koilib 5.0.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -11
- package/dist/koinos.js +71 -49
- package/dist/koinos.min.js +1 -1
- package/lib/Contract.js +34 -30
- package/lib/Contract.js.map +1 -1
- package/lib/Provider.d.ts +4 -1
- package/lib/Provider.js +19 -8
- package/lib/Provider.js.map +1 -1
- package/lib/Signer.d.ts +14 -11
- package/lib/Signer.js +18 -11
- package/lib/Signer.js.map +1 -1
- package/lib/browser/Contract.js +34 -30
- package/lib/browser/Contract.js.map +1 -1
- package/lib/browser/Provider.d.ts +4 -1
- package/lib/browser/Provider.js +19 -8
- package/lib/browser/Provider.js.map +1 -1
- package/lib/browser/Signer.d.ts +14 -11
- package/lib/browser/Signer.js +18 -11
- package/lib/browser/Signer.js.map +1 -1
- package/lib/browser/interface.d.ts +56 -1
- package/lib/interface.d.ts +56 -1
- package/package.json +1 -1
package/dist/koinos.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see koinos.min.js.LICENSE.txt */
|
|
2
|
-
(()=>{var __webpack_modules__={8820:e=>{"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var o=e.charAt(n),i=o.charCodeAt(0);if(255!==t[i])throw new TypeError(o+" is ambiguous");t[i]=n}var s=e.length,a=e.charAt(0),c=Math.log(s)/Math.log(256),l=Math.log(256)/Math.log(s);function u(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var r=0;if(" "!==e[r]){for(var n=0,o=0;e[r]===a;)n++,r++;for(var i=(e.length-r)*c+1>>>0,l=new Uint8Array(i);e[r];){var u=t[e.charCodeAt(r)];if(255===u)return;for(var p=0,d=i-1;(0!==u||p<o)&&-1!==d;d--,p++)u+=s*l[d]>>>0,l[d]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");o=p,r++}if(" "!==e[r]){for(var f=i-o;f!==i&&0===l[f];)f++;for(var h=new Uint8Array(n+(i-f)),y=n;f!==i;)h[y++]=l[f++];return h}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,o=0,i=t.length;o!==i&&0===t[o];)o++,r++;for(var c=(i-o)*l+1>>>0,u=new Uint8Array(c);o!==i;){for(var p=t[o],d=0,f=c-1;(0!==p||d<n)&&-1!==f;f--,d++)p+=256*u[f]>>>0,u[f]=p%s>>>0,p=p/s>>>0;if(0!==p)throw new Error("Non-zero carry");n=d,o++}for(var h=c-n;h!==c&&0===u[h];)h++;for(var y=a.repeat(r);h<c;++h)y+=e.charAt(u[h]);return y},decodeUnsafe:u,decode:function(e){var t=u(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}},7320:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function o(e,...t){if(!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function i(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function a(e,t){o(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=r,t.bool=n,t.bytes=o,t.hash=i,t.exists=s,t.output=a;const c={number:r,bool:n,bytes:o,hash:i,exists:s,output:a};t.default=c},7505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const n=r(7320),o=r(8089);class i extends o.Hash{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,o.createView)(this.buffer)}update(e){n.default.exists(this);const{view:t,buffer:r,blockLen:i}=this,s=(e=(0,o.toBytes)(e)).length;for(let n=0;n<s;){const a=Math.min(i-this.pos,s-n);if(a!==i)r.set(e.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===i&&(this.process(t,0),this.pos=0);else{const t=(0,o.createView)(e);for(;i<=s-n;n+=i)this.process(t,n)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){n.default.exists(this),n.default.output(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:i,isLE:s}=this;let{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>i-a&&(this.process(r,0),a=0);for(let e=a;e<i;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const o=BigInt(32),i=BigInt(4294967295),s=Number(r>>o&i),a=Number(r&i),c=n?4:0,l=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+l,a,n)}(r,i-8,BigInt(8*this.length),s),this.process(r,0);const c=(0,o.createView)(e);this.get().forEach(((e,t)=>c.setUint32(4*t,e,s)))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:o,destroyed:i,pos:s}=this;return e.length=n,e.pos=s,e.finished=o,e.destroyed=i,n%t&&e.buffer.set(r),e}}t.SHA2=i},4421:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto={node:void 0,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0}},830:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=t.RIPEMD160=void 0;const n=r(7505),o=r(8089),i=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),s=Uint8Array.from({length:16},((e,t)=>t)),a=s.map((e=>(9*e+5)%16));let c=[s],l=[a];for(let e=0;e<4;e++)for(let t of[c,l])t.push(t[e].map((e=>i[e])));const u=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map((e=>new Uint8Array(e))),p=c.map(((e,t)=>e.map((e=>u[t][e])))),d=l.map(((e,t)=>e.map((e=>u[t][e])))),f=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),h=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),y=(e,t)=>e<<t|e>>>32-t;function _(e,t,r,n){return 0===e?t^r^n:1===e?t&r|~t&n:2===e?(t|~r)^n:3===e?t&n|r&~n:t^(r|~n)}const g=new Uint32Array(16);class b extends n.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:r,h3:n,h4:o}=this;return[e,t,r,n,o]}set(e,t,r,n,o){this.h0=0|e,this.h1=0|t,this.h2=0|r,this.h3=0|n,this.h4=0|o}process(e,t){for(let r=0;r<16;r++,t+=4)g[r]=e.getUint32(t,!0);let r=0|this.h0,n=r,o=0|this.h1,i=o,s=0|this.h2,a=s,u=0|this.h3,b=u,m=0|this.h4,v=m;for(let e=0;e<5;e++){const t=4-e,w=f[e],k=h[e],O=c[e],x=l[e],S=p[e],j=d[e];for(let t=0;t<16;t++){const n=y(r+_(e,o,s,u)+g[O[t]]+w,S[t])+m|0;r=m,m=u,u=0|y(s,10),s=o,o=n}for(let e=0;e<16;e++){const r=y(n+_(t,i,a,b)+g[x[e]]+k,j[e])+v|0;n=v,v=b,b=0|y(a,10),a=i,i=r}}this.set(this.h1+s+b|0,this.h2+u+v|0,this.h3+m+n|0,this.h4+r+i|0,this.h0+o+a|0)}roundClean(){g.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}t.RIPEMD160=b,t.ripemd160=(0,o.wrapConstructor)((()=>new b))},3061:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=void 0;const n=r(7505),o=r(8089),i=(e,t,r)=>e&t^e&r^t&r,s=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint32Array(64);class l extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[7]}get(){const{A:e,B:t,C:r,D:n,E:o,F:i,G:s,H:a}=this;return[e,t,r,n,o,i,s,a]}set(e,t,r,n,o,i,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|o,this.F=0|i,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)c[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=c[e-15],r=c[e-2],n=(0,o.rotr)(t,7)^(0,o.rotr)(t,18)^t>>>3,i=(0,o.rotr)(r,17)^(0,o.rotr)(r,19)^r>>>10;c[e]=i+c[e-7]+n+c[e-16]|0}let{A:r,B:n,C:a,D:l,E:u,F:p,G:d,H:f}=this;for(let e=0;e<64;e++){const t=f+((0,o.rotr)(u,6)^(0,o.rotr)(u,11)^(0,o.rotr)(u,25))+((h=u)&p^~h&d)+s[e]+c[e]|0,y=((0,o.rotr)(r,2)^(0,o.rotr)(r,13)^(0,o.rotr)(r,22))+i(r,n,a)|0;f=d,d=p,p=u,u=l+t|0,l=a,a=n,n=r,r=t+y|0}var h;r=r+this.A|0,n=n+this.B|0,a=a+this.C|0,l=l+this.D|0,u=u+this.E|0,p=p+this.F|0,d=d+this.G|0,f=f+this.H|0,this.set(r,n,a,l,u,p,d,f)}roundClean(){c.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}t.sha256=(0,o.wrapConstructor)((()=>new l))},8089:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const n=r(4421);if(t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const o=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function i(e){if("string"!=typeof e)throw new TypeError("utf8ToBytes expected string, got "+typeof e);return(new TextEncoder).encode(e)}function s(e){if("string"==typeof e&&(e=i(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}t.bytesToHex=function(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=o[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,o=e.slice(n,n+2),i=Number.parseInt(o,16);if(Number.isNaN(i)||i<0)throw new Error("Invalid byte sequence");t[r]=i}return t},t.nextTick=async()=>{},t.asyncLoop=async function(e,r,n){let o=Date.now();for(let i=0;i<e;i++){n(i);const e=Date.now()-o;e>=0&&e<r||(await(0,t.nextTick)(),o+=e)}},t.utf8ToBytes=i,t.toBytes=s,t.concatBytes=function(...e){if(!e.every((e=>e instanceof Uint8Array)))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const o=e[t];r.set(o,n),n+=o.length}return r},t.Hash=class{clone(){return this._cloneInto()}},t.checkOpts=function(e,t){if(void 0!==t&&("object"!=typeof t||(r=t,"[object Object]"!==Object.prototype.toString.call(r)||r.constructor!==Object)))throw new TypeError("Options should be object or undefined");var r;return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(s(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(s(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto.web)return n.crypto.web.getRandomValues(new Uint8Array(e));if(n.crypto.node)return new Uint8Array(n.crypto.node.randomBytes(e).buffer);throw new Error("The environment doesn't have randomBytes function")}},9656:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.schnorr=t.verify=t.signSync=t.sign=t.getSharedSecret=t.recoverPublicKey=t.getPublicKey=t.Signature=t.Point=t.CURVE=void 0;const n=r(9159),o=BigInt(0),i=BigInt(1),s=BigInt(2),a=BigInt(3),c=BigInt(8),l=s**BigInt(256),u={a:o,b:BigInt(7),P:l-s**BigInt(32)-BigInt(977),n:l-BigInt("432420386565659656852420866394968145599"),h:i,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")};function p(e){const{a:t,b:r}=u,n=T(e*e),o=T(n*e);return T(o+t*e+r)}t.CURVE=u;const d=u.a===o;class f{constructor(e,t,r){this.x=e,this.y=t,this.z=r}static fromAffine(e){if(!(e instanceof y))throw new TypeError("JacobianPoint#fromAffine: expected Point");return new f(e.x,e.y,i)}static toAffineBatch(e){const t=function(e,t=u.P){const r=new Array(e.length),n=I(e.reduce(((e,n,i)=>n===o?e:(r[i]=e,T(e*n,t))),i),t);return e.reduceRight(((e,n,i)=>n===o?e:(r[i]=T(e*r[i],t),T(e*n,t))),n),r}(e.map((e=>e.z)));return e.map(((e,r)=>e.toAffine(t[r])))}static normalizeZ(e){return f.toAffineBatch(e).map(f.fromAffine)}equals(e){if(!(e instanceof f))throw new TypeError("JacobianPoint expected");const{x:t,y:r,z:n}=this,{x:o,y:i,z:a}=e,c=T(n**s),l=T(a**s),u=T(t*l),p=T(o*c),d=T(T(r*a)*l),h=T(T(i*n)*c);return u===p&&d===h}negate(){return new f(this.x,T(-this.y),this.z)}double(){const{x:e,y:t,z:r}=this,n=T(e**s),o=T(t**s),i=T(o**s),l=T(s*(T((e+o)**s)-n-i)),u=T(a*n),p=T(u**s),d=T(p-s*l),h=T(u*(l-d)-c*i),y=T(s*t*r);return new f(d,h,y)}add(e){if(!(e instanceof f))throw new TypeError("JacobianPoint expected");const{x:t,y:r,z:n}=this,{x:i,y:a,z:c}=e;if(i===o||a===o)return this;if(t===o||r===o)return e;const l=T(n**s),u=T(c**s),p=T(t*u),d=T(i*l),h=T(T(r*c)*u),y=T(T(a*n)*l),_=T(d-p),g=T(y-h);if(_===o)return g===o?this.double():f.ZERO;const b=T(_**s),m=T(_*b),v=T(p*b),w=T(g**s-m-s*v),k=T(g*(v-w)-h*m),O=T(n*c*_);return new f(w,k,O)}subtract(e){return this.add(e.negate())}multiplyUnsafe(e){const t=f.ZERO;if("bigint"==typeof e&&e===o)return t;let r=P(e);if(r===i)return this;if(!d){let e=t,n=this;for(;r>o;)r&i&&(e=e.add(n)),n=n.double(),r>>=i;return e}let{k1neg:n,k1:s,k2neg:a,k2:c}=U(r),l=t,p=t,h=this;for(;s>o||c>o;)s&i&&(l=l.add(h)),c&i&&(p=p.add(h)),h=h.double(),s>>=i,c>>=i;return n&&(l=l.negate()),a&&(p=p.negate()),p=new f(T(p.x*u.beta),p.y,p.z),l.add(p)}precomputeWindow(e){const t=d?128/e+1:256/e+1,r=[];let n=this,o=n;for(let i=0;i<t;i++){o=n,r.push(o);for(let t=1;t<2**(e-1);t++)o=o.add(n),r.push(o);n=o.double()}return r}wNAF(e,t){!t&&this.equals(f.BASE)&&(t=y.BASE);const r=t&&t._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=t&&h.get(t);n||(n=this.precomputeWindow(r),t&&1!==r&&(n=f.normalizeZ(n),h.set(t,n)));let o=f.ZERO,s=f.ZERO;const a=1+(d?128/r:256/r),c=2**(r-1),l=BigInt(2**r-1),u=2**r,p=BigInt(r);for(let t=0;t<a;t++){const r=t*c;let a=Number(e&l);if(e>>=p,a>c&&(a-=u,e+=i),0===a){let e=n[r];t%2&&(e=e.negate()),s=s.add(e)}else{let e=n[r+Math.abs(a)-1];a<0&&(e=e.negate()),o=o.add(e)}}return{p:o,f:s}}multiply(e,t){let r,n,o=P(e);if(d){const{k1neg:e,k1:i,k2neg:s,k2:a}=U(o);let{p:c,f:l}=this.wNAF(i,t),{p,f:d}=this.wNAF(a,t);e&&(c=c.negate()),s&&(p=p.negate()),p=new f(T(p.x*u.beta),p.y,p.z),r=c.add(p),n=l.add(d)}else{const{p:e,f:i}=this.wNAF(o,t);r=e,n=i}return f.normalizeZ([r,n])[0]}toAffine(e=I(this.z)){const{x:t,y:r,z:n}=this,o=e,s=T(o*o),a=T(s*o),c=T(t*s),l=T(r*a);if(T(n*o)!==i)throw new Error("invZ was invalid");return new y(c,l)}}f.BASE=new f(u.Gx,u.Gy,i),f.ZERO=new f(o,i,o);const h=new WeakMap;class y{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,h.delete(this)}static fromCompressedHex(e){const t=32===e.length,r=E(t?e:e.subarray(1));if(!J(r))throw new Error("Point is not on curve");let n=function(e){const{P:t}=u,r=BigInt(6),n=BigInt(11),o=BigInt(22),i=BigInt(23),c=BigInt(44),l=BigInt(88),p=e*e*e%t,d=p*p*e%t,f=N(d,a)*d%t,h=N(f,a)*d%t,y=N(h,s)*p%t,_=N(y,n)*y%t,g=N(_,o)*_%t,b=N(g,c)*g%t,m=N(b,l)*b%t,v=N(m,c)*g%t,w=N(v,a)*d%t,k=N(w,i)*_%t,O=N(k,r)*p%t;return N(O,s)}(p(r));const o=(n&i)===i;t?o&&(n=T(-n)):1==(1&e[0])!==o&&(n=T(-n));const c=new y(r,n);return c.assertValidity(),c}static fromUncompressedHex(e){const t=E(e.subarray(1,33)),r=E(e.subarray(33,65)),n=new y(t,r);return n.assertValidity(),n}static fromHex(e){const t=B(e),r=t.length,n=t[0];if(32===r||33===r&&(2===n||3===n))return this.fromCompressedHex(t);if(65===r&&4===n)return this.fromUncompressedHex(t);throw new Error(`Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ${r}`)}static fromPrivateKey(e){return y.BASE.multiply($(e))}static fromSignature(e,t,r){const n=R(e=B(e)),{r:o,s:i}=F(t);if(0!==r&&1!==r)throw new Error("Cannot recover signature: invalid recovery bit");const s=1&r?"03":"02",a=y.fromHex(s+O(o)),{n:c}=u,l=I(o,c),p=T(-n*l,c),d=T(i*l,c),f=y.BASE.multiplyAndAddUnsafe(a,p,d);if(!f)throw new Error("Cannot recover signature: point at infinify");return f.assertValidity(),f}toRawBytes(e=!1){return A(this.toHex(e))}toHex(e=!1){const t=O(this.x);return e?`${this.y&i?"03":"02"}${t}`:`04${t}${O(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const e="Point is not on elliptic curve",{x:t,y:r}=this;if(!J(t)||!J(r))throw new Error(e);const n=T(r*r);if(T(n-p(t))!==o)throw new Error(e)}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new y(this.x,T(-this.y))}double(){return f.fromAffine(this).double().toAffine()}add(e){return f.fromAffine(this).add(f.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return f.fromAffine(this).multiply(e,this).toAffine()}multiplyAndAddUnsafe(e,t,r){const n=f.fromAffine(this),s=t===o||t===i||this!==y.BASE?n.multiplyUnsafe(t):n.multiply(t),a=f.fromAffine(e).multiplyUnsafe(r),c=s.add(a);return c.equals(f.ZERO)?void 0:c.toAffine()}}function _(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}function g(e){if(e.length<2||2!==e[0])throw new Error(`Invalid signature integer tag: ${k(e)}`);const t=e[1],r=e.subarray(2,t+2);if(!t||r.length!==t)throw new Error("Invalid signature integer: wrong length");if(0===r[0]&&r[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:E(r),left:e.subarray(t+2)}}t.Point=y,y.BASE=new y(u.Gx,u.Gy),y.ZERO=new y(o,o);class b{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromCompact(e){const t=v(e),r="Signature.fromCompact";if("string"!=typeof e&&!t)throw new TypeError(`${r}: Expected string or Uint8Array`);const n=t?k(e):e;if(128!==n.length)throw new Error(`${r}: Expected 64-byte hex`);return new b(j(n.slice(0,64)),j(n.slice(64,128)))}static fromDER(e){const t=v(e);if("string"!=typeof e&&!t)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r,s:n}=function(e){if(e.length<2||48!=e[0])throw new Error(`Invalid signature tag: ${k(e)}`);if(e[1]!==e.length-2)throw new Error("Invalid signature: incorrect length");const{data:t,left:r}=g(e.subarray(2)),{data:n,left:o}=g(r);if(o.length)throw new Error(`Invalid signature: left bytes after parsing: ${k(o)}`);return{r:t,s:n}}(t?e:A(e));return new b(r,n)}static fromHex(e){return this.fromDER(e)}assertValidity(){const{r:e,s:t}=this;if(!C(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!C(t))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const e=u.n>>i;return this.s>e}normalizeS(){return this.hasHighS()?new b(this.r,u.n-this.s):this}toDERRawBytes(e=!1){return A(this.toDERHex(e))}toDERHex(e=!1){const t=_(S(this.s));if(e)return t;const r=_(S(this.r)),n=S(r.length/2),o=S(t.length/2);return`30${S(r.length/2+t.length/2+4)}02${n}${r}02${o}${t}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return A(this.toCompactHex())}toCompactHex(){return O(this.r)+O(this.s)}}function m(...e){if(!e.every(v))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const o=e[t];r.set(o,n),n+=o.length}return r}function v(e){return e instanceof Uint8Array}t.Signature=b;const w=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function k(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");let t="";for(let r=0;r<e.length;r++)t+=w[e[r]];return t}function O(e){if(e>l)throw new Error("Expected number < 2^256");return e.toString(16).padStart(64,"0")}function x(e){return A(O(e))}function S(e){const t=e.toString(16);return 1&t.length?`0${t}`:t}function j(e){if("string"!=typeof e)throw new TypeError("hexToNumber: expected string, got "+typeof e);return BigInt(`0x${e}`)}function A(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+e.length);const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,o=e.slice(n,n+2),i=Number.parseInt(o,16);if(Number.isNaN(i)||i<0)throw new Error("Invalid byte sequence");t[r]=i}return t}function E(e){return j(k(e))}function B(e){return e instanceof Uint8Array?Uint8Array.from(e):A(e)}function P(e){if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)return BigInt(e);if("bigint"==typeof e&&C(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function T(e,t=u.P){const r=e%t;return r>=o?r:t+r}function N(e,t){const{P:r}=u;let n=e;for(;t-- >o;)n*=n,n%=r;return n}function I(e,t=u.P){if(e===o||t<=o)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=T(e,t),n=t,s=o,a=i,c=i,l=o;for(;r!==o;){const e=n/r,t=n%r,o=s-c*e,i=a-l*e;n=r,r=t,s=c,a=l,c=o,l=i}if(n!==i)throw new Error("invert: does not exist");return T(s,t)}const L=(e,t)=>(e+t/s)/t,D=s**BigInt(128);function U(e){const{n:t}=u,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-i*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,a=L(s*e,t),c=L(-n*e,t);let l=T(e-a*r-c*o,t),p=T(-a*n-c*s,t);const d=l>D,f=p>D;if(d&&(l=t-l),f&&(p=t-p),l>D||p>D)throw new Error("splitScalarEndo: Endomorphism failed, k="+e);return{k1neg:d,k1:l,k2neg:f,k2:p}}function R(e){const{n:t}=u,r=8*e.length-256;let n=E(e);return r>0&&(n>>=BigInt(r)),n>=t&&(n-=t),n}class z{constructor(){this.v=new Uint8Array(32).fill(1),this.k=new Uint8Array(32).fill(0),this.counter=0}hmac(...e){return t.utils.hmacSha256(this.k,...e)}hmacSync(...e){if("function"!=typeof t.utils.hmacSha256Sync)throw new Error("utils.hmacSha256Sync is undefined, you need to set it");const r=t.utils.hmacSha256Sync(this.k,...e);if(r instanceof Promise)throw new Error("To use sync sign(), ensure utils.hmacSha256 is sync");return r}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(e=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),e),this.v=await this.hmac(this.v),0!==e.length&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),e),this.v=await this.hmac(this.v))}reseedSync(e=new Uint8Array){this.k=this.hmacSync(this.v,Uint8Array.from([0]),e),this.v=this.hmacSync(this.v),0!==e.length&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),e),this.v=this.hmacSync(this.v))}async generate(){return this.incr(),this.v=await this.hmac(this.v),this.v}generateSync(){return this.incr(),this.v=this.hmacSync(this.v),this.v}}function C(e){return o<e&&e<u.n}function J(e){return o<e&&e<u.P}function H(e,t,r){const n=E(e);if(!C(n))return;const{n:s}=u,a=y.BASE.multiply(n),c=T(a.x,s);if(c===o)return;const l=T(I(n,s)*T(t+r*c,s),s);if(l===o)return;const p=new b(c,l);return{sig:p,recovery:(a.x===p.r?0:2)|Number(a.y&i)}}function $(e){let t;if("bigint"==typeof e)t=e;else if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)t=BigInt(e);else if("string"==typeof e){if(64!==e.length)throw new Error("Expected 32 bytes of private key");t=j(e)}else{if(!v(e))throw new TypeError("Expected valid private key");if(32!==e.length)throw new Error("Expected 32 bytes of private key");t=E(e)}if(!C(t))throw new Error("Expected private key: 0 < key < n");return t}function M(e){return e instanceof y?(e.assertValidity(),e):y.fromHex(e)}function F(e){if(e instanceof b)return e.assertValidity(),e;try{return b.fromDER(e)}catch(t){return b.fromCompact(e)}}function q(e){const t=v(e),r="string"==typeof e,n=(t||r)&&e.length;return t?33===n||65===n:r?66===n||130===n:e instanceof y}function V(e){return E(e.length>32?e.slice(0,32):e)}function K(e){const t=V(e),r=T(t,u.n);return G(r<o?t:r)}function G(e){if("bigint"!=typeof e)throw new Error("Expected bigint");return A(O(e))}function W(e,r,n){if(null==e)throw new Error(`sign: expected valid message hash, not "${e}"`);const o=B(e),i=$(r),s=[G(i),K(o)];if(null!=n){!0===n&&(n=t.utils.randomBytes(32));const e=B(n);if(32!==e.length)throw new Error("sign: Expected 32 bytes of extra data");s.push(e)}return{seed:m(...s),m:V(o),d:i}}function Z(e,t){let{sig:r,recovery:n}=e;const{canonical:o,der:i,recovered:s}=Object.assign({canonical:!0,der:!0},t);o&&r.hasHighS()&&(r=r.normalizeS(),n^=1);const a=i?r.toDERRawBytes():r.toCompactRawBytes();return s?[a,n]:a}t.getPublicKey=function(e,t=!1){return y.fromPrivateKey(e).toRawBytes(t)},t.recoverPublicKey=function(e,t,r,n=!1){return y.fromSignature(e,t,r).toRawBytes(n)},t.getSharedSecret=function(e,t,r=!1){if(q(e))throw new TypeError("getSharedSecret: first arg must be private key");if(!q(t))throw new TypeError("getSharedSecret: second arg must be public key");const n=M(t);return n.assertValidity(),n.multiply($(e)).toRawBytes(r)},t.sign=async function(e,t,r={}){const{seed:n,m:o,d:i}=W(e,t,r.extraEntropy);let s;const a=new z;for(await a.reseed(n);!(s=H(await a.generate(),o,i));)await a.reseed();return Z(s,r)},t.signSync=function(e,t,r={}){const{seed:n,m:o,d:i}=W(e,t,r.extraEntropy);let s;const a=new z;for(a.reseedSync(n);!(s=H(a.generateSync(),o,i));)a.reseedSync();return Z(s,r)};const X={strict:!0};function Q(e){return T(E(e),u.n)}function Y(e){return(e.y&i)===o}t.verify=function(e,t,r,n=X){let o;try{o=F(e),t=B(t)}catch(e){return!1}const{r:i,s}=o;if(n.strict&&o.hasHighS())return!1;const a=R(t);let c;try{c=M(r)}catch(e){return!1}const{n:l}=u,p=I(s,l),d=T(a*p,l),f=T(i*p,l),h=y.BASE.multiplyAndAddUnsafe(c,d,f);return!!h&&T(h.x,l)===i};class ee{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromHex(e){const t=B(e);if(64!==t.length)throw new TypeError(`SchnorrSignature.fromHex: expected 64 bytes, not ${t.length}`);const r=E(t.subarray(0,32)),n=E(t.subarray(32,64));return new ee(r,n)}assertValidity(){const{r:e,s:t}=this;if(!J(e)||!C(t))throw new Error("Invalid signature")}toHex(){return O(this.r)+O(this.s)}toRawBytes(){return A(this.toHex())}}function te(e,t,r){if(null==e)throw new TypeError(`sign: Expected valid message, not "${e}"`);const n=B(e),o=$(t),i=B(r);if(32!==i.length)throw new TypeError("sign: Expected 32 bytes of aux randomness");const s=y.fromPrivateKey(o),a=s.toRawX();return{m:n,P:s,px:a,d:Y(s)?o:u.n-o,rand:i}}function re(e,t){return x(e^E(t))}function ne(e){const t=T(E(e),u.n);if(t===o)throw new Error("sign: Creation of signature failed. k is zero");const r=y.fromPrivateKey(t),n=r.toRawX();return{R:r,rx:n,k:Y(r)?t:u.n-t}}function oe(e,t,r,n){return new ee(e.x,T(t+r*n,u.n)).toRawBytes()}function ie(e,t,r){const n=e instanceof ee,o=n?e:ee.fromHex(e);return n&&o.assertValidity(),{...o,m:B(t),P:M(r)}}function se(e,t,r,n){const o=y.BASE.multiplyAndAddUnsafe(t,$(r),T(-n,u.n));return!(!o||!Y(o)||o.x!==e)}async function ae(e,r,n){try{const{r:o,s:i,m:s,P:a}=ie(e,r,n),c=Q(await t.utils.taggedHash(ue.challenge,x(o),a.toRawX(),s));return se(o,a,i,c)}catch(e){return!1}}function ce(e,r,n){try{const{r:o,s:i,m:s,P:a}=ie(e,r,n),c=Q(t.utils.taggedHashSync(ue.challenge,x(o),a.toRawX(),s));return se(o,a,i,c)}catch(e){return!1}}t.schnorr={Signature:ee,getPublicKey:function(e){return y.fromPrivateKey(e).toRawX()},sign:async function(e,r,n=t.utils.randomBytes()){const{m:o,px:i,d:s,rand:a}=te(e,r,n),c=re(s,await t.utils.taggedHash(ue.aux,a)),{R:l,rx:u,k:p}=ne(await t.utils.taggedHash(ue.nonce,c,i,o)),d=oe(l,p,Q(await t.utils.taggedHash(ue.challenge,u,i,o)),s);if(!await ae(d,o,i))throw new Error("sign: Invalid signature produced");return d},verify:ae,signSync:function(e,r,n=t.utils.randomBytes()){const{m:o,px:i,d:s,rand:a}=te(e,r,n),c=re(s,t.utils.taggedHashSync(ue.aux,a)),{R:l,rx:u,k:p}=ne(t.utils.taggedHashSync(ue.nonce,c,i,o)),d=oe(l,p,Q(t.utils.taggedHashSync(ue.challenge,u,i,o)),s);if(!ce(d,o,i))throw new Error("sign: Invalid signature produced");return d},verifySync:ce},y.BASE._setWindowSize(8);const le={node:n,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0},ue={challenge:"BIP0340/challenge",aux:"BIP0340/aux",nonce:"BIP0340/nonce"},pe={};t.utils={isValidPrivateKey(e){try{return $(e),!0}catch(e){return!1}},privateAdd:(e,t)=>x(T($(e)+$(t),u.n)),privateNegate:e=>{const t=$(e);return x(u.n-t)},pointAddScalar:(e,t,r)=>{const n=y.fromHex(e),o=$(t),s=y.BASE.multiplyAndAddUnsafe(n,o,i);if(!s)throw new Error("Tweaked point at infinity");return s.toRawBytes(r)},pointMultiply:(e,t,r)=>{const n=y.fromHex(e),o=E(B(t));return n.multiply(o).toRawBytes(r)},hashToPrivateKey:e=>{if((e=B(e)).length<40||e.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return x(T(E(e),u.n-i)+i)},randomBytes:(e=32)=>{if(le.web)return le.web.getRandomValues(new Uint8Array(e));if(le.node){const{randomBytes:t}=le.node;return Uint8Array.from(t(e))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>t.utils.hashToPrivateKey(t.utils.randomBytes(40)),bytesToHex:k,hexToBytes:A,concatBytes:m,mod:T,invert:I,sha256:async(...e)=>{if(le.web){const t=await le.web.subtle.digest("SHA-256",m(...e));return new Uint8Array(t)}if(le.node){const{createHash:t}=le.node,r=t("sha256");return e.forEach((e=>r.update(e))),Uint8Array.from(r.digest())}throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(e,...t)=>{if(le.web){const r=await le.web.subtle.importKey("raw",e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),n=m(...t),o=await le.web.subtle.sign("HMAC",r,n);return new Uint8Array(o)}if(le.node){const{createHmac:r}=le.node,n=r("sha256",e);return t.forEach((e=>n.update(e))),Uint8Array.from(n.digest())}throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(e,...r)=>{let n=pe[e];if(void 0===n){const r=await t.utils.sha256(Uint8Array.from(e,(e=>e.charCodeAt(0))));n=m(r,r),pe[e]=n}return t.utils.sha256(n,...r)},taggedHashSync:(e,...r)=>{if("function"!=typeof t.utils.sha256Sync)throw new Error("utils.sha256Sync is undefined, you need to set it");let n=pe[e];if(void 0===n){const r=t.utils.sha256Sync(Uint8Array.from(e,(e=>e.charCodeAt(0))));n=m(r,r),pe[e]=n}return t.utils.sha256Sync(n,...r)},precompute(e=8,t=y.BASE){const r=t===y.BASE?t:new y(t.x,t.y);return r._setWindowSize(e),r.multiply(a),r}}},4537:e=>{"use strict";e.exports=function(e,t){for(var r=new Array(arguments.length-1),n=0,o=2,i=!0;o<arguments.length;)r[n++]=arguments[o++];return new Promise((function(o,s){r[n]=function(e){if(i)if(i=!1,e)s(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];o.apply(null,t)}};try{e.apply(t||null,r)}catch(e){i&&(i=!1,s(e))}}))}},7419:(e,t)=>{"use strict";var r=t;r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var n=new Array(64),o=new Array(123),i=0;i<64;)o[n[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;r.encode=function(e,t,r){for(var o,i=null,s=[],a=0,c=0;t<r;){var l=e[t++];switch(c){case 0:s[a++]=n[l>>2],o=(3&l)<<4,c=1;break;case 1:s[a++]=n[o|l>>4],o=(15&l)<<2,c=2;break;case 2:s[a++]=n[o|l>>6],s[a++]=n[63&l],c=0}a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),a=0)}return c&&(s[a++]=n[o],s[a++]=61,1===c&&(s[a++]=61)),i?(a&&i.push(String.fromCharCode.apply(String,s.slice(0,a))),i.join("")):String.fromCharCode.apply(String,s.slice(0,a))};var s="invalid encoding";r.decode=function(e,t,r){for(var n,i=r,a=0,c=0;c<e.length;){var l=e.charCodeAt(c++);if(61===l&&a>1)break;if(void 0===(l=o[l]))throw Error(s);switch(a){case 0:n=l,a=1;break;case 1:t[r++]=n<<2|(48&l)>>4,n=l,a=2;break;case 2:t[r++]=(15&n)<<4|(60&l)>>2,n=l,a=3;break;case 3:t[r++]=(3&n)<<6|l,a=0}}if(1===a)throw Error(s);return r-i},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},5124:e=>{"use strict";function t(e,r){"string"==typeof e&&(r=e,e=void 0);var n=[];function o(e){if("string"!=typeof e){var r=i();if(t.verbose&&console.log("codegen: "+r),r="return "+r,e){for(var s=Object.keys(e),a=new Array(s.length+1),c=new Array(s.length),l=0;l<s.length;)a[l]=s[l],c[l]=e[s[l++]];return a[l]=r,Function.apply(null,a).apply(null,c)}return Function(r)()}for(var u=new Array(arguments.length-1),p=0;p<u.length;)u[p]=arguments[++p];if(p=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var r=u[p++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"})),p!==u.length)throw Error("parameter count mismatch");return n.push(e),o}function i(t){return"function "+(t||r||"")+"("+(e&&e.join(",")||"")+"){\n "+n.join("\n ")+"\n}"}return o.toString=i,o}e.exports=t,t.verbose=!1},9211:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this}},9054:(e,t,r)=>{"use strict";e.exports=i;var n=r(4537),o=r(7199)("fs");function i(e,t,r){return"function"==typeof t?(r=t,t={}):t||(t={}),r?!t.xhr&&o&&o.readFile?o.readFile(e,(function(n,o){return n&&"undefined"!=typeof XMLHttpRequest?i.xhr(e,t,r):n?r(n):r(null,t.binary?o:o.toString("utf8"))})):i.xhr(e,t,r):n(i,this,e,t)}i.xhr=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)return r(Error("status "+n.status));if(t.binary){var e=n.response;if(!e){e=[];for(var o=0;o<n.responseText.length;++o)e.push(255&n.responseText.charCodeAt(o))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,n.responseText)}},t.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()}},945:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3]}function i(e,n,o){t[0]=e,n[o]=r[3],n[o+1]=r[2],n[o+2]=r[1],n[o+3]=r[0]}function s(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function a(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?o:i,e.writeFloatBE=n?i:o,e.readFloatLE=n?s:a,e.readFloatBE=n?a:s}():function(){function t(e,t,r,n){var o=t<0?1:0;if(o&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var i=Math.floor(Math.log(t)/Math.LN2);e((o<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,r,n)}}function s(e,t,r){var n=e(t,r),o=2*(n>>31)+1,i=n>>>23&255,s=8388607&n;return 255===i?s?NaN:o*(1/0):0===i?1401298464324817e-60*o*s:o*Math.pow(2,i-150)*(s+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,n),e.readFloatLE=s.bind(null,o),e.readFloatBE=s.bind(null,i)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3],n[o+4]=r[4],n[o+5]=r[5],n[o+6]=r[6],n[o+7]=r[7]}function i(e,n,o){t[0]=e,n[o]=r[7],n[o+1]=r[6],n[o+2]=r[5],n[o+3]=r[4],n[o+4]=r[3],n[o+5]=r[2],n[o+6]=r[1],n[o+7]=r[0]}function s(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function a(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?o:i,e.writeDoubleBE=n?i:o,e.readDoubleLE=n?s:a,e.readDoubleBE=n?a:s}():function(){function t(e,t,r,n,o,i){var s=n<0?1:0;if(s&&(n=-n),0===n)e(0,o,i+t),e(1/n>0?0:2147483648,o,i+r);else if(isNaN(n))e(0,o,i+t),e(2146959360,o,i+r);else if(n>17976931348623157e292)e(0,o,i+t),e((s<<31|2146435072)>>>0,o,i+r);else{var a;if(n<22250738585072014e-324)e((a=n/5e-324)>>>0,o,i+t),e((s<<31|a/4294967296)>>>0,o,i+r);else{var c=Math.floor(Math.log(n)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=n*Math.pow(2,-c))>>>0,o,i+t),e((s<<31|c+1023<<20|1048576*a&1048575)>>>0,o,i+r)}}}function s(e,t,r,n,o){var i=e(n,o+t),s=e(n,o+r),a=2*(s>>31)+1,c=s>>>20&2047,l=4294967296*(1048575&s)+i;return 2047===c?l?NaN:a*(1/0):0===c?5e-324*a*l:a*Math.pow(2,c-1075)*(l+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,n,4,0),e.readDoubleLE=s.bind(null,o,0,4),e.readDoubleBE=s.bind(null,i,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function n(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function o(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function i(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},7199:module=>{"use strict";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}module.exports=inquire},8626:(e,t)=>{"use strict";var r=t,n=r.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},o=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=n(e),o="";r&&(o=t.shift()+"/");for(var i=0;i<t.length;)".."===t[i]?i>0&&".."!==t[i-1]?t.splice(--i,2):r?t.splice(i,1):++i:"."===t[i]?t.splice(i,1):++i;return o+t.join("/")};r.resolve=function(e,t,r){return r||(t=o(t)),n(t)?t:(r||(e=o(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?o(e+"/"+t):t)}},6662:e=>{"use strict";e.exports=function(e,t,r){var n=r||8192,o=n>>>1,i=null,s=n;return function(r){if(r<1||r>o)return e(r);s+r>n&&(i=e(n),s=0);var a=t.call(i,s,s+=r);return 7&s&&(s=1+(7|s)),a}}},4997:(e,t)=>{"use strict";var r=t;r.length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},r.read=function(e,t,r){if(r-t<1)return"";for(var n,o=null,i=[],s=0;t<r;)(n=e[t++])<128?i[s++]=n:n>191&&n<224?i[s++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[s++]=55296+(n>>10),i[s++]=56320+(1023&n)):i[s++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),s=0);return o?(s&&o.push(String.fromCharCode.apply(String,i.slice(0,s))),o.join("")):String.fromCharCode.apply(String,i.slice(0,s))},r.write=function(e,t,r){for(var n,o,i=r,s=0;s<e.length;++s)(n=e.charCodeAt(s))<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(o=e.charCodeAt(s+1)))?(n=65536+((1023&n)<<10)+(1023&o),++s,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-i}},556:(e,t,r)=>{"use strict";const{encodeText:n}=r(2413);e.exports=class{constructor(e,t,r,o){this.name=e,this.code=t,this.codeBuf=n(this.code),this.alphabet=o,this.codec=r(o)}encode(e){return this.codec.encode(e)}decode(e){for(const t of e)if(this.alphabet&&this.alphabet.indexOf(t)<0)throw new Error(`invalid character '${t}' in '${e}'`);return this.codec.decode(e)}}},5077:(e,t,r)=>{"use strict";const n=r(8820),o=r(556),{rfc4648:i}=r(6727),{decodeText:s,encodeText:a}=r(2413),c=[["identity","\0",()=>({encode:s,decode:a}),""],["base2","0",i(1),"01"],["base8","7",i(3),"01234567"],["base10","9",n,"0123456789"],["base16","f",i(4),"0123456789abcdef"],["base16upper","F",i(4),"0123456789ABCDEF"],["base32hex","v",i(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",i(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",i(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",i(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",i(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",i(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",i(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",i(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",i(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",n,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",n,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",n,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",n,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",i(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",i(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",i(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",i(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],l=c.reduce(((e,t)=>(e[t[0]]=new o(t[0],t[1],t[2],t[3]),e)),{}),u=c.reduce(((e,t)=>(e[t[1]]=l[t[0]],e)),{});e.exports={names:l,codes:u}},6957:(e,t,r)=>{"use strict";const n=r(5077),{encodeText:o,decodeText:i,concat:s}=r(2413);function a(e){if(Object.prototype.hasOwnProperty.call(n.names,e))return n.names[e];if(Object.prototype.hasOwnProperty.call(n.codes,e))return n.codes[e];throw new Error(`Unsupported encoding: ${e}`)}(t=e.exports=function(e,t){if(!t)throw new Error("requires an encoded Uint8Array");const{name:r,codeBuf:n}=a(e);return function(e,t){a(e).decode(i(t))}(r,t),s([n,t],n.length+t.length)}).encode=function(e,t){const r=a(e),n=o(r.encode(t));return s([r.codeBuf,n],r.codeBuf.length+n.length)},t.decode=function(e){e instanceof Uint8Array&&(e=i(e));const t=e[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(t)&&(e=e.toLowerCase()),a(e[0]).decode(e.substring(1))},t.isEncoded=function(e){if(e instanceof Uint8Array&&(e=i(e)),"[object String]"!==Object.prototype.toString.call(e))return!1;try{return a(e[0]).name}catch(e){return!1}},t.encoding=a,t.encodingFromData=function(e){return e instanceof Uint8Array&&(e=i(e)),a(e[0])};const c=Object.freeze(n.names),l=Object.freeze(n.codes);t.names=c,t.codes=l},6727:e=>{"use strict";e.exports={rfc4648:e=>t=>({encode:r=>((e,t,r)=>{const n="="===t[t.length-1],o=(1<<r)-1;let i="",s=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],s+=8;s>r;)s-=r,i+=t[o&a>>s];if(s&&(i+=t[o&a<<r-s]),n)for(;i.length*r&7;)i+="=";return i})(r,t,e),decode:r=>((e,t,r)=>{const n={};for(let e=0;e<t.length;++e)n[t[e]]=e;let o=e.length;for(;"="===e[o-1];)--o;const i=new Uint8Array(o*r/8|0);let s=0,a=0,c=0;for(let t=0;t<o;++t){const o=n[e[t]];if(void 0===o)throw new SyntaxError("Invalid character "+e[t]);a=a<<r|o,s+=r,s>=8&&(s-=8,i[c++]=255&a>>s)}if(s>=r||255&a<<8-s)throw new SyntaxError("Unexpected end of data");return i})(r,t,e)})}},2413:e=>{"use strict";const t=new TextDecoder,r=new TextEncoder;e.exports={decodeText:e=>t.decode(e),encodeText:e=>r.encode(e),concat:function(e,t){const r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r}}},4492:(e,t,r)=>{"use strict";e.exports=r(8836)},2100:(e,t,r)=>{"use strict";e.exports=r(9482)},3996:(e,t,r)=>{"use strict";var n=t,o=r(7025),i=r(9935);function s(e,t,r,n){if(t.resolvedType)if(t.resolvedType instanceof o){e("switch(d%s){",n);for(var i=t.resolvedType.values,s=Object.keys(i),a=0;a<s.length;++a)t.repeated&&i[s[a]]===t.typeDefault&&e("default:"),e("case%j:",s[a])("case %i:",i[s[a]])("m%s=%j",n,i[s[a]])("break");e("}")}else e('if(typeof d%s!=="object")',n)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",n,r,n);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,c)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length >= 0)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n)}}return e}function a(e,t,r,n){if(t.resolvedType)t.resolvedType instanceof o?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",n,r,n,n):e("d%s=types[%i].toObject(m%s,o)",n,r,n);else{var i=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":i=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,i?"true":"",n);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:e("d%s=m%s",n,n)}}return e}n.fromObject=function(e){var t=e.fieldsArray,r=i.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var n=0;n<t.length;++n){var a=t[n].resolve(),c=i.safeProp(a.name);a.map?(r("if(d%s){",c)('if(typeof d%s!=="object")',c)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",c)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",c),s(r,a,n,c+"[ks[i]]")("}")("}")):a.repeated?(r("if(d%s){",c)("if(!Array.isArray(d%s))",c)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",c)("for(var i=0;i<d%s.length;++i){",c),s(r,a,n,c+"[i]")("}")("}")):(a.resolvedType instanceof o||r("if(d%s!=null){",c),s(r,a,n,c),a.resolvedType instanceof o||r("}"))}return r("return m")},n.toObject=function(e){var t=e.fieldsArray.slice().sort(i.compareFieldsById);if(!t.length)return i.codegen()("return {}");for(var r=i.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),n=[],s=[],c=[],l=0;l<t.length;++l)t[l].partOf||(t[l].resolve().repeated?n:t[l].map?s:c).push(t[l]);if(n.length){for(r("if(o.arrays||o.defaults){"),l=0;l<n.length;++l)r("d%s=[]",i.safeProp(n[l].name));r("}")}if(s.length){for(r("if(o.objects||o.defaults){"),l=0;l<s.length;++l)r("d%s={}",i.safeProp(s[l].name));r("}")}if(c.length){for(r("if(o.defaults){"),l=0;l<c.length;++l){var u=c[l],p=i.safeProp(u.name);if(u.resolvedType instanceof o)r("d%s=o.enums===String?%j:%j",p,u.resolvedType.valuesById[u.typeDefault],u.typeDefault);else if(u.long)r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",u.typeDefault.low,u.typeDefault.high,u.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",p)("}else")("d%s=o.longs===String?%j:%i",p,u.typeDefault.toString(),u.typeDefault.toNumber());else if(u.bytes){var d="["+Array.prototype.slice.call(u.typeDefault).join(",")+"]";r("if(o.bytes===String)d%s=%j",p,String.fromCharCode.apply(String,u.typeDefault))("else{")("d%s=%s",p,d)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",p,p)("}")}else r("d%s=%j",p,u.typeDefault)}r("}")}var f=!1;for(l=0;l<t.length;++l){u=t[l];var h=e._fieldsArray.indexOf(u);p=i.safeProp(u.name),u.map?(f||(f=!0,r("var ks2")),r("if(m%s&&(ks2=Object.keys(m%s)).length){",p,p)("d%s={}",p)("for(var j=0;j<ks2.length;++j){"),a(r,u,h,p+"[ks2[j]]")("}")):u.repeated?(r("if(m%s&&m%s.length){",p,p)("d%s=[]",p)("for(var j=0;j<m%s.length;++j){",p),a(r,u,h,p+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",p,u.name),a(r,u,h,p),u.partOf&&r("if(o.oneofs)")("d%s=%j",i.safeProp(u.partOf.name),u.name)),r("}")}return r("return d")}},5305:(e,t,r)=>{"use strict";e.exports=function(e){var t=i.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break"),t("switch(t>>>3){");for(var r=0;r<e.fieldsArray.length;++r){var a=e._fieldsArray[r].resolve(),c=a.resolvedType instanceof n?"int32":a.type,l="m"+i.safeProp(a.name);t("case %i: {",a.id),a.map?(t("if(%s===util.emptyObject)",l)("%s={}",l)("var c2 = r.uint32()+r.pos"),void 0!==o.defaults[a.keyType]?t("k=%j",o.defaults[a.keyType]):t("k=null"),void 0!==o.defaults[c]?t("value=%j",o.defaults[c]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",a.keyType)("case 2:"),void 0===o.basic[c]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",c),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==o.long[a.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',l):t("%s[k]=value",l)):a.repeated?(t("if(!(%s&&%s.length))",l,l)("%s=[]",l),void 0!==o.packed[c]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",l,c)("}else"),void 0===o.basic[c]?t(a.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",l,r):t("%s.push(r.%s())",l,c)):void 0===o.basic[c]?t(a.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",l,r):t("%s=r.%s()",l,c),t("break")("}")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),r=0;r<e._fieldsArray.length;++r){var u=e._fieldsArray[r];u.required&&t("if(!m.hasOwnProperty(%j))",u.name)("throw util.ProtocolError(%j,{instance:m})",s(u))}return t("return m")};var n=r(7025),o=r(7063),i=r(9935);function s(e){return"missing required '"+e.name+"'"}},4928:(e,t,r)=>{"use strict";e.exports=function(e){for(var t,r=i.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),a=e.fieldsArray.slice().sort(i.compareFieldsById),c=0;c<a.length;++c){var l=a[c].resolve(),u=e._fieldsArray.indexOf(l),p=l.resolvedType instanceof n?"int32":l.type,d=o.basic[p];t="m"+i.safeProp(l.name),l.map?(r("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,l.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(l.id<<3|2)>>>0,8|o.mapKey[l.keyType],l.keyType),void 0===d?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",u,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|d,p,t),r("}")("}")):l.repeated?(r("if(%s!=null&&%s.length){",t,t),l.packed&&void 0!==o.packed[p]?r("w.uint32(%i).fork()",(l.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",p,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===d?s(r,l,u,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(l.id<<3|d)>>>0,p,t)),r("}")):(l.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,l.name),void 0===d?s(r,l,u,t):r("w.uint32(%i).%s(%s)",(l.id<<3|d)>>>0,p,t))}return r("return w")};var n=r(7025),o=r(7063),i=r(9935);function s(e,t,r,n){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}},7025:(e,t,r)=>{"use strict";e.exports=s;var n=r(3243);((s.prototype=Object.create(n.prototype)).constructor=s).className="Enum";var o=r(9313),i=r(9935);function s(e,t,r,o,i){if(n.call(this,e,r),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=o,this.comments=i||{},this.reserved=void 0,t)for(var s=Object.keys(t),a=0;a<s.length;++a)"number"==typeof t[s[a]]&&(this.valuesById[this.values[s[a]]=t[s[a]]]=s[a])}s.fromJSON=function(e,t){var r=new s(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,r},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},s.prototype.add=function(e,t,r){if(!i.isString(e))throw TypeError("name must be a string");if(!i.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return this.comments[e]=r||null,this},s.prototype.remove=function(e){if(!i.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this},s.prototype.isReservedId=function(e){return o.isReservedId(this.reserved,e)},s.prototype.isReservedName=function(e){return o.isReservedName(this.reserved,e)}},3548:(e,t,r)=>{"use strict";e.exports=l;var n=r(3243);((l.prototype=Object.create(n.prototype)).constructor=l).className="Field";var o,i=r(7025),s=r(7063),a=r(9935),c=/^required|optional|repeated$/;function l(e,t,r,o,i,l,u){if(a.isObject(o)?(u=i,l=o,o=i=void 0):a.isObject(i)&&(u=l,l=i,i=void 0),n.call(this,e,l),!a.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!a.isString(r))throw TypeError("type must be a string");if(void 0!==o&&!c.test(o=o.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==i&&!a.isString(i))throw TypeError("extend must be a string");"proto3_optional"===o&&(o="optional"),this.rule=o&&"optional"!==o?o:void 0,this.type=r,this.id=t,this.extend=i||void 0,this.required="required"===o,this.optional=!this.required,this.repeated="repeated"===o,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!a.Long&&void 0!==s.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=u}l.fromJSON=function(e,t){return new l(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(l.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),l.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),n.prototype.setOption.call(this,e,t,r)},l.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return a.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},l.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=s.defaults[this.type])?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof o?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof i&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof i)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=a.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;a.base64.test(this.typeDefault)?a.base64.decode(this.typeDefault,e=a.newBuffer(a.base64.length(this.typeDefault)),0):a.utf8.write(this.typeDefault,e=a.newBuffer(a.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=a.emptyObject:this.repeated?this.defaultValue=a.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof o&&(this.parent.ctor.prototype[this.name]=this.defaultValue),n.prototype.resolve.call(this)},l.d=function(e,t,r,n){return"function"==typeof t?t=a.decorateType(t).name:t&&"object"==typeof t&&(t=a.decorateEnum(t).name),function(o,i){a.decorateType(o.constructor).add(new l(i,e,t,r,{default:n}))}},l._configure=function(e){o=e}},8836:(e,t,r)=>{"use strict";var n=e.exports=r(9482);n.build="light",n.load=function(e,t,r){return"function"==typeof t?(r=t,t=new n.Root):t||(t=new n.Root),t.load(e,r)},n.loadSync=function(e,t){return t||(t=new n.Root),t.loadSync(e)},n.encoder=r(4928),n.decoder=r(5305),n.verifier=r(4497),n.converter=r(3996),n.ReflectionObject=r(3243),n.Namespace=r(9313),n.Root=r(9424),n.Enum=r(7025),n.Type=r(7645),n.Field=r(3548),n.OneOf=r(7598),n.MapField=r(6039),n.Service=r(7513),n.Method=r(4429),n.Message=r(8368),n.wrappers=r(1667),n.types=r(7063),n.util=r(9935),n.ReflectionObject._configure(n.Root),n.Namespace._configure(n.Type,n.Service,n.Enum),n.Root._configure(n.Type),n.Field._configure(n.Type)},9482:(e,t,r)=>{"use strict";var n=t;function o(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=r(1173),n.BufferWriter=r(3155),n.Reader=r(1408),n.BufferReader=r(593),n.util=r(9693),n.rpc=r(5994),n.roots=r(5054),n.configure=o,o()},6039:(e,t,r)=>{"use strict";e.exports=s;var n=r(3548);((s.prototype=Object.create(n.prototype)).constructor=s).className="MapField";var o=r(7063),i=r(9935);function s(e,t,r,o,s,a){if(n.call(this,e,t,o,void 0,void 0,s,a),!i.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}s.fromJSON=function(e,t){return new s(e,t.id,t.keyType,t.type,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},s.prototype.resolve=function(){if(this.resolved)return this;if(void 0===o.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return n.prototype.resolve.call(this)},s.d=function(e,t,r){return"function"==typeof r?r=i.decorateType(r).name:r&&"object"==typeof r&&(r=i.decorateEnum(r).name),function(n,o){i.decorateType(n.constructor).add(new s(o,e,t,r))}}},8368:(e,t,r)=>{"use strict";e.exports=o;var n=r(9693);function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.create=function(e){return this.$type.create(e)},o.encode=function(e,t){return this.$type.encode(e,t)},o.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},o.decode=function(e){return this.$type.decode(e)},o.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},o.verify=function(e){return this.$type.verify(e)},o.fromObject=function(e){return this.$type.fromObject(e)},o.toObject=function(e,t){return this.$type.toObject(e,t)},o.prototype.toJSON=function(){return this.$type.toObject(this,n.toJSONOptions)}},4429:(e,t,r)=>{"use strict";e.exports=i;var n=r(3243);((i.prototype=Object.create(n.prototype)).constructor=i).className="Method";var o=r(9935);function i(e,t,r,i,s,a,c,l,u){if(o.isObject(s)?(c=s,s=a=void 0):o.isObject(a)&&(c=a,a=void 0),void 0!==t&&!o.isString(t))throw TypeError("type must be a string");if(!o.isString(r))throw TypeError("requestType must be a string");if(!o.isString(i))throw TypeError("responseType must be a string");n.call(this,e,c),this.type=t||"rpc",this.requestType=r,this.requestStream=!!s||void 0,this.responseType=i,this.responseStream=!!a||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=l,this.parsedOptions=u}i.fromJSON=function(e,t){return new i(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},i.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},i.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),n.prototype.resolve.call(this))}},9313:(e,t,r)=>{"use strict";e.exports=u;var n=r(3243);((u.prototype=Object.create(n.prototype)).constructor=u).className="Namespace";var o,i,s,a=r(3548),c=r(9935);function l(e,t){if(e&&e.length){for(var r={},n=0;n<e.length;++n)r[e[n].name]=e[n].toJSON(t);return r}}function u(e,t){n.call(this,e,t),this.nested=void 0,this._nestedArray=null}function p(e){return e._nestedArray=null,e}u.fromJSON=function(e,t){return new u(e,t.options).addJSON(t.nested)},u.arrayToJSON=l,u.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>t)return!0;return!1},u.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(u.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=c.toArray(this.nested))}}),u.prototype.toJSON=function(e){return c.toObject(["options",this.options,"nested",l(this.nestedArray,e)])},u.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),n=0;n<r.length;++n)t=e[r[n]],this.add((void 0!==t.fields?o.fromJSON:void 0!==t.values?s.fromJSON:void 0!==t.methods?i.fromJSON:void 0!==t.id?a.fromJSON:u.fromJSON)(r[n],t));return this},u.prototype.get=function(e){return this.nested&&this.nested[e]||null},u.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof s)return this.nested[e].values;throw Error("no such enum: "+e)},u.prototype.add=function(e){if(!(e instanceof a&&void 0!==e.extend||e instanceof o||e instanceof s||e instanceof i||e instanceof u))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof u&&e instanceof u)||t instanceof o||t instanceof i)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,n=0;n<r.length;++n)e.add(r[n]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),p(this)},u.prototype.remove=function(e){if(!(e instanceof n))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),p(this)},u.prototype.define=function(e,t){if(c.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof u))throw Error("path conflicts with non-namespace objects")}else r.add(r=new u(n))}return t&&r.addJSON(t),r},u.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof u?e[t++].resolveAll():e[t++].resolve();return this.resolve()},u.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),c.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var n=this.get(e[0]);if(n){if(1===e.length){if(!t||t.indexOf(n.constructor)>-1)return n}else if(n instanceof u&&(n=n.lookup(e.slice(1),t,!0)))return n}else for(var o=0;o<this.nestedArray.length;++o)if(this._nestedArray[o]instanceof u&&(n=this._nestedArray[o].lookup(e,t,!0)))return n;return null===this.parent||r?null:this.parent.lookup(e,t)},u.prototype.lookupType=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such type: "+e);return t},u.prototype.lookupEnum=function(e){var t=this.lookup(e,[s]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},u.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[o,s]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},u.prototype.lookupService=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},u._configure=function(e,t,r){o=e,i=t,s=r}},3243:(e,t,r)=>{"use strict";e.exports=i,i.className="ReflectionObject";var n,o=r(9935);function i(e,t){if(!o.isString(e))throw TypeError("name must be a string");if(t&&!o.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(i.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),i.prototype.toJSON=function(){throw Error()},i.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof n&&t._handleAdd(this)},i.prototype.onRemove=function(e){var t=e.root;t instanceof n&&t._handleRemove(this),this.parent=null,this.resolved=!1},i.prototype.resolve=function(){return this.resolved||this.root instanceof n&&(this.resolved=!0),this},i.prototype.getOption=function(e){if(this.options)return this.options[e]},i.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},i.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var n=this.parsedOptions;if(r){var i=n.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(i){var s=i[e];o.setProperty(s,r,t)}else(i={})[e]=o.setProperty({},r,t),n.push(i)}else{var a={};a[e]=t,n.push(a)}return this},i.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)this.setOption(r[n],e[r[n]],t);return this},i.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},i._configure=function(e){n=e}},7598:(e,t,r)=>{"use strict";e.exports=s;var n=r(3243);((s.prototype=Object.create(n.prototype)).constructor=s).className="OneOf";var o=r(3548),i=r(9935);function s(e,t,r,o){if(Array.isArray(t)||(r=t,t=void 0),n.call(this,e,r),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=o}function a(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}s.fromJSON=function(e,t){return new s(e,t.oneof,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},s.prototype.add=function(e){if(!(e instanceof o))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,a(this),this},s.prototype.remove=function(e){if(!(e instanceof o))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},s.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var r=e.get(this.oneof[t]);r&&!r.partOf&&(r.partOf=this,this.fieldsArray.push(r))}a(this)},s.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);n.prototype.onRemove.call(this,e)},s.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){i.decorateType(t.constructor).add(new s(r,e)),Object.defineProperty(t,r,{get:i.oneOfGetter(e),set:i.oneOfSetter(e)})}}},1408:(e,t,r)=>{"use strict";e.exports=c;var n,o=r(9693),i=o.LongBits,s=o.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var l,u="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},p=function(){return o.Buffer?function(e){return(c.create=function(e){return o.Buffer.isBuffer(e)?new n(e):u(e)})(e)}:u};function d(){var e=new i(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function f(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function h(){if(this.pos+8>this.len)throw a(this,8);return new i(f(this.buf,this.pos+=4),f(this.buf,this.pos+=4))}c.create=p(),c.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,c.prototype.uint32=(l=4294967295,function(){if(l=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return l;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return l}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return f(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|f(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},c.prototype.string=function(){var e=this.bytes();return s.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.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(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){n=e,c.create=p(),n._configure();var t=o.Long?"toLong":"toNumber";o.merge(c.prototype,{int64:function(){return d.call(this)[t](!1)},uint64:function(){return d.call(this)[t](!0)},sint64:function(){return d.call(this).zzDecode()[t](!1)},fixed64:function(){return h.call(this)[t](!0)},sfixed64:function(){return h.call(this)[t](!1)}})}},593:(e,t,r)=>{"use strict";e.exports=i;var n=r(1408);(i.prototype=Object.create(n.prototype)).constructor=i;var o=r(9693);function i(e){n.call(this,e)}i._configure=function(){o.Buffer&&(i.prototype._slice=o.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()},9424:(e,t,r)=>{"use strict";e.exports=p;var n=r(9313);((p.prototype=Object.create(n.prototype)).constructor=p).className="Root";var o,i,s,a=r(3548),c=r(7025),l=r(7598),u=r(9935);function p(e){n.call(this,"",e),this.deferred=[],this.files=[]}function d(){}p.fromJSON=function(e,t){return t||(t=new p),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},p.prototype.resolvePath=u.path.resolve,p.prototype.fetch=u.fetch,p.prototype.load=function e(t,r,n){"function"==typeof r&&(n=r,r=void 0);var o=this;if(!n)return u.asPromise(e,o,t,r);var a=n===d;function c(e,t){if(n){var r=n;if(n=null,a)throw e;r(e,t)}}function l(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in s)return r}return null}function p(e,t){try{if(u.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),u.isString(t)){i.filename=e;var n,s=i(t,o,r),p=0;if(s.imports)for(;p<s.imports.length;++p)(n=l(s.imports[p])||o.resolvePath(e,s.imports[p]))&&f(n);if(s.weakImports)for(p=0;p<s.weakImports.length;++p)(n=l(s.weakImports[p])||o.resolvePath(e,s.weakImports[p]))&&f(n,!0)}else o.setOptions(t.options).addJSON(t.nested)}catch(e){c(e)}a||h||c(null,o)}function f(e,t){if(!(o.files.indexOf(e)>-1))if(o.files.push(e),e in s)a?p(e,s[e]):(++h,setTimeout((function(){--h,p(e,s[e])})));else if(a){var r;try{r=u.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||c(e))}p(e,r)}else++h,o.fetch(e,(function(r,i){--h,n&&(r?t?h||c(null,o):c(r):p(e,i))}))}var h=0;u.isString(t)&&(t=[t]);for(var y,_=0;_<t.length;++_)(y=o.resolvePath("",t[_]))&&f(y);if(a)return o;h||c(null,o)},p.prototype.loadSync=function(e,t){if(!u.isNode)throw Error("not supported");return this.load(e,t,d)},p.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return n.prototype.resolveAll.call(this)};var f=/^[A-Z]/;function h(e,t){var r=t.parent.lookup(t.extend);if(r){var n=new a(t.fullName,t.id,t.type,t.rule,void 0,t.options);return n.declaringField=t,t.extensionField=n,r.add(n),!0}return!1}p.prototype._handleAdd=function(e){if(e instanceof a)void 0===e.extend||e.extensionField||h(0,e)||this.deferred.push(e);else if(e instanceof c)f.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof l)){if(e instanceof o)for(var t=0;t<this.deferred.length;)h(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var r=0;r<e.nestedArray.length;++r)this._handleAdd(e._nestedArray[r]);f.test(e.name)&&(e.parent[e.name]=e)}},p.prototype._handleRemove=function(e){if(e instanceof a){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof c)f.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);f.test(e.name)&&delete e.parent[e.name]}},p._configure=function(e,t,r){o=e,i=t,s=r}},5054:e=>{"use strict";e.exports={}},5994:(e,t,r)=>{"use strict";t.Service=r(7948)},7948:(e,t,r)=>{"use strict";e.exports=o;var n=r(9693);function o(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(o.prototype=Object.create(n.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function e(t,r,o,i,s){if(!i)throw TypeError("request must be specified");var a=this;if(!s)return n.asPromise(e,a,t,r,o,i);if(a.rpcImpl)try{return a.rpcImpl(t,r[a.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(e,r){if(e)return a.emit("error",e,t),s(e);if(null!==r){if(!(r instanceof o))try{r=o[a.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return a.emit("error",e,t),s(e)}return a.emit("data",r,t),s(null,r)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){s(e)}),0)}else setTimeout((function(){s(Error("already ended"))}),0)},o.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},7513:(e,t,r)=>{"use strict";e.exports=a;var n=r(9313);((a.prototype=Object.create(n.prototype)).constructor=a).className="Service";var o=r(4429),i=r(9935),s=r(5994);function a(e,t){n.call(this,e,t),this.methods={},this._methodsArray=null}function c(e){return e._methodsArray=null,e}a.fromJSON=function(e,t){var r=new a(e,t.options);if(t.methods)for(var n=Object.keys(t.methods),i=0;i<n.length;++i)r.add(o.fromJSON(n[i],t.methods[n[i]]));return t.nested&&r.addJSON(t.nested),r.comment=t.comment,r},a.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return i.toObject(["options",t&&t.options||void 0,"methods",n.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},Object.defineProperty(a.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=i.toArray(this.methods))}}),a.prototype.get=function(e){return this.methods[e]||n.prototype.get.call(this,e)},a.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return n.prototype.resolve.call(this)},a.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof o?(this.methods[e.name]=e,e.parent=this,c(this)):n.prototype.add.call(this,e)},a.prototype.remove=function(e){if(e instanceof o){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,c(this)}return n.prototype.remove.call(this,e)},a.prototype.create=function(e,t,r){for(var n,o=new s.Service(e,t,r),a=0;a<this.methodsArray.length;++a){var c=i.lcFirst((n=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");o[c]=i.codegen(["r","c"],i.isReserved(c)?c+"_":c)("return this.rpcCall(m,q,s,r,c)")({m:n,q:n.resolvedRequestType.ctor,s:n.resolvedResponseType.ctor})}return o}},7645:(e,t,r)=>{"use strict";e.exports=b;var n=r(9313);((b.prototype=Object.create(n.prototype)).constructor=b).className="Type";var o=r(7025),i=r(7598),s=r(3548),a=r(6039),c=r(7513),l=r(8368),u=r(1408),p=r(1173),d=r(9935),f=r(4928),h=r(5305),y=r(4497),_=r(3996),g=r(1667);function b(e,t){n.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function m(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(b.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],n=r.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=d.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=d.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=b.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof l||((e.prototype=new l).constructor=e,d.merge(e.prototype,t)),e.$type=e.prototype.$type=this,d.merge(e,l,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this._oneofsArray[r].resolve().name]={get:d.oneOfGetter(this._oneofsArray[r].oneof),set:d.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,n)}}}),b.generateConstructor=function(e){for(var t,r=d.codegen(["p"],e.name),n=0;n<e.fieldsArray.length;++n)(t=e._fieldsArray[n]).map?r("this%s={}",d.safeProp(t.name)):t.repeated&&r("this%s=[]",d.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},b.fromJSON=function(e,t){var r=new b(e,t.options);r.extensions=t.extensions,r.reserved=t.reserved;for(var l=Object.keys(t.fields),u=0;u<l.length;++u)r.add((void 0!==t.fields[l[u]].keyType?a.fromJSON:s.fromJSON)(l[u],t.fields[l[u]]));if(t.oneofs)for(l=Object.keys(t.oneofs),u=0;u<l.length;++u)r.add(i.fromJSON(l[u],t.oneofs[l[u]]));if(t.nested)for(l=Object.keys(t.nested),u=0;u<l.length;++u){var p=t.nested[l[u]];r.add((void 0!==p.id?s.fromJSON:void 0!==p.fields?b.fromJSON:void 0!==p.values?o.fromJSON:void 0!==p.methods?c.fromJSON:n.fromJSON)(l[u],p))}return t.extensions&&t.extensions.length&&(r.extensions=t.extensions),t.reserved&&t.reserved.length&&(r.reserved=t.reserved),t.group&&(r.group=!0),t.comment&&(r.comment=t.comment),r},b.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return d.toObject(["options",t&&t.options||void 0,"oneofs",n.arrayToJSON(this.oneofsArray,e),"fields",n.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},b.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var r=this.oneofsArray;for(t=0;t<r.length;)r[t++].resolve();return n.prototype.resolveAll.call(this)},b.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},b.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof s&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),m(this)}return e instanceof i?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),m(this)):n.prototype.add.call(this,e)},b.prototype.remove=function(e){if(e instanceof s&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),m(this)}if(e instanceof i){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),m(this)}return n.prototype.remove.call(this,e)},b.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},b.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)},b.prototype.create=function(e){return new this.ctor(e)},b.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=f(this)({Writer:p,types:t,util:d}),this.decode=h(this)({Reader:u,types:t,util:d}),this.verify=y(this)({types:t,util:d}),this.fromObject=_.fromObject(this)({types:t,util:d}),this.toObject=_.toObject(this)({types:t,util:d});var n=g[e];if(n){var o=Object.create(this);o.fromObject=this.fromObject,this.fromObject=n.fromObject.bind(o),o.toObject=this.toObject,this.toObject=n.toObject.bind(o)}return this},b.prototype.encode=function(e,t){return this.setup().encode(e,t)},b.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},b.prototype.decode=function(e,t){return this.setup().decode(e,t)},b.prototype.decodeDelimited=function(e){return e instanceof u||(e=u.create(e)),this.decode(e,e.uint32())},b.prototype.verify=function(e){return this.setup().verify(e)},b.prototype.fromObject=function(e){return this.setup().fromObject(e)},b.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},b.d=function(e){return function(t){d.decorateType(t,e)}}},7063:(e,t,r)=>{"use strict";var n=t,o=r(9935),i=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function s(e,t){var r=0,n={};for(t|=0;r<e.length;)n[i[r+t]]=e[r++];return n}n.basic=s([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),n.defaults=s([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",o.emptyArray,null]),n.long=s([0,0,0,1,1],7),n.mapKey=s([0,0,0,5,5,0,0,0,1,1,0,2],2),n.packed=s([1,5,0,0,0,5,5,0,0,0,1,1,0])},9935:(e,t,r)=>{"use strict";var n,o,i=e.exports=r(9693),s=r(5054);i.codegen=r(5124),i.fetch=r(9054),i.path=r(8626),i.fs=i.inquire("fs"),i.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n<t.length;)r[n]=e[t[n++]];return r}return[]},i.toObject=function(e){for(var t={},r=0;r<e.length;){var n=e[r++],o=e[r++];void 0!==o&&(t[n]=o)}return t};var a=/\\/g,c=/"/g;i.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},i.safeProp=function(e){return!/^[$\w_]+$/.test(e)||i.isReserved(e)?'["'+e.replace(a,"\\\\").replace(c,'\\"')+'"]':"."+e},i.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var l=/_([a-z])/g;i.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(l,(function(e,t){return t.toUpperCase()}))},i.compareFieldsById=function(e,t){return e.id-t.id},i.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(i.decorateRoot.remove(e.$type),e.$type.name=t,i.decorateRoot.add(e.$type)),e.$type;n||(n=r(7645));var o=new n(t||e.name);return i.decorateRoot.add(o),o.ctor=e,Object.defineProperty(e,"$type",{value:o,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:o,enumerable:!1}),o};var u=0;i.decorateEnum=function(e){if(e.$type)return e.$type;o||(o=r(7025));var t=new o("Enum"+u++,e);return i.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},i.setProperty=function(e,t,r){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,n){var o=r.shift();if("__proto__"===o)return t;if(r.length>0)t[o]=e(t[o]||{},r,n);else{var i=t[o];i&&(n=[].concat(i).concat(n)),t[o]=n}return t}(e,t=t.split("."),r)},Object.defineProperty(i,"decorateRoot",{get:function(){return s.decorated||(s.decorated=new(r(9424)))}})},1945:(e,t,r)=>{"use strict";e.exports=o;var n=r(9693);function o(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=o.zero=new o(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(e){if(0===e)return i;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new o(r,n)},o.from=function(e){if("number"==typeof e)return o.fromNumber(e);if(n.isString(e)){if(!n.Long)return o.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new o(e.low>>>0,e.high>>>0):i},o.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},o.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;o.fromHash=function(e){return e===s?i:new o((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},o.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},o.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},9693:function(e,t,r){"use strict";var n=t;function o(e,t,r){for(var n=Object.keys(t),o=0;o<n.length;++o)void 0!==e[n[o]]&&r||(e[n[o]]=t[n[o]]);return e}function i(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&o(this,r)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:()=>e,set:void 0,enumerable:!1,configurable:!0},toString:{value(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}n.asPromise=r(4537),n.base64=r(7419),n.EventEmitter=r(9211),n.float=r(945),n.inquire=r(7199),n.utf8=r(4997),n.pool=r(6662),n.LongBits=r(1945),n.isNode=Boolean(void 0!==r.g&&r.g&&r.g.process&&r.g.process.versions&&r.g.process.versions.node),n.global=n.isNode&&r.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,n.emptyArray=Object.freeze?Object.freeze([]):[],n.emptyObject=Object.freeze?Object.freeze({}):{},n.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},n.isString=function(e){return"string"==typeof e||e instanceof String},n.isObject=function(e){return e&&"object"==typeof e},n.isset=n.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"==typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=o,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=i,n.ProtocolError=i("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},n.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},n._configure=function(){var e=n.Buffer;e?(n._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},n._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):n._Buffer_from=n._Buffer_allocUnsafe=null}},4497:(e,t,r)=>{"use strict";e.exports=function(e){var t=o.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r={};e.oneofsArray.length&&t("var p={}");for(var n=0;n<e.fieldsArray.length;++n){var c=e._fieldsArray[n].resolve(),l="m"+o.safeProp(c.name);if(c.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",l,c.name),c.map)t("if(!util.isObject(%s))",l)("return%j",i(c,"object"))("var k=Object.keys(%s)",l)("for(var i=0;i<k.length;++i){"),a(t,c,"k[i]"),s(t,c,n,l+"[k[i]]")("}");else if(c.repeated)t("if(!Array.isArray(%s))",l)("return%j",i(c,"array"))("for(var i=0;i<%s.length;++i){",l),s(t,c,n,l+"[i]")("}");else{if(c.partOf){var u=o.safeProp(c.partOf.name);1===r[c.partOf.name]&&t("if(p%s===1)",u)("return%j",c.partOf.name+": multiple values"),r[c.partOf.name]=1,t("p%s=1",u)}s(t,c,n,l)}c.optional&&t("}")}return t("return null")};var n=r(7025),o=r(9935);function i(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function s(e,t,r,o){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(%s){",o)("default:")("return%j",i(t,"enum value"));for(var s=Object.keys(t.resolvedType.values),a=0;a<s.length;++a)e("case %i:",t.resolvedType.values[s[a]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",r,o)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",o)("return%j",i(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",o,o,o,o)("return%j",i(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',o)("return%j",i(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',o)("return%j",i(t,"boolean"));break;case"string":e("if(!util.isString(%s))",o)("return%j",i(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',o,o,o)("return%j",i(t,"buffer"))}return e}function a(e,t,r){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",r)("return%j",i(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",r)("return%j",i(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",r)("return%j",i(t,"boolean key"))}return e}},1667:(e,t,r)=>{"use strict";var n=t,o=r(8368);n[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var n="."===e["@type"].charAt(0)?e["@type"].slice(1):e["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var r="",n="";if(t&&t.json&&e.type_url&&e.value){n=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var i=this.lookup(n);i&&(e=i.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof o){var s=e.$type.toObject(e,t);return""===r&&(r="type.googleapis.com/"),n=r+("."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName),s["@type"]=n,s}return this.toObject(e,t)}}},1173:(e,t,r)=>{"use strict";e.exports=p;var n,o=r(9693),i=o.LongBits,s=o.base64,a=o.utf8;function c(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function l(){}function u(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function p(){this.len=0,this.head=new c(l,0,0),this.tail=this.head,this.states=null}var d=function(){return o.Buffer?function(){return(p.create=function(){return new n})()}:function(){return new p}};function f(e,t,r){t[r]=255&e}function h(e,t){this.len=e,this.next=void 0,this.val=t}function y(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function _(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}p.create=d(),p.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(p.alloc=o.pool(p.alloc,o.Array.prototype.subarray)),p.prototype._push=function(e,t,r){return this.tail=this.tail.next=new c(e,t,r),this.len+=t,this},h.prototype=Object.create(c.prototype),h.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},p.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new h((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},p.prototype.int32=function(e){return e<0?this._push(y,10,i.fromNumber(e)):this.uint32(e)},p.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},p.prototype.uint64=function(e){var t=i.from(e);return this._push(y,t.length(),t)},p.prototype.int64=p.prototype.uint64,p.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(y,t.length(),t)},p.prototype.bool=function(e){return this._push(f,1,e?1:0)},p.prototype.fixed32=function(e){return this._push(_,4,e>>>0)},p.prototype.sfixed32=p.prototype.fixed32,p.prototype.fixed64=function(e){var t=i.from(e);return this._push(_,4,t.lo)._push(_,4,t.hi)},p.prototype.sfixed64=p.prototype.fixed64,p.prototype.float=function(e){return this._push(o.float.writeFloatLE,4,e)},p.prototype.double=function(e){return this._push(o.float.writeDoubleLE,8,e)};var g=o.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n<e.length;++n)t[r+n]=e[n]};p.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(f,1,0);if(o.isString(e)){var r=p.alloc(t=s.length(e));s.decode(e,r,0),e=r}return this.uint32(t)._push(g,t,e)},p.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(f,1,0)},p.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new c(l,0,0),this.len=0,this},p.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 c(l,0,0),this.len=0),this},p.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},p.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},p._configure=function(e){n=e,p.create=d(),n._configure()}},3155:(e,t,r)=>{"use strict";e.exports=i;var n=r(1173);(i.prototype=Object.create(n.prototype)).constructor=i;var o=r(9693);function i(){n.call(this)}function s(e,t,r){e.length<40?o.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}i._configure=function(){i.alloc=o._Buffer_allocUnsafe,i.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&"set"===o.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n<e.length;)t[r++]=e[n++]}},i.prototype.bytes=function(e){o.isString(e)&&(e=o._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this},i.prototype.string=function(e){var t=o.Buffer.byteLength(e);return this.uint32(t),t&&this._push(s,t,e),this},i._configure()},9822:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=void 0;const n=r(7187),o=r(8593);class i{constructor(e){var t;e.id&&(this.id=(0,o.decodeBase58)(e.id)),this.signer=e.signer,this.provider=e.provider||(null===(t=e.signer)||void 0===t?void 0:t.provider),this.abi=e.abi,this.bytecode=e.bytecode,e.serializer?this.serializer=e.serializer:e.abi&&e.abi.koilib_types&&(this.serializer=new n.Serializer(e.abi.koilib_types)),this.options={signTransaction:!0,sendTransaction:!0,broadcast:!0,sendAbis:!0,...e.options},this.functions={},this.signer&&this.provider&&this.abi&&this.abi.methods&&this.serializer&&Object.keys(this.abi.methods).forEach((e=>{this.functions[e]=async(t={},r)=>{if(!this.provider)throw new Error("provider not found");if(!this.abi||!this.abi.methods)throw new Error("Methods are not defined");if(!this.abi.methods[e])throw new Error(`Method ${e} not defined in the ABI`);const n={...this.options,...r},{read_only:i,return:s,default_output:a,preformat_argument:c,preformat_return:l}=this.abi.methods[e];let u;u="function"==typeof c?c(t):t;const p=await this.encodeOperation({name:e,args:u});if(i){if(!s)throw new Error(`No output defined for ${e}`);const{result:t}=await this.provider.readContract(p.call_contract);let r=a;return t&&(r=await this.serializer.deserialize(t,s)),"function"==typeof l&&(r=l(r)),{operation:p,result:r}}if(!this.signer)throw new Error("signer not found");let d=await this.signer.prepareTransaction({header:{...(null==n?void 0:n.chainId)&&{chain_id:null==n?void 0:n.chainId},...(null==n?void 0:n.rcLimit)&&{rc_limit:null==n?void 0:n.rcLimit},...(null==n?void 0:n.nonce)&&{nonce:null==n?void 0:n.nonce},...(null==n?void 0:n.payer)&&{payer:null==n?void 0:n.payer},...(null==n?void 0:n.payee)&&{payee:null==n?void 0:n.payee}},operations:[p]});const f={};if((null==n?void 0:n.sendAbis)&&(f[(0,o.encodeBase58)(this.id)]=this.abi),!(null==n?void 0:n.sendTransaction)){const e=()=>{throw new Error("This transaction was not broadcasted")};return n.signTransaction&&(d=await this.signer.signTransaction(d,f)),{operation:p,transaction:{...d,wait:e}}}const{transaction:h,receipt:y}=await this.signer.sendTransaction(d,n.broadcast,f);return{operation:p,transaction:h,receipt:y}}}))}getId(){if(!this.id)throw new Error("id is not defined");return(0,o.encodeBase58)(this.id)}async deploy(e){if(!this.signer)throw new Error("signer not found");if(!this.bytecode)throw new Error("bytecode not found");const t={...this.options,...e},r={upload_contract:{contract_id:this.id?(0,o.encodeBase58)(this.id):this.signer.getAddress(),bytecode:(0,o.encodeBase64url)(this.bytecode),...(null==t?void 0:t.abi)&&{abi:null==t?void 0:t.abi},...(null==t?void 0:t.authorizesCallContract)&&{authorizes_call_contract:null==t?void 0:t.authorizesCallContract},...(null==t?void 0:t.authorizesTransactionApplication)&&{authorizes_transaction_application:null==t?void 0:t.authorizesTransactionApplication},...(null==t?void 0:t.authorizesUploadContract)&&{authorizes_upload_contract:null==t?void 0:t.authorizesUploadContract}}};let n=await this.signer.prepareTransaction({header:{...(null==t?void 0:t.chainId)&&{chain_id:null==t?void 0:t.chainId},...(null==t?void 0:t.rcLimit)&&{rc_limit:null==t?void 0:t.rcLimit},...(null==t?void 0:t.nonce)&&{nonce:null==t?void 0:t.nonce},...(null==t?void 0:t.payer)&&{payer:null==t?void 0:t.payer},...(null==t?void 0:t.payee)&&{payee:null==t?void 0:t.payee}},operations:[r]});if(!(null==t?void 0:t.sendTransaction)){const e=()=>{throw new Error("This transaction was not broadcasted")};return t.signTransaction&&(n=await this.signer.signTransaction(n)),{operation:r,transaction:{...n,wait:e}}}const{transaction:i,receipt:s}=await this.signer.sendTransaction(n,t.broadcast);return{operation:r,transaction:i,receipt:s}}async encodeOperation(e){if(!this.abi||!this.abi.methods||!this.abi.methods[e.name])throw new Error(`Operation ${e.name} unknown`);if(!this.serializer)throw new Error("Serializer is not defined");if(!this.id)throw new Error("Contract id is not defined");const t=this.abi.methods[e.name];let r=new Uint8Array(0);if(t.argument){if(!e.args)throw new Error(`No arguments defined for type '${t.argument}'`);r=await this.serializer.serialize(e.args,t.argument)}return{call_contract:{contract_id:(0,o.encodeBase58)(this.id),entry_point:t.entry_point,args:(0,o.encodeBase64url)(r)}}}async decodeOperation(e){if(!this.id)throw new Error("Contract id is not defined");if(!this.abi||!this.abi.methods)throw new Error("Methods are not defined");if(!this.serializer)throw new Error("Serializer is not defined");if(!e.call_contract)throw new Error("Operation is not CallContractOperation");if(e.call_contract.contract_id!==(0,o.encodeBase58)(this.id))throw new Error(`Invalid contract id. Expected: ${(0,o.encodeBase58)(this.id)}. Received: ${e.call_contract.contract_id}`);for(let t=0;t<Object.keys(this.abi.methods).length;t+=1){const r=Object.keys(this.abi.methods)[t],n=this.abi.methods[r];if(e.call_contract.entry_point===n.entry_point)return n.argument?{name:r,args:await this.serializer.deserialize(e.call_contract.args,n.argument)}:{name:r}}throw new Error(`Unknown method id ${e.call_contract.entry_point}`)}}t.Contract=i,t.default=i},5635:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Provider=void 0;const n=r(9104),o=r(8593);async function i(e){return new Promise((t=>setTimeout(t,e)))}class s{constructor(e){Array.isArray(e)?this.rpcNodes=e:this.rpcNodes=[e],this.currentNodeId=0,this.onError=()=>!0}async call(e,t){for(;;)try{const r={id:Math.round(1e3*Math.random()),jsonrpc:"2.0",method:e,params:t},n=this.rpcNodes[this.currentNodeId],o=await fetch(n,{method:"POST",body:JSON.stringify(r)}),i=await o.json();if(void 0!==i.result)return i.result;if(!i.error)throw new Error("undefined error");const{message:s,data:a}=i.error;if(!a)throw new Error(s);let c;try{c=JSON.parse(a)}catch(e){c={data:a}}throw new Error(JSON.stringify({...s&&{error:s},...c}))}catch(e){const t=this.rpcNodes[this.currentNodeId];this.currentNodeId=(this.currentNodeId+1)%this.rpcNodes.length;const r=this.rpcNodes[this.currentNodeId];if(this.onError(e,t,r))throw e}}async getNonce(e,t=!0){const{nonce:r}=await this.call("chain.get_account_nonce",{account:e});if(!t)return r;const i=(0,o.decodeBase64url)(r),s=n.koinos.chain.value_type.decode(i),a=n.koinos.chain.value_type.toObject(s,{longs:String,defaults:!0});return Number(a.uint64_value)}async getAccountRc(e){const{rc:t}=await this.call("chain.get_account_rc",{account:e});return t||"0"}async getTransactionsById(e){return this.call("transaction_store.get_transactions_by_id",{transaction_ids:e})}async getBlocksById(e){return this.call("block_store.get_blocks_by_id",{block_ids:e,return_block:!0,return_receipt:!1})}async getHeadInfo(){return this.call("chain.get_head_info",{})}async getChainId(){const{chain_id:e}=await this.call("chain.get_chain_id",{});return e}async getBlocks(e,t=1,r){let n=r;return n||(n=(await this.getHeadInfo()).head_topology.id),(await this.call("block_store.get_blocks_by_height",{head_block_id:n,ancestor_start_height:e,num_blocks:t,return_block:!0,return_receipt:!1})).block_items}async getBlock(e){return(await this.getBlocks(e,1))[0]}async wait(e,t="byBlock",r=15e3){const n=Date.now();if("byTransactionId"===t){for(;Date.now()<n+r;){await i(1e3);const{transactions:t}=await this.getTransactionsById([e]);if(t&&t[0]&&t[0].containing_blocks)return t[0].containing_blocks[0]}throw new Error(`Transaction not mined after ${r} ms`)}const o=async(t,r,n)=>{const o=await this.getBlocks(t,r,n);let i=0;o.forEach((t=>{t&&t.block&&t.block_id&&t.block.transactions&&t.block.transactions.find((t=>t.id===e))&&(i=Number(t.block_height))}));const s=o[o.length-1].block_id;return[i,s]};let s=0,a=0,c="";for(;Date.now()<n+r;){await i(1e3);const{head_topology:e}=await this.getHeadInfo();if(0===s&&(s=Number(e.height),a=s),Number(e.height)===s-1&&c&&c!==e.id){const[t,r]=await o(a,Number(e.height)-a+1,e.id);if(t)return t;c=r,s=Number(e.height)+1}if(s>Number(e.height))continue;const[t,r]=await o(s,1,e.id);if(t)return t;c||(c=r),s+=1}throw new Error(`Transaction not mined after ${r} ms. Blocks checked from ${a} to ${s}`)}async sendTransaction(e,t=!0){const r=await this.call("chain.submit_transaction",{transaction:e,broadcast:t});return e.wait=async(t="byBlock",r=15e3)=>this.wait(e.id,t,r),{...r,transaction:e}}async submitBlock(e){return this.call("chain.submit_block",{block:e})}async readContract(e){return this.call("chain.read_contract",e)}}t.Provider=s,t.default=s},7187:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Serializer=void 0;const n=r(4492),o=r(8593),i="(koinos.btype)",s=["double","float","int32","int64","uint32","uint64","sint32","sint64","fixed32","fixed64","sfixed32","sfixed64","bool","string","bytes"];class a{constructor(e,t){this.bytesConversion=!0,this.types=e,this.root=n.Root.fromJSON(this.types),(null==t?void 0:t.defaultTypeName)&&(this.defaultType=this.root.lookupType(t.defaultTypeName)),t&&void 0!==t.bytesConversion&&(this.bytesConversion=t.bytesConversion)}btypeDecode(e,t){const r={};return Object.keys(t.fields).forEach((n=>{const{options:a,name:c,type:l,rule:u}=t.fields[n];if(!e[c])return;const p={type:l};if(a&&(a["(btype)"]?p.btype=a["(btype)"]:a[i]&&(p.btype=a[i])),"repeated"!==u)if(s.includes(l))r[c]=(0,o.btypeDecodeValue)(e[c],p);else{const t=this.root.lookupType(l);r[c]=this.btypeDecode(e[c],t)}else r[c]=e[c].map((e=>{if(!s.includes(l)){const t=this.root.lookupType(l);return this.btypeDecode(e,t)}return(0,o.btypeDecodeValue)(e,p)}))})),r}btypeEncode(e,t){const r={};return Object.keys(t.fields).forEach((n=>{const{options:a,name:c,type:l,rule:u}=t.fields[n];if(!e[c])return;const p={type:l};if(a&&(a["(btype)"]?p.btype=a["(btype)"]:a[i]&&(p.btype=a[i])),"repeated"!==u)if(s.includes(l))r[c]=(0,o.btypeEncodeValue)(e[c],p);else{const t=this.root.lookupType(l);r[c]=this.btypeEncode(e[c],t)}else r[c]=e[c].map((e=>{if(!s.includes(l)){const t=this.root.lookupType(l);return this.btypeEncode(e,t)}return(0,o.btypeEncodeValue)(e,p)}))})),r}async serialize(e,t,r){const n=this.defaultType||this.root.lookupType(t);let o={};o=(void 0===(null==r?void 0:r.bytesConversion)?this.bytesConversion:r.bytesConversion)?this.btypeDecode(e,n):e;const i=n.create(o);return n.encode(i).finish()}async deserialize(e,t,r){const n="string"==typeof e?(0,o.decodeBase64url)(e):e,i=this.defaultType||this.root.lookupType(t),s=i.decode(n),a=i.toObject(s,{longs:String,defaults:!0});return(void 0===(null==r?void 0:r.bytesConversion)?this.bytesConversion:r.bytesConversion)?this.btypeEncode(a,i):a}}t.Serializer=a,t.default=a},6991:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Signer=void 0;const s=r(3061),a=i(r(9656)),c=r(8593),l=r(9104),u={previous:{type:"bytes",btype:"BLOCK_ID"},height:{type:"uint64"},timestamp:{type:"uint64"},previous_state_merkle_root:{type:"bytes"},transaction_merkle_root:{type:"bytes"},signer:{type:"bytes",btype:"ADDRESS"}},p={chain_id:{type:"bytes"},rc_limit:{type:"uint64"},nonce:{type:"bytes"},operation_merkle_root:{type:"bytes"},payer:{type:"bytes",btype:"ADDRESS"},payee:{type:"bytes",btype:"ADDRESS"}},d={upload_contract:{type:"object",subtypes:{contract_id:{type:"bytes",btype:"CONTRACT_ID"},bytecode:{type:"bytes"},abi:{type:"string"},authorizes_call_contract:{type:"bool"},authorizes_transaction_application:{type:"bool"},authorizes_upload_contract:{type:"bool"}}},call_contract:{type:"object",subtypes:{contract_id:{type:"bytes",btype:"CONTRACT_ID"},entry_point:{type:"uint32"},args:{type:"bytes"}}},set_system_call:{type:"object",subtypes:{call_id:{type:"uint32"},target:{type:"object",subtypes:{thunk_id:{type:"uint32"},system_call_bundle:{type:"object",subtypes:{contract_id:{type:"bytes",btype:"CONTRACT_ID"},entry_point:{type:"uint32"}}}}}}}};class f{constructor(e){this.chainId="",this.compressed=void 0===e.compressed||e.compressed,this.privateKey=e.privateKey,this.provider=e.provider,e.privateKey,this.publicKey=a.getPublicKey(e.privateKey,this.compressed),this.address=(0,c.bitcoinAddress)(this.publicKey),e.chainId&&(this.chainId=e.chainId)}static fromWif(e,t=!0){const r=void 0===t?"5"!==e[0]:t,n=(0,c.bitcoinDecode)(e);return new f({privateKey:(0,c.toHexString)(n),compressed:r})}static fromSeed(e,t=!0){const r=(0,s.sha256)(e);return new f({privateKey:r,compressed:t})}getAddress(e=!0){if("string"==typeof this.privateKey){const t=a.getPublicKey(this.privateKey,e);return(0,c.bitcoinAddress)(t)}const t=a.getPublicKey(this.privateKey,e);return(0,c.bitcoinAddress)(t)}getPrivateKey(e="hex",t=!1){let r;r=this.privateKey instanceof Uint8Array?(0,c.toHexString)(this.privateKey):"string"==typeof this.privateKey?this.privateKey:BigInt(this.privateKey).toString(16).padStart(64,"0");const n=void 0===t?this.compressed:t;switch(e){case"hex":return r;case"wif":return(0,c.bitcoinEncode)((0,c.toUint8Array)(r),"private",n);default:throw new Error(`Invalid format ${e}`)}}async signHash(e){const[t,r]=await a.sign(e,this.privateKey,{recovered:!0,canonical:!0,der:!1}),n=new Uint8Array(65);return n.set([r+31],0),n.set(t,1),n}async signMessage(e){return this.signHash((0,s.sha256)(e))}async signTransaction(e,t){if(!e.id)throw new Error("Missing transaction id");const r=(0,c.toUint8Array)(e.id.slice(6)),n=await this.signHash(r);return e.signatures||(e.signatures=[]),e.signatures.push((0,c.encodeBase64url)(n)),e}async signBlock(e){if(!e.id)throw new Error("Missing block id");const t=(0,c.toUint8Array)(e.id.slice(6)),r=await this.signHash(t);return e.signature=(0,c.encodeBase64url)(r),e}async sendTransaction(e,t,r){var n;if(e.signatures&&(null===(n=e.signatures)||void 0===n?void 0:n.length)||(e=await this.signTransaction(e)),!this.provider)throw new Error("provider is undefined");return this.provider.sendTransaction(e,t)}static recoverPublicKey(e,t,r=!0){const n=(0,c.toHexString)(t),o=Number(`0x${n.slice(0,2)}`)-31,i=n.slice(2,66),s=n.slice(66),l=BigInt(`0x${i}`),u=BigInt(`0x${s}`),p=new a.Signature(l,u),d=a.recoverPublicKey((0,c.toHexString)(e),p.toHex(),o);if(!d)throw new Error("Public key cannot be recovered");return r?a.Point.fromHex(d).toHex(!0):(0,c.toHexString)(d)}static recoverAddress(e,t,r=!0){return(0,c.bitcoinAddress)((0,c.toUint8Array)(f.recoverPublicKey(e,t,r)))}async recoverPublicKeys(e,t){let r=!0;t&&void 0!==t.compressed&&(r=t.compressed);let n,o=[];const i=e;if(i.signature){if(!i.header)throw new Error("Missing block header");if(!i.signature)throw new Error("Missing block signature");o=[i.signature];const e=(0,c.btypeDecode)(i.header,u),t=l.koinos.protocol.block_header.create(e);n=l.koinos.protocol.block_header.encode(t).finish()}else{const t=e;if(!t.header)throw new Error("Missing transaction header");if(!t.signatures)throw new Error("Missing transaction signatures");o=t.signatures;const r=(0,c.btypeDecode)(t.header,p),i=l.koinos.protocol.transaction_header.create(r);n=l.koinos.protocol.transaction_header.encode(i).finish()}const a=(0,s.sha256)(n);return Promise.all(o.map((async e=>(t&&"function"==typeof t.transformSignature&&(e=await t.transformSignature(e)),f.recoverPublicKey(a,(0,c.decodeBase64url)(e),r)))))}async recoverAddresses(e,t){return(await this.recoverPublicKeys(e,t)).map((e=>(0,c.bitcoinAddress)((0,c.toUint8Array)(e))))}async prepareTransaction(e){var t,r;e.header||(e.header={});const n=null!==(t=e.header.payer)&&void 0!==t?t:this.address,{payee:o}=e.header;let i,a;if(void 0===e.header.nonce){if(!this.provider)throw new Error("Cannot get the nonce because provider is undefined. To skip this call set a nonce in the transaction header");const e=await this.provider.getNonce(o||n),t=l.koinos.chain.value_type.create({uint64_value:String(e+1)}),r=l.koinos.chain.value_type.encode(t).finish();i=(0,c.encodeBase64url)(r)}else i=e.header.nonce;if(void 0===e.header.rc_limit){if(!this.provider)throw new Error("Cannot get the rc_limit because provider is undefined. To skip this call set a rc_limit in the transaction header");a=await this.provider.getAccountRc(n)}else a=e.header.rc_limit;let u=e.header.chain_id||this.chainId;if(!u){if(!this.provider)throw new Error("Cannot get the chain_id because provider is undefined. To skip this call set a chain_id in the Signer");u=await this.provider.getChainId(),this.chainId=u}const f=[];if(e.operations)for(let t=0;t<(null===(r=e.operations)||void 0===r?void 0:r.length);t+=1){const r=(0,c.btypeDecode)(e.operations[t],d),n=l.koinos.protocol.operation.create(r),o=l.koinos.protocol.operation.encode(n).finish();f.push((0,s.sha256)(o))}const h=(0,c.encodeBase64url)(new Uint8Array([18,32,...(0,c.calculateMerkleRoot)(f)]));e.header={chain_id:u,rc_limit:a,nonce:i,operation_merkle_root:h,payer:n,...o&&{payee:o}};const y=(0,c.btypeDecode)(e.header,p),_=l.koinos.protocol.transaction_header.create(y),g=l.koinos.protocol.transaction_header.encode(_).finish(),b=(0,s.sha256)(g);return e.id=`0x1220${(0,c.toHexString)(b)}`,e}async prepareBlock(e){var t;e.header||(e.header={});const r=[];if(e.transactions)for(let n=0;n<e.transactions.length;n++){const o=e.transactions[n],i=(0,c.btypeDecode)(o.header,p),a=l.koinos.protocol.transaction_header.create(i),u=l.koinos.protocol.transaction_header.encode(a).finish();r.push((0,s.sha256)(u));let d=new Uint8Array;null===(t=o.signatures)||void 0===t||t.forEach((e=>{d=new Uint8Array([...d,...(0,c.decodeBase64url)(e)])})),r.push((0,s.sha256)(d))}let{height:n,previous:o,previous_state_merkle_root:i}=e.header;if(!n||!o||!i){if(!this.provider)throw new Error("Cannot get the head info because provider is undefined.");const e=await this.provider.getHeadInfo();n=n||`${Number(e.head_topology.height)+1}`,o=o||e.head_topology.id,i=i||e.head_state_merkle_root}e.header={height:n,previous:o,previous_state_merkle_root:i,timestamp:e.header.timestamp||`${Date.now()}`,transaction_merkle_root:(0,c.encodeBase64url)(new Uint8Array([18,32,...(0,c.calculateMerkleRoot)(r)])),signer:this.address};const a=(0,c.btypeDecode)(e.header,u),d=l.koinos.protocol.block_header.create(a),f=l.koinos.protocol.block_header.encode(d).finish(),h=(0,s.sha256)(f);return e.id=`0x1220${(0,c.toHexString)(h)}`,e}}t.Signer=f,t.default=f},5738:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const s=i(r(8593)),a=r(9822),c=r(6991),l=r(5635),u=r(7187);window.utils=s,window.Contract=a.Contract,window.Signer=c.Signer,window.Provider=l.Provider,window.Serializer=u.Serializer},8593:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.tokenAbi=t.btypeEncode=t.btypeDecode=t.btypeEncodeValue=t.btypeDecodeValue=t.parseUnits=t.formatUnits=t.bitcoinAddress=t.bitcoinDecode=t.bitcoinEncode=t.calculateMerkleRoot=t.decodeBase64=t.multihash=t.encodeBase64=t.decodeBase64url=t.encodeBase64url=t.decodeBase58=t.encodeBase58=t.toHexString=t.toUint8Array=void 0;const a=i(r(6957)),c=r(3061),l=r(830),u=s(r(6567));function p(e){const t=e.match(/[\dA-F]{2}/gi);if(!t)throw new Error("Invalid hex");return new Uint8Array(t.map((e=>parseInt(e,16))))}function d(e){return Array.from(e).map((e=>`0${Number(e).toString(16)}`.slice(-2))).join("")}function f(e){return(new TextDecoder).decode(a.encode("z",e)).slice(1)}function h(e){return a.decode(`z${e}`)}function y(e){return(new TextDecoder).decode(a.encode("U",e)).slice(1)}function _(e){return a.decode(`U${e}`)}function g(e,t,r=!1){let n,o,i;"public"===t?(n=new Uint8Array(25),o=new Uint8Array(21),n[0]=0,o[0]=0,i=21):(r?(n=new Uint8Array(38),o=new Uint8Array(34),i=34,n[33]=1,o[33]=1):(n=new Uint8Array(37),o=new Uint8Array(33),i=33),n[0]=128,o[0]=128),o.set(e,1);const s=(0,c.sha256)(o),a=(0,c.sha256)(s),l=new Uint8Array(4);return l.set(a.slice(0,4)),n.set(e,1),n.set(l,i),f(n)}function b(e){return"string"==typeof e||"number"==typeof e?e:JSON.parse(JSON.stringify(e))}function m(e,t){if("bytes"!==t.type)return b(e);const r=e;if(!t.btype)return _(r);switch(t.btype){case"BASE58":case"CONTRACT_ID":case"ADDRESS":return h(r);case"BASE64":return _(r);case"HEX":case"BLOCK_ID":case"TRANSACTION_ID":return p(r.slice(2));default:throw new Error(`unknown btype ${t.btype}`)}}function v(e,t){if("bytes"!==t.type)return b(e);const r=e;if(!t.btype)return y(r);switch(t.btype){case"BASE58":case"CONTRACT_ID":case"ADDRESS":return f(r);case"BASE64":return y(r);case"HEX":case"BLOCK_ID":case"TRANSACTION_ID":return`0x${d(r)}`;default:throw new Error(`unknown btype ${t.btype}`)}}t.toUint8Array=p,t.toHexString=d,t.encodeBase58=f,t.decodeBase58=h,t.encodeBase64url=y,t.decodeBase64url=_,t.encodeBase64=function(e){return(new TextDecoder).decode(a.encode("M",e)).slice(1)},t.multihash=function(e,t="sha2-256"){switch(t){case"sha2-256":return new Uint8Array([18,e.length,...e]);default:throw new Error(`multihash code ${t} not supported`)}},t.decodeBase64=function(e){return a.decode(`M${e}`)},t.calculateMerkleRoot=function(e){if(!e.length)return(0,c.sha256)(new Uint8Array);for(;e.length>1;){for(let t=0;t<e.length;t+=2)if(t+1<e.length){const r=e[t],n=e[t+1],o=(0,c.sha256)(new Uint8Array([...r,...n]));e[t/2]=new Uint8Array(o)}else e[t/2]=e[t];e=e.slice(0,Math.ceil(e.length/2))}return e[0]},t.bitcoinEncode=g,t.bitcoinDecode=function(e){const t=h(e),r=new Uint8Array(32),n=new Uint8Array(4);return r.set(t.slice(1,33)),"5"!==e[0]?n.set(t.slice(34,38)):n.set(t.slice(33,37)),r},t.bitcoinAddress=function(e){const t=(0,c.sha256)(e);return g((0,l.ripemd160)(t),"public")},t.formatUnits=function(e,t){let r="string"==typeof e?e:BigInt(e).toString();const n="-"===r[0]?"-":"";return r=r.replace("-","").padStart(t+1,"0"),`${n}${r.substring(0,r.length-t).replace(/^0+(?=\d)/,"")}.${r.substring(r.length-t)}`.replace(/(\.0+)?(0+)$/,"")},t.parseUnits=function(e,t){const r="-"===e[0]?"-":"";let[n,o]=e.replace("-","").replace(",",".").split(".");return o||(o=""),o=o.padEnd(t,"0"),`${r}${`${n}${o}`.replace(/^0+(?=\d)/,"")}`},t.btypeDecodeValue=m,t.btypeEncodeValue=v,t.btypeDecode=function e(t,r){if("object"!=typeof t)return t;const n={};return Object.keys(r).forEach((o=>{t[o]&&("repeated"===r[o].rule?n[o]=t[o].map((t=>r[o].subtypes?e(t,r[o].subtypes):m(t,r[o]))):r[o].subtypes?n[o]=e(t[o],r[o].subtypes):n[o]=m(t[o],r[o]))})),n},t.btypeEncode=function e(t,r){if("object"!=typeof t)return t;const n={};return Object.keys(r).forEach((o=>{t[o]&&("repeated"===r[o].rule?n[o]=t[o].map((t=>r[o].subtypes?e(t,r[o].subtypes):v(t,r[o]))):r[o].subtypes?n[o]=e(t[o],r[o].subtypes):n[o]=v(t[o],r[o]))})),n},t.tokenAbi={methods:{name:{entry_point:2191741823,argument:"name_arguments",return:"name_result",read_only:!0},symbol:{entry_point:3077209249,argument:"symbol_arguments",return:"symbol_result",read_only:!0},decimals:{entry_point:4001430831,argument:"decimals_arguments",return:"decimals_result",read_only:!0},totalSupply:{entry_point:2967091508,argument:"total_supply_arguments",return:"total_supply_result",read_only:!0},balanceOf:{entry_point:1550980247,argument:"balance_of_arguments",return:"balance_of_result",read_only:!0,default_output:{value:"0"}},transfer:{entry_point:670398154,argument:"transfer_arguments",return:"transfer_result"},mint:{entry_point:3698268091,argument:"mint_arguments",return:"mint_result"},burn:{entry_point:2241834181,argument:"burn_arguments",return:"burn_result"}},koilib_types:u.default}},9104:function(e,t,r){var n,o,i;o=[r(2100)],void 0===(i="function"==typeof(n=function(e){"use strict";var t,r,n,o,i,s=e.Reader,a=e.Writer,c=e.util,l=e.roots.default||(e.roots.default={});return l.koinos=((i={}).protocol=((n={}).event_data=function(){function t(e){if(this.impacted=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.sequence=0,t.prototype.source=c.newBuffer([]),t.prototype.name="",t.prototype.data=c.newBuffer([]),t.prototype.impacted=c.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.sequence&&Object.hasOwnProperty.call(e,"sequence")&&t.uint32(8).uint32(e.sequence),null!=e.source&&Object.hasOwnProperty.call(e,"source")&&t.uint32(18).bytes(e.source),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(26).string(e.name),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(34).bytes(e.data),null!=e.impacted&&e.impacted.length)for(var r=0;r<e.impacted.length;++r)t.uint32(42).bytes(e.impacted[r]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.event_data;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.sequence=e.uint32();break;case 2:n.source=e.bytes();break;case 3:n.name=e.string();break;case 4:n.data=e.bytes();break;case 5:n.impacted&&n.impacted.length||(n.impacted=[]),n.impacted.push(e.bytes());break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.sequence&&e.hasOwnProperty("sequence")&&!c.isInteger(e.sequence))return"sequence: integer expected";if(null!=e.source&&e.hasOwnProperty("source")&&!(e.source&&"number"==typeof e.source.length||c.isString(e.source)))return"source: buffer expected";if(null!=e.name&&e.hasOwnProperty("name")&&!c.isString(e.name))return"name: string expected";if(null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||c.isString(e.data)))return"data: buffer expected";if(null!=e.impacted&&e.hasOwnProperty("impacted")){if(!Array.isArray(e.impacted))return"impacted: array expected";for(var t=0;t<e.impacted.length;++t)if(!(e.impacted[t]&&"number"==typeof e.impacted[t].length||c.isString(e.impacted[t])))return"impacted: buffer[] expected"}return null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.event_data)return e;var t=new l.koinos.protocol.event_data;if(null!=e.sequence&&(t.sequence=e.sequence>>>0),null!=e.source&&("string"==typeof e.source?c.base64.decode(e.source,t.source=c.newBuffer(c.base64.length(e.source)),0):e.source.length>=0&&(t.source=e.source)),null!=e.name&&(t.name=String(e.name)),null!=e.data&&("string"==typeof e.data?c.base64.decode(e.data,t.data=c.newBuffer(c.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),e.impacted){if(!Array.isArray(e.impacted))throw TypeError(".koinos.protocol.event_data.impacted: array expected");t.impacted=[];for(var r=0;r<e.impacted.length;++r)"string"==typeof e.impacted[r]?c.base64.decode(e.impacted[r],t.impacted[r]=c.newBuffer(c.base64.length(e.impacted[r])),0):e.impacted[r].length>=0&&(t.impacted[r]=e.impacted[r])}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.impacted=[]),t.defaults&&(r.sequence=0,t.bytes===String?r.source="":(r.source=[],t.bytes!==Array&&(r.source=c.newBuffer(r.source))),r.name="",t.bytes===String?r.data="":(r.data=[],t.bytes!==Array&&(r.data=c.newBuffer(r.data)))),null!=e.sequence&&e.hasOwnProperty("sequence")&&(r.sequence=e.sequence),null!=e.source&&e.hasOwnProperty("source")&&(r.source=t.bytes===String?c.base64.encode(e.source,0,e.source.length):t.bytes===Array?Array.prototype.slice.call(e.source):e.source),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.data&&e.hasOwnProperty("data")&&(r.data=t.bytes===String?c.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.impacted&&e.impacted.length){r.impacted=[];for(var n=0;n<e.impacted.length;++n)r.impacted[n]=t.bytes===String?c.base64.encode(e.impacted[n],0,e.impacted[n].length):t.bytes===Array?Array.prototype.slice.call(e.impacted[n]):e.impacted[n]}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.event_data"},t}(),n.contract_call_bundle=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.contract_id=c.newBuffer([]),t.prototype.entry_point=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.contract_id&&Object.hasOwnProperty.call(e,"contract_id")&&t.uint32(10).bytes(e.contract_id),null!=e.entry_point&&Object.hasOwnProperty.call(e,"entry_point")&&t.uint32(16).uint32(e.entry_point),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.contract_call_bundle;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.contract_id=e.bytes();break;case 2:n.entry_point=e.uint32();break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.contract_id&&e.hasOwnProperty("contract_id")&&!(e.contract_id&&"number"==typeof e.contract_id.length||c.isString(e.contract_id))?"contract_id: buffer expected":null!=e.entry_point&&e.hasOwnProperty("entry_point")&&!c.isInteger(e.entry_point)?"entry_point: integer expected":null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.contract_call_bundle)return e;var t=new l.koinos.protocol.contract_call_bundle;return null!=e.contract_id&&("string"==typeof e.contract_id?c.base64.decode(e.contract_id,t.contract_id=c.newBuffer(c.base64.length(e.contract_id)),0):e.contract_id.length>=0&&(t.contract_id=e.contract_id)),null!=e.entry_point&&(t.entry_point=e.entry_point>>>0),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(t.bytes===String?r.contract_id="":(r.contract_id=[],t.bytes!==Array&&(r.contract_id=c.newBuffer(r.contract_id))),r.entry_point=0),null!=e.contract_id&&e.hasOwnProperty("contract_id")&&(r.contract_id=t.bytes===String?c.base64.encode(e.contract_id,0,e.contract_id.length):t.bytes===Array?Array.prototype.slice.call(e.contract_id):e.contract_id),null!=e.entry_point&&e.hasOwnProperty("entry_point")&&(r.entry_point=e.entry_point),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.contract_call_bundle"},t}(),n.system_call_target=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var r;return t.prototype.thunk_id=null,t.prototype.system_call_bundle=null,Object.defineProperty(t.prototype,"target",{get:c.oneOfGetter(r=["thunk_id","system_call_bundle"]),set:c.oneOfSetter(r)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.thunk_id&&Object.hasOwnProperty.call(e,"thunk_id")&&t.uint32(8).uint32(e.thunk_id),null!=e.system_call_bundle&&Object.hasOwnProperty.call(e,"system_call_bundle")&&l.koinos.protocol.contract_call_bundle.encode(e.system_call_bundle,t.uint32(18).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.system_call_target;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.thunk_id=e.uint32();break;case 2:n.system_call_bundle=l.koinos.protocol.contract_call_bundle.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.thunk_id&&e.hasOwnProperty("thunk_id")&&(t.target=1,!c.isInteger(e.thunk_id)))return"thunk_id: integer expected";if(null!=e.system_call_bundle&&e.hasOwnProperty("system_call_bundle")){if(1===t.target)return"target: multiple values";t.target=1;var r=l.koinos.protocol.contract_call_bundle.verify(e.system_call_bundle);if(r)return"system_call_bundle."+r}return null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.system_call_target)return e;var t=new l.koinos.protocol.system_call_target;if(null!=e.thunk_id&&(t.thunk_id=e.thunk_id>>>0),null!=e.system_call_bundle){if("object"!=typeof e.system_call_bundle)throw TypeError(".koinos.protocol.system_call_target.system_call_bundle: object expected");t.system_call_bundle=l.koinos.protocol.contract_call_bundle.fromObject(e.system_call_bundle)}return t},t.toObject=function(e,t){t||(t={});var r={};return null!=e.thunk_id&&e.hasOwnProperty("thunk_id")&&(r.thunk_id=e.thunk_id,t.oneofs&&(r.target="thunk_id")),null!=e.system_call_bundle&&e.hasOwnProperty("system_call_bundle")&&(r.system_call_bundle=l.koinos.protocol.contract_call_bundle.toObject(e.system_call_bundle,t),t.oneofs&&(r.target="system_call_bundle")),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.system_call_target"},t}(),n.upload_contract_operation=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.contract_id=c.newBuffer([]),t.prototype.bytecode=c.newBuffer([]),t.prototype.abi="",t.prototype.authorizes_call_contract=!1,t.prototype.authorizes_transaction_application=!1,t.prototype.authorizes_upload_contract=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.contract_id&&Object.hasOwnProperty.call(e,"contract_id")&&t.uint32(10).bytes(e.contract_id),null!=e.bytecode&&Object.hasOwnProperty.call(e,"bytecode")&&t.uint32(18).bytes(e.bytecode),null!=e.abi&&Object.hasOwnProperty.call(e,"abi")&&t.uint32(26).string(e.abi),null!=e.authorizes_call_contract&&Object.hasOwnProperty.call(e,"authorizes_call_contract")&&t.uint32(32).bool(e.authorizes_call_contract),null!=e.authorizes_transaction_application&&Object.hasOwnProperty.call(e,"authorizes_transaction_application")&&t.uint32(40).bool(e.authorizes_transaction_application),null!=e.authorizes_upload_contract&&Object.hasOwnProperty.call(e,"authorizes_upload_contract")&&t.uint32(48).bool(e.authorizes_upload_contract),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.upload_contract_operation;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.contract_id=e.bytes();break;case 2:n.bytecode=e.bytes();break;case 3:n.abi=e.string();break;case 4:n.authorizes_call_contract=e.bool();break;case 5:n.authorizes_transaction_application=e.bool();break;case 6:n.authorizes_upload_contract=e.bool();break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.contract_id&&e.hasOwnProperty("contract_id")&&!(e.contract_id&&"number"==typeof e.contract_id.length||c.isString(e.contract_id))?"contract_id: buffer expected":null!=e.bytecode&&e.hasOwnProperty("bytecode")&&!(e.bytecode&&"number"==typeof e.bytecode.length||c.isString(e.bytecode))?"bytecode: buffer expected":null!=e.abi&&e.hasOwnProperty("abi")&&!c.isString(e.abi)?"abi: string expected":null!=e.authorizes_call_contract&&e.hasOwnProperty("authorizes_call_contract")&&"boolean"!=typeof e.authorizes_call_contract?"authorizes_call_contract: boolean expected":null!=e.authorizes_transaction_application&&e.hasOwnProperty("authorizes_transaction_application")&&"boolean"!=typeof e.authorizes_transaction_application?"authorizes_transaction_application: boolean expected":null!=e.authorizes_upload_contract&&e.hasOwnProperty("authorizes_upload_contract")&&"boolean"!=typeof e.authorizes_upload_contract?"authorizes_upload_contract: boolean expected":null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.upload_contract_operation)return e;var t=new l.koinos.protocol.upload_contract_operation;return null!=e.contract_id&&("string"==typeof e.contract_id?c.base64.decode(e.contract_id,t.contract_id=c.newBuffer(c.base64.length(e.contract_id)),0):e.contract_id.length>=0&&(t.contract_id=e.contract_id)),null!=e.bytecode&&("string"==typeof e.bytecode?c.base64.decode(e.bytecode,t.bytecode=c.newBuffer(c.base64.length(e.bytecode)),0):e.bytecode.length>=0&&(t.bytecode=e.bytecode)),null!=e.abi&&(t.abi=String(e.abi)),null!=e.authorizes_call_contract&&(t.authorizes_call_contract=Boolean(e.authorizes_call_contract)),null!=e.authorizes_transaction_application&&(t.authorizes_transaction_application=Boolean(e.authorizes_transaction_application)),null!=e.authorizes_upload_contract&&(t.authorizes_upload_contract=Boolean(e.authorizes_upload_contract)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(t.bytes===String?r.contract_id="":(r.contract_id=[],t.bytes!==Array&&(r.contract_id=c.newBuffer(r.contract_id))),t.bytes===String?r.bytecode="":(r.bytecode=[],t.bytes!==Array&&(r.bytecode=c.newBuffer(r.bytecode))),r.abi="",r.authorizes_call_contract=!1,r.authorizes_transaction_application=!1,r.authorizes_upload_contract=!1),null!=e.contract_id&&e.hasOwnProperty("contract_id")&&(r.contract_id=t.bytes===String?c.base64.encode(e.contract_id,0,e.contract_id.length):t.bytes===Array?Array.prototype.slice.call(e.contract_id):e.contract_id),null!=e.bytecode&&e.hasOwnProperty("bytecode")&&(r.bytecode=t.bytes===String?c.base64.encode(e.bytecode,0,e.bytecode.length):t.bytes===Array?Array.prototype.slice.call(e.bytecode):e.bytecode),null!=e.abi&&e.hasOwnProperty("abi")&&(r.abi=e.abi),null!=e.authorizes_call_contract&&e.hasOwnProperty("authorizes_call_contract")&&(r.authorizes_call_contract=e.authorizes_call_contract),null!=e.authorizes_transaction_application&&e.hasOwnProperty("authorizes_transaction_application")&&(r.authorizes_transaction_application=e.authorizes_transaction_application),null!=e.authorizes_upload_contract&&e.hasOwnProperty("authorizes_upload_contract")&&(r.authorizes_upload_contract=e.authorizes_upload_contract),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.upload_contract_operation"},t}(),n.call_contract_operation=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.contract_id=c.newBuffer([]),t.prototype.entry_point=0,t.prototype.args=c.newBuffer([]),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.contract_id&&Object.hasOwnProperty.call(e,"contract_id")&&t.uint32(10).bytes(e.contract_id),null!=e.entry_point&&Object.hasOwnProperty.call(e,"entry_point")&&t.uint32(16).uint32(e.entry_point),null!=e.args&&Object.hasOwnProperty.call(e,"args")&&t.uint32(26).bytes(e.args),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.call_contract_operation;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.contract_id=e.bytes();break;case 2:n.entry_point=e.uint32();break;case 3:n.args=e.bytes();break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.contract_id&&e.hasOwnProperty("contract_id")&&!(e.contract_id&&"number"==typeof e.contract_id.length||c.isString(e.contract_id))?"contract_id: buffer expected":null!=e.entry_point&&e.hasOwnProperty("entry_point")&&!c.isInteger(e.entry_point)?"entry_point: integer expected":null!=e.args&&e.hasOwnProperty("args")&&!(e.args&&"number"==typeof e.args.length||c.isString(e.args))?"args: buffer expected":null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.call_contract_operation)return e;var t=new l.koinos.protocol.call_contract_operation;return null!=e.contract_id&&("string"==typeof e.contract_id?c.base64.decode(e.contract_id,t.contract_id=c.newBuffer(c.base64.length(e.contract_id)),0):e.contract_id.length>=0&&(t.contract_id=e.contract_id)),null!=e.entry_point&&(t.entry_point=e.entry_point>>>0),null!=e.args&&("string"==typeof e.args?c.base64.decode(e.args,t.args=c.newBuffer(c.base64.length(e.args)),0):e.args.length>=0&&(t.args=e.args)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(t.bytes===String?r.contract_id="":(r.contract_id=[],t.bytes!==Array&&(r.contract_id=c.newBuffer(r.contract_id))),r.entry_point=0,t.bytes===String?r.args="":(r.args=[],t.bytes!==Array&&(r.args=c.newBuffer(r.args)))),null!=e.contract_id&&e.hasOwnProperty("contract_id")&&(r.contract_id=t.bytes===String?c.base64.encode(e.contract_id,0,e.contract_id.length):t.bytes===Array?Array.prototype.slice.call(e.contract_id):e.contract_id),null!=e.entry_point&&e.hasOwnProperty("entry_point")&&(r.entry_point=e.entry_point),null!=e.args&&e.hasOwnProperty("args")&&(r.args=t.bytes===String?c.base64.encode(e.args,0,e.args.length):t.bytes===Array?Array.prototype.slice.call(e.args):e.args),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.call_contract_operation"},t}(),n.set_system_call_operation=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.call_id=0,t.prototype.target=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.call_id&&Object.hasOwnProperty.call(e,"call_id")&&t.uint32(8).uint32(e.call_id),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&l.koinos.protocol.system_call_target.encode(e.target,t.uint32(18).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.set_system_call_operation;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.call_id=e.uint32();break;case 2:n.target=l.koinos.protocol.system_call_target.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.call_id&&e.hasOwnProperty("call_id")&&!c.isInteger(e.call_id))return"call_id: integer expected";if(null!=e.target&&e.hasOwnProperty("target")){var t=l.koinos.protocol.system_call_target.verify(e.target);if(t)return"target."+t}return null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.set_system_call_operation)return e;var t=new l.koinos.protocol.set_system_call_operation;if(null!=e.call_id&&(t.call_id=e.call_id>>>0),null!=e.target){if("object"!=typeof e.target)throw TypeError(".koinos.protocol.set_system_call_operation.target: object expected");t.target=l.koinos.protocol.system_call_target.fromObject(e.target)}return t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.call_id=0,r.target=null),null!=e.call_id&&e.hasOwnProperty("call_id")&&(r.call_id=e.call_id),null!=e.target&&e.hasOwnProperty("target")&&(r.target=l.koinos.protocol.system_call_target.toObject(e.target,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.set_system_call_operation"},t}(),n.set_system_contract_operation=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.contract_id=c.newBuffer([]),t.prototype.system_contract=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.contract_id&&Object.hasOwnProperty.call(e,"contract_id")&&t.uint32(10).bytes(e.contract_id),null!=e.system_contract&&Object.hasOwnProperty.call(e,"system_contract")&&t.uint32(16).bool(e.system_contract),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.set_system_contract_operation;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.contract_id=e.bytes();break;case 2:n.system_contract=e.bool();break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.contract_id&&e.hasOwnProperty("contract_id")&&!(e.contract_id&&"number"==typeof e.contract_id.length||c.isString(e.contract_id))?"contract_id: buffer expected":null!=e.system_contract&&e.hasOwnProperty("system_contract")&&"boolean"!=typeof e.system_contract?"system_contract: boolean expected":null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.set_system_contract_operation)return e;var t=new l.koinos.protocol.set_system_contract_operation;return null!=e.contract_id&&("string"==typeof e.contract_id?c.base64.decode(e.contract_id,t.contract_id=c.newBuffer(c.base64.length(e.contract_id)),0):e.contract_id.length>=0&&(t.contract_id=e.contract_id)),null!=e.system_contract&&(t.system_contract=Boolean(e.system_contract)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(t.bytes===String?r.contract_id="":(r.contract_id=[],t.bytes!==Array&&(r.contract_id=c.newBuffer(r.contract_id))),r.system_contract=!1),null!=e.contract_id&&e.hasOwnProperty("contract_id")&&(r.contract_id=t.bytes===String?c.base64.encode(e.contract_id,0,e.contract_id.length):t.bytes===Array?Array.prototype.slice.call(e.contract_id):e.contract_id),null!=e.system_contract&&e.hasOwnProperty("system_contract")&&(r.system_contract=e.system_contract),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.set_system_contract_operation"},t}(),n.operation=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var r;return t.prototype.upload_contract=null,t.prototype.call_contract=null,t.prototype.set_system_call=null,t.prototype.set_system_contract=null,Object.defineProperty(t.prototype,"op",{get:c.oneOfGetter(r=["upload_contract","call_contract","set_system_call","set_system_contract"]),set:c.oneOfSetter(r)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.upload_contract&&Object.hasOwnProperty.call(e,"upload_contract")&&l.koinos.protocol.upload_contract_operation.encode(e.upload_contract,t.uint32(10).fork()).ldelim(),null!=e.call_contract&&Object.hasOwnProperty.call(e,"call_contract")&&l.koinos.protocol.call_contract_operation.encode(e.call_contract,t.uint32(18).fork()).ldelim(),null!=e.set_system_call&&Object.hasOwnProperty.call(e,"set_system_call")&&l.koinos.protocol.set_system_call_operation.encode(e.set_system_call,t.uint32(26).fork()).ldelim(),null!=e.set_system_contract&&Object.hasOwnProperty.call(e,"set_system_contract")&&l.koinos.protocol.set_system_contract_operation.encode(e.set_system_contract,t.uint32(34).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.operation;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.upload_contract=l.koinos.protocol.upload_contract_operation.decode(e,e.uint32());break;case 2:n.call_contract=l.koinos.protocol.call_contract_operation.decode(e,e.uint32());break;case 3:n.set_system_call=l.koinos.protocol.set_system_call_operation.decode(e,e.uint32());break;case 4:n.set_system_contract=l.koinos.protocol.set_system_contract_operation.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.upload_contract&&e.hasOwnProperty("upload_contract")&&(t.op=1,r=l.koinos.protocol.upload_contract_operation.verify(e.upload_contract)))return"upload_contract."+r;if(null!=e.call_contract&&e.hasOwnProperty("call_contract")){if(1===t.op)return"op: multiple values";if(t.op=1,r=l.koinos.protocol.call_contract_operation.verify(e.call_contract))return"call_contract."+r}if(null!=e.set_system_call&&e.hasOwnProperty("set_system_call")){if(1===t.op)return"op: multiple values";if(t.op=1,r=l.koinos.protocol.set_system_call_operation.verify(e.set_system_call))return"set_system_call."+r}if(null!=e.set_system_contract&&e.hasOwnProperty("set_system_contract")){if(1===t.op)return"op: multiple values";var r;if(t.op=1,r=l.koinos.protocol.set_system_contract_operation.verify(e.set_system_contract))return"set_system_contract."+r}return null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.operation)return e;var t=new l.koinos.protocol.operation;if(null!=e.upload_contract){if("object"!=typeof e.upload_contract)throw TypeError(".koinos.protocol.operation.upload_contract: object expected");t.upload_contract=l.koinos.protocol.upload_contract_operation.fromObject(e.upload_contract)}if(null!=e.call_contract){if("object"!=typeof e.call_contract)throw TypeError(".koinos.protocol.operation.call_contract: object expected");t.call_contract=l.koinos.protocol.call_contract_operation.fromObject(e.call_contract)}if(null!=e.set_system_call){if("object"!=typeof e.set_system_call)throw TypeError(".koinos.protocol.operation.set_system_call: object expected");t.set_system_call=l.koinos.protocol.set_system_call_operation.fromObject(e.set_system_call)}if(null!=e.set_system_contract){if("object"!=typeof e.set_system_contract)throw TypeError(".koinos.protocol.operation.set_system_contract: object expected");t.set_system_contract=l.koinos.protocol.set_system_contract_operation.fromObject(e.set_system_contract)}return t},t.toObject=function(e,t){t||(t={});var r={};return null!=e.upload_contract&&e.hasOwnProperty("upload_contract")&&(r.upload_contract=l.koinos.protocol.upload_contract_operation.toObject(e.upload_contract,t),t.oneofs&&(r.op="upload_contract")),null!=e.call_contract&&e.hasOwnProperty("call_contract")&&(r.call_contract=l.koinos.protocol.call_contract_operation.toObject(e.call_contract,t),t.oneofs&&(r.op="call_contract")),null!=e.set_system_call&&e.hasOwnProperty("set_system_call")&&(r.set_system_call=l.koinos.protocol.set_system_call_operation.toObject(e.set_system_call,t),t.oneofs&&(r.op="set_system_call")),null!=e.set_system_contract&&e.hasOwnProperty("set_system_contract")&&(r.set_system_contract=l.koinos.protocol.set_system_contract_operation.toObject(e.set_system_contract,t),t.oneofs&&(r.op="set_system_contract")),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.operation"},t}(),n.transaction_header=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.chain_id=c.newBuffer([]),t.prototype.rc_limit=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.nonce=c.newBuffer([]),t.prototype.operation_merkle_root=c.newBuffer([]),t.prototype.payer=c.newBuffer([]),t.prototype.payee=c.newBuffer([]),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.chain_id&&Object.hasOwnProperty.call(e,"chain_id")&&t.uint32(10).bytes(e.chain_id),null!=e.rc_limit&&Object.hasOwnProperty.call(e,"rc_limit")&&t.uint32(16).uint64(e.rc_limit),null!=e.nonce&&Object.hasOwnProperty.call(e,"nonce")&&t.uint32(26).bytes(e.nonce),null!=e.operation_merkle_root&&Object.hasOwnProperty.call(e,"operation_merkle_root")&&t.uint32(34).bytes(e.operation_merkle_root),null!=e.payer&&Object.hasOwnProperty.call(e,"payer")&&t.uint32(42).bytes(e.payer),null!=e.payee&&Object.hasOwnProperty.call(e,"payee")&&t.uint32(50).bytes(e.payee),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.transaction_header;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.chain_id=e.bytes();break;case 2:n.rc_limit=e.uint64();break;case 3:n.nonce=e.bytes();break;case 4:n.operation_merkle_root=e.bytes();break;case 5:n.payer=e.bytes();break;case 6:n.payee=e.bytes();break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.chain_id&&e.hasOwnProperty("chain_id")&&!(e.chain_id&&"number"==typeof e.chain_id.length||c.isString(e.chain_id))?"chain_id: buffer expected":null!=e.rc_limit&&e.hasOwnProperty("rc_limit")&&!(c.isInteger(e.rc_limit)||e.rc_limit&&c.isInteger(e.rc_limit.low)&&c.isInteger(e.rc_limit.high))?"rc_limit: integer|Long expected":null!=e.nonce&&e.hasOwnProperty("nonce")&&!(e.nonce&&"number"==typeof e.nonce.length||c.isString(e.nonce))?"nonce: buffer expected":null!=e.operation_merkle_root&&e.hasOwnProperty("operation_merkle_root")&&!(e.operation_merkle_root&&"number"==typeof e.operation_merkle_root.length||c.isString(e.operation_merkle_root))?"operation_merkle_root: buffer expected":null!=e.payer&&e.hasOwnProperty("payer")&&!(e.payer&&"number"==typeof e.payer.length||c.isString(e.payer))?"payer: buffer expected":null!=e.payee&&e.hasOwnProperty("payee")&&!(e.payee&&"number"==typeof e.payee.length||c.isString(e.payee))?"payee: buffer expected":null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.transaction_header)return e;var t=new l.koinos.protocol.transaction_header;return null!=e.chain_id&&("string"==typeof e.chain_id?c.base64.decode(e.chain_id,t.chain_id=c.newBuffer(c.base64.length(e.chain_id)),0):e.chain_id.length>=0&&(t.chain_id=e.chain_id)),null!=e.rc_limit&&(c.Long?(t.rc_limit=c.Long.fromValue(e.rc_limit)).unsigned=!0:"string"==typeof e.rc_limit?t.rc_limit=parseInt(e.rc_limit,10):"number"==typeof e.rc_limit?t.rc_limit=e.rc_limit:"object"==typeof e.rc_limit&&(t.rc_limit=new c.LongBits(e.rc_limit.low>>>0,e.rc_limit.high>>>0).toNumber(!0))),null!=e.nonce&&("string"==typeof e.nonce?c.base64.decode(e.nonce,t.nonce=c.newBuffer(c.base64.length(e.nonce)),0):e.nonce.length>=0&&(t.nonce=e.nonce)),null!=e.operation_merkle_root&&("string"==typeof e.operation_merkle_root?c.base64.decode(e.operation_merkle_root,t.operation_merkle_root=c.newBuffer(c.base64.length(e.operation_merkle_root)),0):e.operation_merkle_root.length>=0&&(t.operation_merkle_root=e.operation_merkle_root)),null!=e.payer&&("string"==typeof e.payer?c.base64.decode(e.payer,t.payer=c.newBuffer(c.base64.length(e.payer)),0):e.payer.length>=0&&(t.payer=e.payer)),null!=e.payee&&("string"==typeof e.payee?c.base64.decode(e.payee,t.payee=c.newBuffer(c.base64.length(e.payee)),0):e.payee.length>=0&&(t.payee=e.payee)),t},t.toObject=function(e,t){t||(t={});var r={};if(t.defaults){if(t.bytes===String?r.chain_id="":(r.chain_id=[],t.bytes!==Array&&(r.chain_id=c.newBuffer(r.chain_id))),c.Long){var n=new c.Long(0,0,!0);r.rc_limit=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.rc_limit=t.longs===String?"0":0;t.bytes===String?r.nonce="":(r.nonce=[],t.bytes!==Array&&(r.nonce=c.newBuffer(r.nonce))),t.bytes===String?r.operation_merkle_root="":(r.operation_merkle_root=[],t.bytes!==Array&&(r.operation_merkle_root=c.newBuffer(r.operation_merkle_root))),t.bytes===String?r.payer="":(r.payer=[],t.bytes!==Array&&(r.payer=c.newBuffer(r.payer))),t.bytes===String?r.payee="":(r.payee=[],t.bytes!==Array&&(r.payee=c.newBuffer(r.payee)))}return null!=e.chain_id&&e.hasOwnProperty("chain_id")&&(r.chain_id=t.bytes===String?c.base64.encode(e.chain_id,0,e.chain_id.length):t.bytes===Array?Array.prototype.slice.call(e.chain_id):e.chain_id),null!=e.rc_limit&&e.hasOwnProperty("rc_limit")&&("number"==typeof e.rc_limit?r.rc_limit=t.longs===String?String(e.rc_limit):e.rc_limit:r.rc_limit=t.longs===String?c.Long.prototype.toString.call(e.rc_limit):t.longs===Number?new c.LongBits(e.rc_limit.low>>>0,e.rc_limit.high>>>0).toNumber(!0):e.rc_limit),null!=e.nonce&&e.hasOwnProperty("nonce")&&(r.nonce=t.bytes===String?c.base64.encode(e.nonce,0,e.nonce.length):t.bytes===Array?Array.prototype.slice.call(e.nonce):e.nonce),null!=e.operation_merkle_root&&e.hasOwnProperty("operation_merkle_root")&&(r.operation_merkle_root=t.bytes===String?c.base64.encode(e.operation_merkle_root,0,e.operation_merkle_root.length):t.bytes===Array?Array.prototype.slice.call(e.operation_merkle_root):e.operation_merkle_root),null!=e.payer&&e.hasOwnProperty("payer")&&(r.payer=t.bytes===String?c.base64.encode(e.payer,0,e.payer.length):t.bytes===Array?Array.prototype.slice.call(e.payer):e.payer),null!=e.payee&&e.hasOwnProperty("payee")&&(r.payee=t.bytes===String?c.base64.encode(e.payee,0,e.payee.length):t.bytes===Array?Array.prototype.slice.call(e.payee):e.payee),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.transaction_header"},t}(),n.transaction=function(){function t(e){if(this.operations=[],this.signatures=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.id=c.newBuffer([]),t.prototype.header=null,t.prototype.operations=c.emptyArray,t.prototype.signatures=c.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).bytes(e.id),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&l.koinos.protocol.transaction_header.encode(e.header,t.uint32(18).fork()).ldelim(),null!=e.operations&&e.operations.length)for(var r=0;r<e.operations.length;++r)l.koinos.protocol.operation.encode(e.operations[r],t.uint32(26).fork()).ldelim();if(null!=e.signatures&&e.signatures.length)for(r=0;r<e.signatures.length;++r)t.uint32(34).bytes(e.signatures[r]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.transaction;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.id=e.bytes();break;case 2:n.header=l.koinos.protocol.transaction_header.decode(e,e.uint32());break;case 3:n.operations&&n.operations.length||(n.operations=[]),n.operations.push(l.koinos.protocol.operation.decode(e,e.uint32()));break;case 4:n.signatures&&n.signatures.length||(n.signatures=[]),n.signatures.push(e.bytes());break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!(e.id&&"number"==typeof e.id.length||c.isString(e.id)))return"id: buffer expected";if(null!=e.header&&e.hasOwnProperty("header")&&(r=l.koinos.protocol.transaction_header.verify(e.header)))return"header."+r;if(null!=e.operations&&e.hasOwnProperty("operations")){if(!Array.isArray(e.operations))return"operations: array expected";for(var t=0;t<e.operations.length;++t){var r;if(r=l.koinos.protocol.operation.verify(e.operations[t]))return"operations."+r}}if(null!=e.signatures&&e.hasOwnProperty("signatures")){if(!Array.isArray(e.signatures))return"signatures: array expected";for(t=0;t<e.signatures.length;++t)if(!(e.signatures[t]&&"number"==typeof e.signatures[t].length||c.isString(e.signatures[t])))return"signatures: buffer[] expected"}return null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.transaction)return e;var t=new l.koinos.protocol.transaction;if(null!=e.id&&("string"==typeof e.id?c.base64.decode(e.id,t.id=c.newBuffer(c.base64.length(e.id)),0):e.id.length>=0&&(t.id=e.id)),null!=e.header){if("object"!=typeof e.header)throw TypeError(".koinos.protocol.transaction.header: object expected");t.header=l.koinos.protocol.transaction_header.fromObject(e.header)}if(e.operations){if(!Array.isArray(e.operations))throw TypeError(".koinos.protocol.transaction.operations: array expected");t.operations=[];for(var r=0;r<e.operations.length;++r){if("object"!=typeof e.operations[r])throw TypeError(".koinos.protocol.transaction.operations: object expected");t.operations[r]=l.koinos.protocol.operation.fromObject(e.operations[r])}}if(e.signatures){if(!Array.isArray(e.signatures))throw TypeError(".koinos.protocol.transaction.signatures: array expected");for(t.signatures=[],r=0;r<e.signatures.length;++r)"string"==typeof e.signatures[r]?c.base64.decode(e.signatures[r],t.signatures[r]=c.newBuffer(c.base64.length(e.signatures[r])),0):e.signatures[r].length>=0&&(t.signatures[r]=e.signatures[r])}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.operations=[],r.signatures=[]),t.defaults&&(t.bytes===String?r.id="":(r.id=[],t.bytes!==Array&&(r.id=c.newBuffer(r.id))),r.header=null),null!=e.id&&e.hasOwnProperty("id")&&(r.id=t.bytes===String?c.base64.encode(e.id,0,e.id.length):t.bytes===Array?Array.prototype.slice.call(e.id):e.id),null!=e.header&&e.hasOwnProperty("header")&&(r.header=l.koinos.protocol.transaction_header.toObject(e.header,t)),e.operations&&e.operations.length){r.operations=[];for(var n=0;n<e.operations.length;++n)r.operations[n]=l.koinos.protocol.operation.toObject(e.operations[n],t)}if(e.signatures&&e.signatures.length)for(r.signatures=[],n=0;n<e.signatures.length;++n)r.signatures[n]=t.bytes===String?c.base64.encode(e.signatures[n],0,e.signatures[n].length):t.bytes===Array?Array.prototype.slice.call(e.signatures[n]):e.signatures[n];return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.transaction"},t}(),n.transaction_receipt=function(){function t(e){if(this.events=[],this.logs=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.id=c.newBuffer([]),t.prototype.payer=c.newBuffer([]),t.prototype.max_payer_rc=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.rc_limit=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.rc_used=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.disk_storage_used=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.network_bandwidth_used=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.compute_bandwidth_used=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.reverted=!1,t.prototype.events=c.emptyArray,t.prototype.logs=c.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).bytes(e.id),null!=e.payer&&Object.hasOwnProperty.call(e,"payer")&&t.uint32(18).bytes(e.payer),null!=e.max_payer_rc&&Object.hasOwnProperty.call(e,"max_payer_rc")&&t.uint32(24).uint64(e.max_payer_rc),null!=e.rc_limit&&Object.hasOwnProperty.call(e,"rc_limit")&&t.uint32(32).uint64(e.rc_limit),null!=e.rc_used&&Object.hasOwnProperty.call(e,"rc_used")&&t.uint32(40).uint64(e.rc_used),null!=e.disk_storage_used&&Object.hasOwnProperty.call(e,"disk_storage_used")&&t.uint32(48).uint64(e.disk_storage_used),null!=e.network_bandwidth_used&&Object.hasOwnProperty.call(e,"network_bandwidth_used")&&t.uint32(56).uint64(e.network_bandwidth_used),null!=e.compute_bandwidth_used&&Object.hasOwnProperty.call(e,"compute_bandwidth_used")&&t.uint32(64).uint64(e.compute_bandwidth_used),null!=e.reverted&&Object.hasOwnProperty.call(e,"reverted")&&t.uint32(72).bool(e.reverted),null!=e.events&&e.events.length)for(var r=0;r<e.events.length;++r)l.koinos.protocol.event_data.encode(e.events[r],t.uint32(82).fork()).ldelim();if(null!=e.logs&&e.logs.length)for(r=0;r<e.logs.length;++r)t.uint32(90).string(e.logs[r]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.transaction_receipt;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.id=e.bytes();break;case 2:n.payer=e.bytes();break;case 3:n.max_payer_rc=e.uint64();break;case 4:n.rc_limit=e.uint64();break;case 5:n.rc_used=e.uint64();break;case 6:n.disk_storage_used=e.uint64();break;case 7:n.network_bandwidth_used=e.uint64();break;case 8:n.compute_bandwidth_used=e.uint64();break;case 9:n.reverted=e.bool();break;case 10:n.events&&n.events.length||(n.events=[]),n.events.push(l.koinos.protocol.event_data.decode(e,e.uint32()));break;case 11:n.logs&&n.logs.length||(n.logs=[]),n.logs.push(e.string());break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!(e.id&&"number"==typeof e.id.length||c.isString(e.id)))return"id: buffer expected";if(null!=e.payer&&e.hasOwnProperty("payer")&&!(e.payer&&"number"==typeof e.payer.length||c.isString(e.payer)))return"payer: buffer expected";if(null!=e.max_payer_rc&&e.hasOwnProperty("max_payer_rc")&&!(c.isInteger(e.max_payer_rc)||e.max_payer_rc&&c.isInteger(e.max_payer_rc.low)&&c.isInteger(e.max_payer_rc.high)))return"max_payer_rc: integer|Long expected";if(null!=e.rc_limit&&e.hasOwnProperty("rc_limit")&&!(c.isInteger(e.rc_limit)||e.rc_limit&&c.isInteger(e.rc_limit.low)&&c.isInteger(e.rc_limit.high)))return"rc_limit: integer|Long expected";if(null!=e.rc_used&&e.hasOwnProperty("rc_used")&&!(c.isInteger(e.rc_used)||e.rc_used&&c.isInteger(e.rc_used.low)&&c.isInteger(e.rc_used.high)))return"rc_used: integer|Long expected";if(null!=e.disk_storage_used&&e.hasOwnProperty("disk_storage_used")&&!(c.isInteger(e.disk_storage_used)||e.disk_storage_used&&c.isInteger(e.disk_storage_used.low)&&c.isInteger(e.disk_storage_used.high)))return"disk_storage_used: integer|Long expected";if(null!=e.network_bandwidth_used&&e.hasOwnProperty("network_bandwidth_used")&&!(c.isInteger(e.network_bandwidth_used)||e.network_bandwidth_used&&c.isInteger(e.network_bandwidth_used.low)&&c.isInteger(e.network_bandwidth_used.high)))return"network_bandwidth_used: integer|Long expected";if(null!=e.compute_bandwidth_used&&e.hasOwnProperty("compute_bandwidth_used")&&!(c.isInteger(e.compute_bandwidth_used)||e.compute_bandwidth_used&&c.isInteger(e.compute_bandwidth_used.low)&&c.isInteger(e.compute_bandwidth_used.high)))return"compute_bandwidth_used: integer|Long expected";if(null!=e.reverted&&e.hasOwnProperty("reverted")&&"boolean"!=typeof e.reverted)return"reverted: boolean expected";if(null!=e.events&&e.hasOwnProperty("events")){if(!Array.isArray(e.events))return"events: array expected";for(var t=0;t<e.events.length;++t){var r=l.koinos.protocol.event_data.verify(e.events[t]);if(r)return"events."+r}}if(null!=e.logs&&e.hasOwnProperty("logs")){if(!Array.isArray(e.logs))return"logs: array expected";for(t=0;t<e.logs.length;++t)if(!c.isString(e.logs[t]))return"logs: string[] expected"}return null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.transaction_receipt)return e;var t=new l.koinos.protocol.transaction_receipt;if(null!=e.id&&("string"==typeof e.id?c.base64.decode(e.id,t.id=c.newBuffer(c.base64.length(e.id)),0):e.id.length>=0&&(t.id=e.id)),null!=e.payer&&("string"==typeof e.payer?c.base64.decode(e.payer,t.payer=c.newBuffer(c.base64.length(e.payer)),0):e.payer.length>=0&&(t.payer=e.payer)),null!=e.max_payer_rc&&(c.Long?(t.max_payer_rc=c.Long.fromValue(e.max_payer_rc)).unsigned=!0:"string"==typeof e.max_payer_rc?t.max_payer_rc=parseInt(e.max_payer_rc,10):"number"==typeof e.max_payer_rc?t.max_payer_rc=e.max_payer_rc:"object"==typeof e.max_payer_rc&&(t.max_payer_rc=new c.LongBits(e.max_payer_rc.low>>>0,e.max_payer_rc.high>>>0).toNumber(!0))),null!=e.rc_limit&&(c.Long?(t.rc_limit=c.Long.fromValue(e.rc_limit)).unsigned=!0:"string"==typeof e.rc_limit?t.rc_limit=parseInt(e.rc_limit,10):"number"==typeof e.rc_limit?t.rc_limit=e.rc_limit:"object"==typeof e.rc_limit&&(t.rc_limit=new c.LongBits(e.rc_limit.low>>>0,e.rc_limit.high>>>0).toNumber(!0))),null!=e.rc_used&&(c.Long?(t.rc_used=c.Long.fromValue(e.rc_used)).unsigned=!0:"string"==typeof e.rc_used?t.rc_used=parseInt(e.rc_used,10):"number"==typeof e.rc_used?t.rc_used=e.rc_used:"object"==typeof e.rc_used&&(t.rc_used=new c.LongBits(e.rc_used.low>>>0,e.rc_used.high>>>0).toNumber(!0))),null!=e.disk_storage_used&&(c.Long?(t.disk_storage_used=c.Long.fromValue(e.disk_storage_used)).unsigned=!0:"string"==typeof e.disk_storage_used?t.disk_storage_used=parseInt(e.disk_storage_used,10):"number"==typeof e.disk_storage_used?t.disk_storage_used=e.disk_storage_used:"object"==typeof e.disk_storage_used&&(t.disk_storage_used=new c.LongBits(e.disk_storage_used.low>>>0,e.disk_storage_used.high>>>0).toNumber(!0))),null!=e.network_bandwidth_used&&(c.Long?(t.network_bandwidth_used=c.Long.fromValue(e.network_bandwidth_used)).unsigned=!0:"string"==typeof e.network_bandwidth_used?t.network_bandwidth_used=parseInt(e.network_bandwidth_used,10):"number"==typeof e.network_bandwidth_used?t.network_bandwidth_used=e.network_bandwidth_used:"object"==typeof e.network_bandwidth_used&&(t.network_bandwidth_used=new c.LongBits(e.network_bandwidth_used.low>>>0,e.network_bandwidth_used.high>>>0).toNumber(!0))),null!=e.compute_bandwidth_used&&(c.Long?(t.compute_bandwidth_used=c.Long.fromValue(e.compute_bandwidth_used)).unsigned=!0:"string"==typeof e.compute_bandwidth_used?t.compute_bandwidth_used=parseInt(e.compute_bandwidth_used,10):"number"==typeof e.compute_bandwidth_used?t.compute_bandwidth_used=e.compute_bandwidth_used:"object"==typeof e.compute_bandwidth_used&&(t.compute_bandwidth_used=new c.LongBits(e.compute_bandwidth_used.low>>>0,e.compute_bandwidth_used.high>>>0).toNumber(!0))),null!=e.reverted&&(t.reverted=Boolean(e.reverted)),e.events){if(!Array.isArray(e.events))throw TypeError(".koinos.protocol.transaction_receipt.events: array expected");t.events=[];for(var r=0;r<e.events.length;++r){if("object"!=typeof e.events[r])throw TypeError(".koinos.protocol.transaction_receipt.events: object expected");t.events[r]=l.koinos.protocol.event_data.fromObject(e.events[r])}}if(e.logs){if(!Array.isArray(e.logs))throw TypeError(".koinos.protocol.transaction_receipt.logs: array expected");for(t.logs=[],r=0;r<e.logs.length;++r)t.logs[r]=String(e.logs[r])}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.events=[],r.logs=[]),t.defaults){if(t.bytes===String?r.id="":(r.id=[],t.bytes!==Array&&(r.id=c.newBuffer(r.id))),t.bytes===String?r.payer="":(r.payer=[],t.bytes!==Array&&(r.payer=c.newBuffer(r.payer))),c.Long){var n=new c.Long(0,0,!0);r.max_payer_rc=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.max_payer_rc=t.longs===String?"0":0;c.Long?(n=new c.Long(0,0,!0),r.rc_limit=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.rc_limit=t.longs===String?"0":0,c.Long?(n=new c.Long(0,0,!0),r.rc_used=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.rc_used=t.longs===String?"0":0,c.Long?(n=new c.Long(0,0,!0),r.disk_storage_used=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.disk_storage_used=t.longs===String?"0":0,c.Long?(n=new c.Long(0,0,!0),r.network_bandwidth_used=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.network_bandwidth_used=t.longs===String?"0":0,c.Long?(n=new c.Long(0,0,!0),r.compute_bandwidth_used=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.compute_bandwidth_used=t.longs===String?"0":0,r.reverted=!1}if(null!=e.id&&e.hasOwnProperty("id")&&(r.id=t.bytes===String?c.base64.encode(e.id,0,e.id.length):t.bytes===Array?Array.prototype.slice.call(e.id):e.id),null!=e.payer&&e.hasOwnProperty("payer")&&(r.payer=t.bytes===String?c.base64.encode(e.payer,0,e.payer.length):t.bytes===Array?Array.prototype.slice.call(e.payer):e.payer),null!=e.max_payer_rc&&e.hasOwnProperty("max_payer_rc")&&("number"==typeof e.max_payer_rc?r.max_payer_rc=t.longs===String?String(e.max_payer_rc):e.max_payer_rc:r.max_payer_rc=t.longs===String?c.Long.prototype.toString.call(e.max_payer_rc):t.longs===Number?new c.LongBits(e.max_payer_rc.low>>>0,e.max_payer_rc.high>>>0).toNumber(!0):e.max_payer_rc),null!=e.rc_limit&&e.hasOwnProperty("rc_limit")&&("number"==typeof e.rc_limit?r.rc_limit=t.longs===String?String(e.rc_limit):e.rc_limit:r.rc_limit=t.longs===String?c.Long.prototype.toString.call(e.rc_limit):t.longs===Number?new c.LongBits(e.rc_limit.low>>>0,e.rc_limit.high>>>0).toNumber(!0):e.rc_limit),null!=e.rc_used&&e.hasOwnProperty("rc_used")&&("number"==typeof e.rc_used?r.rc_used=t.longs===String?String(e.rc_used):e.rc_used:r.rc_used=t.longs===String?c.Long.prototype.toString.call(e.rc_used):t.longs===Number?new c.LongBits(e.rc_used.low>>>0,e.rc_used.high>>>0).toNumber(!0):e.rc_used),null!=e.disk_storage_used&&e.hasOwnProperty("disk_storage_used")&&("number"==typeof e.disk_storage_used?r.disk_storage_used=t.longs===String?String(e.disk_storage_used):e.disk_storage_used:r.disk_storage_used=t.longs===String?c.Long.prototype.toString.call(e.disk_storage_used):t.longs===Number?new c.LongBits(e.disk_storage_used.low>>>0,e.disk_storage_used.high>>>0).toNumber(!0):e.disk_storage_used),null!=e.network_bandwidth_used&&e.hasOwnProperty("network_bandwidth_used")&&("number"==typeof e.network_bandwidth_used?r.network_bandwidth_used=t.longs===String?String(e.network_bandwidth_used):e.network_bandwidth_used:r.network_bandwidth_used=t.longs===String?c.Long.prototype.toString.call(e.network_bandwidth_used):t.longs===Number?new c.LongBits(e.network_bandwidth_used.low>>>0,e.network_bandwidth_used.high>>>0).toNumber(!0):e.network_bandwidth_used),null!=e.compute_bandwidth_used&&e.hasOwnProperty("compute_bandwidth_used")&&("number"==typeof e.compute_bandwidth_used?r.compute_bandwidth_used=t.longs===String?String(e.compute_bandwidth_used):e.compute_bandwidth_used:r.compute_bandwidth_used=t.longs===String?c.Long.prototype.toString.call(e.compute_bandwidth_used):t.longs===Number?new c.LongBits(e.compute_bandwidth_used.low>>>0,e.compute_bandwidth_used.high>>>0).toNumber(!0):e.compute_bandwidth_used),null!=e.reverted&&e.hasOwnProperty("reverted")&&(r.reverted=e.reverted),e.events&&e.events.length){r.events=[];for(var o=0;o<e.events.length;++o)r.events[o]=l.koinos.protocol.event_data.toObject(e.events[o],t)}if(e.logs&&e.logs.length)for(r.logs=[],o=0;o<e.logs.length;++o)r.logs[o]=e.logs[o];return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.transaction_receipt"},t}(),n.block_header=function(){function t(e){if(this.approved_proposals=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.previous=c.newBuffer([]),t.prototype.height=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.timestamp=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.previous_state_merkle_root=c.newBuffer([]),t.prototype.transaction_merkle_root=c.newBuffer([]),t.prototype.signer=c.newBuffer([]),t.prototype.approved_proposals=c.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.previous&&Object.hasOwnProperty.call(e,"previous")&&t.uint32(10).bytes(e.previous),null!=e.height&&Object.hasOwnProperty.call(e,"height")&&t.uint32(16).uint64(e.height),null!=e.timestamp&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(24).uint64(e.timestamp),null!=e.previous_state_merkle_root&&Object.hasOwnProperty.call(e,"previous_state_merkle_root")&&t.uint32(34).bytes(e.previous_state_merkle_root),null!=e.transaction_merkle_root&&Object.hasOwnProperty.call(e,"transaction_merkle_root")&&t.uint32(42).bytes(e.transaction_merkle_root),null!=e.signer&&Object.hasOwnProperty.call(e,"signer")&&t.uint32(50).bytes(e.signer),null!=e.approved_proposals&&e.approved_proposals.length)for(var r=0;r<e.approved_proposals.length;++r)t.uint32(58).bytes(e.approved_proposals[r]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.block_header;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.previous=e.bytes();break;case 2:n.height=e.uint64();break;case 3:n.timestamp=e.uint64();break;case 4:n.previous_state_merkle_root=e.bytes();break;case 5:n.transaction_merkle_root=e.bytes();break;case 6:n.signer=e.bytes();break;case 7:n.approved_proposals&&n.approved_proposals.length||(n.approved_proposals=[]),n.approved_proposals.push(e.bytes());break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.previous&&e.hasOwnProperty("previous")&&!(e.previous&&"number"==typeof e.previous.length||c.isString(e.previous)))return"previous: buffer expected";if(null!=e.height&&e.hasOwnProperty("height")&&!(c.isInteger(e.height)||e.height&&c.isInteger(e.height.low)&&c.isInteger(e.height.high)))return"height: integer|Long expected";if(null!=e.timestamp&&e.hasOwnProperty("timestamp")&&!(c.isInteger(e.timestamp)||e.timestamp&&c.isInteger(e.timestamp.low)&&c.isInteger(e.timestamp.high)))return"timestamp: integer|Long expected";if(null!=e.previous_state_merkle_root&&e.hasOwnProperty("previous_state_merkle_root")&&!(e.previous_state_merkle_root&&"number"==typeof e.previous_state_merkle_root.length||c.isString(e.previous_state_merkle_root)))return"previous_state_merkle_root: buffer expected";if(null!=e.transaction_merkle_root&&e.hasOwnProperty("transaction_merkle_root")&&!(e.transaction_merkle_root&&"number"==typeof e.transaction_merkle_root.length||c.isString(e.transaction_merkle_root)))return"transaction_merkle_root: buffer expected";if(null!=e.signer&&e.hasOwnProperty("signer")&&!(e.signer&&"number"==typeof e.signer.length||c.isString(e.signer)))return"signer: buffer expected";if(null!=e.approved_proposals&&e.hasOwnProperty("approved_proposals")){if(!Array.isArray(e.approved_proposals))return"approved_proposals: array expected";for(var t=0;t<e.approved_proposals.length;++t)if(!(e.approved_proposals[t]&&"number"==typeof e.approved_proposals[t].length||c.isString(e.approved_proposals[t])))return"approved_proposals: buffer[] expected"}return null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.block_header)return e;var t=new l.koinos.protocol.block_header;if(null!=e.previous&&("string"==typeof e.previous?c.base64.decode(e.previous,t.previous=c.newBuffer(c.base64.length(e.previous)),0):e.previous.length>=0&&(t.previous=e.previous)),null!=e.height&&(c.Long?(t.height=c.Long.fromValue(e.height)).unsigned=!0:"string"==typeof e.height?t.height=parseInt(e.height,10):"number"==typeof e.height?t.height=e.height:"object"==typeof e.height&&(t.height=new c.LongBits(e.height.low>>>0,e.height.high>>>0).toNumber(!0))),null!=e.timestamp&&(c.Long?(t.timestamp=c.Long.fromValue(e.timestamp)).unsigned=!0:"string"==typeof e.timestamp?t.timestamp=parseInt(e.timestamp,10):"number"==typeof e.timestamp?t.timestamp=e.timestamp:"object"==typeof e.timestamp&&(t.timestamp=new c.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0))),null!=e.previous_state_merkle_root&&("string"==typeof e.previous_state_merkle_root?c.base64.decode(e.previous_state_merkle_root,t.previous_state_merkle_root=c.newBuffer(c.base64.length(e.previous_state_merkle_root)),0):e.previous_state_merkle_root.length>=0&&(t.previous_state_merkle_root=e.previous_state_merkle_root)),null!=e.transaction_merkle_root&&("string"==typeof e.transaction_merkle_root?c.base64.decode(e.transaction_merkle_root,t.transaction_merkle_root=c.newBuffer(c.base64.length(e.transaction_merkle_root)),0):e.transaction_merkle_root.length>=0&&(t.transaction_merkle_root=e.transaction_merkle_root)),null!=e.signer&&("string"==typeof e.signer?c.base64.decode(e.signer,t.signer=c.newBuffer(c.base64.length(e.signer)),0):e.signer.length>=0&&(t.signer=e.signer)),e.approved_proposals){if(!Array.isArray(e.approved_proposals))throw TypeError(".koinos.protocol.block_header.approved_proposals: array expected");t.approved_proposals=[];for(var r=0;r<e.approved_proposals.length;++r)"string"==typeof e.approved_proposals[r]?c.base64.decode(e.approved_proposals[r],t.approved_proposals[r]=c.newBuffer(c.base64.length(e.approved_proposals[r])),0):e.approved_proposals[r].length>=0&&(t.approved_proposals[r]=e.approved_proposals[r])}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.approved_proposals=[]),t.defaults){if(t.bytes===String?r.previous="":(r.previous=[],t.bytes!==Array&&(r.previous=c.newBuffer(r.previous))),c.Long){var n=new c.Long(0,0,!0);r.height=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.height=t.longs===String?"0":0;c.Long?(n=new c.Long(0,0,!0),r.timestamp=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.timestamp=t.longs===String?"0":0,t.bytes===String?r.previous_state_merkle_root="":(r.previous_state_merkle_root=[],t.bytes!==Array&&(r.previous_state_merkle_root=c.newBuffer(r.previous_state_merkle_root))),t.bytes===String?r.transaction_merkle_root="":(r.transaction_merkle_root=[],t.bytes!==Array&&(r.transaction_merkle_root=c.newBuffer(r.transaction_merkle_root))),t.bytes===String?r.signer="":(r.signer=[],t.bytes!==Array&&(r.signer=c.newBuffer(r.signer)))}if(null!=e.previous&&e.hasOwnProperty("previous")&&(r.previous=t.bytes===String?c.base64.encode(e.previous,0,e.previous.length):t.bytes===Array?Array.prototype.slice.call(e.previous):e.previous),null!=e.height&&e.hasOwnProperty("height")&&("number"==typeof e.height?r.height=t.longs===String?String(e.height):e.height:r.height=t.longs===String?c.Long.prototype.toString.call(e.height):t.longs===Number?new c.LongBits(e.height.low>>>0,e.height.high>>>0).toNumber(!0):e.height),null!=e.timestamp&&e.hasOwnProperty("timestamp")&&("number"==typeof e.timestamp?r.timestamp=t.longs===String?String(e.timestamp):e.timestamp:r.timestamp=t.longs===String?c.Long.prototype.toString.call(e.timestamp):t.longs===Number?new c.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0):e.timestamp),null!=e.previous_state_merkle_root&&e.hasOwnProperty("previous_state_merkle_root")&&(r.previous_state_merkle_root=t.bytes===String?c.base64.encode(e.previous_state_merkle_root,0,e.previous_state_merkle_root.length):t.bytes===Array?Array.prototype.slice.call(e.previous_state_merkle_root):e.previous_state_merkle_root),null!=e.transaction_merkle_root&&e.hasOwnProperty("transaction_merkle_root")&&(r.transaction_merkle_root=t.bytes===String?c.base64.encode(e.transaction_merkle_root,0,e.transaction_merkle_root.length):t.bytes===Array?Array.prototype.slice.call(e.transaction_merkle_root):e.transaction_merkle_root),null!=e.signer&&e.hasOwnProperty("signer")&&(r.signer=t.bytes===String?c.base64.encode(e.signer,0,e.signer.length):t.bytes===Array?Array.prototype.slice.call(e.signer):e.signer),e.approved_proposals&&e.approved_proposals.length){r.approved_proposals=[];for(var o=0;o<e.approved_proposals.length;++o)r.approved_proposals[o]=t.bytes===String?c.base64.encode(e.approved_proposals[o],0,e.approved_proposals[o].length):t.bytes===Array?Array.prototype.slice.call(e.approved_proposals[o]):e.approved_proposals[o]}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.block_header"},t}(),n.block=function(){function t(e){if(this.transactions=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.id=c.newBuffer([]),t.prototype.header=null,t.prototype.transactions=c.emptyArray,t.prototype.signature=c.newBuffer([]),t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).bytes(e.id),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&l.koinos.protocol.block_header.encode(e.header,t.uint32(18).fork()).ldelim(),null!=e.transactions&&e.transactions.length)for(var r=0;r<e.transactions.length;++r)l.koinos.protocol.transaction.encode(e.transactions[r],t.uint32(26).fork()).ldelim();return null!=e.signature&&Object.hasOwnProperty.call(e,"signature")&&t.uint32(34).bytes(e.signature),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.block;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.id=e.bytes();break;case 2:n.header=l.koinos.protocol.block_header.decode(e,e.uint32());break;case 3:n.transactions&&n.transactions.length||(n.transactions=[]),n.transactions.push(l.koinos.protocol.transaction.decode(e,e.uint32()));break;case 4:n.signature=e.bytes();break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!(e.id&&"number"==typeof e.id.length||c.isString(e.id)))return"id: buffer expected";if(null!=e.header&&e.hasOwnProperty("header")&&(r=l.koinos.protocol.block_header.verify(e.header)))return"header."+r;if(null!=e.transactions&&e.hasOwnProperty("transactions")){if(!Array.isArray(e.transactions))return"transactions: array expected";for(var t=0;t<e.transactions.length;++t){var r;if(r=l.koinos.protocol.transaction.verify(e.transactions[t]))return"transactions."+r}}return null!=e.signature&&e.hasOwnProperty("signature")&&!(e.signature&&"number"==typeof e.signature.length||c.isString(e.signature))?"signature: buffer expected":null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.block)return e;var t=new l.koinos.protocol.block;if(null!=e.id&&("string"==typeof e.id?c.base64.decode(e.id,t.id=c.newBuffer(c.base64.length(e.id)),0):e.id.length>=0&&(t.id=e.id)),null!=e.header){if("object"!=typeof e.header)throw TypeError(".koinos.protocol.block.header: object expected");t.header=l.koinos.protocol.block_header.fromObject(e.header)}if(e.transactions){if(!Array.isArray(e.transactions))throw TypeError(".koinos.protocol.block.transactions: array expected");t.transactions=[];for(var r=0;r<e.transactions.length;++r){if("object"!=typeof e.transactions[r])throw TypeError(".koinos.protocol.block.transactions: object expected");t.transactions[r]=l.koinos.protocol.transaction.fromObject(e.transactions[r])}}return null!=e.signature&&("string"==typeof e.signature?c.base64.decode(e.signature,t.signature=c.newBuffer(c.base64.length(e.signature)),0):e.signature.length>=0&&(t.signature=e.signature)),t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.transactions=[]),t.defaults&&(t.bytes===String?r.id="":(r.id=[],t.bytes!==Array&&(r.id=c.newBuffer(r.id))),r.header=null,t.bytes===String?r.signature="":(r.signature=[],t.bytes!==Array&&(r.signature=c.newBuffer(r.signature)))),null!=e.id&&e.hasOwnProperty("id")&&(r.id=t.bytes===String?c.base64.encode(e.id,0,e.id.length):t.bytes===Array?Array.prototype.slice.call(e.id):e.id),null!=e.header&&e.hasOwnProperty("header")&&(r.header=l.koinos.protocol.block_header.toObject(e.header,t)),e.transactions&&e.transactions.length){r.transactions=[];for(var n=0;n<e.transactions.length;++n)r.transactions[n]=l.koinos.protocol.transaction.toObject(e.transactions[n],t)}return null!=e.signature&&e.hasOwnProperty("signature")&&(r.signature=t.bytes===String?c.base64.encode(e.signature,0,e.signature.length):t.bytes===Array?Array.prototype.slice.call(e.signature):e.signature),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.block"},t}(),n.block_receipt=function(){function t(e){if(this.events=[],this.transaction_receipts=[],this.logs=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.id=c.newBuffer([]),t.prototype.height=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.disk_storage_used=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.network_bandwidth_used=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.compute_bandwidth_used=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.state_merkle_root=c.newBuffer([]),t.prototype.events=c.emptyArray,t.prototype.transaction_receipts=c.emptyArray,t.prototype.logs=c.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).bytes(e.id),null!=e.height&&Object.hasOwnProperty.call(e,"height")&&t.uint32(16).uint64(e.height),null!=e.disk_storage_used&&Object.hasOwnProperty.call(e,"disk_storage_used")&&t.uint32(24).uint64(e.disk_storage_used),null!=e.network_bandwidth_used&&Object.hasOwnProperty.call(e,"network_bandwidth_used")&&t.uint32(32).uint64(e.network_bandwidth_used),null!=e.compute_bandwidth_used&&Object.hasOwnProperty.call(e,"compute_bandwidth_used")&&t.uint32(40).uint64(e.compute_bandwidth_used),null!=e.state_merkle_root&&Object.hasOwnProperty.call(e,"state_merkle_root")&&t.uint32(50).bytes(e.state_merkle_root),null!=e.events&&e.events.length)for(var r=0;r<e.events.length;++r)l.koinos.protocol.event_data.encode(e.events[r],t.uint32(58).fork()).ldelim();if(null!=e.transaction_receipts&&e.transaction_receipts.length)for(r=0;r<e.transaction_receipts.length;++r)l.koinos.protocol.transaction_receipt.encode(e.transaction_receipts[r],t.uint32(66).fork()).ldelim();if(null!=e.logs&&e.logs.length)for(r=0;r<e.logs.length;++r)t.uint32(74).string(e.logs[r]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.block_receipt;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.id=e.bytes();break;case 2:n.height=e.uint64();break;case 3:n.disk_storage_used=e.uint64();break;case 4:n.network_bandwidth_used=e.uint64();break;case 5:n.compute_bandwidth_used=e.uint64();break;case 6:n.state_merkle_root=e.bytes();break;case 7:n.events&&n.events.length||(n.events=[]),n.events.push(l.koinos.protocol.event_data.decode(e,e.uint32()));break;case 8:n.transaction_receipts&&n.transaction_receipts.length||(n.transaction_receipts=[]),n.transaction_receipts.push(l.koinos.protocol.transaction_receipt.decode(e,e.uint32()));break;case 9:n.logs&&n.logs.length||(n.logs=[]),n.logs.push(e.string());break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!(e.id&&"number"==typeof e.id.length||c.isString(e.id)))return"id: buffer expected";if(null!=e.height&&e.hasOwnProperty("height")&&!(c.isInteger(e.height)||e.height&&c.isInteger(e.height.low)&&c.isInteger(e.height.high)))return"height: integer|Long expected";if(null!=e.disk_storage_used&&e.hasOwnProperty("disk_storage_used")&&!(c.isInteger(e.disk_storage_used)||e.disk_storage_used&&c.isInteger(e.disk_storage_used.low)&&c.isInteger(e.disk_storage_used.high)))return"disk_storage_used: integer|Long expected";if(null!=e.network_bandwidth_used&&e.hasOwnProperty("network_bandwidth_used")&&!(c.isInteger(e.network_bandwidth_used)||e.network_bandwidth_used&&c.isInteger(e.network_bandwidth_used.low)&&c.isInteger(e.network_bandwidth_used.high)))return"network_bandwidth_used: integer|Long expected";if(null!=e.compute_bandwidth_used&&e.hasOwnProperty("compute_bandwidth_used")&&!(c.isInteger(e.compute_bandwidth_used)||e.compute_bandwidth_used&&c.isInteger(e.compute_bandwidth_used.low)&&c.isInteger(e.compute_bandwidth_used.high)))return"compute_bandwidth_used: integer|Long expected";if(null!=e.state_merkle_root&&e.hasOwnProperty("state_merkle_root")&&!(e.state_merkle_root&&"number"==typeof e.state_merkle_root.length||c.isString(e.state_merkle_root)))return"state_merkle_root: buffer expected";if(null!=e.events&&e.hasOwnProperty("events")){if(!Array.isArray(e.events))return"events: array expected";for(var t=0;t<e.events.length;++t)if(r=l.koinos.protocol.event_data.verify(e.events[t]))return"events."+r}if(null!=e.transaction_receipts&&e.hasOwnProperty("transaction_receipts")){if(!Array.isArray(e.transaction_receipts))return"transaction_receipts: array expected";for(t=0;t<e.transaction_receipts.length;++t){var r;if(r=l.koinos.protocol.transaction_receipt.verify(e.transaction_receipts[t]))return"transaction_receipts."+r}}if(null!=e.logs&&e.hasOwnProperty("logs")){if(!Array.isArray(e.logs))return"logs: array expected";for(t=0;t<e.logs.length;++t)if(!c.isString(e.logs[t]))return"logs: string[] expected"}return null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.block_receipt)return e;var t=new l.koinos.protocol.block_receipt;if(null!=e.id&&("string"==typeof e.id?c.base64.decode(e.id,t.id=c.newBuffer(c.base64.length(e.id)),0):e.id.length>=0&&(t.id=e.id)),null!=e.height&&(c.Long?(t.height=c.Long.fromValue(e.height)).unsigned=!0:"string"==typeof e.height?t.height=parseInt(e.height,10):"number"==typeof e.height?t.height=e.height:"object"==typeof e.height&&(t.height=new c.LongBits(e.height.low>>>0,e.height.high>>>0).toNumber(!0))),null!=e.disk_storage_used&&(c.Long?(t.disk_storage_used=c.Long.fromValue(e.disk_storage_used)).unsigned=!0:"string"==typeof e.disk_storage_used?t.disk_storage_used=parseInt(e.disk_storage_used,10):"number"==typeof e.disk_storage_used?t.disk_storage_used=e.disk_storage_used:"object"==typeof e.disk_storage_used&&(t.disk_storage_used=new c.LongBits(e.disk_storage_used.low>>>0,e.disk_storage_used.high>>>0).toNumber(!0))),null!=e.network_bandwidth_used&&(c.Long?(t.network_bandwidth_used=c.Long.fromValue(e.network_bandwidth_used)).unsigned=!0:"string"==typeof e.network_bandwidth_used?t.network_bandwidth_used=parseInt(e.network_bandwidth_used,10):"number"==typeof e.network_bandwidth_used?t.network_bandwidth_used=e.network_bandwidth_used:"object"==typeof e.network_bandwidth_used&&(t.network_bandwidth_used=new c.LongBits(e.network_bandwidth_used.low>>>0,e.network_bandwidth_used.high>>>0).toNumber(!0))),null!=e.compute_bandwidth_used&&(c.Long?(t.compute_bandwidth_used=c.Long.fromValue(e.compute_bandwidth_used)).unsigned=!0:"string"==typeof e.compute_bandwidth_used?t.compute_bandwidth_used=parseInt(e.compute_bandwidth_used,10):"number"==typeof e.compute_bandwidth_used?t.compute_bandwidth_used=e.compute_bandwidth_used:"object"==typeof e.compute_bandwidth_used&&(t.compute_bandwidth_used=new c.LongBits(e.compute_bandwidth_used.low>>>0,e.compute_bandwidth_used.high>>>0).toNumber(!0))),null!=e.state_merkle_root&&("string"==typeof e.state_merkle_root?c.base64.decode(e.state_merkle_root,t.state_merkle_root=c.newBuffer(c.base64.length(e.state_merkle_root)),0):e.state_merkle_root.length>=0&&(t.state_merkle_root=e.state_merkle_root)),e.events){if(!Array.isArray(e.events))throw TypeError(".koinos.protocol.block_receipt.events: array expected");t.events=[];for(var r=0;r<e.events.length;++r){if("object"!=typeof e.events[r])throw TypeError(".koinos.protocol.block_receipt.events: object expected");t.events[r]=l.koinos.protocol.event_data.fromObject(e.events[r])}}if(e.transaction_receipts){if(!Array.isArray(e.transaction_receipts))throw TypeError(".koinos.protocol.block_receipt.transaction_receipts: array expected");for(t.transaction_receipts=[],r=0;r<e.transaction_receipts.length;++r){if("object"!=typeof e.transaction_receipts[r])throw TypeError(".koinos.protocol.block_receipt.transaction_receipts: object expected");t.transaction_receipts[r]=l.koinos.protocol.transaction_receipt.fromObject(e.transaction_receipts[r])}}if(e.logs){if(!Array.isArray(e.logs))throw TypeError(".koinos.protocol.block_receipt.logs: array expected");for(t.logs=[],r=0;r<e.logs.length;++r)t.logs[r]=String(e.logs[r])}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.events=[],r.transaction_receipts=[],r.logs=[]),t.defaults){if(t.bytes===String?r.id="":(r.id=[],t.bytes!==Array&&(r.id=c.newBuffer(r.id))),c.Long){var n=new c.Long(0,0,!0);r.height=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.height=t.longs===String?"0":0;c.Long?(n=new c.Long(0,0,!0),r.disk_storage_used=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.disk_storage_used=t.longs===String?"0":0,c.Long?(n=new c.Long(0,0,!0),r.network_bandwidth_used=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.network_bandwidth_used=t.longs===String?"0":0,c.Long?(n=new c.Long(0,0,!0),r.compute_bandwidth_used=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.compute_bandwidth_used=t.longs===String?"0":0,t.bytes===String?r.state_merkle_root="":(r.state_merkle_root=[],t.bytes!==Array&&(r.state_merkle_root=c.newBuffer(r.state_merkle_root)))}if(null!=e.id&&e.hasOwnProperty("id")&&(r.id=t.bytes===String?c.base64.encode(e.id,0,e.id.length):t.bytes===Array?Array.prototype.slice.call(e.id):e.id),null!=e.height&&e.hasOwnProperty("height")&&("number"==typeof e.height?r.height=t.longs===String?String(e.height):e.height:r.height=t.longs===String?c.Long.prototype.toString.call(e.height):t.longs===Number?new c.LongBits(e.height.low>>>0,e.height.high>>>0).toNumber(!0):e.height),null!=e.disk_storage_used&&e.hasOwnProperty("disk_storage_used")&&("number"==typeof e.disk_storage_used?r.disk_storage_used=t.longs===String?String(e.disk_storage_used):e.disk_storage_used:r.disk_storage_used=t.longs===String?c.Long.prototype.toString.call(e.disk_storage_used):t.longs===Number?new c.LongBits(e.disk_storage_used.low>>>0,e.disk_storage_used.high>>>0).toNumber(!0):e.disk_storage_used),null!=e.network_bandwidth_used&&e.hasOwnProperty("network_bandwidth_used")&&("number"==typeof e.network_bandwidth_used?r.network_bandwidth_used=t.longs===String?String(e.network_bandwidth_used):e.network_bandwidth_used:r.network_bandwidth_used=t.longs===String?c.Long.prototype.toString.call(e.network_bandwidth_used):t.longs===Number?new c.LongBits(e.network_bandwidth_used.low>>>0,e.network_bandwidth_used.high>>>0).toNumber(!0):e.network_bandwidth_used),null!=e.compute_bandwidth_used&&e.hasOwnProperty("compute_bandwidth_used")&&("number"==typeof e.compute_bandwidth_used?r.compute_bandwidth_used=t.longs===String?String(e.compute_bandwidth_used):e.compute_bandwidth_used:r.compute_bandwidth_used=t.longs===String?c.Long.prototype.toString.call(e.compute_bandwidth_used):t.longs===Number?new c.LongBits(e.compute_bandwidth_used.low>>>0,e.compute_bandwidth_used.high>>>0).toNumber(!0):e.compute_bandwidth_used),null!=e.state_merkle_root&&e.hasOwnProperty("state_merkle_root")&&(r.state_merkle_root=t.bytes===String?c.base64.encode(e.state_merkle_root,0,e.state_merkle_root.length):t.bytes===Array?Array.prototype.slice.call(e.state_merkle_root):e.state_merkle_root),e.events&&e.events.length){r.events=[];for(var o=0;o<e.events.length;++o)r.events[o]=l.koinos.protocol.event_data.toObject(e.events[o],t)}if(e.transaction_receipts&&e.transaction_receipts.length)for(r.transaction_receipts=[],o=0;o<e.transaction_receipts.length;++o)r.transaction_receipts[o]=l.koinos.protocol.transaction_receipt.toObject(e.transaction_receipts[o],t);if(e.logs&&e.logs.length)for(r.logs=[],o=0;o<e.logs.length;++o)r.logs[o]=e.logs[o];return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.block_receipt"},t}(),n),i.chain=((o={}).value_type=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var r;return t.prototype.message_value=null,t.prototype.int32_value=null,t.prototype.int64_value=null,t.prototype.uint32_value=null,t.prototype.uint64_value=null,t.prototype.sint32_value=null,t.prototype.sint64_value=null,t.prototype.fixed32_value=null,t.prototype.fixed64_value=null,t.prototype.sfixed32_value=null,t.prototype.sfixed64_value=null,t.prototype.bool_value=null,t.prototype.string_value=null,t.prototype.bytes_value=null,Object.defineProperty(t.prototype,"kind",{get:c.oneOfGetter(r=["message_value","int32_value","int64_value","uint32_value","uint64_value","sint32_value","sint64_value","fixed32_value","fixed64_value","sfixed32_value","sfixed64_value","bool_value","string_value","bytes_value"]),set:c.oneOfSetter(r)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.message_value&&Object.hasOwnProperty.call(e,"message_value")&&l.google.protobuf.Any.encode(e.message_value,t.uint32(10).fork()).ldelim(),null!=e.int32_value&&Object.hasOwnProperty.call(e,"int32_value")&&t.uint32(16).int32(e.int32_value),null!=e.int64_value&&Object.hasOwnProperty.call(e,"int64_value")&&t.uint32(24).int64(e.int64_value),null!=e.uint32_value&&Object.hasOwnProperty.call(e,"uint32_value")&&t.uint32(32).uint32(e.uint32_value),null!=e.uint64_value&&Object.hasOwnProperty.call(e,"uint64_value")&&t.uint32(40).uint64(e.uint64_value),null!=e.sint32_value&&Object.hasOwnProperty.call(e,"sint32_value")&&t.uint32(48).sint32(e.sint32_value),null!=e.sint64_value&&Object.hasOwnProperty.call(e,"sint64_value")&&t.uint32(56).sint64(e.sint64_value),null!=e.fixed32_value&&Object.hasOwnProperty.call(e,"fixed32_value")&&t.uint32(69).fixed32(e.fixed32_value),null!=e.fixed64_value&&Object.hasOwnProperty.call(e,"fixed64_value")&&t.uint32(73).fixed64(e.fixed64_value),null!=e.sfixed32_value&&Object.hasOwnProperty.call(e,"sfixed32_value")&&t.uint32(85).sfixed32(e.sfixed32_value),null!=e.sfixed64_value&&Object.hasOwnProperty.call(e,"sfixed64_value")&&t.uint32(89).sfixed64(e.sfixed64_value),null!=e.bool_value&&Object.hasOwnProperty.call(e,"bool_value")&&t.uint32(96).bool(e.bool_value),null!=e.string_value&&Object.hasOwnProperty.call(e,"string_value")&&t.uint32(106).string(e.string_value),null!=e.bytes_value&&Object.hasOwnProperty.call(e,"bytes_value")&&t.uint32(114).bytes(e.bytes_value),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.chain.value_type;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.message_value=l.google.protobuf.Any.decode(e,e.uint32());break;case 2:n.int32_value=e.int32();break;case 3:n.int64_value=e.int64();break;case 4:n.uint32_value=e.uint32();break;case 5:n.uint64_value=e.uint64();break;case 6:n.sint32_value=e.sint32();break;case 7:n.sint64_value=e.sint64();break;case 8:n.fixed32_value=e.fixed32();break;case 9:n.fixed64_value=e.fixed64();break;case 10:n.sfixed32_value=e.sfixed32();break;case 11:n.sfixed64_value=e.sfixed64();break;case 12:n.bool_value=e.bool();break;case 13:n.string_value=e.string();break;case 14:n.bytes_value=e.bytes();break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.message_value&&e.hasOwnProperty("message_value")){t.kind=1;var r=l.google.protobuf.Any.verify(e.message_value);if(r)return"message_value."+r}if(null!=e.int32_value&&e.hasOwnProperty("int32_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!c.isInteger(e.int32_value))return"int32_value: integer expected"}if(null!=e.int64_value&&e.hasOwnProperty("int64_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!(c.isInteger(e.int64_value)||e.int64_value&&c.isInteger(e.int64_value.low)&&c.isInteger(e.int64_value.high)))return"int64_value: integer|Long expected"}if(null!=e.uint32_value&&e.hasOwnProperty("uint32_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!c.isInteger(e.uint32_value))return"uint32_value: integer expected"}if(null!=e.uint64_value&&e.hasOwnProperty("uint64_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!(c.isInteger(e.uint64_value)||e.uint64_value&&c.isInteger(e.uint64_value.low)&&c.isInteger(e.uint64_value.high)))return"uint64_value: integer|Long expected"}if(null!=e.sint32_value&&e.hasOwnProperty("sint32_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!c.isInteger(e.sint32_value))return"sint32_value: integer expected"}if(null!=e.sint64_value&&e.hasOwnProperty("sint64_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!(c.isInteger(e.sint64_value)||e.sint64_value&&c.isInteger(e.sint64_value.low)&&c.isInteger(e.sint64_value.high)))return"sint64_value: integer|Long expected"}if(null!=e.fixed32_value&&e.hasOwnProperty("fixed32_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!c.isInteger(e.fixed32_value))return"fixed32_value: integer expected"}if(null!=e.fixed64_value&&e.hasOwnProperty("fixed64_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!(c.isInteger(e.fixed64_value)||e.fixed64_value&&c.isInteger(e.fixed64_value.low)&&c.isInteger(e.fixed64_value.high)))return"fixed64_value: integer|Long expected"}if(null!=e.sfixed32_value&&e.hasOwnProperty("sfixed32_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!c.isInteger(e.sfixed32_value))return"sfixed32_value: integer expected"}if(null!=e.sfixed64_value&&e.hasOwnProperty("sfixed64_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!(c.isInteger(e.sfixed64_value)||e.sfixed64_value&&c.isInteger(e.sfixed64_value.low)&&c.isInteger(e.sfixed64_value.high)))return"sfixed64_value: integer|Long expected"}if(null!=e.bool_value&&e.hasOwnProperty("bool_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,"boolean"!=typeof e.bool_value)return"bool_value: boolean expected"}if(null!=e.string_value&&e.hasOwnProperty("string_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!c.isString(e.string_value))return"string_value: string expected"}if(null!=e.bytes_value&&e.hasOwnProperty("bytes_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!(e.bytes_value&&"number"==typeof e.bytes_value.length||c.isString(e.bytes_value)))return"bytes_value: buffer expected"}return null},t.fromObject=function(e){if(e instanceof l.koinos.chain.value_type)return e;var t=new l.koinos.chain.value_type;if(null!=e.message_value){if("object"!=typeof e.message_value)throw TypeError(".koinos.chain.value_type.message_value: object expected");t.message_value=l.google.protobuf.Any.fromObject(e.message_value)}return null!=e.int32_value&&(t.int32_value=0|e.int32_value),null!=e.int64_value&&(c.Long?(t.int64_value=c.Long.fromValue(e.int64_value)).unsigned=!1:"string"==typeof e.int64_value?t.int64_value=parseInt(e.int64_value,10):"number"==typeof e.int64_value?t.int64_value=e.int64_value:"object"==typeof e.int64_value&&(t.int64_value=new c.LongBits(e.int64_value.low>>>0,e.int64_value.high>>>0).toNumber())),null!=e.uint32_value&&(t.uint32_value=e.uint32_value>>>0),null!=e.uint64_value&&(c.Long?(t.uint64_value=c.Long.fromValue(e.uint64_value)).unsigned=!0:"string"==typeof e.uint64_value?t.uint64_value=parseInt(e.uint64_value,10):"number"==typeof e.uint64_value?t.uint64_value=e.uint64_value:"object"==typeof e.uint64_value&&(t.uint64_value=new c.LongBits(e.uint64_value.low>>>0,e.uint64_value.high>>>0).toNumber(!0))),null!=e.sint32_value&&(t.sint32_value=0|e.sint32_value),null!=e.sint64_value&&(c.Long?(t.sint64_value=c.Long.fromValue(e.sint64_value)).unsigned=!1:"string"==typeof e.sint64_value?t.sint64_value=parseInt(e.sint64_value,10):"number"==typeof e.sint64_value?t.sint64_value=e.sint64_value:"object"==typeof e.sint64_value&&(t.sint64_value=new c.LongBits(e.sint64_value.low>>>0,e.sint64_value.high>>>0).toNumber())),null!=e.fixed32_value&&(t.fixed32_value=e.fixed32_value>>>0),null!=e.fixed64_value&&(c.Long?(t.fixed64_value=c.Long.fromValue(e.fixed64_value)).unsigned=!1:"string"==typeof e.fixed64_value?t.fixed64_value=parseInt(e.fixed64_value,10):"number"==typeof e.fixed64_value?t.fixed64_value=e.fixed64_value:"object"==typeof e.fixed64_value&&(t.fixed64_value=new c.LongBits(e.fixed64_value.low>>>0,e.fixed64_value.high>>>0).toNumber())),null!=e.sfixed32_value&&(t.sfixed32_value=0|e.sfixed32_value),null!=e.sfixed64_value&&(c.Long?(t.sfixed64_value=c.Long.fromValue(e.sfixed64_value)).unsigned=!1:"string"==typeof e.sfixed64_value?t.sfixed64_value=parseInt(e.sfixed64_value,10):"number"==typeof e.sfixed64_value?t.sfixed64_value=e.sfixed64_value:"object"==typeof e.sfixed64_value&&(t.sfixed64_value=new c.LongBits(e.sfixed64_value.low>>>0,e.sfixed64_value.high>>>0).toNumber())),null!=e.bool_value&&(t.bool_value=Boolean(e.bool_value)),null!=e.string_value&&(t.string_value=String(e.string_value)),null!=e.bytes_value&&("string"==typeof e.bytes_value?c.base64.decode(e.bytes_value,t.bytes_value=c.newBuffer(c.base64.length(e.bytes_value)),0):e.bytes_value.length>=0&&(t.bytes_value=e.bytes_value)),t},t.toObject=function(e,t){t||(t={});var r={};return null!=e.message_value&&e.hasOwnProperty("message_value")&&(r.message_value=l.google.protobuf.Any.toObject(e.message_value,t),t.oneofs&&(r.kind="message_value")),null!=e.int32_value&&e.hasOwnProperty("int32_value")&&(r.int32_value=e.int32_value,t.oneofs&&(r.kind="int32_value")),null!=e.int64_value&&e.hasOwnProperty("int64_value")&&("number"==typeof e.int64_value?r.int64_value=t.longs===String?String(e.int64_value):e.int64_value:r.int64_value=t.longs===String?c.Long.prototype.toString.call(e.int64_value):t.longs===Number?new c.LongBits(e.int64_value.low>>>0,e.int64_value.high>>>0).toNumber():e.int64_value,t.oneofs&&(r.kind="int64_value")),null!=e.uint32_value&&e.hasOwnProperty("uint32_value")&&(r.uint32_value=e.uint32_value,t.oneofs&&(r.kind="uint32_value")),null!=e.uint64_value&&e.hasOwnProperty("uint64_value")&&("number"==typeof e.uint64_value?r.uint64_value=t.longs===String?String(e.uint64_value):e.uint64_value:r.uint64_value=t.longs===String?c.Long.prototype.toString.call(e.uint64_value):t.longs===Number?new c.LongBits(e.uint64_value.low>>>0,e.uint64_value.high>>>0).toNumber(!0):e.uint64_value,t.oneofs&&(r.kind="uint64_value")),null!=e.sint32_value&&e.hasOwnProperty("sint32_value")&&(r.sint32_value=e.sint32_value,t.oneofs&&(r.kind="sint32_value")),null!=e.sint64_value&&e.hasOwnProperty("sint64_value")&&("number"==typeof e.sint64_value?r.sint64_value=t.longs===String?String(e.sint64_value):e.sint64_value:r.sint64_value=t.longs===String?c.Long.prototype.toString.call(e.sint64_value):t.longs===Number?new c.LongBits(e.sint64_value.low>>>0,e.sint64_value.high>>>0).toNumber():e.sint64_value,t.oneofs&&(r.kind="sint64_value")),null!=e.fixed32_value&&e.hasOwnProperty("fixed32_value")&&(r.fixed32_value=e.fixed32_value,t.oneofs&&(r.kind="fixed32_value")),null!=e.fixed64_value&&e.hasOwnProperty("fixed64_value")&&("number"==typeof e.fixed64_value?r.fixed64_value=t.longs===String?String(e.fixed64_value):e.fixed64_value:r.fixed64_value=t.longs===String?c.Long.prototype.toString.call(e.fixed64_value):t.longs===Number?new c.LongBits(e.fixed64_value.low>>>0,e.fixed64_value.high>>>0).toNumber():e.fixed64_value,t.oneofs&&(r.kind="fixed64_value")),null!=e.sfixed32_value&&e.hasOwnProperty("sfixed32_value")&&(r.sfixed32_value=e.sfixed32_value,t.oneofs&&(r.kind="sfixed32_value")),null!=e.sfixed64_value&&e.hasOwnProperty("sfixed64_value")&&("number"==typeof e.sfixed64_value?r.sfixed64_value=t.longs===String?String(e.sfixed64_value):e.sfixed64_value:r.sfixed64_value=t.longs===String?c.Long.prototype.toString.call(e.sfixed64_value):t.longs===Number?new c.LongBits(e.sfixed64_value.low>>>0,e.sfixed64_value.high>>>0).toNumber():e.sfixed64_value,t.oneofs&&(r.kind="sfixed64_value")),null!=e.bool_value&&e.hasOwnProperty("bool_value")&&(r.bool_value=e.bool_value,t.oneofs&&(r.kind="bool_value")),null!=e.string_value&&e.hasOwnProperty("string_value")&&(r.string_value=e.string_value,t.oneofs&&(r.kind="string_value")),null!=e.bytes_value&&e.hasOwnProperty("bytes_value")&&(r.bytes_value=t.bytes===String?c.base64.encode(e.bytes_value,0,e.bytes_value.length):t.bytes===Array?Array.prototype.slice.call(e.bytes_value):e.bytes_value,t.oneofs&&(r.kind="bytes_value")),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.chain.value_type"},t}(),o.enum_type=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.name="",t.prototype.number=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.number&&Object.hasOwnProperty.call(e,"number")&&t.uint32(16).int32(e.number),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.chain.enum_type;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.name=e.string();break;case 2:n.number=e.int32();break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.name&&e.hasOwnProperty("name")&&!c.isString(e.name)?"name: string expected":null!=e.number&&e.hasOwnProperty("number")&&!c.isInteger(e.number)?"number: integer expected":null},t.fromObject=function(e){if(e instanceof l.koinos.chain.enum_type)return e;var t=new l.koinos.chain.enum_type;return null!=e.name&&(t.name=String(e.name)),null!=e.number&&(t.number=0|e.number),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.name="",r.number=0),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.number&&e.hasOwnProperty("number")&&(r.number=e.number),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.chain.enum_type"},t}(),o.list_type=function(){function t(e){if(this.values=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.values=c.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.values&&e.values.length)for(var r=0;r<e.values.length;++r)l.koinos.chain.value_type.encode(e.values[r],t.uint32(10).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.chain.list_type;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.values&&n.values.length||(n.values=[]),n.values.push(l.koinos.chain.value_type.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.values&&e.hasOwnProperty("values")){if(!Array.isArray(e.values))return"values: array expected";for(var t=0;t<e.values.length;++t){var r=l.koinos.chain.value_type.verify(e.values[t]);if(r)return"values."+r}}return null},t.fromObject=function(e){if(e instanceof l.koinos.chain.list_type)return e;var t=new l.koinos.chain.list_type;if(e.values){if(!Array.isArray(e.values))throw TypeError(".koinos.chain.list_type.values: array expected");t.values=[];for(var r=0;r<e.values.length;++r){if("object"!=typeof e.values[r])throw TypeError(".koinos.chain.list_type.values: object expected");t.values[r]=l.koinos.chain.value_type.fromObject(e.values[r])}}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.values=[]),e.values&&e.values.length){r.values=[];for(var n=0;n<e.values.length;++n)r.values[n]=l.koinos.chain.value_type.toObject(e.values[n],t)}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.chain.list_type"},t}(),o),i),l.google=((r={}).protobuf=((t={}).Any=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.type_url="",t.prototype.value=c.newBuffer([]),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.type_url&&Object.hasOwnProperty.call(e,"type_url")&&t.uint32(10).string(e.type_url),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(18).bytes(e.value),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.google.protobuf.Any;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.type_url=e.string();break;case 2:n.value=e.bytes();break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type_url&&e.hasOwnProperty("type_url")&&!c.isString(e.type_url)?"type_url: string expected":null!=e.value&&e.hasOwnProperty("value")&&!(e.value&&"number"==typeof e.value.length||c.isString(e.value))?"value: buffer expected":null},t.fromObject=function(e){if(e instanceof l.google.protobuf.Any)return e;var t=new l.google.protobuf.Any;return null!=e.type_url&&(t.type_url=String(e.type_url)),null!=e.value&&("string"==typeof e.value?c.base64.decode(e.value,t.value=c.newBuffer(c.base64.length(e.value)),0):e.value.length>=0&&(t.value=e.value)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.type_url="",t.bytes===String?r.value="":(r.value=[],t.bytes!==Array&&(r.value=c.newBuffer(r.value)))),null!=e.type_url&&e.hasOwnProperty("type_url")&&(r.type_url=e.type_url),null!=e.value&&e.hasOwnProperty("value")&&(r.value=t.bytes===String?c.base64.encode(e.value,0,e.value.length):t.bytes===Array?Array.prototype.slice.call(e.value):e.value),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/google.protobuf.Any"},t}(),t),r),l})?n.apply(t,o):n)||(e.exports=i)},9159:()=>{},6567:e=>{"use strict";e.exports=JSON.parse('{"nested":{"koinos":{"nested":{"contracts":{"nested":{"token":{"options":{"go_package":"github.com/koinos/koinos-proto-golang/koinos/contracts/token"},"nested":{"name_arguments":{"fields":{}},"name_result":{"fields":{"value":{"type":"string","id":1}}},"symbol_arguments":{"fields":{}},"symbol_result":{"fields":{"value":{"type":"string","id":1}}},"decimals_arguments":{"fields":{}},"decimals_result":{"fields":{"value":{"type":"uint32","id":1}}},"total_supply_arguments":{"fields":{}},"total_supply_result":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"balance_of_arguments":{"fields":{"owner":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}}}},"balance_of_result":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"transfer_arguments":{"fields":{"from":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}},"to":{"type":"bytes","id":2,"options":{"(btype)":"ADDRESS"}},"value":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}},"transfer_result":{"fields":{}},"mint_arguments":{"fields":{"to":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}},"value":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}}}},"mint_result":{"fields":{}},"burn_arguments":{"fields":{"from":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}},"value":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}}}},"burn_result":{"fields":{}},"balance_object":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"mana_balance_object":{"fields":{"balance":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}},"mana":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}},"last_mana_update":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}},"burn_event":{"fields":{"from":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}},"value":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}}}},"mint_event":{"fields":{"to":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}},"value":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}}}},"transfer_event":{"fields":{"from":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}},"to":{"type":"bytes","id":2,"options":{"(btype)":"ADDRESS"}},"value":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}}}}}}}}}}')}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.exports}__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var __webpack_exports__=__webpack_require__(5738)})();
|
|
2
|
+
(()=>{var __webpack_modules__={8820:e=>{"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var o=e.charAt(n),i=o.charCodeAt(0);if(255!==t[i])throw new TypeError(o+" is ambiguous");t[i]=n}var s=e.length,a=e.charAt(0),c=Math.log(s)/Math.log(256),l=Math.log(256)/Math.log(s);function u(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var r=0;if(" "!==e[r]){for(var n=0,o=0;e[r]===a;)n++,r++;for(var i=(e.length-r)*c+1>>>0,l=new Uint8Array(i);e[r];){var u=t[e.charCodeAt(r)];if(255===u)return;for(var p=0,d=i-1;(0!==u||p<o)&&-1!==d;d--,p++)u+=s*l[d]>>>0,l[d]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");o=p,r++}if(" "!==e[r]){for(var f=i-o;f!==i&&0===l[f];)f++;for(var h=new Uint8Array(n+(i-f)),y=n;f!==i;)h[y++]=l[f++];return h}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,o=0,i=t.length;o!==i&&0===t[o];)o++,r++;for(var c=(i-o)*l+1>>>0,u=new Uint8Array(c);o!==i;){for(var p=t[o],d=0,f=c-1;(0!==p||d<n)&&-1!==f;f--,d++)p+=256*u[f]>>>0,u[f]=p%s>>>0,p=p/s>>>0;if(0!==p)throw new Error("Non-zero carry");n=d,o++}for(var h=c-n;h!==c&&0===u[h];)h++;for(var y=a.repeat(r);h<c;++h)y+=e.charAt(u[h]);return y},decodeUnsafe:u,decode:function(e){var t=u(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}},7320:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function o(e,...t){if(!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function i(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function a(e,t){o(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=r,t.bool=n,t.bytes=o,t.hash=i,t.exists=s,t.output=a;const c={number:r,bool:n,bytes:o,hash:i,exists:s,output:a};t.default=c},7505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const n=r(7320),o=r(8089);class i extends o.Hash{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,o.createView)(this.buffer)}update(e){n.default.exists(this);const{view:t,buffer:r,blockLen:i}=this,s=(e=(0,o.toBytes)(e)).length;for(let n=0;n<s;){const a=Math.min(i-this.pos,s-n);if(a!==i)r.set(e.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===i&&(this.process(t,0),this.pos=0);else{const t=(0,o.createView)(e);for(;i<=s-n;n+=i)this.process(t,n)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){n.default.exists(this),n.default.output(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:i,isLE:s}=this;let{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>i-a&&(this.process(r,0),a=0);for(let e=a;e<i;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const o=BigInt(32),i=BigInt(4294967295),s=Number(r>>o&i),a=Number(r&i),c=n?4:0,l=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+l,a,n)}(r,i-8,BigInt(8*this.length),s),this.process(r,0);const c=(0,o.createView)(e);this.get().forEach(((e,t)=>c.setUint32(4*t,e,s)))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:o,destroyed:i,pos:s}=this;return e.length=n,e.pos=s,e.finished=o,e.destroyed=i,n%t&&e.buffer.set(r),e}}t.SHA2=i},4421:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto={node:void 0,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0}},830:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=t.RIPEMD160=void 0;const n=r(7505),o=r(8089),i=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),s=Uint8Array.from({length:16},((e,t)=>t)),a=s.map((e=>(9*e+5)%16));let c=[s],l=[a];for(let e=0;e<4;e++)for(let t of[c,l])t.push(t[e].map((e=>i[e])));const u=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map((e=>new Uint8Array(e))),p=c.map(((e,t)=>e.map((e=>u[t][e])))),d=l.map(((e,t)=>e.map((e=>u[t][e])))),f=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),h=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),y=(e,t)=>e<<t|e>>>32-t;function _(e,t,r,n){return 0===e?t^r^n:1===e?t&r|~t&n:2===e?(t|~r)^n:3===e?t&n|r&~n:t^(r|~n)}const g=new Uint32Array(16);class b extends n.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:r,h3:n,h4:o}=this;return[e,t,r,n,o]}set(e,t,r,n,o){this.h0=0|e,this.h1=0|t,this.h2=0|r,this.h3=0|n,this.h4=0|o}process(e,t){for(let r=0;r<16;r++,t+=4)g[r]=e.getUint32(t,!0);let r=0|this.h0,n=r,o=0|this.h1,i=o,s=0|this.h2,a=s,u=0|this.h3,b=u,m=0|this.h4,v=m;for(let e=0;e<5;e++){const t=4-e,w=f[e],k=h[e],O=c[e],x=l[e],S=p[e],j=d[e];for(let t=0;t<16;t++){const n=y(r+_(e,o,s,u)+g[O[t]]+w,S[t])+m|0;r=m,m=u,u=0|y(s,10),s=o,o=n}for(let e=0;e<16;e++){const r=y(n+_(t,i,a,b)+g[x[e]]+k,j[e])+v|0;n=v,v=b,b=0|y(a,10),a=i,i=r}}this.set(this.h1+s+b|0,this.h2+u+v|0,this.h3+m+n|0,this.h4+r+i|0,this.h0+o+a|0)}roundClean(){g.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}t.RIPEMD160=b,t.ripemd160=(0,o.wrapConstructor)((()=>new b))},3061:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=void 0;const n=r(7505),o=r(8089),i=(e,t,r)=>e&t^e&r^t&r,s=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint32Array(64);class l extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[7]}get(){const{A:e,B:t,C:r,D:n,E:o,F:i,G:s,H:a}=this;return[e,t,r,n,o,i,s,a]}set(e,t,r,n,o,i,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|o,this.F=0|i,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)c[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=c[e-15],r=c[e-2],n=(0,o.rotr)(t,7)^(0,o.rotr)(t,18)^t>>>3,i=(0,o.rotr)(r,17)^(0,o.rotr)(r,19)^r>>>10;c[e]=i+c[e-7]+n+c[e-16]|0}let{A:r,B:n,C:a,D:l,E:u,F:p,G:d,H:f}=this;for(let e=0;e<64;e++){const t=f+((0,o.rotr)(u,6)^(0,o.rotr)(u,11)^(0,o.rotr)(u,25))+((h=u)&p^~h&d)+s[e]+c[e]|0,y=((0,o.rotr)(r,2)^(0,o.rotr)(r,13)^(0,o.rotr)(r,22))+i(r,n,a)|0;f=d,d=p,p=u,u=l+t|0,l=a,a=n,n=r,r=t+y|0}var h;r=r+this.A|0,n=n+this.B|0,a=a+this.C|0,l=l+this.D|0,u=u+this.E|0,p=p+this.F|0,d=d+this.G|0,f=f+this.H|0,this.set(r,n,a,l,u,p,d,f)}roundClean(){c.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}t.sha256=(0,o.wrapConstructor)((()=>new l))},8089:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const n=r(4421);if(t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const o=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function i(e){if("string"!=typeof e)throw new TypeError("utf8ToBytes expected string, got "+typeof e);return(new TextEncoder).encode(e)}function s(e){if("string"==typeof e&&(e=i(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}t.bytesToHex=function(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=o[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,o=e.slice(n,n+2),i=Number.parseInt(o,16);if(Number.isNaN(i)||i<0)throw new Error("Invalid byte sequence");t[r]=i}return t},t.nextTick=async()=>{},t.asyncLoop=async function(e,r,n){let o=Date.now();for(let i=0;i<e;i++){n(i);const e=Date.now()-o;e>=0&&e<r||(await(0,t.nextTick)(),o+=e)}},t.utf8ToBytes=i,t.toBytes=s,t.concatBytes=function(...e){if(!e.every((e=>e instanceof Uint8Array)))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const o=e[t];r.set(o,n),n+=o.length}return r},t.Hash=class{clone(){return this._cloneInto()}},t.checkOpts=function(e,t){if(void 0!==t&&("object"!=typeof t||(r=t,"[object Object]"!==Object.prototype.toString.call(r)||r.constructor!==Object)))throw new TypeError("Options should be object or undefined");var r;return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(s(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(s(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto.web)return n.crypto.web.getRandomValues(new Uint8Array(e));if(n.crypto.node)return new Uint8Array(n.crypto.node.randomBytes(e).buffer);throw new Error("The environment doesn't have randomBytes function")}},9656:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.schnorr=t.verify=t.signSync=t.sign=t.getSharedSecret=t.recoverPublicKey=t.getPublicKey=t.Signature=t.Point=t.CURVE=void 0;const n=r(9159),o=BigInt(0),i=BigInt(1),s=BigInt(2),a=BigInt(3),c=BigInt(8),l=s**BigInt(256),u={a:o,b:BigInt(7),P:l-s**BigInt(32)-BigInt(977),n:l-BigInt("432420386565659656852420866394968145599"),h:i,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")};function p(e){const{a:t,b:r}=u,n=T(e*e),o=T(n*e);return T(o+t*e+r)}t.CURVE=u;const d=u.a===o;class f{constructor(e,t,r){this.x=e,this.y=t,this.z=r}static fromAffine(e){if(!(e instanceof y))throw new TypeError("JacobianPoint#fromAffine: expected Point");return new f(e.x,e.y,i)}static toAffineBatch(e){const t=function(e,t=u.P){const r=new Array(e.length),n=I(e.reduce(((e,n,i)=>n===o?e:(r[i]=e,T(e*n,t))),i),t);return e.reduceRight(((e,n,i)=>n===o?e:(r[i]=T(e*r[i],t),T(e*n,t))),n),r}(e.map((e=>e.z)));return e.map(((e,r)=>e.toAffine(t[r])))}static normalizeZ(e){return f.toAffineBatch(e).map(f.fromAffine)}equals(e){if(!(e instanceof f))throw new TypeError("JacobianPoint expected");const{x:t,y:r,z:n}=this,{x:o,y:i,z:a}=e,c=T(n**s),l=T(a**s),u=T(t*l),p=T(o*c),d=T(T(r*a)*l),h=T(T(i*n)*c);return u===p&&d===h}negate(){return new f(this.x,T(-this.y),this.z)}double(){const{x:e,y:t,z:r}=this,n=T(e**s),o=T(t**s),i=T(o**s),l=T(s*(T((e+o)**s)-n-i)),u=T(a*n),p=T(u**s),d=T(p-s*l),h=T(u*(l-d)-c*i),y=T(s*t*r);return new f(d,h,y)}add(e){if(!(e instanceof f))throw new TypeError("JacobianPoint expected");const{x:t,y:r,z:n}=this,{x:i,y:a,z:c}=e;if(i===o||a===o)return this;if(t===o||r===o)return e;const l=T(n**s),u=T(c**s),p=T(t*u),d=T(i*l),h=T(T(r*c)*u),y=T(T(a*n)*l),_=T(d-p),g=T(y-h);if(_===o)return g===o?this.double():f.ZERO;const b=T(_**s),m=T(_*b),v=T(p*b),w=T(g**s-m-s*v),k=T(g*(v-w)-h*m),O=T(n*c*_);return new f(w,k,O)}subtract(e){return this.add(e.negate())}multiplyUnsafe(e){const t=f.ZERO;if("bigint"==typeof e&&e===o)return t;let r=P(e);if(r===i)return this;if(!d){let e=t,n=this;for(;r>o;)r&i&&(e=e.add(n)),n=n.double(),r>>=i;return e}let{k1neg:n,k1:s,k2neg:a,k2:c}=U(r),l=t,p=t,h=this;for(;s>o||c>o;)s&i&&(l=l.add(h)),c&i&&(p=p.add(h)),h=h.double(),s>>=i,c>>=i;return n&&(l=l.negate()),a&&(p=p.negate()),p=new f(T(p.x*u.beta),p.y,p.z),l.add(p)}precomputeWindow(e){const t=d?128/e+1:256/e+1,r=[];let n=this,o=n;for(let i=0;i<t;i++){o=n,r.push(o);for(let t=1;t<2**(e-1);t++)o=o.add(n),r.push(o);n=o.double()}return r}wNAF(e,t){!t&&this.equals(f.BASE)&&(t=y.BASE);const r=t&&t._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=t&&h.get(t);n||(n=this.precomputeWindow(r),t&&1!==r&&(n=f.normalizeZ(n),h.set(t,n)));let o=f.ZERO,s=f.ZERO;const a=1+(d?128/r:256/r),c=2**(r-1),l=BigInt(2**r-1),u=2**r,p=BigInt(r);for(let t=0;t<a;t++){const r=t*c;let a=Number(e&l);if(e>>=p,a>c&&(a-=u,e+=i),0===a){let e=n[r];t%2&&(e=e.negate()),s=s.add(e)}else{let e=n[r+Math.abs(a)-1];a<0&&(e=e.negate()),o=o.add(e)}}return{p:o,f:s}}multiply(e,t){let r,n,o=P(e);if(d){const{k1neg:e,k1:i,k2neg:s,k2:a}=U(o);let{p:c,f:l}=this.wNAF(i,t),{p,f:d}=this.wNAF(a,t);e&&(c=c.negate()),s&&(p=p.negate()),p=new f(T(p.x*u.beta),p.y,p.z),r=c.add(p),n=l.add(d)}else{const{p:e,f:i}=this.wNAF(o,t);r=e,n=i}return f.normalizeZ([r,n])[0]}toAffine(e=I(this.z)){const{x:t,y:r,z:n}=this,o=e,s=T(o*o),a=T(s*o),c=T(t*s),l=T(r*a);if(T(n*o)!==i)throw new Error("invZ was invalid");return new y(c,l)}}f.BASE=new f(u.Gx,u.Gy,i),f.ZERO=new f(o,i,o);const h=new WeakMap;class y{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,h.delete(this)}static fromCompressedHex(e){const t=32===e.length,r=E(t?e:e.subarray(1));if(!J(r))throw new Error("Point is not on curve");let n=function(e){const{P:t}=u,r=BigInt(6),n=BigInt(11),o=BigInt(22),i=BigInt(23),c=BigInt(44),l=BigInt(88),p=e*e*e%t,d=p*p*e%t,f=N(d,a)*d%t,h=N(f,a)*d%t,y=N(h,s)*p%t,_=N(y,n)*y%t,g=N(_,o)*_%t,b=N(g,c)*g%t,m=N(b,l)*b%t,v=N(m,c)*g%t,w=N(v,a)*d%t,k=N(w,i)*_%t,O=N(k,r)*p%t;return N(O,s)}(p(r));const o=(n&i)===i;t?o&&(n=T(-n)):1==(1&e[0])!==o&&(n=T(-n));const c=new y(r,n);return c.assertValidity(),c}static fromUncompressedHex(e){const t=E(e.subarray(1,33)),r=E(e.subarray(33,65)),n=new y(t,r);return n.assertValidity(),n}static fromHex(e){const t=B(e),r=t.length,n=t[0];if(32===r||33===r&&(2===n||3===n))return this.fromCompressedHex(t);if(65===r&&4===n)return this.fromUncompressedHex(t);throw new Error(`Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ${r}`)}static fromPrivateKey(e){return y.BASE.multiply($(e))}static fromSignature(e,t,r){const n=R(e=B(e)),{r:o,s:i}=F(t);if(0!==r&&1!==r)throw new Error("Cannot recover signature: invalid recovery bit");const s=1&r?"03":"02",a=y.fromHex(s+O(o)),{n:c}=u,l=I(o,c),p=T(-n*l,c),d=T(i*l,c),f=y.BASE.multiplyAndAddUnsafe(a,p,d);if(!f)throw new Error("Cannot recover signature: point at infinify");return f.assertValidity(),f}toRawBytes(e=!1){return A(this.toHex(e))}toHex(e=!1){const t=O(this.x);return e?`${this.y&i?"03":"02"}${t}`:`04${t}${O(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const e="Point is not on elliptic curve",{x:t,y:r}=this;if(!J(t)||!J(r))throw new Error(e);const n=T(r*r);if(T(n-p(t))!==o)throw new Error(e)}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new y(this.x,T(-this.y))}double(){return f.fromAffine(this).double().toAffine()}add(e){return f.fromAffine(this).add(f.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return f.fromAffine(this).multiply(e,this).toAffine()}multiplyAndAddUnsafe(e,t,r){const n=f.fromAffine(this),s=t===o||t===i||this!==y.BASE?n.multiplyUnsafe(t):n.multiply(t),a=f.fromAffine(e).multiplyUnsafe(r),c=s.add(a);return c.equals(f.ZERO)?void 0:c.toAffine()}}function _(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}function g(e){if(e.length<2||2!==e[0])throw new Error(`Invalid signature integer tag: ${k(e)}`);const t=e[1],r=e.subarray(2,t+2);if(!t||r.length!==t)throw new Error("Invalid signature integer: wrong length");if(0===r[0]&&r[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:E(r),left:e.subarray(t+2)}}t.Point=y,y.BASE=new y(u.Gx,u.Gy),y.ZERO=new y(o,o);class b{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromCompact(e){const t=v(e),r="Signature.fromCompact";if("string"!=typeof e&&!t)throw new TypeError(`${r}: Expected string or Uint8Array`);const n=t?k(e):e;if(128!==n.length)throw new Error(`${r}: Expected 64-byte hex`);return new b(j(n.slice(0,64)),j(n.slice(64,128)))}static fromDER(e){const t=v(e);if("string"!=typeof e&&!t)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r,s:n}=function(e){if(e.length<2||48!=e[0])throw new Error(`Invalid signature tag: ${k(e)}`);if(e[1]!==e.length-2)throw new Error("Invalid signature: incorrect length");const{data:t,left:r}=g(e.subarray(2)),{data:n,left:o}=g(r);if(o.length)throw new Error(`Invalid signature: left bytes after parsing: ${k(o)}`);return{r:t,s:n}}(t?e:A(e));return new b(r,n)}static fromHex(e){return this.fromDER(e)}assertValidity(){const{r:e,s:t}=this;if(!C(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!C(t))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const e=u.n>>i;return this.s>e}normalizeS(){return this.hasHighS()?new b(this.r,u.n-this.s):this}toDERRawBytes(e=!1){return A(this.toDERHex(e))}toDERHex(e=!1){const t=_(S(this.s));if(e)return t;const r=_(S(this.r)),n=S(r.length/2),o=S(t.length/2);return`30${S(r.length/2+t.length/2+4)}02${n}${r}02${o}${t}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return A(this.toCompactHex())}toCompactHex(){return O(this.r)+O(this.s)}}function m(...e){if(!e.every(v))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const o=e[t];r.set(o,n),n+=o.length}return r}function v(e){return e instanceof Uint8Array}t.Signature=b;const w=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function k(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");let t="";for(let r=0;r<e.length;r++)t+=w[e[r]];return t}function O(e){if(e>l)throw new Error("Expected number < 2^256");return e.toString(16).padStart(64,"0")}function x(e){return A(O(e))}function S(e){const t=e.toString(16);return 1&t.length?`0${t}`:t}function j(e){if("string"!=typeof e)throw new TypeError("hexToNumber: expected string, got "+typeof e);return BigInt(`0x${e}`)}function A(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+e.length);const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,o=e.slice(n,n+2),i=Number.parseInt(o,16);if(Number.isNaN(i)||i<0)throw new Error("Invalid byte sequence");t[r]=i}return t}function E(e){return j(k(e))}function B(e){return e instanceof Uint8Array?Uint8Array.from(e):A(e)}function P(e){if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)return BigInt(e);if("bigint"==typeof e&&C(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function T(e,t=u.P){const r=e%t;return r>=o?r:t+r}function N(e,t){const{P:r}=u;let n=e;for(;t-- >o;)n*=n,n%=r;return n}function I(e,t=u.P){if(e===o||t<=o)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=T(e,t),n=t,s=o,a=i,c=i,l=o;for(;r!==o;){const e=n/r,t=n%r,o=s-c*e,i=a-l*e;n=r,r=t,s=c,a=l,c=o,l=i}if(n!==i)throw new Error("invert: does not exist");return T(s,t)}const L=(e,t)=>(e+t/s)/t,D=s**BigInt(128);function U(e){const{n:t}=u,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-i*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,a=L(s*e,t),c=L(-n*e,t);let l=T(e-a*r-c*o,t),p=T(-a*n-c*s,t);const d=l>D,f=p>D;if(d&&(l=t-l),f&&(p=t-p),l>D||p>D)throw new Error("splitScalarEndo: Endomorphism failed, k="+e);return{k1neg:d,k1:l,k2neg:f,k2:p}}function R(e){const{n:t}=u,r=8*e.length-256;let n=E(e);return r>0&&(n>>=BigInt(r)),n>=t&&(n-=t),n}class z{constructor(){this.v=new Uint8Array(32).fill(1),this.k=new Uint8Array(32).fill(0),this.counter=0}hmac(...e){return t.utils.hmacSha256(this.k,...e)}hmacSync(...e){if("function"!=typeof t.utils.hmacSha256Sync)throw new Error("utils.hmacSha256Sync is undefined, you need to set it");const r=t.utils.hmacSha256Sync(this.k,...e);if(r instanceof Promise)throw new Error("To use sync sign(), ensure utils.hmacSha256 is sync");return r}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(e=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),e),this.v=await this.hmac(this.v),0!==e.length&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),e),this.v=await this.hmac(this.v))}reseedSync(e=new Uint8Array){this.k=this.hmacSync(this.v,Uint8Array.from([0]),e),this.v=this.hmacSync(this.v),0!==e.length&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),e),this.v=this.hmacSync(this.v))}async generate(){return this.incr(),this.v=await this.hmac(this.v),this.v}generateSync(){return this.incr(),this.v=this.hmacSync(this.v),this.v}}function C(e){return o<e&&e<u.n}function J(e){return o<e&&e<u.P}function H(e,t,r){const n=E(e);if(!C(n))return;const{n:s}=u,a=y.BASE.multiply(n),c=T(a.x,s);if(c===o)return;const l=T(I(n,s)*T(t+r*c,s),s);if(l===o)return;const p=new b(c,l);return{sig:p,recovery:(a.x===p.r?0:2)|Number(a.y&i)}}function $(e){let t;if("bigint"==typeof e)t=e;else if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)t=BigInt(e);else if("string"==typeof e){if(64!==e.length)throw new Error("Expected 32 bytes of private key");t=j(e)}else{if(!v(e))throw new TypeError("Expected valid private key");if(32!==e.length)throw new Error("Expected 32 bytes of private key");t=E(e)}if(!C(t))throw new Error("Expected private key: 0 < key < n");return t}function M(e){return e instanceof y?(e.assertValidity(),e):y.fromHex(e)}function F(e){if(e instanceof b)return e.assertValidity(),e;try{return b.fromDER(e)}catch(t){return b.fromCompact(e)}}function q(e){const t=v(e),r="string"==typeof e,n=(t||r)&&e.length;return t?33===n||65===n:r?66===n||130===n:e instanceof y}function V(e){return E(e.length>32?e.slice(0,32):e)}function K(e){const t=V(e),r=T(t,u.n);return G(r<o?t:r)}function G(e){if("bigint"!=typeof e)throw new Error("Expected bigint");return A(O(e))}function W(e,r,n){if(null==e)throw new Error(`sign: expected valid message hash, not "${e}"`);const o=B(e),i=$(r),s=[G(i),K(o)];if(null!=n){!0===n&&(n=t.utils.randomBytes(32));const e=B(n);if(32!==e.length)throw new Error("sign: Expected 32 bytes of extra data");s.push(e)}return{seed:m(...s),m:V(o),d:i}}function Z(e,t){let{sig:r,recovery:n}=e;const{canonical:o,der:i,recovered:s}=Object.assign({canonical:!0,der:!0},t);o&&r.hasHighS()&&(r=r.normalizeS(),n^=1);const a=i?r.toDERRawBytes():r.toCompactRawBytes();return s?[a,n]:a}t.getPublicKey=function(e,t=!1){return y.fromPrivateKey(e).toRawBytes(t)},t.recoverPublicKey=function(e,t,r,n=!1){return y.fromSignature(e,t,r).toRawBytes(n)},t.getSharedSecret=function(e,t,r=!1){if(q(e))throw new TypeError("getSharedSecret: first arg must be private key");if(!q(t))throw new TypeError("getSharedSecret: second arg must be public key");const n=M(t);return n.assertValidity(),n.multiply($(e)).toRawBytes(r)},t.sign=async function(e,t,r={}){const{seed:n,m:o,d:i}=W(e,t,r.extraEntropy);let s;const a=new z;for(await a.reseed(n);!(s=H(await a.generate(),o,i));)await a.reseed();return Z(s,r)},t.signSync=function(e,t,r={}){const{seed:n,m:o,d:i}=W(e,t,r.extraEntropy);let s;const a=new z;for(a.reseedSync(n);!(s=H(a.generateSync(),o,i));)a.reseedSync();return Z(s,r)};const X={strict:!0};function Q(e){return T(E(e),u.n)}function Y(e){return(e.y&i)===o}t.verify=function(e,t,r,n=X){let o;try{o=F(e),t=B(t)}catch(e){return!1}const{r:i,s}=o;if(n.strict&&o.hasHighS())return!1;const a=R(t);let c;try{c=M(r)}catch(e){return!1}const{n:l}=u,p=I(s,l),d=T(a*p,l),f=T(i*p,l),h=y.BASE.multiplyAndAddUnsafe(c,d,f);return!!h&&T(h.x,l)===i};class ee{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromHex(e){const t=B(e);if(64!==t.length)throw new TypeError(`SchnorrSignature.fromHex: expected 64 bytes, not ${t.length}`);const r=E(t.subarray(0,32)),n=E(t.subarray(32,64));return new ee(r,n)}assertValidity(){const{r:e,s:t}=this;if(!J(e)||!C(t))throw new Error("Invalid signature")}toHex(){return O(this.r)+O(this.s)}toRawBytes(){return A(this.toHex())}}function te(e,t,r){if(null==e)throw new TypeError(`sign: Expected valid message, not "${e}"`);const n=B(e),o=$(t),i=B(r);if(32!==i.length)throw new TypeError("sign: Expected 32 bytes of aux randomness");const s=y.fromPrivateKey(o),a=s.toRawX();return{m:n,P:s,px:a,d:Y(s)?o:u.n-o,rand:i}}function re(e,t){return x(e^E(t))}function ne(e){const t=T(E(e),u.n);if(t===o)throw new Error("sign: Creation of signature failed. k is zero");const r=y.fromPrivateKey(t),n=r.toRawX();return{R:r,rx:n,k:Y(r)?t:u.n-t}}function oe(e,t,r,n){return new ee(e.x,T(t+r*n,u.n)).toRawBytes()}function ie(e,t,r){const n=e instanceof ee,o=n?e:ee.fromHex(e);return n&&o.assertValidity(),{...o,m:B(t),P:M(r)}}function se(e,t,r,n){const o=y.BASE.multiplyAndAddUnsafe(t,$(r),T(-n,u.n));return!(!o||!Y(o)||o.x!==e)}async function ae(e,r,n){try{const{r:o,s:i,m:s,P:a}=ie(e,r,n),c=Q(await t.utils.taggedHash(ue.challenge,x(o),a.toRawX(),s));return se(o,a,i,c)}catch(e){return!1}}function ce(e,r,n){try{const{r:o,s:i,m:s,P:a}=ie(e,r,n),c=Q(t.utils.taggedHashSync(ue.challenge,x(o),a.toRawX(),s));return se(o,a,i,c)}catch(e){return!1}}t.schnorr={Signature:ee,getPublicKey:function(e){return y.fromPrivateKey(e).toRawX()},sign:async function(e,r,n=t.utils.randomBytes()){const{m:o,px:i,d:s,rand:a}=te(e,r,n),c=re(s,await t.utils.taggedHash(ue.aux,a)),{R:l,rx:u,k:p}=ne(await t.utils.taggedHash(ue.nonce,c,i,o)),d=oe(l,p,Q(await t.utils.taggedHash(ue.challenge,u,i,o)),s);if(!await ae(d,o,i))throw new Error("sign: Invalid signature produced");return d},verify:ae,signSync:function(e,r,n=t.utils.randomBytes()){const{m:o,px:i,d:s,rand:a}=te(e,r,n),c=re(s,t.utils.taggedHashSync(ue.aux,a)),{R:l,rx:u,k:p}=ne(t.utils.taggedHashSync(ue.nonce,c,i,o)),d=oe(l,p,Q(t.utils.taggedHashSync(ue.challenge,u,i,o)),s);if(!ce(d,o,i))throw new Error("sign: Invalid signature produced");return d},verifySync:ce},y.BASE._setWindowSize(8);const le={node:n,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0},ue={challenge:"BIP0340/challenge",aux:"BIP0340/aux",nonce:"BIP0340/nonce"},pe={};t.utils={isValidPrivateKey(e){try{return $(e),!0}catch(e){return!1}},privateAdd:(e,t)=>x(T($(e)+$(t),u.n)),privateNegate:e=>{const t=$(e);return x(u.n-t)},pointAddScalar:(e,t,r)=>{const n=y.fromHex(e),o=$(t),s=y.BASE.multiplyAndAddUnsafe(n,o,i);if(!s)throw new Error("Tweaked point at infinity");return s.toRawBytes(r)},pointMultiply:(e,t,r)=>{const n=y.fromHex(e),o=E(B(t));return n.multiply(o).toRawBytes(r)},hashToPrivateKey:e=>{if((e=B(e)).length<40||e.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return x(T(E(e),u.n-i)+i)},randomBytes:(e=32)=>{if(le.web)return le.web.getRandomValues(new Uint8Array(e));if(le.node){const{randomBytes:t}=le.node;return Uint8Array.from(t(e))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>t.utils.hashToPrivateKey(t.utils.randomBytes(40)),bytesToHex:k,hexToBytes:A,concatBytes:m,mod:T,invert:I,sha256:async(...e)=>{if(le.web){const t=await le.web.subtle.digest("SHA-256",m(...e));return new Uint8Array(t)}if(le.node){const{createHash:t}=le.node,r=t("sha256");return e.forEach((e=>r.update(e))),Uint8Array.from(r.digest())}throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(e,...t)=>{if(le.web){const r=await le.web.subtle.importKey("raw",e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),n=m(...t),o=await le.web.subtle.sign("HMAC",r,n);return new Uint8Array(o)}if(le.node){const{createHmac:r}=le.node,n=r("sha256",e);return t.forEach((e=>n.update(e))),Uint8Array.from(n.digest())}throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(e,...r)=>{let n=pe[e];if(void 0===n){const r=await t.utils.sha256(Uint8Array.from(e,(e=>e.charCodeAt(0))));n=m(r,r),pe[e]=n}return t.utils.sha256(n,...r)},taggedHashSync:(e,...r)=>{if("function"!=typeof t.utils.sha256Sync)throw new Error("utils.sha256Sync is undefined, you need to set it");let n=pe[e];if(void 0===n){const r=t.utils.sha256Sync(Uint8Array.from(e,(e=>e.charCodeAt(0))));n=m(r,r),pe[e]=n}return t.utils.sha256Sync(n,...r)},precompute(e=8,t=y.BASE){const r=t===y.BASE?t:new y(t.x,t.y);return r._setWindowSize(e),r.multiply(a),r}}},4537:e=>{"use strict";e.exports=function(e,t){for(var r=new Array(arguments.length-1),n=0,o=2,i=!0;o<arguments.length;)r[n++]=arguments[o++];return new Promise((function(o,s){r[n]=function(e){if(i)if(i=!1,e)s(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];o.apply(null,t)}};try{e.apply(t||null,r)}catch(e){i&&(i=!1,s(e))}}))}},7419:(e,t)=>{"use strict";var r=t;r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var n=new Array(64),o=new Array(123),i=0;i<64;)o[n[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;r.encode=function(e,t,r){for(var o,i=null,s=[],a=0,c=0;t<r;){var l=e[t++];switch(c){case 0:s[a++]=n[l>>2],o=(3&l)<<4,c=1;break;case 1:s[a++]=n[o|l>>4],o=(15&l)<<2,c=2;break;case 2:s[a++]=n[o|l>>6],s[a++]=n[63&l],c=0}a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),a=0)}return c&&(s[a++]=n[o],s[a++]=61,1===c&&(s[a++]=61)),i?(a&&i.push(String.fromCharCode.apply(String,s.slice(0,a))),i.join("")):String.fromCharCode.apply(String,s.slice(0,a))};var s="invalid encoding";r.decode=function(e,t,r){for(var n,i=r,a=0,c=0;c<e.length;){var l=e.charCodeAt(c++);if(61===l&&a>1)break;if(void 0===(l=o[l]))throw Error(s);switch(a){case 0:n=l,a=1;break;case 1:t[r++]=n<<2|(48&l)>>4,n=l,a=2;break;case 2:t[r++]=(15&n)<<4|(60&l)>>2,n=l,a=3;break;case 3:t[r++]=(3&n)<<6|l,a=0}}if(1===a)throw Error(s);return r-i},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},5124:e=>{"use strict";function t(e,r){"string"==typeof e&&(r=e,e=void 0);var n=[];function o(e){if("string"!=typeof e){var r=i();if(t.verbose&&console.log("codegen: "+r),r="return "+r,e){for(var s=Object.keys(e),a=new Array(s.length+1),c=new Array(s.length),l=0;l<s.length;)a[l]=s[l],c[l]=e[s[l++]];return a[l]=r,Function.apply(null,a).apply(null,c)}return Function(r)()}for(var u=new Array(arguments.length-1),p=0;p<u.length;)u[p]=arguments[++p];if(p=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var r=u[p++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"})),p!==u.length)throw Error("parameter count mismatch");return n.push(e),o}function i(t){return"function "+(t||r||"")+"("+(e&&e.join(",")||"")+"){\n "+n.join("\n ")+"\n}"}return o.toString=i,o}e.exports=t,t.verbose=!1},9211:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this}},9054:(e,t,r)=>{"use strict";e.exports=i;var n=r(4537),o=r(7199)("fs");function i(e,t,r){return"function"==typeof t?(r=t,t={}):t||(t={}),r?!t.xhr&&o&&o.readFile?o.readFile(e,(function(n,o){return n&&"undefined"!=typeof XMLHttpRequest?i.xhr(e,t,r):n?r(n):r(null,t.binary?o:o.toString("utf8"))})):i.xhr(e,t,r):n(i,this,e,t)}i.xhr=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)return r(Error("status "+n.status));if(t.binary){var e=n.response;if(!e){e=[];for(var o=0;o<n.responseText.length;++o)e.push(255&n.responseText.charCodeAt(o))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,n.responseText)}},t.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()}},945:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3]}function i(e,n,o){t[0]=e,n[o]=r[3],n[o+1]=r[2],n[o+2]=r[1],n[o+3]=r[0]}function s(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function a(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?o:i,e.writeFloatBE=n?i:o,e.readFloatLE=n?s:a,e.readFloatBE=n?a:s}():function(){function t(e,t,r,n){var o=t<0?1:0;if(o&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var i=Math.floor(Math.log(t)/Math.LN2);e((o<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,r,n)}}function s(e,t,r){var n=e(t,r),o=2*(n>>31)+1,i=n>>>23&255,s=8388607&n;return 255===i?s?NaN:o*(1/0):0===i?1401298464324817e-60*o*s:o*Math.pow(2,i-150)*(s+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,n),e.readFloatLE=s.bind(null,o),e.readFloatBE=s.bind(null,i)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3],n[o+4]=r[4],n[o+5]=r[5],n[o+6]=r[6],n[o+7]=r[7]}function i(e,n,o){t[0]=e,n[o]=r[7],n[o+1]=r[6],n[o+2]=r[5],n[o+3]=r[4],n[o+4]=r[3],n[o+5]=r[2],n[o+6]=r[1],n[o+7]=r[0]}function s(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function a(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?o:i,e.writeDoubleBE=n?i:o,e.readDoubleLE=n?s:a,e.readDoubleBE=n?a:s}():function(){function t(e,t,r,n,o,i){var s=n<0?1:0;if(s&&(n=-n),0===n)e(0,o,i+t),e(1/n>0?0:2147483648,o,i+r);else if(isNaN(n))e(0,o,i+t),e(2146959360,o,i+r);else if(n>17976931348623157e292)e(0,o,i+t),e((s<<31|2146435072)>>>0,o,i+r);else{var a;if(n<22250738585072014e-324)e((a=n/5e-324)>>>0,o,i+t),e((s<<31|a/4294967296)>>>0,o,i+r);else{var c=Math.floor(Math.log(n)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=n*Math.pow(2,-c))>>>0,o,i+t),e((s<<31|c+1023<<20|1048576*a&1048575)>>>0,o,i+r)}}}function s(e,t,r,n,o){var i=e(n,o+t),s=e(n,o+r),a=2*(s>>31)+1,c=s>>>20&2047,l=4294967296*(1048575&s)+i;return 2047===c?l?NaN:a*(1/0):0===c?5e-324*a*l:a*Math.pow(2,c-1075)*(l+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,n,4,0),e.readDoubleLE=s.bind(null,o,0,4),e.readDoubleBE=s.bind(null,i,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function n(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function o(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function i(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},7199:module=>{"use strict";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}module.exports=inquire},8626:(e,t)=>{"use strict";var r=t,n=r.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},o=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=n(e),o="";r&&(o=t.shift()+"/");for(var i=0;i<t.length;)".."===t[i]?i>0&&".."!==t[i-1]?t.splice(--i,2):r?t.splice(i,1):++i:"."===t[i]?t.splice(i,1):++i;return o+t.join("/")};r.resolve=function(e,t,r){return r||(t=o(t)),n(t)?t:(r||(e=o(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?o(e+"/"+t):t)}},6662:e=>{"use strict";e.exports=function(e,t,r){var n=r||8192,o=n>>>1,i=null,s=n;return function(r){if(r<1||r>o)return e(r);s+r>n&&(i=e(n),s=0);var a=t.call(i,s,s+=r);return 7&s&&(s=1+(7|s)),a}}},4997:(e,t)=>{"use strict";var r=t;r.length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},r.read=function(e,t,r){if(r-t<1)return"";for(var n,o=null,i=[],s=0;t<r;)(n=e[t++])<128?i[s++]=n:n>191&&n<224?i[s++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[s++]=55296+(n>>10),i[s++]=56320+(1023&n)):i[s++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),s=0);return o?(s&&o.push(String.fromCharCode.apply(String,i.slice(0,s))),o.join("")):String.fromCharCode.apply(String,i.slice(0,s))},r.write=function(e,t,r){for(var n,o,i=r,s=0;s<e.length;++s)(n=e.charCodeAt(s))<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(o=e.charCodeAt(s+1)))?(n=65536+((1023&n)<<10)+(1023&o),++s,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-i}},556:(e,t,r)=>{"use strict";const{encodeText:n}=r(2413);e.exports=class{constructor(e,t,r,o){this.name=e,this.code=t,this.codeBuf=n(this.code),this.alphabet=o,this.codec=r(o)}encode(e){return this.codec.encode(e)}decode(e){for(const t of e)if(this.alphabet&&this.alphabet.indexOf(t)<0)throw new Error(`invalid character '${t}' in '${e}'`);return this.codec.decode(e)}}},5077:(e,t,r)=>{"use strict";const n=r(8820),o=r(556),{rfc4648:i}=r(6727),{decodeText:s,encodeText:a}=r(2413),c=[["identity","\0",()=>({encode:s,decode:a}),""],["base2","0",i(1),"01"],["base8","7",i(3),"01234567"],["base10","9",n,"0123456789"],["base16","f",i(4),"0123456789abcdef"],["base16upper","F",i(4),"0123456789ABCDEF"],["base32hex","v",i(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",i(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",i(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",i(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",i(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",i(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",i(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",i(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",i(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",n,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",n,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",n,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",n,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",i(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",i(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",i(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",i(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],l=c.reduce(((e,t)=>(e[t[0]]=new o(t[0],t[1],t[2],t[3]),e)),{}),u=c.reduce(((e,t)=>(e[t[1]]=l[t[0]],e)),{});e.exports={names:l,codes:u}},6957:(e,t,r)=>{"use strict";const n=r(5077),{encodeText:o,decodeText:i,concat:s}=r(2413);function a(e){if(Object.prototype.hasOwnProperty.call(n.names,e))return n.names[e];if(Object.prototype.hasOwnProperty.call(n.codes,e))return n.codes[e];throw new Error(`Unsupported encoding: ${e}`)}(t=e.exports=function(e,t){if(!t)throw new Error("requires an encoded Uint8Array");const{name:r,codeBuf:n}=a(e);return function(e,t){a(e).decode(i(t))}(r,t),s([n,t],n.length+t.length)}).encode=function(e,t){const r=a(e),n=o(r.encode(t));return s([r.codeBuf,n],r.codeBuf.length+n.length)},t.decode=function(e){e instanceof Uint8Array&&(e=i(e));const t=e[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(t)&&(e=e.toLowerCase()),a(e[0]).decode(e.substring(1))},t.isEncoded=function(e){if(e instanceof Uint8Array&&(e=i(e)),"[object String]"!==Object.prototype.toString.call(e))return!1;try{return a(e[0]).name}catch(e){return!1}},t.encoding=a,t.encodingFromData=function(e){return e instanceof Uint8Array&&(e=i(e)),a(e[0])};const c=Object.freeze(n.names),l=Object.freeze(n.codes);t.names=c,t.codes=l},6727:e=>{"use strict";e.exports={rfc4648:e=>t=>({encode:r=>((e,t,r)=>{const n="="===t[t.length-1],o=(1<<r)-1;let i="",s=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],s+=8;s>r;)s-=r,i+=t[o&a>>s];if(s&&(i+=t[o&a<<r-s]),n)for(;i.length*r&7;)i+="=";return i})(r,t,e),decode:r=>((e,t,r)=>{const n={};for(let e=0;e<t.length;++e)n[t[e]]=e;let o=e.length;for(;"="===e[o-1];)--o;const i=new Uint8Array(o*r/8|0);let s=0,a=0,c=0;for(let t=0;t<o;++t){const o=n[e[t]];if(void 0===o)throw new SyntaxError("Invalid character "+e[t]);a=a<<r|o,s+=r,s>=8&&(s-=8,i[c++]=255&a>>s)}if(s>=r||255&a<<8-s)throw new SyntaxError("Unexpected end of data");return i})(r,t,e)})}},2413:e=>{"use strict";const t=new TextDecoder,r=new TextEncoder;e.exports={decodeText:e=>t.decode(e),encodeText:e=>r.encode(e),concat:function(e,t){const r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r}}},4492:(e,t,r)=>{"use strict";e.exports=r(8836)},2100:(e,t,r)=>{"use strict";e.exports=r(9482)},3996:(e,t,r)=>{"use strict";var n=t,o=r(7025),i=r(9935);function s(e,t,r,n){if(t.resolvedType)if(t.resolvedType instanceof o){e("switch(d%s){",n);for(var i=t.resolvedType.values,s=Object.keys(i),a=0;a<s.length;++a)t.repeated&&i[s[a]]===t.typeDefault&&e("default:"),e("case%j:",s[a])("case %i:",i[s[a]])("m%s=%j",n,i[s[a]])("break");e("}")}else e('if(typeof d%s!=="object")',n)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",n,r,n);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,c)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length >= 0)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n)}}return e}function a(e,t,r,n){if(t.resolvedType)t.resolvedType instanceof o?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",n,r,n,n):e("d%s=types[%i].toObject(m%s,o)",n,r,n);else{var i=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":i=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,i?"true":"",n);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:e("d%s=m%s",n,n)}}return e}n.fromObject=function(e){var t=e.fieldsArray,r=i.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var n=0;n<t.length;++n){var a=t[n].resolve(),c=i.safeProp(a.name);a.map?(r("if(d%s){",c)('if(typeof d%s!=="object")',c)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",c)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",c),s(r,a,n,c+"[ks[i]]")("}")("}")):a.repeated?(r("if(d%s){",c)("if(!Array.isArray(d%s))",c)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",c)("for(var i=0;i<d%s.length;++i){",c),s(r,a,n,c+"[i]")("}")("}")):(a.resolvedType instanceof o||r("if(d%s!=null){",c),s(r,a,n,c),a.resolvedType instanceof o||r("}"))}return r("return m")},n.toObject=function(e){var t=e.fieldsArray.slice().sort(i.compareFieldsById);if(!t.length)return i.codegen()("return {}");for(var r=i.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),n=[],s=[],c=[],l=0;l<t.length;++l)t[l].partOf||(t[l].resolve().repeated?n:t[l].map?s:c).push(t[l]);if(n.length){for(r("if(o.arrays||o.defaults){"),l=0;l<n.length;++l)r("d%s=[]",i.safeProp(n[l].name));r("}")}if(s.length){for(r("if(o.objects||o.defaults){"),l=0;l<s.length;++l)r("d%s={}",i.safeProp(s[l].name));r("}")}if(c.length){for(r("if(o.defaults){"),l=0;l<c.length;++l){var u=c[l],p=i.safeProp(u.name);if(u.resolvedType instanceof o)r("d%s=o.enums===String?%j:%j",p,u.resolvedType.valuesById[u.typeDefault],u.typeDefault);else if(u.long)r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",u.typeDefault.low,u.typeDefault.high,u.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",p)("}else")("d%s=o.longs===String?%j:%i",p,u.typeDefault.toString(),u.typeDefault.toNumber());else if(u.bytes){var d="["+Array.prototype.slice.call(u.typeDefault).join(",")+"]";r("if(o.bytes===String)d%s=%j",p,String.fromCharCode.apply(String,u.typeDefault))("else{")("d%s=%s",p,d)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",p,p)("}")}else r("d%s=%j",p,u.typeDefault)}r("}")}var f=!1;for(l=0;l<t.length;++l){u=t[l];var h=e._fieldsArray.indexOf(u);p=i.safeProp(u.name),u.map?(f||(f=!0,r("var ks2")),r("if(m%s&&(ks2=Object.keys(m%s)).length){",p,p)("d%s={}",p)("for(var j=0;j<ks2.length;++j){"),a(r,u,h,p+"[ks2[j]]")("}")):u.repeated?(r("if(m%s&&m%s.length){",p,p)("d%s=[]",p)("for(var j=0;j<m%s.length;++j){",p),a(r,u,h,p+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",p,u.name),a(r,u,h,p),u.partOf&&r("if(o.oneofs)")("d%s=%j",i.safeProp(u.partOf.name),u.name)),r("}")}return r("return d")}},5305:(e,t,r)=>{"use strict";e.exports=function(e){var t=i.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break"),t("switch(t>>>3){");for(var r=0;r<e.fieldsArray.length;++r){var a=e._fieldsArray[r].resolve(),c=a.resolvedType instanceof n?"int32":a.type,l="m"+i.safeProp(a.name);t("case %i: {",a.id),a.map?(t("if(%s===util.emptyObject)",l)("%s={}",l)("var c2 = r.uint32()+r.pos"),void 0!==o.defaults[a.keyType]?t("k=%j",o.defaults[a.keyType]):t("k=null"),void 0!==o.defaults[c]?t("value=%j",o.defaults[c]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",a.keyType)("case 2:"),void 0===o.basic[c]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",c),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==o.long[a.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',l):t("%s[k]=value",l)):a.repeated?(t("if(!(%s&&%s.length))",l,l)("%s=[]",l),void 0!==o.packed[c]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",l,c)("}else"),void 0===o.basic[c]?t(a.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",l,r):t("%s.push(r.%s())",l,c)):void 0===o.basic[c]?t(a.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",l,r):t("%s=r.%s()",l,c),t("break")("}")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),r=0;r<e._fieldsArray.length;++r){var u=e._fieldsArray[r];u.required&&t("if(!m.hasOwnProperty(%j))",u.name)("throw util.ProtocolError(%j,{instance:m})",s(u))}return t("return m")};var n=r(7025),o=r(7063),i=r(9935);function s(e){return"missing required '"+e.name+"'"}},4928:(e,t,r)=>{"use strict";e.exports=function(e){for(var t,r=i.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),a=e.fieldsArray.slice().sort(i.compareFieldsById),c=0;c<a.length;++c){var l=a[c].resolve(),u=e._fieldsArray.indexOf(l),p=l.resolvedType instanceof n?"int32":l.type,d=o.basic[p];t="m"+i.safeProp(l.name),l.map?(r("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,l.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(l.id<<3|2)>>>0,8|o.mapKey[l.keyType],l.keyType),void 0===d?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",u,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|d,p,t),r("}")("}")):l.repeated?(r("if(%s!=null&&%s.length){",t,t),l.packed&&void 0!==o.packed[p]?r("w.uint32(%i).fork()",(l.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",p,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===d?s(r,l,u,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(l.id<<3|d)>>>0,p,t)),r("}")):(l.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,l.name),void 0===d?s(r,l,u,t):r("w.uint32(%i).%s(%s)",(l.id<<3|d)>>>0,p,t))}return r("return w")};var n=r(7025),o=r(7063),i=r(9935);function s(e,t,r,n){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}},7025:(e,t,r)=>{"use strict";e.exports=s;var n=r(3243);((s.prototype=Object.create(n.prototype)).constructor=s).className="Enum";var o=r(9313),i=r(9935);function s(e,t,r,o,i){if(n.call(this,e,r),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=o,this.comments=i||{},this.reserved=void 0,t)for(var s=Object.keys(t),a=0;a<s.length;++a)"number"==typeof t[s[a]]&&(this.valuesById[this.values[s[a]]=t[s[a]]]=s[a])}s.fromJSON=function(e,t){var r=new s(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,r},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},s.prototype.add=function(e,t,r){if(!i.isString(e))throw TypeError("name must be a string");if(!i.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return this.comments[e]=r||null,this},s.prototype.remove=function(e){if(!i.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this},s.prototype.isReservedId=function(e){return o.isReservedId(this.reserved,e)},s.prototype.isReservedName=function(e){return o.isReservedName(this.reserved,e)}},3548:(e,t,r)=>{"use strict";e.exports=l;var n=r(3243);((l.prototype=Object.create(n.prototype)).constructor=l).className="Field";var o,i=r(7025),s=r(7063),a=r(9935),c=/^required|optional|repeated$/;function l(e,t,r,o,i,l,u){if(a.isObject(o)?(u=i,l=o,o=i=void 0):a.isObject(i)&&(u=l,l=i,i=void 0),n.call(this,e,l),!a.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!a.isString(r))throw TypeError("type must be a string");if(void 0!==o&&!c.test(o=o.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==i&&!a.isString(i))throw TypeError("extend must be a string");"proto3_optional"===o&&(o="optional"),this.rule=o&&"optional"!==o?o:void 0,this.type=r,this.id=t,this.extend=i||void 0,this.required="required"===o,this.optional=!this.required,this.repeated="repeated"===o,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!a.Long&&void 0!==s.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=u}l.fromJSON=function(e,t){return new l(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(l.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),l.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),n.prototype.setOption.call(this,e,t,r)},l.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return a.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},l.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=s.defaults[this.type])?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof o?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof i&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof i)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=a.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;a.base64.test(this.typeDefault)?a.base64.decode(this.typeDefault,e=a.newBuffer(a.base64.length(this.typeDefault)),0):a.utf8.write(this.typeDefault,e=a.newBuffer(a.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=a.emptyObject:this.repeated?this.defaultValue=a.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof o&&(this.parent.ctor.prototype[this.name]=this.defaultValue),n.prototype.resolve.call(this)},l.d=function(e,t,r,n){return"function"==typeof t?t=a.decorateType(t).name:t&&"object"==typeof t&&(t=a.decorateEnum(t).name),function(o,i){a.decorateType(o.constructor).add(new l(i,e,t,r,{default:n}))}},l._configure=function(e){o=e}},8836:(e,t,r)=>{"use strict";var n=e.exports=r(9482);n.build="light",n.load=function(e,t,r){return"function"==typeof t?(r=t,t=new n.Root):t||(t=new n.Root),t.load(e,r)},n.loadSync=function(e,t){return t||(t=new n.Root),t.loadSync(e)},n.encoder=r(4928),n.decoder=r(5305),n.verifier=r(4497),n.converter=r(3996),n.ReflectionObject=r(3243),n.Namespace=r(9313),n.Root=r(9424),n.Enum=r(7025),n.Type=r(7645),n.Field=r(3548),n.OneOf=r(7598),n.MapField=r(6039),n.Service=r(7513),n.Method=r(4429),n.Message=r(8368),n.wrappers=r(1667),n.types=r(7063),n.util=r(9935),n.ReflectionObject._configure(n.Root),n.Namespace._configure(n.Type,n.Service,n.Enum),n.Root._configure(n.Type),n.Field._configure(n.Type)},9482:(e,t,r)=>{"use strict";var n=t;function o(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=r(1173),n.BufferWriter=r(3155),n.Reader=r(1408),n.BufferReader=r(593),n.util=r(9693),n.rpc=r(5994),n.roots=r(5054),n.configure=o,o()},6039:(e,t,r)=>{"use strict";e.exports=s;var n=r(3548);((s.prototype=Object.create(n.prototype)).constructor=s).className="MapField";var o=r(7063),i=r(9935);function s(e,t,r,o,s,a){if(n.call(this,e,t,o,void 0,void 0,s,a),!i.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}s.fromJSON=function(e,t){return new s(e,t.id,t.keyType,t.type,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},s.prototype.resolve=function(){if(this.resolved)return this;if(void 0===o.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return n.prototype.resolve.call(this)},s.d=function(e,t,r){return"function"==typeof r?r=i.decorateType(r).name:r&&"object"==typeof r&&(r=i.decorateEnum(r).name),function(n,o){i.decorateType(n.constructor).add(new s(o,e,t,r))}}},8368:(e,t,r)=>{"use strict";e.exports=o;var n=r(9693);function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.create=function(e){return this.$type.create(e)},o.encode=function(e,t){return this.$type.encode(e,t)},o.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},o.decode=function(e){return this.$type.decode(e)},o.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},o.verify=function(e){return this.$type.verify(e)},o.fromObject=function(e){return this.$type.fromObject(e)},o.toObject=function(e,t){return this.$type.toObject(e,t)},o.prototype.toJSON=function(){return this.$type.toObject(this,n.toJSONOptions)}},4429:(e,t,r)=>{"use strict";e.exports=i;var n=r(3243);((i.prototype=Object.create(n.prototype)).constructor=i).className="Method";var o=r(9935);function i(e,t,r,i,s,a,c,l,u){if(o.isObject(s)?(c=s,s=a=void 0):o.isObject(a)&&(c=a,a=void 0),void 0!==t&&!o.isString(t))throw TypeError("type must be a string");if(!o.isString(r))throw TypeError("requestType must be a string");if(!o.isString(i))throw TypeError("responseType must be a string");n.call(this,e,c),this.type=t||"rpc",this.requestType=r,this.requestStream=!!s||void 0,this.responseType=i,this.responseStream=!!a||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=l,this.parsedOptions=u}i.fromJSON=function(e,t){return new i(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},i.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},i.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),n.prototype.resolve.call(this))}},9313:(e,t,r)=>{"use strict";e.exports=u;var n=r(3243);((u.prototype=Object.create(n.prototype)).constructor=u).className="Namespace";var o,i,s,a=r(3548),c=r(9935);function l(e,t){if(e&&e.length){for(var r={},n=0;n<e.length;++n)r[e[n].name]=e[n].toJSON(t);return r}}function u(e,t){n.call(this,e,t),this.nested=void 0,this._nestedArray=null}function p(e){return e._nestedArray=null,e}u.fromJSON=function(e,t){return new u(e,t.options).addJSON(t.nested)},u.arrayToJSON=l,u.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>t)return!0;return!1},u.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(u.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=c.toArray(this.nested))}}),u.prototype.toJSON=function(e){return c.toObject(["options",this.options,"nested",l(this.nestedArray,e)])},u.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),n=0;n<r.length;++n)t=e[r[n]],this.add((void 0!==t.fields?o.fromJSON:void 0!==t.values?s.fromJSON:void 0!==t.methods?i.fromJSON:void 0!==t.id?a.fromJSON:u.fromJSON)(r[n],t));return this},u.prototype.get=function(e){return this.nested&&this.nested[e]||null},u.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof s)return this.nested[e].values;throw Error("no such enum: "+e)},u.prototype.add=function(e){if(!(e instanceof a&&void 0!==e.extend||e instanceof o||e instanceof s||e instanceof i||e instanceof u))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof u&&e instanceof u)||t instanceof o||t instanceof i)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,n=0;n<r.length;++n)e.add(r[n]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),p(this)},u.prototype.remove=function(e){if(!(e instanceof n))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),p(this)},u.prototype.define=function(e,t){if(c.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof u))throw Error("path conflicts with non-namespace objects")}else r.add(r=new u(n))}return t&&r.addJSON(t),r},u.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof u?e[t++].resolveAll():e[t++].resolve();return this.resolve()},u.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),c.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var n=this.get(e[0]);if(n){if(1===e.length){if(!t||t.indexOf(n.constructor)>-1)return n}else if(n instanceof u&&(n=n.lookup(e.slice(1),t,!0)))return n}else for(var o=0;o<this.nestedArray.length;++o)if(this._nestedArray[o]instanceof u&&(n=this._nestedArray[o].lookup(e,t,!0)))return n;return null===this.parent||r?null:this.parent.lookup(e,t)},u.prototype.lookupType=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such type: "+e);return t},u.prototype.lookupEnum=function(e){var t=this.lookup(e,[s]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},u.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[o,s]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},u.prototype.lookupService=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},u._configure=function(e,t,r){o=e,i=t,s=r}},3243:(e,t,r)=>{"use strict";e.exports=i,i.className="ReflectionObject";var n,o=r(9935);function i(e,t){if(!o.isString(e))throw TypeError("name must be a string");if(t&&!o.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(i.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),i.prototype.toJSON=function(){throw Error()},i.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof n&&t._handleAdd(this)},i.prototype.onRemove=function(e){var t=e.root;t instanceof n&&t._handleRemove(this),this.parent=null,this.resolved=!1},i.prototype.resolve=function(){return this.resolved||this.root instanceof n&&(this.resolved=!0),this},i.prototype.getOption=function(e){if(this.options)return this.options[e]},i.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},i.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var n=this.parsedOptions;if(r){var i=n.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(i){var s=i[e];o.setProperty(s,r,t)}else(i={})[e]=o.setProperty({},r,t),n.push(i)}else{var a={};a[e]=t,n.push(a)}return this},i.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)this.setOption(r[n],e[r[n]],t);return this},i.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},i._configure=function(e){n=e}},7598:(e,t,r)=>{"use strict";e.exports=s;var n=r(3243);((s.prototype=Object.create(n.prototype)).constructor=s).className="OneOf";var o=r(3548),i=r(9935);function s(e,t,r,o){if(Array.isArray(t)||(r=t,t=void 0),n.call(this,e,r),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=o}function a(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}s.fromJSON=function(e,t){return new s(e,t.oneof,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},s.prototype.add=function(e){if(!(e instanceof o))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,a(this),this},s.prototype.remove=function(e){if(!(e instanceof o))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},s.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var r=e.get(this.oneof[t]);r&&!r.partOf&&(r.partOf=this,this.fieldsArray.push(r))}a(this)},s.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);n.prototype.onRemove.call(this,e)},s.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){i.decorateType(t.constructor).add(new s(r,e)),Object.defineProperty(t,r,{get:i.oneOfGetter(e),set:i.oneOfSetter(e)})}}},1408:(e,t,r)=>{"use strict";e.exports=c;var n,o=r(9693),i=o.LongBits,s=o.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var l,u="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},p=function(){return o.Buffer?function(e){return(c.create=function(e){return o.Buffer.isBuffer(e)?new n(e):u(e)})(e)}:u};function d(){var e=new i(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function f(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function h(){if(this.pos+8>this.len)throw a(this,8);return new i(f(this.buf,this.pos+=4),f(this.buf,this.pos+=4))}c.create=p(),c.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,c.prototype.uint32=(l=4294967295,function(){if(l=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return l;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return l}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return f(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|f(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},c.prototype.string=function(){var e=this.bytes();return s.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.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(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){n=e,c.create=p(),n._configure();var t=o.Long?"toLong":"toNumber";o.merge(c.prototype,{int64:function(){return d.call(this)[t](!1)},uint64:function(){return d.call(this)[t](!0)},sint64:function(){return d.call(this).zzDecode()[t](!1)},fixed64:function(){return h.call(this)[t](!0)},sfixed64:function(){return h.call(this)[t](!1)}})}},593:(e,t,r)=>{"use strict";e.exports=i;var n=r(1408);(i.prototype=Object.create(n.prototype)).constructor=i;var o=r(9693);function i(e){n.call(this,e)}i._configure=function(){o.Buffer&&(i.prototype._slice=o.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()},9424:(e,t,r)=>{"use strict";e.exports=p;var n=r(9313);((p.prototype=Object.create(n.prototype)).constructor=p).className="Root";var o,i,s,a=r(3548),c=r(7025),l=r(7598),u=r(9935);function p(e){n.call(this,"",e),this.deferred=[],this.files=[]}function d(){}p.fromJSON=function(e,t){return t||(t=new p),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},p.prototype.resolvePath=u.path.resolve,p.prototype.fetch=u.fetch,p.prototype.load=function e(t,r,n){"function"==typeof r&&(n=r,r=void 0);var o=this;if(!n)return u.asPromise(e,o,t,r);var a=n===d;function c(e,t){if(n){var r=n;if(n=null,a)throw e;r(e,t)}}function l(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in s)return r}return null}function p(e,t){try{if(u.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),u.isString(t)){i.filename=e;var n,s=i(t,o,r),p=0;if(s.imports)for(;p<s.imports.length;++p)(n=l(s.imports[p])||o.resolvePath(e,s.imports[p]))&&f(n);if(s.weakImports)for(p=0;p<s.weakImports.length;++p)(n=l(s.weakImports[p])||o.resolvePath(e,s.weakImports[p]))&&f(n,!0)}else o.setOptions(t.options).addJSON(t.nested)}catch(e){c(e)}a||h||c(null,o)}function f(e,t){if(!(o.files.indexOf(e)>-1))if(o.files.push(e),e in s)a?p(e,s[e]):(++h,setTimeout((function(){--h,p(e,s[e])})));else if(a){var r;try{r=u.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||c(e))}p(e,r)}else++h,o.fetch(e,(function(r,i){--h,n&&(r?t?h||c(null,o):c(r):p(e,i))}))}var h=0;u.isString(t)&&(t=[t]);for(var y,_=0;_<t.length;++_)(y=o.resolvePath("",t[_]))&&f(y);if(a)return o;h||c(null,o)},p.prototype.loadSync=function(e,t){if(!u.isNode)throw Error("not supported");return this.load(e,t,d)},p.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return n.prototype.resolveAll.call(this)};var f=/^[A-Z]/;function h(e,t){var r=t.parent.lookup(t.extend);if(r){var n=new a(t.fullName,t.id,t.type,t.rule,void 0,t.options);return n.declaringField=t,t.extensionField=n,r.add(n),!0}return!1}p.prototype._handleAdd=function(e){if(e instanceof a)void 0===e.extend||e.extensionField||h(0,e)||this.deferred.push(e);else if(e instanceof c)f.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof l)){if(e instanceof o)for(var t=0;t<this.deferred.length;)h(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var r=0;r<e.nestedArray.length;++r)this._handleAdd(e._nestedArray[r]);f.test(e.name)&&(e.parent[e.name]=e)}},p.prototype._handleRemove=function(e){if(e instanceof a){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof c)f.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);f.test(e.name)&&delete e.parent[e.name]}},p._configure=function(e,t,r){o=e,i=t,s=r}},5054:e=>{"use strict";e.exports={}},5994:(e,t,r)=>{"use strict";t.Service=r(7948)},7948:(e,t,r)=>{"use strict";e.exports=o;var n=r(9693);function o(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(o.prototype=Object.create(n.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function e(t,r,o,i,s){if(!i)throw TypeError("request must be specified");var a=this;if(!s)return n.asPromise(e,a,t,r,o,i);if(a.rpcImpl)try{return a.rpcImpl(t,r[a.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(e,r){if(e)return a.emit("error",e,t),s(e);if(null!==r){if(!(r instanceof o))try{r=o[a.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return a.emit("error",e,t),s(e)}return a.emit("data",r,t),s(null,r)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){s(e)}),0)}else setTimeout((function(){s(Error("already ended"))}),0)},o.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},7513:(e,t,r)=>{"use strict";e.exports=a;var n=r(9313);((a.prototype=Object.create(n.prototype)).constructor=a).className="Service";var o=r(4429),i=r(9935),s=r(5994);function a(e,t){n.call(this,e,t),this.methods={},this._methodsArray=null}function c(e){return e._methodsArray=null,e}a.fromJSON=function(e,t){var r=new a(e,t.options);if(t.methods)for(var n=Object.keys(t.methods),i=0;i<n.length;++i)r.add(o.fromJSON(n[i],t.methods[n[i]]));return t.nested&&r.addJSON(t.nested),r.comment=t.comment,r},a.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return i.toObject(["options",t&&t.options||void 0,"methods",n.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},Object.defineProperty(a.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=i.toArray(this.methods))}}),a.prototype.get=function(e){return this.methods[e]||n.prototype.get.call(this,e)},a.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return n.prototype.resolve.call(this)},a.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof o?(this.methods[e.name]=e,e.parent=this,c(this)):n.prototype.add.call(this,e)},a.prototype.remove=function(e){if(e instanceof o){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,c(this)}return n.prototype.remove.call(this,e)},a.prototype.create=function(e,t,r){for(var n,o=new s.Service(e,t,r),a=0;a<this.methodsArray.length;++a){var c=i.lcFirst((n=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");o[c]=i.codegen(["r","c"],i.isReserved(c)?c+"_":c)("return this.rpcCall(m,q,s,r,c)")({m:n,q:n.resolvedRequestType.ctor,s:n.resolvedResponseType.ctor})}return o}},7645:(e,t,r)=>{"use strict";e.exports=b;var n=r(9313);((b.prototype=Object.create(n.prototype)).constructor=b).className="Type";var o=r(7025),i=r(7598),s=r(3548),a=r(6039),c=r(7513),l=r(8368),u=r(1408),p=r(1173),d=r(9935),f=r(4928),h=r(5305),y=r(4497),_=r(3996),g=r(1667);function b(e,t){n.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function m(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(b.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],n=r.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=d.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=d.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=b.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof l||((e.prototype=new l).constructor=e,d.merge(e.prototype,t)),e.$type=e.prototype.$type=this,d.merge(e,l,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this._oneofsArray[r].resolve().name]={get:d.oneOfGetter(this._oneofsArray[r].oneof),set:d.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,n)}}}),b.generateConstructor=function(e){for(var t,r=d.codegen(["p"],e.name),n=0;n<e.fieldsArray.length;++n)(t=e._fieldsArray[n]).map?r("this%s={}",d.safeProp(t.name)):t.repeated&&r("this%s=[]",d.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},b.fromJSON=function(e,t){var r=new b(e,t.options);r.extensions=t.extensions,r.reserved=t.reserved;for(var l=Object.keys(t.fields),u=0;u<l.length;++u)r.add((void 0!==t.fields[l[u]].keyType?a.fromJSON:s.fromJSON)(l[u],t.fields[l[u]]));if(t.oneofs)for(l=Object.keys(t.oneofs),u=0;u<l.length;++u)r.add(i.fromJSON(l[u],t.oneofs[l[u]]));if(t.nested)for(l=Object.keys(t.nested),u=0;u<l.length;++u){var p=t.nested[l[u]];r.add((void 0!==p.id?s.fromJSON:void 0!==p.fields?b.fromJSON:void 0!==p.values?o.fromJSON:void 0!==p.methods?c.fromJSON:n.fromJSON)(l[u],p))}return t.extensions&&t.extensions.length&&(r.extensions=t.extensions),t.reserved&&t.reserved.length&&(r.reserved=t.reserved),t.group&&(r.group=!0),t.comment&&(r.comment=t.comment),r},b.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return d.toObject(["options",t&&t.options||void 0,"oneofs",n.arrayToJSON(this.oneofsArray,e),"fields",n.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},b.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var r=this.oneofsArray;for(t=0;t<r.length;)r[t++].resolve();return n.prototype.resolveAll.call(this)},b.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},b.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof s&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),m(this)}return e instanceof i?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),m(this)):n.prototype.add.call(this,e)},b.prototype.remove=function(e){if(e instanceof s&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),m(this)}if(e instanceof i){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),m(this)}return n.prototype.remove.call(this,e)},b.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},b.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)},b.prototype.create=function(e){return new this.ctor(e)},b.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=f(this)({Writer:p,types:t,util:d}),this.decode=h(this)({Reader:u,types:t,util:d}),this.verify=y(this)({types:t,util:d}),this.fromObject=_.fromObject(this)({types:t,util:d}),this.toObject=_.toObject(this)({types:t,util:d});var n=g[e];if(n){var o=Object.create(this);o.fromObject=this.fromObject,this.fromObject=n.fromObject.bind(o),o.toObject=this.toObject,this.toObject=n.toObject.bind(o)}return this},b.prototype.encode=function(e,t){return this.setup().encode(e,t)},b.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},b.prototype.decode=function(e,t){return this.setup().decode(e,t)},b.prototype.decodeDelimited=function(e){return e instanceof u||(e=u.create(e)),this.decode(e,e.uint32())},b.prototype.verify=function(e){return this.setup().verify(e)},b.prototype.fromObject=function(e){return this.setup().fromObject(e)},b.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},b.d=function(e){return function(t){d.decorateType(t,e)}}},7063:(e,t,r)=>{"use strict";var n=t,o=r(9935),i=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function s(e,t){var r=0,n={};for(t|=0;r<e.length;)n[i[r+t]]=e[r++];return n}n.basic=s([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),n.defaults=s([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",o.emptyArray,null]),n.long=s([0,0,0,1,1],7),n.mapKey=s([0,0,0,5,5,0,0,0,1,1,0,2],2),n.packed=s([1,5,0,0,0,5,5,0,0,0,1,1,0])},9935:(e,t,r)=>{"use strict";var n,o,i=e.exports=r(9693),s=r(5054);i.codegen=r(5124),i.fetch=r(9054),i.path=r(8626),i.fs=i.inquire("fs"),i.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n<t.length;)r[n]=e[t[n++]];return r}return[]},i.toObject=function(e){for(var t={},r=0;r<e.length;){var n=e[r++],o=e[r++];void 0!==o&&(t[n]=o)}return t};var a=/\\/g,c=/"/g;i.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},i.safeProp=function(e){return!/^[$\w_]+$/.test(e)||i.isReserved(e)?'["'+e.replace(a,"\\\\").replace(c,'\\"')+'"]':"."+e},i.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var l=/_([a-z])/g;i.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(l,(function(e,t){return t.toUpperCase()}))},i.compareFieldsById=function(e,t){return e.id-t.id},i.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(i.decorateRoot.remove(e.$type),e.$type.name=t,i.decorateRoot.add(e.$type)),e.$type;n||(n=r(7645));var o=new n(t||e.name);return i.decorateRoot.add(o),o.ctor=e,Object.defineProperty(e,"$type",{value:o,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:o,enumerable:!1}),o};var u=0;i.decorateEnum=function(e){if(e.$type)return e.$type;o||(o=r(7025));var t=new o("Enum"+u++,e);return i.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},i.setProperty=function(e,t,r){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,n){var o=r.shift();if("__proto__"===o)return t;if(r.length>0)t[o]=e(t[o]||{},r,n);else{var i=t[o];i&&(n=[].concat(i).concat(n)),t[o]=n}return t}(e,t=t.split("."),r)},Object.defineProperty(i,"decorateRoot",{get:function(){return s.decorated||(s.decorated=new(r(9424)))}})},1945:(e,t,r)=>{"use strict";e.exports=o;var n=r(9693);function o(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=o.zero=new o(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(e){if(0===e)return i;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new o(r,n)},o.from=function(e){if("number"==typeof e)return o.fromNumber(e);if(n.isString(e)){if(!n.Long)return o.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new o(e.low>>>0,e.high>>>0):i},o.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},o.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;o.fromHash=function(e){return e===s?i:new o((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},o.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},o.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},9693:function(e,t,r){"use strict";var n=t;function o(e,t,r){for(var n=Object.keys(t),o=0;o<n.length;++o)void 0!==e[n[o]]&&r||(e[n[o]]=t[n[o]]);return e}function i(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&o(this,r)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:()=>e,set:void 0,enumerable:!1,configurable:!0},toString:{value(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}n.asPromise=r(4537),n.base64=r(7419),n.EventEmitter=r(9211),n.float=r(945),n.inquire=r(7199),n.utf8=r(4997),n.pool=r(6662),n.LongBits=r(1945),n.isNode=Boolean(void 0!==r.g&&r.g&&r.g.process&&r.g.process.versions&&r.g.process.versions.node),n.global=n.isNode&&r.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,n.emptyArray=Object.freeze?Object.freeze([]):[],n.emptyObject=Object.freeze?Object.freeze({}):{},n.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},n.isString=function(e){return"string"==typeof e||e instanceof String},n.isObject=function(e){return e&&"object"==typeof e},n.isset=n.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"==typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=o,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=i,n.ProtocolError=i("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},n.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},n._configure=function(){var e=n.Buffer;e?(n._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},n._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):n._Buffer_from=n._Buffer_allocUnsafe=null}},4497:(e,t,r)=>{"use strict";e.exports=function(e){var t=o.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r={};e.oneofsArray.length&&t("var p={}");for(var n=0;n<e.fieldsArray.length;++n){var c=e._fieldsArray[n].resolve(),l="m"+o.safeProp(c.name);if(c.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",l,c.name),c.map)t("if(!util.isObject(%s))",l)("return%j",i(c,"object"))("var k=Object.keys(%s)",l)("for(var i=0;i<k.length;++i){"),a(t,c,"k[i]"),s(t,c,n,l+"[k[i]]")("}");else if(c.repeated)t("if(!Array.isArray(%s))",l)("return%j",i(c,"array"))("for(var i=0;i<%s.length;++i){",l),s(t,c,n,l+"[i]")("}");else{if(c.partOf){var u=o.safeProp(c.partOf.name);1===r[c.partOf.name]&&t("if(p%s===1)",u)("return%j",c.partOf.name+": multiple values"),r[c.partOf.name]=1,t("p%s=1",u)}s(t,c,n,l)}c.optional&&t("}")}return t("return null")};var n=r(7025),o=r(9935);function i(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function s(e,t,r,o){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(%s){",o)("default:")("return%j",i(t,"enum value"));for(var s=Object.keys(t.resolvedType.values),a=0;a<s.length;++a)e("case %i:",t.resolvedType.values[s[a]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",r,o)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",o)("return%j",i(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",o,o,o,o)("return%j",i(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',o)("return%j",i(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',o)("return%j",i(t,"boolean"));break;case"string":e("if(!util.isString(%s))",o)("return%j",i(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',o,o,o)("return%j",i(t,"buffer"))}return e}function a(e,t,r){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",r)("return%j",i(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",r)("return%j",i(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",r)("return%j",i(t,"boolean key"))}return e}},1667:(e,t,r)=>{"use strict";var n=t,o=r(8368);n[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var n="."===e["@type"].charAt(0)?e["@type"].slice(1):e["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var r="",n="";if(t&&t.json&&e.type_url&&e.value){n=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var i=this.lookup(n);i&&(e=i.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof o){var s=e.$type.toObject(e,t);return""===r&&(r="type.googleapis.com/"),n=r+("."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName),s["@type"]=n,s}return this.toObject(e,t)}}},1173:(e,t,r)=>{"use strict";e.exports=p;var n,o=r(9693),i=o.LongBits,s=o.base64,a=o.utf8;function c(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function l(){}function u(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function p(){this.len=0,this.head=new c(l,0,0),this.tail=this.head,this.states=null}var d=function(){return o.Buffer?function(){return(p.create=function(){return new n})()}:function(){return new p}};function f(e,t,r){t[r]=255&e}function h(e,t){this.len=e,this.next=void 0,this.val=t}function y(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function _(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}p.create=d(),p.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(p.alloc=o.pool(p.alloc,o.Array.prototype.subarray)),p.prototype._push=function(e,t,r){return this.tail=this.tail.next=new c(e,t,r),this.len+=t,this},h.prototype=Object.create(c.prototype),h.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},p.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new h((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},p.prototype.int32=function(e){return e<0?this._push(y,10,i.fromNumber(e)):this.uint32(e)},p.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},p.prototype.uint64=function(e){var t=i.from(e);return this._push(y,t.length(),t)},p.prototype.int64=p.prototype.uint64,p.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(y,t.length(),t)},p.prototype.bool=function(e){return this._push(f,1,e?1:0)},p.prototype.fixed32=function(e){return this._push(_,4,e>>>0)},p.prototype.sfixed32=p.prototype.fixed32,p.prototype.fixed64=function(e){var t=i.from(e);return this._push(_,4,t.lo)._push(_,4,t.hi)},p.prototype.sfixed64=p.prototype.fixed64,p.prototype.float=function(e){return this._push(o.float.writeFloatLE,4,e)},p.prototype.double=function(e){return this._push(o.float.writeDoubleLE,8,e)};var g=o.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n<e.length;++n)t[r+n]=e[n]};p.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(f,1,0);if(o.isString(e)){var r=p.alloc(t=s.length(e));s.decode(e,r,0),e=r}return this.uint32(t)._push(g,t,e)},p.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(f,1,0)},p.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new c(l,0,0),this.len=0,this},p.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 c(l,0,0),this.len=0),this},p.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},p.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},p._configure=function(e){n=e,p.create=d(),n._configure()}},3155:(e,t,r)=>{"use strict";e.exports=i;var n=r(1173);(i.prototype=Object.create(n.prototype)).constructor=i;var o=r(9693);function i(){n.call(this)}function s(e,t,r){e.length<40?o.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}i._configure=function(){i.alloc=o._Buffer_allocUnsafe,i.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&"set"===o.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n<e.length;)t[r++]=e[n++]}},i.prototype.bytes=function(e){o.isString(e)&&(e=o._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this},i.prototype.string=function(e){var t=o.Buffer.byteLength(e);return this.uint32(t),t&&this._push(s,t,e),this},i._configure()},9822:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=void 0;const n=r(7187),o=r(8593);class i{constructor(e){var t;e.id&&(this.id=(0,o.decodeBase58)(e.id)),this.signer=e.signer,this.provider=e.provider||(null===(t=e.signer)||void 0===t?void 0:t.provider),this.abi=e.abi,this.bytecode=e.bytecode,e.serializer?this.serializer=e.serializer:e.abi&&e.abi.koilib_types&&(this.serializer=new n.Serializer(e.abi.koilib_types)),this.options={signTransaction:!0,sendTransaction:!0,broadcast:!0,sendAbis:!0,...e.options},this.functions={},this.abi&&this.abi.methods&&Object.keys(this.abi.methods).forEach((e=>{this.functions[e]=async(t={},r)=>{if(!this.provider)throw new Error("provider not found");if(!this.abi||!this.abi.methods)throw new Error("Methods are not defined");if(!this.abi.methods[e])throw new Error(`Method ${e} not defined in the ABI`);const n={...this.options,...r},{read_only:i,return:s,default_output:a,preformat_argument:c,preformat_return:l}=this.abi.methods[e];let u;u="function"==typeof c?c(t):t;const p=await this.encodeOperation({name:e,args:u});if(i){if(!s)throw new Error(`No output defined for ${e}`);const{result:t}=await this.provider.readContract(p.call_contract);let r=a;return t&&(r=await this.serializer.deserialize(t,s)),"function"==typeof l&&(r=l(r)),{operation:p,result:r}}if(!this.signer)throw new Error("signer not found");let d=await this.signer.prepareTransaction({header:{...n.chainId&&{chain_id:n.chainId},...n.rcLimit&&{rc_limit:n.rcLimit},...n.nonce&&{nonce:n.nonce},...n.payer&&{payer:n.payer},...n.payee&&{payee:n.payee}},operations:[p]});const f={broadcast:n.broadcast,beforeSend:n.beforeSend};if(n.sendAbis){f.abis={};const e=(0,o.encodeBase58)(this.id);f.abis[e]=this.abi}if(!n.sendTransaction){const e=()=>{throw new Error("This transaction was not broadcasted")};return n.signTransaction&&(d=await this.signer.signTransaction(d,f.abis)),{operation:p,transaction:{...d,wait:e}}}const{transaction:h,receipt:y}=await this.signer.sendTransaction(d,f);return{operation:p,transaction:h,receipt:y}}}))}getId(){if(!this.id)throw new Error("id is not defined");return(0,o.encodeBase58)(this.id)}async deploy(e){if(!this.signer)throw new Error("signer not found");if(!this.bytecode)throw new Error("bytecode not found");const t={...this.options,...e},r={upload_contract:{contract_id:this.id?(0,o.encodeBase58)(this.id):this.signer.getAddress(),bytecode:(0,o.encodeBase64url)(this.bytecode),...t.abi&&{abi:t.abi},...t.authorizesCallContract&&{authorizes_call_contract:t.authorizesCallContract},...t.authorizesTransactionApplication&&{authorizes_transaction_application:t.authorizesTransactionApplication},...t.authorizesUploadContract&&{authorizes_upload_contract:t.authorizesUploadContract}}};let n=await this.signer.prepareTransaction({header:{...t.chainId&&{chain_id:t.chainId},...t.rcLimit&&{rc_limit:t.rcLimit},...t.nonce&&{nonce:t.nonce},...t.payer&&{payer:t.payer},...t.payee&&{payee:t.payee}},operations:[r]});const i={broadcast:t.broadcast,beforeSend:t.beforeSend};if(!t.sendTransaction){const e=()=>{throw new Error("This transaction was not broadcasted")};return t.signTransaction&&(n=await this.signer.signTransaction(n)),{operation:r,transaction:{...n,wait:e}}}const{transaction:s,receipt:a}=await this.signer.sendTransaction(n,i);return{operation:r,transaction:s,receipt:a}}async encodeOperation(e){if(!this.abi||!this.abi.methods||!this.abi.methods[e.name])throw new Error(`Operation ${e.name} unknown`);if(!this.serializer)throw new Error("Serializer is not defined");if(!this.id)throw new Error("Contract id is not defined");const t=this.abi.methods[e.name];let r=new Uint8Array(0);if(t.argument){if(!e.args)throw new Error(`No arguments defined for type '${t.argument}'`);r=await this.serializer.serialize(e.args,t.argument)}return{call_contract:{contract_id:(0,o.encodeBase58)(this.id),entry_point:t.entry_point,args:(0,o.encodeBase64url)(r)}}}async decodeOperation(e){if(!this.id)throw new Error("Contract id is not defined");if(!this.abi||!this.abi.methods)throw new Error("Methods are not defined");if(!this.serializer)throw new Error("Serializer is not defined");if(!e.call_contract)throw new Error("Operation is not CallContractOperation");if(e.call_contract.contract_id!==(0,o.encodeBase58)(this.id))throw new Error(`Invalid contract id. Expected: ${(0,o.encodeBase58)(this.id)}. Received: ${e.call_contract.contract_id}`);for(let t=0;t<Object.keys(this.abi.methods).length;t+=1){const r=Object.keys(this.abi.methods)[t],n=this.abi.methods[r];if(e.call_contract.entry_point===n.entry_point)return n.argument?{name:r,args:await this.serializer.deserialize(e.call_contract.args,n.argument)}:{name:r}}throw new Error(`Unknown method id ${e.call_contract.entry_point}`)}}t.Contract=i,t.default=i},5635:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Provider=void 0;const n=r(9104),o=r(8593);async function i(e){return new Promise((t=>setTimeout(t,e)))}class s{constructor(e){Array.isArray(e)?this.rpcNodes=e:this.rpcNodes=[e],this.currentNodeId=0,this.onError=()=>!0}async call(e,t){for(;;)try{const r={id:Math.round(1e3*Math.random()),jsonrpc:"2.0",method:e,params:t},n=this.rpcNodes[this.currentNodeId],o=await fetch(n,{method:"POST",body:JSON.stringify(r)}),i=await o.json();if(void 0!==i.result)return i.result;if(!i.error)throw new Error("undefined error");const{message:s,data:a}=i.error;if(!a)throw new Error(s);let c;try{c=JSON.parse(a)}catch(e){c={data:a}}throw new Error(JSON.stringify({...s&&{error:s},...c}))}catch(e){const t=this.rpcNodes[this.currentNodeId];this.currentNodeId=(this.currentNodeId+1)%this.rpcNodes.length;const r=this.rpcNodes[this.currentNodeId];if(this.onError(e,t,r))throw e}}async getNonce(e,t=!0){const{nonce:r}=await this.call("chain.get_account_nonce",{account:e});if(!t)return r;const i=(0,o.decodeBase64url)(r),s=n.koinos.chain.value_type.decode(i),a=n.koinos.chain.value_type.toObject(s,{longs:String,defaults:!0});return Number(a.uint64_value)}async getAccountRc(e){const{rc:t}=await this.call("chain.get_account_rc",{account:e});return t||"0"}async getTransactionsById(e){return this.call("transaction_store.get_transactions_by_id",{transaction_ids:e})}async getBlocksById(e){return this.call("block_store.get_blocks_by_id",{block_ids:e,return_block:!0,return_receipt:!1})}async getHeadInfo(){return this.call("chain.get_head_info",{})}async getChainId(){const{chain_id:e}=await this.call("chain.get_chain_id",{});return e}async getBlocks(e,t=1,r){let n=r;return n||(n=(await this.getHeadInfo()).head_topology.id),(await this.call("block_store.get_blocks_by_height",{head_block_id:n,ancestor_start_height:e,num_blocks:t,return_block:!0,return_receipt:!1})).block_items}async getBlock(e){return(await this.getBlocks(e,1))[0]}async wait(e,t="byBlock",r=15e3){const n=Date.now();if("byTransactionId"===t){for(;Date.now()<n+r;){await i(1e3);const{transactions:t}=await this.getTransactionsById([e]);if(t&&t[0]&&t[0].containing_blocks)return{blockId:t[0].containing_blocks[0]}}throw new Error(`Transaction not mined after ${r} ms`)}const o=async(t,r,n)=>{const o=await this.getBlocks(t,r,n);let i=0,s="";o.forEach((t=>{t&&t.block&&t.block_id&&t.block.transactions&&t.block.transactions.find((t=>t.id===e))&&(i=Number(t.block_height),s=t.block_id)}));const a=o[o.length-1].block_id;return[i,s,a]};let s=0,a=0,c="";for(;Date.now()<n+r;){await i(1e3);const{head_topology:e}=await this.getHeadInfo();if(0===s&&(s=Number(e.height),a=s),Number(e.height)===s-1&&c&&c!==e.id){const[t,r,n]=await o(a,Number(e.height)-a+1,e.id);if(t)return{blockId:r,blockNumber:t};c=n,s=Number(e.height)+1}if(s>Number(e.height))continue;const[t,r,n]=await o(s,1,e.id);if(t)return{blockId:r,blockNumber:t};c||(c=n),s+=1}throw new Error(`Transaction not mined after ${r} ms. Blocks checked from ${a} to ${s}`)}async sendTransaction(e,t=!0){const r=await this.call("chain.submit_transaction",{transaction:e,broadcast:t});return e.wait=async(t="byBlock",r=15e3)=>this.wait(e.id,t,r),{...r,transaction:e}}async submitBlock(e){return this.call("chain.submit_block",{block:e})}async readContract(e){return this.call("chain.read_contract",e)}}t.Provider=s,t.default=s},7187:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Serializer=void 0;const n=r(4492),o=r(8593),i="(koinos.btype)",s=["double","float","int32","int64","uint32","uint64","sint32","sint64","fixed32","fixed64","sfixed32","sfixed64","bool","string","bytes"];class a{constructor(e,t){this.bytesConversion=!0,this.types=e,this.root=n.Root.fromJSON(this.types),(null==t?void 0:t.defaultTypeName)&&(this.defaultType=this.root.lookupType(t.defaultTypeName)),t&&void 0!==t.bytesConversion&&(this.bytesConversion=t.bytesConversion)}btypeDecode(e,t){const r={};return Object.keys(t.fields).forEach((n=>{const{options:a,name:c,type:l,rule:u}=t.fields[n];if(!e[c])return;const p={type:l};if(a&&(a["(btype)"]?p.btype=a["(btype)"]:a[i]&&(p.btype=a[i])),"repeated"!==u)if(s.includes(l))r[c]=(0,o.btypeDecodeValue)(e[c],p);else{const t=this.root.lookupType(l);r[c]=this.btypeDecode(e[c],t)}else r[c]=e[c].map((e=>{if(!s.includes(l)){const t=this.root.lookupType(l);return this.btypeDecode(e,t)}return(0,o.btypeDecodeValue)(e,p)}))})),r}btypeEncode(e,t){const r={};return Object.keys(t.fields).forEach((n=>{const{options:a,name:c,type:l,rule:u}=t.fields[n];if(!e[c])return;const p={type:l};if(a&&(a["(btype)"]?p.btype=a["(btype)"]:a[i]&&(p.btype=a[i])),"repeated"!==u)if(s.includes(l))r[c]=(0,o.btypeEncodeValue)(e[c],p);else{const t=this.root.lookupType(l);r[c]=this.btypeEncode(e[c],t)}else r[c]=e[c].map((e=>{if(!s.includes(l)){const t=this.root.lookupType(l);return this.btypeEncode(e,t)}return(0,o.btypeEncodeValue)(e,p)}))})),r}async serialize(e,t,r){const n=this.defaultType||this.root.lookupType(t);let o={};o=(void 0===(null==r?void 0:r.bytesConversion)?this.bytesConversion:r.bytesConversion)?this.btypeDecode(e,n):e;const i=n.create(o);return n.encode(i).finish()}async deserialize(e,t,r){const n="string"==typeof e?(0,o.decodeBase64url)(e):e,i=this.defaultType||this.root.lookupType(t),s=i.decode(n),a=i.toObject(s,{longs:String,defaults:!0});return(void 0===(null==r?void 0:r.bytesConversion)?this.bytesConversion:r.bytesConversion)?this.btypeEncode(a,i):a}}t.Serializer=a,t.default=a},6991:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Signer=void 0;const s=r(3061),a=i(r(9656)),c=r(8593),l=r(9104),u={previous:{type:"bytes",btype:"BLOCK_ID"},height:{type:"uint64"},timestamp:{type:"uint64"},previous_state_merkle_root:{type:"bytes"},transaction_merkle_root:{type:"bytes"},signer:{type:"bytes",btype:"ADDRESS"}},p={chain_id:{type:"bytes"},rc_limit:{type:"uint64"},nonce:{type:"bytes"},operation_merkle_root:{type:"bytes"},payer:{type:"bytes",btype:"ADDRESS"},payee:{type:"bytes",btype:"ADDRESS"}},d={upload_contract:{type:"object",subtypes:{contract_id:{type:"bytes",btype:"CONTRACT_ID"},bytecode:{type:"bytes"},abi:{type:"string"},authorizes_call_contract:{type:"bool"},authorizes_transaction_application:{type:"bool"},authorizes_upload_contract:{type:"bool"}}},call_contract:{type:"object",subtypes:{contract_id:{type:"bytes",btype:"CONTRACT_ID"},entry_point:{type:"uint32"},args:{type:"bytes"}}},set_system_call:{type:"object",subtypes:{call_id:{type:"uint32"},target:{type:"object",subtypes:{thunk_id:{type:"uint32"},system_call_bundle:{type:"object",subtypes:{contract_id:{type:"bytes",btype:"CONTRACT_ID"},entry_point:{type:"uint32"}}}}}}}};class f{constructor(e){this.chainId="",this.compressed=void 0===e.compressed||e.compressed,this.privateKey=e.privateKey,this.provider=e.provider,e.privateKey,this.publicKey=a.getPublicKey(e.privateKey,this.compressed),this.address=(0,c.bitcoinAddress)(this.publicKey),e.chainId&&(this.chainId=e.chainId),this.sendOptions={broadcast:!0,...e.sendOptions}}static fromWif(e,t=!0){const r=void 0===t?"5"!==e[0]:t,n=(0,c.bitcoinDecode)(e);return new f({privateKey:(0,c.toHexString)(n),compressed:r})}static fromSeed(e,t=!0){const r=(0,s.sha256)(e);return new f({privateKey:r,compressed:t})}getAddress(e=!0){if("string"==typeof this.privateKey){const t=a.getPublicKey(this.privateKey,e);return(0,c.bitcoinAddress)(t)}const t=a.getPublicKey(this.privateKey,e);return(0,c.bitcoinAddress)(t)}getPrivateKey(e="hex",t=!1){let r;r=this.privateKey instanceof Uint8Array?(0,c.toHexString)(this.privateKey):"string"==typeof this.privateKey?this.privateKey:BigInt(this.privateKey).toString(16).padStart(64,"0");const n=void 0===t?this.compressed:t;switch(e){case"hex":return r;case"wif":return(0,c.bitcoinEncode)((0,c.toUint8Array)(r),"private",n);default:throw new Error(`Invalid format ${e}`)}}async signHash(e){const[t,r]=await a.sign(e,this.privateKey,{recovered:!0,canonical:!0,der:!1}),n=new Uint8Array(65);return n.set([r+31],0),n.set(t,1),n}async signMessage(e){return this.signHash((0,s.sha256)(e))}async signTransaction(e,t){if(!e.id)throw new Error("Missing transaction id");const r=(0,c.toUint8Array)(e.id.slice(6)),n=await this.signHash(r);return e.signatures||(e.signatures=[]),e.signatures.push((0,c.encodeBase64url)(n)),e}async signBlock(e){if(!e.id)throw new Error("Missing block id");const t=(0,c.toUint8Array)(e.id.slice(6)),r=await this.signHash(t);return e.signature=(0,c.encodeBase64url)(r),e}async sendTransaction(e,t){var r;if(e.signatures&&(null===(r=e.signatures)||void 0===r?void 0:r.length)||(e=await this.signTransaction(e)),!this.provider)throw new Error("provider is undefined");const n={...this.sendOptions,...t};return n.beforeSend&&await n.beforeSend(e),this.provider.sendTransaction(e,n.broadcast)}static recoverPublicKey(e,t,r=!0){const n=(0,c.toHexString)(t),o=Number(`0x${n.slice(0,2)}`)-31,i=n.slice(2,66),s=n.slice(66),l=BigInt(`0x${i}`),u=BigInt(`0x${s}`),p=new a.Signature(l,u),d=a.recoverPublicKey((0,c.toHexString)(e),p.toHex(),o);if(!d)throw new Error("Public key cannot be recovered");return r?a.Point.fromHex(d).toHex(!0):(0,c.toHexString)(d)}static recoverAddress(e,t,r=!0){return(0,c.bitcoinAddress)((0,c.toUint8Array)(f.recoverPublicKey(e,t,r)))}async recoverPublicKeys(e,t){let r=!0;t&&void 0!==t.compressed&&(r=t.compressed);let n,o=[];const i=e;if(i.signature){if(!i.header)throw new Error("Missing block header");if(!i.signature)throw new Error("Missing block signature");o=[i.signature];const e=(0,c.btypeDecode)(i.header,u),t=l.koinos.protocol.block_header.create(e);n=l.koinos.protocol.block_header.encode(t).finish()}else{const t=e;if(!t.header)throw new Error("Missing transaction header");if(!t.signatures)throw new Error("Missing transaction signatures");o=t.signatures;const r=(0,c.btypeDecode)(t.header,p),i=l.koinos.protocol.transaction_header.create(r);n=l.koinos.protocol.transaction_header.encode(i).finish()}const a=(0,s.sha256)(n);return Promise.all(o.map((async e=>(t&&"function"==typeof t.transformSignature&&(e=await t.transformSignature(e)),f.recoverPublicKey(a,(0,c.decodeBase64url)(e),r)))))}async recoverAddresses(e,t){return(await this.recoverPublicKeys(e,t)).map((e=>(0,c.bitcoinAddress)((0,c.toUint8Array)(e))))}async prepareTransaction(e){var t,r;e.header||(e.header={});const n=null!==(t=e.header.payer)&&void 0!==t?t:this.address,{payee:o}=e.header;let i,a;if(void 0===e.header.nonce){if(!this.provider)throw new Error("Cannot get the nonce because provider is undefined. To skip this call set a nonce in the transaction header");const e=await this.provider.getNonce(o||n),t=l.koinos.chain.value_type.create({uint64_value:String(e+1)}),r=l.koinos.chain.value_type.encode(t).finish();i=(0,c.encodeBase64url)(r)}else i=e.header.nonce;if(void 0===e.header.rc_limit){if(!this.provider)throw new Error("Cannot get the rc_limit because provider is undefined. To skip this call set a rc_limit in the transaction header");a=await this.provider.getAccountRc(n)}else a=e.header.rc_limit;let u=e.header.chain_id||this.chainId;if(!u){if(!this.provider)throw new Error("Cannot get the chain_id because provider is undefined. To skip this call set a chain_id in the Signer");u=await this.provider.getChainId(),this.chainId=u}const f=[];if(e.operations)for(let t=0;t<(null===(r=e.operations)||void 0===r?void 0:r.length);t+=1){const r=(0,c.btypeDecode)(e.operations[t],d),n=l.koinos.protocol.operation.create(r),o=l.koinos.protocol.operation.encode(n).finish();f.push((0,s.sha256)(o))}const h=(0,c.encodeBase64url)(new Uint8Array([18,32,...(0,c.calculateMerkleRoot)(f)]));e.header={chain_id:u,rc_limit:a,nonce:i,operation_merkle_root:h,payer:n,...o&&{payee:o}};const y=(0,c.btypeDecode)(e.header,p),_=l.koinos.protocol.transaction_header.create(y),g=l.koinos.protocol.transaction_header.encode(_).finish(),b=(0,s.sha256)(g);return e.id=`0x1220${(0,c.toHexString)(b)}`,e}async prepareBlock(e){var t;e.header||(e.header={});const r=[];if(e.transactions)for(let n=0;n<e.transactions.length;n++){const o=e.transactions[n],i=(0,c.btypeDecode)(o.header,p),a=l.koinos.protocol.transaction_header.create(i),u=l.koinos.protocol.transaction_header.encode(a).finish();r.push((0,s.sha256)(u));let d=new Uint8Array;null===(t=o.signatures)||void 0===t||t.forEach((e=>{d=new Uint8Array([...d,...(0,c.decodeBase64url)(e)])})),r.push((0,s.sha256)(d))}let{height:n,previous:o,previous_state_merkle_root:i}=e.header;if(!n||!o||!i){if(!this.provider)throw new Error("Cannot get the head info because provider is undefined.");const e=await this.provider.getHeadInfo();n=n||`${Number(e.head_topology.height)+1}`,o=o||e.head_topology.id,i=i||e.head_state_merkle_root}e.header={height:n,previous:o,previous_state_merkle_root:i,timestamp:e.header.timestamp||`${Date.now()}`,transaction_merkle_root:(0,c.encodeBase64url)(new Uint8Array([18,32,...(0,c.calculateMerkleRoot)(r)])),signer:this.address};const a=(0,c.btypeDecode)(e.header,u),d=l.koinos.protocol.block_header.create(a),f=l.koinos.protocol.block_header.encode(d).finish(),h=(0,s.sha256)(f);return e.id=`0x1220${(0,c.toHexString)(h)}`,e}}t.Signer=f,t.default=f},5738:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const s=i(r(8593)),a=r(9822),c=r(6991),l=r(5635),u=r(7187);window.utils=s,window.Contract=a.Contract,window.Signer=c.Signer,window.Provider=l.Provider,window.Serializer=u.Serializer},8593:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.tokenAbi=t.btypeEncode=t.btypeDecode=t.btypeEncodeValue=t.btypeDecodeValue=t.parseUnits=t.formatUnits=t.bitcoinAddress=t.bitcoinDecode=t.bitcoinEncode=t.calculateMerkleRoot=t.decodeBase64=t.multihash=t.encodeBase64=t.decodeBase64url=t.encodeBase64url=t.decodeBase58=t.encodeBase58=t.toHexString=t.toUint8Array=void 0;const a=i(r(6957)),c=r(3061),l=r(830),u=s(r(6567));function p(e){const t=e.match(/[\dA-F]{2}/gi);if(!t)throw new Error("Invalid hex");return new Uint8Array(t.map((e=>parseInt(e,16))))}function d(e){return Array.from(e).map((e=>`0${Number(e).toString(16)}`.slice(-2))).join("")}function f(e){return(new TextDecoder).decode(a.encode("z",e)).slice(1)}function h(e){return a.decode(`z${e}`)}function y(e){return(new TextDecoder).decode(a.encode("U",e)).slice(1)}function _(e){return a.decode(`U${e}`)}function g(e,t,r=!1){let n,o,i;"public"===t?(n=new Uint8Array(25),o=new Uint8Array(21),n[0]=0,o[0]=0,i=21):(r?(n=new Uint8Array(38),o=new Uint8Array(34),i=34,n[33]=1,o[33]=1):(n=new Uint8Array(37),o=new Uint8Array(33),i=33),n[0]=128,o[0]=128),o.set(e,1);const s=(0,c.sha256)(o),a=(0,c.sha256)(s),l=new Uint8Array(4);return l.set(a.slice(0,4)),n.set(e,1),n.set(l,i),f(n)}function b(e){return"string"==typeof e||"number"==typeof e?e:JSON.parse(JSON.stringify(e))}function m(e,t){if("bytes"!==t.type)return b(e);const r=e;if(!t.btype)return _(r);switch(t.btype){case"BASE58":case"CONTRACT_ID":case"ADDRESS":return h(r);case"BASE64":return _(r);case"HEX":case"BLOCK_ID":case"TRANSACTION_ID":return p(r.slice(2));default:throw new Error(`unknown btype ${t.btype}`)}}function v(e,t){if("bytes"!==t.type)return b(e);const r=e;if(!t.btype)return y(r);switch(t.btype){case"BASE58":case"CONTRACT_ID":case"ADDRESS":return f(r);case"BASE64":return y(r);case"HEX":case"BLOCK_ID":case"TRANSACTION_ID":return`0x${d(r)}`;default:throw new Error(`unknown btype ${t.btype}`)}}t.toUint8Array=p,t.toHexString=d,t.encodeBase58=f,t.decodeBase58=h,t.encodeBase64url=y,t.decodeBase64url=_,t.encodeBase64=function(e){return(new TextDecoder).decode(a.encode("M",e)).slice(1)},t.multihash=function(e,t="sha2-256"){switch(t){case"sha2-256":return new Uint8Array([18,e.length,...e]);default:throw new Error(`multihash code ${t} not supported`)}},t.decodeBase64=function(e){return a.decode(`M${e}`)},t.calculateMerkleRoot=function(e){if(!e.length)return(0,c.sha256)(new Uint8Array);for(;e.length>1;){for(let t=0;t<e.length;t+=2)if(t+1<e.length){const r=e[t],n=e[t+1],o=(0,c.sha256)(new Uint8Array([...r,...n]));e[t/2]=new Uint8Array(o)}else e[t/2]=e[t];e=e.slice(0,Math.ceil(e.length/2))}return e[0]},t.bitcoinEncode=g,t.bitcoinDecode=function(e){const t=h(e),r=new Uint8Array(32),n=new Uint8Array(4);return r.set(t.slice(1,33)),"5"!==e[0]?n.set(t.slice(34,38)):n.set(t.slice(33,37)),r},t.bitcoinAddress=function(e){const t=(0,c.sha256)(e);return g((0,l.ripemd160)(t),"public")},t.formatUnits=function(e,t){let r="string"==typeof e?e:BigInt(e).toString();const n="-"===r[0]?"-":"";return r=r.replace("-","").padStart(t+1,"0"),`${n}${r.substring(0,r.length-t).replace(/^0+(?=\d)/,"")}.${r.substring(r.length-t)}`.replace(/(\.0+)?(0+)$/,"")},t.parseUnits=function(e,t){const r="-"===e[0]?"-":"";let[n,o]=e.replace("-","").replace(",",".").split(".");return o||(o=""),o=o.padEnd(t,"0"),`${r}${`${n}${o}`.replace(/^0+(?=\d)/,"")}`},t.btypeDecodeValue=m,t.btypeEncodeValue=v,t.btypeDecode=function e(t,r){if("object"!=typeof t)return t;const n={};return Object.keys(r).forEach((o=>{t[o]&&("repeated"===r[o].rule?n[o]=t[o].map((t=>r[o].subtypes?e(t,r[o].subtypes):m(t,r[o]))):r[o].subtypes?n[o]=e(t[o],r[o].subtypes):n[o]=m(t[o],r[o]))})),n},t.btypeEncode=function e(t,r){if("object"!=typeof t)return t;const n={};return Object.keys(r).forEach((o=>{t[o]&&("repeated"===r[o].rule?n[o]=t[o].map((t=>r[o].subtypes?e(t,r[o].subtypes):v(t,r[o]))):r[o].subtypes?n[o]=e(t[o],r[o].subtypes):n[o]=v(t[o],r[o]))})),n},t.tokenAbi={methods:{name:{entry_point:2191741823,argument:"name_arguments",return:"name_result",read_only:!0},symbol:{entry_point:3077209249,argument:"symbol_arguments",return:"symbol_result",read_only:!0},decimals:{entry_point:4001430831,argument:"decimals_arguments",return:"decimals_result",read_only:!0},totalSupply:{entry_point:2967091508,argument:"total_supply_arguments",return:"total_supply_result",read_only:!0},balanceOf:{entry_point:1550980247,argument:"balance_of_arguments",return:"balance_of_result",read_only:!0,default_output:{value:"0"}},transfer:{entry_point:670398154,argument:"transfer_arguments",return:"transfer_result"},mint:{entry_point:3698268091,argument:"mint_arguments",return:"mint_result"},burn:{entry_point:2241834181,argument:"burn_arguments",return:"burn_result"}},koilib_types:u.default}},9104:function(e,t,r){var n,o,i;o=[r(2100)],void 0===(i="function"==typeof(n=function(e){"use strict";var t,r,n,o,i,s=e.Reader,a=e.Writer,c=e.util,l=e.roots.default||(e.roots.default={});return l.koinos=((i={}).protocol=((n={}).event_data=function(){function t(e){if(this.impacted=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.sequence=0,t.prototype.source=c.newBuffer([]),t.prototype.name="",t.prototype.data=c.newBuffer([]),t.prototype.impacted=c.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.sequence&&Object.hasOwnProperty.call(e,"sequence")&&t.uint32(8).uint32(e.sequence),null!=e.source&&Object.hasOwnProperty.call(e,"source")&&t.uint32(18).bytes(e.source),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(26).string(e.name),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(34).bytes(e.data),null!=e.impacted&&e.impacted.length)for(var r=0;r<e.impacted.length;++r)t.uint32(42).bytes(e.impacted[r]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.event_data;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.sequence=e.uint32();break;case 2:n.source=e.bytes();break;case 3:n.name=e.string();break;case 4:n.data=e.bytes();break;case 5:n.impacted&&n.impacted.length||(n.impacted=[]),n.impacted.push(e.bytes());break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.sequence&&e.hasOwnProperty("sequence")&&!c.isInteger(e.sequence))return"sequence: integer expected";if(null!=e.source&&e.hasOwnProperty("source")&&!(e.source&&"number"==typeof e.source.length||c.isString(e.source)))return"source: buffer expected";if(null!=e.name&&e.hasOwnProperty("name")&&!c.isString(e.name))return"name: string expected";if(null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||c.isString(e.data)))return"data: buffer expected";if(null!=e.impacted&&e.hasOwnProperty("impacted")){if(!Array.isArray(e.impacted))return"impacted: array expected";for(var t=0;t<e.impacted.length;++t)if(!(e.impacted[t]&&"number"==typeof e.impacted[t].length||c.isString(e.impacted[t])))return"impacted: buffer[] expected"}return null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.event_data)return e;var t=new l.koinos.protocol.event_data;if(null!=e.sequence&&(t.sequence=e.sequence>>>0),null!=e.source&&("string"==typeof e.source?c.base64.decode(e.source,t.source=c.newBuffer(c.base64.length(e.source)),0):e.source.length>=0&&(t.source=e.source)),null!=e.name&&(t.name=String(e.name)),null!=e.data&&("string"==typeof e.data?c.base64.decode(e.data,t.data=c.newBuffer(c.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),e.impacted){if(!Array.isArray(e.impacted))throw TypeError(".koinos.protocol.event_data.impacted: array expected");t.impacted=[];for(var r=0;r<e.impacted.length;++r)"string"==typeof e.impacted[r]?c.base64.decode(e.impacted[r],t.impacted[r]=c.newBuffer(c.base64.length(e.impacted[r])),0):e.impacted[r].length>=0&&(t.impacted[r]=e.impacted[r])}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.impacted=[]),t.defaults&&(r.sequence=0,t.bytes===String?r.source="":(r.source=[],t.bytes!==Array&&(r.source=c.newBuffer(r.source))),r.name="",t.bytes===String?r.data="":(r.data=[],t.bytes!==Array&&(r.data=c.newBuffer(r.data)))),null!=e.sequence&&e.hasOwnProperty("sequence")&&(r.sequence=e.sequence),null!=e.source&&e.hasOwnProperty("source")&&(r.source=t.bytes===String?c.base64.encode(e.source,0,e.source.length):t.bytes===Array?Array.prototype.slice.call(e.source):e.source),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.data&&e.hasOwnProperty("data")&&(r.data=t.bytes===String?c.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.impacted&&e.impacted.length){r.impacted=[];for(var n=0;n<e.impacted.length;++n)r.impacted[n]=t.bytes===String?c.base64.encode(e.impacted[n],0,e.impacted[n].length):t.bytes===Array?Array.prototype.slice.call(e.impacted[n]):e.impacted[n]}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.event_data"},t}(),n.contract_call_bundle=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.contract_id=c.newBuffer([]),t.prototype.entry_point=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.contract_id&&Object.hasOwnProperty.call(e,"contract_id")&&t.uint32(10).bytes(e.contract_id),null!=e.entry_point&&Object.hasOwnProperty.call(e,"entry_point")&&t.uint32(16).uint32(e.entry_point),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.contract_call_bundle;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.contract_id=e.bytes();break;case 2:n.entry_point=e.uint32();break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.contract_id&&e.hasOwnProperty("contract_id")&&!(e.contract_id&&"number"==typeof e.contract_id.length||c.isString(e.contract_id))?"contract_id: buffer expected":null!=e.entry_point&&e.hasOwnProperty("entry_point")&&!c.isInteger(e.entry_point)?"entry_point: integer expected":null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.contract_call_bundle)return e;var t=new l.koinos.protocol.contract_call_bundle;return null!=e.contract_id&&("string"==typeof e.contract_id?c.base64.decode(e.contract_id,t.contract_id=c.newBuffer(c.base64.length(e.contract_id)),0):e.contract_id.length>=0&&(t.contract_id=e.contract_id)),null!=e.entry_point&&(t.entry_point=e.entry_point>>>0),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(t.bytes===String?r.contract_id="":(r.contract_id=[],t.bytes!==Array&&(r.contract_id=c.newBuffer(r.contract_id))),r.entry_point=0),null!=e.contract_id&&e.hasOwnProperty("contract_id")&&(r.contract_id=t.bytes===String?c.base64.encode(e.contract_id,0,e.contract_id.length):t.bytes===Array?Array.prototype.slice.call(e.contract_id):e.contract_id),null!=e.entry_point&&e.hasOwnProperty("entry_point")&&(r.entry_point=e.entry_point),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.contract_call_bundle"},t}(),n.system_call_target=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var r;return t.prototype.thunk_id=null,t.prototype.system_call_bundle=null,Object.defineProperty(t.prototype,"target",{get:c.oneOfGetter(r=["thunk_id","system_call_bundle"]),set:c.oneOfSetter(r)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.thunk_id&&Object.hasOwnProperty.call(e,"thunk_id")&&t.uint32(8).uint32(e.thunk_id),null!=e.system_call_bundle&&Object.hasOwnProperty.call(e,"system_call_bundle")&&l.koinos.protocol.contract_call_bundle.encode(e.system_call_bundle,t.uint32(18).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.system_call_target;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.thunk_id=e.uint32();break;case 2:n.system_call_bundle=l.koinos.protocol.contract_call_bundle.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.thunk_id&&e.hasOwnProperty("thunk_id")&&(t.target=1,!c.isInteger(e.thunk_id)))return"thunk_id: integer expected";if(null!=e.system_call_bundle&&e.hasOwnProperty("system_call_bundle")){if(1===t.target)return"target: multiple values";t.target=1;var r=l.koinos.protocol.contract_call_bundle.verify(e.system_call_bundle);if(r)return"system_call_bundle."+r}return null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.system_call_target)return e;var t=new l.koinos.protocol.system_call_target;if(null!=e.thunk_id&&(t.thunk_id=e.thunk_id>>>0),null!=e.system_call_bundle){if("object"!=typeof e.system_call_bundle)throw TypeError(".koinos.protocol.system_call_target.system_call_bundle: object expected");t.system_call_bundle=l.koinos.protocol.contract_call_bundle.fromObject(e.system_call_bundle)}return t},t.toObject=function(e,t){t||(t={});var r={};return null!=e.thunk_id&&e.hasOwnProperty("thunk_id")&&(r.thunk_id=e.thunk_id,t.oneofs&&(r.target="thunk_id")),null!=e.system_call_bundle&&e.hasOwnProperty("system_call_bundle")&&(r.system_call_bundle=l.koinos.protocol.contract_call_bundle.toObject(e.system_call_bundle,t),t.oneofs&&(r.target="system_call_bundle")),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.system_call_target"},t}(),n.upload_contract_operation=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.contract_id=c.newBuffer([]),t.prototype.bytecode=c.newBuffer([]),t.prototype.abi="",t.prototype.authorizes_call_contract=!1,t.prototype.authorizes_transaction_application=!1,t.prototype.authorizes_upload_contract=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.contract_id&&Object.hasOwnProperty.call(e,"contract_id")&&t.uint32(10).bytes(e.contract_id),null!=e.bytecode&&Object.hasOwnProperty.call(e,"bytecode")&&t.uint32(18).bytes(e.bytecode),null!=e.abi&&Object.hasOwnProperty.call(e,"abi")&&t.uint32(26).string(e.abi),null!=e.authorizes_call_contract&&Object.hasOwnProperty.call(e,"authorizes_call_contract")&&t.uint32(32).bool(e.authorizes_call_contract),null!=e.authorizes_transaction_application&&Object.hasOwnProperty.call(e,"authorizes_transaction_application")&&t.uint32(40).bool(e.authorizes_transaction_application),null!=e.authorizes_upload_contract&&Object.hasOwnProperty.call(e,"authorizes_upload_contract")&&t.uint32(48).bool(e.authorizes_upload_contract),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.upload_contract_operation;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.contract_id=e.bytes();break;case 2:n.bytecode=e.bytes();break;case 3:n.abi=e.string();break;case 4:n.authorizes_call_contract=e.bool();break;case 5:n.authorizes_transaction_application=e.bool();break;case 6:n.authorizes_upload_contract=e.bool();break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.contract_id&&e.hasOwnProperty("contract_id")&&!(e.contract_id&&"number"==typeof e.contract_id.length||c.isString(e.contract_id))?"contract_id: buffer expected":null!=e.bytecode&&e.hasOwnProperty("bytecode")&&!(e.bytecode&&"number"==typeof e.bytecode.length||c.isString(e.bytecode))?"bytecode: buffer expected":null!=e.abi&&e.hasOwnProperty("abi")&&!c.isString(e.abi)?"abi: string expected":null!=e.authorizes_call_contract&&e.hasOwnProperty("authorizes_call_contract")&&"boolean"!=typeof e.authorizes_call_contract?"authorizes_call_contract: boolean expected":null!=e.authorizes_transaction_application&&e.hasOwnProperty("authorizes_transaction_application")&&"boolean"!=typeof e.authorizes_transaction_application?"authorizes_transaction_application: boolean expected":null!=e.authorizes_upload_contract&&e.hasOwnProperty("authorizes_upload_contract")&&"boolean"!=typeof e.authorizes_upload_contract?"authorizes_upload_contract: boolean expected":null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.upload_contract_operation)return e;var t=new l.koinos.protocol.upload_contract_operation;return null!=e.contract_id&&("string"==typeof e.contract_id?c.base64.decode(e.contract_id,t.contract_id=c.newBuffer(c.base64.length(e.contract_id)),0):e.contract_id.length>=0&&(t.contract_id=e.contract_id)),null!=e.bytecode&&("string"==typeof e.bytecode?c.base64.decode(e.bytecode,t.bytecode=c.newBuffer(c.base64.length(e.bytecode)),0):e.bytecode.length>=0&&(t.bytecode=e.bytecode)),null!=e.abi&&(t.abi=String(e.abi)),null!=e.authorizes_call_contract&&(t.authorizes_call_contract=Boolean(e.authorizes_call_contract)),null!=e.authorizes_transaction_application&&(t.authorizes_transaction_application=Boolean(e.authorizes_transaction_application)),null!=e.authorizes_upload_contract&&(t.authorizes_upload_contract=Boolean(e.authorizes_upload_contract)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(t.bytes===String?r.contract_id="":(r.contract_id=[],t.bytes!==Array&&(r.contract_id=c.newBuffer(r.contract_id))),t.bytes===String?r.bytecode="":(r.bytecode=[],t.bytes!==Array&&(r.bytecode=c.newBuffer(r.bytecode))),r.abi="",r.authorizes_call_contract=!1,r.authorizes_transaction_application=!1,r.authorizes_upload_contract=!1),null!=e.contract_id&&e.hasOwnProperty("contract_id")&&(r.contract_id=t.bytes===String?c.base64.encode(e.contract_id,0,e.contract_id.length):t.bytes===Array?Array.prototype.slice.call(e.contract_id):e.contract_id),null!=e.bytecode&&e.hasOwnProperty("bytecode")&&(r.bytecode=t.bytes===String?c.base64.encode(e.bytecode,0,e.bytecode.length):t.bytes===Array?Array.prototype.slice.call(e.bytecode):e.bytecode),null!=e.abi&&e.hasOwnProperty("abi")&&(r.abi=e.abi),null!=e.authorizes_call_contract&&e.hasOwnProperty("authorizes_call_contract")&&(r.authorizes_call_contract=e.authorizes_call_contract),null!=e.authorizes_transaction_application&&e.hasOwnProperty("authorizes_transaction_application")&&(r.authorizes_transaction_application=e.authorizes_transaction_application),null!=e.authorizes_upload_contract&&e.hasOwnProperty("authorizes_upload_contract")&&(r.authorizes_upload_contract=e.authorizes_upload_contract),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.upload_contract_operation"},t}(),n.call_contract_operation=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.contract_id=c.newBuffer([]),t.prototype.entry_point=0,t.prototype.args=c.newBuffer([]),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.contract_id&&Object.hasOwnProperty.call(e,"contract_id")&&t.uint32(10).bytes(e.contract_id),null!=e.entry_point&&Object.hasOwnProperty.call(e,"entry_point")&&t.uint32(16).uint32(e.entry_point),null!=e.args&&Object.hasOwnProperty.call(e,"args")&&t.uint32(26).bytes(e.args),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.call_contract_operation;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.contract_id=e.bytes();break;case 2:n.entry_point=e.uint32();break;case 3:n.args=e.bytes();break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.contract_id&&e.hasOwnProperty("contract_id")&&!(e.contract_id&&"number"==typeof e.contract_id.length||c.isString(e.contract_id))?"contract_id: buffer expected":null!=e.entry_point&&e.hasOwnProperty("entry_point")&&!c.isInteger(e.entry_point)?"entry_point: integer expected":null!=e.args&&e.hasOwnProperty("args")&&!(e.args&&"number"==typeof e.args.length||c.isString(e.args))?"args: buffer expected":null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.call_contract_operation)return e;var t=new l.koinos.protocol.call_contract_operation;return null!=e.contract_id&&("string"==typeof e.contract_id?c.base64.decode(e.contract_id,t.contract_id=c.newBuffer(c.base64.length(e.contract_id)),0):e.contract_id.length>=0&&(t.contract_id=e.contract_id)),null!=e.entry_point&&(t.entry_point=e.entry_point>>>0),null!=e.args&&("string"==typeof e.args?c.base64.decode(e.args,t.args=c.newBuffer(c.base64.length(e.args)),0):e.args.length>=0&&(t.args=e.args)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(t.bytes===String?r.contract_id="":(r.contract_id=[],t.bytes!==Array&&(r.contract_id=c.newBuffer(r.contract_id))),r.entry_point=0,t.bytes===String?r.args="":(r.args=[],t.bytes!==Array&&(r.args=c.newBuffer(r.args)))),null!=e.contract_id&&e.hasOwnProperty("contract_id")&&(r.contract_id=t.bytes===String?c.base64.encode(e.contract_id,0,e.contract_id.length):t.bytes===Array?Array.prototype.slice.call(e.contract_id):e.contract_id),null!=e.entry_point&&e.hasOwnProperty("entry_point")&&(r.entry_point=e.entry_point),null!=e.args&&e.hasOwnProperty("args")&&(r.args=t.bytes===String?c.base64.encode(e.args,0,e.args.length):t.bytes===Array?Array.prototype.slice.call(e.args):e.args),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.call_contract_operation"},t}(),n.set_system_call_operation=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.call_id=0,t.prototype.target=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.call_id&&Object.hasOwnProperty.call(e,"call_id")&&t.uint32(8).uint32(e.call_id),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&l.koinos.protocol.system_call_target.encode(e.target,t.uint32(18).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.set_system_call_operation;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.call_id=e.uint32();break;case 2:n.target=l.koinos.protocol.system_call_target.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.call_id&&e.hasOwnProperty("call_id")&&!c.isInteger(e.call_id))return"call_id: integer expected";if(null!=e.target&&e.hasOwnProperty("target")){var t=l.koinos.protocol.system_call_target.verify(e.target);if(t)return"target."+t}return null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.set_system_call_operation)return e;var t=new l.koinos.protocol.set_system_call_operation;if(null!=e.call_id&&(t.call_id=e.call_id>>>0),null!=e.target){if("object"!=typeof e.target)throw TypeError(".koinos.protocol.set_system_call_operation.target: object expected");t.target=l.koinos.protocol.system_call_target.fromObject(e.target)}return t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.call_id=0,r.target=null),null!=e.call_id&&e.hasOwnProperty("call_id")&&(r.call_id=e.call_id),null!=e.target&&e.hasOwnProperty("target")&&(r.target=l.koinos.protocol.system_call_target.toObject(e.target,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.set_system_call_operation"},t}(),n.set_system_contract_operation=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.contract_id=c.newBuffer([]),t.prototype.system_contract=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.contract_id&&Object.hasOwnProperty.call(e,"contract_id")&&t.uint32(10).bytes(e.contract_id),null!=e.system_contract&&Object.hasOwnProperty.call(e,"system_contract")&&t.uint32(16).bool(e.system_contract),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.set_system_contract_operation;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.contract_id=e.bytes();break;case 2:n.system_contract=e.bool();break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.contract_id&&e.hasOwnProperty("contract_id")&&!(e.contract_id&&"number"==typeof e.contract_id.length||c.isString(e.contract_id))?"contract_id: buffer expected":null!=e.system_contract&&e.hasOwnProperty("system_contract")&&"boolean"!=typeof e.system_contract?"system_contract: boolean expected":null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.set_system_contract_operation)return e;var t=new l.koinos.protocol.set_system_contract_operation;return null!=e.contract_id&&("string"==typeof e.contract_id?c.base64.decode(e.contract_id,t.contract_id=c.newBuffer(c.base64.length(e.contract_id)),0):e.contract_id.length>=0&&(t.contract_id=e.contract_id)),null!=e.system_contract&&(t.system_contract=Boolean(e.system_contract)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(t.bytes===String?r.contract_id="":(r.contract_id=[],t.bytes!==Array&&(r.contract_id=c.newBuffer(r.contract_id))),r.system_contract=!1),null!=e.contract_id&&e.hasOwnProperty("contract_id")&&(r.contract_id=t.bytes===String?c.base64.encode(e.contract_id,0,e.contract_id.length):t.bytes===Array?Array.prototype.slice.call(e.contract_id):e.contract_id),null!=e.system_contract&&e.hasOwnProperty("system_contract")&&(r.system_contract=e.system_contract),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.set_system_contract_operation"},t}(),n.operation=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var r;return t.prototype.upload_contract=null,t.prototype.call_contract=null,t.prototype.set_system_call=null,t.prototype.set_system_contract=null,Object.defineProperty(t.prototype,"op",{get:c.oneOfGetter(r=["upload_contract","call_contract","set_system_call","set_system_contract"]),set:c.oneOfSetter(r)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.upload_contract&&Object.hasOwnProperty.call(e,"upload_contract")&&l.koinos.protocol.upload_contract_operation.encode(e.upload_contract,t.uint32(10).fork()).ldelim(),null!=e.call_contract&&Object.hasOwnProperty.call(e,"call_contract")&&l.koinos.protocol.call_contract_operation.encode(e.call_contract,t.uint32(18).fork()).ldelim(),null!=e.set_system_call&&Object.hasOwnProperty.call(e,"set_system_call")&&l.koinos.protocol.set_system_call_operation.encode(e.set_system_call,t.uint32(26).fork()).ldelim(),null!=e.set_system_contract&&Object.hasOwnProperty.call(e,"set_system_contract")&&l.koinos.protocol.set_system_contract_operation.encode(e.set_system_contract,t.uint32(34).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.operation;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.upload_contract=l.koinos.protocol.upload_contract_operation.decode(e,e.uint32());break;case 2:n.call_contract=l.koinos.protocol.call_contract_operation.decode(e,e.uint32());break;case 3:n.set_system_call=l.koinos.protocol.set_system_call_operation.decode(e,e.uint32());break;case 4:n.set_system_contract=l.koinos.protocol.set_system_contract_operation.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.upload_contract&&e.hasOwnProperty("upload_contract")&&(t.op=1,r=l.koinos.protocol.upload_contract_operation.verify(e.upload_contract)))return"upload_contract."+r;if(null!=e.call_contract&&e.hasOwnProperty("call_contract")){if(1===t.op)return"op: multiple values";if(t.op=1,r=l.koinos.protocol.call_contract_operation.verify(e.call_contract))return"call_contract."+r}if(null!=e.set_system_call&&e.hasOwnProperty("set_system_call")){if(1===t.op)return"op: multiple values";if(t.op=1,r=l.koinos.protocol.set_system_call_operation.verify(e.set_system_call))return"set_system_call."+r}if(null!=e.set_system_contract&&e.hasOwnProperty("set_system_contract")){if(1===t.op)return"op: multiple values";var r;if(t.op=1,r=l.koinos.protocol.set_system_contract_operation.verify(e.set_system_contract))return"set_system_contract."+r}return null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.operation)return e;var t=new l.koinos.protocol.operation;if(null!=e.upload_contract){if("object"!=typeof e.upload_contract)throw TypeError(".koinos.protocol.operation.upload_contract: object expected");t.upload_contract=l.koinos.protocol.upload_contract_operation.fromObject(e.upload_contract)}if(null!=e.call_contract){if("object"!=typeof e.call_contract)throw TypeError(".koinos.protocol.operation.call_contract: object expected");t.call_contract=l.koinos.protocol.call_contract_operation.fromObject(e.call_contract)}if(null!=e.set_system_call){if("object"!=typeof e.set_system_call)throw TypeError(".koinos.protocol.operation.set_system_call: object expected");t.set_system_call=l.koinos.protocol.set_system_call_operation.fromObject(e.set_system_call)}if(null!=e.set_system_contract){if("object"!=typeof e.set_system_contract)throw TypeError(".koinos.protocol.operation.set_system_contract: object expected");t.set_system_contract=l.koinos.protocol.set_system_contract_operation.fromObject(e.set_system_contract)}return t},t.toObject=function(e,t){t||(t={});var r={};return null!=e.upload_contract&&e.hasOwnProperty("upload_contract")&&(r.upload_contract=l.koinos.protocol.upload_contract_operation.toObject(e.upload_contract,t),t.oneofs&&(r.op="upload_contract")),null!=e.call_contract&&e.hasOwnProperty("call_contract")&&(r.call_contract=l.koinos.protocol.call_contract_operation.toObject(e.call_contract,t),t.oneofs&&(r.op="call_contract")),null!=e.set_system_call&&e.hasOwnProperty("set_system_call")&&(r.set_system_call=l.koinos.protocol.set_system_call_operation.toObject(e.set_system_call,t),t.oneofs&&(r.op="set_system_call")),null!=e.set_system_contract&&e.hasOwnProperty("set_system_contract")&&(r.set_system_contract=l.koinos.protocol.set_system_contract_operation.toObject(e.set_system_contract,t),t.oneofs&&(r.op="set_system_contract")),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.operation"},t}(),n.transaction_header=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.chain_id=c.newBuffer([]),t.prototype.rc_limit=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.nonce=c.newBuffer([]),t.prototype.operation_merkle_root=c.newBuffer([]),t.prototype.payer=c.newBuffer([]),t.prototype.payee=c.newBuffer([]),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.chain_id&&Object.hasOwnProperty.call(e,"chain_id")&&t.uint32(10).bytes(e.chain_id),null!=e.rc_limit&&Object.hasOwnProperty.call(e,"rc_limit")&&t.uint32(16).uint64(e.rc_limit),null!=e.nonce&&Object.hasOwnProperty.call(e,"nonce")&&t.uint32(26).bytes(e.nonce),null!=e.operation_merkle_root&&Object.hasOwnProperty.call(e,"operation_merkle_root")&&t.uint32(34).bytes(e.operation_merkle_root),null!=e.payer&&Object.hasOwnProperty.call(e,"payer")&&t.uint32(42).bytes(e.payer),null!=e.payee&&Object.hasOwnProperty.call(e,"payee")&&t.uint32(50).bytes(e.payee),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.transaction_header;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.chain_id=e.bytes();break;case 2:n.rc_limit=e.uint64();break;case 3:n.nonce=e.bytes();break;case 4:n.operation_merkle_root=e.bytes();break;case 5:n.payer=e.bytes();break;case 6:n.payee=e.bytes();break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.chain_id&&e.hasOwnProperty("chain_id")&&!(e.chain_id&&"number"==typeof e.chain_id.length||c.isString(e.chain_id))?"chain_id: buffer expected":null!=e.rc_limit&&e.hasOwnProperty("rc_limit")&&!(c.isInteger(e.rc_limit)||e.rc_limit&&c.isInteger(e.rc_limit.low)&&c.isInteger(e.rc_limit.high))?"rc_limit: integer|Long expected":null!=e.nonce&&e.hasOwnProperty("nonce")&&!(e.nonce&&"number"==typeof e.nonce.length||c.isString(e.nonce))?"nonce: buffer expected":null!=e.operation_merkle_root&&e.hasOwnProperty("operation_merkle_root")&&!(e.operation_merkle_root&&"number"==typeof e.operation_merkle_root.length||c.isString(e.operation_merkle_root))?"operation_merkle_root: buffer expected":null!=e.payer&&e.hasOwnProperty("payer")&&!(e.payer&&"number"==typeof e.payer.length||c.isString(e.payer))?"payer: buffer expected":null!=e.payee&&e.hasOwnProperty("payee")&&!(e.payee&&"number"==typeof e.payee.length||c.isString(e.payee))?"payee: buffer expected":null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.transaction_header)return e;var t=new l.koinos.protocol.transaction_header;return null!=e.chain_id&&("string"==typeof e.chain_id?c.base64.decode(e.chain_id,t.chain_id=c.newBuffer(c.base64.length(e.chain_id)),0):e.chain_id.length>=0&&(t.chain_id=e.chain_id)),null!=e.rc_limit&&(c.Long?(t.rc_limit=c.Long.fromValue(e.rc_limit)).unsigned=!0:"string"==typeof e.rc_limit?t.rc_limit=parseInt(e.rc_limit,10):"number"==typeof e.rc_limit?t.rc_limit=e.rc_limit:"object"==typeof e.rc_limit&&(t.rc_limit=new c.LongBits(e.rc_limit.low>>>0,e.rc_limit.high>>>0).toNumber(!0))),null!=e.nonce&&("string"==typeof e.nonce?c.base64.decode(e.nonce,t.nonce=c.newBuffer(c.base64.length(e.nonce)),0):e.nonce.length>=0&&(t.nonce=e.nonce)),null!=e.operation_merkle_root&&("string"==typeof e.operation_merkle_root?c.base64.decode(e.operation_merkle_root,t.operation_merkle_root=c.newBuffer(c.base64.length(e.operation_merkle_root)),0):e.operation_merkle_root.length>=0&&(t.operation_merkle_root=e.operation_merkle_root)),null!=e.payer&&("string"==typeof e.payer?c.base64.decode(e.payer,t.payer=c.newBuffer(c.base64.length(e.payer)),0):e.payer.length>=0&&(t.payer=e.payer)),null!=e.payee&&("string"==typeof e.payee?c.base64.decode(e.payee,t.payee=c.newBuffer(c.base64.length(e.payee)),0):e.payee.length>=0&&(t.payee=e.payee)),t},t.toObject=function(e,t){t||(t={});var r={};if(t.defaults){if(t.bytes===String?r.chain_id="":(r.chain_id=[],t.bytes!==Array&&(r.chain_id=c.newBuffer(r.chain_id))),c.Long){var n=new c.Long(0,0,!0);r.rc_limit=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.rc_limit=t.longs===String?"0":0;t.bytes===String?r.nonce="":(r.nonce=[],t.bytes!==Array&&(r.nonce=c.newBuffer(r.nonce))),t.bytes===String?r.operation_merkle_root="":(r.operation_merkle_root=[],t.bytes!==Array&&(r.operation_merkle_root=c.newBuffer(r.operation_merkle_root))),t.bytes===String?r.payer="":(r.payer=[],t.bytes!==Array&&(r.payer=c.newBuffer(r.payer))),t.bytes===String?r.payee="":(r.payee=[],t.bytes!==Array&&(r.payee=c.newBuffer(r.payee)))}return null!=e.chain_id&&e.hasOwnProperty("chain_id")&&(r.chain_id=t.bytes===String?c.base64.encode(e.chain_id,0,e.chain_id.length):t.bytes===Array?Array.prototype.slice.call(e.chain_id):e.chain_id),null!=e.rc_limit&&e.hasOwnProperty("rc_limit")&&("number"==typeof e.rc_limit?r.rc_limit=t.longs===String?String(e.rc_limit):e.rc_limit:r.rc_limit=t.longs===String?c.Long.prototype.toString.call(e.rc_limit):t.longs===Number?new c.LongBits(e.rc_limit.low>>>0,e.rc_limit.high>>>0).toNumber(!0):e.rc_limit),null!=e.nonce&&e.hasOwnProperty("nonce")&&(r.nonce=t.bytes===String?c.base64.encode(e.nonce,0,e.nonce.length):t.bytes===Array?Array.prototype.slice.call(e.nonce):e.nonce),null!=e.operation_merkle_root&&e.hasOwnProperty("operation_merkle_root")&&(r.operation_merkle_root=t.bytes===String?c.base64.encode(e.operation_merkle_root,0,e.operation_merkle_root.length):t.bytes===Array?Array.prototype.slice.call(e.operation_merkle_root):e.operation_merkle_root),null!=e.payer&&e.hasOwnProperty("payer")&&(r.payer=t.bytes===String?c.base64.encode(e.payer,0,e.payer.length):t.bytes===Array?Array.prototype.slice.call(e.payer):e.payer),null!=e.payee&&e.hasOwnProperty("payee")&&(r.payee=t.bytes===String?c.base64.encode(e.payee,0,e.payee.length):t.bytes===Array?Array.prototype.slice.call(e.payee):e.payee),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.transaction_header"},t}(),n.transaction=function(){function t(e){if(this.operations=[],this.signatures=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.id=c.newBuffer([]),t.prototype.header=null,t.prototype.operations=c.emptyArray,t.prototype.signatures=c.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).bytes(e.id),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&l.koinos.protocol.transaction_header.encode(e.header,t.uint32(18).fork()).ldelim(),null!=e.operations&&e.operations.length)for(var r=0;r<e.operations.length;++r)l.koinos.protocol.operation.encode(e.operations[r],t.uint32(26).fork()).ldelim();if(null!=e.signatures&&e.signatures.length)for(r=0;r<e.signatures.length;++r)t.uint32(34).bytes(e.signatures[r]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.transaction;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.id=e.bytes();break;case 2:n.header=l.koinos.protocol.transaction_header.decode(e,e.uint32());break;case 3:n.operations&&n.operations.length||(n.operations=[]),n.operations.push(l.koinos.protocol.operation.decode(e,e.uint32()));break;case 4:n.signatures&&n.signatures.length||(n.signatures=[]),n.signatures.push(e.bytes());break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!(e.id&&"number"==typeof e.id.length||c.isString(e.id)))return"id: buffer expected";if(null!=e.header&&e.hasOwnProperty("header")&&(r=l.koinos.protocol.transaction_header.verify(e.header)))return"header."+r;if(null!=e.operations&&e.hasOwnProperty("operations")){if(!Array.isArray(e.operations))return"operations: array expected";for(var t=0;t<e.operations.length;++t){var r;if(r=l.koinos.protocol.operation.verify(e.operations[t]))return"operations."+r}}if(null!=e.signatures&&e.hasOwnProperty("signatures")){if(!Array.isArray(e.signatures))return"signatures: array expected";for(t=0;t<e.signatures.length;++t)if(!(e.signatures[t]&&"number"==typeof e.signatures[t].length||c.isString(e.signatures[t])))return"signatures: buffer[] expected"}return null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.transaction)return e;var t=new l.koinos.protocol.transaction;if(null!=e.id&&("string"==typeof e.id?c.base64.decode(e.id,t.id=c.newBuffer(c.base64.length(e.id)),0):e.id.length>=0&&(t.id=e.id)),null!=e.header){if("object"!=typeof e.header)throw TypeError(".koinos.protocol.transaction.header: object expected");t.header=l.koinos.protocol.transaction_header.fromObject(e.header)}if(e.operations){if(!Array.isArray(e.operations))throw TypeError(".koinos.protocol.transaction.operations: array expected");t.operations=[];for(var r=0;r<e.operations.length;++r){if("object"!=typeof e.operations[r])throw TypeError(".koinos.protocol.transaction.operations: object expected");t.operations[r]=l.koinos.protocol.operation.fromObject(e.operations[r])}}if(e.signatures){if(!Array.isArray(e.signatures))throw TypeError(".koinos.protocol.transaction.signatures: array expected");for(t.signatures=[],r=0;r<e.signatures.length;++r)"string"==typeof e.signatures[r]?c.base64.decode(e.signatures[r],t.signatures[r]=c.newBuffer(c.base64.length(e.signatures[r])),0):e.signatures[r].length>=0&&(t.signatures[r]=e.signatures[r])}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.operations=[],r.signatures=[]),t.defaults&&(t.bytes===String?r.id="":(r.id=[],t.bytes!==Array&&(r.id=c.newBuffer(r.id))),r.header=null),null!=e.id&&e.hasOwnProperty("id")&&(r.id=t.bytes===String?c.base64.encode(e.id,0,e.id.length):t.bytes===Array?Array.prototype.slice.call(e.id):e.id),null!=e.header&&e.hasOwnProperty("header")&&(r.header=l.koinos.protocol.transaction_header.toObject(e.header,t)),e.operations&&e.operations.length){r.operations=[];for(var n=0;n<e.operations.length;++n)r.operations[n]=l.koinos.protocol.operation.toObject(e.operations[n],t)}if(e.signatures&&e.signatures.length)for(r.signatures=[],n=0;n<e.signatures.length;++n)r.signatures[n]=t.bytes===String?c.base64.encode(e.signatures[n],0,e.signatures[n].length):t.bytes===Array?Array.prototype.slice.call(e.signatures[n]):e.signatures[n];return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.transaction"},t}(),n.transaction_receipt=function(){function t(e){if(this.events=[],this.logs=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.id=c.newBuffer([]),t.prototype.payer=c.newBuffer([]),t.prototype.max_payer_rc=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.rc_limit=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.rc_used=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.disk_storage_used=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.network_bandwidth_used=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.compute_bandwidth_used=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.reverted=!1,t.prototype.events=c.emptyArray,t.prototype.logs=c.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).bytes(e.id),null!=e.payer&&Object.hasOwnProperty.call(e,"payer")&&t.uint32(18).bytes(e.payer),null!=e.max_payer_rc&&Object.hasOwnProperty.call(e,"max_payer_rc")&&t.uint32(24).uint64(e.max_payer_rc),null!=e.rc_limit&&Object.hasOwnProperty.call(e,"rc_limit")&&t.uint32(32).uint64(e.rc_limit),null!=e.rc_used&&Object.hasOwnProperty.call(e,"rc_used")&&t.uint32(40).uint64(e.rc_used),null!=e.disk_storage_used&&Object.hasOwnProperty.call(e,"disk_storage_used")&&t.uint32(48).uint64(e.disk_storage_used),null!=e.network_bandwidth_used&&Object.hasOwnProperty.call(e,"network_bandwidth_used")&&t.uint32(56).uint64(e.network_bandwidth_used),null!=e.compute_bandwidth_used&&Object.hasOwnProperty.call(e,"compute_bandwidth_used")&&t.uint32(64).uint64(e.compute_bandwidth_used),null!=e.reverted&&Object.hasOwnProperty.call(e,"reverted")&&t.uint32(72).bool(e.reverted),null!=e.events&&e.events.length)for(var r=0;r<e.events.length;++r)l.koinos.protocol.event_data.encode(e.events[r],t.uint32(82).fork()).ldelim();if(null!=e.logs&&e.logs.length)for(r=0;r<e.logs.length;++r)t.uint32(90).string(e.logs[r]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.transaction_receipt;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.id=e.bytes();break;case 2:n.payer=e.bytes();break;case 3:n.max_payer_rc=e.uint64();break;case 4:n.rc_limit=e.uint64();break;case 5:n.rc_used=e.uint64();break;case 6:n.disk_storage_used=e.uint64();break;case 7:n.network_bandwidth_used=e.uint64();break;case 8:n.compute_bandwidth_used=e.uint64();break;case 9:n.reverted=e.bool();break;case 10:n.events&&n.events.length||(n.events=[]),n.events.push(l.koinos.protocol.event_data.decode(e,e.uint32()));break;case 11:n.logs&&n.logs.length||(n.logs=[]),n.logs.push(e.string());break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!(e.id&&"number"==typeof e.id.length||c.isString(e.id)))return"id: buffer expected";if(null!=e.payer&&e.hasOwnProperty("payer")&&!(e.payer&&"number"==typeof e.payer.length||c.isString(e.payer)))return"payer: buffer expected";if(null!=e.max_payer_rc&&e.hasOwnProperty("max_payer_rc")&&!(c.isInteger(e.max_payer_rc)||e.max_payer_rc&&c.isInteger(e.max_payer_rc.low)&&c.isInteger(e.max_payer_rc.high)))return"max_payer_rc: integer|Long expected";if(null!=e.rc_limit&&e.hasOwnProperty("rc_limit")&&!(c.isInteger(e.rc_limit)||e.rc_limit&&c.isInteger(e.rc_limit.low)&&c.isInteger(e.rc_limit.high)))return"rc_limit: integer|Long expected";if(null!=e.rc_used&&e.hasOwnProperty("rc_used")&&!(c.isInteger(e.rc_used)||e.rc_used&&c.isInteger(e.rc_used.low)&&c.isInteger(e.rc_used.high)))return"rc_used: integer|Long expected";if(null!=e.disk_storage_used&&e.hasOwnProperty("disk_storage_used")&&!(c.isInteger(e.disk_storage_used)||e.disk_storage_used&&c.isInteger(e.disk_storage_used.low)&&c.isInteger(e.disk_storage_used.high)))return"disk_storage_used: integer|Long expected";if(null!=e.network_bandwidth_used&&e.hasOwnProperty("network_bandwidth_used")&&!(c.isInteger(e.network_bandwidth_used)||e.network_bandwidth_used&&c.isInteger(e.network_bandwidth_used.low)&&c.isInteger(e.network_bandwidth_used.high)))return"network_bandwidth_used: integer|Long expected";if(null!=e.compute_bandwidth_used&&e.hasOwnProperty("compute_bandwidth_used")&&!(c.isInteger(e.compute_bandwidth_used)||e.compute_bandwidth_used&&c.isInteger(e.compute_bandwidth_used.low)&&c.isInteger(e.compute_bandwidth_used.high)))return"compute_bandwidth_used: integer|Long expected";if(null!=e.reverted&&e.hasOwnProperty("reverted")&&"boolean"!=typeof e.reverted)return"reverted: boolean expected";if(null!=e.events&&e.hasOwnProperty("events")){if(!Array.isArray(e.events))return"events: array expected";for(var t=0;t<e.events.length;++t){var r=l.koinos.protocol.event_data.verify(e.events[t]);if(r)return"events."+r}}if(null!=e.logs&&e.hasOwnProperty("logs")){if(!Array.isArray(e.logs))return"logs: array expected";for(t=0;t<e.logs.length;++t)if(!c.isString(e.logs[t]))return"logs: string[] expected"}return null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.transaction_receipt)return e;var t=new l.koinos.protocol.transaction_receipt;if(null!=e.id&&("string"==typeof e.id?c.base64.decode(e.id,t.id=c.newBuffer(c.base64.length(e.id)),0):e.id.length>=0&&(t.id=e.id)),null!=e.payer&&("string"==typeof e.payer?c.base64.decode(e.payer,t.payer=c.newBuffer(c.base64.length(e.payer)),0):e.payer.length>=0&&(t.payer=e.payer)),null!=e.max_payer_rc&&(c.Long?(t.max_payer_rc=c.Long.fromValue(e.max_payer_rc)).unsigned=!0:"string"==typeof e.max_payer_rc?t.max_payer_rc=parseInt(e.max_payer_rc,10):"number"==typeof e.max_payer_rc?t.max_payer_rc=e.max_payer_rc:"object"==typeof e.max_payer_rc&&(t.max_payer_rc=new c.LongBits(e.max_payer_rc.low>>>0,e.max_payer_rc.high>>>0).toNumber(!0))),null!=e.rc_limit&&(c.Long?(t.rc_limit=c.Long.fromValue(e.rc_limit)).unsigned=!0:"string"==typeof e.rc_limit?t.rc_limit=parseInt(e.rc_limit,10):"number"==typeof e.rc_limit?t.rc_limit=e.rc_limit:"object"==typeof e.rc_limit&&(t.rc_limit=new c.LongBits(e.rc_limit.low>>>0,e.rc_limit.high>>>0).toNumber(!0))),null!=e.rc_used&&(c.Long?(t.rc_used=c.Long.fromValue(e.rc_used)).unsigned=!0:"string"==typeof e.rc_used?t.rc_used=parseInt(e.rc_used,10):"number"==typeof e.rc_used?t.rc_used=e.rc_used:"object"==typeof e.rc_used&&(t.rc_used=new c.LongBits(e.rc_used.low>>>0,e.rc_used.high>>>0).toNumber(!0))),null!=e.disk_storage_used&&(c.Long?(t.disk_storage_used=c.Long.fromValue(e.disk_storage_used)).unsigned=!0:"string"==typeof e.disk_storage_used?t.disk_storage_used=parseInt(e.disk_storage_used,10):"number"==typeof e.disk_storage_used?t.disk_storage_used=e.disk_storage_used:"object"==typeof e.disk_storage_used&&(t.disk_storage_used=new c.LongBits(e.disk_storage_used.low>>>0,e.disk_storage_used.high>>>0).toNumber(!0))),null!=e.network_bandwidth_used&&(c.Long?(t.network_bandwidth_used=c.Long.fromValue(e.network_bandwidth_used)).unsigned=!0:"string"==typeof e.network_bandwidth_used?t.network_bandwidth_used=parseInt(e.network_bandwidth_used,10):"number"==typeof e.network_bandwidth_used?t.network_bandwidth_used=e.network_bandwidth_used:"object"==typeof e.network_bandwidth_used&&(t.network_bandwidth_used=new c.LongBits(e.network_bandwidth_used.low>>>0,e.network_bandwidth_used.high>>>0).toNumber(!0))),null!=e.compute_bandwidth_used&&(c.Long?(t.compute_bandwidth_used=c.Long.fromValue(e.compute_bandwidth_used)).unsigned=!0:"string"==typeof e.compute_bandwidth_used?t.compute_bandwidth_used=parseInt(e.compute_bandwidth_used,10):"number"==typeof e.compute_bandwidth_used?t.compute_bandwidth_used=e.compute_bandwidth_used:"object"==typeof e.compute_bandwidth_used&&(t.compute_bandwidth_used=new c.LongBits(e.compute_bandwidth_used.low>>>0,e.compute_bandwidth_used.high>>>0).toNumber(!0))),null!=e.reverted&&(t.reverted=Boolean(e.reverted)),e.events){if(!Array.isArray(e.events))throw TypeError(".koinos.protocol.transaction_receipt.events: array expected");t.events=[];for(var r=0;r<e.events.length;++r){if("object"!=typeof e.events[r])throw TypeError(".koinos.protocol.transaction_receipt.events: object expected");t.events[r]=l.koinos.protocol.event_data.fromObject(e.events[r])}}if(e.logs){if(!Array.isArray(e.logs))throw TypeError(".koinos.protocol.transaction_receipt.logs: array expected");for(t.logs=[],r=0;r<e.logs.length;++r)t.logs[r]=String(e.logs[r])}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.events=[],r.logs=[]),t.defaults){if(t.bytes===String?r.id="":(r.id=[],t.bytes!==Array&&(r.id=c.newBuffer(r.id))),t.bytes===String?r.payer="":(r.payer=[],t.bytes!==Array&&(r.payer=c.newBuffer(r.payer))),c.Long){var n=new c.Long(0,0,!0);r.max_payer_rc=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.max_payer_rc=t.longs===String?"0":0;c.Long?(n=new c.Long(0,0,!0),r.rc_limit=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.rc_limit=t.longs===String?"0":0,c.Long?(n=new c.Long(0,0,!0),r.rc_used=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.rc_used=t.longs===String?"0":0,c.Long?(n=new c.Long(0,0,!0),r.disk_storage_used=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.disk_storage_used=t.longs===String?"0":0,c.Long?(n=new c.Long(0,0,!0),r.network_bandwidth_used=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.network_bandwidth_used=t.longs===String?"0":0,c.Long?(n=new c.Long(0,0,!0),r.compute_bandwidth_used=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.compute_bandwidth_used=t.longs===String?"0":0,r.reverted=!1}if(null!=e.id&&e.hasOwnProperty("id")&&(r.id=t.bytes===String?c.base64.encode(e.id,0,e.id.length):t.bytes===Array?Array.prototype.slice.call(e.id):e.id),null!=e.payer&&e.hasOwnProperty("payer")&&(r.payer=t.bytes===String?c.base64.encode(e.payer,0,e.payer.length):t.bytes===Array?Array.prototype.slice.call(e.payer):e.payer),null!=e.max_payer_rc&&e.hasOwnProperty("max_payer_rc")&&("number"==typeof e.max_payer_rc?r.max_payer_rc=t.longs===String?String(e.max_payer_rc):e.max_payer_rc:r.max_payer_rc=t.longs===String?c.Long.prototype.toString.call(e.max_payer_rc):t.longs===Number?new c.LongBits(e.max_payer_rc.low>>>0,e.max_payer_rc.high>>>0).toNumber(!0):e.max_payer_rc),null!=e.rc_limit&&e.hasOwnProperty("rc_limit")&&("number"==typeof e.rc_limit?r.rc_limit=t.longs===String?String(e.rc_limit):e.rc_limit:r.rc_limit=t.longs===String?c.Long.prototype.toString.call(e.rc_limit):t.longs===Number?new c.LongBits(e.rc_limit.low>>>0,e.rc_limit.high>>>0).toNumber(!0):e.rc_limit),null!=e.rc_used&&e.hasOwnProperty("rc_used")&&("number"==typeof e.rc_used?r.rc_used=t.longs===String?String(e.rc_used):e.rc_used:r.rc_used=t.longs===String?c.Long.prototype.toString.call(e.rc_used):t.longs===Number?new c.LongBits(e.rc_used.low>>>0,e.rc_used.high>>>0).toNumber(!0):e.rc_used),null!=e.disk_storage_used&&e.hasOwnProperty("disk_storage_used")&&("number"==typeof e.disk_storage_used?r.disk_storage_used=t.longs===String?String(e.disk_storage_used):e.disk_storage_used:r.disk_storage_used=t.longs===String?c.Long.prototype.toString.call(e.disk_storage_used):t.longs===Number?new c.LongBits(e.disk_storage_used.low>>>0,e.disk_storage_used.high>>>0).toNumber(!0):e.disk_storage_used),null!=e.network_bandwidth_used&&e.hasOwnProperty("network_bandwidth_used")&&("number"==typeof e.network_bandwidth_used?r.network_bandwidth_used=t.longs===String?String(e.network_bandwidth_used):e.network_bandwidth_used:r.network_bandwidth_used=t.longs===String?c.Long.prototype.toString.call(e.network_bandwidth_used):t.longs===Number?new c.LongBits(e.network_bandwidth_used.low>>>0,e.network_bandwidth_used.high>>>0).toNumber(!0):e.network_bandwidth_used),null!=e.compute_bandwidth_used&&e.hasOwnProperty("compute_bandwidth_used")&&("number"==typeof e.compute_bandwidth_used?r.compute_bandwidth_used=t.longs===String?String(e.compute_bandwidth_used):e.compute_bandwidth_used:r.compute_bandwidth_used=t.longs===String?c.Long.prototype.toString.call(e.compute_bandwidth_used):t.longs===Number?new c.LongBits(e.compute_bandwidth_used.low>>>0,e.compute_bandwidth_used.high>>>0).toNumber(!0):e.compute_bandwidth_used),null!=e.reverted&&e.hasOwnProperty("reverted")&&(r.reverted=e.reverted),e.events&&e.events.length){r.events=[];for(var o=0;o<e.events.length;++o)r.events[o]=l.koinos.protocol.event_data.toObject(e.events[o],t)}if(e.logs&&e.logs.length)for(r.logs=[],o=0;o<e.logs.length;++o)r.logs[o]=e.logs[o];return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.transaction_receipt"},t}(),n.block_header=function(){function t(e){if(this.approved_proposals=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.previous=c.newBuffer([]),t.prototype.height=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.timestamp=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.previous_state_merkle_root=c.newBuffer([]),t.prototype.transaction_merkle_root=c.newBuffer([]),t.prototype.signer=c.newBuffer([]),t.prototype.approved_proposals=c.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.previous&&Object.hasOwnProperty.call(e,"previous")&&t.uint32(10).bytes(e.previous),null!=e.height&&Object.hasOwnProperty.call(e,"height")&&t.uint32(16).uint64(e.height),null!=e.timestamp&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(24).uint64(e.timestamp),null!=e.previous_state_merkle_root&&Object.hasOwnProperty.call(e,"previous_state_merkle_root")&&t.uint32(34).bytes(e.previous_state_merkle_root),null!=e.transaction_merkle_root&&Object.hasOwnProperty.call(e,"transaction_merkle_root")&&t.uint32(42).bytes(e.transaction_merkle_root),null!=e.signer&&Object.hasOwnProperty.call(e,"signer")&&t.uint32(50).bytes(e.signer),null!=e.approved_proposals&&e.approved_proposals.length)for(var r=0;r<e.approved_proposals.length;++r)t.uint32(58).bytes(e.approved_proposals[r]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.block_header;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.previous=e.bytes();break;case 2:n.height=e.uint64();break;case 3:n.timestamp=e.uint64();break;case 4:n.previous_state_merkle_root=e.bytes();break;case 5:n.transaction_merkle_root=e.bytes();break;case 6:n.signer=e.bytes();break;case 7:n.approved_proposals&&n.approved_proposals.length||(n.approved_proposals=[]),n.approved_proposals.push(e.bytes());break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.previous&&e.hasOwnProperty("previous")&&!(e.previous&&"number"==typeof e.previous.length||c.isString(e.previous)))return"previous: buffer expected";if(null!=e.height&&e.hasOwnProperty("height")&&!(c.isInteger(e.height)||e.height&&c.isInteger(e.height.low)&&c.isInteger(e.height.high)))return"height: integer|Long expected";if(null!=e.timestamp&&e.hasOwnProperty("timestamp")&&!(c.isInteger(e.timestamp)||e.timestamp&&c.isInteger(e.timestamp.low)&&c.isInteger(e.timestamp.high)))return"timestamp: integer|Long expected";if(null!=e.previous_state_merkle_root&&e.hasOwnProperty("previous_state_merkle_root")&&!(e.previous_state_merkle_root&&"number"==typeof e.previous_state_merkle_root.length||c.isString(e.previous_state_merkle_root)))return"previous_state_merkle_root: buffer expected";if(null!=e.transaction_merkle_root&&e.hasOwnProperty("transaction_merkle_root")&&!(e.transaction_merkle_root&&"number"==typeof e.transaction_merkle_root.length||c.isString(e.transaction_merkle_root)))return"transaction_merkle_root: buffer expected";if(null!=e.signer&&e.hasOwnProperty("signer")&&!(e.signer&&"number"==typeof e.signer.length||c.isString(e.signer)))return"signer: buffer expected";if(null!=e.approved_proposals&&e.hasOwnProperty("approved_proposals")){if(!Array.isArray(e.approved_proposals))return"approved_proposals: array expected";for(var t=0;t<e.approved_proposals.length;++t)if(!(e.approved_proposals[t]&&"number"==typeof e.approved_proposals[t].length||c.isString(e.approved_proposals[t])))return"approved_proposals: buffer[] expected"}return null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.block_header)return e;var t=new l.koinos.protocol.block_header;if(null!=e.previous&&("string"==typeof e.previous?c.base64.decode(e.previous,t.previous=c.newBuffer(c.base64.length(e.previous)),0):e.previous.length>=0&&(t.previous=e.previous)),null!=e.height&&(c.Long?(t.height=c.Long.fromValue(e.height)).unsigned=!0:"string"==typeof e.height?t.height=parseInt(e.height,10):"number"==typeof e.height?t.height=e.height:"object"==typeof e.height&&(t.height=new c.LongBits(e.height.low>>>0,e.height.high>>>0).toNumber(!0))),null!=e.timestamp&&(c.Long?(t.timestamp=c.Long.fromValue(e.timestamp)).unsigned=!0:"string"==typeof e.timestamp?t.timestamp=parseInt(e.timestamp,10):"number"==typeof e.timestamp?t.timestamp=e.timestamp:"object"==typeof e.timestamp&&(t.timestamp=new c.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0))),null!=e.previous_state_merkle_root&&("string"==typeof e.previous_state_merkle_root?c.base64.decode(e.previous_state_merkle_root,t.previous_state_merkle_root=c.newBuffer(c.base64.length(e.previous_state_merkle_root)),0):e.previous_state_merkle_root.length>=0&&(t.previous_state_merkle_root=e.previous_state_merkle_root)),null!=e.transaction_merkle_root&&("string"==typeof e.transaction_merkle_root?c.base64.decode(e.transaction_merkle_root,t.transaction_merkle_root=c.newBuffer(c.base64.length(e.transaction_merkle_root)),0):e.transaction_merkle_root.length>=0&&(t.transaction_merkle_root=e.transaction_merkle_root)),null!=e.signer&&("string"==typeof e.signer?c.base64.decode(e.signer,t.signer=c.newBuffer(c.base64.length(e.signer)),0):e.signer.length>=0&&(t.signer=e.signer)),e.approved_proposals){if(!Array.isArray(e.approved_proposals))throw TypeError(".koinos.protocol.block_header.approved_proposals: array expected");t.approved_proposals=[];for(var r=0;r<e.approved_proposals.length;++r)"string"==typeof e.approved_proposals[r]?c.base64.decode(e.approved_proposals[r],t.approved_proposals[r]=c.newBuffer(c.base64.length(e.approved_proposals[r])),0):e.approved_proposals[r].length>=0&&(t.approved_proposals[r]=e.approved_proposals[r])}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.approved_proposals=[]),t.defaults){if(t.bytes===String?r.previous="":(r.previous=[],t.bytes!==Array&&(r.previous=c.newBuffer(r.previous))),c.Long){var n=new c.Long(0,0,!0);r.height=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.height=t.longs===String?"0":0;c.Long?(n=new c.Long(0,0,!0),r.timestamp=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.timestamp=t.longs===String?"0":0,t.bytes===String?r.previous_state_merkle_root="":(r.previous_state_merkle_root=[],t.bytes!==Array&&(r.previous_state_merkle_root=c.newBuffer(r.previous_state_merkle_root))),t.bytes===String?r.transaction_merkle_root="":(r.transaction_merkle_root=[],t.bytes!==Array&&(r.transaction_merkle_root=c.newBuffer(r.transaction_merkle_root))),t.bytes===String?r.signer="":(r.signer=[],t.bytes!==Array&&(r.signer=c.newBuffer(r.signer)))}if(null!=e.previous&&e.hasOwnProperty("previous")&&(r.previous=t.bytes===String?c.base64.encode(e.previous,0,e.previous.length):t.bytes===Array?Array.prototype.slice.call(e.previous):e.previous),null!=e.height&&e.hasOwnProperty("height")&&("number"==typeof e.height?r.height=t.longs===String?String(e.height):e.height:r.height=t.longs===String?c.Long.prototype.toString.call(e.height):t.longs===Number?new c.LongBits(e.height.low>>>0,e.height.high>>>0).toNumber(!0):e.height),null!=e.timestamp&&e.hasOwnProperty("timestamp")&&("number"==typeof e.timestamp?r.timestamp=t.longs===String?String(e.timestamp):e.timestamp:r.timestamp=t.longs===String?c.Long.prototype.toString.call(e.timestamp):t.longs===Number?new c.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0):e.timestamp),null!=e.previous_state_merkle_root&&e.hasOwnProperty("previous_state_merkle_root")&&(r.previous_state_merkle_root=t.bytes===String?c.base64.encode(e.previous_state_merkle_root,0,e.previous_state_merkle_root.length):t.bytes===Array?Array.prototype.slice.call(e.previous_state_merkle_root):e.previous_state_merkle_root),null!=e.transaction_merkle_root&&e.hasOwnProperty("transaction_merkle_root")&&(r.transaction_merkle_root=t.bytes===String?c.base64.encode(e.transaction_merkle_root,0,e.transaction_merkle_root.length):t.bytes===Array?Array.prototype.slice.call(e.transaction_merkle_root):e.transaction_merkle_root),null!=e.signer&&e.hasOwnProperty("signer")&&(r.signer=t.bytes===String?c.base64.encode(e.signer,0,e.signer.length):t.bytes===Array?Array.prototype.slice.call(e.signer):e.signer),e.approved_proposals&&e.approved_proposals.length){r.approved_proposals=[];for(var o=0;o<e.approved_proposals.length;++o)r.approved_proposals[o]=t.bytes===String?c.base64.encode(e.approved_proposals[o],0,e.approved_proposals[o].length):t.bytes===Array?Array.prototype.slice.call(e.approved_proposals[o]):e.approved_proposals[o]}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.block_header"},t}(),n.block=function(){function t(e){if(this.transactions=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.id=c.newBuffer([]),t.prototype.header=null,t.prototype.transactions=c.emptyArray,t.prototype.signature=c.newBuffer([]),t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).bytes(e.id),null!=e.header&&Object.hasOwnProperty.call(e,"header")&&l.koinos.protocol.block_header.encode(e.header,t.uint32(18).fork()).ldelim(),null!=e.transactions&&e.transactions.length)for(var r=0;r<e.transactions.length;++r)l.koinos.protocol.transaction.encode(e.transactions[r],t.uint32(26).fork()).ldelim();return null!=e.signature&&Object.hasOwnProperty.call(e,"signature")&&t.uint32(34).bytes(e.signature),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.block;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.id=e.bytes();break;case 2:n.header=l.koinos.protocol.block_header.decode(e,e.uint32());break;case 3:n.transactions&&n.transactions.length||(n.transactions=[]),n.transactions.push(l.koinos.protocol.transaction.decode(e,e.uint32()));break;case 4:n.signature=e.bytes();break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!(e.id&&"number"==typeof e.id.length||c.isString(e.id)))return"id: buffer expected";if(null!=e.header&&e.hasOwnProperty("header")&&(r=l.koinos.protocol.block_header.verify(e.header)))return"header."+r;if(null!=e.transactions&&e.hasOwnProperty("transactions")){if(!Array.isArray(e.transactions))return"transactions: array expected";for(var t=0;t<e.transactions.length;++t){var r;if(r=l.koinos.protocol.transaction.verify(e.transactions[t]))return"transactions."+r}}return null!=e.signature&&e.hasOwnProperty("signature")&&!(e.signature&&"number"==typeof e.signature.length||c.isString(e.signature))?"signature: buffer expected":null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.block)return e;var t=new l.koinos.protocol.block;if(null!=e.id&&("string"==typeof e.id?c.base64.decode(e.id,t.id=c.newBuffer(c.base64.length(e.id)),0):e.id.length>=0&&(t.id=e.id)),null!=e.header){if("object"!=typeof e.header)throw TypeError(".koinos.protocol.block.header: object expected");t.header=l.koinos.protocol.block_header.fromObject(e.header)}if(e.transactions){if(!Array.isArray(e.transactions))throw TypeError(".koinos.protocol.block.transactions: array expected");t.transactions=[];for(var r=0;r<e.transactions.length;++r){if("object"!=typeof e.transactions[r])throw TypeError(".koinos.protocol.block.transactions: object expected");t.transactions[r]=l.koinos.protocol.transaction.fromObject(e.transactions[r])}}return null!=e.signature&&("string"==typeof e.signature?c.base64.decode(e.signature,t.signature=c.newBuffer(c.base64.length(e.signature)),0):e.signature.length>=0&&(t.signature=e.signature)),t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.transactions=[]),t.defaults&&(t.bytes===String?r.id="":(r.id=[],t.bytes!==Array&&(r.id=c.newBuffer(r.id))),r.header=null,t.bytes===String?r.signature="":(r.signature=[],t.bytes!==Array&&(r.signature=c.newBuffer(r.signature)))),null!=e.id&&e.hasOwnProperty("id")&&(r.id=t.bytes===String?c.base64.encode(e.id,0,e.id.length):t.bytes===Array?Array.prototype.slice.call(e.id):e.id),null!=e.header&&e.hasOwnProperty("header")&&(r.header=l.koinos.protocol.block_header.toObject(e.header,t)),e.transactions&&e.transactions.length){r.transactions=[];for(var n=0;n<e.transactions.length;++n)r.transactions[n]=l.koinos.protocol.transaction.toObject(e.transactions[n],t)}return null!=e.signature&&e.hasOwnProperty("signature")&&(r.signature=t.bytes===String?c.base64.encode(e.signature,0,e.signature.length):t.bytes===Array?Array.prototype.slice.call(e.signature):e.signature),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.block"},t}(),n.block_receipt=function(){function t(e){if(this.events=[],this.transaction_receipts=[],this.logs=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.id=c.newBuffer([]),t.prototype.height=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.disk_storage_used=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.network_bandwidth_used=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.compute_bandwidth_used=c.Long?c.Long.fromBits(0,0,!0):0,t.prototype.state_merkle_root=c.newBuffer([]),t.prototype.events=c.emptyArray,t.prototype.transaction_receipts=c.emptyArray,t.prototype.logs=c.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).bytes(e.id),null!=e.height&&Object.hasOwnProperty.call(e,"height")&&t.uint32(16).uint64(e.height),null!=e.disk_storage_used&&Object.hasOwnProperty.call(e,"disk_storage_used")&&t.uint32(24).uint64(e.disk_storage_used),null!=e.network_bandwidth_used&&Object.hasOwnProperty.call(e,"network_bandwidth_used")&&t.uint32(32).uint64(e.network_bandwidth_used),null!=e.compute_bandwidth_used&&Object.hasOwnProperty.call(e,"compute_bandwidth_used")&&t.uint32(40).uint64(e.compute_bandwidth_used),null!=e.state_merkle_root&&Object.hasOwnProperty.call(e,"state_merkle_root")&&t.uint32(50).bytes(e.state_merkle_root),null!=e.events&&e.events.length)for(var r=0;r<e.events.length;++r)l.koinos.protocol.event_data.encode(e.events[r],t.uint32(58).fork()).ldelim();if(null!=e.transaction_receipts&&e.transaction_receipts.length)for(r=0;r<e.transaction_receipts.length;++r)l.koinos.protocol.transaction_receipt.encode(e.transaction_receipts[r],t.uint32(66).fork()).ldelim();if(null!=e.logs&&e.logs.length)for(r=0;r<e.logs.length;++r)t.uint32(74).string(e.logs[r]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.protocol.block_receipt;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.id=e.bytes();break;case 2:n.height=e.uint64();break;case 3:n.disk_storage_used=e.uint64();break;case 4:n.network_bandwidth_used=e.uint64();break;case 5:n.compute_bandwidth_used=e.uint64();break;case 6:n.state_merkle_root=e.bytes();break;case 7:n.events&&n.events.length||(n.events=[]),n.events.push(l.koinos.protocol.event_data.decode(e,e.uint32()));break;case 8:n.transaction_receipts&&n.transaction_receipts.length||(n.transaction_receipts=[]),n.transaction_receipts.push(l.koinos.protocol.transaction_receipt.decode(e,e.uint32()));break;case 9:n.logs&&n.logs.length||(n.logs=[]),n.logs.push(e.string());break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!(e.id&&"number"==typeof e.id.length||c.isString(e.id)))return"id: buffer expected";if(null!=e.height&&e.hasOwnProperty("height")&&!(c.isInteger(e.height)||e.height&&c.isInteger(e.height.low)&&c.isInteger(e.height.high)))return"height: integer|Long expected";if(null!=e.disk_storage_used&&e.hasOwnProperty("disk_storage_used")&&!(c.isInteger(e.disk_storage_used)||e.disk_storage_used&&c.isInteger(e.disk_storage_used.low)&&c.isInteger(e.disk_storage_used.high)))return"disk_storage_used: integer|Long expected";if(null!=e.network_bandwidth_used&&e.hasOwnProperty("network_bandwidth_used")&&!(c.isInteger(e.network_bandwidth_used)||e.network_bandwidth_used&&c.isInteger(e.network_bandwidth_used.low)&&c.isInteger(e.network_bandwidth_used.high)))return"network_bandwidth_used: integer|Long expected";if(null!=e.compute_bandwidth_used&&e.hasOwnProperty("compute_bandwidth_used")&&!(c.isInteger(e.compute_bandwidth_used)||e.compute_bandwidth_used&&c.isInteger(e.compute_bandwidth_used.low)&&c.isInteger(e.compute_bandwidth_used.high)))return"compute_bandwidth_used: integer|Long expected";if(null!=e.state_merkle_root&&e.hasOwnProperty("state_merkle_root")&&!(e.state_merkle_root&&"number"==typeof e.state_merkle_root.length||c.isString(e.state_merkle_root)))return"state_merkle_root: buffer expected";if(null!=e.events&&e.hasOwnProperty("events")){if(!Array.isArray(e.events))return"events: array expected";for(var t=0;t<e.events.length;++t)if(r=l.koinos.protocol.event_data.verify(e.events[t]))return"events."+r}if(null!=e.transaction_receipts&&e.hasOwnProperty("transaction_receipts")){if(!Array.isArray(e.transaction_receipts))return"transaction_receipts: array expected";for(t=0;t<e.transaction_receipts.length;++t){var r;if(r=l.koinos.protocol.transaction_receipt.verify(e.transaction_receipts[t]))return"transaction_receipts."+r}}if(null!=e.logs&&e.hasOwnProperty("logs")){if(!Array.isArray(e.logs))return"logs: array expected";for(t=0;t<e.logs.length;++t)if(!c.isString(e.logs[t]))return"logs: string[] expected"}return null},t.fromObject=function(e){if(e instanceof l.koinos.protocol.block_receipt)return e;var t=new l.koinos.protocol.block_receipt;if(null!=e.id&&("string"==typeof e.id?c.base64.decode(e.id,t.id=c.newBuffer(c.base64.length(e.id)),0):e.id.length>=0&&(t.id=e.id)),null!=e.height&&(c.Long?(t.height=c.Long.fromValue(e.height)).unsigned=!0:"string"==typeof e.height?t.height=parseInt(e.height,10):"number"==typeof e.height?t.height=e.height:"object"==typeof e.height&&(t.height=new c.LongBits(e.height.low>>>0,e.height.high>>>0).toNumber(!0))),null!=e.disk_storage_used&&(c.Long?(t.disk_storage_used=c.Long.fromValue(e.disk_storage_used)).unsigned=!0:"string"==typeof e.disk_storage_used?t.disk_storage_used=parseInt(e.disk_storage_used,10):"number"==typeof e.disk_storage_used?t.disk_storage_used=e.disk_storage_used:"object"==typeof e.disk_storage_used&&(t.disk_storage_used=new c.LongBits(e.disk_storage_used.low>>>0,e.disk_storage_used.high>>>0).toNumber(!0))),null!=e.network_bandwidth_used&&(c.Long?(t.network_bandwidth_used=c.Long.fromValue(e.network_bandwidth_used)).unsigned=!0:"string"==typeof e.network_bandwidth_used?t.network_bandwidth_used=parseInt(e.network_bandwidth_used,10):"number"==typeof e.network_bandwidth_used?t.network_bandwidth_used=e.network_bandwidth_used:"object"==typeof e.network_bandwidth_used&&(t.network_bandwidth_used=new c.LongBits(e.network_bandwidth_used.low>>>0,e.network_bandwidth_used.high>>>0).toNumber(!0))),null!=e.compute_bandwidth_used&&(c.Long?(t.compute_bandwidth_used=c.Long.fromValue(e.compute_bandwidth_used)).unsigned=!0:"string"==typeof e.compute_bandwidth_used?t.compute_bandwidth_used=parseInt(e.compute_bandwidth_used,10):"number"==typeof e.compute_bandwidth_used?t.compute_bandwidth_used=e.compute_bandwidth_used:"object"==typeof e.compute_bandwidth_used&&(t.compute_bandwidth_used=new c.LongBits(e.compute_bandwidth_used.low>>>0,e.compute_bandwidth_used.high>>>0).toNumber(!0))),null!=e.state_merkle_root&&("string"==typeof e.state_merkle_root?c.base64.decode(e.state_merkle_root,t.state_merkle_root=c.newBuffer(c.base64.length(e.state_merkle_root)),0):e.state_merkle_root.length>=0&&(t.state_merkle_root=e.state_merkle_root)),e.events){if(!Array.isArray(e.events))throw TypeError(".koinos.protocol.block_receipt.events: array expected");t.events=[];for(var r=0;r<e.events.length;++r){if("object"!=typeof e.events[r])throw TypeError(".koinos.protocol.block_receipt.events: object expected");t.events[r]=l.koinos.protocol.event_data.fromObject(e.events[r])}}if(e.transaction_receipts){if(!Array.isArray(e.transaction_receipts))throw TypeError(".koinos.protocol.block_receipt.transaction_receipts: array expected");for(t.transaction_receipts=[],r=0;r<e.transaction_receipts.length;++r){if("object"!=typeof e.transaction_receipts[r])throw TypeError(".koinos.protocol.block_receipt.transaction_receipts: object expected");t.transaction_receipts[r]=l.koinos.protocol.transaction_receipt.fromObject(e.transaction_receipts[r])}}if(e.logs){if(!Array.isArray(e.logs))throw TypeError(".koinos.protocol.block_receipt.logs: array expected");for(t.logs=[],r=0;r<e.logs.length;++r)t.logs[r]=String(e.logs[r])}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.events=[],r.transaction_receipts=[],r.logs=[]),t.defaults){if(t.bytes===String?r.id="":(r.id=[],t.bytes!==Array&&(r.id=c.newBuffer(r.id))),c.Long){var n=new c.Long(0,0,!0);r.height=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.height=t.longs===String?"0":0;c.Long?(n=new c.Long(0,0,!0),r.disk_storage_used=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.disk_storage_used=t.longs===String?"0":0,c.Long?(n=new c.Long(0,0,!0),r.network_bandwidth_used=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.network_bandwidth_used=t.longs===String?"0":0,c.Long?(n=new c.Long(0,0,!0),r.compute_bandwidth_used=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.compute_bandwidth_used=t.longs===String?"0":0,t.bytes===String?r.state_merkle_root="":(r.state_merkle_root=[],t.bytes!==Array&&(r.state_merkle_root=c.newBuffer(r.state_merkle_root)))}if(null!=e.id&&e.hasOwnProperty("id")&&(r.id=t.bytes===String?c.base64.encode(e.id,0,e.id.length):t.bytes===Array?Array.prototype.slice.call(e.id):e.id),null!=e.height&&e.hasOwnProperty("height")&&("number"==typeof e.height?r.height=t.longs===String?String(e.height):e.height:r.height=t.longs===String?c.Long.prototype.toString.call(e.height):t.longs===Number?new c.LongBits(e.height.low>>>0,e.height.high>>>0).toNumber(!0):e.height),null!=e.disk_storage_used&&e.hasOwnProperty("disk_storage_used")&&("number"==typeof e.disk_storage_used?r.disk_storage_used=t.longs===String?String(e.disk_storage_used):e.disk_storage_used:r.disk_storage_used=t.longs===String?c.Long.prototype.toString.call(e.disk_storage_used):t.longs===Number?new c.LongBits(e.disk_storage_used.low>>>0,e.disk_storage_used.high>>>0).toNumber(!0):e.disk_storage_used),null!=e.network_bandwidth_used&&e.hasOwnProperty("network_bandwidth_used")&&("number"==typeof e.network_bandwidth_used?r.network_bandwidth_used=t.longs===String?String(e.network_bandwidth_used):e.network_bandwidth_used:r.network_bandwidth_used=t.longs===String?c.Long.prototype.toString.call(e.network_bandwidth_used):t.longs===Number?new c.LongBits(e.network_bandwidth_used.low>>>0,e.network_bandwidth_used.high>>>0).toNumber(!0):e.network_bandwidth_used),null!=e.compute_bandwidth_used&&e.hasOwnProperty("compute_bandwidth_used")&&("number"==typeof e.compute_bandwidth_used?r.compute_bandwidth_used=t.longs===String?String(e.compute_bandwidth_used):e.compute_bandwidth_used:r.compute_bandwidth_used=t.longs===String?c.Long.prototype.toString.call(e.compute_bandwidth_used):t.longs===Number?new c.LongBits(e.compute_bandwidth_used.low>>>0,e.compute_bandwidth_used.high>>>0).toNumber(!0):e.compute_bandwidth_used),null!=e.state_merkle_root&&e.hasOwnProperty("state_merkle_root")&&(r.state_merkle_root=t.bytes===String?c.base64.encode(e.state_merkle_root,0,e.state_merkle_root.length):t.bytes===Array?Array.prototype.slice.call(e.state_merkle_root):e.state_merkle_root),e.events&&e.events.length){r.events=[];for(var o=0;o<e.events.length;++o)r.events[o]=l.koinos.protocol.event_data.toObject(e.events[o],t)}if(e.transaction_receipts&&e.transaction_receipts.length)for(r.transaction_receipts=[],o=0;o<e.transaction_receipts.length;++o)r.transaction_receipts[o]=l.koinos.protocol.transaction_receipt.toObject(e.transaction_receipts[o],t);if(e.logs&&e.logs.length)for(r.logs=[],o=0;o<e.logs.length;++o)r.logs[o]=e.logs[o];return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.protocol.block_receipt"},t}(),n),i.chain=((o={}).value_type=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var r;return t.prototype.message_value=null,t.prototype.int32_value=null,t.prototype.int64_value=null,t.prototype.uint32_value=null,t.prototype.uint64_value=null,t.prototype.sint32_value=null,t.prototype.sint64_value=null,t.prototype.fixed32_value=null,t.prototype.fixed64_value=null,t.prototype.sfixed32_value=null,t.prototype.sfixed64_value=null,t.prototype.bool_value=null,t.prototype.string_value=null,t.prototype.bytes_value=null,Object.defineProperty(t.prototype,"kind",{get:c.oneOfGetter(r=["message_value","int32_value","int64_value","uint32_value","uint64_value","sint32_value","sint64_value","fixed32_value","fixed64_value","sfixed32_value","sfixed64_value","bool_value","string_value","bytes_value"]),set:c.oneOfSetter(r)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.message_value&&Object.hasOwnProperty.call(e,"message_value")&&l.google.protobuf.Any.encode(e.message_value,t.uint32(10).fork()).ldelim(),null!=e.int32_value&&Object.hasOwnProperty.call(e,"int32_value")&&t.uint32(16).int32(e.int32_value),null!=e.int64_value&&Object.hasOwnProperty.call(e,"int64_value")&&t.uint32(24).int64(e.int64_value),null!=e.uint32_value&&Object.hasOwnProperty.call(e,"uint32_value")&&t.uint32(32).uint32(e.uint32_value),null!=e.uint64_value&&Object.hasOwnProperty.call(e,"uint64_value")&&t.uint32(40).uint64(e.uint64_value),null!=e.sint32_value&&Object.hasOwnProperty.call(e,"sint32_value")&&t.uint32(48).sint32(e.sint32_value),null!=e.sint64_value&&Object.hasOwnProperty.call(e,"sint64_value")&&t.uint32(56).sint64(e.sint64_value),null!=e.fixed32_value&&Object.hasOwnProperty.call(e,"fixed32_value")&&t.uint32(69).fixed32(e.fixed32_value),null!=e.fixed64_value&&Object.hasOwnProperty.call(e,"fixed64_value")&&t.uint32(73).fixed64(e.fixed64_value),null!=e.sfixed32_value&&Object.hasOwnProperty.call(e,"sfixed32_value")&&t.uint32(85).sfixed32(e.sfixed32_value),null!=e.sfixed64_value&&Object.hasOwnProperty.call(e,"sfixed64_value")&&t.uint32(89).sfixed64(e.sfixed64_value),null!=e.bool_value&&Object.hasOwnProperty.call(e,"bool_value")&&t.uint32(96).bool(e.bool_value),null!=e.string_value&&Object.hasOwnProperty.call(e,"string_value")&&t.uint32(106).string(e.string_value),null!=e.bytes_value&&Object.hasOwnProperty.call(e,"bytes_value")&&t.uint32(114).bytes(e.bytes_value),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.chain.value_type;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.message_value=l.google.protobuf.Any.decode(e,e.uint32());break;case 2:n.int32_value=e.int32();break;case 3:n.int64_value=e.int64();break;case 4:n.uint32_value=e.uint32();break;case 5:n.uint64_value=e.uint64();break;case 6:n.sint32_value=e.sint32();break;case 7:n.sint64_value=e.sint64();break;case 8:n.fixed32_value=e.fixed32();break;case 9:n.fixed64_value=e.fixed64();break;case 10:n.sfixed32_value=e.sfixed32();break;case 11:n.sfixed64_value=e.sfixed64();break;case 12:n.bool_value=e.bool();break;case 13:n.string_value=e.string();break;case 14:n.bytes_value=e.bytes();break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.message_value&&e.hasOwnProperty("message_value")){t.kind=1;var r=l.google.protobuf.Any.verify(e.message_value);if(r)return"message_value."+r}if(null!=e.int32_value&&e.hasOwnProperty("int32_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!c.isInteger(e.int32_value))return"int32_value: integer expected"}if(null!=e.int64_value&&e.hasOwnProperty("int64_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!(c.isInteger(e.int64_value)||e.int64_value&&c.isInteger(e.int64_value.low)&&c.isInteger(e.int64_value.high)))return"int64_value: integer|Long expected"}if(null!=e.uint32_value&&e.hasOwnProperty("uint32_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!c.isInteger(e.uint32_value))return"uint32_value: integer expected"}if(null!=e.uint64_value&&e.hasOwnProperty("uint64_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!(c.isInteger(e.uint64_value)||e.uint64_value&&c.isInteger(e.uint64_value.low)&&c.isInteger(e.uint64_value.high)))return"uint64_value: integer|Long expected"}if(null!=e.sint32_value&&e.hasOwnProperty("sint32_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!c.isInteger(e.sint32_value))return"sint32_value: integer expected"}if(null!=e.sint64_value&&e.hasOwnProperty("sint64_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!(c.isInteger(e.sint64_value)||e.sint64_value&&c.isInteger(e.sint64_value.low)&&c.isInteger(e.sint64_value.high)))return"sint64_value: integer|Long expected"}if(null!=e.fixed32_value&&e.hasOwnProperty("fixed32_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!c.isInteger(e.fixed32_value))return"fixed32_value: integer expected"}if(null!=e.fixed64_value&&e.hasOwnProperty("fixed64_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!(c.isInteger(e.fixed64_value)||e.fixed64_value&&c.isInteger(e.fixed64_value.low)&&c.isInteger(e.fixed64_value.high)))return"fixed64_value: integer|Long expected"}if(null!=e.sfixed32_value&&e.hasOwnProperty("sfixed32_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!c.isInteger(e.sfixed32_value))return"sfixed32_value: integer expected"}if(null!=e.sfixed64_value&&e.hasOwnProperty("sfixed64_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!(c.isInteger(e.sfixed64_value)||e.sfixed64_value&&c.isInteger(e.sfixed64_value.low)&&c.isInteger(e.sfixed64_value.high)))return"sfixed64_value: integer|Long expected"}if(null!=e.bool_value&&e.hasOwnProperty("bool_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,"boolean"!=typeof e.bool_value)return"bool_value: boolean expected"}if(null!=e.string_value&&e.hasOwnProperty("string_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!c.isString(e.string_value))return"string_value: string expected"}if(null!=e.bytes_value&&e.hasOwnProperty("bytes_value")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!(e.bytes_value&&"number"==typeof e.bytes_value.length||c.isString(e.bytes_value)))return"bytes_value: buffer expected"}return null},t.fromObject=function(e){if(e instanceof l.koinos.chain.value_type)return e;var t=new l.koinos.chain.value_type;if(null!=e.message_value){if("object"!=typeof e.message_value)throw TypeError(".koinos.chain.value_type.message_value: object expected");t.message_value=l.google.protobuf.Any.fromObject(e.message_value)}return null!=e.int32_value&&(t.int32_value=0|e.int32_value),null!=e.int64_value&&(c.Long?(t.int64_value=c.Long.fromValue(e.int64_value)).unsigned=!1:"string"==typeof e.int64_value?t.int64_value=parseInt(e.int64_value,10):"number"==typeof e.int64_value?t.int64_value=e.int64_value:"object"==typeof e.int64_value&&(t.int64_value=new c.LongBits(e.int64_value.low>>>0,e.int64_value.high>>>0).toNumber())),null!=e.uint32_value&&(t.uint32_value=e.uint32_value>>>0),null!=e.uint64_value&&(c.Long?(t.uint64_value=c.Long.fromValue(e.uint64_value)).unsigned=!0:"string"==typeof e.uint64_value?t.uint64_value=parseInt(e.uint64_value,10):"number"==typeof e.uint64_value?t.uint64_value=e.uint64_value:"object"==typeof e.uint64_value&&(t.uint64_value=new c.LongBits(e.uint64_value.low>>>0,e.uint64_value.high>>>0).toNumber(!0))),null!=e.sint32_value&&(t.sint32_value=0|e.sint32_value),null!=e.sint64_value&&(c.Long?(t.sint64_value=c.Long.fromValue(e.sint64_value)).unsigned=!1:"string"==typeof e.sint64_value?t.sint64_value=parseInt(e.sint64_value,10):"number"==typeof e.sint64_value?t.sint64_value=e.sint64_value:"object"==typeof e.sint64_value&&(t.sint64_value=new c.LongBits(e.sint64_value.low>>>0,e.sint64_value.high>>>0).toNumber())),null!=e.fixed32_value&&(t.fixed32_value=e.fixed32_value>>>0),null!=e.fixed64_value&&(c.Long?(t.fixed64_value=c.Long.fromValue(e.fixed64_value)).unsigned=!1:"string"==typeof e.fixed64_value?t.fixed64_value=parseInt(e.fixed64_value,10):"number"==typeof e.fixed64_value?t.fixed64_value=e.fixed64_value:"object"==typeof e.fixed64_value&&(t.fixed64_value=new c.LongBits(e.fixed64_value.low>>>0,e.fixed64_value.high>>>0).toNumber())),null!=e.sfixed32_value&&(t.sfixed32_value=0|e.sfixed32_value),null!=e.sfixed64_value&&(c.Long?(t.sfixed64_value=c.Long.fromValue(e.sfixed64_value)).unsigned=!1:"string"==typeof e.sfixed64_value?t.sfixed64_value=parseInt(e.sfixed64_value,10):"number"==typeof e.sfixed64_value?t.sfixed64_value=e.sfixed64_value:"object"==typeof e.sfixed64_value&&(t.sfixed64_value=new c.LongBits(e.sfixed64_value.low>>>0,e.sfixed64_value.high>>>0).toNumber())),null!=e.bool_value&&(t.bool_value=Boolean(e.bool_value)),null!=e.string_value&&(t.string_value=String(e.string_value)),null!=e.bytes_value&&("string"==typeof e.bytes_value?c.base64.decode(e.bytes_value,t.bytes_value=c.newBuffer(c.base64.length(e.bytes_value)),0):e.bytes_value.length>=0&&(t.bytes_value=e.bytes_value)),t},t.toObject=function(e,t){t||(t={});var r={};return null!=e.message_value&&e.hasOwnProperty("message_value")&&(r.message_value=l.google.protobuf.Any.toObject(e.message_value,t),t.oneofs&&(r.kind="message_value")),null!=e.int32_value&&e.hasOwnProperty("int32_value")&&(r.int32_value=e.int32_value,t.oneofs&&(r.kind="int32_value")),null!=e.int64_value&&e.hasOwnProperty("int64_value")&&("number"==typeof e.int64_value?r.int64_value=t.longs===String?String(e.int64_value):e.int64_value:r.int64_value=t.longs===String?c.Long.prototype.toString.call(e.int64_value):t.longs===Number?new c.LongBits(e.int64_value.low>>>0,e.int64_value.high>>>0).toNumber():e.int64_value,t.oneofs&&(r.kind="int64_value")),null!=e.uint32_value&&e.hasOwnProperty("uint32_value")&&(r.uint32_value=e.uint32_value,t.oneofs&&(r.kind="uint32_value")),null!=e.uint64_value&&e.hasOwnProperty("uint64_value")&&("number"==typeof e.uint64_value?r.uint64_value=t.longs===String?String(e.uint64_value):e.uint64_value:r.uint64_value=t.longs===String?c.Long.prototype.toString.call(e.uint64_value):t.longs===Number?new c.LongBits(e.uint64_value.low>>>0,e.uint64_value.high>>>0).toNumber(!0):e.uint64_value,t.oneofs&&(r.kind="uint64_value")),null!=e.sint32_value&&e.hasOwnProperty("sint32_value")&&(r.sint32_value=e.sint32_value,t.oneofs&&(r.kind="sint32_value")),null!=e.sint64_value&&e.hasOwnProperty("sint64_value")&&("number"==typeof e.sint64_value?r.sint64_value=t.longs===String?String(e.sint64_value):e.sint64_value:r.sint64_value=t.longs===String?c.Long.prototype.toString.call(e.sint64_value):t.longs===Number?new c.LongBits(e.sint64_value.low>>>0,e.sint64_value.high>>>0).toNumber():e.sint64_value,t.oneofs&&(r.kind="sint64_value")),null!=e.fixed32_value&&e.hasOwnProperty("fixed32_value")&&(r.fixed32_value=e.fixed32_value,t.oneofs&&(r.kind="fixed32_value")),null!=e.fixed64_value&&e.hasOwnProperty("fixed64_value")&&("number"==typeof e.fixed64_value?r.fixed64_value=t.longs===String?String(e.fixed64_value):e.fixed64_value:r.fixed64_value=t.longs===String?c.Long.prototype.toString.call(e.fixed64_value):t.longs===Number?new c.LongBits(e.fixed64_value.low>>>0,e.fixed64_value.high>>>0).toNumber():e.fixed64_value,t.oneofs&&(r.kind="fixed64_value")),null!=e.sfixed32_value&&e.hasOwnProperty("sfixed32_value")&&(r.sfixed32_value=e.sfixed32_value,t.oneofs&&(r.kind="sfixed32_value")),null!=e.sfixed64_value&&e.hasOwnProperty("sfixed64_value")&&("number"==typeof e.sfixed64_value?r.sfixed64_value=t.longs===String?String(e.sfixed64_value):e.sfixed64_value:r.sfixed64_value=t.longs===String?c.Long.prototype.toString.call(e.sfixed64_value):t.longs===Number?new c.LongBits(e.sfixed64_value.low>>>0,e.sfixed64_value.high>>>0).toNumber():e.sfixed64_value,t.oneofs&&(r.kind="sfixed64_value")),null!=e.bool_value&&e.hasOwnProperty("bool_value")&&(r.bool_value=e.bool_value,t.oneofs&&(r.kind="bool_value")),null!=e.string_value&&e.hasOwnProperty("string_value")&&(r.string_value=e.string_value,t.oneofs&&(r.kind="string_value")),null!=e.bytes_value&&e.hasOwnProperty("bytes_value")&&(r.bytes_value=t.bytes===String?c.base64.encode(e.bytes_value,0,e.bytes_value.length):t.bytes===Array?Array.prototype.slice.call(e.bytes_value):e.bytes_value,t.oneofs&&(r.kind="bytes_value")),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.chain.value_type"},t}(),o.enum_type=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.name="",t.prototype.number=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.number&&Object.hasOwnProperty.call(e,"number")&&t.uint32(16).int32(e.number),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.chain.enum_type;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.name=e.string();break;case 2:n.number=e.int32();break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.name&&e.hasOwnProperty("name")&&!c.isString(e.name)?"name: string expected":null!=e.number&&e.hasOwnProperty("number")&&!c.isInteger(e.number)?"number: integer expected":null},t.fromObject=function(e){if(e instanceof l.koinos.chain.enum_type)return e;var t=new l.koinos.chain.enum_type;return null!=e.name&&(t.name=String(e.name)),null!=e.number&&(t.number=0|e.number),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.name="",r.number=0),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.number&&e.hasOwnProperty("number")&&(r.number=e.number),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.chain.enum_type"},t}(),o.list_type=function(){function t(e){if(this.values=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.values=c.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.values&&e.values.length)for(var r=0;r<e.values.length;++r)l.koinos.chain.value_type.encode(e.values[r],t.uint32(10).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.koinos.chain.list_type;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.values&&n.values.length||(n.values=[]),n.values.push(l.koinos.chain.value_type.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.values&&e.hasOwnProperty("values")){if(!Array.isArray(e.values))return"values: array expected";for(var t=0;t<e.values.length;++t){var r=l.koinos.chain.value_type.verify(e.values[t]);if(r)return"values."+r}}return null},t.fromObject=function(e){if(e instanceof l.koinos.chain.list_type)return e;var t=new l.koinos.chain.list_type;if(e.values){if(!Array.isArray(e.values))throw TypeError(".koinos.chain.list_type.values: array expected");t.values=[];for(var r=0;r<e.values.length;++r){if("object"!=typeof e.values[r])throw TypeError(".koinos.chain.list_type.values: object expected");t.values[r]=l.koinos.chain.value_type.fromObject(e.values[r])}}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.values=[]),e.values&&e.values.length){r.values=[];for(var n=0;n<e.values.length;++n)r.values[n]=l.koinos.chain.value_type.toObject(e.values[n],t)}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/koinos.chain.list_type"},t}(),o),i),l.google=((r={}).protobuf=((t={}).Any=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.type_url="",t.prototype.value=c.newBuffer([]),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.type_url&&Object.hasOwnProperty.call(e,"type_url")&&t.uint32(10).string(e.type_url),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(18).bytes(e.value),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof s||(e=s.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.google.protobuf.Any;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.type_url=e.string();break;case 2:n.value=e.bytes();break;default:e.skipType(7&o)}}return n},t.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type_url&&e.hasOwnProperty("type_url")&&!c.isString(e.type_url)?"type_url: string expected":null!=e.value&&e.hasOwnProperty("value")&&!(e.value&&"number"==typeof e.value.length||c.isString(e.value))?"value: buffer expected":null},t.fromObject=function(e){if(e instanceof l.google.protobuf.Any)return e;var t=new l.google.protobuf.Any;return null!=e.type_url&&(t.type_url=String(e.type_url)),null!=e.value&&("string"==typeof e.value?c.base64.decode(e.value,t.value=c.newBuffer(c.base64.length(e.value)),0):e.value.length>=0&&(t.value=e.value)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.type_url="",t.bytes===String?r.value="":(r.value=[],t.bytes!==Array&&(r.value=c.newBuffer(r.value)))),null!=e.type_url&&e.hasOwnProperty("type_url")&&(r.type_url=e.type_url),null!=e.value&&e.hasOwnProperty("value")&&(r.value=t.bytes===String?c.base64.encode(e.value,0,e.value.length):t.bytes===Array?Array.prototype.slice.call(e.value):e.value),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/google.protobuf.Any"},t}(),t),r),l})?n.apply(t,o):n)||(e.exports=i)},9159:()=>{},6567:e=>{"use strict";e.exports=JSON.parse('{"nested":{"koinos":{"nested":{"contracts":{"nested":{"token":{"options":{"go_package":"github.com/koinos/koinos-proto-golang/koinos/contracts/token"},"nested":{"name_arguments":{"fields":{}},"name_result":{"fields":{"value":{"type":"string","id":1}}},"symbol_arguments":{"fields":{}},"symbol_result":{"fields":{"value":{"type":"string","id":1}}},"decimals_arguments":{"fields":{}},"decimals_result":{"fields":{"value":{"type":"uint32","id":1}}},"total_supply_arguments":{"fields":{}},"total_supply_result":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"balance_of_arguments":{"fields":{"owner":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}}}},"balance_of_result":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"transfer_arguments":{"fields":{"from":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}},"to":{"type":"bytes","id":2,"options":{"(btype)":"ADDRESS"}},"value":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}},"transfer_result":{"fields":{}},"mint_arguments":{"fields":{"to":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}},"value":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}}}},"mint_result":{"fields":{}},"burn_arguments":{"fields":{"from":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}},"value":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}}}},"burn_result":{"fields":{}},"balance_object":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"mana_balance_object":{"fields":{"balance":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}},"mana":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}},"last_mana_update":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}},"burn_event":{"fields":{"from":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}},"value":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}}}},"mint_event":{"fields":{"to":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}},"value":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}}}},"transfer_event":{"fields":{"from":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}},"to":{"type":"bytes","id":2,"options":{"(btype)":"ADDRESS"}},"value":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}}}}}}}}}}')}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.exports}__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var __webpack_exports__=__webpack_require__(5738)})();
|