@sentio/runtime 2.59.2-rc.1 → 2.59.2

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.
@@ -0,0 +1,26 @@
1
+ import { createRequire as createRequireShim } from 'module'; const require = createRequireShim(import.meta.url);
2
+ var Ks=Object.create;var ai=Object.defineProperty;var Xs=Object.getOwnPropertyDescriptor;var Ys=Object.getOwnPropertyNames;var $s=Object.getPrototypeOf,js=Object.prototype.hasOwnProperty;var sc=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,t)=>(typeof require<"u"?require:n)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var fc=(e,n)=>()=>(e&&(n=e(e=0)),n);var q=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),cc=(e,n)=>{for(var t in n)ai(e,t,{get:n[t],enumerable:!0})},Ki=(e,n,t,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of Ys(n))!js.call(e,i)&&i!==t&&ai(e,i,{get:()=>n[i],enumerable:!(a=Xs(n,i))||a.enumerable});return e};var nn=(e,n,t)=>(t=e!=null?Ks($s(e)):{},Ki(n||!e||!e.__esModule?ai(t,"default",{value:e,enumerable:!0}):t,e)),pc=e=>Ki(ai({},"__esModule",{value:!0}),e);var ua=q((mc,oa)=>{"use strict";oa.exports=nf;function nf(e,n){for(var t=new Array(arguments.length-1),a=0,i=2,r=!0;i<arguments.length;)t[a++]=arguments[i++];return new Promise(function(h,c){t[a]=function(m){if(r)if(r=!1,m)c(m);else{for(var V=new Array(arguments.length-1),B=0;B<V.length;)V[B++]=arguments[B];h.apply(null,V)}};try{e.apply(n||null,t)}catch(p){r&&(r=!1,c(p))}})}});var fa=q(sa=>{"use strict";var ui=sa;ui.length=function(n){var t=n.length;if(!t)return 0;for(var a=0;--t%4>1&&n.charAt(t)==="=";)++a;return Math.ceil(n.length*3)/4-a};var An=new Array(64),la=new Array(123);for(Oe=0;Oe<64;)la[An[Oe]=Oe<26?Oe+65:Oe<52?Oe+71:Oe<62?Oe-4:Oe-59|43]=Oe++;var Oe;ui.encode=function(n,t,a){for(var i=null,r=[],s=0,h=0,c;t<a;){var p=n[t++];switch(h){case 0:r[s++]=An[p>>2],c=(p&3)<<4,h=1;break;case 1:r[s++]=An[c|p>>4],c=(p&15)<<2,h=2;break;case 2:r[s++]=An[c|p>>6],r[s++]=An[p&63],h=0;break}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,r)),s=0)}return h&&(r[s++]=An[c],r[s++]=61,h===1&&(r[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,r.slice(0,s))),i.join("")):String.fromCharCode.apply(String,r.slice(0,s))};var da="invalid encoding";ui.decode=function(n,t,a){for(var i=a,r=0,s,h=0;h<n.length;){var c=n.charCodeAt(h++);if(c===61&&r>1)break;if((c=la[c])===void 0)throw Error(da);switch(r){case 0:s=c,r=1;break;case 1:t[a++]=s<<2|(c&48)>>4,s=c,r=2;break;case 2:t[a++]=(s&15)<<4|(c&60)>>2,s=c,r=3;break;case 3:t[a++]=(s&3)<<6|c,r=0;break}}if(r===1)throw Error(da);return a-i};ui.test=function(n){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(n)}});var pa=q((kc,ca)=>{"use strict";ca.exports=di;function di(){this._listeners={}}di.prototype.on=function(n,t,a){return(this._listeners[n]||(this._listeners[n]=[])).push({fn:t,ctx:a||this}),this};di.prototype.off=function(n,t){if(n===void 0)this._listeners={};else if(t===void 0)this._listeners[n]=[];else for(var a=this._listeners[n],i=0;i<a.length;)a[i].fn===t?a.splice(i,1):++i;return this};di.prototype.emit=function(n){var t=this._listeners[n];if(t){for(var a=[],i=1;i<arguments.length;)a.push(arguments[i++]);for(i=0;i<t.length;)t[i].fn.apply(t[i++].ctx,a)}return this}});var Na=q((Sc,Sa)=>{"use strict";Sa.exports=ga(ga);function ga(e){return typeof Float32Array<"u"?function(){var n=new Float32Array([-0]),t=new Uint8Array(n.buffer),a=t[3]===128;function i(c,p,m){n[0]=c,p[m]=t[0],p[m+1]=t[1],p[m+2]=t[2],p[m+3]=t[3]}function r(c,p,m){n[0]=c,p[m]=t[3],p[m+1]=t[2],p[m+2]=t[1],p[m+3]=t[0]}e.writeFloatLE=a?i:r,e.writeFloatBE=a?r:i;function s(c,p){return t[0]=c[p],t[1]=c[p+1],t[2]=c[p+2],t[3]=c[p+3],n[0]}function h(c,p){return t[3]=c[p],t[2]=c[p+1],t[1]=c[p+2],t[0]=c[p+3],n[0]}e.readFloatLE=a?s:h,e.readFloatBE=a?h:s}():function(){function n(a,i,r,s){var h=i<0?1:0;if(h&&(i=-i),i===0)a(1/i>0?0:2147483648,r,s);else if(isNaN(i))a(2143289344,r,s);else if(i>34028234663852886e22)a((h<<31|2139095040)>>>0,r,s);else if(i<11754943508222875e-54)a((h<<31|Math.round(i/1401298464324817e-60))>>>0,r,s);else{var c=Math.floor(Math.log(i)/Math.LN2),p=Math.round(i*Math.pow(2,-c)*8388608)&8388607;a((h<<31|c+127<<23|p)>>>0,r,s)}}e.writeFloatLE=n.bind(null,ha),e.writeFloatBE=n.bind(null,ma);function t(a,i,r){var s=a(i,r),h=(s>>31)*2+1,c=s>>>23&255,p=s&8388607;return c===255?p?NaN:h*(1/0):c===0?h*1401298464324817e-60*p:h*Math.pow(2,c-150)*(p+8388608)}e.readFloatLE=t.bind(null,ya),e.readFloatBE=t.bind(null,ka)}(),typeof Float64Array<"u"?function(){var n=new Float64Array([-0]),t=new Uint8Array(n.buffer),a=t[7]===128;function i(c,p,m){n[0]=c,p[m]=t[0],p[m+1]=t[1],p[m+2]=t[2],p[m+3]=t[3],p[m+4]=t[4],p[m+5]=t[5],p[m+6]=t[6],p[m+7]=t[7]}function r(c,p,m){n[0]=c,p[m]=t[7],p[m+1]=t[6],p[m+2]=t[5],p[m+3]=t[4],p[m+4]=t[3],p[m+5]=t[2],p[m+6]=t[1],p[m+7]=t[0]}e.writeDoubleLE=a?i:r,e.writeDoubleBE=a?r:i;function s(c,p){return t[0]=c[p],t[1]=c[p+1],t[2]=c[p+2],t[3]=c[p+3],t[4]=c[p+4],t[5]=c[p+5],t[6]=c[p+6],t[7]=c[p+7],n[0]}function h(c,p){return t[7]=c[p],t[6]=c[p+1],t[5]=c[p+2],t[4]=c[p+3],t[3]=c[p+4],t[2]=c[p+5],t[1]=c[p+6],t[0]=c[p+7],n[0]}e.readDoubleLE=a?s:h,e.readDoubleBE=a?h:s}():function(){function n(a,i,r,s,h,c){var p=s<0?1:0;if(p&&(s=-s),s===0)a(0,h,c+i),a(1/s>0?0:2147483648,h,c+r);else if(isNaN(s))a(0,h,c+i),a(2146959360,h,c+r);else if(s>17976931348623157e292)a(0,h,c+i),a((p<<31|2146435072)>>>0,h,c+r);else{var m;if(s<22250738585072014e-324)m=s/5e-324,a(m>>>0,h,c+i),a((p<<31|m/4294967296)>>>0,h,c+r);else{var V=Math.floor(Math.log(s)/Math.LN2);V===1024&&(V=1023),m=s*Math.pow(2,-V),a(m*4503599627370496>>>0,h,c+i),a((p<<31|V+1023<<20|m*1048576&1048575)>>>0,h,c+r)}}}e.writeDoubleLE=n.bind(null,ha,0,4),e.writeDoubleBE=n.bind(null,ma,4,0);function t(a,i,r,s,h){var c=a(s,h+i),p=a(s,h+r),m=(p>>31)*2+1,V=p>>>20&2047,B=4294967296*(p&1048575)+c;return V===2047?B?NaN:m*(1/0):V===0?m*5e-324*B:m*Math.pow(2,V-1075)*(B+4503599627370496)}e.readDoubleLE=t.bind(null,ya,0,4),e.readDoubleBE=t.bind(null,ka,4,0)}(),e}function ha(e,n,t){n[t]=e&255,n[t+1]=e>>>8&255,n[t+2]=e>>>16&255,n[t+3]=e>>>24}function ma(e,n,t){n[t]=e>>>24,n[t+1]=e>>>16&255,n[t+2]=e>>>8&255,n[t+3]=e&255}function ya(e,n){return(e[n]|e[n+1]<<8|e[n+2]<<16|e[n+3]<<24)>>>0}function ka(e,n){return(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])>>>0}});var Ta=q((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}});var Ia=q(Ca=>{"use strict";var mi=Ca;mi.length=function(n){for(var t=0,a=0,i=0;i<n.length;++i)a=n.charCodeAt(i),a<128?t+=1:a<2048?t+=2:(a&64512)===55296&&(n.charCodeAt(i+1)&64512)===56320?(++i,t+=4):t+=3;return t};mi.read=function(n,t,a){var i=a-t;if(i<1)return"";for(var r=null,s=[],h=0,c;t<a;)c=n[t++],c<128?s[h++]=c:c>191&&c<224?s[h++]=(c&31)<<6|n[t++]&63:c>239&&c<365?(c=((c&7)<<18|(n[t++]&63)<<12|(n[t++]&63)<<6|n[t++]&63)-65536,s[h++]=55296+(c>>10),s[h++]=56320+(c&1023)):s[h++]=(c&15)<<12|(n[t++]&63)<<6|n[t++]&63,h>8191&&((r||(r=[])).push(String.fromCharCode.apply(String,s)),h=0);return r?(h&&r.push(String.fromCharCode.apply(String,s.slice(0,h))),r.join("")):String.fromCharCode.apply(String,s.slice(0,h))};mi.write=function(n,t,a){for(var i=a,r,s,h=0;h<n.length;++h)r=n.charCodeAt(h),r<128?t[a++]=r:r<2048?(t[a++]=r>>6|192,t[a++]=r&63|128):(r&64512)===55296&&((s=n.charCodeAt(h+1))&64512)===56320?(r=65536+((r&1023)<<10)+(s&1023),++h,t[a++]=r>>18|240,t[a++]=r>>12&63|128,t[a++]=r>>6&63|128,t[a++]=r&63|128):(t[a++]=r>>12|224,t[a++]=r>>6&63|128,t[a++]=r&63|128);return a-i}});var Oa=q((Tc,Ea)=>{"use strict";Ea.exports=tf;function tf(e,n,t){var a=t||8192,i=a>>>1,r=null,s=a;return function(c){if(c<1||c>i)return e(c);s+c>a&&(r=e(a),s=0);var p=n.call(r,s,s+=c);return s&7&&(s=(s|7)+1),p}}});var Pa=q((Cc,Ra)=>{"use strict";Ra.exports=Q;var ei=hn();function Q(e,n){this.lo=e>>>0,this.hi=n>>>0}var Sn=Q.zero=new Q(0,0);Sn.toNumber=function(){return 0};Sn.zzEncode=Sn.zzDecode=function(){return this};Sn.length=function(){return 1};var rf=Q.zeroHash="\0\0\0\0\0\0\0\0";Q.fromNumber=function(n){if(n===0)return Sn;var t=n<0;t&&(n=-n);var a=n>>>0,i=(n-a)/4294967296>>>0;return t&&(i=~i>>>0,a=~a>>>0,++a>4294967295&&(a=0,++i>4294967295&&(i=0))),new Q(a,i)};Q.from=function(n){if(typeof n=="number")return Q.fromNumber(n);if(ei.isString(n))if(ei.Long)n=ei.Long.fromString(n);else return Q.fromNumber(parseInt(n,10));return n.low||n.high?new Q(n.low>>>0,n.high>>>0):Sn};Q.prototype.toNumber=function(n){if(!n&&this.hi>>>31){var t=~this.lo+1>>>0,a=~this.hi>>>0;return t||(a=a+1>>>0),-(t+a*4294967296)}return this.lo+this.hi*4294967296};Q.prototype.toLong=function(n){return ei.Long?new ei.Long(this.lo|0,this.hi|0,!!n):{low:this.lo|0,high:this.hi|0,unsigned:!!n}};var gn=String.prototype.charCodeAt;Q.fromHash=function(n){return n===rf?Sn:new Q((gn.call(n,0)|gn.call(n,1)<<8|gn.call(n,2)<<16|gn.call(n,3)<<24)>>>0,(gn.call(n,4)|gn.call(n,5)<<8|gn.call(n,6)<<16|gn.call(n,7)<<24)>>>0)};Q.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)};Q.prototype.zzEncode=function(){var n=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^n)>>>0,this.lo=(this.lo<<1^n)>>>0,this};Q.prototype.zzDecode=function(){var n=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^n)>>>0,this.hi=(this.hi>>>1^n)>>>0,this};Q.prototype.length=function(){var n=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,a=this.hi>>>24;return a===0?t===0?n<16384?n<128?1:2:n<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:a<128?9:10}});var hn=q(yi=>{"use strict";var y=yi;y.asPromise=ua();y.base64=fa();y.EventEmitter=pa();y.float=Na();y.inquire=Ta();y.utf8=Ia();y.pool=Oa();y.LongBits=Pa();y.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);y.global=y.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||yi;y.emptyArray=Object.freeze?Object.freeze([]):[];y.emptyObject=Object.freeze?Object.freeze({}):{};y.isInteger=Number.isInteger||function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n};y.isString=function(n){return typeof n=="string"||n instanceof String};y.isObject=function(n){return n&&typeof n=="object"};y.isset=y.isSet=function(n,t){var a=n[t];return a!=null&&n.hasOwnProperty(t)?typeof a!="object"||(Array.isArray(a)?a.length:Object.keys(a).length)>0:!1};y.Buffer=function(){try{var e=y.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch{return null}}();y._Buffer_from=null;y._Buffer_allocUnsafe=null;y.newBuffer=function(n){return typeof n=="number"?y.Buffer?y._Buffer_allocUnsafe(n):new y.Array(n):y.Buffer?y._Buffer_from(n):typeof Uint8Array>"u"?n:new Uint8Array(n)};y.Array=typeof Uint8Array<"u"?Uint8Array:Array;y.Long=y.global.dcodeIO&&y.global.dcodeIO.Long||y.global.Long||y.inquire("long");y.key2Re=/^true|false|0|1$/;y.key32Re=/^-?(?:0|[1-9][0-9]*)$/;y.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;y.longToHash=function(n){return n?y.LongBits.from(n).toHash():y.LongBits.zeroHash};y.longFromHash=function(n,t){var a=y.LongBits.fromHash(n);return y.Long?y.Long.fromBits(a.lo,a.hi,t):a.toNumber(!!t)};function _a(e,n,t){for(var a=Object.keys(n),i=0;i<a.length;++i)(e[a[i]]===void 0||!t)&&(e[a[i]]=n[a[i]]);return e}y.merge=_a;y.lcFirst=function(n){return n.charAt(0).toLowerCase()+n.substring(1)};function va(e){function n(t,a){if(!(this instanceof n))return new n(t,a);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,n):Object.defineProperty(this,"stack",{value:new Error().stack||""}),a&&_a(this,a)}return n.prototype=Object.create(Error.prototype,{constructor:{value:n,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),n}y.newError=va;y.ProtocolError=va("ProtocolError");y.oneOfGetter=function(n){for(var t={},a=0;a<n.length;++a)t[n[a]]=1;return function(){for(var i=Object.keys(this),r=i.length-1;r>-1;--r)if(t[i[r]]===1&&this[i[r]]!==void 0&&this[i[r]]!==null)return i[r]}};y.oneOfSetter=function(n){return function(t){for(var a=0;a<n.length;++a)n[a]!==t&&delete this[n[a]]}};y.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};y._configure=function(){var e=y.Buffer;if(!e){y._Buffer_from=y._Buffer_allocUnsafe=null;return}y._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,a){return new e(t,a)},y._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}}});var Ei=q((Ec,Da)=>{"use strict";Da.exports=E;var ke=hn(),ki,li=ke.LongBits,Aa=ke.base64,Ba=ke.utf8;function ni(e,n,t){this.fn=e,this.len=n,this.next=void 0,this.val=t}function Ni(){}function af(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function E(){this.len=0,this.head=new ni(Ni,0,0),this.tail=this.head,this.states=null}var ba=function(){return ke.Buffer?function(){return(E.create=function(){return new ki})()}:function(){return new E}};E.create=ba();E.alloc=function(n){return new ke.Array(n)};ke.Array!==Array&&(E.alloc=ke.pool(E.alloc,ke.Array.prototype.subarray));E.prototype._push=function(n,t,a){return this.tail=this.tail.next=new ni(n,t,a),this.len+=t,this};function Ti(e,n,t){n[t]=e&255}function of(e,n,t){for(;e>127;)n[t++]=e&127|128,e>>>=7;n[t]=e}function Ci(e,n){this.len=e,this.next=void 0,this.val=n}Ci.prototype=Object.create(ni.prototype);Ci.prototype.fn=of;E.prototype.uint32=function(n){return this.len+=(this.tail=this.tail.next=new Ci((n=n>>>0)<128?1:n<16384?2:n<2097152?3:n<268435456?4:5,n)).len,this};E.prototype.int32=function(n){return n<0?this._push(Ii,10,li.fromNumber(n)):this.uint32(n)};E.prototype.sint32=function(n){return this.uint32((n<<1^n>>31)>>>0)};function Ii(e,n,t){for(;e.hi;)n[t++]=e.lo&127|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)n[t++]=e.lo&127|128,e.lo=e.lo>>>7;n[t++]=e.lo}E.prototype.uint64=function(n){var t=li.from(n);return this._push(Ii,t.length(),t)};E.prototype.int64=E.prototype.uint64;E.prototype.sint64=function(n){var t=li.from(n).zzEncode();return this._push(Ii,t.length(),t)};E.prototype.bool=function(n){return this._push(Ti,1,n?1:0)};function Si(e,n,t){n[t]=e&255,n[t+1]=e>>>8&255,n[t+2]=e>>>16&255,n[t+3]=e>>>24}E.prototype.fixed32=function(n){return this._push(Si,4,n>>>0)};E.prototype.sfixed32=E.prototype.fixed32;E.prototype.fixed64=function(n){var t=li.from(n);return this._push(Si,4,t.lo)._push(Si,4,t.hi)};E.prototype.sfixed64=E.prototype.fixed64;E.prototype.float=function(n){return this._push(ke.float.writeFloatLE,4,n)};E.prototype.double=function(n){return this._push(ke.float.writeDoubleLE,8,n)};var uf=ke.Array.prototype.set?function(n,t,a){t.set(n,a)}:function(n,t,a){for(var i=0;i<n.length;++i)t[a+i]=n[i]};E.prototype.bytes=function(n){var t=n.length>>>0;if(!t)return this._push(Ti,1,0);if(ke.isString(n)){var a=E.alloc(t=Aa.length(n));Aa.decode(n,a,0),n=a}return this.uint32(t)._push(uf,t,n)};E.prototype.string=function(n){var t=Ba.length(n);return t?this.uint32(t)._push(Ba.write,t,n):this._push(Ti,1,0)};E.prototype.fork=function(){return this.states=new af(this),this.head=this.tail=new ni(Ni,0,0),this.len=0,this};E.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new ni(Ni,0,0),this.len=0),this};E.prototype.ldelim=function(){var n=this.head,t=this.tail,a=this.len;return this.reset().uint32(a),a&&(this.tail.next=n.next,this.tail=t,this.len+=a),this};E.prototype.finish=function(){for(var n=this.head.next,t=this.constructor.alloc(this.len),a=0;n;)n.fn(n.val,t,a),a+=n.len,n=n.next;return t};E._configure=function(e){ki=e,E.create=ba(),ki._configure()}});var Ua=q((Oc,xa)=>{"use strict";xa.exports=tn;var Ja=Ei();(tn.prototype=Object.create(Ja.prototype)).constructor=tn;var mn=hn();function tn(){Ja.call(this)}tn._configure=function(){tn.alloc=mn._Buffer_allocUnsafe,tn.writeBytesBuffer=mn.Buffer&&mn.Buffer.prototype instanceof Uint8Array&&mn.Buffer.prototype.set.name==="set"?function(n,t,a){t.set(n,a)}:function(n,t,a){if(n.copy)n.copy(t,a,0,n.length);else for(var i=0;i<n.length;)t[a++]=n[i++]}};tn.prototype.bytes=function(n){mn.isString(n)&&(n=mn._Buffer_from(n,"base64"));var t=n.length>>>0;return this.uint32(t),t&&this._push(tn.writeBytesBuffer,t,n),this};function df(e,n,t){e.length<40?mn.utf8.write(e,n,t):n.utf8Write?n.utf8Write(e,t):n.write(e,t)}tn.prototype.string=function(n){var t=mn.Buffer.byteLength(n);return this.uint32(t),t&&this._push(df,t,n),this};tn._configure()});var Pi=q((Rc,Ma)=>{"use strict";Ma.exports=F;var Re=hn(),Ri,Fa=Re.LongBits,lf=Re.utf8;function Pe(e,n){return RangeError("index out of range: "+e.pos+" + "+(n||1)+" > "+e.len)}function F(e){this.buf=e,this.pos=0,this.len=e.length}var Va=typeof Uint8Array<"u"?function(n){if(n instanceof Uint8Array||Array.isArray(n))return new F(n);throw Error("illegal buffer")}:function(n){if(Array.isArray(n))return new F(n);throw Error("illegal buffer")},wa=function(){return Re.Buffer?function(t){return(F.create=function(i){return Re.Buffer.isBuffer(i)?new Ri(i):Va(i)})(t)}:Va};F.create=wa();F.prototype._slice=Re.Array.prototype.subarray||Re.Array.prototype.slice;F.prototype.uint32=function(){var n=4294967295;return function(){if(n=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(n=(n|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(n=(n|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(n=(n|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(n=(n|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return n;if((this.pos+=5)>this.len)throw this.pos=this.len,Pe(this,10);return n}}();F.prototype.int32=function(){return this.uint32()|0};F.prototype.sint32=function(){var n=this.uint32();return n>>>1^-(n&1)|0};function Oi(){var e=new Fa(0,0),n=0;if(this.len-this.pos>4){for(;n<4;++n)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<n*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;n=0}else{for(;n<3;++n){if(this.pos>=this.len)throw Pe(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<n*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<n*7)>>>0,e}if(this.len-this.pos>4){for(;n<5;++n)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<n*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;n<5;++n){if(this.pos>=this.len)throw Pe(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<n*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}F.prototype.bool=function(){return this.uint32()!==0};function si(e,n){return(e[n-4]|e[n-3]<<8|e[n-2]<<16|e[n-1]<<24)>>>0}F.prototype.fixed32=function(){if(this.pos+4>this.len)throw Pe(this,4);return si(this.buf,this.pos+=4)};F.prototype.sfixed32=function(){if(this.pos+4>this.len)throw Pe(this,4);return si(this.buf,this.pos+=4)|0};function La(){if(this.pos+8>this.len)throw Pe(this,8);return new Fa(si(this.buf,this.pos+=4),si(this.buf,this.pos+=4))}F.prototype.float=function(){if(this.pos+4>this.len)throw Pe(this,4);var n=Re.float.readFloatLE(this.buf,this.pos);return this.pos+=4,n};F.prototype.double=function(){if(this.pos+8>this.len)throw Pe(this,4);var n=Re.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,n};F.prototype.bytes=function(){var n=this.uint32(),t=this.pos,a=this.pos+n;if(a>this.len)throw Pe(this,n);if(this.pos+=n,Array.isArray(this.buf))return this.buf.slice(t,a);if(t===a){var i=Re.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,a)};F.prototype.string=function(){var n=this.bytes();return lf.read(n,0,n.length)};F.prototype.skip=function(n){if(typeof n=="number"){if(this.pos+n>this.len)throw Pe(this,n);this.pos+=n}else do if(this.pos>=this.len)throw Pe(this);while(this.buf[this.pos++]&128);return this};F.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};F._configure=function(e){Ri=e,F.create=wa(),Ri._configure();var n=Re.Long?"toLong":"toNumber";Re.merge(F.prototype,{int64:function(){return Oi.call(this)[n](!1)},uint64:function(){return Oi.call(this)[n](!0)},sint64:function(){return Oi.call(this).zzDecode()[n](!1)},fixed64:function(){return La.call(this)[n](!0)},sfixed64:function(){return La.call(this)[n](!1)}})}});var Ha=q((Pc,qa)=>{"use strict";qa.exports=Nn;var Ga=Pi();(Nn.prototype=Object.create(Ga.prototype)).constructor=Nn;var Wa=hn();function Nn(e){Ga.call(this,e)}Nn._configure=function(){Wa.Buffer&&(Nn.prototype._slice=Wa.Buffer.prototype.slice)};Nn.prototype.string=function(){var n=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+n,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+n,this.len))};Nn._configure()});var Za=q((_c,Qa)=>{"use strict";Qa.exports=ti;var _i=hn();(ti.prototype=Object.create(_i.EventEmitter.prototype)).constructor=ti;function ti(e,n,t){if(typeof e!="function")throw TypeError("rpcImpl must be a function");_i.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!n,this.responseDelimited=!!t}ti.prototype.rpcCall=function e(n,t,a,i,r){if(!i)throw TypeError("request must be specified");var s=this;if(!r)return _i.asPromise(e,s,n,t,a,i);if(!s.rpcImpl){setTimeout(function(){r(Error("already ended"))},0);return}try{return s.rpcImpl(n,t[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(c,p){if(c)return s.emit("error",c,n),r(c);if(p===null){s.end(!0);return}if(!(p instanceof a))try{p=a[s.responseDelimited?"decodeDelimited":"decode"](p)}catch(m){return s.emit("error",m,n),r(m)}return s.emit("data",p,n),r(null,p)})}catch(h){s.emit("error",h,n),setTimeout(function(){r(h)},0);return}};ti.prototype.end=function(n){return this.rpcImpl&&(n||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var Ka=q(za=>{"use strict";var sf=za;sf.Service=Za()});var Ya=q((Ac,Xa)=>{"use strict";Xa.exports={}});var eo=q(ja=>{"use strict";var se=ja;se.build="minimal";se.Writer=Ei();se.BufferWriter=Ua();se.Reader=Pi();se.BufferReader=Ha();se.util=hn();se.rpc=Ka();se.roots=Ya();se.configure=$a;function $a(){se.util._configure(),se.Writer._configure(se.BufferWriter),se.Reader._configure(se.BufferReader)}$a()});var _e=q((bc,no)=>{"use strict";no.exports=eo()});var me=null;try{me=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function b(e,n,t){this.low=e|0,this.high=n|0,this.unsigned=!!t}b.prototype.__isLong__;Object.defineProperty(b.prototype,"__isLong__",{value:!0});function Y(e){return(e&&e.__isLong__)===!0}function Xi(e){var n=Math.clz32(e&-e);return e?31-n:n}b.isLong=Y;var Yi={},$i={};function kn(e,n){var t,a,i;return n?(e>>>=0,(i=0<=e&&e<256)&&(a=$i[e],a)?a:(t=O(e,0,!0),i&&($i[e]=t),t)):(e|=0,(i=-128<=e&&e<128)&&(a=Yi[e],a)?a:(t=O(e,e<0?-1:0,!1),i&&(Yi[e]=t),t))}b.fromInt=kn;function ye(e,n){if(isNaN(e))return n?un:Ie;if(n){if(e<0)return un;if(e>=ta)return aa}else{if(e<=-ea)return le;if(e+1>=ea)return ia}return e<0?ye(-e,n).neg():O(e%vn|0,e/vn|0,n)}b.fromNumber=ye;function O(e,n,t){return new b(e,n,t)}b.fromBits=O;var oi=Math.pow;function hi(e,n,t){if(e.length===0)throw Error("empty string");if(typeof n=="number"?(t=n,n=!1):n=!!n,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return n?un:Ie;if(t=t||10,t<2||36<t)throw RangeError("radix");var a;if((a=e.indexOf("-"))>0)throw Error("interior hyphen");if(a===0)return hi(e.substring(1),n,t).neg();for(var i=ye(oi(t,8)),r=Ie,s=0;s<e.length;s+=8){var h=Math.min(8,e.length-s),c=parseInt(e.substring(s,s+h),t);if(h<8){var p=ye(oi(t,h));r=r.mul(p).add(ye(c))}else r=r.mul(i),r=r.add(ye(c))}return r.unsigned=n,r}b.fromString=hi;function Ee(e,n){return typeof e=="number"?ye(e,n):typeof e=="string"?hi(e,n):O(e.low,e.high,typeof n=="boolean"?n:e.unsigned)}b.fromValue=Ee;var ji=65536,ef=1<<24,vn=ji*ji,ta=vn*vn,ea=ta/2,na=kn(ef),Ie=kn(0);b.ZERO=Ie;var un=kn(0,!0);b.UZERO=un;var _n=kn(1);b.ONE=_n;var ra=kn(1,!0);b.UONE=ra;var gi=kn(-1);b.NEG_ONE=gi;var ia=O(-1,2147483647,!1);b.MAX_VALUE=ia;var aa=O(-1,-1,!0);b.MAX_UNSIGNED_VALUE=aa;var le=O(0,-2147483648,!1);b.MIN_VALUE=le;var g=b.prototype;g.toInt=function(){return this.unsigned?this.low>>>0:this.low};g.toNumber=function(){return this.unsigned?(this.high>>>0)*vn+(this.low>>>0):this.high*vn+(this.low>>>0)};g.toString=function(n){if(n=n||10,n<2||36<n)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(le)){var t=ye(n),a=this.div(t),i=a.mul(t).sub(this);return a.toString(n)+i.toInt().toString(n)}else return"-"+this.neg().toString(n);for(var r=ye(oi(n,6),this.unsigned),s=this,h="";;){var c=s.div(r),p=s.sub(c.mul(r)).toInt()>>>0,m=p.toString(n);if(s=c,s.isZero())return m+h;for(;m.length<6;)m="0"+m;h=""+m+h}};g.getHighBits=function(){return this.high};g.getHighBitsUnsigned=function(){return this.high>>>0};g.getLowBits=function(){return this.low};g.getLowBitsUnsigned=function(){return this.low>>>0};g.getNumBitsAbs=function(){if(this.isNegative())return this.eq(le)?64:this.neg().getNumBitsAbs();for(var n=this.high!=0?this.high:this.low,t=31;t>0&&!(n&1<<t);t--);return this.high!=0?t+33:t+1};g.isZero=function(){return this.high===0&&this.low===0};g.eqz=g.isZero;g.isNegative=function(){return!this.unsigned&&this.high<0};g.isPositive=function(){return this.unsigned||this.high>=0};g.isOdd=function(){return(this.low&1)===1};g.isEven=function(){return(this.low&1)===0};g.equals=function(n){return Y(n)||(n=Ee(n)),this.unsigned!==n.unsigned&&this.high>>>31===1&&n.high>>>31===1?!1:this.high===n.high&&this.low===n.low};g.eq=g.equals;g.notEquals=function(n){return!this.eq(n)};g.neq=g.notEquals;g.ne=g.notEquals;g.lessThan=function(n){return this.comp(n)<0};g.lt=g.lessThan;g.lessThanOrEqual=function(n){return this.comp(n)<=0};g.lte=g.lessThanOrEqual;g.le=g.lessThanOrEqual;g.greaterThan=function(n){return this.comp(n)>0};g.gt=g.greaterThan;g.greaterThanOrEqual=function(n){return this.comp(n)>=0};g.gte=g.greaterThanOrEqual;g.ge=g.greaterThanOrEqual;g.compare=function(n){if(Y(n)||(n=Ee(n)),this.eq(n))return 0;var t=this.isNegative(),a=n.isNegative();return t&&!a?-1:!t&&a?1:this.unsigned?n.high>>>0>this.high>>>0||n.high===this.high&&n.low>>>0>this.low>>>0?-1:1:this.sub(n).isNegative()?-1:1};g.comp=g.compare;g.negate=function(){return!this.unsigned&&this.eq(le)?le:this.not().add(_n)};g.neg=g.negate;g.add=function(n){Y(n)||(n=Ee(n));var t=this.high>>>16,a=this.high&65535,i=this.low>>>16,r=this.low&65535,s=n.high>>>16,h=n.high&65535,c=n.low>>>16,p=n.low&65535,m=0,V=0,B=0,ce=0;return ce+=r+p,B+=ce>>>16,ce&=65535,B+=i+c,V+=B>>>16,B&=65535,V+=a+h,m+=V>>>16,V&=65535,m+=t+s,m&=65535,O(B<<16|ce,m<<16|V,this.unsigned)};g.subtract=function(n){return Y(n)||(n=Ee(n)),this.add(n.neg())};g.sub=g.subtract;g.multiply=function(n){if(this.isZero())return this;if(Y(n)||(n=Ee(n)),me){var t=me.mul(this.low,this.high,n.low,n.high);return O(t,me.get_high(),this.unsigned)}if(n.isZero())return this.unsigned?un:Ie;if(this.eq(le))return n.isOdd()?le:Ie;if(n.eq(le))return this.isOdd()?le:Ie;if(this.isNegative())return n.isNegative()?this.neg().mul(n.neg()):this.neg().mul(n).neg();if(n.isNegative())return this.mul(n.neg()).neg();if(this.lt(na)&&n.lt(na))return ye(this.toNumber()*n.toNumber(),this.unsigned);var a=this.high>>>16,i=this.high&65535,r=this.low>>>16,s=this.low&65535,h=n.high>>>16,c=n.high&65535,p=n.low>>>16,m=n.low&65535,V=0,B=0,ce=0,ii=0;return ii+=s*m,ce+=ii>>>16,ii&=65535,ce+=r*m,B+=ce>>>16,ce&=65535,ce+=s*p,B+=ce>>>16,ce&=65535,B+=i*m,V+=B>>>16,B&=65535,B+=r*p,V+=B>>>16,B&=65535,B+=s*c,V+=B>>>16,B&=65535,V+=a*m+i*p+r*c+s*h,V&=65535,O(ce<<16|ii,V<<16|B,this.unsigned)};g.mul=g.multiply;g.divide=function(n){if(Y(n)||(n=Ee(n)),n.isZero())throw Error("division by zero");if(me){if(!this.unsigned&&this.high===-2147483648&&n.low===-1&&n.high===-1)return this;var t=(this.unsigned?me.div_u:me.div_s)(this.low,this.high,n.low,n.high);return O(t,me.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?un:Ie;var a,i,r;if(this.unsigned){if(n.unsigned||(n=n.toUnsigned()),n.gt(this))return un;if(n.gt(this.shru(1)))return ra;r=un}else{if(this.eq(le)){if(n.eq(_n)||n.eq(gi))return le;if(n.eq(le))return _n;var s=this.shr(1);return a=s.div(n).shl(1),a.eq(Ie)?n.isNegative()?_n:gi:(i=this.sub(n.mul(a)),r=a.add(i.div(n)),r)}else if(n.eq(le))return this.unsigned?un:Ie;if(this.isNegative())return n.isNegative()?this.neg().div(n.neg()):this.neg().div(n).neg();if(n.isNegative())return this.div(n.neg()).neg();r=Ie}for(i=this;i.gte(n);){a=Math.max(1,Math.floor(i.toNumber()/n.toNumber()));for(var h=Math.ceil(Math.log(a)/Math.LN2),c=h<=48?1:oi(2,h-48),p=ye(a),m=p.mul(n);m.isNegative()||m.gt(i);)a-=c,p=ye(a,this.unsigned),m=p.mul(n);p.isZero()&&(p=_n),r=r.add(p),i=i.sub(m)}return r};g.div=g.divide;g.modulo=function(n){if(Y(n)||(n=Ee(n)),me){var t=(this.unsigned?me.rem_u:me.rem_s)(this.low,this.high,n.low,n.high);return O(t,me.get_high(),this.unsigned)}return this.sub(this.div(n).mul(n))};g.mod=g.modulo;g.rem=g.modulo;g.not=function(){return O(~this.low,~this.high,this.unsigned)};g.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};g.clz=g.countLeadingZeros;g.countTrailingZeros=function(){return this.low?Xi(this.low):Xi(this.high)+32};g.ctz=g.countTrailingZeros;g.and=function(n){return Y(n)||(n=Ee(n)),O(this.low&n.low,this.high&n.high,this.unsigned)};g.or=function(n){return Y(n)||(n=Ee(n)),O(this.low|n.low,this.high|n.high,this.unsigned)};g.xor=function(n){return Y(n)||(n=Ee(n)),O(this.low^n.low,this.high^n.high,this.unsigned)};g.shiftLeft=function(n){return Y(n)&&(n=n.toInt()),(n&=63)===0?this:n<32?O(this.low<<n,this.high<<n|this.low>>>32-n,this.unsigned):O(0,this.low<<n-32,this.unsigned)};g.shl=g.shiftLeft;g.shiftRight=function(n){return Y(n)&&(n=n.toInt()),(n&=63)===0?this:n<32?O(this.low>>>n|this.high<<32-n,this.high>>n,this.unsigned):O(this.high>>n-32,this.high>=0?0:-1,this.unsigned)};g.shr=g.shiftRight;g.shiftRightUnsigned=function(n){return Y(n)&&(n=n.toInt()),(n&=63)===0?this:n<32?O(this.low>>>n|this.high<<32-n,this.high>>>n,this.unsigned):n===32?O(this.high,0,this.unsigned):O(this.high>>>n-32,0,this.unsigned)};g.shru=g.shiftRightUnsigned;g.shr_u=g.shiftRightUnsigned;g.rotateLeft=function(n){var t;return Y(n)&&(n=n.toInt()),(n&=63)===0?this:n===32?O(this.high,this.low,this.unsigned):n<32?(t=32-n,O(this.low<<n|this.high>>>t,this.high<<n|this.low>>>t,this.unsigned)):(n-=32,t=32-n,O(this.high<<n|this.low>>>t,this.low<<n|this.high>>>t,this.unsigned))};g.rotl=g.rotateLeft;g.rotateRight=function(n){var t;return Y(n)&&(n=n.toInt()),(n&=63)===0?this:n===32?O(this.high,this.low,this.unsigned):n<32?(t=32-n,O(this.high<<t|this.low>>>n,this.low<<t|this.high>>>n,this.unsigned)):(n-=32,t=32-n,O(this.low<<t|this.high>>>n,this.high<<t|this.low>>>n,this.unsigned))};g.rotr=g.rotateRight;g.toSigned=function(){return this.unsigned?O(this.low,this.high,!1):this};g.toUnsigned=function(){return this.unsigned?this:O(this.low,this.high,!0)};g.toBytes=function(n){return n?this.toBytesLE():this.toBytesBE()};g.toBytesLE=function(){var n=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,n&255,n>>>8&255,n>>>16&255,n>>>24]};g.toBytesBE=function(){var n=this.high,t=this.low;return[n>>>24,n>>>16&255,n>>>8&255,n&255,t>>>24,t>>>16&255,t>>>8&255,t&255]};b.fromBytes=function(n,t,a){return a?b.fromBytesLE(n,t):b.fromBytesBE(n,t)};b.fromBytesLE=function(n,t){return new b(n[0]|n[1]<<8|n[2]<<16|n[3]<<24,n[4]|n[5]<<8|n[6]<<16|n[7]<<24,t)};b.fromBytesBE=function(n,t){return new b(n[4]<<24|n[5]<<16|n[6]<<8|n[7],n[0]<<24|n[1]<<16|n[2]<<8|n[3],t)};var H=b;var d=nn(_e(),1);var ff=nn(_e(),1);var pe=nn(_e(),1),Tn;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Tn||(Tn={}));function cf(e){switch(e){case 0:case"NULL_VALUE":return Tn.NULL_VALUE;case-1:case"UNRECOGNIZED":default:return Tn.UNRECOGNIZED}}function pf(e){switch(e){case Tn.NULL_VALUE:return"NULL_VALUE";case Tn.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function vi(){return{fields:{}}}var de={encode(e,n=pe.default.Writer.create()){return Object.entries(e.fields).forEach(([t,a])=>{a!==void 0&&bi.encode({key:t,value:a},n.uint32(10).fork()).ldelim()}),n},decode(e,n){let t=e instanceof pe.default.Reader?e:pe.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=vi();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;let s=bi.decode(t,t.uint32());s.value!==void 0&&(i.fields[s.key]=s.value);continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{fields:ro(e.fields)?Object.entries(e.fields).reduce((n,[t,a])=>(n[t]=a,n),{}):{}}},toJSON(e){let n={};if(e.fields){let t=Object.entries(e.fields);t.length>0&&(n.fields={},t.forEach(([a,i])=>{n.fields[a]=i}))}return n},create(e){return de.fromPartial(e??{})},fromPartial(e){let n=vi();return n.fields=Object.entries(e.fields??{}).reduce((t,[a,i])=>(i!==void 0&&(t[a]=i),t),{}),n},wrap(e){let n=vi();if(e!==void 0)for(let t of Object.keys(e))n.fields[t]=e[t];return n},unwrap(e){let n={};if(e.fields)for(let t of Object.keys(e.fields))n[t]=e.fields[t];return n}};function to(){return{key:"",value:void 0}}var bi={encode(e,n=pe.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==void 0&&dn.encode(dn.wrap(e.value),n.uint32(18).fork()).ldelim(),n},decode(e,n){let t=e instanceof pe.default.Reader?e:pe.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=to();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.key=t.string();continue;case 2:if(r!==18)break;i.value=dn.unwrap(dn.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{key:bn(e.key)?globalThis.String(e.key):"",value:bn(e?.value)?e.value:void 0}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==void 0&&(n.value=e.value),n},create(e){return bi.fromPartial(e??{})},fromPartial(e){let n=to();return n.key=e.key??"",n.value=e.value??void 0,n}};function Ai(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var dn={encode(e,n=pe.default.Writer.create()){return e.nullValue!==void 0&&n.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&n.uint32(17).double(e.numberValue),e.stringValue!==void 0&&n.uint32(26).string(e.stringValue),e.boolValue!==void 0&&n.uint32(32).bool(e.boolValue),e.structValue!==void 0&&de.encode(de.wrap(e.structValue),n.uint32(42).fork()).ldelim(),e.listValue!==void 0&&Bn.encode(Bn.wrap(e.listValue),n.uint32(50).fork()).ldelim(),n},decode(e,n){let t=e instanceof pe.default.Reader?e:pe.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Ai();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.nullValue=t.int32();continue;case 2:if(r!==17)break;i.numberValue=t.double();continue;case 3:if(r!==26)break;i.stringValue=t.string();continue;case 4:if(r!==32)break;i.boolValue=t.bool();continue;case 5:if(r!==42)break;i.structValue=de.unwrap(de.decode(t,t.uint32()));continue;case 6:if(r!==50)break;i.listValue=Bn.unwrap(Bn.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{nullValue:bn(e.nullValue)?cf(e.nullValue):void 0,numberValue:bn(e.numberValue)?globalThis.Number(e.numberValue):void 0,stringValue:bn(e.stringValue)?globalThis.String(e.stringValue):void 0,boolValue:bn(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,structValue:ro(e.structValue)?e.structValue:void 0,listValue:globalThis.Array.isArray(e.listValue)?[...e.listValue]:void 0}},toJSON(e){let n={};return e.nullValue!==void 0&&(n.nullValue=pf(e.nullValue)),e.numberValue!==void 0&&(n.numberValue=e.numberValue),e.stringValue!==void 0&&(n.stringValue=e.stringValue),e.boolValue!==void 0&&(n.boolValue=e.boolValue),e.structValue!==void 0&&(n.structValue=e.structValue),e.listValue!==void 0&&(n.listValue=e.listValue),n},create(e){return dn.fromPartial(e??{})},fromPartial(e){let n=Ai();return n.nullValue=e.nullValue??void 0,n.numberValue=e.numberValue??void 0,n.stringValue=e.stringValue??void 0,n.boolValue=e.boolValue??void 0,n.structValue=e.structValue??void 0,n.listValue=e.listValue??void 0,n},wrap(e){let n=Ai();if(e===null)n.nullValue=Tn.NULL_VALUE;else if(typeof e=="boolean")n.boolValue=e;else if(typeof e=="number")n.numberValue=e;else if(typeof e=="string")n.stringValue=e;else if(globalThis.Array.isArray(e))n.listValue=e;else if(typeof e=="object")n.structValue=e;else if(typeof e<"u")throw new globalThis.Error("Unsupported any value type: "+typeof e);return n},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function Bi(){return{values:[]}}var Bn={encode(e,n=pe.default.Writer.create()){for(let t of e.values)dn.encode(dn.wrap(t),n.uint32(10).fork()).ldelim();return n},decode(e,n){let t=e instanceof pe.default.Reader?e:pe.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Bi();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.values.push(dn.unwrap(dn.decode(t,t.uint32())));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e?.values)?[...e.values]:[]}},toJSON(e){let n={};return e.values?.length&&(n.values=e.values),n},create(e){return Bn.fromPartial(e??{})},fromPartial(e){let n=Bi();return n.values=e.values?.map(t=>t)||[],n},wrap(e){let n=Bi();return n.values=e??[],n},unwrap(e){return e?.hasOwnProperty("values")&&globalThis.Array.isArray(e.values)?e.values:e}};function ro(e){return typeof e=="object"&&e!==null}function bn(e){return e!=null}var Cn=nn(_e(),1);function io(){return{seconds:BigInt("0"),nanos:0}}var yn={encode(e,n=Cn.default.Writer.create()){if(e.seconds!==BigInt("0")){if(BigInt.asIntN(64,e.seconds)!==e.seconds)throw new globalThis.Error("value provided for field message.seconds of type int64 too large");n.uint32(8).int64(e.seconds.toString())}return e.nanos!==0&&n.uint32(16).int32(e.nanos),n},decode(e,n){let t=e instanceof Cn.default.Reader?e:Cn.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=io();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.seconds=gf(t.int64());continue;case 2:if(r!==16)break;i.nanos=t.int32();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{seconds:ao(e.seconds)?BigInt(e.seconds):BigInt("0"),nanos:ao(e.nanos)?globalThis.Number(e.nanos):0}},toJSON(e){let n={};return e.seconds!==BigInt("0")&&(n.seconds=e.seconds.toString()),e.nanos!==0&&(n.nanos=Math.round(e.nanos)),n},create(e){return yn.fromPartial(e??{})},fromPartial(e){let n=io();return n.seconds=e.seconds??BigInt("0"),n.nanos=e.nanos??0,n}};function gf(e){return BigInt(e.toString())}Cn.default.util.Long!==H&&(Cn.default.util.Long=H,Cn.default.configure());function ao(e){return e!=null}var P=nn(_e(),1);var oo;(function(e){e[e.FREE=0]="FREE",e[e.DEV=1]="DEV",e[e.PRO=2]="PRO",e[e.ENTERPRISE=3]="ENTERPRISE",e[e.ANONYMOUS=16]="ANONYMOUS",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(oo||(oo={}));var uo;(function(e){e[e.ORG_MEMBER=0]="ORG_MEMBER",e[e.ORG_ADMIN=1]="ORG_ADMIN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(uo||(uo={}));var lo;(function(e){e[e.AND=0]="AND",e[e.OR=1]="OR",e[e.THEN=2]="THEN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(lo||(lo={}));var so;(function(e){e[e.READ=0]="READ",e[e.WRITE=1]="WRITE",e[e.ADMIN=2]="ADMIN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(so||(so={}));var fo;(function(e){e[e.CREDIT_CARD=0]="CREDIT_CARD",e[e.INVOICE_FIAT=1]="INVOICE_FIAT",e[e.INVOICE_CRYPTO=2]="INVOICE_CRYPTO",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(fo||(fo={}));var co;(function(e){e[e.GENERAL=0]="GENERAL",e[e.PROCESSOR_UPLOAD_FAILED=101]="PROCESSOR_UPLOAD_FAILED",e[e.PROCESSOR_UPLOAD_SUCCESS=102]="PROCESSOR_UPLOAD_SUCCESS",e[e.PROCESSOR_OBSOLETED=103]="PROCESSOR_OBSOLETED",e[e.PROCESSOR_STOPPED=104]="PROCESSOR_STOPPED",e[e.PROCESSOR_ACTIVATED=105]="PROCESSOR_ACTIVATED",e[e.PROCESSOR_GENERAL=106]="PROCESSOR_GENERAL",e[e.PROCESSOR_ERROR=107]="PROCESSOR_ERROR",e[e.EXPORT_TASK_FAILED=201]="EXPORT_TASK_FAILED",e[e.EXPORT_TASK_SUCCESS=202]="EXPORT_TASK_SUCCESS",e[e.BILLING_INVOICE=301]="BILLING_INVOICE",e[e.BILLING_PAYMENT=302]="BILLING_PAYMENT",e[e.BILLING_SUBSCRIPTION=303]="BILLING_SUBSCRIPTION",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(co||(co={}));var po;(function(e){e[e.PENDING=0]="PENDING",e[e.SET_USERNAME=1]="SET_USERNAME",e[e.BANNED=9]="BANNED",e[e.ACTIVE=10]="ACTIVE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(po||(po={}));var go;(function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(go||(go={}));var ho;(function(e){e[e.SENTIO=0]="SENTIO",e[e.SUBGRAPH=1]="SUBGRAPH",e[e.ACTION=2]="ACTION",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(ho||(ho={}));var mo;(function(e){e[e.AVG=0]="AVG",e[e.SUM=1]="SUM",e[e.MIN=2]="MIN",e[e.MAX=3]="MAX",e[e.COUNT=4]="COUNT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(mo||(mo={}));var yo;(function(e){e[e.EQ=0]="EQ",e[e.NEQ=1]="NEQ",e[e.EXISTS=9]="EXISTS",e[e.NOT_EXISTS=10]="NOT_EXISTS",e[e.GT=2]="GT",e[e.GTE=3]="GTE",e[e.LT=4]="LT",e[e.LTE=5]="LTE",e[e.BETWEEN=7]="BETWEEN",e[e.NOT_BETWEEN=8]="NOT_BETWEEN",e[e.CONTAINS=11]="CONTAINS",e[e.NOT_CONTAINS=12]="NOT_CONTAINS",e[e.IN_COHORTS=13]="IN_COHORTS",e[e.NOT_IN_COHORTS=14]="NOT_IN_COHORTS",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(yo||(yo={}));var ko;(function(e){e[e.EVENTS=0]="EVENTS",e[e.COHORTS=1]="COHORTS",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(ko||(ko={}));var So;(function(e){e[e.SUM=0]="SUM",e[e.CUMULATIVE_SUM=6]="CUMULATIVE_SUM",e[e.AVG=1]="AVG",e[e.MEDIAN=2]="MEDIAN",e[e.MIN=3]="MIN",e[e.MAX=4]="MAX",e[e.DISTINCT_COUNT=5]="DISTINCT_COUNT",e[e.CUMULATIVE_DISTINCT_COUNT=9]="CUMULATIVE_DISTINCT_COUNT",e[e.CUMULATIVE_COUNT=12]="CUMULATIVE_COUNT",e[e.LAST=7]="LAST",e[e.CUMULATIVE_LAST=10]="CUMULATIVE_LAST",e[e.FIRST=8]="FIRST",e[e.CUMULATIVE_FIRST=11]="CUMULATIVE_FIRST",e[e.PERCENTILE_25TH=20]="PERCENTILE_25TH",e[e.PERCENTILE_75TH=21]="PERCENTILE_75TH",e[e.PERCENTILE_90TH=22]="PERCENTILE_90TH",e[e.PERCENTILE_95TH=23]="PERCENTILE_95TH",e[e.PERCENTILE_99TH=24]="PERCENTILE_99TH",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(So||(So={}));var No;(function(e){e[e.EQ=0]="EQ",e[e.NEQ=1]="NEQ",e[e.GT=2]="GT",e[e.GTE=3]="GTE",e[e.LT=4]="LT",e[e.LTE=5]="LTE",e[e.BETWEEN=7]="BETWEEN",e[e.NOT_BETWEEN=8]="NOT_BETWEEN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(No||(No={}));var To;(function(e){e[e.SUM=0]="SUM",e[e.AVG=1]="AVG",e[e.MEDIAN=2]="MEDIAN",e[e.MIN=3]="MIN",e[e.MAX=4]="MAX",e[e.DISTINCT_COUNT=5]="DISTINCT_COUNT",e[e.LAST=6]="LAST",e[e.FIRST=7]="FIRST",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(To||(To={}));var Co;(function(e){e[e.PROCESSOR=0]="PROCESSOR",e[e.UI=1]="UI",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Co||(Co={}));var Io;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.EMAIL=1]="EMAIL",e[e.SLACK=2]="SLACK",e[e.TELEGRAM=3]="TELEGRAM",e[e.WEBHOOK=4]="WEBHOOK",e[e.DISCORD=5]="DISCORD",e[e.PAGERDUTY=6]="PAGERDUTY",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Io||(Io={}));var Eo;(function(e){e[e.STRING=0]="STRING",e[e.NUMBER=1]="NUMBER",e[e.BOOLEAN=2]="BOOLEAN",e[e.LIST=3]="LIST",e[e.TIME=4]="TIME",e[e.MAP=5]="MAP",e[e.JSON=6]="JSON",e[e.TOKEN=7]="TOKEN",e[e.DYNAMIC=8]="DYNAMIC",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Eo||(Eo={}));var Oo;(function(e){e[e.OnOrAfter=0]="OnOrAfter",e[e.On=1]="On",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Oo||(Oo={}));var Ro;(function(e){e[e.Disable=0]="Disable",e[e.FirstInTimeRange=1]="FirstInTimeRange",e[e.FirstInGlobal=2]="FirstInGlobal",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Ro||(Ro={}));var Po;(function(e){e[e.Day=0]="Day",e[e.Week=1]="Week",e[e.Month=2]="Month",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Po||(Po={}));var _o;(function(e){e[e.SUM=0]="SUM",e[e.AVG=1]="AVG",e[e.MEDIAN=2]="MEDIAN",e[e.MIN=3]="MIN",e[e.MAX=4]="MAX",e[e.DISTINCT_COUNT=5]="DISTINCT_COUNT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(_o||(_o={}));var En;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(En||(En={}));function hf(e){switch(e){case 0:case"NULL_VALUE":return En.NULL_VALUE;case-1:case"UNRECOGNIZED":default:return En.UNRECOGNIZED}}function mf(e){switch(e){case En.NULL_VALUE:return"NULL_VALUE";case En.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function vo(){return{symbol:void 0,address:void 0}}var ge={encode(e,n=P.default.Writer.create()){return e.symbol!==void 0&&n.uint32(10).string(e.symbol),e.address!==void 0&&Dn.encode(e.address,n.uint32(18).fork()).ldelim(),n},decode(e,n){let t=e instanceof P.default.Reader?e:P.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=vo();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.symbol=t.string();continue;case 2:if(r!==18)break;i.address=Dn.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{symbol:D(e.symbol)?globalThis.String(e.symbol):void 0,address:D(e.address)?Dn.fromJSON(e.address):void 0}},toJSON(e){let n={};return e.symbol!==void 0&&(n.symbol=e.symbol),e.address!==void 0&&(n.address=Dn.toJSON(e.address)),n},create(e){return ge.fromPartial(e??{})},fromPartial(e){let n=vo();return n.symbol=e.symbol??void 0,n.address=e.address!==void 0&&e.address!==null?Dn.fromPartial(e.address):void 0,n}};function Ao(){return{address:"",chain:""}}var Dn={encode(e,n=P.default.Writer.create()){return e.address!==""&&n.uint32(10).string(e.address),e.chain!==""&&n.uint32(18).string(e.chain),n},decode(e,n){let t=e instanceof P.default.Reader?e:P.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Ao();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.address=t.string();continue;case 2:if(r!==18)break;i.chain=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{address:D(e.address)?globalThis.String(e.address):"",chain:D(e.chain)?globalThis.String(e.chain):""}},toJSON(e){let n={};return e.address!==""&&(n.address=e.address),e.chain!==""&&(n.chain=e.chain),n},create(e){return Dn.fromPartial(e??{})},fromPartial(e){let n=Ao();return n.address=e.address??"",n.chain=e.chain??"",n}};function Bo(){return{nullValue:void 0,intValue:void 0,int64Value:void 0,floatValue:void 0,bytesValue:void 0,boolValue:void 0,stringValue:void 0,timestampValue:void 0,bigintValue:void 0,bigdecimalValue:void 0,listValue:void 0,structValue:void 0,tokenValue:void 0}}var S={encode(e,n=P.default.Writer.create()){if(e.nullValue!==void 0&&n.uint32(8).int32(e.nullValue),e.intValue!==void 0&&n.uint32(16).int32(e.intValue),e.int64Value!==void 0){if(BigInt.asIntN(64,e.int64Value)!==e.int64Value)throw new globalThis.Error("value provided for field message.int64Value of type int64 too large");n.uint32(104).int64(e.int64Value.toString())}return e.floatValue!==void 0&&n.uint32(25).double(e.floatValue),e.bytesValue!==void 0&&n.uint32(34).bytes(e.bytesValue),e.boolValue!==void 0&&n.uint32(40).bool(e.boolValue),e.stringValue!==void 0&&n.uint32(50).string(e.stringValue),e.timestampValue!==void 0&&yn.encode(wo(e.timestampValue),n.uint32(58).fork()).ldelim(),e.bigintValue!==void 0&&z.encode(e.bigintValue,n.uint32(66).fork()).ldelim(),e.bigdecimalValue!==void 0&&Se.encode(e.bigdecimalValue,n.uint32(74).fork()).ldelim(),e.listValue!==void 0&&L.encode(e.listValue,n.uint32(82).fork()).ldelim(),e.structValue!==void 0&&Z.encode(e.structValue,n.uint32(90).fork()).ldelim(),e.tokenValue!==void 0&&In.encode(e.tokenValue,n.uint32(98).fork()).ldelim(),n},decode(e,n){let t=e instanceof P.default.Reader?e:P.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Bo();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.nullValue=t.int32();continue;case 2:if(r!==16)break;i.intValue=t.int32();continue;case 13:if(r!==104)break;i.int64Value=yf(t.int64());continue;case 3:if(r!==25)break;i.floatValue=t.double();continue;case 4:if(r!==34)break;i.bytesValue=t.bytes();continue;case 5:if(r!==40)break;i.boolValue=t.bool();continue;case 6:if(r!==50)break;i.stringValue=t.string();continue;case 7:if(r!==58)break;i.timestampValue=Ji(yn.decode(t,t.uint32()));continue;case 8:if(r!==66)break;i.bigintValue=z.decode(t,t.uint32());continue;case 9:if(r!==74)break;i.bigdecimalValue=Se.decode(t,t.uint32());continue;case 10:if(r!==82)break;i.listValue=L.decode(t,t.uint32());continue;case 11:if(r!==90)break;i.structValue=Z.decode(t,t.uint32());continue;case 12:if(r!==98)break;i.tokenValue=In.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{nullValue:D(e.nullValue)?hf(e.nullValue):void 0,intValue:D(e.intValue)?globalThis.Number(e.intValue):void 0,int64Value:D(e.int64Value)?BigInt(e.int64Value):void 0,floatValue:D(e.floatValue)?globalThis.Number(e.floatValue):void 0,bytesValue:D(e.bytesValue)?Lo(e.bytesValue):void 0,boolValue:D(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,stringValue:D(e.stringValue)?globalThis.String(e.stringValue):void 0,timestampValue:D(e.timestampValue)?Mo(e.timestampValue):void 0,bigintValue:D(e.bigintValue)?z.fromJSON(e.bigintValue):void 0,bigdecimalValue:D(e.bigdecimalValue)?Se.fromJSON(e.bigdecimalValue):void 0,listValue:D(e.listValue)?L.fromJSON(e.listValue):void 0,structValue:D(e.structValue)?Z.fromJSON(e.structValue):void 0,tokenValue:D(e.tokenValue)?In.fromJSON(e.tokenValue):void 0}},toJSON(e){let n={};return e.nullValue!==void 0&&(n.nullValue=mf(e.nullValue)),e.intValue!==void 0&&(n.intValue=Math.round(e.intValue)),e.int64Value!==void 0&&(n.int64Value=e.int64Value.toString()),e.floatValue!==void 0&&(n.floatValue=e.floatValue),e.bytesValue!==void 0&&(n.bytesValue=Fo(e.bytesValue)),e.boolValue!==void 0&&(n.boolValue=e.boolValue),e.stringValue!==void 0&&(n.stringValue=e.stringValue),e.timestampValue!==void 0&&(n.timestampValue=e.timestampValue.toISOString()),e.bigintValue!==void 0&&(n.bigintValue=z.toJSON(e.bigintValue)),e.bigdecimalValue!==void 0&&(n.bigdecimalValue=Se.toJSON(e.bigdecimalValue)),e.listValue!==void 0&&(n.listValue=L.toJSON(e.listValue)),e.structValue!==void 0&&(n.structValue=Z.toJSON(e.structValue)),e.tokenValue!==void 0&&(n.tokenValue=In.toJSON(e.tokenValue)),n},create(e){return S.fromPartial(e??{})},fromPartial(e){let n=Bo();return n.nullValue=e.nullValue??void 0,n.intValue=e.intValue??void 0,n.int64Value=e.int64Value??void 0,n.floatValue=e.floatValue??void 0,n.bytesValue=e.bytesValue??void 0,n.boolValue=e.boolValue??void 0,n.stringValue=e.stringValue??void 0,n.timestampValue=e.timestampValue??void 0,n.bigintValue=e.bigintValue!==void 0&&e.bigintValue!==null?z.fromPartial(e.bigintValue):void 0,n.bigdecimalValue=e.bigdecimalValue!==void 0&&e.bigdecimalValue!==null?Se.fromPartial(e.bigdecimalValue):void 0,n.listValue=e.listValue!==void 0&&e.listValue!==null?L.fromPartial(e.listValue):void 0,n.structValue=e.structValue!==void 0&&e.structValue!==null?Z.fromPartial(e.structValue):void 0,n.tokenValue=e.tokenValue!==void 0&&e.tokenValue!==null?In.fromPartial(e.tokenValue):void 0,n}};function bo(){return{fields:{}}}var Z={encode(e,n=P.default.Writer.create()){return Object.entries(e.fields).forEach(([t,a])=>{Di.encode({key:t,value:a},n.uint32(10).fork()).ldelim()}),n},decode(e,n){let t=e instanceof P.default.Reader?e:P.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=bo();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;let s=Di.decode(t,t.uint32());s.value!==void 0&&(i.fields[s.key]=s.value);continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{fields:kf(e.fields)?Object.entries(e.fields).reduce((n,[t,a])=>(n[t]=S.fromJSON(a),n),{}):{}}},toJSON(e){let n={};if(e.fields){let t=Object.entries(e.fields);t.length>0&&(n.fields={},t.forEach(([a,i])=>{n.fields[a]=S.toJSON(i)}))}return n},create(e){return Z.fromPartial(e??{})},fromPartial(e){let n=bo();return n.fields=Object.entries(e.fields??{}).reduce((t,[a,i])=>(i!==void 0&&(t[a]=S.fromPartial(i)),t),{}),n}};function Do(){return{key:"",value:void 0}}var Di={encode(e,n=P.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==void 0&&S.encode(e.value,n.uint32(18).fork()).ldelim(),n},decode(e,n){let t=e instanceof P.default.Reader?e:P.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Do();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.key=t.string();continue;case 2:if(r!==18)break;i.value=S.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{key:D(e.key)?globalThis.String(e.key):"",value:D(e.value)?S.fromJSON(e.value):void 0}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==void 0&&(n.value=S.toJSON(e.value)),n},create(e){return Di.fromPartial(e??{})},fromPartial(e){let n=Do();return n.key=e.key??"",n.value=e.value!==void 0&&e.value!==null?S.fromPartial(e.value):void 0,n}};function Jo(){return{values:[]}}var L={encode(e,n=P.default.Writer.create()){for(let t of e.values)S.encode(t,n.uint32(10).fork()).ldelim();return n},decode(e,n){let t=e instanceof P.default.Reader?e:P.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Jo();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.values.push(S.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e?.values)?e.values.map(n=>S.fromJSON(n)):[]}},toJSON(e){let n={};return e.values?.length&&(n.values=e.values.map(t=>S.toJSON(t))),n},create(e){return L.fromPartial(e??{})},fromPartial(e){let n=Jo();return n.values=e.values?.map(t=>S.fromPartial(t))||[],n}};function xo(){return{value:void 0,exp:0}}var Se={encode(e,n=P.default.Writer.create()){return e.value!==void 0&&z.encode(e.value,n.uint32(10).fork()).ldelim(),e.exp!==0&&n.uint32(16).int32(e.exp),n},decode(e,n){let t=e instanceof P.default.Reader?e:P.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=xo();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.value=z.decode(t,t.uint32());continue;case 2:if(r!==16)break;i.exp=t.int32();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{value:D(e.value)?z.fromJSON(e.value):void 0,exp:D(e.exp)?globalThis.Number(e.exp):0}},toJSON(e){let n={};return e.value!==void 0&&(n.value=z.toJSON(e.value)),e.exp!==0&&(n.exp=Math.round(e.exp)),n},create(e){return Se.fromPartial(e??{})},fromPartial(e){let n=xo();return n.value=e.value!==void 0&&e.value!==null?z.fromPartial(e.value):void 0,n.exp=e.exp??0,n}};function Uo(){return{negative:!1,data:new Uint8Array(0)}}var z={encode(e,n=P.default.Writer.create()){return e.negative!==!1&&n.uint32(8).bool(e.negative),e.data.length!==0&&n.uint32(18).bytes(e.data),n},decode(e,n){let t=e instanceof P.default.Reader?e:P.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Uo();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.negative=t.bool();continue;case 2:if(r!==18)break;i.data=t.bytes();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{negative:D(e.negative)?globalThis.Boolean(e.negative):!1,data:D(e.data)?Lo(e.data):new Uint8Array(0)}},toJSON(e){let n={};return e.negative!==!1&&(n.negative=e.negative),e.data.length!==0&&(n.data=Fo(e.data)),n},create(e){return z.fromPartial(e??{})},fromPartial(e){let n=Uo();return n.negative=e.negative??!1,n.data=e.data??new Uint8Array(0),n}};function Vo(){return{token:void 0,amount:void 0,specifiedAt:void 0}}var In={encode(e,n=P.default.Writer.create()){return e.token!==void 0&&ge.encode(e.token,n.uint32(10).fork()).ldelim(),e.amount!==void 0&&Se.encode(e.amount,n.uint32(18).fork()).ldelim(),e.specifiedAt!==void 0&&yn.encode(wo(e.specifiedAt),n.uint32(26).fork()).ldelim(),n},decode(e,n){let t=e instanceof P.default.Reader?e:P.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Vo();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.token=ge.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.amount=Se.decode(t,t.uint32());continue;case 3:if(r!==26)break;i.specifiedAt=Ji(yn.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{token:D(e.token)?ge.fromJSON(e.token):void 0,amount:D(e.amount)?Se.fromJSON(e.amount):void 0,specifiedAt:D(e.specifiedAt)?Mo(e.specifiedAt):void 0}},toJSON(e){let n={};return e.token!==void 0&&(n.token=ge.toJSON(e.token)),e.amount!==void 0&&(n.amount=Se.toJSON(e.amount)),e.specifiedAt!==void 0&&(n.specifiedAt=e.specifiedAt.toISOString()),n},create(e){return In.fromPartial(e??{})},fromPartial(e){let n=Vo();return n.token=e.token!==void 0&&e.token!==null?ge.fromPartial(e.token):void 0,n.amount=e.amount!==void 0&&e.amount!==null?Se.fromPartial(e.amount):void 0,n.specifiedAt=e.specifiedAt??void 0,n}};function Lo(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{let n=globalThis.atob(e),t=new Uint8Array(n.length);for(let a=0;a<n.length;++a)t[a]=n.charCodeAt(a);return t}}function Fo(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{let n=[];return e.forEach(t=>{n.push(globalThis.String.fromCharCode(t))}),globalThis.btoa(n.join(""))}}function wo(e){let n=BigInt(Math.trunc(e.getTime()/1e3)),t=e.getTime()%1e3*1e6;return{seconds:n,nanos:t}}function Ji(e){let n=(globalThis.Number(e.seconds.toString())||0)*1e3;return n+=(e.nanos||0)/1e6,new globalThis.Date(n)}function Mo(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):Ji(yn.fromJSON(e))}function yf(e){return BigInt(e.toString())}P.default.util.Long!==H&&(P.default.util.Long=H,P.default.configure());function kf(e){return typeof e=="object"&&e!==null}function D(e){return e!=null}var Ne;(function(e){e[e.UNKNOWN_TYPE=0]="UNKNOWN_TYPE",e[e.COUNTER=1]="COUNTER",e[e.GAUGE=2]="GAUGE",e[e.HISTOGRAM=3]="HISTOGRAM",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Ne||(Ne={}));function Nf(e){switch(e){case 0:case"UNKNOWN_TYPE":return Ne.UNKNOWN_TYPE;case 1:case"COUNTER":return Ne.COUNTER;case 2:case"GAUGE":return Ne.GAUGE;case 3:case"HISTOGRAM":return Ne.HISTOGRAM;case-1:case"UNRECOGNIZED":default:return Ne.UNRECOGNIZED}}function Tf(e){switch(e){case Ne.UNKNOWN_TYPE:return"UNKNOWN_TYPE";case Ne.COUNTER:return"COUNTER";case Ne.GAUGE:return"GAUGE";case Ne.HISTOGRAM:return"HISTOGRAM";case Ne.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var $;(function(e){e[e.COUNT=0]="COUNT",e[e.SUM=1]="SUM",e[e.AVG=2]="AVG",e[e.MIN=3]="MIN",e[e.MAX=4]="MAX",e[e.LAST=5]="LAST",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})($||($={}));function Cf(e){switch(e){case 0:case"COUNT":return $.COUNT;case 1:case"SUM":return $.SUM;case 2:case"AVG":return $.AVG;case 3:case"MIN":return $.MIN;case 4:case"MAX":return $.MAX;case 5:case"LAST":return $.LAST;case-1:case"UNRECOGNIZED":default:return $.UNRECOGNIZED}}function If(e){switch(e){case $.COUNT:return"COUNT";case $.SUM:return"SUM";case $.AVG:return"AVG";case $.MIN:return"MIN";case $.MAX:return"MAX";case $.LAST:return"LAST";case $.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var Te;(function(e){e[e.ADDRESS=0]="ADDRESS",e[e.OBJECT=1]="OBJECT",e[e.WRAPPED_OBJECT=2]="WRAPPED_OBJECT",e[e.TYPE=3]="TYPE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Te||(Te={}));function Ef(e){switch(e){case 0:case"ADDRESS":return Te.ADDRESS;case 1:case"OBJECT":return Te.OBJECT;case 2:case"WRAPPED_OBJECT":return Te.WRAPPED_OBJECT;case 3:case"TYPE":return Te.TYPE;case-1:case"UNRECOGNIZED":default:return Te.UNRECOGNIZED}}function Of(e){switch(e){case Te.ADDRESS:return"ADDRESS";case Te.OBJECT:return"OBJECT";case Te.WRAPPED_OBJECT:return"WRAPPED_OBJECT";case Te.TYPE:return"TYPE";case Te.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var rn;(function(e){e[e.ERC20=0]="ERC20",e[e.ERC721=1]="ERC721",e[e.ERC1155=2]="ERC1155",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(rn||(rn={}));function Rf(e){switch(e){case 0:case"ERC20":return rn.ERC20;case 1:case"ERC721":return rn.ERC721;case 2:case"ERC1155":return rn.ERC1155;case-1:case"UNRECOGNIZED":default:return rn.UNRECOGNIZED}}function Pf(e){switch(e){case rn.ERC20:return"ERC20";case rn.ERC721:return"ERC721";case rn.ERC1155:return"ERC1155";case rn.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var N;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.ETH_LOG=1]="ETH_LOG",e[e.ETH_BLOCK=2]="ETH_BLOCK",e[e.ETH_TRACE=5]="ETH_TRACE",e[e.ETH_TRANSACTION=11]="ETH_TRANSACTION",e[e.SOL_INSTRUCTION=4]="SOL_INSTRUCTION",e[e.APT_EVENT=6]="APT_EVENT",e[e.APT_CALL=7]="APT_CALL",e[e.APT_RESOURCE=8]="APT_RESOURCE",e[e.SUI_EVENT=3]="SUI_EVENT",e[e.SUI_CALL=9]="SUI_CALL",e[e.SUI_OBJECT=10]="SUI_OBJECT",e[e.SUI_OBJECT_CHANGE=12]="SUI_OBJECT_CHANGE",e[e.FUEL_CALL=13]="FUEL_CALL",e[e.FUEL_RECEIPT=19]="FUEL_RECEIPT",e[e.FUEL_TRANSACTION=20]="FUEL_TRANSACTION",e[e.FUEL_BLOCK=17]="FUEL_BLOCK",e[e.COSMOS_CALL=14]="COSMOS_CALL",e[e.STARKNET_EVENT=15]="STARKNET_EVENT",e[e.BTC_TRANSACTION=16]="BTC_TRANSACTION",e[e.BTC_BLOCK=18]="BTC_BLOCK",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(N||(N={}));function _f(e){switch(e){case 0:case"UNKNOWN":return N.UNKNOWN;case 1:case"ETH_LOG":return N.ETH_LOG;case 2:case"ETH_BLOCK":return N.ETH_BLOCK;case 5:case"ETH_TRACE":return N.ETH_TRACE;case 11:case"ETH_TRANSACTION":return N.ETH_TRANSACTION;case 4:case"SOL_INSTRUCTION":return N.SOL_INSTRUCTION;case 6:case"APT_EVENT":return N.APT_EVENT;case 7:case"APT_CALL":return N.APT_CALL;case 8:case"APT_RESOURCE":return N.APT_RESOURCE;case 3:case"SUI_EVENT":return N.SUI_EVENT;case 9:case"SUI_CALL":return N.SUI_CALL;case 10:case"SUI_OBJECT":return N.SUI_OBJECT;case 12:case"SUI_OBJECT_CHANGE":return N.SUI_OBJECT_CHANGE;case 13:case"FUEL_CALL":return N.FUEL_CALL;case 19:case"FUEL_RECEIPT":return N.FUEL_RECEIPT;case 20:case"FUEL_TRANSACTION":return N.FUEL_TRANSACTION;case 17:case"FUEL_BLOCK":return N.FUEL_BLOCK;case 14:case"COSMOS_CALL":return N.COSMOS_CALL;case 15:case"STARKNET_EVENT":return N.STARKNET_EVENT;case 16:case"BTC_TRANSACTION":return N.BTC_TRANSACTION;case 18:case"BTC_BLOCK":return N.BTC_BLOCK;case-1:case"UNRECOGNIZED":default:return N.UNRECOGNIZED}}function vf(e){switch(e){case N.UNKNOWN:return"UNKNOWN";case N.ETH_LOG:return"ETH_LOG";case N.ETH_BLOCK:return"ETH_BLOCK";case N.ETH_TRACE:return"ETH_TRACE";case N.ETH_TRANSACTION:return"ETH_TRANSACTION";case N.SOL_INSTRUCTION:return"SOL_INSTRUCTION";case N.APT_EVENT:return"APT_EVENT";case N.APT_CALL:return"APT_CALL";case N.APT_RESOURCE:return"APT_RESOURCE";case N.SUI_EVENT:return"SUI_EVENT";case N.SUI_CALL:return"SUI_CALL";case N.SUI_OBJECT:return"SUI_OBJECT";case N.SUI_OBJECT_CHANGE:return"SUI_OBJECT_CHANGE";case N.FUEL_CALL:return"FUEL_CALL";case N.FUEL_RECEIPT:return"FUEL_RECEIPT";case N.FUEL_TRANSACTION:return"FUEL_TRANSACTION";case N.FUEL_BLOCK:return"FUEL_BLOCK";case N.COSMOS_CALL:return"COSMOS_CALL";case N.STARKNET_EVENT:return"STARKNET_EVENT";case N.BTC_TRANSACTION:return"BTC_TRANSACTION";case N.BTC_BLOCK:return"BTC_BLOCK";case N.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var fe;(function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARNING=2]="WARNING",e[e.ERROR=3]="ERROR",e[e.CRITICAL=4]="CRITICAL",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(fe||(fe={}));function Af(e){switch(e){case 0:case"DEBUG":return fe.DEBUG;case 1:case"INFO":return fe.INFO;case 2:case"WARNING":return fe.WARNING;case 3:case"ERROR":return fe.ERROR;case 4:case"CRITICAL":return fe.CRITICAL;case-1:case"UNRECOGNIZED":default:return fe.UNRECOGNIZED}}function Bf(e){switch(e){case fe.DEBUG:return"DEBUG";case fe.INFO:return"INFO";case fe.WARNING:return"WARNING";case fe.ERROR:return"ERROR";case fe.CRITICAL:return"CRITICAL";case fe.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var Wo;(function(e){e[e.AVG=0]="AVG",e[e.MEDIAN=1]="MEDIAN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Wo||(Wo={}));var j;(function(e){e[e.STRING=0]="STRING",e[e.DOUBLE=1]="DOUBLE",e[e.BOOL=2]="BOOL",e[e.TIMESTAMP=3]="TIMESTAMP",e[e.BIG_INTEGER=4]="BIG_INTEGER",e[e.BIG_DECIMAL=5]="BIG_DECIMAL",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(j||(j={}));function bf(e){switch(e){case 0:case"STRING":return j.STRING;case 1:case"DOUBLE":return j.DOUBLE;case 2:case"BOOL":return j.BOOL;case 3:case"TIMESTAMP":return j.TIMESTAMP;case 4:case"BIG_INTEGER":return j.BIG_INTEGER;case 5:case"BIG_DECIMAL":return j.BIG_DECIMAL;case-1:case"UNRECOGNIZED":default:return j.UNRECOGNIZED}}function Df(e){switch(e){case j.STRING:return"STRING";case j.DOUBLE:return"DOUBLE";case j.BOOL:return"BOOL";case j.TIMESTAMP:return"TIMESTAMP";case j.BIG_INTEGER:return"BIG_INTEGER";case j.BIG_DECIMAL:return"BIG_DECIMAL";case j.UNRECOGNIZED:default:return"UNRECOGNIZED"}}var fi;(function(e){e[e.BLOCK_NUMBER=0]="BLOCK_NUMBER",e[e.SEQ_MODE=1]="SEQ_MODE",e[e.UNIQUE_VALUE=2]="UNIQUE_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(fi||(fi={}));var Go;(function(e){e[e.SET=0]="SET",e[e.ADD=1]="ADD",e[e.MULTIPLY=2]="MULTIPLY",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Go||(Go={}));var qo;(function(e){e[e.EQ=0]="EQ",e[e.NE=1]="NE",e[e.GT=2]="GT",e[e.GE=3]="GE",e[e.LT=4]="LT",e[e.LE=5]="LE",e[e.IN=6]="IN",e[e.NOT_IN=7]="NOT_IN",e[e.LIKE=8]="LIKE",e[e.NOT_LIKE=9]="NOT_LIKE",e[e.HAS_ALL=10]="HAS_ALL",e[e.HAS_ANY=11]="HAS_ANY",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(qo||(qo={}));var an;(function(e){e[e.EVENT=0]="EVENT",e[e.GAUGE=1]="GAUGE",e[e.COUNTER=2]="COUNTER",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(an||(an={}));function Jf(e){switch(e){case 0:case"EVENT":return an.EVENT;case 1:case"GAUGE":return an.GAUGE;case 2:case"COUNTER":return an.COUNTER;case-1:case"UNRECOGNIZED":default:return an.UNRECOGNIZED}}function xf(e){switch(e){case an.EVENT:return"EVENT";case an.GAUGE:return"GAUGE";case an.COUNTER:return"COUNTER";case an.UNRECOGNIZED:default:return"UNRECOGNIZED"}}function Ho(){return{name:"",version:""}}var Jn={encode(e,n=d.default.Writer.create()){return e.name!==""&&n.uint32(10).string(e.name),e.version!==""&&n.uint32(26).string(e.version),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Ho();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.name=t.string();continue;case 3:if(r!==26)break;i.version=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{name:l(e.name)?globalThis.String(e.name):"",version:l(e.version)?globalThis.String(e.version):""}},toJSON(e){let n={};return e.name!==""&&(n.name=e.name),e.version!==""&&(n.version=e.version),n},create(e){return Jn.fromPartial(e??{})},fromPartial(e){let n=Ho();return n.name=e.name??"",n.version=e.version??"",n}};function Qo(){return{sequential:!1,forceExactBlockTime:!1,processBindingTimeout:0,skipStartBlockValidation:!1,rpcRetryTimes:0,ethAbiDecoderConfig:void 0}}var xn={encode(e,n=d.default.Writer.create()){return e.sequential!==!1&&n.uint32(8).bool(e.sequential),e.forceExactBlockTime!==!1&&n.uint32(16).bool(e.forceExactBlockTime),e.processBindingTimeout!==0&&n.uint32(24).int32(e.processBindingTimeout),e.skipStartBlockValidation!==!1&&n.uint32(32).bool(e.skipStartBlockValidation),e.rpcRetryTimes!==0&&n.uint32(40).int32(e.rpcRetryTimes),e.ethAbiDecoderConfig!==void 0&&Un.encode(e.ethAbiDecoderConfig,n.uint32(50).fork()).ldelim(),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Qo();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.sequential=t.bool();continue;case 2:if(r!==16)break;i.forceExactBlockTime=t.bool();continue;case 3:if(r!==24)break;i.processBindingTimeout=t.int32();continue;case 4:if(r!==32)break;i.skipStartBlockValidation=t.bool();continue;case 5:if(r!==40)break;i.rpcRetryTimes=t.int32();continue;case 6:if(r!==50)break;i.ethAbiDecoderConfig=Un.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{sequential:l(e.sequential)?globalThis.Boolean(e.sequential):!1,forceExactBlockTime:l(e.forceExactBlockTime)?globalThis.Boolean(e.forceExactBlockTime):!1,processBindingTimeout:l(e.processBindingTimeout)?globalThis.Number(e.processBindingTimeout):0,skipStartBlockValidation:l(e.skipStartBlockValidation)?globalThis.Boolean(e.skipStartBlockValidation):!1,rpcRetryTimes:l(e.rpcRetryTimes)?globalThis.Number(e.rpcRetryTimes):0,ethAbiDecoderConfig:l(e.ethAbiDecoderConfig)?Un.fromJSON(e.ethAbiDecoderConfig):void 0}},toJSON(e){let n={};return e.sequential!==!1&&(n.sequential=e.sequential),e.forceExactBlockTime!==!1&&(n.forceExactBlockTime=e.forceExactBlockTime),e.processBindingTimeout!==0&&(n.processBindingTimeout=Math.round(e.processBindingTimeout)),e.skipStartBlockValidation!==!1&&(n.skipStartBlockValidation=e.skipStartBlockValidation),e.rpcRetryTimes!==0&&(n.rpcRetryTimes=Math.round(e.rpcRetryTimes)),e.ethAbiDecoderConfig!==void 0&&(n.ethAbiDecoderConfig=Un.toJSON(e.ethAbiDecoderConfig)),n},create(e){return xn.fromPartial(e??{})},fromPartial(e){let n=Qo();return n.sequential=e.sequential??!1,n.forceExactBlockTime=e.forceExactBlockTime??!1,n.processBindingTimeout=e.processBindingTimeout??0,n.skipStartBlockValidation=e.skipStartBlockValidation??!1,n.rpcRetryTimes=e.rpcRetryTimes??0,n.ethAbiDecoderConfig=e.ethAbiDecoderConfig!==void 0&&e.ethAbiDecoderConfig!==null?Un.fromPartial(e.ethAbiDecoderConfig):void 0,n}};function Zo(){return{enabled:!1,workerCount:void 0,skipWhenDecodeFailed:void 0}}var Un={encode(e,n=d.default.Writer.create()){return e.enabled!==!1&&n.uint32(8).bool(e.enabled),e.workerCount!==void 0&&n.uint32(16).int32(e.workerCount),e.skipWhenDecodeFailed!==void 0&&n.uint32(24).bool(e.skipWhenDecodeFailed),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Zo();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.enabled=t.bool();continue;case 2:if(r!==16)break;i.workerCount=t.int32();continue;case 3:if(r!==24)break;i.skipWhenDecodeFailed=t.bool();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{enabled:l(e.enabled)?globalThis.Boolean(e.enabled):!1,workerCount:l(e.workerCount)?globalThis.Number(e.workerCount):void 0,skipWhenDecodeFailed:l(e.skipWhenDecodeFailed)?globalThis.Boolean(e.skipWhenDecodeFailed):void 0}},toJSON(e){let n={};return e.enabled!==!1&&(n.enabled=e.enabled),e.workerCount!==void 0&&(n.workerCount=Math.round(e.workerCount)),e.skipWhenDecodeFailed!==void 0&&(n.skipWhenDecodeFailed=e.skipWhenDecodeFailed),n},create(e){return Un.fromPartial(e??{})},fromPartial(e){let n=Zo();return n.enabled=e.enabled??!1,n.workerCount=e.workerCount??void 0,n.skipWhenDecodeFailed=e.skipWhenDecodeFailed??void 0,n}};function zo(){return{config:void 0,executionConfig:void 0,contractConfigs:[],templateInstances:[],accountConfigs:[],metricConfigs:[],eventTrackingConfigs:[],exportConfigs:[],eventLogConfigs:[],dbSchema:void 0}}var Uf={encode(e,n=d.default.Writer.create()){e.config!==void 0&&Jn.encode(e.config,n.uint32(10).fork()).ldelim(),e.executionConfig!==void 0&&xn.encode(e.executionConfig,n.uint32(74).fork()).ldelim();for(let t of e.contractConfigs)Vn.encode(t,n.uint32(18).fork()).ldelim();for(let t of e.templateInstances)De.encode(t,n.uint32(26).fork()).ldelim();for(let t of e.accountConfigs)Zn.encode(t,n.uint32(34).fork()).ldelim();for(let t of e.metricConfigs)Gn.encode(t,n.uint32(42).fork()).ldelim();for(let t of e.eventTrackingConfigs)Mn.encode(t,n.uint32(50).fork()).ldelim();for(let t of e.exportConfigs)Wn.encode(t,n.uint32(58).fork()).ldelim();for(let t of e.eventLogConfigs)qn.encode(t,n.uint32(66).fork()).ldelim();return e.dbSchema!==void 0&&Ln.encode(e.dbSchema,n.uint32(82).fork()).ldelim(),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=zo();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.config=Jn.decode(t,t.uint32());continue;case 9:if(r!==74)break;i.executionConfig=xn.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.contractConfigs.push(Vn.decode(t,t.uint32()));continue;case 3:if(r!==26)break;i.templateInstances.push(De.decode(t,t.uint32()));continue;case 4:if(r!==34)break;i.accountConfigs.push(Zn.decode(t,t.uint32()));continue;case 5:if(r!==42)break;i.metricConfigs.push(Gn.decode(t,t.uint32()));continue;case 6:if(r!==50)break;i.eventTrackingConfigs.push(Mn.decode(t,t.uint32()));continue;case 7:if(r!==58)break;i.exportConfigs.push(Wn.decode(t,t.uint32()));continue;case 8:if(r!==66)break;i.eventLogConfigs.push(qn.decode(t,t.uint32()));continue;case 10:if(r!==82)break;i.dbSchema=Ln.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{config:l(e.config)?Jn.fromJSON(e.config):void 0,executionConfig:l(e.executionConfig)?xn.fromJSON(e.executionConfig):void 0,contractConfigs:globalThis.Array.isArray(e?.contractConfigs)?e.contractConfigs.map(n=>Vn.fromJSON(n)):[],templateInstances:globalThis.Array.isArray(e?.templateInstances)?e.templateInstances.map(n=>De.fromJSON(n)):[],accountConfigs:globalThis.Array.isArray(e?.accountConfigs)?e.accountConfigs.map(n=>Zn.fromJSON(n)):[],metricConfigs:globalThis.Array.isArray(e?.metricConfigs)?e.metricConfigs.map(n=>Gn.fromJSON(n)):[],eventTrackingConfigs:globalThis.Array.isArray(e?.eventTrackingConfigs)?e.eventTrackingConfigs.map(n=>Mn.fromJSON(n)):[],exportConfigs:globalThis.Array.isArray(e?.exportConfigs)?e.exportConfigs.map(n=>Wn.fromJSON(n)):[],eventLogConfigs:globalThis.Array.isArray(e?.eventLogConfigs)?e.eventLogConfigs.map(n=>qn.fromJSON(n)):[],dbSchema:l(e.dbSchema)?Ln.fromJSON(e.dbSchema):void 0}},toJSON(e){let n={};return e.config!==void 0&&(n.config=Jn.toJSON(e.config)),e.executionConfig!==void 0&&(n.executionConfig=xn.toJSON(e.executionConfig)),e.contractConfigs?.length&&(n.contractConfigs=e.contractConfigs.map(t=>Vn.toJSON(t))),e.templateInstances?.length&&(n.templateInstances=e.templateInstances.map(t=>De.toJSON(t))),e.accountConfigs?.length&&(n.accountConfigs=e.accountConfigs.map(t=>Zn.toJSON(t))),e.metricConfigs?.length&&(n.metricConfigs=e.metricConfigs.map(t=>Gn.toJSON(t))),e.eventTrackingConfigs?.length&&(n.eventTrackingConfigs=e.eventTrackingConfigs.map(t=>Mn.toJSON(t))),e.exportConfigs?.length&&(n.exportConfigs=e.exportConfigs.map(t=>Wn.toJSON(t))),e.eventLogConfigs?.length&&(n.eventLogConfigs=e.eventLogConfigs.map(t=>qn.toJSON(t))),e.dbSchema!==void 0&&(n.dbSchema=Ln.toJSON(e.dbSchema)),n},create(e){return Uf.fromPartial(e??{})},fromPartial(e){let n=zo();return n.config=e.config!==void 0&&e.config!==null?Jn.fromPartial(e.config):void 0,n.executionConfig=e.executionConfig!==void 0&&e.executionConfig!==null?xn.fromPartial(e.executionConfig):void 0,n.contractConfigs=e.contractConfigs?.map(t=>Vn.fromPartial(t))||[],n.templateInstances=e.templateInstances?.map(t=>De.fromPartial(t))||[],n.accountConfigs=e.accountConfigs?.map(t=>Zn.fromPartial(t))||[],n.metricConfigs=e.metricConfigs?.map(t=>Gn.fromPartial(t))||[],n.eventTrackingConfigs=e.eventTrackingConfigs?.map(t=>Mn.fromPartial(t))||[],n.exportConfigs=e.exportConfigs?.map(t=>Wn.fromPartial(t))||[],n.eventLogConfigs=e.eventLogConfigs?.map(t=>qn.fromPartial(t))||[],n.dbSchema=e.dbSchema!==void 0&&e.dbSchema!==null?Ln.fromPartial(e.dbSchema):void 0,n}};function Ko(){return{contract:void 0,intervalConfigs:[],moveIntervalConfigs:[],logConfigs:[],traceConfigs:[],transactionConfig:[],moveEventConfigs:[],moveCallConfigs:[],moveResourceChangeConfigs:[],fuelTransactionConfigs:[],assetConfigs:[],fuelReceiptConfigs:[],cosmosLogConfigs:[],starknetEventConfigs:[],btcTransactionConfigs:[],instructionConfig:void 0,startBlock:BigInt("0"),endBlock:BigInt("0"),processorType:""}}var Vn={encode(e,n=d.default.Writer.create()){e.contract!==void 0&&be.encode(e.contract,n.uint32(10).fork()).ldelim();for(let t of e.intervalConfigs)ee.encode(t,n.uint32(90).fork()).ldelim();for(let t of e.moveIntervalConfigs)Be.encode(t,n.uint32(154).fork()).ldelim();for(let t of e.logConfigs)Je.encode(t,n.uint32(26).fork()).ldelim();for(let t of e.traceConfigs)zn.encode(t,n.uint32(18).fork()).ldelim();for(let t of e.transactionConfig)Kn.encode(t,n.uint32(58).fork()).ldelim();for(let t of e.moveEventConfigs)ot.encode(t,n.uint32(74).fork()).ldelim();for(let t of e.moveCallConfigs)xe.encode(t,n.uint32(82).fork()).ldelim();for(let t of e.moveResourceChangeConfigs)Ue.encode(t,n.uint32(98).fork()).ldelim();for(let t of e.fuelTransactionConfigs)ht.encode(t,n.uint32(162).fork()).ldelim();for(let t of e.assetConfigs)Xn.encode(t,n.uint32(114).fork()).ldelim();for(let t of e.fuelReceiptConfigs)$n.encode(t,n.uint32(170).fork()).ldelim();for(let t of e.cosmosLogConfigs)nt.encode(t,n.uint32(130).fork()).ldelim();for(let t of e.starknetEventConfigs)st.encode(t,n.uint32(138).fork()).ldelim();for(let t of e.btcTransactionConfigs)ft.encode(t,n.uint32(146).fork()).ldelim();if(e.instructionConfig!==void 0&&rt.encode(e.instructionConfig,n.uint32(50).fork()).ldelim(),e.startBlock!==BigInt("0")){if(BigInt.asUintN(64,e.startBlock)!==e.startBlock)throw new globalThis.Error("value provided for field message.startBlock of type uint64 too large");n.uint32(32).uint64(e.startBlock.toString())}if(e.endBlock!==BigInt("0")){if(BigInt.asUintN(64,e.endBlock)!==e.endBlock)throw new globalThis.Error("value provided for field message.endBlock of type uint64 too large");n.uint32(40).uint64(e.endBlock.toString())}return e.processorType!==""&&n.uint32(66).string(e.processorType),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Ko();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.contract=be.decode(t,t.uint32());continue;case 11:if(r!==90)break;i.intervalConfigs.push(ee.decode(t,t.uint32()));continue;case 19:if(r!==154)break;i.moveIntervalConfigs.push(Be.decode(t,t.uint32()));continue;case 3:if(r!==26)break;i.logConfigs.push(Je.decode(t,t.uint32()));continue;case 2:if(r!==18)break;i.traceConfigs.push(zn.decode(t,t.uint32()));continue;case 7:if(r!==58)break;i.transactionConfig.push(Kn.decode(t,t.uint32()));continue;case 9:if(r!==74)break;i.moveEventConfigs.push(ot.decode(t,t.uint32()));continue;case 10:if(r!==82)break;i.moveCallConfigs.push(xe.decode(t,t.uint32()));continue;case 12:if(r!==98)break;i.moveResourceChangeConfigs.push(Ue.decode(t,t.uint32()));continue;case 20:if(r!==162)break;i.fuelTransactionConfigs.push(ht.decode(t,t.uint32()));continue;case 14:if(r!==114)break;i.assetConfigs.push(Xn.decode(t,t.uint32()));continue;case 21:if(r!==170)break;i.fuelReceiptConfigs.push($n.decode(t,t.uint32()));continue;case 16:if(r!==130)break;i.cosmosLogConfigs.push(nt.decode(t,t.uint32()));continue;case 17:if(r!==138)break;i.starknetEventConfigs.push(st.decode(t,t.uint32()));continue;case 18:if(r!==146)break;i.btcTransactionConfigs.push(ft.decode(t,t.uint32()));continue;case 6:if(r!==50)break;i.instructionConfig=rt.decode(t,t.uint32());continue;case 4:if(r!==32)break;i.startBlock=On(t.uint64());continue;case 5:if(r!==40)break;i.endBlock=On(t.uint64());continue;case 8:if(r!==66)break;i.processorType=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{contract:l(e.contract)?be.fromJSON(e.contract):void 0,intervalConfigs:globalThis.Array.isArray(e?.intervalConfigs)?e.intervalConfigs.map(n=>ee.fromJSON(n)):[],moveIntervalConfigs:globalThis.Array.isArray(e?.moveIntervalConfigs)?e.moveIntervalConfigs.map(n=>Be.fromJSON(n)):[],logConfigs:globalThis.Array.isArray(e?.logConfigs)?e.logConfigs.map(n=>Je.fromJSON(n)):[],traceConfigs:globalThis.Array.isArray(e?.traceConfigs)?e.traceConfigs.map(n=>zn.fromJSON(n)):[],transactionConfig:globalThis.Array.isArray(e?.transactionConfig)?e.transactionConfig.map(n=>Kn.fromJSON(n)):[],moveEventConfigs:globalThis.Array.isArray(e?.moveEventConfigs)?e.moveEventConfigs.map(n=>ot.fromJSON(n)):[],moveCallConfigs:globalThis.Array.isArray(e?.moveCallConfigs)?e.moveCallConfigs.map(n=>xe.fromJSON(n)):[],moveResourceChangeConfigs:globalThis.Array.isArray(e?.moveResourceChangeConfigs)?e.moveResourceChangeConfigs.map(n=>Ue.fromJSON(n)):[],fuelTransactionConfigs:globalThis.Array.isArray(e?.fuelTransactionConfigs)?e.fuelTransactionConfigs.map(n=>ht.fromJSON(n)):[],assetConfigs:globalThis.Array.isArray(e?.assetConfigs)?e.assetConfigs.map(n=>Xn.fromJSON(n)):[],fuelReceiptConfigs:globalThis.Array.isArray(e?.fuelReceiptConfigs)?e.fuelReceiptConfigs.map(n=>$n.fromJSON(n)):[],cosmosLogConfigs:globalThis.Array.isArray(e?.cosmosLogConfigs)?e.cosmosLogConfigs.map(n=>nt.fromJSON(n)):[],starknetEventConfigs:globalThis.Array.isArray(e?.starknetEventConfigs)?e.starknetEventConfigs.map(n=>st.fromJSON(n)):[],btcTransactionConfigs:globalThis.Array.isArray(e?.btcTransactionConfigs)?e.btcTransactionConfigs.map(n=>ft.fromJSON(n)):[],instructionConfig:l(e.instructionConfig)?rt.fromJSON(e.instructionConfig):void 0,startBlock:l(e.startBlock)?BigInt(e.startBlock):BigInt("0"),endBlock:l(e.endBlock)?BigInt(e.endBlock):BigInt("0"),processorType:l(e.processorType)?globalThis.String(e.processorType):""}},toJSON(e){let n={};return e.contract!==void 0&&(n.contract=be.toJSON(e.contract)),e.intervalConfigs?.length&&(n.intervalConfigs=e.intervalConfigs.map(t=>ee.toJSON(t))),e.moveIntervalConfigs?.length&&(n.moveIntervalConfigs=e.moveIntervalConfigs.map(t=>Be.toJSON(t))),e.logConfigs?.length&&(n.logConfigs=e.logConfigs.map(t=>Je.toJSON(t))),e.traceConfigs?.length&&(n.traceConfigs=e.traceConfigs.map(t=>zn.toJSON(t))),e.transactionConfig?.length&&(n.transactionConfig=e.transactionConfig.map(t=>Kn.toJSON(t))),e.moveEventConfigs?.length&&(n.moveEventConfigs=e.moveEventConfigs.map(t=>ot.toJSON(t))),e.moveCallConfigs?.length&&(n.moveCallConfigs=e.moveCallConfigs.map(t=>xe.toJSON(t))),e.moveResourceChangeConfigs?.length&&(n.moveResourceChangeConfigs=e.moveResourceChangeConfigs.map(t=>Ue.toJSON(t))),e.fuelTransactionConfigs?.length&&(n.fuelTransactionConfigs=e.fuelTransactionConfigs.map(t=>ht.toJSON(t))),e.assetConfigs?.length&&(n.assetConfigs=e.assetConfigs.map(t=>Xn.toJSON(t))),e.fuelReceiptConfigs?.length&&(n.fuelReceiptConfigs=e.fuelReceiptConfigs.map(t=>$n.toJSON(t))),e.cosmosLogConfigs?.length&&(n.cosmosLogConfigs=e.cosmosLogConfigs.map(t=>nt.toJSON(t))),e.starknetEventConfigs?.length&&(n.starknetEventConfigs=e.starknetEventConfigs.map(t=>st.toJSON(t))),e.btcTransactionConfigs?.length&&(n.btcTransactionConfigs=e.btcTransactionConfigs.map(t=>ft.toJSON(t))),e.instructionConfig!==void 0&&(n.instructionConfig=rt.toJSON(e.instructionConfig)),e.startBlock!==BigInt("0")&&(n.startBlock=e.startBlock.toString()),e.endBlock!==BigInt("0")&&(n.endBlock=e.endBlock.toString()),e.processorType!==""&&(n.processorType=e.processorType),n},create(e){return Vn.fromPartial(e??{})},fromPartial(e){let n=Ko();return n.contract=e.contract!==void 0&&e.contract!==null?be.fromPartial(e.contract):void 0,n.intervalConfigs=e.intervalConfigs?.map(t=>ee.fromPartial(t))||[],n.moveIntervalConfigs=e.moveIntervalConfigs?.map(t=>Be.fromPartial(t))||[],n.logConfigs=e.logConfigs?.map(t=>Je.fromPartial(t))||[],n.traceConfigs=e.traceConfigs?.map(t=>zn.fromPartial(t))||[],n.transactionConfig=e.transactionConfig?.map(t=>Kn.fromPartial(t))||[],n.moveEventConfigs=e.moveEventConfigs?.map(t=>ot.fromPartial(t))||[],n.moveCallConfigs=e.moveCallConfigs?.map(t=>xe.fromPartial(t))||[],n.moveResourceChangeConfigs=e.moveResourceChangeConfigs?.map(t=>Ue.fromPartial(t))||[],n.fuelTransactionConfigs=e.fuelTransactionConfigs?.map(t=>ht.fromPartial(t))||[],n.assetConfigs=e.assetConfigs?.map(t=>Xn.fromPartial(t))||[],n.fuelReceiptConfigs=e.fuelReceiptConfigs?.map(t=>$n.fromPartial(t))||[],n.cosmosLogConfigs=e.cosmosLogConfigs?.map(t=>nt.fromPartial(t))||[],n.starknetEventConfigs=e.starknetEventConfigs?.map(t=>st.fromPartial(t))||[],n.btcTransactionConfigs=e.btcTransactionConfigs?.map(t=>ft.fromPartial(t))||[],n.instructionConfig=e.instructionConfig!==void 0&&e.instructionConfig!==null?rt.fromPartial(e.instructionConfig):void 0,n.startBlock=e.startBlock??BigInt("0"),n.endBlock=e.endBlock??BigInt("0"),n.processorType=e.processorType??"",n}};function Xo(){return{gqlSchema:""}}var Ln={encode(e,n=d.default.Writer.create()){return e.gqlSchema!==""&&n.uint32(10).string(e.gqlSchema),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Xo();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.gqlSchema=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{gqlSchema:l(e.gqlSchema)?globalThis.String(e.gqlSchema):""}},toJSON(e){let n={};return e.gqlSchema!==""&&(n.gqlSchema=e.gqlSchema),n},create(e){return Ln.fromPartial(e??{})},fromPartial(e){let n=Xo();return n.gqlSchema=e.gqlSchema??"",n}};function Yo(){return{}}var Fn={encode(e,n=d.default.Writer.create()){return n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Yo();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{}},toJSON(e){return{}},create(e){return Fn.fromPartial(e??{})},fromPartial(e){return Yo()}};function $o(){return{retentionEventName:"",days:0}}var wn={encode(e,n=d.default.Writer.create()){return e.retentionEventName!==""&&n.uint32(18).string(e.retentionEventName),e.days!==0&&n.uint32(24).int32(e.days),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=$o();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 2:if(r!==18)break;i.retentionEventName=t.string();continue;case 3:if(r!==24)break;i.days=t.int32();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{retentionEventName:l(e.retentionEventName)?globalThis.String(e.retentionEventName):"",days:l(e.days)?globalThis.Number(e.days):0}},toJSON(e){let n={};return e.retentionEventName!==""&&(n.retentionEventName=e.retentionEventName),e.days!==0&&(n.days=Math.round(e.days)),n},create(e){return wn.fromPartial(e??{})},fromPartial(e){let n=$o();return n.retentionEventName=e.retentionEventName??"",n.days=e.days??0,n}};function jo(){return{eventName:"",totalByDay:!1,unique:!1,totalPerEntity:void 0,distinctAggregationByDays:[],retentionConfig:void 0}}var Mn={encode(e,n=d.default.Writer.create()){e.eventName!==""&&n.uint32(10).string(e.eventName),e.totalByDay!==!1&&n.uint32(16).bool(e.totalByDay),e.unique!==!1&&n.uint32(24).bool(e.unique),e.totalPerEntity!==void 0&&Fn.encode(e.totalPerEntity,n.uint32(34).fork()).ldelim(),n.uint32(42).fork();for(let t of e.distinctAggregationByDays)n.int32(t);return n.ldelim(),e.retentionConfig!==void 0&&wn.encode(e.retentionConfig,n.uint32(50).fork()).ldelim(),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=jo();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.eventName=t.string();continue;case 2:if(r!==16)break;i.totalByDay=t.bool();continue;case 3:if(r!==24)break;i.unique=t.bool();continue;case 4:if(r!==34)break;i.totalPerEntity=Fn.decode(t,t.uint32());continue;case 5:if(r===40){i.distinctAggregationByDays.push(t.int32());continue}if(r===42){let s=t.uint32()+t.pos;for(;t.pos<s;)i.distinctAggregationByDays.push(t.int32());continue}break;case 6:if(r!==50)break;i.retentionConfig=wn.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{eventName:l(e.eventName)?globalThis.String(e.eventName):"",totalByDay:l(e.totalByDay)?globalThis.Boolean(e.totalByDay):!1,unique:l(e.unique)?globalThis.Boolean(e.unique):!1,totalPerEntity:l(e.totalPerEntity)?Fn.fromJSON(e.totalPerEntity):void 0,distinctAggregationByDays:globalThis.Array.isArray(e?.distinctAggregationByDays)?e.distinctAggregationByDays.map(n=>globalThis.Number(n)):[],retentionConfig:l(e.retentionConfig)?wn.fromJSON(e.retentionConfig):void 0}},toJSON(e){let n={};return e.eventName!==""&&(n.eventName=e.eventName),e.totalByDay!==!1&&(n.totalByDay=e.totalByDay),e.unique!==!1&&(n.unique=e.unique),e.totalPerEntity!==void 0&&(n.totalPerEntity=Fn.toJSON(e.totalPerEntity)),e.distinctAggregationByDays?.length&&(n.distinctAggregationByDays=e.distinctAggregationByDays.map(t=>Math.round(t))),e.retentionConfig!==void 0&&(n.retentionConfig=wn.toJSON(e.retentionConfig)),n},create(e){return Mn.fromPartial(e??{})},fromPartial(e){let n=jo();return n.eventName=e.eventName??"",n.totalByDay=e.totalByDay??!1,n.unique=e.unique??!1,n.totalPerEntity=e.totalPerEntity!==void 0&&e.totalPerEntity!==null?Fn.fromPartial(e.totalPerEntity):void 0,n.distinctAggregationByDays=e.distinctAggregationByDays?.map(t=>t)||[],n.retentionConfig=e.retentionConfig!==void 0&&e.retentionConfig!==null?wn.fromPartial(e.retentionConfig):void 0,n}};function eu(){return{name:"",channel:""}}var Wn={encode(e,n=d.default.Writer.create()){return e.name!==""&&n.uint32(10).string(e.name),e.channel!==""&&n.uint32(18).string(e.channel),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=eu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.name=t.string();continue;case 2:if(r!==18)break;i.channel=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{name:l(e.name)?globalThis.String(e.name):"",channel:l(e.channel)?globalThis.String(e.channel):""}},toJSON(e){let n={};return e.name!==""&&(n.name=e.name),e.channel!==""&&(n.channel=e.channel),n},create(e){return Wn.fromPartial(e??{})},fromPartial(e){let n=eu();return n.name=e.name??"",n.channel=e.channel??"",n}};function nu(){return{name:"",description:"",unit:"",sparse:!1,persistentBetweenVersion:!1,type:0,aggregationConfig:void 0}}var Gn={encode(e,n=d.default.Writer.create()){return e.name!==""&&n.uint32(10).string(e.name),e.description!==""&&n.uint32(26).string(e.description),e.unit!==""&&n.uint32(18).string(e.unit),e.sparse!==!1&&n.uint32(32).bool(e.sparse),e.persistentBetweenVersion!==!1&&n.uint32(40).bool(e.persistentBetweenVersion),e.type!==0&&n.uint32(56).int32(e.type),e.aggregationConfig!==void 0&&Qn.encode(e.aggregationConfig,n.uint32(50).fork()).ldelim(),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=nu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.name=t.string();continue;case 3:if(r!==26)break;i.description=t.string();continue;case 2:if(r!==18)break;i.unit=t.string();continue;case 4:if(r!==32)break;i.sparse=t.bool();continue;case 5:if(r!==40)break;i.persistentBetweenVersion=t.bool();continue;case 7:if(r!==56)break;i.type=t.int32();continue;case 6:if(r!==50)break;i.aggregationConfig=Qn.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{name:l(e.name)?globalThis.String(e.name):"",description:l(e.description)?globalThis.String(e.description):"",unit:l(e.unit)?globalThis.String(e.unit):"",sparse:l(e.sparse)?globalThis.Boolean(e.sparse):!1,persistentBetweenVersion:l(e.persistentBetweenVersion)?globalThis.Boolean(e.persistentBetweenVersion):!1,type:l(e.type)?Nf(e.type):0,aggregationConfig:l(e.aggregationConfig)?Qn.fromJSON(e.aggregationConfig):void 0}},toJSON(e){let n={};return e.name!==""&&(n.name=e.name),e.description!==""&&(n.description=e.description),e.unit!==""&&(n.unit=e.unit),e.sparse!==!1&&(n.sparse=e.sparse),e.persistentBetweenVersion!==!1&&(n.persistentBetweenVersion=e.persistentBetweenVersion),e.type!==0&&(n.type=Tf(e.type)),e.aggregationConfig!==void 0&&(n.aggregationConfig=Qn.toJSON(e.aggregationConfig)),n},create(e){return Gn.fromPartial(e??{})},fromPartial(e){let n=nu();return n.name=e.name??"",n.description=e.description??"",n.unit=e.unit??"",n.sparse=e.sparse??!1,n.persistentBetweenVersion=e.persistentBetweenVersion??!1,n.type=e.type??0,n.aggregationConfig=e.aggregationConfig!==void 0&&e.aggregationConfig!==null?Qn.fromPartial(e.aggregationConfig):void 0,n}};function tu(){return{name:"",fields:[]}}var qn={encode(e,n=d.default.Writer.create()){e.name!==""&&n.uint32(10).string(e.name);for(let t of e.fields)Ae.encode(t,n.uint32(18).fork()).ldelim();return n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=tu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.name=t.string();continue;case 2:if(r!==18)break;i.fields.push(Ae.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{name:l(e.name)?globalThis.String(e.name):"",fields:globalThis.Array.isArray(e?.fields)?e.fields.map(n=>Ae.fromJSON(n)):[]}},toJSON(e){let n={};return e.name!==""&&(n.name=e.name),e.fields?.length&&(n.fields=e.fields.map(t=>Ae.toJSON(t))),n},create(e){return qn.fromPartial(e??{})},fromPartial(e){let n=tu();return n.name=e.name??"",n.fields=e.fields?.map(t=>Ae.fromPartial(t))||[],n}};function ru(){return{fields:[]}}var Hn={encode(e,n=d.default.Writer.create()){for(let t of e.fields)Ae.encode(t,n.uint32(18).fork()).ldelim();return n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=ru();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 2:if(r!==18)break;i.fields.push(Ae.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{fields:globalThis.Array.isArray(e?.fields)?e.fields.map(n=>Ae.fromJSON(n)):[]}},toJSON(e){let n={};return e.fields?.length&&(n.fields=e.fields.map(t=>Ae.toJSON(t))),n},create(e){return Hn.fromPartial(e??{})},fromPartial(e){let n=ru();return n.fields=e.fields?.map(t=>Ae.fromPartial(t))||[],n}};function iu(){return{name:"",basicType:void 0,coinType:void 0,structType:void 0}}var Ae={encode(e,n=d.default.Writer.create()){return e.name!==""&&n.uint32(10).string(e.name),e.basicType!==void 0&&n.uint32(16).int32(e.basicType),e.coinType!==void 0&&ge.encode(e.coinType,n.uint32(26).fork()).ldelim(),e.structType!==void 0&&Hn.encode(e.structType,n.uint32(34).fork()).ldelim(),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=iu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.name=t.string();continue;case 2:if(r!==16)break;i.basicType=t.int32();continue;case 3:if(r!==26)break;i.coinType=ge.decode(t,t.uint32());continue;case 4:if(r!==34)break;i.structType=Hn.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{name:l(e.name)?globalThis.String(e.name):"",basicType:l(e.basicType)?bf(e.basicType):void 0,coinType:l(e.coinType)?ge.fromJSON(e.coinType):void 0,structType:l(e.structType)?Hn.fromJSON(e.structType):void 0}},toJSON(e){let n={};return e.name!==""&&(n.name=e.name),e.basicType!==void 0&&(n.basicType=Df(e.basicType)),e.coinType!==void 0&&(n.coinType=ge.toJSON(e.coinType)),e.structType!==void 0&&(n.structType=Hn.toJSON(e.structType)),n},create(e){return Ae.fromPartial(e??{})},fromPartial(e){let n=iu();return n.name=e.name??"",n.basicType=e.basicType??void 0,n.coinType=e.coinType!==void 0&&e.coinType!==null?ge.fromPartial(e.coinType):void 0,n.structType=e.structType!==void 0&&e.structType!==null?Hn.fromPartial(e.structType):void 0,n}};function au(){return{intervalInMinutes:[],types:[],discardOrigin:!1}}var Qn={encode(e,n=d.default.Writer.create()){n.uint32(10).fork();for(let t of e.intervalInMinutes)n.int32(t);n.ldelim(),n.uint32(18).fork();for(let t of e.types)n.int32(t);return n.ldelim(),e.discardOrigin!==!1&&n.uint32(24).bool(e.discardOrigin),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=au();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r===8){i.intervalInMinutes.push(t.int32());continue}if(r===10){let s=t.uint32()+t.pos;for(;t.pos<s;)i.intervalInMinutes.push(t.int32());continue}break;case 2:if(r===16){i.types.push(t.int32());continue}if(r===18){let s=t.uint32()+t.pos;for(;t.pos<s;)i.types.push(t.int32());continue}break;case 3:if(r!==24)break;i.discardOrigin=t.bool();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{intervalInMinutes:globalThis.Array.isArray(e?.intervalInMinutes)?e.intervalInMinutes.map(n=>globalThis.Number(n)):[],types:globalThis.Array.isArray(e?.types)?e.types.map(n=>Cf(n)):[],discardOrigin:l(e.discardOrigin)?globalThis.Boolean(e.discardOrigin):!1}},toJSON(e){let n={};return e.intervalInMinutes?.length&&(n.intervalInMinutes=e.intervalInMinutes.map(t=>Math.round(t))),e.types?.length&&(n.types=e.types.map(t=>If(t))),e.discardOrigin!==!1&&(n.discardOrigin=e.discardOrigin),n},create(e){return Qn.fromPartial(e??{})},fromPartial(e){let n=au();return n.intervalInMinutes=e.intervalInMinutes?.map(t=>t)||[],n.types=e.types?.map(t=>t)||[],n.discardOrigin=e.discardOrigin??!1,n}};function ou(){return{chainId:"",address:"",startBlock:BigInt("0"),endBlock:BigInt("0"),intervalConfigs:[],moveIntervalConfigs:[],moveCallConfigs:[],moveResourceChangeConfigs:[],logConfigs:[]}}var Zn={encode(e,n=d.default.Writer.create()){if(e.chainId!==""&&n.uint32(10).string(e.chainId),e.address!==""&&n.uint32(18).string(e.address),e.startBlock!==BigInt("0")){if(BigInt.asUintN(64,e.startBlock)!==e.startBlock)throw new globalThis.Error("value provided for field message.startBlock of type uint64 too large");n.uint32(24).uint64(e.startBlock.toString())}if(e.endBlock!==BigInt("0")){if(BigInt.asUintN(64,e.endBlock)!==e.endBlock)throw new globalThis.Error("value provided for field message.endBlock of type uint64 too large");n.uint32(80).uint64(e.endBlock.toString())}for(let t of e.intervalConfigs)ee.encode(t,n.uint32(34).fork()).ldelim();for(let t of e.moveIntervalConfigs)Be.encode(t,n.uint32(58).fork()).ldelim();for(let t of e.moveCallConfigs)xe.encode(t,n.uint32(66).fork()).ldelim();for(let t of e.moveResourceChangeConfigs)Ue.encode(t,n.uint32(74).fork()).ldelim();for(let t of e.logConfigs)Je.encode(t,n.uint32(50).fork()).ldelim();return n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=ou();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.chainId=t.string();continue;case 2:if(r!==18)break;i.address=t.string();continue;case 3:if(r!==24)break;i.startBlock=On(t.uint64());continue;case 10:if(r!==80)break;i.endBlock=On(t.uint64());continue;case 4:if(r!==34)break;i.intervalConfigs.push(ee.decode(t,t.uint32()));continue;case 7:if(r!==58)break;i.moveIntervalConfigs.push(Be.decode(t,t.uint32()));continue;case 8:if(r!==66)break;i.moveCallConfigs.push(xe.decode(t,t.uint32()));continue;case 9:if(r!==74)break;i.moveResourceChangeConfigs.push(Ue.decode(t,t.uint32()));continue;case 6:if(r!==50)break;i.logConfigs.push(Je.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{chainId:l(e.chainId)?globalThis.String(e.chainId):"",address:l(e.address)?globalThis.String(e.address):"",startBlock:l(e.startBlock)?BigInt(e.startBlock):BigInt("0"),endBlock:l(e.endBlock)?BigInt(e.endBlock):BigInt("0"),intervalConfigs:globalThis.Array.isArray(e?.intervalConfigs)?e.intervalConfigs.map(n=>ee.fromJSON(n)):[],moveIntervalConfigs:globalThis.Array.isArray(e?.moveIntervalConfigs)?e.moveIntervalConfigs.map(n=>Be.fromJSON(n)):[],moveCallConfigs:globalThis.Array.isArray(e?.moveCallConfigs)?e.moveCallConfigs.map(n=>xe.fromJSON(n)):[],moveResourceChangeConfigs:globalThis.Array.isArray(e?.moveResourceChangeConfigs)?e.moveResourceChangeConfigs.map(n=>Ue.fromJSON(n)):[],logConfigs:globalThis.Array.isArray(e?.logConfigs)?e.logConfigs.map(n=>Je.fromJSON(n)):[]}},toJSON(e){let n={};return e.chainId!==""&&(n.chainId=e.chainId),e.address!==""&&(n.address=e.address),e.startBlock!==BigInt("0")&&(n.startBlock=e.startBlock.toString()),e.endBlock!==BigInt("0")&&(n.endBlock=e.endBlock.toString()),e.intervalConfigs?.length&&(n.intervalConfigs=e.intervalConfigs.map(t=>ee.toJSON(t))),e.moveIntervalConfigs?.length&&(n.moveIntervalConfigs=e.moveIntervalConfigs.map(t=>Be.toJSON(t))),e.moveCallConfigs?.length&&(n.moveCallConfigs=e.moveCallConfigs.map(t=>xe.toJSON(t))),e.moveResourceChangeConfigs?.length&&(n.moveResourceChangeConfigs=e.moveResourceChangeConfigs.map(t=>Ue.toJSON(t))),e.logConfigs?.length&&(n.logConfigs=e.logConfigs.map(t=>Je.toJSON(t))),n},create(e){return Zn.fromPartial(e??{})},fromPartial(e){let n=ou();return n.chainId=e.chainId??"",n.address=e.address??"",n.startBlock=e.startBlock??BigInt("0"),n.endBlock=e.endBlock??BigInt("0"),n.intervalConfigs=e.intervalConfigs?.map(t=>ee.fromPartial(t))||[],n.moveIntervalConfigs=e.moveIntervalConfigs?.map(t=>Be.fromPartial(t))||[],n.moveCallConfigs=e.moveCallConfigs?.map(t=>xe.fromPartial(t))||[],n.moveResourceChangeConfigs=e.moveResourceChangeConfigs?.map(t=>Ue.fromPartial(t))||[],n.logConfigs=e.logConfigs?.map(t=>Je.fromPartial(t))||[],n}};function uu(){return{recentInterval:0,backfillInterval:0}}var ve={encode(e,n=d.default.Writer.create()){return e.recentInterval!==0&&n.uint32(8).int32(e.recentInterval),e.backfillInterval!==0&&n.uint32(16).int32(e.backfillInterval),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=uu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.recentInterval=t.int32();continue;case 2:if(r!==16)break;i.backfillInterval=t.int32();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{recentInterval:l(e.recentInterval)?globalThis.Number(e.recentInterval):0,backfillInterval:l(e.backfillInterval)?globalThis.Number(e.backfillInterval):0}},toJSON(e){let n={};return e.recentInterval!==0&&(n.recentInterval=Math.round(e.recentInterval)),e.backfillInterval!==0&&(n.backfillInterval=Math.round(e.backfillInterval)),n},create(e){return ve.fromPartial(e??{})},fromPartial(e){let n=uu();return n.recentInterval=e.recentInterval??0,n.backfillInterval=e.backfillInterval??0,n}};function du(){return{handlerId:0,minutes:0,minutesInterval:void 0,slot:0,slotInterval:void 0,fetchConfig:void 0,handlerName:""}}var ee={encode(e,n=d.default.Writer.create()){return e.handlerId!==0&&n.uint32(8).int32(e.handlerId),e.minutes!==0&&n.uint32(16).int32(e.minutes),e.minutesInterval!==void 0&&ve.encode(e.minutesInterval,n.uint32(34).fork()).ldelim(),e.slot!==0&&n.uint32(24).int32(e.slot),e.slotInterval!==void 0&&ve.encode(e.slotInterval,n.uint32(42).fork()).ldelim(),e.fetchConfig!==void 0&&w.encode(e.fetchConfig,n.uint32(50).fork()).ldelim(),e.handlerName!==""&&n.uint32(58).string(e.handlerName),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=du();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.handlerId=t.int32();continue;case 2:if(r!==16)break;i.minutes=t.int32();continue;case 4:if(r!==34)break;i.minutesInterval=ve.decode(t,t.uint32());continue;case 3:if(r!==24)break;i.slot=t.int32();continue;case 5:if(r!==42)break;i.slotInterval=ve.decode(t,t.uint32());continue;case 6:if(r!==50)break;i.fetchConfig=w.decode(t,t.uint32());continue;case 7:if(r!==58)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{handlerId:l(e.handlerId)?globalThis.Number(e.handlerId):0,minutes:l(e.minutes)?globalThis.Number(e.minutes):0,minutesInterval:l(e.minutesInterval)?ve.fromJSON(e.minutesInterval):void 0,slot:l(e.slot)?globalThis.Number(e.slot):0,slotInterval:l(e.slotInterval)?ve.fromJSON(e.slotInterval):void 0,fetchConfig:l(e.fetchConfig)?w.fromJSON(e.fetchConfig):void 0,handlerName:l(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.minutes!==0&&(n.minutes=Math.round(e.minutes)),e.minutesInterval!==void 0&&(n.minutesInterval=ve.toJSON(e.minutesInterval)),e.slot!==0&&(n.slot=Math.round(e.slot)),e.slotInterval!==void 0&&(n.slotInterval=ve.toJSON(e.slotInterval)),e.fetchConfig!==void 0&&(n.fetchConfig=w.toJSON(e.fetchConfig)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return ee.fromPartial(e??{})},fromPartial(e){let n=du();return n.handlerId=e.handlerId??0,n.minutes=e.minutes??0,n.minutesInterval=e.minutesInterval!==void 0&&e.minutesInterval!==null?ve.fromPartial(e.minutesInterval):void 0,n.slot=e.slot??0,n.slotInterval=e.slotInterval!==void 0&&e.slotInterval!==null?ve.fromPartial(e.slotInterval):void 0,n.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?w.fromPartial(e.fetchConfig):void 0,n.handlerName=e.handlerName??"",n}};function lu(){return{intervalConfig:void 0,type:"",ownerType:0,resourceFetchConfig:void 0,fetchConfig:void 0}}var Be={encode(e,n=d.default.Writer.create()){return e.intervalConfig!==void 0&&ee.encode(e.intervalConfig,n.uint32(10).fork()).ldelim(),e.type!==""&&n.uint32(18).string(e.type),e.ownerType!==0&&n.uint32(24).int32(e.ownerType),e.resourceFetchConfig!==void 0&&at.encode(e.resourceFetchConfig,n.uint32(34).fork()).ldelim(),e.fetchConfig!==void 0&&ne.encode(e.fetchConfig,n.uint32(42).fork()).ldelim(),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=lu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.intervalConfig=ee.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.type=t.string();continue;case 3:if(r!==24)break;i.ownerType=t.int32();continue;case 4:if(r!==34)break;i.resourceFetchConfig=at.decode(t,t.uint32());continue;case 5:if(r!==42)break;i.fetchConfig=ne.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{intervalConfig:l(e.intervalConfig)?ee.fromJSON(e.intervalConfig):void 0,type:l(e.type)?globalThis.String(e.type):"",ownerType:l(e.ownerType)?Ef(e.ownerType):0,resourceFetchConfig:l(e.resourceFetchConfig)?at.fromJSON(e.resourceFetchConfig):void 0,fetchConfig:l(e.fetchConfig)?ne.fromJSON(e.fetchConfig):void 0}},toJSON(e){let n={};return e.intervalConfig!==void 0&&(n.intervalConfig=ee.toJSON(e.intervalConfig)),e.type!==""&&(n.type=e.type),e.ownerType!==0&&(n.ownerType=Of(e.ownerType)),e.resourceFetchConfig!==void 0&&(n.resourceFetchConfig=at.toJSON(e.resourceFetchConfig)),e.fetchConfig!==void 0&&(n.fetchConfig=ne.toJSON(e.fetchConfig)),n},create(e){return Be.fromPartial(e??{})},fromPartial(e){let n=lu();return n.intervalConfig=e.intervalConfig!==void 0&&e.intervalConfig!==null?ee.fromPartial(e.intervalConfig):void 0,n.type=e.type??"",n.ownerType=e.ownerType??0,n.resourceFetchConfig=e.resourceFetchConfig!==void 0&&e.resourceFetchConfig!==null?at.fromPartial(e.resourceFetchConfig):void 0,n.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?ne.fromPartial(e.fetchConfig):void 0,n}};function su(){return{name:"",chainId:"",address:"",abi:""}}var be={encode(e,n=d.default.Writer.create()){return e.name!==""&&n.uint32(10).string(e.name),e.chainId!==""&&n.uint32(18).string(e.chainId),e.address!==""&&n.uint32(26).string(e.address),e.abi!==""&&n.uint32(34).string(e.abi),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=su();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.name=t.string();continue;case 2:if(r!==18)break;i.chainId=t.string();continue;case 3:if(r!==26)break;i.address=t.string();continue;case 4:if(r!==34)break;i.abi=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{name:l(e.name)?globalThis.String(e.name):"",chainId:l(e.chainId)?globalThis.String(e.chainId):"",address:l(e.address)?globalThis.String(e.address):"",abi:l(e.abi)?globalThis.String(e.abi):""}},toJSON(e){let n={};return e.name!==""&&(n.name=e.name),e.chainId!==""&&(n.chainId=e.chainId),e.address!==""&&(n.address=e.address),e.abi!==""&&(n.abi=e.abi),n},create(e){return be.fromPartial(e??{})},fromPartial(e){let n=su();return n.name=e.name??"",n.chainId=e.chainId??"",n.address=e.address??"",n.abi=e.abi??"",n}};function fu(){return{contract:void 0,startBlock:BigInt("0"),endBlock:BigInt("0"),templateId:0,baseLabels:void 0}}var De={encode(e,n=d.default.Writer.create()){if(e.contract!==void 0&&be.encode(e.contract,n.uint32(10).fork()).ldelim(),e.startBlock!==BigInt("0")){if(BigInt.asUintN(64,e.startBlock)!==e.startBlock)throw new globalThis.Error("value provided for field message.startBlock of type uint64 too large");n.uint32(16).uint64(e.startBlock.toString())}if(e.endBlock!==BigInt("0")){if(BigInt.asUintN(64,e.endBlock)!==e.endBlock)throw new globalThis.Error("value provided for field message.endBlock of type uint64 too large");n.uint32(24).uint64(e.endBlock.toString())}return e.templateId!==0&&n.uint32(32).int32(e.templateId),e.baseLabels!==void 0&&de.encode(de.wrap(e.baseLabels),n.uint32(42).fork()).ldelim(),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=fu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.contract=be.decode(t,t.uint32());continue;case 2:if(r!==16)break;i.startBlock=On(t.uint64());continue;case 3:if(r!==24)break;i.endBlock=On(t.uint64());continue;case 4:if(r!==32)break;i.templateId=t.int32();continue;case 5:if(r!==42)break;i.baseLabels=de.unwrap(de.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{contract:l(e.contract)?be.fromJSON(e.contract):void 0,startBlock:l(e.startBlock)?BigInt(e.startBlock):BigInt("0"),endBlock:l(e.endBlock)?BigInt(e.endBlock):BigInt("0"),templateId:l(e.templateId)?globalThis.Number(e.templateId):0,baseLabels:ci(e.baseLabels)?e.baseLabels:void 0}},toJSON(e){let n={};return e.contract!==void 0&&(n.contract=be.toJSON(e.contract)),e.startBlock!==BigInt("0")&&(n.startBlock=e.startBlock.toString()),e.endBlock!==BigInt("0")&&(n.endBlock=e.endBlock.toString()),e.templateId!==0&&(n.templateId=Math.round(e.templateId)),e.baseLabels!==void 0&&(n.baseLabels=e.baseLabels),n},create(e){return De.fromPartial(e??{})},fromPartial(e){let n=fu();return n.contract=e.contract!==void 0&&e.contract!==null?be.fromPartial(e.contract):void 0,n.startBlock=e.startBlock??BigInt("0"),n.endBlock=e.endBlock??BigInt("0"),n.templateId=e.templateId??0,n.baseLabels=e.baseLabels??void 0,n}};function cu(){return{templateInstances:[]}}var Vf={encode(e,n=d.default.Writer.create()){for(let t of e.templateInstances)De.encode(t,n.uint32(10).fork()).ldelim();return n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=cu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.templateInstances.push(De.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{templateInstances:globalThis.Array.isArray(e?.templateInstances)?e.templateInstances.map(n=>De.fromJSON(n)):[]}},toJSON(e){let n={};return e.templateInstances?.length&&(n.templateInstances=e.templateInstances.map(t=>De.toJSON(t))),n},create(e){return Vf.fromPartial(e??{})},fromPartial(e){let n=cu();return n.templateInstances=e.templateInstances?.map(t=>De.fromPartial(t))||[],n}};function pu(){return{transaction:!1,transactionReceipt:!1,transactionReceiptLogs:!1,block:!1,trace:!1}}var w={encode(e,n=d.default.Writer.create()){return e.transaction!==!1&&n.uint32(8).bool(e.transaction),e.transactionReceipt!==!1&&n.uint32(16).bool(e.transactionReceipt),e.transactionReceiptLogs!==!1&&n.uint32(40).bool(e.transactionReceiptLogs),e.block!==!1&&n.uint32(24).bool(e.block),e.trace!==!1&&n.uint32(32).bool(e.trace),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=pu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.transaction=t.bool();continue;case 2:if(r!==16)break;i.transactionReceipt=t.bool();continue;case 5:if(r!==40)break;i.transactionReceiptLogs=t.bool();continue;case 3:if(r!==24)break;i.block=t.bool();continue;case 4:if(r!==32)break;i.trace=t.bool();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{transaction:l(e.transaction)?globalThis.Boolean(e.transaction):!1,transactionReceipt:l(e.transactionReceipt)?globalThis.Boolean(e.transactionReceipt):!1,transactionReceiptLogs:l(e.transactionReceiptLogs)?globalThis.Boolean(e.transactionReceiptLogs):!1,block:l(e.block)?globalThis.Boolean(e.block):!1,trace:l(e.trace)?globalThis.Boolean(e.trace):!1}},toJSON(e){let n={};return e.transaction!==!1&&(n.transaction=e.transaction),e.transactionReceipt!==!1&&(n.transactionReceipt=e.transactionReceipt),e.transactionReceiptLogs!==!1&&(n.transactionReceiptLogs=e.transactionReceiptLogs),e.block!==!1&&(n.block=e.block),e.trace!==!1&&(n.trace=e.trace),n},create(e){return w.fromPartial(e??{})},fromPartial(e){let n=pu();return n.transaction=e.transaction??!1,n.transactionReceipt=e.transactionReceipt??!1,n.transactionReceiptLogs=e.transactionReceiptLogs??!1,n.block=e.block??!1,n.trace=e.trace??!1,n}};function gu(){return{signature:"",handlerId:0,fetchConfig:void 0,handlerName:""}}var zn={encode(e,n=d.default.Writer.create()){return e.signature!==""&&n.uint32(10).string(e.signature),e.handlerId!==0&&n.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&w.encode(e.fetchConfig,n.uint32(26).fork()).ldelim(),e.handlerName!==""&&n.uint32(34).string(e.handlerName),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=gu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.signature=t.string();continue;case 2:if(r!==16)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.fetchConfig=w.decode(t,t.uint32());continue;case 4:if(r!==34)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{signature:l(e.signature)?globalThis.String(e.signature):"",handlerId:l(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:l(e.fetchConfig)?w.fromJSON(e.fetchConfig):void 0,handlerName:l(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.signature!==""&&(n.signature=e.signature),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(n.fetchConfig=w.toJSON(e.fetchConfig)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return zn.fromPartial(e??{})},fromPartial(e){let n=gu();return n.signature=e.signature??"",n.handlerId=e.handlerId??0,n.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?w.fromPartial(e.fetchConfig):void 0,n.handlerName=e.handlerName??"",n}};function hu(){return{handlerId:0,fetchConfig:void 0,handlerName:""}}var Kn={encode(e,n=d.default.Writer.create()){return e.handlerId!==0&&n.uint32(8).int32(e.handlerId),e.fetchConfig!==void 0&&w.encode(e.fetchConfig,n.uint32(26).fork()).ldelim(),e.handlerName!==""&&n.uint32(34).string(e.handlerName),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=hu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.fetchConfig=w.decode(t,t.uint32());continue;case 4:if(r!==34)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{handlerId:l(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:l(e.fetchConfig)?w.fromJSON(e.fetchConfig):void 0,handlerName:l(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(n.fetchConfig=w.toJSON(e.fetchConfig)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return Kn.fromPartial(e??{})},fromPartial(e){let n=hu();return n.handlerId=e.handlerId??0,n.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?w.fromPartial(e.fetchConfig):void 0,n.handlerName=e.handlerName??"",n}};function mu(){return{filters:[],handlerId:0,fetchConfig:void 0,handlerName:""}}var Je={encode(e,n=d.default.Writer.create()){for(let t of e.filters)tt.encode(t,n.uint32(10).fork()).ldelim();return e.handlerId!==0&&n.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&w.encode(e.fetchConfig,n.uint32(26).fork()).ldelim(),e.handlerName!==""&&n.uint32(34).string(e.handlerName),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=mu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.filters.push(tt.decode(t,t.uint32()));continue;case 2:if(r!==16)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.fetchConfig=w.decode(t,t.uint32());continue;case 4:if(r!==34)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(n=>tt.fromJSON(n)):[],handlerId:l(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:l(e.fetchConfig)?w.fromJSON(e.fetchConfig):void 0,handlerName:l(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.filters?.length&&(n.filters=e.filters.map(t=>tt.toJSON(t))),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(n.fetchConfig=w.toJSON(e.fetchConfig)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return Je.fromPartial(e??{})},fromPartial(e){let n=mu();return n.filters=e.filters?.map(t=>tt.fromPartial(t))||[],n.handlerId=e.handlerId??0,n.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?w.fromPartial(e.fetchConfig):void 0,n.handlerName=e.handlerName??"",n}};function yu(){return{filters:[],handlerId:0,handlerName:""}}var Xn={encode(e,n=d.default.Writer.create()){for(let t of e.filters)Yn.encode(t,n.uint32(10).fork()).ldelim();return e.handlerId!==0&&n.uint32(16).int32(e.handlerId),e.handlerName!==""&&n.uint32(26).string(e.handlerName),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=yu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.filters.push(Yn.decode(t,t.uint32()));continue;case 2:if(r!==16)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(n=>Yn.fromJSON(n)):[],handlerId:l(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:l(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.filters?.length&&(n.filters=e.filters.map(t=>Yn.toJSON(t))),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return Xn.fromPartial(e??{})},fromPartial(e){let n=yu();return n.filters=e.filters?.map(t=>Yn.fromPartial(t))||[],n.handlerId=e.handlerId??0,n.handlerName=e.handlerName??"",n}};function ku(){return{assetId:void 0,fromAddress:void 0,toAddress:void 0}}var Yn={encode(e,n=d.default.Writer.create()){return e.assetId!==void 0&&n.uint32(10).string(e.assetId),e.fromAddress!==void 0&&n.uint32(18).string(e.fromAddress),e.toAddress!==void 0&&n.uint32(26).string(e.toAddress),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=ku();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.assetId=t.string();continue;case 2:if(r!==18)break;i.fromAddress=t.string();continue;case 3:if(r!==26)break;i.toAddress=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{assetId:l(e.assetId)?globalThis.String(e.assetId):void 0,fromAddress:l(e.fromAddress)?globalThis.String(e.fromAddress):void 0,toAddress:l(e.toAddress)?globalThis.String(e.toAddress):void 0}},toJSON(e){let n={};return e.assetId!==void 0&&(n.assetId=e.assetId),e.fromAddress!==void 0&&(n.fromAddress=e.fromAddress),e.toAddress!==void 0&&(n.toAddress=e.toAddress),n},create(e){return Yn.fromPartial(e??{})},fromPartial(e){let n=ku();return n.assetId=e.assetId??void 0,n.fromAddress=e.fromAddress??void 0,n.toAddress=e.toAddress??void 0,n}};function Su(){return{log:void 0,transfer:void 0,handlerId:0,handlerName:""}}var $n={encode(e,n=d.default.Writer.create()){return e.log!==void 0&&et.encode(e.log,n.uint32(10).fork()).ldelim(),e.transfer!==void 0&&jn.encode(e.transfer,n.uint32(18).fork()).ldelim(),e.handlerId!==0&&n.uint32(24).int32(e.handlerId),e.handlerName!==""&&n.uint32(34).string(e.handlerName),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Su();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.log=et.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.transfer=jn.decode(t,t.uint32());continue;case 3:if(r!==24)break;i.handlerId=t.int32();continue;case 4:if(r!==34)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{log:l(e.log)?et.fromJSON(e.log):void 0,transfer:l(e.transfer)?jn.fromJSON(e.transfer):void 0,handlerId:l(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:l(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.log!==void 0&&(n.log=et.toJSON(e.log)),e.transfer!==void 0&&(n.transfer=jn.toJSON(e.transfer)),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return $n.fromPartial(e??{})},fromPartial(e){let n=Su();return n.log=e.log!==void 0&&e.log!==null?et.fromPartial(e.log):void 0,n.transfer=e.transfer!==void 0&&e.transfer!==null?jn.fromPartial(e.transfer):void 0,n.handlerId=e.handlerId??0,n.handlerName=e.handlerName??"",n}};function Nu(){return{assetId:"",from:"",to:""}}var jn={encode(e,n=d.default.Writer.create()){return e.assetId!==""&&n.uint32(34).string(e.assetId),e.from!==""&&n.uint32(10).string(e.from),e.to!==""&&n.uint32(18).string(e.to),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Nu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 4:if(r!==34)break;i.assetId=t.string();continue;case 1:if(r!==10)break;i.from=t.string();continue;case 2:if(r!==18)break;i.to=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{assetId:l(e.assetId)?globalThis.String(e.assetId):"",from:l(e.from)?globalThis.String(e.from):"",to:l(e.to)?globalThis.String(e.to):""}},toJSON(e){let n={};return e.assetId!==""&&(n.assetId=e.assetId),e.from!==""&&(n.from=e.from),e.to!==""&&(n.to=e.to),n},create(e){return jn.fromPartial(e??{})},fromPartial(e){let n=Nu();return n.assetId=e.assetId??"",n.from=e.from??"",n.to=e.to??"",n}};function Tu(){return{logIds:[]}}var et={encode(e,n=d.default.Writer.create()){for(let t of e.logIds)n.uint32(10).string(t);return n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Tu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.logIds.push(t.string());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{logIds:globalThis.Array.isArray(e?.logIds)?e.logIds.map(n=>globalThis.String(n)):[]}},toJSON(e){let n={};return e.logIds?.length&&(n.logIds=e.logIds),n},create(e){return et.fromPartial(e??{})},fromPartial(e){let n=Tu();return n.logIds=e.logIds?.map(t=>t)||[],n}};function Cu(){return{logFilters:[],handlerId:0,handlerName:""}}var nt={encode(e,n=d.default.Writer.create()){for(let t of e.logFilters)n.uint32(10).string(t);return e.handlerId!==0&&n.uint32(16).int32(e.handlerId),e.handlerName!==""&&n.uint32(26).string(e.handlerName),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Cu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.logFilters.push(t.string());continue;case 2:if(r!==16)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{logFilters:globalThis.Array.isArray(e?.logFilters)?e.logFilters.map(n=>globalThis.String(n)):[],handlerId:l(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:l(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.logFilters?.length&&(n.logFilters=e.logFilters),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return nt.fromPartial(e??{})},fromPartial(e){let n=Cu();return n.logFilters=e.logFilters?.map(t=>t)||[],n.handlerId=e.handlerId??0,n.handlerName=e.handlerName??"",n}};function Iu(){return{topics:[],address:void 0,addressType:void 0}}var tt={encode(e,n=d.default.Writer.create()){for(let t of e.topics)mt.encode(t,n.uint32(10).fork()).ldelim();return e.address!==void 0&&n.uint32(18).string(e.address),e.addressType!==void 0&&n.uint32(24).int32(e.addressType),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Iu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.topics.push(mt.decode(t,t.uint32()));continue;case 2:if(r!==18)break;i.address=t.string();continue;case 3:if(r!==24)break;i.addressType=t.int32();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{topics:globalThis.Array.isArray(e?.topics)?e.topics.map(n=>mt.fromJSON(n)):[],address:l(e.address)?globalThis.String(e.address):void 0,addressType:l(e.addressType)?Rf(e.addressType):void 0}},toJSON(e){let n={};return e.topics?.length&&(n.topics=e.topics.map(t=>mt.toJSON(t))),e.address!==void 0&&(n.address=e.address),e.addressType!==void 0&&(n.addressType=Pf(e.addressType)),n},create(e){return tt.fromPartial(e??{})},fromPartial(e){let n=Iu();return n.topics=e.topics?.map(t=>mt.fromPartial(t))||[],n.address=e.address??void 0,n.addressType=e.addressType??void 0,n}};function Eu(){return{innerInstruction:!1,parsedInstruction:!1,rawDataInstruction:!1}}var rt={encode(e,n=d.default.Writer.create()){return e.innerInstruction!==!1&&n.uint32(8).bool(e.innerInstruction),e.parsedInstruction!==!1&&n.uint32(16).bool(e.parsedInstruction),e.rawDataInstruction!==!1&&n.uint32(24).bool(e.rawDataInstruction),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Eu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.innerInstruction=t.bool();continue;case 2:if(r!==16)break;i.parsedInstruction=t.bool();continue;case 3:if(r!==24)break;i.rawDataInstruction=t.bool();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{innerInstruction:l(e.innerInstruction)?globalThis.Boolean(e.innerInstruction):!1,parsedInstruction:l(e.parsedInstruction)?globalThis.Boolean(e.parsedInstruction):!1,rawDataInstruction:l(e.rawDataInstruction)?globalThis.Boolean(e.rawDataInstruction):!1}},toJSON(e){let n={};return e.innerInstruction!==!1&&(n.innerInstruction=e.innerInstruction),e.parsedInstruction!==!1&&(n.parsedInstruction=e.parsedInstruction),e.rawDataInstruction!==!1&&(n.rawDataInstruction=e.rawDataInstruction),n},create(e){return rt.fromPartial(e??{})},fromPartial(e){let n=Eu();return n.innerInstruction=e.innerInstruction??!1,n.parsedInstruction=e.parsedInstruction??!1,n.rawDataInstruction=e.rawDataInstruction??!1,n}};function Ou(){return{moveTypePrefix:""}}var it={encode(e,n=d.default.Writer.create()){return e.moveTypePrefix!==""&&n.uint32(10).string(e.moveTypePrefix),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Ou();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.moveTypePrefix=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{moveTypePrefix:l(e.moveTypePrefix)?globalThis.String(e.moveTypePrefix):""}},toJSON(e){let n={};return e.moveTypePrefix!==""&&(n.moveTypePrefix=e.moveTypePrefix),n},create(e){return it.fromPartial(e??{})},fromPartial(e){let n=Ou();return n.moveTypePrefix=e.moveTypePrefix??"",n}};function Ru(){return{resourceChanges:!1,allEvents:!1,inputs:!1,resourceConfig:void 0,supportMultisigFunc:void 0,includeFailedTransaction:void 0}}var ne={encode(e,n=d.default.Writer.create()){return e.resourceChanges!==!1&&n.uint32(8).bool(e.resourceChanges),e.allEvents!==!1&&n.uint32(16).bool(e.allEvents),e.inputs!==!1&&n.uint32(32).bool(e.inputs),e.resourceConfig!==void 0&&it.encode(e.resourceConfig,n.uint32(26).fork()).ldelim(),e.supportMultisigFunc!==void 0&&n.uint32(40).bool(e.supportMultisigFunc),e.includeFailedTransaction!==void 0&&n.uint32(48).bool(e.includeFailedTransaction),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Ru();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.resourceChanges=t.bool();continue;case 2:if(r!==16)break;i.allEvents=t.bool();continue;case 4:if(r!==32)break;i.inputs=t.bool();continue;case 3:if(r!==26)break;i.resourceConfig=it.decode(t,t.uint32());continue;case 5:if(r!==40)break;i.supportMultisigFunc=t.bool();continue;case 6:if(r!==48)break;i.includeFailedTransaction=t.bool();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{resourceChanges:l(e.resourceChanges)?globalThis.Boolean(e.resourceChanges):!1,allEvents:l(e.allEvents)?globalThis.Boolean(e.allEvents):!1,inputs:l(e.inputs)?globalThis.Boolean(e.inputs):!1,resourceConfig:l(e.resourceConfig)?it.fromJSON(e.resourceConfig):void 0,supportMultisigFunc:l(e.supportMultisigFunc)?globalThis.Boolean(e.supportMultisigFunc):void 0,includeFailedTransaction:l(e.includeFailedTransaction)?globalThis.Boolean(e.includeFailedTransaction):void 0}},toJSON(e){let n={};return e.resourceChanges!==!1&&(n.resourceChanges=e.resourceChanges),e.allEvents!==!1&&(n.allEvents=e.allEvents),e.inputs!==!1&&(n.inputs=e.inputs),e.resourceConfig!==void 0&&(n.resourceConfig=it.toJSON(e.resourceConfig)),e.supportMultisigFunc!==void 0&&(n.supportMultisigFunc=e.supportMultisigFunc),e.includeFailedTransaction!==void 0&&(n.includeFailedTransaction=e.includeFailedTransaction),n},create(e){return ne.fromPartial(e??{})},fromPartial(e){let n=Ru();return n.resourceChanges=e.resourceChanges??!1,n.allEvents=e.allEvents??!1,n.inputs=e.inputs??!1,n.resourceConfig=e.resourceConfig!==void 0&&e.resourceConfig!==null?it.fromPartial(e.resourceConfig):void 0,n.supportMultisigFunc=e.supportMultisigFunc??void 0,n.includeFailedTransaction=e.includeFailedTransaction??void 0,n}};function Pu(){return{owned:!1}}var at={encode(e,n=d.default.Writer.create()){return e.owned!==!1&&n.uint32(8).bool(e.owned),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Pu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.owned=t.bool();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{owned:l(e.owned)?globalThis.Boolean(e.owned):!1}},toJSON(e){let n={};return e.owned!==!1&&(n.owned=e.owned),n},create(e){return at.fromPartial(e??{})},fromPartial(e){let n=Pu();return n.owned=e.owned??!1,n}};function _u(){return{filters:[],handlerId:0,fetchConfig:void 0,handlerName:""}}var ot={encode(e,n=d.default.Writer.create()){for(let t of e.filters)ut.encode(t,n.uint32(10).fork()).ldelim();return e.handlerId!==0&&n.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&ne.encode(e.fetchConfig,n.uint32(26).fork()).ldelim(),e.handlerName!==""&&n.uint32(34).string(e.handlerName),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=_u();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.filters.push(ut.decode(t,t.uint32()));continue;case 2:if(r!==16)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.fetchConfig=ne.decode(t,t.uint32());continue;case 4:if(r!==34)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(n=>ut.fromJSON(n)):[],handlerId:l(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:l(e.fetchConfig)?ne.fromJSON(e.fetchConfig):void 0,handlerName:l(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.filters?.length&&(n.filters=e.filters.map(t=>ut.toJSON(t))),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(n.fetchConfig=ne.toJSON(e.fetchConfig)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return ot.fromPartial(e??{})},fromPartial(e){let n=_u();return n.filters=e.filters?.map(t=>ut.fromPartial(t))||[],n.handlerId=e.handlerId??0,n.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?ne.fromPartial(e.fetchConfig):void 0,n.handlerName=e.handlerName??"",n}};function vu(){return{type:"",account:"",eventAccount:""}}var ut={encode(e,n=d.default.Writer.create()){return e.type!==""&&n.uint32(10).string(e.type),e.account!==""&&n.uint32(18).string(e.account),e.eventAccount!==""&&n.uint32(26).string(e.eventAccount),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=vu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.type=t.string();continue;case 2:if(r!==18)break;i.account=t.string();continue;case 3:if(r!==26)break;i.eventAccount=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{type:l(e.type)?globalThis.String(e.type):"",account:l(e.account)?globalThis.String(e.account):"",eventAccount:l(e.eventAccount)?globalThis.String(e.eventAccount):""}},toJSON(e){let n={};return e.type!==""&&(n.type=e.type),e.account!==""&&(n.account=e.account),e.eventAccount!==""&&(n.eventAccount=e.eventAccount),n},create(e){return ut.fromPartial(e??{})},fromPartial(e){let n=vu();return n.type=e.type??"",n.account=e.account??"",n.eventAccount=e.eventAccount??"",n}};function Au(){return{filters:[],handlerId:0,fetchConfig:void 0,handlerName:""}}var xe={encode(e,n=d.default.Writer.create()){for(let t of e.filters)dt.encode(t,n.uint32(10).fork()).ldelim();return e.handlerId!==0&&n.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&ne.encode(e.fetchConfig,n.uint32(26).fork()).ldelim(),e.handlerName!==""&&n.uint32(34).string(e.handlerName),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Au();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.filters.push(dt.decode(t,t.uint32()));continue;case 2:if(r!==16)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.fetchConfig=ne.decode(t,t.uint32());continue;case 4:if(r!==34)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(n=>dt.fromJSON(n)):[],handlerId:l(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:l(e.fetchConfig)?ne.fromJSON(e.fetchConfig):void 0,handlerName:l(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.filters?.length&&(n.filters=e.filters.map(t=>dt.toJSON(t))),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(n.fetchConfig=ne.toJSON(e.fetchConfig)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return xe.fromPartial(e??{})},fromPartial(e){let n=Au();return n.filters=e.filters?.map(t=>dt.fromPartial(t))||[],n.handlerId=e.handlerId??0,n.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?ne.fromPartial(e.fetchConfig):void 0,n.handlerName=e.handlerName??"",n}};function Bu(){return{type:"",includeDeleted:!1,handlerId:0,handlerName:""}}var Ue={encode(e,n=d.default.Writer.create()){return e.type!==""&&n.uint32(10).string(e.type),e.includeDeleted!==!1&&n.uint32(32).bool(e.includeDeleted),e.handlerId!==0&&n.uint32(16).int32(e.handlerId),e.handlerName!==""&&n.uint32(26).string(e.handlerName),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Bu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.type=t.string();continue;case 4:if(r!==32)break;i.includeDeleted=t.bool();continue;case 2:if(r!==16)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{type:l(e.type)?globalThis.String(e.type):"",includeDeleted:l(e.includeDeleted)?globalThis.Boolean(e.includeDeleted):!1,handlerId:l(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:l(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.type!==""&&(n.type=e.type),e.includeDeleted!==!1&&(n.includeDeleted=e.includeDeleted),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return Ue.fromPartial(e??{})},fromPartial(e){let n=Bu();return n.type=e.type??"",n.includeDeleted=e.includeDeleted??!1,n.handlerId=e.handlerId??0,n.handlerName=e.handlerName??"",n}};function bu(){return{function:"",typeArguments:[],withTypeArguments:!1,includeFailed:!1,publicKeyPrefix:"",fromAndToAddress:void 0}}var dt={encode(e,n=d.default.Writer.create()){e.function!==""&&n.uint32(10).string(e.function);for(let t of e.typeArguments)n.uint32(18).string(t);return e.withTypeArguments!==!1&&n.uint32(24).bool(e.withTypeArguments),e.includeFailed!==!1&&n.uint32(32).bool(e.includeFailed),e.publicKeyPrefix!==""&&n.uint32(42).string(e.publicKeyPrefix),e.fromAndToAddress!==void 0&&lt.encode(e.fromAndToAddress,n.uint32(50).fork()).ldelim(),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=bu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.function=t.string();continue;case 2:if(r!==18)break;i.typeArguments.push(t.string());continue;case 3:if(r!==24)break;i.withTypeArguments=t.bool();continue;case 4:if(r!==32)break;i.includeFailed=t.bool();continue;case 5:if(r!==42)break;i.publicKeyPrefix=t.string();continue;case 6:if(r!==50)break;i.fromAndToAddress=lt.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{function:l(e.function)?globalThis.String(e.function):"",typeArguments:globalThis.Array.isArray(e?.typeArguments)?e.typeArguments.map(n=>globalThis.String(n)):[],withTypeArguments:l(e.withTypeArguments)?globalThis.Boolean(e.withTypeArguments):!1,includeFailed:l(e.includeFailed)?globalThis.Boolean(e.includeFailed):!1,publicKeyPrefix:l(e.publicKeyPrefix)?globalThis.String(e.publicKeyPrefix):"",fromAndToAddress:l(e.fromAndToAddress)?lt.fromJSON(e.fromAndToAddress):void 0}},toJSON(e){let n={};return e.function!==""&&(n.function=e.function),e.typeArguments?.length&&(n.typeArguments=e.typeArguments),e.withTypeArguments!==!1&&(n.withTypeArguments=e.withTypeArguments),e.includeFailed!==!1&&(n.includeFailed=e.includeFailed),e.publicKeyPrefix!==""&&(n.publicKeyPrefix=e.publicKeyPrefix),e.fromAndToAddress!==void 0&&(n.fromAndToAddress=lt.toJSON(e.fromAndToAddress)),n},create(e){return dt.fromPartial(e??{})},fromPartial(e){let n=bu();return n.function=e.function??"",n.typeArguments=e.typeArguments?.map(t=>t)||[],n.withTypeArguments=e.withTypeArguments??!1,n.includeFailed=e.includeFailed??!1,n.publicKeyPrefix=e.publicKeyPrefix??"",n.fromAndToAddress=e.fromAndToAddress!==void 0&&e.fromAndToAddress!==null?lt.fromPartial(e.fromAndToAddress):void 0,n}};function Du(){return{from:"",to:""}}var lt={encode(e,n=d.default.Writer.create()){return e.from!==""&&n.uint32(10).string(e.from),e.to!==""&&n.uint32(18).string(e.to),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Du();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.from=t.string();continue;case 2:if(r!==18)break;i.to=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{from:l(e.from)?globalThis.String(e.from):"",to:l(e.to)?globalThis.String(e.to):""}},toJSON(e){let n={};return e.from!==""&&(n.from=e.from),e.to!==""&&(n.to=e.to),n},create(e){return lt.fromPartial(e??{})},fromPartial(e){let n=Du();return n.from=e.from??"",n.to=e.to??"",n}};function Ju(){return{filters:[],handlerId:0,handlerName:""}}var st={encode(e,n=d.default.Writer.create()){for(let t of e.filters)gt.encode(t,n.uint32(10).fork()).ldelim();return e.handlerId!==0&&n.uint32(16).int32(e.handlerId),e.handlerName!==""&&n.uint32(26).string(e.handlerName),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Ju();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.filters.push(gt.decode(t,t.uint32()));continue;case 2:if(r!==16)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(n=>gt.fromJSON(n)):[],handlerId:l(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:l(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.filters?.length&&(n.filters=e.filters.map(t=>gt.toJSON(t))),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return st.fromPartial(e??{})},fromPartial(e){let n=Ju();return n.filters=e.filters?.map(t=>gt.fromPartial(t))||[],n.handlerId=e.handlerId??0,n.handlerName=e.handlerName??"",n}};function xu(){return{filters:[],handlerId:0,handlerName:""}}var ft={encode(e,n=d.default.Writer.create()){for(let t of e.filters)Ve.encode(t,n.uint32(10).fork()).ldelim();return e.handlerId!==0&&n.uint32(16).int32(e.handlerId),e.handlerName!==""&&n.uint32(26).string(e.handlerName),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=xu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.filters.push(Ve.decode(t,t.uint32()));continue;case 2:if(r!==16)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(n=>Ve.fromJSON(n)):[],handlerId:l(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:l(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.filters?.length&&(n.filters=e.filters.map(t=>Ve.toJSON(t))),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return ft.fromPartial(e??{})},fromPartial(e){let n=xu();return n.filters=e.filters?.map(t=>Ve.fromPartial(t))||[],n.handlerId=e.handlerId??0,n.handlerName=e.handlerName??"",n}};function Uu(){return{inputFilter:void 0,outputFilter:void 0,filter:[]}}var Ve={encode(e,n=d.default.Writer.create()){e.inputFilter!==void 0&&ct.encode(e.inputFilter,n.uint32(10).fork()).ldelim(),e.outputFilter!==void 0&&pt.encode(e.outputFilter,n.uint32(18).fork()).ldelim();for(let t of e.filter)te.encode(t,n.uint32(26).fork()).ldelim();return n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Uu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.inputFilter=ct.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.outputFilter=pt.decode(t,t.uint32());continue;case 3:if(r!==26)break;i.filter.push(te.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{inputFilter:l(e.inputFilter)?ct.fromJSON(e.inputFilter):void 0,outputFilter:l(e.outputFilter)?pt.fromJSON(e.outputFilter):void 0,filter:globalThis.Array.isArray(e?.filter)?e.filter.map(n=>te.fromJSON(n)):[]}},toJSON(e){let n={};return e.inputFilter!==void 0&&(n.inputFilter=ct.toJSON(e.inputFilter)),e.outputFilter!==void 0&&(n.outputFilter=pt.toJSON(e.outputFilter)),e.filter?.length&&(n.filter=e.filter.map(t=>te.toJSON(t))),n},create(e){return Ve.fromPartial(e??{})},fromPartial(e){let n=Uu();return n.inputFilter=e.inputFilter!==void 0&&e.inputFilter!==null?ct.fromPartial(e.inputFilter):void 0,n.outputFilter=e.outputFilter!==void 0&&e.outputFilter!==null?pt.fromPartial(e.outputFilter):void 0,n.filter=e.filter?.map(t=>te.fromPartial(t))||[],n}};function Vu(){return{eq:void 0,gt:void 0,gte:void 0,lt:void 0,lte:void 0,ne:void 0,prefix:void 0,contains:void 0,notContains:void 0,lengthEq:void 0,lengthGt:void 0,lengthLt:void 0,hasAny:void 0,hasAll:void 0,in:void 0}}var ln={encode(e,n=d.default.Writer.create()){return e.eq!==void 0&&S.encode(e.eq,n.uint32(10).fork()).ldelim(),e.gt!==void 0&&S.encode(e.gt,n.uint32(18).fork()).ldelim(),e.gte!==void 0&&S.encode(e.gte,n.uint32(26).fork()).ldelim(),e.lt!==void 0&&S.encode(e.lt,n.uint32(34).fork()).ldelim(),e.lte!==void 0&&S.encode(e.lte,n.uint32(42).fork()).ldelim(),e.ne!==void 0&&S.encode(e.ne,n.uint32(50).fork()).ldelim(),e.prefix!==void 0&&n.uint32(58).string(e.prefix),e.contains!==void 0&&n.uint32(66).string(e.contains),e.notContains!==void 0&&n.uint32(74).string(e.notContains),e.lengthEq!==void 0&&n.uint32(80).int32(e.lengthEq),e.lengthGt!==void 0&&n.uint32(88).int32(e.lengthGt),e.lengthLt!==void 0&&n.uint32(96).int32(e.lengthLt),e.hasAny!==void 0&&L.encode(e.hasAny,n.uint32(106).fork()).ldelim(),e.hasAll!==void 0&&L.encode(e.hasAll,n.uint32(114).fork()).ldelim(),e.in!==void 0&&L.encode(e.in,n.uint32(122).fork()).ldelim(),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Vu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.eq=S.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.gt=S.decode(t,t.uint32());continue;case 3:if(r!==26)break;i.gte=S.decode(t,t.uint32());continue;case 4:if(r!==34)break;i.lt=S.decode(t,t.uint32());continue;case 5:if(r!==42)break;i.lte=S.decode(t,t.uint32());continue;case 6:if(r!==50)break;i.ne=S.decode(t,t.uint32());continue;case 7:if(r!==58)break;i.prefix=t.string();continue;case 8:if(r!==66)break;i.contains=t.string();continue;case 9:if(r!==74)break;i.notContains=t.string();continue;case 10:if(r!==80)break;i.lengthEq=t.int32();continue;case 11:if(r!==88)break;i.lengthGt=t.int32();continue;case 12:if(r!==96)break;i.lengthLt=t.int32();continue;case 13:if(r!==106)break;i.hasAny=L.decode(t,t.uint32());continue;case 14:if(r!==114)break;i.hasAll=L.decode(t,t.uint32());continue;case 15:if(r!==122)break;i.in=L.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{eq:l(e.eq)?S.fromJSON(e.eq):void 0,gt:l(e.gt)?S.fromJSON(e.gt):void 0,gte:l(e.gte)?S.fromJSON(e.gte):void 0,lt:l(e.lt)?S.fromJSON(e.lt):void 0,lte:l(e.lte)?S.fromJSON(e.lte):void 0,ne:l(e.ne)?S.fromJSON(e.ne):void 0,prefix:l(e.prefix)?globalThis.String(e.prefix):void 0,contains:l(e.contains)?globalThis.String(e.contains):void 0,notContains:l(e.notContains)?globalThis.String(e.notContains):void 0,lengthEq:l(e.lengthEq)?globalThis.Number(e.lengthEq):void 0,lengthGt:l(e.lengthGt)?globalThis.Number(e.lengthGt):void 0,lengthLt:l(e.lengthLt)?globalThis.Number(e.lengthLt):void 0,hasAny:l(e.hasAny)?L.fromJSON(e.hasAny):void 0,hasAll:l(e.hasAll)?L.fromJSON(e.hasAll):void 0,in:l(e.in)?L.fromJSON(e.in):void 0}},toJSON(e){let n={};return e.eq!==void 0&&(n.eq=S.toJSON(e.eq)),e.gt!==void 0&&(n.gt=S.toJSON(e.gt)),e.gte!==void 0&&(n.gte=S.toJSON(e.gte)),e.lt!==void 0&&(n.lt=S.toJSON(e.lt)),e.lte!==void 0&&(n.lte=S.toJSON(e.lte)),e.ne!==void 0&&(n.ne=S.toJSON(e.ne)),e.prefix!==void 0&&(n.prefix=e.prefix),e.contains!==void 0&&(n.contains=e.contains),e.notContains!==void 0&&(n.notContains=e.notContains),e.lengthEq!==void 0&&(n.lengthEq=Math.round(e.lengthEq)),e.lengthGt!==void 0&&(n.lengthGt=Math.round(e.lengthGt)),e.lengthLt!==void 0&&(n.lengthLt=Math.round(e.lengthLt)),e.hasAny!==void 0&&(n.hasAny=L.toJSON(e.hasAny)),e.hasAll!==void 0&&(n.hasAll=L.toJSON(e.hasAll)),e.in!==void 0&&(n.in=L.toJSON(e.in)),n},create(e){return ln.fromPartial(e??{})},fromPartial(e){let n=Vu();return n.eq=e.eq!==void 0&&e.eq!==null?S.fromPartial(e.eq):void 0,n.gt=e.gt!==void 0&&e.gt!==null?S.fromPartial(e.gt):void 0,n.gte=e.gte!==void 0&&e.gte!==null?S.fromPartial(e.gte):void 0,n.lt=e.lt!==void 0&&e.lt!==null?S.fromPartial(e.lt):void 0,n.lte=e.lte!==void 0&&e.lte!==null?S.fromPartial(e.lte):void 0,n.ne=e.ne!==void 0&&e.ne!==null?S.fromPartial(e.ne):void 0,n.prefix=e.prefix??void 0,n.contains=e.contains??void 0,n.notContains=e.notContains??void 0,n.lengthEq=e.lengthEq??void 0,n.lengthGt=e.lengthGt??void 0,n.lengthLt=e.lengthLt??void 0,n.hasAny=e.hasAny!==void 0&&e.hasAny!==null?L.fromPartial(e.hasAny):void 0,n.hasAll=e.hasAll!==void 0&&e.hasAll!==null?L.fromPartial(e.hasAll):void 0,n.in=e.in!==void 0&&e.in!==null?L.fromPartial(e.in):void 0,n}};function Lu(){return{conditions:{}}}var te={encode(e,n=d.default.Writer.create()){return Object.entries(e.conditions).forEach(([t,a])=>{xi.encode({key:t,value:a},n.uint32(10).fork()).ldelim()}),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Lu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;let s=xi.decode(t,t.uint32());s.value!==void 0&&(i.conditions[s.key]=s.value);continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{conditions:ci(e.conditions)?Object.entries(e.conditions).reduce((n,[t,a])=>(n[t]=ln.fromJSON(a),n),{}):{}}},toJSON(e){let n={};if(e.conditions){let t=Object.entries(e.conditions);t.length>0&&(n.conditions={},t.forEach(([a,i])=>{n.conditions[a]=ln.toJSON(i)}))}return n},create(e){return te.fromPartial(e??{})},fromPartial(e){let n=Lu();return n.conditions=Object.entries(e.conditions??{}).reduce((t,[a,i])=>(i!==void 0&&(t[a]=ln.fromPartial(i)),t),{}),n}};function Fu(){return{key:"",value:void 0}}var xi={encode(e,n=d.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==void 0&&ln.encode(e.value,n.uint32(18).fork()).ldelim(),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Fu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.key=t.string();continue;case 2:if(r!==18)break;i.value=ln.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{key:l(e.key)?globalThis.String(e.key):"",value:l(e.value)?ln.fromJSON(e.value):void 0}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==void 0&&(n.value=ln.toJSON(e.value)),n},create(e){return xi.fromPartial(e??{})},fromPartial(e){let n=Fu();return n.key=e.key??"",n.value=e.value!==void 0&&e.value!==null?ln.fromPartial(e.value):void 0,n}};function wu(){return{filters:[]}}var Le={encode(e,n=d.default.Writer.create()){for(let t of e.filters)te.encode(t,n.uint32(10).fork()).ldelim();return n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=wu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.filters.push(te.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(n=>te.fromJSON(n)):[]}},toJSON(e){let n={};return e.filters?.length&&(n.filters=e.filters.map(t=>te.toJSON(t))),n},create(e){return Le.fromPartial(e??{})},fromPartial(e){let n=wu();return n.filters=e.filters?.map(t=>te.fromPartial(t))||[],n}};function Mu(){return{filters:void 0,preVOut:void 0,preTransaction:void 0}}var ct={encode(e,n=d.default.Writer.create()){return e.filters!==void 0&&Le.encode(e.filters,n.uint32(10).fork()).ldelim(),e.preVOut!==void 0&&te.encode(e.preVOut,n.uint32(18).fork()).ldelim(),e.preTransaction!==void 0&&Ve.encode(e.preTransaction,n.uint32(26).fork()).ldelim(),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Mu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.filters=Le.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.preVOut=te.decode(t,t.uint32());continue;case 3:if(r!==26)break;i.preTransaction=Ve.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{filters:l(e.filters)?Le.fromJSON(e.filters):void 0,preVOut:l(e.preVOut)?te.fromJSON(e.preVOut):void 0,preTransaction:l(e.preTransaction)?Ve.fromJSON(e.preTransaction):void 0}},toJSON(e){let n={};return e.filters!==void 0&&(n.filters=Le.toJSON(e.filters)),e.preVOut!==void 0&&(n.preVOut=te.toJSON(e.preVOut)),e.preTransaction!==void 0&&(n.preTransaction=Ve.toJSON(e.preTransaction)),n},create(e){return ct.fromPartial(e??{})},fromPartial(e){let n=Mu();return n.filters=e.filters!==void 0&&e.filters!==null?Le.fromPartial(e.filters):void 0,n.preVOut=e.preVOut!==void 0&&e.preVOut!==null?te.fromPartial(e.preVOut):void 0,n.preTransaction=e.preTransaction!==void 0&&e.preTransaction!==null?Ve.fromPartial(e.preTransaction):void 0,n}};function Wu(){return{filters:void 0}}var pt={encode(e,n=d.default.Writer.create()){return e.filters!==void 0&&Le.encode(e.filters,n.uint32(10).fork()).ldelim(),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Wu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.filters=Le.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{filters:l(e.filters)?Le.fromJSON(e.filters):void 0}},toJSON(e){let n={};return e.filters!==void 0&&(n.filters=Le.toJSON(e.filters)),n},create(e){return pt.fromPartial(e??{})},fromPartial(e){let n=Wu();return n.filters=e.filters!==void 0&&e.filters!==null?Le.fromPartial(e.filters):void 0,n}};function Gu(){return{address:"",keys:[]}}var gt={encode(e,n=d.default.Writer.create()){e.address!==""&&n.uint32(10).string(e.address);for(let t of e.keys)n.uint32(18).string(t);return n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Gu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.address=t.string();continue;case 2:if(r!==18)break;i.keys.push(t.string());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{address:l(e.address)?globalThis.String(e.address):"",keys:globalThis.Array.isArray(e?.keys)?e.keys.map(n=>globalThis.String(n)):[]}},toJSON(e){let n={};return e.address!==""&&(n.address=e.address),e.keys?.length&&(n.keys=e.keys),n},create(e){return gt.fromPartial(e??{})},fromPartial(e){let n=Gu();return n.address=e.address??"",n.keys=e.keys?.map(t=>t)||[],n}};function qu(){return{handlerId:0,handlerName:""}}var ht={encode(e,n=d.default.Writer.create()){return e.handlerId!==0&&n.uint32(8).int32(e.handlerId),e.handlerName!==""&&n.uint32(18).string(e.handlerName),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=qu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.handlerId=t.int32();continue;case 2:if(r!==18)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{handlerId:l(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:l(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return ht.fromPartial(e??{})},fromPartial(e){let n=qu();return n.handlerId=e.handlerId??0,n.handlerName=e.handlerName??"",n}};function Hu(){return{hashes:[]}}var mt={encode(e,n=d.default.Writer.create()){for(let t of e.hashes)n.uint32(10).string(t);return n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Hu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.hashes.push(t.string());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{hashes:globalThis.Array.isArray(e?.hashes)?e.hashes.map(n=>globalThis.String(n)):[]}},toJSON(e){let n={};return e.hashes?.length&&(n.hashes=e.hashes),n},create(e){return mt.fromPartial(e??{})},fromPartial(e){let n=Hu();return n.hashes=e.hashes?.map(t=>t)||[],n}};function Qu(){return{configUpdated:!1,error:void 0}}var yt={encode(e,n=d.default.Writer.create()){return e.configUpdated!==!1&&n.uint32(8).bool(e.configUpdated),e.error!==void 0&&n.uint32(18).string(e.error),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Qu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.configUpdated=t.bool();continue;case 2:if(r!==18)break;i.error=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{configUpdated:l(e.configUpdated)?globalThis.Boolean(e.configUpdated):!1,error:l(e.error)?globalThis.String(e.error):void 0}},toJSON(e){let n={};return e.configUpdated!==!1&&(n.configUpdated=e.configUpdated),e.error!==void 0&&(n.error=e.error),n},create(e){return yt.fromPartial(e??{})},fromPartial(e){let n=Qu();return n.configUpdated=e.configUpdated??!1,n.error=e.error??void 0,n}};function Zu(){return{gauges:[],counters:[],events:[],exports:[],states:void 0,timeseriesResult:[]}}var Vi={encode(e,n=d.default.Writer.create()){for(let t of e.gauges)Nt.encode(t,n.uint32(10).fork()).ldelim();for(let t of e.counters)Tt.encode(t,n.uint32(18).fork()).ldelim();for(let t of e.events)Ct.encode(t,n.uint32(34).fork()).ldelim();for(let t of e.exports)Et.encode(t,n.uint32(42).fork()).ldelim();e.states!==void 0&&yt.encode(e.states,n.uint32(50).fork()).ldelim();for(let t of e.timeseriesResult)It.encode(t,n.uint32(58).fork()).ldelim();return n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Zu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.gauges.push(Nt.decode(t,t.uint32()));continue;case 2:if(r!==18)break;i.counters.push(Tt.decode(t,t.uint32()));continue;case 4:if(r!==34)break;i.events.push(Ct.decode(t,t.uint32()));continue;case 5:if(r!==42)break;i.exports.push(Et.decode(t,t.uint32()));continue;case 6:if(r!==50)break;i.states=yt.decode(t,t.uint32());continue;case 7:if(r!==58)break;i.timeseriesResult.push(It.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{gauges:globalThis.Array.isArray(e?.gauges)?e.gauges.map(n=>Nt.fromJSON(n)):[],counters:globalThis.Array.isArray(e?.counters)?e.counters.map(n=>Tt.fromJSON(n)):[],events:globalThis.Array.isArray(e?.events)?e.events.map(n=>Ct.fromJSON(n)):[],exports:globalThis.Array.isArray(e?.exports)?e.exports.map(n=>Et.fromJSON(n)):[],states:l(e.states)?yt.fromJSON(e.states):void 0,timeseriesResult:globalThis.Array.isArray(e?.timeseriesResult)?e.timeseriesResult.map(n=>It.fromJSON(n)):[]}},toJSON(e){let n={};return e.gauges?.length&&(n.gauges=e.gauges.map(t=>Nt.toJSON(t))),e.counters?.length&&(n.counters=e.counters.map(t=>Tt.toJSON(t))),e.events?.length&&(n.events=e.events.map(t=>Ct.toJSON(t))),e.exports?.length&&(n.exports=e.exports.map(t=>Et.toJSON(t))),e.states!==void 0&&(n.states=yt.toJSON(e.states)),e.timeseriesResult?.length&&(n.timeseriesResult=e.timeseriesResult.map(t=>It.toJSON(t))),n},create(e){return Vi.fromPartial(e??{})},fromPartial(e){let n=Zu();return n.gauges=e.gauges?.map(t=>Nt.fromPartial(t))||[],n.counters=e.counters?.map(t=>Tt.fromPartial(t))||[],n.events=e.events?.map(t=>Ct.fromPartial(t))||[],n.exports=e.exports?.map(t=>Et.fromPartial(t))||[],n.states=e.states!==void 0&&e.states!==null?yt.fromPartial(e.states):void 0,n.timeseriesResult=e.timeseriesResult?.map(t=>It.fromPartial(t))||[],n}};function zu(){return{context:void 0,calldata:""}}var kt={encode(e,n=d.default.Writer.create()){return e.context!==void 0&&St.encode(e.context,n.uint32(10).fork()).ldelim(),e.calldata!==""&&n.uint32(18).string(e.calldata),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=zu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.context=St.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.calldata=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{context:l(e.context)?St.fromJSON(e.context):void 0,calldata:l(e.calldata)?globalThis.String(e.calldata):""}},toJSON(e){let n={};return e.context!==void 0&&(n.context=St.toJSON(e.context)),e.calldata!==""&&(n.calldata=e.calldata),n},create(e){return kt.fromPartial(e??{})},fromPartial(e){let n=zu();return n.context=e.context!==void 0&&e.context!==null?St.fromPartial(e.context):void 0,n.calldata=e.calldata??"",n}};function Ku(){return{chainId:"",address:"",blockTag:""}}var St={encode(e,n=d.default.Writer.create()){return e.chainId!==""&&n.uint32(10).string(e.chainId),e.address!==""&&n.uint32(18).string(e.address),e.blockTag!==""&&n.uint32(26).string(e.blockTag),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Ku();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.chainId=t.string();continue;case 2:if(r!==18)break;i.address=t.string();continue;case 3:if(r!==26)break;i.blockTag=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{chainId:l(e.chainId)?globalThis.String(e.chainId):"",address:l(e.address)?globalThis.String(e.address):"",blockTag:l(e.blockTag)?globalThis.String(e.blockTag):""}},toJSON(e){let n={};return e.chainId!==""&&(n.chainId=e.chainId),e.address!==""&&(n.address=e.address),e.blockTag!==""&&(n.blockTag=e.blockTag),n},create(e){return St.fromPartial(e??{})},fromPartial(e){let n=Ku();return n.chainId=e.chainId??"",n.address=e.address??"",n.blockTag=e.blockTag??"",n}};function Xu(){return{ethCallParams:[]}}var Li={encode(e,n=d.default.Writer.create()){for(let t of e.ethCallParams)kt.encode(t,n.uint32(10).fork()).ldelim();return n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Xu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.ethCallParams.push(kt.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{ethCallParams:globalThis.Array.isArray(e?.ethCallParams)?e.ethCallParams.map(n=>kt.fromJSON(n)):[]}},toJSON(e){let n={};return e.ethCallParams?.length&&(n.ethCallParams=e.ethCallParams.map(t=>kt.toJSON(t))),n},create(e){return Li.fromPartial(e??{})},fromPartial(e){let n=Xu();return n.ethCallParams=e.ethCallParams?.map(t=>kt.fromPartial(t))||[],n}};function Yu(){return{address:"",contractName:"",blockNumber:BigInt("0"),transactionHash:"",chainId:"",transactionIndex:0,logIndex:0,name:"",labels:{}}}var J={encode(e,n=d.default.Writer.create()){if(e.address!==""&&n.uint32(10).string(e.address),e.contractName!==""&&n.uint32(74).string(e.contractName),e.blockNumber!==BigInt("0")){if(BigInt.asUintN(64,e.blockNumber)!==e.blockNumber)throw new globalThis.Error("value provided for field message.blockNumber of type uint64 too large");n.uint32(16).uint64(e.blockNumber.toString())}return e.transactionHash!==""&&n.uint32(50).string(e.transactionHash),e.chainId!==""&&n.uint32(42).string(e.chainId),e.transactionIndex!==0&&n.uint32(24).int32(e.transactionIndex),e.logIndex!==0&&n.uint32(32).int32(e.logIndex),e.name!==""&&n.uint32(82).string(e.name),Object.entries(e.labels).forEach(([t,a])=>{Ui.encode({key:t,value:a},n.uint32(58).fork()).ldelim()}),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Yu();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.address=t.string();continue;case 9:if(r!==74)break;i.contractName=t.string();continue;case 2:if(r!==16)break;i.blockNumber=On(t.uint64());continue;case 6:if(r!==50)break;i.transactionHash=t.string();continue;case 5:if(r!==42)break;i.chainId=t.string();continue;case 3:if(r!==24)break;i.transactionIndex=t.int32();continue;case 4:if(r!==32)break;i.logIndex=t.int32();continue;case 10:if(r!==82)break;i.name=t.string();continue;case 7:if(r!==58)break;let s=Ui.decode(t,t.uint32());s.value!==void 0&&(i.labels[s.key]=s.value);continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{address:l(e.address)?globalThis.String(e.address):"",contractName:l(e.contractName)?globalThis.String(e.contractName):"",blockNumber:l(e.blockNumber)?BigInt(e.blockNumber):BigInt("0"),transactionHash:l(e.transactionHash)?globalThis.String(e.transactionHash):"",chainId:l(e.chainId)?globalThis.String(e.chainId):"",transactionIndex:l(e.transactionIndex)?globalThis.Number(e.transactionIndex):0,logIndex:l(e.logIndex)?globalThis.Number(e.logIndex):0,name:l(e.name)?globalThis.String(e.name):"",labels:ci(e.labels)?Object.entries(e.labels).reduce((n,[t,a])=>(n[t]=String(a),n),{}):{}}},toJSON(e){let n={};if(e.address!==""&&(n.address=e.address),e.contractName!==""&&(n.contractName=e.contractName),e.blockNumber!==BigInt("0")&&(n.blockNumber=e.blockNumber.toString()),e.transactionHash!==""&&(n.transactionHash=e.transactionHash),e.chainId!==""&&(n.chainId=e.chainId),e.transactionIndex!==0&&(n.transactionIndex=Math.round(e.transactionIndex)),e.logIndex!==0&&(n.logIndex=Math.round(e.logIndex)),e.name!==""&&(n.name=e.name),e.labels){let t=Object.entries(e.labels);t.length>0&&(n.labels={},t.forEach(([a,i])=>{n.labels[a]=i}))}return n},create(e){return J.fromPartial(e??{})},fromPartial(e){let n=Yu();return n.address=e.address??"",n.contractName=e.contractName??"",n.blockNumber=e.blockNumber??BigInt("0"),n.transactionHash=e.transactionHash??"",n.chainId=e.chainId??"",n.transactionIndex=e.transactionIndex??0,n.logIndex=e.logIndex??0,n.name=e.name??"",n.labels=Object.entries(e.labels??{}).reduce((t,[a,i])=>(i!==void 0&&(t[a]=globalThis.String(i)),t),{}),n}};function $u(){return{key:"",value:""}}var Ui={encode(e,n=d.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=$u();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.key=t.string();continue;case 2:if(r!==18)break;i.value=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{key:l(e.key)?globalThis.String(e.key):"",value:l(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return Ui.fromPartial(e??{})},fromPartial(e){let n=$u();return n.key=e.key??"",n.value=e.value??"",n}};function ju(){return{bigDecimal:void 0,doubleValue:void 0,bigInteger:void 0}}var Fe={encode(e,n=d.default.Writer.create()){return e.bigDecimal!==void 0&&n.uint32(10).string(e.bigDecimal),e.doubleValue!==void 0&&n.uint32(17).double(e.doubleValue),e.bigInteger!==void 0&&z.encode(e.bigInteger,n.uint32(26).fork()).ldelim(),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=ju();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.bigDecimal=t.string();continue;case 2:if(r!==17)break;i.doubleValue=t.double();continue;case 3:if(r!==26)break;i.bigInteger=z.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{bigDecimal:l(e.bigDecimal)?globalThis.String(e.bigDecimal):void 0,doubleValue:l(e.doubleValue)?globalThis.Number(e.doubleValue):void 0,bigInteger:l(e.bigInteger)?z.fromJSON(e.bigInteger):void 0}},toJSON(e){let n={};return e.bigDecimal!==void 0&&(n.bigDecimal=e.bigDecimal),e.doubleValue!==void 0&&(n.doubleValue=e.doubleValue),e.bigInteger!==void 0&&(n.bigInteger=z.toJSON(e.bigInteger)),n},create(e){return Fe.fromPartial(e??{})},fromPartial(e){let n=ju();return n.bigDecimal=e.bigDecimal??void 0,n.doubleValue=e.doubleValue??void 0,n.bigInteger=e.bigInteger!==void 0&&e.bigInteger!==null?z.fromPartial(e.bigInteger):void 0,n}};function ed(){return{from:0}}var x={encode(e,n=d.default.Writer.create()){return e.from!==0&&n.uint32(8).int32(e.from),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=ed();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.from=t.int32();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{from:l(e.from)?_f(e.from):0}},toJSON(e){let n={};return e.from!==0&&(n.from=vf(e.from)),n},create(e){return x.fromPartial(e??{})},fromPartial(e){let n=ed();return n.from=e.from??0,n}};function nd(){return{metadata:void 0,metricValue:void 0,runtimeInfo:void 0}}var Nt={encode(e,n=d.default.Writer.create()){return e.metadata!==void 0&&J.encode(e.metadata,n.uint32(10).fork()).ldelim(),e.metricValue!==void 0&&Fe.encode(e.metricValue,n.uint32(18).fork()).ldelim(),e.runtimeInfo!==void 0&&x.encode(e.runtimeInfo,n.uint32(26).fork()).ldelim(),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=nd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.metadata=J.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.metricValue=Fe.decode(t,t.uint32());continue;case 3:if(r!==26)break;i.runtimeInfo=x.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{metadata:l(e.metadata)?J.fromJSON(e.metadata):void 0,metricValue:l(e.metricValue)?Fe.fromJSON(e.metricValue):void 0,runtimeInfo:l(e.runtimeInfo)?x.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let n={};return e.metadata!==void 0&&(n.metadata=J.toJSON(e.metadata)),e.metricValue!==void 0&&(n.metricValue=Fe.toJSON(e.metricValue)),e.runtimeInfo!==void 0&&(n.runtimeInfo=x.toJSON(e.runtimeInfo)),n},create(e){return Nt.fromPartial(e??{})},fromPartial(e){let n=nd();return n.metadata=e.metadata!==void 0&&e.metadata!==null?J.fromPartial(e.metadata):void 0,n.metricValue=e.metricValue!==void 0&&e.metricValue!==null?Fe.fromPartial(e.metricValue):void 0,n.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?x.fromPartial(e.runtimeInfo):void 0,n}};function td(){return{metadata:void 0,metricValue:void 0,add:!1,runtimeInfo:void 0}}var Tt={encode(e,n=d.default.Writer.create()){return e.metadata!==void 0&&J.encode(e.metadata,n.uint32(10).fork()).ldelim(),e.metricValue!==void 0&&Fe.encode(e.metricValue,n.uint32(18).fork()).ldelim(),e.add!==!1&&n.uint32(24).bool(e.add),e.runtimeInfo!==void 0&&x.encode(e.runtimeInfo,n.uint32(34).fork()).ldelim(),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=td();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.metadata=J.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.metricValue=Fe.decode(t,t.uint32());continue;case 3:if(r!==24)break;i.add=t.bool();continue;case 4:if(r!==34)break;i.runtimeInfo=x.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{metadata:l(e.metadata)?J.fromJSON(e.metadata):void 0,metricValue:l(e.metricValue)?Fe.fromJSON(e.metricValue):void 0,add:l(e.add)?globalThis.Boolean(e.add):!1,runtimeInfo:l(e.runtimeInfo)?x.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let n={};return e.metadata!==void 0&&(n.metadata=J.toJSON(e.metadata)),e.metricValue!==void 0&&(n.metricValue=Fe.toJSON(e.metricValue)),e.add!==!1&&(n.add=e.add),e.runtimeInfo!==void 0&&(n.runtimeInfo=x.toJSON(e.runtimeInfo)),n},create(e){return Tt.fromPartial(e??{})},fromPartial(e){let n=td();return n.metadata=e.metadata!==void 0&&e.metadata!==null?J.fromPartial(e.metadata):void 0,n.metricValue=e.metricValue!==void 0&&e.metricValue!==null?Fe.fromPartial(e.metricValue):void 0,n.add=e.add??!1,n.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?x.fromPartial(e.runtimeInfo):void 0,n}};function rd(){return{metadata:void 0,distinctEntityId:"",attributes:void 0,severity:0,message:"",runtimeInfo:void 0,attributes2:void 0,noMetric:!1}}var Ct={encode(e,n=d.default.Writer.create()){return e.metadata!==void 0&&J.encode(e.metadata,n.uint32(10).fork()).ldelim(),e.distinctEntityId!==""&&n.uint32(18).string(e.distinctEntityId),e.attributes!==void 0&&de.encode(de.wrap(e.attributes),n.uint32(50).fork()).ldelim(),e.severity!==0&&n.uint32(56).int32(e.severity),e.message!==""&&n.uint32(66).string(e.message),e.runtimeInfo!==void 0&&x.encode(e.runtimeInfo,n.uint32(42).fork()).ldelim(),e.attributes2!==void 0&&Z.encode(e.attributes2,n.uint32(74).fork()).ldelim(),e.noMetric!==!1&&n.uint32(24).bool(e.noMetric),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=rd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.metadata=J.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.distinctEntityId=t.string();continue;case 6:if(r!==50)break;i.attributes=de.unwrap(de.decode(t,t.uint32()));continue;case 7:if(r!==56)break;i.severity=t.int32();continue;case 8:if(r!==66)break;i.message=t.string();continue;case 5:if(r!==42)break;i.runtimeInfo=x.decode(t,t.uint32());continue;case 9:if(r!==74)break;i.attributes2=Z.decode(t,t.uint32());continue;case 3:if(r!==24)break;i.noMetric=t.bool();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{metadata:l(e.metadata)?J.fromJSON(e.metadata):void 0,distinctEntityId:l(e.distinctEntityId)?globalThis.String(e.distinctEntityId):"",attributes:ci(e.attributes)?e.attributes:void 0,severity:l(e.severity)?Af(e.severity):0,message:l(e.message)?globalThis.String(e.message):"",runtimeInfo:l(e.runtimeInfo)?x.fromJSON(e.runtimeInfo):void 0,attributes2:l(e.attributes2)?Z.fromJSON(e.attributes2):void 0,noMetric:l(e.noMetric)?globalThis.Boolean(e.noMetric):!1}},toJSON(e){let n={};return e.metadata!==void 0&&(n.metadata=J.toJSON(e.metadata)),e.distinctEntityId!==""&&(n.distinctEntityId=e.distinctEntityId),e.attributes!==void 0&&(n.attributes=e.attributes),e.severity!==0&&(n.severity=Bf(e.severity)),e.message!==""&&(n.message=e.message),e.runtimeInfo!==void 0&&(n.runtimeInfo=x.toJSON(e.runtimeInfo)),e.attributes2!==void 0&&(n.attributes2=Z.toJSON(e.attributes2)),e.noMetric!==!1&&(n.noMetric=e.noMetric),n},create(e){return Ct.fromPartial(e??{})},fromPartial(e){let n=rd();return n.metadata=e.metadata!==void 0&&e.metadata!==null?J.fromPartial(e.metadata):void 0,n.distinctEntityId=e.distinctEntityId??"",n.attributes=e.attributes??void 0,n.severity=e.severity??0,n.message=e.message??"",n.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?x.fromPartial(e.runtimeInfo):void 0,n.attributes2=e.attributes2!==void 0&&e.attributes2!==null?Z.fromPartial(e.attributes2):void 0,n.noMetric=e.noMetric??!1,n}};function id(){return{metadata:void 0,type:0,data:void 0,runtimeInfo:void 0}}var It={encode(e,n=d.default.Writer.create()){return e.metadata!==void 0&&J.encode(e.metadata,n.uint32(10).fork()).ldelim(),e.type!==0&&n.uint32(16).int32(e.type),e.data!==void 0&&Z.encode(e.data,n.uint32(26).fork()).ldelim(),e.runtimeInfo!==void 0&&x.encode(e.runtimeInfo,n.uint32(34).fork()).ldelim(),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=id();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.metadata=J.decode(t,t.uint32());continue;case 2:if(r!==16)break;i.type=t.int32();continue;case 3:if(r!==26)break;i.data=Z.decode(t,t.uint32());continue;case 4:if(r!==34)break;i.runtimeInfo=x.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{metadata:l(e.metadata)?J.fromJSON(e.metadata):void 0,type:l(e.type)?Jf(e.type):0,data:l(e.data)?Z.fromJSON(e.data):void 0,runtimeInfo:l(e.runtimeInfo)?x.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let n={};return e.metadata!==void 0&&(n.metadata=J.toJSON(e.metadata)),e.type!==0&&(n.type=xf(e.type)),e.data!==void 0&&(n.data=Z.toJSON(e.data)),e.runtimeInfo!==void 0&&(n.runtimeInfo=x.toJSON(e.runtimeInfo)),n},create(e){return It.fromPartial(e??{})},fromPartial(e){let n=id();return n.metadata=e.metadata!==void 0&&e.metadata!==null?J.fromPartial(e.metadata):void 0,n.type=e.type??0,n.data=e.data!==void 0&&e.data!==null?Z.fromPartial(e.data):void 0,n.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?x.fromPartial(e.runtimeInfo):void 0,n}};function ad(){return{metadata:void 0,payload:"",runtimeInfo:void 0}}var Et={encode(e,n=d.default.Writer.create()){return e.metadata!==void 0&&J.encode(e.metadata,n.uint32(10).fork()).ldelim(),e.payload!==""&&n.uint32(18).string(e.payload),e.runtimeInfo!==void 0&&x.encode(e.runtimeInfo,n.uint32(26).fork()).ldelim(),n},decode(e,n){let t=e instanceof d.default.Reader?e:d.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=ad();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.metadata=J.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.payload=t.string();continue;case 3:if(r!==26)break;i.runtimeInfo=x.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{metadata:l(e.metadata)?J.fromJSON(e.metadata):void 0,payload:l(e.payload)?globalThis.String(e.payload):"",runtimeInfo:l(e.runtimeInfo)?x.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let n={};return e.metadata!==void 0&&(n.metadata=J.toJSON(e.metadata)),e.payload!==""&&(n.payload=e.payload),e.runtimeInfo!==void 0&&(n.runtimeInfo=x.toJSON(e.runtimeInfo)),n},create(e){return Et.fromPartial(e??{})},fromPartial(e){let n=ad();return n.metadata=e.metadata!==void 0&&e.metadata!==null?J.fromPartial(e.metadata):void 0,n.payload=e.payload??"",n.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?x.fromPartial(e.runtimeInfo):void 0,n}};function On(e){return BigInt(e.toString())}d.default.util.Long!==H&&(d.default.util.Long=H,d.default.configure());function ci(e){return typeof e=="object"&&e!==null}function l(e){return e!=null}import{AsyncLocalStorage as Lf}from"node:async_hooks";var od=class{name;supportedHandlers=[];async configure(n){}async start(n){}stateDiff(n){return!1}async processBinding(n,t){return Vi.create()}async preprocessBinding(n,t){return Li.create()}async partition(n){return{partitions:n.handlerIds.reduce((t,a)=>({...t,[a]:{sysValue:fi.UNRECOGNIZED}}),{})}}async startServer(n){}shutdownServer(){}},ud=class e{static INSTANCE=new e;dbContextLocalStorage=new Lf;plugins=[];typesToPlugin=new Map;register(n){if(!this.plugins.find(t=>t.name===n.name)){this.plugins.push(n);for(let t of n.supportedHandlers){let a=this.typesToPlugin.get(t);if(a)throw new Error(`Duplicate plugin for ${t}: ${a.name} and ${n.name}`);this.typesToPlugin.set(t,n)}}}configure(n){return Promise.all(this.plugins.map(t=>t.configure(n)))}start(n,t){return Promise.all(this.plugins.map(a=>a.start(n)))}startServer(n){return Promise.all(this.plugins.map(t=>t.startServer(n)))}shutdown(){this.plugins.forEach(n=>n.shutdownServer())}stateDiff(n){return this.plugins.some(t=>t.stateDiff(n))}processBinding(n,t,a){let i=this.typesToPlugin.get(n.handlerType);if(!i)throw new Error(`No plugin for ${n.handlerType}`);return this.dbContextLocalStorage.run(a,()=>i.processBinding(n,t))}async partition(n){let t=this.typesToPlugin.get(n.handlerType);if(!t)throw new Error(`No plugin for ${n.handlerType}`);return t.partition(n)}preprocessBinding(n,t,a){let i=this.typesToPlugin.get(n.handlerType);if(!i)throw new Error(`No plugin for ${n.handlerType}`);return this.dbContextLocalStorage.run(a,()=>i.preprocessBinding(n,t))}};import("node:process").then(e=>e.stdout.write(""));var o=nn(_e(),1);var pi=nn(_e(),1);function dd(){return{}}var ri={encode(e,n=pi.default.Writer.create()){return n},decode(e,n){let t=e instanceof pi.default.Reader?e:pi.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=dd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{}},toJSON(e){return{}},create(e){return ri.fromPartial(e??{})},fromPartial(e){return dd()}};import("node:process").then(e=>e.stdout.write(""));var he=nn(_e(),1);function Ff(e){switch(e){case 0:case"NULL_VALUE":return 0;case-1:case"UNRECOGNIZED":default:return-1}}function wf(e){switch(e){case 0:return"NULL_VALUE";case-1:default:return"UNRECOGNIZED"}}function Fi(){return{fields:{}}}var f={encode(e,n=he.default.Writer.create()){return Object.entries(e.fields).forEach(([t,a])=>{a!==void 0&&Wi.encode({key:t,value:a},n.uint32(10).fork()).ldelim()}),n},decode(e,n){let t=e instanceof he.default.Reader?e:he.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Fi();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;let s=Wi.decode(t,t.uint32());s.value!==void 0&&(i.fields[s.key]=s.value);continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{fields:sd(e.fields)?Object.entries(e.fields).reduce((n,[t,a])=>(n[t]=a,n),{}):{}}},toJSON(e){let n={};if(e.fields){let t=Object.entries(e.fields);t.length>0&&(n.fields={},t.forEach(([a,i])=>{n.fields[a]=i}))}return n},create(e){return f.fromPartial(e??{})},fromPartial(e){let n=Fi();return n.fields=Object.entries(e.fields??{}).reduce((t,[a,i])=>(i!==void 0&&(t[a]=i),t),{}),n},wrap(e){let n=Fi();if(e!==void 0)for(let t of Object.keys(e))n.fields[t]=e[t];return n},unwrap(e){let n={};if(e.fields)for(let t of Object.keys(e.fields))n[t]=e.fields[t];return n}};function ld(){return{key:"",value:void 0}}var Wi={encode(e,n=he.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==void 0&&sn.encode(sn.wrap(e.value),n.uint32(18).fork()).ldelim(),n},decode(e,n){let t=e instanceof he.default.Reader?e:he.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=ld();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.key=t.string();continue;case 2:if(r!==18)break;i.value=sn.unwrap(sn.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{key:Ot(e.key)?globalThis.String(e.key):"",value:Ot(e?.value)?e.value:void 0}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==void 0&&(n.value=e.value),n},create(e){return Wi.fromPartial(e??{})},fromPartial(e){let n=ld();return n.key=e.key??"",n.value=e.value??void 0,n}};function wi(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var sn={encode(e,n=he.default.Writer.create()){return e.nullValue!==void 0&&n.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&n.uint32(17).double(e.numberValue),e.stringValue!==void 0&&n.uint32(26).string(e.stringValue),e.boolValue!==void 0&&n.uint32(32).bool(e.boolValue),e.structValue!==void 0&&f.encode(f.wrap(e.structValue),n.uint32(42).fork()).ldelim(),e.listValue!==void 0&&on.encode(on.wrap(e.listValue),n.uint32(50).fork()).ldelim(),n},decode(e,n){let t=e instanceof he.default.Reader?e:he.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=wi();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.nullValue=t.int32();continue;case 2:if(r!==17)break;i.numberValue=t.double();continue;case 3:if(r!==26)break;i.stringValue=t.string();continue;case 4:if(r!==32)break;i.boolValue=t.bool();continue;case 5:if(r!==42)break;i.structValue=f.unwrap(f.decode(t,t.uint32()));continue;case 6:if(r!==50)break;i.listValue=on.unwrap(on.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{nullValue:Ot(e.nullValue)?Ff(e.nullValue):void 0,numberValue:Ot(e.numberValue)?globalThis.Number(e.numberValue):void 0,stringValue:Ot(e.stringValue)?globalThis.String(e.stringValue):void 0,boolValue:Ot(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,structValue:sd(e.structValue)?e.structValue:void 0,listValue:globalThis.Array.isArray(e.listValue)?[...e.listValue]:void 0}},toJSON(e){let n={};return e.nullValue!==void 0&&(n.nullValue=wf(e.nullValue)),e.numberValue!==void 0&&(n.numberValue=e.numberValue),e.stringValue!==void 0&&(n.stringValue=e.stringValue),e.boolValue!==void 0&&(n.boolValue=e.boolValue),e.structValue!==void 0&&(n.structValue=e.structValue),e.listValue!==void 0&&(n.listValue=e.listValue),n},create(e){return sn.fromPartial(e??{})},fromPartial(e){let n=wi();return n.nullValue=e.nullValue??void 0,n.numberValue=e.numberValue??void 0,n.stringValue=e.stringValue??void 0,n.boolValue=e.boolValue??void 0,n.structValue=e.structValue??void 0,n.listValue=e.listValue??void 0,n},wrap(e){let n=wi();if(e===null)n.nullValue=0;else if(typeof e=="boolean")n.boolValue=e;else if(typeof e=="number")n.numberValue=e;else if(typeof e=="string")n.stringValue=e;else if(globalThis.Array.isArray(e))n.listValue=e;else if(typeof e=="object")n.structValue=e;else if(typeof e<"u")throw new globalThis.Error("Unsupported any value type: "+typeof e);return n},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function Mi(){return{values:[]}}var on={encode(e,n=he.default.Writer.create()){for(let t of e.values)sn.encode(sn.wrap(t),n.uint32(10).fork()).ldelim();return n},decode(e,n){let t=e instanceof he.default.Reader?e:he.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Mi();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.values.push(sn.unwrap(sn.decode(t,t.uint32())));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e?.values)?[...e.values]:[]}},toJSON(e){let n={};return e.values?.length&&(n.values=e.values),n},create(e){return on.fromPartial(e??{})},fromPartial(e){let n=Mi();return n.values=e.values?.map(t=>t)||[],n},wrap(e){let n=Mi();return n.values=e??[],n},unwrap(e){return e?.hasOwnProperty("values")&&globalThis.Array.isArray(e.values)?e.values:e}};function sd(e){return typeof e=="object"&&e!==null}function Ot(e){return e!=null}import("node:process").then(e=>e.stdout.write(""));var Rn=nn(_e(),1);function fd(){return{seconds:BigInt("0"),nanos:0}}var T={encode(e,n=Rn.default.Writer.create()){if(e.seconds!==BigInt("0")){if(BigInt.asIntN(64,e.seconds)!==e.seconds)throw new globalThis.Error("value provided for field message.seconds of type int64 too large");n.uint32(8).int64(e.seconds.toString())}return e.nanos!==0&&n.uint32(16).int32(e.nanos),n},decode(e,n){let t=e instanceof Rn.default.Reader?e:Rn.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=fd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.seconds=Mf(t.int64());continue;case 2:if(r!==16)break;i.nanos=t.int32();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{seconds:cd(e.seconds)?BigInt(e.seconds):BigInt("0"),nanos:cd(e.nanos)?globalThis.Number(e.nanos):0}},toJSON(e){let n={};return e.seconds!==BigInt("0")&&(n.seconds=e.seconds.toString()),e.nanos!==0&&(n.nanos=Math.round(e.nanos)),n},create(e){return T.fromPartial(e??{})},fromPartial(e){let n=fd();return n.seconds=e.seconds??BigInt("0"),n.nanos=e.nanos??0,n}};function Mf(e){return BigInt(e.toString())}Rn.default.util.Long!==H&&(Rn.default.util.Long=H,Rn.default.configure());function cd(e){return e!=null}import("node:process").then(e=>e.stdout.write(""));var I=nn(_e(),1);function Wf(e){switch(e){case 0:case"NULL_VALUE":return 0;case-1:case"UNRECOGNIZED":default:return-1}}function Gf(e){switch(e){case 0:return"NULL_VALUE";case-1:default:return"UNRECOGNIZED"}}function pd(){return{symbol:void 0,address:void 0}}var Ce={encode(e,n=I.default.Writer.create()){return e.symbol!==void 0&&n.uint32(10).string(e.symbol),e.address!==void 0&&Rt.encode(e.address,n.uint32(18).fork()).ldelim(),n},decode(e,n){let t=e instanceof I.default.Reader?e:I.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=pd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.symbol=t.string();continue;case 2:if(r!==18)break;i.address=Rt.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{symbol:U(e.symbol)?globalThis.String(e.symbol):void 0,address:U(e.address)?Rt.fromJSON(e.address):void 0}},toJSON(e){let n={};return e.symbol!==void 0&&(n.symbol=e.symbol),e.address!==void 0&&(n.address=Rt.toJSON(e.address)),n},create(e){return Ce.fromPartial(e??{})},fromPartial(e){let n=pd();return n.symbol=e.symbol??void 0,n.address=e.address!==void 0&&e.address!==null?Rt.fromPartial(e.address):void 0,n}};function gd(){return{address:"",chain:""}}var Rt={encode(e,n=I.default.Writer.create()){return e.address!==""&&n.uint32(10).string(e.address),e.chain!==""&&n.uint32(18).string(e.chain),n},decode(e,n){let t=e instanceof I.default.Reader?e:I.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=gd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.address=t.string();continue;case 2:if(r!==18)break;i.chain=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{address:U(e.address)?globalThis.String(e.address):"",chain:U(e.chain)?globalThis.String(e.chain):""}},toJSON(e){let n={};return e.address!==""&&(n.address=e.address),e.chain!==""&&(n.chain=e.chain),n},create(e){return Rt.fromPartial(e??{})},fromPartial(e){let n=gd();return n.address=e.address??"",n.chain=e.chain??"",n}};function hd(){return{nullValue:void 0,intValue:void 0,int64Value:void 0,floatValue:void 0,bytesValue:void 0,boolValue:void 0,stringValue:void 0,timestampValue:void 0,bigintValue:void 0,bigdecimalValue:void 0,listValue:void 0,structValue:void 0,tokenValue:void 0}}var k={encode(e,n=I.default.Writer.create()){if(e.nullValue!==void 0&&n.uint32(8).int32(e.nullValue),e.intValue!==void 0&&n.uint32(16).int32(e.intValue),e.int64Value!==void 0){if(BigInt.asIntN(64,e.int64Value)!==e.int64Value)throw new globalThis.Error("value provided for field message.int64Value of type int64 too large");n.uint32(104).int64(e.int64Value.toString())}return e.floatValue!==void 0&&n.uint32(25).double(e.floatValue),e.bytesValue!==void 0&&n.uint32(34).bytes(e.bytesValue),e.boolValue!==void 0&&n.uint32(40).bool(e.boolValue),e.stringValue!==void 0&&n.uint32(50).string(e.stringValue),e.timestampValue!==void 0&&T.encode(Od(e.timestampValue),n.uint32(58).fork()).ldelim(),e.bigintValue!==void 0&&K.encode(e.bigintValue,n.uint32(66).fork()).ldelim(),e.bigdecimalValue!==void 0&&we.encode(e.bigdecimalValue,n.uint32(74).fork()).ldelim(),e.listValue!==void 0&&A.encode(e.listValue,n.uint32(82).fork()).ldelim(),e.structValue!==void 0&&R.encode(e.structValue,n.uint32(90).fork()).ldelim(),e.tokenValue!==void 0&&Pt.encode(e.tokenValue,n.uint32(98).fork()).ldelim(),n},decode(e,n){let t=e instanceof I.default.Reader?e:I.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=hd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.nullValue=t.int32();continue;case 2:if(r!==16)break;i.intValue=t.int32();continue;case 13:if(r!==104)break;i.int64Value=qf(t.int64());continue;case 3:if(r!==25)break;i.floatValue=t.double();continue;case 4:if(r!==34)break;i.bytesValue=t.bytes();continue;case 5:if(r!==40)break;i.boolValue=t.bool();continue;case 6:if(r!==50)break;i.stringValue=t.string();continue;case 7:if(r!==58)break;i.timestampValue=qi(T.decode(t,t.uint32()));continue;case 8:if(r!==66)break;i.bigintValue=K.decode(t,t.uint32());continue;case 9:if(r!==74)break;i.bigdecimalValue=we.decode(t,t.uint32());continue;case 10:if(r!==82)break;i.listValue=A.decode(t,t.uint32());continue;case 11:if(r!==90)break;i.structValue=R.decode(t,t.uint32());continue;case 12:if(r!==98)break;i.tokenValue=Pt.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{nullValue:U(e.nullValue)?Wf(e.nullValue):void 0,intValue:U(e.intValue)?globalThis.Number(e.intValue):void 0,int64Value:U(e.int64Value)?BigInt(e.int64Value):void 0,floatValue:U(e.floatValue)?globalThis.Number(e.floatValue):void 0,bytesValue:U(e.bytesValue)?Id(e.bytesValue):void 0,boolValue:U(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,stringValue:U(e.stringValue)?globalThis.String(e.stringValue):void 0,timestampValue:U(e.timestampValue)?Rd(e.timestampValue):void 0,bigintValue:U(e.bigintValue)?K.fromJSON(e.bigintValue):void 0,bigdecimalValue:U(e.bigdecimalValue)?we.fromJSON(e.bigdecimalValue):void 0,listValue:U(e.listValue)?A.fromJSON(e.listValue):void 0,structValue:U(e.structValue)?R.fromJSON(e.structValue):void 0,tokenValue:U(e.tokenValue)?Pt.fromJSON(e.tokenValue):void 0}},toJSON(e){let n={};return e.nullValue!==void 0&&(n.nullValue=Gf(e.nullValue)),e.intValue!==void 0&&(n.intValue=Math.round(e.intValue)),e.int64Value!==void 0&&(n.int64Value=e.int64Value.toString()),e.floatValue!==void 0&&(n.floatValue=e.floatValue),e.bytesValue!==void 0&&(n.bytesValue=Ed(e.bytesValue)),e.boolValue!==void 0&&(n.boolValue=e.boolValue),e.stringValue!==void 0&&(n.stringValue=e.stringValue),e.timestampValue!==void 0&&(n.timestampValue=e.timestampValue.toISOString()),e.bigintValue!==void 0&&(n.bigintValue=K.toJSON(e.bigintValue)),e.bigdecimalValue!==void 0&&(n.bigdecimalValue=we.toJSON(e.bigdecimalValue)),e.listValue!==void 0&&(n.listValue=A.toJSON(e.listValue)),e.structValue!==void 0&&(n.structValue=R.toJSON(e.structValue)),e.tokenValue!==void 0&&(n.tokenValue=Pt.toJSON(e.tokenValue)),n},create(e){return k.fromPartial(e??{})},fromPartial(e){let n=hd();return n.nullValue=e.nullValue??void 0,n.intValue=e.intValue??void 0,n.int64Value=e.int64Value??void 0,n.floatValue=e.floatValue??void 0,n.bytesValue=e.bytesValue??void 0,n.boolValue=e.boolValue??void 0,n.stringValue=e.stringValue??void 0,n.timestampValue=e.timestampValue??void 0,n.bigintValue=e.bigintValue!==void 0&&e.bigintValue!==null?K.fromPartial(e.bigintValue):void 0,n.bigdecimalValue=e.bigdecimalValue!==void 0&&e.bigdecimalValue!==null?we.fromPartial(e.bigdecimalValue):void 0,n.listValue=e.listValue!==void 0&&e.listValue!==null?A.fromPartial(e.listValue):void 0,n.structValue=e.structValue!==void 0&&e.structValue!==null?R.fromPartial(e.structValue):void 0,n.tokenValue=e.tokenValue!==void 0&&e.tokenValue!==null?Pt.fromPartial(e.tokenValue):void 0,n}};function md(){return{fields:{}}}var R={encode(e,n=I.default.Writer.create()){return Object.entries(e.fields).forEach(([t,a])=>{Gi.encode({key:t,value:a},n.uint32(10).fork()).ldelim()}),n},decode(e,n){let t=e instanceof I.default.Reader?e:I.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=md();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;let s=Gi.decode(t,t.uint32());s.value!==void 0&&(i.fields[s.key]=s.value);continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{fields:Hf(e.fields)?Object.entries(e.fields).reduce((n,[t,a])=>(n[t]=k.fromJSON(a),n),{}):{}}},toJSON(e){let n={};if(e.fields){let t=Object.entries(e.fields);t.length>0&&(n.fields={},t.forEach(([a,i])=>{n.fields[a]=k.toJSON(i)}))}return n},create(e){return R.fromPartial(e??{})},fromPartial(e){let n=md();return n.fields=Object.entries(e.fields??{}).reduce((t,[a,i])=>(i!==void 0&&(t[a]=k.fromPartial(i)),t),{}),n}};function yd(){return{key:"",value:void 0}}var Gi={encode(e,n=I.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==void 0&&k.encode(e.value,n.uint32(18).fork()).ldelim(),n},decode(e,n){let t=e instanceof I.default.Reader?e:I.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=yd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.key=t.string();continue;case 2:if(r!==18)break;i.value=k.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{key:U(e.key)?globalThis.String(e.key):"",value:U(e.value)?k.fromJSON(e.value):void 0}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==void 0&&(n.value=k.toJSON(e.value)),n},create(e){return Gi.fromPartial(e??{})},fromPartial(e){let n=yd();return n.key=e.key??"",n.value=e.value!==void 0&&e.value!==null?k.fromPartial(e.value):void 0,n}};function kd(){return{values:[]}}var A={encode(e,n=I.default.Writer.create()){for(let t of e.values)k.encode(t,n.uint32(10).fork()).ldelim();return n},decode(e,n){let t=e instanceof I.default.Reader?e:I.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=kd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.values.push(k.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e?.values)?e.values.map(n=>k.fromJSON(n)):[]}},toJSON(e){let n={};return e.values?.length&&(n.values=e.values.map(t=>k.toJSON(t))),n},create(e){return A.fromPartial(e??{})},fromPartial(e){let n=kd();return n.values=e.values?.map(t=>k.fromPartial(t))||[],n}};function Sd(){return{entities:[]}}var Pn={encode(e,n=I.default.Writer.create()){for(let t of e.entities)R.encode(t,n.uint32(10).fork()).ldelim();return n},decode(e,n){let t=e instanceof I.default.Reader?e:I.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Sd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.entities.push(R.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{entities:globalThis.Array.isArray(e?.entities)?e.entities.map(n=>R.fromJSON(n)):[]}},toJSON(e){let n={};return e.entities?.length&&(n.entities=e.entities.map(t=>R.toJSON(t))),n},create(e){return Pn.fromPartial(e??{})},fromPartial(e){let n=Sd();return n.entities=e.entities?.map(t=>R.fromPartial(t))||[],n}};function Nd(){return{value:void 0,exp:0}}var we={encode(e,n=I.default.Writer.create()){return e.value!==void 0&&K.encode(e.value,n.uint32(10).fork()).ldelim(),e.exp!==0&&n.uint32(16).int32(e.exp),n},decode(e,n){let t=e instanceof I.default.Reader?e:I.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Nd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.value=K.decode(t,t.uint32());continue;case 2:if(r!==16)break;i.exp=t.int32();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{value:U(e.value)?K.fromJSON(e.value):void 0,exp:U(e.exp)?globalThis.Number(e.exp):0}},toJSON(e){let n={};return e.value!==void 0&&(n.value=K.toJSON(e.value)),e.exp!==0&&(n.exp=Math.round(e.exp)),n},create(e){return we.fromPartial(e??{})},fromPartial(e){let n=Nd();return n.value=e.value!==void 0&&e.value!==null?K.fromPartial(e.value):void 0,n.exp=e.exp??0,n}};function Td(){return{negative:!1,data:new Uint8Array(0)}}var K={encode(e,n=I.default.Writer.create()){return e.negative!==!1&&n.uint32(8).bool(e.negative),e.data.length!==0&&n.uint32(18).bytes(e.data),n},decode(e,n){let t=e instanceof I.default.Reader?e:I.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Td();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.negative=t.bool();continue;case 2:if(r!==18)break;i.data=t.bytes();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{negative:U(e.negative)?globalThis.Boolean(e.negative):!1,data:U(e.data)?Id(e.data):new Uint8Array(0)}},toJSON(e){let n={};return e.negative!==!1&&(n.negative=e.negative),e.data.length!==0&&(n.data=Ed(e.data)),n},create(e){return K.fromPartial(e??{})},fromPartial(e){let n=Td();return n.negative=e.negative??!1,n.data=e.data??new Uint8Array(0),n}};function Cd(){return{token:void 0,amount:void 0,specifiedAt:void 0}}var Pt={encode(e,n=I.default.Writer.create()){return e.token!==void 0&&Ce.encode(e.token,n.uint32(10).fork()).ldelim(),e.amount!==void 0&&we.encode(e.amount,n.uint32(18).fork()).ldelim(),e.specifiedAt!==void 0&&T.encode(Od(e.specifiedAt),n.uint32(26).fork()).ldelim(),n},decode(e,n){let t=e instanceof I.default.Reader?e:I.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Cd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.token=Ce.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.amount=we.decode(t,t.uint32());continue;case 3:if(r!==26)break;i.specifiedAt=qi(T.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{token:U(e.token)?Ce.fromJSON(e.token):void 0,amount:U(e.amount)?we.fromJSON(e.amount):void 0,specifiedAt:U(e.specifiedAt)?Rd(e.specifiedAt):void 0}},toJSON(e){let n={};return e.token!==void 0&&(n.token=Ce.toJSON(e.token)),e.amount!==void 0&&(n.amount=we.toJSON(e.amount)),e.specifiedAt!==void 0&&(n.specifiedAt=e.specifiedAt.toISOString()),n},create(e){return Pt.fromPartial(e??{})},fromPartial(e){let n=Cd();return n.token=e.token!==void 0&&e.token!==null?Ce.fromPartial(e.token):void 0,n.amount=e.amount!==void 0&&e.amount!==null?we.fromPartial(e.amount):void 0,n.specifiedAt=e.specifiedAt??void 0,n}};function Id(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{let n=globalThis.atob(e),t=new Uint8Array(n.length);for(let a=0;a<n.length;++a)t[a]=n.charCodeAt(a);return t}}function Ed(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{let n=[];return e.forEach(t=>{n.push(globalThis.String.fromCharCode(t))}),globalThis.btoa(n.join(""))}}function Od(e){let n=BigInt(Math.trunc(e.getTime()/1e3)),t=e.getTime()%1e3*1e6;return{seconds:n,nanos:t}}function qi(e){let n=(globalThis.Number(e.seconds.toString())||0)*1e3;return n+=(e.nanos||0)/1e6,new globalThis.Date(n)}function Rd(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):qi(T.fromJSON(e))}function qf(e){return BigInt(e.toString())}I.default.util.Long!==H&&(I.default.util.Long=H,I.default.configure());function Hf(e){return typeof e=="object"&&e!==null}function U(e){return e!=null}import("node:process").then(e=>e.stdout.write(""));function Qf(e){switch(e){case 0:case"UNKNOWN_TYPE":return 0;case 1:case"COUNTER":return 1;case 2:case"GAUGE":return 2;case 3:case"HISTOGRAM":return 3;case-1:case"UNRECOGNIZED":default:return-1}}function Zf(e){switch(e){case 0:return"UNKNOWN_TYPE";case 1:return"COUNTER";case 2:return"GAUGE";case 3:return"HISTOGRAM";case-1:default:return"UNRECOGNIZED"}}function zf(e){switch(e){case 0:case"COUNT":return 0;case 1:case"SUM":return 1;case 2:case"AVG":return 2;case 3:case"MIN":return 3;case 4:case"MAX":return 4;case 5:case"LAST":return 5;case-1:case"UNRECOGNIZED":default:return-1}}function Kf(e){switch(e){case 0:return"COUNT";case 1:return"SUM";case 2:return"AVG";case 3:return"MIN";case 4:return"MAX";case 5:return"LAST";case-1:default:return"UNRECOGNIZED"}}function Xf(e){switch(e){case 0:case"ADDRESS":return 0;case 1:case"OBJECT":return 1;case 2:case"WRAPPED_OBJECT":return 2;case 3:case"TYPE":return 3;case-1:case"UNRECOGNIZED":default:return-1}}function Yf(e){switch(e){case 0:return"ADDRESS";case 1:return"OBJECT";case 2:return"WRAPPED_OBJECT";case 3:return"TYPE";case-1:default:return"UNRECOGNIZED"}}function $f(e){switch(e){case 0:case"ERC20":return 0;case 1:case"ERC721":return 1;case 2:case"ERC1155":return 2;case-1:case"UNRECOGNIZED":default:return-1}}function jf(e){switch(e){case 0:return"ERC20";case 1:return"ERC721";case 2:return"ERC1155";case-1:default:return"UNRECOGNIZED"}}function Us(e){switch(e){case 0:case"UNKNOWN":return 0;case 1:case"ETH_LOG":return 1;case 2:case"ETH_BLOCK":return 2;case 5:case"ETH_TRACE":return 5;case 11:case"ETH_TRANSACTION":return 11;case 4:case"SOL_INSTRUCTION":return 4;case 6:case"APT_EVENT":return 6;case 7:case"APT_CALL":return 7;case 8:case"APT_RESOURCE":return 8;case 3:case"SUI_EVENT":return 3;case 9:case"SUI_CALL":return 9;case 10:case"SUI_OBJECT":return 10;case 12:case"SUI_OBJECT_CHANGE":return 12;case 13:case"FUEL_CALL":return 13;case 19:case"FUEL_RECEIPT":return 19;case 20:case"FUEL_TRANSACTION":return 20;case 17:case"FUEL_BLOCK":return 17;case 14:case"COSMOS_CALL":return 14;case 15:case"STARKNET_EVENT":return 15;case 16:case"BTC_TRANSACTION":return 16;case 18:case"BTC_BLOCK":return 18;case-1:case"UNRECOGNIZED":default:return-1}}function Vs(e){switch(e){case 0:return"UNKNOWN";case 1:return"ETH_LOG";case 2:return"ETH_BLOCK";case 5:return"ETH_TRACE";case 11:return"ETH_TRANSACTION";case 4:return"SOL_INSTRUCTION";case 6:return"APT_EVENT";case 7:return"APT_CALL";case 8:return"APT_RESOURCE";case 3:return"SUI_EVENT";case 9:return"SUI_CALL";case 10:return"SUI_OBJECT";case 12:return"SUI_OBJECT_CHANGE";case 13:return"FUEL_CALL";case 19:return"FUEL_RECEIPT";case 20:return"FUEL_TRANSACTION";case 17:return"FUEL_BLOCK";case 14:return"COSMOS_CALL";case 15:return"STARKNET_EVENT";case 16:return"BTC_TRANSACTION";case 18:return"BTC_BLOCK";case-1:default:return"UNRECOGNIZED"}}function Ls(e){switch(e){case 0:case"DEBUG":return 0;case 1:case"INFO":return 1;case 2:case"WARNING":return 2;case 3:case"ERROR":return 3;case 4:case"CRITICAL":return 4;case-1:case"UNRECOGNIZED":default:return-1}}function Fs(e){switch(e){case 0:return"DEBUG";case 1:return"INFO";case 2:return"WARNING";case 3:return"ERROR";case 4:return"CRITICAL";case-1:default:return"UNRECOGNIZED"}}function ec(e){switch(e){case 0:case"STRING":return 0;case 1:case"DOUBLE":return 1;case 2:case"BOOL":return 2;case 3:case"TIMESTAMP":return 3;case 4:case"BIG_INTEGER":return 4;case 5:case"BIG_DECIMAL":return 5;case-1:case"UNRECOGNIZED":default:return-1}}function nc(e){switch(e){case 0:return"STRING";case 1:return"DOUBLE";case 2:return"BOOL";case 3:return"TIMESTAMP";case 4:return"BIG_INTEGER";case 5:return"BIG_DECIMAL";case-1:default:return"UNRECOGNIZED"}}function tc(e){switch(e){case 0:case"BLOCK_NUMBER":return 0;case 1:case"SEQ_MODE":return 1;case 2:case"UNIQUE_VALUE":return 2;case-1:case"UNRECOGNIZED":default:return-1}}function rc(e){switch(e){case 0:return"BLOCK_NUMBER";case 1:return"SEQ_MODE";case 2:return"UNIQUE_VALUE";case-1:default:return"UNRECOGNIZED"}}function ic(e){switch(e){case 0:case"SET":return 0;case 1:case"ADD":return 1;case 2:case"MULTIPLY":return 2;case-1:case"UNRECOGNIZED":default:return-1}}function ac(e){switch(e){case 0:return"SET";case 1:return"ADD";case 2:return"MULTIPLY";case-1:default:return"UNRECOGNIZED"}}function oc(e){switch(e){case 0:case"EQ":return 0;case 1:case"NE":return 1;case 2:case"GT":return 2;case 3:case"GE":return 3;case 4:case"LT":return 4;case 5:case"LE":return 5;case 6:case"IN":return 6;case 7:case"NOT_IN":return 7;case 8:case"LIKE":return 8;case 9:case"NOT_LIKE":return 9;case 10:case"HAS_ALL":return 10;case 11:case"HAS_ANY":return 11;case-1:case"UNRECOGNIZED":default:return-1}}function uc(e){switch(e){case 0:return"EQ";case 1:return"NE";case 2:return"GT";case 3:return"GE";case 4:return"LT";case 5:return"LE";case 6:return"IN";case 7:return"NOT_IN";case 8:return"LIKE";case 9:return"NOT_LIKE";case 10:return"HAS_ALL";case 11:return"HAS_ANY";case-1:default:return"UNRECOGNIZED"}}function dc(e){switch(e){case 0:case"EVENT":return 0;case 1:case"GAUGE":return 1;case 2:case"COUNTER":return 2;case-1:case"UNRECOGNIZED":default:return-1}}function lc(e){switch(e){case 0:return"EVENT";case 1:return"GAUGE";case 2:return"COUNTER";case-1:default:return"UNRECOGNIZED"}}function Pd(){return{name:"",version:""}}var _t={encode(e,n=o.default.Writer.create()){return e.name!==""&&n.uint32(10).string(e.name),e.version!==""&&n.uint32(26).string(e.version),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Pd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.name=t.string();continue;case 3:if(r!==26)break;i.version=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{name:u(e.name)?globalThis.String(e.name):"",version:u(e.version)?globalThis.String(e.version):""}},toJSON(e){let n={};return e.name!==""&&(n.name=e.name),e.version!==""&&(n.version=e.version),n},create(e){return _t.fromPartial(e??{})},fromPartial(e){let n=Pd();return n.name=e.name??"",n.version=e.version??"",n}};function _d(){return{sequential:!1,forceExactBlockTime:!1,processBindingTimeout:0,skipStartBlockValidation:!1,rpcRetryTimes:0,ethAbiDecoderConfig:void 0}}var vt={encode(e,n=o.default.Writer.create()){return e.sequential!==!1&&n.uint32(8).bool(e.sequential),e.forceExactBlockTime!==!1&&n.uint32(16).bool(e.forceExactBlockTime),e.processBindingTimeout!==0&&n.uint32(24).int32(e.processBindingTimeout),e.skipStartBlockValidation!==!1&&n.uint32(32).bool(e.skipStartBlockValidation),e.rpcRetryTimes!==0&&n.uint32(40).int32(e.rpcRetryTimes),e.ethAbiDecoderConfig!==void 0&&At.encode(e.ethAbiDecoderConfig,n.uint32(50).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=_d();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.sequential=t.bool();continue;case 2:if(r!==16)break;i.forceExactBlockTime=t.bool();continue;case 3:if(r!==24)break;i.processBindingTimeout=t.int32();continue;case 4:if(r!==32)break;i.skipStartBlockValidation=t.bool();continue;case 5:if(r!==40)break;i.rpcRetryTimes=t.int32();continue;case 6:if(r!==50)break;i.ethAbiDecoderConfig=At.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{sequential:u(e.sequential)?globalThis.Boolean(e.sequential):!1,forceExactBlockTime:u(e.forceExactBlockTime)?globalThis.Boolean(e.forceExactBlockTime):!1,processBindingTimeout:u(e.processBindingTimeout)?globalThis.Number(e.processBindingTimeout):0,skipStartBlockValidation:u(e.skipStartBlockValidation)?globalThis.Boolean(e.skipStartBlockValidation):!1,rpcRetryTimes:u(e.rpcRetryTimes)?globalThis.Number(e.rpcRetryTimes):0,ethAbiDecoderConfig:u(e.ethAbiDecoderConfig)?At.fromJSON(e.ethAbiDecoderConfig):void 0}},toJSON(e){let n={};return e.sequential!==!1&&(n.sequential=e.sequential),e.forceExactBlockTime!==!1&&(n.forceExactBlockTime=e.forceExactBlockTime),e.processBindingTimeout!==0&&(n.processBindingTimeout=Math.round(e.processBindingTimeout)),e.skipStartBlockValidation!==!1&&(n.skipStartBlockValidation=e.skipStartBlockValidation),e.rpcRetryTimes!==0&&(n.rpcRetryTimes=Math.round(e.rpcRetryTimes)),e.ethAbiDecoderConfig!==void 0&&(n.ethAbiDecoderConfig=At.toJSON(e.ethAbiDecoderConfig)),n},create(e){return vt.fromPartial(e??{})},fromPartial(e){let n=_d();return n.sequential=e.sequential??!1,n.forceExactBlockTime=e.forceExactBlockTime??!1,n.processBindingTimeout=e.processBindingTimeout??0,n.skipStartBlockValidation=e.skipStartBlockValidation??!1,n.rpcRetryTimes=e.rpcRetryTimes??0,n.ethAbiDecoderConfig=e.ethAbiDecoderConfig!==void 0&&e.ethAbiDecoderConfig!==null?At.fromPartial(e.ethAbiDecoderConfig):void 0,n}};function vd(){return{enabled:!1,workerCount:void 0,skipWhenDecodeFailed:void 0}}var At={encode(e,n=o.default.Writer.create()){return e.enabled!==!1&&n.uint32(8).bool(e.enabled),e.workerCount!==void 0&&n.uint32(16).int32(e.workerCount),e.skipWhenDecodeFailed!==void 0&&n.uint32(24).bool(e.skipWhenDecodeFailed),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=vd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.enabled=t.bool();continue;case 2:if(r!==16)break;i.workerCount=t.int32();continue;case 3:if(r!==24)break;i.skipWhenDecodeFailed=t.bool();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{enabled:u(e.enabled)?globalThis.Boolean(e.enabled):!1,workerCount:u(e.workerCount)?globalThis.Number(e.workerCount):void 0,skipWhenDecodeFailed:u(e.skipWhenDecodeFailed)?globalThis.Boolean(e.skipWhenDecodeFailed):void 0}},toJSON(e){let n={};return e.enabled!==!1&&(n.enabled=e.enabled),e.workerCount!==void 0&&(n.workerCount=Math.round(e.workerCount)),e.skipWhenDecodeFailed!==void 0&&(n.skipWhenDecodeFailed=e.skipWhenDecodeFailed),n},create(e){return At.fromPartial(e??{})},fromPartial(e){let n=vd();return n.enabled=e.enabled??!1,n.workerCount=e.workerCount??void 0,n.skipWhenDecodeFailed=e.skipWhenDecodeFailed??void 0,n}};function Ad(){return{}}var ws={encode(e,n=o.default.Writer.create()){return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Ad();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{}},toJSON(e){return{}},create(e){return ws.fromPartial(e??{})},fromPartial(e){return Ad()}};function Bd(){return{config:void 0,executionConfig:void 0,contractConfigs:[],templateInstances:[],accountConfigs:[],metricConfigs:[],eventTrackingConfigs:[],exportConfigs:[],eventLogConfigs:[],dbSchema:void 0}}var Ms={encode(e,n=o.default.Writer.create()){e.config!==void 0&&_t.encode(e.config,n.uint32(10).fork()).ldelim(),e.executionConfig!==void 0&&vt.encode(e.executionConfig,n.uint32(74).fork()).ldelim();for(let t of e.contractConfigs)Bt.encode(t,n.uint32(18).fork()).ldelim();for(let t of e.templateInstances)He.encode(t,n.uint32(26).fork()).ldelim();for(let t of e.accountConfigs)Mt.encode(t,n.uint32(34).fork()).ldelim();for(let t of e.metricConfigs)Vt.encode(t,n.uint32(42).fork()).ldelim();for(let t of e.eventTrackingConfigs)xt.encode(t,n.uint32(50).fork()).ldelim();for(let t of e.exportConfigs)Ut.encode(t,n.uint32(58).fork()).ldelim();for(let t of e.eventLogConfigs)Lt.encode(t,n.uint32(66).fork()).ldelim();return e.dbSchema!==void 0&&bt.encode(e.dbSchema,n.uint32(82).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Bd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.config=_t.decode(t,t.uint32());continue;case 9:if(r!==74)break;i.executionConfig=vt.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.contractConfigs.push(Bt.decode(t,t.uint32()));continue;case 3:if(r!==26)break;i.templateInstances.push(He.decode(t,t.uint32()));continue;case 4:if(r!==34)break;i.accountConfigs.push(Mt.decode(t,t.uint32()));continue;case 5:if(r!==42)break;i.metricConfigs.push(Vt.decode(t,t.uint32()));continue;case 6:if(r!==50)break;i.eventTrackingConfigs.push(xt.decode(t,t.uint32()));continue;case 7:if(r!==58)break;i.exportConfigs.push(Ut.decode(t,t.uint32()));continue;case 8:if(r!==66)break;i.eventLogConfigs.push(Lt.decode(t,t.uint32()));continue;case 10:if(r!==82)break;i.dbSchema=bt.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{config:u(e.config)?_t.fromJSON(e.config):void 0,executionConfig:u(e.executionConfig)?vt.fromJSON(e.executionConfig):void 0,contractConfigs:globalThis.Array.isArray(e?.contractConfigs)?e.contractConfigs.map(n=>Bt.fromJSON(n)):[],templateInstances:globalThis.Array.isArray(e?.templateInstances)?e.templateInstances.map(n=>He.fromJSON(n)):[],accountConfigs:globalThis.Array.isArray(e?.accountConfigs)?e.accountConfigs.map(n=>Mt.fromJSON(n)):[],metricConfigs:globalThis.Array.isArray(e?.metricConfigs)?e.metricConfigs.map(n=>Vt.fromJSON(n)):[],eventTrackingConfigs:globalThis.Array.isArray(e?.eventTrackingConfigs)?e.eventTrackingConfigs.map(n=>xt.fromJSON(n)):[],exportConfigs:globalThis.Array.isArray(e?.exportConfigs)?e.exportConfigs.map(n=>Ut.fromJSON(n)):[],eventLogConfigs:globalThis.Array.isArray(e?.eventLogConfigs)?e.eventLogConfigs.map(n=>Lt.fromJSON(n)):[],dbSchema:u(e.dbSchema)?bt.fromJSON(e.dbSchema):void 0}},toJSON(e){let n={};return e.config!==void 0&&(n.config=_t.toJSON(e.config)),e.executionConfig!==void 0&&(n.executionConfig=vt.toJSON(e.executionConfig)),e.contractConfigs?.length&&(n.contractConfigs=e.contractConfigs.map(t=>Bt.toJSON(t))),e.templateInstances?.length&&(n.templateInstances=e.templateInstances.map(t=>He.toJSON(t))),e.accountConfigs?.length&&(n.accountConfigs=e.accountConfigs.map(t=>Mt.toJSON(t))),e.metricConfigs?.length&&(n.metricConfigs=e.metricConfigs.map(t=>Vt.toJSON(t))),e.eventTrackingConfigs?.length&&(n.eventTrackingConfigs=e.eventTrackingConfigs.map(t=>xt.toJSON(t))),e.exportConfigs?.length&&(n.exportConfigs=e.exportConfigs.map(t=>Ut.toJSON(t))),e.eventLogConfigs?.length&&(n.eventLogConfigs=e.eventLogConfigs.map(t=>Lt.toJSON(t))),e.dbSchema!==void 0&&(n.dbSchema=bt.toJSON(e.dbSchema)),n},create(e){return Ms.fromPartial(e??{})},fromPartial(e){let n=Bd();return n.config=e.config!==void 0&&e.config!==null?_t.fromPartial(e.config):void 0,n.executionConfig=e.executionConfig!==void 0&&e.executionConfig!==null?vt.fromPartial(e.executionConfig):void 0,n.contractConfigs=e.contractConfigs?.map(t=>Bt.fromPartial(t))||[],n.templateInstances=e.templateInstances?.map(t=>He.fromPartial(t))||[],n.accountConfigs=e.accountConfigs?.map(t=>Mt.fromPartial(t))||[],n.metricConfigs=e.metricConfigs?.map(t=>Vt.fromPartial(t))||[],n.eventTrackingConfigs=e.eventTrackingConfigs?.map(t=>xt.fromPartial(t))||[],n.exportConfigs=e.exportConfigs?.map(t=>Ut.fromPartial(t))||[],n.eventLogConfigs=e.eventLogConfigs?.map(t=>Lt.fromPartial(t))||[],n.dbSchema=e.dbSchema!==void 0&&e.dbSchema!==null?bt.fromPartial(e.dbSchema):void 0,n}};function bd(){return{contract:void 0,intervalConfigs:[],moveIntervalConfigs:[],logConfigs:[],traceConfigs:[],transactionConfig:[],moveEventConfigs:[],moveCallConfigs:[],moveResourceChangeConfigs:[],fuelCallConfigs:[],fuelTransactionConfigs:[],assetConfigs:[],fuelLogConfigs:[],fuelReceiptConfigs:[],cosmosLogConfigs:[],starknetEventConfigs:[],btcTransactionConfigs:[],instructionConfig:void 0,startBlock:BigInt("0"),endBlock:BigInt("0"),processorType:""}}var Bt={encode(e,n=o.default.Writer.create()){e.contract!==void 0&&qe.encode(e.contract,n.uint32(10).fork()).ldelim();for(let t of e.intervalConfigs)M.encode(t,n.uint32(90).fork()).ldelim();for(let t of e.moveIntervalConfigs)Ge.encode(t,n.uint32(154).fork()).ldelim();for(let t of e.logConfigs)Qe.encode(t,n.uint32(26).fork()).ldelim();for(let t of e.traceConfigs)Gt.encode(t,n.uint32(18).fork()).ldelim();for(let t of e.transactionConfig)qt.encode(t,n.uint32(58).fork()).ldelim();for(let t of e.moveEventConfigs)tr.encode(t,n.uint32(74).fork()).ldelim();for(let t of e.moveCallConfigs)Ze.encode(t,n.uint32(82).fork()).ldelim();for(let t of e.moveResourceChangeConfigs)ze.encode(t,n.uint32(98).fork()).ldelim();for(let t of e.fuelCallConfigs)cr.encode(t,n.uint32(106).fork()).ldelim();for(let t of e.fuelTransactionConfigs)pr.encode(t,n.uint32(162).fork()).ldelim();for(let t of e.assetConfigs)Ht.encode(t,n.uint32(114).fork()).ldelim();for(let t of e.fuelLogConfigs)Zt.encode(t,n.uint32(122).fork()).ldelim();for(let t of e.fuelReceiptConfigs)zt.encode(t,n.uint32(170).fork()).ldelim();for(let t of e.cosmosLogConfigs)Yt.encode(t,n.uint32(130).fork()).ldelim();for(let t of e.starknetEventConfigs)or.encode(t,n.uint32(138).fork()).ldelim();for(let t of e.btcTransactionConfigs)ur.encode(t,n.uint32(146).fork()).ldelim();if(e.instructionConfig!==void 0&&jt.encode(e.instructionConfig,n.uint32(50).fork()).ldelim(),e.startBlock!==BigInt("0")){if(BigInt.asUintN(64,e.startBlock)!==e.startBlock)throw new globalThis.Error("value provided for field message.startBlock of type uint64 too large");n.uint32(32).uint64(e.startBlock.toString())}if(e.endBlock!==BigInt("0")){if(BigInt.asUintN(64,e.endBlock)!==e.endBlock)throw new globalThis.Error("value provided for field message.endBlock of type uint64 too large");n.uint32(40).uint64(e.endBlock.toString())}return e.processorType!==""&&n.uint32(66).string(e.processorType),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=bd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.contract=qe.decode(t,t.uint32());continue;case 11:if(r!==90)break;i.intervalConfigs.push(M.decode(t,t.uint32()));continue;case 19:if(r!==154)break;i.moveIntervalConfigs.push(Ge.decode(t,t.uint32()));continue;case 3:if(r!==26)break;i.logConfigs.push(Qe.decode(t,t.uint32()));continue;case 2:if(r!==18)break;i.traceConfigs.push(Gt.decode(t,t.uint32()));continue;case 7:if(r!==58)break;i.transactionConfig.push(qt.decode(t,t.uint32()));continue;case 9:if(r!==74)break;i.moveEventConfigs.push(tr.decode(t,t.uint32()));continue;case 10:if(r!==82)break;i.moveCallConfigs.push(Ze.decode(t,t.uint32()));continue;case 12:if(r!==98)break;i.moveResourceChangeConfigs.push(ze.decode(t,t.uint32()));continue;case 13:if(r!==106)break;i.fuelCallConfigs.push(cr.decode(t,t.uint32()));continue;case 20:if(r!==162)break;i.fuelTransactionConfigs.push(pr.decode(t,t.uint32()));continue;case 14:if(r!==114)break;i.assetConfigs.push(Ht.decode(t,t.uint32()));continue;case 15:if(r!==122)break;i.fuelLogConfigs.push(Zt.decode(t,t.uint32()));continue;case 21:if(r!==170)break;i.fuelReceiptConfigs.push(zt.decode(t,t.uint32()));continue;case 16:if(r!==130)break;i.cosmosLogConfigs.push(Yt.decode(t,t.uint32()));continue;case 17:if(r!==138)break;i.starknetEventConfigs.push(or.decode(t,t.uint32()));continue;case 18:if(r!==146)break;i.btcTransactionConfigs.push(ur.decode(t,t.uint32()));continue;case 6:if(r!==50)break;i.instructionConfig=jt.decode(t,t.uint32());continue;case 4:if(r!==32)break;i.startBlock=G(t.uint64());continue;case 5:if(r!==40)break;i.endBlock=G(t.uint64());continue;case 8:if(r!==66)break;i.processorType=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{contract:u(e.contract)?qe.fromJSON(e.contract):void 0,intervalConfigs:globalThis.Array.isArray(e?.intervalConfigs)?e.intervalConfigs.map(n=>M.fromJSON(n)):[],moveIntervalConfigs:globalThis.Array.isArray(e?.moveIntervalConfigs)?e.moveIntervalConfigs.map(n=>Ge.fromJSON(n)):[],logConfigs:globalThis.Array.isArray(e?.logConfigs)?e.logConfigs.map(n=>Qe.fromJSON(n)):[],traceConfigs:globalThis.Array.isArray(e?.traceConfigs)?e.traceConfigs.map(n=>Gt.fromJSON(n)):[],transactionConfig:globalThis.Array.isArray(e?.transactionConfig)?e.transactionConfig.map(n=>qt.fromJSON(n)):[],moveEventConfigs:globalThis.Array.isArray(e?.moveEventConfigs)?e.moveEventConfigs.map(n=>tr.fromJSON(n)):[],moveCallConfigs:globalThis.Array.isArray(e?.moveCallConfigs)?e.moveCallConfigs.map(n=>Ze.fromJSON(n)):[],moveResourceChangeConfigs:globalThis.Array.isArray(e?.moveResourceChangeConfigs)?e.moveResourceChangeConfigs.map(n=>ze.fromJSON(n)):[],fuelCallConfigs:globalThis.Array.isArray(e?.fuelCallConfigs)?e.fuelCallConfigs.map(n=>cr.fromJSON(n)):[],fuelTransactionConfigs:globalThis.Array.isArray(e?.fuelTransactionConfigs)?e.fuelTransactionConfigs.map(n=>pr.fromJSON(n)):[],assetConfigs:globalThis.Array.isArray(e?.assetConfigs)?e.assetConfigs.map(n=>Ht.fromJSON(n)):[],fuelLogConfigs:globalThis.Array.isArray(e?.fuelLogConfigs)?e.fuelLogConfigs.map(n=>Zt.fromJSON(n)):[],fuelReceiptConfigs:globalThis.Array.isArray(e?.fuelReceiptConfigs)?e.fuelReceiptConfigs.map(n=>zt.fromJSON(n)):[],cosmosLogConfigs:globalThis.Array.isArray(e?.cosmosLogConfigs)?e.cosmosLogConfigs.map(n=>Yt.fromJSON(n)):[],starknetEventConfigs:globalThis.Array.isArray(e?.starknetEventConfigs)?e.starknetEventConfigs.map(n=>or.fromJSON(n)):[],btcTransactionConfigs:globalThis.Array.isArray(e?.btcTransactionConfigs)?e.btcTransactionConfigs.map(n=>ur.fromJSON(n)):[],instructionConfig:u(e.instructionConfig)?jt.fromJSON(e.instructionConfig):void 0,startBlock:u(e.startBlock)?BigInt(e.startBlock):BigInt("0"),endBlock:u(e.endBlock)?BigInt(e.endBlock):BigInt("0"),processorType:u(e.processorType)?globalThis.String(e.processorType):""}},toJSON(e){let n={};return e.contract!==void 0&&(n.contract=qe.toJSON(e.contract)),e.intervalConfigs?.length&&(n.intervalConfigs=e.intervalConfigs.map(t=>M.toJSON(t))),e.moveIntervalConfigs?.length&&(n.moveIntervalConfigs=e.moveIntervalConfigs.map(t=>Ge.toJSON(t))),e.logConfigs?.length&&(n.logConfigs=e.logConfigs.map(t=>Qe.toJSON(t))),e.traceConfigs?.length&&(n.traceConfigs=e.traceConfigs.map(t=>Gt.toJSON(t))),e.transactionConfig?.length&&(n.transactionConfig=e.transactionConfig.map(t=>qt.toJSON(t))),e.moveEventConfigs?.length&&(n.moveEventConfigs=e.moveEventConfigs.map(t=>tr.toJSON(t))),e.moveCallConfigs?.length&&(n.moveCallConfigs=e.moveCallConfigs.map(t=>Ze.toJSON(t))),e.moveResourceChangeConfigs?.length&&(n.moveResourceChangeConfigs=e.moveResourceChangeConfigs.map(t=>ze.toJSON(t))),e.fuelCallConfigs?.length&&(n.fuelCallConfigs=e.fuelCallConfigs.map(t=>cr.toJSON(t))),e.fuelTransactionConfigs?.length&&(n.fuelTransactionConfigs=e.fuelTransactionConfigs.map(t=>pr.toJSON(t))),e.assetConfigs?.length&&(n.assetConfigs=e.assetConfigs.map(t=>Ht.toJSON(t))),e.fuelLogConfigs?.length&&(n.fuelLogConfigs=e.fuelLogConfigs.map(t=>Zt.toJSON(t))),e.fuelReceiptConfigs?.length&&(n.fuelReceiptConfigs=e.fuelReceiptConfigs.map(t=>zt.toJSON(t))),e.cosmosLogConfigs?.length&&(n.cosmosLogConfigs=e.cosmosLogConfigs.map(t=>Yt.toJSON(t))),e.starknetEventConfigs?.length&&(n.starknetEventConfigs=e.starknetEventConfigs.map(t=>or.toJSON(t))),e.btcTransactionConfigs?.length&&(n.btcTransactionConfigs=e.btcTransactionConfigs.map(t=>ur.toJSON(t))),e.instructionConfig!==void 0&&(n.instructionConfig=jt.toJSON(e.instructionConfig)),e.startBlock!==BigInt("0")&&(n.startBlock=e.startBlock.toString()),e.endBlock!==BigInt("0")&&(n.endBlock=e.endBlock.toString()),e.processorType!==""&&(n.processorType=e.processorType),n},create(e){return Bt.fromPartial(e??{})},fromPartial(e){let n=bd();return n.contract=e.contract!==void 0&&e.contract!==null?qe.fromPartial(e.contract):void 0,n.intervalConfigs=e.intervalConfigs?.map(t=>M.fromPartial(t))||[],n.moveIntervalConfigs=e.moveIntervalConfigs?.map(t=>Ge.fromPartial(t))||[],n.logConfigs=e.logConfigs?.map(t=>Qe.fromPartial(t))||[],n.traceConfigs=e.traceConfigs?.map(t=>Gt.fromPartial(t))||[],n.transactionConfig=e.transactionConfig?.map(t=>qt.fromPartial(t))||[],n.moveEventConfigs=e.moveEventConfigs?.map(t=>tr.fromPartial(t))||[],n.moveCallConfigs=e.moveCallConfigs?.map(t=>Ze.fromPartial(t))||[],n.moveResourceChangeConfigs=e.moveResourceChangeConfigs?.map(t=>ze.fromPartial(t))||[],n.fuelCallConfigs=e.fuelCallConfigs?.map(t=>cr.fromPartial(t))||[],n.fuelTransactionConfigs=e.fuelTransactionConfigs?.map(t=>pr.fromPartial(t))||[],n.assetConfigs=e.assetConfigs?.map(t=>Ht.fromPartial(t))||[],n.fuelLogConfigs=e.fuelLogConfigs?.map(t=>Zt.fromPartial(t))||[],n.fuelReceiptConfigs=e.fuelReceiptConfigs?.map(t=>zt.fromPartial(t))||[],n.cosmosLogConfigs=e.cosmosLogConfigs?.map(t=>Yt.fromPartial(t))||[],n.starknetEventConfigs=e.starknetEventConfigs?.map(t=>or.fromPartial(t))||[],n.btcTransactionConfigs=e.btcTransactionConfigs?.map(t=>ur.fromPartial(t))||[],n.instructionConfig=e.instructionConfig!==void 0&&e.instructionConfig!==null?jt.fromPartial(e.instructionConfig):void 0,n.startBlock=e.startBlock??BigInt("0"),n.endBlock=e.endBlock??BigInt("0"),n.processorType=e.processorType??"",n}};function Dd(){return{gqlSchema:""}}var bt={encode(e,n=o.default.Writer.create()){return e.gqlSchema!==""&&n.uint32(10).string(e.gqlSchema),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Dd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.gqlSchema=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{gqlSchema:u(e.gqlSchema)?globalThis.String(e.gqlSchema):""}},toJSON(e){let n={};return e.gqlSchema!==""&&(n.gqlSchema=e.gqlSchema),n},create(e){return bt.fromPartial(e??{})},fromPartial(e){let n=Dd();return n.gqlSchema=e.gqlSchema??"",n}};function Jd(){return{}}var Dt={encode(e,n=o.default.Writer.create()){return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Jd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{}},toJSON(e){return{}},create(e){return Dt.fromPartial(e??{})},fromPartial(e){return Jd()}};function xd(){return{retentionEventName:"",days:0}}var Jt={encode(e,n=o.default.Writer.create()){return e.retentionEventName!==""&&n.uint32(18).string(e.retentionEventName),e.days!==0&&n.uint32(24).int32(e.days),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=xd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 2:if(r!==18)break;i.retentionEventName=t.string();continue;case 3:if(r!==24)break;i.days=t.int32();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{retentionEventName:u(e.retentionEventName)?globalThis.String(e.retentionEventName):"",days:u(e.days)?globalThis.Number(e.days):0}},toJSON(e){let n={};return e.retentionEventName!==""&&(n.retentionEventName=e.retentionEventName),e.days!==0&&(n.days=Math.round(e.days)),n},create(e){return Jt.fromPartial(e??{})},fromPartial(e){let n=xd();return n.retentionEventName=e.retentionEventName??"",n.days=e.days??0,n}};function Ud(){return{eventName:"",totalByDay:!1,unique:!1,totalPerEntity:void 0,distinctAggregationByDays:[],retentionConfig:void 0}}var xt={encode(e,n=o.default.Writer.create()){e.eventName!==""&&n.uint32(10).string(e.eventName),e.totalByDay!==!1&&n.uint32(16).bool(e.totalByDay),e.unique!==!1&&n.uint32(24).bool(e.unique),e.totalPerEntity!==void 0&&Dt.encode(e.totalPerEntity,n.uint32(34).fork()).ldelim(),n.uint32(42).fork();for(let t of e.distinctAggregationByDays)n.int32(t);return n.ldelim(),e.retentionConfig!==void 0&&Jt.encode(e.retentionConfig,n.uint32(50).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Ud();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.eventName=t.string();continue;case 2:if(r!==16)break;i.totalByDay=t.bool();continue;case 3:if(r!==24)break;i.unique=t.bool();continue;case 4:if(r!==34)break;i.totalPerEntity=Dt.decode(t,t.uint32());continue;case 5:if(r===40){i.distinctAggregationByDays.push(t.int32());continue}if(r===42){let s=t.uint32()+t.pos;for(;t.pos<s;)i.distinctAggregationByDays.push(t.int32());continue}break;case 6:if(r!==50)break;i.retentionConfig=Jt.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{eventName:u(e.eventName)?globalThis.String(e.eventName):"",totalByDay:u(e.totalByDay)?globalThis.Boolean(e.totalByDay):!1,unique:u(e.unique)?globalThis.Boolean(e.unique):!1,totalPerEntity:u(e.totalPerEntity)?Dt.fromJSON(e.totalPerEntity):void 0,distinctAggregationByDays:globalThis.Array.isArray(e?.distinctAggregationByDays)?e.distinctAggregationByDays.map(n=>globalThis.Number(n)):[],retentionConfig:u(e.retentionConfig)?Jt.fromJSON(e.retentionConfig):void 0}},toJSON(e){let n={};return e.eventName!==""&&(n.eventName=e.eventName),e.totalByDay!==!1&&(n.totalByDay=e.totalByDay),e.unique!==!1&&(n.unique=e.unique),e.totalPerEntity!==void 0&&(n.totalPerEntity=Dt.toJSON(e.totalPerEntity)),e.distinctAggregationByDays?.length&&(n.distinctAggregationByDays=e.distinctAggregationByDays.map(t=>Math.round(t))),e.retentionConfig!==void 0&&(n.retentionConfig=Jt.toJSON(e.retentionConfig)),n},create(e){return xt.fromPartial(e??{})},fromPartial(e){let n=Ud();return n.eventName=e.eventName??"",n.totalByDay=e.totalByDay??!1,n.unique=e.unique??!1,n.totalPerEntity=e.totalPerEntity!==void 0&&e.totalPerEntity!==null?Dt.fromPartial(e.totalPerEntity):void 0,n.distinctAggregationByDays=e.distinctAggregationByDays?.map(t=>t)||[],n.retentionConfig=e.retentionConfig!==void 0&&e.retentionConfig!==null?Jt.fromPartial(e.retentionConfig):void 0,n}};function Vd(){return{name:"",channel:""}}var Ut={encode(e,n=o.default.Writer.create()){return e.name!==""&&n.uint32(10).string(e.name),e.channel!==""&&n.uint32(18).string(e.channel),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Vd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.name=t.string();continue;case 2:if(r!==18)break;i.channel=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{name:u(e.name)?globalThis.String(e.name):"",channel:u(e.channel)?globalThis.String(e.channel):""}},toJSON(e){let n={};return e.name!==""&&(n.name=e.name),e.channel!==""&&(n.channel=e.channel),n},create(e){return Ut.fromPartial(e??{})},fromPartial(e){let n=Vd();return n.name=e.name??"",n.channel=e.channel??"",n}};function Ld(){return{name:"",description:"",unit:"",sparse:!1,persistentBetweenVersion:!1,type:0,aggregationConfig:void 0}}var Vt={encode(e,n=o.default.Writer.create()){return e.name!==""&&n.uint32(10).string(e.name),e.description!==""&&n.uint32(26).string(e.description),e.unit!==""&&n.uint32(18).string(e.unit),e.sparse!==!1&&n.uint32(32).bool(e.sparse),e.persistentBetweenVersion!==!1&&n.uint32(40).bool(e.persistentBetweenVersion),e.type!==0&&n.uint32(56).int32(e.type),e.aggregationConfig!==void 0&&wt.encode(e.aggregationConfig,n.uint32(50).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Ld();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.name=t.string();continue;case 3:if(r!==26)break;i.description=t.string();continue;case 2:if(r!==18)break;i.unit=t.string();continue;case 4:if(r!==32)break;i.sparse=t.bool();continue;case 5:if(r!==40)break;i.persistentBetweenVersion=t.bool();continue;case 7:if(r!==56)break;i.type=t.int32();continue;case 6:if(r!==50)break;i.aggregationConfig=wt.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{name:u(e.name)?globalThis.String(e.name):"",description:u(e.description)?globalThis.String(e.description):"",unit:u(e.unit)?globalThis.String(e.unit):"",sparse:u(e.sparse)?globalThis.Boolean(e.sparse):!1,persistentBetweenVersion:u(e.persistentBetweenVersion)?globalThis.Boolean(e.persistentBetweenVersion):!1,type:u(e.type)?Qf(e.type):0,aggregationConfig:u(e.aggregationConfig)?wt.fromJSON(e.aggregationConfig):void 0}},toJSON(e){let n={};return e.name!==""&&(n.name=e.name),e.description!==""&&(n.description=e.description),e.unit!==""&&(n.unit=e.unit),e.sparse!==!1&&(n.sparse=e.sparse),e.persistentBetweenVersion!==!1&&(n.persistentBetweenVersion=e.persistentBetweenVersion),e.type!==0&&(n.type=Zf(e.type)),e.aggregationConfig!==void 0&&(n.aggregationConfig=wt.toJSON(e.aggregationConfig)),n},create(e){return Vt.fromPartial(e??{})},fromPartial(e){let n=Ld();return n.name=e.name??"",n.description=e.description??"",n.unit=e.unit??"",n.sparse=e.sparse??!1,n.persistentBetweenVersion=e.persistentBetweenVersion??!1,n.type=e.type??0,n.aggregationConfig=e.aggregationConfig!==void 0&&e.aggregationConfig!==null?wt.fromPartial(e.aggregationConfig):void 0,n}};function Fd(){return{name:"",fields:[]}}var Lt={encode(e,n=o.default.Writer.create()){e.name!==""&&n.uint32(10).string(e.name);for(let t of e.fields)We.encode(t,n.uint32(18).fork()).ldelim();return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Fd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.name=t.string();continue;case 2:if(r!==18)break;i.fields.push(We.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{name:u(e.name)?globalThis.String(e.name):"",fields:globalThis.Array.isArray(e?.fields)?e.fields.map(n=>We.fromJSON(n)):[]}},toJSON(e){let n={};return e.name!==""&&(n.name=e.name),e.fields?.length&&(n.fields=e.fields.map(t=>We.toJSON(t))),n},create(e){return Lt.fromPartial(e??{})},fromPartial(e){let n=Fd();return n.name=e.name??"",n.fields=e.fields?.map(t=>We.fromPartial(t))||[],n}};function wd(){return{fields:[]}}var Ft={encode(e,n=o.default.Writer.create()){for(let t of e.fields)We.encode(t,n.uint32(18).fork()).ldelim();return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=wd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 2:if(r!==18)break;i.fields.push(We.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{fields:globalThis.Array.isArray(e?.fields)?e.fields.map(n=>We.fromJSON(n)):[]}},toJSON(e){let n={};return e.fields?.length&&(n.fields=e.fields.map(t=>We.toJSON(t))),n},create(e){return Ft.fromPartial(e??{})},fromPartial(e){let n=wd();return n.fields=e.fields?.map(t=>We.fromPartial(t))||[],n}};function Md(){return{name:"",basicType:void 0,coinType:void 0,structType:void 0}}var We={encode(e,n=o.default.Writer.create()){return e.name!==""&&n.uint32(10).string(e.name),e.basicType!==void 0&&n.uint32(16).int32(e.basicType),e.coinType!==void 0&&Ce.encode(e.coinType,n.uint32(26).fork()).ldelim(),e.structType!==void 0&&Ft.encode(e.structType,n.uint32(34).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Md();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.name=t.string();continue;case 2:if(r!==16)break;i.basicType=t.int32();continue;case 3:if(r!==26)break;i.coinType=Ce.decode(t,t.uint32());continue;case 4:if(r!==34)break;i.structType=Ft.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{name:u(e.name)?globalThis.String(e.name):"",basicType:u(e.basicType)?ec(e.basicType):void 0,coinType:u(e.coinType)?Ce.fromJSON(e.coinType):void 0,structType:u(e.structType)?Ft.fromJSON(e.structType):void 0}},toJSON(e){let n={};return e.name!==""&&(n.name=e.name),e.basicType!==void 0&&(n.basicType=nc(e.basicType)),e.coinType!==void 0&&(n.coinType=Ce.toJSON(e.coinType)),e.structType!==void 0&&(n.structType=Ft.toJSON(e.structType)),n},create(e){return We.fromPartial(e??{})},fromPartial(e){let n=Md();return n.name=e.name??"",n.basicType=e.basicType??void 0,n.coinType=e.coinType!==void 0&&e.coinType!==null?Ce.fromPartial(e.coinType):void 0,n.structType=e.structType!==void 0&&e.structType!==null?Ft.fromPartial(e.structType):void 0,n}};function Wd(){return{intervalInMinutes:[],types:[],discardOrigin:!1}}var wt={encode(e,n=o.default.Writer.create()){n.uint32(10).fork();for(let t of e.intervalInMinutes)n.int32(t);n.ldelim(),n.uint32(18).fork();for(let t of e.types)n.int32(t);return n.ldelim(),e.discardOrigin!==!1&&n.uint32(24).bool(e.discardOrigin),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Wd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r===8){i.intervalInMinutes.push(t.int32());continue}if(r===10){let s=t.uint32()+t.pos;for(;t.pos<s;)i.intervalInMinutes.push(t.int32());continue}break;case 2:if(r===16){i.types.push(t.int32());continue}if(r===18){let s=t.uint32()+t.pos;for(;t.pos<s;)i.types.push(t.int32());continue}break;case 3:if(r!==24)break;i.discardOrigin=t.bool();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{intervalInMinutes:globalThis.Array.isArray(e?.intervalInMinutes)?e.intervalInMinutes.map(n=>globalThis.Number(n)):[],types:globalThis.Array.isArray(e?.types)?e.types.map(n=>zf(n)):[],discardOrigin:u(e.discardOrigin)?globalThis.Boolean(e.discardOrigin):!1}},toJSON(e){let n={};return e.intervalInMinutes?.length&&(n.intervalInMinutes=e.intervalInMinutes.map(t=>Math.round(t))),e.types?.length&&(n.types=e.types.map(t=>Kf(t))),e.discardOrigin!==!1&&(n.discardOrigin=e.discardOrigin),n},create(e){return wt.fromPartial(e??{})},fromPartial(e){let n=Wd();return n.intervalInMinutes=e.intervalInMinutes?.map(t=>t)||[],n.types=e.types?.map(t=>t)||[],n.discardOrigin=e.discardOrigin??!1,n}};function Gd(){return{chainId:"",address:"",startBlock:BigInt("0"),endBlock:BigInt("0"),intervalConfigs:[],aptosIntervalConfigs:[],moveIntervalConfigs:[],moveCallConfigs:[],moveResourceChangeConfigs:[],logConfigs:[]}}var Mt={encode(e,n=o.default.Writer.create()){if(e.chainId!==""&&n.uint32(10).string(e.chainId),e.address!==""&&n.uint32(18).string(e.address),e.startBlock!==BigInt("0")){if(BigInt.asUintN(64,e.startBlock)!==e.startBlock)throw new globalThis.Error("value provided for field message.startBlock of type uint64 too large");n.uint32(24).uint64(e.startBlock.toString())}if(e.endBlock!==BigInt("0")){if(BigInt.asUintN(64,e.endBlock)!==e.endBlock)throw new globalThis.Error("value provided for field message.endBlock of type uint64 too large");n.uint32(80).uint64(e.endBlock.toString())}for(let t of e.intervalConfigs)M.encode(t,n.uint32(34).fork()).ldelim();for(let t of e.aptosIntervalConfigs)Wt.encode(t,n.uint32(42).fork()).ldelim();for(let t of e.moveIntervalConfigs)Ge.encode(t,n.uint32(58).fork()).ldelim();for(let t of e.moveCallConfigs)Ze.encode(t,n.uint32(66).fork()).ldelim();for(let t of e.moveResourceChangeConfigs)ze.encode(t,n.uint32(74).fork()).ldelim();for(let t of e.logConfigs)Qe.encode(t,n.uint32(50).fork()).ldelim();return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Gd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.chainId=t.string();continue;case 2:if(r!==18)break;i.address=t.string();continue;case 3:if(r!==24)break;i.startBlock=G(t.uint64());continue;case 10:if(r!==80)break;i.endBlock=G(t.uint64());continue;case 4:if(r!==34)break;i.intervalConfigs.push(M.decode(t,t.uint32()));continue;case 5:if(r!==42)break;i.aptosIntervalConfigs.push(Wt.decode(t,t.uint32()));continue;case 7:if(r!==58)break;i.moveIntervalConfigs.push(Ge.decode(t,t.uint32()));continue;case 8:if(r!==66)break;i.moveCallConfigs.push(Ze.decode(t,t.uint32()));continue;case 9:if(r!==74)break;i.moveResourceChangeConfigs.push(ze.decode(t,t.uint32()));continue;case 6:if(r!==50)break;i.logConfigs.push(Qe.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{chainId:u(e.chainId)?globalThis.String(e.chainId):"",address:u(e.address)?globalThis.String(e.address):"",startBlock:u(e.startBlock)?BigInt(e.startBlock):BigInt("0"),endBlock:u(e.endBlock)?BigInt(e.endBlock):BigInt("0"),intervalConfigs:globalThis.Array.isArray(e?.intervalConfigs)?e.intervalConfigs.map(n=>M.fromJSON(n)):[],aptosIntervalConfigs:globalThis.Array.isArray(e?.aptosIntervalConfigs)?e.aptosIntervalConfigs.map(n=>Wt.fromJSON(n)):[],moveIntervalConfigs:globalThis.Array.isArray(e?.moveIntervalConfigs)?e.moveIntervalConfigs.map(n=>Ge.fromJSON(n)):[],moveCallConfigs:globalThis.Array.isArray(e?.moveCallConfigs)?e.moveCallConfigs.map(n=>Ze.fromJSON(n)):[],moveResourceChangeConfigs:globalThis.Array.isArray(e?.moveResourceChangeConfigs)?e.moveResourceChangeConfigs.map(n=>ze.fromJSON(n)):[],logConfigs:globalThis.Array.isArray(e?.logConfigs)?e.logConfigs.map(n=>Qe.fromJSON(n)):[]}},toJSON(e){let n={};return e.chainId!==""&&(n.chainId=e.chainId),e.address!==""&&(n.address=e.address),e.startBlock!==BigInt("0")&&(n.startBlock=e.startBlock.toString()),e.endBlock!==BigInt("0")&&(n.endBlock=e.endBlock.toString()),e.intervalConfigs?.length&&(n.intervalConfigs=e.intervalConfigs.map(t=>M.toJSON(t))),e.aptosIntervalConfigs?.length&&(n.aptosIntervalConfigs=e.aptosIntervalConfigs.map(t=>Wt.toJSON(t))),e.moveIntervalConfigs?.length&&(n.moveIntervalConfigs=e.moveIntervalConfigs.map(t=>Ge.toJSON(t))),e.moveCallConfigs?.length&&(n.moveCallConfigs=e.moveCallConfigs.map(t=>Ze.toJSON(t))),e.moveResourceChangeConfigs?.length&&(n.moveResourceChangeConfigs=e.moveResourceChangeConfigs.map(t=>ze.toJSON(t))),e.logConfigs?.length&&(n.logConfigs=e.logConfigs.map(t=>Qe.toJSON(t))),n},create(e){return Mt.fromPartial(e??{})},fromPartial(e){let n=Gd();return n.chainId=e.chainId??"",n.address=e.address??"",n.startBlock=e.startBlock??BigInt("0"),n.endBlock=e.endBlock??BigInt("0"),n.intervalConfigs=e.intervalConfigs?.map(t=>M.fromPartial(t))||[],n.aptosIntervalConfigs=e.aptosIntervalConfigs?.map(t=>Wt.fromPartial(t))||[],n.moveIntervalConfigs=e.moveIntervalConfigs?.map(t=>Ge.fromPartial(t))||[],n.moveCallConfigs=e.moveCallConfigs?.map(t=>Ze.fromPartial(t))||[],n.moveResourceChangeConfigs=e.moveResourceChangeConfigs?.map(t=>ze.fromPartial(t))||[],n.logConfigs=e.logConfigs?.map(t=>Qe.fromPartial(t))||[],n}};function qd(){return{recentInterval:0,backfillInterval:0}}var Me={encode(e,n=o.default.Writer.create()){return e.recentInterval!==0&&n.uint32(8).int32(e.recentInterval),e.backfillInterval!==0&&n.uint32(16).int32(e.backfillInterval),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=qd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.recentInterval=t.int32();continue;case 2:if(r!==16)break;i.backfillInterval=t.int32();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{recentInterval:u(e.recentInterval)?globalThis.Number(e.recentInterval):0,backfillInterval:u(e.backfillInterval)?globalThis.Number(e.backfillInterval):0}},toJSON(e){let n={};return e.recentInterval!==0&&(n.recentInterval=Math.round(e.recentInterval)),e.backfillInterval!==0&&(n.backfillInterval=Math.round(e.backfillInterval)),n},create(e){return Me.fromPartial(e??{})},fromPartial(e){let n=qd();return n.recentInterval=e.recentInterval??0,n.backfillInterval=e.backfillInterval??0,n}};function Hd(){return{handlerId:0,minutes:0,minutesInterval:void 0,slot:0,slotInterval:void 0,fetchConfig:void 0,handlerName:""}}var M={encode(e,n=o.default.Writer.create()){return e.handlerId!==0&&n.uint32(8).int32(e.handlerId),e.minutes!==0&&n.uint32(16).int32(e.minutes),e.minutesInterval!==void 0&&Me.encode(e.minutesInterval,n.uint32(34).fork()).ldelim(),e.slot!==0&&n.uint32(24).int32(e.slot),e.slotInterval!==void 0&&Me.encode(e.slotInterval,n.uint32(42).fork()).ldelim(),e.fetchConfig!==void 0&&W.encode(e.fetchConfig,n.uint32(50).fork()).ldelim(),e.handlerName!==""&&n.uint32(58).string(e.handlerName),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Hd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.handlerId=t.int32();continue;case 2:if(r!==16)break;i.minutes=t.int32();continue;case 4:if(r!==34)break;i.minutesInterval=Me.decode(t,t.uint32());continue;case 3:if(r!==24)break;i.slot=t.int32();continue;case 5:if(r!==42)break;i.slotInterval=Me.decode(t,t.uint32());continue;case 6:if(r!==50)break;i.fetchConfig=W.decode(t,t.uint32());continue;case 7:if(r!==58)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{handlerId:u(e.handlerId)?globalThis.Number(e.handlerId):0,minutes:u(e.minutes)?globalThis.Number(e.minutes):0,minutesInterval:u(e.minutesInterval)?Me.fromJSON(e.minutesInterval):void 0,slot:u(e.slot)?globalThis.Number(e.slot):0,slotInterval:u(e.slotInterval)?Me.fromJSON(e.slotInterval):void 0,fetchConfig:u(e.fetchConfig)?W.fromJSON(e.fetchConfig):void 0,handlerName:u(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.minutes!==0&&(n.minutes=Math.round(e.minutes)),e.minutesInterval!==void 0&&(n.minutesInterval=Me.toJSON(e.minutesInterval)),e.slot!==0&&(n.slot=Math.round(e.slot)),e.slotInterval!==void 0&&(n.slotInterval=Me.toJSON(e.slotInterval)),e.fetchConfig!==void 0&&(n.fetchConfig=W.toJSON(e.fetchConfig)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return M.fromPartial(e??{})},fromPartial(e){let n=Hd();return n.handlerId=e.handlerId??0,n.minutes=e.minutes??0,n.minutesInterval=e.minutesInterval!==void 0&&e.minutesInterval!==null?Me.fromPartial(e.minutesInterval):void 0,n.slot=e.slot??0,n.slotInterval=e.slotInterval!==void 0&&e.slotInterval!==null?Me.fromPartial(e.slotInterval):void 0,n.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?W.fromPartial(e.fetchConfig):void 0,n.handlerName=e.handlerName??"",n}};function Qd(){return{intervalConfig:void 0,type:""}}var Wt={encode(e,n=o.default.Writer.create()){return e.intervalConfig!==void 0&&M.encode(e.intervalConfig,n.uint32(10).fork()).ldelim(),e.type!==""&&n.uint32(18).string(e.type),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Qd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.intervalConfig=M.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.type=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{intervalConfig:u(e.intervalConfig)?M.fromJSON(e.intervalConfig):void 0,type:u(e.type)?globalThis.String(e.type):""}},toJSON(e){let n={};return e.intervalConfig!==void 0&&(n.intervalConfig=M.toJSON(e.intervalConfig)),e.type!==""&&(n.type=e.type),n},create(e){return Wt.fromPartial(e??{})},fromPartial(e){let n=Qd();return n.intervalConfig=e.intervalConfig!==void 0&&e.intervalConfig!==null?M.fromPartial(e.intervalConfig):void 0,n.type=e.type??"",n}};function Zd(){return{intervalConfig:void 0,type:"",ownerType:0,resourceFetchConfig:void 0,fetchConfig:void 0}}var Ge={encode(e,n=o.default.Writer.create()){return e.intervalConfig!==void 0&&M.encode(e.intervalConfig,n.uint32(10).fork()).ldelim(),e.type!==""&&n.uint32(18).string(e.type),e.ownerType!==0&&n.uint32(24).int32(e.ownerType),e.resourceFetchConfig!==void 0&&nr.encode(e.resourceFetchConfig,n.uint32(34).fork()).ldelim(),e.fetchConfig!==void 0&&re.encode(e.fetchConfig,n.uint32(42).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Zd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.intervalConfig=M.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.type=t.string();continue;case 3:if(r!==24)break;i.ownerType=t.int32();continue;case 4:if(r!==34)break;i.resourceFetchConfig=nr.decode(t,t.uint32());continue;case 5:if(r!==42)break;i.fetchConfig=re.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{intervalConfig:u(e.intervalConfig)?M.fromJSON(e.intervalConfig):void 0,type:u(e.type)?globalThis.String(e.type):"",ownerType:u(e.ownerType)?Xf(e.ownerType):0,resourceFetchConfig:u(e.resourceFetchConfig)?nr.fromJSON(e.resourceFetchConfig):void 0,fetchConfig:u(e.fetchConfig)?re.fromJSON(e.fetchConfig):void 0}},toJSON(e){let n={};return e.intervalConfig!==void 0&&(n.intervalConfig=M.toJSON(e.intervalConfig)),e.type!==""&&(n.type=e.type),e.ownerType!==0&&(n.ownerType=Yf(e.ownerType)),e.resourceFetchConfig!==void 0&&(n.resourceFetchConfig=nr.toJSON(e.resourceFetchConfig)),e.fetchConfig!==void 0&&(n.fetchConfig=re.toJSON(e.fetchConfig)),n},create(e){return Ge.fromPartial(e??{})},fromPartial(e){let n=Zd();return n.intervalConfig=e.intervalConfig!==void 0&&e.intervalConfig!==null?M.fromPartial(e.intervalConfig):void 0,n.type=e.type??"",n.ownerType=e.ownerType??0,n.resourceFetchConfig=e.resourceFetchConfig!==void 0&&e.resourceFetchConfig!==null?nr.fromPartial(e.resourceFetchConfig):void 0,n.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?re.fromPartial(e.fetchConfig):void 0,n}};function zd(){return{name:"",chainId:"",address:"",abi:""}}var qe={encode(e,n=o.default.Writer.create()){return e.name!==""&&n.uint32(10).string(e.name),e.chainId!==""&&n.uint32(18).string(e.chainId),e.address!==""&&n.uint32(26).string(e.address),e.abi!==""&&n.uint32(34).string(e.abi),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=zd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.name=t.string();continue;case 2:if(r!==18)break;i.chainId=t.string();continue;case 3:if(r!==26)break;i.address=t.string();continue;case 4:if(r!==34)break;i.abi=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{name:u(e.name)?globalThis.String(e.name):"",chainId:u(e.chainId)?globalThis.String(e.chainId):"",address:u(e.address)?globalThis.String(e.address):"",abi:u(e.abi)?globalThis.String(e.abi):""}},toJSON(e){let n={};return e.name!==""&&(n.name=e.name),e.chainId!==""&&(n.chainId=e.chainId),e.address!==""&&(n.address=e.address),e.abi!==""&&(n.abi=e.abi),n},create(e){return qe.fromPartial(e??{})},fromPartial(e){let n=zd();return n.name=e.name??"",n.chainId=e.chainId??"",n.address=e.address??"",n.abi=e.abi??"",n}};function Kd(){return{contract:void 0,startBlock:BigInt("0"),endBlock:BigInt("0"),templateId:0,baseLabels:void 0}}var He={encode(e,n=o.default.Writer.create()){if(e.contract!==void 0&&qe.encode(e.contract,n.uint32(10).fork()).ldelim(),e.startBlock!==BigInt("0")){if(BigInt.asUintN(64,e.startBlock)!==e.startBlock)throw new globalThis.Error("value provided for field message.startBlock of type uint64 too large");n.uint32(16).uint64(e.startBlock.toString())}if(e.endBlock!==BigInt("0")){if(BigInt.asUintN(64,e.endBlock)!==e.endBlock)throw new globalThis.Error("value provided for field message.endBlock of type uint64 too large");n.uint32(24).uint64(e.endBlock.toString())}return e.templateId!==0&&n.uint32(32).int32(e.templateId),e.baseLabels!==void 0&&f.encode(f.wrap(e.baseLabels),n.uint32(42).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Kd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.contract=qe.decode(t,t.uint32());continue;case 2:if(r!==16)break;i.startBlock=G(t.uint64());continue;case 3:if(r!==24)break;i.endBlock=G(t.uint64());continue;case 4:if(r!==32)break;i.templateId=t.int32();continue;case 5:if(r!==42)break;i.baseLabels=f.unwrap(f.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{contract:u(e.contract)?qe.fromJSON(e.contract):void 0,startBlock:u(e.startBlock)?BigInt(e.startBlock):BigInt("0"),endBlock:u(e.endBlock)?BigInt(e.endBlock):BigInt("0"),templateId:u(e.templateId)?globalThis.Number(e.templateId):0,baseLabels:C(e.baseLabels)?e.baseLabels:void 0}},toJSON(e){let n={};return e.contract!==void 0&&(n.contract=qe.toJSON(e.contract)),e.startBlock!==BigInt("0")&&(n.startBlock=e.startBlock.toString()),e.endBlock!==BigInt("0")&&(n.endBlock=e.endBlock.toString()),e.templateId!==0&&(n.templateId=Math.round(e.templateId)),e.baseLabels!==void 0&&(n.baseLabels=e.baseLabels),n},create(e){return He.fromPartial(e??{})},fromPartial(e){let n=Kd();return n.contract=e.contract!==void 0&&e.contract!==null?qe.fromPartial(e.contract):void 0,n.startBlock=e.startBlock??BigInt("0"),n.endBlock=e.endBlock??BigInt("0"),n.templateId=e.templateId??0,n.baseLabels=e.baseLabels??void 0,n}};function Xd(){return{templateInstances:[]}}var Ws={encode(e,n=o.default.Writer.create()){for(let t of e.templateInstances)He.encode(t,n.uint32(10).fork()).ldelim();return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Xd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.templateInstances.push(He.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{templateInstances:globalThis.Array.isArray(e?.templateInstances)?e.templateInstances.map(n=>He.fromJSON(n)):[]}},toJSON(e){let n={};return e.templateInstances?.length&&(n.templateInstances=e.templateInstances.map(t=>He.toJSON(t))),n},create(e){return Ws.fromPartial(e??{})},fromPartial(e){let n=Xd();return n.templateInstances=e.templateInstances?.map(t=>He.fromPartial(t))||[],n}};function Yd(){return{transaction:!1,transactionReceipt:!1,transactionReceiptLogs:!1,block:!1,trace:!1}}var W={encode(e,n=o.default.Writer.create()){return e.transaction!==!1&&n.uint32(8).bool(e.transaction),e.transactionReceipt!==!1&&n.uint32(16).bool(e.transactionReceipt),e.transactionReceiptLogs!==!1&&n.uint32(40).bool(e.transactionReceiptLogs),e.block!==!1&&n.uint32(24).bool(e.block),e.trace!==!1&&n.uint32(32).bool(e.trace),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Yd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.transaction=t.bool();continue;case 2:if(r!==16)break;i.transactionReceipt=t.bool();continue;case 5:if(r!==40)break;i.transactionReceiptLogs=t.bool();continue;case 3:if(r!==24)break;i.block=t.bool();continue;case 4:if(r!==32)break;i.trace=t.bool();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{transaction:u(e.transaction)?globalThis.Boolean(e.transaction):!1,transactionReceipt:u(e.transactionReceipt)?globalThis.Boolean(e.transactionReceipt):!1,transactionReceiptLogs:u(e.transactionReceiptLogs)?globalThis.Boolean(e.transactionReceiptLogs):!1,block:u(e.block)?globalThis.Boolean(e.block):!1,trace:u(e.trace)?globalThis.Boolean(e.trace):!1}},toJSON(e){let n={};return e.transaction!==!1&&(n.transaction=e.transaction),e.transactionReceipt!==!1&&(n.transactionReceipt=e.transactionReceipt),e.transactionReceiptLogs!==!1&&(n.transactionReceiptLogs=e.transactionReceiptLogs),e.block!==!1&&(n.block=e.block),e.trace!==!1&&(n.trace=e.trace),n},create(e){return W.fromPartial(e??{})},fromPartial(e){let n=Yd();return n.transaction=e.transaction??!1,n.transactionReceipt=e.transactionReceipt??!1,n.transactionReceiptLogs=e.transactionReceiptLogs??!1,n.block=e.block??!1,n.trace=e.trace??!1,n}};function $d(){return{signature:"",handlerId:0,fetchConfig:void 0,handlerName:""}}var Gt={encode(e,n=o.default.Writer.create()){return e.signature!==""&&n.uint32(10).string(e.signature),e.handlerId!==0&&n.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&W.encode(e.fetchConfig,n.uint32(26).fork()).ldelim(),e.handlerName!==""&&n.uint32(34).string(e.handlerName),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=$d();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.signature=t.string();continue;case 2:if(r!==16)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.fetchConfig=W.decode(t,t.uint32());continue;case 4:if(r!==34)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{signature:u(e.signature)?globalThis.String(e.signature):"",handlerId:u(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:u(e.fetchConfig)?W.fromJSON(e.fetchConfig):void 0,handlerName:u(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.signature!==""&&(n.signature=e.signature),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(n.fetchConfig=W.toJSON(e.fetchConfig)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return Gt.fromPartial(e??{})},fromPartial(e){let n=$d();return n.signature=e.signature??"",n.handlerId=e.handlerId??0,n.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?W.fromPartial(e.fetchConfig):void 0,n.handlerName=e.handlerName??"",n}};function jd(){return{handlerId:0,fetchConfig:void 0,handlerName:""}}var qt={encode(e,n=o.default.Writer.create()){return e.handlerId!==0&&n.uint32(8).int32(e.handlerId),e.fetchConfig!==void 0&&W.encode(e.fetchConfig,n.uint32(26).fork()).ldelim(),e.handlerName!==""&&n.uint32(34).string(e.handlerName),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=jd();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.fetchConfig=W.decode(t,t.uint32());continue;case 4:if(r!==34)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{handlerId:u(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:u(e.fetchConfig)?W.fromJSON(e.fetchConfig):void 0,handlerName:u(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(n.fetchConfig=W.toJSON(e.fetchConfig)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return qt.fromPartial(e??{})},fromPartial(e){let n=jd();return n.handlerId=e.handlerId??0,n.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?W.fromPartial(e.fetchConfig):void 0,n.handlerName=e.handlerName??"",n}};function el(){return{filters:[],handlerId:0,fetchConfig:void 0,handlerName:""}}var Qe={encode(e,n=o.default.Writer.create()){for(let t of e.filters)$t.encode(t,n.uint32(10).fork()).ldelim();return e.handlerId!==0&&n.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&W.encode(e.fetchConfig,n.uint32(26).fork()).ldelim(),e.handlerName!==""&&n.uint32(34).string(e.handlerName),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=el();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.filters.push($t.decode(t,t.uint32()));continue;case 2:if(r!==16)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.fetchConfig=W.decode(t,t.uint32());continue;case 4:if(r!==34)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(n=>$t.fromJSON(n)):[],handlerId:u(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:u(e.fetchConfig)?W.fromJSON(e.fetchConfig):void 0,handlerName:u(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.filters?.length&&(n.filters=e.filters.map(t=>$t.toJSON(t))),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(n.fetchConfig=W.toJSON(e.fetchConfig)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return Qe.fromPartial(e??{})},fromPartial(e){let n=el();return n.filters=e.filters?.map(t=>$t.fromPartial(t))||[],n.handlerId=e.handlerId??0,n.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?W.fromPartial(e.fetchConfig):void 0,n.handlerName=e.handlerName??"",n}};function nl(){return{filters:[],handlerId:0,handlerName:""}}var Ht={encode(e,n=o.default.Writer.create()){for(let t of e.filters)Qt.encode(t,n.uint32(10).fork()).ldelim();return e.handlerId!==0&&n.uint32(16).int32(e.handlerId),e.handlerName!==""&&n.uint32(26).string(e.handlerName),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=nl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.filters.push(Qt.decode(t,t.uint32()));continue;case 2:if(r!==16)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(n=>Qt.fromJSON(n)):[],handlerId:u(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:u(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.filters?.length&&(n.filters=e.filters.map(t=>Qt.toJSON(t))),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return Ht.fromPartial(e??{})},fromPartial(e){let n=nl();return n.filters=e.filters?.map(t=>Qt.fromPartial(t))||[],n.handlerId=e.handlerId??0,n.handlerName=e.handlerName??"",n}};function tl(){return{assetId:void 0,fromAddress:void 0,toAddress:void 0}}var Qt={encode(e,n=o.default.Writer.create()){return e.assetId!==void 0&&n.uint32(10).string(e.assetId),e.fromAddress!==void 0&&n.uint32(18).string(e.fromAddress),e.toAddress!==void 0&&n.uint32(26).string(e.toAddress),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=tl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.assetId=t.string();continue;case 2:if(r!==18)break;i.fromAddress=t.string();continue;case 3:if(r!==26)break;i.toAddress=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{assetId:u(e.assetId)?globalThis.String(e.assetId):void 0,fromAddress:u(e.fromAddress)?globalThis.String(e.fromAddress):void 0,toAddress:u(e.toAddress)?globalThis.String(e.toAddress):void 0}},toJSON(e){let n={};return e.assetId!==void 0&&(n.assetId=e.assetId),e.fromAddress!==void 0&&(n.fromAddress=e.fromAddress),e.toAddress!==void 0&&(n.toAddress=e.toAddress),n},create(e){return Qt.fromPartial(e??{})},fromPartial(e){let n=tl();return n.assetId=e.assetId??void 0,n.fromAddress=e.fromAddress??void 0,n.toAddress=e.toAddress??void 0,n}};function rl(){return{logIds:[],handlerId:0,handlerName:""}}var Zt={encode(e,n=o.default.Writer.create()){for(let t of e.logIds)n.uint32(10).string(t);return e.handlerId!==0&&n.uint32(16).int32(e.handlerId),e.handlerName!==""&&n.uint32(26).string(e.handlerName),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=rl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.logIds.push(t.string());continue;case 2:if(r!==16)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{logIds:globalThis.Array.isArray(e?.logIds)?e.logIds.map(n=>globalThis.String(n)):[],handlerId:u(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:u(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.logIds?.length&&(n.logIds=e.logIds),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return Zt.fromPartial(e??{})},fromPartial(e){let n=rl();return n.logIds=e.logIds?.map(t=>t)||[],n.handlerId=e.handlerId??0,n.handlerName=e.handlerName??"",n}};function il(){return{log:void 0,transfer:void 0,handlerId:0,handlerName:""}}var zt={encode(e,n=o.default.Writer.create()){return e.log!==void 0&&Xt.encode(e.log,n.uint32(10).fork()).ldelim(),e.transfer!==void 0&&Kt.encode(e.transfer,n.uint32(18).fork()).ldelim(),e.handlerId!==0&&n.uint32(24).int32(e.handlerId),e.handlerName!==""&&n.uint32(34).string(e.handlerName),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=il();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.log=Xt.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.transfer=Kt.decode(t,t.uint32());continue;case 3:if(r!==24)break;i.handlerId=t.int32();continue;case 4:if(r!==34)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{log:u(e.log)?Xt.fromJSON(e.log):void 0,transfer:u(e.transfer)?Kt.fromJSON(e.transfer):void 0,handlerId:u(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:u(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.log!==void 0&&(n.log=Xt.toJSON(e.log)),e.transfer!==void 0&&(n.transfer=Kt.toJSON(e.transfer)),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return zt.fromPartial(e??{})},fromPartial(e){let n=il();return n.log=e.log!==void 0&&e.log!==null?Xt.fromPartial(e.log):void 0,n.transfer=e.transfer!==void 0&&e.transfer!==null?Kt.fromPartial(e.transfer):void 0,n.handlerId=e.handlerId??0,n.handlerName=e.handlerName??"",n}};function al(){return{assetId:"",from:"",to:""}}var Kt={encode(e,n=o.default.Writer.create()){return e.assetId!==""&&n.uint32(34).string(e.assetId),e.from!==""&&n.uint32(10).string(e.from),e.to!==""&&n.uint32(18).string(e.to),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=al();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 4:if(r!==34)break;i.assetId=t.string();continue;case 1:if(r!==10)break;i.from=t.string();continue;case 2:if(r!==18)break;i.to=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{assetId:u(e.assetId)?globalThis.String(e.assetId):"",from:u(e.from)?globalThis.String(e.from):"",to:u(e.to)?globalThis.String(e.to):""}},toJSON(e){let n={};return e.assetId!==""&&(n.assetId=e.assetId),e.from!==""&&(n.from=e.from),e.to!==""&&(n.to=e.to),n},create(e){return Kt.fromPartial(e??{})},fromPartial(e){let n=al();return n.assetId=e.assetId??"",n.from=e.from??"",n.to=e.to??"",n}};function ol(){return{logIds:[]}}var Xt={encode(e,n=o.default.Writer.create()){for(let t of e.logIds)n.uint32(10).string(t);return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=ol();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.logIds.push(t.string());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{logIds:globalThis.Array.isArray(e?.logIds)?e.logIds.map(n=>globalThis.String(n)):[]}},toJSON(e){let n={};return e.logIds?.length&&(n.logIds=e.logIds),n},create(e){return Xt.fromPartial(e??{})},fromPartial(e){let n=ol();return n.logIds=e.logIds?.map(t=>t)||[],n}};function ul(){return{logFilters:[],handlerId:0,handlerName:""}}var Yt={encode(e,n=o.default.Writer.create()){for(let t of e.logFilters)n.uint32(10).string(t);return e.handlerId!==0&&n.uint32(16).int32(e.handlerId),e.handlerName!==""&&n.uint32(26).string(e.handlerName),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=ul();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.logFilters.push(t.string());continue;case 2:if(r!==16)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{logFilters:globalThis.Array.isArray(e?.logFilters)?e.logFilters.map(n=>globalThis.String(n)):[],handlerId:u(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:u(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.logFilters?.length&&(n.logFilters=e.logFilters),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return Yt.fromPartial(e??{})},fromPartial(e){let n=ul();return n.logFilters=e.logFilters?.map(t=>t)||[],n.handlerId=e.handlerId??0,n.handlerName=e.handlerName??"",n}};function dl(){return{topics:[],address:void 0,addressType:void 0}}var $t={encode(e,n=o.default.Writer.create()){for(let t of e.topics)gr.encode(t,n.uint32(10).fork()).ldelim();return e.address!==void 0&&n.uint32(18).string(e.address),e.addressType!==void 0&&n.uint32(24).int32(e.addressType),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=dl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.topics.push(gr.decode(t,t.uint32()));continue;case 2:if(r!==18)break;i.address=t.string();continue;case 3:if(r!==24)break;i.addressType=t.int32();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{topics:globalThis.Array.isArray(e?.topics)?e.topics.map(n=>gr.fromJSON(n)):[],address:u(e.address)?globalThis.String(e.address):void 0,addressType:u(e.addressType)?$f(e.addressType):void 0}},toJSON(e){let n={};return e.topics?.length&&(n.topics=e.topics.map(t=>gr.toJSON(t))),e.address!==void 0&&(n.address=e.address),e.addressType!==void 0&&(n.addressType=jf(e.addressType)),n},create(e){return $t.fromPartial(e??{})},fromPartial(e){let n=dl();return n.topics=e.topics?.map(t=>gr.fromPartial(t))||[],n.address=e.address??void 0,n.addressType=e.addressType??void 0,n}};function ll(){return{innerInstruction:!1,parsedInstruction:!1,rawDataInstruction:!1}}var jt={encode(e,n=o.default.Writer.create()){return e.innerInstruction!==!1&&n.uint32(8).bool(e.innerInstruction),e.parsedInstruction!==!1&&n.uint32(16).bool(e.parsedInstruction),e.rawDataInstruction!==!1&&n.uint32(24).bool(e.rawDataInstruction),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=ll();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.innerInstruction=t.bool();continue;case 2:if(r!==16)break;i.parsedInstruction=t.bool();continue;case 3:if(r!==24)break;i.rawDataInstruction=t.bool();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{innerInstruction:u(e.innerInstruction)?globalThis.Boolean(e.innerInstruction):!1,parsedInstruction:u(e.parsedInstruction)?globalThis.Boolean(e.parsedInstruction):!1,rawDataInstruction:u(e.rawDataInstruction)?globalThis.Boolean(e.rawDataInstruction):!1}},toJSON(e){let n={};return e.innerInstruction!==!1&&(n.innerInstruction=e.innerInstruction),e.parsedInstruction!==!1&&(n.parsedInstruction=e.parsedInstruction),e.rawDataInstruction!==!1&&(n.rawDataInstruction=e.rawDataInstruction),n},create(e){return jt.fromPartial(e??{})},fromPartial(e){let n=ll();return n.innerInstruction=e.innerInstruction??!1,n.parsedInstruction=e.parsedInstruction??!1,n.rawDataInstruction=e.rawDataInstruction??!1,n}};function sl(){return{moveTypePrefix:""}}var er={encode(e,n=o.default.Writer.create()){return e.moveTypePrefix!==""&&n.uint32(10).string(e.moveTypePrefix),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=sl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.moveTypePrefix=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{moveTypePrefix:u(e.moveTypePrefix)?globalThis.String(e.moveTypePrefix):""}},toJSON(e){let n={};return e.moveTypePrefix!==""&&(n.moveTypePrefix=e.moveTypePrefix),n},create(e){return er.fromPartial(e??{})},fromPartial(e){let n=sl();return n.moveTypePrefix=e.moveTypePrefix??"",n}};function fl(){return{resourceChanges:!1,allEvents:!1,inputs:!1,resourceConfig:void 0,supportMultisigFunc:void 0,includeFailedTransaction:void 0}}var re={encode(e,n=o.default.Writer.create()){return e.resourceChanges!==!1&&n.uint32(8).bool(e.resourceChanges),e.allEvents!==!1&&n.uint32(16).bool(e.allEvents),e.inputs!==!1&&n.uint32(32).bool(e.inputs),e.resourceConfig!==void 0&&er.encode(e.resourceConfig,n.uint32(26).fork()).ldelim(),e.supportMultisigFunc!==void 0&&n.uint32(40).bool(e.supportMultisigFunc),e.includeFailedTransaction!==void 0&&n.uint32(48).bool(e.includeFailedTransaction),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=fl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.resourceChanges=t.bool();continue;case 2:if(r!==16)break;i.allEvents=t.bool();continue;case 4:if(r!==32)break;i.inputs=t.bool();continue;case 3:if(r!==26)break;i.resourceConfig=er.decode(t,t.uint32());continue;case 5:if(r!==40)break;i.supportMultisigFunc=t.bool();continue;case 6:if(r!==48)break;i.includeFailedTransaction=t.bool();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{resourceChanges:u(e.resourceChanges)?globalThis.Boolean(e.resourceChanges):!1,allEvents:u(e.allEvents)?globalThis.Boolean(e.allEvents):!1,inputs:u(e.inputs)?globalThis.Boolean(e.inputs):!1,resourceConfig:u(e.resourceConfig)?er.fromJSON(e.resourceConfig):void 0,supportMultisigFunc:u(e.supportMultisigFunc)?globalThis.Boolean(e.supportMultisigFunc):void 0,includeFailedTransaction:u(e.includeFailedTransaction)?globalThis.Boolean(e.includeFailedTransaction):void 0}},toJSON(e){let n={};return e.resourceChanges!==!1&&(n.resourceChanges=e.resourceChanges),e.allEvents!==!1&&(n.allEvents=e.allEvents),e.inputs!==!1&&(n.inputs=e.inputs),e.resourceConfig!==void 0&&(n.resourceConfig=er.toJSON(e.resourceConfig)),e.supportMultisigFunc!==void 0&&(n.supportMultisigFunc=e.supportMultisigFunc),e.includeFailedTransaction!==void 0&&(n.includeFailedTransaction=e.includeFailedTransaction),n},create(e){return re.fromPartial(e??{})},fromPartial(e){let n=fl();return n.resourceChanges=e.resourceChanges??!1,n.allEvents=e.allEvents??!1,n.inputs=e.inputs??!1,n.resourceConfig=e.resourceConfig!==void 0&&e.resourceConfig!==null?er.fromPartial(e.resourceConfig):void 0,n.supportMultisigFunc=e.supportMultisigFunc??void 0,n.includeFailedTransaction=e.includeFailedTransaction??void 0,n}};function cl(){return{owned:!1}}var nr={encode(e,n=o.default.Writer.create()){return e.owned!==!1&&n.uint32(8).bool(e.owned),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=cl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.owned=t.bool();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{owned:u(e.owned)?globalThis.Boolean(e.owned):!1}},toJSON(e){let n={};return e.owned!==!1&&(n.owned=e.owned),n},create(e){return nr.fromPartial(e??{})},fromPartial(e){let n=cl();return n.owned=e.owned??!1,n}};function pl(){return{filters:[],handlerId:0,fetchConfig:void 0,handlerName:""}}var tr={encode(e,n=o.default.Writer.create()){for(let t of e.filters)rr.encode(t,n.uint32(10).fork()).ldelim();return e.handlerId!==0&&n.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&re.encode(e.fetchConfig,n.uint32(26).fork()).ldelim(),e.handlerName!==""&&n.uint32(34).string(e.handlerName),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=pl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.filters.push(rr.decode(t,t.uint32()));continue;case 2:if(r!==16)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.fetchConfig=re.decode(t,t.uint32());continue;case 4:if(r!==34)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(n=>rr.fromJSON(n)):[],handlerId:u(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:u(e.fetchConfig)?re.fromJSON(e.fetchConfig):void 0,handlerName:u(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.filters?.length&&(n.filters=e.filters.map(t=>rr.toJSON(t))),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(n.fetchConfig=re.toJSON(e.fetchConfig)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return tr.fromPartial(e??{})},fromPartial(e){let n=pl();return n.filters=e.filters?.map(t=>rr.fromPartial(t))||[],n.handlerId=e.handlerId??0,n.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?re.fromPartial(e.fetchConfig):void 0,n.handlerName=e.handlerName??"",n}};function gl(){return{type:"",account:"",eventAccount:""}}var rr={encode(e,n=o.default.Writer.create()){return e.type!==""&&n.uint32(10).string(e.type),e.account!==""&&n.uint32(18).string(e.account),e.eventAccount!==""&&n.uint32(26).string(e.eventAccount),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=gl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.type=t.string();continue;case 2:if(r!==18)break;i.account=t.string();continue;case 3:if(r!==26)break;i.eventAccount=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{type:u(e.type)?globalThis.String(e.type):"",account:u(e.account)?globalThis.String(e.account):"",eventAccount:u(e.eventAccount)?globalThis.String(e.eventAccount):""}},toJSON(e){let n={};return e.type!==""&&(n.type=e.type),e.account!==""&&(n.account=e.account),e.eventAccount!==""&&(n.eventAccount=e.eventAccount),n},create(e){return rr.fromPartial(e??{})},fromPartial(e){let n=gl();return n.type=e.type??"",n.account=e.account??"",n.eventAccount=e.eventAccount??"",n}};function hl(){return{filters:[],handlerId:0,fetchConfig:void 0,handlerName:""}}var Ze={encode(e,n=o.default.Writer.create()){for(let t of e.filters)ir.encode(t,n.uint32(10).fork()).ldelim();return e.handlerId!==0&&n.uint32(16).int32(e.handlerId),e.fetchConfig!==void 0&&re.encode(e.fetchConfig,n.uint32(26).fork()).ldelim(),e.handlerName!==""&&n.uint32(34).string(e.handlerName),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=hl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.filters.push(ir.decode(t,t.uint32()));continue;case 2:if(r!==16)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.fetchConfig=re.decode(t,t.uint32());continue;case 4:if(r!==34)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(n=>ir.fromJSON(n)):[],handlerId:u(e.handlerId)?globalThis.Number(e.handlerId):0,fetchConfig:u(e.fetchConfig)?re.fromJSON(e.fetchConfig):void 0,handlerName:u(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.filters?.length&&(n.filters=e.filters.map(t=>ir.toJSON(t))),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.fetchConfig!==void 0&&(n.fetchConfig=re.toJSON(e.fetchConfig)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return Ze.fromPartial(e??{})},fromPartial(e){let n=hl();return n.filters=e.filters?.map(t=>ir.fromPartial(t))||[],n.handlerId=e.handlerId??0,n.fetchConfig=e.fetchConfig!==void 0&&e.fetchConfig!==null?re.fromPartial(e.fetchConfig):void 0,n.handlerName=e.handlerName??"",n}};function ml(){return{type:"",includeDeleted:!1,handlerId:0,handlerName:""}}var ze={encode(e,n=o.default.Writer.create()){return e.type!==""&&n.uint32(10).string(e.type),e.includeDeleted!==!1&&n.uint32(32).bool(e.includeDeleted),e.handlerId!==0&&n.uint32(16).int32(e.handlerId),e.handlerName!==""&&n.uint32(26).string(e.handlerName),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=ml();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.type=t.string();continue;case 4:if(r!==32)break;i.includeDeleted=t.bool();continue;case 2:if(r!==16)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{type:u(e.type)?globalThis.String(e.type):"",includeDeleted:u(e.includeDeleted)?globalThis.Boolean(e.includeDeleted):!1,handlerId:u(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:u(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.type!==""&&(n.type=e.type),e.includeDeleted!==!1&&(n.includeDeleted=e.includeDeleted),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return ze.fromPartial(e??{})},fromPartial(e){let n=ml();return n.type=e.type??"",n.includeDeleted=e.includeDeleted??!1,n.handlerId=e.handlerId??0,n.handlerName=e.handlerName??"",n}};function yl(){return{function:"",typeArguments:[],withTypeArguments:!1,includeFailed:!1,publicKeyPrefix:"",fromAndToAddress:void 0}}var ir={encode(e,n=o.default.Writer.create()){e.function!==""&&n.uint32(10).string(e.function);for(let t of e.typeArguments)n.uint32(18).string(t);return e.withTypeArguments!==!1&&n.uint32(24).bool(e.withTypeArguments),e.includeFailed!==!1&&n.uint32(32).bool(e.includeFailed),e.publicKeyPrefix!==""&&n.uint32(42).string(e.publicKeyPrefix),e.fromAndToAddress!==void 0&&ar.encode(e.fromAndToAddress,n.uint32(50).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=yl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.function=t.string();continue;case 2:if(r!==18)break;i.typeArguments.push(t.string());continue;case 3:if(r!==24)break;i.withTypeArguments=t.bool();continue;case 4:if(r!==32)break;i.includeFailed=t.bool();continue;case 5:if(r!==42)break;i.publicKeyPrefix=t.string();continue;case 6:if(r!==50)break;i.fromAndToAddress=ar.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{function:u(e.function)?globalThis.String(e.function):"",typeArguments:globalThis.Array.isArray(e?.typeArguments)?e.typeArguments.map(n=>globalThis.String(n)):[],withTypeArguments:u(e.withTypeArguments)?globalThis.Boolean(e.withTypeArguments):!1,includeFailed:u(e.includeFailed)?globalThis.Boolean(e.includeFailed):!1,publicKeyPrefix:u(e.publicKeyPrefix)?globalThis.String(e.publicKeyPrefix):"",fromAndToAddress:u(e.fromAndToAddress)?ar.fromJSON(e.fromAndToAddress):void 0}},toJSON(e){let n={};return e.function!==""&&(n.function=e.function),e.typeArguments?.length&&(n.typeArguments=e.typeArguments),e.withTypeArguments!==!1&&(n.withTypeArguments=e.withTypeArguments),e.includeFailed!==!1&&(n.includeFailed=e.includeFailed),e.publicKeyPrefix!==""&&(n.publicKeyPrefix=e.publicKeyPrefix),e.fromAndToAddress!==void 0&&(n.fromAndToAddress=ar.toJSON(e.fromAndToAddress)),n},create(e){return ir.fromPartial(e??{})},fromPartial(e){let n=yl();return n.function=e.function??"",n.typeArguments=e.typeArguments?.map(t=>t)||[],n.withTypeArguments=e.withTypeArguments??!1,n.includeFailed=e.includeFailed??!1,n.publicKeyPrefix=e.publicKeyPrefix??"",n.fromAndToAddress=e.fromAndToAddress!==void 0&&e.fromAndToAddress!==null?ar.fromPartial(e.fromAndToAddress):void 0,n}};function kl(){return{from:"",to:""}}var ar={encode(e,n=o.default.Writer.create()){return e.from!==""&&n.uint32(10).string(e.from),e.to!==""&&n.uint32(18).string(e.to),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=kl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.from=t.string();continue;case 2:if(r!==18)break;i.to=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{from:u(e.from)?globalThis.String(e.from):"",to:u(e.to)?globalThis.String(e.to):""}},toJSON(e){let n={};return e.from!==""&&(n.from=e.from),e.to!==""&&(n.to=e.to),n},create(e){return ar.fromPartial(e??{})},fromPartial(e){let n=kl();return n.from=e.from??"",n.to=e.to??"",n}};function Sl(){return{filters:[],handlerId:0,handlerName:""}}var or={encode(e,n=o.default.Writer.create()){for(let t of e.filters)sr.encode(t,n.uint32(10).fork()).ldelim();return e.handlerId!==0&&n.uint32(16).int32(e.handlerId),e.handlerName!==""&&n.uint32(26).string(e.handlerName),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Sl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.filters.push(sr.decode(t,t.uint32()));continue;case 2:if(r!==16)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(n=>sr.fromJSON(n)):[],handlerId:u(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:u(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.filters?.length&&(n.filters=e.filters.map(t=>sr.toJSON(t))),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return or.fromPartial(e??{})},fromPartial(e){let n=Sl();return n.filters=e.filters?.map(t=>sr.fromPartial(t))||[],n.handlerId=e.handlerId??0,n.handlerName=e.handlerName??"",n}};function Nl(){return{filters:[],handlerId:0,handlerName:""}}var ur={encode(e,n=o.default.Writer.create()){for(let t of e.filters)Ke.encode(t,n.uint32(10).fork()).ldelim();return e.handlerId!==0&&n.uint32(16).int32(e.handlerId),e.handlerName!==""&&n.uint32(26).string(e.handlerName),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Nl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.filters.push(Ke.decode(t,t.uint32()));continue;case 2:if(r!==16)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(n=>Ke.fromJSON(n)):[],handlerId:u(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:u(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.filters?.length&&(n.filters=e.filters.map(t=>Ke.toJSON(t))),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return ur.fromPartial(e??{})},fromPartial(e){let n=Nl();return n.filters=e.filters?.map(t=>Ke.fromPartial(t))||[],n.handlerId=e.handlerId??0,n.handlerName=e.handlerName??"",n}};function Tl(){return{inputFilter:void 0,outputFilter:void 0,filter:[]}}var Ke={encode(e,n=o.default.Writer.create()){e.inputFilter!==void 0&&dr.encode(e.inputFilter,n.uint32(10).fork()).ldelim(),e.outputFilter!==void 0&&lr.encode(e.outputFilter,n.uint32(18).fork()).ldelim();for(let t of e.filter)ie.encode(t,n.uint32(26).fork()).ldelim();return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Tl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.inputFilter=dr.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.outputFilter=lr.decode(t,t.uint32());continue;case 3:if(r!==26)break;i.filter.push(ie.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{inputFilter:u(e.inputFilter)?dr.fromJSON(e.inputFilter):void 0,outputFilter:u(e.outputFilter)?lr.fromJSON(e.outputFilter):void 0,filter:globalThis.Array.isArray(e?.filter)?e.filter.map(n=>ie.fromJSON(n)):[]}},toJSON(e){let n={};return e.inputFilter!==void 0&&(n.inputFilter=dr.toJSON(e.inputFilter)),e.outputFilter!==void 0&&(n.outputFilter=lr.toJSON(e.outputFilter)),e.filter?.length&&(n.filter=e.filter.map(t=>ie.toJSON(t))),n},create(e){return Ke.fromPartial(e??{})},fromPartial(e){let n=Tl();return n.inputFilter=e.inputFilter!==void 0&&e.inputFilter!==null?dr.fromPartial(e.inputFilter):void 0,n.outputFilter=e.outputFilter!==void 0&&e.outputFilter!==null?lr.fromPartial(e.outputFilter):void 0,n.filter=e.filter?.map(t=>ie.fromPartial(t))||[],n}};function Cl(){return{eq:void 0,gt:void 0,gte:void 0,lt:void 0,lte:void 0,ne:void 0,prefix:void 0,contains:void 0,notContains:void 0,lengthEq:void 0,lengthGt:void 0,lengthLt:void 0,hasAny:void 0,hasAll:void 0,in:void 0}}var fn={encode(e,n=o.default.Writer.create()){return e.eq!==void 0&&k.encode(e.eq,n.uint32(10).fork()).ldelim(),e.gt!==void 0&&k.encode(e.gt,n.uint32(18).fork()).ldelim(),e.gte!==void 0&&k.encode(e.gte,n.uint32(26).fork()).ldelim(),e.lt!==void 0&&k.encode(e.lt,n.uint32(34).fork()).ldelim(),e.lte!==void 0&&k.encode(e.lte,n.uint32(42).fork()).ldelim(),e.ne!==void 0&&k.encode(e.ne,n.uint32(50).fork()).ldelim(),e.prefix!==void 0&&n.uint32(58).string(e.prefix),e.contains!==void 0&&n.uint32(66).string(e.contains),e.notContains!==void 0&&n.uint32(74).string(e.notContains),e.lengthEq!==void 0&&n.uint32(80).int32(e.lengthEq),e.lengthGt!==void 0&&n.uint32(88).int32(e.lengthGt),e.lengthLt!==void 0&&n.uint32(96).int32(e.lengthLt),e.hasAny!==void 0&&A.encode(e.hasAny,n.uint32(106).fork()).ldelim(),e.hasAll!==void 0&&A.encode(e.hasAll,n.uint32(114).fork()).ldelim(),e.in!==void 0&&A.encode(e.in,n.uint32(122).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Cl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.eq=k.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.gt=k.decode(t,t.uint32());continue;case 3:if(r!==26)break;i.gte=k.decode(t,t.uint32());continue;case 4:if(r!==34)break;i.lt=k.decode(t,t.uint32());continue;case 5:if(r!==42)break;i.lte=k.decode(t,t.uint32());continue;case 6:if(r!==50)break;i.ne=k.decode(t,t.uint32());continue;case 7:if(r!==58)break;i.prefix=t.string();continue;case 8:if(r!==66)break;i.contains=t.string();continue;case 9:if(r!==74)break;i.notContains=t.string();continue;case 10:if(r!==80)break;i.lengthEq=t.int32();continue;case 11:if(r!==88)break;i.lengthGt=t.int32();continue;case 12:if(r!==96)break;i.lengthLt=t.int32();continue;case 13:if(r!==106)break;i.hasAny=A.decode(t,t.uint32());continue;case 14:if(r!==114)break;i.hasAll=A.decode(t,t.uint32());continue;case 15:if(r!==122)break;i.in=A.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{eq:u(e.eq)?k.fromJSON(e.eq):void 0,gt:u(e.gt)?k.fromJSON(e.gt):void 0,gte:u(e.gte)?k.fromJSON(e.gte):void 0,lt:u(e.lt)?k.fromJSON(e.lt):void 0,lte:u(e.lte)?k.fromJSON(e.lte):void 0,ne:u(e.ne)?k.fromJSON(e.ne):void 0,prefix:u(e.prefix)?globalThis.String(e.prefix):void 0,contains:u(e.contains)?globalThis.String(e.contains):void 0,notContains:u(e.notContains)?globalThis.String(e.notContains):void 0,lengthEq:u(e.lengthEq)?globalThis.Number(e.lengthEq):void 0,lengthGt:u(e.lengthGt)?globalThis.Number(e.lengthGt):void 0,lengthLt:u(e.lengthLt)?globalThis.Number(e.lengthLt):void 0,hasAny:u(e.hasAny)?A.fromJSON(e.hasAny):void 0,hasAll:u(e.hasAll)?A.fromJSON(e.hasAll):void 0,in:u(e.in)?A.fromJSON(e.in):void 0}},toJSON(e){let n={};return e.eq!==void 0&&(n.eq=k.toJSON(e.eq)),e.gt!==void 0&&(n.gt=k.toJSON(e.gt)),e.gte!==void 0&&(n.gte=k.toJSON(e.gte)),e.lt!==void 0&&(n.lt=k.toJSON(e.lt)),e.lte!==void 0&&(n.lte=k.toJSON(e.lte)),e.ne!==void 0&&(n.ne=k.toJSON(e.ne)),e.prefix!==void 0&&(n.prefix=e.prefix),e.contains!==void 0&&(n.contains=e.contains),e.notContains!==void 0&&(n.notContains=e.notContains),e.lengthEq!==void 0&&(n.lengthEq=Math.round(e.lengthEq)),e.lengthGt!==void 0&&(n.lengthGt=Math.round(e.lengthGt)),e.lengthLt!==void 0&&(n.lengthLt=Math.round(e.lengthLt)),e.hasAny!==void 0&&(n.hasAny=A.toJSON(e.hasAny)),e.hasAll!==void 0&&(n.hasAll=A.toJSON(e.hasAll)),e.in!==void 0&&(n.in=A.toJSON(e.in)),n},create(e){return fn.fromPartial(e??{})},fromPartial(e){let n=Cl();return n.eq=e.eq!==void 0&&e.eq!==null?k.fromPartial(e.eq):void 0,n.gt=e.gt!==void 0&&e.gt!==null?k.fromPartial(e.gt):void 0,n.gte=e.gte!==void 0&&e.gte!==null?k.fromPartial(e.gte):void 0,n.lt=e.lt!==void 0&&e.lt!==null?k.fromPartial(e.lt):void 0,n.lte=e.lte!==void 0&&e.lte!==null?k.fromPartial(e.lte):void 0,n.ne=e.ne!==void 0&&e.ne!==null?k.fromPartial(e.ne):void 0,n.prefix=e.prefix??void 0,n.contains=e.contains??void 0,n.notContains=e.notContains??void 0,n.lengthEq=e.lengthEq??void 0,n.lengthGt=e.lengthGt??void 0,n.lengthLt=e.lengthLt??void 0,n.hasAny=e.hasAny!==void 0&&e.hasAny!==null?A.fromPartial(e.hasAny):void 0,n.hasAll=e.hasAll!==void 0&&e.hasAll!==null?A.fromPartial(e.hasAll):void 0,n.in=e.in!==void 0&&e.in!==null?A.fromPartial(e.in):void 0,n}};function Il(){return{conditions:{}}}var ie={encode(e,n=o.default.Writer.create()){return Object.entries(e.conditions).forEach(([t,a])=>{Hi.encode({key:t,value:a},n.uint32(10).fork()).ldelim()}),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Il();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;let s=Hi.decode(t,t.uint32());s.value!==void 0&&(i.conditions[s.key]=s.value);continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{conditions:C(e.conditions)?Object.entries(e.conditions).reduce((n,[t,a])=>(n[t]=fn.fromJSON(a),n),{}):{}}},toJSON(e){let n={};if(e.conditions){let t=Object.entries(e.conditions);t.length>0&&(n.conditions={},t.forEach(([a,i])=>{n.conditions[a]=fn.toJSON(i)}))}return n},create(e){return ie.fromPartial(e??{})},fromPartial(e){let n=Il();return n.conditions=Object.entries(e.conditions??{}).reduce((t,[a,i])=>(i!==void 0&&(t[a]=fn.fromPartial(i)),t),{}),n}};function El(){return{key:"",value:void 0}}var Hi={encode(e,n=o.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==void 0&&fn.encode(e.value,n.uint32(18).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=El();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.key=t.string();continue;case 2:if(r!==18)break;i.value=fn.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{key:u(e.key)?globalThis.String(e.key):"",value:u(e.value)?fn.fromJSON(e.value):void 0}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==void 0&&(n.value=fn.toJSON(e.value)),n},create(e){return Hi.fromPartial(e??{})},fromPartial(e){let n=El();return n.key=e.key??"",n.value=e.value!==void 0&&e.value!==null?fn.fromPartial(e.value):void 0,n}};function Ol(){return{filters:[]}}var Xe={encode(e,n=o.default.Writer.create()){for(let t of e.filters)ie.encode(t,n.uint32(10).fork()).ldelim();return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Ol();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.filters.push(ie.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(n=>ie.fromJSON(n)):[]}},toJSON(e){let n={};return e.filters?.length&&(n.filters=e.filters.map(t=>ie.toJSON(t))),n},create(e){return Xe.fromPartial(e??{})},fromPartial(e){let n=Ol();return n.filters=e.filters?.map(t=>ie.fromPartial(t))||[],n}};function Rl(){return{filters:void 0,preVOut:void 0,preTransaction:void 0}}var dr={encode(e,n=o.default.Writer.create()){return e.filters!==void 0&&Xe.encode(e.filters,n.uint32(10).fork()).ldelim(),e.preVOut!==void 0&&ie.encode(e.preVOut,n.uint32(18).fork()).ldelim(),e.preTransaction!==void 0&&Ke.encode(e.preTransaction,n.uint32(26).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Rl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.filters=Xe.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.preVOut=ie.decode(t,t.uint32());continue;case 3:if(r!==26)break;i.preTransaction=Ke.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{filters:u(e.filters)?Xe.fromJSON(e.filters):void 0,preVOut:u(e.preVOut)?ie.fromJSON(e.preVOut):void 0,preTransaction:u(e.preTransaction)?Ke.fromJSON(e.preTransaction):void 0}},toJSON(e){let n={};return e.filters!==void 0&&(n.filters=Xe.toJSON(e.filters)),e.preVOut!==void 0&&(n.preVOut=ie.toJSON(e.preVOut)),e.preTransaction!==void 0&&(n.preTransaction=Ke.toJSON(e.preTransaction)),n},create(e){return dr.fromPartial(e??{})},fromPartial(e){let n=Rl();return n.filters=e.filters!==void 0&&e.filters!==null?Xe.fromPartial(e.filters):void 0,n.preVOut=e.preVOut!==void 0&&e.preVOut!==null?ie.fromPartial(e.preVOut):void 0,n.preTransaction=e.preTransaction!==void 0&&e.preTransaction!==null?Ke.fromPartial(e.preTransaction):void 0,n}};function Pl(){return{filters:void 0}}var lr={encode(e,n=o.default.Writer.create()){return e.filters!==void 0&&Xe.encode(e.filters,n.uint32(10).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Pl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.filters=Xe.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{filters:u(e.filters)?Xe.fromJSON(e.filters):void 0}},toJSON(e){let n={};return e.filters!==void 0&&(n.filters=Xe.toJSON(e.filters)),n},create(e){return lr.fromPartial(e??{})},fromPartial(e){let n=Pl();return n.filters=e.filters!==void 0&&e.filters!==null?Xe.fromPartial(e.filters):void 0,n}};function _l(){return{address:"",keys:[]}}var sr={encode(e,n=o.default.Writer.create()){e.address!==""&&n.uint32(10).string(e.address);for(let t of e.keys)n.uint32(18).string(t);return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=_l();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.address=t.string();continue;case 2:if(r!==18)break;i.keys.push(t.string());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{address:u(e.address)?globalThis.String(e.address):"",keys:globalThis.Array.isArray(e?.keys)?e.keys.map(n=>globalThis.String(n)):[]}},toJSON(e){let n={};return e.address!==""&&(n.address=e.address),e.keys?.length&&(n.keys=e.keys),n},create(e){return sr.fromPartial(e??{})},fromPartial(e){let n=_l();return n.address=e.address??"",n.keys=e.keys?.map(t=>t)||[],n}};function vl(){return{function:"",includeFailed:!1}}var fr={encode(e,n=o.default.Writer.create()){return e.function!==""&&n.uint32(10).string(e.function),e.includeFailed!==!1&&n.uint32(16).bool(e.includeFailed),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=vl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.function=t.string();continue;case 2:if(r!==16)break;i.includeFailed=t.bool();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{function:u(e.function)?globalThis.String(e.function):"",includeFailed:u(e.includeFailed)?globalThis.Boolean(e.includeFailed):!1}},toJSON(e){let n={};return e.function!==""&&(n.function=e.function),e.includeFailed!==!1&&(n.includeFailed=e.includeFailed),n},create(e){return fr.fromPartial(e??{})},fromPartial(e){let n=vl();return n.function=e.function??"",n.includeFailed=e.includeFailed??!1,n}};function Al(){return{filters:[],handlerId:0,handlerName:""}}var cr={encode(e,n=o.default.Writer.create()){for(let t of e.filters)fr.encode(t,n.uint32(10).fork()).ldelim();return e.handlerId!==0&&n.uint32(16).int32(e.handlerId),e.handlerName!==""&&n.uint32(26).string(e.handlerName),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Al();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.filters.push(fr.decode(t,t.uint32()));continue;case 2:if(r!==16)break;i.handlerId=t.int32();continue;case 3:if(r!==26)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{filters:globalThis.Array.isArray(e?.filters)?e.filters.map(n=>fr.fromJSON(n)):[],handlerId:u(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:u(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.filters?.length&&(n.filters=e.filters.map(t=>fr.toJSON(t))),e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return cr.fromPartial(e??{})},fromPartial(e){let n=Al();return n.filters=e.filters?.map(t=>fr.fromPartial(t))||[],n.handlerId=e.handlerId??0,n.handlerName=e.handlerName??"",n}};function Bl(){return{handlerId:0,handlerName:""}}var pr={encode(e,n=o.default.Writer.create()){return e.handlerId!==0&&n.uint32(8).int32(e.handlerId),e.handlerName!==""&&n.uint32(18).string(e.handlerName),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Bl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.handlerId=t.int32();continue;case 2:if(r!==18)break;i.handlerName=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{handlerId:u(e.handlerId)?globalThis.Number(e.handlerId):0,handlerName:u(e.handlerName)?globalThis.String(e.handlerName):""}},toJSON(e){let n={};return e.handlerId!==0&&(n.handlerId=Math.round(e.handlerId)),e.handlerName!==""&&(n.handlerName=e.handlerName),n},create(e){return pr.fromPartial(e??{})},fromPartial(e){let n=Bl();return n.handlerId=e.handlerId??0,n.handlerName=e.handlerName??"",n}};function bl(){return{hashes:[]}}var gr={encode(e,n=o.default.Writer.create()){for(let t of e.hashes)n.uint32(10).string(t);return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=bl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.hashes.push(t.string());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{hashes:globalThis.Array.isArray(e?.hashes)?e.hashes.map(n=>globalThis.String(n)):[]}},toJSON(e){let n={};return e.hashes?.length&&(n.hashes=e.hashes),n},create(e){return gr.fromPartial(e??{})},fromPartial(e){let n=bl();return n.hashes=e.hashes?.map(t=>t)||[],n}};function Dl(){return{bindings:[]}}var Gs={encode(e,n=o.default.Writer.create()){for(let t of e.bindings)ae.encode(t,n.uint32(10).fork()).ldelim();return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Dl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.bindings.push(ae.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{bindings:globalThis.Array.isArray(e?.bindings)?e.bindings.map(n=>ae.fromJSON(n)):[]}},toJSON(e){let n={};return e.bindings?.length&&(n.bindings=e.bindings.map(t=>ae.toJSON(t))),n},create(e){return Gs.fromPartial(e??{})},fromPartial(e){let n=Dl();return n.bindings=e.bindings?.map(t=>ae.fromPartial(t))||[],n}};function Jl(){return{result:void 0,configUpdated:!1}}var qs={encode(e,n=o.default.Writer.create()){return e.result!==void 0&&je.encode(e.result,n.uint32(10).fork()).ldelim(),e.configUpdated!==!1&&n.uint32(32).bool(e.configUpdated),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Jl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.result=je.decode(t,t.uint32());continue;case 4:if(r!==32)break;i.configUpdated=t.bool();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{result:u(e.result)?je.fromJSON(e.result):void 0,configUpdated:u(e.configUpdated)?globalThis.Boolean(e.configUpdated):!1}},toJSON(e){let n={};return e.result!==void 0&&(n.result=je.toJSON(e.result)),e.configUpdated!==!1&&(n.configUpdated=e.configUpdated),n},create(e){return qs.fromPartial(e??{})},fromPartial(e){let n=Jl();return n.result=e.result!==void 0&&e.result!==null?je.fromPartial(e.result):void 0,n.configUpdated=e.configUpdated??!1,n}};function xl(){return{processId:0,binding:void 0,dbResult:void 0,start:void 0}}var Hs={encode(e,n=o.default.Writer.create()){return e.processId!==0&&n.uint32(8).int32(e.processId),e.binding!==void 0&&ae.encode(e.binding,n.uint32(18).fork()).ldelim(),e.dbResult!==void 0&&Ye.encode(e.dbResult,n.uint32(26).fork()).ldelim(),e.start!==void 0&&n.uint32(32).bool(e.start),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=xl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.processId=t.int32();continue;case 2:if(r!==18)break;i.binding=ae.decode(t,t.uint32());continue;case 3:if(r!==26)break;i.dbResult=Ye.decode(t,t.uint32());continue;case 4:if(r!==32)break;i.start=t.bool();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{processId:u(e.processId)?globalThis.Number(e.processId):0,binding:u(e.binding)?ae.fromJSON(e.binding):void 0,dbResult:u(e.dbResult)?Ye.fromJSON(e.dbResult):void 0,start:u(e.start)?globalThis.Boolean(e.start):void 0}},toJSON(e){let n={};return e.processId!==0&&(n.processId=Math.round(e.processId)),e.binding!==void 0&&(n.binding=ae.toJSON(e.binding)),e.dbResult!==void 0&&(n.dbResult=Ye.toJSON(e.dbResult)),e.start!==void 0&&(n.start=e.start),n},create(e){return Hs.fromPartial(e??{})},fromPartial(e){let n=xl();return n.processId=e.processId??0,n.binding=e.binding!==void 0&&e.binding!==null?ae.fromPartial(e.binding):void 0,n.dbResult=e.dbResult!==void 0&&e.dbResult!==null?Ye.fromPartial(e.dbResult):void 0,n.start=e.start??void 0,n}};function Ul(){return{processId:0,dbRequest:void 0,result:void 0,partitions:void 0}}var Qs={encode(e,n=o.default.Writer.create()){return e.processId!==0&&n.uint32(8).int32(e.processId),e.dbRequest!==void 0&&$e.encode(e.dbRequest,n.uint32(18).fork()).ldelim(),e.result!==void 0&&je.encode(e.result,n.uint32(26).fork()).ldelim(),e.partitions!==void 0&&hr.encode(e.partitions,n.uint32(34).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Ul();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.processId=t.int32();continue;case 2:if(r!==18)break;i.dbRequest=$e.decode(t,t.uint32());continue;case 3:if(r!==26)break;i.result=je.decode(t,t.uint32());continue;case 4:if(r!==34)break;i.partitions=hr.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{processId:u(e.processId)?globalThis.Number(e.processId):0,dbRequest:u(e.dbRequest)?$e.fromJSON(e.dbRequest):void 0,result:u(e.result)?je.fromJSON(e.result):void 0,partitions:u(e.partitions)?hr.fromJSON(e.partitions):void 0}},toJSON(e){let n={};return e.processId!==0&&(n.processId=Math.round(e.processId)),e.dbRequest!==void 0&&(n.dbRequest=$e.toJSON(e.dbRequest)),e.result!==void 0&&(n.result=je.toJSON(e.result)),e.partitions!==void 0&&(n.partitions=hr.toJSON(e.partitions)),n},create(e){return Qs.fromPartial(e??{})},fromPartial(e){let n=Ul();return n.processId=e.processId??0,n.dbRequest=e.dbRequest!==void 0&&e.dbRequest!==null?$e.fromPartial(e.dbRequest):void 0,n.result=e.result!==void 0&&e.result!==null?je.fromPartial(e.result):void 0,n.partitions=e.partitions!==void 0&&e.partitions!==null?hr.fromPartial(e.partitions):void 0,n}};function Vl(){return{partitions:{}}}var hr={encode(e,n=o.default.Writer.create()){return Object.entries(e.partitions).forEach(([t,a])=>{Qi.encode({key:t,value:a},n.uint32(10).fork()).ldelim()}),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Vl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;let s=Qi.decode(t,t.uint32());s.value!==void 0&&(i.partitions[s.key]=s.value);continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{partitions:C(e.partitions)?Object.entries(e.partitions).reduce((n,[t,a])=>(n[globalThis.Number(t)]=cn.fromJSON(a),n),{}):{}}},toJSON(e){let n={};if(e.partitions){let t=Object.entries(e.partitions);t.length>0&&(n.partitions={},t.forEach(([a,i])=>{n.partitions[a]=cn.toJSON(i)}))}return n},create(e){return hr.fromPartial(e??{})},fromPartial(e){let n=Vl();return n.partitions=Object.entries(e.partitions??{}).reduce((t,[a,i])=>(i!==void 0&&(t[globalThis.Number(a)]=cn.fromPartial(i)),t),{}),n}};function Ll(){return{userValue:void 0,sysValue:void 0}}var cn={encode(e,n=o.default.Writer.create()){return e.userValue!==void 0&&n.uint32(10).string(e.userValue),e.sysValue!==void 0&&n.uint32(16).int32(e.sysValue),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Ll();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.userValue=t.string();continue;case 2:if(r!==16)break;i.sysValue=t.int32();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{userValue:u(e.userValue)?globalThis.String(e.userValue):void 0,sysValue:u(e.sysValue)?tc(e.sysValue):void 0}},toJSON(e){let n={};return e.userValue!==void 0&&(n.userValue=e.userValue),e.sysValue!==void 0&&(n.sysValue=rc(e.sysValue)),n},create(e){return cn.fromPartial(e??{})},fromPartial(e){let n=Ll();return n.userValue=e.userValue??void 0,n.sysValue=e.sysValue??void 0,n}};function Fl(){return{key:0,value:void 0}}var Qi={encode(e,n=o.default.Writer.create()){return e.key!==0&&n.uint32(8).int32(e.key),e.value!==void 0&&cn.encode(e.value,n.uint32(18).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Fl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.key=t.int32();continue;case 2:if(r!==18)break;i.value=cn.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{key:u(e.key)?globalThis.Number(e.key):0,value:u(e.value)?cn.fromJSON(e.value):void 0}},toJSON(e){let n={};return e.key!==0&&(n.key=Math.round(e.key)),e.value!==void 0&&(n.value=cn.toJSON(e.value)),n},create(e){return Qi.fromPartial(e??{})},fromPartial(e){let n=Fl();return n.key=e.key??0,n.value=e.value!==void 0&&e.value!==null?cn.fromPartial(e.value):void 0,n}};function wl(){return{processId:0,bindings:void 0,dbResult:void 0}}var Zs={encode(e,n=o.default.Writer.create()){return e.processId!==0&&n.uint32(8).int32(e.processId),e.bindings!==void 0&&mr.encode(e.bindings,n.uint32(18).fork()).ldelim(),e.dbResult!==void 0&&Ye.encode(e.dbResult,n.uint32(26).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=wl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.processId=t.int32();continue;case 2:if(r!==18)break;i.bindings=mr.decode(t,t.uint32());continue;case 3:if(r!==26)break;i.dbResult=Ye.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{processId:u(e.processId)?globalThis.Number(e.processId):0,bindings:u(e.bindings)?mr.fromJSON(e.bindings):void 0,dbResult:u(e.dbResult)?Ye.fromJSON(e.dbResult):void 0}},toJSON(e){let n={};return e.processId!==0&&(n.processId=Math.round(e.processId)),e.bindings!==void 0&&(n.bindings=mr.toJSON(e.bindings)),e.dbResult!==void 0&&(n.dbResult=Ye.toJSON(e.dbResult)),n},create(e){return Zs.fromPartial(e??{})},fromPartial(e){let n=wl();return n.processId=e.processId??0,n.bindings=e.bindings!==void 0&&e.bindings!==null?mr.fromPartial(e.bindings):void 0,n.dbResult=e.dbResult!==void 0&&e.dbResult!==null?Ye.fromPartial(e.dbResult):void 0,n}};function Ml(){return{bindings:[]}}var mr={encode(e,n=o.default.Writer.create()){for(let t of e.bindings)ae.encode(t,n.uint32(10).fork()).ldelim();return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Ml();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.bindings.push(ae.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{bindings:globalThis.Array.isArray(e?.bindings)?e.bindings.map(n=>ae.fromJSON(n)):[]}},toJSON(e){let n={};return e.bindings?.length&&(n.bindings=e.bindings.map(t=>ae.toJSON(t))),n},create(e){return mr.fromPartial(e??{})},fromPartial(e){let n=Ml();return n.bindings=e.bindings?.map(t=>ae.fromPartial(t))||[],n}};function Wl(){return{processId:0,dbRequest:void 0}}var zs={encode(e,n=o.default.Writer.create()){return e.processId!==0&&n.uint32(8).int32(e.processId),e.dbRequest!==void 0&&$e.encode(e.dbRequest,n.uint32(18).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Wl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.processId=t.int32();continue;case 2:if(r!==18)break;i.dbRequest=$e.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{processId:u(e.processId)?globalThis.Number(e.processId):0,dbRequest:u(e.dbRequest)?$e.fromJSON(e.dbRequest):void 0}},toJSON(e){let n={};return e.processId!==0&&(n.processId=Math.round(e.processId)),e.dbRequest!==void 0&&(n.dbRequest=$e.toJSON(e.dbRequest)),n},create(e){return zs.fromPartial(e??{})},fromPartial(e){let n=Wl();return n.processId=e.processId??0,n.dbRequest=e.dbRequest!==void 0&&e.dbRequest!==null?$e.fromPartial(e.dbRequest):void 0,n}};function Gl(){return{opId:BigInt("0"),data:void 0,list:void 0,error:void 0,entities:void 0,entityList:void 0,nextCursor:void 0}}var Ye={encode(e,n=o.default.Writer.create()){if(e.opId!==BigInt("0")){if(BigInt.asUintN(64,e.opId)!==e.opId)throw new globalThis.Error("value provided for field message.opId of type uint64 too large");n.uint32(8).uint64(e.opId.toString())}return e.data!==void 0&&f.encode(f.wrap(e.data),n.uint32(18).fork()).ldelim(),e.list!==void 0&&on.encode(on.wrap(e.list),n.uint32(34).fork()).ldelim(),e.error!==void 0&&n.uint32(26).string(e.error),e.entities!==void 0&&Pn.encode(e.entities,n.uint32(50).fork()).ldelim(),e.entityList!==void 0&&kr.encode(e.entityList,n.uint32(58).fork()).ldelim(),e.nextCursor!==void 0&&n.uint32(42).string(e.nextCursor),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Gl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.opId=G(t.uint64());continue;case 2:if(r!==18)break;i.data=f.unwrap(f.decode(t,t.uint32()));continue;case 4:if(r!==34)break;i.list=on.unwrap(on.decode(t,t.uint32()));continue;case 3:if(r!==26)break;i.error=t.string();continue;case 6:if(r!==50)break;i.entities=Pn.decode(t,t.uint32());continue;case 7:if(r!==58)break;i.entityList=kr.decode(t,t.uint32());continue;case 5:if(r!==42)break;i.nextCursor=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{opId:u(e.opId)?BigInt(e.opId):BigInt("0"),data:C(e.data)?e.data:void 0,list:globalThis.Array.isArray(e.list)?[...e.list]:void 0,error:u(e.error)?globalThis.String(e.error):void 0,entities:u(e.entities)?Pn.fromJSON(e.entities):void 0,entityList:u(e.entityList)?kr.fromJSON(e.entityList):void 0,nextCursor:u(e.nextCursor)?globalThis.String(e.nextCursor):void 0}},toJSON(e){let n={};return e.opId!==BigInt("0")&&(n.opId=e.opId.toString()),e.data!==void 0&&(n.data=e.data),e.list!==void 0&&(n.list=e.list),e.error!==void 0&&(n.error=e.error),e.entities!==void 0&&(n.entities=Pn.toJSON(e.entities)),e.entityList!==void 0&&(n.entityList=kr.toJSON(e.entityList)),e.nextCursor!==void 0&&(n.nextCursor=e.nextCursor),n},create(e){return Ye.fromPartial(e??{})},fromPartial(e){let n=Gl();return n.opId=e.opId??BigInt("0"),n.data=e.data??void 0,n.list=e.list??void 0,n.error=e.error??void 0,n.entities=e.entities!==void 0&&e.entities!==null?Pn.fromPartial(e.entities):void 0,n.entityList=e.entityList!==void 0&&e.entityList!==null?kr.fromPartial(e.entityList):void 0,n.nextCursor=e.nextCursor??void 0,n}};function ql(){return{entity:"",genBlockNumber:BigInt("0"),genBlockChain:"",genBlockTime:void 0,data:void 0}}var yr={encode(e,n=o.default.Writer.create()){if(e.entity!==""&&n.uint32(10).string(e.entity),e.genBlockNumber!==BigInt("0")){if(BigInt.asUintN(64,e.genBlockNumber)!==e.genBlockNumber)throw new globalThis.Error("value provided for field message.genBlockNumber of type uint64 too large");n.uint32(16).uint64(e.genBlockNumber.toString())}return e.genBlockChain!==""&&n.uint32(26).string(e.genBlockChain),e.genBlockTime!==void 0&&T.encode(oe(e.genBlockTime),n.uint32(34).fork()).ldelim(),e.data!==void 0&&R.encode(e.data,n.uint32(42).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=ql();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.entity=t.string();continue;case 2:if(r!==16)break;i.genBlockNumber=G(t.uint64());continue;case 3:if(r!==26)break;i.genBlockChain=t.string();continue;case 4:if(r!==34)break;i.genBlockTime=X(T.decode(t,t.uint32()));continue;case 5:if(r!==42)break;i.data=R.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{entity:u(e.entity)?globalThis.String(e.entity):"",genBlockNumber:u(e.genBlockNumber)?BigInt(e.genBlockNumber):BigInt("0"),genBlockChain:u(e.genBlockChain)?globalThis.String(e.genBlockChain):"",genBlockTime:u(e.genBlockTime)?ue(e.genBlockTime):void 0,data:u(e.data)?R.fromJSON(e.data):void 0}},toJSON(e){let n={};return e.entity!==""&&(n.entity=e.entity),e.genBlockNumber!==BigInt("0")&&(n.genBlockNumber=e.genBlockNumber.toString()),e.genBlockChain!==""&&(n.genBlockChain=e.genBlockChain),e.genBlockTime!==void 0&&(n.genBlockTime=e.genBlockTime.toISOString()),e.data!==void 0&&(n.data=R.toJSON(e.data)),n},create(e){return yr.fromPartial(e??{})},fromPartial(e){let n=ql();return n.entity=e.entity??"",n.genBlockNumber=e.genBlockNumber??BigInt("0"),n.genBlockChain=e.genBlockChain??"",n.genBlockTime=e.genBlockTime??void 0,n.data=e.data!==void 0&&e.data!==null?R.fromPartial(e.data):void 0,n}};function Hl(){return{entities:[]}}var kr={encode(e,n=o.default.Writer.create()){for(let t of e.entities)yr.encode(t,n.uint32(10).fork()).ldelim();return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Hl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.entities.push(yr.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{entities:globalThis.Array.isArray(e?.entities)?e.entities.map(n=>yr.fromJSON(n)):[]}},toJSON(e){let n={};return e.entities?.length&&(n.entities=e.entities.map(t=>yr.toJSON(t))),n},create(e){return kr.fromPartial(e??{})},fromPartial(e){let n=Hl();return n.entities=e.entities?.map(t=>yr.fromPartial(t))||[],n}};function Ql(){return{fields:{}}}var Sr={encode(e,n=o.default.Writer.create()){return Object.entries(e.fields).forEach(([t,a])=>{Zi.encode({key:t,value:a},n.uint32(10).fork()).ldelim()}),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Ql();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;let s=Zi.decode(t,t.uint32());s.value!==void 0&&(i.fields[s.key]=s.value);continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{fields:C(e.fields)?Object.entries(e.fields).reduce((n,[t,a])=>(n[t]=pn.fromJSON(a),n),{}):{}}},toJSON(e){let n={};if(e.fields){let t=Object.entries(e.fields);t.length>0&&(n.fields={},t.forEach(([a,i])=>{n.fields[a]=pn.toJSON(i)}))}return n},create(e){return Sr.fromPartial(e??{})},fromPartial(e){let n=Ql();return n.fields=Object.entries(e.fields??{}).reduce((t,[a,i])=>(i!==void 0&&(t[a]=pn.fromPartial(i)),t),{}),n}};function Zl(){return{value:void 0,op:0}}var pn={encode(e,n=o.default.Writer.create()){return e.value!==void 0&&k.encode(e.value,n.uint32(10).fork()).ldelim(),e.op!==0&&n.uint32(16).int32(e.op),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Zl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.value=k.decode(t,t.uint32());continue;case 2:if(r!==16)break;i.op=t.int32();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{value:u(e.value)?k.fromJSON(e.value):void 0,op:u(e.op)?ic(e.op):0}},toJSON(e){let n={};return e.value!==void 0&&(n.value=k.toJSON(e.value)),e.op!==0&&(n.op=ac(e.op)),n},create(e){return pn.fromPartial(e??{})},fromPartial(e){let n=Zl();return n.value=e.value!==void 0&&e.value!==null?k.fromPartial(e.value):void 0,n.op=e.op??0,n}};function zl(){return{key:"",value:void 0}}var Zi={encode(e,n=o.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==void 0&&pn.encode(e.value,n.uint32(18).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=zl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.key=t.string();continue;case 2:if(r!==18)break;i.value=pn.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{key:u(e.key)?globalThis.String(e.key):"",value:u(e.value)?pn.fromJSON(e.value):void 0}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==void 0&&(n.value=pn.toJSON(e.value)),n},create(e){return Zi.fromPartial(e??{})},fromPartial(e){let n=zl();return n.key=e.key??"",n.value=e.value!==void 0&&e.value!==null?pn.fromPartial(e.value):void 0,n}};function Kl(){return{opId:BigInt("0"),get:void 0,upsert:void 0,update:void 0,delete:void 0,list:void 0}}var $e={encode(e,n=o.default.Writer.create()){if(e.opId!==BigInt("0")){if(BigInt.asUintN(64,e.opId)!==e.opId)throw new globalThis.Error("value provided for field message.opId of type uint64 too large");n.uint32(8).uint64(e.opId.toString())}return e.get!==void 0&&Nr.encode(e.get,n.uint32(18).fork()).ldelim(),e.upsert!==void 0&&Cr.encode(e.upsert,n.uint32(26).fork()).ldelim(),e.update!==void 0&&Ir.encode(e.update,n.uint32(50).fork()).ldelim(),e.delete!==void 0&&Er.encode(e.delete,n.uint32(34).fork()).ldelim(),e.list!==void 0&&Tr.encode(e.list,n.uint32(42).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Kl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.opId=G(t.uint64());continue;case 2:if(r!==18)break;i.get=Nr.decode(t,t.uint32());continue;case 3:if(r!==26)break;i.upsert=Cr.decode(t,t.uint32());continue;case 6:if(r!==50)break;i.update=Ir.decode(t,t.uint32());continue;case 4:if(r!==34)break;i.delete=Er.decode(t,t.uint32());continue;case 5:if(r!==42)break;i.list=Tr.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{opId:u(e.opId)?BigInt(e.opId):BigInt("0"),get:u(e.get)?Nr.fromJSON(e.get):void 0,upsert:u(e.upsert)?Cr.fromJSON(e.upsert):void 0,update:u(e.update)?Ir.fromJSON(e.update):void 0,delete:u(e.delete)?Er.fromJSON(e.delete):void 0,list:u(e.list)?Tr.fromJSON(e.list):void 0}},toJSON(e){let n={};return e.opId!==BigInt("0")&&(n.opId=e.opId.toString()),e.get!==void 0&&(n.get=Nr.toJSON(e.get)),e.upsert!==void 0&&(n.upsert=Cr.toJSON(e.upsert)),e.update!==void 0&&(n.update=Ir.toJSON(e.update)),e.delete!==void 0&&(n.delete=Er.toJSON(e.delete)),e.list!==void 0&&(n.list=Tr.toJSON(e.list)),n},create(e){return $e.fromPartial(e??{})},fromPartial(e){let n=Kl();return n.opId=e.opId??BigInt("0"),n.get=e.get!==void 0&&e.get!==null?Nr.fromPartial(e.get):void 0,n.upsert=e.upsert!==void 0&&e.upsert!==null?Cr.fromPartial(e.upsert):void 0,n.update=e.update!==void 0&&e.update!==null?Ir.fromPartial(e.update):void 0,n.delete=e.delete!==void 0&&e.delete!==null?Er.fromPartial(e.delete):void 0,n.list=e.list!==void 0&&e.list!==null?Tr.fromPartial(e.list):void 0,n}};function Xl(){return{entity:"",id:""}}var Nr={encode(e,n=o.default.Writer.create()){return e.entity!==""&&n.uint32(10).string(e.entity),e.id!==""&&n.uint32(18).string(e.id),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Xl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.entity=t.string();continue;case 2:if(r!==18)break;i.id=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{entity:u(e.entity)?globalThis.String(e.entity):"",id:u(e.id)?globalThis.String(e.id):""}},toJSON(e){let n={};return e.entity!==""&&(n.entity=e.entity),e.id!==""&&(n.id=e.id),n},create(e){return Nr.fromPartial(e??{})},fromPartial(e){let n=Xl();return n.entity=e.entity??"",n.id=e.id??"",n}};function Yl(){return{entity:"",filters:[],cursor:"",pageSize:void 0}}var Tr={encode(e,n=o.default.Writer.create()){e.entity!==""&&n.uint32(10).string(e.entity);for(let t of e.filters)Or.encode(t,n.uint32(34).fork()).ldelim();return e.cursor!==""&&n.uint32(42).string(e.cursor),e.pageSize!==void 0&&n.uint32(48).uint32(e.pageSize),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Yl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.entity=t.string();continue;case 4:if(r!==34)break;i.filters.push(Or.decode(t,t.uint32()));continue;case 5:if(r!==42)break;i.cursor=t.string();continue;case 6:if(r!==48)break;i.pageSize=t.uint32();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{entity:u(e.entity)?globalThis.String(e.entity):"",filters:globalThis.Array.isArray(e?.filters)?e.filters.map(n=>Or.fromJSON(n)):[],cursor:u(e.cursor)?globalThis.String(e.cursor):"",pageSize:u(e.pageSize)?globalThis.Number(e.pageSize):void 0}},toJSON(e){let n={};return e.entity!==""&&(n.entity=e.entity),e.filters?.length&&(n.filters=e.filters.map(t=>Or.toJSON(t))),e.cursor!==""&&(n.cursor=e.cursor),e.pageSize!==void 0&&(n.pageSize=Math.round(e.pageSize)),n},create(e){return Tr.fromPartial(e??{})},fromPartial(e){let n=Yl();return n.entity=e.entity??"",n.filters=e.filters?.map(t=>Or.fromPartial(t))||[],n.cursor=e.cursor??"",n.pageSize=e.pageSize??void 0,n}};function $l(){return{entity:[],id:[],data:[],entityData:[]}}var Cr={encode(e,n=o.default.Writer.create()){for(let t of e.entity)n.uint32(10).string(t);for(let t of e.id)n.uint32(18).string(t);for(let t of e.data)f.encode(f.wrap(t),n.uint32(26).fork()).ldelim();for(let t of e.entityData)R.encode(t,n.uint32(34).fork()).ldelim();return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=$l();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.entity.push(t.string());continue;case 2:if(r!==18)break;i.id.push(t.string());continue;case 3:if(r!==26)break;i.data.push(f.unwrap(f.decode(t,t.uint32())));continue;case 4:if(r!==34)break;i.entityData.push(R.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{entity:globalThis.Array.isArray(e?.entity)?e.entity.map(n=>globalThis.String(n)):[],id:globalThis.Array.isArray(e?.id)?e.id.map(n=>globalThis.String(n)):[],data:globalThis.Array.isArray(e?.data)?[...e.data]:[],entityData:globalThis.Array.isArray(e?.entityData)?e.entityData.map(n=>R.fromJSON(n)):[]}},toJSON(e){let n={};return e.entity?.length&&(n.entity=e.entity),e.id?.length&&(n.id=e.id),e.data?.length&&(n.data=e.data),e.entityData?.length&&(n.entityData=e.entityData.map(t=>R.toJSON(t))),n},create(e){return Cr.fromPartial(e??{})},fromPartial(e){let n=$l();return n.entity=e.entity?.map(t=>t)||[],n.id=e.id?.map(t=>t)||[],n.data=e.data?.map(t=>t)||[],n.entityData=e.entityData?.map(t=>R.fromPartial(t))||[],n}};function jl(){return{entity:[],id:[],entityData:[]}}var Ir={encode(e,n=o.default.Writer.create()){for(let t of e.entity)n.uint32(10).string(t);for(let t of e.id)n.uint32(18).string(t);for(let t of e.entityData)Sr.encode(t,n.uint32(26).fork()).ldelim();return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=jl();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.entity.push(t.string());continue;case 2:if(r!==18)break;i.id.push(t.string());continue;case 3:if(r!==26)break;i.entityData.push(Sr.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{entity:globalThis.Array.isArray(e?.entity)?e.entity.map(n=>globalThis.String(n)):[],id:globalThis.Array.isArray(e?.id)?e.id.map(n=>globalThis.String(n)):[],entityData:globalThis.Array.isArray(e?.entityData)?e.entityData.map(n=>Sr.fromJSON(n)):[]}},toJSON(e){let n={};return e.entity?.length&&(n.entity=e.entity),e.id?.length&&(n.id=e.id),e.entityData?.length&&(n.entityData=e.entityData.map(t=>Sr.toJSON(t))),n},create(e){return Ir.fromPartial(e??{})},fromPartial(e){let n=jl();return n.entity=e.entity?.map(t=>t)||[],n.id=e.id?.map(t=>t)||[],n.entityData=e.entityData?.map(t=>Sr.fromPartial(t))||[],n}};function es(){return{entity:[],id:[]}}var Er={encode(e,n=o.default.Writer.create()){for(let t of e.entity)n.uint32(10).string(t);for(let t of e.id)n.uint32(18).string(t);return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=es();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.entity.push(t.string());continue;case 2:if(r!==18)break;i.id.push(t.string());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{entity:globalThis.Array.isArray(e?.entity)?e.entity.map(n=>globalThis.String(n)):[],id:globalThis.Array.isArray(e?.id)?e.id.map(n=>globalThis.String(n)):[]}},toJSON(e){let n={};return e.entity?.length&&(n.entity=e.entity),e.id?.length&&(n.id=e.id),n},create(e){return Er.fromPartial(e??{})},fromPartial(e){let n=es();return n.entity=e.entity?.map(t=>t)||[],n.id=e.id?.map(t=>t)||[],n}};function ns(){return{field:"",op:0,value:void 0}}var Or={encode(e,n=o.default.Writer.create()){return e.field!==""&&n.uint32(10).string(e.field),e.op!==0&&n.uint32(16).int32(e.op),e.value!==void 0&&A.encode(e.value,n.uint32(26).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=ns();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.field=t.string();continue;case 2:if(r!==16)break;i.op=t.int32();continue;case 3:if(r!==26)break;i.value=A.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{field:u(e.field)?globalThis.String(e.field):"",op:u(e.op)?oc(e.op):0,value:u(e.value)?A.fromJSON(e.value):void 0}},toJSON(e){let n={};return e.field!==""&&(n.field=e.field),e.op!==0&&(n.op=uc(e.op)),e.value!==void 0&&(n.value=A.toJSON(e.value)),n},create(e){return Or.fromPartial(e??{})},fromPartial(e){let n=ns();return n.field=e.field??"",n.op=e.op??0,n.value=e.value!==void 0&&e.value!==null?A.fromPartial(e.value):void 0,n}};function ts(){return{ethLog:void 0,ethBlock:void 0,ethTransaction:void 0,ethTrace:void 0,solInstruction:void 0,aptEvent:void 0,aptCall:void 0,aptResource:void 0,suiEvent:void 0,suiCall:void 0,suiObject:void 0,suiObjectChange:void 0,fuelLog:void 0,fuelCall:void 0,fuelTransaction:void 0,fuelBlock:void 0,cosmosCall:void 0,starknetEvents:void 0,btcTransaction:void 0,btcBlock:void 0}}var Rr={encode(e,n=o.default.Writer.create()){return e.ethLog!==void 0&&Pr.encode(e.ethLog,n.uint32(18).fork()).ldelim(),e.ethBlock!==void 0&&_r.encode(e.ethBlock,n.uint32(26).fork()).ldelim(),e.ethTransaction!==void 0&&vr.encode(e.ethTransaction,n.uint32(34).fork()).ldelim(),e.ethTrace!==void 0&&Ar.encode(e.ethTrace,n.uint32(42).fork()).ldelim(),e.solInstruction!==void 0&&Br.encode(e.solInstruction,n.uint32(50).fork()).ldelim(),e.aptEvent!==void 0&&br.encode(e.aptEvent,n.uint32(58).fork()).ldelim(),e.aptCall!==void 0&&Dr.encode(e.aptCall,n.uint32(66).fork()).ldelim(),e.aptResource!==void 0&&Jr.encode(e.aptResource,n.uint32(74).fork()).ldelim(),e.suiEvent!==void 0&&xr.encode(e.suiEvent,n.uint32(82).fork()).ldelim(),e.suiCall!==void 0&&Ur.encode(e.suiCall,n.uint32(90).fork()).ldelim(),e.suiObject!==void 0&&Vr.encode(e.suiObject,n.uint32(98).fork()).ldelim(),e.suiObjectChange!==void 0&&Lr.encode(e.suiObjectChange,n.uint32(106).fork()).ldelim(),e.fuelLog!==void 0&&Fr.encode(e.fuelLog,n.uint32(162).fork()).ldelim(),e.fuelCall!==void 0&&Mr.encode(e.fuelCall,n.uint32(114).fork()).ldelim(),e.fuelTransaction!==void 0&&wr.encode(e.fuelTransaction,n.uint32(170).fork()).ldelim(),e.fuelBlock!==void 0&&Wr.encode(e.fuelBlock,n.uint32(146).fork()).ldelim(),e.cosmosCall!==void 0&&Gr.encode(e.cosmosCall,n.uint32(122).fork()).ldelim(),e.starknetEvents!==void 0&&qr.encode(e.starknetEvents,n.uint32(130).fork()).ldelim(),e.btcTransaction!==void 0&&Hr.encode(e.btcTransaction,n.uint32(138).fork()).ldelim(),e.btcBlock!==void 0&&Qr.encode(e.btcBlock,n.uint32(154).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=ts();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 2:if(r!==18)break;i.ethLog=Pr.decode(t,t.uint32());continue;case 3:if(r!==26)break;i.ethBlock=_r.decode(t,t.uint32());continue;case 4:if(r!==34)break;i.ethTransaction=vr.decode(t,t.uint32());continue;case 5:if(r!==42)break;i.ethTrace=Ar.decode(t,t.uint32());continue;case 6:if(r!==50)break;i.solInstruction=Br.decode(t,t.uint32());continue;case 7:if(r!==58)break;i.aptEvent=br.decode(t,t.uint32());continue;case 8:if(r!==66)break;i.aptCall=Dr.decode(t,t.uint32());continue;case 9:if(r!==74)break;i.aptResource=Jr.decode(t,t.uint32());continue;case 10:if(r!==82)break;i.suiEvent=xr.decode(t,t.uint32());continue;case 11:if(r!==90)break;i.suiCall=Ur.decode(t,t.uint32());continue;case 12:if(r!==98)break;i.suiObject=Vr.decode(t,t.uint32());continue;case 13:if(r!==106)break;i.suiObjectChange=Lr.decode(t,t.uint32());continue;case 20:if(r!==162)break;i.fuelLog=Fr.decode(t,t.uint32());continue;case 14:if(r!==114)break;i.fuelCall=Mr.decode(t,t.uint32());continue;case 21:if(r!==170)break;i.fuelTransaction=wr.decode(t,t.uint32());continue;case 18:if(r!==146)break;i.fuelBlock=Wr.decode(t,t.uint32());continue;case 15:if(r!==122)break;i.cosmosCall=Gr.decode(t,t.uint32());continue;case 16:if(r!==130)break;i.starknetEvents=qr.decode(t,t.uint32());continue;case 17:if(r!==138)break;i.btcTransaction=Hr.decode(t,t.uint32());continue;case 19:if(r!==154)break;i.btcBlock=Qr.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{ethLog:u(e.ethLog)?Pr.fromJSON(e.ethLog):void 0,ethBlock:u(e.ethBlock)?_r.fromJSON(e.ethBlock):void 0,ethTransaction:u(e.ethTransaction)?vr.fromJSON(e.ethTransaction):void 0,ethTrace:u(e.ethTrace)?Ar.fromJSON(e.ethTrace):void 0,solInstruction:u(e.solInstruction)?Br.fromJSON(e.solInstruction):void 0,aptEvent:u(e.aptEvent)?br.fromJSON(e.aptEvent):void 0,aptCall:u(e.aptCall)?Dr.fromJSON(e.aptCall):void 0,aptResource:u(e.aptResource)?Jr.fromJSON(e.aptResource):void 0,suiEvent:u(e.suiEvent)?xr.fromJSON(e.suiEvent):void 0,suiCall:u(e.suiCall)?Ur.fromJSON(e.suiCall):void 0,suiObject:u(e.suiObject)?Vr.fromJSON(e.suiObject):void 0,suiObjectChange:u(e.suiObjectChange)?Lr.fromJSON(e.suiObjectChange):void 0,fuelLog:u(e.fuelLog)?Fr.fromJSON(e.fuelLog):void 0,fuelCall:u(e.fuelCall)?Mr.fromJSON(e.fuelCall):void 0,fuelTransaction:u(e.fuelTransaction)?wr.fromJSON(e.fuelTransaction):void 0,fuelBlock:u(e.fuelBlock)?Wr.fromJSON(e.fuelBlock):void 0,cosmosCall:u(e.cosmosCall)?Gr.fromJSON(e.cosmosCall):void 0,starknetEvents:u(e.starknetEvents)?qr.fromJSON(e.starknetEvents):void 0,btcTransaction:u(e.btcTransaction)?Hr.fromJSON(e.btcTransaction):void 0,btcBlock:u(e.btcBlock)?Qr.fromJSON(e.btcBlock):void 0}},toJSON(e){let n={};return e.ethLog!==void 0&&(n.ethLog=Pr.toJSON(e.ethLog)),e.ethBlock!==void 0&&(n.ethBlock=_r.toJSON(e.ethBlock)),e.ethTransaction!==void 0&&(n.ethTransaction=vr.toJSON(e.ethTransaction)),e.ethTrace!==void 0&&(n.ethTrace=Ar.toJSON(e.ethTrace)),e.solInstruction!==void 0&&(n.solInstruction=Br.toJSON(e.solInstruction)),e.aptEvent!==void 0&&(n.aptEvent=br.toJSON(e.aptEvent)),e.aptCall!==void 0&&(n.aptCall=Dr.toJSON(e.aptCall)),e.aptResource!==void 0&&(n.aptResource=Jr.toJSON(e.aptResource)),e.suiEvent!==void 0&&(n.suiEvent=xr.toJSON(e.suiEvent)),e.suiCall!==void 0&&(n.suiCall=Ur.toJSON(e.suiCall)),e.suiObject!==void 0&&(n.suiObject=Vr.toJSON(e.suiObject)),e.suiObjectChange!==void 0&&(n.suiObjectChange=Lr.toJSON(e.suiObjectChange)),e.fuelLog!==void 0&&(n.fuelLog=Fr.toJSON(e.fuelLog)),e.fuelCall!==void 0&&(n.fuelCall=Mr.toJSON(e.fuelCall)),e.fuelTransaction!==void 0&&(n.fuelTransaction=wr.toJSON(e.fuelTransaction)),e.fuelBlock!==void 0&&(n.fuelBlock=Wr.toJSON(e.fuelBlock)),e.cosmosCall!==void 0&&(n.cosmosCall=Gr.toJSON(e.cosmosCall)),e.starknetEvents!==void 0&&(n.starknetEvents=qr.toJSON(e.starknetEvents)),e.btcTransaction!==void 0&&(n.btcTransaction=Hr.toJSON(e.btcTransaction)),e.btcBlock!==void 0&&(n.btcBlock=Qr.toJSON(e.btcBlock)),n},create(e){return Rr.fromPartial(e??{})},fromPartial(e){let n=ts();return n.ethLog=e.ethLog!==void 0&&e.ethLog!==null?Pr.fromPartial(e.ethLog):void 0,n.ethBlock=e.ethBlock!==void 0&&e.ethBlock!==null?_r.fromPartial(e.ethBlock):void 0,n.ethTransaction=e.ethTransaction!==void 0&&e.ethTransaction!==null?vr.fromPartial(e.ethTransaction):void 0,n.ethTrace=e.ethTrace!==void 0&&e.ethTrace!==null?Ar.fromPartial(e.ethTrace):void 0,n.solInstruction=e.solInstruction!==void 0&&e.solInstruction!==null?Br.fromPartial(e.solInstruction):void 0,n.aptEvent=e.aptEvent!==void 0&&e.aptEvent!==null?br.fromPartial(e.aptEvent):void 0,n.aptCall=e.aptCall!==void 0&&e.aptCall!==null?Dr.fromPartial(e.aptCall):void 0,n.aptResource=e.aptResource!==void 0&&e.aptResource!==null?Jr.fromPartial(e.aptResource):void 0,n.suiEvent=e.suiEvent!==void 0&&e.suiEvent!==null?xr.fromPartial(e.suiEvent):void 0,n.suiCall=e.suiCall!==void 0&&e.suiCall!==null?Ur.fromPartial(e.suiCall):void 0,n.suiObject=e.suiObject!==void 0&&e.suiObject!==null?Vr.fromPartial(e.suiObject):void 0,n.suiObjectChange=e.suiObjectChange!==void 0&&e.suiObjectChange!==null?Lr.fromPartial(e.suiObjectChange):void 0,n.fuelLog=e.fuelLog!==void 0&&e.fuelLog!==null?Fr.fromPartial(e.fuelLog):void 0,n.fuelCall=e.fuelCall!==void 0&&e.fuelCall!==null?Mr.fromPartial(e.fuelCall):void 0,n.fuelTransaction=e.fuelTransaction!==void 0&&e.fuelTransaction!==null?wr.fromPartial(e.fuelTransaction):void 0,n.fuelBlock=e.fuelBlock!==void 0&&e.fuelBlock!==null?Wr.fromPartial(e.fuelBlock):void 0,n.cosmosCall=e.cosmosCall!==void 0&&e.cosmosCall!==null?Gr.fromPartial(e.cosmosCall):void 0,n.starknetEvents=e.starknetEvents!==void 0&&e.starknetEvents!==null?qr.fromPartial(e.starknetEvents):void 0,n.btcTransaction=e.btcTransaction!==void 0&&e.btcTransaction!==null?Hr.fromPartial(e.btcTransaction):void 0,n.btcBlock=e.btcBlock!==void 0&&e.btcBlock!==null?Qr.fromPartial(e.btcBlock):void 0,n}};function rs(){return{log:void 0,timestamp:void 0,transaction:void 0,transactionReceipt:void 0,block:void 0,rawLog:"",rawTransaction:void 0,rawTransactionReceipt:void 0,rawBlock:void 0}}var Pr={encode(e,n=o.default.Writer.create()){return e.log!==void 0&&f.encode(f.wrap(e.log),n.uint32(26).fork()).ldelim(),e.timestamp!==void 0&&T.encode(oe(e.timestamp),n.uint32(34).fork()).ldelim(),e.transaction!==void 0&&f.encode(f.wrap(e.transaction),n.uint32(18).fork()).ldelim(),e.transactionReceipt!==void 0&&f.encode(f.wrap(e.transactionReceipt),n.uint32(42).fork()).ldelim(),e.block!==void 0&&f.encode(f.wrap(e.block),n.uint32(50).fork()).ldelim(),e.rawLog!==""&&n.uint32(58).string(e.rawLog),e.rawTransaction!==void 0&&n.uint32(66).string(e.rawTransaction),e.rawTransactionReceipt!==void 0&&n.uint32(74).string(e.rawTransactionReceipt),e.rawBlock!==void 0&&n.uint32(82).string(e.rawBlock),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=rs();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 3:if(r!==26)break;i.log=f.unwrap(f.decode(t,t.uint32()));continue;case 4:if(r!==34)break;i.timestamp=X(T.decode(t,t.uint32()));continue;case 2:if(r!==18)break;i.transaction=f.unwrap(f.decode(t,t.uint32()));continue;case 5:if(r!==42)break;i.transactionReceipt=f.unwrap(f.decode(t,t.uint32()));continue;case 6:if(r!==50)break;i.block=f.unwrap(f.decode(t,t.uint32()));continue;case 7:if(r!==58)break;i.rawLog=t.string();continue;case 8:if(r!==66)break;i.rawTransaction=t.string();continue;case 9:if(r!==74)break;i.rawTransactionReceipt=t.string();continue;case 10:if(r!==82)break;i.rawBlock=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{log:C(e.log)?e.log:void 0,timestamp:u(e.timestamp)?ue(e.timestamp):void 0,transaction:C(e.transaction)?e.transaction:void 0,transactionReceipt:C(e.transactionReceipt)?e.transactionReceipt:void 0,block:C(e.block)?e.block:void 0,rawLog:u(e.rawLog)?globalThis.String(e.rawLog):"",rawTransaction:u(e.rawTransaction)?globalThis.String(e.rawTransaction):void 0,rawTransactionReceipt:u(e.rawTransactionReceipt)?globalThis.String(e.rawTransactionReceipt):void 0,rawBlock:u(e.rawBlock)?globalThis.String(e.rawBlock):void 0}},toJSON(e){let n={};return e.log!==void 0&&(n.log=e.log),e.timestamp!==void 0&&(n.timestamp=e.timestamp.toISOString()),e.transaction!==void 0&&(n.transaction=e.transaction),e.transactionReceipt!==void 0&&(n.transactionReceipt=e.transactionReceipt),e.block!==void 0&&(n.block=e.block),e.rawLog!==""&&(n.rawLog=e.rawLog),e.rawTransaction!==void 0&&(n.rawTransaction=e.rawTransaction),e.rawTransactionReceipt!==void 0&&(n.rawTransactionReceipt=e.rawTransactionReceipt),e.rawBlock!==void 0&&(n.rawBlock=e.rawBlock),n},create(e){return Pr.fromPartial(e??{})},fromPartial(e){let n=rs();return n.log=e.log??void 0,n.timestamp=e.timestamp??void 0,n.transaction=e.transaction??void 0,n.transactionReceipt=e.transactionReceipt??void 0,n.block=e.block??void 0,n.rawLog=e.rawLog??"",n.rawTransaction=e.rawTransaction??void 0,n.rawTransactionReceipt=e.rawTransactionReceipt??void 0,n.rawBlock=e.rawBlock??void 0,n}};function is(){return{block:void 0}}var _r={encode(e,n=o.default.Writer.create()){return e.block!==void 0&&f.encode(f.wrap(e.block),n.uint32(18).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=is();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 2:if(r!==18)break;i.block=f.unwrap(f.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{block:C(e.block)?e.block:void 0}},toJSON(e){let n={};return e.block!==void 0&&(n.block=e.block),n},create(e){return _r.fromPartial(e??{})},fromPartial(e){let n=is();return n.block=e.block??void 0,n}};function as(){return{transaction:void 0,timestamp:void 0,transactionReceipt:void 0,block:void 0,trace:void 0,rawTransaction:"",rawTransactionReceipt:void 0,rawBlock:void 0,rawTrace:void 0}}var vr={encode(e,n=o.default.Writer.create()){return e.transaction!==void 0&&f.encode(f.wrap(e.transaction),n.uint32(34).fork()).ldelim(),e.timestamp!==void 0&&T.encode(oe(e.timestamp),n.uint32(42).fork()).ldelim(),e.transactionReceipt!==void 0&&f.encode(f.wrap(e.transactionReceipt),n.uint32(26).fork()).ldelim(),e.block!==void 0&&f.encode(f.wrap(e.block),n.uint32(50).fork()).ldelim(),e.trace!==void 0&&f.encode(f.wrap(e.trace),n.uint32(58).fork()).ldelim(),e.rawTransaction!==""&&n.uint32(66).string(e.rawTransaction),e.rawTransactionReceipt!==void 0&&n.uint32(74).string(e.rawTransactionReceipt),e.rawBlock!==void 0&&n.uint32(82).string(e.rawBlock),e.rawTrace!==void 0&&n.uint32(90).string(e.rawTrace),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=as();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 4:if(r!==34)break;i.transaction=f.unwrap(f.decode(t,t.uint32()));continue;case 5:if(r!==42)break;i.timestamp=X(T.decode(t,t.uint32()));continue;case 3:if(r!==26)break;i.transactionReceipt=f.unwrap(f.decode(t,t.uint32()));continue;case 6:if(r!==50)break;i.block=f.unwrap(f.decode(t,t.uint32()));continue;case 7:if(r!==58)break;i.trace=f.unwrap(f.decode(t,t.uint32()));continue;case 8:if(r!==66)break;i.rawTransaction=t.string();continue;case 9:if(r!==74)break;i.rawTransactionReceipt=t.string();continue;case 10:if(r!==82)break;i.rawBlock=t.string();continue;case 11:if(r!==90)break;i.rawTrace=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{transaction:C(e.transaction)?e.transaction:void 0,timestamp:u(e.timestamp)?ue(e.timestamp):void 0,transactionReceipt:C(e.transactionReceipt)?e.transactionReceipt:void 0,block:C(e.block)?e.block:void 0,trace:C(e.trace)?e.trace:void 0,rawTransaction:u(e.rawTransaction)?globalThis.String(e.rawTransaction):"",rawTransactionReceipt:u(e.rawTransactionReceipt)?globalThis.String(e.rawTransactionReceipt):void 0,rawBlock:u(e.rawBlock)?globalThis.String(e.rawBlock):void 0,rawTrace:u(e.rawTrace)?globalThis.String(e.rawTrace):void 0}},toJSON(e){let n={};return e.transaction!==void 0&&(n.transaction=e.transaction),e.timestamp!==void 0&&(n.timestamp=e.timestamp.toISOString()),e.transactionReceipt!==void 0&&(n.transactionReceipt=e.transactionReceipt),e.block!==void 0&&(n.block=e.block),e.trace!==void 0&&(n.trace=e.trace),e.rawTransaction!==""&&(n.rawTransaction=e.rawTransaction),e.rawTransactionReceipt!==void 0&&(n.rawTransactionReceipt=e.rawTransactionReceipt),e.rawBlock!==void 0&&(n.rawBlock=e.rawBlock),e.rawTrace!==void 0&&(n.rawTrace=e.rawTrace),n},create(e){return vr.fromPartial(e??{})},fromPartial(e){let n=as();return n.transaction=e.transaction??void 0,n.timestamp=e.timestamp??void 0,n.transactionReceipt=e.transactionReceipt??void 0,n.block=e.block??void 0,n.trace=e.trace??void 0,n.rawTransaction=e.rawTransaction??"",n.rawTransactionReceipt=e.rawTransactionReceipt??void 0,n.rawBlock=e.rawBlock??void 0,n.rawTrace=e.rawTrace??void 0,n}};function os(){return{trace:void 0,timestamp:void 0,transaction:void 0,transactionReceipt:void 0,block:void 0}}var Ar={encode(e,n=o.default.Writer.create()){return e.trace!==void 0&&f.encode(f.wrap(e.trace),n.uint32(34).fork()).ldelim(),e.timestamp!==void 0&&T.encode(oe(e.timestamp),n.uint32(42).fork()).ldelim(),e.transaction!==void 0&&f.encode(f.wrap(e.transaction),n.uint32(18).fork()).ldelim(),e.transactionReceipt!==void 0&&f.encode(f.wrap(e.transactionReceipt),n.uint32(26).fork()).ldelim(),e.block!==void 0&&f.encode(f.wrap(e.block),n.uint32(50).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=os();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 4:if(r!==34)break;i.trace=f.unwrap(f.decode(t,t.uint32()));continue;case 5:if(r!==42)break;i.timestamp=X(T.decode(t,t.uint32()));continue;case 2:if(r!==18)break;i.transaction=f.unwrap(f.decode(t,t.uint32()));continue;case 3:if(r!==26)break;i.transactionReceipt=f.unwrap(f.decode(t,t.uint32()));continue;case 6:if(r!==50)break;i.block=f.unwrap(f.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{trace:C(e.trace)?e.trace:void 0,timestamp:u(e.timestamp)?ue(e.timestamp):void 0,transaction:C(e.transaction)?e.transaction:void 0,transactionReceipt:C(e.transactionReceipt)?e.transactionReceipt:void 0,block:C(e.block)?e.block:void 0}},toJSON(e){let n={};return e.trace!==void 0&&(n.trace=e.trace),e.timestamp!==void 0&&(n.timestamp=e.timestamp.toISOString()),e.transaction!==void 0&&(n.transaction=e.transaction),e.transactionReceipt!==void 0&&(n.transactionReceipt=e.transactionReceipt),e.block!==void 0&&(n.block=e.block),n},create(e){return Ar.fromPartial(e??{})},fromPartial(e){let n=os();return n.trace=e.trace??void 0,n.timestamp=e.timestamp??void 0,n.transaction=e.transaction??void 0,n.transactionReceipt=e.transactionReceipt??void 0,n.block=e.block??void 0,n}};function us(){return{instructionData:"",slot:BigInt("0"),programAccountId:"",accounts:[],parsed:void 0}}var Br={encode(e,n=o.default.Writer.create()){if(e.instructionData!==""&&n.uint32(10).string(e.instructionData),e.slot!==BigInt("0")){if(BigInt.asUintN(64,e.slot)!==e.slot)throw new globalThis.Error("value provided for field message.slot of type uint64 too large");n.uint32(16).uint64(e.slot.toString())}e.programAccountId!==""&&n.uint32(26).string(e.programAccountId);for(let t of e.accounts)n.uint32(42).string(t);return e.parsed!==void 0&&f.encode(f.wrap(e.parsed),n.uint32(34).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=us();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.instructionData=t.string();continue;case 2:if(r!==16)break;i.slot=G(t.uint64());continue;case 3:if(r!==26)break;i.programAccountId=t.string();continue;case 5:if(r!==42)break;i.accounts.push(t.string());continue;case 4:if(r!==34)break;i.parsed=f.unwrap(f.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{instructionData:u(e.instructionData)?globalThis.String(e.instructionData):"",slot:u(e.slot)?BigInt(e.slot):BigInt("0"),programAccountId:u(e.programAccountId)?globalThis.String(e.programAccountId):"",accounts:globalThis.Array.isArray(e?.accounts)?e.accounts.map(n=>globalThis.String(n)):[],parsed:C(e.parsed)?e.parsed:void 0}},toJSON(e){let n={};return e.instructionData!==""&&(n.instructionData=e.instructionData),e.slot!==BigInt("0")&&(n.slot=e.slot.toString()),e.programAccountId!==""&&(n.programAccountId=e.programAccountId),e.accounts?.length&&(n.accounts=e.accounts),e.parsed!==void 0&&(n.parsed=e.parsed),n},create(e){return Br.fromPartial(e??{})},fromPartial(e){let n=us();return n.instructionData=e.instructionData??"",n.slot=e.slot??BigInt("0"),n.programAccountId=e.programAccountId??"",n.accounts=e.accounts?.map(t=>t)||[],n.parsed=e.parsed??void 0,n}};function ds(){return{rawEvent:"",eventIndex:0,transaction:void 0,rawTransaction:""}}var br={encode(e,n=o.default.Writer.create()){return e.rawEvent!==""&&n.uint32(10).string(e.rawEvent),e.eventIndex!==0&&n.uint32(32).int32(e.eventIndex),e.transaction!==void 0&&f.encode(f.wrap(e.transaction),n.uint32(18).fork()).ldelim(),e.rawTransaction!==""&&n.uint32(26).string(e.rawTransaction),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=ds();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.rawEvent=t.string();continue;case 4:if(r!==32)break;i.eventIndex=t.int32();continue;case 2:if(r!==18)break;i.transaction=f.unwrap(f.decode(t,t.uint32()));continue;case 3:if(r!==26)break;i.rawTransaction=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{rawEvent:u(e.rawEvent)?globalThis.String(e.rawEvent):"",eventIndex:u(e.eventIndex)?globalThis.Number(e.eventIndex):0,transaction:C(e.transaction)?e.transaction:void 0,rawTransaction:u(e.rawTransaction)?globalThis.String(e.rawTransaction):""}},toJSON(e){let n={};return e.rawEvent!==""&&(n.rawEvent=e.rawEvent),e.eventIndex!==0&&(n.eventIndex=Math.round(e.eventIndex)),e.transaction!==void 0&&(n.transaction=e.transaction),e.rawTransaction!==""&&(n.rawTransaction=e.rawTransaction),n},create(e){return br.fromPartial(e??{})},fromPartial(e){let n=ds();return n.rawEvent=e.rawEvent??"",n.eventIndex=e.eventIndex??0,n.transaction=e.transaction??void 0,n.rawTransaction=e.rawTransaction??"",n}};function ls(){return{transaction:void 0,rawTransaction:""}}var Dr={encode(e,n=o.default.Writer.create()){return e.transaction!==void 0&&f.encode(f.wrap(e.transaction),n.uint32(18).fork()).ldelim(),e.rawTransaction!==""&&n.uint32(26).string(e.rawTransaction),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=ls();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 2:if(r!==18)break;i.transaction=f.unwrap(f.decode(t,t.uint32()));continue;case 3:if(r!==26)break;i.rawTransaction=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{transaction:C(e.transaction)?e.transaction:void 0,rawTransaction:u(e.rawTransaction)?globalThis.String(e.rawTransaction):""}},toJSON(e){let n={};return e.transaction!==void 0&&(n.transaction=e.transaction),e.rawTransaction!==""&&(n.rawTransaction=e.rawTransaction),n},create(e){return Dr.fromPartial(e??{})},fromPartial(e){let n=ls();return n.transaction=e.transaction??void 0,n.rawTransaction=e.rawTransaction??"",n}};function ss(){return{resources:[],version:BigInt("0"),timestampMicros:BigInt("0"),rawResources:[]}}var Jr={encode(e,n=o.default.Writer.create()){for(let t of e.resources)f.encode(f.wrap(t),n.uint32(34).fork()).ldelim();if(e.version!==BigInt("0")){if(BigInt.asIntN(64,e.version)!==e.version)throw new globalThis.Error("value provided for field message.version of type int64 too large");n.uint32(16).int64(e.version.toString())}if(e.timestampMicros!==BigInt("0")){if(BigInt.asIntN(64,e.timestampMicros)!==e.timestampMicros)throw new globalThis.Error("value provided for field message.timestampMicros of type int64 too large");n.uint32(40).int64(e.timestampMicros.toString())}for(let t of e.rawResources)n.uint32(50).string(t);return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=ss();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 4:if(r!==34)break;i.resources.push(f.unwrap(f.decode(t,t.uint32())));continue;case 2:if(r!==16)break;i.version=G(t.int64());continue;case 5:if(r!==40)break;i.timestampMicros=G(t.int64());continue;case 6:if(r!==50)break;i.rawResources.push(t.string());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{resources:globalThis.Array.isArray(e?.resources)?[...e.resources]:[],version:u(e.version)?BigInt(e.version):BigInt("0"),timestampMicros:u(e.timestampMicros)?BigInt(e.timestampMicros):BigInt("0"),rawResources:globalThis.Array.isArray(e?.rawResources)?e.rawResources.map(n=>globalThis.String(n)):[]}},toJSON(e){let n={};return e.resources?.length&&(n.resources=e.resources),e.version!==BigInt("0")&&(n.version=e.version.toString()),e.timestampMicros!==BigInt("0")&&(n.timestampMicros=e.timestampMicros.toString()),e.rawResources?.length&&(n.rawResources=e.rawResources),n},create(e){return Jr.fromPartial(e??{})},fromPartial(e){let n=ss();return n.resources=e.resources?.map(t=>t)||[],n.version=e.version??BigInt("0"),n.timestampMicros=e.timestampMicros??BigInt("0"),n.rawResources=e.rawResources?.map(t=>t)||[],n}};function fs(){return{transaction:void 0,rawEvent:"",rawTransaction:"",timestamp:void 0,slot:BigInt("0")}}var xr={encode(e,n=o.default.Writer.create()){if(e.transaction!==void 0&&f.encode(f.wrap(e.transaction),n.uint32(10).fork()).ldelim(),e.rawEvent!==""&&n.uint32(34).string(e.rawEvent),e.rawTransaction!==""&&n.uint32(42).string(e.rawTransaction),e.timestamp!==void 0&&T.encode(oe(e.timestamp),n.uint32(18).fork()).ldelim(),e.slot!==BigInt("0")){if(BigInt.asUintN(64,e.slot)!==e.slot)throw new globalThis.Error("value provided for field message.slot of type uint64 too large");n.uint32(24).uint64(e.slot.toString())}return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=fs();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.transaction=f.unwrap(f.decode(t,t.uint32()));continue;case 4:if(r!==34)break;i.rawEvent=t.string();continue;case 5:if(r!==42)break;i.rawTransaction=t.string();continue;case 2:if(r!==18)break;i.timestamp=X(T.decode(t,t.uint32()));continue;case 3:if(r!==24)break;i.slot=G(t.uint64());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{transaction:C(e.transaction)?e.transaction:void 0,rawEvent:u(e.rawEvent)?globalThis.String(e.rawEvent):"",rawTransaction:u(e.rawTransaction)?globalThis.String(e.rawTransaction):"",timestamp:u(e.timestamp)?ue(e.timestamp):void 0,slot:u(e.slot)?BigInt(e.slot):BigInt("0")}},toJSON(e){let n={};return e.transaction!==void 0&&(n.transaction=e.transaction),e.rawEvent!==""&&(n.rawEvent=e.rawEvent),e.rawTransaction!==""&&(n.rawTransaction=e.rawTransaction),e.timestamp!==void 0&&(n.timestamp=e.timestamp.toISOString()),e.slot!==BigInt("0")&&(n.slot=e.slot.toString()),n},create(e){return xr.fromPartial(e??{})},fromPartial(e){let n=fs();return n.transaction=e.transaction??void 0,n.rawEvent=e.rawEvent??"",n.rawTransaction=e.rawTransaction??"",n.timestamp=e.timestamp??void 0,n.slot=e.slot??BigInt("0"),n}};function cs(){return{transaction:void 0,rawTransaction:"",timestamp:void 0,slot:BigInt("0")}}var Ur={encode(e,n=o.default.Writer.create()){if(e.transaction!==void 0&&f.encode(f.wrap(e.transaction),n.uint32(10).fork()).ldelim(),e.rawTransaction!==""&&n.uint32(34).string(e.rawTransaction),e.timestamp!==void 0&&T.encode(oe(e.timestamp),n.uint32(18).fork()).ldelim(),e.slot!==BigInt("0")){if(BigInt.asUintN(64,e.slot)!==e.slot)throw new globalThis.Error("value provided for field message.slot of type uint64 too large");n.uint32(24).uint64(e.slot.toString())}return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=cs();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.transaction=f.unwrap(f.decode(t,t.uint32()));continue;case 4:if(r!==34)break;i.rawTransaction=t.string();continue;case 2:if(r!==18)break;i.timestamp=X(T.decode(t,t.uint32()));continue;case 3:if(r!==24)break;i.slot=G(t.uint64());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{transaction:C(e.transaction)?e.transaction:void 0,rawTransaction:u(e.rawTransaction)?globalThis.String(e.rawTransaction):"",timestamp:u(e.timestamp)?ue(e.timestamp):void 0,slot:u(e.slot)?BigInt(e.slot):BigInt("0")}},toJSON(e){let n={};return e.transaction!==void 0&&(n.transaction=e.transaction),e.rawTransaction!==""&&(n.rawTransaction=e.rawTransaction),e.timestamp!==void 0&&(n.timestamp=e.timestamp.toISOString()),e.slot!==BigInt("0")&&(n.slot=e.slot.toString()),n},create(e){return Ur.fromPartial(e??{})},fromPartial(e){let n=cs();return n.transaction=e.transaction??void 0,n.rawTransaction=e.rawTransaction??"",n.timestamp=e.timestamp??void 0,n.slot=e.slot??BigInt("0"),n}};function ps(){return{objects:[],self:void 0,rawObjects:[],rawSelf:void 0,objectId:"",objectVersion:BigInt("0"),objectDigest:"",timestamp:void 0,slot:BigInt("0")}}var Vr={encode(e,n=o.default.Writer.create()){for(let t of e.objects)f.encode(f.wrap(t),n.uint32(10).fork()).ldelim();e.self!==void 0&&f.encode(f.wrap(e.self),n.uint32(34).fork()).ldelim();for(let t of e.rawObjects)n.uint32(82).string(t);if(e.rawSelf!==void 0&&n.uint32(74).string(e.rawSelf),e.objectId!==""&&n.uint32(42).string(e.objectId),e.objectVersion!==BigInt("0")){if(BigInt.asUintN(64,e.objectVersion)!==e.objectVersion)throw new globalThis.Error("value provided for field message.objectVersion of type uint64 too large");n.uint32(48).uint64(e.objectVersion.toString())}if(e.objectDigest!==""&&n.uint32(58).string(e.objectDigest),e.timestamp!==void 0&&T.encode(oe(e.timestamp),n.uint32(18).fork()).ldelim(),e.slot!==BigInt("0")){if(BigInt.asUintN(64,e.slot)!==e.slot)throw new globalThis.Error("value provided for field message.slot of type uint64 too large");n.uint32(24).uint64(e.slot.toString())}return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=ps();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.objects.push(f.unwrap(f.decode(t,t.uint32())));continue;case 4:if(r!==34)break;i.self=f.unwrap(f.decode(t,t.uint32()));continue;case 10:if(r!==82)break;i.rawObjects.push(t.string());continue;case 9:if(r!==74)break;i.rawSelf=t.string();continue;case 5:if(r!==42)break;i.objectId=t.string();continue;case 6:if(r!==48)break;i.objectVersion=G(t.uint64());continue;case 7:if(r!==58)break;i.objectDigest=t.string();continue;case 2:if(r!==18)break;i.timestamp=X(T.decode(t,t.uint32()));continue;case 3:if(r!==24)break;i.slot=G(t.uint64());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{objects:globalThis.Array.isArray(e?.objects)?[...e.objects]:[],self:C(e.self)?e.self:void 0,rawObjects:globalThis.Array.isArray(e?.rawObjects)?e.rawObjects.map(n=>globalThis.String(n)):[],rawSelf:u(e.rawSelf)?globalThis.String(e.rawSelf):void 0,objectId:u(e.objectId)?globalThis.String(e.objectId):"",objectVersion:u(e.objectVersion)?BigInt(e.objectVersion):BigInt("0"),objectDigest:u(e.objectDigest)?globalThis.String(e.objectDigest):"",timestamp:u(e.timestamp)?ue(e.timestamp):void 0,slot:u(e.slot)?BigInt(e.slot):BigInt("0")}},toJSON(e){let n={};return e.objects?.length&&(n.objects=e.objects),e.self!==void 0&&(n.self=e.self),e.rawObjects?.length&&(n.rawObjects=e.rawObjects),e.rawSelf!==void 0&&(n.rawSelf=e.rawSelf),e.objectId!==""&&(n.objectId=e.objectId),e.objectVersion!==BigInt("0")&&(n.objectVersion=e.objectVersion.toString()),e.objectDigest!==""&&(n.objectDigest=e.objectDigest),e.timestamp!==void 0&&(n.timestamp=e.timestamp.toISOString()),e.slot!==BigInt("0")&&(n.slot=e.slot.toString()),n},create(e){return Vr.fromPartial(e??{})},fromPartial(e){let n=ps();return n.objects=e.objects?.map(t=>t)||[],n.self=e.self??void 0,n.rawObjects=e.rawObjects?.map(t=>t)||[],n.rawSelf=e.rawSelf??void 0,n.objectId=e.objectId??"",n.objectVersion=e.objectVersion??BigInt("0"),n.objectDigest=e.objectDigest??"",n.timestamp=e.timestamp??void 0,n.slot=e.slot??BigInt("0"),n}};function gs(){return{changes:[],rawChanges:[],timestamp:void 0,txDigest:"",slot:BigInt("0")}}var Lr={encode(e,n=o.default.Writer.create()){for(let t of e.changes)f.encode(f.wrap(t),n.uint32(10).fork()).ldelim();for(let t of e.rawChanges)n.uint32(42).string(t);if(e.timestamp!==void 0&&T.encode(oe(e.timestamp),n.uint32(18).fork()).ldelim(),e.txDigest!==""&&n.uint32(34).string(e.txDigest),e.slot!==BigInt("0")){if(BigInt.asUintN(64,e.slot)!==e.slot)throw new globalThis.Error("value provided for field message.slot of type uint64 too large");n.uint32(24).uint64(e.slot.toString())}return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=gs();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.changes.push(f.unwrap(f.decode(t,t.uint32())));continue;case 5:if(r!==42)break;i.rawChanges.push(t.string());continue;case 2:if(r!==18)break;i.timestamp=X(T.decode(t,t.uint32()));continue;case 4:if(r!==34)break;i.txDigest=t.string();continue;case 3:if(r!==24)break;i.slot=G(t.uint64());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{changes:globalThis.Array.isArray(e?.changes)?[...e.changes]:[],rawChanges:globalThis.Array.isArray(e?.rawChanges)?e.rawChanges.map(n=>globalThis.String(n)):[],timestamp:u(e.timestamp)?ue(e.timestamp):void 0,txDigest:u(e.txDigest)?globalThis.String(e.txDigest):"",slot:u(e.slot)?BigInt(e.slot):BigInt("0")}},toJSON(e){let n={};return e.changes?.length&&(n.changes=e.changes),e.rawChanges?.length&&(n.rawChanges=e.rawChanges),e.timestamp!==void 0&&(n.timestamp=e.timestamp.toISOString()),e.txDigest!==""&&(n.txDigest=e.txDigest),e.slot!==BigInt("0")&&(n.slot=e.slot.toString()),n},create(e){return Lr.fromPartial(e??{})},fromPartial(e){let n=gs();return n.changes=e.changes?.map(t=>t)||[],n.rawChanges=e.rawChanges?.map(t=>t)||[],n.timestamp=e.timestamp??void 0,n.txDigest=e.txDigest??"",n.slot=e.slot??BigInt("0"),n}};function hs(){return{transaction:void 0,timestamp:void 0,receiptIndex:BigInt("0")}}var Fr={encode(e,n=o.default.Writer.create()){if(e.transaction!==void 0&&f.encode(f.wrap(e.transaction),n.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&T.encode(oe(e.timestamp),n.uint32(18).fork()).ldelim(),e.receiptIndex!==BigInt("0")){if(BigInt.asIntN(64,e.receiptIndex)!==e.receiptIndex)throw new globalThis.Error("value provided for field message.receiptIndex of type int64 too large");n.uint32(24).int64(e.receiptIndex.toString())}return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=hs();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.transaction=f.unwrap(f.decode(t,t.uint32()));continue;case 2:if(r!==18)break;i.timestamp=X(T.decode(t,t.uint32()));continue;case 3:if(r!==24)break;i.receiptIndex=G(t.int64());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{transaction:C(e.transaction)?e.transaction:void 0,timestamp:u(e.timestamp)?ue(e.timestamp):void 0,receiptIndex:u(e.receiptIndex)?BigInt(e.receiptIndex):BigInt("0")}},toJSON(e){let n={};return e.transaction!==void 0&&(n.transaction=e.transaction),e.timestamp!==void 0&&(n.timestamp=e.timestamp.toISOString()),e.receiptIndex!==BigInt("0")&&(n.receiptIndex=e.receiptIndex.toString()),n},create(e){return Fr.fromPartial(e??{})},fromPartial(e){let n=hs();return n.transaction=e.transaction??void 0,n.timestamp=e.timestamp??void 0,n.receiptIndex=e.receiptIndex??BigInt("0"),n}};function ms(){return{transaction:void 0,timestamp:void 0}}var wr={encode(e,n=o.default.Writer.create()){return e.transaction!==void 0&&f.encode(f.wrap(e.transaction),n.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&T.encode(oe(e.timestamp),n.uint32(18).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=ms();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.transaction=f.unwrap(f.decode(t,t.uint32()));continue;case 2:if(r!==18)break;i.timestamp=X(T.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{transaction:C(e.transaction)?e.transaction:void 0,timestamp:u(e.timestamp)?ue(e.timestamp):void 0}},toJSON(e){let n={};return e.transaction!==void 0&&(n.transaction=e.transaction),e.timestamp!==void 0&&(n.timestamp=e.timestamp.toISOString()),n},create(e){return wr.fromPartial(e??{})},fromPartial(e){let n=ms();return n.transaction=e.transaction??void 0,n.timestamp=e.timestamp??void 0,n}};function ys(){return{transaction:void 0,timestamp:void 0}}var Mr={encode(e,n=o.default.Writer.create()){return e.transaction!==void 0&&f.encode(f.wrap(e.transaction),n.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&T.encode(oe(e.timestamp),n.uint32(18).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=ys();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.transaction=f.unwrap(f.decode(t,t.uint32()));continue;case 2:if(r!==18)break;i.timestamp=X(T.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{transaction:C(e.transaction)?e.transaction:void 0,timestamp:u(e.timestamp)?ue(e.timestamp):void 0}},toJSON(e){let n={};return e.transaction!==void 0&&(n.transaction=e.transaction),e.timestamp!==void 0&&(n.timestamp=e.timestamp.toISOString()),n},create(e){return Mr.fromPartial(e??{})},fromPartial(e){let n=ys();return n.transaction=e.transaction??void 0,n.timestamp=e.timestamp??void 0,n}};function ks(){return{block:void 0,timestamp:void 0}}var Wr={encode(e,n=o.default.Writer.create()){return e.block!==void 0&&f.encode(f.wrap(e.block),n.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&T.encode(oe(e.timestamp),n.uint32(18).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=ks();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.block=f.unwrap(f.decode(t,t.uint32()));continue;case 2:if(r!==18)break;i.timestamp=X(T.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{block:C(e.block)?e.block:void 0,timestamp:u(e.timestamp)?ue(e.timestamp):void 0}},toJSON(e){let n={};return e.block!==void 0&&(n.block=e.block),e.timestamp!==void 0&&(n.timestamp=e.timestamp.toISOString()),n},create(e){return Wr.fromPartial(e??{})},fromPartial(e){let n=ks();return n.block=e.block??void 0,n.timestamp=e.timestamp??void 0,n}};function Ss(){return{transaction:void 0,timestamp:void 0}}var Gr={encode(e,n=o.default.Writer.create()){return e.transaction!==void 0&&f.encode(f.wrap(e.transaction),n.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&T.encode(oe(e.timestamp),n.uint32(18).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Ss();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.transaction=f.unwrap(f.decode(t,t.uint32()));continue;case 2:if(r!==18)break;i.timestamp=X(T.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{transaction:C(e.transaction)?e.transaction:void 0,timestamp:u(e.timestamp)?ue(e.timestamp):void 0}},toJSON(e){let n={};return e.transaction!==void 0&&(n.transaction=e.transaction),e.timestamp!==void 0&&(n.timestamp=e.timestamp.toISOString()),n},create(e){return Gr.fromPartial(e??{})},fromPartial(e){let n=Ss();return n.transaction=e.transaction??void 0,n.timestamp=e.timestamp??void 0,n}};function Ns(){return{result:void 0,timestamp:void 0}}var qr={encode(e,n=o.default.Writer.create()){return e.result!==void 0&&f.encode(f.wrap(e.result),n.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&T.encode(oe(e.timestamp),n.uint32(18).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Ns();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.result=f.unwrap(f.decode(t,t.uint32()));continue;case 2:if(r!==18)break;i.timestamp=X(T.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{result:C(e.result)?e.result:void 0,timestamp:u(e.timestamp)?ue(e.timestamp):void 0}},toJSON(e){let n={};return e.result!==void 0&&(n.result=e.result),e.timestamp!==void 0&&(n.timestamp=e.timestamp.toISOString()),n},create(e){return qr.fromPartial(e??{})},fromPartial(e){let n=Ns();return n.result=e.result??void 0,n.timestamp=e.timestamp??void 0,n}};function Ts(){return{transaction:void 0,timestamp:void 0}}var Hr={encode(e,n=o.default.Writer.create()){return e.transaction!==void 0&&f.encode(f.wrap(e.transaction),n.uint32(34).fork()).ldelim(),e.timestamp!==void 0&&T.encode(oe(e.timestamp),n.uint32(42).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Ts();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 4:if(r!==34)break;i.transaction=f.unwrap(f.decode(t,t.uint32()));continue;case 5:if(r!==42)break;i.timestamp=X(T.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{transaction:C(e.transaction)?e.transaction:void 0,timestamp:u(e.timestamp)?ue(e.timestamp):void 0}},toJSON(e){let n={};return e.transaction!==void 0&&(n.transaction=e.transaction),e.timestamp!==void 0&&(n.timestamp=e.timestamp.toISOString()),n},create(e){return Hr.fromPartial(e??{})},fromPartial(e){let n=Ts();return n.transaction=e.transaction??void 0,n.timestamp=e.timestamp??void 0,n}};function Cs(){return{block:void 0,timestamp:void 0}}var Qr={encode(e,n=o.default.Writer.create()){return e.block!==void 0&&f.encode(f.wrap(e.block),n.uint32(10).fork()).ldelim(),e.timestamp!==void 0&&T.encode(oe(e.timestamp),n.uint32(18).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Cs();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.block=f.unwrap(f.decode(t,t.uint32()));continue;case 2:if(r!==18)break;i.timestamp=X(T.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{block:C(e.block)?e.block:void 0,timestamp:u(e.timestamp)?ue(e.timestamp):void 0}},toJSON(e){let n={};return e.block!==void 0&&(n.block=e.block),e.timestamp!==void 0&&(n.timestamp=e.timestamp.toISOString()),n},create(e){return Qr.fromPartial(e??{})},fromPartial(e){let n=Cs();return n.block=e.block??void 0,n.timestamp=e.timestamp??void 0,n}};function Is(){return{data:void 0,handlerType:0,handlerIds:[]}}var ae={encode(e,n=o.default.Writer.create()){e.data!==void 0&&Rr.encode(e.data,n.uint32(10).fork()).ldelim(),e.handlerType!==0&&n.uint32(24).int32(e.handlerType),n.uint32(34).fork();for(let t of e.handlerIds)n.int32(t);return n.ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Is();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.data=Rr.decode(t,t.uint32());continue;case 3:if(r!==24)break;i.handlerType=t.int32();continue;case 4:if(r===32){i.handlerIds.push(t.int32());continue}if(r===34){let s=t.uint32()+t.pos;for(;t.pos<s;)i.handlerIds.push(t.int32());continue}break}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{data:u(e.data)?Rr.fromJSON(e.data):void 0,handlerType:u(e.handlerType)?Us(e.handlerType):0,handlerIds:globalThis.Array.isArray(e?.handlerIds)?e.handlerIds.map(n=>globalThis.Number(n)):[]}},toJSON(e){let n={};return e.data!==void 0&&(n.data=Rr.toJSON(e.data)),e.handlerType!==0&&(n.handlerType=Vs(e.handlerType)),e.handlerIds?.length&&(n.handlerIds=e.handlerIds.map(t=>Math.round(t))),n},create(e){return ae.fromPartial(e??{})},fromPartial(e){let n=Is();return n.data=e.data!==void 0&&e.data!==null?Rr.fromPartial(e.data):void 0,n.handlerType=e.handlerType??0,n.handlerIds=e.handlerIds?.map(t=>t)||[],n}};function Es(){return{configUpdated:!1,error:void 0}}var Zr={encode(e,n=o.default.Writer.create()){return e.configUpdated!==!1&&n.uint32(8).bool(e.configUpdated),e.error!==void 0&&n.uint32(18).string(e.error),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Es();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.configUpdated=t.bool();continue;case 2:if(r!==18)break;i.error=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{configUpdated:u(e.configUpdated)?globalThis.Boolean(e.configUpdated):!1,error:u(e.error)?globalThis.String(e.error):void 0}},toJSON(e){let n={};return e.configUpdated!==!1&&(n.configUpdated=e.configUpdated),e.error!==void 0&&(n.error=e.error),n},create(e){return Zr.fromPartial(e??{})},fromPartial(e){let n=Es();return n.configUpdated=e.configUpdated??!1,n.error=e.error??void 0,n}};function Os(){return{gauges:[],counters:[],logs:[],events:[],exports:[],states:void 0,timeseriesResult:[]}}var je={encode(e,n=o.default.Writer.create()){for(let t of e.gauges)zr.encode(t,n.uint32(10).fork()).ldelim();for(let t of e.counters)Kr.encode(t,n.uint32(18).fork()).ldelim();for(let t of e.logs)Xr.encode(t,n.uint32(26).fork()).ldelim();for(let t of e.events)Yr.encode(t,n.uint32(34).fork()).ldelim();for(let t of e.exports)jr.encode(t,n.uint32(42).fork()).ldelim();e.states!==void 0&&Zr.encode(e.states,n.uint32(50).fork()).ldelim();for(let t of e.timeseriesResult)$r.encode(t,n.uint32(58).fork()).ldelim();return n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Os();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.gauges.push(zr.decode(t,t.uint32()));continue;case 2:if(r!==18)break;i.counters.push(Kr.decode(t,t.uint32()));continue;case 3:if(r!==26)break;i.logs.push(Xr.decode(t,t.uint32()));continue;case 4:if(r!==34)break;i.events.push(Yr.decode(t,t.uint32()));continue;case 5:if(r!==42)break;i.exports.push(jr.decode(t,t.uint32()));continue;case 6:if(r!==50)break;i.states=Zr.decode(t,t.uint32());continue;case 7:if(r!==58)break;i.timeseriesResult.push($r.decode(t,t.uint32()));continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{gauges:globalThis.Array.isArray(e?.gauges)?e.gauges.map(n=>zr.fromJSON(n)):[],counters:globalThis.Array.isArray(e?.counters)?e.counters.map(n=>Kr.fromJSON(n)):[],logs:globalThis.Array.isArray(e?.logs)?e.logs.map(n=>Xr.fromJSON(n)):[],events:globalThis.Array.isArray(e?.events)?e.events.map(n=>Yr.fromJSON(n)):[],exports:globalThis.Array.isArray(e?.exports)?e.exports.map(n=>jr.fromJSON(n)):[],states:u(e.states)?Zr.fromJSON(e.states):void 0,timeseriesResult:globalThis.Array.isArray(e?.timeseriesResult)?e.timeseriesResult.map(n=>$r.fromJSON(n)):[]}},toJSON(e){let n={};return e.gauges?.length&&(n.gauges=e.gauges.map(t=>zr.toJSON(t))),e.counters?.length&&(n.counters=e.counters.map(t=>Kr.toJSON(t))),e.logs?.length&&(n.logs=e.logs.map(t=>Xr.toJSON(t))),e.events?.length&&(n.events=e.events.map(t=>Yr.toJSON(t))),e.exports?.length&&(n.exports=e.exports.map(t=>jr.toJSON(t))),e.states!==void 0&&(n.states=Zr.toJSON(e.states)),e.timeseriesResult?.length&&(n.timeseriesResult=e.timeseriesResult.map(t=>$r.toJSON(t))),n},create(e){return je.fromPartial(e??{})},fromPartial(e){let n=Os();return n.gauges=e.gauges?.map(t=>zr.fromPartial(t))||[],n.counters=e.counters?.map(t=>Kr.fromPartial(t))||[],n.logs=e.logs?.map(t=>Xr.fromPartial(t))||[],n.events=e.events?.map(t=>Yr.fromPartial(t))||[],n.exports=e.exports?.map(t=>jr.fromPartial(t))||[],n.states=e.states!==void 0&&e.states!==null?Zr.fromPartial(e.states):void 0,n.timeseriesResult=e.timeseriesResult?.map(t=>$r.fromPartial(t))||[],n}};function Rs(){return{address:"",contractName:"",blockNumber:BigInt("0"),transactionHash:"",chainId:"",transactionIndex:0,logIndex:0,name:"",labels:{}}}var _={encode(e,n=o.default.Writer.create()){if(e.address!==""&&n.uint32(10).string(e.address),e.contractName!==""&&n.uint32(74).string(e.contractName),e.blockNumber!==BigInt("0")){if(BigInt.asUintN(64,e.blockNumber)!==e.blockNumber)throw new globalThis.Error("value provided for field message.blockNumber of type uint64 too large");n.uint32(16).uint64(e.blockNumber.toString())}return e.transactionHash!==""&&n.uint32(50).string(e.transactionHash),e.chainId!==""&&n.uint32(42).string(e.chainId),e.transactionIndex!==0&&n.uint32(24).int32(e.transactionIndex),e.logIndex!==0&&n.uint32(32).int32(e.logIndex),e.name!==""&&n.uint32(82).string(e.name),Object.entries(e.labels).forEach(([t,a])=>{zi.encode({key:t,value:a},n.uint32(58).fork()).ldelim()}),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Rs();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.address=t.string();continue;case 9:if(r!==74)break;i.contractName=t.string();continue;case 2:if(r!==16)break;i.blockNumber=G(t.uint64());continue;case 6:if(r!==50)break;i.transactionHash=t.string();continue;case 5:if(r!==42)break;i.chainId=t.string();continue;case 3:if(r!==24)break;i.transactionIndex=t.int32();continue;case 4:if(r!==32)break;i.logIndex=t.int32();continue;case 10:if(r!==82)break;i.name=t.string();continue;case 7:if(r!==58)break;let s=zi.decode(t,t.uint32());s.value!==void 0&&(i.labels[s.key]=s.value);continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{address:u(e.address)?globalThis.String(e.address):"",contractName:u(e.contractName)?globalThis.String(e.contractName):"",blockNumber:u(e.blockNumber)?BigInt(e.blockNumber):BigInt("0"),transactionHash:u(e.transactionHash)?globalThis.String(e.transactionHash):"",chainId:u(e.chainId)?globalThis.String(e.chainId):"",transactionIndex:u(e.transactionIndex)?globalThis.Number(e.transactionIndex):0,logIndex:u(e.logIndex)?globalThis.Number(e.logIndex):0,name:u(e.name)?globalThis.String(e.name):"",labels:C(e.labels)?Object.entries(e.labels).reduce((n,[t,a])=>(n[t]=String(a),n),{}):{}}},toJSON(e){let n={};if(e.address!==""&&(n.address=e.address),e.contractName!==""&&(n.contractName=e.contractName),e.blockNumber!==BigInt("0")&&(n.blockNumber=e.blockNumber.toString()),e.transactionHash!==""&&(n.transactionHash=e.transactionHash),e.chainId!==""&&(n.chainId=e.chainId),e.transactionIndex!==0&&(n.transactionIndex=Math.round(e.transactionIndex)),e.logIndex!==0&&(n.logIndex=Math.round(e.logIndex)),e.name!==""&&(n.name=e.name),e.labels){let t=Object.entries(e.labels);t.length>0&&(n.labels={},t.forEach(([a,i])=>{n.labels[a]=i}))}return n},create(e){return _.fromPartial(e??{})},fromPartial(e){let n=Rs();return n.address=e.address??"",n.contractName=e.contractName??"",n.blockNumber=e.blockNumber??BigInt("0"),n.transactionHash=e.transactionHash??"",n.chainId=e.chainId??"",n.transactionIndex=e.transactionIndex??0,n.logIndex=e.logIndex??0,n.name=e.name??"",n.labels=Object.entries(e.labels??{}).reduce((t,[a,i])=>(i!==void 0&&(t[a]=globalThis.String(i)),t),{}),n}};function Ps(){return{key:"",value:""}}var zi={encode(e,n=o.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Ps();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.key=t.string();continue;case 2:if(r!==18)break;i.value=t.string();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{key:u(e.key)?globalThis.String(e.key):"",value:u(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return zi.fromPartial(e??{})},fromPartial(e){let n=Ps();return n.key=e.key??"",n.value=e.value??"",n}};function _s(){return{bigDecimal:void 0,doubleValue:void 0,bigInteger:void 0}}var en={encode(e,n=o.default.Writer.create()){return e.bigDecimal!==void 0&&n.uint32(10).string(e.bigDecimal),e.doubleValue!==void 0&&n.uint32(17).double(e.doubleValue),e.bigInteger!==void 0&&K.encode(e.bigInteger,n.uint32(26).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=_s();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.bigDecimal=t.string();continue;case 2:if(r!==17)break;i.doubleValue=t.double();continue;case 3:if(r!==26)break;i.bigInteger=K.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{bigDecimal:u(e.bigDecimal)?globalThis.String(e.bigDecimal):void 0,doubleValue:u(e.doubleValue)?globalThis.Number(e.doubleValue):void 0,bigInteger:u(e.bigInteger)?K.fromJSON(e.bigInteger):void 0}},toJSON(e){let n={};return e.bigDecimal!==void 0&&(n.bigDecimal=e.bigDecimal),e.doubleValue!==void 0&&(n.doubleValue=e.doubleValue),e.bigInteger!==void 0&&(n.bigInteger=K.toJSON(e.bigInteger)),n},create(e){return en.fromPartial(e??{})},fromPartial(e){let n=_s();return n.bigDecimal=e.bigDecimal??void 0,n.doubleValue=e.doubleValue??void 0,n.bigInteger=e.bigInteger!==void 0&&e.bigInteger!==null?K.fromPartial(e.bigInteger):void 0,n}};function vs(){return{from:0}}var v={encode(e,n=o.default.Writer.create()){return e.from!==0&&n.uint32(8).int32(e.from),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=vs();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==8)break;i.from=t.int32();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{from:u(e.from)?Us(e.from):0}},toJSON(e){let n={};return e.from!==0&&(n.from=Vs(e.from)),n},create(e){return v.fromPartial(e??{})},fromPartial(e){let n=vs();return n.from=e.from??0,n}};function As(){return{metadata:void 0,metricValue:void 0,runtimeInfo:void 0}}var zr={encode(e,n=o.default.Writer.create()){return e.metadata!==void 0&&_.encode(e.metadata,n.uint32(10).fork()).ldelim(),e.metricValue!==void 0&&en.encode(e.metricValue,n.uint32(18).fork()).ldelim(),e.runtimeInfo!==void 0&&v.encode(e.runtimeInfo,n.uint32(26).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=As();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.metadata=_.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.metricValue=en.decode(t,t.uint32());continue;case 3:if(r!==26)break;i.runtimeInfo=v.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{metadata:u(e.metadata)?_.fromJSON(e.metadata):void 0,metricValue:u(e.metricValue)?en.fromJSON(e.metricValue):void 0,runtimeInfo:u(e.runtimeInfo)?v.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let n={};return e.metadata!==void 0&&(n.metadata=_.toJSON(e.metadata)),e.metricValue!==void 0&&(n.metricValue=en.toJSON(e.metricValue)),e.runtimeInfo!==void 0&&(n.runtimeInfo=v.toJSON(e.runtimeInfo)),n},create(e){return zr.fromPartial(e??{})},fromPartial(e){let n=As();return n.metadata=e.metadata!==void 0&&e.metadata!==null?_.fromPartial(e.metadata):void 0,n.metricValue=e.metricValue!==void 0&&e.metricValue!==null?en.fromPartial(e.metricValue):void 0,n.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?v.fromPartial(e.runtimeInfo):void 0,n}};function Bs(){return{metadata:void 0,metricValue:void 0,add:!1,runtimeInfo:void 0}}var Kr={encode(e,n=o.default.Writer.create()){return e.metadata!==void 0&&_.encode(e.metadata,n.uint32(10).fork()).ldelim(),e.metricValue!==void 0&&en.encode(e.metricValue,n.uint32(18).fork()).ldelim(),e.add!==!1&&n.uint32(24).bool(e.add),e.runtimeInfo!==void 0&&v.encode(e.runtimeInfo,n.uint32(34).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Bs();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.metadata=_.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.metricValue=en.decode(t,t.uint32());continue;case 3:if(r!==24)break;i.add=t.bool();continue;case 4:if(r!==34)break;i.runtimeInfo=v.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{metadata:u(e.metadata)?_.fromJSON(e.metadata):void 0,metricValue:u(e.metricValue)?en.fromJSON(e.metricValue):void 0,add:u(e.add)?globalThis.Boolean(e.add):!1,runtimeInfo:u(e.runtimeInfo)?v.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let n={};return e.metadata!==void 0&&(n.metadata=_.toJSON(e.metadata)),e.metricValue!==void 0&&(n.metricValue=en.toJSON(e.metricValue)),e.add!==!1&&(n.add=e.add),e.runtimeInfo!==void 0&&(n.runtimeInfo=v.toJSON(e.runtimeInfo)),n},create(e){return Kr.fromPartial(e??{})},fromPartial(e){let n=Bs();return n.metadata=e.metadata!==void 0&&e.metadata!==null?_.fromPartial(e.metadata):void 0,n.metricValue=e.metricValue!==void 0&&e.metricValue!==null?en.fromPartial(e.metricValue):void 0,n.add=e.add??!1,n.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?v.fromPartial(e.runtimeInfo):void 0,n}};function bs(){return{metadata:void 0,level:0,message:"",attributes:"",attributes2:void 0,runtimeInfo:void 0}}var Xr={encode(e,n=o.default.Writer.create()){return e.metadata!==void 0&&_.encode(e.metadata,n.uint32(10).fork()).ldelim(),e.level!==0&&n.uint32(16).int32(e.level),e.message!==""&&n.uint32(26).string(e.message),e.attributes!==""&&n.uint32(50).string(e.attributes),e.attributes2!==void 0&&f.encode(f.wrap(e.attributes2),n.uint32(58).fork()).ldelim(),e.runtimeInfo!==void 0&&v.encode(e.runtimeInfo,n.uint32(34).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=bs();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.metadata=_.decode(t,t.uint32());continue;case 2:if(r!==16)break;i.level=t.int32();continue;case 3:if(r!==26)break;i.message=t.string();continue;case 6:if(r!==50)break;i.attributes=t.string();continue;case 7:if(r!==58)break;i.attributes2=f.unwrap(f.decode(t,t.uint32()));continue;case 4:if(r!==34)break;i.runtimeInfo=v.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{metadata:u(e.metadata)?_.fromJSON(e.metadata):void 0,level:u(e.level)?Ls(e.level):0,message:u(e.message)?globalThis.String(e.message):"",attributes:u(e.attributes)?globalThis.String(e.attributes):"",attributes2:C(e.attributes2)?e.attributes2:void 0,runtimeInfo:u(e.runtimeInfo)?v.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let n={};return e.metadata!==void 0&&(n.metadata=_.toJSON(e.metadata)),e.level!==0&&(n.level=Fs(e.level)),e.message!==""&&(n.message=e.message),e.attributes!==""&&(n.attributes=e.attributes),e.attributes2!==void 0&&(n.attributes2=e.attributes2),e.runtimeInfo!==void 0&&(n.runtimeInfo=v.toJSON(e.runtimeInfo)),n},create(e){return Xr.fromPartial(e??{})},fromPartial(e){let n=bs();return n.metadata=e.metadata!==void 0&&e.metadata!==null?_.fromPartial(e.metadata):void 0,n.level=e.level??0,n.message=e.message??"",n.attributes=e.attributes??"",n.attributes2=e.attributes2??void 0,n.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?v.fromPartial(e.runtimeInfo):void 0,n}};function Ds(){return{metadata:void 0,distinctEntityId:"",attributes:void 0,severity:0,message:"",runtimeInfo:void 0,attributes2:void 0,noMetric:!1}}var Yr={encode(e,n=o.default.Writer.create()){return e.metadata!==void 0&&_.encode(e.metadata,n.uint32(10).fork()).ldelim(),e.distinctEntityId!==""&&n.uint32(18).string(e.distinctEntityId),e.attributes!==void 0&&f.encode(f.wrap(e.attributes),n.uint32(50).fork()).ldelim(),e.severity!==0&&n.uint32(56).int32(e.severity),e.message!==""&&n.uint32(66).string(e.message),e.runtimeInfo!==void 0&&v.encode(e.runtimeInfo,n.uint32(42).fork()).ldelim(),e.attributes2!==void 0&&R.encode(e.attributes2,n.uint32(74).fork()).ldelim(),e.noMetric!==!1&&n.uint32(24).bool(e.noMetric),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Ds();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.metadata=_.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.distinctEntityId=t.string();continue;case 6:if(r!==50)break;i.attributes=f.unwrap(f.decode(t,t.uint32()));continue;case 7:if(r!==56)break;i.severity=t.int32();continue;case 8:if(r!==66)break;i.message=t.string();continue;case 5:if(r!==42)break;i.runtimeInfo=v.decode(t,t.uint32());continue;case 9:if(r!==74)break;i.attributes2=R.decode(t,t.uint32());continue;case 3:if(r!==24)break;i.noMetric=t.bool();continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{metadata:u(e.metadata)?_.fromJSON(e.metadata):void 0,distinctEntityId:u(e.distinctEntityId)?globalThis.String(e.distinctEntityId):"",attributes:C(e.attributes)?e.attributes:void 0,severity:u(e.severity)?Ls(e.severity):0,message:u(e.message)?globalThis.String(e.message):"",runtimeInfo:u(e.runtimeInfo)?v.fromJSON(e.runtimeInfo):void 0,attributes2:u(e.attributes2)?R.fromJSON(e.attributes2):void 0,noMetric:u(e.noMetric)?globalThis.Boolean(e.noMetric):!1}},toJSON(e){let n={};return e.metadata!==void 0&&(n.metadata=_.toJSON(e.metadata)),e.distinctEntityId!==""&&(n.distinctEntityId=e.distinctEntityId),e.attributes!==void 0&&(n.attributes=e.attributes),e.severity!==0&&(n.severity=Fs(e.severity)),e.message!==""&&(n.message=e.message),e.runtimeInfo!==void 0&&(n.runtimeInfo=v.toJSON(e.runtimeInfo)),e.attributes2!==void 0&&(n.attributes2=R.toJSON(e.attributes2)),e.noMetric!==!1&&(n.noMetric=e.noMetric),n},create(e){return Yr.fromPartial(e??{})},fromPartial(e){let n=Ds();return n.metadata=e.metadata!==void 0&&e.metadata!==null?_.fromPartial(e.metadata):void 0,n.distinctEntityId=e.distinctEntityId??"",n.attributes=e.attributes??void 0,n.severity=e.severity??0,n.message=e.message??"",n.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?v.fromPartial(e.runtimeInfo):void 0,n.attributes2=e.attributes2!==void 0&&e.attributes2!==null?R.fromPartial(e.attributes2):void 0,n.noMetric=e.noMetric??!1,n}};function Js(){return{metadata:void 0,type:0,data:void 0,runtimeInfo:void 0}}var $r={encode(e,n=o.default.Writer.create()){return e.metadata!==void 0&&_.encode(e.metadata,n.uint32(10).fork()).ldelim(),e.type!==0&&n.uint32(16).int32(e.type),e.data!==void 0&&R.encode(e.data,n.uint32(26).fork()).ldelim(),e.runtimeInfo!==void 0&&v.encode(e.runtimeInfo,n.uint32(34).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=Js();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.metadata=_.decode(t,t.uint32());continue;case 2:if(r!==16)break;i.type=t.int32();continue;case 3:if(r!==26)break;i.data=R.decode(t,t.uint32());continue;case 4:if(r!==34)break;i.runtimeInfo=v.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{metadata:u(e.metadata)?_.fromJSON(e.metadata):void 0,type:u(e.type)?dc(e.type):0,data:u(e.data)?R.fromJSON(e.data):void 0,runtimeInfo:u(e.runtimeInfo)?v.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let n={};return e.metadata!==void 0&&(n.metadata=_.toJSON(e.metadata)),e.type!==0&&(n.type=lc(e.type)),e.data!==void 0&&(n.data=R.toJSON(e.data)),e.runtimeInfo!==void 0&&(n.runtimeInfo=v.toJSON(e.runtimeInfo)),n},create(e){return $r.fromPartial(e??{})},fromPartial(e){let n=Js();return n.metadata=e.metadata!==void 0&&e.metadata!==null?_.fromPartial(e.metadata):void 0,n.type=e.type??0,n.data=e.data!==void 0&&e.data!==null?R.fromPartial(e.data):void 0,n.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?v.fromPartial(e.runtimeInfo):void 0,n}};function xs(){return{metadata:void 0,payload:"",runtimeInfo:void 0}}var jr={encode(e,n=o.default.Writer.create()){return e.metadata!==void 0&&_.encode(e.metadata,n.uint32(10).fork()).ldelim(),e.payload!==""&&n.uint32(18).string(e.payload),e.runtimeInfo!==void 0&&v.encode(e.runtimeInfo,n.uint32(26).fork()).ldelim(),n},decode(e,n){let t=e instanceof o.default.Reader?e:o.default.Reader.create(e),a=n===void 0?t.len:t.pos+n,i=xs();for(;t.pos<a;){let r=t.uint32();switch(r>>>3){case 1:if(r!==10)break;i.metadata=_.decode(t,t.uint32());continue;case 2:if(r!==18)break;i.payload=t.string();continue;case 3:if(r!==26)break;i.runtimeInfo=v.decode(t,t.uint32());continue}if((r&7)===4||r===0)break;t.skipType(r&7)}return i},fromJSON(e){return{metadata:u(e.metadata)?_.fromJSON(e.metadata):void 0,payload:u(e.payload)?globalThis.String(e.payload):"",runtimeInfo:u(e.runtimeInfo)?v.fromJSON(e.runtimeInfo):void 0}},toJSON(e){let n={};return e.metadata!==void 0&&(n.metadata=_.toJSON(e.metadata)),e.payload!==""&&(n.payload=e.payload),e.runtimeInfo!==void 0&&(n.runtimeInfo=v.toJSON(e.runtimeInfo)),n},create(e){return jr.fromPartial(e??{})},fromPartial(e){let n=xs();return n.metadata=e.metadata!==void 0&&e.metadata!==null?_.fromPartial(e.metadata):void 0,n.payload=e.payload??"",n.runtimeInfo=e.runtimeInfo!==void 0&&e.runtimeInfo!==null?v.fromPartial(e.runtimeInfo):void 0,n}},Ip={name:"Processor",fullName:"processor.Processor",methods:{start:{name:"Start",requestType:Ws,requestStream:!1,responseType:ri,responseStream:!1,options:{}},stop:{name:"Stop",requestType:ri,requestStream:!1,responseType:ri,responseStream:!1,options:{}},getConfig:{name:"GetConfig",requestType:ws,requestStream:!1,responseType:Ms,responseStream:!1,options:{}},processBindings:{name:"ProcessBindings",requestType:Gs,requestStream:!1,responseType:qs,responseStream:!1,options:{}},processBindingsStream:{name:"ProcessBindingsStream",requestType:Hs,requestStream:!0,responseType:Qs,responseStream:!0,options:{}},preprocessBindingsStream:{name:"PreprocessBindingsStream",requestType:Zs,requestStream:!0,responseType:zs,responseStream:!0,options:{}}}};function oe(e){let n=BigInt(Math.trunc(e.getTime()/1e3)),t=e.getTime()%1e3*1e6;return{seconds:n,nanos:t}}function X(e){let n=(globalThis.Number(e.seconds.toString())||0)*1e3;return n+=(e.nanos||0)/1e6,new globalThis.Date(n)}function ue(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):X(T.fromJSON(e))}function G(e){return BigInt(e.toString())}o.default.util.Long!==H&&(o.default.util.Long=H,o.default.configure());function C(e){return typeof e=="object"&&e!==null}function u(e){return e!=null}import("node:process").then(e=>e.stdout.write(""));export{sc as a,fc as b,q as c,cc as d,nn as e,pc as f,ua as g,Ta as h,hn as i,Ei as j,Pi as k,Ka as l,Ya as m,eo as n,_e as o,N as p,Uf as q,Vf as r,Vi as s,od as t,ud as u,vt as v,Zr as w,je as x,Ip as y};
3
+ /*! Bundled license information:
4
+
5
+ long/index.js:
6
+ (**
7
+ * @license
8
+ * Copyright 2009 The Closure Library Authors
9
+ * Copyright 2020 Daniel Wirtz / The long.js Authors.
10
+ *
11
+ * Licensed under the Apache License, Version 2.0 (the "License");
12
+ * you may not use this file except in compliance with the License.
13
+ * You may obtain a copy of the License at
14
+ *
15
+ * http://www.apache.org/licenses/LICENSE-2.0
16
+ *
17
+ * Unless required by applicable law or agreed to in writing, software
18
+ * distributed under the License is distributed on an "AS IS" BASIS,
19
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
+ * See the License for the specific language governing permissions and
21
+ * limitations under the License.
22
+ *
23
+ * SPDX-License-Identifier: Apache-2.0
24
+ *)
25
+ */
26
+ //# sourceMappingURL=chunk-VUN3TGG5.js.map