@iconlake/client 0.4.0 → 0.5.0

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.
@@ -19,4 +19,4 @@ Proven: ${(0,encoding_1$c.toHex)(e.key)}`);return ics23_1.ics23.CommitmentProof.
19
19
  * limitations under the License.
20
20
  *
21
21
  * SPDX-License-Identifier: Apache-2.0
22
- */var wasm=null;try{wasm=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(e){}function Long(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}Long.prototype.__isLong__,Object.defineProperty(Long.prototype,"__isLong__",{value:!0});function isLong(e){return(e&&e.__isLong__)===!0}function ctz32(e){var t=Math.clz32(e&-e);return e?31-t:t}Long.isLong=isLong;var INT_CACHE={},UINT_CACHE={};function fromInt(e,t){var n,p,u;return t?(e>>>=0,(u=0<=e&&e<256)&&(p=UINT_CACHE[e],p)?p:(n=fromBits(e,0,!0),u&&(UINT_CACHE[e]=n),n)):(e|=0,(u=-128<=e&&e<128)&&(p=INT_CACHE[e],p)?p:(n=fromBits(e,e<0?-1:0,!1),u&&(INT_CACHE[e]=n),n))}Long.fromInt=fromInt;function fromNumber(e,t){if(isNaN(e))return t?UZERO:ZERO;if(t){if(e<0)return UZERO;if(e>=TWO_PWR_64_DBL)return MAX_UNSIGNED_VALUE}else{if(e<=-TWO_PWR_63_DBL)return MIN_VALUE;if(e+1>=TWO_PWR_63_DBL)return MAX_VALUE}return e<0?fromNumber(-e,t).neg():fromBits(e%TWO_PWR_32_DBL|0,e/TWO_PWR_32_DBL|0,t)}Long.fromNumber=fromNumber;function fromBits(e,t,n){return new Long(e,t,n)}Long.fromBits=fromBits;var pow_dbl=Math.pow;function fromString(e,t,n){if(e.length===0)throw Error("empty string");if(typeof t=="number"?(n=t,t=!1):t=!!t,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t?UZERO:ZERO;if(n=n||10,n<2||36<n)throw RangeError("radix");var p;if((p=e.indexOf("-"))>0)throw Error("interior hyphen");if(p===0)return fromString(e.substring(1),t,n).neg();for(var u=fromNumber(pow_dbl(n,8)),g=ZERO,y=0;y<e.length;y+=8){var P=Math.min(8,e.length-y),N=parseInt(e.substring(y,y+P),n);if(P<8){var X=fromNumber(pow_dbl(n,P));g=g.mul(X).add(fromNumber(N))}else g=g.mul(u),g=g.add(fromNumber(N))}return g.unsigned=t,g}Long.fromString=fromString;function fromValue(e,t){return typeof e=="number"?fromNumber(e,t):typeof e=="string"?fromString(e,t):fromBits(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}Long.fromValue=fromValue;var TWO_PWR_16_DBL=65536,TWO_PWR_24_DBL=1<<24,TWO_PWR_32_DBL=TWO_PWR_16_DBL*TWO_PWR_16_DBL,TWO_PWR_64_DBL=TWO_PWR_32_DBL*TWO_PWR_32_DBL,TWO_PWR_63_DBL=TWO_PWR_64_DBL/2,TWO_PWR_24=fromInt(TWO_PWR_24_DBL),ZERO=fromInt(0);Long.ZERO=ZERO;var UZERO=fromInt(0,!0);Long.UZERO=UZERO;var ONE=fromInt(1);Long.ONE=ONE;var UONE=fromInt(1,!0);Long.UONE=UONE;var NEG_ONE=fromInt(-1);Long.NEG_ONE=NEG_ONE;var MAX_VALUE=fromBits(-1,2147483647,!1);Long.MAX_VALUE=MAX_VALUE;var MAX_UNSIGNED_VALUE=fromBits(-1,-1,!0);Long.MAX_UNSIGNED_VALUE=MAX_UNSIGNED_VALUE;var MIN_VALUE=fromBits(0,-2147483648,!1);Long.MIN_VALUE=MIN_VALUE;var LongPrototype=Long.prototype;LongPrototype.toInt=function e(){return this.unsigned?this.low>>>0:this.low},LongPrototype.toNumber=function e(){return this.unsigned?(this.high>>>0)*TWO_PWR_32_DBL+(this.low>>>0):this.high*TWO_PWR_32_DBL+(this.low>>>0)},LongPrototype.toString=function e(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(MIN_VALUE)){var n=fromNumber(t),p=this.div(n),u=p.mul(n).sub(this);return p.toString(t)+u.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var g=fromNumber(pow_dbl(t,6),this.unsigned),y=this,P="";;){var N=y.div(g),X=y.sub(N.mul(g)).toInt()>>>0,se=X.toString(t);if(y=N,y.isZero())return se+P;for(;se.length<6;)se="0"+se;P=""+se+P}},LongPrototype.getHighBits=function e(){return this.high},LongPrototype.getHighBitsUnsigned=function e(){return this.high>>>0},LongPrototype.getLowBits=function e(){return this.low},LongPrototype.getLowBitsUnsigned=function e(){return this.low>>>0},LongPrototype.getNumBitsAbs=function e(){if(this.isNegative())return this.eq(MIN_VALUE)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,n=31;n>0&&!(t&1<<n);n--);return this.high!=0?n+33:n+1},LongPrototype.isZero=function e(){return this.high===0&&this.low===0},LongPrototype.eqz=LongPrototype.isZero,LongPrototype.isNegative=function e(){return!this.unsigned&&this.high<0},LongPrototype.isPositive=function e(){return this.unsigned||this.high>=0},LongPrototype.isOdd=function e(){return(this.low&1)===1},LongPrototype.isEven=function e(){return(this.low&1)===0},LongPrototype.equals=function e(t){return isLong(t)||(t=fromValue(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low},LongPrototype.eq=LongPrototype.equals,LongPrototype.notEquals=function e(t){return!this.eq(t)},LongPrototype.neq=LongPrototype.notEquals,LongPrototype.ne=LongPrototype.notEquals,LongPrototype.lessThan=function e(t){return this.comp(t)<0},LongPrototype.lt=LongPrototype.lessThan,LongPrototype.lessThanOrEqual=function e(t){return this.comp(t)<=0},LongPrototype.lte=LongPrototype.lessThanOrEqual,LongPrototype.le=LongPrototype.lessThanOrEqual,LongPrototype.greaterThan=function e(t){return this.comp(t)>0},LongPrototype.gt=LongPrototype.greaterThan,LongPrototype.greaterThanOrEqual=function e(t){return this.comp(t)>=0},LongPrototype.gte=LongPrototype.greaterThanOrEqual,LongPrototype.ge=LongPrototype.greaterThanOrEqual,LongPrototype.compare=function e(t){if(isLong(t)||(t=fromValue(t)),this.eq(t))return 0;var n=this.isNegative(),p=t.isNegative();return n&&!p?-1:!n&&p?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},LongPrototype.comp=LongPrototype.compare,LongPrototype.negate=function e(){return!this.unsigned&&this.eq(MIN_VALUE)?MIN_VALUE:this.not().add(ONE)},LongPrototype.neg=LongPrototype.negate,LongPrototype.add=function e(t){isLong(t)||(t=fromValue(t));var n=this.high>>>16,p=this.high&65535,u=this.low>>>16,g=this.low&65535,y=t.high>>>16,P=t.high&65535,N=t.low>>>16,X=t.low&65535,se=0,Ae=0,fe=0,C=0;return C+=g+X,fe+=C>>>16,C&=65535,fe+=u+N,Ae+=fe>>>16,fe&=65535,Ae+=p+P,se+=Ae>>>16,Ae&=65535,se+=n+y,se&=65535,fromBits(fe<<16|C,se<<16|Ae,this.unsigned)},LongPrototype.subtract=function e(t){return isLong(t)||(t=fromValue(t)),this.add(t.neg())},LongPrototype.sub=LongPrototype.subtract,LongPrototype.multiply=function e(t){if(this.isZero())return this;if(isLong(t)||(t=fromValue(t)),wasm){var n=wasm.mul(this.low,this.high,t.low,t.high);return fromBits(n,wasm.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?UZERO:ZERO;if(this.eq(MIN_VALUE))return t.isOdd()?MIN_VALUE:ZERO;if(t.eq(MIN_VALUE))return this.isOdd()?MIN_VALUE:ZERO;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(TWO_PWR_24)&&t.lt(TWO_PWR_24))return fromNumber(this.toNumber()*t.toNumber(),this.unsigned);var p=this.high>>>16,u=this.high&65535,g=this.low>>>16,y=this.low&65535,P=t.high>>>16,N=t.high&65535,X=t.low>>>16,se=t.low&65535,Ae=0,fe=0,C=0,re=0;return re+=y*se,C+=re>>>16,re&=65535,C+=g*se,fe+=C>>>16,C&=65535,C+=y*X,fe+=C>>>16,C&=65535,fe+=u*se,Ae+=fe>>>16,fe&=65535,fe+=g*X,Ae+=fe>>>16,fe&=65535,fe+=y*N,Ae+=fe>>>16,fe&=65535,Ae+=p*se+u*X+g*N+y*P,Ae&=65535,fromBits(C<<16|re,Ae<<16|fe,this.unsigned)},LongPrototype.mul=LongPrototype.multiply,LongPrototype.divide=function e(t){if(isLong(t)||(t=fromValue(t)),t.isZero())throw Error("division by zero");if(wasm){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var n=(this.unsigned?wasm.div_u:wasm.div_s)(this.low,this.high,t.low,t.high);return fromBits(n,wasm.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?UZERO:ZERO;var p,u,g;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return UZERO;if(t.gt(this.shru(1)))return UONE;g=UZERO}else{if(this.eq(MIN_VALUE)){if(t.eq(ONE)||t.eq(NEG_ONE))return MIN_VALUE;if(t.eq(MIN_VALUE))return ONE;var y=this.shr(1);return p=y.div(t).shl(1),p.eq(ZERO)?t.isNegative()?ONE:NEG_ONE:(u=this.sub(t.mul(p)),g=p.add(u.div(t)),g)}else if(t.eq(MIN_VALUE))return this.unsigned?UZERO:ZERO;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();g=ZERO}for(u=this;u.gte(t);){p=Math.max(1,Math.floor(u.toNumber()/t.toNumber()));for(var P=Math.ceil(Math.log(p)/Math.LN2),N=P<=48?1:pow_dbl(2,P-48),X=fromNumber(p),se=X.mul(t);se.isNegative()||se.gt(u);)p-=N,X=fromNumber(p,this.unsigned),se=X.mul(t);X.isZero()&&(X=ONE),g=g.add(X),u=u.sub(se)}return g},LongPrototype.div=LongPrototype.divide,LongPrototype.modulo=function e(t){if(isLong(t)||(t=fromValue(t)),wasm){var n=(this.unsigned?wasm.rem_u:wasm.rem_s)(this.low,this.high,t.low,t.high);return fromBits(n,wasm.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},LongPrototype.mod=LongPrototype.modulo,LongPrototype.rem=LongPrototype.modulo,LongPrototype.not=function e(){return fromBits(~this.low,~this.high,this.unsigned)},LongPrototype.countLeadingZeros=function e(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},LongPrototype.clz=LongPrototype.countLeadingZeros,LongPrototype.countTrailingZeros=function e(){return this.low?ctz32(this.low):ctz32(this.high)+32},LongPrototype.ctz=LongPrototype.countTrailingZeros,LongPrototype.and=function e(t){return isLong(t)||(t=fromValue(t)),fromBits(this.low&t.low,this.high&t.high,this.unsigned)},LongPrototype.or=function e(t){return isLong(t)||(t=fromValue(t)),fromBits(this.low|t.low,this.high|t.high,this.unsigned)},LongPrototype.xor=function e(t){return isLong(t)||(t=fromValue(t)),fromBits(this.low^t.low,this.high^t.high,this.unsigned)},LongPrototype.shiftLeft=function e(t){return isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?fromBits(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):fromBits(0,this.low<<t-32,this.unsigned)},LongPrototype.shl=LongPrototype.shiftLeft,LongPrototype.shiftRight=function e(t){return isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?fromBits(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):fromBits(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},LongPrototype.shr=LongPrototype.shiftRight,LongPrototype.shiftRightUnsigned=function e(t){return isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?fromBits(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?fromBits(this.high,0,this.unsigned):fromBits(this.high>>>t-32,0,this.unsigned)},LongPrototype.shru=LongPrototype.shiftRightUnsigned,LongPrototype.shr_u=LongPrototype.shiftRightUnsigned,LongPrototype.rotateLeft=function e(t){var n;return isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?fromBits(this.high,this.low,this.unsigned):t<32?(n=32-t,fromBits(this.low<<t|this.high>>>n,this.high<<t|this.low>>>n,this.unsigned)):(t-=32,n=32-t,fromBits(this.high<<t|this.low>>>n,this.low<<t|this.high>>>n,this.unsigned))},LongPrototype.rotl=LongPrototype.rotateLeft,LongPrototype.rotateRight=function e(t){var n;return isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?fromBits(this.high,this.low,this.unsigned):t<32?(n=32-t,fromBits(this.high<<n|this.low>>>t,this.low<<n|this.high>>>t,this.unsigned)):(t-=32,n=32-t,fromBits(this.low<<n|this.high>>>t,this.high<<n|this.low>>>t,this.unsigned))},LongPrototype.rotr=LongPrototype.rotateRight,LongPrototype.toSigned=function e(){return this.unsigned?fromBits(this.low,this.high,!1):this},LongPrototype.toUnsigned=function e(){return this.unsigned?this:fromBits(this.low,this.high,!0)},LongPrototype.toBytes=function e(t){return t?this.toBytesLE():this.toBytesBE()},LongPrototype.toBytesLE=function e(){var t=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]},LongPrototype.toBytesBE=function e(){var t=this.high,n=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,n>>>24,n>>>16&255,n>>>8&255,n&255]},Long.fromBytes=function e(t,n,p){return p?Long.fromBytesLE(t,n):Long.fromBytesBE(t,n)},Long.fromBytesLE=function e(t,n){return new Long(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,n)},Long.fromBytesBE=function e(t,n){return new Long(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],n)};var indexMinimal={},minimal$1={},longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=t;var e=requireMinimal();function t(g,y){this.lo=g>>>0,this.hi=y>>>0}var n=t.zero=new t(0,0);n.toNumber=function(){return 0},n.zzEncode=n.zzDecode=function(){return this},n.length=function(){return 1};var p=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(y){if(y===0)return n;var P=y<0;P&&(y=-y);var N=y>>>0,X=(y-N)/4294967296>>>0;return P&&(X=~X>>>0,N=~N>>>0,++N>4294967295&&(N=0,++X>4294967295&&(X=0))),new t(N,X)},t.from=function(y){if(typeof y=="number")return t.fromNumber(y);if(e.isString(y))if(e.Long)y=e.Long.fromString(y);else return t.fromNumber(parseInt(y,10));return y.low||y.high?new t(y.low>>>0,y.high>>>0):n},t.prototype.toNumber=function(y){if(!y&&this.hi>>>31){var P=~this.lo+1>>>0,N=~this.hi>>>0;return P||(N=N+1>>>0),-(P+N*4294967296)}return this.lo+this.hi*4294967296},t.prototype.toLong=function(y){return e.Long?new e.Long(this.lo|0,this.hi|0,!!y):{low:this.lo|0,high:this.hi|0,unsigned:!!y}};var u=String.prototype.charCodeAt;return t.fromHash=function(y){return y===p?n:new t((u.call(y,0)|u.call(y,1)<<8|u.call(y,2)<<16|u.call(y,3)<<24)>>>0,(u.call(y,4)|u.call(y,5)<<8|u.call(y,6)<<16|u.call(y,7)<<24)>>>0)},t.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)},t.prototype.zzEncode=function(){var y=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^y)>>>0,this.lo=(this.lo<<1^y)>>>0,this},t.prototype.zzDecode=function(){var y=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^y)>>>0,this.hi=(this.hi>>>1^y)>>>0,this},t.prototype.length=function(){var y=this.lo,P=(this.lo>>>28|this.hi<<4)>>>0,N=this.hi>>>24;return N===0?P===0?y<16384?y<128?1:2:y<2097152?3:4:P<16384?P<128?5:6:P<2097152?7:8:N<128?9:10},longbits}var hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,function(e){var t=e;t.asPromise=aspromise,t.base64=base64$3,t.EventEmitter=eventemitter,t.float=float,t.inquire=inquire_1,t.utf8=utf8$5,t.pool=pool_1,t.LongBits=requireLongbits(),t.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),t.global=t.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||commonjsGlobal,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(g){return typeof g=="number"&&isFinite(g)&&Math.floor(g)===g},t.isString=function(g){return typeof g=="string"||g instanceof String},t.isObject=function(g){return g&&typeof g=="object"},t.isset=t.isSet=function(g,y){var P=g[y];return P!=null&&g.hasOwnProperty(y)?typeof P!="object"||(Array.isArray(P)?P.length:Object.keys(P).length)>0:!1},t.Buffer=function(){try{var u=t.inquire("buffer").Buffer;return u.prototype.utf8Write?u:null}catch{return null}}(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(g){return typeof g=="number"?t.Buffer?t._Buffer_allocUnsafe(g):new t.Array(g):t.Buffer?t._Buffer_from(g):typeof Uint8Array>"u"?g:new Uint8Array(g)},t.Array=typeof Uint8Array<"u"?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire("long"),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(g){return g?t.LongBits.from(g).toHash():t.LongBits.zeroHash},t.longFromHash=function(g,y){var P=t.LongBits.fromHash(g);return t.Long?t.Long.fromBits(P.lo,P.hi,y):P.toNumber(!!y)};function n(u,g,y){for(var P=Object.keys(g),N=0;N<P.length;++N)(u[P[N]]===void 0||!y)&&(u[P[N]]=g[P[N]]);return u}t.merge=n,t.lcFirst=function(g){return g.charAt(0).toLowerCase()+g.substring(1)};function p(u){function g(y,P){if(!(this instanceof g))return new g(y,P);Object.defineProperty(this,"message",{get:function(){return y}}),Error.captureStackTrace?Error.captureStackTrace(this,g):Object.defineProperty(this,"stack",{value:new Error().stack||""}),P&&n(this,P)}return g.prototype=Object.create(Error.prototype,{constructor:{value:g,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return u},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),g}t.newError=p,t.ProtocolError=p("ProtocolError"),t.oneOfGetter=function(g){for(var y={},P=0;P<g.length;++P)y[g[P]]=1;return function(){for(var N=Object.keys(this),X=N.length-1;X>-1;--X)if(y[N[X]]===1&&this[N[X]]!==void 0&&this[N[X]]!==null)return N[X]}},t.oneOfSetter=function(g){return function(y){for(var P=0;P<g.length;++P)g[P]!==y&&delete this[g[P]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var u=t.Buffer;if(!u){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=u.from!==Uint8Array.from&&u.from||function(y,P){return new u(y,P)},t._Buffer_allocUnsafe=u.allocUnsafe||function(y){return new u(y)}}}(minimal$1)),minimal$1}var writer=Writer$1,util$4=requireMinimal(),BufferWriter$1,LongBits$1=util$4.LongBits,base64=util$4.base64,utf8$1=util$4.utf8;function Op(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function noop(){}function State(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function Writer$1(){this.len=0,this.head=new Op(noop,0,0),this.tail=this.head,this.states=null}var create$1=function e(){return util$4.Buffer?function(){return(Writer$1.create=function(){return new BufferWriter$1})()}:function(){return new Writer$1}};Writer$1.create=create$1(),Writer$1.alloc=function e(t){return new util$4.Array(t)},util$4.Array!==Array&&(Writer$1.alloc=util$4.pool(Writer$1.alloc,util$4.Array.prototype.subarray)),Writer$1.prototype._push=function e(t,n,p){return this.tail=this.tail.next=new Op(t,n,p),this.len+=n,this};function writeByte(e,t,n){t[n]=e&255}function writeVarint32(e,t,n){for(;e>127;)t[n++]=e&127|128,e>>>=7;t[n]=e}function VarintOp(e,t){this.len=e,this.next=void 0,this.val=t}VarintOp.prototype=Object.create(Op.prototype),VarintOp.prototype.fn=writeVarint32,Writer$1.prototype.uint32=function e(t){return this.len+=(this.tail=this.tail.next=new VarintOp((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},Writer$1.prototype.int32=function e(t){return t<0?this._push(writeVarint64,10,LongBits$1.fromNumber(t)):this.uint32(t)},Writer$1.prototype.sint32=function e(t){return this.uint32((t<<1^t>>31)>>>0)};function writeVarint64(e,t,n){for(;e.hi;)t[n++]=e.lo&127|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=e.lo&127|128,e.lo=e.lo>>>7;t[n++]=e.lo}Writer$1.prototype.uint64=function e(t){var n=LongBits$1.from(t);return this._push(writeVarint64,n.length(),n)},Writer$1.prototype.int64=Writer$1.prototype.uint64,Writer$1.prototype.sint64=function e(t){var n=LongBits$1.from(t).zzEncode();return this._push(writeVarint64,n.length(),n)},Writer$1.prototype.bool=function e(t){return this._push(writeByte,1,t?1:0)};function writeFixed32(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}Writer$1.prototype.fixed32=function e(t){return this._push(writeFixed32,4,t>>>0)},Writer$1.prototype.sfixed32=Writer$1.prototype.fixed32,Writer$1.prototype.fixed64=function e(t){var n=LongBits$1.from(t);return this._push(writeFixed32,4,n.lo)._push(writeFixed32,4,n.hi)},Writer$1.prototype.sfixed64=Writer$1.prototype.fixed64,Writer$1.prototype.float=function e(t){return this._push(util$4.float.writeFloatLE,4,t)},Writer$1.prototype.double=function e(t){return this._push(util$4.float.writeDoubleLE,8,t)};var writeBytes=util$4.Array.prototype.set?function e(t,n,p){n.set(t,p)}:function e(t,n,p){for(var u=0;u<t.length;++u)n[p+u]=t[u]};Writer$1.prototype.bytes=function e(t){var n=t.length>>>0;if(!n)return this._push(writeByte,1,0);if(util$4.isString(t)){var p=Writer$1.alloc(n=base64.length(t));base64.decode(t,p,0),t=p}return this.uint32(n)._push(writeBytes,n,t)},Writer$1.prototype.string=function e(t){var n=utf8$1.length(t);return n?this.uint32(n)._push(utf8$1.write,n,t):this._push(writeByte,1,0)},Writer$1.prototype.fork=function e(){return this.states=new State(this),this.head=this.tail=new Op(noop,0,0),this.len=0,this},Writer$1.prototype.reset=function e(){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 Op(noop,0,0),this.len=0),this},Writer$1.prototype.ldelim=function e(){var t=this.head,n=this.tail,p=this.len;return this.reset().uint32(p),p&&(this.tail.next=t.next,this.tail=n,this.len+=p),this},Writer$1.prototype.finish=function e(){for(var t=this.head.next,n=this.constructor.alloc(this.len),p=0;t;)t.fn(t.val,n,p),p+=t.len,t=t.next;return n},Writer$1._configure=function(e){BufferWriter$1=e,Writer$1.create=create$1(),BufferWriter$1._configure()};var writer_buffer=BufferWriter,Writer=writer;(BufferWriter.prototype=Object.create(Writer.prototype)).constructor=BufferWriter;var util$3=requireMinimal();function BufferWriter(){Writer.call(this)}BufferWriter._configure=function(){BufferWriter.alloc=util$3._Buffer_allocUnsafe,BufferWriter.writeBytesBuffer=util$3.Buffer&&util$3.Buffer.prototype instanceof Uint8Array&&util$3.Buffer.prototype.set.name==="set"?function(t,n,p){n.set(t,p)}:function(t,n,p){if(t.copy)t.copy(n,p,0,t.length);else for(var u=0;u<t.length;)n[p++]=t[u++]}},BufferWriter.prototype.bytes=function e(t){util$3.isString(t)&&(t=util$3._Buffer_from(t,"base64"));var n=t.length>>>0;return this.uint32(n),n&&this._push(BufferWriter.writeBytesBuffer,n,t),this};function writeStringBuffer(e,t,n){e.length<40?util$3.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}BufferWriter.prototype.string=function e(t){var n=util$3.Buffer.byteLength(t);return this.uint32(n),n&&this._push(writeStringBuffer,n,t),this},BufferWriter._configure();var reader=Reader$1,util$2=requireMinimal(),BufferReader$1,LongBits=util$2.LongBits,utf8=util$2.utf8;function indexOutOfRange(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function Reader$1(e){this.buf=e,this.pos=0,this.len=e.length}var create_array=typeof Uint8Array<"u"?function e(t){if(t instanceof Uint8Array||Array.isArray(t))return new Reader$1(t);throw Error("illegal buffer")}:function e(t){if(Array.isArray(t))return new Reader$1(t);throw Error("illegal buffer")},create=function e(){return util$2.Buffer?function(n){return(Reader$1.create=function(u){return util$2.Buffer.isBuffer(u)?new BufferReader$1(u):create_array(u)})(n)}:create_array};Reader$1.create=create(),Reader$1.prototype._slice=util$2.Array.prototype.subarray||util$2.Array.prototype.slice,Reader$1.prototype.uint32=function e(){var t=4294967295;return function(){if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return t}}(),Reader$1.prototype.int32=function e(){return this.uint32()|0},Reader$1.prototype.sint32=function e(){var t=this.uint32();return t>>>1^-(t&1)|0};function readLongVarint(){var e=new LongBits(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*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;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}Reader$1.prototype.bool=function e(){return this.uint32()!==0};function readFixed32_end(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}Reader$1.prototype.fixed32=function e(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)},Reader$1.prototype.sfixed32=function e(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)|0};function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader$1.prototype.float=function e(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var t=util$2.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},Reader$1.prototype.double=function e(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var t=util$2.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},Reader$1.prototype.bytes=function e(){var t=this.uint32(),n=this.pos,p=this.pos+t;if(p>this.len)throw indexOutOfRange(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(n,p):n===p?new this.buf.constructor(0):this._slice.call(this.buf,n,p)},Reader$1.prototype.string=function e(){var t=this.bytes();return utf8.read(t,0,t.length)},Reader$1.prototype.skip=function e(t){if(typeof t=="number"){if(this.pos+t>this.len)throw indexOutOfRange(this,t);this.pos+=t}else do if(this.pos>=this.len)throw indexOutOfRange(this);while(this.buf[this.pos++]&128);return this},Reader$1.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},Reader$1._configure=function(e){BufferReader$1=e,Reader$1.create=create(),BufferReader$1._configure();var t=util$2.Long?"toLong":"toNumber";util$2.merge(Reader$1.prototype,{int64:function(){return readLongVarint.call(this)[t](!1)},uint64:function(){return readLongVarint.call(this)[t](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[t](!1)},fixed64:function(){return readFixed64.call(this)[t](!0)},sfixed64:function(){return readFixed64.call(this)[t](!1)}})};var reader_buffer=BufferReader,Reader=reader;(BufferReader.prototype=Object.create(Reader.prototype)).constructor=BufferReader;var util$1=requireMinimal();function BufferReader(e){Reader.call(this,e)}BufferReader._configure=function(){util$1.Buffer&&(BufferReader.prototype._slice=util$1.Buffer.prototype.slice)},BufferReader.prototype.string=function e(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},BufferReader._configure();var rpc={},service=Service,util=requireMinimal();(Service.prototype=Object.create(util.EventEmitter.prototype)).constructor=Service;function Service(e,t,n){if(typeof e!="function")throw TypeError("rpcImpl must be a function");util.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!n}Service.prototype.rpcCall=function e(t,n,p,u,g){if(!u)throw TypeError("request must be specified");var y=this;if(!g)return util.asPromise(e,y,t,n,p,u);if(!y.rpcImpl){setTimeout(function(){g(Error("already ended"))},0);return}try{return y.rpcImpl(t,n[y.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(N,X){if(N)return y.emit("error",N,t),g(N);if(X===null){y.end(!0);return}if(!(X instanceof p))try{X=p[y.responseDelimited?"decodeDelimited":"decode"](X)}catch(se){return y.emit("error",se,t),g(se)}return y.emit("data",X,t),g(null,X)})}catch(P){y.emit("error",P,t),setTimeout(function(){g(P)},0);return}},Service.prototype.end=function e(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},function(e){var t=e;t.Service=service}(rpc);var roots={};(function(e){var t=e;t.build="minimal",t.Writer=writer,t.BufferWriter=writer_buffer,t.Reader=reader,t.BufferReader=reader_buffer,t.util=requireMinimal(),t.rpc=rpc,t.roots=roots,t.configure=n;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}n()})(indexMinimal);var minimal=indexMinimal;const _m0=getDefaultExportFromCjs(minimal);function createBaseAny$d(){return{typeUrl:"",value:new Uint8Array}}const Any$d={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$d();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$1S(e.typeUrl)?String(e.typeUrl):"",value:isSet$1S(e.value)?bytesFromBase64$w(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$w(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$d();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$1y=(()=>{if(typeof globalThis$1y<"u")return globalThis$1y;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$w(e){if(globalThis$1y.Buffer)return Uint8Array.from(globalThis$1y.Buffer.from(e,"base64"));{const t=globalThis$1y.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$w(e){if(globalThis$1y.Buffer)return globalThis$1y.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$1y.btoa(t.join(""))}}function isSet$1S(e){return e!=null}function createBaseBaseAccount$1(){return{address:"",pubKey:void 0,accountNumber:0,sequence:0}}const BaseAccount$1={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.pubKey!==void 0&&Any$d.encode(e.pubKey,t.uint32(18).fork()).ldelim(),e.accountNumber!==0&&t.uint32(24).uint64(e.accountNumber),e.sequence!==0&&t.uint32(32).uint64(e.sequence),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseBaseAccount$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.pubKey=Any$d.decode(n,n.uint32());break;case 3:u.accountNumber=longToNumber$Z(n.uint64());break;case 4:u.sequence=longToNumber$Z(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$1R(e.address)?String(e.address):"",pubKey:isSet$1R(e.pubKey)?Any$d.fromJSON(e.pubKey):void 0,accountNumber:isSet$1R(e.accountNumber)?Number(e.accountNumber):0,sequence:isSet$1R(e.sequence)?Number(e.sequence):0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.pubKey!==void 0&&(t.pubKey=e.pubKey?Any$d.toJSON(e.pubKey):void 0),e.accountNumber!==void 0&&(t.accountNumber=Math.round(e.accountNumber)),e.sequence!==void 0&&(t.sequence=Math.round(e.sequence)),t},fromPartial(e){const t=createBaseBaseAccount$1();return t.address=e.address??"",t.pubKey=e.pubKey!==void 0&&e.pubKey!==null?Any$d.fromPartial(e.pubKey):void 0,t.accountNumber=e.accountNumber??0,t.sequence=e.sequence??0,t}};function createBaseModuleAccount(){return{baseAccount:void 0,name:"",permissions:[]}}const ModuleAccount={encode(e,t=_m0.Writer.create()){e.baseAccount!==void 0&&BaseAccount$1.encode(e.baseAccount,t.uint32(10).fork()).ldelim(),e.name!==""&&t.uint32(18).string(e.name);for(const n of e.permissions)t.uint32(26).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseModuleAccount();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.baseAccount=BaseAccount$1.decode(n,n.uint32());break;case 2:u.name=n.string();break;case 3:u.permissions.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{baseAccount:isSet$1R(e.baseAccount)?BaseAccount$1.fromJSON(e.baseAccount):void 0,name:isSet$1R(e.name)?String(e.name):"",permissions:Array.isArray(e==null?void 0:e.permissions)?e.permissions.map(t=>String(t)):[]}},toJSON(e){const t={};return e.baseAccount!==void 0&&(t.baseAccount=e.baseAccount?BaseAccount$1.toJSON(e.baseAccount):void 0),e.name!==void 0&&(t.name=e.name),e.permissions?t.permissions=e.permissions.map(n=>n):t.permissions=[],t},fromPartial(e){var n;const t=createBaseModuleAccount();return t.baseAccount=e.baseAccount!==void 0&&e.baseAccount!==null?BaseAccount$1.fromPartial(e.baseAccount):void 0,t.name=e.name??"",t.permissions=((n=e.permissions)==null?void 0:n.map(p=>p))||[],t}};function createBaseModuleCredential(){return{moduleName:"",derivationKeys:[]}}const ModuleCredential={encode(e,t=_m0.Writer.create()){e.moduleName!==""&&t.uint32(10).string(e.moduleName);for(const n of e.derivationKeys)t.uint32(18).bytes(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseModuleCredential();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.moduleName=n.string();break;case 2:u.derivationKeys.push(n.bytes());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{moduleName:isSet$1R(e.moduleName)?String(e.moduleName):"",derivationKeys:Array.isArray(e==null?void 0:e.derivationKeys)?e.derivationKeys.map(t=>bytesFromBase64$v(t)):[]}},toJSON(e){const t={};return e.moduleName!==void 0&&(t.moduleName=e.moduleName),e.derivationKeys?t.derivationKeys=e.derivationKeys.map(n=>base64FromBytes$v(n!==void 0?n:new Uint8Array)):t.derivationKeys=[],t},fromPartial(e){var n;const t=createBaseModuleCredential();return t.moduleName=e.moduleName??"",t.derivationKeys=((n=e.derivationKeys)==null?void 0:n.map(p=>p))||[],t}};function createBaseParams$d(){return{maxMemoCharacters:0,txSigLimit:0,txSizeCostPerByte:0,sigVerifyCostEd25519:0,sigVerifyCostSecp256k1:0}}const Params$d={encode(e,t=_m0.Writer.create()){return e.maxMemoCharacters!==0&&t.uint32(8).uint64(e.maxMemoCharacters),e.txSigLimit!==0&&t.uint32(16).uint64(e.txSigLimit),e.txSizeCostPerByte!==0&&t.uint32(24).uint64(e.txSizeCostPerByte),e.sigVerifyCostEd25519!==0&&t.uint32(32).uint64(e.sigVerifyCostEd25519),e.sigVerifyCostSecp256k1!==0&&t.uint32(40).uint64(e.sigVerifyCostSecp256k1),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$d();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.maxMemoCharacters=longToNumber$Z(n.uint64());break;case 2:u.txSigLimit=longToNumber$Z(n.uint64());break;case 3:u.txSizeCostPerByte=longToNumber$Z(n.uint64());break;case 4:u.sigVerifyCostEd25519=longToNumber$Z(n.uint64());break;case 5:u.sigVerifyCostSecp256k1=longToNumber$Z(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{maxMemoCharacters:isSet$1R(e.maxMemoCharacters)?Number(e.maxMemoCharacters):0,txSigLimit:isSet$1R(e.txSigLimit)?Number(e.txSigLimit):0,txSizeCostPerByte:isSet$1R(e.txSizeCostPerByte)?Number(e.txSizeCostPerByte):0,sigVerifyCostEd25519:isSet$1R(e.sigVerifyCostEd25519)?Number(e.sigVerifyCostEd25519):0,sigVerifyCostSecp256k1:isSet$1R(e.sigVerifyCostSecp256k1)?Number(e.sigVerifyCostSecp256k1):0}},toJSON(e){const t={};return e.maxMemoCharacters!==void 0&&(t.maxMemoCharacters=Math.round(e.maxMemoCharacters)),e.txSigLimit!==void 0&&(t.txSigLimit=Math.round(e.txSigLimit)),e.txSizeCostPerByte!==void 0&&(t.txSizeCostPerByte=Math.round(e.txSizeCostPerByte)),e.sigVerifyCostEd25519!==void 0&&(t.sigVerifyCostEd25519=Math.round(e.sigVerifyCostEd25519)),e.sigVerifyCostSecp256k1!==void 0&&(t.sigVerifyCostSecp256k1=Math.round(e.sigVerifyCostSecp256k1)),t},fromPartial(e){const t=createBaseParams$d();return t.maxMemoCharacters=e.maxMemoCharacters??0,t.txSigLimit=e.txSigLimit??0,t.txSizeCostPerByte=e.txSizeCostPerByte??0,t.sigVerifyCostEd25519=e.sigVerifyCostEd25519??0,t.sigVerifyCostSecp256k1=e.sigVerifyCostSecp256k1??0,t}};var globalThis$1x=(()=>{if(typeof globalThis$1x<"u")return globalThis$1x;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$v(e){if(globalThis$1x.Buffer)return Uint8Array.from(globalThis$1x.Buffer.from(e,"base64"));{const t=globalThis$1x.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$v(e){if(globalThis$1x.Buffer)return globalThis$1x.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$1x.btoa(t.join(""))}}function longToNumber$Z(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1x.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1R(e){return e!=null}new build$b.Registry(msgTypes$s);function getStructure$p(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$s=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$s=({addr:e}={addr:"http://localhost:1317"})=>new Api$s({baseURL:e});let SDKModule$s=class{constructor(t){this.registry=[],this.query=queryClient$s({addr:t.env.apiURL}),this.updateTX(t),this.structure={BaseAccount:getStructure$p(BaseAccount$1.fromPartial({})),ModuleAccount:getStructure$p(ModuleAccount.fromPartial({})),ModuleCredential:getStructure$p(ModuleCredential.fromPartial({})),Params:getStructure$p(Params$d.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$s({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$t=e=>({module:{CosmosAuthV1Beta1:new SDKModule$s(e)},registry:msgTypes$s});function createBaseAny$c(){return{typeUrl:"",value:new Uint8Array}}const Any$c={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$c();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$1Q(e.typeUrl)?String(e.typeUrl):"",value:isSet$1Q(e.value)?bytesFromBase64$u(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$u(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$c();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$1w=(()=>{if(typeof globalThis$1w<"u")return globalThis$1w;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$u(e){if(globalThis$1w.Buffer)return Uint8Array.from(globalThis$1w.Buffer.from(e,"base64"));{const t=globalThis$1w.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$u(e){if(globalThis$1w.Buffer)return globalThis$1w.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$1w.btoa(t.join(""))}}function isSet$1Q(e){return e!=null}function createBaseTimestamp$a(){return{seconds:0,nanos:0}}const Timestamp$a={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp$a();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$Y(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$1P(e.seconds)?Number(e.seconds):0,nanos:isSet$1P(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp$a();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$1v=(()=>{if(typeof globalThis$1v<"u")return globalThis$1v;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$Y(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1v.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1P(e){return e!=null}function createBaseGenericAuthorization(){return{msg:""}}const GenericAuthorization={encode(e,t=_m0.Writer.create()){return e.msg!==""&&t.uint32(10).string(e.msg),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseGenericAuthorization();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.msg=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{msg:isSet$1O(e.msg)?String(e.msg):""}},toJSON(e){const t={};return e.msg!==void 0&&(t.msg=e.msg),t},fromPartial(e){const t=createBaseGenericAuthorization();return t.msg=e.msg??"",t}};function createBaseGrant$1(){return{authorization:void 0,expiration:void 0}}const Grant$1={encode(e,t=_m0.Writer.create()){return e.authorization!==void 0&&Any$c.encode(e.authorization,t.uint32(10).fork()).ldelim(),e.expiration!==void 0&&Timestamp$a.encode(toTimestamp$d(e.expiration),t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseGrant$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.authorization=Any$c.decode(n,n.uint32());break;case 2:u.expiration=fromTimestamp$d(Timestamp$a.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{authorization:isSet$1O(e.authorization)?Any$c.fromJSON(e.authorization):void 0,expiration:isSet$1O(e.expiration)?fromJsonTimestamp$d(e.expiration):void 0}},toJSON(e){const t={};return e.authorization!==void 0&&(t.authorization=e.authorization?Any$c.toJSON(e.authorization):void 0),e.expiration!==void 0&&(t.expiration=e.expiration.toISOString()),t},fromPartial(e){const t=createBaseGrant$1();return t.authorization=e.authorization!==void 0&&e.authorization!==null?Any$c.fromPartial(e.authorization):void 0,t.expiration=e.expiration??void 0,t}};function createBaseGrantAuthorization(){return{granter:"",grantee:"",authorization:void 0,expiration:void 0}}const GrantAuthorization={encode(e,t=_m0.Writer.create()){return e.granter!==""&&t.uint32(10).string(e.granter),e.grantee!==""&&t.uint32(18).string(e.grantee),e.authorization!==void 0&&Any$c.encode(e.authorization,t.uint32(26).fork()).ldelim(),e.expiration!==void 0&&Timestamp$a.encode(toTimestamp$d(e.expiration),t.uint32(34).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseGrantAuthorization();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.granter=n.string();break;case 2:u.grantee=n.string();break;case 3:u.authorization=Any$c.decode(n,n.uint32());break;case 4:u.expiration=fromTimestamp$d(Timestamp$a.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{granter:isSet$1O(e.granter)?String(e.granter):"",grantee:isSet$1O(e.grantee)?String(e.grantee):"",authorization:isSet$1O(e.authorization)?Any$c.fromJSON(e.authorization):void 0,expiration:isSet$1O(e.expiration)?fromJsonTimestamp$d(e.expiration):void 0}},toJSON(e){const t={};return e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),e.authorization!==void 0&&(t.authorization=e.authorization?Any$c.toJSON(e.authorization):void 0),e.expiration!==void 0&&(t.expiration=e.expiration.toISOString()),t},fromPartial(e){const t=createBaseGrantAuthorization();return t.granter=e.granter??"",t.grantee=e.grantee??"",t.authorization=e.authorization!==void 0&&e.authorization!==null?Any$c.fromPartial(e.authorization):void 0,t.expiration=e.expiration??void 0,t}};function createBaseGrantQueueItem(){return{msgTypeUrls:[]}}const GrantQueueItem={encode(e,t=_m0.Writer.create()){for(const n of e.msgTypeUrls)t.uint32(10).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseGrantQueueItem();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.msgTypeUrls.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{msgTypeUrls:Array.isArray(e==null?void 0:e.msgTypeUrls)?e.msgTypeUrls.map(t=>String(t)):[]}},toJSON(e){const t={};return e.msgTypeUrls?t.msgTypeUrls=e.msgTypeUrls.map(n=>n):t.msgTypeUrls=[],t},fromPartial(e){var n;const t=createBaseGrantQueueItem();return t.msgTypeUrls=((n=e.msgTypeUrls)==null?void 0:n.map(p=>p))||[],t}};function toTimestamp$d(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$d(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$d(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$d(Timestamp$a.fromJSON(e))}function isSet$1O(e){return e!=null}function createBaseMsgGrant(){return{granter:"",grantee:"",grant:void 0}}const MsgGrant={encode(e,t=_m0.Writer.create()){return e.granter!==""&&t.uint32(10).string(e.granter),e.grantee!==""&&t.uint32(18).string(e.grantee),e.grant!==void 0&&Grant$1.encode(e.grant,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgGrant();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.granter=n.string();break;case 2:u.grantee=n.string();break;case 3:u.grant=Grant$1.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{granter:isSet$1N(e.granter)?String(e.granter):"",grantee:isSet$1N(e.grantee)?String(e.grantee):"",grant:isSet$1N(e.grant)?Grant$1.fromJSON(e.grant):void 0}},toJSON(e){const t={};return e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),e.grant!==void 0&&(t.grant=e.grant?Grant$1.toJSON(e.grant):void 0),t},fromPartial(e){const t=createBaseMsgGrant();return t.granter=e.granter??"",t.grantee=e.grantee??"",t.grant=e.grant!==void 0&&e.grant!==null?Grant$1.fromPartial(e.grant):void 0,t}};function createBaseMsgExec$1(){return{grantee:"",msgs:[]}}const MsgExec$1={encode(e,t=_m0.Writer.create()){e.grantee!==""&&t.uint32(10).string(e.grantee);for(const n of e.msgs)Any$c.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgExec$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.grantee=n.string();break;case 2:u.msgs.push(Any$c.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{grantee:isSet$1N(e.grantee)?String(e.grantee):"",msgs:Array.isArray(e==null?void 0:e.msgs)?e.msgs.map(t=>Any$c.fromJSON(t)):[]}},toJSON(e){const t={};return e.grantee!==void 0&&(t.grantee=e.grantee),e.msgs?t.msgs=e.msgs.map(n=>n?Any$c.toJSON(n):void 0):t.msgs=[],t},fromPartial(e){var n;const t=createBaseMsgExec$1();return t.grantee=e.grantee??"",t.msgs=((n=e.msgs)==null?void 0:n.map(p=>Any$c.fromPartial(p)))||[],t}};function createBaseMsgRevoke(){return{granter:"",grantee:"",msgTypeUrl:""}}const MsgRevoke={encode(e,t=_m0.Writer.create()){return e.granter!==""&&t.uint32(10).string(e.granter),e.grantee!==""&&t.uint32(18).string(e.grantee),e.msgTypeUrl!==""&&t.uint32(26).string(e.msgTypeUrl),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgRevoke();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.granter=n.string();break;case 2:u.grantee=n.string();break;case 3:u.msgTypeUrl=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{granter:isSet$1N(e.granter)?String(e.granter):"",grantee:isSet$1N(e.grantee)?String(e.grantee):"",msgTypeUrl:isSet$1N(e.msgTypeUrl)?String(e.msgTypeUrl):""}},toJSON(e){const t={};return e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),e.msgTypeUrl!==void 0&&(t.msgTypeUrl=e.msgTypeUrl),t},fromPartial(e){const t=createBaseMsgRevoke();return t.granter=e.granter??"",t.grantee=e.grantee??"",t.msgTypeUrl=e.msgTypeUrl??"",t}};var globalThis$1u=(()=>{if(typeof globalThis$1u<"u")return globalThis$1u;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function isSet$1N(e){return e!=null}const msgTypes$r=[["/cosmos.authz.v1beta1.MsgRevoke",MsgRevoke],["/cosmos.authz.v1beta1.MsgGrant",MsgGrant],["/cosmos.authz.v1beta1.MsgExec",MsgExec$1]];let HttpClient$r=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$r=class extends HttpClient$r{constructor(){super(...arguments),this.queryGrants=(t,n={})=>this.request({path:"/cosmos/authz/v1beta1/grants",method:"GET",query:t,format:"json",...n}),this.queryGranteeGrants=(t,n,p={})=>this.request({path:`/cosmos/authz/v1beta1/grants/grantee/${t}`,method:"GET",query:n,format:"json",...p}),this.queryGranterGrants=(t,n,p={})=>this.request({path:`/cosmos/authz/v1beta1/grants/granter/${t}`,method:"GET",query:n,format:"json",...p})}};function createBaseEventGrant(){return{msgTypeUrl:"",granter:"",grantee:""}}const EventGrant={encode(e,t=_m0.Writer.create()){return e.msgTypeUrl!==""&&t.uint32(18).string(e.msgTypeUrl),e.granter!==""&&t.uint32(26).string(e.granter),e.grantee!==""&&t.uint32(34).string(e.grantee),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventGrant();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 2:u.msgTypeUrl=n.string();break;case 3:u.granter=n.string();break;case 4:u.grantee=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{msgTypeUrl:isSet$1M(e.msgTypeUrl)?String(e.msgTypeUrl):"",granter:isSet$1M(e.granter)?String(e.granter):"",grantee:isSet$1M(e.grantee)?String(e.grantee):""}},toJSON(e){const t={};return e.msgTypeUrl!==void 0&&(t.msgTypeUrl=e.msgTypeUrl),e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),t},fromPartial(e){const t=createBaseEventGrant();return t.msgTypeUrl=e.msgTypeUrl??"",t.granter=e.granter??"",t.grantee=e.grantee??"",t}};function createBaseEventRevoke(){return{msgTypeUrl:"",granter:"",grantee:""}}const EventRevoke={encode(e,t=_m0.Writer.create()){return e.msgTypeUrl!==""&&t.uint32(18).string(e.msgTypeUrl),e.granter!==""&&t.uint32(26).string(e.granter),e.grantee!==""&&t.uint32(34).string(e.grantee),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventRevoke();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 2:u.msgTypeUrl=n.string();break;case 3:u.granter=n.string();break;case 4:u.grantee=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{msgTypeUrl:isSet$1M(e.msgTypeUrl)?String(e.msgTypeUrl):"",granter:isSet$1M(e.granter)?String(e.granter):"",grantee:isSet$1M(e.grantee)?String(e.grantee):""}},toJSON(e){const t={};return e.msgTypeUrl!==void 0&&(t.msgTypeUrl=e.msgTypeUrl),e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),t},fromPartial(e){const t=createBaseEventRevoke();return t.msgTypeUrl=e.msgTypeUrl??"",t.granter=e.granter??"",t.grantee=e.grantee??"",t}};function isSet$1M(e){return e!=null}const registry$g=new build$b.Registry(msgTypes$r);function getStructure$o(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$f={amount:[],gas:"200000"},txClient$r=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgRevoke({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgRevoke: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$g,prefix:t});let N=this.msgRevoke({value:MsgRevoke.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$f,g)}catch(y){throw new Error("TxClient:sendMsgRevoke: Could not broadcast Tx: "+y.message)}},async sendMsgGrant({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgGrant: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$g,prefix:t});let N=this.msgGrant({value:MsgGrant.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$f,g)}catch(y){throw new Error("TxClient:sendMsgGrant: Could not broadcast Tx: "+y.message)}},async sendMsgExec({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgExec: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$g,prefix:t});let N=this.msgExec({value:MsgExec$1.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$f,g)}catch(y){throw new Error("TxClient:sendMsgExec: Could not broadcast Tx: "+y.message)}},msgRevoke({value:p}){try{return{typeUrl:"/cosmos.authz.v1beta1.MsgRevoke",value:MsgRevoke.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgRevoke: Could not create message: "+u.message)}},msgGrant({value:p}){try{return{typeUrl:"/cosmos.authz.v1beta1.MsgGrant",value:MsgGrant.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgGrant: Could not create message: "+u.message)}},msgExec({value:p}){try{return{typeUrl:"/cosmos.authz.v1beta1.MsgExec",value:MsgExec$1.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgExec: Could not create message: "+u.message)}}}),queryClient$r=({addr:e}={addr:"http://localhost:1317"})=>new Api$r({baseURL:e});let SDKModule$r=class{constructor(t){this.registry=[],this.query=queryClient$r({addr:t.env.apiURL}),this.updateTX(t),this.structure={GenericAuthorization:getStructure$o(GenericAuthorization.fromPartial({})),Grant:getStructure$o(Grant$1.fromPartial({})),GrantAuthorization:getStructure$o(GrantAuthorization.fromPartial({})),GrantQueueItem:getStructure$o(GrantQueueItem.fromPartial({})),EventGrant:getStructure$o(EventGrant.fromPartial({})),EventRevoke:getStructure$o(EventRevoke.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$r({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$s=e=>({module:{CosmosAuthzV1Beta1:new SDKModule$r(e)},registry:msgTypes$r});function createBaseCoin$a(){return{denom:"",amount:""}}const Coin$a={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin$a();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$1L(e.denom)?String(e.denom):"",amount:isSet$1L(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin$a();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$1L(e){return e!=null}function createBaseParams$c(){return{sendEnabled:[],defaultSendEnabled:!1}}const Params$c={encode(e,t=_m0.Writer.create()){for(const n of e.sendEnabled)SendEnabled.encode(n,t.uint32(10).fork()).ldelim();return e.defaultSendEnabled===!0&&t.uint32(16).bool(e.defaultSendEnabled),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$c();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.sendEnabled.push(SendEnabled.decode(n,n.uint32()));break;case 2:u.defaultSendEnabled=n.bool();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{sendEnabled:Array.isArray(e==null?void 0:e.sendEnabled)?e.sendEnabled.map(t=>SendEnabled.fromJSON(t)):[],defaultSendEnabled:isSet$1K(e.defaultSendEnabled)?!!e.defaultSendEnabled:!1}},toJSON(e){const t={};return e.sendEnabled?t.sendEnabled=e.sendEnabled.map(n=>n?SendEnabled.toJSON(n):void 0):t.sendEnabled=[],e.defaultSendEnabled!==void 0&&(t.defaultSendEnabled=e.defaultSendEnabled),t},fromPartial(e){var n;const t=createBaseParams$c();return t.sendEnabled=((n=e.sendEnabled)==null?void 0:n.map(p=>SendEnabled.fromPartial(p)))||[],t.defaultSendEnabled=e.defaultSendEnabled??!1,t}};function createBaseSendEnabled(){return{denom:"",enabled:!1}}const SendEnabled={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.enabled===!0&&t.uint32(16).bool(e.enabled),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseSendEnabled();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.enabled=n.bool();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$1K(e.denom)?String(e.denom):"",enabled:isSet$1K(e.enabled)?!!e.enabled:!1}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.enabled!==void 0&&(t.enabled=e.enabled),t},fromPartial(e){const t=createBaseSendEnabled();return t.denom=e.denom??"",t.enabled=e.enabled??!1,t}};function createBaseInput(){return{address:"",coins:[]}}const Input={encode(e,t=_m0.Writer.create()){e.address!==""&&t.uint32(10).string(e.address);for(const n of e.coins)Coin$a.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseInput();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.coins.push(Coin$a.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$1K(e.address)?String(e.address):"",coins:Array.isArray(e==null?void 0:e.coins)?e.coins.map(t=>Coin$a.fromJSON(t)):[]}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.coins?t.coins=e.coins.map(n=>n?Coin$a.toJSON(n):void 0):t.coins=[],t},fromPartial(e){var n;const t=createBaseInput();return t.address=e.address??"",t.coins=((n=e.coins)==null?void 0:n.map(p=>Coin$a.fromPartial(p)))||[],t}};function createBaseOutput(){return{address:"",coins:[]}}const Output={encode(e,t=_m0.Writer.create()){e.address!==""&&t.uint32(10).string(e.address);for(const n of e.coins)Coin$a.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseOutput();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.coins.push(Coin$a.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$1K(e.address)?String(e.address):"",coins:Array.isArray(e==null?void 0:e.coins)?e.coins.map(t=>Coin$a.fromJSON(t)):[]}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.coins?t.coins=e.coins.map(n=>n?Coin$a.toJSON(n):void 0):t.coins=[],t},fromPartial(e){var n;const t=createBaseOutput();return t.address=e.address??"",t.coins=((n=e.coins)==null?void 0:n.map(p=>Coin$a.fromPartial(p)))||[],t}};function createBaseSupply(){return{total:[]}}const Supply={encode(e,t=_m0.Writer.create()){for(const n of e.total)Coin$a.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseSupply();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.total.push(Coin$a.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{total:Array.isArray(e==null?void 0:e.total)?e.total.map(t=>Coin$a.fromJSON(t)):[]}},toJSON(e){const t={};return e.total?t.total=e.total.map(n=>n?Coin$a.toJSON(n):void 0):t.total=[],t},fromPartial(e){var n;const t=createBaseSupply();return t.total=((n=e.total)==null?void 0:n.map(p=>Coin$a.fromPartial(p)))||[],t}};function createBaseDenomUnit(){return{denom:"",exponent:0,aliases:[]}}const DenomUnit={encode(e,t=_m0.Writer.create()){e.denom!==""&&t.uint32(10).string(e.denom),e.exponent!==0&&t.uint32(16).uint32(e.exponent);for(const n of e.aliases)t.uint32(26).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDenomUnit();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.exponent=n.uint32();break;case 3:u.aliases.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$1K(e.denom)?String(e.denom):"",exponent:isSet$1K(e.exponent)?Number(e.exponent):0,aliases:Array.isArray(e==null?void 0:e.aliases)?e.aliases.map(t=>String(t)):[]}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.exponent!==void 0&&(t.exponent=Math.round(e.exponent)),e.aliases?t.aliases=e.aliases.map(n=>n):t.aliases=[],t},fromPartial(e){var n;const t=createBaseDenomUnit();return t.denom=e.denom??"",t.exponent=e.exponent??0,t.aliases=((n=e.aliases)==null?void 0:n.map(p=>p))||[],t}};function createBaseMetadata(){return{description:"",denomUnits:[],base:"",display:"",name:"",symbol:"",uri:"",uriHash:""}}const Metadata={encode(e,t=_m0.Writer.create()){e.description!==""&&t.uint32(10).string(e.description);for(const n of e.denomUnits)DenomUnit.encode(n,t.uint32(18).fork()).ldelim();return e.base!==""&&t.uint32(26).string(e.base),e.display!==""&&t.uint32(34).string(e.display),e.name!==""&&t.uint32(42).string(e.name),e.symbol!==""&&t.uint32(50).string(e.symbol),e.uri!==""&&t.uint32(58).string(e.uri),e.uriHash!==""&&t.uint32(66).string(e.uriHash),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMetadata();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.description=n.string();break;case 2:u.denomUnits.push(DenomUnit.decode(n,n.uint32()));break;case 3:u.base=n.string();break;case 4:u.display=n.string();break;case 5:u.name=n.string();break;case 6:u.symbol=n.string();break;case 7:u.uri=n.string();break;case 8:u.uriHash=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{description:isSet$1K(e.description)?String(e.description):"",denomUnits:Array.isArray(e==null?void 0:e.denomUnits)?e.denomUnits.map(t=>DenomUnit.fromJSON(t)):[],base:isSet$1K(e.base)?String(e.base):"",display:isSet$1K(e.display)?String(e.display):"",name:isSet$1K(e.name)?String(e.name):"",symbol:isSet$1K(e.symbol)?String(e.symbol):"",uri:isSet$1K(e.uri)?String(e.uri):"",uriHash:isSet$1K(e.uriHash)?String(e.uriHash):""}},toJSON(e){const t={};return e.description!==void 0&&(t.description=e.description),e.denomUnits?t.denomUnits=e.denomUnits.map(n=>n?DenomUnit.toJSON(n):void 0):t.denomUnits=[],e.base!==void 0&&(t.base=e.base),e.display!==void 0&&(t.display=e.display),e.name!==void 0&&(t.name=e.name),e.symbol!==void 0&&(t.symbol=e.symbol),e.uri!==void 0&&(t.uri=e.uri),e.uriHash!==void 0&&(t.uriHash=e.uriHash),t},fromPartial(e){var n;const t=createBaseMetadata();return t.description=e.description??"",t.denomUnits=((n=e.denomUnits)==null?void 0:n.map(p=>DenomUnit.fromPartial(p)))||[],t.base=e.base??"",t.display=e.display??"",t.name=e.name??"",t.symbol=e.symbol??"",t.uri=e.uri??"",t.uriHash=e.uriHash??"",t}};function isSet$1K(e){return e!=null}function createBaseMsgSend(){return{fromAddress:"",toAddress:"",amount:[]}}const MsgSend={encode(e,t=_m0.Writer.create()){e.fromAddress!==""&&t.uint32(10).string(e.fromAddress),e.toAddress!==""&&t.uint32(18).string(e.toAddress);for(const n of e.amount)Coin$a.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgSend();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.fromAddress=n.string();break;case 2:u.toAddress=n.string();break;case 3:u.amount.push(Coin$a.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{fromAddress:isSet$1J(e.fromAddress)?String(e.fromAddress):"",toAddress:isSet$1J(e.toAddress)?String(e.toAddress):"",amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$a.fromJSON(t)):[]}},toJSON(e){const t={};return e.fromAddress!==void 0&&(t.fromAddress=e.fromAddress),e.toAddress!==void 0&&(t.toAddress=e.toAddress),e.amount?t.amount=e.amount.map(n=>n?Coin$a.toJSON(n):void 0):t.amount=[],t},fromPartial(e){var n;const t=createBaseMsgSend();return t.fromAddress=e.fromAddress??"",t.toAddress=e.toAddress??"",t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$a.fromPartial(p)))||[],t}};function createBaseMsgMultiSend(){return{inputs:[],outputs:[]}}const MsgMultiSend={encode(e,t=_m0.Writer.create()){for(const n of e.inputs)Input.encode(n,t.uint32(10).fork()).ldelim();for(const n of e.outputs)Output.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgMultiSend();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.inputs.push(Input.decode(n,n.uint32()));break;case 2:u.outputs.push(Output.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{inputs:Array.isArray(e==null?void 0:e.inputs)?e.inputs.map(t=>Input.fromJSON(t)):[],outputs:Array.isArray(e==null?void 0:e.outputs)?e.outputs.map(t=>Output.fromJSON(t)):[]}},toJSON(e){const t={};return e.inputs?t.inputs=e.inputs.map(n=>n?Input.toJSON(n):void 0):t.inputs=[],e.outputs?t.outputs=e.outputs.map(n=>n?Output.toJSON(n):void 0):t.outputs=[],t},fromPartial(e){var n,p;const t=createBaseMsgMultiSend();return t.inputs=((n=e.inputs)==null?void 0:n.map(u=>Input.fromPartial(u)))||[],t.outputs=((p=e.outputs)==null?void 0:p.map(u=>Output.fromPartial(u)))||[],t}};function isSet$1J(e){return e!=null}const msgTypes$q=[["/cosmos.bank.v1beta1.MsgMultiSend",MsgMultiSend],["/cosmos.bank.v1beta1.MsgSend",MsgSend]];let HttpClient$q=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$q=class extends HttpClient$q{constructor(){super(...arguments),this.queryAllBalances=(t,n,p={})=>this.request({path:`/cosmos/bank/v1beta1/balances/${t}`,method:"GET",query:n,format:"json",...p}),this.queryBalance=(t,n,p={})=>this.request({path:`/cosmos/bank/v1beta1/balances/${t}/by_denom`,method:"GET",query:n,format:"json",...p}),this.queryDenomOwners=(t,n,p={})=>this.request({path:`/cosmos/bank/v1beta1/denom_owners/${t}`,method:"GET",query:n,format:"json",...p}),this.queryDenomsMetadata=(t,n={})=>this.request({path:"/cosmos/bank/v1beta1/denoms_metadata",method:"GET",query:t,format:"json",...n}),this.queryDenomMetadata=(t,n={})=>this.request({path:`/cosmos/bank/v1beta1/denoms_metadata/${t}`,method:"GET",format:"json",...n}),this.queryParams=(t={})=>this.request({path:"/cosmos/bank/v1beta1/params",method:"GET",format:"json",...t}),this.querySendEnabled=(t,n={})=>this.request({path:"/cosmos/bank/v1beta1/send_enabled",method:"GET",query:t,format:"json",...n}),this.querySpendableBalances=(t,n,p={})=>this.request({path:`/cosmos/bank/v1beta1/spendable_balances/${t}`,method:"GET",query:n,format:"json",...p}),this.querySpendableBalanceByDenom=(t,n,p={})=>this.request({path:`/cosmos/bank/v1beta1/spendable_balances/${t}/by_denom`,method:"GET",query:n,format:"json",...p}),this.queryTotalSupply=(t,n={})=>this.request({path:"/cosmos/bank/v1beta1/supply",method:"GET",query:t,format:"json",...n}),this.querySupplyOf=(t,n={})=>this.request({path:"/cosmos/bank/v1beta1/supply/by_denom",method:"GET",query:t,format:"json",...n})}};function createBaseSendAuthorization(){return{spendLimit:[],allowList:[]}}const SendAuthorization={encode(e,t=_m0.Writer.create()){for(const n of e.spendLimit)Coin$a.encode(n,t.uint32(10).fork()).ldelim();for(const n of e.allowList)t.uint32(18).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseSendAuthorization();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.spendLimit.push(Coin$a.decode(n,n.uint32()));break;case 2:u.allowList.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{spendLimit:Array.isArray(e==null?void 0:e.spendLimit)?e.spendLimit.map(t=>Coin$a.fromJSON(t)):[],allowList:Array.isArray(e==null?void 0:e.allowList)?e.allowList.map(t=>String(t)):[]}},toJSON(e){const t={};return e.spendLimit?t.spendLimit=e.spendLimit.map(n=>n?Coin$a.toJSON(n):void 0):t.spendLimit=[],e.allowList?t.allowList=e.allowList.map(n=>n):t.allowList=[],t},fromPartial(e){var n,p;const t=createBaseSendAuthorization();return t.spendLimit=((n=e.spendLimit)==null?void 0:n.map(u=>Coin$a.fromPartial(u)))||[],t.allowList=((p=e.allowList)==null?void 0:p.map(u=>u))||[],t}};function createBaseBalance(){return{address:"",coins:[]}}const Balance={encode(e,t=_m0.Writer.create()){e.address!==""&&t.uint32(10).string(e.address);for(const n of e.coins)Coin$a.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseBalance();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.coins.push(Coin$a.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$1I(e.address)?String(e.address):"",coins:Array.isArray(e==null?void 0:e.coins)?e.coins.map(t=>Coin$a.fromJSON(t)):[]}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.coins?t.coins=e.coins.map(n=>n?Coin$a.toJSON(n):void 0):t.coins=[],t},fromPartial(e){var n;const t=createBaseBalance();return t.address=e.address??"",t.coins=((n=e.coins)==null?void 0:n.map(p=>Coin$a.fromPartial(p)))||[],t}};function isSet$1I(e){return e!=null}var globalThis$1t=(()=>{if(typeof globalThis$1t<"u")return globalThis$1t;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function createBaseDenomOwner(){return{address:"",balance:void 0}}const DenomOwner={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.balance!==void 0&&Coin$a.encode(e.balance,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDenomOwner();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.balance=Coin$a.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$1H(e.address)?String(e.address):"",balance:isSet$1H(e.balance)?Coin$a.fromJSON(e.balance):void 0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.balance!==void 0&&(t.balance=e.balance?Coin$a.toJSON(e.balance):void 0),t},fromPartial(e){const t=createBaseDenomOwner();return t.address=e.address??"",t.balance=e.balance!==void 0&&e.balance!==null?Coin$a.fromPartial(e.balance):void 0,t}};function isSet$1H(e){return e!=null}const registry$f=new build$b.Registry(msgTypes$q);function getStructure$n(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$e={amount:[],gas:"200000"},txClient$q=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgMultiSend({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgMultiSend: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$f,prefix:t});let N=this.msgMultiSend({value:MsgMultiSend.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$e,g)}catch(y){throw new Error("TxClient:sendMsgMultiSend: Could not broadcast Tx: "+y.message)}},async sendMsgSend({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgSend: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$f,prefix:t});let N=this.msgSend({value:MsgSend.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$e,g)}catch(y){throw new Error("TxClient:sendMsgSend: Could not broadcast Tx: "+y.message)}},msgMultiSend({value:p}){try{return{typeUrl:"/cosmos.bank.v1beta1.MsgMultiSend",value:MsgMultiSend.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgMultiSend: Could not create message: "+u.message)}},msgSend({value:p}){try{return{typeUrl:"/cosmos.bank.v1beta1.MsgSend",value:MsgSend.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgSend: Could not create message: "+u.message)}}}),queryClient$q=({addr:e}={addr:"http://localhost:1317"})=>new Api$q({baseURL:e});let SDKModule$q=class{constructor(t){this.registry=[],this.query=queryClient$q({addr:t.env.apiURL}),this.updateTX(t),this.structure={SendAuthorization:getStructure$n(SendAuthorization.fromPartial({})),Params:getStructure$n(Params$c.fromPartial({})),SendEnabled:getStructure$n(SendEnabled.fromPartial({})),Input:getStructure$n(Input.fromPartial({})),Output:getStructure$n(Output.fromPartial({})),Supply:getStructure$n(Supply.fromPartial({})),DenomUnit:getStructure$n(DenomUnit.fromPartial({})),Metadata:getStructure$n(Metadata.fromPartial({})),Balance:getStructure$n(Balance.fromPartial({})),DenomOwner:getStructure$n(DenomOwner.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$q({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$r=e=>({module:{CosmosBankV1Beta1:new SDKModule$q(e)},registry:msgTypes$q}),module$2=Object.freeze(Object.defineProperty({__proto__:null,MsgMultiSend,MsgSend,default:Module$r,queryClient:queryClient$q,registry:registry$f,txClient:txClient$q},Symbol.toStringTag,{value:"Module"})),msgTypes$p=[];let HttpClient$p=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$p=class extends HttpClient$p{constructor(){super(...arguments),this.serviceConfig=(t={})=>this.request({path:"/cosmos/base/node/v1beta1/config",method:"GET",format:"json",...t})}};new build$b.Registry(msgTypes$p);const txClient$p=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$p=({addr:e}={addr:"http://localhost:1317"})=>new Api$p({baseURL:e});let SDKModule$p=class{constructor(t){this.registry=[],this.query=queryClient$p({addr:t.env.apiURL}),this.updateTX(t),this.structure={},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$p({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$q=e=>({module:{CosmosBaseNodeV1Beta1:new SDKModule$p(e)},registry:msgTypes$p}),msgTypes$o=[];let HttpClient$o=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$o=class extends HttpClient$o{constructor(){super(...arguments),this.serviceABCIQuery=(t,n={})=>this.request({path:"/cosmos/base/tendermint/v1beta1/abci_query",method:"GET",query:t,format:"json",...n}),this.serviceGetLatestBlock=(t={})=>this.request({path:"/cosmos/base/tendermint/v1beta1/blocks/latest",method:"GET",format:"json",...t}),this.serviceGetBlockByHeight=(t,n={})=>this.request({path:`/cosmos/base/tendermint/v1beta1/blocks/${t}`,method:"GET",format:"json",...n}),this.serviceGetNodeInfo=(t={})=>this.request({path:"/cosmos/base/tendermint/v1beta1/node_info",method:"GET",format:"json",...t}),this.serviceGetSyncing=(t={})=>this.request({path:"/cosmos/base/tendermint/v1beta1/syncing",method:"GET",format:"json",...t}),this.serviceGetLatestValidatorSet=(t,n={})=>this.request({path:"/cosmos/base/tendermint/v1beta1/validatorsets/latest",method:"GET",query:t,format:"json",...n}),this.serviceGetValidatorSetByHeight=(t,n,p={})=>this.request({path:`/cosmos/base/tendermint/v1beta1/validatorsets/${t}`,method:"GET",query:n,format:"json",...p})}};function createBaseAny$b(){return{typeUrl:"",value:new Uint8Array}}const Any$b={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$b();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$1G(e.typeUrl)?String(e.typeUrl):"",value:isSet$1G(e.value)?bytesFromBase64$t(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$t(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$b();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$1s=(()=>{if(typeof globalThis$1s<"u")return globalThis$1s;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$t(e){if(globalThis$1s.Buffer)return Uint8Array.from(globalThis$1s.Buffer.from(e,"base64"));{const t=globalThis$1s.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$t(e){if(globalThis$1s.Buffer)return globalThis$1s.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$1s.btoa(t.join(""))}}function isSet$1G(e){return e!=null}var globalThis$1r=(()=>{if(typeof globalThis$1r<"u")return globalThis$1r;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function createBaseTimestamp$9(){return{seconds:0,nanos:0}}const Timestamp$9={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp$9();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$X(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$1F(e.seconds)?Number(e.seconds):0,nanos:isSet$1F(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp$9();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$1q=(()=>{if(typeof globalThis$1q<"u")return globalThis$1q;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$X(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1q.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1F(e){return e!=null}var globalThis$1p=(()=>{if(typeof globalThis$1p<"u")return globalThis$1p;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function createBaseConsensus$1(){return{block:0,app:0}}const Consensus$1={encode(e,t=_m0.Writer.create()){return e.block!==0&&t.uint32(8).uint64(e.block),e.app!==0&&t.uint32(16).uint64(e.app),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseConsensus$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.block=longToNumber$W(n.uint64());break;case 2:u.app=longToNumber$W(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{block:isSet$1E(e.block)?Number(e.block):0,app:isSet$1E(e.app)?Number(e.app):0}},toJSON(e){const t={};return e.block!==void 0&&(t.block=Math.round(e.block)),e.app!==void 0&&(t.app=Math.round(e.app)),t},fromPartial(e){const t=createBaseConsensus$1();return t.block=e.block??0,t.app=e.app??0,t}};var globalThis$1o=(()=>{if(typeof globalThis$1o<"u")return globalThis$1o;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$W(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1o.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1E(e){return e!=null}function createBasePublicKey$1(){return{ed25519:void 0,secp256k1:void 0}}const PublicKey$1={encode(e,t=_m0.Writer.create()){return e.ed25519!==void 0&&t.uint32(10).bytes(e.ed25519),e.secp256k1!==void 0&&t.uint32(18).bytes(e.secp256k1),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePublicKey$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.ed25519=n.bytes();break;case 2:u.secp256k1=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{ed25519:isSet$1D(e.ed25519)?bytesFromBase64$s(e.ed25519):void 0,secp256k1:isSet$1D(e.secp256k1)?bytesFromBase64$s(e.secp256k1):void 0}},toJSON(e){const t={};return e.ed25519!==void 0&&(t.ed25519=e.ed25519!==void 0?base64FromBytes$s(e.ed25519):void 0),e.secp256k1!==void 0&&(t.secp256k1=e.secp256k1!==void 0?base64FromBytes$s(e.secp256k1):void 0),t},fromPartial(e){const t=createBasePublicKey$1();return t.ed25519=e.ed25519??void 0,t.secp256k1=e.secp256k1??void 0,t}};var globalThis$1n=(()=>{if(typeof globalThis$1n<"u")return globalThis$1n;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$s(e){if(globalThis$1n.Buffer)return Uint8Array.from(globalThis$1n.Buffer.from(e,"base64"));{const t=globalThis$1n.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$s(e){if(globalThis$1n.Buffer)return globalThis$1n.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$1n.btoa(t.join(""))}}function isSet$1D(e){return e!=null}function createBaseValidatorSet(){return{validators:[],proposer:void 0,totalVotingPower:0}}const ValidatorSet={encode(e,t=_m0.Writer.create()){for(const n of e.validators)Validator$2.encode(n,t.uint32(10).fork()).ldelim();return e.proposer!==void 0&&Validator$2.encode(e.proposer,t.uint32(18).fork()).ldelim(),e.totalVotingPower!==0&&t.uint32(24).int64(e.totalVotingPower),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorSet();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validators.push(Validator$2.decode(n,n.uint32()));break;case 2:u.proposer=Validator$2.decode(n,n.uint32());break;case 3:u.totalVotingPower=longToNumber$V(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validators:Array.isArray(e==null?void 0:e.validators)?e.validators.map(t=>Validator$2.fromJSON(t)):[],proposer:isSet$1C(e.proposer)?Validator$2.fromJSON(e.proposer):void 0,totalVotingPower:isSet$1C(e.totalVotingPower)?Number(e.totalVotingPower):0}},toJSON(e){const t={};return e.validators?t.validators=e.validators.map(n=>n?Validator$2.toJSON(n):void 0):t.validators=[],e.proposer!==void 0&&(t.proposer=e.proposer?Validator$2.toJSON(e.proposer):void 0),e.totalVotingPower!==void 0&&(t.totalVotingPower=Math.round(e.totalVotingPower)),t},fromPartial(e){var n;const t=createBaseValidatorSet();return t.validators=((n=e.validators)==null?void 0:n.map(p=>Validator$2.fromPartial(p)))||[],t.proposer=e.proposer!==void 0&&e.proposer!==null?Validator$2.fromPartial(e.proposer):void 0,t.totalVotingPower=e.totalVotingPower??0,t}};function createBaseValidator$2(){return{address:new Uint8Array,pubKey:void 0,votingPower:0,proposerPriority:0}}const Validator$2={encode(e,t=_m0.Writer.create()){return e.address.length!==0&&t.uint32(10).bytes(e.address),e.pubKey!==void 0&&PublicKey$1.encode(e.pubKey,t.uint32(18).fork()).ldelim(),e.votingPower!==0&&t.uint32(24).int64(e.votingPower),e.proposerPriority!==0&&t.uint32(32).int64(e.proposerPriority),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidator$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.bytes();break;case 2:u.pubKey=PublicKey$1.decode(n,n.uint32());break;case 3:u.votingPower=longToNumber$V(n.int64());break;case 4:u.proposerPriority=longToNumber$V(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$1C(e.address)?bytesFromBase64$r(e.address):new Uint8Array,pubKey:isSet$1C(e.pubKey)?PublicKey$1.fromJSON(e.pubKey):void 0,votingPower:isSet$1C(e.votingPower)?Number(e.votingPower):0,proposerPriority:isSet$1C(e.proposerPriority)?Number(e.proposerPriority):0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=base64FromBytes$r(e.address!==void 0?e.address:new Uint8Array)),e.pubKey!==void 0&&(t.pubKey=e.pubKey?PublicKey$1.toJSON(e.pubKey):void 0),e.votingPower!==void 0&&(t.votingPower=Math.round(e.votingPower)),e.proposerPriority!==void 0&&(t.proposerPriority=Math.round(e.proposerPriority)),t},fromPartial(e){const t=createBaseValidator$2();return t.address=e.address??new Uint8Array,t.pubKey=e.pubKey!==void 0&&e.pubKey!==null?PublicKey$1.fromPartial(e.pubKey):void 0,t.votingPower=e.votingPower??0,t.proposerPriority=e.proposerPriority??0,t}};var globalThis$1m=(()=>{if(typeof globalThis$1m<"u")return globalThis$1m;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$r(e){if(globalThis$1m.Buffer)return Uint8Array.from(globalThis$1m.Buffer.from(e,"base64"));{const t=globalThis$1m.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$r(e){if(globalThis$1m.Buffer)return globalThis$1m.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$1m.btoa(t.join(""))}}function longToNumber$V(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1m.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1C(e){return e!=null}function blockIDFlagFromJSON(e){switch(e){case 0:case"BLOCK_ID_FLAG_UNKNOWN":return 0;case 1:case"BLOCK_ID_FLAG_ABSENT":return 1;case 2:case"BLOCK_ID_FLAG_COMMIT":return 2;case 3:case"BLOCK_ID_FLAG_NIL":return 3;case-1:case"UNRECOGNIZED":default:return-1}}function blockIDFlagToJSON(e){switch(e){case 0:return"BLOCK_ID_FLAG_UNKNOWN";case 1:return"BLOCK_ID_FLAG_ABSENT";case 2:return"BLOCK_ID_FLAG_COMMIT";case 3:return"BLOCK_ID_FLAG_NIL";case-1:default:return"UNRECOGNIZED"}}function signedMsgTypeFromJSON(e){switch(e){case 0:case"SIGNED_MSG_TYPE_UNKNOWN":return 0;case 1:case"SIGNED_MSG_TYPE_PREVOTE":return 1;case 2:case"SIGNED_MSG_TYPE_PRECOMMIT":return 2;case 32:case"SIGNED_MSG_TYPE_PROPOSAL":return 32;case-1:case"UNRECOGNIZED":default:return-1}}function signedMsgTypeToJSON(e){switch(e){case 0:return"SIGNED_MSG_TYPE_UNKNOWN";case 1:return"SIGNED_MSG_TYPE_PREVOTE";case 2:return"SIGNED_MSG_TYPE_PRECOMMIT";case 32:return"SIGNED_MSG_TYPE_PROPOSAL";case-1:default:return"UNRECOGNIZED"}}function createBasePartSetHeader$1(){return{total:0,hash:new Uint8Array}}const PartSetHeader$1={encode(e,t=_m0.Writer.create()){return e.total!==0&&t.uint32(8).uint32(e.total),e.hash.length!==0&&t.uint32(18).bytes(e.hash),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePartSetHeader$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.total=n.uint32();break;case 2:u.hash=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{total:isSet$1B(e.total)?Number(e.total):0,hash:isSet$1B(e.hash)?bytesFromBase64$q(e.hash):new Uint8Array}},toJSON(e){const t={};return e.total!==void 0&&(t.total=Math.round(e.total)),e.hash!==void 0&&(t.hash=base64FromBytes$q(e.hash!==void 0?e.hash:new Uint8Array)),t},fromPartial(e){const t=createBasePartSetHeader$1();return t.total=e.total??0,t.hash=e.hash??new Uint8Array,t}};function createBaseBlockID$1(){return{hash:new Uint8Array,partSetHeader:void 0}}const BlockID$1={encode(e,t=_m0.Writer.create()){return e.hash.length!==0&&t.uint32(10).bytes(e.hash),e.partSetHeader!==void 0&&PartSetHeader$1.encode(e.partSetHeader,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseBlockID$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.hash=n.bytes();break;case 2:u.partSetHeader=PartSetHeader$1.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{hash:isSet$1B(e.hash)?bytesFromBase64$q(e.hash):new Uint8Array,partSetHeader:isSet$1B(e.partSetHeader)?PartSetHeader$1.fromJSON(e.partSetHeader):void 0}},toJSON(e){const t={};return e.hash!==void 0&&(t.hash=base64FromBytes$q(e.hash!==void 0?e.hash:new Uint8Array)),e.partSetHeader!==void 0&&(t.partSetHeader=e.partSetHeader?PartSetHeader$1.toJSON(e.partSetHeader):void 0),t},fromPartial(e){const t=createBaseBlockID$1();return t.hash=e.hash??new Uint8Array,t.partSetHeader=e.partSetHeader!==void 0&&e.partSetHeader!==null?PartSetHeader$1.fromPartial(e.partSetHeader):void 0,t}};function createBaseHeader$2(){return{version:void 0,chainId:"",height:0,time:void 0,lastBlockId:void 0,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}}const Header$2={encode(e,t=_m0.Writer.create()){return e.version!==void 0&&Consensus$1.encode(e.version,t.uint32(10).fork()).ldelim(),e.chainId!==""&&t.uint32(18).string(e.chainId),e.height!==0&&t.uint32(24).int64(e.height),e.time!==void 0&&Timestamp$9.encode(toTimestamp$c(e.time),t.uint32(34).fork()).ldelim(),e.lastBlockId!==void 0&&BlockID$1.encode(e.lastBlockId,t.uint32(42).fork()).ldelim(),e.lastCommitHash.length!==0&&t.uint32(50).bytes(e.lastCommitHash),e.dataHash.length!==0&&t.uint32(58).bytes(e.dataHash),e.validatorsHash.length!==0&&t.uint32(66).bytes(e.validatorsHash),e.nextValidatorsHash.length!==0&&t.uint32(74).bytes(e.nextValidatorsHash),e.consensusHash.length!==0&&t.uint32(82).bytes(e.consensusHash),e.appHash.length!==0&&t.uint32(90).bytes(e.appHash),e.lastResultsHash.length!==0&&t.uint32(98).bytes(e.lastResultsHash),e.evidenceHash.length!==0&&t.uint32(106).bytes(e.evidenceHash),e.proposerAddress.length!==0&&t.uint32(114).bytes(e.proposerAddress),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseHeader$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.version=Consensus$1.decode(n,n.uint32());break;case 2:u.chainId=n.string();break;case 3:u.height=longToNumber$U(n.int64());break;case 4:u.time=fromTimestamp$c(Timestamp$9.decode(n,n.uint32()));break;case 5:u.lastBlockId=BlockID$1.decode(n,n.uint32());break;case 6:u.lastCommitHash=n.bytes();break;case 7:u.dataHash=n.bytes();break;case 8:u.validatorsHash=n.bytes();break;case 9:u.nextValidatorsHash=n.bytes();break;case 10:u.consensusHash=n.bytes();break;case 11:u.appHash=n.bytes();break;case 12:u.lastResultsHash=n.bytes();break;case 13:u.evidenceHash=n.bytes();break;case 14:u.proposerAddress=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{version:isSet$1B(e.version)?Consensus$1.fromJSON(e.version):void 0,chainId:isSet$1B(e.chainId)?String(e.chainId):"",height:isSet$1B(e.height)?Number(e.height):0,time:isSet$1B(e.time)?fromJsonTimestamp$c(e.time):void 0,lastBlockId:isSet$1B(e.lastBlockId)?BlockID$1.fromJSON(e.lastBlockId):void 0,lastCommitHash:isSet$1B(e.lastCommitHash)?bytesFromBase64$q(e.lastCommitHash):new Uint8Array,dataHash:isSet$1B(e.dataHash)?bytesFromBase64$q(e.dataHash):new Uint8Array,validatorsHash:isSet$1B(e.validatorsHash)?bytesFromBase64$q(e.validatorsHash):new Uint8Array,nextValidatorsHash:isSet$1B(e.nextValidatorsHash)?bytesFromBase64$q(e.nextValidatorsHash):new Uint8Array,consensusHash:isSet$1B(e.consensusHash)?bytesFromBase64$q(e.consensusHash):new Uint8Array,appHash:isSet$1B(e.appHash)?bytesFromBase64$q(e.appHash):new Uint8Array,lastResultsHash:isSet$1B(e.lastResultsHash)?bytesFromBase64$q(e.lastResultsHash):new Uint8Array,evidenceHash:isSet$1B(e.evidenceHash)?bytesFromBase64$q(e.evidenceHash):new Uint8Array,proposerAddress:isSet$1B(e.proposerAddress)?bytesFromBase64$q(e.proposerAddress):new Uint8Array}},toJSON(e){const t={};return e.version!==void 0&&(t.version=e.version?Consensus$1.toJSON(e.version):void 0),e.chainId!==void 0&&(t.chainId=e.chainId),e.height!==void 0&&(t.height=Math.round(e.height)),e.time!==void 0&&(t.time=e.time.toISOString()),e.lastBlockId!==void 0&&(t.lastBlockId=e.lastBlockId?BlockID$1.toJSON(e.lastBlockId):void 0),e.lastCommitHash!==void 0&&(t.lastCommitHash=base64FromBytes$q(e.lastCommitHash!==void 0?e.lastCommitHash:new Uint8Array)),e.dataHash!==void 0&&(t.dataHash=base64FromBytes$q(e.dataHash!==void 0?e.dataHash:new Uint8Array)),e.validatorsHash!==void 0&&(t.validatorsHash=base64FromBytes$q(e.validatorsHash!==void 0?e.validatorsHash:new Uint8Array)),e.nextValidatorsHash!==void 0&&(t.nextValidatorsHash=base64FromBytes$q(e.nextValidatorsHash!==void 0?e.nextValidatorsHash:new Uint8Array)),e.consensusHash!==void 0&&(t.consensusHash=base64FromBytes$q(e.consensusHash!==void 0?e.consensusHash:new Uint8Array)),e.appHash!==void 0&&(t.appHash=base64FromBytes$q(e.appHash!==void 0?e.appHash:new Uint8Array)),e.lastResultsHash!==void 0&&(t.lastResultsHash=base64FromBytes$q(e.lastResultsHash!==void 0?e.lastResultsHash:new Uint8Array)),e.evidenceHash!==void 0&&(t.evidenceHash=base64FromBytes$q(e.evidenceHash!==void 0?e.evidenceHash:new Uint8Array)),e.proposerAddress!==void 0&&(t.proposerAddress=base64FromBytes$q(e.proposerAddress!==void 0?e.proposerAddress:new Uint8Array)),t},fromPartial(e){const t=createBaseHeader$2();return t.version=e.version!==void 0&&e.version!==null?Consensus$1.fromPartial(e.version):void 0,t.chainId=e.chainId??"",t.height=e.height??0,t.time=e.time??void 0,t.lastBlockId=e.lastBlockId!==void 0&&e.lastBlockId!==null?BlockID$1.fromPartial(e.lastBlockId):void 0,t.lastCommitHash=e.lastCommitHash??new Uint8Array,t.dataHash=e.dataHash??new Uint8Array,t.validatorsHash=e.validatorsHash??new Uint8Array,t.nextValidatorsHash=e.nextValidatorsHash??new Uint8Array,t.consensusHash=e.consensusHash??new Uint8Array,t.appHash=e.appHash??new Uint8Array,t.lastResultsHash=e.lastResultsHash??new Uint8Array,t.evidenceHash=e.evidenceHash??new Uint8Array,t.proposerAddress=e.proposerAddress??new Uint8Array,t}};function createBaseData(){return{txs:[]}}const Data={encode(e,t=_m0.Writer.create()){for(const n of e.txs)t.uint32(10).bytes(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseData();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.txs.push(n.bytes());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{txs:Array.isArray(e==null?void 0:e.txs)?e.txs.map(t=>bytesFromBase64$q(t)):[]}},toJSON(e){const t={};return e.txs?t.txs=e.txs.map(n=>base64FromBytes$q(n!==void 0?n:new Uint8Array)):t.txs=[],t},fromPartial(e){var n;const t=createBaseData();return t.txs=((n=e.txs)==null?void 0:n.map(p=>p))||[],t}};function createBaseVote$3(){return{type:0,height:0,round:0,blockId:void 0,timestamp:void 0,validatorAddress:new Uint8Array,validatorIndex:0,signature:new Uint8Array}}const Vote$3={encode(e,t=_m0.Writer.create()){return e.type!==0&&t.uint32(8).int32(e.type),e.height!==0&&t.uint32(16).int64(e.height),e.round!==0&&t.uint32(24).int32(e.round),e.blockId!==void 0&&BlockID$1.encode(e.blockId,t.uint32(34).fork()).ldelim(),e.timestamp!==void 0&&Timestamp$9.encode(toTimestamp$c(e.timestamp),t.uint32(42).fork()).ldelim(),e.validatorAddress.length!==0&&t.uint32(50).bytes(e.validatorAddress),e.validatorIndex!==0&&t.uint32(56).int32(e.validatorIndex),e.signature.length!==0&&t.uint32(66).bytes(e.signature),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseVote$3();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.type=n.int32();break;case 2:u.height=longToNumber$U(n.int64());break;case 3:u.round=n.int32();break;case 4:u.blockId=BlockID$1.decode(n,n.uint32());break;case 5:u.timestamp=fromTimestamp$c(Timestamp$9.decode(n,n.uint32()));break;case 6:u.validatorAddress=n.bytes();break;case 7:u.validatorIndex=n.int32();break;case 8:u.signature=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{type:isSet$1B(e.type)?signedMsgTypeFromJSON(e.type):0,height:isSet$1B(e.height)?Number(e.height):0,round:isSet$1B(e.round)?Number(e.round):0,blockId:isSet$1B(e.blockId)?BlockID$1.fromJSON(e.blockId):void 0,timestamp:isSet$1B(e.timestamp)?fromJsonTimestamp$c(e.timestamp):void 0,validatorAddress:isSet$1B(e.validatorAddress)?bytesFromBase64$q(e.validatorAddress):new Uint8Array,validatorIndex:isSet$1B(e.validatorIndex)?Number(e.validatorIndex):0,signature:isSet$1B(e.signature)?bytesFromBase64$q(e.signature):new Uint8Array}},toJSON(e){const t={};return e.type!==void 0&&(t.type=signedMsgTypeToJSON(e.type)),e.height!==void 0&&(t.height=Math.round(e.height)),e.round!==void 0&&(t.round=Math.round(e.round)),e.blockId!==void 0&&(t.blockId=e.blockId?BlockID$1.toJSON(e.blockId):void 0),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.validatorAddress!==void 0&&(t.validatorAddress=base64FromBytes$q(e.validatorAddress!==void 0?e.validatorAddress:new Uint8Array)),e.validatorIndex!==void 0&&(t.validatorIndex=Math.round(e.validatorIndex)),e.signature!==void 0&&(t.signature=base64FromBytes$q(e.signature!==void 0?e.signature:new Uint8Array)),t},fromPartial(e){const t=createBaseVote$3();return t.type=e.type??0,t.height=e.height??0,t.round=e.round??0,t.blockId=e.blockId!==void 0&&e.blockId!==null?BlockID$1.fromPartial(e.blockId):void 0,t.timestamp=e.timestamp??void 0,t.validatorAddress=e.validatorAddress??new Uint8Array,t.validatorIndex=e.validatorIndex??0,t.signature=e.signature??new Uint8Array,t}};function createBaseCommit(){return{height:0,round:0,blockId:void 0,signatures:[]}}const Commit={encode(e,t=_m0.Writer.create()){e.height!==0&&t.uint32(8).int64(e.height),e.round!==0&&t.uint32(16).int32(e.round),e.blockId!==void 0&&BlockID$1.encode(e.blockId,t.uint32(26).fork()).ldelim();for(const n of e.signatures)CommitSig.encode(n,t.uint32(34).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCommit();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.height=longToNumber$U(n.int64());break;case 2:u.round=n.int32();break;case 3:u.blockId=BlockID$1.decode(n,n.uint32());break;case 4:u.signatures.push(CommitSig.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{height:isSet$1B(e.height)?Number(e.height):0,round:isSet$1B(e.round)?Number(e.round):0,blockId:isSet$1B(e.blockId)?BlockID$1.fromJSON(e.blockId):void 0,signatures:Array.isArray(e==null?void 0:e.signatures)?e.signatures.map(t=>CommitSig.fromJSON(t)):[]}},toJSON(e){const t={};return e.height!==void 0&&(t.height=Math.round(e.height)),e.round!==void 0&&(t.round=Math.round(e.round)),e.blockId!==void 0&&(t.blockId=e.blockId?BlockID$1.toJSON(e.blockId):void 0),e.signatures?t.signatures=e.signatures.map(n=>n?CommitSig.toJSON(n):void 0):t.signatures=[],t},fromPartial(e){var n;const t=createBaseCommit();return t.height=e.height??0,t.round=e.round??0,t.blockId=e.blockId!==void 0&&e.blockId!==null?BlockID$1.fromPartial(e.blockId):void 0,t.signatures=((n=e.signatures)==null?void 0:n.map(p=>CommitSig.fromPartial(p)))||[],t}};function createBaseCommitSig(){return{blockIdFlag:0,validatorAddress:new Uint8Array,timestamp:void 0,signature:new Uint8Array}}const CommitSig={encode(e,t=_m0.Writer.create()){return e.blockIdFlag!==0&&t.uint32(8).int32(e.blockIdFlag),e.validatorAddress.length!==0&&t.uint32(18).bytes(e.validatorAddress),e.timestamp!==void 0&&Timestamp$9.encode(toTimestamp$c(e.timestamp),t.uint32(26).fork()).ldelim(),e.signature.length!==0&&t.uint32(34).bytes(e.signature),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCommitSig();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.blockIdFlag=n.int32();break;case 2:u.validatorAddress=n.bytes();break;case 3:u.timestamp=fromTimestamp$c(Timestamp$9.decode(n,n.uint32()));break;case 4:u.signature=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{blockIdFlag:isSet$1B(e.blockIdFlag)?blockIDFlagFromJSON(e.blockIdFlag):0,validatorAddress:isSet$1B(e.validatorAddress)?bytesFromBase64$q(e.validatorAddress):new Uint8Array,timestamp:isSet$1B(e.timestamp)?fromJsonTimestamp$c(e.timestamp):void 0,signature:isSet$1B(e.signature)?bytesFromBase64$q(e.signature):new Uint8Array}},toJSON(e){const t={};return e.blockIdFlag!==void 0&&(t.blockIdFlag=blockIDFlagToJSON(e.blockIdFlag)),e.validatorAddress!==void 0&&(t.validatorAddress=base64FromBytes$q(e.validatorAddress!==void 0?e.validatorAddress:new Uint8Array)),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.signature!==void 0&&(t.signature=base64FromBytes$q(e.signature!==void 0?e.signature:new Uint8Array)),t},fromPartial(e){const t=createBaseCommitSig();return t.blockIdFlag=e.blockIdFlag??0,t.validatorAddress=e.validatorAddress??new Uint8Array,t.timestamp=e.timestamp??void 0,t.signature=e.signature??new Uint8Array,t}};function createBaseSignedHeader(){return{header:void 0,commit:void 0}}const SignedHeader={encode(e,t=_m0.Writer.create()){return e.header!==void 0&&Header$2.encode(e.header,t.uint32(10).fork()).ldelim(),e.commit!==void 0&&Commit.encode(e.commit,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseSignedHeader();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.header=Header$2.decode(n,n.uint32());break;case 2:u.commit=Commit.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{header:isSet$1B(e.header)?Header$2.fromJSON(e.header):void 0,commit:isSet$1B(e.commit)?Commit.fromJSON(e.commit):void 0}},toJSON(e){const t={};return e.header!==void 0&&(t.header=e.header?Header$2.toJSON(e.header):void 0),e.commit!==void 0&&(t.commit=e.commit?Commit.toJSON(e.commit):void 0),t},fromPartial(e){const t=createBaseSignedHeader();return t.header=e.header!==void 0&&e.header!==null?Header$2.fromPartial(e.header):void 0,t.commit=e.commit!==void 0&&e.commit!==null?Commit.fromPartial(e.commit):void 0,t}};function createBaseLightBlock(){return{signedHeader:void 0,validatorSet:void 0}}const LightBlock={encode(e,t=_m0.Writer.create()){return e.signedHeader!==void 0&&SignedHeader.encode(e.signedHeader,t.uint32(10).fork()).ldelim(),e.validatorSet!==void 0&&ValidatorSet.encode(e.validatorSet,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseLightBlock();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.signedHeader=SignedHeader.decode(n,n.uint32());break;case 2:u.validatorSet=ValidatorSet.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{signedHeader:isSet$1B(e.signedHeader)?SignedHeader.fromJSON(e.signedHeader):void 0,validatorSet:isSet$1B(e.validatorSet)?ValidatorSet.fromJSON(e.validatorSet):void 0}},toJSON(e){const t={};return e.signedHeader!==void 0&&(t.signedHeader=e.signedHeader?SignedHeader.toJSON(e.signedHeader):void 0),e.validatorSet!==void 0&&(t.validatorSet=e.validatorSet?ValidatorSet.toJSON(e.validatorSet):void 0),t},fromPartial(e){const t=createBaseLightBlock();return t.signedHeader=e.signedHeader!==void 0&&e.signedHeader!==null?SignedHeader.fromPartial(e.signedHeader):void 0,t.validatorSet=e.validatorSet!==void 0&&e.validatorSet!==null?ValidatorSet.fromPartial(e.validatorSet):void 0,t}};var globalThis$1l=(()=>{if(typeof globalThis$1l<"u")return globalThis$1l;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$q(e){if(globalThis$1l.Buffer)return Uint8Array.from(globalThis$1l.Buffer.from(e,"base64"));{const t=globalThis$1l.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$q(e){if(globalThis$1l.Buffer)return globalThis$1l.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$1l.btoa(t.join(""))}}function toTimestamp$c(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$c(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$c(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$c(Timestamp$9.fromJSON(e))}function longToNumber$U(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1l.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1B(e){return e!=null}function createBaseEvidence(){return{duplicateVoteEvidence:void 0,lightClientAttackEvidence:void 0}}const Evidence={encode(e,t=_m0.Writer.create()){return e.duplicateVoteEvidence!==void 0&&DuplicateVoteEvidence.encode(e.duplicateVoteEvidence,t.uint32(10).fork()).ldelim(),e.lightClientAttackEvidence!==void 0&&LightClientAttackEvidence.encode(e.lightClientAttackEvidence,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEvidence();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.duplicateVoteEvidence=DuplicateVoteEvidence.decode(n,n.uint32());break;case 2:u.lightClientAttackEvidence=LightClientAttackEvidence.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{duplicateVoteEvidence:isSet$1A(e.duplicateVoteEvidence)?DuplicateVoteEvidence.fromJSON(e.duplicateVoteEvidence):void 0,lightClientAttackEvidence:isSet$1A(e.lightClientAttackEvidence)?LightClientAttackEvidence.fromJSON(e.lightClientAttackEvidence):void 0}},toJSON(e){const t={};return e.duplicateVoteEvidence!==void 0&&(t.duplicateVoteEvidence=e.duplicateVoteEvidence?DuplicateVoteEvidence.toJSON(e.duplicateVoteEvidence):void 0),e.lightClientAttackEvidence!==void 0&&(t.lightClientAttackEvidence=e.lightClientAttackEvidence?LightClientAttackEvidence.toJSON(e.lightClientAttackEvidence):void 0),t},fromPartial(e){const t=createBaseEvidence();return t.duplicateVoteEvidence=e.duplicateVoteEvidence!==void 0&&e.duplicateVoteEvidence!==null?DuplicateVoteEvidence.fromPartial(e.duplicateVoteEvidence):void 0,t.lightClientAttackEvidence=e.lightClientAttackEvidence!==void 0&&e.lightClientAttackEvidence!==null?LightClientAttackEvidence.fromPartial(e.lightClientAttackEvidence):void 0,t}};function createBaseDuplicateVoteEvidence(){return{voteA:void 0,voteB:void 0,totalVotingPower:0,validatorPower:0,timestamp:void 0}}const DuplicateVoteEvidence={encode(e,t=_m0.Writer.create()){return e.voteA!==void 0&&Vote$3.encode(e.voteA,t.uint32(10).fork()).ldelim(),e.voteB!==void 0&&Vote$3.encode(e.voteB,t.uint32(18).fork()).ldelim(),e.totalVotingPower!==0&&t.uint32(24).int64(e.totalVotingPower),e.validatorPower!==0&&t.uint32(32).int64(e.validatorPower),e.timestamp!==void 0&&Timestamp$9.encode(toTimestamp$b(e.timestamp),t.uint32(42).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDuplicateVoteEvidence();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.voteA=Vote$3.decode(n,n.uint32());break;case 2:u.voteB=Vote$3.decode(n,n.uint32());break;case 3:u.totalVotingPower=longToNumber$T(n.int64());break;case 4:u.validatorPower=longToNumber$T(n.int64());break;case 5:u.timestamp=fromTimestamp$b(Timestamp$9.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{voteA:isSet$1A(e.voteA)?Vote$3.fromJSON(e.voteA):void 0,voteB:isSet$1A(e.voteB)?Vote$3.fromJSON(e.voteB):void 0,totalVotingPower:isSet$1A(e.totalVotingPower)?Number(e.totalVotingPower):0,validatorPower:isSet$1A(e.validatorPower)?Number(e.validatorPower):0,timestamp:isSet$1A(e.timestamp)?fromJsonTimestamp$b(e.timestamp):void 0}},toJSON(e){const t={};return e.voteA!==void 0&&(t.voteA=e.voteA?Vote$3.toJSON(e.voteA):void 0),e.voteB!==void 0&&(t.voteB=e.voteB?Vote$3.toJSON(e.voteB):void 0),e.totalVotingPower!==void 0&&(t.totalVotingPower=Math.round(e.totalVotingPower)),e.validatorPower!==void 0&&(t.validatorPower=Math.round(e.validatorPower)),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),t},fromPartial(e){const t=createBaseDuplicateVoteEvidence();return t.voteA=e.voteA!==void 0&&e.voteA!==null?Vote$3.fromPartial(e.voteA):void 0,t.voteB=e.voteB!==void 0&&e.voteB!==null?Vote$3.fromPartial(e.voteB):void 0,t.totalVotingPower=e.totalVotingPower??0,t.validatorPower=e.validatorPower??0,t.timestamp=e.timestamp??void 0,t}};function createBaseLightClientAttackEvidence(){return{conflictingBlock:void 0,commonHeight:0,byzantineValidators:[],totalVotingPower:0,timestamp:void 0}}const LightClientAttackEvidence={encode(e,t=_m0.Writer.create()){e.conflictingBlock!==void 0&&LightBlock.encode(e.conflictingBlock,t.uint32(10).fork()).ldelim(),e.commonHeight!==0&&t.uint32(16).int64(e.commonHeight);for(const n of e.byzantineValidators)Validator$2.encode(n,t.uint32(26).fork()).ldelim();return e.totalVotingPower!==0&&t.uint32(32).int64(e.totalVotingPower),e.timestamp!==void 0&&Timestamp$9.encode(toTimestamp$b(e.timestamp),t.uint32(42).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseLightClientAttackEvidence();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.conflictingBlock=LightBlock.decode(n,n.uint32());break;case 2:u.commonHeight=longToNumber$T(n.int64());break;case 3:u.byzantineValidators.push(Validator$2.decode(n,n.uint32()));break;case 4:u.totalVotingPower=longToNumber$T(n.int64());break;case 5:u.timestamp=fromTimestamp$b(Timestamp$9.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{conflictingBlock:isSet$1A(e.conflictingBlock)?LightBlock.fromJSON(e.conflictingBlock):void 0,commonHeight:isSet$1A(e.commonHeight)?Number(e.commonHeight):0,byzantineValidators:Array.isArray(e==null?void 0:e.byzantineValidators)?e.byzantineValidators.map(t=>Validator$2.fromJSON(t)):[],totalVotingPower:isSet$1A(e.totalVotingPower)?Number(e.totalVotingPower):0,timestamp:isSet$1A(e.timestamp)?fromJsonTimestamp$b(e.timestamp):void 0}},toJSON(e){const t={};return e.conflictingBlock!==void 0&&(t.conflictingBlock=e.conflictingBlock?LightBlock.toJSON(e.conflictingBlock):void 0),e.commonHeight!==void 0&&(t.commonHeight=Math.round(e.commonHeight)),e.byzantineValidators?t.byzantineValidators=e.byzantineValidators.map(n=>n?Validator$2.toJSON(n):void 0):t.byzantineValidators=[],e.totalVotingPower!==void 0&&(t.totalVotingPower=Math.round(e.totalVotingPower)),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),t},fromPartial(e){var n;const t=createBaseLightClientAttackEvidence();return t.conflictingBlock=e.conflictingBlock!==void 0&&e.conflictingBlock!==null?LightBlock.fromPartial(e.conflictingBlock):void 0,t.commonHeight=e.commonHeight??0,t.byzantineValidators=((n=e.byzantineValidators)==null?void 0:n.map(p=>Validator$2.fromPartial(p)))||[],t.totalVotingPower=e.totalVotingPower??0,t.timestamp=e.timestamp??void 0,t}};function createBaseEvidenceList(){return{evidence:[]}}const EvidenceList={encode(e,t=_m0.Writer.create()){for(const n of e.evidence)Evidence.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEvidenceList();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.evidence.push(Evidence.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{evidence:Array.isArray(e==null?void 0:e.evidence)?e.evidence.map(t=>Evidence.fromJSON(t)):[]}},toJSON(e){const t={};return e.evidence?t.evidence=e.evidence.map(n=>n?Evidence.toJSON(n):void 0):t.evidence=[],t},fromPartial(e){var n;const t=createBaseEvidenceList();return t.evidence=((n=e.evidence)==null?void 0:n.map(p=>Evidence.fromPartial(p)))||[],t}};var globalThis$1k=(()=>{if(typeof globalThis$1k<"u")return globalThis$1k;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function toTimestamp$b(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$b(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$b(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$b(Timestamp$9.fromJSON(e))}function longToNumber$T(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1k.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1A(e){return e!=null}var globalThis$1j=(()=>{if(typeof globalThis$1j<"u")return globalThis$1j;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function createBaseBlock(){return{header:void 0,data:void 0,evidence:void 0,lastCommit:void 0}}const Block={encode(e,t=_m0.Writer.create()){return e.header!==void 0&&Header$1.encode(e.header,t.uint32(10).fork()).ldelim(),e.data!==void 0&&Data.encode(e.data,t.uint32(18).fork()).ldelim(),e.evidence!==void 0&&EvidenceList.encode(e.evidence,t.uint32(26).fork()).ldelim(),e.lastCommit!==void 0&&Commit.encode(e.lastCommit,t.uint32(34).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseBlock();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.header=Header$1.decode(n,n.uint32());break;case 2:u.data=Data.decode(n,n.uint32());break;case 3:u.evidence=EvidenceList.decode(n,n.uint32());break;case 4:u.lastCommit=Commit.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{header:isSet$1z(e.header)?Header$1.fromJSON(e.header):void 0,data:isSet$1z(e.data)?Data.fromJSON(e.data):void 0,evidence:isSet$1z(e.evidence)?EvidenceList.fromJSON(e.evidence):void 0,lastCommit:isSet$1z(e.lastCommit)?Commit.fromJSON(e.lastCommit):void 0}},toJSON(e){const t={};return e.header!==void 0&&(t.header=e.header?Header$1.toJSON(e.header):void 0),e.data!==void 0&&(t.data=e.data?Data.toJSON(e.data):void 0),e.evidence!==void 0&&(t.evidence=e.evidence?EvidenceList.toJSON(e.evidence):void 0),e.lastCommit!==void 0&&(t.lastCommit=e.lastCommit?Commit.toJSON(e.lastCommit):void 0),t},fromPartial(e){const t=createBaseBlock();return t.header=e.header!==void 0&&e.header!==null?Header$1.fromPartial(e.header):void 0,t.data=e.data!==void 0&&e.data!==null?Data.fromPartial(e.data):void 0,t.evidence=e.evidence!==void 0&&e.evidence!==null?EvidenceList.fromPartial(e.evidence):void 0,t.lastCommit=e.lastCommit!==void 0&&e.lastCommit!==null?Commit.fromPartial(e.lastCommit):void 0,t}};function createBaseHeader$1(){return{version:void 0,chainId:"",height:0,time:void 0,lastBlockId:void 0,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:""}}const Header$1={encode(e,t=_m0.Writer.create()){return e.version!==void 0&&Consensus$1.encode(e.version,t.uint32(10).fork()).ldelim(),e.chainId!==""&&t.uint32(18).string(e.chainId),e.height!==0&&t.uint32(24).int64(e.height),e.time!==void 0&&Timestamp$9.encode(toTimestamp$a(e.time),t.uint32(34).fork()).ldelim(),e.lastBlockId!==void 0&&BlockID$1.encode(e.lastBlockId,t.uint32(42).fork()).ldelim(),e.lastCommitHash.length!==0&&t.uint32(50).bytes(e.lastCommitHash),e.dataHash.length!==0&&t.uint32(58).bytes(e.dataHash),e.validatorsHash.length!==0&&t.uint32(66).bytes(e.validatorsHash),e.nextValidatorsHash.length!==0&&t.uint32(74).bytes(e.nextValidatorsHash),e.consensusHash.length!==0&&t.uint32(82).bytes(e.consensusHash),e.appHash.length!==0&&t.uint32(90).bytes(e.appHash),e.lastResultsHash.length!==0&&t.uint32(98).bytes(e.lastResultsHash),e.evidenceHash.length!==0&&t.uint32(106).bytes(e.evidenceHash),e.proposerAddress!==""&&t.uint32(114).string(e.proposerAddress),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseHeader$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.version=Consensus$1.decode(n,n.uint32());break;case 2:u.chainId=n.string();break;case 3:u.height=longToNumber$S(n.int64());break;case 4:u.time=fromTimestamp$a(Timestamp$9.decode(n,n.uint32()));break;case 5:u.lastBlockId=BlockID$1.decode(n,n.uint32());break;case 6:u.lastCommitHash=n.bytes();break;case 7:u.dataHash=n.bytes();break;case 8:u.validatorsHash=n.bytes();break;case 9:u.nextValidatorsHash=n.bytes();break;case 10:u.consensusHash=n.bytes();break;case 11:u.appHash=n.bytes();break;case 12:u.lastResultsHash=n.bytes();break;case 13:u.evidenceHash=n.bytes();break;case 14:u.proposerAddress=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{version:isSet$1z(e.version)?Consensus$1.fromJSON(e.version):void 0,chainId:isSet$1z(e.chainId)?String(e.chainId):"",height:isSet$1z(e.height)?Number(e.height):0,time:isSet$1z(e.time)?fromJsonTimestamp$a(e.time):void 0,lastBlockId:isSet$1z(e.lastBlockId)?BlockID$1.fromJSON(e.lastBlockId):void 0,lastCommitHash:isSet$1z(e.lastCommitHash)?bytesFromBase64$p(e.lastCommitHash):new Uint8Array,dataHash:isSet$1z(e.dataHash)?bytesFromBase64$p(e.dataHash):new Uint8Array,validatorsHash:isSet$1z(e.validatorsHash)?bytesFromBase64$p(e.validatorsHash):new Uint8Array,nextValidatorsHash:isSet$1z(e.nextValidatorsHash)?bytesFromBase64$p(e.nextValidatorsHash):new Uint8Array,consensusHash:isSet$1z(e.consensusHash)?bytesFromBase64$p(e.consensusHash):new Uint8Array,appHash:isSet$1z(e.appHash)?bytesFromBase64$p(e.appHash):new Uint8Array,lastResultsHash:isSet$1z(e.lastResultsHash)?bytesFromBase64$p(e.lastResultsHash):new Uint8Array,evidenceHash:isSet$1z(e.evidenceHash)?bytesFromBase64$p(e.evidenceHash):new Uint8Array,proposerAddress:isSet$1z(e.proposerAddress)?String(e.proposerAddress):""}},toJSON(e){const t={};return e.version!==void 0&&(t.version=e.version?Consensus$1.toJSON(e.version):void 0),e.chainId!==void 0&&(t.chainId=e.chainId),e.height!==void 0&&(t.height=Math.round(e.height)),e.time!==void 0&&(t.time=e.time.toISOString()),e.lastBlockId!==void 0&&(t.lastBlockId=e.lastBlockId?BlockID$1.toJSON(e.lastBlockId):void 0),e.lastCommitHash!==void 0&&(t.lastCommitHash=base64FromBytes$p(e.lastCommitHash!==void 0?e.lastCommitHash:new Uint8Array)),e.dataHash!==void 0&&(t.dataHash=base64FromBytes$p(e.dataHash!==void 0?e.dataHash:new Uint8Array)),e.validatorsHash!==void 0&&(t.validatorsHash=base64FromBytes$p(e.validatorsHash!==void 0?e.validatorsHash:new Uint8Array)),e.nextValidatorsHash!==void 0&&(t.nextValidatorsHash=base64FromBytes$p(e.nextValidatorsHash!==void 0?e.nextValidatorsHash:new Uint8Array)),e.consensusHash!==void 0&&(t.consensusHash=base64FromBytes$p(e.consensusHash!==void 0?e.consensusHash:new Uint8Array)),e.appHash!==void 0&&(t.appHash=base64FromBytes$p(e.appHash!==void 0?e.appHash:new Uint8Array)),e.lastResultsHash!==void 0&&(t.lastResultsHash=base64FromBytes$p(e.lastResultsHash!==void 0?e.lastResultsHash:new Uint8Array)),e.evidenceHash!==void 0&&(t.evidenceHash=base64FromBytes$p(e.evidenceHash!==void 0?e.evidenceHash:new Uint8Array)),e.proposerAddress!==void 0&&(t.proposerAddress=e.proposerAddress),t},fromPartial(e){const t=createBaseHeader$1();return t.version=e.version!==void 0&&e.version!==null?Consensus$1.fromPartial(e.version):void 0,t.chainId=e.chainId??"",t.height=e.height??0,t.time=e.time??void 0,t.lastBlockId=e.lastBlockId!==void 0&&e.lastBlockId!==null?BlockID$1.fromPartial(e.lastBlockId):void 0,t.lastCommitHash=e.lastCommitHash??new Uint8Array,t.dataHash=e.dataHash??new Uint8Array,t.validatorsHash=e.validatorsHash??new Uint8Array,t.nextValidatorsHash=e.nextValidatorsHash??new Uint8Array,t.consensusHash=e.consensusHash??new Uint8Array,t.appHash=e.appHash??new Uint8Array,t.lastResultsHash=e.lastResultsHash??new Uint8Array,t.evidenceHash=e.evidenceHash??new Uint8Array,t.proposerAddress=e.proposerAddress??"",t}};var globalThis$1i=(()=>{if(typeof globalThis$1i<"u")return globalThis$1i;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$p(e){if(globalThis$1i.Buffer)return Uint8Array.from(globalThis$1i.Buffer.from(e,"base64"));{const t=globalThis$1i.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$p(e){if(globalThis$1i.Buffer)return globalThis$1i.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$1i.btoa(t.join(""))}}function toTimestamp$a(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$a(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$a(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$a(Timestamp$9.fromJSON(e))}function longToNumber$S(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1i.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1z(e){return e!=null}function createBaseValidator$1(){return{address:"",pubKey:void 0,votingPower:0,proposerPriority:0}}const Validator$1={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.pubKey!==void 0&&Any$b.encode(e.pubKey,t.uint32(18).fork()).ldelim(),e.votingPower!==0&&t.uint32(24).int64(e.votingPower),e.proposerPriority!==0&&t.uint32(32).int64(e.proposerPriority),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidator$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.pubKey=Any$b.decode(n,n.uint32());break;case 3:u.votingPower=longToNumber$R(n.int64());break;case 4:u.proposerPriority=longToNumber$R(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$1y(e.address)?String(e.address):"",pubKey:isSet$1y(e.pubKey)?Any$b.fromJSON(e.pubKey):void 0,votingPower:isSet$1y(e.votingPower)?Number(e.votingPower):0,proposerPriority:isSet$1y(e.proposerPriority)?Number(e.proposerPriority):0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.pubKey!==void 0&&(t.pubKey=e.pubKey?Any$b.toJSON(e.pubKey):void 0),e.votingPower!==void 0&&(t.votingPower=Math.round(e.votingPower)),e.proposerPriority!==void 0&&(t.proposerPriority=Math.round(e.proposerPriority)),t},fromPartial(e){const t=createBaseValidator$1();return t.address=e.address??"",t.pubKey=e.pubKey!==void 0&&e.pubKey!==null?Any$b.fromPartial(e.pubKey):void 0,t.votingPower=e.votingPower??0,t.proposerPriority=e.proposerPriority??0,t}};function createBaseVersionInfo(){return{name:"",appName:"",version:"",gitCommit:"",buildTags:"",goVersion:"",buildDeps:[],cosmosSdkVersion:""}}const VersionInfo={encode(e,t=_m0.Writer.create()){e.name!==""&&t.uint32(10).string(e.name),e.appName!==""&&t.uint32(18).string(e.appName),e.version!==""&&t.uint32(26).string(e.version),e.gitCommit!==""&&t.uint32(34).string(e.gitCommit),e.buildTags!==""&&t.uint32(42).string(e.buildTags),e.goVersion!==""&&t.uint32(50).string(e.goVersion);for(const n of e.buildDeps)Module$p.encode(n,t.uint32(58).fork()).ldelim();return e.cosmosSdkVersion!==""&&t.uint32(66).string(e.cosmosSdkVersion),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseVersionInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.name=n.string();break;case 2:u.appName=n.string();break;case 3:u.version=n.string();break;case 4:u.gitCommit=n.string();break;case 5:u.buildTags=n.string();break;case 6:u.goVersion=n.string();break;case 7:u.buildDeps.push(Module$p.decode(n,n.uint32()));break;case 8:u.cosmosSdkVersion=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{name:isSet$1y(e.name)?String(e.name):"",appName:isSet$1y(e.appName)?String(e.appName):"",version:isSet$1y(e.version)?String(e.version):"",gitCommit:isSet$1y(e.gitCommit)?String(e.gitCommit):"",buildTags:isSet$1y(e.buildTags)?String(e.buildTags):"",goVersion:isSet$1y(e.goVersion)?String(e.goVersion):"",buildDeps:Array.isArray(e==null?void 0:e.buildDeps)?e.buildDeps.map(t=>Module$p.fromJSON(t)):[],cosmosSdkVersion:isSet$1y(e.cosmosSdkVersion)?String(e.cosmosSdkVersion):""}},toJSON(e){const t={};return e.name!==void 0&&(t.name=e.name),e.appName!==void 0&&(t.appName=e.appName),e.version!==void 0&&(t.version=e.version),e.gitCommit!==void 0&&(t.gitCommit=e.gitCommit),e.buildTags!==void 0&&(t.buildTags=e.buildTags),e.goVersion!==void 0&&(t.goVersion=e.goVersion),e.buildDeps?t.buildDeps=e.buildDeps.map(n=>n?Module$p.toJSON(n):void 0):t.buildDeps=[],e.cosmosSdkVersion!==void 0&&(t.cosmosSdkVersion=e.cosmosSdkVersion),t},fromPartial(e){var n;const t=createBaseVersionInfo();return t.name=e.name??"",t.appName=e.appName??"",t.version=e.version??"",t.gitCommit=e.gitCommit??"",t.buildTags=e.buildTags??"",t.goVersion=e.goVersion??"",t.buildDeps=((n=e.buildDeps)==null?void 0:n.map(p=>Module$p.fromPartial(p)))||[],t.cosmosSdkVersion=e.cosmosSdkVersion??"",t}};function createBaseModule(){return{path:"",version:"",sum:""}}const Module$p={encode(e,t=_m0.Writer.create()){return e.path!==""&&t.uint32(10).string(e.path),e.version!==""&&t.uint32(18).string(e.version),e.sum!==""&&t.uint32(26).string(e.sum),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseModule();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.path=n.string();break;case 2:u.version=n.string();break;case 3:u.sum=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{path:isSet$1y(e.path)?String(e.path):"",version:isSet$1y(e.version)?String(e.version):"",sum:isSet$1y(e.sum)?String(e.sum):""}},toJSON(e){const t={};return e.path!==void 0&&(t.path=e.path),e.version!==void 0&&(t.version=e.version),e.sum!==void 0&&(t.sum=e.sum),t},fromPartial(e){const t=createBaseModule();return t.path=e.path??"",t.version=e.version??"",t.sum=e.sum??"",t}};function createBaseProofOp(){return{type:"",key:new Uint8Array,data:new Uint8Array}}const ProofOp={encode(e,t=_m0.Writer.create()){return e.type!==""&&t.uint32(10).string(e.type),e.key.length!==0&&t.uint32(18).bytes(e.key),e.data.length!==0&&t.uint32(26).bytes(e.data),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseProofOp();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.type=n.string();break;case 2:u.key=n.bytes();break;case 3:u.data=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{type:isSet$1y(e.type)?String(e.type):"",key:isSet$1y(e.key)?bytesFromBase64$o(e.key):new Uint8Array,data:isSet$1y(e.data)?bytesFromBase64$o(e.data):new Uint8Array}},toJSON(e){const t={};return e.type!==void 0&&(t.type=e.type),e.key!==void 0&&(t.key=base64FromBytes$o(e.key!==void 0?e.key:new Uint8Array)),e.data!==void 0&&(t.data=base64FromBytes$o(e.data!==void 0?e.data:new Uint8Array)),t},fromPartial(e){const t=createBaseProofOp();return t.type=e.type??"",t.key=e.key??new Uint8Array,t.data=e.data??new Uint8Array,t}};function createBaseProofOps(){return{ops:[]}}const ProofOps={encode(e,t=_m0.Writer.create()){for(const n of e.ops)ProofOp.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseProofOps();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.ops.push(ProofOp.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{ops:Array.isArray(e==null?void 0:e.ops)?e.ops.map(t=>ProofOp.fromJSON(t)):[]}},toJSON(e){const t={};return e.ops?t.ops=e.ops.map(n=>n?ProofOp.toJSON(n):void 0):t.ops=[],t},fromPartial(e){var n;const t=createBaseProofOps();return t.ops=((n=e.ops)==null?void 0:n.map(p=>ProofOp.fromPartial(p)))||[],t}};var globalThis$1h=(()=>{if(typeof globalThis$1h<"u")return globalThis$1h;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$o(e){if(globalThis$1h.Buffer)return Uint8Array.from(globalThis$1h.Buffer.from(e,"base64"));{const t=globalThis$1h.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$o(e){if(globalThis$1h.Buffer)return globalThis$1h.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$1h.btoa(t.join(""))}}function longToNumber$R(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1h.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1y(e){return e!=null}new build$b.Registry(msgTypes$o);function getStructure$m(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$o=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$o=({addr:e}={addr:"http://localhost:1317"})=>new Api$o({baseURL:e});let SDKModule$o=class{constructor(t){this.registry=[],this.query=queryClient$o({addr:t.env.apiURL}),this.updateTX(t),this.structure={Validator:getStructure$m(Validator$1.fromPartial({})),VersionInfo:getStructure$m(VersionInfo.fromPartial({})),Module:getStructure$m(Module$p.fromPartial({})),ProofOp:getStructure$m(ProofOp.fromPartial({})),ProofOps:getStructure$m(ProofOps.fromPartial({})),Block:getStructure$m(Block.fromPartial({})),Header:getStructure$m(Header$1.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$o({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$o=e=>({module:{CosmosBaseTendermintV1Beta1:new SDKModule$o(e)},registry:msgTypes$o}),module$1=Object.freeze(Object.defineProperty({__proto__:null,default:Module$o,queryClient:queryClient$o,txClient:txClient$o},Symbol.toStringTag,{value:"Module"}));function createBaseDuration$6(){return{seconds:0,nanos:0}}const Duration$6={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDuration$6();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$Q(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$1x(e.seconds)?Number(e.seconds):0,nanos:isSet$1x(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseDuration$6();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$1g=(()=>{if(typeof globalThis$1g<"u")return globalThis$1g;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$Q(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1g.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1x(e){return e!=null}function createBaseBlockParams(){return{maxBytes:0,maxGas:0}}const BlockParams={encode(e,t=_m0.Writer.create()){return e.maxBytes!==0&&t.uint32(8).int64(e.maxBytes),e.maxGas!==0&&t.uint32(16).int64(e.maxGas),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseBlockParams();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.maxBytes=longToNumber$P(n.int64());break;case 2:u.maxGas=longToNumber$P(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{maxBytes:isSet$1w(e.maxBytes)?Number(e.maxBytes):0,maxGas:isSet$1w(e.maxGas)?Number(e.maxGas):0}},toJSON(e){const t={};return e.maxBytes!==void 0&&(t.maxBytes=Math.round(e.maxBytes)),e.maxGas!==void 0&&(t.maxGas=Math.round(e.maxGas)),t},fromPartial(e){const t=createBaseBlockParams();return t.maxBytes=e.maxBytes??0,t.maxGas=e.maxGas??0,t}};function createBaseEvidenceParams(){return{maxAgeNumBlocks:0,maxAgeDuration:void 0,maxBytes:0}}const EvidenceParams={encode(e,t=_m0.Writer.create()){return e.maxAgeNumBlocks!==0&&t.uint32(8).int64(e.maxAgeNumBlocks),e.maxAgeDuration!==void 0&&Duration$6.encode(e.maxAgeDuration,t.uint32(18).fork()).ldelim(),e.maxBytes!==0&&t.uint32(24).int64(e.maxBytes),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEvidenceParams();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.maxAgeNumBlocks=longToNumber$P(n.int64());break;case 2:u.maxAgeDuration=Duration$6.decode(n,n.uint32());break;case 3:u.maxBytes=longToNumber$P(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{maxAgeNumBlocks:isSet$1w(e.maxAgeNumBlocks)?Number(e.maxAgeNumBlocks):0,maxAgeDuration:isSet$1w(e.maxAgeDuration)?Duration$6.fromJSON(e.maxAgeDuration):void 0,maxBytes:isSet$1w(e.maxBytes)?Number(e.maxBytes):0}},toJSON(e){const t={};return e.maxAgeNumBlocks!==void 0&&(t.maxAgeNumBlocks=Math.round(e.maxAgeNumBlocks)),e.maxAgeDuration!==void 0&&(t.maxAgeDuration=e.maxAgeDuration?Duration$6.toJSON(e.maxAgeDuration):void 0),e.maxBytes!==void 0&&(t.maxBytes=Math.round(e.maxBytes)),t},fromPartial(e){const t=createBaseEvidenceParams();return t.maxAgeNumBlocks=e.maxAgeNumBlocks??0,t.maxAgeDuration=e.maxAgeDuration!==void 0&&e.maxAgeDuration!==null?Duration$6.fromPartial(e.maxAgeDuration):void 0,t.maxBytes=e.maxBytes??0,t}};function createBaseValidatorParams(){return{pubKeyTypes:[]}}const ValidatorParams={encode(e,t=_m0.Writer.create()){for(const n of e.pubKeyTypes)t.uint32(10).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorParams();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.pubKeyTypes.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{pubKeyTypes:Array.isArray(e==null?void 0:e.pubKeyTypes)?e.pubKeyTypes.map(t=>String(t)):[]}},toJSON(e){const t={};return e.pubKeyTypes?t.pubKeyTypes=e.pubKeyTypes.map(n=>n):t.pubKeyTypes=[],t},fromPartial(e){var n;const t=createBaseValidatorParams();return t.pubKeyTypes=((n=e.pubKeyTypes)==null?void 0:n.map(p=>p))||[],t}};var globalThis$1f=(()=>{if(typeof globalThis$1f<"u")return globalThis$1f;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$P(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1f.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1w(e){return e!=null}function createBaseMsgUpdateParams$3(){return{authority:"",block:void 0,evidence:void 0,validator:void 0}}const MsgUpdateParams$3={encode(e,t=_m0.Writer.create()){return e.authority!==""&&t.uint32(10).string(e.authority),e.block!==void 0&&BlockParams.encode(e.block,t.uint32(18).fork()).ldelim(),e.evidence!==void 0&&EvidenceParams.encode(e.evidence,t.uint32(26).fork()).ldelim(),e.validator!==void 0&&ValidatorParams.encode(e.validator,t.uint32(34).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateParams$3();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.authority=n.string();break;case 2:u.block=BlockParams.decode(n,n.uint32());break;case 3:u.evidence=EvidenceParams.decode(n,n.uint32());break;case 4:u.validator=ValidatorParams.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{authority:isSet$1v(e.authority)?String(e.authority):"",block:isSet$1v(e.block)?BlockParams.fromJSON(e.block):void 0,evidence:isSet$1v(e.evidence)?EvidenceParams.fromJSON(e.evidence):void 0,validator:isSet$1v(e.validator)?ValidatorParams.fromJSON(e.validator):void 0}},toJSON(e){const t={};return e.authority!==void 0&&(t.authority=e.authority),e.block!==void 0&&(t.block=e.block?BlockParams.toJSON(e.block):void 0),e.evidence!==void 0&&(t.evidence=e.evidence?EvidenceParams.toJSON(e.evidence):void 0),e.validator!==void 0&&(t.validator=e.validator?ValidatorParams.toJSON(e.validator):void 0),t},fromPartial(e){const t=createBaseMsgUpdateParams$3();return t.authority=e.authority??"",t.block=e.block!==void 0&&e.block!==null?BlockParams.fromPartial(e.block):void 0,t.evidence=e.evidence!==void 0&&e.evidence!==null?EvidenceParams.fromPartial(e.evidence):void 0,t.validator=e.validator!==void 0&&e.validator!==null?ValidatorParams.fromPartial(e.validator):void 0,t}};function isSet$1v(e){return e!=null}const msgTypes$n=[["/cosmos.consensus.v1.MsgUpdateParams",MsgUpdateParams$3]];let HttpClient$n=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$n=class extends HttpClient$n{constructor(){super(...arguments),this.queryParams=(t={})=>this.request({path:"/cosmos/consensus/v1/params",method:"GET",format:"json",...t})}};const registry$e=new build$b.Registry(msgTypes$n),defaultFee$d={amount:[],gas:"200000"},txClient$n=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgUpdateParams({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateParams: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$e,prefix:t});let N=this.msgUpdateParams({value:MsgUpdateParams$3.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$d,g)}catch(y){throw new Error("TxClient:sendMsgUpdateParams: Could not broadcast Tx: "+y.message)}},msgUpdateParams({value:p}){try{return{typeUrl:"/cosmos.consensus.v1.MsgUpdateParams",value:MsgUpdateParams$3.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateParams: Could not create message: "+u.message)}}}),queryClient$n=({addr:e}={addr:"http://localhost:1317"})=>new Api$n({baseURL:e});let SDKModule$n=class{constructor(t){this.registry=[],this.query=queryClient$n({addr:t.env.apiURL}),this.updateTX(t),this.structure={},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$n({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$n=e=>({module:{CosmosConsensusV1:new SDKModule$n(e)},registry:msgTypes$n});function createBaseCoin$9(){return{denom:"",amount:""}}const Coin$9={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin$9();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$1u(e.denom)?String(e.denom):"",amount:isSet$1u(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin$9();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$1u(e){return e!=null}function createBaseMsgVerifyInvariant(){return{sender:"",invariantModuleName:"",invariantRoute:""}}const MsgVerifyInvariant={encode(e,t=_m0.Writer.create()){return e.sender!==""&&t.uint32(10).string(e.sender),e.invariantModuleName!==""&&t.uint32(18).string(e.invariantModuleName),e.invariantRoute!==""&&t.uint32(26).string(e.invariantRoute),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgVerifyInvariant();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.sender=n.string();break;case 2:u.invariantModuleName=n.string();break;case 3:u.invariantRoute=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{sender:isSet$1t(e.sender)?String(e.sender):"",invariantModuleName:isSet$1t(e.invariantModuleName)?String(e.invariantModuleName):"",invariantRoute:isSet$1t(e.invariantRoute)?String(e.invariantRoute):""}},toJSON(e){const t={};return e.sender!==void 0&&(t.sender=e.sender),e.invariantModuleName!==void 0&&(t.invariantModuleName=e.invariantModuleName),e.invariantRoute!==void 0&&(t.invariantRoute=e.invariantRoute),t},fromPartial(e){const t=createBaseMsgVerifyInvariant();return t.sender=e.sender??"",t.invariantModuleName=e.invariantModuleName??"",t.invariantRoute=e.invariantRoute??"",t}};function createBaseMsgUpdateParams$2(){return{authority:"",constantFee:void 0}}const MsgUpdateParams$2={encode(e,t=_m0.Writer.create()){return e.authority!==""&&t.uint32(10).string(e.authority),e.constantFee!==void 0&&Coin$9.encode(e.constantFee,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateParams$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.authority=n.string();break;case 2:u.constantFee=Coin$9.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{authority:isSet$1t(e.authority)?String(e.authority):"",constantFee:isSet$1t(e.constantFee)?Coin$9.fromJSON(e.constantFee):void 0}},toJSON(e){const t={};return e.authority!==void 0&&(t.authority=e.authority),e.constantFee!==void 0&&(t.constantFee=e.constantFee?Coin$9.toJSON(e.constantFee):void 0),t},fromPartial(e){const t=createBaseMsgUpdateParams$2();return t.authority=e.authority??"",t.constantFee=e.constantFee!==void 0&&e.constantFee!==null?Coin$9.fromPartial(e.constantFee):void 0,t}};function isSet$1t(e){return e!=null}const msgTypes$m=[["/cosmos.crisis.v1beta1.MsgVerifyInvariant",MsgVerifyInvariant],["/cosmos.crisis.v1beta1.MsgUpdateParams",MsgUpdateParams$2]];let HttpClient$m=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$m=class extends HttpClient$m{};const registry$d=new build$b.Registry(msgTypes$m),defaultFee$c={amount:[],gas:"200000"},txClient$m=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgVerifyInvariant({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgVerifyInvariant: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$d,prefix:t});let N=this.msgVerifyInvariant({value:MsgVerifyInvariant.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$c,g)}catch(y){throw new Error("TxClient:sendMsgVerifyInvariant: Could not broadcast Tx: "+y.message)}},async sendMsgUpdateParams({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateParams: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$d,prefix:t});let N=this.msgUpdateParams({value:MsgUpdateParams$2.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$c,g)}catch(y){throw new Error("TxClient:sendMsgUpdateParams: Could not broadcast Tx: "+y.message)}},msgVerifyInvariant({value:p}){try{return{typeUrl:"/cosmos.crisis.v1beta1.MsgVerifyInvariant",value:MsgVerifyInvariant.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgVerifyInvariant: Could not create message: "+u.message)}},msgUpdateParams({value:p}){try{return{typeUrl:"/cosmos.crisis.v1beta1.MsgUpdateParams",value:MsgUpdateParams$2.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateParams: Could not create message: "+u.message)}}}),queryClient$m=({addr:e}={addr:"http://localhost:1317"})=>new Api$m({baseURL:e});let SDKModule$m=class{constructor(t){this.registry=[],this.query=queryClient$m({addr:t.env.apiURL}),this.updateTX(t),this.structure={},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$m({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$m=e=>({module:{CosmosCrisisV1Beta1:new SDKModule$m(e)},registry:msgTypes$m});function createBaseCoin$8(){return{denom:"",amount:""}}const Coin$8={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin$8();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$1s(e.denom)?String(e.denom):"",amount:isSet$1s(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin$8();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function createBaseDecCoin(){return{denom:"",amount:""}}const DecCoin={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDecCoin();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$1s(e.denom)?String(e.denom):"",amount:isSet$1s(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseDecCoin();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$1s(e){return e!=null}function createBaseParams$b(){return{communityTax:"",baseProposerReward:"",bonusProposerReward:"",withdrawAddrEnabled:!1}}const Params$b={encode(e,t=_m0.Writer.create()){return e.communityTax!==""&&t.uint32(10).string(e.communityTax),e.baseProposerReward!==""&&t.uint32(18).string(e.baseProposerReward),e.bonusProposerReward!==""&&t.uint32(26).string(e.bonusProposerReward),e.withdrawAddrEnabled===!0&&t.uint32(32).bool(e.withdrawAddrEnabled),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$b();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.communityTax=n.string();break;case 2:u.baseProposerReward=n.string();break;case 3:u.bonusProposerReward=n.string();break;case 4:u.withdrawAddrEnabled=n.bool();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{communityTax:isSet$1r(e.communityTax)?String(e.communityTax):"",baseProposerReward:isSet$1r(e.baseProposerReward)?String(e.baseProposerReward):"",bonusProposerReward:isSet$1r(e.bonusProposerReward)?String(e.bonusProposerReward):"",withdrawAddrEnabled:isSet$1r(e.withdrawAddrEnabled)?!!e.withdrawAddrEnabled:!1}},toJSON(e){const t={};return e.communityTax!==void 0&&(t.communityTax=e.communityTax),e.baseProposerReward!==void 0&&(t.baseProposerReward=e.baseProposerReward),e.bonusProposerReward!==void 0&&(t.bonusProposerReward=e.bonusProposerReward),e.withdrawAddrEnabled!==void 0&&(t.withdrawAddrEnabled=e.withdrawAddrEnabled),t},fromPartial(e){const t=createBaseParams$b();return t.communityTax=e.communityTax??"",t.baseProposerReward=e.baseProposerReward??"",t.bonusProposerReward=e.bonusProposerReward??"",t.withdrawAddrEnabled=e.withdrawAddrEnabled??!1,t}};function createBaseValidatorHistoricalRewards(){return{cumulativeRewardRatio:[],referenceCount:0}}const ValidatorHistoricalRewards={encode(e,t=_m0.Writer.create()){for(const n of e.cumulativeRewardRatio)DecCoin.encode(n,t.uint32(10).fork()).ldelim();return e.referenceCount!==0&&t.uint32(16).uint32(e.referenceCount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorHistoricalRewards();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.cumulativeRewardRatio.push(DecCoin.decode(n,n.uint32()));break;case 2:u.referenceCount=n.uint32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{cumulativeRewardRatio:Array.isArray(e==null?void 0:e.cumulativeRewardRatio)?e.cumulativeRewardRatio.map(t=>DecCoin.fromJSON(t)):[],referenceCount:isSet$1r(e.referenceCount)?Number(e.referenceCount):0}},toJSON(e){const t={};return e.cumulativeRewardRatio?t.cumulativeRewardRatio=e.cumulativeRewardRatio.map(n=>n?DecCoin.toJSON(n):void 0):t.cumulativeRewardRatio=[],e.referenceCount!==void 0&&(t.referenceCount=Math.round(e.referenceCount)),t},fromPartial(e){var n;const t=createBaseValidatorHistoricalRewards();return t.cumulativeRewardRatio=((n=e.cumulativeRewardRatio)==null?void 0:n.map(p=>DecCoin.fromPartial(p)))||[],t.referenceCount=e.referenceCount??0,t}};function createBaseValidatorCurrentRewards(){return{rewards:[],period:0}}const ValidatorCurrentRewards={encode(e,t=_m0.Writer.create()){for(const n of e.rewards)DecCoin.encode(n,t.uint32(10).fork()).ldelim();return e.period!==0&&t.uint32(16).uint64(e.period),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorCurrentRewards();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.rewards.push(DecCoin.decode(n,n.uint32()));break;case 2:u.period=longToNumber$O(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{rewards:Array.isArray(e==null?void 0:e.rewards)?e.rewards.map(t=>DecCoin.fromJSON(t)):[],period:isSet$1r(e.period)?Number(e.period):0}},toJSON(e){const t={};return e.rewards?t.rewards=e.rewards.map(n=>n?DecCoin.toJSON(n):void 0):t.rewards=[],e.period!==void 0&&(t.period=Math.round(e.period)),t},fromPartial(e){var n;const t=createBaseValidatorCurrentRewards();return t.rewards=((n=e.rewards)==null?void 0:n.map(p=>DecCoin.fromPartial(p)))||[],t.period=e.period??0,t}};function createBaseValidatorAccumulatedCommission(){return{commission:[]}}const ValidatorAccumulatedCommission={encode(e,t=_m0.Writer.create()){for(const n of e.commission)DecCoin.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorAccumulatedCommission();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.commission.push(DecCoin.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{commission:Array.isArray(e==null?void 0:e.commission)?e.commission.map(t=>DecCoin.fromJSON(t)):[]}},toJSON(e){const t={};return e.commission?t.commission=e.commission.map(n=>n?DecCoin.toJSON(n):void 0):t.commission=[],t},fromPartial(e){var n;const t=createBaseValidatorAccumulatedCommission();return t.commission=((n=e.commission)==null?void 0:n.map(p=>DecCoin.fromPartial(p)))||[],t}};function createBaseValidatorOutstandingRewards(){return{rewards:[]}}const ValidatorOutstandingRewards={encode(e,t=_m0.Writer.create()){for(const n of e.rewards)DecCoin.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorOutstandingRewards();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.rewards.push(DecCoin.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{rewards:Array.isArray(e==null?void 0:e.rewards)?e.rewards.map(t=>DecCoin.fromJSON(t)):[]}},toJSON(e){const t={};return e.rewards?t.rewards=e.rewards.map(n=>n?DecCoin.toJSON(n):void 0):t.rewards=[],t},fromPartial(e){var n;const t=createBaseValidatorOutstandingRewards();return t.rewards=((n=e.rewards)==null?void 0:n.map(p=>DecCoin.fromPartial(p)))||[],t}};function createBaseValidatorSlashEvent(){return{validatorPeriod:0,fraction:""}}const ValidatorSlashEvent={encode(e,t=_m0.Writer.create()){return e.validatorPeriod!==0&&t.uint32(8).uint64(e.validatorPeriod),e.fraction!==""&&t.uint32(18).string(e.fraction),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorSlashEvent();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validatorPeriod=longToNumber$O(n.uint64());break;case 2:u.fraction=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validatorPeriod:isSet$1r(e.validatorPeriod)?Number(e.validatorPeriod):0,fraction:isSet$1r(e.fraction)?String(e.fraction):""}},toJSON(e){const t={};return e.validatorPeriod!==void 0&&(t.validatorPeriod=Math.round(e.validatorPeriod)),e.fraction!==void 0&&(t.fraction=e.fraction),t},fromPartial(e){const t=createBaseValidatorSlashEvent();return t.validatorPeriod=e.validatorPeriod??0,t.fraction=e.fraction??"",t}};function createBaseValidatorSlashEvents(){return{validatorSlashEvents:[]}}const ValidatorSlashEvents={encode(e,t=_m0.Writer.create()){for(const n of e.validatorSlashEvents)ValidatorSlashEvent.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorSlashEvents();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validatorSlashEvents.push(ValidatorSlashEvent.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validatorSlashEvents:Array.isArray(e==null?void 0:e.validatorSlashEvents)?e.validatorSlashEvents.map(t=>ValidatorSlashEvent.fromJSON(t)):[]}},toJSON(e){const t={};return e.validatorSlashEvents?t.validatorSlashEvents=e.validatorSlashEvents.map(n=>n?ValidatorSlashEvent.toJSON(n):void 0):t.validatorSlashEvents=[],t},fromPartial(e){var n;const t=createBaseValidatorSlashEvents();return t.validatorSlashEvents=((n=e.validatorSlashEvents)==null?void 0:n.map(p=>ValidatorSlashEvent.fromPartial(p)))||[],t}};function createBaseFeePool(){return{communityPool:[]}}const FeePool={encode(e,t=_m0.Writer.create()){for(const n of e.communityPool)DecCoin.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseFeePool();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.communityPool.push(DecCoin.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{communityPool:Array.isArray(e==null?void 0:e.communityPool)?e.communityPool.map(t=>DecCoin.fromJSON(t)):[]}},toJSON(e){const t={};return e.communityPool?t.communityPool=e.communityPool.map(n=>n?DecCoin.toJSON(n):void 0):t.communityPool=[],t},fromPartial(e){var n;const t=createBaseFeePool();return t.communityPool=((n=e.communityPool)==null?void 0:n.map(p=>DecCoin.fromPartial(p)))||[],t}};function createBaseCommunityPoolSpendProposal(){return{title:"",description:"",recipient:"",amount:[]}}const CommunityPoolSpendProposal={encode(e,t=_m0.Writer.create()){e.title!==""&&t.uint32(10).string(e.title),e.description!==""&&t.uint32(18).string(e.description),e.recipient!==""&&t.uint32(26).string(e.recipient);for(const n of e.amount)Coin$8.encode(n,t.uint32(34).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCommunityPoolSpendProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.title=n.string();break;case 2:u.description=n.string();break;case 3:u.recipient=n.string();break;case 4:u.amount.push(Coin$8.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{title:isSet$1r(e.title)?String(e.title):"",description:isSet$1r(e.description)?String(e.description):"",recipient:isSet$1r(e.recipient)?String(e.recipient):"",amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$8.fromJSON(t)):[]}},toJSON(e){const t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),e.recipient!==void 0&&(t.recipient=e.recipient),e.amount?t.amount=e.amount.map(n=>n?Coin$8.toJSON(n):void 0):t.amount=[],t},fromPartial(e){var n;const t=createBaseCommunityPoolSpendProposal();return t.title=e.title??"",t.description=e.description??"",t.recipient=e.recipient??"",t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$8.fromPartial(p)))||[],t}};function createBaseDelegatorStartingInfo(){return{previousPeriod:0,stake:"",height:0}}const DelegatorStartingInfo={encode(e,t=_m0.Writer.create()){return e.previousPeriod!==0&&t.uint32(8).uint64(e.previousPeriod),e.stake!==""&&t.uint32(18).string(e.stake),e.height!==0&&t.uint32(24).uint64(e.height),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDelegatorStartingInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.previousPeriod=longToNumber$O(n.uint64());break;case 2:u.stake=n.string();break;case 3:u.height=longToNumber$O(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{previousPeriod:isSet$1r(e.previousPeriod)?Number(e.previousPeriod):0,stake:isSet$1r(e.stake)?String(e.stake):"",height:isSet$1r(e.height)?Number(e.height):0}},toJSON(e){const t={};return e.previousPeriod!==void 0&&(t.previousPeriod=Math.round(e.previousPeriod)),e.stake!==void 0&&(t.stake=e.stake),e.height!==void 0&&(t.height=Math.round(e.height)),t},fromPartial(e){const t=createBaseDelegatorStartingInfo();return t.previousPeriod=e.previousPeriod??0,t.stake=e.stake??"",t.height=e.height??0,t}};function createBaseDelegationDelegatorReward(){return{validatorAddress:"",reward:[]}}const DelegationDelegatorReward={encode(e,t=_m0.Writer.create()){e.validatorAddress!==""&&t.uint32(10).string(e.validatorAddress);for(const n of e.reward)DecCoin.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDelegationDelegatorReward();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validatorAddress=n.string();break;case 2:u.reward.push(DecCoin.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validatorAddress:isSet$1r(e.validatorAddress)?String(e.validatorAddress):"",reward:Array.isArray(e==null?void 0:e.reward)?e.reward.map(t=>DecCoin.fromJSON(t)):[]}},toJSON(e){const t={};return e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.reward?t.reward=e.reward.map(n=>n?DecCoin.toJSON(n):void 0):t.reward=[],t},fromPartial(e){var n;const t=createBaseDelegationDelegatorReward();return t.validatorAddress=e.validatorAddress??"",t.reward=((n=e.reward)==null?void 0:n.map(p=>DecCoin.fromPartial(p)))||[],t}};function createBaseCommunityPoolSpendProposalWithDeposit(){return{title:"",description:"",recipient:"",amount:"",deposit:""}}const CommunityPoolSpendProposalWithDeposit={encode(e,t=_m0.Writer.create()){return e.title!==""&&t.uint32(10).string(e.title),e.description!==""&&t.uint32(18).string(e.description),e.recipient!==""&&t.uint32(26).string(e.recipient),e.amount!==""&&t.uint32(34).string(e.amount),e.deposit!==""&&t.uint32(42).string(e.deposit),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCommunityPoolSpendProposalWithDeposit();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.title=n.string();break;case 2:u.description=n.string();break;case 3:u.recipient=n.string();break;case 4:u.amount=n.string();break;case 5:u.deposit=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{title:isSet$1r(e.title)?String(e.title):"",description:isSet$1r(e.description)?String(e.description):"",recipient:isSet$1r(e.recipient)?String(e.recipient):"",amount:isSet$1r(e.amount)?String(e.amount):"",deposit:isSet$1r(e.deposit)?String(e.deposit):""}},toJSON(e){const t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),e.recipient!==void 0&&(t.recipient=e.recipient),e.amount!==void 0&&(t.amount=e.amount),e.deposit!==void 0&&(t.deposit=e.deposit),t},fromPartial(e){const t=createBaseCommunityPoolSpendProposalWithDeposit();return t.title=e.title??"",t.description=e.description??"",t.recipient=e.recipient??"",t.amount=e.amount??"",t.deposit=e.deposit??"",t}};var globalThis$1e=(()=>{if(typeof globalThis$1e<"u")return globalThis$1e;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$O(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1e.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1r(e){return e!=null}function createBaseMsgSetWithdrawAddress(){return{delegatorAddress:"",withdrawAddress:""}}const MsgSetWithdrawAddress={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.withdrawAddress!==""&&t.uint32(18).string(e.withdrawAddress),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgSetWithdrawAddress();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.withdrawAddress=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$1q(e.delegatorAddress)?String(e.delegatorAddress):"",withdrawAddress:isSet$1q(e.withdrawAddress)?String(e.withdrawAddress):""}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.withdrawAddress!==void 0&&(t.withdrawAddress=e.withdrawAddress),t},fromPartial(e){const t=createBaseMsgSetWithdrawAddress();return t.delegatorAddress=e.delegatorAddress??"",t.withdrawAddress=e.withdrawAddress??"",t}};function createBaseMsgWithdrawDelegatorReward(){return{delegatorAddress:"",validatorAddress:""}}const MsgWithdrawDelegatorReward={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==""&&t.uint32(18).string(e.validatorAddress),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgWithdrawDelegatorReward();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorAddress=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$1q(e.delegatorAddress)?String(e.delegatorAddress):"",validatorAddress:isSet$1q(e.validatorAddress)?String(e.validatorAddress):""}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){const t=createBaseMsgWithdrawDelegatorReward();return t.delegatorAddress=e.delegatorAddress??"",t.validatorAddress=e.validatorAddress??"",t}};function createBaseMsgWithdrawValidatorCommission(){return{validatorAddress:""}}const MsgWithdrawValidatorCommission={encode(e,t=_m0.Writer.create()){return e.validatorAddress!==""&&t.uint32(10).string(e.validatorAddress),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgWithdrawValidatorCommission();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validatorAddress=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validatorAddress:isSet$1q(e.validatorAddress)?String(e.validatorAddress):""}},toJSON(e){const t={};return e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){const t=createBaseMsgWithdrawValidatorCommission();return t.validatorAddress=e.validatorAddress??"",t}};function createBaseMsgFundCommunityPool(){return{amount:[],depositor:""}}const MsgFundCommunityPool={encode(e,t=_m0.Writer.create()){for(const n of e.amount)Coin$8.encode(n,t.uint32(10).fork()).ldelim();return e.depositor!==""&&t.uint32(18).string(e.depositor),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgFundCommunityPool();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.amount.push(Coin$8.decode(n,n.uint32()));break;case 2:u.depositor=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$8.fromJSON(t)):[],depositor:isSet$1q(e.depositor)?String(e.depositor):""}},toJSON(e){const t={};return e.amount?t.amount=e.amount.map(n=>n?Coin$8.toJSON(n):void 0):t.amount=[],e.depositor!==void 0&&(t.depositor=e.depositor),t},fromPartial(e){var n;const t=createBaseMsgFundCommunityPool();return t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$8.fromPartial(p)))||[],t.depositor=e.depositor??"",t}};function createBaseMsgUpdateParams$1(){return{authority:"",params:void 0}}const MsgUpdateParams$1={encode(e,t=_m0.Writer.create()){return e.authority!==""&&t.uint32(10).string(e.authority),e.params!==void 0&&Params$b.encode(e.params,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateParams$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.authority=n.string();break;case 2:u.params=Params$b.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{authority:isSet$1q(e.authority)?String(e.authority):"",params:isSet$1q(e.params)?Params$b.fromJSON(e.params):void 0}},toJSON(e){const t={};return e.authority!==void 0&&(t.authority=e.authority),e.params!==void 0&&(t.params=e.params?Params$b.toJSON(e.params):void 0),t},fromPartial(e){const t=createBaseMsgUpdateParams$1();return t.authority=e.authority??"",t.params=e.params!==void 0&&e.params!==null?Params$b.fromPartial(e.params):void 0,t}};function createBaseMsgCommunityPoolSpend(){return{authority:"",recipient:"",amount:[]}}const MsgCommunityPoolSpend={encode(e,t=_m0.Writer.create()){e.authority!==""&&t.uint32(10).string(e.authority),e.recipient!==""&&t.uint32(18).string(e.recipient);for(const n of e.amount)Coin$8.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgCommunityPoolSpend();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.authority=n.string();break;case 2:u.recipient=n.string();break;case 3:u.amount.push(Coin$8.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{authority:isSet$1q(e.authority)?String(e.authority):"",recipient:isSet$1q(e.recipient)?String(e.recipient):"",amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$8.fromJSON(t)):[]}},toJSON(e){const t={};return e.authority!==void 0&&(t.authority=e.authority),e.recipient!==void 0&&(t.recipient=e.recipient),e.amount?t.amount=e.amount.map(n=>n?Coin$8.toJSON(n):void 0):t.amount=[],t},fromPartial(e){var n;const t=createBaseMsgCommunityPoolSpend();return t.authority=e.authority??"",t.recipient=e.recipient??"",t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$8.fromPartial(p)))||[],t}};function isSet$1q(e){return e!=null}const msgTypes$l=[["/cosmos.distribution.v1beta1.MsgCommunityPoolSpend",MsgCommunityPoolSpend],["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",MsgWithdrawDelegatorReward],["/cosmos.distribution.v1beta1.MsgUpdateParams",MsgUpdateParams$1],["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress",MsgSetWithdrawAddress],["/cosmos.distribution.v1beta1.MsgFundCommunityPool",MsgFundCommunityPool],["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission",MsgWithdrawValidatorCommission]];let HttpClient$l=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$l=class extends HttpClient$l{constructor(){super(...arguments),this.queryCommunityPool=(t={})=>this.request({path:"/cosmos/distribution/v1beta1/community_pool",method:"GET",format:"json",...t}),this.queryDelegationTotalRewards=(t,n={})=>this.request({path:`/cosmos/distribution/v1beta1/delegators/${t}/rewards`,method:"GET",format:"json",...n}),this.queryDelegationRewards=(t,n,p={})=>this.request({path:`/cosmos/distribution/v1beta1/delegators/${t}/rewards/${n}`,method:"GET",format:"json",...p}),this.queryDelegatorValidators=(t,n={})=>this.request({path:`/cosmos/distribution/v1beta1/delegators/${t}/validators`,method:"GET",format:"json",...n}),this.queryDelegatorWithdrawAddress=(t,n={})=>this.request({path:`/cosmos/distribution/v1beta1/delegators/${t}/withdraw_address`,method:"GET",format:"json",...n}),this.queryParams=(t={})=>this.request({path:"/cosmos/distribution/v1beta1/params",method:"GET",format:"json",...t}),this.queryValidatorDistributionInfo=(t,n={})=>this.request({path:`/cosmos/distribution/v1beta1/validators/${t}`,method:"GET",format:"json",...n}),this.queryValidatorCommission=(t,n={})=>this.request({path:`/cosmos/distribution/v1beta1/validators/${t}/commission`,method:"GET",format:"json",...n}),this.queryValidatorOutstandingRewards=(t,n={})=>this.request({path:`/cosmos/distribution/v1beta1/validators/${t}/outstanding_rewards`,method:"GET",format:"json",...n}),this.queryValidatorSlashes=(t,n,p={})=>this.request({path:`/cosmos/distribution/v1beta1/validators/${t}/slashes`,method:"GET",query:n,format:"json",...p})}};function createBaseDelegatorWithdrawInfo(){return{delegatorAddress:"",withdrawAddress:""}}const DelegatorWithdrawInfo={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.withdrawAddress!==""&&t.uint32(18).string(e.withdrawAddress),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDelegatorWithdrawInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.withdrawAddress=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$1p(e.delegatorAddress)?String(e.delegatorAddress):"",withdrawAddress:isSet$1p(e.withdrawAddress)?String(e.withdrawAddress):""}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.withdrawAddress!==void 0&&(t.withdrawAddress=e.withdrawAddress),t},fromPartial(e){const t=createBaseDelegatorWithdrawInfo();return t.delegatorAddress=e.delegatorAddress??"",t.withdrawAddress=e.withdrawAddress??"",t}};function createBaseValidatorOutstandingRewardsRecord(){return{validatorAddress:"",outstandingRewards:[]}}const ValidatorOutstandingRewardsRecord={encode(e,t=_m0.Writer.create()){e.validatorAddress!==""&&t.uint32(10).string(e.validatorAddress);for(const n of e.outstandingRewards)DecCoin.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorOutstandingRewardsRecord();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validatorAddress=n.string();break;case 2:u.outstandingRewards.push(DecCoin.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validatorAddress:isSet$1p(e.validatorAddress)?String(e.validatorAddress):"",outstandingRewards:Array.isArray(e==null?void 0:e.outstandingRewards)?e.outstandingRewards.map(t=>DecCoin.fromJSON(t)):[]}},toJSON(e){const t={};return e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.outstandingRewards?t.outstandingRewards=e.outstandingRewards.map(n=>n?DecCoin.toJSON(n):void 0):t.outstandingRewards=[],t},fromPartial(e){var n;const t=createBaseValidatorOutstandingRewardsRecord();return t.validatorAddress=e.validatorAddress??"",t.outstandingRewards=((n=e.outstandingRewards)==null?void 0:n.map(p=>DecCoin.fromPartial(p)))||[],t}};function createBaseValidatorAccumulatedCommissionRecord(){return{validatorAddress:"",accumulated:void 0}}const ValidatorAccumulatedCommissionRecord={encode(e,t=_m0.Writer.create()){return e.validatorAddress!==""&&t.uint32(10).string(e.validatorAddress),e.accumulated!==void 0&&ValidatorAccumulatedCommission.encode(e.accumulated,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorAccumulatedCommissionRecord();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validatorAddress=n.string();break;case 2:u.accumulated=ValidatorAccumulatedCommission.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validatorAddress:isSet$1p(e.validatorAddress)?String(e.validatorAddress):"",accumulated:isSet$1p(e.accumulated)?ValidatorAccumulatedCommission.fromJSON(e.accumulated):void 0}},toJSON(e){const t={};return e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.accumulated!==void 0&&(t.accumulated=e.accumulated?ValidatorAccumulatedCommission.toJSON(e.accumulated):void 0),t},fromPartial(e){const t=createBaseValidatorAccumulatedCommissionRecord();return t.validatorAddress=e.validatorAddress??"",t.accumulated=e.accumulated!==void 0&&e.accumulated!==null?ValidatorAccumulatedCommission.fromPartial(e.accumulated):void 0,t}};function createBaseValidatorHistoricalRewardsRecord(){return{validatorAddress:"",period:0,rewards:void 0}}const ValidatorHistoricalRewardsRecord={encode(e,t=_m0.Writer.create()){return e.validatorAddress!==""&&t.uint32(10).string(e.validatorAddress),e.period!==0&&t.uint32(16).uint64(e.period),e.rewards!==void 0&&ValidatorHistoricalRewards.encode(e.rewards,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorHistoricalRewardsRecord();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validatorAddress=n.string();break;case 2:u.period=longToNumber$N(n.uint64());break;case 3:u.rewards=ValidatorHistoricalRewards.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validatorAddress:isSet$1p(e.validatorAddress)?String(e.validatorAddress):"",period:isSet$1p(e.period)?Number(e.period):0,rewards:isSet$1p(e.rewards)?ValidatorHistoricalRewards.fromJSON(e.rewards):void 0}},toJSON(e){const t={};return e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.period!==void 0&&(t.period=Math.round(e.period)),e.rewards!==void 0&&(t.rewards=e.rewards?ValidatorHistoricalRewards.toJSON(e.rewards):void 0),t},fromPartial(e){const t=createBaseValidatorHistoricalRewardsRecord();return t.validatorAddress=e.validatorAddress??"",t.period=e.period??0,t.rewards=e.rewards!==void 0&&e.rewards!==null?ValidatorHistoricalRewards.fromPartial(e.rewards):void 0,t}};function createBaseValidatorCurrentRewardsRecord(){return{validatorAddress:"",rewards:void 0}}const ValidatorCurrentRewardsRecord={encode(e,t=_m0.Writer.create()){return e.validatorAddress!==""&&t.uint32(10).string(e.validatorAddress),e.rewards!==void 0&&ValidatorCurrentRewards.encode(e.rewards,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorCurrentRewardsRecord();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validatorAddress=n.string();break;case 2:u.rewards=ValidatorCurrentRewards.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validatorAddress:isSet$1p(e.validatorAddress)?String(e.validatorAddress):"",rewards:isSet$1p(e.rewards)?ValidatorCurrentRewards.fromJSON(e.rewards):void 0}},toJSON(e){const t={};return e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.rewards!==void 0&&(t.rewards=e.rewards?ValidatorCurrentRewards.toJSON(e.rewards):void 0),t},fromPartial(e){const t=createBaseValidatorCurrentRewardsRecord();return t.validatorAddress=e.validatorAddress??"",t.rewards=e.rewards!==void 0&&e.rewards!==null?ValidatorCurrentRewards.fromPartial(e.rewards):void 0,t}};function createBaseDelegatorStartingInfoRecord(){return{delegatorAddress:"",validatorAddress:"",startingInfo:void 0}}const DelegatorStartingInfoRecord={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==""&&t.uint32(18).string(e.validatorAddress),e.startingInfo!==void 0&&DelegatorStartingInfo.encode(e.startingInfo,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDelegatorStartingInfoRecord();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorAddress=n.string();break;case 3:u.startingInfo=DelegatorStartingInfo.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$1p(e.delegatorAddress)?String(e.delegatorAddress):"",validatorAddress:isSet$1p(e.validatorAddress)?String(e.validatorAddress):"",startingInfo:isSet$1p(e.startingInfo)?DelegatorStartingInfo.fromJSON(e.startingInfo):void 0}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.startingInfo!==void 0&&(t.startingInfo=e.startingInfo?DelegatorStartingInfo.toJSON(e.startingInfo):void 0),t},fromPartial(e){const t=createBaseDelegatorStartingInfoRecord();return t.delegatorAddress=e.delegatorAddress??"",t.validatorAddress=e.validatorAddress??"",t.startingInfo=e.startingInfo!==void 0&&e.startingInfo!==null?DelegatorStartingInfo.fromPartial(e.startingInfo):void 0,t}};function createBaseValidatorSlashEventRecord(){return{validatorAddress:"",height:0,period:0,validatorSlashEvent:void 0}}const ValidatorSlashEventRecord={encode(e,t=_m0.Writer.create()){return e.validatorAddress!==""&&t.uint32(10).string(e.validatorAddress),e.height!==0&&t.uint32(16).uint64(e.height),e.period!==0&&t.uint32(24).uint64(e.period),e.validatorSlashEvent!==void 0&&ValidatorSlashEvent.encode(e.validatorSlashEvent,t.uint32(34).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorSlashEventRecord();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validatorAddress=n.string();break;case 2:u.height=longToNumber$N(n.uint64());break;case 3:u.period=longToNumber$N(n.uint64());break;case 4:u.validatorSlashEvent=ValidatorSlashEvent.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validatorAddress:isSet$1p(e.validatorAddress)?String(e.validatorAddress):"",height:isSet$1p(e.height)?Number(e.height):0,period:isSet$1p(e.period)?Number(e.period):0,validatorSlashEvent:isSet$1p(e.validatorSlashEvent)?ValidatorSlashEvent.fromJSON(e.validatorSlashEvent):void 0}},toJSON(e){const t={};return e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.height!==void 0&&(t.height=Math.round(e.height)),e.period!==void 0&&(t.period=Math.round(e.period)),e.validatorSlashEvent!==void 0&&(t.validatorSlashEvent=e.validatorSlashEvent?ValidatorSlashEvent.toJSON(e.validatorSlashEvent):void 0),t},fromPartial(e){const t=createBaseValidatorSlashEventRecord();return t.validatorAddress=e.validatorAddress??"",t.height=e.height??0,t.period=e.period??0,t.validatorSlashEvent=e.validatorSlashEvent!==void 0&&e.validatorSlashEvent!==null?ValidatorSlashEvent.fromPartial(e.validatorSlashEvent):void 0,t}};var globalThis$1d=(()=>{if(typeof globalThis$1d<"u")return globalThis$1d;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$N(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1d.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1p(e){return e!=null}const registry$c=new build$b.Registry(msgTypes$l);function getStructure$l(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$b={amount:[],gas:"200000"},txClient$l=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgCommunityPoolSpend({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgCommunityPoolSpend: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$c,prefix:t});let N=this.msgCommunityPoolSpend({value:MsgCommunityPoolSpend.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$b,g)}catch(y){throw new Error("TxClient:sendMsgCommunityPoolSpend: Could not broadcast Tx: "+y.message)}},async sendMsgWithdrawDelegatorReward({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgWithdrawDelegatorReward: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$c,prefix:t});let N=this.msgWithdrawDelegatorReward({value:MsgWithdrawDelegatorReward.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$b,g)}catch(y){throw new Error("TxClient:sendMsgWithdrawDelegatorReward: Could not broadcast Tx: "+y.message)}},async sendMsgUpdateParams({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateParams: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$c,prefix:t});let N=this.msgUpdateParams({value:MsgUpdateParams$1.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$b,g)}catch(y){throw new Error("TxClient:sendMsgUpdateParams: Could not broadcast Tx: "+y.message)}},async sendMsgSetWithdrawAddress({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgSetWithdrawAddress: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$c,prefix:t});let N=this.msgSetWithdrawAddress({value:MsgSetWithdrawAddress.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$b,g)}catch(y){throw new Error("TxClient:sendMsgSetWithdrawAddress: Could not broadcast Tx: "+y.message)}},async sendMsgFundCommunityPool({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgFundCommunityPool: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$c,prefix:t});let N=this.msgFundCommunityPool({value:MsgFundCommunityPool.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$b,g)}catch(y){throw new Error("TxClient:sendMsgFundCommunityPool: Could not broadcast Tx: "+y.message)}},async sendMsgWithdrawValidatorCommission({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgWithdrawValidatorCommission: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$c,prefix:t});let N=this.msgWithdrawValidatorCommission({value:MsgWithdrawValidatorCommission.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$b,g)}catch(y){throw new Error("TxClient:sendMsgWithdrawValidatorCommission: Could not broadcast Tx: "+y.message)}},msgCommunityPoolSpend({value:p}){try{return{typeUrl:"/cosmos.distribution.v1beta1.MsgCommunityPoolSpend",value:MsgCommunityPoolSpend.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgCommunityPoolSpend: Could not create message: "+u.message)}},msgWithdrawDelegatorReward({value:p}){try{return{typeUrl:"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",value:MsgWithdrawDelegatorReward.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgWithdrawDelegatorReward: Could not create message: "+u.message)}},msgUpdateParams({value:p}){try{return{typeUrl:"/cosmos.distribution.v1beta1.MsgUpdateParams",value:MsgUpdateParams$1.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateParams: Could not create message: "+u.message)}},msgSetWithdrawAddress({value:p}){try{return{typeUrl:"/cosmos.distribution.v1beta1.MsgSetWithdrawAddress",value:MsgSetWithdrawAddress.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgSetWithdrawAddress: Could not create message: "+u.message)}},msgFundCommunityPool({value:p}){try{return{typeUrl:"/cosmos.distribution.v1beta1.MsgFundCommunityPool",value:MsgFundCommunityPool.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgFundCommunityPool: Could not create message: "+u.message)}},msgWithdrawValidatorCommission({value:p}){try{return{typeUrl:"/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission",value:MsgWithdrawValidatorCommission.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgWithdrawValidatorCommission: Could not create message: "+u.message)}}}),queryClient$l=({addr:e}={addr:"http://localhost:1317"})=>new Api$l({baseURL:e});let SDKModule$l=class{constructor(t){this.registry=[],this.query=queryClient$l({addr:t.env.apiURL}),this.updateTX(t),this.structure={Params:getStructure$l(Params$b.fromPartial({})),ValidatorHistoricalRewards:getStructure$l(ValidatorHistoricalRewards.fromPartial({})),ValidatorCurrentRewards:getStructure$l(ValidatorCurrentRewards.fromPartial({})),ValidatorAccumulatedCommission:getStructure$l(ValidatorAccumulatedCommission.fromPartial({})),ValidatorOutstandingRewards:getStructure$l(ValidatorOutstandingRewards.fromPartial({})),ValidatorSlashEvent:getStructure$l(ValidatorSlashEvent.fromPartial({})),ValidatorSlashEvents:getStructure$l(ValidatorSlashEvents.fromPartial({})),FeePool:getStructure$l(FeePool.fromPartial({})),CommunityPoolSpendProposal:getStructure$l(CommunityPoolSpendProposal.fromPartial({})),DelegatorStartingInfo:getStructure$l(DelegatorStartingInfo.fromPartial({})),DelegationDelegatorReward:getStructure$l(DelegationDelegatorReward.fromPartial({})),CommunityPoolSpendProposalWithDeposit:getStructure$l(CommunityPoolSpendProposalWithDeposit.fromPartial({})),DelegatorWithdrawInfo:getStructure$l(DelegatorWithdrawInfo.fromPartial({})),ValidatorOutstandingRewardsRecord:getStructure$l(ValidatorOutstandingRewardsRecord.fromPartial({})),ValidatorAccumulatedCommissionRecord:getStructure$l(ValidatorAccumulatedCommissionRecord.fromPartial({})),ValidatorHistoricalRewardsRecord:getStructure$l(ValidatorHistoricalRewardsRecord.fromPartial({})),ValidatorCurrentRewardsRecord:getStructure$l(ValidatorCurrentRewardsRecord.fromPartial({})),DelegatorStartingInfoRecord:getStructure$l(DelegatorStartingInfoRecord.fromPartial({})),ValidatorSlashEventRecord:getStructure$l(ValidatorSlashEventRecord.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$l({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$l=e=>({module:{CosmosDistributionV1Beta1:new SDKModule$l(e)},registry:msgTypes$l});function createBaseAny$a(){return{typeUrl:"",value:new Uint8Array}}const Any$a={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$a();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$1o(e.typeUrl)?String(e.typeUrl):"",value:isSet$1o(e.value)?bytesFromBase64$n(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$n(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$a();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$1c=(()=>{if(typeof globalThis$1c<"u")return globalThis$1c;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$n(e){if(globalThis$1c.Buffer)return Uint8Array.from(globalThis$1c.Buffer.from(e,"base64"));{const t=globalThis$1c.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$n(e){if(globalThis$1c.Buffer)return globalThis$1c.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$1c.btoa(t.join(""))}}function isSet$1o(e){return e!=null}function createBaseMsgSubmitEvidence(){return{submitter:"",evidence:void 0}}const MsgSubmitEvidence={encode(e,t=_m0.Writer.create()){return e.submitter!==""&&t.uint32(10).string(e.submitter),e.evidence!==void 0&&Any$a.encode(e.evidence,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgSubmitEvidence();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.submitter=n.string();break;case 2:u.evidence=Any$a.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{submitter:isSet$1n(e.submitter)?String(e.submitter):"",evidence:isSet$1n(e.evidence)?Any$a.fromJSON(e.evidence):void 0}},toJSON(e){const t={};return e.submitter!==void 0&&(t.submitter=e.submitter),e.evidence!==void 0&&(t.evidence=e.evidence?Any$a.toJSON(e.evidence):void 0),t},fromPartial(e){const t=createBaseMsgSubmitEvidence();return t.submitter=e.submitter??"",t.evidence=e.evidence!==void 0&&e.evidence!==null?Any$a.fromPartial(e.evidence):void 0,t}};var globalThis$1b=(()=>{if(typeof globalThis$1b<"u")return globalThis$1b;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function isSet$1n(e){return e!=null}const msgTypes$k=[["/cosmos.evidence.v1beta1.MsgSubmitEvidence",MsgSubmitEvidence]];let HttpClient$k=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$k=class extends HttpClient$k{constructor(){super(...arguments),this.queryAllEvidence=(t,n={})=>this.request({path:"/cosmos/evidence/v1beta1/evidence",method:"GET",query:t,format:"json",...n}),this.queryEvidence=(t,n,p={})=>this.request({path:`/cosmos/evidence/v1beta1/evidence/${t}`,method:"GET",query:n,format:"json",...p})}};function createBaseTimestamp$8(){return{seconds:0,nanos:0}}const Timestamp$8={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp$8();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$M(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$1m(e.seconds)?Number(e.seconds):0,nanos:isSet$1m(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp$8();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$1a=(()=>{if(typeof globalThis$1a<"u")return globalThis$1a;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$M(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1a.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1m(e){return e!=null}function createBaseEquivocation(){return{height:0,time:void 0,power:0,consensusAddress:""}}const Equivocation={encode(e,t=_m0.Writer.create()){return e.height!==0&&t.uint32(8).int64(e.height),e.time!==void 0&&Timestamp$8.encode(toTimestamp$9(e.time),t.uint32(18).fork()).ldelim(),e.power!==0&&t.uint32(24).int64(e.power),e.consensusAddress!==""&&t.uint32(34).string(e.consensusAddress),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEquivocation();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.height=longToNumber$L(n.int64());break;case 2:u.time=fromTimestamp$9(Timestamp$8.decode(n,n.uint32()));break;case 3:u.power=longToNumber$L(n.int64());break;case 4:u.consensusAddress=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{height:isSet$1l(e.height)?Number(e.height):0,time:isSet$1l(e.time)?fromJsonTimestamp$9(e.time):void 0,power:isSet$1l(e.power)?Number(e.power):0,consensusAddress:isSet$1l(e.consensusAddress)?String(e.consensusAddress):""}},toJSON(e){const t={};return e.height!==void 0&&(t.height=Math.round(e.height)),e.time!==void 0&&(t.time=e.time.toISOString()),e.power!==void 0&&(t.power=Math.round(e.power)),e.consensusAddress!==void 0&&(t.consensusAddress=e.consensusAddress),t},fromPartial(e){const t=createBaseEquivocation();return t.height=e.height??0,t.time=e.time??void 0,t.power=e.power??0,t.consensusAddress=e.consensusAddress??"",t}};var globalThis$19=(()=>{if(typeof globalThis$19<"u")return globalThis$19;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function toTimestamp$9(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$9(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$9(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$9(Timestamp$8.fromJSON(e))}function longToNumber$L(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$19.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1l(e){return e!=null}const registry$b=new build$b.Registry(msgTypes$k);function getStructure$k(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$a={amount:[],gas:"200000"},txClient$k=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgSubmitEvidence({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgSubmitEvidence: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$b,prefix:t});let N=this.msgSubmitEvidence({value:MsgSubmitEvidence.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$a,g)}catch(y){throw new Error("TxClient:sendMsgSubmitEvidence: Could not broadcast Tx: "+y.message)}},msgSubmitEvidence({value:p}){try{return{typeUrl:"/cosmos.evidence.v1beta1.MsgSubmitEvidence",value:MsgSubmitEvidence.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgSubmitEvidence: Could not create message: "+u.message)}}}),queryClient$k=({addr:e}={addr:"http://localhost:1317"})=>new Api$k({baseURL:e});let SDKModule$k=class{constructor(t){this.registry=[],this.query=queryClient$k({addr:t.env.apiURL}),this.updateTX(t),this.structure={Equivocation:getStructure$k(Equivocation.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$k({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$k=e=>({module:{CosmosEvidenceV1Beta1:new SDKModule$k(e)},registry:msgTypes$k});function createBaseAny$9(){return{typeUrl:"",value:new Uint8Array}}const Any$9={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$9();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$1k(e.typeUrl)?String(e.typeUrl):"",value:isSet$1k(e.value)?bytesFromBase64$m(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$m(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$9();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$18=(()=>{if(typeof globalThis$18<"u")return globalThis$18;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$m(e){if(globalThis$18.Buffer)return Uint8Array.from(globalThis$18.Buffer.from(e,"base64"));{const t=globalThis$18.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$m(e){if(globalThis$18.Buffer)return globalThis$18.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$18.btoa(t.join(""))}}function isSet$1k(e){return e!=null}function createBaseMsgGrantAllowance(){return{granter:"",grantee:"",allowance:void 0}}const MsgGrantAllowance={encode(e,t=_m0.Writer.create()){return e.granter!==""&&t.uint32(10).string(e.granter),e.grantee!==""&&t.uint32(18).string(e.grantee),e.allowance!==void 0&&Any$9.encode(e.allowance,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgGrantAllowance();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.granter=n.string();break;case 2:u.grantee=n.string();break;case 3:u.allowance=Any$9.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{granter:isSet$1j(e.granter)?String(e.granter):"",grantee:isSet$1j(e.grantee)?String(e.grantee):"",allowance:isSet$1j(e.allowance)?Any$9.fromJSON(e.allowance):void 0}},toJSON(e){const t={};return e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),e.allowance!==void 0&&(t.allowance=e.allowance?Any$9.toJSON(e.allowance):void 0),t},fromPartial(e){const t=createBaseMsgGrantAllowance();return t.granter=e.granter??"",t.grantee=e.grantee??"",t.allowance=e.allowance!==void 0&&e.allowance!==null?Any$9.fromPartial(e.allowance):void 0,t}};function createBaseMsgRevokeAllowance(){return{granter:"",grantee:""}}const MsgRevokeAllowance={encode(e,t=_m0.Writer.create()){return e.granter!==""&&t.uint32(10).string(e.granter),e.grantee!==""&&t.uint32(18).string(e.grantee),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgRevokeAllowance();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.granter=n.string();break;case 2:u.grantee=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{granter:isSet$1j(e.granter)?String(e.granter):"",grantee:isSet$1j(e.grantee)?String(e.grantee):""}},toJSON(e){const t={};return e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),t},fromPartial(e){const t=createBaseMsgRevokeAllowance();return t.granter=e.granter??"",t.grantee=e.grantee??"",t}};function isSet$1j(e){return e!=null}const msgTypes$j=[["/cosmos.feegrant.v1beta1.MsgRevokeAllowance",MsgRevokeAllowance],["/cosmos.feegrant.v1beta1.MsgGrantAllowance",MsgGrantAllowance]];let HttpClient$j=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$j=class extends HttpClient$j{constructor(){super(...arguments),this.queryAllowance=(t,n,p={})=>this.request({path:`/cosmos/feegrant/v1beta1/allowance/${t}/${n}`,method:"GET",format:"json",...p}),this.queryAllowances=(t,n,p={})=>this.request({path:`/cosmos/feegrant/v1beta1/allowances/${t}`,method:"GET",query:n,format:"json",...p}),this.queryAllowancesByGranter=(t,n,p={})=>this.request({path:`/cosmos/feegrant/v1beta1/issued/${t}`,method:"GET",query:n,format:"json",...p})}};function createBaseDuration$5(){return{seconds:0,nanos:0}}const Duration$5={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDuration$5();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$K(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$1i(e.seconds)?Number(e.seconds):0,nanos:isSet$1i(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseDuration$5();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$17=(()=>{if(typeof globalThis$17<"u")return globalThis$17;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$K(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$17.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1i(e){return e!=null}function createBaseTimestamp$7(){return{seconds:0,nanos:0}}const Timestamp$7={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp$7();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$J(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$1h(e.seconds)?Number(e.seconds):0,nanos:isSet$1h(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp$7();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$16=(()=>{if(typeof globalThis$16<"u")return globalThis$16;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$J(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$16.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1h(e){return e!=null}function createBaseCoin$7(){return{denom:"",amount:""}}const Coin$7={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin$7();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$1g(e.denom)?String(e.denom):"",amount:isSet$1g(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin$7();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$1g(e){return e!=null}function createBaseBasicAllowance(){return{spendLimit:[],expiration:void 0}}const BasicAllowance={encode(e,t=_m0.Writer.create()){for(const n of e.spendLimit)Coin$7.encode(n,t.uint32(10).fork()).ldelim();return e.expiration!==void 0&&Timestamp$7.encode(toTimestamp$8(e.expiration),t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseBasicAllowance();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.spendLimit.push(Coin$7.decode(n,n.uint32()));break;case 2:u.expiration=fromTimestamp$8(Timestamp$7.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{spendLimit:Array.isArray(e==null?void 0:e.spendLimit)?e.spendLimit.map(t=>Coin$7.fromJSON(t)):[],expiration:isSet$1f(e.expiration)?fromJsonTimestamp$8(e.expiration):void 0}},toJSON(e){const t={};return e.spendLimit?t.spendLimit=e.spendLimit.map(n=>n?Coin$7.toJSON(n):void 0):t.spendLimit=[],e.expiration!==void 0&&(t.expiration=e.expiration.toISOString()),t},fromPartial(e){var n;const t=createBaseBasicAllowance();return t.spendLimit=((n=e.spendLimit)==null?void 0:n.map(p=>Coin$7.fromPartial(p)))||[],t.expiration=e.expiration??void 0,t}};function createBasePeriodicAllowance(){return{basic:void 0,period:void 0,periodSpendLimit:[],periodCanSpend:[],periodReset:void 0}}const PeriodicAllowance={encode(e,t=_m0.Writer.create()){e.basic!==void 0&&BasicAllowance.encode(e.basic,t.uint32(10).fork()).ldelim(),e.period!==void 0&&Duration$5.encode(e.period,t.uint32(18).fork()).ldelim();for(const n of e.periodSpendLimit)Coin$7.encode(n,t.uint32(26).fork()).ldelim();for(const n of e.periodCanSpend)Coin$7.encode(n,t.uint32(34).fork()).ldelim();return e.periodReset!==void 0&&Timestamp$7.encode(toTimestamp$8(e.periodReset),t.uint32(42).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePeriodicAllowance();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.basic=BasicAllowance.decode(n,n.uint32());break;case 2:u.period=Duration$5.decode(n,n.uint32());break;case 3:u.periodSpendLimit.push(Coin$7.decode(n,n.uint32()));break;case 4:u.periodCanSpend.push(Coin$7.decode(n,n.uint32()));break;case 5:u.periodReset=fromTimestamp$8(Timestamp$7.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{basic:isSet$1f(e.basic)?BasicAllowance.fromJSON(e.basic):void 0,period:isSet$1f(e.period)?Duration$5.fromJSON(e.period):void 0,periodSpendLimit:Array.isArray(e==null?void 0:e.periodSpendLimit)?e.periodSpendLimit.map(t=>Coin$7.fromJSON(t)):[],periodCanSpend:Array.isArray(e==null?void 0:e.periodCanSpend)?e.periodCanSpend.map(t=>Coin$7.fromJSON(t)):[],periodReset:isSet$1f(e.periodReset)?fromJsonTimestamp$8(e.periodReset):void 0}},toJSON(e){const t={};return e.basic!==void 0&&(t.basic=e.basic?BasicAllowance.toJSON(e.basic):void 0),e.period!==void 0&&(t.period=e.period?Duration$5.toJSON(e.period):void 0),e.periodSpendLimit?t.periodSpendLimit=e.periodSpendLimit.map(n=>n?Coin$7.toJSON(n):void 0):t.periodSpendLimit=[],e.periodCanSpend?t.periodCanSpend=e.periodCanSpend.map(n=>n?Coin$7.toJSON(n):void 0):t.periodCanSpend=[],e.periodReset!==void 0&&(t.periodReset=e.periodReset.toISOString()),t},fromPartial(e){var n,p;const t=createBasePeriodicAllowance();return t.basic=e.basic!==void 0&&e.basic!==null?BasicAllowance.fromPartial(e.basic):void 0,t.period=e.period!==void 0&&e.period!==null?Duration$5.fromPartial(e.period):void 0,t.periodSpendLimit=((n=e.periodSpendLimit)==null?void 0:n.map(u=>Coin$7.fromPartial(u)))||[],t.periodCanSpend=((p=e.periodCanSpend)==null?void 0:p.map(u=>Coin$7.fromPartial(u)))||[],t.periodReset=e.periodReset??void 0,t}};function createBaseAllowedMsgAllowance(){return{allowance:void 0,allowedMessages:[]}}const AllowedMsgAllowance={encode(e,t=_m0.Writer.create()){e.allowance!==void 0&&Any$9.encode(e.allowance,t.uint32(10).fork()).ldelim();for(const n of e.allowedMessages)t.uint32(18).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAllowedMsgAllowance();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.allowance=Any$9.decode(n,n.uint32());break;case 2:u.allowedMessages.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{allowance:isSet$1f(e.allowance)?Any$9.fromJSON(e.allowance):void 0,allowedMessages:Array.isArray(e==null?void 0:e.allowedMessages)?e.allowedMessages.map(t=>String(t)):[]}},toJSON(e){const t={};return e.allowance!==void 0&&(t.allowance=e.allowance?Any$9.toJSON(e.allowance):void 0),e.allowedMessages?t.allowedMessages=e.allowedMessages.map(n=>n):t.allowedMessages=[],t},fromPartial(e){var n;const t=createBaseAllowedMsgAllowance();return t.allowance=e.allowance!==void 0&&e.allowance!==null?Any$9.fromPartial(e.allowance):void 0,t.allowedMessages=((n=e.allowedMessages)==null?void 0:n.map(p=>p))||[],t}};function createBaseGrant(){return{granter:"",grantee:"",allowance:void 0}}const Grant={encode(e,t=_m0.Writer.create()){return e.granter!==""&&t.uint32(10).string(e.granter),e.grantee!==""&&t.uint32(18).string(e.grantee),e.allowance!==void 0&&Any$9.encode(e.allowance,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseGrant();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.granter=n.string();break;case 2:u.grantee=n.string();break;case 3:u.allowance=Any$9.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{granter:isSet$1f(e.granter)?String(e.granter):"",grantee:isSet$1f(e.grantee)?String(e.grantee):"",allowance:isSet$1f(e.allowance)?Any$9.fromJSON(e.allowance):void 0}},toJSON(e){const t={};return e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),e.allowance!==void 0&&(t.allowance=e.allowance?Any$9.toJSON(e.allowance):void 0),t},fromPartial(e){const t=createBaseGrant();return t.granter=e.granter??"",t.grantee=e.grantee??"",t.allowance=e.allowance!==void 0&&e.allowance!==null?Any$9.fromPartial(e.allowance):void 0,t}};function toTimestamp$8(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$8(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$8(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$8(Timestamp$7.fromJSON(e))}function isSet$1f(e){return e!=null}const registry$a=new build$b.Registry(msgTypes$j);function getStructure$j(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$9={amount:[],gas:"200000"},txClient$j=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgRevokeAllowance({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgRevokeAllowance: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$a,prefix:t});let N=this.msgRevokeAllowance({value:MsgRevokeAllowance.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$9,g)}catch(y){throw new Error("TxClient:sendMsgRevokeAllowance: Could not broadcast Tx: "+y.message)}},async sendMsgGrantAllowance({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgGrantAllowance: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$a,prefix:t});let N=this.msgGrantAllowance({value:MsgGrantAllowance.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$9,g)}catch(y){throw new Error("TxClient:sendMsgGrantAllowance: Could not broadcast Tx: "+y.message)}},msgRevokeAllowance({value:p}){try{return{typeUrl:"/cosmos.feegrant.v1beta1.MsgRevokeAllowance",value:MsgRevokeAllowance.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgRevokeAllowance: Could not create message: "+u.message)}},msgGrantAllowance({value:p}){try{return{typeUrl:"/cosmos.feegrant.v1beta1.MsgGrantAllowance",value:MsgGrantAllowance.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgGrantAllowance: Could not create message: "+u.message)}}}),queryClient$j=({addr:e}={addr:"http://localhost:1317"})=>new Api$j({baseURL:e});let SDKModule$j=class{constructor(t){this.registry=[],this.query=queryClient$j({addr:t.env.apiURL}),this.updateTX(t),this.structure={BasicAllowance:getStructure$j(BasicAllowance.fromPartial({})),PeriodicAllowance:getStructure$j(PeriodicAllowance.fromPartial({})),AllowedMsgAllowance:getStructure$j(AllowedMsgAllowance.fromPartial({})),Grant:getStructure$j(Grant.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$j({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$j=e=>({module:{CosmosFeegrantV1Beta1:new SDKModule$j(e)},registry:msgTypes$j});function createBaseAny$8(){return{typeUrl:"",value:new Uint8Array}}const Any$8={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$8();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$1e(e.typeUrl)?String(e.typeUrl):"",value:isSet$1e(e.value)?bytesFromBase64$l(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$l(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$8();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$15=(()=>{if(typeof globalThis$15<"u")return globalThis$15;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$l(e){if(globalThis$15.Buffer)return Uint8Array.from(globalThis$15.Buffer.from(e,"base64"));{const t=globalThis$15.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$l(e){if(globalThis$15.Buffer)return globalThis$15.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$15.btoa(t.join(""))}}function isSet$1e(e){return e!=null}function createBaseCoin$6(){return{denom:"",amount:""}}const Coin$6={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin$6();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$1d(e.denom)?String(e.denom):"",amount:isSet$1d(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin$6();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$1d(e){return e!=null}function createBaseDuration$4(){return{seconds:0,nanos:0}}const Duration$4={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDuration$4();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$I(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$1c(e.seconds)?Number(e.seconds):0,nanos:isSet$1c(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseDuration$4();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$14=(()=>{if(typeof globalThis$14<"u")return globalThis$14;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$I(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$14.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1c(e){return e!=null}function createBaseTimestamp$6(){return{seconds:0,nanos:0}}const Timestamp$6={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp$6();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$H(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$1b(e.seconds)?Number(e.seconds):0,nanos:isSet$1b(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp$6();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$13=(()=>{if(typeof globalThis$13<"u")return globalThis$13;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$H(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$13.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1b(e){return e!=null}function voteOptionFromJSON$2(e){switch(e){case 0:case"VOTE_OPTION_UNSPECIFIED":return 0;case 1:case"VOTE_OPTION_YES":return 1;case 2:case"VOTE_OPTION_ABSTAIN":return 2;case 3:case"VOTE_OPTION_NO":return 3;case 4:case"VOTE_OPTION_NO_WITH_VETO":return 4;case-1:case"UNRECOGNIZED":default:return-1}}function voteOptionToJSON$2(e){switch(e){case 0:return"VOTE_OPTION_UNSPECIFIED";case 1:return"VOTE_OPTION_YES";case 2:return"VOTE_OPTION_ABSTAIN";case 3:return"VOTE_OPTION_NO";case 4:return"VOTE_OPTION_NO_WITH_VETO";case-1:default:return"UNRECOGNIZED"}}function proposalStatusFromJSON$2(e){switch(e){case 0:case"PROPOSAL_STATUS_UNSPECIFIED":return 0;case 1:case"PROPOSAL_STATUS_DEPOSIT_PERIOD":return 1;case 2:case"PROPOSAL_STATUS_VOTING_PERIOD":return 2;case 3:case"PROPOSAL_STATUS_PASSED":return 3;case 4:case"PROPOSAL_STATUS_REJECTED":return 4;case 5:case"PROPOSAL_STATUS_FAILED":return 5;case-1:case"UNRECOGNIZED":default:return-1}}function proposalStatusToJSON$2(e){switch(e){case 0:return"PROPOSAL_STATUS_UNSPECIFIED";case 1:return"PROPOSAL_STATUS_DEPOSIT_PERIOD";case 2:return"PROPOSAL_STATUS_VOTING_PERIOD";case 3:return"PROPOSAL_STATUS_PASSED";case 4:return"PROPOSAL_STATUS_REJECTED";case 5:return"PROPOSAL_STATUS_FAILED";case-1:default:return"UNRECOGNIZED"}}function createBaseWeightedVoteOption$1(){return{option:0,weight:""}}const WeightedVoteOption$1={encode(e,t=_m0.Writer.create()){return e.option!==0&&t.uint32(8).int32(e.option),e.weight!==""&&t.uint32(18).string(e.weight),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseWeightedVoteOption$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.option=n.int32();break;case 2:u.weight=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{option:isSet$1a(e.option)?voteOptionFromJSON$2(e.option):0,weight:isSet$1a(e.weight)?String(e.weight):""}},toJSON(e){const t={};return e.option!==void 0&&(t.option=voteOptionToJSON$2(e.option)),e.weight!==void 0&&(t.weight=e.weight),t},fromPartial(e){const t=createBaseWeightedVoteOption$1();return t.option=e.option??0,t.weight=e.weight??"",t}};function createBaseDeposit$1(){return{proposalId:0,depositor:"",amount:[]}}const Deposit$1={encode(e,t=_m0.Writer.create()){e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.depositor!==""&&t.uint32(18).string(e.depositor);for(const n of e.amount)Coin$6.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDeposit$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$G(n.uint64());break;case 2:u.depositor=n.string();break;case 3:u.amount.push(Coin$6.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$1a(e.proposalId)?Number(e.proposalId):0,depositor:isSet$1a(e.depositor)?String(e.depositor):"",amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$6.fromJSON(t)):[]}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.depositor!==void 0&&(t.depositor=e.depositor),e.amount?t.amount=e.amount.map(n=>n?Coin$6.toJSON(n):void 0):t.amount=[],t},fromPartial(e){var n;const t=createBaseDeposit$1();return t.proposalId=e.proposalId??0,t.depositor=e.depositor??"",t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$6.fromPartial(p)))||[],t}};function createBaseProposal$2(){return{id:0,messages:[],status:0,finalTallyResult:void 0,submitTime:void 0,depositEndTime:void 0,totalDeposit:[],votingStartTime:void 0,votingEndTime:void 0,metadata:"",title:"",summary:"",proposer:""}}const Proposal$2={encode(e,t=_m0.Writer.create()){e.id!==0&&t.uint32(8).uint64(e.id);for(const n of e.messages)Any$8.encode(n,t.uint32(18).fork()).ldelim();e.status!==0&&t.uint32(24).int32(e.status),e.finalTallyResult!==void 0&&TallyResult$2.encode(e.finalTallyResult,t.uint32(34).fork()).ldelim(),e.submitTime!==void 0&&Timestamp$6.encode(toTimestamp$7(e.submitTime),t.uint32(42).fork()).ldelim(),e.depositEndTime!==void 0&&Timestamp$6.encode(toTimestamp$7(e.depositEndTime),t.uint32(50).fork()).ldelim();for(const n of e.totalDeposit)Coin$6.encode(n,t.uint32(58).fork()).ldelim();return e.votingStartTime!==void 0&&Timestamp$6.encode(toTimestamp$7(e.votingStartTime),t.uint32(66).fork()).ldelim(),e.votingEndTime!==void 0&&Timestamp$6.encode(toTimestamp$7(e.votingEndTime),t.uint32(74).fork()).ldelim(),e.metadata!==""&&t.uint32(82).string(e.metadata),e.title!==""&&t.uint32(90).string(e.title),e.summary!==""&&t.uint32(98).string(e.summary),e.proposer!==""&&t.uint32(106).string(e.proposer),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseProposal$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.id=longToNumber$G(n.uint64());break;case 2:u.messages.push(Any$8.decode(n,n.uint32()));break;case 3:u.status=n.int32();break;case 4:u.finalTallyResult=TallyResult$2.decode(n,n.uint32());break;case 5:u.submitTime=fromTimestamp$7(Timestamp$6.decode(n,n.uint32()));break;case 6:u.depositEndTime=fromTimestamp$7(Timestamp$6.decode(n,n.uint32()));break;case 7:u.totalDeposit.push(Coin$6.decode(n,n.uint32()));break;case 8:u.votingStartTime=fromTimestamp$7(Timestamp$6.decode(n,n.uint32()));break;case 9:u.votingEndTime=fromTimestamp$7(Timestamp$6.decode(n,n.uint32()));break;case 10:u.metadata=n.string();break;case 11:u.title=n.string();break;case 12:u.summary=n.string();break;case 13:u.proposer=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{id:isSet$1a(e.id)?Number(e.id):0,messages:Array.isArray(e==null?void 0:e.messages)?e.messages.map(t=>Any$8.fromJSON(t)):[],status:isSet$1a(e.status)?proposalStatusFromJSON$2(e.status):0,finalTallyResult:isSet$1a(e.finalTallyResult)?TallyResult$2.fromJSON(e.finalTallyResult):void 0,submitTime:isSet$1a(e.submitTime)?fromJsonTimestamp$7(e.submitTime):void 0,depositEndTime:isSet$1a(e.depositEndTime)?fromJsonTimestamp$7(e.depositEndTime):void 0,totalDeposit:Array.isArray(e==null?void 0:e.totalDeposit)?e.totalDeposit.map(t=>Coin$6.fromJSON(t)):[],votingStartTime:isSet$1a(e.votingStartTime)?fromJsonTimestamp$7(e.votingStartTime):void 0,votingEndTime:isSet$1a(e.votingEndTime)?fromJsonTimestamp$7(e.votingEndTime):void 0,metadata:isSet$1a(e.metadata)?String(e.metadata):"",title:isSet$1a(e.title)?String(e.title):"",summary:isSet$1a(e.summary)?String(e.summary):"",proposer:isSet$1a(e.proposer)?String(e.proposer):""}},toJSON(e){const t={};return e.id!==void 0&&(t.id=Math.round(e.id)),e.messages?t.messages=e.messages.map(n=>n?Any$8.toJSON(n):void 0):t.messages=[],e.status!==void 0&&(t.status=proposalStatusToJSON$2(e.status)),e.finalTallyResult!==void 0&&(t.finalTallyResult=e.finalTallyResult?TallyResult$2.toJSON(e.finalTallyResult):void 0),e.submitTime!==void 0&&(t.submitTime=e.submitTime.toISOString()),e.depositEndTime!==void 0&&(t.depositEndTime=e.depositEndTime.toISOString()),e.totalDeposit?t.totalDeposit=e.totalDeposit.map(n=>n?Coin$6.toJSON(n):void 0):t.totalDeposit=[],e.votingStartTime!==void 0&&(t.votingStartTime=e.votingStartTime.toISOString()),e.votingEndTime!==void 0&&(t.votingEndTime=e.votingEndTime.toISOString()),e.metadata!==void 0&&(t.metadata=e.metadata),e.title!==void 0&&(t.title=e.title),e.summary!==void 0&&(t.summary=e.summary),e.proposer!==void 0&&(t.proposer=e.proposer),t},fromPartial(e){var n,p;const t=createBaseProposal$2();return t.id=e.id??0,t.messages=((n=e.messages)==null?void 0:n.map(u=>Any$8.fromPartial(u)))||[],t.status=e.status??0,t.finalTallyResult=e.finalTallyResult!==void 0&&e.finalTallyResult!==null?TallyResult$2.fromPartial(e.finalTallyResult):void 0,t.submitTime=e.submitTime??void 0,t.depositEndTime=e.depositEndTime??void 0,t.totalDeposit=((p=e.totalDeposit)==null?void 0:p.map(u=>Coin$6.fromPartial(u)))||[],t.votingStartTime=e.votingStartTime??void 0,t.votingEndTime=e.votingEndTime??void 0,t.metadata=e.metadata??"",t.title=e.title??"",t.summary=e.summary??"",t.proposer=e.proposer??"",t}};function createBaseTallyResult$2(){return{yesCount:"",abstainCount:"",noCount:"",noWithVetoCount:""}}const TallyResult$2={encode(e,t=_m0.Writer.create()){return e.yesCount!==""&&t.uint32(10).string(e.yesCount),e.abstainCount!==""&&t.uint32(18).string(e.abstainCount),e.noCount!==""&&t.uint32(26).string(e.noCount),e.noWithVetoCount!==""&&t.uint32(34).string(e.noWithVetoCount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTallyResult$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.yesCount=n.string();break;case 2:u.abstainCount=n.string();break;case 3:u.noCount=n.string();break;case 4:u.noWithVetoCount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{yesCount:isSet$1a(e.yesCount)?String(e.yesCount):"",abstainCount:isSet$1a(e.abstainCount)?String(e.abstainCount):"",noCount:isSet$1a(e.noCount)?String(e.noCount):"",noWithVetoCount:isSet$1a(e.noWithVetoCount)?String(e.noWithVetoCount):""}},toJSON(e){const t={};return e.yesCount!==void 0&&(t.yesCount=e.yesCount),e.abstainCount!==void 0&&(t.abstainCount=e.abstainCount),e.noCount!==void 0&&(t.noCount=e.noCount),e.noWithVetoCount!==void 0&&(t.noWithVetoCount=e.noWithVetoCount),t},fromPartial(e){const t=createBaseTallyResult$2();return t.yesCount=e.yesCount??"",t.abstainCount=e.abstainCount??"",t.noCount=e.noCount??"",t.noWithVetoCount=e.noWithVetoCount??"",t}};function createBaseVote$2(){return{proposalId:0,voter:"",options:[],metadata:""}}const Vote$2={encode(e,t=_m0.Writer.create()){e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.voter!==""&&t.uint32(18).string(e.voter);for(const n of e.options)WeightedVoteOption$1.encode(n,t.uint32(34).fork()).ldelim();return e.metadata!==""&&t.uint32(42).string(e.metadata),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseVote$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$G(n.uint64());break;case 2:u.voter=n.string();break;case 4:u.options.push(WeightedVoteOption$1.decode(n,n.uint32()));break;case 5:u.metadata=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$1a(e.proposalId)?Number(e.proposalId):0,voter:isSet$1a(e.voter)?String(e.voter):"",options:Array.isArray(e==null?void 0:e.options)?e.options.map(t=>WeightedVoteOption$1.fromJSON(t)):[],metadata:isSet$1a(e.metadata)?String(e.metadata):""}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.voter!==void 0&&(t.voter=e.voter),e.options?t.options=e.options.map(n=>n?WeightedVoteOption$1.toJSON(n):void 0):t.options=[],e.metadata!==void 0&&(t.metadata=e.metadata),t},fromPartial(e){var n;const t=createBaseVote$2();return t.proposalId=e.proposalId??0,t.voter=e.voter??"",t.options=((n=e.options)==null?void 0:n.map(p=>WeightedVoteOption$1.fromPartial(p)))||[],t.metadata=e.metadata??"",t}};function createBaseDepositParams$1(){return{minDeposit:[],maxDepositPeriod:void 0}}const DepositParams$1={encode(e,t=_m0.Writer.create()){for(const n of e.minDeposit)Coin$6.encode(n,t.uint32(10).fork()).ldelim();return e.maxDepositPeriod!==void 0&&Duration$4.encode(e.maxDepositPeriod,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDepositParams$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.minDeposit.push(Coin$6.decode(n,n.uint32()));break;case 2:u.maxDepositPeriod=Duration$4.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{minDeposit:Array.isArray(e==null?void 0:e.minDeposit)?e.minDeposit.map(t=>Coin$6.fromJSON(t)):[],maxDepositPeriod:isSet$1a(e.maxDepositPeriod)?Duration$4.fromJSON(e.maxDepositPeriod):void 0}},toJSON(e){const t={};return e.minDeposit?t.minDeposit=e.minDeposit.map(n=>n?Coin$6.toJSON(n):void 0):t.minDeposit=[],e.maxDepositPeriod!==void 0&&(t.maxDepositPeriod=e.maxDepositPeriod?Duration$4.toJSON(e.maxDepositPeriod):void 0),t},fromPartial(e){var n;const t=createBaseDepositParams$1();return t.minDeposit=((n=e.minDeposit)==null?void 0:n.map(p=>Coin$6.fromPartial(p)))||[],t.maxDepositPeriod=e.maxDepositPeriod!==void 0&&e.maxDepositPeriod!==null?Duration$4.fromPartial(e.maxDepositPeriod):void 0,t}};function createBaseVotingParams$1(){return{votingPeriod:void 0}}const VotingParams$1={encode(e,t=_m0.Writer.create()){return e.votingPeriod!==void 0&&Duration$4.encode(e.votingPeriod,t.uint32(10).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseVotingParams$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.votingPeriod=Duration$4.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{votingPeriod:isSet$1a(e.votingPeriod)?Duration$4.fromJSON(e.votingPeriod):void 0}},toJSON(e){const t={};return e.votingPeriod!==void 0&&(t.votingPeriod=e.votingPeriod?Duration$4.toJSON(e.votingPeriod):void 0),t},fromPartial(e){const t=createBaseVotingParams$1();return t.votingPeriod=e.votingPeriod!==void 0&&e.votingPeriod!==null?Duration$4.fromPartial(e.votingPeriod):void 0,t}};function createBaseTallyParams$1(){return{quorum:"",threshold:"",vetoThreshold:""}}const TallyParams$1={encode(e,t=_m0.Writer.create()){return e.quorum!==""&&t.uint32(10).string(e.quorum),e.threshold!==""&&t.uint32(18).string(e.threshold),e.vetoThreshold!==""&&t.uint32(26).string(e.vetoThreshold),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTallyParams$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.quorum=n.string();break;case 2:u.threshold=n.string();break;case 3:u.vetoThreshold=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{quorum:isSet$1a(e.quorum)?String(e.quorum):"",threshold:isSet$1a(e.threshold)?String(e.threshold):"",vetoThreshold:isSet$1a(e.vetoThreshold)?String(e.vetoThreshold):""}},toJSON(e){const t={};return e.quorum!==void 0&&(t.quorum=e.quorum),e.threshold!==void 0&&(t.threshold=e.threshold),e.vetoThreshold!==void 0&&(t.vetoThreshold=e.vetoThreshold),t},fromPartial(e){const t=createBaseTallyParams$1();return t.quorum=e.quorum??"",t.threshold=e.threshold??"",t.vetoThreshold=e.vetoThreshold??"",t}};function createBaseParams$a(){return{minDeposit:[],maxDepositPeriod:void 0,votingPeriod:void 0,quorum:"",threshold:"",vetoThreshold:"",minInitialDepositRatio:"",burnVoteQuorum:!1,burnProposalDepositPrevote:!1,burnVoteVeto:!1}}const Params$a={encode(e,t=_m0.Writer.create()){for(const n of e.minDeposit)Coin$6.encode(n,t.uint32(10).fork()).ldelim();return e.maxDepositPeriod!==void 0&&Duration$4.encode(e.maxDepositPeriod,t.uint32(18).fork()).ldelim(),e.votingPeriod!==void 0&&Duration$4.encode(e.votingPeriod,t.uint32(26).fork()).ldelim(),e.quorum!==""&&t.uint32(34).string(e.quorum),e.threshold!==""&&t.uint32(42).string(e.threshold),e.vetoThreshold!==""&&t.uint32(50).string(e.vetoThreshold),e.minInitialDepositRatio!==""&&t.uint32(58).string(e.minInitialDepositRatio),e.burnVoteQuorum===!0&&t.uint32(104).bool(e.burnVoteQuorum),e.burnProposalDepositPrevote===!0&&t.uint32(112).bool(e.burnProposalDepositPrevote),e.burnVoteVeto===!0&&t.uint32(120).bool(e.burnVoteVeto),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$a();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.minDeposit.push(Coin$6.decode(n,n.uint32()));break;case 2:u.maxDepositPeriod=Duration$4.decode(n,n.uint32());break;case 3:u.votingPeriod=Duration$4.decode(n,n.uint32());break;case 4:u.quorum=n.string();break;case 5:u.threshold=n.string();break;case 6:u.vetoThreshold=n.string();break;case 7:u.minInitialDepositRatio=n.string();break;case 13:u.burnVoteQuorum=n.bool();break;case 14:u.burnProposalDepositPrevote=n.bool();break;case 15:u.burnVoteVeto=n.bool();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{minDeposit:Array.isArray(e==null?void 0:e.minDeposit)?e.minDeposit.map(t=>Coin$6.fromJSON(t)):[],maxDepositPeriod:isSet$1a(e.maxDepositPeriod)?Duration$4.fromJSON(e.maxDepositPeriod):void 0,votingPeriod:isSet$1a(e.votingPeriod)?Duration$4.fromJSON(e.votingPeriod):void 0,quorum:isSet$1a(e.quorum)?String(e.quorum):"",threshold:isSet$1a(e.threshold)?String(e.threshold):"",vetoThreshold:isSet$1a(e.vetoThreshold)?String(e.vetoThreshold):"",minInitialDepositRatio:isSet$1a(e.minInitialDepositRatio)?String(e.minInitialDepositRatio):"",burnVoteQuorum:isSet$1a(e.burnVoteQuorum)?!!e.burnVoteQuorum:!1,burnProposalDepositPrevote:isSet$1a(e.burnProposalDepositPrevote)?!!e.burnProposalDepositPrevote:!1,burnVoteVeto:isSet$1a(e.burnVoteVeto)?!!e.burnVoteVeto:!1}},toJSON(e){const t={};return e.minDeposit?t.minDeposit=e.minDeposit.map(n=>n?Coin$6.toJSON(n):void 0):t.minDeposit=[],e.maxDepositPeriod!==void 0&&(t.maxDepositPeriod=e.maxDepositPeriod?Duration$4.toJSON(e.maxDepositPeriod):void 0),e.votingPeriod!==void 0&&(t.votingPeriod=e.votingPeriod?Duration$4.toJSON(e.votingPeriod):void 0),e.quorum!==void 0&&(t.quorum=e.quorum),e.threshold!==void 0&&(t.threshold=e.threshold),e.vetoThreshold!==void 0&&(t.vetoThreshold=e.vetoThreshold),e.minInitialDepositRatio!==void 0&&(t.minInitialDepositRatio=e.minInitialDepositRatio),e.burnVoteQuorum!==void 0&&(t.burnVoteQuorum=e.burnVoteQuorum),e.burnProposalDepositPrevote!==void 0&&(t.burnProposalDepositPrevote=e.burnProposalDepositPrevote),e.burnVoteVeto!==void 0&&(t.burnVoteVeto=e.burnVoteVeto),t},fromPartial(e){var n;const t=createBaseParams$a();return t.minDeposit=((n=e.minDeposit)==null?void 0:n.map(p=>Coin$6.fromPartial(p)))||[],t.maxDepositPeriod=e.maxDepositPeriod!==void 0&&e.maxDepositPeriod!==null?Duration$4.fromPartial(e.maxDepositPeriod):void 0,t.votingPeriod=e.votingPeriod!==void 0&&e.votingPeriod!==null?Duration$4.fromPartial(e.votingPeriod):void 0,t.quorum=e.quorum??"",t.threshold=e.threshold??"",t.vetoThreshold=e.vetoThreshold??"",t.minInitialDepositRatio=e.minInitialDepositRatio??"",t.burnVoteQuorum=e.burnVoteQuorum??!1,t.burnProposalDepositPrevote=e.burnProposalDepositPrevote??!1,t.burnVoteVeto=e.burnVoteVeto??!1,t}};var globalThis$12=(()=>{if(typeof globalThis$12<"u")return globalThis$12;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function toTimestamp$7(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$7(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$7(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$7(Timestamp$6.fromJSON(e))}function longToNumber$G(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$12.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1a(e){return e!=null}function createBaseMsgSubmitProposal$2(){return{messages:[],initialDeposit:[],proposer:"",metadata:"",title:"",summary:""}}const MsgSubmitProposal$2={encode(e,t=_m0.Writer.create()){for(const n of e.messages)Any$8.encode(n,t.uint32(10).fork()).ldelim();for(const n of e.initialDeposit)Coin$6.encode(n,t.uint32(18).fork()).ldelim();return e.proposer!==""&&t.uint32(26).string(e.proposer),e.metadata!==""&&t.uint32(34).string(e.metadata),e.title!==""&&t.uint32(42).string(e.title),e.summary!==""&&t.uint32(50).string(e.summary),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgSubmitProposal$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.messages.push(Any$8.decode(n,n.uint32()));break;case 2:u.initialDeposit.push(Coin$6.decode(n,n.uint32()));break;case 3:u.proposer=n.string();break;case 4:u.metadata=n.string();break;case 5:u.title=n.string();break;case 6:u.summary=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{messages:Array.isArray(e==null?void 0:e.messages)?e.messages.map(t=>Any$8.fromJSON(t)):[],initialDeposit:Array.isArray(e==null?void 0:e.initialDeposit)?e.initialDeposit.map(t=>Coin$6.fromJSON(t)):[],proposer:isSet$19(e.proposer)?String(e.proposer):"",metadata:isSet$19(e.metadata)?String(e.metadata):"",title:isSet$19(e.title)?String(e.title):"",summary:isSet$19(e.summary)?String(e.summary):""}},toJSON(e){const t={};return e.messages?t.messages=e.messages.map(n=>n?Any$8.toJSON(n):void 0):t.messages=[],e.initialDeposit?t.initialDeposit=e.initialDeposit.map(n=>n?Coin$6.toJSON(n):void 0):t.initialDeposit=[],e.proposer!==void 0&&(t.proposer=e.proposer),e.metadata!==void 0&&(t.metadata=e.metadata),e.title!==void 0&&(t.title=e.title),e.summary!==void 0&&(t.summary=e.summary),t},fromPartial(e){var n,p;const t=createBaseMsgSubmitProposal$2();return t.messages=((n=e.messages)==null?void 0:n.map(u=>Any$8.fromPartial(u)))||[],t.initialDeposit=((p=e.initialDeposit)==null?void 0:p.map(u=>Coin$6.fromPartial(u)))||[],t.proposer=e.proposer??"",t.metadata=e.metadata??"",t.title=e.title??"",t.summary=e.summary??"",t}};function createBaseMsgVote$2(){return{proposalId:0,voter:"",option:0,metadata:""}}const MsgVote$2={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.voter!==""&&t.uint32(18).string(e.voter),e.option!==0&&t.uint32(24).int32(e.option),e.metadata!==""&&t.uint32(34).string(e.metadata),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgVote$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$F(n.uint64());break;case 2:u.voter=n.string();break;case 3:u.option=n.int32();break;case 4:u.metadata=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$19(e.proposalId)?Number(e.proposalId):0,voter:isSet$19(e.voter)?String(e.voter):"",option:isSet$19(e.option)?voteOptionFromJSON$2(e.option):0,metadata:isSet$19(e.metadata)?String(e.metadata):""}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.voter!==void 0&&(t.voter=e.voter),e.option!==void 0&&(t.option=voteOptionToJSON$2(e.option)),e.metadata!==void 0&&(t.metadata=e.metadata),t},fromPartial(e){const t=createBaseMsgVote$2();return t.proposalId=e.proposalId??0,t.voter=e.voter??"",t.option=e.option??0,t.metadata=e.metadata??"",t}};function createBaseMsgVoteWeighted$1(){return{proposalId:0,voter:"",options:[],metadata:""}}const MsgVoteWeighted$1={encode(e,t=_m0.Writer.create()){e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.voter!==""&&t.uint32(18).string(e.voter);for(const n of e.options)WeightedVoteOption$1.encode(n,t.uint32(26).fork()).ldelim();return e.metadata!==""&&t.uint32(34).string(e.metadata),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgVoteWeighted$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$F(n.uint64());break;case 2:u.voter=n.string();break;case 3:u.options.push(WeightedVoteOption$1.decode(n,n.uint32()));break;case 4:u.metadata=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$19(e.proposalId)?Number(e.proposalId):0,voter:isSet$19(e.voter)?String(e.voter):"",options:Array.isArray(e==null?void 0:e.options)?e.options.map(t=>WeightedVoteOption$1.fromJSON(t)):[],metadata:isSet$19(e.metadata)?String(e.metadata):""}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.voter!==void 0&&(t.voter=e.voter),e.options?t.options=e.options.map(n=>n?WeightedVoteOption$1.toJSON(n):void 0):t.options=[],e.metadata!==void 0&&(t.metadata=e.metadata),t},fromPartial(e){var n;const t=createBaseMsgVoteWeighted$1();return t.proposalId=e.proposalId??0,t.voter=e.voter??"",t.options=((n=e.options)==null?void 0:n.map(p=>WeightedVoteOption$1.fromPartial(p)))||[],t.metadata=e.metadata??"",t}};function createBaseMsgDeposit$1(){return{proposalId:0,depositor:"",amount:[]}}const MsgDeposit$1={encode(e,t=_m0.Writer.create()){e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.depositor!==""&&t.uint32(18).string(e.depositor);for(const n of e.amount)Coin$6.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgDeposit$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$F(n.uint64());break;case 2:u.depositor=n.string();break;case 3:u.amount.push(Coin$6.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$19(e.proposalId)?Number(e.proposalId):0,depositor:isSet$19(e.depositor)?String(e.depositor):"",amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$6.fromJSON(t)):[]}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.depositor!==void 0&&(t.depositor=e.depositor),e.amount?t.amount=e.amount.map(n=>n?Coin$6.toJSON(n):void 0):t.amount=[],t},fromPartial(e){var n;const t=createBaseMsgDeposit$1();return t.proposalId=e.proposalId??0,t.depositor=e.depositor??"",t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$6.fromPartial(p)))||[],t}};function createBaseMsgUpdateParams(){return{authority:"",params:void 0}}const MsgUpdateParams={encode(e,t=_m0.Writer.create()){return e.authority!==""&&t.uint32(10).string(e.authority),e.params!==void 0&&Params$a.encode(e.params,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateParams();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.authority=n.string();break;case 2:u.params=Params$a.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{authority:isSet$19(e.authority)?String(e.authority):"",params:isSet$19(e.params)?Params$a.fromJSON(e.params):void 0}},toJSON(e){const t={};return e.authority!==void 0&&(t.authority=e.authority),e.params!==void 0&&(t.params=e.params?Params$a.toJSON(e.params):void 0),t},fromPartial(e){const t=createBaseMsgUpdateParams();return t.authority=e.authority??"",t.params=e.params!==void 0&&e.params!==null?Params$a.fromPartial(e.params):void 0,t}};var globalThis$11=(()=>{if(typeof globalThis$11<"u")return globalThis$11;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$F(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$11.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$19(e){return e!=null}const msgTypes$i=[["/cosmos.gov.v1.MsgVote",MsgVote$2],["/cosmos.gov.v1.MsgVoteWeighted",MsgVoteWeighted$1],["/cosmos.gov.v1.MsgUpdateParams",MsgUpdateParams],["/cosmos.gov.v1.MsgDeposit",MsgDeposit$1],["/cosmos.gov.v1.MsgSubmitProposal",MsgSubmitProposal$2]];let HttpClient$i=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$i=class extends HttpClient$i{constructor(){super(...arguments),this.queryParams=(t,n={})=>this.request({path:`/cosmos/gov/v1/params/${t}`,method:"GET",format:"json",...n}),this.queryProposals=(t,n={})=>this.request({path:"/cosmos/gov/v1/proposals",method:"GET",query:t,format:"json",...n}),this.queryProposal=(t,n={})=>this.request({path:`/cosmos/gov/v1/proposals/${t}`,method:"GET",format:"json",...n}),this.queryDeposits=(t,n,p={})=>this.request({path:`/cosmos/gov/v1/proposals/${t}/deposits`,method:"GET",query:n,format:"json",...p}),this.queryDeposit=(t,n,p={})=>this.request({path:`/cosmos/gov/v1/proposals/${t}/deposits/${n}`,method:"GET",format:"json",...p}),this.queryTallyResult=(t,n={})=>this.request({path:`/cosmos/gov/v1/proposals/${t}/tally`,method:"GET",format:"json",...n}),this.queryVotes=(t,n,p={})=>this.request({path:`/cosmos/gov/v1/proposals/${t}/votes`,method:"GET",query:n,format:"json",...p}),this.queryVote=(t,n,p={})=>this.request({path:`/cosmos/gov/v1/proposals/${t}/votes/${n}`,method:"GET",format:"json",...p})}};const registry$9=new build$b.Registry(msgTypes$i);function getStructure$i(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$8={amount:[],gas:"200000"},txClient$i=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgVote({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgVote: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$9,prefix:t});let N=this.msgVote({value:MsgVote$2.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$8,g)}catch(y){throw new Error("TxClient:sendMsgVote: Could not broadcast Tx: "+y.message)}},async sendMsgVoteWeighted({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgVoteWeighted: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$9,prefix:t});let N=this.msgVoteWeighted({value:MsgVoteWeighted$1.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$8,g)}catch(y){throw new Error("TxClient:sendMsgVoteWeighted: Could not broadcast Tx: "+y.message)}},async sendMsgUpdateParams({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateParams: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$9,prefix:t});let N=this.msgUpdateParams({value:MsgUpdateParams.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$8,g)}catch(y){throw new Error("TxClient:sendMsgUpdateParams: Could not broadcast Tx: "+y.message)}},async sendMsgDeposit({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgDeposit: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$9,prefix:t});let N=this.msgDeposit({value:MsgDeposit$1.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$8,g)}catch(y){throw new Error("TxClient:sendMsgDeposit: Could not broadcast Tx: "+y.message)}},async sendMsgSubmitProposal({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgSubmitProposal: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$9,prefix:t});let N=this.msgSubmitProposal({value:MsgSubmitProposal$2.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$8,g)}catch(y){throw new Error("TxClient:sendMsgSubmitProposal: Could not broadcast Tx: "+y.message)}},msgVote({value:p}){try{return{typeUrl:"/cosmos.gov.v1.MsgVote",value:MsgVote$2.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgVote: Could not create message: "+u.message)}},msgVoteWeighted({value:p}){try{return{typeUrl:"/cosmos.gov.v1.MsgVoteWeighted",value:MsgVoteWeighted$1.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgVoteWeighted: Could not create message: "+u.message)}},msgUpdateParams({value:p}){try{return{typeUrl:"/cosmos.gov.v1.MsgUpdateParams",value:MsgUpdateParams.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateParams: Could not create message: "+u.message)}},msgDeposit({value:p}){try{return{typeUrl:"/cosmos.gov.v1.MsgDeposit",value:MsgDeposit$1.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgDeposit: Could not create message: "+u.message)}},msgSubmitProposal({value:p}){try{return{typeUrl:"/cosmos.gov.v1.MsgSubmitProposal",value:MsgSubmitProposal$2.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgSubmitProposal: Could not create message: "+u.message)}}}),queryClient$i=({addr:e}={addr:"http://localhost:1317"})=>new Api$i({baseURL:e});let SDKModule$i=class{constructor(t){this.registry=[],this.query=queryClient$i({addr:t.env.apiURL}),this.updateTX(t),this.structure={WeightedVoteOption:getStructure$i(WeightedVoteOption$1.fromPartial({})),Deposit:getStructure$i(Deposit$1.fromPartial({})),Proposal:getStructure$i(Proposal$2.fromPartial({})),TallyResult:getStructure$i(TallyResult$2.fromPartial({})),Vote:getStructure$i(Vote$2.fromPartial({})),DepositParams:getStructure$i(DepositParams$1.fromPartial({})),VotingParams:getStructure$i(VotingParams$1.fromPartial({})),TallyParams:getStructure$i(TallyParams$1.fromPartial({})),Params:getStructure$i(Params$a.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$i({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$i=e=>({module:{CosmosGovV1:new SDKModule$i(e)},registry:msgTypes$i});function createBaseAny$7(){return{typeUrl:"",value:new Uint8Array}}const Any$7={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$7();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$18(e.typeUrl)?String(e.typeUrl):"",value:isSet$18(e.value)?bytesFromBase64$k(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$k(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$7();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$10=(()=>{if(typeof globalThis$10<"u")return globalThis$10;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$k(e){if(globalThis$10.Buffer)return Uint8Array.from(globalThis$10.Buffer.from(e,"base64"));{const t=globalThis$10.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$k(e){if(globalThis$10.Buffer)return globalThis$10.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$10.btoa(t.join(""))}}function isSet$18(e){return e!=null}function createBaseCoin$5(){return{denom:"",amount:""}}const Coin$5={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin$5();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$17(e.denom)?String(e.denom):"",amount:isSet$17(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin$5();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$17(e){return e!=null}function createBaseDuration$3(){return{seconds:0,nanos:0}}const Duration$3={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDuration$3();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$E(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$16(e.seconds)?Number(e.seconds):0,nanos:isSet$16(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseDuration$3();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$$=(()=>{if(typeof globalThis$$<"u")return globalThis$$;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$E(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$$.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$16(e){return e!=null}function createBaseTimestamp$5(){return{seconds:0,nanos:0}}const Timestamp$5={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp$5();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$D(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$15(e.seconds)?Number(e.seconds):0,nanos:isSet$15(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp$5();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$_=(()=>{if(typeof globalThis$_<"u")return globalThis$_;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$D(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$_.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$15(e){return e!=null}function voteOptionFromJSON$1(e){switch(e){case 0:case"VOTE_OPTION_UNSPECIFIED":return 0;case 1:case"VOTE_OPTION_YES":return 1;case 2:case"VOTE_OPTION_ABSTAIN":return 2;case 3:case"VOTE_OPTION_NO":return 3;case 4:case"VOTE_OPTION_NO_WITH_VETO":return 4;case-1:case"UNRECOGNIZED":default:return-1}}function voteOptionToJSON$1(e){switch(e){case 0:return"VOTE_OPTION_UNSPECIFIED";case 1:return"VOTE_OPTION_YES";case 2:return"VOTE_OPTION_ABSTAIN";case 3:return"VOTE_OPTION_NO";case 4:return"VOTE_OPTION_NO_WITH_VETO";case-1:default:return"UNRECOGNIZED"}}function proposalStatusFromJSON$1(e){switch(e){case 0:case"PROPOSAL_STATUS_UNSPECIFIED":return 0;case 1:case"PROPOSAL_STATUS_DEPOSIT_PERIOD":return 1;case 2:case"PROPOSAL_STATUS_VOTING_PERIOD":return 2;case 3:case"PROPOSAL_STATUS_PASSED":return 3;case 4:case"PROPOSAL_STATUS_REJECTED":return 4;case 5:case"PROPOSAL_STATUS_FAILED":return 5;case-1:case"UNRECOGNIZED":default:return-1}}function proposalStatusToJSON$1(e){switch(e){case 0:return"PROPOSAL_STATUS_UNSPECIFIED";case 1:return"PROPOSAL_STATUS_DEPOSIT_PERIOD";case 2:return"PROPOSAL_STATUS_VOTING_PERIOD";case 3:return"PROPOSAL_STATUS_PASSED";case 4:return"PROPOSAL_STATUS_REJECTED";case 5:return"PROPOSAL_STATUS_FAILED";case-1:default:return"UNRECOGNIZED"}}function createBaseWeightedVoteOption(){return{option:0,weight:""}}const WeightedVoteOption={encode(e,t=_m0.Writer.create()){return e.option!==0&&t.uint32(8).int32(e.option),e.weight!==""&&t.uint32(18).string(e.weight),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseWeightedVoteOption();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.option=n.int32();break;case 2:u.weight=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{option:isSet$14(e.option)?voteOptionFromJSON$1(e.option):0,weight:isSet$14(e.weight)?String(e.weight):""}},toJSON(e){const t={};return e.option!==void 0&&(t.option=voteOptionToJSON$1(e.option)),e.weight!==void 0&&(t.weight=e.weight),t},fromPartial(e){const t=createBaseWeightedVoteOption();return t.option=e.option??0,t.weight=e.weight??"",t}};function createBaseTextProposal(){return{title:"",description:""}}const TextProposal={encode(e,t=_m0.Writer.create()){return e.title!==""&&t.uint32(10).string(e.title),e.description!==""&&t.uint32(18).string(e.description),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTextProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.title=n.string();break;case 2:u.description=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{title:isSet$14(e.title)?String(e.title):"",description:isSet$14(e.description)?String(e.description):""}},toJSON(e){const t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),t},fromPartial(e){const t=createBaseTextProposal();return t.title=e.title??"",t.description=e.description??"",t}};function createBaseDeposit(){return{proposalId:0,depositor:"",amount:[]}}const Deposit={encode(e,t=_m0.Writer.create()){e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.depositor!==""&&t.uint32(18).string(e.depositor);for(const n of e.amount)Coin$5.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDeposit();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$C(n.uint64());break;case 2:u.depositor=n.string();break;case 3:u.amount.push(Coin$5.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$14(e.proposalId)?Number(e.proposalId):0,depositor:isSet$14(e.depositor)?String(e.depositor):"",amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$5.fromJSON(t)):[]}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.depositor!==void 0&&(t.depositor=e.depositor),e.amount?t.amount=e.amount.map(n=>n?Coin$5.toJSON(n):void 0):t.amount=[],t},fromPartial(e){var n;const t=createBaseDeposit();return t.proposalId=e.proposalId??0,t.depositor=e.depositor??"",t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$5.fromPartial(p)))||[],t}};function createBaseProposal$1(){return{proposalId:0,content:void 0,status:0,finalTallyResult:void 0,submitTime:void 0,depositEndTime:void 0,totalDeposit:[],votingStartTime:void 0,votingEndTime:void 0}}const Proposal$1={encode(e,t=_m0.Writer.create()){e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.content!==void 0&&Any$7.encode(e.content,t.uint32(18).fork()).ldelim(),e.status!==0&&t.uint32(24).int32(e.status),e.finalTallyResult!==void 0&&TallyResult$1.encode(e.finalTallyResult,t.uint32(34).fork()).ldelim(),e.submitTime!==void 0&&Timestamp$5.encode(toTimestamp$6(e.submitTime),t.uint32(42).fork()).ldelim(),e.depositEndTime!==void 0&&Timestamp$5.encode(toTimestamp$6(e.depositEndTime),t.uint32(50).fork()).ldelim();for(const n of e.totalDeposit)Coin$5.encode(n,t.uint32(58).fork()).ldelim();return e.votingStartTime!==void 0&&Timestamp$5.encode(toTimestamp$6(e.votingStartTime),t.uint32(66).fork()).ldelim(),e.votingEndTime!==void 0&&Timestamp$5.encode(toTimestamp$6(e.votingEndTime),t.uint32(74).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseProposal$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$C(n.uint64());break;case 2:u.content=Any$7.decode(n,n.uint32());break;case 3:u.status=n.int32();break;case 4:u.finalTallyResult=TallyResult$1.decode(n,n.uint32());break;case 5:u.submitTime=fromTimestamp$6(Timestamp$5.decode(n,n.uint32()));break;case 6:u.depositEndTime=fromTimestamp$6(Timestamp$5.decode(n,n.uint32()));break;case 7:u.totalDeposit.push(Coin$5.decode(n,n.uint32()));break;case 8:u.votingStartTime=fromTimestamp$6(Timestamp$5.decode(n,n.uint32()));break;case 9:u.votingEndTime=fromTimestamp$6(Timestamp$5.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$14(e.proposalId)?Number(e.proposalId):0,content:isSet$14(e.content)?Any$7.fromJSON(e.content):void 0,status:isSet$14(e.status)?proposalStatusFromJSON$1(e.status):0,finalTallyResult:isSet$14(e.finalTallyResult)?TallyResult$1.fromJSON(e.finalTallyResult):void 0,submitTime:isSet$14(e.submitTime)?fromJsonTimestamp$6(e.submitTime):void 0,depositEndTime:isSet$14(e.depositEndTime)?fromJsonTimestamp$6(e.depositEndTime):void 0,totalDeposit:Array.isArray(e==null?void 0:e.totalDeposit)?e.totalDeposit.map(t=>Coin$5.fromJSON(t)):[],votingStartTime:isSet$14(e.votingStartTime)?fromJsonTimestamp$6(e.votingStartTime):void 0,votingEndTime:isSet$14(e.votingEndTime)?fromJsonTimestamp$6(e.votingEndTime):void 0}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.content!==void 0&&(t.content=e.content?Any$7.toJSON(e.content):void 0),e.status!==void 0&&(t.status=proposalStatusToJSON$1(e.status)),e.finalTallyResult!==void 0&&(t.finalTallyResult=e.finalTallyResult?TallyResult$1.toJSON(e.finalTallyResult):void 0),e.submitTime!==void 0&&(t.submitTime=e.submitTime.toISOString()),e.depositEndTime!==void 0&&(t.depositEndTime=e.depositEndTime.toISOString()),e.totalDeposit?t.totalDeposit=e.totalDeposit.map(n=>n?Coin$5.toJSON(n):void 0):t.totalDeposit=[],e.votingStartTime!==void 0&&(t.votingStartTime=e.votingStartTime.toISOString()),e.votingEndTime!==void 0&&(t.votingEndTime=e.votingEndTime.toISOString()),t},fromPartial(e){var n;const t=createBaseProposal$1();return t.proposalId=e.proposalId??0,t.content=e.content!==void 0&&e.content!==null?Any$7.fromPartial(e.content):void 0,t.status=e.status??0,t.finalTallyResult=e.finalTallyResult!==void 0&&e.finalTallyResult!==null?TallyResult$1.fromPartial(e.finalTallyResult):void 0,t.submitTime=e.submitTime??void 0,t.depositEndTime=e.depositEndTime??void 0,t.totalDeposit=((n=e.totalDeposit)==null?void 0:n.map(p=>Coin$5.fromPartial(p)))||[],t.votingStartTime=e.votingStartTime??void 0,t.votingEndTime=e.votingEndTime??void 0,t}};function createBaseTallyResult$1(){return{yes:"",abstain:"",no:"",noWithVeto:""}}const TallyResult$1={encode(e,t=_m0.Writer.create()){return e.yes!==""&&t.uint32(10).string(e.yes),e.abstain!==""&&t.uint32(18).string(e.abstain),e.no!==""&&t.uint32(26).string(e.no),e.noWithVeto!==""&&t.uint32(34).string(e.noWithVeto),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTallyResult$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.yes=n.string();break;case 2:u.abstain=n.string();break;case 3:u.no=n.string();break;case 4:u.noWithVeto=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{yes:isSet$14(e.yes)?String(e.yes):"",abstain:isSet$14(e.abstain)?String(e.abstain):"",no:isSet$14(e.no)?String(e.no):"",noWithVeto:isSet$14(e.noWithVeto)?String(e.noWithVeto):""}},toJSON(e){const t={};return e.yes!==void 0&&(t.yes=e.yes),e.abstain!==void 0&&(t.abstain=e.abstain),e.no!==void 0&&(t.no=e.no),e.noWithVeto!==void 0&&(t.noWithVeto=e.noWithVeto),t},fromPartial(e){const t=createBaseTallyResult$1();return t.yes=e.yes??"",t.abstain=e.abstain??"",t.no=e.no??"",t.noWithVeto=e.noWithVeto??"",t}};function createBaseVote$1(){return{proposalId:0,voter:"",option:0,options:[]}}const Vote$1={encode(e,t=_m0.Writer.create()){e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.voter!==""&&t.uint32(18).string(e.voter),e.option!==0&&t.uint32(24).int32(e.option);for(const n of e.options)WeightedVoteOption.encode(n,t.uint32(34).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseVote$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$C(n.uint64());break;case 2:u.voter=n.string();break;case 3:u.option=n.int32();break;case 4:u.options.push(WeightedVoteOption.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$14(e.proposalId)?Number(e.proposalId):0,voter:isSet$14(e.voter)?String(e.voter):"",option:isSet$14(e.option)?voteOptionFromJSON$1(e.option):0,options:Array.isArray(e==null?void 0:e.options)?e.options.map(t=>WeightedVoteOption.fromJSON(t)):[]}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.voter!==void 0&&(t.voter=e.voter),e.option!==void 0&&(t.option=voteOptionToJSON$1(e.option)),e.options?t.options=e.options.map(n=>n?WeightedVoteOption.toJSON(n):void 0):t.options=[],t},fromPartial(e){var n;const t=createBaseVote$1();return t.proposalId=e.proposalId??0,t.voter=e.voter??"",t.option=e.option??0,t.options=((n=e.options)==null?void 0:n.map(p=>WeightedVoteOption.fromPartial(p)))||[],t}};function createBaseDepositParams(){return{minDeposit:[],maxDepositPeriod:void 0}}const DepositParams={encode(e,t=_m0.Writer.create()){for(const n of e.minDeposit)Coin$5.encode(n,t.uint32(10).fork()).ldelim();return e.maxDepositPeriod!==void 0&&Duration$3.encode(e.maxDepositPeriod,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDepositParams();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.minDeposit.push(Coin$5.decode(n,n.uint32()));break;case 2:u.maxDepositPeriod=Duration$3.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{minDeposit:Array.isArray(e==null?void 0:e.minDeposit)?e.minDeposit.map(t=>Coin$5.fromJSON(t)):[],maxDepositPeriod:isSet$14(e.maxDepositPeriod)?Duration$3.fromJSON(e.maxDepositPeriod):void 0}},toJSON(e){const t={};return e.minDeposit?t.minDeposit=e.minDeposit.map(n=>n?Coin$5.toJSON(n):void 0):t.minDeposit=[],e.maxDepositPeriod!==void 0&&(t.maxDepositPeriod=e.maxDepositPeriod?Duration$3.toJSON(e.maxDepositPeriod):void 0),t},fromPartial(e){var n;const t=createBaseDepositParams();return t.minDeposit=((n=e.minDeposit)==null?void 0:n.map(p=>Coin$5.fromPartial(p)))||[],t.maxDepositPeriod=e.maxDepositPeriod!==void 0&&e.maxDepositPeriod!==null?Duration$3.fromPartial(e.maxDepositPeriod):void 0,t}};function createBaseVotingParams(){return{votingPeriod:void 0}}const VotingParams={encode(e,t=_m0.Writer.create()){return e.votingPeriod!==void 0&&Duration$3.encode(e.votingPeriod,t.uint32(10).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseVotingParams();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.votingPeriod=Duration$3.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{votingPeriod:isSet$14(e.votingPeriod)?Duration$3.fromJSON(e.votingPeriod):void 0}},toJSON(e){const t={};return e.votingPeriod!==void 0&&(t.votingPeriod=e.votingPeriod?Duration$3.toJSON(e.votingPeriod):void 0),t},fromPartial(e){const t=createBaseVotingParams();return t.votingPeriod=e.votingPeriod!==void 0&&e.votingPeriod!==null?Duration$3.fromPartial(e.votingPeriod):void 0,t}};function createBaseTallyParams(){return{quorum:new Uint8Array,threshold:new Uint8Array,vetoThreshold:new Uint8Array}}const TallyParams={encode(e,t=_m0.Writer.create()){return e.quorum.length!==0&&t.uint32(10).bytes(e.quorum),e.threshold.length!==0&&t.uint32(18).bytes(e.threshold),e.vetoThreshold.length!==0&&t.uint32(26).bytes(e.vetoThreshold),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTallyParams();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.quorum=n.bytes();break;case 2:u.threshold=n.bytes();break;case 3:u.vetoThreshold=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{quorum:isSet$14(e.quorum)?bytesFromBase64$j(e.quorum):new Uint8Array,threshold:isSet$14(e.threshold)?bytesFromBase64$j(e.threshold):new Uint8Array,vetoThreshold:isSet$14(e.vetoThreshold)?bytesFromBase64$j(e.vetoThreshold):new Uint8Array}},toJSON(e){const t={};return e.quorum!==void 0&&(t.quorum=base64FromBytes$j(e.quorum!==void 0?e.quorum:new Uint8Array)),e.threshold!==void 0&&(t.threshold=base64FromBytes$j(e.threshold!==void 0?e.threshold:new Uint8Array)),e.vetoThreshold!==void 0&&(t.vetoThreshold=base64FromBytes$j(e.vetoThreshold!==void 0?e.vetoThreshold:new Uint8Array)),t},fromPartial(e){const t=createBaseTallyParams();return t.quorum=e.quorum??new Uint8Array,t.threshold=e.threshold??new Uint8Array,t.vetoThreshold=e.vetoThreshold??new Uint8Array,t}};var globalThis$Z=(()=>{if(typeof globalThis$Z<"u")return globalThis$Z;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$j(e){if(globalThis$Z.Buffer)return Uint8Array.from(globalThis$Z.Buffer.from(e,"base64"));{const t=globalThis$Z.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$j(e){if(globalThis$Z.Buffer)return globalThis$Z.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$Z.btoa(t.join(""))}}function toTimestamp$6(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$6(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$6(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$6(Timestamp$5.fromJSON(e))}function longToNumber$C(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$Z.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$14(e){return e!=null}function createBaseMsgSubmitProposal$1(){return{content:void 0,initialDeposit:[],proposer:""}}const MsgSubmitProposal$1={encode(e,t=_m0.Writer.create()){e.content!==void 0&&Any$7.encode(e.content,t.uint32(10).fork()).ldelim();for(const n of e.initialDeposit)Coin$5.encode(n,t.uint32(18).fork()).ldelim();return e.proposer!==""&&t.uint32(26).string(e.proposer),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgSubmitProposal$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.content=Any$7.decode(n,n.uint32());break;case 2:u.initialDeposit.push(Coin$5.decode(n,n.uint32()));break;case 3:u.proposer=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{content:isSet$13(e.content)?Any$7.fromJSON(e.content):void 0,initialDeposit:Array.isArray(e==null?void 0:e.initialDeposit)?e.initialDeposit.map(t=>Coin$5.fromJSON(t)):[],proposer:isSet$13(e.proposer)?String(e.proposer):""}},toJSON(e){const t={};return e.content!==void 0&&(t.content=e.content?Any$7.toJSON(e.content):void 0),e.initialDeposit?t.initialDeposit=e.initialDeposit.map(n=>n?Coin$5.toJSON(n):void 0):t.initialDeposit=[],e.proposer!==void 0&&(t.proposer=e.proposer),t},fromPartial(e){var n;const t=createBaseMsgSubmitProposal$1();return t.content=e.content!==void 0&&e.content!==null?Any$7.fromPartial(e.content):void 0,t.initialDeposit=((n=e.initialDeposit)==null?void 0:n.map(p=>Coin$5.fromPartial(p)))||[],t.proposer=e.proposer??"",t}};function createBaseMsgVote$1(){return{proposalId:0,voter:"",option:0}}const MsgVote$1={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.voter!==""&&t.uint32(18).string(e.voter),e.option!==0&&t.uint32(24).int32(e.option),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgVote$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$B(n.uint64());break;case 2:u.voter=n.string();break;case 3:u.option=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$13(e.proposalId)?Number(e.proposalId):0,voter:isSet$13(e.voter)?String(e.voter):"",option:isSet$13(e.option)?voteOptionFromJSON$1(e.option):0}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.voter!==void 0&&(t.voter=e.voter),e.option!==void 0&&(t.option=voteOptionToJSON$1(e.option)),t},fromPartial(e){const t=createBaseMsgVote$1();return t.proposalId=e.proposalId??0,t.voter=e.voter??"",t.option=e.option??0,t}};function createBaseMsgVoteWeighted(){return{proposalId:0,voter:"",options:[]}}const MsgVoteWeighted={encode(e,t=_m0.Writer.create()){e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.voter!==""&&t.uint32(18).string(e.voter);for(const n of e.options)WeightedVoteOption.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgVoteWeighted();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$B(n.uint64());break;case 2:u.voter=n.string();break;case 3:u.options.push(WeightedVoteOption.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$13(e.proposalId)?Number(e.proposalId):0,voter:isSet$13(e.voter)?String(e.voter):"",options:Array.isArray(e==null?void 0:e.options)?e.options.map(t=>WeightedVoteOption.fromJSON(t)):[]}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.voter!==void 0&&(t.voter=e.voter),e.options?t.options=e.options.map(n=>n?WeightedVoteOption.toJSON(n):void 0):t.options=[],t},fromPartial(e){var n;const t=createBaseMsgVoteWeighted();return t.proposalId=e.proposalId??0,t.voter=e.voter??"",t.options=((n=e.options)==null?void 0:n.map(p=>WeightedVoteOption.fromPartial(p)))||[],t}};function createBaseMsgDeposit(){return{proposalId:0,depositor:"",amount:[]}}const MsgDeposit={encode(e,t=_m0.Writer.create()){e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.depositor!==""&&t.uint32(18).string(e.depositor);for(const n of e.amount)Coin$5.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgDeposit();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$B(n.uint64());break;case 2:u.depositor=n.string();break;case 3:u.amount.push(Coin$5.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$13(e.proposalId)?Number(e.proposalId):0,depositor:isSet$13(e.depositor)?String(e.depositor):"",amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$5.fromJSON(t)):[]}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.depositor!==void 0&&(t.depositor=e.depositor),e.amount?t.amount=e.amount.map(n=>n?Coin$5.toJSON(n):void 0):t.amount=[],t},fromPartial(e){var n;const t=createBaseMsgDeposit();return t.proposalId=e.proposalId??0,t.depositor=e.depositor??"",t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$5.fromPartial(p)))||[],t}};var globalThis$Y=(()=>{if(typeof globalThis$Y<"u")return globalThis$Y;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$B(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$Y.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$13(e){return e!=null}const msgTypes$h=[["/cosmos.gov.v1beta1.MsgSubmitProposal",MsgSubmitProposal$1],["/cosmos.gov.v1beta1.MsgDeposit",MsgDeposit],["/cosmos.gov.v1beta1.MsgVote",MsgVote$1],["/cosmos.gov.v1beta1.MsgVoteWeighted",MsgVoteWeighted]];let HttpClient$h=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$h=class extends HttpClient$h{constructor(){super(...arguments),this.queryParams=(t,n={})=>this.request({path:`/cosmos/gov/v1beta1/params/${t}`,method:"GET",format:"json",...n}),this.queryProposals=(t,n={})=>this.request({path:"/cosmos/gov/v1beta1/proposals",method:"GET",query:t,format:"json",...n}),this.queryProposal=(t,n={})=>this.request({path:`/cosmos/gov/v1beta1/proposals/${t}`,method:"GET",format:"json",...n}),this.queryDeposits=(t,n,p={})=>this.request({path:`/cosmos/gov/v1beta1/proposals/${t}/deposits`,method:"GET",query:n,format:"json",...p}),this.queryDeposit=(t,n,p={})=>this.request({path:`/cosmos/gov/v1beta1/proposals/${t}/deposits/${n}`,method:"GET",format:"json",...p}),this.queryTallyResult=(t,n={})=>this.request({path:`/cosmos/gov/v1beta1/proposals/${t}/tally`,method:"GET",format:"json",...n}),this.queryVotes=(t,n,p={})=>this.request({path:`/cosmos/gov/v1beta1/proposals/${t}/votes`,method:"GET",query:n,format:"json",...p}),this.queryVote=(t,n,p={})=>this.request({path:`/cosmos/gov/v1beta1/proposals/${t}/votes/${n}`,method:"GET",format:"json",...p})}};const registry$8=new build$b.Registry(msgTypes$h);function getStructure$h(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$7={amount:[],gas:"200000"},txClient$h=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgSubmitProposal({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgSubmitProposal: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$8,prefix:t});let N=this.msgSubmitProposal({value:MsgSubmitProposal$1.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$7,g)}catch(y){throw new Error("TxClient:sendMsgSubmitProposal: Could not broadcast Tx: "+y.message)}},async sendMsgDeposit({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgDeposit: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$8,prefix:t});let N=this.msgDeposit({value:MsgDeposit.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$7,g)}catch(y){throw new Error("TxClient:sendMsgDeposit: Could not broadcast Tx: "+y.message)}},async sendMsgVote({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgVote: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$8,prefix:t});let N=this.msgVote({value:MsgVote$1.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$7,g)}catch(y){throw new Error("TxClient:sendMsgVote: Could not broadcast Tx: "+y.message)}},async sendMsgVoteWeighted({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgVoteWeighted: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$8,prefix:t});let N=this.msgVoteWeighted({value:MsgVoteWeighted.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$7,g)}catch(y){throw new Error("TxClient:sendMsgVoteWeighted: Could not broadcast Tx: "+y.message)}},msgSubmitProposal({value:p}){try{return{typeUrl:"/cosmos.gov.v1beta1.MsgSubmitProposal",value:MsgSubmitProposal$1.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgSubmitProposal: Could not create message: "+u.message)}},msgDeposit({value:p}){try{return{typeUrl:"/cosmos.gov.v1beta1.MsgDeposit",value:MsgDeposit.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgDeposit: Could not create message: "+u.message)}},msgVote({value:p}){try{return{typeUrl:"/cosmos.gov.v1beta1.MsgVote",value:MsgVote$1.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgVote: Could not create message: "+u.message)}},msgVoteWeighted({value:p}){try{return{typeUrl:"/cosmos.gov.v1beta1.MsgVoteWeighted",value:MsgVoteWeighted.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgVoteWeighted: Could not create message: "+u.message)}}}),queryClient$h=({addr:e}={addr:"http://localhost:1317"})=>new Api$h({baseURL:e});let SDKModule$h=class{constructor(t){this.registry=[],this.query=queryClient$h({addr:t.env.apiURL}),this.updateTX(t),this.structure={WeightedVoteOption:getStructure$h(WeightedVoteOption.fromPartial({})),TextProposal:getStructure$h(TextProposal.fromPartial({})),Deposit:getStructure$h(Deposit.fromPartial({})),Proposal:getStructure$h(Proposal$1.fromPartial({})),TallyResult:getStructure$h(TallyResult$1.fromPartial({})),Vote:getStructure$h(Vote$1.fromPartial({})),DepositParams:getStructure$h(DepositParams.fromPartial({})),VotingParams:getStructure$h(VotingParams.fromPartial({})),TallyParams:getStructure$h(TallyParams.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$h({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$h=e=>({module:{CosmosGovV1Beta1:new SDKModule$h(e)},registry:msgTypes$h});function createBaseAny$6(){return{typeUrl:"",value:new Uint8Array}}const Any$6={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$6();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$12(e.typeUrl)?String(e.typeUrl):"",value:isSet$12(e.value)?bytesFromBase64$i(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$i(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$6();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$X=(()=>{if(typeof globalThis$X<"u")return globalThis$X;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$i(e){if(globalThis$X.Buffer)return Uint8Array.from(globalThis$X.Buffer.from(e,"base64"));{const t=globalThis$X.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$i(e){if(globalThis$X.Buffer)return globalThis$X.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$X.btoa(t.join(""))}}function isSet$12(e){return e!=null}function createBaseDuration$2(){return{seconds:0,nanos:0}}const Duration$2={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDuration$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$A(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$11(e.seconds)?Number(e.seconds):0,nanos:isSet$11(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseDuration$2();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$W=(()=>{if(typeof globalThis$W<"u")return globalThis$W;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$A(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$W.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$11(e){return e!=null}function createBaseTimestamp$4(){return{seconds:0,nanos:0}}const Timestamp$4={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp$4();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$z(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$10(e.seconds)?Number(e.seconds):0,nanos:isSet$10(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp$4();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$V=(()=>{if(typeof globalThis$V<"u")return globalThis$V;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$z(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$V.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$10(e){return e!=null}function voteOptionFromJSON(e){switch(e){case 0:case"VOTE_OPTION_UNSPECIFIED":return 0;case 1:case"VOTE_OPTION_YES":return 1;case 2:case"VOTE_OPTION_ABSTAIN":return 2;case 3:case"VOTE_OPTION_NO":return 3;case 4:case"VOTE_OPTION_NO_WITH_VETO":return 4;case-1:case"UNRECOGNIZED":default:return-1}}function voteOptionToJSON(e){switch(e){case 0:return"VOTE_OPTION_UNSPECIFIED";case 1:return"VOTE_OPTION_YES";case 2:return"VOTE_OPTION_ABSTAIN";case 3:return"VOTE_OPTION_NO";case 4:return"VOTE_OPTION_NO_WITH_VETO";case-1:default:return"UNRECOGNIZED"}}function proposalStatusFromJSON(e){switch(e){case 0:case"PROPOSAL_STATUS_UNSPECIFIED":return 0;case 1:case"PROPOSAL_STATUS_SUBMITTED":return 1;case 2:case"PROPOSAL_STATUS_ACCEPTED":return 2;case 3:case"PROPOSAL_STATUS_REJECTED":return 3;case 4:case"PROPOSAL_STATUS_ABORTED":return 4;case 5:case"PROPOSAL_STATUS_WITHDRAWN":return 5;case-1:case"UNRECOGNIZED":default:return-1}}function proposalStatusToJSON(e){switch(e){case 0:return"PROPOSAL_STATUS_UNSPECIFIED";case 1:return"PROPOSAL_STATUS_SUBMITTED";case 2:return"PROPOSAL_STATUS_ACCEPTED";case 3:return"PROPOSAL_STATUS_REJECTED";case 4:return"PROPOSAL_STATUS_ABORTED";case 5:return"PROPOSAL_STATUS_WITHDRAWN";case-1:default:return"UNRECOGNIZED"}}function proposalExecutorResultFromJSON(e){switch(e){case 0:case"PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED":return 0;case 1:case"PROPOSAL_EXECUTOR_RESULT_NOT_RUN":return 1;case 2:case"PROPOSAL_EXECUTOR_RESULT_SUCCESS":return 2;case 3:case"PROPOSAL_EXECUTOR_RESULT_FAILURE":return 3;case-1:case"UNRECOGNIZED":default:return-1}}function proposalExecutorResultToJSON(e){switch(e){case 0:return"PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED";case 1:return"PROPOSAL_EXECUTOR_RESULT_NOT_RUN";case 2:return"PROPOSAL_EXECUTOR_RESULT_SUCCESS";case 3:return"PROPOSAL_EXECUTOR_RESULT_FAILURE";case-1:default:return"UNRECOGNIZED"}}function createBaseMember(){return{address:"",weight:"",metadata:"",addedAt:void 0}}const Member={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.weight!==""&&t.uint32(18).string(e.weight),e.metadata!==""&&t.uint32(26).string(e.metadata),e.addedAt!==void 0&&Timestamp$4.encode(toTimestamp$5(e.addedAt),t.uint32(34).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMember();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.weight=n.string();break;case 3:u.metadata=n.string();break;case 4:u.addedAt=fromTimestamp$5(Timestamp$4.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$$(e.address)?String(e.address):"",weight:isSet$$(e.weight)?String(e.weight):"",metadata:isSet$$(e.metadata)?String(e.metadata):"",addedAt:isSet$$(e.addedAt)?fromJsonTimestamp$5(e.addedAt):void 0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.weight!==void 0&&(t.weight=e.weight),e.metadata!==void 0&&(t.metadata=e.metadata),e.addedAt!==void 0&&(t.addedAt=e.addedAt.toISOString()),t},fromPartial(e){const t=createBaseMember();return t.address=e.address??"",t.weight=e.weight??"",t.metadata=e.metadata??"",t.addedAt=e.addedAt??void 0,t}};function createBaseMemberRequest(){return{address:"",weight:"",metadata:""}}const MemberRequest={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.weight!==""&&t.uint32(18).string(e.weight),e.metadata!==""&&t.uint32(26).string(e.metadata),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMemberRequest();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.weight=n.string();break;case 3:u.metadata=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$$(e.address)?String(e.address):"",weight:isSet$$(e.weight)?String(e.weight):"",metadata:isSet$$(e.metadata)?String(e.metadata):""}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.weight!==void 0&&(t.weight=e.weight),e.metadata!==void 0&&(t.metadata=e.metadata),t},fromPartial(e){const t=createBaseMemberRequest();return t.address=e.address??"",t.weight=e.weight??"",t.metadata=e.metadata??"",t}};function createBaseThresholdDecisionPolicy(){return{threshold:"",windows:void 0}}const ThresholdDecisionPolicy={encode(e,t=_m0.Writer.create()){return e.threshold!==""&&t.uint32(10).string(e.threshold),e.windows!==void 0&&DecisionPolicyWindows.encode(e.windows,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseThresholdDecisionPolicy();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.threshold=n.string();break;case 2:u.windows=DecisionPolicyWindows.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{threshold:isSet$$(e.threshold)?String(e.threshold):"",windows:isSet$$(e.windows)?DecisionPolicyWindows.fromJSON(e.windows):void 0}},toJSON(e){const t={};return e.threshold!==void 0&&(t.threshold=e.threshold),e.windows!==void 0&&(t.windows=e.windows?DecisionPolicyWindows.toJSON(e.windows):void 0),t},fromPartial(e){const t=createBaseThresholdDecisionPolicy();return t.threshold=e.threshold??"",t.windows=e.windows!==void 0&&e.windows!==null?DecisionPolicyWindows.fromPartial(e.windows):void 0,t}};function createBasePercentageDecisionPolicy(){return{percentage:"",windows:void 0}}const PercentageDecisionPolicy={encode(e,t=_m0.Writer.create()){return e.percentage!==""&&t.uint32(10).string(e.percentage),e.windows!==void 0&&DecisionPolicyWindows.encode(e.windows,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePercentageDecisionPolicy();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.percentage=n.string();break;case 2:u.windows=DecisionPolicyWindows.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{percentage:isSet$$(e.percentage)?String(e.percentage):"",windows:isSet$$(e.windows)?DecisionPolicyWindows.fromJSON(e.windows):void 0}},toJSON(e){const t={};return e.percentage!==void 0&&(t.percentage=e.percentage),e.windows!==void 0&&(t.windows=e.windows?DecisionPolicyWindows.toJSON(e.windows):void 0),t},fromPartial(e){const t=createBasePercentageDecisionPolicy();return t.percentage=e.percentage??"",t.windows=e.windows!==void 0&&e.windows!==null?DecisionPolicyWindows.fromPartial(e.windows):void 0,t}};function createBaseDecisionPolicyWindows(){return{votingPeriod:void 0,minExecutionPeriod:void 0}}const DecisionPolicyWindows={encode(e,t=_m0.Writer.create()){return e.votingPeriod!==void 0&&Duration$2.encode(e.votingPeriod,t.uint32(10).fork()).ldelim(),e.minExecutionPeriod!==void 0&&Duration$2.encode(e.minExecutionPeriod,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDecisionPolicyWindows();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.votingPeriod=Duration$2.decode(n,n.uint32());break;case 2:u.minExecutionPeriod=Duration$2.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{votingPeriod:isSet$$(e.votingPeriod)?Duration$2.fromJSON(e.votingPeriod):void 0,minExecutionPeriod:isSet$$(e.minExecutionPeriod)?Duration$2.fromJSON(e.minExecutionPeriod):void 0}},toJSON(e){const t={};return e.votingPeriod!==void 0&&(t.votingPeriod=e.votingPeriod?Duration$2.toJSON(e.votingPeriod):void 0),e.minExecutionPeriod!==void 0&&(t.minExecutionPeriod=e.minExecutionPeriod?Duration$2.toJSON(e.minExecutionPeriod):void 0),t},fromPartial(e){const t=createBaseDecisionPolicyWindows();return t.votingPeriod=e.votingPeriod!==void 0&&e.votingPeriod!==null?Duration$2.fromPartial(e.votingPeriod):void 0,t.minExecutionPeriod=e.minExecutionPeriod!==void 0&&e.minExecutionPeriod!==null?Duration$2.fromPartial(e.minExecutionPeriod):void 0,t}};function createBaseGroupInfo(){return{id:0,admin:"",metadata:"",version:0,totalWeight:"",createdAt:void 0}}const GroupInfo={encode(e,t=_m0.Writer.create()){return e.id!==0&&t.uint32(8).uint64(e.id),e.admin!==""&&t.uint32(18).string(e.admin),e.metadata!==""&&t.uint32(26).string(e.metadata),e.version!==0&&t.uint32(32).uint64(e.version),e.totalWeight!==""&&t.uint32(42).string(e.totalWeight),e.createdAt!==void 0&&Timestamp$4.encode(toTimestamp$5(e.createdAt),t.uint32(50).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseGroupInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.id=longToNumber$y(n.uint64());break;case 2:u.admin=n.string();break;case 3:u.metadata=n.string();break;case 4:u.version=longToNumber$y(n.uint64());break;case 5:u.totalWeight=n.string();break;case 6:u.createdAt=fromTimestamp$5(Timestamp$4.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{id:isSet$$(e.id)?Number(e.id):0,admin:isSet$$(e.admin)?String(e.admin):"",metadata:isSet$$(e.metadata)?String(e.metadata):"",version:isSet$$(e.version)?Number(e.version):0,totalWeight:isSet$$(e.totalWeight)?String(e.totalWeight):"",createdAt:isSet$$(e.createdAt)?fromJsonTimestamp$5(e.createdAt):void 0}},toJSON(e){const t={};return e.id!==void 0&&(t.id=Math.round(e.id)),e.admin!==void 0&&(t.admin=e.admin),e.metadata!==void 0&&(t.metadata=e.metadata),e.version!==void 0&&(t.version=Math.round(e.version)),e.totalWeight!==void 0&&(t.totalWeight=e.totalWeight),e.createdAt!==void 0&&(t.createdAt=e.createdAt.toISOString()),t},fromPartial(e){const t=createBaseGroupInfo();return t.id=e.id??0,t.admin=e.admin??"",t.metadata=e.metadata??"",t.version=e.version??0,t.totalWeight=e.totalWeight??"",t.createdAt=e.createdAt??void 0,t}};function createBaseGroupMember(){return{groupId:0,member:void 0}}const GroupMember={encode(e,t=_m0.Writer.create()){return e.groupId!==0&&t.uint32(8).uint64(e.groupId),e.member!==void 0&&Member.encode(e.member,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseGroupMember();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.groupId=longToNumber$y(n.uint64());break;case 2:u.member=Member.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{groupId:isSet$$(e.groupId)?Number(e.groupId):0,member:isSet$$(e.member)?Member.fromJSON(e.member):void 0}},toJSON(e){const t={};return e.groupId!==void 0&&(t.groupId=Math.round(e.groupId)),e.member!==void 0&&(t.member=e.member?Member.toJSON(e.member):void 0),t},fromPartial(e){const t=createBaseGroupMember();return t.groupId=e.groupId??0,t.member=e.member!==void 0&&e.member!==null?Member.fromPartial(e.member):void 0,t}};function createBaseGroupPolicyInfo(){return{address:"",groupId:0,admin:"",metadata:"",version:0,decisionPolicy:void 0,createdAt:void 0}}const GroupPolicyInfo={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.groupId!==0&&t.uint32(16).uint64(e.groupId),e.admin!==""&&t.uint32(26).string(e.admin),e.metadata!==""&&t.uint32(34).string(e.metadata),e.version!==0&&t.uint32(40).uint64(e.version),e.decisionPolicy!==void 0&&Any$6.encode(e.decisionPolicy,t.uint32(50).fork()).ldelim(),e.createdAt!==void 0&&Timestamp$4.encode(toTimestamp$5(e.createdAt),t.uint32(58).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseGroupPolicyInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.groupId=longToNumber$y(n.uint64());break;case 3:u.admin=n.string();break;case 4:u.metadata=n.string();break;case 5:u.version=longToNumber$y(n.uint64());break;case 6:u.decisionPolicy=Any$6.decode(n,n.uint32());break;case 7:u.createdAt=fromTimestamp$5(Timestamp$4.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$$(e.address)?String(e.address):"",groupId:isSet$$(e.groupId)?Number(e.groupId):0,admin:isSet$$(e.admin)?String(e.admin):"",metadata:isSet$$(e.metadata)?String(e.metadata):"",version:isSet$$(e.version)?Number(e.version):0,decisionPolicy:isSet$$(e.decisionPolicy)?Any$6.fromJSON(e.decisionPolicy):void 0,createdAt:isSet$$(e.createdAt)?fromJsonTimestamp$5(e.createdAt):void 0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.groupId!==void 0&&(t.groupId=Math.round(e.groupId)),e.admin!==void 0&&(t.admin=e.admin),e.metadata!==void 0&&(t.metadata=e.metadata),e.version!==void 0&&(t.version=Math.round(e.version)),e.decisionPolicy!==void 0&&(t.decisionPolicy=e.decisionPolicy?Any$6.toJSON(e.decisionPolicy):void 0),e.createdAt!==void 0&&(t.createdAt=e.createdAt.toISOString()),t},fromPartial(e){const t=createBaseGroupPolicyInfo();return t.address=e.address??"",t.groupId=e.groupId??0,t.admin=e.admin??"",t.metadata=e.metadata??"",t.version=e.version??0,t.decisionPolicy=e.decisionPolicy!==void 0&&e.decisionPolicy!==null?Any$6.fromPartial(e.decisionPolicy):void 0,t.createdAt=e.createdAt??void 0,t}};function createBaseProposal(){return{id:0,groupPolicyAddress:"",metadata:"",proposers:[],submitTime:void 0,groupVersion:0,groupPolicyVersion:0,status:0,finalTallyResult:void 0,votingPeriodEnd:void 0,executorResult:0,messages:[],title:"",summary:""}}const Proposal={encode(e,t=_m0.Writer.create()){e.id!==0&&t.uint32(8).uint64(e.id),e.groupPolicyAddress!==""&&t.uint32(18).string(e.groupPolicyAddress),e.metadata!==""&&t.uint32(26).string(e.metadata);for(const n of e.proposers)t.uint32(34).string(n);e.submitTime!==void 0&&Timestamp$4.encode(toTimestamp$5(e.submitTime),t.uint32(42).fork()).ldelim(),e.groupVersion!==0&&t.uint32(48).uint64(e.groupVersion),e.groupPolicyVersion!==0&&t.uint32(56).uint64(e.groupPolicyVersion),e.status!==0&&t.uint32(64).int32(e.status),e.finalTallyResult!==void 0&&TallyResult.encode(e.finalTallyResult,t.uint32(74).fork()).ldelim(),e.votingPeriodEnd!==void 0&&Timestamp$4.encode(toTimestamp$5(e.votingPeriodEnd),t.uint32(82).fork()).ldelim(),e.executorResult!==0&&t.uint32(88).int32(e.executorResult);for(const n of e.messages)Any$6.encode(n,t.uint32(98).fork()).ldelim();return e.title!==""&&t.uint32(106).string(e.title),e.summary!==""&&t.uint32(114).string(e.summary),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.id=longToNumber$y(n.uint64());break;case 2:u.groupPolicyAddress=n.string();break;case 3:u.metadata=n.string();break;case 4:u.proposers.push(n.string());break;case 5:u.submitTime=fromTimestamp$5(Timestamp$4.decode(n,n.uint32()));break;case 6:u.groupVersion=longToNumber$y(n.uint64());break;case 7:u.groupPolicyVersion=longToNumber$y(n.uint64());break;case 8:u.status=n.int32();break;case 9:u.finalTallyResult=TallyResult.decode(n,n.uint32());break;case 10:u.votingPeriodEnd=fromTimestamp$5(Timestamp$4.decode(n,n.uint32()));break;case 11:u.executorResult=n.int32();break;case 12:u.messages.push(Any$6.decode(n,n.uint32()));break;case 13:u.title=n.string();break;case 14:u.summary=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{id:isSet$$(e.id)?Number(e.id):0,groupPolicyAddress:isSet$$(e.groupPolicyAddress)?String(e.groupPolicyAddress):"",metadata:isSet$$(e.metadata)?String(e.metadata):"",proposers:Array.isArray(e==null?void 0:e.proposers)?e.proposers.map(t=>String(t)):[],submitTime:isSet$$(e.submitTime)?fromJsonTimestamp$5(e.submitTime):void 0,groupVersion:isSet$$(e.groupVersion)?Number(e.groupVersion):0,groupPolicyVersion:isSet$$(e.groupPolicyVersion)?Number(e.groupPolicyVersion):0,status:isSet$$(e.status)?proposalStatusFromJSON(e.status):0,finalTallyResult:isSet$$(e.finalTallyResult)?TallyResult.fromJSON(e.finalTallyResult):void 0,votingPeriodEnd:isSet$$(e.votingPeriodEnd)?fromJsonTimestamp$5(e.votingPeriodEnd):void 0,executorResult:isSet$$(e.executorResult)?proposalExecutorResultFromJSON(e.executorResult):0,messages:Array.isArray(e==null?void 0:e.messages)?e.messages.map(t=>Any$6.fromJSON(t)):[],title:isSet$$(e.title)?String(e.title):"",summary:isSet$$(e.summary)?String(e.summary):""}},toJSON(e){const t={};return e.id!==void 0&&(t.id=Math.round(e.id)),e.groupPolicyAddress!==void 0&&(t.groupPolicyAddress=e.groupPolicyAddress),e.metadata!==void 0&&(t.metadata=e.metadata),e.proposers?t.proposers=e.proposers.map(n=>n):t.proposers=[],e.submitTime!==void 0&&(t.submitTime=e.submitTime.toISOString()),e.groupVersion!==void 0&&(t.groupVersion=Math.round(e.groupVersion)),e.groupPolicyVersion!==void 0&&(t.groupPolicyVersion=Math.round(e.groupPolicyVersion)),e.status!==void 0&&(t.status=proposalStatusToJSON(e.status)),e.finalTallyResult!==void 0&&(t.finalTallyResult=e.finalTallyResult?TallyResult.toJSON(e.finalTallyResult):void 0),e.votingPeriodEnd!==void 0&&(t.votingPeriodEnd=e.votingPeriodEnd.toISOString()),e.executorResult!==void 0&&(t.executorResult=proposalExecutorResultToJSON(e.executorResult)),e.messages?t.messages=e.messages.map(n=>n?Any$6.toJSON(n):void 0):t.messages=[],e.title!==void 0&&(t.title=e.title),e.summary!==void 0&&(t.summary=e.summary),t},fromPartial(e){var n,p;const t=createBaseProposal();return t.id=e.id??0,t.groupPolicyAddress=e.groupPolicyAddress??"",t.metadata=e.metadata??"",t.proposers=((n=e.proposers)==null?void 0:n.map(u=>u))||[],t.submitTime=e.submitTime??void 0,t.groupVersion=e.groupVersion??0,t.groupPolicyVersion=e.groupPolicyVersion??0,t.status=e.status??0,t.finalTallyResult=e.finalTallyResult!==void 0&&e.finalTallyResult!==null?TallyResult.fromPartial(e.finalTallyResult):void 0,t.votingPeriodEnd=e.votingPeriodEnd??void 0,t.executorResult=e.executorResult??0,t.messages=((p=e.messages)==null?void 0:p.map(u=>Any$6.fromPartial(u)))||[],t.title=e.title??"",t.summary=e.summary??"",t}};function createBaseTallyResult(){return{yesCount:"",abstainCount:"",noCount:"",noWithVetoCount:""}}const TallyResult={encode(e,t=_m0.Writer.create()){return e.yesCount!==""&&t.uint32(10).string(e.yesCount),e.abstainCount!==""&&t.uint32(18).string(e.abstainCount),e.noCount!==""&&t.uint32(26).string(e.noCount),e.noWithVetoCount!==""&&t.uint32(34).string(e.noWithVetoCount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTallyResult();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.yesCount=n.string();break;case 2:u.abstainCount=n.string();break;case 3:u.noCount=n.string();break;case 4:u.noWithVetoCount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{yesCount:isSet$$(e.yesCount)?String(e.yesCount):"",abstainCount:isSet$$(e.abstainCount)?String(e.abstainCount):"",noCount:isSet$$(e.noCount)?String(e.noCount):"",noWithVetoCount:isSet$$(e.noWithVetoCount)?String(e.noWithVetoCount):""}},toJSON(e){const t={};return e.yesCount!==void 0&&(t.yesCount=e.yesCount),e.abstainCount!==void 0&&(t.abstainCount=e.abstainCount),e.noCount!==void 0&&(t.noCount=e.noCount),e.noWithVetoCount!==void 0&&(t.noWithVetoCount=e.noWithVetoCount),t},fromPartial(e){const t=createBaseTallyResult();return t.yesCount=e.yesCount??"",t.abstainCount=e.abstainCount??"",t.noCount=e.noCount??"",t.noWithVetoCount=e.noWithVetoCount??"",t}};function createBaseVote(){return{proposalId:0,voter:"",option:0,metadata:"",submitTime:void 0}}const Vote={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.voter!==""&&t.uint32(18).string(e.voter),e.option!==0&&t.uint32(24).int32(e.option),e.metadata!==""&&t.uint32(34).string(e.metadata),e.submitTime!==void 0&&Timestamp$4.encode(toTimestamp$5(e.submitTime),t.uint32(42).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseVote();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$y(n.uint64());break;case 2:u.voter=n.string();break;case 3:u.option=n.int32();break;case 4:u.metadata=n.string();break;case 5:u.submitTime=fromTimestamp$5(Timestamp$4.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$$(e.proposalId)?Number(e.proposalId):0,voter:isSet$$(e.voter)?String(e.voter):"",option:isSet$$(e.option)?voteOptionFromJSON(e.option):0,metadata:isSet$$(e.metadata)?String(e.metadata):"",submitTime:isSet$$(e.submitTime)?fromJsonTimestamp$5(e.submitTime):void 0}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.voter!==void 0&&(t.voter=e.voter),e.option!==void 0&&(t.option=voteOptionToJSON(e.option)),e.metadata!==void 0&&(t.metadata=e.metadata),e.submitTime!==void 0&&(t.submitTime=e.submitTime.toISOString()),t},fromPartial(e){const t=createBaseVote();return t.proposalId=e.proposalId??0,t.voter=e.voter??"",t.option=e.option??0,t.metadata=e.metadata??"",t.submitTime=e.submitTime??void 0,t}};var globalThis$U=(()=>{if(typeof globalThis$U<"u")return globalThis$U;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function toTimestamp$5(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$5(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$5(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$5(Timestamp$4.fromJSON(e))}function longToNumber$y(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$U.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$$(e){return e!=null}function execFromJSON(e){switch(e){case 0:case"EXEC_UNSPECIFIED":return 0;case 1:case"EXEC_TRY":return 1;case-1:case"UNRECOGNIZED":default:return-1}}function execToJSON(e){switch(e){case 0:return"EXEC_UNSPECIFIED";case 1:return"EXEC_TRY";case-1:default:return"UNRECOGNIZED"}}function createBaseMsgCreateGroup(){return{admin:"",members:[],metadata:""}}const MsgCreateGroup={encode(e,t=_m0.Writer.create()){e.admin!==""&&t.uint32(10).string(e.admin);for(const n of e.members)MemberRequest.encode(n,t.uint32(18).fork()).ldelim();return e.metadata!==""&&t.uint32(26).string(e.metadata),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgCreateGroup();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.admin=n.string();break;case 2:u.members.push(MemberRequest.decode(n,n.uint32()));break;case 3:u.metadata=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{admin:isSet$_(e.admin)?String(e.admin):"",members:Array.isArray(e==null?void 0:e.members)?e.members.map(t=>MemberRequest.fromJSON(t)):[],metadata:isSet$_(e.metadata)?String(e.metadata):""}},toJSON(e){const t={};return e.admin!==void 0&&(t.admin=e.admin),e.members?t.members=e.members.map(n=>n?MemberRequest.toJSON(n):void 0):t.members=[],e.metadata!==void 0&&(t.metadata=e.metadata),t},fromPartial(e){var n;const t=createBaseMsgCreateGroup();return t.admin=e.admin??"",t.members=((n=e.members)==null?void 0:n.map(p=>MemberRequest.fromPartial(p)))||[],t.metadata=e.metadata??"",t}};function createBaseMsgUpdateGroupMembers(){return{admin:"",groupId:0,memberUpdates:[]}}const MsgUpdateGroupMembers={encode(e,t=_m0.Writer.create()){e.admin!==""&&t.uint32(10).string(e.admin),e.groupId!==0&&t.uint32(16).uint64(e.groupId);for(const n of e.memberUpdates)MemberRequest.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateGroupMembers();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.admin=n.string();break;case 2:u.groupId=longToNumber$x(n.uint64());break;case 3:u.memberUpdates.push(MemberRequest.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{admin:isSet$_(e.admin)?String(e.admin):"",groupId:isSet$_(e.groupId)?Number(e.groupId):0,memberUpdates:Array.isArray(e==null?void 0:e.memberUpdates)?e.memberUpdates.map(t=>MemberRequest.fromJSON(t)):[]}},toJSON(e){const t={};return e.admin!==void 0&&(t.admin=e.admin),e.groupId!==void 0&&(t.groupId=Math.round(e.groupId)),e.memberUpdates?t.memberUpdates=e.memberUpdates.map(n=>n?MemberRequest.toJSON(n):void 0):t.memberUpdates=[],t},fromPartial(e){var n;const t=createBaseMsgUpdateGroupMembers();return t.admin=e.admin??"",t.groupId=e.groupId??0,t.memberUpdates=((n=e.memberUpdates)==null?void 0:n.map(p=>MemberRequest.fromPartial(p)))||[],t}};function createBaseMsgUpdateGroupAdmin(){return{admin:"",groupId:0,newAdmin:""}}const MsgUpdateGroupAdmin={encode(e,t=_m0.Writer.create()){return e.admin!==""&&t.uint32(10).string(e.admin),e.groupId!==0&&t.uint32(16).uint64(e.groupId),e.newAdmin!==""&&t.uint32(26).string(e.newAdmin),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateGroupAdmin();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.admin=n.string();break;case 2:u.groupId=longToNumber$x(n.uint64());break;case 3:u.newAdmin=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{admin:isSet$_(e.admin)?String(e.admin):"",groupId:isSet$_(e.groupId)?Number(e.groupId):0,newAdmin:isSet$_(e.newAdmin)?String(e.newAdmin):""}},toJSON(e){const t={};return e.admin!==void 0&&(t.admin=e.admin),e.groupId!==void 0&&(t.groupId=Math.round(e.groupId)),e.newAdmin!==void 0&&(t.newAdmin=e.newAdmin),t},fromPartial(e){const t=createBaseMsgUpdateGroupAdmin();return t.admin=e.admin??"",t.groupId=e.groupId??0,t.newAdmin=e.newAdmin??"",t}};function createBaseMsgUpdateGroupMetadata(){return{admin:"",groupId:0,metadata:""}}const MsgUpdateGroupMetadata={encode(e,t=_m0.Writer.create()){return e.admin!==""&&t.uint32(10).string(e.admin),e.groupId!==0&&t.uint32(16).uint64(e.groupId),e.metadata!==""&&t.uint32(26).string(e.metadata),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateGroupMetadata();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.admin=n.string();break;case 2:u.groupId=longToNumber$x(n.uint64());break;case 3:u.metadata=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{admin:isSet$_(e.admin)?String(e.admin):"",groupId:isSet$_(e.groupId)?Number(e.groupId):0,metadata:isSet$_(e.metadata)?String(e.metadata):""}},toJSON(e){const t={};return e.admin!==void 0&&(t.admin=e.admin),e.groupId!==void 0&&(t.groupId=Math.round(e.groupId)),e.metadata!==void 0&&(t.metadata=e.metadata),t},fromPartial(e){const t=createBaseMsgUpdateGroupMetadata();return t.admin=e.admin??"",t.groupId=e.groupId??0,t.metadata=e.metadata??"",t}};function createBaseMsgCreateGroupPolicy(){return{admin:"",groupId:0,metadata:"",decisionPolicy:void 0}}const MsgCreateGroupPolicy={encode(e,t=_m0.Writer.create()){return e.admin!==""&&t.uint32(10).string(e.admin),e.groupId!==0&&t.uint32(16).uint64(e.groupId),e.metadata!==""&&t.uint32(26).string(e.metadata),e.decisionPolicy!==void 0&&Any$6.encode(e.decisionPolicy,t.uint32(34).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgCreateGroupPolicy();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.admin=n.string();break;case 2:u.groupId=longToNumber$x(n.uint64());break;case 3:u.metadata=n.string();break;case 4:u.decisionPolicy=Any$6.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{admin:isSet$_(e.admin)?String(e.admin):"",groupId:isSet$_(e.groupId)?Number(e.groupId):0,metadata:isSet$_(e.metadata)?String(e.metadata):"",decisionPolicy:isSet$_(e.decisionPolicy)?Any$6.fromJSON(e.decisionPolicy):void 0}},toJSON(e){const t={};return e.admin!==void 0&&(t.admin=e.admin),e.groupId!==void 0&&(t.groupId=Math.round(e.groupId)),e.metadata!==void 0&&(t.metadata=e.metadata),e.decisionPolicy!==void 0&&(t.decisionPolicy=e.decisionPolicy?Any$6.toJSON(e.decisionPolicy):void 0),t},fromPartial(e){const t=createBaseMsgCreateGroupPolicy();return t.admin=e.admin??"",t.groupId=e.groupId??0,t.metadata=e.metadata??"",t.decisionPolicy=e.decisionPolicy!==void 0&&e.decisionPolicy!==null?Any$6.fromPartial(e.decisionPolicy):void 0,t}};function createBaseMsgUpdateGroupPolicyAdmin(){return{admin:"",groupPolicyAddress:"",newAdmin:""}}const MsgUpdateGroupPolicyAdmin={encode(e,t=_m0.Writer.create()){return e.admin!==""&&t.uint32(10).string(e.admin),e.groupPolicyAddress!==""&&t.uint32(18).string(e.groupPolicyAddress),e.newAdmin!==""&&t.uint32(26).string(e.newAdmin),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateGroupPolicyAdmin();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.admin=n.string();break;case 2:u.groupPolicyAddress=n.string();break;case 3:u.newAdmin=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{admin:isSet$_(e.admin)?String(e.admin):"",groupPolicyAddress:isSet$_(e.groupPolicyAddress)?String(e.groupPolicyAddress):"",newAdmin:isSet$_(e.newAdmin)?String(e.newAdmin):""}},toJSON(e){const t={};return e.admin!==void 0&&(t.admin=e.admin),e.groupPolicyAddress!==void 0&&(t.groupPolicyAddress=e.groupPolicyAddress),e.newAdmin!==void 0&&(t.newAdmin=e.newAdmin),t},fromPartial(e){const t=createBaseMsgUpdateGroupPolicyAdmin();return t.admin=e.admin??"",t.groupPolicyAddress=e.groupPolicyAddress??"",t.newAdmin=e.newAdmin??"",t}};function createBaseMsgCreateGroupWithPolicy(){return{admin:"",members:[],groupMetadata:"",groupPolicyMetadata:"",groupPolicyAsAdmin:!1,decisionPolicy:void 0}}const MsgCreateGroupWithPolicy={encode(e,t=_m0.Writer.create()){e.admin!==""&&t.uint32(10).string(e.admin);for(const n of e.members)MemberRequest.encode(n,t.uint32(18).fork()).ldelim();return e.groupMetadata!==""&&t.uint32(26).string(e.groupMetadata),e.groupPolicyMetadata!==""&&t.uint32(34).string(e.groupPolicyMetadata),e.groupPolicyAsAdmin===!0&&t.uint32(40).bool(e.groupPolicyAsAdmin),e.decisionPolicy!==void 0&&Any$6.encode(e.decisionPolicy,t.uint32(50).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgCreateGroupWithPolicy();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.admin=n.string();break;case 2:u.members.push(MemberRequest.decode(n,n.uint32()));break;case 3:u.groupMetadata=n.string();break;case 4:u.groupPolicyMetadata=n.string();break;case 5:u.groupPolicyAsAdmin=n.bool();break;case 6:u.decisionPolicy=Any$6.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{admin:isSet$_(e.admin)?String(e.admin):"",members:Array.isArray(e==null?void 0:e.members)?e.members.map(t=>MemberRequest.fromJSON(t)):[],groupMetadata:isSet$_(e.groupMetadata)?String(e.groupMetadata):"",groupPolicyMetadata:isSet$_(e.groupPolicyMetadata)?String(e.groupPolicyMetadata):"",groupPolicyAsAdmin:isSet$_(e.groupPolicyAsAdmin)?!!e.groupPolicyAsAdmin:!1,decisionPolicy:isSet$_(e.decisionPolicy)?Any$6.fromJSON(e.decisionPolicy):void 0}},toJSON(e){const t={};return e.admin!==void 0&&(t.admin=e.admin),e.members?t.members=e.members.map(n=>n?MemberRequest.toJSON(n):void 0):t.members=[],e.groupMetadata!==void 0&&(t.groupMetadata=e.groupMetadata),e.groupPolicyMetadata!==void 0&&(t.groupPolicyMetadata=e.groupPolicyMetadata),e.groupPolicyAsAdmin!==void 0&&(t.groupPolicyAsAdmin=e.groupPolicyAsAdmin),e.decisionPolicy!==void 0&&(t.decisionPolicy=e.decisionPolicy?Any$6.toJSON(e.decisionPolicy):void 0),t},fromPartial(e){var n;const t=createBaseMsgCreateGroupWithPolicy();return t.admin=e.admin??"",t.members=((n=e.members)==null?void 0:n.map(p=>MemberRequest.fromPartial(p)))||[],t.groupMetadata=e.groupMetadata??"",t.groupPolicyMetadata=e.groupPolicyMetadata??"",t.groupPolicyAsAdmin=e.groupPolicyAsAdmin??!1,t.decisionPolicy=e.decisionPolicy!==void 0&&e.decisionPolicy!==null?Any$6.fromPartial(e.decisionPolicy):void 0,t}};function createBaseMsgUpdateGroupPolicyDecisionPolicy(){return{admin:"",groupPolicyAddress:"",decisionPolicy:void 0}}const MsgUpdateGroupPolicyDecisionPolicy={encode(e,t=_m0.Writer.create()){return e.admin!==""&&t.uint32(10).string(e.admin),e.groupPolicyAddress!==""&&t.uint32(18).string(e.groupPolicyAddress),e.decisionPolicy!==void 0&&Any$6.encode(e.decisionPolicy,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateGroupPolicyDecisionPolicy();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.admin=n.string();break;case 2:u.groupPolicyAddress=n.string();break;case 3:u.decisionPolicy=Any$6.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{admin:isSet$_(e.admin)?String(e.admin):"",groupPolicyAddress:isSet$_(e.groupPolicyAddress)?String(e.groupPolicyAddress):"",decisionPolicy:isSet$_(e.decisionPolicy)?Any$6.fromJSON(e.decisionPolicy):void 0}},toJSON(e){const t={};return e.admin!==void 0&&(t.admin=e.admin),e.groupPolicyAddress!==void 0&&(t.groupPolicyAddress=e.groupPolicyAddress),e.decisionPolicy!==void 0&&(t.decisionPolicy=e.decisionPolicy?Any$6.toJSON(e.decisionPolicy):void 0),t},fromPartial(e){const t=createBaseMsgUpdateGroupPolicyDecisionPolicy();return t.admin=e.admin??"",t.groupPolicyAddress=e.groupPolicyAddress??"",t.decisionPolicy=e.decisionPolicy!==void 0&&e.decisionPolicy!==null?Any$6.fromPartial(e.decisionPolicy):void 0,t}};function createBaseMsgUpdateGroupPolicyMetadata(){return{admin:"",groupPolicyAddress:"",metadata:""}}const MsgUpdateGroupPolicyMetadata={encode(e,t=_m0.Writer.create()){return e.admin!==""&&t.uint32(10).string(e.admin),e.groupPolicyAddress!==""&&t.uint32(18).string(e.groupPolicyAddress),e.metadata!==""&&t.uint32(26).string(e.metadata),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateGroupPolicyMetadata();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.admin=n.string();break;case 2:u.groupPolicyAddress=n.string();break;case 3:u.metadata=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{admin:isSet$_(e.admin)?String(e.admin):"",groupPolicyAddress:isSet$_(e.groupPolicyAddress)?String(e.groupPolicyAddress):"",metadata:isSet$_(e.metadata)?String(e.metadata):""}},toJSON(e){const t={};return e.admin!==void 0&&(t.admin=e.admin),e.groupPolicyAddress!==void 0&&(t.groupPolicyAddress=e.groupPolicyAddress),e.metadata!==void 0&&(t.metadata=e.metadata),t},fromPartial(e){const t=createBaseMsgUpdateGroupPolicyMetadata();return t.admin=e.admin??"",t.groupPolicyAddress=e.groupPolicyAddress??"",t.metadata=e.metadata??"",t}};function createBaseMsgSubmitProposal(){return{groupPolicyAddress:"",proposers:[],metadata:"",messages:[],exec:0,title:"",summary:""}}const MsgSubmitProposal={encode(e,t=_m0.Writer.create()){e.groupPolicyAddress!==""&&t.uint32(10).string(e.groupPolicyAddress);for(const n of e.proposers)t.uint32(18).string(n);e.metadata!==""&&t.uint32(26).string(e.metadata);for(const n of e.messages)Any$6.encode(n,t.uint32(34).fork()).ldelim();return e.exec!==0&&t.uint32(40).int32(e.exec),e.title!==""&&t.uint32(50).string(e.title),e.summary!==""&&t.uint32(58).string(e.summary),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgSubmitProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.groupPolicyAddress=n.string();break;case 2:u.proposers.push(n.string());break;case 3:u.metadata=n.string();break;case 4:u.messages.push(Any$6.decode(n,n.uint32()));break;case 5:u.exec=n.int32();break;case 6:u.title=n.string();break;case 7:u.summary=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{groupPolicyAddress:isSet$_(e.groupPolicyAddress)?String(e.groupPolicyAddress):"",proposers:Array.isArray(e==null?void 0:e.proposers)?e.proposers.map(t=>String(t)):[],metadata:isSet$_(e.metadata)?String(e.metadata):"",messages:Array.isArray(e==null?void 0:e.messages)?e.messages.map(t=>Any$6.fromJSON(t)):[],exec:isSet$_(e.exec)?execFromJSON(e.exec):0,title:isSet$_(e.title)?String(e.title):"",summary:isSet$_(e.summary)?String(e.summary):""}},toJSON(e){const t={};return e.groupPolicyAddress!==void 0&&(t.groupPolicyAddress=e.groupPolicyAddress),e.proposers?t.proposers=e.proposers.map(n=>n):t.proposers=[],e.metadata!==void 0&&(t.metadata=e.metadata),e.messages?t.messages=e.messages.map(n=>n?Any$6.toJSON(n):void 0):t.messages=[],e.exec!==void 0&&(t.exec=execToJSON(e.exec)),e.title!==void 0&&(t.title=e.title),e.summary!==void 0&&(t.summary=e.summary),t},fromPartial(e){var n,p;const t=createBaseMsgSubmitProposal();return t.groupPolicyAddress=e.groupPolicyAddress??"",t.proposers=((n=e.proposers)==null?void 0:n.map(u=>u))||[],t.metadata=e.metadata??"",t.messages=((p=e.messages)==null?void 0:p.map(u=>Any$6.fromPartial(u)))||[],t.exec=e.exec??0,t.title=e.title??"",t.summary=e.summary??"",t}};function createBaseMsgWithdrawProposal(){return{proposalId:0,address:""}}const MsgWithdrawProposal={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.address!==""&&t.uint32(18).string(e.address),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgWithdrawProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$x(n.uint64());break;case 2:u.address=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$_(e.proposalId)?Number(e.proposalId):0,address:isSet$_(e.address)?String(e.address):""}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.address!==void 0&&(t.address=e.address),t},fromPartial(e){const t=createBaseMsgWithdrawProposal();return t.proposalId=e.proposalId??0,t.address=e.address??"",t}};function createBaseMsgVote(){return{proposalId:0,voter:"",option:0,metadata:"",exec:0}}const MsgVote={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.voter!==""&&t.uint32(18).string(e.voter),e.option!==0&&t.uint32(24).int32(e.option),e.metadata!==""&&t.uint32(34).string(e.metadata),e.exec!==0&&t.uint32(40).int32(e.exec),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgVote();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$x(n.uint64());break;case 2:u.voter=n.string();break;case 3:u.option=n.int32();break;case 4:u.metadata=n.string();break;case 5:u.exec=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$_(e.proposalId)?Number(e.proposalId):0,voter:isSet$_(e.voter)?String(e.voter):"",option:isSet$_(e.option)?voteOptionFromJSON(e.option):0,metadata:isSet$_(e.metadata)?String(e.metadata):"",exec:isSet$_(e.exec)?execFromJSON(e.exec):0}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.voter!==void 0&&(t.voter=e.voter),e.option!==void 0&&(t.option=voteOptionToJSON(e.option)),e.metadata!==void 0&&(t.metadata=e.metadata),e.exec!==void 0&&(t.exec=execToJSON(e.exec)),t},fromPartial(e){const t=createBaseMsgVote();return t.proposalId=e.proposalId??0,t.voter=e.voter??"",t.option=e.option??0,t.metadata=e.metadata??"",t.exec=e.exec??0,t}};function createBaseMsgExec(){return{proposalId:0,executor:""}}const MsgExec={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.executor!==""&&t.uint32(18).string(e.executor),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgExec();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$x(n.uint64());break;case 2:u.executor=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$_(e.proposalId)?Number(e.proposalId):0,executor:isSet$_(e.executor)?String(e.executor):""}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.executor!==void 0&&(t.executor=e.executor),t},fromPartial(e){const t=createBaseMsgExec();return t.proposalId=e.proposalId??0,t.executor=e.executor??"",t}};function createBaseMsgLeaveGroup(){return{address:"",groupId:0}}const MsgLeaveGroup={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.groupId!==0&&t.uint32(16).uint64(e.groupId),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgLeaveGroup();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.groupId=longToNumber$x(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$_(e.address)?String(e.address):"",groupId:isSet$_(e.groupId)?Number(e.groupId):0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.groupId!==void 0&&(t.groupId=Math.round(e.groupId)),t},fromPartial(e){const t=createBaseMsgLeaveGroup();return t.address=e.address??"",t.groupId=e.groupId??0,t}};var globalThis$T=(()=>{if(typeof globalThis$T<"u")return globalThis$T;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$x(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$T.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$_(e){return e!=null}const msgTypes$g=[["/cosmos.group.v1.MsgUpdateGroupPolicyMetadata",MsgUpdateGroupPolicyMetadata],["/cosmos.group.v1.MsgWithdrawProposal",MsgWithdrawProposal],["/cosmos.group.v1.MsgSubmitProposal",MsgSubmitProposal],["/cosmos.group.v1.MsgLeaveGroup",MsgLeaveGroup],["/cosmos.group.v1.MsgUpdateGroupAdmin",MsgUpdateGroupAdmin],["/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy",MsgUpdateGroupPolicyDecisionPolicy],["/cosmos.group.v1.MsgCreateGroupWithPolicy",MsgCreateGroupWithPolicy],["/cosmos.group.v1.MsgCreateGroupPolicy",MsgCreateGroupPolicy],["/cosmos.group.v1.MsgVote",MsgVote],["/cosmos.group.v1.MsgUpdateGroupMembers",MsgUpdateGroupMembers],["/cosmos.group.v1.MsgExec",MsgExec],["/cosmos.group.v1.MsgCreateGroup",MsgCreateGroup],["/cosmos.group.v1.MsgUpdateGroupMetadata",MsgUpdateGroupMetadata],["/cosmos.group.v1.MsgUpdateGroupPolicyAdmin",MsgUpdateGroupPolicyAdmin]];let HttpClient$g=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$g=class extends HttpClient$g{constructor(){super(...arguments),this.queryGroupInfo=(t,n={})=>this.request({path:`/cosmos/group/v1/group_info/${t}`,method:"GET",format:"json",...n}),this.queryGroupMembers=(t,n,p={})=>this.request({path:`/cosmos/group/v1/group_members/${t}`,method:"GET",query:n,format:"json",...p}),this.queryGroupPoliciesByAdmin=(t,n,p={})=>this.request({path:`/cosmos/group/v1/group_policies_by_admin/${t}`,method:"GET",query:n,format:"json",...p}),this.queryGroupPoliciesByGroup=(t,n,p={})=>this.request({path:`/cosmos/group/v1/group_policies_by_group/${t}`,method:"GET",query:n,format:"json",...p}),this.queryGroupPolicyInfo=(t,n={})=>this.request({path:`/cosmos/group/v1/group_policy_info/${t}`,method:"GET",format:"json",...n}),this.queryGroups=(t,n={})=>this.request({path:"/cosmos/group/v1/groups",method:"GET",query:t,format:"json",...n}),this.queryGroupsByAdmin=(t,n,p={})=>this.request({path:`/cosmos/group/v1/groups_by_admin/${t}`,method:"GET",query:n,format:"json",...p}),this.queryGroupsByMember=(t,n,p={})=>this.request({path:`/cosmos/group/v1/groups_by_member/${t}`,method:"GET",query:n,format:"json",...p}),this.queryProposal=(t,n={})=>this.request({path:`/cosmos/group/v1/proposal/${t}`,method:"GET",format:"json",...n}),this.queryTallyResult=(t,n={})=>this.request({path:`/cosmos/group/v1/proposals/${t}/tally`,method:"GET",format:"json",...n}),this.queryProposalsByGroupPolicy=(t,n,p={})=>this.request({path:`/cosmos/group/v1/proposals_by_group_policy/${t}`,method:"GET",query:n,format:"json",...p}),this.queryVoteByProposalVoter=(t,n,p={})=>this.request({path:`/cosmos/group/v1/vote_by_proposal_voter/${t}/${n}`,method:"GET",format:"json",...p}),this.queryVotesByProposal=(t,n,p={})=>this.request({path:`/cosmos/group/v1/votes_by_proposal/${t}`,method:"GET",query:n,format:"json",...p}),this.queryVotesByVoter=(t,n,p={})=>this.request({path:`/cosmos/group/v1/votes_by_voter/${t}`,method:"GET",query:n,format:"json",...p})}};function createBaseEventCreateGroup(){return{groupId:0}}const EventCreateGroup={encode(e,t=_m0.Writer.create()){return e.groupId!==0&&t.uint32(8).uint64(e.groupId),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventCreateGroup();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.groupId=longToNumber$w(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{groupId:isSet$Z(e.groupId)?Number(e.groupId):0}},toJSON(e){const t={};return e.groupId!==void 0&&(t.groupId=Math.round(e.groupId)),t},fromPartial(e){const t=createBaseEventCreateGroup();return t.groupId=e.groupId??0,t}};function createBaseEventUpdateGroup(){return{groupId:0}}const EventUpdateGroup={encode(e,t=_m0.Writer.create()){return e.groupId!==0&&t.uint32(8).uint64(e.groupId),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventUpdateGroup();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.groupId=longToNumber$w(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{groupId:isSet$Z(e.groupId)?Number(e.groupId):0}},toJSON(e){const t={};return e.groupId!==void 0&&(t.groupId=Math.round(e.groupId)),t},fromPartial(e){const t=createBaseEventUpdateGroup();return t.groupId=e.groupId??0,t}};function createBaseEventCreateGroupPolicy(){return{address:""}}const EventCreateGroupPolicy={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventCreateGroupPolicy();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$Z(e.address)?String(e.address):""}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),t},fromPartial(e){const t=createBaseEventCreateGroupPolicy();return t.address=e.address??"",t}};function createBaseEventUpdateGroupPolicy(){return{address:""}}const EventUpdateGroupPolicy={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventUpdateGroupPolicy();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$Z(e.address)?String(e.address):""}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),t},fromPartial(e){const t=createBaseEventUpdateGroupPolicy();return t.address=e.address??"",t}};function createBaseEventSubmitProposal(){return{proposalId:0}}const EventSubmitProposal={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventSubmitProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$w(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$Z(e.proposalId)?Number(e.proposalId):0}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),t},fromPartial(e){const t=createBaseEventSubmitProposal();return t.proposalId=e.proposalId??0,t}};function createBaseEventWithdrawProposal(){return{proposalId:0}}const EventWithdrawProposal={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventWithdrawProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$w(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$Z(e.proposalId)?Number(e.proposalId):0}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),t},fromPartial(e){const t=createBaseEventWithdrawProposal();return t.proposalId=e.proposalId??0,t}};function createBaseEventVote(){return{proposalId:0}}const EventVote={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventVote();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$w(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$Z(e.proposalId)?Number(e.proposalId):0}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),t},fromPartial(e){const t=createBaseEventVote();return t.proposalId=e.proposalId??0,t}};function createBaseEventExec(){return{proposalId:0,result:0,logs:""}}const EventExec={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.result!==0&&t.uint32(16).int32(e.result),e.logs!==""&&t.uint32(26).string(e.logs),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventExec();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$w(n.uint64());break;case 2:u.result=n.int32();break;case 3:u.logs=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$Z(e.proposalId)?Number(e.proposalId):0,result:isSet$Z(e.result)?proposalExecutorResultFromJSON(e.result):0,logs:isSet$Z(e.logs)?String(e.logs):""}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.result!==void 0&&(t.result=proposalExecutorResultToJSON(e.result)),e.logs!==void 0&&(t.logs=e.logs),t},fromPartial(e){const t=createBaseEventExec();return t.proposalId=e.proposalId??0,t.result=e.result??0,t.logs=e.logs??"",t}};function createBaseEventLeaveGroup(){return{groupId:0,address:""}}const EventLeaveGroup={encode(e,t=_m0.Writer.create()){return e.groupId!==0&&t.uint32(8).uint64(e.groupId),e.address!==""&&t.uint32(18).string(e.address),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventLeaveGroup();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.groupId=longToNumber$w(n.uint64());break;case 2:u.address=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{groupId:isSet$Z(e.groupId)?Number(e.groupId):0,address:isSet$Z(e.address)?String(e.address):""}},toJSON(e){const t={};return e.groupId!==void 0&&(t.groupId=Math.round(e.groupId)),e.address!==void 0&&(t.address=e.address),t},fromPartial(e){const t=createBaseEventLeaveGroup();return t.groupId=e.groupId??0,t.address=e.address??"",t}};function createBaseEventProposalPruned(){return{proposalId:0,status:0,tallyResult:void 0}}const EventProposalPruned={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.status!==0&&t.uint32(16).int32(e.status),e.tallyResult!==void 0&&TallyResult.encode(e.tallyResult,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventProposalPruned();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$w(n.uint64());break;case 2:u.status=n.int32();break;case 3:u.tallyResult=TallyResult.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$Z(e.proposalId)?Number(e.proposalId):0,status:isSet$Z(e.status)?proposalStatusFromJSON(e.status):0,tallyResult:isSet$Z(e.tallyResult)?TallyResult.fromJSON(e.tallyResult):void 0}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.status!==void 0&&(t.status=proposalStatusToJSON(e.status)),e.tallyResult!==void 0&&(t.tallyResult=e.tallyResult?TallyResult.toJSON(e.tallyResult):void 0),t},fromPartial(e){const t=createBaseEventProposalPruned();return t.proposalId=e.proposalId??0,t.status=e.status??0,t.tallyResult=e.tallyResult!==void 0&&e.tallyResult!==null?TallyResult.fromPartial(e.tallyResult):void 0,t}};var globalThis$S=(()=>{if(typeof globalThis$S<"u")return globalThis$S;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$w(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$S.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$Z(e){return e!=null}const registry$7=new build$b.Registry(msgTypes$g);function getStructure$g(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$6={amount:[],gas:"200000"},txClient$g=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgUpdateGroupPolicyMetadata({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateGroupPolicyMetadata: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgUpdateGroupPolicyMetadata({value:MsgUpdateGroupPolicyMetadata.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgUpdateGroupPolicyMetadata: Could not broadcast Tx: "+y.message)}},async sendMsgWithdrawProposal({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgWithdrawProposal: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgWithdrawProposal({value:MsgWithdrawProposal.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgWithdrawProposal: Could not broadcast Tx: "+y.message)}},async sendMsgSubmitProposal({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgSubmitProposal: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgSubmitProposal({value:MsgSubmitProposal.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgSubmitProposal: Could not broadcast Tx: "+y.message)}},async sendMsgLeaveGroup({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgLeaveGroup: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgLeaveGroup({value:MsgLeaveGroup.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgLeaveGroup: Could not broadcast Tx: "+y.message)}},async sendMsgUpdateGroupAdmin({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateGroupAdmin: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgUpdateGroupAdmin({value:MsgUpdateGroupAdmin.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgUpdateGroupAdmin: Could not broadcast Tx: "+y.message)}},async sendMsgUpdateGroupPolicyDecisionPolicy({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateGroupPolicyDecisionPolicy: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgUpdateGroupPolicyDecisionPolicy({value:MsgUpdateGroupPolicyDecisionPolicy.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgUpdateGroupPolicyDecisionPolicy: Could not broadcast Tx: "+y.message)}},async sendMsgCreateGroupWithPolicy({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgCreateGroupWithPolicy: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgCreateGroupWithPolicy({value:MsgCreateGroupWithPolicy.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgCreateGroupWithPolicy: Could not broadcast Tx: "+y.message)}},async sendMsgCreateGroupPolicy({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgCreateGroupPolicy: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgCreateGroupPolicy({value:MsgCreateGroupPolicy.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgCreateGroupPolicy: Could not broadcast Tx: "+y.message)}},async sendMsgVote({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgVote: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgVote({value:MsgVote.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgVote: Could not broadcast Tx: "+y.message)}},async sendMsgUpdateGroupMembers({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateGroupMembers: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgUpdateGroupMembers({value:MsgUpdateGroupMembers.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgUpdateGroupMembers: Could not broadcast Tx: "+y.message)}},async sendMsgExec({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgExec: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgExec({value:MsgExec.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgExec: Could not broadcast Tx: "+y.message)}},async sendMsgCreateGroup({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgCreateGroup: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgCreateGroup({value:MsgCreateGroup.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgCreateGroup: Could not broadcast Tx: "+y.message)}},async sendMsgUpdateGroupMetadata({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateGroupMetadata: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgUpdateGroupMetadata({value:MsgUpdateGroupMetadata.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgUpdateGroupMetadata: Could not broadcast Tx: "+y.message)}},async sendMsgUpdateGroupPolicyAdmin({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateGroupPolicyAdmin: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgUpdateGroupPolicyAdmin({value:MsgUpdateGroupPolicyAdmin.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgUpdateGroupPolicyAdmin: Could not broadcast Tx: "+y.message)}},msgUpdateGroupPolicyMetadata({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgUpdateGroupPolicyMetadata",value:MsgUpdateGroupPolicyMetadata.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateGroupPolicyMetadata: Could not create message: "+u.message)}},msgWithdrawProposal({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgWithdrawProposal",value:MsgWithdrawProposal.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgWithdrawProposal: Could not create message: "+u.message)}},msgSubmitProposal({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgSubmitProposal",value:MsgSubmitProposal.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgSubmitProposal: Could not create message: "+u.message)}},msgLeaveGroup({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgLeaveGroup",value:MsgLeaveGroup.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgLeaveGroup: Could not create message: "+u.message)}},msgUpdateGroupAdmin({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgUpdateGroupAdmin",value:MsgUpdateGroupAdmin.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateGroupAdmin: Could not create message: "+u.message)}},msgUpdateGroupPolicyDecisionPolicy({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy",value:MsgUpdateGroupPolicyDecisionPolicy.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateGroupPolicyDecisionPolicy: Could not create message: "+u.message)}},msgCreateGroupWithPolicy({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgCreateGroupWithPolicy",value:MsgCreateGroupWithPolicy.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgCreateGroupWithPolicy: Could not create message: "+u.message)}},msgCreateGroupPolicy({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgCreateGroupPolicy",value:MsgCreateGroupPolicy.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgCreateGroupPolicy: Could not create message: "+u.message)}},msgVote({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgVote",value:MsgVote.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgVote: Could not create message: "+u.message)}},msgUpdateGroupMembers({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgUpdateGroupMembers",value:MsgUpdateGroupMembers.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateGroupMembers: Could not create message: "+u.message)}},msgExec({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgExec",value:MsgExec.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgExec: Could not create message: "+u.message)}},msgCreateGroup({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgCreateGroup",value:MsgCreateGroup.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgCreateGroup: Could not create message: "+u.message)}},msgUpdateGroupMetadata({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgUpdateGroupMetadata",value:MsgUpdateGroupMetadata.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateGroupMetadata: Could not create message: "+u.message)}},msgUpdateGroupPolicyAdmin({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgUpdateGroupPolicyAdmin",value:MsgUpdateGroupPolicyAdmin.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateGroupPolicyAdmin: Could not create message: "+u.message)}}}),queryClient$g=({addr:e}={addr:"http://localhost:1317"})=>new Api$g({baseURL:e});let SDKModule$g=class{constructor(t){this.registry=[],this.query=queryClient$g({addr:t.env.apiURL}),this.updateTX(t),this.structure={EventCreateGroup:getStructure$g(EventCreateGroup.fromPartial({})),EventUpdateGroup:getStructure$g(EventUpdateGroup.fromPartial({})),EventCreateGroupPolicy:getStructure$g(EventCreateGroupPolicy.fromPartial({})),EventUpdateGroupPolicy:getStructure$g(EventUpdateGroupPolicy.fromPartial({})),EventSubmitProposal:getStructure$g(EventSubmitProposal.fromPartial({})),EventWithdrawProposal:getStructure$g(EventWithdrawProposal.fromPartial({})),EventVote:getStructure$g(EventVote.fromPartial({})),EventExec:getStructure$g(EventExec.fromPartial({})),EventLeaveGroup:getStructure$g(EventLeaveGroup.fromPartial({})),EventProposalPruned:getStructure$g(EventProposalPruned.fromPartial({})),Member:getStructure$g(Member.fromPartial({})),MemberRequest:getStructure$g(MemberRequest.fromPartial({})),ThresholdDecisionPolicy:getStructure$g(ThresholdDecisionPolicy.fromPartial({})),PercentageDecisionPolicy:getStructure$g(PercentageDecisionPolicy.fromPartial({})),DecisionPolicyWindows:getStructure$g(DecisionPolicyWindows.fromPartial({})),GroupInfo:getStructure$g(GroupInfo.fromPartial({})),GroupMember:getStructure$g(GroupMember.fromPartial({})),GroupPolicyInfo:getStructure$g(GroupPolicyInfo.fromPartial({})),Proposal:getStructure$g(Proposal.fromPartial({})),TallyResult:getStructure$g(TallyResult.fromPartial({})),Vote:getStructure$g(Vote.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$g({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$g=e=>({module:{CosmosGroupV1:new SDKModule$g(e)},registry:msgTypes$g}),msgTypes$f=[];let HttpClient$f=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$f=class extends HttpClient$f{constructor(){super(...arguments),this.queryAnnualProvisions=(t={})=>this.request({path:"/cosmos/mint/v1beta1/annual_provisions",method:"GET",format:"json",...t}),this.queryInflation=(t={})=>this.request({path:"/cosmos/mint/v1beta1/inflation",method:"GET",format:"json",...t}),this.queryParams=(t={})=>this.request({path:"/cosmos/mint/v1beta1/params",method:"GET",format:"json",...t})}};function createBaseMinter(){return{inflation:"",annualProvisions:""}}const Minter={encode(e,t=_m0.Writer.create()){return e.inflation!==""&&t.uint32(10).string(e.inflation),e.annualProvisions!==""&&t.uint32(18).string(e.annualProvisions),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMinter();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.inflation=n.string();break;case 2:u.annualProvisions=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{inflation:isSet$Y(e.inflation)?String(e.inflation):"",annualProvisions:isSet$Y(e.annualProvisions)?String(e.annualProvisions):""}},toJSON(e){const t={};return e.inflation!==void 0&&(t.inflation=e.inflation),e.annualProvisions!==void 0&&(t.annualProvisions=e.annualProvisions),t},fromPartial(e){const t=createBaseMinter();return t.inflation=e.inflation??"",t.annualProvisions=e.annualProvisions??"",t}};function createBaseParams$9(){return{mintDenom:"",inflationRateChange:"",inflationMax:"",inflationMin:"",goalBonded:"",blocksPerYear:0}}const Params$9={encode(e,t=_m0.Writer.create()){return e.mintDenom!==""&&t.uint32(10).string(e.mintDenom),e.inflationRateChange!==""&&t.uint32(18).string(e.inflationRateChange),e.inflationMax!==""&&t.uint32(26).string(e.inflationMax),e.inflationMin!==""&&t.uint32(34).string(e.inflationMin),e.goalBonded!==""&&t.uint32(42).string(e.goalBonded),e.blocksPerYear!==0&&t.uint32(48).uint64(e.blocksPerYear),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$9();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.mintDenom=n.string();break;case 2:u.inflationRateChange=n.string();break;case 3:u.inflationMax=n.string();break;case 4:u.inflationMin=n.string();break;case 5:u.goalBonded=n.string();break;case 6:u.blocksPerYear=longToNumber$v(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{mintDenom:isSet$Y(e.mintDenom)?String(e.mintDenom):"",inflationRateChange:isSet$Y(e.inflationRateChange)?String(e.inflationRateChange):"",inflationMax:isSet$Y(e.inflationMax)?String(e.inflationMax):"",inflationMin:isSet$Y(e.inflationMin)?String(e.inflationMin):"",goalBonded:isSet$Y(e.goalBonded)?String(e.goalBonded):"",blocksPerYear:isSet$Y(e.blocksPerYear)?Number(e.blocksPerYear):0}},toJSON(e){const t={};return e.mintDenom!==void 0&&(t.mintDenom=e.mintDenom),e.inflationRateChange!==void 0&&(t.inflationRateChange=e.inflationRateChange),e.inflationMax!==void 0&&(t.inflationMax=e.inflationMax),e.inflationMin!==void 0&&(t.inflationMin=e.inflationMin),e.goalBonded!==void 0&&(t.goalBonded=e.goalBonded),e.blocksPerYear!==void 0&&(t.blocksPerYear=Math.round(e.blocksPerYear)),t},fromPartial(e){const t=createBaseParams$9();return t.mintDenom=e.mintDenom??"",t.inflationRateChange=e.inflationRateChange??"",t.inflationMax=e.inflationMax??"",t.inflationMin=e.inflationMin??"",t.goalBonded=e.goalBonded??"",t.blocksPerYear=e.blocksPerYear??0,t}};var globalThis$R=(()=>{if(typeof globalThis$R<"u")return globalThis$R;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$v(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$R.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$Y(e){return e!=null}new build$b.Registry(msgTypes$f);function getStructure$f(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$f=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$f=({addr:e}={addr:"http://localhost:1317"})=>new Api$f({baseURL:e});let SDKModule$f=class{constructor(t){this.registry=[],this.query=queryClient$f({addr:t.env.apiURL}),this.updateTX(t),this.structure={Minter:getStructure$f(Minter.fromPartial({})),Params:getStructure$f(Params$9.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$f({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$f=e=>({module:{CosmosMintV1Beta1:new SDKModule$f(e)},registry:msgTypes$f}),msgTypes$e=[];let HttpClient$e=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$e=class extends HttpClient$e{constructor(){super(...arguments),this.queryBalance=(t,n,p={})=>this.request({path:`/cosmos/nft/v1beta1/balance/${t}/${n}`,method:"GET",format:"json",...p}),this.queryClasses=(t,n={})=>this.request({path:"/cosmos/nft/v1beta1/classes",method:"GET",query:t,format:"json",...n}),this.queryClass=(t,n={})=>this.request({path:`/cosmos/nft/v1beta1/classes/${t}`,method:"GET",format:"json",...n}),this.queryNFTs=(t,n={})=>this.request({path:"/cosmos/nft/v1beta1/nfts",method:"GET",query:t,format:"json",...n}),this.queryNFT=(t,n,p={})=>this.request({path:`/cosmos/nft/v1beta1/nfts/${t}/${n}`,method:"GET",format:"json",...p}),this.queryOwner=(t,n,p={})=>this.request({path:`/cosmos/nft/v1beta1/owner/${t}/${n}`,method:"GET",format:"json",...p}),this.querySupply=(t,n={})=>this.request({path:`/cosmos/nft/v1beta1/supply/${t}`,method:"GET",format:"json",...n})}};function createBaseEventSend(){return{classId:"",id:"",sender:"",receiver:""}}const EventSend={encode(e,t=_m0.Writer.create()){return e.classId!==""&&t.uint32(10).string(e.classId),e.id!==""&&t.uint32(18).string(e.id),e.sender!==""&&t.uint32(26).string(e.sender),e.receiver!==""&&t.uint32(34).string(e.receiver),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventSend();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.classId=n.string();break;case 2:u.id=n.string();break;case 3:u.sender=n.string();break;case 4:u.receiver=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{classId:isSet$X(e.classId)?String(e.classId):"",id:isSet$X(e.id)?String(e.id):"",sender:isSet$X(e.sender)?String(e.sender):"",receiver:isSet$X(e.receiver)?String(e.receiver):""}},toJSON(e){const t={};return e.classId!==void 0&&(t.classId=e.classId),e.id!==void 0&&(t.id=e.id),e.sender!==void 0&&(t.sender=e.sender),e.receiver!==void 0&&(t.receiver=e.receiver),t},fromPartial(e){const t=createBaseEventSend();return t.classId=e.classId??"",t.id=e.id??"",t.sender=e.sender??"",t.receiver=e.receiver??"",t}};function createBaseEventMint(){return{classId:"",id:"",owner:""}}const EventMint={encode(e,t=_m0.Writer.create()){return e.classId!==""&&t.uint32(10).string(e.classId),e.id!==""&&t.uint32(18).string(e.id),e.owner!==""&&t.uint32(26).string(e.owner),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventMint();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.classId=n.string();break;case 2:u.id=n.string();break;case 3:u.owner=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{classId:isSet$X(e.classId)?String(e.classId):"",id:isSet$X(e.id)?String(e.id):"",owner:isSet$X(e.owner)?String(e.owner):""}},toJSON(e){const t={};return e.classId!==void 0&&(t.classId=e.classId),e.id!==void 0&&(t.id=e.id),e.owner!==void 0&&(t.owner=e.owner),t},fromPartial(e){const t=createBaseEventMint();return t.classId=e.classId??"",t.id=e.id??"",t.owner=e.owner??"",t}};function createBaseEventBurn(){return{classId:"",id:"",owner:""}}const EventBurn={encode(e,t=_m0.Writer.create()){return e.classId!==""&&t.uint32(10).string(e.classId),e.id!==""&&t.uint32(18).string(e.id),e.owner!==""&&t.uint32(26).string(e.owner),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventBurn();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.classId=n.string();break;case 2:u.id=n.string();break;case 3:u.owner=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{classId:isSet$X(e.classId)?String(e.classId):"",id:isSet$X(e.id)?String(e.id):"",owner:isSet$X(e.owner)?String(e.owner):""}},toJSON(e){const t={};return e.classId!==void 0&&(t.classId=e.classId),e.id!==void 0&&(t.id=e.id),e.owner!==void 0&&(t.owner=e.owner),t},fromPartial(e){const t=createBaseEventBurn();return t.classId=e.classId??"",t.id=e.id??"",t.owner=e.owner??"",t}};function isSet$X(e){return e!=null}function createBaseAny$5(){return{typeUrl:"",value:new Uint8Array}}const Any$5={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$5();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$W(e.typeUrl)?String(e.typeUrl):"",value:isSet$W(e.value)?bytesFromBase64$h(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$h(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$5();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$Q=(()=>{if(typeof globalThis$Q<"u")return globalThis$Q;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$h(e){if(globalThis$Q.Buffer)return Uint8Array.from(globalThis$Q.Buffer.from(e,"base64"));{const t=globalThis$Q.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$h(e){if(globalThis$Q.Buffer)return globalThis$Q.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$Q.btoa(t.join(""))}}function isSet$W(e){return e!=null}function createBaseClass$1(){return{id:"",name:"",symbol:"",description:"",uri:"",uriHash:"",data:void 0}}const Class$1={encode(e,t=_m0.Writer.create()){return e.id!==""&&t.uint32(10).string(e.id),e.name!==""&&t.uint32(18).string(e.name),e.symbol!==""&&t.uint32(26).string(e.symbol),e.description!==""&&t.uint32(34).string(e.description),e.uri!==""&&t.uint32(42).string(e.uri),e.uriHash!==""&&t.uint32(50).string(e.uriHash),e.data!==void 0&&Any$5.encode(e.data,t.uint32(58).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseClass$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.id=n.string();break;case 2:u.name=n.string();break;case 3:u.symbol=n.string();break;case 4:u.description=n.string();break;case 5:u.uri=n.string();break;case 6:u.uriHash=n.string();break;case 7:u.data=Any$5.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{id:isSet$V(e.id)?String(e.id):"",name:isSet$V(e.name)?String(e.name):"",symbol:isSet$V(e.symbol)?String(e.symbol):"",description:isSet$V(e.description)?String(e.description):"",uri:isSet$V(e.uri)?String(e.uri):"",uriHash:isSet$V(e.uriHash)?String(e.uriHash):"",data:isSet$V(e.data)?Any$5.fromJSON(e.data):void 0}},toJSON(e){const t={};return e.id!==void 0&&(t.id=e.id),e.name!==void 0&&(t.name=e.name),e.symbol!==void 0&&(t.symbol=e.symbol),e.description!==void 0&&(t.description=e.description),e.uri!==void 0&&(t.uri=e.uri),e.uriHash!==void 0&&(t.uriHash=e.uriHash),e.data!==void 0&&(t.data=e.data?Any$5.toJSON(e.data):void 0),t},fromPartial(e){const t=createBaseClass$1();return t.id=e.id??"",t.name=e.name??"",t.symbol=e.symbol??"",t.description=e.description??"",t.uri=e.uri??"",t.uriHash=e.uriHash??"",t.data=e.data!==void 0&&e.data!==null?Any$5.fromPartial(e.data):void 0,t}};function createBaseNFT$1(){return{classId:"",id:"",uri:"",uriHash:"",data:void 0}}const NFT$1={encode(e,t=_m0.Writer.create()){return e.classId!==""&&t.uint32(10).string(e.classId),e.id!==""&&t.uint32(18).string(e.id),e.uri!==""&&t.uint32(26).string(e.uri),e.uriHash!==""&&t.uint32(34).string(e.uriHash),e.data!==void 0&&Any$5.encode(e.data,t.uint32(82).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseNFT$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.classId=n.string();break;case 2:u.id=n.string();break;case 3:u.uri=n.string();break;case 4:u.uriHash=n.string();break;case 10:u.data=Any$5.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{classId:isSet$V(e.classId)?String(e.classId):"",id:isSet$V(e.id)?String(e.id):"",uri:isSet$V(e.uri)?String(e.uri):"",uriHash:isSet$V(e.uriHash)?String(e.uriHash):"",data:isSet$V(e.data)?Any$5.fromJSON(e.data):void 0}},toJSON(e){const t={};return e.classId!==void 0&&(t.classId=e.classId),e.id!==void 0&&(t.id=e.id),e.uri!==void 0&&(t.uri=e.uri),e.uriHash!==void 0&&(t.uriHash=e.uriHash),e.data!==void 0&&(t.data=e.data?Any$5.toJSON(e.data):void 0),t},fromPartial(e){const t=createBaseNFT$1();return t.classId=e.classId??"",t.id=e.id??"",t.uri=e.uri??"",t.uriHash=e.uriHash??"",t.data=e.data!==void 0&&e.data!==null?Any$5.fromPartial(e.data):void 0,t}};function isSet$V(e){return e!=null}function createBaseEntry(){return{owner:"",nfts:[]}}const Entry={encode(e,t=_m0.Writer.create()){e.owner!==""&&t.uint32(10).string(e.owner);for(const n of e.nfts)NFT$1.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEntry();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.owner=n.string();break;case 2:u.nfts.push(NFT$1.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{owner:isSet$U(e.owner)?String(e.owner):"",nfts:Array.isArray(e==null?void 0:e.nfts)?e.nfts.map(t=>NFT$1.fromJSON(t)):[]}},toJSON(e){const t={};return e.owner!==void 0&&(t.owner=e.owner),e.nfts?t.nfts=e.nfts.map(n=>n?NFT$1.toJSON(n):void 0):t.nfts=[],t},fromPartial(e){var n;const t=createBaseEntry();return t.owner=e.owner??"",t.nfts=((n=e.nfts)==null?void 0:n.map(p=>NFT$1.fromPartial(p)))||[],t}};function isSet$U(e){return e!=null}new build$b.Registry(msgTypes$e);function getStructure$e(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$e=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$e=({addr:e}={addr:"http://localhost:1317"})=>new Api$e({baseURL:e});let SDKModule$e=class{constructor(t){this.registry=[],this.query=queryClient$e({addr:t.env.apiURL}),this.updateTX(t),this.structure={EventSend:getStructure$e(EventSend.fromPartial({})),EventMint:getStructure$e(EventMint.fromPartial({})),EventBurn:getStructure$e(EventBurn.fromPartial({})),Entry:getStructure$e(Entry.fromPartial({})),Class:getStructure$e(Class$1.fromPartial({})),NFT:getStructure$e(NFT$1.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$e({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$e=e=>({module:{CosmosNftV1Beta1:new SDKModule$e(e)},registry:msgTypes$e}),msgTypes$d=[];let HttpClient$d=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$d=class extends HttpClient$d{constructor(){super(...arguments),this.queryParams=(t,n={})=>this.request({path:"/cosmos/params/v1beta1/params",method:"GET",query:t,format:"json",...n}),this.querySubspaces=(t={})=>this.request({path:"/cosmos/params/v1beta1/subspaces",method:"GET",format:"json",...t})}};function createBaseParameterChangeProposal(){return{title:"",description:"",changes:[]}}const ParameterChangeProposal={encode(e,t=_m0.Writer.create()){e.title!==""&&t.uint32(10).string(e.title),e.description!==""&&t.uint32(18).string(e.description);for(const n of e.changes)ParamChange.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParameterChangeProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.title=n.string();break;case 2:u.description=n.string();break;case 3:u.changes.push(ParamChange.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{title:isSet$T(e.title)?String(e.title):"",description:isSet$T(e.description)?String(e.description):"",changes:Array.isArray(e==null?void 0:e.changes)?e.changes.map(t=>ParamChange.fromJSON(t)):[]}},toJSON(e){const t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),e.changes?t.changes=e.changes.map(n=>n?ParamChange.toJSON(n):void 0):t.changes=[],t},fromPartial(e){var n;const t=createBaseParameterChangeProposal();return t.title=e.title??"",t.description=e.description??"",t.changes=((n=e.changes)==null?void 0:n.map(p=>ParamChange.fromPartial(p)))||[],t}};function createBaseParamChange(){return{subspace:"",key:"",value:""}}const ParamChange={encode(e,t=_m0.Writer.create()){return e.subspace!==""&&t.uint32(10).string(e.subspace),e.key!==""&&t.uint32(18).string(e.key),e.value!==""&&t.uint32(26).string(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParamChange();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.subspace=n.string();break;case 2:u.key=n.string();break;case 3:u.value=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{subspace:isSet$T(e.subspace)?String(e.subspace):"",key:isSet$T(e.key)?String(e.key):"",value:isSet$T(e.value)?String(e.value):""}},toJSON(e){const t={};return e.subspace!==void 0&&(t.subspace=e.subspace),e.key!==void 0&&(t.key=e.key),e.value!==void 0&&(t.value=e.value),t},fromPartial(e){const t=createBaseParamChange();return t.subspace=e.subspace??"",t.key=e.key??"",t.value=e.value??"",t}};function isSet$T(e){return e!=null}function createBaseSubspace(){return{subspace:"",keys:[]}}const Subspace={encode(e,t=_m0.Writer.create()){e.subspace!==""&&t.uint32(10).string(e.subspace);for(const n of e.keys)t.uint32(18).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseSubspace();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.subspace=n.string();break;case 2:u.keys.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{subspace:isSet$S(e.subspace)?String(e.subspace):"",keys:Array.isArray(e==null?void 0:e.keys)?e.keys.map(t=>String(t)):[]}},toJSON(e){const t={};return e.subspace!==void 0&&(t.subspace=e.subspace),e.keys?t.keys=e.keys.map(n=>n):t.keys=[],t},fromPartial(e){var n;const t=createBaseSubspace();return t.subspace=e.subspace??"",t.keys=((n=e.keys)==null?void 0:n.map(p=>p))||[],t}};function isSet$S(e){return e!=null}new build$b.Registry(msgTypes$d);function getStructure$d(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$d=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$d=({addr:e}={addr:"http://localhost:1317"})=>new Api$d({baseURL:e});let SDKModule$d=class{constructor(t){this.registry=[],this.query=queryClient$d({addr:t.env.apiURL}),this.updateTX(t),this.structure={ParameterChangeProposal:getStructure$d(ParameterChangeProposal.fromPartial({})),ParamChange:getStructure$d(ParamChange.fromPartial({})),Subspace:getStructure$d(Subspace.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$d({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$d=e=>({module:{CosmosParamsV1Beta1:new SDKModule$d(e)},registry:msgTypes$d});function createBaseDuration$1(){return{seconds:0,nanos:0}}const Duration$1={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDuration$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$u(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$R(e.seconds)?Number(e.seconds):0,nanos:isSet$R(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseDuration$1();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$P=(()=>{if(typeof globalThis$P<"u")return globalThis$P;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$u(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$P.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$R(e){return e!=null}function createBaseTimestamp$3(){return{seconds:0,nanos:0}}const Timestamp$3={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp$3();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$t(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$Q(e.seconds)?Number(e.seconds):0,nanos:isSet$Q(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp$3();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$O=(()=>{if(typeof globalThis$O<"u")return globalThis$O;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$t(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$O.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$Q(e){return e!=null}function createBaseValidatorSigningInfo(){return{address:"",startHeight:0,indexOffset:0,jailedUntil:void 0,tombstoned:!1,missedBlocksCounter:0}}const ValidatorSigningInfo={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.startHeight!==0&&t.uint32(16).int64(e.startHeight),e.indexOffset!==0&&t.uint32(24).int64(e.indexOffset),e.jailedUntil!==void 0&&Timestamp$3.encode(toTimestamp$4(e.jailedUntil),t.uint32(34).fork()).ldelim(),e.tombstoned===!0&&t.uint32(40).bool(e.tombstoned),e.missedBlocksCounter!==0&&t.uint32(48).int64(e.missedBlocksCounter),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorSigningInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.startHeight=longToNumber$s(n.int64());break;case 3:u.indexOffset=longToNumber$s(n.int64());break;case 4:u.jailedUntil=fromTimestamp$4(Timestamp$3.decode(n,n.uint32()));break;case 5:u.tombstoned=n.bool();break;case 6:u.missedBlocksCounter=longToNumber$s(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$P(e.address)?String(e.address):"",startHeight:isSet$P(e.startHeight)?Number(e.startHeight):0,indexOffset:isSet$P(e.indexOffset)?Number(e.indexOffset):0,jailedUntil:isSet$P(e.jailedUntil)?fromJsonTimestamp$4(e.jailedUntil):void 0,tombstoned:isSet$P(e.tombstoned)?!!e.tombstoned:!1,missedBlocksCounter:isSet$P(e.missedBlocksCounter)?Number(e.missedBlocksCounter):0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.startHeight!==void 0&&(t.startHeight=Math.round(e.startHeight)),e.indexOffset!==void 0&&(t.indexOffset=Math.round(e.indexOffset)),e.jailedUntil!==void 0&&(t.jailedUntil=e.jailedUntil.toISOString()),e.tombstoned!==void 0&&(t.tombstoned=e.tombstoned),e.missedBlocksCounter!==void 0&&(t.missedBlocksCounter=Math.round(e.missedBlocksCounter)),t},fromPartial(e){const t=createBaseValidatorSigningInfo();return t.address=e.address??"",t.startHeight=e.startHeight??0,t.indexOffset=e.indexOffset??0,t.jailedUntil=e.jailedUntil??void 0,t.tombstoned=e.tombstoned??!1,t.missedBlocksCounter=e.missedBlocksCounter??0,t}};function createBaseParams$8(){return{signedBlocksWindow:0,minSignedPerWindow:new Uint8Array,downtimeJailDuration:void 0,slashFractionDoubleSign:new Uint8Array,slashFractionDowntime:new Uint8Array}}const Params$8={encode(e,t=_m0.Writer.create()){return e.signedBlocksWindow!==0&&t.uint32(8).int64(e.signedBlocksWindow),e.minSignedPerWindow.length!==0&&t.uint32(18).bytes(e.minSignedPerWindow),e.downtimeJailDuration!==void 0&&Duration$1.encode(e.downtimeJailDuration,t.uint32(26).fork()).ldelim(),e.slashFractionDoubleSign.length!==0&&t.uint32(34).bytes(e.slashFractionDoubleSign),e.slashFractionDowntime.length!==0&&t.uint32(42).bytes(e.slashFractionDowntime),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$8();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.signedBlocksWindow=longToNumber$s(n.int64());break;case 2:u.minSignedPerWindow=n.bytes();break;case 3:u.downtimeJailDuration=Duration$1.decode(n,n.uint32());break;case 4:u.slashFractionDoubleSign=n.bytes();break;case 5:u.slashFractionDowntime=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{signedBlocksWindow:isSet$P(e.signedBlocksWindow)?Number(e.signedBlocksWindow):0,minSignedPerWindow:isSet$P(e.minSignedPerWindow)?bytesFromBase64$g(e.minSignedPerWindow):new Uint8Array,downtimeJailDuration:isSet$P(e.downtimeJailDuration)?Duration$1.fromJSON(e.downtimeJailDuration):void 0,slashFractionDoubleSign:isSet$P(e.slashFractionDoubleSign)?bytesFromBase64$g(e.slashFractionDoubleSign):new Uint8Array,slashFractionDowntime:isSet$P(e.slashFractionDowntime)?bytesFromBase64$g(e.slashFractionDowntime):new Uint8Array}},toJSON(e){const t={};return e.signedBlocksWindow!==void 0&&(t.signedBlocksWindow=Math.round(e.signedBlocksWindow)),e.minSignedPerWindow!==void 0&&(t.minSignedPerWindow=base64FromBytes$g(e.minSignedPerWindow!==void 0?e.minSignedPerWindow:new Uint8Array)),e.downtimeJailDuration!==void 0&&(t.downtimeJailDuration=e.downtimeJailDuration?Duration$1.toJSON(e.downtimeJailDuration):void 0),e.slashFractionDoubleSign!==void 0&&(t.slashFractionDoubleSign=base64FromBytes$g(e.slashFractionDoubleSign!==void 0?e.slashFractionDoubleSign:new Uint8Array)),e.slashFractionDowntime!==void 0&&(t.slashFractionDowntime=base64FromBytes$g(e.slashFractionDowntime!==void 0?e.slashFractionDowntime:new Uint8Array)),t},fromPartial(e){const t=createBaseParams$8();return t.signedBlocksWindow=e.signedBlocksWindow??0,t.minSignedPerWindow=e.minSignedPerWindow??new Uint8Array,t.downtimeJailDuration=e.downtimeJailDuration!==void 0&&e.downtimeJailDuration!==null?Duration$1.fromPartial(e.downtimeJailDuration):void 0,t.slashFractionDoubleSign=e.slashFractionDoubleSign??new Uint8Array,t.slashFractionDowntime=e.slashFractionDowntime??new Uint8Array,t}};var globalThis$N=(()=>{if(typeof globalThis$N<"u")return globalThis$N;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$g(e){if(globalThis$N.Buffer)return Uint8Array.from(globalThis$N.Buffer.from(e,"base64"));{const t=globalThis$N.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$g(e){if(globalThis$N.Buffer)return globalThis$N.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$N.btoa(t.join(""))}}function toTimestamp$4(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$4(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$4(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$4(Timestamp$3.fromJSON(e))}function longToNumber$s(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$N.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$P(e){return e!=null}function createBaseMsgUnjail(){return{validatorAddr:""}}const MsgUnjail={encode(e,t=_m0.Writer.create()){return e.validatorAddr!==""&&t.uint32(10).string(e.validatorAddr),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUnjail();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validatorAddr=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validatorAddr:isSet$O(e.validatorAddr)?String(e.validatorAddr):""}},toJSON(e){const t={};return e.validatorAddr!==void 0&&(t.validatorAddr=e.validatorAddr),t},fromPartial(e){const t=createBaseMsgUnjail();return t.validatorAddr=e.validatorAddr??"",t}};function isSet$O(e){return e!=null}const msgTypes$c=[["/cosmos.slashing.v1beta1.MsgUnjail",MsgUnjail]];let HttpClient$c=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$c=class extends HttpClient$c{constructor(){super(...arguments),this.queryParams=(t={})=>this.request({path:"/cosmos/slashing/v1beta1/params",method:"GET",format:"json",...t}),this.querySigningInfos=(t,n={})=>this.request({path:"/cosmos/slashing/v1beta1/signing_infos",method:"GET",query:t,format:"json",...n}),this.querySigningInfo=(t,n={})=>this.request({path:`/cosmos/slashing/v1beta1/signing_infos/${t}`,method:"GET",format:"json",...n})}};function createBaseSigningInfo(){return{address:"",validatorSigningInfo:void 0}}const SigningInfo={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.validatorSigningInfo!==void 0&&ValidatorSigningInfo.encode(e.validatorSigningInfo,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseSigningInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.validatorSigningInfo=ValidatorSigningInfo.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$N(e.address)?String(e.address):"",validatorSigningInfo:isSet$N(e.validatorSigningInfo)?ValidatorSigningInfo.fromJSON(e.validatorSigningInfo):void 0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.validatorSigningInfo!==void 0&&(t.validatorSigningInfo=e.validatorSigningInfo?ValidatorSigningInfo.toJSON(e.validatorSigningInfo):void 0),t},fromPartial(e){const t=createBaseSigningInfo();return t.address=e.address??"",t.validatorSigningInfo=e.validatorSigningInfo!==void 0&&e.validatorSigningInfo!==null?ValidatorSigningInfo.fromPartial(e.validatorSigningInfo):void 0,t}};function createBaseValidatorMissedBlocks(){return{address:"",missedBlocks:[]}}const ValidatorMissedBlocks={encode(e,t=_m0.Writer.create()){e.address!==""&&t.uint32(10).string(e.address);for(const n of e.missedBlocks)MissedBlock.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorMissedBlocks();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.missedBlocks.push(MissedBlock.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$N(e.address)?String(e.address):"",missedBlocks:Array.isArray(e==null?void 0:e.missedBlocks)?e.missedBlocks.map(t=>MissedBlock.fromJSON(t)):[]}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.missedBlocks?t.missedBlocks=e.missedBlocks.map(n=>n?MissedBlock.toJSON(n):void 0):t.missedBlocks=[],t},fromPartial(e){var n;const t=createBaseValidatorMissedBlocks();return t.address=e.address??"",t.missedBlocks=((n=e.missedBlocks)==null?void 0:n.map(p=>MissedBlock.fromPartial(p)))||[],t}};function createBaseMissedBlock(){return{index:0,missed:!1}}const MissedBlock={encode(e,t=_m0.Writer.create()){return e.index!==0&&t.uint32(8).int64(e.index),e.missed===!0&&t.uint32(16).bool(e.missed),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMissedBlock();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.index=longToNumber$r(n.int64());break;case 2:u.missed=n.bool();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{index:isSet$N(e.index)?Number(e.index):0,missed:isSet$N(e.missed)?!!e.missed:!1}},toJSON(e){const t={};return e.index!==void 0&&(t.index=Math.round(e.index)),e.missed!==void 0&&(t.missed=e.missed),t},fromPartial(e){const t=createBaseMissedBlock();return t.index=e.index??0,t.missed=e.missed??!1,t}};var globalThis$M=(()=>{if(typeof globalThis$M<"u")return globalThis$M;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$r(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$M.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$N(e){return e!=null}const registry$6=new build$b.Registry(msgTypes$c);function getStructure$c(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$5={amount:[],gas:"200000"},txClient$c=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgUnjail({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUnjail: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$6,prefix:t});let N=this.msgUnjail({value:MsgUnjail.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$5,g)}catch(y){throw new Error("TxClient:sendMsgUnjail: Could not broadcast Tx: "+y.message)}},msgUnjail({value:p}){try{return{typeUrl:"/cosmos.slashing.v1beta1.MsgUnjail",value:MsgUnjail.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUnjail: Could not create message: "+u.message)}}}),queryClient$c=({addr:e}={addr:"http://localhost:1317"})=>new Api$c({baseURL:e});let SDKModule$c=class{constructor(t){this.registry=[],this.query=queryClient$c({addr:t.env.apiURL}),this.updateTX(t),this.structure={SigningInfo:getStructure$c(SigningInfo.fromPartial({})),ValidatorMissedBlocks:getStructure$c(ValidatorMissedBlocks.fromPartial({})),MissedBlock:getStructure$c(MissedBlock.fromPartial({})),ValidatorSigningInfo:getStructure$c(ValidatorSigningInfo.fromPartial({})),Params:getStructure$c(Params$8.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$c({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$c=e=>({module:{CosmosSlashingV1Beta1:new SDKModule$c(e)},registry:msgTypes$c});function createBaseAny$4(){return{typeUrl:"",value:new Uint8Array}}const Any$4={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$4();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$M(e.typeUrl)?String(e.typeUrl):"",value:isSet$M(e.value)?bytesFromBase64$f(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$f(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$4();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$L=(()=>{if(typeof globalThis$L<"u")return globalThis$L;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$f(e){if(globalThis$L.Buffer)return Uint8Array.from(globalThis$L.Buffer.from(e,"base64"));{const t=globalThis$L.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$f(e){if(globalThis$L.Buffer)return globalThis$L.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$L.btoa(t.join(""))}}function isSet$M(e){return e!=null}function createBaseTimestamp$2(){return{seconds:0,nanos:0}}const Timestamp$2={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$q(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$L(e.seconds)?Number(e.seconds):0,nanos:isSet$L(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp$2();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$K=(()=>{if(typeof globalThis$K<"u")return globalThis$K;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$q(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$K.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$L(e){return e!=null}function createBaseCoin$4(){return{denom:"",amount:""}}const Coin$4={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin$4();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$K(e.denom)?String(e.denom):"",amount:isSet$K(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin$4();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$K(e){return e!=null}function createBaseDuration(){return{seconds:0,nanos:0}}const Duration={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDuration();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$p(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$J(e.seconds)?Number(e.seconds):0,nanos:isSet$J(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseDuration();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$J=(()=>{if(typeof globalThis$J<"u")return globalThis$J;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$p(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$J.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$J(e){return e!=null}function createBasePublicKey(){return{ed25519:void 0,secp256k1:void 0}}const PublicKey={encode(e,t=_m0.Writer.create()){return e.ed25519!==void 0&&t.uint32(10).bytes(e.ed25519),e.secp256k1!==void 0&&t.uint32(18).bytes(e.secp256k1),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePublicKey();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.ed25519=n.bytes();break;case 2:u.secp256k1=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{ed25519:isSet$I(e.ed25519)?bytesFromBase64$e(e.ed25519):void 0,secp256k1:isSet$I(e.secp256k1)?bytesFromBase64$e(e.secp256k1):void 0}},toJSON(e){const t={};return e.ed25519!==void 0&&(t.ed25519=e.ed25519!==void 0?base64FromBytes$e(e.ed25519):void 0),e.secp256k1!==void 0&&(t.secp256k1=e.secp256k1!==void 0?base64FromBytes$e(e.secp256k1):void 0),t},fromPartial(e){const t=createBasePublicKey();return t.ed25519=e.ed25519??void 0,t.secp256k1=e.secp256k1??void 0,t}};var globalThis$I=(()=>{if(typeof globalThis$I<"u")return globalThis$I;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$e(e){if(globalThis$I.Buffer)return Uint8Array.from(globalThis$I.Buffer.from(e,"base64"));{const t=globalThis$I.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$e(e){if(globalThis$I.Buffer)return globalThis$I.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$I.btoa(t.join(""))}}function isSet$I(e){return e!=null}var globalThis$H=(()=>{if(typeof globalThis$H<"u")return globalThis$H;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());var globalThis$G=(()=>{if(typeof globalThis$G<"u")return globalThis$G;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function createBaseConsensus(){return{block:0,app:0}}const Consensus={encode(e,t=_m0.Writer.create()){return e.block!==0&&t.uint32(8).uint64(e.block),e.app!==0&&t.uint32(16).uint64(e.app),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseConsensus();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.block=longToNumber$o(n.uint64());break;case 2:u.app=longToNumber$o(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{block:isSet$H(e.block)?Number(e.block):0,app:isSet$H(e.app)?Number(e.app):0}},toJSON(e){const t={};return e.block!==void 0&&(t.block=Math.round(e.block)),e.app!==void 0&&(t.app=Math.round(e.app)),t},fromPartial(e){const t=createBaseConsensus();return t.block=e.block??0,t.app=e.app??0,t}};var globalThis$F=(()=>{if(typeof globalThis$F<"u")return globalThis$F;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$o(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$F.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$H(e){return e!=null}var globalThis$E=(()=>{if(typeof globalThis$E<"u")return globalThis$E;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function createBasePartSetHeader(){return{total:0,hash:new Uint8Array}}const PartSetHeader={encode(e,t=_m0.Writer.create()){return e.total!==0&&t.uint32(8).uint32(e.total),e.hash.length!==0&&t.uint32(18).bytes(e.hash),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePartSetHeader();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.total=n.uint32();break;case 2:u.hash=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{total:isSet$G(e.total)?Number(e.total):0,hash:isSet$G(e.hash)?bytesFromBase64$d(e.hash):new Uint8Array}},toJSON(e){const t={};return e.total!==void 0&&(t.total=Math.round(e.total)),e.hash!==void 0&&(t.hash=base64FromBytes$d(e.hash!==void 0?e.hash:new Uint8Array)),t},fromPartial(e){const t=createBasePartSetHeader();return t.total=e.total??0,t.hash=e.hash??new Uint8Array,t}};function createBaseBlockID(){return{hash:new Uint8Array,partSetHeader:void 0}}const BlockID={encode(e,t=_m0.Writer.create()){return e.hash.length!==0&&t.uint32(10).bytes(e.hash),e.partSetHeader!==void 0&&PartSetHeader.encode(e.partSetHeader,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseBlockID();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.hash=n.bytes();break;case 2:u.partSetHeader=PartSetHeader.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{hash:isSet$G(e.hash)?bytesFromBase64$d(e.hash):new Uint8Array,partSetHeader:isSet$G(e.partSetHeader)?PartSetHeader.fromJSON(e.partSetHeader):void 0}},toJSON(e){const t={};return e.hash!==void 0&&(t.hash=base64FromBytes$d(e.hash!==void 0?e.hash:new Uint8Array)),e.partSetHeader!==void 0&&(t.partSetHeader=e.partSetHeader?PartSetHeader.toJSON(e.partSetHeader):void 0),t},fromPartial(e){const t=createBaseBlockID();return t.hash=e.hash??new Uint8Array,t.partSetHeader=e.partSetHeader!==void 0&&e.partSetHeader!==null?PartSetHeader.fromPartial(e.partSetHeader):void 0,t}};function createBaseHeader(){return{version:void 0,chainId:"",height:0,time:void 0,lastBlockId:void 0,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}}const Header={encode(e,t=_m0.Writer.create()){return e.version!==void 0&&Consensus.encode(e.version,t.uint32(10).fork()).ldelim(),e.chainId!==""&&t.uint32(18).string(e.chainId),e.height!==0&&t.uint32(24).int64(e.height),e.time!==void 0&&Timestamp$2.encode(toTimestamp$3(e.time),t.uint32(34).fork()).ldelim(),e.lastBlockId!==void 0&&BlockID.encode(e.lastBlockId,t.uint32(42).fork()).ldelim(),e.lastCommitHash.length!==0&&t.uint32(50).bytes(e.lastCommitHash),e.dataHash.length!==0&&t.uint32(58).bytes(e.dataHash),e.validatorsHash.length!==0&&t.uint32(66).bytes(e.validatorsHash),e.nextValidatorsHash.length!==0&&t.uint32(74).bytes(e.nextValidatorsHash),e.consensusHash.length!==0&&t.uint32(82).bytes(e.consensusHash),e.appHash.length!==0&&t.uint32(90).bytes(e.appHash),e.lastResultsHash.length!==0&&t.uint32(98).bytes(e.lastResultsHash),e.evidenceHash.length!==0&&t.uint32(106).bytes(e.evidenceHash),e.proposerAddress.length!==0&&t.uint32(114).bytes(e.proposerAddress),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseHeader();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.version=Consensus.decode(n,n.uint32());break;case 2:u.chainId=n.string();break;case 3:u.height=longToNumber$n(n.int64());break;case 4:u.time=fromTimestamp$3(Timestamp$2.decode(n,n.uint32()));break;case 5:u.lastBlockId=BlockID.decode(n,n.uint32());break;case 6:u.lastCommitHash=n.bytes();break;case 7:u.dataHash=n.bytes();break;case 8:u.validatorsHash=n.bytes();break;case 9:u.nextValidatorsHash=n.bytes();break;case 10:u.consensusHash=n.bytes();break;case 11:u.appHash=n.bytes();break;case 12:u.lastResultsHash=n.bytes();break;case 13:u.evidenceHash=n.bytes();break;case 14:u.proposerAddress=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{version:isSet$G(e.version)?Consensus.fromJSON(e.version):void 0,chainId:isSet$G(e.chainId)?String(e.chainId):"",height:isSet$G(e.height)?Number(e.height):0,time:isSet$G(e.time)?fromJsonTimestamp$3(e.time):void 0,lastBlockId:isSet$G(e.lastBlockId)?BlockID.fromJSON(e.lastBlockId):void 0,lastCommitHash:isSet$G(e.lastCommitHash)?bytesFromBase64$d(e.lastCommitHash):new Uint8Array,dataHash:isSet$G(e.dataHash)?bytesFromBase64$d(e.dataHash):new Uint8Array,validatorsHash:isSet$G(e.validatorsHash)?bytesFromBase64$d(e.validatorsHash):new Uint8Array,nextValidatorsHash:isSet$G(e.nextValidatorsHash)?bytesFromBase64$d(e.nextValidatorsHash):new Uint8Array,consensusHash:isSet$G(e.consensusHash)?bytesFromBase64$d(e.consensusHash):new Uint8Array,appHash:isSet$G(e.appHash)?bytesFromBase64$d(e.appHash):new Uint8Array,lastResultsHash:isSet$G(e.lastResultsHash)?bytesFromBase64$d(e.lastResultsHash):new Uint8Array,evidenceHash:isSet$G(e.evidenceHash)?bytesFromBase64$d(e.evidenceHash):new Uint8Array,proposerAddress:isSet$G(e.proposerAddress)?bytesFromBase64$d(e.proposerAddress):new Uint8Array}},toJSON(e){const t={};return e.version!==void 0&&(t.version=e.version?Consensus.toJSON(e.version):void 0),e.chainId!==void 0&&(t.chainId=e.chainId),e.height!==void 0&&(t.height=Math.round(e.height)),e.time!==void 0&&(t.time=e.time.toISOString()),e.lastBlockId!==void 0&&(t.lastBlockId=e.lastBlockId?BlockID.toJSON(e.lastBlockId):void 0),e.lastCommitHash!==void 0&&(t.lastCommitHash=base64FromBytes$d(e.lastCommitHash!==void 0?e.lastCommitHash:new Uint8Array)),e.dataHash!==void 0&&(t.dataHash=base64FromBytes$d(e.dataHash!==void 0?e.dataHash:new Uint8Array)),e.validatorsHash!==void 0&&(t.validatorsHash=base64FromBytes$d(e.validatorsHash!==void 0?e.validatorsHash:new Uint8Array)),e.nextValidatorsHash!==void 0&&(t.nextValidatorsHash=base64FromBytes$d(e.nextValidatorsHash!==void 0?e.nextValidatorsHash:new Uint8Array)),e.consensusHash!==void 0&&(t.consensusHash=base64FromBytes$d(e.consensusHash!==void 0?e.consensusHash:new Uint8Array)),e.appHash!==void 0&&(t.appHash=base64FromBytes$d(e.appHash!==void 0?e.appHash:new Uint8Array)),e.lastResultsHash!==void 0&&(t.lastResultsHash=base64FromBytes$d(e.lastResultsHash!==void 0?e.lastResultsHash:new Uint8Array)),e.evidenceHash!==void 0&&(t.evidenceHash=base64FromBytes$d(e.evidenceHash!==void 0?e.evidenceHash:new Uint8Array)),e.proposerAddress!==void 0&&(t.proposerAddress=base64FromBytes$d(e.proposerAddress!==void 0?e.proposerAddress:new Uint8Array)),t},fromPartial(e){const t=createBaseHeader();return t.version=e.version!==void 0&&e.version!==null?Consensus.fromPartial(e.version):void 0,t.chainId=e.chainId??"",t.height=e.height??0,t.time=e.time??void 0,t.lastBlockId=e.lastBlockId!==void 0&&e.lastBlockId!==null?BlockID.fromPartial(e.lastBlockId):void 0,t.lastCommitHash=e.lastCommitHash??new Uint8Array,t.dataHash=e.dataHash??new Uint8Array,t.validatorsHash=e.validatorsHash??new Uint8Array,t.nextValidatorsHash=e.nextValidatorsHash??new Uint8Array,t.consensusHash=e.consensusHash??new Uint8Array,t.appHash=e.appHash??new Uint8Array,t.lastResultsHash=e.lastResultsHash??new Uint8Array,t.evidenceHash=e.evidenceHash??new Uint8Array,t.proposerAddress=e.proposerAddress??new Uint8Array,t}};var globalThis$D=(()=>{if(typeof globalThis$D<"u")return globalThis$D;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$d(e){if(globalThis$D.Buffer)return Uint8Array.from(globalThis$D.Buffer.from(e,"base64"));{const t=globalThis$D.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$d(e){if(globalThis$D.Buffer)return globalThis$D.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$D.btoa(t.join(""))}}function toTimestamp$3(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$3(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$3(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$3(Timestamp$2.fromJSON(e))}function longToNumber$n(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$D.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$G(e){return e!=null}function createBaseValidatorUpdate(){return{pubKey:void 0,power:0}}const ValidatorUpdate={encode(e,t=_m0.Writer.create()){return e.pubKey!==void 0&&PublicKey.encode(e.pubKey,t.uint32(10).fork()).ldelim(),e.power!==0&&t.uint32(16).int64(e.power),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorUpdate();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.pubKey=PublicKey.decode(n,n.uint32());break;case 2:u.power=longToNumber$m(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{pubKey:isSet$F(e.pubKey)?PublicKey.fromJSON(e.pubKey):void 0,power:isSet$F(e.power)?Number(e.power):0}},toJSON(e){const t={};return e.pubKey!==void 0&&(t.pubKey=e.pubKey?PublicKey.toJSON(e.pubKey):void 0),e.power!==void 0&&(t.power=Math.round(e.power)),t},fromPartial(e){const t=createBaseValidatorUpdate();return t.pubKey=e.pubKey!==void 0&&e.pubKey!==null?PublicKey.fromPartial(e.pubKey):void 0,t.power=e.power??0,t}};var globalThis$C=(()=>{if(typeof globalThis$C<"u")return globalThis$C;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$m(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$C.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$F(e){return e!=null}function bondStatusFromJSON(e){switch(e){case 0:case"BOND_STATUS_UNSPECIFIED":return 0;case 1:case"BOND_STATUS_UNBONDED":return 1;case 2:case"BOND_STATUS_UNBONDING":return 2;case 3:case"BOND_STATUS_BONDED":return 3;case-1:case"UNRECOGNIZED":default:return-1}}function bondStatusToJSON(e){switch(e){case 0:return"BOND_STATUS_UNSPECIFIED";case 1:return"BOND_STATUS_UNBONDED";case 2:return"BOND_STATUS_UNBONDING";case 3:return"BOND_STATUS_BONDED";case-1:default:return"UNRECOGNIZED"}}function createBaseHistoricalInfo(){return{header:void 0,valset:[]}}const HistoricalInfo={encode(e,t=_m0.Writer.create()){e.header!==void 0&&Header.encode(e.header,t.uint32(10).fork()).ldelim();for(const n of e.valset)Validator.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseHistoricalInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.header=Header.decode(n,n.uint32());break;case 2:u.valset.push(Validator.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{header:isSet$E(e.header)?Header.fromJSON(e.header):void 0,valset:Array.isArray(e==null?void 0:e.valset)?e.valset.map(t=>Validator.fromJSON(t)):[]}},toJSON(e){const t={};return e.header!==void 0&&(t.header=e.header?Header.toJSON(e.header):void 0),e.valset?t.valset=e.valset.map(n=>n?Validator.toJSON(n):void 0):t.valset=[],t},fromPartial(e){var n;const t=createBaseHistoricalInfo();return t.header=e.header!==void 0&&e.header!==null?Header.fromPartial(e.header):void 0,t.valset=((n=e.valset)==null?void 0:n.map(p=>Validator.fromPartial(p)))||[],t}};function createBaseCommissionRates(){return{rate:"",maxRate:"",maxChangeRate:""}}const CommissionRates={encode(e,t=_m0.Writer.create()){return e.rate!==""&&t.uint32(10).string(e.rate),e.maxRate!==""&&t.uint32(18).string(e.maxRate),e.maxChangeRate!==""&&t.uint32(26).string(e.maxChangeRate),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCommissionRates();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.rate=n.string();break;case 2:u.maxRate=n.string();break;case 3:u.maxChangeRate=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{rate:isSet$E(e.rate)?String(e.rate):"",maxRate:isSet$E(e.maxRate)?String(e.maxRate):"",maxChangeRate:isSet$E(e.maxChangeRate)?String(e.maxChangeRate):""}},toJSON(e){const t={};return e.rate!==void 0&&(t.rate=e.rate),e.maxRate!==void 0&&(t.maxRate=e.maxRate),e.maxChangeRate!==void 0&&(t.maxChangeRate=e.maxChangeRate),t},fromPartial(e){const t=createBaseCommissionRates();return t.rate=e.rate??"",t.maxRate=e.maxRate??"",t.maxChangeRate=e.maxChangeRate??"",t}};function createBaseCommission(){return{commissionRates:void 0,updateTime:void 0}}const Commission={encode(e,t=_m0.Writer.create()){return e.commissionRates!==void 0&&CommissionRates.encode(e.commissionRates,t.uint32(10).fork()).ldelim(),e.updateTime!==void 0&&Timestamp$2.encode(toTimestamp$2(e.updateTime),t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCommission();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.commissionRates=CommissionRates.decode(n,n.uint32());break;case 2:u.updateTime=fromTimestamp$2(Timestamp$2.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{commissionRates:isSet$E(e.commissionRates)?CommissionRates.fromJSON(e.commissionRates):void 0,updateTime:isSet$E(e.updateTime)?fromJsonTimestamp$2(e.updateTime):void 0}},toJSON(e){const t={};return e.commissionRates!==void 0&&(t.commissionRates=e.commissionRates?CommissionRates.toJSON(e.commissionRates):void 0),e.updateTime!==void 0&&(t.updateTime=e.updateTime.toISOString()),t},fromPartial(e){const t=createBaseCommission();return t.commissionRates=e.commissionRates!==void 0&&e.commissionRates!==null?CommissionRates.fromPartial(e.commissionRates):void 0,t.updateTime=e.updateTime??void 0,t}};function createBaseDescription(){return{moniker:"",identity:"",website:"",securityContact:"",details:""}}const Description={encode(e,t=_m0.Writer.create()){return e.moniker!==""&&t.uint32(10).string(e.moniker),e.identity!==""&&t.uint32(18).string(e.identity),e.website!==""&&t.uint32(26).string(e.website),e.securityContact!==""&&t.uint32(34).string(e.securityContact),e.details!==""&&t.uint32(42).string(e.details),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDescription();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.moniker=n.string();break;case 2:u.identity=n.string();break;case 3:u.website=n.string();break;case 4:u.securityContact=n.string();break;case 5:u.details=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{moniker:isSet$E(e.moniker)?String(e.moniker):"",identity:isSet$E(e.identity)?String(e.identity):"",website:isSet$E(e.website)?String(e.website):"",securityContact:isSet$E(e.securityContact)?String(e.securityContact):"",details:isSet$E(e.details)?String(e.details):""}},toJSON(e){const t={};return e.moniker!==void 0&&(t.moniker=e.moniker),e.identity!==void 0&&(t.identity=e.identity),e.website!==void 0&&(t.website=e.website),e.securityContact!==void 0&&(t.securityContact=e.securityContact),e.details!==void 0&&(t.details=e.details),t},fromPartial(e){const t=createBaseDescription();return t.moniker=e.moniker??"",t.identity=e.identity??"",t.website=e.website??"",t.securityContact=e.securityContact??"",t.details=e.details??"",t}};function createBaseValidator(){return{operatorAddress:"",consensusPubkey:void 0,jailed:!1,status:0,tokens:"",delegatorShares:"",description:void 0,unbondingHeight:0,unbondingTime:void 0,commission:void 0,minSelfDelegation:"",unbondingOnHoldRefCount:0,unbondingIds:[]}}const Validator={encode(e,t=_m0.Writer.create()){e.operatorAddress!==""&&t.uint32(10).string(e.operatorAddress),e.consensusPubkey!==void 0&&Any$4.encode(e.consensusPubkey,t.uint32(18).fork()).ldelim(),e.jailed===!0&&t.uint32(24).bool(e.jailed),e.status!==0&&t.uint32(32).int32(e.status),e.tokens!==""&&t.uint32(42).string(e.tokens),e.delegatorShares!==""&&t.uint32(50).string(e.delegatorShares),e.description!==void 0&&Description.encode(e.description,t.uint32(58).fork()).ldelim(),e.unbondingHeight!==0&&t.uint32(64).int64(e.unbondingHeight),e.unbondingTime!==void 0&&Timestamp$2.encode(toTimestamp$2(e.unbondingTime),t.uint32(74).fork()).ldelim(),e.commission!==void 0&&Commission.encode(e.commission,t.uint32(82).fork()).ldelim(),e.minSelfDelegation!==""&&t.uint32(90).string(e.minSelfDelegation),e.unbondingOnHoldRefCount!==0&&t.uint32(96).int64(e.unbondingOnHoldRefCount),t.uint32(106).fork();for(const n of e.unbondingIds)t.uint64(n);return t.ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidator();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.operatorAddress=n.string();break;case 2:u.consensusPubkey=Any$4.decode(n,n.uint32());break;case 3:u.jailed=n.bool();break;case 4:u.status=n.int32();break;case 5:u.tokens=n.string();break;case 6:u.delegatorShares=n.string();break;case 7:u.description=Description.decode(n,n.uint32());break;case 8:u.unbondingHeight=longToNumber$l(n.int64());break;case 9:u.unbondingTime=fromTimestamp$2(Timestamp$2.decode(n,n.uint32()));break;case 10:u.commission=Commission.decode(n,n.uint32());break;case 11:u.minSelfDelegation=n.string();break;case 12:u.unbondingOnHoldRefCount=longToNumber$l(n.int64());break;case 13:if((g&7)===2){const y=n.uint32()+n.pos;for(;n.pos<y;)u.unbondingIds.push(longToNumber$l(n.uint64()))}else u.unbondingIds.push(longToNumber$l(n.uint64()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{operatorAddress:isSet$E(e.operatorAddress)?String(e.operatorAddress):"",consensusPubkey:isSet$E(e.consensusPubkey)?Any$4.fromJSON(e.consensusPubkey):void 0,jailed:isSet$E(e.jailed)?!!e.jailed:!1,status:isSet$E(e.status)?bondStatusFromJSON(e.status):0,tokens:isSet$E(e.tokens)?String(e.tokens):"",delegatorShares:isSet$E(e.delegatorShares)?String(e.delegatorShares):"",description:isSet$E(e.description)?Description.fromJSON(e.description):void 0,unbondingHeight:isSet$E(e.unbondingHeight)?Number(e.unbondingHeight):0,unbondingTime:isSet$E(e.unbondingTime)?fromJsonTimestamp$2(e.unbondingTime):void 0,commission:isSet$E(e.commission)?Commission.fromJSON(e.commission):void 0,minSelfDelegation:isSet$E(e.minSelfDelegation)?String(e.minSelfDelegation):"",unbondingOnHoldRefCount:isSet$E(e.unbondingOnHoldRefCount)?Number(e.unbondingOnHoldRefCount):0,unbondingIds:Array.isArray(e==null?void 0:e.unbondingIds)?e.unbondingIds.map(t=>Number(t)):[]}},toJSON(e){const t={};return e.operatorAddress!==void 0&&(t.operatorAddress=e.operatorAddress),e.consensusPubkey!==void 0&&(t.consensusPubkey=e.consensusPubkey?Any$4.toJSON(e.consensusPubkey):void 0),e.jailed!==void 0&&(t.jailed=e.jailed),e.status!==void 0&&(t.status=bondStatusToJSON(e.status)),e.tokens!==void 0&&(t.tokens=e.tokens),e.delegatorShares!==void 0&&(t.delegatorShares=e.delegatorShares),e.description!==void 0&&(t.description=e.description?Description.toJSON(e.description):void 0),e.unbondingHeight!==void 0&&(t.unbondingHeight=Math.round(e.unbondingHeight)),e.unbondingTime!==void 0&&(t.unbondingTime=e.unbondingTime.toISOString()),e.commission!==void 0&&(t.commission=e.commission?Commission.toJSON(e.commission):void 0),e.minSelfDelegation!==void 0&&(t.minSelfDelegation=e.minSelfDelegation),e.unbondingOnHoldRefCount!==void 0&&(t.unbondingOnHoldRefCount=Math.round(e.unbondingOnHoldRefCount)),e.unbondingIds?t.unbondingIds=e.unbondingIds.map(n=>Math.round(n)):t.unbondingIds=[],t},fromPartial(e){var n;const t=createBaseValidator();return t.operatorAddress=e.operatorAddress??"",t.consensusPubkey=e.consensusPubkey!==void 0&&e.consensusPubkey!==null?Any$4.fromPartial(e.consensusPubkey):void 0,t.jailed=e.jailed??!1,t.status=e.status??0,t.tokens=e.tokens??"",t.delegatorShares=e.delegatorShares??"",t.description=e.description!==void 0&&e.description!==null?Description.fromPartial(e.description):void 0,t.unbondingHeight=e.unbondingHeight??0,t.unbondingTime=e.unbondingTime??void 0,t.commission=e.commission!==void 0&&e.commission!==null?Commission.fromPartial(e.commission):void 0,t.minSelfDelegation=e.minSelfDelegation??"",t.unbondingOnHoldRefCount=e.unbondingOnHoldRefCount??0,t.unbondingIds=((n=e.unbondingIds)==null?void 0:n.map(p=>p))||[],t}};function createBaseValAddresses(){return{addresses:[]}}const ValAddresses={encode(e,t=_m0.Writer.create()){for(const n of e.addresses)t.uint32(10).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValAddresses();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.addresses.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{addresses:Array.isArray(e==null?void 0:e.addresses)?e.addresses.map(t=>String(t)):[]}},toJSON(e){const t={};return e.addresses?t.addresses=e.addresses.map(n=>n):t.addresses=[],t},fromPartial(e){var n;const t=createBaseValAddresses();return t.addresses=((n=e.addresses)==null?void 0:n.map(p=>p))||[],t}};function createBaseDVPair(){return{delegatorAddress:"",validatorAddress:""}}const DVPair={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==""&&t.uint32(18).string(e.validatorAddress),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDVPair();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorAddress=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$E(e.delegatorAddress)?String(e.delegatorAddress):"",validatorAddress:isSet$E(e.validatorAddress)?String(e.validatorAddress):""}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){const t=createBaseDVPair();return t.delegatorAddress=e.delegatorAddress??"",t.validatorAddress=e.validatorAddress??"",t}};function createBaseDVPairs(){return{pairs:[]}}const DVPairs={encode(e,t=_m0.Writer.create()){for(const n of e.pairs)DVPair.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDVPairs();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.pairs.push(DVPair.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{pairs:Array.isArray(e==null?void 0:e.pairs)?e.pairs.map(t=>DVPair.fromJSON(t)):[]}},toJSON(e){const t={};return e.pairs?t.pairs=e.pairs.map(n=>n?DVPair.toJSON(n):void 0):t.pairs=[],t},fromPartial(e){var n;const t=createBaseDVPairs();return t.pairs=((n=e.pairs)==null?void 0:n.map(p=>DVPair.fromPartial(p)))||[],t}};function createBaseDVVTriplet(){return{delegatorAddress:"",validatorSrcAddress:"",validatorDstAddress:""}}const DVVTriplet={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorSrcAddress!==""&&t.uint32(18).string(e.validatorSrcAddress),e.validatorDstAddress!==""&&t.uint32(26).string(e.validatorDstAddress),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDVVTriplet();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorSrcAddress=n.string();break;case 3:u.validatorDstAddress=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$E(e.delegatorAddress)?String(e.delegatorAddress):"",validatorSrcAddress:isSet$E(e.validatorSrcAddress)?String(e.validatorSrcAddress):"",validatorDstAddress:isSet$E(e.validatorDstAddress)?String(e.validatorDstAddress):""}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorSrcAddress!==void 0&&(t.validatorSrcAddress=e.validatorSrcAddress),e.validatorDstAddress!==void 0&&(t.validatorDstAddress=e.validatorDstAddress),t},fromPartial(e){const t=createBaseDVVTriplet();return t.delegatorAddress=e.delegatorAddress??"",t.validatorSrcAddress=e.validatorSrcAddress??"",t.validatorDstAddress=e.validatorDstAddress??"",t}};function createBaseDVVTriplets(){return{triplets:[]}}const DVVTriplets={encode(e,t=_m0.Writer.create()){for(const n of e.triplets)DVVTriplet.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDVVTriplets();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.triplets.push(DVVTriplet.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{triplets:Array.isArray(e==null?void 0:e.triplets)?e.triplets.map(t=>DVVTriplet.fromJSON(t)):[]}},toJSON(e){const t={};return e.triplets?t.triplets=e.triplets.map(n=>n?DVVTriplet.toJSON(n):void 0):t.triplets=[],t},fromPartial(e){var n;const t=createBaseDVVTriplets();return t.triplets=((n=e.triplets)==null?void 0:n.map(p=>DVVTriplet.fromPartial(p)))||[],t}};function createBaseDelegation(){return{delegatorAddress:"",validatorAddress:"",shares:""}}const Delegation={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==""&&t.uint32(18).string(e.validatorAddress),e.shares!==""&&t.uint32(26).string(e.shares),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDelegation();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorAddress=n.string();break;case 3:u.shares=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$E(e.delegatorAddress)?String(e.delegatorAddress):"",validatorAddress:isSet$E(e.validatorAddress)?String(e.validatorAddress):"",shares:isSet$E(e.shares)?String(e.shares):""}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.shares!==void 0&&(t.shares=e.shares),t},fromPartial(e){const t=createBaseDelegation();return t.delegatorAddress=e.delegatorAddress??"",t.validatorAddress=e.validatorAddress??"",t.shares=e.shares??"",t}};function createBaseUnbondingDelegation(){return{delegatorAddress:"",validatorAddress:"",entries:[]}}const UnbondingDelegation={encode(e,t=_m0.Writer.create()){e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==""&&t.uint32(18).string(e.validatorAddress);for(const n of e.entries)UnbondingDelegationEntry.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseUnbondingDelegation();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorAddress=n.string();break;case 3:u.entries.push(UnbondingDelegationEntry.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$E(e.delegatorAddress)?String(e.delegatorAddress):"",validatorAddress:isSet$E(e.validatorAddress)?String(e.validatorAddress):"",entries:Array.isArray(e==null?void 0:e.entries)?e.entries.map(t=>UnbondingDelegationEntry.fromJSON(t)):[]}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.entries?t.entries=e.entries.map(n=>n?UnbondingDelegationEntry.toJSON(n):void 0):t.entries=[],t},fromPartial(e){var n;const t=createBaseUnbondingDelegation();return t.delegatorAddress=e.delegatorAddress??"",t.validatorAddress=e.validatorAddress??"",t.entries=((n=e.entries)==null?void 0:n.map(p=>UnbondingDelegationEntry.fromPartial(p)))||[],t}};function createBaseUnbondingDelegationEntry(){return{creationHeight:0,completionTime:void 0,initialBalance:"",balance:"",unbondingId:0,unbondingOnHoldRefCount:0}}const UnbondingDelegationEntry={encode(e,t=_m0.Writer.create()){return e.creationHeight!==0&&t.uint32(8).int64(e.creationHeight),e.completionTime!==void 0&&Timestamp$2.encode(toTimestamp$2(e.completionTime),t.uint32(18).fork()).ldelim(),e.initialBalance!==""&&t.uint32(26).string(e.initialBalance),e.balance!==""&&t.uint32(34).string(e.balance),e.unbondingId!==0&&t.uint32(40).uint64(e.unbondingId),e.unbondingOnHoldRefCount!==0&&t.uint32(48).int64(e.unbondingOnHoldRefCount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseUnbondingDelegationEntry();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.creationHeight=longToNumber$l(n.int64());break;case 2:u.completionTime=fromTimestamp$2(Timestamp$2.decode(n,n.uint32()));break;case 3:u.initialBalance=n.string();break;case 4:u.balance=n.string();break;case 5:u.unbondingId=longToNumber$l(n.uint64());break;case 6:u.unbondingOnHoldRefCount=longToNumber$l(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{creationHeight:isSet$E(e.creationHeight)?Number(e.creationHeight):0,completionTime:isSet$E(e.completionTime)?fromJsonTimestamp$2(e.completionTime):void 0,initialBalance:isSet$E(e.initialBalance)?String(e.initialBalance):"",balance:isSet$E(e.balance)?String(e.balance):"",unbondingId:isSet$E(e.unbondingId)?Number(e.unbondingId):0,unbondingOnHoldRefCount:isSet$E(e.unbondingOnHoldRefCount)?Number(e.unbondingOnHoldRefCount):0}},toJSON(e){const t={};return e.creationHeight!==void 0&&(t.creationHeight=Math.round(e.creationHeight)),e.completionTime!==void 0&&(t.completionTime=e.completionTime.toISOString()),e.initialBalance!==void 0&&(t.initialBalance=e.initialBalance),e.balance!==void 0&&(t.balance=e.balance),e.unbondingId!==void 0&&(t.unbondingId=Math.round(e.unbondingId)),e.unbondingOnHoldRefCount!==void 0&&(t.unbondingOnHoldRefCount=Math.round(e.unbondingOnHoldRefCount)),t},fromPartial(e){const t=createBaseUnbondingDelegationEntry();return t.creationHeight=e.creationHeight??0,t.completionTime=e.completionTime??void 0,t.initialBalance=e.initialBalance??"",t.balance=e.balance??"",t.unbondingId=e.unbondingId??0,t.unbondingOnHoldRefCount=e.unbondingOnHoldRefCount??0,t}};function createBaseRedelegationEntry(){return{creationHeight:0,completionTime:void 0,initialBalance:"",sharesDst:"",unbondingId:0,unbondingOnHoldRefCount:0}}const RedelegationEntry={encode(e,t=_m0.Writer.create()){return e.creationHeight!==0&&t.uint32(8).int64(e.creationHeight),e.completionTime!==void 0&&Timestamp$2.encode(toTimestamp$2(e.completionTime),t.uint32(18).fork()).ldelim(),e.initialBalance!==""&&t.uint32(26).string(e.initialBalance),e.sharesDst!==""&&t.uint32(34).string(e.sharesDst),e.unbondingId!==0&&t.uint32(40).uint64(e.unbondingId),e.unbondingOnHoldRefCount!==0&&t.uint32(48).int64(e.unbondingOnHoldRefCount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseRedelegationEntry();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.creationHeight=longToNumber$l(n.int64());break;case 2:u.completionTime=fromTimestamp$2(Timestamp$2.decode(n,n.uint32()));break;case 3:u.initialBalance=n.string();break;case 4:u.sharesDst=n.string();break;case 5:u.unbondingId=longToNumber$l(n.uint64());break;case 6:u.unbondingOnHoldRefCount=longToNumber$l(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{creationHeight:isSet$E(e.creationHeight)?Number(e.creationHeight):0,completionTime:isSet$E(e.completionTime)?fromJsonTimestamp$2(e.completionTime):void 0,initialBalance:isSet$E(e.initialBalance)?String(e.initialBalance):"",sharesDst:isSet$E(e.sharesDst)?String(e.sharesDst):"",unbondingId:isSet$E(e.unbondingId)?Number(e.unbondingId):0,unbondingOnHoldRefCount:isSet$E(e.unbondingOnHoldRefCount)?Number(e.unbondingOnHoldRefCount):0}},toJSON(e){const t={};return e.creationHeight!==void 0&&(t.creationHeight=Math.round(e.creationHeight)),e.completionTime!==void 0&&(t.completionTime=e.completionTime.toISOString()),e.initialBalance!==void 0&&(t.initialBalance=e.initialBalance),e.sharesDst!==void 0&&(t.sharesDst=e.sharesDst),e.unbondingId!==void 0&&(t.unbondingId=Math.round(e.unbondingId)),e.unbondingOnHoldRefCount!==void 0&&(t.unbondingOnHoldRefCount=Math.round(e.unbondingOnHoldRefCount)),t},fromPartial(e){const t=createBaseRedelegationEntry();return t.creationHeight=e.creationHeight??0,t.completionTime=e.completionTime??void 0,t.initialBalance=e.initialBalance??"",t.sharesDst=e.sharesDst??"",t.unbondingId=e.unbondingId??0,t.unbondingOnHoldRefCount=e.unbondingOnHoldRefCount??0,t}};function createBaseRedelegation(){return{delegatorAddress:"",validatorSrcAddress:"",validatorDstAddress:"",entries:[]}}const Redelegation={encode(e,t=_m0.Writer.create()){e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorSrcAddress!==""&&t.uint32(18).string(e.validatorSrcAddress),e.validatorDstAddress!==""&&t.uint32(26).string(e.validatorDstAddress);for(const n of e.entries)RedelegationEntry.encode(n,t.uint32(34).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseRedelegation();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorSrcAddress=n.string();break;case 3:u.validatorDstAddress=n.string();break;case 4:u.entries.push(RedelegationEntry.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$E(e.delegatorAddress)?String(e.delegatorAddress):"",validatorSrcAddress:isSet$E(e.validatorSrcAddress)?String(e.validatorSrcAddress):"",validatorDstAddress:isSet$E(e.validatorDstAddress)?String(e.validatorDstAddress):"",entries:Array.isArray(e==null?void 0:e.entries)?e.entries.map(t=>RedelegationEntry.fromJSON(t)):[]}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorSrcAddress!==void 0&&(t.validatorSrcAddress=e.validatorSrcAddress),e.validatorDstAddress!==void 0&&(t.validatorDstAddress=e.validatorDstAddress),e.entries?t.entries=e.entries.map(n=>n?RedelegationEntry.toJSON(n):void 0):t.entries=[],t},fromPartial(e){var n;const t=createBaseRedelegation();return t.delegatorAddress=e.delegatorAddress??"",t.validatorSrcAddress=e.validatorSrcAddress??"",t.validatorDstAddress=e.validatorDstAddress??"",t.entries=((n=e.entries)==null?void 0:n.map(p=>RedelegationEntry.fromPartial(p)))||[],t}};function createBaseParams$7(){return{unbondingTime:void 0,maxValidators:0,maxEntries:0,historicalEntries:0,bondDenom:"",minCommissionRate:""}}const Params$7={encode(e,t=_m0.Writer.create()){return e.unbondingTime!==void 0&&Duration.encode(e.unbondingTime,t.uint32(10).fork()).ldelim(),e.maxValidators!==0&&t.uint32(16).uint32(e.maxValidators),e.maxEntries!==0&&t.uint32(24).uint32(e.maxEntries),e.historicalEntries!==0&&t.uint32(32).uint32(e.historicalEntries),e.bondDenom!==""&&t.uint32(42).string(e.bondDenom),e.minCommissionRate!==""&&t.uint32(50).string(e.minCommissionRate),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$7();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.unbondingTime=Duration.decode(n,n.uint32());break;case 2:u.maxValidators=n.uint32();break;case 3:u.maxEntries=n.uint32();break;case 4:u.historicalEntries=n.uint32();break;case 5:u.bondDenom=n.string();break;case 6:u.minCommissionRate=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{unbondingTime:isSet$E(e.unbondingTime)?Duration.fromJSON(e.unbondingTime):void 0,maxValidators:isSet$E(e.maxValidators)?Number(e.maxValidators):0,maxEntries:isSet$E(e.maxEntries)?Number(e.maxEntries):0,historicalEntries:isSet$E(e.historicalEntries)?Number(e.historicalEntries):0,bondDenom:isSet$E(e.bondDenom)?String(e.bondDenom):"",minCommissionRate:isSet$E(e.minCommissionRate)?String(e.minCommissionRate):""}},toJSON(e){const t={};return e.unbondingTime!==void 0&&(t.unbondingTime=e.unbondingTime?Duration.toJSON(e.unbondingTime):void 0),e.maxValidators!==void 0&&(t.maxValidators=Math.round(e.maxValidators)),e.maxEntries!==void 0&&(t.maxEntries=Math.round(e.maxEntries)),e.historicalEntries!==void 0&&(t.historicalEntries=Math.round(e.historicalEntries)),e.bondDenom!==void 0&&(t.bondDenom=e.bondDenom),e.minCommissionRate!==void 0&&(t.minCommissionRate=e.minCommissionRate),t},fromPartial(e){const t=createBaseParams$7();return t.unbondingTime=e.unbondingTime!==void 0&&e.unbondingTime!==null?Duration.fromPartial(e.unbondingTime):void 0,t.maxValidators=e.maxValidators??0,t.maxEntries=e.maxEntries??0,t.historicalEntries=e.historicalEntries??0,t.bondDenom=e.bondDenom??"",t.minCommissionRate=e.minCommissionRate??"",t}};function createBaseDelegationResponse(){return{delegation:void 0,balance:void 0}}const DelegationResponse={encode(e,t=_m0.Writer.create()){return e.delegation!==void 0&&Delegation.encode(e.delegation,t.uint32(10).fork()).ldelim(),e.balance!==void 0&&Coin$4.encode(e.balance,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDelegationResponse();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegation=Delegation.decode(n,n.uint32());break;case 2:u.balance=Coin$4.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegation:isSet$E(e.delegation)?Delegation.fromJSON(e.delegation):void 0,balance:isSet$E(e.balance)?Coin$4.fromJSON(e.balance):void 0}},toJSON(e){const t={};return e.delegation!==void 0&&(t.delegation=e.delegation?Delegation.toJSON(e.delegation):void 0),e.balance!==void 0&&(t.balance=e.balance?Coin$4.toJSON(e.balance):void 0),t},fromPartial(e){const t=createBaseDelegationResponse();return t.delegation=e.delegation!==void 0&&e.delegation!==null?Delegation.fromPartial(e.delegation):void 0,t.balance=e.balance!==void 0&&e.balance!==null?Coin$4.fromPartial(e.balance):void 0,t}};function createBaseRedelegationEntryResponse(){return{redelegationEntry:void 0,balance:""}}const RedelegationEntryResponse={encode(e,t=_m0.Writer.create()){return e.redelegationEntry!==void 0&&RedelegationEntry.encode(e.redelegationEntry,t.uint32(10).fork()).ldelim(),e.balance!==""&&t.uint32(34).string(e.balance),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseRedelegationEntryResponse();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.redelegationEntry=RedelegationEntry.decode(n,n.uint32());break;case 4:u.balance=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{redelegationEntry:isSet$E(e.redelegationEntry)?RedelegationEntry.fromJSON(e.redelegationEntry):void 0,balance:isSet$E(e.balance)?String(e.balance):""}},toJSON(e){const t={};return e.redelegationEntry!==void 0&&(t.redelegationEntry=e.redelegationEntry?RedelegationEntry.toJSON(e.redelegationEntry):void 0),e.balance!==void 0&&(t.balance=e.balance),t},fromPartial(e){const t=createBaseRedelegationEntryResponse();return t.redelegationEntry=e.redelegationEntry!==void 0&&e.redelegationEntry!==null?RedelegationEntry.fromPartial(e.redelegationEntry):void 0,t.balance=e.balance??"",t}};function createBaseRedelegationResponse(){return{redelegation:void 0,entries:[]}}const RedelegationResponse={encode(e,t=_m0.Writer.create()){e.redelegation!==void 0&&Redelegation.encode(e.redelegation,t.uint32(10).fork()).ldelim();for(const n of e.entries)RedelegationEntryResponse.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseRedelegationResponse();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.redelegation=Redelegation.decode(n,n.uint32());break;case 2:u.entries.push(RedelegationEntryResponse.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{redelegation:isSet$E(e.redelegation)?Redelegation.fromJSON(e.redelegation):void 0,entries:Array.isArray(e==null?void 0:e.entries)?e.entries.map(t=>RedelegationEntryResponse.fromJSON(t)):[]}},toJSON(e){const t={};return e.redelegation!==void 0&&(t.redelegation=e.redelegation?Redelegation.toJSON(e.redelegation):void 0),e.entries?t.entries=e.entries.map(n=>n?RedelegationEntryResponse.toJSON(n):void 0):t.entries=[],t},fromPartial(e){var n;const t=createBaseRedelegationResponse();return t.redelegation=e.redelegation!==void 0&&e.redelegation!==null?Redelegation.fromPartial(e.redelegation):void 0,t.entries=((n=e.entries)==null?void 0:n.map(p=>RedelegationEntryResponse.fromPartial(p)))||[],t}};function createBasePool(){return{notBondedTokens:"",bondedTokens:""}}const Pool={encode(e,t=_m0.Writer.create()){return e.notBondedTokens!==""&&t.uint32(10).string(e.notBondedTokens),e.bondedTokens!==""&&t.uint32(18).string(e.bondedTokens),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePool();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.notBondedTokens=n.string();break;case 2:u.bondedTokens=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{notBondedTokens:isSet$E(e.notBondedTokens)?String(e.notBondedTokens):"",bondedTokens:isSet$E(e.bondedTokens)?String(e.bondedTokens):""}},toJSON(e){const t={};return e.notBondedTokens!==void 0&&(t.notBondedTokens=e.notBondedTokens),e.bondedTokens!==void 0&&(t.bondedTokens=e.bondedTokens),t},fromPartial(e){const t=createBasePool();return t.notBondedTokens=e.notBondedTokens??"",t.bondedTokens=e.bondedTokens??"",t}};function createBaseValidatorUpdates(){return{updates:[]}}const ValidatorUpdates={encode(e,t=_m0.Writer.create()){for(const n of e.updates)ValidatorUpdate.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorUpdates();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.updates.push(ValidatorUpdate.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{updates:Array.isArray(e==null?void 0:e.updates)?e.updates.map(t=>ValidatorUpdate.fromJSON(t)):[]}},toJSON(e){const t={};return e.updates?t.updates=e.updates.map(n=>n?ValidatorUpdate.toJSON(n):void 0):t.updates=[],t},fromPartial(e){var n;const t=createBaseValidatorUpdates();return t.updates=((n=e.updates)==null?void 0:n.map(p=>ValidatorUpdate.fromPartial(p)))||[],t}};var globalThis$B=(()=>{if(typeof globalThis$B<"u")return globalThis$B;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function toTimestamp$2(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$2(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$2(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$2(Timestamp$2.fromJSON(e))}function longToNumber$l(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$B.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$E(e){return e!=null}function createBaseMsgCreateValidator(){return{description:void 0,commission:void 0,minSelfDelegation:"",delegatorAddress:"",validatorAddress:"",pubkey:void 0,value:void 0}}const MsgCreateValidator={encode(e,t=_m0.Writer.create()){return e.description!==void 0&&Description.encode(e.description,t.uint32(10).fork()).ldelim(),e.commission!==void 0&&CommissionRates.encode(e.commission,t.uint32(18).fork()).ldelim(),e.minSelfDelegation!==""&&t.uint32(26).string(e.minSelfDelegation),e.delegatorAddress!==""&&t.uint32(34).string(e.delegatorAddress),e.validatorAddress!==""&&t.uint32(42).string(e.validatorAddress),e.pubkey!==void 0&&Any$4.encode(e.pubkey,t.uint32(50).fork()).ldelim(),e.value!==void 0&&Coin$4.encode(e.value,t.uint32(58).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgCreateValidator();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.description=Description.decode(n,n.uint32());break;case 2:u.commission=CommissionRates.decode(n,n.uint32());break;case 3:u.minSelfDelegation=n.string();break;case 4:u.delegatorAddress=n.string();break;case 5:u.validatorAddress=n.string();break;case 6:u.pubkey=Any$4.decode(n,n.uint32());break;case 7:u.value=Coin$4.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{description:isSet$D(e.description)?Description.fromJSON(e.description):void 0,commission:isSet$D(e.commission)?CommissionRates.fromJSON(e.commission):void 0,minSelfDelegation:isSet$D(e.minSelfDelegation)?String(e.minSelfDelegation):"",delegatorAddress:isSet$D(e.delegatorAddress)?String(e.delegatorAddress):"",validatorAddress:isSet$D(e.validatorAddress)?String(e.validatorAddress):"",pubkey:isSet$D(e.pubkey)?Any$4.fromJSON(e.pubkey):void 0,value:isSet$D(e.value)?Coin$4.fromJSON(e.value):void 0}},toJSON(e){const t={};return e.description!==void 0&&(t.description=e.description?Description.toJSON(e.description):void 0),e.commission!==void 0&&(t.commission=e.commission?CommissionRates.toJSON(e.commission):void 0),e.minSelfDelegation!==void 0&&(t.minSelfDelegation=e.minSelfDelegation),e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.pubkey!==void 0&&(t.pubkey=e.pubkey?Any$4.toJSON(e.pubkey):void 0),e.value!==void 0&&(t.value=e.value?Coin$4.toJSON(e.value):void 0),t},fromPartial(e){const t=createBaseMsgCreateValidator();return t.description=e.description!==void 0&&e.description!==null?Description.fromPartial(e.description):void 0,t.commission=e.commission!==void 0&&e.commission!==null?CommissionRates.fromPartial(e.commission):void 0,t.minSelfDelegation=e.minSelfDelegation??"",t.delegatorAddress=e.delegatorAddress??"",t.validatorAddress=e.validatorAddress??"",t.pubkey=e.pubkey!==void 0&&e.pubkey!==null?Any$4.fromPartial(e.pubkey):void 0,t.value=e.value!==void 0&&e.value!==null?Coin$4.fromPartial(e.value):void 0,t}};function createBaseMsgEditValidator(){return{description:void 0,validatorAddress:"",commissionRate:"",minSelfDelegation:""}}const MsgEditValidator={encode(e,t=_m0.Writer.create()){return e.description!==void 0&&Description.encode(e.description,t.uint32(10).fork()).ldelim(),e.validatorAddress!==""&&t.uint32(18).string(e.validatorAddress),e.commissionRate!==""&&t.uint32(26).string(e.commissionRate),e.minSelfDelegation!==""&&t.uint32(34).string(e.minSelfDelegation),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgEditValidator();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.description=Description.decode(n,n.uint32());break;case 2:u.validatorAddress=n.string();break;case 3:u.commissionRate=n.string();break;case 4:u.minSelfDelegation=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{description:isSet$D(e.description)?Description.fromJSON(e.description):void 0,validatorAddress:isSet$D(e.validatorAddress)?String(e.validatorAddress):"",commissionRate:isSet$D(e.commissionRate)?String(e.commissionRate):"",minSelfDelegation:isSet$D(e.minSelfDelegation)?String(e.minSelfDelegation):""}},toJSON(e){const t={};return e.description!==void 0&&(t.description=e.description?Description.toJSON(e.description):void 0),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.commissionRate!==void 0&&(t.commissionRate=e.commissionRate),e.minSelfDelegation!==void 0&&(t.minSelfDelegation=e.minSelfDelegation),t},fromPartial(e){const t=createBaseMsgEditValidator();return t.description=e.description!==void 0&&e.description!==null?Description.fromPartial(e.description):void 0,t.validatorAddress=e.validatorAddress??"",t.commissionRate=e.commissionRate??"",t.minSelfDelegation=e.minSelfDelegation??"",t}};function createBaseMsgDelegate(){return{delegatorAddress:"",validatorAddress:"",amount:void 0}}const MsgDelegate={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==""&&t.uint32(18).string(e.validatorAddress),e.amount!==void 0&&Coin$4.encode(e.amount,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgDelegate();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorAddress=n.string();break;case 3:u.amount=Coin$4.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$D(e.delegatorAddress)?String(e.delegatorAddress):"",validatorAddress:isSet$D(e.validatorAddress)?String(e.validatorAddress):"",amount:isSet$D(e.amount)?Coin$4.fromJSON(e.amount):void 0}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.amount!==void 0&&(t.amount=e.amount?Coin$4.toJSON(e.amount):void 0),t},fromPartial(e){const t=createBaseMsgDelegate();return t.delegatorAddress=e.delegatorAddress??"",t.validatorAddress=e.validatorAddress??"",t.amount=e.amount!==void 0&&e.amount!==null?Coin$4.fromPartial(e.amount):void 0,t}};function createBaseMsgBeginRedelegate(){return{delegatorAddress:"",validatorSrcAddress:"",validatorDstAddress:"",amount:void 0}}const MsgBeginRedelegate={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorSrcAddress!==""&&t.uint32(18).string(e.validatorSrcAddress),e.validatorDstAddress!==""&&t.uint32(26).string(e.validatorDstAddress),e.amount!==void 0&&Coin$4.encode(e.amount,t.uint32(34).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgBeginRedelegate();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorSrcAddress=n.string();break;case 3:u.validatorDstAddress=n.string();break;case 4:u.amount=Coin$4.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$D(e.delegatorAddress)?String(e.delegatorAddress):"",validatorSrcAddress:isSet$D(e.validatorSrcAddress)?String(e.validatorSrcAddress):"",validatorDstAddress:isSet$D(e.validatorDstAddress)?String(e.validatorDstAddress):"",amount:isSet$D(e.amount)?Coin$4.fromJSON(e.amount):void 0}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorSrcAddress!==void 0&&(t.validatorSrcAddress=e.validatorSrcAddress),e.validatorDstAddress!==void 0&&(t.validatorDstAddress=e.validatorDstAddress),e.amount!==void 0&&(t.amount=e.amount?Coin$4.toJSON(e.amount):void 0),t},fromPartial(e){const t=createBaseMsgBeginRedelegate();return t.delegatorAddress=e.delegatorAddress??"",t.validatorSrcAddress=e.validatorSrcAddress??"",t.validatorDstAddress=e.validatorDstAddress??"",t.amount=e.amount!==void 0&&e.amount!==null?Coin$4.fromPartial(e.amount):void 0,t}};function createBaseMsgUndelegate(){return{delegatorAddress:"",validatorAddress:"",amount:void 0}}const MsgUndelegate={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==""&&t.uint32(18).string(e.validatorAddress),e.amount!==void 0&&Coin$4.encode(e.amount,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUndelegate();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorAddress=n.string();break;case 3:u.amount=Coin$4.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$D(e.delegatorAddress)?String(e.delegatorAddress):"",validatorAddress:isSet$D(e.validatorAddress)?String(e.validatorAddress):"",amount:isSet$D(e.amount)?Coin$4.fromJSON(e.amount):void 0}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.amount!==void 0&&(t.amount=e.amount?Coin$4.toJSON(e.amount):void 0),t},fromPartial(e){const t=createBaseMsgUndelegate();return t.delegatorAddress=e.delegatorAddress??"",t.validatorAddress=e.validatorAddress??"",t.amount=e.amount!==void 0&&e.amount!==null?Coin$4.fromPartial(e.amount):void 0,t}};function createBaseMsgCancelUnbondingDelegation(){return{delegatorAddress:"",validatorAddress:"",amount:void 0,creationHeight:0}}const MsgCancelUnbondingDelegation={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==""&&t.uint32(18).string(e.validatorAddress),e.amount!==void 0&&Coin$4.encode(e.amount,t.uint32(26).fork()).ldelim(),e.creationHeight!==0&&t.uint32(32).int64(e.creationHeight),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgCancelUnbondingDelegation();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorAddress=n.string();break;case 3:u.amount=Coin$4.decode(n,n.uint32());break;case 4:u.creationHeight=longToNumber$k(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$D(e.delegatorAddress)?String(e.delegatorAddress):"",validatorAddress:isSet$D(e.validatorAddress)?String(e.validatorAddress):"",amount:isSet$D(e.amount)?Coin$4.fromJSON(e.amount):void 0,creationHeight:isSet$D(e.creationHeight)?Number(e.creationHeight):0}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.amount!==void 0&&(t.amount=e.amount?Coin$4.toJSON(e.amount):void 0),e.creationHeight!==void 0&&(t.creationHeight=Math.round(e.creationHeight)),t},fromPartial(e){const t=createBaseMsgCancelUnbondingDelegation();return t.delegatorAddress=e.delegatorAddress??"",t.validatorAddress=e.validatorAddress??"",t.amount=e.amount!==void 0&&e.amount!==null?Coin$4.fromPartial(e.amount):void 0,t.creationHeight=e.creationHeight??0,t}};var globalThis$A=(()=>{if(typeof globalThis$A<"u")return globalThis$A;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$k(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$A.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$D(e){return e!=null}const msgTypes$b=[["/cosmos.staking.v1beta1.MsgCreateValidator",MsgCreateValidator],["/cosmos.staking.v1beta1.MsgBeginRedelegate",MsgBeginRedelegate],["/cosmos.staking.v1beta1.MsgDelegate",MsgDelegate],["/cosmos.staking.v1beta1.MsgEditValidator",MsgEditValidator],["/cosmos.staking.v1beta1.MsgUndelegate",MsgUndelegate],["/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation",MsgCancelUnbondingDelegation]];let HttpClient$b=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$b=class extends HttpClient$b{constructor(){super(...arguments),this.queryDelegatorDelegations=(t,n,p={})=>this.request({path:`/cosmos/staking/v1beta1/delegations/${t}`,method:"GET",query:n,format:"json",...p}),this.queryRedelegations=(t,n,p={})=>this.request({path:`/cosmos/staking/v1beta1/delegators/${t}/redelegations`,method:"GET",query:n,format:"json",...p}),this.queryDelegatorUnbondingDelegations=(t,n,p={})=>this.request({path:`/cosmos/staking/v1beta1/delegators/${t}/unbonding_delegations`,method:"GET",query:n,format:"json",...p}),this.queryDelegatorValidators=(t,n,p={})=>this.request({path:`/cosmos/staking/v1beta1/delegators/${t}/validators`,method:"GET",query:n,format:"json",...p}),this.queryDelegatorValidator=(t,n,p={})=>this.request({path:`/cosmos/staking/v1beta1/delegators/${t}/validators/${n}`,method:"GET",format:"json",...p}),this.queryHistoricalInfo=(t,n={})=>this.request({path:`/cosmos/staking/v1beta1/historical_info/${t}`,method:"GET",format:"json",...n}),this.queryParams=(t={})=>this.request({path:"/cosmos/staking/v1beta1/params",method:"GET",format:"json",...t}),this.queryPool=(t={})=>this.request({path:"/cosmos/staking/v1beta1/pool",method:"GET",format:"json",...t}),this.queryValidators=(t,n={})=>this.request({path:"/cosmos/staking/v1beta1/validators",method:"GET",query:t,format:"json",...n}),this.queryValidator=(t,n={})=>this.request({path:`/cosmos/staking/v1beta1/validators/${t}`,method:"GET",format:"json",...n}),this.queryValidatorDelegations=(t,n,p={})=>this.request({path:`/cosmos/staking/v1beta1/validators/${t}/delegations`,method:"GET",query:n,format:"json",...p}),this.queryDelegation=(t,n,p={})=>this.request({path:`/cosmos/staking/v1beta1/validators/${t}/delegations/${n}`,method:"GET",format:"json",...p}),this.queryUnbondingDelegation=(t,n,p={})=>this.request({path:`/cosmos/staking/v1beta1/validators/${t}/delegations/${n}/unbonding_delegation`,method:"GET",format:"json",...p}),this.queryValidatorUnbondingDelegations=(t,n,p={})=>this.request({path:`/cosmos/staking/v1beta1/validators/${t}/unbonding_delegations`,method:"GET",query:n,format:"json",...p})}};function authorizationTypeFromJSON(e){switch(e){case 0:case"AUTHORIZATION_TYPE_UNSPECIFIED":return 0;case 1:case"AUTHORIZATION_TYPE_DELEGATE":return 1;case 2:case"AUTHORIZATION_TYPE_UNDELEGATE":return 2;case 3:case"AUTHORIZATION_TYPE_REDELEGATE":return 3;case-1:case"UNRECOGNIZED":default:return-1}}function authorizationTypeToJSON(e){switch(e){case 0:return"AUTHORIZATION_TYPE_UNSPECIFIED";case 1:return"AUTHORIZATION_TYPE_DELEGATE";case 2:return"AUTHORIZATION_TYPE_UNDELEGATE";case 3:return"AUTHORIZATION_TYPE_REDELEGATE";case-1:default:return"UNRECOGNIZED"}}function createBaseStakeAuthorization(){return{maxTokens:void 0,allowList:void 0,denyList:void 0,authorizationType:0}}const StakeAuthorization={encode(e,t=_m0.Writer.create()){return e.maxTokens!==void 0&&Coin$4.encode(e.maxTokens,t.uint32(10).fork()).ldelim(),e.allowList!==void 0&&StakeAuthorization_Validators.encode(e.allowList,t.uint32(18).fork()).ldelim(),e.denyList!==void 0&&StakeAuthorization_Validators.encode(e.denyList,t.uint32(26).fork()).ldelim(),e.authorizationType!==0&&t.uint32(32).int32(e.authorizationType),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseStakeAuthorization();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.maxTokens=Coin$4.decode(n,n.uint32());break;case 2:u.allowList=StakeAuthorization_Validators.decode(n,n.uint32());break;case 3:u.denyList=StakeAuthorization_Validators.decode(n,n.uint32());break;case 4:u.authorizationType=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{maxTokens:isSet$C(e.maxTokens)?Coin$4.fromJSON(e.maxTokens):void 0,allowList:isSet$C(e.allowList)?StakeAuthorization_Validators.fromJSON(e.allowList):void 0,denyList:isSet$C(e.denyList)?StakeAuthorization_Validators.fromJSON(e.denyList):void 0,authorizationType:isSet$C(e.authorizationType)?authorizationTypeFromJSON(e.authorizationType):0}},toJSON(e){const t={};return e.maxTokens!==void 0&&(t.maxTokens=e.maxTokens?Coin$4.toJSON(e.maxTokens):void 0),e.allowList!==void 0&&(t.allowList=e.allowList?StakeAuthorization_Validators.toJSON(e.allowList):void 0),e.denyList!==void 0&&(t.denyList=e.denyList?StakeAuthorization_Validators.toJSON(e.denyList):void 0),e.authorizationType!==void 0&&(t.authorizationType=authorizationTypeToJSON(e.authorizationType)),t},fromPartial(e){const t=createBaseStakeAuthorization();return t.maxTokens=e.maxTokens!==void 0&&e.maxTokens!==null?Coin$4.fromPartial(e.maxTokens):void 0,t.allowList=e.allowList!==void 0&&e.allowList!==null?StakeAuthorization_Validators.fromPartial(e.allowList):void 0,t.denyList=e.denyList!==void 0&&e.denyList!==null?StakeAuthorization_Validators.fromPartial(e.denyList):void 0,t.authorizationType=e.authorizationType??0,t}};function createBaseStakeAuthorization_Validators(){return{address:[]}}const StakeAuthorization_Validators={encode(e,t=_m0.Writer.create()){for(const n of e.address)t.uint32(10).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseStakeAuthorization_Validators();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:Array.isArray(e==null?void 0:e.address)?e.address.map(t=>String(t)):[]}},toJSON(e){const t={};return e.address?t.address=e.address.map(n=>n):t.address=[],t},fromPartial(e){var n;const t=createBaseStakeAuthorization_Validators();return t.address=((n=e.address)==null?void 0:n.map(p=>p))||[],t}};function isSet$C(e){return e!=null}function createBaseLastValidatorPower(){return{address:"",power:0}}const LastValidatorPower={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.power!==0&&t.uint32(16).int64(e.power),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseLastValidatorPower();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.power=longToNumber$j(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$B(e.address)?String(e.address):"",power:isSet$B(e.power)?Number(e.power):0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.power!==void 0&&(t.power=Math.round(e.power)),t},fromPartial(e){const t=createBaseLastValidatorPower();return t.address=e.address??"",t.power=e.power??0,t}};var globalThis$z=(()=>{if(typeof globalThis$z<"u")return globalThis$z;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$j(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$z.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$B(e){return e!=null}const registry$5=new build$b.Registry(msgTypes$b);function getStructure$b(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$4={amount:[],gas:"200000"},txClient$b=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgCreateValidator({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgCreateValidator: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$5,prefix:t});let N=this.msgCreateValidator({value:MsgCreateValidator.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$4,g)}catch(y){throw new Error("TxClient:sendMsgCreateValidator: Could not broadcast Tx: "+y.message)}},async sendMsgBeginRedelegate({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgBeginRedelegate: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$5,prefix:t});let N=this.msgBeginRedelegate({value:MsgBeginRedelegate.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$4,g)}catch(y){throw new Error("TxClient:sendMsgBeginRedelegate: Could not broadcast Tx: "+y.message)}},async sendMsgDelegate({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgDelegate: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$5,prefix:t});let N=this.msgDelegate({value:MsgDelegate.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$4,g)}catch(y){throw new Error("TxClient:sendMsgDelegate: Could not broadcast Tx: "+y.message)}},async sendMsgEditValidator({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgEditValidator: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$5,prefix:t});let N=this.msgEditValidator({value:MsgEditValidator.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$4,g)}catch(y){throw new Error("TxClient:sendMsgEditValidator: Could not broadcast Tx: "+y.message)}},async sendMsgUndelegate({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUndelegate: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$5,prefix:t});let N=this.msgUndelegate({value:MsgUndelegate.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$4,g)}catch(y){throw new Error("TxClient:sendMsgUndelegate: Could not broadcast Tx: "+y.message)}},async sendMsgCancelUnbondingDelegation({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgCancelUnbondingDelegation: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$5,prefix:t});let N=this.msgCancelUnbondingDelegation({value:MsgCancelUnbondingDelegation.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$4,g)}catch(y){throw new Error("TxClient:sendMsgCancelUnbondingDelegation: Could not broadcast Tx: "+y.message)}},msgCreateValidator({value:p}){try{return{typeUrl:"/cosmos.staking.v1beta1.MsgCreateValidator",value:MsgCreateValidator.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgCreateValidator: Could not create message: "+u.message)}},msgBeginRedelegate({value:p}){try{return{typeUrl:"/cosmos.staking.v1beta1.MsgBeginRedelegate",value:MsgBeginRedelegate.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgBeginRedelegate: Could not create message: "+u.message)}},msgDelegate({value:p}){try{return{typeUrl:"/cosmos.staking.v1beta1.MsgDelegate",value:MsgDelegate.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgDelegate: Could not create message: "+u.message)}},msgEditValidator({value:p}){try{return{typeUrl:"/cosmos.staking.v1beta1.MsgEditValidator",value:MsgEditValidator.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgEditValidator: Could not create message: "+u.message)}},msgUndelegate({value:p}){try{return{typeUrl:"/cosmos.staking.v1beta1.MsgUndelegate",value:MsgUndelegate.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUndelegate: Could not create message: "+u.message)}},msgCancelUnbondingDelegation({value:p}){try{return{typeUrl:"/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation",value:MsgCancelUnbondingDelegation.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgCancelUnbondingDelegation: Could not create message: "+u.message)}}}),queryClient$b=({addr:e}={addr:"http://localhost:1317"})=>new Api$b({baseURL:e});let SDKModule$b=class{constructor(t){this.registry=[],this.query=queryClient$b({addr:t.env.apiURL}),this.updateTX(t),this.structure={StakeAuthorization:getStructure$b(StakeAuthorization.fromPartial({})),StakeAuthorization_Validators:getStructure$b(StakeAuthorization_Validators.fromPartial({})),LastValidatorPower:getStructure$b(LastValidatorPower.fromPartial({})),HistoricalInfo:getStructure$b(HistoricalInfo.fromPartial({})),CommissionRates:getStructure$b(CommissionRates.fromPartial({})),Commission:getStructure$b(Commission.fromPartial({})),Description:getStructure$b(Description.fromPartial({})),Validator:getStructure$b(Validator.fromPartial({})),ValAddresses:getStructure$b(ValAddresses.fromPartial({})),DVPair:getStructure$b(DVPair.fromPartial({})),DVPairs:getStructure$b(DVPairs.fromPartial({})),DVVTriplet:getStructure$b(DVVTriplet.fromPartial({})),DVVTriplets:getStructure$b(DVVTriplets.fromPartial({})),Delegation:getStructure$b(Delegation.fromPartial({})),UnbondingDelegation:getStructure$b(UnbondingDelegation.fromPartial({})),UnbondingDelegationEntry:getStructure$b(UnbondingDelegationEntry.fromPartial({})),RedelegationEntry:getStructure$b(RedelegationEntry.fromPartial({})),Redelegation:getStructure$b(Redelegation.fromPartial({})),Params:getStructure$b(Params$7.fromPartial({})),DelegationResponse:getStructure$b(DelegationResponse.fromPartial({})),RedelegationEntryResponse:getStructure$b(RedelegationEntryResponse.fromPartial({})),RedelegationResponse:getStructure$b(RedelegationResponse.fromPartial({})),Pool:getStructure$b(Pool.fromPartial({})),ValidatorUpdates:getStructure$b(ValidatorUpdates.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$b({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$b=e=>({module:{CosmosStakingV1Beta1:new SDKModule$b(e)},registry:msgTypes$b}),module=Object.freeze(Object.defineProperty({__proto__:null,MsgBeginRedelegate,MsgCancelUnbondingDelegation,MsgCreateValidator,MsgDelegate,MsgEditValidator,MsgUndelegate,default:Module$b,queryClient:queryClient$b,registry:registry$5,txClient:txClient$b},Symbol.toStringTag,{value:"Module"})),msgTypes$a=[];let HttpClient$a=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$a=class extends HttpClient$a{constructor(){super(...arguments),this.serviceTxDecode=(t,n={})=>this.request({path:"/cosmos/tx/v1beta1/decode",method:"POST",body:t,type:"application/json",format:"json",...n}),this.serviceTxDecodeAmino=(t,n={})=>this.request({path:"/cosmos/tx/v1beta1/decode/amino",method:"POST",body:t,type:"application/json",format:"json",...n}),this.serviceTxEncode=(t,n={})=>this.request({path:"/cosmos/tx/v1beta1/encode",method:"POST",body:t,type:"application/json",format:"json",...n}),this.serviceTxEncodeAmino=(t,n={})=>this.request({path:"/cosmos/tx/v1beta1/encode/amino",method:"POST",body:t,type:"application/json",format:"json",...n}),this.serviceSimulate=(t,n={})=>this.request({path:"/cosmos/tx/v1beta1/simulate",method:"POST",body:t,type:"application/json",format:"json",...n}),this.serviceGetTxsEvent=(t,n={})=>this.request({path:"/cosmos/tx/v1beta1/txs",method:"GET",query:t,format:"json",...n}),this.serviceBroadcastTx=(t,n={})=>this.request({path:"/cosmos/tx/v1beta1/txs",method:"POST",body:t,type:"application/json",format:"json",...n}),this.serviceGetBlockWithTxs=(t,n,p={})=>this.request({path:`/cosmos/tx/v1beta1/txs/block/${t}`,method:"GET",query:n,format:"json",...p}),this.serviceGetTx=(t,n={})=>this.request({path:`/cosmos/tx/v1beta1/txs/${t}`,method:"GET",format:"json",...n})}};function createBaseAny$3(){return{typeUrl:"",value:new Uint8Array}}const Any$3={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$3();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$A(e.typeUrl)?String(e.typeUrl):"",value:isSet$A(e.value)?bytesFromBase64$c(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$c(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$3();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$y=(()=>{if(typeof globalThis$y<"u")return globalThis$y;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$c(e){if(globalThis$y.Buffer)return Uint8Array.from(globalThis$y.Buffer.from(e,"base64"));{const t=globalThis$y.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$c(e){if(globalThis$y.Buffer)return globalThis$y.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$y.btoa(t.join(""))}}function isSet$A(e){return e!=null}function createBaseCoin$3(){return{denom:"",amount:""}}const Coin$3={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin$3();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$z(e.denom)?String(e.denom):"",amount:isSet$z(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin$3();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$z(e){return e!=null}function createBaseCompactBitArray(){return{extraBitsStored:0,elems:new Uint8Array}}const CompactBitArray={encode(e,t=_m0.Writer.create()){return e.extraBitsStored!==0&&t.uint32(8).uint32(e.extraBitsStored),e.elems.length!==0&&t.uint32(18).bytes(e.elems),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCompactBitArray();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.extraBitsStored=n.uint32();break;case 2:u.elems=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{extraBitsStored:isSet$y(e.extraBitsStored)?Number(e.extraBitsStored):0,elems:isSet$y(e.elems)?bytesFromBase64$b(e.elems):new Uint8Array}},toJSON(e){const t={};return e.extraBitsStored!==void 0&&(t.extraBitsStored=Math.round(e.extraBitsStored)),e.elems!==void 0&&(t.elems=base64FromBytes$b(e.elems!==void 0?e.elems:new Uint8Array)),t},fromPartial(e){const t=createBaseCompactBitArray();return t.extraBitsStored=e.extraBitsStored??0,t.elems=e.elems??new Uint8Array,t}};var globalThis$x=(()=>{if(typeof globalThis$x<"u")return globalThis$x;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$b(e){if(globalThis$x.Buffer)return Uint8Array.from(globalThis$x.Buffer.from(e,"base64"));{const t=globalThis$x.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$b(e){if(globalThis$x.Buffer)return globalThis$x.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$x.btoa(t.join(""))}}function isSet$y(e){return e!=null}function signModeFromJSON(e){switch(e){case 0:case"SIGN_MODE_UNSPECIFIED":return 0;case 1:case"SIGN_MODE_DIRECT":return 1;case 2:case"SIGN_MODE_TEXTUAL":return 2;case 3:case"SIGN_MODE_DIRECT_AUX":return 3;case 127:case"SIGN_MODE_LEGACY_AMINO_JSON":return 127;case 191:case"SIGN_MODE_EIP_191":return 191;case-1:case"UNRECOGNIZED":default:return-1}}function signModeToJSON(e){switch(e){case 0:return"SIGN_MODE_UNSPECIFIED";case 1:return"SIGN_MODE_DIRECT";case 2:return"SIGN_MODE_TEXTUAL";case 3:return"SIGN_MODE_DIRECT_AUX";case 127:return"SIGN_MODE_LEGACY_AMINO_JSON";case 191:return"SIGN_MODE_EIP_191";case-1:default:return"UNRECOGNIZED"}}var globalThis$w=(()=>{if(typeof globalThis$w<"u")return globalThis$w;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function createBaseTx(){return{body:void 0,authInfo:void 0,signatures:[]}}const Tx={encode(e,t=_m0.Writer.create()){e.body!==void 0&&TxBody.encode(e.body,t.uint32(10).fork()).ldelim(),e.authInfo!==void 0&&AuthInfo.encode(e.authInfo,t.uint32(18).fork()).ldelim();for(const n of e.signatures)t.uint32(26).bytes(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTx();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.body=TxBody.decode(n,n.uint32());break;case 2:u.authInfo=AuthInfo.decode(n,n.uint32());break;case 3:u.signatures.push(n.bytes());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{body:isSet$x(e.body)?TxBody.fromJSON(e.body):void 0,authInfo:isSet$x(e.authInfo)?AuthInfo.fromJSON(e.authInfo):void 0,signatures:Array.isArray(e==null?void 0:e.signatures)?e.signatures.map(t=>bytesFromBase64$a(t)):[]}},toJSON(e){const t={};return e.body!==void 0&&(t.body=e.body?TxBody.toJSON(e.body):void 0),e.authInfo!==void 0&&(t.authInfo=e.authInfo?AuthInfo.toJSON(e.authInfo):void 0),e.signatures?t.signatures=e.signatures.map(n=>base64FromBytes$a(n!==void 0?n:new Uint8Array)):t.signatures=[],t},fromPartial(e){var n;const t=createBaseTx();return t.body=e.body!==void 0&&e.body!==null?TxBody.fromPartial(e.body):void 0,t.authInfo=e.authInfo!==void 0&&e.authInfo!==null?AuthInfo.fromPartial(e.authInfo):void 0,t.signatures=((n=e.signatures)==null?void 0:n.map(p=>p))||[],t}};function createBaseTxRaw(){return{bodyBytes:new Uint8Array,authInfoBytes:new Uint8Array,signatures:[]}}const TxRaw={encode(e,t=_m0.Writer.create()){e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&t.uint32(18).bytes(e.authInfoBytes);for(const n of e.signatures)t.uint32(26).bytes(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTxRaw();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.bodyBytes=n.bytes();break;case 2:u.authInfoBytes=n.bytes();break;case 3:u.signatures.push(n.bytes());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{bodyBytes:isSet$x(e.bodyBytes)?bytesFromBase64$a(e.bodyBytes):new Uint8Array,authInfoBytes:isSet$x(e.authInfoBytes)?bytesFromBase64$a(e.authInfoBytes):new Uint8Array,signatures:Array.isArray(e==null?void 0:e.signatures)?e.signatures.map(t=>bytesFromBase64$a(t)):[]}},toJSON(e){const t={};return e.bodyBytes!==void 0&&(t.bodyBytes=base64FromBytes$a(e.bodyBytes!==void 0?e.bodyBytes:new Uint8Array)),e.authInfoBytes!==void 0&&(t.authInfoBytes=base64FromBytes$a(e.authInfoBytes!==void 0?e.authInfoBytes:new Uint8Array)),e.signatures?t.signatures=e.signatures.map(n=>base64FromBytes$a(n!==void 0?n:new Uint8Array)):t.signatures=[],t},fromPartial(e){var n;const t=createBaseTxRaw();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.authInfoBytes=e.authInfoBytes??new Uint8Array,t.signatures=((n=e.signatures)==null?void 0:n.map(p=>p))||[],t}};function createBaseSignDoc(){return{bodyBytes:new Uint8Array,authInfoBytes:new Uint8Array,chainId:"",accountNumber:0}}const SignDoc={encode(e,t=_m0.Writer.create()){return e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&t.uint32(18).bytes(e.authInfoBytes),e.chainId!==""&&t.uint32(26).string(e.chainId),e.accountNumber!==0&&t.uint32(32).uint64(e.accountNumber),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseSignDoc();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.bodyBytes=n.bytes();break;case 2:u.authInfoBytes=n.bytes();break;case 3:u.chainId=n.string();break;case 4:u.accountNumber=longToNumber$i(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{bodyBytes:isSet$x(e.bodyBytes)?bytesFromBase64$a(e.bodyBytes):new Uint8Array,authInfoBytes:isSet$x(e.authInfoBytes)?bytesFromBase64$a(e.authInfoBytes):new Uint8Array,chainId:isSet$x(e.chainId)?String(e.chainId):"",accountNumber:isSet$x(e.accountNumber)?Number(e.accountNumber):0}},toJSON(e){const t={};return e.bodyBytes!==void 0&&(t.bodyBytes=base64FromBytes$a(e.bodyBytes!==void 0?e.bodyBytes:new Uint8Array)),e.authInfoBytes!==void 0&&(t.authInfoBytes=base64FromBytes$a(e.authInfoBytes!==void 0?e.authInfoBytes:new Uint8Array)),e.chainId!==void 0&&(t.chainId=e.chainId),e.accountNumber!==void 0&&(t.accountNumber=Math.round(e.accountNumber)),t},fromPartial(e){const t=createBaseSignDoc();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.authInfoBytes=e.authInfoBytes??new Uint8Array,t.chainId=e.chainId??"",t.accountNumber=e.accountNumber??0,t}};function createBaseSignDocDirectAux(){return{bodyBytes:new Uint8Array,publicKey:void 0,chainId:"",accountNumber:0,sequence:0,tip:void 0}}const SignDocDirectAux={encode(e,t=_m0.Writer.create()){return e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.publicKey!==void 0&&Any$3.encode(e.publicKey,t.uint32(18).fork()).ldelim(),e.chainId!==""&&t.uint32(26).string(e.chainId),e.accountNumber!==0&&t.uint32(32).uint64(e.accountNumber),e.sequence!==0&&t.uint32(40).uint64(e.sequence),e.tip!==void 0&&Tip.encode(e.tip,t.uint32(50).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseSignDocDirectAux();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.bodyBytes=n.bytes();break;case 2:u.publicKey=Any$3.decode(n,n.uint32());break;case 3:u.chainId=n.string();break;case 4:u.accountNumber=longToNumber$i(n.uint64());break;case 5:u.sequence=longToNumber$i(n.uint64());break;case 6:u.tip=Tip.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{bodyBytes:isSet$x(e.bodyBytes)?bytesFromBase64$a(e.bodyBytes):new Uint8Array,publicKey:isSet$x(e.publicKey)?Any$3.fromJSON(e.publicKey):void 0,chainId:isSet$x(e.chainId)?String(e.chainId):"",accountNumber:isSet$x(e.accountNumber)?Number(e.accountNumber):0,sequence:isSet$x(e.sequence)?Number(e.sequence):0,tip:isSet$x(e.tip)?Tip.fromJSON(e.tip):void 0}},toJSON(e){const t={};return e.bodyBytes!==void 0&&(t.bodyBytes=base64FromBytes$a(e.bodyBytes!==void 0?e.bodyBytes:new Uint8Array)),e.publicKey!==void 0&&(t.publicKey=e.publicKey?Any$3.toJSON(e.publicKey):void 0),e.chainId!==void 0&&(t.chainId=e.chainId),e.accountNumber!==void 0&&(t.accountNumber=Math.round(e.accountNumber)),e.sequence!==void 0&&(t.sequence=Math.round(e.sequence)),e.tip!==void 0&&(t.tip=e.tip?Tip.toJSON(e.tip):void 0),t},fromPartial(e){const t=createBaseSignDocDirectAux();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.publicKey=e.publicKey!==void 0&&e.publicKey!==null?Any$3.fromPartial(e.publicKey):void 0,t.chainId=e.chainId??"",t.accountNumber=e.accountNumber??0,t.sequence=e.sequence??0,t.tip=e.tip!==void 0&&e.tip!==null?Tip.fromPartial(e.tip):void 0,t}};function createBaseTxBody(){return{messages:[],memo:"",timeoutHeight:0,extensionOptions:[],nonCriticalExtensionOptions:[]}}const TxBody={encode(e,t=_m0.Writer.create()){for(const n of e.messages)Any$3.encode(n,t.uint32(10).fork()).ldelim();e.memo!==""&&t.uint32(18).string(e.memo),e.timeoutHeight!==0&&t.uint32(24).uint64(e.timeoutHeight);for(const n of e.extensionOptions)Any$3.encode(n,t.uint32(8186).fork()).ldelim();for(const n of e.nonCriticalExtensionOptions)Any$3.encode(n,t.uint32(16378).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTxBody();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.messages.push(Any$3.decode(n,n.uint32()));break;case 2:u.memo=n.string();break;case 3:u.timeoutHeight=longToNumber$i(n.uint64());break;case 1023:u.extensionOptions.push(Any$3.decode(n,n.uint32()));break;case 2047:u.nonCriticalExtensionOptions.push(Any$3.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{messages:Array.isArray(e==null?void 0:e.messages)?e.messages.map(t=>Any$3.fromJSON(t)):[],memo:isSet$x(e.memo)?String(e.memo):"",timeoutHeight:isSet$x(e.timeoutHeight)?Number(e.timeoutHeight):0,extensionOptions:Array.isArray(e==null?void 0:e.extensionOptions)?e.extensionOptions.map(t=>Any$3.fromJSON(t)):[],nonCriticalExtensionOptions:Array.isArray(e==null?void 0:e.nonCriticalExtensionOptions)?e.nonCriticalExtensionOptions.map(t=>Any$3.fromJSON(t)):[]}},toJSON(e){const t={};return e.messages?t.messages=e.messages.map(n=>n?Any$3.toJSON(n):void 0):t.messages=[],e.memo!==void 0&&(t.memo=e.memo),e.timeoutHeight!==void 0&&(t.timeoutHeight=Math.round(e.timeoutHeight)),e.extensionOptions?t.extensionOptions=e.extensionOptions.map(n=>n?Any$3.toJSON(n):void 0):t.extensionOptions=[],e.nonCriticalExtensionOptions?t.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions.map(n=>n?Any$3.toJSON(n):void 0):t.nonCriticalExtensionOptions=[],t},fromPartial(e){var n,p,u;const t=createBaseTxBody();return t.messages=((n=e.messages)==null?void 0:n.map(g=>Any$3.fromPartial(g)))||[],t.memo=e.memo??"",t.timeoutHeight=e.timeoutHeight??0,t.extensionOptions=((p=e.extensionOptions)==null?void 0:p.map(g=>Any$3.fromPartial(g)))||[],t.nonCriticalExtensionOptions=((u=e.nonCriticalExtensionOptions)==null?void 0:u.map(g=>Any$3.fromPartial(g)))||[],t}};function createBaseAuthInfo(){return{signerInfos:[],fee:void 0,tip:void 0}}const AuthInfo={encode(e,t=_m0.Writer.create()){for(const n of e.signerInfos)SignerInfo.encode(n,t.uint32(10).fork()).ldelim();return e.fee!==void 0&&Fee.encode(e.fee,t.uint32(18).fork()).ldelim(),e.tip!==void 0&&Tip.encode(e.tip,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAuthInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.signerInfos.push(SignerInfo.decode(n,n.uint32()));break;case 2:u.fee=Fee.decode(n,n.uint32());break;case 3:u.tip=Tip.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{signerInfos:Array.isArray(e==null?void 0:e.signerInfos)?e.signerInfos.map(t=>SignerInfo.fromJSON(t)):[],fee:isSet$x(e.fee)?Fee.fromJSON(e.fee):void 0,tip:isSet$x(e.tip)?Tip.fromJSON(e.tip):void 0}},toJSON(e){const t={};return e.signerInfos?t.signerInfos=e.signerInfos.map(n=>n?SignerInfo.toJSON(n):void 0):t.signerInfos=[],e.fee!==void 0&&(t.fee=e.fee?Fee.toJSON(e.fee):void 0),e.tip!==void 0&&(t.tip=e.tip?Tip.toJSON(e.tip):void 0),t},fromPartial(e){var n;const t=createBaseAuthInfo();return t.signerInfos=((n=e.signerInfos)==null?void 0:n.map(p=>SignerInfo.fromPartial(p)))||[],t.fee=e.fee!==void 0&&e.fee!==null?Fee.fromPartial(e.fee):void 0,t.tip=e.tip!==void 0&&e.tip!==null?Tip.fromPartial(e.tip):void 0,t}};function createBaseSignerInfo(){return{publicKey:void 0,modeInfo:void 0,sequence:0}}const SignerInfo={encode(e,t=_m0.Writer.create()){return e.publicKey!==void 0&&Any$3.encode(e.publicKey,t.uint32(10).fork()).ldelim(),e.modeInfo!==void 0&&ModeInfo.encode(e.modeInfo,t.uint32(18).fork()).ldelim(),e.sequence!==0&&t.uint32(24).uint64(e.sequence),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseSignerInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.publicKey=Any$3.decode(n,n.uint32());break;case 2:u.modeInfo=ModeInfo.decode(n,n.uint32());break;case 3:u.sequence=longToNumber$i(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{publicKey:isSet$x(e.publicKey)?Any$3.fromJSON(e.publicKey):void 0,modeInfo:isSet$x(e.modeInfo)?ModeInfo.fromJSON(e.modeInfo):void 0,sequence:isSet$x(e.sequence)?Number(e.sequence):0}},toJSON(e){const t={};return e.publicKey!==void 0&&(t.publicKey=e.publicKey?Any$3.toJSON(e.publicKey):void 0),e.modeInfo!==void 0&&(t.modeInfo=e.modeInfo?ModeInfo.toJSON(e.modeInfo):void 0),e.sequence!==void 0&&(t.sequence=Math.round(e.sequence)),t},fromPartial(e){const t=createBaseSignerInfo();return t.publicKey=e.publicKey!==void 0&&e.publicKey!==null?Any$3.fromPartial(e.publicKey):void 0,t.modeInfo=e.modeInfo!==void 0&&e.modeInfo!==null?ModeInfo.fromPartial(e.modeInfo):void 0,t.sequence=e.sequence??0,t}};function createBaseModeInfo(){return{single:void 0,multi:void 0}}const ModeInfo={encode(e,t=_m0.Writer.create()){return e.single!==void 0&&ModeInfo_Single.encode(e.single,t.uint32(10).fork()).ldelim(),e.multi!==void 0&&ModeInfo_Multi.encode(e.multi,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseModeInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.single=ModeInfo_Single.decode(n,n.uint32());break;case 2:u.multi=ModeInfo_Multi.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{single:isSet$x(e.single)?ModeInfo_Single.fromJSON(e.single):void 0,multi:isSet$x(e.multi)?ModeInfo_Multi.fromJSON(e.multi):void 0}},toJSON(e){const t={};return e.single!==void 0&&(t.single=e.single?ModeInfo_Single.toJSON(e.single):void 0),e.multi!==void 0&&(t.multi=e.multi?ModeInfo_Multi.toJSON(e.multi):void 0),t},fromPartial(e){const t=createBaseModeInfo();return t.single=e.single!==void 0&&e.single!==null?ModeInfo_Single.fromPartial(e.single):void 0,t.multi=e.multi!==void 0&&e.multi!==null?ModeInfo_Multi.fromPartial(e.multi):void 0,t}};function createBaseModeInfo_Single(){return{mode:0}}const ModeInfo_Single={encode(e,t=_m0.Writer.create()){return e.mode!==0&&t.uint32(8).int32(e.mode),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseModeInfo_Single();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.mode=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{mode:isSet$x(e.mode)?signModeFromJSON(e.mode):0}},toJSON(e){const t={};return e.mode!==void 0&&(t.mode=signModeToJSON(e.mode)),t},fromPartial(e){const t=createBaseModeInfo_Single();return t.mode=e.mode??0,t}};function createBaseModeInfo_Multi(){return{bitarray:void 0,modeInfos:[]}}const ModeInfo_Multi={encode(e,t=_m0.Writer.create()){e.bitarray!==void 0&&CompactBitArray.encode(e.bitarray,t.uint32(10).fork()).ldelim();for(const n of e.modeInfos)ModeInfo.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseModeInfo_Multi();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.bitarray=CompactBitArray.decode(n,n.uint32());break;case 2:u.modeInfos.push(ModeInfo.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{bitarray:isSet$x(e.bitarray)?CompactBitArray.fromJSON(e.bitarray):void 0,modeInfos:Array.isArray(e==null?void 0:e.modeInfos)?e.modeInfos.map(t=>ModeInfo.fromJSON(t)):[]}},toJSON(e){const t={};return e.bitarray!==void 0&&(t.bitarray=e.bitarray?CompactBitArray.toJSON(e.bitarray):void 0),e.modeInfos?t.modeInfos=e.modeInfos.map(n=>n?ModeInfo.toJSON(n):void 0):t.modeInfos=[],t},fromPartial(e){var n;const t=createBaseModeInfo_Multi();return t.bitarray=e.bitarray!==void 0&&e.bitarray!==null?CompactBitArray.fromPartial(e.bitarray):void 0,t.modeInfos=((n=e.modeInfos)==null?void 0:n.map(p=>ModeInfo.fromPartial(p)))||[],t}};function createBaseFee(){return{amount:[],gasLimit:0,payer:"",granter:""}}const Fee={encode(e,t=_m0.Writer.create()){for(const n of e.amount)Coin$3.encode(n,t.uint32(10).fork()).ldelim();return e.gasLimit!==0&&t.uint32(16).uint64(e.gasLimit),e.payer!==""&&t.uint32(26).string(e.payer),e.granter!==""&&t.uint32(34).string(e.granter),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseFee();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.amount.push(Coin$3.decode(n,n.uint32()));break;case 2:u.gasLimit=longToNumber$i(n.uint64());break;case 3:u.payer=n.string();break;case 4:u.granter=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$3.fromJSON(t)):[],gasLimit:isSet$x(e.gasLimit)?Number(e.gasLimit):0,payer:isSet$x(e.payer)?String(e.payer):"",granter:isSet$x(e.granter)?String(e.granter):""}},toJSON(e){const t={};return e.amount?t.amount=e.amount.map(n=>n?Coin$3.toJSON(n):void 0):t.amount=[],e.gasLimit!==void 0&&(t.gasLimit=Math.round(e.gasLimit)),e.payer!==void 0&&(t.payer=e.payer),e.granter!==void 0&&(t.granter=e.granter),t},fromPartial(e){var n;const t=createBaseFee();return t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$3.fromPartial(p)))||[],t.gasLimit=e.gasLimit??0,t.payer=e.payer??"",t.granter=e.granter??"",t}};function createBaseTip(){return{amount:[],tipper:""}}const Tip={encode(e,t=_m0.Writer.create()){for(const n of e.amount)Coin$3.encode(n,t.uint32(10).fork()).ldelim();return e.tipper!==""&&t.uint32(18).string(e.tipper),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTip();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.amount.push(Coin$3.decode(n,n.uint32()));break;case 2:u.tipper=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$3.fromJSON(t)):[],tipper:isSet$x(e.tipper)?String(e.tipper):""}},toJSON(e){const t={};return e.amount?t.amount=e.amount.map(n=>n?Coin$3.toJSON(n):void 0):t.amount=[],e.tipper!==void 0&&(t.tipper=e.tipper),t},fromPartial(e){var n;const t=createBaseTip();return t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$3.fromPartial(p)))||[],t.tipper=e.tipper??"",t}};function createBaseAuxSignerData(){return{address:"",signDoc:void 0,mode:0,sig:new Uint8Array}}const AuxSignerData={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.signDoc!==void 0&&SignDocDirectAux.encode(e.signDoc,t.uint32(18).fork()).ldelim(),e.mode!==0&&t.uint32(24).int32(e.mode),e.sig.length!==0&&t.uint32(34).bytes(e.sig),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAuxSignerData();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.signDoc=SignDocDirectAux.decode(n,n.uint32());break;case 3:u.mode=n.int32();break;case 4:u.sig=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$x(e.address)?String(e.address):"",signDoc:isSet$x(e.signDoc)?SignDocDirectAux.fromJSON(e.signDoc):void 0,mode:isSet$x(e.mode)?signModeFromJSON(e.mode):0,sig:isSet$x(e.sig)?bytesFromBase64$a(e.sig):new Uint8Array}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.signDoc!==void 0&&(t.signDoc=e.signDoc?SignDocDirectAux.toJSON(e.signDoc):void 0),e.mode!==void 0&&(t.mode=signModeToJSON(e.mode)),e.sig!==void 0&&(t.sig=base64FromBytes$a(e.sig!==void 0?e.sig:new Uint8Array)),t},fromPartial(e){const t=createBaseAuxSignerData();return t.address=e.address??"",t.signDoc=e.signDoc!==void 0&&e.signDoc!==null?SignDocDirectAux.fromPartial(e.signDoc):void 0,t.mode=e.mode??0,t.sig=e.sig??new Uint8Array,t}};var globalThis$v=(()=>{if(typeof globalThis$v<"u")return globalThis$v;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$a(e){if(globalThis$v.Buffer)return Uint8Array.from(globalThis$v.Buffer.from(e,"base64"));{const t=globalThis$v.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$a(e){if(globalThis$v.Buffer)return globalThis$v.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$v.btoa(t.join(""))}}function longToNumber$i(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$v.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$x(e){return e!=null}new build$b.Registry(msgTypes$a);function getStructure$a(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$a=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$a=({addr:e}={addr:"http://localhost:1317"})=>new Api$a({baseURL:e});let SDKModule$a=class{constructor(t){this.registry=[],this.query=queryClient$a({addr:t.env.apiURL}),this.updateTX(t),this.structure={Tx:getStructure$a(Tx.fromPartial({})),TxRaw:getStructure$a(TxRaw.fromPartial({})),SignDoc:getStructure$a(SignDoc.fromPartial({})),SignDocDirectAux:getStructure$a(SignDocDirectAux.fromPartial({})),TxBody:getStructure$a(TxBody.fromPartial({})),AuthInfo:getStructure$a(AuthInfo.fromPartial({})),SignerInfo:getStructure$a(SignerInfo.fromPartial({})),ModeInfo:getStructure$a(ModeInfo.fromPartial({})),ModeInfo_Single:getStructure$a(ModeInfo_Single.fromPartial({})),ModeInfo_Multi:getStructure$a(ModeInfo_Multi.fromPartial({})),Fee:getStructure$a(Fee.fromPartial({})),Tip:getStructure$a(Tip.fromPartial({})),AuxSignerData:getStructure$a(AuxSignerData.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$a({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$a=e=>({module:{CosmosTxV1Beta1:new SDKModule$a(e)},registry:msgTypes$a});function createBaseAny$2(){return{typeUrl:"",value:new Uint8Array}}const Any$2={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$w(e.typeUrl)?String(e.typeUrl):"",value:isSet$w(e.value)?bytesFromBase64$9(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$9(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$2();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$u=(()=>{if(typeof globalThis$u<"u")return globalThis$u;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$9(e){if(globalThis$u.Buffer)return Uint8Array.from(globalThis$u.Buffer.from(e,"base64"));{const t=globalThis$u.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$9(e){if(globalThis$u.Buffer)return globalThis$u.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$u.btoa(t.join(""))}}function isSet$w(e){return e!=null}function createBaseTimestamp$1(){return{seconds:0,nanos:0}}const Timestamp$1={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$h(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$v(e.seconds)?Number(e.seconds):0,nanos:isSet$v(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp$1();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$t=(()=>{if(typeof globalThis$t<"u")return globalThis$t;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$h(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$t.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$v(e){return e!=null}function createBasePlan$1(){return{name:"",time:void 0,height:0,info:"",upgradedClientState:void 0}}const Plan$1={encode(e,t=_m0.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.time!==void 0&&Timestamp$1.encode(toTimestamp$1(e.time),t.uint32(18).fork()).ldelim(),e.height!==0&&t.uint32(24).int64(e.height),e.info!==""&&t.uint32(34).string(e.info),e.upgradedClientState!==void 0&&Any$2.encode(e.upgradedClientState,t.uint32(42).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePlan$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.name=n.string();break;case 2:u.time=fromTimestamp$1(Timestamp$1.decode(n,n.uint32()));break;case 3:u.height=longToNumber$g(n.int64());break;case 4:u.info=n.string();break;case 5:u.upgradedClientState=Any$2.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{name:isSet$u(e.name)?String(e.name):"",time:isSet$u(e.time)?fromJsonTimestamp$1(e.time):void 0,height:isSet$u(e.height)?Number(e.height):0,info:isSet$u(e.info)?String(e.info):"",upgradedClientState:isSet$u(e.upgradedClientState)?Any$2.fromJSON(e.upgradedClientState):void 0}},toJSON(e){const t={};return e.name!==void 0&&(t.name=e.name),e.time!==void 0&&(t.time=e.time.toISOString()),e.height!==void 0&&(t.height=Math.round(e.height)),e.info!==void 0&&(t.info=e.info),e.upgradedClientState!==void 0&&(t.upgradedClientState=e.upgradedClientState?Any$2.toJSON(e.upgradedClientState):void 0),t},fromPartial(e){const t=createBasePlan$1();return t.name=e.name??"",t.time=e.time??void 0,t.height=e.height??0,t.info=e.info??"",t.upgradedClientState=e.upgradedClientState!==void 0&&e.upgradedClientState!==null?Any$2.fromPartial(e.upgradedClientState):void 0,t}};function createBaseSoftwareUpgradeProposal(){return{title:"",description:"",plan:void 0}}const SoftwareUpgradeProposal={encode(e,t=_m0.Writer.create()){return e.title!==""&&t.uint32(10).string(e.title),e.description!==""&&t.uint32(18).string(e.description),e.plan!==void 0&&Plan$1.encode(e.plan,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseSoftwareUpgradeProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.title=n.string();break;case 2:u.description=n.string();break;case 3:u.plan=Plan$1.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{title:isSet$u(e.title)?String(e.title):"",description:isSet$u(e.description)?String(e.description):"",plan:isSet$u(e.plan)?Plan$1.fromJSON(e.plan):void 0}},toJSON(e){const t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),e.plan!==void 0&&(t.plan=e.plan?Plan$1.toJSON(e.plan):void 0),t},fromPartial(e){const t=createBaseSoftwareUpgradeProposal();return t.title=e.title??"",t.description=e.description??"",t.plan=e.plan!==void 0&&e.plan!==null?Plan$1.fromPartial(e.plan):void 0,t}};function createBaseCancelSoftwareUpgradeProposal(){return{title:"",description:""}}const CancelSoftwareUpgradeProposal={encode(e,t=_m0.Writer.create()){return e.title!==""&&t.uint32(10).string(e.title),e.description!==""&&t.uint32(18).string(e.description),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCancelSoftwareUpgradeProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.title=n.string();break;case 2:u.description=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{title:isSet$u(e.title)?String(e.title):"",description:isSet$u(e.description)?String(e.description):""}},toJSON(e){const t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),t},fromPartial(e){const t=createBaseCancelSoftwareUpgradeProposal();return t.title=e.title??"",t.description=e.description??"",t}};function createBaseModuleVersion(){return{name:"",version:0}}const ModuleVersion={encode(e,t=_m0.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.version!==0&&t.uint32(16).uint64(e.version),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseModuleVersion();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.name=n.string();break;case 2:u.version=longToNumber$g(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{name:isSet$u(e.name)?String(e.name):"",version:isSet$u(e.version)?Number(e.version):0}},toJSON(e){const t={};return e.name!==void 0&&(t.name=e.name),e.version!==void 0&&(t.version=Math.round(e.version)),t},fromPartial(e){const t=createBaseModuleVersion();return t.name=e.name??"",t.version=e.version??0,t}};var globalThis$s=(()=>{if(typeof globalThis$s<"u")return globalThis$s;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function toTimestamp$1(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$1(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$1(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$1(Timestamp$1.fromJSON(e))}function longToNumber$g(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$s.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$u(e){return e!=null}function createBaseMsgSoftwareUpgrade(){return{authority:"",plan:void 0}}const MsgSoftwareUpgrade={encode(e,t=_m0.Writer.create()){return e.authority!==""&&t.uint32(10).string(e.authority),e.plan!==void 0&&Plan$1.encode(e.plan,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgSoftwareUpgrade();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.authority=n.string();break;case 2:u.plan=Plan$1.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{authority:isSet$t(e.authority)?String(e.authority):"",plan:isSet$t(e.plan)?Plan$1.fromJSON(e.plan):void 0}},toJSON(e){const t={};return e.authority!==void 0&&(t.authority=e.authority),e.plan!==void 0&&(t.plan=e.plan?Plan$1.toJSON(e.plan):void 0),t},fromPartial(e){const t=createBaseMsgSoftwareUpgrade();return t.authority=e.authority??"",t.plan=e.plan!==void 0&&e.plan!==null?Plan$1.fromPartial(e.plan):void 0,t}};function createBaseMsgCancelUpgrade(){return{authority:""}}const MsgCancelUpgrade={encode(e,t=_m0.Writer.create()){return e.authority!==""&&t.uint32(10).string(e.authority),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgCancelUpgrade();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.authority=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{authority:isSet$t(e.authority)?String(e.authority):""}},toJSON(e){const t={};return e.authority!==void 0&&(t.authority=e.authority),t},fromPartial(e){const t=createBaseMsgCancelUpgrade();return t.authority=e.authority??"",t}};function isSet$t(e){return e!=null}const msgTypes$9=[["/cosmos.upgrade.v1beta1.MsgCancelUpgrade",MsgCancelUpgrade],["/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade",MsgSoftwareUpgrade]];let HttpClient$9=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$9=class extends HttpClient$9{constructor(){super(...arguments),this.queryAppliedPlan=(t,n={})=>this.request({path:`/cosmos/upgrade/v1beta1/applied_plan/${t}`,method:"GET",format:"json",...n}),this.queryAuthority=(t={})=>this.request({path:"/cosmos/upgrade/v1beta1/authority",method:"GET",format:"json",...t}),this.queryCurrentPlan=(t={})=>this.request({path:"/cosmos/upgrade/v1beta1/current_plan",method:"GET",format:"json",...t}),this.queryModuleVersions=(t,n={})=>this.request({path:"/cosmos/upgrade/v1beta1/module_versions",method:"GET",query:t,format:"json",...n}),this.queryUpgradedConsensusState=(t,n={})=>this.request({path:`/cosmos/upgrade/v1beta1/upgraded_consensus_state/${t}`,method:"GET",format:"json",...n})}};const registry$4=new build$b.Registry(msgTypes$9);function getStructure$9(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$3={amount:[],gas:"200000"},txClient$9=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgCancelUpgrade({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgCancelUpgrade: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$4,prefix:t});let N=this.msgCancelUpgrade({value:MsgCancelUpgrade.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$3,g)}catch(y){throw new Error("TxClient:sendMsgCancelUpgrade: Could not broadcast Tx: "+y.message)}},async sendMsgSoftwareUpgrade({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgSoftwareUpgrade: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$4,prefix:t});let N=this.msgSoftwareUpgrade({value:MsgSoftwareUpgrade.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$3,g)}catch(y){throw new Error("TxClient:sendMsgSoftwareUpgrade: Could not broadcast Tx: "+y.message)}},msgCancelUpgrade({value:p}){try{return{typeUrl:"/cosmos.upgrade.v1beta1.MsgCancelUpgrade",value:MsgCancelUpgrade.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgCancelUpgrade: Could not create message: "+u.message)}},msgSoftwareUpgrade({value:p}){try{return{typeUrl:"/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade",value:MsgSoftwareUpgrade.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgSoftwareUpgrade: Could not create message: "+u.message)}}}),queryClient$9=({addr:e}={addr:"http://localhost:1317"})=>new Api$9({baseURL:e});let SDKModule$9=class{constructor(t){this.registry=[],this.query=queryClient$9({addr:t.env.apiURL}),this.updateTX(t),this.structure={Plan:getStructure$9(Plan$1.fromPartial({})),SoftwareUpgradeProposal:getStructure$9(SoftwareUpgradeProposal.fromPartial({})),CancelSoftwareUpgradeProposal:getStructure$9(CancelSoftwareUpgradeProposal.fromPartial({})),ModuleVersion:getStructure$9(ModuleVersion.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$9({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$9=e=>({module:{CosmosUpgradeV1Beta1:new SDKModule$9(e)},registry:msgTypes$9});function createBaseCoin$2(){return{denom:"",amount:""}}const Coin$2={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$s(e.denom)?String(e.denom):"",amount:isSet$s(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin$2();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$s(e){return e!=null}function createBaseAny$1(){return{typeUrl:"",value:new Uint8Array}}const Any$1={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$r(e.typeUrl)?String(e.typeUrl):"",value:isSet$r(e.value)?bytesFromBase64$8(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$8(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$1();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$r=(()=>{if(typeof globalThis$r<"u")return globalThis$r;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$8(e){if(globalThis$r.Buffer)return Uint8Array.from(globalThis$r.Buffer.from(e,"base64"));{const t=globalThis$r.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$8(e){if(globalThis$r.Buffer)return globalThis$r.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$r.btoa(t.join(""))}}function isSet$r(e){return e!=null}function createBaseBaseAccount(){return{address:"",pubKey:void 0,accountNumber:0,sequence:0}}const BaseAccount={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.pubKey!==void 0&&Any$1.encode(e.pubKey,t.uint32(18).fork()).ldelim(),e.accountNumber!==0&&t.uint32(24).uint64(e.accountNumber),e.sequence!==0&&t.uint32(32).uint64(e.sequence),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseBaseAccount();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.pubKey=Any$1.decode(n,n.uint32());break;case 3:u.accountNumber=longToNumber$f(n.uint64());break;case 4:u.sequence=longToNumber$f(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$q(e.address)?String(e.address):"",pubKey:isSet$q(e.pubKey)?Any$1.fromJSON(e.pubKey):void 0,accountNumber:isSet$q(e.accountNumber)?Number(e.accountNumber):0,sequence:isSet$q(e.sequence)?Number(e.sequence):0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.pubKey!==void 0&&(t.pubKey=e.pubKey?Any$1.toJSON(e.pubKey):void 0),e.accountNumber!==void 0&&(t.accountNumber=Math.round(e.accountNumber)),e.sequence!==void 0&&(t.sequence=Math.round(e.sequence)),t},fromPartial(e){const t=createBaseBaseAccount();return t.address=e.address??"",t.pubKey=e.pubKey!==void 0&&e.pubKey!==null?Any$1.fromPartial(e.pubKey):void 0,t.accountNumber=e.accountNumber??0,t.sequence=e.sequence??0,t}};var globalThis$q=(()=>{if(typeof globalThis$q<"u")return globalThis$q;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$f(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$q.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$q(e){return e!=null}function createBaseBaseVestingAccount(){return{baseAccount:void 0,originalVesting:[],delegatedFree:[],delegatedVesting:[],endTime:0}}const BaseVestingAccount={encode(e,t=_m0.Writer.create()){e.baseAccount!==void 0&&BaseAccount.encode(e.baseAccount,t.uint32(10).fork()).ldelim();for(const n of e.originalVesting)Coin$2.encode(n,t.uint32(18).fork()).ldelim();for(const n of e.delegatedFree)Coin$2.encode(n,t.uint32(26).fork()).ldelim();for(const n of e.delegatedVesting)Coin$2.encode(n,t.uint32(34).fork()).ldelim();return e.endTime!==0&&t.uint32(40).int64(e.endTime),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseBaseVestingAccount();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.baseAccount=BaseAccount.decode(n,n.uint32());break;case 2:u.originalVesting.push(Coin$2.decode(n,n.uint32()));break;case 3:u.delegatedFree.push(Coin$2.decode(n,n.uint32()));break;case 4:u.delegatedVesting.push(Coin$2.decode(n,n.uint32()));break;case 5:u.endTime=longToNumber$e(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{baseAccount:isSet$p(e.baseAccount)?BaseAccount.fromJSON(e.baseAccount):void 0,originalVesting:Array.isArray(e==null?void 0:e.originalVesting)?e.originalVesting.map(t=>Coin$2.fromJSON(t)):[],delegatedFree:Array.isArray(e==null?void 0:e.delegatedFree)?e.delegatedFree.map(t=>Coin$2.fromJSON(t)):[],delegatedVesting:Array.isArray(e==null?void 0:e.delegatedVesting)?e.delegatedVesting.map(t=>Coin$2.fromJSON(t)):[],endTime:isSet$p(e.endTime)?Number(e.endTime):0}},toJSON(e){const t={};return e.baseAccount!==void 0&&(t.baseAccount=e.baseAccount?BaseAccount.toJSON(e.baseAccount):void 0),e.originalVesting?t.originalVesting=e.originalVesting.map(n=>n?Coin$2.toJSON(n):void 0):t.originalVesting=[],e.delegatedFree?t.delegatedFree=e.delegatedFree.map(n=>n?Coin$2.toJSON(n):void 0):t.delegatedFree=[],e.delegatedVesting?t.delegatedVesting=e.delegatedVesting.map(n=>n?Coin$2.toJSON(n):void 0):t.delegatedVesting=[],e.endTime!==void 0&&(t.endTime=Math.round(e.endTime)),t},fromPartial(e){var n,p,u;const t=createBaseBaseVestingAccount();return t.baseAccount=e.baseAccount!==void 0&&e.baseAccount!==null?BaseAccount.fromPartial(e.baseAccount):void 0,t.originalVesting=((n=e.originalVesting)==null?void 0:n.map(g=>Coin$2.fromPartial(g)))||[],t.delegatedFree=((p=e.delegatedFree)==null?void 0:p.map(g=>Coin$2.fromPartial(g)))||[],t.delegatedVesting=((u=e.delegatedVesting)==null?void 0:u.map(g=>Coin$2.fromPartial(g)))||[],t.endTime=e.endTime??0,t}};function createBaseContinuousVestingAccount(){return{baseVestingAccount:void 0,startTime:0}}const ContinuousVestingAccount={encode(e,t=_m0.Writer.create()){return e.baseVestingAccount!==void 0&&BaseVestingAccount.encode(e.baseVestingAccount,t.uint32(10).fork()).ldelim(),e.startTime!==0&&t.uint32(16).int64(e.startTime),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseContinuousVestingAccount();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.baseVestingAccount=BaseVestingAccount.decode(n,n.uint32());break;case 2:u.startTime=longToNumber$e(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{baseVestingAccount:isSet$p(e.baseVestingAccount)?BaseVestingAccount.fromJSON(e.baseVestingAccount):void 0,startTime:isSet$p(e.startTime)?Number(e.startTime):0}},toJSON(e){const t={};return e.baseVestingAccount!==void 0&&(t.baseVestingAccount=e.baseVestingAccount?BaseVestingAccount.toJSON(e.baseVestingAccount):void 0),e.startTime!==void 0&&(t.startTime=Math.round(e.startTime)),t},fromPartial(e){const t=createBaseContinuousVestingAccount();return t.baseVestingAccount=e.baseVestingAccount!==void 0&&e.baseVestingAccount!==null?BaseVestingAccount.fromPartial(e.baseVestingAccount):void 0,t.startTime=e.startTime??0,t}};function createBaseDelayedVestingAccount(){return{baseVestingAccount:void 0}}const DelayedVestingAccount={encode(e,t=_m0.Writer.create()){return e.baseVestingAccount!==void 0&&BaseVestingAccount.encode(e.baseVestingAccount,t.uint32(10).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDelayedVestingAccount();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.baseVestingAccount=BaseVestingAccount.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{baseVestingAccount:isSet$p(e.baseVestingAccount)?BaseVestingAccount.fromJSON(e.baseVestingAccount):void 0}},toJSON(e){const t={};return e.baseVestingAccount!==void 0&&(t.baseVestingAccount=e.baseVestingAccount?BaseVestingAccount.toJSON(e.baseVestingAccount):void 0),t},fromPartial(e){const t=createBaseDelayedVestingAccount();return t.baseVestingAccount=e.baseVestingAccount!==void 0&&e.baseVestingAccount!==null?BaseVestingAccount.fromPartial(e.baseVestingAccount):void 0,t}};function createBasePeriod(){return{length:0,amount:[]}}const Period={encode(e,t=_m0.Writer.create()){e.length!==0&&t.uint32(8).int64(e.length);for(const n of e.amount)Coin$2.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePeriod();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.length=longToNumber$e(n.int64());break;case 2:u.amount.push(Coin$2.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{length:isSet$p(e.length)?Number(e.length):0,amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$2.fromJSON(t)):[]}},toJSON(e){const t={};return e.length!==void 0&&(t.length=Math.round(e.length)),e.amount?t.amount=e.amount.map(n=>n?Coin$2.toJSON(n):void 0):t.amount=[],t},fromPartial(e){var n;const t=createBasePeriod();return t.length=e.length??0,t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$2.fromPartial(p)))||[],t}};function createBasePeriodicVestingAccount(){return{baseVestingAccount:void 0,startTime:0,vestingPeriods:[]}}const PeriodicVestingAccount={encode(e,t=_m0.Writer.create()){e.baseVestingAccount!==void 0&&BaseVestingAccount.encode(e.baseVestingAccount,t.uint32(10).fork()).ldelim(),e.startTime!==0&&t.uint32(16).int64(e.startTime);for(const n of e.vestingPeriods)Period.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePeriodicVestingAccount();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.baseVestingAccount=BaseVestingAccount.decode(n,n.uint32());break;case 2:u.startTime=longToNumber$e(n.int64());break;case 3:u.vestingPeriods.push(Period.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{baseVestingAccount:isSet$p(e.baseVestingAccount)?BaseVestingAccount.fromJSON(e.baseVestingAccount):void 0,startTime:isSet$p(e.startTime)?Number(e.startTime):0,vestingPeriods:Array.isArray(e==null?void 0:e.vestingPeriods)?e.vestingPeriods.map(t=>Period.fromJSON(t)):[]}},toJSON(e){const t={};return e.baseVestingAccount!==void 0&&(t.baseVestingAccount=e.baseVestingAccount?BaseVestingAccount.toJSON(e.baseVestingAccount):void 0),e.startTime!==void 0&&(t.startTime=Math.round(e.startTime)),e.vestingPeriods?t.vestingPeriods=e.vestingPeriods.map(n=>n?Period.toJSON(n):void 0):t.vestingPeriods=[],t},fromPartial(e){var n;const t=createBasePeriodicVestingAccount();return t.baseVestingAccount=e.baseVestingAccount!==void 0&&e.baseVestingAccount!==null?BaseVestingAccount.fromPartial(e.baseVestingAccount):void 0,t.startTime=e.startTime??0,t.vestingPeriods=((n=e.vestingPeriods)==null?void 0:n.map(p=>Period.fromPartial(p)))||[],t}};function createBasePermanentLockedAccount(){return{baseVestingAccount:void 0}}const PermanentLockedAccount={encode(e,t=_m0.Writer.create()){return e.baseVestingAccount!==void 0&&BaseVestingAccount.encode(e.baseVestingAccount,t.uint32(10).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePermanentLockedAccount();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.baseVestingAccount=BaseVestingAccount.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{baseVestingAccount:isSet$p(e.baseVestingAccount)?BaseVestingAccount.fromJSON(e.baseVestingAccount):void 0}},toJSON(e){const t={};return e.baseVestingAccount!==void 0&&(t.baseVestingAccount=e.baseVestingAccount?BaseVestingAccount.toJSON(e.baseVestingAccount):void 0),t},fromPartial(e){const t=createBasePermanentLockedAccount();return t.baseVestingAccount=e.baseVestingAccount!==void 0&&e.baseVestingAccount!==null?BaseVestingAccount.fromPartial(e.baseVestingAccount):void 0,t}};var globalThis$p=(()=>{if(typeof globalThis$p<"u")return globalThis$p;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$e(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$p.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$p(e){return e!=null}function createBaseMsgCreateVestingAccount(){return{fromAddress:"",toAddress:"",amount:[],endTime:0,delayed:!1}}const MsgCreateVestingAccount={encode(e,t=_m0.Writer.create()){e.fromAddress!==""&&t.uint32(10).string(e.fromAddress),e.toAddress!==""&&t.uint32(18).string(e.toAddress);for(const n of e.amount)Coin$2.encode(n,t.uint32(26).fork()).ldelim();return e.endTime!==0&&t.uint32(32).int64(e.endTime),e.delayed===!0&&t.uint32(40).bool(e.delayed),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgCreateVestingAccount();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.fromAddress=n.string();break;case 2:u.toAddress=n.string();break;case 3:u.amount.push(Coin$2.decode(n,n.uint32()));break;case 4:u.endTime=longToNumber$d(n.int64());break;case 5:u.delayed=n.bool();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{fromAddress:isSet$o(e.fromAddress)?String(e.fromAddress):"",toAddress:isSet$o(e.toAddress)?String(e.toAddress):"",amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$2.fromJSON(t)):[],endTime:isSet$o(e.endTime)?Number(e.endTime):0,delayed:isSet$o(e.delayed)?!!e.delayed:!1}},toJSON(e){const t={};return e.fromAddress!==void 0&&(t.fromAddress=e.fromAddress),e.toAddress!==void 0&&(t.toAddress=e.toAddress),e.amount?t.amount=e.amount.map(n=>n?Coin$2.toJSON(n):void 0):t.amount=[],e.endTime!==void 0&&(t.endTime=Math.round(e.endTime)),e.delayed!==void 0&&(t.delayed=e.delayed),t},fromPartial(e){var n;const t=createBaseMsgCreateVestingAccount();return t.fromAddress=e.fromAddress??"",t.toAddress=e.toAddress??"",t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$2.fromPartial(p)))||[],t.endTime=e.endTime??0,t.delayed=e.delayed??!1,t}};function createBaseMsgCreatePermanentLockedAccount(){return{fromAddress:"",toAddress:"",amount:[]}}const MsgCreatePermanentLockedAccount={encode(e,t=_m0.Writer.create()){e.fromAddress!==""&&t.uint32(10).string(e.fromAddress),e.toAddress!==""&&t.uint32(18).string(e.toAddress);for(const n of e.amount)Coin$2.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgCreatePermanentLockedAccount();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.fromAddress=n.string();break;case 2:u.toAddress=n.string();break;case 3:u.amount.push(Coin$2.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{fromAddress:isSet$o(e.fromAddress)?String(e.fromAddress):"",toAddress:isSet$o(e.toAddress)?String(e.toAddress):"",amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$2.fromJSON(t)):[]}},toJSON(e){const t={};return e.fromAddress!==void 0&&(t.fromAddress=e.fromAddress),e.toAddress!==void 0&&(t.toAddress=e.toAddress),e.amount?t.amount=e.amount.map(n=>n?Coin$2.toJSON(n):void 0):t.amount=[],t},fromPartial(e){var n;const t=createBaseMsgCreatePermanentLockedAccount();return t.fromAddress=e.fromAddress??"",t.toAddress=e.toAddress??"",t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$2.fromPartial(p)))||[],t}};function createBaseMsgCreatePeriodicVestingAccount(){return{fromAddress:"",toAddress:"",startTime:0,vestingPeriods:[]}}const MsgCreatePeriodicVestingAccount={encode(e,t=_m0.Writer.create()){e.fromAddress!==""&&t.uint32(10).string(e.fromAddress),e.toAddress!==""&&t.uint32(18).string(e.toAddress),e.startTime!==0&&t.uint32(24).int64(e.startTime);for(const n of e.vestingPeriods)Period.encode(n,t.uint32(34).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgCreatePeriodicVestingAccount();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.fromAddress=n.string();break;case 2:u.toAddress=n.string();break;case 3:u.startTime=longToNumber$d(n.int64());break;case 4:u.vestingPeriods.push(Period.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{fromAddress:isSet$o(e.fromAddress)?String(e.fromAddress):"",toAddress:isSet$o(e.toAddress)?String(e.toAddress):"",startTime:isSet$o(e.startTime)?Number(e.startTime):0,vestingPeriods:Array.isArray(e==null?void 0:e.vestingPeriods)?e.vestingPeriods.map(t=>Period.fromJSON(t)):[]}},toJSON(e){const t={};return e.fromAddress!==void 0&&(t.fromAddress=e.fromAddress),e.toAddress!==void 0&&(t.toAddress=e.toAddress),e.startTime!==void 0&&(t.startTime=Math.round(e.startTime)),e.vestingPeriods?t.vestingPeriods=e.vestingPeriods.map(n=>n?Period.toJSON(n):void 0):t.vestingPeriods=[],t},fromPartial(e){var n;const t=createBaseMsgCreatePeriodicVestingAccount();return t.fromAddress=e.fromAddress??"",t.toAddress=e.toAddress??"",t.startTime=e.startTime??0,t.vestingPeriods=((n=e.vestingPeriods)==null?void 0:n.map(p=>Period.fromPartial(p)))||[],t}};var globalThis$o=(()=>{if(typeof globalThis$o<"u")return globalThis$o;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$d(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$o.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$o(e){return e!=null}const msgTypes$8=[["/cosmos.vesting.v1beta1.MsgCreateVestingAccount",MsgCreateVestingAccount],["/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount",MsgCreatePermanentLockedAccount],["/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount",MsgCreatePeriodicVestingAccount]];let HttpClient$8=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$8=class extends HttpClient$8{};const registry$3=new build$b.Registry(msgTypes$8);function getStructure$8(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$2={amount:[],gas:"200000"},txClient$8=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgCreateVestingAccount({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgCreateVestingAccount: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$3,prefix:t});let N=this.msgCreateVestingAccount({value:MsgCreateVestingAccount.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$2,g)}catch(y){throw new Error("TxClient:sendMsgCreateVestingAccount: Could not broadcast Tx: "+y.message)}},async sendMsgCreatePermanentLockedAccount({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgCreatePermanentLockedAccount: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$3,prefix:t});let N=this.msgCreatePermanentLockedAccount({value:MsgCreatePermanentLockedAccount.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$2,g)}catch(y){throw new Error("TxClient:sendMsgCreatePermanentLockedAccount: Could not broadcast Tx: "+y.message)}},async sendMsgCreatePeriodicVestingAccount({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgCreatePeriodicVestingAccount: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$3,prefix:t});let N=this.msgCreatePeriodicVestingAccount({value:MsgCreatePeriodicVestingAccount.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$2,g)}catch(y){throw new Error("TxClient:sendMsgCreatePeriodicVestingAccount: Could not broadcast Tx: "+y.message)}},msgCreateVestingAccount({value:p}){try{return{typeUrl:"/cosmos.vesting.v1beta1.MsgCreateVestingAccount",value:MsgCreateVestingAccount.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgCreateVestingAccount: Could not create message: "+u.message)}},msgCreatePermanentLockedAccount({value:p}){try{return{typeUrl:"/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount",value:MsgCreatePermanentLockedAccount.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgCreatePermanentLockedAccount: Could not create message: "+u.message)}},msgCreatePeriodicVestingAccount({value:p}){try{return{typeUrl:"/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount",value:MsgCreatePeriodicVestingAccount.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgCreatePeriodicVestingAccount: Could not create message: "+u.message)}}}),queryClient$8=({addr:e}={addr:"http://localhost:1317"})=>new Api$8({baseURL:e});let SDKModule$8=class{constructor(t){this.registry=[],this.query=queryClient$8({addr:t.env.apiURL}),this.updateTX(t),this.structure={BaseVestingAccount:getStructure$8(BaseVestingAccount.fromPartial({})),ContinuousVestingAccount:getStructure$8(ContinuousVestingAccount.fromPartial({})),DelayedVestingAccount:getStructure$8(DelayedVestingAccount.fromPartial({})),Period:getStructure$8(Period.fromPartial({})),PeriodicVestingAccount:getStructure$8(PeriodicVestingAccount.fromPartial({})),PermanentLockedAccount:getStructure$8(PermanentLockedAccount.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$8({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$8=e=>({module:{CosmosVestingV1Beta1:new SDKModule$8(e)},registry:msgTypes$8}),msgTypes$7=[];let HttpClient$7=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$7=class extends HttpClient$7{constructor(){super(...arguments),this.queryInterchainAccount=(t,n,p={})=>this.request({path:`/ibc/apps/interchain_accounts/controller/v1/owners/${t}/connections/${n}`,method:"GET",format:"json",...p}),this.queryParams=(t={})=>this.request({path:"/ibc/apps/interchain_accounts/controller/v1/params",method:"GET",format:"json",...t})}};function createBaseParams$6(){return{controllerEnabled:!1}}const Params$6={encode(e,t=_m0.Writer.create()){return e.controllerEnabled===!0&&t.uint32(8).bool(e.controllerEnabled),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$6();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.controllerEnabled=n.bool();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{controllerEnabled:isSet$n(e.controllerEnabled)?!!e.controllerEnabled:!1}},toJSON(e){const t={};return e.controllerEnabled!==void 0&&(t.controllerEnabled=e.controllerEnabled),t},fromPartial(e){const t=createBaseParams$6();return t.controllerEnabled=e.controllerEnabled??!1,t}};function isSet$n(e){return e!=null}new build$b.Registry(msgTypes$7);function getStructure$7(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$7=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$7=({addr:e}={addr:"http://localhost:1317"})=>new Api$7({baseURL:e});let SDKModule$7=class{constructor(t){this.registry=[],this.query=queryClient$7({addr:t.env.apiURL}),this.updateTX(t),this.structure={Params:getStructure$7(Params$6.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$7({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$7=e=>({module:{IbcApplicationsInterchainAccountsControllerV1:new SDKModule$7(e)},registry:msgTypes$7}),msgTypes$6=[];let HttpClient$6=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$6=class extends HttpClient$6{constructor(){super(...arguments),this.queryParams=(t={})=>this.request({path:"/ibc/apps/interchain_accounts/host/v1/params",method:"GET",format:"json",...t})}};function createBaseParams$5(){return{hostEnabled:!1,allowMessages:[]}}const Params$5={encode(e,t=_m0.Writer.create()){e.hostEnabled===!0&&t.uint32(8).bool(e.hostEnabled);for(const n of e.allowMessages)t.uint32(18).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$5();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.hostEnabled=n.bool();break;case 2:u.allowMessages.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{hostEnabled:isSet$m(e.hostEnabled)?!!e.hostEnabled:!1,allowMessages:Array.isArray(e==null?void 0:e.allowMessages)?e.allowMessages.map(t=>String(t)):[]}},toJSON(e){const t={};return e.hostEnabled!==void 0&&(t.hostEnabled=e.hostEnabled),e.allowMessages?t.allowMessages=e.allowMessages.map(n=>n):t.allowMessages=[],t},fromPartial(e){var n;const t=createBaseParams$5();return t.hostEnabled=e.hostEnabled??!1,t.allowMessages=((n=e.allowMessages)==null?void 0:n.map(p=>p))||[],t}};function isSet$m(e){return e!=null}new build$b.Registry(msgTypes$6);function getStructure$6(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$6=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$6=({addr:e}={addr:"http://localhost:1317"})=>new Api$6({baseURL:e});let SDKModule$6=class{constructor(t){this.registry=[],this.query=queryClient$6({addr:t.env.apiURL}),this.updateTX(t),this.structure={Params:getStructure$6(Params$5.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$6({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$6=e=>({module:{IbcApplicationsInterchainAccountsHostV1:new SDKModule$6(e)},registry:msgTypes$6}),msgTypes$5=[];let HttpClient$5=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$5=class extends HttpClient$5{constructor(){super(...arguments),this.queryEscrowAddress=(t,n,p={})=>this.request({path:`/ibc/apps/transfer/v1/channels/${t}/ports/${n}/escrow_address`,method:"GET",format:"json",...p}),this.queryDenomHash=(t,n={})=>this.request({path:`/ibc/apps/transfer/v1/denom_hashes/${t}`,method:"GET",format:"json",...n}),this.queryDenomTraces=(t,n={})=>this.request({path:"/ibc/apps/transfer/v1/denom_traces",method:"GET",query:t,format:"json",...n}),this.queryDenomTrace=(t,n={})=>this.request({path:`/ibc/apps/transfer/v1/denom_traces/${t}`,method:"GET",format:"json",...n}),this.queryTotalEscrowForDenom=(t,n={})=>this.request({path:`/ibc/apps/transfer/v1/denoms/${t}/total_escrow`,method:"GET",format:"json",...n}),this.queryParams=(t={})=>this.request({path:"/ibc/apps/transfer/v1/params",method:"GET",format:"json",...t})}};function createBaseCoin$1(){return{denom:"",amount:""}}const Coin$1={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$l(e.denom)?String(e.denom):"",amount:isSet$l(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin$1();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$l(e){return e!=null}function createBaseAllocation(){return{sourcePort:"",sourceChannel:"",spendLimit:[],allowList:[]}}const Allocation={encode(e,t=_m0.Writer.create()){e.sourcePort!==""&&t.uint32(10).string(e.sourcePort),e.sourceChannel!==""&&t.uint32(18).string(e.sourceChannel);for(const n of e.spendLimit)Coin$1.encode(n,t.uint32(26).fork()).ldelim();for(const n of e.allowList)t.uint32(34).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAllocation();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.sourcePort=n.string();break;case 2:u.sourceChannel=n.string();break;case 3:u.spendLimit.push(Coin$1.decode(n,n.uint32()));break;case 4:u.allowList.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{sourcePort:isSet$k(e.sourcePort)?String(e.sourcePort):"",sourceChannel:isSet$k(e.sourceChannel)?String(e.sourceChannel):"",spendLimit:Array.isArray(e==null?void 0:e.spendLimit)?e.spendLimit.map(t=>Coin$1.fromJSON(t)):[],allowList:Array.isArray(e==null?void 0:e.allowList)?e.allowList.map(t=>String(t)):[]}},toJSON(e){const t={};return e.sourcePort!==void 0&&(t.sourcePort=e.sourcePort),e.sourceChannel!==void 0&&(t.sourceChannel=e.sourceChannel),e.spendLimit?t.spendLimit=e.spendLimit.map(n=>n?Coin$1.toJSON(n):void 0):t.spendLimit=[],e.allowList?t.allowList=e.allowList.map(n=>n):t.allowList=[],t},fromPartial(e){var n,p;const t=createBaseAllocation();return t.sourcePort=e.sourcePort??"",t.sourceChannel=e.sourceChannel??"",t.spendLimit=((n=e.spendLimit)==null?void 0:n.map(u=>Coin$1.fromPartial(u)))||[],t.allowList=((p=e.allowList)==null?void 0:p.map(u=>u))||[],t}};function createBaseTransferAuthorization(){return{allocations:[]}}const TransferAuthorization={encode(e,t=_m0.Writer.create()){for(const n of e.allocations)Allocation.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTransferAuthorization();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.allocations.push(Allocation.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{allocations:Array.isArray(e==null?void 0:e.allocations)?e.allocations.map(t=>Allocation.fromJSON(t)):[]}},toJSON(e){const t={};return e.allocations?t.allocations=e.allocations.map(n=>n?Allocation.toJSON(n):void 0):t.allocations=[],t},fromPartial(e){var n;const t=createBaseTransferAuthorization();return t.allocations=((n=e.allocations)==null?void 0:n.map(p=>Allocation.fromPartial(p)))||[],t}};function isSet$k(e){return e!=null}function createBaseDenomTrace(){return{path:"",baseDenom:""}}const DenomTrace={encode(e,t=_m0.Writer.create()){return e.path!==""&&t.uint32(10).string(e.path),e.baseDenom!==""&&t.uint32(18).string(e.baseDenom),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDenomTrace();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.path=n.string();break;case 2:u.baseDenom=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{path:isSet$j(e.path)?String(e.path):"",baseDenom:isSet$j(e.baseDenom)?String(e.baseDenom):""}},toJSON(e){const t={};return e.path!==void 0&&(t.path=e.path),e.baseDenom!==void 0&&(t.baseDenom=e.baseDenom),t},fromPartial(e){const t=createBaseDenomTrace();return t.path=e.path??"",t.baseDenom=e.baseDenom??"",t}};function createBaseParams$4(){return{sendEnabled:!1,receiveEnabled:!1}}const Params$4={encode(e,t=_m0.Writer.create()){return e.sendEnabled===!0&&t.uint32(8).bool(e.sendEnabled),e.receiveEnabled===!0&&t.uint32(16).bool(e.receiveEnabled),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$4();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.sendEnabled=n.bool();break;case 2:u.receiveEnabled=n.bool();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{sendEnabled:isSet$j(e.sendEnabled)?!!e.sendEnabled:!1,receiveEnabled:isSet$j(e.receiveEnabled)?!!e.receiveEnabled:!1}},toJSON(e){const t={};return e.sendEnabled!==void 0&&(t.sendEnabled=e.sendEnabled),e.receiveEnabled!==void 0&&(t.receiveEnabled=e.receiveEnabled),t},fromPartial(e){const t=createBaseParams$4();return t.sendEnabled=e.sendEnabled??!1,t.receiveEnabled=e.receiveEnabled??!1,t}};function isSet$j(e){return e!=null}new build$b.Registry(msgTypes$5);function getStructure$5(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$5=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$5=({addr:e}={addr:"http://localhost:1317"})=>new Api$5({baseURL:e});let SDKModule$5=class{constructor(t){this.registry=[],this.query=queryClient$5({addr:t.env.apiURL}),this.updateTX(t),this.structure={Allocation:getStructure$5(Allocation.fromPartial({})),TransferAuthorization:getStructure$5(TransferAuthorization.fromPartial({})),DenomTrace:getStructure$5(DenomTrace.fromPartial({})),Params:getStructure$5(Params$4.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$5({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$5=e=>({module:{IbcApplicationsTransferV1:new SDKModule$5(e)},registry:msgTypes$5}),msgTypes$4=[];let HttpClient$4=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$4=class extends HttpClient$4{constructor(){super(...arguments),this.queryChannels=(t,n={})=>this.request({path:"/ibc/core/channel/v1/channels",method:"GET",query:t,format:"json",...n}),this.queryChannel=(t,n,p={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}`,method:"GET",format:"json",...p}),this.queryChannelClientState=(t,n,p={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}/client_state`,method:"GET",format:"json",...p}),this.queryChannelConsensusState=(t,n,p,u,g={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}/consensus_state/revision/${p}/height/${u}`,method:"GET",format:"json",...g}),this.queryNextSequenceReceive=(t,n,p={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}/next_sequence`,method:"GET",format:"json",...p}),this.queryPacketAcknowledgements=(t,n,p,u={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}/packet_acknowledgements`,method:"GET",query:p,format:"json",...u}),this.queryPacketAcknowledgement=(t,n,p,u={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}/packet_acks/${p}`,method:"GET",format:"json",...u}),this.queryPacketCommitments=(t,n,p,u={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}/packet_commitments`,method:"GET",query:p,format:"json",...u}),this.queryUnreceivedAcks=(t,n,p,u={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}/packet_commitments/${p}/unreceived_acks`,method:"GET",format:"json",...u}),this.queryUnreceivedPackets=(t,n,p,u={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}/packet_commitments/${p}/unreceived_packets`,method:"GET",format:"json",...u}),this.queryPacketCommitment=(t,n,p,u={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}/packet_commitments/${p}`,method:"GET",format:"json",...u}),this.queryPacketReceipt=(t,n,p,u={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}/packet_receipts/${p}`,method:"GET",format:"json",...u}),this.queryConnectionChannels=(t,n,p={})=>this.request({path:`/ibc/core/channel/v1/connections/${t}/channels`,method:"GET",query:n,format:"json",...p})}};var globalThis$n=(()=>{if(typeof globalThis$n<"u")return globalThis$n;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})(),globalThis$m=(()=>{if(typeof globalThis$m<"u")return globalThis$m;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());var globalThis$l=(()=>{if(typeof globalThis$l<"u")return globalThis$l;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function createBaseHeight$1(){return{revisionNumber:0,revisionHeight:0}}const Height$1={encode(e,t=_m0.Writer.create()){return e.revisionNumber!==0&&t.uint32(8).uint64(e.revisionNumber),e.revisionHeight!==0&&t.uint32(16).uint64(e.revisionHeight),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseHeight$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.revisionNumber=longToNumber$c(n.uint64());break;case 2:u.revisionHeight=longToNumber$c(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{revisionNumber:isSet$i(e.revisionNumber)?Number(e.revisionNumber):0,revisionHeight:isSet$i(e.revisionHeight)?Number(e.revisionHeight):0}},toJSON(e){const t={};return e.revisionNumber!==void 0&&(t.revisionNumber=Math.round(e.revisionNumber)),e.revisionHeight!==void 0&&(t.revisionHeight=Math.round(e.revisionHeight)),t},fromPartial(e){const t=createBaseHeight$1();return t.revisionNumber=e.revisionNumber??0,t.revisionHeight=e.revisionHeight??0,t}};var globalThis$k=(()=>{if(typeof globalThis$k<"u")return globalThis$k;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$c(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$k.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$i(e){return e!=null}function stateFromJSON$1(e){switch(e){case 0:case"STATE_UNINITIALIZED_UNSPECIFIED":return 0;case 1:case"STATE_INIT":return 1;case 2:case"STATE_TRYOPEN":return 2;case 3:case"STATE_OPEN":return 3;case 4:case"STATE_CLOSED":return 4;case-1:case"UNRECOGNIZED":default:return-1}}function stateToJSON$1(e){switch(e){case 0:return"STATE_UNINITIALIZED_UNSPECIFIED";case 1:return"STATE_INIT";case 2:return"STATE_TRYOPEN";case 3:return"STATE_OPEN";case 4:return"STATE_CLOSED";case-1:default:return"UNRECOGNIZED"}}function orderFromJSON(e){switch(e){case 0:case"ORDER_NONE_UNSPECIFIED":return 0;case 1:case"ORDER_UNORDERED":return 1;case 2:case"ORDER_ORDERED":return 2;case-1:case"UNRECOGNIZED":default:return-1}}function orderToJSON(e){switch(e){case 0:return"ORDER_NONE_UNSPECIFIED";case 1:return"ORDER_UNORDERED";case 2:return"ORDER_ORDERED";case-1:default:return"UNRECOGNIZED"}}function createBaseChannel(){return{state:0,ordering:0,counterparty:void 0,connectionHops:[],version:""}}const Channel={encode(e,t=_m0.Writer.create()){e.state!==0&&t.uint32(8).int32(e.state),e.ordering!==0&&t.uint32(16).int32(e.ordering),e.counterparty!==void 0&&Counterparty$1.encode(e.counterparty,t.uint32(26).fork()).ldelim();for(const n of e.connectionHops)t.uint32(34).string(n);return e.version!==""&&t.uint32(42).string(e.version),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseChannel();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.state=n.int32();break;case 2:u.ordering=n.int32();break;case 3:u.counterparty=Counterparty$1.decode(n,n.uint32());break;case 4:u.connectionHops.push(n.string());break;case 5:u.version=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{state:isSet$h(e.state)?stateFromJSON$1(e.state):0,ordering:isSet$h(e.ordering)?orderFromJSON(e.ordering):0,counterparty:isSet$h(e.counterparty)?Counterparty$1.fromJSON(e.counterparty):void 0,connectionHops:Array.isArray(e==null?void 0:e.connectionHops)?e.connectionHops.map(t=>String(t)):[],version:isSet$h(e.version)?String(e.version):""}},toJSON(e){const t={};return e.state!==void 0&&(t.state=stateToJSON$1(e.state)),e.ordering!==void 0&&(t.ordering=orderToJSON(e.ordering)),e.counterparty!==void 0&&(t.counterparty=e.counterparty?Counterparty$1.toJSON(e.counterparty):void 0),e.connectionHops?t.connectionHops=e.connectionHops.map(n=>n):t.connectionHops=[],e.version!==void 0&&(t.version=e.version),t},fromPartial(e){var n;const t=createBaseChannel();return t.state=e.state??0,t.ordering=e.ordering??0,t.counterparty=e.counterparty!==void 0&&e.counterparty!==null?Counterparty$1.fromPartial(e.counterparty):void 0,t.connectionHops=((n=e.connectionHops)==null?void 0:n.map(p=>p))||[],t.version=e.version??"",t}};function createBaseIdentifiedChannel(){return{state:0,ordering:0,counterparty:void 0,connectionHops:[],version:"",portId:"",channelId:""}}const IdentifiedChannel={encode(e,t=_m0.Writer.create()){e.state!==0&&t.uint32(8).int32(e.state),e.ordering!==0&&t.uint32(16).int32(e.ordering),e.counterparty!==void 0&&Counterparty$1.encode(e.counterparty,t.uint32(26).fork()).ldelim();for(const n of e.connectionHops)t.uint32(34).string(n);return e.version!==""&&t.uint32(42).string(e.version),e.portId!==""&&t.uint32(50).string(e.portId),e.channelId!==""&&t.uint32(58).string(e.channelId),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseIdentifiedChannel();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.state=n.int32();break;case 2:u.ordering=n.int32();break;case 3:u.counterparty=Counterparty$1.decode(n,n.uint32());break;case 4:u.connectionHops.push(n.string());break;case 5:u.version=n.string();break;case 6:u.portId=n.string();break;case 7:u.channelId=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{state:isSet$h(e.state)?stateFromJSON$1(e.state):0,ordering:isSet$h(e.ordering)?orderFromJSON(e.ordering):0,counterparty:isSet$h(e.counterparty)?Counterparty$1.fromJSON(e.counterparty):void 0,connectionHops:Array.isArray(e==null?void 0:e.connectionHops)?e.connectionHops.map(t=>String(t)):[],version:isSet$h(e.version)?String(e.version):"",portId:isSet$h(e.portId)?String(e.portId):"",channelId:isSet$h(e.channelId)?String(e.channelId):""}},toJSON(e){const t={};return e.state!==void 0&&(t.state=stateToJSON$1(e.state)),e.ordering!==void 0&&(t.ordering=orderToJSON(e.ordering)),e.counterparty!==void 0&&(t.counterparty=e.counterparty?Counterparty$1.toJSON(e.counterparty):void 0),e.connectionHops?t.connectionHops=e.connectionHops.map(n=>n):t.connectionHops=[],e.version!==void 0&&(t.version=e.version),e.portId!==void 0&&(t.portId=e.portId),e.channelId!==void 0&&(t.channelId=e.channelId),t},fromPartial(e){var n;const t=createBaseIdentifiedChannel();return t.state=e.state??0,t.ordering=e.ordering??0,t.counterparty=e.counterparty!==void 0&&e.counterparty!==null?Counterparty$1.fromPartial(e.counterparty):void 0,t.connectionHops=((n=e.connectionHops)==null?void 0:n.map(p=>p))||[],t.version=e.version??"",t.portId=e.portId??"",t.channelId=e.channelId??"",t}};function createBaseCounterparty$1(){return{portId:"",channelId:""}}const Counterparty$1={encode(e,t=_m0.Writer.create()){return e.portId!==""&&t.uint32(10).string(e.portId),e.channelId!==""&&t.uint32(18).string(e.channelId),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCounterparty$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.portId=n.string();break;case 2:u.channelId=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{portId:isSet$h(e.portId)?String(e.portId):"",channelId:isSet$h(e.channelId)?String(e.channelId):""}},toJSON(e){const t={};return e.portId!==void 0&&(t.portId=e.portId),e.channelId!==void 0&&(t.channelId=e.channelId),t},fromPartial(e){const t=createBaseCounterparty$1();return t.portId=e.portId??"",t.channelId=e.channelId??"",t}};function createBasePacket(){return{sequence:0,sourcePort:"",sourceChannel:"",destinationPort:"",destinationChannel:"",data:new Uint8Array,timeoutHeight:void 0,timeoutTimestamp:0}}const Packet={encode(e,t=_m0.Writer.create()){return e.sequence!==0&&t.uint32(8).uint64(e.sequence),e.sourcePort!==""&&t.uint32(18).string(e.sourcePort),e.sourceChannel!==""&&t.uint32(26).string(e.sourceChannel),e.destinationPort!==""&&t.uint32(34).string(e.destinationPort),e.destinationChannel!==""&&t.uint32(42).string(e.destinationChannel),e.data.length!==0&&t.uint32(50).bytes(e.data),e.timeoutHeight!==void 0&&Height$1.encode(e.timeoutHeight,t.uint32(58).fork()).ldelim(),e.timeoutTimestamp!==0&&t.uint32(64).uint64(e.timeoutTimestamp),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePacket();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.sequence=longToNumber$b(n.uint64());break;case 2:u.sourcePort=n.string();break;case 3:u.sourceChannel=n.string();break;case 4:u.destinationPort=n.string();break;case 5:u.destinationChannel=n.string();break;case 6:u.data=n.bytes();break;case 7:u.timeoutHeight=Height$1.decode(n,n.uint32());break;case 8:u.timeoutTimestamp=longToNumber$b(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{sequence:isSet$h(e.sequence)?Number(e.sequence):0,sourcePort:isSet$h(e.sourcePort)?String(e.sourcePort):"",sourceChannel:isSet$h(e.sourceChannel)?String(e.sourceChannel):"",destinationPort:isSet$h(e.destinationPort)?String(e.destinationPort):"",destinationChannel:isSet$h(e.destinationChannel)?String(e.destinationChannel):"",data:isSet$h(e.data)?bytesFromBase64$7(e.data):new Uint8Array,timeoutHeight:isSet$h(e.timeoutHeight)?Height$1.fromJSON(e.timeoutHeight):void 0,timeoutTimestamp:isSet$h(e.timeoutTimestamp)?Number(e.timeoutTimestamp):0}},toJSON(e){const t={};return e.sequence!==void 0&&(t.sequence=Math.round(e.sequence)),e.sourcePort!==void 0&&(t.sourcePort=e.sourcePort),e.sourceChannel!==void 0&&(t.sourceChannel=e.sourceChannel),e.destinationPort!==void 0&&(t.destinationPort=e.destinationPort),e.destinationChannel!==void 0&&(t.destinationChannel=e.destinationChannel),e.data!==void 0&&(t.data=base64FromBytes$7(e.data!==void 0?e.data:new Uint8Array)),e.timeoutHeight!==void 0&&(t.timeoutHeight=e.timeoutHeight?Height$1.toJSON(e.timeoutHeight):void 0),e.timeoutTimestamp!==void 0&&(t.timeoutTimestamp=Math.round(e.timeoutTimestamp)),t},fromPartial(e){const t=createBasePacket();return t.sequence=e.sequence??0,t.sourcePort=e.sourcePort??"",t.sourceChannel=e.sourceChannel??"",t.destinationPort=e.destinationPort??"",t.destinationChannel=e.destinationChannel??"",t.data=e.data??new Uint8Array,t.timeoutHeight=e.timeoutHeight!==void 0&&e.timeoutHeight!==null?Height$1.fromPartial(e.timeoutHeight):void 0,t.timeoutTimestamp=e.timeoutTimestamp??0,t}};function createBasePacketState(){return{portId:"",channelId:"",sequence:0,data:new Uint8Array}}const PacketState={encode(e,t=_m0.Writer.create()){return e.portId!==""&&t.uint32(10).string(e.portId),e.channelId!==""&&t.uint32(18).string(e.channelId),e.sequence!==0&&t.uint32(24).uint64(e.sequence),e.data.length!==0&&t.uint32(34).bytes(e.data),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePacketState();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.portId=n.string();break;case 2:u.channelId=n.string();break;case 3:u.sequence=longToNumber$b(n.uint64());break;case 4:u.data=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{portId:isSet$h(e.portId)?String(e.portId):"",channelId:isSet$h(e.channelId)?String(e.channelId):"",sequence:isSet$h(e.sequence)?Number(e.sequence):0,data:isSet$h(e.data)?bytesFromBase64$7(e.data):new Uint8Array}},toJSON(e){const t={};return e.portId!==void 0&&(t.portId=e.portId),e.channelId!==void 0&&(t.channelId=e.channelId),e.sequence!==void 0&&(t.sequence=Math.round(e.sequence)),e.data!==void 0&&(t.data=base64FromBytes$7(e.data!==void 0?e.data:new Uint8Array)),t},fromPartial(e){const t=createBasePacketState();return t.portId=e.portId??"",t.channelId=e.channelId??"",t.sequence=e.sequence??0,t.data=e.data??new Uint8Array,t}};function createBasePacketId(){return{portId:"",channelId:"",sequence:0}}const PacketId={encode(e,t=_m0.Writer.create()){return e.portId!==""&&t.uint32(10).string(e.portId),e.channelId!==""&&t.uint32(18).string(e.channelId),e.sequence!==0&&t.uint32(24).uint64(e.sequence),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePacketId();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.portId=n.string();break;case 2:u.channelId=n.string();break;case 3:u.sequence=longToNumber$b(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{portId:isSet$h(e.portId)?String(e.portId):"",channelId:isSet$h(e.channelId)?String(e.channelId):"",sequence:isSet$h(e.sequence)?Number(e.sequence):0}},toJSON(e){const t={};return e.portId!==void 0&&(t.portId=e.portId),e.channelId!==void 0&&(t.channelId=e.channelId),e.sequence!==void 0&&(t.sequence=Math.round(e.sequence)),t},fromPartial(e){const t=createBasePacketId();return t.portId=e.portId??"",t.channelId=e.channelId??"",t.sequence=e.sequence??0,t}};function createBaseAcknowledgement(){return{result:void 0,error:void 0}}const Acknowledgement={encode(e,t=_m0.Writer.create()){return e.result!==void 0&&t.uint32(170).bytes(e.result),e.error!==void 0&&t.uint32(178).string(e.error),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAcknowledgement();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 21:u.result=n.bytes();break;case 22:u.error=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{result:isSet$h(e.result)?bytesFromBase64$7(e.result):void 0,error:isSet$h(e.error)?String(e.error):void 0}},toJSON(e){const t={};return e.result!==void 0&&(t.result=e.result!==void 0?base64FromBytes$7(e.result):void 0),e.error!==void 0&&(t.error=e.error),t},fromPartial(e){const t=createBaseAcknowledgement();return t.result=e.result??void 0,t.error=e.error??void 0,t}};var globalThis$j=(()=>{if(typeof globalThis$j<"u")return globalThis$j;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$7(e){if(globalThis$j.Buffer)return Uint8Array.from(globalThis$j.Buffer.from(e,"base64"));{const t=globalThis$j.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$7(e){if(globalThis$j.Buffer)return globalThis$j.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$j.btoa(t.join(""))}}function longToNumber$b(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$j.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$h(e){return e!=null}function createBasePacketSequence(){return{portId:"",channelId:"",sequence:0}}const PacketSequence={encode(e,t=_m0.Writer.create()){return e.portId!==""&&t.uint32(10).string(e.portId),e.channelId!==""&&t.uint32(18).string(e.channelId),e.sequence!==0&&t.uint32(24).uint64(e.sequence),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePacketSequence();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.portId=n.string();break;case 2:u.channelId=n.string();break;case 3:u.sequence=longToNumber$a(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{portId:isSet$g(e.portId)?String(e.portId):"",channelId:isSet$g(e.channelId)?String(e.channelId):"",sequence:isSet$g(e.sequence)?Number(e.sequence):0}},toJSON(e){const t={};return e.portId!==void 0&&(t.portId=e.portId),e.channelId!==void 0&&(t.channelId=e.channelId),e.sequence!==void 0&&(t.sequence=Math.round(e.sequence)),t},fromPartial(e){const t=createBasePacketSequence();return t.portId=e.portId??"",t.channelId=e.channelId??"",t.sequence=e.sequence??0,t}};var globalThis$i=(()=>{if(typeof globalThis$i<"u")return globalThis$i;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$a(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$i.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$g(e){return e!=null}new build$b.Registry(msgTypes$4);function getStructure$4(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$4=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$4=({addr:e}={addr:"http://localhost:1317"})=>new Api$4({baseURL:e});let SDKModule$4=class{constructor(t){this.registry=[],this.query=queryClient$4({addr:t.env.apiURL}),this.updateTX(t),this.structure={Channel:getStructure$4(Channel.fromPartial({})),IdentifiedChannel:getStructure$4(IdentifiedChannel.fromPartial({})),Counterparty:getStructure$4(Counterparty$1.fromPartial({})),Packet:getStructure$4(Packet.fromPartial({})),PacketState:getStructure$4(PacketState.fromPartial({})),PacketId:getStructure$4(PacketId.fromPartial({})),Acknowledgement:getStructure$4(Acknowledgement.fromPartial({})),PacketSequence:getStructure$4(PacketSequence.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$4({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$4=e=>({module:{IbcCoreChannelV1:new SDKModule$4(e)},registry:msgTypes$4}),msgTypes$3=[];let HttpClient$3=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$3=class extends HttpClient$3{constructor(){super(...arguments),this.queryClientStates=(t,n={})=>this.request({path:"/ibc/core/client/v1/client_states",method:"GET",query:t,format:"json",...n}),this.queryClientState=(t,n={})=>this.request({path:`/ibc/core/client/v1/client_states/${t}`,method:"GET",format:"json",...n}),this.queryClientStatus=(t,n={})=>this.request({path:`/ibc/core/client/v1/client_status/${t}`,method:"GET",format:"json",...n}),this.queryConsensusStates=(t,n,p={})=>this.request({path:`/ibc/core/client/v1/consensus_states/${t}`,method:"GET",query:n,format:"json",...p}),this.queryConsensusStateHeights=(t,n,p={})=>this.request({path:`/ibc/core/client/v1/consensus_states/${t}/heights`,method:"GET",query:n,format:"json",...p}),this.queryConsensusState=(t,n,p,u,g={})=>this.request({path:`/ibc/core/client/v1/consensus_states/${t}/revision/${n}/height/${p}`,method:"GET",query:u,format:"json",...g}),this.queryClientParams=(t={})=>this.request({path:"/ibc/core/client/v1/params",method:"GET",format:"json",...t}),this.queryUpgradedClientState=(t={})=>this.request({path:"/ibc/core/client/v1/upgraded_client_states",method:"GET",format:"json",...t}),this.queryUpgradedConsensusState=(t={})=>this.request({path:"/ibc/core/client/v1/upgraded_consensus_states",method:"GET",format:"json",...t})}};function createBaseAny(){return{typeUrl:"",value:new Uint8Array}}const Any={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$f(e.typeUrl)?String(e.typeUrl):"",value:isSet$f(e.value)?bytesFromBase64$6(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$6(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$h=(()=>{if(typeof globalThis$h<"u")return globalThis$h;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$6(e){if(globalThis$h.Buffer)return Uint8Array.from(globalThis$h.Buffer.from(e,"base64"));{const t=globalThis$h.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$6(e){if(globalThis$h.Buffer)return globalThis$h.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$h.btoa(t.join(""))}}function isSet$f(e){return e!=null}function createBaseTimestamp(){return{seconds:0,nanos:0}}const Timestamp={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$9(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$e(e.seconds)?Number(e.seconds):0,nanos:isSet$e(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$g=(()=>{if(typeof globalThis$g<"u")return globalThis$g;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$9(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$g.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$e(e){return e!=null}function createBasePlan(){return{name:"",time:void 0,height:0,info:"",upgradedClientState:void 0}}const Plan={encode(e,t=_m0.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.time!==void 0&&Timestamp.encode(toTimestamp(e.time),t.uint32(18).fork()).ldelim(),e.height!==0&&t.uint32(24).int64(e.height),e.info!==""&&t.uint32(34).string(e.info),e.upgradedClientState!==void 0&&Any.encode(e.upgradedClientState,t.uint32(42).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePlan();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.name=n.string();break;case 2:u.time=fromTimestamp(Timestamp.decode(n,n.uint32()));break;case 3:u.height=longToNumber$8(n.int64());break;case 4:u.info=n.string();break;case 5:u.upgradedClientState=Any.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{name:isSet$d(e.name)?String(e.name):"",time:isSet$d(e.time)?fromJsonTimestamp(e.time):void 0,height:isSet$d(e.height)?Number(e.height):0,info:isSet$d(e.info)?String(e.info):"",upgradedClientState:isSet$d(e.upgradedClientState)?Any.fromJSON(e.upgradedClientState):void 0}},toJSON(e){const t={};return e.name!==void 0&&(t.name=e.name),e.time!==void 0&&(t.time=e.time.toISOString()),e.height!==void 0&&(t.height=Math.round(e.height)),e.info!==void 0&&(t.info=e.info),e.upgradedClientState!==void 0&&(t.upgradedClientState=e.upgradedClientState?Any.toJSON(e.upgradedClientState):void 0),t},fromPartial(e){const t=createBasePlan();return t.name=e.name??"",t.time=e.time??void 0,t.height=e.height??0,t.info=e.info??"",t.upgradedClientState=e.upgradedClientState!==void 0&&e.upgradedClientState!==null?Any.fromPartial(e.upgradedClientState):void 0,t}};var globalThis$f=(()=>{if(typeof globalThis$f<"u")return globalThis$f;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function toTimestamp(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp(Timestamp.fromJSON(e))}function longToNumber$8(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$f.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$d(e){return e!=null}function createBaseIdentifiedClientState(){return{clientId:"",clientState:void 0}}const IdentifiedClientState={encode(e,t=_m0.Writer.create()){return e.clientId!==""&&t.uint32(10).string(e.clientId),e.clientState!==void 0&&Any.encode(e.clientState,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseIdentifiedClientState();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.clientId=n.string();break;case 2:u.clientState=Any.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{clientId:isSet$c(e.clientId)?String(e.clientId):"",clientState:isSet$c(e.clientState)?Any.fromJSON(e.clientState):void 0}},toJSON(e){const t={};return e.clientId!==void 0&&(t.clientId=e.clientId),e.clientState!==void 0&&(t.clientState=e.clientState?Any.toJSON(e.clientState):void 0),t},fromPartial(e){const t=createBaseIdentifiedClientState();return t.clientId=e.clientId??"",t.clientState=e.clientState!==void 0&&e.clientState!==null?Any.fromPartial(e.clientState):void 0,t}};function createBaseConsensusStateWithHeight(){return{height:void 0,consensusState:void 0}}const ConsensusStateWithHeight={encode(e,t=_m0.Writer.create()){return e.height!==void 0&&Height.encode(e.height,t.uint32(10).fork()).ldelim(),e.consensusState!==void 0&&Any.encode(e.consensusState,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseConsensusStateWithHeight();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.height=Height.decode(n,n.uint32());break;case 2:u.consensusState=Any.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{height:isSet$c(e.height)?Height.fromJSON(e.height):void 0,consensusState:isSet$c(e.consensusState)?Any.fromJSON(e.consensusState):void 0}},toJSON(e){const t={};return e.height!==void 0&&(t.height=e.height?Height.toJSON(e.height):void 0),e.consensusState!==void 0&&(t.consensusState=e.consensusState?Any.toJSON(e.consensusState):void 0),t},fromPartial(e){const t=createBaseConsensusStateWithHeight();return t.height=e.height!==void 0&&e.height!==null?Height.fromPartial(e.height):void 0,t.consensusState=e.consensusState!==void 0&&e.consensusState!==null?Any.fromPartial(e.consensusState):void 0,t}};function createBaseClientConsensusStates(){return{clientId:"",consensusStates:[]}}const ClientConsensusStates={encode(e,t=_m0.Writer.create()){e.clientId!==""&&t.uint32(10).string(e.clientId);for(const n of e.consensusStates)ConsensusStateWithHeight.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseClientConsensusStates();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.clientId=n.string();break;case 2:u.consensusStates.push(ConsensusStateWithHeight.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{clientId:isSet$c(e.clientId)?String(e.clientId):"",consensusStates:Array.isArray(e==null?void 0:e.consensusStates)?e.consensusStates.map(t=>ConsensusStateWithHeight.fromJSON(t)):[]}},toJSON(e){const t={};return e.clientId!==void 0&&(t.clientId=e.clientId),e.consensusStates?t.consensusStates=e.consensusStates.map(n=>n?ConsensusStateWithHeight.toJSON(n):void 0):t.consensusStates=[],t},fromPartial(e){var n;const t=createBaseClientConsensusStates();return t.clientId=e.clientId??"",t.consensusStates=((n=e.consensusStates)==null?void 0:n.map(p=>ConsensusStateWithHeight.fromPartial(p)))||[],t}};function createBaseClientUpdateProposal(){return{title:"",description:"",subjectClientId:"",substituteClientId:""}}const ClientUpdateProposal={encode(e,t=_m0.Writer.create()){return e.title!==""&&t.uint32(10).string(e.title),e.description!==""&&t.uint32(18).string(e.description),e.subjectClientId!==""&&t.uint32(26).string(e.subjectClientId),e.substituteClientId!==""&&t.uint32(34).string(e.substituteClientId),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseClientUpdateProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.title=n.string();break;case 2:u.description=n.string();break;case 3:u.subjectClientId=n.string();break;case 4:u.substituteClientId=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{title:isSet$c(e.title)?String(e.title):"",description:isSet$c(e.description)?String(e.description):"",subjectClientId:isSet$c(e.subjectClientId)?String(e.subjectClientId):"",substituteClientId:isSet$c(e.substituteClientId)?String(e.substituteClientId):""}},toJSON(e){const t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),e.subjectClientId!==void 0&&(t.subjectClientId=e.subjectClientId),e.substituteClientId!==void 0&&(t.substituteClientId=e.substituteClientId),t},fromPartial(e){const t=createBaseClientUpdateProposal();return t.title=e.title??"",t.description=e.description??"",t.subjectClientId=e.subjectClientId??"",t.substituteClientId=e.substituteClientId??"",t}};function createBaseUpgradeProposal(){return{title:"",description:"",plan:void 0,upgradedClientState:void 0}}const UpgradeProposal={encode(e,t=_m0.Writer.create()){return e.title!==""&&t.uint32(10).string(e.title),e.description!==""&&t.uint32(18).string(e.description),e.plan!==void 0&&Plan.encode(e.plan,t.uint32(26).fork()).ldelim(),e.upgradedClientState!==void 0&&Any.encode(e.upgradedClientState,t.uint32(34).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseUpgradeProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.title=n.string();break;case 2:u.description=n.string();break;case 3:u.plan=Plan.decode(n,n.uint32());break;case 4:u.upgradedClientState=Any.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{title:isSet$c(e.title)?String(e.title):"",description:isSet$c(e.description)?String(e.description):"",plan:isSet$c(e.plan)?Plan.fromJSON(e.plan):void 0,upgradedClientState:isSet$c(e.upgradedClientState)?Any.fromJSON(e.upgradedClientState):void 0}},toJSON(e){const t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),e.plan!==void 0&&(t.plan=e.plan?Plan.toJSON(e.plan):void 0),e.upgradedClientState!==void 0&&(t.upgradedClientState=e.upgradedClientState?Any.toJSON(e.upgradedClientState):void 0),t},fromPartial(e){const t=createBaseUpgradeProposal();return t.title=e.title??"",t.description=e.description??"",t.plan=e.plan!==void 0&&e.plan!==null?Plan.fromPartial(e.plan):void 0,t.upgradedClientState=e.upgradedClientState!==void 0&&e.upgradedClientState!==null?Any.fromPartial(e.upgradedClientState):void 0,t}};function createBaseHeight(){return{revisionNumber:0,revisionHeight:0}}const Height={encode(e,t=_m0.Writer.create()){return e.revisionNumber!==0&&t.uint32(8).uint64(e.revisionNumber),e.revisionHeight!==0&&t.uint32(16).uint64(e.revisionHeight),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseHeight();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.revisionNumber=longToNumber$7(n.uint64());break;case 2:u.revisionHeight=longToNumber$7(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{revisionNumber:isSet$c(e.revisionNumber)?Number(e.revisionNumber):0,revisionHeight:isSet$c(e.revisionHeight)?Number(e.revisionHeight):0}},toJSON(e){const t={};return e.revisionNumber!==void 0&&(t.revisionNumber=Math.round(e.revisionNumber)),e.revisionHeight!==void 0&&(t.revisionHeight=Math.round(e.revisionHeight)),t},fromPartial(e){const t=createBaseHeight();return t.revisionNumber=e.revisionNumber??0,t.revisionHeight=e.revisionHeight??0,t}};function createBaseParams$3(){return{allowedClients:[]}}const Params$3={encode(e,t=_m0.Writer.create()){for(const n of e.allowedClients)t.uint32(10).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$3();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.allowedClients.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{allowedClients:Array.isArray(e==null?void 0:e.allowedClients)?e.allowedClients.map(t=>String(t)):[]}},toJSON(e){const t={};return e.allowedClients?t.allowedClients=e.allowedClients.map(n=>n):t.allowedClients=[],t},fromPartial(e){var n;const t=createBaseParams$3();return t.allowedClients=((n=e.allowedClients)==null?void 0:n.map(p=>p))||[],t}};var globalThis$e=(()=>{if(typeof globalThis$e<"u")return globalThis$e;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$7(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$e.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$c(e){return e!=null}function createBaseGenesisMetadata(){return{key:new Uint8Array,value:new Uint8Array}}const GenesisMetadata={encode(e,t=_m0.Writer.create()){return e.key.length!==0&&t.uint32(10).bytes(e.key),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseGenesisMetadata();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.key=n.bytes();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{key:isSet$b(e.key)?bytesFromBase64$5(e.key):new Uint8Array,value:isSet$b(e.value)?bytesFromBase64$5(e.value):new Uint8Array}},toJSON(e){const t={};return e.key!==void 0&&(t.key=base64FromBytes$5(e.key!==void 0?e.key:new Uint8Array)),e.value!==void 0&&(t.value=base64FromBytes$5(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseGenesisMetadata();return t.key=e.key??new Uint8Array,t.value=e.value??new Uint8Array,t}};function createBaseIdentifiedGenesisMetadata(){return{clientId:"",clientMetadata:[]}}const IdentifiedGenesisMetadata={encode(e,t=_m0.Writer.create()){e.clientId!==""&&t.uint32(10).string(e.clientId);for(const n of e.clientMetadata)GenesisMetadata.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseIdentifiedGenesisMetadata();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.clientId=n.string();break;case 2:u.clientMetadata.push(GenesisMetadata.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{clientId:isSet$b(e.clientId)?String(e.clientId):"",clientMetadata:Array.isArray(e==null?void 0:e.clientMetadata)?e.clientMetadata.map(t=>GenesisMetadata.fromJSON(t)):[]}},toJSON(e){const t={};return e.clientId!==void 0&&(t.clientId=e.clientId),e.clientMetadata?t.clientMetadata=e.clientMetadata.map(n=>n?GenesisMetadata.toJSON(n):void 0):t.clientMetadata=[],t},fromPartial(e){var n;const t=createBaseIdentifiedGenesisMetadata();return t.clientId=e.clientId??"",t.clientMetadata=((n=e.clientMetadata)==null?void 0:n.map(p=>GenesisMetadata.fromPartial(p)))||[],t}};var globalThis$d=(()=>{if(typeof globalThis$d<"u")return globalThis$d;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$5(e){if(globalThis$d.Buffer)return Uint8Array.from(globalThis$d.Buffer.from(e,"base64"));{const t=globalThis$d.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$5(e){if(globalThis$d.Buffer)return globalThis$d.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$d.btoa(t.join(""))}}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$b(e){return e!=null}new build$b.Registry(msgTypes$3);function getStructure$3(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$3=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$3=({addr:e}={addr:"http://localhost:1317"})=>new Api$3({baseURL:e});let SDKModule$3=class{constructor(t){this.registry=[],this.query=queryClient$3({addr:t.env.apiURL}),this.updateTX(t),this.structure={IdentifiedClientState:getStructure$3(IdentifiedClientState.fromPartial({})),ConsensusStateWithHeight:getStructure$3(ConsensusStateWithHeight.fromPartial({})),ClientConsensusStates:getStructure$3(ClientConsensusStates.fromPartial({})),ClientUpdateProposal:getStructure$3(ClientUpdateProposal.fromPartial({})),UpgradeProposal:getStructure$3(UpgradeProposal.fromPartial({})),Height:getStructure$3(Height.fromPartial({})),Params:getStructure$3(Params$3.fromPartial({})),GenesisMetadata:getStructure$3(GenesisMetadata.fromPartial({})),IdentifiedGenesisMetadata:getStructure$3(IdentifiedGenesisMetadata.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$3({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$3=e=>({module:{IbcCoreClientV1:new SDKModule$3(e)},registry:msgTypes$3}),msgTypes$2=[];let HttpClient$2=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$2=class extends HttpClient$2{constructor(){super(...arguments),this.queryClientConnections=(t,n={})=>this.request({path:`/ibc/core/connection/v1/client_connections/${t}`,method:"GET",format:"json",...n}),this.queryConnections=(t,n={})=>this.request({path:"/ibc/core/connection/v1/connections",method:"GET",query:t,format:"json",...n}),this.queryConnection=(t,n={})=>this.request({path:`/ibc/core/connection/v1/connections/${t}`,method:"GET",format:"json",...n}),this.queryConnectionClientState=(t,n={})=>this.request({path:`/ibc/core/connection/v1/connections/${t}/client_state`,method:"GET",format:"json",...n}),this.queryConnectionConsensusState=(t,n,p,u={})=>this.request({path:`/ibc/core/connection/v1/connections/${t}/consensus_state/revision/${n}/height/${p}`,method:"GET",format:"json",...u}),this.queryConnectionParams=(t={})=>this.request({path:"/ibc/core/connection/v1/params",method:"GET",format:"json",...t})}};var globalThis$c=(()=>{if(typeof globalThis$c<"u")return globalThis$c;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function createBaseMerklePrefix(){return{keyPrefix:new Uint8Array}}const MerklePrefix={encode(e,t=_m0.Writer.create()){return e.keyPrefix.length!==0&&t.uint32(10).bytes(e.keyPrefix),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMerklePrefix();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.keyPrefix=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{keyPrefix:isSet$a(e.keyPrefix)?bytesFromBase64$4(e.keyPrefix):new Uint8Array}},toJSON(e){const t={};return e.keyPrefix!==void 0&&(t.keyPrefix=base64FromBytes$4(e.keyPrefix!==void 0?e.keyPrefix:new Uint8Array)),t},fromPartial(e){const t=createBaseMerklePrefix();return t.keyPrefix=e.keyPrefix??new Uint8Array,t}};var globalThis$b=(()=>{if(typeof globalThis$b<"u")return globalThis$b;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$4(e){if(globalThis$b.Buffer)return Uint8Array.from(globalThis$b.Buffer.from(e,"base64"));{const t=globalThis$b.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$4(e){if(globalThis$b.Buffer)return globalThis$b.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$b.btoa(t.join(""))}}function isSet$a(e){return e!=null}function stateFromJSON(e){switch(e){case 0:case"STATE_UNINITIALIZED_UNSPECIFIED":return 0;case 1:case"STATE_INIT":return 1;case 2:case"STATE_TRYOPEN":return 2;case 3:case"STATE_OPEN":return 3;case-1:case"UNRECOGNIZED":default:return-1}}function stateToJSON(e){switch(e){case 0:return"STATE_UNINITIALIZED_UNSPECIFIED";case 1:return"STATE_INIT";case 2:return"STATE_TRYOPEN";case 3:return"STATE_OPEN";case-1:default:return"UNRECOGNIZED"}}function createBaseConnectionEnd(){return{clientId:"",versions:[],state:0,counterparty:void 0,delayPeriod:0}}const ConnectionEnd={encode(e,t=_m0.Writer.create()){e.clientId!==""&&t.uint32(10).string(e.clientId);for(const n of e.versions)Version.encode(n,t.uint32(18).fork()).ldelim();return e.state!==0&&t.uint32(24).int32(e.state),e.counterparty!==void 0&&Counterparty.encode(e.counterparty,t.uint32(34).fork()).ldelim(),e.delayPeriod!==0&&t.uint32(40).uint64(e.delayPeriod),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseConnectionEnd();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.clientId=n.string();break;case 2:u.versions.push(Version.decode(n,n.uint32()));break;case 3:u.state=n.int32();break;case 4:u.counterparty=Counterparty.decode(n,n.uint32());break;case 5:u.delayPeriod=longToNumber$6(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{clientId:isSet$9(e.clientId)?String(e.clientId):"",versions:Array.isArray(e==null?void 0:e.versions)?e.versions.map(t=>Version.fromJSON(t)):[],state:isSet$9(e.state)?stateFromJSON(e.state):0,counterparty:isSet$9(e.counterparty)?Counterparty.fromJSON(e.counterparty):void 0,delayPeriod:isSet$9(e.delayPeriod)?Number(e.delayPeriod):0}},toJSON(e){const t={};return e.clientId!==void 0&&(t.clientId=e.clientId),e.versions?t.versions=e.versions.map(n=>n?Version.toJSON(n):void 0):t.versions=[],e.state!==void 0&&(t.state=stateToJSON(e.state)),e.counterparty!==void 0&&(t.counterparty=e.counterparty?Counterparty.toJSON(e.counterparty):void 0),e.delayPeriod!==void 0&&(t.delayPeriod=Math.round(e.delayPeriod)),t},fromPartial(e){var n;const t=createBaseConnectionEnd();return t.clientId=e.clientId??"",t.versions=((n=e.versions)==null?void 0:n.map(p=>Version.fromPartial(p)))||[],t.state=e.state??0,t.counterparty=e.counterparty!==void 0&&e.counterparty!==null?Counterparty.fromPartial(e.counterparty):void 0,t.delayPeriod=e.delayPeriod??0,t}};function createBaseIdentifiedConnection(){return{id:"",clientId:"",versions:[],state:0,counterparty:void 0,delayPeriod:0}}const IdentifiedConnection={encode(e,t=_m0.Writer.create()){e.id!==""&&t.uint32(10).string(e.id),e.clientId!==""&&t.uint32(18).string(e.clientId);for(const n of e.versions)Version.encode(n,t.uint32(26).fork()).ldelim();return e.state!==0&&t.uint32(32).int32(e.state),e.counterparty!==void 0&&Counterparty.encode(e.counterparty,t.uint32(42).fork()).ldelim(),e.delayPeriod!==0&&t.uint32(48).uint64(e.delayPeriod),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseIdentifiedConnection();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.id=n.string();break;case 2:u.clientId=n.string();break;case 3:u.versions.push(Version.decode(n,n.uint32()));break;case 4:u.state=n.int32();break;case 5:u.counterparty=Counterparty.decode(n,n.uint32());break;case 6:u.delayPeriod=longToNumber$6(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{id:isSet$9(e.id)?String(e.id):"",clientId:isSet$9(e.clientId)?String(e.clientId):"",versions:Array.isArray(e==null?void 0:e.versions)?e.versions.map(t=>Version.fromJSON(t)):[],state:isSet$9(e.state)?stateFromJSON(e.state):0,counterparty:isSet$9(e.counterparty)?Counterparty.fromJSON(e.counterparty):void 0,delayPeriod:isSet$9(e.delayPeriod)?Number(e.delayPeriod):0}},toJSON(e){const t={};return e.id!==void 0&&(t.id=e.id),e.clientId!==void 0&&(t.clientId=e.clientId),e.versions?t.versions=e.versions.map(n=>n?Version.toJSON(n):void 0):t.versions=[],e.state!==void 0&&(t.state=stateToJSON(e.state)),e.counterparty!==void 0&&(t.counterparty=e.counterparty?Counterparty.toJSON(e.counterparty):void 0),e.delayPeriod!==void 0&&(t.delayPeriod=Math.round(e.delayPeriod)),t},fromPartial(e){var n;const t=createBaseIdentifiedConnection();return t.id=e.id??"",t.clientId=e.clientId??"",t.versions=((n=e.versions)==null?void 0:n.map(p=>Version.fromPartial(p)))||[],t.state=e.state??0,t.counterparty=e.counterparty!==void 0&&e.counterparty!==null?Counterparty.fromPartial(e.counterparty):void 0,t.delayPeriod=e.delayPeriod??0,t}};function createBaseCounterparty(){return{clientId:"",connectionId:"",prefix:void 0}}const Counterparty={encode(e,t=_m0.Writer.create()){return e.clientId!==""&&t.uint32(10).string(e.clientId),e.connectionId!==""&&t.uint32(18).string(e.connectionId),e.prefix!==void 0&&MerklePrefix.encode(e.prefix,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCounterparty();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.clientId=n.string();break;case 2:u.connectionId=n.string();break;case 3:u.prefix=MerklePrefix.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{clientId:isSet$9(e.clientId)?String(e.clientId):"",connectionId:isSet$9(e.connectionId)?String(e.connectionId):"",prefix:isSet$9(e.prefix)?MerklePrefix.fromJSON(e.prefix):void 0}},toJSON(e){const t={};return e.clientId!==void 0&&(t.clientId=e.clientId),e.connectionId!==void 0&&(t.connectionId=e.connectionId),e.prefix!==void 0&&(t.prefix=e.prefix?MerklePrefix.toJSON(e.prefix):void 0),t},fromPartial(e){const t=createBaseCounterparty();return t.clientId=e.clientId??"",t.connectionId=e.connectionId??"",t.prefix=e.prefix!==void 0&&e.prefix!==null?MerklePrefix.fromPartial(e.prefix):void 0,t}};function createBaseClientPaths(){return{paths:[]}}const ClientPaths={encode(e,t=_m0.Writer.create()){for(const n of e.paths)t.uint32(10).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseClientPaths();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.paths.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{paths:Array.isArray(e==null?void 0:e.paths)?e.paths.map(t=>String(t)):[]}},toJSON(e){const t={};return e.paths?t.paths=e.paths.map(n=>n):t.paths=[],t},fromPartial(e){var n;const t=createBaseClientPaths();return t.paths=((n=e.paths)==null?void 0:n.map(p=>p))||[],t}};function createBaseConnectionPaths(){return{clientId:"",paths:[]}}const ConnectionPaths={encode(e,t=_m0.Writer.create()){e.clientId!==""&&t.uint32(10).string(e.clientId);for(const n of e.paths)t.uint32(18).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseConnectionPaths();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.clientId=n.string();break;case 2:u.paths.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{clientId:isSet$9(e.clientId)?String(e.clientId):"",paths:Array.isArray(e==null?void 0:e.paths)?e.paths.map(t=>String(t)):[]}},toJSON(e){const t={};return e.clientId!==void 0&&(t.clientId=e.clientId),e.paths?t.paths=e.paths.map(n=>n):t.paths=[],t},fromPartial(e){var n;const t=createBaseConnectionPaths();return t.clientId=e.clientId??"",t.paths=((n=e.paths)==null?void 0:n.map(p=>p))||[],t}};function createBaseVersion(){return{identifier:"",features:[]}}const Version={encode(e,t=_m0.Writer.create()){e.identifier!==""&&t.uint32(10).string(e.identifier);for(const n of e.features)t.uint32(18).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseVersion();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.identifier=n.string();break;case 2:u.features.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{identifier:isSet$9(e.identifier)?String(e.identifier):"",features:Array.isArray(e==null?void 0:e.features)?e.features.map(t=>String(t)):[]}},toJSON(e){const t={};return e.identifier!==void 0&&(t.identifier=e.identifier),e.features?t.features=e.features.map(n=>n):t.features=[],t},fromPartial(e){var n;const t=createBaseVersion();return t.identifier=e.identifier??"",t.features=((n=e.features)==null?void 0:n.map(p=>p))||[],t}};function createBaseParams$2(){return{maxExpectedTimePerBlock:0}}const Params$2={encode(e,t=_m0.Writer.create()){return e.maxExpectedTimePerBlock!==0&&t.uint32(8).uint64(e.maxExpectedTimePerBlock),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.maxExpectedTimePerBlock=longToNumber$6(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{maxExpectedTimePerBlock:isSet$9(e.maxExpectedTimePerBlock)?Number(e.maxExpectedTimePerBlock):0}},toJSON(e){const t={};return e.maxExpectedTimePerBlock!==void 0&&(t.maxExpectedTimePerBlock=Math.round(e.maxExpectedTimePerBlock)),t},fromPartial(e){const t=createBaseParams$2();return t.maxExpectedTimePerBlock=e.maxExpectedTimePerBlock??0,t}};var globalThis$a=(()=>{if(typeof globalThis$a<"u")return globalThis$a;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$6(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$a.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$9(e){return e!=null}new build$b.Registry(msgTypes$2);function getStructure$2(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$2=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$2=({addr:e}={addr:"http://localhost:1317"})=>new Api$2({baseURL:e});let SDKModule$2=class{constructor(t){this.registry=[],this.query=queryClient$2({addr:t.env.apiURL}),this.updateTX(t),this.structure={ConnectionEnd:getStructure$2(ConnectionEnd.fromPartial({})),IdentifiedConnection:getStructure$2(IdentifiedConnection.fromPartial({})),Counterparty:getStructure$2(Counterparty.fromPartial({})),ClientPaths:getStructure$2(ClientPaths.fromPartial({})),ConnectionPaths:getStructure$2(ConnectionPaths.fromPartial({})),Version:getStructure$2(Version.fromPartial({})),Params:getStructure$2(Params$2.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$2({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$2=e=>({module:{IbcCoreConnectionV1:new SDKModule$2(e)},registry:msgTypes$2});function createBaseCoin(){return{denom:"",amount:""}}const Coin={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$8(e.denom)?String(e.denom):"",amount:isSet$8(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$8(e){return e!=null}function createBaseMsgMint$1(){return{creator:"",amount:void 0}}const MsgMint$1={encode(e,t=_m0.Writer.create()){return e.creator!==""&&t.uint32(10).string(e.creator),e.amount!==void 0&&Coin.encode(e.amount,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgMint$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.creator=n.string();break;case 2:u.amount=Coin.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{creator:isSet$7(e.creator)?String(e.creator):"",amount:isSet$7(e.amount)?Coin.fromJSON(e.amount):void 0}},toJSON(e){const t={};return e.creator!==void 0&&(t.creator=e.creator),e.amount!==void 0&&(t.amount=e.amount?Coin.toJSON(e.amount):void 0),t},fromPartial(e){const t=createBaseMsgMint$1();return t.creator=e.creator??"",t.amount=e.amount!==void 0&&e.amount!==null?Coin.fromPartial(e.amount):void 0,t}};function createBaseMsgInit(){return{creator:"",address:""}}const MsgInit={encode(e,t=_m0.Writer.create()){return e.creator!==""&&t.uint32(10).string(e.creator),e.address!==""&&t.uint32(18).string(e.address),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgInit();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.creator=n.string();break;case 2:u.address=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{creator:isSet$7(e.creator)?String(e.creator):"",address:isSet$7(e.address)?String(e.address):""}},toJSON(e){const t={};return e.creator!==void 0&&(t.creator=e.creator),e.address!==void 0&&(t.address=e.address),t},fromPartial(e){const t=createBaseMsgInit();return t.creator=e.creator??"",t.address=e.address??"",t}};var globalThis$9=(()=>{if(typeof globalThis$9<"u")return globalThis$9;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$7(e){return e!=null}const msgTypes$1=[["/iconlake.drop.MsgInit",MsgInit],["/iconlake.drop.MsgMint",MsgMint$1]];let HttpClient$1=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$1=class extends HttpClient$1{constructor(){super(...arguments),this.queryInfoAll=(t,n={})=>this.request({path:"/iconlake/drop/info",method:"GET",query:t,format:"json",...n}),this.queryInfo=(t,n={})=>this.request({path:`/iconlake/drop/info/${t}`,method:"GET",format:"json",...n}),this.queryParams=(t={})=>this.request({path:"/iconlake/drop/params",method:"GET",format:"json",...t})}};function createBaseInfo(){return{address:"",lastMintTime:0}}const Info={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.lastMintTime!==0&&t.uint32(16).int64(e.lastMintTime),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.lastMintTime=longToNumber$5(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$6(e.address)?String(e.address):"",lastMintTime:isSet$6(e.lastMintTime)?Number(e.lastMintTime):0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.lastMintTime!==void 0&&(t.lastMintTime=Math.round(e.lastMintTime)),t},fromPartial(e){const t=createBaseInfo();return t.address=e.address??"",t.lastMintTime=e.lastMintTime??0,t}};function createBaseInfoRaw(){return{address:new Uint8Array,lastMintTime:0}}const InfoRaw={encode(e,t=_m0.Writer.create()){return e.address.length!==0&&t.uint32(10).bytes(e.address),e.lastMintTime!==0&&t.uint32(16).int64(e.lastMintTime),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseInfoRaw();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.bytes();break;case 2:u.lastMintTime=longToNumber$5(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$6(e.address)?bytesFromBase64$3(e.address):new Uint8Array,lastMintTime:isSet$6(e.lastMintTime)?Number(e.lastMintTime):0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=base64FromBytes$3(e.address!==void 0?e.address:new Uint8Array)),e.lastMintTime!==void 0&&(t.lastMintTime=Math.round(e.lastMintTime)),t},fromPartial(e){const t=createBaseInfoRaw();return t.address=e.address??new Uint8Array,t.lastMintTime=e.lastMintTime??0,t}};var globalThis$8=(()=>{if(typeof globalThis$8<"u")return globalThis$8;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$3(e){if(globalThis$8.Buffer)return Uint8Array.from(globalThis$8.Buffer.from(e,"base64"));{const t=globalThis$8.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$3(e){if(globalThis$8.Buffer)return globalThis$8.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$8.btoa(t.join(""))}}function longToNumber$5(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$8.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$6(e){return e!=null}function createBaseParams$1(){return{initAmount:0,minAmountPerMint:0,maxAmountPerMint:0}}const Params$1={encode(e,t=_m0.Writer.create()){return e.initAmount!==0&&t.uint32(8).int64(e.initAmount),e.minAmountPerMint!==0&&t.uint32(16).int64(e.minAmountPerMint),e.maxAmountPerMint!==0&&t.uint32(24).int64(e.maxAmountPerMint),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.initAmount=longToNumber$4(n.int64());break;case 2:u.minAmountPerMint=longToNumber$4(n.int64());break;case 3:u.maxAmountPerMint=longToNumber$4(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{initAmount:isSet$5(e.initAmount)?Number(e.initAmount):0,minAmountPerMint:isSet$5(e.minAmountPerMint)?Number(e.minAmountPerMint):0,maxAmountPerMint:isSet$5(e.maxAmountPerMint)?Number(e.maxAmountPerMint):0}},toJSON(e){const t={};return e.initAmount!==void 0&&(t.initAmount=Math.round(e.initAmount)),e.minAmountPerMint!==void 0&&(t.minAmountPerMint=Math.round(e.minAmountPerMint)),e.maxAmountPerMint!==void 0&&(t.maxAmountPerMint=Math.round(e.maxAmountPerMint)),t},fromPartial(e){const t=createBaseParams$1();return t.initAmount=e.initAmount??0,t.minAmountPerMint=e.minAmountPerMint??0,t.maxAmountPerMint=e.maxAmountPerMint??0,t}};var globalThis$7=(()=>{if(typeof globalThis$7<"u")return globalThis$7;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$4(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$7.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$5(e){return e!=null}const registry$2=new build$b.Registry(msgTypes$1);function getStructure$1(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$1={amount:[],gas:"200000"},txClient$1=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgInit({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgInit: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$2,prefix:t});let N=this.msgInit({value:MsgInit.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$1,g)}catch(y){throw new Error("TxClient:sendMsgInit: Could not broadcast Tx: "+y.message)}},async sendMsgMint({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgMint: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$2,prefix:t});let N=this.msgMint({value:MsgMint$1.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$1,g)}catch(y){throw new Error("TxClient:sendMsgMint: Could not broadcast Tx: "+y.message)}},msgInit({value:p}){try{return{typeUrl:"/iconlake.drop.MsgInit",value:MsgInit.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgInit: Could not create message: "+u.message)}},msgMint({value:p}){try{return{typeUrl:"/iconlake.drop.MsgMint",value:MsgMint$1.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgMint: Could not create message: "+u.message)}}}),queryClient$1=({addr:e}={addr:"http://localhost:1317"})=>new Api$1({baseURL:e});let SDKModule$1=class{constructor(t){this.registry=[],this.query=queryClient$1({addr:t.env.apiURL}),this.updateTX(t),this.structure={Info:getStructure$1(Info.fromPartial({})),InfoRaw:getStructure$1(InfoRaw.fromPartial({})),Params:getStructure$1(Params$1.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$1({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$1=e=>({module:{IconlakeDrop:new SDKModule$1(e)},registry:msgTypes$1});function createBaseMsgMint(){return{creator:"",classId:"",id:"",name:"",description:"",uri:"",uriHash:"",supply:0}}const MsgMint={encode(e,t=_m0.Writer.create()){return e.creator!==""&&t.uint32(10).string(e.creator),e.classId!==""&&t.uint32(18).string(e.classId),e.id!==""&&t.uint32(26).string(e.id),e.name!==""&&t.uint32(34).string(e.name),e.description!==""&&t.uint32(42).string(e.description),e.uri!==""&&t.uint32(50).string(e.uri),e.uriHash!==""&&t.uint32(58).string(e.uriHash),e.supply!==0&&t.uint32(64).uint64(e.supply),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgMint();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.creator=n.string();break;case 2:u.classId=n.string();break;case 3:u.id=n.string();break;case 4:u.name=n.string();break;case 5:u.description=n.string();break;case 6:u.uri=n.string();break;case 7:u.uriHash=n.string();break;case 8:u.supply=longToNumber$3(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{creator:isSet$4(e.creator)?String(e.creator):"",classId:isSet$4(e.classId)?String(e.classId):"",id:isSet$4(e.id)?String(e.id):"",name:isSet$4(e.name)?String(e.name):"",description:isSet$4(e.description)?String(e.description):"",uri:isSet$4(e.uri)?String(e.uri):"",uriHash:isSet$4(e.uriHash)?String(e.uriHash):"",supply:isSet$4(e.supply)?Number(e.supply):0}},toJSON(e){const t={};return e.creator!==void 0&&(t.creator=e.creator),e.classId!==void 0&&(t.classId=e.classId),e.id!==void 0&&(t.id=e.id),e.name!==void 0&&(t.name=e.name),e.description!==void 0&&(t.description=e.description),e.uri!==void 0&&(t.uri=e.uri),e.uriHash!==void 0&&(t.uriHash=e.uriHash),e.supply!==void 0&&(t.supply=Math.round(e.supply)),t},fromPartial(e){const t=createBaseMsgMint();return t.creator=e.creator??"",t.classId=e.classId??"",t.id=e.id??"",t.name=e.name??"",t.description=e.description??"",t.uri=e.uri??"",t.uriHash=e.uriHash??"",t.supply=e.supply??0,t}};function createBaseMsgUpdateClass(){return{creator:"",id:"",name:"",symbol:"",description:"",uri:"",uriHash:""}}const MsgUpdateClass={encode(e,t=_m0.Writer.create()){return e.creator!==""&&t.uint32(10).string(e.creator),e.id!==""&&t.uint32(18).string(e.id),e.name!==""&&t.uint32(26).string(e.name),e.symbol!==""&&t.uint32(34).string(e.symbol),e.description!==""&&t.uint32(42).string(e.description),e.uri!==""&&t.uint32(50).string(e.uri),e.uriHash!==""&&t.uint32(58).string(e.uriHash),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateClass();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.creator=n.string();break;case 2:u.id=n.string();break;case 3:u.name=n.string();break;case 4:u.symbol=n.string();break;case 5:u.description=n.string();break;case 6:u.uri=n.string();break;case 7:u.uriHash=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{creator:isSet$4(e.creator)?String(e.creator):"",id:isSet$4(e.id)?String(e.id):"",name:isSet$4(e.name)?String(e.name):"",symbol:isSet$4(e.symbol)?String(e.symbol):"",description:isSet$4(e.description)?String(e.description):"",uri:isSet$4(e.uri)?String(e.uri):"",uriHash:isSet$4(e.uriHash)?String(e.uriHash):""}},toJSON(e){const t={};return e.creator!==void 0&&(t.creator=e.creator),e.id!==void 0&&(t.id=e.id),e.name!==void 0&&(t.name=e.name),e.symbol!==void 0&&(t.symbol=e.symbol),e.description!==void 0&&(t.description=e.description),e.uri!==void 0&&(t.uri=e.uri),e.uriHash!==void 0&&(t.uriHash=e.uriHash),t},fromPartial(e){const t=createBaseMsgUpdateClass();return t.creator=e.creator??"",t.id=e.id??"",t.name=e.name??"",t.symbol=e.symbol??"",t.description=e.description??"",t.uri=e.uri??"",t.uriHash=e.uriHash??"",t}};function createBaseMsgBurn(){return{creator:"",classId:"",id:""}}const MsgBurn={encode(e,t=_m0.Writer.create()){return e.creator!==""&&t.uint32(10).string(e.creator),e.classId!==""&&t.uint32(18).string(e.classId),e.id!==""&&t.uint32(26).string(e.id),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgBurn();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.creator=n.string();break;case 2:u.classId=n.string();break;case 3:u.id=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{creator:isSet$4(e.creator)?String(e.creator):"",classId:isSet$4(e.classId)?String(e.classId):"",id:isSet$4(e.id)?String(e.id):""}},toJSON(e){const t={};return e.creator!==void 0&&(t.creator=e.creator),e.classId!==void 0&&(t.classId=e.classId),e.id!==void 0&&(t.id=e.id),t},fromPartial(e){const t=createBaseMsgBurn();return t.creator=e.creator??"",t.classId=e.classId??"",t.id=e.id??"",t}};var globalThis$6=(()=>{if(typeof globalThis$6<"u")return globalThis$6;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$3(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$6.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$4(e){return e!=null}const msgTypes=[["/iconlake.icon.MsgBurn",MsgBurn],["/iconlake.icon.MsgUpdateClass",MsgUpdateClass],["/iconlake.icon.MsgMint",MsgMint]];class HttpClient{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}}class Api extends HttpClient{constructor(){super(...arguments),this.queryClass=(t,n={})=>this.request({path:"/iconlake/icon/class",method:"GET",query:t,format:"json",...n}),this.queryClasses=(t,n={})=>this.request({path:"/iconlake/icon/classes",method:"GET",query:t,format:"json",...n}),this.queryHash=(t,n={})=>this.request({path:"/iconlake/icon/hash",method:"POST",body:t,type:"application/json",format:"json",...n}),this.queryNFT=(t,n={})=>this.request({path:"/iconlake/icon/nft",method:"GET",query:t,format:"json",...n}),this.queryNFTs=(t,n={})=>this.request({path:"/iconlake/icon/nfts",method:"GET",query:t,format:"json",...n}),this.queryParams=(t={})=>this.request({path:"/iconlake/icon/params",method:"GET",format:"json",...t})}}function createBaseClassData(){return{author:"",createTime:0}}const ClassData={encode(e,t=_m0.Writer.create()){return e.author!==""&&t.uint32(10).string(e.author),e.createTime!==0&&t.uint32(16).int64(e.createTime),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseClassData();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.author=n.string();break;case 2:u.createTime=longToNumber$2(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{author:isSet$3(e.author)?String(e.author):"",createTime:isSet$3(e.createTime)?Number(e.createTime):0}},toJSON(e){const t={};return e.author!==void 0&&(t.author=e.author),e.createTime!==void 0&&(t.createTime=Math.round(e.createTime)),t},fromPartial(e){const t=createBaseClassData();return t.author=e.author??"",t.createTime=e.createTime??0,t}};function createBaseClassDataRaw(){return{author:new Uint8Array,createTime:0}}const ClassDataRaw={encode(e,t=_m0.Writer.create()){return e.author.length!==0&&t.uint32(10).bytes(e.author),e.createTime!==0&&t.uint32(16).int64(e.createTime),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseClassDataRaw();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.author=n.bytes();break;case 2:u.createTime=longToNumber$2(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{author:isSet$3(e.author)?bytesFromBase64$2(e.author):new Uint8Array,createTime:isSet$3(e.createTime)?Number(e.createTime):0}},toJSON(e){const t={};return e.author!==void 0&&(t.author=base64FromBytes$2(e.author!==void 0?e.author:new Uint8Array)),e.createTime!==void 0&&(t.createTime=Math.round(e.createTime)),t},fromPartial(e){const t=createBaseClassDataRaw();return t.author=e.author??new Uint8Array,t.createTime=e.createTime??0,t}};var globalThis$5=(()=>{if(typeof globalThis$5<"u")return globalThis$5;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$2(e){if(globalThis$5.Buffer)return Uint8Array.from(globalThis$5.Buffer.from(e,"base64"));{const t=globalThis$5.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$2(e){if(globalThis$5.Buffer)return globalThis$5.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$5.btoa(t.join(""))}}function longToNumber$2(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$5.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$3(e){return e!=null}function createBaseIconData(){return{author:"",name:"",description:"",createTime:0}}const IconData={encode(e,t=_m0.Writer.create()){return e.author!==""&&t.uint32(10).string(e.author),e.name!==""&&t.uint32(18).string(e.name),e.description!==""&&t.uint32(26).string(e.description),e.createTime!==0&&t.uint32(32).int64(e.createTime),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseIconData();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.author=n.string();break;case 2:u.name=n.string();break;case 3:u.description=n.string();break;case 4:u.createTime=longToNumber$1(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{author:isSet$2(e.author)?String(e.author):"",name:isSet$2(e.name)?String(e.name):"",description:isSet$2(e.description)?String(e.description):"",createTime:isSet$2(e.createTime)?Number(e.createTime):0}},toJSON(e){const t={};return e.author!==void 0&&(t.author=e.author),e.name!==void 0&&(t.name=e.name),e.description!==void 0&&(t.description=e.description),e.createTime!==void 0&&(t.createTime=Math.round(e.createTime)),t},fromPartial(e){const t=createBaseIconData();return t.author=e.author??"",t.name=e.name??"",t.description=e.description??"",t.createTime=e.createTime??0,t}};function createBaseIconDataRaw(){return{author:new Uint8Array,name:"",description:"",createTime:0}}const IconDataRaw={encode(e,t=_m0.Writer.create()){return e.author.length!==0&&t.uint32(10).bytes(e.author),e.name!==""&&t.uint32(18).string(e.name),e.description!==""&&t.uint32(26).string(e.description),e.createTime!==0&&t.uint32(32).int64(e.createTime),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseIconDataRaw();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.author=n.bytes();break;case 2:u.name=n.string();break;case 3:u.description=n.string();break;case 4:u.createTime=longToNumber$1(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{author:isSet$2(e.author)?bytesFromBase64$1(e.author):new Uint8Array,name:isSet$2(e.name)?String(e.name):"",description:isSet$2(e.description)?String(e.description):"",createTime:isSet$2(e.createTime)?Number(e.createTime):0}},toJSON(e){const t={};return e.author!==void 0&&(t.author=base64FromBytes$1(e.author!==void 0?e.author:new Uint8Array)),e.name!==void 0&&(t.name=e.name),e.description!==void 0&&(t.description=e.description),e.createTime!==void 0&&(t.createTime=Math.round(e.createTime)),t},fromPartial(e){const t=createBaseIconDataRaw();return t.author=e.author??new Uint8Array,t.name=e.name??"",t.description=e.description??"",t.createTime=e.createTime??0,t}};var globalThis$4=(()=>{if(typeof globalThis$4<"u")return globalThis$4;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$1(e){if(globalThis$4.Buffer)return Uint8Array.from(globalThis$4.Buffer.from(e,"base64"));{const t=globalThis$4.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$1(e){if(globalThis$4.Buffer)return globalThis$4.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$4.btoa(t.join(""))}}function longToNumber$1(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$4.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$2(e){return e!=null}function createBaseParams(){return{}}const Params={encode(e,t=_m0.Writer.create()){return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){default:n.skipType(g&7);break}}return u},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return createBaseParams()}};function createBasePageResponse(){return{nextKey:new Uint8Array,total:0}}const PageResponse={encode(e,t=_m0.Writer.create()){return e.nextKey.length!==0&&t.uint32(10).bytes(e.nextKey),e.total!==0&&t.uint32(16).uint64(e.total),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePageResponse();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.nextKey=n.bytes();break;case 2:u.total=longToNumber(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{nextKey:isSet$1(e.nextKey)?bytesFromBase64(e.nextKey):new Uint8Array,total:isSet$1(e.total)?Number(e.total):0}},toJSON(e){const t={};return e.nextKey!==void 0&&(t.nextKey=base64FromBytes(e.nextKey!==void 0?e.nextKey:new Uint8Array)),e.total!==void 0&&(t.total=Math.round(e.total)),t},fromPartial(e){const t=createBasePageResponse();return t.nextKey=e.nextKey??new Uint8Array,t.total=e.total??0,t}};var globalThis$3=(()=>{if(typeof globalThis$3<"u")return globalThis$3;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64(e){if(globalThis$3.Buffer)return Uint8Array.from(globalThis$3.Buffer.from(e,"base64"));{const t=globalThis$3.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes(e){if(globalThis$3.Buffer)return globalThis$3.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$3.btoa(t.join(""))}}function longToNumber(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$3.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1(e){return e!=null}var globalThis$2=(()=>{if(typeof globalThis$2<"u")return globalThis$2;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})(),globalThis$1=(()=>{if(typeof globalThis$1<"u")return globalThis$1;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function createBaseNFT(){return{classId:"",id:"",uri:"",uriHash:"",data:void 0}}const NFT={encode(e,t=_m0.Writer.create()){return e.classId!==""&&t.uint32(10).string(e.classId),e.id!==""&&t.uint32(18).string(e.id),e.uri!==""&&t.uint32(26).string(e.uri),e.uriHash!==""&&t.uint32(34).string(e.uriHash),e.data!==void 0&&IconData.encode(e.data,t.uint32(42).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseNFT();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.classId=n.string();break;case 2:u.id=n.string();break;case 3:u.uri=n.string();break;case 4:u.uriHash=n.string();break;case 5:u.data=IconData.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{classId:isSet(e.classId)?String(e.classId):"",id:isSet(e.id)?String(e.id):"",uri:isSet(e.uri)?String(e.uri):"",uriHash:isSet(e.uriHash)?String(e.uriHash):"",data:isSet(e.data)?IconData.fromJSON(e.data):void 0}},toJSON(e){const t={};return e.classId!==void 0&&(t.classId=e.classId),e.id!==void 0&&(t.id=e.id),e.uri!==void 0&&(t.uri=e.uri),e.uriHash!==void 0&&(t.uriHash=e.uriHash),e.data!==void 0&&(t.data=e.data?IconData.toJSON(e.data):void 0),t},fromPartial(e){const t=createBaseNFT();return t.classId=e.classId??"",t.id=e.id??"",t.uri=e.uri??"",t.uriHash=e.uriHash??"",t.data=e.data!==void 0&&e.data!==null?IconData.fromPartial(e.data):void 0,t}};function createBaseQueryNFTsResponse(){return{nfts:[],pagination:void 0}}const QueryNFTsResponse={encode(e,t=_m0.Writer.create()){for(const n of e.nfts)NFT.encode(n,t.uint32(10).fork()).ldelim();return e.pagination!==void 0&&PageResponse.encode(e.pagination,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseQueryNFTsResponse();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.nfts.push(NFT.decode(n,n.uint32()));break;case 2:u.pagination=PageResponse.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{nfts:Array.isArray(e==null?void 0:e.nfts)?e.nfts.map(t=>NFT.fromJSON(t)):[],pagination:isSet(e.pagination)?PageResponse.fromJSON(e.pagination):void 0}},toJSON(e){const t={};return e.nfts?t.nfts=e.nfts.map(n=>n?NFT.toJSON(n):void 0):t.nfts=[],e.pagination!==void 0&&(t.pagination=e.pagination?PageResponse.toJSON(e.pagination):void 0),t},fromPartial(e){var n;const t=createBaseQueryNFTsResponse();return t.nfts=((n=e.nfts)==null?void 0:n.map(p=>NFT.fromPartial(p)))||[],t.pagination=e.pagination!==void 0&&e.pagination!==null?PageResponse.fromPartial(e.pagination):void 0,t}};function createBaseClass(){return{id:"",name:"",symbol:"",description:"",uri:"",uriHash:"",data:void 0}}const Class={encode(e,t=_m0.Writer.create()){return e.id!==""&&t.uint32(10).string(e.id),e.name!==""&&t.uint32(18).string(e.name),e.symbol!==""&&t.uint32(26).string(e.symbol),e.description!==""&&t.uint32(34).string(e.description),e.uri!==""&&t.uint32(42).string(e.uri),e.uriHash!==""&&t.uint32(50).string(e.uriHash),e.data!==void 0&&ClassData.encode(e.data,t.uint32(58).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseClass();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.id=n.string();break;case 2:u.name=n.string();break;case 3:u.symbol=n.string();break;case 4:u.description=n.string();break;case 5:u.uri=n.string();break;case 6:u.uriHash=n.string();break;case 7:u.data=ClassData.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{id:isSet(e.id)?String(e.id):"",name:isSet(e.name)?String(e.name):"",symbol:isSet(e.symbol)?String(e.symbol):"",description:isSet(e.description)?String(e.description):"",uri:isSet(e.uri)?String(e.uri):"",uriHash:isSet(e.uriHash)?String(e.uriHash):"",data:isSet(e.data)?ClassData.fromJSON(e.data):void 0}},toJSON(e){const t={};return e.id!==void 0&&(t.id=e.id),e.name!==void 0&&(t.name=e.name),e.symbol!==void 0&&(t.symbol=e.symbol),e.description!==void 0&&(t.description=e.description),e.uri!==void 0&&(t.uri=e.uri),e.uriHash!==void 0&&(t.uriHash=e.uriHash),e.data!==void 0&&(t.data=e.data?ClassData.toJSON(e.data):void 0),t},fromPartial(e){const t=createBaseClass();return t.id=e.id??"",t.name=e.name??"",t.symbol=e.symbol??"",t.description=e.description??"",t.uri=e.uri??"",t.uriHash=e.uriHash??"",t.data=e.data!==void 0&&e.data!==null?ClassData.fromPartial(e.data):void 0,t}};function createBaseQueryClassesResponse(){return{classes:[],pagination:void 0}}const QueryClassesResponse={encode(e,t=_m0.Writer.create()){for(const n of e.classes)Class.encode(n,t.uint32(10).fork()).ldelim();return e.pagination!==void 0&&PageResponse.encode(e.pagination,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseQueryClassesResponse();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.classes.push(Class.decode(n,n.uint32()));break;case 2:u.pagination=PageResponse.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{classes:Array.isArray(e==null?void 0:e.classes)?e.classes.map(t=>Class.fromJSON(t)):[],pagination:isSet(e.pagination)?PageResponse.fromJSON(e.pagination):void 0}},toJSON(e){const t={};return e.classes?t.classes=e.classes.map(n=>n?Class.toJSON(n):void 0):t.classes=[],e.pagination!==void 0&&(t.pagination=e.pagination?PageResponse.toJSON(e.pagination):void 0),t},fromPartial(e){var n;const t=createBaseQueryClassesResponse();return t.classes=((n=e.classes)==null?void 0:n.map(p=>Class.fromPartial(p)))||[],t.pagination=e.pagination!==void 0&&e.pagination!==null?PageResponse.fromPartial(e.pagination):void 0,t}};function isSet(e){return e!=null}const registry$1=new build$b.Registry(msgTypes);function getStructure(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee={amount:[],gas:"200000"},txClient=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgBurn({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgBurn: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$1,prefix:t});let N=this.msgBurn({value:MsgBurn.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee,g)}catch(y){throw new Error("TxClient:sendMsgBurn: Could not broadcast Tx: "+y.message)}},async sendMsgUpdateClass({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateClass: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$1,prefix:t});let N=this.msgUpdateClass({value:MsgUpdateClass.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee,g)}catch(y){throw new Error("TxClient:sendMsgUpdateClass: Could not broadcast Tx: "+y.message)}},async sendMsgMint({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgMint: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$1,prefix:t});let N=this.msgMint({value:MsgMint.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee,g)}catch(y){throw new Error("TxClient:sendMsgMint: Could not broadcast Tx: "+y.message)}},msgBurn({value:p}){try{return{typeUrl:"/iconlake.icon.MsgBurn",value:MsgBurn.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgBurn: Could not create message: "+u.message)}},msgUpdateClass({value:p}){try{return{typeUrl:"/iconlake.icon.MsgUpdateClass",value:MsgUpdateClass.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateClass: Could not create message: "+u.message)}},msgMint({value:p}){try{return{typeUrl:"/iconlake.icon.MsgMint",value:MsgMint.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgMint: Could not create message: "+u.message)}}}),queryClient=({addr:e}={addr:"http://localhost:1317"})=>new Api({baseURL:e});class SDKModule{constructor(t){this.registry=[],this.query=queryClient({addr:t.env.apiURL}),this.updateTX(t),this.structure={ClassData:getStructure(ClassData.fromPartial({})),ClassDataRaw:getStructure(ClassDataRaw.fromPartial({})),IconData:getStructure(IconData.fromPartial({})),IconDataRaw:getStructure(IconDataRaw.fromPartial({})),Params:getStructure(Params.fromPartial({})),NFT:getStructure(NFT.fromPartial({})),QueryNFTsResponse:getStructure(QueryNFTsResponse.fromPartial({})),Class:getStructure(Class.fromPartial({})),QueryClassesResponse:getStructure(QueryClassesResponse.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}}const Module=e=>({module:{IconlakeIcon:new SDKModule(e)},registry:msgTypes}),Client=IgniteClient.plugin([Module$t,Module$s,Module$r,Module$q,Module$o,Module$n,Module$m,Module$l,Module$k,Module$j,Module$i,Module$h,Module$g,Module$f,Module$e,Module$d,Module$c,Module$b,Module$a,Module$9,Module$8,Module$7,Module$6,Module$5,Module$4,Module$3,Module$2,Module$1,Module]),registry=new build$b.Registry([...msgTypes$s,...msgTypes$r,...msgTypes$q,...msgTypes$p,...msgTypes$o,...msgTypes$n,...msgTypes$m,...msgTypes$l,...msgTypes$k,...msgTypes$j,...msgTypes$i,...msgTypes$h,...msgTypes$g,...msgTypes$f,...msgTypes$e,...msgTypes$d,...msgTypes$c,...msgTypes$b,...msgTypes$a,...msgTypes$9,...msgTypes$8,...msgTypes$7,...msgTypes$6,...msgTypes$5,...msgTypes$4,...msgTypes$3,...msgTypes$2,...msgTypes$1,...msgTypes]);return exports.Client=Client,exports.MissingWalletError=MissingWalletError,exports.registry=registry,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),exports}({});
22
+ */var wasm=null;try{wasm=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(e){}function Long(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}Long.prototype.__isLong__,Object.defineProperty(Long.prototype,"__isLong__",{value:!0});function isLong(e){return(e&&e.__isLong__)===!0}function ctz32(e){var t=Math.clz32(e&-e);return e?31-t:t}Long.isLong=isLong;var INT_CACHE={},UINT_CACHE={};function fromInt(e,t){var n,p,u;return t?(e>>>=0,(u=0<=e&&e<256)&&(p=UINT_CACHE[e],p)?p:(n=fromBits(e,0,!0),u&&(UINT_CACHE[e]=n),n)):(e|=0,(u=-128<=e&&e<128)&&(p=INT_CACHE[e],p)?p:(n=fromBits(e,e<0?-1:0,!1),u&&(INT_CACHE[e]=n),n))}Long.fromInt=fromInt;function fromNumber(e,t){if(isNaN(e))return t?UZERO:ZERO;if(t){if(e<0)return UZERO;if(e>=TWO_PWR_64_DBL)return MAX_UNSIGNED_VALUE}else{if(e<=-TWO_PWR_63_DBL)return MIN_VALUE;if(e+1>=TWO_PWR_63_DBL)return MAX_VALUE}return e<0?fromNumber(-e,t).neg():fromBits(e%TWO_PWR_32_DBL|0,e/TWO_PWR_32_DBL|0,t)}Long.fromNumber=fromNumber;function fromBits(e,t,n){return new Long(e,t,n)}Long.fromBits=fromBits;var pow_dbl=Math.pow;function fromString(e,t,n){if(e.length===0)throw Error("empty string");if(typeof t=="number"?(n=t,t=!1):t=!!t,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t?UZERO:ZERO;if(n=n||10,n<2||36<n)throw RangeError("radix");var p;if((p=e.indexOf("-"))>0)throw Error("interior hyphen");if(p===0)return fromString(e.substring(1),t,n).neg();for(var u=fromNumber(pow_dbl(n,8)),g=ZERO,y=0;y<e.length;y+=8){var P=Math.min(8,e.length-y),N=parseInt(e.substring(y,y+P),n);if(P<8){var X=fromNumber(pow_dbl(n,P));g=g.mul(X).add(fromNumber(N))}else g=g.mul(u),g=g.add(fromNumber(N))}return g.unsigned=t,g}Long.fromString=fromString;function fromValue(e,t){return typeof e=="number"?fromNumber(e,t):typeof e=="string"?fromString(e,t):fromBits(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}Long.fromValue=fromValue;var TWO_PWR_16_DBL=65536,TWO_PWR_24_DBL=1<<24,TWO_PWR_32_DBL=TWO_PWR_16_DBL*TWO_PWR_16_DBL,TWO_PWR_64_DBL=TWO_PWR_32_DBL*TWO_PWR_32_DBL,TWO_PWR_63_DBL=TWO_PWR_64_DBL/2,TWO_PWR_24=fromInt(TWO_PWR_24_DBL),ZERO=fromInt(0);Long.ZERO=ZERO;var UZERO=fromInt(0,!0);Long.UZERO=UZERO;var ONE=fromInt(1);Long.ONE=ONE;var UONE=fromInt(1,!0);Long.UONE=UONE;var NEG_ONE=fromInt(-1);Long.NEG_ONE=NEG_ONE;var MAX_VALUE=fromBits(-1,2147483647,!1);Long.MAX_VALUE=MAX_VALUE;var MAX_UNSIGNED_VALUE=fromBits(-1,-1,!0);Long.MAX_UNSIGNED_VALUE=MAX_UNSIGNED_VALUE;var MIN_VALUE=fromBits(0,-2147483648,!1);Long.MIN_VALUE=MIN_VALUE;var LongPrototype=Long.prototype;LongPrototype.toInt=function e(){return this.unsigned?this.low>>>0:this.low},LongPrototype.toNumber=function e(){return this.unsigned?(this.high>>>0)*TWO_PWR_32_DBL+(this.low>>>0):this.high*TWO_PWR_32_DBL+(this.low>>>0)},LongPrototype.toString=function e(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(MIN_VALUE)){var n=fromNumber(t),p=this.div(n),u=p.mul(n).sub(this);return p.toString(t)+u.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var g=fromNumber(pow_dbl(t,6),this.unsigned),y=this,P="";;){var N=y.div(g),X=y.sub(N.mul(g)).toInt()>>>0,se=X.toString(t);if(y=N,y.isZero())return se+P;for(;se.length<6;)se="0"+se;P=""+se+P}},LongPrototype.getHighBits=function e(){return this.high},LongPrototype.getHighBitsUnsigned=function e(){return this.high>>>0},LongPrototype.getLowBits=function e(){return this.low},LongPrototype.getLowBitsUnsigned=function e(){return this.low>>>0},LongPrototype.getNumBitsAbs=function e(){if(this.isNegative())return this.eq(MIN_VALUE)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,n=31;n>0&&!(t&1<<n);n--);return this.high!=0?n+33:n+1},LongPrototype.isZero=function e(){return this.high===0&&this.low===0},LongPrototype.eqz=LongPrototype.isZero,LongPrototype.isNegative=function e(){return!this.unsigned&&this.high<0},LongPrototype.isPositive=function e(){return this.unsigned||this.high>=0},LongPrototype.isOdd=function e(){return(this.low&1)===1},LongPrototype.isEven=function e(){return(this.low&1)===0},LongPrototype.equals=function e(t){return isLong(t)||(t=fromValue(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low},LongPrototype.eq=LongPrototype.equals,LongPrototype.notEquals=function e(t){return!this.eq(t)},LongPrototype.neq=LongPrototype.notEquals,LongPrototype.ne=LongPrototype.notEquals,LongPrototype.lessThan=function e(t){return this.comp(t)<0},LongPrototype.lt=LongPrototype.lessThan,LongPrototype.lessThanOrEqual=function e(t){return this.comp(t)<=0},LongPrototype.lte=LongPrototype.lessThanOrEqual,LongPrototype.le=LongPrototype.lessThanOrEqual,LongPrototype.greaterThan=function e(t){return this.comp(t)>0},LongPrototype.gt=LongPrototype.greaterThan,LongPrototype.greaterThanOrEqual=function e(t){return this.comp(t)>=0},LongPrototype.gte=LongPrototype.greaterThanOrEqual,LongPrototype.ge=LongPrototype.greaterThanOrEqual,LongPrototype.compare=function e(t){if(isLong(t)||(t=fromValue(t)),this.eq(t))return 0;var n=this.isNegative(),p=t.isNegative();return n&&!p?-1:!n&&p?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},LongPrototype.comp=LongPrototype.compare,LongPrototype.negate=function e(){return!this.unsigned&&this.eq(MIN_VALUE)?MIN_VALUE:this.not().add(ONE)},LongPrototype.neg=LongPrototype.negate,LongPrototype.add=function e(t){isLong(t)||(t=fromValue(t));var n=this.high>>>16,p=this.high&65535,u=this.low>>>16,g=this.low&65535,y=t.high>>>16,P=t.high&65535,N=t.low>>>16,X=t.low&65535,se=0,Ae=0,fe=0,C=0;return C+=g+X,fe+=C>>>16,C&=65535,fe+=u+N,Ae+=fe>>>16,fe&=65535,Ae+=p+P,se+=Ae>>>16,Ae&=65535,se+=n+y,se&=65535,fromBits(fe<<16|C,se<<16|Ae,this.unsigned)},LongPrototype.subtract=function e(t){return isLong(t)||(t=fromValue(t)),this.add(t.neg())},LongPrototype.sub=LongPrototype.subtract,LongPrototype.multiply=function e(t){if(this.isZero())return this;if(isLong(t)||(t=fromValue(t)),wasm){var n=wasm.mul(this.low,this.high,t.low,t.high);return fromBits(n,wasm.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?UZERO:ZERO;if(this.eq(MIN_VALUE))return t.isOdd()?MIN_VALUE:ZERO;if(t.eq(MIN_VALUE))return this.isOdd()?MIN_VALUE:ZERO;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(TWO_PWR_24)&&t.lt(TWO_PWR_24))return fromNumber(this.toNumber()*t.toNumber(),this.unsigned);var p=this.high>>>16,u=this.high&65535,g=this.low>>>16,y=this.low&65535,P=t.high>>>16,N=t.high&65535,X=t.low>>>16,se=t.low&65535,Ae=0,fe=0,C=0,re=0;return re+=y*se,C+=re>>>16,re&=65535,C+=g*se,fe+=C>>>16,C&=65535,C+=y*X,fe+=C>>>16,C&=65535,fe+=u*se,Ae+=fe>>>16,fe&=65535,fe+=g*X,Ae+=fe>>>16,fe&=65535,fe+=y*N,Ae+=fe>>>16,fe&=65535,Ae+=p*se+u*X+g*N+y*P,Ae&=65535,fromBits(C<<16|re,Ae<<16|fe,this.unsigned)},LongPrototype.mul=LongPrototype.multiply,LongPrototype.divide=function e(t){if(isLong(t)||(t=fromValue(t)),t.isZero())throw Error("division by zero");if(wasm){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var n=(this.unsigned?wasm.div_u:wasm.div_s)(this.low,this.high,t.low,t.high);return fromBits(n,wasm.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?UZERO:ZERO;var p,u,g;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return UZERO;if(t.gt(this.shru(1)))return UONE;g=UZERO}else{if(this.eq(MIN_VALUE)){if(t.eq(ONE)||t.eq(NEG_ONE))return MIN_VALUE;if(t.eq(MIN_VALUE))return ONE;var y=this.shr(1);return p=y.div(t).shl(1),p.eq(ZERO)?t.isNegative()?ONE:NEG_ONE:(u=this.sub(t.mul(p)),g=p.add(u.div(t)),g)}else if(t.eq(MIN_VALUE))return this.unsigned?UZERO:ZERO;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();g=ZERO}for(u=this;u.gte(t);){p=Math.max(1,Math.floor(u.toNumber()/t.toNumber()));for(var P=Math.ceil(Math.log(p)/Math.LN2),N=P<=48?1:pow_dbl(2,P-48),X=fromNumber(p),se=X.mul(t);se.isNegative()||se.gt(u);)p-=N,X=fromNumber(p,this.unsigned),se=X.mul(t);X.isZero()&&(X=ONE),g=g.add(X),u=u.sub(se)}return g},LongPrototype.div=LongPrototype.divide,LongPrototype.modulo=function e(t){if(isLong(t)||(t=fromValue(t)),wasm){var n=(this.unsigned?wasm.rem_u:wasm.rem_s)(this.low,this.high,t.low,t.high);return fromBits(n,wasm.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},LongPrototype.mod=LongPrototype.modulo,LongPrototype.rem=LongPrototype.modulo,LongPrototype.not=function e(){return fromBits(~this.low,~this.high,this.unsigned)},LongPrototype.countLeadingZeros=function e(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},LongPrototype.clz=LongPrototype.countLeadingZeros,LongPrototype.countTrailingZeros=function e(){return this.low?ctz32(this.low):ctz32(this.high)+32},LongPrototype.ctz=LongPrototype.countTrailingZeros,LongPrototype.and=function e(t){return isLong(t)||(t=fromValue(t)),fromBits(this.low&t.low,this.high&t.high,this.unsigned)},LongPrototype.or=function e(t){return isLong(t)||(t=fromValue(t)),fromBits(this.low|t.low,this.high|t.high,this.unsigned)},LongPrototype.xor=function e(t){return isLong(t)||(t=fromValue(t)),fromBits(this.low^t.low,this.high^t.high,this.unsigned)},LongPrototype.shiftLeft=function e(t){return isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?fromBits(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):fromBits(0,this.low<<t-32,this.unsigned)},LongPrototype.shl=LongPrototype.shiftLeft,LongPrototype.shiftRight=function e(t){return isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?fromBits(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):fromBits(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},LongPrototype.shr=LongPrototype.shiftRight,LongPrototype.shiftRightUnsigned=function e(t){return isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?fromBits(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?fromBits(this.high,0,this.unsigned):fromBits(this.high>>>t-32,0,this.unsigned)},LongPrototype.shru=LongPrototype.shiftRightUnsigned,LongPrototype.shr_u=LongPrototype.shiftRightUnsigned,LongPrototype.rotateLeft=function e(t){var n;return isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?fromBits(this.high,this.low,this.unsigned):t<32?(n=32-t,fromBits(this.low<<t|this.high>>>n,this.high<<t|this.low>>>n,this.unsigned)):(t-=32,n=32-t,fromBits(this.high<<t|this.low>>>n,this.low<<t|this.high>>>n,this.unsigned))},LongPrototype.rotl=LongPrototype.rotateLeft,LongPrototype.rotateRight=function e(t){var n;return isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?fromBits(this.high,this.low,this.unsigned):t<32?(n=32-t,fromBits(this.high<<n|this.low>>>t,this.low<<n|this.high>>>t,this.unsigned)):(t-=32,n=32-t,fromBits(this.low<<n|this.high>>>t,this.high<<n|this.low>>>t,this.unsigned))},LongPrototype.rotr=LongPrototype.rotateRight,LongPrototype.toSigned=function e(){return this.unsigned?fromBits(this.low,this.high,!1):this},LongPrototype.toUnsigned=function e(){return this.unsigned?this:fromBits(this.low,this.high,!0)},LongPrototype.toBytes=function e(t){return t?this.toBytesLE():this.toBytesBE()},LongPrototype.toBytesLE=function e(){var t=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]},LongPrototype.toBytesBE=function e(){var t=this.high,n=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,n>>>24,n>>>16&255,n>>>8&255,n&255]},Long.fromBytes=function e(t,n,p){return p?Long.fromBytesLE(t,n):Long.fromBytesBE(t,n)},Long.fromBytesLE=function e(t,n){return new Long(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,n)},Long.fromBytesBE=function e(t,n){return new Long(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],n)};var indexMinimal={},minimal$1={},longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=t;var e=requireMinimal();function t(g,y){this.lo=g>>>0,this.hi=y>>>0}var n=t.zero=new t(0,0);n.toNumber=function(){return 0},n.zzEncode=n.zzDecode=function(){return this},n.length=function(){return 1};var p=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(y){if(y===0)return n;var P=y<0;P&&(y=-y);var N=y>>>0,X=(y-N)/4294967296>>>0;return P&&(X=~X>>>0,N=~N>>>0,++N>4294967295&&(N=0,++X>4294967295&&(X=0))),new t(N,X)},t.from=function(y){if(typeof y=="number")return t.fromNumber(y);if(e.isString(y))if(e.Long)y=e.Long.fromString(y);else return t.fromNumber(parseInt(y,10));return y.low||y.high?new t(y.low>>>0,y.high>>>0):n},t.prototype.toNumber=function(y){if(!y&&this.hi>>>31){var P=~this.lo+1>>>0,N=~this.hi>>>0;return P||(N=N+1>>>0),-(P+N*4294967296)}return this.lo+this.hi*4294967296},t.prototype.toLong=function(y){return e.Long?new e.Long(this.lo|0,this.hi|0,!!y):{low:this.lo|0,high:this.hi|0,unsigned:!!y}};var u=String.prototype.charCodeAt;return t.fromHash=function(y){return y===p?n:new t((u.call(y,0)|u.call(y,1)<<8|u.call(y,2)<<16|u.call(y,3)<<24)>>>0,(u.call(y,4)|u.call(y,5)<<8|u.call(y,6)<<16|u.call(y,7)<<24)>>>0)},t.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)},t.prototype.zzEncode=function(){var y=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^y)>>>0,this.lo=(this.lo<<1^y)>>>0,this},t.prototype.zzDecode=function(){var y=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^y)>>>0,this.hi=(this.hi>>>1^y)>>>0,this},t.prototype.length=function(){var y=this.lo,P=(this.lo>>>28|this.hi<<4)>>>0,N=this.hi>>>24;return N===0?P===0?y<16384?y<128?1:2:y<2097152?3:4:P<16384?P<128?5:6:P<2097152?7:8:N<128?9:10},longbits}var hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,function(e){var t=e;t.asPromise=aspromise,t.base64=base64$3,t.EventEmitter=eventemitter,t.float=float,t.inquire=inquire_1,t.utf8=utf8$5,t.pool=pool_1,t.LongBits=requireLongbits(),t.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),t.global=t.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||commonjsGlobal,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(g){return typeof g=="number"&&isFinite(g)&&Math.floor(g)===g},t.isString=function(g){return typeof g=="string"||g instanceof String},t.isObject=function(g){return g&&typeof g=="object"},t.isset=t.isSet=function(g,y){var P=g[y];return P!=null&&g.hasOwnProperty(y)?typeof P!="object"||(Array.isArray(P)?P.length:Object.keys(P).length)>0:!1},t.Buffer=function(){try{var u=t.inquire("buffer").Buffer;return u.prototype.utf8Write?u:null}catch{return null}}(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(g){return typeof g=="number"?t.Buffer?t._Buffer_allocUnsafe(g):new t.Array(g):t.Buffer?t._Buffer_from(g):typeof Uint8Array>"u"?g:new Uint8Array(g)},t.Array=typeof Uint8Array<"u"?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire("long"),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(g){return g?t.LongBits.from(g).toHash():t.LongBits.zeroHash},t.longFromHash=function(g,y){var P=t.LongBits.fromHash(g);return t.Long?t.Long.fromBits(P.lo,P.hi,y):P.toNumber(!!y)};function n(u,g,y){for(var P=Object.keys(g),N=0;N<P.length;++N)(u[P[N]]===void 0||!y)&&(u[P[N]]=g[P[N]]);return u}t.merge=n,t.lcFirst=function(g){return g.charAt(0).toLowerCase()+g.substring(1)};function p(u){function g(y,P){if(!(this instanceof g))return new g(y,P);Object.defineProperty(this,"message",{get:function(){return y}}),Error.captureStackTrace?Error.captureStackTrace(this,g):Object.defineProperty(this,"stack",{value:new Error().stack||""}),P&&n(this,P)}return g.prototype=Object.create(Error.prototype,{constructor:{value:g,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return u},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),g}t.newError=p,t.ProtocolError=p("ProtocolError"),t.oneOfGetter=function(g){for(var y={},P=0;P<g.length;++P)y[g[P]]=1;return function(){for(var N=Object.keys(this),X=N.length-1;X>-1;--X)if(y[N[X]]===1&&this[N[X]]!==void 0&&this[N[X]]!==null)return N[X]}},t.oneOfSetter=function(g){return function(y){for(var P=0;P<g.length;++P)g[P]!==y&&delete this[g[P]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var u=t.Buffer;if(!u){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=u.from!==Uint8Array.from&&u.from||function(y,P){return new u(y,P)},t._Buffer_allocUnsafe=u.allocUnsafe||function(y){return new u(y)}}}(minimal$1)),minimal$1}var writer=Writer$1,util$4=requireMinimal(),BufferWriter$1,LongBits$1=util$4.LongBits,base64=util$4.base64,utf8$1=util$4.utf8;function Op(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function noop(){}function State(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function Writer$1(){this.len=0,this.head=new Op(noop,0,0),this.tail=this.head,this.states=null}var create$1=function e(){return util$4.Buffer?function(){return(Writer$1.create=function(){return new BufferWriter$1})()}:function(){return new Writer$1}};Writer$1.create=create$1(),Writer$1.alloc=function e(t){return new util$4.Array(t)},util$4.Array!==Array&&(Writer$1.alloc=util$4.pool(Writer$1.alloc,util$4.Array.prototype.subarray)),Writer$1.prototype._push=function e(t,n,p){return this.tail=this.tail.next=new Op(t,n,p),this.len+=n,this};function writeByte(e,t,n){t[n]=e&255}function writeVarint32(e,t,n){for(;e>127;)t[n++]=e&127|128,e>>>=7;t[n]=e}function VarintOp(e,t){this.len=e,this.next=void 0,this.val=t}VarintOp.prototype=Object.create(Op.prototype),VarintOp.prototype.fn=writeVarint32,Writer$1.prototype.uint32=function e(t){return this.len+=(this.tail=this.tail.next=new VarintOp((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},Writer$1.prototype.int32=function e(t){return t<0?this._push(writeVarint64,10,LongBits$1.fromNumber(t)):this.uint32(t)},Writer$1.prototype.sint32=function e(t){return this.uint32((t<<1^t>>31)>>>0)};function writeVarint64(e,t,n){for(;e.hi;)t[n++]=e.lo&127|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=e.lo&127|128,e.lo=e.lo>>>7;t[n++]=e.lo}Writer$1.prototype.uint64=function e(t){var n=LongBits$1.from(t);return this._push(writeVarint64,n.length(),n)},Writer$1.prototype.int64=Writer$1.prototype.uint64,Writer$1.prototype.sint64=function e(t){var n=LongBits$1.from(t).zzEncode();return this._push(writeVarint64,n.length(),n)},Writer$1.prototype.bool=function e(t){return this._push(writeByte,1,t?1:0)};function writeFixed32(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}Writer$1.prototype.fixed32=function e(t){return this._push(writeFixed32,4,t>>>0)},Writer$1.prototype.sfixed32=Writer$1.prototype.fixed32,Writer$1.prototype.fixed64=function e(t){var n=LongBits$1.from(t);return this._push(writeFixed32,4,n.lo)._push(writeFixed32,4,n.hi)},Writer$1.prototype.sfixed64=Writer$1.prototype.fixed64,Writer$1.prototype.float=function e(t){return this._push(util$4.float.writeFloatLE,4,t)},Writer$1.prototype.double=function e(t){return this._push(util$4.float.writeDoubleLE,8,t)};var writeBytes=util$4.Array.prototype.set?function e(t,n,p){n.set(t,p)}:function e(t,n,p){for(var u=0;u<t.length;++u)n[p+u]=t[u]};Writer$1.prototype.bytes=function e(t){var n=t.length>>>0;if(!n)return this._push(writeByte,1,0);if(util$4.isString(t)){var p=Writer$1.alloc(n=base64.length(t));base64.decode(t,p,0),t=p}return this.uint32(n)._push(writeBytes,n,t)},Writer$1.prototype.string=function e(t){var n=utf8$1.length(t);return n?this.uint32(n)._push(utf8$1.write,n,t):this._push(writeByte,1,0)},Writer$1.prototype.fork=function e(){return this.states=new State(this),this.head=this.tail=new Op(noop,0,0),this.len=0,this},Writer$1.prototype.reset=function e(){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 Op(noop,0,0),this.len=0),this},Writer$1.prototype.ldelim=function e(){var t=this.head,n=this.tail,p=this.len;return this.reset().uint32(p),p&&(this.tail.next=t.next,this.tail=n,this.len+=p),this},Writer$1.prototype.finish=function e(){for(var t=this.head.next,n=this.constructor.alloc(this.len),p=0;t;)t.fn(t.val,n,p),p+=t.len,t=t.next;return n},Writer$1._configure=function(e){BufferWriter$1=e,Writer$1.create=create$1(),BufferWriter$1._configure()};var writer_buffer=BufferWriter,Writer=writer;(BufferWriter.prototype=Object.create(Writer.prototype)).constructor=BufferWriter;var util$3=requireMinimal();function BufferWriter(){Writer.call(this)}BufferWriter._configure=function(){BufferWriter.alloc=util$3._Buffer_allocUnsafe,BufferWriter.writeBytesBuffer=util$3.Buffer&&util$3.Buffer.prototype instanceof Uint8Array&&util$3.Buffer.prototype.set.name==="set"?function(t,n,p){n.set(t,p)}:function(t,n,p){if(t.copy)t.copy(n,p,0,t.length);else for(var u=0;u<t.length;)n[p++]=t[u++]}},BufferWriter.prototype.bytes=function e(t){util$3.isString(t)&&(t=util$3._Buffer_from(t,"base64"));var n=t.length>>>0;return this.uint32(n),n&&this._push(BufferWriter.writeBytesBuffer,n,t),this};function writeStringBuffer(e,t,n){e.length<40?util$3.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}BufferWriter.prototype.string=function e(t){var n=util$3.Buffer.byteLength(t);return this.uint32(n),n&&this._push(writeStringBuffer,n,t),this},BufferWriter._configure();var reader=Reader$1,util$2=requireMinimal(),BufferReader$1,LongBits=util$2.LongBits,utf8=util$2.utf8;function indexOutOfRange(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function Reader$1(e){this.buf=e,this.pos=0,this.len=e.length}var create_array=typeof Uint8Array<"u"?function e(t){if(t instanceof Uint8Array||Array.isArray(t))return new Reader$1(t);throw Error("illegal buffer")}:function e(t){if(Array.isArray(t))return new Reader$1(t);throw Error("illegal buffer")},create=function e(){return util$2.Buffer?function(n){return(Reader$1.create=function(u){return util$2.Buffer.isBuffer(u)?new BufferReader$1(u):create_array(u)})(n)}:create_array};Reader$1.create=create(),Reader$1.prototype._slice=util$2.Array.prototype.subarray||util$2.Array.prototype.slice,Reader$1.prototype.uint32=function e(){var t=4294967295;return function(){if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return t}}(),Reader$1.prototype.int32=function e(){return this.uint32()|0},Reader$1.prototype.sint32=function e(){var t=this.uint32();return t>>>1^-(t&1)|0};function readLongVarint(){var e=new LongBits(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*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;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw indexOutOfRange(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}Reader$1.prototype.bool=function e(){return this.uint32()!==0};function readFixed32_end(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}Reader$1.prototype.fixed32=function e(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)},Reader$1.prototype.sfixed32=function e(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)|0};function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader$1.prototype.float=function e(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var t=util$2.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},Reader$1.prototype.double=function e(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var t=util$2.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},Reader$1.prototype.bytes=function e(){var t=this.uint32(),n=this.pos,p=this.pos+t;if(p>this.len)throw indexOutOfRange(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(n,p):n===p?new this.buf.constructor(0):this._slice.call(this.buf,n,p)},Reader$1.prototype.string=function e(){var t=this.bytes();return utf8.read(t,0,t.length)},Reader$1.prototype.skip=function e(t){if(typeof t=="number"){if(this.pos+t>this.len)throw indexOutOfRange(this,t);this.pos+=t}else do if(this.pos>=this.len)throw indexOutOfRange(this);while(this.buf[this.pos++]&128);return this},Reader$1.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},Reader$1._configure=function(e){BufferReader$1=e,Reader$1.create=create(),BufferReader$1._configure();var t=util$2.Long?"toLong":"toNumber";util$2.merge(Reader$1.prototype,{int64:function(){return readLongVarint.call(this)[t](!1)},uint64:function(){return readLongVarint.call(this)[t](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[t](!1)},fixed64:function(){return readFixed64.call(this)[t](!0)},sfixed64:function(){return readFixed64.call(this)[t](!1)}})};var reader_buffer=BufferReader,Reader=reader;(BufferReader.prototype=Object.create(Reader.prototype)).constructor=BufferReader;var util$1=requireMinimal();function BufferReader(e){Reader.call(this,e)}BufferReader._configure=function(){util$1.Buffer&&(BufferReader.prototype._slice=util$1.Buffer.prototype.slice)},BufferReader.prototype.string=function e(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},BufferReader._configure();var rpc={},service=Service,util=requireMinimal();(Service.prototype=Object.create(util.EventEmitter.prototype)).constructor=Service;function Service(e,t,n){if(typeof e!="function")throw TypeError("rpcImpl must be a function");util.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!n}Service.prototype.rpcCall=function e(t,n,p,u,g){if(!u)throw TypeError("request must be specified");var y=this;if(!g)return util.asPromise(e,y,t,n,p,u);if(!y.rpcImpl){setTimeout(function(){g(Error("already ended"))},0);return}try{return y.rpcImpl(t,n[y.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(N,X){if(N)return y.emit("error",N,t),g(N);if(X===null){y.end(!0);return}if(!(X instanceof p))try{X=p[y.responseDelimited?"decodeDelimited":"decode"](X)}catch(se){return y.emit("error",se,t),g(se)}return y.emit("data",X,t),g(null,X)})}catch(P){y.emit("error",P,t),setTimeout(function(){g(P)},0);return}},Service.prototype.end=function e(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},function(e){var t=e;t.Service=service}(rpc);var roots={};(function(e){var t=e;t.build="minimal",t.Writer=writer,t.BufferWriter=writer_buffer,t.Reader=reader,t.BufferReader=reader_buffer,t.util=requireMinimal(),t.rpc=rpc,t.roots=roots,t.configure=n;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}n()})(indexMinimal);var minimal=indexMinimal;const _m0=getDefaultExportFromCjs(minimal);function createBaseAny$d(){return{typeUrl:"",value:new Uint8Array}}const Any$d={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$d();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$1S(e.typeUrl)?String(e.typeUrl):"",value:isSet$1S(e.value)?bytesFromBase64$w(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$w(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$d();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$1y=(()=>{if(typeof globalThis$1y<"u")return globalThis$1y;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$w(e){if(globalThis$1y.Buffer)return Uint8Array.from(globalThis$1y.Buffer.from(e,"base64"));{const t=globalThis$1y.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$w(e){if(globalThis$1y.Buffer)return globalThis$1y.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$1y.btoa(t.join(""))}}function isSet$1S(e){return e!=null}function createBaseBaseAccount$1(){return{address:"",pubKey:void 0,accountNumber:0,sequence:0}}const BaseAccount$1={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.pubKey!==void 0&&Any$d.encode(e.pubKey,t.uint32(18).fork()).ldelim(),e.accountNumber!==0&&t.uint32(24).uint64(e.accountNumber),e.sequence!==0&&t.uint32(32).uint64(e.sequence),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseBaseAccount$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.pubKey=Any$d.decode(n,n.uint32());break;case 3:u.accountNumber=longToNumber$Z(n.uint64());break;case 4:u.sequence=longToNumber$Z(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$1R(e.address)?String(e.address):"",pubKey:isSet$1R(e.pubKey)?Any$d.fromJSON(e.pubKey):void 0,accountNumber:isSet$1R(e.accountNumber)?Number(e.accountNumber):0,sequence:isSet$1R(e.sequence)?Number(e.sequence):0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.pubKey!==void 0&&(t.pubKey=e.pubKey?Any$d.toJSON(e.pubKey):void 0),e.accountNumber!==void 0&&(t.accountNumber=Math.round(e.accountNumber)),e.sequence!==void 0&&(t.sequence=Math.round(e.sequence)),t},fromPartial(e){const t=createBaseBaseAccount$1();return t.address=e.address??"",t.pubKey=e.pubKey!==void 0&&e.pubKey!==null?Any$d.fromPartial(e.pubKey):void 0,t.accountNumber=e.accountNumber??0,t.sequence=e.sequence??0,t}};function createBaseModuleAccount(){return{baseAccount:void 0,name:"",permissions:[]}}const ModuleAccount={encode(e,t=_m0.Writer.create()){e.baseAccount!==void 0&&BaseAccount$1.encode(e.baseAccount,t.uint32(10).fork()).ldelim(),e.name!==""&&t.uint32(18).string(e.name);for(const n of e.permissions)t.uint32(26).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseModuleAccount();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.baseAccount=BaseAccount$1.decode(n,n.uint32());break;case 2:u.name=n.string();break;case 3:u.permissions.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{baseAccount:isSet$1R(e.baseAccount)?BaseAccount$1.fromJSON(e.baseAccount):void 0,name:isSet$1R(e.name)?String(e.name):"",permissions:Array.isArray(e==null?void 0:e.permissions)?e.permissions.map(t=>String(t)):[]}},toJSON(e){const t={};return e.baseAccount!==void 0&&(t.baseAccount=e.baseAccount?BaseAccount$1.toJSON(e.baseAccount):void 0),e.name!==void 0&&(t.name=e.name),e.permissions?t.permissions=e.permissions.map(n=>n):t.permissions=[],t},fromPartial(e){var n;const t=createBaseModuleAccount();return t.baseAccount=e.baseAccount!==void 0&&e.baseAccount!==null?BaseAccount$1.fromPartial(e.baseAccount):void 0,t.name=e.name??"",t.permissions=((n=e.permissions)==null?void 0:n.map(p=>p))||[],t}};function createBaseModuleCredential(){return{moduleName:"",derivationKeys:[]}}const ModuleCredential={encode(e,t=_m0.Writer.create()){e.moduleName!==""&&t.uint32(10).string(e.moduleName);for(const n of e.derivationKeys)t.uint32(18).bytes(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseModuleCredential();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.moduleName=n.string();break;case 2:u.derivationKeys.push(n.bytes());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{moduleName:isSet$1R(e.moduleName)?String(e.moduleName):"",derivationKeys:Array.isArray(e==null?void 0:e.derivationKeys)?e.derivationKeys.map(t=>bytesFromBase64$v(t)):[]}},toJSON(e){const t={};return e.moduleName!==void 0&&(t.moduleName=e.moduleName),e.derivationKeys?t.derivationKeys=e.derivationKeys.map(n=>base64FromBytes$v(n!==void 0?n:new Uint8Array)):t.derivationKeys=[],t},fromPartial(e){var n;const t=createBaseModuleCredential();return t.moduleName=e.moduleName??"",t.derivationKeys=((n=e.derivationKeys)==null?void 0:n.map(p=>p))||[],t}};function createBaseParams$d(){return{maxMemoCharacters:0,txSigLimit:0,txSizeCostPerByte:0,sigVerifyCostEd25519:0,sigVerifyCostSecp256k1:0}}const Params$d={encode(e,t=_m0.Writer.create()){return e.maxMemoCharacters!==0&&t.uint32(8).uint64(e.maxMemoCharacters),e.txSigLimit!==0&&t.uint32(16).uint64(e.txSigLimit),e.txSizeCostPerByte!==0&&t.uint32(24).uint64(e.txSizeCostPerByte),e.sigVerifyCostEd25519!==0&&t.uint32(32).uint64(e.sigVerifyCostEd25519),e.sigVerifyCostSecp256k1!==0&&t.uint32(40).uint64(e.sigVerifyCostSecp256k1),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$d();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.maxMemoCharacters=longToNumber$Z(n.uint64());break;case 2:u.txSigLimit=longToNumber$Z(n.uint64());break;case 3:u.txSizeCostPerByte=longToNumber$Z(n.uint64());break;case 4:u.sigVerifyCostEd25519=longToNumber$Z(n.uint64());break;case 5:u.sigVerifyCostSecp256k1=longToNumber$Z(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{maxMemoCharacters:isSet$1R(e.maxMemoCharacters)?Number(e.maxMemoCharacters):0,txSigLimit:isSet$1R(e.txSigLimit)?Number(e.txSigLimit):0,txSizeCostPerByte:isSet$1R(e.txSizeCostPerByte)?Number(e.txSizeCostPerByte):0,sigVerifyCostEd25519:isSet$1R(e.sigVerifyCostEd25519)?Number(e.sigVerifyCostEd25519):0,sigVerifyCostSecp256k1:isSet$1R(e.sigVerifyCostSecp256k1)?Number(e.sigVerifyCostSecp256k1):0}},toJSON(e){const t={};return e.maxMemoCharacters!==void 0&&(t.maxMemoCharacters=Math.round(e.maxMemoCharacters)),e.txSigLimit!==void 0&&(t.txSigLimit=Math.round(e.txSigLimit)),e.txSizeCostPerByte!==void 0&&(t.txSizeCostPerByte=Math.round(e.txSizeCostPerByte)),e.sigVerifyCostEd25519!==void 0&&(t.sigVerifyCostEd25519=Math.round(e.sigVerifyCostEd25519)),e.sigVerifyCostSecp256k1!==void 0&&(t.sigVerifyCostSecp256k1=Math.round(e.sigVerifyCostSecp256k1)),t},fromPartial(e){const t=createBaseParams$d();return t.maxMemoCharacters=e.maxMemoCharacters??0,t.txSigLimit=e.txSigLimit??0,t.txSizeCostPerByte=e.txSizeCostPerByte??0,t.sigVerifyCostEd25519=e.sigVerifyCostEd25519??0,t.sigVerifyCostSecp256k1=e.sigVerifyCostSecp256k1??0,t}};var globalThis$1x=(()=>{if(typeof globalThis$1x<"u")return globalThis$1x;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$v(e){if(globalThis$1x.Buffer)return Uint8Array.from(globalThis$1x.Buffer.from(e,"base64"));{const t=globalThis$1x.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$v(e){if(globalThis$1x.Buffer)return globalThis$1x.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$1x.btoa(t.join(""))}}function longToNumber$Z(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1x.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1R(e){return e!=null}new build$b.Registry(msgTypes$s);function getStructure$p(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$s=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$s=({addr:e}={addr:"http://localhost:1317"})=>new Api$s({baseURL:e});let SDKModule$s=class{constructor(t){this.registry=[],this.query=queryClient$s({addr:t.env.apiURL}),this.updateTX(t),this.structure={BaseAccount:getStructure$p(BaseAccount$1.fromPartial({})),ModuleAccount:getStructure$p(ModuleAccount.fromPartial({})),ModuleCredential:getStructure$p(ModuleCredential.fromPartial({})),Params:getStructure$p(Params$d.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$s({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$t=e=>({module:{CosmosAuthV1Beta1:new SDKModule$s(e)},registry:msgTypes$s});function createBaseAny$c(){return{typeUrl:"",value:new Uint8Array}}const Any$c={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$c();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$1Q(e.typeUrl)?String(e.typeUrl):"",value:isSet$1Q(e.value)?bytesFromBase64$u(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$u(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$c();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$1w=(()=>{if(typeof globalThis$1w<"u")return globalThis$1w;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$u(e){if(globalThis$1w.Buffer)return Uint8Array.from(globalThis$1w.Buffer.from(e,"base64"));{const t=globalThis$1w.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$u(e){if(globalThis$1w.Buffer)return globalThis$1w.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$1w.btoa(t.join(""))}}function isSet$1Q(e){return e!=null}function createBaseTimestamp$a(){return{seconds:0,nanos:0}}const Timestamp$a={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp$a();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$Y(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$1P(e.seconds)?Number(e.seconds):0,nanos:isSet$1P(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp$a();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$1v=(()=>{if(typeof globalThis$1v<"u")return globalThis$1v;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$Y(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1v.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1P(e){return e!=null}function createBaseGenericAuthorization(){return{msg:""}}const GenericAuthorization={encode(e,t=_m0.Writer.create()){return e.msg!==""&&t.uint32(10).string(e.msg),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseGenericAuthorization();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.msg=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{msg:isSet$1O(e.msg)?String(e.msg):""}},toJSON(e){const t={};return e.msg!==void 0&&(t.msg=e.msg),t},fromPartial(e){const t=createBaseGenericAuthorization();return t.msg=e.msg??"",t}};function createBaseGrant$1(){return{authorization:void 0,expiration:void 0}}const Grant$1={encode(e,t=_m0.Writer.create()){return e.authorization!==void 0&&Any$c.encode(e.authorization,t.uint32(10).fork()).ldelim(),e.expiration!==void 0&&Timestamp$a.encode(toTimestamp$d(e.expiration),t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseGrant$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.authorization=Any$c.decode(n,n.uint32());break;case 2:u.expiration=fromTimestamp$d(Timestamp$a.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{authorization:isSet$1O(e.authorization)?Any$c.fromJSON(e.authorization):void 0,expiration:isSet$1O(e.expiration)?fromJsonTimestamp$d(e.expiration):void 0}},toJSON(e){const t={};return e.authorization!==void 0&&(t.authorization=e.authorization?Any$c.toJSON(e.authorization):void 0),e.expiration!==void 0&&(t.expiration=e.expiration.toISOString()),t},fromPartial(e){const t=createBaseGrant$1();return t.authorization=e.authorization!==void 0&&e.authorization!==null?Any$c.fromPartial(e.authorization):void 0,t.expiration=e.expiration??void 0,t}};function createBaseGrantAuthorization(){return{granter:"",grantee:"",authorization:void 0,expiration:void 0}}const GrantAuthorization={encode(e,t=_m0.Writer.create()){return e.granter!==""&&t.uint32(10).string(e.granter),e.grantee!==""&&t.uint32(18).string(e.grantee),e.authorization!==void 0&&Any$c.encode(e.authorization,t.uint32(26).fork()).ldelim(),e.expiration!==void 0&&Timestamp$a.encode(toTimestamp$d(e.expiration),t.uint32(34).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseGrantAuthorization();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.granter=n.string();break;case 2:u.grantee=n.string();break;case 3:u.authorization=Any$c.decode(n,n.uint32());break;case 4:u.expiration=fromTimestamp$d(Timestamp$a.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{granter:isSet$1O(e.granter)?String(e.granter):"",grantee:isSet$1O(e.grantee)?String(e.grantee):"",authorization:isSet$1O(e.authorization)?Any$c.fromJSON(e.authorization):void 0,expiration:isSet$1O(e.expiration)?fromJsonTimestamp$d(e.expiration):void 0}},toJSON(e){const t={};return e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),e.authorization!==void 0&&(t.authorization=e.authorization?Any$c.toJSON(e.authorization):void 0),e.expiration!==void 0&&(t.expiration=e.expiration.toISOString()),t},fromPartial(e){const t=createBaseGrantAuthorization();return t.granter=e.granter??"",t.grantee=e.grantee??"",t.authorization=e.authorization!==void 0&&e.authorization!==null?Any$c.fromPartial(e.authorization):void 0,t.expiration=e.expiration??void 0,t}};function createBaseGrantQueueItem(){return{msgTypeUrls:[]}}const GrantQueueItem={encode(e,t=_m0.Writer.create()){for(const n of e.msgTypeUrls)t.uint32(10).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseGrantQueueItem();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.msgTypeUrls.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{msgTypeUrls:Array.isArray(e==null?void 0:e.msgTypeUrls)?e.msgTypeUrls.map(t=>String(t)):[]}},toJSON(e){const t={};return e.msgTypeUrls?t.msgTypeUrls=e.msgTypeUrls.map(n=>n):t.msgTypeUrls=[],t},fromPartial(e){var n;const t=createBaseGrantQueueItem();return t.msgTypeUrls=((n=e.msgTypeUrls)==null?void 0:n.map(p=>p))||[],t}};function toTimestamp$d(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$d(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$d(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$d(Timestamp$a.fromJSON(e))}function isSet$1O(e){return e!=null}function createBaseMsgGrant(){return{granter:"",grantee:"",grant:void 0}}const MsgGrant={encode(e,t=_m0.Writer.create()){return e.granter!==""&&t.uint32(10).string(e.granter),e.grantee!==""&&t.uint32(18).string(e.grantee),e.grant!==void 0&&Grant$1.encode(e.grant,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgGrant();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.granter=n.string();break;case 2:u.grantee=n.string();break;case 3:u.grant=Grant$1.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{granter:isSet$1N(e.granter)?String(e.granter):"",grantee:isSet$1N(e.grantee)?String(e.grantee):"",grant:isSet$1N(e.grant)?Grant$1.fromJSON(e.grant):void 0}},toJSON(e){const t={};return e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),e.grant!==void 0&&(t.grant=e.grant?Grant$1.toJSON(e.grant):void 0),t},fromPartial(e){const t=createBaseMsgGrant();return t.granter=e.granter??"",t.grantee=e.grantee??"",t.grant=e.grant!==void 0&&e.grant!==null?Grant$1.fromPartial(e.grant):void 0,t}};function createBaseMsgExec$1(){return{grantee:"",msgs:[]}}const MsgExec$1={encode(e,t=_m0.Writer.create()){e.grantee!==""&&t.uint32(10).string(e.grantee);for(const n of e.msgs)Any$c.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgExec$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.grantee=n.string();break;case 2:u.msgs.push(Any$c.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{grantee:isSet$1N(e.grantee)?String(e.grantee):"",msgs:Array.isArray(e==null?void 0:e.msgs)?e.msgs.map(t=>Any$c.fromJSON(t)):[]}},toJSON(e){const t={};return e.grantee!==void 0&&(t.grantee=e.grantee),e.msgs?t.msgs=e.msgs.map(n=>n?Any$c.toJSON(n):void 0):t.msgs=[],t},fromPartial(e){var n;const t=createBaseMsgExec$1();return t.grantee=e.grantee??"",t.msgs=((n=e.msgs)==null?void 0:n.map(p=>Any$c.fromPartial(p)))||[],t}};function createBaseMsgRevoke(){return{granter:"",grantee:"",msgTypeUrl:""}}const MsgRevoke={encode(e,t=_m0.Writer.create()){return e.granter!==""&&t.uint32(10).string(e.granter),e.grantee!==""&&t.uint32(18).string(e.grantee),e.msgTypeUrl!==""&&t.uint32(26).string(e.msgTypeUrl),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgRevoke();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.granter=n.string();break;case 2:u.grantee=n.string();break;case 3:u.msgTypeUrl=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{granter:isSet$1N(e.granter)?String(e.granter):"",grantee:isSet$1N(e.grantee)?String(e.grantee):"",msgTypeUrl:isSet$1N(e.msgTypeUrl)?String(e.msgTypeUrl):""}},toJSON(e){const t={};return e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),e.msgTypeUrl!==void 0&&(t.msgTypeUrl=e.msgTypeUrl),t},fromPartial(e){const t=createBaseMsgRevoke();return t.granter=e.granter??"",t.grantee=e.grantee??"",t.msgTypeUrl=e.msgTypeUrl??"",t}};var globalThis$1u=(()=>{if(typeof globalThis$1u<"u")return globalThis$1u;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function isSet$1N(e){return e!=null}const msgTypes$r=[["/cosmos.authz.v1beta1.MsgGrant",MsgGrant],["/cosmos.authz.v1beta1.MsgExec",MsgExec$1],["/cosmos.authz.v1beta1.MsgRevoke",MsgRevoke]];let HttpClient$r=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$r=class extends HttpClient$r{constructor(){super(...arguments),this.queryGrants=(t,n={})=>this.request({path:"/cosmos/authz/v1beta1/grants",method:"GET",query:t,format:"json",...n}),this.queryGranteeGrants=(t,n,p={})=>this.request({path:`/cosmos/authz/v1beta1/grants/grantee/${t}`,method:"GET",query:n,format:"json",...p}),this.queryGranterGrants=(t,n,p={})=>this.request({path:`/cosmos/authz/v1beta1/grants/granter/${t}`,method:"GET",query:n,format:"json",...p})}};function createBaseEventGrant(){return{msgTypeUrl:"",granter:"",grantee:""}}const EventGrant={encode(e,t=_m0.Writer.create()){return e.msgTypeUrl!==""&&t.uint32(18).string(e.msgTypeUrl),e.granter!==""&&t.uint32(26).string(e.granter),e.grantee!==""&&t.uint32(34).string(e.grantee),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventGrant();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 2:u.msgTypeUrl=n.string();break;case 3:u.granter=n.string();break;case 4:u.grantee=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{msgTypeUrl:isSet$1M(e.msgTypeUrl)?String(e.msgTypeUrl):"",granter:isSet$1M(e.granter)?String(e.granter):"",grantee:isSet$1M(e.grantee)?String(e.grantee):""}},toJSON(e){const t={};return e.msgTypeUrl!==void 0&&(t.msgTypeUrl=e.msgTypeUrl),e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),t},fromPartial(e){const t=createBaseEventGrant();return t.msgTypeUrl=e.msgTypeUrl??"",t.granter=e.granter??"",t.grantee=e.grantee??"",t}};function createBaseEventRevoke(){return{msgTypeUrl:"",granter:"",grantee:""}}const EventRevoke={encode(e,t=_m0.Writer.create()){return e.msgTypeUrl!==""&&t.uint32(18).string(e.msgTypeUrl),e.granter!==""&&t.uint32(26).string(e.granter),e.grantee!==""&&t.uint32(34).string(e.grantee),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventRevoke();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 2:u.msgTypeUrl=n.string();break;case 3:u.granter=n.string();break;case 4:u.grantee=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{msgTypeUrl:isSet$1M(e.msgTypeUrl)?String(e.msgTypeUrl):"",granter:isSet$1M(e.granter)?String(e.granter):"",grantee:isSet$1M(e.grantee)?String(e.grantee):""}},toJSON(e){const t={};return e.msgTypeUrl!==void 0&&(t.msgTypeUrl=e.msgTypeUrl),e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),t},fromPartial(e){const t=createBaseEventRevoke();return t.msgTypeUrl=e.msgTypeUrl??"",t.granter=e.granter??"",t.grantee=e.grantee??"",t}};function isSet$1M(e){return e!=null}const registry$g=new build$b.Registry(msgTypes$r);function getStructure$o(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$f={amount:[],gas:"200000"},txClient$r=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgGrant({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgGrant: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$g,prefix:t});let N=this.msgGrant({value:MsgGrant.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$f,g)}catch(y){throw new Error("TxClient:sendMsgGrant: Could not broadcast Tx: "+y.message)}},async sendMsgExec({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgExec: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$g,prefix:t});let N=this.msgExec({value:MsgExec$1.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$f,g)}catch(y){throw new Error("TxClient:sendMsgExec: Could not broadcast Tx: "+y.message)}},async sendMsgRevoke({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgRevoke: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$g,prefix:t});let N=this.msgRevoke({value:MsgRevoke.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$f,g)}catch(y){throw new Error("TxClient:sendMsgRevoke: Could not broadcast Tx: "+y.message)}},msgGrant({value:p}){try{return{typeUrl:"/cosmos.authz.v1beta1.MsgGrant",value:MsgGrant.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgGrant: Could not create message: "+u.message)}},msgExec({value:p}){try{return{typeUrl:"/cosmos.authz.v1beta1.MsgExec",value:MsgExec$1.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgExec: Could not create message: "+u.message)}},msgRevoke({value:p}){try{return{typeUrl:"/cosmos.authz.v1beta1.MsgRevoke",value:MsgRevoke.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgRevoke: Could not create message: "+u.message)}}}),queryClient$r=({addr:e}={addr:"http://localhost:1317"})=>new Api$r({baseURL:e});let SDKModule$r=class{constructor(t){this.registry=[],this.query=queryClient$r({addr:t.env.apiURL}),this.updateTX(t),this.structure={GenericAuthorization:getStructure$o(GenericAuthorization.fromPartial({})),Grant:getStructure$o(Grant$1.fromPartial({})),GrantAuthorization:getStructure$o(GrantAuthorization.fromPartial({})),GrantQueueItem:getStructure$o(GrantQueueItem.fromPartial({})),EventGrant:getStructure$o(EventGrant.fromPartial({})),EventRevoke:getStructure$o(EventRevoke.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$r({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$s=e=>({module:{CosmosAuthzV1Beta1:new SDKModule$r(e)},registry:msgTypes$r});function createBaseCoin$a(){return{denom:"",amount:""}}const Coin$a={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin$a();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$1L(e.denom)?String(e.denom):"",amount:isSet$1L(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin$a();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$1L(e){return e!=null}function createBaseParams$c(){return{sendEnabled:[],defaultSendEnabled:!1}}const Params$c={encode(e,t=_m0.Writer.create()){for(const n of e.sendEnabled)SendEnabled.encode(n,t.uint32(10).fork()).ldelim();return e.defaultSendEnabled===!0&&t.uint32(16).bool(e.defaultSendEnabled),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$c();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.sendEnabled.push(SendEnabled.decode(n,n.uint32()));break;case 2:u.defaultSendEnabled=n.bool();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{sendEnabled:Array.isArray(e==null?void 0:e.sendEnabled)?e.sendEnabled.map(t=>SendEnabled.fromJSON(t)):[],defaultSendEnabled:isSet$1K(e.defaultSendEnabled)?!!e.defaultSendEnabled:!1}},toJSON(e){const t={};return e.sendEnabled?t.sendEnabled=e.sendEnabled.map(n=>n?SendEnabled.toJSON(n):void 0):t.sendEnabled=[],e.defaultSendEnabled!==void 0&&(t.defaultSendEnabled=e.defaultSendEnabled),t},fromPartial(e){var n;const t=createBaseParams$c();return t.sendEnabled=((n=e.sendEnabled)==null?void 0:n.map(p=>SendEnabled.fromPartial(p)))||[],t.defaultSendEnabled=e.defaultSendEnabled??!1,t}};function createBaseSendEnabled(){return{denom:"",enabled:!1}}const SendEnabled={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.enabled===!0&&t.uint32(16).bool(e.enabled),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseSendEnabled();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.enabled=n.bool();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$1K(e.denom)?String(e.denom):"",enabled:isSet$1K(e.enabled)?!!e.enabled:!1}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.enabled!==void 0&&(t.enabled=e.enabled),t},fromPartial(e){const t=createBaseSendEnabled();return t.denom=e.denom??"",t.enabled=e.enabled??!1,t}};function createBaseInput(){return{address:"",coins:[]}}const Input={encode(e,t=_m0.Writer.create()){e.address!==""&&t.uint32(10).string(e.address);for(const n of e.coins)Coin$a.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseInput();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.coins.push(Coin$a.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$1K(e.address)?String(e.address):"",coins:Array.isArray(e==null?void 0:e.coins)?e.coins.map(t=>Coin$a.fromJSON(t)):[]}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.coins?t.coins=e.coins.map(n=>n?Coin$a.toJSON(n):void 0):t.coins=[],t},fromPartial(e){var n;const t=createBaseInput();return t.address=e.address??"",t.coins=((n=e.coins)==null?void 0:n.map(p=>Coin$a.fromPartial(p)))||[],t}};function createBaseOutput(){return{address:"",coins:[]}}const Output={encode(e,t=_m0.Writer.create()){e.address!==""&&t.uint32(10).string(e.address);for(const n of e.coins)Coin$a.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseOutput();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.coins.push(Coin$a.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$1K(e.address)?String(e.address):"",coins:Array.isArray(e==null?void 0:e.coins)?e.coins.map(t=>Coin$a.fromJSON(t)):[]}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.coins?t.coins=e.coins.map(n=>n?Coin$a.toJSON(n):void 0):t.coins=[],t},fromPartial(e){var n;const t=createBaseOutput();return t.address=e.address??"",t.coins=((n=e.coins)==null?void 0:n.map(p=>Coin$a.fromPartial(p)))||[],t}};function createBaseSupply(){return{total:[]}}const Supply={encode(e,t=_m0.Writer.create()){for(const n of e.total)Coin$a.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseSupply();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.total.push(Coin$a.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{total:Array.isArray(e==null?void 0:e.total)?e.total.map(t=>Coin$a.fromJSON(t)):[]}},toJSON(e){const t={};return e.total?t.total=e.total.map(n=>n?Coin$a.toJSON(n):void 0):t.total=[],t},fromPartial(e){var n;const t=createBaseSupply();return t.total=((n=e.total)==null?void 0:n.map(p=>Coin$a.fromPartial(p)))||[],t}};function createBaseDenomUnit(){return{denom:"",exponent:0,aliases:[]}}const DenomUnit={encode(e,t=_m0.Writer.create()){e.denom!==""&&t.uint32(10).string(e.denom),e.exponent!==0&&t.uint32(16).uint32(e.exponent);for(const n of e.aliases)t.uint32(26).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDenomUnit();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.exponent=n.uint32();break;case 3:u.aliases.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$1K(e.denom)?String(e.denom):"",exponent:isSet$1K(e.exponent)?Number(e.exponent):0,aliases:Array.isArray(e==null?void 0:e.aliases)?e.aliases.map(t=>String(t)):[]}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.exponent!==void 0&&(t.exponent=Math.round(e.exponent)),e.aliases?t.aliases=e.aliases.map(n=>n):t.aliases=[],t},fromPartial(e){var n;const t=createBaseDenomUnit();return t.denom=e.denom??"",t.exponent=e.exponent??0,t.aliases=((n=e.aliases)==null?void 0:n.map(p=>p))||[],t}};function createBaseMetadata(){return{description:"",denomUnits:[],base:"",display:"",name:"",symbol:"",uri:"",uriHash:""}}const Metadata={encode(e,t=_m0.Writer.create()){e.description!==""&&t.uint32(10).string(e.description);for(const n of e.denomUnits)DenomUnit.encode(n,t.uint32(18).fork()).ldelim();return e.base!==""&&t.uint32(26).string(e.base),e.display!==""&&t.uint32(34).string(e.display),e.name!==""&&t.uint32(42).string(e.name),e.symbol!==""&&t.uint32(50).string(e.symbol),e.uri!==""&&t.uint32(58).string(e.uri),e.uriHash!==""&&t.uint32(66).string(e.uriHash),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMetadata();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.description=n.string();break;case 2:u.denomUnits.push(DenomUnit.decode(n,n.uint32()));break;case 3:u.base=n.string();break;case 4:u.display=n.string();break;case 5:u.name=n.string();break;case 6:u.symbol=n.string();break;case 7:u.uri=n.string();break;case 8:u.uriHash=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{description:isSet$1K(e.description)?String(e.description):"",denomUnits:Array.isArray(e==null?void 0:e.denomUnits)?e.denomUnits.map(t=>DenomUnit.fromJSON(t)):[],base:isSet$1K(e.base)?String(e.base):"",display:isSet$1K(e.display)?String(e.display):"",name:isSet$1K(e.name)?String(e.name):"",symbol:isSet$1K(e.symbol)?String(e.symbol):"",uri:isSet$1K(e.uri)?String(e.uri):"",uriHash:isSet$1K(e.uriHash)?String(e.uriHash):""}},toJSON(e){const t={};return e.description!==void 0&&(t.description=e.description),e.denomUnits?t.denomUnits=e.denomUnits.map(n=>n?DenomUnit.toJSON(n):void 0):t.denomUnits=[],e.base!==void 0&&(t.base=e.base),e.display!==void 0&&(t.display=e.display),e.name!==void 0&&(t.name=e.name),e.symbol!==void 0&&(t.symbol=e.symbol),e.uri!==void 0&&(t.uri=e.uri),e.uriHash!==void 0&&(t.uriHash=e.uriHash),t},fromPartial(e){var n;const t=createBaseMetadata();return t.description=e.description??"",t.denomUnits=((n=e.denomUnits)==null?void 0:n.map(p=>DenomUnit.fromPartial(p)))||[],t.base=e.base??"",t.display=e.display??"",t.name=e.name??"",t.symbol=e.symbol??"",t.uri=e.uri??"",t.uriHash=e.uriHash??"",t}};function isSet$1K(e){return e!=null}function createBaseMsgSend(){return{fromAddress:"",toAddress:"",amount:[]}}const MsgSend={encode(e,t=_m0.Writer.create()){e.fromAddress!==""&&t.uint32(10).string(e.fromAddress),e.toAddress!==""&&t.uint32(18).string(e.toAddress);for(const n of e.amount)Coin$a.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgSend();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.fromAddress=n.string();break;case 2:u.toAddress=n.string();break;case 3:u.amount.push(Coin$a.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{fromAddress:isSet$1J(e.fromAddress)?String(e.fromAddress):"",toAddress:isSet$1J(e.toAddress)?String(e.toAddress):"",amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$a.fromJSON(t)):[]}},toJSON(e){const t={};return e.fromAddress!==void 0&&(t.fromAddress=e.fromAddress),e.toAddress!==void 0&&(t.toAddress=e.toAddress),e.amount?t.amount=e.amount.map(n=>n?Coin$a.toJSON(n):void 0):t.amount=[],t},fromPartial(e){var n;const t=createBaseMsgSend();return t.fromAddress=e.fromAddress??"",t.toAddress=e.toAddress??"",t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$a.fromPartial(p)))||[],t}};function createBaseMsgMultiSend(){return{inputs:[],outputs:[]}}const MsgMultiSend={encode(e,t=_m0.Writer.create()){for(const n of e.inputs)Input.encode(n,t.uint32(10).fork()).ldelim();for(const n of e.outputs)Output.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgMultiSend();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.inputs.push(Input.decode(n,n.uint32()));break;case 2:u.outputs.push(Output.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{inputs:Array.isArray(e==null?void 0:e.inputs)?e.inputs.map(t=>Input.fromJSON(t)):[],outputs:Array.isArray(e==null?void 0:e.outputs)?e.outputs.map(t=>Output.fromJSON(t)):[]}},toJSON(e){const t={};return e.inputs?t.inputs=e.inputs.map(n=>n?Input.toJSON(n):void 0):t.inputs=[],e.outputs?t.outputs=e.outputs.map(n=>n?Output.toJSON(n):void 0):t.outputs=[],t},fromPartial(e){var n,p;const t=createBaseMsgMultiSend();return t.inputs=((n=e.inputs)==null?void 0:n.map(u=>Input.fromPartial(u)))||[],t.outputs=((p=e.outputs)==null?void 0:p.map(u=>Output.fromPartial(u)))||[],t}};function isSet$1J(e){return e!=null}const msgTypes$q=[["/cosmos.bank.v1beta1.MsgSend",MsgSend],["/cosmos.bank.v1beta1.MsgMultiSend",MsgMultiSend]];let HttpClient$q=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$q=class extends HttpClient$q{constructor(){super(...arguments),this.queryAllBalances=(t,n,p={})=>this.request({path:`/cosmos/bank/v1beta1/balances/${t}`,method:"GET",query:n,format:"json",...p}),this.queryBalance=(t,n,p={})=>this.request({path:`/cosmos/bank/v1beta1/balances/${t}/by_denom`,method:"GET",query:n,format:"json",...p}),this.queryDenomOwners=(t,n,p={})=>this.request({path:`/cosmos/bank/v1beta1/denom_owners/${t}`,method:"GET",query:n,format:"json",...p}),this.queryDenomsMetadata=(t,n={})=>this.request({path:"/cosmos/bank/v1beta1/denoms_metadata",method:"GET",query:t,format:"json",...n}),this.queryDenomMetadata=(t,n={})=>this.request({path:`/cosmos/bank/v1beta1/denoms_metadata/${t}`,method:"GET",format:"json",...n}),this.queryParams=(t={})=>this.request({path:"/cosmos/bank/v1beta1/params",method:"GET",format:"json",...t}),this.querySendEnabled=(t,n={})=>this.request({path:"/cosmos/bank/v1beta1/send_enabled",method:"GET",query:t,format:"json",...n}),this.querySpendableBalances=(t,n,p={})=>this.request({path:`/cosmos/bank/v1beta1/spendable_balances/${t}`,method:"GET",query:n,format:"json",...p}),this.querySpendableBalanceByDenom=(t,n,p={})=>this.request({path:`/cosmos/bank/v1beta1/spendable_balances/${t}/by_denom`,method:"GET",query:n,format:"json",...p}),this.queryTotalSupply=(t,n={})=>this.request({path:"/cosmos/bank/v1beta1/supply",method:"GET",query:t,format:"json",...n}),this.querySupplyOf=(t,n={})=>this.request({path:"/cosmos/bank/v1beta1/supply/by_denom",method:"GET",query:t,format:"json",...n})}};function createBaseSendAuthorization(){return{spendLimit:[],allowList:[]}}const SendAuthorization={encode(e,t=_m0.Writer.create()){for(const n of e.spendLimit)Coin$a.encode(n,t.uint32(10).fork()).ldelim();for(const n of e.allowList)t.uint32(18).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseSendAuthorization();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.spendLimit.push(Coin$a.decode(n,n.uint32()));break;case 2:u.allowList.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{spendLimit:Array.isArray(e==null?void 0:e.spendLimit)?e.spendLimit.map(t=>Coin$a.fromJSON(t)):[],allowList:Array.isArray(e==null?void 0:e.allowList)?e.allowList.map(t=>String(t)):[]}},toJSON(e){const t={};return e.spendLimit?t.spendLimit=e.spendLimit.map(n=>n?Coin$a.toJSON(n):void 0):t.spendLimit=[],e.allowList?t.allowList=e.allowList.map(n=>n):t.allowList=[],t},fromPartial(e){var n,p;const t=createBaseSendAuthorization();return t.spendLimit=((n=e.spendLimit)==null?void 0:n.map(u=>Coin$a.fromPartial(u)))||[],t.allowList=((p=e.allowList)==null?void 0:p.map(u=>u))||[],t}};function createBaseBalance(){return{address:"",coins:[]}}const Balance={encode(e,t=_m0.Writer.create()){e.address!==""&&t.uint32(10).string(e.address);for(const n of e.coins)Coin$a.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseBalance();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.coins.push(Coin$a.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$1I(e.address)?String(e.address):"",coins:Array.isArray(e==null?void 0:e.coins)?e.coins.map(t=>Coin$a.fromJSON(t)):[]}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.coins?t.coins=e.coins.map(n=>n?Coin$a.toJSON(n):void 0):t.coins=[],t},fromPartial(e){var n;const t=createBaseBalance();return t.address=e.address??"",t.coins=((n=e.coins)==null?void 0:n.map(p=>Coin$a.fromPartial(p)))||[],t}};function isSet$1I(e){return e!=null}var globalThis$1t=(()=>{if(typeof globalThis$1t<"u")return globalThis$1t;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function createBaseDenomOwner(){return{address:"",balance:void 0}}const DenomOwner={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.balance!==void 0&&Coin$a.encode(e.balance,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDenomOwner();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.balance=Coin$a.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$1H(e.address)?String(e.address):"",balance:isSet$1H(e.balance)?Coin$a.fromJSON(e.balance):void 0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.balance!==void 0&&(t.balance=e.balance?Coin$a.toJSON(e.balance):void 0),t},fromPartial(e){const t=createBaseDenomOwner();return t.address=e.address??"",t.balance=e.balance!==void 0&&e.balance!==null?Coin$a.fromPartial(e.balance):void 0,t}};function isSet$1H(e){return e!=null}const registry$f=new build$b.Registry(msgTypes$q);function getStructure$n(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$e={amount:[],gas:"200000"},txClient$q=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgSend({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgSend: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$f,prefix:t});let N=this.msgSend({value:MsgSend.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$e,g)}catch(y){throw new Error("TxClient:sendMsgSend: Could not broadcast Tx: "+y.message)}},async sendMsgMultiSend({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgMultiSend: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$f,prefix:t});let N=this.msgMultiSend({value:MsgMultiSend.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$e,g)}catch(y){throw new Error("TxClient:sendMsgMultiSend: Could not broadcast Tx: "+y.message)}},msgSend({value:p}){try{return{typeUrl:"/cosmos.bank.v1beta1.MsgSend",value:MsgSend.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgSend: Could not create message: "+u.message)}},msgMultiSend({value:p}){try{return{typeUrl:"/cosmos.bank.v1beta1.MsgMultiSend",value:MsgMultiSend.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgMultiSend: Could not create message: "+u.message)}}}),queryClient$q=({addr:e}={addr:"http://localhost:1317"})=>new Api$q({baseURL:e});let SDKModule$q=class{constructor(t){this.registry=[],this.query=queryClient$q({addr:t.env.apiURL}),this.updateTX(t),this.structure={SendAuthorization:getStructure$n(SendAuthorization.fromPartial({})),Params:getStructure$n(Params$c.fromPartial({})),SendEnabled:getStructure$n(SendEnabled.fromPartial({})),Input:getStructure$n(Input.fromPartial({})),Output:getStructure$n(Output.fromPartial({})),Supply:getStructure$n(Supply.fromPartial({})),DenomUnit:getStructure$n(DenomUnit.fromPartial({})),Metadata:getStructure$n(Metadata.fromPartial({})),Balance:getStructure$n(Balance.fromPartial({})),DenomOwner:getStructure$n(DenomOwner.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$q({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$r=e=>({module:{CosmosBankV1Beta1:new SDKModule$q(e)},registry:msgTypes$q}),module$2=Object.freeze(Object.defineProperty({__proto__:null,MsgMultiSend,MsgSend,default:Module$r,queryClient:queryClient$q,registry:registry$f,txClient:txClient$q},Symbol.toStringTag,{value:"Module"})),msgTypes$p=[];let HttpClient$p=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$p=class extends HttpClient$p{constructor(){super(...arguments),this.serviceConfig=(t={})=>this.request({path:"/cosmos/base/node/v1beta1/config",method:"GET",format:"json",...t})}};new build$b.Registry(msgTypes$p);const txClient$p=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$p=({addr:e}={addr:"http://localhost:1317"})=>new Api$p({baseURL:e});let SDKModule$p=class{constructor(t){this.registry=[],this.query=queryClient$p({addr:t.env.apiURL}),this.updateTX(t),this.structure={},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$p({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$q=e=>({module:{CosmosBaseNodeV1Beta1:new SDKModule$p(e)},registry:msgTypes$p}),msgTypes$o=[];let HttpClient$o=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$o=class extends HttpClient$o{constructor(){super(...arguments),this.serviceABCIQuery=(t,n={})=>this.request({path:"/cosmos/base/tendermint/v1beta1/abci_query",method:"GET",query:t,format:"json",...n}),this.serviceGetLatestBlock=(t={})=>this.request({path:"/cosmos/base/tendermint/v1beta1/blocks/latest",method:"GET",format:"json",...t}),this.serviceGetBlockByHeight=(t,n={})=>this.request({path:`/cosmos/base/tendermint/v1beta1/blocks/${t}`,method:"GET",format:"json",...n}),this.serviceGetNodeInfo=(t={})=>this.request({path:"/cosmos/base/tendermint/v1beta1/node_info",method:"GET",format:"json",...t}),this.serviceGetSyncing=(t={})=>this.request({path:"/cosmos/base/tendermint/v1beta1/syncing",method:"GET",format:"json",...t}),this.serviceGetLatestValidatorSet=(t,n={})=>this.request({path:"/cosmos/base/tendermint/v1beta1/validatorsets/latest",method:"GET",query:t,format:"json",...n}),this.serviceGetValidatorSetByHeight=(t,n,p={})=>this.request({path:`/cosmos/base/tendermint/v1beta1/validatorsets/${t}`,method:"GET",query:n,format:"json",...p})}};function createBaseAny$b(){return{typeUrl:"",value:new Uint8Array}}const Any$b={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$b();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$1G(e.typeUrl)?String(e.typeUrl):"",value:isSet$1G(e.value)?bytesFromBase64$t(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$t(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$b();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$1s=(()=>{if(typeof globalThis$1s<"u")return globalThis$1s;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$t(e){if(globalThis$1s.Buffer)return Uint8Array.from(globalThis$1s.Buffer.from(e,"base64"));{const t=globalThis$1s.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$t(e){if(globalThis$1s.Buffer)return globalThis$1s.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$1s.btoa(t.join(""))}}function isSet$1G(e){return e!=null}var globalThis$1r=(()=>{if(typeof globalThis$1r<"u")return globalThis$1r;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function createBaseTimestamp$9(){return{seconds:0,nanos:0}}const Timestamp$9={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp$9();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$X(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$1F(e.seconds)?Number(e.seconds):0,nanos:isSet$1F(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp$9();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$1q=(()=>{if(typeof globalThis$1q<"u")return globalThis$1q;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$X(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1q.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1F(e){return e!=null}var globalThis$1p=(()=>{if(typeof globalThis$1p<"u")return globalThis$1p;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function createBaseConsensus$1(){return{block:0,app:0}}const Consensus$1={encode(e,t=_m0.Writer.create()){return e.block!==0&&t.uint32(8).uint64(e.block),e.app!==0&&t.uint32(16).uint64(e.app),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseConsensus$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.block=longToNumber$W(n.uint64());break;case 2:u.app=longToNumber$W(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{block:isSet$1E(e.block)?Number(e.block):0,app:isSet$1E(e.app)?Number(e.app):0}},toJSON(e){const t={};return e.block!==void 0&&(t.block=Math.round(e.block)),e.app!==void 0&&(t.app=Math.round(e.app)),t},fromPartial(e){const t=createBaseConsensus$1();return t.block=e.block??0,t.app=e.app??0,t}};var globalThis$1o=(()=>{if(typeof globalThis$1o<"u")return globalThis$1o;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$W(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1o.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1E(e){return e!=null}function createBasePublicKey$1(){return{ed25519:void 0,secp256k1:void 0}}const PublicKey$1={encode(e,t=_m0.Writer.create()){return e.ed25519!==void 0&&t.uint32(10).bytes(e.ed25519),e.secp256k1!==void 0&&t.uint32(18).bytes(e.secp256k1),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePublicKey$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.ed25519=n.bytes();break;case 2:u.secp256k1=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{ed25519:isSet$1D(e.ed25519)?bytesFromBase64$s(e.ed25519):void 0,secp256k1:isSet$1D(e.secp256k1)?bytesFromBase64$s(e.secp256k1):void 0}},toJSON(e){const t={};return e.ed25519!==void 0&&(t.ed25519=e.ed25519!==void 0?base64FromBytes$s(e.ed25519):void 0),e.secp256k1!==void 0&&(t.secp256k1=e.secp256k1!==void 0?base64FromBytes$s(e.secp256k1):void 0),t},fromPartial(e){const t=createBasePublicKey$1();return t.ed25519=e.ed25519??void 0,t.secp256k1=e.secp256k1??void 0,t}};var globalThis$1n=(()=>{if(typeof globalThis$1n<"u")return globalThis$1n;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$s(e){if(globalThis$1n.Buffer)return Uint8Array.from(globalThis$1n.Buffer.from(e,"base64"));{const t=globalThis$1n.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$s(e){if(globalThis$1n.Buffer)return globalThis$1n.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$1n.btoa(t.join(""))}}function isSet$1D(e){return e!=null}function createBaseValidatorSet(){return{validators:[],proposer:void 0,totalVotingPower:0}}const ValidatorSet={encode(e,t=_m0.Writer.create()){for(const n of e.validators)Validator$2.encode(n,t.uint32(10).fork()).ldelim();return e.proposer!==void 0&&Validator$2.encode(e.proposer,t.uint32(18).fork()).ldelim(),e.totalVotingPower!==0&&t.uint32(24).int64(e.totalVotingPower),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorSet();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validators.push(Validator$2.decode(n,n.uint32()));break;case 2:u.proposer=Validator$2.decode(n,n.uint32());break;case 3:u.totalVotingPower=longToNumber$V(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validators:Array.isArray(e==null?void 0:e.validators)?e.validators.map(t=>Validator$2.fromJSON(t)):[],proposer:isSet$1C(e.proposer)?Validator$2.fromJSON(e.proposer):void 0,totalVotingPower:isSet$1C(e.totalVotingPower)?Number(e.totalVotingPower):0}},toJSON(e){const t={};return e.validators?t.validators=e.validators.map(n=>n?Validator$2.toJSON(n):void 0):t.validators=[],e.proposer!==void 0&&(t.proposer=e.proposer?Validator$2.toJSON(e.proposer):void 0),e.totalVotingPower!==void 0&&(t.totalVotingPower=Math.round(e.totalVotingPower)),t},fromPartial(e){var n;const t=createBaseValidatorSet();return t.validators=((n=e.validators)==null?void 0:n.map(p=>Validator$2.fromPartial(p)))||[],t.proposer=e.proposer!==void 0&&e.proposer!==null?Validator$2.fromPartial(e.proposer):void 0,t.totalVotingPower=e.totalVotingPower??0,t}};function createBaseValidator$2(){return{address:new Uint8Array,pubKey:void 0,votingPower:0,proposerPriority:0}}const Validator$2={encode(e,t=_m0.Writer.create()){return e.address.length!==0&&t.uint32(10).bytes(e.address),e.pubKey!==void 0&&PublicKey$1.encode(e.pubKey,t.uint32(18).fork()).ldelim(),e.votingPower!==0&&t.uint32(24).int64(e.votingPower),e.proposerPriority!==0&&t.uint32(32).int64(e.proposerPriority),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidator$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.bytes();break;case 2:u.pubKey=PublicKey$1.decode(n,n.uint32());break;case 3:u.votingPower=longToNumber$V(n.int64());break;case 4:u.proposerPriority=longToNumber$V(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$1C(e.address)?bytesFromBase64$r(e.address):new Uint8Array,pubKey:isSet$1C(e.pubKey)?PublicKey$1.fromJSON(e.pubKey):void 0,votingPower:isSet$1C(e.votingPower)?Number(e.votingPower):0,proposerPriority:isSet$1C(e.proposerPriority)?Number(e.proposerPriority):0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=base64FromBytes$r(e.address!==void 0?e.address:new Uint8Array)),e.pubKey!==void 0&&(t.pubKey=e.pubKey?PublicKey$1.toJSON(e.pubKey):void 0),e.votingPower!==void 0&&(t.votingPower=Math.round(e.votingPower)),e.proposerPriority!==void 0&&(t.proposerPriority=Math.round(e.proposerPriority)),t},fromPartial(e){const t=createBaseValidator$2();return t.address=e.address??new Uint8Array,t.pubKey=e.pubKey!==void 0&&e.pubKey!==null?PublicKey$1.fromPartial(e.pubKey):void 0,t.votingPower=e.votingPower??0,t.proposerPriority=e.proposerPriority??0,t}};var globalThis$1m=(()=>{if(typeof globalThis$1m<"u")return globalThis$1m;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$r(e){if(globalThis$1m.Buffer)return Uint8Array.from(globalThis$1m.Buffer.from(e,"base64"));{const t=globalThis$1m.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$r(e){if(globalThis$1m.Buffer)return globalThis$1m.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$1m.btoa(t.join(""))}}function longToNumber$V(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1m.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1C(e){return e!=null}function blockIDFlagFromJSON(e){switch(e){case 0:case"BLOCK_ID_FLAG_UNKNOWN":return 0;case 1:case"BLOCK_ID_FLAG_ABSENT":return 1;case 2:case"BLOCK_ID_FLAG_COMMIT":return 2;case 3:case"BLOCK_ID_FLAG_NIL":return 3;case-1:case"UNRECOGNIZED":default:return-1}}function blockIDFlagToJSON(e){switch(e){case 0:return"BLOCK_ID_FLAG_UNKNOWN";case 1:return"BLOCK_ID_FLAG_ABSENT";case 2:return"BLOCK_ID_FLAG_COMMIT";case 3:return"BLOCK_ID_FLAG_NIL";case-1:default:return"UNRECOGNIZED"}}function signedMsgTypeFromJSON(e){switch(e){case 0:case"SIGNED_MSG_TYPE_UNKNOWN":return 0;case 1:case"SIGNED_MSG_TYPE_PREVOTE":return 1;case 2:case"SIGNED_MSG_TYPE_PRECOMMIT":return 2;case 32:case"SIGNED_MSG_TYPE_PROPOSAL":return 32;case-1:case"UNRECOGNIZED":default:return-1}}function signedMsgTypeToJSON(e){switch(e){case 0:return"SIGNED_MSG_TYPE_UNKNOWN";case 1:return"SIGNED_MSG_TYPE_PREVOTE";case 2:return"SIGNED_MSG_TYPE_PRECOMMIT";case 32:return"SIGNED_MSG_TYPE_PROPOSAL";case-1:default:return"UNRECOGNIZED"}}function createBasePartSetHeader$1(){return{total:0,hash:new Uint8Array}}const PartSetHeader$1={encode(e,t=_m0.Writer.create()){return e.total!==0&&t.uint32(8).uint32(e.total),e.hash.length!==0&&t.uint32(18).bytes(e.hash),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePartSetHeader$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.total=n.uint32();break;case 2:u.hash=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{total:isSet$1B(e.total)?Number(e.total):0,hash:isSet$1B(e.hash)?bytesFromBase64$q(e.hash):new Uint8Array}},toJSON(e){const t={};return e.total!==void 0&&(t.total=Math.round(e.total)),e.hash!==void 0&&(t.hash=base64FromBytes$q(e.hash!==void 0?e.hash:new Uint8Array)),t},fromPartial(e){const t=createBasePartSetHeader$1();return t.total=e.total??0,t.hash=e.hash??new Uint8Array,t}};function createBaseBlockID$1(){return{hash:new Uint8Array,partSetHeader:void 0}}const BlockID$1={encode(e,t=_m0.Writer.create()){return e.hash.length!==0&&t.uint32(10).bytes(e.hash),e.partSetHeader!==void 0&&PartSetHeader$1.encode(e.partSetHeader,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseBlockID$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.hash=n.bytes();break;case 2:u.partSetHeader=PartSetHeader$1.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{hash:isSet$1B(e.hash)?bytesFromBase64$q(e.hash):new Uint8Array,partSetHeader:isSet$1B(e.partSetHeader)?PartSetHeader$1.fromJSON(e.partSetHeader):void 0}},toJSON(e){const t={};return e.hash!==void 0&&(t.hash=base64FromBytes$q(e.hash!==void 0?e.hash:new Uint8Array)),e.partSetHeader!==void 0&&(t.partSetHeader=e.partSetHeader?PartSetHeader$1.toJSON(e.partSetHeader):void 0),t},fromPartial(e){const t=createBaseBlockID$1();return t.hash=e.hash??new Uint8Array,t.partSetHeader=e.partSetHeader!==void 0&&e.partSetHeader!==null?PartSetHeader$1.fromPartial(e.partSetHeader):void 0,t}};function createBaseHeader$2(){return{version:void 0,chainId:"",height:0,time:void 0,lastBlockId:void 0,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}}const Header$2={encode(e,t=_m0.Writer.create()){return e.version!==void 0&&Consensus$1.encode(e.version,t.uint32(10).fork()).ldelim(),e.chainId!==""&&t.uint32(18).string(e.chainId),e.height!==0&&t.uint32(24).int64(e.height),e.time!==void 0&&Timestamp$9.encode(toTimestamp$c(e.time),t.uint32(34).fork()).ldelim(),e.lastBlockId!==void 0&&BlockID$1.encode(e.lastBlockId,t.uint32(42).fork()).ldelim(),e.lastCommitHash.length!==0&&t.uint32(50).bytes(e.lastCommitHash),e.dataHash.length!==0&&t.uint32(58).bytes(e.dataHash),e.validatorsHash.length!==0&&t.uint32(66).bytes(e.validatorsHash),e.nextValidatorsHash.length!==0&&t.uint32(74).bytes(e.nextValidatorsHash),e.consensusHash.length!==0&&t.uint32(82).bytes(e.consensusHash),e.appHash.length!==0&&t.uint32(90).bytes(e.appHash),e.lastResultsHash.length!==0&&t.uint32(98).bytes(e.lastResultsHash),e.evidenceHash.length!==0&&t.uint32(106).bytes(e.evidenceHash),e.proposerAddress.length!==0&&t.uint32(114).bytes(e.proposerAddress),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseHeader$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.version=Consensus$1.decode(n,n.uint32());break;case 2:u.chainId=n.string();break;case 3:u.height=longToNumber$U(n.int64());break;case 4:u.time=fromTimestamp$c(Timestamp$9.decode(n,n.uint32()));break;case 5:u.lastBlockId=BlockID$1.decode(n,n.uint32());break;case 6:u.lastCommitHash=n.bytes();break;case 7:u.dataHash=n.bytes();break;case 8:u.validatorsHash=n.bytes();break;case 9:u.nextValidatorsHash=n.bytes();break;case 10:u.consensusHash=n.bytes();break;case 11:u.appHash=n.bytes();break;case 12:u.lastResultsHash=n.bytes();break;case 13:u.evidenceHash=n.bytes();break;case 14:u.proposerAddress=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{version:isSet$1B(e.version)?Consensus$1.fromJSON(e.version):void 0,chainId:isSet$1B(e.chainId)?String(e.chainId):"",height:isSet$1B(e.height)?Number(e.height):0,time:isSet$1B(e.time)?fromJsonTimestamp$c(e.time):void 0,lastBlockId:isSet$1B(e.lastBlockId)?BlockID$1.fromJSON(e.lastBlockId):void 0,lastCommitHash:isSet$1B(e.lastCommitHash)?bytesFromBase64$q(e.lastCommitHash):new Uint8Array,dataHash:isSet$1B(e.dataHash)?bytesFromBase64$q(e.dataHash):new Uint8Array,validatorsHash:isSet$1B(e.validatorsHash)?bytesFromBase64$q(e.validatorsHash):new Uint8Array,nextValidatorsHash:isSet$1B(e.nextValidatorsHash)?bytesFromBase64$q(e.nextValidatorsHash):new Uint8Array,consensusHash:isSet$1B(e.consensusHash)?bytesFromBase64$q(e.consensusHash):new Uint8Array,appHash:isSet$1B(e.appHash)?bytesFromBase64$q(e.appHash):new Uint8Array,lastResultsHash:isSet$1B(e.lastResultsHash)?bytesFromBase64$q(e.lastResultsHash):new Uint8Array,evidenceHash:isSet$1B(e.evidenceHash)?bytesFromBase64$q(e.evidenceHash):new Uint8Array,proposerAddress:isSet$1B(e.proposerAddress)?bytesFromBase64$q(e.proposerAddress):new Uint8Array}},toJSON(e){const t={};return e.version!==void 0&&(t.version=e.version?Consensus$1.toJSON(e.version):void 0),e.chainId!==void 0&&(t.chainId=e.chainId),e.height!==void 0&&(t.height=Math.round(e.height)),e.time!==void 0&&(t.time=e.time.toISOString()),e.lastBlockId!==void 0&&(t.lastBlockId=e.lastBlockId?BlockID$1.toJSON(e.lastBlockId):void 0),e.lastCommitHash!==void 0&&(t.lastCommitHash=base64FromBytes$q(e.lastCommitHash!==void 0?e.lastCommitHash:new Uint8Array)),e.dataHash!==void 0&&(t.dataHash=base64FromBytes$q(e.dataHash!==void 0?e.dataHash:new Uint8Array)),e.validatorsHash!==void 0&&(t.validatorsHash=base64FromBytes$q(e.validatorsHash!==void 0?e.validatorsHash:new Uint8Array)),e.nextValidatorsHash!==void 0&&(t.nextValidatorsHash=base64FromBytes$q(e.nextValidatorsHash!==void 0?e.nextValidatorsHash:new Uint8Array)),e.consensusHash!==void 0&&(t.consensusHash=base64FromBytes$q(e.consensusHash!==void 0?e.consensusHash:new Uint8Array)),e.appHash!==void 0&&(t.appHash=base64FromBytes$q(e.appHash!==void 0?e.appHash:new Uint8Array)),e.lastResultsHash!==void 0&&(t.lastResultsHash=base64FromBytes$q(e.lastResultsHash!==void 0?e.lastResultsHash:new Uint8Array)),e.evidenceHash!==void 0&&(t.evidenceHash=base64FromBytes$q(e.evidenceHash!==void 0?e.evidenceHash:new Uint8Array)),e.proposerAddress!==void 0&&(t.proposerAddress=base64FromBytes$q(e.proposerAddress!==void 0?e.proposerAddress:new Uint8Array)),t},fromPartial(e){const t=createBaseHeader$2();return t.version=e.version!==void 0&&e.version!==null?Consensus$1.fromPartial(e.version):void 0,t.chainId=e.chainId??"",t.height=e.height??0,t.time=e.time??void 0,t.lastBlockId=e.lastBlockId!==void 0&&e.lastBlockId!==null?BlockID$1.fromPartial(e.lastBlockId):void 0,t.lastCommitHash=e.lastCommitHash??new Uint8Array,t.dataHash=e.dataHash??new Uint8Array,t.validatorsHash=e.validatorsHash??new Uint8Array,t.nextValidatorsHash=e.nextValidatorsHash??new Uint8Array,t.consensusHash=e.consensusHash??new Uint8Array,t.appHash=e.appHash??new Uint8Array,t.lastResultsHash=e.lastResultsHash??new Uint8Array,t.evidenceHash=e.evidenceHash??new Uint8Array,t.proposerAddress=e.proposerAddress??new Uint8Array,t}};function createBaseData(){return{txs:[]}}const Data={encode(e,t=_m0.Writer.create()){for(const n of e.txs)t.uint32(10).bytes(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseData();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.txs.push(n.bytes());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{txs:Array.isArray(e==null?void 0:e.txs)?e.txs.map(t=>bytesFromBase64$q(t)):[]}},toJSON(e){const t={};return e.txs?t.txs=e.txs.map(n=>base64FromBytes$q(n!==void 0?n:new Uint8Array)):t.txs=[],t},fromPartial(e){var n;const t=createBaseData();return t.txs=((n=e.txs)==null?void 0:n.map(p=>p))||[],t}};function createBaseVote$3(){return{type:0,height:0,round:0,blockId:void 0,timestamp:void 0,validatorAddress:new Uint8Array,validatorIndex:0,signature:new Uint8Array}}const Vote$3={encode(e,t=_m0.Writer.create()){return e.type!==0&&t.uint32(8).int32(e.type),e.height!==0&&t.uint32(16).int64(e.height),e.round!==0&&t.uint32(24).int32(e.round),e.blockId!==void 0&&BlockID$1.encode(e.blockId,t.uint32(34).fork()).ldelim(),e.timestamp!==void 0&&Timestamp$9.encode(toTimestamp$c(e.timestamp),t.uint32(42).fork()).ldelim(),e.validatorAddress.length!==0&&t.uint32(50).bytes(e.validatorAddress),e.validatorIndex!==0&&t.uint32(56).int32(e.validatorIndex),e.signature.length!==0&&t.uint32(66).bytes(e.signature),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseVote$3();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.type=n.int32();break;case 2:u.height=longToNumber$U(n.int64());break;case 3:u.round=n.int32();break;case 4:u.blockId=BlockID$1.decode(n,n.uint32());break;case 5:u.timestamp=fromTimestamp$c(Timestamp$9.decode(n,n.uint32()));break;case 6:u.validatorAddress=n.bytes();break;case 7:u.validatorIndex=n.int32();break;case 8:u.signature=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{type:isSet$1B(e.type)?signedMsgTypeFromJSON(e.type):0,height:isSet$1B(e.height)?Number(e.height):0,round:isSet$1B(e.round)?Number(e.round):0,blockId:isSet$1B(e.blockId)?BlockID$1.fromJSON(e.blockId):void 0,timestamp:isSet$1B(e.timestamp)?fromJsonTimestamp$c(e.timestamp):void 0,validatorAddress:isSet$1B(e.validatorAddress)?bytesFromBase64$q(e.validatorAddress):new Uint8Array,validatorIndex:isSet$1B(e.validatorIndex)?Number(e.validatorIndex):0,signature:isSet$1B(e.signature)?bytesFromBase64$q(e.signature):new Uint8Array}},toJSON(e){const t={};return e.type!==void 0&&(t.type=signedMsgTypeToJSON(e.type)),e.height!==void 0&&(t.height=Math.round(e.height)),e.round!==void 0&&(t.round=Math.round(e.round)),e.blockId!==void 0&&(t.blockId=e.blockId?BlockID$1.toJSON(e.blockId):void 0),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.validatorAddress!==void 0&&(t.validatorAddress=base64FromBytes$q(e.validatorAddress!==void 0?e.validatorAddress:new Uint8Array)),e.validatorIndex!==void 0&&(t.validatorIndex=Math.round(e.validatorIndex)),e.signature!==void 0&&(t.signature=base64FromBytes$q(e.signature!==void 0?e.signature:new Uint8Array)),t},fromPartial(e){const t=createBaseVote$3();return t.type=e.type??0,t.height=e.height??0,t.round=e.round??0,t.blockId=e.blockId!==void 0&&e.blockId!==null?BlockID$1.fromPartial(e.blockId):void 0,t.timestamp=e.timestamp??void 0,t.validatorAddress=e.validatorAddress??new Uint8Array,t.validatorIndex=e.validatorIndex??0,t.signature=e.signature??new Uint8Array,t}};function createBaseCommit(){return{height:0,round:0,blockId:void 0,signatures:[]}}const Commit={encode(e,t=_m0.Writer.create()){e.height!==0&&t.uint32(8).int64(e.height),e.round!==0&&t.uint32(16).int32(e.round),e.blockId!==void 0&&BlockID$1.encode(e.blockId,t.uint32(26).fork()).ldelim();for(const n of e.signatures)CommitSig.encode(n,t.uint32(34).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCommit();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.height=longToNumber$U(n.int64());break;case 2:u.round=n.int32();break;case 3:u.blockId=BlockID$1.decode(n,n.uint32());break;case 4:u.signatures.push(CommitSig.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{height:isSet$1B(e.height)?Number(e.height):0,round:isSet$1B(e.round)?Number(e.round):0,blockId:isSet$1B(e.blockId)?BlockID$1.fromJSON(e.blockId):void 0,signatures:Array.isArray(e==null?void 0:e.signatures)?e.signatures.map(t=>CommitSig.fromJSON(t)):[]}},toJSON(e){const t={};return e.height!==void 0&&(t.height=Math.round(e.height)),e.round!==void 0&&(t.round=Math.round(e.round)),e.blockId!==void 0&&(t.blockId=e.blockId?BlockID$1.toJSON(e.blockId):void 0),e.signatures?t.signatures=e.signatures.map(n=>n?CommitSig.toJSON(n):void 0):t.signatures=[],t},fromPartial(e){var n;const t=createBaseCommit();return t.height=e.height??0,t.round=e.round??0,t.blockId=e.blockId!==void 0&&e.blockId!==null?BlockID$1.fromPartial(e.blockId):void 0,t.signatures=((n=e.signatures)==null?void 0:n.map(p=>CommitSig.fromPartial(p)))||[],t}};function createBaseCommitSig(){return{blockIdFlag:0,validatorAddress:new Uint8Array,timestamp:void 0,signature:new Uint8Array}}const CommitSig={encode(e,t=_m0.Writer.create()){return e.blockIdFlag!==0&&t.uint32(8).int32(e.blockIdFlag),e.validatorAddress.length!==0&&t.uint32(18).bytes(e.validatorAddress),e.timestamp!==void 0&&Timestamp$9.encode(toTimestamp$c(e.timestamp),t.uint32(26).fork()).ldelim(),e.signature.length!==0&&t.uint32(34).bytes(e.signature),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCommitSig();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.blockIdFlag=n.int32();break;case 2:u.validatorAddress=n.bytes();break;case 3:u.timestamp=fromTimestamp$c(Timestamp$9.decode(n,n.uint32()));break;case 4:u.signature=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{blockIdFlag:isSet$1B(e.blockIdFlag)?blockIDFlagFromJSON(e.blockIdFlag):0,validatorAddress:isSet$1B(e.validatorAddress)?bytesFromBase64$q(e.validatorAddress):new Uint8Array,timestamp:isSet$1B(e.timestamp)?fromJsonTimestamp$c(e.timestamp):void 0,signature:isSet$1B(e.signature)?bytesFromBase64$q(e.signature):new Uint8Array}},toJSON(e){const t={};return e.blockIdFlag!==void 0&&(t.blockIdFlag=blockIDFlagToJSON(e.blockIdFlag)),e.validatorAddress!==void 0&&(t.validatorAddress=base64FromBytes$q(e.validatorAddress!==void 0?e.validatorAddress:new Uint8Array)),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.signature!==void 0&&(t.signature=base64FromBytes$q(e.signature!==void 0?e.signature:new Uint8Array)),t},fromPartial(e){const t=createBaseCommitSig();return t.blockIdFlag=e.blockIdFlag??0,t.validatorAddress=e.validatorAddress??new Uint8Array,t.timestamp=e.timestamp??void 0,t.signature=e.signature??new Uint8Array,t}};function createBaseSignedHeader(){return{header:void 0,commit:void 0}}const SignedHeader={encode(e,t=_m0.Writer.create()){return e.header!==void 0&&Header$2.encode(e.header,t.uint32(10).fork()).ldelim(),e.commit!==void 0&&Commit.encode(e.commit,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseSignedHeader();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.header=Header$2.decode(n,n.uint32());break;case 2:u.commit=Commit.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{header:isSet$1B(e.header)?Header$2.fromJSON(e.header):void 0,commit:isSet$1B(e.commit)?Commit.fromJSON(e.commit):void 0}},toJSON(e){const t={};return e.header!==void 0&&(t.header=e.header?Header$2.toJSON(e.header):void 0),e.commit!==void 0&&(t.commit=e.commit?Commit.toJSON(e.commit):void 0),t},fromPartial(e){const t=createBaseSignedHeader();return t.header=e.header!==void 0&&e.header!==null?Header$2.fromPartial(e.header):void 0,t.commit=e.commit!==void 0&&e.commit!==null?Commit.fromPartial(e.commit):void 0,t}};function createBaseLightBlock(){return{signedHeader:void 0,validatorSet:void 0}}const LightBlock={encode(e,t=_m0.Writer.create()){return e.signedHeader!==void 0&&SignedHeader.encode(e.signedHeader,t.uint32(10).fork()).ldelim(),e.validatorSet!==void 0&&ValidatorSet.encode(e.validatorSet,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseLightBlock();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.signedHeader=SignedHeader.decode(n,n.uint32());break;case 2:u.validatorSet=ValidatorSet.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{signedHeader:isSet$1B(e.signedHeader)?SignedHeader.fromJSON(e.signedHeader):void 0,validatorSet:isSet$1B(e.validatorSet)?ValidatorSet.fromJSON(e.validatorSet):void 0}},toJSON(e){const t={};return e.signedHeader!==void 0&&(t.signedHeader=e.signedHeader?SignedHeader.toJSON(e.signedHeader):void 0),e.validatorSet!==void 0&&(t.validatorSet=e.validatorSet?ValidatorSet.toJSON(e.validatorSet):void 0),t},fromPartial(e){const t=createBaseLightBlock();return t.signedHeader=e.signedHeader!==void 0&&e.signedHeader!==null?SignedHeader.fromPartial(e.signedHeader):void 0,t.validatorSet=e.validatorSet!==void 0&&e.validatorSet!==null?ValidatorSet.fromPartial(e.validatorSet):void 0,t}};var globalThis$1l=(()=>{if(typeof globalThis$1l<"u")return globalThis$1l;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$q(e){if(globalThis$1l.Buffer)return Uint8Array.from(globalThis$1l.Buffer.from(e,"base64"));{const t=globalThis$1l.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$q(e){if(globalThis$1l.Buffer)return globalThis$1l.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$1l.btoa(t.join(""))}}function toTimestamp$c(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$c(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$c(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$c(Timestamp$9.fromJSON(e))}function longToNumber$U(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1l.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1B(e){return e!=null}function createBaseEvidence(){return{duplicateVoteEvidence:void 0,lightClientAttackEvidence:void 0}}const Evidence={encode(e,t=_m0.Writer.create()){return e.duplicateVoteEvidence!==void 0&&DuplicateVoteEvidence.encode(e.duplicateVoteEvidence,t.uint32(10).fork()).ldelim(),e.lightClientAttackEvidence!==void 0&&LightClientAttackEvidence.encode(e.lightClientAttackEvidence,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEvidence();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.duplicateVoteEvidence=DuplicateVoteEvidence.decode(n,n.uint32());break;case 2:u.lightClientAttackEvidence=LightClientAttackEvidence.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{duplicateVoteEvidence:isSet$1A(e.duplicateVoteEvidence)?DuplicateVoteEvidence.fromJSON(e.duplicateVoteEvidence):void 0,lightClientAttackEvidence:isSet$1A(e.lightClientAttackEvidence)?LightClientAttackEvidence.fromJSON(e.lightClientAttackEvidence):void 0}},toJSON(e){const t={};return e.duplicateVoteEvidence!==void 0&&(t.duplicateVoteEvidence=e.duplicateVoteEvidence?DuplicateVoteEvidence.toJSON(e.duplicateVoteEvidence):void 0),e.lightClientAttackEvidence!==void 0&&(t.lightClientAttackEvidence=e.lightClientAttackEvidence?LightClientAttackEvidence.toJSON(e.lightClientAttackEvidence):void 0),t},fromPartial(e){const t=createBaseEvidence();return t.duplicateVoteEvidence=e.duplicateVoteEvidence!==void 0&&e.duplicateVoteEvidence!==null?DuplicateVoteEvidence.fromPartial(e.duplicateVoteEvidence):void 0,t.lightClientAttackEvidence=e.lightClientAttackEvidence!==void 0&&e.lightClientAttackEvidence!==null?LightClientAttackEvidence.fromPartial(e.lightClientAttackEvidence):void 0,t}};function createBaseDuplicateVoteEvidence(){return{voteA:void 0,voteB:void 0,totalVotingPower:0,validatorPower:0,timestamp:void 0}}const DuplicateVoteEvidence={encode(e,t=_m0.Writer.create()){return e.voteA!==void 0&&Vote$3.encode(e.voteA,t.uint32(10).fork()).ldelim(),e.voteB!==void 0&&Vote$3.encode(e.voteB,t.uint32(18).fork()).ldelim(),e.totalVotingPower!==0&&t.uint32(24).int64(e.totalVotingPower),e.validatorPower!==0&&t.uint32(32).int64(e.validatorPower),e.timestamp!==void 0&&Timestamp$9.encode(toTimestamp$b(e.timestamp),t.uint32(42).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDuplicateVoteEvidence();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.voteA=Vote$3.decode(n,n.uint32());break;case 2:u.voteB=Vote$3.decode(n,n.uint32());break;case 3:u.totalVotingPower=longToNumber$T(n.int64());break;case 4:u.validatorPower=longToNumber$T(n.int64());break;case 5:u.timestamp=fromTimestamp$b(Timestamp$9.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{voteA:isSet$1A(e.voteA)?Vote$3.fromJSON(e.voteA):void 0,voteB:isSet$1A(e.voteB)?Vote$3.fromJSON(e.voteB):void 0,totalVotingPower:isSet$1A(e.totalVotingPower)?Number(e.totalVotingPower):0,validatorPower:isSet$1A(e.validatorPower)?Number(e.validatorPower):0,timestamp:isSet$1A(e.timestamp)?fromJsonTimestamp$b(e.timestamp):void 0}},toJSON(e){const t={};return e.voteA!==void 0&&(t.voteA=e.voteA?Vote$3.toJSON(e.voteA):void 0),e.voteB!==void 0&&(t.voteB=e.voteB?Vote$3.toJSON(e.voteB):void 0),e.totalVotingPower!==void 0&&(t.totalVotingPower=Math.round(e.totalVotingPower)),e.validatorPower!==void 0&&(t.validatorPower=Math.round(e.validatorPower)),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),t},fromPartial(e){const t=createBaseDuplicateVoteEvidence();return t.voteA=e.voteA!==void 0&&e.voteA!==null?Vote$3.fromPartial(e.voteA):void 0,t.voteB=e.voteB!==void 0&&e.voteB!==null?Vote$3.fromPartial(e.voteB):void 0,t.totalVotingPower=e.totalVotingPower??0,t.validatorPower=e.validatorPower??0,t.timestamp=e.timestamp??void 0,t}};function createBaseLightClientAttackEvidence(){return{conflictingBlock:void 0,commonHeight:0,byzantineValidators:[],totalVotingPower:0,timestamp:void 0}}const LightClientAttackEvidence={encode(e,t=_m0.Writer.create()){e.conflictingBlock!==void 0&&LightBlock.encode(e.conflictingBlock,t.uint32(10).fork()).ldelim(),e.commonHeight!==0&&t.uint32(16).int64(e.commonHeight);for(const n of e.byzantineValidators)Validator$2.encode(n,t.uint32(26).fork()).ldelim();return e.totalVotingPower!==0&&t.uint32(32).int64(e.totalVotingPower),e.timestamp!==void 0&&Timestamp$9.encode(toTimestamp$b(e.timestamp),t.uint32(42).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseLightClientAttackEvidence();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.conflictingBlock=LightBlock.decode(n,n.uint32());break;case 2:u.commonHeight=longToNumber$T(n.int64());break;case 3:u.byzantineValidators.push(Validator$2.decode(n,n.uint32()));break;case 4:u.totalVotingPower=longToNumber$T(n.int64());break;case 5:u.timestamp=fromTimestamp$b(Timestamp$9.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{conflictingBlock:isSet$1A(e.conflictingBlock)?LightBlock.fromJSON(e.conflictingBlock):void 0,commonHeight:isSet$1A(e.commonHeight)?Number(e.commonHeight):0,byzantineValidators:Array.isArray(e==null?void 0:e.byzantineValidators)?e.byzantineValidators.map(t=>Validator$2.fromJSON(t)):[],totalVotingPower:isSet$1A(e.totalVotingPower)?Number(e.totalVotingPower):0,timestamp:isSet$1A(e.timestamp)?fromJsonTimestamp$b(e.timestamp):void 0}},toJSON(e){const t={};return e.conflictingBlock!==void 0&&(t.conflictingBlock=e.conflictingBlock?LightBlock.toJSON(e.conflictingBlock):void 0),e.commonHeight!==void 0&&(t.commonHeight=Math.round(e.commonHeight)),e.byzantineValidators?t.byzantineValidators=e.byzantineValidators.map(n=>n?Validator$2.toJSON(n):void 0):t.byzantineValidators=[],e.totalVotingPower!==void 0&&(t.totalVotingPower=Math.round(e.totalVotingPower)),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),t},fromPartial(e){var n;const t=createBaseLightClientAttackEvidence();return t.conflictingBlock=e.conflictingBlock!==void 0&&e.conflictingBlock!==null?LightBlock.fromPartial(e.conflictingBlock):void 0,t.commonHeight=e.commonHeight??0,t.byzantineValidators=((n=e.byzantineValidators)==null?void 0:n.map(p=>Validator$2.fromPartial(p)))||[],t.totalVotingPower=e.totalVotingPower??0,t.timestamp=e.timestamp??void 0,t}};function createBaseEvidenceList(){return{evidence:[]}}const EvidenceList={encode(e,t=_m0.Writer.create()){for(const n of e.evidence)Evidence.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEvidenceList();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.evidence.push(Evidence.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{evidence:Array.isArray(e==null?void 0:e.evidence)?e.evidence.map(t=>Evidence.fromJSON(t)):[]}},toJSON(e){const t={};return e.evidence?t.evidence=e.evidence.map(n=>n?Evidence.toJSON(n):void 0):t.evidence=[],t},fromPartial(e){var n;const t=createBaseEvidenceList();return t.evidence=((n=e.evidence)==null?void 0:n.map(p=>Evidence.fromPartial(p)))||[],t}};var globalThis$1k=(()=>{if(typeof globalThis$1k<"u")return globalThis$1k;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function toTimestamp$b(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$b(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$b(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$b(Timestamp$9.fromJSON(e))}function longToNumber$T(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1k.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1A(e){return e!=null}var globalThis$1j=(()=>{if(typeof globalThis$1j<"u")return globalThis$1j;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function createBaseBlock(){return{header:void 0,data:void 0,evidence:void 0,lastCommit:void 0}}const Block={encode(e,t=_m0.Writer.create()){return e.header!==void 0&&Header$1.encode(e.header,t.uint32(10).fork()).ldelim(),e.data!==void 0&&Data.encode(e.data,t.uint32(18).fork()).ldelim(),e.evidence!==void 0&&EvidenceList.encode(e.evidence,t.uint32(26).fork()).ldelim(),e.lastCommit!==void 0&&Commit.encode(e.lastCommit,t.uint32(34).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseBlock();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.header=Header$1.decode(n,n.uint32());break;case 2:u.data=Data.decode(n,n.uint32());break;case 3:u.evidence=EvidenceList.decode(n,n.uint32());break;case 4:u.lastCommit=Commit.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{header:isSet$1z(e.header)?Header$1.fromJSON(e.header):void 0,data:isSet$1z(e.data)?Data.fromJSON(e.data):void 0,evidence:isSet$1z(e.evidence)?EvidenceList.fromJSON(e.evidence):void 0,lastCommit:isSet$1z(e.lastCommit)?Commit.fromJSON(e.lastCommit):void 0}},toJSON(e){const t={};return e.header!==void 0&&(t.header=e.header?Header$1.toJSON(e.header):void 0),e.data!==void 0&&(t.data=e.data?Data.toJSON(e.data):void 0),e.evidence!==void 0&&(t.evidence=e.evidence?EvidenceList.toJSON(e.evidence):void 0),e.lastCommit!==void 0&&(t.lastCommit=e.lastCommit?Commit.toJSON(e.lastCommit):void 0),t},fromPartial(e){const t=createBaseBlock();return t.header=e.header!==void 0&&e.header!==null?Header$1.fromPartial(e.header):void 0,t.data=e.data!==void 0&&e.data!==null?Data.fromPartial(e.data):void 0,t.evidence=e.evidence!==void 0&&e.evidence!==null?EvidenceList.fromPartial(e.evidence):void 0,t.lastCommit=e.lastCommit!==void 0&&e.lastCommit!==null?Commit.fromPartial(e.lastCommit):void 0,t}};function createBaseHeader$1(){return{version:void 0,chainId:"",height:0,time:void 0,lastBlockId:void 0,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:""}}const Header$1={encode(e,t=_m0.Writer.create()){return e.version!==void 0&&Consensus$1.encode(e.version,t.uint32(10).fork()).ldelim(),e.chainId!==""&&t.uint32(18).string(e.chainId),e.height!==0&&t.uint32(24).int64(e.height),e.time!==void 0&&Timestamp$9.encode(toTimestamp$a(e.time),t.uint32(34).fork()).ldelim(),e.lastBlockId!==void 0&&BlockID$1.encode(e.lastBlockId,t.uint32(42).fork()).ldelim(),e.lastCommitHash.length!==0&&t.uint32(50).bytes(e.lastCommitHash),e.dataHash.length!==0&&t.uint32(58).bytes(e.dataHash),e.validatorsHash.length!==0&&t.uint32(66).bytes(e.validatorsHash),e.nextValidatorsHash.length!==0&&t.uint32(74).bytes(e.nextValidatorsHash),e.consensusHash.length!==0&&t.uint32(82).bytes(e.consensusHash),e.appHash.length!==0&&t.uint32(90).bytes(e.appHash),e.lastResultsHash.length!==0&&t.uint32(98).bytes(e.lastResultsHash),e.evidenceHash.length!==0&&t.uint32(106).bytes(e.evidenceHash),e.proposerAddress!==""&&t.uint32(114).string(e.proposerAddress),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseHeader$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.version=Consensus$1.decode(n,n.uint32());break;case 2:u.chainId=n.string();break;case 3:u.height=longToNumber$S(n.int64());break;case 4:u.time=fromTimestamp$a(Timestamp$9.decode(n,n.uint32()));break;case 5:u.lastBlockId=BlockID$1.decode(n,n.uint32());break;case 6:u.lastCommitHash=n.bytes();break;case 7:u.dataHash=n.bytes();break;case 8:u.validatorsHash=n.bytes();break;case 9:u.nextValidatorsHash=n.bytes();break;case 10:u.consensusHash=n.bytes();break;case 11:u.appHash=n.bytes();break;case 12:u.lastResultsHash=n.bytes();break;case 13:u.evidenceHash=n.bytes();break;case 14:u.proposerAddress=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{version:isSet$1z(e.version)?Consensus$1.fromJSON(e.version):void 0,chainId:isSet$1z(e.chainId)?String(e.chainId):"",height:isSet$1z(e.height)?Number(e.height):0,time:isSet$1z(e.time)?fromJsonTimestamp$a(e.time):void 0,lastBlockId:isSet$1z(e.lastBlockId)?BlockID$1.fromJSON(e.lastBlockId):void 0,lastCommitHash:isSet$1z(e.lastCommitHash)?bytesFromBase64$p(e.lastCommitHash):new Uint8Array,dataHash:isSet$1z(e.dataHash)?bytesFromBase64$p(e.dataHash):new Uint8Array,validatorsHash:isSet$1z(e.validatorsHash)?bytesFromBase64$p(e.validatorsHash):new Uint8Array,nextValidatorsHash:isSet$1z(e.nextValidatorsHash)?bytesFromBase64$p(e.nextValidatorsHash):new Uint8Array,consensusHash:isSet$1z(e.consensusHash)?bytesFromBase64$p(e.consensusHash):new Uint8Array,appHash:isSet$1z(e.appHash)?bytesFromBase64$p(e.appHash):new Uint8Array,lastResultsHash:isSet$1z(e.lastResultsHash)?bytesFromBase64$p(e.lastResultsHash):new Uint8Array,evidenceHash:isSet$1z(e.evidenceHash)?bytesFromBase64$p(e.evidenceHash):new Uint8Array,proposerAddress:isSet$1z(e.proposerAddress)?String(e.proposerAddress):""}},toJSON(e){const t={};return e.version!==void 0&&(t.version=e.version?Consensus$1.toJSON(e.version):void 0),e.chainId!==void 0&&(t.chainId=e.chainId),e.height!==void 0&&(t.height=Math.round(e.height)),e.time!==void 0&&(t.time=e.time.toISOString()),e.lastBlockId!==void 0&&(t.lastBlockId=e.lastBlockId?BlockID$1.toJSON(e.lastBlockId):void 0),e.lastCommitHash!==void 0&&(t.lastCommitHash=base64FromBytes$p(e.lastCommitHash!==void 0?e.lastCommitHash:new Uint8Array)),e.dataHash!==void 0&&(t.dataHash=base64FromBytes$p(e.dataHash!==void 0?e.dataHash:new Uint8Array)),e.validatorsHash!==void 0&&(t.validatorsHash=base64FromBytes$p(e.validatorsHash!==void 0?e.validatorsHash:new Uint8Array)),e.nextValidatorsHash!==void 0&&(t.nextValidatorsHash=base64FromBytes$p(e.nextValidatorsHash!==void 0?e.nextValidatorsHash:new Uint8Array)),e.consensusHash!==void 0&&(t.consensusHash=base64FromBytes$p(e.consensusHash!==void 0?e.consensusHash:new Uint8Array)),e.appHash!==void 0&&(t.appHash=base64FromBytes$p(e.appHash!==void 0?e.appHash:new Uint8Array)),e.lastResultsHash!==void 0&&(t.lastResultsHash=base64FromBytes$p(e.lastResultsHash!==void 0?e.lastResultsHash:new Uint8Array)),e.evidenceHash!==void 0&&(t.evidenceHash=base64FromBytes$p(e.evidenceHash!==void 0?e.evidenceHash:new Uint8Array)),e.proposerAddress!==void 0&&(t.proposerAddress=e.proposerAddress),t},fromPartial(e){const t=createBaseHeader$1();return t.version=e.version!==void 0&&e.version!==null?Consensus$1.fromPartial(e.version):void 0,t.chainId=e.chainId??"",t.height=e.height??0,t.time=e.time??void 0,t.lastBlockId=e.lastBlockId!==void 0&&e.lastBlockId!==null?BlockID$1.fromPartial(e.lastBlockId):void 0,t.lastCommitHash=e.lastCommitHash??new Uint8Array,t.dataHash=e.dataHash??new Uint8Array,t.validatorsHash=e.validatorsHash??new Uint8Array,t.nextValidatorsHash=e.nextValidatorsHash??new Uint8Array,t.consensusHash=e.consensusHash??new Uint8Array,t.appHash=e.appHash??new Uint8Array,t.lastResultsHash=e.lastResultsHash??new Uint8Array,t.evidenceHash=e.evidenceHash??new Uint8Array,t.proposerAddress=e.proposerAddress??"",t}};var globalThis$1i=(()=>{if(typeof globalThis$1i<"u")return globalThis$1i;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$p(e){if(globalThis$1i.Buffer)return Uint8Array.from(globalThis$1i.Buffer.from(e,"base64"));{const t=globalThis$1i.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$p(e){if(globalThis$1i.Buffer)return globalThis$1i.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$1i.btoa(t.join(""))}}function toTimestamp$a(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$a(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$a(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$a(Timestamp$9.fromJSON(e))}function longToNumber$S(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1i.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1z(e){return e!=null}function createBaseValidator$1(){return{address:"",pubKey:void 0,votingPower:0,proposerPriority:0}}const Validator$1={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.pubKey!==void 0&&Any$b.encode(e.pubKey,t.uint32(18).fork()).ldelim(),e.votingPower!==0&&t.uint32(24).int64(e.votingPower),e.proposerPriority!==0&&t.uint32(32).int64(e.proposerPriority),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidator$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.pubKey=Any$b.decode(n,n.uint32());break;case 3:u.votingPower=longToNumber$R(n.int64());break;case 4:u.proposerPriority=longToNumber$R(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$1y(e.address)?String(e.address):"",pubKey:isSet$1y(e.pubKey)?Any$b.fromJSON(e.pubKey):void 0,votingPower:isSet$1y(e.votingPower)?Number(e.votingPower):0,proposerPriority:isSet$1y(e.proposerPriority)?Number(e.proposerPriority):0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.pubKey!==void 0&&(t.pubKey=e.pubKey?Any$b.toJSON(e.pubKey):void 0),e.votingPower!==void 0&&(t.votingPower=Math.round(e.votingPower)),e.proposerPriority!==void 0&&(t.proposerPriority=Math.round(e.proposerPriority)),t},fromPartial(e){const t=createBaseValidator$1();return t.address=e.address??"",t.pubKey=e.pubKey!==void 0&&e.pubKey!==null?Any$b.fromPartial(e.pubKey):void 0,t.votingPower=e.votingPower??0,t.proposerPriority=e.proposerPriority??0,t}};function createBaseVersionInfo(){return{name:"",appName:"",version:"",gitCommit:"",buildTags:"",goVersion:"",buildDeps:[],cosmosSdkVersion:""}}const VersionInfo={encode(e,t=_m0.Writer.create()){e.name!==""&&t.uint32(10).string(e.name),e.appName!==""&&t.uint32(18).string(e.appName),e.version!==""&&t.uint32(26).string(e.version),e.gitCommit!==""&&t.uint32(34).string(e.gitCommit),e.buildTags!==""&&t.uint32(42).string(e.buildTags),e.goVersion!==""&&t.uint32(50).string(e.goVersion);for(const n of e.buildDeps)Module$p.encode(n,t.uint32(58).fork()).ldelim();return e.cosmosSdkVersion!==""&&t.uint32(66).string(e.cosmosSdkVersion),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseVersionInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.name=n.string();break;case 2:u.appName=n.string();break;case 3:u.version=n.string();break;case 4:u.gitCommit=n.string();break;case 5:u.buildTags=n.string();break;case 6:u.goVersion=n.string();break;case 7:u.buildDeps.push(Module$p.decode(n,n.uint32()));break;case 8:u.cosmosSdkVersion=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{name:isSet$1y(e.name)?String(e.name):"",appName:isSet$1y(e.appName)?String(e.appName):"",version:isSet$1y(e.version)?String(e.version):"",gitCommit:isSet$1y(e.gitCommit)?String(e.gitCommit):"",buildTags:isSet$1y(e.buildTags)?String(e.buildTags):"",goVersion:isSet$1y(e.goVersion)?String(e.goVersion):"",buildDeps:Array.isArray(e==null?void 0:e.buildDeps)?e.buildDeps.map(t=>Module$p.fromJSON(t)):[],cosmosSdkVersion:isSet$1y(e.cosmosSdkVersion)?String(e.cosmosSdkVersion):""}},toJSON(e){const t={};return e.name!==void 0&&(t.name=e.name),e.appName!==void 0&&(t.appName=e.appName),e.version!==void 0&&(t.version=e.version),e.gitCommit!==void 0&&(t.gitCommit=e.gitCommit),e.buildTags!==void 0&&(t.buildTags=e.buildTags),e.goVersion!==void 0&&(t.goVersion=e.goVersion),e.buildDeps?t.buildDeps=e.buildDeps.map(n=>n?Module$p.toJSON(n):void 0):t.buildDeps=[],e.cosmosSdkVersion!==void 0&&(t.cosmosSdkVersion=e.cosmosSdkVersion),t},fromPartial(e){var n;const t=createBaseVersionInfo();return t.name=e.name??"",t.appName=e.appName??"",t.version=e.version??"",t.gitCommit=e.gitCommit??"",t.buildTags=e.buildTags??"",t.goVersion=e.goVersion??"",t.buildDeps=((n=e.buildDeps)==null?void 0:n.map(p=>Module$p.fromPartial(p)))||[],t.cosmosSdkVersion=e.cosmosSdkVersion??"",t}};function createBaseModule(){return{path:"",version:"",sum:""}}const Module$p={encode(e,t=_m0.Writer.create()){return e.path!==""&&t.uint32(10).string(e.path),e.version!==""&&t.uint32(18).string(e.version),e.sum!==""&&t.uint32(26).string(e.sum),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseModule();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.path=n.string();break;case 2:u.version=n.string();break;case 3:u.sum=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{path:isSet$1y(e.path)?String(e.path):"",version:isSet$1y(e.version)?String(e.version):"",sum:isSet$1y(e.sum)?String(e.sum):""}},toJSON(e){const t={};return e.path!==void 0&&(t.path=e.path),e.version!==void 0&&(t.version=e.version),e.sum!==void 0&&(t.sum=e.sum),t},fromPartial(e){const t=createBaseModule();return t.path=e.path??"",t.version=e.version??"",t.sum=e.sum??"",t}};function createBaseProofOp(){return{type:"",key:new Uint8Array,data:new Uint8Array}}const ProofOp={encode(e,t=_m0.Writer.create()){return e.type!==""&&t.uint32(10).string(e.type),e.key.length!==0&&t.uint32(18).bytes(e.key),e.data.length!==0&&t.uint32(26).bytes(e.data),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseProofOp();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.type=n.string();break;case 2:u.key=n.bytes();break;case 3:u.data=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{type:isSet$1y(e.type)?String(e.type):"",key:isSet$1y(e.key)?bytesFromBase64$o(e.key):new Uint8Array,data:isSet$1y(e.data)?bytesFromBase64$o(e.data):new Uint8Array}},toJSON(e){const t={};return e.type!==void 0&&(t.type=e.type),e.key!==void 0&&(t.key=base64FromBytes$o(e.key!==void 0?e.key:new Uint8Array)),e.data!==void 0&&(t.data=base64FromBytes$o(e.data!==void 0?e.data:new Uint8Array)),t},fromPartial(e){const t=createBaseProofOp();return t.type=e.type??"",t.key=e.key??new Uint8Array,t.data=e.data??new Uint8Array,t}};function createBaseProofOps(){return{ops:[]}}const ProofOps={encode(e,t=_m0.Writer.create()){for(const n of e.ops)ProofOp.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseProofOps();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.ops.push(ProofOp.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{ops:Array.isArray(e==null?void 0:e.ops)?e.ops.map(t=>ProofOp.fromJSON(t)):[]}},toJSON(e){const t={};return e.ops?t.ops=e.ops.map(n=>n?ProofOp.toJSON(n):void 0):t.ops=[],t},fromPartial(e){var n;const t=createBaseProofOps();return t.ops=((n=e.ops)==null?void 0:n.map(p=>ProofOp.fromPartial(p)))||[],t}};var globalThis$1h=(()=>{if(typeof globalThis$1h<"u")return globalThis$1h;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$o(e){if(globalThis$1h.Buffer)return Uint8Array.from(globalThis$1h.Buffer.from(e,"base64"));{const t=globalThis$1h.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$o(e){if(globalThis$1h.Buffer)return globalThis$1h.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$1h.btoa(t.join(""))}}function longToNumber$R(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1h.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1y(e){return e!=null}new build$b.Registry(msgTypes$o);function getStructure$m(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$o=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$o=({addr:e}={addr:"http://localhost:1317"})=>new Api$o({baseURL:e});let SDKModule$o=class{constructor(t){this.registry=[],this.query=queryClient$o({addr:t.env.apiURL}),this.updateTX(t),this.structure={Validator:getStructure$m(Validator$1.fromPartial({})),VersionInfo:getStructure$m(VersionInfo.fromPartial({})),Module:getStructure$m(Module$p.fromPartial({})),ProofOp:getStructure$m(ProofOp.fromPartial({})),ProofOps:getStructure$m(ProofOps.fromPartial({})),Block:getStructure$m(Block.fromPartial({})),Header:getStructure$m(Header$1.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$o({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$o=e=>({module:{CosmosBaseTendermintV1Beta1:new SDKModule$o(e)},registry:msgTypes$o}),module$1=Object.freeze(Object.defineProperty({__proto__:null,default:Module$o,queryClient:queryClient$o,txClient:txClient$o},Symbol.toStringTag,{value:"Module"}));function createBaseDuration$6(){return{seconds:0,nanos:0}}const Duration$6={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDuration$6();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$Q(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$1x(e.seconds)?Number(e.seconds):0,nanos:isSet$1x(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseDuration$6();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$1g=(()=>{if(typeof globalThis$1g<"u")return globalThis$1g;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$Q(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1g.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1x(e){return e!=null}function createBaseBlockParams(){return{maxBytes:0,maxGas:0}}const BlockParams={encode(e,t=_m0.Writer.create()){return e.maxBytes!==0&&t.uint32(8).int64(e.maxBytes),e.maxGas!==0&&t.uint32(16).int64(e.maxGas),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseBlockParams();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.maxBytes=longToNumber$P(n.int64());break;case 2:u.maxGas=longToNumber$P(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{maxBytes:isSet$1w(e.maxBytes)?Number(e.maxBytes):0,maxGas:isSet$1w(e.maxGas)?Number(e.maxGas):0}},toJSON(e){const t={};return e.maxBytes!==void 0&&(t.maxBytes=Math.round(e.maxBytes)),e.maxGas!==void 0&&(t.maxGas=Math.round(e.maxGas)),t},fromPartial(e){const t=createBaseBlockParams();return t.maxBytes=e.maxBytes??0,t.maxGas=e.maxGas??0,t}};function createBaseEvidenceParams(){return{maxAgeNumBlocks:0,maxAgeDuration:void 0,maxBytes:0}}const EvidenceParams={encode(e,t=_m0.Writer.create()){return e.maxAgeNumBlocks!==0&&t.uint32(8).int64(e.maxAgeNumBlocks),e.maxAgeDuration!==void 0&&Duration$6.encode(e.maxAgeDuration,t.uint32(18).fork()).ldelim(),e.maxBytes!==0&&t.uint32(24).int64(e.maxBytes),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEvidenceParams();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.maxAgeNumBlocks=longToNumber$P(n.int64());break;case 2:u.maxAgeDuration=Duration$6.decode(n,n.uint32());break;case 3:u.maxBytes=longToNumber$P(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{maxAgeNumBlocks:isSet$1w(e.maxAgeNumBlocks)?Number(e.maxAgeNumBlocks):0,maxAgeDuration:isSet$1w(e.maxAgeDuration)?Duration$6.fromJSON(e.maxAgeDuration):void 0,maxBytes:isSet$1w(e.maxBytes)?Number(e.maxBytes):0}},toJSON(e){const t={};return e.maxAgeNumBlocks!==void 0&&(t.maxAgeNumBlocks=Math.round(e.maxAgeNumBlocks)),e.maxAgeDuration!==void 0&&(t.maxAgeDuration=e.maxAgeDuration?Duration$6.toJSON(e.maxAgeDuration):void 0),e.maxBytes!==void 0&&(t.maxBytes=Math.round(e.maxBytes)),t},fromPartial(e){const t=createBaseEvidenceParams();return t.maxAgeNumBlocks=e.maxAgeNumBlocks??0,t.maxAgeDuration=e.maxAgeDuration!==void 0&&e.maxAgeDuration!==null?Duration$6.fromPartial(e.maxAgeDuration):void 0,t.maxBytes=e.maxBytes??0,t}};function createBaseValidatorParams(){return{pubKeyTypes:[]}}const ValidatorParams={encode(e,t=_m0.Writer.create()){for(const n of e.pubKeyTypes)t.uint32(10).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorParams();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.pubKeyTypes.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{pubKeyTypes:Array.isArray(e==null?void 0:e.pubKeyTypes)?e.pubKeyTypes.map(t=>String(t)):[]}},toJSON(e){const t={};return e.pubKeyTypes?t.pubKeyTypes=e.pubKeyTypes.map(n=>n):t.pubKeyTypes=[],t},fromPartial(e){var n;const t=createBaseValidatorParams();return t.pubKeyTypes=((n=e.pubKeyTypes)==null?void 0:n.map(p=>p))||[],t}};var globalThis$1f=(()=>{if(typeof globalThis$1f<"u")return globalThis$1f;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$P(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1f.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1w(e){return e!=null}function createBaseMsgUpdateParams$3(){return{authority:"",block:void 0,evidence:void 0,validator:void 0}}const MsgUpdateParams$3={encode(e,t=_m0.Writer.create()){return e.authority!==""&&t.uint32(10).string(e.authority),e.block!==void 0&&BlockParams.encode(e.block,t.uint32(18).fork()).ldelim(),e.evidence!==void 0&&EvidenceParams.encode(e.evidence,t.uint32(26).fork()).ldelim(),e.validator!==void 0&&ValidatorParams.encode(e.validator,t.uint32(34).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateParams$3();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.authority=n.string();break;case 2:u.block=BlockParams.decode(n,n.uint32());break;case 3:u.evidence=EvidenceParams.decode(n,n.uint32());break;case 4:u.validator=ValidatorParams.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{authority:isSet$1v(e.authority)?String(e.authority):"",block:isSet$1v(e.block)?BlockParams.fromJSON(e.block):void 0,evidence:isSet$1v(e.evidence)?EvidenceParams.fromJSON(e.evidence):void 0,validator:isSet$1v(e.validator)?ValidatorParams.fromJSON(e.validator):void 0}},toJSON(e){const t={};return e.authority!==void 0&&(t.authority=e.authority),e.block!==void 0&&(t.block=e.block?BlockParams.toJSON(e.block):void 0),e.evidence!==void 0&&(t.evidence=e.evidence?EvidenceParams.toJSON(e.evidence):void 0),e.validator!==void 0&&(t.validator=e.validator?ValidatorParams.toJSON(e.validator):void 0),t},fromPartial(e){const t=createBaseMsgUpdateParams$3();return t.authority=e.authority??"",t.block=e.block!==void 0&&e.block!==null?BlockParams.fromPartial(e.block):void 0,t.evidence=e.evidence!==void 0&&e.evidence!==null?EvidenceParams.fromPartial(e.evidence):void 0,t.validator=e.validator!==void 0&&e.validator!==null?ValidatorParams.fromPartial(e.validator):void 0,t}};function isSet$1v(e){return e!=null}const msgTypes$n=[["/cosmos.consensus.v1.MsgUpdateParams",MsgUpdateParams$3]];let HttpClient$n=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$n=class extends HttpClient$n{constructor(){super(...arguments),this.queryParams=(t={})=>this.request({path:"/cosmos/consensus/v1/params",method:"GET",format:"json",...t})}};const registry$e=new build$b.Registry(msgTypes$n),defaultFee$d={amount:[],gas:"200000"},txClient$n=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgUpdateParams({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateParams: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$e,prefix:t});let N=this.msgUpdateParams({value:MsgUpdateParams$3.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$d,g)}catch(y){throw new Error("TxClient:sendMsgUpdateParams: Could not broadcast Tx: "+y.message)}},msgUpdateParams({value:p}){try{return{typeUrl:"/cosmos.consensus.v1.MsgUpdateParams",value:MsgUpdateParams$3.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateParams: Could not create message: "+u.message)}}}),queryClient$n=({addr:e}={addr:"http://localhost:1317"})=>new Api$n({baseURL:e});let SDKModule$n=class{constructor(t){this.registry=[],this.query=queryClient$n({addr:t.env.apiURL}),this.updateTX(t),this.structure={},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$n({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$n=e=>({module:{CosmosConsensusV1:new SDKModule$n(e)},registry:msgTypes$n});function createBaseCoin$9(){return{denom:"",amount:""}}const Coin$9={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin$9();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$1u(e.denom)?String(e.denom):"",amount:isSet$1u(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin$9();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$1u(e){return e!=null}function createBaseMsgVerifyInvariant(){return{sender:"",invariantModuleName:"",invariantRoute:""}}const MsgVerifyInvariant={encode(e,t=_m0.Writer.create()){return e.sender!==""&&t.uint32(10).string(e.sender),e.invariantModuleName!==""&&t.uint32(18).string(e.invariantModuleName),e.invariantRoute!==""&&t.uint32(26).string(e.invariantRoute),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgVerifyInvariant();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.sender=n.string();break;case 2:u.invariantModuleName=n.string();break;case 3:u.invariantRoute=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{sender:isSet$1t(e.sender)?String(e.sender):"",invariantModuleName:isSet$1t(e.invariantModuleName)?String(e.invariantModuleName):"",invariantRoute:isSet$1t(e.invariantRoute)?String(e.invariantRoute):""}},toJSON(e){const t={};return e.sender!==void 0&&(t.sender=e.sender),e.invariantModuleName!==void 0&&(t.invariantModuleName=e.invariantModuleName),e.invariantRoute!==void 0&&(t.invariantRoute=e.invariantRoute),t},fromPartial(e){const t=createBaseMsgVerifyInvariant();return t.sender=e.sender??"",t.invariantModuleName=e.invariantModuleName??"",t.invariantRoute=e.invariantRoute??"",t}};function createBaseMsgUpdateParams$2(){return{authority:"",constantFee:void 0}}const MsgUpdateParams$2={encode(e,t=_m0.Writer.create()){return e.authority!==""&&t.uint32(10).string(e.authority),e.constantFee!==void 0&&Coin$9.encode(e.constantFee,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateParams$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.authority=n.string();break;case 2:u.constantFee=Coin$9.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{authority:isSet$1t(e.authority)?String(e.authority):"",constantFee:isSet$1t(e.constantFee)?Coin$9.fromJSON(e.constantFee):void 0}},toJSON(e){const t={};return e.authority!==void 0&&(t.authority=e.authority),e.constantFee!==void 0&&(t.constantFee=e.constantFee?Coin$9.toJSON(e.constantFee):void 0),t},fromPartial(e){const t=createBaseMsgUpdateParams$2();return t.authority=e.authority??"",t.constantFee=e.constantFee!==void 0&&e.constantFee!==null?Coin$9.fromPartial(e.constantFee):void 0,t}};function isSet$1t(e){return e!=null}const msgTypes$m=[["/cosmos.crisis.v1beta1.MsgVerifyInvariant",MsgVerifyInvariant],["/cosmos.crisis.v1beta1.MsgUpdateParams",MsgUpdateParams$2]];let HttpClient$m=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$m=class extends HttpClient$m{};const registry$d=new build$b.Registry(msgTypes$m),defaultFee$c={amount:[],gas:"200000"},txClient$m=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgVerifyInvariant({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgVerifyInvariant: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$d,prefix:t});let N=this.msgVerifyInvariant({value:MsgVerifyInvariant.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$c,g)}catch(y){throw new Error("TxClient:sendMsgVerifyInvariant: Could not broadcast Tx: "+y.message)}},async sendMsgUpdateParams({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateParams: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$d,prefix:t});let N=this.msgUpdateParams({value:MsgUpdateParams$2.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$c,g)}catch(y){throw new Error("TxClient:sendMsgUpdateParams: Could not broadcast Tx: "+y.message)}},msgVerifyInvariant({value:p}){try{return{typeUrl:"/cosmos.crisis.v1beta1.MsgVerifyInvariant",value:MsgVerifyInvariant.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgVerifyInvariant: Could not create message: "+u.message)}},msgUpdateParams({value:p}){try{return{typeUrl:"/cosmos.crisis.v1beta1.MsgUpdateParams",value:MsgUpdateParams$2.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateParams: Could not create message: "+u.message)}}}),queryClient$m=({addr:e}={addr:"http://localhost:1317"})=>new Api$m({baseURL:e});let SDKModule$m=class{constructor(t){this.registry=[],this.query=queryClient$m({addr:t.env.apiURL}),this.updateTX(t),this.structure={},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$m({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$m=e=>({module:{CosmosCrisisV1Beta1:new SDKModule$m(e)},registry:msgTypes$m});function createBaseCoin$8(){return{denom:"",amount:""}}const Coin$8={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin$8();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$1s(e.denom)?String(e.denom):"",amount:isSet$1s(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin$8();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function createBaseDecCoin(){return{denom:"",amount:""}}const DecCoin={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDecCoin();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$1s(e.denom)?String(e.denom):"",amount:isSet$1s(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseDecCoin();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$1s(e){return e!=null}function createBaseParams$b(){return{communityTax:"",baseProposerReward:"",bonusProposerReward:"",withdrawAddrEnabled:!1}}const Params$b={encode(e,t=_m0.Writer.create()){return e.communityTax!==""&&t.uint32(10).string(e.communityTax),e.baseProposerReward!==""&&t.uint32(18).string(e.baseProposerReward),e.bonusProposerReward!==""&&t.uint32(26).string(e.bonusProposerReward),e.withdrawAddrEnabled===!0&&t.uint32(32).bool(e.withdrawAddrEnabled),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$b();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.communityTax=n.string();break;case 2:u.baseProposerReward=n.string();break;case 3:u.bonusProposerReward=n.string();break;case 4:u.withdrawAddrEnabled=n.bool();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{communityTax:isSet$1r(e.communityTax)?String(e.communityTax):"",baseProposerReward:isSet$1r(e.baseProposerReward)?String(e.baseProposerReward):"",bonusProposerReward:isSet$1r(e.bonusProposerReward)?String(e.bonusProposerReward):"",withdrawAddrEnabled:isSet$1r(e.withdrawAddrEnabled)?!!e.withdrawAddrEnabled:!1}},toJSON(e){const t={};return e.communityTax!==void 0&&(t.communityTax=e.communityTax),e.baseProposerReward!==void 0&&(t.baseProposerReward=e.baseProposerReward),e.bonusProposerReward!==void 0&&(t.bonusProposerReward=e.bonusProposerReward),e.withdrawAddrEnabled!==void 0&&(t.withdrawAddrEnabled=e.withdrawAddrEnabled),t},fromPartial(e){const t=createBaseParams$b();return t.communityTax=e.communityTax??"",t.baseProposerReward=e.baseProposerReward??"",t.bonusProposerReward=e.bonusProposerReward??"",t.withdrawAddrEnabled=e.withdrawAddrEnabled??!1,t}};function createBaseValidatorHistoricalRewards(){return{cumulativeRewardRatio:[],referenceCount:0}}const ValidatorHistoricalRewards={encode(e,t=_m0.Writer.create()){for(const n of e.cumulativeRewardRatio)DecCoin.encode(n,t.uint32(10).fork()).ldelim();return e.referenceCount!==0&&t.uint32(16).uint32(e.referenceCount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorHistoricalRewards();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.cumulativeRewardRatio.push(DecCoin.decode(n,n.uint32()));break;case 2:u.referenceCount=n.uint32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{cumulativeRewardRatio:Array.isArray(e==null?void 0:e.cumulativeRewardRatio)?e.cumulativeRewardRatio.map(t=>DecCoin.fromJSON(t)):[],referenceCount:isSet$1r(e.referenceCount)?Number(e.referenceCount):0}},toJSON(e){const t={};return e.cumulativeRewardRatio?t.cumulativeRewardRatio=e.cumulativeRewardRatio.map(n=>n?DecCoin.toJSON(n):void 0):t.cumulativeRewardRatio=[],e.referenceCount!==void 0&&(t.referenceCount=Math.round(e.referenceCount)),t},fromPartial(e){var n;const t=createBaseValidatorHistoricalRewards();return t.cumulativeRewardRatio=((n=e.cumulativeRewardRatio)==null?void 0:n.map(p=>DecCoin.fromPartial(p)))||[],t.referenceCount=e.referenceCount??0,t}};function createBaseValidatorCurrentRewards(){return{rewards:[],period:0}}const ValidatorCurrentRewards={encode(e,t=_m0.Writer.create()){for(const n of e.rewards)DecCoin.encode(n,t.uint32(10).fork()).ldelim();return e.period!==0&&t.uint32(16).uint64(e.period),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorCurrentRewards();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.rewards.push(DecCoin.decode(n,n.uint32()));break;case 2:u.period=longToNumber$O(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{rewards:Array.isArray(e==null?void 0:e.rewards)?e.rewards.map(t=>DecCoin.fromJSON(t)):[],period:isSet$1r(e.period)?Number(e.period):0}},toJSON(e){const t={};return e.rewards?t.rewards=e.rewards.map(n=>n?DecCoin.toJSON(n):void 0):t.rewards=[],e.period!==void 0&&(t.period=Math.round(e.period)),t},fromPartial(e){var n;const t=createBaseValidatorCurrentRewards();return t.rewards=((n=e.rewards)==null?void 0:n.map(p=>DecCoin.fromPartial(p)))||[],t.period=e.period??0,t}};function createBaseValidatorAccumulatedCommission(){return{commission:[]}}const ValidatorAccumulatedCommission={encode(e,t=_m0.Writer.create()){for(const n of e.commission)DecCoin.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorAccumulatedCommission();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.commission.push(DecCoin.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{commission:Array.isArray(e==null?void 0:e.commission)?e.commission.map(t=>DecCoin.fromJSON(t)):[]}},toJSON(e){const t={};return e.commission?t.commission=e.commission.map(n=>n?DecCoin.toJSON(n):void 0):t.commission=[],t},fromPartial(e){var n;const t=createBaseValidatorAccumulatedCommission();return t.commission=((n=e.commission)==null?void 0:n.map(p=>DecCoin.fromPartial(p)))||[],t}};function createBaseValidatorOutstandingRewards(){return{rewards:[]}}const ValidatorOutstandingRewards={encode(e,t=_m0.Writer.create()){for(const n of e.rewards)DecCoin.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorOutstandingRewards();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.rewards.push(DecCoin.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{rewards:Array.isArray(e==null?void 0:e.rewards)?e.rewards.map(t=>DecCoin.fromJSON(t)):[]}},toJSON(e){const t={};return e.rewards?t.rewards=e.rewards.map(n=>n?DecCoin.toJSON(n):void 0):t.rewards=[],t},fromPartial(e){var n;const t=createBaseValidatorOutstandingRewards();return t.rewards=((n=e.rewards)==null?void 0:n.map(p=>DecCoin.fromPartial(p)))||[],t}};function createBaseValidatorSlashEvent(){return{validatorPeriod:0,fraction:""}}const ValidatorSlashEvent={encode(e,t=_m0.Writer.create()){return e.validatorPeriod!==0&&t.uint32(8).uint64(e.validatorPeriod),e.fraction!==""&&t.uint32(18).string(e.fraction),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorSlashEvent();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validatorPeriod=longToNumber$O(n.uint64());break;case 2:u.fraction=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validatorPeriod:isSet$1r(e.validatorPeriod)?Number(e.validatorPeriod):0,fraction:isSet$1r(e.fraction)?String(e.fraction):""}},toJSON(e){const t={};return e.validatorPeriod!==void 0&&(t.validatorPeriod=Math.round(e.validatorPeriod)),e.fraction!==void 0&&(t.fraction=e.fraction),t},fromPartial(e){const t=createBaseValidatorSlashEvent();return t.validatorPeriod=e.validatorPeriod??0,t.fraction=e.fraction??"",t}};function createBaseValidatorSlashEvents(){return{validatorSlashEvents:[]}}const ValidatorSlashEvents={encode(e,t=_m0.Writer.create()){for(const n of e.validatorSlashEvents)ValidatorSlashEvent.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorSlashEvents();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validatorSlashEvents.push(ValidatorSlashEvent.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validatorSlashEvents:Array.isArray(e==null?void 0:e.validatorSlashEvents)?e.validatorSlashEvents.map(t=>ValidatorSlashEvent.fromJSON(t)):[]}},toJSON(e){const t={};return e.validatorSlashEvents?t.validatorSlashEvents=e.validatorSlashEvents.map(n=>n?ValidatorSlashEvent.toJSON(n):void 0):t.validatorSlashEvents=[],t},fromPartial(e){var n;const t=createBaseValidatorSlashEvents();return t.validatorSlashEvents=((n=e.validatorSlashEvents)==null?void 0:n.map(p=>ValidatorSlashEvent.fromPartial(p)))||[],t}};function createBaseFeePool(){return{communityPool:[]}}const FeePool={encode(e,t=_m0.Writer.create()){for(const n of e.communityPool)DecCoin.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseFeePool();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.communityPool.push(DecCoin.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{communityPool:Array.isArray(e==null?void 0:e.communityPool)?e.communityPool.map(t=>DecCoin.fromJSON(t)):[]}},toJSON(e){const t={};return e.communityPool?t.communityPool=e.communityPool.map(n=>n?DecCoin.toJSON(n):void 0):t.communityPool=[],t},fromPartial(e){var n;const t=createBaseFeePool();return t.communityPool=((n=e.communityPool)==null?void 0:n.map(p=>DecCoin.fromPartial(p)))||[],t}};function createBaseCommunityPoolSpendProposal(){return{title:"",description:"",recipient:"",amount:[]}}const CommunityPoolSpendProposal={encode(e,t=_m0.Writer.create()){e.title!==""&&t.uint32(10).string(e.title),e.description!==""&&t.uint32(18).string(e.description),e.recipient!==""&&t.uint32(26).string(e.recipient);for(const n of e.amount)Coin$8.encode(n,t.uint32(34).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCommunityPoolSpendProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.title=n.string();break;case 2:u.description=n.string();break;case 3:u.recipient=n.string();break;case 4:u.amount.push(Coin$8.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{title:isSet$1r(e.title)?String(e.title):"",description:isSet$1r(e.description)?String(e.description):"",recipient:isSet$1r(e.recipient)?String(e.recipient):"",amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$8.fromJSON(t)):[]}},toJSON(e){const t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),e.recipient!==void 0&&(t.recipient=e.recipient),e.amount?t.amount=e.amount.map(n=>n?Coin$8.toJSON(n):void 0):t.amount=[],t},fromPartial(e){var n;const t=createBaseCommunityPoolSpendProposal();return t.title=e.title??"",t.description=e.description??"",t.recipient=e.recipient??"",t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$8.fromPartial(p)))||[],t}};function createBaseDelegatorStartingInfo(){return{previousPeriod:0,stake:"",height:0}}const DelegatorStartingInfo={encode(e,t=_m0.Writer.create()){return e.previousPeriod!==0&&t.uint32(8).uint64(e.previousPeriod),e.stake!==""&&t.uint32(18).string(e.stake),e.height!==0&&t.uint32(24).uint64(e.height),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDelegatorStartingInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.previousPeriod=longToNumber$O(n.uint64());break;case 2:u.stake=n.string();break;case 3:u.height=longToNumber$O(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{previousPeriod:isSet$1r(e.previousPeriod)?Number(e.previousPeriod):0,stake:isSet$1r(e.stake)?String(e.stake):"",height:isSet$1r(e.height)?Number(e.height):0}},toJSON(e){const t={};return e.previousPeriod!==void 0&&(t.previousPeriod=Math.round(e.previousPeriod)),e.stake!==void 0&&(t.stake=e.stake),e.height!==void 0&&(t.height=Math.round(e.height)),t},fromPartial(e){const t=createBaseDelegatorStartingInfo();return t.previousPeriod=e.previousPeriod??0,t.stake=e.stake??"",t.height=e.height??0,t}};function createBaseDelegationDelegatorReward(){return{validatorAddress:"",reward:[]}}const DelegationDelegatorReward={encode(e,t=_m0.Writer.create()){e.validatorAddress!==""&&t.uint32(10).string(e.validatorAddress);for(const n of e.reward)DecCoin.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDelegationDelegatorReward();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validatorAddress=n.string();break;case 2:u.reward.push(DecCoin.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validatorAddress:isSet$1r(e.validatorAddress)?String(e.validatorAddress):"",reward:Array.isArray(e==null?void 0:e.reward)?e.reward.map(t=>DecCoin.fromJSON(t)):[]}},toJSON(e){const t={};return e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.reward?t.reward=e.reward.map(n=>n?DecCoin.toJSON(n):void 0):t.reward=[],t},fromPartial(e){var n;const t=createBaseDelegationDelegatorReward();return t.validatorAddress=e.validatorAddress??"",t.reward=((n=e.reward)==null?void 0:n.map(p=>DecCoin.fromPartial(p)))||[],t}};function createBaseCommunityPoolSpendProposalWithDeposit(){return{title:"",description:"",recipient:"",amount:"",deposit:""}}const CommunityPoolSpendProposalWithDeposit={encode(e,t=_m0.Writer.create()){return e.title!==""&&t.uint32(10).string(e.title),e.description!==""&&t.uint32(18).string(e.description),e.recipient!==""&&t.uint32(26).string(e.recipient),e.amount!==""&&t.uint32(34).string(e.amount),e.deposit!==""&&t.uint32(42).string(e.deposit),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCommunityPoolSpendProposalWithDeposit();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.title=n.string();break;case 2:u.description=n.string();break;case 3:u.recipient=n.string();break;case 4:u.amount=n.string();break;case 5:u.deposit=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{title:isSet$1r(e.title)?String(e.title):"",description:isSet$1r(e.description)?String(e.description):"",recipient:isSet$1r(e.recipient)?String(e.recipient):"",amount:isSet$1r(e.amount)?String(e.amount):"",deposit:isSet$1r(e.deposit)?String(e.deposit):""}},toJSON(e){const t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),e.recipient!==void 0&&(t.recipient=e.recipient),e.amount!==void 0&&(t.amount=e.amount),e.deposit!==void 0&&(t.deposit=e.deposit),t},fromPartial(e){const t=createBaseCommunityPoolSpendProposalWithDeposit();return t.title=e.title??"",t.description=e.description??"",t.recipient=e.recipient??"",t.amount=e.amount??"",t.deposit=e.deposit??"",t}};var globalThis$1e=(()=>{if(typeof globalThis$1e<"u")return globalThis$1e;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$O(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1e.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1r(e){return e!=null}function createBaseMsgSetWithdrawAddress(){return{delegatorAddress:"",withdrawAddress:""}}const MsgSetWithdrawAddress={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.withdrawAddress!==""&&t.uint32(18).string(e.withdrawAddress),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgSetWithdrawAddress();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.withdrawAddress=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$1q(e.delegatorAddress)?String(e.delegatorAddress):"",withdrawAddress:isSet$1q(e.withdrawAddress)?String(e.withdrawAddress):""}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.withdrawAddress!==void 0&&(t.withdrawAddress=e.withdrawAddress),t},fromPartial(e){const t=createBaseMsgSetWithdrawAddress();return t.delegatorAddress=e.delegatorAddress??"",t.withdrawAddress=e.withdrawAddress??"",t}};function createBaseMsgWithdrawDelegatorReward(){return{delegatorAddress:"",validatorAddress:""}}const MsgWithdrawDelegatorReward={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==""&&t.uint32(18).string(e.validatorAddress),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgWithdrawDelegatorReward();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorAddress=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$1q(e.delegatorAddress)?String(e.delegatorAddress):"",validatorAddress:isSet$1q(e.validatorAddress)?String(e.validatorAddress):""}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){const t=createBaseMsgWithdrawDelegatorReward();return t.delegatorAddress=e.delegatorAddress??"",t.validatorAddress=e.validatorAddress??"",t}};function createBaseMsgWithdrawValidatorCommission(){return{validatorAddress:""}}const MsgWithdrawValidatorCommission={encode(e,t=_m0.Writer.create()){return e.validatorAddress!==""&&t.uint32(10).string(e.validatorAddress),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgWithdrawValidatorCommission();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validatorAddress=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validatorAddress:isSet$1q(e.validatorAddress)?String(e.validatorAddress):""}},toJSON(e){const t={};return e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){const t=createBaseMsgWithdrawValidatorCommission();return t.validatorAddress=e.validatorAddress??"",t}};function createBaseMsgFundCommunityPool(){return{amount:[],depositor:""}}const MsgFundCommunityPool={encode(e,t=_m0.Writer.create()){for(const n of e.amount)Coin$8.encode(n,t.uint32(10).fork()).ldelim();return e.depositor!==""&&t.uint32(18).string(e.depositor),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgFundCommunityPool();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.amount.push(Coin$8.decode(n,n.uint32()));break;case 2:u.depositor=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$8.fromJSON(t)):[],depositor:isSet$1q(e.depositor)?String(e.depositor):""}},toJSON(e){const t={};return e.amount?t.amount=e.amount.map(n=>n?Coin$8.toJSON(n):void 0):t.amount=[],e.depositor!==void 0&&(t.depositor=e.depositor),t},fromPartial(e){var n;const t=createBaseMsgFundCommunityPool();return t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$8.fromPartial(p)))||[],t.depositor=e.depositor??"",t}};function createBaseMsgUpdateParams$1(){return{authority:"",params:void 0}}const MsgUpdateParams$1={encode(e,t=_m0.Writer.create()){return e.authority!==""&&t.uint32(10).string(e.authority),e.params!==void 0&&Params$b.encode(e.params,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateParams$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.authority=n.string();break;case 2:u.params=Params$b.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{authority:isSet$1q(e.authority)?String(e.authority):"",params:isSet$1q(e.params)?Params$b.fromJSON(e.params):void 0}},toJSON(e){const t={};return e.authority!==void 0&&(t.authority=e.authority),e.params!==void 0&&(t.params=e.params?Params$b.toJSON(e.params):void 0),t},fromPartial(e){const t=createBaseMsgUpdateParams$1();return t.authority=e.authority??"",t.params=e.params!==void 0&&e.params!==null?Params$b.fromPartial(e.params):void 0,t}};function createBaseMsgCommunityPoolSpend(){return{authority:"",recipient:"",amount:[]}}const MsgCommunityPoolSpend={encode(e,t=_m0.Writer.create()){e.authority!==""&&t.uint32(10).string(e.authority),e.recipient!==""&&t.uint32(18).string(e.recipient);for(const n of e.amount)Coin$8.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgCommunityPoolSpend();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.authority=n.string();break;case 2:u.recipient=n.string();break;case 3:u.amount.push(Coin$8.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{authority:isSet$1q(e.authority)?String(e.authority):"",recipient:isSet$1q(e.recipient)?String(e.recipient):"",amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$8.fromJSON(t)):[]}},toJSON(e){const t={};return e.authority!==void 0&&(t.authority=e.authority),e.recipient!==void 0&&(t.recipient=e.recipient),e.amount?t.amount=e.amount.map(n=>n?Coin$8.toJSON(n):void 0):t.amount=[],t},fromPartial(e){var n;const t=createBaseMsgCommunityPoolSpend();return t.authority=e.authority??"",t.recipient=e.recipient??"",t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$8.fromPartial(p)))||[],t}};function isSet$1q(e){return e!=null}const msgTypes$l=[["/cosmos.distribution.v1beta1.MsgFundCommunityPool",MsgFundCommunityPool],["/cosmos.distribution.v1beta1.MsgCommunityPoolSpend",MsgCommunityPoolSpend],["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",MsgWithdrawDelegatorReward],["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission",MsgWithdrawValidatorCommission],["/cosmos.distribution.v1beta1.MsgUpdateParams",MsgUpdateParams$1],["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress",MsgSetWithdrawAddress]];let HttpClient$l=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$l=class extends HttpClient$l{constructor(){super(...arguments),this.queryCommunityPool=(t={})=>this.request({path:"/cosmos/distribution/v1beta1/community_pool",method:"GET",format:"json",...t}),this.queryDelegationTotalRewards=(t,n={})=>this.request({path:`/cosmos/distribution/v1beta1/delegators/${t}/rewards`,method:"GET",format:"json",...n}),this.queryDelegationRewards=(t,n,p={})=>this.request({path:`/cosmos/distribution/v1beta1/delegators/${t}/rewards/${n}`,method:"GET",format:"json",...p}),this.queryDelegatorValidators=(t,n={})=>this.request({path:`/cosmos/distribution/v1beta1/delegators/${t}/validators`,method:"GET",format:"json",...n}),this.queryDelegatorWithdrawAddress=(t,n={})=>this.request({path:`/cosmos/distribution/v1beta1/delegators/${t}/withdraw_address`,method:"GET",format:"json",...n}),this.queryParams=(t={})=>this.request({path:"/cosmos/distribution/v1beta1/params",method:"GET",format:"json",...t}),this.queryValidatorDistributionInfo=(t,n={})=>this.request({path:`/cosmos/distribution/v1beta1/validators/${t}`,method:"GET",format:"json",...n}),this.queryValidatorCommission=(t,n={})=>this.request({path:`/cosmos/distribution/v1beta1/validators/${t}/commission`,method:"GET",format:"json",...n}),this.queryValidatorOutstandingRewards=(t,n={})=>this.request({path:`/cosmos/distribution/v1beta1/validators/${t}/outstanding_rewards`,method:"GET",format:"json",...n}),this.queryValidatorSlashes=(t,n,p={})=>this.request({path:`/cosmos/distribution/v1beta1/validators/${t}/slashes`,method:"GET",query:n,format:"json",...p})}};function createBaseDelegatorWithdrawInfo(){return{delegatorAddress:"",withdrawAddress:""}}const DelegatorWithdrawInfo={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.withdrawAddress!==""&&t.uint32(18).string(e.withdrawAddress),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDelegatorWithdrawInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.withdrawAddress=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$1p(e.delegatorAddress)?String(e.delegatorAddress):"",withdrawAddress:isSet$1p(e.withdrawAddress)?String(e.withdrawAddress):""}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.withdrawAddress!==void 0&&(t.withdrawAddress=e.withdrawAddress),t},fromPartial(e){const t=createBaseDelegatorWithdrawInfo();return t.delegatorAddress=e.delegatorAddress??"",t.withdrawAddress=e.withdrawAddress??"",t}};function createBaseValidatorOutstandingRewardsRecord(){return{validatorAddress:"",outstandingRewards:[]}}const ValidatorOutstandingRewardsRecord={encode(e,t=_m0.Writer.create()){e.validatorAddress!==""&&t.uint32(10).string(e.validatorAddress);for(const n of e.outstandingRewards)DecCoin.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorOutstandingRewardsRecord();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validatorAddress=n.string();break;case 2:u.outstandingRewards.push(DecCoin.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validatorAddress:isSet$1p(e.validatorAddress)?String(e.validatorAddress):"",outstandingRewards:Array.isArray(e==null?void 0:e.outstandingRewards)?e.outstandingRewards.map(t=>DecCoin.fromJSON(t)):[]}},toJSON(e){const t={};return e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.outstandingRewards?t.outstandingRewards=e.outstandingRewards.map(n=>n?DecCoin.toJSON(n):void 0):t.outstandingRewards=[],t},fromPartial(e){var n;const t=createBaseValidatorOutstandingRewardsRecord();return t.validatorAddress=e.validatorAddress??"",t.outstandingRewards=((n=e.outstandingRewards)==null?void 0:n.map(p=>DecCoin.fromPartial(p)))||[],t}};function createBaseValidatorAccumulatedCommissionRecord(){return{validatorAddress:"",accumulated:void 0}}const ValidatorAccumulatedCommissionRecord={encode(e,t=_m0.Writer.create()){return e.validatorAddress!==""&&t.uint32(10).string(e.validatorAddress),e.accumulated!==void 0&&ValidatorAccumulatedCommission.encode(e.accumulated,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorAccumulatedCommissionRecord();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validatorAddress=n.string();break;case 2:u.accumulated=ValidatorAccumulatedCommission.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validatorAddress:isSet$1p(e.validatorAddress)?String(e.validatorAddress):"",accumulated:isSet$1p(e.accumulated)?ValidatorAccumulatedCommission.fromJSON(e.accumulated):void 0}},toJSON(e){const t={};return e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.accumulated!==void 0&&(t.accumulated=e.accumulated?ValidatorAccumulatedCommission.toJSON(e.accumulated):void 0),t},fromPartial(e){const t=createBaseValidatorAccumulatedCommissionRecord();return t.validatorAddress=e.validatorAddress??"",t.accumulated=e.accumulated!==void 0&&e.accumulated!==null?ValidatorAccumulatedCommission.fromPartial(e.accumulated):void 0,t}};function createBaseValidatorHistoricalRewardsRecord(){return{validatorAddress:"",period:0,rewards:void 0}}const ValidatorHistoricalRewardsRecord={encode(e,t=_m0.Writer.create()){return e.validatorAddress!==""&&t.uint32(10).string(e.validatorAddress),e.period!==0&&t.uint32(16).uint64(e.period),e.rewards!==void 0&&ValidatorHistoricalRewards.encode(e.rewards,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorHistoricalRewardsRecord();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validatorAddress=n.string();break;case 2:u.period=longToNumber$N(n.uint64());break;case 3:u.rewards=ValidatorHistoricalRewards.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validatorAddress:isSet$1p(e.validatorAddress)?String(e.validatorAddress):"",period:isSet$1p(e.period)?Number(e.period):0,rewards:isSet$1p(e.rewards)?ValidatorHistoricalRewards.fromJSON(e.rewards):void 0}},toJSON(e){const t={};return e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.period!==void 0&&(t.period=Math.round(e.period)),e.rewards!==void 0&&(t.rewards=e.rewards?ValidatorHistoricalRewards.toJSON(e.rewards):void 0),t},fromPartial(e){const t=createBaseValidatorHistoricalRewardsRecord();return t.validatorAddress=e.validatorAddress??"",t.period=e.period??0,t.rewards=e.rewards!==void 0&&e.rewards!==null?ValidatorHistoricalRewards.fromPartial(e.rewards):void 0,t}};function createBaseValidatorCurrentRewardsRecord(){return{validatorAddress:"",rewards:void 0}}const ValidatorCurrentRewardsRecord={encode(e,t=_m0.Writer.create()){return e.validatorAddress!==""&&t.uint32(10).string(e.validatorAddress),e.rewards!==void 0&&ValidatorCurrentRewards.encode(e.rewards,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorCurrentRewardsRecord();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validatorAddress=n.string();break;case 2:u.rewards=ValidatorCurrentRewards.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validatorAddress:isSet$1p(e.validatorAddress)?String(e.validatorAddress):"",rewards:isSet$1p(e.rewards)?ValidatorCurrentRewards.fromJSON(e.rewards):void 0}},toJSON(e){const t={};return e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.rewards!==void 0&&(t.rewards=e.rewards?ValidatorCurrentRewards.toJSON(e.rewards):void 0),t},fromPartial(e){const t=createBaseValidatorCurrentRewardsRecord();return t.validatorAddress=e.validatorAddress??"",t.rewards=e.rewards!==void 0&&e.rewards!==null?ValidatorCurrentRewards.fromPartial(e.rewards):void 0,t}};function createBaseDelegatorStartingInfoRecord(){return{delegatorAddress:"",validatorAddress:"",startingInfo:void 0}}const DelegatorStartingInfoRecord={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==""&&t.uint32(18).string(e.validatorAddress),e.startingInfo!==void 0&&DelegatorStartingInfo.encode(e.startingInfo,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDelegatorStartingInfoRecord();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorAddress=n.string();break;case 3:u.startingInfo=DelegatorStartingInfo.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$1p(e.delegatorAddress)?String(e.delegatorAddress):"",validatorAddress:isSet$1p(e.validatorAddress)?String(e.validatorAddress):"",startingInfo:isSet$1p(e.startingInfo)?DelegatorStartingInfo.fromJSON(e.startingInfo):void 0}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.startingInfo!==void 0&&(t.startingInfo=e.startingInfo?DelegatorStartingInfo.toJSON(e.startingInfo):void 0),t},fromPartial(e){const t=createBaseDelegatorStartingInfoRecord();return t.delegatorAddress=e.delegatorAddress??"",t.validatorAddress=e.validatorAddress??"",t.startingInfo=e.startingInfo!==void 0&&e.startingInfo!==null?DelegatorStartingInfo.fromPartial(e.startingInfo):void 0,t}};function createBaseValidatorSlashEventRecord(){return{validatorAddress:"",height:0,period:0,validatorSlashEvent:void 0}}const ValidatorSlashEventRecord={encode(e,t=_m0.Writer.create()){return e.validatorAddress!==""&&t.uint32(10).string(e.validatorAddress),e.height!==0&&t.uint32(16).uint64(e.height),e.period!==0&&t.uint32(24).uint64(e.period),e.validatorSlashEvent!==void 0&&ValidatorSlashEvent.encode(e.validatorSlashEvent,t.uint32(34).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorSlashEventRecord();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validatorAddress=n.string();break;case 2:u.height=longToNumber$N(n.uint64());break;case 3:u.period=longToNumber$N(n.uint64());break;case 4:u.validatorSlashEvent=ValidatorSlashEvent.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validatorAddress:isSet$1p(e.validatorAddress)?String(e.validatorAddress):"",height:isSet$1p(e.height)?Number(e.height):0,period:isSet$1p(e.period)?Number(e.period):0,validatorSlashEvent:isSet$1p(e.validatorSlashEvent)?ValidatorSlashEvent.fromJSON(e.validatorSlashEvent):void 0}},toJSON(e){const t={};return e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.height!==void 0&&(t.height=Math.round(e.height)),e.period!==void 0&&(t.period=Math.round(e.period)),e.validatorSlashEvent!==void 0&&(t.validatorSlashEvent=e.validatorSlashEvent?ValidatorSlashEvent.toJSON(e.validatorSlashEvent):void 0),t},fromPartial(e){const t=createBaseValidatorSlashEventRecord();return t.validatorAddress=e.validatorAddress??"",t.height=e.height??0,t.period=e.period??0,t.validatorSlashEvent=e.validatorSlashEvent!==void 0&&e.validatorSlashEvent!==null?ValidatorSlashEvent.fromPartial(e.validatorSlashEvent):void 0,t}};var globalThis$1d=(()=>{if(typeof globalThis$1d<"u")return globalThis$1d;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$N(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1d.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1p(e){return e!=null}const registry$c=new build$b.Registry(msgTypes$l);function getStructure$l(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$b={amount:[],gas:"200000"},txClient$l=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgFundCommunityPool({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgFundCommunityPool: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$c,prefix:t});let N=this.msgFundCommunityPool({value:MsgFundCommunityPool.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$b,g)}catch(y){throw new Error("TxClient:sendMsgFundCommunityPool: Could not broadcast Tx: "+y.message)}},async sendMsgCommunityPoolSpend({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgCommunityPoolSpend: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$c,prefix:t});let N=this.msgCommunityPoolSpend({value:MsgCommunityPoolSpend.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$b,g)}catch(y){throw new Error("TxClient:sendMsgCommunityPoolSpend: Could not broadcast Tx: "+y.message)}},async sendMsgWithdrawDelegatorReward({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgWithdrawDelegatorReward: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$c,prefix:t});let N=this.msgWithdrawDelegatorReward({value:MsgWithdrawDelegatorReward.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$b,g)}catch(y){throw new Error("TxClient:sendMsgWithdrawDelegatorReward: Could not broadcast Tx: "+y.message)}},async sendMsgWithdrawValidatorCommission({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgWithdrawValidatorCommission: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$c,prefix:t});let N=this.msgWithdrawValidatorCommission({value:MsgWithdrawValidatorCommission.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$b,g)}catch(y){throw new Error("TxClient:sendMsgWithdrawValidatorCommission: Could not broadcast Tx: "+y.message)}},async sendMsgUpdateParams({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateParams: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$c,prefix:t});let N=this.msgUpdateParams({value:MsgUpdateParams$1.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$b,g)}catch(y){throw new Error("TxClient:sendMsgUpdateParams: Could not broadcast Tx: "+y.message)}},async sendMsgSetWithdrawAddress({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgSetWithdrawAddress: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$c,prefix:t});let N=this.msgSetWithdrawAddress({value:MsgSetWithdrawAddress.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$b,g)}catch(y){throw new Error("TxClient:sendMsgSetWithdrawAddress: Could not broadcast Tx: "+y.message)}},msgFundCommunityPool({value:p}){try{return{typeUrl:"/cosmos.distribution.v1beta1.MsgFundCommunityPool",value:MsgFundCommunityPool.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgFundCommunityPool: Could not create message: "+u.message)}},msgCommunityPoolSpend({value:p}){try{return{typeUrl:"/cosmos.distribution.v1beta1.MsgCommunityPoolSpend",value:MsgCommunityPoolSpend.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgCommunityPoolSpend: Could not create message: "+u.message)}},msgWithdrawDelegatorReward({value:p}){try{return{typeUrl:"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",value:MsgWithdrawDelegatorReward.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgWithdrawDelegatorReward: Could not create message: "+u.message)}},msgWithdrawValidatorCommission({value:p}){try{return{typeUrl:"/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission",value:MsgWithdrawValidatorCommission.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgWithdrawValidatorCommission: Could not create message: "+u.message)}},msgUpdateParams({value:p}){try{return{typeUrl:"/cosmos.distribution.v1beta1.MsgUpdateParams",value:MsgUpdateParams$1.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateParams: Could not create message: "+u.message)}},msgSetWithdrawAddress({value:p}){try{return{typeUrl:"/cosmos.distribution.v1beta1.MsgSetWithdrawAddress",value:MsgSetWithdrawAddress.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgSetWithdrawAddress: Could not create message: "+u.message)}}}),queryClient$l=({addr:e}={addr:"http://localhost:1317"})=>new Api$l({baseURL:e});let SDKModule$l=class{constructor(t){this.registry=[],this.query=queryClient$l({addr:t.env.apiURL}),this.updateTX(t),this.structure={Params:getStructure$l(Params$b.fromPartial({})),ValidatorHistoricalRewards:getStructure$l(ValidatorHistoricalRewards.fromPartial({})),ValidatorCurrentRewards:getStructure$l(ValidatorCurrentRewards.fromPartial({})),ValidatorAccumulatedCommission:getStructure$l(ValidatorAccumulatedCommission.fromPartial({})),ValidatorOutstandingRewards:getStructure$l(ValidatorOutstandingRewards.fromPartial({})),ValidatorSlashEvent:getStructure$l(ValidatorSlashEvent.fromPartial({})),ValidatorSlashEvents:getStructure$l(ValidatorSlashEvents.fromPartial({})),FeePool:getStructure$l(FeePool.fromPartial({})),CommunityPoolSpendProposal:getStructure$l(CommunityPoolSpendProposal.fromPartial({})),DelegatorStartingInfo:getStructure$l(DelegatorStartingInfo.fromPartial({})),DelegationDelegatorReward:getStructure$l(DelegationDelegatorReward.fromPartial({})),CommunityPoolSpendProposalWithDeposit:getStructure$l(CommunityPoolSpendProposalWithDeposit.fromPartial({})),DelegatorWithdrawInfo:getStructure$l(DelegatorWithdrawInfo.fromPartial({})),ValidatorOutstandingRewardsRecord:getStructure$l(ValidatorOutstandingRewardsRecord.fromPartial({})),ValidatorAccumulatedCommissionRecord:getStructure$l(ValidatorAccumulatedCommissionRecord.fromPartial({})),ValidatorHistoricalRewardsRecord:getStructure$l(ValidatorHistoricalRewardsRecord.fromPartial({})),ValidatorCurrentRewardsRecord:getStructure$l(ValidatorCurrentRewardsRecord.fromPartial({})),DelegatorStartingInfoRecord:getStructure$l(DelegatorStartingInfoRecord.fromPartial({})),ValidatorSlashEventRecord:getStructure$l(ValidatorSlashEventRecord.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$l({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$l=e=>({module:{CosmosDistributionV1Beta1:new SDKModule$l(e)},registry:msgTypes$l});function createBaseAny$a(){return{typeUrl:"",value:new Uint8Array}}const Any$a={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$a();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$1o(e.typeUrl)?String(e.typeUrl):"",value:isSet$1o(e.value)?bytesFromBase64$n(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$n(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$a();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$1c=(()=>{if(typeof globalThis$1c<"u")return globalThis$1c;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$n(e){if(globalThis$1c.Buffer)return Uint8Array.from(globalThis$1c.Buffer.from(e,"base64"));{const t=globalThis$1c.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$n(e){if(globalThis$1c.Buffer)return globalThis$1c.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$1c.btoa(t.join(""))}}function isSet$1o(e){return e!=null}function createBaseMsgSubmitEvidence(){return{submitter:"",evidence:void 0}}const MsgSubmitEvidence={encode(e,t=_m0.Writer.create()){return e.submitter!==""&&t.uint32(10).string(e.submitter),e.evidence!==void 0&&Any$a.encode(e.evidence,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgSubmitEvidence();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.submitter=n.string();break;case 2:u.evidence=Any$a.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{submitter:isSet$1n(e.submitter)?String(e.submitter):"",evidence:isSet$1n(e.evidence)?Any$a.fromJSON(e.evidence):void 0}},toJSON(e){const t={};return e.submitter!==void 0&&(t.submitter=e.submitter),e.evidence!==void 0&&(t.evidence=e.evidence?Any$a.toJSON(e.evidence):void 0),t},fromPartial(e){const t=createBaseMsgSubmitEvidence();return t.submitter=e.submitter??"",t.evidence=e.evidence!==void 0&&e.evidence!==null?Any$a.fromPartial(e.evidence):void 0,t}};var globalThis$1b=(()=>{if(typeof globalThis$1b<"u")return globalThis$1b;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function isSet$1n(e){return e!=null}const msgTypes$k=[["/cosmos.evidence.v1beta1.MsgSubmitEvidence",MsgSubmitEvidence]];let HttpClient$k=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$k=class extends HttpClient$k{constructor(){super(...arguments),this.queryAllEvidence=(t,n={})=>this.request({path:"/cosmos/evidence/v1beta1/evidence",method:"GET",query:t,format:"json",...n}),this.queryEvidence=(t,n,p={})=>this.request({path:`/cosmos/evidence/v1beta1/evidence/${t}`,method:"GET",query:n,format:"json",...p})}};function createBaseTimestamp$8(){return{seconds:0,nanos:0}}const Timestamp$8={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp$8();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$M(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$1m(e.seconds)?Number(e.seconds):0,nanos:isSet$1m(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp$8();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$1a=(()=>{if(typeof globalThis$1a<"u")return globalThis$1a;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$M(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1a.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1m(e){return e!=null}function createBaseEquivocation(){return{height:0,time:void 0,power:0,consensusAddress:""}}const Equivocation={encode(e,t=_m0.Writer.create()){return e.height!==0&&t.uint32(8).int64(e.height),e.time!==void 0&&Timestamp$8.encode(toTimestamp$9(e.time),t.uint32(18).fork()).ldelim(),e.power!==0&&t.uint32(24).int64(e.power),e.consensusAddress!==""&&t.uint32(34).string(e.consensusAddress),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEquivocation();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.height=longToNumber$L(n.int64());break;case 2:u.time=fromTimestamp$9(Timestamp$8.decode(n,n.uint32()));break;case 3:u.power=longToNumber$L(n.int64());break;case 4:u.consensusAddress=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{height:isSet$1l(e.height)?Number(e.height):0,time:isSet$1l(e.time)?fromJsonTimestamp$9(e.time):void 0,power:isSet$1l(e.power)?Number(e.power):0,consensusAddress:isSet$1l(e.consensusAddress)?String(e.consensusAddress):""}},toJSON(e){const t={};return e.height!==void 0&&(t.height=Math.round(e.height)),e.time!==void 0&&(t.time=e.time.toISOString()),e.power!==void 0&&(t.power=Math.round(e.power)),e.consensusAddress!==void 0&&(t.consensusAddress=e.consensusAddress),t},fromPartial(e){const t=createBaseEquivocation();return t.height=e.height??0,t.time=e.time??void 0,t.power=e.power??0,t.consensusAddress=e.consensusAddress??"",t}};var globalThis$19=(()=>{if(typeof globalThis$19<"u")return globalThis$19;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function toTimestamp$9(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$9(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$9(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$9(Timestamp$8.fromJSON(e))}function longToNumber$L(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$19.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1l(e){return e!=null}const registry$b=new build$b.Registry(msgTypes$k);function getStructure$k(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$a={amount:[],gas:"200000"},txClient$k=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgSubmitEvidence({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgSubmitEvidence: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$b,prefix:t});let N=this.msgSubmitEvidence({value:MsgSubmitEvidence.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$a,g)}catch(y){throw new Error("TxClient:sendMsgSubmitEvidence: Could not broadcast Tx: "+y.message)}},msgSubmitEvidence({value:p}){try{return{typeUrl:"/cosmos.evidence.v1beta1.MsgSubmitEvidence",value:MsgSubmitEvidence.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgSubmitEvidence: Could not create message: "+u.message)}}}),queryClient$k=({addr:e}={addr:"http://localhost:1317"})=>new Api$k({baseURL:e});let SDKModule$k=class{constructor(t){this.registry=[],this.query=queryClient$k({addr:t.env.apiURL}),this.updateTX(t),this.structure={Equivocation:getStructure$k(Equivocation.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$k({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$k=e=>({module:{CosmosEvidenceV1Beta1:new SDKModule$k(e)},registry:msgTypes$k});function createBaseAny$9(){return{typeUrl:"",value:new Uint8Array}}const Any$9={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$9();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$1k(e.typeUrl)?String(e.typeUrl):"",value:isSet$1k(e.value)?bytesFromBase64$m(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$m(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$9();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$18=(()=>{if(typeof globalThis$18<"u")return globalThis$18;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$m(e){if(globalThis$18.Buffer)return Uint8Array.from(globalThis$18.Buffer.from(e,"base64"));{const t=globalThis$18.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$m(e){if(globalThis$18.Buffer)return globalThis$18.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$18.btoa(t.join(""))}}function isSet$1k(e){return e!=null}function createBaseMsgGrantAllowance(){return{granter:"",grantee:"",allowance:void 0}}const MsgGrantAllowance={encode(e,t=_m0.Writer.create()){return e.granter!==""&&t.uint32(10).string(e.granter),e.grantee!==""&&t.uint32(18).string(e.grantee),e.allowance!==void 0&&Any$9.encode(e.allowance,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgGrantAllowance();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.granter=n.string();break;case 2:u.grantee=n.string();break;case 3:u.allowance=Any$9.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{granter:isSet$1j(e.granter)?String(e.granter):"",grantee:isSet$1j(e.grantee)?String(e.grantee):"",allowance:isSet$1j(e.allowance)?Any$9.fromJSON(e.allowance):void 0}},toJSON(e){const t={};return e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),e.allowance!==void 0&&(t.allowance=e.allowance?Any$9.toJSON(e.allowance):void 0),t},fromPartial(e){const t=createBaseMsgGrantAllowance();return t.granter=e.granter??"",t.grantee=e.grantee??"",t.allowance=e.allowance!==void 0&&e.allowance!==null?Any$9.fromPartial(e.allowance):void 0,t}};function createBaseMsgRevokeAllowance(){return{granter:"",grantee:""}}const MsgRevokeAllowance={encode(e,t=_m0.Writer.create()){return e.granter!==""&&t.uint32(10).string(e.granter),e.grantee!==""&&t.uint32(18).string(e.grantee),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgRevokeAllowance();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.granter=n.string();break;case 2:u.grantee=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{granter:isSet$1j(e.granter)?String(e.granter):"",grantee:isSet$1j(e.grantee)?String(e.grantee):""}},toJSON(e){const t={};return e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),t},fromPartial(e){const t=createBaseMsgRevokeAllowance();return t.granter=e.granter??"",t.grantee=e.grantee??"",t}};function isSet$1j(e){return e!=null}const msgTypes$j=[["/cosmos.feegrant.v1beta1.MsgRevokeAllowance",MsgRevokeAllowance],["/cosmos.feegrant.v1beta1.MsgGrantAllowance",MsgGrantAllowance]];let HttpClient$j=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$j=class extends HttpClient$j{constructor(){super(...arguments),this.queryAllowance=(t,n,p={})=>this.request({path:`/cosmos/feegrant/v1beta1/allowance/${t}/${n}`,method:"GET",format:"json",...p}),this.queryAllowances=(t,n,p={})=>this.request({path:`/cosmos/feegrant/v1beta1/allowances/${t}`,method:"GET",query:n,format:"json",...p}),this.queryAllowancesByGranter=(t,n,p={})=>this.request({path:`/cosmos/feegrant/v1beta1/issued/${t}`,method:"GET",query:n,format:"json",...p})}};function createBaseDuration$5(){return{seconds:0,nanos:0}}const Duration$5={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDuration$5();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$K(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$1i(e.seconds)?Number(e.seconds):0,nanos:isSet$1i(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseDuration$5();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$17=(()=>{if(typeof globalThis$17<"u")return globalThis$17;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$K(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$17.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1i(e){return e!=null}function createBaseTimestamp$7(){return{seconds:0,nanos:0}}const Timestamp$7={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp$7();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$J(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$1h(e.seconds)?Number(e.seconds):0,nanos:isSet$1h(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp$7();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$16=(()=>{if(typeof globalThis$16<"u")return globalThis$16;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$J(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$16.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1h(e){return e!=null}function createBaseCoin$7(){return{denom:"",amount:""}}const Coin$7={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin$7();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$1g(e.denom)?String(e.denom):"",amount:isSet$1g(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin$7();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$1g(e){return e!=null}function createBaseBasicAllowance(){return{spendLimit:[],expiration:void 0}}const BasicAllowance={encode(e,t=_m0.Writer.create()){for(const n of e.spendLimit)Coin$7.encode(n,t.uint32(10).fork()).ldelim();return e.expiration!==void 0&&Timestamp$7.encode(toTimestamp$8(e.expiration),t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseBasicAllowance();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.spendLimit.push(Coin$7.decode(n,n.uint32()));break;case 2:u.expiration=fromTimestamp$8(Timestamp$7.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{spendLimit:Array.isArray(e==null?void 0:e.spendLimit)?e.spendLimit.map(t=>Coin$7.fromJSON(t)):[],expiration:isSet$1f(e.expiration)?fromJsonTimestamp$8(e.expiration):void 0}},toJSON(e){const t={};return e.spendLimit?t.spendLimit=e.spendLimit.map(n=>n?Coin$7.toJSON(n):void 0):t.spendLimit=[],e.expiration!==void 0&&(t.expiration=e.expiration.toISOString()),t},fromPartial(e){var n;const t=createBaseBasicAllowance();return t.spendLimit=((n=e.spendLimit)==null?void 0:n.map(p=>Coin$7.fromPartial(p)))||[],t.expiration=e.expiration??void 0,t}};function createBasePeriodicAllowance(){return{basic:void 0,period:void 0,periodSpendLimit:[],periodCanSpend:[],periodReset:void 0}}const PeriodicAllowance={encode(e,t=_m0.Writer.create()){e.basic!==void 0&&BasicAllowance.encode(e.basic,t.uint32(10).fork()).ldelim(),e.period!==void 0&&Duration$5.encode(e.period,t.uint32(18).fork()).ldelim();for(const n of e.periodSpendLimit)Coin$7.encode(n,t.uint32(26).fork()).ldelim();for(const n of e.periodCanSpend)Coin$7.encode(n,t.uint32(34).fork()).ldelim();return e.periodReset!==void 0&&Timestamp$7.encode(toTimestamp$8(e.periodReset),t.uint32(42).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePeriodicAllowance();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.basic=BasicAllowance.decode(n,n.uint32());break;case 2:u.period=Duration$5.decode(n,n.uint32());break;case 3:u.periodSpendLimit.push(Coin$7.decode(n,n.uint32()));break;case 4:u.periodCanSpend.push(Coin$7.decode(n,n.uint32()));break;case 5:u.periodReset=fromTimestamp$8(Timestamp$7.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{basic:isSet$1f(e.basic)?BasicAllowance.fromJSON(e.basic):void 0,period:isSet$1f(e.period)?Duration$5.fromJSON(e.period):void 0,periodSpendLimit:Array.isArray(e==null?void 0:e.periodSpendLimit)?e.periodSpendLimit.map(t=>Coin$7.fromJSON(t)):[],periodCanSpend:Array.isArray(e==null?void 0:e.periodCanSpend)?e.periodCanSpend.map(t=>Coin$7.fromJSON(t)):[],periodReset:isSet$1f(e.periodReset)?fromJsonTimestamp$8(e.periodReset):void 0}},toJSON(e){const t={};return e.basic!==void 0&&(t.basic=e.basic?BasicAllowance.toJSON(e.basic):void 0),e.period!==void 0&&(t.period=e.period?Duration$5.toJSON(e.period):void 0),e.periodSpendLimit?t.periodSpendLimit=e.periodSpendLimit.map(n=>n?Coin$7.toJSON(n):void 0):t.periodSpendLimit=[],e.periodCanSpend?t.periodCanSpend=e.periodCanSpend.map(n=>n?Coin$7.toJSON(n):void 0):t.periodCanSpend=[],e.periodReset!==void 0&&(t.periodReset=e.periodReset.toISOString()),t},fromPartial(e){var n,p;const t=createBasePeriodicAllowance();return t.basic=e.basic!==void 0&&e.basic!==null?BasicAllowance.fromPartial(e.basic):void 0,t.period=e.period!==void 0&&e.period!==null?Duration$5.fromPartial(e.period):void 0,t.periodSpendLimit=((n=e.periodSpendLimit)==null?void 0:n.map(u=>Coin$7.fromPartial(u)))||[],t.periodCanSpend=((p=e.periodCanSpend)==null?void 0:p.map(u=>Coin$7.fromPartial(u)))||[],t.periodReset=e.periodReset??void 0,t}};function createBaseAllowedMsgAllowance(){return{allowance:void 0,allowedMessages:[]}}const AllowedMsgAllowance={encode(e,t=_m0.Writer.create()){e.allowance!==void 0&&Any$9.encode(e.allowance,t.uint32(10).fork()).ldelim();for(const n of e.allowedMessages)t.uint32(18).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAllowedMsgAllowance();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.allowance=Any$9.decode(n,n.uint32());break;case 2:u.allowedMessages.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{allowance:isSet$1f(e.allowance)?Any$9.fromJSON(e.allowance):void 0,allowedMessages:Array.isArray(e==null?void 0:e.allowedMessages)?e.allowedMessages.map(t=>String(t)):[]}},toJSON(e){const t={};return e.allowance!==void 0&&(t.allowance=e.allowance?Any$9.toJSON(e.allowance):void 0),e.allowedMessages?t.allowedMessages=e.allowedMessages.map(n=>n):t.allowedMessages=[],t},fromPartial(e){var n;const t=createBaseAllowedMsgAllowance();return t.allowance=e.allowance!==void 0&&e.allowance!==null?Any$9.fromPartial(e.allowance):void 0,t.allowedMessages=((n=e.allowedMessages)==null?void 0:n.map(p=>p))||[],t}};function createBaseGrant(){return{granter:"",grantee:"",allowance:void 0}}const Grant={encode(e,t=_m0.Writer.create()){return e.granter!==""&&t.uint32(10).string(e.granter),e.grantee!==""&&t.uint32(18).string(e.grantee),e.allowance!==void 0&&Any$9.encode(e.allowance,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseGrant();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.granter=n.string();break;case 2:u.grantee=n.string();break;case 3:u.allowance=Any$9.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{granter:isSet$1f(e.granter)?String(e.granter):"",grantee:isSet$1f(e.grantee)?String(e.grantee):"",allowance:isSet$1f(e.allowance)?Any$9.fromJSON(e.allowance):void 0}},toJSON(e){const t={};return e.granter!==void 0&&(t.granter=e.granter),e.grantee!==void 0&&(t.grantee=e.grantee),e.allowance!==void 0&&(t.allowance=e.allowance?Any$9.toJSON(e.allowance):void 0),t},fromPartial(e){const t=createBaseGrant();return t.granter=e.granter??"",t.grantee=e.grantee??"",t.allowance=e.allowance!==void 0&&e.allowance!==null?Any$9.fromPartial(e.allowance):void 0,t}};function toTimestamp$8(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$8(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$8(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$8(Timestamp$7.fromJSON(e))}function isSet$1f(e){return e!=null}const registry$a=new build$b.Registry(msgTypes$j);function getStructure$j(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$9={amount:[],gas:"200000"},txClient$j=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgRevokeAllowance({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgRevokeAllowance: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$a,prefix:t});let N=this.msgRevokeAllowance({value:MsgRevokeAllowance.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$9,g)}catch(y){throw new Error("TxClient:sendMsgRevokeAllowance: Could not broadcast Tx: "+y.message)}},async sendMsgGrantAllowance({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgGrantAllowance: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$a,prefix:t});let N=this.msgGrantAllowance({value:MsgGrantAllowance.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$9,g)}catch(y){throw new Error("TxClient:sendMsgGrantAllowance: Could not broadcast Tx: "+y.message)}},msgRevokeAllowance({value:p}){try{return{typeUrl:"/cosmos.feegrant.v1beta1.MsgRevokeAllowance",value:MsgRevokeAllowance.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgRevokeAllowance: Could not create message: "+u.message)}},msgGrantAllowance({value:p}){try{return{typeUrl:"/cosmos.feegrant.v1beta1.MsgGrantAllowance",value:MsgGrantAllowance.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgGrantAllowance: Could not create message: "+u.message)}}}),queryClient$j=({addr:e}={addr:"http://localhost:1317"})=>new Api$j({baseURL:e});let SDKModule$j=class{constructor(t){this.registry=[],this.query=queryClient$j({addr:t.env.apiURL}),this.updateTX(t),this.structure={BasicAllowance:getStructure$j(BasicAllowance.fromPartial({})),PeriodicAllowance:getStructure$j(PeriodicAllowance.fromPartial({})),AllowedMsgAllowance:getStructure$j(AllowedMsgAllowance.fromPartial({})),Grant:getStructure$j(Grant.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$j({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$j=e=>({module:{CosmosFeegrantV1Beta1:new SDKModule$j(e)},registry:msgTypes$j});function createBaseAny$8(){return{typeUrl:"",value:new Uint8Array}}const Any$8={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$8();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$1e(e.typeUrl)?String(e.typeUrl):"",value:isSet$1e(e.value)?bytesFromBase64$l(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$l(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$8();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$15=(()=>{if(typeof globalThis$15<"u")return globalThis$15;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$l(e){if(globalThis$15.Buffer)return Uint8Array.from(globalThis$15.Buffer.from(e,"base64"));{const t=globalThis$15.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$l(e){if(globalThis$15.Buffer)return globalThis$15.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$15.btoa(t.join(""))}}function isSet$1e(e){return e!=null}function createBaseCoin$6(){return{denom:"",amount:""}}const Coin$6={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin$6();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$1d(e.denom)?String(e.denom):"",amount:isSet$1d(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin$6();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$1d(e){return e!=null}function createBaseDuration$4(){return{seconds:0,nanos:0}}const Duration$4={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDuration$4();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$I(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$1c(e.seconds)?Number(e.seconds):0,nanos:isSet$1c(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseDuration$4();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$14=(()=>{if(typeof globalThis$14<"u")return globalThis$14;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$I(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$14.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1c(e){return e!=null}function createBaseTimestamp$6(){return{seconds:0,nanos:0}}const Timestamp$6={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp$6();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$H(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$1b(e.seconds)?Number(e.seconds):0,nanos:isSet$1b(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp$6();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$13=(()=>{if(typeof globalThis$13<"u")return globalThis$13;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$H(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$13.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1b(e){return e!=null}function voteOptionFromJSON$2(e){switch(e){case 0:case"VOTE_OPTION_UNSPECIFIED":return 0;case 1:case"VOTE_OPTION_YES":return 1;case 2:case"VOTE_OPTION_ABSTAIN":return 2;case 3:case"VOTE_OPTION_NO":return 3;case 4:case"VOTE_OPTION_NO_WITH_VETO":return 4;case-1:case"UNRECOGNIZED":default:return-1}}function voteOptionToJSON$2(e){switch(e){case 0:return"VOTE_OPTION_UNSPECIFIED";case 1:return"VOTE_OPTION_YES";case 2:return"VOTE_OPTION_ABSTAIN";case 3:return"VOTE_OPTION_NO";case 4:return"VOTE_OPTION_NO_WITH_VETO";case-1:default:return"UNRECOGNIZED"}}function proposalStatusFromJSON$2(e){switch(e){case 0:case"PROPOSAL_STATUS_UNSPECIFIED":return 0;case 1:case"PROPOSAL_STATUS_DEPOSIT_PERIOD":return 1;case 2:case"PROPOSAL_STATUS_VOTING_PERIOD":return 2;case 3:case"PROPOSAL_STATUS_PASSED":return 3;case 4:case"PROPOSAL_STATUS_REJECTED":return 4;case 5:case"PROPOSAL_STATUS_FAILED":return 5;case-1:case"UNRECOGNIZED":default:return-1}}function proposalStatusToJSON$2(e){switch(e){case 0:return"PROPOSAL_STATUS_UNSPECIFIED";case 1:return"PROPOSAL_STATUS_DEPOSIT_PERIOD";case 2:return"PROPOSAL_STATUS_VOTING_PERIOD";case 3:return"PROPOSAL_STATUS_PASSED";case 4:return"PROPOSAL_STATUS_REJECTED";case 5:return"PROPOSAL_STATUS_FAILED";case-1:default:return"UNRECOGNIZED"}}function createBaseWeightedVoteOption$1(){return{option:0,weight:""}}const WeightedVoteOption$1={encode(e,t=_m0.Writer.create()){return e.option!==0&&t.uint32(8).int32(e.option),e.weight!==""&&t.uint32(18).string(e.weight),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseWeightedVoteOption$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.option=n.int32();break;case 2:u.weight=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{option:isSet$1a(e.option)?voteOptionFromJSON$2(e.option):0,weight:isSet$1a(e.weight)?String(e.weight):""}},toJSON(e){const t={};return e.option!==void 0&&(t.option=voteOptionToJSON$2(e.option)),e.weight!==void 0&&(t.weight=e.weight),t},fromPartial(e){const t=createBaseWeightedVoteOption$1();return t.option=e.option??0,t.weight=e.weight??"",t}};function createBaseDeposit$1(){return{proposalId:0,depositor:"",amount:[]}}const Deposit$1={encode(e,t=_m0.Writer.create()){e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.depositor!==""&&t.uint32(18).string(e.depositor);for(const n of e.amount)Coin$6.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDeposit$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$G(n.uint64());break;case 2:u.depositor=n.string();break;case 3:u.amount.push(Coin$6.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$1a(e.proposalId)?Number(e.proposalId):0,depositor:isSet$1a(e.depositor)?String(e.depositor):"",amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$6.fromJSON(t)):[]}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.depositor!==void 0&&(t.depositor=e.depositor),e.amount?t.amount=e.amount.map(n=>n?Coin$6.toJSON(n):void 0):t.amount=[],t},fromPartial(e){var n;const t=createBaseDeposit$1();return t.proposalId=e.proposalId??0,t.depositor=e.depositor??"",t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$6.fromPartial(p)))||[],t}};function createBaseProposal$2(){return{id:0,messages:[],status:0,finalTallyResult:void 0,submitTime:void 0,depositEndTime:void 0,totalDeposit:[],votingStartTime:void 0,votingEndTime:void 0,metadata:"",title:"",summary:"",proposer:""}}const Proposal$2={encode(e,t=_m0.Writer.create()){e.id!==0&&t.uint32(8).uint64(e.id);for(const n of e.messages)Any$8.encode(n,t.uint32(18).fork()).ldelim();e.status!==0&&t.uint32(24).int32(e.status),e.finalTallyResult!==void 0&&TallyResult$2.encode(e.finalTallyResult,t.uint32(34).fork()).ldelim(),e.submitTime!==void 0&&Timestamp$6.encode(toTimestamp$7(e.submitTime),t.uint32(42).fork()).ldelim(),e.depositEndTime!==void 0&&Timestamp$6.encode(toTimestamp$7(e.depositEndTime),t.uint32(50).fork()).ldelim();for(const n of e.totalDeposit)Coin$6.encode(n,t.uint32(58).fork()).ldelim();return e.votingStartTime!==void 0&&Timestamp$6.encode(toTimestamp$7(e.votingStartTime),t.uint32(66).fork()).ldelim(),e.votingEndTime!==void 0&&Timestamp$6.encode(toTimestamp$7(e.votingEndTime),t.uint32(74).fork()).ldelim(),e.metadata!==""&&t.uint32(82).string(e.metadata),e.title!==""&&t.uint32(90).string(e.title),e.summary!==""&&t.uint32(98).string(e.summary),e.proposer!==""&&t.uint32(106).string(e.proposer),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseProposal$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.id=longToNumber$G(n.uint64());break;case 2:u.messages.push(Any$8.decode(n,n.uint32()));break;case 3:u.status=n.int32();break;case 4:u.finalTallyResult=TallyResult$2.decode(n,n.uint32());break;case 5:u.submitTime=fromTimestamp$7(Timestamp$6.decode(n,n.uint32()));break;case 6:u.depositEndTime=fromTimestamp$7(Timestamp$6.decode(n,n.uint32()));break;case 7:u.totalDeposit.push(Coin$6.decode(n,n.uint32()));break;case 8:u.votingStartTime=fromTimestamp$7(Timestamp$6.decode(n,n.uint32()));break;case 9:u.votingEndTime=fromTimestamp$7(Timestamp$6.decode(n,n.uint32()));break;case 10:u.metadata=n.string();break;case 11:u.title=n.string();break;case 12:u.summary=n.string();break;case 13:u.proposer=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{id:isSet$1a(e.id)?Number(e.id):0,messages:Array.isArray(e==null?void 0:e.messages)?e.messages.map(t=>Any$8.fromJSON(t)):[],status:isSet$1a(e.status)?proposalStatusFromJSON$2(e.status):0,finalTallyResult:isSet$1a(e.finalTallyResult)?TallyResult$2.fromJSON(e.finalTallyResult):void 0,submitTime:isSet$1a(e.submitTime)?fromJsonTimestamp$7(e.submitTime):void 0,depositEndTime:isSet$1a(e.depositEndTime)?fromJsonTimestamp$7(e.depositEndTime):void 0,totalDeposit:Array.isArray(e==null?void 0:e.totalDeposit)?e.totalDeposit.map(t=>Coin$6.fromJSON(t)):[],votingStartTime:isSet$1a(e.votingStartTime)?fromJsonTimestamp$7(e.votingStartTime):void 0,votingEndTime:isSet$1a(e.votingEndTime)?fromJsonTimestamp$7(e.votingEndTime):void 0,metadata:isSet$1a(e.metadata)?String(e.metadata):"",title:isSet$1a(e.title)?String(e.title):"",summary:isSet$1a(e.summary)?String(e.summary):"",proposer:isSet$1a(e.proposer)?String(e.proposer):""}},toJSON(e){const t={};return e.id!==void 0&&(t.id=Math.round(e.id)),e.messages?t.messages=e.messages.map(n=>n?Any$8.toJSON(n):void 0):t.messages=[],e.status!==void 0&&(t.status=proposalStatusToJSON$2(e.status)),e.finalTallyResult!==void 0&&(t.finalTallyResult=e.finalTallyResult?TallyResult$2.toJSON(e.finalTallyResult):void 0),e.submitTime!==void 0&&(t.submitTime=e.submitTime.toISOString()),e.depositEndTime!==void 0&&(t.depositEndTime=e.depositEndTime.toISOString()),e.totalDeposit?t.totalDeposit=e.totalDeposit.map(n=>n?Coin$6.toJSON(n):void 0):t.totalDeposit=[],e.votingStartTime!==void 0&&(t.votingStartTime=e.votingStartTime.toISOString()),e.votingEndTime!==void 0&&(t.votingEndTime=e.votingEndTime.toISOString()),e.metadata!==void 0&&(t.metadata=e.metadata),e.title!==void 0&&(t.title=e.title),e.summary!==void 0&&(t.summary=e.summary),e.proposer!==void 0&&(t.proposer=e.proposer),t},fromPartial(e){var n,p;const t=createBaseProposal$2();return t.id=e.id??0,t.messages=((n=e.messages)==null?void 0:n.map(u=>Any$8.fromPartial(u)))||[],t.status=e.status??0,t.finalTallyResult=e.finalTallyResult!==void 0&&e.finalTallyResult!==null?TallyResult$2.fromPartial(e.finalTallyResult):void 0,t.submitTime=e.submitTime??void 0,t.depositEndTime=e.depositEndTime??void 0,t.totalDeposit=((p=e.totalDeposit)==null?void 0:p.map(u=>Coin$6.fromPartial(u)))||[],t.votingStartTime=e.votingStartTime??void 0,t.votingEndTime=e.votingEndTime??void 0,t.metadata=e.metadata??"",t.title=e.title??"",t.summary=e.summary??"",t.proposer=e.proposer??"",t}};function createBaseTallyResult$2(){return{yesCount:"",abstainCount:"",noCount:"",noWithVetoCount:""}}const TallyResult$2={encode(e,t=_m0.Writer.create()){return e.yesCount!==""&&t.uint32(10).string(e.yesCount),e.abstainCount!==""&&t.uint32(18).string(e.abstainCount),e.noCount!==""&&t.uint32(26).string(e.noCount),e.noWithVetoCount!==""&&t.uint32(34).string(e.noWithVetoCount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTallyResult$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.yesCount=n.string();break;case 2:u.abstainCount=n.string();break;case 3:u.noCount=n.string();break;case 4:u.noWithVetoCount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{yesCount:isSet$1a(e.yesCount)?String(e.yesCount):"",abstainCount:isSet$1a(e.abstainCount)?String(e.abstainCount):"",noCount:isSet$1a(e.noCount)?String(e.noCount):"",noWithVetoCount:isSet$1a(e.noWithVetoCount)?String(e.noWithVetoCount):""}},toJSON(e){const t={};return e.yesCount!==void 0&&(t.yesCount=e.yesCount),e.abstainCount!==void 0&&(t.abstainCount=e.abstainCount),e.noCount!==void 0&&(t.noCount=e.noCount),e.noWithVetoCount!==void 0&&(t.noWithVetoCount=e.noWithVetoCount),t},fromPartial(e){const t=createBaseTallyResult$2();return t.yesCount=e.yesCount??"",t.abstainCount=e.abstainCount??"",t.noCount=e.noCount??"",t.noWithVetoCount=e.noWithVetoCount??"",t}};function createBaseVote$2(){return{proposalId:0,voter:"",options:[],metadata:""}}const Vote$2={encode(e,t=_m0.Writer.create()){e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.voter!==""&&t.uint32(18).string(e.voter);for(const n of e.options)WeightedVoteOption$1.encode(n,t.uint32(34).fork()).ldelim();return e.metadata!==""&&t.uint32(42).string(e.metadata),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseVote$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$G(n.uint64());break;case 2:u.voter=n.string();break;case 4:u.options.push(WeightedVoteOption$1.decode(n,n.uint32()));break;case 5:u.metadata=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$1a(e.proposalId)?Number(e.proposalId):0,voter:isSet$1a(e.voter)?String(e.voter):"",options:Array.isArray(e==null?void 0:e.options)?e.options.map(t=>WeightedVoteOption$1.fromJSON(t)):[],metadata:isSet$1a(e.metadata)?String(e.metadata):""}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.voter!==void 0&&(t.voter=e.voter),e.options?t.options=e.options.map(n=>n?WeightedVoteOption$1.toJSON(n):void 0):t.options=[],e.metadata!==void 0&&(t.metadata=e.metadata),t},fromPartial(e){var n;const t=createBaseVote$2();return t.proposalId=e.proposalId??0,t.voter=e.voter??"",t.options=((n=e.options)==null?void 0:n.map(p=>WeightedVoteOption$1.fromPartial(p)))||[],t.metadata=e.metadata??"",t}};function createBaseDepositParams$1(){return{minDeposit:[],maxDepositPeriod:void 0}}const DepositParams$1={encode(e,t=_m0.Writer.create()){for(const n of e.minDeposit)Coin$6.encode(n,t.uint32(10).fork()).ldelim();return e.maxDepositPeriod!==void 0&&Duration$4.encode(e.maxDepositPeriod,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDepositParams$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.minDeposit.push(Coin$6.decode(n,n.uint32()));break;case 2:u.maxDepositPeriod=Duration$4.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{minDeposit:Array.isArray(e==null?void 0:e.minDeposit)?e.minDeposit.map(t=>Coin$6.fromJSON(t)):[],maxDepositPeriod:isSet$1a(e.maxDepositPeriod)?Duration$4.fromJSON(e.maxDepositPeriod):void 0}},toJSON(e){const t={};return e.minDeposit?t.minDeposit=e.minDeposit.map(n=>n?Coin$6.toJSON(n):void 0):t.minDeposit=[],e.maxDepositPeriod!==void 0&&(t.maxDepositPeriod=e.maxDepositPeriod?Duration$4.toJSON(e.maxDepositPeriod):void 0),t},fromPartial(e){var n;const t=createBaseDepositParams$1();return t.minDeposit=((n=e.minDeposit)==null?void 0:n.map(p=>Coin$6.fromPartial(p)))||[],t.maxDepositPeriod=e.maxDepositPeriod!==void 0&&e.maxDepositPeriod!==null?Duration$4.fromPartial(e.maxDepositPeriod):void 0,t}};function createBaseVotingParams$1(){return{votingPeriod:void 0}}const VotingParams$1={encode(e,t=_m0.Writer.create()){return e.votingPeriod!==void 0&&Duration$4.encode(e.votingPeriod,t.uint32(10).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseVotingParams$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.votingPeriod=Duration$4.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{votingPeriod:isSet$1a(e.votingPeriod)?Duration$4.fromJSON(e.votingPeriod):void 0}},toJSON(e){const t={};return e.votingPeriod!==void 0&&(t.votingPeriod=e.votingPeriod?Duration$4.toJSON(e.votingPeriod):void 0),t},fromPartial(e){const t=createBaseVotingParams$1();return t.votingPeriod=e.votingPeriod!==void 0&&e.votingPeriod!==null?Duration$4.fromPartial(e.votingPeriod):void 0,t}};function createBaseTallyParams$1(){return{quorum:"",threshold:"",vetoThreshold:""}}const TallyParams$1={encode(e,t=_m0.Writer.create()){return e.quorum!==""&&t.uint32(10).string(e.quorum),e.threshold!==""&&t.uint32(18).string(e.threshold),e.vetoThreshold!==""&&t.uint32(26).string(e.vetoThreshold),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTallyParams$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.quorum=n.string();break;case 2:u.threshold=n.string();break;case 3:u.vetoThreshold=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{quorum:isSet$1a(e.quorum)?String(e.quorum):"",threshold:isSet$1a(e.threshold)?String(e.threshold):"",vetoThreshold:isSet$1a(e.vetoThreshold)?String(e.vetoThreshold):""}},toJSON(e){const t={};return e.quorum!==void 0&&(t.quorum=e.quorum),e.threshold!==void 0&&(t.threshold=e.threshold),e.vetoThreshold!==void 0&&(t.vetoThreshold=e.vetoThreshold),t},fromPartial(e){const t=createBaseTallyParams$1();return t.quorum=e.quorum??"",t.threshold=e.threshold??"",t.vetoThreshold=e.vetoThreshold??"",t}};function createBaseParams$a(){return{minDeposit:[],maxDepositPeriod:void 0,votingPeriod:void 0,quorum:"",threshold:"",vetoThreshold:"",minInitialDepositRatio:"",burnVoteQuorum:!1,burnProposalDepositPrevote:!1,burnVoteVeto:!1}}const Params$a={encode(e,t=_m0.Writer.create()){for(const n of e.minDeposit)Coin$6.encode(n,t.uint32(10).fork()).ldelim();return e.maxDepositPeriod!==void 0&&Duration$4.encode(e.maxDepositPeriod,t.uint32(18).fork()).ldelim(),e.votingPeriod!==void 0&&Duration$4.encode(e.votingPeriod,t.uint32(26).fork()).ldelim(),e.quorum!==""&&t.uint32(34).string(e.quorum),e.threshold!==""&&t.uint32(42).string(e.threshold),e.vetoThreshold!==""&&t.uint32(50).string(e.vetoThreshold),e.minInitialDepositRatio!==""&&t.uint32(58).string(e.minInitialDepositRatio),e.burnVoteQuorum===!0&&t.uint32(104).bool(e.burnVoteQuorum),e.burnProposalDepositPrevote===!0&&t.uint32(112).bool(e.burnProposalDepositPrevote),e.burnVoteVeto===!0&&t.uint32(120).bool(e.burnVoteVeto),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$a();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.minDeposit.push(Coin$6.decode(n,n.uint32()));break;case 2:u.maxDepositPeriod=Duration$4.decode(n,n.uint32());break;case 3:u.votingPeriod=Duration$4.decode(n,n.uint32());break;case 4:u.quorum=n.string();break;case 5:u.threshold=n.string();break;case 6:u.vetoThreshold=n.string();break;case 7:u.minInitialDepositRatio=n.string();break;case 13:u.burnVoteQuorum=n.bool();break;case 14:u.burnProposalDepositPrevote=n.bool();break;case 15:u.burnVoteVeto=n.bool();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{minDeposit:Array.isArray(e==null?void 0:e.minDeposit)?e.minDeposit.map(t=>Coin$6.fromJSON(t)):[],maxDepositPeriod:isSet$1a(e.maxDepositPeriod)?Duration$4.fromJSON(e.maxDepositPeriod):void 0,votingPeriod:isSet$1a(e.votingPeriod)?Duration$4.fromJSON(e.votingPeriod):void 0,quorum:isSet$1a(e.quorum)?String(e.quorum):"",threshold:isSet$1a(e.threshold)?String(e.threshold):"",vetoThreshold:isSet$1a(e.vetoThreshold)?String(e.vetoThreshold):"",minInitialDepositRatio:isSet$1a(e.minInitialDepositRatio)?String(e.minInitialDepositRatio):"",burnVoteQuorum:isSet$1a(e.burnVoteQuorum)?!!e.burnVoteQuorum:!1,burnProposalDepositPrevote:isSet$1a(e.burnProposalDepositPrevote)?!!e.burnProposalDepositPrevote:!1,burnVoteVeto:isSet$1a(e.burnVoteVeto)?!!e.burnVoteVeto:!1}},toJSON(e){const t={};return e.minDeposit?t.minDeposit=e.minDeposit.map(n=>n?Coin$6.toJSON(n):void 0):t.minDeposit=[],e.maxDepositPeriod!==void 0&&(t.maxDepositPeriod=e.maxDepositPeriod?Duration$4.toJSON(e.maxDepositPeriod):void 0),e.votingPeriod!==void 0&&(t.votingPeriod=e.votingPeriod?Duration$4.toJSON(e.votingPeriod):void 0),e.quorum!==void 0&&(t.quorum=e.quorum),e.threshold!==void 0&&(t.threshold=e.threshold),e.vetoThreshold!==void 0&&(t.vetoThreshold=e.vetoThreshold),e.minInitialDepositRatio!==void 0&&(t.minInitialDepositRatio=e.minInitialDepositRatio),e.burnVoteQuorum!==void 0&&(t.burnVoteQuorum=e.burnVoteQuorum),e.burnProposalDepositPrevote!==void 0&&(t.burnProposalDepositPrevote=e.burnProposalDepositPrevote),e.burnVoteVeto!==void 0&&(t.burnVoteVeto=e.burnVoteVeto),t},fromPartial(e){var n;const t=createBaseParams$a();return t.minDeposit=((n=e.minDeposit)==null?void 0:n.map(p=>Coin$6.fromPartial(p)))||[],t.maxDepositPeriod=e.maxDepositPeriod!==void 0&&e.maxDepositPeriod!==null?Duration$4.fromPartial(e.maxDepositPeriod):void 0,t.votingPeriod=e.votingPeriod!==void 0&&e.votingPeriod!==null?Duration$4.fromPartial(e.votingPeriod):void 0,t.quorum=e.quorum??"",t.threshold=e.threshold??"",t.vetoThreshold=e.vetoThreshold??"",t.minInitialDepositRatio=e.minInitialDepositRatio??"",t.burnVoteQuorum=e.burnVoteQuorum??!1,t.burnProposalDepositPrevote=e.burnProposalDepositPrevote??!1,t.burnVoteVeto=e.burnVoteVeto??!1,t}};var globalThis$12=(()=>{if(typeof globalThis$12<"u")return globalThis$12;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function toTimestamp$7(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$7(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$7(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$7(Timestamp$6.fromJSON(e))}function longToNumber$G(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$12.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1a(e){return e!=null}function createBaseMsgSubmitProposal$2(){return{messages:[],initialDeposit:[],proposer:"",metadata:"",title:"",summary:""}}const MsgSubmitProposal$2={encode(e,t=_m0.Writer.create()){for(const n of e.messages)Any$8.encode(n,t.uint32(10).fork()).ldelim();for(const n of e.initialDeposit)Coin$6.encode(n,t.uint32(18).fork()).ldelim();return e.proposer!==""&&t.uint32(26).string(e.proposer),e.metadata!==""&&t.uint32(34).string(e.metadata),e.title!==""&&t.uint32(42).string(e.title),e.summary!==""&&t.uint32(50).string(e.summary),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgSubmitProposal$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.messages.push(Any$8.decode(n,n.uint32()));break;case 2:u.initialDeposit.push(Coin$6.decode(n,n.uint32()));break;case 3:u.proposer=n.string();break;case 4:u.metadata=n.string();break;case 5:u.title=n.string();break;case 6:u.summary=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{messages:Array.isArray(e==null?void 0:e.messages)?e.messages.map(t=>Any$8.fromJSON(t)):[],initialDeposit:Array.isArray(e==null?void 0:e.initialDeposit)?e.initialDeposit.map(t=>Coin$6.fromJSON(t)):[],proposer:isSet$19(e.proposer)?String(e.proposer):"",metadata:isSet$19(e.metadata)?String(e.metadata):"",title:isSet$19(e.title)?String(e.title):"",summary:isSet$19(e.summary)?String(e.summary):""}},toJSON(e){const t={};return e.messages?t.messages=e.messages.map(n=>n?Any$8.toJSON(n):void 0):t.messages=[],e.initialDeposit?t.initialDeposit=e.initialDeposit.map(n=>n?Coin$6.toJSON(n):void 0):t.initialDeposit=[],e.proposer!==void 0&&(t.proposer=e.proposer),e.metadata!==void 0&&(t.metadata=e.metadata),e.title!==void 0&&(t.title=e.title),e.summary!==void 0&&(t.summary=e.summary),t},fromPartial(e){var n,p;const t=createBaseMsgSubmitProposal$2();return t.messages=((n=e.messages)==null?void 0:n.map(u=>Any$8.fromPartial(u)))||[],t.initialDeposit=((p=e.initialDeposit)==null?void 0:p.map(u=>Coin$6.fromPartial(u)))||[],t.proposer=e.proposer??"",t.metadata=e.metadata??"",t.title=e.title??"",t.summary=e.summary??"",t}};function createBaseMsgVote$2(){return{proposalId:0,voter:"",option:0,metadata:""}}const MsgVote$2={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.voter!==""&&t.uint32(18).string(e.voter),e.option!==0&&t.uint32(24).int32(e.option),e.metadata!==""&&t.uint32(34).string(e.metadata),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgVote$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$F(n.uint64());break;case 2:u.voter=n.string();break;case 3:u.option=n.int32();break;case 4:u.metadata=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$19(e.proposalId)?Number(e.proposalId):0,voter:isSet$19(e.voter)?String(e.voter):"",option:isSet$19(e.option)?voteOptionFromJSON$2(e.option):0,metadata:isSet$19(e.metadata)?String(e.metadata):""}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.voter!==void 0&&(t.voter=e.voter),e.option!==void 0&&(t.option=voteOptionToJSON$2(e.option)),e.metadata!==void 0&&(t.metadata=e.metadata),t},fromPartial(e){const t=createBaseMsgVote$2();return t.proposalId=e.proposalId??0,t.voter=e.voter??"",t.option=e.option??0,t.metadata=e.metadata??"",t}};function createBaseMsgVoteWeighted$1(){return{proposalId:0,voter:"",options:[],metadata:""}}const MsgVoteWeighted$1={encode(e,t=_m0.Writer.create()){e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.voter!==""&&t.uint32(18).string(e.voter);for(const n of e.options)WeightedVoteOption$1.encode(n,t.uint32(26).fork()).ldelim();return e.metadata!==""&&t.uint32(34).string(e.metadata),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgVoteWeighted$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$F(n.uint64());break;case 2:u.voter=n.string();break;case 3:u.options.push(WeightedVoteOption$1.decode(n,n.uint32()));break;case 4:u.metadata=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$19(e.proposalId)?Number(e.proposalId):0,voter:isSet$19(e.voter)?String(e.voter):"",options:Array.isArray(e==null?void 0:e.options)?e.options.map(t=>WeightedVoteOption$1.fromJSON(t)):[],metadata:isSet$19(e.metadata)?String(e.metadata):""}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.voter!==void 0&&(t.voter=e.voter),e.options?t.options=e.options.map(n=>n?WeightedVoteOption$1.toJSON(n):void 0):t.options=[],e.metadata!==void 0&&(t.metadata=e.metadata),t},fromPartial(e){var n;const t=createBaseMsgVoteWeighted$1();return t.proposalId=e.proposalId??0,t.voter=e.voter??"",t.options=((n=e.options)==null?void 0:n.map(p=>WeightedVoteOption$1.fromPartial(p)))||[],t.metadata=e.metadata??"",t}};function createBaseMsgDeposit$1(){return{proposalId:0,depositor:"",amount:[]}}const MsgDeposit$1={encode(e,t=_m0.Writer.create()){e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.depositor!==""&&t.uint32(18).string(e.depositor);for(const n of e.amount)Coin$6.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgDeposit$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$F(n.uint64());break;case 2:u.depositor=n.string();break;case 3:u.amount.push(Coin$6.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$19(e.proposalId)?Number(e.proposalId):0,depositor:isSet$19(e.depositor)?String(e.depositor):"",amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$6.fromJSON(t)):[]}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.depositor!==void 0&&(t.depositor=e.depositor),e.amount?t.amount=e.amount.map(n=>n?Coin$6.toJSON(n):void 0):t.amount=[],t},fromPartial(e){var n;const t=createBaseMsgDeposit$1();return t.proposalId=e.proposalId??0,t.depositor=e.depositor??"",t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$6.fromPartial(p)))||[],t}};function createBaseMsgUpdateParams(){return{authority:"",params:void 0}}const MsgUpdateParams={encode(e,t=_m0.Writer.create()){return e.authority!==""&&t.uint32(10).string(e.authority),e.params!==void 0&&Params$a.encode(e.params,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateParams();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.authority=n.string();break;case 2:u.params=Params$a.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{authority:isSet$19(e.authority)?String(e.authority):"",params:isSet$19(e.params)?Params$a.fromJSON(e.params):void 0}},toJSON(e){const t={};return e.authority!==void 0&&(t.authority=e.authority),e.params!==void 0&&(t.params=e.params?Params$a.toJSON(e.params):void 0),t},fromPartial(e){const t=createBaseMsgUpdateParams();return t.authority=e.authority??"",t.params=e.params!==void 0&&e.params!==null?Params$a.fromPartial(e.params):void 0,t}};var globalThis$11=(()=>{if(typeof globalThis$11<"u")return globalThis$11;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$F(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$11.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$19(e){return e!=null}const msgTypes$i=[["/cosmos.gov.v1.MsgVote",MsgVote$2],["/cosmos.gov.v1.MsgVoteWeighted",MsgVoteWeighted$1],["/cosmos.gov.v1.MsgSubmitProposal",MsgSubmitProposal$2],["/cosmos.gov.v1.MsgUpdateParams",MsgUpdateParams],["/cosmos.gov.v1.MsgDeposit",MsgDeposit$1]];let HttpClient$i=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$i=class extends HttpClient$i{constructor(){super(...arguments),this.queryParams=(t,n={})=>this.request({path:`/cosmos/gov/v1/params/${t}`,method:"GET",format:"json",...n}),this.queryProposals=(t,n={})=>this.request({path:"/cosmos/gov/v1/proposals",method:"GET",query:t,format:"json",...n}),this.queryProposal=(t,n={})=>this.request({path:`/cosmos/gov/v1/proposals/${t}`,method:"GET",format:"json",...n}),this.queryDeposits=(t,n,p={})=>this.request({path:`/cosmos/gov/v1/proposals/${t}/deposits`,method:"GET",query:n,format:"json",...p}),this.queryDeposit=(t,n,p={})=>this.request({path:`/cosmos/gov/v1/proposals/${t}/deposits/${n}`,method:"GET",format:"json",...p}),this.queryTallyResult=(t,n={})=>this.request({path:`/cosmos/gov/v1/proposals/${t}/tally`,method:"GET",format:"json",...n}),this.queryVotes=(t,n,p={})=>this.request({path:`/cosmos/gov/v1/proposals/${t}/votes`,method:"GET",query:n,format:"json",...p}),this.queryVote=(t,n,p={})=>this.request({path:`/cosmos/gov/v1/proposals/${t}/votes/${n}`,method:"GET",format:"json",...p})}};const registry$9=new build$b.Registry(msgTypes$i);function getStructure$i(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$8={amount:[],gas:"200000"},txClient$i=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgVote({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgVote: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$9,prefix:t});let N=this.msgVote({value:MsgVote$2.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$8,g)}catch(y){throw new Error("TxClient:sendMsgVote: Could not broadcast Tx: "+y.message)}},async sendMsgVoteWeighted({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgVoteWeighted: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$9,prefix:t});let N=this.msgVoteWeighted({value:MsgVoteWeighted$1.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$8,g)}catch(y){throw new Error("TxClient:sendMsgVoteWeighted: Could not broadcast Tx: "+y.message)}},async sendMsgSubmitProposal({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgSubmitProposal: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$9,prefix:t});let N=this.msgSubmitProposal({value:MsgSubmitProposal$2.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$8,g)}catch(y){throw new Error("TxClient:sendMsgSubmitProposal: Could not broadcast Tx: "+y.message)}},async sendMsgUpdateParams({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateParams: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$9,prefix:t});let N=this.msgUpdateParams({value:MsgUpdateParams.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$8,g)}catch(y){throw new Error("TxClient:sendMsgUpdateParams: Could not broadcast Tx: "+y.message)}},async sendMsgDeposit({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgDeposit: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$9,prefix:t});let N=this.msgDeposit({value:MsgDeposit$1.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$8,g)}catch(y){throw new Error("TxClient:sendMsgDeposit: Could not broadcast Tx: "+y.message)}},msgVote({value:p}){try{return{typeUrl:"/cosmos.gov.v1.MsgVote",value:MsgVote$2.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgVote: Could not create message: "+u.message)}},msgVoteWeighted({value:p}){try{return{typeUrl:"/cosmos.gov.v1.MsgVoteWeighted",value:MsgVoteWeighted$1.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgVoteWeighted: Could not create message: "+u.message)}},msgSubmitProposal({value:p}){try{return{typeUrl:"/cosmos.gov.v1.MsgSubmitProposal",value:MsgSubmitProposal$2.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgSubmitProposal: Could not create message: "+u.message)}},msgUpdateParams({value:p}){try{return{typeUrl:"/cosmos.gov.v1.MsgUpdateParams",value:MsgUpdateParams.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateParams: Could not create message: "+u.message)}},msgDeposit({value:p}){try{return{typeUrl:"/cosmos.gov.v1.MsgDeposit",value:MsgDeposit$1.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgDeposit: Could not create message: "+u.message)}}}),queryClient$i=({addr:e}={addr:"http://localhost:1317"})=>new Api$i({baseURL:e});let SDKModule$i=class{constructor(t){this.registry=[],this.query=queryClient$i({addr:t.env.apiURL}),this.updateTX(t),this.structure={WeightedVoteOption:getStructure$i(WeightedVoteOption$1.fromPartial({})),Deposit:getStructure$i(Deposit$1.fromPartial({})),Proposal:getStructure$i(Proposal$2.fromPartial({})),TallyResult:getStructure$i(TallyResult$2.fromPartial({})),Vote:getStructure$i(Vote$2.fromPartial({})),DepositParams:getStructure$i(DepositParams$1.fromPartial({})),VotingParams:getStructure$i(VotingParams$1.fromPartial({})),TallyParams:getStructure$i(TallyParams$1.fromPartial({})),Params:getStructure$i(Params$a.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$i({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$i=e=>({module:{CosmosGovV1:new SDKModule$i(e)},registry:msgTypes$i});function createBaseAny$7(){return{typeUrl:"",value:new Uint8Array}}const Any$7={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$7();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$18(e.typeUrl)?String(e.typeUrl):"",value:isSet$18(e.value)?bytesFromBase64$k(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$k(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$7();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$10=(()=>{if(typeof globalThis$10<"u")return globalThis$10;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$k(e){if(globalThis$10.Buffer)return Uint8Array.from(globalThis$10.Buffer.from(e,"base64"));{const t=globalThis$10.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$k(e){if(globalThis$10.Buffer)return globalThis$10.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$10.btoa(t.join(""))}}function isSet$18(e){return e!=null}function createBaseCoin$5(){return{denom:"",amount:""}}const Coin$5={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin$5();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$17(e.denom)?String(e.denom):"",amount:isSet$17(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin$5();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$17(e){return e!=null}function createBaseDuration$3(){return{seconds:0,nanos:0}}const Duration$3={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDuration$3();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$E(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$16(e.seconds)?Number(e.seconds):0,nanos:isSet$16(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseDuration$3();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$$=(()=>{if(typeof globalThis$$<"u")return globalThis$$;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$E(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$$.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$16(e){return e!=null}function createBaseTimestamp$5(){return{seconds:0,nanos:0}}const Timestamp$5={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp$5();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$D(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$15(e.seconds)?Number(e.seconds):0,nanos:isSet$15(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp$5();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$_=(()=>{if(typeof globalThis$_<"u")return globalThis$_;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$D(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$_.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$15(e){return e!=null}function voteOptionFromJSON$1(e){switch(e){case 0:case"VOTE_OPTION_UNSPECIFIED":return 0;case 1:case"VOTE_OPTION_YES":return 1;case 2:case"VOTE_OPTION_ABSTAIN":return 2;case 3:case"VOTE_OPTION_NO":return 3;case 4:case"VOTE_OPTION_NO_WITH_VETO":return 4;case-1:case"UNRECOGNIZED":default:return-1}}function voteOptionToJSON$1(e){switch(e){case 0:return"VOTE_OPTION_UNSPECIFIED";case 1:return"VOTE_OPTION_YES";case 2:return"VOTE_OPTION_ABSTAIN";case 3:return"VOTE_OPTION_NO";case 4:return"VOTE_OPTION_NO_WITH_VETO";case-1:default:return"UNRECOGNIZED"}}function proposalStatusFromJSON$1(e){switch(e){case 0:case"PROPOSAL_STATUS_UNSPECIFIED":return 0;case 1:case"PROPOSAL_STATUS_DEPOSIT_PERIOD":return 1;case 2:case"PROPOSAL_STATUS_VOTING_PERIOD":return 2;case 3:case"PROPOSAL_STATUS_PASSED":return 3;case 4:case"PROPOSAL_STATUS_REJECTED":return 4;case 5:case"PROPOSAL_STATUS_FAILED":return 5;case-1:case"UNRECOGNIZED":default:return-1}}function proposalStatusToJSON$1(e){switch(e){case 0:return"PROPOSAL_STATUS_UNSPECIFIED";case 1:return"PROPOSAL_STATUS_DEPOSIT_PERIOD";case 2:return"PROPOSAL_STATUS_VOTING_PERIOD";case 3:return"PROPOSAL_STATUS_PASSED";case 4:return"PROPOSAL_STATUS_REJECTED";case 5:return"PROPOSAL_STATUS_FAILED";case-1:default:return"UNRECOGNIZED"}}function createBaseWeightedVoteOption(){return{option:0,weight:""}}const WeightedVoteOption={encode(e,t=_m0.Writer.create()){return e.option!==0&&t.uint32(8).int32(e.option),e.weight!==""&&t.uint32(18).string(e.weight),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseWeightedVoteOption();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.option=n.int32();break;case 2:u.weight=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{option:isSet$14(e.option)?voteOptionFromJSON$1(e.option):0,weight:isSet$14(e.weight)?String(e.weight):""}},toJSON(e){const t={};return e.option!==void 0&&(t.option=voteOptionToJSON$1(e.option)),e.weight!==void 0&&(t.weight=e.weight),t},fromPartial(e){const t=createBaseWeightedVoteOption();return t.option=e.option??0,t.weight=e.weight??"",t}};function createBaseTextProposal(){return{title:"",description:""}}const TextProposal={encode(e,t=_m0.Writer.create()){return e.title!==""&&t.uint32(10).string(e.title),e.description!==""&&t.uint32(18).string(e.description),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTextProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.title=n.string();break;case 2:u.description=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{title:isSet$14(e.title)?String(e.title):"",description:isSet$14(e.description)?String(e.description):""}},toJSON(e){const t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),t},fromPartial(e){const t=createBaseTextProposal();return t.title=e.title??"",t.description=e.description??"",t}};function createBaseDeposit(){return{proposalId:0,depositor:"",amount:[]}}const Deposit={encode(e,t=_m0.Writer.create()){e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.depositor!==""&&t.uint32(18).string(e.depositor);for(const n of e.amount)Coin$5.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDeposit();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$C(n.uint64());break;case 2:u.depositor=n.string();break;case 3:u.amount.push(Coin$5.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$14(e.proposalId)?Number(e.proposalId):0,depositor:isSet$14(e.depositor)?String(e.depositor):"",amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$5.fromJSON(t)):[]}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.depositor!==void 0&&(t.depositor=e.depositor),e.amount?t.amount=e.amount.map(n=>n?Coin$5.toJSON(n):void 0):t.amount=[],t},fromPartial(e){var n;const t=createBaseDeposit();return t.proposalId=e.proposalId??0,t.depositor=e.depositor??"",t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$5.fromPartial(p)))||[],t}};function createBaseProposal$1(){return{proposalId:0,content:void 0,status:0,finalTallyResult:void 0,submitTime:void 0,depositEndTime:void 0,totalDeposit:[],votingStartTime:void 0,votingEndTime:void 0}}const Proposal$1={encode(e,t=_m0.Writer.create()){e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.content!==void 0&&Any$7.encode(e.content,t.uint32(18).fork()).ldelim(),e.status!==0&&t.uint32(24).int32(e.status),e.finalTallyResult!==void 0&&TallyResult$1.encode(e.finalTallyResult,t.uint32(34).fork()).ldelim(),e.submitTime!==void 0&&Timestamp$5.encode(toTimestamp$6(e.submitTime),t.uint32(42).fork()).ldelim(),e.depositEndTime!==void 0&&Timestamp$5.encode(toTimestamp$6(e.depositEndTime),t.uint32(50).fork()).ldelim();for(const n of e.totalDeposit)Coin$5.encode(n,t.uint32(58).fork()).ldelim();return e.votingStartTime!==void 0&&Timestamp$5.encode(toTimestamp$6(e.votingStartTime),t.uint32(66).fork()).ldelim(),e.votingEndTime!==void 0&&Timestamp$5.encode(toTimestamp$6(e.votingEndTime),t.uint32(74).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseProposal$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$C(n.uint64());break;case 2:u.content=Any$7.decode(n,n.uint32());break;case 3:u.status=n.int32();break;case 4:u.finalTallyResult=TallyResult$1.decode(n,n.uint32());break;case 5:u.submitTime=fromTimestamp$6(Timestamp$5.decode(n,n.uint32()));break;case 6:u.depositEndTime=fromTimestamp$6(Timestamp$5.decode(n,n.uint32()));break;case 7:u.totalDeposit.push(Coin$5.decode(n,n.uint32()));break;case 8:u.votingStartTime=fromTimestamp$6(Timestamp$5.decode(n,n.uint32()));break;case 9:u.votingEndTime=fromTimestamp$6(Timestamp$5.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$14(e.proposalId)?Number(e.proposalId):0,content:isSet$14(e.content)?Any$7.fromJSON(e.content):void 0,status:isSet$14(e.status)?proposalStatusFromJSON$1(e.status):0,finalTallyResult:isSet$14(e.finalTallyResult)?TallyResult$1.fromJSON(e.finalTallyResult):void 0,submitTime:isSet$14(e.submitTime)?fromJsonTimestamp$6(e.submitTime):void 0,depositEndTime:isSet$14(e.depositEndTime)?fromJsonTimestamp$6(e.depositEndTime):void 0,totalDeposit:Array.isArray(e==null?void 0:e.totalDeposit)?e.totalDeposit.map(t=>Coin$5.fromJSON(t)):[],votingStartTime:isSet$14(e.votingStartTime)?fromJsonTimestamp$6(e.votingStartTime):void 0,votingEndTime:isSet$14(e.votingEndTime)?fromJsonTimestamp$6(e.votingEndTime):void 0}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.content!==void 0&&(t.content=e.content?Any$7.toJSON(e.content):void 0),e.status!==void 0&&(t.status=proposalStatusToJSON$1(e.status)),e.finalTallyResult!==void 0&&(t.finalTallyResult=e.finalTallyResult?TallyResult$1.toJSON(e.finalTallyResult):void 0),e.submitTime!==void 0&&(t.submitTime=e.submitTime.toISOString()),e.depositEndTime!==void 0&&(t.depositEndTime=e.depositEndTime.toISOString()),e.totalDeposit?t.totalDeposit=e.totalDeposit.map(n=>n?Coin$5.toJSON(n):void 0):t.totalDeposit=[],e.votingStartTime!==void 0&&(t.votingStartTime=e.votingStartTime.toISOString()),e.votingEndTime!==void 0&&(t.votingEndTime=e.votingEndTime.toISOString()),t},fromPartial(e){var n;const t=createBaseProposal$1();return t.proposalId=e.proposalId??0,t.content=e.content!==void 0&&e.content!==null?Any$7.fromPartial(e.content):void 0,t.status=e.status??0,t.finalTallyResult=e.finalTallyResult!==void 0&&e.finalTallyResult!==null?TallyResult$1.fromPartial(e.finalTallyResult):void 0,t.submitTime=e.submitTime??void 0,t.depositEndTime=e.depositEndTime??void 0,t.totalDeposit=((n=e.totalDeposit)==null?void 0:n.map(p=>Coin$5.fromPartial(p)))||[],t.votingStartTime=e.votingStartTime??void 0,t.votingEndTime=e.votingEndTime??void 0,t}};function createBaseTallyResult$1(){return{yes:"",abstain:"",no:"",noWithVeto:""}}const TallyResult$1={encode(e,t=_m0.Writer.create()){return e.yes!==""&&t.uint32(10).string(e.yes),e.abstain!==""&&t.uint32(18).string(e.abstain),e.no!==""&&t.uint32(26).string(e.no),e.noWithVeto!==""&&t.uint32(34).string(e.noWithVeto),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTallyResult$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.yes=n.string();break;case 2:u.abstain=n.string();break;case 3:u.no=n.string();break;case 4:u.noWithVeto=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{yes:isSet$14(e.yes)?String(e.yes):"",abstain:isSet$14(e.abstain)?String(e.abstain):"",no:isSet$14(e.no)?String(e.no):"",noWithVeto:isSet$14(e.noWithVeto)?String(e.noWithVeto):""}},toJSON(e){const t={};return e.yes!==void 0&&(t.yes=e.yes),e.abstain!==void 0&&(t.abstain=e.abstain),e.no!==void 0&&(t.no=e.no),e.noWithVeto!==void 0&&(t.noWithVeto=e.noWithVeto),t},fromPartial(e){const t=createBaseTallyResult$1();return t.yes=e.yes??"",t.abstain=e.abstain??"",t.no=e.no??"",t.noWithVeto=e.noWithVeto??"",t}};function createBaseVote$1(){return{proposalId:0,voter:"",option:0,options:[]}}const Vote$1={encode(e,t=_m0.Writer.create()){e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.voter!==""&&t.uint32(18).string(e.voter),e.option!==0&&t.uint32(24).int32(e.option);for(const n of e.options)WeightedVoteOption.encode(n,t.uint32(34).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseVote$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$C(n.uint64());break;case 2:u.voter=n.string();break;case 3:u.option=n.int32();break;case 4:u.options.push(WeightedVoteOption.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$14(e.proposalId)?Number(e.proposalId):0,voter:isSet$14(e.voter)?String(e.voter):"",option:isSet$14(e.option)?voteOptionFromJSON$1(e.option):0,options:Array.isArray(e==null?void 0:e.options)?e.options.map(t=>WeightedVoteOption.fromJSON(t)):[]}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.voter!==void 0&&(t.voter=e.voter),e.option!==void 0&&(t.option=voteOptionToJSON$1(e.option)),e.options?t.options=e.options.map(n=>n?WeightedVoteOption.toJSON(n):void 0):t.options=[],t},fromPartial(e){var n;const t=createBaseVote$1();return t.proposalId=e.proposalId??0,t.voter=e.voter??"",t.option=e.option??0,t.options=((n=e.options)==null?void 0:n.map(p=>WeightedVoteOption.fromPartial(p)))||[],t}};function createBaseDepositParams(){return{minDeposit:[],maxDepositPeriod:void 0}}const DepositParams={encode(e,t=_m0.Writer.create()){for(const n of e.minDeposit)Coin$5.encode(n,t.uint32(10).fork()).ldelim();return e.maxDepositPeriod!==void 0&&Duration$3.encode(e.maxDepositPeriod,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDepositParams();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.minDeposit.push(Coin$5.decode(n,n.uint32()));break;case 2:u.maxDepositPeriod=Duration$3.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{minDeposit:Array.isArray(e==null?void 0:e.minDeposit)?e.minDeposit.map(t=>Coin$5.fromJSON(t)):[],maxDepositPeriod:isSet$14(e.maxDepositPeriod)?Duration$3.fromJSON(e.maxDepositPeriod):void 0}},toJSON(e){const t={};return e.minDeposit?t.minDeposit=e.minDeposit.map(n=>n?Coin$5.toJSON(n):void 0):t.minDeposit=[],e.maxDepositPeriod!==void 0&&(t.maxDepositPeriod=e.maxDepositPeriod?Duration$3.toJSON(e.maxDepositPeriod):void 0),t},fromPartial(e){var n;const t=createBaseDepositParams();return t.minDeposit=((n=e.minDeposit)==null?void 0:n.map(p=>Coin$5.fromPartial(p)))||[],t.maxDepositPeriod=e.maxDepositPeriod!==void 0&&e.maxDepositPeriod!==null?Duration$3.fromPartial(e.maxDepositPeriod):void 0,t}};function createBaseVotingParams(){return{votingPeriod:void 0}}const VotingParams={encode(e,t=_m0.Writer.create()){return e.votingPeriod!==void 0&&Duration$3.encode(e.votingPeriod,t.uint32(10).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseVotingParams();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.votingPeriod=Duration$3.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{votingPeriod:isSet$14(e.votingPeriod)?Duration$3.fromJSON(e.votingPeriod):void 0}},toJSON(e){const t={};return e.votingPeriod!==void 0&&(t.votingPeriod=e.votingPeriod?Duration$3.toJSON(e.votingPeriod):void 0),t},fromPartial(e){const t=createBaseVotingParams();return t.votingPeriod=e.votingPeriod!==void 0&&e.votingPeriod!==null?Duration$3.fromPartial(e.votingPeriod):void 0,t}};function createBaseTallyParams(){return{quorum:new Uint8Array,threshold:new Uint8Array,vetoThreshold:new Uint8Array}}const TallyParams={encode(e,t=_m0.Writer.create()){return e.quorum.length!==0&&t.uint32(10).bytes(e.quorum),e.threshold.length!==0&&t.uint32(18).bytes(e.threshold),e.vetoThreshold.length!==0&&t.uint32(26).bytes(e.vetoThreshold),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTallyParams();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.quorum=n.bytes();break;case 2:u.threshold=n.bytes();break;case 3:u.vetoThreshold=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{quorum:isSet$14(e.quorum)?bytesFromBase64$j(e.quorum):new Uint8Array,threshold:isSet$14(e.threshold)?bytesFromBase64$j(e.threshold):new Uint8Array,vetoThreshold:isSet$14(e.vetoThreshold)?bytesFromBase64$j(e.vetoThreshold):new Uint8Array}},toJSON(e){const t={};return e.quorum!==void 0&&(t.quorum=base64FromBytes$j(e.quorum!==void 0?e.quorum:new Uint8Array)),e.threshold!==void 0&&(t.threshold=base64FromBytes$j(e.threshold!==void 0?e.threshold:new Uint8Array)),e.vetoThreshold!==void 0&&(t.vetoThreshold=base64FromBytes$j(e.vetoThreshold!==void 0?e.vetoThreshold:new Uint8Array)),t},fromPartial(e){const t=createBaseTallyParams();return t.quorum=e.quorum??new Uint8Array,t.threshold=e.threshold??new Uint8Array,t.vetoThreshold=e.vetoThreshold??new Uint8Array,t}};var globalThis$Z=(()=>{if(typeof globalThis$Z<"u")return globalThis$Z;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$j(e){if(globalThis$Z.Buffer)return Uint8Array.from(globalThis$Z.Buffer.from(e,"base64"));{const t=globalThis$Z.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$j(e){if(globalThis$Z.Buffer)return globalThis$Z.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$Z.btoa(t.join(""))}}function toTimestamp$6(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$6(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$6(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$6(Timestamp$5.fromJSON(e))}function longToNumber$C(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$Z.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$14(e){return e!=null}function createBaseMsgSubmitProposal$1(){return{content:void 0,initialDeposit:[],proposer:""}}const MsgSubmitProposal$1={encode(e,t=_m0.Writer.create()){e.content!==void 0&&Any$7.encode(e.content,t.uint32(10).fork()).ldelim();for(const n of e.initialDeposit)Coin$5.encode(n,t.uint32(18).fork()).ldelim();return e.proposer!==""&&t.uint32(26).string(e.proposer),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgSubmitProposal$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.content=Any$7.decode(n,n.uint32());break;case 2:u.initialDeposit.push(Coin$5.decode(n,n.uint32()));break;case 3:u.proposer=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{content:isSet$13(e.content)?Any$7.fromJSON(e.content):void 0,initialDeposit:Array.isArray(e==null?void 0:e.initialDeposit)?e.initialDeposit.map(t=>Coin$5.fromJSON(t)):[],proposer:isSet$13(e.proposer)?String(e.proposer):""}},toJSON(e){const t={};return e.content!==void 0&&(t.content=e.content?Any$7.toJSON(e.content):void 0),e.initialDeposit?t.initialDeposit=e.initialDeposit.map(n=>n?Coin$5.toJSON(n):void 0):t.initialDeposit=[],e.proposer!==void 0&&(t.proposer=e.proposer),t},fromPartial(e){var n;const t=createBaseMsgSubmitProposal$1();return t.content=e.content!==void 0&&e.content!==null?Any$7.fromPartial(e.content):void 0,t.initialDeposit=((n=e.initialDeposit)==null?void 0:n.map(p=>Coin$5.fromPartial(p)))||[],t.proposer=e.proposer??"",t}};function createBaseMsgVote$1(){return{proposalId:0,voter:"",option:0}}const MsgVote$1={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.voter!==""&&t.uint32(18).string(e.voter),e.option!==0&&t.uint32(24).int32(e.option),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgVote$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$B(n.uint64());break;case 2:u.voter=n.string();break;case 3:u.option=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$13(e.proposalId)?Number(e.proposalId):0,voter:isSet$13(e.voter)?String(e.voter):"",option:isSet$13(e.option)?voteOptionFromJSON$1(e.option):0}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.voter!==void 0&&(t.voter=e.voter),e.option!==void 0&&(t.option=voteOptionToJSON$1(e.option)),t},fromPartial(e){const t=createBaseMsgVote$1();return t.proposalId=e.proposalId??0,t.voter=e.voter??"",t.option=e.option??0,t}};function createBaseMsgVoteWeighted(){return{proposalId:0,voter:"",options:[]}}const MsgVoteWeighted={encode(e,t=_m0.Writer.create()){e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.voter!==""&&t.uint32(18).string(e.voter);for(const n of e.options)WeightedVoteOption.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgVoteWeighted();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$B(n.uint64());break;case 2:u.voter=n.string();break;case 3:u.options.push(WeightedVoteOption.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$13(e.proposalId)?Number(e.proposalId):0,voter:isSet$13(e.voter)?String(e.voter):"",options:Array.isArray(e==null?void 0:e.options)?e.options.map(t=>WeightedVoteOption.fromJSON(t)):[]}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.voter!==void 0&&(t.voter=e.voter),e.options?t.options=e.options.map(n=>n?WeightedVoteOption.toJSON(n):void 0):t.options=[],t},fromPartial(e){var n;const t=createBaseMsgVoteWeighted();return t.proposalId=e.proposalId??0,t.voter=e.voter??"",t.options=((n=e.options)==null?void 0:n.map(p=>WeightedVoteOption.fromPartial(p)))||[],t}};function createBaseMsgDeposit(){return{proposalId:0,depositor:"",amount:[]}}const MsgDeposit={encode(e,t=_m0.Writer.create()){e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.depositor!==""&&t.uint32(18).string(e.depositor);for(const n of e.amount)Coin$5.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgDeposit();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$B(n.uint64());break;case 2:u.depositor=n.string();break;case 3:u.amount.push(Coin$5.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$13(e.proposalId)?Number(e.proposalId):0,depositor:isSet$13(e.depositor)?String(e.depositor):"",amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$5.fromJSON(t)):[]}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.depositor!==void 0&&(t.depositor=e.depositor),e.amount?t.amount=e.amount.map(n=>n?Coin$5.toJSON(n):void 0):t.amount=[],t},fromPartial(e){var n;const t=createBaseMsgDeposit();return t.proposalId=e.proposalId??0,t.depositor=e.depositor??"",t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$5.fromPartial(p)))||[],t}};var globalThis$Y=(()=>{if(typeof globalThis$Y<"u")return globalThis$Y;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$B(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$Y.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$13(e){return e!=null}const msgTypes$h=[["/cosmos.gov.v1beta1.MsgSubmitProposal",MsgSubmitProposal$1],["/cosmos.gov.v1beta1.MsgVote",MsgVote$1],["/cosmos.gov.v1beta1.MsgVoteWeighted",MsgVoteWeighted],["/cosmos.gov.v1beta1.MsgDeposit",MsgDeposit]];let HttpClient$h=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$h=class extends HttpClient$h{constructor(){super(...arguments),this.queryParams=(t,n={})=>this.request({path:`/cosmos/gov/v1beta1/params/${t}`,method:"GET",format:"json",...n}),this.queryProposals=(t,n={})=>this.request({path:"/cosmos/gov/v1beta1/proposals",method:"GET",query:t,format:"json",...n}),this.queryProposal=(t,n={})=>this.request({path:`/cosmos/gov/v1beta1/proposals/${t}`,method:"GET",format:"json",...n}),this.queryDeposits=(t,n,p={})=>this.request({path:`/cosmos/gov/v1beta1/proposals/${t}/deposits`,method:"GET",query:n,format:"json",...p}),this.queryDeposit=(t,n,p={})=>this.request({path:`/cosmos/gov/v1beta1/proposals/${t}/deposits/${n}`,method:"GET",format:"json",...p}),this.queryTallyResult=(t,n={})=>this.request({path:`/cosmos/gov/v1beta1/proposals/${t}/tally`,method:"GET",format:"json",...n}),this.queryVotes=(t,n,p={})=>this.request({path:`/cosmos/gov/v1beta1/proposals/${t}/votes`,method:"GET",query:n,format:"json",...p}),this.queryVote=(t,n,p={})=>this.request({path:`/cosmos/gov/v1beta1/proposals/${t}/votes/${n}`,method:"GET",format:"json",...p})}};const registry$8=new build$b.Registry(msgTypes$h);function getStructure$h(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$7={amount:[],gas:"200000"},txClient$h=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgSubmitProposal({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgSubmitProposal: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$8,prefix:t});let N=this.msgSubmitProposal({value:MsgSubmitProposal$1.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$7,g)}catch(y){throw new Error("TxClient:sendMsgSubmitProposal: Could not broadcast Tx: "+y.message)}},async sendMsgVote({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgVote: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$8,prefix:t});let N=this.msgVote({value:MsgVote$1.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$7,g)}catch(y){throw new Error("TxClient:sendMsgVote: Could not broadcast Tx: "+y.message)}},async sendMsgVoteWeighted({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgVoteWeighted: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$8,prefix:t});let N=this.msgVoteWeighted({value:MsgVoteWeighted.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$7,g)}catch(y){throw new Error("TxClient:sendMsgVoteWeighted: Could not broadcast Tx: "+y.message)}},async sendMsgDeposit({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgDeposit: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$8,prefix:t});let N=this.msgDeposit({value:MsgDeposit.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$7,g)}catch(y){throw new Error("TxClient:sendMsgDeposit: Could not broadcast Tx: "+y.message)}},msgSubmitProposal({value:p}){try{return{typeUrl:"/cosmos.gov.v1beta1.MsgSubmitProposal",value:MsgSubmitProposal$1.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgSubmitProposal: Could not create message: "+u.message)}},msgVote({value:p}){try{return{typeUrl:"/cosmos.gov.v1beta1.MsgVote",value:MsgVote$1.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgVote: Could not create message: "+u.message)}},msgVoteWeighted({value:p}){try{return{typeUrl:"/cosmos.gov.v1beta1.MsgVoteWeighted",value:MsgVoteWeighted.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgVoteWeighted: Could not create message: "+u.message)}},msgDeposit({value:p}){try{return{typeUrl:"/cosmos.gov.v1beta1.MsgDeposit",value:MsgDeposit.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgDeposit: Could not create message: "+u.message)}}}),queryClient$h=({addr:e}={addr:"http://localhost:1317"})=>new Api$h({baseURL:e});let SDKModule$h=class{constructor(t){this.registry=[],this.query=queryClient$h({addr:t.env.apiURL}),this.updateTX(t),this.structure={WeightedVoteOption:getStructure$h(WeightedVoteOption.fromPartial({})),TextProposal:getStructure$h(TextProposal.fromPartial({})),Deposit:getStructure$h(Deposit.fromPartial({})),Proposal:getStructure$h(Proposal$1.fromPartial({})),TallyResult:getStructure$h(TallyResult$1.fromPartial({})),Vote:getStructure$h(Vote$1.fromPartial({})),DepositParams:getStructure$h(DepositParams.fromPartial({})),VotingParams:getStructure$h(VotingParams.fromPartial({})),TallyParams:getStructure$h(TallyParams.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$h({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$h=e=>({module:{CosmosGovV1Beta1:new SDKModule$h(e)},registry:msgTypes$h});function createBaseAny$6(){return{typeUrl:"",value:new Uint8Array}}const Any$6={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$6();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$12(e.typeUrl)?String(e.typeUrl):"",value:isSet$12(e.value)?bytesFromBase64$i(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$i(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$6();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$X=(()=>{if(typeof globalThis$X<"u")return globalThis$X;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$i(e){if(globalThis$X.Buffer)return Uint8Array.from(globalThis$X.Buffer.from(e,"base64"));{const t=globalThis$X.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$i(e){if(globalThis$X.Buffer)return globalThis$X.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$X.btoa(t.join(""))}}function isSet$12(e){return e!=null}function createBaseDuration$2(){return{seconds:0,nanos:0}}const Duration$2={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDuration$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$A(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$11(e.seconds)?Number(e.seconds):0,nanos:isSet$11(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseDuration$2();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$W=(()=>{if(typeof globalThis$W<"u")return globalThis$W;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$A(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$W.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$11(e){return e!=null}function createBaseTimestamp$4(){return{seconds:0,nanos:0}}const Timestamp$4={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp$4();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$z(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$10(e.seconds)?Number(e.seconds):0,nanos:isSet$10(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp$4();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$V=(()=>{if(typeof globalThis$V<"u")return globalThis$V;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$z(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$V.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$10(e){return e!=null}function voteOptionFromJSON(e){switch(e){case 0:case"VOTE_OPTION_UNSPECIFIED":return 0;case 1:case"VOTE_OPTION_YES":return 1;case 2:case"VOTE_OPTION_ABSTAIN":return 2;case 3:case"VOTE_OPTION_NO":return 3;case 4:case"VOTE_OPTION_NO_WITH_VETO":return 4;case-1:case"UNRECOGNIZED":default:return-1}}function voteOptionToJSON(e){switch(e){case 0:return"VOTE_OPTION_UNSPECIFIED";case 1:return"VOTE_OPTION_YES";case 2:return"VOTE_OPTION_ABSTAIN";case 3:return"VOTE_OPTION_NO";case 4:return"VOTE_OPTION_NO_WITH_VETO";case-1:default:return"UNRECOGNIZED"}}function proposalStatusFromJSON(e){switch(e){case 0:case"PROPOSAL_STATUS_UNSPECIFIED":return 0;case 1:case"PROPOSAL_STATUS_SUBMITTED":return 1;case 2:case"PROPOSAL_STATUS_ACCEPTED":return 2;case 3:case"PROPOSAL_STATUS_REJECTED":return 3;case 4:case"PROPOSAL_STATUS_ABORTED":return 4;case 5:case"PROPOSAL_STATUS_WITHDRAWN":return 5;case-1:case"UNRECOGNIZED":default:return-1}}function proposalStatusToJSON(e){switch(e){case 0:return"PROPOSAL_STATUS_UNSPECIFIED";case 1:return"PROPOSAL_STATUS_SUBMITTED";case 2:return"PROPOSAL_STATUS_ACCEPTED";case 3:return"PROPOSAL_STATUS_REJECTED";case 4:return"PROPOSAL_STATUS_ABORTED";case 5:return"PROPOSAL_STATUS_WITHDRAWN";case-1:default:return"UNRECOGNIZED"}}function proposalExecutorResultFromJSON(e){switch(e){case 0:case"PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED":return 0;case 1:case"PROPOSAL_EXECUTOR_RESULT_NOT_RUN":return 1;case 2:case"PROPOSAL_EXECUTOR_RESULT_SUCCESS":return 2;case 3:case"PROPOSAL_EXECUTOR_RESULT_FAILURE":return 3;case-1:case"UNRECOGNIZED":default:return-1}}function proposalExecutorResultToJSON(e){switch(e){case 0:return"PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED";case 1:return"PROPOSAL_EXECUTOR_RESULT_NOT_RUN";case 2:return"PROPOSAL_EXECUTOR_RESULT_SUCCESS";case 3:return"PROPOSAL_EXECUTOR_RESULT_FAILURE";case-1:default:return"UNRECOGNIZED"}}function createBaseMember(){return{address:"",weight:"",metadata:"",addedAt:void 0}}const Member={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.weight!==""&&t.uint32(18).string(e.weight),e.metadata!==""&&t.uint32(26).string(e.metadata),e.addedAt!==void 0&&Timestamp$4.encode(toTimestamp$5(e.addedAt),t.uint32(34).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMember();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.weight=n.string();break;case 3:u.metadata=n.string();break;case 4:u.addedAt=fromTimestamp$5(Timestamp$4.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$$(e.address)?String(e.address):"",weight:isSet$$(e.weight)?String(e.weight):"",metadata:isSet$$(e.metadata)?String(e.metadata):"",addedAt:isSet$$(e.addedAt)?fromJsonTimestamp$5(e.addedAt):void 0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.weight!==void 0&&(t.weight=e.weight),e.metadata!==void 0&&(t.metadata=e.metadata),e.addedAt!==void 0&&(t.addedAt=e.addedAt.toISOString()),t},fromPartial(e){const t=createBaseMember();return t.address=e.address??"",t.weight=e.weight??"",t.metadata=e.metadata??"",t.addedAt=e.addedAt??void 0,t}};function createBaseMemberRequest(){return{address:"",weight:"",metadata:""}}const MemberRequest={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.weight!==""&&t.uint32(18).string(e.weight),e.metadata!==""&&t.uint32(26).string(e.metadata),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMemberRequest();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.weight=n.string();break;case 3:u.metadata=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$$(e.address)?String(e.address):"",weight:isSet$$(e.weight)?String(e.weight):"",metadata:isSet$$(e.metadata)?String(e.metadata):""}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.weight!==void 0&&(t.weight=e.weight),e.metadata!==void 0&&(t.metadata=e.metadata),t},fromPartial(e){const t=createBaseMemberRequest();return t.address=e.address??"",t.weight=e.weight??"",t.metadata=e.metadata??"",t}};function createBaseThresholdDecisionPolicy(){return{threshold:"",windows:void 0}}const ThresholdDecisionPolicy={encode(e,t=_m0.Writer.create()){return e.threshold!==""&&t.uint32(10).string(e.threshold),e.windows!==void 0&&DecisionPolicyWindows.encode(e.windows,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseThresholdDecisionPolicy();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.threshold=n.string();break;case 2:u.windows=DecisionPolicyWindows.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{threshold:isSet$$(e.threshold)?String(e.threshold):"",windows:isSet$$(e.windows)?DecisionPolicyWindows.fromJSON(e.windows):void 0}},toJSON(e){const t={};return e.threshold!==void 0&&(t.threshold=e.threshold),e.windows!==void 0&&(t.windows=e.windows?DecisionPolicyWindows.toJSON(e.windows):void 0),t},fromPartial(e){const t=createBaseThresholdDecisionPolicy();return t.threshold=e.threshold??"",t.windows=e.windows!==void 0&&e.windows!==null?DecisionPolicyWindows.fromPartial(e.windows):void 0,t}};function createBasePercentageDecisionPolicy(){return{percentage:"",windows:void 0}}const PercentageDecisionPolicy={encode(e,t=_m0.Writer.create()){return e.percentage!==""&&t.uint32(10).string(e.percentage),e.windows!==void 0&&DecisionPolicyWindows.encode(e.windows,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePercentageDecisionPolicy();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.percentage=n.string();break;case 2:u.windows=DecisionPolicyWindows.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{percentage:isSet$$(e.percentage)?String(e.percentage):"",windows:isSet$$(e.windows)?DecisionPolicyWindows.fromJSON(e.windows):void 0}},toJSON(e){const t={};return e.percentage!==void 0&&(t.percentage=e.percentage),e.windows!==void 0&&(t.windows=e.windows?DecisionPolicyWindows.toJSON(e.windows):void 0),t},fromPartial(e){const t=createBasePercentageDecisionPolicy();return t.percentage=e.percentage??"",t.windows=e.windows!==void 0&&e.windows!==null?DecisionPolicyWindows.fromPartial(e.windows):void 0,t}};function createBaseDecisionPolicyWindows(){return{votingPeriod:void 0,minExecutionPeriod:void 0}}const DecisionPolicyWindows={encode(e,t=_m0.Writer.create()){return e.votingPeriod!==void 0&&Duration$2.encode(e.votingPeriod,t.uint32(10).fork()).ldelim(),e.minExecutionPeriod!==void 0&&Duration$2.encode(e.minExecutionPeriod,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDecisionPolicyWindows();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.votingPeriod=Duration$2.decode(n,n.uint32());break;case 2:u.minExecutionPeriod=Duration$2.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{votingPeriod:isSet$$(e.votingPeriod)?Duration$2.fromJSON(e.votingPeriod):void 0,minExecutionPeriod:isSet$$(e.minExecutionPeriod)?Duration$2.fromJSON(e.minExecutionPeriod):void 0}},toJSON(e){const t={};return e.votingPeriod!==void 0&&(t.votingPeriod=e.votingPeriod?Duration$2.toJSON(e.votingPeriod):void 0),e.minExecutionPeriod!==void 0&&(t.minExecutionPeriod=e.minExecutionPeriod?Duration$2.toJSON(e.minExecutionPeriod):void 0),t},fromPartial(e){const t=createBaseDecisionPolicyWindows();return t.votingPeriod=e.votingPeriod!==void 0&&e.votingPeriod!==null?Duration$2.fromPartial(e.votingPeriod):void 0,t.minExecutionPeriod=e.minExecutionPeriod!==void 0&&e.minExecutionPeriod!==null?Duration$2.fromPartial(e.minExecutionPeriod):void 0,t}};function createBaseGroupInfo(){return{id:0,admin:"",metadata:"",version:0,totalWeight:"",createdAt:void 0}}const GroupInfo={encode(e,t=_m0.Writer.create()){return e.id!==0&&t.uint32(8).uint64(e.id),e.admin!==""&&t.uint32(18).string(e.admin),e.metadata!==""&&t.uint32(26).string(e.metadata),e.version!==0&&t.uint32(32).uint64(e.version),e.totalWeight!==""&&t.uint32(42).string(e.totalWeight),e.createdAt!==void 0&&Timestamp$4.encode(toTimestamp$5(e.createdAt),t.uint32(50).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseGroupInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.id=longToNumber$y(n.uint64());break;case 2:u.admin=n.string();break;case 3:u.metadata=n.string();break;case 4:u.version=longToNumber$y(n.uint64());break;case 5:u.totalWeight=n.string();break;case 6:u.createdAt=fromTimestamp$5(Timestamp$4.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{id:isSet$$(e.id)?Number(e.id):0,admin:isSet$$(e.admin)?String(e.admin):"",metadata:isSet$$(e.metadata)?String(e.metadata):"",version:isSet$$(e.version)?Number(e.version):0,totalWeight:isSet$$(e.totalWeight)?String(e.totalWeight):"",createdAt:isSet$$(e.createdAt)?fromJsonTimestamp$5(e.createdAt):void 0}},toJSON(e){const t={};return e.id!==void 0&&(t.id=Math.round(e.id)),e.admin!==void 0&&(t.admin=e.admin),e.metadata!==void 0&&(t.metadata=e.metadata),e.version!==void 0&&(t.version=Math.round(e.version)),e.totalWeight!==void 0&&(t.totalWeight=e.totalWeight),e.createdAt!==void 0&&(t.createdAt=e.createdAt.toISOString()),t},fromPartial(e){const t=createBaseGroupInfo();return t.id=e.id??0,t.admin=e.admin??"",t.metadata=e.metadata??"",t.version=e.version??0,t.totalWeight=e.totalWeight??"",t.createdAt=e.createdAt??void 0,t}};function createBaseGroupMember(){return{groupId:0,member:void 0}}const GroupMember={encode(e,t=_m0.Writer.create()){return e.groupId!==0&&t.uint32(8).uint64(e.groupId),e.member!==void 0&&Member.encode(e.member,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseGroupMember();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.groupId=longToNumber$y(n.uint64());break;case 2:u.member=Member.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{groupId:isSet$$(e.groupId)?Number(e.groupId):0,member:isSet$$(e.member)?Member.fromJSON(e.member):void 0}},toJSON(e){const t={};return e.groupId!==void 0&&(t.groupId=Math.round(e.groupId)),e.member!==void 0&&(t.member=e.member?Member.toJSON(e.member):void 0),t},fromPartial(e){const t=createBaseGroupMember();return t.groupId=e.groupId??0,t.member=e.member!==void 0&&e.member!==null?Member.fromPartial(e.member):void 0,t}};function createBaseGroupPolicyInfo(){return{address:"",groupId:0,admin:"",metadata:"",version:0,decisionPolicy:void 0,createdAt:void 0}}const GroupPolicyInfo={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.groupId!==0&&t.uint32(16).uint64(e.groupId),e.admin!==""&&t.uint32(26).string(e.admin),e.metadata!==""&&t.uint32(34).string(e.metadata),e.version!==0&&t.uint32(40).uint64(e.version),e.decisionPolicy!==void 0&&Any$6.encode(e.decisionPolicy,t.uint32(50).fork()).ldelim(),e.createdAt!==void 0&&Timestamp$4.encode(toTimestamp$5(e.createdAt),t.uint32(58).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseGroupPolicyInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.groupId=longToNumber$y(n.uint64());break;case 3:u.admin=n.string();break;case 4:u.metadata=n.string();break;case 5:u.version=longToNumber$y(n.uint64());break;case 6:u.decisionPolicy=Any$6.decode(n,n.uint32());break;case 7:u.createdAt=fromTimestamp$5(Timestamp$4.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$$(e.address)?String(e.address):"",groupId:isSet$$(e.groupId)?Number(e.groupId):0,admin:isSet$$(e.admin)?String(e.admin):"",metadata:isSet$$(e.metadata)?String(e.metadata):"",version:isSet$$(e.version)?Number(e.version):0,decisionPolicy:isSet$$(e.decisionPolicy)?Any$6.fromJSON(e.decisionPolicy):void 0,createdAt:isSet$$(e.createdAt)?fromJsonTimestamp$5(e.createdAt):void 0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.groupId!==void 0&&(t.groupId=Math.round(e.groupId)),e.admin!==void 0&&(t.admin=e.admin),e.metadata!==void 0&&(t.metadata=e.metadata),e.version!==void 0&&(t.version=Math.round(e.version)),e.decisionPolicy!==void 0&&(t.decisionPolicy=e.decisionPolicy?Any$6.toJSON(e.decisionPolicy):void 0),e.createdAt!==void 0&&(t.createdAt=e.createdAt.toISOString()),t},fromPartial(e){const t=createBaseGroupPolicyInfo();return t.address=e.address??"",t.groupId=e.groupId??0,t.admin=e.admin??"",t.metadata=e.metadata??"",t.version=e.version??0,t.decisionPolicy=e.decisionPolicy!==void 0&&e.decisionPolicy!==null?Any$6.fromPartial(e.decisionPolicy):void 0,t.createdAt=e.createdAt??void 0,t}};function createBaseProposal(){return{id:0,groupPolicyAddress:"",metadata:"",proposers:[],submitTime:void 0,groupVersion:0,groupPolicyVersion:0,status:0,finalTallyResult:void 0,votingPeriodEnd:void 0,executorResult:0,messages:[],title:"",summary:""}}const Proposal={encode(e,t=_m0.Writer.create()){e.id!==0&&t.uint32(8).uint64(e.id),e.groupPolicyAddress!==""&&t.uint32(18).string(e.groupPolicyAddress),e.metadata!==""&&t.uint32(26).string(e.metadata);for(const n of e.proposers)t.uint32(34).string(n);e.submitTime!==void 0&&Timestamp$4.encode(toTimestamp$5(e.submitTime),t.uint32(42).fork()).ldelim(),e.groupVersion!==0&&t.uint32(48).uint64(e.groupVersion),e.groupPolicyVersion!==0&&t.uint32(56).uint64(e.groupPolicyVersion),e.status!==0&&t.uint32(64).int32(e.status),e.finalTallyResult!==void 0&&TallyResult.encode(e.finalTallyResult,t.uint32(74).fork()).ldelim(),e.votingPeriodEnd!==void 0&&Timestamp$4.encode(toTimestamp$5(e.votingPeriodEnd),t.uint32(82).fork()).ldelim(),e.executorResult!==0&&t.uint32(88).int32(e.executorResult);for(const n of e.messages)Any$6.encode(n,t.uint32(98).fork()).ldelim();return e.title!==""&&t.uint32(106).string(e.title),e.summary!==""&&t.uint32(114).string(e.summary),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.id=longToNumber$y(n.uint64());break;case 2:u.groupPolicyAddress=n.string();break;case 3:u.metadata=n.string();break;case 4:u.proposers.push(n.string());break;case 5:u.submitTime=fromTimestamp$5(Timestamp$4.decode(n,n.uint32()));break;case 6:u.groupVersion=longToNumber$y(n.uint64());break;case 7:u.groupPolicyVersion=longToNumber$y(n.uint64());break;case 8:u.status=n.int32();break;case 9:u.finalTallyResult=TallyResult.decode(n,n.uint32());break;case 10:u.votingPeriodEnd=fromTimestamp$5(Timestamp$4.decode(n,n.uint32()));break;case 11:u.executorResult=n.int32();break;case 12:u.messages.push(Any$6.decode(n,n.uint32()));break;case 13:u.title=n.string();break;case 14:u.summary=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{id:isSet$$(e.id)?Number(e.id):0,groupPolicyAddress:isSet$$(e.groupPolicyAddress)?String(e.groupPolicyAddress):"",metadata:isSet$$(e.metadata)?String(e.metadata):"",proposers:Array.isArray(e==null?void 0:e.proposers)?e.proposers.map(t=>String(t)):[],submitTime:isSet$$(e.submitTime)?fromJsonTimestamp$5(e.submitTime):void 0,groupVersion:isSet$$(e.groupVersion)?Number(e.groupVersion):0,groupPolicyVersion:isSet$$(e.groupPolicyVersion)?Number(e.groupPolicyVersion):0,status:isSet$$(e.status)?proposalStatusFromJSON(e.status):0,finalTallyResult:isSet$$(e.finalTallyResult)?TallyResult.fromJSON(e.finalTallyResult):void 0,votingPeriodEnd:isSet$$(e.votingPeriodEnd)?fromJsonTimestamp$5(e.votingPeriodEnd):void 0,executorResult:isSet$$(e.executorResult)?proposalExecutorResultFromJSON(e.executorResult):0,messages:Array.isArray(e==null?void 0:e.messages)?e.messages.map(t=>Any$6.fromJSON(t)):[],title:isSet$$(e.title)?String(e.title):"",summary:isSet$$(e.summary)?String(e.summary):""}},toJSON(e){const t={};return e.id!==void 0&&(t.id=Math.round(e.id)),e.groupPolicyAddress!==void 0&&(t.groupPolicyAddress=e.groupPolicyAddress),e.metadata!==void 0&&(t.metadata=e.metadata),e.proposers?t.proposers=e.proposers.map(n=>n):t.proposers=[],e.submitTime!==void 0&&(t.submitTime=e.submitTime.toISOString()),e.groupVersion!==void 0&&(t.groupVersion=Math.round(e.groupVersion)),e.groupPolicyVersion!==void 0&&(t.groupPolicyVersion=Math.round(e.groupPolicyVersion)),e.status!==void 0&&(t.status=proposalStatusToJSON(e.status)),e.finalTallyResult!==void 0&&(t.finalTallyResult=e.finalTallyResult?TallyResult.toJSON(e.finalTallyResult):void 0),e.votingPeriodEnd!==void 0&&(t.votingPeriodEnd=e.votingPeriodEnd.toISOString()),e.executorResult!==void 0&&(t.executorResult=proposalExecutorResultToJSON(e.executorResult)),e.messages?t.messages=e.messages.map(n=>n?Any$6.toJSON(n):void 0):t.messages=[],e.title!==void 0&&(t.title=e.title),e.summary!==void 0&&(t.summary=e.summary),t},fromPartial(e){var n,p;const t=createBaseProposal();return t.id=e.id??0,t.groupPolicyAddress=e.groupPolicyAddress??"",t.metadata=e.metadata??"",t.proposers=((n=e.proposers)==null?void 0:n.map(u=>u))||[],t.submitTime=e.submitTime??void 0,t.groupVersion=e.groupVersion??0,t.groupPolicyVersion=e.groupPolicyVersion??0,t.status=e.status??0,t.finalTallyResult=e.finalTallyResult!==void 0&&e.finalTallyResult!==null?TallyResult.fromPartial(e.finalTallyResult):void 0,t.votingPeriodEnd=e.votingPeriodEnd??void 0,t.executorResult=e.executorResult??0,t.messages=((p=e.messages)==null?void 0:p.map(u=>Any$6.fromPartial(u)))||[],t.title=e.title??"",t.summary=e.summary??"",t}};function createBaseTallyResult(){return{yesCount:"",abstainCount:"",noCount:"",noWithVetoCount:""}}const TallyResult={encode(e,t=_m0.Writer.create()){return e.yesCount!==""&&t.uint32(10).string(e.yesCount),e.abstainCount!==""&&t.uint32(18).string(e.abstainCount),e.noCount!==""&&t.uint32(26).string(e.noCount),e.noWithVetoCount!==""&&t.uint32(34).string(e.noWithVetoCount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTallyResult();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.yesCount=n.string();break;case 2:u.abstainCount=n.string();break;case 3:u.noCount=n.string();break;case 4:u.noWithVetoCount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{yesCount:isSet$$(e.yesCount)?String(e.yesCount):"",abstainCount:isSet$$(e.abstainCount)?String(e.abstainCount):"",noCount:isSet$$(e.noCount)?String(e.noCount):"",noWithVetoCount:isSet$$(e.noWithVetoCount)?String(e.noWithVetoCount):""}},toJSON(e){const t={};return e.yesCount!==void 0&&(t.yesCount=e.yesCount),e.abstainCount!==void 0&&(t.abstainCount=e.abstainCount),e.noCount!==void 0&&(t.noCount=e.noCount),e.noWithVetoCount!==void 0&&(t.noWithVetoCount=e.noWithVetoCount),t},fromPartial(e){const t=createBaseTallyResult();return t.yesCount=e.yesCount??"",t.abstainCount=e.abstainCount??"",t.noCount=e.noCount??"",t.noWithVetoCount=e.noWithVetoCount??"",t}};function createBaseVote(){return{proposalId:0,voter:"",option:0,metadata:"",submitTime:void 0}}const Vote={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.voter!==""&&t.uint32(18).string(e.voter),e.option!==0&&t.uint32(24).int32(e.option),e.metadata!==""&&t.uint32(34).string(e.metadata),e.submitTime!==void 0&&Timestamp$4.encode(toTimestamp$5(e.submitTime),t.uint32(42).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseVote();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$y(n.uint64());break;case 2:u.voter=n.string();break;case 3:u.option=n.int32();break;case 4:u.metadata=n.string();break;case 5:u.submitTime=fromTimestamp$5(Timestamp$4.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$$(e.proposalId)?Number(e.proposalId):0,voter:isSet$$(e.voter)?String(e.voter):"",option:isSet$$(e.option)?voteOptionFromJSON(e.option):0,metadata:isSet$$(e.metadata)?String(e.metadata):"",submitTime:isSet$$(e.submitTime)?fromJsonTimestamp$5(e.submitTime):void 0}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.voter!==void 0&&(t.voter=e.voter),e.option!==void 0&&(t.option=voteOptionToJSON(e.option)),e.metadata!==void 0&&(t.metadata=e.metadata),e.submitTime!==void 0&&(t.submitTime=e.submitTime.toISOString()),t},fromPartial(e){const t=createBaseVote();return t.proposalId=e.proposalId??0,t.voter=e.voter??"",t.option=e.option??0,t.metadata=e.metadata??"",t.submitTime=e.submitTime??void 0,t}};var globalThis$U=(()=>{if(typeof globalThis$U<"u")return globalThis$U;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function toTimestamp$5(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$5(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$5(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$5(Timestamp$4.fromJSON(e))}function longToNumber$y(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$U.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$$(e){return e!=null}function execFromJSON(e){switch(e){case 0:case"EXEC_UNSPECIFIED":return 0;case 1:case"EXEC_TRY":return 1;case-1:case"UNRECOGNIZED":default:return-1}}function execToJSON(e){switch(e){case 0:return"EXEC_UNSPECIFIED";case 1:return"EXEC_TRY";case-1:default:return"UNRECOGNIZED"}}function createBaseMsgCreateGroup(){return{admin:"",members:[],metadata:""}}const MsgCreateGroup={encode(e,t=_m0.Writer.create()){e.admin!==""&&t.uint32(10).string(e.admin);for(const n of e.members)MemberRequest.encode(n,t.uint32(18).fork()).ldelim();return e.metadata!==""&&t.uint32(26).string(e.metadata),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgCreateGroup();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.admin=n.string();break;case 2:u.members.push(MemberRequest.decode(n,n.uint32()));break;case 3:u.metadata=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{admin:isSet$_(e.admin)?String(e.admin):"",members:Array.isArray(e==null?void 0:e.members)?e.members.map(t=>MemberRequest.fromJSON(t)):[],metadata:isSet$_(e.metadata)?String(e.metadata):""}},toJSON(e){const t={};return e.admin!==void 0&&(t.admin=e.admin),e.members?t.members=e.members.map(n=>n?MemberRequest.toJSON(n):void 0):t.members=[],e.metadata!==void 0&&(t.metadata=e.metadata),t},fromPartial(e){var n;const t=createBaseMsgCreateGroup();return t.admin=e.admin??"",t.members=((n=e.members)==null?void 0:n.map(p=>MemberRequest.fromPartial(p)))||[],t.metadata=e.metadata??"",t}};function createBaseMsgUpdateGroupMembers(){return{admin:"",groupId:0,memberUpdates:[]}}const MsgUpdateGroupMembers={encode(e,t=_m0.Writer.create()){e.admin!==""&&t.uint32(10).string(e.admin),e.groupId!==0&&t.uint32(16).uint64(e.groupId);for(const n of e.memberUpdates)MemberRequest.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateGroupMembers();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.admin=n.string();break;case 2:u.groupId=longToNumber$x(n.uint64());break;case 3:u.memberUpdates.push(MemberRequest.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{admin:isSet$_(e.admin)?String(e.admin):"",groupId:isSet$_(e.groupId)?Number(e.groupId):0,memberUpdates:Array.isArray(e==null?void 0:e.memberUpdates)?e.memberUpdates.map(t=>MemberRequest.fromJSON(t)):[]}},toJSON(e){const t={};return e.admin!==void 0&&(t.admin=e.admin),e.groupId!==void 0&&(t.groupId=Math.round(e.groupId)),e.memberUpdates?t.memberUpdates=e.memberUpdates.map(n=>n?MemberRequest.toJSON(n):void 0):t.memberUpdates=[],t},fromPartial(e){var n;const t=createBaseMsgUpdateGroupMembers();return t.admin=e.admin??"",t.groupId=e.groupId??0,t.memberUpdates=((n=e.memberUpdates)==null?void 0:n.map(p=>MemberRequest.fromPartial(p)))||[],t}};function createBaseMsgUpdateGroupAdmin(){return{admin:"",groupId:0,newAdmin:""}}const MsgUpdateGroupAdmin={encode(e,t=_m0.Writer.create()){return e.admin!==""&&t.uint32(10).string(e.admin),e.groupId!==0&&t.uint32(16).uint64(e.groupId),e.newAdmin!==""&&t.uint32(26).string(e.newAdmin),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateGroupAdmin();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.admin=n.string();break;case 2:u.groupId=longToNumber$x(n.uint64());break;case 3:u.newAdmin=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{admin:isSet$_(e.admin)?String(e.admin):"",groupId:isSet$_(e.groupId)?Number(e.groupId):0,newAdmin:isSet$_(e.newAdmin)?String(e.newAdmin):""}},toJSON(e){const t={};return e.admin!==void 0&&(t.admin=e.admin),e.groupId!==void 0&&(t.groupId=Math.round(e.groupId)),e.newAdmin!==void 0&&(t.newAdmin=e.newAdmin),t},fromPartial(e){const t=createBaseMsgUpdateGroupAdmin();return t.admin=e.admin??"",t.groupId=e.groupId??0,t.newAdmin=e.newAdmin??"",t}};function createBaseMsgUpdateGroupMetadata(){return{admin:"",groupId:0,metadata:""}}const MsgUpdateGroupMetadata={encode(e,t=_m0.Writer.create()){return e.admin!==""&&t.uint32(10).string(e.admin),e.groupId!==0&&t.uint32(16).uint64(e.groupId),e.metadata!==""&&t.uint32(26).string(e.metadata),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateGroupMetadata();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.admin=n.string();break;case 2:u.groupId=longToNumber$x(n.uint64());break;case 3:u.metadata=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{admin:isSet$_(e.admin)?String(e.admin):"",groupId:isSet$_(e.groupId)?Number(e.groupId):0,metadata:isSet$_(e.metadata)?String(e.metadata):""}},toJSON(e){const t={};return e.admin!==void 0&&(t.admin=e.admin),e.groupId!==void 0&&(t.groupId=Math.round(e.groupId)),e.metadata!==void 0&&(t.metadata=e.metadata),t},fromPartial(e){const t=createBaseMsgUpdateGroupMetadata();return t.admin=e.admin??"",t.groupId=e.groupId??0,t.metadata=e.metadata??"",t}};function createBaseMsgCreateGroupPolicy(){return{admin:"",groupId:0,metadata:"",decisionPolicy:void 0}}const MsgCreateGroupPolicy={encode(e,t=_m0.Writer.create()){return e.admin!==""&&t.uint32(10).string(e.admin),e.groupId!==0&&t.uint32(16).uint64(e.groupId),e.metadata!==""&&t.uint32(26).string(e.metadata),e.decisionPolicy!==void 0&&Any$6.encode(e.decisionPolicy,t.uint32(34).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgCreateGroupPolicy();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.admin=n.string();break;case 2:u.groupId=longToNumber$x(n.uint64());break;case 3:u.metadata=n.string();break;case 4:u.decisionPolicy=Any$6.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{admin:isSet$_(e.admin)?String(e.admin):"",groupId:isSet$_(e.groupId)?Number(e.groupId):0,metadata:isSet$_(e.metadata)?String(e.metadata):"",decisionPolicy:isSet$_(e.decisionPolicy)?Any$6.fromJSON(e.decisionPolicy):void 0}},toJSON(e){const t={};return e.admin!==void 0&&(t.admin=e.admin),e.groupId!==void 0&&(t.groupId=Math.round(e.groupId)),e.metadata!==void 0&&(t.metadata=e.metadata),e.decisionPolicy!==void 0&&(t.decisionPolicy=e.decisionPolicy?Any$6.toJSON(e.decisionPolicy):void 0),t},fromPartial(e){const t=createBaseMsgCreateGroupPolicy();return t.admin=e.admin??"",t.groupId=e.groupId??0,t.metadata=e.metadata??"",t.decisionPolicy=e.decisionPolicy!==void 0&&e.decisionPolicy!==null?Any$6.fromPartial(e.decisionPolicy):void 0,t}};function createBaseMsgUpdateGroupPolicyAdmin(){return{admin:"",groupPolicyAddress:"",newAdmin:""}}const MsgUpdateGroupPolicyAdmin={encode(e,t=_m0.Writer.create()){return e.admin!==""&&t.uint32(10).string(e.admin),e.groupPolicyAddress!==""&&t.uint32(18).string(e.groupPolicyAddress),e.newAdmin!==""&&t.uint32(26).string(e.newAdmin),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateGroupPolicyAdmin();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.admin=n.string();break;case 2:u.groupPolicyAddress=n.string();break;case 3:u.newAdmin=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{admin:isSet$_(e.admin)?String(e.admin):"",groupPolicyAddress:isSet$_(e.groupPolicyAddress)?String(e.groupPolicyAddress):"",newAdmin:isSet$_(e.newAdmin)?String(e.newAdmin):""}},toJSON(e){const t={};return e.admin!==void 0&&(t.admin=e.admin),e.groupPolicyAddress!==void 0&&(t.groupPolicyAddress=e.groupPolicyAddress),e.newAdmin!==void 0&&(t.newAdmin=e.newAdmin),t},fromPartial(e){const t=createBaseMsgUpdateGroupPolicyAdmin();return t.admin=e.admin??"",t.groupPolicyAddress=e.groupPolicyAddress??"",t.newAdmin=e.newAdmin??"",t}};function createBaseMsgCreateGroupWithPolicy(){return{admin:"",members:[],groupMetadata:"",groupPolicyMetadata:"",groupPolicyAsAdmin:!1,decisionPolicy:void 0}}const MsgCreateGroupWithPolicy={encode(e,t=_m0.Writer.create()){e.admin!==""&&t.uint32(10).string(e.admin);for(const n of e.members)MemberRequest.encode(n,t.uint32(18).fork()).ldelim();return e.groupMetadata!==""&&t.uint32(26).string(e.groupMetadata),e.groupPolicyMetadata!==""&&t.uint32(34).string(e.groupPolicyMetadata),e.groupPolicyAsAdmin===!0&&t.uint32(40).bool(e.groupPolicyAsAdmin),e.decisionPolicy!==void 0&&Any$6.encode(e.decisionPolicy,t.uint32(50).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgCreateGroupWithPolicy();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.admin=n.string();break;case 2:u.members.push(MemberRequest.decode(n,n.uint32()));break;case 3:u.groupMetadata=n.string();break;case 4:u.groupPolicyMetadata=n.string();break;case 5:u.groupPolicyAsAdmin=n.bool();break;case 6:u.decisionPolicy=Any$6.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{admin:isSet$_(e.admin)?String(e.admin):"",members:Array.isArray(e==null?void 0:e.members)?e.members.map(t=>MemberRequest.fromJSON(t)):[],groupMetadata:isSet$_(e.groupMetadata)?String(e.groupMetadata):"",groupPolicyMetadata:isSet$_(e.groupPolicyMetadata)?String(e.groupPolicyMetadata):"",groupPolicyAsAdmin:isSet$_(e.groupPolicyAsAdmin)?!!e.groupPolicyAsAdmin:!1,decisionPolicy:isSet$_(e.decisionPolicy)?Any$6.fromJSON(e.decisionPolicy):void 0}},toJSON(e){const t={};return e.admin!==void 0&&(t.admin=e.admin),e.members?t.members=e.members.map(n=>n?MemberRequest.toJSON(n):void 0):t.members=[],e.groupMetadata!==void 0&&(t.groupMetadata=e.groupMetadata),e.groupPolicyMetadata!==void 0&&(t.groupPolicyMetadata=e.groupPolicyMetadata),e.groupPolicyAsAdmin!==void 0&&(t.groupPolicyAsAdmin=e.groupPolicyAsAdmin),e.decisionPolicy!==void 0&&(t.decisionPolicy=e.decisionPolicy?Any$6.toJSON(e.decisionPolicy):void 0),t},fromPartial(e){var n;const t=createBaseMsgCreateGroupWithPolicy();return t.admin=e.admin??"",t.members=((n=e.members)==null?void 0:n.map(p=>MemberRequest.fromPartial(p)))||[],t.groupMetadata=e.groupMetadata??"",t.groupPolicyMetadata=e.groupPolicyMetadata??"",t.groupPolicyAsAdmin=e.groupPolicyAsAdmin??!1,t.decisionPolicy=e.decisionPolicy!==void 0&&e.decisionPolicy!==null?Any$6.fromPartial(e.decisionPolicy):void 0,t}};function createBaseMsgUpdateGroupPolicyDecisionPolicy(){return{admin:"",groupPolicyAddress:"",decisionPolicy:void 0}}const MsgUpdateGroupPolicyDecisionPolicy={encode(e,t=_m0.Writer.create()){return e.admin!==""&&t.uint32(10).string(e.admin),e.groupPolicyAddress!==""&&t.uint32(18).string(e.groupPolicyAddress),e.decisionPolicy!==void 0&&Any$6.encode(e.decisionPolicy,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateGroupPolicyDecisionPolicy();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.admin=n.string();break;case 2:u.groupPolicyAddress=n.string();break;case 3:u.decisionPolicy=Any$6.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{admin:isSet$_(e.admin)?String(e.admin):"",groupPolicyAddress:isSet$_(e.groupPolicyAddress)?String(e.groupPolicyAddress):"",decisionPolicy:isSet$_(e.decisionPolicy)?Any$6.fromJSON(e.decisionPolicy):void 0}},toJSON(e){const t={};return e.admin!==void 0&&(t.admin=e.admin),e.groupPolicyAddress!==void 0&&(t.groupPolicyAddress=e.groupPolicyAddress),e.decisionPolicy!==void 0&&(t.decisionPolicy=e.decisionPolicy?Any$6.toJSON(e.decisionPolicy):void 0),t},fromPartial(e){const t=createBaseMsgUpdateGroupPolicyDecisionPolicy();return t.admin=e.admin??"",t.groupPolicyAddress=e.groupPolicyAddress??"",t.decisionPolicy=e.decisionPolicy!==void 0&&e.decisionPolicy!==null?Any$6.fromPartial(e.decisionPolicy):void 0,t}};function createBaseMsgUpdateGroupPolicyMetadata(){return{admin:"",groupPolicyAddress:"",metadata:""}}const MsgUpdateGroupPolicyMetadata={encode(e,t=_m0.Writer.create()){return e.admin!==""&&t.uint32(10).string(e.admin),e.groupPolicyAddress!==""&&t.uint32(18).string(e.groupPolicyAddress),e.metadata!==""&&t.uint32(26).string(e.metadata),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateGroupPolicyMetadata();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.admin=n.string();break;case 2:u.groupPolicyAddress=n.string();break;case 3:u.metadata=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{admin:isSet$_(e.admin)?String(e.admin):"",groupPolicyAddress:isSet$_(e.groupPolicyAddress)?String(e.groupPolicyAddress):"",metadata:isSet$_(e.metadata)?String(e.metadata):""}},toJSON(e){const t={};return e.admin!==void 0&&(t.admin=e.admin),e.groupPolicyAddress!==void 0&&(t.groupPolicyAddress=e.groupPolicyAddress),e.metadata!==void 0&&(t.metadata=e.metadata),t},fromPartial(e){const t=createBaseMsgUpdateGroupPolicyMetadata();return t.admin=e.admin??"",t.groupPolicyAddress=e.groupPolicyAddress??"",t.metadata=e.metadata??"",t}};function createBaseMsgSubmitProposal(){return{groupPolicyAddress:"",proposers:[],metadata:"",messages:[],exec:0,title:"",summary:""}}const MsgSubmitProposal={encode(e,t=_m0.Writer.create()){e.groupPolicyAddress!==""&&t.uint32(10).string(e.groupPolicyAddress);for(const n of e.proposers)t.uint32(18).string(n);e.metadata!==""&&t.uint32(26).string(e.metadata);for(const n of e.messages)Any$6.encode(n,t.uint32(34).fork()).ldelim();return e.exec!==0&&t.uint32(40).int32(e.exec),e.title!==""&&t.uint32(50).string(e.title),e.summary!==""&&t.uint32(58).string(e.summary),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgSubmitProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.groupPolicyAddress=n.string();break;case 2:u.proposers.push(n.string());break;case 3:u.metadata=n.string();break;case 4:u.messages.push(Any$6.decode(n,n.uint32()));break;case 5:u.exec=n.int32();break;case 6:u.title=n.string();break;case 7:u.summary=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{groupPolicyAddress:isSet$_(e.groupPolicyAddress)?String(e.groupPolicyAddress):"",proposers:Array.isArray(e==null?void 0:e.proposers)?e.proposers.map(t=>String(t)):[],metadata:isSet$_(e.metadata)?String(e.metadata):"",messages:Array.isArray(e==null?void 0:e.messages)?e.messages.map(t=>Any$6.fromJSON(t)):[],exec:isSet$_(e.exec)?execFromJSON(e.exec):0,title:isSet$_(e.title)?String(e.title):"",summary:isSet$_(e.summary)?String(e.summary):""}},toJSON(e){const t={};return e.groupPolicyAddress!==void 0&&(t.groupPolicyAddress=e.groupPolicyAddress),e.proposers?t.proposers=e.proposers.map(n=>n):t.proposers=[],e.metadata!==void 0&&(t.metadata=e.metadata),e.messages?t.messages=e.messages.map(n=>n?Any$6.toJSON(n):void 0):t.messages=[],e.exec!==void 0&&(t.exec=execToJSON(e.exec)),e.title!==void 0&&(t.title=e.title),e.summary!==void 0&&(t.summary=e.summary),t},fromPartial(e){var n,p;const t=createBaseMsgSubmitProposal();return t.groupPolicyAddress=e.groupPolicyAddress??"",t.proposers=((n=e.proposers)==null?void 0:n.map(u=>u))||[],t.metadata=e.metadata??"",t.messages=((p=e.messages)==null?void 0:p.map(u=>Any$6.fromPartial(u)))||[],t.exec=e.exec??0,t.title=e.title??"",t.summary=e.summary??"",t}};function createBaseMsgWithdrawProposal(){return{proposalId:0,address:""}}const MsgWithdrawProposal={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.address!==""&&t.uint32(18).string(e.address),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgWithdrawProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$x(n.uint64());break;case 2:u.address=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$_(e.proposalId)?Number(e.proposalId):0,address:isSet$_(e.address)?String(e.address):""}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.address!==void 0&&(t.address=e.address),t},fromPartial(e){const t=createBaseMsgWithdrawProposal();return t.proposalId=e.proposalId??0,t.address=e.address??"",t}};function createBaseMsgVote(){return{proposalId:0,voter:"",option:0,metadata:"",exec:0}}const MsgVote={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.voter!==""&&t.uint32(18).string(e.voter),e.option!==0&&t.uint32(24).int32(e.option),e.metadata!==""&&t.uint32(34).string(e.metadata),e.exec!==0&&t.uint32(40).int32(e.exec),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgVote();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$x(n.uint64());break;case 2:u.voter=n.string();break;case 3:u.option=n.int32();break;case 4:u.metadata=n.string();break;case 5:u.exec=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$_(e.proposalId)?Number(e.proposalId):0,voter:isSet$_(e.voter)?String(e.voter):"",option:isSet$_(e.option)?voteOptionFromJSON(e.option):0,metadata:isSet$_(e.metadata)?String(e.metadata):"",exec:isSet$_(e.exec)?execFromJSON(e.exec):0}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.voter!==void 0&&(t.voter=e.voter),e.option!==void 0&&(t.option=voteOptionToJSON(e.option)),e.metadata!==void 0&&(t.metadata=e.metadata),e.exec!==void 0&&(t.exec=execToJSON(e.exec)),t},fromPartial(e){const t=createBaseMsgVote();return t.proposalId=e.proposalId??0,t.voter=e.voter??"",t.option=e.option??0,t.metadata=e.metadata??"",t.exec=e.exec??0,t}};function createBaseMsgExec(){return{proposalId:0,executor:""}}const MsgExec={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.executor!==""&&t.uint32(18).string(e.executor),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgExec();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$x(n.uint64());break;case 2:u.executor=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$_(e.proposalId)?Number(e.proposalId):0,executor:isSet$_(e.executor)?String(e.executor):""}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.executor!==void 0&&(t.executor=e.executor),t},fromPartial(e){const t=createBaseMsgExec();return t.proposalId=e.proposalId??0,t.executor=e.executor??"",t}};function createBaseMsgLeaveGroup(){return{address:"",groupId:0}}const MsgLeaveGroup={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.groupId!==0&&t.uint32(16).uint64(e.groupId),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgLeaveGroup();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.groupId=longToNumber$x(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$_(e.address)?String(e.address):"",groupId:isSet$_(e.groupId)?Number(e.groupId):0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.groupId!==void 0&&(t.groupId=Math.round(e.groupId)),t},fromPartial(e){const t=createBaseMsgLeaveGroup();return t.address=e.address??"",t.groupId=e.groupId??0,t}};var globalThis$T=(()=>{if(typeof globalThis$T<"u")return globalThis$T;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$x(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$T.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$_(e){return e!=null}const msgTypes$g=[["/cosmos.group.v1.MsgLeaveGroup",MsgLeaveGroup],["/cosmos.group.v1.MsgCreateGroup",MsgCreateGroup],["/cosmos.group.v1.MsgUpdateGroupPolicyMetadata",MsgUpdateGroupPolicyMetadata],["/cosmos.group.v1.MsgExec",MsgExec],["/cosmos.group.v1.MsgUpdateGroupAdmin",MsgUpdateGroupAdmin],["/cosmos.group.v1.MsgCreateGroupWithPolicy",MsgCreateGroupWithPolicy],["/cosmos.group.v1.MsgUpdateGroupPolicyAdmin",MsgUpdateGroupPolicyAdmin],["/cosmos.group.v1.MsgWithdrawProposal",MsgWithdrawProposal],["/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy",MsgUpdateGroupPolicyDecisionPolicy],["/cosmos.group.v1.MsgUpdateGroupMetadata",MsgUpdateGroupMetadata],["/cosmos.group.v1.MsgVote",MsgVote],["/cosmos.group.v1.MsgSubmitProposal",MsgSubmitProposal],["/cosmos.group.v1.MsgCreateGroupPolicy",MsgCreateGroupPolicy],["/cosmos.group.v1.MsgUpdateGroupMembers",MsgUpdateGroupMembers]];let HttpClient$g=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$g=class extends HttpClient$g{constructor(){super(...arguments),this.queryGroupInfo=(t,n={})=>this.request({path:`/cosmos/group/v1/group_info/${t}`,method:"GET",format:"json",...n}),this.queryGroupMembers=(t,n,p={})=>this.request({path:`/cosmos/group/v1/group_members/${t}`,method:"GET",query:n,format:"json",...p}),this.queryGroupPoliciesByAdmin=(t,n,p={})=>this.request({path:`/cosmos/group/v1/group_policies_by_admin/${t}`,method:"GET",query:n,format:"json",...p}),this.queryGroupPoliciesByGroup=(t,n,p={})=>this.request({path:`/cosmos/group/v1/group_policies_by_group/${t}`,method:"GET",query:n,format:"json",...p}),this.queryGroupPolicyInfo=(t,n={})=>this.request({path:`/cosmos/group/v1/group_policy_info/${t}`,method:"GET",format:"json",...n}),this.queryGroups=(t,n={})=>this.request({path:"/cosmos/group/v1/groups",method:"GET",query:t,format:"json",...n}),this.queryGroupsByAdmin=(t,n,p={})=>this.request({path:`/cosmos/group/v1/groups_by_admin/${t}`,method:"GET",query:n,format:"json",...p}),this.queryGroupsByMember=(t,n,p={})=>this.request({path:`/cosmos/group/v1/groups_by_member/${t}`,method:"GET",query:n,format:"json",...p}),this.queryProposal=(t,n={})=>this.request({path:`/cosmos/group/v1/proposal/${t}`,method:"GET",format:"json",...n}),this.queryTallyResult=(t,n={})=>this.request({path:`/cosmos/group/v1/proposals/${t}/tally`,method:"GET",format:"json",...n}),this.queryProposalsByGroupPolicy=(t,n,p={})=>this.request({path:`/cosmos/group/v1/proposals_by_group_policy/${t}`,method:"GET",query:n,format:"json",...p}),this.queryVoteByProposalVoter=(t,n,p={})=>this.request({path:`/cosmos/group/v1/vote_by_proposal_voter/${t}/${n}`,method:"GET",format:"json",...p}),this.queryVotesByProposal=(t,n,p={})=>this.request({path:`/cosmos/group/v1/votes_by_proposal/${t}`,method:"GET",query:n,format:"json",...p}),this.queryVotesByVoter=(t,n,p={})=>this.request({path:`/cosmos/group/v1/votes_by_voter/${t}`,method:"GET",query:n,format:"json",...p})}};function createBaseEventCreateGroup(){return{groupId:0}}const EventCreateGroup={encode(e,t=_m0.Writer.create()){return e.groupId!==0&&t.uint32(8).uint64(e.groupId),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventCreateGroup();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.groupId=longToNumber$w(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{groupId:isSet$Z(e.groupId)?Number(e.groupId):0}},toJSON(e){const t={};return e.groupId!==void 0&&(t.groupId=Math.round(e.groupId)),t},fromPartial(e){const t=createBaseEventCreateGroup();return t.groupId=e.groupId??0,t}};function createBaseEventUpdateGroup(){return{groupId:0}}const EventUpdateGroup={encode(e,t=_m0.Writer.create()){return e.groupId!==0&&t.uint32(8).uint64(e.groupId),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventUpdateGroup();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.groupId=longToNumber$w(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{groupId:isSet$Z(e.groupId)?Number(e.groupId):0}},toJSON(e){const t={};return e.groupId!==void 0&&(t.groupId=Math.round(e.groupId)),t},fromPartial(e){const t=createBaseEventUpdateGroup();return t.groupId=e.groupId??0,t}};function createBaseEventCreateGroupPolicy(){return{address:""}}const EventCreateGroupPolicy={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventCreateGroupPolicy();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$Z(e.address)?String(e.address):""}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),t},fromPartial(e){const t=createBaseEventCreateGroupPolicy();return t.address=e.address??"",t}};function createBaseEventUpdateGroupPolicy(){return{address:""}}const EventUpdateGroupPolicy={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventUpdateGroupPolicy();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$Z(e.address)?String(e.address):""}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),t},fromPartial(e){const t=createBaseEventUpdateGroupPolicy();return t.address=e.address??"",t}};function createBaseEventSubmitProposal(){return{proposalId:0}}const EventSubmitProposal={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventSubmitProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$w(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$Z(e.proposalId)?Number(e.proposalId):0}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),t},fromPartial(e){const t=createBaseEventSubmitProposal();return t.proposalId=e.proposalId??0,t}};function createBaseEventWithdrawProposal(){return{proposalId:0}}const EventWithdrawProposal={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventWithdrawProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$w(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$Z(e.proposalId)?Number(e.proposalId):0}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),t},fromPartial(e){const t=createBaseEventWithdrawProposal();return t.proposalId=e.proposalId??0,t}};function createBaseEventVote(){return{proposalId:0}}const EventVote={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventVote();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$w(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$Z(e.proposalId)?Number(e.proposalId):0}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),t},fromPartial(e){const t=createBaseEventVote();return t.proposalId=e.proposalId??0,t}};function createBaseEventExec(){return{proposalId:0,result:0,logs:""}}const EventExec={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.result!==0&&t.uint32(16).int32(e.result),e.logs!==""&&t.uint32(26).string(e.logs),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventExec();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$w(n.uint64());break;case 2:u.result=n.int32();break;case 3:u.logs=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$Z(e.proposalId)?Number(e.proposalId):0,result:isSet$Z(e.result)?proposalExecutorResultFromJSON(e.result):0,logs:isSet$Z(e.logs)?String(e.logs):""}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.result!==void 0&&(t.result=proposalExecutorResultToJSON(e.result)),e.logs!==void 0&&(t.logs=e.logs),t},fromPartial(e){const t=createBaseEventExec();return t.proposalId=e.proposalId??0,t.result=e.result??0,t.logs=e.logs??"",t}};function createBaseEventLeaveGroup(){return{groupId:0,address:""}}const EventLeaveGroup={encode(e,t=_m0.Writer.create()){return e.groupId!==0&&t.uint32(8).uint64(e.groupId),e.address!==""&&t.uint32(18).string(e.address),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventLeaveGroup();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.groupId=longToNumber$w(n.uint64());break;case 2:u.address=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{groupId:isSet$Z(e.groupId)?Number(e.groupId):0,address:isSet$Z(e.address)?String(e.address):""}},toJSON(e){const t={};return e.groupId!==void 0&&(t.groupId=Math.round(e.groupId)),e.address!==void 0&&(t.address=e.address),t},fromPartial(e){const t=createBaseEventLeaveGroup();return t.groupId=e.groupId??0,t.address=e.address??"",t}};function createBaseEventProposalPruned(){return{proposalId:0,status:0,tallyResult:void 0}}const EventProposalPruned={encode(e,t=_m0.Writer.create()){return e.proposalId!==0&&t.uint32(8).uint64(e.proposalId),e.status!==0&&t.uint32(16).int32(e.status),e.tallyResult!==void 0&&TallyResult.encode(e.tallyResult,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventProposalPruned();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.proposalId=longToNumber$w(n.uint64());break;case 2:u.status=n.int32();break;case 3:u.tallyResult=TallyResult.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{proposalId:isSet$Z(e.proposalId)?Number(e.proposalId):0,status:isSet$Z(e.status)?proposalStatusFromJSON(e.status):0,tallyResult:isSet$Z(e.tallyResult)?TallyResult.fromJSON(e.tallyResult):void 0}},toJSON(e){const t={};return e.proposalId!==void 0&&(t.proposalId=Math.round(e.proposalId)),e.status!==void 0&&(t.status=proposalStatusToJSON(e.status)),e.tallyResult!==void 0&&(t.tallyResult=e.tallyResult?TallyResult.toJSON(e.tallyResult):void 0),t},fromPartial(e){const t=createBaseEventProposalPruned();return t.proposalId=e.proposalId??0,t.status=e.status??0,t.tallyResult=e.tallyResult!==void 0&&e.tallyResult!==null?TallyResult.fromPartial(e.tallyResult):void 0,t}};var globalThis$S=(()=>{if(typeof globalThis$S<"u")return globalThis$S;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$w(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$S.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$Z(e){return e!=null}const registry$7=new build$b.Registry(msgTypes$g);function getStructure$g(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$6={amount:[],gas:"200000"},txClient$g=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgLeaveGroup({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgLeaveGroup: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgLeaveGroup({value:MsgLeaveGroup.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgLeaveGroup: Could not broadcast Tx: "+y.message)}},async sendMsgCreateGroup({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgCreateGroup: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgCreateGroup({value:MsgCreateGroup.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgCreateGroup: Could not broadcast Tx: "+y.message)}},async sendMsgUpdateGroupPolicyMetadata({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateGroupPolicyMetadata: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgUpdateGroupPolicyMetadata({value:MsgUpdateGroupPolicyMetadata.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgUpdateGroupPolicyMetadata: Could not broadcast Tx: "+y.message)}},async sendMsgExec({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgExec: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgExec({value:MsgExec.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgExec: Could not broadcast Tx: "+y.message)}},async sendMsgUpdateGroupAdmin({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateGroupAdmin: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgUpdateGroupAdmin({value:MsgUpdateGroupAdmin.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgUpdateGroupAdmin: Could not broadcast Tx: "+y.message)}},async sendMsgCreateGroupWithPolicy({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgCreateGroupWithPolicy: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgCreateGroupWithPolicy({value:MsgCreateGroupWithPolicy.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgCreateGroupWithPolicy: Could not broadcast Tx: "+y.message)}},async sendMsgUpdateGroupPolicyAdmin({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateGroupPolicyAdmin: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgUpdateGroupPolicyAdmin({value:MsgUpdateGroupPolicyAdmin.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgUpdateGroupPolicyAdmin: Could not broadcast Tx: "+y.message)}},async sendMsgWithdrawProposal({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgWithdrawProposal: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgWithdrawProposal({value:MsgWithdrawProposal.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgWithdrawProposal: Could not broadcast Tx: "+y.message)}},async sendMsgUpdateGroupPolicyDecisionPolicy({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateGroupPolicyDecisionPolicy: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgUpdateGroupPolicyDecisionPolicy({value:MsgUpdateGroupPolicyDecisionPolicy.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgUpdateGroupPolicyDecisionPolicy: Could not broadcast Tx: "+y.message)}},async sendMsgUpdateGroupMetadata({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateGroupMetadata: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgUpdateGroupMetadata({value:MsgUpdateGroupMetadata.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgUpdateGroupMetadata: Could not broadcast Tx: "+y.message)}},async sendMsgVote({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgVote: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgVote({value:MsgVote.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgVote: Could not broadcast Tx: "+y.message)}},async sendMsgSubmitProposal({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgSubmitProposal: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgSubmitProposal({value:MsgSubmitProposal.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgSubmitProposal: Could not broadcast Tx: "+y.message)}},async sendMsgCreateGroupPolicy({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgCreateGroupPolicy: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgCreateGroupPolicy({value:MsgCreateGroupPolicy.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgCreateGroupPolicy: Could not broadcast Tx: "+y.message)}},async sendMsgUpdateGroupMembers({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateGroupMembers: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$7,prefix:t});let N=this.msgUpdateGroupMembers({value:MsgUpdateGroupMembers.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$6,g)}catch(y){throw new Error("TxClient:sendMsgUpdateGroupMembers: Could not broadcast Tx: "+y.message)}},msgLeaveGroup({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgLeaveGroup",value:MsgLeaveGroup.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgLeaveGroup: Could not create message: "+u.message)}},msgCreateGroup({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgCreateGroup",value:MsgCreateGroup.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgCreateGroup: Could not create message: "+u.message)}},msgUpdateGroupPolicyMetadata({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgUpdateGroupPolicyMetadata",value:MsgUpdateGroupPolicyMetadata.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateGroupPolicyMetadata: Could not create message: "+u.message)}},msgExec({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgExec",value:MsgExec.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgExec: Could not create message: "+u.message)}},msgUpdateGroupAdmin({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgUpdateGroupAdmin",value:MsgUpdateGroupAdmin.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateGroupAdmin: Could not create message: "+u.message)}},msgCreateGroupWithPolicy({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgCreateGroupWithPolicy",value:MsgCreateGroupWithPolicy.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgCreateGroupWithPolicy: Could not create message: "+u.message)}},msgUpdateGroupPolicyAdmin({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgUpdateGroupPolicyAdmin",value:MsgUpdateGroupPolicyAdmin.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateGroupPolicyAdmin: Could not create message: "+u.message)}},msgWithdrawProposal({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgWithdrawProposal",value:MsgWithdrawProposal.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgWithdrawProposal: Could not create message: "+u.message)}},msgUpdateGroupPolicyDecisionPolicy({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy",value:MsgUpdateGroupPolicyDecisionPolicy.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateGroupPolicyDecisionPolicy: Could not create message: "+u.message)}},msgUpdateGroupMetadata({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgUpdateGroupMetadata",value:MsgUpdateGroupMetadata.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateGroupMetadata: Could not create message: "+u.message)}},msgVote({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgVote",value:MsgVote.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgVote: Could not create message: "+u.message)}},msgSubmitProposal({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgSubmitProposal",value:MsgSubmitProposal.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgSubmitProposal: Could not create message: "+u.message)}},msgCreateGroupPolicy({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgCreateGroupPolicy",value:MsgCreateGroupPolicy.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgCreateGroupPolicy: Could not create message: "+u.message)}},msgUpdateGroupMembers({value:p}){try{return{typeUrl:"/cosmos.group.v1.MsgUpdateGroupMembers",value:MsgUpdateGroupMembers.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateGroupMembers: Could not create message: "+u.message)}}}),queryClient$g=({addr:e}={addr:"http://localhost:1317"})=>new Api$g({baseURL:e});let SDKModule$g=class{constructor(t){this.registry=[],this.query=queryClient$g({addr:t.env.apiURL}),this.updateTX(t),this.structure={EventCreateGroup:getStructure$g(EventCreateGroup.fromPartial({})),EventUpdateGroup:getStructure$g(EventUpdateGroup.fromPartial({})),EventCreateGroupPolicy:getStructure$g(EventCreateGroupPolicy.fromPartial({})),EventUpdateGroupPolicy:getStructure$g(EventUpdateGroupPolicy.fromPartial({})),EventSubmitProposal:getStructure$g(EventSubmitProposal.fromPartial({})),EventWithdrawProposal:getStructure$g(EventWithdrawProposal.fromPartial({})),EventVote:getStructure$g(EventVote.fromPartial({})),EventExec:getStructure$g(EventExec.fromPartial({})),EventLeaveGroup:getStructure$g(EventLeaveGroup.fromPartial({})),EventProposalPruned:getStructure$g(EventProposalPruned.fromPartial({})),Member:getStructure$g(Member.fromPartial({})),MemberRequest:getStructure$g(MemberRequest.fromPartial({})),ThresholdDecisionPolicy:getStructure$g(ThresholdDecisionPolicy.fromPartial({})),PercentageDecisionPolicy:getStructure$g(PercentageDecisionPolicy.fromPartial({})),DecisionPolicyWindows:getStructure$g(DecisionPolicyWindows.fromPartial({})),GroupInfo:getStructure$g(GroupInfo.fromPartial({})),GroupMember:getStructure$g(GroupMember.fromPartial({})),GroupPolicyInfo:getStructure$g(GroupPolicyInfo.fromPartial({})),Proposal:getStructure$g(Proposal.fromPartial({})),TallyResult:getStructure$g(TallyResult.fromPartial({})),Vote:getStructure$g(Vote.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$g({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$g=e=>({module:{CosmosGroupV1:new SDKModule$g(e)},registry:msgTypes$g}),msgTypes$f=[];let HttpClient$f=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$f=class extends HttpClient$f{constructor(){super(...arguments),this.queryAnnualProvisions=(t={})=>this.request({path:"/cosmos/mint/v1beta1/annual_provisions",method:"GET",format:"json",...t}),this.queryInflation=(t={})=>this.request({path:"/cosmos/mint/v1beta1/inflation",method:"GET",format:"json",...t}),this.queryParams=(t={})=>this.request({path:"/cosmos/mint/v1beta1/params",method:"GET",format:"json",...t})}};function createBaseMinter(){return{inflation:"",annualProvisions:""}}const Minter={encode(e,t=_m0.Writer.create()){return e.inflation!==""&&t.uint32(10).string(e.inflation),e.annualProvisions!==""&&t.uint32(18).string(e.annualProvisions),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMinter();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.inflation=n.string();break;case 2:u.annualProvisions=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{inflation:isSet$Y(e.inflation)?String(e.inflation):"",annualProvisions:isSet$Y(e.annualProvisions)?String(e.annualProvisions):""}},toJSON(e){const t={};return e.inflation!==void 0&&(t.inflation=e.inflation),e.annualProvisions!==void 0&&(t.annualProvisions=e.annualProvisions),t},fromPartial(e){const t=createBaseMinter();return t.inflation=e.inflation??"",t.annualProvisions=e.annualProvisions??"",t}};function createBaseParams$9(){return{mintDenom:"",inflationRateChange:"",inflationMax:"",inflationMin:"",goalBonded:"",blocksPerYear:0}}const Params$9={encode(e,t=_m0.Writer.create()){return e.mintDenom!==""&&t.uint32(10).string(e.mintDenom),e.inflationRateChange!==""&&t.uint32(18).string(e.inflationRateChange),e.inflationMax!==""&&t.uint32(26).string(e.inflationMax),e.inflationMin!==""&&t.uint32(34).string(e.inflationMin),e.goalBonded!==""&&t.uint32(42).string(e.goalBonded),e.blocksPerYear!==0&&t.uint32(48).uint64(e.blocksPerYear),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$9();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.mintDenom=n.string();break;case 2:u.inflationRateChange=n.string();break;case 3:u.inflationMax=n.string();break;case 4:u.inflationMin=n.string();break;case 5:u.goalBonded=n.string();break;case 6:u.blocksPerYear=longToNumber$v(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{mintDenom:isSet$Y(e.mintDenom)?String(e.mintDenom):"",inflationRateChange:isSet$Y(e.inflationRateChange)?String(e.inflationRateChange):"",inflationMax:isSet$Y(e.inflationMax)?String(e.inflationMax):"",inflationMin:isSet$Y(e.inflationMin)?String(e.inflationMin):"",goalBonded:isSet$Y(e.goalBonded)?String(e.goalBonded):"",blocksPerYear:isSet$Y(e.blocksPerYear)?Number(e.blocksPerYear):0}},toJSON(e){const t={};return e.mintDenom!==void 0&&(t.mintDenom=e.mintDenom),e.inflationRateChange!==void 0&&(t.inflationRateChange=e.inflationRateChange),e.inflationMax!==void 0&&(t.inflationMax=e.inflationMax),e.inflationMin!==void 0&&(t.inflationMin=e.inflationMin),e.goalBonded!==void 0&&(t.goalBonded=e.goalBonded),e.blocksPerYear!==void 0&&(t.blocksPerYear=Math.round(e.blocksPerYear)),t},fromPartial(e){const t=createBaseParams$9();return t.mintDenom=e.mintDenom??"",t.inflationRateChange=e.inflationRateChange??"",t.inflationMax=e.inflationMax??"",t.inflationMin=e.inflationMin??"",t.goalBonded=e.goalBonded??"",t.blocksPerYear=e.blocksPerYear??0,t}};var globalThis$R=(()=>{if(typeof globalThis$R<"u")return globalThis$R;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$v(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$R.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$Y(e){return e!=null}new build$b.Registry(msgTypes$f);function getStructure$f(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$f=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$f=({addr:e}={addr:"http://localhost:1317"})=>new Api$f({baseURL:e});let SDKModule$f=class{constructor(t){this.registry=[],this.query=queryClient$f({addr:t.env.apiURL}),this.updateTX(t),this.structure={Minter:getStructure$f(Minter.fromPartial({})),Params:getStructure$f(Params$9.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$f({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$f=e=>({module:{CosmosMintV1Beta1:new SDKModule$f(e)},registry:msgTypes$f}),msgTypes$e=[];let HttpClient$e=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$e=class extends HttpClient$e{constructor(){super(...arguments),this.queryBalance=(t,n,p={})=>this.request({path:`/cosmos/nft/v1beta1/balance/${t}/${n}`,method:"GET",format:"json",...p}),this.queryClasses=(t,n={})=>this.request({path:"/cosmos/nft/v1beta1/classes",method:"GET",query:t,format:"json",...n}),this.queryClass=(t,n={})=>this.request({path:`/cosmos/nft/v1beta1/classes/${t}`,method:"GET",format:"json",...n}),this.queryNFTs=(t,n={})=>this.request({path:"/cosmos/nft/v1beta1/nfts",method:"GET",query:t,format:"json",...n}),this.queryNFT=(t,n,p={})=>this.request({path:`/cosmos/nft/v1beta1/nfts/${t}/${n}`,method:"GET",format:"json",...p}),this.queryOwner=(t,n,p={})=>this.request({path:`/cosmos/nft/v1beta1/owner/${t}/${n}`,method:"GET",format:"json",...p}),this.querySupply=(t,n={})=>this.request({path:`/cosmos/nft/v1beta1/supply/${t}`,method:"GET",format:"json",...n})}};function createBaseEventSend(){return{classId:"",id:"",sender:"",receiver:""}}const EventSend={encode(e,t=_m0.Writer.create()){return e.classId!==""&&t.uint32(10).string(e.classId),e.id!==""&&t.uint32(18).string(e.id),e.sender!==""&&t.uint32(26).string(e.sender),e.receiver!==""&&t.uint32(34).string(e.receiver),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventSend();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.classId=n.string();break;case 2:u.id=n.string();break;case 3:u.sender=n.string();break;case 4:u.receiver=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{classId:isSet$X(e.classId)?String(e.classId):"",id:isSet$X(e.id)?String(e.id):"",sender:isSet$X(e.sender)?String(e.sender):"",receiver:isSet$X(e.receiver)?String(e.receiver):""}},toJSON(e){const t={};return e.classId!==void 0&&(t.classId=e.classId),e.id!==void 0&&(t.id=e.id),e.sender!==void 0&&(t.sender=e.sender),e.receiver!==void 0&&(t.receiver=e.receiver),t},fromPartial(e){const t=createBaseEventSend();return t.classId=e.classId??"",t.id=e.id??"",t.sender=e.sender??"",t.receiver=e.receiver??"",t}};function createBaseEventMint(){return{classId:"",id:"",owner:""}}const EventMint={encode(e,t=_m0.Writer.create()){return e.classId!==""&&t.uint32(10).string(e.classId),e.id!==""&&t.uint32(18).string(e.id),e.owner!==""&&t.uint32(26).string(e.owner),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventMint();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.classId=n.string();break;case 2:u.id=n.string();break;case 3:u.owner=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{classId:isSet$X(e.classId)?String(e.classId):"",id:isSet$X(e.id)?String(e.id):"",owner:isSet$X(e.owner)?String(e.owner):""}},toJSON(e){const t={};return e.classId!==void 0&&(t.classId=e.classId),e.id!==void 0&&(t.id=e.id),e.owner!==void 0&&(t.owner=e.owner),t},fromPartial(e){const t=createBaseEventMint();return t.classId=e.classId??"",t.id=e.id??"",t.owner=e.owner??"",t}};function createBaseEventBurn(){return{classId:"",id:"",owner:""}}const EventBurn={encode(e,t=_m0.Writer.create()){return e.classId!==""&&t.uint32(10).string(e.classId),e.id!==""&&t.uint32(18).string(e.id),e.owner!==""&&t.uint32(26).string(e.owner),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEventBurn();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.classId=n.string();break;case 2:u.id=n.string();break;case 3:u.owner=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{classId:isSet$X(e.classId)?String(e.classId):"",id:isSet$X(e.id)?String(e.id):"",owner:isSet$X(e.owner)?String(e.owner):""}},toJSON(e){const t={};return e.classId!==void 0&&(t.classId=e.classId),e.id!==void 0&&(t.id=e.id),e.owner!==void 0&&(t.owner=e.owner),t},fromPartial(e){const t=createBaseEventBurn();return t.classId=e.classId??"",t.id=e.id??"",t.owner=e.owner??"",t}};function isSet$X(e){return e!=null}function createBaseAny$5(){return{typeUrl:"",value:new Uint8Array}}const Any$5={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$5();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$W(e.typeUrl)?String(e.typeUrl):"",value:isSet$W(e.value)?bytesFromBase64$h(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$h(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$5();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$Q=(()=>{if(typeof globalThis$Q<"u")return globalThis$Q;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$h(e){if(globalThis$Q.Buffer)return Uint8Array.from(globalThis$Q.Buffer.from(e,"base64"));{const t=globalThis$Q.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$h(e){if(globalThis$Q.Buffer)return globalThis$Q.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$Q.btoa(t.join(""))}}function isSet$W(e){return e!=null}function createBaseClass$1(){return{id:"",name:"",symbol:"",description:"",uri:"",uriHash:"",data:void 0}}const Class$1={encode(e,t=_m0.Writer.create()){return e.id!==""&&t.uint32(10).string(e.id),e.name!==""&&t.uint32(18).string(e.name),e.symbol!==""&&t.uint32(26).string(e.symbol),e.description!==""&&t.uint32(34).string(e.description),e.uri!==""&&t.uint32(42).string(e.uri),e.uriHash!==""&&t.uint32(50).string(e.uriHash),e.data!==void 0&&Any$5.encode(e.data,t.uint32(58).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseClass$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.id=n.string();break;case 2:u.name=n.string();break;case 3:u.symbol=n.string();break;case 4:u.description=n.string();break;case 5:u.uri=n.string();break;case 6:u.uriHash=n.string();break;case 7:u.data=Any$5.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{id:isSet$V(e.id)?String(e.id):"",name:isSet$V(e.name)?String(e.name):"",symbol:isSet$V(e.symbol)?String(e.symbol):"",description:isSet$V(e.description)?String(e.description):"",uri:isSet$V(e.uri)?String(e.uri):"",uriHash:isSet$V(e.uriHash)?String(e.uriHash):"",data:isSet$V(e.data)?Any$5.fromJSON(e.data):void 0}},toJSON(e){const t={};return e.id!==void 0&&(t.id=e.id),e.name!==void 0&&(t.name=e.name),e.symbol!==void 0&&(t.symbol=e.symbol),e.description!==void 0&&(t.description=e.description),e.uri!==void 0&&(t.uri=e.uri),e.uriHash!==void 0&&(t.uriHash=e.uriHash),e.data!==void 0&&(t.data=e.data?Any$5.toJSON(e.data):void 0),t},fromPartial(e){const t=createBaseClass$1();return t.id=e.id??"",t.name=e.name??"",t.symbol=e.symbol??"",t.description=e.description??"",t.uri=e.uri??"",t.uriHash=e.uriHash??"",t.data=e.data!==void 0&&e.data!==null?Any$5.fromPartial(e.data):void 0,t}};function createBaseNFT$1(){return{classId:"",id:"",uri:"",uriHash:"",data:void 0}}const NFT$1={encode(e,t=_m0.Writer.create()){return e.classId!==""&&t.uint32(10).string(e.classId),e.id!==""&&t.uint32(18).string(e.id),e.uri!==""&&t.uint32(26).string(e.uri),e.uriHash!==""&&t.uint32(34).string(e.uriHash),e.data!==void 0&&Any$5.encode(e.data,t.uint32(82).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseNFT$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.classId=n.string();break;case 2:u.id=n.string();break;case 3:u.uri=n.string();break;case 4:u.uriHash=n.string();break;case 10:u.data=Any$5.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{classId:isSet$V(e.classId)?String(e.classId):"",id:isSet$V(e.id)?String(e.id):"",uri:isSet$V(e.uri)?String(e.uri):"",uriHash:isSet$V(e.uriHash)?String(e.uriHash):"",data:isSet$V(e.data)?Any$5.fromJSON(e.data):void 0}},toJSON(e){const t={};return e.classId!==void 0&&(t.classId=e.classId),e.id!==void 0&&(t.id=e.id),e.uri!==void 0&&(t.uri=e.uri),e.uriHash!==void 0&&(t.uriHash=e.uriHash),e.data!==void 0&&(t.data=e.data?Any$5.toJSON(e.data):void 0),t},fromPartial(e){const t=createBaseNFT$1();return t.classId=e.classId??"",t.id=e.id??"",t.uri=e.uri??"",t.uriHash=e.uriHash??"",t.data=e.data!==void 0&&e.data!==null?Any$5.fromPartial(e.data):void 0,t}};function isSet$V(e){return e!=null}function createBaseEntry(){return{owner:"",nfts:[]}}const Entry={encode(e,t=_m0.Writer.create()){e.owner!==""&&t.uint32(10).string(e.owner);for(const n of e.nfts)NFT$1.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseEntry();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.owner=n.string();break;case 2:u.nfts.push(NFT$1.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{owner:isSet$U(e.owner)?String(e.owner):"",nfts:Array.isArray(e==null?void 0:e.nfts)?e.nfts.map(t=>NFT$1.fromJSON(t)):[]}},toJSON(e){const t={};return e.owner!==void 0&&(t.owner=e.owner),e.nfts?t.nfts=e.nfts.map(n=>n?NFT$1.toJSON(n):void 0):t.nfts=[],t},fromPartial(e){var n;const t=createBaseEntry();return t.owner=e.owner??"",t.nfts=((n=e.nfts)==null?void 0:n.map(p=>NFT$1.fromPartial(p)))||[],t}};function isSet$U(e){return e!=null}new build$b.Registry(msgTypes$e);function getStructure$e(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$e=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$e=({addr:e}={addr:"http://localhost:1317"})=>new Api$e({baseURL:e});let SDKModule$e=class{constructor(t){this.registry=[],this.query=queryClient$e({addr:t.env.apiURL}),this.updateTX(t),this.structure={EventSend:getStructure$e(EventSend.fromPartial({})),EventMint:getStructure$e(EventMint.fromPartial({})),EventBurn:getStructure$e(EventBurn.fromPartial({})),Entry:getStructure$e(Entry.fromPartial({})),Class:getStructure$e(Class$1.fromPartial({})),NFT:getStructure$e(NFT$1.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$e({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$e=e=>({module:{CosmosNftV1Beta1:new SDKModule$e(e)},registry:msgTypes$e}),msgTypes$d=[];let HttpClient$d=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$d=class extends HttpClient$d{constructor(){super(...arguments),this.queryParams=(t,n={})=>this.request({path:"/cosmos/params/v1beta1/params",method:"GET",query:t,format:"json",...n}),this.querySubspaces=(t={})=>this.request({path:"/cosmos/params/v1beta1/subspaces",method:"GET",format:"json",...t})}};function createBaseParameterChangeProposal(){return{title:"",description:"",changes:[]}}const ParameterChangeProposal={encode(e,t=_m0.Writer.create()){e.title!==""&&t.uint32(10).string(e.title),e.description!==""&&t.uint32(18).string(e.description);for(const n of e.changes)ParamChange.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParameterChangeProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.title=n.string();break;case 2:u.description=n.string();break;case 3:u.changes.push(ParamChange.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{title:isSet$T(e.title)?String(e.title):"",description:isSet$T(e.description)?String(e.description):"",changes:Array.isArray(e==null?void 0:e.changes)?e.changes.map(t=>ParamChange.fromJSON(t)):[]}},toJSON(e){const t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),e.changes?t.changes=e.changes.map(n=>n?ParamChange.toJSON(n):void 0):t.changes=[],t},fromPartial(e){var n;const t=createBaseParameterChangeProposal();return t.title=e.title??"",t.description=e.description??"",t.changes=((n=e.changes)==null?void 0:n.map(p=>ParamChange.fromPartial(p)))||[],t}};function createBaseParamChange(){return{subspace:"",key:"",value:""}}const ParamChange={encode(e,t=_m0.Writer.create()){return e.subspace!==""&&t.uint32(10).string(e.subspace),e.key!==""&&t.uint32(18).string(e.key),e.value!==""&&t.uint32(26).string(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParamChange();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.subspace=n.string();break;case 2:u.key=n.string();break;case 3:u.value=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{subspace:isSet$T(e.subspace)?String(e.subspace):"",key:isSet$T(e.key)?String(e.key):"",value:isSet$T(e.value)?String(e.value):""}},toJSON(e){const t={};return e.subspace!==void 0&&(t.subspace=e.subspace),e.key!==void 0&&(t.key=e.key),e.value!==void 0&&(t.value=e.value),t},fromPartial(e){const t=createBaseParamChange();return t.subspace=e.subspace??"",t.key=e.key??"",t.value=e.value??"",t}};function isSet$T(e){return e!=null}function createBaseSubspace(){return{subspace:"",keys:[]}}const Subspace={encode(e,t=_m0.Writer.create()){e.subspace!==""&&t.uint32(10).string(e.subspace);for(const n of e.keys)t.uint32(18).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseSubspace();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.subspace=n.string();break;case 2:u.keys.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{subspace:isSet$S(e.subspace)?String(e.subspace):"",keys:Array.isArray(e==null?void 0:e.keys)?e.keys.map(t=>String(t)):[]}},toJSON(e){const t={};return e.subspace!==void 0&&(t.subspace=e.subspace),e.keys?t.keys=e.keys.map(n=>n):t.keys=[],t},fromPartial(e){var n;const t=createBaseSubspace();return t.subspace=e.subspace??"",t.keys=((n=e.keys)==null?void 0:n.map(p=>p))||[],t}};function isSet$S(e){return e!=null}new build$b.Registry(msgTypes$d);function getStructure$d(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$d=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$d=({addr:e}={addr:"http://localhost:1317"})=>new Api$d({baseURL:e});let SDKModule$d=class{constructor(t){this.registry=[],this.query=queryClient$d({addr:t.env.apiURL}),this.updateTX(t),this.structure={ParameterChangeProposal:getStructure$d(ParameterChangeProposal.fromPartial({})),ParamChange:getStructure$d(ParamChange.fromPartial({})),Subspace:getStructure$d(Subspace.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$d({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$d=e=>({module:{CosmosParamsV1Beta1:new SDKModule$d(e)},registry:msgTypes$d});function createBaseDuration$1(){return{seconds:0,nanos:0}}const Duration$1={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDuration$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$u(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$R(e.seconds)?Number(e.seconds):0,nanos:isSet$R(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseDuration$1();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$P=(()=>{if(typeof globalThis$P<"u")return globalThis$P;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$u(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$P.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$R(e){return e!=null}function createBaseTimestamp$3(){return{seconds:0,nanos:0}}const Timestamp$3={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp$3();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$t(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$Q(e.seconds)?Number(e.seconds):0,nanos:isSet$Q(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp$3();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$O=(()=>{if(typeof globalThis$O<"u")return globalThis$O;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$t(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$O.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$Q(e){return e!=null}function createBaseValidatorSigningInfo(){return{address:"",startHeight:0,indexOffset:0,jailedUntil:void 0,tombstoned:!1,missedBlocksCounter:0}}const ValidatorSigningInfo={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.startHeight!==0&&t.uint32(16).int64(e.startHeight),e.indexOffset!==0&&t.uint32(24).int64(e.indexOffset),e.jailedUntil!==void 0&&Timestamp$3.encode(toTimestamp$4(e.jailedUntil),t.uint32(34).fork()).ldelim(),e.tombstoned===!0&&t.uint32(40).bool(e.tombstoned),e.missedBlocksCounter!==0&&t.uint32(48).int64(e.missedBlocksCounter),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorSigningInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.startHeight=longToNumber$s(n.int64());break;case 3:u.indexOffset=longToNumber$s(n.int64());break;case 4:u.jailedUntil=fromTimestamp$4(Timestamp$3.decode(n,n.uint32()));break;case 5:u.tombstoned=n.bool();break;case 6:u.missedBlocksCounter=longToNumber$s(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$P(e.address)?String(e.address):"",startHeight:isSet$P(e.startHeight)?Number(e.startHeight):0,indexOffset:isSet$P(e.indexOffset)?Number(e.indexOffset):0,jailedUntil:isSet$P(e.jailedUntil)?fromJsonTimestamp$4(e.jailedUntil):void 0,tombstoned:isSet$P(e.tombstoned)?!!e.tombstoned:!1,missedBlocksCounter:isSet$P(e.missedBlocksCounter)?Number(e.missedBlocksCounter):0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.startHeight!==void 0&&(t.startHeight=Math.round(e.startHeight)),e.indexOffset!==void 0&&(t.indexOffset=Math.round(e.indexOffset)),e.jailedUntil!==void 0&&(t.jailedUntil=e.jailedUntil.toISOString()),e.tombstoned!==void 0&&(t.tombstoned=e.tombstoned),e.missedBlocksCounter!==void 0&&(t.missedBlocksCounter=Math.round(e.missedBlocksCounter)),t},fromPartial(e){const t=createBaseValidatorSigningInfo();return t.address=e.address??"",t.startHeight=e.startHeight??0,t.indexOffset=e.indexOffset??0,t.jailedUntil=e.jailedUntil??void 0,t.tombstoned=e.tombstoned??!1,t.missedBlocksCounter=e.missedBlocksCounter??0,t}};function createBaseParams$8(){return{signedBlocksWindow:0,minSignedPerWindow:new Uint8Array,downtimeJailDuration:void 0,slashFractionDoubleSign:new Uint8Array,slashFractionDowntime:new Uint8Array}}const Params$8={encode(e,t=_m0.Writer.create()){return e.signedBlocksWindow!==0&&t.uint32(8).int64(e.signedBlocksWindow),e.minSignedPerWindow.length!==0&&t.uint32(18).bytes(e.minSignedPerWindow),e.downtimeJailDuration!==void 0&&Duration$1.encode(e.downtimeJailDuration,t.uint32(26).fork()).ldelim(),e.slashFractionDoubleSign.length!==0&&t.uint32(34).bytes(e.slashFractionDoubleSign),e.slashFractionDowntime.length!==0&&t.uint32(42).bytes(e.slashFractionDowntime),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$8();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.signedBlocksWindow=longToNumber$s(n.int64());break;case 2:u.minSignedPerWindow=n.bytes();break;case 3:u.downtimeJailDuration=Duration$1.decode(n,n.uint32());break;case 4:u.slashFractionDoubleSign=n.bytes();break;case 5:u.slashFractionDowntime=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{signedBlocksWindow:isSet$P(e.signedBlocksWindow)?Number(e.signedBlocksWindow):0,minSignedPerWindow:isSet$P(e.minSignedPerWindow)?bytesFromBase64$g(e.minSignedPerWindow):new Uint8Array,downtimeJailDuration:isSet$P(e.downtimeJailDuration)?Duration$1.fromJSON(e.downtimeJailDuration):void 0,slashFractionDoubleSign:isSet$P(e.slashFractionDoubleSign)?bytesFromBase64$g(e.slashFractionDoubleSign):new Uint8Array,slashFractionDowntime:isSet$P(e.slashFractionDowntime)?bytesFromBase64$g(e.slashFractionDowntime):new Uint8Array}},toJSON(e){const t={};return e.signedBlocksWindow!==void 0&&(t.signedBlocksWindow=Math.round(e.signedBlocksWindow)),e.minSignedPerWindow!==void 0&&(t.minSignedPerWindow=base64FromBytes$g(e.minSignedPerWindow!==void 0?e.minSignedPerWindow:new Uint8Array)),e.downtimeJailDuration!==void 0&&(t.downtimeJailDuration=e.downtimeJailDuration?Duration$1.toJSON(e.downtimeJailDuration):void 0),e.slashFractionDoubleSign!==void 0&&(t.slashFractionDoubleSign=base64FromBytes$g(e.slashFractionDoubleSign!==void 0?e.slashFractionDoubleSign:new Uint8Array)),e.slashFractionDowntime!==void 0&&(t.slashFractionDowntime=base64FromBytes$g(e.slashFractionDowntime!==void 0?e.slashFractionDowntime:new Uint8Array)),t},fromPartial(e){const t=createBaseParams$8();return t.signedBlocksWindow=e.signedBlocksWindow??0,t.minSignedPerWindow=e.minSignedPerWindow??new Uint8Array,t.downtimeJailDuration=e.downtimeJailDuration!==void 0&&e.downtimeJailDuration!==null?Duration$1.fromPartial(e.downtimeJailDuration):void 0,t.slashFractionDoubleSign=e.slashFractionDoubleSign??new Uint8Array,t.slashFractionDowntime=e.slashFractionDowntime??new Uint8Array,t}};var globalThis$N=(()=>{if(typeof globalThis$N<"u")return globalThis$N;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$g(e){if(globalThis$N.Buffer)return Uint8Array.from(globalThis$N.Buffer.from(e,"base64"));{const t=globalThis$N.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$g(e){if(globalThis$N.Buffer)return globalThis$N.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$N.btoa(t.join(""))}}function toTimestamp$4(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$4(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$4(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$4(Timestamp$3.fromJSON(e))}function longToNumber$s(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$N.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$P(e){return e!=null}function createBaseMsgUnjail(){return{validatorAddr:""}}const MsgUnjail={encode(e,t=_m0.Writer.create()){return e.validatorAddr!==""&&t.uint32(10).string(e.validatorAddr),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUnjail();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.validatorAddr=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{validatorAddr:isSet$O(e.validatorAddr)?String(e.validatorAddr):""}},toJSON(e){const t={};return e.validatorAddr!==void 0&&(t.validatorAddr=e.validatorAddr),t},fromPartial(e){const t=createBaseMsgUnjail();return t.validatorAddr=e.validatorAddr??"",t}};function isSet$O(e){return e!=null}const msgTypes$c=[["/cosmos.slashing.v1beta1.MsgUnjail",MsgUnjail]];let HttpClient$c=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$c=class extends HttpClient$c{constructor(){super(...arguments),this.queryParams=(t={})=>this.request({path:"/cosmos/slashing/v1beta1/params",method:"GET",format:"json",...t}),this.querySigningInfos=(t,n={})=>this.request({path:"/cosmos/slashing/v1beta1/signing_infos",method:"GET",query:t,format:"json",...n}),this.querySigningInfo=(t,n={})=>this.request({path:`/cosmos/slashing/v1beta1/signing_infos/${t}`,method:"GET",format:"json",...n})}};function createBaseSigningInfo(){return{address:"",validatorSigningInfo:void 0}}const SigningInfo={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.validatorSigningInfo!==void 0&&ValidatorSigningInfo.encode(e.validatorSigningInfo,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseSigningInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.validatorSigningInfo=ValidatorSigningInfo.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$N(e.address)?String(e.address):"",validatorSigningInfo:isSet$N(e.validatorSigningInfo)?ValidatorSigningInfo.fromJSON(e.validatorSigningInfo):void 0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.validatorSigningInfo!==void 0&&(t.validatorSigningInfo=e.validatorSigningInfo?ValidatorSigningInfo.toJSON(e.validatorSigningInfo):void 0),t},fromPartial(e){const t=createBaseSigningInfo();return t.address=e.address??"",t.validatorSigningInfo=e.validatorSigningInfo!==void 0&&e.validatorSigningInfo!==null?ValidatorSigningInfo.fromPartial(e.validatorSigningInfo):void 0,t}};function createBaseValidatorMissedBlocks(){return{address:"",missedBlocks:[]}}const ValidatorMissedBlocks={encode(e,t=_m0.Writer.create()){e.address!==""&&t.uint32(10).string(e.address);for(const n of e.missedBlocks)MissedBlock.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorMissedBlocks();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.missedBlocks.push(MissedBlock.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$N(e.address)?String(e.address):"",missedBlocks:Array.isArray(e==null?void 0:e.missedBlocks)?e.missedBlocks.map(t=>MissedBlock.fromJSON(t)):[]}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.missedBlocks?t.missedBlocks=e.missedBlocks.map(n=>n?MissedBlock.toJSON(n):void 0):t.missedBlocks=[],t},fromPartial(e){var n;const t=createBaseValidatorMissedBlocks();return t.address=e.address??"",t.missedBlocks=((n=e.missedBlocks)==null?void 0:n.map(p=>MissedBlock.fromPartial(p)))||[],t}};function createBaseMissedBlock(){return{index:0,missed:!1}}const MissedBlock={encode(e,t=_m0.Writer.create()){return e.index!==0&&t.uint32(8).int64(e.index),e.missed===!0&&t.uint32(16).bool(e.missed),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMissedBlock();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.index=longToNumber$r(n.int64());break;case 2:u.missed=n.bool();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{index:isSet$N(e.index)?Number(e.index):0,missed:isSet$N(e.missed)?!!e.missed:!1}},toJSON(e){const t={};return e.index!==void 0&&(t.index=Math.round(e.index)),e.missed!==void 0&&(t.missed=e.missed),t},fromPartial(e){const t=createBaseMissedBlock();return t.index=e.index??0,t.missed=e.missed??!1,t}};var globalThis$M=(()=>{if(typeof globalThis$M<"u")return globalThis$M;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$r(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$M.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$N(e){return e!=null}const registry$6=new build$b.Registry(msgTypes$c);function getStructure$c(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$5={amount:[],gas:"200000"},txClient$c=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgUnjail({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUnjail: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$6,prefix:t});let N=this.msgUnjail({value:MsgUnjail.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$5,g)}catch(y){throw new Error("TxClient:sendMsgUnjail: Could not broadcast Tx: "+y.message)}},msgUnjail({value:p}){try{return{typeUrl:"/cosmos.slashing.v1beta1.MsgUnjail",value:MsgUnjail.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUnjail: Could not create message: "+u.message)}}}),queryClient$c=({addr:e}={addr:"http://localhost:1317"})=>new Api$c({baseURL:e});let SDKModule$c=class{constructor(t){this.registry=[],this.query=queryClient$c({addr:t.env.apiURL}),this.updateTX(t),this.structure={SigningInfo:getStructure$c(SigningInfo.fromPartial({})),ValidatorMissedBlocks:getStructure$c(ValidatorMissedBlocks.fromPartial({})),MissedBlock:getStructure$c(MissedBlock.fromPartial({})),ValidatorSigningInfo:getStructure$c(ValidatorSigningInfo.fromPartial({})),Params:getStructure$c(Params$8.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$c({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$c=e=>({module:{CosmosSlashingV1Beta1:new SDKModule$c(e)},registry:msgTypes$c});function createBaseAny$4(){return{typeUrl:"",value:new Uint8Array}}const Any$4={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$4();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$M(e.typeUrl)?String(e.typeUrl):"",value:isSet$M(e.value)?bytesFromBase64$f(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$f(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$4();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$L=(()=>{if(typeof globalThis$L<"u")return globalThis$L;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$f(e){if(globalThis$L.Buffer)return Uint8Array.from(globalThis$L.Buffer.from(e,"base64"));{const t=globalThis$L.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$f(e){if(globalThis$L.Buffer)return globalThis$L.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$L.btoa(t.join(""))}}function isSet$M(e){return e!=null}function createBaseTimestamp$2(){return{seconds:0,nanos:0}}const Timestamp$2={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$q(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$L(e.seconds)?Number(e.seconds):0,nanos:isSet$L(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp$2();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$K=(()=>{if(typeof globalThis$K<"u")return globalThis$K;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$q(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$K.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$L(e){return e!=null}function createBaseCoin$4(){return{denom:"",amount:""}}const Coin$4={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin$4();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$K(e.denom)?String(e.denom):"",amount:isSet$K(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin$4();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$K(e){return e!=null}function createBaseDuration(){return{seconds:0,nanos:0}}const Duration={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDuration();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$p(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$J(e.seconds)?Number(e.seconds):0,nanos:isSet$J(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseDuration();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$J=(()=>{if(typeof globalThis$J<"u")return globalThis$J;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$p(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$J.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$J(e){return e!=null}function createBasePublicKey(){return{ed25519:void 0,secp256k1:void 0}}const PublicKey={encode(e,t=_m0.Writer.create()){return e.ed25519!==void 0&&t.uint32(10).bytes(e.ed25519),e.secp256k1!==void 0&&t.uint32(18).bytes(e.secp256k1),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePublicKey();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.ed25519=n.bytes();break;case 2:u.secp256k1=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{ed25519:isSet$I(e.ed25519)?bytesFromBase64$e(e.ed25519):void 0,secp256k1:isSet$I(e.secp256k1)?bytesFromBase64$e(e.secp256k1):void 0}},toJSON(e){const t={};return e.ed25519!==void 0&&(t.ed25519=e.ed25519!==void 0?base64FromBytes$e(e.ed25519):void 0),e.secp256k1!==void 0&&(t.secp256k1=e.secp256k1!==void 0?base64FromBytes$e(e.secp256k1):void 0),t},fromPartial(e){const t=createBasePublicKey();return t.ed25519=e.ed25519??void 0,t.secp256k1=e.secp256k1??void 0,t}};var globalThis$I=(()=>{if(typeof globalThis$I<"u")return globalThis$I;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$e(e){if(globalThis$I.Buffer)return Uint8Array.from(globalThis$I.Buffer.from(e,"base64"));{const t=globalThis$I.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$e(e){if(globalThis$I.Buffer)return globalThis$I.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$I.btoa(t.join(""))}}function isSet$I(e){return e!=null}var globalThis$H=(()=>{if(typeof globalThis$H<"u")return globalThis$H;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());var globalThis$G=(()=>{if(typeof globalThis$G<"u")return globalThis$G;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function createBaseConsensus(){return{block:0,app:0}}const Consensus={encode(e,t=_m0.Writer.create()){return e.block!==0&&t.uint32(8).uint64(e.block),e.app!==0&&t.uint32(16).uint64(e.app),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseConsensus();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.block=longToNumber$o(n.uint64());break;case 2:u.app=longToNumber$o(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{block:isSet$H(e.block)?Number(e.block):0,app:isSet$H(e.app)?Number(e.app):0}},toJSON(e){const t={};return e.block!==void 0&&(t.block=Math.round(e.block)),e.app!==void 0&&(t.app=Math.round(e.app)),t},fromPartial(e){const t=createBaseConsensus();return t.block=e.block??0,t.app=e.app??0,t}};var globalThis$F=(()=>{if(typeof globalThis$F<"u")return globalThis$F;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$o(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$F.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$H(e){return e!=null}var globalThis$E=(()=>{if(typeof globalThis$E<"u")return globalThis$E;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function createBasePartSetHeader(){return{total:0,hash:new Uint8Array}}const PartSetHeader={encode(e,t=_m0.Writer.create()){return e.total!==0&&t.uint32(8).uint32(e.total),e.hash.length!==0&&t.uint32(18).bytes(e.hash),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePartSetHeader();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.total=n.uint32();break;case 2:u.hash=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{total:isSet$G(e.total)?Number(e.total):0,hash:isSet$G(e.hash)?bytesFromBase64$d(e.hash):new Uint8Array}},toJSON(e){const t={};return e.total!==void 0&&(t.total=Math.round(e.total)),e.hash!==void 0&&(t.hash=base64FromBytes$d(e.hash!==void 0?e.hash:new Uint8Array)),t},fromPartial(e){const t=createBasePartSetHeader();return t.total=e.total??0,t.hash=e.hash??new Uint8Array,t}};function createBaseBlockID(){return{hash:new Uint8Array,partSetHeader:void 0}}const BlockID={encode(e,t=_m0.Writer.create()){return e.hash.length!==0&&t.uint32(10).bytes(e.hash),e.partSetHeader!==void 0&&PartSetHeader.encode(e.partSetHeader,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseBlockID();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.hash=n.bytes();break;case 2:u.partSetHeader=PartSetHeader.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{hash:isSet$G(e.hash)?bytesFromBase64$d(e.hash):new Uint8Array,partSetHeader:isSet$G(e.partSetHeader)?PartSetHeader.fromJSON(e.partSetHeader):void 0}},toJSON(e){const t={};return e.hash!==void 0&&(t.hash=base64FromBytes$d(e.hash!==void 0?e.hash:new Uint8Array)),e.partSetHeader!==void 0&&(t.partSetHeader=e.partSetHeader?PartSetHeader.toJSON(e.partSetHeader):void 0),t},fromPartial(e){const t=createBaseBlockID();return t.hash=e.hash??new Uint8Array,t.partSetHeader=e.partSetHeader!==void 0&&e.partSetHeader!==null?PartSetHeader.fromPartial(e.partSetHeader):void 0,t}};function createBaseHeader(){return{version:void 0,chainId:"",height:0,time:void 0,lastBlockId:void 0,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}}const Header={encode(e,t=_m0.Writer.create()){return e.version!==void 0&&Consensus.encode(e.version,t.uint32(10).fork()).ldelim(),e.chainId!==""&&t.uint32(18).string(e.chainId),e.height!==0&&t.uint32(24).int64(e.height),e.time!==void 0&&Timestamp$2.encode(toTimestamp$3(e.time),t.uint32(34).fork()).ldelim(),e.lastBlockId!==void 0&&BlockID.encode(e.lastBlockId,t.uint32(42).fork()).ldelim(),e.lastCommitHash.length!==0&&t.uint32(50).bytes(e.lastCommitHash),e.dataHash.length!==0&&t.uint32(58).bytes(e.dataHash),e.validatorsHash.length!==0&&t.uint32(66).bytes(e.validatorsHash),e.nextValidatorsHash.length!==0&&t.uint32(74).bytes(e.nextValidatorsHash),e.consensusHash.length!==0&&t.uint32(82).bytes(e.consensusHash),e.appHash.length!==0&&t.uint32(90).bytes(e.appHash),e.lastResultsHash.length!==0&&t.uint32(98).bytes(e.lastResultsHash),e.evidenceHash.length!==0&&t.uint32(106).bytes(e.evidenceHash),e.proposerAddress.length!==0&&t.uint32(114).bytes(e.proposerAddress),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseHeader();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.version=Consensus.decode(n,n.uint32());break;case 2:u.chainId=n.string();break;case 3:u.height=longToNumber$n(n.int64());break;case 4:u.time=fromTimestamp$3(Timestamp$2.decode(n,n.uint32()));break;case 5:u.lastBlockId=BlockID.decode(n,n.uint32());break;case 6:u.lastCommitHash=n.bytes();break;case 7:u.dataHash=n.bytes();break;case 8:u.validatorsHash=n.bytes();break;case 9:u.nextValidatorsHash=n.bytes();break;case 10:u.consensusHash=n.bytes();break;case 11:u.appHash=n.bytes();break;case 12:u.lastResultsHash=n.bytes();break;case 13:u.evidenceHash=n.bytes();break;case 14:u.proposerAddress=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{version:isSet$G(e.version)?Consensus.fromJSON(e.version):void 0,chainId:isSet$G(e.chainId)?String(e.chainId):"",height:isSet$G(e.height)?Number(e.height):0,time:isSet$G(e.time)?fromJsonTimestamp$3(e.time):void 0,lastBlockId:isSet$G(e.lastBlockId)?BlockID.fromJSON(e.lastBlockId):void 0,lastCommitHash:isSet$G(e.lastCommitHash)?bytesFromBase64$d(e.lastCommitHash):new Uint8Array,dataHash:isSet$G(e.dataHash)?bytesFromBase64$d(e.dataHash):new Uint8Array,validatorsHash:isSet$G(e.validatorsHash)?bytesFromBase64$d(e.validatorsHash):new Uint8Array,nextValidatorsHash:isSet$G(e.nextValidatorsHash)?bytesFromBase64$d(e.nextValidatorsHash):new Uint8Array,consensusHash:isSet$G(e.consensusHash)?bytesFromBase64$d(e.consensusHash):new Uint8Array,appHash:isSet$G(e.appHash)?bytesFromBase64$d(e.appHash):new Uint8Array,lastResultsHash:isSet$G(e.lastResultsHash)?bytesFromBase64$d(e.lastResultsHash):new Uint8Array,evidenceHash:isSet$G(e.evidenceHash)?bytesFromBase64$d(e.evidenceHash):new Uint8Array,proposerAddress:isSet$G(e.proposerAddress)?bytesFromBase64$d(e.proposerAddress):new Uint8Array}},toJSON(e){const t={};return e.version!==void 0&&(t.version=e.version?Consensus.toJSON(e.version):void 0),e.chainId!==void 0&&(t.chainId=e.chainId),e.height!==void 0&&(t.height=Math.round(e.height)),e.time!==void 0&&(t.time=e.time.toISOString()),e.lastBlockId!==void 0&&(t.lastBlockId=e.lastBlockId?BlockID.toJSON(e.lastBlockId):void 0),e.lastCommitHash!==void 0&&(t.lastCommitHash=base64FromBytes$d(e.lastCommitHash!==void 0?e.lastCommitHash:new Uint8Array)),e.dataHash!==void 0&&(t.dataHash=base64FromBytes$d(e.dataHash!==void 0?e.dataHash:new Uint8Array)),e.validatorsHash!==void 0&&(t.validatorsHash=base64FromBytes$d(e.validatorsHash!==void 0?e.validatorsHash:new Uint8Array)),e.nextValidatorsHash!==void 0&&(t.nextValidatorsHash=base64FromBytes$d(e.nextValidatorsHash!==void 0?e.nextValidatorsHash:new Uint8Array)),e.consensusHash!==void 0&&(t.consensusHash=base64FromBytes$d(e.consensusHash!==void 0?e.consensusHash:new Uint8Array)),e.appHash!==void 0&&(t.appHash=base64FromBytes$d(e.appHash!==void 0?e.appHash:new Uint8Array)),e.lastResultsHash!==void 0&&(t.lastResultsHash=base64FromBytes$d(e.lastResultsHash!==void 0?e.lastResultsHash:new Uint8Array)),e.evidenceHash!==void 0&&(t.evidenceHash=base64FromBytes$d(e.evidenceHash!==void 0?e.evidenceHash:new Uint8Array)),e.proposerAddress!==void 0&&(t.proposerAddress=base64FromBytes$d(e.proposerAddress!==void 0?e.proposerAddress:new Uint8Array)),t},fromPartial(e){const t=createBaseHeader();return t.version=e.version!==void 0&&e.version!==null?Consensus.fromPartial(e.version):void 0,t.chainId=e.chainId??"",t.height=e.height??0,t.time=e.time??void 0,t.lastBlockId=e.lastBlockId!==void 0&&e.lastBlockId!==null?BlockID.fromPartial(e.lastBlockId):void 0,t.lastCommitHash=e.lastCommitHash??new Uint8Array,t.dataHash=e.dataHash??new Uint8Array,t.validatorsHash=e.validatorsHash??new Uint8Array,t.nextValidatorsHash=e.nextValidatorsHash??new Uint8Array,t.consensusHash=e.consensusHash??new Uint8Array,t.appHash=e.appHash??new Uint8Array,t.lastResultsHash=e.lastResultsHash??new Uint8Array,t.evidenceHash=e.evidenceHash??new Uint8Array,t.proposerAddress=e.proposerAddress??new Uint8Array,t}};var globalThis$D=(()=>{if(typeof globalThis$D<"u")return globalThis$D;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$d(e){if(globalThis$D.Buffer)return Uint8Array.from(globalThis$D.Buffer.from(e,"base64"));{const t=globalThis$D.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$d(e){if(globalThis$D.Buffer)return globalThis$D.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$D.btoa(t.join(""))}}function toTimestamp$3(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$3(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$3(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$3(Timestamp$2.fromJSON(e))}function longToNumber$n(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$D.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$G(e){return e!=null}function createBaseValidatorUpdate(){return{pubKey:void 0,power:0}}const ValidatorUpdate={encode(e,t=_m0.Writer.create()){return e.pubKey!==void 0&&PublicKey.encode(e.pubKey,t.uint32(10).fork()).ldelim(),e.power!==0&&t.uint32(16).int64(e.power),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorUpdate();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.pubKey=PublicKey.decode(n,n.uint32());break;case 2:u.power=longToNumber$m(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{pubKey:isSet$F(e.pubKey)?PublicKey.fromJSON(e.pubKey):void 0,power:isSet$F(e.power)?Number(e.power):0}},toJSON(e){const t={};return e.pubKey!==void 0&&(t.pubKey=e.pubKey?PublicKey.toJSON(e.pubKey):void 0),e.power!==void 0&&(t.power=Math.round(e.power)),t},fromPartial(e){const t=createBaseValidatorUpdate();return t.pubKey=e.pubKey!==void 0&&e.pubKey!==null?PublicKey.fromPartial(e.pubKey):void 0,t.power=e.power??0,t}};var globalThis$C=(()=>{if(typeof globalThis$C<"u")return globalThis$C;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$m(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$C.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$F(e){return e!=null}function bondStatusFromJSON(e){switch(e){case 0:case"BOND_STATUS_UNSPECIFIED":return 0;case 1:case"BOND_STATUS_UNBONDED":return 1;case 2:case"BOND_STATUS_UNBONDING":return 2;case 3:case"BOND_STATUS_BONDED":return 3;case-1:case"UNRECOGNIZED":default:return-1}}function bondStatusToJSON(e){switch(e){case 0:return"BOND_STATUS_UNSPECIFIED";case 1:return"BOND_STATUS_UNBONDED";case 2:return"BOND_STATUS_UNBONDING";case 3:return"BOND_STATUS_BONDED";case-1:default:return"UNRECOGNIZED"}}function createBaseHistoricalInfo(){return{header:void 0,valset:[]}}const HistoricalInfo={encode(e,t=_m0.Writer.create()){e.header!==void 0&&Header.encode(e.header,t.uint32(10).fork()).ldelim();for(const n of e.valset)Validator.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseHistoricalInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.header=Header.decode(n,n.uint32());break;case 2:u.valset.push(Validator.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{header:isSet$E(e.header)?Header.fromJSON(e.header):void 0,valset:Array.isArray(e==null?void 0:e.valset)?e.valset.map(t=>Validator.fromJSON(t)):[]}},toJSON(e){const t={};return e.header!==void 0&&(t.header=e.header?Header.toJSON(e.header):void 0),e.valset?t.valset=e.valset.map(n=>n?Validator.toJSON(n):void 0):t.valset=[],t},fromPartial(e){var n;const t=createBaseHistoricalInfo();return t.header=e.header!==void 0&&e.header!==null?Header.fromPartial(e.header):void 0,t.valset=((n=e.valset)==null?void 0:n.map(p=>Validator.fromPartial(p)))||[],t}};function createBaseCommissionRates(){return{rate:"",maxRate:"",maxChangeRate:""}}const CommissionRates={encode(e,t=_m0.Writer.create()){return e.rate!==""&&t.uint32(10).string(e.rate),e.maxRate!==""&&t.uint32(18).string(e.maxRate),e.maxChangeRate!==""&&t.uint32(26).string(e.maxChangeRate),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCommissionRates();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.rate=n.string();break;case 2:u.maxRate=n.string();break;case 3:u.maxChangeRate=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{rate:isSet$E(e.rate)?String(e.rate):"",maxRate:isSet$E(e.maxRate)?String(e.maxRate):"",maxChangeRate:isSet$E(e.maxChangeRate)?String(e.maxChangeRate):""}},toJSON(e){const t={};return e.rate!==void 0&&(t.rate=e.rate),e.maxRate!==void 0&&(t.maxRate=e.maxRate),e.maxChangeRate!==void 0&&(t.maxChangeRate=e.maxChangeRate),t},fromPartial(e){const t=createBaseCommissionRates();return t.rate=e.rate??"",t.maxRate=e.maxRate??"",t.maxChangeRate=e.maxChangeRate??"",t}};function createBaseCommission(){return{commissionRates:void 0,updateTime:void 0}}const Commission={encode(e,t=_m0.Writer.create()){return e.commissionRates!==void 0&&CommissionRates.encode(e.commissionRates,t.uint32(10).fork()).ldelim(),e.updateTime!==void 0&&Timestamp$2.encode(toTimestamp$2(e.updateTime),t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCommission();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.commissionRates=CommissionRates.decode(n,n.uint32());break;case 2:u.updateTime=fromTimestamp$2(Timestamp$2.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{commissionRates:isSet$E(e.commissionRates)?CommissionRates.fromJSON(e.commissionRates):void 0,updateTime:isSet$E(e.updateTime)?fromJsonTimestamp$2(e.updateTime):void 0}},toJSON(e){const t={};return e.commissionRates!==void 0&&(t.commissionRates=e.commissionRates?CommissionRates.toJSON(e.commissionRates):void 0),e.updateTime!==void 0&&(t.updateTime=e.updateTime.toISOString()),t},fromPartial(e){const t=createBaseCommission();return t.commissionRates=e.commissionRates!==void 0&&e.commissionRates!==null?CommissionRates.fromPartial(e.commissionRates):void 0,t.updateTime=e.updateTime??void 0,t}};function createBaseDescription(){return{moniker:"",identity:"",website:"",securityContact:"",details:""}}const Description={encode(e,t=_m0.Writer.create()){return e.moniker!==""&&t.uint32(10).string(e.moniker),e.identity!==""&&t.uint32(18).string(e.identity),e.website!==""&&t.uint32(26).string(e.website),e.securityContact!==""&&t.uint32(34).string(e.securityContact),e.details!==""&&t.uint32(42).string(e.details),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDescription();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.moniker=n.string();break;case 2:u.identity=n.string();break;case 3:u.website=n.string();break;case 4:u.securityContact=n.string();break;case 5:u.details=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{moniker:isSet$E(e.moniker)?String(e.moniker):"",identity:isSet$E(e.identity)?String(e.identity):"",website:isSet$E(e.website)?String(e.website):"",securityContact:isSet$E(e.securityContact)?String(e.securityContact):"",details:isSet$E(e.details)?String(e.details):""}},toJSON(e){const t={};return e.moniker!==void 0&&(t.moniker=e.moniker),e.identity!==void 0&&(t.identity=e.identity),e.website!==void 0&&(t.website=e.website),e.securityContact!==void 0&&(t.securityContact=e.securityContact),e.details!==void 0&&(t.details=e.details),t},fromPartial(e){const t=createBaseDescription();return t.moniker=e.moniker??"",t.identity=e.identity??"",t.website=e.website??"",t.securityContact=e.securityContact??"",t.details=e.details??"",t}};function createBaseValidator(){return{operatorAddress:"",consensusPubkey:void 0,jailed:!1,status:0,tokens:"",delegatorShares:"",description:void 0,unbondingHeight:0,unbondingTime:void 0,commission:void 0,minSelfDelegation:"",unbondingOnHoldRefCount:0,unbondingIds:[]}}const Validator={encode(e,t=_m0.Writer.create()){e.operatorAddress!==""&&t.uint32(10).string(e.operatorAddress),e.consensusPubkey!==void 0&&Any$4.encode(e.consensusPubkey,t.uint32(18).fork()).ldelim(),e.jailed===!0&&t.uint32(24).bool(e.jailed),e.status!==0&&t.uint32(32).int32(e.status),e.tokens!==""&&t.uint32(42).string(e.tokens),e.delegatorShares!==""&&t.uint32(50).string(e.delegatorShares),e.description!==void 0&&Description.encode(e.description,t.uint32(58).fork()).ldelim(),e.unbondingHeight!==0&&t.uint32(64).int64(e.unbondingHeight),e.unbondingTime!==void 0&&Timestamp$2.encode(toTimestamp$2(e.unbondingTime),t.uint32(74).fork()).ldelim(),e.commission!==void 0&&Commission.encode(e.commission,t.uint32(82).fork()).ldelim(),e.minSelfDelegation!==""&&t.uint32(90).string(e.minSelfDelegation),e.unbondingOnHoldRefCount!==0&&t.uint32(96).int64(e.unbondingOnHoldRefCount),t.uint32(106).fork();for(const n of e.unbondingIds)t.uint64(n);return t.ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidator();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.operatorAddress=n.string();break;case 2:u.consensusPubkey=Any$4.decode(n,n.uint32());break;case 3:u.jailed=n.bool();break;case 4:u.status=n.int32();break;case 5:u.tokens=n.string();break;case 6:u.delegatorShares=n.string();break;case 7:u.description=Description.decode(n,n.uint32());break;case 8:u.unbondingHeight=longToNumber$l(n.int64());break;case 9:u.unbondingTime=fromTimestamp$2(Timestamp$2.decode(n,n.uint32()));break;case 10:u.commission=Commission.decode(n,n.uint32());break;case 11:u.minSelfDelegation=n.string();break;case 12:u.unbondingOnHoldRefCount=longToNumber$l(n.int64());break;case 13:if((g&7)===2){const y=n.uint32()+n.pos;for(;n.pos<y;)u.unbondingIds.push(longToNumber$l(n.uint64()))}else u.unbondingIds.push(longToNumber$l(n.uint64()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{operatorAddress:isSet$E(e.operatorAddress)?String(e.operatorAddress):"",consensusPubkey:isSet$E(e.consensusPubkey)?Any$4.fromJSON(e.consensusPubkey):void 0,jailed:isSet$E(e.jailed)?!!e.jailed:!1,status:isSet$E(e.status)?bondStatusFromJSON(e.status):0,tokens:isSet$E(e.tokens)?String(e.tokens):"",delegatorShares:isSet$E(e.delegatorShares)?String(e.delegatorShares):"",description:isSet$E(e.description)?Description.fromJSON(e.description):void 0,unbondingHeight:isSet$E(e.unbondingHeight)?Number(e.unbondingHeight):0,unbondingTime:isSet$E(e.unbondingTime)?fromJsonTimestamp$2(e.unbondingTime):void 0,commission:isSet$E(e.commission)?Commission.fromJSON(e.commission):void 0,minSelfDelegation:isSet$E(e.minSelfDelegation)?String(e.minSelfDelegation):"",unbondingOnHoldRefCount:isSet$E(e.unbondingOnHoldRefCount)?Number(e.unbondingOnHoldRefCount):0,unbondingIds:Array.isArray(e==null?void 0:e.unbondingIds)?e.unbondingIds.map(t=>Number(t)):[]}},toJSON(e){const t={};return e.operatorAddress!==void 0&&(t.operatorAddress=e.operatorAddress),e.consensusPubkey!==void 0&&(t.consensusPubkey=e.consensusPubkey?Any$4.toJSON(e.consensusPubkey):void 0),e.jailed!==void 0&&(t.jailed=e.jailed),e.status!==void 0&&(t.status=bondStatusToJSON(e.status)),e.tokens!==void 0&&(t.tokens=e.tokens),e.delegatorShares!==void 0&&(t.delegatorShares=e.delegatorShares),e.description!==void 0&&(t.description=e.description?Description.toJSON(e.description):void 0),e.unbondingHeight!==void 0&&(t.unbondingHeight=Math.round(e.unbondingHeight)),e.unbondingTime!==void 0&&(t.unbondingTime=e.unbondingTime.toISOString()),e.commission!==void 0&&(t.commission=e.commission?Commission.toJSON(e.commission):void 0),e.minSelfDelegation!==void 0&&(t.minSelfDelegation=e.minSelfDelegation),e.unbondingOnHoldRefCount!==void 0&&(t.unbondingOnHoldRefCount=Math.round(e.unbondingOnHoldRefCount)),e.unbondingIds?t.unbondingIds=e.unbondingIds.map(n=>Math.round(n)):t.unbondingIds=[],t},fromPartial(e){var n;const t=createBaseValidator();return t.operatorAddress=e.operatorAddress??"",t.consensusPubkey=e.consensusPubkey!==void 0&&e.consensusPubkey!==null?Any$4.fromPartial(e.consensusPubkey):void 0,t.jailed=e.jailed??!1,t.status=e.status??0,t.tokens=e.tokens??"",t.delegatorShares=e.delegatorShares??"",t.description=e.description!==void 0&&e.description!==null?Description.fromPartial(e.description):void 0,t.unbondingHeight=e.unbondingHeight??0,t.unbondingTime=e.unbondingTime??void 0,t.commission=e.commission!==void 0&&e.commission!==null?Commission.fromPartial(e.commission):void 0,t.minSelfDelegation=e.minSelfDelegation??"",t.unbondingOnHoldRefCount=e.unbondingOnHoldRefCount??0,t.unbondingIds=((n=e.unbondingIds)==null?void 0:n.map(p=>p))||[],t}};function createBaseValAddresses(){return{addresses:[]}}const ValAddresses={encode(e,t=_m0.Writer.create()){for(const n of e.addresses)t.uint32(10).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValAddresses();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.addresses.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{addresses:Array.isArray(e==null?void 0:e.addresses)?e.addresses.map(t=>String(t)):[]}},toJSON(e){const t={};return e.addresses?t.addresses=e.addresses.map(n=>n):t.addresses=[],t},fromPartial(e){var n;const t=createBaseValAddresses();return t.addresses=((n=e.addresses)==null?void 0:n.map(p=>p))||[],t}};function createBaseDVPair(){return{delegatorAddress:"",validatorAddress:""}}const DVPair={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==""&&t.uint32(18).string(e.validatorAddress),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDVPair();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorAddress=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$E(e.delegatorAddress)?String(e.delegatorAddress):"",validatorAddress:isSet$E(e.validatorAddress)?String(e.validatorAddress):""}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){const t=createBaseDVPair();return t.delegatorAddress=e.delegatorAddress??"",t.validatorAddress=e.validatorAddress??"",t}};function createBaseDVPairs(){return{pairs:[]}}const DVPairs={encode(e,t=_m0.Writer.create()){for(const n of e.pairs)DVPair.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDVPairs();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.pairs.push(DVPair.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{pairs:Array.isArray(e==null?void 0:e.pairs)?e.pairs.map(t=>DVPair.fromJSON(t)):[]}},toJSON(e){const t={};return e.pairs?t.pairs=e.pairs.map(n=>n?DVPair.toJSON(n):void 0):t.pairs=[],t},fromPartial(e){var n;const t=createBaseDVPairs();return t.pairs=((n=e.pairs)==null?void 0:n.map(p=>DVPair.fromPartial(p)))||[],t}};function createBaseDVVTriplet(){return{delegatorAddress:"",validatorSrcAddress:"",validatorDstAddress:""}}const DVVTriplet={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorSrcAddress!==""&&t.uint32(18).string(e.validatorSrcAddress),e.validatorDstAddress!==""&&t.uint32(26).string(e.validatorDstAddress),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDVVTriplet();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorSrcAddress=n.string();break;case 3:u.validatorDstAddress=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$E(e.delegatorAddress)?String(e.delegatorAddress):"",validatorSrcAddress:isSet$E(e.validatorSrcAddress)?String(e.validatorSrcAddress):"",validatorDstAddress:isSet$E(e.validatorDstAddress)?String(e.validatorDstAddress):""}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorSrcAddress!==void 0&&(t.validatorSrcAddress=e.validatorSrcAddress),e.validatorDstAddress!==void 0&&(t.validatorDstAddress=e.validatorDstAddress),t},fromPartial(e){const t=createBaseDVVTriplet();return t.delegatorAddress=e.delegatorAddress??"",t.validatorSrcAddress=e.validatorSrcAddress??"",t.validatorDstAddress=e.validatorDstAddress??"",t}};function createBaseDVVTriplets(){return{triplets:[]}}const DVVTriplets={encode(e,t=_m0.Writer.create()){for(const n of e.triplets)DVVTriplet.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDVVTriplets();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.triplets.push(DVVTriplet.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{triplets:Array.isArray(e==null?void 0:e.triplets)?e.triplets.map(t=>DVVTriplet.fromJSON(t)):[]}},toJSON(e){const t={};return e.triplets?t.triplets=e.triplets.map(n=>n?DVVTriplet.toJSON(n):void 0):t.triplets=[],t},fromPartial(e){var n;const t=createBaseDVVTriplets();return t.triplets=((n=e.triplets)==null?void 0:n.map(p=>DVVTriplet.fromPartial(p)))||[],t}};function createBaseDelegation(){return{delegatorAddress:"",validatorAddress:"",shares:""}}const Delegation={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==""&&t.uint32(18).string(e.validatorAddress),e.shares!==""&&t.uint32(26).string(e.shares),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDelegation();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorAddress=n.string();break;case 3:u.shares=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$E(e.delegatorAddress)?String(e.delegatorAddress):"",validatorAddress:isSet$E(e.validatorAddress)?String(e.validatorAddress):"",shares:isSet$E(e.shares)?String(e.shares):""}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.shares!==void 0&&(t.shares=e.shares),t},fromPartial(e){const t=createBaseDelegation();return t.delegatorAddress=e.delegatorAddress??"",t.validatorAddress=e.validatorAddress??"",t.shares=e.shares??"",t}};function createBaseUnbondingDelegation(){return{delegatorAddress:"",validatorAddress:"",entries:[]}}const UnbondingDelegation={encode(e,t=_m0.Writer.create()){e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==""&&t.uint32(18).string(e.validatorAddress);for(const n of e.entries)UnbondingDelegationEntry.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseUnbondingDelegation();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorAddress=n.string();break;case 3:u.entries.push(UnbondingDelegationEntry.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$E(e.delegatorAddress)?String(e.delegatorAddress):"",validatorAddress:isSet$E(e.validatorAddress)?String(e.validatorAddress):"",entries:Array.isArray(e==null?void 0:e.entries)?e.entries.map(t=>UnbondingDelegationEntry.fromJSON(t)):[]}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.entries?t.entries=e.entries.map(n=>n?UnbondingDelegationEntry.toJSON(n):void 0):t.entries=[],t},fromPartial(e){var n;const t=createBaseUnbondingDelegation();return t.delegatorAddress=e.delegatorAddress??"",t.validatorAddress=e.validatorAddress??"",t.entries=((n=e.entries)==null?void 0:n.map(p=>UnbondingDelegationEntry.fromPartial(p)))||[],t}};function createBaseUnbondingDelegationEntry(){return{creationHeight:0,completionTime:void 0,initialBalance:"",balance:"",unbondingId:0,unbondingOnHoldRefCount:0}}const UnbondingDelegationEntry={encode(e,t=_m0.Writer.create()){return e.creationHeight!==0&&t.uint32(8).int64(e.creationHeight),e.completionTime!==void 0&&Timestamp$2.encode(toTimestamp$2(e.completionTime),t.uint32(18).fork()).ldelim(),e.initialBalance!==""&&t.uint32(26).string(e.initialBalance),e.balance!==""&&t.uint32(34).string(e.balance),e.unbondingId!==0&&t.uint32(40).uint64(e.unbondingId),e.unbondingOnHoldRefCount!==0&&t.uint32(48).int64(e.unbondingOnHoldRefCount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseUnbondingDelegationEntry();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.creationHeight=longToNumber$l(n.int64());break;case 2:u.completionTime=fromTimestamp$2(Timestamp$2.decode(n,n.uint32()));break;case 3:u.initialBalance=n.string();break;case 4:u.balance=n.string();break;case 5:u.unbondingId=longToNumber$l(n.uint64());break;case 6:u.unbondingOnHoldRefCount=longToNumber$l(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{creationHeight:isSet$E(e.creationHeight)?Number(e.creationHeight):0,completionTime:isSet$E(e.completionTime)?fromJsonTimestamp$2(e.completionTime):void 0,initialBalance:isSet$E(e.initialBalance)?String(e.initialBalance):"",balance:isSet$E(e.balance)?String(e.balance):"",unbondingId:isSet$E(e.unbondingId)?Number(e.unbondingId):0,unbondingOnHoldRefCount:isSet$E(e.unbondingOnHoldRefCount)?Number(e.unbondingOnHoldRefCount):0}},toJSON(e){const t={};return e.creationHeight!==void 0&&(t.creationHeight=Math.round(e.creationHeight)),e.completionTime!==void 0&&(t.completionTime=e.completionTime.toISOString()),e.initialBalance!==void 0&&(t.initialBalance=e.initialBalance),e.balance!==void 0&&(t.balance=e.balance),e.unbondingId!==void 0&&(t.unbondingId=Math.round(e.unbondingId)),e.unbondingOnHoldRefCount!==void 0&&(t.unbondingOnHoldRefCount=Math.round(e.unbondingOnHoldRefCount)),t},fromPartial(e){const t=createBaseUnbondingDelegationEntry();return t.creationHeight=e.creationHeight??0,t.completionTime=e.completionTime??void 0,t.initialBalance=e.initialBalance??"",t.balance=e.balance??"",t.unbondingId=e.unbondingId??0,t.unbondingOnHoldRefCount=e.unbondingOnHoldRefCount??0,t}};function createBaseRedelegationEntry(){return{creationHeight:0,completionTime:void 0,initialBalance:"",sharesDst:"",unbondingId:0,unbondingOnHoldRefCount:0}}const RedelegationEntry={encode(e,t=_m0.Writer.create()){return e.creationHeight!==0&&t.uint32(8).int64(e.creationHeight),e.completionTime!==void 0&&Timestamp$2.encode(toTimestamp$2(e.completionTime),t.uint32(18).fork()).ldelim(),e.initialBalance!==""&&t.uint32(26).string(e.initialBalance),e.sharesDst!==""&&t.uint32(34).string(e.sharesDst),e.unbondingId!==0&&t.uint32(40).uint64(e.unbondingId),e.unbondingOnHoldRefCount!==0&&t.uint32(48).int64(e.unbondingOnHoldRefCount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseRedelegationEntry();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.creationHeight=longToNumber$l(n.int64());break;case 2:u.completionTime=fromTimestamp$2(Timestamp$2.decode(n,n.uint32()));break;case 3:u.initialBalance=n.string();break;case 4:u.sharesDst=n.string();break;case 5:u.unbondingId=longToNumber$l(n.uint64());break;case 6:u.unbondingOnHoldRefCount=longToNumber$l(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{creationHeight:isSet$E(e.creationHeight)?Number(e.creationHeight):0,completionTime:isSet$E(e.completionTime)?fromJsonTimestamp$2(e.completionTime):void 0,initialBalance:isSet$E(e.initialBalance)?String(e.initialBalance):"",sharesDst:isSet$E(e.sharesDst)?String(e.sharesDst):"",unbondingId:isSet$E(e.unbondingId)?Number(e.unbondingId):0,unbondingOnHoldRefCount:isSet$E(e.unbondingOnHoldRefCount)?Number(e.unbondingOnHoldRefCount):0}},toJSON(e){const t={};return e.creationHeight!==void 0&&(t.creationHeight=Math.round(e.creationHeight)),e.completionTime!==void 0&&(t.completionTime=e.completionTime.toISOString()),e.initialBalance!==void 0&&(t.initialBalance=e.initialBalance),e.sharesDst!==void 0&&(t.sharesDst=e.sharesDst),e.unbondingId!==void 0&&(t.unbondingId=Math.round(e.unbondingId)),e.unbondingOnHoldRefCount!==void 0&&(t.unbondingOnHoldRefCount=Math.round(e.unbondingOnHoldRefCount)),t},fromPartial(e){const t=createBaseRedelegationEntry();return t.creationHeight=e.creationHeight??0,t.completionTime=e.completionTime??void 0,t.initialBalance=e.initialBalance??"",t.sharesDst=e.sharesDst??"",t.unbondingId=e.unbondingId??0,t.unbondingOnHoldRefCount=e.unbondingOnHoldRefCount??0,t}};function createBaseRedelegation(){return{delegatorAddress:"",validatorSrcAddress:"",validatorDstAddress:"",entries:[]}}const Redelegation={encode(e,t=_m0.Writer.create()){e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorSrcAddress!==""&&t.uint32(18).string(e.validatorSrcAddress),e.validatorDstAddress!==""&&t.uint32(26).string(e.validatorDstAddress);for(const n of e.entries)RedelegationEntry.encode(n,t.uint32(34).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseRedelegation();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorSrcAddress=n.string();break;case 3:u.validatorDstAddress=n.string();break;case 4:u.entries.push(RedelegationEntry.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$E(e.delegatorAddress)?String(e.delegatorAddress):"",validatorSrcAddress:isSet$E(e.validatorSrcAddress)?String(e.validatorSrcAddress):"",validatorDstAddress:isSet$E(e.validatorDstAddress)?String(e.validatorDstAddress):"",entries:Array.isArray(e==null?void 0:e.entries)?e.entries.map(t=>RedelegationEntry.fromJSON(t)):[]}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorSrcAddress!==void 0&&(t.validatorSrcAddress=e.validatorSrcAddress),e.validatorDstAddress!==void 0&&(t.validatorDstAddress=e.validatorDstAddress),e.entries?t.entries=e.entries.map(n=>n?RedelegationEntry.toJSON(n):void 0):t.entries=[],t},fromPartial(e){var n;const t=createBaseRedelegation();return t.delegatorAddress=e.delegatorAddress??"",t.validatorSrcAddress=e.validatorSrcAddress??"",t.validatorDstAddress=e.validatorDstAddress??"",t.entries=((n=e.entries)==null?void 0:n.map(p=>RedelegationEntry.fromPartial(p)))||[],t}};function createBaseParams$7(){return{unbondingTime:void 0,maxValidators:0,maxEntries:0,historicalEntries:0,bondDenom:"",minCommissionRate:""}}const Params$7={encode(e,t=_m0.Writer.create()){return e.unbondingTime!==void 0&&Duration.encode(e.unbondingTime,t.uint32(10).fork()).ldelim(),e.maxValidators!==0&&t.uint32(16).uint32(e.maxValidators),e.maxEntries!==0&&t.uint32(24).uint32(e.maxEntries),e.historicalEntries!==0&&t.uint32(32).uint32(e.historicalEntries),e.bondDenom!==""&&t.uint32(42).string(e.bondDenom),e.minCommissionRate!==""&&t.uint32(50).string(e.minCommissionRate),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$7();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.unbondingTime=Duration.decode(n,n.uint32());break;case 2:u.maxValidators=n.uint32();break;case 3:u.maxEntries=n.uint32();break;case 4:u.historicalEntries=n.uint32();break;case 5:u.bondDenom=n.string();break;case 6:u.minCommissionRate=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{unbondingTime:isSet$E(e.unbondingTime)?Duration.fromJSON(e.unbondingTime):void 0,maxValidators:isSet$E(e.maxValidators)?Number(e.maxValidators):0,maxEntries:isSet$E(e.maxEntries)?Number(e.maxEntries):0,historicalEntries:isSet$E(e.historicalEntries)?Number(e.historicalEntries):0,bondDenom:isSet$E(e.bondDenom)?String(e.bondDenom):"",minCommissionRate:isSet$E(e.minCommissionRate)?String(e.minCommissionRate):""}},toJSON(e){const t={};return e.unbondingTime!==void 0&&(t.unbondingTime=e.unbondingTime?Duration.toJSON(e.unbondingTime):void 0),e.maxValidators!==void 0&&(t.maxValidators=Math.round(e.maxValidators)),e.maxEntries!==void 0&&(t.maxEntries=Math.round(e.maxEntries)),e.historicalEntries!==void 0&&(t.historicalEntries=Math.round(e.historicalEntries)),e.bondDenom!==void 0&&(t.bondDenom=e.bondDenom),e.minCommissionRate!==void 0&&(t.minCommissionRate=e.minCommissionRate),t},fromPartial(e){const t=createBaseParams$7();return t.unbondingTime=e.unbondingTime!==void 0&&e.unbondingTime!==null?Duration.fromPartial(e.unbondingTime):void 0,t.maxValidators=e.maxValidators??0,t.maxEntries=e.maxEntries??0,t.historicalEntries=e.historicalEntries??0,t.bondDenom=e.bondDenom??"",t.minCommissionRate=e.minCommissionRate??"",t}};function createBaseDelegationResponse(){return{delegation:void 0,balance:void 0}}const DelegationResponse={encode(e,t=_m0.Writer.create()){return e.delegation!==void 0&&Delegation.encode(e.delegation,t.uint32(10).fork()).ldelim(),e.balance!==void 0&&Coin$4.encode(e.balance,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDelegationResponse();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegation=Delegation.decode(n,n.uint32());break;case 2:u.balance=Coin$4.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegation:isSet$E(e.delegation)?Delegation.fromJSON(e.delegation):void 0,balance:isSet$E(e.balance)?Coin$4.fromJSON(e.balance):void 0}},toJSON(e){const t={};return e.delegation!==void 0&&(t.delegation=e.delegation?Delegation.toJSON(e.delegation):void 0),e.balance!==void 0&&(t.balance=e.balance?Coin$4.toJSON(e.balance):void 0),t},fromPartial(e){const t=createBaseDelegationResponse();return t.delegation=e.delegation!==void 0&&e.delegation!==null?Delegation.fromPartial(e.delegation):void 0,t.balance=e.balance!==void 0&&e.balance!==null?Coin$4.fromPartial(e.balance):void 0,t}};function createBaseRedelegationEntryResponse(){return{redelegationEntry:void 0,balance:""}}const RedelegationEntryResponse={encode(e,t=_m0.Writer.create()){return e.redelegationEntry!==void 0&&RedelegationEntry.encode(e.redelegationEntry,t.uint32(10).fork()).ldelim(),e.balance!==""&&t.uint32(34).string(e.balance),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseRedelegationEntryResponse();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.redelegationEntry=RedelegationEntry.decode(n,n.uint32());break;case 4:u.balance=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{redelegationEntry:isSet$E(e.redelegationEntry)?RedelegationEntry.fromJSON(e.redelegationEntry):void 0,balance:isSet$E(e.balance)?String(e.balance):""}},toJSON(e){const t={};return e.redelegationEntry!==void 0&&(t.redelegationEntry=e.redelegationEntry?RedelegationEntry.toJSON(e.redelegationEntry):void 0),e.balance!==void 0&&(t.balance=e.balance),t},fromPartial(e){const t=createBaseRedelegationEntryResponse();return t.redelegationEntry=e.redelegationEntry!==void 0&&e.redelegationEntry!==null?RedelegationEntry.fromPartial(e.redelegationEntry):void 0,t.balance=e.balance??"",t}};function createBaseRedelegationResponse(){return{redelegation:void 0,entries:[]}}const RedelegationResponse={encode(e,t=_m0.Writer.create()){e.redelegation!==void 0&&Redelegation.encode(e.redelegation,t.uint32(10).fork()).ldelim();for(const n of e.entries)RedelegationEntryResponse.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseRedelegationResponse();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.redelegation=Redelegation.decode(n,n.uint32());break;case 2:u.entries.push(RedelegationEntryResponse.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{redelegation:isSet$E(e.redelegation)?Redelegation.fromJSON(e.redelegation):void 0,entries:Array.isArray(e==null?void 0:e.entries)?e.entries.map(t=>RedelegationEntryResponse.fromJSON(t)):[]}},toJSON(e){const t={};return e.redelegation!==void 0&&(t.redelegation=e.redelegation?Redelegation.toJSON(e.redelegation):void 0),e.entries?t.entries=e.entries.map(n=>n?RedelegationEntryResponse.toJSON(n):void 0):t.entries=[],t},fromPartial(e){var n;const t=createBaseRedelegationResponse();return t.redelegation=e.redelegation!==void 0&&e.redelegation!==null?Redelegation.fromPartial(e.redelegation):void 0,t.entries=((n=e.entries)==null?void 0:n.map(p=>RedelegationEntryResponse.fromPartial(p)))||[],t}};function createBasePool(){return{notBondedTokens:"",bondedTokens:""}}const Pool={encode(e,t=_m0.Writer.create()){return e.notBondedTokens!==""&&t.uint32(10).string(e.notBondedTokens),e.bondedTokens!==""&&t.uint32(18).string(e.bondedTokens),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePool();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.notBondedTokens=n.string();break;case 2:u.bondedTokens=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{notBondedTokens:isSet$E(e.notBondedTokens)?String(e.notBondedTokens):"",bondedTokens:isSet$E(e.bondedTokens)?String(e.bondedTokens):""}},toJSON(e){const t={};return e.notBondedTokens!==void 0&&(t.notBondedTokens=e.notBondedTokens),e.bondedTokens!==void 0&&(t.bondedTokens=e.bondedTokens),t},fromPartial(e){const t=createBasePool();return t.notBondedTokens=e.notBondedTokens??"",t.bondedTokens=e.bondedTokens??"",t}};function createBaseValidatorUpdates(){return{updates:[]}}const ValidatorUpdates={encode(e,t=_m0.Writer.create()){for(const n of e.updates)ValidatorUpdate.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseValidatorUpdates();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.updates.push(ValidatorUpdate.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{updates:Array.isArray(e==null?void 0:e.updates)?e.updates.map(t=>ValidatorUpdate.fromJSON(t)):[]}},toJSON(e){const t={};return e.updates?t.updates=e.updates.map(n=>n?ValidatorUpdate.toJSON(n):void 0):t.updates=[],t},fromPartial(e){var n;const t=createBaseValidatorUpdates();return t.updates=((n=e.updates)==null?void 0:n.map(p=>ValidatorUpdate.fromPartial(p)))||[],t}};var globalThis$B=(()=>{if(typeof globalThis$B<"u")return globalThis$B;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function toTimestamp$2(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$2(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$2(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$2(Timestamp$2.fromJSON(e))}function longToNumber$l(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$B.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$E(e){return e!=null}function createBaseMsgCreateValidator(){return{description:void 0,commission:void 0,minSelfDelegation:"",delegatorAddress:"",validatorAddress:"",pubkey:void 0,value:void 0}}const MsgCreateValidator={encode(e,t=_m0.Writer.create()){return e.description!==void 0&&Description.encode(e.description,t.uint32(10).fork()).ldelim(),e.commission!==void 0&&CommissionRates.encode(e.commission,t.uint32(18).fork()).ldelim(),e.minSelfDelegation!==""&&t.uint32(26).string(e.minSelfDelegation),e.delegatorAddress!==""&&t.uint32(34).string(e.delegatorAddress),e.validatorAddress!==""&&t.uint32(42).string(e.validatorAddress),e.pubkey!==void 0&&Any$4.encode(e.pubkey,t.uint32(50).fork()).ldelim(),e.value!==void 0&&Coin$4.encode(e.value,t.uint32(58).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgCreateValidator();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.description=Description.decode(n,n.uint32());break;case 2:u.commission=CommissionRates.decode(n,n.uint32());break;case 3:u.minSelfDelegation=n.string();break;case 4:u.delegatorAddress=n.string();break;case 5:u.validatorAddress=n.string();break;case 6:u.pubkey=Any$4.decode(n,n.uint32());break;case 7:u.value=Coin$4.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{description:isSet$D(e.description)?Description.fromJSON(e.description):void 0,commission:isSet$D(e.commission)?CommissionRates.fromJSON(e.commission):void 0,minSelfDelegation:isSet$D(e.minSelfDelegation)?String(e.minSelfDelegation):"",delegatorAddress:isSet$D(e.delegatorAddress)?String(e.delegatorAddress):"",validatorAddress:isSet$D(e.validatorAddress)?String(e.validatorAddress):"",pubkey:isSet$D(e.pubkey)?Any$4.fromJSON(e.pubkey):void 0,value:isSet$D(e.value)?Coin$4.fromJSON(e.value):void 0}},toJSON(e){const t={};return e.description!==void 0&&(t.description=e.description?Description.toJSON(e.description):void 0),e.commission!==void 0&&(t.commission=e.commission?CommissionRates.toJSON(e.commission):void 0),e.minSelfDelegation!==void 0&&(t.minSelfDelegation=e.minSelfDelegation),e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.pubkey!==void 0&&(t.pubkey=e.pubkey?Any$4.toJSON(e.pubkey):void 0),e.value!==void 0&&(t.value=e.value?Coin$4.toJSON(e.value):void 0),t},fromPartial(e){const t=createBaseMsgCreateValidator();return t.description=e.description!==void 0&&e.description!==null?Description.fromPartial(e.description):void 0,t.commission=e.commission!==void 0&&e.commission!==null?CommissionRates.fromPartial(e.commission):void 0,t.minSelfDelegation=e.minSelfDelegation??"",t.delegatorAddress=e.delegatorAddress??"",t.validatorAddress=e.validatorAddress??"",t.pubkey=e.pubkey!==void 0&&e.pubkey!==null?Any$4.fromPartial(e.pubkey):void 0,t.value=e.value!==void 0&&e.value!==null?Coin$4.fromPartial(e.value):void 0,t}};function createBaseMsgEditValidator(){return{description:void 0,validatorAddress:"",commissionRate:"",minSelfDelegation:""}}const MsgEditValidator={encode(e,t=_m0.Writer.create()){return e.description!==void 0&&Description.encode(e.description,t.uint32(10).fork()).ldelim(),e.validatorAddress!==""&&t.uint32(18).string(e.validatorAddress),e.commissionRate!==""&&t.uint32(26).string(e.commissionRate),e.minSelfDelegation!==""&&t.uint32(34).string(e.minSelfDelegation),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgEditValidator();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.description=Description.decode(n,n.uint32());break;case 2:u.validatorAddress=n.string();break;case 3:u.commissionRate=n.string();break;case 4:u.minSelfDelegation=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{description:isSet$D(e.description)?Description.fromJSON(e.description):void 0,validatorAddress:isSet$D(e.validatorAddress)?String(e.validatorAddress):"",commissionRate:isSet$D(e.commissionRate)?String(e.commissionRate):"",minSelfDelegation:isSet$D(e.minSelfDelegation)?String(e.minSelfDelegation):""}},toJSON(e){const t={};return e.description!==void 0&&(t.description=e.description?Description.toJSON(e.description):void 0),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.commissionRate!==void 0&&(t.commissionRate=e.commissionRate),e.minSelfDelegation!==void 0&&(t.minSelfDelegation=e.minSelfDelegation),t},fromPartial(e){const t=createBaseMsgEditValidator();return t.description=e.description!==void 0&&e.description!==null?Description.fromPartial(e.description):void 0,t.validatorAddress=e.validatorAddress??"",t.commissionRate=e.commissionRate??"",t.minSelfDelegation=e.minSelfDelegation??"",t}};function createBaseMsgDelegate(){return{delegatorAddress:"",validatorAddress:"",amount:void 0}}const MsgDelegate={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==""&&t.uint32(18).string(e.validatorAddress),e.amount!==void 0&&Coin$4.encode(e.amount,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgDelegate();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorAddress=n.string();break;case 3:u.amount=Coin$4.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$D(e.delegatorAddress)?String(e.delegatorAddress):"",validatorAddress:isSet$D(e.validatorAddress)?String(e.validatorAddress):"",amount:isSet$D(e.amount)?Coin$4.fromJSON(e.amount):void 0}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.amount!==void 0&&(t.amount=e.amount?Coin$4.toJSON(e.amount):void 0),t},fromPartial(e){const t=createBaseMsgDelegate();return t.delegatorAddress=e.delegatorAddress??"",t.validatorAddress=e.validatorAddress??"",t.amount=e.amount!==void 0&&e.amount!==null?Coin$4.fromPartial(e.amount):void 0,t}};function createBaseMsgBeginRedelegate(){return{delegatorAddress:"",validatorSrcAddress:"",validatorDstAddress:"",amount:void 0}}const MsgBeginRedelegate={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorSrcAddress!==""&&t.uint32(18).string(e.validatorSrcAddress),e.validatorDstAddress!==""&&t.uint32(26).string(e.validatorDstAddress),e.amount!==void 0&&Coin$4.encode(e.amount,t.uint32(34).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgBeginRedelegate();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorSrcAddress=n.string();break;case 3:u.validatorDstAddress=n.string();break;case 4:u.amount=Coin$4.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$D(e.delegatorAddress)?String(e.delegatorAddress):"",validatorSrcAddress:isSet$D(e.validatorSrcAddress)?String(e.validatorSrcAddress):"",validatorDstAddress:isSet$D(e.validatorDstAddress)?String(e.validatorDstAddress):"",amount:isSet$D(e.amount)?Coin$4.fromJSON(e.amount):void 0}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorSrcAddress!==void 0&&(t.validatorSrcAddress=e.validatorSrcAddress),e.validatorDstAddress!==void 0&&(t.validatorDstAddress=e.validatorDstAddress),e.amount!==void 0&&(t.amount=e.amount?Coin$4.toJSON(e.amount):void 0),t},fromPartial(e){const t=createBaseMsgBeginRedelegate();return t.delegatorAddress=e.delegatorAddress??"",t.validatorSrcAddress=e.validatorSrcAddress??"",t.validatorDstAddress=e.validatorDstAddress??"",t.amount=e.amount!==void 0&&e.amount!==null?Coin$4.fromPartial(e.amount):void 0,t}};function createBaseMsgUndelegate(){return{delegatorAddress:"",validatorAddress:"",amount:void 0}}const MsgUndelegate={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==""&&t.uint32(18).string(e.validatorAddress),e.amount!==void 0&&Coin$4.encode(e.amount,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUndelegate();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorAddress=n.string();break;case 3:u.amount=Coin$4.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$D(e.delegatorAddress)?String(e.delegatorAddress):"",validatorAddress:isSet$D(e.validatorAddress)?String(e.validatorAddress):"",amount:isSet$D(e.amount)?Coin$4.fromJSON(e.amount):void 0}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.amount!==void 0&&(t.amount=e.amount?Coin$4.toJSON(e.amount):void 0),t},fromPartial(e){const t=createBaseMsgUndelegate();return t.delegatorAddress=e.delegatorAddress??"",t.validatorAddress=e.validatorAddress??"",t.amount=e.amount!==void 0&&e.amount!==null?Coin$4.fromPartial(e.amount):void 0,t}};function createBaseMsgCancelUnbondingDelegation(){return{delegatorAddress:"",validatorAddress:"",amount:void 0,creationHeight:0}}const MsgCancelUnbondingDelegation={encode(e,t=_m0.Writer.create()){return e.delegatorAddress!==""&&t.uint32(10).string(e.delegatorAddress),e.validatorAddress!==""&&t.uint32(18).string(e.validatorAddress),e.amount!==void 0&&Coin$4.encode(e.amount,t.uint32(26).fork()).ldelim(),e.creationHeight!==0&&t.uint32(32).int64(e.creationHeight),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgCancelUnbondingDelegation();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.delegatorAddress=n.string();break;case 2:u.validatorAddress=n.string();break;case 3:u.amount=Coin$4.decode(n,n.uint32());break;case 4:u.creationHeight=longToNumber$k(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{delegatorAddress:isSet$D(e.delegatorAddress)?String(e.delegatorAddress):"",validatorAddress:isSet$D(e.validatorAddress)?String(e.validatorAddress):"",amount:isSet$D(e.amount)?Coin$4.fromJSON(e.amount):void 0,creationHeight:isSet$D(e.creationHeight)?Number(e.creationHeight):0}},toJSON(e){const t={};return e.delegatorAddress!==void 0&&(t.delegatorAddress=e.delegatorAddress),e.validatorAddress!==void 0&&(t.validatorAddress=e.validatorAddress),e.amount!==void 0&&(t.amount=e.amount?Coin$4.toJSON(e.amount):void 0),e.creationHeight!==void 0&&(t.creationHeight=Math.round(e.creationHeight)),t},fromPartial(e){const t=createBaseMsgCancelUnbondingDelegation();return t.delegatorAddress=e.delegatorAddress??"",t.validatorAddress=e.validatorAddress??"",t.amount=e.amount!==void 0&&e.amount!==null?Coin$4.fromPartial(e.amount):void 0,t.creationHeight=e.creationHeight??0,t}};var globalThis$A=(()=>{if(typeof globalThis$A<"u")return globalThis$A;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$k(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$A.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$D(e){return e!=null}const msgTypes$b=[["/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation",MsgCancelUnbondingDelegation],["/cosmos.staking.v1beta1.MsgCreateValidator",MsgCreateValidator],["/cosmos.staking.v1beta1.MsgEditValidator",MsgEditValidator],["/cosmos.staking.v1beta1.MsgBeginRedelegate",MsgBeginRedelegate],["/cosmos.staking.v1beta1.MsgDelegate",MsgDelegate],["/cosmos.staking.v1beta1.MsgUndelegate",MsgUndelegate]];let HttpClient$b=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$b=class extends HttpClient$b{constructor(){super(...arguments),this.queryDelegatorDelegations=(t,n,p={})=>this.request({path:`/cosmos/staking/v1beta1/delegations/${t}`,method:"GET",query:n,format:"json",...p}),this.queryRedelegations=(t,n,p={})=>this.request({path:`/cosmos/staking/v1beta1/delegators/${t}/redelegations`,method:"GET",query:n,format:"json",...p}),this.queryDelegatorUnbondingDelegations=(t,n,p={})=>this.request({path:`/cosmos/staking/v1beta1/delegators/${t}/unbonding_delegations`,method:"GET",query:n,format:"json",...p}),this.queryDelegatorValidators=(t,n,p={})=>this.request({path:`/cosmos/staking/v1beta1/delegators/${t}/validators`,method:"GET",query:n,format:"json",...p}),this.queryDelegatorValidator=(t,n,p={})=>this.request({path:`/cosmos/staking/v1beta1/delegators/${t}/validators/${n}`,method:"GET",format:"json",...p}),this.queryHistoricalInfo=(t,n={})=>this.request({path:`/cosmos/staking/v1beta1/historical_info/${t}`,method:"GET",format:"json",...n}),this.queryParams=(t={})=>this.request({path:"/cosmos/staking/v1beta1/params",method:"GET",format:"json",...t}),this.queryPool=(t={})=>this.request({path:"/cosmos/staking/v1beta1/pool",method:"GET",format:"json",...t}),this.queryValidators=(t,n={})=>this.request({path:"/cosmos/staking/v1beta1/validators",method:"GET",query:t,format:"json",...n}),this.queryValidator=(t,n={})=>this.request({path:`/cosmos/staking/v1beta1/validators/${t}`,method:"GET",format:"json",...n}),this.queryValidatorDelegations=(t,n,p={})=>this.request({path:`/cosmos/staking/v1beta1/validators/${t}/delegations`,method:"GET",query:n,format:"json",...p}),this.queryDelegation=(t,n,p={})=>this.request({path:`/cosmos/staking/v1beta1/validators/${t}/delegations/${n}`,method:"GET",format:"json",...p}),this.queryUnbondingDelegation=(t,n,p={})=>this.request({path:`/cosmos/staking/v1beta1/validators/${t}/delegations/${n}/unbonding_delegation`,method:"GET",format:"json",...p}),this.queryValidatorUnbondingDelegations=(t,n,p={})=>this.request({path:`/cosmos/staking/v1beta1/validators/${t}/unbonding_delegations`,method:"GET",query:n,format:"json",...p})}};function authorizationTypeFromJSON(e){switch(e){case 0:case"AUTHORIZATION_TYPE_UNSPECIFIED":return 0;case 1:case"AUTHORIZATION_TYPE_DELEGATE":return 1;case 2:case"AUTHORIZATION_TYPE_UNDELEGATE":return 2;case 3:case"AUTHORIZATION_TYPE_REDELEGATE":return 3;case-1:case"UNRECOGNIZED":default:return-1}}function authorizationTypeToJSON(e){switch(e){case 0:return"AUTHORIZATION_TYPE_UNSPECIFIED";case 1:return"AUTHORIZATION_TYPE_DELEGATE";case 2:return"AUTHORIZATION_TYPE_UNDELEGATE";case 3:return"AUTHORIZATION_TYPE_REDELEGATE";case-1:default:return"UNRECOGNIZED"}}function createBaseStakeAuthorization(){return{maxTokens:void 0,allowList:void 0,denyList:void 0,authorizationType:0}}const StakeAuthorization={encode(e,t=_m0.Writer.create()){return e.maxTokens!==void 0&&Coin$4.encode(e.maxTokens,t.uint32(10).fork()).ldelim(),e.allowList!==void 0&&StakeAuthorization_Validators.encode(e.allowList,t.uint32(18).fork()).ldelim(),e.denyList!==void 0&&StakeAuthorization_Validators.encode(e.denyList,t.uint32(26).fork()).ldelim(),e.authorizationType!==0&&t.uint32(32).int32(e.authorizationType),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseStakeAuthorization();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.maxTokens=Coin$4.decode(n,n.uint32());break;case 2:u.allowList=StakeAuthorization_Validators.decode(n,n.uint32());break;case 3:u.denyList=StakeAuthorization_Validators.decode(n,n.uint32());break;case 4:u.authorizationType=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{maxTokens:isSet$C(e.maxTokens)?Coin$4.fromJSON(e.maxTokens):void 0,allowList:isSet$C(e.allowList)?StakeAuthorization_Validators.fromJSON(e.allowList):void 0,denyList:isSet$C(e.denyList)?StakeAuthorization_Validators.fromJSON(e.denyList):void 0,authorizationType:isSet$C(e.authorizationType)?authorizationTypeFromJSON(e.authorizationType):0}},toJSON(e){const t={};return e.maxTokens!==void 0&&(t.maxTokens=e.maxTokens?Coin$4.toJSON(e.maxTokens):void 0),e.allowList!==void 0&&(t.allowList=e.allowList?StakeAuthorization_Validators.toJSON(e.allowList):void 0),e.denyList!==void 0&&(t.denyList=e.denyList?StakeAuthorization_Validators.toJSON(e.denyList):void 0),e.authorizationType!==void 0&&(t.authorizationType=authorizationTypeToJSON(e.authorizationType)),t},fromPartial(e){const t=createBaseStakeAuthorization();return t.maxTokens=e.maxTokens!==void 0&&e.maxTokens!==null?Coin$4.fromPartial(e.maxTokens):void 0,t.allowList=e.allowList!==void 0&&e.allowList!==null?StakeAuthorization_Validators.fromPartial(e.allowList):void 0,t.denyList=e.denyList!==void 0&&e.denyList!==null?StakeAuthorization_Validators.fromPartial(e.denyList):void 0,t.authorizationType=e.authorizationType??0,t}};function createBaseStakeAuthorization_Validators(){return{address:[]}}const StakeAuthorization_Validators={encode(e,t=_m0.Writer.create()){for(const n of e.address)t.uint32(10).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseStakeAuthorization_Validators();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:Array.isArray(e==null?void 0:e.address)?e.address.map(t=>String(t)):[]}},toJSON(e){const t={};return e.address?t.address=e.address.map(n=>n):t.address=[],t},fromPartial(e){var n;const t=createBaseStakeAuthorization_Validators();return t.address=((n=e.address)==null?void 0:n.map(p=>p))||[],t}};function isSet$C(e){return e!=null}function createBaseLastValidatorPower(){return{address:"",power:0}}const LastValidatorPower={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.power!==0&&t.uint32(16).int64(e.power),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseLastValidatorPower();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.power=longToNumber$j(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$B(e.address)?String(e.address):"",power:isSet$B(e.power)?Number(e.power):0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.power!==void 0&&(t.power=Math.round(e.power)),t},fromPartial(e){const t=createBaseLastValidatorPower();return t.address=e.address??"",t.power=e.power??0,t}};var globalThis$z=(()=>{if(typeof globalThis$z<"u")return globalThis$z;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$j(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$z.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$B(e){return e!=null}const registry$5=new build$b.Registry(msgTypes$b);function getStructure$b(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$4={amount:[],gas:"200000"},txClient$b=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgCancelUnbondingDelegation({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgCancelUnbondingDelegation: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$5,prefix:t});let N=this.msgCancelUnbondingDelegation({value:MsgCancelUnbondingDelegation.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$4,g)}catch(y){throw new Error("TxClient:sendMsgCancelUnbondingDelegation: Could not broadcast Tx: "+y.message)}},async sendMsgCreateValidator({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgCreateValidator: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$5,prefix:t});let N=this.msgCreateValidator({value:MsgCreateValidator.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$4,g)}catch(y){throw new Error("TxClient:sendMsgCreateValidator: Could not broadcast Tx: "+y.message)}},async sendMsgEditValidator({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgEditValidator: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$5,prefix:t});let N=this.msgEditValidator({value:MsgEditValidator.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$4,g)}catch(y){throw new Error("TxClient:sendMsgEditValidator: Could not broadcast Tx: "+y.message)}},async sendMsgBeginRedelegate({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgBeginRedelegate: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$5,prefix:t});let N=this.msgBeginRedelegate({value:MsgBeginRedelegate.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$4,g)}catch(y){throw new Error("TxClient:sendMsgBeginRedelegate: Could not broadcast Tx: "+y.message)}},async sendMsgDelegate({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgDelegate: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$5,prefix:t});let N=this.msgDelegate({value:MsgDelegate.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$4,g)}catch(y){throw new Error("TxClient:sendMsgDelegate: Could not broadcast Tx: "+y.message)}},async sendMsgUndelegate({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUndelegate: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$5,prefix:t});let N=this.msgUndelegate({value:MsgUndelegate.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$4,g)}catch(y){throw new Error("TxClient:sendMsgUndelegate: Could not broadcast Tx: "+y.message)}},msgCancelUnbondingDelegation({value:p}){try{return{typeUrl:"/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation",value:MsgCancelUnbondingDelegation.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgCancelUnbondingDelegation: Could not create message: "+u.message)}},msgCreateValidator({value:p}){try{return{typeUrl:"/cosmos.staking.v1beta1.MsgCreateValidator",value:MsgCreateValidator.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgCreateValidator: Could not create message: "+u.message)}},msgEditValidator({value:p}){try{return{typeUrl:"/cosmos.staking.v1beta1.MsgEditValidator",value:MsgEditValidator.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgEditValidator: Could not create message: "+u.message)}},msgBeginRedelegate({value:p}){try{return{typeUrl:"/cosmos.staking.v1beta1.MsgBeginRedelegate",value:MsgBeginRedelegate.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgBeginRedelegate: Could not create message: "+u.message)}},msgDelegate({value:p}){try{return{typeUrl:"/cosmos.staking.v1beta1.MsgDelegate",value:MsgDelegate.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgDelegate: Could not create message: "+u.message)}},msgUndelegate({value:p}){try{return{typeUrl:"/cosmos.staking.v1beta1.MsgUndelegate",value:MsgUndelegate.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUndelegate: Could not create message: "+u.message)}}}),queryClient$b=({addr:e}={addr:"http://localhost:1317"})=>new Api$b({baseURL:e});let SDKModule$b=class{constructor(t){this.registry=[],this.query=queryClient$b({addr:t.env.apiURL}),this.updateTX(t),this.structure={StakeAuthorization:getStructure$b(StakeAuthorization.fromPartial({})),StakeAuthorization_Validators:getStructure$b(StakeAuthorization_Validators.fromPartial({})),LastValidatorPower:getStructure$b(LastValidatorPower.fromPartial({})),HistoricalInfo:getStructure$b(HistoricalInfo.fromPartial({})),CommissionRates:getStructure$b(CommissionRates.fromPartial({})),Commission:getStructure$b(Commission.fromPartial({})),Description:getStructure$b(Description.fromPartial({})),Validator:getStructure$b(Validator.fromPartial({})),ValAddresses:getStructure$b(ValAddresses.fromPartial({})),DVPair:getStructure$b(DVPair.fromPartial({})),DVPairs:getStructure$b(DVPairs.fromPartial({})),DVVTriplet:getStructure$b(DVVTriplet.fromPartial({})),DVVTriplets:getStructure$b(DVVTriplets.fromPartial({})),Delegation:getStructure$b(Delegation.fromPartial({})),UnbondingDelegation:getStructure$b(UnbondingDelegation.fromPartial({})),UnbondingDelegationEntry:getStructure$b(UnbondingDelegationEntry.fromPartial({})),RedelegationEntry:getStructure$b(RedelegationEntry.fromPartial({})),Redelegation:getStructure$b(Redelegation.fromPartial({})),Params:getStructure$b(Params$7.fromPartial({})),DelegationResponse:getStructure$b(DelegationResponse.fromPartial({})),RedelegationEntryResponse:getStructure$b(RedelegationEntryResponse.fromPartial({})),RedelegationResponse:getStructure$b(RedelegationResponse.fromPartial({})),Pool:getStructure$b(Pool.fromPartial({})),ValidatorUpdates:getStructure$b(ValidatorUpdates.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$b({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$b=e=>({module:{CosmosStakingV1Beta1:new SDKModule$b(e)},registry:msgTypes$b}),module=Object.freeze(Object.defineProperty({__proto__:null,MsgBeginRedelegate,MsgCancelUnbondingDelegation,MsgCreateValidator,MsgDelegate,MsgEditValidator,MsgUndelegate,default:Module$b,queryClient:queryClient$b,registry:registry$5,txClient:txClient$b},Symbol.toStringTag,{value:"Module"})),msgTypes$a=[];let HttpClient$a=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$a=class extends HttpClient$a{constructor(){super(...arguments),this.serviceTxDecode=(t,n={})=>this.request({path:"/cosmos/tx/v1beta1/decode",method:"POST",body:t,type:"application/json",format:"json",...n}),this.serviceTxDecodeAmino=(t,n={})=>this.request({path:"/cosmos/tx/v1beta1/decode/amino",method:"POST",body:t,type:"application/json",format:"json",...n}),this.serviceTxEncode=(t,n={})=>this.request({path:"/cosmos/tx/v1beta1/encode",method:"POST",body:t,type:"application/json",format:"json",...n}),this.serviceTxEncodeAmino=(t,n={})=>this.request({path:"/cosmos/tx/v1beta1/encode/amino",method:"POST",body:t,type:"application/json",format:"json",...n}),this.serviceSimulate=(t,n={})=>this.request({path:"/cosmos/tx/v1beta1/simulate",method:"POST",body:t,type:"application/json",format:"json",...n}),this.serviceGetTxsEvent=(t,n={})=>this.request({path:"/cosmos/tx/v1beta1/txs",method:"GET",query:t,format:"json",...n}),this.serviceBroadcastTx=(t,n={})=>this.request({path:"/cosmos/tx/v1beta1/txs",method:"POST",body:t,type:"application/json",format:"json",...n}),this.serviceGetBlockWithTxs=(t,n,p={})=>this.request({path:`/cosmos/tx/v1beta1/txs/block/${t}`,method:"GET",query:n,format:"json",...p}),this.serviceGetTx=(t,n={})=>this.request({path:`/cosmos/tx/v1beta1/txs/${t}`,method:"GET",format:"json",...n})}};function createBaseAny$3(){return{typeUrl:"",value:new Uint8Array}}const Any$3={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$3();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$A(e.typeUrl)?String(e.typeUrl):"",value:isSet$A(e.value)?bytesFromBase64$c(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$c(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$3();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$y=(()=>{if(typeof globalThis$y<"u")return globalThis$y;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$c(e){if(globalThis$y.Buffer)return Uint8Array.from(globalThis$y.Buffer.from(e,"base64"));{const t=globalThis$y.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$c(e){if(globalThis$y.Buffer)return globalThis$y.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$y.btoa(t.join(""))}}function isSet$A(e){return e!=null}function createBaseCoin$3(){return{denom:"",amount:""}}const Coin$3={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin$3();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$z(e.denom)?String(e.denom):"",amount:isSet$z(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin$3();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$z(e){return e!=null}function createBaseCompactBitArray(){return{extraBitsStored:0,elems:new Uint8Array}}const CompactBitArray={encode(e,t=_m0.Writer.create()){return e.extraBitsStored!==0&&t.uint32(8).uint32(e.extraBitsStored),e.elems.length!==0&&t.uint32(18).bytes(e.elems),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCompactBitArray();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.extraBitsStored=n.uint32();break;case 2:u.elems=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{extraBitsStored:isSet$y(e.extraBitsStored)?Number(e.extraBitsStored):0,elems:isSet$y(e.elems)?bytesFromBase64$b(e.elems):new Uint8Array}},toJSON(e){const t={};return e.extraBitsStored!==void 0&&(t.extraBitsStored=Math.round(e.extraBitsStored)),e.elems!==void 0&&(t.elems=base64FromBytes$b(e.elems!==void 0?e.elems:new Uint8Array)),t},fromPartial(e){const t=createBaseCompactBitArray();return t.extraBitsStored=e.extraBitsStored??0,t.elems=e.elems??new Uint8Array,t}};var globalThis$x=(()=>{if(typeof globalThis$x<"u")return globalThis$x;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$b(e){if(globalThis$x.Buffer)return Uint8Array.from(globalThis$x.Buffer.from(e,"base64"));{const t=globalThis$x.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$b(e){if(globalThis$x.Buffer)return globalThis$x.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$x.btoa(t.join(""))}}function isSet$y(e){return e!=null}function signModeFromJSON(e){switch(e){case 0:case"SIGN_MODE_UNSPECIFIED":return 0;case 1:case"SIGN_MODE_DIRECT":return 1;case 2:case"SIGN_MODE_TEXTUAL":return 2;case 3:case"SIGN_MODE_DIRECT_AUX":return 3;case 127:case"SIGN_MODE_LEGACY_AMINO_JSON":return 127;case 191:case"SIGN_MODE_EIP_191":return 191;case-1:case"UNRECOGNIZED":default:return-1}}function signModeToJSON(e){switch(e){case 0:return"SIGN_MODE_UNSPECIFIED";case 1:return"SIGN_MODE_DIRECT";case 2:return"SIGN_MODE_TEXTUAL";case 3:return"SIGN_MODE_DIRECT_AUX";case 127:return"SIGN_MODE_LEGACY_AMINO_JSON";case 191:return"SIGN_MODE_EIP_191";case-1:default:return"UNRECOGNIZED"}}var globalThis$w=(()=>{if(typeof globalThis$w<"u")return globalThis$w;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function createBaseTx(){return{body:void 0,authInfo:void 0,signatures:[]}}const Tx={encode(e,t=_m0.Writer.create()){e.body!==void 0&&TxBody.encode(e.body,t.uint32(10).fork()).ldelim(),e.authInfo!==void 0&&AuthInfo.encode(e.authInfo,t.uint32(18).fork()).ldelim();for(const n of e.signatures)t.uint32(26).bytes(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTx();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.body=TxBody.decode(n,n.uint32());break;case 2:u.authInfo=AuthInfo.decode(n,n.uint32());break;case 3:u.signatures.push(n.bytes());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{body:isSet$x(e.body)?TxBody.fromJSON(e.body):void 0,authInfo:isSet$x(e.authInfo)?AuthInfo.fromJSON(e.authInfo):void 0,signatures:Array.isArray(e==null?void 0:e.signatures)?e.signatures.map(t=>bytesFromBase64$a(t)):[]}},toJSON(e){const t={};return e.body!==void 0&&(t.body=e.body?TxBody.toJSON(e.body):void 0),e.authInfo!==void 0&&(t.authInfo=e.authInfo?AuthInfo.toJSON(e.authInfo):void 0),e.signatures?t.signatures=e.signatures.map(n=>base64FromBytes$a(n!==void 0?n:new Uint8Array)):t.signatures=[],t},fromPartial(e){var n;const t=createBaseTx();return t.body=e.body!==void 0&&e.body!==null?TxBody.fromPartial(e.body):void 0,t.authInfo=e.authInfo!==void 0&&e.authInfo!==null?AuthInfo.fromPartial(e.authInfo):void 0,t.signatures=((n=e.signatures)==null?void 0:n.map(p=>p))||[],t}};function createBaseTxRaw(){return{bodyBytes:new Uint8Array,authInfoBytes:new Uint8Array,signatures:[]}}const TxRaw={encode(e,t=_m0.Writer.create()){e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&t.uint32(18).bytes(e.authInfoBytes);for(const n of e.signatures)t.uint32(26).bytes(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTxRaw();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.bodyBytes=n.bytes();break;case 2:u.authInfoBytes=n.bytes();break;case 3:u.signatures.push(n.bytes());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{bodyBytes:isSet$x(e.bodyBytes)?bytesFromBase64$a(e.bodyBytes):new Uint8Array,authInfoBytes:isSet$x(e.authInfoBytes)?bytesFromBase64$a(e.authInfoBytes):new Uint8Array,signatures:Array.isArray(e==null?void 0:e.signatures)?e.signatures.map(t=>bytesFromBase64$a(t)):[]}},toJSON(e){const t={};return e.bodyBytes!==void 0&&(t.bodyBytes=base64FromBytes$a(e.bodyBytes!==void 0?e.bodyBytes:new Uint8Array)),e.authInfoBytes!==void 0&&(t.authInfoBytes=base64FromBytes$a(e.authInfoBytes!==void 0?e.authInfoBytes:new Uint8Array)),e.signatures?t.signatures=e.signatures.map(n=>base64FromBytes$a(n!==void 0?n:new Uint8Array)):t.signatures=[],t},fromPartial(e){var n;const t=createBaseTxRaw();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.authInfoBytes=e.authInfoBytes??new Uint8Array,t.signatures=((n=e.signatures)==null?void 0:n.map(p=>p))||[],t}};function createBaseSignDoc(){return{bodyBytes:new Uint8Array,authInfoBytes:new Uint8Array,chainId:"",accountNumber:0}}const SignDoc={encode(e,t=_m0.Writer.create()){return e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&t.uint32(18).bytes(e.authInfoBytes),e.chainId!==""&&t.uint32(26).string(e.chainId),e.accountNumber!==0&&t.uint32(32).uint64(e.accountNumber),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseSignDoc();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.bodyBytes=n.bytes();break;case 2:u.authInfoBytes=n.bytes();break;case 3:u.chainId=n.string();break;case 4:u.accountNumber=longToNumber$i(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{bodyBytes:isSet$x(e.bodyBytes)?bytesFromBase64$a(e.bodyBytes):new Uint8Array,authInfoBytes:isSet$x(e.authInfoBytes)?bytesFromBase64$a(e.authInfoBytes):new Uint8Array,chainId:isSet$x(e.chainId)?String(e.chainId):"",accountNumber:isSet$x(e.accountNumber)?Number(e.accountNumber):0}},toJSON(e){const t={};return e.bodyBytes!==void 0&&(t.bodyBytes=base64FromBytes$a(e.bodyBytes!==void 0?e.bodyBytes:new Uint8Array)),e.authInfoBytes!==void 0&&(t.authInfoBytes=base64FromBytes$a(e.authInfoBytes!==void 0?e.authInfoBytes:new Uint8Array)),e.chainId!==void 0&&(t.chainId=e.chainId),e.accountNumber!==void 0&&(t.accountNumber=Math.round(e.accountNumber)),t},fromPartial(e){const t=createBaseSignDoc();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.authInfoBytes=e.authInfoBytes??new Uint8Array,t.chainId=e.chainId??"",t.accountNumber=e.accountNumber??0,t}};function createBaseSignDocDirectAux(){return{bodyBytes:new Uint8Array,publicKey:void 0,chainId:"",accountNumber:0,sequence:0,tip:void 0}}const SignDocDirectAux={encode(e,t=_m0.Writer.create()){return e.bodyBytes.length!==0&&t.uint32(10).bytes(e.bodyBytes),e.publicKey!==void 0&&Any$3.encode(e.publicKey,t.uint32(18).fork()).ldelim(),e.chainId!==""&&t.uint32(26).string(e.chainId),e.accountNumber!==0&&t.uint32(32).uint64(e.accountNumber),e.sequence!==0&&t.uint32(40).uint64(e.sequence),e.tip!==void 0&&Tip.encode(e.tip,t.uint32(50).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseSignDocDirectAux();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.bodyBytes=n.bytes();break;case 2:u.publicKey=Any$3.decode(n,n.uint32());break;case 3:u.chainId=n.string();break;case 4:u.accountNumber=longToNumber$i(n.uint64());break;case 5:u.sequence=longToNumber$i(n.uint64());break;case 6:u.tip=Tip.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{bodyBytes:isSet$x(e.bodyBytes)?bytesFromBase64$a(e.bodyBytes):new Uint8Array,publicKey:isSet$x(e.publicKey)?Any$3.fromJSON(e.publicKey):void 0,chainId:isSet$x(e.chainId)?String(e.chainId):"",accountNumber:isSet$x(e.accountNumber)?Number(e.accountNumber):0,sequence:isSet$x(e.sequence)?Number(e.sequence):0,tip:isSet$x(e.tip)?Tip.fromJSON(e.tip):void 0}},toJSON(e){const t={};return e.bodyBytes!==void 0&&(t.bodyBytes=base64FromBytes$a(e.bodyBytes!==void 0?e.bodyBytes:new Uint8Array)),e.publicKey!==void 0&&(t.publicKey=e.publicKey?Any$3.toJSON(e.publicKey):void 0),e.chainId!==void 0&&(t.chainId=e.chainId),e.accountNumber!==void 0&&(t.accountNumber=Math.round(e.accountNumber)),e.sequence!==void 0&&(t.sequence=Math.round(e.sequence)),e.tip!==void 0&&(t.tip=e.tip?Tip.toJSON(e.tip):void 0),t},fromPartial(e){const t=createBaseSignDocDirectAux();return t.bodyBytes=e.bodyBytes??new Uint8Array,t.publicKey=e.publicKey!==void 0&&e.publicKey!==null?Any$3.fromPartial(e.publicKey):void 0,t.chainId=e.chainId??"",t.accountNumber=e.accountNumber??0,t.sequence=e.sequence??0,t.tip=e.tip!==void 0&&e.tip!==null?Tip.fromPartial(e.tip):void 0,t}};function createBaseTxBody(){return{messages:[],memo:"",timeoutHeight:0,extensionOptions:[],nonCriticalExtensionOptions:[]}}const TxBody={encode(e,t=_m0.Writer.create()){for(const n of e.messages)Any$3.encode(n,t.uint32(10).fork()).ldelim();e.memo!==""&&t.uint32(18).string(e.memo),e.timeoutHeight!==0&&t.uint32(24).uint64(e.timeoutHeight);for(const n of e.extensionOptions)Any$3.encode(n,t.uint32(8186).fork()).ldelim();for(const n of e.nonCriticalExtensionOptions)Any$3.encode(n,t.uint32(16378).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTxBody();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.messages.push(Any$3.decode(n,n.uint32()));break;case 2:u.memo=n.string();break;case 3:u.timeoutHeight=longToNumber$i(n.uint64());break;case 1023:u.extensionOptions.push(Any$3.decode(n,n.uint32()));break;case 2047:u.nonCriticalExtensionOptions.push(Any$3.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{messages:Array.isArray(e==null?void 0:e.messages)?e.messages.map(t=>Any$3.fromJSON(t)):[],memo:isSet$x(e.memo)?String(e.memo):"",timeoutHeight:isSet$x(e.timeoutHeight)?Number(e.timeoutHeight):0,extensionOptions:Array.isArray(e==null?void 0:e.extensionOptions)?e.extensionOptions.map(t=>Any$3.fromJSON(t)):[],nonCriticalExtensionOptions:Array.isArray(e==null?void 0:e.nonCriticalExtensionOptions)?e.nonCriticalExtensionOptions.map(t=>Any$3.fromJSON(t)):[]}},toJSON(e){const t={};return e.messages?t.messages=e.messages.map(n=>n?Any$3.toJSON(n):void 0):t.messages=[],e.memo!==void 0&&(t.memo=e.memo),e.timeoutHeight!==void 0&&(t.timeoutHeight=Math.round(e.timeoutHeight)),e.extensionOptions?t.extensionOptions=e.extensionOptions.map(n=>n?Any$3.toJSON(n):void 0):t.extensionOptions=[],e.nonCriticalExtensionOptions?t.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions.map(n=>n?Any$3.toJSON(n):void 0):t.nonCriticalExtensionOptions=[],t},fromPartial(e){var n,p,u;const t=createBaseTxBody();return t.messages=((n=e.messages)==null?void 0:n.map(g=>Any$3.fromPartial(g)))||[],t.memo=e.memo??"",t.timeoutHeight=e.timeoutHeight??0,t.extensionOptions=((p=e.extensionOptions)==null?void 0:p.map(g=>Any$3.fromPartial(g)))||[],t.nonCriticalExtensionOptions=((u=e.nonCriticalExtensionOptions)==null?void 0:u.map(g=>Any$3.fromPartial(g)))||[],t}};function createBaseAuthInfo(){return{signerInfos:[],fee:void 0,tip:void 0}}const AuthInfo={encode(e,t=_m0.Writer.create()){for(const n of e.signerInfos)SignerInfo.encode(n,t.uint32(10).fork()).ldelim();return e.fee!==void 0&&Fee.encode(e.fee,t.uint32(18).fork()).ldelim(),e.tip!==void 0&&Tip.encode(e.tip,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAuthInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.signerInfos.push(SignerInfo.decode(n,n.uint32()));break;case 2:u.fee=Fee.decode(n,n.uint32());break;case 3:u.tip=Tip.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{signerInfos:Array.isArray(e==null?void 0:e.signerInfos)?e.signerInfos.map(t=>SignerInfo.fromJSON(t)):[],fee:isSet$x(e.fee)?Fee.fromJSON(e.fee):void 0,tip:isSet$x(e.tip)?Tip.fromJSON(e.tip):void 0}},toJSON(e){const t={};return e.signerInfos?t.signerInfos=e.signerInfos.map(n=>n?SignerInfo.toJSON(n):void 0):t.signerInfos=[],e.fee!==void 0&&(t.fee=e.fee?Fee.toJSON(e.fee):void 0),e.tip!==void 0&&(t.tip=e.tip?Tip.toJSON(e.tip):void 0),t},fromPartial(e){var n;const t=createBaseAuthInfo();return t.signerInfos=((n=e.signerInfos)==null?void 0:n.map(p=>SignerInfo.fromPartial(p)))||[],t.fee=e.fee!==void 0&&e.fee!==null?Fee.fromPartial(e.fee):void 0,t.tip=e.tip!==void 0&&e.tip!==null?Tip.fromPartial(e.tip):void 0,t}};function createBaseSignerInfo(){return{publicKey:void 0,modeInfo:void 0,sequence:0}}const SignerInfo={encode(e,t=_m0.Writer.create()){return e.publicKey!==void 0&&Any$3.encode(e.publicKey,t.uint32(10).fork()).ldelim(),e.modeInfo!==void 0&&ModeInfo.encode(e.modeInfo,t.uint32(18).fork()).ldelim(),e.sequence!==0&&t.uint32(24).uint64(e.sequence),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseSignerInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.publicKey=Any$3.decode(n,n.uint32());break;case 2:u.modeInfo=ModeInfo.decode(n,n.uint32());break;case 3:u.sequence=longToNumber$i(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{publicKey:isSet$x(e.publicKey)?Any$3.fromJSON(e.publicKey):void 0,modeInfo:isSet$x(e.modeInfo)?ModeInfo.fromJSON(e.modeInfo):void 0,sequence:isSet$x(e.sequence)?Number(e.sequence):0}},toJSON(e){const t={};return e.publicKey!==void 0&&(t.publicKey=e.publicKey?Any$3.toJSON(e.publicKey):void 0),e.modeInfo!==void 0&&(t.modeInfo=e.modeInfo?ModeInfo.toJSON(e.modeInfo):void 0),e.sequence!==void 0&&(t.sequence=Math.round(e.sequence)),t},fromPartial(e){const t=createBaseSignerInfo();return t.publicKey=e.publicKey!==void 0&&e.publicKey!==null?Any$3.fromPartial(e.publicKey):void 0,t.modeInfo=e.modeInfo!==void 0&&e.modeInfo!==null?ModeInfo.fromPartial(e.modeInfo):void 0,t.sequence=e.sequence??0,t}};function createBaseModeInfo(){return{single:void 0,multi:void 0}}const ModeInfo={encode(e,t=_m0.Writer.create()){return e.single!==void 0&&ModeInfo_Single.encode(e.single,t.uint32(10).fork()).ldelim(),e.multi!==void 0&&ModeInfo_Multi.encode(e.multi,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseModeInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.single=ModeInfo_Single.decode(n,n.uint32());break;case 2:u.multi=ModeInfo_Multi.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{single:isSet$x(e.single)?ModeInfo_Single.fromJSON(e.single):void 0,multi:isSet$x(e.multi)?ModeInfo_Multi.fromJSON(e.multi):void 0}},toJSON(e){const t={};return e.single!==void 0&&(t.single=e.single?ModeInfo_Single.toJSON(e.single):void 0),e.multi!==void 0&&(t.multi=e.multi?ModeInfo_Multi.toJSON(e.multi):void 0),t},fromPartial(e){const t=createBaseModeInfo();return t.single=e.single!==void 0&&e.single!==null?ModeInfo_Single.fromPartial(e.single):void 0,t.multi=e.multi!==void 0&&e.multi!==null?ModeInfo_Multi.fromPartial(e.multi):void 0,t}};function createBaseModeInfo_Single(){return{mode:0}}const ModeInfo_Single={encode(e,t=_m0.Writer.create()){return e.mode!==0&&t.uint32(8).int32(e.mode),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseModeInfo_Single();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.mode=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{mode:isSet$x(e.mode)?signModeFromJSON(e.mode):0}},toJSON(e){const t={};return e.mode!==void 0&&(t.mode=signModeToJSON(e.mode)),t},fromPartial(e){const t=createBaseModeInfo_Single();return t.mode=e.mode??0,t}};function createBaseModeInfo_Multi(){return{bitarray:void 0,modeInfos:[]}}const ModeInfo_Multi={encode(e,t=_m0.Writer.create()){e.bitarray!==void 0&&CompactBitArray.encode(e.bitarray,t.uint32(10).fork()).ldelim();for(const n of e.modeInfos)ModeInfo.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseModeInfo_Multi();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.bitarray=CompactBitArray.decode(n,n.uint32());break;case 2:u.modeInfos.push(ModeInfo.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{bitarray:isSet$x(e.bitarray)?CompactBitArray.fromJSON(e.bitarray):void 0,modeInfos:Array.isArray(e==null?void 0:e.modeInfos)?e.modeInfos.map(t=>ModeInfo.fromJSON(t)):[]}},toJSON(e){const t={};return e.bitarray!==void 0&&(t.bitarray=e.bitarray?CompactBitArray.toJSON(e.bitarray):void 0),e.modeInfos?t.modeInfos=e.modeInfos.map(n=>n?ModeInfo.toJSON(n):void 0):t.modeInfos=[],t},fromPartial(e){var n;const t=createBaseModeInfo_Multi();return t.bitarray=e.bitarray!==void 0&&e.bitarray!==null?CompactBitArray.fromPartial(e.bitarray):void 0,t.modeInfos=((n=e.modeInfos)==null?void 0:n.map(p=>ModeInfo.fromPartial(p)))||[],t}};function createBaseFee(){return{amount:[],gasLimit:0,payer:"",granter:""}}const Fee={encode(e,t=_m0.Writer.create()){for(const n of e.amount)Coin$3.encode(n,t.uint32(10).fork()).ldelim();return e.gasLimit!==0&&t.uint32(16).uint64(e.gasLimit),e.payer!==""&&t.uint32(26).string(e.payer),e.granter!==""&&t.uint32(34).string(e.granter),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseFee();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.amount.push(Coin$3.decode(n,n.uint32()));break;case 2:u.gasLimit=longToNumber$i(n.uint64());break;case 3:u.payer=n.string();break;case 4:u.granter=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$3.fromJSON(t)):[],gasLimit:isSet$x(e.gasLimit)?Number(e.gasLimit):0,payer:isSet$x(e.payer)?String(e.payer):"",granter:isSet$x(e.granter)?String(e.granter):""}},toJSON(e){const t={};return e.amount?t.amount=e.amount.map(n=>n?Coin$3.toJSON(n):void 0):t.amount=[],e.gasLimit!==void 0&&(t.gasLimit=Math.round(e.gasLimit)),e.payer!==void 0&&(t.payer=e.payer),e.granter!==void 0&&(t.granter=e.granter),t},fromPartial(e){var n;const t=createBaseFee();return t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$3.fromPartial(p)))||[],t.gasLimit=e.gasLimit??0,t.payer=e.payer??"",t.granter=e.granter??"",t}};function createBaseTip(){return{amount:[],tipper:""}}const Tip={encode(e,t=_m0.Writer.create()){for(const n of e.amount)Coin$3.encode(n,t.uint32(10).fork()).ldelim();return e.tipper!==""&&t.uint32(18).string(e.tipper),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTip();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.amount.push(Coin$3.decode(n,n.uint32()));break;case 2:u.tipper=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$3.fromJSON(t)):[],tipper:isSet$x(e.tipper)?String(e.tipper):""}},toJSON(e){const t={};return e.amount?t.amount=e.amount.map(n=>n?Coin$3.toJSON(n):void 0):t.amount=[],e.tipper!==void 0&&(t.tipper=e.tipper),t},fromPartial(e){var n;const t=createBaseTip();return t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$3.fromPartial(p)))||[],t.tipper=e.tipper??"",t}};function createBaseAuxSignerData(){return{address:"",signDoc:void 0,mode:0,sig:new Uint8Array}}const AuxSignerData={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.signDoc!==void 0&&SignDocDirectAux.encode(e.signDoc,t.uint32(18).fork()).ldelim(),e.mode!==0&&t.uint32(24).int32(e.mode),e.sig.length!==0&&t.uint32(34).bytes(e.sig),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAuxSignerData();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.signDoc=SignDocDirectAux.decode(n,n.uint32());break;case 3:u.mode=n.int32();break;case 4:u.sig=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$x(e.address)?String(e.address):"",signDoc:isSet$x(e.signDoc)?SignDocDirectAux.fromJSON(e.signDoc):void 0,mode:isSet$x(e.mode)?signModeFromJSON(e.mode):0,sig:isSet$x(e.sig)?bytesFromBase64$a(e.sig):new Uint8Array}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.signDoc!==void 0&&(t.signDoc=e.signDoc?SignDocDirectAux.toJSON(e.signDoc):void 0),e.mode!==void 0&&(t.mode=signModeToJSON(e.mode)),e.sig!==void 0&&(t.sig=base64FromBytes$a(e.sig!==void 0?e.sig:new Uint8Array)),t},fromPartial(e){const t=createBaseAuxSignerData();return t.address=e.address??"",t.signDoc=e.signDoc!==void 0&&e.signDoc!==null?SignDocDirectAux.fromPartial(e.signDoc):void 0,t.mode=e.mode??0,t.sig=e.sig??new Uint8Array,t}};var globalThis$v=(()=>{if(typeof globalThis$v<"u")return globalThis$v;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$a(e){if(globalThis$v.Buffer)return Uint8Array.from(globalThis$v.Buffer.from(e,"base64"));{const t=globalThis$v.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$a(e){if(globalThis$v.Buffer)return globalThis$v.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$v.btoa(t.join(""))}}function longToNumber$i(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$v.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$x(e){return e!=null}new build$b.Registry(msgTypes$a);function getStructure$a(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$a=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$a=({addr:e}={addr:"http://localhost:1317"})=>new Api$a({baseURL:e});let SDKModule$a=class{constructor(t){this.registry=[],this.query=queryClient$a({addr:t.env.apiURL}),this.updateTX(t),this.structure={Tx:getStructure$a(Tx.fromPartial({})),TxRaw:getStructure$a(TxRaw.fromPartial({})),SignDoc:getStructure$a(SignDoc.fromPartial({})),SignDocDirectAux:getStructure$a(SignDocDirectAux.fromPartial({})),TxBody:getStructure$a(TxBody.fromPartial({})),AuthInfo:getStructure$a(AuthInfo.fromPartial({})),SignerInfo:getStructure$a(SignerInfo.fromPartial({})),ModeInfo:getStructure$a(ModeInfo.fromPartial({})),ModeInfo_Single:getStructure$a(ModeInfo_Single.fromPartial({})),ModeInfo_Multi:getStructure$a(ModeInfo_Multi.fromPartial({})),Fee:getStructure$a(Fee.fromPartial({})),Tip:getStructure$a(Tip.fromPartial({})),AuxSignerData:getStructure$a(AuxSignerData.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$a({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$a=e=>({module:{CosmosTxV1Beta1:new SDKModule$a(e)},registry:msgTypes$a});function createBaseAny$2(){return{typeUrl:"",value:new Uint8Array}}const Any$2={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$w(e.typeUrl)?String(e.typeUrl):"",value:isSet$w(e.value)?bytesFromBase64$9(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$9(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$2();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$u=(()=>{if(typeof globalThis$u<"u")return globalThis$u;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$9(e){if(globalThis$u.Buffer)return Uint8Array.from(globalThis$u.Buffer.from(e,"base64"));{const t=globalThis$u.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$9(e){if(globalThis$u.Buffer)return globalThis$u.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$u.btoa(t.join(""))}}function isSet$w(e){return e!=null}function createBaseTimestamp$1(){return{seconds:0,nanos:0}}const Timestamp$1={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$h(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$v(e.seconds)?Number(e.seconds):0,nanos:isSet$v(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp$1();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$t=(()=>{if(typeof globalThis$t<"u")return globalThis$t;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$h(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$t.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$v(e){return e!=null}function createBasePlan$1(){return{name:"",time:void 0,height:0,info:"",upgradedClientState:void 0}}const Plan$1={encode(e,t=_m0.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.time!==void 0&&Timestamp$1.encode(toTimestamp$1(e.time),t.uint32(18).fork()).ldelim(),e.height!==0&&t.uint32(24).int64(e.height),e.info!==""&&t.uint32(34).string(e.info),e.upgradedClientState!==void 0&&Any$2.encode(e.upgradedClientState,t.uint32(42).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePlan$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.name=n.string();break;case 2:u.time=fromTimestamp$1(Timestamp$1.decode(n,n.uint32()));break;case 3:u.height=longToNumber$g(n.int64());break;case 4:u.info=n.string();break;case 5:u.upgradedClientState=Any$2.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{name:isSet$u(e.name)?String(e.name):"",time:isSet$u(e.time)?fromJsonTimestamp$1(e.time):void 0,height:isSet$u(e.height)?Number(e.height):0,info:isSet$u(e.info)?String(e.info):"",upgradedClientState:isSet$u(e.upgradedClientState)?Any$2.fromJSON(e.upgradedClientState):void 0}},toJSON(e){const t={};return e.name!==void 0&&(t.name=e.name),e.time!==void 0&&(t.time=e.time.toISOString()),e.height!==void 0&&(t.height=Math.round(e.height)),e.info!==void 0&&(t.info=e.info),e.upgradedClientState!==void 0&&(t.upgradedClientState=e.upgradedClientState?Any$2.toJSON(e.upgradedClientState):void 0),t},fromPartial(e){const t=createBasePlan$1();return t.name=e.name??"",t.time=e.time??void 0,t.height=e.height??0,t.info=e.info??"",t.upgradedClientState=e.upgradedClientState!==void 0&&e.upgradedClientState!==null?Any$2.fromPartial(e.upgradedClientState):void 0,t}};function createBaseSoftwareUpgradeProposal(){return{title:"",description:"",plan:void 0}}const SoftwareUpgradeProposal={encode(e,t=_m0.Writer.create()){return e.title!==""&&t.uint32(10).string(e.title),e.description!==""&&t.uint32(18).string(e.description),e.plan!==void 0&&Plan$1.encode(e.plan,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseSoftwareUpgradeProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.title=n.string();break;case 2:u.description=n.string();break;case 3:u.plan=Plan$1.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{title:isSet$u(e.title)?String(e.title):"",description:isSet$u(e.description)?String(e.description):"",plan:isSet$u(e.plan)?Plan$1.fromJSON(e.plan):void 0}},toJSON(e){const t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),e.plan!==void 0&&(t.plan=e.plan?Plan$1.toJSON(e.plan):void 0),t},fromPartial(e){const t=createBaseSoftwareUpgradeProposal();return t.title=e.title??"",t.description=e.description??"",t.plan=e.plan!==void 0&&e.plan!==null?Plan$1.fromPartial(e.plan):void 0,t}};function createBaseCancelSoftwareUpgradeProposal(){return{title:"",description:""}}const CancelSoftwareUpgradeProposal={encode(e,t=_m0.Writer.create()){return e.title!==""&&t.uint32(10).string(e.title),e.description!==""&&t.uint32(18).string(e.description),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCancelSoftwareUpgradeProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.title=n.string();break;case 2:u.description=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{title:isSet$u(e.title)?String(e.title):"",description:isSet$u(e.description)?String(e.description):""}},toJSON(e){const t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),t},fromPartial(e){const t=createBaseCancelSoftwareUpgradeProposal();return t.title=e.title??"",t.description=e.description??"",t}};function createBaseModuleVersion(){return{name:"",version:0}}const ModuleVersion={encode(e,t=_m0.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.version!==0&&t.uint32(16).uint64(e.version),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseModuleVersion();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.name=n.string();break;case 2:u.version=longToNumber$g(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{name:isSet$u(e.name)?String(e.name):"",version:isSet$u(e.version)?Number(e.version):0}},toJSON(e){const t={};return e.name!==void 0&&(t.name=e.name),e.version!==void 0&&(t.version=Math.round(e.version)),t},fromPartial(e){const t=createBaseModuleVersion();return t.name=e.name??"",t.version=e.version??0,t}};var globalThis$s=(()=>{if(typeof globalThis$s<"u")return globalThis$s;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function toTimestamp$1(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp$1(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp$1(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp$1(Timestamp$1.fromJSON(e))}function longToNumber$g(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$s.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$u(e){return e!=null}function createBaseMsgSoftwareUpgrade(){return{authority:"",plan:void 0}}const MsgSoftwareUpgrade={encode(e,t=_m0.Writer.create()){return e.authority!==""&&t.uint32(10).string(e.authority),e.plan!==void 0&&Plan$1.encode(e.plan,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgSoftwareUpgrade();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.authority=n.string();break;case 2:u.plan=Plan$1.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{authority:isSet$t(e.authority)?String(e.authority):"",plan:isSet$t(e.plan)?Plan$1.fromJSON(e.plan):void 0}},toJSON(e){const t={};return e.authority!==void 0&&(t.authority=e.authority),e.plan!==void 0&&(t.plan=e.plan?Plan$1.toJSON(e.plan):void 0),t},fromPartial(e){const t=createBaseMsgSoftwareUpgrade();return t.authority=e.authority??"",t.plan=e.plan!==void 0&&e.plan!==null?Plan$1.fromPartial(e.plan):void 0,t}};function createBaseMsgCancelUpgrade(){return{authority:""}}const MsgCancelUpgrade={encode(e,t=_m0.Writer.create()){return e.authority!==""&&t.uint32(10).string(e.authority),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgCancelUpgrade();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.authority=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{authority:isSet$t(e.authority)?String(e.authority):""}},toJSON(e){const t={};return e.authority!==void 0&&(t.authority=e.authority),t},fromPartial(e){const t=createBaseMsgCancelUpgrade();return t.authority=e.authority??"",t}};function isSet$t(e){return e!=null}const msgTypes$9=[["/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade",MsgSoftwareUpgrade],["/cosmos.upgrade.v1beta1.MsgCancelUpgrade",MsgCancelUpgrade]];let HttpClient$9=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$9=class extends HttpClient$9{constructor(){super(...arguments),this.queryAppliedPlan=(t,n={})=>this.request({path:`/cosmos/upgrade/v1beta1/applied_plan/${t}`,method:"GET",format:"json",...n}),this.queryAuthority=(t={})=>this.request({path:"/cosmos/upgrade/v1beta1/authority",method:"GET",format:"json",...t}),this.queryCurrentPlan=(t={})=>this.request({path:"/cosmos/upgrade/v1beta1/current_plan",method:"GET",format:"json",...t}),this.queryModuleVersions=(t,n={})=>this.request({path:"/cosmos/upgrade/v1beta1/module_versions",method:"GET",query:t,format:"json",...n}),this.queryUpgradedConsensusState=(t,n={})=>this.request({path:`/cosmos/upgrade/v1beta1/upgraded_consensus_state/${t}`,method:"GET",format:"json",...n})}};const registry$4=new build$b.Registry(msgTypes$9);function getStructure$9(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$3={amount:[],gas:"200000"},txClient$9=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgSoftwareUpgrade({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgSoftwareUpgrade: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$4,prefix:t});let N=this.msgSoftwareUpgrade({value:MsgSoftwareUpgrade.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$3,g)}catch(y){throw new Error("TxClient:sendMsgSoftwareUpgrade: Could not broadcast Tx: "+y.message)}},async sendMsgCancelUpgrade({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgCancelUpgrade: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$4,prefix:t});let N=this.msgCancelUpgrade({value:MsgCancelUpgrade.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$3,g)}catch(y){throw new Error("TxClient:sendMsgCancelUpgrade: Could not broadcast Tx: "+y.message)}},msgSoftwareUpgrade({value:p}){try{return{typeUrl:"/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade",value:MsgSoftwareUpgrade.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgSoftwareUpgrade: Could not create message: "+u.message)}},msgCancelUpgrade({value:p}){try{return{typeUrl:"/cosmos.upgrade.v1beta1.MsgCancelUpgrade",value:MsgCancelUpgrade.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgCancelUpgrade: Could not create message: "+u.message)}}}),queryClient$9=({addr:e}={addr:"http://localhost:1317"})=>new Api$9({baseURL:e});let SDKModule$9=class{constructor(t){this.registry=[],this.query=queryClient$9({addr:t.env.apiURL}),this.updateTX(t),this.structure={Plan:getStructure$9(Plan$1.fromPartial({})),SoftwareUpgradeProposal:getStructure$9(SoftwareUpgradeProposal.fromPartial({})),CancelSoftwareUpgradeProposal:getStructure$9(CancelSoftwareUpgradeProposal.fromPartial({})),ModuleVersion:getStructure$9(ModuleVersion.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$9({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$9=e=>({module:{CosmosUpgradeV1Beta1:new SDKModule$9(e)},registry:msgTypes$9});function createBaseCoin$2(){return{denom:"",amount:""}}const Coin$2={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$s(e.denom)?String(e.denom):"",amount:isSet$s(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin$2();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$s(e){return e!=null}function createBaseAny$1(){return{typeUrl:"",value:new Uint8Array}}const Any$1={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$r(e.typeUrl)?String(e.typeUrl):"",value:isSet$r(e.value)?bytesFromBase64$8(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$8(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny$1();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$r=(()=>{if(typeof globalThis$r<"u")return globalThis$r;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$8(e){if(globalThis$r.Buffer)return Uint8Array.from(globalThis$r.Buffer.from(e,"base64"));{const t=globalThis$r.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$8(e){if(globalThis$r.Buffer)return globalThis$r.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$r.btoa(t.join(""))}}function isSet$r(e){return e!=null}function createBaseBaseAccount(){return{address:"",pubKey:void 0,accountNumber:0,sequence:0}}const BaseAccount={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.pubKey!==void 0&&Any$1.encode(e.pubKey,t.uint32(18).fork()).ldelim(),e.accountNumber!==0&&t.uint32(24).uint64(e.accountNumber),e.sequence!==0&&t.uint32(32).uint64(e.sequence),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseBaseAccount();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.pubKey=Any$1.decode(n,n.uint32());break;case 3:u.accountNumber=longToNumber$f(n.uint64());break;case 4:u.sequence=longToNumber$f(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$q(e.address)?String(e.address):"",pubKey:isSet$q(e.pubKey)?Any$1.fromJSON(e.pubKey):void 0,accountNumber:isSet$q(e.accountNumber)?Number(e.accountNumber):0,sequence:isSet$q(e.sequence)?Number(e.sequence):0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.pubKey!==void 0&&(t.pubKey=e.pubKey?Any$1.toJSON(e.pubKey):void 0),e.accountNumber!==void 0&&(t.accountNumber=Math.round(e.accountNumber)),e.sequence!==void 0&&(t.sequence=Math.round(e.sequence)),t},fromPartial(e){const t=createBaseBaseAccount();return t.address=e.address??"",t.pubKey=e.pubKey!==void 0&&e.pubKey!==null?Any$1.fromPartial(e.pubKey):void 0,t.accountNumber=e.accountNumber??0,t.sequence=e.sequence??0,t}};var globalThis$q=(()=>{if(typeof globalThis$q<"u")return globalThis$q;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$f(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$q.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$q(e){return e!=null}function createBaseBaseVestingAccount(){return{baseAccount:void 0,originalVesting:[],delegatedFree:[],delegatedVesting:[],endTime:0}}const BaseVestingAccount={encode(e,t=_m0.Writer.create()){e.baseAccount!==void 0&&BaseAccount.encode(e.baseAccount,t.uint32(10).fork()).ldelim();for(const n of e.originalVesting)Coin$2.encode(n,t.uint32(18).fork()).ldelim();for(const n of e.delegatedFree)Coin$2.encode(n,t.uint32(26).fork()).ldelim();for(const n of e.delegatedVesting)Coin$2.encode(n,t.uint32(34).fork()).ldelim();return e.endTime!==0&&t.uint32(40).int64(e.endTime),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseBaseVestingAccount();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.baseAccount=BaseAccount.decode(n,n.uint32());break;case 2:u.originalVesting.push(Coin$2.decode(n,n.uint32()));break;case 3:u.delegatedFree.push(Coin$2.decode(n,n.uint32()));break;case 4:u.delegatedVesting.push(Coin$2.decode(n,n.uint32()));break;case 5:u.endTime=longToNumber$e(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{baseAccount:isSet$p(e.baseAccount)?BaseAccount.fromJSON(e.baseAccount):void 0,originalVesting:Array.isArray(e==null?void 0:e.originalVesting)?e.originalVesting.map(t=>Coin$2.fromJSON(t)):[],delegatedFree:Array.isArray(e==null?void 0:e.delegatedFree)?e.delegatedFree.map(t=>Coin$2.fromJSON(t)):[],delegatedVesting:Array.isArray(e==null?void 0:e.delegatedVesting)?e.delegatedVesting.map(t=>Coin$2.fromJSON(t)):[],endTime:isSet$p(e.endTime)?Number(e.endTime):0}},toJSON(e){const t={};return e.baseAccount!==void 0&&(t.baseAccount=e.baseAccount?BaseAccount.toJSON(e.baseAccount):void 0),e.originalVesting?t.originalVesting=e.originalVesting.map(n=>n?Coin$2.toJSON(n):void 0):t.originalVesting=[],e.delegatedFree?t.delegatedFree=e.delegatedFree.map(n=>n?Coin$2.toJSON(n):void 0):t.delegatedFree=[],e.delegatedVesting?t.delegatedVesting=e.delegatedVesting.map(n=>n?Coin$2.toJSON(n):void 0):t.delegatedVesting=[],e.endTime!==void 0&&(t.endTime=Math.round(e.endTime)),t},fromPartial(e){var n,p,u;const t=createBaseBaseVestingAccount();return t.baseAccount=e.baseAccount!==void 0&&e.baseAccount!==null?BaseAccount.fromPartial(e.baseAccount):void 0,t.originalVesting=((n=e.originalVesting)==null?void 0:n.map(g=>Coin$2.fromPartial(g)))||[],t.delegatedFree=((p=e.delegatedFree)==null?void 0:p.map(g=>Coin$2.fromPartial(g)))||[],t.delegatedVesting=((u=e.delegatedVesting)==null?void 0:u.map(g=>Coin$2.fromPartial(g)))||[],t.endTime=e.endTime??0,t}};function createBaseContinuousVestingAccount(){return{baseVestingAccount:void 0,startTime:0}}const ContinuousVestingAccount={encode(e,t=_m0.Writer.create()){return e.baseVestingAccount!==void 0&&BaseVestingAccount.encode(e.baseVestingAccount,t.uint32(10).fork()).ldelim(),e.startTime!==0&&t.uint32(16).int64(e.startTime),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseContinuousVestingAccount();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.baseVestingAccount=BaseVestingAccount.decode(n,n.uint32());break;case 2:u.startTime=longToNumber$e(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{baseVestingAccount:isSet$p(e.baseVestingAccount)?BaseVestingAccount.fromJSON(e.baseVestingAccount):void 0,startTime:isSet$p(e.startTime)?Number(e.startTime):0}},toJSON(e){const t={};return e.baseVestingAccount!==void 0&&(t.baseVestingAccount=e.baseVestingAccount?BaseVestingAccount.toJSON(e.baseVestingAccount):void 0),e.startTime!==void 0&&(t.startTime=Math.round(e.startTime)),t},fromPartial(e){const t=createBaseContinuousVestingAccount();return t.baseVestingAccount=e.baseVestingAccount!==void 0&&e.baseVestingAccount!==null?BaseVestingAccount.fromPartial(e.baseVestingAccount):void 0,t.startTime=e.startTime??0,t}};function createBaseDelayedVestingAccount(){return{baseVestingAccount:void 0}}const DelayedVestingAccount={encode(e,t=_m0.Writer.create()){return e.baseVestingAccount!==void 0&&BaseVestingAccount.encode(e.baseVestingAccount,t.uint32(10).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDelayedVestingAccount();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.baseVestingAccount=BaseVestingAccount.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{baseVestingAccount:isSet$p(e.baseVestingAccount)?BaseVestingAccount.fromJSON(e.baseVestingAccount):void 0}},toJSON(e){const t={};return e.baseVestingAccount!==void 0&&(t.baseVestingAccount=e.baseVestingAccount?BaseVestingAccount.toJSON(e.baseVestingAccount):void 0),t},fromPartial(e){const t=createBaseDelayedVestingAccount();return t.baseVestingAccount=e.baseVestingAccount!==void 0&&e.baseVestingAccount!==null?BaseVestingAccount.fromPartial(e.baseVestingAccount):void 0,t}};function createBasePeriod(){return{length:0,amount:[]}}const Period={encode(e,t=_m0.Writer.create()){e.length!==0&&t.uint32(8).int64(e.length);for(const n of e.amount)Coin$2.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePeriod();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.length=longToNumber$e(n.int64());break;case 2:u.amount.push(Coin$2.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{length:isSet$p(e.length)?Number(e.length):0,amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$2.fromJSON(t)):[]}},toJSON(e){const t={};return e.length!==void 0&&(t.length=Math.round(e.length)),e.amount?t.amount=e.amount.map(n=>n?Coin$2.toJSON(n):void 0):t.amount=[],t},fromPartial(e){var n;const t=createBasePeriod();return t.length=e.length??0,t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$2.fromPartial(p)))||[],t}};function createBasePeriodicVestingAccount(){return{baseVestingAccount:void 0,startTime:0,vestingPeriods:[]}}const PeriodicVestingAccount={encode(e,t=_m0.Writer.create()){e.baseVestingAccount!==void 0&&BaseVestingAccount.encode(e.baseVestingAccount,t.uint32(10).fork()).ldelim(),e.startTime!==0&&t.uint32(16).int64(e.startTime);for(const n of e.vestingPeriods)Period.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePeriodicVestingAccount();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.baseVestingAccount=BaseVestingAccount.decode(n,n.uint32());break;case 2:u.startTime=longToNumber$e(n.int64());break;case 3:u.vestingPeriods.push(Period.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{baseVestingAccount:isSet$p(e.baseVestingAccount)?BaseVestingAccount.fromJSON(e.baseVestingAccount):void 0,startTime:isSet$p(e.startTime)?Number(e.startTime):0,vestingPeriods:Array.isArray(e==null?void 0:e.vestingPeriods)?e.vestingPeriods.map(t=>Period.fromJSON(t)):[]}},toJSON(e){const t={};return e.baseVestingAccount!==void 0&&(t.baseVestingAccount=e.baseVestingAccount?BaseVestingAccount.toJSON(e.baseVestingAccount):void 0),e.startTime!==void 0&&(t.startTime=Math.round(e.startTime)),e.vestingPeriods?t.vestingPeriods=e.vestingPeriods.map(n=>n?Period.toJSON(n):void 0):t.vestingPeriods=[],t},fromPartial(e){var n;const t=createBasePeriodicVestingAccount();return t.baseVestingAccount=e.baseVestingAccount!==void 0&&e.baseVestingAccount!==null?BaseVestingAccount.fromPartial(e.baseVestingAccount):void 0,t.startTime=e.startTime??0,t.vestingPeriods=((n=e.vestingPeriods)==null?void 0:n.map(p=>Period.fromPartial(p)))||[],t}};function createBasePermanentLockedAccount(){return{baseVestingAccount:void 0}}const PermanentLockedAccount={encode(e,t=_m0.Writer.create()){return e.baseVestingAccount!==void 0&&BaseVestingAccount.encode(e.baseVestingAccount,t.uint32(10).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePermanentLockedAccount();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.baseVestingAccount=BaseVestingAccount.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{baseVestingAccount:isSet$p(e.baseVestingAccount)?BaseVestingAccount.fromJSON(e.baseVestingAccount):void 0}},toJSON(e){const t={};return e.baseVestingAccount!==void 0&&(t.baseVestingAccount=e.baseVestingAccount?BaseVestingAccount.toJSON(e.baseVestingAccount):void 0),t},fromPartial(e){const t=createBasePermanentLockedAccount();return t.baseVestingAccount=e.baseVestingAccount!==void 0&&e.baseVestingAccount!==null?BaseVestingAccount.fromPartial(e.baseVestingAccount):void 0,t}};var globalThis$p=(()=>{if(typeof globalThis$p<"u")return globalThis$p;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$e(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$p.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$p(e){return e!=null}function createBaseMsgCreateVestingAccount(){return{fromAddress:"",toAddress:"",amount:[],endTime:0,delayed:!1}}const MsgCreateVestingAccount={encode(e,t=_m0.Writer.create()){e.fromAddress!==""&&t.uint32(10).string(e.fromAddress),e.toAddress!==""&&t.uint32(18).string(e.toAddress);for(const n of e.amount)Coin$2.encode(n,t.uint32(26).fork()).ldelim();return e.endTime!==0&&t.uint32(32).int64(e.endTime),e.delayed===!0&&t.uint32(40).bool(e.delayed),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgCreateVestingAccount();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.fromAddress=n.string();break;case 2:u.toAddress=n.string();break;case 3:u.amount.push(Coin$2.decode(n,n.uint32()));break;case 4:u.endTime=longToNumber$d(n.int64());break;case 5:u.delayed=n.bool();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{fromAddress:isSet$o(e.fromAddress)?String(e.fromAddress):"",toAddress:isSet$o(e.toAddress)?String(e.toAddress):"",amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$2.fromJSON(t)):[],endTime:isSet$o(e.endTime)?Number(e.endTime):0,delayed:isSet$o(e.delayed)?!!e.delayed:!1}},toJSON(e){const t={};return e.fromAddress!==void 0&&(t.fromAddress=e.fromAddress),e.toAddress!==void 0&&(t.toAddress=e.toAddress),e.amount?t.amount=e.amount.map(n=>n?Coin$2.toJSON(n):void 0):t.amount=[],e.endTime!==void 0&&(t.endTime=Math.round(e.endTime)),e.delayed!==void 0&&(t.delayed=e.delayed),t},fromPartial(e){var n;const t=createBaseMsgCreateVestingAccount();return t.fromAddress=e.fromAddress??"",t.toAddress=e.toAddress??"",t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$2.fromPartial(p)))||[],t.endTime=e.endTime??0,t.delayed=e.delayed??!1,t}};function createBaseMsgCreatePermanentLockedAccount(){return{fromAddress:"",toAddress:"",amount:[]}}const MsgCreatePermanentLockedAccount={encode(e,t=_m0.Writer.create()){e.fromAddress!==""&&t.uint32(10).string(e.fromAddress),e.toAddress!==""&&t.uint32(18).string(e.toAddress);for(const n of e.amount)Coin$2.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgCreatePermanentLockedAccount();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.fromAddress=n.string();break;case 2:u.toAddress=n.string();break;case 3:u.amount.push(Coin$2.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{fromAddress:isSet$o(e.fromAddress)?String(e.fromAddress):"",toAddress:isSet$o(e.toAddress)?String(e.toAddress):"",amount:Array.isArray(e==null?void 0:e.amount)?e.amount.map(t=>Coin$2.fromJSON(t)):[]}},toJSON(e){const t={};return e.fromAddress!==void 0&&(t.fromAddress=e.fromAddress),e.toAddress!==void 0&&(t.toAddress=e.toAddress),e.amount?t.amount=e.amount.map(n=>n?Coin$2.toJSON(n):void 0):t.amount=[],t},fromPartial(e){var n;const t=createBaseMsgCreatePermanentLockedAccount();return t.fromAddress=e.fromAddress??"",t.toAddress=e.toAddress??"",t.amount=((n=e.amount)==null?void 0:n.map(p=>Coin$2.fromPartial(p)))||[],t}};function createBaseMsgCreatePeriodicVestingAccount(){return{fromAddress:"",toAddress:"",startTime:0,vestingPeriods:[]}}const MsgCreatePeriodicVestingAccount={encode(e,t=_m0.Writer.create()){e.fromAddress!==""&&t.uint32(10).string(e.fromAddress),e.toAddress!==""&&t.uint32(18).string(e.toAddress),e.startTime!==0&&t.uint32(24).int64(e.startTime);for(const n of e.vestingPeriods)Period.encode(n,t.uint32(34).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgCreatePeriodicVestingAccount();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.fromAddress=n.string();break;case 2:u.toAddress=n.string();break;case 3:u.startTime=longToNumber$d(n.int64());break;case 4:u.vestingPeriods.push(Period.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{fromAddress:isSet$o(e.fromAddress)?String(e.fromAddress):"",toAddress:isSet$o(e.toAddress)?String(e.toAddress):"",startTime:isSet$o(e.startTime)?Number(e.startTime):0,vestingPeriods:Array.isArray(e==null?void 0:e.vestingPeriods)?e.vestingPeriods.map(t=>Period.fromJSON(t)):[]}},toJSON(e){const t={};return e.fromAddress!==void 0&&(t.fromAddress=e.fromAddress),e.toAddress!==void 0&&(t.toAddress=e.toAddress),e.startTime!==void 0&&(t.startTime=Math.round(e.startTime)),e.vestingPeriods?t.vestingPeriods=e.vestingPeriods.map(n=>n?Period.toJSON(n):void 0):t.vestingPeriods=[],t},fromPartial(e){var n;const t=createBaseMsgCreatePeriodicVestingAccount();return t.fromAddress=e.fromAddress??"",t.toAddress=e.toAddress??"",t.startTime=e.startTime??0,t.vestingPeriods=((n=e.vestingPeriods)==null?void 0:n.map(p=>Period.fromPartial(p)))||[],t}};var globalThis$o=(()=>{if(typeof globalThis$o<"u")return globalThis$o;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$d(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$o.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$o(e){return e!=null}const msgTypes$8=[["/cosmos.vesting.v1beta1.MsgCreateVestingAccount",MsgCreateVestingAccount],["/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount",MsgCreatePeriodicVestingAccount],["/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount",MsgCreatePermanentLockedAccount]];let HttpClient$8=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$8=class extends HttpClient$8{};const registry$3=new build$b.Registry(msgTypes$8);function getStructure$8(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$2={amount:[],gas:"200000"},txClient$8=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgCreateVestingAccount({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgCreateVestingAccount: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$3,prefix:t});let N=this.msgCreateVestingAccount({value:MsgCreateVestingAccount.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$2,g)}catch(y){throw new Error("TxClient:sendMsgCreateVestingAccount: Could not broadcast Tx: "+y.message)}},async sendMsgCreatePeriodicVestingAccount({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgCreatePeriodicVestingAccount: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$3,prefix:t});let N=this.msgCreatePeriodicVestingAccount({value:MsgCreatePeriodicVestingAccount.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$2,g)}catch(y){throw new Error("TxClient:sendMsgCreatePeriodicVestingAccount: Could not broadcast Tx: "+y.message)}},async sendMsgCreatePermanentLockedAccount({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgCreatePermanentLockedAccount: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$3,prefix:t});let N=this.msgCreatePermanentLockedAccount({value:MsgCreatePermanentLockedAccount.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$2,g)}catch(y){throw new Error("TxClient:sendMsgCreatePermanentLockedAccount: Could not broadcast Tx: "+y.message)}},msgCreateVestingAccount({value:p}){try{return{typeUrl:"/cosmos.vesting.v1beta1.MsgCreateVestingAccount",value:MsgCreateVestingAccount.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgCreateVestingAccount: Could not create message: "+u.message)}},msgCreatePeriodicVestingAccount({value:p}){try{return{typeUrl:"/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount",value:MsgCreatePeriodicVestingAccount.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgCreatePeriodicVestingAccount: Could not create message: "+u.message)}},msgCreatePermanentLockedAccount({value:p}){try{return{typeUrl:"/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount",value:MsgCreatePermanentLockedAccount.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgCreatePermanentLockedAccount: Could not create message: "+u.message)}}}),queryClient$8=({addr:e}={addr:"http://localhost:1317"})=>new Api$8({baseURL:e});let SDKModule$8=class{constructor(t){this.registry=[],this.query=queryClient$8({addr:t.env.apiURL}),this.updateTX(t),this.structure={BaseVestingAccount:getStructure$8(BaseVestingAccount.fromPartial({})),ContinuousVestingAccount:getStructure$8(ContinuousVestingAccount.fromPartial({})),DelayedVestingAccount:getStructure$8(DelayedVestingAccount.fromPartial({})),Period:getStructure$8(Period.fromPartial({})),PeriodicVestingAccount:getStructure$8(PeriodicVestingAccount.fromPartial({})),PermanentLockedAccount:getStructure$8(PermanentLockedAccount.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$8({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$8=e=>({module:{CosmosVestingV1Beta1:new SDKModule$8(e)},registry:msgTypes$8}),msgTypes$7=[];let HttpClient$7=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$7=class extends HttpClient$7{constructor(){super(...arguments),this.queryInterchainAccount=(t,n,p={})=>this.request({path:`/ibc/apps/interchain_accounts/controller/v1/owners/${t}/connections/${n}`,method:"GET",format:"json",...p}),this.queryParams=(t={})=>this.request({path:"/ibc/apps/interchain_accounts/controller/v1/params",method:"GET",format:"json",...t})}};function createBaseParams$6(){return{controllerEnabled:!1}}const Params$6={encode(e,t=_m0.Writer.create()){return e.controllerEnabled===!0&&t.uint32(8).bool(e.controllerEnabled),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$6();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.controllerEnabled=n.bool();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{controllerEnabled:isSet$n(e.controllerEnabled)?!!e.controllerEnabled:!1}},toJSON(e){const t={};return e.controllerEnabled!==void 0&&(t.controllerEnabled=e.controllerEnabled),t},fromPartial(e){const t=createBaseParams$6();return t.controllerEnabled=e.controllerEnabled??!1,t}};function isSet$n(e){return e!=null}new build$b.Registry(msgTypes$7);function getStructure$7(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$7=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$7=({addr:e}={addr:"http://localhost:1317"})=>new Api$7({baseURL:e});let SDKModule$7=class{constructor(t){this.registry=[],this.query=queryClient$7({addr:t.env.apiURL}),this.updateTX(t),this.structure={Params:getStructure$7(Params$6.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$7({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$7=e=>({module:{IbcApplicationsInterchainAccountsControllerV1:new SDKModule$7(e)},registry:msgTypes$7}),msgTypes$6=[];let HttpClient$6=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$6=class extends HttpClient$6{constructor(){super(...arguments),this.queryParams=(t={})=>this.request({path:"/ibc/apps/interchain_accounts/host/v1/params",method:"GET",format:"json",...t})}};function createBaseParams$5(){return{hostEnabled:!1,allowMessages:[]}}const Params$5={encode(e,t=_m0.Writer.create()){e.hostEnabled===!0&&t.uint32(8).bool(e.hostEnabled);for(const n of e.allowMessages)t.uint32(18).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$5();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.hostEnabled=n.bool();break;case 2:u.allowMessages.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{hostEnabled:isSet$m(e.hostEnabled)?!!e.hostEnabled:!1,allowMessages:Array.isArray(e==null?void 0:e.allowMessages)?e.allowMessages.map(t=>String(t)):[]}},toJSON(e){const t={};return e.hostEnabled!==void 0&&(t.hostEnabled=e.hostEnabled),e.allowMessages?t.allowMessages=e.allowMessages.map(n=>n):t.allowMessages=[],t},fromPartial(e){var n;const t=createBaseParams$5();return t.hostEnabled=e.hostEnabled??!1,t.allowMessages=((n=e.allowMessages)==null?void 0:n.map(p=>p))||[],t}};function isSet$m(e){return e!=null}new build$b.Registry(msgTypes$6);function getStructure$6(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$6=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$6=({addr:e}={addr:"http://localhost:1317"})=>new Api$6({baseURL:e});let SDKModule$6=class{constructor(t){this.registry=[],this.query=queryClient$6({addr:t.env.apiURL}),this.updateTX(t),this.structure={Params:getStructure$6(Params$5.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$6({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$6=e=>({module:{IbcApplicationsInterchainAccountsHostV1:new SDKModule$6(e)},registry:msgTypes$6}),msgTypes$5=[];let HttpClient$5=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$5=class extends HttpClient$5{constructor(){super(...arguments),this.queryEscrowAddress=(t,n,p={})=>this.request({path:`/ibc/apps/transfer/v1/channels/${t}/ports/${n}/escrow_address`,method:"GET",format:"json",...p}),this.queryDenomHash=(t,n={})=>this.request({path:`/ibc/apps/transfer/v1/denom_hashes/${t}`,method:"GET",format:"json",...n}),this.queryDenomTraces=(t,n={})=>this.request({path:"/ibc/apps/transfer/v1/denom_traces",method:"GET",query:t,format:"json",...n}),this.queryDenomTrace=(t,n={})=>this.request({path:`/ibc/apps/transfer/v1/denom_traces/${t}`,method:"GET",format:"json",...n}),this.queryTotalEscrowForDenom=(t,n={})=>this.request({path:`/ibc/apps/transfer/v1/denoms/${t}/total_escrow`,method:"GET",format:"json",...n}),this.queryParams=(t={})=>this.request({path:"/ibc/apps/transfer/v1/params",method:"GET",format:"json",...t})}};function createBaseCoin$1(){return{denom:"",amount:""}}const Coin$1={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$l(e.denom)?String(e.denom):"",amount:isSet$l(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin$1();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$l(e){return e!=null}function createBaseAllocation(){return{sourcePort:"",sourceChannel:"",spendLimit:[],allowList:[]}}const Allocation={encode(e,t=_m0.Writer.create()){e.sourcePort!==""&&t.uint32(10).string(e.sourcePort),e.sourceChannel!==""&&t.uint32(18).string(e.sourceChannel);for(const n of e.spendLimit)Coin$1.encode(n,t.uint32(26).fork()).ldelim();for(const n of e.allowList)t.uint32(34).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAllocation();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.sourcePort=n.string();break;case 2:u.sourceChannel=n.string();break;case 3:u.spendLimit.push(Coin$1.decode(n,n.uint32()));break;case 4:u.allowList.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{sourcePort:isSet$k(e.sourcePort)?String(e.sourcePort):"",sourceChannel:isSet$k(e.sourceChannel)?String(e.sourceChannel):"",spendLimit:Array.isArray(e==null?void 0:e.spendLimit)?e.spendLimit.map(t=>Coin$1.fromJSON(t)):[],allowList:Array.isArray(e==null?void 0:e.allowList)?e.allowList.map(t=>String(t)):[]}},toJSON(e){const t={};return e.sourcePort!==void 0&&(t.sourcePort=e.sourcePort),e.sourceChannel!==void 0&&(t.sourceChannel=e.sourceChannel),e.spendLimit?t.spendLimit=e.spendLimit.map(n=>n?Coin$1.toJSON(n):void 0):t.spendLimit=[],e.allowList?t.allowList=e.allowList.map(n=>n):t.allowList=[],t},fromPartial(e){var n,p;const t=createBaseAllocation();return t.sourcePort=e.sourcePort??"",t.sourceChannel=e.sourceChannel??"",t.spendLimit=((n=e.spendLimit)==null?void 0:n.map(u=>Coin$1.fromPartial(u)))||[],t.allowList=((p=e.allowList)==null?void 0:p.map(u=>u))||[],t}};function createBaseTransferAuthorization(){return{allocations:[]}}const TransferAuthorization={encode(e,t=_m0.Writer.create()){for(const n of e.allocations)Allocation.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTransferAuthorization();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.allocations.push(Allocation.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{allocations:Array.isArray(e==null?void 0:e.allocations)?e.allocations.map(t=>Allocation.fromJSON(t)):[]}},toJSON(e){const t={};return e.allocations?t.allocations=e.allocations.map(n=>n?Allocation.toJSON(n):void 0):t.allocations=[],t},fromPartial(e){var n;const t=createBaseTransferAuthorization();return t.allocations=((n=e.allocations)==null?void 0:n.map(p=>Allocation.fromPartial(p)))||[],t}};function isSet$k(e){return e!=null}function createBaseDenomTrace(){return{path:"",baseDenom:""}}const DenomTrace={encode(e,t=_m0.Writer.create()){return e.path!==""&&t.uint32(10).string(e.path),e.baseDenom!==""&&t.uint32(18).string(e.baseDenom),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseDenomTrace();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.path=n.string();break;case 2:u.baseDenom=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{path:isSet$j(e.path)?String(e.path):"",baseDenom:isSet$j(e.baseDenom)?String(e.baseDenom):""}},toJSON(e){const t={};return e.path!==void 0&&(t.path=e.path),e.baseDenom!==void 0&&(t.baseDenom=e.baseDenom),t},fromPartial(e){const t=createBaseDenomTrace();return t.path=e.path??"",t.baseDenom=e.baseDenom??"",t}};function createBaseParams$4(){return{sendEnabled:!1,receiveEnabled:!1}}const Params$4={encode(e,t=_m0.Writer.create()){return e.sendEnabled===!0&&t.uint32(8).bool(e.sendEnabled),e.receiveEnabled===!0&&t.uint32(16).bool(e.receiveEnabled),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$4();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.sendEnabled=n.bool();break;case 2:u.receiveEnabled=n.bool();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{sendEnabled:isSet$j(e.sendEnabled)?!!e.sendEnabled:!1,receiveEnabled:isSet$j(e.receiveEnabled)?!!e.receiveEnabled:!1}},toJSON(e){const t={};return e.sendEnabled!==void 0&&(t.sendEnabled=e.sendEnabled),e.receiveEnabled!==void 0&&(t.receiveEnabled=e.receiveEnabled),t},fromPartial(e){const t=createBaseParams$4();return t.sendEnabled=e.sendEnabled??!1,t.receiveEnabled=e.receiveEnabled??!1,t}};function isSet$j(e){return e!=null}new build$b.Registry(msgTypes$5);function getStructure$5(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$5=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$5=({addr:e}={addr:"http://localhost:1317"})=>new Api$5({baseURL:e});let SDKModule$5=class{constructor(t){this.registry=[],this.query=queryClient$5({addr:t.env.apiURL}),this.updateTX(t),this.structure={Allocation:getStructure$5(Allocation.fromPartial({})),TransferAuthorization:getStructure$5(TransferAuthorization.fromPartial({})),DenomTrace:getStructure$5(DenomTrace.fromPartial({})),Params:getStructure$5(Params$4.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$5({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$5=e=>({module:{IbcApplicationsTransferV1:new SDKModule$5(e)},registry:msgTypes$5}),msgTypes$4=[];let HttpClient$4=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$4=class extends HttpClient$4{constructor(){super(...arguments),this.queryChannels=(t,n={})=>this.request({path:"/ibc/core/channel/v1/channels",method:"GET",query:t,format:"json",...n}),this.queryChannel=(t,n,p={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}`,method:"GET",format:"json",...p}),this.queryChannelClientState=(t,n,p={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}/client_state`,method:"GET",format:"json",...p}),this.queryChannelConsensusState=(t,n,p,u,g={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}/consensus_state/revision/${p}/height/${u}`,method:"GET",format:"json",...g}),this.queryNextSequenceReceive=(t,n,p={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}/next_sequence`,method:"GET",format:"json",...p}),this.queryPacketAcknowledgements=(t,n,p,u={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}/packet_acknowledgements`,method:"GET",query:p,format:"json",...u}),this.queryPacketAcknowledgement=(t,n,p,u={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}/packet_acks/${p}`,method:"GET",format:"json",...u}),this.queryPacketCommitments=(t,n,p,u={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}/packet_commitments`,method:"GET",query:p,format:"json",...u}),this.queryUnreceivedAcks=(t,n,p,u={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}/packet_commitments/${p}/unreceived_acks`,method:"GET",format:"json",...u}),this.queryUnreceivedPackets=(t,n,p,u={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}/packet_commitments/${p}/unreceived_packets`,method:"GET",format:"json",...u}),this.queryPacketCommitment=(t,n,p,u={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}/packet_commitments/${p}`,method:"GET",format:"json",...u}),this.queryPacketReceipt=(t,n,p,u={})=>this.request({path:`/ibc/core/channel/v1/channels/${t}/ports/${n}/packet_receipts/${p}`,method:"GET",format:"json",...u}),this.queryConnectionChannels=(t,n,p={})=>this.request({path:`/ibc/core/channel/v1/connections/${t}/channels`,method:"GET",query:n,format:"json",...p})}};var globalThis$n=(()=>{if(typeof globalThis$n<"u")return globalThis$n;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})(),globalThis$m=(()=>{if(typeof globalThis$m<"u")return globalThis$m;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());var globalThis$l=(()=>{if(typeof globalThis$l<"u")return globalThis$l;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function createBaseHeight$1(){return{revisionNumber:0,revisionHeight:0}}const Height$1={encode(e,t=_m0.Writer.create()){return e.revisionNumber!==0&&t.uint32(8).uint64(e.revisionNumber),e.revisionHeight!==0&&t.uint32(16).uint64(e.revisionHeight),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseHeight$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.revisionNumber=longToNumber$c(n.uint64());break;case 2:u.revisionHeight=longToNumber$c(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{revisionNumber:isSet$i(e.revisionNumber)?Number(e.revisionNumber):0,revisionHeight:isSet$i(e.revisionHeight)?Number(e.revisionHeight):0}},toJSON(e){const t={};return e.revisionNumber!==void 0&&(t.revisionNumber=Math.round(e.revisionNumber)),e.revisionHeight!==void 0&&(t.revisionHeight=Math.round(e.revisionHeight)),t},fromPartial(e){const t=createBaseHeight$1();return t.revisionNumber=e.revisionNumber??0,t.revisionHeight=e.revisionHeight??0,t}};var globalThis$k=(()=>{if(typeof globalThis$k<"u")return globalThis$k;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$c(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$k.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$i(e){return e!=null}function stateFromJSON$1(e){switch(e){case 0:case"STATE_UNINITIALIZED_UNSPECIFIED":return 0;case 1:case"STATE_INIT":return 1;case 2:case"STATE_TRYOPEN":return 2;case 3:case"STATE_OPEN":return 3;case 4:case"STATE_CLOSED":return 4;case-1:case"UNRECOGNIZED":default:return-1}}function stateToJSON$1(e){switch(e){case 0:return"STATE_UNINITIALIZED_UNSPECIFIED";case 1:return"STATE_INIT";case 2:return"STATE_TRYOPEN";case 3:return"STATE_OPEN";case 4:return"STATE_CLOSED";case-1:default:return"UNRECOGNIZED"}}function orderFromJSON(e){switch(e){case 0:case"ORDER_NONE_UNSPECIFIED":return 0;case 1:case"ORDER_UNORDERED":return 1;case 2:case"ORDER_ORDERED":return 2;case-1:case"UNRECOGNIZED":default:return-1}}function orderToJSON(e){switch(e){case 0:return"ORDER_NONE_UNSPECIFIED";case 1:return"ORDER_UNORDERED";case 2:return"ORDER_ORDERED";case-1:default:return"UNRECOGNIZED"}}function createBaseChannel(){return{state:0,ordering:0,counterparty:void 0,connectionHops:[],version:""}}const Channel={encode(e,t=_m0.Writer.create()){e.state!==0&&t.uint32(8).int32(e.state),e.ordering!==0&&t.uint32(16).int32(e.ordering),e.counterparty!==void 0&&Counterparty$1.encode(e.counterparty,t.uint32(26).fork()).ldelim();for(const n of e.connectionHops)t.uint32(34).string(n);return e.version!==""&&t.uint32(42).string(e.version),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseChannel();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.state=n.int32();break;case 2:u.ordering=n.int32();break;case 3:u.counterparty=Counterparty$1.decode(n,n.uint32());break;case 4:u.connectionHops.push(n.string());break;case 5:u.version=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{state:isSet$h(e.state)?stateFromJSON$1(e.state):0,ordering:isSet$h(e.ordering)?orderFromJSON(e.ordering):0,counterparty:isSet$h(e.counterparty)?Counterparty$1.fromJSON(e.counterparty):void 0,connectionHops:Array.isArray(e==null?void 0:e.connectionHops)?e.connectionHops.map(t=>String(t)):[],version:isSet$h(e.version)?String(e.version):""}},toJSON(e){const t={};return e.state!==void 0&&(t.state=stateToJSON$1(e.state)),e.ordering!==void 0&&(t.ordering=orderToJSON(e.ordering)),e.counterparty!==void 0&&(t.counterparty=e.counterparty?Counterparty$1.toJSON(e.counterparty):void 0),e.connectionHops?t.connectionHops=e.connectionHops.map(n=>n):t.connectionHops=[],e.version!==void 0&&(t.version=e.version),t},fromPartial(e){var n;const t=createBaseChannel();return t.state=e.state??0,t.ordering=e.ordering??0,t.counterparty=e.counterparty!==void 0&&e.counterparty!==null?Counterparty$1.fromPartial(e.counterparty):void 0,t.connectionHops=((n=e.connectionHops)==null?void 0:n.map(p=>p))||[],t.version=e.version??"",t}};function createBaseIdentifiedChannel(){return{state:0,ordering:0,counterparty:void 0,connectionHops:[],version:"",portId:"",channelId:""}}const IdentifiedChannel={encode(e,t=_m0.Writer.create()){e.state!==0&&t.uint32(8).int32(e.state),e.ordering!==0&&t.uint32(16).int32(e.ordering),e.counterparty!==void 0&&Counterparty$1.encode(e.counterparty,t.uint32(26).fork()).ldelim();for(const n of e.connectionHops)t.uint32(34).string(n);return e.version!==""&&t.uint32(42).string(e.version),e.portId!==""&&t.uint32(50).string(e.portId),e.channelId!==""&&t.uint32(58).string(e.channelId),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseIdentifiedChannel();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.state=n.int32();break;case 2:u.ordering=n.int32();break;case 3:u.counterparty=Counterparty$1.decode(n,n.uint32());break;case 4:u.connectionHops.push(n.string());break;case 5:u.version=n.string();break;case 6:u.portId=n.string();break;case 7:u.channelId=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{state:isSet$h(e.state)?stateFromJSON$1(e.state):0,ordering:isSet$h(e.ordering)?orderFromJSON(e.ordering):0,counterparty:isSet$h(e.counterparty)?Counterparty$1.fromJSON(e.counterparty):void 0,connectionHops:Array.isArray(e==null?void 0:e.connectionHops)?e.connectionHops.map(t=>String(t)):[],version:isSet$h(e.version)?String(e.version):"",portId:isSet$h(e.portId)?String(e.portId):"",channelId:isSet$h(e.channelId)?String(e.channelId):""}},toJSON(e){const t={};return e.state!==void 0&&(t.state=stateToJSON$1(e.state)),e.ordering!==void 0&&(t.ordering=orderToJSON(e.ordering)),e.counterparty!==void 0&&(t.counterparty=e.counterparty?Counterparty$1.toJSON(e.counterparty):void 0),e.connectionHops?t.connectionHops=e.connectionHops.map(n=>n):t.connectionHops=[],e.version!==void 0&&(t.version=e.version),e.portId!==void 0&&(t.portId=e.portId),e.channelId!==void 0&&(t.channelId=e.channelId),t},fromPartial(e){var n;const t=createBaseIdentifiedChannel();return t.state=e.state??0,t.ordering=e.ordering??0,t.counterparty=e.counterparty!==void 0&&e.counterparty!==null?Counterparty$1.fromPartial(e.counterparty):void 0,t.connectionHops=((n=e.connectionHops)==null?void 0:n.map(p=>p))||[],t.version=e.version??"",t.portId=e.portId??"",t.channelId=e.channelId??"",t}};function createBaseCounterparty$1(){return{portId:"",channelId:""}}const Counterparty$1={encode(e,t=_m0.Writer.create()){return e.portId!==""&&t.uint32(10).string(e.portId),e.channelId!==""&&t.uint32(18).string(e.channelId),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCounterparty$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.portId=n.string();break;case 2:u.channelId=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{portId:isSet$h(e.portId)?String(e.portId):"",channelId:isSet$h(e.channelId)?String(e.channelId):""}},toJSON(e){const t={};return e.portId!==void 0&&(t.portId=e.portId),e.channelId!==void 0&&(t.channelId=e.channelId),t},fromPartial(e){const t=createBaseCounterparty$1();return t.portId=e.portId??"",t.channelId=e.channelId??"",t}};function createBasePacket(){return{sequence:0,sourcePort:"",sourceChannel:"",destinationPort:"",destinationChannel:"",data:new Uint8Array,timeoutHeight:void 0,timeoutTimestamp:0}}const Packet={encode(e,t=_m0.Writer.create()){return e.sequence!==0&&t.uint32(8).uint64(e.sequence),e.sourcePort!==""&&t.uint32(18).string(e.sourcePort),e.sourceChannel!==""&&t.uint32(26).string(e.sourceChannel),e.destinationPort!==""&&t.uint32(34).string(e.destinationPort),e.destinationChannel!==""&&t.uint32(42).string(e.destinationChannel),e.data.length!==0&&t.uint32(50).bytes(e.data),e.timeoutHeight!==void 0&&Height$1.encode(e.timeoutHeight,t.uint32(58).fork()).ldelim(),e.timeoutTimestamp!==0&&t.uint32(64).uint64(e.timeoutTimestamp),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePacket();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.sequence=longToNumber$b(n.uint64());break;case 2:u.sourcePort=n.string();break;case 3:u.sourceChannel=n.string();break;case 4:u.destinationPort=n.string();break;case 5:u.destinationChannel=n.string();break;case 6:u.data=n.bytes();break;case 7:u.timeoutHeight=Height$1.decode(n,n.uint32());break;case 8:u.timeoutTimestamp=longToNumber$b(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{sequence:isSet$h(e.sequence)?Number(e.sequence):0,sourcePort:isSet$h(e.sourcePort)?String(e.sourcePort):"",sourceChannel:isSet$h(e.sourceChannel)?String(e.sourceChannel):"",destinationPort:isSet$h(e.destinationPort)?String(e.destinationPort):"",destinationChannel:isSet$h(e.destinationChannel)?String(e.destinationChannel):"",data:isSet$h(e.data)?bytesFromBase64$7(e.data):new Uint8Array,timeoutHeight:isSet$h(e.timeoutHeight)?Height$1.fromJSON(e.timeoutHeight):void 0,timeoutTimestamp:isSet$h(e.timeoutTimestamp)?Number(e.timeoutTimestamp):0}},toJSON(e){const t={};return e.sequence!==void 0&&(t.sequence=Math.round(e.sequence)),e.sourcePort!==void 0&&(t.sourcePort=e.sourcePort),e.sourceChannel!==void 0&&(t.sourceChannel=e.sourceChannel),e.destinationPort!==void 0&&(t.destinationPort=e.destinationPort),e.destinationChannel!==void 0&&(t.destinationChannel=e.destinationChannel),e.data!==void 0&&(t.data=base64FromBytes$7(e.data!==void 0?e.data:new Uint8Array)),e.timeoutHeight!==void 0&&(t.timeoutHeight=e.timeoutHeight?Height$1.toJSON(e.timeoutHeight):void 0),e.timeoutTimestamp!==void 0&&(t.timeoutTimestamp=Math.round(e.timeoutTimestamp)),t},fromPartial(e){const t=createBasePacket();return t.sequence=e.sequence??0,t.sourcePort=e.sourcePort??"",t.sourceChannel=e.sourceChannel??"",t.destinationPort=e.destinationPort??"",t.destinationChannel=e.destinationChannel??"",t.data=e.data??new Uint8Array,t.timeoutHeight=e.timeoutHeight!==void 0&&e.timeoutHeight!==null?Height$1.fromPartial(e.timeoutHeight):void 0,t.timeoutTimestamp=e.timeoutTimestamp??0,t}};function createBasePacketState(){return{portId:"",channelId:"",sequence:0,data:new Uint8Array}}const PacketState={encode(e,t=_m0.Writer.create()){return e.portId!==""&&t.uint32(10).string(e.portId),e.channelId!==""&&t.uint32(18).string(e.channelId),e.sequence!==0&&t.uint32(24).uint64(e.sequence),e.data.length!==0&&t.uint32(34).bytes(e.data),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePacketState();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.portId=n.string();break;case 2:u.channelId=n.string();break;case 3:u.sequence=longToNumber$b(n.uint64());break;case 4:u.data=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{portId:isSet$h(e.portId)?String(e.portId):"",channelId:isSet$h(e.channelId)?String(e.channelId):"",sequence:isSet$h(e.sequence)?Number(e.sequence):0,data:isSet$h(e.data)?bytesFromBase64$7(e.data):new Uint8Array}},toJSON(e){const t={};return e.portId!==void 0&&(t.portId=e.portId),e.channelId!==void 0&&(t.channelId=e.channelId),e.sequence!==void 0&&(t.sequence=Math.round(e.sequence)),e.data!==void 0&&(t.data=base64FromBytes$7(e.data!==void 0?e.data:new Uint8Array)),t},fromPartial(e){const t=createBasePacketState();return t.portId=e.portId??"",t.channelId=e.channelId??"",t.sequence=e.sequence??0,t.data=e.data??new Uint8Array,t}};function createBasePacketId(){return{portId:"",channelId:"",sequence:0}}const PacketId={encode(e,t=_m0.Writer.create()){return e.portId!==""&&t.uint32(10).string(e.portId),e.channelId!==""&&t.uint32(18).string(e.channelId),e.sequence!==0&&t.uint32(24).uint64(e.sequence),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePacketId();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.portId=n.string();break;case 2:u.channelId=n.string();break;case 3:u.sequence=longToNumber$b(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{portId:isSet$h(e.portId)?String(e.portId):"",channelId:isSet$h(e.channelId)?String(e.channelId):"",sequence:isSet$h(e.sequence)?Number(e.sequence):0}},toJSON(e){const t={};return e.portId!==void 0&&(t.portId=e.portId),e.channelId!==void 0&&(t.channelId=e.channelId),e.sequence!==void 0&&(t.sequence=Math.round(e.sequence)),t},fromPartial(e){const t=createBasePacketId();return t.portId=e.portId??"",t.channelId=e.channelId??"",t.sequence=e.sequence??0,t}};function createBaseAcknowledgement(){return{result:void 0,error:void 0}}const Acknowledgement={encode(e,t=_m0.Writer.create()){return e.result!==void 0&&t.uint32(170).bytes(e.result),e.error!==void 0&&t.uint32(178).string(e.error),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAcknowledgement();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 21:u.result=n.bytes();break;case 22:u.error=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{result:isSet$h(e.result)?bytesFromBase64$7(e.result):void 0,error:isSet$h(e.error)?String(e.error):void 0}},toJSON(e){const t={};return e.result!==void 0&&(t.result=e.result!==void 0?base64FromBytes$7(e.result):void 0),e.error!==void 0&&(t.error=e.error),t},fromPartial(e){const t=createBaseAcknowledgement();return t.result=e.result??void 0,t.error=e.error??void 0,t}};var globalThis$j=(()=>{if(typeof globalThis$j<"u")return globalThis$j;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$7(e){if(globalThis$j.Buffer)return Uint8Array.from(globalThis$j.Buffer.from(e,"base64"));{const t=globalThis$j.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$7(e){if(globalThis$j.Buffer)return globalThis$j.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$j.btoa(t.join(""))}}function longToNumber$b(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$j.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$h(e){return e!=null}function createBasePacketSequence(){return{portId:"",channelId:"",sequence:0}}const PacketSequence={encode(e,t=_m0.Writer.create()){return e.portId!==""&&t.uint32(10).string(e.portId),e.channelId!==""&&t.uint32(18).string(e.channelId),e.sequence!==0&&t.uint32(24).uint64(e.sequence),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePacketSequence();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.portId=n.string();break;case 2:u.channelId=n.string();break;case 3:u.sequence=longToNumber$a(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{portId:isSet$g(e.portId)?String(e.portId):"",channelId:isSet$g(e.channelId)?String(e.channelId):"",sequence:isSet$g(e.sequence)?Number(e.sequence):0}},toJSON(e){const t={};return e.portId!==void 0&&(t.portId=e.portId),e.channelId!==void 0&&(t.channelId=e.channelId),e.sequence!==void 0&&(t.sequence=Math.round(e.sequence)),t},fromPartial(e){const t=createBasePacketSequence();return t.portId=e.portId??"",t.channelId=e.channelId??"",t.sequence=e.sequence??0,t}};var globalThis$i=(()=>{if(typeof globalThis$i<"u")return globalThis$i;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$a(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$i.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$g(e){return e!=null}new build$b.Registry(msgTypes$4);function getStructure$4(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$4=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$4=({addr:e}={addr:"http://localhost:1317"})=>new Api$4({baseURL:e});let SDKModule$4=class{constructor(t){this.registry=[],this.query=queryClient$4({addr:t.env.apiURL}),this.updateTX(t),this.structure={Channel:getStructure$4(Channel.fromPartial({})),IdentifiedChannel:getStructure$4(IdentifiedChannel.fromPartial({})),Counterparty:getStructure$4(Counterparty$1.fromPartial({})),Packet:getStructure$4(Packet.fromPartial({})),PacketState:getStructure$4(PacketState.fromPartial({})),PacketId:getStructure$4(PacketId.fromPartial({})),Acknowledgement:getStructure$4(Acknowledgement.fromPartial({})),PacketSequence:getStructure$4(PacketSequence.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$4({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$4=e=>({module:{IbcCoreChannelV1:new SDKModule$4(e)},registry:msgTypes$4}),msgTypes$3=[];let HttpClient$3=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$3=class extends HttpClient$3{constructor(){super(...arguments),this.queryClientStates=(t,n={})=>this.request({path:"/ibc/core/client/v1/client_states",method:"GET",query:t,format:"json",...n}),this.queryClientState=(t,n={})=>this.request({path:`/ibc/core/client/v1/client_states/${t}`,method:"GET",format:"json",...n}),this.queryClientStatus=(t,n={})=>this.request({path:`/ibc/core/client/v1/client_status/${t}`,method:"GET",format:"json",...n}),this.queryConsensusStates=(t,n,p={})=>this.request({path:`/ibc/core/client/v1/consensus_states/${t}`,method:"GET",query:n,format:"json",...p}),this.queryConsensusStateHeights=(t,n,p={})=>this.request({path:`/ibc/core/client/v1/consensus_states/${t}/heights`,method:"GET",query:n,format:"json",...p}),this.queryConsensusState=(t,n,p,u,g={})=>this.request({path:`/ibc/core/client/v1/consensus_states/${t}/revision/${n}/height/${p}`,method:"GET",query:u,format:"json",...g}),this.queryClientParams=(t={})=>this.request({path:"/ibc/core/client/v1/params",method:"GET",format:"json",...t}),this.queryUpgradedClientState=(t={})=>this.request({path:"/ibc/core/client/v1/upgraded_client_states",method:"GET",format:"json",...t}),this.queryUpgradedConsensusState=(t={})=>this.request({path:"/ibc/core/client/v1/upgraded_consensus_states",method:"GET",format:"json",...t})}};function createBaseAny(){return{typeUrl:"",value:new Uint8Array}}const Any={encode(e,t=_m0.Writer.create()){return e.typeUrl!==""&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseAny();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.typeUrl=n.string();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{typeUrl:isSet$f(e.typeUrl)?String(e.typeUrl):"",value:isSet$f(e.value)?bytesFromBase64$6(e.value):new Uint8Array}},toJSON(e){const t={};return e.typeUrl!==void 0&&(t.typeUrl=e.typeUrl),e.value!==void 0&&(t.value=base64FromBytes$6(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseAny();return t.typeUrl=e.typeUrl??"",t.value=e.value??new Uint8Array,t}};var globalThis$h=(()=>{if(typeof globalThis$h<"u")return globalThis$h;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$6(e){if(globalThis$h.Buffer)return Uint8Array.from(globalThis$h.Buffer.from(e,"base64"));{const t=globalThis$h.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$6(e){if(globalThis$h.Buffer)return globalThis$h.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$h.btoa(t.join(""))}}function isSet$f(e){return e!=null}function createBaseTimestamp(){return{seconds:0,nanos:0}}const Timestamp={encode(e,t=_m0.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseTimestamp();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.seconds=longToNumber$9(n.int64());break;case 2:u.nanos=n.int32();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{seconds:isSet$e(e.seconds)?Number(e.seconds):0,nanos:isSet$e(e.nanos)?Number(e.nanos):0}},toJSON(e){const t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},fromPartial(e){const t=createBaseTimestamp();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};var globalThis$g=(()=>{if(typeof globalThis$g<"u")return globalThis$g;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$9(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$g.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$e(e){return e!=null}function createBasePlan(){return{name:"",time:void 0,height:0,info:"",upgradedClientState:void 0}}const Plan={encode(e,t=_m0.Writer.create()){return e.name!==""&&t.uint32(10).string(e.name),e.time!==void 0&&Timestamp.encode(toTimestamp(e.time),t.uint32(18).fork()).ldelim(),e.height!==0&&t.uint32(24).int64(e.height),e.info!==""&&t.uint32(34).string(e.info),e.upgradedClientState!==void 0&&Any.encode(e.upgradedClientState,t.uint32(42).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePlan();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.name=n.string();break;case 2:u.time=fromTimestamp(Timestamp.decode(n,n.uint32()));break;case 3:u.height=longToNumber$8(n.int64());break;case 4:u.info=n.string();break;case 5:u.upgradedClientState=Any.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{name:isSet$d(e.name)?String(e.name):"",time:isSet$d(e.time)?fromJsonTimestamp(e.time):void 0,height:isSet$d(e.height)?Number(e.height):0,info:isSet$d(e.info)?String(e.info):"",upgradedClientState:isSet$d(e.upgradedClientState)?Any.fromJSON(e.upgradedClientState):void 0}},toJSON(e){const t={};return e.name!==void 0&&(t.name=e.name),e.time!==void 0&&(t.time=e.time.toISOString()),e.height!==void 0&&(t.height=Math.round(e.height)),e.info!==void 0&&(t.info=e.info),e.upgradedClientState!==void 0&&(t.upgradedClientState=e.upgradedClientState?Any.toJSON(e.upgradedClientState):void 0),t},fromPartial(e){const t=createBasePlan();return t.name=e.name??"",t.time=e.time??void 0,t.height=e.height??0,t.info=e.info??"",t.upgradedClientState=e.upgradedClientState!==void 0&&e.upgradedClientState!==null?Any.fromPartial(e.upgradedClientState):void 0,t}};var globalThis$f=(()=>{if(typeof globalThis$f<"u")return globalThis$f;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function toTimestamp(e){const t=e.getTime()/1e3,n=e.getTime()%1e3*1e6;return{seconds:t,nanos:n}}function fromTimestamp(e){let t=e.seconds*1e3;return t+=e.nanos/1e6,new Date(t)}function fromJsonTimestamp(e){return e instanceof Date?e:typeof e=="string"?new Date(e):fromTimestamp(Timestamp.fromJSON(e))}function longToNumber$8(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$f.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$d(e){return e!=null}function createBaseIdentifiedClientState(){return{clientId:"",clientState:void 0}}const IdentifiedClientState={encode(e,t=_m0.Writer.create()){return e.clientId!==""&&t.uint32(10).string(e.clientId),e.clientState!==void 0&&Any.encode(e.clientState,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseIdentifiedClientState();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.clientId=n.string();break;case 2:u.clientState=Any.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{clientId:isSet$c(e.clientId)?String(e.clientId):"",clientState:isSet$c(e.clientState)?Any.fromJSON(e.clientState):void 0}},toJSON(e){const t={};return e.clientId!==void 0&&(t.clientId=e.clientId),e.clientState!==void 0&&(t.clientState=e.clientState?Any.toJSON(e.clientState):void 0),t},fromPartial(e){const t=createBaseIdentifiedClientState();return t.clientId=e.clientId??"",t.clientState=e.clientState!==void 0&&e.clientState!==null?Any.fromPartial(e.clientState):void 0,t}};function createBaseConsensusStateWithHeight(){return{height:void 0,consensusState:void 0}}const ConsensusStateWithHeight={encode(e,t=_m0.Writer.create()){return e.height!==void 0&&Height.encode(e.height,t.uint32(10).fork()).ldelim(),e.consensusState!==void 0&&Any.encode(e.consensusState,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseConsensusStateWithHeight();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.height=Height.decode(n,n.uint32());break;case 2:u.consensusState=Any.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{height:isSet$c(e.height)?Height.fromJSON(e.height):void 0,consensusState:isSet$c(e.consensusState)?Any.fromJSON(e.consensusState):void 0}},toJSON(e){const t={};return e.height!==void 0&&(t.height=e.height?Height.toJSON(e.height):void 0),e.consensusState!==void 0&&(t.consensusState=e.consensusState?Any.toJSON(e.consensusState):void 0),t},fromPartial(e){const t=createBaseConsensusStateWithHeight();return t.height=e.height!==void 0&&e.height!==null?Height.fromPartial(e.height):void 0,t.consensusState=e.consensusState!==void 0&&e.consensusState!==null?Any.fromPartial(e.consensusState):void 0,t}};function createBaseClientConsensusStates(){return{clientId:"",consensusStates:[]}}const ClientConsensusStates={encode(e,t=_m0.Writer.create()){e.clientId!==""&&t.uint32(10).string(e.clientId);for(const n of e.consensusStates)ConsensusStateWithHeight.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseClientConsensusStates();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.clientId=n.string();break;case 2:u.consensusStates.push(ConsensusStateWithHeight.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{clientId:isSet$c(e.clientId)?String(e.clientId):"",consensusStates:Array.isArray(e==null?void 0:e.consensusStates)?e.consensusStates.map(t=>ConsensusStateWithHeight.fromJSON(t)):[]}},toJSON(e){const t={};return e.clientId!==void 0&&(t.clientId=e.clientId),e.consensusStates?t.consensusStates=e.consensusStates.map(n=>n?ConsensusStateWithHeight.toJSON(n):void 0):t.consensusStates=[],t},fromPartial(e){var n;const t=createBaseClientConsensusStates();return t.clientId=e.clientId??"",t.consensusStates=((n=e.consensusStates)==null?void 0:n.map(p=>ConsensusStateWithHeight.fromPartial(p)))||[],t}};function createBaseClientUpdateProposal(){return{title:"",description:"",subjectClientId:"",substituteClientId:""}}const ClientUpdateProposal={encode(e,t=_m0.Writer.create()){return e.title!==""&&t.uint32(10).string(e.title),e.description!==""&&t.uint32(18).string(e.description),e.subjectClientId!==""&&t.uint32(26).string(e.subjectClientId),e.substituteClientId!==""&&t.uint32(34).string(e.substituteClientId),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseClientUpdateProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.title=n.string();break;case 2:u.description=n.string();break;case 3:u.subjectClientId=n.string();break;case 4:u.substituteClientId=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{title:isSet$c(e.title)?String(e.title):"",description:isSet$c(e.description)?String(e.description):"",subjectClientId:isSet$c(e.subjectClientId)?String(e.subjectClientId):"",substituteClientId:isSet$c(e.substituteClientId)?String(e.substituteClientId):""}},toJSON(e){const t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),e.subjectClientId!==void 0&&(t.subjectClientId=e.subjectClientId),e.substituteClientId!==void 0&&(t.substituteClientId=e.substituteClientId),t},fromPartial(e){const t=createBaseClientUpdateProposal();return t.title=e.title??"",t.description=e.description??"",t.subjectClientId=e.subjectClientId??"",t.substituteClientId=e.substituteClientId??"",t}};function createBaseUpgradeProposal(){return{title:"",description:"",plan:void 0,upgradedClientState:void 0}}const UpgradeProposal={encode(e,t=_m0.Writer.create()){return e.title!==""&&t.uint32(10).string(e.title),e.description!==""&&t.uint32(18).string(e.description),e.plan!==void 0&&Plan.encode(e.plan,t.uint32(26).fork()).ldelim(),e.upgradedClientState!==void 0&&Any.encode(e.upgradedClientState,t.uint32(34).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseUpgradeProposal();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.title=n.string();break;case 2:u.description=n.string();break;case 3:u.plan=Plan.decode(n,n.uint32());break;case 4:u.upgradedClientState=Any.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{title:isSet$c(e.title)?String(e.title):"",description:isSet$c(e.description)?String(e.description):"",plan:isSet$c(e.plan)?Plan.fromJSON(e.plan):void 0,upgradedClientState:isSet$c(e.upgradedClientState)?Any.fromJSON(e.upgradedClientState):void 0}},toJSON(e){const t={};return e.title!==void 0&&(t.title=e.title),e.description!==void 0&&(t.description=e.description),e.plan!==void 0&&(t.plan=e.plan?Plan.toJSON(e.plan):void 0),e.upgradedClientState!==void 0&&(t.upgradedClientState=e.upgradedClientState?Any.toJSON(e.upgradedClientState):void 0),t},fromPartial(e){const t=createBaseUpgradeProposal();return t.title=e.title??"",t.description=e.description??"",t.plan=e.plan!==void 0&&e.plan!==null?Plan.fromPartial(e.plan):void 0,t.upgradedClientState=e.upgradedClientState!==void 0&&e.upgradedClientState!==null?Any.fromPartial(e.upgradedClientState):void 0,t}};function createBaseHeight(){return{revisionNumber:0,revisionHeight:0}}const Height={encode(e,t=_m0.Writer.create()){return e.revisionNumber!==0&&t.uint32(8).uint64(e.revisionNumber),e.revisionHeight!==0&&t.uint32(16).uint64(e.revisionHeight),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseHeight();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.revisionNumber=longToNumber$7(n.uint64());break;case 2:u.revisionHeight=longToNumber$7(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{revisionNumber:isSet$c(e.revisionNumber)?Number(e.revisionNumber):0,revisionHeight:isSet$c(e.revisionHeight)?Number(e.revisionHeight):0}},toJSON(e){const t={};return e.revisionNumber!==void 0&&(t.revisionNumber=Math.round(e.revisionNumber)),e.revisionHeight!==void 0&&(t.revisionHeight=Math.round(e.revisionHeight)),t},fromPartial(e){const t=createBaseHeight();return t.revisionNumber=e.revisionNumber??0,t.revisionHeight=e.revisionHeight??0,t}};function createBaseParams$3(){return{allowedClients:[]}}const Params$3={encode(e,t=_m0.Writer.create()){for(const n of e.allowedClients)t.uint32(10).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$3();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.allowedClients.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{allowedClients:Array.isArray(e==null?void 0:e.allowedClients)?e.allowedClients.map(t=>String(t)):[]}},toJSON(e){const t={};return e.allowedClients?t.allowedClients=e.allowedClients.map(n=>n):t.allowedClients=[],t},fromPartial(e){var n;const t=createBaseParams$3();return t.allowedClients=((n=e.allowedClients)==null?void 0:n.map(p=>p))||[],t}};var globalThis$e=(()=>{if(typeof globalThis$e<"u")return globalThis$e;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$7(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$e.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$c(e){return e!=null}function createBaseGenesisMetadata(){return{key:new Uint8Array,value:new Uint8Array}}const GenesisMetadata={encode(e,t=_m0.Writer.create()){return e.key.length!==0&&t.uint32(10).bytes(e.key),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseGenesisMetadata();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.key=n.bytes();break;case 2:u.value=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{key:isSet$b(e.key)?bytesFromBase64$5(e.key):new Uint8Array,value:isSet$b(e.value)?bytesFromBase64$5(e.value):new Uint8Array}},toJSON(e){const t={};return e.key!==void 0&&(t.key=base64FromBytes$5(e.key!==void 0?e.key:new Uint8Array)),e.value!==void 0&&(t.value=base64FromBytes$5(e.value!==void 0?e.value:new Uint8Array)),t},fromPartial(e){const t=createBaseGenesisMetadata();return t.key=e.key??new Uint8Array,t.value=e.value??new Uint8Array,t}};function createBaseIdentifiedGenesisMetadata(){return{clientId:"",clientMetadata:[]}}const IdentifiedGenesisMetadata={encode(e,t=_m0.Writer.create()){e.clientId!==""&&t.uint32(10).string(e.clientId);for(const n of e.clientMetadata)GenesisMetadata.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseIdentifiedGenesisMetadata();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.clientId=n.string();break;case 2:u.clientMetadata.push(GenesisMetadata.decode(n,n.uint32()));break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{clientId:isSet$b(e.clientId)?String(e.clientId):"",clientMetadata:Array.isArray(e==null?void 0:e.clientMetadata)?e.clientMetadata.map(t=>GenesisMetadata.fromJSON(t)):[]}},toJSON(e){const t={};return e.clientId!==void 0&&(t.clientId=e.clientId),e.clientMetadata?t.clientMetadata=e.clientMetadata.map(n=>n?GenesisMetadata.toJSON(n):void 0):t.clientMetadata=[],t},fromPartial(e){var n;const t=createBaseIdentifiedGenesisMetadata();return t.clientId=e.clientId??"",t.clientMetadata=((n=e.clientMetadata)==null?void 0:n.map(p=>GenesisMetadata.fromPartial(p)))||[],t}};var globalThis$d=(()=>{if(typeof globalThis$d<"u")return globalThis$d;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$5(e){if(globalThis$d.Buffer)return Uint8Array.from(globalThis$d.Buffer.from(e,"base64"));{const t=globalThis$d.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$5(e){if(globalThis$d.Buffer)return globalThis$d.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$d.btoa(t.join(""))}}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$b(e){return e!=null}new build$b.Registry(msgTypes$3);function getStructure$3(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$3=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$3=({addr:e}={addr:"http://localhost:1317"})=>new Api$3({baseURL:e});let SDKModule$3=class{constructor(t){this.registry=[],this.query=queryClient$3({addr:t.env.apiURL}),this.updateTX(t),this.structure={IdentifiedClientState:getStructure$3(IdentifiedClientState.fromPartial({})),ConsensusStateWithHeight:getStructure$3(ConsensusStateWithHeight.fromPartial({})),ClientConsensusStates:getStructure$3(ClientConsensusStates.fromPartial({})),ClientUpdateProposal:getStructure$3(ClientUpdateProposal.fromPartial({})),UpgradeProposal:getStructure$3(UpgradeProposal.fromPartial({})),Height:getStructure$3(Height.fromPartial({})),Params:getStructure$3(Params$3.fromPartial({})),GenesisMetadata:getStructure$3(GenesisMetadata.fromPartial({})),IdentifiedGenesisMetadata:getStructure$3(IdentifiedGenesisMetadata.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$3({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$3=e=>({module:{IbcCoreClientV1:new SDKModule$3(e)},registry:msgTypes$3}),msgTypes$2=[];let HttpClient$2=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$2=class extends HttpClient$2{constructor(){super(...arguments),this.queryClientConnections=(t,n={})=>this.request({path:`/ibc/core/connection/v1/client_connections/${t}`,method:"GET",format:"json",...n}),this.queryConnections=(t,n={})=>this.request({path:"/ibc/core/connection/v1/connections",method:"GET",query:t,format:"json",...n}),this.queryConnection=(t,n={})=>this.request({path:`/ibc/core/connection/v1/connections/${t}`,method:"GET",format:"json",...n}),this.queryConnectionClientState=(t,n={})=>this.request({path:`/ibc/core/connection/v1/connections/${t}/client_state`,method:"GET",format:"json",...n}),this.queryConnectionConsensusState=(t,n,p,u={})=>this.request({path:`/ibc/core/connection/v1/connections/${t}/consensus_state/revision/${n}/height/${p}`,method:"GET",format:"json",...u}),this.queryConnectionParams=(t={})=>this.request({path:"/ibc/core/connection/v1/params",method:"GET",format:"json",...t})}};var globalThis$c=(()=>{if(typeof globalThis$c<"u")return globalThis$c;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function createBaseMerklePrefix(){return{keyPrefix:new Uint8Array}}const MerklePrefix={encode(e,t=_m0.Writer.create()){return e.keyPrefix.length!==0&&t.uint32(10).bytes(e.keyPrefix),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMerklePrefix();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.keyPrefix=n.bytes();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{keyPrefix:isSet$a(e.keyPrefix)?bytesFromBase64$4(e.keyPrefix):new Uint8Array}},toJSON(e){const t={};return e.keyPrefix!==void 0&&(t.keyPrefix=base64FromBytes$4(e.keyPrefix!==void 0?e.keyPrefix:new Uint8Array)),t},fromPartial(e){const t=createBaseMerklePrefix();return t.keyPrefix=e.keyPrefix??new Uint8Array,t}};var globalThis$b=(()=>{if(typeof globalThis$b<"u")return globalThis$b;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$4(e){if(globalThis$b.Buffer)return Uint8Array.from(globalThis$b.Buffer.from(e,"base64"));{const t=globalThis$b.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$4(e){if(globalThis$b.Buffer)return globalThis$b.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$b.btoa(t.join(""))}}function isSet$a(e){return e!=null}function stateFromJSON(e){switch(e){case 0:case"STATE_UNINITIALIZED_UNSPECIFIED":return 0;case 1:case"STATE_INIT":return 1;case 2:case"STATE_TRYOPEN":return 2;case 3:case"STATE_OPEN":return 3;case-1:case"UNRECOGNIZED":default:return-1}}function stateToJSON(e){switch(e){case 0:return"STATE_UNINITIALIZED_UNSPECIFIED";case 1:return"STATE_INIT";case 2:return"STATE_TRYOPEN";case 3:return"STATE_OPEN";case-1:default:return"UNRECOGNIZED"}}function createBaseConnectionEnd(){return{clientId:"",versions:[],state:0,counterparty:void 0,delayPeriod:0}}const ConnectionEnd={encode(e,t=_m0.Writer.create()){e.clientId!==""&&t.uint32(10).string(e.clientId);for(const n of e.versions)Version.encode(n,t.uint32(18).fork()).ldelim();return e.state!==0&&t.uint32(24).int32(e.state),e.counterparty!==void 0&&Counterparty.encode(e.counterparty,t.uint32(34).fork()).ldelim(),e.delayPeriod!==0&&t.uint32(40).uint64(e.delayPeriod),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseConnectionEnd();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.clientId=n.string();break;case 2:u.versions.push(Version.decode(n,n.uint32()));break;case 3:u.state=n.int32();break;case 4:u.counterparty=Counterparty.decode(n,n.uint32());break;case 5:u.delayPeriod=longToNumber$6(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{clientId:isSet$9(e.clientId)?String(e.clientId):"",versions:Array.isArray(e==null?void 0:e.versions)?e.versions.map(t=>Version.fromJSON(t)):[],state:isSet$9(e.state)?stateFromJSON(e.state):0,counterparty:isSet$9(e.counterparty)?Counterparty.fromJSON(e.counterparty):void 0,delayPeriod:isSet$9(e.delayPeriod)?Number(e.delayPeriod):0}},toJSON(e){const t={};return e.clientId!==void 0&&(t.clientId=e.clientId),e.versions?t.versions=e.versions.map(n=>n?Version.toJSON(n):void 0):t.versions=[],e.state!==void 0&&(t.state=stateToJSON(e.state)),e.counterparty!==void 0&&(t.counterparty=e.counterparty?Counterparty.toJSON(e.counterparty):void 0),e.delayPeriod!==void 0&&(t.delayPeriod=Math.round(e.delayPeriod)),t},fromPartial(e){var n;const t=createBaseConnectionEnd();return t.clientId=e.clientId??"",t.versions=((n=e.versions)==null?void 0:n.map(p=>Version.fromPartial(p)))||[],t.state=e.state??0,t.counterparty=e.counterparty!==void 0&&e.counterparty!==null?Counterparty.fromPartial(e.counterparty):void 0,t.delayPeriod=e.delayPeriod??0,t}};function createBaseIdentifiedConnection(){return{id:"",clientId:"",versions:[],state:0,counterparty:void 0,delayPeriod:0}}const IdentifiedConnection={encode(e,t=_m0.Writer.create()){e.id!==""&&t.uint32(10).string(e.id),e.clientId!==""&&t.uint32(18).string(e.clientId);for(const n of e.versions)Version.encode(n,t.uint32(26).fork()).ldelim();return e.state!==0&&t.uint32(32).int32(e.state),e.counterparty!==void 0&&Counterparty.encode(e.counterparty,t.uint32(42).fork()).ldelim(),e.delayPeriod!==0&&t.uint32(48).uint64(e.delayPeriod),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseIdentifiedConnection();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.id=n.string();break;case 2:u.clientId=n.string();break;case 3:u.versions.push(Version.decode(n,n.uint32()));break;case 4:u.state=n.int32();break;case 5:u.counterparty=Counterparty.decode(n,n.uint32());break;case 6:u.delayPeriod=longToNumber$6(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{id:isSet$9(e.id)?String(e.id):"",clientId:isSet$9(e.clientId)?String(e.clientId):"",versions:Array.isArray(e==null?void 0:e.versions)?e.versions.map(t=>Version.fromJSON(t)):[],state:isSet$9(e.state)?stateFromJSON(e.state):0,counterparty:isSet$9(e.counterparty)?Counterparty.fromJSON(e.counterparty):void 0,delayPeriod:isSet$9(e.delayPeriod)?Number(e.delayPeriod):0}},toJSON(e){const t={};return e.id!==void 0&&(t.id=e.id),e.clientId!==void 0&&(t.clientId=e.clientId),e.versions?t.versions=e.versions.map(n=>n?Version.toJSON(n):void 0):t.versions=[],e.state!==void 0&&(t.state=stateToJSON(e.state)),e.counterparty!==void 0&&(t.counterparty=e.counterparty?Counterparty.toJSON(e.counterparty):void 0),e.delayPeriod!==void 0&&(t.delayPeriod=Math.round(e.delayPeriod)),t},fromPartial(e){var n;const t=createBaseIdentifiedConnection();return t.id=e.id??"",t.clientId=e.clientId??"",t.versions=((n=e.versions)==null?void 0:n.map(p=>Version.fromPartial(p)))||[],t.state=e.state??0,t.counterparty=e.counterparty!==void 0&&e.counterparty!==null?Counterparty.fromPartial(e.counterparty):void 0,t.delayPeriod=e.delayPeriod??0,t}};function createBaseCounterparty(){return{clientId:"",connectionId:"",prefix:void 0}}const Counterparty={encode(e,t=_m0.Writer.create()){return e.clientId!==""&&t.uint32(10).string(e.clientId),e.connectionId!==""&&t.uint32(18).string(e.connectionId),e.prefix!==void 0&&MerklePrefix.encode(e.prefix,t.uint32(26).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCounterparty();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.clientId=n.string();break;case 2:u.connectionId=n.string();break;case 3:u.prefix=MerklePrefix.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{clientId:isSet$9(e.clientId)?String(e.clientId):"",connectionId:isSet$9(e.connectionId)?String(e.connectionId):"",prefix:isSet$9(e.prefix)?MerklePrefix.fromJSON(e.prefix):void 0}},toJSON(e){const t={};return e.clientId!==void 0&&(t.clientId=e.clientId),e.connectionId!==void 0&&(t.connectionId=e.connectionId),e.prefix!==void 0&&(t.prefix=e.prefix?MerklePrefix.toJSON(e.prefix):void 0),t},fromPartial(e){const t=createBaseCounterparty();return t.clientId=e.clientId??"",t.connectionId=e.connectionId??"",t.prefix=e.prefix!==void 0&&e.prefix!==null?MerklePrefix.fromPartial(e.prefix):void 0,t}};function createBaseClientPaths(){return{paths:[]}}const ClientPaths={encode(e,t=_m0.Writer.create()){for(const n of e.paths)t.uint32(10).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseClientPaths();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.paths.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{paths:Array.isArray(e==null?void 0:e.paths)?e.paths.map(t=>String(t)):[]}},toJSON(e){const t={};return e.paths?t.paths=e.paths.map(n=>n):t.paths=[],t},fromPartial(e){var n;const t=createBaseClientPaths();return t.paths=((n=e.paths)==null?void 0:n.map(p=>p))||[],t}};function createBaseConnectionPaths(){return{clientId:"",paths:[]}}const ConnectionPaths={encode(e,t=_m0.Writer.create()){e.clientId!==""&&t.uint32(10).string(e.clientId);for(const n of e.paths)t.uint32(18).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseConnectionPaths();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.clientId=n.string();break;case 2:u.paths.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{clientId:isSet$9(e.clientId)?String(e.clientId):"",paths:Array.isArray(e==null?void 0:e.paths)?e.paths.map(t=>String(t)):[]}},toJSON(e){const t={};return e.clientId!==void 0&&(t.clientId=e.clientId),e.paths?t.paths=e.paths.map(n=>n):t.paths=[],t},fromPartial(e){var n;const t=createBaseConnectionPaths();return t.clientId=e.clientId??"",t.paths=((n=e.paths)==null?void 0:n.map(p=>p))||[],t}};function createBaseVersion(){return{identifier:"",features:[]}}const Version={encode(e,t=_m0.Writer.create()){e.identifier!==""&&t.uint32(10).string(e.identifier);for(const n of e.features)t.uint32(18).string(n);return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseVersion();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.identifier=n.string();break;case 2:u.features.push(n.string());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{identifier:isSet$9(e.identifier)?String(e.identifier):"",features:Array.isArray(e==null?void 0:e.features)?e.features.map(t=>String(t)):[]}},toJSON(e){const t={};return e.identifier!==void 0&&(t.identifier=e.identifier),e.features?t.features=e.features.map(n=>n):t.features=[],t},fromPartial(e){var n;const t=createBaseVersion();return t.identifier=e.identifier??"",t.features=((n=e.features)==null?void 0:n.map(p=>p))||[],t}};function createBaseParams$2(){return{maxExpectedTimePerBlock:0}}const Params$2={encode(e,t=_m0.Writer.create()){return e.maxExpectedTimePerBlock!==0&&t.uint32(8).uint64(e.maxExpectedTimePerBlock),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$2();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.maxExpectedTimePerBlock=longToNumber$6(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{maxExpectedTimePerBlock:isSet$9(e.maxExpectedTimePerBlock)?Number(e.maxExpectedTimePerBlock):0}},toJSON(e){const t={};return e.maxExpectedTimePerBlock!==void 0&&(t.maxExpectedTimePerBlock=Math.round(e.maxExpectedTimePerBlock)),t},fromPartial(e){const t=createBaseParams$2();return t.maxExpectedTimePerBlock=e.maxExpectedTimePerBlock??0,t}};var globalThis$a=(()=>{if(typeof globalThis$a<"u")return globalThis$a;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$6(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$a.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$9(e){return e!=null}new build$b.Registry(msgTypes$2);function getStructure$2(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const txClient$2=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({}),queryClient$2=({addr:e}={addr:"http://localhost:1317"})=>new Api$2({baseURL:e});let SDKModule$2=class{constructor(t){this.registry=[],this.query=queryClient$2({addr:t.env.apiURL}),this.updateTX(t),this.structure={ConnectionEnd:getStructure$2(ConnectionEnd.fromPartial({})),IdentifiedConnection:getStructure$2(IdentifiedConnection.fromPartial({})),Counterparty:getStructure$2(Counterparty.fromPartial({})),ClientPaths:getStructure$2(ClientPaths.fromPartial({})),ConnectionPaths:getStructure$2(ConnectionPaths.fromPartial({})),Version:getStructure$2(Version.fromPartial({})),Params:getStructure$2(Params$2.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$2({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$2=e=>({module:{IbcCoreConnectionV1:new SDKModule$2(e)},registry:msgTypes$2});function createBaseCoin(){return{denom:"",amount:""}}const Coin={encode(e,t=_m0.Writer.create()){return e.denom!==""&&t.uint32(10).string(e.denom),e.amount!==""&&t.uint32(18).string(e.amount),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseCoin();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.denom=n.string();break;case 2:u.amount=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{denom:isSet$8(e.denom)?String(e.denom):"",amount:isSet$8(e.amount)?String(e.amount):""}},toJSON(e){const t={};return e.denom!==void 0&&(t.denom=e.denom),e.amount!==void 0&&(t.amount=e.amount),t},fromPartial(e){const t=createBaseCoin();return t.denom=e.denom??"",t.amount=e.amount??"",t}};function isSet$8(e){return e!=null}function createBaseMsgMint$1(){return{creator:"",amount:void 0}}const MsgMint$1={encode(e,t=_m0.Writer.create()){return e.creator!==""&&t.uint32(10).string(e.creator),e.amount!==void 0&&Coin.encode(e.amount,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgMint$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.creator=n.string();break;case 2:u.amount=Coin.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{creator:isSet$7(e.creator)?String(e.creator):"",amount:isSet$7(e.amount)?Coin.fromJSON(e.amount):void 0}},toJSON(e){const t={};return e.creator!==void 0&&(t.creator=e.creator),e.amount!==void 0&&(t.amount=e.amount?Coin.toJSON(e.amount):void 0),t},fromPartial(e){const t=createBaseMsgMint$1();return t.creator=e.creator??"",t.amount=e.amount!==void 0&&e.amount!==null?Coin.fromPartial(e.amount):void 0,t}};function createBaseMsgInit(){return{creator:"",address:""}}const MsgInit={encode(e,t=_m0.Writer.create()){return e.creator!==""&&t.uint32(10).string(e.creator),e.address!==""&&t.uint32(18).string(e.address),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgInit();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.creator=n.string();break;case 2:u.address=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{creator:isSet$7(e.creator)?String(e.creator):"",address:isSet$7(e.address)?String(e.address):""}},toJSON(e){const t={};return e.creator!==void 0&&(t.creator=e.creator),e.address!==void 0&&(t.address=e.address),t},fromPartial(e){const t=createBaseMsgInit();return t.creator=e.creator??"",t.address=e.address??"",t}};var globalThis$9=(()=>{if(typeof globalThis$9<"u")return globalThis$9;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$7(e){return e!=null}const msgTypes$1=[["/iconlake.drop.MsgInit",MsgInit],["/iconlake.drop.MsgMint",MsgMint$1]];let HttpClient$1=class{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}},Api$1=class extends HttpClient$1{constructor(){super(...arguments),this.queryInfoAll=(t,n={})=>this.request({path:"/iconlake/drop/info",method:"GET",query:t,format:"json",...n}),this.queryInfo=(t,n={})=>this.request({path:`/iconlake/drop/info/${t}`,method:"GET",format:"json",...n}),this.queryParams=(t={})=>this.request({path:"/iconlake/drop/params",method:"GET",format:"json",...t})}};function createBaseInfo(){return{address:"",lastMintTime:0}}const Info={encode(e,t=_m0.Writer.create()){return e.address!==""&&t.uint32(10).string(e.address),e.lastMintTime!==0&&t.uint32(16).int64(e.lastMintTime),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseInfo();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.string();break;case 2:u.lastMintTime=longToNumber$5(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$6(e.address)?String(e.address):"",lastMintTime:isSet$6(e.lastMintTime)?Number(e.lastMintTime):0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=e.address),e.lastMintTime!==void 0&&(t.lastMintTime=Math.round(e.lastMintTime)),t},fromPartial(e){const t=createBaseInfo();return t.address=e.address??"",t.lastMintTime=e.lastMintTime??0,t}};function createBaseInfoRaw(){return{address:new Uint8Array,lastMintTime:0}}const InfoRaw={encode(e,t=_m0.Writer.create()){return e.address.length!==0&&t.uint32(10).bytes(e.address),e.lastMintTime!==0&&t.uint32(16).int64(e.lastMintTime),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseInfoRaw();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.address=n.bytes();break;case 2:u.lastMintTime=longToNumber$5(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{address:isSet$6(e.address)?bytesFromBase64$3(e.address):new Uint8Array,lastMintTime:isSet$6(e.lastMintTime)?Number(e.lastMintTime):0}},toJSON(e){const t={};return e.address!==void 0&&(t.address=base64FromBytes$3(e.address!==void 0?e.address:new Uint8Array)),e.lastMintTime!==void 0&&(t.lastMintTime=Math.round(e.lastMintTime)),t},fromPartial(e){const t=createBaseInfoRaw();return t.address=e.address??new Uint8Array,t.lastMintTime=e.lastMintTime??0,t}};var globalThis$8=(()=>{if(typeof globalThis$8<"u")return globalThis$8;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$3(e){if(globalThis$8.Buffer)return Uint8Array.from(globalThis$8.Buffer.from(e,"base64"));{const t=globalThis$8.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$3(e){if(globalThis$8.Buffer)return globalThis$8.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$8.btoa(t.join(""))}}function longToNumber$5(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$8.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$6(e){return e!=null}function createBaseParams$1(){return{initAmount:0,minAmountPerMint:0,maxAmountPerMint:0}}const Params$1={encode(e,t=_m0.Writer.create()){return e.initAmount!==0&&t.uint32(8).int64(e.initAmount),e.minAmountPerMint!==0&&t.uint32(16).int64(e.minAmountPerMint),e.maxAmountPerMint!==0&&t.uint32(24).int64(e.maxAmountPerMint),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams$1();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.initAmount=longToNumber$4(n.int64());break;case 2:u.minAmountPerMint=longToNumber$4(n.int64());break;case 3:u.maxAmountPerMint=longToNumber$4(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{initAmount:isSet$5(e.initAmount)?Number(e.initAmount):0,minAmountPerMint:isSet$5(e.minAmountPerMint)?Number(e.minAmountPerMint):0,maxAmountPerMint:isSet$5(e.maxAmountPerMint)?Number(e.maxAmountPerMint):0}},toJSON(e){const t={};return e.initAmount!==void 0&&(t.initAmount=Math.round(e.initAmount)),e.minAmountPerMint!==void 0&&(t.minAmountPerMint=Math.round(e.minAmountPerMint)),e.maxAmountPerMint!==void 0&&(t.maxAmountPerMint=Math.round(e.maxAmountPerMint)),t},fromPartial(e){const t=createBaseParams$1();return t.initAmount=e.initAmount??0,t.minAmountPerMint=e.minAmountPerMint??0,t.maxAmountPerMint=e.maxAmountPerMint??0,t}};var globalThis$7=(()=>{if(typeof globalThis$7<"u")return globalThis$7;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$4(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$7.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$5(e){return e!=null}const registry$2=new build$b.Registry(msgTypes$1);function getStructure$1(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee$1={amount:[],gas:"200000"},txClient$1=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgInit({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgInit: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$2,prefix:t});let N=this.msgInit({value:MsgInit.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$1,g)}catch(y){throw new Error("TxClient:sendMsgInit: Could not broadcast Tx: "+y.message)}},async sendMsgMint({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgMint: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$2,prefix:t});let N=this.msgMint({value:MsgMint$1.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee$1,g)}catch(y){throw new Error("TxClient:sendMsgMint: Could not broadcast Tx: "+y.message)}},msgInit({value:p}){try{return{typeUrl:"/iconlake.drop.MsgInit",value:MsgInit.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgInit: Could not create message: "+u.message)}},msgMint({value:p}){try{return{typeUrl:"/iconlake.drop.MsgMint",value:MsgMint$1.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgMint: Could not create message: "+u.message)}}}),queryClient$1=({addr:e}={addr:"http://localhost:1317"})=>new Api$1({baseURL:e});let SDKModule$1=class{constructor(t){this.registry=[],this.query=queryClient$1({addr:t.env.apiURL}),this.updateTX(t),this.structure={Info:getStructure$1(Info.fromPartial({})),InfoRaw:getStructure$1(InfoRaw.fromPartial({})),Params:getStructure$1(Params$1.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient$1({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}};const Module$1=e=>({module:{IconlakeDrop:new SDKModule$1(e)},registry:msgTypes$1});function createBaseMsgMint(){return{creator:"",classId:"",id:"",name:"",description:"",uri:"",uriHash:"",supply:0}}const MsgMint={encode(e,t=_m0.Writer.create()){return e.creator!==""&&t.uint32(10).string(e.creator),e.classId!==""&&t.uint32(18).string(e.classId),e.id!==""&&t.uint32(26).string(e.id),e.name!==""&&t.uint32(34).string(e.name),e.description!==""&&t.uint32(42).string(e.description),e.uri!==""&&t.uint32(50).string(e.uri),e.uriHash!==""&&t.uint32(58).string(e.uriHash),e.supply!==0&&t.uint32(64).uint64(e.supply),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgMint();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.creator=n.string();break;case 2:u.classId=n.string();break;case 3:u.id=n.string();break;case 4:u.name=n.string();break;case 5:u.description=n.string();break;case 6:u.uri=n.string();break;case 7:u.uriHash=n.string();break;case 8:u.supply=longToNumber$3(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{creator:isSet$4(e.creator)?String(e.creator):"",classId:isSet$4(e.classId)?String(e.classId):"",id:isSet$4(e.id)?String(e.id):"",name:isSet$4(e.name)?String(e.name):"",description:isSet$4(e.description)?String(e.description):"",uri:isSet$4(e.uri)?String(e.uri):"",uriHash:isSet$4(e.uriHash)?String(e.uriHash):"",supply:isSet$4(e.supply)?Number(e.supply):0}},toJSON(e){const t={};return e.creator!==void 0&&(t.creator=e.creator),e.classId!==void 0&&(t.classId=e.classId),e.id!==void 0&&(t.id=e.id),e.name!==void 0&&(t.name=e.name),e.description!==void 0&&(t.description=e.description),e.uri!==void 0&&(t.uri=e.uri),e.uriHash!==void 0&&(t.uriHash=e.uriHash),e.supply!==void 0&&(t.supply=Math.round(e.supply)),t},fromPartial(e){const t=createBaseMsgMint();return t.creator=e.creator??"",t.classId=e.classId??"",t.id=e.id??"",t.name=e.name??"",t.description=e.description??"",t.uri=e.uri??"",t.uriHash=e.uriHash??"",t.supply=e.supply??0,t}};function createBaseMsgUpdateClass(){return{creator:"",id:"",name:"",symbol:"",description:"",uri:"",uriHash:""}}const MsgUpdateClass={encode(e,t=_m0.Writer.create()){return e.creator!==""&&t.uint32(10).string(e.creator),e.id!==""&&t.uint32(18).string(e.id),e.name!==""&&t.uint32(26).string(e.name),e.symbol!==""&&t.uint32(34).string(e.symbol),e.description!==""&&t.uint32(42).string(e.description),e.uri!==""&&t.uint32(50).string(e.uri),e.uriHash!==""&&t.uint32(58).string(e.uriHash),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgUpdateClass();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.creator=n.string();break;case 2:u.id=n.string();break;case 3:u.name=n.string();break;case 4:u.symbol=n.string();break;case 5:u.description=n.string();break;case 6:u.uri=n.string();break;case 7:u.uriHash=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{creator:isSet$4(e.creator)?String(e.creator):"",id:isSet$4(e.id)?String(e.id):"",name:isSet$4(e.name)?String(e.name):"",symbol:isSet$4(e.symbol)?String(e.symbol):"",description:isSet$4(e.description)?String(e.description):"",uri:isSet$4(e.uri)?String(e.uri):"",uriHash:isSet$4(e.uriHash)?String(e.uriHash):""}},toJSON(e){const t={};return e.creator!==void 0&&(t.creator=e.creator),e.id!==void 0&&(t.id=e.id),e.name!==void 0&&(t.name=e.name),e.symbol!==void 0&&(t.symbol=e.symbol),e.description!==void 0&&(t.description=e.description),e.uri!==void 0&&(t.uri=e.uri),e.uriHash!==void 0&&(t.uriHash=e.uriHash),t},fromPartial(e){const t=createBaseMsgUpdateClass();return t.creator=e.creator??"",t.id=e.id??"",t.name=e.name??"",t.symbol=e.symbol??"",t.description=e.description??"",t.uri=e.uri??"",t.uriHash=e.uriHash??"",t}};function createBaseMsgBurn(){return{creator:"",classId:"",id:""}}const MsgBurn={encode(e,t=_m0.Writer.create()){return e.creator!==""&&t.uint32(10).string(e.creator),e.classId!==""&&t.uint32(18).string(e.classId),e.id!==""&&t.uint32(26).string(e.id),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseMsgBurn();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.creator=n.string();break;case 2:u.classId=n.string();break;case 3:u.id=n.string();break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{creator:isSet$4(e.creator)?String(e.creator):"",classId:isSet$4(e.classId)?String(e.classId):"",id:isSet$4(e.id)?String(e.id):""}},toJSON(e){const t={};return e.creator!==void 0&&(t.creator=e.creator),e.classId!==void 0&&(t.classId=e.classId),e.id!==void 0&&(t.id=e.id),t},fromPartial(e){const t=createBaseMsgBurn();return t.creator=e.creator??"",t.classId=e.classId??"",t.id=e.id??"",t}};var globalThis$6=(()=>{if(typeof globalThis$6<"u")return globalThis$6;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function longToNumber$3(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$6.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$4(e){return e!=null}const msgTypes=[["/iconlake.icon.MsgMint",MsgMint],["/iconlake.icon.MsgUpdateClass",MsgUpdateClass],["/iconlake.icon.MsgBurn",MsgBurn]];class HttpClient{constructor({securityWorker:t,secure:n,format:p,...u}={}){this.securityData=null,this.setSecurityData=g=>{this.securityData=g},this.request=async({secure:g,path:y,type:P,query:N,format:X,body:se,...Ae})=>{const fe=(typeof g=="boolean"?g:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},C=this.mergeRequestParams(Ae,fe),re=X&&this.format||void 0;return P==="multipart/form-data"&&se&&se!==null&&typeof se=="object"&&(C.headers.common={Accept:"*/*"},C.headers.post={},C.headers.put={},se=this.createFormData(se)),this.instance.request({...C,headers:{...P&&P!=="multipart/form-data"?{"Content-Type":P}:{},...C.headers||{}},params:N,responseType:re,data:se,url:y})},this.instance=axios$1.create({...u,baseURL:u.baseURL||""}),this.secure=n,this.format=p,this.securityWorker=t}mergeRequestParams(t,n){return{...this.instance.defaults,...t,...n||{},headers:{...this.instance.defaults.headers||{},...t.headers||{},...n&&n.headers||{}}}}createFormData(t){return Object.keys(t||{}).reduce((n,p)=>{const u=t[p];return n.append(p,u instanceof Blob?u:typeof u=="object"&&u!==null?JSON.stringify(u):`${u}`),n},new FormData)}}class Api extends HttpClient{constructor(){super(...arguments),this.queryClass=(t,n={})=>this.request({path:"/iconlake/icon/class",method:"GET",query:t,format:"json",...n}),this.queryClasses=(t,n={})=>this.request({path:"/iconlake/icon/classes",method:"GET",query:t,format:"json",...n}),this.queryHash=(t,n={})=>this.request({path:"/iconlake/icon/hash",method:"POST",body:t,type:"application/json",format:"json",...n}),this.queryNFT=(t,n={})=>this.request({path:"/iconlake/icon/nft",method:"GET",query:t,format:"json",...n}),this.queryNFTs=(t,n={})=>this.request({path:"/iconlake/icon/nfts",method:"GET",query:t,format:"json",...n}),this.queryParams=(t={})=>this.request({path:"/iconlake/icon/params",method:"GET",format:"json",...t})}}function createBaseClassData(){return{author:"",createTime:0}}const ClassData={encode(e,t=_m0.Writer.create()){return e.author!==""&&t.uint32(10).string(e.author),e.createTime!==0&&t.uint32(16).int64(e.createTime),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseClassData();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.author=n.string();break;case 2:u.createTime=longToNumber$2(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{author:isSet$3(e.author)?String(e.author):"",createTime:isSet$3(e.createTime)?Number(e.createTime):0}},toJSON(e){const t={};return e.author!==void 0&&(t.author=e.author),e.createTime!==void 0&&(t.createTime=Math.round(e.createTime)),t},fromPartial(e){const t=createBaseClassData();return t.author=e.author??"",t.createTime=e.createTime??0,t}};function createBaseClassDataRaw(){return{author:new Uint8Array,createTime:0}}const ClassDataRaw={encode(e,t=_m0.Writer.create()){return e.author.length!==0&&t.uint32(10).bytes(e.author),e.createTime!==0&&t.uint32(16).int64(e.createTime),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseClassDataRaw();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.author=n.bytes();break;case 2:u.createTime=longToNumber$2(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{author:isSet$3(e.author)?bytesFromBase64$2(e.author):new Uint8Array,createTime:isSet$3(e.createTime)?Number(e.createTime):0}},toJSON(e){const t={};return e.author!==void 0&&(t.author=base64FromBytes$2(e.author!==void 0?e.author:new Uint8Array)),e.createTime!==void 0&&(t.createTime=Math.round(e.createTime)),t},fromPartial(e){const t=createBaseClassDataRaw();return t.author=e.author??new Uint8Array,t.createTime=e.createTime??0,t}};var globalThis$5=(()=>{if(typeof globalThis$5<"u")return globalThis$5;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$2(e){if(globalThis$5.Buffer)return Uint8Array.from(globalThis$5.Buffer.from(e,"base64"));{const t=globalThis$5.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$2(e){if(globalThis$5.Buffer)return globalThis$5.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$5.btoa(t.join(""))}}function longToNumber$2(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$5.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$3(e){return e!=null}function createBaseIconData(){return{author:"",name:"",description:"",createTime:0}}const IconData={encode(e,t=_m0.Writer.create()){return e.author!==""&&t.uint32(10).string(e.author),e.name!==""&&t.uint32(18).string(e.name),e.description!==""&&t.uint32(26).string(e.description),e.createTime!==0&&t.uint32(32).int64(e.createTime),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseIconData();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.author=n.string();break;case 2:u.name=n.string();break;case 3:u.description=n.string();break;case 4:u.createTime=longToNumber$1(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{author:isSet$2(e.author)?String(e.author):"",name:isSet$2(e.name)?String(e.name):"",description:isSet$2(e.description)?String(e.description):"",createTime:isSet$2(e.createTime)?Number(e.createTime):0}},toJSON(e){const t={};return e.author!==void 0&&(t.author=e.author),e.name!==void 0&&(t.name=e.name),e.description!==void 0&&(t.description=e.description),e.createTime!==void 0&&(t.createTime=Math.round(e.createTime)),t},fromPartial(e){const t=createBaseIconData();return t.author=e.author??"",t.name=e.name??"",t.description=e.description??"",t.createTime=e.createTime??0,t}};function createBaseIconDataRaw(){return{author:new Uint8Array,name:"",description:"",createTime:0}}const IconDataRaw={encode(e,t=_m0.Writer.create()){return e.author.length!==0&&t.uint32(10).bytes(e.author),e.name!==""&&t.uint32(18).string(e.name),e.description!==""&&t.uint32(26).string(e.description),e.createTime!==0&&t.uint32(32).int64(e.createTime),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseIconDataRaw();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.author=n.bytes();break;case 2:u.name=n.string();break;case 3:u.description=n.string();break;case 4:u.createTime=longToNumber$1(n.int64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{author:isSet$2(e.author)?bytesFromBase64$1(e.author):new Uint8Array,name:isSet$2(e.name)?String(e.name):"",description:isSet$2(e.description)?String(e.description):"",createTime:isSet$2(e.createTime)?Number(e.createTime):0}},toJSON(e){const t={};return e.author!==void 0&&(t.author=base64FromBytes$1(e.author!==void 0?e.author:new Uint8Array)),e.name!==void 0&&(t.name=e.name),e.description!==void 0&&(t.description=e.description),e.createTime!==void 0&&(t.createTime=Math.round(e.createTime)),t},fromPartial(e){const t=createBaseIconDataRaw();return t.author=e.author??new Uint8Array,t.name=e.name??"",t.description=e.description??"",t.createTime=e.createTime??0,t}};var globalThis$4=(()=>{if(typeof globalThis$4<"u")return globalThis$4;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64$1(e){if(globalThis$4.Buffer)return Uint8Array.from(globalThis$4.Buffer.from(e,"base64"));{const t=globalThis$4.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes$1(e){if(globalThis$4.Buffer)return globalThis$4.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$4.btoa(t.join(""))}}function longToNumber$1(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$4.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$2(e){return e!=null}function createBaseParams(){return{}}const Params={encode(e,t=_m0.Writer.create()){return t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseParams();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){default:n.skipType(g&7);break}}return u},fromJSON(e){return{}},toJSON(e){return{}},fromPartial(e){return createBaseParams()}};function createBasePageResponse(){return{nextKey:new Uint8Array,total:0}}const PageResponse={encode(e,t=_m0.Writer.create()){return e.nextKey.length!==0&&t.uint32(10).bytes(e.nextKey),e.total!==0&&t.uint32(16).uint64(e.total),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBasePageResponse();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.nextKey=n.bytes();break;case 2:u.total=longToNumber(n.uint64());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{nextKey:isSet$1(e.nextKey)?bytesFromBase64(e.nextKey):new Uint8Array,total:isSet$1(e.total)?Number(e.total):0}},toJSON(e){const t={};return e.nextKey!==void 0&&(t.nextKey=base64FromBytes(e.nextKey!==void 0?e.nextKey:new Uint8Array)),e.total!==void 0&&(t.total=Math.round(e.total)),t},fromPartial(e){const t=createBasePageResponse();return t.nextKey=e.nextKey??new Uint8Array,t.total=e.total??0,t}};var globalThis$3=(()=>{if(typeof globalThis$3<"u")return globalThis$3;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();function bytesFromBase64(e){if(globalThis$3.Buffer)return Uint8Array.from(globalThis$3.Buffer.from(e,"base64"));{const t=globalThis$3.atob(e),n=new Uint8Array(t.length);for(let p=0;p<t.length;++p)n[p]=t.charCodeAt(p);return n}}function base64FromBytes(e){if(globalThis$3.Buffer)return globalThis$3.Buffer.from(e).toString("base64");{const t=[];return e.forEach(n=>{t.push(String.fromCharCode(n))}),globalThis$3.btoa(t.join(""))}}function longToNumber(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$3.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function isSet$1(e){return e!=null}var globalThis$2=(()=>{if(typeof globalThis$2<"u")return globalThis$2;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})(),globalThis$1=(()=>{if(typeof globalThis$1<"u")return globalThis$1;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function createBaseNFT(){return{classId:"",id:"",uri:"",uriHash:"",data:void 0}}const NFT={encode(e,t=_m0.Writer.create()){return e.classId!==""&&t.uint32(10).string(e.classId),e.id!==""&&t.uint32(18).string(e.id),e.uri!==""&&t.uint32(26).string(e.uri),e.uriHash!==""&&t.uint32(34).string(e.uriHash),e.data!==void 0&&IconData.encode(e.data,t.uint32(42).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseNFT();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.classId=n.string();break;case 2:u.id=n.string();break;case 3:u.uri=n.string();break;case 4:u.uriHash=n.string();break;case 5:u.data=IconData.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{classId:isSet(e.classId)?String(e.classId):"",id:isSet(e.id)?String(e.id):"",uri:isSet(e.uri)?String(e.uri):"",uriHash:isSet(e.uriHash)?String(e.uriHash):"",data:isSet(e.data)?IconData.fromJSON(e.data):void 0}},toJSON(e){const t={};return e.classId!==void 0&&(t.classId=e.classId),e.id!==void 0&&(t.id=e.id),e.uri!==void 0&&(t.uri=e.uri),e.uriHash!==void 0&&(t.uriHash=e.uriHash),e.data!==void 0&&(t.data=e.data?IconData.toJSON(e.data):void 0),t},fromPartial(e){const t=createBaseNFT();return t.classId=e.classId??"",t.id=e.id??"",t.uri=e.uri??"",t.uriHash=e.uriHash??"",t.data=e.data!==void 0&&e.data!==null?IconData.fromPartial(e.data):void 0,t}};function createBaseQueryNFTsResponse(){return{nfts:[],pagination:void 0}}const QueryNFTsResponse={encode(e,t=_m0.Writer.create()){for(const n of e.nfts)NFT.encode(n,t.uint32(10).fork()).ldelim();return e.pagination!==void 0&&PageResponse.encode(e.pagination,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseQueryNFTsResponse();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.nfts.push(NFT.decode(n,n.uint32()));break;case 2:u.pagination=PageResponse.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{nfts:Array.isArray(e==null?void 0:e.nfts)?e.nfts.map(t=>NFT.fromJSON(t)):[],pagination:isSet(e.pagination)?PageResponse.fromJSON(e.pagination):void 0}},toJSON(e){const t={};return e.nfts?t.nfts=e.nfts.map(n=>n?NFT.toJSON(n):void 0):t.nfts=[],e.pagination!==void 0&&(t.pagination=e.pagination?PageResponse.toJSON(e.pagination):void 0),t},fromPartial(e){var n;const t=createBaseQueryNFTsResponse();return t.nfts=((n=e.nfts)==null?void 0:n.map(p=>NFT.fromPartial(p)))||[],t.pagination=e.pagination!==void 0&&e.pagination!==null?PageResponse.fromPartial(e.pagination):void 0,t}};function createBaseClass(){return{id:"",name:"",symbol:"",description:"",uri:"",uriHash:"",data:void 0}}const Class={encode(e,t=_m0.Writer.create()){return e.id!==""&&t.uint32(10).string(e.id),e.name!==""&&t.uint32(18).string(e.name),e.symbol!==""&&t.uint32(26).string(e.symbol),e.description!==""&&t.uint32(34).string(e.description),e.uri!==""&&t.uint32(42).string(e.uri),e.uriHash!==""&&t.uint32(50).string(e.uriHash),e.data!==void 0&&ClassData.encode(e.data,t.uint32(58).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseClass();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.id=n.string();break;case 2:u.name=n.string();break;case 3:u.symbol=n.string();break;case 4:u.description=n.string();break;case 5:u.uri=n.string();break;case 6:u.uriHash=n.string();break;case 7:u.data=ClassData.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{id:isSet(e.id)?String(e.id):"",name:isSet(e.name)?String(e.name):"",symbol:isSet(e.symbol)?String(e.symbol):"",description:isSet(e.description)?String(e.description):"",uri:isSet(e.uri)?String(e.uri):"",uriHash:isSet(e.uriHash)?String(e.uriHash):"",data:isSet(e.data)?ClassData.fromJSON(e.data):void 0}},toJSON(e){const t={};return e.id!==void 0&&(t.id=e.id),e.name!==void 0&&(t.name=e.name),e.symbol!==void 0&&(t.symbol=e.symbol),e.description!==void 0&&(t.description=e.description),e.uri!==void 0&&(t.uri=e.uri),e.uriHash!==void 0&&(t.uriHash=e.uriHash),e.data!==void 0&&(t.data=e.data?ClassData.toJSON(e.data):void 0),t},fromPartial(e){const t=createBaseClass();return t.id=e.id??"",t.name=e.name??"",t.symbol=e.symbol??"",t.description=e.description??"",t.uri=e.uri??"",t.uriHash=e.uriHash??"",t.data=e.data!==void 0&&e.data!==null?ClassData.fromPartial(e.data):void 0,t}};function createBaseQueryClassesResponse(){return{classes:[],pagination:void 0}}const QueryClassesResponse={encode(e,t=_m0.Writer.create()){for(const n of e.classes)Class.encode(n,t.uint32(10).fork()).ldelim();return e.pagination!==void 0&&PageResponse.encode(e.pagination,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof _m0.Reader?e:new _m0.Reader(e);let p=t===void 0?n.len:n.pos+t;const u=createBaseQueryClassesResponse();for(;n.pos<p;){const g=n.uint32();switch(g>>>3){case 1:u.classes.push(Class.decode(n,n.uint32()));break;case 2:u.pagination=PageResponse.decode(n,n.uint32());break;default:n.skipType(g&7);break}}return u},fromJSON(e){return{classes:Array.isArray(e==null?void 0:e.classes)?e.classes.map(t=>Class.fromJSON(t)):[],pagination:isSet(e.pagination)?PageResponse.fromJSON(e.pagination):void 0}},toJSON(e){const t={};return e.classes?t.classes=e.classes.map(n=>n?Class.toJSON(n):void 0):t.classes=[],e.pagination!==void 0&&(t.pagination=e.pagination?PageResponse.toJSON(e.pagination):void 0),t},fromPartial(e){var n;const t=createBaseQueryClassesResponse();return t.classes=((n=e.classes)==null?void 0:n.map(p=>Class.fromPartial(p)))||[],t.pagination=e.pagination!==void 0&&e.pagination!==null?PageResponse.fromPartial(e.pagination):void 0,t}};function isSet(e){return e!=null}const registry$1=new build$b.Registry(msgTypes);function getStructure(e){const t={fields:[]};for(let[n,p]of Object.entries(e)){let u={name:n,type:typeof p};t.fields.push(u)}return t}const defaultFee={amount:[],gas:"200000"},txClient=({signer:e,prefix:t,addr:n}={addr:"http://localhost:26657",prefix:"cosmos"})=>({async sendMsgMint({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgMint: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$1,prefix:t});let N=this.msgMint({value:MsgMint.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee,g)}catch(y){throw new Error("TxClient:sendMsgMint: Could not broadcast Tx: "+y.message)}},async sendMsgUpdateClass({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgUpdateClass: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$1,prefix:t});let N=this.msgUpdateClass({value:MsgUpdateClass.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee,g)}catch(y){throw new Error("TxClient:sendMsgUpdateClass: Could not broadcast Tx: "+y.message)}},async sendMsgBurn({value:p,fee:u,memo:g}){if(!e)throw new Error("TxClient:sendMsgBurn: Unable to sign Tx. Signer is not present.");try{const{address:y}=(await e.getAccounts())[0],P=await build$5.SigningStargateClient.connectWithSigner(n,e,{registry:registry$1,prefix:t});let N=this.msgBurn({value:MsgBurn.fromPartial(p)});return await P.signAndBroadcast(y,[N],u||defaultFee,g)}catch(y){throw new Error("TxClient:sendMsgBurn: Could not broadcast Tx: "+y.message)}},msgMint({value:p}){try{return{typeUrl:"/iconlake.icon.MsgMint",value:MsgMint.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgMint: Could not create message: "+u.message)}},msgUpdateClass({value:p}){try{return{typeUrl:"/iconlake.icon.MsgUpdateClass",value:MsgUpdateClass.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgUpdateClass: Could not create message: "+u.message)}},msgBurn({value:p}){try{return{typeUrl:"/iconlake.icon.MsgBurn",value:MsgBurn.fromPartial(p)}}catch(u){throw new Error("TxClient:MsgBurn: Could not create message: "+u.message)}}}),queryClient=({addr:e}={addr:"http://localhost:1317"})=>new Api({baseURL:e});class SDKModule{constructor(t){this.registry=[],this.query=queryClient({addr:t.env.apiURL}),this.updateTX(t),this.structure={ClassData:getStructure(ClassData.fromPartial({})),ClassDataRaw:getStructure(ClassDataRaw.fromPartial({})),IconData:getStructure(IconData.fromPartial({})),IconDataRaw:getStructure(IconDataRaw.fromPartial({})),Params:getStructure(Params.fromPartial({})),NFT:getStructure(NFT.fromPartial({})),QueryNFTsResponse:getStructure(QueryNFTsResponse.fromPartial({})),Class:getStructure(Class.fromPartial({})),QueryClassesResponse:getStructure(QueryClassesResponse.fromPartial({}))},t.on("signer-changed",n=>{this.updateTX(t)})}updateTX(t){const n=txClient({signer:t.signer,addr:t.env.rpcURL,prefix:t.env.prefix??"cosmos"});this.tx=n;for(let p in n)this.tx[p]=n[p].bind(this.tx)}}const Module=e=>({module:{IconlakeIcon:new SDKModule(e)},registry:msgTypes}),Client=IgniteClient.plugin([Module$t,Module$s,Module$r,Module$q,Module$o,Module$n,Module$m,Module$l,Module$k,Module$j,Module$i,Module$h,Module$g,Module$f,Module$e,Module$d,Module$c,Module$b,Module$a,Module$9,Module$8,Module$7,Module$6,Module$5,Module$4,Module$3,Module$2,Module$1,Module]),registry=new build$b.Registry([...msgTypes$s,...msgTypes$r,...msgTypes$q,...msgTypes$p,...msgTypes$o,...msgTypes$n,...msgTypes$m,...msgTypes$l,...msgTypes$k,...msgTypes$j,...msgTypes$i,...msgTypes$h,...msgTypes$g,...msgTypes$f,...msgTypes$e,...msgTypes$d,...msgTypes$c,...msgTypes$b,...msgTypes$a,...msgTypes$9,...msgTypes$8,...msgTypes$7,...msgTypes$6,...msgTypes$5,...msgTypes$4,...msgTypes$3,...msgTypes$2,...msgTypes$1,...msgTypes]);return exports.Client=Client,exports.MissingWalletError=MissingWalletError,exports.registry=registry,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),exports}({});