11 lines
814 KiB
JavaScript
11 lines
814 KiB
JavaScript
import{a as Kd,b as Jd,c as Xd,d as Gd,e as Yd,f as Qd}from"./chunk-YUSIJWOC.js";import{a as Hd}from"./chunk-YHVKZE66.js";import{k as $d}from"./chunk-2DSLTDTL.js";import{a as Zd}from"./chunk-UVIVAH5I.js";import{a as Cf,b as Wd}from"./chunk-ALIHWT7Z.js";import{a as zd,b as Dd,e as Ud,g as Rd,h as Vd,k as Ef,l as qd}from"./chunk-IAFVNOEB.js";import{a as qi}from"./chunk-DUYWEMAT.js";import{d as Md,e as _d}from"./chunk-WMCBVXPA.js";import{c as $,g as Pf,o as C,p as P,q as F}from"./chunk-QTLWQ5AJ.js";var Gn=$(j=>{"use strict";C();F();Object.defineProperty(j,"__esModule",{value:!0});j.bytes=j.stringToBytes=j.str=j.bytesToString=j.hex=j.utf8=j.bech32m=j.bech32=j.base58check=j.base58xmr=j.base58xrp=j.base58flickr=j.base58=j.base64url=j.base64=j.base32crockford=j.base32hex=j.base32=j.base16=j.utils=j.assertNumber=void 0;function Bn(f){if(!Number.isSafeInteger(f))throw new Error(`Wrong integer: ${f}`)}j.assertNumber=Bn;function Xt(...f){let r=(t,n)=>l=>t(n(l)),o=Array.from(f).reverse().reduce((t,n)=>t?r(t,n.encode):n.encode,void 0),e=f.reduce((t,n)=>t?r(t,n.decode):n.decode,void 0);return{encode:o,decode:e}}function on(f){return{encode:r=>{if(!Array.isArray(r)||r.length&&typeof r[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return r.map(o=>{if(Bn(o),o<0||o>=f.length)throw new Error(`Digit index outside alphabet: ${o} (alphabet: ${f.length})`);return f[o]})},decode:r=>{if(!Array.isArray(r)||r.length&&typeof r[0]!="string")throw new Error("alphabet.decode input should be array of strings");return r.map(o=>{if(typeof o!="string")throw new Error(`alphabet.decode: not string element=${o}`);let e=f.indexOf(o);if(e===-1)throw new Error(`Unknown letter: "${o}". Allowed: ${f}`);return e})}}}function ln(f=""){if(typeof f!="string")throw new Error("join separator should be string");return{encode:r=>{if(!Array.isArray(r)||r.length&&typeof r[0]!="string")throw new Error("join.encode input should be array of strings");for(let o of r)if(typeof o!="string")throw new Error(`join.encode: non-string input=${o}`);return r.join(f)},decode:r=>{if(typeof r!="string")throw new Error("join.decode input should be string");return r.split(f)}}}function Zr(f,r="="){if(Bn(f),typeof r!="string")throw new Error("padding chr should be string");return{encode(o){if(!Array.isArray(o)||o.length&&typeof o[0]!="string")throw new Error("padding.encode input should be array of strings");for(let e of o)if(typeof e!="string")throw new Error(`padding.encode: non-string input=${e}`);for(;o.length*f%8;)o.push(r);return o},decode(o){if(!Array.isArray(o)||o.length&&typeof o[0]!="string")throw new Error("padding.encode input should be array of strings");for(let t of o)if(typeof t!="string")throw new Error(`padding.decode: non-string input=${t}`);let e=o.length;if(e*f%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;e>0&&o[e-1]===r;e--)if(!((e-1)*f%8))throw new Error("Invalid padding: string has too much padding");return o.slice(0,e)}}}function Uf(f){if(typeof f!="function")throw new Error("normalize fn should be function");return{encode:r=>r,decode:r=>f(r)}}function Ff(f,r,o){if(r<2)throw new Error(`convertRadix: wrong from=${r}, base cannot be less than 2`);if(o<2)throw new Error(`convertRadix: wrong to=${o}, base cannot be less than 2`);if(!Array.isArray(f))throw new Error("convertRadix: data should be array");if(!f.length)return[];let e=0,t=[],n=Array.from(f);for(n.forEach(l=>{if(Bn(l),l<0||l>=r)throw new Error(`Wrong integer: ${l}`)});;){let l=0,c=!0;for(let u=e;u<n.length;u++){let b=n[u],A=r*l+b;if(!Number.isSafeInteger(A)||r*l/r!==l||A-b!==r*l)throw new Error("convertRadix: carry overflow");if(l=A%o,n[u]=Math.floor(A/o),!Number.isSafeInteger(n[u])||n[u]*o+l!==A)throw new Error("convertRadix: carry overflow");if(c)n[u]?c=!1:e=u;else continue}if(t.push(l),c)break}for(let l=0;l<f.length-1&&f[l]===0;l++)t.push(0);return t.reverse()}var Rf=(f,r)=>r?Rf(r,f%r):f,Ao=(f,r)=>f+(r-Rf(f,r));function Hi(f,r,o,e){if(!Array.isArray(f))throw new Error("convertRadix2: data should be array");if(r<=0||r>32)throw new Error(`convertRadix2: wrong from=${r}`);if(o<=0||o>32)throw new Error(`convertRadix2: wrong to=${o}`);if(Ao(r,o)>32)throw new Error(`convertRadix2: carry overflow from=${r} to=${o} carryBits=${Ao(r,o)}`);let t=0,n=0,l=2**o-1,c=[];for(let u of f){if(Bn(u),u>=2**r)throw new Error(`convertRadix2: invalid data word=${u} from=${r}`);if(t=t<<r|u,n+r>32)throw new Error(`convertRadix2: carry overflow pos=${n} from=${r}`);for(n+=r;n>=o;n-=o)c.push((t>>n-o&l)>>>0);t&=2**n-1}if(t=t<<o-n&l,!e&&n>=r)throw new Error("Excess padding");if(!e&&t)throw new Error(`Non-zero padding: ${t}`);return e&&n>0&&c.push(t>>>0),c}function Vf(f){return Bn(f),{encode:r=>{if(!(r instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return Ff(Array.from(r),2**8,f)},decode:r=>{if(!Array.isArray(r)||r.length&&typeof r[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(Ff(r,f,2**8))}}}function An(f,r=!1){if(Bn(f),f<=0||f>32)throw new Error("radix2: bits should be in (0..32]");if(Ao(8,f)>32||Ao(f,8)>32)throw new Error("radix2: carry overflow");return{encode:o=>{if(!(o instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return Hi(Array.from(o),8,f,!r)},decode:o=>{if(!Array.isArray(o)||o.length&&typeof o[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(Hi(o,f,8,r))}}}function Mf(f){if(typeof f!="function")throw new Error("unsafeWrapper fn should be function");return function(...r){try{return f.apply(null,r)}catch{}}}function qf(f,r){if(Bn(f),typeof r!="function")throw new Error("checksum fn should be function");return{encode(o){if(!(o instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");let e=r(o).slice(0,f),t=new Uint8Array(o.length+f);return t.set(o),t.set(e,o.length),t},decode(o){if(!(o instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");let e=o.slice(0,-f),t=r(e).slice(0,f),n=o.slice(-f);for(let l=0;l<f;l++)if(t[l]!==n[l])throw new Error("Invalid checksum");return e}}}j.utils={alphabet:on,chain:Xt,checksum:qf,radix:Vf,radix2:An,join:ln,padding:Zr};j.base16=Xt(An(4),on("0123456789ABCDEF"),ln(""));j.base32=Xt(An(5),on("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Zr(5),ln(""));j.base32hex=Xt(An(5),on("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Zr(5),ln(""));j.base32crockford=Xt(An(5),on("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),ln(""),Uf(f=>f.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));j.base64=Xt(An(6),on("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Zr(6),ln(""));j.base64url=Xt(An(6),on("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Zr(6),ln(""));var Ki=f=>Xt(Vf(58),on(f),ln(""));j.base58=Ki("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");j.base58flickr=Ki("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ");j.base58xrp=Ki("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");var _f=[0,2,3,5,6,7,9,10,11];j.base58xmr={encode(f){let r="";for(let o=0;o<f.length;o+=8){let e=f.subarray(o,o+8);r+=j.base58.encode(e).padStart(_f[e.length],"1")}return r},decode(f){let r=[];for(let o=0;o<f.length;o+=11){let e=f.slice(o,o+11),t=_f.indexOf(e.length),n=j.base58.decode(e);for(let l=0;l<n.length-t;l++)if(n[l]!==0)throw new Error("base58xmr: wrong padding");r=r.concat(Array.from(n.slice(n.length-t)))}return Uint8Array.from(r)}};var jd=f=>Xt(qf(4,r=>f(f(r))),j.base58);j.base58check=jd;var Wi=Xt(on("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),ln("")),zf=[996825010,642813549,513874426,1027748829,705979059];function Jr(f){let r=f>>25,o=(f&33554431)<<5;for(let e=0;e<zf.length;e++)(r>>e&1)===1&&(o^=zf[e]);return o}function Df(f,r,o=1){let e=f.length,t=1;for(let n=0;n<e;n++){let l=f.charCodeAt(n);if(l<33||l>126)throw new Error(`Invalid prefix (${f})`);t=Jr(t)^l>>5}t=Jr(t);for(let n=0;n<e;n++)t=Jr(t)^f.charCodeAt(n)&31;for(let n of r)t=Jr(t)^n;for(let n=0;n<6;n++)t=Jr(t);return t^=o,Wi.encode(Hi([t%2**30],30,5,!1))}function Hf(f){let r=f==="bech32"?1:734539939,o=An(5),e=o.decode,t=o.encode,n=Mf(e);function l(A,w,B=90){if(typeof A!="string")throw new Error(`bech32.encode prefix should be string, not ${typeof A}`);if(!Array.isArray(w)||w.length&&typeof w[0]!="number")throw new Error(`bech32.encode words should be array of numbers, not ${typeof w}`);let m=A.length+7+w.length;if(B!==!1&&m>B)throw new TypeError(`Length ${m} exceeds limit ${B}`);return A=A.toLowerCase(),`${A}1${Wi.encode(w)}${Df(A,w,r)}`}function c(A,w=90){if(typeof A!="string")throw new Error(`bech32.decode input should be string, not ${typeof A}`);if(A.length<8||w!==!1&&A.length>w)throw new TypeError(`Wrong string length: ${A.length} (${A}). Expected (8..${w})`);let B=A.toLowerCase();if(A!==B&&A!==A.toUpperCase())throw new Error("String must be lowercase or uppercase");A=B;let m=A.lastIndexOf("1");if(m===0||m===-1)throw new Error('Letter "1" must be present between prefix and data only');let[I,O]=[A.slice(0,m),A.slice(m+1)];if(O.length<6)throw new Error("Data must be at least 6 characters long");let T=Wi.decode(O).slice(0,-6),E=Df(I,T,r);if(!O.endsWith(E))throw new Error(`Invalid checksum in ${A}: expected "${E}"`);return{prefix:I,words:T}}let u=Mf(c);function b(A){let{prefix:w,words:B}=c(A,!1);return{prefix:w,words:B,bytes:e(B)}}return{encode:l,decode:c,decodeToBytes:b,decodeUnsafe:u,fromWords:e,fromWordsUnsafe:n,toWords:t}}j.bech32=Hf("bech32");j.bech32m=Hf("bech32m");j.utf8={encode:f=>new TextDecoder().decode(f),decode:f=>new TextEncoder().encode(f)};j.hex=Xt(An(4),on("0123456789abcdef"),ln(""),Uf(f=>{if(typeof f!="string"||f.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof f} with length ${f.length}`);return f.toLowerCase()}));var $r={utf8:j.utf8,hex:j.hex,base16:j.base16,base32:j.base32,base64:j.base64,base64url:j.base64url,base58:j.base58,base58xmr:j.base58xmr},Wf=`Invalid encoding type. Available types: ${Object.keys($r).join(", ")}`,es=(f,r)=>{if(typeof f!="string"||!$r.hasOwnProperty(f))throw new TypeError(Wf);if(!(r instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return $r[f].encode(r)};j.bytesToString=es;j.str=j.bytesToString;var ts=(f,r)=>{if(!$r.hasOwnProperty(f))throw new TypeError(Wf);if(typeof r!="string")throw new TypeError("stringToBytes() expects string");return $r[f].decode(r)};j.stringToBytes=ts;j.bytes=j.stringToBytes});var Kf=$(xn=>{"use strict";C();F();Object.defineProperty(xn,"__esModule",{value:!0});xn.base58=xn.fromBase58=xn.toBase58=void 0;var Ji=Gn();Object.defineProperty(xn,"base58",{enumerable:!0,get:function(){return Ji.base58}});function ns(f){let r=P.Buffer.from(f);return Ji.base58.encode(Uint8Array.from(r))}xn.toBase58=ns;function rs(f){return Ji.base58.decode(f)}xn.fromBase58=rs});var Jf=$(Oo=>{"use strict";C();F();Object.defineProperty(Oo,"__esModule",{value:!0});Oo.crypto=void 0;Oo.crypto={node:void 0,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0}});var St=$((ne,Xr)=>{"use strict";C();F();Object.defineProperty(ne,"__esModule",{value:!0});ne.randomBytes=ne.wrapConstructorWithOpts=ne.wrapConstructor=ne.checkOpts=ne.Hash=ne.assertHash=ne.assertBytes=ne.assertBool=ne.assertNumber=ne.concatBytes=ne.toBytes=ne.utf8ToBytes=ne.asyncLoop=ne.nextTick=ne.hexToBytes=ne.bytesToHex=ne.isLE=ne.rotr=ne.createView=ne.u32=ne.u8=void 0;var So=Jf(),os=f=>new Uint8Array(f.buffer,f.byteOffset,f.byteLength);ne.u8=os;var is=f=>new Uint32Array(f.buffer,f.byteOffset,Math.floor(f.byteLength/4));ne.u32=is;var ls=f=>new DataView(f.buffer,f.byteOffset,f.byteLength);ne.createView=ls;var fs=(f,r)=>f<<32-r|f>>>r;ne.rotr=fs;ne.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!ne.isLE)throw new Error("Non little-endian hardware is not supported");var cs=Array.from({length:256},(f,r)=>r.toString(16).padStart(2,"0"));function as(f){let r="";for(let o=0;o<f.length;o++)r+=cs[f[o]];return r}ne.bytesToHex=as;function us(f){if(typeof f!="string")throw new TypeError("hexToBytes: expected string, got "+typeof f);if(f.length%2)throw new Error("hexToBytes: received invalid unpadded hex");let r=new Uint8Array(f.length/2);for(let o=0;o<r.length;o++){let e=o*2,t=f.slice(e,e+2),n=Number.parseInt(t,16);if(Number.isNaN(n))throw new Error("Invalid byte sequence");r[o]=n}return r}ne.hexToBytes=us;ne.nextTick=(()=>{let f=typeof Xr<"u"&&typeof Xr.require=="function"&&Xr.require.bind(Xr);try{if(f){let{setImmediate:r}=f("timers");return()=>new Promise(o=>r(o))}}catch{}return()=>new Promise(r=>setTimeout(r,0))})();async function ds(f,r,o){let e=Date.now();for(let t=0;t<f;t++){o(t);let n=Date.now()-e;n>=0&&n<r||(await(0,ne.nextTick)(),e+=n)}}ne.asyncLoop=ds;function $f(f){if(typeof f!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof f}`);return new TextEncoder().encode(f)}ne.utf8ToBytes=$f;function Xi(f){if(typeof f=="string"&&(f=$f(f)),!(f instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof f})`);return f}ne.toBytes=Xi;function ss(...f){if(!f.every(e=>e instanceof Uint8Array))throw new Error("Uint8Array list expected");if(f.length===1)return f[0];let r=f.reduce((e,t)=>e+t.length,0),o=new Uint8Array(r);for(let e=0,t=0;e<f.length;e++){let n=f[e];o.set(n,t),t+=n.length}return o}ne.concatBytes=ss;function $i(f){if(!Number.isSafeInteger(f)||f<0)throw new Error(`Wrong positive integer: ${f}`)}ne.assertNumber=$i;function hs(f){if(typeof f!="boolean")throw new Error(`Expected boolean, not ${f}`)}ne.assertBool=hs;function ps(f,...r){if(!(f instanceof Uint8Array&&(!r.length||r.includes(f.length))))throw new TypeError(`Expected ${r} bytes, not ${typeof f} with length=${f.length}`)}ne.assertBytes=ps;function ys(f){if(typeof f!="function"||typeof f.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");$i(f.outputLen),$i(f.blockLen)}ne.assertHash=ys;var Zi=class{clone(){return this._cloneInto()}};ne.Hash=Zi;var bs=f=>Object.prototype.toString.call(f)==="[object Object]"&&f.constructor===Object;function ws(f,r){if(r!==void 0&&(typeof r!="object"||!bs(r)))throw new TypeError("Options should be object or undefined");return Object.assign(f,r)}ne.checkOpts=ws;function gs(f){let r=e=>f().update(Xi(e)).digest(),o=f();return r.outputLen=o.outputLen,r.blockLen=o.blockLen,r.create=()=>f(),r}ne.wrapConstructor=gs;function vs(f){let r=(e,t)=>f(t).update(Xi(e)).digest(),o=f({});return r.outputLen=o.outputLen,r.blockLen=o.blockLen,r.create=e=>f(e),r}ne.wrapConstructorWithOpts=vs;function As(f=32){if(So.crypto.web)return So.crypto.web.getRandomValues(new Uint8Array(f));if(So.crypto.node)return new Uint8Array(So.crypto.node.randomBytes(f).buffer);throw new Error("The environment doesn't have randomBytes function")}ne.randomBytes=As});var Io=$(mo=>{"use strict";C();F();Object.defineProperty(mo,"__esModule",{value:!0});mo.SHA2=void 0;var Gr=St();function Os(f,r,o,e){if(typeof f.setBigUint64=="function")return f.setBigUint64(r,o,e);let t=BigInt(32),n=BigInt(4294967295),l=Number(o>>t&n),c=Number(o&n),u=e?4:0,b=e?0:4;f.setUint32(r+u,l,e),f.setUint32(r+b,c,e)}var Gi=class extends Gr.Hash{constructor(r,o,e,t){super(),this.blockLen=r,this.outputLen=o,this.padOffset=e,this.isLE=t,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(r),this.view=(0,Gr.createView)(this.buffer)}update(r){if(this.destroyed)throw new Error("instance is destroyed");let{view:o,buffer:e,blockLen:t,finished:n}=this;if(n)throw new Error("digest() was already called");r=(0,Gr.toBytes)(r);let l=r.length;for(let c=0;c<l;){let u=Math.min(t-this.pos,l-c);if(u===t){let b=(0,Gr.createView)(r);for(;t<=l-c;c+=t)this.process(b,c);continue}e.set(r.subarray(c,c+u),this.pos),this.pos+=u,c+=u,this.pos===t&&(this.process(o,0),this.pos=0)}return this.length+=r.length,this.roundClean(),this}digestInto(r){if(this.destroyed)throw new Error("instance is destroyed");if(!(r instanceof Uint8Array)||r.length<this.outputLen)throw new Error("_Sha2: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");this.finished=!0;let{buffer:o,view:e,blockLen:t,isLE:n}=this,{pos:l}=this;o[l++]=128,this.buffer.subarray(l).fill(0),this.padOffset>t-l&&(this.process(e,0),l=0);for(let u=l;u<t;u++)o[u]=0;Os(e,t-8,BigInt(this.length*8),n),this.process(e,0);let c=(0,Gr.createView)(r);this.get().forEach((u,b)=>c.setUint32(4*b,u,n))}digest(){let{buffer:r,outputLen:o}=this;this.digestInto(r);let e=r.slice(0,o);return this.destroy(),e}_cloneInto(r){r||(r=new this.constructor),r.set(...this.get());let{blockLen:o,buffer:e,length:t,finished:n,destroyed:l,pos:c}=this;return r.length=t,r.pos=c,r.finished=n,r.destroyed=l,t%o&&r.buffer.set(e),r}};mo.SHA2=Gi});var br=$(Bo=>{"use strict";C();F();Object.defineProperty(Bo,"__esModule",{value:!0});Bo.sha256=void 0;var Ss=Io(),Gt=St(),ms=(f,r,o)=>f&r^~f&o,Is=(f,r,o)=>f&r^f&o^r&o,Bs=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]),Nn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),kn=new Uint32Array(64),Yi=class extends Ss.SHA2{constructor(){super(64,32,8,!1),this.A=Nn[0]|0,this.B=Nn[1]|0,this.C=Nn[2]|0,this.D=Nn[3]|0,this.E=Nn[4]|0,this.F=Nn[5]|0,this.G=Nn[6]|0,this.H=Nn[7]|0}get(){let{A:r,B:o,C:e,D:t,E:n,F:l,G:c,H:u}=this;return[r,o,e,t,n,l,c,u]}set(r,o,e,t,n,l,c,u){this.A=r|0,this.B=o|0,this.C=e|0,this.D=t|0,this.E=n|0,this.F=l|0,this.G=c|0,this.H=u|0}process(r,o){for(let w=0;w<16;w++,o+=4)kn[w]=r.getUint32(o,!1);for(let w=16;w<64;w++){let B=kn[w-15],m=kn[w-2],I=(0,Gt.rotr)(B,7)^(0,Gt.rotr)(B,18)^B>>>3,O=(0,Gt.rotr)(m,17)^(0,Gt.rotr)(m,19)^m>>>10;kn[w]=O+kn[w-7]+I+kn[w-16]|0}let{A:e,B:t,C:n,D:l,E:c,F:u,G:b,H:A}=this;for(let w=0;w<64;w++){let B=(0,Gt.rotr)(c,6)^(0,Gt.rotr)(c,11)^(0,Gt.rotr)(c,25),m=A+B+ms(c,u,b)+Bs[w]+kn[w]|0,O=((0,Gt.rotr)(e,2)^(0,Gt.rotr)(e,13)^(0,Gt.rotr)(e,22))+Is(e,t,n)|0;A=b,b=u,u=c,c=l+m|0,l=n,n=t,t=e,e=m+O|0}e=e+this.A|0,t=t+this.B|0,n=n+this.C|0,l=l+this.D|0,c=c+this.E|0,u=u+this.F|0,b=b+this.G|0,A=A+this.H|0,this.set(e,t,n,l,c,u,b,A)}roundClean(){kn.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};Bo.sha256=(0,Gt.wrapConstructor)(()=>new Yi)});var wr=$(re=>{"use strict";C();F();Object.defineProperty(re,"__esModule",{value:!0});re.add5H=re.add5L=re.add4H=re.add4L=re.add3H=re.add3L=re.add=re.rotlBL=re.rotlBH=re.rotlSL=re.rotlSH=re.rotr32L=re.rotr32H=re.rotrBL=re.rotrBH=re.rotrSL=re.rotrSH=re.shrSL=re.shrSH=re.toBig=re.split=re.fromBig=void 0;var xo=BigInt(2**32-1),Qi=BigInt(32);function Zf(f,r=!1){return r?{h:Number(f&xo),l:Number(f>>Qi&xo)}:{h:Number(f>>Qi&xo)|0,l:Number(f&xo)|0}}re.fromBig=Zf;function xs(f,r=!1){let o=new Uint32Array(f.length),e=new Uint32Array(f.length);for(let t=0;t<f.length;t++){let{h:n,l}=Zf(f[t],r);[o[t],e[t]]=[n,l]}return[o,e]}re.split=xs;var Ns=(f,r)=>BigInt(f>>>0)<<Qi|BigInt(r>>>0);re.toBig=Ns;var ks=(f,r,o)=>f>>>o;re.shrSH=ks;var Ts=(f,r,o)=>f<<32-o|r>>>o;re.shrSL=Ts;var Ls=(f,r,o)=>f>>>o|r<<32-o;re.rotrSH=Ls;var Ps=(f,r,o)=>f<<32-o|r>>>o;re.rotrSL=Ps;var Es=(f,r,o)=>f<<64-o|r>>>o-32;re.rotrBH=Es;var Cs=(f,r,o)=>f>>>o-32|r<<64-o;re.rotrBL=Cs;var Fs=(f,r)=>r;re.rotr32H=Fs;var Ms=(f,r)=>f;re.rotr32L=Ms;var _s=(f,r,o)=>f<<o|r>>>32-o;re.rotlSH=_s;var zs=(f,r,o)=>r<<o|f>>>32-o;re.rotlSL=zs;var Ds=(f,r,o)=>r<<o-32|f>>>64-o;re.rotlBH=Ds;var Us=(f,r,o)=>f<<o-32|r>>>64-o;re.rotlBL=Us;function Rs(f,r,o,e){let t=(r>>>0)+(e>>>0);return{h:f+o+(t/2**32|0)|0,l:t|0}}re.add=Rs;var Vs=(f,r,o)=>(f>>>0)+(r>>>0)+(o>>>0);re.add3L=Vs;var qs=(f,r,o,e)=>r+o+e+(f/2**32|0)|0;re.add3H=qs;var Hs=(f,r,o,e)=>(f>>>0)+(r>>>0)+(o>>>0)+(e>>>0);re.add4L=Hs;var Ws=(f,r,o,e,t)=>r+o+e+t+(f/2**32|0)|0;re.add4H=Ws;var Ks=(f,r,o,e,t)=>(f>>>0)+(r>>>0)+(o>>>0)+(e>>>0)+(t>>>0);re.add5L=Ks;var Js=(f,r,o,e,t,n)=>r+o+e+t+n+(f/2**32|0)|0;re.add5H=Js});var No=$(Bt=>{"use strict";C();F();var $s=Bt&&Bt.__createBinding||(Object.create?function(f,r,o,e){e===void 0&&(e=o),Object.defineProperty(f,e,{enumerable:!0,get:function(){return r[o]}})}:function(f,r,o,e){e===void 0&&(e=o),f[e]=r[o]}),Zs=Bt&&Bt.__setModuleDefault||(Object.create?function(f,r){Object.defineProperty(f,"default",{enumerable:!0,value:r})}:function(f,r){f.default=r}),Xs=Bt&&Bt.__importStar||function(f){if(f&&f.__esModule)return f;var r={};if(f!=null)for(var o in f)o!=="default"&&Object.prototype.hasOwnProperty.call(f,o)&&$s(r,f,o);return Zs(r,f),r};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.sha384=Bt.sha512_256=Bt.sha512=Bt.SHA512=void 0;var Gs=Io(),fe=Xs(wr()),tl=St(),[Ys,Qs]=fe.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(f=>BigInt(f))),Tn=new Uint32Array(80),Ln=new Uint32Array(80),gr=class extends Gs.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:r,Al:o,Bh:e,Bl:t,Ch:n,Cl:l,Dh:c,Dl:u,Eh:b,El:A,Fh:w,Fl:B,Gh:m,Gl:I,Hh:O,Hl:T}=this;return[r,o,e,t,n,l,c,u,b,A,w,B,m,I,O,T]}set(r,o,e,t,n,l,c,u,b,A,w,B,m,I,O,T){this.Ah=r|0,this.Al=o|0,this.Bh=e|0,this.Bl=t|0,this.Ch=n|0,this.Cl=l|0,this.Dh=c|0,this.Dl=u|0,this.Eh=b|0,this.El=A|0,this.Fh=w|0,this.Fl=B|0,this.Gh=m|0,this.Gl=I|0,this.Hh=O|0,this.Hl=T|0}process(r,o){for(let M=0;M<16;M++,o+=4)Tn[M]=r.getUint32(o),Ln[M]=r.getUint32(o+=4);for(let M=16;M<80;M++){let R=Tn[M-15]|0,D=Ln[M-15]|0,_=fe.rotrSH(R,D,1)^fe.rotrSH(R,D,8)^fe.shrSH(R,D,7),q=fe.rotrSL(R,D,1)^fe.rotrSL(R,D,8)^fe.shrSL(R,D,7),U=Tn[M-2]|0,Q=Ln[M-2]|0,k=fe.rotrSH(U,Q,19)^fe.rotrBH(U,Q,61)^fe.shrSH(U,Q,6),a=fe.rotrSL(U,Q,19)^fe.rotrBL(U,Q,61)^fe.shrSL(U,Q,6),p=fe.add4L(q,a,Ln[M-7],Ln[M-16]),y=fe.add4H(p,_,k,Tn[M-7],Tn[M-16]);Tn[M]=y|0,Ln[M]=p|0}let{Ah:e,Al:t,Bh:n,Bl:l,Ch:c,Cl:u,Dh:b,Dl:A,Eh:w,El:B,Fh:m,Fl:I,Gh:O,Gl:T,Hh:E,Hl:z}=this;for(let M=0;M<80;M++){let R=fe.rotrSH(w,B,14)^fe.rotrSH(w,B,18)^fe.rotrBH(w,B,41),D=fe.rotrSL(w,B,14)^fe.rotrSL(w,B,18)^fe.rotrBL(w,B,41),_=w&m^~w&O,q=B&I^~B&T,U=fe.add5L(z,D,q,Qs[M],Ln[M]),Q=fe.add5H(U,E,R,_,Ys[M],Tn[M]),k=U|0,a=fe.rotrSH(e,t,28)^fe.rotrBH(e,t,34)^fe.rotrBH(e,t,39),p=fe.rotrSL(e,t,28)^fe.rotrBL(e,t,34)^fe.rotrBL(e,t,39),y=e&n^e&c^n&c,h=t&l^t&u^l&u;E=O|0,z=T|0,O=m|0,T=I|0,m=w|0,I=B|0,{h:w,l:B}=fe.add(b|0,A|0,Q|0,k|0),b=c|0,A=u|0,c=n|0,u=l|0,n=e|0,l=t|0;let g=fe.add3L(k,p,h);e=fe.add3H(g,Q,a,y),t=g|0}({h:e,l:t}=fe.add(this.Ah|0,this.Al|0,e|0,t|0)),{h:n,l}=fe.add(this.Bh|0,this.Bl|0,n|0,l|0),{h:c,l:u}=fe.add(this.Ch|0,this.Cl|0,c|0,u|0),{h:b,l:A}=fe.add(this.Dh|0,this.Dl|0,b|0,A|0),{h:w,l:B}=fe.add(this.Eh|0,this.El|0,w|0,B|0),{h:m,l:I}=fe.add(this.Fh|0,this.Fl|0,m|0,I|0),{h:O,l:T}=fe.add(this.Gh|0,this.Gl|0,O|0,T|0),{h:E,l:z}=fe.add(this.Hh|0,this.Hl|0,E|0,z|0),this.set(e,t,n,l,c,u,b,A,w,B,m,I,O,T,E,z)}roundClean(){Tn.fill(0),Ln.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};Bt.SHA512=gr;var ji=class extends gr{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},el=class extends gr{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}};Bt.sha512=(0,tl.wrapConstructor)(()=>new gr);Bt.sha512_256=(0,tl.wrapConstructor)(()=>new ji);Bt.sha384=(0,tl.wrapConstructor)(()=>new el)});var ol=$(vr=>{"use strict";C();F();Object.defineProperty(vr,"__esModule",{value:!0});vr.ripemd160=vr.RIPEMD160=void 0;var js=Io(),eh=St(),th=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Gf=Uint8Array.from({length:16},(f,r)=>r),nh=Gf.map(f=>(9*f+5)%16),nl=[Gf],rl=[nh];for(let f=0;f<4;f++)for(let r of[nl,rl])r.push(r[f].map(o=>th[o]));var Yf=[[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(f=>new Uint8Array(f)),rh=nl.map((f,r)=>f.map(o=>Yf[r][o])),oh=rl.map((f,r)=>f.map(o=>Yf[r][o])),ih=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),lh=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),ko=(f,r)=>f<<r|f>>>32-r;function Xf(f,r,o,e){return f===0?r^o^e:f===1?r&o|~r&e:f===2?(r|~o)^e:f===3?r&e|o&~e:r^(o|~e)}var To=new Uint32Array(16),Lo=class extends js.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:r,h1:o,h2:e,h3:t,h4:n}=this;return[r,o,e,t,n]}set(r,o,e,t,n){this.h0=r|0,this.h1=o|0,this.h2=e|0,this.h3=t|0,this.h4=n|0}process(r,o){for(let m=0;m<16;m++,o+=4)To[m]=r.getUint32(o,!0);let e=this.h0|0,t=e,n=this.h1|0,l=n,c=this.h2|0,u=c,b=this.h3|0,A=b,w=this.h4|0,B=w;for(let m=0;m<5;m++){let I=4-m,O=ih[m],T=lh[m],E=nl[m],z=rl[m],M=rh[m],R=oh[m];for(let D=0;D<16;D++){let _=ko(e+Xf(m,n,c,b)+To[E[D]]+O,M[D])+w|0;e=w,w=b,b=ko(c,10)|0,c=n,n=_}for(let D=0;D<16;D++){let _=ko(t+Xf(I,l,u,A)+To[z[D]]+T,R[D])+B|0;t=B,B=A,A=ko(u,10)|0,u=l,l=_}}this.set(this.h1+c+A|0,this.h2+b+B|0,this.h3+w+t|0,this.h4+e+l|0,this.h0+n+u|0)}roundClean(){To.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}};vr.RIPEMD160=Lo;vr.ripemd160=(0,eh.wrapConstructor)(()=>new Lo)});var Po=$(he=>{"use strict";C();F();var fh=he&&he.__createBinding||(Object.create?function(f,r,o,e){e===void 0&&(e=o),Object.defineProperty(f,e,{enumerable:!0,get:function(){return r[o]}})}:function(f,r,o,e){e===void 0&&(e=o),f[e]=r[o]}),ch=he&&he.__setModuleDefault||(Object.create?function(f,r){Object.defineProperty(f,"default",{enumerable:!0,value:r})}:function(f,r){f.default=r}),ah=he&&he.__importStar||function(f){if(f&&f.__esModule)return f;var r={};if(f!=null)for(var o in f)o!=="default"&&Object.prototype.hasOwnProperty.call(f,o)&&fh(r,f,o);return ch(r,f),r};Object.defineProperty(he,"__esModule",{value:!0});he.shake256=he.shake128=he.keccak_512=he.keccak_384=he.keccak_256=he.keccak_224=he.sha3_512=he.sha3_384=he.sha3_256=he.sha3_224=he.Keccak=he.keccakP=void 0;var Qr=ah(wr()),Yn=St(),[ec,tc,nc]=[[],[],[]],uh=BigInt(0),Yr=BigInt(1),dh=BigInt(2),sh=BigInt(7),hh=BigInt(256),ph=BigInt(113);for(let f=0,r=Yr,o=1,e=0;f<24;f++){[o,e]=[e,(2*o+3*e)%5],ec.push(2*(5*e+o)),tc.push((f+1)*(f+2)/2%64);let t=uh;for(let n=0;n<7;n++)r=(r<<Yr^(r>>sh)*ph)%hh,r&dh&&(t^=Yr<<(Yr<<BigInt(n))-Yr);nc.push(t)}var[yh,bh]=Qr.split(nc,!0),Qf=(f,r,o)=>o>32?Qr.rotlBH(f,r,o):Qr.rotlSH(f,r,o),jf=(f,r,o)=>o>32?Qr.rotlBL(f,r,o):Qr.rotlSL(f,r,o);function rc(f,r=24){let o=new Uint32Array(10);for(let e=24-r;e<24;e++){for(let l=0;l<10;l++)o[l]=f[l]^f[l+10]^f[l+20]^f[l+30]^f[l+40];for(let l=0;l<10;l+=2){let c=(l+8)%10,u=(l+2)%10,b=o[u],A=o[u+1],w=Qf(b,A,1)^o[c],B=jf(b,A,1)^o[c+1];for(let m=0;m<50;m+=10)f[l+m]^=w,f[l+m+1]^=B}let t=f[2],n=f[3];for(let l=0;l<24;l++){let c=tc[l],u=Qf(t,n,c),b=jf(t,n,c),A=ec[l];t=f[A],n=f[A+1],f[A]=u,f[A+1]=b}for(let l=0;l<50;l+=10){for(let c=0;c<10;c++)o[c]=f[l+c];for(let c=0;c<10;c++)f[l+c]^=~o[(c+2)%10]&o[(c+4)%10]}f[0]^=yh[e],f[1]^=bh[e]}o.fill(0)}he.keccakP=rc;var Qn=class extends Yn.Hash{constructor(r,o,e,t=!1,n=24){if(super(),this.blockLen=r,this.suffix=o,this.outputLen=e,this.enableXOF=t,this.rounds=n,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,Yn.assertNumber)(e),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,Yn.u32)(this.state)}keccak(){rc(this.state32,this.rounds),this.posOut=0,this.pos=0}update(r){if(this.destroyed)throw new Error("instance is destroyed");if(this.finished)throw new Error("digest() was already called");let{blockLen:o,state:e}=this;r=(0,Yn.toBytes)(r);let t=r.length;for(let n=0;n<t;){let l=Math.min(o-this.pos,t-n);for(let c=0;c<l;c++)e[this.pos++]^=r[n++];this.pos===o&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:r,suffix:o,pos:e,blockLen:t}=this;r[e]^=o,(o&128)!==0&&e===t-1&&this.keccak(),r[t-1]^=128,this.keccak()}writeInto(r){if(this.destroyed)throw new Error("instance is destroyed");if(!(r instanceof Uint8Array))throw new Error("Keccak: invalid output buffer");this.finish();for(let o=0,e=r.length;o<e;){this.posOut>=this.blockLen&&this.keccak();let t=Math.min(this.blockLen-this.posOut,e-o);r.set(this.state.subarray(this.posOut,this.posOut+t),o),this.posOut+=t,o+=t}return r}xofInto(r){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(r)}xof(r){return(0,Yn.assertNumber)(r),this.xofInto(new Uint8Array(r))}digestInto(r){if(r.length<this.outputLen)throw new Error("Keccak: invalid output buffer");if(this.finished)throw new Error("digest() was already called");return this.finish(),this.writeInto(r),this.destroy(),r}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(r){let{blockLen:o,suffix:e,outputLen:t,rounds:n,enableXOF:l}=this;return r||(r=new Qn(o,e,t,l,n)),r.state32.set(this.state32),r.pos=this.pos,r.posOut=this.posOut,r.finished=this.finished,r.rounds=n,r.suffix=e,r.outputLen=t,r.enableXOF=l,r.destroyed=this.destroyed,r}};he.Keccak=Qn;var Pn=(f,r,o)=>(0,Yn.wrapConstructor)(()=>new Qn(r,f,o));he.sha3_224=Pn(6,144,224/8);he.sha3_256=Pn(6,136,256/8);he.sha3_384=Pn(6,104,384/8);he.sha3_512=Pn(6,72,512/8);he.keccak_224=Pn(1,144,224/8);he.keccak_256=Pn(1,136,256/8);he.keccak_384=Pn(1,104,384/8);he.keccak_512=Pn(1,72,512/8);var oc=(f,r,o)=>(0,Yn.wrapConstructorWithOpts)((e={})=>new Qn(r,f,e.dkLen!==void 0?e.dkLen:o,!0));he.shake128=oc(31,168,128/8);he.shake256=oc(31,136,256/8)});var Eo=$(Ar=>{"use strict";C();F();Object.defineProperty(Ar,"__esModule",{value:!0});Ar.BLAKE2=Ar.SIGMA=void 0;var jn=St();Ar.SIGMA=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3]);var il=class extends jn.Hash{constructor(r,o,e={},t,n,l){if(super(),this.blockLen=r,this.outputLen=o,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,(0,jn.assertNumber)(r),(0,jn.assertNumber)(o),(0,jn.assertNumber)(t),o<0||o>t)throw new Error("Blake2: outputLen bigger than keyLen");if(e.key!==void 0&&(e.key.length<1||e.key.length>t))throw new Error(`Key should be up 1..${t} byte long or undefined`);if(e.salt!==void 0&&e.salt.length!==n)throw new Error(`Salt should be ${n} byte long or undefined`);if(e.personalization!==void 0&&e.personalization.length!==l)throw new Error(`Personalization should be ${l} byte long or undefined`);this.buffer32=(0,jn.u32)(this.buffer=new Uint8Array(r))}update(r){if(this.destroyed)throw new Error("instance is destroyed");let{finished:o,blockLen:e,buffer:t,buffer32:n}=this;if(o)throw new Error("digest() was already called");r=(0,jn.toBytes)(r);let l=r.length;for(let c=0;c<l;){this.pos===e&&(this.compress(n,0,!1),this.pos=0);let u=Math.min(e-this.pos,l-c),b=r.byteOffset+c;if(u===e&&!(b%4)&&c+u<l){let A=new Uint32Array(r.buffer,b,Math.floor((l-c)/4));for(let w=0;c+e<l;w+=n.length,c+=e)this.length+=e,this.compress(A,w,!1);continue}t.set(r.subarray(c,c+u),this.pos),this.pos+=u,this.length+=u,c+=u}return this}digestInto(r){if(this.destroyed)throw new Error("instance is destroyed");if(!(r instanceof Uint8Array)||r.length<this.outputLen)throw new Error("_Blake2: Invalid output buffer");let{finished:o,pos:e,buffer32:t}=this;if(o)throw new Error("digest() was already called");this.finished=!0,this.buffer.subarray(e).fill(0),this.compress(t,0,!0);let n=(0,jn.u32)(r);this.get().forEach((l,c)=>n[c]=l)}digest(){let{buffer:r,outputLen:o}=this;this.digestInto(r);let e=r.slice(0,o);return this.destroy(),e}_cloneInto(r){let{buffer:o,length:e,finished:t,destroyed:n,outputLen:l,pos:c}=this;return r||(r=new this.constructor({dkLen:l})),r.set(...this.get()),r.length=e,r.finished=t,r.destroyed=n,r.outputLen=l,r.buffer.set(o),r.pos=c,r}};Ar.BLAKE2=il});var fl=$(fn=>{"use strict";C();F();var wh=fn&&fn.__createBinding||(Object.create?function(f,r,o,e){e===void 0&&(e=o),Object.defineProperty(f,e,{enumerable:!0,get:function(){return r[o]}})}:function(f,r,o,e){e===void 0&&(e=o),f[e]=r[o]}),gh=fn&&fn.__setModuleDefault||(Object.create?function(f,r){Object.defineProperty(f,"default",{enumerable:!0,value:r})}:function(f,r){f.default=r}),lc=fn&&fn.__importStar||function(f){if(f&&f.__esModule)return f;var r={};if(f!=null)for(var o in f)o!=="default"&&Object.prototype.hasOwnProperty.call(f,o)&&wh(r,f,o);return gh(r,f),r};Object.defineProperty(fn,"__esModule",{value:!0});fn.blake2b=void 0;var ic=lc(Eo()),Et=lc(wr()),Or=St(),ht=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Z=new Uint32Array(32);function En(f,r,o,e,t,n){let l=t[n],c=t[n+1],u=Z[2*f],b=Z[2*f+1],A=Z[2*r],w=Z[2*r+1],B=Z[2*o],m=Z[2*o+1],I=Z[2*e],O=Z[2*e+1],T=Et.add3L(u,A,l);b=Et.add3H(T,b,w,c),u=T|0,{Dh:O,Dl:I}={Dh:O^b,Dl:I^u},{Dh:O,Dl:I}={Dh:Et.rotr32H(O,I),Dl:Et.rotr32L(O,I)},{h:m,l:B}=Et.add(m,B,O,I),{Bh:w,Bl:A}={Bh:w^m,Bl:A^B},{Bh:w,Bl:A}={Bh:Et.rotrSH(w,A,24),Bl:Et.rotrSL(w,A,24)},Z[2*f]=u,Z[2*f+1]=b,Z[2*r]=A,Z[2*r+1]=w,Z[2*o]=B,Z[2*o+1]=m,Z[2*e]=I,Z[2*e+1]=O}function Cn(f,r,o,e,t,n){let l=t[n],c=t[n+1],u=Z[2*f],b=Z[2*f+1],A=Z[2*r],w=Z[2*r+1],B=Z[2*o],m=Z[2*o+1],I=Z[2*e],O=Z[2*e+1],T=Et.add3L(u,A,l);b=Et.add3H(T,b,w,c),u=T|0,{Dh:O,Dl:I}={Dh:O^b,Dl:I^u},{Dh:O,Dl:I}={Dh:Et.rotrSH(O,I,16),Dl:Et.rotrSL(O,I,16)},{h:m,l:B}=Et.add(m,B,O,I),{Bh:w,Bl:A}={Bh:w^m,Bl:A^B},{Bh:w,Bl:A}={Bh:Et.rotrBH(w,A,63),Bl:Et.rotrBL(w,A,63)},Z[2*f]=u,Z[2*f+1]=b,Z[2*r]=A,Z[2*r+1]=w,Z[2*o]=B,Z[2*o+1]=m,Z[2*e]=I,Z[2*e+1]=O}var ll=class extends ic.BLAKE2{constructor(r={}){super(128,r.dkLen===void 0?64:r.dkLen,r,64,16,16),this.v0l=ht[0]|0,this.v0h=ht[1]|0,this.v1l=ht[2]|0,this.v1h=ht[3]|0,this.v2l=ht[4]|0,this.v2h=ht[5]|0,this.v3l=ht[6]|0,this.v3h=ht[7]|0,this.v4l=ht[8]|0,this.v4h=ht[9]|0,this.v5l=ht[10]|0,this.v5h=ht[11]|0,this.v6l=ht[12]|0,this.v6h=ht[13]|0,this.v7l=ht[14]|0,this.v7h=ht[15]|0;let o=r.key?r.key.length:0;if(this.v0l^=this.outputLen|o<<8|1<<16|1<<24,r.salt){let e=(0,Or.u32)((0,Or.toBytes)(r.salt));this.v4l^=e[0],this.v4h^=e[1],this.v5l^=e[2],this.v5h^=e[3]}if(r.personalization){let e=(0,Or.u32)((0,Or.toBytes)(r.personalization));this.v6l^=e[0],this.v6h^=e[1],this.v7l^=e[2],this.v7h^=e[3]}if(r.key){let e=new Uint8Array(this.blockLen);e.set((0,Or.toBytes)(r.key)),this.update(e)}}get(){let{v0l:r,v0h:o,v1l:e,v1h:t,v2l:n,v2h:l,v3l:c,v3h:u,v4l:b,v4h:A,v5l:w,v5h:B,v6l:m,v6h:I,v7l:O,v7h:T}=this;return[r,o,e,t,n,l,c,u,b,A,w,B,m,I,O,T]}set(r,o,e,t,n,l,c,u,b,A,w,B,m,I,O,T){this.v0l=r|0,this.v0h=o|0,this.v1l=e|0,this.v1h=t|0,this.v2l=n|0,this.v2h=l|0,this.v3l=c|0,this.v3h=u|0,this.v4l=b|0,this.v4h=A|0,this.v5l=w|0,this.v5h=B|0,this.v6l=m|0,this.v6h=I|0,this.v7l=O|0,this.v7h=T|0}compress(r,o,e){this.get().forEach((u,b)=>Z[b]=u),Z.set(ht,16);let{h:t,l:n}=Et.fromBig(BigInt(this.length));Z[24]=ht[8]^n,Z[25]=ht[9]^t,e&&(Z[28]=~Z[28],Z[29]=~Z[29]);let l=0,c=ic.SIGMA;for(let u=0;u<12;u++)En(0,4,8,12,r,o+2*c[l++]),Cn(0,4,8,12,r,o+2*c[l++]),En(1,5,9,13,r,o+2*c[l++]),Cn(1,5,9,13,r,o+2*c[l++]),En(2,6,10,14,r,o+2*c[l++]),Cn(2,6,10,14,r,o+2*c[l++]),En(3,7,11,15,r,o+2*c[l++]),Cn(3,7,11,15,r,o+2*c[l++]),En(0,5,10,15,r,o+2*c[l++]),Cn(0,5,10,15,r,o+2*c[l++]),En(1,6,11,12,r,o+2*c[l++]),Cn(1,6,11,12,r,o+2*c[l++]),En(2,7,8,13,r,o+2*c[l++]),Cn(2,7,8,13,r,o+2*c[l++]),En(3,4,9,14,r,o+2*c[l++]),Cn(3,4,9,14,r,o+2*c[l++]);this.v0l^=Z[0]^Z[16],this.v0h^=Z[1]^Z[17],this.v1l^=Z[2]^Z[18],this.v1h^=Z[3]^Z[19],this.v2l^=Z[4]^Z[20],this.v2h^=Z[5]^Z[21],this.v3l^=Z[6]^Z[22],this.v3h^=Z[7]^Z[23],this.v4l^=Z[8]^Z[24],this.v4h^=Z[9]^Z[25],this.v5l^=Z[10]^Z[26],this.v5h^=Z[11]^Z[27],this.v6l^=Z[12]^Z[28],this.v6h^=Z[13]^Z[29],this.v7l^=Z[14]^Z[30],this.v7h^=Z[15]^Z[31],Z.fill(0)}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};fn.blake2b=(0,Or.wrapConstructorWithOpts)(f=>new ll(f))});var jr=$(Se=>{"use strict";C();F();Object.defineProperty(Se,"__esModule",{value:!0});Se.sha3_512=Se.sha3_256=Se.ripemd160=Se.sha512=Se.sha256=Se.magicHash=Se.blake2=Se.keccak256=Se.keccak=Se.hash160=Se.doubleSha256=void 0;var Co=br();Object.defineProperty(Se,"sha256",{enumerable:!0,get:function(){return Co.sha256}});var vh=No();Object.defineProperty(Se,"sha512",{enumerable:!0,get:function(){return vh.sha512}});var cc=ol();Object.defineProperty(Se,"ripemd160",{enumerable:!0,get:function(){return cc.ripemd160}});var Sr=Po();Object.defineProperty(Se,"sha3_256",{enumerable:!0,get:function(){return Sr.sha3_256}});Object.defineProperty(Se,"sha3_512",{enumerable:!0,get:function(){return Sr.sha3_512}});var Ah=fl();function ac(f){let r=(0,Co.sha256)(f);return(0,Co.sha256)(r)}Se.doubleSha256=ac;function Oh(f){let r=(0,Co.sha256)(f);return(0,cc.ripemd160)(r)}Se.hash160=Oh;var Sh=function(f,r=256){let o=P.Buffer.from(f);switch(r){case 224:return P.Buffer.from((0,Sr.keccak_224)(o));case 256:return P.Buffer.from((0,Sr.keccak_256)(o));case 384:return P.Buffer.from((0,Sr.keccak_384)(o));case 512:return P.Buffer.from((0,Sr.keccak_512)(o));default:throw new Error(`Invald algorithm: keccak${r}`)}};Se.keccak=Sh;var mh=function(f){return(0,Se.keccak)(f)};Se.keccak256=mh;function Ih(f,r,o){let e=Math.ceil(r/8);return(0,Ah.blake2b)(f,{dkLen:e,key:o})}Se.blake2=Ih;function fc(f){let r;return f<253?(r=P.Buffer.alloc(1),r.writeUInt8(f,0)):f<65536?(r=P.Buffer.alloc(1+2),r.writeUInt8(253,0),r.writeUInt16LE(f,1)):f<4294967296?(r=P.Buffer.alloc(1+4),r.writeUInt8(254,0),r.writeUInt32LE(f,1)):(r=P.Buffer.alloc(1+8),r.writeUInt8(255,0),r.writeInt32LE(f&-1,1),r.writeUInt32LE(Math.floor(f/4294967296),5)),r}var Bh=P.Buffer.from(`Bitcoin Signed Message:
|
||
`);function xh(f,r){let o=r?P.Buffer.from(r,"utf8"):Bh,e=fc(o.length),t=P.Buffer.from(f),n=fc(t.length),l=P.Buffer.concat([e,o,n,t]);return ac(l)}Se.magicHash=xh});var sc=$(mr=>{"use strict";C();F();Object.defineProperty(mr,"__esModule",{value:!0});mr.fromBase58Check=mr.toBase58Check=void 0;var uc=jr(),Yg=Dd(),dc=Gn();function Nh(f){return(0,dc.base58check)(uc.sha256).encode(P.Buffer.from(f))}mr.toBase58Check=Nh;function kh(f){let r=(0,dc.base58check)(uc.sha256);return P.Buffer.from(r.decode(f))}mr.fromBase58Check=kh});var hc=$(Ir=>{"use strict";C();F();Object.defineProperty(Ir,"__esModule",{value:!0});Ir.fromBech32=Ir.toBech32=void 0;var Fo=Gn();function Th(f,r,o){let e=P.Buffer.from(r),t=Fo.bech32.toWords(Uint8Array.from(e));return Fo.bech32.encode(f,t,o)}Ir.toBech32=Th;function Lh(f,r){let o=Fo.bech32.decode(f,r),e=Fo.bech32.fromWords(o.words);return[o.prefix,P.Buffer.from(e)]}Ir.fromBech32=Lh});var pc=$(cn=>{"use strict";C();F();Object.defineProperty(cn,"__esModule",{value:!0});cn.isHexPrefixed=cn.stripHexPrefix=cn.fromHex=cn.toHex=void 0;function Ph(f,r=!1){let o=P.Buffer.from(f);return r?"0x"+o.toString("hex"):o.toString("hex")}cn.toHex=Ph;function Eh(f){return f.startsWith("0x")&&(f=f.substring(2)),P.Buffer.from(f,"hex")}cn.fromHex=Eh;function Ch(f){return f.startsWith("0x")?f.substring(2):f}cn.stripHexPrefix=Ch;function Fh(f){return f.startsWith("0x")}cn.isHexPrefixed=Fh});var bc=$(Br=>{"use strict";C();F();Object.defineProperty(Br,"__esModule",{value:!0});Br.fromBase64=Br.toBase64=void 0;var yc=Gn();function Mh(f){let r=P.Buffer.from(f);return yc.base64.encode(Uint8Array.from(r))}Br.toBase64=Mh;function _h(f){return yc.base64.decode(f)}Br.fromBase64=_h});var to=$(eo=>{"use strict";C();F();Object.defineProperty(eo,"__esModule",{value:!0});eo.hmac=void 0;var Mo=St(),_o=class extends Mo.Hash{constructor(r,o){super(),this.finished=!1,this.destroyed=!1,(0,Mo.assertHash)(r);let e=(0,Mo.toBytes)(o);if(this.iHash=r.create(),!(this.iHash instanceof Mo.Hash))throw new TypeError("Expected instance of class which extends utils.Hash");let t=this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;let n=new Uint8Array(t);n.set(e.length>this.iHash.blockLen?r.create().update(e).digest():e);for(let l=0;l<n.length;l++)n[l]^=54;this.iHash.update(n),this.oHash=r.create();for(let l=0;l<n.length;l++)n[l]^=106;this.oHash.update(n),n.fill(0)}update(r){if(this.destroyed)throw new Error("instance is destroyed");return this.iHash.update(r),this}digestInto(r){if(this.destroyed)throw new Error("instance is destroyed");if(!(r instanceof Uint8Array)||r.length!==this.outputLen)throw new Error("HMAC: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");this.finished=!0,this.iHash.digestInto(r),this.oHash.update(r),this.oHash.digestInto(r),this.destroy()}digest(){let r=new Uint8Array(this.oHash.outputLen);return this.digestInto(r),r}_cloneInto(r){r||(r=Object.create(Object.getPrototypeOf(this),{}));let{oHash:o,iHash:e,finished:t,destroyed:n,blockLen:l,outputLen:c}=this;return r=r,r.finished=t,r.destroyed=n,r.blockLen=l,r.outputLen=c,r.oHash=o._cloneInto(r.oHash),r.iHash=e._cloneInto(r.iHash),r}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},zh=(f,r,o)=>new _o(f,r).update(o).digest();eo.hmac=zh;eo.hmac.create=(f,r)=>new _o(f,r)});var vc=$(xr=>{"use strict";C();F();Object.defineProperty(xr,"__esModule",{value:!0});xr.hmacSHA512=xr.hmacSHA256=void 0;var wc=to(),gc=jr();function Dh(f,r){return P.Buffer.from((0,wc.hmac)(gc.sha256,f,r))}xr.hmacSHA256=Dh;function Uh(f,r){return P.Buffer.from((0,wc.hmac)(gc.sha512,f,r))}xr.hmacSHA512=Uh});var Ac=$(Nr=>{"use strict";C();F();Object.defineProperty(Nr,"__esModule",{value:!0});Nr.fromUtf8=Nr.toUtf8=void 0;function Rh(f){return new TextEncoder().encode(f)}Nr.toUtf8=Rh;function Vh(f){return new TextDecoder("utf-8",{fatal:!0}).decode(f)}Nr.fromUtf8=Vh});var al=$(Fn=>{"use strict";C();F();Object.defineProperty(Fn,"__esModule",{value:!0});Fn.checkIsUndefined=Fn.checkIsDefined=Fn.check=void 0;var cl=(f,r)=>{if(!f)throw r=r||"Invalid statement",r=r instanceof Error?r:new Error(r),r};Fn.check=cl;var qh=(f,r)=>(cl(typeof f<"u",r||"Expect defined but actually undefined"),f);Fn.checkIsDefined=qh;var Hh=(f,r)=>{cl(typeof f>"u",r||`Expect undefined but actually ${f}`)};Fn.checkIsUndefined=Hh});var Sc=$(an=>{"use strict";C();F();Object.defineProperty(an,"__esModule",{value:!0});an.string2BigNumber=an.bigNumber2String=an.fromBigIntHex=an.toBigIntHex=void 0;var Oc=ul(),Wh=al(),Kh=f=>{let r=f.integerValue().toString(16);return r="0x"+r,r};an.toBigIntHex=Kh;var Jh=f=>((0,Wh.check)(f&&f.startsWith("0x"),`Invalid hex string. value: ${f}`),new Oc.BigNumber(f).integerValue());an.fromBigIntHex=Jh;var $h=(f,r)=>f.integerValue().toString(r);an.bigNumber2String=$h;var Zh=(f,r)=>new Oc.BigNumber(f,r);an.string2BigNumber=Zh});var pt=$((mc,dl)=>{C();F();(function(f,r){"use strict";function o(k,a){if(!k)throw new Error(a||"Assertion failed")}function e(k,a){k.super_=a;var p=function(){};p.prototype=a.prototype,k.prototype=new p,k.prototype.constructor=k}function t(k,a,p){if(t.isBN(k))return k;this.negative=0,this.words=null,this.length=0,this.red=null,k!==null&&((a==="le"||a==="be")&&(p=a,a=10),this._init(k||0,a||10,p||"be"))}typeof f=="object"?f.exports=t:r.BN=t,t.BN=t,t.wordSize=26;var n;try{typeof window<"u"&&typeof window.Buffer<"u"?n=window.Buffer:n=Md().Buffer}catch{}t.isBN=function(a){return a instanceof t?!0:a!==null&&typeof a=="object"&&a.constructor.wordSize===t.wordSize&&Array.isArray(a.words)},t.max=function(a,p){return a.cmp(p)>0?a:p},t.min=function(a,p){return a.cmp(p)<0?a:p},t.prototype._init=function(a,p,y){if(typeof a=="number")return this._initNumber(a,p,y);if(typeof a=="object")return this._initArray(a,p,y);p==="hex"&&(p=16),o(p===(p|0)&&p>=2&&p<=36),a=a.toString().replace(/\s+/g,"");var h=0;a[0]==="-"&&(h++,this.negative=1),h<a.length&&(p===16?this._parseHex(a,h,y):(this._parseBase(a,p,h),y==="le"&&this._initArray(this.toArray(),p,y)))},t.prototype._initNumber=function(a,p,y){a<0&&(this.negative=1,a=-a),a<67108864?(this.words=[a&67108863],this.length=1):a<4503599627370496?(this.words=[a&67108863,a/67108864&67108863],this.length=2):(o(a<9007199254740992),this.words=[a&67108863,a/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),p,y)},t.prototype._initArray=function(a,p,y){if(o(typeof a.length=="number"),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=new Array(this.length);for(var h=0;h<this.length;h++)this.words[h]=0;var g,N,L=0;if(y==="be")for(h=a.length-1,g=0;h>=0;h-=3)N=a[h]|a[h-1]<<8|a[h-2]<<16,this.words[g]|=N<<L&67108863,this.words[g+1]=N>>>26-L&67108863,L+=24,L>=26&&(L-=26,g++);else if(y==="le")for(h=0,g=0;h<a.length;h+=3)N=a[h]|a[h+1]<<8|a[h+2]<<16,this.words[g]|=N<<L&67108863,this.words[g+1]=N>>>26-L&67108863,L+=24,L>=26&&(L-=26,g++);return this.strip()};function l(k,a){var p=k.charCodeAt(a);return p>=65&&p<=70?p-55:p>=97&&p<=102?p-87:p-48&15}function c(k,a,p){var y=l(k,p);return p-1>=a&&(y|=l(k,p-1)<<4),y}t.prototype._parseHex=function(a,p,y){this.length=Math.ceil((a.length-p)/6),this.words=new Array(this.length);for(var h=0;h<this.length;h++)this.words[h]=0;var g=0,N=0,L;if(y==="be")for(h=a.length-1;h>=p;h-=2)L=c(a,p,h)<<g,this.words[N]|=L&67108863,g>=18?(g-=18,N+=1,this.words[N]|=L>>>26):g+=8;else{var S=a.length-p;for(h=S%2===0?p+1:p;h<a.length;h+=2)L=c(a,p,h)<<g,this.words[N]|=L&67108863,g>=18?(g-=18,N+=1,this.words[N]|=L>>>26):g+=8}this.strip()};function u(k,a,p,y){for(var h=0,g=Math.min(k.length,p),N=a;N<g;N++){var L=k.charCodeAt(N)-48;h*=y,L>=49?h+=L-49+10:L>=17?h+=L-17+10:h+=L}return h}t.prototype._parseBase=function(a,p,y){this.words=[0],this.length=1;for(var h=0,g=1;g<=67108863;g*=p)h++;h--,g=g/p|0;for(var N=a.length-y,L=N%h,S=Math.min(N,N-L)+y,s=0,x=y;x<S;x+=h)s=u(a,x,x+h,p),this.imuln(g),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(L!==0){var W=1;for(s=u(a,x,a.length,p),x=0;x<L;x++)W*=p;this.imuln(W),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}this.strip()},t.prototype.copy=function(a){a.words=new Array(this.length);for(var p=0;p<this.length;p++)a.words[p]=this.words[p];a.length=this.length,a.negative=this.negative,a.red=this.red},t.prototype.clone=function(){var a=new t(null);return this.copy(a),a},t.prototype._expand=function(a){for(;this.length<a;)this.words[this.length++]=0;return this},t.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},t.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},t.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],A=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],w=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];t.prototype.toString=function(a,p){a=a||10,p=p|0||1;var y;if(a===16||a==="hex"){y="";for(var h=0,g=0,N=0;N<this.length;N++){var L=this.words[N],S=((L<<h|g)&16777215).toString(16);g=L>>>24-h&16777215,g!==0||N!==this.length-1?y=b[6-S.length]+S+y:y=S+y,h+=2,h>=26&&(h-=26,N--)}for(g!==0&&(y=g.toString(16)+y);y.length%p!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(a===(a|0)&&a>=2&&a<=36){var s=A[a],x=w[a];y="";var W=this.clone();for(W.negative=0;!W.isZero();){var K=W.modn(x).toString(a);W=W.idivn(x),W.isZero()?y=K+y:y=b[s-K.length]+K+y}for(this.isZero()&&(y="0"+y);y.length%p!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}o(!1,"Base should be between 2 and 36")},t.prototype.toNumber=function(){var a=this.words[0];return this.length===2?a+=this.words[1]*67108864:this.length===3&&this.words[2]===1?a+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-a:a},t.prototype.toJSON=function(){return this.toString(16)},t.prototype.toBuffer=function(a,p){return o(typeof n<"u"),this.toArrayLike(n,a,p)},t.prototype.toArray=function(a,p){return this.toArrayLike(Array,a,p)},t.prototype.toArrayLike=function(a,p,y){var h=this.byteLength(),g=y||Math.max(1,h);o(h<=g,"byte array longer than desired length"),o(g>0,"Requested array length <= 0"),this.strip();var N=p==="le",L=new a(g),S,s,x=this.clone();if(N){for(s=0;!x.isZero();s++)S=x.andln(255),x.iushrn(8),L[s]=S;for(;s<g;s++)L[s]=0}else{for(s=0;s<g-h;s++)L[s]=0;for(s=0;!x.isZero();s++)S=x.andln(255),x.iushrn(8),L[g-s-1]=S}return L},Math.clz32?t.prototype._countBits=function(a){return 32-Math.clz32(a)}:t.prototype._countBits=function(a){var p=a,y=0;return p>=4096&&(y+=13,p>>>=13),p>=64&&(y+=7,p>>>=7),p>=8&&(y+=4,p>>>=4),p>=2&&(y+=2,p>>>=2),y+p},t.prototype._zeroBits=function(a){if(a===0)return 26;var p=a,y=0;return(p&8191)===0&&(y+=13,p>>>=13),(p&127)===0&&(y+=7,p>>>=7),(p&15)===0&&(y+=4,p>>>=4),(p&3)===0&&(y+=2,p>>>=2),(p&1)===0&&y++,y},t.prototype.bitLength=function(){var a=this.words[this.length-1],p=this._countBits(a);return(this.length-1)*26+p};function B(k){for(var a=new Array(k.bitLength()),p=0;p<a.length;p++){var y=p/26|0,h=p%26;a[p]=(k.words[y]&1<<h)>>>h}return a}t.prototype.zeroBits=function(){if(this.isZero())return 0;for(var a=0,p=0;p<this.length;p++){var y=this._zeroBits(this.words[p]);if(a+=y,y!==26)break}return a},t.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},t.prototype.toTwos=function(a){return this.negative!==0?this.abs().inotn(a).iaddn(1):this.clone()},t.prototype.fromTwos=function(a){return this.testn(a-1)?this.notn(a).iaddn(1).ineg():this.clone()},t.prototype.isNeg=function(){return this.negative!==0},t.prototype.neg=function(){return this.clone().ineg()},t.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},t.prototype.iuor=function(a){for(;this.length<a.length;)this.words[this.length++]=0;for(var p=0;p<a.length;p++)this.words[p]=this.words[p]|a.words[p];return this.strip()},t.prototype.ior=function(a){return o((this.negative|a.negative)===0),this.iuor(a)},t.prototype.or=function(a){return this.length>a.length?this.clone().ior(a):a.clone().ior(this)},t.prototype.uor=function(a){return this.length>a.length?this.clone().iuor(a):a.clone().iuor(this)},t.prototype.iuand=function(a){var p;this.length>a.length?p=a:p=this;for(var y=0;y<p.length;y++)this.words[y]=this.words[y]&a.words[y];return this.length=p.length,this.strip()},t.prototype.iand=function(a){return o((this.negative|a.negative)===0),this.iuand(a)},t.prototype.and=function(a){return this.length>a.length?this.clone().iand(a):a.clone().iand(this)},t.prototype.uand=function(a){return this.length>a.length?this.clone().iuand(a):a.clone().iuand(this)},t.prototype.iuxor=function(a){var p,y;this.length>a.length?(p=this,y=a):(p=a,y=this);for(var h=0;h<y.length;h++)this.words[h]=p.words[h]^y.words[h];if(this!==p)for(;h<p.length;h++)this.words[h]=p.words[h];return this.length=p.length,this.strip()},t.prototype.ixor=function(a){return o((this.negative|a.negative)===0),this.iuxor(a)},t.prototype.xor=function(a){return this.length>a.length?this.clone().ixor(a):a.clone().ixor(this)},t.prototype.uxor=function(a){return this.length>a.length?this.clone().iuxor(a):a.clone().iuxor(this)},t.prototype.inotn=function(a){o(typeof a=="number"&&a>=0);var p=Math.ceil(a/26)|0,y=a%26;this._expand(p),y>0&&p--;for(var h=0;h<p;h++)this.words[h]=~this.words[h]&67108863;return y>0&&(this.words[h]=~this.words[h]&67108863>>26-y),this.strip()},t.prototype.notn=function(a){return this.clone().inotn(a)},t.prototype.setn=function(a,p){o(typeof a=="number"&&a>=0);var y=a/26|0,h=a%26;return this._expand(y+1),p?this.words[y]=this.words[y]|1<<h:this.words[y]=this.words[y]&~(1<<h),this.strip()},t.prototype.iadd=function(a){var p;if(this.negative!==0&&a.negative===0)return this.negative=0,p=this.isub(a),this.negative^=1,this._normSign();if(this.negative===0&&a.negative!==0)return a.negative=0,p=this.isub(a),a.negative=1,p._normSign();var y,h;this.length>a.length?(y=this,h=a):(y=a,h=this);for(var g=0,N=0;N<h.length;N++)p=(y.words[N]|0)+(h.words[N]|0)+g,this.words[N]=p&67108863,g=p>>>26;for(;g!==0&&N<y.length;N++)p=(y.words[N]|0)+g,this.words[N]=p&67108863,g=p>>>26;if(this.length=y.length,g!==0)this.words[this.length]=g,this.length++;else if(y!==this)for(;N<y.length;N++)this.words[N]=y.words[N];return this},t.prototype.add=function(a){var p;return a.negative!==0&&this.negative===0?(a.negative=0,p=this.sub(a),a.negative^=1,p):a.negative===0&&this.negative!==0?(this.negative=0,p=a.sub(this),this.negative=1,p):this.length>a.length?this.clone().iadd(a):a.clone().iadd(this)},t.prototype.isub=function(a){if(a.negative!==0){a.negative=0;var p=this.iadd(a);return a.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var y=this.cmp(a);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var h,g;y>0?(h=this,g=a):(h=a,g=this);for(var N=0,L=0;L<g.length;L++)p=(h.words[L]|0)-(g.words[L]|0)+N,N=p>>26,this.words[L]=p&67108863;for(;N!==0&&L<h.length;L++)p=(h.words[L]|0)+N,N=p>>26,this.words[L]=p&67108863;if(N===0&&L<h.length&&h!==this)for(;L<h.length;L++)this.words[L]=h.words[L];return this.length=Math.max(this.length,L),h!==this&&(this.negative=1),this.strip()},t.prototype.sub=function(a){return this.clone().isub(a)};function m(k,a,p){p.negative=a.negative^k.negative;var y=k.length+a.length|0;p.length=y,y=y-1|0;var h=k.words[0]|0,g=a.words[0]|0,N=h*g,L=N&67108863,S=N/67108864|0;p.words[0]=L;for(var s=1;s<y;s++){for(var x=S>>>26,W=S&67108863,K=Math.min(s,a.length-1),J=Math.max(0,s-k.length+1);J<=K;J++){var G=s-J|0;h=k.words[G]|0,g=a.words[J]|0,N=h*g+W,x+=N/67108864|0,W=N&67108863}p.words[s]=W|0,S=x|0}return S!==0?p.words[s]=S|0:p.length--,p.strip()}var I=function(a,p,y){var h=a.words,g=p.words,N=y.words,L=0,S,s,x,W=h[0]|0,K=W&8191,J=W>>>13,G=h[1]|0,ee=G&8191,te=G>>>13,ke=h[2]|0,we=ke&8191,se=ke>>>13,gn=h[3]|0,xe=gn&8191,ye=gn>>>13,vn=h[4]|0,Oe=vn&8191,Ne=vn>>>13,Kr=h[5]|0,Ce=Kr&8191,Fe=Kr>>>13,wf=h[6]|0,Me=wf&8191,_e=wf>>>13,gf=h[7]|0,ze=gf&8191,De=gf>>>13,vf=h[8]|0,Ue=vf&8191,Re=vf>>>13,Af=h[9]|0,Ve=Af&8191,qe=Af>>>13,Of=g[0]|0,He=Of&8191,We=Of>>>13,Sf=g[1]|0,Ke=Sf&8191,Je=Sf>>>13,mf=g[2]|0,$e=mf&8191,Ze=mf>>>13,If=g[3]|0,Xe=If&8191,Ge=If>>>13,Bf=g[4]|0,Ye=Bf&8191,Qe=Bf>>>13,xf=g[5]|0,je=xf&8191,et=xf>>>13,Nf=g[6]|0,tt=Nf&8191,nt=Nf>>>13,kf=g[7]|0,rt=kf&8191,ot=kf>>>13,Tf=g[8]|0,it=Tf&8191,lt=Tf>>>13,Lf=g[9]|0,ft=Lf&8191,ct=Lf>>>13;y.negative=a.negative^p.negative,y.length=19,S=Math.imul(K,He),s=Math.imul(K,We),s=s+Math.imul(J,He)|0,x=Math.imul(J,We);var mi=(L+S|0)+((s&8191)<<13)|0;L=(x+(s>>>13)|0)+(mi>>>26)|0,mi&=67108863,S=Math.imul(ee,He),s=Math.imul(ee,We),s=s+Math.imul(te,He)|0,x=Math.imul(te,We),S=S+Math.imul(K,Ke)|0,s=s+Math.imul(K,Je)|0,s=s+Math.imul(J,Ke)|0,x=x+Math.imul(J,Je)|0;var Ii=(L+S|0)+((s&8191)<<13)|0;L=(x+(s>>>13)|0)+(Ii>>>26)|0,Ii&=67108863,S=Math.imul(we,He),s=Math.imul(we,We),s=s+Math.imul(se,He)|0,x=Math.imul(se,We),S=S+Math.imul(ee,Ke)|0,s=s+Math.imul(ee,Je)|0,s=s+Math.imul(te,Ke)|0,x=x+Math.imul(te,Je)|0,S=S+Math.imul(K,$e)|0,s=s+Math.imul(K,Ze)|0,s=s+Math.imul(J,$e)|0,x=x+Math.imul(J,Ze)|0;var Bi=(L+S|0)+((s&8191)<<13)|0;L=(x+(s>>>13)|0)+(Bi>>>26)|0,Bi&=67108863,S=Math.imul(xe,He),s=Math.imul(xe,We),s=s+Math.imul(ye,He)|0,x=Math.imul(ye,We),S=S+Math.imul(we,Ke)|0,s=s+Math.imul(we,Je)|0,s=s+Math.imul(se,Ke)|0,x=x+Math.imul(se,Je)|0,S=S+Math.imul(ee,$e)|0,s=s+Math.imul(ee,Ze)|0,s=s+Math.imul(te,$e)|0,x=x+Math.imul(te,Ze)|0,S=S+Math.imul(K,Xe)|0,s=s+Math.imul(K,Ge)|0,s=s+Math.imul(J,Xe)|0,x=x+Math.imul(J,Ge)|0;var xi=(L+S|0)+((s&8191)<<13)|0;L=(x+(s>>>13)|0)+(xi>>>26)|0,xi&=67108863,S=Math.imul(Oe,He),s=Math.imul(Oe,We),s=s+Math.imul(Ne,He)|0,x=Math.imul(Ne,We),S=S+Math.imul(xe,Ke)|0,s=s+Math.imul(xe,Je)|0,s=s+Math.imul(ye,Ke)|0,x=x+Math.imul(ye,Je)|0,S=S+Math.imul(we,$e)|0,s=s+Math.imul(we,Ze)|0,s=s+Math.imul(se,$e)|0,x=x+Math.imul(se,Ze)|0,S=S+Math.imul(ee,Xe)|0,s=s+Math.imul(ee,Ge)|0,s=s+Math.imul(te,Xe)|0,x=x+Math.imul(te,Ge)|0,S=S+Math.imul(K,Ye)|0,s=s+Math.imul(K,Qe)|0,s=s+Math.imul(J,Ye)|0,x=x+Math.imul(J,Qe)|0;var Ni=(L+S|0)+((s&8191)<<13)|0;L=(x+(s>>>13)|0)+(Ni>>>26)|0,Ni&=67108863,S=Math.imul(Ce,He),s=Math.imul(Ce,We),s=s+Math.imul(Fe,He)|0,x=Math.imul(Fe,We),S=S+Math.imul(Oe,Ke)|0,s=s+Math.imul(Oe,Je)|0,s=s+Math.imul(Ne,Ke)|0,x=x+Math.imul(Ne,Je)|0,S=S+Math.imul(xe,$e)|0,s=s+Math.imul(xe,Ze)|0,s=s+Math.imul(ye,$e)|0,x=x+Math.imul(ye,Ze)|0,S=S+Math.imul(we,Xe)|0,s=s+Math.imul(we,Ge)|0,s=s+Math.imul(se,Xe)|0,x=x+Math.imul(se,Ge)|0,S=S+Math.imul(ee,Ye)|0,s=s+Math.imul(ee,Qe)|0,s=s+Math.imul(te,Ye)|0,x=x+Math.imul(te,Qe)|0,S=S+Math.imul(K,je)|0,s=s+Math.imul(K,et)|0,s=s+Math.imul(J,je)|0,x=x+Math.imul(J,et)|0;var ki=(L+S|0)+((s&8191)<<13)|0;L=(x+(s>>>13)|0)+(ki>>>26)|0,ki&=67108863,S=Math.imul(Me,He),s=Math.imul(Me,We),s=s+Math.imul(_e,He)|0,x=Math.imul(_e,We),S=S+Math.imul(Ce,Ke)|0,s=s+Math.imul(Ce,Je)|0,s=s+Math.imul(Fe,Ke)|0,x=x+Math.imul(Fe,Je)|0,S=S+Math.imul(Oe,$e)|0,s=s+Math.imul(Oe,Ze)|0,s=s+Math.imul(Ne,$e)|0,x=x+Math.imul(Ne,Ze)|0,S=S+Math.imul(xe,Xe)|0,s=s+Math.imul(xe,Ge)|0,s=s+Math.imul(ye,Xe)|0,x=x+Math.imul(ye,Ge)|0,S=S+Math.imul(we,Ye)|0,s=s+Math.imul(we,Qe)|0,s=s+Math.imul(se,Ye)|0,x=x+Math.imul(se,Qe)|0,S=S+Math.imul(ee,je)|0,s=s+Math.imul(ee,et)|0,s=s+Math.imul(te,je)|0,x=x+Math.imul(te,et)|0,S=S+Math.imul(K,tt)|0,s=s+Math.imul(K,nt)|0,s=s+Math.imul(J,tt)|0,x=x+Math.imul(J,nt)|0;var Ti=(L+S|0)+((s&8191)<<13)|0;L=(x+(s>>>13)|0)+(Ti>>>26)|0,Ti&=67108863,S=Math.imul(ze,He),s=Math.imul(ze,We),s=s+Math.imul(De,He)|0,x=Math.imul(De,We),S=S+Math.imul(Me,Ke)|0,s=s+Math.imul(Me,Je)|0,s=s+Math.imul(_e,Ke)|0,x=x+Math.imul(_e,Je)|0,S=S+Math.imul(Ce,$e)|0,s=s+Math.imul(Ce,Ze)|0,s=s+Math.imul(Fe,$e)|0,x=x+Math.imul(Fe,Ze)|0,S=S+Math.imul(Oe,Xe)|0,s=s+Math.imul(Oe,Ge)|0,s=s+Math.imul(Ne,Xe)|0,x=x+Math.imul(Ne,Ge)|0,S=S+Math.imul(xe,Ye)|0,s=s+Math.imul(xe,Qe)|0,s=s+Math.imul(ye,Ye)|0,x=x+Math.imul(ye,Qe)|0,S=S+Math.imul(we,je)|0,s=s+Math.imul(we,et)|0,s=s+Math.imul(se,je)|0,x=x+Math.imul(se,et)|0,S=S+Math.imul(ee,tt)|0,s=s+Math.imul(ee,nt)|0,s=s+Math.imul(te,tt)|0,x=x+Math.imul(te,nt)|0,S=S+Math.imul(K,rt)|0,s=s+Math.imul(K,ot)|0,s=s+Math.imul(J,rt)|0,x=x+Math.imul(J,ot)|0;var Li=(L+S|0)+((s&8191)<<13)|0;L=(x+(s>>>13)|0)+(Li>>>26)|0,Li&=67108863,S=Math.imul(Ue,He),s=Math.imul(Ue,We),s=s+Math.imul(Re,He)|0,x=Math.imul(Re,We),S=S+Math.imul(ze,Ke)|0,s=s+Math.imul(ze,Je)|0,s=s+Math.imul(De,Ke)|0,x=x+Math.imul(De,Je)|0,S=S+Math.imul(Me,$e)|0,s=s+Math.imul(Me,Ze)|0,s=s+Math.imul(_e,$e)|0,x=x+Math.imul(_e,Ze)|0,S=S+Math.imul(Ce,Xe)|0,s=s+Math.imul(Ce,Ge)|0,s=s+Math.imul(Fe,Xe)|0,x=x+Math.imul(Fe,Ge)|0,S=S+Math.imul(Oe,Ye)|0,s=s+Math.imul(Oe,Qe)|0,s=s+Math.imul(Ne,Ye)|0,x=x+Math.imul(Ne,Qe)|0,S=S+Math.imul(xe,je)|0,s=s+Math.imul(xe,et)|0,s=s+Math.imul(ye,je)|0,x=x+Math.imul(ye,et)|0,S=S+Math.imul(we,tt)|0,s=s+Math.imul(we,nt)|0,s=s+Math.imul(se,tt)|0,x=x+Math.imul(se,nt)|0,S=S+Math.imul(ee,rt)|0,s=s+Math.imul(ee,ot)|0,s=s+Math.imul(te,rt)|0,x=x+Math.imul(te,ot)|0,S=S+Math.imul(K,it)|0,s=s+Math.imul(K,lt)|0,s=s+Math.imul(J,it)|0,x=x+Math.imul(J,lt)|0;var Pi=(L+S|0)+((s&8191)<<13)|0;L=(x+(s>>>13)|0)+(Pi>>>26)|0,Pi&=67108863,S=Math.imul(Ve,He),s=Math.imul(Ve,We),s=s+Math.imul(qe,He)|0,x=Math.imul(qe,We),S=S+Math.imul(Ue,Ke)|0,s=s+Math.imul(Ue,Je)|0,s=s+Math.imul(Re,Ke)|0,x=x+Math.imul(Re,Je)|0,S=S+Math.imul(ze,$e)|0,s=s+Math.imul(ze,Ze)|0,s=s+Math.imul(De,$e)|0,x=x+Math.imul(De,Ze)|0,S=S+Math.imul(Me,Xe)|0,s=s+Math.imul(Me,Ge)|0,s=s+Math.imul(_e,Xe)|0,x=x+Math.imul(_e,Ge)|0,S=S+Math.imul(Ce,Ye)|0,s=s+Math.imul(Ce,Qe)|0,s=s+Math.imul(Fe,Ye)|0,x=x+Math.imul(Fe,Qe)|0,S=S+Math.imul(Oe,je)|0,s=s+Math.imul(Oe,et)|0,s=s+Math.imul(Ne,je)|0,x=x+Math.imul(Ne,et)|0,S=S+Math.imul(xe,tt)|0,s=s+Math.imul(xe,nt)|0,s=s+Math.imul(ye,tt)|0,x=x+Math.imul(ye,nt)|0,S=S+Math.imul(we,rt)|0,s=s+Math.imul(we,ot)|0,s=s+Math.imul(se,rt)|0,x=x+Math.imul(se,ot)|0,S=S+Math.imul(ee,it)|0,s=s+Math.imul(ee,lt)|0,s=s+Math.imul(te,it)|0,x=x+Math.imul(te,lt)|0,S=S+Math.imul(K,ft)|0,s=s+Math.imul(K,ct)|0,s=s+Math.imul(J,ft)|0,x=x+Math.imul(J,ct)|0;var Ei=(L+S|0)+((s&8191)<<13)|0;L=(x+(s>>>13)|0)+(Ei>>>26)|0,Ei&=67108863,S=Math.imul(Ve,Ke),s=Math.imul(Ve,Je),s=s+Math.imul(qe,Ke)|0,x=Math.imul(qe,Je),S=S+Math.imul(Ue,$e)|0,s=s+Math.imul(Ue,Ze)|0,s=s+Math.imul(Re,$e)|0,x=x+Math.imul(Re,Ze)|0,S=S+Math.imul(ze,Xe)|0,s=s+Math.imul(ze,Ge)|0,s=s+Math.imul(De,Xe)|0,x=x+Math.imul(De,Ge)|0,S=S+Math.imul(Me,Ye)|0,s=s+Math.imul(Me,Qe)|0,s=s+Math.imul(_e,Ye)|0,x=x+Math.imul(_e,Qe)|0,S=S+Math.imul(Ce,je)|0,s=s+Math.imul(Ce,et)|0,s=s+Math.imul(Fe,je)|0,x=x+Math.imul(Fe,et)|0,S=S+Math.imul(Oe,tt)|0,s=s+Math.imul(Oe,nt)|0,s=s+Math.imul(Ne,tt)|0,x=x+Math.imul(Ne,nt)|0,S=S+Math.imul(xe,rt)|0,s=s+Math.imul(xe,ot)|0,s=s+Math.imul(ye,rt)|0,x=x+Math.imul(ye,ot)|0,S=S+Math.imul(we,it)|0,s=s+Math.imul(we,lt)|0,s=s+Math.imul(se,it)|0,x=x+Math.imul(se,lt)|0,S=S+Math.imul(ee,ft)|0,s=s+Math.imul(ee,ct)|0,s=s+Math.imul(te,ft)|0,x=x+Math.imul(te,ct)|0;var Ci=(L+S|0)+((s&8191)<<13)|0;L=(x+(s>>>13)|0)+(Ci>>>26)|0,Ci&=67108863,S=Math.imul(Ve,$e),s=Math.imul(Ve,Ze),s=s+Math.imul(qe,$e)|0,x=Math.imul(qe,Ze),S=S+Math.imul(Ue,Xe)|0,s=s+Math.imul(Ue,Ge)|0,s=s+Math.imul(Re,Xe)|0,x=x+Math.imul(Re,Ge)|0,S=S+Math.imul(ze,Ye)|0,s=s+Math.imul(ze,Qe)|0,s=s+Math.imul(De,Ye)|0,x=x+Math.imul(De,Qe)|0,S=S+Math.imul(Me,je)|0,s=s+Math.imul(Me,et)|0,s=s+Math.imul(_e,je)|0,x=x+Math.imul(_e,et)|0,S=S+Math.imul(Ce,tt)|0,s=s+Math.imul(Ce,nt)|0,s=s+Math.imul(Fe,tt)|0,x=x+Math.imul(Fe,nt)|0,S=S+Math.imul(Oe,rt)|0,s=s+Math.imul(Oe,ot)|0,s=s+Math.imul(Ne,rt)|0,x=x+Math.imul(Ne,ot)|0,S=S+Math.imul(xe,it)|0,s=s+Math.imul(xe,lt)|0,s=s+Math.imul(ye,it)|0,x=x+Math.imul(ye,lt)|0,S=S+Math.imul(we,ft)|0,s=s+Math.imul(we,ct)|0,s=s+Math.imul(se,ft)|0,x=x+Math.imul(se,ct)|0;var Fi=(L+S|0)+((s&8191)<<13)|0;L=(x+(s>>>13)|0)+(Fi>>>26)|0,Fi&=67108863,S=Math.imul(Ve,Xe),s=Math.imul(Ve,Ge),s=s+Math.imul(qe,Xe)|0,x=Math.imul(qe,Ge),S=S+Math.imul(Ue,Ye)|0,s=s+Math.imul(Ue,Qe)|0,s=s+Math.imul(Re,Ye)|0,x=x+Math.imul(Re,Qe)|0,S=S+Math.imul(ze,je)|0,s=s+Math.imul(ze,et)|0,s=s+Math.imul(De,je)|0,x=x+Math.imul(De,et)|0,S=S+Math.imul(Me,tt)|0,s=s+Math.imul(Me,nt)|0,s=s+Math.imul(_e,tt)|0,x=x+Math.imul(_e,nt)|0,S=S+Math.imul(Ce,rt)|0,s=s+Math.imul(Ce,ot)|0,s=s+Math.imul(Fe,rt)|0,x=x+Math.imul(Fe,ot)|0,S=S+Math.imul(Oe,it)|0,s=s+Math.imul(Oe,lt)|0,s=s+Math.imul(Ne,it)|0,x=x+Math.imul(Ne,lt)|0,S=S+Math.imul(xe,ft)|0,s=s+Math.imul(xe,ct)|0,s=s+Math.imul(ye,ft)|0,x=x+Math.imul(ye,ct)|0;var Mi=(L+S|0)+((s&8191)<<13)|0;L=(x+(s>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,S=Math.imul(Ve,Ye),s=Math.imul(Ve,Qe),s=s+Math.imul(qe,Ye)|0,x=Math.imul(qe,Qe),S=S+Math.imul(Ue,je)|0,s=s+Math.imul(Ue,et)|0,s=s+Math.imul(Re,je)|0,x=x+Math.imul(Re,et)|0,S=S+Math.imul(ze,tt)|0,s=s+Math.imul(ze,nt)|0,s=s+Math.imul(De,tt)|0,x=x+Math.imul(De,nt)|0,S=S+Math.imul(Me,rt)|0,s=s+Math.imul(Me,ot)|0,s=s+Math.imul(_e,rt)|0,x=x+Math.imul(_e,ot)|0,S=S+Math.imul(Ce,it)|0,s=s+Math.imul(Ce,lt)|0,s=s+Math.imul(Fe,it)|0,x=x+Math.imul(Fe,lt)|0,S=S+Math.imul(Oe,ft)|0,s=s+Math.imul(Oe,ct)|0,s=s+Math.imul(Ne,ft)|0,x=x+Math.imul(Ne,ct)|0;var _i=(L+S|0)+((s&8191)<<13)|0;L=(x+(s>>>13)|0)+(_i>>>26)|0,_i&=67108863,S=Math.imul(Ve,je),s=Math.imul(Ve,et),s=s+Math.imul(qe,je)|0,x=Math.imul(qe,et),S=S+Math.imul(Ue,tt)|0,s=s+Math.imul(Ue,nt)|0,s=s+Math.imul(Re,tt)|0,x=x+Math.imul(Re,nt)|0,S=S+Math.imul(ze,rt)|0,s=s+Math.imul(ze,ot)|0,s=s+Math.imul(De,rt)|0,x=x+Math.imul(De,ot)|0,S=S+Math.imul(Me,it)|0,s=s+Math.imul(Me,lt)|0,s=s+Math.imul(_e,it)|0,x=x+Math.imul(_e,lt)|0,S=S+Math.imul(Ce,ft)|0,s=s+Math.imul(Ce,ct)|0,s=s+Math.imul(Fe,ft)|0,x=x+Math.imul(Fe,ct)|0;var zi=(L+S|0)+((s&8191)<<13)|0;L=(x+(s>>>13)|0)+(zi>>>26)|0,zi&=67108863,S=Math.imul(Ve,tt),s=Math.imul(Ve,nt),s=s+Math.imul(qe,tt)|0,x=Math.imul(qe,nt),S=S+Math.imul(Ue,rt)|0,s=s+Math.imul(Ue,ot)|0,s=s+Math.imul(Re,rt)|0,x=x+Math.imul(Re,ot)|0,S=S+Math.imul(ze,it)|0,s=s+Math.imul(ze,lt)|0,s=s+Math.imul(De,it)|0,x=x+Math.imul(De,lt)|0,S=S+Math.imul(Me,ft)|0,s=s+Math.imul(Me,ct)|0,s=s+Math.imul(_e,ft)|0,x=x+Math.imul(_e,ct)|0;var Di=(L+S|0)+((s&8191)<<13)|0;L=(x+(s>>>13)|0)+(Di>>>26)|0,Di&=67108863,S=Math.imul(Ve,rt),s=Math.imul(Ve,ot),s=s+Math.imul(qe,rt)|0,x=Math.imul(qe,ot),S=S+Math.imul(Ue,it)|0,s=s+Math.imul(Ue,lt)|0,s=s+Math.imul(Re,it)|0,x=x+Math.imul(Re,lt)|0,S=S+Math.imul(ze,ft)|0,s=s+Math.imul(ze,ct)|0,s=s+Math.imul(De,ft)|0,x=x+Math.imul(De,ct)|0;var Ui=(L+S|0)+((s&8191)<<13)|0;L=(x+(s>>>13)|0)+(Ui>>>26)|0,Ui&=67108863,S=Math.imul(Ve,it),s=Math.imul(Ve,lt),s=s+Math.imul(qe,it)|0,x=Math.imul(qe,lt),S=S+Math.imul(Ue,ft)|0,s=s+Math.imul(Ue,ct)|0,s=s+Math.imul(Re,ft)|0,x=x+Math.imul(Re,ct)|0;var Ri=(L+S|0)+((s&8191)<<13)|0;L=(x+(s>>>13)|0)+(Ri>>>26)|0,Ri&=67108863,S=Math.imul(Ve,ft),s=Math.imul(Ve,ct),s=s+Math.imul(qe,ft)|0,x=Math.imul(qe,ct);var Vi=(L+S|0)+((s&8191)<<13)|0;return L=(x+(s>>>13)|0)+(Vi>>>26)|0,Vi&=67108863,N[0]=mi,N[1]=Ii,N[2]=Bi,N[3]=xi,N[4]=Ni,N[5]=ki,N[6]=Ti,N[7]=Li,N[8]=Pi,N[9]=Ei,N[10]=Ci,N[11]=Fi,N[12]=Mi,N[13]=_i,N[14]=zi,N[15]=Di,N[16]=Ui,N[17]=Ri,N[18]=Vi,L!==0&&(N[19]=L,y.length++),y};Math.imul||(I=m);function O(k,a,p){p.negative=a.negative^k.negative,p.length=k.length+a.length;for(var y=0,h=0,g=0;g<p.length-1;g++){var N=h;h=0;for(var L=y&67108863,S=Math.min(g,a.length-1),s=Math.max(0,g-k.length+1);s<=S;s++){var x=g-s,W=k.words[x]|0,K=a.words[s]|0,J=W*K,G=J&67108863;N=N+(J/67108864|0)|0,G=G+L|0,L=G&67108863,N=N+(G>>>26)|0,h+=N>>>26,N&=67108863}p.words[g]=L,y=N,N=h}return y!==0?p.words[g]=y:p.length--,p.strip()}function T(k,a,p){var y=new E;return y.mulp(k,a,p)}t.prototype.mulTo=function(a,p){var y,h=this.length+a.length;return this.length===10&&a.length===10?y=I(this,a,p):h<63?y=m(this,a,p):h<1024?y=O(this,a,p):y=T(this,a,p),y};function E(k,a){this.x=k,this.y=a}E.prototype.makeRBT=function(a){for(var p=new Array(a),y=t.prototype._countBits(a)-1,h=0;h<a;h++)p[h]=this.revBin(h,y,a);return p},E.prototype.revBin=function(a,p,y){if(a===0||a===y-1)return a;for(var h=0,g=0;g<p;g++)h|=(a&1)<<p-g-1,a>>=1;return h},E.prototype.permute=function(a,p,y,h,g,N){for(var L=0;L<N;L++)h[L]=p[a[L]],g[L]=y[a[L]]},E.prototype.transform=function(a,p,y,h,g,N){this.permute(N,a,p,y,h,g);for(var L=1;L<g;L<<=1)for(var S=L<<1,s=Math.cos(2*Math.PI/S),x=Math.sin(2*Math.PI/S),W=0;W<g;W+=S)for(var K=s,J=x,G=0;G<L;G++){var ee=y[W+G],te=h[W+G],ke=y[W+G+L],we=h[W+G+L],se=K*ke-J*we;we=K*we+J*ke,ke=se,y[W+G]=ee+ke,h[W+G]=te+we,y[W+G+L]=ee-ke,h[W+G+L]=te-we,G!==S&&(se=s*K-x*J,J=s*J+x*K,K=se)}},E.prototype.guessLen13b=function(a,p){var y=Math.max(p,a)|1,h=y&1,g=0;for(y=y/2|0;y;y=y>>>1)g++;return 1<<g+1+h},E.prototype.conjugate=function(a,p,y){if(!(y<=1))for(var h=0;h<y/2;h++){var g=a[h];a[h]=a[y-h-1],a[y-h-1]=g,g=p[h],p[h]=-p[y-h-1],p[y-h-1]=-g}},E.prototype.normalize13b=function(a,p){for(var y=0,h=0;h<p/2;h++){var g=Math.round(a[2*h+1]/p)*8192+Math.round(a[2*h]/p)+y;a[h]=g&67108863,g<67108864?y=0:y=g/67108864|0}return a},E.prototype.convert13b=function(a,p,y,h){for(var g=0,N=0;N<p;N++)g=g+(a[N]|0),y[2*N]=g&8191,g=g>>>13,y[2*N+1]=g&8191,g=g>>>13;for(N=2*p;N<h;++N)y[N]=0;o(g===0),o((g&-8192)===0)},E.prototype.stub=function(a){for(var p=new Array(a),y=0;y<a;y++)p[y]=0;return p},E.prototype.mulp=function(a,p,y){var h=2*this.guessLen13b(a.length,p.length),g=this.makeRBT(h),N=this.stub(h),L=new Array(h),S=new Array(h),s=new Array(h),x=new Array(h),W=new Array(h),K=new Array(h),J=y.words;J.length=h,this.convert13b(a.words,a.length,L,h),this.convert13b(p.words,p.length,x,h),this.transform(L,N,S,s,h,g),this.transform(x,N,W,K,h,g);for(var G=0;G<h;G++){var ee=S[G]*W[G]-s[G]*K[G];s[G]=S[G]*K[G]+s[G]*W[G],S[G]=ee}return this.conjugate(S,s,h),this.transform(S,s,J,N,h,g),this.conjugate(J,N,h),this.normalize13b(J,h),y.negative=a.negative^p.negative,y.length=a.length+p.length,y.strip()},t.prototype.mul=function(a){var p=new t(null);return p.words=new Array(this.length+a.length),this.mulTo(a,p)},t.prototype.mulf=function(a){var p=new t(null);return p.words=new Array(this.length+a.length),T(this,a,p)},t.prototype.imul=function(a){return this.clone().mulTo(a,this)},t.prototype.imuln=function(a){o(typeof a=="number"),o(a<67108864);for(var p=0,y=0;y<this.length;y++){var h=(this.words[y]|0)*a,g=(h&67108863)+(p&67108863);p>>=26,p+=h/67108864|0,p+=g>>>26,this.words[y]=g&67108863}return p!==0&&(this.words[y]=p,this.length++),this},t.prototype.muln=function(a){return this.clone().imuln(a)},t.prototype.sqr=function(){return this.mul(this)},t.prototype.isqr=function(){return this.imul(this.clone())},t.prototype.pow=function(a){var p=B(a);if(p.length===0)return new t(1);for(var y=this,h=0;h<p.length&&p[h]===0;h++,y=y.sqr());if(++h<p.length)for(var g=y.sqr();h<p.length;h++,g=g.sqr())p[h]!==0&&(y=y.mul(g));return y},t.prototype.iushln=function(a){o(typeof a=="number"&&a>=0);var p=a%26,y=(a-p)/26,h=67108863>>>26-p<<26-p,g;if(p!==0){var N=0;for(g=0;g<this.length;g++){var L=this.words[g]&h,S=(this.words[g]|0)-L<<p;this.words[g]=S|N,N=L>>>26-p}N&&(this.words[g]=N,this.length++)}if(y!==0){for(g=this.length-1;g>=0;g--)this.words[g+y]=this.words[g];for(g=0;g<y;g++)this.words[g]=0;this.length+=y}return this.strip()},t.prototype.ishln=function(a){return o(this.negative===0),this.iushln(a)},t.prototype.iushrn=function(a,p,y){o(typeof a=="number"&&a>=0);var h;p?h=(p-p%26)/26:h=0;var g=a%26,N=Math.min((a-g)/26,this.length),L=67108863^67108863>>>g<<g,S=y;if(h-=N,h=Math.max(0,h),S){for(var s=0;s<N;s++)S.words[s]=this.words[s];S.length=N}if(N!==0)if(this.length>N)for(this.length-=N,s=0;s<this.length;s++)this.words[s]=this.words[s+N];else this.words[0]=0,this.length=1;var x=0;for(s=this.length-1;s>=0&&(x!==0||s>=h);s--){var W=this.words[s]|0;this.words[s]=x<<26-g|W>>>g,x=W&L}return S&&x!==0&&(S.words[S.length++]=x),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},t.prototype.ishrn=function(a,p,y){return o(this.negative===0),this.iushrn(a,p,y)},t.prototype.shln=function(a){return this.clone().ishln(a)},t.prototype.ushln=function(a){return this.clone().iushln(a)},t.prototype.shrn=function(a){return this.clone().ishrn(a)},t.prototype.ushrn=function(a){return this.clone().iushrn(a)},t.prototype.testn=function(a){o(typeof a=="number"&&a>=0);var p=a%26,y=(a-p)/26,h=1<<p;if(this.length<=y)return!1;var g=this.words[y];return!!(g&h)},t.prototype.imaskn=function(a){o(typeof a=="number"&&a>=0);var p=a%26,y=(a-p)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(p!==0&&y++,this.length=Math.min(y,this.length),p!==0){var h=67108863^67108863>>>p<<p;this.words[this.length-1]&=h}return this.strip()},t.prototype.maskn=function(a){return this.clone().imaskn(a)},t.prototype.iaddn=function(a){return o(typeof a=="number"),o(a<67108864),a<0?this.isubn(-a):this.negative!==0?this.length===1&&(this.words[0]|0)<a?(this.words[0]=a-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(a),this.negative=1,this):this._iaddn(a)},t.prototype._iaddn=function(a){this.words[0]+=a;for(var p=0;p<this.length&&this.words[p]>=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},t.prototype.isubn=function(a){if(o(typeof a=="number"),o(a<67108864),a<0)return this.iaddn(-a);if(this.negative!==0)return this.negative=0,this.iaddn(a),this.negative=1,this;if(this.words[0]-=a,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p<this.length&&this.words[p]<0;p++)this.words[p]+=67108864,this.words[p+1]-=1;return this.strip()},t.prototype.addn=function(a){return this.clone().iaddn(a)},t.prototype.subn=function(a){return this.clone().isubn(a)},t.prototype.iabs=function(){return this.negative=0,this},t.prototype.abs=function(){return this.clone().iabs()},t.prototype._ishlnsubmul=function(a,p,y){var h=a.length+y,g;this._expand(h);var N,L=0;for(g=0;g<a.length;g++){N=(this.words[g+y]|0)+L;var S=(a.words[g]|0)*p;N-=S&67108863,L=(N>>26)-(S/67108864|0),this.words[g+y]=N&67108863}for(;g<this.length-y;g++)N=(this.words[g+y]|0)+L,L=N>>26,this.words[g+y]=N&67108863;if(L===0)return this.strip();for(o(L===-1),L=0,g=0;g<this.length;g++)N=-(this.words[g]|0)+L,L=N>>26,this.words[g]=N&67108863;return this.negative=1,this.strip()},t.prototype._wordDiv=function(a,p){var y=this.length-a.length,h=this.clone(),g=a,N=g.words[g.length-1]|0,L=this._countBits(N);y=26-L,y!==0&&(g=g.ushln(y),h.iushln(y),N=g.words[g.length-1]|0);var S=h.length-g.length,s;if(p!=="mod"){s=new t(null),s.length=S+1,s.words=new Array(s.length);for(var x=0;x<s.length;x++)s.words[x]=0}var W=h.clone()._ishlnsubmul(g,1,S);W.negative===0&&(h=W,s&&(s.words[S]=1));for(var K=S-1;K>=0;K--){var J=(h.words[g.length+K]|0)*67108864+(h.words[g.length+K-1]|0);for(J=Math.min(J/N|0,67108863),h._ishlnsubmul(g,J,K);h.negative!==0;)J--,h.negative=0,h._ishlnsubmul(g,1,K),h.isZero()||(h.negative^=1);s&&(s.words[K]=J)}return s&&s.strip(),h.strip(),p!=="div"&&y!==0&&h.iushrn(y),{div:s||null,mod:h}},t.prototype.divmod=function(a,p,y){if(o(!a.isZero()),this.isZero())return{div:new t(0),mod:new t(0)};var h,g,N;return this.negative!==0&&a.negative===0?(N=this.neg().divmod(a,p),p!=="mod"&&(h=N.div.neg()),p!=="div"&&(g=N.mod.neg(),y&&g.negative!==0&&g.iadd(a)),{div:h,mod:g}):this.negative===0&&a.negative!==0?(N=this.divmod(a.neg(),p),p!=="mod"&&(h=N.div.neg()),{div:h,mod:N.mod}):(this.negative&a.negative)!==0?(N=this.neg().divmod(a.neg(),p),p!=="div"&&(g=N.mod.neg(),y&&g.negative!==0&&g.isub(a)),{div:N.div,mod:g}):a.length>this.length||this.cmp(a)<0?{div:new t(0),mod:this}:a.length===1?p==="div"?{div:this.divn(a.words[0]),mod:null}:p==="mod"?{div:null,mod:new t(this.modn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new t(this.modn(a.words[0]))}:this._wordDiv(a,p)},t.prototype.div=function(a){return this.divmod(a,"div",!1).div},t.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},t.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},t.prototype.divRound=function(a){var p=this.divmod(a);if(p.mod.isZero())return p.div;var y=p.div.negative!==0?p.mod.isub(a):p.mod,h=a.ushrn(1),g=a.andln(1),N=y.cmp(h);return N<0||g===1&&N===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},t.prototype.modn=function(a){o(a<=67108863);for(var p=(1<<26)%a,y=0,h=this.length-1;h>=0;h--)y=(p*y+(this.words[h]|0))%a;return y},t.prototype.idivn=function(a){o(a<=67108863);for(var p=0,y=this.length-1;y>=0;y--){var h=(this.words[y]|0)+p*67108864;this.words[y]=h/a|0,p=h%a}return this.strip()},t.prototype.divn=function(a){return this.clone().idivn(a)},t.prototype.egcd=function(a){o(a.negative===0),o(!a.isZero());var p=this,y=a.clone();p.negative!==0?p=p.umod(a):p=p.clone();for(var h=new t(1),g=new t(0),N=new t(0),L=new t(1),S=0;p.isEven()&&y.isEven();)p.iushrn(1),y.iushrn(1),++S;for(var s=y.clone(),x=p.clone();!p.isZero();){for(var W=0,K=1;(p.words[0]&K)===0&&W<26;++W,K<<=1);if(W>0)for(p.iushrn(W);W-- >0;)(h.isOdd()||g.isOdd())&&(h.iadd(s),g.isub(x)),h.iushrn(1),g.iushrn(1);for(var J=0,G=1;(y.words[0]&G)===0&&J<26;++J,G<<=1);if(J>0)for(y.iushrn(J);J-- >0;)(N.isOdd()||L.isOdd())&&(N.iadd(s),L.isub(x)),N.iushrn(1),L.iushrn(1);p.cmp(y)>=0?(p.isub(y),h.isub(N),g.isub(L)):(y.isub(p),N.isub(h),L.isub(g))}return{a:N,b:L,gcd:y.iushln(S)}},t.prototype._invmp=function(a){o(a.negative===0),o(!a.isZero());var p=this,y=a.clone();p.negative!==0?p=p.umod(a):p=p.clone();for(var h=new t(1),g=new t(0),N=y.clone();p.cmpn(1)>0&&y.cmpn(1)>0;){for(var L=0,S=1;(p.words[0]&S)===0&&L<26;++L,S<<=1);if(L>0)for(p.iushrn(L);L-- >0;)h.isOdd()&&h.iadd(N),h.iushrn(1);for(var s=0,x=1;(y.words[0]&x)===0&&s<26;++s,x<<=1);if(s>0)for(y.iushrn(s);s-- >0;)g.isOdd()&&g.iadd(N),g.iushrn(1);p.cmp(y)>=0?(p.isub(y),h.isub(g)):(y.isub(p),g.isub(h))}var W;return p.cmpn(1)===0?W=h:W=g,W.cmpn(0)<0&&W.iadd(a),W},t.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var p=this.clone(),y=a.clone();p.negative=0,y.negative=0;for(var h=0;p.isEven()&&y.isEven();h++)p.iushrn(1),y.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;y.isEven();)y.iushrn(1);var g=p.cmp(y);if(g<0){var N=p;p=y,y=N}else if(g===0||y.cmpn(1)===0)break;p.isub(y)}while(!0);return y.iushln(h)},t.prototype.invm=function(a){return this.egcd(a).a.umod(a)},t.prototype.isEven=function(){return(this.words[0]&1)===0},t.prototype.isOdd=function(){return(this.words[0]&1)===1},t.prototype.andln=function(a){return this.words[0]&a},t.prototype.bincn=function(a){o(typeof a=="number");var p=a%26,y=(a-p)/26,h=1<<p;if(this.length<=y)return this._expand(y+1),this.words[y]|=h,this;for(var g=h,N=y;g!==0&&N<this.length;N++){var L=this.words[N]|0;L+=g,g=L>>>26,L&=67108863,this.words[N]=L}return g!==0&&(this.words[N]=g,this.length++),this},t.prototype.isZero=function(){return this.length===1&&this.words[0]===0},t.prototype.cmpn=function(a){var p=a<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this.strip();var y;if(this.length>1)y=1;else{p&&(a=-a),o(a<=67108863,"Number is too big");var h=this.words[0]|0;y=h===a?0:h<a?-1:1}return this.negative!==0?-y|0:y},t.prototype.cmp=function(a){if(this.negative!==0&&a.negative===0)return-1;if(this.negative===0&&a.negative!==0)return 1;var p=this.ucmp(a);return this.negative!==0?-p|0:p},t.prototype.ucmp=function(a){if(this.length>a.length)return 1;if(this.length<a.length)return-1;for(var p=0,y=this.length-1;y>=0;y--){var h=this.words[y]|0,g=a.words[y]|0;if(h!==g){h<g?p=-1:h>g&&(p=1);break}}return p},t.prototype.gtn=function(a){return this.cmpn(a)===1},t.prototype.gt=function(a){return this.cmp(a)===1},t.prototype.gten=function(a){return this.cmpn(a)>=0},t.prototype.gte=function(a){return this.cmp(a)>=0},t.prototype.ltn=function(a){return this.cmpn(a)===-1},t.prototype.lt=function(a){return this.cmp(a)===-1},t.prototype.lten=function(a){return this.cmpn(a)<=0},t.prototype.lte=function(a){return this.cmp(a)<=0},t.prototype.eqn=function(a){return this.cmpn(a)===0},t.prototype.eq=function(a){return this.cmp(a)===0},t.red=function(a){return new U(a)},t.prototype.toRed=function(a){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),a.convertTo(this)._forceRed(a)},t.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},t.prototype._forceRed=function(a){return this.red=a,this},t.prototype.forceRed=function(a){return o(!this.red,"Already a number in reduction context"),this._forceRed(a)},t.prototype.redAdd=function(a){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},t.prototype.redIAdd=function(a){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},t.prototype.redSub=function(a){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},t.prototype.redISub=function(a){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},t.prototype.redShl=function(a){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},t.prototype.redMul=function(a){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},t.prototype.redIMul=function(a){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},t.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},t.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},t.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},t.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},t.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},t.prototype.redPow=function(a){return o(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var z={k256:null,p224:null,p192:null,p25519:null};function M(k,a){this.name=k,this.p=new t(a,16),this.n=this.p.bitLength(),this.k=new t(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}M.prototype._tmp=function(){var a=new t(null);return a.words=new Array(Math.ceil(this.n/13)),a},M.prototype.ireduce=function(a){var p=a,y;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),y=p.bitLength();while(y>this.n);var h=y<this.n?-1:p.ucmp(this.p);return h===0?(p.words[0]=0,p.length=1):h>0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},M.prototype.split=function(a,p){a.iushrn(this.n,0,p)},M.prototype.imulK=function(a){return a.imul(this.k)};function R(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}e(R,M),R.prototype.split=function(a,p){for(var y=4194303,h=Math.min(a.length,9),g=0;g<h;g++)p.words[g]=a.words[g];if(p.length=h,a.length<=9){a.words[0]=0,a.length=1;return}var N=a.words[9];for(p.words[p.length++]=N&y,g=10;g<a.length;g++){var L=a.words[g]|0;a.words[g-10]=(L&y)<<4|N>>>22,N=L}N>>>=22,a.words[g-10]=N,N===0&&a.length>10?a.length-=10:a.length-=9},R.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var p=0,y=0;y<a.length;y++){var h=a.words[y]|0;p+=h*977,a.words[y]=p&67108863,p=h*64+(p/67108864|0)}return a.words[a.length-1]===0&&(a.length--,a.words[a.length-1]===0&&a.length--),a};function D(){M.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}e(D,M);function _(){M.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}e(_,M);function q(){M.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}e(q,M),q.prototype.imulK=function(a){for(var p=0,y=0;y<a.length;y++){var h=(a.words[y]|0)*19+p,g=h&67108863;h>>>=26,a.words[y]=g,p=h}return p!==0&&(a.words[a.length++]=p),a},t._prime=function(a){if(z[a])return z[a];var p;if(a==="k256")p=new R;else if(a==="p224")p=new D;else if(a==="p192")p=new _;else if(a==="p25519")p=new q;else throw new Error("Unknown prime "+a);return z[a]=p,p};function U(k){if(typeof k=="string"){var a=t._prime(k);this.m=a.p,this.prime=a}else o(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}U.prototype._verify1=function(a){o(a.negative===0,"red works only with positives"),o(a.red,"red works only with red numbers")},U.prototype._verify2=function(a,p){o((a.negative|p.negative)===0,"red works only with positives"),o(a.red&&a.red===p.red,"red works only with red numbers")},U.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},U.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},U.prototype.add=function(a,p){this._verify2(a,p);var y=a.add(p);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},U.prototype.iadd=function(a,p){this._verify2(a,p);var y=a.iadd(p);return y.cmp(this.m)>=0&&y.isub(this.m),y},U.prototype.sub=function(a,p){this._verify2(a,p);var y=a.sub(p);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},U.prototype.isub=function(a,p){this._verify2(a,p);var y=a.isub(p);return y.cmpn(0)<0&&y.iadd(this.m),y},U.prototype.shl=function(a,p){return this._verify1(a),this.imod(a.ushln(p))},U.prototype.imul=function(a,p){return this._verify2(a,p),this.imod(a.imul(p))},U.prototype.mul=function(a,p){return this._verify2(a,p),this.imod(a.mul(p))},U.prototype.isqr=function(a){return this.imul(a,a.clone())},U.prototype.sqr=function(a){return this.mul(a,a)},U.prototype.sqrt=function(a){if(a.isZero())return a.clone();var p=this.m.andln(3);if(o(p%2===1),p===3){var y=this.m.add(new t(1)).iushrn(2);return this.pow(a,y)}for(var h=this.m.subn(1),g=0;!h.isZero()&&h.andln(1)===0;)g++,h.iushrn(1);o(!h.isZero());var N=new t(1).toRed(this),L=N.redNeg(),S=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new t(2*s*s).toRed(this);this.pow(s,S).cmp(L)!==0;)s.redIAdd(L);for(var x=this.pow(s,h),W=this.pow(a,h.addn(1).iushrn(1)),K=this.pow(a,h),J=g;K.cmp(N)!==0;){for(var G=K,ee=0;G.cmp(N)!==0;ee++)G=G.redSqr();o(ee<J);var te=this.pow(x,new t(1).iushln(J-ee-1));W=W.redMul(te),x=te.redSqr(),K=K.redMul(x),J=ee}return W},U.prototype.invm=function(a){var p=a._invmp(this.m);return p.negative!==0?(p.negative=0,this.imod(p).redNeg()):this.imod(p)},U.prototype.pow=function(a,p){if(p.isZero())return new t(1).toRed(this);if(p.cmpn(1)===0)return a.clone();var y=4,h=new Array(1<<y);h[0]=new t(1).toRed(this),h[1]=a;for(var g=2;g<h.length;g++)h[g]=this.mul(h[g-1],a);var N=h[0],L=0,S=0,s=p.bitLength()%26;for(s===0&&(s=26),g=p.length-1;g>=0;g--){for(var x=p.words[g],W=s-1;W>=0;W--){var K=x>>W&1;if(N!==h[0]&&(N=this.sqr(N)),K===0&&L===0){S=0;continue}L<<=1,L|=K,S++,!(S!==y&&(g!==0||W!==0))&&(N=this.mul(N,h[L]),S=0,L=0)}s=26}return N},U.prototype.convertTo=function(a){var p=a.umod(this.m);return p===a?p.clone():p},U.prototype.convertFrom=function(a){var p=a.clone();return p.red=null,p},t.mont=function(a){return new Q(a)};function Q(k){U.call(this,k),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new t(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}e(Q,U),Q.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},Q.prototype.convertFrom=function(a){var p=this.imod(a.mul(this.rinv));return p.red=null,p},Q.prototype.imul=function(a,p){if(a.isZero()||p.isZero())return a.words[0]=0,a.length=1,a;var y=a.imul(p),h=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=y.isub(h).iushrn(this.shift),N=g;return g.cmp(this.m)>=0?N=g.isub(this.m):g.cmpn(0)<0&&(N=g.iadd(this.m)),N._forceRed(this)},Q.prototype.mul=function(a,p){if(a.isZero()||p.isZero())return new t(0)._forceRed(this);var y=a.mul(p),h=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=y.isub(h).iushrn(this.shift),N=g;return g.cmp(this.m)>=0?N=g.isub(this.m):g.cmpn(0)<0&&(N=g.iadd(this.m)),N._forceRed(this)},Q.prototype.invm=function(a){var p=this.imod(a._invmp(this.m).mul(this.r2));return p._forceRed(this)}})(typeof dl>"u"||dl,mc)});var Nc=$(Ft=>{"use strict";C();F();var Xh=Ft&&Ft.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.stripHexPrefix=Ft.isHexPrefixed=Ft.getLength=Ft.decode=Ft.encode=void 0;var Gh=Xh(pt());function Bc(f){if(Array.isArray(f)){let r=[];for(let e=0;e<f.length;e++)r.push(Bc(f[e]));let o=P.Buffer.concat(r);return P.Buffer.concat([Ic(o.length,192),o])}else{let r=bl(f);return r.length===1&&r[0]<128?r:P.Buffer.concat([Ic(r.length,128),r])}}Ft.encode=Bc;function sl(f,r){if(f[0]==="0"&&f[1]==="0")throw new Error("invalid RLP: extra zeros");return parseInt(f,r)}function Ic(f,r){if(f<56)return P.Buffer.from([f+r]);{let o=pl(f),e=o.length/2,t=pl(r+55+e);return P.Buffer.from(t+o,"hex")}}function Yh(f,r=!1){if(!f||f.length===0)return P.Buffer.from([]);let o=bl(f),e=hl(o);if(r)return e;if(e.remainder.length!==0)throw new Error("invalid remainder");return e.data}Ft.decode=Yh;function Qh(f){if(!f||f.length===0)return P.Buffer.from([]);let r=bl(f),o=r[0];if(o<=127)return r.length;if(o<=183)return o-127;if(o<=191)return o-182;if(o<=247)return o-191;{let e=o-246,t=sl(r.slice(1,e).toString("hex"),16);return e+t}}Ft.getLength=Qh;function hl(f){let r,o,e,t,n,l=[],c=f[0];if(c<=127)return{data:f.slice(0,1),remainder:f.slice(1)};if(c<=183){if(r=c-127,c===128?e=P.Buffer.from([]):e=f.slice(1,r),r===2&&e[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:e,remainder:f.slice(r)}}else if(c<=191){if(o=c-182,f.length-1<o)throw new Error("invalid RLP: not enough bytes for string length");if(r=sl(f.slice(1,o).toString("hex"),16),r<=55)throw new Error("invalid RLP: expected string length to be greater than 55");if(e=f.slice(o,r+o),e.length<r)throw new Error("invalid RLP: not enough bytes for string");return{data:e,remainder:f.slice(r+o)}}else if(c<=247){for(r=c-191,t=f.slice(1,r);t.length;)n=hl(t),l.push(n.data),t=n.remainder;return{data:l,remainder:f.slice(r)}}else{o=c-246,r=sl(f.slice(1,o).toString("hex"),16);let u=o+r;if(u>f.length)throw new Error("invalid rlp: total length is larger than the data");if(t=f.slice(o,u),t.length===0)throw new Error("invalid rlp, List has a invalid length");for(;t.length;)n=hl(t),l.push(n.data),t=n.remainder;return{data:l,remainder:f.slice(u)}}}function yl(f){return f.slice(0,2)==="0x"}Ft.isHexPrefixed=yl;function xc(f){return yl(f)?f.slice(2):f}Ft.stripHexPrefix=xc;function pl(f){if(f<0)throw new Error("Invalid integer as argument, must be unsigned!");let r=f.toString(16);return r.length%2?`0${r}`:r}function jh(f){return f.length%2?`0${f}`:f}function ep(f){let r=pl(f);return P.Buffer.from(r,"hex")}function bl(f){if(!P.Buffer.isBuffer(f)){if(typeof f=="string")return yl(f)?P.Buffer.from(jh(xc(f)),"hex"):P.Buffer.from(f);if(typeof f=="number"||typeof f=="bigint")return f?ep(f):P.Buffer.from([]);if(f==null)return P.Buffer.from([]);if(f instanceof Uint8Array)return P.Buffer.from(f);if(Gh.default.isBN(f))return P.Buffer.from(f.toArray());throw new Error("invalid type")}return f}});var kc=$(kr=>{"use strict";C();F();Object.defineProperty(kr,"__esModule",{value:!0});kr.validateHexString=kr.isHexString=void 0;function tp(f,r){return f.match(/^0x[0-9A-Fa-f]*$/)?!(r&&f.length!==2+2*r):!1}kr.isHexString=tp;function np(f){if(!f)return!1;let r=f.toLowerCase().startsWith("0x")?f.substring(2).toLowerCase():f.toLowerCase();return!(r.length===0||r.length%2!==0||!r.match(/^[0-9A-Fa-f]*$/))}kr.validateHexString=np});var Tc=$(zo=>{"use strict";C();F();Object.defineProperty(zo,"__esModule",{value:!0});zo.encode=void 0;function rp(f){var r="0123456789abcdef";function o(D){var _,q="";for(_=0;_<=3;_++)q+=r.charAt(D>>_*8+4&15)+r.charAt(D>>_*8&15);return q}function e(D,_){var q=(D&65535)+(_&65535),U=(D>>16)+(_>>16)+(q>>16);return U<<16|q&65535}function t(D,_){return D<<_|D>>>32-_}function n(D,_,q,U,Q,k){return e(t(e(e(_,D),e(U,k)),Q),q)}function l(D,_,q,U,Q,k,a){return n(_&q|~_&U,D,_,Q,k,a)}function c(D,_,q,U,Q,k,a){return n(_&U|q&~U,D,_,Q,k,a)}function u(D,_,q,U,Q,k,a){return n(_^q^U,D,_,Q,k,a)}function b(D,_,q,U,Q,k,a){return n(q^(_|~U),D,_,Q,k,a)}function A(D){var _,q=(D.length+8>>6)+1,U=new Array(q*16);for(_=0;_<q*16;_++)U[_]=0;for(_=0;_<D.length;_++)U[_>>2]|=D.charCodeAt(_)<<_%4*8;return U[_>>2]|=128<<_%4*8,U[q*16-2]=D.length*8,U}var w,B=A(""+f),m=1732584193,I=-271733879,O=-1732584194,T=271733878,E,z,M,R;for(w=0;w<B.length;w+=16)E=m,z=I,M=O,R=T,m=l(m,I,O,T,B[w+0],7,-680876936),T=l(T,m,I,O,B[w+1],12,-389564586),O=l(O,T,m,I,B[w+2],17,606105819),I=l(I,O,T,m,B[w+3],22,-1044525330),m=l(m,I,O,T,B[w+4],7,-176418897),T=l(T,m,I,O,B[w+5],12,1200080426),O=l(O,T,m,I,B[w+6],17,-1473231341),I=l(I,O,T,m,B[w+7],22,-45705983),m=l(m,I,O,T,B[w+8],7,1770035416),T=l(T,m,I,O,B[w+9],12,-1958414417),O=l(O,T,m,I,B[w+10],17,-42063),I=l(I,O,T,m,B[w+11],22,-1990404162),m=l(m,I,O,T,B[w+12],7,1804603682),T=l(T,m,I,O,B[w+13],12,-40341101),O=l(O,T,m,I,B[w+14],17,-1502002290),I=l(I,O,T,m,B[w+15],22,1236535329),m=c(m,I,O,T,B[w+1],5,-165796510),T=c(T,m,I,O,B[w+6],9,-1069501632),O=c(O,T,m,I,B[w+11],14,643717713),I=c(I,O,T,m,B[w+0],20,-373897302),m=c(m,I,O,T,B[w+5],5,-701558691),T=c(T,m,I,O,B[w+10],9,38016083),O=c(O,T,m,I,B[w+15],14,-660478335),I=c(I,O,T,m,B[w+4],20,-405537848),m=c(m,I,O,T,B[w+9],5,568446438),T=c(T,m,I,O,B[w+14],9,-1019803690),O=c(O,T,m,I,B[w+3],14,-187363961),I=c(I,O,T,m,B[w+8],20,1163531501),m=c(m,I,O,T,B[w+13],5,-1444681467),T=c(T,m,I,O,B[w+2],9,-51403784),O=c(O,T,m,I,B[w+7],14,1735328473),I=c(I,O,T,m,B[w+12],20,-1926607734),m=u(m,I,O,T,B[w+5],4,-378558),T=u(T,m,I,O,B[w+8],11,-2022574463),O=u(O,T,m,I,B[w+11],16,1839030562),I=u(I,O,T,m,B[w+14],23,-35309556),m=u(m,I,O,T,B[w+1],4,-1530992060),T=u(T,m,I,O,B[w+4],11,1272893353),O=u(O,T,m,I,B[w+7],16,-155497632),I=u(I,O,T,m,B[w+10],23,-1094730640),m=u(m,I,O,T,B[w+13],4,681279174),T=u(T,m,I,O,B[w+0],11,-358537222),O=u(O,T,m,I,B[w+3],16,-722521979),I=u(I,O,T,m,B[w+6],23,76029189),m=u(m,I,O,T,B[w+9],4,-640364487),T=u(T,m,I,O,B[w+12],11,-421815835),O=u(O,T,m,I,B[w+15],16,530742520),I=u(I,O,T,m,B[w+2],23,-995338651),m=b(m,I,O,T,B[w+0],6,-198630844),T=b(T,m,I,O,B[w+7],10,1126891415),O=b(O,T,m,I,B[w+14],15,-1416354905),I=b(I,O,T,m,B[w+5],21,-57434055),m=b(m,I,O,T,B[w+12],6,1700485571),T=b(T,m,I,O,B[w+3],10,-1894986606),O=b(O,T,m,I,B[w+10],15,-1051523),I=b(I,O,T,m,B[w+1],21,-2054922799),m=b(m,I,O,T,B[w+8],6,1873313359),T=b(T,m,I,O,B[w+15],10,-30611744),O=b(O,T,m,I,B[w+6],15,-1560198380),I=b(I,O,T,m,B[w+13],21,1309151649),m=b(m,I,O,T,B[w+4],6,-145523070),T=b(T,m,I,O,B[w+11],10,-1120210379),O=b(O,T,m,I,B[w+2],15,718787259),I=b(I,O,T,m,B[w+9],21,-343485551),m=e(m,E),I=e(I,z),O=e(O,M),T=e(T,R);return o(m)+o(I)+o(O)+o(T)}zo.encode=rp});var gl=$(be=>{"use strict";C();F();var op=be&&be.__createBinding||(Object.create?function(f,r,o,e){e===void 0&&(e=o),Object.defineProperty(f,e,{enumerable:!0,get:function(){return r[o]}})}:function(f,r,o,e){e===void 0&&(e=o),f[e]=r[o]}),ip=be&&be.__setModuleDefault||(Object.create?function(f,r){Object.defineProperty(f,"default",{enumerable:!0,value:r})}:function(f,r){f.default=r}),Pc=be&&be.__importStar||function(f){if(f&&f.__esModule)return f;var r={};if(f!=null)for(var o in f)o!=="default"&&Object.prototype.hasOwnProperty.call(f,o)&&op(r,f,o);return ip(r,f),r};Object.defineProperty(be,"__esModule",{value:!0});be.blake2s=be.compress=be.IV=void 0;var lp=Pc(wr()),Lc=Pc(Eo()),un=St();be.IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);function Mn(f,r,o,e,t){return f=f+r+t|0,e=(0,un.rotr)(e^f,16),o=o+e|0,r=(0,un.rotr)(r^o,12),{a:f,b:r,c:o,d:e}}function _n(f,r,o,e,t){return f=f+r+t|0,e=(0,un.rotr)(e^f,8),o=o+e|0,r=(0,un.rotr)(r^o,7),{a:f,b:r,c:o,d:e}}function Ec(f,r,o,e,t,n,l,c,u,b,A,w,B,m,I,O,T,E,z,M){let R=0;for(let D=0;D<e;D++)({a:t,b:u,c:B,d:T}=Mn(t,u,B,T,o[r+f[R++]])),{a:t,b:u,c:B,d:T}=_n(t,u,B,T,o[r+f[R++]]),{a:n,b,c:m,d:E}=Mn(n,b,m,E,o[r+f[R++]]),{a:n,b,c:m,d:E}=_n(n,b,m,E,o[r+f[R++]]),{a:l,b:A,c:I,d:z}=Mn(l,A,I,z,o[r+f[R++]]),{a:l,b:A,c:I,d:z}=_n(l,A,I,z,o[r+f[R++]]),{a:c,b:w,c:O,d:M}=Mn(c,w,O,M,o[r+f[R++]]),{a:c,b:w,c:O,d:M}=_n(c,w,O,M,o[r+f[R++]]),{a:t,b,c:I,d:M}=Mn(t,b,I,M,o[r+f[R++]]),{a:t,b,c:I,d:M}=_n(t,b,I,M,o[r+f[R++]]),{a:n,b:A,c:O,d:T}=Mn(n,A,O,T,o[r+f[R++]]),{a:n,b:A,c:O,d:T}=_n(n,A,O,T,o[r+f[R++]]),{a:l,b:w,c:B,d:E}=Mn(l,w,B,E,o[r+f[R++]]),{a:l,b:w,c:B,d:E}=_n(l,w,B,E,o[r+f[R++]]),{a:c,b:u,c:m,d:z}=Mn(c,u,m,z,o[r+f[R++]]),{a:c,b:u,c:m,d:z}=_n(c,u,m,z,o[r+f[R++]]);return{v0:t,v1:n,v2:l,v3:c,v4:u,v5:b,v6:A,v7:w,v8:B,v9:m,v10:I,v11:O,v12:T,v13:E,v14:z,v15:M}}be.compress=Ec;var wl=class extends Lc.BLAKE2{constructor(r={}){super(64,r.dkLen===void 0?32:r.dkLen,r,32,8,8),this.v0=be.IV[0]|0,this.v1=be.IV[1]|0,this.v2=be.IV[2]|0,this.v3=be.IV[3]|0,this.v4=be.IV[4]|0,this.v5=be.IV[5]|0,this.v6=be.IV[6]|0,this.v7=be.IV[7]|0;let o=r.key?r.key.length:0;if(this.v0^=this.outputLen|o<<8|1<<16|1<<24,r.salt){let e=(0,un.u32)((0,un.toBytes)(r.salt));this.v4^=e[0],this.v5^=e[1]}if(r.personalization){let e=(0,un.u32)((0,un.toBytes)(r.personalization));this.v6^=e[0],this.v7^=e[1]}if(r.key){let e=new Uint8Array(this.blockLen);e.set((0,un.toBytes)(r.key)),this.update(e)}}get(){let{v0:r,v1:o,v2:e,v3:t,v4:n,v5:l,v6:c,v7:u}=this;return[r,o,e,t,n,l,c,u]}set(r,o,e,t,n,l,c,u){this.v0=r|0,this.v1=o|0,this.v2=e|0,this.v3=t|0,this.v4=n|0,this.v5=l|0,this.v6=c|0,this.v7=u|0}compress(r,o,e){let{h:t,l:n}=lp.fromBig(BigInt(this.length)),{v0:l,v1:c,v2:u,v3:b,v4:A,v5:w,v6:B,v7:m,v8:I,v9:O,v10:T,v11:E,v12:z,v13:M,v14:R,v15:D}=Ec(Lc.SIGMA,o,r,10,this.v0,this.v1,this.v2,this.v3,this.v4,this.v5,this.v6,this.v7,be.IV[0],be.IV[1],be.IV[2],be.IV[3],n^be.IV[4],t^be.IV[5],e?~be.IV[6]:be.IV[6],be.IV[7]);this.v0^=l^I,this.v1^=c^O,this.v2^=u^T,this.v3^=b^E,this.v4^=A^z,this.v5^=w^M,this.v6^=B^R,this.v7^=m^D}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0)}};be.blake2s=(0,un.wrapConstructorWithOpts)(f=>new wl(f))});var Do=$(Tr=>{"use strict";C();F();Object.defineProperty(Tr,"__esModule",{value:!0});Tr.pbkdf2Async=Tr.pbkdf2=void 0;var fp=to(),dn=St();function Cc(f,r,o,e){(0,dn.assertHash)(f);let t=(0,dn.checkOpts)({dkLen:32,asyncTick:10},e),{c:n,dkLen:l,asyncTick:c}=t;if((0,dn.assertNumber)(n),(0,dn.assertNumber)(l),(0,dn.assertNumber)(c),n<1)throw new Error("PBKDF2: iterations (c) should be >= 1");let u=(0,dn.toBytes)(r),b=(0,dn.toBytes)(o),A=new Uint8Array(l),w=fp.hmac.create(f,u),B=w._cloneInto().update(b);return{c:n,dkLen:l,asyncTick:c,DK:A,PRF:w,PRFSalt:B}}function Fc(f,r,o,e,t){return f.destroy(),r.destroy(),e&&e.destroy(),t.fill(0),o}function cp(f,r,o,e){let{c:t,dkLen:n,DK:l,PRF:c,PRFSalt:u}=Cc(f,r,o,e),b,A=new Uint8Array(4),w=(0,dn.createView)(A),B=new Uint8Array(c.outputLen);for(let m=1,I=0;I<n;m++,I+=c.outputLen){let O=l.subarray(I,I+c.outputLen);w.setInt32(0,m,!1),(b=u._cloneInto(b)).update(A).digestInto(B),O.set(B.subarray(0,O.length));for(let T=1;T<t;T++){c._cloneInto(b).update(B).digestInto(B);for(let E=0;E<O.length;E++)O[E]^=B[E]}}return Fc(c,u,l,b,B)}Tr.pbkdf2=cp;async function ap(f,r,o,e){let{c:t,dkLen:n,asyncTick:l,DK:c,PRF:u,PRFSalt:b}=Cc(f,r,o,e),A,w=new Uint8Array(4),B=(0,dn.createView)(w),m=new Uint8Array(u.outputLen);for(let I=1,O=0;O<n;I++,O+=u.outputLen){let T=c.subarray(O,O+u.outputLen);B.setInt32(0,I,!1),(A=b._cloneInto(A)).update(w).digestInto(m),T.set(m.subarray(0,T.length)),await(0,dn.asyncLoop)(t-1,l,E=>{u._cloneInto(A).update(m).digestInto(m);for(let z=0;z<T.length;z++)T[z]^=m[z]})}return Fc(u,b,c,A,m)}Tr.pbkdf2Async=ap});var Rc=$(Pr=>{"use strict";C();F();Object.defineProperty(Pr,"__esModule",{value:!0});Pr.scryptAsync=Pr.scrypt=void 0;var _c=br(),zc=Do(),Dt=St(),pe=(f,r)=>f<<r|f>>>32-r;function Mc(f,r,o,e,t,n){let l=f[r++]^o[e++],c=f[r++]^o[e++],u=f[r++]^o[e++],b=f[r++]^o[e++],A=f[r++]^o[e++],w=f[r++]^o[e++],B=f[r++]^o[e++],m=f[r++]^o[e++],I=f[r++]^o[e++],O=f[r++]^o[e++],T=f[r++]^o[e++],E=f[r++]^o[e++],z=f[r++]^o[e++],M=f[r++]^o[e++],R=f[r++]^o[e++],D=f[r++]^o[e++],_=l,q=c,U=u,Q=b,k=A,a=w,p=B,y=m,h=I,g=O,N=T,L=E,S=z,s=M,x=R,W=D;for(let K=0;K<8;K+=2)k^=pe(_+S|0,7),h^=pe(k+_|0,9),S^=pe(h+k|0,13),_^=pe(S+h|0,18),g^=pe(a+q|0,7),s^=pe(g+a|0,9),q^=pe(s+g|0,13),a^=pe(q+s|0,18),x^=pe(N+p|0,7),U^=pe(x+N|0,9),p^=pe(U+x|0,13),N^=pe(p+U|0,18),Q^=pe(W+L|0,7),y^=pe(Q+W|0,9),L^=pe(y+Q|0,13),W^=pe(L+y|0,18),q^=pe(_+Q|0,7),U^=pe(q+_|0,9),Q^=pe(U+q|0,13),_^=pe(Q+U|0,18),p^=pe(a+k|0,7),y^=pe(p+a|0,9),k^=pe(y+p|0,13),a^=pe(k+y|0,18),L^=pe(N+g|0,7),h^=pe(L+N|0,9),g^=pe(h+L|0,13),N^=pe(g+h|0,18),S^=pe(W+x|0,7),s^=pe(S+W|0,9),x^=pe(s+S|0,13),W^=pe(x+s|0,18);t[n++]=l+_|0,t[n++]=c+q|0,t[n++]=u+U|0,t[n++]=b+Q|0,t[n++]=A+k|0,t[n++]=w+a|0,t[n++]=B+p|0,t[n++]=m+y|0,t[n++]=I+h|0,t[n++]=O+g|0,t[n++]=T+N|0,t[n++]=E+L|0,t[n++]=z+S|0,t[n++]=M+s|0,t[n++]=R+x|0,t[n++]=D+W|0}function Lr(f,r,o,e,t){let n=e+0,l=e+16*t;for(let c=0;c<16;c++)o[l+c]=f[r+(2*t-1)*16+c];for(let c=0;c<t;c++,n+=16,r+=16)Mc(o,l,f,r,o,n),c>0&&(l+=16),Mc(o,n,f,r+=16,o,l)}function Dc(f,r,o){let e=(0,Dt.checkOpts)({dkLen:32,asyncTick:10,maxmem:1073742848},o),{N:t,r:n,p:l,dkLen:c,asyncTick:u,maxmem:b,onProgress:A}=e;if((0,Dt.assertNumber)(t),(0,Dt.assertNumber)(n),(0,Dt.assertNumber)(l),(0,Dt.assertNumber)(c),(0,Dt.assertNumber)(u),(0,Dt.assertNumber)(b),A!==void 0&&typeof A!="function")throw new Error("progressCb should be function");let w=128*n,B=w/4;if(t<=1||(t&t-1)!==0||t>=2**(w/8)||t>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(l<0||l>(2**32-1)*32/w)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(c<0||c>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");let m=w*(t+l);if(m>b)throw new Error(`Scrypt: parameters too large, ${m} (128 * r * (N + p)) > ${b} (maxmem)`);let I=(0,zc.pbkdf2)(_c.sha256,f,r,{c:1,dkLen:w*l}),O=(0,Dt.u32)(I),T=(0,Dt.u32)(new Uint8Array(w*t)),E=(0,Dt.u32)(new Uint8Array(w)),z=()=>{};if(A){let M=2*t*l,R=Math.max(Math.floor(M/1e4),1),D=0;z=()=>{D++,A&&(!(D%R)||D===M)&&A(D/M)}}return{N:t,r:n,p:l,dkLen:c,blockSize32:B,V:T,B32:O,B:I,tmp:E,blockMixCb:z,asyncTick:u}}function Uc(f,r,o,e,t){let n=(0,zc.pbkdf2)(_c.sha256,f,o,{c:1,dkLen:r});return o.fill(0),e.fill(0),t.fill(0),n}function up(f,r,o){let{N:e,r:t,p:n,dkLen:l,blockSize32:c,V:u,B32:b,B:A,tmp:w,blockMixCb:B}=Dc(f,r,o);for(let m=0;m<n;m++){let I=c*m;for(let O=0;O<c;O++)u[O]=b[I+O];for(let O=0,T=0;O<e-1;O++)Lr(u,T,u,T+=c,t),B();Lr(u,(e-1)*c,b,I,t),B();for(let O=0;O<e;O++){let T=b[I+c-16]%e;for(let E=0;E<c;E++)w[E]=b[I+E]^u[T*c+E];Lr(w,0,b,I,t),B()}}return Uc(f,l,A,u,w)}Pr.scrypt=up;async function dp(f,r,o){let{N:e,r:t,p:n,dkLen:l,blockSize32:c,V:u,B32:b,B:A,tmp:w,blockMixCb:B,asyncTick:m}=Dc(f,r,o);for(let I=0;I<n;I++){let O=c*I;for(let E=0;E<c;E++)u[E]=b[O+E];let T=0;await(0,Dt.asyncLoop)(e-1,m,E=>{Lr(u,T,u,T+=c,t),B()}),Lr(u,(e-1)*c,b,O,t),B(),await(0,Dt.asyncLoop)(e,m,E=>{let z=b[O+c-16]%e;for(let M=0;M<c;M++)w[M]=b[O+M]^u[z*c+M];Lr(w,0,b,O,t),B()})}return Uc(f,l,A,u,w)}Pr.scryptAsync=dp});var Hc=$(sn=>{"use strict";C();F();var sp=sn&&sn.__createBinding||(Object.create?function(f,r,o,e){e===void 0&&(e=o),Object.defineProperty(f,e,{enumerable:!0,get:function(){return r[o]}})}:function(f,r,o,e){e===void 0&&(e=o),f[e]=r[o]}),hp=sn&&sn.__setModuleDefault||(Object.create?function(f,r){Object.defineProperty(f,"default",{enumerable:!0,value:r})}:function(f,r){f.default=r}),vl=sn&&sn.__importStar||function(f){if(f&&f.__esModule)return f;var r={};if(f!=null)for(var o in f)o!=="default"&&Object.prototype.hasOwnProperty.call(f,o)&&sp(r,f,o);return hp(r,f),r};Object.defineProperty(sn,"__esModule",{value:!0});sn.blake3=void 0;var Vc=vl(wr()),pp=vl(Eo()),Yt=vl(gl()),er=St(),Ut;(function(f){f[f.CHUNK_START=1]="CHUNK_START",f[f.CHUNK_END=2]="CHUNK_END",f[f.PARENT=4]="PARENT",f[f.ROOT=8]="ROOT",f[f.KEYED_HASH=16]="KEYED_HASH",f[f.DERIVE_KEY_CONTEXT=32]="DERIVE_KEY_CONTEXT",f[f.DERIVE_KEY_MATERIAL=64]="DERIVE_KEY_MATERIAL"})(Ut||(Ut={}));var qc=(()=>{let f=Array.from({length:16},(e,t)=>t),r=e=>[2,6,3,10,7,0,4,13,1,11,12,5,9,14,15,8].map(t=>e[t]),o=[];for(let e=0,t=f;e<7;e++,t=r(t))o.push(...t);return Uint8Array.from(o)})(),no=class extends pp.BLAKE2{constructor(r={},o=0){if(super(64,r.dkLen===void 0?32:r.dkLen,{},Number.MAX_SAFE_INTEGER,0,0),this.flags=0,this.chunkPos=0,this.chunksDone=0,this.stack=[],this.posOut=0,this.bufferOut32=new Uint32Array(16),this.chunkOut=0,this.enableXOF=!0,this.outputLen=r.dkLen===void 0?32:r.dkLen,(0,er.assertNumber)(this.outputLen),r.key!==void 0&&r.context!==void 0)throw new Error("Blake3: only key or context can be specified at same time");if(r.key!==void 0){let e=(0,er.toBytes)(r.key);if(e.length!==32)throw new Error("Blake3: key should be 32 byte");this.IV=(0,er.u32)(e),this.flags=o|Ut.KEYED_HASH}else if(r.context!==void 0){let e=new no({dkLen:32},Ut.DERIVE_KEY_CONTEXT).update(r.context).digest();this.IV=(0,er.u32)(e),this.flags=o|Ut.DERIVE_KEY_MATERIAL}else this.IV=Yt.IV.slice(),this.flags=o;this.state=this.IV.slice(),this.bufferOut=(0,er.u8)(this.bufferOut32)}get(){return[]}set(){}b2Compress(r,o,e,t=0){let{state:n,pos:l}=this,{h:c,l:u}=Vc.fromBig(BigInt(r),!0),{v0:b,v1:A,v2:w,v3:B,v4:m,v5:I,v6:O,v7:T,v8:E,v9:z,v10:M,v11:R,v12:D,v13:_,v14:q,v15:U}=Yt.compress(qc,t,e,7,n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],Yt.IV[0],Yt.IV[1],Yt.IV[2],Yt.IV[3],c,u,l,o);n[0]=b^E,n[1]=A^z,n[2]=w^M,n[3]=B^R,n[4]=m^D,n[5]=I^_,n[6]=O^q,n[7]=T^U}compress(r,o=0,e=!1){let t=this.flags;if(this.chunkPos||(t|=Ut.CHUNK_START),(this.chunkPos===15||e)&&(t|=Ut.CHUNK_END),e||(this.pos=this.blockLen),this.b2Compress(this.chunksDone,t,r,o),this.chunkPos+=1,this.chunkPos===16||e){let n=this.state;this.state=this.IV.slice();for(let l,c=this.chunksDone+1;(e||!(c&1))&&(l=this.stack.pop());c>>=1)this.buffer32.set(l,0),this.buffer32.set(n,8),this.pos=this.blockLen,this.b2Compress(0,this.flags|Ut.PARENT,this.buffer32,0),n=this.state,this.state=this.IV.slice();this.chunksDone++,this.chunkPos=0,this.stack.push(n)}this.pos=0}_cloneInto(r){r=super._cloneInto(r);let{IV:o,flags:e,state:t,chunkPos:n,posOut:l,chunkOut:c,stack:u,chunksDone:b}=this;return r.state.set(t.slice()),r.stack=u.map(A=>Uint32Array.from(A)),r.IV.set(o),r.flags=e,r.chunkPos=n,r.chunksDone=b,r.posOut=l,r.chunkOut=c,r.enableXOF=this.enableXOF,r.bufferOut32.set(this.bufferOut32),r}destroy(){this.destroyed=!0,this.state.fill(0),this.buffer32.fill(0),this.IV.fill(0),this.bufferOut32.fill(0);for(let r of this.stack)r.fill(0)}b2CompressOut(){let{state:r,pos:o,flags:e,buffer32:t,bufferOut32:n}=this,{h:l,l:c}=Vc.fromBig(BigInt(this.chunkOut++)),{v0:u,v1:b,v2:A,v3:w,v4:B,v5:m,v6:I,v7:O,v8:T,v9:E,v10:z,v11:M,v12:R,v13:D,v14:_,v15:q}=Yt.compress(qc,0,t,7,r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],Yt.IV[0],Yt.IV[1],Yt.IV[2],Yt.IV[3],c,l,o,e);n[0]=u^T,n[1]=b^E,n[2]=A^z,n[3]=w^M,n[4]=B^R,n[5]=m^D,n[6]=I^_,n[7]=O^q,n[8]=r[0]^T,n[9]=r[1]^E,n[10]=r[2]^z,n[11]=r[3]^M,n[12]=r[4]^R,n[13]=r[5]^D,n[14]=r[6]^_,n[15]=r[7]^q,this.posOut=0}finish(){if(this.finished)return;this.finished=!0,this.buffer.fill(0,this.pos);let r=this.flags|Ut.ROOT;this.stack.length?(r|=Ut.PARENT,this.compress(this.buffer32,0,!0),this.chunksDone=0,this.pos=this.blockLen):r|=(this.chunkPos?0:Ut.CHUNK_START)|Ut.CHUNK_END,this.flags=r,this.b2CompressOut()}writeInto(r){if(this.destroyed)throw new Error("instance is destroyed");if(!(r instanceof Uint8Array))throw new Error("Blake3: Invalid output buffer");this.finish();let{blockLen:o,bufferOut:e}=this;for(let t=0,n=r.length;t<n;){this.posOut>=o&&this.b2CompressOut();let l=Math.min(this.blockLen-this.posOut,n-t);r.set(e.subarray(this.posOut,this.posOut+l),t),this.posOut+=l,t+=l}return r}xofInto(r){if(!this.enableXOF)throw new Error("XOF impossible after digest call");return this.writeInto(r)}xof(r){return(0,er.assertNumber)(r),this.xofInto(new Uint8Array(r))}digestInto(r){if(r.length<this.outputLen)throw new Error("Blake3: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");return this.enableXOF=!1,this.writeInto(r),this.destroy(),r}digest(){return this.digestInto(new Uint8Array(this.outputLen))}};sn.blake3=(0,er.wrapConstructorWithOpts)(f=>new no(f))});var tr=$(ie=>{"use strict";C();F();var Wc=ie&&ie.__createBinding||(Object.create?function(f,r,o,e){e===void 0&&(e=o);var t=Object.getOwnPropertyDescriptor(r,o);(!t||("get"in t?!r.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(f,e,t)}:function(f,r,o,e){e===void 0&&(e=o),f[e]=r[o]}),yp=ie&&ie.__setModuleDefault||(Object.create?function(f,r){Object.defineProperty(f,"default",{enumerable:!0,value:r})}:function(f,r){f.default=r}),Te=ie&&ie.__exportStar||function(f,r){for(var o in f)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&Wc(r,f,o)},Al=ie&&ie.__importStar||function(f){if(f&&f.__esModule)return f;var r={};if(f!=null)for(var o in f)o!=="default"&&Object.prototype.hasOwnProperty.call(f,o)&&Wc(r,f,o);return yp(r,f),r};Object.defineProperty(ie,"__esModule",{value:!0});ie.randomBytes=ie.concatBytes=ie.reverseBuffer=ie.md5=ie.rlp=void 0;Te(Kf(),ie);Te(sc(),ie);Te(hc(),ie);Te(pc(),ie);Te(bc(),ie);Te(jr(),ie);Te(vc(),ie);Te(Ac(),ie);Te(Sc(),ie);Te(al(),ie);ie.rlp=Al(Nc());Te(kc(),ie);ie.md5=Al(Tc());Te(Gn(),ie);Te(br(),ie);Te(to(),ie);Te(ol(),ie);Te(No(),ie);Te(Po(),ie);Te(fl(),ie);Te(gl(),ie);Te(Do(),ie);Te(Rc(),ie);Te(Hc(),ie);var bp=Al(St()),wp=zd();function gp(f){if(f.length<1)return f;let r=f.length-1,o=0;for(let e=0;e<f.length/2;e++)o=f[e],f[e]=f[r],f[r]=o,r--;return f}ie.reverseBuffer=gp;function vp(f,r){return bp.concatBytes(Uint8Array.from(f),Uint8Array.from(r))}ie.concatBytes=vp;function Ap(f){return wp(f)}ie.randomBytes=Ap});var zt=$(Kc=>{"use strict";C();F();var Qt=Kc,Op=pt(),Sp=Ud(),Uo=Vd();Qt.assert=Sp;Qt.toArray=Uo.toArray;Qt.zero2=Uo.zero2;Qt.toHex=Uo.toHex;Qt.encode=Uo.encode;function mp(f,r,o){var e=new Array(Math.max(f.bitLength(),o)+1);e.fill(0);for(var t=1<<r+1,n=f.clone(),l=0;l<e.length;l++){var c,u=n.andln(t-1);n.isOdd()?(u>(t>>1)-1?c=(t>>1)-u:c=u,n.isubn(c)):c=0,e[l]=c,n.iushrn(1)}return e}Qt.getNAF=mp;function Ip(f,r){var o=[[],[]];f=f.clone(),r=r.clone();for(var e=0,t=0,n;f.cmpn(-e)>0||r.cmpn(-t)>0;){var l=f.andln(3)+e&3,c=r.andln(3)+t&3;l===3&&(l=-1),c===3&&(c=-1);var u;(l&1)===0?u=0:(n=f.andln(7)+e&7,(n===3||n===5)&&c===2?u=-l:u=l),o[0].push(u);var b;(c&1)===0?b=0:(n=r.andln(7)+t&7,(n===3||n===5)&&l===2?b=-c:b=c),o[1].push(b),2*e===u+1&&(e=1-e),2*t===b+1&&(t=1-t),f.iushrn(1),r.iushrn(1)}return o}Qt.getJSF=Ip;function Bp(f,r,o){var e="_"+r;f.prototype[r]=function(){return this[e]!==void 0?this[e]:this[e]=o.call(this)}}Qt.cachedProperty=Bp;function xp(f){return typeof f=="string"?Qt.toArray(f,"hex"):f}Qt.parseBytes=xp;function Np(f){return new Op(f,"hex","le")}Qt.intFromLE=Np});var oo=$((e1,Jc)=>{"use strict";C();F();var ro=zt(),nr=pt(),Ro=ro.getNAF,kp=ro.getJSF,Vo=ro.assert;function zn(f,r){this.type=f,this.p=new nr(r.p,16),this.red=r.prime?nr.red(r.prime):nr.mont(this.p),this.zero=new nr(0).toRed(this.red),this.one=new nr(1).toRed(this.red),this.two=new nr(2).toRed(this.red),this.n=r.n&&new nr(r.n,16),this.g=r.g&&this.pointFromJSON(r.g,r.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var o=this.n&&this.p.div(this.n);!o||o.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}Jc.exports=zn;zn.prototype.point=function(){throw new Error("Not implemented")};zn.prototype.validate=function(){throw new Error("Not implemented")};zn.prototype._fixedNafMul=function(r,o){Vo(r.precomputed);var e=r._getDoubles(),t=Ro(o,1,this._bitLength),n=(1<<e.step+1)-(e.step%2===0?2:1);n/=3;var l=[],c,u;for(c=0;c<t.length;c+=e.step){u=0;for(var b=c+e.step-1;b>=c;b--)u=(u<<1)+t[b];l.push(u)}for(var A=this.jpoint(null,null,null),w=this.jpoint(null,null,null),B=n;B>0;B--){for(c=0;c<l.length;c++)u=l[c],u===B?w=w.mixedAdd(e.points[c]):u===-B&&(w=w.mixedAdd(e.points[c].neg()));A=A.add(w)}return A.toP()};zn.prototype._wnafMul=function(r,o){var e=4,t=r._getNAFPoints(e);e=t.wnd;for(var n=t.points,l=Ro(o,e,this._bitLength),c=this.jpoint(null,null,null),u=l.length-1;u>=0;u--){for(var b=0;u>=0&&l[u]===0;u--)b++;if(u>=0&&b++,c=c.dblp(b),u<0)break;var A=l[u];Vo(A!==0),r.type==="affine"?A>0?c=c.mixedAdd(n[A-1>>1]):c=c.mixedAdd(n[-A-1>>1].neg()):A>0?c=c.add(n[A-1>>1]):c=c.add(n[-A-1>>1].neg())}return r.type==="affine"?c.toP():c};zn.prototype._wnafMulAdd=function(r,o,e,t,n){var l=this._wnafT1,c=this._wnafT2,u=this._wnafT3,b=0,A,w,B;for(A=0;A<t;A++){B=o[A];var m=B._getNAFPoints(r);l[A]=m.wnd,c[A]=m.points}for(A=t-1;A>=1;A-=2){var I=A-1,O=A;if(l[I]!==1||l[O]!==1){u[I]=Ro(e[I],l[I],this._bitLength),u[O]=Ro(e[O],l[O],this._bitLength),b=Math.max(u[I].length,b),b=Math.max(u[O].length,b);continue}var T=[o[I],null,null,o[O]];o[I].y.cmp(o[O].y)===0?(T[1]=o[I].add(o[O]),T[2]=o[I].toJ().mixedAdd(o[O].neg())):o[I].y.cmp(o[O].y.redNeg())===0?(T[1]=o[I].toJ().mixedAdd(o[O]),T[2]=o[I].add(o[O].neg())):(T[1]=o[I].toJ().mixedAdd(o[O]),T[2]=o[I].toJ().mixedAdd(o[O].neg()));var E=[-3,-1,-5,-7,0,7,5,1,3],z=kp(e[I],e[O]);for(b=Math.max(z[0].length,b),u[I]=new Array(b),u[O]=new Array(b),w=0;w<b;w++){var M=z[0][w]|0,R=z[1][w]|0;u[I][w]=E[(M+1)*3+(R+1)],u[O][w]=0,c[I]=T}}var D=this.jpoint(null,null,null),_=this._wnafT4;for(A=b;A>=0;A--){for(var q=0;A>=0;){var U=!0;for(w=0;w<t;w++)_[w]=u[w][A]|0,_[w]!==0&&(U=!1);if(!U)break;q++,A--}if(A>=0&&q++,D=D.dblp(q),A<0)break;for(w=0;w<t;w++){var Q=_[w];Q!==0&&(Q>0?B=c[w][Q-1>>1]:Q<0&&(B=c[w][-Q-1>>1].neg()),B.type==="affine"?D=D.mixedAdd(B):D=D.add(B))}}for(A=0;A<t;A++)c[A]=null;return n?D:D.toP()};function Rt(f,r){this.curve=f,this.type=r,this.precomputed=null}zn.BasePoint=Rt;Rt.prototype.eq=function(){throw new Error("Not implemented")};Rt.prototype.validate=function(){return this.curve.validate(this)};zn.prototype.decodePoint=function(r,o){r=ro.toArray(r,o);var e=this.p.byteLength();if((r[0]===4||r[0]===6||r[0]===7)&&r.length-1===2*e){r[0]===6?Vo(r[r.length-1]%2===0):r[0]===7&&Vo(r[r.length-1]%2===1);var t=this.point(r.slice(1,1+e),r.slice(1+e,1+2*e));return t}else if((r[0]===2||r[0]===3)&&r.length-1===e)return this.pointFromX(r.slice(1,1+e),r[0]===3);throw new Error("Unknown point format")};Rt.prototype.encodeCompressed=function(r){return this.encode(r,!0)};Rt.prototype._encode=function(r){var o=this.curve.p.byteLength(),e=this.getX().toArray("be",o);return r?[this.getY().isEven()?2:3].concat(e):[4].concat(e,this.getY().toArray("be",o))};Rt.prototype.encode=function(r,o){return ro.encode(this._encode(o),r)};Rt.prototype.precompute=function(r){if(this.precomputed)return this;var o={doubles:null,naf:null,beta:null};return o.naf=this._getNAFPoints(8),o.doubles=this._getDoubles(4,r),o.beta=this._getBeta(),this.precomputed=o,this};Rt.prototype._hasDoubles=function(r){if(!this.precomputed)return!1;var o=this.precomputed.doubles;return o?o.points.length>=Math.ceil((r.bitLength()+1)/o.step):!1};Rt.prototype._getDoubles=function(r,o){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var e=[this],t=this,n=0;n<o;n+=r){for(var l=0;l<r;l++)t=t.dbl();e.push(t)}return{step:r,points:e}};Rt.prototype._getNAFPoints=function(r){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var o=[this],e=(1<<r)-1,t=e===1?null:this.dbl(),n=1;n<e;n++)o[n]=o[n-1].add(t);return{wnd:r,points:o}};Rt.prototype._getBeta=function(){return null};Rt.prototype.dblp=function(r){for(var o=this,e=0;e<r;e++)o=o.dbl();return o}});var Zc=$((r1,$c)=>{"use strict";C();F();var Tp=zt(),Le=pt(),Ol=qi(),Er=oo(),Lp=Tp.assert;function Vt(f){Er.call(this,"short",f),this.a=new Le(f.a,16).toRed(this.red),this.b=new Le(f.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(f),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}Ol(Vt,Er);$c.exports=Vt;Vt.prototype._getEndomorphism=function(r){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var o,e;if(r.beta)o=new Le(r.beta,16).toRed(this.red);else{var t=this._getEndoRoots(this.p);o=t[0].cmp(t[1])<0?t[0]:t[1],o=o.toRed(this.red)}if(r.lambda)e=new Le(r.lambda,16);else{var n=this._getEndoRoots(this.n);this.g.mul(n[0]).x.cmp(this.g.x.redMul(o))===0?e=n[0]:(e=n[1],Lp(this.g.mul(e).x.cmp(this.g.x.redMul(o))===0))}var l;return r.basis?l=r.basis.map(function(c){return{a:new Le(c.a,16),b:new Le(c.b,16)}}):l=this._getEndoBasis(e),{beta:o,lambda:e,basis:l}}};Vt.prototype._getEndoRoots=function(r){var o=r===this.p?this.red:Le.mont(r),e=new Le(2).toRed(o).redInvm(),t=e.redNeg(),n=new Le(3).toRed(o).redNeg().redSqrt().redMul(e),l=t.redAdd(n).fromRed(),c=t.redSub(n).fromRed();return[l,c]};Vt.prototype._getEndoBasis=function(r){for(var o=this.n.ushrn(Math.floor(this.n.bitLength()/2)),e=r,t=this.n.clone(),n=new Le(1),l=new Le(0),c=new Le(0),u=new Le(1),b,A,w,B,m,I,O,T=0,E,z;e.cmpn(0)!==0;){var M=t.div(e);E=t.sub(M.mul(e)),z=c.sub(M.mul(n));var R=u.sub(M.mul(l));if(!w&&E.cmp(o)<0)b=O.neg(),A=n,w=E.neg(),B=z;else if(w&&++T===2)break;O=E,t=e,e=E,c=n,n=z,u=l,l=R}m=E.neg(),I=z;var D=w.sqr().add(B.sqr()),_=m.sqr().add(I.sqr());return _.cmp(D)>=0&&(m=b,I=A),w.negative&&(w=w.neg(),B=B.neg()),m.negative&&(m=m.neg(),I=I.neg()),[{a:w,b:B},{a:m,b:I}]};Vt.prototype._endoSplit=function(r){var o=this.endo.basis,e=o[0],t=o[1],n=t.b.mul(r).divRound(this.n),l=e.b.neg().mul(r).divRound(this.n),c=n.mul(e.a),u=l.mul(t.a),b=n.mul(e.b),A=l.mul(t.b),w=r.sub(c).sub(u),B=b.add(A).neg();return{k1:w,k2:B}};Vt.prototype.pointFromX=function(r,o){r=new Le(r,16),r.red||(r=r.toRed(this.red));var e=r.redSqr().redMul(r).redIAdd(r.redMul(this.a)).redIAdd(this.b),t=e.redSqrt();if(t.redSqr().redSub(e).cmp(this.zero)!==0)throw new Error("invalid point");var n=t.fromRed().isOdd();return(o&&!n||!o&&n)&&(t=t.redNeg()),this.point(r,t)};Vt.prototype.validate=function(r){if(r.inf)return!0;var o=r.x,e=r.y,t=this.a.redMul(o),n=o.redSqr().redMul(o).redIAdd(t).redIAdd(this.b);return e.redSqr().redISub(n).cmpn(0)===0};Vt.prototype._endoWnafMulAdd=function(r,o,e){for(var t=this._endoWnafT1,n=this._endoWnafT2,l=0;l<r.length;l++){var c=this._endoSplit(o[l]),u=r[l],b=u._getBeta();c.k1.negative&&(c.k1.ineg(),u=u.neg(!0)),c.k2.negative&&(c.k2.ineg(),b=b.neg(!0)),t[l*2]=u,t[l*2+1]=b,n[l*2]=c.k1,n[l*2+1]=c.k2}for(var A=this._wnafMulAdd(1,t,n,l*2,e),w=0;w<l*2;w++)t[w]=null,n[w]=null;return A};function wt(f,r,o,e){Er.BasePoint.call(this,f,"affine"),r===null&&o===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Le(r,16),this.y=new Le(o,16),e&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}Ol(wt,Er.BasePoint);Vt.prototype.point=function(r,o,e){return new wt(this,r,o,e)};Vt.prototype.pointFromJSON=function(r,o){return wt.fromJSON(this,r,o)};wt.prototype._getBeta=function(){if(!!this.curve.endo){var r=this.precomputed;if(r&&r.beta)return r.beta;var o=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(r){var e=this.curve,t=function(n){return e.point(n.x.redMul(e.endo.beta),n.y)};r.beta=o,o.precomputed={beta:null,naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(t)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(t)}}}return o}};wt.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};wt.fromJSON=function(r,o,e){typeof o=="string"&&(o=JSON.parse(o));var t=r.point(o[0],o[1],e);if(!o[2])return t;function n(c){return r.point(c[0],c[1],e)}var l=o[2];return t.precomputed={beta:null,doubles:l.doubles&&{step:l.doubles.step,points:[t].concat(l.doubles.points.map(n))},naf:l.naf&&{wnd:l.naf.wnd,points:[t].concat(l.naf.points.map(n))}},t};wt.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};wt.prototype.isInfinity=function(){return this.inf};wt.prototype.add=function(r){if(this.inf)return r;if(r.inf)return this;if(this.eq(r))return this.dbl();if(this.neg().eq(r))return this.curve.point(null,null);if(this.x.cmp(r.x)===0)return this.curve.point(null,null);var o=this.y.redSub(r.y);o.cmpn(0)!==0&&(o=o.redMul(this.x.redSub(r.x).redInvm()));var e=o.redSqr().redISub(this.x).redISub(r.x),t=o.redMul(this.x.redSub(e)).redISub(this.y);return this.curve.point(e,t)};wt.prototype.dbl=function(){if(this.inf)return this;var r=this.y.redAdd(this.y);if(r.cmpn(0)===0)return this.curve.point(null,null);var o=this.curve.a,e=this.x.redSqr(),t=r.redInvm(),n=e.redAdd(e).redIAdd(e).redIAdd(o).redMul(t),l=n.redSqr().redISub(this.x.redAdd(this.x)),c=n.redMul(this.x.redSub(l)).redISub(this.y);return this.curve.point(l,c)};wt.prototype.getX=function(){return this.x.fromRed()};wt.prototype.getY=function(){return this.y.fromRed()};wt.prototype.mul=function(r){return r=new Le(r,16),this.isInfinity()?this:this._hasDoubles(r)?this.curve._fixedNafMul(this,r):this.curve.endo?this.curve._endoWnafMulAdd([this],[r]):this.curve._wnafMul(this,r)};wt.prototype.mulAdd=function(r,o,e){var t=[this,o],n=[r,e];return this.curve.endo?this.curve._endoWnafMulAdd(t,n):this.curve._wnafMulAdd(1,t,n,2)};wt.prototype.jmulAdd=function(r,o,e){var t=[this,o],n=[r,e];return this.curve.endo?this.curve._endoWnafMulAdd(t,n,!0):this.curve._wnafMulAdd(1,t,n,2,!0)};wt.prototype.eq=function(r){return this===r||this.inf===r.inf&&(this.inf||this.x.cmp(r.x)===0&&this.y.cmp(r.y)===0)};wt.prototype.neg=function(r){if(this.inf)return this;var o=this.curve.point(this.x,this.y.redNeg());if(r&&this.precomputed){var e=this.precomputed,t=function(n){return n.neg()};o.precomputed={naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(t)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(t)}}}return o};wt.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var r=this.curve.jpoint(this.x,this.y,this.curve.one);return r};function mt(f,r,o,e){Er.BasePoint.call(this,f,"jacobian"),r===null&&o===null&&e===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Le(0)):(this.x=new Le(r,16),this.y=new Le(o,16),this.z=new Le(e,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}Ol(mt,Er.BasePoint);Vt.prototype.jpoint=function(r,o,e){return new mt(this,r,o,e)};mt.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var r=this.z.redInvm(),o=r.redSqr(),e=this.x.redMul(o),t=this.y.redMul(o).redMul(r);return this.curve.point(e,t)};mt.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};mt.prototype.add=function(r){if(this.isInfinity())return r;if(r.isInfinity())return this;var o=r.z.redSqr(),e=this.z.redSqr(),t=this.x.redMul(o),n=r.x.redMul(e),l=this.y.redMul(o.redMul(r.z)),c=r.y.redMul(e.redMul(this.z)),u=t.redSub(n),b=l.redSub(c);if(u.cmpn(0)===0)return b.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var A=u.redSqr(),w=A.redMul(u),B=t.redMul(A),m=b.redSqr().redIAdd(w).redISub(B).redISub(B),I=b.redMul(B.redISub(m)).redISub(l.redMul(w)),O=this.z.redMul(r.z).redMul(u);return this.curve.jpoint(m,I,O)};mt.prototype.mixedAdd=function(r){if(this.isInfinity())return r.toJ();if(r.isInfinity())return this;var o=this.z.redSqr(),e=this.x,t=r.x.redMul(o),n=this.y,l=r.y.redMul(o).redMul(this.z),c=e.redSub(t),u=n.redSub(l);if(c.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var b=c.redSqr(),A=b.redMul(c),w=e.redMul(b),B=u.redSqr().redIAdd(A).redISub(w).redISub(w),m=u.redMul(w.redISub(B)).redISub(n.redMul(A)),I=this.z.redMul(c);return this.curve.jpoint(B,m,I)};mt.prototype.dblp=function(r){if(r===0)return this;if(this.isInfinity())return this;if(!r)return this.dbl();var o;if(this.curve.zeroA||this.curve.threeA){var e=this;for(o=0;o<r;o++)e=e.dbl();return e}var t=this.curve.a,n=this.curve.tinv,l=this.x,c=this.y,u=this.z,b=u.redSqr().redSqr(),A=c.redAdd(c);for(o=0;o<r;o++){var w=l.redSqr(),B=A.redSqr(),m=B.redSqr(),I=w.redAdd(w).redIAdd(w).redIAdd(t.redMul(b)),O=l.redMul(B),T=I.redSqr().redISub(O.redAdd(O)),E=O.redISub(T),z=I.redMul(E);z=z.redIAdd(z).redISub(m);var M=A.redMul(u);o+1<r&&(b=b.redMul(m)),l=T,u=M,A=z}return this.curve.jpoint(l,A.redMul(n),u)};mt.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};mt.prototype._zeroDbl=function(){var r,o,e;if(this.zOne){var t=this.x.redSqr(),n=this.y.redSqr(),l=n.redSqr(),c=this.x.redAdd(n).redSqr().redISub(t).redISub(l);c=c.redIAdd(c);var u=t.redAdd(t).redIAdd(t),b=u.redSqr().redISub(c).redISub(c),A=l.redIAdd(l);A=A.redIAdd(A),A=A.redIAdd(A),r=b,o=u.redMul(c.redISub(b)).redISub(A),e=this.y.redAdd(this.y)}else{var w=this.x.redSqr(),B=this.y.redSqr(),m=B.redSqr(),I=this.x.redAdd(B).redSqr().redISub(w).redISub(m);I=I.redIAdd(I);var O=w.redAdd(w).redIAdd(w),T=O.redSqr(),E=m.redIAdd(m);E=E.redIAdd(E),E=E.redIAdd(E),r=T.redISub(I).redISub(I),o=O.redMul(I.redISub(r)).redISub(E),e=this.y.redMul(this.z),e=e.redIAdd(e)}return this.curve.jpoint(r,o,e)};mt.prototype._threeDbl=function(){var r,o,e;if(this.zOne){var t=this.x.redSqr(),n=this.y.redSqr(),l=n.redSqr(),c=this.x.redAdd(n).redSqr().redISub(t).redISub(l);c=c.redIAdd(c);var u=t.redAdd(t).redIAdd(t).redIAdd(this.curve.a),b=u.redSqr().redISub(c).redISub(c);r=b;var A=l.redIAdd(l);A=A.redIAdd(A),A=A.redIAdd(A),o=u.redMul(c.redISub(b)).redISub(A),e=this.y.redAdd(this.y)}else{var w=this.z.redSqr(),B=this.y.redSqr(),m=this.x.redMul(B),I=this.x.redSub(w).redMul(this.x.redAdd(w));I=I.redAdd(I).redIAdd(I);var O=m.redIAdd(m);O=O.redIAdd(O);var T=O.redAdd(O);r=I.redSqr().redISub(T),e=this.y.redAdd(this.z).redSqr().redISub(B).redISub(w);var E=B.redSqr();E=E.redIAdd(E),E=E.redIAdd(E),E=E.redIAdd(E),o=I.redMul(O.redISub(r)).redISub(E)}return this.curve.jpoint(r,o,e)};mt.prototype._dbl=function(){var r=this.curve.a,o=this.x,e=this.y,t=this.z,n=t.redSqr().redSqr(),l=o.redSqr(),c=e.redSqr(),u=l.redAdd(l).redIAdd(l).redIAdd(r.redMul(n)),b=o.redAdd(o);b=b.redIAdd(b);var A=b.redMul(c),w=u.redSqr().redISub(A.redAdd(A)),B=A.redISub(w),m=c.redSqr();m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m);var I=u.redMul(B).redISub(m),O=e.redAdd(e).redMul(t);return this.curve.jpoint(w,I,O)};mt.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var r=this.x.redSqr(),o=this.y.redSqr(),e=this.z.redSqr(),t=o.redSqr(),n=r.redAdd(r).redIAdd(r),l=n.redSqr(),c=this.x.redAdd(o).redSqr().redISub(r).redISub(t);c=c.redIAdd(c),c=c.redAdd(c).redIAdd(c),c=c.redISub(l);var u=c.redSqr(),b=t.redIAdd(t);b=b.redIAdd(b),b=b.redIAdd(b),b=b.redIAdd(b);var A=n.redIAdd(c).redSqr().redISub(l).redISub(u).redISub(b),w=o.redMul(A);w=w.redIAdd(w),w=w.redIAdd(w);var B=this.x.redMul(u).redISub(w);B=B.redIAdd(B),B=B.redIAdd(B);var m=this.y.redMul(A.redMul(b.redISub(A)).redISub(c.redMul(u)));m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m);var I=this.z.redAdd(c).redSqr().redISub(e).redISub(u);return this.curve.jpoint(B,m,I)};mt.prototype.mul=function(r,o){return r=new Le(r,o),this.curve._wnafMul(this,r)};mt.prototype.eq=function(r){if(r.type==="affine")return this.eq(r.toJ());if(this===r)return!0;var o=this.z.redSqr(),e=r.z.redSqr();if(this.x.redMul(e).redISub(r.x.redMul(o)).cmpn(0)!==0)return!1;var t=o.redMul(this.z),n=e.redMul(r.z);return this.y.redMul(n).redISub(r.y.redMul(t)).cmpn(0)===0};mt.prototype.eqXToP=function(r){var o=this.z.redSqr(),e=r.toRed(this.curve.red).redMul(o);if(this.x.cmp(e)===0)return!0;for(var t=r.clone(),n=this.curve.redN.redMul(o);;){if(t.iadd(this.curve.n),t.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),this.x.cmp(e)===0)return!0}};mt.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};mt.prototype.isInfinity=function(){return this.z.cmpn(0)===0}});var Yc=$((l1,Gc)=>{"use strict";C();F();var Cr=pt(),Xc=qi(),qo=oo(),Pp=zt();function Fr(f){qo.call(this,"mont",f),this.a=new Cr(f.a,16).toRed(this.red),this.b=new Cr(f.b,16).toRed(this.red),this.i4=new Cr(4).toRed(this.red).redInvm(),this.two=new Cr(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}Xc(Fr,qo);Gc.exports=Fr;Fr.prototype.validate=function(r){var o=r.normalize().x,e=o.redSqr(),t=e.redMul(o).redAdd(e.redMul(this.a)).redAdd(o),n=t.redSqrt();return n.redSqr().cmp(t)===0};function gt(f,r,o){qo.BasePoint.call(this,f,"projective"),r===null&&o===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Cr(r,16),this.z=new Cr(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}Xc(gt,qo.BasePoint);Fr.prototype.decodePoint=function(r,o){return this.point(Pp.toArray(r,o),1)};Fr.prototype.point=function(r,o){return new gt(this,r,o)};Fr.prototype.pointFromJSON=function(r){return gt.fromJSON(this,r)};gt.prototype.precompute=function(){};gt.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};gt.fromJSON=function(r,o){return new gt(r,o[0],o[1]||r.one)};gt.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};gt.prototype.isInfinity=function(){return this.z.cmpn(0)===0};gt.prototype.dbl=function(){var r=this.x.redAdd(this.z),o=r.redSqr(),e=this.x.redSub(this.z),t=e.redSqr(),n=o.redSub(t),l=o.redMul(t),c=n.redMul(t.redAdd(this.curve.a24.redMul(n)));return this.curve.point(l,c)};gt.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};gt.prototype.diffAdd=function(r,o){var e=this.x.redAdd(this.z),t=this.x.redSub(this.z),n=r.x.redAdd(r.z),l=r.x.redSub(r.z),c=l.redMul(e),u=n.redMul(t),b=o.z.redMul(c.redAdd(u).redSqr()),A=o.x.redMul(c.redISub(u).redSqr());return this.curve.point(b,A)};gt.prototype.mul=function(r){for(var o=r.clone(),e=this,t=this.curve.point(null,null),n=this,l=[];o.cmpn(0)!==0;o.iushrn(1))l.push(o.andln(1));for(var c=l.length-1;c>=0;c--)l[c]===0?(e=e.diffAdd(t,n),t=t.dbl()):(t=e.diffAdd(t,n),e=e.dbl());return t};gt.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};gt.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};gt.prototype.eq=function(r){return this.getX().cmp(r.getX())===0};gt.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};gt.prototype.getX=function(){return this.normalize(),this.x.fromRed()}});var ea=$((a1,jc)=>{"use strict";C();F();var Ep=zt(),On=pt(),Qc=qi(),Ho=oo(),Cp=Ep.assert;function hn(f){this.twisted=(f.a|0)!==1,this.mOneA=this.twisted&&(f.a|0)===-1,this.extended=this.mOneA,Ho.call(this,"edwards",f),this.a=new On(f.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new On(f.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new On(f.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Cp(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(f.c|0)===1}Qc(hn,Ho);jc.exports=hn;hn.prototype._mulA=function(r){return this.mOneA?r.redNeg():this.a.redMul(r)};hn.prototype._mulC=function(r){return this.oneC?r:this.c.redMul(r)};hn.prototype.jpoint=function(r,o,e,t){return this.point(r,o,e,t)};hn.prototype.pointFromX=function(r,o){r=new On(r,16),r.red||(r=r.toRed(this.red));var e=r.redSqr(),t=this.c2.redSub(this.a.redMul(e)),n=this.one.redSub(this.c2.redMul(this.d).redMul(e)),l=t.redMul(n.redInvm()),c=l.redSqrt();if(c.redSqr().redSub(l).cmp(this.zero)!==0)throw new Error("invalid point");var u=c.fromRed().isOdd();return(o&&!u||!o&&u)&&(c=c.redNeg()),this.point(r,c)};hn.prototype.pointFromY=function(r,o){r=new On(r,16),r.red||(r=r.toRed(this.red));var e=r.redSqr(),t=e.redSub(this.c2),n=e.redMul(this.d).redMul(this.c2).redSub(this.a),l=t.redMul(n.redInvm());if(l.cmp(this.zero)===0){if(o)throw new Error("invalid point");return this.point(this.zero,r)}var c=l.redSqrt();if(c.redSqr().redSub(l).cmp(this.zero)!==0)throw new Error("invalid point");return c.fromRed().isOdd()!==o&&(c=c.redNeg()),this.point(c,r)};hn.prototype.validate=function(r){if(r.isInfinity())return!0;r.normalize();var o=r.x.redSqr(),e=r.y.redSqr(),t=o.redMul(this.a).redAdd(e),n=this.c2.redMul(this.one.redAdd(this.d.redMul(o).redMul(e)));return t.cmp(n)===0};function ve(f,r,o,e,t){Ho.BasePoint.call(this,f,"projective"),r===null&&o===null&&e===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new On(r,16),this.y=new On(o,16),this.z=e?new On(e,16):this.curve.one,this.t=t&&new On(t,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}Qc(ve,Ho.BasePoint);hn.prototype.pointFromJSON=function(r){return ve.fromJSON(this,r)};hn.prototype.point=function(r,o,e,t){return new ve(this,r,o,e,t)};ve.fromJSON=function(r,o){return new ve(r,o[0],o[1],o[2])};ve.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};ve.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};ve.prototype._extDbl=function(){var r=this.x.redSqr(),o=this.y.redSqr(),e=this.z.redSqr();e=e.redIAdd(e);var t=this.curve._mulA(r),n=this.x.redAdd(this.y).redSqr().redISub(r).redISub(o),l=t.redAdd(o),c=l.redSub(e),u=t.redSub(o),b=n.redMul(c),A=l.redMul(u),w=n.redMul(u),B=c.redMul(l);return this.curve.point(b,A,B,w)};ve.prototype._projDbl=function(){var r=this.x.redAdd(this.y).redSqr(),o=this.x.redSqr(),e=this.y.redSqr(),t,n,l,c,u,b;if(this.curve.twisted){c=this.curve._mulA(o);var A=c.redAdd(e);this.zOne?(t=r.redSub(o).redSub(e).redMul(A.redSub(this.curve.two)),n=A.redMul(c.redSub(e)),l=A.redSqr().redSub(A).redSub(A)):(u=this.z.redSqr(),b=A.redSub(u).redISub(u),t=r.redSub(o).redISub(e).redMul(b),n=A.redMul(c.redSub(e)),l=A.redMul(b))}else c=o.redAdd(e),u=this.curve._mulC(this.z).redSqr(),b=c.redSub(u).redSub(u),t=this.curve._mulC(r.redISub(c)).redMul(b),n=this.curve._mulC(c).redMul(o.redISub(e)),l=c.redMul(b);return this.curve.point(t,n,l)};ve.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};ve.prototype._extAdd=function(r){var o=this.y.redSub(this.x).redMul(r.y.redSub(r.x)),e=this.y.redAdd(this.x).redMul(r.y.redAdd(r.x)),t=this.t.redMul(this.curve.dd).redMul(r.t),n=this.z.redMul(r.z.redAdd(r.z)),l=e.redSub(o),c=n.redSub(t),u=n.redAdd(t),b=e.redAdd(o),A=l.redMul(c),w=u.redMul(b),B=l.redMul(b),m=c.redMul(u);return this.curve.point(A,w,m,B)};ve.prototype._projAdd=function(r){var o=this.z.redMul(r.z),e=o.redSqr(),t=this.x.redMul(r.x),n=this.y.redMul(r.y),l=this.curve.d.redMul(t).redMul(n),c=e.redSub(l),u=e.redAdd(l),b=this.x.redAdd(this.y).redMul(r.x.redAdd(r.y)).redISub(t).redISub(n),A=o.redMul(c).redMul(b),w,B;return this.curve.twisted?(w=o.redMul(u).redMul(n.redSub(this.curve._mulA(t))),B=c.redMul(u)):(w=o.redMul(u).redMul(n.redSub(t)),B=this.curve._mulC(c).redMul(u)),this.curve.point(A,w,B)};ve.prototype.add=function(r){return this.isInfinity()?r:r.isInfinity()?this:this.curve.extended?this._extAdd(r):this._projAdd(r)};ve.prototype.mul=function(r){return this._hasDoubles(r)?this.curve._fixedNafMul(this,r):this.curve._wnafMul(this,r)};ve.prototype.mulAdd=function(r,o,e){return this.curve._wnafMulAdd(1,[this,o],[r,e],2,!1)};ve.prototype.jmulAdd=function(r,o,e){return this.curve._wnafMulAdd(1,[this,o],[r,e],2,!0)};ve.prototype.normalize=function(){if(this.zOne)return this;var r=this.z.redInvm();return this.x=this.x.redMul(r),this.y=this.y.redMul(r),this.t&&(this.t=this.t.redMul(r)),this.z=this.curve.one,this.zOne=!0,this};ve.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};ve.prototype.getX=function(){return this.normalize(),this.x.fromRed()};ve.prototype.getY=function(){return this.normalize(),this.y.fromRed()};ve.prototype.eq=function(r){return this===r||this.getX().cmp(r.getX())===0&&this.getY().cmp(r.getY())===0};ve.prototype.eqXToP=function(r){var o=r.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(o)===0)return!0;for(var e=r.clone(),t=this.curve.redN.redMul(this.z);;){if(e.iadd(this.curve.n),e.cmp(this.curve.p)>=0)return!1;if(o.redIAdd(t),this.x.cmp(o)===0)return!0}};ve.prototype.toP=ve.prototype.normalize;ve.prototype.mixedAdd=ve.prototype.add});var Sl=$(ta=>{"use strict";C();F();var Wo=ta;Wo.base=oo();Wo.short=Zc();Wo.mont=Yc();Wo.edwards=ea()});var ra=$((y1,na)=>{"use strict";C();F();na.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}});var Ko=$(la=>{"use strict";C();F();var Il=la,Dn=Ef(),ml=Sl(),Fp=zt(),oa=Fp.assert;function ia(f){f.type==="short"?this.curve=new ml.short(f):f.type==="edwards"?this.curve=new ml.edwards(f):this.curve=new ml.mont(f),this.g=this.curve.g,this.n=this.curve.n,this.hash=f.hash,oa(this.g.validate(),"Invalid curve"),oa(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}Il.PresetCurve=ia;function Un(f,r){Object.defineProperty(Il,f,{configurable:!0,enumerable:!0,get:function(){var o=new ia(r);return Object.defineProperty(Il,f,{configurable:!0,enumerable:!0,value:o}),o}})}Un("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Dn.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});Un("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Dn.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});Un("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Dn.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});Un("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Dn.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});Un("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Dn.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]});Un("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Dn.sha256,gRed:!1,g:["9"]});Un("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Dn.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var Bl;try{Bl=ra()}catch{Bl=void 0}Un("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Dn.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",Bl]})});var ca=$((O1,fa)=>{"use strict";C();F();var Mp=pt(),_p=zt(),xl=_p.assert;function xt(f,r){this.ec=f,this.priv=null,this.pub=null,r.priv&&this._importPrivate(r.priv,r.privEnc),r.pub&&this._importPublic(r.pub,r.pubEnc)}fa.exports=xt;xt.fromPublic=function(r,o,e){return o instanceof xt?o:new xt(r,{pub:o,pubEnc:e})};xt.fromPrivate=function(r,o,e){return o instanceof xt?o:new xt(r,{priv:o,privEnc:e})};xt.prototype.validate=function(){var r=this.getPublic();return r.isInfinity()?{result:!1,reason:"Invalid public key"}:r.validate()?r.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};xt.prototype.getPublic=function(r,o){return typeof r=="string"&&(o=r,r=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),o?this.pub.encode(o,r):this.pub};xt.prototype.getPrivate=function(r){return r==="hex"?this.priv.toString(16,2):this.priv};xt.prototype._importPrivate=function(r,o){this.priv=new Mp(r,o||16),this.priv=this.priv.umod(this.ec.curve.n)};xt.prototype._importPublic=function(r,o){if(r.x||r.y){this.ec.curve.type==="mont"?xl(r.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&xl(r.x&&r.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(r.x,r.y);return}this.pub=this.ec.curve.decodePoint(r,o)};xt.prototype.derive=function(r){return r.validate()||xl(r.validate(),"public point not validated"),r.mul(this.priv).getX()};xt.prototype.sign=function(r,o,e){return this.ec.sign(r,this,o,e)};xt.prototype.verify=function(r,o){return this.ec.verify(r,o,this)};xt.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}});var da=$((I1,ua)=>{"use strict";C();F();var Jo=pt(),Tl=zt(),zp=Tl.assert;function io(f,r,o){if(r instanceof io)return r;this._importDER(r,o)||(zp(r.r&&r.s,"Signature without r or s"),this.r=new Jo(r.r,16),this.s=new Jo(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam,this.curve=f,this.byteLength=this.curve.n.byteLength())}ua.exports=io;function Dp(){this.place=0}function Nl(f,r){var o=f[r.place++];if(!(o&128))return o;var e=o&15;if(e===0||e>4)return!1;for(var t=0,n=0,l=r.place;n<e;n++,l++)t<<=8,t|=f[l],t>>>=0;return t<=127?!1:(r.place=l,t)}function aa(f){for(var r=0,o=f.length-1;!f[r]&&!(f[r+1]&128)&&r<o;)r++;return r===0?f:f.slice(r)}io.prototype._importDER=function(r,o){r=Tl.toArray(r,o);var e=new Dp;if(r[e.place++]!==48)return!1;var t=Nl(r,e);if(t===!1||t+e.place!==r.length||r[e.place++]!==2)return!1;var n=Nl(r,e);if(n===!1)return!1;var l=r.slice(e.place,n+e.place);if(e.place+=n,r[e.place++]!==2)return!1;var c=Nl(r,e);if(c===!1||r.length!==c+e.place)return!1;var u=r.slice(e.place,c+e.place);if(l[0]===0)if(l[1]&128)l=l.slice(1);else return!1;if(u[0]===0)if(u[1]&128)u=u.slice(1);else return!1;return this.r=new Jo(l),this.s=new Jo(u),this.recoveryParam=null,!0};function kl(f,r){if(r<128){f.push(r);return}var o=1+(Math.log(r)/Math.LN2>>>3);for(f.push(o|128);--o;)f.push(r>>>(o<<3)&255);f.push(r)}io.prototype.toDER=function(r){var o=this.r.toArray(),e=this.s.toArray();for(o[0]&128&&(o=[0].concat(o)),e[0]&128&&(e=[0].concat(e)),o=aa(o),e=aa(e);!e[0]&&!(e[1]&128);)e=e.slice(1);var t=[2];kl(t,o.length),t=t.concat(o),t.push(2),kl(t,e.length);var n=t.concat(e),l=[48];return kl(l,n.length),l=l.concat(n),Tl.encode(l,r)};io.prototype.toBytes=function(){let r=this.r.toArray("be",this.byteLength),o=this.s.toArray("be",this.byteLength);return r.concat(o)}});var ya=$((N1,pa)=>{"use strict";C();F();var rr=pt(),sa=qd(),Up=zt(),Ll=Ko(),Rp=Rd(),ha=Up.assert,Pl=ca(),$o=da();function qt(f){if(!(this instanceof qt))return new qt(f);typeof f=="string"&&(ha(Object.prototype.hasOwnProperty.call(Ll,f),"Unknown curve "+f),f=Ll[f]),f instanceof Ll.PresetCurve&&(f={curve:f}),this.curve=f.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=f.curve.g,this.g.precompute(f.curve.n.bitLength()+1),this.hash=f.hash||f.curve.hash}pa.exports=qt;qt.prototype.keyPair=function(r){return new Pl(this,r)};qt.prototype.keyFromPrivate=function(r,o){return Pl.fromPrivate(this,r,o)};qt.prototype.keyFromPublic=function(r,o){return Pl.fromPublic(this,r,o)};qt.prototype.genKeyPair=function(r){r||(r={});for(var o=new sa({hash:this.hash,pers:r.pers,persEnc:r.persEnc||"utf8",entropy:r.entropy||Rp(this.hash.hmacStrength),entropyEnc:r.entropy&&r.entropyEnc||"utf8",nonce:this.n.toArray()}),e=this.n.byteLength(),t=this.n.sub(new rr(2));;){var n=new rr(o.generate(e));if(!(n.cmp(t)>0))return n.iaddn(1),this.keyFromPrivate(n)}};qt.prototype._truncateToN=function(r,o){var e=r.byteLength()*8-this.n.bitLength();return e>0&&(r=r.ushrn(e)),!o&&r.cmp(this.n)>=0?r.sub(this.n):r};qt.prototype.sign=function(r,o,e,t){typeof e=="object"&&(t=e,e=null),t||(t={}),o=this.keyFromPrivate(o,e),r=this._truncateToN(new rr(r,16));for(var n=this.n.byteLength(),l=o.getPrivate().toArray("be",n),c=r.toArray("be",n),u=new sa({hash:this.hash,entropy:l,nonce:c,pers:t.pers,persEnc:t.persEnc||"utf8"}),b=this.n.sub(new rr(1)),A=0;;A++){var w=t.k?t.k(A):new rr(u.generate(this.n.byteLength()));if(w=this._truncateToN(w,!0),!(w.cmpn(1)<=0||w.cmp(b)>=0)){var B=this.g.mul(w);if(!B.isInfinity()){var m=B.getX(),I=m.umod(this.n);if(I.cmpn(0)!==0){var O=w.invm(this.n).mul(I.mul(o.getPrivate()).iadd(r));if(O=O.umod(this.n),O.cmpn(0)!==0){var T=(B.getY().isOdd()?1:0)|(m.cmp(I)!==0?2:0);return t.canonical&&O.cmp(this.nh)>0&&(O=this.n.sub(O),T^=1),new $o(this.curve,{r:I,s:O,recoveryParam:T})}}}}}};qt.prototype.verify=function(r,o,e,t){r=this._truncateToN(new rr(r,16)),e=this.keyFromPublic(e,t),o=new $o(this.curve,o,"hex");var n=o.r,l=o.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0||l.cmpn(1)<0||l.cmp(this.n)>=0)return!1;var c=l.invm(this.n),u=c.mul(r).umod(this.n),b=c.mul(n).umod(this.n),A;return this.curve._maxwellTrick?(A=this.g.jmulAdd(u,e.getPublic(),b),A.isInfinity()?!1:A.eqXToP(n)):(A=this.g.mulAdd(u,e.getPublic(),b),A.isInfinity()?!1:A.getX().umod(this.n).cmp(n)===0)};qt.prototype.recoverPubKey=function(f,r,o,e){ha((3&o)===o,"The recovery param is more than two bits"),r=new $o(this.curve,r,e);var t=this.n,n=new rr(f),l=r.r,c=r.s,u=o&1,b=o>>1;if(l.cmp(this.curve.p.umod(this.curve.n))>=0&&b)throw new Error("Unable to find sencond key candinate");b?l=this.curve.pointFromX(l.add(this.curve.n),u):l=this.curve.pointFromX(l,u);var A=r.r.invm(t),w=t.sub(n).mul(A).umod(t),B=c.mul(A).umod(t);return this.g.mulAdd(w,l,B)};qt.prototype.getKeyRecoveryParam=function(f,r,o,e){if(r=new $o(this.curve,r,e),r.recoveryParam!==null)return r.recoveryParam;for(var t=0;t<4;t++){var n;try{n=this.recoverPubKey(f,r,t)}catch{continue}if(n.eq(o))return t}throw new Error("Unable to find valid recovery factor")}});var va=$((L1,ga)=>{"use strict";C();F();var lo=zt(),wa=lo.assert,ba=lo.parseBytes,Mr=lo.cachedProperty;function vt(f,r){this.eddsa=f,this._secret=ba(r.secret),f.isPoint(r.pub)?this._pub=r.pub:this._pubBytes=ba(r.pub)}vt.fromPublic=function(r,o){return o instanceof vt?o:new vt(r,{pub:o})};vt.fromSecret=function(r,o){return o instanceof vt?o:new vt(r,{secret:o})};vt.prototype.secret=function(){return this._secret};Mr(vt,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});Mr(vt,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});Mr(vt,"privBytes",function(){var r=this.eddsa,o=this.hash(),e=r.encodingLength-1,t=o.slice(0,r.encodingLength);return t[0]&=248,t[e]&=127,t[e]|=64,t});Mr(vt,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});Mr(vt,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});Mr(vt,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});vt.prototype.sign=function(r){return wa(this._secret,"KeyPair can only verify"),this.eddsa.sign(r,this)};vt.prototype.verify=function(r,o){return this.eddsa.verify(r,o,this)};vt.prototype.getSecret=function(r){return wa(this._secret,"KeyPair is public only"),lo.encode(this.secret(),r)};vt.prototype.getPublic=function(r){return lo.encode(this.pubBytes(),r)};ga.exports=vt});var Oa=$((C1,Aa)=>{"use strict";C();F();var Vp=pt(),Zo=zt(),qp=Zo.assert,Xo=Zo.cachedProperty,Hp=Zo.parseBytes;function or(f,r){this.eddsa=f,typeof r!="object"&&(r=Hp(r)),Array.isArray(r)&&(r={R:r.slice(0,f.encodingLength),S:r.slice(f.encodingLength)}),qp(r.R&&r.S,"Signature without R or S"),f.isPoint(r.R)&&(this._R=r.R),r.S instanceof Vp&&(this._S=r.S),this._Rencoded=Array.isArray(r.R)?r.R:r.Rencoded,this._Sencoded=Array.isArray(r.S)?r.S:r.Sencoded}Xo(or,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});Xo(or,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});Xo(or,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});Xo(or,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});or.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};or.prototype.toHex=function(){return Zo.encode(this.toBytes(),"hex").toUpperCase()};Aa.exports=or});var xa=$((_1,Ba)=>{"use strict";C();F();var Wp=Ef(),Kp=Ko(),_r=zt(),Jp=_r.assert,ma=_r.parseBytes,Ia=va(),Sa=Oa();function Mt(f){if(Jp(f==="ed25519","only tested with ed25519 so far"),!(this instanceof Mt))return new Mt(f);f=Kp[f].curve,this.curve=f,this.g=f.g,this.g.precompute(f.n.bitLength()+1),this.pointClass=f.point().constructor,this.encodingLength=Math.ceil(f.n.bitLength()/8),this.hash=Wp.sha512}Ba.exports=Mt;Mt.prototype.sign=function(r,o){r=ma(r);var e=this.keyFromSecret(o),t=this.hashInt(e.messagePrefix(),r),n=this.g.mul(t),l=this.encodePoint(n),c=this.hashInt(l,e.pubBytes(),r).mul(e.priv()),u=t.add(c).umod(this.curve.n);return this.makeSignature({R:n,S:u,Rencoded:l})};Mt.prototype.verify=function(r,o,e){r=ma(r),o=this.makeSignature(o);var t=this.keyFromPublic(e),n=this.hashInt(o.Rencoded(),t.pubBytes(),r),l=this.g.mul(o.S()),c=o.R().add(t.pub().mul(n));return c.eq(l)};Mt.prototype.hashInt=function(){for(var r=this.hash(),o=0;o<arguments.length;o++)r.update(arguments[o]);return _r.intFromLE(r.digest()).umod(this.curve.n)};Mt.prototype.keyFromPublic=function(r){return Ia.fromPublic(this,r)};Mt.prototype.keyFromSecret=function(r){return Ia.fromSecret(this,r)};Mt.prototype.makeSignature=function(r){return r instanceof Sa?r:new Sa(this,r)};Mt.prototype.encodePoint=function(r){var o=r.getY().toArray("le",this.encodingLength);return o[this.encodingLength-1]|=r.getX().isOdd()?128:0,o};Mt.prototype.decodePoint=function(r){r=_r.parseBytes(r);var o=r.length-1,e=r.slice(0,o).concat(r[o]&-129),t=(r[o]&128)!==0,n=_r.intFromLE(e);return this.curve.pointFromY(n,t)};Mt.prototype.encodeInt=function(r){return r.toArray("le",this.encodingLength)};Mt.prototype.decodeInt=function(r){return _r.intFromLE(r)};Mt.prototype.isPoint=function(r){return r instanceof this.pointClass}});var zr=$(Ht=>{"use strict";C();F();Object.defineProperty(Ht,"__esModule",{value:!0});Ht.utils=Ht.curves=Ht.curve=Ht.eddsa=Ht.ec=void 0;var $p=Sl();Ht.curve=$p;var Zp=Ko();Ht.curves=Zp;var Xp=ya();Ht.ec=Xp;var Gp=xa();Ht.eddsa=Gp;var Yp=zt();Ht.utils=Yp});var Ta=$((Na,ka)=>{"use strict";C();F();Object.defineProperty(Na,"__esModule",{value:!0});var Qp=zr(),pn=new Qp.ec("secp256k1"),ae=pn.curve,Ae=pt();function jp(f,r){let o=new Ae(r);if(o.cmp(ae.p)>=0)return null;o=o.toRed(ae.red);let e=o.redSqr().redIMul(o).redIAdd(ae.b).redSqrt();f===3!==e.isOdd()&&(e=e.redNeg());let t=o.redSqr().redIMul(o);return e.redSqr().redISub(t.redIAdd(ae.b)).isZero()?pn.keyPair({pub:{x:o,y:e}}):null}function e0(f,r,o){let e=new Ae(r),t=new Ae(o);if(e.cmp(ae.p)>=0||t.cmp(ae.p)>=0||(e=e.toRed(ae.red),t=t.toRed(ae.red),(f===6||f===7)&&t.isOdd()!==(f===7)))return null;let n=e.redSqr().redIMul(e);return t.redSqr().redISub(n.redIAdd(ae.b)).isZero()?pn.keyPair({pub:{x:e,y:t}}):null}function Rn(f){let r=f[0];switch(r){case 2:case 3:return f.length!==33?null:jp(r,f.subarray(1,33));case 4:case 6:case 7:return f.length!==65?null:e0(r,f.subarray(1,33),f.subarray(33,65));default:return null}}ka.exports={contextRandomize(){return 0},privateKeyVerify(f){let r=new Ae(f);return r.cmp(ae.n)<0&&!r.isZero()},privateKeyNegate(f){let r=new Ae(f);return P.Buffer.from(ae.n.sub(r).umod(ae.n).toArray("be",32))},privateKeyTweakAdd(f,r){let o=new Ae(r);return o.cmp(ae.n)>=0||(o.iadd(new Ae(f)),o.cmp(ae.n)>=0&&o.isub(ae.n),o.isZero())?null:P.Buffer.from(o.toArray("be",32))},privateKeyTweakMul(f,r){let o=new Ae(r);return o.cmp(ae.n)>=0||o.isZero()?1:(o.imul(new Ae(f)),o.cmp(ae.n)>=0&&(o=o.umod(ae.n)),P.Buffer.from(o.toArray("be",32)))},publicKeyVerify(f){let r=Rn(f);return r==null?null:r.validate().result},publicKeyCreate(f,r){let o=new Ae(f);if(o.cmp(ae.n)>=0||o.isZero())return null;let e=pn.keyFromPrivate(f,null).getPublic();return P.Buffer.from(e.encode(null,r))},publicKeyConvert(f,r){let e=Rn(f).getPublic();return P.Buffer.from(e.encode(null,r))},publicKeyNegate(f,r){let o=Rn(f);if(o===null)return 1;let e=o.getPublic();return e.y=e.y.redNeg(),P.Buffer.from(e.encode(null,r))},publicKeyCombine(f,r){let o=new Array(f.length);for(let t=0;t<f.length;++t)if(o[t]=Rn(f[t]),o[t]===null)return null;let e=o[0].getPublic();for(let t=1;t<o.length;++t)e=e.add(o[t].pub);return e.isInfinity()?null:P.Buffer.from(e.encode(null,r))},publicKeyTweakAdd(f,r,o){let e=Rn(f);if(e===null||new Ae(r).cmp(ae.n)>=0)return null;let n=e.getPublic().add(ae.g.mul(r));return n.isInfinity()?null:P.Buffer.from(n.encode(null,o))},publicKeyTweakMul(f,r,o){let e=Rn(f);if(e===null)return null;let t=new Ae(r);if(t.cmp(ae.n)>=0||t.isZero())return null;let n=e.getPublic().mul(r);return P.Buffer.from(n.encode(null,o))},signatureNormalize(f){let r=new Ae(f.subarray(0,32)),o=new Ae(f.subarray(32,64));return r.cmp(ae.n)>=0||o.cmp(ae.n)>=0?null:(o.cmp(pn.nh)===1&&f.set(ae.n.sub(o).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(f,r){let o=r.subarray(0,32),e=r.subarray(32,64);if(new Ae(o).cmp(ae.n)>=0||new Ae(e).cmp(ae.n)>=0)return 1;let{output:t}=f,n=t.subarray(4,4+33);n[0]=0,n.set(o,1);let l=33,c=0;for(;l>1&&n[c]===0&&!(n[c+1]&128);--l,++c);if(n=n.subarray(c),n[0]&128||l>1&&n[0]===0&&!(n[1]&128))return 1;let u=t.subarray(6+33,6+33+33);u[0]=0,u.set(e,1);let b=33,A=0;for(;b>1&&u[A]===0&&!(u[A+1]&128);--b,++A);return u=u.subarray(A),u[0]&128||b>1&&u[0]===0&&!(u[1]&128)?1:(f.outputlen=6+l+b,t[0]=48,t[1]=f.outputlen-2,t[2]=2,t[3]=n.length,t.set(n,4),t[4+l]=2,t[5+l]=u.length,t.set(u,6+l),0)},signatureImport(f,r){if(r.length<8||r.length>72||r[0]!==48||r[1]!==r.length-2||r[2]!==2)return 1;let o=r[3];if(o===0||5+o>=r.length||r[4+o]!==2)return 1;let e=r[5+o];if(e===0||6+o+e!==r.length||r[4]&128||o>1&&r[4]===0&&!(r[5]&128)||r[o+6]&128||e>1&&r[o+6]===0&&!(r[o+7]&128))return 1;let t=r.subarray(4,4+o);if(t.length===33&&t[0]===0&&(t=t.subarray(1)),t.length>32)return 1;let n=r.subarray(6+o);if(n.length===33&&n[0]===0&&(n=n.slice(1)),n.length>32)throw new Error("S length is too long");let l=new Ae(t);l.cmp(ae.n)>=0&&(l=new Ae(0));let c=new Ae(r.subarray(6+o));return c.cmp(ae.n)>=0&&(c=new Ae(0)),f.set(l.toArrayLike(Uint8Array,"be",32),0),f.set(c.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(f,r){let o=new Ae(r);return o.cmp(ae.n)>=0||o.isZero()?null:pn.sign(f,r,{canonical:!0}).toBytes()},ecdsaVerify(f,r,o){let e={r:f.subarray(0,32),s:f.subarray(32,64)},t=new Ae(e.r),n=new Ae(e.s);if(t.cmp(ae.n)>=0||n.cmp(ae.n)>=0)return 1;if(n.cmp(pn.nh)===1||t.isZero()||n.isZero())return 3;let l=Rn(o);if(l===null)return 2;let c=l.getPublic();return pn.verify(r,e,c)},ecdsaRecover(f,r,o,e){let t={r:f.slice(0,32),s:f.slice(32,64)},n=new Ae(t.r),l=new Ae(t.s);if(n.cmp(ae.n)>=0||l.cmp(ae.n)>=0)return 1;if(n.isZero()||l.isZero())return 2;let c;try{c=pn.recoverPubKey(o,t,r,null)}catch{return 2}return P.Buffer.from(c.encode(null,e))},ecdh(f,r,o,e,t,n,l){let c=Rn(r);if(c===null)return 1;let u=new Ae(o);if(u.cmp(ae.n)>=0||u.isZero())return 2;let b=c.getPublic().mul(u);if(t===void 0){let A=b.encode(null,!0),w=pn.hash().update(A).digest();for(let B=0;B<32;++B)f[B]=w[B]}else{n||(n=new Uint8Array(32));let A=b.getX().toArray("be",32);for(let I=0;I<32;++I)n[I]=A[I];l||(l=new Uint8Array(32));let w=b.getY().toArray("be",32);for(let I=0;I<32;++I)l[I]=w[I];let B=t(n,l,e);if(!(B instanceof Uint8Array&&B.length===f.length))return 2;f.set(B)}return 0}}});var Fa=$(At=>{"use strict";C();F();var t0=At&&At.__createBinding||(Object.create?function(f,r,o,e){e===void 0&&(e=o);var t=Object.getOwnPropertyDescriptor(r,o);(!t||("get"in t?!r.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(f,e,t)}:function(f,r,o,e){e===void 0&&(e=o),f[e]=r[o]}),n0=At&&At.__setModuleDefault||(Object.create?function(f,r){Object.defineProperty(f,"default",{enumerable:!0,value:r})}:function(f,r){f.default=r}),r0=At&&At.__importStar||function(f){if(f&&f.__esModule)return f;var r={};if(f!=null)for(var o in f)o!=="default"&&Object.prototype.hasOwnProperty.call(f,o)&&t0(r,f,o);return n0(r,f),r};Object.defineProperty(At,"__esModule",{value:!0});At.fromSeed=At.fromPublicKey=At.fromPrivateKey=At.fromBase58=At.tinySecp256k1Interface=void 0;var El=r0(tr()),o0=Gn(),i0=jr(),Pa=(0,o0.base58check)(i0.sha256),Ea=Ta(),It=Cf(),l0=Wd();function f0(f){return{isPoint:r=>f.publicKeyVerify(r),isPrivate:r=>f.privateKeyVerify(r),pointAddScalar:(r,o,e)=>f.publicKeyTweakAdd(r,o,e),pointFromScalar:(r,o)=>f.publicKeyCreate(r,o),privateAdd:(r,o)=>f.privateKeyTweakAdd(new Uint8Array(r),o),sign:(r,o)=>f.ecdsaSign(r,o),verify:(r,o,e)=>f.ecdsaVerify(e,r,o)}}function c0(f){return{isPoint:r=>f.publicKeyVerify(r),pointCompress:(r,o)=>Uint8Array.from(f.publicKeyConvert(r,o??!0)),isPrivate:r=>f.privateKeyVerify(r),pointFromScalar:(r,o)=>{let e=f.publicKeyCreate(r,o??!0);return e==null?null:Uint8Array.from(e)},sign:(r,o,e)=>Uint8Array.from(f.ecdsaSign(r,o)),verify:(r,o,e,t)=>f.ecdsaVerify(e,r,o)}}var Vn=f0(Ea);At.tinySecp256k1Interface=c0(Ea);var Cl=It.BufferN(32),a0=It.compile({wif:It.UInt8,bip32:{public:It.UInt32,private:It.UInt32}}),Qo={messagePrefix:`Bitcoin Signed Message:
|
||
`,bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},La=2147483648,u0=Math.pow(2,31)-1;function d0(f){return It.String(f)&&f.match(/^(m\/)?(\d+'?\/)*\d+'?$/)!==null}function s0(f){return It.UInt32(f)&&f<=u0}var Go=class{constructor(r,o,e,t,n=0,l=0,c=0){this.__D=r,this.__Q=o,this.chainCode=e,this.network=t,this.__DEPTH=n,this.__INDEX=l,this.__PARENT_FINGERPRINT=c,It(a0,t),this.lowR=!1}get depth(){return this.__DEPTH}get index(){return this.__INDEX}get parentFingerprint(){return this.__PARENT_FINGERPRINT}get publicKey(){return this.__Q===void 0&&(this.__Q=P.Buffer.from(Vn.pointFromScalar(this.__D,!0))),this.__Q}get privateKey(){return this.__D}get identifier(){return P.Buffer.from(El.hash160(this.publicKey))}get fingerprint(){return this.identifier.slice(0,4)}get compressed(){return!0}isNeutered(){return this.__D===void 0}neutered(){return Yo(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}toBase58(){let r=this.network,o=this.isNeutered()?r.bip32.public:r.bip32.private,e=P.Buffer.allocUnsafe(78);return e.writeUInt32BE(o,0),e.writeUInt8(this.depth,4),e.writeUInt32BE(this.parentFingerprint,5),e.writeUInt32BE(this.index,9),this.chainCode.copy(e,13),this.isNeutered()?this.publicKey.copy(e,45):(e.writeUInt8(0,45),this.privateKey.copy(e,46)),Pa.encode(e)}toWIF(){if(!this.privateKey)throw new TypeError("Missing private key");return l0.encode(this.network.wif,this.privateKey,!0)}derive(r){It(It.UInt32,r);let o=r>=La,e=P.Buffer.allocUnsafe(37);if(o){if(this.isNeutered())throw new TypeError("Missing private key for hardened child key");e[0]=0,this.privateKey.copy(e,1),e.writeUInt32BE(r,33)}else this.publicKey.copy(e,0),e.writeUInt32BE(r,33);let t=El.hmacSHA512(this.chainCode,e),n=t.slice(0,32),l=t.slice(32);if(!Vn.isPrivate(n))return this.derive(r+1);let c;if(this.isNeutered()){let u=Vn.pointAddScalar(this.publicKey,n,!0);if(u===null)return this.derive(r+1);c=Yo(u,l,this.network,this.depth+1,r,this.fingerprint.readUInt32BE(0))}else{let u=Vn.privateAdd(this.privateKey,n);if(u==null)return this.derive(r+1);c=Fl(u,l,this.network,this.depth+1,r,this.fingerprint.readUInt32BE(0))}return c}deriveHardened(r){return It(s0,r),this.derive(r+La)}derivePath(r){It(d0,r);let o=r.split("/");if(o[0]==="m"){if(this.parentFingerprint)throw new TypeError("Expected master, got child");o=o.slice(1)}return o.reduce((e,t)=>{let n;return t.slice(-1)==="'"?(n=parseInt(t.slice(0,-1),10),e.deriveHardened(n)):(n=parseInt(t,10),e.derive(n))},this)}sign(r){if(!this.privateKey)throw new Error("Missing private key");return Vn.sign(r,this.privateKey)}verify(r,o){return Vn.verify(r,this.publicKey,o)}};function h0(f,r){let o=P.Buffer.from(Pa.decode(f));if(o.length!==78)throw new TypeError("Invalid buffer length");r=r||Qo;let e=o.readUInt32BE(0);if(e!==r.bip32.private&&e!==r.bip32.public)throw new TypeError("Invalid network version");let t=o[4],n=o.readUInt32BE(5);if(t===0&&n!==0)throw new TypeError("Invalid parent fingerprint");let l=o.readUInt32BE(9);if(t===0&&l!==0)throw new TypeError("Invalid index");let c=o.slice(13,45),u;if(e===r.bip32.private){if(o.readUInt8(45)!==0)throw new TypeError("Invalid private key");let b=o.slice(46,78);u=Fl(b,c,r,t,l,n)}else{let b=o.slice(45,78);u=Yo(b,c,r,t,l,n)}return u}At.fromBase58=h0;function Ca(f,r,o){return Fl(f,r,o)}At.fromPrivateKey=Ca;function Fl(f,r,o,e,t,n){if(It({privateKey:Cl,chainCode:Cl},{privateKey:f,chainCode:r}),o=o||Qo,!Vn.isPrivate(f))throw new TypeError("Private key not in range [1, n)");return new Go(f,void 0,r,o,e,t,n)}function p0(f,r,o){return Yo(f,r,o)}At.fromPublicKey=p0;function Yo(f,r,o,e,t,n){if(It({publicKey:It.BufferN(33),chainCode:Cl},{publicKey:f,chainCode:r}),o=o||Qo,!Vn.isPoint(f))throw new TypeError("Point is not on the curve");return new Go(void 0,f,r,o,e,t,n)}function y0(f,r){if(It(It.Buffer,f),f.length<16)throw new TypeError("Seed should be at least 128 bits");if(f.length>64)throw new TypeError("Seed should be at most 512 bits");r=r||Qo;let o=El.hmacSHA512(P.Buffer.from("Bitcoin seed","utf8"),f),e=o.slice(0,32),t=o.slice(32);return Ca(e,t,r)}At.fromSeed=y0});var Ma=$(Wt=>{"use strict";C();F();Object.defineProperty(Wt,"__esModule",{value:!0});Wt.fromPrivateKey=Wt.fromPublicKey=Wt.fromBase58=Wt.fromSeed=Wt.tinySecp256k1Interface=void 0;var fo=Fa();Object.defineProperty(Wt,"tinySecp256k1Interface",{enumerable:!0,get:function(){return fo.tinySecp256k1Interface}});Object.defineProperty(Wt,"fromSeed",{enumerable:!0,get:function(){return fo.fromSeed}});Object.defineProperty(Wt,"fromBase58",{enumerable:!0,get:function(){return fo.fromBase58}});Object.defineProperty(Wt,"fromPublicKey",{enumerable:!0,get:function(){return fo.fromPublicKey}});Object.defineProperty(Wt,"fromPrivateKey",{enumerable:!0,get:function(){return fo.fromPrivateKey}})});var _a=$((G1,b0)=>{b0.exports=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"]});var _l=$(ir=>{"use strict";C();F();Object.defineProperty(ir,"__esModule",{value:!0});ir._default=ir.wordlists=void 0;var Ml={};ir.wordlists=Ml;var jo;ir._default=jo;try{ir._default=jo=_a(),Ml.english=jo,Ml.EN=jo}catch{}});var zl=$(at=>{"use strict";C();F();Object.defineProperty(at,"__esModule",{value:!0});at.wordlists=at.getDefaultWordlist=at.setDefaultWordlist=at.validateMnemonic=at.generateMnemonic=at.entropyToMnemonic=at.mnemonicToEntropy=at.mnemonicToSeed=at.mnemonicToSeedSync=void 0;var Da=tr(),Ua=Do(),ei=_l(),Ra=No(),co=ei._default,za="Invalid mnemonic",lr="Invalid entropy",w0="Invalid mnemonic checksum",Va=`A wordlist is required but a default could not be found.
|
||
Please pass a 2048 word array explicitly.`;function g0(f,r,o,e,t){let n=(0,Ua.pbkdf2)(Ra.sha512,f,r,{c:o,dkLen:e});return Promise.resolve(P.Buffer.from(n))}function ao(f){return(f||"").normalize("NFKD")}function qa(f,r,o){for(;f.length<o;)f=r+f;return f}function Ha(f){return parseInt(f,2)}function Wa(f){return f.map(r=>qa(r.toString(2),"0",8)).join("")}function Ka(f){let o=f.length*8/32,e=(0,Da.sha256)(f);return Wa(Array.from(e)).slice(0,o)}function Ja(f){return"mnemonic"+(f||"")}function v0(f,r){let o=P.Buffer.from(ao(f),"utf8"),e=P.Buffer.from(Ja(ao(r)),"utf8"),t=(0,Ua.pbkdf2)(Ra.sha512,o,e,{c:2048,dkLen:64});return P.Buffer.from(t)}at.mnemonicToSeedSync=v0;function A0(f,r){return Promise.resolve().then(()=>{let o=P.Buffer.from(ao(f),"utf8"),e=P.Buffer.from(Ja(ao(r)),"utf8");return g0(o,e,2048,64,"sha512")})}at.mnemonicToSeed=A0;function $a(f,r){if(r=r||co,!r)throw new Error(Va);let o=ao(f).split(" ");if(o.length%3!==0)throw new Error(za);let e=o.map(A=>{let w=r.indexOf(A);if(w===-1)throw new Error(za);return qa(w.toString(2),"0",11)}).join(""),t=Math.floor(e.length/33)*32,n=e.slice(0,t),l=e.slice(t),c=n.match(/(.{1,8})/g).map(Ha);if(c.length<16)throw new Error(lr);if(c.length>32)throw new Error(lr);if(c.length%4!==0)throw new Error(lr);let u=P.Buffer.from(c);if(Ka(u)!==l)throw new Error(w0);return u.toString("hex")}at.mnemonicToEntropy=$a;function Za(f,r){if(P.Buffer.isBuffer(f)||(f=P.Buffer.from(f,"hex")),r=r||co,!r)throw new Error(Va);if(f.length<16)throw new TypeError(lr);if(f.length>32)throw new TypeError(lr);if(f.length%4!==0)throw new TypeError(lr);let o=Wa(Array.from(f)),e=Ka(f),l=(o+e).match(/(.{1,11})/g).map(c=>{let u=Ha(c);return r[u]});return r[0]==="\u3042\u3044\u3053\u304F\u3057\u3093"?l.join("\u3000"):l.join(" ")}at.entropyToMnemonic=Za;function O0(f,r,o){if(f=f||128,f%32!==0)throw new TypeError(lr);return r=r||Da.randomBytes,Za(r(f/8),o)}at.generateMnemonic=O0;function S0(f,r){try{$a(f,r)}catch{return!1}return!0}at.validateMnemonic=S0;function m0(f){let r=ei.wordlists[f];if(r)co=r;else throw new Error('Could not find wordlist for language "'+f+'"')}at.setDefaultWordlist=m0;function I0(){if(!co)throw new Error("No Default Wordlist set");return Object.keys(ei.wordlists).filter(f=>f==="JA"||f==="EN"?!1:ei.wordlists[f].every((r,o)=>r===co[o]))[0]}at.getDefaultWordlist=I0;var B0=_l();Object.defineProperty(at,"wordlists",{enumerable:!0,get:function(){return B0.wordlists}})});var Ga=$(Nt=>{"use strict";C();F();Object.defineProperty(Nt,"__esModule",{value:!0});Nt.unpadBuffer=Nt.stripZeros=Nt.setLengthRight=Nt.setLengthLeft=Nt.zeros=Nt.assertIsBuffer=void 0;var x0=function(f){if(!P.Buffer.isBuffer(f)){let r=`This method only supports Buffer but input was: ${f}`;throw new Error(r)}};Nt.assertIsBuffer=x0;var N0=function(f){return P.Buffer.allocUnsafe(f).fill(0)};Nt.zeros=N0;var Xa=function(f,r,o){let e=(0,Nt.zeros)(r);return o?f.length<r?(f.copy(e),e):f.slice(0,r):f.length<r?(f.copy(e,r-f.length),e):f.slice(-r)},k0=function(f,r){return P.Buffer.isBuffer(f)||(f=P.Buffer.from(f)),Xa(f,r,!1)};Nt.setLengthLeft=k0;var T0=function(f,r){return P.Buffer.isBuffer(f)||(f=P.Buffer.from(f)),Xa(f,r,!0)};Nt.setLengthRight=T0;var L0=function(f){let r=f[0];for(;f.length>0&&r.toString()==="0";)f=f.slice(1),r=f[0];return f};Nt.stripZeros=L0;var P0=function(f){return P.Buffer.isBuffer(f)||(f=P.Buffer.from(f)),(0,Nt.stripZeros)(f)};Nt.unpadBuffer=P0});var ti=$(Pe=>{"use strict";C();F();Object.defineProperty(Pe,"__esModule",{value:!0});Pe.isHexString=Pe.getKeys=Pe.fromAscii=Pe.fromUtf8=Pe.toAscii=Pe.arrayContainsArray=Pe.getBinarySize=Pe.padToEven=Pe.stripHexPrefix=Pe.isHexPrefixed=void 0;function Ya(f){if(typeof f!="string")throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof f}`);return f[0]==="0"&&f[1]==="x"}Pe.isHexPrefixed=Ya;var E0=f=>{if(typeof f!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof f}`);return Ya(f)?f.slice(2):f};Pe.stripHexPrefix=E0;function Qa(f){let r=f;if(typeof r!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof r}`);return r.length%2&&(r=`0${r}`),r}Pe.padToEven=Qa;function C0(f){if(typeof f!="string")throw new Error(`[getBinarySize] method requires input type 'string', received ${typeof f}`);return P.Buffer.byteLength(f,"utf8")}Pe.getBinarySize=C0;function F0(f,r,o){if(Array.isArray(f)!==!0)throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof f}'`);if(Array.isArray(r)!==!0)throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof r}'`);return r[o===!0?"some":"every"](e=>f.indexOf(e)>=0)}Pe.arrayContainsArray=F0;function M0(f){let r="",o=0,e=f.length;for(f.substring(0,2)==="0x"&&(o=2);o<e;o+=2){let t=parseInt(f.substr(o,2),16);r+=String.fromCharCode(t)}return r}Pe.toAscii=M0;function _0(f){let r=P.Buffer.from(f,"utf8");return`0x${Qa(r.toString("hex")).replace(/^0+|0+$/g,"")}`}Pe.fromUtf8=_0;function z0(f){let r="";for(let o=0;o<f.length;o++){let t=f.charCodeAt(o).toString(16);r+=t.length<2?`0${t}`:t}return`0x${r}`}Pe.fromAscii=z0;function D0(f,r,o){if(!Array.isArray(f))throw new Error(`[getKeys] method expects input 'params' to be an array, got ${typeof f}`);if(typeof r!="string")throw new Error(`[getKeys] method expects input 'key' to be type 'string', got ${typeof f}`);let e=[];for(let t=0;t<f.length;t++){let n=f[t][r];if(o===!0&&!n)n="";else if(typeof n!="string")throw new Error(`invalid abi - expected type 'string', received ${typeof n}`);e.push(n)}return e}Pe.getKeys=D0;function U0(f,r){return!(typeof f!="string"||!f.match(/^0x[0-9A-Fa-f]*$/)||typeof r<"u"&&r>0&&f.length!==2+2*r)}Pe.isHexString=U0});var ja=$(yn=>{"use strict";C();F();Object.defineProperty(yn,"__esModule",{value:!0});yn.assertIsString=yn.assertIsArray=yn.assertIsBuffer=yn.assertIsHexString=void 0;var R0=ti(),V0=function(f){if(!(0,R0.isHexString)(f)){let r=`This method only supports 0x-prefixed hex strings but input was: ${f}`;throw new Error(r)}};yn.assertIsHexString=V0;var q0=function(f){if(!P.Buffer.isBuffer(f)){let r=`This method only supports Buffer but input was: ${f}`;throw new Error(r)}};yn.assertIsBuffer=q0;var H0=function(f){if(!Array.isArray(f)){let r=`This method only supports number arrays but input was: ${f}`;throw new Error(r)}};yn.assertIsArray=H0;var W0=function(f){if(typeof f!="string"){let r=`This method only supports strings but input was: ${f}`;throw new Error(r)}};yn.assertIsString=W0});var ru=$(Y=>{"use strict";C();F();Object.defineProperty(Y,"__esModule",{value:!0});Y.intToUnpaddedBuffer=Y.bigIntToUnpaddedBuffer=Y.bigIntToHex=Y.bufArrToArr=Y.arrToBufArr=Y.validateNoLeadingZeroes=Y.baToJSON=Y.toUtf8=Y.short=Y.addHexPrefix=Y.toUnsigned=Y.fromSigned=Y.bufferToInt=Y.bigIntToBuffer=Y.bufferToBigInt=Y.bufferToHex=Y.toBuffer=Y.unpadHexString=Y.unpadArray=Y.unpadBuffer=Y.setLengthRight=Y.setLengthLeft=Y.zeros=Y.intToBuffer=Y.intToHex=void 0;var uo=ja(),fr=ti(),K0=function(f){if(!Number.isSafeInteger(f)||f<0)throw new Error(`Received an invalid integer type: ${f}`);return`0x${f.toString(16)}`};Y.intToHex=K0;var J0=function(f){let r=(0,Y.intToHex)(f);return P.Buffer.from((0,fr.padToEven)(r.slice(2)),"hex")};Y.intToBuffer=J0;var $0=function(f){return P.Buffer.allocUnsafe(f).fill(0)};Y.zeros=$0;var eu=function(f,r,o){let e=(0,Y.zeros)(r);return o?f.length<r?(f.copy(e),e):f.slice(0,r):f.length<r?(f.copy(e,r-f.length),e):f.slice(-r)},Z0=function(f,r){return(0,uo.assertIsBuffer)(f),eu(f,r,!1)};Y.setLengthLeft=Z0;var X0=function(f,r){return(0,uo.assertIsBuffer)(f),eu(f,r,!0)};Y.setLengthRight=X0;var Dl=function(f){let r=f[0];for(;f.length>0&&r.toString()==="0";)f=f.slice(1),r=f[0];return f},G0=function(f){return(0,uo.assertIsBuffer)(f),Dl(f)};Y.unpadBuffer=G0;var Y0=function(f){return(0,uo.assertIsArray)(f),Dl(f)};Y.unpadArray=Y0;var Q0=function(f){return(0,uo.assertIsHexString)(f),f=(0,fr.stripHexPrefix)(f),"0x"+Dl(f)};Y.unpadHexString=Q0;var j0=function(f){if(f==null)return P.Buffer.allocUnsafe(0);if(P.Buffer.isBuffer(f))return P.Buffer.from(f);if(Array.isArray(f)||f instanceof Uint8Array)return P.Buffer.from(f);if(typeof f=="string"){if(!(0,fr.isHexString)(f))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${f}`);return P.Buffer.from((0,fr.padToEven)((0,fr.stripHexPrefix)(f)),"hex")}if(typeof f=="number")return(0,Y.intToBuffer)(f);if(typeof f=="bigint"){if(f<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${f}`);let r=f.toString(16);return r.length%2&&(r="0"+r),P.Buffer.from(r,"hex")}if(f.toArray)return P.Buffer.from(f.toArray());if(f.toBuffer)return P.Buffer.from(f.toBuffer());throw new Error("invalid type")};Y.toBuffer=j0;var ey=function(f){return f=(0,Y.toBuffer)(f),"0x"+f.toString("hex")};Y.bufferToHex=ey;function Ul(f){let r=(0,Y.bufferToHex)(f);return BigInt(r==="0x"?0:r)}Y.bufferToBigInt=Ul;function Rl(f){return(0,Y.toBuffer)("0x"+f.toString(16))}Y.bigIntToBuffer=Rl;var ty=function(f){let r=Number(Ul(f));if(!Number.isSafeInteger(r))throw new Error("Number exceeds 53 bits");return r};Y.bufferToInt=ty;var ny=function(f){return BigInt.asIntN(256,Ul(f))};Y.fromSigned=ny;var ry=function(f){return Rl(BigInt.asUintN(256,f))};Y.toUnsigned=ry;var oy=function(f){return typeof f!="string"||(0,fr.isHexPrefixed)(f)?f:"0x"+f};Y.addHexPrefix=oy;function iy(f,r=50){let o=P.Buffer.isBuffer(f)?f.toString("hex"):f;return o.length<=r?o:o.slice(0,r)+"\u2026"}Y.short=iy;var ly=function(f){let r=/^(00)+|(00)+$/g;if(f=(0,fr.stripHexPrefix)(f),f.length%2!==0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return P.Buffer.from(f.replace(r,""),"hex").toString("utf8")};Y.toUtf8=ly;var fy=function(f){if(P.Buffer.isBuffer(f))return`0x${f.toString("hex")}`;if(f instanceof Array){let r=[];for(let o=0;o<f.length;o++)r.push((0,Y.baToJSON)(f[o]));return r}};Y.baToJSON=fy;var cy=function(f){for(let[r,o]of Object.entries(f))if(o!==void 0&&o.length>0&&o[0]===0)throw new Error(`${r} cannot have leading zeroes, received: ${o.toString("hex")}`)};Y.validateNoLeadingZeroes=cy;function tu(f){return Array.isArray(f)?f.map(r=>tu(r)):P.Buffer.from(f)}Y.arrToBufArr=tu;function nu(f){return Array.isArray(f)?f.map(r=>nu(r)):Uint8Array.from(f??[])}Y.bufArrToArr=nu;var ay=f=>"0x"+f.toString(16);Y.bigIntToHex=ay;function uy(f){return(0,Y.unpadBuffer)(Rl(f))}Y.bigIntToUnpaddedBuffer=uy;function dy(f){return(0,Y.unpadBuffer)((0,Y.intToBuffer)(f))}Y.intToUnpaddedBuffer=dy});var fu=$((yv,lu)=>{"use strict";C();F();var ni=Ga(),Dr=tr(),_t=pt(),{isHexString:sy,stripHexPrefix:hy,padToEven:py}=ti(),{intToBuffer:yy,addHexPrefix:by,bufferToHex:wy}=ru(),Be=function(){};function ri(f){return f.startsWith("int[")?"int256"+f.slice(3):f==="int"?"int256":f.startsWith("uint[")?"uint256"+f.slice(4):f==="uint"?"uint256":f.startsWith("fixed[")?"fixed128x128"+f.slice(5):f==="fixed"?"fixed128x128":f.startsWith("ufixed[")?"ufixed128x128"+f.slice(6):f==="ufixed"?"ufixed128x128":f}function Vl(f){if(f==null)return P.Buffer.allocUnsafe(0);if(P.Buffer.isBuffer(f))return P.Buffer.from(f);if(Array.isArray(f)||f instanceof Uint8Array)return P.Buffer.from(f);if(typeof f=="string"){if(!sy(f))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${f}`);return P.Buffer.from(py(hy(f)),"hex")}if(typeof f=="number")return yy(f);if(typeof f=="bigint"){if(f<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${f}`);let r=f.toString(16);return r.length%2&&(r="0"+r),P.Buffer.from(r,"hex")}if(f.toArray)return P.Buffer.from(f.toArray());if(f.toBuffer)return P.Buffer.from(f.toBuffer());throw new Error("invalid type")}function gy(f){if(!!f){if(typeof f=="number"){if(f<0)return"0x";let r=Vl(f);f=wy(r)}if(typeof f!="string"){let r="eth-sig-util.normalize() requires hex string or integer input.";throw r+=` received ${typeof f}: ${f}`,new Error(r)}return by(f.toLowerCase())}}Be.eventID=function(f,r){var o=f+"("+r.map(ri).join(",")+")";return Dr.keccak256(P.Buffer.from(o))};Be.methodID=function(f,r){return Be.eventID(f,r).slice(0,4)};function qn(f){return parseInt(/^\D+(\d+)$/.exec(f)[1],10)}function ql(f){var r=/^\D+(\d+)x(\d+)$/.exec(f);return[parseInt(r[1],10),parseInt(r[2],10)]}function ho(f){var r=f.match(/(.*)\[(.*?)\]$/);return r?r[2]===""?"dynamic":parseInt(r[2],10):null}function cr(f){var r=typeof f;if(r==="string")return Dr.isHexPrefixed(f)?new _t(Dr.stripHexPrefix(f),16):new _t(f,10);if(r==="number")return new _t(f);if(f.toArray)return f;throw new Error("Argument is not a number")}function iu(f){var r=/^(\w+)\((.*)\)$/.exec(f);if(r.length!==3)throw new Error("Invalid method signature");var o=/^(.+)\):\((.+)$/.exec(r[2]);if(o!==null&&o.length===3)return{method:r[1],args:o[1].split(","),retargs:o[2].split(",")};var e=r[2].split(",");return e.length===1&&e[0]===""&&(e=[]),{method:r[1],args:e}}function bn(f,r){var o,e,t,n;if(f==="address")return bn("uint160",cr(r));if(f==="bool")return bn("uint8",r?1:0);if(f==="string")return bn("bytes",P.Buffer.from(r,"utf8"));if(so(f)){if(typeof r.length>"u")throw new Error("Not an array?");if(o=ho(f),o!=="dynamic"&&o!==0&&r.length>o)throw new Error("Elements exceed array size: "+o);t=[],f=f.slice(0,f.lastIndexOf("[")),typeof r=="string"&&(r=JSON.parse(r));for(n in r)t.push(bn(f,r[n]));if(o==="dynamic"){var l=bn("uint256",r.length);t.unshift(l)}return P.Buffer.concat(t)}else{if(f==="bytes")return r=P.Buffer.from(r),t=P.Buffer.concat([bn("uint256",r.length),r]),r.length%32!==0&&(t=P.Buffer.concat([t,ni.zeros(32-r.length%32)])),t;if(f.startsWith("bytes")){if(o=qn(f),o<1||o>32)throw new Error("Invalid bytes<N> width: "+o);return ni.setLengthRight(r,32)}else if(f.startsWith("uint")){if(o=qn(f),o%8||o<8||o>256)throw new Error("Invalid uint<N> width: "+o);if(e=cr(r),e.bitLength()>o)throw new Error("Supplied uint exceeds width: "+o+" vs "+e.bitLength());if(e<0)throw new Error("Supplied uint is negative");return e.toArrayLike(P.Buffer,"be",32)}else if(f.startsWith("int")){if(o=qn(f),o%8||o<8||o>256)throw new Error("Invalid int<N> width: "+o);if(e=cr(r),e.bitLength()>o)throw new Error("Supplied int exceeds width: "+o+" vs "+e.bitLength());return e.toTwos(256).toArrayLike(P.Buffer,"be",32)}else if(f.startsWith("ufixed")){if(o=ql(f),e=cr(r),e<0)throw new Error("Supplied ufixed is negative");return bn("uint256",e.mul(new _t(2).pow(new _t(o[1]))))}else if(f.startsWith("fixed"))return o=ql(f),bn("int256",cr(r).mul(new _t(2).pow(new _t(o[1]))))}throw new Error("Unsupported or invalid type: "+f)}function jt(f,r,o){typeof f=="string"&&(f=Hl(f));var e,t,n,l;if(f.name==="address")return jt(f.rawType,r,o).toArrayLike(P.Buffer,"be",20).toString("hex");if(f.name==="bool")return jt(f.rawType,r,o).toString()===new _t(1).toString();if(f.name==="string"){var c=jt(f.rawType,r,o);return P.Buffer.from(c,"utf8").toString()}else if(f.isArray){for(n=[],e=f.size,f.size==="dynamic"&&(o=jt("uint256",r,o).toNumber(),e=jt("uint256",r,o).toNumber(),o=o+32),l=0;l<e;l++){var u=jt(f.subArray,r,o);n.push(u),o+=f.subArray.memoryUsage}return n}else{if(f.name==="bytes")return o=jt("uint256",r,o).toNumber(),e=jt("uint256",r,o).toNumber(),r.slice(o+32,o+32+e);if(f.name.startsWith("bytes"))return r.slice(o,o+f.size);if(f.name.startsWith("uint")){if(t=new _t(r.slice(o,o+32),16,"be"),t.bitLength()>f.size)throw new Error("Decoded int exceeds width: "+f.size+" vs "+t.bitLength());return t}else if(f.name.startsWith("int")){if(t=new _t(r.slice(o,o+32),16,"be").fromTwos(256),t.bitLength()>f.size)throw new Error("Decoded uint exceeds width: "+f.size+" vs "+t.bitLength());return t}else if(f.name.startsWith("ufixed")){if(e=new _t(2).pow(new _t(f.size[1])),t=jt("uint256",r,o),!t.mod(e).isZero())throw new Error("Decimals not supported yet");return t.div(e)}else if(f.name.startsWith("fixed")){if(e=new _t(2).pow(new _t(f.size[1])),t=jt("int256",r,o),!t.mod(e).isZero())throw new Error("Decimals not supported yet");return t.div(e)}}throw new Error("Unsupported or invalid type: "+f.name)}function Hl(f){var r,o;if(so(f)){r=ho(f);var e=f.slice(0,f.lastIndexOf("["));return e=Hl(e),o={isArray:!0,name:f,size:r,memoryUsage:r==="dynamic"?32:e.memoryUsage*r,subArray:e},o}else{var t;switch(f){case"address":t="uint160";break;case"bool":t="uint8";break;case"string":t="bytes";break}if(o={rawType:t,name:f,memoryUsage:32},f.startsWith("bytes")&&f!=="bytes"||f.startsWith("uint")||f.startsWith("int")?o.size=qn(f):(f.startsWith("ufixed")||f.startsWith("fixed"))&&(o.size=ql(f)),f.startsWith("bytes")&&f!=="bytes"&&(o.size<1||o.size>32))throw new Error("Invalid bytes<N> width: "+o.size);if((f.startsWith("uint")||f.startsWith("int"))&&(o.size%8||o.size<8||o.size>256))throw new Error("Invalid int/uint<N> width: "+o.size);return o}}function vy(f){return f==="string"||f==="bytes"||ho(f)==="dynamic"}function so(f){return f.lastIndexOf("]")===f.length-1}Be.rawEncode=function(f,r){var o=[],e=[],t=0;f.forEach(function(b){if(so(b)){var A=ho(b);A!=="dynamic"?t+=32*A:t+=32}else t+=32});for(var n=0;n<f.length;n++){var l=ri(f[n]),c=r[n],u=bn(l,c);vy(l)?(o.push(bn("uint256",t)),e.push(u),t+=u.length):o.push(u)}return P.Buffer.concat(o.concat(e))};Be.rawDecode=function(f,r){var o=[];r=P.Buffer.from(r);for(var e=0,t=0;t<f.length;t++){var n=ri(f[t]),l=Hl(n,r,e),c=jt(l,r,e);e+=l.memoryUsage,o.push(c)}return o};Be.simpleEncode=function(f){var r=Array.prototype.slice.call(arguments).slice(1),o=iu(f);if(r.length!==o.args.length)throw new Error("Argument count mismatch");return P.Buffer.concat([Be.methodID(o.method,o.args),Be.rawEncode(o.args,r)])};Be.simpleDecode=function(f,r){var o=iu(f);if(!o.retargs)throw new Error("No return values in method");return Be.rawDecode(o.retargs,r)};function ou(f,r){return f.startsWith("address")||f.startsWith("bytes")?"0x"+r.toString("hex"):r.toString()}Be.stringify=function(f,r){var o=[];for(var e in f){var t=f[e],n=r[e];/^[^\[]+\[.*\]$/.test(t)?n=n.map(function(l){return ou(t,l)}).join(", "):n=ou(t,n),o.push(n)}return o};Be.solidityHexValue=function(f,r,o){var e,t;if(so(f)){var n=f.replace(/\[.*?\]/,"");if(!so(n)){var l=ho(f);if(l!=="dynamic"&&l!==0&&r.length>l)throw new Error("Elements exceed array size: "+l)}var c=r.map(function(A){return Be.solidityHexValue(n,A,256)});return P.Buffer.concat(c)}else{if(f==="bytes")return r;if(f==="string")return P.Buffer.from(r,"utf8");if(f==="bool"){o=o||8;var u=Array(o/4).join("0");return P.Buffer.from(r?u+"1":u+"0","hex")}else if(f==="address"){var b=20;return o&&(b=o/8),ni.setLengthLeft(Vl(r),b)}else if(f.startsWith("bytes")){if(e=qn(f),e<1||e>32)throw new Error("Invalid bytes<N> width: "+e);return typeof r=="number"&&(r=gy(r)),ni.setLengthRight(Vl(r),e)}else if(f.startsWith("uint")){if(e=qn(f),e%8||e<8||e>256)throw new Error("Invalid uint<N> width: "+e);if(t=cr(r),t.bitLength()>e)throw new Error("Supplied uint exceeds width: "+e+" vs "+t.bitLength());return o=o||e,t.toArrayLike(P.Buffer,"be",o/8)}else if(f.startsWith("int")){if(e=qn(f),e%8||e<8||e>256)throw new Error("Invalid int<N> width: "+e);if(t=cr(r),t.bitLength()>e)throw new Error("Supplied int exceeds width: "+e+" vs "+t.bitLength());return o=o||e,t.toTwos(e).toArrayLike(P.Buffer,"be",o/8)}else throw new Error("Unsupported or invalid type: "+f)}};Be.solidityPack=function(f,r){if(f.length!==r.length)throw new Error("Number of types are not matching the values");for(var o=[],e=0;e<f.length;e++){var t=ri(f[e]),n=r[e];o.push(Be.solidityHexValue(t,n,null))}return P.Buffer.concat(o)};Be.soliditySHA3=function(f,r){return Dr.keccak256(Be.solidityPack(f,r))};Be.soliditySHA256=function(f,r){return Dr.sha256(Be.solidityPack(f,r))};Be.solidityRIPEMD160=function(f,r){return Dr.ripemd160(Be.solidityPack(f,r),!0)};function Ay(f){return f>="0"&&f<="9"}Be.fromSerpent=function(f){for(var r=[],o=0;o<f.length;o++){var e=f[o];if(e==="s")r.push("bytes");else if(e==="b"){for(var t="bytes",n=o+1;n<f.length&&Ay(f[n]);)t+=f[n]-"0",n++;o=n-1,r.push(t)}else if(e==="i")r.push("int256");else if(e==="a")r.push("int256[]");else throw new Error("Unsupported or invalid type: "+e)}return r};Be.toSerpent=function(f){for(var r=[],o=0;o<f.length;o++){var e=f[o];if(e==="bytes")r.push("s");else if(e.startsWith("bytes"))r.push("b"+qn(e));else if(e==="int256")r.push("i");else if(e==="int256[]")r.push("a");else throw new Error("Unsupported or invalid type: "+e)}return r.join("")};lu.exports=Be});var cu=$(Hn=>{"use strict";C();F();Object.defineProperty(Hn,"__esModule",{value:!0});Hn.SoliditySHA3=Hn.RawEncode=Hn.ABI=void 0;var Wl=fu();Hn.ABI=Wl;function Oy(f,r){return Wl.rawEncode(f,r)}Hn.RawEncode=Oy;function Sy(f,r){return Wl.soliditySHA3(f,r)}Hn.SoliditySHA3=Sy});var pu=$(de=>{"use strict";C();F();var my=de&&de.__createBinding||(Object.create?function(f,r,o,e){e===void 0&&(e=o);var t=Object.getOwnPropertyDescriptor(r,o);(!t||("get"in t?!r.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(f,e,t)}:function(f,r,o,e){e===void 0&&(e=o),f[e]=r[o]}),Iy=de&&de.__setModuleDefault||(Object.create?function(f,r){Object.defineProperty(f,"default",{enumerable:!0,value:r})}:function(f,r){f.default=r}),By=de&&de.__importStar||function(f){if(f&&f.__esModule)return f;var r={};if(f!=null)for(var o in f)o!=="default"&&Object.prototype.hasOwnProperty.call(f,o)&&my(r,f,o);return Iy(r,f),r},xy=de&&de.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(de,"__esModule",{value:!0});de.loadUncompressedPublicKey=de.loadCompressedPublicKey=de.publicKeyConvert=de.publicKeyCreate=de.publicKeyVerify=de.privateKeyVerify=de.loadPublicKey=de.recover=de.verifyWithNoRecovery=de.verify=de.getV=de.sign=void 0;var Ny=By(zr()),yt=new Ny.ec("secp256k1"),au=tr(),Ur=xy(pt());function ky(f,r,o=!0){let e=yt.sign(Array.from(f),P.Buffer.from(r),{canonical:o});return{signature:e.toBytes(),recovery:e.recoveryParam}}de.sign=ky;function Ty(f,r,o,e,t=!0){let n=po(e);if(n==null)throw new Error("pubkey error");let l=yt.keyPair({pub:{x:n.x,y:n.y}}).getPublic();return yt.getKeyRecoveryParam(f,{r,s:o},l,t)}de.getV=Ty;function Ly(f,r,o,e){let t=uu(r,o,f,!0);if(t==null)return!1;let n=du(e,!0);return n==null?!1:t.equals(n)}de.verify=Ly;function Py(f,r,o){let e=po(o);if(e==null)throw new Error("pubkey error");let t=yt.keyPair({pub:{x:e.x,y:e.y}}),n={r:(0,au.toHex)(r.slice(0,32)),s:(0,au.toHex)(r.slice(32,64))};return t.verify(f,n)}de.verifyWithNoRecovery=Py;function uu(f,r,o,e){let t={r:Array.from(f.slice(0,32)),s:Array.from(f.slice(32,64))},n=new Ur.default(t.r),l=new Ur.default(t.s);if(n.cmp(yt.curve.n)>=0||l.cmp(yt.curve.n)>=0||n.isZero()||l.isZero())return null;let c;try{c=yt.recoverPubKey(Array.from(o),t,r,null)}catch{return null}return P.Buffer.from(c.encode(null,e))}de.recover=uu;function po(f){let r=P.Buffer.from(f),o=r[0];switch(o){case 2:case 3:return r.length!==33?null:su(o,r.subarray(1,33));case 4:case 6:case 7:return r.length!==65?null:hu(o,r.subarray(1,33),r.subarray(33,65));default:return null}}de.loadPublicKey=po;function Ey(f){let r=new Ur.default(Array.from(f));return r.cmp(yt.curve.n)<0&&!r.isZero()}de.privateKeyVerify=Ey;function Cy(f){return po(f)!==null}de.publicKeyVerify=Cy;function Fy(f,r){let o=yt.keyFromPrivate(Array.from(f),"bytes").getPublic();return P.Buffer.from(o.encode(null,r))}de.publicKeyCreate=Fy;function du(f,r){let o=po(f);if(o==null)return null;let e=yt.keyPair({pub:{x:o.x,y:o.y}}).getPublic();return P.Buffer.from(e.encode(null,r))}de.publicKeyConvert=du;function su(f,r){let o=new Ur.default(Array.from(r));if(o.cmp(yt.curve.p)>=0)return null;let e=o.toRed(yt.curve.red),t=e.redSqr().redIMul(e).redIAdd(yt.curve.b).redSqrt();f===3!==t.isOdd()&&(t=t.redNeg());let n=e.redSqr().redIMul(e);return t.redSqr().redISub(n.redIAdd(yt.curve.b)).isZero()?{x:e,y:t}:null}de.loadCompressedPublicKey=su;function hu(f,r,o){let e=new Ur.default(Array.from(r)),t=new Ur.default(Array.from(o));if(e.cmp(yt.curve.p)>=0||t.cmp(yt.curve.p)>=0)return null;let n=e.toRed(yt.curve.red),l=t.toRed(yt.curve.red);if((f===6||f===7)&&l.isOdd()!==(f===7))return null;let c=n.redSqr().redIMul(n);return l.redSqr().redISub(c.redIAdd(yt.curve.b)).isZero()?{x:n,y:l}:null}de.loadUncompressedPublicKey=hu});var Su=$(ue=>{"use strict";C();F();var My=ue&&ue.__createBinding||(Object.create?function(f,r,o,e){e===void 0&&(e=o);var t=Object.getOwnPropertyDescriptor(r,o);(!t||("get"in t?!r.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(f,e,t)}:function(f,r,o,e){e===void 0&&(e=o),f[e]=r[o]}),_y=ue&&ue.__setModuleDefault||(Object.create?function(f,r){Object.defineProperty(f,"default",{enumerable:!0,value:r})}:function(f,r){f.default=r}),zy=ue&&ue.__importStar||function(f){if(f&&f.__esModule)return f;var r={};if(f!=null)for(var o in f)o!=="default"&&Object.prototype.hasOwnProperty.call(f,o)&&My(r,f,o);return _y(r,f),r},Dy=ue&&ue.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(ue,"__esModule",{value:!0});ue.ed25519_getDerivedPrivateKey=ue.isValidPath=ue.ed25519_getRandomPrivateKey=ue.ed25519SignTest=ue.fromSecret=ue.fromSeed=ue.privateKeyVerify=ue.publicKeyVerify=ue.publicKeyCreate=ue.verify=ue.sign=ue.ed25519MulBase=void 0;var yu=zy(zr()),en=tr(),Uy=Dy(pt()),Ry=zl(),Sn=new yu.eddsa("ed25519"),bu=Sn.curve;function Vy(f){let r=Sn.curve.g;return Sn.encodePoint(r.mul(yu.utils.intFromLE(f)))}ue.ed25519MulBase=Vy;function wu(f,r){let o=r;o.length==64&&(o=o.slice(0,32));let t=Sn.keyFromSecret(Array.from(o)).sign(Array.from(f)).toBytes();return Uint8Array.from(t)}ue.sign=wu;function gu(f,r,o){return Sn.keyFromPublic(Array.from(o)).verify(Array.from(f),Array.from(r))}ue.verify=gu;function oi(f){let r=f;r.length==64&&(r=r.slice(0,32));let e=Sn.keyFromSecret(Array.from(r)).getPublic();if(f.length==64&&!qy(f.slice(32,64),e))throw new Error("invalid public key");return Uint8Array.from(e)}ue.publicKeyCreate=oi;function qy(f,r){if(f.length!==r.length)return!1;for(let o=0;o<f.length;o++)if(f[o]!==r[o])return!1;return!0}function Hy(f){let r=Sn.decodePoint(Array.from(f));return bu.validate(r)}ue.publicKeyVerify=Hy;function vu(f){let r=new Uy.default(Array.from(f));return r.cmp(bu.n)<0&&!r.isZero()}ue.privateKeyVerify=vu;function Wy(f){let r=Sn.keyFromSecret(Array.from(f)),o=Uint8Array.from(r.getPublic());return{publicKey:o,secretKey:(0,en.concatBytes)(f,o)}}ue.fromSeed=Wy;function Ky(f){let r=f.slice(0,32),o=Sn.keyFromSecret(Array.from(r));return{publicKey:Uint8Array.from(o.getPublic()),secretKey:Uint8Array.from(r)}}ue.fromSecret=Ky;function Au(f){let r=(0,en.sha256)("ed25519-test"),o=oi(f),e=wu(r,f);return gu(r,e,o)}ue.ed25519SignTest=Au;function Jy(f,r){for(;;){let o=(0,en.randomBytes)(32);if(vu(o)&&Au(o)){let e=oi(o),t=f?(0,en.concatBytes)(o,e):o;return r==="base58"?(0,en.toBase58)(t):(0,en.toHex)(t)}}}ue.ed25519_getRandomPrivateKey=Jy;var $y=new RegExp("^m(\\/[0-9]+')+$"),Ou=f=>f.replace("'",""),Zy=2147483648;function Xy(f){let r=(0,en.hmacSHA512)("ed25519 seed",f),o=r.slice(0,32),e=r.slice(32);return{key:o,chainCode:e}}function Gy({key:f,chainCode:r},o){let e=P.Buffer.allocUnsafe(4);e.writeUInt32BE(o,0);let t=P.Buffer.concat([P.Buffer.alloc(1,0),f,e]),n=(0,en.hmacSHA512)(r,t),l=n.slice(0,32),c=n.slice(32);return{key:l,chainCode:c}}var Yy=f=>$y.test(f)?!f.split("/").slice(1).map(Ou).some(isNaN):!1;ue.isValidPath=Yy;function Qy(f,r,o=Zy){if(!(0,ue.isValidPath)(f))throw new Error("Invalid derivation path");let{key:e,chainCode:t}=Xy(r);return f.split("/").slice(1).map(Ou).map(l=>parseInt(l,10)).reduce((l,c)=>Gy(l,c+o),{key:e,chainCode:t})}async function jy(f,r,o,e){let t=await(0,Ry.mnemonicToSeed)(f),n=Qy(r,t).key,l=oi(n),c=o?(0,en.concatBytes)(n,l):n;return e==="base58"?Promise.resolve((0,en.toBase58)(c)):Promise.resolve((0,en.toHex)(c))}ue.ed25519_getDerivedPrivateKey=jy});var xu=$(ge=>{"use strict";C();F();var eb=ge&&ge.__createBinding||(Object.create?function(f,r,o,e){e===void 0&&(e=o);var t=Object.getOwnPropertyDescriptor(r,o);(!t||("get"in t?!r.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(f,e,t)}:function(f,r,o,e){e===void 0&&(e=o),f[e]=r[o]}),tb=ge&&ge.__setModuleDefault||(Object.create?function(f,r){Object.defineProperty(f,"default",{enumerable:!0,value:r})}:function(f,r){f.default=r}),nb=ge&&ge.__importStar||function(f){if(f&&f.__esModule)return f;var r={};if(f!=null)for(var o in f)o!=="default"&&Object.prototype.hasOwnProperty.call(f,o)&&eb(r,f,o);return tb(r,f),r},rb=ge&&ge.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(ge,"__esModule",{value:!0});ge.loadUncompressedPublicKey=ge.loadCompressedPublicKey=ge.publicKeyConvert=ge.publicKeyCreate=ge.publicKeyVerify=ge.privateKeyVerify=ge.loadPublicKey=ge.recover=ge.verify=ge.sign=void 0;var ob=nb(zr()),Ct=new ob.ec("p256"),Rr=rb(pt());function ib(f,r,o=!0){let e=Ct.sign(Array.from(f),P.Buffer.from(r),{canonical:o});return{signature:e.toBytes(),recovery:e.recoveryParam}}ge.sign=ib;function lb(f,r,o,e){let t=mu(r,o,f,!1);return t==null?!1:t.equals(e)}ge.verify=lb;function mu(f,r,o,e){let t={r:Array.from(f.slice(0,32)),s:Array.from(f.slice(32,64))},n=new Rr.default(t.r),l=new Rr.default(t.s);if(n.cmp(Ct.curve.n)>=0||l.cmp(Ct.curve.n)>=0||n.isZero()||l.isZero())return null;let c;try{c=Ct.recoverPubKey(Array.from(o),t,r,null)}catch{return null}return P.Buffer.from(c.encode(null,e))}ge.recover=mu;function Kl(f){let r=P.Buffer.from(f),o=r[0];switch(o){case 2:case 3:return r.length!==33?null:Iu(o,r.subarray(1,33));case 4:case 6:case 7:return r.length!==65?null:Bu(o,r.subarray(1,33),r.subarray(33,65));default:return null}}ge.loadPublicKey=Kl;function fb(f){let r=new Rr.default(Array.from(f));return r.cmp(Ct.curve.n)<0&&!r.isZero()}ge.privateKeyVerify=fb;function cb(f){return Kl(f)!==null}ge.publicKeyVerify=cb;function ab(f,r){let o=Ct.keyFromPrivate(Array.from(f),"bytes").getPublic();return P.Buffer.from(o.encode(null,r))}ge.publicKeyCreate=ab;function ub(f,r){let o=Kl(f);if(o==null)return null;let e=Ct.keyPair({pub:{x:o.x,y:o.y}}).getPublic();return P.Buffer.from(e.encode(null,r))}ge.publicKeyConvert=ub;function Iu(f,r){let o=new Rr.default(Array.from(r));if(o.cmp(Ct.curve.p)>=0)return null;let e=o.toRed(Ct.curve.red),t=e.redSqr().redIMul(e).redIAdd(Ct.curve.b).redSqrt();return f===3!==t.isOdd()&&(t=t.redNeg()),{x:e,y:t}}ge.loadCompressedPublicKey=Iu;function Bu(f,r,o){let e=new Rr.default(Array.from(r)),t=new Rr.default(Array.from(o));if(e.cmp(Ct.curve.p)>=0||t.cmp(Ct.curve.p)>=0)return null;let n=e.toRed(Ct.curve.red),l=t.toRed(Ct.curve.red);if((f===6||f===7)&&l.isOdd()!==(f===7))return null;let c=n.redSqr().redIMul(n);return l.redSqr().redISub(c.redIAdd(Ct.curve.b)).isZero()?{x:n,y:l}:null}ge.loadUncompressedPublicKey=Bu});var mn=$(le=>{"use strict";C();F();Object.defineProperty(le,"__esModule",{value:!0});le.validateObject=le.createHmacDrbg=le.bitMask=le.bitSet=le.bitGet=le.bitLen=le.utf8ToBytes=le.equalBytes=le.concatBytes=le.ensureBytes=le.numberToVarBytesBE=le.numberToBytesLE=le.numberToBytesBE=le.bytesToNumberLE=le.bytesToNumberBE=le.hexToBytes=le.hexToNumber=le.numberToHexUnpadded=le.bytesToHex=void 0;var ku=BigInt(0),ii=BigInt(1),db=BigInt(2),li=f=>f instanceof Uint8Array,sb=Array.from({length:256},(f,r)=>r.toString(16).padStart(2,"0"));function $l(f){if(!li(f))throw new Error("Uint8Array expected");let r="";for(let o=0;o<f.length;o++)r+=sb[f[o]];return r}le.bytesToHex=$l;function Tu(f){let r=f.toString(16);return r.length&1?`0${r}`:r}le.numberToHexUnpadded=Tu;function Zl(f){if(typeof f!="string")throw new Error("hex string expected, got "+typeof f);return BigInt(f===""?"0":`0x${f}`)}le.hexToNumber=Zl;function fi(f){if(typeof f!="string")throw new Error("hex string expected, got "+typeof f);if(f.length%2)throw new Error("hex string is invalid: unpadded "+f.length);let r=new Uint8Array(f.length/2);for(let o=0;o<r.length;o++){let e=o*2,t=f.slice(e,e+2),n=Number.parseInt(t,16);if(Number.isNaN(n)||n<0)throw new Error("invalid byte sequence");r[o]=n}return r}le.hexToBytes=fi;function hb(f){return Zl($l(f))}le.bytesToNumberBE=hb;function pb(f){if(!li(f))throw new Error("Uint8Array expected");return Zl($l(Uint8Array.from(f).reverse()))}le.bytesToNumberLE=pb;var yb=(f,r)=>fi(f.toString(16).padStart(r*2,"0"));le.numberToBytesBE=yb;var bb=(f,r)=>(0,le.numberToBytesBE)(f,r).reverse();le.numberToBytesLE=bb;var wb=f=>fi(Tu(f));le.numberToVarBytesBE=wb;function gb(f,r,o){let e;if(typeof r=="string")try{e=fi(r)}catch(n){throw new Error(`${f} must be valid hex string, got "${r}". Cause: ${n}`)}else if(li(r))e=Uint8Array.from(r);else throw new Error(`${f} must be hex string or Uint8Array`);let t=e.length;if(typeof o=="number"&&t!==o)throw new Error(`${f} expected ${o} bytes, got ${t}`);return e}le.ensureBytes=gb;function Lu(...f){let r=new Uint8Array(f.reduce((e,t)=>e+t.length,0)),o=0;return f.forEach(e=>{if(!li(e))throw new Error("Uint8Array expected");r.set(e,o),o+=e.length}),r}le.concatBytes=Lu;function vb(f,r){if(f.length!==r.length)return!1;for(let o=0;o<f.length;o++)if(f[o]!==r[o])return!1;return!0}le.equalBytes=vb;function Ab(f){if(typeof f!="string")throw new Error(`utf8ToBytes expected string, got ${typeof f}`);return new TextEncoder().encode(f)}le.utf8ToBytes=Ab;function Ob(f){let r;for(r=0;f>ku;f>>=ii,r+=1);return r}le.bitLen=Ob;var Sb=(f,r)=>f>>BigInt(r)ⅈle.bitGet=Sb;var mb=(f,r,o)=>f|(o?ii:ku)<<BigInt(r);le.bitSet=mb;var Ib=f=>(db<<BigInt(f-1))-ii;le.bitMask=Ib;var Jl=f=>new Uint8Array(f),Nu=f=>Uint8Array.from(f);function Bb(f,r,o){if(typeof f!="number"||f<2)throw new Error("hashLen must be a number");if(typeof r!="number"||r<2)throw new Error("qByteLen must be a number");if(typeof o!="function")throw new Error("hmacFn must be a function");let e=Jl(f),t=Jl(f),n=0,l=()=>{e.fill(1),t.fill(0),n=0},c=(...w)=>o(t,e,...w),u=(w=Jl())=>{t=c(Nu([0]),w),e=c(),w.length!==0&&(t=c(Nu([1]),w),e=c())},b=()=>{if(n++>=1e3)throw new Error("drbg: tried 1000 values");let w=0,B=[];for(;w<r;){e=c();let m=e.slice();B.push(m),w+=e.length}return Lu(...B)};return(w,B)=>{l(),u(w);let m;for(;!(m=B(b()));)u();return l(),m}}le.createHmacDrbg=Bb;var xb={bigint:f=>typeof f=="bigint",function:f=>typeof f=="function",boolean:f=>typeof f=="boolean",string:f=>typeof f=="string",isSafeInteger:f=>Number.isSafeInteger(f),array:f=>Array.isArray(f),field:(f,r)=>r.Fp.isValid(f),hash:f=>typeof f=="function"&&Number.isSafeInteger(f.outputLen)};function Nb(f,r,o={}){let e=(t,n,l)=>{let c=xb[n];if(typeof c!="function")throw new Error(`Invalid validator "${n}", expected function`);let u=f[t];if(!(l&&u===void 0)&&!c(u,f))throw new Error(`Invalid param ${String(t)}=${u} (${typeof u}), expected ${n}`)};for(let[t,n]of Object.entries(r))e(t,n,!1);for(let[t,n]of Object.entries(o))e(t,n,!0);return f}le.validateObject=Nb});var ar=$(ce=>{"use strict";C();F();Object.defineProperty(ce,"__esModule",{value:!0});ce.hashToPrivateScalar=ce.FpSqrtEven=ce.FpSqrtOdd=ce.Field=ce.nLength=ce.FpIsSquare=ce.FpDiv=ce.FpInvertBatch=ce.FpPow=ce.validateField=ce.isNegativeLE=ce.FpSqrt=ce.tonelliShanks=ce.invert=ce.pow2=ce.pow=ce.mod=void 0;var In=mn(),bt=BigInt(0),me=BigInt(1),Wn=BigInt(2),kb=BigInt(3),Xl=BigInt(4),Pu=BigInt(5),Eu=BigInt(8),Tb=BigInt(9),Lb=BigInt(16);function Kt(f,r){let o=f%r;return o>=bt?o:r+o}ce.mod=Kt;function Cu(f,r,o){if(o<=bt||r<bt)throw new Error("Expected power/modulo > 0");if(o===me)return bt;let e=me;for(;r>bt;)r&me&&(e=e*f%o),f=f*f%o,r>>=me;return e}ce.pow=Cu;function Pb(f,r,o){let e=f;for(;r-- >bt;)e*=e,e%=o;return e}ce.pow2=Pb;function ci(f,r){if(f===bt||r<=bt)throw new Error(`invert: expected positive integers, got n=${f} mod=${r}`);let o=Kt(f,r),e=r,t=bt,n=me,l=me,c=bt;for(;o!==bt;){let b=e/o,A=e%o,w=t-l*b,B=n-c*b;e=o,o=A,t=l,n=c,l=w,c=B}if(e!==me)throw new Error("invert: does not exist");return Kt(t,r)}ce.invert=ci;function Fu(f){let r=(f-me)/Wn,o,e,t;for(o=f-me,e=0;o%Wn===bt;o/=Wn,e++);for(t=Wn;t<f&&Cu(t,r,f)!==f-me;t++);if(e===1){let l=(f+me)/Xl;return function(u,b){let A=u.pow(b,l);if(!u.eql(u.sqr(A),b))throw new Error("Cannot find square root");return A}}let n=(o+me)/Wn;return function(c,u){if(c.pow(u,r)===c.neg(c.ONE))throw new Error("Cannot find square root");let b=e,A=c.pow(c.mul(c.ONE,t),o),w=c.pow(u,n),B=c.pow(u,o);for(;!c.eql(B,c.ONE);){if(c.eql(B,c.ZERO))return c.ZERO;let m=1;for(let O=c.sqr(B);m<b&&!c.eql(O,c.ONE);m++)O=c.sqr(O);let I=c.pow(A,me<<BigInt(b-m-1));A=c.sqr(I),w=c.mul(w,I),B=c.mul(B,A),b=m}return w}}ce.tonelliShanks=Fu;function Mu(f){if(f%Xl===kb){let r=(f+me)/Xl;return function(e,t){let n=e.pow(t,r);if(!e.eql(e.sqr(n),t))throw new Error("Cannot find square root");return n}}if(f%Eu===Pu){let r=(f-Pu)/Eu;return function(e,t){let n=e.mul(t,Wn),l=e.pow(n,r),c=e.mul(t,l),u=e.mul(e.mul(c,Wn),l),b=e.mul(c,e.sub(u,e.ONE));if(!e.eql(e.sqr(b),t))throw new Error("Cannot find square root");return b}}return f%Lb,Fu(f)}ce.FpSqrt=Mu;var Eb=(f,r)=>(Kt(f,r)&me)===me;ce.isNegativeLE=Eb;var Cb=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Fb(f){let r={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},o=Cb.reduce((e,t)=>(e[t]="function",e),r);return(0,In.validateObject)(f,o)}ce.validateField=Fb;function _u(f,r,o){if(o<bt)throw new Error("Expected power > 0");if(o===bt)return f.ONE;if(o===me)return r;let e=f.ONE,t=r;for(;o>bt;)o&me&&(e=f.mul(e,t)),t=f.sqr(t),o>>=me;return e}ce.FpPow=_u;function zu(f,r){let o=new Array(r.length),e=r.reduce((n,l,c)=>f.is0(l)?n:(o[c]=n,f.mul(n,l)),f.ONE),t=f.inv(e);return r.reduceRight((n,l,c)=>f.is0(l)?n:(o[c]=f.mul(n,o[c]),f.mul(n,l)),t),o}ce.FpInvertBatch=zu;function Mb(f,r,o){return f.mul(r,typeof o=="bigint"?ci(o,f.ORDER):f.inv(o))}ce.FpDiv=Mb;function _b(f){let r=(f.ORDER-me)/Wn;return o=>{let e=f.pow(o,r);return f.eql(e,f.ZERO)||f.eql(e,f.ONE)}}ce.FpIsSquare=_b;function Gl(f,r){let o=r!==void 0?r:f.toString(2).length,e=Math.ceil(o/8);return{nBitLength:o,nByteLength:e}}ce.nLength=Gl;function zb(f,r,o=!1,e={}){if(f<=bt)throw new Error(`Expected Fp ORDER > 0, got ${f}`);let{nBitLength:t,nByteLength:n}=Gl(f,r);if(n>2048)throw new Error("Field lengths over 2048 bytes are not supported");let l=Mu(f),c=Object.freeze({ORDER:f,BITS:t,BYTES:n,MASK:(0,In.bitMask)(t),ZERO:bt,ONE:me,create:u=>Kt(u,f),isValid:u=>{if(typeof u!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof u}`);return bt<=u&&u<f},is0:u=>u===bt,isOdd:u=>(u&me)===me,neg:u=>Kt(-u,f),eql:(u,b)=>u===b,sqr:u=>Kt(u*u,f),add:(u,b)=>Kt(u+b,f),sub:(u,b)=>Kt(u-b,f),mul:(u,b)=>Kt(u*b,f),pow:(u,b)=>_u(c,u,b),div:(u,b)=>Kt(u*ci(b,f),f),sqrN:u=>u*u,addN:(u,b)=>u+b,subN:(u,b)=>u-b,mulN:(u,b)=>u*b,inv:u=>ci(u,f),sqrt:e.sqrt||(u=>l(c,u)),invertBatch:u=>zu(c,u),cmov:(u,b,A)=>A?b:u,toBytes:u=>o?(0,In.numberToBytesLE)(u,n):(0,In.numberToBytesBE)(u,n),fromBytes:u=>{if(u.length!==n)throw new Error(`Fp.fromBytes: expected ${n}, got ${u.length}`);return o?(0,In.bytesToNumberLE)(u):(0,In.bytesToNumberBE)(u)}});return Object.freeze(c)}ce.Field=zb;function Db(f,r){if(!f.isOdd)throw new Error("Field doesn't have isOdd");let o=f.sqrt(r);return f.isOdd(o)?o:f.neg(o)}ce.FpSqrtOdd=Db;function Ub(f,r){if(!f.isOdd)throw new Error("Field doesn't have isOdd");let o=f.sqrt(r);return f.isOdd(o)?f.neg(o):o}ce.FpSqrtEven=Ub;function Rb(f,r,o=!1){f=(0,In.ensureBytes)("privateHash",f);let e=f.length,t=Gl(r).nByteLength+8;if(t<24||e<t||e>1024)throw new Error(`hashToPrivateScalar: expected ${t}-1024 bytes of input, got ${e}`);let n=o?(0,In.bytesToNumberLE)(f):(0,In.bytesToNumberBE)(f);return Kt(n,r-me)+me}ce.hashToPrivateScalar=Rb});var Uu=$(Vr=>{"use strict";C();F();Object.defineProperty(Vr,"__esModule",{value:!0});Vr.validateBasic=Vr.wNAF=void 0;var Du=ar(),Vb=mn(),qb=BigInt(0),Yl=BigInt(1);function Hb(f,r){let o=(t,n)=>{let l=n.negate();return t?l:n},e=t=>{let n=Math.ceil(r/t)+1,l=2**(t-1);return{windows:n,windowSize:l}};return{constTimeNegate:o,unsafeLadder(t,n){let l=f.ZERO,c=t;for(;n>qb;)n&Yl&&(l=l.add(c)),c=c.double(),n>>=Yl;return l},precomputeWindow(t,n){let{windows:l,windowSize:c}=e(n),u=[],b=t,A=b;for(let w=0;w<l;w++){A=b,u.push(A);for(let B=1;B<c;B++)A=A.add(b),u.push(A);b=A.double()}return u},wNAF(t,n,l){let{windows:c,windowSize:u}=e(t),b=f.ZERO,A=f.BASE,w=BigInt(2**t-1),B=2**t,m=BigInt(t);for(let I=0;I<c;I++){let O=I*u,T=Number(l&w);l>>=m,T>u&&(T-=B,l+=Yl);let E=O,z=O+Math.abs(T)-1,M=I%2!==0,R=T<0;T===0?A=A.add(o(M,n[E])):b=b.add(o(R,n[z]))}return{p:b,f:A}},wNAFCached(t,n,l,c){let u=t._WINDOW_SIZE||1,b=n.get(t);return b||(b=this.precomputeWindow(t,u),u!==1&&n.set(t,c(b))),this.wNAF(u,b,l)}}}Vr.wNAF=Hb;function Wb(f){return(0,Du.validateField)(f.Fp),(0,Vb.validateObject)(f,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,Du.nLength)(f.n,f.nBitLength),...f,p:f.Fp.ORDER})}Vr.validateBasic=Wb});var ui=$(Ie=>{"use strict";C();F();var Kb=Ie&&Ie.__createBinding||(Object.create?function(f,r,o,e){e===void 0&&(e=o);var t=Object.getOwnPropertyDescriptor(r,o);(!t||("get"in t?!r.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(f,e,t)}:function(f,r,o,e){e===void 0&&(e=o),f[e]=r[o]}),Jb=Ie&&Ie.__setModuleDefault||(Object.create?function(f,r){Object.defineProperty(f,"default",{enumerable:!0,value:r})}:function(f,r){f.default=r}),Vu=Ie&&Ie.__importStar||function(f){if(f&&f.__esModule)return f;var r={};if(f!=null)for(var o in f)o!=="default"&&Object.prototype.hasOwnProperty.call(f,o)&&Kb(r,f,o);return Jb(r,f),r};Object.defineProperty(Ie,"__esModule",{value:!0});Ie.mapToCurveSimpleSWU=Ie.SWUFpSqrtRatio=Ie.weierstrass=Ie.weierstrassPoints=Ie.DER=void 0;var yo=Vu(ar()),ut=Vu(mn()),wn=mn(),Ql=Uu();function $b(f){let r=(0,Ql.validateBasic)(f);ut.validateObject(r,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:o,Fp:e,a:t}=r;if(o){if(!e.eql(t,e.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof o!="object"||typeof o.beta!="bigint"||typeof o.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...r})}var{bytesToNumberBE:Zb,hexToBytes:Xb}=ut;Ie.DER={Err:class extends Error{constructor(r=""){super(r)}},_parseInt(f){let{Err:r}=Ie.DER;if(f.length<2||f[0]!==2)throw new r("Invalid signature integer tag");let o=f[1],e=f.subarray(2,o+2);if(!o||e.length!==o)throw new r("Invalid signature integer: wrong length");if(e[0]&128)throw new r("Invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new r("Invalid signature integer: unnecessary leading zero");return{d:Zb(e),l:f.subarray(o+2)}},toSig(f){let{Err:r}=Ie.DER,o=typeof f=="string"?Xb(f):f;if(!(o instanceof Uint8Array))throw new Error("ui8a expected");let e=o.length;if(e<2||o[0]!=48)throw new r("Invalid signature tag");if(o[1]!==e-2)throw new r("Invalid signature: incorrect length");let{d:t,l:n}=Ie.DER._parseInt(o.subarray(2)),{d:l,l:c}=Ie.DER._parseInt(n);if(c.length)throw new r("Invalid signature: left bytes after parsing");return{r:t,s:l}},hexFromSig(f){let r=b=>Number.parseInt(b[0],16)&8?"00"+b:b,o=b=>{let A=b.toString(16);return A.length&1?`0${A}`:A},e=r(o(f.s)),t=r(o(f.r)),n=e.length/2,l=t.length/2,c=o(n),u=o(l);return`30${o(l+n+4)}02${u}${t}02${c}${e}`}};var tn=BigInt(0),Ee=BigInt(1),Kn=BigInt(2),ai=BigInt(3),Ru=BigInt(4);function qu(f){let r=$b(f),{Fp:o}=r,e=r.toBytes||((I,O,T)=>{let E=O.toAffine();return ut.concatBytes(Uint8Array.from([4]),o.toBytes(E.x),o.toBytes(E.y))}),t=r.fromBytes||(I=>{let O=I.subarray(1),T=o.fromBytes(O.subarray(0,o.BYTES)),E=o.fromBytes(O.subarray(o.BYTES,2*o.BYTES));return{x:T,y:E}});function n(I){let{a:O,b:T}=r,E=o.sqr(I),z=o.mul(E,I);return o.add(o.add(z,o.mul(I,O)),T)}if(!o.eql(o.sqr(r.Gy),n(r.Gx)))throw new Error("bad generator point: equation left != right");function l(I){return typeof I=="bigint"&&tn<I&&I<r.n}function c(I){if(!l(I))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function u(I){let{allowedPrivateKeyLengths:O,nByteLength:T,wrapPrivateKey:E,n:z}=r;if(O&&typeof I!="bigint"){if(I instanceof Uint8Array&&(I=ut.bytesToHex(I)),typeof I!="string"||!O.includes(I.length))throw new Error("Invalid key");I=I.padStart(T*2,"0")}let M;try{M=typeof I=="bigint"?I:ut.bytesToNumberBE((0,wn.ensureBytes)("private key",I,T))}catch{throw new Error(`private key must be ${T} bytes, hex or bigint, not ${typeof I}`)}return E&&(M=yo.mod(M,z)),c(M),M}let b=new Map;function A(I){if(!(I instanceof w))throw new Error("ProjectivePoint expected")}class w{constructor(O,T,E){if(this.px=O,this.py=T,this.pz=E,O==null||!o.isValid(O))throw new Error("x required");if(T==null||!o.isValid(T))throw new Error("y required");if(E==null||!o.isValid(E))throw new Error("z required")}static fromAffine(O){let{x:T,y:E}=O||{};if(!O||!o.isValid(T)||!o.isValid(E))throw new Error("invalid affine point");if(O instanceof w)throw new Error("projective point not allowed");let z=M=>o.eql(M,o.ZERO);return z(T)&&z(E)?w.ZERO:new w(T,E,o.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(O){let T=o.invertBatch(O.map(E=>E.pz));return O.map((E,z)=>E.toAffine(T[z])).map(w.fromAffine)}static fromHex(O){let T=w.fromAffine(t((0,wn.ensureBytes)("pointHex",O)));return T.assertValidity(),T}static fromPrivateKey(O){return w.BASE.multiply(u(O))}_setWindowSize(O){this._WINDOW_SIZE=O,b.delete(this)}assertValidity(){if(this.is0()){if(r.allowInfinityPoint)return;throw new Error("bad point: ZERO")}let{x:O,y:T}=this.toAffine();if(!o.isValid(O)||!o.isValid(T))throw new Error("bad point: x or y not FE");let E=o.sqr(T),z=n(O);if(!o.eql(E,z))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:O}=this.toAffine();if(o.isOdd)return!o.isOdd(O);throw new Error("Field doesn't support isOdd")}equals(O){A(O);let{px:T,py:E,pz:z}=this,{px:M,py:R,pz:D}=O,_=o.eql(o.mul(T,D),o.mul(M,z)),q=o.eql(o.mul(E,D),o.mul(R,z));return _&&q}negate(){return new w(this.px,o.neg(this.py),this.pz)}double(){let{a:O,b:T}=r,E=o.mul(T,ai),{px:z,py:M,pz:R}=this,D=o.ZERO,_=o.ZERO,q=o.ZERO,U=o.mul(z,z),Q=o.mul(M,M),k=o.mul(R,R),a=o.mul(z,M);return a=o.add(a,a),q=o.mul(z,R),q=o.add(q,q),D=o.mul(O,q),_=o.mul(E,k),_=o.add(D,_),D=o.sub(Q,_),_=o.add(Q,_),_=o.mul(D,_),D=o.mul(a,D),q=o.mul(E,q),k=o.mul(O,k),a=o.sub(U,k),a=o.mul(O,a),a=o.add(a,q),q=o.add(U,U),U=o.add(q,U),U=o.add(U,k),U=o.mul(U,a),_=o.add(_,U),k=o.mul(M,R),k=o.add(k,k),U=o.mul(k,a),D=o.sub(D,U),q=o.mul(k,Q),q=o.add(q,q),q=o.add(q,q),new w(D,_,q)}add(O){A(O);let{px:T,py:E,pz:z}=this,{px:M,py:R,pz:D}=O,_=o.ZERO,q=o.ZERO,U=o.ZERO,Q=r.a,k=o.mul(r.b,ai),a=o.mul(T,M),p=o.mul(E,R),y=o.mul(z,D),h=o.add(T,E),g=o.add(M,R);h=o.mul(h,g),g=o.add(a,p),h=o.sub(h,g),g=o.add(T,z);let N=o.add(M,D);return g=o.mul(g,N),N=o.add(a,y),g=o.sub(g,N),N=o.add(E,z),_=o.add(R,D),N=o.mul(N,_),_=o.add(p,y),N=o.sub(N,_),U=o.mul(Q,g),_=o.mul(k,y),U=o.add(_,U),_=o.sub(p,U),U=o.add(p,U),q=o.mul(_,U),p=o.add(a,a),p=o.add(p,a),y=o.mul(Q,y),g=o.mul(k,g),p=o.add(p,y),y=o.sub(a,y),y=o.mul(Q,y),g=o.add(g,y),a=o.mul(p,g),q=o.add(q,a),a=o.mul(N,g),_=o.mul(h,_),_=o.sub(_,a),a=o.mul(h,p),U=o.mul(N,U),U=o.add(U,a),new w(_,q,U)}subtract(O){return this.add(O.negate())}is0(){return this.equals(w.ZERO)}wNAF(O){return m.wNAFCached(this,b,O,T=>{let E=o.invertBatch(T.map(z=>z.pz));return T.map((z,M)=>z.toAffine(E[M])).map(w.fromAffine)})}multiplyUnsafe(O){let T=w.ZERO;if(O===tn)return T;if(c(O),O===Ee)return this;let{endo:E}=r;if(!E)return m.unsafeLadder(this,O);let{k1neg:z,k1:M,k2neg:R,k2:D}=E.splitScalar(O),_=T,q=T,U=this;for(;M>tn||D>tn;)M&Ee&&(_=_.add(U)),D&Ee&&(q=q.add(U)),U=U.double(),M>>=Ee,D>>=Ee;return z&&(_=_.negate()),R&&(q=q.negate()),q=new w(o.mul(q.px,E.beta),q.py,q.pz),_.add(q)}multiply(O){c(O);let T=O,E,z,{endo:M}=r;if(M){let{k1neg:R,k1:D,k2neg:_,k2:q}=M.splitScalar(T),{p:U,f:Q}=this.wNAF(D),{p:k,f:a}=this.wNAF(q);U=m.constTimeNegate(R,U),k=m.constTimeNegate(_,k),k=new w(o.mul(k.px,M.beta),k.py,k.pz),E=U.add(k),z=Q.add(a)}else{let{p:R,f:D}=this.wNAF(T);E=R,z=D}return w.normalizeZ([E,z])[0]}multiplyAndAddUnsafe(O,T,E){let z=w.BASE,M=(D,_)=>_===tn||_===Ee||!D.equals(z)?D.multiplyUnsafe(_):D.multiply(_),R=M(this,T).add(M(O,E));return R.is0()?void 0:R}toAffine(O){let{px:T,py:E,pz:z}=this,M=this.is0();O==null&&(O=M?o.ONE:o.inv(z));let R=o.mul(T,O),D=o.mul(E,O),_=o.mul(z,O);if(M)return{x:o.ZERO,y:o.ZERO};if(!o.eql(_,o.ONE))throw new Error("invZ was invalid");return{x:R,y:D}}isTorsionFree(){let{h:O,isTorsionFree:T}=r;if(O===Ee)return!0;if(T)return T(w,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:O,clearCofactor:T}=r;return O===Ee?this:T?T(w,this):this.multiplyUnsafe(r.h)}toRawBytes(O=!0){return this.assertValidity(),e(w,this,O)}toHex(O=!0){return ut.bytesToHex(this.toRawBytes(O))}}w.BASE=new w(r.Gx,r.Gy,o.ONE),w.ZERO=new w(o.ZERO,o.ONE,o.ZERO);let B=r.nBitLength,m=(0,Ql.wNAF)(w,r.endo?Math.ceil(B/2):B);return{CURVE:r,ProjectivePoint:w,normPrivateKeyToScalar:u,weierstrassEquation:n,isWithinCurveOrder:l}}Ie.weierstrassPoints=qu;function Gb(f){let r=(0,Ql.validateBasic)(f);return ut.validateObject(r,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...r})}function Yb(f){let r=Gb(f),{Fp:o,n:e}=r,t=o.BYTES+1,n=2*o.BYTES+1;function l(g){return tn<g&&g<o.ORDER}function c(g){return yo.mod(g,e)}function u(g){return yo.invert(g,e)}let{ProjectivePoint:b,normPrivateKeyToScalar:A,weierstrassEquation:w,isWithinCurveOrder:B}=qu({...r,toBytes(g,N,L){let S=N.toAffine(),s=o.toBytes(S.x),x=ut.concatBytes;return L?x(Uint8Array.from([N.hasEvenY()?2:3]),s):x(Uint8Array.from([4]),s,o.toBytes(S.y))},fromBytes(g){let N=g.length,L=g[0],S=g.subarray(1);if(N===t&&(L===2||L===3)){let s=ut.bytesToNumberBE(S);if(!l(s))throw new Error("Point is not on curve");let x=w(s),W=o.sqrt(x),K=(W&Ee)===Ee;return(L&1)===1!==K&&(W=o.neg(W)),{x:s,y:W}}else if(N===n&&L===4){let s=o.fromBytes(S.subarray(0,o.BYTES)),x=o.fromBytes(S.subarray(o.BYTES,2*o.BYTES));return{x:s,y:x}}else throw new Error(`Point of length ${N} was invalid. Expected ${t} compressed bytes or ${n} uncompressed bytes`)}}),m=g=>ut.bytesToHex(ut.numberToBytesBE(g,r.nByteLength));function I(g){let N=e>>Ee;return g>N}function O(g){return I(g)?c(-g):g}let T=(g,N,L)=>ut.bytesToNumberBE(g.slice(N,L));class E{constructor(N,L,S){this.r=N,this.s=L,this.recovery=S,this.assertValidity()}static fromCompact(N){let L=r.nByteLength;return N=(0,wn.ensureBytes)("compactSignature",N,L*2),new E(T(N,0,L),T(N,L,2*L))}static fromDER(N){let{r:L,s:S}=Ie.DER.toSig((0,wn.ensureBytes)("DER",N));return new E(L,S)}assertValidity(){if(!B(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!B(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(N){return new E(this.r,this.s,N)}recoverPublicKey(N){let{r:L,s:S,recovery:s}=this,x=q((0,wn.ensureBytes)("msgHash",N));if(s==null||![0,1,2,3].includes(s))throw new Error("recovery id invalid");let W=s===2||s===3?L+r.n:L;if(W>=o.ORDER)throw new Error("recovery id 2 or 3 invalid");let K=(s&1)===0?"02":"03",J=b.fromHex(K+m(W)),G=u(W),ee=c(-x*G),te=c(S*G),ke=b.BASE.multiplyAndAddUnsafe(J,ee,te);if(!ke)throw new Error("point at infinify");return ke.assertValidity(),ke}hasHighS(){return I(this.s)}normalizeS(){return this.hasHighS()?new E(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return ut.hexToBytes(this.toDERHex())}toDERHex(){return Ie.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ut.hexToBytes(this.toCompactHex())}toCompactHex(){return m(this.r)+m(this.s)}}let z={isValidPrivateKey(g){try{return A(g),!0}catch{return!1}},normPrivateKeyToScalar:A,randomPrivateKey:()=>{let g=r.randomBytes(o.BYTES+8),N=yo.hashToPrivateScalar(g,e);return ut.numberToBytesBE(N,r.nByteLength)},precompute(g=8,N=b.BASE){return N._setWindowSize(g),N.multiply(BigInt(3)),N}};function M(g,N=!0){return b.fromPrivateKey(g).toRawBytes(N)}function R(g){let N=g instanceof Uint8Array,L=typeof g=="string",S=(N||L)&&g.length;return N?S===t||S===n:L?S===2*t||S===2*n:g instanceof b}function D(g,N,L=!0){if(R(g))throw new Error("first arg must be private key");if(!R(N))throw new Error("second arg must be public key");return b.fromHex(N).multiply(A(g)).toRawBytes(L)}let _=r.bits2int||function(g){let N=ut.bytesToNumberBE(g),L=g.length*8-r.nBitLength;return L>0?N>>BigInt(L):N},q=r.bits2int_modN||function(g){return c(_(g))},U=ut.bitMask(r.nBitLength);function Q(g){if(typeof g!="bigint")throw new Error("bigint expected");if(!(tn<=g&&g<U))throw new Error(`bigint expected < 2^${r.nBitLength}`);return ut.numberToBytesBE(g,r.nByteLength)}function k(g,N,L=a){if(["recovered","canonical"].some(se=>se in L))throw new Error("sign() legacy options not supported");let{hash:S,randomBytes:s}=r,{lowS:x,prehash:W,extraEntropy:K}=L;x==null&&(x=!0),g=(0,wn.ensureBytes)("msgHash",g),W&&(g=(0,wn.ensureBytes)("prehashed msgHash",S(g)));let J=q(g),G=A(N),ee=[Q(G),Q(J)];if(K!=null){let se=K===!0?s(o.BYTES):K;ee.push((0,wn.ensureBytes)("extraEntropy",se,o.BYTES))}let te=ut.concatBytes(...ee),ke=J;function we(se){let gn=_(se);if(!B(gn))return;let xe=u(gn),ye=b.BASE.multiply(gn).toAffine(),vn=c(ye.x);if(vn===tn)return;let Oe=c(xe*c(ke+vn*G));if(Oe===tn)return;let Ne=(ye.x===vn?0:2)|Number(ye.y&Ee),Kr=Oe;return x&&I(Oe)&&(Kr=O(Oe),Ne^=1),new E(vn,Kr,Ne)}return{seed:te,k2sig:we}}let a={lowS:r.lowS,prehash:!1},p={lowS:r.lowS,prehash:!1};function y(g,N,L=a){let{seed:S,k2sig:s}=k(g,N,L),x=r;return ut.createHmacDrbg(x.hash.outputLen,x.nByteLength,x.hmac)(S,s)}b.BASE._setWindowSize(8);function h(g,N,L,S=p){let s=g;if(N=(0,wn.ensureBytes)("msgHash",N),L=(0,wn.ensureBytes)("publicKey",L),"strict"in S)throw new Error("options.strict was renamed to lowS");let{lowS:x,prehash:W}=S,K,J;try{if(typeof s=="string"||s instanceof Uint8Array)try{K=E.fromDER(s)}catch(ye){if(!(ye instanceof Ie.DER.Err))throw ye;K=E.fromCompact(s)}else if(typeof s=="object"&&typeof s.r=="bigint"&&typeof s.s=="bigint"){let{r:ye,s:vn}=s;K=new E(ye,vn)}else throw new Error("PARSE");J=b.fromHex(L)}catch(ye){if(ye.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(x&&K.hasHighS())return!1;W&&(N=r.hash(N));let{r:G,s:ee}=K,te=q(N),ke=u(ee),we=c(te*ke),se=c(G*ke),gn=b.BASE.multiplyAndAddUnsafe(J,we,se)?.toAffine();return gn?c(gn.x)===G:!1}return{CURVE:r,getPublicKey:M,getSharedSecret:D,sign:y,verify:h,ProjectivePoint:b,Signature:E,utils:z}}Ie.weierstrass=Yb;function Hu(f,r){let o=f.ORDER,e=tn;for(let I=o-Ee;I%Kn===tn;I/=Kn)e+=Ee;let t=e,n=Kn<<t-Ee-Ee,l=n*Kn,c=(o-Ee)/l,u=(c-Ee)/Kn,b=l-Ee,A=n,w=f.pow(r,c),B=f.pow(r,(c+Ee)/Kn),m=(I,O)=>{let T=w,E=f.pow(O,b),z=f.sqr(E);z=f.mul(z,O);let M=f.mul(I,z);M=f.pow(M,u),M=f.mul(M,E),E=f.mul(M,O),z=f.mul(M,I);let R=f.mul(z,E);M=f.pow(R,A);let D=f.eql(M,f.ONE);E=f.mul(z,B),M=f.mul(R,T),z=f.cmov(E,z,D),R=f.cmov(M,R,D);for(let _=t;_>Ee;_--){let q=_-Kn;q=Kn<<q-Ee;let U=f.pow(R,q),Q=f.eql(U,f.ONE);E=f.mul(z,T),T=f.mul(T,T),U=f.mul(R,T),z=f.cmov(E,z,Q),R=f.cmov(U,R,Q)}return{isValid:D,value:z}};if(f.ORDER%Ru===ai){let I=(f.ORDER-ai)/Ru,O=f.sqrt(f.neg(r));m=(T,E)=>{let z=f.sqr(E),M=f.mul(T,E);z=f.mul(z,M);let R=f.pow(z,I);R=f.mul(R,M);let D=f.mul(R,O),_=f.mul(f.sqr(R),E),q=f.eql(_,T),U=f.cmov(D,R,q);return{isValid:q,value:U}}}return m}Ie.SWUFpSqrtRatio=Hu;function Qb(f,r){if(yo.validateField(f),!f.isValid(r.A)||!f.isValid(r.B)||!f.isValid(r.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");let o=Hu(f,r.Z);if(!f.isOdd)throw new Error("Fp.isOdd is not implemented!");return e=>{let t,n,l,c,u,b,A,w;t=f.sqr(e),t=f.mul(t,r.Z),n=f.sqr(t),n=f.add(n,t),l=f.add(n,f.ONE),l=f.mul(l,r.B),c=f.cmov(r.Z,f.neg(n),!f.eql(n,f.ZERO)),c=f.mul(c,r.A),n=f.sqr(l),b=f.sqr(c),u=f.mul(b,r.A),n=f.add(n,u),n=f.mul(n,l),b=f.mul(b,c),u=f.mul(b,r.B),n=f.add(n,u),A=f.mul(t,l);let{isValid:B,value:m}=o(n,b);w=f.mul(t,e),w=f.mul(w,m),A=f.cmov(A,l,B),w=f.cmov(w,m,B);let I=f.isOdd(e)===f.isOdd(w);return w=f.cmov(f.neg(w),w,I),A=f.div(A,c),{x:A,y:w}}}Ie.mapToCurveSimpleSWU=Qb});var Ju=$(Jt=>{"use strict";C();F();Object.defineProperty(Jt,"__esModule",{value:!0});Jt.createHasher=Jt.isogenyMap=Jt.hash_to_field=Jt.expand_message_xof=Jt.expand_message_xmd=void 0;var jb=ar(),nn=mn();function ew(f){if(f instanceof Uint8Array)return f;if(typeof f=="string")return(0,nn.utf8ToBytes)(f);throw new Error("DST must be Uint8Array or string")}var tw=nn.bytesToNumberBE;function Jn(f,r){if(f<0||f>=1<<8*r)throw new Error(`bad I2OSP call: value=${f} length=${r}`);let o=Array.from({length:r}).fill(0);for(let e=r-1;e>=0;e--)o[e]=f&255,f>>>=8;return new Uint8Array(o)}function nw(f,r){let o=new Uint8Array(f.length);for(let e=0;e<f.length;e++)o[e]=f[e]^r[e];return o}function bo(f){if(!(f instanceof Uint8Array))throw new Error("Uint8Array expected")}function ef(f){if(!Number.isSafeInteger(f))throw new Error("number expected")}function Wu(f,r,o,e){bo(f),bo(r),ef(o),r.length>255&&(r=e((0,nn.concatBytes)((0,nn.utf8ToBytes)("H2C-OVERSIZE-DST-"),r)));let{outputLen:t,blockLen:n}=e,l=Math.ceil(o/t);if(l>255)throw new Error("Invalid xmd length");let c=(0,nn.concatBytes)(r,Jn(r.length,1)),u=Jn(0,n),b=Jn(o,2),A=new Array(l),w=e((0,nn.concatBytes)(u,f,b,Jn(0,1),c));A[0]=e((0,nn.concatBytes)(w,Jn(1,1),c));for(let m=1;m<=l;m++){let I=[nw(w,A[m-1]),Jn(m+1,1),c];A[m]=e((0,nn.concatBytes)(...I))}return(0,nn.concatBytes)(...A).slice(0,o)}Jt.expand_message_xmd=Wu;function Ku(f,r,o,e,t){if(bo(f),bo(r),ef(o),r.length>255){let n=Math.ceil(2*e/8);r=t.create({dkLen:n}).update((0,nn.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(r).digest()}if(o>65535||r.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return t.create({dkLen:o}).update(f).update(Jn(o,2)).update(r).update(Jn(r.length,1)).digest()}Jt.expand_message_xof=Ku;function jl(f,r,o){(0,nn.validateObject)(o,{DST:"string",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:e,k:t,m:n,hash:l,expand:c,DST:u}=o;bo(f),ef(r);let b=ew(u),A=e.toString(2).length,w=Math.ceil((A+t)/8),B=r*n*w,m;if(c==="xmd")m=Wu(f,b,B,l);else if(c==="xof")m=Ku(f,b,B,t,l);else if(c==="_internal_pass")m=f;else throw new Error('expand must be "xmd" or "xof"');let I=new Array(r);for(let O=0;O<r;O++){let T=new Array(n);for(let E=0;E<n;E++){let z=w*(E+O*n),M=m.subarray(z,z+w);T[E]=(0,jb.mod)(tw(M),e)}I[O]=T}return I}Jt.hash_to_field=jl;function rw(f,r){let o=r.map(e=>Array.from(e).reverse());return(e,t)=>{let[n,l,c,u]=o.map(b=>b.reduce((A,w)=>f.add(f.mul(A,e),w)));return e=f.div(n,l),t=f.mul(t,f.div(c,u)),{x:e,y:t}}}Jt.isogenyMap=rw;function ow(f,r,o){if(typeof r!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(e,t){let n=jl(e,2,{...o,DST:o.DST,...t}),l=f.fromAffine(r(n[0])),c=f.fromAffine(r(n[1])),u=l.add(c).clearCofactor();return u.assertValidity(),u},encodeToCurve(e,t){let n=jl(e,1,{...o,DST:o.encodeDST,...t}),l=f.fromAffine(r(n[0])).clearCofactor();return l.assertValidity(),l}}}Jt.createHasher=ow});var tf=$(qr=>{"use strict";C();F();Object.defineProperty(qr,"__esModule",{value:!0});qr.createCurve=qr.getHash=void 0;var iw=to(),$u=St(),lw=ui();function Zu(f){return{hash:f,hmac:(r,...o)=>(0,iw.hmac)(f,r,(0,$u.concatBytes)(...o)),randomBytes:$u.randomBytes}}qr.getHash=Zu;function fw(f,r){let o=e=>(0,lw.weierstrass)({...f,...Zu(e)});return Object.freeze({...o(r),create:o})}qr.createCurve=fw});var od=$(dt=>{"use strict";C();F();var cw=dt&&dt.__createBinding||(Object.create?function(f,r,o,e){e===void 0&&(e=o);var t=Object.getOwnPropertyDescriptor(r,o);(!t||("get"in t?!r.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(f,e,t)}:function(f,r,o,e){e===void 0&&(e=o),f[e]=r[o]}),aw=dt&&dt.__setModuleDefault||(Object.create?function(f,r){Object.defineProperty(f,"default",{enumerable:!0,value:r})}:function(f,r){f.default=r}),uw=dt&&dt.__importStar||function(f){if(f&&f.__esModule)return f;var r={};if(f!=null)for(var o in f)o!=="default"&&Object.prototype.hasOwnProperty.call(f,o)&&cw(r,f,o);return aw(r,f),r},nf;Object.defineProperty(dt,"__esModule",{value:!0});dt.encodeToCurve=dt.hashToCurve=dt.schnorr=dt.secp256k1=void 0;var di=br(),dw=St(),Ot=ar(),sw=ui(),kt=mn(),Yu=uw(Ju()),hw=tf(),yi=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),si=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Qu=BigInt(1),hi=BigInt(2),Xu=(f,r)=>(f+r/hi)/r;function ju(f){let r=yi,o=BigInt(3),e=BigInt(6),t=BigInt(11),n=BigInt(22),l=BigInt(23),c=BigInt(44),u=BigInt(88),b=f*f*f%r,A=b*b*f%r,w=(0,Ot.pow2)(A,o,r)*A%r,B=(0,Ot.pow2)(w,o,r)*A%r,m=(0,Ot.pow2)(B,hi,r)*b%r,I=(0,Ot.pow2)(m,t,r)*m%r,O=(0,Ot.pow2)(I,n,r)*I%r,T=(0,Ot.pow2)(O,c,r)*O%r,E=(0,Ot.pow2)(T,u,r)*T%r,z=(0,Ot.pow2)(E,c,r)*O%r,M=(0,Ot.pow2)(z,o,r)*A%r,R=(0,Ot.pow2)(M,l,r)*I%r,D=(0,Ot.pow2)(R,e,r)*b%r,_=(0,Ot.pow2)(D,hi,r);if(!$n.eql($n.sqr(_),f))throw new Error("Cannot find square root");return _}var $n=(0,Ot.Field)(yi,void 0,void 0,{sqrt:ju});dt.secp256k1=(0,hw.createCurve)({a:BigInt(0),b:BigInt(7),Fp:$n,n:si,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:f=>{let r=si,o=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),e=-Qu*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),t=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),n=o,l=BigInt("0x100000000000000000000000000000000"),c=Xu(n*f,r),u=Xu(-e*f,r),b=(0,Ot.mod)(f-c*o-u*t,r),A=(0,Ot.mod)(-c*e-u*n,r),w=b>l,B=A>l;if(w&&(b=r-b),B&&(A=r-A),b>l||A>l)throw new Error("splitScalar: Endomorphism failed, k="+f);return{k1neg:w,k1:b,k2neg:B,k2:A}}}},di.sha256);var bi=BigInt(0),ed=f=>typeof f=="bigint"&&bi<f&&f<yi,pw=f=>typeof f=="bigint"&&bi<f&&f<si,Gu={};function pi(f,...r){let o=Gu[f];if(o===void 0){let e=(0,di.sha256)(Uint8Array.from(f,t=>t.charCodeAt(0)));o=(0,kt.concatBytes)(e,e),Gu[f]=o}return(0,di.sha256)((0,kt.concatBytes)(o,...r))}var ff=f=>f.toRawBytes(!0).slice(1),of=f=>(0,kt.numberToBytesBE)(f,32),rf=f=>(0,Ot.mod)(f,yi),wo=f=>(0,Ot.mod)(f,si),cf=dt.secp256k1.ProjectivePoint,yw=(f,r,o)=>cf.BASE.multiplyAndAddUnsafe(f,r,o);function lf(f){let r=dt.secp256k1.utils.normPrivateKeyToScalar(f),o=cf.fromPrivateKey(r);return{scalar:o.hasEvenY()?r:wo(-r),bytes:ff(o)}}function td(f){if(!ed(f))throw new Error("bad x: need 0 < x < p");let r=rf(f*f),o=rf(r*f+BigInt(7)),e=ju(o);e%hi!==bi&&(e=rf(-e));let t=new cf(f,e,Qu);return t.assertValidity(),t}function nd(...f){return wo((0,kt.bytesToNumberBE)(pi("BIP0340/challenge",...f)))}function bw(f){return lf(f).bytes}function ww(f,r,o=(0,dw.randomBytes)(32)){let e=(0,kt.ensureBytes)("message",f),{bytes:t,scalar:n}=lf(r),l=(0,kt.ensureBytes)("auxRand",o,32),c=of(n^(0,kt.bytesToNumberBE)(pi("BIP0340/aux",l))),u=pi("BIP0340/nonce",c,t,e),b=wo((0,kt.bytesToNumberBE)(u));if(b===bi)throw new Error("sign failed: k is zero");let{bytes:A,scalar:w}=lf(b),B=nd(A,t,e),m=new Uint8Array(64);if(m.set(A,0),m.set(of(wo(w+B*n)),32),!rd(m,e,t))throw new Error("sign: Invalid signature produced");return m}function rd(f,r,o){let e=(0,kt.ensureBytes)("signature",f,64),t=(0,kt.ensureBytes)("message",r),n=(0,kt.ensureBytes)("publicKey",o,32);try{let l=td((0,kt.bytesToNumberBE)(n)),c=(0,kt.bytesToNumberBE)(e.subarray(0,32));if(!ed(c))return!1;let u=(0,kt.bytesToNumberBE)(e.subarray(32,64));if(!pw(u))return!1;let b=nd(of(c),ff(l),t),A=yw(l,u,wo(-b));return!(!A||!A.hasEvenY()||A.toAffine().x!==c)}catch{return!1}}dt.schnorr={getPublicKey:bw,sign:ww,verify:rd,utils:{randomPrivateKey:dt.secp256k1.utils.randomPrivateKey,lift_x:td,pointToBytes:ff,numberToBytesBE:kt.numberToBytesBE,bytesToNumberBE:kt.bytesToNumberBE,taggedHash:pi,mod:Ot.mod}};var gw=Yu.isogenyMap($n,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(f=>f.map(r=>BigInt(r)))),vw=(0,sw.mapToCurveSimpleSWU)($n,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:$n.create(BigInt("-11"))});nf=Yu.createHasher(dt.secp256k1.ProjectivePoint,f=>{let{x:r,y:o}=vw($n.create(f[0]));return gw(r,o)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:$n.ORDER,m:1,k:128,expand:"xmd",hash:di.sha256}),dt.hashToCurve=nf.hashToCurve,dt.encodeToCurve=nf.encodeToCurve});var fd=$(Zn=>{"use strict";C();F();Object.defineProperty(Zn,"__esModule",{value:!0});Zn.poseidon=Zn.splitConstants=Zn.validateOpts=void 0;var id=ar();function ld(f){let{Fp:r}=f;(0,id.validateField)(r);for(let u of["t","roundsFull","roundsPartial"])if(typeof f[u]!="number"||!Number.isSafeInteger(f[u]))throw new Error(`Poseidon: invalid param ${u}=${f[u]} (${typeof f[u]})`);if(f.reversePartialPowIdx!==void 0&&typeof f.reversePartialPowIdx!="boolean")throw new Error(`Poseidon: invalid param reversePartialPowIdx=${f.reversePartialPowIdx}`);let o=f.sboxPower;if(o===void 0&&(o=5),typeof o!="number"||!Number.isSafeInteger(o))throw new Error(`Poseidon wrong sboxPower=${o}`);let e=BigInt(o),t=u=>(0,id.FpPow)(r,u,e);if(o===3?t=u=>r.mul(r.sqrN(u),u):o===5&&(t=u=>r.mul(r.sqrN(r.sqrN(u)),u)),f.roundsFull%2!==0)throw new Error(`Poseidon roundsFull is not even: ${f.roundsFull}`);let n=f.roundsFull+f.roundsPartial;if(!Array.isArray(f.roundConstants)||f.roundConstants.length!==n)throw new Error("Poseidon: wrong round constants");let l=f.roundConstants.map(u=>{if(!Array.isArray(u)||u.length!==f.t)throw new Error(`Poseidon wrong round constants: ${u}`);return u.map(b=>{if(typeof b!="bigint"||!r.isValid(b))throw new Error(`Poseidon wrong round constant=${b}`);return r.create(b)})});if(!Array.isArray(f.mds)||f.mds.length!==f.t)throw new Error("Poseidon: wrong MDS matrix");let c=f.mds.map(u=>{if(!Array.isArray(u)||u.length!==f.t)throw new Error(`Poseidon MDS matrix row: ${u}`);return u.map(b=>{if(typeof b!="bigint")throw new Error(`Poseidon MDS matrix value=${b}`);return r.create(b)})});return Object.freeze({...f,rounds:n,sboxFn:t,roundConstants:l,mds:c})}Zn.validateOpts=ld;function Aw(f,r){if(typeof r!="number")throw new Error("poseidonSplitConstants: wrong t");if(!Array.isArray(f)||f.length%r)throw new Error("poseidonSplitConstants: wrong rc");let o=[],e=[];for(let t=0;t<f.length;t++)e.push(f[t]),e.length===r&&(o.push(e),e=[]);return o}Zn.splitConstants=Aw;function Ow(f){let{t:r,Fp:o,rounds:e,sboxFn:t,reversePartialPowIdx:n}=ld(f),l=Math.floor(f.roundsFull/2),c=n?r-1:0,u=(A,w,B)=>(A=A.map((m,I)=>o.add(m,f.roundConstants[B][I])),w?A=A.map(m=>t(m)):A[c]=t(A[c]),A=f.mds.map(m=>m.reduce((I,O,T)=>o.add(I,o.mulN(O,A[T])),o.ZERO)),A),b=function(w){if(!Array.isArray(w)||w.length!==r)throw new Error(`Poseidon: wrong values (expected array of bigints with length ${r})`);w=w.map(m=>{if(typeof m!="bigint")throw new Error(`Poseidon: wrong value=${m} (${typeof m})`);return o.create(m)});let B=0;for(let m=0;m<l;m++)w=u(w,!0,B++);for(let m=0;m<f.roundsPartial;m++)w=u(w,!1,B++);for(let m=0;m<l;m++)w=u(w,!0,B++);if(B!==e)throw new Error(`Poseidon: wrong number of rounds: last round=${B}, total=${e}`);return w};return b.roundConstants=f.roundConstants,b}Zn.poseidon=Ow});var Ad=$(X=>{"use strict";C();F();var Sw=X&&X.__createBinding||(Object.create?function(f,r,o,e){e===void 0&&(e=o);var t=Object.getOwnPropertyDescriptor(r,o);(!t||("get"in t?!r.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(f,e,t)}:function(f,r,o,e){e===void 0&&(e=o),f[e]=r[o]}),mw=X&&X.__setModuleDefault||(Object.create?function(f,r){Object.defineProperty(f,"default",{enumerable:!0,value:r})}:function(f,r){f.default=r}),Iw=X&&X.__importStar||function(f){if(f&&f.__esModule)return f;var r={};if(f!=null)for(var o in f)o!=="default"&&Object.prototype.hasOwnProperty.call(f,o)&&Sw(r,f,o);return mw(r,f),r};Object.defineProperty(X,"__esModule",{value:!0});X.poseidonHashMany=X.poseidonHashSingle=X.poseidonHashFunc=X.poseidonHash=X.poseidonSmall=X.poseidonCreate=X.poseidonBasic=X._poseidonMDS=X.Fp251=X.Fp253=X.keccak=X.computeHashOnElements=X.hashChain=X.pedersen=X.getAccountPath=X.ethSigToPrivate=X.getStarkKey=X.grindKey=X.utils=X.Signature=X.ProjectivePoint=X.CURVE=X.verify=X.sign=X.getSharedSecret=X.getPublicKey=X._starkCurve=void 0;var Bw=Po(),df=br(),xw=St(),dr=ar(),Nw=fd(),kw=ui(),Tt=Iw(mn()),Tw=tf(),gi=BigInt("3618502788666131213697322783095070105526743751716087489154079457884512865583"),ud=252;function cd(f){for(;f[0]===0;)f=f.subarray(1);let r=f.length*8-ud,o=Tt.bytesToNumberBE(f);return r>0?o>>BigInt(r):o}function dd(f){return typeof f=="string"&&(f=hf(f),f.length&1&&(f="0"+f)),Tt.hexToBytes(f)}var sr=(0,kw.weierstrass)({a:BigInt(1),b:BigInt("3141592653589793238462643383279502884197169399375105820974944592307816406665"),Fp:(0,dr.Field)(BigInt("0x800000000000011000000000000000000000000000000000000000000000001")),n:gi,nBitLength:ud,Gx:BigInt("874739451078007766457464989774322083649278607533249481151382481072868806602"),Gy:BigInt("152666792071518830868575557812948353041420400780739481342941381225525861407"),h:BigInt(1),lowS:!1,...(0,Tw.getHash)(df.sha256),bits2int:cd,bits2int_modN:f=>{let r=Tt.bytesToNumberBE(f).toString(16);return r.length===63&&(f=dd(r+"0")),(0,dr.mod)(cd(f),gi)}});X._starkCurve=sr;function ur(f){return Tt.ensureBytes("",typeof f=="string"?dd(f):f)}function sf(f){return Tt.bytesToHex(ur(f)).padStart(64,"0")}function sd(f,r=!1){return sr.getPublicKey(sf(f),r)}X.getPublicKey=sd;function Lw(f,r){return sr.getSharedSecret(sf(f),r)}X.getSharedSecret=Lw;function Pw(f,r,o){return sr.sign(ur(f),sf(r),o)}X.sign=Pw;function Ew(f,r,o){let e=f instanceof hd?f:ur(f);return sr.verify(e,ur(r),ur(o))}X.verify=Ew;var{CURVE:Cw,ProjectivePoint:Hr,Signature:hd,utils:Fw}=sr;X.CURVE=Cw;X.ProjectivePoint=Hr;X.Signature=hd;X.utils=Fw;function pd(f){return`0x${Tt.bytesToHex(f.subarray(1)).replace(/^0+/gm,"")}`}function hf(f){return f.replace(/^0x/i,"")}function Mw(f){return`0x${f.toString(16)}`}function yd(f){let r=ur(f),o=2n**256n,e=o-(0,dr.mod)(o,gi);for(let t=0;;t++){let n=af(Tt.concatBytes(r,Tt.numberToVarBytesBE(BigInt(t))));if(n<e)return(0,dr.mod)(n,gi).toString(16);if(t===1e5)throw new Error("grindKey is broken: tried 100k vals")}}X.grindKey=yd;function _w(f){return pd(sd(f,!0))}X.getStarkKey=_w;function zw(f){if(f=hf(f),f.length!==130)throw new Error("Wrong ethereum signature");return yd(f.substring(0,64))}X.ethSigToPrivate=zw;var Dw=2n**31n-1n,wi=f=>Number(f&Dw);function Uw(f,r,o,e){let t=wi(af(f)),n=wi(af(r)),l=Tt.hexToNumber(hf(o));return`m/2645'/${t}'/${n}'/${wi(l)}'/${wi(l>>31n)}'/${e}`}X.getAccountPath=Uw;var go=[new Hr(2089986280348253421170679821480865132823066470938446095505822317253594081284n,1713931329540660377023406109199410414810705867260802078187082345529207694986n,1n),new Hr(996781205833008774514500082376783249102396023663454813447423147977397232763n,1668503676786377725805489344771023921079126552019160156920634619255970485781n,1n),new Hr(2251563274489750535117886426533222435294046428347329203627021249169616184184n,1798716007562728905295480679789526322175868328062420237419143593021674992973n,1n),new Hr(2138414695194151160943305727036575959195309218611738193261179310511854807447n,113410276730064486255102093846540133784865286929052426931474106396135072156n,1n),new Hr(2379962749567351885752724891227938183011949129833673362440656643086021394946n,776496453633298175483985398648758586525933812536653089401905292063708816422n,1n)];function bd(f,r){let o=[],e=f;for(let t=0;t<248;t++)o.push(e),e=e.double();e=r;for(let t=0;t<4;t++)o.push(e),e=e.double();return o}var Rw=bd(go[1],go[2]),Vw=bd(go[3],go[4]);function wd(f){let r;if(typeof f=="bigint")r=f;else if(typeof f=="number"){if(!Number.isSafeInteger(f))throw new Error(`Invalid pedersenArg: ${f}`);r=BigInt(f)}else r=Tt.bytesToNumberBE(ur(f));if(!(0n<=r&&r<sr.CURVE.Fp.ORDER))throw new Error(`PedersenArg should be 0 <= value < CURVE.P: ${r}`);return r}function ad(f,r,o){let e=wd(r);for(let t=0;t<252;t++){let n=o[t];if(n.equals(f))throw new Error("Same point");(e&1n)!==0n&&(f=f.add(n)),e>>=1n}return f}function pf(f,r){let o=go[0];return o=ad(o,f,Rw),o=ad(o,r,Vw),pd(o.toRawBytes(!0))}X.pedersen=pf;function qw(f,r=pf){if(!Array.isArray(f)||f.length<1)throw new Error("data should be array of at least 1 element");return f.length===1?Mw(wd(f[0])):Array.from(f).reverse().reduce((o,e)=>r(e,o))}X.hashChain=qw;var Hw=(f,r=pf)=>[0,...f,f.length].reduce((o,e)=>r(o,e));X.computeHashOnElements=Hw;var Ww=Tt.bitMask(250),Kw=f=>Tt.bytesToNumberBE((0,Bw.keccak_256)(f))&Ww;X.keccak=Kw;var af=f=>Tt.bytesToNumberBE((0,df.sha256)(f));X.Fp253=(0,dr.Field)(BigInt("14474011154664525231415395255581126252639794253786371766033694892385558855681"));X.Fp251=(0,dr.Field)(BigInt("3618502788666131213697322783095070105623107215331596699973092056135872020481"));function uf(f,r,o){let e=f.fromBytes((0,df.sha256)((0,xw.utf8ToBytes)(`${r}${o}`)));return f.create(e)}function gd(f,r,o,e=0){let t=[],n=[];for(let l=0;l<o;l++)t.push(uf(f,`${r}x`,e*o+l)),n.push(uf(f,`${r}y`,e*o+l));if(new Set([...t,...n]).size!==2*o)throw new Error("X and Y values are not distinct");return t.map(l=>n.map(c=>f.inv(f.sub(l,c))))}X._poseidonMDS=gd;var Jw=[[3,1,1],[1,-1,1],[1,1,-2]].map(f=>f.map(BigInt));function yf(f,r){if((0,dr.validateField)(f.Fp),!Number.isSafeInteger(f.rate)||!Number.isSafeInteger(f.capacity))throw new Error(`Wrong poseidon opts: ${f}`);let o=f.rate+f.capacity,e=f.roundsFull+f.roundsPartial,t=[];for(let l=0;l<e;l++){let c=[];for(let u=0;u<o;u++)c.push(uf(f.Fp,"Hades",o*l+u));t.push(c)}let n=(0,Nw.poseidon)({...f,t:o,sboxPower:3,reversePartialPowIdx:!0,mds:r,roundConstants:t});return n.m=o,n.rate=f.rate,n.capacity=f.capacity,n}X.poseidonBasic=yf;function $w(f,r=0){let o=f.rate+f.capacity;if(!Number.isSafeInteger(r))throw new Error(`Wrong mdsAttempt=${r}`);return yf(f,gd(f.Fp,"HadesMDS",o,r))}X.poseidonCreate=$w;X.poseidonSmall=yf({Fp:X.Fp251,rate:2,capacity:1,roundsFull:8,roundsPartial:83},Jw);function vd(f,r,o=X.poseidonSmall){return o([f,r,2n])[0]}X.poseidonHash=vd;function Zw(f,r,o=X.poseidonSmall){return Tt.numberToVarBytesBE(vd(Tt.bytesToNumberBE(f),Tt.bytesToNumberBE(r),o))}X.poseidonHashFunc=Zw;function Xw(f,r=X.poseidonSmall){return r([f,0n,1n])[0]}X.poseidonHashSingle=Xw;function Gw(f,r=X.poseidonSmall){let{m:o,rate:e}=r;if(!Array.isArray(f))throw new Error("bigint array expected in values");let t=Array.from(f);for(t.push(1n);t.length%e!==0;)t.push(0n);let n=new Array(o).fill(0n);for(let l=0;l<t.length;l+=e){for(let c=0;c<e;c++)n[c]+=t[l+c];n=r(n)}return n[0]}X.poseidonHashMany=Gw});var md=$(Lt=>{"use strict";C();F();var Yw=Lt&&Lt.__createBinding||(Object.create?function(f,r,o,e){e===void 0&&(e=o);var t=Object.getOwnPropertyDescriptor(r,o);(!t||("get"in t?!r.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(f,e,t)}:function(f,r,o,e){e===void 0&&(e=o),f[e]=r[o]}),Qw=Lt&&Lt.__setModuleDefault||(Object.create?function(f,r){Object.defineProperty(f,"default",{enumerable:!0,value:r})}:function(f,r){f.default=r}),Od=Lt&&Lt.__importStar||function(f){if(f&&f.__esModule)return f;var r={};if(f!=null)for(var o in f)o!=="default"&&Object.prototype.hasOwnProperty.call(f,o)&&Yw(r,f,o);return Qw(r,f),r};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.bytesToHex=Lt.hexToBytes=Lt.stark=Lt.secp256k1=void 0;Lt.secp256k1=Od(od());Lt.stark=Od(Ad());var Sd=mn();Object.defineProperty(Lt,"hexToBytes",{enumerable:!0,get:function(){return Sd.hexToBytes}});Object.defineProperty(Lt,"bytesToHex",{enumerable:!0,get:function(){return Sd.bytesToHex}})});var Id=$(Pt=>{"use strict";C();F();var jw=Pt&&Pt.__createBinding||(Object.create?function(f,r,o,e){e===void 0&&(e=o);var t=Object.getOwnPropertyDescriptor(r,o);(!t||("get"in t?!r.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(f,e,t)}:function(f,r,o,e){e===void 0&&(e=o),f[e]=r[o]}),eg=Pt&&Pt.__setModuleDefault||(Object.create?function(f,r){Object.defineProperty(f,"default",{enumerable:!0,value:r})}:function(f,r){f.default=r}),vi=Pt&&Pt.__importStar||function(f){if(f&&f.__esModule)return f;var r={};if(f!=null)for(var o in f)o!=="default"&&Object.prototype.hasOwnProperty.call(f,o)&&jw(r,f,o);return eg(r,f),r};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.schnorr=Pt.p256=Pt.ed25519=Pt.secp256k1=void 0;Pt.secp256k1=vi(pu());Pt.ed25519=vi(Su());Pt.p256=vi(xu());Pt.schnorr=vi(md())});var xd=$(Wr=>{"use strict";C();F();var tg=Wr&&Wr.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(Wr,"__esModule",{value:!0});Wr.Decimal=void 0;var hr=tg(pt()),Bd=100,st=class{static fromUserInput(r,o){st.verifyFractionalDigits(o);let e=r.match(/[^0-9.]/);if(e)throw new Error(`Invalid character at position ${e.index+1}`);let t,n;if(r.search(/\./)===-1)t=r,n="";else{let c=r.split(".");switch(c.length){case 0:case 1:throw new Error("Fewer than two elements in split result. This must not happen here.");case 2:if(!c[1])throw new Error("Fractional part missing");t=c[0],n=c[1].replace(/0+$/,"");break;default:throw new Error("More than one separator found")}}if(n.length>o)throw new Error("Got more fractional digits than supported");let l=`${t}${n.padEnd(o,"0")}`;return new st(l,o)}static fromAtomics(r,o){return st.verifyFractionalDigits(o),new st(r,o)}static zero(r){return st.verifyFractionalDigits(r),new st("0",r)}static one(r){return st.verifyFractionalDigits(r),new st("1"+"0".repeat(r),r)}static verifyFractionalDigits(r){if(!Number.isInteger(r))throw new Error("Fractional digits is not an integer");if(r<0)throw new Error("Fractional digits must not be negative");if(r>Bd)throw new Error(`Fractional digits must not exceed ${Bd}`)}static compare(r,o){if(r.fractionalDigits!==o.fractionalDigits)throw new Error("Fractional digits do not match");return r.data.atomics.cmp(new hr.default(o.atomics))}get atomics(){return this.data.atomics.toString()}get fractionalDigits(){return this.data.fractionalDigits}constructor(r,o){this.data={atomics:new hr.default(r),fractionalDigits:o}}toString(){let r=new hr.default(10).pow(new hr.default(this.data.fractionalDigits)),o=this.data.atomics.div(r),e=this.data.atomics.mod(r);if(e.isZero())return o.toString();{let n=e.toString().padStart(this.data.fractionalDigits,"0").replace(/0+$/,"");return`${o.toString()}.${n}`}}toFloatApproximation(){let r=Number(this.toString());if(Number.isNaN(r))throw new Error("Conversion to number failed");return r}plus(r){if(this.fractionalDigits!==r.fractionalDigits)throw new Error("Fractional digits do not match");let o=this.data.atomics.add(new hr.default(r.atomics));return new st(o.toString(),this.fractionalDigits)}minus(r){if(this.fractionalDigits!==r.fractionalDigits)throw new Error("Fractional digits do not match");let o=this.data.atomics.sub(new hr.default(r.atomics));if(o.ltn(0))throw new Error("Difference must not be negative");return new st(o.toString(),this.fractionalDigits)}multiply(r){let o=this.data.atomics.mul(new hr.default(r.toString()));return new st(o.toString(),this.fractionalDigits)}equals(r){return st.compare(this,r)===0}isLessThan(r){return st.compare(this,r)<0}isLessThanOrEqual(r){return st.compare(this,r)<=0}isGreaterThan(r){return st.compare(this,r)>0}isGreaterThanOrEqual(r){return st.compare(this,r)>=0}};Wr.Decimal=st});var Nd=$($t=>{"use strict";C();F();var ng=$t&&$t.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty($t,"__esModule",{value:!0});$t.Uint64=$t.Uint53=$t.Int53=$t.Uint32=void 0;var Ai=ng(pt()),rg=new Ai.default("18446744073709551615",10,"be"),pr=class{static fromBigEndianBytes(r){return pr.fromBytes(r)}static fromBytes(r,o="be"){if(r.length!==4)throw new Error("Invalid input length. Expected 4 bytes.");for(let t=0;t<r.length;++t)if(!Number.isInteger(r[t])||r[t]>255||r[t]<0)throw new Error("Invalid value in byte. Found: "+r[t]);let e=o==="be"?r:Array.from(r).reverse();return new pr(e[0]*2**24+e[1]*2**16+e[2]*2**8+e[3])}static fromString(r){if(!r.match(/^[0-9]+$/))throw new Error("Invalid string format");return new pr(Number.parseInt(r,10))}constructor(r){if(Number.isNaN(r))throw new Error("Input is not a number");if(!Number.isInteger(r))throw new Error("Input is not an integer");if(r<0||r>4294967295)throw new Error("Input not in uint32 range: "+r.toString());this.data=r}toBytesBigEndian(){return new Uint8Array([Math.floor(this.data/2**24)&255,Math.floor(this.data/2**16)&255,Math.floor(this.data/2**8)&255,Math.floor(this.data/2**0)&255])}toBytesLittleEndian(){return new Uint8Array([Math.floor(this.data/2**0)&255,Math.floor(this.data/2**8)&255,Math.floor(this.data/2**16)&255,Math.floor(this.data/2**24)&255])}toNumber(){return this.data}toString(){return this.data.toString()}};$t.Uint32=pr;var yr=class{static fromString(r){if(!r.match(/^-?[0-9]+$/))throw new Error("Invalid string format");return new yr(Number.parseInt(r,10))}constructor(r){if(Number.isNaN(r))throw new Error("Input is not a number");if(!Number.isInteger(r))throw new Error("Input is not an integer");if(r<Number.MIN_SAFE_INTEGER||r>Number.MAX_SAFE_INTEGER)throw new Error("Input not in int53 range: "+r.toString());this.data=r}toNumber(){return this.data}toString(){return this.data.toString()}};$t.Int53=yr;var vo=class{static fromString(r){let o=yr.fromString(r);return new vo(o.toNumber())}constructor(r){let o=new yr(r);if(o.toNumber()<0)throw new Error("Input is negative");this.data=o}toNumber(){return this.data.toNumber()}toString(){return this.data.toString()}};$t.Uint53=vo;var Xn=class{static fromBytesBigEndian(r){return Xn.fromBytes(r)}static fromBytes(r,o="be"){if(r.length!==8)throw new Error("Invalid input length. Expected 8 bytes.");for(let t=0;t<r.length;++t)if(!Number.isInteger(r[t])||r[t]>255||r[t]<0)throw new Error("Invalid value in byte. Found: "+r[t]);let e=o==="be"?Array.from(r):Array.from(r).reverse();return new Xn(new Ai.default(e))}static fromString(r){if(!r.match(/^[0-9]+$/))throw new Error("Invalid string format");return new Xn(new Ai.default(r,10,"be"))}static fromNumber(r){if(Number.isNaN(r))throw new Error("Input is not a number");if(!Number.isInteger(r))throw new Error("Input is not an integer");let o;try{o=new Ai.default(r)}catch{throw new Error("Input is not a safe integer")}return new Xn(o)}constructor(r){if(r.isNeg())throw new Error("Input is negative");if(r.gt(rg))throw new Error("Input exceeds uint64 range");this.data=r}toBytesBigEndian(){return Uint8Array.from(this.data.toArray("be",8))}toBytesLittleEndian(){return Uint8Array.from(this.data.toArray("le",8))}toString(){return this.data.toString(10)}toNumber(){return this.data.toNumber()}};$t.Uint64=Xn});var kd=$(Zt=>{"use strict";C();F();Object.defineProperty(Zt,"__esModule",{value:!0});Zt.Uint64=Zt.Uint53=Zt.Uint32=Zt.Int53=Zt.Decimal=void 0;var og=xd();Object.defineProperty(Zt,"Decimal",{enumerable:!0,get:function(){return og.Decimal}});var Oi=Nd();Object.defineProperty(Zt,"Int53",{enumerable:!0,get:function(){return Oi.Int53}});Object.defineProperty(Zt,"Uint32",{enumerable:!0,get:function(){return Oi.Uint32}});Object.defineProperty(Zt,"Uint53",{enumerable:!0,get:function(){return Oi.Uint53}});Object.defineProperty(Zt,"Uint64",{enumerable:!0,get:function(){return Oi.Uint64}})});var Pd=$((Ld,bf)=>{C();F();var Td=function(f){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var r=null;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function o(y,h,g){this.low=y|0,this.high=h|0,this.unsigned=!!g}o.prototype.__isLong__,Object.defineProperty(o.prototype,"__isLong__",{value:!0});function e(y){return(y&&y.__isLong__)===!0}function t(y){var h=Math.clz32(y&-y);return y?31-h:h}o.isLong=e;var n={},l={};function c(y,h){var g,N,L;return h?(y>>>=0,(L=0<=y&&y<256)&&(N=l[y],N)?N:(g=b(y,0,!0),L&&(l[y]=g),g)):(y|=0,(L=-128<=y&&y<128)&&(N=n[y],N)?N:(g=b(y,y<0?-1:0,!1),L&&(n[y]=g),g))}o.fromInt=c;function u(y,h){if(isNaN(y))return h?R:M;if(h){if(y<0)return R;if(y>=T)return Q}else{if(y<=-E)return k;if(y+1>=E)return U}return y<0?u(-y,h).neg():b(y%O|0,y/O|0,h)}o.fromNumber=u;function b(y,h,g){return new o(y,h,g)}o.fromBits=b;var A=Math.pow;function w(y,h,g){if(y.length===0)throw Error("empty string");if(typeof h=="number"?(g=h,h=!1):h=!!h,y==="NaN"||y==="Infinity"||y==="+Infinity"||y==="-Infinity")return h?R:M;if(g=g||10,g<2||36<g)throw RangeError("radix");var N;if((N=y.indexOf("-"))>0)throw Error("interior hyphen");if(N===0)return w(y.substring(1),h,g).neg();for(var L=u(A(g,8)),S=M,s=0;s<y.length;s+=8){var x=Math.min(8,y.length-s),W=parseInt(y.substring(s,s+x),g);if(x<8){var K=u(A(g,x));S=S.mul(K).add(u(W))}else S=S.mul(L),S=S.add(u(W))}return S.unsigned=h,S}o.fromString=w;function B(y,h){return typeof y=="number"?u(y,h):typeof y=="string"?w(y,h):b(y.low,y.high,typeof h=="boolean"?h:y.unsigned)}o.fromValue=B;var m=1<<16,I=1<<24,O=m*m,T=O*O,E=T/2,z=c(I),M=c(0);o.ZERO=M;var R=c(0,!0);o.UZERO=R;var D=c(1);o.ONE=D;var _=c(1,!0);o.UONE=_;var q=c(-1);o.NEG_ONE=q;var U=b(-1,2147483647,!1);o.MAX_VALUE=U;var Q=b(-1,-1,!0);o.MAX_UNSIGNED_VALUE=Q;var k=b(0,-2147483648,!1);o.MIN_VALUE=k;var a=o.prototype;a.toInt=function(){return this.unsigned?this.low>>>0:this.low},a.toNumber=function(){return this.unsigned?(this.high>>>0)*O+(this.low>>>0):this.high*O+(this.low>>>0)},a.toString=function(h){if(h=h||10,h<2||36<h)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(k)){var g=u(h),N=this.div(g),L=N.mul(g).sub(this);return N.toString(h)+L.toInt().toString(h)}else return"-"+this.neg().toString(h);for(var S=u(A(h,6),this.unsigned),s=this,x="";;){var W=s.div(S),K=s.sub(W.mul(S)).toInt()>>>0,J=K.toString(h);if(s=W,s.isZero())return J+x;for(;J.length<6;)J="0"+J;x=""+J+x}},a.getHighBits=function(){return this.high},a.getHighBitsUnsigned=function(){return this.high>>>0},a.getLowBits=function(){return this.low},a.getLowBitsUnsigned=function(){return this.low>>>0},a.getNumBitsAbs=function(){if(this.isNegative())return this.eq(k)?64:this.neg().getNumBitsAbs();for(var h=this.high!=0?this.high:this.low,g=31;g>0&&(h&1<<g)==0;g--);return this.high!=0?g+33:g+1},a.isZero=function(){return this.high===0&&this.low===0},a.eqz=a.isZero,a.isNegative=function(){return!this.unsigned&&this.high<0},a.isPositive=function(){return this.unsigned||this.high>=0},a.isOdd=function(){return(this.low&1)===1},a.isEven=function(){return(this.low&1)===0},a.equals=function(h){return e(h)||(h=B(h)),this.unsigned!==h.unsigned&&this.high>>>31===1&&h.high>>>31===1?!1:this.high===h.high&&this.low===h.low},a.eq=a.equals,a.notEquals=function(h){return!this.eq(h)},a.neq=a.notEquals,a.ne=a.notEquals,a.lessThan=function(h){return this.comp(h)<0},a.lt=a.lessThan,a.lessThanOrEqual=function(h){return this.comp(h)<=0},a.lte=a.lessThanOrEqual,a.le=a.lessThanOrEqual,a.greaterThan=function(h){return this.comp(h)>0},a.gt=a.greaterThan,a.greaterThanOrEqual=function(h){return this.comp(h)>=0},a.gte=a.greaterThanOrEqual,a.ge=a.greaterThanOrEqual,a.compare=function(h){if(e(h)||(h=B(h)),this.eq(h))return 0;var g=this.isNegative(),N=h.isNegative();return g&&!N?-1:!g&&N?1:this.unsigned?h.high>>>0>this.high>>>0||h.high===this.high&&h.low>>>0>this.low>>>0?-1:1:this.sub(h).isNegative()?-1:1},a.comp=a.compare,a.negate=function(){return!this.unsigned&&this.eq(k)?k:this.not().add(D)},a.neg=a.negate,a.add=function(h){e(h)||(h=B(h));var g=this.high>>>16,N=this.high&65535,L=this.low>>>16,S=this.low&65535,s=h.high>>>16,x=h.high&65535,W=h.low>>>16,K=h.low&65535,J=0,G=0,ee=0,te=0;return te+=S+K,ee+=te>>>16,te&=65535,ee+=L+W,G+=ee>>>16,ee&=65535,G+=N+x,J+=G>>>16,G&=65535,J+=g+s,J&=65535,b(ee<<16|te,J<<16|G,this.unsigned)},a.subtract=function(h){return e(h)||(h=B(h)),this.add(h.neg())},a.sub=a.subtract,a.multiply=function(h){if(this.isZero())return this;if(e(h)||(h=B(h)),r){var g=r.mul(this.low,this.high,h.low,h.high);return b(g,r.get_high(),this.unsigned)}if(h.isZero())return this.unsigned?R:M;if(this.eq(k))return h.isOdd()?k:M;if(h.eq(k))return this.isOdd()?k:M;if(this.isNegative())return h.isNegative()?this.neg().mul(h.neg()):this.neg().mul(h).neg();if(h.isNegative())return this.mul(h.neg()).neg();if(this.lt(z)&&h.lt(z))return u(this.toNumber()*h.toNumber(),this.unsigned);var N=this.high>>>16,L=this.high&65535,S=this.low>>>16,s=this.low&65535,x=h.high>>>16,W=h.high&65535,K=h.low>>>16,J=h.low&65535,G=0,ee=0,te=0,ke=0;return ke+=s*J,te+=ke>>>16,ke&=65535,te+=S*J,ee+=te>>>16,te&=65535,te+=s*K,ee+=te>>>16,te&=65535,ee+=L*J,G+=ee>>>16,ee&=65535,ee+=S*K,G+=ee>>>16,ee&=65535,ee+=s*W,G+=ee>>>16,ee&=65535,G+=N*J+L*K+S*W+s*x,G&=65535,b(te<<16|ke,G<<16|ee,this.unsigned)},a.mul=a.multiply,a.divide=function(h){if(e(h)||(h=B(h)),h.isZero())throw Error("division by zero");if(r){if(!this.unsigned&&this.high===-2147483648&&h.low===-1&&h.high===-1)return this;var g=(this.unsigned?r.div_u:r.div_s)(this.low,this.high,h.low,h.high);return b(g,r.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?R:M;var N,L,S;if(this.unsigned){if(h.unsigned||(h=h.toUnsigned()),h.gt(this))return R;if(h.gt(this.shru(1)))return _;S=R}else{if(this.eq(k)){if(h.eq(D)||h.eq(q))return k;if(h.eq(k))return D;var s=this.shr(1);return N=s.div(h).shl(1),N.eq(M)?h.isNegative()?D:q:(L=this.sub(h.mul(N)),S=N.add(L.div(h)),S)}else if(h.eq(k))return this.unsigned?R:M;if(this.isNegative())return h.isNegative()?this.neg().div(h.neg()):this.neg().div(h).neg();if(h.isNegative())return this.div(h.neg()).neg();S=M}for(L=this;L.gte(h);){N=Math.max(1,Math.floor(L.toNumber()/h.toNumber()));for(var x=Math.ceil(Math.log(N)/Math.LN2),W=x<=48?1:A(2,x-48),K=u(N),J=K.mul(h);J.isNegative()||J.gt(L);)N-=W,K=u(N,this.unsigned),J=K.mul(h);K.isZero()&&(K=D),S=S.add(K),L=L.sub(J)}return S},a.div=a.divide,a.modulo=function(h){if(e(h)||(h=B(h)),r){var g=(this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,h.low,h.high);return b(g,r.get_high(),this.unsigned)}return this.sub(this.div(h).mul(h))},a.mod=a.modulo,a.rem=a.modulo,a.not=function(){return b(~this.low,~this.high,this.unsigned)},a.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},a.clz=a.countLeadingZeros,a.countTrailingZeros=function(){return this.low?t(this.low):t(this.high)+32},a.ctz=a.countTrailingZeros,a.and=function(h){return e(h)||(h=B(h)),b(this.low&h.low,this.high&h.high,this.unsigned)},a.or=function(h){return e(h)||(h=B(h)),b(this.low|h.low,this.high|h.high,this.unsigned)},a.xor=function(h){return e(h)||(h=B(h)),b(this.low^h.low,this.high^h.high,this.unsigned)},a.shiftLeft=function(h){return e(h)&&(h=h.toInt()),(h&=63)===0?this:h<32?b(this.low<<h,this.high<<h|this.low>>>32-h,this.unsigned):b(0,this.low<<h-32,this.unsigned)},a.shl=a.shiftLeft,a.shiftRight=function(h){return e(h)&&(h=h.toInt()),(h&=63)===0?this:h<32?b(this.low>>>h|this.high<<32-h,this.high>>h,this.unsigned):b(this.high>>h-32,this.high>=0?0:-1,this.unsigned)},a.shr=a.shiftRight,a.shiftRightUnsigned=function(h){return e(h)&&(h=h.toInt()),(h&=63)===0?this:h<32?b(this.low>>>h|this.high<<32-h,this.high>>>h,this.unsigned):h===32?b(this.high,0,this.unsigned):b(this.high>>>h-32,0,this.unsigned)},a.shru=a.shiftRightUnsigned,a.shr_u=a.shiftRightUnsigned,a.rotateLeft=function(h){var g;return e(h)&&(h=h.toInt()),(h&=63)===0?this:h===32?b(this.high,this.low,this.unsigned):h<32?(g=32-h,b(this.low<<h|this.high>>>g,this.high<<h|this.low>>>g,this.unsigned)):(h-=32,g=32-h,b(this.high<<h|this.low>>>g,this.low<<h|this.high>>>g,this.unsigned))},a.rotl=a.rotateLeft,a.rotateRight=function(h){var g;return e(h)&&(h=h.toInt()),(h&=63)===0?this:h===32?b(this.high,this.low,this.unsigned):h<32?(g=32-h,b(this.high<<g|this.low>>>h,this.low<<g|this.high>>>h,this.unsigned)):(h-=32,g=32-h,b(this.low<<g|this.high>>>h,this.high<<g|this.low>>>h,this.unsigned))},a.rotr=a.rotateRight,a.toSigned=function(){return this.unsigned?b(this.low,this.high,!1):this},a.toUnsigned=function(){return this.unsigned?this:b(this.low,this.high,!0)},a.toBytes=function(h){return h?this.toBytesLE():this.toBytesBE()},a.toBytesLE=function(){var h=this.high,g=this.low;return[g&255,g>>>8&255,g>>>16&255,g>>>24,h&255,h>>>8&255,h>>>16&255,h>>>24]},a.toBytesBE=function(){var h=this.high,g=this.low;return[h>>>24,h>>>16&255,h>>>8&255,h&255,g>>>24,g>>>16&255,g>>>8&255,g&255]},o.fromBytes=function(h,g,N){return N?o.fromBytesLE(h,g):o.fromBytesBE(h,g)},o.fromBytesLE=function(h,g){return new o(h[0]|h[1]<<8|h[2]<<16|h[3]<<24,h[4]|h[5]<<8|h[6]<<16|h[7]<<24,g)},o.fromBytesBE=function(h,g){return new o(h[4]<<24|h[5]<<16|h[6]<<8|h[7],h[0]<<24|h[1]<<16|h[2]<<8|h[3],g)};var p=o;return f.default=p,"default"in f?f.default:f}({});typeof define=="function"&&define.amd?define([],function(){return Td}):typeof bf=="object"&&typeof Ld=="object"&&(bf.exports=Td)});var ul=$(oe=>{"use strict";C();F();var Ed=oe&&oe.__createBinding||(Object.create?function(f,r,o,e){e===void 0&&(e=o);var t=Object.getOwnPropertyDescriptor(r,o);(!t||("get"in t?!r.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(f,e,t)}:function(f,r,o,e){e===void 0&&(e=o),f[e]=r[o]}),ig=oe&&oe.__setModuleDefault||(Object.create?function(f,r){Object.defineProperty(f,"default",{enumerable:!0,value:r})}:function(f,r){f.default=r}),rn=oe&&oe.__importStar||function(f){if(f&&f.__esModule)return f;var r={};if(f!=null)for(var o in f)o!=="default"&&Object.prototype.hasOwnProperty.call(f,o)&&Ed(r,f,o);return ig(r,f),r},Cd=oe&&oe.__exportStar||function(f,r){for(var o in f)o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o)&&Ed(r,f,o)},Si=oe&&oe.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(oe,"__esModule",{value:!0});oe.secp256k1=oe.ed25519=oe.Long=oe._m0=oe.protobuf=oe.typeforce=oe.safeBuffer=oe.BigNumber=oe.BN=oe.math=oe.signUtil=oe.abi=oe.elliptic=oe.bip39=oe.bip32=oe.base=void 0;oe.base=rn(tr());oe.bip32=rn(Ma());oe.bip39=rn(zl());oe.elliptic=rn(zr());oe.abi=rn(cu());oe.signUtil=rn(Id());oe.math=rn(kd());var lg=Si(pt());oe.BN=lg.default;var fg=Si(Hd());oe.BigNumber=fg.default;var cg=Si(_d());oe.safeBuffer=cg.default;var ag=Cf();oe.typeforce=ag;oe.protobuf=rn(Kd());oe._m0=rn(Jd());var ug=Si(Pd());oe.Long=ug.default;oe.ed25519=rn($d());oe.secp256k1=rn(Zd());Cd((Gd(),Pf(Xd)),oe);Cd((Qd(),Pf(Yd)),oe)});var sg=$((IA,Fd)=>{C();F();var dg=ul(),V=dg._m0,v=V.Reader,H=V.Writer,i=V.util,d=V.roots.default||(V.roots.default={});d.protocol=function(){var f={};return f.AccountType=function(){var r={},o=Object.create(r);return o[r[0]="Normal"]=0,o[r[1]="AssetIssue"]=1,o[r[2]="Contract"]=2,o}(),f.AccountId=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.name=i.newBuffer([]),r.prototype.address=i.newBuffer([]),r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.name!=null&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).bytes(e.name),e.address!=null&&Object.hasOwnProperty.call(e,"address")&&t.uint32(18).bytes(e.address),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.AccountId;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.name=e.bytes();break;case 2:l.address=e.bytes();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.name!=null&&e.hasOwnProperty("name")&&!(e.name&&typeof e.name.length=="number"||i.isString(e.name))?"name: buffer expected":e.address!=null&&e.hasOwnProperty("address")&&!(e.address&&typeof e.address.length=="number"||i.isString(e.address))?"address: buffer expected":null},r.fromObject=function(e){if(e instanceof d.protocol.AccountId)return e;var t=new d.protocol.AccountId;return e.name!=null&&(typeof e.name=="string"?i.base64.decode(e.name,t.name=i.newBuffer(i.base64.length(e.name)),0):e.name.length&&(t.name=e.name)),e.address!=null&&(typeof e.address=="string"?i.base64.decode(e.address,t.address=i.newBuffer(i.base64.length(e.address)),0):e.address.length&&(t.address=e.address)),t},r.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(t.bytes===String?n.name="":(n.name=[],t.bytes!==Array&&(n.name=i.newBuffer(n.name))),t.bytes===String?n.address="":(n.address=[],t.bytes!==Array&&(n.address=i.newBuffer(n.address)))),e.name!=null&&e.hasOwnProperty("name")&&(n.name=t.bytes===String?i.base64.encode(e.name,0,e.name.length):t.bytes===Array?Array.prototype.slice.call(e.name):e.name),e.address!=null&&e.hasOwnProperty("address")&&(n.address=t.bytes===String?i.base64.encode(e.address,0,e.address.length):t.bytes===Array?Array.prototype.slice.call(e.address):e.address),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.Vote=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.voteAddress=i.newBuffer([]),r.prototype.voteCount=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.voteAddress!=null&&Object.hasOwnProperty.call(e,"voteAddress")&&t.uint32(10).bytes(e.voteAddress),e.voteCount!=null&&Object.hasOwnProperty.call(e,"voteCount")&&t.uint32(16).int64(e.voteCount),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.Vote;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.voteAddress=e.bytes();break;case 2:l.voteCount=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.voteAddress!=null&&e.hasOwnProperty("voteAddress")&&!(e.voteAddress&&typeof e.voteAddress.length=="number"||i.isString(e.voteAddress))?"voteAddress: buffer expected":e.voteCount!=null&&e.hasOwnProperty("voteCount")&&!i.isInteger(e.voteCount)&&!(e.voteCount&&i.isInteger(e.voteCount.low)&&i.isInteger(e.voteCount.high))?"voteCount: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.Vote)return e;var t=new d.protocol.Vote;return e.voteAddress!=null&&(typeof e.voteAddress=="string"?i.base64.decode(e.voteAddress,t.voteAddress=i.newBuffer(i.base64.length(e.voteAddress)),0):e.voteAddress.length&&(t.voteAddress=e.voteAddress)),e.voteCount!=null&&(i.Long?(t.voteCount=i.Long.fromValue(e.voteCount)).unsigned=!1:typeof e.voteCount=="string"?t.voteCount=parseInt(e.voteCount,10):typeof e.voteCount=="number"?t.voteCount=e.voteCount:typeof e.voteCount=="object"&&(t.voteCount=new i.LongBits(e.voteCount.low>>>0,e.voteCount.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults)if(t.bytes===String?n.voteAddress="":(n.voteAddress=[],t.bytes!==Array&&(n.voteAddress=i.newBuffer(n.voteAddress))),i.Long){var l=new i.Long(0,0,!1);n.voteCount=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.voteCount=t.longs===String?"0":0;return e.voteAddress!=null&&e.hasOwnProperty("voteAddress")&&(n.voteAddress=t.bytes===String?i.base64.encode(e.voteAddress,0,e.voteAddress.length):t.bytes===Array?Array.prototype.slice.call(e.voteAddress):e.voteAddress),e.voteCount!=null&&e.hasOwnProperty("voteCount")&&(typeof e.voteCount=="number"?n.voteCount=t.longs===String?String(e.voteCount):e.voteCount:n.voteCount=t.longs===String?i.Long.prototype.toString.call(e.voteCount):t.longs===Number?new i.LongBits(e.voteCount.low>>>0,e.voteCount.high>>>0).toNumber():e.voteCount),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.Proposal=function(){function r(o){if(this.parameters={},this.approvals=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.proposalId=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.proposerAddress=i.newBuffer([]),r.prototype.parameters=i.emptyObject,r.prototype.expirationTime=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.createTime=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.approvals=i.emptyArray,r.prototype.state=0,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.proposalId!=null&&Object.hasOwnProperty.call(e,"proposalId")&&t.uint32(8).int64(e.proposalId),e.proposerAddress!=null&&Object.hasOwnProperty.call(e,"proposerAddress")&&t.uint32(18).bytes(e.proposerAddress),e.parameters!=null&&Object.hasOwnProperty.call(e,"parameters"))for(var n=Object.keys(e.parameters),l=0;l<n.length;++l)t.uint32(26).fork().uint32(8).int64(n[l]).uint32(16).int64(e.parameters[n[l]]).ldelim();if(e.expirationTime!=null&&Object.hasOwnProperty.call(e,"expirationTime")&&t.uint32(32).int64(e.expirationTime),e.createTime!=null&&Object.hasOwnProperty.call(e,"createTime")&&t.uint32(40).int64(e.createTime),e.approvals!=null&&e.approvals.length)for(var l=0;l<e.approvals.length;++l)t.uint32(50).bytes(e.approvals[l]);return e.state!=null&&Object.hasOwnProperty.call(e,"state")&&t.uint32(56).int32(e.state),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.Proposal,c,u;e.pos<n;){var b=e.uint32();switch(b>>>3){case 1:l.proposalId=e.int64();break;case 2:l.proposerAddress=e.bytes();break;case 3:l.parameters===i.emptyObject&&(l.parameters={});var A=e.uint32()+e.pos;for(c=0,u=0;e.pos<A;){var w=e.uint32();switch(w>>>3){case 1:c=e.int64();break;case 2:u=e.int64();break;default:e.skipType(w&7);break}}l.parameters[typeof c=="object"?i.longToHash(c):c]=u;break;case 4:l.expirationTime=e.int64();break;case 5:l.createTime=e.int64();break;case 6:l.approvals&&l.approvals.length||(l.approvals=[]),l.approvals.push(e.bytes());break;case 7:l.state=e.int32();break;default:e.skipType(b&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.proposalId!=null&&e.hasOwnProperty("proposalId")&&!i.isInteger(e.proposalId)&&!(e.proposalId&&i.isInteger(e.proposalId.low)&&i.isInteger(e.proposalId.high)))return"proposalId: integer|Long expected";if(e.proposerAddress!=null&&e.hasOwnProperty("proposerAddress")&&!(e.proposerAddress&&typeof e.proposerAddress.length=="number"||i.isString(e.proposerAddress)))return"proposerAddress: buffer expected";if(e.parameters!=null&&e.hasOwnProperty("parameters")){if(!i.isObject(e.parameters))return"parameters: object expected";for(var t=Object.keys(e.parameters),n=0;n<t.length;++n){if(!i.key64Re.test(t[n]))return"parameters: integer|Long key{k:int64} expected";if(!i.isInteger(e.parameters[t[n]])&&!(e.parameters[t[n]]&&i.isInteger(e.parameters[t[n]].low)&&i.isInteger(e.parameters[t[n]].high)))return"parameters: integer|Long{k:int64} expected"}}if(e.expirationTime!=null&&e.hasOwnProperty("expirationTime")&&!i.isInteger(e.expirationTime)&&!(e.expirationTime&&i.isInteger(e.expirationTime.low)&&i.isInteger(e.expirationTime.high)))return"expirationTime: integer|Long expected";if(e.createTime!=null&&e.hasOwnProperty("createTime")&&!i.isInteger(e.createTime)&&!(e.createTime&&i.isInteger(e.createTime.low)&&i.isInteger(e.createTime.high)))return"createTime: integer|Long expected";if(e.approvals!=null&&e.hasOwnProperty("approvals")){if(!Array.isArray(e.approvals))return"approvals: array expected";for(var n=0;n<e.approvals.length;++n)if(!(e.approvals[n]&&typeof e.approvals[n].length=="number"||i.isString(e.approvals[n])))return"approvals: buffer[] expected"}if(e.state!=null&&e.hasOwnProperty("state"))switch(e.state){default:return"state: enum value expected";case 0:case 1:case 2:case 3:break}return null},r.fromObject=function(e){if(e instanceof d.protocol.Proposal)return e;var t=new d.protocol.Proposal;if(e.proposalId!=null&&(i.Long?(t.proposalId=i.Long.fromValue(e.proposalId)).unsigned=!1:typeof e.proposalId=="string"?t.proposalId=parseInt(e.proposalId,10):typeof e.proposalId=="number"?t.proposalId=e.proposalId:typeof e.proposalId=="object"&&(t.proposalId=new i.LongBits(e.proposalId.low>>>0,e.proposalId.high>>>0).toNumber())),e.proposerAddress!=null&&(typeof e.proposerAddress=="string"?i.base64.decode(e.proposerAddress,t.proposerAddress=i.newBuffer(i.base64.length(e.proposerAddress)),0):e.proposerAddress.length&&(t.proposerAddress=e.proposerAddress)),e.parameters){if(typeof e.parameters!="object")throw TypeError(".protocol.Proposal.parameters: object expected");t.parameters={};for(var n=Object.keys(e.parameters),l=0;l<n.length;++l)i.Long?(t.parameters[n[l]]=i.Long.fromValue(e.parameters[n[l]])).unsigned=!1:typeof e.parameters[n[l]]=="string"?t.parameters[n[l]]=parseInt(e.parameters[n[l]],10):typeof e.parameters[n[l]]=="number"?t.parameters[n[l]]=e.parameters[n[l]]:typeof e.parameters[n[l]]=="object"&&(t.parameters[n[l]]=new i.LongBits(e.parameters[n[l]].low>>>0,e.parameters[n[l]].high>>>0).toNumber())}if(e.expirationTime!=null&&(i.Long?(t.expirationTime=i.Long.fromValue(e.expirationTime)).unsigned=!1:typeof e.expirationTime=="string"?t.expirationTime=parseInt(e.expirationTime,10):typeof e.expirationTime=="number"?t.expirationTime=e.expirationTime:typeof e.expirationTime=="object"&&(t.expirationTime=new i.LongBits(e.expirationTime.low>>>0,e.expirationTime.high>>>0).toNumber())),e.createTime!=null&&(i.Long?(t.createTime=i.Long.fromValue(e.createTime)).unsigned=!1:typeof e.createTime=="string"?t.createTime=parseInt(e.createTime,10):typeof e.createTime=="number"?t.createTime=e.createTime:typeof e.createTime=="object"&&(t.createTime=new i.LongBits(e.createTime.low>>>0,e.createTime.high>>>0).toNumber())),e.approvals){if(!Array.isArray(e.approvals))throw TypeError(".protocol.Proposal.approvals: array expected");t.approvals=[];for(var l=0;l<e.approvals.length;++l)typeof e.approvals[l]=="string"?i.base64.decode(e.approvals[l],t.approvals[l]=i.newBuffer(i.base64.length(e.approvals[l])),0):e.approvals[l].length&&(t.approvals[l]=e.approvals[l])}switch(e.state){case"PENDING":case 0:t.state=0;break;case"DISAPPROVED":case 1:t.state=1;break;case"APPROVED":case 2:t.state=2;break;case"CANCELED":case 3:t.state=3;break}return t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.approvals=[]),(t.objects||t.defaults)&&(n.parameters={}),t.defaults){if(i.Long){var l=new i.Long(0,0,!1);n.proposalId=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.proposalId=t.longs===String?"0":0;if(t.bytes===String?n.proposerAddress="":(n.proposerAddress=[],t.bytes!==Array&&(n.proposerAddress=i.newBuffer(n.proposerAddress))),i.Long){var l=new i.Long(0,0,!1);n.expirationTime=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.expirationTime=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.createTime=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.createTime=t.longs===String?"0":0;n.state=t.enums===String?"PENDING":0}e.proposalId!=null&&e.hasOwnProperty("proposalId")&&(typeof e.proposalId=="number"?n.proposalId=t.longs===String?String(e.proposalId):e.proposalId:n.proposalId=t.longs===String?i.Long.prototype.toString.call(e.proposalId):t.longs===Number?new i.LongBits(e.proposalId.low>>>0,e.proposalId.high>>>0).toNumber():e.proposalId),e.proposerAddress!=null&&e.hasOwnProperty("proposerAddress")&&(n.proposerAddress=t.bytes===String?i.base64.encode(e.proposerAddress,0,e.proposerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.proposerAddress):e.proposerAddress);var c;if(e.parameters&&(c=Object.keys(e.parameters)).length){n.parameters={};for(var u=0;u<c.length;++u)typeof e.parameters[c[u]]=="number"?n.parameters[c[u]]=t.longs===String?String(e.parameters[c[u]]):e.parameters[c[u]]:n.parameters[c[u]]=t.longs===String?i.Long.prototype.toString.call(e.parameters[c[u]]):t.longs===Number?new i.LongBits(e.parameters[c[u]].low>>>0,e.parameters[c[u]].high>>>0).toNumber():e.parameters[c[u]]}if(e.expirationTime!=null&&e.hasOwnProperty("expirationTime")&&(typeof e.expirationTime=="number"?n.expirationTime=t.longs===String?String(e.expirationTime):e.expirationTime:n.expirationTime=t.longs===String?i.Long.prototype.toString.call(e.expirationTime):t.longs===Number?new i.LongBits(e.expirationTime.low>>>0,e.expirationTime.high>>>0).toNumber():e.expirationTime),e.createTime!=null&&e.hasOwnProperty("createTime")&&(typeof e.createTime=="number"?n.createTime=t.longs===String?String(e.createTime):e.createTime:n.createTime=t.longs===String?i.Long.prototype.toString.call(e.createTime):t.longs===Number?new i.LongBits(e.createTime.low>>>0,e.createTime.high>>>0).toNumber():e.createTime),e.approvals&&e.approvals.length){n.approvals=[];for(var u=0;u<e.approvals.length;++u)n.approvals[u]=t.bytes===String?i.base64.encode(e.approvals[u],0,e.approvals[u].length):t.bytes===Array?Array.prototype.slice.call(e.approvals[u]):e.approvals[u]}return e.state!=null&&e.hasOwnProperty("state")&&(n.state=t.enums===String?d.protocol.Proposal.State[e.state]:e.state),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r.State=function(){var o={},e=Object.create(o);return e[o[0]="PENDING"]=0,e[o[1]="DISAPPROVED"]=1,e[o[2]="APPROVED"]=2,e[o[3]="CANCELED"]=3,e}(),r}(),f.Exchange=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.exchangeId=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.creatorAddress=i.newBuffer([]),r.prototype.createTime=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.firstTokenId=i.newBuffer([]),r.prototype.firstTokenBalance=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.secondTokenId=i.newBuffer([]),r.prototype.secondTokenBalance=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.exchangeId!=null&&Object.hasOwnProperty.call(e,"exchangeId")&&t.uint32(8).int64(e.exchangeId),e.creatorAddress!=null&&Object.hasOwnProperty.call(e,"creatorAddress")&&t.uint32(18).bytes(e.creatorAddress),e.createTime!=null&&Object.hasOwnProperty.call(e,"createTime")&&t.uint32(24).int64(e.createTime),e.firstTokenId!=null&&Object.hasOwnProperty.call(e,"firstTokenId")&&t.uint32(50).bytes(e.firstTokenId),e.firstTokenBalance!=null&&Object.hasOwnProperty.call(e,"firstTokenBalance")&&t.uint32(56).int64(e.firstTokenBalance),e.secondTokenId!=null&&Object.hasOwnProperty.call(e,"secondTokenId")&&t.uint32(66).bytes(e.secondTokenId),e.secondTokenBalance!=null&&Object.hasOwnProperty.call(e,"secondTokenBalance")&&t.uint32(72).int64(e.secondTokenBalance),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.Exchange;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.exchangeId=e.int64();break;case 2:l.creatorAddress=e.bytes();break;case 3:l.createTime=e.int64();break;case 6:l.firstTokenId=e.bytes();break;case 7:l.firstTokenBalance=e.int64();break;case 8:l.secondTokenId=e.bytes();break;case 9:l.secondTokenBalance=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.exchangeId!=null&&e.hasOwnProperty("exchangeId")&&!i.isInteger(e.exchangeId)&&!(e.exchangeId&&i.isInteger(e.exchangeId.low)&&i.isInteger(e.exchangeId.high))?"exchangeId: integer|Long expected":e.creatorAddress!=null&&e.hasOwnProperty("creatorAddress")&&!(e.creatorAddress&&typeof e.creatorAddress.length=="number"||i.isString(e.creatorAddress))?"creatorAddress: buffer expected":e.createTime!=null&&e.hasOwnProperty("createTime")&&!i.isInteger(e.createTime)&&!(e.createTime&&i.isInteger(e.createTime.low)&&i.isInteger(e.createTime.high))?"createTime: integer|Long expected":e.firstTokenId!=null&&e.hasOwnProperty("firstTokenId")&&!(e.firstTokenId&&typeof e.firstTokenId.length=="number"||i.isString(e.firstTokenId))?"firstTokenId: buffer expected":e.firstTokenBalance!=null&&e.hasOwnProperty("firstTokenBalance")&&!i.isInteger(e.firstTokenBalance)&&!(e.firstTokenBalance&&i.isInteger(e.firstTokenBalance.low)&&i.isInteger(e.firstTokenBalance.high))?"firstTokenBalance: integer|Long expected":e.secondTokenId!=null&&e.hasOwnProperty("secondTokenId")&&!(e.secondTokenId&&typeof e.secondTokenId.length=="number"||i.isString(e.secondTokenId))?"secondTokenId: buffer expected":e.secondTokenBalance!=null&&e.hasOwnProperty("secondTokenBalance")&&!i.isInteger(e.secondTokenBalance)&&!(e.secondTokenBalance&&i.isInteger(e.secondTokenBalance.low)&&i.isInteger(e.secondTokenBalance.high))?"secondTokenBalance: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.Exchange)return e;var t=new d.protocol.Exchange;return e.exchangeId!=null&&(i.Long?(t.exchangeId=i.Long.fromValue(e.exchangeId)).unsigned=!1:typeof e.exchangeId=="string"?t.exchangeId=parseInt(e.exchangeId,10):typeof e.exchangeId=="number"?t.exchangeId=e.exchangeId:typeof e.exchangeId=="object"&&(t.exchangeId=new i.LongBits(e.exchangeId.low>>>0,e.exchangeId.high>>>0).toNumber())),e.creatorAddress!=null&&(typeof e.creatorAddress=="string"?i.base64.decode(e.creatorAddress,t.creatorAddress=i.newBuffer(i.base64.length(e.creatorAddress)),0):e.creatorAddress.length&&(t.creatorAddress=e.creatorAddress)),e.createTime!=null&&(i.Long?(t.createTime=i.Long.fromValue(e.createTime)).unsigned=!1:typeof e.createTime=="string"?t.createTime=parseInt(e.createTime,10):typeof e.createTime=="number"?t.createTime=e.createTime:typeof e.createTime=="object"&&(t.createTime=new i.LongBits(e.createTime.low>>>0,e.createTime.high>>>0).toNumber())),e.firstTokenId!=null&&(typeof e.firstTokenId=="string"?i.base64.decode(e.firstTokenId,t.firstTokenId=i.newBuffer(i.base64.length(e.firstTokenId)),0):e.firstTokenId.length&&(t.firstTokenId=e.firstTokenId)),e.firstTokenBalance!=null&&(i.Long?(t.firstTokenBalance=i.Long.fromValue(e.firstTokenBalance)).unsigned=!1:typeof e.firstTokenBalance=="string"?t.firstTokenBalance=parseInt(e.firstTokenBalance,10):typeof e.firstTokenBalance=="number"?t.firstTokenBalance=e.firstTokenBalance:typeof e.firstTokenBalance=="object"&&(t.firstTokenBalance=new i.LongBits(e.firstTokenBalance.low>>>0,e.firstTokenBalance.high>>>0).toNumber())),e.secondTokenId!=null&&(typeof e.secondTokenId=="string"?i.base64.decode(e.secondTokenId,t.secondTokenId=i.newBuffer(i.base64.length(e.secondTokenId)),0):e.secondTokenId.length&&(t.secondTokenId=e.secondTokenId)),e.secondTokenBalance!=null&&(i.Long?(t.secondTokenBalance=i.Long.fromValue(e.secondTokenBalance)).unsigned=!1:typeof e.secondTokenBalance=="string"?t.secondTokenBalance=parseInt(e.secondTokenBalance,10):typeof e.secondTokenBalance=="number"?t.secondTokenBalance=e.secondTokenBalance:typeof e.secondTokenBalance=="object"&&(t.secondTokenBalance=new i.LongBits(e.secondTokenBalance.low>>>0,e.secondTokenBalance.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(i.Long){var l=new i.Long(0,0,!1);n.exchangeId=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.exchangeId=t.longs===String?"0":0;if(t.bytes===String?n.creatorAddress="":(n.creatorAddress=[],t.bytes!==Array&&(n.creatorAddress=i.newBuffer(n.creatorAddress))),i.Long){var l=new i.Long(0,0,!1);n.createTime=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.createTime=t.longs===String?"0":0;if(t.bytes===String?n.firstTokenId="":(n.firstTokenId=[],t.bytes!==Array&&(n.firstTokenId=i.newBuffer(n.firstTokenId))),i.Long){var l=new i.Long(0,0,!1);n.firstTokenBalance=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.firstTokenBalance=t.longs===String?"0":0;if(t.bytes===String?n.secondTokenId="":(n.secondTokenId=[],t.bytes!==Array&&(n.secondTokenId=i.newBuffer(n.secondTokenId))),i.Long){var l=new i.Long(0,0,!1);n.secondTokenBalance=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.secondTokenBalance=t.longs===String?"0":0}return e.exchangeId!=null&&e.hasOwnProperty("exchangeId")&&(typeof e.exchangeId=="number"?n.exchangeId=t.longs===String?String(e.exchangeId):e.exchangeId:n.exchangeId=t.longs===String?i.Long.prototype.toString.call(e.exchangeId):t.longs===Number?new i.LongBits(e.exchangeId.low>>>0,e.exchangeId.high>>>0).toNumber():e.exchangeId),e.creatorAddress!=null&&e.hasOwnProperty("creatorAddress")&&(n.creatorAddress=t.bytes===String?i.base64.encode(e.creatorAddress,0,e.creatorAddress.length):t.bytes===Array?Array.prototype.slice.call(e.creatorAddress):e.creatorAddress),e.createTime!=null&&e.hasOwnProperty("createTime")&&(typeof e.createTime=="number"?n.createTime=t.longs===String?String(e.createTime):e.createTime:n.createTime=t.longs===String?i.Long.prototype.toString.call(e.createTime):t.longs===Number?new i.LongBits(e.createTime.low>>>0,e.createTime.high>>>0).toNumber():e.createTime),e.firstTokenId!=null&&e.hasOwnProperty("firstTokenId")&&(n.firstTokenId=t.bytes===String?i.base64.encode(e.firstTokenId,0,e.firstTokenId.length):t.bytes===Array?Array.prototype.slice.call(e.firstTokenId):e.firstTokenId),e.firstTokenBalance!=null&&e.hasOwnProperty("firstTokenBalance")&&(typeof e.firstTokenBalance=="number"?n.firstTokenBalance=t.longs===String?String(e.firstTokenBalance):e.firstTokenBalance:n.firstTokenBalance=t.longs===String?i.Long.prototype.toString.call(e.firstTokenBalance):t.longs===Number?new i.LongBits(e.firstTokenBalance.low>>>0,e.firstTokenBalance.high>>>0).toNumber():e.firstTokenBalance),e.secondTokenId!=null&&e.hasOwnProperty("secondTokenId")&&(n.secondTokenId=t.bytes===String?i.base64.encode(e.secondTokenId,0,e.secondTokenId.length):t.bytes===Array?Array.prototype.slice.call(e.secondTokenId):e.secondTokenId),e.secondTokenBalance!=null&&e.hasOwnProperty("secondTokenBalance")&&(typeof e.secondTokenBalance=="number"?n.secondTokenBalance=t.longs===String?String(e.secondTokenBalance):e.secondTokenBalance:n.secondTokenBalance=t.longs===String?i.Long.prototype.toString.call(e.secondTokenBalance):t.longs===Number?new i.LongBits(e.secondTokenBalance.low>>>0,e.secondTokenBalance.high>>>0).toNumber():e.secondTokenBalance),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.ChainParameters=function(){function r(o){if(this.chainParameter=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.chainParameter=i.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.chainParameter!=null&&e.chainParameter.length)for(var n=0;n<e.chainParameter.length;++n)d.protocol.ChainParameters.ChainParameter.encode(e.chainParameter[n],t.uint32(10).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.ChainParameters;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.chainParameter&&l.chainParameter.length||(l.chainParameter=[]),l.chainParameter.push(d.protocol.ChainParameters.ChainParameter.decode(e,e.uint32()));break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.chainParameter!=null&&e.hasOwnProperty("chainParameter")){if(!Array.isArray(e.chainParameter))return"chainParameter: array expected";for(var t=0;t<e.chainParameter.length;++t){var n=d.protocol.ChainParameters.ChainParameter.verify(e.chainParameter[t]);if(n)return"chainParameter."+n}}return null},r.fromObject=function(e){if(e instanceof d.protocol.ChainParameters)return e;var t=new d.protocol.ChainParameters;if(e.chainParameter){if(!Array.isArray(e.chainParameter))throw TypeError(".protocol.ChainParameters.chainParameter: array expected");t.chainParameter=[];for(var n=0;n<e.chainParameter.length;++n){if(typeof e.chainParameter[n]!="object")throw TypeError(".protocol.ChainParameters.chainParameter: object expected");t.chainParameter[n]=d.protocol.ChainParameters.ChainParameter.fromObject(e.chainParameter[n])}}return t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.chainParameter=[]),e.chainParameter&&e.chainParameter.length){n.chainParameter=[];for(var l=0;l<e.chainParameter.length;++l)n.chainParameter[l]=d.protocol.ChainParameters.ChainParameter.toObject(e.chainParameter[l],t)}return n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r.ChainParameter=function(){function o(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return o.prototype.key="",o.prototype.value=i.Long?i.Long.fromBits(0,0,!1):0,o.create=function(t){return new o(t)},o.encode=function(t,n){return n||(n=H.create()),t.key!=null&&Object.hasOwnProperty.call(t,"key")&&n.uint32(10).string(t.key),t.value!=null&&Object.hasOwnProperty.call(t,"value")&&n.uint32(16).int64(t.value),n},o.encodeDelimited=function(t,n){return this.encode(t,n).ldelim()},o.decode=function(t,n){t instanceof v||(t=v.create(t));for(var l=n===void 0?t.len:t.pos+n,c=new d.protocol.ChainParameters.ChainParameter;t.pos<l;){var u=t.uint32();switch(u>>>3){case 1:c.key=t.string();break;case 2:c.value=t.int64();break;default:t.skipType(u&7);break}}return c},o.decodeDelimited=function(t){return t instanceof v||(t=new v(t)),this.decode(t,t.uint32())},o.verify=function(t){return typeof t!="object"||t===null?"object expected":t.key!=null&&t.hasOwnProperty("key")&&!i.isString(t.key)?"key: string expected":t.value!=null&&t.hasOwnProperty("value")&&!i.isInteger(t.value)&&!(t.value&&i.isInteger(t.value.low)&&i.isInteger(t.value.high))?"value: integer|Long expected":null},o.fromObject=function(t){if(t instanceof d.protocol.ChainParameters.ChainParameter)return t;var n=new d.protocol.ChainParameters.ChainParameter;return t.key!=null&&(n.key=String(t.key)),t.value!=null&&(i.Long?(n.value=i.Long.fromValue(t.value)).unsigned=!1:typeof t.value=="string"?n.value=parseInt(t.value,10):typeof t.value=="number"?n.value=t.value:typeof t.value=="object"&&(n.value=new i.LongBits(t.value.low>>>0,t.value.high>>>0).toNumber())),n},o.toObject=function(t,n){n||(n={});var l={};if(n.defaults)if(l.key="",i.Long){var c=new i.Long(0,0,!1);l.value=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.value=n.longs===String?"0":0;return t.key!=null&&t.hasOwnProperty("key")&&(l.key=t.key),t.value!=null&&t.hasOwnProperty("value")&&(typeof t.value=="number"?l.value=n.longs===String?String(t.value):t.value:l.value=n.longs===String?i.Long.prototype.toString.call(t.value):n.longs===Number?new i.LongBits(t.value.low>>>0,t.value.high>>>0).toNumber():t.value),l},o.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},o}(),r}(),f.Account=function(){function r(o){if(this.votes=[],this.asset={},this.assetV2={},this.frozen=[],this.frozenSupply=[],this.latestAssetOperationTime={},this.latestAssetOperationTimeV2={},this.freeAssetNetUsage={},this.freeAssetNetUsageV2={},this.activePermission=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.accountName=i.newBuffer([]),r.prototype.type=0,r.prototype.address=i.newBuffer([]),r.prototype.balance=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.votes=i.emptyArray,r.prototype.asset=i.emptyObject,r.prototype.assetV2=i.emptyObject,r.prototype.frozen=i.emptyArray,r.prototype.netUsage=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.acquiredDelegatedFrozenBalanceForBandwidth=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.delegatedFrozenBalanceForBandwidth=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.createTime=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.latestOprationTime=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.allowance=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.latestWithdrawTime=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.code=i.newBuffer([]),r.prototype.isWitness=!1,r.prototype.isCommittee=!1,r.prototype.frozenSupply=i.emptyArray,r.prototype.assetIssuedName=i.newBuffer([]),r.prototype.assetIssued_ID=i.newBuffer([]),r.prototype.latestAssetOperationTime=i.emptyObject,r.prototype.latestAssetOperationTimeV2=i.emptyObject,r.prototype.freeNetUsage=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.freeAssetNetUsage=i.emptyObject,r.prototype.freeAssetNetUsageV2=i.emptyObject,r.prototype.latestConsumeTime=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.latestConsumeFreeTime=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.accountId=i.newBuffer([]),r.prototype.accountResource=null,r.prototype.codeHash=i.newBuffer([]),r.prototype.ownerPermission=null,r.prototype.witnessPermission=null,r.prototype.activePermission=i.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.accountName!=null&&Object.hasOwnProperty.call(e,"accountName")&&t.uint32(10).bytes(e.accountName),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&t.uint32(16).int32(e.type),e.address!=null&&Object.hasOwnProperty.call(e,"address")&&t.uint32(26).bytes(e.address),e.balance!=null&&Object.hasOwnProperty.call(e,"balance")&&t.uint32(32).int64(e.balance),e.votes!=null&&e.votes.length)for(var n=0;n<e.votes.length;++n)d.protocol.Vote.encode(e.votes[n],t.uint32(42).fork()).ldelim();if(e.asset!=null&&Object.hasOwnProperty.call(e,"asset"))for(var l=Object.keys(e.asset),n=0;n<l.length;++n)t.uint32(50).fork().uint32(10).string(l[n]).uint32(16).int64(e.asset[l[n]]).ldelim();if(e.frozen!=null&&e.frozen.length)for(var n=0;n<e.frozen.length;++n)d.protocol.Account.Frozen.encode(e.frozen[n],t.uint32(58).fork()).ldelim();if(e.netUsage!=null&&Object.hasOwnProperty.call(e,"netUsage")&&t.uint32(64).int64(e.netUsage),e.createTime!=null&&Object.hasOwnProperty.call(e,"createTime")&&t.uint32(72).int64(e.createTime),e.latestOprationTime!=null&&Object.hasOwnProperty.call(e,"latestOprationTime")&&t.uint32(80).int64(e.latestOprationTime),e.allowance!=null&&Object.hasOwnProperty.call(e,"allowance")&&t.uint32(88).int64(e.allowance),e.latestWithdrawTime!=null&&Object.hasOwnProperty.call(e,"latestWithdrawTime")&&t.uint32(96).int64(e.latestWithdrawTime),e.code!=null&&Object.hasOwnProperty.call(e,"code")&&t.uint32(106).bytes(e.code),e.isWitness!=null&&Object.hasOwnProperty.call(e,"isWitness")&&t.uint32(112).bool(e.isWitness),e.isCommittee!=null&&Object.hasOwnProperty.call(e,"isCommittee")&&t.uint32(120).bool(e.isCommittee),e.frozenSupply!=null&&e.frozenSupply.length)for(var n=0;n<e.frozenSupply.length;++n)d.protocol.Account.Frozen.encode(e.frozenSupply[n],t.uint32(130).fork()).ldelim();if(e.assetIssuedName!=null&&Object.hasOwnProperty.call(e,"assetIssuedName")&&t.uint32(138).bytes(e.assetIssuedName),e.latestAssetOperationTime!=null&&Object.hasOwnProperty.call(e,"latestAssetOperationTime"))for(var l=Object.keys(e.latestAssetOperationTime),n=0;n<l.length;++n)t.uint32(146).fork().uint32(10).string(l[n]).uint32(16).int64(e.latestAssetOperationTime[l[n]]).ldelim();if(e.freeNetUsage!=null&&Object.hasOwnProperty.call(e,"freeNetUsage")&&t.uint32(152).int64(e.freeNetUsage),e.freeAssetNetUsage!=null&&Object.hasOwnProperty.call(e,"freeAssetNetUsage"))for(var l=Object.keys(e.freeAssetNetUsage),n=0;n<l.length;++n)t.uint32(162).fork().uint32(10).string(l[n]).uint32(16).int64(e.freeAssetNetUsage[l[n]]).ldelim();if(e.latestConsumeTime!=null&&Object.hasOwnProperty.call(e,"latestConsumeTime")&&t.uint32(168).int64(e.latestConsumeTime),e.latestConsumeFreeTime!=null&&Object.hasOwnProperty.call(e,"latestConsumeFreeTime")&&t.uint32(176).int64(e.latestConsumeFreeTime),e.accountId!=null&&Object.hasOwnProperty.call(e,"accountId")&&t.uint32(186).bytes(e.accountId),e.accountResource!=null&&Object.hasOwnProperty.call(e,"accountResource")&&d.protocol.Account.AccountResource.encode(e.accountResource,t.uint32(210).fork()).ldelim(),e.codeHash!=null&&Object.hasOwnProperty.call(e,"codeHash")&&t.uint32(242).bytes(e.codeHash),e.ownerPermission!=null&&Object.hasOwnProperty.call(e,"ownerPermission")&&d.protocol.Permission.encode(e.ownerPermission,t.uint32(250).fork()).ldelim(),e.witnessPermission!=null&&Object.hasOwnProperty.call(e,"witnessPermission")&&d.protocol.Permission.encode(e.witnessPermission,t.uint32(258).fork()).ldelim(),e.activePermission!=null&&e.activePermission.length)for(var n=0;n<e.activePermission.length;++n)d.protocol.Permission.encode(e.activePermission[n],t.uint32(266).fork()).ldelim();if(e.acquiredDelegatedFrozenBalanceForBandwidth!=null&&Object.hasOwnProperty.call(e,"acquiredDelegatedFrozenBalanceForBandwidth")&&t.uint32(328).int64(e.acquiredDelegatedFrozenBalanceForBandwidth),e.delegatedFrozenBalanceForBandwidth!=null&&Object.hasOwnProperty.call(e,"delegatedFrozenBalanceForBandwidth")&&t.uint32(336).int64(e.delegatedFrozenBalanceForBandwidth),e.assetV2!=null&&Object.hasOwnProperty.call(e,"assetV2"))for(var l=Object.keys(e.assetV2),n=0;n<l.length;++n)t.uint32(450).fork().uint32(10).string(l[n]).uint32(16).int64(e.assetV2[l[n]]).ldelim();if(e.assetIssued_ID!=null&&Object.hasOwnProperty.call(e,"assetIssued_ID")&&t.uint32(458).bytes(e.assetIssued_ID),e.latestAssetOperationTimeV2!=null&&Object.hasOwnProperty.call(e,"latestAssetOperationTimeV2"))for(var l=Object.keys(e.latestAssetOperationTimeV2),n=0;n<l.length;++n)t.uint32(466).fork().uint32(10).string(l[n]).uint32(16).int64(e.latestAssetOperationTimeV2[l[n]]).ldelim();if(e.freeAssetNetUsageV2!=null&&Object.hasOwnProperty.call(e,"freeAssetNetUsageV2"))for(var l=Object.keys(e.freeAssetNetUsageV2),n=0;n<l.length;++n)t.uint32(474).fork().uint32(10).string(l[n]).uint32(16).int64(e.freeAssetNetUsageV2[l[n]]).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.Account,c,u;e.pos<n;){var b=e.uint32();switch(b>>>3){case 1:l.accountName=e.bytes();break;case 2:l.type=e.int32();break;case 3:l.address=e.bytes();break;case 4:l.balance=e.int64();break;case 5:l.votes&&l.votes.length||(l.votes=[]),l.votes.push(d.protocol.Vote.decode(e,e.uint32()));break;case 6:l.asset===i.emptyObject&&(l.asset={});var w=e.uint32()+e.pos;for(c="",u=0;e.pos<w;){var A=e.uint32();switch(A>>>3){case 1:c=e.string();break;case 2:u=e.int64();break;default:e.skipType(A&7);break}}l.asset[c]=u;break;case 56:l.assetV2===i.emptyObject&&(l.assetV2={});var w=e.uint32()+e.pos;for(c="",u=0;e.pos<w;){var A=e.uint32();switch(A>>>3){case 1:c=e.string();break;case 2:u=e.int64();break;default:e.skipType(A&7);break}}l.assetV2[c]=u;break;case 7:l.frozen&&l.frozen.length||(l.frozen=[]),l.frozen.push(d.protocol.Account.Frozen.decode(e,e.uint32()));break;case 8:l.netUsage=e.int64();break;case 41:l.acquiredDelegatedFrozenBalanceForBandwidth=e.int64();break;case 42:l.delegatedFrozenBalanceForBandwidth=e.int64();break;case 9:l.createTime=e.int64();break;case 10:l.latestOprationTime=e.int64();break;case 11:l.allowance=e.int64();break;case 12:l.latestWithdrawTime=e.int64();break;case 13:l.code=e.bytes();break;case 14:l.isWitness=e.bool();break;case 15:l.isCommittee=e.bool();break;case 16:l.frozenSupply&&l.frozenSupply.length||(l.frozenSupply=[]),l.frozenSupply.push(d.protocol.Account.Frozen.decode(e,e.uint32()));break;case 17:l.assetIssuedName=e.bytes();break;case 57:l.assetIssued_ID=e.bytes();break;case 18:l.latestAssetOperationTime===i.emptyObject&&(l.latestAssetOperationTime={});var w=e.uint32()+e.pos;for(c="",u=0;e.pos<w;){var A=e.uint32();switch(A>>>3){case 1:c=e.string();break;case 2:u=e.int64();break;default:e.skipType(A&7);break}}l.latestAssetOperationTime[c]=u;break;case 58:l.latestAssetOperationTimeV2===i.emptyObject&&(l.latestAssetOperationTimeV2={});var w=e.uint32()+e.pos;for(c="",u=0;e.pos<w;){var A=e.uint32();switch(A>>>3){case 1:c=e.string();break;case 2:u=e.int64();break;default:e.skipType(A&7);break}}l.latestAssetOperationTimeV2[c]=u;break;case 19:l.freeNetUsage=e.int64();break;case 20:l.freeAssetNetUsage===i.emptyObject&&(l.freeAssetNetUsage={});var w=e.uint32()+e.pos;for(c="",u=0;e.pos<w;){var A=e.uint32();switch(A>>>3){case 1:c=e.string();break;case 2:u=e.int64();break;default:e.skipType(A&7);break}}l.freeAssetNetUsage[c]=u;break;case 59:l.freeAssetNetUsageV2===i.emptyObject&&(l.freeAssetNetUsageV2={});var w=e.uint32()+e.pos;for(c="",u=0;e.pos<w;){var A=e.uint32();switch(A>>>3){case 1:c=e.string();break;case 2:u=e.int64();break;default:e.skipType(A&7);break}}l.freeAssetNetUsageV2[c]=u;break;case 21:l.latestConsumeTime=e.int64();break;case 22:l.latestConsumeFreeTime=e.int64();break;case 23:l.accountId=e.bytes();break;case 26:l.accountResource=d.protocol.Account.AccountResource.decode(e,e.uint32());break;case 30:l.codeHash=e.bytes();break;case 31:l.ownerPermission=d.protocol.Permission.decode(e,e.uint32());break;case 32:l.witnessPermission=d.protocol.Permission.decode(e,e.uint32());break;case 33:l.activePermission&&l.activePermission.length||(l.activePermission=[]),l.activePermission.push(d.protocol.Permission.decode(e,e.uint32()));break;default:e.skipType(b&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.accountName!=null&&e.hasOwnProperty("accountName")&&!(e.accountName&&typeof e.accountName.length=="number"||i.isString(e.accountName)))return"accountName: buffer expected";if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:break}if(e.address!=null&&e.hasOwnProperty("address")&&!(e.address&&typeof e.address.length=="number"||i.isString(e.address)))return"address: buffer expected";if(e.balance!=null&&e.hasOwnProperty("balance")&&!i.isInteger(e.balance)&&!(e.balance&&i.isInteger(e.balance.low)&&i.isInteger(e.balance.high)))return"balance: integer|Long expected";if(e.votes!=null&&e.hasOwnProperty("votes")){if(!Array.isArray(e.votes))return"votes: array expected";for(var t=0;t<e.votes.length;++t){var n=d.protocol.Vote.verify(e.votes[t]);if(n)return"votes."+n}}if(e.asset!=null&&e.hasOwnProperty("asset")){if(!i.isObject(e.asset))return"asset: object expected";for(var l=Object.keys(e.asset),t=0;t<l.length;++t)if(!i.isInteger(e.asset[l[t]])&&!(e.asset[l[t]]&&i.isInteger(e.asset[l[t]].low)&&i.isInteger(e.asset[l[t]].high)))return"asset: integer|Long{k:string} expected"}if(e.assetV2!=null&&e.hasOwnProperty("assetV2")){if(!i.isObject(e.assetV2))return"assetV2: object expected";for(var l=Object.keys(e.assetV2),t=0;t<l.length;++t)if(!i.isInteger(e.assetV2[l[t]])&&!(e.assetV2[l[t]]&&i.isInteger(e.assetV2[l[t]].low)&&i.isInteger(e.assetV2[l[t]].high)))return"assetV2: integer|Long{k:string} expected"}if(e.frozen!=null&&e.hasOwnProperty("frozen")){if(!Array.isArray(e.frozen))return"frozen: array expected";for(var t=0;t<e.frozen.length;++t){var n=d.protocol.Account.Frozen.verify(e.frozen[t]);if(n)return"frozen."+n}}if(e.netUsage!=null&&e.hasOwnProperty("netUsage")&&!i.isInteger(e.netUsage)&&!(e.netUsage&&i.isInteger(e.netUsage.low)&&i.isInteger(e.netUsage.high)))return"netUsage: integer|Long expected";if(e.acquiredDelegatedFrozenBalanceForBandwidth!=null&&e.hasOwnProperty("acquiredDelegatedFrozenBalanceForBandwidth")&&!i.isInteger(e.acquiredDelegatedFrozenBalanceForBandwidth)&&!(e.acquiredDelegatedFrozenBalanceForBandwidth&&i.isInteger(e.acquiredDelegatedFrozenBalanceForBandwidth.low)&&i.isInteger(e.acquiredDelegatedFrozenBalanceForBandwidth.high)))return"acquiredDelegatedFrozenBalanceForBandwidth: integer|Long expected";if(e.delegatedFrozenBalanceForBandwidth!=null&&e.hasOwnProperty("delegatedFrozenBalanceForBandwidth")&&!i.isInteger(e.delegatedFrozenBalanceForBandwidth)&&!(e.delegatedFrozenBalanceForBandwidth&&i.isInteger(e.delegatedFrozenBalanceForBandwidth.low)&&i.isInteger(e.delegatedFrozenBalanceForBandwidth.high)))return"delegatedFrozenBalanceForBandwidth: integer|Long expected";if(e.createTime!=null&&e.hasOwnProperty("createTime")&&!i.isInteger(e.createTime)&&!(e.createTime&&i.isInteger(e.createTime.low)&&i.isInteger(e.createTime.high)))return"createTime: integer|Long expected";if(e.latestOprationTime!=null&&e.hasOwnProperty("latestOprationTime")&&!i.isInteger(e.latestOprationTime)&&!(e.latestOprationTime&&i.isInteger(e.latestOprationTime.low)&&i.isInteger(e.latestOprationTime.high)))return"latestOprationTime: integer|Long expected";if(e.allowance!=null&&e.hasOwnProperty("allowance")&&!i.isInteger(e.allowance)&&!(e.allowance&&i.isInteger(e.allowance.low)&&i.isInteger(e.allowance.high)))return"allowance: integer|Long expected";if(e.latestWithdrawTime!=null&&e.hasOwnProperty("latestWithdrawTime")&&!i.isInteger(e.latestWithdrawTime)&&!(e.latestWithdrawTime&&i.isInteger(e.latestWithdrawTime.low)&&i.isInteger(e.latestWithdrawTime.high)))return"latestWithdrawTime: integer|Long expected";if(e.code!=null&&e.hasOwnProperty("code")&&!(e.code&&typeof e.code.length=="number"||i.isString(e.code)))return"code: buffer expected";if(e.isWitness!=null&&e.hasOwnProperty("isWitness")&&typeof e.isWitness!="boolean")return"isWitness: boolean expected";if(e.isCommittee!=null&&e.hasOwnProperty("isCommittee")&&typeof e.isCommittee!="boolean")return"isCommittee: boolean expected";if(e.frozenSupply!=null&&e.hasOwnProperty("frozenSupply")){if(!Array.isArray(e.frozenSupply))return"frozenSupply: array expected";for(var t=0;t<e.frozenSupply.length;++t){var n=d.protocol.Account.Frozen.verify(e.frozenSupply[t]);if(n)return"frozenSupply."+n}}if(e.assetIssuedName!=null&&e.hasOwnProperty("assetIssuedName")&&!(e.assetIssuedName&&typeof e.assetIssuedName.length=="number"||i.isString(e.assetIssuedName)))return"assetIssuedName: buffer expected";if(e.assetIssued_ID!=null&&e.hasOwnProperty("assetIssued_ID")&&!(e.assetIssued_ID&&typeof e.assetIssued_ID.length=="number"||i.isString(e.assetIssued_ID)))return"assetIssued_ID: buffer expected";if(e.latestAssetOperationTime!=null&&e.hasOwnProperty("latestAssetOperationTime")){if(!i.isObject(e.latestAssetOperationTime))return"latestAssetOperationTime: object expected";for(var l=Object.keys(e.latestAssetOperationTime),t=0;t<l.length;++t)if(!i.isInteger(e.latestAssetOperationTime[l[t]])&&!(e.latestAssetOperationTime[l[t]]&&i.isInteger(e.latestAssetOperationTime[l[t]].low)&&i.isInteger(e.latestAssetOperationTime[l[t]].high)))return"latestAssetOperationTime: integer|Long{k:string} expected"}if(e.latestAssetOperationTimeV2!=null&&e.hasOwnProperty("latestAssetOperationTimeV2")){if(!i.isObject(e.latestAssetOperationTimeV2))return"latestAssetOperationTimeV2: object expected";for(var l=Object.keys(e.latestAssetOperationTimeV2),t=0;t<l.length;++t)if(!i.isInteger(e.latestAssetOperationTimeV2[l[t]])&&!(e.latestAssetOperationTimeV2[l[t]]&&i.isInteger(e.latestAssetOperationTimeV2[l[t]].low)&&i.isInteger(e.latestAssetOperationTimeV2[l[t]].high)))return"latestAssetOperationTimeV2: integer|Long{k:string} expected"}if(e.freeNetUsage!=null&&e.hasOwnProperty("freeNetUsage")&&!i.isInteger(e.freeNetUsage)&&!(e.freeNetUsage&&i.isInteger(e.freeNetUsage.low)&&i.isInteger(e.freeNetUsage.high)))return"freeNetUsage: integer|Long expected";if(e.freeAssetNetUsage!=null&&e.hasOwnProperty("freeAssetNetUsage")){if(!i.isObject(e.freeAssetNetUsage))return"freeAssetNetUsage: object expected";for(var l=Object.keys(e.freeAssetNetUsage),t=0;t<l.length;++t)if(!i.isInteger(e.freeAssetNetUsage[l[t]])&&!(e.freeAssetNetUsage[l[t]]&&i.isInteger(e.freeAssetNetUsage[l[t]].low)&&i.isInteger(e.freeAssetNetUsage[l[t]].high)))return"freeAssetNetUsage: integer|Long{k:string} expected"}if(e.freeAssetNetUsageV2!=null&&e.hasOwnProperty("freeAssetNetUsageV2")){if(!i.isObject(e.freeAssetNetUsageV2))return"freeAssetNetUsageV2: object expected";for(var l=Object.keys(e.freeAssetNetUsageV2),t=0;t<l.length;++t)if(!i.isInteger(e.freeAssetNetUsageV2[l[t]])&&!(e.freeAssetNetUsageV2[l[t]]&&i.isInteger(e.freeAssetNetUsageV2[l[t]].low)&&i.isInteger(e.freeAssetNetUsageV2[l[t]].high)))return"freeAssetNetUsageV2: integer|Long{k:string} expected"}if(e.latestConsumeTime!=null&&e.hasOwnProperty("latestConsumeTime")&&!i.isInteger(e.latestConsumeTime)&&!(e.latestConsumeTime&&i.isInteger(e.latestConsumeTime.low)&&i.isInteger(e.latestConsumeTime.high)))return"latestConsumeTime: integer|Long expected";if(e.latestConsumeFreeTime!=null&&e.hasOwnProperty("latestConsumeFreeTime")&&!i.isInteger(e.latestConsumeFreeTime)&&!(e.latestConsumeFreeTime&&i.isInteger(e.latestConsumeFreeTime.low)&&i.isInteger(e.latestConsumeFreeTime.high)))return"latestConsumeFreeTime: integer|Long expected";if(e.accountId!=null&&e.hasOwnProperty("accountId")&&!(e.accountId&&typeof e.accountId.length=="number"||i.isString(e.accountId)))return"accountId: buffer expected";if(e.accountResource!=null&&e.hasOwnProperty("accountResource")){var n=d.protocol.Account.AccountResource.verify(e.accountResource);if(n)return"accountResource."+n}if(e.codeHash!=null&&e.hasOwnProperty("codeHash")&&!(e.codeHash&&typeof e.codeHash.length=="number"||i.isString(e.codeHash)))return"codeHash: buffer expected";if(e.ownerPermission!=null&&e.hasOwnProperty("ownerPermission")){var n=d.protocol.Permission.verify(e.ownerPermission);if(n)return"ownerPermission."+n}if(e.witnessPermission!=null&&e.hasOwnProperty("witnessPermission")){var n=d.protocol.Permission.verify(e.witnessPermission);if(n)return"witnessPermission."+n}if(e.activePermission!=null&&e.hasOwnProperty("activePermission")){if(!Array.isArray(e.activePermission))return"activePermission: array expected";for(var t=0;t<e.activePermission.length;++t){var n=d.protocol.Permission.verify(e.activePermission[t]);if(n)return"activePermission."+n}}return null},r.fromObject=function(e){if(e instanceof d.protocol.Account)return e;var t=new d.protocol.Account;switch(e.accountName!=null&&(typeof e.accountName=="string"?i.base64.decode(e.accountName,t.accountName=i.newBuffer(i.base64.length(e.accountName)),0):e.accountName.length&&(t.accountName=e.accountName)),e.type){case"Normal":case 0:t.type=0;break;case"AssetIssue":case 1:t.type=1;break;case"Contract":case 2:t.type=2;break}if(e.address!=null&&(typeof e.address=="string"?i.base64.decode(e.address,t.address=i.newBuffer(i.base64.length(e.address)),0):e.address.length&&(t.address=e.address)),e.balance!=null&&(i.Long?(t.balance=i.Long.fromValue(e.balance)).unsigned=!1:typeof e.balance=="string"?t.balance=parseInt(e.balance,10):typeof e.balance=="number"?t.balance=e.balance:typeof e.balance=="object"&&(t.balance=new i.LongBits(e.balance.low>>>0,e.balance.high>>>0).toNumber())),e.votes){if(!Array.isArray(e.votes))throw TypeError(".protocol.Account.votes: array expected");t.votes=[];for(var n=0;n<e.votes.length;++n){if(typeof e.votes[n]!="object")throw TypeError(".protocol.Account.votes: object expected");t.votes[n]=d.protocol.Vote.fromObject(e.votes[n])}}if(e.asset){if(typeof e.asset!="object")throw TypeError(".protocol.Account.asset: object expected");t.asset={};for(var l=Object.keys(e.asset),n=0;n<l.length;++n)i.Long?(t.asset[l[n]]=i.Long.fromValue(e.asset[l[n]])).unsigned=!1:typeof e.asset[l[n]]=="string"?t.asset[l[n]]=parseInt(e.asset[l[n]],10):typeof e.asset[l[n]]=="number"?t.asset[l[n]]=e.asset[l[n]]:typeof e.asset[l[n]]=="object"&&(t.asset[l[n]]=new i.LongBits(e.asset[l[n]].low>>>0,e.asset[l[n]].high>>>0).toNumber())}if(e.assetV2){if(typeof e.assetV2!="object")throw TypeError(".protocol.Account.assetV2: object expected");t.assetV2={};for(var l=Object.keys(e.assetV2),n=0;n<l.length;++n)i.Long?(t.assetV2[l[n]]=i.Long.fromValue(e.assetV2[l[n]])).unsigned=!1:typeof e.assetV2[l[n]]=="string"?t.assetV2[l[n]]=parseInt(e.assetV2[l[n]],10):typeof e.assetV2[l[n]]=="number"?t.assetV2[l[n]]=e.assetV2[l[n]]:typeof e.assetV2[l[n]]=="object"&&(t.assetV2[l[n]]=new i.LongBits(e.assetV2[l[n]].low>>>0,e.assetV2[l[n]].high>>>0).toNumber())}if(e.frozen){if(!Array.isArray(e.frozen))throw TypeError(".protocol.Account.frozen: array expected");t.frozen=[];for(var n=0;n<e.frozen.length;++n){if(typeof e.frozen[n]!="object")throw TypeError(".protocol.Account.frozen: object expected");t.frozen[n]=d.protocol.Account.Frozen.fromObject(e.frozen[n])}}if(e.netUsage!=null&&(i.Long?(t.netUsage=i.Long.fromValue(e.netUsage)).unsigned=!1:typeof e.netUsage=="string"?t.netUsage=parseInt(e.netUsage,10):typeof e.netUsage=="number"?t.netUsage=e.netUsage:typeof e.netUsage=="object"&&(t.netUsage=new i.LongBits(e.netUsage.low>>>0,e.netUsage.high>>>0).toNumber())),e.acquiredDelegatedFrozenBalanceForBandwidth!=null&&(i.Long?(t.acquiredDelegatedFrozenBalanceForBandwidth=i.Long.fromValue(e.acquiredDelegatedFrozenBalanceForBandwidth)).unsigned=!1:typeof e.acquiredDelegatedFrozenBalanceForBandwidth=="string"?t.acquiredDelegatedFrozenBalanceForBandwidth=parseInt(e.acquiredDelegatedFrozenBalanceForBandwidth,10):typeof e.acquiredDelegatedFrozenBalanceForBandwidth=="number"?t.acquiredDelegatedFrozenBalanceForBandwidth=e.acquiredDelegatedFrozenBalanceForBandwidth:typeof e.acquiredDelegatedFrozenBalanceForBandwidth=="object"&&(t.acquiredDelegatedFrozenBalanceForBandwidth=new i.LongBits(e.acquiredDelegatedFrozenBalanceForBandwidth.low>>>0,e.acquiredDelegatedFrozenBalanceForBandwidth.high>>>0).toNumber())),e.delegatedFrozenBalanceForBandwidth!=null&&(i.Long?(t.delegatedFrozenBalanceForBandwidth=i.Long.fromValue(e.delegatedFrozenBalanceForBandwidth)).unsigned=!1:typeof e.delegatedFrozenBalanceForBandwidth=="string"?t.delegatedFrozenBalanceForBandwidth=parseInt(e.delegatedFrozenBalanceForBandwidth,10):typeof e.delegatedFrozenBalanceForBandwidth=="number"?t.delegatedFrozenBalanceForBandwidth=e.delegatedFrozenBalanceForBandwidth:typeof e.delegatedFrozenBalanceForBandwidth=="object"&&(t.delegatedFrozenBalanceForBandwidth=new i.LongBits(e.delegatedFrozenBalanceForBandwidth.low>>>0,e.delegatedFrozenBalanceForBandwidth.high>>>0).toNumber())),e.createTime!=null&&(i.Long?(t.createTime=i.Long.fromValue(e.createTime)).unsigned=!1:typeof e.createTime=="string"?t.createTime=parseInt(e.createTime,10):typeof e.createTime=="number"?t.createTime=e.createTime:typeof e.createTime=="object"&&(t.createTime=new i.LongBits(e.createTime.low>>>0,e.createTime.high>>>0).toNumber())),e.latestOprationTime!=null&&(i.Long?(t.latestOprationTime=i.Long.fromValue(e.latestOprationTime)).unsigned=!1:typeof e.latestOprationTime=="string"?t.latestOprationTime=parseInt(e.latestOprationTime,10):typeof e.latestOprationTime=="number"?t.latestOprationTime=e.latestOprationTime:typeof e.latestOprationTime=="object"&&(t.latestOprationTime=new i.LongBits(e.latestOprationTime.low>>>0,e.latestOprationTime.high>>>0).toNumber())),e.allowance!=null&&(i.Long?(t.allowance=i.Long.fromValue(e.allowance)).unsigned=!1:typeof e.allowance=="string"?t.allowance=parseInt(e.allowance,10):typeof e.allowance=="number"?t.allowance=e.allowance:typeof e.allowance=="object"&&(t.allowance=new i.LongBits(e.allowance.low>>>0,e.allowance.high>>>0).toNumber())),e.latestWithdrawTime!=null&&(i.Long?(t.latestWithdrawTime=i.Long.fromValue(e.latestWithdrawTime)).unsigned=!1:typeof e.latestWithdrawTime=="string"?t.latestWithdrawTime=parseInt(e.latestWithdrawTime,10):typeof e.latestWithdrawTime=="number"?t.latestWithdrawTime=e.latestWithdrawTime:typeof e.latestWithdrawTime=="object"&&(t.latestWithdrawTime=new i.LongBits(e.latestWithdrawTime.low>>>0,e.latestWithdrawTime.high>>>0).toNumber())),e.code!=null&&(typeof e.code=="string"?i.base64.decode(e.code,t.code=i.newBuffer(i.base64.length(e.code)),0):e.code.length&&(t.code=e.code)),e.isWitness!=null&&(t.isWitness=Boolean(e.isWitness)),e.isCommittee!=null&&(t.isCommittee=Boolean(e.isCommittee)),e.frozenSupply){if(!Array.isArray(e.frozenSupply))throw TypeError(".protocol.Account.frozenSupply: array expected");t.frozenSupply=[];for(var n=0;n<e.frozenSupply.length;++n){if(typeof e.frozenSupply[n]!="object")throw TypeError(".protocol.Account.frozenSupply: object expected");t.frozenSupply[n]=d.protocol.Account.Frozen.fromObject(e.frozenSupply[n])}}if(e.assetIssuedName!=null&&(typeof e.assetIssuedName=="string"?i.base64.decode(e.assetIssuedName,t.assetIssuedName=i.newBuffer(i.base64.length(e.assetIssuedName)),0):e.assetIssuedName.length&&(t.assetIssuedName=e.assetIssuedName)),e.assetIssued_ID!=null&&(typeof e.assetIssued_ID=="string"?i.base64.decode(e.assetIssued_ID,t.assetIssued_ID=i.newBuffer(i.base64.length(e.assetIssued_ID)),0):e.assetIssued_ID.length&&(t.assetIssued_ID=e.assetIssued_ID)),e.latestAssetOperationTime){if(typeof e.latestAssetOperationTime!="object")throw TypeError(".protocol.Account.latestAssetOperationTime: object expected");t.latestAssetOperationTime={};for(var l=Object.keys(e.latestAssetOperationTime),n=0;n<l.length;++n)i.Long?(t.latestAssetOperationTime[l[n]]=i.Long.fromValue(e.latestAssetOperationTime[l[n]])).unsigned=!1:typeof e.latestAssetOperationTime[l[n]]=="string"?t.latestAssetOperationTime[l[n]]=parseInt(e.latestAssetOperationTime[l[n]],10):typeof e.latestAssetOperationTime[l[n]]=="number"?t.latestAssetOperationTime[l[n]]=e.latestAssetOperationTime[l[n]]:typeof e.latestAssetOperationTime[l[n]]=="object"&&(t.latestAssetOperationTime[l[n]]=new i.LongBits(e.latestAssetOperationTime[l[n]].low>>>0,e.latestAssetOperationTime[l[n]].high>>>0).toNumber())}if(e.latestAssetOperationTimeV2){if(typeof e.latestAssetOperationTimeV2!="object")throw TypeError(".protocol.Account.latestAssetOperationTimeV2: object expected");t.latestAssetOperationTimeV2={};for(var l=Object.keys(e.latestAssetOperationTimeV2),n=0;n<l.length;++n)i.Long?(t.latestAssetOperationTimeV2[l[n]]=i.Long.fromValue(e.latestAssetOperationTimeV2[l[n]])).unsigned=!1:typeof e.latestAssetOperationTimeV2[l[n]]=="string"?t.latestAssetOperationTimeV2[l[n]]=parseInt(e.latestAssetOperationTimeV2[l[n]],10):typeof e.latestAssetOperationTimeV2[l[n]]=="number"?t.latestAssetOperationTimeV2[l[n]]=e.latestAssetOperationTimeV2[l[n]]:typeof e.latestAssetOperationTimeV2[l[n]]=="object"&&(t.latestAssetOperationTimeV2[l[n]]=new i.LongBits(e.latestAssetOperationTimeV2[l[n]].low>>>0,e.latestAssetOperationTimeV2[l[n]].high>>>0).toNumber())}if(e.freeNetUsage!=null&&(i.Long?(t.freeNetUsage=i.Long.fromValue(e.freeNetUsage)).unsigned=!1:typeof e.freeNetUsage=="string"?t.freeNetUsage=parseInt(e.freeNetUsage,10):typeof e.freeNetUsage=="number"?t.freeNetUsage=e.freeNetUsage:typeof e.freeNetUsage=="object"&&(t.freeNetUsage=new i.LongBits(e.freeNetUsage.low>>>0,e.freeNetUsage.high>>>0).toNumber())),e.freeAssetNetUsage){if(typeof e.freeAssetNetUsage!="object")throw TypeError(".protocol.Account.freeAssetNetUsage: object expected");t.freeAssetNetUsage={};for(var l=Object.keys(e.freeAssetNetUsage),n=0;n<l.length;++n)i.Long?(t.freeAssetNetUsage[l[n]]=i.Long.fromValue(e.freeAssetNetUsage[l[n]])).unsigned=!1:typeof e.freeAssetNetUsage[l[n]]=="string"?t.freeAssetNetUsage[l[n]]=parseInt(e.freeAssetNetUsage[l[n]],10):typeof e.freeAssetNetUsage[l[n]]=="number"?t.freeAssetNetUsage[l[n]]=e.freeAssetNetUsage[l[n]]:typeof e.freeAssetNetUsage[l[n]]=="object"&&(t.freeAssetNetUsage[l[n]]=new i.LongBits(e.freeAssetNetUsage[l[n]].low>>>0,e.freeAssetNetUsage[l[n]].high>>>0).toNumber())}if(e.freeAssetNetUsageV2){if(typeof e.freeAssetNetUsageV2!="object")throw TypeError(".protocol.Account.freeAssetNetUsageV2: object expected");t.freeAssetNetUsageV2={};for(var l=Object.keys(e.freeAssetNetUsageV2),n=0;n<l.length;++n)i.Long?(t.freeAssetNetUsageV2[l[n]]=i.Long.fromValue(e.freeAssetNetUsageV2[l[n]])).unsigned=!1:typeof e.freeAssetNetUsageV2[l[n]]=="string"?t.freeAssetNetUsageV2[l[n]]=parseInt(e.freeAssetNetUsageV2[l[n]],10):typeof e.freeAssetNetUsageV2[l[n]]=="number"?t.freeAssetNetUsageV2[l[n]]=e.freeAssetNetUsageV2[l[n]]:typeof e.freeAssetNetUsageV2[l[n]]=="object"&&(t.freeAssetNetUsageV2[l[n]]=new i.LongBits(e.freeAssetNetUsageV2[l[n]].low>>>0,e.freeAssetNetUsageV2[l[n]].high>>>0).toNumber())}if(e.latestConsumeTime!=null&&(i.Long?(t.latestConsumeTime=i.Long.fromValue(e.latestConsumeTime)).unsigned=!1:typeof e.latestConsumeTime=="string"?t.latestConsumeTime=parseInt(e.latestConsumeTime,10):typeof e.latestConsumeTime=="number"?t.latestConsumeTime=e.latestConsumeTime:typeof e.latestConsumeTime=="object"&&(t.latestConsumeTime=new i.LongBits(e.latestConsumeTime.low>>>0,e.latestConsumeTime.high>>>0).toNumber())),e.latestConsumeFreeTime!=null&&(i.Long?(t.latestConsumeFreeTime=i.Long.fromValue(e.latestConsumeFreeTime)).unsigned=!1:typeof e.latestConsumeFreeTime=="string"?t.latestConsumeFreeTime=parseInt(e.latestConsumeFreeTime,10):typeof e.latestConsumeFreeTime=="number"?t.latestConsumeFreeTime=e.latestConsumeFreeTime:typeof e.latestConsumeFreeTime=="object"&&(t.latestConsumeFreeTime=new i.LongBits(e.latestConsumeFreeTime.low>>>0,e.latestConsumeFreeTime.high>>>0).toNumber())),e.accountId!=null&&(typeof e.accountId=="string"?i.base64.decode(e.accountId,t.accountId=i.newBuffer(i.base64.length(e.accountId)),0):e.accountId.length&&(t.accountId=e.accountId)),e.accountResource!=null){if(typeof e.accountResource!="object")throw TypeError(".protocol.Account.accountResource: object expected");t.accountResource=d.protocol.Account.AccountResource.fromObject(e.accountResource)}if(e.codeHash!=null&&(typeof e.codeHash=="string"?i.base64.decode(e.codeHash,t.codeHash=i.newBuffer(i.base64.length(e.codeHash)),0):e.codeHash.length&&(t.codeHash=e.codeHash)),e.ownerPermission!=null){if(typeof e.ownerPermission!="object")throw TypeError(".protocol.Account.ownerPermission: object expected");t.ownerPermission=d.protocol.Permission.fromObject(e.ownerPermission)}if(e.witnessPermission!=null){if(typeof e.witnessPermission!="object")throw TypeError(".protocol.Account.witnessPermission: object expected");t.witnessPermission=d.protocol.Permission.fromObject(e.witnessPermission)}if(e.activePermission){if(!Array.isArray(e.activePermission))throw TypeError(".protocol.Account.activePermission: array expected");t.activePermission=[];for(var n=0;n<e.activePermission.length;++n){if(typeof e.activePermission[n]!="object")throw TypeError(".protocol.Account.activePermission: object expected");t.activePermission[n]=d.protocol.Permission.fromObject(e.activePermission[n])}}return t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.votes=[],n.frozen=[],n.frozenSupply=[],n.activePermission=[]),(t.objects||t.defaults)&&(n.asset={},n.latestAssetOperationTime={},n.freeAssetNetUsage={},n.assetV2={},n.latestAssetOperationTimeV2={},n.freeAssetNetUsageV2={}),t.defaults){if(t.bytes===String?n.accountName="":(n.accountName=[],t.bytes!==Array&&(n.accountName=i.newBuffer(n.accountName))),n.type=t.enums===String?"Normal":0,t.bytes===String?n.address="":(n.address=[],t.bytes!==Array&&(n.address=i.newBuffer(n.address))),i.Long){var l=new i.Long(0,0,!1);n.balance=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.balance=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.netUsage=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.netUsage=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.createTime=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.createTime=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.latestOprationTime=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.latestOprationTime=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.allowance=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.allowance=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.latestWithdrawTime=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.latestWithdrawTime=t.longs===String?"0":0;if(t.bytes===String?n.code="":(n.code=[],t.bytes!==Array&&(n.code=i.newBuffer(n.code))),n.isWitness=!1,n.isCommittee=!1,t.bytes===String?n.assetIssuedName="":(n.assetIssuedName=[],t.bytes!==Array&&(n.assetIssuedName=i.newBuffer(n.assetIssuedName))),i.Long){var l=new i.Long(0,0,!1);n.freeNetUsage=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.freeNetUsage=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.latestConsumeTime=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.latestConsumeTime=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.latestConsumeFreeTime=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.latestConsumeFreeTime=t.longs===String?"0":0;if(t.bytes===String?n.accountId="":(n.accountId=[],t.bytes!==Array&&(n.accountId=i.newBuffer(n.accountId))),n.accountResource=null,t.bytes===String?n.codeHash="":(n.codeHash=[],t.bytes!==Array&&(n.codeHash=i.newBuffer(n.codeHash))),n.ownerPermission=null,n.witnessPermission=null,i.Long){var l=new i.Long(0,0,!1);n.acquiredDelegatedFrozenBalanceForBandwidth=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.acquiredDelegatedFrozenBalanceForBandwidth=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.delegatedFrozenBalanceForBandwidth=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.delegatedFrozenBalanceForBandwidth=t.longs===String?"0":0;t.bytes===String?n.assetIssued_ID="":(n.assetIssued_ID=[],t.bytes!==Array&&(n.assetIssued_ID=i.newBuffer(n.assetIssued_ID)))}if(e.accountName!=null&&e.hasOwnProperty("accountName")&&(n.accountName=t.bytes===String?i.base64.encode(e.accountName,0,e.accountName.length):t.bytes===Array?Array.prototype.slice.call(e.accountName):e.accountName),e.type!=null&&e.hasOwnProperty("type")&&(n.type=t.enums===String?d.protocol.AccountType[e.type]:e.type),e.address!=null&&e.hasOwnProperty("address")&&(n.address=t.bytes===String?i.base64.encode(e.address,0,e.address.length):t.bytes===Array?Array.prototype.slice.call(e.address):e.address),e.balance!=null&&e.hasOwnProperty("balance")&&(typeof e.balance=="number"?n.balance=t.longs===String?String(e.balance):e.balance:n.balance=t.longs===String?i.Long.prototype.toString.call(e.balance):t.longs===Number?new i.LongBits(e.balance.low>>>0,e.balance.high>>>0).toNumber():e.balance),e.votes&&e.votes.length){n.votes=[];for(var c=0;c<e.votes.length;++c)n.votes[c]=d.protocol.Vote.toObject(e.votes[c],t)}var u;if(e.asset&&(u=Object.keys(e.asset)).length){n.asset={};for(var c=0;c<u.length;++c)typeof e.asset[u[c]]=="number"?n.asset[u[c]]=t.longs===String?String(e.asset[u[c]]):e.asset[u[c]]:n.asset[u[c]]=t.longs===String?i.Long.prototype.toString.call(e.asset[u[c]]):t.longs===Number?new i.LongBits(e.asset[u[c]].low>>>0,e.asset[u[c]].high>>>0).toNumber():e.asset[u[c]]}if(e.frozen&&e.frozen.length){n.frozen=[];for(var c=0;c<e.frozen.length;++c)n.frozen[c]=d.protocol.Account.Frozen.toObject(e.frozen[c],t)}if(e.netUsage!=null&&e.hasOwnProperty("netUsage")&&(typeof e.netUsage=="number"?n.netUsage=t.longs===String?String(e.netUsage):e.netUsage:n.netUsage=t.longs===String?i.Long.prototype.toString.call(e.netUsage):t.longs===Number?new i.LongBits(e.netUsage.low>>>0,e.netUsage.high>>>0).toNumber():e.netUsage),e.createTime!=null&&e.hasOwnProperty("createTime")&&(typeof e.createTime=="number"?n.createTime=t.longs===String?String(e.createTime):e.createTime:n.createTime=t.longs===String?i.Long.prototype.toString.call(e.createTime):t.longs===Number?new i.LongBits(e.createTime.low>>>0,e.createTime.high>>>0).toNumber():e.createTime),e.latestOprationTime!=null&&e.hasOwnProperty("latestOprationTime")&&(typeof e.latestOprationTime=="number"?n.latestOprationTime=t.longs===String?String(e.latestOprationTime):e.latestOprationTime:n.latestOprationTime=t.longs===String?i.Long.prototype.toString.call(e.latestOprationTime):t.longs===Number?new i.LongBits(e.latestOprationTime.low>>>0,e.latestOprationTime.high>>>0).toNumber():e.latestOprationTime),e.allowance!=null&&e.hasOwnProperty("allowance")&&(typeof e.allowance=="number"?n.allowance=t.longs===String?String(e.allowance):e.allowance:n.allowance=t.longs===String?i.Long.prototype.toString.call(e.allowance):t.longs===Number?new i.LongBits(e.allowance.low>>>0,e.allowance.high>>>0).toNumber():e.allowance),e.latestWithdrawTime!=null&&e.hasOwnProperty("latestWithdrawTime")&&(typeof e.latestWithdrawTime=="number"?n.latestWithdrawTime=t.longs===String?String(e.latestWithdrawTime):e.latestWithdrawTime:n.latestWithdrawTime=t.longs===String?i.Long.prototype.toString.call(e.latestWithdrawTime):t.longs===Number?new i.LongBits(e.latestWithdrawTime.low>>>0,e.latestWithdrawTime.high>>>0).toNumber():e.latestWithdrawTime),e.code!=null&&e.hasOwnProperty("code")&&(n.code=t.bytes===String?i.base64.encode(e.code,0,e.code.length):t.bytes===Array?Array.prototype.slice.call(e.code):e.code),e.isWitness!=null&&e.hasOwnProperty("isWitness")&&(n.isWitness=e.isWitness),e.isCommittee!=null&&e.hasOwnProperty("isCommittee")&&(n.isCommittee=e.isCommittee),e.frozenSupply&&e.frozenSupply.length){n.frozenSupply=[];for(var c=0;c<e.frozenSupply.length;++c)n.frozenSupply[c]=d.protocol.Account.Frozen.toObject(e.frozenSupply[c],t)}if(e.assetIssuedName!=null&&e.hasOwnProperty("assetIssuedName")&&(n.assetIssuedName=t.bytes===String?i.base64.encode(e.assetIssuedName,0,e.assetIssuedName.length):t.bytes===Array?Array.prototype.slice.call(e.assetIssuedName):e.assetIssuedName),e.latestAssetOperationTime&&(u=Object.keys(e.latestAssetOperationTime)).length){n.latestAssetOperationTime={};for(var c=0;c<u.length;++c)typeof e.latestAssetOperationTime[u[c]]=="number"?n.latestAssetOperationTime[u[c]]=t.longs===String?String(e.latestAssetOperationTime[u[c]]):e.latestAssetOperationTime[u[c]]:n.latestAssetOperationTime[u[c]]=t.longs===String?i.Long.prototype.toString.call(e.latestAssetOperationTime[u[c]]):t.longs===Number?new i.LongBits(e.latestAssetOperationTime[u[c]].low>>>0,e.latestAssetOperationTime[u[c]].high>>>0).toNumber():e.latestAssetOperationTime[u[c]]}if(e.freeNetUsage!=null&&e.hasOwnProperty("freeNetUsage")&&(typeof e.freeNetUsage=="number"?n.freeNetUsage=t.longs===String?String(e.freeNetUsage):e.freeNetUsage:n.freeNetUsage=t.longs===String?i.Long.prototype.toString.call(e.freeNetUsage):t.longs===Number?new i.LongBits(e.freeNetUsage.low>>>0,e.freeNetUsage.high>>>0).toNumber():e.freeNetUsage),e.freeAssetNetUsage&&(u=Object.keys(e.freeAssetNetUsage)).length){n.freeAssetNetUsage={};for(var c=0;c<u.length;++c)typeof e.freeAssetNetUsage[u[c]]=="number"?n.freeAssetNetUsage[u[c]]=t.longs===String?String(e.freeAssetNetUsage[u[c]]):e.freeAssetNetUsage[u[c]]:n.freeAssetNetUsage[u[c]]=t.longs===String?i.Long.prototype.toString.call(e.freeAssetNetUsage[u[c]]):t.longs===Number?new i.LongBits(e.freeAssetNetUsage[u[c]].low>>>0,e.freeAssetNetUsage[u[c]].high>>>0).toNumber():e.freeAssetNetUsage[u[c]]}if(e.latestConsumeTime!=null&&e.hasOwnProperty("latestConsumeTime")&&(typeof e.latestConsumeTime=="number"?n.latestConsumeTime=t.longs===String?String(e.latestConsumeTime):e.latestConsumeTime:n.latestConsumeTime=t.longs===String?i.Long.prototype.toString.call(e.latestConsumeTime):t.longs===Number?new i.LongBits(e.latestConsumeTime.low>>>0,e.latestConsumeTime.high>>>0).toNumber():e.latestConsumeTime),e.latestConsumeFreeTime!=null&&e.hasOwnProperty("latestConsumeFreeTime")&&(typeof e.latestConsumeFreeTime=="number"?n.latestConsumeFreeTime=t.longs===String?String(e.latestConsumeFreeTime):e.latestConsumeFreeTime:n.latestConsumeFreeTime=t.longs===String?i.Long.prototype.toString.call(e.latestConsumeFreeTime):t.longs===Number?new i.LongBits(e.latestConsumeFreeTime.low>>>0,e.latestConsumeFreeTime.high>>>0).toNumber():e.latestConsumeFreeTime),e.accountId!=null&&e.hasOwnProperty("accountId")&&(n.accountId=t.bytes===String?i.base64.encode(e.accountId,0,e.accountId.length):t.bytes===Array?Array.prototype.slice.call(e.accountId):e.accountId),e.accountResource!=null&&e.hasOwnProperty("accountResource")&&(n.accountResource=d.protocol.Account.AccountResource.toObject(e.accountResource,t)),e.codeHash!=null&&e.hasOwnProperty("codeHash")&&(n.codeHash=t.bytes===String?i.base64.encode(e.codeHash,0,e.codeHash.length):t.bytes===Array?Array.prototype.slice.call(e.codeHash):e.codeHash),e.ownerPermission!=null&&e.hasOwnProperty("ownerPermission")&&(n.ownerPermission=d.protocol.Permission.toObject(e.ownerPermission,t)),e.witnessPermission!=null&&e.hasOwnProperty("witnessPermission")&&(n.witnessPermission=d.protocol.Permission.toObject(e.witnessPermission,t)),e.activePermission&&e.activePermission.length){n.activePermission=[];for(var c=0;c<e.activePermission.length;++c)n.activePermission[c]=d.protocol.Permission.toObject(e.activePermission[c],t)}if(e.acquiredDelegatedFrozenBalanceForBandwidth!=null&&e.hasOwnProperty("acquiredDelegatedFrozenBalanceForBandwidth")&&(typeof e.acquiredDelegatedFrozenBalanceForBandwidth=="number"?n.acquiredDelegatedFrozenBalanceForBandwidth=t.longs===String?String(e.acquiredDelegatedFrozenBalanceForBandwidth):e.acquiredDelegatedFrozenBalanceForBandwidth:n.acquiredDelegatedFrozenBalanceForBandwidth=t.longs===String?i.Long.prototype.toString.call(e.acquiredDelegatedFrozenBalanceForBandwidth):t.longs===Number?new i.LongBits(e.acquiredDelegatedFrozenBalanceForBandwidth.low>>>0,e.acquiredDelegatedFrozenBalanceForBandwidth.high>>>0).toNumber():e.acquiredDelegatedFrozenBalanceForBandwidth),e.delegatedFrozenBalanceForBandwidth!=null&&e.hasOwnProperty("delegatedFrozenBalanceForBandwidth")&&(typeof e.delegatedFrozenBalanceForBandwidth=="number"?n.delegatedFrozenBalanceForBandwidth=t.longs===String?String(e.delegatedFrozenBalanceForBandwidth):e.delegatedFrozenBalanceForBandwidth:n.delegatedFrozenBalanceForBandwidth=t.longs===String?i.Long.prototype.toString.call(e.delegatedFrozenBalanceForBandwidth):t.longs===Number?new i.LongBits(e.delegatedFrozenBalanceForBandwidth.low>>>0,e.delegatedFrozenBalanceForBandwidth.high>>>0).toNumber():e.delegatedFrozenBalanceForBandwidth),e.assetV2&&(u=Object.keys(e.assetV2)).length){n.assetV2={};for(var c=0;c<u.length;++c)typeof e.assetV2[u[c]]=="number"?n.assetV2[u[c]]=t.longs===String?String(e.assetV2[u[c]]):e.assetV2[u[c]]:n.assetV2[u[c]]=t.longs===String?i.Long.prototype.toString.call(e.assetV2[u[c]]):t.longs===Number?new i.LongBits(e.assetV2[u[c]].low>>>0,e.assetV2[u[c]].high>>>0).toNumber():e.assetV2[u[c]]}if(e.assetIssued_ID!=null&&e.hasOwnProperty("assetIssued_ID")&&(n.assetIssued_ID=t.bytes===String?i.base64.encode(e.assetIssued_ID,0,e.assetIssued_ID.length):t.bytes===Array?Array.prototype.slice.call(e.assetIssued_ID):e.assetIssued_ID),e.latestAssetOperationTimeV2&&(u=Object.keys(e.latestAssetOperationTimeV2)).length){n.latestAssetOperationTimeV2={};for(var c=0;c<u.length;++c)typeof e.latestAssetOperationTimeV2[u[c]]=="number"?n.latestAssetOperationTimeV2[u[c]]=t.longs===String?String(e.latestAssetOperationTimeV2[u[c]]):e.latestAssetOperationTimeV2[u[c]]:n.latestAssetOperationTimeV2[u[c]]=t.longs===String?i.Long.prototype.toString.call(e.latestAssetOperationTimeV2[u[c]]):t.longs===Number?new i.LongBits(e.latestAssetOperationTimeV2[u[c]].low>>>0,e.latestAssetOperationTimeV2[u[c]].high>>>0).toNumber():e.latestAssetOperationTimeV2[u[c]]}if(e.freeAssetNetUsageV2&&(u=Object.keys(e.freeAssetNetUsageV2)).length){n.freeAssetNetUsageV2={};for(var c=0;c<u.length;++c)typeof e.freeAssetNetUsageV2[u[c]]=="number"?n.freeAssetNetUsageV2[u[c]]=t.longs===String?String(e.freeAssetNetUsageV2[u[c]]):e.freeAssetNetUsageV2[u[c]]:n.freeAssetNetUsageV2[u[c]]=t.longs===String?i.Long.prototype.toString.call(e.freeAssetNetUsageV2[u[c]]):t.longs===Number?new i.LongBits(e.freeAssetNetUsageV2[u[c]].low>>>0,e.freeAssetNetUsageV2[u[c]].high>>>0).toNumber():e.freeAssetNetUsageV2[u[c]]}return n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r.Frozen=function(){function o(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return o.prototype.frozenBalance=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.expireTime=i.Long?i.Long.fromBits(0,0,!1):0,o.create=function(t){return new o(t)},o.encode=function(t,n){return n||(n=H.create()),t.frozenBalance!=null&&Object.hasOwnProperty.call(t,"frozenBalance")&&n.uint32(8).int64(t.frozenBalance),t.expireTime!=null&&Object.hasOwnProperty.call(t,"expireTime")&&n.uint32(16).int64(t.expireTime),n},o.encodeDelimited=function(t,n){return this.encode(t,n).ldelim()},o.decode=function(t,n){t instanceof v||(t=v.create(t));for(var l=n===void 0?t.len:t.pos+n,c=new d.protocol.Account.Frozen;t.pos<l;){var u=t.uint32();switch(u>>>3){case 1:c.frozenBalance=t.int64();break;case 2:c.expireTime=t.int64();break;default:t.skipType(u&7);break}}return c},o.decodeDelimited=function(t){return t instanceof v||(t=new v(t)),this.decode(t,t.uint32())},o.verify=function(t){return typeof t!="object"||t===null?"object expected":t.frozenBalance!=null&&t.hasOwnProperty("frozenBalance")&&!i.isInteger(t.frozenBalance)&&!(t.frozenBalance&&i.isInteger(t.frozenBalance.low)&&i.isInteger(t.frozenBalance.high))?"frozenBalance: integer|Long expected":t.expireTime!=null&&t.hasOwnProperty("expireTime")&&!i.isInteger(t.expireTime)&&!(t.expireTime&&i.isInteger(t.expireTime.low)&&i.isInteger(t.expireTime.high))?"expireTime: integer|Long expected":null},o.fromObject=function(t){if(t instanceof d.protocol.Account.Frozen)return t;var n=new d.protocol.Account.Frozen;return t.frozenBalance!=null&&(i.Long?(n.frozenBalance=i.Long.fromValue(t.frozenBalance)).unsigned=!1:typeof t.frozenBalance=="string"?n.frozenBalance=parseInt(t.frozenBalance,10):typeof t.frozenBalance=="number"?n.frozenBalance=t.frozenBalance:typeof t.frozenBalance=="object"&&(n.frozenBalance=new i.LongBits(t.frozenBalance.low>>>0,t.frozenBalance.high>>>0).toNumber())),t.expireTime!=null&&(i.Long?(n.expireTime=i.Long.fromValue(t.expireTime)).unsigned=!1:typeof t.expireTime=="string"?n.expireTime=parseInt(t.expireTime,10):typeof t.expireTime=="number"?n.expireTime=t.expireTime:typeof t.expireTime=="object"&&(n.expireTime=new i.LongBits(t.expireTime.low>>>0,t.expireTime.high>>>0).toNumber())),n},o.toObject=function(t,n){n||(n={});var l={};if(n.defaults){if(i.Long){var c=new i.Long(0,0,!1);l.frozenBalance=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.frozenBalance=n.longs===String?"0":0;if(i.Long){var c=new i.Long(0,0,!1);l.expireTime=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.expireTime=n.longs===String?"0":0}return t.frozenBalance!=null&&t.hasOwnProperty("frozenBalance")&&(typeof t.frozenBalance=="number"?l.frozenBalance=n.longs===String?String(t.frozenBalance):t.frozenBalance:l.frozenBalance=n.longs===String?i.Long.prototype.toString.call(t.frozenBalance):n.longs===Number?new i.LongBits(t.frozenBalance.low>>>0,t.frozenBalance.high>>>0).toNumber():t.frozenBalance),t.expireTime!=null&&t.hasOwnProperty("expireTime")&&(typeof t.expireTime=="number"?l.expireTime=n.longs===String?String(t.expireTime):t.expireTime:l.expireTime=n.longs===String?i.Long.prototype.toString.call(t.expireTime):n.longs===Number?new i.LongBits(t.expireTime.low>>>0,t.expireTime.high>>>0).toNumber():t.expireTime),l},o.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},o}(),r.AccountResource=function(){function o(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return o.prototype.energyUsage=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.frozenBalanceForEnergy=null,o.prototype.latestConsumeTimeForEnergy=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.acquiredDelegatedFrozenBalanceForEnergy=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.delegatedFrozenBalanceForEnergy=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.storageLimit=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.storageUsage=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.latestExchangeStorageTime=i.Long?i.Long.fromBits(0,0,!1):0,o.create=function(t){return new o(t)},o.encode=function(t,n){return n||(n=H.create()),t.energyUsage!=null&&Object.hasOwnProperty.call(t,"energyUsage")&&n.uint32(8).int64(t.energyUsage),t.frozenBalanceForEnergy!=null&&Object.hasOwnProperty.call(t,"frozenBalanceForEnergy")&&d.protocol.Account.Frozen.encode(t.frozenBalanceForEnergy,n.uint32(18).fork()).ldelim(),t.latestConsumeTimeForEnergy!=null&&Object.hasOwnProperty.call(t,"latestConsumeTimeForEnergy")&&n.uint32(24).int64(t.latestConsumeTimeForEnergy),t.acquiredDelegatedFrozenBalanceForEnergy!=null&&Object.hasOwnProperty.call(t,"acquiredDelegatedFrozenBalanceForEnergy")&&n.uint32(32).int64(t.acquiredDelegatedFrozenBalanceForEnergy),t.delegatedFrozenBalanceForEnergy!=null&&Object.hasOwnProperty.call(t,"delegatedFrozenBalanceForEnergy")&&n.uint32(40).int64(t.delegatedFrozenBalanceForEnergy),t.storageLimit!=null&&Object.hasOwnProperty.call(t,"storageLimit")&&n.uint32(48).int64(t.storageLimit),t.storageUsage!=null&&Object.hasOwnProperty.call(t,"storageUsage")&&n.uint32(56).int64(t.storageUsage),t.latestExchangeStorageTime!=null&&Object.hasOwnProperty.call(t,"latestExchangeStorageTime")&&n.uint32(64).int64(t.latestExchangeStorageTime),n},o.encodeDelimited=function(t,n){return this.encode(t,n).ldelim()},o.decode=function(t,n){t instanceof v||(t=v.create(t));for(var l=n===void 0?t.len:t.pos+n,c=new d.protocol.Account.AccountResource;t.pos<l;){var u=t.uint32();switch(u>>>3){case 1:c.energyUsage=t.int64();break;case 2:c.frozenBalanceForEnergy=d.protocol.Account.Frozen.decode(t,t.uint32());break;case 3:c.latestConsumeTimeForEnergy=t.int64();break;case 4:c.acquiredDelegatedFrozenBalanceForEnergy=t.int64();break;case 5:c.delegatedFrozenBalanceForEnergy=t.int64();break;case 6:c.storageLimit=t.int64();break;case 7:c.storageUsage=t.int64();break;case 8:c.latestExchangeStorageTime=t.int64();break;default:t.skipType(u&7);break}}return c},o.decodeDelimited=function(t){return t instanceof v||(t=new v(t)),this.decode(t,t.uint32())},o.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.energyUsage!=null&&t.hasOwnProperty("energyUsage")&&!i.isInteger(t.energyUsage)&&!(t.energyUsage&&i.isInteger(t.energyUsage.low)&&i.isInteger(t.energyUsage.high)))return"energyUsage: integer|Long expected";if(t.frozenBalanceForEnergy!=null&&t.hasOwnProperty("frozenBalanceForEnergy")){var n=d.protocol.Account.Frozen.verify(t.frozenBalanceForEnergy);if(n)return"frozenBalanceForEnergy."+n}return t.latestConsumeTimeForEnergy!=null&&t.hasOwnProperty("latestConsumeTimeForEnergy")&&!i.isInteger(t.latestConsumeTimeForEnergy)&&!(t.latestConsumeTimeForEnergy&&i.isInteger(t.latestConsumeTimeForEnergy.low)&&i.isInteger(t.latestConsumeTimeForEnergy.high))?"latestConsumeTimeForEnergy: integer|Long expected":t.acquiredDelegatedFrozenBalanceForEnergy!=null&&t.hasOwnProperty("acquiredDelegatedFrozenBalanceForEnergy")&&!i.isInteger(t.acquiredDelegatedFrozenBalanceForEnergy)&&!(t.acquiredDelegatedFrozenBalanceForEnergy&&i.isInteger(t.acquiredDelegatedFrozenBalanceForEnergy.low)&&i.isInteger(t.acquiredDelegatedFrozenBalanceForEnergy.high))?"acquiredDelegatedFrozenBalanceForEnergy: integer|Long expected":t.delegatedFrozenBalanceForEnergy!=null&&t.hasOwnProperty("delegatedFrozenBalanceForEnergy")&&!i.isInteger(t.delegatedFrozenBalanceForEnergy)&&!(t.delegatedFrozenBalanceForEnergy&&i.isInteger(t.delegatedFrozenBalanceForEnergy.low)&&i.isInteger(t.delegatedFrozenBalanceForEnergy.high))?"delegatedFrozenBalanceForEnergy: integer|Long expected":t.storageLimit!=null&&t.hasOwnProperty("storageLimit")&&!i.isInteger(t.storageLimit)&&!(t.storageLimit&&i.isInteger(t.storageLimit.low)&&i.isInteger(t.storageLimit.high))?"storageLimit: integer|Long expected":t.storageUsage!=null&&t.hasOwnProperty("storageUsage")&&!i.isInteger(t.storageUsage)&&!(t.storageUsage&&i.isInteger(t.storageUsage.low)&&i.isInteger(t.storageUsage.high))?"storageUsage: integer|Long expected":t.latestExchangeStorageTime!=null&&t.hasOwnProperty("latestExchangeStorageTime")&&!i.isInteger(t.latestExchangeStorageTime)&&!(t.latestExchangeStorageTime&&i.isInteger(t.latestExchangeStorageTime.low)&&i.isInteger(t.latestExchangeStorageTime.high))?"latestExchangeStorageTime: integer|Long expected":null},o.fromObject=function(t){if(t instanceof d.protocol.Account.AccountResource)return t;var n=new d.protocol.Account.AccountResource;if(t.energyUsage!=null&&(i.Long?(n.energyUsage=i.Long.fromValue(t.energyUsage)).unsigned=!1:typeof t.energyUsage=="string"?n.energyUsage=parseInt(t.energyUsage,10):typeof t.energyUsage=="number"?n.energyUsage=t.energyUsage:typeof t.energyUsage=="object"&&(n.energyUsage=new i.LongBits(t.energyUsage.low>>>0,t.energyUsage.high>>>0).toNumber())),t.frozenBalanceForEnergy!=null){if(typeof t.frozenBalanceForEnergy!="object")throw TypeError(".protocol.Account.AccountResource.frozenBalanceForEnergy: object expected");n.frozenBalanceForEnergy=d.protocol.Account.Frozen.fromObject(t.frozenBalanceForEnergy)}return t.latestConsumeTimeForEnergy!=null&&(i.Long?(n.latestConsumeTimeForEnergy=i.Long.fromValue(t.latestConsumeTimeForEnergy)).unsigned=!1:typeof t.latestConsumeTimeForEnergy=="string"?n.latestConsumeTimeForEnergy=parseInt(t.latestConsumeTimeForEnergy,10):typeof t.latestConsumeTimeForEnergy=="number"?n.latestConsumeTimeForEnergy=t.latestConsumeTimeForEnergy:typeof t.latestConsumeTimeForEnergy=="object"&&(n.latestConsumeTimeForEnergy=new i.LongBits(t.latestConsumeTimeForEnergy.low>>>0,t.latestConsumeTimeForEnergy.high>>>0).toNumber())),t.acquiredDelegatedFrozenBalanceForEnergy!=null&&(i.Long?(n.acquiredDelegatedFrozenBalanceForEnergy=i.Long.fromValue(t.acquiredDelegatedFrozenBalanceForEnergy)).unsigned=!1:typeof t.acquiredDelegatedFrozenBalanceForEnergy=="string"?n.acquiredDelegatedFrozenBalanceForEnergy=parseInt(t.acquiredDelegatedFrozenBalanceForEnergy,10):typeof t.acquiredDelegatedFrozenBalanceForEnergy=="number"?n.acquiredDelegatedFrozenBalanceForEnergy=t.acquiredDelegatedFrozenBalanceForEnergy:typeof t.acquiredDelegatedFrozenBalanceForEnergy=="object"&&(n.acquiredDelegatedFrozenBalanceForEnergy=new i.LongBits(t.acquiredDelegatedFrozenBalanceForEnergy.low>>>0,t.acquiredDelegatedFrozenBalanceForEnergy.high>>>0).toNumber())),t.delegatedFrozenBalanceForEnergy!=null&&(i.Long?(n.delegatedFrozenBalanceForEnergy=i.Long.fromValue(t.delegatedFrozenBalanceForEnergy)).unsigned=!1:typeof t.delegatedFrozenBalanceForEnergy=="string"?n.delegatedFrozenBalanceForEnergy=parseInt(t.delegatedFrozenBalanceForEnergy,10):typeof t.delegatedFrozenBalanceForEnergy=="number"?n.delegatedFrozenBalanceForEnergy=t.delegatedFrozenBalanceForEnergy:typeof t.delegatedFrozenBalanceForEnergy=="object"&&(n.delegatedFrozenBalanceForEnergy=new i.LongBits(t.delegatedFrozenBalanceForEnergy.low>>>0,t.delegatedFrozenBalanceForEnergy.high>>>0).toNumber())),t.storageLimit!=null&&(i.Long?(n.storageLimit=i.Long.fromValue(t.storageLimit)).unsigned=!1:typeof t.storageLimit=="string"?n.storageLimit=parseInt(t.storageLimit,10):typeof t.storageLimit=="number"?n.storageLimit=t.storageLimit:typeof t.storageLimit=="object"&&(n.storageLimit=new i.LongBits(t.storageLimit.low>>>0,t.storageLimit.high>>>0).toNumber())),t.storageUsage!=null&&(i.Long?(n.storageUsage=i.Long.fromValue(t.storageUsage)).unsigned=!1:typeof t.storageUsage=="string"?n.storageUsage=parseInt(t.storageUsage,10):typeof t.storageUsage=="number"?n.storageUsage=t.storageUsage:typeof t.storageUsage=="object"&&(n.storageUsage=new i.LongBits(t.storageUsage.low>>>0,t.storageUsage.high>>>0).toNumber())),t.latestExchangeStorageTime!=null&&(i.Long?(n.latestExchangeStorageTime=i.Long.fromValue(t.latestExchangeStorageTime)).unsigned=!1:typeof t.latestExchangeStorageTime=="string"?n.latestExchangeStorageTime=parseInt(t.latestExchangeStorageTime,10):typeof t.latestExchangeStorageTime=="number"?n.latestExchangeStorageTime=t.latestExchangeStorageTime:typeof t.latestExchangeStorageTime=="object"&&(n.latestExchangeStorageTime=new i.LongBits(t.latestExchangeStorageTime.low>>>0,t.latestExchangeStorageTime.high>>>0).toNumber())),n},o.toObject=function(t,n){n||(n={});var l={};if(n.defaults){if(i.Long){var c=new i.Long(0,0,!1);l.energyUsage=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.energyUsage=n.longs===String?"0":0;if(l.frozenBalanceForEnergy=null,i.Long){var c=new i.Long(0,0,!1);l.latestConsumeTimeForEnergy=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.latestConsumeTimeForEnergy=n.longs===String?"0":0;if(i.Long){var c=new i.Long(0,0,!1);l.acquiredDelegatedFrozenBalanceForEnergy=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.acquiredDelegatedFrozenBalanceForEnergy=n.longs===String?"0":0;if(i.Long){var c=new i.Long(0,0,!1);l.delegatedFrozenBalanceForEnergy=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.delegatedFrozenBalanceForEnergy=n.longs===String?"0":0;if(i.Long){var c=new i.Long(0,0,!1);l.storageLimit=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.storageLimit=n.longs===String?"0":0;if(i.Long){var c=new i.Long(0,0,!1);l.storageUsage=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.storageUsage=n.longs===String?"0":0;if(i.Long){var c=new i.Long(0,0,!1);l.latestExchangeStorageTime=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.latestExchangeStorageTime=n.longs===String?"0":0}return t.energyUsage!=null&&t.hasOwnProperty("energyUsage")&&(typeof t.energyUsage=="number"?l.energyUsage=n.longs===String?String(t.energyUsage):t.energyUsage:l.energyUsage=n.longs===String?i.Long.prototype.toString.call(t.energyUsage):n.longs===Number?new i.LongBits(t.energyUsage.low>>>0,t.energyUsage.high>>>0).toNumber():t.energyUsage),t.frozenBalanceForEnergy!=null&&t.hasOwnProperty("frozenBalanceForEnergy")&&(l.frozenBalanceForEnergy=d.protocol.Account.Frozen.toObject(t.frozenBalanceForEnergy,n)),t.latestConsumeTimeForEnergy!=null&&t.hasOwnProperty("latestConsumeTimeForEnergy")&&(typeof t.latestConsumeTimeForEnergy=="number"?l.latestConsumeTimeForEnergy=n.longs===String?String(t.latestConsumeTimeForEnergy):t.latestConsumeTimeForEnergy:l.latestConsumeTimeForEnergy=n.longs===String?i.Long.prototype.toString.call(t.latestConsumeTimeForEnergy):n.longs===Number?new i.LongBits(t.latestConsumeTimeForEnergy.low>>>0,t.latestConsumeTimeForEnergy.high>>>0).toNumber():t.latestConsumeTimeForEnergy),t.acquiredDelegatedFrozenBalanceForEnergy!=null&&t.hasOwnProperty("acquiredDelegatedFrozenBalanceForEnergy")&&(typeof t.acquiredDelegatedFrozenBalanceForEnergy=="number"?l.acquiredDelegatedFrozenBalanceForEnergy=n.longs===String?String(t.acquiredDelegatedFrozenBalanceForEnergy):t.acquiredDelegatedFrozenBalanceForEnergy:l.acquiredDelegatedFrozenBalanceForEnergy=n.longs===String?i.Long.prototype.toString.call(t.acquiredDelegatedFrozenBalanceForEnergy):n.longs===Number?new i.LongBits(t.acquiredDelegatedFrozenBalanceForEnergy.low>>>0,t.acquiredDelegatedFrozenBalanceForEnergy.high>>>0).toNumber():t.acquiredDelegatedFrozenBalanceForEnergy),t.delegatedFrozenBalanceForEnergy!=null&&t.hasOwnProperty("delegatedFrozenBalanceForEnergy")&&(typeof t.delegatedFrozenBalanceForEnergy=="number"?l.delegatedFrozenBalanceForEnergy=n.longs===String?String(t.delegatedFrozenBalanceForEnergy):t.delegatedFrozenBalanceForEnergy:l.delegatedFrozenBalanceForEnergy=n.longs===String?i.Long.prototype.toString.call(t.delegatedFrozenBalanceForEnergy):n.longs===Number?new i.LongBits(t.delegatedFrozenBalanceForEnergy.low>>>0,t.delegatedFrozenBalanceForEnergy.high>>>0).toNumber():t.delegatedFrozenBalanceForEnergy),t.storageLimit!=null&&t.hasOwnProperty("storageLimit")&&(typeof t.storageLimit=="number"?l.storageLimit=n.longs===String?String(t.storageLimit):t.storageLimit:l.storageLimit=n.longs===String?i.Long.prototype.toString.call(t.storageLimit):n.longs===Number?new i.LongBits(t.storageLimit.low>>>0,t.storageLimit.high>>>0).toNumber():t.storageLimit),t.storageUsage!=null&&t.hasOwnProperty("storageUsage")&&(typeof t.storageUsage=="number"?l.storageUsage=n.longs===String?String(t.storageUsage):t.storageUsage:l.storageUsage=n.longs===String?i.Long.prototype.toString.call(t.storageUsage):n.longs===Number?new i.LongBits(t.storageUsage.low>>>0,t.storageUsage.high>>>0).toNumber():t.storageUsage),t.latestExchangeStorageTime!=null&&t.hasOwnProperty("latestExchangeStorageTime")&&(typeof t.latestExchangeStorageTime=="number"?l.latestExchangeStorageTime=n.longs===String?String(t.latestExchangeStorageTime):t.latestExchangeStorageTime:l.latestExchangeStorageTime=n.longs===String?i.Long.prototype.toString.call(t.latestExchangeStorageTime):n.longs===Number?new i.LongBits(t.latestExchangeStorageTime.low>>>0,t.latestExchangeStorageTime.high>>>0).toNumber():t.latestExchangeStorageTime),l},o.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},o}(),r}(),f.Key=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.address=i.newBuffer([]),r.prototype.weight=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.address!=null&&Object.hasOwnProperty.call(e,"address")&&t.uint32(10).bytes(e.address),e.weight!=null&&Object.hasOwnProperty.call(e,"weight")&&t.uint32(16).int64(e.weight),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.Key;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.address=e.bytes();break;case 2:l.weight=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.address!=null&&e.hasOwnProperty("address")&&!(e.address&&typeof e.address.length=="number"||i.isString(e.address))?"address: buffer expected":e.weight!=null&&e.hasOwnProperty("weight")&&!i.isInteger(e.weight)&&!(e.weight&&i.isInteger(e.weight.low)&&i.isInteger(e.weight.high))?"weight: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.Key)return e;var t=new d.protocol.Key;return e.address!=null&&(typeof e.address=="string"?i.base64.decode(e.address,t.address=i.newBuffer(i.base64.length(e.address)),0):e.address.length&&(t.address=e.address)),e.weight!=null&&(i.Long?(t.weight=i.Long.fromValue(e.weight)).unsigned=!1:typeof e.weight=="string"?t.weight=parseInt(e.weight,10):typeof e.weight=="number"?t.weight=e.weight:typeof e.weight=="object"&&(t.weight=new i.LongBits(e.weight.low>>>0,e.weight.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults)if(t.bytes===String?n.address="":(n.address=[],t.bytes!==Array&&(n.address=i.newBuffer(n.address))),i.Long){var l=new i.Long(0,0,!1);n.weight=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.weight=t.longs===String?"0":0;return e.address!=null&&e.hasOwnProperty("address")&&(n.address=t.bytes===String?i.base64.encode(e.address,0,e.address.length):t.bytes===Array?Array.prototype.slice.call(e.address):e.address),e.weight!=null&&e.hasOwnProperty("weight")&&(typeof e.weight=="number"?n.weight=t.longs===String?String(e.weight):e.weight:n.weight=t.longs===String?i.Long.prototype.toString.call(e.weight):t.longs===Number?new i.LongBits(e.weight.low>>>0,e.weight.high>>>0).toNumber():e.weight),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.DelegatedResource=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.from=i.newBuffer([]),r.prototype.to=i.newBuffer([]),r.prototype.frozenBalanceForBandwidth=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.frozenBalanceForEnergy=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.expireTimeForBandwidth=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.expireTimeForEnergy=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.from!=null&&Object.hasOwnProperty.call(e,"from")&&t.uint32(10).bytes(e.from),e.to!=null&&Object.hasOwnProperty.call(e,"to")&&t.uint32(18).bytes(e.to),e.frozenBalanceForBandwidth!=null&&Object.hasOwnProperty.call(e,"frozenBalanceForBandwidth")&&t.uint32(24).int64(e.frozenBalanceForBandwidth),e.frozenBalanceForEnergy!=null&&Object.hasOwnProperty.call(e,"frozenBalanceForEnergy")&&t.uint32(32).int64(e.frozenBalanceForEnergy),e.expireTimeForBandwidth!=null&&Object.hasOwnProperty.call(e,"expireTimeForBandwidth")&&t.uint32(40).int64(e.expireTimeForBandwidth),e.expireTimeForEnergy!=null&&Object.hasOwnProperty.call(e,"expireTimeForEnergy")&&t.uint32(48).int64(e.expireTimeForEnergy),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.DelegatedResource;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.from=e.bytes();break;case 2:l.to=e.bytes();break;case 3:l.frozenBalanceForBandwidth=e.int64();break;case 4:l.frozenBalanceForEnergy=e.int64();break;case 5:l.expireTimeForBandwidth=e.int64();break;case 6:l.expireTimeForEnergy=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.from!=null&&e.hasOwnProperty("from")&&!(e.from&&typeof e.from.length=="number"||i.isString(e.from))?"from: buffer expected":e.to!=null&&e.hasOwnProperty("to")&&!(e.to&&typeof e.to.length=="number"||i.isString(e.to))?"to: buffer expected":e.frozenBalanceForBandwidth!=null&&e.hasOwnProperty("frozenBalanceForBandwidth")&&!i.isInteger(e.frozenBalanceForBandwidth)&&!(e.frozenBalanceForBandwidth&&i.isInteger(e.frozenBalanceForBandwidth.low)&&i.isInteger(e.frozenBalanceForBandwidth.high))?"frozenBalanceForBandwidth: integer|Long expected":e.frozenBalanceForEnergy!=null&&e.hasOwnProperty("frozenBalanceForEnergy")&&!i.isInteger(e.frozenBalanceForEnergy)&&!(e.frozenBalanceForEnergy&&i.isInteger(e.frozenBalanceForEnergy.low)&&i.isInteger(e.frozenBalanceForEnergy.high))?"frozenBalanceForEnergy: integer|Long expected":e.expireTimeForBandwidth!=null&&e.hasOwnProperty("expireTimeForBandwidth")&&!i.isInteger(e.expireTimeForBandwidth)&&!(e.expireTimeForBandwidth&&i.isInteger(e.expireTimeForBandwidth.low)&&i.isInteger(e.expireTimeForBandwidth.high))?"expireTimeForBandwidth: integer|Long expected":e.expireTimeForEnergy!=null&&e.hasOwnProperty("expireTimeForEnergy")&&!i.isInteger(e.expireTimeForEnergy)&&!(e.expireTimeForEnergy&&i.isInteger(e.expireTimeForEnergy.low)&&i.isInteger(e.expireTimeForEnergy.high))?"expireTimeForEnergy: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.DelegatedResource)return e;var t=new d.protocol.DelegatedResource;return e.from!=null&&(typeof e.from=="string"?i.base64.decode(e.from,t.from=i.newBuffer(i.base64.length(e.from)),0):e.from.length&&(t.from=e.from)),e.to!=null&&(typeof e.to=="string"?i.base64.decode(e.to,t.to=i.newBuffer(i.base64.length(e.to)),0):e.to.length&&(t.to=e.to)),e.frozenBalanceForBandwidth!=null&&(i.Long?(t.frozenBalanceForBandwidth=i.Long.fromValue(e.frozenBalanceForBandwidth)).unsigned=!1:typeof e.frozenBalanceForBandwidth=="string"?t.frozenBalanceForBandwidth=parseInt(e.frozenBalanceForBandwidth,10):typeof e.frozenBalanceForBandwidth=="number"?t.frozenBalanceForBandwidth=e.frozenBalanceForBandwidth:typeof e.frozenBalanceForBandwidth=="object"&&(t.frozenBalanceForBandwidth=new i.LongBits(e.frozenBalanceForBandwidth.low>>>0,e.frozenBalanceForBandwidth.high>>>0).toNumber())),e.frozenBalanceForEnergy!=null&&(i.Long?(t.frozenBalanceForEnergy=i.Long.fromValue(e.frozenBalanceForEnergy)).unsigned=!1:typeof e.frozenBalanceForEnergy=="string"?t.frozenBalanceForEnergy=parseInt(e.frozenBalanceForEnergy,10):typeof e.frozenBalanceForEnergy=="number"?t.frozenBalanceForEnergy=e.frozenBalanceForEnergy:typeof e.frozenBalanceForEnergy=="object"&&(t.frozenBalanceForEnergy=new i.LongBits(e.frozenBalanceForEnergy.low>>>0,e.frozenBalanceForEnergy.high>>>0).toNumber())),e.expireTimeForBandwidth!=null&&(i.Long?(t.expireTimeForBandwidth=i.Long.fromValue(e.expireTimeForBandwidth)).unsigned=!1:typeof e.expireTimeForBandwidth=="string"?t.expireTimeForBandwidth=parseInt(e.expireTimeForBandwidth,10):typeof e.expireTimeForBandwidth=="number"?t.expireTimeForBandwidth=e.expireTimeForBandwidth:typeof e.expireTimeForBandwidth=="object"&&(t.expireTimeForBandwidth=new i.LongBits(e.expireTimeForBandwidth.low>>>0,e.expireTimeForBandwidth.high>>>0).toNumber())),e.expireTimeForEnergy!=null&&(i.Long?(t.expireTimeForEnergy=i.Long.fromValue(e.expireTimeForEnergy)).unsigned=!1:typeof e.expireTimeForEnergy=="string"?t.expireTimeForEnergy=parseInt(e.expireTimeForEnergy,10):typeof e.expireTimeForEnergy=="number"?t.expireTimeForEnergy=e.expireTimeForEnergy:typeof e.expireTimeForEnergy=="object"&&(t.expireTimeForEnergy=new i.LongBits(e.expireTimeForEnergy.low>>>0,e.expireTimeForEnergy.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(t.bytes===String?n.from="":(n.from=[],t.bytes!==Array&&(n.from=i.newBuffer(n.from))),t.bytes===String?n.to="":(n.to=[],t.bytes!==Array&&(n.to=i.newBuffer(n.to))),i.Long){var l=new i.Long(0,0,!1);n.frozenBalanceForBandwidth=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.frozenBalanceForBandwidth=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.frozenBalanceForEnergy=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.frozenBalanceForEnergy=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.expireTimeForBandwidth=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.expireTimeForBandwidth=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.expireTimeForEnergy=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.expireTimeForEnergy=t.longs===String?"0":0}return e.from!=null&&e.hasOwnProperty("from")&&(n.from=t.bytes===String?i.base64.encode(e.from,0,e.from.length):t.bytes===Array?Array.prototype.slice.call(e.from):e.from),e.to!=null&&e.hasOwnProperty("to")&&(n.to=t.bytes===String?i.base64.encode(e.to,0,e.to.length):t.bytes===Array?Array.prototype.slice.call(e.to):e.to),e.frozenBalanceForBandwidth!=null&&e.hasOwnProperty("frozenBalanceForBandwidth")&&(typeof e.frozenBalanceForBandwidth=="number"?n.frozenBalanceForBandwidth=t.longs===String?String(e.frozenBalanceForBandwidth):e.frozenBalanceForBandwidth:n.frozenBalanceForBandwidth=t.longs===String?i.Long.prototype.toString.call(e.frozenBalanceForBandwidth):t.longs===Number?new i.LongBits(e.frozenBalanceForBandwidth.low>>>0,e.frozenBalanceForBandwidth.high>>>0).toNumber():e.frozenBalanceForBandwidth),e.frozenBalanceForEnergy!=null&&e.hasOwnProperty("frozenBalanceForEnergy")&&(typeof e.frozenBalanceForEnergy=="number"?n.frozenBalanceForEnergy=t.longs===String?String(e.frozenBalanceForEnergy):e.frozenBalanceForEnergy:n.frozenBalanceForEnergy=t.longs===String?i.Long.prototype.toString.call(e.frozenBalanceForEnergy):t.longs===Number?new i.LongBits(e.frozenBalanceForEnergy.low>>>0,e.frozenBalanceForEnergy.high>>>0).toNumber():e.frozenBalanceForEnergy),e.expireTimeForBandwidth!=null&&e.hasOwnProperty("expireTimeForBandwidth")&&(typeof e.expireTimeForBandwidth=="number"?n.expireTimeForBandwidth=t.longs===String?String(e.expireTimeForBandwidth):e.expireTimeForBandwidth:n.expireTimeForBandwidth=t.longs===String?i.Long.prototype.toString.call(e.expireTimeForBandwidth):t.longs===Number?new i.LongBits(e.expireTimeForBandwidth.low>>>0,e.expireTimeForBandwidth.high>>>0).toNumber():e.expireTimeForBandwidth),e.expireTimeForEnergy!=null&&e.hasOwnProperty("expireTimeForEnergy")&&(typeof e.expireTimeForEnergy=="number"?n.expireTimeForEnergy=t.longs===String?String(e.expireTimeForEnergy):e.expireTimeForEnergy:n.expireTimeForEnergy=t.longs===String?i.Long.prototype.toString.call(e.expireTimeForEnergy):t.longs===Number?new i.LongBits(e.expireTimeForEnergy.low>>>0,e.expireTimeForEnergy.high>>>0).toNumber():e.expireTimeForEnergy),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.authority=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.account=null,r.prototype.permissionName=i.newBuffer([]),r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.account!=null&&Object.hasOwnProperty.call(e,"account")&&d.protocol.AccountId.encode(e.account,t.uint32(10).fork()).ldelim(),e.permissionName!=null&&Object.hasOwnProperty.call(e,"permissionName")&&t.uint32(18).bytes(e.permissionName),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.authority;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.account=d.protocol.AccountId.decode(e,e.uint32());break;case 2:l.permissionName=e.bytes();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.account!=null&&e.hasOwnProperty("account")){var t=d.protocol.AccountId.verify(e.account);if(t)return"account."+t}return e.permissionName!=null&&e.hasOwnProperty("permissionName")&&!(e.permissionName&&typeof e.permissionName.length=="number"||i.isString(e.permissionName))?"permissionName: buffer expected":null},r.fromObject=function(e){if(e instanceof d.protocol.authority)return e;var t=new d.protocol.authority;if(e.account!=null){if(typeof e.account!="object")throw TypeError(".protocol.authority.account: object expected");t.account=d.protocol.AccountId.fromObject(e.account)}return e.permissionName!=null&&(typeof e.permissionName=="string"?i.base64.decode(e.permissionName,t.permissionName=i.newBuffer(i.base64.length(e.permissionName)),0):e.permissionName.length&&(t.permissionName=e.permissionName)),t},r.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.account=null,t.bytes===String?n.permissionName="":(n.permissionName=[],t.bytes!==Array&&(n.permissionName=i.newBuffer(n.permissionName)))),e.account!=null&&e.hasOwnProperty("account")&&(n.account=d.protocol.AccountId.toObject(e.account,t)),e.permissionName!=null&&e.hasOwnProperty("permissionName")&&(n.permissionName=t.bytes===String?i.base64.encode(e.permissionName,0,e.permissionName.length):t.bytes===Array?Array.prototype.slice.call(e.permissionName):e.permissionName),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.Permission=function(){function r(o){if(this.keys=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.type=0,r.prototype.id=0,r.prototype.permissionName="",r.prototype.threshold=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.parentId=0,r.prototype.operations=i.newBuffer([]),r.prototype.keys=i.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).int32(e.type),e.id!=null&&Object.hasOwnProperty.call(e,"id")&&t.uint32(16).int32(e.id),e.permissionName!=null&&Object.hasOwnProperty.call(e,"permissionName")&&t.uint32(26).string(e.permissionName),e.threshold!=null&&Object.hasOwnProperty.call(e,"threshold")&&t.uint32(32).int64(e.threshold),e.parentId!=null&&Object.hasOwnProperty.call(e,"parentId")&&t.uint32(40).int32(e.parentId),e.operations!=null&&Object.hasOwnProperty.call(e,"operations")&&t.uint32(50).bytes(e.operations),e.keys!=null&&e.keys.length)for(var n=0;n<e.keys.length;++n)d.protocol.Key.encode(e.keys[n],t.uint32(58).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.Permission;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.type=e.int32();break;case 2:l.id=e.int32();break;case 3:l.permissionName=e.string();break;case 4:l.threshold=e.int64();break;case 5:l.parentId=e.int32();break;case 6:l.operations=e.bytes();break;case 7:l.keys&&l.keys.length||(l.keys=[]),l.keys.push(d.protocol.Key.decode(e,e.uint32()));break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:break}if(e.id!=null&&e.hasOwnProperty("id")&&!i.isInteger(e.id))return"id: integer expected";if(e.permissionName!=null&&e.hasOwnProperty("permissionName")&&!i.isString(e.permissionName))return"permissionName: string expected";if(e.threshold!=null&&e.hasOwnProperty("threshold")&&!i.isInteger(e.threshold)&&!(e.threshold&&i.isInteger(e.threshold.low)&&i.isInteger(e.threshold.high)))return"threshold: integer|Long expected";if(e.parentId!=null&&e.hasOwnProperty("parentId")&&!i.isInteger(e.parentId))return"parentId: integer expected";if(e.operations!=null&&e.hasOwnProperty("operations")&&!(e.operations&&typeof e.operations.length=="number"||i.isString(e.operations)))return"operations: buffer expected";if(e.keys!=null&&e.hasOwnProperty("keys")){if(!Array.isArray(e.keys))return"keys: array expected";for(var t=0;t<e.keys.length;++t){var n=d.protocol.Key.verify(e.keys[t]);if(n)return"keys."+n}}return null},r.fromObject=function(e){if(e instanceof d.protocol.Permission)return e;var t=new d.protocol.Permission;switch(e.type){case"Owner":case 0:t.type=0;break;case"Witness":case 1:t.type=1;break;case"Active":case 2:t.type=2;break}if(e.id!=null&&(t.id=e.id|0),e.permissionName!=null&&(t.permissionName=String(e.permissionName)),e.threshold!=null&&(i.Long?(t.threshold=i.Long.fromValue(e.threshold)).unsigned=!1:typeof e.threshold=="string"?t.threshold=parseInt(e.threshold,10):typeof e.threshold=="number"?t.threshold=e.threshold:typeof e.threshold=="object"&&(t.threshold=new i.LongBits(e.threshold.low>>>0,e.threshold.high>>>0).toNumber())),e.parentId!=null&&(t.parentId=e.parentId|0),e.operations!=null&&(typeof e.operations=="string"?i.base64.decode(e.operations,t.operations=i.newBuffer(i.base64.length(e.operations)),0):e.operations.length&&(t.operations=e.operations)),e.keys){if(!Array.isArray(e.keys))throw TypeError(".protocol.Permission.keys: array expected");t.keys=[];for(var n=0;n<e.keys.length;++n){if(typeof e.keys[n]!="object")throw TypeError(".protocol.Permission.keys: object expected");t.keys[n]=d.protocol.Key.fromObject(e.keys[n])}}return t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.keys=[]),t.defaults){if(n.type=t.enums===String?"Owner":0,n.id=0,n.permissionName="",i.Long){var l=new i.Long(0,0,!1);n.threshold=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.threshold=t.longs===String?"0":0;n.parentId=0,t.bytes===String?n.operations="":(n.operations=[],t.bytes!==Array&&(n.operations=i.newBuffer(n.operations)))}if(e.type!=null&&e.hasOwnProperty("type")&&(n.type=t.enums===String?d.protocol.Permission.PermissionType[e.type]:e.type),e.id!=null&&e.hasOwnProperty("id")&&(n.id=e.id),e.permissionName!=null&&e.hasOwnProperty("permissionName")&&(n.permissionName=e.permissionName),e.threshold!=null&&e.hasOwnProperty("threshold")&&(typeof e.threshold=="number"?n.threshold=t.longs===String?String(e.threshold):e.threshold:n.threshold=t.longs===String?i.Long.prototype.toString.call(e.threshold):t.longs===Number?new i.LongBits(e.threshold.low>>>0,e.threshold.high>>>0).toNumber():e.threshold),e.parentId!=null&&e.hasOwnProperty("parentId")&&(n.parentId=e.parentId),e.operations!=null&&e.hasOwnProperty("operations")&&(n.operations=t.bytes===String?i.base64.encode(e.operations,0,e.operations.length):t.bytes===Array?Array.prototype.slice.call(e.operations):e.operations),e.keys&&e.keys.length){n.keys=[];for(var c=0;c<e.keys.length;++c)n.keys[c]=d.protocol.Key.toObject(e.keys[c],t)}return n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r.PermissionType=function(){var o={},e=Object.create(o);return e[o[0]="Owner"]=0,e[o[1]="Witness"]=1,e[o[2]="Active"]=2,e}(),r}(),f.Witness=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.address=i.newBuffer([]),r.prototype.voteCount=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.pubKey=i.newBuffer([]),r.prototype.url="",r.prototype.totalProduced=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.totalMissed=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.latestBlockNum=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.latestSlotNum=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.isJobs=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.address!=null&&Object.hasOwnProperty.call(e,"address")&&t.uint32(10).bytes(e.address),e.voteCount!=null&&Object.hasOwnProperty.call(e,"voteCount")&&t.uint32(16).int64(e.voteCount),e.pubKey!=null&&Object.hasOwnProperty.call(e,"pubKey")&&t.uint32(26).bytes(e.pubKey),e.url!=null&&Object.hasOwnProperty.call(e,"url")&&t.uint32(34).string(e.url),e.totalProduced!=null&&Object.hasOwnProperty.call(e,"totalProduced")&&t.uint32(40).int64(e.totalProduced),e.totalMissed!=null&&Object.hasOwnProperty.call(e,"totalMissed")&&t.uint32(48).int64(e.totalMissed),e.latestBlockNum!=null&&Object.hasOwnProperty.call(e,"latestBlockNum")&&t.uint32(56).int64(e.latestBlockNum),e.latestSlotNum!=null&&Object.hasOwnProperty.call(e,"latestSlotNum")&&t.uint32(64).int64(e.latestSlotNum),e.isJobs!=null&&Object.hasOwnProperty.call(e,"isJobs")&&t.uint32(72).bool(e.isJobs),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.Witness;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.address=e.bytes();break;case 2:l.voteCount=e.int64();break;case 3:l.pubKey=e.bytes();break;case 4:l.url=e.string();break;case 5:l.totalProduced=e.int64();break;case 6:l.totalMissed=e.int64();break;case 7:l.latestBlockNum=e.int64();break;case 8:l.latestSlotNum=e.int64();break;case 9:l.isJobs=e.bool();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.address!=null&&e.hasOwnProperty("address")&&!(e.address&&typeof e.address.length=="number"||i.isString(e.address))?"address: buffer expected":e.voteCount!=null&&e.hasOwnProperty("voteCount")&&!i.isInteger(e.voteCount)&&!(e.voteCount&&i.isInteger(e.voteCount.low)&&i.isInteger(e.voteCount.high))?"voteCount: integer|Long expected":e.pubKey!=null&&e.hasOwnProperty("pubKey")&&!(e.pubKey&&typeof e.pubKey.length=="number"||i.isString(e.pubKey))?"pubKey: buffer expected":e.url!=null&&e.hasOwnProperty("url")&&!i.isString(e.url)?"url: string expected":e.totalProduced!=null&&e.hasOwnProperty("totalProduced")&&!i.isInteger(e.totalProduced)&&!(e.totalProduced&&i.isInteger(e.totalProduced.low)&&i.isInteger(e.totalProduced.high))?"totalProduced: integer|Long expected":e.totalMissed!=null&&e.hasOwnProperty("totalMissed")&&!i.isInteger(e.totalMissed)&&!(e.totalMissed&&i.isInteger(e.totalMissed.low)&&i.isInteger(e.totalMissed.high))?"totalMissed: integer|Long expected":e.latestBlockNum!=null&&e.hasOwnProperty("latestBlockNum")&&!i.isInteger(e.latestBlockNum)&&!(e.latestBlockNum&&i.isInteger(e.latestBlockNum.low)&&i.isInteger(e.latestBlockNum.high))?"latestBlockNum: integer|Long expected":e.latestSlotNum!=null&&e.hasOwnProperty("latestSlotNum")&&!i.isInteger(e.latestSlotNum)&&!(e.latestSlotNum&&i.isInteger(e.latestSlotNum.low)&&i.isInteger(e.latestSlotNum.high))?"latestSlotNum: integer|Long expected":e.isJobs!=null&&e.hasOwnProperty("isJobs")&&typeof e.isJobs!="boolean"?"isJobs: boolean expected":null},r.fromObject=function(e){if(e instanceof d.protocol.Witness)return e;var t=new d.protocol.Witness;return e.address!=null&&(typeof e.address=="string"?i.base64.decode(e.address,t.address=i.newBuffer(i.base64.length(e.address)),0):e.address.length&&(t.address=e.address)),e.voteCount!=null&&(i.Long?(t.voteCount=i.Long.fromValue(e.voteCount)).unsigned=!1:typeof e.voteCount=="string"?t.voteCount=parseInt(e.voteCount,10):typeof e.voteCount=="number"?t.voteCount=e.voteCount:typeof e.voteCount=="object"&&(t.voteCount=new i.LongBits(e.voteCount.low>>>0,e.voteCount.high>>>0).toNumber())),e.pubKey!=null&&(typeof e.pubKey=="string"?i.base64.decode(e.pubKey,t.pubKey=i.newBuffer(i.base64.length(e.pubKey)),0):e.pubKey.length&&(t.pubKey=e.pubKey)),e.url!=null&&(t.url=String(e.url)),e.totalProduced!=null&&(i.Long?(t.totalProduced=i.Long.fromValue(e.totalProduced)).unsigned=!1:typeof e.totalProduced=="string"?t.totalProduced=parseInt(e.totalProduced,10):typeof e.totalProduced=="number"?t.totalProduced=e.totalProduced:typeof e.totalProduced=="object"&&(t.totalProduced=new i.LongBits(e.totalProduced.low>>>0,e.totalProduced.high>>>0).toNumber())),e.totalMissed!=null&&(i.Long?(t.totalMissed=i.Long.fromValue(e.totalMissed)).unsigned=!1:typeof e.totalMissed=="string"?t.totalMissed=parseInt(e.totalMissed,10):typeof e.totalMissed=="number"?t.totalMissed=e.totalMissed:typeof e.totalMissed=="object"&&(t.totalMissed=new i.LongBits(e.totalMissed.low>>>0,e.totalMissed.high>>>0).toNumber())),e.latestBlockNum!=null&&(i.Long?(t.latestBlockNum=i.Long.fromValue(e.latestBlockNum)).unsigned=!1:typeof e.latestBlockNum=="string"?t.latestBlockNum=parseInt(e.latestBlockNum,10):typeof e.latestBlockNum=="number"?t.latestBlockNum=e.latestBlockNum:typeof e.latestBlockNum=="object"&&(t.latestBlockNum=new i.LongBits(e.latestBlockNum.low>>>0,e.latestBlockNum.high>>>0).toNumber())),e.latestSlotNum!=null&&(i.Long?(t.latestSlotNum=i.Long.fromValue(e.latestSlotNum)).unsigned=!1:typeof e.latestSlotNum=="string"?t.latestSlotNum=parseInt(e.latestSlotNum,10):typeof e.latestSlotNum=="number"?t.latestSlotNum=e.latestSlotNum:typeof e.latestSlotNum=="object"&&(t.latestSlotNum=new i.LongBits(e.latestSlotNum.low>>>0,e.latestSlotNum.high>>>0).toNumber())),e.isJobs!=null&&(t.isJobs=Boolean(e.isJobs)),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(t.bytes===String?n.address="":(n.address=[],t.bytes!==Array&&(n.address=i.newBuffer(n.address))),i.Long){var l=new i.Long(0,0,!1);n.voteCount=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.voteCount=t.longs===String?"0":0;if(t.bytes===String?n.pubKey="":(n.pubKey=[],t.bytes!==Array&&(n.pubKey=i.newBuffer(n.pubKey))),n.url="",i.Long){var l=new i.Long(0,0,!1);n.totalProduced=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.totalProduced=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.totalMissed=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.totalMissed=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.latestBlockNum=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.latestBlockNum=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.latestSlotNum=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.latestSlotNum=t.longs===String?"0":0;n.isJobs=!1}return e.address!=null&&e.hasOwnProperty("address")&&(n.address=t.bytes===String?i.base64.encode(e.address,0,e.address.length):t.bytes===Array?Array.prototype.slice.call(e.address):e.address),e.voteCount!=null&&e.hasOwnProperty("voteCount")&&(typeof e.voteCount=="number"?n.voteCount=t.longs===String?String(e.voteCount):e.voteCount:n.voteCount=t.longs===String?i.Long.prototype.toString.call(e.voteCount):t.longs===Number?new i.LongBits(e.voteCount.low>>>0,e.voteCount.high>>>0).toNumber():e.voteCount),e.pubKey!=null&&e.hasOwnProperty("pubKey")&&(n.pubKey=t.bytes===String?i.base64.encode(e.pubKey,0,e.pubKey.length):t.bytes===Array?Array.prototype.slice.call(e.pubKey):e.pubKey),e.url!=null&&e.hasOwnProperty("url")&&(n.url=e.url),e.totalProduced!=null&&e.hasOwnProperty("totalProduced")&&(typeof e.totalProduced=="number"?n.totalProduced=t.longs===String?String(e.totalProduced):e.totalProduced:n.totalProduced=t.longs===String?i.Long.prototype.toString.call(e.totalProduced):t.longs===Number?new i.LongBits(e.totalProduced.low>>>0,e.totalProduced.high>>>0).toNumber():e.totalProduced),e.totalMissed!=null&&e.hasOwnProperty("totalMissed")&&(typeof e.totalMissed=="number"?n.totalMissed=t.longs===String?String(e.totalMissed):e.totalMissed:n.totalMissed=t.longs===String?i.Long.prototype.toString.call(e.totalMissed):t.longs===Number?new i.LongBits(e.totalMissed.low>>>0,e.totalMissed.high>>>0).toNumber():e.totalMissed),e.latestBlockNum!=null&&e.hasOwnProperty("latestBlockNum")&&(typeof e.latestBlockNum=="number"?n.latestBlockNum=t.longs===String?String(e.latestBlockNum):e.latestBlockNum:n.latestBlockNum=t.longs===String?i.Long.prototype.toString.call(e.latestBlockNum):t.longs===Number?new i.LongBits(e.latestBlockNum.low>>>0,e.latestBlockNum.high>>>0).toNumber():e.latestBlockNum),e.latestSlotNum!=null&&e.hasOwnProperty("latestSlotNum")&&(typeof e.latestSlotNum=="number"?n.latestSlotNum=t.longs===String?String(e.latestSlotNum):e.latestSlotNum:n.latestSlotNum=t.longs===String?i.Long.prototype.toString.call(e.latestSlotNum):t.longs===Number?new i.LongBits(e.latestSlotNum.low>>>0,e.latestSlotNum.high>>>0).toNumber():e.latestSlotNum),e.isJobs!=null&&e.hasOwnProperty("isJobs")&&(n.isJobs=e.isJobs),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.Votes=function(){function r(o){if(this.oldVotes=[],this.newVotes=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.address=i.newBuffer([]),r.prototype.oldVotes=i.emptyArray,r.prototype.newVotes=i.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.address!=null&&Object.hasOwnProperty.call(e,"address")&&t.uint32(10).bytes(e.address),e.oldVotes!=null&&e.oldVotes.length)for(var n=0;n<e.oldVotes.length;++n)d.protocol.Vote.encode(e.oldVotes[n],t.uint32(18).fork()).ldelim();if(e.newVotes!=null&&e.newVotes.length)for(var n=0;n<e.newVotes.length;++n)d.protocol.Vote.encode(e.newVotes[n],t.uint32(26).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.Votes;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.address=e.bytes();break;case 2:l.oldVotes&&l.oldVotes.length||(l.oldVotes=[]),l.oldVotes.push(d.protocol.Vote.decode(e,e.uint32()));break;case 3:l.newVotes&&l.newVotes.length||(l.newVotes=[]),l.newVotes.push(d.protocol.Vote.decode(e,e.uint32()));break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.address!=null&&e.hasOwnProperty("address")&&!(e.address&&typeof e.address.length=="number"||i.isString(e.address)))return"address: buffer expected";if(e.oldVotes!=null&&e.hasOwnProperty("oldVotes")){if(!Array.isArray(e.oldVotes))return"oldVotes: array expected";for(var t=0;t<e.oldVotes.length;++t){var n=d.protocol.Vote.verify(e.oldVotes[t]);if(n)return"oldVotes."+n}}if(e.newVotes!=null&&e.hasOwnProperty("newVotes")){if(!Array.isArray(e.newVotes))return"newVotes: array expected";for(var t=0;t<e.newVotes.length;++t){var n=d.protocol.Vote.verify(e.newVotes[t]);if(n)return"newVotes."+n}}return null},r.fromObject=function(e){if(e instanceof d.protocol.Votes)return e;var t=new d.protocol.Votes;if(e.address!=null&&(typeof e.address=="string"?i.base64.decode(e.address,t.address=i.newBuffer(i.base64.length(e.address)),0):e.address.length&&(t.address=e.address)),e.oldVotes){if(!Array.isArray(e.oldVotes))throw TypeError(".protocol.Votes.oldVotes: array expected");t.oldVotes=[];for(var n=0;n<e.oldVotes.length;++n){if(typeof e.oldVotes[n]!="object")throw TypeError(".protocol.Votes.oldVotes: object expected");t.oldVotes[n]=d.protocol.Vote.fromObject(e.oldVotes[n])}}if(e.newVotes){if(!Array.isArray(e.newVotes))throw TypeError(".protocol.Votes.newVotes: array expected");t.newVotes=[];for(var n=0;n<e.newVotes.length;++n){if(typeof e.newVotes[n]!="object")throw TypeError(".protocol.Votes.newVotes: object expected");t.newVotes[n]=d.protocol.Vote.fromObject(e.newVotes[n])}}return t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.oldVotes=[],n.newVotes=[]),t.defaults&&(t.bytes===String?n.address="":(n.address=[],t.bytes!==Array&&(n.address=i.newBuffer(n.address)))),e.address!=null&&e.hasOwnProperty("address")&&(n.address=t.bytes===String?i.base64.encode(e.address,0,e.address.length):t.bytes===Array?Array.prototype.slice.call(e.address):e.address),e.oldVotes&&e.oldVotes.length){n.oldVotes=[];for(var l=0;l<e.oldVotes.length;++l)n.oldVotes[l]=d.protocol.Vote.toObject(e.oldVotes[l],t)}if(e.newVotes&&e.newVotes.length){n.newVotes=[];for(var l=0;l<e.newVotes.length;++l)n.newVotes[l]=d.protocol.Vote.toObject(e.newVotes[l],t)}return n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.TXOutput=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.value=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.pubKeyHash=i.newBuffer([]),r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.value!=null&&Object.hasOwnProperty.call(e,"value")&&t.uint32(8).int64(e.value),e.pubKeyHash!=null&&Object.hasOwnProperty.call(e,"pubKeyHash")&&t.uint32(18).bytes(e.pubKeyHash),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.TXOutput;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.value=e.int64();break;case 2:l.pubKeyHash=e.bytes();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.value!=null&&e.hasOwnProperty("value")&&!i.isInteger(e.value)&&!(e.value&&i.isInteger(e.value.low)&&i.isInteger(e.value.high))?"value: integer|Long expected":e.pubKeyHash!=null&&e.hasOwnProperty("pubKeyHash")&&!(e.pubKeyHash&&typeof e.pubKeyHash.length=="number"||i.isString(e.pubKeyHash))?"pubKeyHash: buffer expected":null},r.fromObject=function(e){if(e instanceof d.protocol.TXOutput)return e;var t=new d.protocol.TXOutput;return e.value!=null&&(i.Long?(t.value=i.Long.fromValue(e.value)).unsigned=!1:typeof e.value=="string"?t.value=parseInt(e.value,10):typeof e.value=="number"?t.value=e.value:typeof e.value=="object"&&(t.value=new i.LongBits(e.value.low>>>0,e.value.high>>>0).toNumber())),e.pubKeyHash!=null&&(typeof e.pubKeyHash=="string"?i.base64.decode(e.pubKeyHash,t.pubKeyHash=i.newBuffer(i.base64.length(e.pubKeyHash)),0):e.pubKeyHash.length&&(t.pubKeyHash=e.pubKeyHash)),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(i.Long){var l=new i.Long(0,0,!1);n.value=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.value=t.longs===String?"0":0;t.bytes===String?n.pubKeyHash="":(n.pubKeyHash=[],t.bytes!==Array&&(n.pubKeyHash=i.newBuffer(n.pubKeyHash)))}return e.value!=null&&e.hasOwnProperty("value")&&(typeof e.value=="number"?n.value=t.longs===String?String(e.value):e.value:n.value=t.longs===String?i.Long.prototype.toString.call(e.value):t.longs===Number?new i.LongBits(e.value.low>>>0,e.value.high>>>0).toNumber():e.value),e.pubKeyHash!=null&&e.hasOwnProperty("pubKeyHash")&&(n.pubKeyHash=t.bytes===String?i.base64.encode(e.pubKeyHash,0,e.pubKeyHash.length):t.bytes===Array?Array.prototype.slice.call(e.pubKeyHash):e.pubKeyHash),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.TXInput=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.rawData=null,r.prototype.signature=i.newBuffer([]),r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.rawData!=null&&Object.hasOwnProperty.call(e,"rawData")&&d.protocol.TXInput.raw.encode(e.rawData,t.uint32(10).fork()).ldelim(),e.signature!=null&&Object.hasOwnProperty.call(e,"signature")&&t.uint32(34).bytes(e.signature),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.TXInput;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.rawData=d.protocol.TXInput.raw.decode(e,e.uint32());break;case 4:l.signature=e.bytes();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.rawData!=null&&e.hasOwnProperty("rawData")){var t=d.protocol.TXInput.raw.verify(e.rawData);if(t)return"rawData."+t}return e.signature!=null&&e.hasOwnProperty("signature")&&!(e.signature&&typeof e.signature.length=="number"||i.isString(e.signature))?"signature: buffer expected":null},r.fromObject=function(e){if(e instanceof d.protocol.TXInput)return e;var t=new d.protocol.TXInput;if(e.rawData!=null){if(typeof e.rawData!="object")throw TypeError(".protocol.TXInput.rawData: object expected");t.rawData=d.protocol.TXInput.raw.fromObject(e.rawData)}return e.signature!=null&&(typeof e.signature=="string"?i.base64.decode(e.signature,t.signature=i.newBuffer(i.base64.length(e.signature)),0):e.signature.length&&(t.signature=e.signature)),t},r.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.rawData=null,t.bytes===String?n.signature="":(n.signature=[],t.bytes!==Array&&(n.signature=i.newBuffer(n.signature)))),e.rawData!=null&&e.hasOwnProperty("rawData")&&(n.rawData=d.protocol.TXInput.raw.toObject(e.rawData,t)),e.signature!=null&&e.hasOwnProperty("signature")&&(n.signature=t.bytes===String?i.base64.encode(e.signature,0,e.signature.length):t.bytes===Array?Array.prototype.slice.call(e.signature):e.signature),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r.raw=function(){function o(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return o.prototype.txID=i.newBuffer([]),o.prototype.vout=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.pubKey=i.newBuffer([]),o.create=function(t){return new o(t)},o.encode=function(t,n){return n||(n=H.create()),t.txID!=null&&Object.hasOwnProperty.call(t,"txID")&&n.uint32(10).bytes(t.txID),t.vout!=null&&Object.hasOwnProperty.call(t,"vout")&&n.uint32(16).int64(t.vout),t.pubKey!=null&&Object.hasOwnProperty.call(t,"pubKey")&&n.uint32(26).bytes(t.pubKey),n},o.encodeDelimited=function(t,n){return this.encode(t,n).ldelim()},o.decode=function(t,n){t instanceof v||(t=v.create(t));for(var l=n===void 0?t.len:t.pos+n,c=new d.protocol.TXInput.raw;t.pos<l;){var u=t.uint32();switch(u>>>3){case 1:c.txID=t.bytes();break;case 2:c.vout=t.int64();break;case 3:c.pubKey=t.bytes();break;default:t.skipType(u&7);break}}return c},o.decodeDelimited=function(t){return t instanceof v||(t=new v(t)),this.decode(t,t.uint32())},o.verify=function(t){return typeof t!="object"||t===null?"object expected":t.txID!=null&&t.hasOwnProperty("txID")&&!(t.txID&&typeof t.txID.length=="number"||i.isString(t.txID))?"txID: buffer expected":t.vout!=null&&t.hasOwnProperty("vout")&&!i.isInteger(t.vout)&&!(t.vout&&i.isInteger(t.vout.low)&&i.isInteger(t.vout.high))?"vout: integer|Long expected":t.pubKey!=null&&t.hasOwnProperty("pubKey")&&!(t.pubKey&&typeof t.pubKey.length=="number"||i.isString(t.pubKey))?"pubKey: buffer expected":null},o.fromObject=function(t){if(t instanceof d.protocol.TXInput.raw)return t;var n=new d.protocol.TXInput.raw;return t.txID!=null&&(typeof t.txID=="string"?i.base64.decode(t.txID,n.txID=i.newBuffer(i.base64.length(t.txID)),0):t.txID.length&&(n.txID=t.txID)),t.vout!=null&&(i.Long?(n.vout=i.Long.fromValue(t.vout)).unsigned=!1:typeof t.vout=="string"?n.vout=parseInt(t.vout,10):typeof t.vout=="number"?n.vout=t.vout:typeof t.vout=="object"&&(n.vout=new i.LongBits(t.vout.low>>>0,t.vout.high>>>0).toNumber())),t.pubKey!=null&&(typeof t.pubKey=="string"?i.base64.decode(t.pubKey,n.pubKey=i.newBuffer(i.base64.length(t.pubKey)),0):t.pubKey.length&&(n.pubKey=t.pubKey)),n},o.toObject=function(t,n){n||(n={});var l={};if(n.defaults){if(n.bytes===String?l.txID="":(l.txID=[],n.bytes!==Array&&(l.txID=i.newBuffer(l.txID))),i.Long){var c=new i.Long(0,0,!1);l.vout=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.vout=n.longs===String?"0":0;n.bytes===String?l.pubKey="":(l.pubKey=[],n.bytes!==Array&&(l.pubKey=i.newBuffer(l.pubKey)))}return t.txID!=null&&t.hasOwnProperty("txID")&&(l.txID=n.bytes===String?i.base64.encode(t.txID,0,t.txID.length):n.bytes===Array?Array.prototype.slice.call(t.txID):t.txID),t.vout!=null&&t.hasOwnProperty("vout")&&(typeof t.vout=="number"?l.vout=n.longs===String?String(t.vout):t.vout:l.vout=n.longs===String?i.Long.prototype.toString.call(t.vout):n.longs===Number?new i.LongBits(t.vout.low>>>0,t.vout.high>>>0).toNumber():t.vout),t.pubKey!=null&&t.hasOwnProperty("pubKey")&&(l.pubKey=n.bytes===String?i.base64.encode(t.pubKey,0,t.pubKey.length):n.bytes===Array?Array.prototype.slice.call(t.pubKey):t.pubKey),l},o.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},o}(),r}(),f.TXOutputs=function(){function r(o){if(this.outputs=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.outputs=i.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.outputs!=null&&e.outputs.length)for(var n=0;n<e.outputs.length;++n)d.protocol.TXOutput.encode(e.outputs[n],t.uint32(10).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.TXOutputs;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.outputs&&l.outputs.length||(l.outputs=[]),l.outputs.push(d.protocol.TXOutput.decode(e,e.uint32()));break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.outputs!=null&&e.hasOwnProperty("outputs")){if(!Array.isArray(e.outputs))return"outputs: array expected";for(var t=0;t<e.outputs.length;++t){var n=d.protocol.TXOutput.verify(e.outputs[t]);if(n)return"outputs."+n}}return null},r.fromObject=function(e){if(e instanceof d.protocol.TXOutputs)return e;var t=new d.protocol.TXOutputs;if(e.outputs){if(!Array.isArray(e.outputs))throw TypeError(".protocol.TXOutputs.outputs: array expected");t.outputs=[];for(var n=0;n<e.outputs.length;++n){if(typeof e.outputs[n]!="object")throw TypeError(".protocol.TXOutputs.outputs: object expected");t.outputs[n]=d.protocol.TXOutput.fromObject(e.outputs[n])}}return t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.outputs=[]),e.outputs&&e.outputs.length){n.outputs=[];for(var l=0;l<e.outputs.length;++l)n.outputs[l]=d.protocol.TXOutput.toObject(e.outputs[l],t)}return n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.ResourceReceipt=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.energyUsage=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.energyFee=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.originEnergyUsage=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.energyUsageTotal=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.netUsage=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.netFee=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.result=0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.energyUsage!=null&&Object.hasOwnProperty.call(e,"energyUsage")&&t.uint32(8).int64(e.energyUsage),e.energyFee!=null&&Object.hasOwnProperty.call(e,"energyFee")&&t.uint32(16).int64(e.energyFee),e.originEnergyUsage!=null&&Object.hasOwnProperty.call(e,"originEnergyUsage")&&t.uint32(24).int64(e.originEnergyUsage),e.energyUsageTotal!=null&&Object.hasOwnProperty.call(e,"energyUsageTotal")&&t.uint32(32).int64(e.energyUsageTotal),e.netUsage!=null&&Object.hasOwnProperty.call(e,"netUsage")&&t.uint32(40).int64(e.netUsage),e.netFee!=null&&Object.hasOwnProperty.call(e,"netFee")&&t.uint32(48).int64(e.netFee),e.result!=null&&Object.hasOwnProperty.call(e,"result")&&t.uint32(56).int32(e.result),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.ResourceReceipt;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.energyUsage=e.int64();break;case 2:l.energyFee=e.int64();break;case 3:l.originEnergyUsage=e.int64();break;case 4:l.energyUsageTotal=e.int64();break;case 5:l.netUsage=e.int64();break;case 6:l.netFee=e.int64();break;case 7:l.result=e.int32();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.energyUsage!=null&&e.hasOwnProperty("energyUsage")&&!i.isInteger(e.energyUsage)&&!(e.energyUsage&&i.isInteger(e.energyUsage.low)&&i.isInteger(e.energyUsage.high)))return"energyUsage: integer|Long expected";if(e.energyFee!=null&&e.hasOwnProperty("energyFee")&&!i.isInteger(e.energyFee)&&!(e.energyFee&&i.isInteger(e.energyFee.low)&&i.isInteger(e.energyFee.high)))return"energyFee: integer|Long expected";if(e.originEnergyUsage!=null&&e.hasOwnProperty("originEnergyUsage")&&!i.isInteger(e.originEnergyUsage)&&!(e.originEnergyUsage&&i.isInteger(e.originEnergyUsage.low)&&i.isInteger(e.originEnergyUsage.high)))return"originEnergyUsage: integer|Long expected";if(e.energyUsageTotal!=null&&e.hasOwnProperty("energyUsageTotal")&&!i.isInteger(e.energyUsageTotal)&&!(e.energyUsageTotal&&i.isInteger(e.energyUsageTotal.low)&&i.isInteger(e.energyUsageTotal.high)))return"energyUsageTotal: integer|Long expected";if(e.netUsage!=null&&e.hasOwnProperty("netUsage")&&!i.isInteger(e.netUsage)&&!(e.netUsage&&i.isInteger(e.netUsage.low)&&i.isInteger(e.netUsage.high)))return"netUsage: integer|Long expected";if(e.netFee!=null&&e.hasOwnProperty("netFee")&&!i.isInteger(e.netFee)&&!(e.netFee&&i.isInteger(e.netFee.low)&&i.isInteger(e.netFee.high)))return"netFee: integer|Long expected";if(e.result!=null&&e.hasOwnProperty("result"))switch(e.result){default:return"result: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:break}return null},r.fromObject=function(e){if(e instanceof d.protocol.ResourceReceipt)return e;var t=new d.protocol.ResourceReceipt;switch(e.energyUsage!=null&&(i.Long?(t.energyUsage=i.Long.fromValue(e.energyUsage)).unsigned=!1:typeof e.energyUsage=="string"?t.energyUsage=parseInt(e.energyUsage,10):typeof e.energyUsage=="number"?t.energyUsage=e.energyUsage:typeof e.energyUsage=="object"&&(t.energyUsage=new i.LongBits(e.energyUsage.low>>>0,e.energyUsage.high>>>0).toNumber())),e.energyFee!=null&&(i.Long?(t.energyFee=i.Long.fromValue(e.energyFee)).unsigned=!1:typeof e.energyFee=="string"?t.energyFee=parseInt(e.energyFee,10):typeof e.energyFee=="number"?t.energyFee=e.energyFee:typeof e.energyFee=="object"&&(t.energyFee=new i.LongBits(e.energyFee.low>>>0,e.energyFee.high>>>0).toNumber())),e.originEnergyUsage!=null&&(i.Long?(t.originEnergyUsage=i.Long.fromValue(e.originEnergyUsage)).unsigned=!1:typeof e.originEnergyUsage=="string"?t.originEnergyUsage=parseInt(e.originEnergyUsage,10):typeof e.originEnergyUsage=="number"?t.originEnergyUsage=e.originEnergyUsage:typeof e.originEnergyUsage=="object"&&(t.originEnergyUsage=new i.LongBits(e.originEnergyUsage.low>>>0,e.originEnergyUsage.high>>>0).toNumber())),e.energyUsageTotal!=null&&(i.Long?(t.energyUsageTotal=i.Long.fromValue(e.energyUsageTotal)).unsigned=!1:typeof e.energyUsageTotal=="string"?t.energyUsageTotal=parseInt(e.energyUsageTotal,10):typeof e.energyUsageTotal=="number"?t.energyUsageTotal=e.energyUsageTotal:typeof e.energyUsageTotal=="object"&&(t.energyUsageTotal=new i.LongBits(e.energyUsageTotal.low>>>0,e.energyUsageTotal.high>>>0).toNumber())),e.netUsage!=null&&(i.Long?(t.netUsage=i.Long.fromValue(e.netUsage)).unsigned=!1:typeof e.netUsage=="string"?t.netUsage=parseInt(e.netUsage,10):typeof e.netUsage=="number"?t.netUsage=e.netUsage:typeof e.netUsage=="object"&&(t.netUsage=new i.LongBits(e.netUsage.low>>>0,e.netUsage.high>>>0).toNumber())),e.netFee!=null&&(i.Long?(t.netFee=i.Long.fromValue(e.netFee)).unsigned=!1:typeof e.netFee=="string"?t.netFee=parseInt(e.netFee,10):typeof e.netFee=="number"?t.netFee=e.netFee:typeof e.netFee=="object"&&(t.netFee=new i.LongBits(e.netFee.low>>>0,e.netFee.high>>>0).toNumber())),e.result){case"DEFAULT":case 0:t.result=0;break;case"SUCCESS":case 1:t.result=1;break;case"REVERT":case 2:t.result=2;break;case"BAD_JUMP_DESTINATION":case 3:t.result=3;break;case"OUT_OF_MEMORY":case 4:t.result=4;break;case"PRECOMPILED_CONTRACT":case 5:t.result=5;break;case"STACK_TOO_SMALL":case 6:t.result=6;break;case"STACK_TOO_LARGE":case 7:t.result=7;break;case"ILLEGAL_OPERATION":case 8:t.result=8;break;case"STACK_OVERFLOW":case 9:t.result=9;break;case"OUT_OF_ENERGY":case 10:t.result=10;break;case"OUT_OF_TIME":case 11:t.result=11;break;case"JVM_STACK_OVER_FLOW":case 12:t.result=12;break;case"UNKNOWN":case 13:t.result=13;break;case"TRANSFER_FAILED":case 14:t.result=14;break}return t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(i.Long){var l=new i.Long(0,0,!1);n.energyUsage=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.energyUsage=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.energyFee=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.energyFee=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.originEnergyUsage=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.originEnergyUsage=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.energyUsageTotal=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.energyUsageTotal=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.netUsage=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.netUsage=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.netFee=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.netFee=t.longs===String?"0":0;n.result=t.enums===String?"DEFAULT":0}return e.energyUsage!=null&&e.hasOwnProperty("energyUsage")&&(typeof e.energyUsage=="number"?n.energyUsage=t.longs===String?String(e.energyUsage):e.energyUsage:n.energyUsage=t.longs===String?i.Long.prototype.toString.call(e.energyUsage):t.longs===Number?new i.LongBits(e.energyUsage.low>>>0,e.energyUsage.high>>>0).toNumber():e.energyUsage),e.energyFee!=null&&e.hasOwnProperty("energyFee")&&(typeof e.energyFee=="number"?n.energyFee=t.longs===String?String(e.energyFee):e.energyFee:n.energyFee=t.longs===String?i.Long.prototype.toString.call(e.energyFee):t.longs===Number?new i.LongBits(e.energyFee.low>>>0,e.energyFee.high>>>0).toNumber():e.energyFee),e.originEnergyUsage!=null&&e.hasOwnProperty("originEnergyUsage")&&(typeof e.originEnergyUsage=="number"?n.originEnergyUsage=t.longs===String?String(e.originEnergyUsage):e.originEnergyUsage:n.originEnergyUsage=t.longs===String?i.Long.prototype.toString.call(e.originEnergyUsage):t.longs===Number?new i.LongBits(e.originEnergyUsage.low>>>0,e.originEnergyUsage.high>>>0).toNumber():e.originEnergyUsage),e.energyUsageTotal!=null&&e.hasOwnProperty("energyUsageTotal")&&(typeof e.energyUsageTotal=="number"?n.energyUsageTotal=t.longs===String?String(e.energyUsageTotal):e.energyUsageTotal:n.energyUsageTotal=t.longs===String?i.Long.prototype.toString.call(e.energyUsageTotal):t.longs===Number?new i.LongBits(e.energyUsageTotal.low>>>0,e.energyUsageTotal.high>>>0).toNumber():e.energyUsageTotal),e.netUsage!=null&&e.hasOwnProperty("netUsage")&&(typeof e.netUsage=="number"?n.netUsage=t.longs===String?String(e.netUsage):e.netUsage:n.netUsage=t.longs===String?i.Long.prototype.toString.call(e.netUsage):t.longs===Number?new i.LongBits(e.netUsage.low>>>0,e.netUsage.high>>>0).toNumber():e.netUsage),e.netFee!=null&&e.hasOwnProperty("netFee")&&(typeof e.netFee=="number"?n.netFee=t.longs===String?String(e.netFee):e.netFee:n.netFee=t.longs===String?i.Long.prototype.toString.call(e.netFee):t.longs===Number?new i.LongBits(e.netFee.low>>>0,e.netFee.high>>>0).toNumber():e.netFee),e.result!=null&&e.hasOwnProperty("result")&&(n.result=t.enums===String?d.protocol.Transaction.Result.contractResult[e.result]:e.result),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.Transaction=function(){function r(o){if(this.signature=[],this.ret=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.rawData=null,r.prototype.signature=i.emptyArray,r.prototype.ret=i.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.rawData!=null&&Object.hasOwnProperty.call(e,"rawData")&&d.protocol.Transaction.raw.encode(e.rawData,t.uint32(10).fork()).ldelim(),e.signature!=null&&e.signature.length)for(var n=0;n<e.signature.length;++n)t.uint32(18).bytes(e.signature[n]);if(e.ret!=null&&e.ret.length)for(var n=0;n<e.ret.length;++n)d.protocol.Transaction.Result.encode(e.ret[n],t.uint32(42).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.Transaction;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.rawData=d.protocol.Transaction.raw.decode(e,e.uint32());break;case 2:l.signature&&l.signature.length||(l.signature=[]),l.signature.push(e.bytes());break;case 5:l.ret&&l.ret.length||(l.ret=[]),l.ret.push(d.protocol.Transaction.Result.decode(e,e.uint32()));break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.rawData!=null&&e.hasOwnProperty("rawData")){var t=d.protocol.Transaction.raw.verify(e.rawData);if(t)return"rawData."+t}if(e.signature!=null&&e.hasOwnProperty("signature")){if(!Array.isArray(e.signature))return"signature: array expected";for(var n=0;n<e.signature.length;++n)if(!(e.signature[n]&&typeof e.signature[n].length=="number"||i.isString(e.signature[n])))return"signature: buffer[] expected"}if(e.ret!=null&&e.hasOwnProperty("ret")){if(!Array.isArray(e.ret))return"ret: array expected";for(var n=0;n<e.ret.length;++n){var t=d.protocol.Transaction.Result.verify(e.ret[n]);if(t)return"ret."+t}}return null},r.fromObject=function(e){if(e instanceof d.protocol.Transaction)return e;var t=new d.protocol.Transaction;if(e.rawData!=null){if(typeof e.rawData!="object")throw TypeError(".protocol.Transaction.rawData: object expected");t.rawData=d.protocol.Transaction.raw.fromObject(e.rawData)}if(e.signature){if(!Array.isArray(e.signature))throw TypeError(".protocol.Transaction.signature: array expected");t.signature=[];for(var n=0;n<e.signature.length;++n)typeof e.signature[n]=="string"?i.base64.decode(e.signature[n],t.signature[n]=i.newBuffer(i.base64.length(e.signature[n])),0):e.signature[n].length&&(t.signature[n]=e.signature[n])}if(e.ret){if(!Array.isArray(e.ret))throw TypeError(".protocol.Transaction.ret: array expected");t.ret=[];for(var n=0;n<e.ret.length;++n){if(typeof e.ret[n]!="object")throw TypeError(".protocol.Transaction.ret: object expected");t.ret[n]=d.protocol.Transaction.Result.fromObject(e.ret[n])}}return t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.signature=[],n.ret=[]),t.defaults&&(n.rawData=null),e.rawData!=null&&e.hasOwnProperty("rawData")&&(n.rawData=d.protocol.Transaction.raw.toObject(e.rawData,t)),e.signature&&e.signature.length){n.signature=[];for(var l=0;l<e.signature.length;++l)n.signature[l]=t.bytes===String?i.base64.encode(e.signature[l],0,e.signature[l].length):t.bytes===Array?Array.prototype.slice.call(e.signature[l]):e.signature[l]}if(e.ret&&e.ret.length){n.ret=[];for(var l=0;l<e.ret.length;++l)n.ret[l]=d.protocol.Transaction.Result.toObject(e.ret[l],t)}return n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r.Contract=function(){function o(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return o.prototype.type=0,o.prototype.parameter=null,o.prototype.provider=i.newBuffer([]),o.prototype.ContractName=i.newBuffer([]),o.prototype.PermissionId=0,o.create=function(t){return new o(t)},o.encode=function(t,n){return n||(n=H.create()),t.type!=null&&Object.hasOwnProperty.call(t,"type")&&n.uint32(8).int32(t.type),t.parameter!=null&&Object.hasOwnProperty.call(t,"parameter")&&d.google.protobuf.Any.encode(t.parameter,n.uint32(18).fork()).ldelim(),t.provider!=null&&Object.hasOwnProperty.call(t,"provider")&&n.uint32(26).bytes(t.provider),t.ContractName!=null&&Object.hasOwnProperty.call(t,"ContractName")&&n.uint32(34).bytes(t.ContractName),t.PermissionId!=null&&Object.hasOwnProperty.call(t,"PermissionId")&&n.uint32(40).int32(t.PermissionId),n},o.encodeDelimited=function(t,n){return this.encode(t,n).ldelim()},o.decode=function(t,n){t instanceof v||(t=v.create(t));for(var l=n===void 0?t.len:t.pos+n,c=new d.protocol.Transaction.Contract;t.pos<l;){var u=t.uint32();switch(u>>>3){case 1:c.type=t.int32();break;case 2:c.parameter=d.google.protobuf.Any.decode(t,t.uint32());break;case 3:c.provider=t.bytes();break;case 4:c.ContractName=t.bytes();break;case 5:c.PermissionId=t.int32();break;default:t.skipType(u&7);break}}return c},o.decodeDelimited=function(t){return t instanceof v||(t=new v(t)),this.decode(t,t.uint32())},o.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.type!=null&&t.hasOwnProperty("type"))switch(t.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 30:case 31:case 32:case 33:case 41:case 42:case 43:case 44:case 45:case 46:case 48:break}if(t.parameter!=null&&t.hasOwnProperty("parameter")){var n=d.google.protobuf.Any.verify(t.parameter);if(n)return"parameter."+n}return t.provider!=null&&t.hasOwnProperty("provider")&&!(t.provider&&typeof t.provider.length=="number"||i.isString(t.provider))?"provider: buffer expected":t.ContractName!=null&&t.hasOwnProperty("ContractName")&&!(t.ContractName&&typeof t.ContractName.length=="number"||i.isString(t.ContractName))?"ContractName: buffer expected":t.PermissionId!=null&&t.hasOwnProperty("PermissionId")&&!i.isInteger(t.PermissionId)?"PermissionId: integer expected":null},o.fromObject=function(t){if(t instanceof d.protocol.Transaction.Contract)return t;var n=new d.protocol.Transaction.Contract;switch(t.type){case"AccountCreateContract":case 0:n.type=0;break;case"TransferContract":case 1:n.type=1;break;case"TransferAssetContract":case 2:n.type=2;break;case"VoteAssetContract":case 3:n.type=3;break;case"VoteWitnessContract":case 4:n.type=4;break;case"WitnessCreateContract":case 5:n.type=5;break;case"AssetIssueContract":case 6:n.type=6;break;case"WitnessUpdateContract":case 8:n.type=8;break;case"ParticipateAssetIssueContract":case 9:n.type=9;break;case"AccountUpdateContract":case 10:n.type=10;break;case"FreezeBalanceContract":case 11:n.type=11;break;case"UnfreezeBalanceContract":case 12:n.type=12;break;case"WithdrawBalanceContract":case 13:n.type=13;break;case"UnfreezeAssetContract":case 14:n.type=14;break;case"UpdateAssetContract":case 15:n.type=15;break;case"ProposalCreateContract":case 16:n.type=16;break;case"ProposalApproveContract":case 17:n.type=17;break;case"ProposalDeleteContract":case 18:n.type=18;break;case"SetAccountIdContract":case 19:n.type=19;break;case"CustomContract":case 20:n.type=20;break;case"CreateSmartContract":case 30:n.type=30;break;case"TriggerSmartContract":case 31:n.type=31;break;case"GetContract":case 32:n.type=32;break;case"UpdateSettingContract":case 33:n.type=33;break;case"ExchangeCreateContract":case 41:n.type=41;break;case"ExchangeInjectContract":case 42:n.type=42;break;case"ExchangeWithdrawContract":case 43:n.type=43;break;case"ExchangeTransactionContract":case 44:n.type=44;break;case"UpdateEnergyLimitContract":case 45:n.type=45;break;case"AccountPermissionUpdateContract":case 46:n.type=46;break;case"ClearABIContract":case 48:n.type=48;break}if(t.parameter!=null){if(typeof t.parameter!="object")throw TypeError(".protocol.Transaction.Contract.parameter: object expected");n.parameter=d.google.protobuf.Any.fromObject(t.parameter)}return t.provider!=null&&(typeof t.provider=="string"?i.base64.decode(t.provider,n.provider=i.newBuffer(i.base64.length(t.provider)),0):t.provider.length&&(n.provider=t.provider)),t.ContractName!=null&&(typeof t.ContractName=="string"?i.base64.decode(t.ContractName,n.ContractName=i.newBuffer(i.base64.length(t.ContractName)),0):t.ContractName.length&&(n.ContractName=t.ContractName)),t.PermissionId!=null&&(n.PermissionId=t.PermissionId|0),n},o.toObject=function(t,n){n||(n={});var l={};return n.defaults&&(l.type=n.enums===String?"AccountCreateContract":0,l.parameter=null,n.bytes===String?l.provider="":(l.provider=[],n.bytes!==Array&&(l.provider=i.newBuffer(l.provider))),n.bytes===String?l.ContractName="":(l.ContractName=[],n.bytes!==Array&&(l.ContractName=i.newBuffer(l.ContractName))),l.PermissionId=0),t.type!=null&&t.hasOwnProperty("type")&&(l.type=n.enums===String?d.protocol.Transaction.Contract.ContractType[t.type]:t.type),t.parameter!=null&&t.hasOwnProperty("parameter")&&(l.parameter=d.google.protobuf.Any.toObject(t.parameter,n)),t.provider!=null&&t.hasOwnProperty("provider")&&(l.provider=n.bytes===String?i.base64.encode(t.provider,0,t.provider.length):n.bytes===Array?Array.prototype.slice.call(t.provider):t.provider),t.ContractName!=null&&t.hasOwnProperty("ContractName")&&(l.ContractName=n.bytes===String?i.base64.encode(t.ContractName,0,t.ContractName.length):n.bytes===Array?Array.prototype.slice.call(t.ContractName):t.ContractName),t.PermissionId!=null&&t.hasOwnProperty("PermissionId")&&(l.PermissionId=t.PermissionId),l},o.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},o.ContractType=function(){var e={},t=Object.create(e);return t[e[0]="AccountCreateContract"]=0,t[e[1]="TransferContract"]=1,t[e[2]="TransferAssetContract"]=2,t[e[3]="VoteAssetContract"]=3,t[e[4]="VoteWitnessContract"]=4,t[e[5]="WitnessCreateContract"]=5,t[e[6]="AssetIssueContract"]=6,t[e[8]="WitnessUpdateContract"]=8,t[e[9]="ParticipateAssetIssueContract"]=9,t[e[10]="AccountUpdateContract"]=10,t[e[11]="FreezeBalanceContract"]=11,t[e[12]="UnfreezeBalanceContract"]=12,t[e[13]="WithdrawBalanceContract"]=13,t[e[14]="UnfreezeAssetContract"]=14,t[e[15]="UpdateAssetContract"]=15,t[e[16]="ProposalCreateContract"]=16,t[e[17]="ProposalApproveContract"]=17,t[e[18]="ProposalDeleteContract"]=18,t[e[19]="SetAccountIdContract"]=19,t[e[20]="CustomContract"]=20,t[e[30]="CreateSmartContract"]=30,t[e[31]="TriggerSmartContract"]=31,t[e[32]="GetContract"]=32,t[e[33]="UpdateSettingContract"]=33,t[e[41]="ExchangeCreateContract"]=41,t[e[42]="ExchangeInjectContract"]=42,t[e[43]="ExchangeWithdrawContract"]=43,t[e[44]="ExchangeTransactionContract"]=44,t[e[45]="UpdateEnergyLimitContract"]=45,t[e[46]="AccountPermissionUpdateContract"]=46,t[e[48]="ClearABIContract"]=48,t}(),o}(),r.Result=function(){function o(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return o.prototype.fee=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.ret=0,o.prototype.contractRet=0,o.prototype.assetIssueID="",o.prototype.withdrawAmount=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.unfreezeAmount=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.exchangeReceivedAmount=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.exchangeInjectAnotherAmount=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.exchangeWithdrawAnotherAmount=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.exchangeId=i.Long?i.Long.fromBits(0,0,!1):0,o.create=function(t){return new o(t)},o.encode=function(t,n){return n||(n=H.create()),t.fee!=null&&Object.hasOwnProperty.call(t,"fee")&&n.uint32(8).int64(t.fee),t.ret!=null&&Object.hasOwnProperty.call(t,"ret")&&n.uint32(16).int32(t.ret),t.contractRet!=null&&Object.hasOwnProperty.call(t,"contractRet")&&n.uint32(24).int32(t.contractRet),t.assetIssueID!=null&&Object.hasOwnProperty.call(t,"assetIssueID")&&n.uint32(114).string(t.assetIssueID),t.withdrawAmount!=null&&Object.hasOwnProperty.call(t,"withdrawAmount")&&n.uint32(120).int64(t.withdrawAmount),t.unfreezeAmount!=null&&Object.hasOwnProperty.call(t,"unfreezeAmount")&&n.uint32(128).int64(t.unfreezeAmount),t.exchangeReceivedAmount!=null&&Object.hasOwnProperty.call(t,"exchangeReceivedAmount")&&n.uint32(144).int64(t.exchangeReceivedAmount),t.exchangeInjectAnotherAmount!=null&&Object.hasOwnProperty.call(t,"exchangeInjectAnotherAmount")&&n.uint32(152).int64(t.exchangeInjectAnotherAmount),t.exchangeWithdrawAnotherAmount!=null&&Object.hasOwnProperty.call(t,"exchangeWithdrawAnotherAmount")&&n.uint32(160).int64(t.exchangeWithdrawAnotherAmount),t.exchangeId!=null&&Object.hasOwnProperty.call(t,"exchangeId")&&n.uint32(168).int64(t.exchangeId),n},o.encodeDelimited=function(t,n){return this.encode(t,n).ldelim()},o.decode=function(t,n){t instanceof v||(t=v.create(t));for(var l=n===void 0?t.len:t.pos+n,c=new d.protocol.Transaction.Result;t.pos<l;){var u=t.uint32();switch(u>>>3){case 1:c.fee=t.int64();break;case 2:c.ret=t.int32();break;case 3:c.contractRet=t.int32();break;case 14:c.assetIssueID=t.string();break;case 15:c.withdrawAmount=t.int64();break;case 16:c.unfreezeAmount=t.int64();break;case 18:c.exchangeReceivedAmount=t.int64();break;case 19:c.exchangeInjectAnotherAmount=t.int64();break;case 20:c.exchangeWithdrawAnotherAmount=t.int64();break;case 21:c.exchangeId=t.int64();break;default:t.skipType(u&7);break}}return c},o.decodeDelimited=function(t){return t instanceof v||(t=new v(t)),this.decode(t,t.uint32())},o.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fee!=null&&t.hasOwnProperty("fee")&&!i.isInteger(t.fee)&&!(t.fee&&i.isInteger(t.fee.low)&&i.isInteger(t.fee.high)))return"fee: integer|Long expected";if(t.ret!=null&&t.hasOwnProperty("ret"))switch(t.ret){default:return"ret: enum value expected";case 0:case 1:break}if(t.contractRet!=null&&t.hasOwnProperty("contractRet"))switch(t.contractRet){default:return"contractRet: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:break}return t.assetIssueID!=null&&t.hasOwnProperty("assetIssueID")&&!i.isString(t.assetIssueID)?"assetIssueID: string expected":t.withdrawAmount!=null&&t.hasOwnProperty("withdrawAmount")&&!i.isInteger(t.withdrawAmount)&&!(t.withdrawAmount&&i.isInteger(t.withdrawAmount.low)&&i.isInteger(t.withdrawAmount.high))?"withdrawAmount: integer|Long expected":t.unfreezeAmount!=null&&t.hasOwnProperty("unfreezeAmount")&&!i.isInteger(t.unfreezeAmount)&&!(t.unfreezeAmount&&i.isInteger(t.unfreezeAmount.low)&&i.isInteger(t.unfreezeAmount.high))?"unfreezeAmount: integer|Long expected":t.exchangeReceivedAmount!=null&&t.hasOwnProperty("exchangeReceivedAmount")&&!i.isInteger(t.exchangeReceivedAmount)&&!(t.exchangeReceivedAmount&&i.isInteger(t.exchangeReceivedAmount.low)&&i.isInteger(t.exchangeReceivedAmount.high))?"exchangeReceivedAmount: integer|Long expected":t.exchangeInjectAnotherAmount!=null&&t.hasOwnProperty("exchangeInjectAnotherAmount")&&!i.isInteger(t.exchangeInjectAnotherAmount)&&!(t.exchangeInjectAnotherAmount&&i.isInteger(t.exchangeInjectAnotherAmount.low)&&i.isInteger(t.exchangeInjectAnotherAmount.high))?"exchangeInjectAnotherAmount: integer|Long expected":t.exchangeWithdrawAnotherAmount!=null&&t.hasOwnProperty("exchangeWithdrawAnotherAmount")&&!i.isInteger(t.exchangeWithdrawAnotherAmount)&&!(t.exchangeWithdrawAnotherAmount&&i.isInteger(t.exchangeWithdrawAnotherAmount.low)&&i.isInteger(t.exchangeWithdrawAnotherAmount.high))?"exchangeWithdrawAnotherAmount: integer|Long expected":t.exchangeId!=null&&t.hasOwnProperty("exchangeId")&&!i.isInteger(t.exchangeId)&&!(t.exchangeId&&i.isInteger(t.exchangeId.low)&&i.isInteger(t.exchangeId.high))?"exchangeId: integer|Long expected":null},o.fromObject=function(t){if(t instanceof d.protocol.Transaction.Result)return t;var n=new d.protocol.Transaction.Result;switch(t.fee!=null&&(i.Long?(n.fee=i.Long.fromValue(t.fee)).unsigned=!1:typeof t.fee=="string"?n.fee=parseInt(t.fee,10):typeof t.fee=="number"?n.fee=t.fee:typeof t.fee=="object"&&(n.fee=new i.LongBits(t.fee.low>>>0,t.fee.high>>>0).toNumber())),t.ret){case"SUCESS":case 0:n.ret=0;break;case"FAILED":case 1:n.ret=1;break}switch(t.contractRet){case"DEFAULT":case 0:n.contractRet=0;break;case"SUCCESS":case 1:n.contractRet=1;break;case"REVERT":case 2:n.contractRet=2;break;case"BAD_JUMP_DESTINATION":case 3:n.contractRet=3;break;case"OUT_OF_MEMORY":case 4:n.contractRet=4;break;case"PRECOMPILED_CONTRACT":case 5:n.contractRet=5;break;case"STACK_TOO_SMALL":case 6:n.contractRet=6;break;case"STACK_TOO_LARGE":case 7:n.contractRet=7;break;case"ILLEGAL_OPERATION":case 8:n.contractRet=8;break;case"STACK_OVERFLOW":case 9:n.contractRet=9;break;case"OUT_OF_ENERGY":case 10:n.contractRet=10;break;case"OUT_OF_TIME":case 11:n.contractRet=11;break;case"JVM_STACK_OVER_FLOW":case 12:n.contractRet=12;break;case"UNKNOWN":case 13:n.contractRet=13;break;case"TRANSFER_FAILED":case 14:n.contractRet=14;break}return t.assetIssueID!=null&&(n.assetIssueID=String(t.assetIssueID)),t.withdrawAmount!=null&&(i.Long?(n.withdrawAmount=i.Long.fromValue(t.withdrawAmount)).unsigned=!1:typeof t.withdrawAmount=="string"?n.withdrawAmount=parseInt(t.withdrawAmount,10):typeof t.withdrawAmount=="number"?n.withdrawAmount=t.withdrawAmount:typeof t.withdrawAmount=="object"&&(n.withdrawAmount=new i.LongBits(t.withdrawAmount.low>>>0,t.withdrawAmount.high>>>0).toNumber())),t.unfreezeAmount!=null&&(i.Long?(n.unfreezeAmount=i.Long.fromValue(t.unfreezeAmount)).unsigned=!1:typeof t.unfreezeAmount=="string"?n.unfreezeAmount=parseInt(t.unfreezeAmount,10):typeof t.unfreezeAmount=="number"?n.unfreezeAmount=t.unfreezeAmount:typeof t.unfreezeAmount=="object"&&(n.unfreezeAmount=new i.LongBits(t.unfreezeAmount.low>>>0,t.unfreezeAmount.high>>>0).toNumber())),t.exchangeReceivedAmount!=null&&(i.Long?(n.exchangeReceivedAmount=i.Long.fromValue(t.exchangeReceivedAmount)).unsigned=!1:typeof t.exchangeReceivedAmount=="string"?n.exchangeReceivedAmount=parseInt(t.exchangeReceivedAmount,10):typeof t.exchangeReceivedAmount=="number"?n.exchangeReceivedAmount=t.exchangeReceivedAmount:typeof t.exchangeReceivedAmount=="object"&&(n.exchangeReceivedAmount=new i.LongBits(t.exchangeReceivedAmount.low>>>0,t.exchangeReceivedAmount.high>>>0).toNumber())),t.exchangeInjectAnotherAmount!=null&&(i.Long?(n.exchangeInjectAnotherAmount=i.Long.fromValue(t.exchangeInjectAnotherAmount)).unsigned=!1:typeof t.exchangeInjectAnotherAmount=="string"?n.exchangeInjectAnotherAmount=parseInt(t.exchangeInjectAnotherAmount,10):typeof t.exchangeInjectAnotherAmount=="number"?n.exchangeInjectAnotherAmount=t.exchangeInjectAnotherAmount:typeof t.exchangeInjectAnotherAmount=="object"&&(n.exchangeInjectAnotherAmount=new i.LongBits(t.exchangeInjectAnotherAmount.low>>>0,t.exchangeInjectAnotherAmount.high>>>0).toNumber())),t.exchangeWithdrawAnotherAmount!=null&&(i.Long?(n.exchangeWithdrawAnotherAmount=i.Long.fromValue(t.exchangeWithdrawAnotherAmount)).unsigned=!1:typeof t.exchangeWithdrawAnotherAmount=="string"?n.exchangeWithdrawAnotherAmount=parseInt(t.exchangeWithdrawAnotherAmount,10):typeof t.exchangeWithdrawAnotherAmount=="number"?n.exchangeWithdrawAnotherAmount=t.exchangeWithdrawAnotherAmount:typeof t.exchangeWithdrawAnotherAmount=="object"&&(n.exchangeWithdrawAnotherAmount=new i.LongBits(t.exchangeWithdrawAnotherAmount.low>>>0,t.exchangeWithdrawAnotherAmount.high>>>0).toNumber())),t.exchangeId!=null&&(i.Long?(n.exchangeId=i.Long.fromValue(t.exchangeId)).unsigned=!1:typeof t.exchangeId=="string"?n.exchangeId=parseInt(t.exchangeId,10):typeof t.exchangeId=="number"?n.exchangeId=t.exchangeId:typeof t.exchangeId=="object"&&(n.exchangeId=new i.LongBits(t.exchangeId.low>>>0,t.exchangeId.high>>>0).toNumber())),n},o.toObject=function(t,n){n||(n={});var l={};if(n.defaults){if(i.Long){var c=new i.Long(0,0,!1);l.fee=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.fee=n.longs===String?"0":0;if(l.ret=n.enums===String?"SUCESS":0,l.contractRet=n.enums===String?"DEFAULT":0,l.assetIssueID="",i.Long){var c=new i.Long(0,0,!1);l.withdrawAmount=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.withdrawAmount=n.longs===String?"0":0;if(i.Long){var c=new i.Long(0,0,!1);l.unfreezeAmount=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.unfreezeAmount=n.longs===String?"0":0;if(i.Long){var c=new i.Long(0,0,!1);l.exchangeReceivedAmount=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.exchangeReceivedAmount=n.longs===String?"0":0;if(i.Long){var c=new i.Long(0,0,!1);l.exchangeInjectAnotherAmount=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.exchangeInjectAnotherAmount=n.longs===String?"0":0;if(i.Long){var c=new i.Long(0,0,!1);l.exchangeWithdrawAnotherAmount=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.exchangeWithdrawAnotherAmount=n.longs===String?"0":0;if(i.Long){var c=new i.Long(0,0,!1);l.exchangeId=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.exchangeId=n.longs===String?"0":0}return t.fee!=null&&t.hasOwnProperty("fee")&&(typeof t.fee=="number"?l.fee=n.longs===String?String(t.fee):t.fee:l.fee=n.longs===String?i.Long.prototype.toString.call(t.fee):n.longs===Number?new i.LongBits(t.fee.low>>>0,t.fee.high>>>0).toNumber():t.fee),t.ret!=null&&t.hasOwnProperty("ret")&&(l.ret=n.enums===String?d.protocol.Transaction.Result.code[t.ret]:t.ret),t.contractRet!=null&&t.hasOwnProperty("contractRet")&&(l.contractRet=n.enums===String?d.protocol.Transaction.Result.contractResult[t.contractRet]:t.contractRet),t.assetIssueID!=null&&t.hasOwnProperty("assetIssueID")&&(l.assetIssueID=t.assetIssueID),t.withdrawAmount!=null&&t.hasOwnProperty("withdrawAmount")&&(typeof t.withdrawAmount=="number"?l.withdrawAmount=n.longs===String?String(t.withdrawAmount):t.withdrawAmount:l.withdrawAmount=n.longs===String?i.Long.prototype.toString.call(t.withdrawAmount):n.longs===Number?new i.LongBits(t.withdrawAmount.low>>>0,t.withdrawAmount.high>>>0).toNumber():t.withdrawAmount),t.unfreezeAmount!=null&&t.hasOwnProperty("unfreezeAmount")&&(typeof t.unfreezeAmount=="number"?l.unfreezeAmount=n.longs===String?String(t.unfreezeAmount):t.unfreezeAmount:l.unfreezeAmount=n.longs===String?i.Long.prototype.toString.call(t.unfreezeAmount):n.longs===Number?new i.LongBits(t.unfreezeAmount.low>>>0,t.unfreezeAmount.high>>>0).toNumber():t.unfreezeAmount),t.exchangeReceivedAmount!=null&&t.hasOwnProperty("exchangeReceivedAmount")&&(typeof t.exchangeReceivedAmount=="number"?l.exchangeReceivedAmount=n.longs===String?String(t.exchangeReceivedAmount):t.exchangeReceivedAmount:l.exchangeReceivedAmount=n.longs===String?i.Long.prototype.toString.call(t.exchangeReceivedAmount):n.longs===Number?new i.LongBits(t.exchangeReceivedAmount.low>>>0,t.exchangeReceivedAmount.high>>>0).toNumber():t.exchangeReceivedAmount),t.exchangeInjectAnotherAmount!=null&&t.hasOwnProperty("exchangeInjectAnotherAmount")&&(typeof t.exchangeInjectAnotherAmount=="number"?l.exchangeInjectAnotherAmount=n.longs===String?String(t.exchangeInjectAnotherAmount):t.exchangeInjectAnotherAmount:l.exchangeInjectAnotherAmount=n.longs===String?i.Long.prototype.toString.call(t.exchangeInjectAnotherAmount):n.longs===Number?new i.LongBits(t.exchangeInjectAnotherAmount.low>>>0,t.exchangeInjectAnotherAmount.high>>>0).toNumber():t.exchangeInjectAnotherAmount),t.exchangeWithdrawAnotherAmount!=null&&t.hasOwnProperty("exchangeWithdrawAnotherAmount")&&(typeof t.exchangeWithdrawAnotherAmount=="number"?l.exchangeWithdrawAnotherAmount=n.longs===String?String(t.exchangeWithdrawAnotherAmount):t.exchangeWithdrawAnotherAmount:l.exchangeWithdrawAnotherAmount=n.longs===String?i.Long.prototype.toString.call(t.exchangeWithdrawAnotherAmount):n.longs===Number?new i.LongBits(t.exchangeWithdrawAnotherAmount.low>>>0,t.exchangeWithdrawAnotherAmount.high>>>0).toNumber():t.exchangeWithdrawAnotherAmount),t.exchangeId!=null&&t.hasOwnProperty("exchangeId")&&(typeof t.exchangeId=="number"?l.exchangeId=n.longs===String?String(t.exchangeId):t.exchangeId:l.exchangeId=n.longs===String?i.Long.prototype.toString.call(t.exchangeId):n.longs===Number?new i.LongBits(t.exchangeId.low>>>0,t.exchangeId.high>>>0).toNumber():t.exchangeId),l},o.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},o.code=function(){var e={},t=Object.create(e);return t[e[0]="SUCESS"]=0,t[e[1]="FAILED"]=1,t}(),o.contractResult=function(){var e={},t=Object.create(e);return t[e[0]="DEFAULT"]=0,t[e[1]="SUCCESS"]=1,t[e[2]="REVERT"]=2,t[e[3]="BAD_JUMP_DESTINATION"]=3,t[e[4]="OUT_OF_MEMORY"]=4,t[e[5]="PRECOMPILED_CONTRACT"]=5,t[e[6]="STACK_TOO_SMALL"]=6,t[e[7]="STACK_TOO_LARGE"]=7,t[e[8]="ILLEGAL_OPERATION"]=8,t[e[9]="STACK_OVERFLOW"]=9,t[e[10]="OUT_OF_ENERGY"]=10,t[e[11]="OUT_OF_TIME"]=11,t[e[12]="JVM_STACK_OVER_FLOW"]=12,t[e[13]="UNKNOWN"]=13,t[e[14]="TRANSFER_FAILED"]=14,t}(),o}(),r.raw=function(){function o(e){if(this.auths=[],this.contract=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return o.prototype.refBlockBytes=i.newBuffer([]),o.prototype.refBlockNum=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.refBlockHash=i.newBuffer([]),o.prototype.expiration=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.auths=i.emptyArray,o.prototype.data=i.newBuffer([]),o.prototype.contract=i.emptyArray,o.prototype.scripts=i.newBuffer([]),o.prototype.timestamp=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.feeLimit=i.Long?i.Long.fromBits(0,0,!1):0,o.create=function(t){return new o(t)},o.encode=function(t,n){if(n||(n=H.create()),t.refBlockBytes!=null&&Object.hasOwnProperty.call(t,"refBlockBytes")&&n.uint32(10).bytes(t.refBlockBytes),t.refBlockNum!=null&&Object.hasOwnProperty.call(t,"refBlockNum")&&n.uint32(24).int64(t.refBlockNum),t.refBlockHash!=null&&Object.hasOwnProperty.call(t,"refBlockHash")&&n.uint32(34).bytes(t.refBlockHash),t.expiration!=null&&Object.hasOwnProperty.call(t,"expiration")&&n.uint32(64).int64(t.expiration),t.auths!=null&&t.auths.length)for(var l=0;l<t.auths.length;++l)d.protocol.authority.encode(t.auths[l],n.uint32(74).fork()).ldelim();if(t.data!=null&&Object.hasOwnProperty.call(t,"data")&&n.uint32(82).bytes(t.data),t.contract!=null&&t.contract.length)for(var l=0;l<t.contract.length;++l)d.protocol.Transaction.Contract.encode(t.contract[l],n.uint32(90).fork()).ldelim();return t.scripts!=null&&Object.hasOwnProperty.call(t,"scripts")&&n.uint32(98).bytes(t.scripts),t.timestamp!=null&&Object.hasOwnProperty.call(t,"timestamp")&&n.uint32(112).int64(t.timestamp),t.feeLimit!=null&&Object.hasOwnProperty.call(t,"feeLimit")&&n.uint32(144).int64(t.feeLimit),n},o.encodeDelimited=function(t,n){return this.encode(t,n).ldelim()},o.decode=function(t,n){t instanceof v||(t=v.create(t));for(var l=n===void 0?t.len:t.pos+n,c=new d.protocol.Transaction.raw;t.pos<l;){var u=t.uint32();switch(u>>>3){case 1:c.refBlockBytes=t.bytes();break;case 3:c.refBlockNum=t.int64();break;case 4:c.refBlockHash=t.bytes();break;case 8:c.expiration=t.int64();break;case 9:c.auths&&c.auths.length||(c.auths=[]),c.auths.push(d.protocol.authority.decode(t,t.uint32()));break;case 10:c.data=t.bytes();break;case 11:c.contract&&c.contract.length||(c.contract=[]),c.contract.push(d.protocol.Transaction.Contract.decode(t,t.uint32()));break;case 12:c.scripts=t.bytes();break;case 14:c.timestamp=t.int64();break;case 18:c.feeLimit=t.int64();break;default:t.skipType(u&7);break}}return c},o.decodeDelimited=function(t){return t instanceof v||(t=new v(t)),this.decode(t,t.uint32())},o.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.refBlockBytes!=null&&t.hasOwnProperty("refBlockBytes")&&!(t.refBlockBytes&&typeof t.refBlockBytes.length=="number"||i.isString(t.refBlockBytes)))return"refBlockBytes: buffer expected";if(t.refBlockNum!=null&&t.hasOwnProperty("refBlockNum")&&!i.isInteger(t.refBlockNum)&&!(t.refBlockNum&&i.isInteger(t.refBlockNum.low)&&i.isInteger(t.refBlockNum.high)))return"refBlockNum: integer|Long expected";if(t.refBlockHash!=null&&t.hasOwnProperty("refBlockHash")&&!(t.refBlockHash&&typeof t.refBlockHash.length=="number"||i.isString(t.refBlockHash)))return"refBlockHash: buffer expected";if(t.expiration!=null&&t.hasOwnProperty("expiration")&&!i.isInteger(t.expiration)&&!(t.expiration&&i.isInteger(t.expiration.low)&&i.isInteger(t.expiration.high)))return"expiration: integer|Long expected";if(t.auths!=null&&t.hasOwnProperty("auths")){if(!Array.isArray(t.auths))return"auths: array expected";for(var n=0;n<t.auths.length;++n){var l=d.protocol.authority.verify(t.auths[n]);if(l)return"auths."+l}}if(t.data!=null&&t.hasOwnProperty("data")&&!(t.data&&typeof t.data.length=="number"||i.isString(t.data)))return"data: buffer expected";if(t.contract!=null&&t.hasOwnProperty("contract")){if(!Array.isArray(t.contract))return"contract: array expected";for(var n=0;n<t.contract.length;++n){var l=d.protocol.Transaction.Contract.verify(t.contract[n]);if(l)return"contract."+l}}return t.scripts!=null&&t.hasOwnProperty("scripts")&&!(t.scripts&&typeof t.scripts.length=="number"||i.isString(t.scripts))?"scripts: buffer expected":t.timestamp!=null&&t.hasOwnProperty("timestamp")&&!i.isInteger(t.timestamp)&&!(t.timestamp&&i.isInteger(t.timestamp.low)&&i.isInteger(t.timestamp.high))?"timestamp: integer|Long expected":t.feeLimit!=null&&t.hasOwnProperty("feeLimit")&&!i.isInteger(t.feeLimit)&&!(t.feeLimit&&i.isInteger(t.feeLimit.low)&&i.isInteger(t.feeLimit.high))?"feeLimit: integer|Long expected":null},o.fromObject=function(t){if(t instanceof d.protocol.Transaction.raw)return t;var n=new d.protocol.Transaction.raw;if(t.refBlockBytes!=null&&(typeof t.refBlockBytes=="string"?i.base64.decode(t.refBlockBytes,n.refBlockBytes=i.newBuffer(i.base64.length(t.refBlockBytes)),0):t.refBlockBytes.length&&(n.refBlockBytes=t.refBlockBytes)),t.refBlockNum!=null&&(i.Long?(n.refBlockNum=i.Long.fromValue(t.refBlockNum)).unsigned=!1:typeof t.refBlockNum=="string"?n.refBlockNum=parseInt(t.refBlockNum,10):typeof t.refBlockNum=="number"?n.refBlockNum=t.refBlockNum:typeof t.refBlockNum=="object"&&(n.refBlockNum=new i.LongBits(t.refBlockNum.low>>>0,t.refBlockNum.high>>>0).toNumber())),t.refBlockHash!=null&&(typeof t.refBlockHash=="string"?i.base64.decode(t.refBlockHash,n.refBlockHash=i.newBuffer(i.base64.length(t.refBlockHash)),0):t.refBlockHash.length&&(n.refBlockHash=t.refBlockHash)),t.expiration!=null&&(i.Long?(n.expiration=i.Long.fromValue(t.expiration)).unsigned=!1:typeof t.expiration=="string"?n.expiration=parseInt(t.expiration,10):typeof t.expiration=="number"?n.expiration=t.expiration:typeof t.expiration=="object"&&(n.expiration=new i.LongBits(t.expiration.low>>>0,t.expiration.high>>>0).toNumber())),t.auths){if(!Array.isArray(t.auths))throw TypeError(".protocol.Transaction.raw.auths: array expected");n.auths=[];for(var l=0;l<t.auths.length;++l){if(typeof t.auths[l]!="object")throw TypeError(".protocol.Transaction.raw.auths: object expected");n.auths[l]=d.protocol.authority.fromObject(t.auths[l])}}if(t.data!=null&&(typeof t.data=="string"?i.base64.decode(t.data,n.data=i.newBuffer(i.base64.length(t.data)),0):t.data.length&&(n.data=t.data)),t.contract){if(!Array.isArray(t.contract))throw TypeError(".protocol.Transaction.raw.contract: array expected");n.contract=[];for(var l=0;l<t.contract.length;++l){if(typeof t.contract[l]!="object")throw TypeError(".protocol.Transaction.raw.contract: object expected");n.contract[l]=d.protocol.Transaction.Contract.fromObject(t.contract[l])}}return t.scripts!=null&&(typeof t.scripts=="string"?i.base64.decode(t.scripts,n.scripts=i.newBuffer(i.base64.length(t.scripts)),0):t.scripts.length&&(n.scripts=t.scripts)),t.timestamp!=null&&(i.Long?(n.timestamp=i.Long.fromValue(t.timestamp)).unsigned=!1:typeof t.timestamp=="string"?n.timestamp=parseInt(t.timestamp,10):typeof t.timestamp=="number"?n.timestamp=t.timestamp:typeof t.timestamp=="object"&&(n.timestamp=new i.LongBits(t.timestamp.low>>>0,t.timestamp.high>>>0).toNumber())),t.feeLimit!=null&&(i.Long?(n.feeLimit=i.Long.fromValue(t.feeLimit)).unsigned=!1:typeof t.feeLimit=="string"?n.feeLimit=parseInt(t.feeLimit,10):typeof t.feeLimit=="number"?n.feeLimit=t.feeLimit:typeof t.feeLimit=="object"&&(n.feeLimit=new i.LongBits(t.feeLimit.low>>>0,t.feeLimit.high>>>0).toNumber())),n},o.toObject=function(t,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.auths=[],l.contract=[]),n.defaults){if(n.bytes===String?l.refBlockBytes="":(l.refBlockBytes=[],n.bytes!==Array&&(l.refBlockBytes=i.newBuffer(l.refBlockBytes))),i.Long){var c=new i.Long(0,0,!1);l.refBlockNum=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.refBlockNum=n.longs===String?"0":0;if(n.bytes===String?l.refBlockHash="":(l.refBlockHash=[],n.bytes!==Array&&(l.refBlockHash=i.newBuffer(l.refBlockHash))),i.Long){var c=new i.Long(0,0,!1);l.expiration=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.expiration=n.longs===String?"0":0;if(n.bytes===String?l.data="":(l.data=[],n.bytes!==Array&&(l.data=i.newBuffer(l.data))),n.bytes===String?l.scripts="":(l.scripts=[],n.bytes!==Array&&(l.scripts=i.newBuffer(l.scripts))),i.Long){var c=new i.Long(0,0,!1);l.timestamp=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.timestamp=n.longs===String?"0":0;if(i.Long){var c=new i.Long(0,0,!1);l.feeLimit=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.feeLimit=n.longs===String?"0":0}if(t.refBlockBytes!=null&&t.hasOwnProperty("refBlockBytes")&&(l.refBlockBytes=n.bytes===String?i.base64.encode(t.refBlockBytes,0,t.refBlockBytes.length):n.bytes===Array?Array.prototype.slice.call(t.refBlockBytes):t.refBlockBytes),t.refBlockNum!=null&&t.hasOwnProperty("refBlockNum")&&(typeof t.refBlockNum=="number"?l.refBlockNum=n.longs===String?String(t.refBlockNum):t.refBlockNum:l.refBlockNum=n.longs===String?i.Long.prototype.toString.call(t.refBlockNum):n.longs===Number?new i.LongBits(t.refBlockNum.low>>>0,t.refBlockNum.high>>>0).toNumber():t.refBlockNum),t.refBlockHash!=null&&t.hasOwnProperty("refBlockHash")&&(l.refBlockHash=n.bytes===String?i.base64.encode(t.refBlockHash,0,t.refBlockHash.length):n.bytes===Array?Array.prototype.slice.call(t.refBlockHash):t.refBlockHash),t.expiration!=null&&t.hasOwnProperty("expiration")&&(typeof t.expiration=="number"?l.expiration=n.longs===String?String(t.expiration):t.expiration:l.expiration=n.longs===String?i.Long.prototype.toString.call(t.expiration):n.longs===Number?new i.LongBits(t.expiration.low>>>0,t.expiration.high>>>0).toNumber():t.expiration),t.auths&&t.auths.length){l.auths=[];for(var u=0;u<t.auths.length;++u)l.auths[u]=d.protocol.authority.toObject(t.auths[u],n)}if(t.data!=null&&t.hasOwnProperty("data")&&(l.data=n.bytes===String?i.base64.encode(t.data,0,t.data.length):n.bytes===Array?Array.prototype.slice.call(t.data):t.data),t.contract&&t.contract.length){l.contract=[];for(var u=0;u<t.contract.length;++u)l.contract[u]=d.protocol.Transaction.Contract.toObject(t.contract[u],n)}return t.scripts!=null&&t.hasOwnProperty("scripts")&&(l.scripts=n.bytes===String?i.base64.encode(t.scripts,0,t.scripts.length):n.bytes===Array?Array.prototype.slice.call(t.scripts):t.scripts),t.timestamp!=null&&t.hasOwnProperty("timestamp")&&(typeof t.timestamp=="number"?l.timestamp=n.longs===String?String(t.timestamp):t.timestamp:l.timestamp=n.longs===String?i.Long.prototype.toString.call(t.timestamp):n.longs===Number?new i.LongBits(t.timestamp.low>>>0,t.timestamp.high>>>0).toNumber():t.timestamp),t.feeLimit!=null&&t.hasOwnProperty("feeLimit")&&(typeof t.feeLimit=="number"?l.feeLimit=n.longs===String?String(t.feeLimit):t.feeLimit:l.feeLimit=n.longs===String?i.Long.prototype.toString.call(t.feeLimit):n.longs===Number?new i.LongBits(t.feeLimit.low>>>0,t.feeLimit.high>>>0).toNumber():t.feeLimit),l},o.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},o}(),r}(),f.TransactionInfo=function(){function r(o){if(this.contractResult=[],this.log=[],this.internalTransactions=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.id=i.newBuffer([]),r.prototype.fee=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.blockNumber=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.blockTimeStamp=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.contractResult=i.emptyArray,r.prototype.contractAddress=i.newBuffer([]),r.prototype.receipt=null,r.prototype.log=i.emptyArray,r.prototype.result=0,r.prototype.resMessage=i.newBuffer([]),r.prototype.assetIssueID="",r.prototype.withdrawAmount=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.unfreezeAmount=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.internalTransactions=i.emptyArray,r.prototype.exchangeReceivedAmount=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.exchangeInjectAnotherAmount=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.exchangeWithdrawAnotherAmount=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.exchangeId=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.id!=null&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).bytes(e.id),e.fee!=null&&Object.hasOwnProperty.call(e,"fee")&&t.uint32(16).int64(e.fee),e.blockNumber!=null&&Object.hasOwnProperty.call(e,"blockNumber")&&t.uint32(24).int64(e.blockNumber),e.blockTimeStamp!=null&&Object.hasOwnProperty.call(e,"blockTimeStamp")&&t.uint32(32).int64(e.blockTimeStamp),e.contractResult!=null&&e.contractResult.length)for(var n=0;n<e.contractResult.length;++n)t.uint32(42).bytes(e.contractResult[n]);if(e.contractAddress!=null&&Object.hasOwnProperty.call(e,"contractAddress")&&t.uint32(50).bytes(e.contractAddress),e.receipt!=null&&Object.hasOwnProperty.call(e,"receipt")&&d.protocol.ResourceReceipt.encode(e.receipt,t.uint32(58).fork()).ldelim(),e.log!=null&&e.log.length)for(var n=0;n<e.log.length;++n)d.protocol.TransactionInfo.Log.encode(e.log[n],t.uint32(66).fork()).ldelim();if(e.result!=null&&Object.hasOwnProperty.call(e,"result")&&t.uint32(72).int32(e.result),e.resMessage!=null&&Object.hasOwnProperty.call(e,"resMessage")&&t.uint32(82).bytes(e.resMessage),e.assetIssueID!=null&&Object.hasOwnProperty.call(e,"assetIssueID")&&t.uint32(114).string(e.assetIssueID),e.withdrawAmount!=null&&Object.hasOwnProperty.call(e,"withdrawAmount")&&t.uint32(120).int64(e.withdrawAmount),e.unfreezeAmount!=null&&Object.hasOwnProperty.call(e,"unfreezeAmount")&&t.uint32(128).int64(e.unfreezeAmount),e.internalTransactions!=null&&e.internalTransactions.length)for(var n=0;n<e.internalTransactions.length;++n)d.protocol.InternalTransaction.encode(e.internalTransactions[n],t.uint32(138).fork()).ldelim();return e.exchangeReceivedAmount!=null&&Object.hasOwnProperty.call(e,"exchangeReceivedAmount")&&t.uint32(144).int64(e.exchangeReceivedAmount),e.exchangeInjectAnotherAmount!=null&&Object.hasOwnProperty.call(e,"exchangeInjectAnotherAmount")&&t.uint32(152).int64(e.exchangeInjectAnotherAmount),e.exchangeWithdrawAnotherAmount!=null&&Object.hasOwnProperty.call(e,"exchangeWithdrawAnotherAmount")&&t.uint32(160).int64(e.exchangeWithdrawAnotherAmount),e.exchangeId!=null&&Object.hasOwnProperty.call(e,"exchangeId")&&t.uint32(168).int64(e.exchangeId),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.TransactionInfo;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.id=e.bytes();break;case 2:l.fee=e.int64();break;case 3:l.blockNumber=e.int64();break;case 4:l.blockTimeStamp=e.int64();break;case 5:l.contractResult&&l.contractResult.length||(l.contractResult=[]),l.contractResult.push(e.bytes());break;case 6:l.contractAddress=e.bytes();break;case 7:l.receipt=d.protocol.ResourceReceipt.decode(e,e.uint32());break;case 8:l.log&&l.log.length||(l.log=[]),l.log.push(d.protocol.TransactionInfo.Log.decode(e,e.uint32()));break;case 9:l.result=e.int32();break;case 10:l.resMessage=e.bytes();break;case 14:l.assetIssueID=e.string();break;case 15:l.withdrawAmount=e.int64();break;case 16:l.unfreezeAmount=e.int64();break;case 17:l.internalTransactions&&l.internalTransactions.length||(l.internalTransactions=[]),l.internalTransactions.push(d.protocol.InternalTransaction.decode(e,e.uint32()));break;case 18:l.exchangeReceivedAmount=e.int64();break;case 19:l.exchangeInjectAnotherAmount=e.int64();break;case 20:l.exchangeWithdrawAnotherAmount=e.int64();break;case 21:l.exchangeId=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.id!=null&&e.hasOwnProperty("id")&&!(e.id&&typeof e.id.length=="number"||i.isString(e.id)))return"id: buffer expected";if(e.fee!=null&&e.hasOwnProperty("fee")&&!i.isInteger(e.fee)&&!(e.fee&&i.isInteger(e.fee.low)&&i.isInteger(e.fee.high)))return"fee: integer|Long expected";if(e.blockNumber!=null&&e.hasOwnProperty("blockNumber")&&!i.isInteger(e.blockNumber)&&!(e.blockNumber&&i.isInteger(e.blockNumber.low)&&i.isInteger(e.blockNumber.high)))return"blockNumber: integer|Long expected";if(e.blockTimeStamp!=null&&e.hasOwnProperty("blockTimeStamp")&&!i.isInteger(e.blockTimeStamp)&&!(e.blockTimeStamp&&i.isInteger(e.blockTimeStamp.low)&&i.isInteger(e.blockTimeStamp.high)))return"blockTimeStamp: integer|Long expected";if(e.contractResult!=null&&e.hasOwnProperty("contractResult")){if(!Array.isArray(e.contractResult))return"contractResult: array expected";for(var t=0;t<e.contractResult.length;++t)if(!(e.contractResult[t]&&typeof e.contractResult[t].length=="number"||i.isString(e.contractResult[t])))return"contractResult: buffer[] expected"}if(e.contractAddress!=null&&e.hasOwnProperty("contractAddress")&&!(e.contractAddress&&typeof e.contractAddress.length=="number"||i.isString(e.contractAddress)))return"contractAddress: buffer expected";if(e.receipt!=null&&e.hasOwnProperty("receipt")){var n=d.protocol.ResourceReceipt.verify(e.receipt);if(n)return"receipt."+n}if(e.log!=null&&e.hasOwnProperty("log")){if(!Array.isArray(e.log))return"log: array expected";for(var t=0;t<e.log.length;++t){var n=d.protocol.TransactionInfo.Log.verify(e.log[t]);if(n)return"log."+n}}if(e.result!=null&&e.hasOwnProperty("result"))switch(e.result){default:return"result: enum value expected";case 0:case 1:break}if(e.resMessage!=null&&e.hasOwnProperty("resMessage")&&!(e.resMessage&&typeof e.resMessage.length=="number"||i.isString(e.resMessage)))return"resMessage: buffer expected";if(e.assetIssueID!=null&&e.hasOwnProperty("assetIssueID")&&!i.isString(e.assetIssueID))return"assetIssueID: string expected";if(e.withdrawAmount!=null&&e.hasOwnProperty("withdrawAmount")&&!i.isInteger(e.withdrawAmount)&&!(e.withdrawAmount&&i.isInteger(e.withdrawAmount.low)&&i.isInteger(e.withdrawAmount.high)))return"withdrawAmount: integer|Long expected";if(e.unfreezeAmount!=null&&e.hasOwnProperty("unfreezeAmount")&&!i.isInteger(e.unfreezeAmount)&&!(e.unfreezeAmount&&i.isInteger(e.unfreezeAmount.low)&&i.isInteger(e.unfreezeAmount.high)))return"unfreezeAmount: integer|Long expected";if(e.internalTransactions!=null&&e.hasOwnProperty("internalTransactions")){if(!Array.isArray(e.internalTransactions))return"internalTransactions: array expected";for(var t=0;t<e.internalTransactions.length;++t){var n=d.protocol.InternalTransaction.verify(e.internalTransactions[t]);if(n)return"internalTransactions."+n}}return e.exchangeReceivedAmount!=null&&e.hasOwnProperty("exchangeReceivedAmount")&&!i.isInteger(e.exchangeReceivedAmount)&&!(e.exchangeReceivedAmount&&i.isInteger(e.exchangeReceivedAmount.low)&&i.isInteger(e.exchangeReceivedAmount.high))?"exchangeReceivedAmount: integer|Long expected":e.exchangeInjectAnotherAmount!=null&&e.hasOwnProperty("exchangeInjectAnotherAmount")&&!i.isInteger(e.exchangeInjectAnotherAmount)&&!(e.exchangeInjectAnotherAmount&&i.isInteger(e.exchangeInjectAnotherAmount.low)&&i.isInteger(e.exchangeInjectAnotherAmount.high))?"exchangeInjectAnotherAmount: integer|Long expected":e.exchangeWithdrawAnotherAmount!=null&&e.hasOwnProperty("exchangeWithdrawAnotherAmount")&&!i.isInteger(e.exchangeWithdrawAnotherAmount)&&!(e.exchangeWithdrawAnotherAmount&&i.isInteger(e.exchangeWithdrawAnotherAmount.low)&&i.isInteger(e.exchangeWithdrawAnotherAmount.high))?"exchangeWithdrawAnotherAmount: integer|Long expected":e.exchangeId!=null&&e.hasOwnProperty("exchangeId")&&!i.isInteger(e.exchangeId)&&!(e.exchangeId&&i.isInteger(e.exchangeId.low)&&i.isInteger(e.exchangeId.high))?"exchangeId: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.TransactionInfo)return e;var t=new d.protocol.TransactionInfo;if(e.id!=null&&(typeof e.id=="string"?i.base64.decode(e.id,t.id=i.newBuffer(i.base64.length(e.id)),0):e.id.length&&(t.id=e.id)),e.fee!=null&&(i.Long?(t.fee=i.Long.fromValue(e.fee)).unsigned=!1:typeof e.fee=="string"?t.fee=parseInt(e.fee,10):typeof e.fee=="number"?t.fee=e.fee:typeof e.fee=="object"&&(t.fee=new i.LongBits(e.fee.low>>>0,e.fee.high>>>0).toNumber())),e.blockNumber!=null&&(i.Long?(t.blockNumber=i.Long.fromValue(e.blockNumber)).unsigned=!1:typeof e.blockNumber=="string"?t.blockNumber=parseInt(e.blockNumber,10):typeof e.blockNumber=="number"?t.blockNumber=e.blockNumber:typeof e.blockNumber=="object"&&(t.blockNumber=new i.LongBits(e.blockNumber.low>>>0,e.blockNumber.high>>>0).toNumber())),e.blockTimeStamp!=null&&(i.Long?(t.blockTimeStamp=i.Long.fromValue(e.blockTimeStamp)).unsigned=!1:typeof e.blockTimeStamp=="string"?t.blockTimeStamp=parseInt(e.blockTimeStamp,10):typeof e.blockTimeStamp=="number"?t.blockTimeStamp=e.blockTimeStamp:typeof e.blockTimeStamp=="object"&&(t.blockTimeStamp=new i.LongBits(e.blockTimeStamp.low>>>0,e.blockTimeStamp.high>>>0).toNumber())),e.contractResult){if(!Array.isArray(e.contractResult))throw TypeError(".protocol.TransactionInfo.contractResult: array expected");t.contractResult=[];for(var n=0;n<e.contractResult.length;++n)typeof e.contractResult[n]=="string"?i.base64.decode(e.contractResult[n],t.contractResult[n]=i.newBuffer(i.base64.length(e.contractResult[n])),0):e.contractResult[n].length&&(t.contractResult[n]=e.contractResult[n])}if(e.contractAddress!=null&&(typeof e.contractAddress=="string"?i.base64.decode(e.contractAddress,t.contractAddress=i.newBuffer(i.base64.length(e.contractAddress)),0):e.contractAddress.length&&(t.contractAddress=e.contractAddress)),e.receipt!=null){if(typeof e.receipt!="object")throw TypeError(".protocol.TransactionInfo.receipt: object expected");t.receipt=d.protocol.ResourceReceipt.fromObject(e.receipt)}if(e.log){if(!Array.isArray(e.log))throw TypeError(".protocol.TransactionInfo.log: array expected");t.log=[];for(var n=0;n<e.log.length;++n){if(typeof e.log[n]!="object")throw TypeError(".protocol.TransactionInfo.log: object expected");t.log[n]=d.protocol.TransactionInfo.Log.fromObject(e.log[n])}}switch(e.result){case"SUCESS":case 0:t.result=0;break;case"FAILED":case 1:t.result=1;break}if(e.resMessage!=null&&(typeof e.resMessage=="string"?i.base64.decode(e.resMessage,t.resMessage=i.newBuffer(i.base64.length(e.resMessage)),0):e.resMessage.length&&(t.resMessage=e.resMessage)),e.assetIssueID!=null&&(t.assetIssueID=String(e.assetIssueID)),e.withdrawAmount!=null&&(i.Long?(t.withdrawAmount=i.Long.fromValue(e.withdrawAmount)).unsigned=!1:typeof e.withdrawAmount=="string"?t.withdrawAmount=parseInt(e.withdrawAmount,10):typeof e.withdrawAmount=="number"?t.withdrawAmount=e.withdrawAmount:typeof e.withdrawAmount=="object"&&(t.withdrawAmount=new i.LongBits(e.withdrawAmount.low>>>0,e.withdrawAmount.high>>>0).toNumber())),e.unfreezeAmount!=null&&(i.Long?(t.unfreezeAmount=i.Long.fromValue(e.unfreezeAmount)).unsigned=!1:typeof e.unfreezeAmount=="string"?t.unfreezeAmount=parseInt(e.unfreezeAmount,10):typeof e.unfreezeAmount=="number"?t.unfreezeAmount=e.unfreezeAmount:typeof e.unfreezeAmount=="object"&&(t.unfreezeAmount=new i.LongBits(e.unfreezeAmount.low>>>0,e.unfreezeAmount.high>>>0).toNumber())),e.internalTransactions){if(!Array.isArray(e.internalTransactions))throw TypeError(".protocol.TransactionInfo.internalTransactions: array expected");t.internalTransactions=[];for(var n=0;n<e.internalTransactions.length;++n){if(typeof e.internalTransactions[n]!="object")throw TypeError(".protocol.TransactionInfo.internalTransactions: object expected");t.internalTransactions[n]=d.protocol.InternalTransaction.fromObject(e.internalTransactions[n])}}return e.exchangeReceivedAmount!=null&&(i.Long?(t.exchangeReceivedAmount=i.Long.fromValue(e.exchangeReceivedAmount)).unsigned=!1:typeof e.exchangeReceivedAmount=="string"?t.exchangeReceivedAmount=parseInt(e.exchangeReceivedAmount,10):typeof e.exchangeReceivedAmount=="number"?t.exchangeReceivedAmount=e.exchangeReceivedAmount:typeof e.exchangeReceivedAmount=="object"&&(t.exchangeReceivedAmount=new i.LongBits(e.exchangeReceivedAmount.low>>>0,e.exchangeReceivedAmount.high>>>0).toNumber())),e.exchangeInjectAnotherAmount!=null&&(i.Long?(t.exchangeInjectAnotherAmount=i.Long.fromValue(e.exchangeInjectAnotherAmount)).unsigned=!1:typeof e.exchangeInjectAnotherAmount=="string"?t.exchangeInjectAnotherAmount=parseInt(e.exchangeInjectAnotherAmount,10):typeof e.exchangeInjectAnotherAmount=="number"?t.exchangeInjectAnotherAmount=e.exchangeInjectAnotherAmount:typeof e.exchangeInjectAnotherAmount=="object"&&(t.exchangeInjectAnotherAmount=new i.LongBits(e.exchangeInjectAnotherAmount.low>>>0,e.exchangeInjectAnotherAmount.high>>>0).toNumber())),e.exchangeWithdrawAnotherAmount!=null&&(i.Long?(t.exchangeWithdrawAnotherAmount=i.Long.fromValue(e.exchangeWithdrawAnotherAmount)).unsigned=!1:typeof e.exchangeWithdrawAnotherAmount=="string"?t.exchangeWithdrawAnotherAmount=parseInt(e.exchangeWithdrawAnotherAmount,10):typeof e.exchangeWithdrawAnotherAmount=="number"?t.exchangeWithdrawAnotherAmount=e.exchangeWithdrawAnotherAmount:typeof e.exchangeWithdrawAnotherAmount=="object"&&(t.exchangeWithdrawAnotherAmount=new i.LongBits(e.exchangeWithdrawAnotherAmount.low>>>0,e.exchangeWithdrawAnotherAmount.high>>>0).toNumber())),e.exchangeId!=null&&(i.Long?(t.exchangeId=i.Long.fromValue(e.exchangeId)).unsigned=!1:typeof e.exchangeId=="string"?t.exchangeId=parseInt(e.exchangeId,10):typeof e.exchangeId=="number"?t.exchangeId=e.exchangeId:typeof e.exchangeId=="object"&&(t.exchangeId=new i.LongBits(e.exchangeId.low>>>0,e.exchangeId.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.contractResult=[],n.log=[],n.internalTransactions=[]),t.defaults){if(t.bytes===String?n.id="":(n.id=[],t.bytes!==Array&&(n.id=i.newBuffer(n.id))),i.Long){var l=new i.Long(0,0,!1);n.fee=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.fee=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.blockNumber=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.blockNumber=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.blockTimeStamp=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.blockTimeStamp=t.longs===String?"0":0;if(t.bytes===String?n.contractAddress="":(n.contractAddress=[],t.bytes!==Array&&(n.contractAddress=i.newBuffer(n.contractAddress))),n.receipt=null,n.result=t.enums===String?"SUCESS":0,t.bytes===String?n.resMessage="":(n.resMessage=[],t.bytes!==Array&&(n.resMessage=i.newBuffer(n.resMessage))),n.assetIssueID="",i.Long){var l=new i.Long(0,0,!1);n.withdrawAmount=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.withdrawAmount=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.unfreezeAmount=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.unfreezeAmount=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.exchangeReceivedAmount=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.exchangeReceivedAmount=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.exchangeInjectAnotherAmount=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.exchangeInjectAnotherAmount=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.exchangeWithdrawAnotherAmount=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.exchangeWithdrawAnotherAmount=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.exchangeId=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.exchangeId=t.longs===String?"0":0}if(e.id!=null&&e.hasOwnProperty("id")&&(n.id=t.bytes===String?i.base64.encode(e.id,0,e.id.length):t.bytes===Array?Array.prototype.slice.call(e.id):e.id),e.fee!=null&&e.hasOwnProperty("fee")&&(typeof e.fee=="number"?n.fee=t.longs===String?String(e.fee):e.fee:n.fee=t.longs===String?i.Long.prototype.toString.call(e.fee):t.longs===Number?new i.LongBits(e.fee.low>>>0,e.fee.high>>>0).toNumber():e.fee),e.blockNumber!=null&&e.hasOwnProperty("blockNumber")&&(typeof e.blockNumber=="number"?n.blockNumber=t.longs===String?String(e.blockNumber):e.blockNumber:n.blockNumber=t.longs===String?i.Long.prototype.toString.call(e.blockNumber):t.longs===Number?new i.LongBits(e.blockNumber.low>>>0,e.blockNumber.high>>>0).toNumber():e.blockNumber),e.blockTimeStamp!=null&&e.hasOwnProperty("blockTimeStamp")&&(typeof e.blockTimeStamp=="number"?n.blockTimeStamp=t.longs===String?String(e.blockTimeStamp):e.blockTimeStamp:n.blockTimeStamp=t.longs===String?i.Long.prototype.toString.call(e.blockTimeStamp):t.longs===Number?new i.LongBits(e.blockTimeStamp.low>>>0,e.blockTimeStamp.high>>>0).toNumber():e.blockTimeStamp),e.contractResult&&e.contractResult.length){n.contractResult=[];for(var c=0;c<e.contractResult.length;++c)n.contractResult[c]=t.bytes===String?i.base64.encode(e.contractResult[c],0,e.contractResult[c].length):t.bytes===Array?Array.prototype.slice.call(e.contractResult[c]):e.contractResult[c]}if(e.contractAddress!=null&&e.hasOwnProperty("contractAddress")&&(n.contractAddress=t.bytes===String?i.base64.encode(e.contractAddress,0,e.contractAddress.length):t.bytes===Array?Array.prototype.slice.call(e.contractAddress):e.contractAddress),e.receipt!=null&&e.hasOwnProperty("receipt")&&(n.receipt=d.protocol.ResourceReceipt.toObject(e.receipt,t)),e.log&&e.log.length){n.log=[];for(var c=0;c<e.log.length;++c)n.log[c]=d.protocol.TransactionInfo.Log.toObject(e.log[c],t)}if(e.result!=null&&e.hasOwnProperty("result")&&(n.result=t.enums===String?d.protocol.TransactionInfo.code[e.result]:e.result),e.resMessage!=null&&e.hasOwnProperty("resMessage")&&(n.resMessage=t.bytes===String?i.base64.encode(e.resMessage,0,e.resMessage.length):t.bytes===Array?Array.prototype.slice.call(e.resMessage):e.resMessage),e.assetIssueID!=null&&e.hasOwnProperty("assetIssueID")&&(n.assetIssueID=e.assetIssueID),e.withdrawAmount!=null&&e.hasOwnProperty("withdrawAmount")&&(typeof e.withdrawAmount=="number"?n.withdrawAmount=t.longs===String?String(e.withdrawAmount):e.withdrawAmount:n.withdrawAmount=t.longs===String?i.Long.prototype.toString.call(e.withdrawAmount):t.longs===Number?new i.LongBits(e.withdrawAmount.low>>>0,e.withdrawAmount.high>>>0).toNumber():e.withdrawAmount),e.unfreezeAmount!=null&&e.hasOwnProperty("unfreezeAmount")&&(typeof e.unfreezeAmount=="number"?n.unfreezeAmount=t.longs===String?String(e.unfreezeAmount):e.unfreezeAmount:n.unfreezeAmount=t.longs===String?i.Long.prototype.toString.call(e.unfreezeAmount):t.longs===Number?new i.LongBits(e.unfreezeAmount.low>>>0,e.unfreezeAmount.high>>>0).toNumber():e.unfreezeAmount),e.internalTransactions&&e.internalTransactions.length){n.internalTransactions=[];for(var c=0;c<e.internalTransactions.length;++c)n.internalTransactions[c]=d.protocol.InternalTransaction.toObject(e.internalTransactions[c],t)}return e.exchangeReceivedAmount!=null&&e.hasOwnProperty("exchangeReceivedAmount")&&(typeof e.exchangeReceivedAmount=="number"?n.exchangeReceivedAmount=t.longs===String?String(e.exchangeReceivedAmount):e.exchangeReceivedAmount:n.exchangeReceivedAmount=t.longs===String?i.Long.prototype.toString.call(e.exchangeReceivedAmount):t.longs===Number?new i.LongBits(e.exchangeReceivedAmount.low>>>0,e.exchangeReceivedAmount.high>>>0).toNumber():e.exchangeReceivedAmount),e.exchangeInjectAnotherAmount!=null&&e.hasOwnProperty("exchangeInjectAnotherAmount")&&(typeof e.exchangeInjectAnotherAmount=="number"?n.exchangeInjectAnotherAmount=t.longs===String?String(e.exchangeInjectAnotherAmount):e.exchangeInjectAnotherAmount:n.exchangeInjectAnotherAmount=t.longs===String?i.Long.prototype.toString.call(e.exchangeInjectAnotherAmount):t.longs===Number?new i.LongBits(e.exchangeInjectAnotherAmount.low>>>0,e.exchangeInjectAnotherAmount.high>>>0).toNumber():e.exchangeInjectAnotherAmount),e.exchangeWithdrawAnotherAmount!=null&&e.hasOwnProperty("exchangeWithdrawAnotherAmount")&&(typeof e.exchangeWithdrawAnotherAmount=="number"?n.exchangeWithdrawAnotherAmount=t.longs===String?String(e.exchangeWithdrawAnotherAmount):e.exchangeWithdrawAnotherAmount:n.exchangeWithdrawAnotherAmount=t.longs===String?i.Long.prototype.toString.call(e.exchangeWithdrawAnotherAmount):t.longs===Number?new i.LongBits(e.exchangeWithdrawAnotherAmount.low>>>0,e.exchangeWithdrawAnotherAmount.high>>>0).toNumber():e.exchangeWithdrawAnotherAmount),e.exchangeId!=null&&e.hasOwnProperty("exchangeId")&&(typeof e.exchangeId=="number"?n.exchangeId=t.longs===String?String(e.exchangeId):e.exchangeId:n.exchangeId=t.longs===String?i.Long.prototype.toString.call(e.exchangeId):t.longs===Number?new i.LongBits(e.exchangeId.low>>>0,e.exchangeId.high>>>0).toNumber():e.exchangeId),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r.code=function(){var o={},e=Object.create(o);return e[o[0]="SUCESS"]=0,e[o[1]="FAILED"]=1,e}(),r.Log=function(){function o(e){if(this.topics=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return o.prototype.address=i.newBuffer([]),o.prototype.topics=i.emptyArray,o.prototype.data=i.newBuffer([]),o.create=function(t){return new o(t)},o.encode=function(t,n){if(n||(n=H.create()),t.address!=null&&Object.hasOwnProperty.call(t,"address")&&n.uint32(10).bytes(t.address),t.topics!=null&&t.topics.length)for(var l=0;l<t.topics.length;++l)n.uint32(18).bytes(t.topics[l]);return t.data!=null&&Object.hasOwnProperty.call(t,"data")&&n.uint32(26).bytes(t.data),n},o.encodeDelimited=function(t,n){return this.encode(t,n).ldelim()},o.decode=function(t,n){t instanceof v||(t=v.create(t));for(var l=n===void 0?t.len:t.pos+n,c=new d.protocol.TransactionInfo.Log;t.pos<l;){var u=t.uint32();switch(u>>>3){case 1:c.address=t.bytes();break;case 2:c.topics&&c.topics.length||(c.topics=[]),c.topics.push(t.bytes());break;case 3:c.data=t.bytes();break;default:t.skipType(u&7);break}}return c},o.decodeDelimited=function(t){return t instanceof v||(t=new v(t)),this.decode(t,t.uint32())},o.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.address!=null&&t.hasOwnProperty("address")&&!(t.address&&typeof t.address.length=="number"||i.isString(t.address)))return"address: buffer expected";if(t.topics!=null&&t.hasOwnProperty("topics")){if(!Array.isArray(t.topics))return"topics: array expected";for(var n=0;n<t.topics.length;++n)if(!(t.topics[n]&&typeof t.topics[n].length=="number"||i.isString(t.topics[n])))return"topics: buffer[] expected"}return t.data!=null&&t.hasOwnProperty("data")&&!(t.data&&typeof t.data.length=="number"||i.isString(t.data))?"data: buffer expected":null},o.fromObject=function(t){if(t instanceof d.protocol.TransactionInfo.Log)return t;var n=new d.protocol.TransactionInfo.Log;if(t.address!=null&&(typeof t.address=="string"?i.base64.decode(t.address,n.address=i.newBuffer(i.base64.length(t.address)),0):t.address.length&&(n.address=t.address)),t.topics){if(!Array.isArray(t.topics))throw TypeError(".protocol.TransactionInfo.Log.topics: array expected");n.topics=[];for(var l=0;l<t.topics.length;++l)typeof t.topics[l]=="string"?i.base64.decode(t.topics[l],n.topics[l]=i.newBuffer(i.base64.length(t.topics[l])),0):t.topics[l].length&&(n.topics[l]=t.topics[l])}return t.data!=null&&(typeof t.data=="string"?i.base64.decode(t.data,n.data=i.newBuffer(i.base64.length(t.data)),0):t.data.length&&(n.data=t.data)),n},o.toObject=function(t,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.topics=[]),n.defaults&&(n.bytes===String?l.address="":(l.address=[],n.bytes!==Array&&(l.address=i.newBuffer(l.address))),n.bytes===String?l.data="":(l.data=[],n.bytes!==Array&&(l.data=i.newBuffer(l.data)))),t.address!=null&&t.hasOwnProperty("address")&&(l.address=n.bytes===String?i.base64.encode(t.address,0,t.address.length):n.bytes===Array?Array.prototype.slice.call(t.address):t.address),t.topics&&t.topics.length){l.topics=[];for(var c=0;c<t.topics.length;++c)l.topics[c]=n.bytes===String?i.base64.encode(t.topics[c],0,t.topics[c].length):n.bytes===Array?Array.prototype.slice.call(t.topics[c]):t.topics[c]}return t.data!=null&&t.hasOwnProperty("data")&&(l.data=n.bytes===String?i.base64.encode(t.data,0,t.data.length):n.bytes===Array?Array.prototype.slice.call(t.data):t.data),l},o.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},o}(),r}(),f.TransactionRet=function(){function r(o){if(this.transactioninfo=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.blockNumber=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.blockTimeStamp=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.transactioninfo=i.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.blockNumber!=null&&Object.hasOwnProperty.call(e,"blockNumber")&&t.uint32(8).int64(e.blockNumber),e.blockTimeStamp!=null&&Object.hasOwnProperty.call(e,"blockTimeStamp")&&t.uint32(16).int64(e.blockTimeStamp),e.transactioninfo!=null&&e.transactioninfo.length)for(var n=0;n<e.transactioninfo.length;++n)d.protocol.TransactionInfo.encode(e.transactioninfo[n],t.uint32(26).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.TransactionRet;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.blockNumber=e.int64();break;case 2:l.blockTimeStamp=e.int64();break;case 3:l.transactioninfo&&l.transactioninfo.length||(l.transactioninfo=[]),l.transactioninfo.push(d.protocol.TransactionInfo.decode(e,e.uint32()));break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.blockNumber!=null&&e.hasOwnProperty("blockNumber")&&!i.isInteger(e.blockNumber)&&!(e.blockNumber&&i.isInteger(e.blockNumber.low)&&i.isInteger(e.blockNumber.high)))return"blockNumber: integer|Long expected";if(e.blockTimeStamp!=null&&e.hasOwnProperty("blockTimeStamp")&&!i.isInteger(e.blockTimeStamp)&&!(e.blockTimeStamp&&i.isInteger(e.blockTimeStamp.low)&&i.isInteger(e.blockTimeStamp.high)))return"blockTimeStamp: integer|Long expected";if(e.transactioninfo!=null&&e.hasOwnProperty("transactioninfo")){if(!Array.isArray(e.transactioninfo))return"transactioninfo: array expected";for(var t=0;t<e.transactioninfo.length;++t){var n=d.protocol.TransactionInfo.verify(e.transactioninfo[t]);if(n)return"transactioninfo."+n}}return null},r.fromObject=function(e){if(e instanceof d.protocol.TransactionRet)return e;var t=new d.protocol.TransactionRet;if(e.blockNumber!=null&&(i.Long?(t.blockNumber=i.Long.fromValue(e.blockNumber)).unsigned=!1:typeof e.blockNumber=="string"?t.blockNumber=parseInt(e.blockNumber,10):typeof e.blockNumber=="number"?t.blockNumber=e.blockNumber:typeof e.blockNumber=="object"&&(t.blockNumber=new i.LongBits(e.blockNumber.low>>>0,e.blockNumber.high>>>0).toNumber())),e.blockTimeStamp!=null&&(i.Long?(t.blockTimeStamp=i.Long.fromValue(e.blockTimeStamp)).unsigned=!1:typeof e.blockTimeStamp=="string"?t.blockTimeStamp=parseInt(e.blockTimeStamp,10):typeof e.blockTimeStamp=="number"?t.blockTimeStamp=e.blockTimeStamp:typeof e.blockTimeStamp=="object"&&(t.blockTimeStamp=new i.LongBits(e.blockTimeStamp.low>>>0,e.blockTimeStamp.high>>>0).toNumber())),e.transactioninfo){if(!Array.isArray(e.transactioninfo))throw TypeError(".protocol.TransactionRet.transactioninfo: array expected");t.transactioninfo=[];for(var n=0;n<e.transactioninfo.length;++n){if(typeof e.transactioninfo[n]!="object")throw TypeError(".protocol.TransactionRet.transactioninfo: object expected");t.transactioninfo[n]=d.protocol.TransactionInfo.fromObject(e.transactioninfo[n])}}return t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.transactioninfo=[]),t.defaults){if(i.Long){var l=new i.Long(0,0,!1);n.blockNumber=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.blockNumber=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.blockTimeStamp=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.blockTimeStamp=t.longs===String?"0":0}if(e.blockNumber!=null&&e.hasOwnProperty("blockNumber")&&(typeof e.blockNumber=="number"?n.blockNumber=t.longs===String?String(e.blockNumber):e.blockNumber:n.blockNumber=t.longs===String?i.Long.prototype.toString.call(e.blockNumber):t.longs===Number?new i.LongBits(e.blockNumber.low>>>0,e.blockNumber.high>>>0).toNumber():e.blockNumber),e.blockTimeStamp!=null&&e.hasOwnProperty("blockTimeStamp")&&(typeof e.blockTimeStamp=="number"?n.blockTimeStamp=t.longs===String?String(e.blockTimeStamp):e.blockTimeStamp:n.blockTimeStamp=t.longs===String?i.Long.prototype.toString.call(e.blockTimeStamp):t.longs===Number?new i.LongBits(e.blockTimeStamp.low>>>0,e.blockTimeStamp.high>>>0).toNumber():e.blockTimeStamp),e.transactioninfo&&e.transactioninfo.length){n.transactioninfo=[];for(var c=0;c<e.transactioninfo.length;++c)n.transactioninfo[c]=d.protocol.TransactionInfo.toObject(e.transactioninfo[c],t)}return n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.Transactions=function(){function r(o){if(this.transactions=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.transactions=i.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.transactions!=null&&e.transactions.length)for(var n=0;n<e.transactions.length;++n)d.protocol.Transaction.encode(e.transactions[n],t.uint32(10).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.Transactions;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.transactions&&l.transactions.length||(l.transactions=[]),l.transactions.push(d.protocol.Transaction.decode(e,e.uint32()));break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.transactions!=null&&e.hasOwnProperty("transactions")){if(!Array.isArray(e.transactions))return"transactions: array expected";for(var t=0;t<e.transactions.length;++t){var n=d.protocol.Transaction.verify(e.transactions[t]);if(n)return"transactions."+n}}return null},r.fromObject=function(e){if(e instanceof d.protocol.Transactions)return e;var t=new d.protocol.Transactions;if(e.transactions){if(!Array.isArray(e.transactions))throw TypeError(".protocol.Transactions.transactions: array expected");t.transactions=[];for(var n=0;n<e.transactions.length;++n){if(typeof e.transactions[n]!="object")throw TypeError(".protocol.Transactions.transactions: object expected");t.transactions[n]=d.protocol.Transaction.fromObject(e.transactions[n])}}return t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.transactions=[]),e.transactions&&e.transactions.length){n.transactions=[];for(var l=0;l<e.transactions.length;++l)n.transactions[l]=d.protocol.Transaction.toObject(e.transactions[l],t)}return n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.TransactionSign=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.transaction=null,r.prototype.privateKey=i.newBuffer([]),r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.transaction!=null&&Object.hasOwnProperty.call(e,"transaction")&&d.protocol.Transaction.encode(e.transaction,t.uint32(10).fork()).ldelim(),e.privateKey!=null&&Object.hasOwnProperty.call(e,"privateKey")&&t.uint32(18).bytes(e.privateKey),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.TransactionSign;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.transaction=d.protocol.Transaction.decode(e,e.uint32());break;case 2:l.privateKey=e.bytes();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.transaction!=null&&e.hasOwnProperty("transaction")){var t=d.protocol.Transaction.verify(e.transaction);if(t)return"transaction."+t}return e.privateKey!=null&&e.hasOwnProperty("privateKey")&&!(e.privateKey&&typeof e.privateKey.length=="number"||i.isString(e.privateKey))?"privateKey: buffer expected":null},r.fromObject=function(e){if(e instanceof d.protocol.TransactionSign)return e;var t=new d.protocol.TransactionSign;if(e.transaction!=null){if(typeof e.transaction!="object")throw TypeError(".protocol.TransactionSign.transaction: object expected");t.transaction=d.protocol.Transaction.fromObject(e.transaction)}return e.privateKey!=null&&(typeof e.privateKey=="string"?i.base64.decode(e.privateKey,t.privateKey=i.newBuffer(i.base64.length(e.privateKey)),0):e.privateKey.length&&(t.privateKey=e.privateKey)),t},r.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.transaction=null,t.bytes===String?n.privateKey="":(n.privateKey=[],t.bytes!==Array&&(n.privateKey=i.newBuffer(n.privateKey)))),e.transaction!=null&&e.hasOwnProperty("transaction")&&(n.transaction=d.protocol.Transaction.toObject(e.transaction,t)),e.privateKey!=null&&e.hasOwnProperty("privateKey")&&(n.privateKey=t.bytes===String?i.base64.encode(e.privateKey,0,e.privateKey.length):t.bytes===Array?Array.prototype.slice.call(e.privateKey):e.privateKey),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.BlockHeader=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.rawData=null,r.prototype.witnessSignature=i.newBuffer([]),r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.rawData!=null&&Object.hasOwnProperty.call(e,"rawData")&&d.protocol.BlockHeader.raw.encode(e.rawData,t.uint32(10).fork()).ldelim(),e.witnessSignature!=null&&Object.hasOwnProperty.call(e,"witnessSignature")&&t.uint32(18).bytes(e.witnessSignature),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.BlockHeader;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.rawData=d.protocol.BlockHeader.raw.decode(e,e.uint32());break;case 2:l.witnessSignature=e.bytes();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.rawData!=null&&e.hasOwnProperty("rawData")){var t=d.protocol.BlockHeader.raw.verify(e.rawData);if(t)return"rawData."+t}return e.witnessSignature!=null&&e.hasOwnProperty("witnessSignature")&&!(e.witnessSignature&&typeof e.witnessSignature.length=="number"||i.isString(e.witnessSignature))?"witnessSignature: buffer expected":null},r.fromObject=function(e){if(e instanceof d.protocol.BlockHeader)return e;var t=new d.protocol.BlockHeader;if(e.rawData!=null){if(typeof e.rawData!="object")throw TypeError(".protocol.BlockHeader.rawData: object expected");t.rawData=d.protocol.BlockHeader.raw.fromObject(e.rawData)}return e.witnessSignature!=null&&(typeof e.witnessSignature=="string"?i.base64.decode(e.witnessSignature,t.witnessSignature=i.newBuffer(i.base64.length(e.witnessSignature)),0):e.witnessSignature.length&&(t.witnessSignature=e.witnessSignature)),t},r.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.rawData=null,t.bytes===String?n.witnessSignature="":(n.witnessSignature=[],t.bytes!==Array&&(n.witnessSignature=i.newBuffer(n.witnessSignature)))),e.rawData!=null&&e.hasOwnProperty("rawData")&&(n.rawData=d.protocol.BlockHeader.raw.toObject(e.rawData,t)),e.witnessSignature!=null&&e.hasOwnProperty("witnessSignature")&&(n.witnessSignature=t.bytes===String?i.base64.encode(e.witnessSignature,0,e.witnessSignature.length):t.bytes===Array?Array.prototype.slice.call(e.witnessSignature):e.witnessSignature),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r.raw=function(){function o(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return o.prototype.timestamp=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.txTrieRoot=i.newBuffer([]),o.prototype.parentHash=i.newBuffer([]),o.prototype.number=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.witnessId=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.witnessAddress=i.newBuffer([]),o.prototype.version=0,o.prototype.accountStateRoot=i.newBuffer([]),o.create=function(t){return new o(t)},o.encode=function(t,n){return n||(n=H.create()),t.timestamp!=null&&Object.hasOwnProperty.call(t,"timestamp")&&n.uint32(8).int64(t.timestamp),t.txTrieRoot!=null&&Object.hasOwnProperty.call(t,"txTrieRoot")&&n.uint32(18).bytes(t.txTrieRoot),t.parentHash!=null&&Object.hasOwnProperty.call(t,"parentHash")&&n.uint32(26).bytes(t.parentHash),t.number!=null&&Object.hasOwnProperty.call(t,"number")&&n.uint32(56).int64(t.number),t.witnessId!=null&&Object.hasOwnProperty.call(t,"witnessId")&&n.uint32(64).int64(t.witnessId),t.witnessAddress!=null&&Object.hasOwnProperty.call(t,"witnessAddress")&&n.uint32(74).bytes(t.witnessAddress),t.version!=null&&Object.hasOwnProperty.call(t,"version")&&n.uint32(80).int32(t.version),t.accountStateRoot!=null&&Object.hasOwnProperty.call(t,"accountStateRoot")&&n.uint32(90).bytes(t.accountStateRoot),n},o.encodeDelimited=function(t,n){return this.encode(t,n).ldelim()},o.decode=function(t,n){t instanceof v||(t=v.create(t));for(var l=n===void 0?t.len:t.pos+n,c=new d.protocol.BlockHeader.raw;t.pos<l;){var u=t.uint32();switch(u>>>3){case 1:c.timestamp=t.int64();break;case 2:c.txTrieRoot=t.bytes();break;case 3:c.parentHash=t.bytes();break;case 7:c.number=t.int64();break;case 8:c.witnessId=t.int64();break;case 9:c.witnessAddress=t.bytes();break;case 10:c.version=t.int32();break;case 11:c.accountStateRoot=t.bytes();break;default:t.skipType(u&7);break}}return c},o.decodeDelimited=function(t){return t instanceof v||(t=new v(t)),this.decode(t,t.uint32())},o.verify=function(t){return typeof t!="object"||t===null?"object expected":t.timestamp!=null&&t.hasOwnProperty("timestamp")&&!i.isInteger(t.timestamp)&&!(t.timestamp&&i.isInteger(t.timestamp.low)&&i.isInteger(t.timestamp.high))?"timestamp: integer|Long expected":t.txTrieRoot!=null&&t.hasOwnProperty("txTrieRoot")&&!(t.txTrieRoot&&typeof t.txTrieRoot.length=="number"||i.isString(t.txTrieRoot))?"txTrieRoot: buffer expected":t.parentHash!=null&&t.hasOwnProperty("parentHash")&&!(t.parentHash&&typeof t.parentHash.length=="number"||i.isString(t.parentHash))?"parentHash: buffer expected":t.number!=null&&t.hasOwnProperty("number")&&!i.isInteger(t.number)&&!(t.number&&i.isInteger(t.number.low)&&i.isInteger(t.number.high))?"number: integer|Long expected":t.witnessId!=null&&t.hasOwnProperty("witnessId")&&!i.isInteger(t.witnessId)&&!(t.witnessId&&i.isInteger(t.witnessId.low)&&i.isInteger(t.witnessId.high))?"witnessId: integer|Long expected":t.witnessAddress!=null&&t.hasOwnProperty("witnessAddress")&&!(t.witnessAddress&&typeof t.witnessAddress.length=="number"||i.isString(t.witnessAddress))?"witnessAddress: buffer expected":t.version!=null&&t.hasOwnProperty("version")&&!i.isInteger(t.version)?"version: integer expected":t.accountStateRoot!=null&&t.hasOwnProperty("accountStateRoot")&&!(t.accountStateRoot&&typeof t.accountStateRoot.length=="number"||i.isString(t.accountStateRoot))?"accountStateRoot: buffer expected":null},o.fromObject=function(t){if(t instanceof d.protocol.BlockHeader.raw)return t;var n=new d.protocol.BlockHeader.raw;return t.timestamp!=null&&(i.Long?(n.timestamp=i.Long.fromValue(t.timestamp)).unsigned=!1:typeof t.timestamp=="string"?n.timestamp=parseInt(t.timestamp,10):typeof t.timestamp=="number"?n.timestamp=t.timestamp:typeof t.timestamp=="object"&&(n.timestamp=new i.LongBits(t.timestamp.low>>>0,t.timestamp.high>>>0).toNumber())),t.txTrieRoot!=null&&(typeof t.txTrieRoot=="string"?i.base64.decode(t.txTrieRoot,n.txTrieRoot=i.newBuffer(i.base64.length(t.txTrieRoot)),0):t.txTrieRoot.length&&(n.txTrieRoot=t.txTrieRoot)),t.parentHash!=null&&(typeof t.parentHash=="string"?i.base64.decode(t.parentHash,n.parentHash=i.newBuffer(i.base64.length(t.parentHash)),0):t.parentHash.length&&(n.parentHash=t.parentHash)),t.number!=null&&(i.Long?(n.number=i.Long.fromValue(t.number)).unsigned=!1:typeof t.number=="string"?n.number=parseInt(t.number,10):typeof t.number=="number"?n.number=t.number:typeof t.number=="object"&&(n.number=new i.LongBits(t.number.low>>>0,t.number.high>>>0).toNumber())),t.witnessId!=null&&(i.Long?(n.witnessId=i.Long.fromValue(t.witnessId)).unsigned=!1:typeof t.witnessId=="string"?n.witnessId=parseInt(t.witnessId,10):typeof t.witnessId=="number"?n.witnessId=t.witnessId:typeof t.witnessId=="object"&&(n.witnessId=new i.LongBits(t.witnessId.low>>>0,t.witnessId.high>>>0).toNumber())),t.witnessAddress!=null&&(typeof t.witnessAddress=="string"?i.base64.decode(t.witnessAddress,n.witnessAddress=i.newBuffer(i.base64.length(t.witnessAddress)),0):t.witnessAddress.length&&(n.witnessAddress=t.witnessAddress)),t.version!=null&&(n.version=t.version|0),t.accountStateRoot!=null&&(typeof t.accountStateRoot=="string"?i.base64.decode(t.accountStateRoot,n.accountStateRoot=i.newBuffer(i.base64.length(t.accountStateRoot)),0):t.accountStateRoot.length&&(n.accountStateRoot=t.accountStateRoot)),n},o.toObject=function(t,n){n||(n={});var l={};if(n.defaults){if(i.Long){var c=new i.Long(0,0,!1);l.timestamp=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.timestamp=n.longs===String?"0":0;if(n.bytes===String?l.txTrieRoot="":(l.txTrieRoot=[],n.bytes!==Array&&(l.txTrieRoot=i.newBuffer(l.txTrieRoot))),n.bytes===String?l.parentHash="":(l.parentHash=[],n.bytes!==Array&&(l.parentHash=i.newBuffer(l.parentHash))),i.Long){var c=new i.Long(0,0,!1);l.number=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.number=n.longs===String?"0":0;if(i.Long){var c=new i.Long(0,0,!1);l.witnessId=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.witnessId=n.longs===String?"0":0;n.bytes===String?l.witnessAddress="":(l.witnessAddress=[],n.bytes!==Array&&(l.witnessAddress=i.newBuffer(l.witnessAddress))),l.version=0,n.bytes===String?l.accountStateRoot="":(l.accountStateRoot=[],n.bytes!==Array&&(l.accountStateRoot=i.newBuffer(l.accountStateRoot)))}return t.timestamp!=null&&t.hasOwnProperty("timestamp")&&(typeof t.timestamp=="number"?l.timestamp=n.longs===String?String(t.timestamp):t.timestamp:l.timestamp=n.longs===String?i.Long.prototype.toString.call(t.timestamp):n.longs===Number?new i.LongBits(t.timestamp.low>>>0,t.timestamp.high>>>0).toNumber():t.timestamp),t.txTrieRoot!=null&&t.hasOwnProperty("txTrieRoot")&&(l.txTrieRoot=n.bytes===String?i.base64.encode(t.txTrieRoot,0,t.txTrieRoot.length):n.bytes===Array?Array.prototype.slice.call(t.txTrieRoot):t.txTrieRoot),t.parentHash!=null&&t.hasOwnProperty("parentHash")&&(l.parentHash=n.bytes===String?i.base64.encode(t.parentHash,0,t.parentHash.length):n.bytes===Array?Array.prototype.slice.call(t.parentHash):t.parentHash),t.number!=null&&t.hasOwnProperty("number")&&(typeof t.number=="number"?l.number=n.longs===String?String(t.number):t.number:l.number=n.longs===String?i.Long.prototype.toString.call(t.number):n.longs===Number?new i.LongBits(t.number.low>>>0,t.number.high>>>0).toNumber():t.number),t.witnessId!=null&&t.hasOwnProperty("witnessId")&&(typeof t.witnessId=="number"?l.witnessId=n.longs===String?String(t.witnessId):t.witnessId:l.witnessId=n.longs===String?i.Long.prototype.toString.call(t.witnessId):n.longs===Number?new i.LongBits(t.witnessId.low>>>0,t.witnessId.high>>>0).toNumber():t.witnessId),t.witnessAddress!=null&&t.hasOwnProperty("witnessAddress")&&(l.witnessAddress=n.bytes===String?i.base64.encode(t.witnessAddress,0,t.witnessAddress.length):n.bytes===Array?Array.prototype.slice.call(t.witnessAddress):t.witnessAddress),t.version!=null&&t.hasOwnProperty("version")&&(l.version=t.version),t.accountStateRoot!=null&&t.hasOwnProperty("accountStateRoot")&&(l.accountStateRoot=n.bytes===String?i.base64.encode(t.accountStateRoot,0,t.accountStateRoot.length):n.bytes===Array?Array.prototype.slice.call(t.accountStateRoot):t.accountStateRoot),l},o.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},o}(),r}(),f.Block=function(){function r(o){if(this.transactions=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.transactions=i.emptyArray,r.prototype.blockHeader=null,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.transactions!=null&&e.transactions.length)for(var n=0;n<e.transactions.length;++n)d.protocol.Transaction.encode(e.transactions[n],t.uint32(10).fork()).ldelim();return e.blockHeader!=null&&Object.hasOwnProperty.call(e,"blockHeader")&&d.protocol.BlockHeader.encode(e.blockHeader,t.uint32(18).fork()).ldelim(),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.Block;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.transactions&&l.transactions.length||(l.transactions=[]),l.transactions.push(d.protocol.Transaction.decode(e,e.uint32()));break;case 2:l.blockHeader=d.protocol.BlockHeader.decode(e,e.uint32());break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.transactions!=null&&e.hasOwnProperty("transactions")){if(!Array.isArray(e.transactions))return"transactions: array expected";for(var t=0;t<e.transactions.length;++t){var n=d.protocol.Transaction.verify(e.transactions[t]);if(n)return"transactions."+n}}if(e.blockHeader!=null&&e.hasOwnProperty("blockHeader")){var n=d.protocol.BlockHeader.verify(e.blockHeader);if(n)return"blockHeader."+n}return null},r.fromObject=function(e){if(e instanceof d.protocol.Block)return e;var t=new d.protocol.Block;if(e.transactions){if(!Array.isArray(e.transactions))throw TypeError(".protocol.Block.transactions: array expected");t.transactions=[];for(var n=0;n<e.transactions.length;++n){if(typeof e.transactions[n]!="object")throw TypeError(".protocol.Block.transactions: object expected");t.transactions[n]=d.protocol.Transaction.fromObject(e.transactions[n])}}if(e.blockHeader!=null){if(typeof e.blockHeader!="object")throw TypeError(".protocol.Block.blockHeader: object expected");t.blockHeader=d.protocol.BlockHeader.fromObject(e.blockHeader)}return t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.transactions=[]),t.defaults&&(n.blockHeader=null),e.transactions&&e.transactions.length){n.transactions=[];for(var l=0;l<e.transactions.length;++l)n.transactions[l]=d.protocol.Transaction.toObject(e.transactions[l],t)}return e.blockHeader!=null&&e.hasOwnProperty("blockHeader")&&(n.blockHeader=d.protocol.BlockHeader.toObject(e.blockHeader,t)),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.ChainInventory=function(){function r(o){if(this.ids=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ids=i.emptyArray,r.prototype.remainNum=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.ids!=null&&e.ids.length)for(var n=0;n<e.ids.length;++n)d.protocol.ChainInventory.BlockId.encode(e.ids[n],t.uint32(10).fork()).ldelim();return e.remainNum!=null&&Object.hasOwnProperty.call(e,"remainNum")&&t.uint32(16).int64(e.remainNum),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.ChainInventory;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ids&&l.ids.length||(l.ids=[]),l.ids.push(d.protocol.ChainInventory.BlockId.decode(e,e.uint32()));break;case 2:l.remainNum=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.ids!=null&&e.hasOwnProperty("ids")){if(!Array.isArray(e.ids))return"ids: array expected";for(var t=0;t<e.ids.length;++t){var n=d.protocol.ChainInventory.BlockId.verify(e.ids[t]);if(n)return"ids."+n}}return e.remainNum!=null&&e.hasOwnProperty("remainNum")&&!i.isInteger(e.remainNum)&&!(e.remainNum&&i.isInteger(e.remainNum.low)&&i.isInteger(e.remainNum.high))?"remainNum: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.ChainInventory)return e;var t=new d.protocol.ChainInventory;if(e.ids){if(!Array.isArray(e.ids))throw TypeError(".protocol.ChainInventory.ids: array expected");t.ids=[];for(var n=0;n<e.ids.length;++n){if(typeof e.ids[n]!="object")throw TypeError(".protocol.ChainInventory.ids: object expected");t.ids[n]=d.protocol.ChainInventory.BlockId.fromObject(e.ids[n])}}return e.remainNum!=null&&(i.Long?(t.remainNum=i.Long.fromValue(e.remainNum)).unsigned=!1:typeof e.remainNum=="string"?t.remainNum=parseInt(e.remainNum,10):typeof e.remainNum=="number"?t.remainNum=e.remainNum:typeof e.remainNum=="object"&&(t.remainNum=new i.LongBits(e.remainNum.low>>>0,e.remainNum.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.ids=[]),t.defaults)if(i.Long){var l=new i.Long(0,0,!1);n.remainNum=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.remainNum=t.longs===String?"0":0;if(e.ids&&e.ids.length){n.ids=[];for(var c=0;c<e.ids.length;++c)n.ids[c]=d.protocol.ChainInventory.BlockId.toObject(e.ids[c],t)}return e.remainNum!=null&&e.hasOwnProperty("remainNum")&&(typeof e.remainNum=="number"?n.remainNum=t.longs===String?String(e.remainNum):e.remainNum:n.remainNum=t.longs===String?i.Long.prototype.toString.call(e.remainNum):t.longs===Number?new i.LongBits(e.remainNum.low>>>0,e.remainNum.high>>>0).toNumber():e.remainNum),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r.BlockId=function(){function o(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return o.prototype.hash=i.newBuffer([]),o.prototype.number=i.Long?i.Long.fromBits(0,0,!1):0,o.create=function(t){return new o(t)},o.encode=function(t,n){return n||(n=H.create()),t.hash!=null&&Object.hasOwnProperty.call(t,"hash")&&n.uint32(10).bytes(t.hash),t.number!=null&&Object.hasOwnProperty.call(t,"number")&&n.uint32(16).int64(t.number),n},o.encodeDelimited=function(t,n){return this.encode(t,n).ldelim()},o.decode=function(t,n){t instanceof v||(t=v.create(t));for(var l=n===void 0?t.len:t.pos+n,c=new d.protocol.ChainInventory.BlockId;t.pos<l;){var u=t.uint32();switch(u>>>3){case 1:c.hash=t.bytes();break;case 2:c.number=t.int64();break;default:t.skipType(u&7);break}}return c},o.decodeDelimited=function(t){return t instanceof v||(t=new v(t)),this.decode(t,t.uint32())},o.verify=function(t){return typeof t!="object"||t===null?"object expected":t.hash!=null&&t.hasOwnProperty("hash")&&!(t.hash&&typeof t.hash.length=="number"||i.isString(t.hash))?"hash: buffer expected":t.number!=null&&t.hasOwnProperty("number")&&!i.isInteger(t.number)&&!(t.number&&i.isInteger(t.number.low)&&i.isInteger(t.number.high))?"number: integer|Long expected":null},o.fromObject=function(t){if(t instanceof d.protocol.ChainInventory.BlockId)return t;var n=new d.protocol.ChainInventory.BlockId;return t.hash!=null&&(typeof t.hash=="string"?i.base64.decode(t.hash,n.hash=i.newBuffer(i.base64.length(t.hash)),0):t.hash.length&&(n.hash=t.hash)),t.number!=null&&(i.Long?(n.number=i.Long.fromValue(t.number)).unsigned=!1:typeof t.number=="string"?n.number=parseInt(t.number,10):typeof t.number=="number"?n.number=t.number:typeof t.number=="object"&&(n.number=new i.LongBits(t.number.low>>>0,t.number.high>>>0).toNumber())),n},o.toObject=function(t,n){n||(n={});var l={};if(n.defaults)if(n.bytes===String?l.hash="":(l.hash=[],n.bytes!==Array&&(l.hash=i.newBuffer(l.hash))),i.Long){var c=new i.Long(0,0,!1);l.number=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.number=n.longs===String?"0":0;return t.hash!=null&&t.hasOwnProperty("hash")&&(l.hash=n.bytes===String?i.base64.encode(t.hash,0,t.hash.length):n.bytes===Array?Array.prototype.slice.call(t.hash):t.hash),t.number!=null&&t.hasOwnProperty("number")&&(typeof t.number=="number"?l.number=n.longs===String?String(t.number):t.number:l.number=n.longs===String?i.Long.prototype.toString.call(t.number):n.longs===Number?new i.LongBits(t.number.low>>>0,t.number.high>>>0).toNumber():t.number),l},o.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},o}(),r}(),f.BlockInventory=function(){function r(o){if(this.ids=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ids=i.emptyArray,r.prototype.type=0,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.ids!=null&&e.ids.length)for(var n=0;n<e.ids.length;++n)d.protocol.BlockInventory.BlockId.encode(e.ids[n],t.uint32(10).fork()).ldelim();return e.type!=null&&Object.hasOwnProperty.call(e,"type")&&t.uint32(16).int32(e.type),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.BlockInventory;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ids&&l.ids.length||(l.ids=[]),l.ids.push(d.protocol.BlockInventory.BlockId.decode(e,e.uint32()));break;case 2:l.type=e.int32();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.ids!=null&&e.hasOwnProperty("ids")){if(!Array.isArray(e.ids))return"ids: array expected";for(var t=0;t<e.ids.length;++t){var n=d.protocol.BlockInventory.BlockId.verify(e.ids[t]);if(n)return"ids."+n}}if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:break}return null},r.fromObject=function(e){if(e instanceof d.protocol.BlockInventory)return e;var t=new d.protocol.BlockInventory;if(e.ids){if(!Array.isArray(e.ids))throw TypeError(".protocol.BlockInventory.ids: array expected");t.ids=[];for(var n=0;n<e.ids.length;++n){if(typeof e.ids[n]!="object")throw TypeError(".protocol.BlockInventory.ids: object expected");t.ids[n]=d.protocol.BlockInventory.BlockId.fromObject(e.ids[n])}}switch(e.type){case"SYNC":case 0:t.type=0;break;case"ADVTISE":case 1:t.type=1;break;case"FETCH":case 2:t.type=2;break}return t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.ids=[]),t.defaults&&(n.type=t.enums===String?"SYNC":0),e.ids&&e.ids.length){n.ids=[];for(var l=0;l<e.ids.length;++l)n.ids[l]=d.protocol.BlockInventory.BlockId.toObject(e.ids[l],t)}return e.type!=null&&e.hasOwnProperty("type")&&(n.type=t.enums===String?d.protocol.BlockInventory.Type[e.type]:e.type),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r.Type=function(){var o={},e=Object.create(o);return e[o[0]="SYNC"]=0,e[o[1]="ADVTISE"]=1,e[o[2]="FETCH"]=2,e}(),r.BlockId=function(){function o(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return o.prototype.hash=i.newBuffer([]),o.prototype.number=i.Long?i.Long.fromBits(0,0,!1):0,o.create=function(t){return new o(t)},o.encode=function(t,n){return n||(n=H.create()),t.hash!=null&&Object.hasOwnProperty.call(t,"hash")&&n.uint32(10).bytes(t.hash),t.number!=null&&Object.hasOwnProperty.call(t,"number")&&n.uint32(16).int64(t.number),n},o.encodeDelimited=function(t,n){return this.encode(t,n).ldelim()},o.decode=function(t,n){t instanceof v||(t=v.create(t));for(var l=n===void 0?t.len:t.pos+n,c=new d.protocol.BlockInventory.BlockId;t.pos<l;){var u=t.uint32();switch(u>>>3){case 1:c.hash=t.bytes();break;case 2:c.number=t.int64();break;default:t.skipType(u&7);break}}return c},o.decodeDelimited=function(t){return t instanceof v||(t=new v(t)),this.decode(t,t.uint32())},o.verify=function(t){return typeof t!="object"||t===null?"object expected":t.hash!=null&&t.hasOwnProperty("hash")&&!(t.hash&&typeof t.hash.length=="number"||i.isString(t.hash))?"hash: buffer expected":t.number!=null&&t.hasOwnProperty("number")&&!i.isInteger(t.number)&&!(t.number&&i.isInteger(t.number.low)&&i.isInteger(t.number.high))?"number: integer|Long expected":null},o.fromObject=function(t){if(t instanceof d.protocol.BlockInventory.BlockId)return t;var n=new d.protocol.BlockInventory.BlockId;return t.hash!=null&&(typeof t.hash=="string"?i.base64.decode(t.hash,n.hash=i.newBuffer(i.base64.length(t.hash)),0):t.hash.length&&(n.hash=t.hash)),t.number!=null&&(i.Long?(n.number=i.Long.fromValue(t.number)).unsigned=!1:typeof t.number=="string"?n.number=parseInt(t.number,10):typeof t.number=="number"?n.number=t.number:typeof t.number=="object"&&(n.number=new i.LongBits(t.number.low>>>0,t.number.high>>>0).toNumber())),n},o.toObject=function(t,n){n||(n={});var l={};if(n.defaults)if(n.bytes===String?l.hash="":(l.hash=[],n.bytes!==Array&&(l.hash=i.newBuffer(l.hash))),i.Long){var c=new i.Long(0,0,!1);l.number=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.number=n.longs===String?"0":0;return t.hash!=null&&t.hasOwnProperty("hash")&&(l.hash=n.bytes===String?i.base64.encode(t.hash,0,t.hash.length):n.bytes===Array?Array.prototype.slice.call(t.hash):t.hash),t.number!=null&&t.hasOwnProperty("number")&&(typeof t.number=="number"?l.number=n.longs===String?String(t.number):t.number:l.number=n.longs===String?i.Long.prototype.toString.call(t.number):n.longs===Number?new i.LongBits(t.number.low>>>0,t.number.high>>>0).toNumber():t.number),l},o.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},o}(),r}(),f.Inventory=function(){function r(o){if(this.ids=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.type=0,r.prototype.ids=i.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).int32(e.type),e.ids!=null&&e.ids.length)for(var n=0;n<e.ids.length;++n)t.uint32(18).bytes(e.ids[n]);return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.Inventory;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.type=e.int32();break;case 2:l.ids&&l.ids.length||(l.ids=[]),l.ids.push(e.bytes());break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:break}if(e.ids!=null&&e.hasOwnProperty("ids")){if(!Array.isArray(e.ids))return"ids: array expected";for(var t=0;t<e.ids.length;++t)if(!(e.ids[t]&&typeof e.ids[t].length=="number"||i.isString(e.ids[t])))return"ids: buffer[] expected"}return null},r.fromObject=function(e){if(e instanceof d.protocol.Inventory)return e;var t=new d.protocol.Inventory;switch(e.type){case"TRX":case 0:t.type=0;break;case"BLOCK":case 1:t.type=1;break}if(e.ids){if(!Array.isArray(e.ids))throw TypeError(".protocol.Inventory.ids: array expected");t.ids=[];for(var n=0;n<e.ids.length;++n)typeof e.ids[n]=="string"?i.base64.decode(e.ids[n],t.ids[n]=i.newBuffer(i.base64.length(e.ids[n])),0):e.ids[n].length&&(t.ids[n]=e.ids[n])}return t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.ids=[]),t.defaults&&(n.type=t.enums===String?"TRX":0),e.type!=null&&e.hasOwnProperty("type")&&(n.type=t.enums===String?d.protocol.Inventory.InventoryType[e.type]:e.type),e.ids&&e.ids.length){n.ids=[];for(var l=0;l<e.ids.length;++l)n.ids[l]=t.bytes===String?i.base64.encode(e.ids[l],0,e.ids[l].length):t.bytes===Array?Array.prototype.slice.call(e.ids[l]):e.ids[l]}return n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r.InventoryType=function(){var o={},e=Object.create(o);return e[o[0]="TRX"]=0,e[o[1]="BLOCK"]=1,e}(),r}(),f.Items=function(){function r(o){if(this.blocks=[],this.blockHeaders=[],this.transactions=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.type=0,r.prototype.blocks=i.emptyArray,r.prototype.blockHeaders=i.emptyArray,r.prototype.transactions=i.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).int32(e.type),e.blocks!=null&&e.blocks.length)for(var n=0;n<e.blocks.length;++n)d.protocol.Block.encode(e.blocks[n],t.uint32(18).fork()).ldelim();if(e.blockHeaders!=null&&e.blockHeaders.length)for(var n=0;n<e.blockHeaders.length;++n)d.protocol.BlockHeader.encode(e.blockHeaders[n],t.uint32(26).fork()).ldelim();if(e.transactions!=null&&e.transactions.length)for(var n=0;n<e.transactions.length;++n)d.protocol.Transaction.encode(e.transactions[n],t.uint32(34).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.Items;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.type=e.int32();break;case 2:l.blocks&&l.blocks.length||(l.blocks=[]),l.blocks.push(d.protocol.Block.decode(e,e.uint32()));break;case 3:l.blockHeaders&&l.blockHeaders.length||(l.blockHeaders=[]),l.blockHeaders.push(d.protocol.BlockHeader.decode(e,e.uint32()));break;case 4:l.transactions&&l.transactions.length||(l.transactions=[]),l.transactions.push(d.protocol.Transaction.decode(e,e.uint32()));break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}if(e.blocks!=null&&e.hasOwnProperty("blocks")){if(!Array.isArray(e.blocks))return"blocks: array expected";for(var t=0;t<e.blocks.length;++t){var n=d.protocol.Block.verify(e.blocks[t]);if(n)return"blocks."+n}}if(e.blockHeaders!=null&&e.hasOwnProperty("blockHeaders")){if(!Array.isArray(e.blockHeaders))return"blockHeaders: array expected";for(var t=0;t<e.blockHeaders.length;++t){var n=d.protocol.BlockHeader.verify(e.blockHeaders[t]);if(n)return"blockHeaders."+n}}if(e.transactions!=null&&e.hasOwnProperty("transactions")){if(!Array.isArray(e.transactions))return"transactions: array expected";for(var t=0;t<e.transactions.length;++t){var n=d.protocol.Transaction.verify(e.transactions[t]);if(n)return"transactions."+n}}return null},r.fromObject=function(e){if(e instanceof d.protocol.Items)return e;var t=new d.protocol.Items;switch(e.type){case"ERR":case 0:t.type=0;break;case"TRX":case 1:t.type=1;break;case"BLOCK":case 2:t.type=2;break;case"BLOCKHEADER":case 3:t.type=3;break}if(e.blocks){if(!Array.isArray(e.blocks))throw TypeError(".protocol.Items.blocks: array expected");t.blocks=[];for(var n=0;n<e.blocks.length;++n){if(typeof e.blocks[n]!="object")throw TypeError(".protocol.Items.blocks: object expected");t.blocks[n]=d.protocol.Block.fromObject(e.blocks[n])}}if(e.blockHeaders){if(!Array.isArray(e.blockHeaders))throw TypeError(".protocol.Items.blockHeaders: array expected");t.blockHeaders=[];for(var n=0;n<e.blockHeaders.length;++n){if(typeof e.blockHeaders[n]!="object")throw TypeError(".protocol.Items.blockHeaders: object expected");t.blockHeaders[n]=d.protocol.BlockHeader.fromObject(e.blockHeaders[n])}}if(e.transactions){if(!Array.isArray(e.transactions))throw TypeError(".protocol.Items.transactions: array expected");t.transactions=[];for(var n=0;n<e.transactions.length;++n){if(typeof e.transactions[n]!="object")throw TypeError(".protocol.Items.transactions: object expected");t.transactions[n]=d.protocol.Transaction.fromObject(e.transactions[n])}}return t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.blocks=[],n.blockHeaders=[],n.transactions=[]),t.defaults&&(n.type=t.enums===String?"ERR":0),e.type!=null&&e.hasOwnProperty("type")&&(n.type=t.enums===String?d.protocol.Items.ItemType[e.type]:e.type),e.blocks&&e.blocks.length){n.blocks=[];for(var l=0;l<e.blocks.length;++l)n.blocks[l]=d.protocol.Block.toObject(e.blocks[l],t)}if(e.blockHeaders&&e.blockHeaders.length){n.blockHeaders=[];for(var l=0;l<e.blockHeaders.length;++l)n.blockHeaders[l]=d.protocol.BlockHeader.toObject(e.blockHeaders[l],t)}if(e.transactions&&e.transactions.length){n.transactions=[];for(var l=0;l<e.transactions.length;++l)n.transactions[l]=d.protocol.Transaction.toObject(e.transactions[l],t)}return n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r.ItemType=function(){var o={},e=Object.create(o);return e[o[0]="ERR"]=0,e[o[1]="TRX"]=1,e[o[2]="BLOCK"]=2,e[o[3]="BLOCKHEADER"]=3,e}(),r}(),f.DynamicProperties=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.lastSolidityBlockNum=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.lastSolidityBlockNum!=null&&Object.hasOwnProperty.call(e,"lastSolidityBlockNum")&&t.uint32(8).int64(e.lastSolidityBlockNum),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.DynamicProperties;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.lastSolidityBlockNum=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.lastSolidityBlockNum!=null&&e.hasOwnProperty("lastSolidityBlockNum")&&!i.isInteger(e.lastSolidityBlockNum)&&!(e.lastSolidityBlockNum&&i.isInteger(e.lastSolidityBlockNum.low)&&i.isInteger(e.lastSolidityBlockNum.high))?"lastSolidityBlockNum: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.DynamicProperties)return e;var t=new d.protocol.DynamicProperties;return e.lastSolidityBlockNum!=null&&(i.Long?(t.lastSolidityBlockNum=i.Long.fromValue(e.lastSolidityBlockNum)).unsigned=!1:typeof e.lastSolidityBlockNum=="string"?t.lastSolidityBlockNum=parseInt(e.lastSolidityBlockNum,10):typeof e.lastSolidityBlockNum=="number"?t.lastSolidityBlockNum=e.lastSolidityBlockNum:typeof e.lastSolidityBlockNum=="object"&&(t.lastSolidityBlockNum=new i.LongBits(e.lastSolidityBlockNum.low>>>0,e.lastSolidityBlockNum.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults)if(i.Long){var l=new i.Long(0,0,!1);n.lastSolidityBlockNum=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.lastSolidityBlockNum=t.longs===String?"0":0;return e.lastSolidityBlockNum!=null&&e.hasOwnProperty("lastSolidityBlockNum")&&(typeof e.lastSolidityBlockNum=="number"?n.lastSolidityBlockNum=t.longs===String?String(e.lastSolidityBlockNum):e.lastSolidityBlockNum:n.lastSolidityBlockNum=t.longs===String?i.Long.prototype.toString.call(e.lastSolidityBlockNum):t.longs===Number?new i.LongBits(e.lastSolidityBlockNum.low>>>0,e.lastSolidityBlockNum.high>>>0).toNumber():e.lastSolidityBlockNum),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.ReasonCode=function(){var r={},o=Object.create(r);return o[r[0]="REQUESTED"]=0,o[r[2]="BAD_PROTOCOL"]=2,o[r[4]="TOO_MANY_PEERS"]=4,o[r[5]="DUPLICATE_PEER"]=5,o[r[6]="INCOMPATIBLE_PROTOCOL"]=6,o[r[7]="NULL_IDENTITY"]=7,o[r[8]="PEER_QUITING"]=8,o[r[9]="UNEXPECTED_IDENTITY"]=9,o[r[10]="LOCAL_IDENTITY"]=10,o[r[11]="PING_TIMEOUT"]=11,o[r[16]="USER_REASON"]=16,o[r[17]="RESET"]=17,o[r[18]="SYNC_FAIL"]=18,o[r[19]="FETCH_FAIL"]=19,o[r[20]="BAD_TX"]=20,o[r[21]="BAD_BLOCK"]=21,o[r[22]="FORKED"]=22,o[r[23]="UNLINKABLE"]=23,o[r[24]="INCOMPATIBLE_VERSION"]=24,o[r[25]="INCOMPATIBLE_CHAIN"]=25,o[r[32]="TIME_OUT"]=32,o[r[33]="CONNECT_FAIL"]=33,o[r[34]="TOO_MANY_PEERS_WITH_SAME_IP"]=34,o[r[255]="UNKNOWN"]=255,o}(),f.DisconnectMessage=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.reason=0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.reason!=null&&Object.hasOwnProperty.call(e,"reason")&&t.uint32(8).int32(e.reason),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.DisconnectMessage;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.reason=e.int32();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.reason!=null&&e.hasOwnProperty("reason"))switch(e.reason){default:return"reason: enum value expected";case 0:case 2:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 32:case 33:case 34:case 255:break}return null},r.fromObject=function(e){if(e instanceof d.protocol.DisconnectMessage)return e;var t=new d.protocol.DisconnectMessage;switch(e.reason){case"REQUESTED":case 0:t.reason=0;break;case"BAD_PROTOCOL":case 2:t.reason=2;break;case"TOO_MANY_PEERS":case 4:t.reason=4;break;case"DUPLICATE_PEER":case 5:t.reason=5;break;case"INCOMPATIBLE_PROTOCOL":case 6:t.reason=6;break;case"NULL_IDENTITY":case 7:t.reason=7;break;case"PEER_QUITING":case 8:t.reason=8;break;case"UNEXPECTED_IDENTITY":case 9:t.reason=9;break;case"LOCAL_IDENTITY":case 10:t.reason=10;break;case"PING_TIMEOUT":case 11:t.reason=11;break;case"USER_REASON":case 16:t.reason=16;break;case"RESET":case 17:t.reason=17;break;case"SYNC_FAIL":case 18:t.reason=18;break;case"FETCH_FAIL":case 19:t.reason=19;break;case"BAD_TX":case 20:t.reason=20;break;case"BAD_BLOCK":case 21:t.reason=21;break;case"FORKED":case 22:t.reason=22;break;case"UNLINKABLE":case 23:t.reason=23;break;case"INCOMPATIBLE_VERSION":case 24:t.reason=24;break;case"INCOMPATIBLE_CHAIN":case 25:t.reason=25;break;case"TIME_OUT":case 32:t.reason=32;break;case"CONNECT_FAIL":case 33:t.reason=33;break;case"TOO_MANY_PEERS_WITH_SAME_IP":case 34:t.reason=34;break;case"UNKNOWN":case 255:t.reason=255;break}return t},r.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.reason=t.enums===String?"REQUESTED":0),e.reason!=null&&e.hasOwnProperty("reason")&&(n.reason=t.enums===String?d.protocol.ReasonCode[e.reason]:e.reason),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.HelloMessage=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.from=null,r.prototype.version=0,r.prototype.timestamp=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.genesisBlockId=null,r.prototype.solidBlockId=null,r.prototype.headBlockId=null,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.from!=null&&Object.hasOwnProperty.call(e,"from")&&d.protocol.Endpoint.encode(e.from,t.uint32(10).fork()).ldelim(),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&t.uint32(16).int32(e.version),e.timestamp!=null&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(24).int64(e.timestamp),e.genesisBlockId!=null&&Object.hasOwnProperty.call(e,"genesisBlockId")&&d.protocol.HelloMessage.BlockId.encode(e.genesisBlockId,t.uint32(34).fork()).ldelim(),e.solidBlockId!=null&&Object.hasOwnProperty.call(e,"solidBlockId")&&d.protocol.HelloMessage.BlockId.encode(e.solidBlockId,t.uint32(42).fork()).ldelim(),e.headBlockId!=null&&Object.hasOwnProperty.call(e,"headBlockId")&&d.protocol.HelloMessage.BlockId.encode(e.headBlockId,t.uint32(50).fork()).ldelim(),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.HelloMessage;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.from=d.protocol.Endpoint.decode(e,e.uint32());break;case 2:l.version=e.int32();break;case 3:l.timestamp=e.int64();break;case 4:l.genesisBlockId=d.protocol.HelloMessage.BlockId.decode(e,e.uint32());break;case 5:l.solidBlockId=d.protocol.HelloMessage.BlockId.decode(e,e.uint32());break;case 6:l.headBlockId=d.protocol.HelloMessage.BlockId.decode(e,e.uint32());break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.from!=null&&e.hasOwnProperty("from")){var t=d.protocol.Endpoint.verify(e.from);if(t)return"from."+t}if(e.version!=null&&e.hasOwnProperty("version")&&!i.isInteger(e.version))return"version: integer expected";if(e.timestamp!=null&&e.hasOwnProperty("timestamp")&&!i.isInteger(e.timestamp)&&!(e.timestamp&&i.isInteger(e.timestamp.low)&&i.isInteger(e.timestamp.high)))return"timestamp: integer|Long expected";if(e.genesisBlockId!=null&&e.hasOwnProperty("genesisBlockId")){var t=d.protocol.HelloMessage.BlockId.verify(e.genesisBlockId);if(t)return"genesisBlockId."+t}if(e.solidBlockId!=null&&e.hasOwnProperty("solidBlockId")){var t=d.protocol.HelloMessage.BlockId.verify(e.solidBlockId);if(t)return"solidBlockId."+t}if(e.headBlockId!=null&&e.hasOwnProperty("headBlockId")){var t=d.protocol.HelloMessage.BlockId.verify(e.headBlockId);if(t)return"headBlockId."+t}return null},r.fromObject=function(e){if(e instanceof d.protocol.HelloMessage)return e;var t=new d.protocol.HelloMessage;if(e.from!=null){if(typeof e.from!="object")throw TypeError(".protocol.HelloMessage.from: object expected");t.from=d.protocol.Endpoint.fromObject(e.from)}if(e.version!=null&&(t.version=e.version|0),e.timestamp!=null&&(i.Long?(t.timestamp=i.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?t.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?t.timestamp=e.timestamp:typeof e.timestamp=="object"&&(t.timestamp=new i.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),e.genesisBlockId!=null){if(typeof e.genesisBlockId!="object")throw TypeError(".protocol.HelloMessage.genesisBlockId: object expected");t.genesisBlockId=d.protocol.HelloMessage.BlockId.fromObject(e.genesisBlockId)}if(e.solidBlockId!=null){if(typeof e.solidBlockId!="object")throw TypeError(".protocol.HelloMessage.solidBlockId: object expected");t.solidBlockId=d.protocol.HelloMessage.BlockId.fromObject(e.solidBlockId)}if(e.headBlockId!=null){if(typeof e.headBlockId!="object")throw TypeError(".protocol.HelloMessage.headBlockId: object expected");t.headBlockId=d.protocol.HelloMessage.BlockId.fromObject(e.headBlockId)}return t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(n.from=null,n.version=0,i.Long){var l=new i.Long(0,0,!1);n.timestamp=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.timestamp=t.longs===String?"0":0;n.genesisBlockId=null,n.solidBlockId=null,n.headBlockId=null}return e.from!=null&&e.hasOwnProperty("from")&&(n.from=d.protocol.Endpoint.toObject(e.from,t)),e.version!=null&&e.hasOwnProperty("version")&&(n.version=e.version),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?n.timestamp=t.longs===String?String(e.timestamp):e.timestamp:n.timestamp=t.longs===String?i.Long.prototype.toString.call(e.timestamp):t.longs===Number?new i.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber():e.timestamp),e.genesisBlockId!=null&&e.hasOwnProperty("genesisBlockId")&&(n.genesisBlockId=d.protocol.HelloMessage.BlockId.toObject(e.genesisBlockId,t)),e.solidBlockId!=null&&e.hasOwnProperty("solidBlockId")&&(n.solidBlockId=d.protocol.HelloMessage.BlockId.toObject(e.solidBlockId,t)),e.headBlockId!=null&&e.hasOwnProperty("headBlockId")&&(n.headBlockId=d.protocol.HelloMessage.BlockId.toObject(e.headBlockId,t)),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r.BlockId=function(){function o(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return o.prototype.hash=i.newBuffer([]),o.prototype.number=i.Long?i.Long.fromBits(0,0,!1):0,o.create=function(t){return new o(t)},o.encode=function(t,n){return n||(n=H.create()),t.hash!=null&&Object.hasOwnProperty.call(t,"hash")&&n.uint32(10).bytes(t.hash),t.number!=null&&Object.hasOwnProperty.call(t,"number")&&n.uint32(16).int64(t.number),n},o.encodeDelimited=function(t,n){return this.encode(t,n).ldelim()},o.decode=function(t,n){t instanceof v||(t=v.create(t));for(var l=n===void 0?t.len:t.pos+n,c=new d.protocol.HelloMessage.BlockId;t.pos<l;){var u=t.uint32();switch(u>>>3){case 1:c.hash=t.bytes();break;case 2:c.number=t.int64();break;default:t.skipType(u&7);break}}return c},o.decodeDelimited=function(t){return t instanceof v||(t=new v(t)),this.decode(t,t.uint32())},o.verify=function(t){return typeof t!="object"||t===null?"object expected":t.hash!=null&&t.hasOwnProperty("hash")&&!(t.hash&&typeof t.hash.length=="number"||i.isString(t.hash))?"hash: buffer expected":t.number!=null&&t.hasOwnProperty("number")&&!i.isInteger(t.number)&&!(t.number&&i.isInteger(t.number.low)&&i.isInteger(t.number.high))?"number: integer|Long expected":null},o.fromObject=function(t){if(t instanceof d.protocol.HelloMessage.BlockId)return t;var n=new d.protocol.HelloMessage.BlockId;return t.hash!=null&&(typeof t.hash=="string"?i.base64.decode(t.hash,n.hash=i.newBuffer(i.base64.length(t.hash)),0):t.hash.length&&(n.hash=t.hash)),t.number!=null&&(i.Long?(n.number=i.Long.fromValue(t.number)).unsigned=!1:typeof t.number=="string"?n.number=parseInt(t.number,10):typeof t.number=="number"?n.number=t.number:typeof t.number=="object"&&(n.number=new i.LongBits(t.number.low>>>0,t.number.high>>>0).toNumber())),n},o.toObject=function(t,n){n||(n={});var l={};if(n.defaults)if(n.bytes===String?l.hash="":(l.hash=[],n.bytes!==Array&&(l.hash=i.newBuffer(l.hash))),i.Long){var c=new i.Long(0,0,!1);l.number=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.number=n.longs===String?"0":0;return t.hash!=null&&t.hasOwnProperty("hash")&&(l.hash=n.bytes===String?i.base64.encode(t.hash,0,t.hash.length):n.bytes===Array?Array.prototype.slice.call(t.hash):t.hash),t.number!=null&&t.hasOwnProperty("number")&&(typeof t.number=="number"?l.number=n.longs===String?String(t.number):t.number:l.number=n.longs===String?i.Long.prototype.toString.call(t.number):n.longs===Number?new i.LongBits(t.number.low>>>0,t.number.high>>>0).toNumber():t.number),l},o.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},o}(),r}(),f.SmartContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.originAddress=i.newBuffer([]),r.prototype.contractAddress=i.newBuffer([]),r.prototype.abi=null,r.prototype.bytecode=i.newBuffer([]),r.prototype.callValue=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.consumeUserResourcePercent=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.name="",r.prototype.originEnergyLimit=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.codeHash=i.newBuffer([]),r.prototype.trxHash=i.newBuffer([]),r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.originAddress!=null&&Object.hasOwnProperty.call(e,"originAddress")&&t.uint32(10).bytes(e.originAddress),e.contractAddress!=null&&Object.hasOwnProperty.call(e,"contractAddress")&&t.uint32(18).bytes(e.contractAddress),e.abi!=null&&Object.hasOwnProperty.call(e,"abi")&&d.protocol.SmartContract.ABI.encode(e.abi,t.uint32(26).fork()).ldelim(),e.bytecode!=null&&Object.hasOwnProperty.call(e,"bytecode")&&t.uint32(34).bytes(e.bytecode),e.callValue!=null&&Object.hasOwnProperty.call(e,"callValue")&&t.uint32(40).int64(e.callValue),e.consumeUserResourcePercent!=null&&Object.hasOwnProperty.call(e,"consumeUserResourcePercent")&&t.uint32(48).int64(e.consumeUserResourcePercent),e.name!=null&&Object.hasOwnProperty.call(e,"name")&&t.uint32(58).string(e.name),e.originEnergyLimit!=null&&Object.hasOwnProperty.call(e,"originEnergyLimit")&&t.uint32(64).int64(e.originEnergyLimit),e.codeHash!=null&&Object.hasOwnProperty.call(e,"codeHash")&&t.uint32(74).bytes(e.codeHash),e.trxHash!=null&&Object.hasOwnProperty.call(e,"trxHash")&&t.uint32(82).bytes(e.trxHash),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.SmartContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.originAddress=e.bytes();break;case 2:l.contractAddress=e.bytes();break;case 3:l.abi=d.protocol.SmartContract.ABI.decode(e,e.uint32());break;case 4:l.bytecode=e.bytes();break;case 5:l.callValue=e.int64();break;case 6:l.consumeUserResourcePercent=e.int64();break;case 7:l.name=e.string();break;case 8:l.originEnergyLimit=e.int64();break;case 9:l.codeHash=e.bytes();break;case 10:l.trxHash=e.bytes();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.originAddress!=null&&e.hasOwnProperty("originAddress")&&!(e.originAddress&&typeof e.originAddress.length=="number"||i.isString(e.originAddress)))return"originAddress: buffer expected";if(e.contractAddress!=null&&e.hasOwnProperty("contractAddress")&&!(e.contractAddress&&typeof e.contractAddress.length=="number"||i.isString(e.contractAddress)))return"contractAddress: buffer expected";if(e.abi!=null&&e.hasOwnProperty("abi")){var t=d.protocol.SmartContract.ABI.verify(e.abi);if(t)return"abi."+t}return e.bytecode!=null&&e.hasOwnProperty("bytecode")&&!(e.bytecode&&typeof e.bytecode.length=="number"||i.isString(e.bytecode))?"bytecode: buffer expected":e.callValue!=null&&e.hasOwnProperty("callValue")&&!i.isInteger(e.callValue)&&!(e.callValue&&i.isInteger(e.callValue.low)&&i.isInteger(e.callValue.high))?"callValue: integer|Long expected":e.consumeUserResourcePercent!=null&&e.hasOwnProperty("consumeUserResourcePercent")&&!i.isInteger(e.consumeUserResourcePercent)&&!(e.consumeUserResourcePercent&&i.isInteger(e.consumeUserResourcePercent.low)&&i.isInteger(e.consumeUserResourcePercent.high))?"consumeUserResourcePercent: integer|Long expected":e.name!=null&&e.hasOwnProperty("name")&&!i.isString(e.name)?"name: string expected":e.originEnergyLimit!=null&&e.hasOwnProperty("originEnergyLimit")&&!i.isInteger(e.originEnergyLimit)&&!(e.originEnergyLimit&&i.isInteger(e.originEnergyLimit.low)&&i.isInteger(e.originEnergyLimit.high))?"originEnergyLimit: integer|Long expected":e.codeHash!=null&&e.hasOwnProperty("codeHash")&&!(e.codeHash&&typeof e.codeHash.length=="number"||i.isString(e.codeHash))?"codeHash: buffer expected":e.trxHash!=null&&e.hasOwnProperty("trxHash")&&!(e.trxHash&&typeof e.trxHash.length=="number"||i.isString(e.trxHash))?"trxHash: buffer expected":null},r.fromObject=function(e){if(e instanceof d.protocol.SmartContract)return e;var t=new d.protocol.SmartContract;if(e.originAddress!=null&&(typeof e.originAddress=="string"?i.base64.decode(e.originAddress,t.originAddress=i.newBuffer(i.base64.length(e.originAddress)),0):e.originAddress.length&&(t.originAddress=e.originAddress)),e.contractAddress!=null&&(typeof e.contractAddress=="string"?i.base64.decode(e.contractAddress,t.contractAddress=i.newBuffer(i.base64.length(e.contractAddress)),0):e.contractAddress.length&&(t.contractAddress=e.contractAddress)),e.abi!=null){if(typeof e.abi!="object")throw TypeError(".protocol.SmartContract.abi: object expected");t.abi=d.protocol.SmartContract.ABI.fromObject(e.abi)}return e.bytecode!=null&&(typeof e.bytecode=="string"?i.base64.decode(e.bytecode,t.bytecode=i.newBuffer(i.base64.length(e.bytecode)),0):e.bytecode.length&&(t.bytecode=e.bytecode)),e.callValue!=null&&(i.Long?(t.callValue=i.Long.fromValue(e.callValue)).unsigned=!1:typeof e.callValue=="string"?t.callValue=parseInt(e.callValue,10):typeof e.callValue=="number"?t.callValue=e.callValue:typeof e.callValue=="object"&&(t.callValue=new i.LongBits(e.callValue.low>>>0,e.callValue.high>>>0).toNumber())),e.consumeUserResourcePercent!=null&&(i.Long?(t.consumeUserResourcePercent=i.Long.fromValue(e.consumeUserResourcePercent)).unsigned=!1:typeof e.consumeUserResourcePercent=="string"?t.consumeUserResourcePercent=parseInt(e.consumeUserResourcePercent,10):typeof e.consumeUserResourcePercent=="number"?t.consumeUserResourcePercent=e.consumeUserResourcePercent:typeof e.consumeUserResourcePercent=="object"&&(t.consumeUserResourcePercent=new i.LongBits(e.consumeUserResourcePercent.low>>>0,e.consumeUserResourcePercent.high>>>0).toNumber())),e.name!=null&&(t.name=String(e.name)),e.originEnergyLimit!=null&&(i.Long?(t.originEnergyLimit=i.Long.fromValue(e.originEnergyLimit)).unsigned=!1:typeof e.originEnergyLimit=="string"?t.originEnergyLimit=parseInt(e.originEnergyLimit,10):typeof e.originEnergyLimit=="number"?t.originEnergyLimit=e.originEnergyLimit:typeof e.originEnergyLimit=="object"&&(t.originEnergyLimit=new i.LongBits(e.originEnergyLimit.low>>>0,e.originEnergyLimit.high>>>0).toNumber())),e.codeHash!=null&&(typeof e.codeHash=="string"?i.base64.decode(e.codeHash,t.codeHash=i.newBuffer(i.base64.length(e.codeHash)),0):e.codeHash.length&&(t.codeHash=e.codeHash)),e.trxHash!=null&&(typeof e.trxHash=="string"?i.base64.decode(e.trxHash,t.trxHash=i.newBuffer(i.base64.length(e.trxHash)),0):e.trxHash.length&&(t.trxHash=e.trxHash)),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(t.bytes===String?n.originAddress="":(n.originAddress=[],t.bytes!==Array&&(n.originAddress=i.newBuffer(n.originAddress))),t.bytes===String?n.contractAddress="":(n.contractAddress=[],t.bytes!==Array&&(n.contractAddress=i.newBuffer(n.contractAddress))),n.abi=null,t.bytes===String?n.bytecode="":(n.bytecode=[],t.bytes!==Array&&(n.bytecode=i.newBuffer(n.bytecode))),i.Long){var l=new i.Long(0,0,!1);n.callValue=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.callValue=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.consumeUserResourcePercent=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.consumeUserResourcePercent=t.longs===String?"0":0;if(n.name="",i.Long){var l=new i.Long(0,0,!1);n.originEnergyLimit=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.originEnergyLimit=t.longs===String?"0":0;t.bytes===String?n.codeHash="":(n.codeHash=[],t.bytes!==Array&&(n.codeHash=i.newBuffer(n.codeHash))),t.bytes===String?n.trxHash="":(n.trxHash=[],t.bytes!==Array&&(n.trxHash=i.newBuffer(n.trxHash)))}return e.originAddress!=null&&e.hasOwnProperty("originAddress")&&(n.originAddress=t.bytes===String?i.base64.encode(e.originAddress,0,e.originAddress.length):t.bytes===Array?Array.prototype.slice.call(e.originAddress):e.originAddress),e.contractAddress!=null&&e.hasOwnProperty("contractAddress")&&(n.contractAddress=t.bytes===String?i.base64.encode(e.contractAddress,0,e.contractAddress.length):t.bytes===Array?Array.prototype.slice.call(e.contractAddress):e.contractAddress),e.abi!=null&&e.hasOwnProperty("abi")&&(n.abi=d.protocol.SmartContract.ABI.toObject(e.abi,t)),e.bytecode!=null&&e.hasOwnProperty("bytecode")&&(n.bytecode=t.bytes===String?i.base64.encode(e.bytecode,0,e.bytecode.length):t.bytes===Array?Array.prototype.slice.call(e.bytecode):e.bytecode),e.callValue!=null&&e.hasOwnProperty("callValue")&&(typeof e.callValue=="number"?n.callValue=t.longs===String?String(e.callValue):e.callValue:n.callValue=t.longs===String?i.Long.prototype.toString.call(e.callValue):t.longs===Number?new i.LongBits(e.callValue.low>>>0,e.callValue.high>>>0).toNumber():e.callValue),e.consumeUserResourcePercent!=null&&e.hasOwnProperty("consumeUserResourcePercent")&&(typeof e.consumeUserResourcePercent=="number"?n.consumeUserResourcePercent=t.longs===String?String(e.consumeUserResourcePercent):e.consumeUserResourcePercent:n.consumeUserResourcePercent=t.longs===String?i.Long.prototype.toString.call(e.consumeUserResourcePercent):t.longs===Number?new i.LongBits(e.consumeUserResourcePercent.low>>>0,e.consumeUserResourcePercent.high>>>0).toNumber():e.consumeUserResourcePercent),e.name!=null&&e.hasOwnProperty("name")&&(n.name=e.name),e.originEnergyLimit!=null&&e.hasOwnProperty("originEnergyLimit")&&(typeof e.originEnergyLimit=="number"?n.originEnergyLimit=t.longs===String?String(e.originEnergyLimit):e.originEnergyLimit:n.originEnergyLimit=t.longs===String?i.Long.prototype.toString.call(e.originEnergyLimit):t.longs===Number?new i.LongBits(e.originEnergyLimit.low>>>0,e.originEnergyLimit.high>>>0).toNumber():e.originEnergyLimit),e.codeHash!=null&&e.hasOwnProperty("codeHash")&&(n.codeHash=t.bytes===String?i.base64.encode(e.codeHash,0,e.codeHash.length):t.bytes===Array?Array.prototype.slice.call(e.codeHash):e.codeHash),e.trxHash!=null&&e.hasOwnProperty("trxHash")&&(n.trxHash=t.bytes===String?i.base64.encode(e.trxHash,0,e.trxHash.length):t.bytes===Array?Array.prototype.slice.call(e.trxHash):e.trxHash),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r.ABI=function(){function o(e){if(this.entrys=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return o.prototype.entrys=i.emptyArray,o.create=function(t){return new o(t)},o.encode=function(t,n){if(n||(n=H.create()),t.entrys!=null&&t.entrys.length)for(var l=0;l<t.entrys.length;++l)d.protocol.SmartContract.ABI.Entry.encode(t.entrys[l],n.uint32(10).fork()).ldelim();return n},o.encodeDelimited=function(t,n){return this.encode(t,n).ldelim()},o.decode=function(t,n){t instanceof v||(t=v.create(t));for(var l=n===void 0?t.len:t.pos+n,c=new d.protocol.SmartContract.ABI;t.pos<l;){var u=t.uint32();switch(u>>>3){case 1:c.entrys&&c.entrys.length||(c.entrys=[]),c.entrys.push(d.protocol.SmartContract.ABI.Entry.decode(t,t.uint32()));break;default:t.skipType(u&7);break}}return c},o.decodeDelimited=function(t){return t instanceof v||(t=new v(t)),this.decode(t,t.uint32())},o.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.entrys!=null&&t.hasOwnProperty("entrys")){if(!Array.isArray(t.entrys))return"entrys: array expected";for(var n=0;n<t.entrys.length;++n){var l=d.protocol.SmartContract.ABI.Entry.verify(t.entrys[n]);if(l)return"entrys."+l}}return null},o.fromObject=function(t){if(t instanceof d.protocol.SmartContract.ABI)return t;var n=new d.protocol.SmartContract.ABI;if(t.entrys){if(!Array.isArray(t.entrys))throw TypeError(".protocol.SmartContract.ABI.entrys: array expected");n.entrys=[];for(var l=0;l<t.entrys.length;++l){if(typeof t.entrys[l]!="object")throw TypeError(".protocol.SmartContract.ABI.entrys: object expected");n.entrys[l]=d.protocol.SmartContract.ABI.Entry.fromObject(t.entrys[l])}}return n},o.toObject=function(t,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.entrys=[]),t.entrys&&t.entrys.length){l.entrys=[];for(var c=0;c<t.entrys.length;++c)l.entrys[c]=d.protocol.SmartContract.ABI.Entry.toObject(t.entrys[c],n)}return l},o.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},o.Entry=function(){function e(t){if(this.inputs=[],this.outputs=[],t)for(var n=Object.keys(t),l=0;l<n.length;++l)t[n[l]]!=null&&(this[n[l]]=t[n[l]])}return e.prototype.anonymous=!1,e.prototype.constant=!1,e.prototype.name="",e.prototype.inputs=i.emptyArray,e.prototype.outputs=i.emptyArray,e.prototype.type=0,e.prototype.payable=!1,e.prototype.stateMutability=0,e.create=function(n){return new e(n)},e.encode=function(n,l){if(l||(l=H.create()),n.anonymous!=null&&Object.hasOwnProperty.call(n,"anonymous")&&l.uint32(8).bool(n.anonymous),n.constant!=null&&Object.hasOwnProperty.call(n,"constant")&&l.uint32(16).bool(n.constant),n.name!=null&&Object.hasOwnProperty.call(n,"name")&&l.uint32(26).string(n.name),n.inputs!=null&&n.inputs.length)for(var c=0;c<n.inputs.length;++c)d.protocol.SmartContract.ABI.Entry.Param.encode(n.inputs[c],l.uint32(34).fork()).ldelim();if(n.outputs!=null&&n.outputs.length)for(var c=0;c<n.outputs.length;++c)d.protocol.SmartContract.ABI.Entry.Param.encode(n.outputs[c],l.uint32(42).fork()).ldelim();return n.type!=null&&Object.hasOwnProperty.call(n,"type")&&l.uint32(48).int32(n.type),n.payable!=null&&Object.hasOwnProperty.call(n,"payable")&&l.uint32(56).bool(n.payable),n.stateMutability!=null&&Object.hasOwnProperty.call(n,"stateMutability")&&l.uint32(64).int32(n.stateMutability),l},e.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},e.decode=function(n,l){n instanceof v||(n=v.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.protocol.SmartContract.ABI.Entry;n.pos<c;){var b=n.uint32();switch(b>>>3){case 1:u.anonymous=n.bool();break;case 2:u.constant=n.bool();break;case 3:u.name=n.string();break;case 4:u.inputs&&u.inputs.length||(u.inputs=[]),u.inputs.push(d.protocol.SmartContract.ABI.Entry.Param.decode(n,n.uint32()));break;case 5:u.outputs&&u.outputs.length||(u.outputs=[]),u.outputs.push(d.protocol.SmartContract.ABI.Entry.Param.decode(n,n.uint32()));break;case 6:u.type=n.int32();break;case 7:u.payable=n.bool();break;case 8:u.stateMutability=n.int32();break;default:n.skipType(b&7);break}}return u},e.decodeDelimited=function(n){return n instanceof v||(n=new v(n)),this.decode(n,n.uint32())},e.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.anonymous!=null&&n.hasOwnProperty("anonymous")&&typeof n.anonymous!="boolean")return"anonymous: boolean expected";if(n.constant!=null&&n.hasOwnProperty("constant")&&typeof n.constant!="boolean")return"constant: boolean expected";if(n.name!=null&&n.hasOwnProperty("name")&&!i.isString(n.name))return"name: string expected";if(n.inputs!=null&&n.hasOwnProperty("inputs")){if(!Array.isArray(n.inputs))return"inputs: array expected";for(var l=0;l<n.inputs.length;++l){var c=d.protocol.SmartContract.ABI.Entry.Param.verify(n.inputs[l]);if(c)return"inputs."+c}}if(n.outputs!=null&&n.hasOwnProperty("outputs")){if(!Array.isArray(n.outputs))return"outputs: array expected";for(var l=0;l<n.outputs.length;++l){var c=d.protocol.SmartContract.ABI.Entry.Param.verify(n.outputs[l]);if(c)return"outputs."+c}}if(n.type!=null&&n.hasOwnProperty("type"))switch(n.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:case 4:break}if(n.payable!=null&&n.hasOwnProperty("payable")&&typeof n.payable!="boolean")return"payable: boolean expected";if(n.stateMutability!=null&&n.hasOwnProperty("stateMutability"))switch(n.stateMutability){default:return"stateMutability: enum value expected";case 0:case 1:case 2:case 3:case 4:break}return null},e.fromObject=function(n){if(n instanceof d.protocol.SmartContract.ABI.Entry)return n;var l=new d.protocol.SmartContract.ABI.Entry;if(n.anonymous!=null&&(l.anonymous=Boolean(n.anonymous)),n.constant!=null&&(l.constant=Boolean(n.constant)),n.name!=null&&(l.name=String(n.name)),n.inputs){if(!Array.isArray(n.inputs))throw TypeError(".protocol.SmartContract.ABI.Entry.inputs: array expected");l.inputs=[];for(var c=0;c<n.inputs.length;++c){if(typeof n.inputs[c]!="object")throw TypeError(".protocol.SmartContract.ABI.Entry.inputs: object expected");l.inputs[c]=d.protocol.SmartContract.ABI.Entry.Param.fromObject(n.inputs[c])}}if(n.outputs){if(!Array.isArray(n.outputs))throw TypeError(".protocol.SmartContract.ABI.Entry.outputs: array expected");l.outputs=[];for(var c=0;c<n.outputs.length;++c){if(typeof n.outputs[c]!="object")throw TypeError(".protocol.SmartContract.ABI.Entry.outputs: object expected");l.outputs[c]=d.protocol.SmartContract.ABI.Entry.Param.fromObject(n.outputs[c])}}switch(n.type){case"UnknownEntryType":case 0:l.type=0;break;case"Constructor":case 1:l.type=1;break;case"Function":case 2:l.type=2;break;case"Event":case 3:l.type=3;break;case"Fallback":case 4:l.type=4;break}switch(n.payable!=null&&(l.payable=Boolean(n.payable)),n.stateMutability){case"UnknownMutabilityType":case 0:l.stateMutability=0;break;case"Pure":case 1:l.stateMutability=1;break;case"View":case 2:l.stateMutability=2;break;case"Nonpayable":case 3:l.stateMutability=3;break;case"Payable":case 4:l.stateMutability=4;break}return l},e.toObject=function(n,l){l||(l={});var c={};if((l.arrays||l.defaults)&&(c.inputs=[],c.outputs=[]),l.defaults&&(c.anonymous=!1,c.constant=!1,c.name="",c.type=l.enums===String?"UnknownEntryType":0,c.payable=!1,c.stateMutability=l.enums===String?"UnknownMutabilityType":0),n.anonymous!=null&&n.hasOwnProperty("anonymous")&&(c.anonymous=n.anonymous),n.constant!=null&&n.hasOwnProperty("constant")&&(c.constant=n.constant),n.name!=null&&n.hasOwnProperty("name")&&(c.name=n.name),n.inputs&&n.inputs.length){c.inputs=[];for(var u=0;u<n.inputs.length;++u)c.inputs[u]=d.protocol.SmartContract.ABI.Entry.Param.toObject(n.inputs[u],l)}if(n.outputs&&n.outputs.length){c.outputs=[];for(var u=0;u<n.outputs.length;++u)c.outputs[u]=d.protocol.SmartContract.ABI.Entry.Param.toObject(n.outputs[u],l)}return n.type!=null&&n.hasOwnProperty("type")&&(c.type=l.enums===String?d.protocol.SmartContract.ABI.Entry.EntryType[n.type]:n.type),n.payable!=null&&n.hasOwnProperty("payable")&&(c.payable=n.payable),n.stateMutability!=null&&n.hasOwnProperty("stateMutability")&&(c.stateMutability=l.enums===String?d.protocol.SmartContract.ABI.Entry.StateMutabilityType[n.stateMutability]:n.stateMutability),c},e.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},e.EntryType=function(){var t={},n=Object.create(t);return n[t[0]="UnknownEntryType"]=0,n[t[1]="Constructor"]=1,n[t[2]="Function"]=2,n[t[3]="Event"]=3,n[t[4]="Fallback"]=4,n}(),e.Param=function(){function t(n){if(n)for(var l=Object.keys(n),c=0;c<l.length;++c)n[l[c]]!=null&&(this[l[c]]=n[l[c]])}return t.prototype.indexed=!1,t.prototype.name="",t.prototype.type="",t.create=function(l){return new t(l)},t.encode=function(l,c){return c||(c=H.create()),l.indexed!=null&&Object.hasOwnProperty.call(l,"indexed")&&c.uint32(8).bool(l.indexed),l.name!=null&&Object.hasOwnProperty.call(l,"name")&&c.uint32(18).string(l.name),l.type!=null&&Object.hasOwnProperty.call(l,"type")&&c.uint32(26).string(l.type),c},t.encodeDelimited=function(l,c){return this.encode(l,c).ldelim()},t.decode=function(l,c){l instanceof v||(l=v.create(l));for(var u=c===void 0?l.len:l.pos+c,b=new d.protocol.SmartContract.ABI.Entry.Param;l.pos<u;){var A=l.uint32();switch(A>>>3){case 1:b.indexed=l.bool();break;case 2:b.name=l.string();break;case 3:b.type=l.string();break;default:l.skipType(A&7);break}}return b},t.decodeDelimited=function(l){return l instanceof v||(l=new v(l)),this.decode(l,l.uint32())},t.verify=function(l){return typeof l!="object"||l===null?"object expected":l.indexed!=null&&l.hasOwnProperty("indexed")&&typeof l.indexed!="boolean"?"indexed: boolean expected":l.name!=null&&l.hasOwnProperty("name")&&!i.isString(l.name)?"name: string expected":l.type!=null&&l.hasOwnProperty("type")&&!i.isString(l.type)?"type: string expected":null},t.fromObject=function(l){if(l instanceof d.protocol.SmartContract.ABI.Entry.Param)return l;var c=new d.protocol.SmartContract.ABI.Entry.Param;return l.indexed!=null&&(c.indexed=Boolean(l.indexed)),l.name!=null&&(c.name=String(l.name)),l.type!=null&&(c.type=String(l.type)),c},t.toObject=function(l,c){c||(c={});var u={};return c.defaults&&(u.indexed=!1,u.name="",u.type=""),l.indexed!=null&&l.hasOwnProperty("indexed")&&(u.indexed=l.indexed),l.name!=null&&l.hasOwnProperty("name")&&(u.name=l.name),l.type!=null&&l.hasOwnProperty("type")&&(u.type=l.type),u},t.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},t}(),e.StateMutabilityType=function(){var t={},n=Object.create(t);return n[t[0]="UnknownMutabilityType"]=0,n[t[1]="Pure"]=1,n[t[2]="View"]=2,n[t[3]="Nonpayable"]=3,n[t[4]="Payable"]=4,n}(),e}(),o}(),r}(),f.InternalTransaction=function(){function r(o){if(this.callValueInfo=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.hash=i.newBuffer([]),r.prototype.callerAddress=i.newBuffer([]),r.prototype.transferToAddress=i.newBuffer([]),r.prototype.callValueInfo=i.emptyArray,r.prototype.note=i.newBuffer([]),r.prototype.rejected=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.hash!=null&&Object.hasOwnProperty.call(e,"hash")&&t.uint32(10).bytes(e.hash),e.callerAddress!=null&&Object.hasOwnProperty.call(e,"callerAddress")&&t.uint32(18).bytes(e.callerAddress),e.transferToAddress!=null&&Object.hasOwnProperty.call(e,"transferToAddress")&&t.uint32(26).bytes(e.transferToAddress),e.callValueInfo!=null&&e.callValueInfo.length)for(var n=0;n<e.callValueInfo.length;++n)d.protocol.InternalTransaction.CallValueInfo.encode(e.callValueInfo[n],t.uint32(34).fork()).ldelim();return e.note!=null&&Object.hasOwnProperty.call(e,"note")&&t.uint32(42).bytes(e.note),e.rejected!=null&&Object.hasOwnProperty.call(e,"rejected")&&t.uint32(48).bool(e.rejected),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.InternalTransaction;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.hash=e.bytes();break;case 2:l.callerAddress=e.bytes();break;case 3:l.transferToAddress=e.bytes();break;case 4:l.callValueInfo&&l.callValueInfo.length||(l.callValueInfo=[]),l.callValueInfo.push(d.protocol.InternalTransaction.CallValueInfo.decode(e,e.uint32()));break;case 5:l.note=e.bytes();break;case 6:l.rejected=e.bool();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.hash!=null&&e.hasOwnProperty("hash")&&!(e.hash&&typeof e.hash.length=="number"||i.isString(e.hash)))return"hash: buffer expected";if(e.callerAddress!=null&&e.hasOwnProperty("callerAddress")&&!(e.callerAddress&&typeof e.callerAddress.length=="number"||i.isString(e.callerAddress)))return"callerAddress: buffer expected";if(e.transferToAddress!=null&&e.hasOwnProperty("transferToAddress")&&!(e.transferToAddress&&typeof e.transferToAddress.length=="number"||i.isString(e.transferToAddress)))return"transferToAddress: buffer expected";if(e.callValueInfo!=null&&e.hasOwnProperty("callValueInfo")){if(!Array.isArray(e.callValueInfo))return"callValueInfo: array expected";for(var t=0;t<e.callValueInfo.length;++t){var n=d.protocol.InternalTransaction.CallValueInfo.verify(e.callValueInfo[t]);if(n)return"callValueInfo."+n}}return e.note!=null&&e.hasOwnProperty("note")&&!(e.note&&typeof e.note.length=="number"||i.isString(e.note))?"note: buffer expected":e.rejected!=null&&e.hasOwnProperty("rejected")&&typeof e.rejected!="boolean"?"rejected: boolean expected":null},r.fromObject=function(e){if(e instanceof d.protocol.InternalTransaction)return e;var t=new d.protocol.InternalTransaction;if(e.hash!=null&&(typeof e.hash=="string"?i.base64.decode(e.hash,t.hash=i.newBuffer(i.base64.length(e.hash)),0):e.hash.length&&(t.hash=e.hash)),e.callerAddress!=null&&(typeof e.callerAddress=="string"?i.base64.decode(e.callerAddress,t.callerAddress=i.newBuffer(i.base64.length(e.callerAddress)),0):e.callerAddress.length&&(t.callerAddress=e.callerAddress)),e.transferToAddress!=null&&(typeof e.transferToAddress=="string"?i.base64.decode(e.transferToAddress,t.transferToAddress=i.newBuffer(i.base64.length(e.transferToAddress)),0):e.transferToAddress.length&&(t.transferToAddress=e.transferToAddress)),e.callValueInfo){if(!Array.isArray(e.callValueInfo))throw TypeError(".protocol.InternalTransaction.callValueInfo: array expected");t.callValueInfo=[];for(var n=0;n<e.callValueInfo.length;++n){if(typeof e.callValueInfo[n]!="object")throw TypeError(".protocol.InternalTransaction.callValueInfo: object expected");t.callValueInfo[n]=d.protocol.InternalTransaction.CallValueInfo.fromObject(e.callValueInfo[n])}}return e.note!=null&&(typeof e.note=="string"?i.base64.decode(e.note,t.note=i.newBuffer(i.base64.length(e.note)),0):e.note.length&&(t.note=e.note)),e.rejected!=null&&(t.rejected=Boolean(e.rejected)),t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.callValueInfo=[]),t.defaults&&(t.bytes===String?n.hash="":(n.hash=[],t.bytes!==Array&&(n.hash=i.newBuffer(n.hash))),t.bytes===String?n.callerAddress="":(n.callerAddress=[],t.bytes!==Array&&(n.callerAddress=i.newBuffer(n.callerAddress))),t.bytes===String?n.transferToAddress="":(n.transferToAddress=[],t.bytes!==Array&&(n.transferToAddress=i.newBuffer(n.transferToAddress))),t.bytes===String?n.note="":(n.note=[],t.bytes!==Array&&(n.note=i.newBuffer(n.note))),n.rejected=!1),e.hash!=null&&e.hasOwnProperty("hash")&&(n.hash=t.bytes===String?i.base64.encode(e.hash,0,e.hash.length):t.bytes===Array?Array.prototype.slice.call(e.hash):e.hash),e.callerAddress!=null&&e.hasOwnProperty("callerAddress")&&(n.callerAddress=t.bytes===String?i.base64.encode(e.callerAddress,0,e.callerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.callerAddress):e.callerAddress),e.transferToAddress!=null&&e.hasOwnProperty("transferToAddress")&&(n.transferToAddress=t.bytes===String?i.base64.encode(e.transferToAddress,0,e.transferToAddress.length):t.bytes===Array?Array.prototype.slice.call(e.transferToAddress):e.transferToAddress),e.callValueInfo&&e.callValueInfo.length){n.callValueInfo=[];for(var l=0;l<e.callValueInfo.length;++l)n.callValueInfo[l]=d.protocol.InternalTransaction.CallValueInfo.toObject(e.callValueInfo[l],t)}return e.note!=null&&e.hasOwnProperty("note")&&(n.note=t.bytes===String?i.base64.encode(e.note,0,e.note.length):t.bytes===Array?Array.prototype.slice.call(e.note):e.note),e.rejected!=null&&e.hasOwnProperty("rejected")&&(n.rejected=e.rejected),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r.CallValueInfo=function(){function o(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return o.prototype.callValue=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.tokenId="",o.create=function(t){return new o(t)},o.encode=function(t,n){return n||(n=H.create()),t.callValue!=null&&Object.hasOwnProperty.call(t,"callValue")&&n.uint32(8).int64(t.callValue),t.tokenId!=null&&Object.hasOwnProperty.call(t,"tokenId")&&n.uint32(18).string(t.tokenId),n},o.encodeDelimited=function(t,n){return this.encode(t,n).ldelim()},o.decode=function(t,n){t instanceof v||(t=v.create(t));for(var l=n===void 0?t.len:t.pos+n,c=new d.protocol.InternalTransaction.CallValueInfo;t.pos<l;){var u=t.uint32();switch(u>>>3){case 1:c.callValue=t.int64();break;case 2:c.tokenId=t.string();break;default:t.skipType(u&7);break}}return c},o.decodeDelimited=function(t){return t instanceof v||(t=new v(t)),this.decode(t,t.uint32())},o.verify=function(t){return typeof t!="object"||t===null?"object expected":t.callValue!=null&&t.hasOwnProperty("callValue")&&!i.isInteger(t.callValue)&&!(t.callValue&&i.isInteger(t.callValue.low)&&i.isInteger(t.callValue.high))?"callValue: integer|Long expected":t.tokenId!=null&&t.hasOwnProperty("tokenId")&&!i.isString(t.tokenId)?"tokenId: string expected":null},o.fromObject=function(t){if(t instanceof d.protocol.InternalTransaction.CallValueInfo)return t;var n=new d.protocol.InternalTransaction.CallValueInfo;return t.callValue!=null&&(i.Long?(n.callValue=i.Long.fromValue(t.callValue)).unsigned=!1:typeof t.callValue=="string"?n.callValue=parseInt(t.callValue,10):typeof t.callValue=="number"?n.callValue=t.callValue:typeof t.callValue=="object"&&(n.callValue=new i.LongBits(t.callValue.low>>>0,t.callValue.high>>>0).toNumber())),t.tokenId!=null&&(n.tokenId=String(t.tokenId)),n},o.toObject=function(t,n){n||(n={});var l={};if(n.defaults){if(i.Long){var c=new i.Long(0,0,!1);l.callValue=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.callValue=n.longs===String?"0":0;l.tokenId=""}return t.callValue!=null&&t.hasOwnProperty("callValue")&&(typeof t.callValue=="number"?l.callValue=n.longs===String?String(t.callValue):t.callValue:l.callValue=n.longs===String?i.Long.prototype.toString.call(t.callValue):n.longs===Number?new i.LongBits(t.callValue.low>>>0,t.callValue.high>>>0).toNumber():t.callValue),t.tokenId!=null&&t.hasOwnProperty("tokenId")&&(l.tokenId=t.tokenId),l},o.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},o}(),r}(),f.DelegatedResourceAccountIndex=function(){function r(o){if(this.fromAccounts=[],this.toAccounts=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.account=i.newBuffer([]),r.prototype.fromAccounts=i.emptyArray,r.prototype.toAccounts=i.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.account!=null&&Object.hasOwnProperty.call(e,"account")&&t.uint32(10).bytes(e.account),e.fromAccounts!=null&&e.fromAccounts.length)for(var n=0;n<e.fromAccounts.length;++n)t.uint32(18).bytes(e.fromAccounts[n]);if(e.toAccounts!=null&&e.toAccounts.length)for(var n=0;n<e.toAccounts.length;++n)t.uint32(26).bytes(e.toAccounts[n]);return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.DelegatedResourceAccountIndex;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.account=e.bytes();break;case 2:l.fromAccounts&&l.fromAccounts.length||(l.fromAccounts=[]),l.fromAccounts.push(e.bytes());break;case 3:l.toAccounts&&l.toAccounts.length||(l.toAccounts=[]),l.toAccounts.push(e.bytes());break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.account!=null&&e.hasOwnProperty("account")&&!(e.account&&typeof e.account.length=="number"||i.isString(e.account)))return"account: buffer expected";if(e.fromAccounts!=null&&e.hasOwnProperty("fromAccounts")){if(!Array.isArray(e.fromAccounts))return"fromAccounts: array expected";for(var t=0;t<e.fromAccounts.length;++t)if(!(e.fromAccounts[t]&&typeof e.fromAccounts[t].length=="number"||i.isString(e.fromAccounts[t])))return"fromAccounts: buffer[] expected"}if(e.toAccounts!=null&&e.hasOwnProperty("toAccounts")){if(!Array.isArray(e.toAccounts))return"toAccounts: array expected";for(var t=0;t<e.toAccounts.length;++t)if(!(e.toAccounts[t]&&typeof e.toAccounts[t].length=="number"||i.isString(e.toAccounts[t])))return"toAccounts: buffer[] expected"}return null},r.fromObject=function(e){if(e instanceof d.protocol.DelegatedResourceAccountIndex)return e;var t=new d.protocol.DelegatedResourceAccountIndex;if(e.account!=null&&(typeof e.account=="string"?i.base64.decode(e.account,t.account=i.newBuffer(i.base64.length(e.account)),0):e.account.length&&(t.account=e.account)),e.fromAccounts){if(!Array.isArray(e.fromAccounts))throw TypeError(".protocol.DelegatedResourceAccountIndex.fromAccounts: array expected");t.fromAccounts=[];for(var n=0;n<e.fromAccounts.length;++n)typeof e.fromAccounts[n]=="string"?i.base64.decode(e.fromAccounts[n],t.fromAccounts[n]=i.newBuffer(i.base64.length(e.fromAccounts[n])),0):e.fromAccounts[n].length&&(t.fromAccounts[n]=e.fromAccounts[n])}if(e.toAccounts){if(!Array.isArray(e.toAccounts))throw TypeError(".protocol.DelegatedResourceAccountIndex.toAccounts: array expected");t.toAccounts=[];for(var n=0;n<e.toAccounts.length;++n)typeof e.toAccounts[n]=="string"?i.base64.decode(e.toAccounts[n],t.toAccounts[n]=i.newBuffer(i.base64.length(e.toAccounts[n])),0):e.toAccounts[n].length&&(t.toAccounts[n]=e.toAccounts[n])}return t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.fromAccounts=[],n.toAccounts=[]),t.defaults&&(t.bytes===String?n.account="":(n.account=[],t.bytes!==Array&&(n.account=i.newBuffer(n.account)))),e.account!=null&&e.hasOwnProperty("account")&&(n.account=t.bytes===String?i.base64.encode(e.account,0,e.account.length):t.bytes===Array?Array.prototype.slice.call(e.account):e.account),e.fromAccounts&&e.fromAccounts.length){n.fromAccounts=[];for(var l=0;l<e.fromAccounts.length;++l)n.fromAccounts[l]=t.bytes===String?i.base64.encode(e.fromAccounts[l],0,e.fromAccounts[l].length):t.bytes===Array?Array.prototype.slice.call(e.fromAccounts[l]):e.fromAccounts[l]}if(e.toAccounts&&e.toAccounts.length){n.toAccounts=[];for(var l=0;l<e.toAccounts.length;++l)n.toAccounts[l]=t.bytes===String?i.base64.encode(e.toAccounts[l],0,e.toAccounts[l].length):t.bytes===Array?Array.prototype.slice.call(e.toAccounts[l]):e.toAccounts[l]}return n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.NodeInfo=function(){function r(o){if(this.peerInfoList=[],this.cheatWitnessInfoMap={},o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.beginSyncNum=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.block="",r.prototype.solidityBlock="",r.prototype.currentConnectCount=0,r.prototype.activeConnectCount=0,r.prototype.passiveConnectCount=0,r.prototype.totalFlow=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.peerInfoList=i.emptyArray,r.prototype.configNodeInfo=null,r.prototype.machineInfo=null,r.prototype.cheatWitnessInfoMap=i.emptyObject,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.beginSyncNum!=null&&Object.hasOwnProperty.call(e,"beginSyncNum")&&t.uint32(8).int64(e.beginSyncNum),e.block!=null&&Object.hasOwnProperty.call(e,"block")&&t.uint32(18).string(e.block),e.solidityBlock!=null&&Object.hasOwnProperty.call(e,"solidityBlock")&&t.uint32(26).string(e.solidityBlock),e.currentConnectCount!=null&&Object.hasOwnProperty.call(e,"currentConnectCount")&&t.uint32(32).int32(e.currentConnectCount),e.activeConnectCount!=null&&Object.hasOwnProperty.call(e,"activeConnectCount")&&t.uint32(40).int32(e.activeConnectCount),e.passiveConnectCount!=null&&Object.hasOwnProperty.call(e,"passiveConnectCount")&&t.uint32(48).int32(e.passiveConnectCount),e.totalFlow!=null&&Object.hasOwnProperty.call(e,"totalFlow")&&t.uint32(56).int64(e.totalFlow),e.peerInfoList!=null&&e.peerInfoList.length)for(var n=0;n<e.peerInfoList.length;++n)d.protocol.NodeInfo.PeerInfo.encode(e.peerInfoList[n],t.uint32(66).fork()).ldelim();if(e.configNodeInfo!=null&&Object.hasOwnProperty.call(e,"configNodeInfo")&&d.protocol.NodeInfo.ConfigNodeInfo.encode(e.configNodeInfo,t.uint32(74).fork()).ldelim(),e.machineInfo!=null&&Object.hasOwnProperty.call(e,"machineInfo")&&d.protocol.NodeInfo.MachineInfo.encode(e.machineInfo,t.uint32(82).fork()).ldelim(),e.cheatWitnessInfoMap!=null&&Object.hasOwnProperty.call(e,"cheatWitnessInfoMap"))for(var l=Object.keys(e.cheatWitnessInfoMap),n=0;n<l.length;++n)t.uint32(90).fork().uint32(10).string(l[n]).uint32(18).string(e.cheatWitnessInfoMap[l[n]]).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.NodeInfo,c,u;e.pos<n;){var b=e.uint32();switch(b>>>3){case 1:l.beginSyncNum=e.int64();break;case 2:l.block=e.string();break;case 3:l.solidityBlock=e.string();break;case 4:l.currentConnectCount=e.int32();break;case 5:l.activeConnectCount=e.int32();break;case 6:l.passiveConnectCount=e.int32();break;case 7:l.totalFlow=e.int64();break;case 8:l.peerInfoList&&l.peerInfoList.length||(l.peerInfoList=[]),l.peerInfoList.push(d.protocol.NodeInfo.PeerInfo.decode(e,e.uint32()));break;case 9:l.configNodeInfo=d.protocol.NodeInfo.ConfigNodeInfo.decode(e,e.uint32());break;case 10:l.machineInfo=d.protocol.NodeInfo.MachineInfo.decode(e,e.uint32());break;case 11:l.cheatWitnessInfoMap===i.emptyObject&&(l.cheatWitnessInfoMap={});var A=e.uint32()+e.pos;for(c="",u="";e.pos<A;){var w=e.uint32();switch(w>>>3){case 1:c=e.string();break;case 2:u=e.string();break;default:e.skipType(w&7);break}}l.cheatWitnessInfoMap[c]=u;break;default:e.skipType(b&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.beginSyncNum!=null&&e.hasOwnProperty("beginSyncNum")&&!i.isInteger(e.beginSyncNum)&&!(e.beginSyncNum&&i.isInteger(e.beginSyncNum.low)&&i.isInteger(e.beginSyncNum.high)))return"beginSyncNum: integer|Long expected";if(e.block!=null&&e.hasOwnProperty("block")&&!i.isString(e.block))return"block: string expected";if(e.solidityBlock!=null&&e.hasOwnProperty("solidityBlock")&&!i.isString(e.solidityBlock))return"solidityBlock: string expected";if(e.currentConnectCount!=null&&e.hasOwnProperty("currentConnectCount")&&!i.isInteger(e.currentConnectCount))return"currentConnectCount: integer expected";if(e.activeConnectCount!=null&&e.hasOwnProperty("activeConnectCount")&&!i.isInteger(e.activeConnectCount))return"activeConnectCount: integer expected";if(e.passiveConnectCount!=null&&e.hasOwnProperty("passiveConnectCount")&&!i.isInteger(e.passiveConnectCount))return"passiveConnectCount: integer expected";if(e.totalFlow!=null&&e.hasOwnProperty("totalFlow")&&!i.isInteger(e.totalFlow)&&!(e.totalFlow&&i.isInteger(e.totalFlow.low)&&i.isInteger(e.totalFlow.high)))return"totalFlow: integer|Long expected";if(e.peerInfoList!=null&&e.hasOwnProperty("peerInfoList")){if(!Array.isArray(e.peerInfoList))return"peerInfoList: array expected";for(var t=0;t<e.peerInfoList.length;++t){var n=d.protocol.NodeInfo.PeerInfo.verify(e.peerInfoList[t]);if(n)return"peerInfoList."+n}}if(e.configNodeInfo!=null&&e.hasOwnProperty("configNodeInfo")){var n=d.protocol.NodeInfo.ConfigNodeInfo.verify(e.configNodeInfo);if(n)return"configNodeInfo."+n}if(e.machineInfo!=null&&e.hasOwnProperty("machineInfo")){var n=d.protocol.NodeInfo.MachineInfo.verify(e.machineInfo);if(n)return"machineInfo."+n}if(e.cheatWitnessInfoMap!=null&&e.hasOwnProperty("cheatWitnessInfoMap")){if(!i.isObject(e.cheatWitnessInfoMap))return"cheatWitnessInfoMap: object expected";for(var l=Object.keys(e.cheatWitnessInfoMap),t=0;t<l.length;++t)if(!i.isString(e.cheatWitnessInfoMap[l[t]]))return"cheatWitnessInfoMap: string{k:string} expected"}return null},r.fromObject=function(e){if(e instanceof d.protocol.NodeInfo)return e;var t=new d.protocol.NodeInfo;if(e.beginSyncNum!=null&&(i.Long?(t.beginSyncNum=i.Long.fromValue(e.beginSyncNum)).unsigned=!1:typeof e.beginSyncNum=="string"?t.beginSyncNum=parseInt(e.beginSyncNum,10):typeof e.beginSyncNum=="number"?t.beginSyncNum=e.beginSyncNum:typeof e.beginSyncNum=="object"&&(t.beginSyncNum=new i.LongBits(e.beginSyncNum.low>>>0,e.beginSyncNum.high>>>0).toNumber())),e.block!=null&&(t.block=String(e.block)),e.solidityBlock!=null&&(t.solidityBlock=String(e.solidityBlock)),e.currentConnectCount!=null&&(t.currentConnectCount=e.currentConnectCount|0),e.activeConnectCount!=null&&(t.activeConnectCount=e.activeConnectCount|0),e.passiveConnectCount!=null&&(t.passiveConnectCount=e.passiveConnectCount|0),e.totalFlow!=null&&(i.Long?(t.totalFlow=i.Long.fromValue(e.totalFlow)).unsigned=!1:typeof e.totalFlow=="string"?t.totalFlow=parseInt(e.totalFlow,10):typeof e.totalFlow=="number"?t.totalFlow=e.totalFlow:typeof e.totalFlow=="object"&&(t.totalFlow=new i.LongBits(e.totalFlow.low>>>0,e.totalFlow.high>>>0).toNumber())),e.peerInfoList){if(!Array.isArray(e.peerInfoList))throw TypeError(".protocol.NodeInfo.peerInfoList: array expected");t.peerInfoList=[];for(var n=0;n<e.peerInfoList.length;++n){if(typeof e.peerInfoList[n]!="object")throw TypeError(".protocol.NodeInfo.peerInfoList: object expected");t.peerInfoList[n]=d.protocol.NodeInfo.PeerInfo.fromObject(e.peerInfoList[n])}}if(e.configNodeInfo!=null){if(typeof e.configNodeInfo!="object")throw TypeError(".protocol.NodeInfo.configNodeInfo: object expected");t.configNodeInfo=d.protocol.NodeInfo.ConfigNodeInfo.fromObject(e.configNodeInfo)}if(e.machineInfo!=null){if(typeof e.machineInfo!="object")throw TypeError(".protocol.NodeInfo.machineInfo: object expected");t.machineInfo=d.protocol.NodeInfo.MachineInfo.fromObject(e.machineInfo)}if(e.cheatWitnessInfoMap){if(typeof e.cheatWitnessInfoMap!="object")throw TypeError(".protocol.NodeInfo.cheatWitnessInfoMap: object expected");t.cheatWitnessInfoMap={};for(var l=Object.keys(e.cheatWitnessInfoMap),n=0;n<l.length;++n)t.cheatWitnessInfoMap[l[n]]=String(e.cheatWitnessInfoMap[l[n]])}return t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.peerInfoList=[]),(t.objects||t.defaults)&&(n.cheatWitnessInfoMap={}),t.defaults){if(i.Long){var l=new i.Long(0,0,!1);n.beginSyncNum=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.beginSyncNum=t.longs===String?"0":0;if(n.block="",n.solidityBlock="",n.currentConnectCount=0,n.activeConnectCount=0,n.passiveConnectCount=0,i.Long){var l=new i.Long(0,0,!1);n.totalFlow=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.totalFlow=t.longs===String?"0":0;n.configNodeInfo=null,n.machineInfo=null}if(e.beginSyncNum!=null&&e.hasOwnProperty("beginSyncNum")&&(typeof e.beginSyncNum=="number"?n.beginSyncNum=t.longs===String?String(e.beginSyncNum):e.beginSyncNum:n.beginSyncNum=t.longs===String?i.Long.prototype.toString.call(e.beginSyncNum):t.longs===Number?new i.LongBits(e.beginSyncNum.low>>>0,e.beginSyncNum.high>>>0).toNumber():e.beginSyncNum),e.block!=null&&e.hasOwnProperty("block")&&(n.block=e.block),e.solidityBlock!=null&&e.hasOwnProperty("solidityBlock")&&(n.solidityBlock=e.solidityBlock),e.currentConnectCount!=null&&e.hasOwnProperty("currentConnectCount")&&(n.currentConnectCount=e.currentConnectCount),e.activeConnectCount!=null&&e.hasOwnProperty("activeConnectCount")&&(n.activeConnectCount=e.activeConnectCount),e.passiveConnectCount!=null&&e.hasOwnProperty("passiveConnectCount")&&(n.passiveConnectCount=e.passiveConnectCount),e.totalFlow!=null&&e.hasOwnProperty("totalFlow")&&(typeof e.totalFlow=="number"?n.totalFlow=t.longs===String?String(e.totalFlow):e.totalFlow:n.totalFlow=t.longs===String?i.Long.prototype.toString.call(e.totalFlow):t.longs===Number?new i.LongBits(e.totalFlow.low>>>0,e.totalFlow.high>>>0).toNumber():e.totalFlow),e.peerInfoList&&e.peerInfoList.length){n.peerInfoList=[];for(var c=0;c<e.peerInfoList.length;++c)n.peerInfoList[c]=d.protocol.NodeInfo.PeerInfo.toObject(e.peerInfoList[c],t)}e.configNodeInfo!=null&&e.hasOwnProperty("configNodeInfo")&&(n.configNodeInfo=d.protocol.NodeInfo.ConfigNodeInfo.toObject(e.configNodeInfo,t)),e.machineInfo!=null&&e.hasOwnProperty("machineInfo")&&(n.machineInfo=d.protocol.NodeInfo.MachineInfo.toObject(e.machineInfo,t));var u;if(e.cheatWitnessInfoMap&&(u=Object.keys(e.cheatWitnessInfoMap)).length){n.cheatWitnessInfoMap={};for(var c=0;c<u.length;++c)n.cheatWitnessInfoMap[u[c]]=e.cheatWitnessInfoMap[u[c]]}return n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r.PeerInfo=function(){function o(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return o.prototype.lastSyncBlock="",o.prototype.remainNum=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.lastBlockUpdateTime=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.syncFlag=!1,o.prototype.headBlockTimeWeBothHave=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.needSyncFromPeer=!1,o.prototype.needSyncFromUs=!1,o.prototype.host="",o.prototype.port=0,o.prototype.nodeId="",o.prototype.connectTime=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.avgLatency=0,o.prototype.syncToFetchSize=0,o.prototype.syncToFetchSizePeekNum=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.syncBlockRequestedSize=0,o.prototype.unFetchSynNum=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.blockInPorcSize=0,o.prototype.headBlockWeBothHave="",o.prototype.isActive=!1,o.prototype.score=0,o.prototype.nodeCount=0,o.prototype.inFlow=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.disconnectTimes=0,o.prototype.localDisconnectReason="",o.prototype.remoteDisconnectReason="",o.create=function(t){return new o(t)},o.encode=function(t,n){return n||(n=H.create()),t.lastSyncBlock!=null&&Object.hasOwnProperty.call(t,"lastSyncBlock")&&n.uint32(10).string(t.lastSyncBlock),t.remainNum!=null&&Object.hasOwnProperty.call(t,"remainNum")&&n.uint32(16).int64(t.remainNum),t.lastBlockUpdateTime!=null&&Object.hasOwnProperty.call(t,"lastBlockUpdateTime")&&n.uint32(24).int64(t.lastBlockUpdateTime),t.syncFlag!=null&&Object.hasOwnProperty.call(t,"syncFlag")&&n.uint32(32).bool(t.syncFlag),t.headBlockTimeWeBothHave!=null&&Object.hasOwnProperty.call(t,"headBlockTimeWeBothHave")&&n.uint32(40).int64(t.headBlockTimeWeBothHave),t.needSyncFromPeer!=null&&Object.hasOwnProperty.call(t,"needSyncFromPeer")&&n.uint32(48).bool(t.needSyncFromPeer),t.needSyncFromUs!=null&&Object.hasOwnProperty.call(t,"needSyncFromUs")&&n.uint32(56).bool(t.needSyncFromUs),t.host!=null&&Object.hasOwnProperty.call(t,"host")&&n.uint32(66).string(t.host),t.port!=null&&Object.hasOwnProperty.call(t,"port")&&n.uint32(72).int32(t.port),t.nodeId!=null&&Object.hasOwnProperty.call(t,"nodeId")&&n.uint32(82).string(t.nodeId),t.connectTime!=null&&Object.hasOwnProperty.call(t,"connectTime")&&n.uint32(88).int64(t.connectTime),t.avgLatency!=null&&Object.hasOwnProperty.call(t,"avgLatency")&&n.uint32(97).double(t.avgLatency),t.syncToFetchSize!=null&&Object.hasOwnProperty.call(t,"syncToFetchSize")&&n.uint32(104).int32(t.syncToFetchSize),t.syncToFetchSizePeekNum!=null&&Object.hasOwnProperty.call(t,"syncToFetchSizePeekNum")&&n.uint32(112).int64(t.syncToFetchSizePeekNum),t.syncBlockRequestedSize!=null&&Object.hasOwnProperty.call(t,"syncBlockRequestedSize")&&n.uint32(120).int32(t.syncBlockRequestedSize),t.unFetchSynNum!=null&&Object.hasOwnProperty.call(t,"unFetchSynNum")&&n.uint32(128).int64(t.unFetchSynNum),t.blockInPorcSize!=null&&Object.hasOwnProperty.call(t,"blockInPorcSize")&&n.uint32(136).int32(t.blockInPorcSize),t.headBlockWeBothHave!=null&&Object.hasOwnProperty.call(t,"headBlockWeBothHave")&&n.uint32(146).string(t.headBlockWeBothHave),t.isActive!=null&&Object.hasOwnProperty.call(t,"isActive")&&n.uint32(152).bool(t.isActive),t.score!=null&&Object.hasOwnProperty.call(t,"score")&&n.uint32(160).int32(t.score),t.nodeCount!=null&&Object.hasOwnProperty.call(t,"nodeCount")&&n.uint32(168).int32(t.nodeCount),t.inFlow!=null&&Object.hasOwnProperty.call(t,"inFlow")&&n.uint32(176).int64(t.inFlow),t.disconnectTimes!=null&&Object.hasOwnProperty.call(t,"disconnectTimes")&&n.uint32(184).int32(t.disconnectTimes),t.localDisconnectReason!=null&&Object.hasOwnProperty.call(t,"localDisconnectReason")&&n.uint32(194).string(t.localDisconnectReason),t.remoteDisconnectReason!=null&&Object.hasOwnProperty.call(t,"remoteDisconnectReason")&&n.uint32(202).string(t.remoteDisconnectReason),n},o.encodeDelimited=function(t,n){return this.encode(t,n).ldelim()},o.decode=function(t,n){t instanceof v||(t=v.create(t));for(var l=n===void 0?t.len:t.pos+n,c=new d.protocol.NodeInfo.PeerInfo;t.pos<l;){var u=t.uint32();switch(u>>>3){case 1:c.lastSyncBlock=t.string();break;case 2:c.remainNum=t.int64();break;case 3:c.lastBlockUpdateTime=t.int64();break;case 4:c.syncFlag=t.bool();break;case 5:c.headBlockTimeWeBothHave=t.int64();break;case 6:c.needSyncFromPeer=t.bool();break;case 7:c.needSyncFromUs=t.bool();break;case 8:c.host=t.string();break;case 9:c.port=t.int32();break;case 10:c.nodeId=t.string();break;case 11:c.connectTime=t.int64();break;case 12:c.avgLatency=t.double();break;case 13:c.syncToFetchSize=t.int32();break;case 14:c.syncToFetchSizePeekNum=t.int64();break;case 15:c.syncBlockRequestedSize=t.int32();break;case 16:c.unFetchSynNum=t.int64();break;case 17:c.blockInPorcSize=t.int32();break;case 18:c.headBlockWeBothHave=t.string();break;case 19:c.isActive=t.bool();break;case 20:c.score=t.int32();break;case 21:c.nodeCount=t.int32();break;case 22:c.inFlow=t.int64();break;case 23:c.disconnectTimes=t.int32();break;case 24:c.localDisconnectReason=t.string();break;case 25:c.remoteDisconnectReason=t.string();break;default:t.skipType(u&7);break}}return c},o.decodeDelimited=function(t){return t instanceof v||(t=new v(t)),this.decode(t,t.uint32())},o.verify=function(t){return typeof t!="object"||t===null?"object expected":t.lastSyncBlock!=null&&t.hasOwnProperty("lastSyncBlock")&&!i.isString(t.lastSyncBlock)?"lastSyncBlock: string expected":t.remainNum!=null&&t.hasOwnProperty("remainNum")&&!i.isInteger(t.remainNum)&&!(t.remainNum&&i.isInteger(t.remainNum.low)&&i.isInteger(t.remainNum.high))?"remainNum: integer|Long expected":t.lastBlockUpdateTime!=null&&t.hasOwnProperty("lastBlockUpdateTime")&&!i.isInteger(t.lastBlockUpdateTime)&&!(t.lastBlockUpdateTime&&i.isInteger(t.lastBlockUpdateTime.low)&&i.isInteger(t.lastBlockUpdateTime.high))?"lastBlockUpdateTime: integer|Long expected":t.syncFlag!=null&&t.hasOwnProperty("syncFlag")&&typeof t.syncFlag!="boolean"?"syncFlag: boolean expected":t.headBlockTimeWeBothHave!=null&&t.hasOwnProperty("headBlockTimeWeBothHave")&&!i.isInteger(t.headBlockTimeWeBothHave)&&!(t.headBlockTimeWeBothHave&&i.isInteger(t.headBlockTimeWeBothHave.low)&&i.isInteger(t.headBlockTimeWeBothHave.high))?"headBlockTimeWeBothHave: integer|Long expected":t.needSyncFromPeer!=null&&t.hasOwnProperty("needSyncFromPeer")&&typeof t.needSyncFromPeer!="boolean"?"needSyncFromPeer: boolean expected":t.needSyncFromUs!=null&&t.hasOwnProperty("needSyncFromUs")&&typeof t.needSyncFromUs!="boolean"?"needSyncFromUs: boolean expected":t.host!=null&&t.hasOwnProperty("host")&&!i.isString(t.host)?"host: string expected":t.port!=null&&t.hasOwnProperty("port")&&!i.isInteger(t.port)?"port: integer expected":t.nodeId!=null&&t.hasOwnProperty("nodeId")&&!i.isString(t.nodeId)?"nodeId: string expected":t.connectTime!=null&&t.hasOwnProperty("connectTime")&&!i.isInteger(t.connectTime)&&!(t.connectTime&&i.isInteger(t.connectTime.low)&&i.isInteger(t.connectTime.high))?"connectTime: integer|Long expected":t.avgLatency!=null&&t.hasOwnProperty("avgLatency")&&typeof t.avgLatency!="number"?"avgLatency: number expected":t.syncToFetchSize!=null&&t.hasOwnProperty("syncToFetchSize")&&!i.isInteger(t.syncToFetchSize)?"syncToFetchSize: integer expected":t.syncToFetchSizePeekNum!=null&&t.hasOwnProperty("syncToFetchSizePeekNum")&&!i.isInteger(t.syncToFetchSizePeekNum)&&!(t.syncToFetchSizePeekNum&&i.isInteger(t.syncToFetchSizePeekNum.low)&&i.isInteger(t.syncToFetchSizePeekNum.high))?"syncToFetchSizePeekNum: integer|Long expected":t.syncBlockRequestedSize!=null&&t.hasOwnProperty("syncBlockRequestedSize")&&!i.isInteger(t.syncBlockRequestedSize)?"syncBlockRequestedSize: integer expected":t.unFetchSynNum!=null&&t.hasOwnProperty("unFetchSynNum")&&!i.isInteger(t.unFetchSynNum)&&!(t.unFetchSynNum&&i.isInteger(t.unFetchSynNum.low)&&i.isInteger(t.unFetchSynNum.high))?"unFetchSynNum: integer|Long expected":t.blockInPorcSize!=null&&t.hasOwnProperty("blockInPorcSize")&&!i.isInteger(t.blockInPorcSize)?"blockInPorcSize: integer expected":t.headBlockWeBothHave!=null&&t.hasOwnProperty("headBlockWeBothHave")&&!i.isString(t.headBlockWeBothHave)?"headBlockWeBothHave: string expected":t.isActive!=null&&t.hasOwnProperty("isActive")&&typeof t.isActive!="boolean"?"isActive: boolean expected":t.score!=null&&t.hasOwnProperty("score")&&!i.isInteger(t.score)?"score: integer expected":t.nodeCount!=null&&t.hasOwnProperty("nodeCount")&&!i.isInteger(t.nodeCount)?"nodeCount: integer expected":t.inFlow!=null&&t.hasOwnProperty("inFlow")&&!i.isInteger(t.inFlow)&&!(t.inFlow&&i.isInteger(t.inFlow.low)&&i.isInteger(t.inFlow.high))?"inFlow: integer|Long expected":t.disconnectTimes!=null&&t.hasOwnProperty("disconnectTimes")&&!i.isInteger(t.disconnectTimes)?"disconnectTimes: integer expected":t.localDisconnectReason!=null&&t.hasOwnProperty("localDisconnectReason")&&!i.isString(t.localDisconnectReason)?"localDisconnectReason: string expected":t.remoteDisconnectReason!=null&&t.hasOwnProperty("remoteDisconnectReason")&&!i.isString(t.remoteDisconnectReason)?"remoteDisconnectReason: string expected":null},o.fromObject=function(t){if(t instanceof d.protocol.NodeInfo.PeerInfo)return t;var n=new d.protocol.NodeInfo.PeerInfo;return t.lastSyncBlock!=null&&(n.lastSyncBlock=String(t.lastSyncBlock)),t.remainNum!=null&&(i.Long?(n.remainNum=i.Long.fromValue(t.remainNum)).unsigned=!1:typeof t.remainNum=="string"?n.remainNum=parseInt(t.remainNum,10):typeof t.remainNum=="number"?n.remainNum=t.remainNum:typeof t.remainNum=="object"&&(n.remainNum=new i.LongBits(t.remainNum.low>>>0,t.remainNum.high>>>0).toNumber())),t.lastBlockUpdateTime!=null&&(i.Long?(n.lastBlockUpdateTime=i.Long.fromValue(t.lastBlockUpdateTime)).unsigned=!1:typeof t.lastBlockUpdateTime=="string"?n.lastBlockUpdateTime=parseInt(t.lastBlockUpdateTime,10):typeof t.lastBlockUpdateTime=="number"?n.lastBlockUpdateTime=t.lastBlockUpdateTime:typeof t.lastBlockUpdateTime=="object"&&(n.lastBlockUpdateTime=new i.LongBits(t.lastBlockUpdateTime.low>>>0,t.lastBlockUpdateTime.high>>>0).toNumber())),t.syncFlag!=null&&(n.syncFlag=Boolean(t.syncFlag)),t.headBlockTimeWeBothHave!=null&&(i.Long?(n.headBlockTimeWeBothHave=i.Long.fromValue(t.headBlockTimeWeBothHave)).unsigned=!1:typeof t.headBlockTimeWeBothHave=="string"?n.headBlockTimeWeBothHave=parseInt(t.headBlockTimeWeBothHave,10):typeof t.headBlockTimeWeBothHave=="number"?n.headBlockTimeWeBothHave=t.headBlockTimeWeBothHave:typeof t.headBlockTimeWeBothHave=="object"&&(n.headBlockTimeWeBothHave=new i.LongBits(t.headBlockTimeWeBothHave.low>>>0,t.headBlockTimeWeBothHave.high>>>0).toNumber())),t.needSyncFromPeer!=null&&(n.needSyncFromPeer=Boolean(t.needSyncFromPeer)),t.needSyncFromUs!=null&&(n.needSyncFromUs=Boolean(t.needSyncFromUs)),t.host!=null&&(n.host=String(t.host)),t.port!=null&&(n.port=t.port|0),t.nodeId!=null&&(n.nodeId=String(t.nodeId)),t.connectTime!=null&&(i.Long?(n.connectTime=i.Long.fromValue(t.connectTime)).unsigned=!1:typeof t.connectTime=="string"?n.connectTime=parseInt(t.connectTime,10):typeof t.connectTime=="number"?n.connectTime=t.connectTime:typeof t.connectTime=="object"&&(n.connectTime=new i.LongBits(t.connectTime.low>>>0,t.connectTime.high>>>0).toNumber())),t.avgLatency!=null&&(n.avgLatency=Number(t.avgLatency)),t.syncToFetchSize!=null&&(n.syncToFetchSize=t.syncToFetchSize|0),t.syncToFetchSizePeekNum!=null&&(i.Long?(n.syncToFetchSizePeekNum=i.Long.fromValue(t.syncToFetchSizePeekNum)).unsigned=!1:typeof t.syncToFetchSizePeekNum=="string"?n.syncToFetchSizePeekNum=parseInt(t.syncToFetchSizePeekNum,10):typeof t.syncToFetchSizePeekNum=="number"?n.syncToFetchSizePeekNum=t.syncToFetchSizePeekNum:typeof t.syncToFetchSizePeekNum=="object"&&(n.syncToFetchSizePeekNum=new i.LongBits(t.syncToFetchSizePeekNum.low>>>0,t.syncToFetchSizePeekNum.high>>>0).toNumber())),t.syncBlockRequestedSize!=null&&(n.syncBlockRequestedSize=t.syncBlockRequestedSize|0),t.unFetchSynNum!=null&&(i.Long?(n.unFetchSynNum=i.Long.fromValue(t.unFetchSynNum)).unsigned=!1:typeof t.unFetchSynNum=="string"?n.unFetchSynNum=parseInt(t.unFetchSynNum,10):typeof t.unFetchSynNum=="number"?n.unFetchSynNum=t.unFetchSynNum:typeof t.unFetchSynNum=="object"&&(n.unFetchSynNum=new i.LongBits(t.unFetchSynNum.low>>>0,t.unFetchSynNum.high>>>0).toNumber())),t.blockInPorcSize!=null&&(n.blockInPorcSize=t.blockInPorcSize|0),t.headBlockWeBothHave!=null&&(n.headBlockWeBothHave=String(t.headBlockWeBothHave)),t.isActive!=null&&(n.isActive=Boolean(t.isActive)),t.score!=null&&(n.score=t.score|0),t.nodeCount!=null&&(n.nodeCount=t.nodeCount|0),t.inFlow!=null&&(i.Long?(n.inFlow=i.Long.fromValue(t.inFlow)).unsigned=!1:typeof t.inFlow=="string"?n.inFlow=parseInt(t.inFlow,10):typeof t.inFlow=="number"?n.inFlow=t.inFlow:typeof t.inFlow=="object"&&(n.inFlow=new i.LongBits(t.inFlow.low>>>0,t.inFlow.high>>>0).toNumber())),t.disconnectTimes!=null&&(n.disconnectTimes=t.disconnectTimes|0),t.localDisconnectReason!=null&&(n.localDisconnectReason=String(t.localDisconnectReason)),t.remoteDisconnectReason!=null&&(n.remoteDisconnectReason=String(t.remoteDisconnectReason)),n},o.toObject=function(t,n){n||(n={});var l={};if(n.defaults){if(l.lastSyncBlock="",i.Long){var c=new i.Long(0,0,!1);l.remainNum=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.remainNum=n.longs===String?"0":0;if(i.Long){var c=new i.Long(0,0,!1);l.lastBlockUpdateTime=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.lastBlockUpdateTime=n.longs===String?"0":0;if(l.syncFlag=!1,i.Long){var c=new i.Long(0,0,!1);l.headBlockTimeWeBothHave=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.headBlockTimeWeBothHave=n.longs===String?"0":0;if(l.needSyncFromPeer=!1,l.needSyncFromUs=!1,l.host="",l.port=0,l.nodeId="",i.Long){var c=new i.Long(0,0,!1);l.connectTime=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.connectTime=n.longs===String?"0":0;if(l.avgLatency=0,l.syncToFetchSize=0,i.Long){var c=new i.Long(0,0,!1);l.syncToFetchSizePeekNum=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.syncToFetchSizePeekNum=n.longs===String?"0":0;if(l.syncBlockRequestedSize=0,i.Long){var c=new i.Long(0,0,!1);l.unFetchSynNum=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.unFetchSynNum=n.longs===String?"0":0;if(l.blockInPorcSize=0,l.headBlockWeBothHave="",l.isActive=!1,l.score=0,l.nodeCount=0,i.Long){var c=new i.Long(0,0,!1);l.inFlow=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.inFlow=n.longs===String?"0":0;l.disconnectTimes=0,l.localDisconnectReason="",l.remoteDisconnectReason=""}return t.lastSyncBlock!=null&&t.hasOwnProperty("lastSyncBlock")&&(l.lastSyncBlock=t.lastSyncBlock),t.remainNum!=null&&t.hasOwnProperty("remainNum")&&(typeof t.remainNum=="number"?l.remainNum=n.longs===String?String(t.remainNum):t.remainNum:l.remainNum=n.longs===String?i.Long.prototype.toString.call(t.remainNum):n.longs===Number?new i.LongBits(t.remainNum.low>>>0,t.remainNum.high>>>0).toNumber():t.remainNum),t.lastBlockUpdateTime!=null&&t.hasOwnProperty("lastBlockUpdateTime")&&(typeof t.lastBlockUpdateTime=="number"?l.lastBlockUpdateTime=n.longs===String?String(t.lastBlockUpdateTime):t.lastBlockUpdateTime:l.lastBlockUpdateTime=n.longs===String?i.Long.prototype.toString.call(t.lastBlockUpdateTime):n.longs===Number?new i.LongBits(t.lastBlockUpdateTime.low>>>0,t.lastBlockUpdateTime.high>>>0).toNumber():t.lastBlockUpdateTime),t.syncFlag!=null&&t.hasOwnProperty("syncFlag")&&(l.syncFlag=t.syncFlag),t.headBlockTimeWeBothHave!=null&&t.hasOwnProperty("headBlockTimeWeBothHave")&&(typeof t.headBlockTimeWeBothHave=="number"?l.headBlockTimeWeBothHave=n.longs===String?String(t.headBlockTimeWeBothHave):t.headBlockTimeWeBothHave:l.headBlockTimeWeBothHave=n.longs===String?i.Long.prototype.toString.call(t.headBlockTimeWeBothHave):n.longs===Number?new i.LongBits(t.headBlockTimeWeBothHave.low>>>0,t.headBlockTimeWeBothHave.high>>>0).toNumber():t.headBlockTimeWeBothHave),t.needSyncFromPeer!=null&&t.hasOwnProperty("needSyncFromPeer")&&(l.needSyncFromPeer=t.needSyncFromPeer),t.needSyncFromUs!=null&&t.hasOwnProperty("needSyncFromUs")&&(l.needSyncFromUs=t.needSyncFromUs),t.host!=null&&t.hasOwnProperty("host")&&(l.host=t.host),t.port!=null&&t.hasOwnProperty("port")&&(l.port=t.port),t.nodeId!=null&&t.hasOwnProperty("nodeId")&&(l.nodeId=t.nodeId),t.connectTime!=null&&t.hasOwnProperty("connectTime")&&(typeof t.connectTime=="number"?l.connectTime=n.longs===String?String(t.connectTime):t.connectTime:l.connectTime=n.longs===String?i.Long.prototype.toString.call(t.connectTime):n.longs===Number?new i.LongBits(t.connectTime.low>>>0,t.connectTime.high>>>0).toNumber():t.connectTime),t.avgLatency!=null&&t.hasOwnProperty("avgLatency")&&(l.avgLatency=n.json&&!isFinite(t.avgLatency)?String(t.avgLatency):t.avgLatency),t.syncToFetchSize!=null&&t.hasOwnProperty("syncToFetchSize")&&(l.syncToFetchSize=t.syncToFetchSize),t.syncToFetchSizePeekNum!=null&&t.hasOwnProperty("syncToFetchSizePeekNum")&&(typeof t.syncToFetchSizePeekNum=="number"?l.syncToFetchSizePeekNum=n.longs===String?String(t.syncToFetchSizePeekNum):t.syncToFetchSizePeekNum:l.syncToFetchSizePeekNum=n.longs===String?i.Long.prototype.toString.call(t.syncToFetchSizePeekNum):n.longs===Number?new i.LongBits(t.syncToFetchSizePeekNum.low>>>0,t.syncToFetchSizePeekNum.high>>>0).toNumber():t.syncToFetchSizePeekNum),t.syncBlockRequestedSize!=null&&t.hasOwnProperty("syncBlockRequestedSize")&&(l.syncBlockRequestedSize=t.syncBlockRequestedSize),t.unFetchSynNum!=null&&t.hasOwnProperty("unFetchSynNum")&&(typeof t.unFetchSynNum=="number"?l.unFetchSynNum=n.longs===String?String(t.unFetchSynNum):t.unFetchSynNum:l.unFetchSynNum=n.longs===String?i.Long.prototype.toString.call(t.unFetchSynNum):n.longs===Number?new i.LongBits(t.unFetchSynNum.low>>>0,t.unFetchSynNum.high>>>0).toNumber():t.unFetchSynNum),t.blockInPorcSize!=null&&t.hasOwnProperty("blockInPorcSize")&&(l.blockInPorcSize=t.blockInPorcSize),t.headBlockWeBothHave!=null&&t.hasOwnProperty("headBlockWeBothHave")&&(l.headBlockWeBothHave=t.headBlockWeBothHave),t.isActive!=null&&t.hasOwnProperty("isActive")&&(l.isActive=t.isActive),t.score!=null&&t.hasOwnProperty("score")&&(l.score=t.score),t.nodeCount!=null&&t.hasOwnProperty("nodeCount")&&(l.nodeCount=t.nodeCount),t.inFlow!=null&&t.hasOwnProperty("inFlow")&&(typeof t.inFlow=="number"?l.inFlow=n.longs===String?String(t.inFlow):t.inFlow:l.inFlow=n.longs===String?i.Long.prototype.toString.call(t.inFlow):n.longs===Number?new i.LongBits(t.inFlow.low>>>0,t.inFlow.high>>>0).toNumber():t.inFlow),t.disconnectTimes!=null&&t.hasOwnProperty("disconnectTimes")&&(l.disconnectTimes=t.disconnectTimes),t.localDisconnectReason!=null&&t.hasOwnProperty("localDisconnectReason")&&(l.localDisconnectReason=t.localDisconnectReason),t.remoteDisconnectReason!=null&&t.hasOwnProperty("remoteDisconnectReason")&&(l.remoteDisconnectReason=t.remoteDisconnectReason),l},o.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},o}(),r.ConfigNodeInfo=function(){function o(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return o.prototype.codeVersion="",o.prototype.p2pVersion="",o.prototype.listenPort=0,o.prototype.discoverEnable=!1,o.prototype.activeNodeSize=0,o.prototype.passiveNodeSize=0,o.prototype.sendNodeSize=0,o.prototype.maxConnectCount=0,o.prototype.sameIpMaxConnectCount=0,o.prototype.backupListenPort=0,o.prototype.backupMemberSize=0,o.prototype.backupPriority=0,o.prototype.dbVersion=0,o.prototype.minParticipationRate=0,o.prototype.supportConstant=!1,o.prototype.minTimeRatio=0,o.prototype.maxTimeRatio=0,o.prototype.allowCreationOfContracts=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.allowAdaptiveEnergy=i.Long?i.Long.fromBits(0,0,!1):0,o.create=function(t){return new o(t)},o.encode=function(t,n){return n||(n=H.create()),t.codeVersion!=null&&Object.hasOwnProperty.call(t,"codeVersion")&&n.uint32(10).string(t.codeVersion),t.p2pVersion!=null&&Object.hasOwnProperty.call(t,"p2pVersion")&&n.uint32(18).string(t.p2pVersion),t.listenPort!=null&&Object.hasOwnProperty.call(t,"listenPort")&&n.uint32(24).int32(t.listenPort),t.discoverEnable!=null&&Object.hasOwnProperty.call(t,"discoverEnable")&&n.uint32(32).bool(t.discoverEnable),t.activeNodeSize!=null&&Object.hasOwnProperty.call(t,"activeNodeSize")&&n.uint32(40).int32(t.activeNodeSize),t.passiveNodeSize!=null&&Object.hasOwnProperty.call(t,"passiveNodeSize")&&n.uint32(48).int32(t.passiveNodeSize),t.sendNodeSize!=null&&Object.hasOwnProperty.call(t,"sendNodeSize")&&n.uint32(56).int32(t.sendNodeSize),t.maxConnectCount!=null&&Object.hasOwnProperty.call(t,"maxConnectCount")&&n.uint32(64).int32(t.maxConnectCount),t.sameIpMaxConnectCount!=null&&Object.hasOwnProperty.call(t,"sameIpMaxConnectCount")&&n.uint32(72).int32(t.sameIpMaxConnectCount),t.backupListenPort!=null&&Object.hasOwnProperty.call(t,"backupListenPort")&&n.uint32(80).int32(t.backupListenPort),t.backupMemberSize!=null&&Object.hasOwnProperty.call(t,"backupMemberSize")&&n.uint32(88).int32(t.backupMemberSize),t.backupPriority!=null&&Object.hasOwnProperty.call(t,"backupPriority")&&n.uint32(96).int32(t.backupPriority),t.dbVersion!=null&&Object.hasOwnProperty.call(t,"dbVersion")&&n.uint32(104).int32(t.dbVersion),t.minParticipationRate!=null&&Object.hasOwnProperty.call(t,"minParticipationRate")&&n.uint32(112).int32(t.minParticipationRate),t.supportConstant!=null&&Object.hasOwnProperty.call(t,"supportConstant")&&n.uint32(120).bool(t.supportConstant),t.minTimeRatio!=null&&Object.hasOwnProperty.call(t,"minTimeRatio")&&n.uint32(129).double(t.minTimeRatio),t.maxTimeRatio!=null&&Object.hasOwnProperty.call(t,"maxTimeRatio")&&n.uint32(137).double(t.maxTimeRatio),t.allowCreationOfContracts!=null&&Object.hasOwnProperty.call(t,"allowCreationOfContracts")&&n.uint32(144).int64(t.allowCreationOfContracts),t.allowAdaptiveEnergy!=null&&Object.hasOwnProperty.call(t,"allowAdaptiveEnergy")&&n.uint32(152).int64(t.allowAdaptiveEnergy),n},o.encodeDelimited=function(t,n){return this.encode(t,n).ldelim()},o.decode=function(t,n){t instanceof v||(t=v.create(t));for(var l=n===void 0?t.len:t.pos+n,c=new d.protocol.NodeInfo.ConfigNodeInfo;t.pos<l;){var u=t.uint32();switch(u>>>3){case 1:c.codeVersion=t.string();break;case 2:c.p2pVersion=t.string();break;case 3:c.listenPort=t.int32();break;case 4:c.discoverEnable=t.bool();break;case 5:c.activeNodeSize=t.int32();break;case 6:c.passiveNodeSize=t.int32();break;case 7:c.sendNodeSize=t.int32();break;case 8:c.maxConnectCount=t.int32();break;case 9:c.sameIpMaxConnectCount=t.int32();break;case 10:c.backupListenPort=t.int32();break;case 11:c.backupMemberSize=t.int32();break;case 12:c.backupPriority=t.int32();break;case 13:c.dbVersion=t.int32();break;case 14:c.minParticipationRate=t.int32();break;case 15:c.supportConstant=t.bool();break;case 16:c.minTimeRatio=t.double();break;case 17:c.maxTimeRatio=t.double();break;case 18:c.allowCreationOfContracts=t.int64();break;case 19:c.allowAdaptiveEnergy=t.int64();break;default:t.skipType(u&7);break}}return c},o.decodeDelimited=function(t){return t instanceof v||(t=new v(t)),this.decode(t,t.uint32())},o.verify=function(t){return typeof t!="object"||t===null?"object expected":t.codeVersion!=null&&t.hasOwnProperty("codeVersion")&&!i.isString(t.codeVersion)?"codeVersion: string expected":t.p2pVersion!=null&&t.hasOwnProperty("p2pVersion")&&!i.isString(t.p2pVersion)?"p2pVersion: string expected":t.listenPort!=null&&t.hasOwnProperty("listenPort")&&!i.isInteger(t.listenPort)?"listenPort: integer expected":t.discoverEnable!=null&&t.hasOwnProperty("discoverEnable")&&typeof t.discoverEnable!="boolean"?"discoverEnable: boolean expected":t.activeNodeSize!=null&&t.hasOwnProperty("activeNodeSize")&&!i.isInteger(t.activeNodeSize)?"activeNodeSize: integer expected":t.passiveNodeSize!=null&&t.hasOwnProperty("passiveNodeSize")&&!i.isInteger(t.passiveNodeSize)?"passiveNodeSize: integer expected":t.sendNodeSize!=null&&t.hasOwnProperty("sendNodeSize")&&!i.isInteger(t.sendNodeSize)?"sendNodeSize: integer expected":t.maxConnectCount!=null&&t.hasOwnProperty("maxConnectCount")&&!i.isInteger(t.maxConnectCount)?"maxConnectCount: integer expected":t.sameIpMaxConnectCount!=null&&t.hasOwnProperty("sameIpMaxConnectCount")&&!i.isInteger(t.sameIpMaxConnectCount)?"sameIpMaxConnectCount: integer expected":t.backupListenPort!=null&&t.hasOwnProperty("backupListenPort")&&!i.isInteger(t.backupListenPort)?"backupListenPort: integer expected":t.backupMemberSize!=null&&t.hasOwnProperty("backupMemberSize")&&!i.isInteger(t.backupMemberSize)?"backupMemberSize: integer expected":t.backupPriority!=null&&t.hasOwnProperty("backupPriority")&&!i.isInteger(t.backupPriority)?"backupPriority: integer expected":t.dbVersion!=null&&t.hasOwnProperty("dbVersion")&&!i.isInteger(t.dbVersion)?"dbVersion: integer expected":t.minParticipationRate!=null&&t.hasOwnProperty("minParticipationRate")&&!i.isInteger(t.minParticipationRate)?"minParticipationRate: integer expected":t.supportConstant!=null&&t.hasOwnProperty("supportConstant")&&typeof t.supportConstant!="boolean"?"supportConstant: boolean expected":t.minTimeRatio!=null&&t.hasOwnProperty("minTimeRatio")&&typeof t.minTimeRatio!="number"?"minTimeRatio: number expected":t.maxTimeRatio!=null&&t.hasOwnProperty("maxTimeRatio")&&typeof t.maxTimeRatio!="number"?"maxTimeRatio: number expected":t.allowCreationOfContracts!=null&&t.hasOwnProperty("allowCreationOfContracts")&&!i.isInteger(t.allowCreationOfContracts)&&!(t.allowCreationOfContracts&&i.isInteger(t.allowCreationOfContracts.low)&&i.isInteger(t.allowCreationOfContracts.high))?"allowCreationOfContracts: integer|Long expected":t.allowAdaptiveEnergy!=null&&t.hasOwnProperty("allowAdaptiveEnergy")&&!i.isInteger(t.allowAdaptiveEnergy)&&!(t.allowAdaptiveEnergy&&i.isInteger(t.allowAdaptiveEnergy.low)&&i.isInteger(t.allowAdaptiveEnergy.high))?"allowAdaptiveEnergy: integer|Long expected":null},o.fromObject=function(t){if(t instanceof d.protocol.NodeInfo.ConfigNodeInfo)return t;var n=new d.protocol.NodeInfo.ConfigNodeInfo;return t.codeVersion!=null&&(n.codeVersion=String(t.codeVersion)),t.p2pVersion!=null&&(n.p2pVersion=String(t.p2pVersion)),t.listenPort!=null&&(n.listenPort=t.listenPort|0),t.discoverEnable!=null&&(n.discoverEnable=Boolean(t.discoverEnable)),t.activeNodeSize!=null&&(n.activeNodeSize=t.activeNodeSize|0),t.passiveNodeSize!=null&&(n.passiveNodeSize=t.passiveNodeSize|0),t.sendNodeSize!=null&&(n.sendNodeSize=t.sendNodeSize|0),t.maxConnectCount!=null&&(n.maxConnectCount=t.maxConnectCount|0),t.sameIpMaxConnectCount!=null&&(n.sameIpMaxConnectCount=t.sameIpMaxConnectCount|0),t.backupListenPort!=null&&(n.backupListenPort=t.backupListenPort|0),t.backupMemberSize!=null&&(n.backupMemberSize=t.backupMemberSize|0),t.backupPriority!=null&&(n.backupPriority=t.backupPriority|0),t.dbVersion!=null&&(n.dbVersion=t.dbVersion|0),t.minParticipationRate!=null&&(n.minParticipationRate=t.minParticipationRate|0),t.supportConstant!=null&&(n.supportConstant=Boolean(t.supportConstant)),t.minTimeRatio!=null&&(n.minTimeRatio=Number(t.minTimeRatio)),t.maxTimeRatio!=null&&(n.maxTimeRatio=Number(t.maxTimeRatio)),t.allowCreationOfContracts!=null&&(i.Long?(n.allowCreationOfContracts=i.Long.fromValue(t.allowCreationOfContracts)).unsigned=!1:typeof t.allowCreationOfContracts=="string"?n.allowCreationOfContracts=parseInt(t.allowCreationOfContracts,10):typeof t.allowCreationOfContracts=="number"?n.allowCreationOfContracts=t.allowCreationOfContracts:typeof t.allowCreationOfContracts=="object"&&(n.allowCreationOfContracts=new i.LongBits(t.allowCreationOfContracts.low>>>0,t.allowCreationOfContracts.high>>>0).toNumber())),t.allowAdaptiveEnergy!=null&&(i.Long?(n.allowAdaptiveEnergy=i.Long.fromValue(t.allowAdaptiveEnergy)).unsigned=!1:typeof t.allowAdaptiveEnergy=="string"?n.allowAdaptiveEnergy=parseInt(t.allowAdaptiveEnergy,10):typeof t.allowAdaptiveEnergy=="number"?n.allowAdaptiveEnergy=t.allowAdaptiveEnergy:typeof t.allowAdaptiveEnergy=="object"&&(n.allowAdaptiveEnergy=new i.LongBits(t.allowAdaptiveEnergy.low>>>0,t.allowAdaptiveEnergy.high>>>0).toNumber())),n},o.toObject=function(t,n){n||(n={});var l={};if(n.defaults){if(l.codeVersion="",l.p2pVersion="",l.listenPort=0,l.discoverEnable=!1,l.activeNodeSize=0,l.passiveNodeSize=0,l.sendNodeSize=0,l.maxConnectCount=0,l.sameIpMaxConnectCount=0,l.backupListenPort=0,l.backupMemberSize=0,l.backupPriority=0,l.dbVersion=0,l.minParticipationRate=0,l.supportConstant=!1,l.minTimeRatio=0,l.maxTimeRatio=0,i.Long){var c=new i.Long(0,0,!1);l.allowCreationOfContracts=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.allowCreationOfContracts=n.longs===String?"0":0;if(i.Long){var c=new i.Long(0,0,!1);l.allowAdaptiveEnergy=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.allowAdaptiveEnergy=n.longs===String?"0":0}return t.codeVersion!=null&&t.hasOwnProperty("codeVersion")&&(l.codeVersion=t.codeVersion),t.p2pVersion!=null&&t.hasOwnProperty("p2pVersion")&&(l.p2pVersion=t.p2pVersion),t.listenPort!=null&&t.hasOwnProperty("listenPort")&&(l.listenPort=t.listenPort),t.discoverEnable!=null&&t.hasOwnProperty("discoverEnable")&&(l.discoverEnable=t.discoverEnable),t.activeNodeSize!=null&&t.hasOwnProperty("activeNodeSize")&&(l.activeNodeSize=t.activeNodeSize),t.passiveNodeSize!=null&&t.hasOwnProperty("passiveNodeSize")&&(l.passiveNodeSize=t.passiveNodeSize),t.sendNodeSize!=null&&t.hasOwnProperty("sendNodeSize")&&(l.sendNodeSize=t.sendNodeSize),t.maxConnectCount!=null&&t.hasOwnProperty("maxConnectCount")&&(l.maxConnectCount=t.maxConnectCount),t.sameIpMaxConnectCount!=null&&t.hasOwnProperty("sameIpMaxConnectCount")&&(l.sameIpMaxConnectCount=t.sameIpMaxConnectCount),t.backupListenPort!=null&&t.hasOwnProperty("backupListenPort")&&(l.backupListenPort=t.backupListenPort),t.backupMemberSize!=null&&t.hasOwnProperty("backupMemberSize")&&(l.backupMemberSize=t.backupMemberSize),t.backupPriority!=null&&t.hasOwnProperty("backupPriority")&&(l.backupPriority=t.backupPriority),t.dbVersion!=null&&t.hasOwnProperty("dbVersion")&&(l.dbVersion=t.dbVersion),t.minParticipationRate!=null&&t.hasOwnProperty("minParticipationRate")&&(l.minParticipationRate=t.minParticipationRate),t.supportConstant!=null&&t.hasOwnProperty("supportConstant")&&(l.supportConstant=t.supportConstant),t.minTimeRatio!=null&&t.hasOwnProperty("minTimeRatio")&&(l.minTimeRatio=n.json&&!isFinite(t.minTimeRatio)?String(t.minTimeRatio):t.minTimeRatio),t.maxTimeRatio!=null&&t.hasOwnProperty("maxTimeRatio")&&(l.maxTimeRatio=n.json&&!isFinite(t.maxTimeRatio)?String(t.maxTimeRatio):t.maxTimeRatio),t.allowCreationOfContracts!=null&&t.hasOwnProperty("allowCreationOfContracts")&&(typeof t.allowCreationOfContracts=="number"?l.allowCreationOfContracts=n.longs===String?String(t.allowCreationOfContracts):t.allowCreationOfContracts:l.allowCreationOfContracts=n.longs===String?i.Long.prototype.toString.call(t.allowCreationOfContracts):n.longs===Number?new i.LongBits(t.allowCreationOfContracts.low>>>0,t.allowCreationOfContracts.high>>>0).toNumber():t.allowCreationOfContracts),t.allowAdaptiveEnergy!=null&&t.hasOwnProperty("allowAdaptiveEnergy")&&(typeof t.allowAdaptiveEnergy=="number"?l.allowAdaptiveEnergy=n.longs===String?String(t.allowAdaptiveEnergy):t.allowAdaptiveEnergy:l.allowAdaptiveEnergy=n.longs===String?i.Long.prototype.toString.call(t.allowAdaptiveEnergy):n.longs===Number?new i.LongBits(t.allowAdaptiveEnergy.low>>>0,t.allowAdaptiveEnergy.high>>>0).toNumber():t.allowAdaptiveEnergy),l},o.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},o}(),r.MachineInfo=function(){function o(e){if(this.memoryDescInfoList=[],this.deadLockThreadInfoList=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return o.prototype.threadCount=0,o.prototype.deadLockThreadCount=0,o.prototype.cpuCount=0,o.prototype.totalMemory=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.freeMemory=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.cpuRate=0,o.prototype.javaVersion="",o.prototype.osName="",o.prototype.jvmTotalMemoery=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.jvmFreeMemory=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.processCpuRate=0,o.prototype.memoryDescInfoList=i.emptyArray,o.prototype.deadLockThreadInfoList=i.emptyArray,o.create=function(t){return new o(t)},o.encode=function(t,n){if(n||(n=H.create()),t.threadCount!=null&&Object.hasOwnProperty.call(t,"threadCount")&&n.uint32(8).int32(t.threadCount),t.deadLockThreadCount!=null&&Object.hasOwnProperty.call(t,"deadLockThreadCount")&&n.uint32(16).int32(t.deadLockThreadCount),t.cpuCount!=null&&Object.hasOwnProperty.call(t,"cpuCount")&&n.uint32(24).int32(t.cpuCount),t.totalMemory!=null&&Object.hasOwnProperty.call(t,"totalMemory")&&n.uint32(32).int64(t.totalMemory),t.freeMemory!=null&&Object.hasOwnProperty.call(t,"freeMemory")&&n.uint32(40).int64(t.freeMemory),t.cpuRate!=null&&Object.hasOwnProperty.call(t,"cpuRate")&&n.uint32(49).double(t.cpuRate),t.javaVersion!=null&&Object.hasOwnProperty.call(t,"javaVersion")&&n.uint32(58).string(t.javaVersion),t.osName!=null&&Object.hasOwnProperty.call(t,"osName")&&n.uint32(66).string(t.osName),t.jvmTotalMemoery!=null&&Object.hasOwnProperty.call(t,"jvmTotalMemoery")&&n.uint32(72).int64(t.jvmTotalMemoery),t.jvmFreeMemory!=null&&Object.hasOwnProperty.call(t,"jvmFreeMemory")&&n.uint32(80).int64(t.jvmFreeMemory),t.processCpuRate!=null&&Object.hasOwnProperty.call(t,"processCpuRate")&&n.uint32(89).double(t.processCpuRate),t.memoryDescInfoList!=null&&t.memoryDescInfoList.length)for(var l=0;l<t.memoryDescInfoList.length;++l)d.protocol.NodeInfo.MachineInfo.MemoryDescInfo.encode(t.memoryDescInfoList[l],n.uint32(98).fork()).ldelim();if(t.deadLockThreadInfoList!=null&&t.deadLockThreadInfoList.length)for(var l=0;l<t.deadLockThreadInfoList.length;++l)d.protocol.NodeInfo.MachineInfo.DeadLockThreadInfo.encode(t.deadLockThreadInfoList[l],n.uint32(106).fork()).ldelim();return n},o.encodeDelimited=function(t,n){return this.encode(t,n).ldelim()},o.decode=function(t,n){t instanceof v||(t=v.create(t));for(var l=n===void 0?t.len:t.pos+n,c=new d.protocol.NodeInfo.MachineInfo;t.pos<l;){var u=t.uint32();switch(u>>>3){case 1:c.threadCount=t.int32();break;case 2:c.deadLockThreadCount=t.int32();break;case 3:c.cpuCount=t.int32();break;case 4:c.totalMemory=t.int64();break;case 5:c.freeMemory=t.int64();break;case 6:c.cpuRate=t.double();break;case 7:c.javaVersion=t.string();break;case 8:c.osName=t.string();break;case 9:c.jvmTotalMemoery=t.int64();break;case 10:c.jvmFreeMemory=t.int64();break;case 11:c.processCpuRate=t.double();break;case 12:c.memoryDescInfoList&&c.memoryDescInfoList.length||(c.memoryDescInfoList=[]),c.memoryDescInfoList.push(d.protocol.NodeInfo.MachineInfo.MemoryDescInfo.decode(t,t.uint32()));break;case 13:c.deadLockThreadInfoList&&c.deadLockThreadInfoList.length||(c.deadLockThreadInfoList=[]),c.deadLockThreadInfoList.push(d.protocol.NodeInfo.MachineInfo.DeadLockThreadInfo.decode(t,t.uint32()));break;default:t.skipType(u&7);break}}return c},o.decodeDelimited=function(t){return t instanceof v||(t=new v(t)),this.decode(t,t.uint32())},o.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.threadCount!=null&&t.hasOwnProperty("threadCount")&&!i.isInteger(t.threadCount))return"threadCount: integer expected";if(t.deadLockThreadCount!=null&&t.hasOwnProperty("deadLockThreadCount")&&!i.isInteger(t.deadLockThreadCount))return"deadLockThreadCount: integer expected";if(t.cpuCount!=null&&t.hasOwnProperty("cpuCount")&&!i.isInteger(t.cpuCount))return"cpuCount: integer expected";if(t.totalMemory!=null&&t.hasOwnProperty("totalMemory")&&!i.isInteger(t.totalMemory)&&!(t.totalMemory&&i.isInteger(t.totalMemory.low)&&i.isInteger(t.totalMemory.high)))return"totalMemory: integer|Long expected";if(t.freeMemory!=null&&t.hasOwnProperty("freeMemory")&&!i.isInteger(t.freeMemory)&&!(t.freeMemory&&i.isInteger(t.freeMemory.low)&&i.isInteger(t.freeMemory.high)))return"freeMemory: integer|Long expected";if(t.cpuRate!=null&&t.hasOwnProperty("cpuRate")&&typeof t.cpuRate!="number")return"cpuRate: number expected";if(t.javaVersion!=null&&t.hasOwnProperty("javaVersion")&&!i.isString(t.javaVersion))return"javaVersion: string expected";if(t.osName!=null&&t.hasOwnProperty("osName")&&!i.isString(t.osName))return"osName: string expected";if(t.jvmTotalMemoery!=null&&t.hasOwnProperty("jvmTotalMemoery")&&!i.isInteger(t.jvmTotalMemoery)&&!(t.jvmTotalMemoery&&i.isInteger(t.jvmTotalMemoery.low)&&i.isInteger(t.jvmTotalMemoery.high)))return"jvmTotalMemoery: integer|Long expected";if(t.jvmFreeMemory!=null&&t.hasOwnProperty("jvmFreeMemory")&&!i.isInteger(t.jvmFreeMemory)&&!(t.jvmFreeMemory&&i.isInteger(t.jvmFreeMemory.low)&&i.isInteger(t.jvmFreeMemory.high)))return"jvmFreeMemory: integer|Long expected";if(t.processCpuRate!=null&&t.hasOwnProperty("processCpuRate")&&typeof t.processCpuRate!="number")return"processCpuRate: number expected";if(t.memoryDescInfoList!=null&&t.hasOwnProperty("memoryDescInfoList")){if(!Array.isArray(t.memoryDescInfoList))return"memoryDescInfoList: array expected";for(var n=0;n<t.memoryDescInfoList.length;++n){var l=d.protocol.NodeInfo.MachineInfo.MemoryDescInfo.verify(t.memoryDescInfoList[n]);if(l)return"memoryDescInfoList."+l}}if(t.deadLockThreadInfoList!=null&&t.hasOwnProperty("deadLockThreadInfoList")){if(!Array.isArray(t.deadLockThreadInfoList))return"deadLockThreadInfoList: array expected";for(var n=0;n<t.deadLockThreadInfoList.length;++n){var l=d.protocol.NodeInfo.MachineInfo.DeadLockThreadInfo.verify(t.deadLockThreadInfoList[n]);if(l)return"deadLockThreadInfoList."+l}}return null},o.fromObject=function(t){if(t instanceof d.protocol.NodeInfo.MachineInfo)return t;var n=new d.protocol.NodeInfo.MachineInfo;if(t.threadCount!=null&&(n.threadCount=t.threadCount|0),t.deadLockThreadCount!=null&&(n.deadLockThreadCount=t.deadLockThreadCount|0),t.cpuCount!=null&&(n.cpuCount=t.cpuCount|0),t.totalMemory!=null&&(i.Long?(n.totalMemory=i.Long.fromValue(t.totalMemory)).unsigned=!1:typeof t.totalMemory=="string"?n.totalMemory=parseInt(t.totalMemory,10):typeof t.totalMemory=="number"?n.totalMemory=t.totalMemory:typeof t.totalMemory=="object"&&(n.totalMemory=new i.LongBits(t.totalMemory.low>>>0,t.totalMemory.high>>>0).toNumber())),t.freeMemory!=null&&(i.Long?(n.freeMemory=i.Long.fromValue(t.freeMemory)).unsigned=!1:typeof t.freeMemory=="string"?n.freeMemory=parseInt(t.freeMemory,10):typeof t.freeMemory=="number"?n.freeMemory=t.freeMemory:typeof t.freeMemory=="object"&&(n.freeMemory=new i.LongBits(t.freeMemory.low>>>0,t.freeMemory.high>>>0).toNumber())),t.cpuRate!=null&&(n.cpuRate=Number(t.cpuRate)),t.javaVersion!=null&&(n.javaVersion=String(t.javaVersion)),t.osName!=null&&(n.osName=String(t.osName)),t.jvmTotalMemoery!=null&&(i.Long?(n.jvmTotalMemoery=i.Long.fromValue(t.jvmTotalMemoery)).unsigned=!1:typeof t.jvmTotalMemoery=="string"?n.jvmTotalMemoery=parseInt(t.jvmTotalMemoery,10):typeof t.jvmTotalMemoery=="number"?n.jvmTotalMemoery=t.jvmTotalMemoery:typeof t.jvmTotalMemoery=="object"&&(n.jvmTotalMemoery=new i.LongBits(t.jvmTotalMemoery.low>>>0,t.jvmTotalMemoery.high>>>0).toNumber())),t.jvmFreeMemory!=null&&(i.Long?(n.jvmFreeMemory=i.Long.fromValue(t.jvmFreeMemory)).unsigned=!1:typeof t.jvmFreeMemory=="string"?n.jvmFreeMemory=parseInt(t.jvmFreeMemory,10):typeof t.jvmFreeMemory=="number"?n.jvmFreeMemory=t.jvmFreeMemory:typeof t.jvmFreeMemory=="object"&&(n.jvmFreeMemory=new i.LongBits(t.jvmFreeMemory.low>>>0,t.jvmFreeMemory.high>>>0).toNumber())),t.processCpuRate!=null&&(n.processCpuRate=Number(t.processCpuRate)),t.memoryDescInfoList){if(!Array.isArray(t.memoryDescInfoList))throw TypeError(".protocol.NodeInfo.MachineInfo.memoryDescInfoList: array expected");n.memoryDescInfoList=[];for(var l=0;l<t.memoryDescInfoList.length;++l){if(typeof t.memoryDescInfoList[l]!="object")throw TypeError(".protocol.NodeInfo.MachineInfo.memoryDescInfoList: object expected");n.memoryDescInfoList[l]=d.protocol.NodeInfo.MachineInfo.MemoryDescInfo.fromObject(t.memoryDescInfoList[l])}}if(t.deadLockThreadInfoList){if(!Array.isArray(t.deadLockThreadInfoList))throw TypeError(".protocol.NodeInfo.MachineInfo.deadLockThreadInfoList: array expected");n.deadLockThreadInfoList=[];for(var l=0;l<t.deadLockThreadInfoList.length;++l){if(typeof t.deadLockThreadInfoList[l]!="object")throw TypeError(".protocol.NodeInfo.MachineInfo.deadLockThreadInfoList: object expected");n.deadLockThreadInfoList[l]=d.protocol.NodeInfo.MachineInfo.DeadLockThreadInfo.fromObject(t.deadLockThreadInfoList[l])}}return n},o.toObject=function(t,n){n||(n={});var l={};if((n.arrays||n.defaults)&&(l.memoryDescInfoList=[],l.deadLockThreadInfoList=[]),n.defaults){if(l.threadCount=0,l.deadLockThreadCount=0,l.cpuCount=0,i.Long){var c=new i.Long(0,0,!1);l.totalMemory=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.totalMemory=n.longs===String?"0":0;if(i.Long){var c=new i.Long(0,0,!1);l.freeMemory=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.freeMemory=n.longs===String?"0":0;if(l.cpuRate=0,l.javaVersion="",l.osName="",i.Long){var c=new i.Long(0,0,!1);l.jvmTotalMemoery=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.jvmTotalMemoery=n.longs===String?"0":0;if(i.Long){var c=new i.Long(0,0,!1);l.jvmFreeMemory=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.jvmFreeMemory=n.longs===String?"0":0;l.processCpuRate=0}if(t.threadCount!=null&&t.hasOwnProperty("threadCount")&&(l.threadCount=t.threadCount),t.deadLockThreadCount!=null&&t.hasOwnProperty("deadLockThreadCount")&&(l.deadLockThreadCount=t.deadLockThreadCount),t.cpuCount!=null&&t.hasOwnProperty("cpuCount")&&(l.cpuCount=t.cpuCount),t.totalMemory!=null&&t.hasOwnProperty("totalMemory")&&(typeof t.totalMemory=="number"?l.totalMemory=n.longs===String?String(t.totalMemory):t.totalMemory:l.totalMemory=n.longs===String?i.Long.prototype.toString.call(t.totalMemory):n.longs===Number?new i.LongBits(t.totalMemory.low>>>0,t.totalMemory.high>>>0).toNumber():t.totalMemory),t.freeMemory!=null&&t.hasOwnProperty("freeMemory")&&(typeof t.freeMemory=="number"?l.freeMemory=n.longs===String?String(t.freeMemory):t.freeMemory:l.freeMemory=n.longs===String?i.Long.prototype.toString.call(t.freeMemory):n.longs===Number?new i.LongBits(t.freeMemory.low>>>0,t.freeMemory.high>>>0).toNumber():t.freeMemory),t.cpuRate!=null&&t.hasOwnProperty("cpuRate")&&(l.cpuRate=n.json&&!isFinite(t.cpuRate)?String(t.cpuRate):t.cpuRate),t.javaVersion!=null&&t.hasOwnProperty("javaVersion")&&(l.javaVersion=t.javaVersion),t.osName!=null&&t.hasOwnProperty("osName")&&(l.osName=t.osName),t.jvmTotalMemoery!=null&&t.hasOwnProperty("jvmTotalMemoery")&&(typeof t.jvmTotalMemoery=="number"?l.jvmTotalMemoery=n.longs===String?String(t.jvmTotalMemoery):t.jvmTotalMemoery:l.jvmTotalMemoery=n.longs===String?i.Long.prototype.toString.call(t.jvmTotalMemoery):n.longs===Number?new i.LongBits(t.jvmTotalMemoery.low>>>0,t.jvmTotalMemoery.high>>>0).toNumber():t.jvmTotalMemoery),t.jvmFreeMemory!=null&&t.hasOwnProperty("jvmFreeMemory")&&(typeof t.jvmFreeMemory=="number"?l.jvmFreeMemory=n.longs===String?String(t.jvmFreeMemory):t.jvmFreeMemory:l.jvmFreeMemory=n.longs===String?i.Long.prototype.toString.call(t.jvmFreeMemory):n.longs===Number?new i.LongBits(t.jvmFreeMemory.low>>>0,t.jvmFreeMemory.high>>>0).toNumber():t.jvmFreeMemory),t.processCpuRate!=null&&t.hasOwnProperty("processCpuRate")&&(l.processCpuRate=n.json&&!isFinite(t.processCpuRate)?String(t.processCpuRate):t.processCpuRate),t.memoryDescInfoList&&t.memoryDescInfoList.length){l.memoryDescInfoList=[];for(var u=0;u<t.memoryDescInfoList.length;++u)l.memoryDescInfoList[u]=d.protocol.NodeInfo.MachineInfo.MemoryDescInfo.toObject(t.memoryDescInfoList[u],n)}if(t.deadLockThreadInfoList&&t.deadLockThreadInfoList.length){l.deadLockThreadInfoList=[];for(var u=0;u<t.deadLockThreadInfoList.length;++u)l.deadLockThreadInfoList[u]=d.protocol.NodeInfo.MachineInfo.DeadLockThreadInfo.toObject(t.deadLockThreadInfoList[u],n)}return l},o.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},o.MemoryDescInfo=function(){function e(t){if(t)for(var n=Object.keys(t),l=0;l<n.length;++l)t[n[l]]!=null&&(this[n[l]]=t[n[l]])}return e.prototype.name="",e.prototype.initSize=i.Long?i.Long.fromBits(0,0,!1):0,e.prototype.useSize=i.Long?i.Long.fromBits(0,0,!1):0,e.prototype.maxSize=i.Long?i.Long.fromBits(0,0,!1):0,e.prototype.useRate=0,e.create=function(n){return new e(n)},e.encode=function(n,l){return l||(l=H.create()),n.name!=null&&Object.hasOwnProperty.call(n,"name")&&l.uint32(10).string(n.name),n.initSize!=null&&Object.hasOwnProperty.call(n,"initSize")&&l.uint32(16).int64(n.initSize),n.useSize!=null&&Object.hasOwnProperty.call(n,"useSize")&&l.uint32(24).int64(n.useSize),n.maxSize!=null&&Object.hasOwnProperty.call(n,"maxSize")&&l.uint32(32).int64(n.maxSize),n.useRate!=null&&Object.hasOwnProperty.call(n,"useRate")&&l.uint32(41).double(n.useRate),l},e.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},e.decode=function(n,l){n instanceof v||(n=v.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.protocol.NodeInfo.MachineInfo.MemoryDescInfo;n.pos<c;){var b=n.uint32();switch(b>>>3){case 1:u.name=n.string();break;case 2:u.initSize=n.int64();break;case 3:u.useSize=n.int64();break;case 4:u.maxSize=n.int64();break;case 5:u.useRate=n.double();break;default:n.skipType(b&7);break}}return u},e.decodeDelimited=function(n){return n instanceof v||(n=new v(n)),this.decode(n,n.uint32())},e.verify=function(n){return typeof n!="object"||n===null?"object expected":n.name!=null&&n.hasOwnProperty("name")&&!i.isString(n.name)?"name: string expected":n.initSize!=null&&n.hasOwnProperty("initSize")&&!i.isInteger(n.initSize)&&!(n.initSize&&i.isInteger(n.initSize.low)&&i.isInteger(n.initSize.high))?"initSize: integer|Long expected":n.useSize!=null&&n.hasOwnProperty("useSize")&&!i.isInteger(n.useSize)&&!(n.useSize&&i.isInteger(n.useSize.low)&&i.isInteger(n.useSize.high))?"useSize: integer|Long expected":n.maxSize!=null&&n.hasOwnProperty("maxSize")&&!i.isInteger(n.maxSize)&&!(n.maxSize&&i.isInteger(n.maxSize.low)&&i.isInteger(n.maxSize.high))?"maxSize: integer|Long expected":n.useRate!=null&&n.hasOwnProperty("useRate")&&typeof n.useRate!="number"?"useRate: number expected":null},e.fromObject=function(n){if(n instanceof d.protocol.NodeInfo.MachineInfo.MemoryDescInfo)return n;var l=new d.protocol.NodeInfo.MachineInfo.MemoryDescInfo;return n.name!=null&&(l.name=String(n.name)),n.initSize!=null&&(i.Long?(l.initSize=i.Long.fromValue(n.initSize)).unsigned=!1:typeof n.initSize=="string"?l.initSize=parseInt(n.initSize,10):typeof n.initSize=="number"?l.initSize=n.initSize:typeof n.initSize=="object"&&(l.initSize=new i.LongBits(n.initSize.low>>>0,n.initSize.high>>>0).toNumber())),n.useSize!=null&&(i.Long?(l.useSize=i.Long.fromValue(n.useSize)).unsigned=!1:typeof n.useSize=="string"?l.useSize=parseInt(n.useSize,10):typeof n.useSize=="number"?l.useSize=n.useSize:typeof n.useSize=="object"&&(l.useSize=new i.LongBits(n.useSize.low>>>0,n.useSize.high>>>0).toNumber())),n.maxSize!=null&&(i.Long?(l.maxSize=i.Long.fromValue(n.maxSize)).unsigned=!1:typeof n.maxSize=="string"?l.maxSize=parseInt(n.maxSize,10):typeof n.maxSize=="number"?l.maxSize=n.maxSize:typeof n.maxSize=="object"&&(l.maxSize=new i.LongBits(n.maxSize.low>>>0,n.maxSize.high>>>0).toNumber())),n.useRate!=null&&(l.useRate=Number(n.useRate)),l},e.toObject=function(n,l){l||(l={});var c={};if(l.defaults){if(c.name="",i.Long){var u=new i.Long(0,0,!1);c.initSize=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.initSize=l.longs===String?"0":0;if(i.Long){var u=new i.Long(0,0,!1);c.useSize=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.useSize=l.longs===String?"0":0;if(i.Long){var u=new i.Long(0,0,!1);c.maxSize=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.maxSize=l.longs===String?"0":0;c.useRate=0}return n.name!=null&&n.hasOwnProperty("name")&&(c.name=n.name),n.initSize!=null&&n.hasOwnProperty("initSize")&&(typeof n.initSize=="number"?c.initSize=l.longs===String?String(n.initSize):n.initSize:c.initSize=l.longs===String?i.Long.prototype.toString.call(n.initSize):l.longs===Number?new i.LongBits(n.initSize.low>>>0,n.initSize.high>>>0).toNumber():n.initSize),n.useSize!=null&&n.hasOwnProperty("useSize")&&(typeof n.useSize=="number"?c.useSize=l.longs===String?String(n.useSize):n.useSize:c.useSize=l.longs===String?i.Long.prototype.toString.call(n.useSize):l.longs===Number?new i.LongBits(n.useSize.low>>>0,n.useSize.high>>>0).toNumber():n.useSize),n.maxSize!=null&&n.hasOwnProperty("maxSize")&&(typeof n.maxSize=="number"?c.maxSize=l.longs===String?String(n.maxSize):n.maxSize:c.maxSize=l.longs===String?i.Long.prototype.toString.call(n.maxSize):l.longs===Number?new i.LongBits(n.maxSize.low>>>0,n.maxSize.high>>>0).toNumber():n.maxSize),n.useRate!=null&&n.hasOwnProperty("useRate")&&(c.useRate=l.json&&!isFinite(n.useRate)?String(n.useRate):n.useRate),c},e.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},e}(),o.DeadLockThreadInfo=function(){function e(t){if(t)for(var n=Object.keys(t),l=0;l<n.length;++l)t[n[l]]!=null&&(this[n[l]]=t[n[l]])}return e.prototype.name="",e.prototype.lockName="",e.prototype.lockOwner="",e.prototype.state="",e.prototype.blockTime=i.Long?i.Long.fromBits(0,0,!1):0,e.prototype.waitTime=i.Long?i.Long.fromBits(0,0,!1):0,e.prototype.stackTrace="",e.create=function(n){return new e(n)},e.encode=function(n,l){return l||(l=H.create()),n.name!=null&&Object.hasOwnProperty.call(n,"name")&&l.uint32(10).string(n.name),n.lockName!=null&&Object.hasOwnProperty.call(n,"lockName")&&l.uint32(18).string(n.lockName),n.lockOwner!=null&&Object.hasOwnProperty.call(n,"lockOwner")&&l.uint32(26).string(n.lockOwner),n.state!=null&&Object.hasOwnProperty.call(n,"state")&&l.uint32(34).string(n.state),n.blockTime!=null&&Object.hasOwnProperty.call(n,"blockTime")&&l.uint32(40).int64(n.blockTime),n.waitTime!=null&&Object.hasOwnProperty.call(n,"waitTime")&&l.uint32(48).int64(n.waitTime),n.stackTrace!=null&&Object.hasOwnProperty.call(n,"stackTrace")&&l.uint32(58).string(n.stackTrace),l},e.encodeDelimited=function(n,l){return this.encode(n,l).ldelim()},e.decode=function(n,l){n instanceof v||(n=v.create(n));for(var c=l===void 0?n.len:n.pos+l,u=new d.protocol.NodeInfo.MachineInfo.DeadLockThreadInfo;n.pos<c;){var b=n.uint32();switch(b>>>3){case 1:u.name=n.string();break;case 2:u.lockName=n.string();break;case 3:u.lockOwner=n.string();break;case 4:u.state=n.string();break;case 5:u.blockTime=n.int64();break;case 6:u.waitTime=n.int64();break;case 7:u.stackTrace=n.string();break;default:n.skipType(b&7);break}}return u},e.decodeDelimited=function(n){return n instanceof v||(n=new v(n)),this.decode(n,n.uint32())},e.verify=function(n){return typeof n!="object"||n===null?"object expected":n.name!=null&&n.hasOwnProperty("name")&&!i.isString(n.name)?"name: string expected":n.lockName!=null&&n.hasOwnProperty("lockName")&&!i.isString(n.lockName)?"lockName: string expected":n.lockOwner!=null&&n.hasOwnProperty("lockOwner")&&!i.isString(n.lockOwner)?"lockOwner: string expected":n.state!=null&&n.hasOwnProperty("state")&&!i.isString(n.state)?"state: string expected":n.blockTime!=null&&n.hasOwnProperty("blockTime")&&!i.isInteger(n.blockTime)&&!(n.blockTime&&i.isInteger(n.blockTime.low)&&i.isInteger(n.blockTime.high))?"blockTime: integer|Long expected":n.waitTime!=null&&n.hasOwnProperty("waitTime")&&!i.isInteger(n.waitTime)&&!(n.waitTime&&i.isInteger(n.waitTime.low)&&i.isInteger(n.waitTime.high))?"waitTime: integer|Long expected":n.stackTrace!=null&&n.hasOwnProperty("stackTrace")&&!i.isString(n.stackTrace)?"stackTrace: string expected":null},e.fromObject=function(n){if(n instanceof d.protocol.NodeInfo.MachineInfo.DeadLockThreadInfo)return n;var l=new d.protocol.NodeInfo.MachineInfo.DeadLockThreadInfo;return n.name!=null&&(l.name=String(n.name)),n.lockName!=null&&(l.lockName=String(n.lockName)),n.lockOwner!=null&&(l.lockOwner=String(n.lockOwner)),n.state!=null&&(l.state=String(n.state)),n.blockTime!=null&&(i.Long?(l.blockTime=i.Long.fromValue(n.blockTime)).unsigned=!1:typeof n.blockTime=="string"?l.blockTime=parseInt(n.blockTime,10):typeof n.blockTime=="number"?l.blockTime=n.blockTime:typeof n.blockTime=="object"&&(l.blockTime=new i.LongBits(n.blockTime.low>>>0,n.blockTime.high>>>0).toNumber())),n.waitTime!=null&&(i.Long?(l.waitTime=i.Long.fromValue(n.waitTime)).unsigned=!1:typeof n.waitTime=="string"?l.waitTime=parseInt(n.waitTime,10):typeof n.waitTime=="number"?l.waitTime=n.waitTime:typeof n.waitTime=="object"&&(l.waitTime=new i.LongBits(n.waitTime.low>>>0,n.waitTime.high>>>0).toNumber())),n.stackTrace!=null&&(l.stackTrace=String(n.stackTrace)),l},e.toObject=function(n,l){l||(l={});var c={};if(l.defaults){if(c.name="",c.lockName="",c.lockOwner="",c.state="",i.Long){var u=new i.Long(0,0,!1);c.blockTime=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.blockTime=l.longs===String?"0":0;if(i.Long){var u=new i.Long(0,0,!1);c.waitTime=l.longs===String?u.toString():l.longs===Number?u.toNumber():u}else c.waitTime=l.longs===String?"0":0;c.stackTrace=""}return n.name!=null&&n.hasOwnProperty("name")&&(c.name=n.name),n.lockName!=null&&n.hasOwnProperty("lockName")&&(c.lockName=n.lockName),n.lockOwner!=null&&n.hasOwnProperty("lockOwner")&&(c.lockOwner=n.lockOwner),n.state!=null&&n.hasOwnProperty("state")&&(c.state=n.state),n.blockTime!=null&&n.hasOwnProperty("blockTime")&&(typeof n.blockTime=="number"?c.blockTime=l.longs===String?String(n.blockTime):n.blockTime:c.blockTime=l.longs===String?i.Long.prototype.toString.call(n.blockTime):l.longs===Number?new i.LongBits(n.blockTime.low>>>0,n.blockTime.high>>>0).toNumber():n.blockTime),n.waitTime!=null&&n.hasOwnProperty("waitTime")&&(typeof n.waitTime=="number"?c.waitTime=l.longs===String?String(n.waitTime):n.waitTime:c.waitTime=l.longs===String?i.Long.prototype.toString.call(n.waitTime):l.longs===Number?new i.LongBits(n.waitTime.low>>>0,n.waitTime.high>>>0).toNumber():n.waitTime),n.stackTrace!=null&&n.hasOwnProperty("stackTrace")&&(c.stackTrace=n.stackTrace),c},e.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},e}(),o}(),r}(),f.Endpoint=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.address=i.newBuffer([]),r.prototype.port=0,r.prototype.nodeId=i.newBuffer([]),r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.address!=null&&Object.hasOwnProperty.call(e,"address")&&t.uint32(10).bytes(e.address),e.port!=null&&Object.hasOwnProperty.call(e,"port")&&t.uint32(16).int32(e.port),e.nodeId!=null&&Object.hasOwnProperty.call(e,"nodeId")&&t.uint32(26).bytes(e.nodeId),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.Endpoint;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.address=e.bytes();break;case 2:l.port=e.int32();break;case 3:l.nodeId=e.bytes();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.address!=null&&e.hasOwnProperty("address")&&!(e.address&&typeof e.address.length=="number"||i.isString(e.address))?"address: buffer expected":e.port!=null&&e.hasOwnProperty("port")&&!i.isInteger(e.port)?"port: integer expected":e.nodeId!=null&&e.hasOwnProperty("nodeId")&&!(e.nodeId&&typeof e.nodeId.length=="number"||i.isString(e.nodeId))?"nodeId: buffer expected":null},r.fromObject=function(e){if(e instanceof d.protocol.Endpoint)return e;var t=new d.protocol.Endpoint;return e.address!=null&&(typeof e.address=="string"?i.base64.decode(e.address,t.address=i.newBuffer(i.base64.length(e.address)),0):e.address.length&&(t.address=e.address)),e.port!=null&&(t.port=e.port|0),e.nodeId!=null&&(typeof e.nodeId=="string"?i.base64.decode(e.nodeId,t.nodeId=i.newBuffer(i.base64.length(e.nodeId)),0):e.nodeId.length&&(t.nodeId=e.nodeId)),t},r.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(t.bytes===String?n.address="":(n.address=[],t.bytes!==Array&&(n.address=i.newBuffer(n.address))),n.port=0,t.bytes===String?n.nodeId="":(n.nodeId=[],t.bytes!==Array&&(n.nodeId=i.newBuffer(n.nodeId)))),e.address!=null&&e.hasOwnProperty("address")&&(n.address=t.bytes===String?i.base64.encode(e.address,0,e.address.length):t.bytes===Array?Array.prototype.slice.call(e.address):e.address),e.port!=null&&e.hasOwnProperty("port")&&(n.port=e.port),e.nodeId!=null&&e.hasOwnProperty("nodeId")&&(n.nodeId=t.bytes===String?i.base64.encode(e.nodeId,0,e.nodeId.length):t.bytes===Array?Array.prototype.slice.call(e.nodeId):e.nodeId),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.PingMessage=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.from=null,r.prototype.to=null,r.prototype.version=0,r.prototype.timestamp=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.from!=null&&Object.hasOwnProperty.call(e,"from")&&d.protocol.Endpoint.encode(e.from,t.uint32(10).fork()).ldelim(),e.to!=null&&Object.hasOwnProperty.call(e,"to")&&d.protocol.Endpoint.encode(e.to,t.uint32(18).fork()).ldelim(),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&t.uint32(24).int32(e.version),e.timestamp!=null&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(32).int64(e.timestamp),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.PingMessage;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.from=d.protocol.Endpoint.decode(e,e.uint32());break;case 2:l.to=d.protocol.Endpoint.decode(e,e.uint32());break;case 3:l.version=e.int32();break;case 4:l.timestamp=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.from!=null&&e.hasOwnProperty("from")){var t=d.protocol.Endpoint.verify(e.from);if(t)return"from."+t}if(e.to!=null&&e.hasOwnProperty("to")){var t=d.protocol.Endpoint.verify(e.to);if(t)return"to."+t}return e.version!=null&&e.hasOwnProperty("version")&&!i.isInteger(e.version)?"version: integer expected":e.timestamp!=null&&e.hasOwnProperty("timestamp")&&!i.isInteger(e.timestamp)&&!(e.timestamp&&i.isInteger(e.timestamp.low)&&i.isInteger(e.timestamp.high))?"timestamp: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.PingMessage)return e;var t=new d.protocol.PingMessage;if(e.from!=null){if(typeof e.from!="object")throw TypeError(".protocol.PingMessage.from: object expected");t.from=d.protocol.Endpoint.fromObject(e.from)}if(e.to!=null){if(typeof e.to!="object")throw TypeError(".protocol.PingMessage.to: object expected");t.to=d.protocol.Endpoint.fromObject(e.to)}return e.version!=null&&(t.version=e.version|0),e.timestamp!=null&&(i.Long?(t.timestamp=i.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?t.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?t.timestamp=e.timestamp:typeof e.timestamp=="object"&&(t.timestamp=new i.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults)if(n.from=null,n.to=null,n.version=0,i.Long){var l=new i.Long(0,0,!1);n.timestamp=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.timestamp=t.longs===String?"0":0;return e.from!=null&&e.hasOwnProperty("from")&&(n.from=d.protocol.Endpoint.toObject(e.from,t)),e.to!=null&&e.hasOwnProperty("to")&&(n.to=d.protocol.Endpoint.toObject(e.to,t)),e.version!=null&&e.hasOwnProperty("version")&&(n.version=e.version),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?n.timestamp=t.longs===String?String(e.timestamp):e.timestamp:n.timestamp=t.longs===String?i.Long.prototype.toString.call(e.timestamp):t.longs===Number?new i.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber():e.timestamp),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.PongMessage=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.from=null,r.prototype.echo=0,r.prototype.timestamp=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.from!=null&&Object.hasOwnProperty.call(e,"from")&&d.protocol.Endpoint.encode(e.from,t.uint32(10).fork()).ldelim(),e.echo!=null&&Object.hasOwnProperty.call(e,"echo")&&t.uint32(16).int32(e.echo),e.timestamp!=null&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(24).int64(e.timestamp),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.PongMessage;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.from=d.protocol.Endpoint.decode(e,e.uint32());break;case 2:l.echo=e.int32();break;case 3:l.timestamp=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.from!=null&&e.hasOwnProperty("from")){var t=d.protocol.Endpoint.verify(e.from);if(t)return"from."+t}return e.echo!=null&&e.hasOwnProperty("echo")&&!i.isInteger(e.echo)?"echo: integer expected":e.timestamp!=null&&e.hasOwnProperty("timestamp")&&!i.isInteger(e.timestamp)&&!(e.timestamp&&i.isInteger(e.timestamp.low)&&i.isInteger(e.timestamp.high))?"timestamp: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.PongMessage)return e;var t=new d.protocol.PongMessage;if(e.from!=null){if(typeof e.from!="object")throw TypeError(".protocol.PongMessage.from: object expected");t.from=d.protocol.Endpoint.fromObject(e.from)}return e.echo!=null&&(t.echo=e.echo|0),e.timestamp!=null&&(i.Long?(t.timestamp=i.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?t.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?t.timestamp=e.timestamp:typeof e.timestamp=="object"&&(t.timestamp=new i.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults)if(n.from=null,n.echo=0,i.Long){var l=new i.Long(0,0,!1);n.timestamp=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.timestamp=t.longs===String?"0":0;return e.from!=null&&e.hasOwnProperty("from")&&(n.from=d.protocol.Endpoint.toObject(e.from,t)),e.echo!=null&&e.hasOwnProperty("echo")&&(n.echo=e.echo),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?n.timestamp=t.longs===String?String(e.timestamp):e.timestamp:n.timestamp=t.longs===String?i.Long.prototype.toString.call(e.timestamp):t.longs===Number?new i.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber():e.timestamp),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.FindNeighbours=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.from=null,r.prototype.targetId=i.newBuffer([]),r.prototype.timestamp=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.from!=null&&Object.hasOwnProperty.call(e,"from")&&d.protocol.Endpoint.encode(e.from,t.uint32(10).fork()).ldelim(),e.targetId!=null&&Object.hasOwnProperty.call(e,"targetId")&&t.uint32(18).bytes(e.targetId),e.timestamp!=null&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(24).int64(e.timestamp),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.FindNeighbours;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.from=d.protocol.Endpoint.decode(e,e.uint32());break;case 2:l.targetId=e.bytes();break;case 3:l.timestamp=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.from!=null&&e.hasOwnProperty("from")){var t=d.protocol.Endpoint.verify(e.from);if(t)return"from."+t}return e.targetId!=null&&e.hasOwnProperty("targetId")&&!(e.targetId&&typeof e.targetId.length=="number"||i.isString(e.targetId))?"targetId: buffer expected":e.timestamp!=null&&e.hasOwnProperty("timestamp")&&!i.isInteger(e.timestamp)&&!(e.timestamp&&i.isInteger(e.timestamp.low)&&i.isInteger(e.timestamp.high))?"timestamp: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.FindNeighbours)return e;var t=new d.protocol.FindNeighbours;if(e.from!=null){if(typeof e.from!="object")throw TypeError(".protocol.FindNeighbours.from: object expected");t.from=d.protocol.Endpoint.fromObject(e.from)}return e.targetId!=null&&(typeof e.targetId=="string"?i.base64.decode(e.targetId,t.targetId=i.newBuffer(i.base64.length(e.targetId)),0):e.targetId.length&&(t.targetId=e.targetId)),e.timestamp!=null&&(i.Long?(t.timestamp=i.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?t.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?t.timestamp=e.timestamp:typeof e.timestamp=="object"&&(t.timestamp=new i.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults)if(n.from=null,t.bytes===String?n.targetId="":(n.targetId=[],t.bytes!==Array&&(n.targetId=i.newBuffer(n.targetId))),i.Long){var l=new i.Long(0,0,!1);n.timestamp=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.timestamp=t.longs===String?"0":0;return e.from!=null&&e.hasOwnProperty("from")&&(n.from=d.protocol.Endpoint.toObject(e.from,t)),e.targetId!=null&&e.hasOwnProperty("targetId")&&(n.targetId=t.bytes===String?i.base64.encode(e.targetId,0,e.targetId.length):t.bytes===Array?Array.prototype.slice.call(e.targetId):e.targetId),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?n.timestamp=t.longs===String?String(e.timestamp):e.timestamp:n.timestamp=t.longs===String?i.Long.prototype.toString.call(e.timestamp):t.longs===Number?new i.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber():e.timestamp),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.Neighbours=function(){function r(o){if(this.neighbours=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.from=null,r.prototype.neighbours=i.emptyArray,r.prototype.timestamp=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.from!=null&&Object.hasOwnProperty.call(e,"from")&&d.protocol.Endpoint.encode(e.from,t.uint32(10).fork()).ldelim(),e.neighbours!=null&&e.neighbours.length)for(var n=0;n<e.neighbours.length;++n)d.protocol.Endpoint.encode(e.neighbours[n],t.uint32(18).fork()).ldelim();return e.timestamp!=null&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(24).int64(e.timestamp),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.Neighbours;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.from=d.protocol.Endpoint.decode(e,e.uint32());break;case 2:l.neighbours&&l.neighbours.length||(l.neighbours=[]),l.neighbours.push(d.protocol.Endpoint.decode(e,e.uint32()));break;case 3:l.timestamp=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.from!=null&&e.hasOwnProperty("from")){var t=d.protocol.Endpoint.verify(e.from);if(t)return"from."+t}if(e.neighbours!=null&&e.hasOwnProperty("neighbours")){if(!Array.isArray(e.neighbours))return"neighbours: array expected";for(var n=0;n<e.neighbours.length;++n){var t=d.protocol.Endpoint.verify(e.neighbours[n]);if(t)return"neighbours."+t}}return e.timestamp!=null&&e.hasOwnProperty("timestamp")&&!i.isInteger(e.timestamp)&&!(e.timestamp&&i.isInteger(e.timestamp.low)&&i.isInteger(e.timestamp.high))?"timestamp: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.Neighbours)return e;var t=new d.protocol.Neighbours;if(e.from!=null){if(typeof e.from!="object")throw TypeError(".protocol.Neighbours.from: object expected");t.from=d.protocol.Endpoint.fromObject(e.from)}if(e.neighbours){if(!Array.isArray(e.neighbours))throw TypeError(".protocol.Neighbours.neighbours: array expected");t.neighbours=[];for(var n=0;n<e.neighbours.length;++n){if(typeof e.neighbours[n]!="object")throw TypeError(".protocol.Neighbours.neighbours: object expected");t.neighbours[n]=d.protocol.Endpoint.fromObject(e.neighbours[n])}}return e.timestamp!=null&&(i.Long?(t.timestamp=i.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?t.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?t.timestamp=e.timestamp:typeof e.timestamp=="object"&&(t.timestamp=new i.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.neighbours=[]),t.defaults)if(n.from=null,i.Long){var l=new i.Long(0,0,!1);n.timestamp=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.timestamp=t.longs===String?"0":0;if(e.from!=null&&e.hasOwnProperty("from")&&(n.from=d.protocol.Endpoint.toObject(e.from,t)),e.neighbours&&e.neighbours.length){n.neighbours=[];for(var c=0;c<e.neighbours.length;++c)n.neighbours[c]=d.protocol.Endpoint.toObject(e.neighbours[c],t)}return e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?n.timestamp=t.longs===String?String(e.timestamp):e.timestamp:n.timestamp=t.longs===String?i.Long.prototype.toString.call(e.timestamp):t.longs===Number?new i.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber():e.timestamp),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.BackupMessage=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.flag=!1,r.prototype.priority=0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.flag!=null&&Object.hasOwnProperty.call(e,"flag")&&t.uint32(8).bool(e.flag),e.priority!=null&&Object.hasOwnProperty.call(e,"priority")&&t.uint32(16).int32(e.priority),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.BackupMessage;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.flag=e.bool();break;case 2:l.priority=e.int32();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.flag!=null&&e.hasOwnProperty("flag")&&typeof e.flag!="boolean"?"flag: boolean expected":e.priority!=null&&e.hasOwnProperty("priority")&&!i.isInteger(e.priority)?"priority: integer expected":null},r.fromObject=function(e){if(e instanceof d.protocol.BackupMessage)return e;var t=new d.protocol.BackupMessage;return e.flag!=null&&(t.flag=Boolean(e.flag)),e.priority!=null&&(t.priority=e.priority|0),t},r.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.flag=!1,n.priority=0),e.flag!=null&&e.hasOwnProperty("flag")&&(n.flag=e.flag),e.priority!=null&&e.hasOwnProperty("priority")&&(n.priority=e.priority),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.AccountCreateContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.accountAddress=i.newBuffer([]),r.prototype.type=0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.accountAddress!=null&&Object.hasOwnProperty.call(e,"accountAddress")&&t.uint32(18).bytes(e.accountAddress),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&t.uint32(24).int32(e.type),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.AccountCreateContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.accountAddress=e.bytes();break;case 3:l.type=e.int32();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress)))return"ownerAddress: buffer expected";if(e.accountAddress!=null&&e.hasOwnProperty("accountAddress")&&!(e.accountAddress&&typeof e.accountAddress.length=="number"||i.isString(e.accountAddress)))return"accountAddress: buffer expected";if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:break}return null},r.fromObject=function(e){if(e instanceof d.protocol.AccountCreateContract)return e;var t=new d.protocol.AccountCreateContract;switch(e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.accountAddress!=null&&(typeof e.accountAddress=="string"?i.base64.decode(e.accountAddress,t.accountAddress=i.newBuffer(i.base64.length(e.accountAddress)),0):e.accountAddress.length&&(t.accountAddress=e.accountAddress)),e.type){case"Normal":case 0:t.type=0;break;case"AssetIssue":case 1:t.type=1;break;case"Contract":case 2:t.type=2;break}return t},r.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),t.bytes===String?n.accountAddress="":(n.accountAddress=[],t.bytes!==Array&&(n.accountAddress=i.newBuffer(n.accountAddress))),n.type=t.enums===String?"Normal":0),e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.accountAddress!=null&&e.hasOwnProperty("accountAddress")&&(n.accountAddress=t.bytes===String?i.base64.encode(e.accountAddress,0,e.accountAddress.length):t.bytes===Array?Array.prototype.slice.call(e.accountAddress):e.accountAddress),e.type!=null&&e.hasOwnProperty("type")&&(n.type=t.enums===String?d.protocol.AccountType[e.type]:e.type),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.AccountUpdateContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.accountName=i.newBuffer([]),r.prototype.ownerAddress=i.newBuffer([]),r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.accountName!=null&&Object.hasOwnProperty.call(e,"accountName")&&t.uint32(10).bytes(e.accountName),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(18).bytes(e.ownerAddress),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.AccountUpdateContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.accountName=e.bytes();break;case 2:l.ownerAddress=e.bytes();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.accountName!=null&&e.hasOwnProperty("accountName")&&!(e.accountName&&typeof e.accountName.length=="number"||i.isString(e.accountName))?"accountName: buffer expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":null},r.fromObject=function(e){if(e instanceof d.protocol.AccountUpdateContract)return e;var t=new d.protocol.AccountUpdateContract;return e.accountName!=null&&(typeof e.accountName=="string"?i.base64.decode(e.accountName,t.accountName=i.newBuffer(i.base64.length(e.accountName)),0):e.accountName.length&&(t.accountName=e.accountName)),e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),t},r.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(t.bytes===String?n.accountName="":(n.accountName=[],t.bytes!==Array&&(n.accountName=i.newBuffer(n.accountName))),t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress)))),e.accountName!=null&&e.hasOwnProperty("accountName")&&(n.accountName=t.bytes===String?i.base64.encode(e.accountName,0,e.accountName.length):t.bytes===Array?Array.prototype.slice.call(e.accountName):e.accountName),e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.SetAccountIdContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.accountId=i.newBuffer([]),r.prototype.ownerAddress=i.newBuffer([]),r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.accountId!=null&&Object.hasOwnProperty.call(e,"accountId")&&t.uint32(10).bytes(e.accountId),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(18).bytes(e.ownerAddress),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.SetAccountIdContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.accountId=e.bytes();break;case 2:l.ownerAddress=e.bytes();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.accountId!=null&&e.hasOwnProperty("accountId")&&!(e.accountId&&typeof e.accountId.length=="number"||i.isString(e.accountId))?"accountId: buffer expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":null},r.fromObject=function(e){if(e instanceof d.protocol.SetAccountIdContract)return e;var t=new d.protocol.SetAccountIdContract;return e.accountId!=null&&(typeof e.accountId=="string"?i.base64.decode(e.accountId,t.accountId=i.newBuffer(i.base64.length(e.accountId)),0):e.accountId.length&&(t.accountId=e.accountId)),e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),t},r.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(t.bytes===String?n.accountId="":(n.accountId=[],t.bytes!==Array&&(n.accountId=i.newBuffer(n.accountId))),t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress)))),e.accountId!=null&&e.hasOwnProperty("accountId")&&(n.accountId=t.bytes===String?i.base64.encode(e.accountId,0,e.accountId.length):t.bytes===Array?Array.prototype.slice.call(e.accountId):e.accountId),e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.TransferContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.toAddress=i.newBuffer([]),r.prototype.amount=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.toAddress!=null&&Object.hasOwnProperty.call(e,"toAddress")&&t.uint32(18).bytes(e.toAddress),e.amount!=null&&Object.hasOwnProperty.call(e,"amount")&&t.uint32(24).int64(e.amount),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.TransferContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.toAddress=e.bytes();break;case 3:l.amount=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":e.toAddress!=null&&e.hasOwnProperty("toAddress")&&!(e.toAddress&&typeof e.toAddress.length=="number"||i.isString(e.toAddress))?"toAddress: buffer expected":e.amount!=null&&e.hasOwnProperty("amount")&&!i.isInteger(e.amount)&&!(e.amount&&i.isInteger(e.amount.low)&&i.isInteger(e.amount.high))?"amount: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.TransferContract)return e;var t=new d.protocol.TransferContract;return e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.toAddress!=null&&(typeof e.toAddress=="string"?i.base64.decode(e.toAddress,t.toAddress=i.newBuffer(i.base64.length(e.toAddress)),0):e.toAddress.length&&(t.toAddress=e.toAddress)),e.amount!=null&&(i.Long?(t.amount=i.Long.fromValue(e.amount)).unsigned=!1:typeof e.amount=="string"?t.amount=parseInt(e.amount,10):typeof e.amount=="number"?t.amount=e.amount:typeof e.amount=="object"&&(t.amount=new i.LongBits(e.amount.low>>>0,e.amount.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults)if(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),t.bytes===String?n.toAddress="":(n.toAddress=[],t.bytes!==Array&&(n.toAddress=i.newBuffer(n.toAddress))),i.Long){var l=new i.Long(0,0,!1);n.amount=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.amount=t.longs===String?"0":0;return e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.toAddress!=null&&e.hasOwnProperty("toAddress")&&(n.toAddress=t.bytes===String?i.base64.encode(e.toAddress,0,e.toAddress.length):t.bytes===Array?Array.prototype.slice.call(e.toAddress):e.toAddress),e.amount!=null&&e.hasOwnProperty("amount")&&(typeof e.amount=="number"?n.amount=t.longs===String?String(e.amount):e.amount:n.amount=t.longs===String?i.Long.prototype.toString.call(e.amount):t.longs===Number?new i.LongBits(e.amount.low>>>0,e.amount.high>>>0).toNumber():e.amount),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.TransferAssetContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.assetName=i.newBuffer([]),r.prototype.ownerAddress=i.newBuffer([]),r.prototype.toAddress=i.newBuffer([]),r.prototype.amount=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.assetName!=null&&Object.hasOwnProperty.call(e,"assetName")&&t.uint32(10).bytes(e.assetName),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(18).bytes(e.ownerAddress),e.toAddress!=null&&Object.hasOwnProperty.call(e,"toAddress")&&t.uint32(26).bytes(e.toAddress),e.amount!=null&&Object.hasOwnProperty.call(e,"amount")&&t.uint32(32).int64(e.amount),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.TransferAssetContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.assetName=e.bytes();break;case 2:l.ownerAddress=e.bytes();break;case 3:l.toAddress=e.bytes();break;case 4:l.amount=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.assetName!=null&&e.hasOwnProperty("assetName")&&!(e.assetName&&typeof e.assetName.length=="number"||i.isString(e.assetName))?"assetName: buffer expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":e.toAddress!=null&&e.hasOwnProperty("toAddress")&&!(e.toAddress&&typeof e.toAddress.length=="number"||i.isString(e.toAddress))?"toAddress: buffer expected":e.amount!=null&&e.hasOwnProperty("amount")&&!i.isInteger(e.amount)&&!(e.amount&&i.isInteger(e.amount.low)&&i.isInteger(e.amount.high))?"amount: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.TransferAssetContract)return e;var t=new d.protocol.TransferAssetContract;return e.assetName!=null&&(typeof e.assetName=="string"?i.base64.decode(e.assetName,t.assetName=i.newBuffer(i.base64.length(e.assetName)),0):e.assetName.length&&(t.assetName=e.assetName)),e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.toAddress!=null&&(typeof e.toAddress=="string"?i.base64.decode(e.toAddress,t.toAddress=i.newBuffer(i.base64.length(e.toAddress)),0):e.toAddress.length&&(t.toAddress=e.toAddress)),e.amount!=null&&(i.Long?(t.amount=i.Long.fromValue(e.amount)).unsigned=!1:typeof e.amount=="string"?t.amount=parseInt(e.amount,10):typeof e.amount=="number"?t.amount=e.amount:typeof e.amount=="object"&&(t.amount=new i.LongBits(e.amount.low>>>0,e.amount.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults)if(t.bytes===String?n.assetName="":(n.assetName=[],t.bytes!==Array&&(n.assetName=i.newBuffer(n.assetName))),t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),t.bytes===String?n.toAddress="":(n.toAddress=[],t.bytes!==Array&&(n.toAddress=i.newBuffer(n.toAddress))),i.Long){var l=new i.Long(0,0,!1);n.amount=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.amount=t.longs===String?"0":0;return e.assetName!=null&&e.hasOwnProperty("assetName")&&(n.assetName=t.bytes===String?i.base64.encode(e.assetName,0,e.assetName.length):t.bytes===Array?Array.prototype.slice.call(e.assetName):e.assetName),e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.toAddress!=null&&e.hasOwnProperty("toAddress")&&(n.toAddress=t.bytes===String?i.base64.encode(e.toAddress,0,e.toAddress.length):t.bytes===Array?Array.prototype.slice.call(e.toAddress):e.toAddress),e.amount!=null&&e.hasOwnProperty("amount")&&(typeof e.amount=="number"?n.amount=t.longs===String?String(e.amount):e.amount:n.amount=t.longs===String?i.Long.prototype.toString.call(e.amount):t.longs===Number?new i.LongBits(e.amount.low>>>0,e.amount.high>>>0).toNumber():e.amount),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.VoteAssetContract=function(){function r(o){if(this.voteAddress=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.voteAddress=i.emptyArray,r.prototype.support=!1,r.prototype.count=0,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.voteAddress!=null&&e.voteAddress.length)for(var n=0;n<e.voteAddress.length;++n)t.uint32(18).bytes(e.voteAddress[n]);return e.support!=null&&Object.hasOwnProperty.call(e,"support")&&t.uint32(24).bool(e.support),e.count!=null&&Object.hasOwnProperty.call(e,"count")&&t.uint32(40).int32(e.count),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.VoteAssetContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.voteAddress&&l.voteAddress.length||(l.voteAddress=[]),l.voteAddress.push(e.bytes());break;case 3:l.support=e.bool();break;case 5:l.count=e.int32();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress)))return"ownerAddress: buffer expected";if(e.voteAddress!=null&&e.hasOwnProperty("voteAddress")){if(!Array.isArray(e.voteAddress))return"voteAddress: array expected";for(var t=0;t<e.voteAddress.length;++t)if(!(e.voteAddress[t]&&typeof e.voteAddress[t].length=="number"||i.isString(e.voteAddress[t])))return"voteAddress: buffer[] expected"}return e.support!=null&&e.hasOwnProperty("support")&&typeof e.support!="boolean"?"support: boolean expected":e.count!=null&&e.hasOwnProperty("count")&&!i.isInteger(e.count)?"count: integer expected":null},r.fromObject=function(e){if(e instanceof d.protocol.VoteAssetContract)return e;var t=new d.protocol.VoteAssetContract;if(e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.voteAddress){if(!Array.isArray(e.voteAddress))throw TypeError(".protocol.VoteAssetContract.voteAddress: array expected");t.voteAddress=[];for(var n=0;n<e.voteAddress.length;++n)typeof e.voteAddress[n]=="string"?i.base64.decode(e.voteAddress[n],t.voteAddress[n]=i.newBuffer(i.base64.length(e.voteAddress[n])),0):e.voteAddress[n].length&&(t.voteAddress[n]=e.voteAddress[n])}return e.support!=null&&(t.support=Boolean(e.support)),e.count!=null&&(t.count=e.count|0),t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.voteAddress=[]),t.defaults&&(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),n.support=!1,n.count=0),e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.voteAddress&&e.voteAddress.length){n.voteAddress=[];for(var l=0;l<e.voteAddress.length;++l)n.voteAddress[l]=t.bytes===String?i.base64.encode(e.voteAddress[l],0,e.voteAddress[l].length):t.bytes===Array?Array.prototype.slice.call(e.voteAddress[l]):e.voteAddress[l]}return e.support!=null&&e.hasOwnProperty("support")&&(n.support=e.support),e.count!=null&&e.hasOwnProperty("count")&&(n.count=e.count),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.VoteWitnessContract=function(){function r(o){if(this.votes=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.votes=i.emptyArray,r.prototype.support=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.votes!=null&&e.votes.length)for(var n=0;n<e.votes.length;++n)d.protocol.VoteWitnessContract.Vote.encode(e.votes[n],t.uint32(18).fork()).ldelim();return e.support!=null&&Object.hasOwnProperty.call(e,"support")&&t.uint32(24).bool(e.support),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.VoteWitnessContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.votes&&l.votes.length||(l.votes=[]),l.votes.push(d.protocol.VoteWitnessContract.Vote.decode(e,e.uint32()));break;case 3:l.support=e.bool();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress)))return"ownerAddress: buffer expected";if(e.votes!=null&&e.hasOwnProperty("votes")){if(!Array.isArray(e.votes))return"votes: array expected";for(var t=0;t<e.votes.length;++t){var n=d.protocol.VoteWitnessContract.Vote.verify(e.votes[t]);if(n)return"votes."+n}}return e.support!=null&&e.hasOwnProperty("support")&&typeof e.support!="boolean"?"support: boolean expected":null},r.fromObject=function(e){if(e instanceof d.protocol.VoteWitnessContract)return e;var t=new d.protocol.VoteWitnessContract;if(e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.votes){if(!Array.isArray(e.votes))throw TypeError(".protocol.VoteWitnessContract.votes: array expected");t.votes=[];for(var n=0;n<e.votes.length;++n){if(typeof e.votes[n]!="object")throw TypeError(".protocol.VoteWitnessContract.votes: object expected");t.votes[n]=d.protocol.VoteWitnessContract.Vote.fromObject(e.votes[n])}}return e.support!=null&&(t.support=Boolean(e.support)),t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.votes=[]),t.defaults&&(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),n.support=!1),e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.votes&&e.votes.length){n.votes=[];for(var l=0;l<e.votes.length;++l)n.votes[l]=d.protocol.VoteWitnessContract.Vote.toObject(e.votes[l],t)}return e.support!=null&&e.hasOwnProperty("support")&&(n.support=e.support),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r.Vote=function(){function o(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return o.prototype.voteAddress=i.newBuffer([]),o.prototype.voteCount=i.Long?i.Long.fromBits(0,0,!1):0,o.create=function(t){return new o(t)},o.encode=function(t,n){return n||(n=H.create()),t.voteAddress!=null&&Object.hasOwnProperty.call(t,"voteAddress")&&n.uint32(10).bytes(t.voteAddress),t.voteCount!=null&&Object.hasOwnProperty.call(t,"voteCount")&&n.uint32(16).int64(t.voteCount),n},o.encodeDelimited=function(t,n){return this.encode(t,n).ldelim()},o.decode=function(t,n){t instanceof v||(t=v.create(t));for(var l=n===void 0?t.len:t.pos+n,c=new d.protocol.VoteWitnessContract.Vote;t.pos<l;){var u=t.uint32();switch(u>>>3){case 1:c.voteAddress=t.bytes();break;case 2:c.voteCount=t.int64();break;default:t.skipType(u&7);break}}return c},o.decodeDelimited=function(t){return t instanceof v||(t=new v(t)),this.decode(t,t.uint32())},o.verify=function(t){return typeof t!="object"||t===null?"object expected":t.voteAddress!=null&&t.hasOwnProperty("voteAddress")&&!(t.voteAddress&&typeof t.voteAddress.length=="number"||i.isString(t.voteAddress))?"voteAddress: buffer expected":t.voteCount!=null&&t.hasOwnProperty("voteCount")&&!i.isInteger(t.voteCount)&&!(t.voteCount&&i.isInteger(t.voteCount.low)&&i.isInteger(t.voteCount.high))?"voteCount: integer|Long expected":null},o.fromObject=function(t){if(t instanceof d.protocol.VoteWitnessContract.Vote)return t;var n=new d.protocol.VoteWitnessContract.Vote;return t.voteAddress!=null&&(typeof t.voteAddress=="string"?i.base64.decode(t.voteAddress,n.voteAddress=i.newBuffer(i.base64.length(t.voteAddress)),0):t.voteAddress.length&&(n.voteAddress=t.voteAddress)),t.voteCount!=null&&(i.Long?(n.voteCount=i.Long.fromValue(t.voteCount)).unsigned=!1:typeof t.voteCount=="string"?n.voteCount=parseInt(t.voteCount,10):typeof t.voteCount=="number"?n.voteCount=t.voteCount:typeof t.voteCount=="object"&&(n.voteCount=new i.LongBits(t.voteCount.low>>>0,t.voteCount.high>>>0).toNumber())),n},o.toObject=function(t,n){n||(n={});var l={};if(n.defaults)if(n.bytes===String?l.voteAddress="":(l.voteAddress=[],n.bytes!==Array&&(l.voteAddress=i.newBuffer(l.voteAddress))),i.Long){var c=new i.Long(0,0,!1);l.voteCount=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.voteCount=n.longs===String?"0":0;return t.voteAddress!=null&&t.hasOwnProperty("voteAddress")&&(l.voteAddress=n.bytes===String?i.base64.encode(t.voteAddress,0,t.voteAddress.length):n.bytes===Array?Array.prototype.slice.call(t.voteAddress):t.voteAddress),t.voteCount!=null&&t.hasOwnProperty("voteCount")&&(typeof t.voteCount=="number"?l.voteCount=n.longs===String?String(t.voteCount):t.voteCount:l.voteCount=n.longs===String?i.Long.prototype.toString.call(t.voteCount):n.longs===Number?new i.LongBits(t.voteCount.low>>>0,t.voteCount.high>>>0).toNumber():t.voteCount),l},o.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},o}(),r}(),f.UpdateSettingContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.contractAddress=i.newBuffer([]),r.prototype.consumeUserResourcePercent=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.contractAddress!=null&&Object.hasOwnProperty.call(e,"contractAddress")&&t.uint32(18).bytes(e.contractAddress),e.consumeUserResourcePercent!=null&&Object.hasOwnProperty.call(e,"consumeUserResourcePercent")&&t.uint32(24).int64(e.consumeUserResourcePercent),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.UpdateSettingContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.contractAddress=e.bytes();break;case 3:l.consumeUserResourcePercent=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":e.contractAddress!=null&&e.hasOwnProperty("contractAddress")&&!(e.contractAddress&&typeof e.contractAddress.length=="number"||i.isString(e.contractAddress))?"contractAddress: buffer expected":e.consumeUserResourcePercent!=null&&e.hasOwnProperty("consumeUserResourcePercent")&&!i.isInteger(e.consumeUserResourcePercent)&&!(e.consumeUserResourcePercent&&i.isInteger(e.consumeUserResourcePercent.low)&&i.isInteger(e.consumeUserResourcePercent.high))?"consumeUserResourcePercent: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.UpdateSettingContract)return e;var t=new d.protocol.UpdateSettingContract;return e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.contractAddress!=null&&(typeof e.contractAddress=="string"?i.base64.decode(e.contractAddress,t.contractAddress=i.newBuffer(i.base64.length(e.contractAddress)),0):e.contractAddress.length&&(t.contractAddress=e.contractAddress)),e.consumeUserResourcePercent!=null&&(i.Long?(t.consumeUserResourcePercent=i.Long.fromValue(e.consumeUserResourcePercent)).unsigned=!1:typeof e.consumeUserResourcePercent=="string"?t.consumeUserResourcePercent=parseInt(e.consumeUserResourcePercent,10):typeof e.consumeUserResourcePercent=="number"?t.consumeUserResourcePercent=e.consumeUserResourcePercent:typeof e.consumeUserResourcePercent=="object"&&(t.consumeUserResourcePercent=new i.LongBits(e.consumeUserResourcePercent.low>>>0,e.consumeUserResourcePercent.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults)if(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),t.bytes===String?n.contractAddress="":(n.contractAddress=[],t.bytes!==Array&&(n.contractAddress=i.newBuffer(n.contractAddress))),i.Long){var l=new i.Long(0,0,!1);n.consumeUserResourcePercent=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.consumeUserResourcePercent=t.longs===String?"0":0;return e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.contractAddress!=null&&e.hasOwnProperty("contractAddress")&&(n.contractAddress=t.bytes===String?i.base64.encode(e.contractAddress,0,e.contractAddress.length):t.bytes===Array?Array.prototype.slice.call(e.contractAddress):e.contractAddress),e.consumeUserResourcePercent!=null&&e.hasOwnProperty("consumeUserResourcePercent")&&(typeof e.consumeUserResourcePercent=="number"?n.consumeUserResourcePercent=t.longs===String?String(e.consumeUserResourcePercent):e.consumeUserResourcePercent:n.consumeUserResourcePercent=t.longs===String?i.Long.prototype.toString.call(e.consumeUserResourcePercent):t.longs===Number?new i.LongBits(e.consumeUserResourcePercent.low>>>0,e.consumeUserResourcePercent.high>>>0).toNumber():e.consumeUserResourcePercent),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.UpdateEnergyLimitContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.contractAddress=i.newBuffer([]),r.prototype.originEnergyLimit=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.contractAddress!=null&&Object.hasOwnProperty.call(e,"contractAddress")&&t.uint32(18).bytes(e.contractAddress),e.originEnergyLimit!=null&&Object.hasOwnProperty.call(e,"originEnergyLimit")&&t.uint32(24).int64(e.originEnergyLimit),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.UpdateEnergyLimitContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.contractAddress=e.bytes();break;case 3:l.originEnergyLimit=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":e.contractAddress!=null&&e.hasOwnProperty("contractAddress")&&!(e.contractAddress&&typeof e.contractAddress.length=="number"||i.isString(e.contractAddress))?"contractAddress: buffer expected":e.originEnergyLimit!=null&&e.hasOwnProperty("originEnergyLimit")&&!i.isInteger(e.originEnergyLimit)&&!(e.originEnergyLimit&&i.isInteger(e.originEnergyLimit.low)&&i.isInteger(e.originEnergyLimit.high))?"originEnergyLimit: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.UpdateEnergyLimitContract)return e;var t=new d.protocol.UpdateEnergyLimitContract;return e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.contractAddress!=null&&(typeof e.contractAddress=="string"?i.base64.decode(e.contractAddress,t.contractAddress=i.newBuffer(i.base64.length(e.contractAddress)),0):e.contractAddress.length&&(t.contractAddress=e.contractAddress)),e.originEnergyLimit!=null&&(i.Long?(t.originEnergyLimit=i.Long.fromValue(e.originEnergyLimit)).unsigned=!1:typeof e.originEnergyLimit=="string"?t.originEnergyLimit=parseInt(e.originEnergyLimit,10):typeof e.originEnergyLimit=="number"?t.originEnergyLimit=e.originEnergyLimit:typeof e.originEnergyLimit=="object"&&(t.originEnergyLimit=new i.LongBits(e.originEnergyLimit.low>>>0,e.originEnergyLimit.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults)if(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),t.bytes===String?n.contractAddress="":(n.contractAddress=[],t.bytes!==Array&&(n.contractAddress=i.newBuffer(n.contractAddress))),i.Long){var l=new i.Long(0,0,!1);n.originEnergyLimit=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.originEnergyLimit=t.longs===String?"0":0;return e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.contractAddress!=null&&e.hasOwnProperty("contractAddress")&&(n.contractAddress=t.bytes===String?i.base64.encode(e.contractAddress,0,e.contractAddress.length):t.bytes===Array?Array.prototype.slice.call(e.contractAddress):e.contractAddress),e.originEnergyLimit!=null&&e.hasOwnProperty("originEnergyLimit")&&(typeof e.originEnergyLimit=="number"?n.originEnergyLimit=t.longs===String?String(e.originEnergyLimit):e.originEnergyLimit:n.originEnergyLimit=t.longs===String?i.Long.prototype.toString.call(e.originEnergyLimit):t.longs===Number?new i.LongBits(e.originEnergyLimit.low>>>0,e.originEnergyLimit.high>>>0).toNumber():e.originEnergyLimit),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.ClearABIContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.contractAddress=i.newBuffer([]),r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.contractAddress!=null&&Object.hasOwnProperty.call(e,"contractAddress")&&t.uint32(18).bytes(e.contractAddress),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.ClearABIContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.contractAddress=e.bytes();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":e.contractAddress!=null&&e.hasOwnProperty("contractAddress")&&!(e.contractAddress&&typeof e.contractAddress.length=="number"||i.isString(e.contractAddress))?"contractAddress: buffer expected":null},r.fromObject=function(e){if(e instanceof d.protocol.ClearABIContract)return e;var t=new d.protocol.ClearABIContract;return e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.contractAddress!=null&&(typeof e.contractAddress=="string"?i.base64.decode(e.contractAddress,t.contractAddress=i.newBuffer(i.base64.length(e.contractAddress)),0):e.contractAddress.length&&(t.contractAddress=e.contractAddress)),t},r.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),t.bytes===String?n.contractAddress="":(n.contractAddress=[],t.bytes!==Array&&(n.contractAddress=i.newBuffer(n.contractAddress)))),e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.contractAddress!=null&&e.hasOwnProperty("contractAddress")&&(n.contractAddress=t.bytes===String?i.base64.encode(e.contractAddress,0,e.contractAddress.length):t.bytes===Array?Array.prototype.slice.call(e.contractAddress):e.contractAddress),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.WitnessCreateContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.url=i.newBuffer([]),r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.url!=null&&Object.hasOwnProperty.call(e,"url")&&t.uint32(18).bytes(e.url),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.WitnessCreateContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.url=e.bytes();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":e.url!=null&&e.hasOwnProperty("url")&&!(e.url&&typeof e.url.length=="number"||i.isString(e.url))?"url: buffer expected":null},r.fromObject=function(e){if(e instanceof d.protocol.WitnessCreateContract)return e;var t=new d.protocol.WitnessCreateContract;return e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.url!=null&&(typeof e.url=="string"?i.base64.decode(e.url,t.url=i.newBuffer(i.base64.length(e.url)),0):e.url.length&&(t.url=e.url)),t},r.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),t.bytes===String?n.url="":(n.url=[],t.bytes!==Array&&(n.url=i.newBuffer(n.url)))),e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.url!=null&&e.hasOwnProperty("url")&&(n.url=t.bytes===String?i.base64.encode(e.url,0,e.url.length):t.bytes===Array?Array.prototype.slice.call(e.url):e.url),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.WitnessUpdateContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.updateUrl=i.newBuffer([]),r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.updateUrl!=null&&Object.hasOwnProperty.call(e,"updateUrl")&&t.uint32(98).bytes(e.updateUrl),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.WitnessUpdateContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 12:l.updateUrl=e.bytes();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":e.updateUrl!=null&&e.hasOwnProperty("updateUrl")&&!(e.updateUrl&&typeof e.updateUrl.length=="number"||i.isString(e.updateUrl))?"updateUrl: buffer expected":null},r.fromObject=function(e){if(e instanceof d.protocol.WitnessUpdateContract)return e;var t=new d.protocol.WitnessUpdateContract;return e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.updateUrl!=null&&(typeof e.updateUrl=="string"?i.base64.decode(e.updateUrl,t.updateUrl=i.newBuffer(i.base64.length(e.updateUrl)),0):e.updateUrl.length&&(t.updateUrl=e.updateUrl)),t},r.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),t.bytes===String?n.updateUrl="":(n.updateUrl=[],t.bytes!==Array&&(n.updateUrl=i.newBuffer(n.updateUrl)))),e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.updateUrl!=null&&e.hasOwnProperty("updateUrl")&&(n.updateUrl=t.bytes===String?i.base64.encode(e.updateUrl,0,e.updateUrl.length):t.bytes===Array?Array.prototype.slice.call(e.updateUrl):e.updateUrl),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.AssetIssueContract=function(){function r(o){if(this.frozenSupply=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.id="",r.prototype.ownerAddress=i.newBuffer([]),r.prototype.name=i.newBuffer([]),r.prototype.abbr=i.newBuffer([]),r.prototype.totalSupply=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.frozenSupply=i.emptyArray,r.prototype.trxNum=0,r.prototype.precision=0,r.prototype.num=0,r.prototype.startTime=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.endTime=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.order=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.voteScore=0,r.prototype.description=i.newBuffer([]),r.prototype.url=i.newBuffer([]),r.prototype.freeAssetNetLimit=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.publicFreeAssetNetLimit=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.publicFreeAssetNetUsage=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.publicLatestFreeNetTime=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.name!=null&&Object.hasOwnProperty.call(e,"name")&&t.uint32(18).bytes(e.name),e.abbr!=null&&Object.hasOwnProperty.call(e,"abbr")&&t.uint32(26).bytes(e.abbr),e.totalSupply!=null&&Object.hasOwnProperty.call(e,"totalSupply")&&t.uint32(32).int64(e.totalSupply),e.frozenSupply!=null&&e.frozenSupply.length)for(var n=0;n<e.frozenSupply.length;++n)d.protocol.AssetIssueContract.FrozenSupply.encode(e.frozenSupply[n],t.uint32(42).fork()).ldelim();return e.trxNum!=null&&Object.hasOwnProperty.call(e,"trxNum")&&t.uint32(48).int32(e.trxNum),e.precision!=null&&Object.hasOwnProperty.call(e,"precision")&&t.uint32(56).int32(e.precision),e.num!=null&&Object.hasOwnProperty.call(e,"num")&&t.uint32(64).int32(e.num),e.startTime!=null&&Object.hasOwnProperty.call(e,"startTime")&&t.uint32(72).int64(e.startTime),e.endTime!=null&&Object.hasOwnProperty.call(e,"endTime")&&t.uint32(80).int64(e.endTime),e.order!=null&&Object.hasOwnProperty.call(e,"order")&&t.uint32(88).int64(e.order),e.voteScore!=null&&Object.hasOwnProperty.call(e,"voteScore")&&t.uint32(128).int32(e.voteScore),e.description!=null&&Object.hasOwnProperty.call(e,"description")&&t.uint32(162).bytes(e.description),e.url!=null&&Object.hasOwnProperty.call(e,"url")&&t.uint32(170).bytes(e.url),e.freeAssetNetLimit!=null&&Object.hasOwnProperty.call(e,"freeAssetNetLimit")&&t.uint32(176).int64(e.freeAssetNetLimit),e.publicFreeAssetNetLimit!=null&&Object.hasOwnProperty.call(e,"publicFreeAssetNetLimit")&&t.uint32(184).int64(e.publicFreeAssetNetLimit),e.publicFreeAssetNetUsage!=null&&Object.hasOwnProperty.call(e,"publicFreeAssetNetUsage")&&t.uint32(192).int64(e.publicFreeAssetNetUsage),e.publicLatestFreeNetTime!=null&&Object.hasOwnProperty.call(e,"publicLatestFreeNetTime")&&t.uint32(200).int64(e.publicLatestFreeNetTime),e.id!=null&&Object.hasOwnProperty.call(e,"id")&&t.uint32(330).string(e.id),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.AssetIssueContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 41:l.id=e.string();break;case 1:l.ownerAddress=e.bytes();break;case 2:l.name=e.bytes();break;case 3:l.abbr=e.bytes();break;case 4:l.totalSupply=e.int64();break;case 5:l.frozenSupply&&l.frozenSupply.length||(l.frozenSupply=[]),l.frozenSupply.push(d.protocol.AssetIssueContract.FrozenSupply.decode(e,e.uint32()));break;case 6:l.trxNum=e.int32();break;case 7:l.precision=e.int32();break;case 8:l.num=e.int32();break;case 9:l.startTime=e.int64();break;case 10:l.endTime=e.int64();break;case 11:l.order=e.int64();break;case 16:l.voteScore=e.int32();break;case 20:l.description=e.bytes();break;case 21:l.url=e.bytes();break;case 22:l.freeAssetNetLimit=e.int64();break;case 23:l.publicFreeAssetNetLimit=e.int64();break;case 24:l.publicFreeAssetNetUsage=e.int64();break;case 25:l.publicLatestFreeNetTime=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.id!=null&&e.hasOwnProperty("id")&&!i.isString(e.id))return"id: string expected";if(e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress)))return"ownerAddress: buffer expected";if(e.name!=null&&e.hasOwnProperty("name")&&!(e.name&&typeof e.name.length=="number"||i.isString(e.name)))return"name: buffer expected";if(e.abbr!=null&&e.hasOwnProperty("abbr")&&!(e.abbr&&typeof e.abbr.length=="number"||i.isString(e.abbr)))return"abbr: buffer expected";if(e.totalSupply!=null&&e.hasOwnProperty("totalSupply")&&!i.isInteger(e.totalSupply)&&!(e.totalSupply&&i.isInteger(e.totalSupply.low)&&i.isInteger(e.totalSupply.high)))return"totalSupply: integer|Long expected";if(e.frozenSupply!=null&&e.hasOwnProperty("frozenSupply")){if(!Array.isArray(e.frozenSupply))return"frozenSupply: array expected";for(var t=0;t<e.frozenSupply.length;++t){var n=d.protocol.AssetIssueContract.FrozenSupply.verify(e.frozenSupply[t]);if(n)return"frozenSupply."+n}}return e.trxNum!=null&&e.hasOwnProperty("trxNum")&&!i.isInteger(e.trxNum)?"trxNum: integer expected":e.precision!=null&&e.hasOwnProperty("precision")&&!i.isInteger(e.precision)?"precision: integer expected":e.num!=null&&e.hasOwnProperty("num")&&!i.isInteger(e.num)?"num: integer expected":e.startTime!=null&&e.hasOwnProperty("startTime")&&!i.isInteger(e.startTime)&&!(e.startTime&&i.isInteger(e.startTime.low)&&i.isInteger(e.startTime.high))?"startTime: integer|Long expected":e.endTime!=null&&e.hasOwnProperty("endTime")&&!i.isInteger(e.endTime)&&!(e.endTime&&i.isInteger(e.endTime.low)&&i.isInteger(e.endTime.high))?"endTime: integer|Long expected":e.order!=null&&e.hasOwnProperty("order")&&!i.isInteger(e.order)&&!(e.order&&i.isInteger(e.order.low)&&i.isInteger(e.order.high))?"order: integer|Long expected":e.voteScore!=null&&e.hasOwnProperty("voteScore")&&!i.isInteger(e.voteScore)?"voteScore: integer expected":e.description!=null&&e.hasOwnProperty("description")&&!(e.description&&typeof e.description.length=="number"||i.isString(e.description))?"description: buffer expected":e.url!=null&&e.hasOwnProperty("url")&&!(e.url&&typeof e.url.length=="number"||i.isString(e.url))?"url: buffer expected":e.freeAssetNetLimit!=null&&e.hasOwnProperty("freeAssetNetLimit")&&!i.isInteger(e.freeAssetNetLimit)&&!(e.freeAssetNetLimit&&i.isInteger(e.freeAssetNetLimit.low)&&i.isInteger(e.freeAssetNetLimit.high))?"freeAssetNetLimit: integer|Long expected":e.publicFreeAssetNetLimit!=null&&e.hasOwnProperty("publicFreeAssetNetLimit")&&!i.isInteger(e.publicFreeAssetNetLimit)&&!(e.publicFreeAssetNetLimit&&i.isInteger(e.publicFreeAssetNetLimit.low)&&i.isInteger(e.publicFreeAssetNetLimit.high))?"publicFreeAssetNetLimit: integer|Long expected":e.publicFreeAssetNetUsage!=null&&e.hasOwnProperty("publicFreeAssetNetUsage")&&!i.isInteger(e.publicFreeAssetNetUsage)&&!(e.publicFreeAssetNetUsage&&i.isInteger(e.publicFreeAssetNetUsage.low)&&i.isInteger(e.publicFreeAssetNetUsage.high))?"publicFreeAssetNetUsage: integer|Long expected":e.publicLatestFreeNetTime!=null&&e.hasOwnProperty("publicLatestFreeNetTime")&&!i.isInteger(e.publicLatestFreeNetTime)&&!(e.publicLatestFreeNetTime&&i.isInteger(e.publicLatestFreeNetTime.low)&&i.isInteger(e.publicLatestFreeNetTime.high))?"publicLatestFreeNetTime: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.AssetIssueContract)return e;var t=new d.protocol.AssetIssueContract;if(e.id!=null&&(t.id=String(e.id)),e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.name!=null&&(typeof e.name=="string"?i.base64.decode(e.name,t.name=i.newBuffer(i.base64.length(e.name)),0):e.name.length&&(t.name=e.name)),e.abbr!=null&&(typeof e.abbr=="string"?i.base64.decode(e.abbr,t.abbr=i.newBuffer(i.base64.length(e.abbr)),0):e.abbr.length&&(t.abbr=e.abbr)),e.totalSupply!=null&&(i.Long?(t.totalSupply=i.Long.fromValue(e.totalSupply)).unsigned=!1:typeof e.totalSupply=="string"?t.totalSupply=parseInt(e.totalSupply,10):typeof e.totalSupply=="number"?t.totalSupply=e.totalSupply:typeof e.totalSupply=="object"&&(t.totalSupply=new i.LongBits(e.totalSupply.low>>>0,e.totalSupply.high>>>0).toNumber())),e.frozenSupply){if(!Array.isArray(e.frozenSupply))throw TypeError(".protocol.AssetIssueContract.frozenSupply: array expected");t.frozenSupply=[];for(var n=0;n<e.frozenSupply.length;++n){if(typeof e.frozenSupply[n]!="object")throw TypeError(".protocol.AssetIssueContract.frozenSupply: object expected");t.frozenSupply[n]=d.protocol.AssetIssueContract.FrozenSupply.fromObject(e.frozenSupply[n])}}return e.trxNum!=null&&(t.trxNum=e.trxNum|0),e.precision!=null&&(t.precision=e.precision|0),e.num!=null&&(t.num=e.num|0),e.startTime!=null&&(i.Long?(t.startTime=i.Long.fromValue(e.startTime)).unsigned=!1:typeof e.startTime=="string"?t.startTime=parseInt(e.startTime,10):typeof e.startTime=="number"?t.startTime=e.startTime:typeof e.startTime=="object"&&(t.startTime=new i.LongBits(e.startTime.low>>>0,e.startTime.high>>>0).toNumber())),e.endTime!=null&&(i.Long?(t.endTime=i.Long.fromValue(e.endTime)).unsigned=!1:typeof e.endTime=="string"?t.endTime=parseInt(e.endTime,10):typeof e.endTime=="number"?t.endTime=e.endTime:typeof e.endTime=="object"&&(t.endTime=new i.LongBits(e.endTime.low>>>0,e.endTime.high>>>0).toNumber())),e.order!=null&&(i.Long?(t.order=i.Long.fromValue(e.order)).unsigned=!1:typeof e.order=="string"?t.order=parseInt(e.order,10):typeof e.order=="number"?t.order=e.order:typeof e.order=="object"&&(t.order=new i.LongBits(e.order.low>>>0,e.order.high>>>0).toNumber())),e.voteScore!=null&&(t.voteScore=e.voteScore|0),e.description!=null&&(typeof e.description=="string"?i.base64.decode(e.description,t.description=i.newBuffer(i.base64.length(e.description)),0):e.description.length&&(t.description=e.description)),e.url!=null&&(typeof e.url=="string"?i.base64.decode(e.url,t.url=i.newBuffer(i.base64.length(e.url)),0):e.url.length&&(t.url=e.url)),e.freeAssetNetLimit!=null&&(i.Long?(t.freeAssetNetLimit=i.Long.fromValue(e.freeAssetNetLimit)).unsigned=!1:typeof e.freeAssetNetLimit=="string"?t.freeAssetNetLimit=parseInt(e.freeAssetNetLimit,10):typeof e.freeAssetNetLimit=="number"?t.freeAssetNetLimit=e.freeAssetNetLimit:typeof e.freeAssetNetLimit=="object"&&(t.freeAssetNetLimit=new i.LongBits(e.freeAssetNetLimit.low>>>0,e.freeAssetNetLimit.high>>>0).toNumber())),e.publicFreeAssetNetLimit!=null&&(i.Long?(t.publicFreeAssetNetLimit=i.Long.fromValue(e.publicFreeAssetNetLimit)).unsigned=!1:typeof e.publicFreeAssetNetLimit=="string"?t.publicFreeAssetNetLimit=parseInt(e.publicFreeAssetNetLimit,10):typeof e.publicFreeAssetNetLimit=="number"?t.publicFreeAssetNetLimit=e.publicFreeAssetNetLimit:typeof e.publicFreeAssetNetLimit=="object"&&(t.publicFreeAssetNetLimit=new i.LongBits(e.publicFreeAssetNetLimit.low>>>0,e.publicFreeAssetNetLimit.high>>>0).toNumber())),e.publicFreeAssetNetUsage!=null&&(i.Long?(t.publicFreeAssetNetUsage=i.Long.fromValue(e.publicFreeAssetNetUsage)).unsigned=!1:typeof e.publicFreeAssetNetUsage=="string"?t.publicFreeAssetNetUsage=parseInt(e.publicFreeAssetNetUsage,10):typeof e.publicFreeAssetNetUsage=="number"?t.publicFreeAssetNetUsage=e.publicFreeAssetNetUsage:typeof e.publicFreeAssetNetUsage=="object"&&(t.publicFreeAssetNetUsage=new i.LongBits(e.publicFreeAssetNetUsage.low>>>0,e.publicFreeAssetNetUsage.high>>>0).toNumber())),e.publicLatestFreeNetTime!=null&&(i.Long?(t.publicLatestFreeNetTime=i.Long.fromValue(e.publicLatestFreeNetTime)).unsigned=!1:typeof e.publicLatestFreeNetTime=="string"?t.publicLatestFreeNetTime=parseInt(e.publicLatestFreeNetTime,10):typeof e.publicLatestFreeNetTime=="number"?t.publicLatestFreeNetTime=e.publicLatestFreeNetTime:typeof e.publicLatestFreeNetTime=="object"&&(t.publicLatestFreeNetTime=new i.LongBits(e.publicLatestFreeNetTime.low>>>0,e.publicLatestFreeNetTime.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.frozenSupply=[]),t.defaults){if(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),t.bytes===String?n.name="":(n.name=[],t.bytes!==Array&&(n.name=i.newBuffer(n.name))),t.bytes===String?n.abbr="":(n.abbr=[],t.bytes!==Array&&(n.abbr=i.newBuffer(n.abbr))),i.Long){var l=new i.Long(0,0,!1);n.totalSupply=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.totalSupply=t.longs===String?"0":0;if(n.trxNum=0,n.precision=0,n.num=0,i.Long){var l=new i.Long(0,0,!1);n.startTime=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.startTime=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.endTime=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.endTime=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.order=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.order=t.longs===String?"0":0;if(n.voteScore=0,t.bytes===String?n.description="":(n.description=[],t.bytes!==Array&&(n.description=i.newBuffer(n.description))),t.bytes===String?n.url="":(n.url=[],t.bytes!==Array&&(n.url=i.newBuffer(n.url))),i.Long){var l=new i.Long(0,0,!1);n.freeAssetNetLimit=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.freeAssetNetLimit=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.publicFreeAssetNetLimit=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.publicFreeAssetNetLimit=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.publicFreeAssetNetUsage=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.publicFreeAssetNetUsage=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.publicLatestFreeNetTime=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.publicLatestFreeNetTime=t.longs===String?"0":0;n.id=""}if(e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.name!=null&&e.hasOwnProperty("name")&&(n.name=t.bytes===String?i.base64.encode(e.name,0,e.name.length):t.bytes===Array?Array.prototype.slice.call(e.name):e.name),e.abbr!=null&&e.hasOwnProperty("abbr")&&(n.abbr=t.bytes===String?i.base64.encode(e.abbr,0,e.abbr.length):t.bytes===Array?Array.prototype.slice.call(e.abbr):e.abbr),e.totalSupply!=null&&e.hasOwnProperty("totalSupply")&&(typeof e.totalSupply=="number"?n.totalSupply=t.longs===String?String(e.totalSupply):e.totalSupply:n.totalSupply=t.longs===String?i.Long.prototype.toString.call(e.totalSupply):t.longs===Number?new i.LongBits(e.totalSupply.low>>>0,e.totalSupply.high>>>0).toNumber():e.totalSupply),e.frozenSupply&&e.frozenSupply.length){n.frozenSupply=[];for(var c=0;c<e.frozenSupply.length;++c)n.frozenSupply[c]=d.protocol.AssetIssueContract.FrozenSupply.toObject(e.frozenSupply[c],t)}return e.trxNum!=null&&e.hasOwnProperty("trxNum")&&(n.trxNum=e.trxNum),e.precision!=null&&e.hasOwnProperty("precision")&&(n.precision=e.precision),e.num!=null&&e.hasOwnProperty("num")&&(n.num=e.num),e.startTime!=null&&e.hasOwnProperty("startTime")&&(typeof e.startTime=="number"?n.startTime=t.longs===String?String(e.startTime):e.startTime:n.startTime=t.longs===String?i.Long.prototype.toString.call(e.startTime):t.longs===Number?new i.LongBits(e.startTime.low>>>0,e.startTime.high>>>0).toNumber():e.startTime),e.endTime!=null&&e.hasOwnProperty("endTime")&&(typeof e.endTime=="number"?n.endTime=t.longs===String?String(e.endTime):e.endTime:n.endTime=t.longs===String?i.Long.prototype.toString.call(e.endTime):t.longs===Number?new i.LongBits(e.endTime.low>>>0,e.endTime.high>>>0).toNumber():e.endTime),e.order!=null&&e.hasOwnProperty("order")&&(typeof e.order=="number"?n.order=t.longs===String?String(e.order):e.order:n.order=t.longs===String?i.Long.prototype.toString.call(e.order):t.longs===Number?new i.LongBits(e.order.low>>>0,e.order.high>>>0).toNumber():e.order),e.voteScore!=null&&e.hasOwnProperty("voteScore")&&(n.voteScore=e.voteScore),e.description!=null&&e.hasOwnProperty("description")&&(n.description=t.bytes===String?i.base64.encode(e.description,0,e.description.length):t.bytes===Array?Array.prototype.slice.call(e.description):e.description),e.url!=null&&e.hasOwnProperty("url")&&(n.url=t.bytes===String?i.base64.encode(e.url,0,e.url.length):t.bytes===Array?Array.prototype.slice.call(e.url):e.url),e.freeAssetNetLimit!=null&&e.hasOwnProperty("freeAssetNetLimit")&&(typeof e.freeAssetNetLimit=="number"?n.freeAssetNetLimit=t.longs===String?String(e.freeAssetNetLimit):e.freeAssetNetLimit:n.freeAssetNetLimit=t.longs===String?i.Long.prototype.toString.call(e.freeAssetNetLimit):t.longs===Number?new i.LongBits(e.freeAssetNetLimit.low>>>0,e.freeAssetNetLimit.high>>>0).toNumber():e.freeAssetNetLimit),e.publicFreeAssetNetLimit!=null&&e.hasOwnProperty("publicFreeAssetNetLimit")&&(typeof e.publicFreeAssetNetLimit=="number"?n.publicFreeAssetNetLimit=t.longs===String?String(e.publicFreeAssetNetLimit):e.publicFreeAssetNetLimit:n.publicFreeAssetNetLimit=t.longs===String?i.Long.prototype.toString.call(e.publicFreeAssetNetLimit):t.longs===Number?new i.LongBits(e.publicFreeAssetNetLimit.low>>>0,e.publicFreeAssetNetLimit.high>>>0).toNumber():e.publicFreeAssetNetLimit),e.publicFreeAssetNetUsage!=null&&e.hasOwnProperty("publicFreeAssetNetUsage")&&(typeof e.publicFreeAssetNetUsage=="number"?n.publicFreeAssetNetUsage=t.longs===String?String(e.publicFreeAssetNetUsage):e.publicFreeAssetNetUsage:n.publicFreeAssetNetUsage=t.longs===String?i.Long.prototype.toString.call(e.publicFreeAssetNetUsage):t.longs===Number?new i.LongBits(e.publicFreeAssetNetUsage.low>>>0,e.publicFreeAssetNetUsage.high>>>0).toNumber():e.publicFreeAssetNetUsage),e.publicLatestFreeNetTime!=null&&e.hasOwnProperty("publicLatestFreeNetTime")&&(typeof e.publicLatestFreeNetTime=="number"?n.publicLatestFreeNetTime=t.longs===String?String(e.publicLatestFreeNetTime):e.publicLatestFreeNetTime:n.publicLatestFreeNetTime=t.longs===String?i.Long.prototype.toString.call(e.publicLatestFreeNetTime):t.longs===Number?new i.LongBits(e.publicLatestFreeNetTime.low>>>0,e.publicLatestFreeNetTime.high>>>0).toNumber():e.publicLatestFreeNetTime),e.id!=null&&e.hasOwnProperty("id")&&(n.id=e.id),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r.FrozenSupply=function(){function o(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return o.prototype.frozenAmount=i.Long?i.Long.fromBits(0,0,!1):0,o.prototype.frozenDays=i.Long?i.Long.fromBits(0,0,!1):0,o.create=function(t){return new o(t)},o.encode=function(t,n){return n||(n=H.create()),t.frozenAmount!=null&&Object.hasOwnProperty.call(t,"frozenAmount")&&n.uint32(8).int64(t.frozenAmount),t.frozenDays!=null&&Object.hasOwnProperty.call(t,"frozenDays")&&n.uint32(16).int64(t.frozenDays),n},o.encodeDelimited=function(t,n){return this.encode(t,n).ldelim()},o.decode=function(t,n){t instanceof v||(t=v.create(t));for(var l=n===void 0?t.len:t.pos+n,c=new d.protocol.AssetIssueContract.FrozenSupply;t.pos<l;){var u=t.uint32();switch(u>>>3){case 1:c.frozenAmount=t.int64();break;case 2:c.frozenDays=t.int64();break;default:t.skipType(u&7);break}}return c},o.decodeDelimited=function(t){return t instanceof v||(t=new v(t)),this.decode(t,t.uint32())},o.verify=function(t){return typeof t!="object"||t===null?"object expected":t.frozenAmount!=null&&t.hasOwnProperty("frozenAmount")&&!i.isInteger(t.frozenAmount)&&!(t.frozenAmount&&i.isInteger(t.frozenAmount.low)&&i.isInteger(t.frozenAmount.high))?"frozenAmount: integer|Long expected":t.frozenDays!=null&&t.hasOwnProperty("frozenDays")&&!i.isInteger(t.frozenDays)&&!(t.frozenDays&&i.isInteger(t.frozenDays.low)&&i.isInteger(t.frozenDays.high))?"frozenDays: integer|Long expected":null},o.fromObject=function(t){if(t instanceof d.protocol.AssetIssueContract.FrozenSupply)return t;var n=new d.protocol.AssetIssueContract.FrozenSupply;return t.frozenAmount!=null&&(i.Long?(n.frozenAmount=i.Long.fromValue(t.frozenAmount)).unsigned=!1:typeof t.frozenAmount=="string"?n.frozenAmount=parseInt(t.frozenAmount,10):typeof t.frozenAmount=="number"?n.frozenAmount=t.frozenAmount:typeof t.frozenAmount=="object"&&(n.frozenAmount=new i.LongBits(t.frozenAmount.low>>>0,t.frozenAmount.high>>>0).toNumber())),t.frozenDays!=null&&(i.Long?(n.frozenDays=i.Long.fromValue(t.frozenDays)).unsigned=!1:typeof t.frozenDays=="string"?n.frozenDays=parseInt(t.frozenDays,10):typeof t.frozenDays=="number"?n.frozenDays=t.frozenDays:typeof t.frozenDays=="object"&&(n.frozenDays=new i.LongBits(t.frozenDays.low>>>0,t.frozenDays.high>>>0).toNumber())),n},o.toObject=function(t,n){n||(n={});var l={};if(n.defaults){if(i.Long){var c=new i.Long(0,0,!1);l.frozenAmount=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.frozenAmount=n.longs===String?"0":0;if(i.Long){var c=new i.Long(0,0,!1);l.frozenDays=n.longs===String?c.toString():n.longs===Number?c.toNumber():c}else l.frozenDays=n.longs===String?"0":0}return t.frozenAmount!=null&&t.hasOwnProperty("frozenAmount")&&(typeof t.frozenAmount=="number"?l.frozenAmount=n.longs===String?String(t.frozenAmount):t.frozenAmount:l.frozenAmount=n.longs===String?i.Long.prototype.toString.call(t.frozenAmount):n.longs===Number?new i.LongBits(t.frozenAmount.low>>>0,t.frozenAmount.high>>>0).toNumber():t.frozenAmount),t.frozenDays!=null&&t.hasOwnProperty("frozenDays")&&(typeof t.frozenDays=="number"?l.frozenDays=n.longs===String?String(t.frozenDays):t.frozenDays:l.frozenDays=n.longs===String?i.Long.prototype.toString.call(t.frozenDays):n.longs===Number?new i.LongBits(t.frozenDays.low>>>0,t.frozenDays.high>>>0).toNumber():t.frozenDays),l},o.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},o}(),r}(),f.ParticipateAssetIssueContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.toAddress=i.newBuffer([]),r.prototype.assetName=i.newBuffer([]),r.prototype.amount=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.toAddress!=null&&Object.hasOwnProperty.call(e,"toAddress")&&t.uint32(18).bytes(e.toAddress),e.assetName!=null&&Object.hasOwnProperty.call(e,"assetName")&&t.uint32(26).bytes(e.assetName),e.amount!=null&&Object.hasOwnProperty.call(e,"amount")&&t.uint32(32).int64(e.amount),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.ParticipateAssetIssueContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.toAddress=e.bytes();break;case 3:l.assetName=e.bytes();break;case 4:l.amount=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":e.toAddress!=null&&e.hasOwnProperty("toAddress")&&!(e.toAddress&&typeof e.toAddress.length=="number"||i.isString(e.toAddress))?"toAddress: buffer expected":e.assetName!=null&&e.hasOwnProperty("assetName")&&!(e.assetName&&typeof e.assetName.length=="number"||i.isString(e.assetName))?"assetName: buffer expected":e.amount!=null&&e.hasOwnProperty("amount")&&!i.isInteger(e.amount)&&!(e.amount&&i.isInteger(e.amount.low)&&i.isInteger(e.amount.high))?"amount: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.ParticipateAssetIssueContract)return e;var t=new d.protocol.ParticipateAssetIssueContract;return e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.toAddress!=null&&(typeof e.toAddress=="string"?i.base64.decode(e.toAddress,t.toAddress=i.newBuffer(i.base64.length(e.toAddress)),0):e.toAddress.length&&(t.toAddress=e.toAddress)),e.assetName!=null&&(typeof e.assetName=="string"?i.base64.decode(e.assetName,t.assetName=i.newBuffer(i.base64.length(e.assetName)),0):e.assetName.length&&(t.assetName=e.assetName)),e.amount!=null&&(i.Long?(t.amount=i.Long.fromValue(e.amount)).unsigned=!1:typeof e.amount=="string"?t.amount=parseInt(e.amount,10):typeof e.amount=="number"?t.amount=e.amount:typeof e.amount=="object"&&(t.amount=new i.LongBits(e.amount.low>>>0,e.amount.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults)if(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),t.bytes===String?n.toAddress="":(n.toAddress=[],t.bytes!==Array&&(n.toAddress=i.newBuffer(n.toAddress))),t.bytes===String?n.assetName="":(n.assetName=[],t.bytes!==Array&&(n.assetName=i.newBuffer(n.assetName))),i.Long){var l=new i.Long(0,0,!1);n.amount=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.amount=t.longs===String?"0":0;return e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.toAddress!=null&&e.hasOwnProperty("toAddress")&&(n.toAddress=t.bytes===String?i.base64.encode(e.toAddress,0,e.toAddress.length):t.bytes===Array?Array.prototype.slice.call(e.toAddress):e.toAddress),e.assetName!=null&&e.hasOwnProperty("assetName")&&(n.assetName=t.bytes===String?i.base64.encode(e.assetName,0,e.assetName.length):t.bytes===Array?Array.prototype.slice.call(e.assetName):e.assetName),e.amount!=null&&e.hasOwnProperty("amount")&&(typeof e.amount=="number"?n.amount=t.longs===String?String(e.amount):e.amount:n.amount=t.longs===String?i.Long.prototype.toString.call(e.amount):t.longs===Number?new i.LongBits(e.amount.low>>>0,e.amount.high>>>0).toNumber():e.amount),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.ResourceCode=function(){var r={},o=Object.create(r);return o[r[0]="BANDWIDTH"]=0,o[r[1]="ENERGY"]=1,o}(),f.FreezeBalanceContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.frozenBalance=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.frozenDuration=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.resource=0,r.prototype.receiverAddress=i.newBuffer([]),r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.frozenBalance!=null&&Object.hasOwnProperty.call(e,"frozenBalance")&&t.uint32(16).int64(e.frozenBalance),e.frozenDuration!=null&&Object.hasOwnProperty.call(e,"frozenDuration")&&t.uint32(24).int64(e.frozenDuration),e.resource!=null&&Object.hasOwnProperty.call(e,"resource")&&t.uint32(80).int32(e.resource),e.receiverAddress!=null&&Object.hasOwnProperty.call(e,"receiverAddress")&&t.uint32(122).bytes(e.receiverAddress),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.FreezeBalanceContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.frozenBalance=e.int64();break;case 3:l.frozenDuration=e.int64();break;case 10:l.resource=e.int32();break;case 15:l.receiverAddress=e.bytes();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress)))return"ownerAddress: buffer expected";if(e.frozenBalance!=null&&e.hasOwnProperty("frozenBalance")&&!i.isInteger(e.frozenBalance)&&!(e.frozenBalance&&i.isInteger(e.frozenBalance.low)&&i.isInteger(e.frozenBalance.high)))return"frozenBalance: integer|Long expected";if(e.frozenDuration!=null&&e.hasOwnProperty("frozenDuration")&&!i.isInteger(e.frozenDuration)&&!(e.frozenDuration&&i.isInteger(e.frozenDuration.low)&&i.isInteger(e.frozenDuration.high)))return"frozenDuration: integer|Long expected";if(e.resource!=null&&e.hasOwnProperty("resource"))switch(e.resource){default:return"resource: enum value expected";case 0:case 1:break}return e.receiverAddress!=null&&e.hasOwnProperty("receiverAddress")&&!(e.receiverAddress&&typeof e.receiverAddress.length=="number"||i.isString(e.receiverAddress))?"receiverAddress: buffer expected":null},r.fromObject=function(e){if(e instanceof d.protocol.FreezeBalanceContract)return e;var t=new d.protocol.FreezeBalanceContract;switch(e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.frozenBalance!=null&&(i.Long?(t.frozenBalance=i.Long.fromValue(e.frozenBalance)).unsigned=!1:typeof e.frozenBalance=="string"?t.frozenBalance=parseInt(e.frozenBalance,10):typeof e.frozenBalance=="number"?t.frozenBalance=e.frozenBalance:typeof e.frozenBalance=="object"&&(t.frozenBalance=new i.LongBits(e.frozenBalance.low>>>0,e.frozenBalance.high>>>0).toNumber())),e.frozenDuration!=null&&(i.Long?(t.frozenDuration=i.Long.fromValue(e.frozenDuration)).unsigned=!1:typeof e.frozenDuration=="string"?t.frozenDuration=parseInt(e.frozenDuration,10):typeof e.frozenDuration=="number"?t.frozenDuration=e.frozenDuration:typeof e.frozenDuration=="object"&&(t.frozenDuration=new i.LongBits(e.frozenDuration.low>>>0,e.frozenDuration.high>>>0).toNumber())),e.resource){case"BANDWIDTH":case 0:t.resource=0;break;case"ENERGY":case 1:t.resource=1;break}return e.receiverAddress!=null&&(typeof e.receiverAddress=="string"?i.base64.decode(e.receiverAddress,t.receiverAddress=i.newBuffer(i.base64.length(e.receiverAddress)),0):e.receiverAddress.length&&(t.receiverAddress=e.receiverAddress)),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),i.Long){var l=new i.Long(0,0,!1);n.frozenBalance=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.frozenBalance=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.frozenDuration=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.frozenDuration=t.longs===String?"0":0;n.resource=t.enums===String?"BANDWIDTH":0,t.bytes===String?n.receiverAddress="":(n.receiverAddress=[],t.bytes!==Array&&(n.receiverAddress=i.newBuffer(n.receiverAddress)))}return e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.frozenBalance!=null&&e.hasOwnProperty("frozenBalance")&&(typeof e.frozenBalance=="number"?n.frozenBalance=t.longs===String?String(e.frozenBalance):e.frozenBalance:n.frozenBalance=t.longs===String?i.Long.prototype.toString.call(e.frozenBalance):t.longs===Number?new i.LongBits(e.frozenBalance.low>>>0,e.frozenBalance.high>>>0).toNumber():e.frozenBalance),e.frozenDuration!=null&&e.hasOwnProperty("frozenDuration")&&(typeof e.frozenDuration=="number"?n.frozenDuration=t.longs===String?String(e.frozenDuration):e.frozenDuration:n.frozenDuration=t.longs===String?i.Long.prototype.toString.call(e.frozenDuration):t.longs===Number?new i.LongBits(e.frozenDuration.low>>>0,e.frozenDuration.high>>>0).toNumber():e.frozenDuration),e.resource!=null&&e.hasOwnProperty("resource")&&(n.resource=t.enums===String?d.protocol.ResourceCode[e.resource]:e.resource),e.receiverAddress!=null&&e.hasOwnProperty("receiverAddress")&&(n.receiverAddress=t.bytes===String?i.base64.encode(e.receiverAddress,0,e.receiverAddress.length):t.bytes===Array?Array.prototype.slice.call(e.receiverAddress):e.receiverAddress),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.UnfreezeBalanceContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.resource=0,r.prototype.receiverAddress=i.newBuffer([]),r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.resource!=null&&Object.hasOwnProperty.call(e,"resource")&&t.uint32(80).int32(e.resource),e.receiverAddress!=null&&Object.hasOwnProperty.call(e,"receiverAddress")&&t.uint32(122).bytes(e.receiverAddress),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.UnfreezeBalanceContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 10:l.resource=e.int32();break;case 15:l.receiverAddress=e.bytes();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress)))return"ownerAddress: buffer expected";if(e.resource!=null&&e.hasOwnProperty("resource"))switch(e.resource){default:return"resource: enum value expected";case 0:case 1:break}return e.receiverAddress!=null&&e.hasOwnProperty("receiverAddress")&&!(e.receiverAddress&&typeof e.receiverAddress.length=="number"||i.isString(e.receiverAddress))?"receiverAddress: buffer expected":null},r.fromObject=function(e){if(e instanceof d.protocol.UnfreezeBalanceContract)return e;var t=new d.protocol.UnfreezeBalanceContract;switch(e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.resource){case"BANDWIDTH":case 0:t.resource=0;break;case"ENERGY":case 1:t.resource=1;break}return e.receiverAddress!=null&&(typeof e.receiverAddress=="string"?i.base64.decode(e.receiverAddress,t.receiverAddress=i.newBuffer(i.base64.length(e.receiverAddress)),0):e.receiverAddress.length&&(t.receiverAddress=e.receiverAddress)),t},r.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),n.resource=t.enums===String?"BANDWIDTH":0,t.bytes===String?n.receiverAddress="":(n.receiverAddress=[],t.bytes!==Array&&(n.receiverAddress=i.newBuffer(n.receiverAddress)))),e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.resource!=null&&e.hasOwnProperty("resource")&&(n.resource=t.enums===String?d.protocol.ResourceCode[e.resource]:e.resource),e.receiverAddress!=null&&e.hasOwnProperty("receiverAddress")&&(n.receiverAddress=t.bytes===String?i.base64.encode(e.receiverAddress,0,e.receiverAddress.length):t.bytes===Array?Array.prototype.slice.call(e.receiverAddress):e.receiverAddress),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.UnfreezeAssetContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.UnfreezeAssetContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":null},r.fromObject=function(e){if(e instanceof d.protocol.UnfreezeAssetContract)return e;var t=new d.protocol.UnfreezeAssetContract;return e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),t},r.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress)))),e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.WithdrawBalanceContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.WithdrawBalanceContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":null},r.fromObject=function(e){if(e instanceof d.protocol.WithdrawBalanceContract)return e;var t=new d.protocol.WithdrawBalanceContract;return e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),t},r.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress)))),e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.UpdateAssetContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.description=i.newBuffer([]),r.prototype.url=i.newBuffer([]),r.prototype.newLimit=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.newPublicLimit=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.description!=null&&Object.hasOwnProperty.call(e,"description")&&t.uint32(18).bytes(e.description),e.url!=null&&Object.hasOwnProperty.call(e,"url")&&t.uint32(26).bytes(e.url),e.newLimit!=null&&Object.hasOwnProperty.call(e,"newLimit")&&t.uint32(32).int64(e.newLimit),e.newPublicLimit!=null&&Object.hasOwnProperty.call(e,"newPublicLimit")&&t.uint32(40).int64(e.newPublicLimit),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.UpdateAssetContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.description=e.bytes();break;case 3:l.url=e.bytes();break;case 4:l.newLimit=e.int64();break;case 5:l.newPublicLimit=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":e.description!=null&&e.hasOwnProperty("description")&&!(e.description&&typeof e.description.length=="number"||i.isString(e.description))?"description: buffer expected":e.url!=null&&e.hasOwnProperty("url")&&!(e.url&&typeof e.url.length=="number"||i.isString(e.url))?"url: buffer expected":e.newLimit!=null&&e.hasOwnProperty("newLimit")&&!i.isInteger(e.newLimit)&&!(e.newLimit&&i.isInteger(e.newLimit.low)&&i.isInteger(e.newLimit.high))?"newLimit: integer|Long expected":e.newPublicLimit!=null&&e.hasOwnProperty("newPublicLimit")&&!i.isInteger(e.newPublicLimit)&&!(e.newPublicLimit&&i.isInteger(e.newPublicLimit.low)&&i.isInteger(e.newPublicLimit.high))?"newPublicLimit: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.UpdateAssetContract)return e;var t=new d.protocol.UpdateAssetContract;return e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.description!=null&&(typeof e.description=="string"?i.base64.decode(e.description,t.description=i.newBuffer(i.base64.length(e.description)),0):e.description.length&&(t.description=e.description)),e.url!=null&&(typeof e.url=="string"?i.base64.decode(e.url,t.url=i.newBuffer(i.base64.length(e.url)),0):e.url.length&&(t.url=e.url)),e.newLimit!=null&&(i.Long?(t.newLimit=i.Long.fromValue(e.newLimit)).unsigned=!1:typeof e.newLimit=="string"?t.newLimit=parseInt(e.newLimit,10):typeof e.newLimit=="number"?t.newLimit=e.newLimit:typeof e.newLimit=="object"&&(t.newLimit=new i.LongBits(e.newLimit.low>>>0,e.newLimit.high>>>0).toNumber())),e.newPublicLimit!=null&&(i.Long?(t.newPublicLimit=i.Long.fromValue(e.newPublicLimit)).unsigned=!1:typeof e.newPublicLimit=="string"?t.newPublicLimit=parseInt(e.newPublicLimit,10):typeof e.newPublicLimit=="number"?t.newPublicLimit=e.newPublicLimit:typeof e.newPublicLimit=="object"&&(t.newPublicLimit=new i.LongBits(e.newPublicLimit.low>>>0,e.newPublicLimit.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),t.bytes===String?n.description="":(n.description=[],t.bytes!==Array&&(n.description=i.newBuffer(n.description))),t.bytes===String?n.url="":(n.url=[],t.bytes!==Array&&(n.url=i.newBuffer(n.url))),i.Long){var l=new i.Long(0,0,!1);n.newLimit=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.newLimit=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.newPublicLimit=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.newPublicLimit=t.longs===String?"0":0}return e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.description!=null&&e.hasOwnProperty("description")&&(n.description=t.bytes===String?i.base64.encode(e.description,0,e.description.length):t.bytes===Array?Array.prototype.slice.call(e.description):e.description),e.url!=null&&e.hasOwnProperty("url")&&(n.url=t.bytes===String?i.base64.encode(e.url,0,e.url.length):t.bytes===Array?Array.prototype.slice.call(e.url):e.url),e.newLimit!=null&&e.hasOwnProperty("newLimit")&&(typeof e.newLimit=="number"?n.newLimit=t.longs===String?String(e.newLimit):e.newLimit:n.newLimit=t.longs===String?i.Long.prototype.toString.call(e.newLimit):t.longs===Number?new i.LongBits(e.newLimit.low>>>0,e.newLimit.high>>>0).toNumber():e.newLimit),e.newPublicLimit!=null&&e.hasOwnProperty("newPublicLimit")&&(typeof e.newPublicLimit=="number"?n.newPublicLimit=t.longs===String?String(e.newPublicLimit):e.newPublicLimit:n.newPublicLimit=t.longs===String?i.Long.prototype.toString.call(e.newPublicLimit):t.longs===Number?new i.LongBits(e.newPublicLimit.low>>>0,e.newPublicLimit.high>>>0).toNumber():e.newPublicLimit),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.ProposalCreateContract=function(){function r(o){if(this.parameters={},o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.parameters=i.emptyObject,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.parameters!=null&&Object.hasOwnProperty.call(e,"parameters"))for(var n=Object.keys(e.parameters),l=0;l<n.length;++l)t.uint32(18).fork().uint32(8).int64(n[l]).uint32(16).int64(e.parameters[n[l]]).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.ProposalCreateContract,c,u;e.pos<n;){var b=e.uint32();switch(b>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.parameters===i.emptyObject&&(l.parameters={});var A=e.uint32()+e.pos;for(c=0,u=0;e.pos<A;){var w=e.uint32();switch(w>>>3){case 1:c=e.int64();break;case 2:u=e.int64();break;default:e.skipType(w&7);break}}l.parameters[typeof c=="object"?i.longToHash(c):c]=u;break;default:e.skipType(b&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress)))return"ownerAddress: buffer expected";if(e.parameters!=null&&e.hasOwnProperty("parameters")){if(!i.isObject(e.parameters))return"parameters: object expected";for(var t=Object.keys(e.parameters),n=0;n<t.length;++n){if(!i.key64Re.test(t[n]))return"parameters: integer|Long key{k:int64} expected";if(!i.isInteger(e.parameters[t[n]])&&!(e.parameters[t[n]]&&i.isInteger(e.parameters[t[n]].low)&&i.isInteger(e.parameters[t[n]].high)))return"parameters: integer|Long{k:int64} expected"}}return null},r.fromObject=function(e){if(e instanceof d.protocol.ProposalCreateContract)return e;var t=new d.protocol.ProposalCreateContract;if(e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.parameters){if(typeof e.parameters!="object")throw TypeError(".protocol.ProposalCreateContract.parameters: object expected");t.parameters={};for(var n=Object.keys(e.parameters),l=0;l<n.length;++l)i.Long?(t.parameters[n[l]]=i.Long.fromValue(e.parameters[n[l]])).unsigned=!1:typeof e.parameters[n[l]]=="string"?t.parameters[n[l]]=parseInt(e.parameters[n[l]],10):typeof e.parameters[n[l]]=="number"?t.parameters[n[l]]=e.parameters[n[l]]:typeof e.parameters[n[l]]=="object"&&(t.parameters[n[l]]=new i.LongBits(e.parameters[n[l]].low>>>0,e.parameters[n[l]].high>>>0).toNumber())}return t},r.toObject=function(e,t){t||(t={});var n={};(t.objects||t.defaults)&&(n.parameters={}),t.defaults&&(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress)))),e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress);var l;if(e.parameters&&(l=Object.keys(e.parameters)).length){n.parameters={};for(var c=0;c<l.length;++c)typeof e.parameters[l[c]]=="number"?n.parameters[l[c]]=t.longs===String?String(e.parameters[l[c]]):e.parameters[l[c]]:n.parameters[l[c]]=t.longs===String?i.Long.prototype.toString.call(e.parameters[l[c]]):t.longs===Number?new i.LongBits(e.parameters[l[c]].low>>>0,e.parameters[l[c]].high>>>0).toNumber():e.parameters[l[c]]}return n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.ProposalApproveContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.proposalId=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.isAddApproval=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.proposalId!=null&&Object.hasOwnProperty.call(e,"proposalId")&&t.uint32(16).int64(e.proposalId),e.isAddApproval!=null&&Object.hasOwnProperty.call(e,"isAddApproval")&&t.uint32(24).bool(e.isAddApproval),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.ProposalApproveContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.proposalId=e.int64();break;case 3:l.isAddApproval=e.bool();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":e.proposalId!=null&&e.hasOwnProperty("proposalId")&&!i.isInteger(e.proposalId)&&!(e.proposalId&&i.isInteger(e.proposalId.low)&&i.isInteger(e.proposalId.high))?"proposalId: integer|Long expected":e.isAddApproval!=null&&e.hasOwnProperty("isAddApproval")&&typeof e.isAddApproval!="boolean"?"isAddApproval: boolean expected":null},r.fromObject=function(e){if(e instanceof d.protocol.ProposalApproveContract)return e;var t=new d.protocol.ProposalApproveContract;return e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.proposalId!=null&&(i.Long?(t.proposalId=i.Long.fromValue(e.proposalId)).unsigned=!1:typeof e.proposalId=="string"?t.proposalId=parseInt(e.proposalId,10):typeof e.proposalId=="number"?t.proposalId=e.proposalId:typeof e.proposalId=="object"&&(t.proposalId=new i.LongBits(e.proposalId.low>>>0,e.proposalId.high>>>0).toNumber())),e.isAddApproval!=null&&(t.isAddApproval=Boolean(e.isAddApproval)),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),i.Long){var l=new i.Long(0,0,!1);n.proposalId=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.proposalId=t.longs===String?"0":0;n.isAddApproval=!1}return e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.proposalId!=null&&e.hasOwnProperty("proposalId")&&(typeof e.proposalId=="number"?n.proposalId=t.longs===String?String(e.proposalId):e.proposalId:n.proposalId=t.longs===String?i.Long.prototype.toString.call(e.proposalId):t.longs===Number?new i.LongBits(e.proposalId.low>>>0,e.proposalId.high>>>0).toNumber():e.proposalId),e.isAddApproval!=null&&e.hasOwnProperty("isAddApproval")&&(n.isAddApproval=e.isAddApproval),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.ProposalDeleteContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.proposalId=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.proposalId!=null&&Object.hasOwnProperty.call(e,"proposalId")&&t.uint32(16).int64(e.proposalId),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.ProposalDeleteContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.proposalId=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":e.proposalId!=null&&e.hasOwnProperty("proposalId")&&!i.isInteger(e.proposalId)&&!(e.proposalId&&i.isInteger(e.proposalId.low)&&i.isInteger(e.proposalId.high))?"proposalId: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.ProposalDeleteContract)return e;var t=new d.protocol.ProposalDeleteContract;return e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.proposalId!=null&&(i.Long?(t.proposalId=i.Long.fromValue(e.proposalId)).unsigned=!1:typeof e.proposalId=="string"?t.proposalId=parseInt(e.proposalId,10):typeof e.proposalId=="number"?t.proposalId=e.proposalId:typeof e.proposalId=="object"&&(t.proposalId=new i.LongBits(e.proposalId.low>>>0,e.proposalId.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults)if(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),i.Long){var l=new i.Long(0,0,!1);n.proposalId=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.proposalId=t.longs===String?"0":0;return e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.proposalId!=null&&e.hasOwnProperty("proposalId")&&(typeof e.proposalId=="number"?n.proposalId=t.longs===String?String(e.proposalId):e.proposalId:n.proposalId=t.longs===String?i.Long.prototype.toString.call(e.proposalId):t.longs===Number?new i.LongBits(e.proposalId.low>>>0,e.proposalId.high>>>0).toNumber():e.proposalId),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.CreateSmartContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.newContract=null,r.prototype.callTokenValue=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.tokenId=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.newContract!=null&&Object.hasOwnProperty.call(e,"newContract")&&d.protocol.SmartContract.encode(e.newContract,t.uint32(18).fork()).ldelim(),e.callTokenValue!=null&&Object.hasOwnProperty.call(e,"callTokenValue")&&t.uint32(24).int64(e.callTokenValue),e.tokenId!=null&&Object.hasOwnProperty.call(e,"tokenId")&&t.uint32(32).int64(e.tokenId),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.CreateSmartContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.newContract=d.protocol.SmartContract.decode(e,e.uint32());break;case 3:l.callTokenValue=e.int64();break;case 4:l.tokenId=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress)))return"ownerAddress: buffer expected";if(e.newContract!=null&&e.hasOwnProperty("newContract")){var t=d.protocol.SmartContract.verify(e.newContract);if(t)return"newContract."+t}return e.callTokenValue!=null&&e.hasOwnProperty("callTokenValue")&&!i.isInteger(e.callTokenValue)&&!(e.callTokenValue&&i.isInteger(e.callTokenValue.low)&&i.isInteger(e.callTokenValue.high))?"callTokenValue: integer|Long expected":e.tokenId!=null&&e.hasOwnProperty("tokenId")&&!i.isInteger(e.tokenId)&&!(e.tokenId&&i.isInteger(e.tokenId.low)&&i.isInteger(e.tokenId.high))?"tokenId: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.CreateSmartContract)return e;var t=new d.protocol.CreateSmartContract;if(e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.newContract!=null){if(typeof e.newContract!="object")throw TypeError(".protocol.CreateSmartContract.newContract: object expected");t.newContract=d.protocol.SmartContract.fromObject(e.newContract)}return e.callTokenValue!=null&&(i.Long?(t.callTokenValue=i.Long.fromValue(e.callTokenValue)).unsigned=!1:typeof e.callTokenValue=="string"?t.callTokenValue=parseInt(e.callTokenValue,10):typeof e.callTokenValue=="number"?t.callTokenValue=e.callTokenValue:typeof e.callTokenValue=="object"&&(t.callTokenValue=new i.LongBits(e.callTokenValue.low>>>0,e.callTokenValue.high>>>0).toNumber())),e.tokenId!=null&&(i.Long?(t.tokenId=i.Long.fromValue(e.tokenId)).unsigned=!1:typeof e.tokenId=="string"?t.tokenId=parseInt(e.tokenId,10):typeof e.tokenId=="number"?t.tokenId=e.tokenId:typeof e.tokenId=="object"&&(t.tokenId=new i.LongBits(e.tokenId.low>>>0,e.tokenId.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),n.newContract=null,i.Long){var l=new i.Long(0,0,!1);n.callTokenValue=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.callTokenValue=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.tokenId=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.tokenId=t.longs===String?"0":0}return e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.newContract!=null&&e.hasOwnProperty("newContract")&&(n.newContract=d.protocol.SmartContract.toObject(e.newContract,t)),e.callTokenValue!=null&&e.hasOwnProperty("callTokenValue")&&(typeof e.callTokenValue=="number"?n.callTokenValue=t.longs===String?String(e.callTokenValue):e.callTokenValue:n.callTokenValue=t.longs===String?i.Long.prototype.toString.call(e.callTokenValue):t.longs===Number?new i.LongBits(e.callTokenValue.low>>>0,e.callTokenValue.high>>>0).toNumber():e.callTokenValue),e.tokenId!=null&&e.hasOwnProperty("tokenId")&&(typeof e.tokenId=="number"?n.tokenId=t.longs===String?String(e.tokenId):e.tokenId:n.tokenId=t.longs===String?i.Long.prototype.toString.call(e.tokenId):t.longs===Number?new i.LongBits(e.tokenId.low>>>0,e.tokenId.high>>>0).toNumber():e.tokenId),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.TriggerSmartContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.contractAddress=i.newBuffer([]),r.prototype.callValue=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.data=i.newBuffer([]),r.prototype.callTokenValue=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.tokenId=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.contractAddress!=null&&Object.hasOwnProperty.call(e,"contractAddress")&&t.uint32(18).bytes(e.contractAddress),e.callValue!=null&&Object.hasOwnProperty.call(e,"callValue")&&t.uint32(24).int64(e.callValue),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&t.uint32(34).bytes(e.data),e.callTokenValue!=null&&Object.hasOwnProperty.call(e,"callTokenValue")&&t.uint32(40).int64(e.callTokenValue),e.tokenId!=null&&Object.hasOwnProperty.call(e,"tokenId")&&t.uint32(48).int64(e.tokenId),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.TriggerSmartContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.contractAddress=e.bytes();break;case 3:l.callValue=e.int64();break;case 4:l.data=e.bytes();break;case 5:l.callTokenValue=e.int64();break;case 6:l.tokenId=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":e.contractAddress!=null&&e.hasOwnProperty("contractAddress")&&!(e.contractAddress&&typeof e.contractAddress.length=="number"||i.isString(e.contractAddress))?"contractAddress: buffer expected":e.callValue!=null&&e.hasOwnProperty("callValue")&&!i.isInteger(e.callValue)&&!(e.callValue&&i.isInteger(e.callValue.low)&&i.isInteger(e.callValue.high))?"callValue: integer|Long expected":e.data!=null&&e.hasOwnProperty("data")&&!(e.data&&typeof e.data.length=="number"||i.isString(e.data))?"data: buffer expected":e.callTokenValue!=null&&e.hasOwnProperty("callTokenValue")&&!i.isInteger(e.callTokenValue)&&!(e.callTokenValue&&i.isInteger(e.callTokenValue.low)&&i.isInteger(e.callTokenValue.high))?"callTokenValue: integer|Long expected":e.tokenId!=null&&e.hasOwnProperty("tokenId")&&!i.isInteger(e.tokenId)&&!(e.tokenId&&i.isInteger(e.tokenId.low)&&i.isInteger(e.tokenId.high))?"tokenId: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.TriggerSmartContract)return e;var t=new d.protocol.TriggerSmartContract;return e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.contractAddress!=null&&(typeof e.contractAddress=="string"?i.base64.decode(e.contractAddress,t.contractAddress=i.newBuffer(i.base64.length(e.contractAddress)),0):e.contractAddress.length&&(t.contractAddress=e.contractAddress)),e.callValue!=null&&(i.Long?(t.callValue=i.Long.fromValue(e.callValue)).unsigned=!1:typeof e.callValue=="string"?t.callValue=parseInt(e.callValue,10):typeof e.callValue=="number"?t.callValue=e.callValue:typeof e.callValue=="object"&&(t.callValue=new i.LongBits(e.callValue.low>>>0,e.callValue.high>>>0).toNumber())),e.data!=null&&(typeof e.data=="string"?i.base64.decode(e.data,t.data=i.newBuffer(i.base64.length(e.data)),0):e.data.length&&(t.data=e.data)),e.callTokenValue!=null&&(i.Long?(t.callTokenValue=i.Long.fromValue(e.callTokenValue)).unsigned=!1:typeof e.callTokenValue=="string"?t.callTokenValue=parseInt(e.callTokenValue,10):typeof e.callTokenValue=="number"?t.callTokenValue=e.callTokenValue:typeof e.callTokenValue=="object"&&(t.callTokenValue=new i.LongBits(e.callTokenValue.low>>>0,e.callTokenValue.high>>>0).toNumber())),e.tokenId!=null&&(i.Long?(t.tokenId=i.Long.fromValue(e.tokenId)).unsigned=!1:typeof e.tokenId=="string"?t.tokenId=parseInt(e.tokenId,10):typeof e.tokenId=="number"?t.tokenId=e.tokenId:typeof e.tokenId=="object"&&(t.tokenId=new i.LongBits(e.tokenId.low>>>0,e.tokenId.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),t.bytes===String?n.contractAddress="":(n.contractAddress=[],t.bytes!==Array&&(n.contractAddress=i.newBuffer(n.contractAddress))),i.Long){var l=new i.Long(0,0,!1);n.callValue=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.callValue=t.longs===String?"0":0;if(t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=i.newBuffer(n.data))),i.Long){var l=new i.Long(0,0,!1);n.callTokenValue=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.callTokenValue=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.tokenId=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.tokenId=t.longs===String?"0":0}return e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.contractAddress!=null&&e.hasOwnProperty("contractAddress")&&(n.contractAddress=t.bytes===String?i.base64.encode(e.contractAddress,0,e.contractAddress.length):t.bytes===Array?Array.prototype.slice.call(e.contractAddress):e.contractAddress),e.callValue!=null&&e.hasOwnProperty("callValue")&&(typeof e.callValue=="number"?n.callValue=t.longs===String?String(e.callValue):e.callValue:n.callValue=t.longs===String?i.Long.prototype.toString.call(e.callValue):t.longs===Number?new i.LongBits(e.callValue.low>>>0,e.callValue.high>>>0).toNumber():e.callValue),e.data!=null&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?i.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.callTokenValue!=null&&e.hasOwnProperty("callTokenValue")&&(typeof e.callTokenValue=="number"?n.callTokenValue=t.longs===String?String(e.callTokenValue):e.callTokenValue:n.callTokenValue=t.longs===String?i.Long.prototype.toString.call(e.callTokenValue):t.longs===Number?new i.LongBits(e.callTokenValue.low>>>0,e.callTokenValue.high>>>0).toNumber():e.callTokenValue),e.tokenId!=null&&e.hasOwnProperty("tokenId")&&(typeof e.tokenId=="number"?n.tokenId=t.longs===String?String(e.tokenId):e.tokenId:n.tokenId=t.longs===String?i.Long.prototype.toString.call(e.tokenId):t.longs===Number?new i.LongBits(e.tokenId.low>>>0,e.tokenId.high>>>0).toNumber():e.tokenId),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.BuyStorageContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.quant=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.quant!=null&&Object.hasOwnProperty.call(e,"quant")&&t.uint32(16).int64(e.quant),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.BuyStorageContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.quant=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":e.quant!=null&&e.hasOwnProperty("quant")&&!i.isInteger(e.quant)&&!(e.quant&&i.isInteger(e.quant.low)&&i.isInteger(e.quant.high))?"quant: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.BuyStorageContract)return e;var t=new d.protocol.BuyStorageContract;return e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.quant!=null&&(i.Long?(t.quant=i.Long.fromValue(e.quant)).unsigned=!1:typeof e.quant=="string"?t.quant=parseInt(e.quant,10):typeof e.quant=="number"?t.quant=e.quant:typeof e.quant=="object"&&(t.quant=new i.LongBits(e.quant.low>>>0,e.quant.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults)if(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),i.Long){var l=new i.Long(0,0,!1);n.quant=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.quant=t.longs===String?"0":0;return e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.quant!=null&&e.hasOwnProperty("quant")&&(typeof e.quant=="number"?n.quant=t.longs===String?String(e.quant):e.quant:n.quant=t.longs===String?i.Long.prototype.toString.call(e.quant):t.longs===Number?new i.LongBits(e.quant.low>>>0,e.quant.high>>>0).toNumber():e.quant),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.BuyStorageBytesContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.bytes=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.bytes!=null&&Object.hasOwnProperty.call(e,"bytes")&&t.uint32(16).int64(e.bytes),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.BuyStorageBytesContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.bytes=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":e.bytes!=null&&e.hasOwnProperty("bytes")&&!i.isInteger(e.bytes)&&!(e.bytes&&i.isInteger(e.bytes.low)&&i.isInteger(e.bytes.high))?"bytes: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.BuyStorageBytesContract)return e;var t=new d.protocol.BuyStorageBytesContract;return e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.bytes!=null&&(i.Long?(t.bytes=i.Long.fromValue(e.bytes)).unsigned=!1:typeof e.bytes=="string"?t.bytes=parseInt(e.bytes,10):typeof e.bytes=="number"?t.bytes=e.bytes:typeof e.bytes=="object"&&(t.bytes=new i.LongBits(e.bytes.low>>>0,e.bytes.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults)if(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),i.Long){var l=new i.Long(0,0,!1);n.bytes=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.bytes=t.longs===String?"0":0;return e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.bytes!=null&&e.hasOwnProperty("bytes")&&(typeof e.bytes=="number"?n.bytes=t.longs===String?String(e.bytes):e.bytes:n.bytes=t.longs===String?i.Long.prototype.toString.call(e.bytes):t.longs===Number?new i.LongBits(e.bytes.low>>>0,e.bytes.high>>>0).toNumber():e.bytes),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.SellStorageContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.storageBytes=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.storageBytes!=null&&Object.hasOwnProperty.call(e,"storageBytes")&&t.uint32(16).int64(e.storageBytes),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.SellStorageContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.storageBytes=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":e.storageBytes!=null&&e.hasOwnProperty("storageBytes")&&!i.isInteger(e.storageBytes)&&!(e.storageBytes&&i.isInteger(e.storageBytes.low)&&i.isInteger(e.storageBytes.high))?"storageBytes: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.SellStorageContract)return e;var t=new d.protocol.SellStorageContract;return e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.storageBytes!=null&&(i.Long?(t.storageBytes=i.Long.fromValue(e.storageBytes)).unsigned=!1:typeof e.storageBytes=="string"?t.storageBytes=parseInt(e.storageBytes,10):typeof e.storageBytes=="number"?t.storageBytes=e.storageBytes:typeof e.storageBytes=="object"&&(t.storageBytes=new i.LongBits(e.storageBytes.low>>>0,e.storageBytes.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults)if(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),i.Long){var l=new i.Long(0,0,!1);n.storageBytes=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.storageBytes=t.longs===String?"0":0;return e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.storageBytes!=null&&e.hasOwnProperty("storageBytes")&&(typeof e.storageBytes=="number"?n.storageBytes=t.longs===String?String(e.storageBytes):e.storageBytes:n.storageBytes=t.longs===String?i.Long.prototype.toString.call(e.storageBytes):t.longs===Number?new i.LongBits(e.storageBytes.low>>>0,e.storageBytes.high>>>0).toNumber():e.storageBytes),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.ExchangeCreateContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.firstTokenId=i.newBuffer([]),r.prototype.firstTokenBalance=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.secondTokenId=i.newBuffer([]),r.prototype.secondTokenBalance=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.firstTokenId!=null&&Object.hasOwnProperty.call(e,"firstTokenId")&&t.uint32(18).bytes(e.firstTokenId),e.firstTokenBalance!=null&&Object.hasOwnProperty.call(e,"firstTokenBalance")&&t.uint32(24).int64(e.firstTokenBalance),e.secondTokenId!=null&&Object.hasOwnProperty.call(e,"secondTokenId")&&t.uint32(34).bytes(e.secondTokenId),e.secondTokenBalance!=null&&Object.hasOwnProperty.call(e,"secondTokenBalance")&&t.uint32(40).int64(e.secondTokenBalance),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.ExchangeCreateContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.firstTokenId=e.bytes();break;case 3:l.firstTokenBalance=e.int64();break;case 4:l.secondTokenId=e.bytes();break;case 5:l.secondTokenBalance=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":e.firstTokenId!=null&&e.hasOwnProperty("firstTokenId")&&!(e.firstTokenId&&typeof e.firstTokenId.length=="number"||i.isString(e.firstTokenId))?"firstTokenId: buffer expected":e.firstTokenBalance!=null&&e.hasOwnProperty("firstTokenBalance")&&!i.isInteger(e.firstTokenBalance)&&!(e.firstTokenBalance&&i.isInteger(e.firstTokenBalance.low)&&i.isInteger(e.firstTokenBalance.high))?"firstTokenBalance: integer|Long expected":e.secondTokenId!=null&&e.hasOwnProperty("secondTokenId")&&!(e.secondTokenId&&typeof e.secondTokenId.length=="number"||i.isString(e.secondTokenId))?"secondTokenId: buffer expected":e.secondTokenBalance!=null&&e.hasOwnProperty("secondTokenBalance")&&!i.isInteger(e.secondTokenBalance)&&!(e.secondTokenBalance&&i.isInteger(e.secondTokenBalance.low)&&i.isInteger(e.secondTokenBalance.high))?"secondTokenBalance: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.ExchangeCreateContract)return e;var t=new d.protocol.ExchangeCreateContract;return e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.firstTokenId!=null&&(typeof e.firstTokenId=="string"?i.base64.decode(e.firstTokenId,t.firstTokenId=i.newBuffer(i.base64.length(e.firstTokenId)),0):e.firstTokenId.length&&(t.firstTokenId=e.firstTokenId)),e.firstTokenBalance!=null&&(i.Long?(t.firstTokenBalance=i.Long.fromValue(e.firstTokenBalance)).unsigned=!1:typeof e.firstTokenBalance=="string"?t.firstTokenBalance=parseInt(e.firstTokenBalance,10):typeof e.firstTokenBalance=="number"?t.firstTokenBalance=e.firstTokenBalance:typeof e.firstTokenBalance=="object"&&(t.firstTokenBalance=new i.LongBits(e.firstTokenBalance.low>>>0,e.firstTokenBalance.high>>>0).toNumber())),e.secondTokenId!=null&&(typeof e.secondTokenId=="string"?i.base64.decode(e.secondTokenId,t.secondTokenId=i.newBuffer(i.base64.length(e.secondTokenId)),0):e.secondTokenId.length&&(t.secondTokenId=e.secondTokenId)),e.secondTokenBalance!=null&&(i.Long?(t.secondTokenBalance=i.Long.fromValue(e.secondTokenBalance)).unsigned=!1:typeof e.secondTokenBalance=="string"?t.secondTokenBalance=parseInt(e.secondTokenBalance,10):typeof e.secondTokenBalance=="number"?t.secondTokenBalance=e.secondTokenBalance:typeof e.secondTokenBalance=="object"&&(t.secondTokenBalance=new i.LongBits(e.secondTokenBalance.low>>>0,e.secondTokenBalance.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),t.bytes===String?n.firstTokenId="":(n.firstTokenId=[],t.bytes!==Array&&(n.firstTokenId=i.newBuffer(n.firstTokenId))),i.Long){var l=new i.Long(0,0,!1);n.firstTokenBalance=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.firstTokenBalance=t.longs===String?"0":0;if(t.bytes===String?n.secondTokenId="":(n.secondTokenId=[],t.bytes!==Array&&(n.secondTokenId=i.newBuffer(n.secondTokenId))),i.Long){var l=new i.Long(0,0,!1);n.secondTokenBalance=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.secondTokenBalance=t.longs===String?"0":0}return e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.firstTokenId!=null&&e.hasOwnProperty("firstTokenId")&&(n.firstTokenId=t.bytes===String?i.base64.encode(e.firstTokenId,0,e.firstTokenId.length):t.bytes===Array?Array.prototype.slice.call(e.firstTokenId):e.firstTokenId),e.firstTokenBalance!=null&&e.hasOwnProperty("firstTokenBalance")&&(typeof e.firstTokenBalance=="number"?n.firstTokenBalance=t.longs===String?String(e.firstTokenBalance):e.firstTokenBalance:n.firstTokenBalance=t.longs===String?i.Long.prototype.toString.call(e.firstTokenBalance):t.longs===Number?new i.LongBits(e.firstTokenBalance.low>>>0,e.firstTokenBalance.high>>>0).toNumber():e.firstTokenBalance),e.secondTokenId!=null&&e.hasOwnProperty("secondTokenId")&&(n.secondTokenId=t.bytes===String?i.base64.encode(e.secondTokenId,0,e.secondTokenId.length):t.bytes===Array?Array.prototype.slice.call(e.secondTokenId):e.secondTokenId),e.secondTokenBalance!=null&&e.hasOwnProperty("secondTokenBalance")&&(typeof e.secondTokenBalance=="number"?n.secondTokenBalance=t.longs===String?String(e.secondTokenBalance):e.secondTokenBalance:n.secondTokenBalance=t.longs===String?i.Long.prototype.toString.call(e.secondTokenBalance):t.longs===Number?new i.LongBits(e.secondTokenBalance.low>>>0,e.secondTokenBalance.high>>>0).toNumber():e.secondTokenBalance),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.ExchangeInjectContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.exchangeId=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.tokenId=i.newBuffer([]),r.prototype.quant=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.exchangeId!=null&&Object.hasOwnProperty.call(e,"exchangeId")&&t.uint32(16).int64(e.exchangeId),e.tokenId!=null&&Object.hasOwnProperty.call(e,"tokenId")&&t.uint32(26).bytes(e.tokenId),e.quant!=null&&Object.hasOwnProperty.call(e,"quant")&&t.uint32(32).int64(e.quant),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.ExchangeInjectContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.exchangeId=e.int64();break;case 3:l.tokenId=e.bytes();break;case 4:l.quant=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":e.exchangeId!=null&&e.hasOwnProperty("exchangeId")&&!i.isInteger(e.exchangeId)&&!(e.exchangeId&&i.isInteger(e.exchangeId.low)&&i.isInteger(e.exchangeId.high))?"exchangeId: integer|Long expected":e.tokenId!=null&&e.hasOwnProperty("tokenId")&&!(e.tokenId&&typeof e.tokenId.length=="number"||i.isString(e.tokenId))?"tokenId: buffer expected":e.quant!=null&&e.hasOwnProperty("quant")&&!i.isInteger(e.quant)&&!(e.quant&&i.isInteger(e.quant.low)&&i.isInteger(e.quant.high))?"quant: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.ExchangeInjectContract)return e;var t=new d.protocol.ExchangeInjectContract;return e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.exchangeId!=null&&(i.Long?(t.exchangeId=i.Long.fromValue(e.exchangeId)).unsigned=!1:typeof e.exchangeId=="string"?t.exchangeId=parseInt(e.exchangeId,10):typeof e.exchangeId=="number"?t.exchangeId=e.exchangeId:typeof e.exchangeId=="object"&&(t.exchangeId=new i.LongBits(e.exchangeId.low>>>0,e.exchangeId.high>>>0).toNumber())),e.tokenId!=null&&(typeof e.tokenId=="string"?i.base64.decode(e.tokenId,t.tokenId=i.newBuffer(i.base64.length(e.tokenId)),0):e.tokenId.length&&(t.tokenId=e.tokenId)),e.quant!=null&&(i.Long?(t.quant=i.Long.fromValue(e.quant)).unsigned=!1:typeof e.quant=="string"?t.quant=parseInt(e.quant,10):typeof e.quant=="number"?t.quant=e.quant:typeof e.quant=="object"&&(t.quant=new i.LongBits(e.quant.low>>>0,e.quant.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),i.Long){var l=new i.Long(0,0,!1);n.exchangeId=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.exchangeId=t.longs===String?"0":0;if(t.bytes===String?n.tokenId="":(n.tokenId=[],t.bytes!==Array&&(n.tokenId=i.newBuffer(n.tokenId))),i.Long){var l=new i.Long(0,0,!1);n.quant=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.quant=t.longs===String?"0":0}return e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.exchangeId!=null&&e.hasOwnProperty("exchangeId")&&(typeof e.exchangeId=="number"?n.exchangeId=t.longs===String?String(e.exchangeId):e.exchangeId:n.exchangeId=t.longs===String?i.Long.prototype.toString.call(e.exchangeId):t.longs===Number?new i.LongBits(e.exchangeId.low>>>0,e.exchangeId.high>>>0).toNumber():e.exchangeId),e.tokenId!=null&&e.hasOwnProperty("tokenId")&&(n.tokenId=t.bytes===String?i.base64.encode(e.tokenId,0,e.tokenId.length):t.bytes===Array?Array.prototype.slice.call(e.tokenId):e.tokenId),e.quant!=null&&e.hasOwnProperty("quant")&&(typeof e.quant=="number"?n.quant=t.longs===String?String(e.quant):e.quant:n.quant=t.longs===String?i.Long.prototype.toString.call(e.quant):t.longs===Number?new i.LongBits(e.quant.low>>>0,e.quant.high>>>0).toNumber():e.quant),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.ExchangeWithdrawContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.exchangeId=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.tokenId=i.newBuffer([]),r.prototype.quant=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.exchangeId!=null&&Object.hasOwnProperty.call(e,"exchangeId")&&t.uint32(16).int64(e.exchangeId),e.tokenId!=null&&Object.hasOwnProperty.call(e,"tokenId")&&t.uint32(26).bytes(e.tokenId),e.quant!=null&&Object.hasOwnProperty.call(e,"quant")&&t.uint32(32).int64(e.quant),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.ExchangeWithdrawContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.exchangeId=e.int64();break;case 3:l.tokenId=e.bytes();break;case 4:l.quant=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":e.exchangeId!=null&&e.hasOwnProperty("exchangeId")&&!i.isInteger(e.exchangeId)&&!(e.exchangeId&&i.isInteger(e.exchangeId.low)&&i.isInteger(e.exchangeId.high))?"exchangeId: integer|Long expected":e.tokenId!=null&&e.hasOwnProperty("tokenId")&&!(e.tokenId&&typeof e.tokenId.length=="number"||i.isString(e.tokenId))?"tokenId: buffer expected":e.quant!=null&&e.hasOwnProperty("quant")&&!i.isInteger(e.quant)&&!(e.quant&&i.isInteger(e.quant.low)&&i.isInteger(e.quant.high))?"quant: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.ExchangeWithdrawContract)return e;var t=new d.protocol.ExchangeWithdrawContract;return e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.exchangeId!=null&&(i.Long?(t.exchangeId=i.Long.fromValue(e.exchangeId)).unsigned=!1:typeof e.exchangeId=="string"?t.exchangeId=parseInt(e.exchangeId,10):typeof e.exchangeId=="number"?t.exchangeId=e.exchangeId:typeof e.exchangeId=="object"&&(t.exchangeId=new i.LongBits(e.exchangeId.low>>>0,e.exchangeId.high>>>0).toNumber())),e.tokenId!=null&&(typeof e.tokenId=="string"?i.base64.decode(e.tokenId,t.tokenId=i.newBuffer(i.base64.length(e.tokenId)),0):e.tokenId.length&&(t.tokenId=e.tokenId)),e.quant!=null&&(i.Long?(t.quant=i.Long.fromValue(e.quant)).unsigned=!1:typeof e.quant=="string"?t.quant=parseInt(e.quant,10):typeof e.quant=="number"?t.quant=e.quant:typeof e.quant=="object"&&(t.quant=new i.LongBits(e.quant.low>>>0,e.quant.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),i.Long){var l=new i.Long(0,0,!1);n.exchangeId=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.exchangeId=t.longs===String?"0":0;if(t.bytes===String?n.tokenId="":(n.tokenId=[],t.bytes!==Array&&(n.tokenId=i.newBuffer(n.tokenId))),i.Long){var l=new i.Long(0,0,!1);n.quant=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.quant=t.longs===String?"0":0}return e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.exchangeId!=null&&e.hasOwnProperty("exchangeId")&&(typeof e.exchangeId=="number"?n.exchangeId=t.longs===String?String(e.exchangeId):e.exchangeId:n.exchangeId=t.longs===String?i.Long.prototype.toString.call(e.exchangeId):t.longs===Number?new i.LongBits(e.exchangeId.low>>>0,e.exchangeId.high>>>0).toNumber():e.exchangeId),e.tokenId!=null&&e.hasOwnProperty("tokenId")&&(n.tokenId=t.bytes===String?i.base64.encode(e.tokenId,0,e.tokenId.length):t.bytes===Array?Array.prototype.slice.call(e.tokenId):e.tokenId),e.quant!=null&&e.hasOwnProperty("quant")&&(typeof e.quant=="number"?n.quant=t.longs===String?String(e.quant):e.quant:n.quant=t.longs===String?i.Long.prototype.toString.call(e.quant):t.longs===Number?new i.LongBits(e.quant.low>>>0,e.quant.high>>>0).toNumber():e.quant),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.ExchangeTransactionContract=function(){function r(o){if(o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.exchangeId=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.tokenId=i.newBuffer([]),r.prototype.quant=i.Long?i.Long.fromBits(0,0,!1):0,r.prototype.expected=i.Long?i.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.exchangeId!=null&&Object.hasOwnProperty.call(e,"exchangeId")&&t.uint32(16).int64(e.exchangeId),e.tokenId!=null&&Object.hasOwnProperty.call(e,"tokenId")&&t.uint32(26).bytes(e.tokenId),e.quant!=null&&Object.hasOwnProperty.call(e,"quant")&&t.uint32(32).int64(e.quant),e.expected!=null&&Object.hasOwnProperty.call(e,"expected")&&t.uint32(40).int64(e.expected),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.ExchangeTransactionContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.exchangeId=e.int64();break;case 3:l.tokenId=e.bytes();break;case 4:l.quant=e.int64();break;case 5:l.expected=e.int64();break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress))?"ownerAddress: buffer expected":e.exchangeId!=null&&e.hasOwnProperty("exchangeId")&&!i.isInteger(e.exchangeId)&&!(e.exchangeId&&i.isInteger(e.exchangeId.low)&&i.isInteger(e.exchangeId.high))?"exchangeId: integer|Long expected":e.tokenId!=null&&e.hasOwnProperty("tokenId")&&!(e.tokenId&&typeof e.tokenId.length=="number"||i.isString(e.tokenId))?"tokenId: buffer expected":e.quant!=null&&e.hasOwnProperty("quant")&&!i.isInteger(e.quant)&&!(e.quant&&i.isInteger(e.quant.low)&&i.isInteger(e.quant.high))?"quant: integer|Long expected":e.expected!=null&&e.hasOwnProperty("expected")&&!i.isInteger(e.expected)&&!(e.expected&&i.isInteger(e.expected.low)&&i.isInteger(e.expected.high))?"expected: integer|Long expected":null},r.fromObject=function(e){if(e instanceof d.protocol.ExchangeTransactionContract)return e;var t=new d.protocol.ExchangeTransactionContract;return e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.exchangeId!=null&&(i.Long?(t.exchangeId=i.Long.fromValue(e.exchangeId)).unsigned=!1:typeof e.exchangeId=="string"?t.exchangeId=parseInt(e.exchangeId,10):typeof e.exchangeId=="number"?t.exchangeId=e.exchangeId:typeof e.exchangeId=="object"&&(t.exchangeId=new i.LongBits(e.exchangeId.low>>>0,e.exchangeId.high>>>0).toNumber())),e.tokenId!=null&&(typeof e.tokenId=="string"?i.base64.decode(e.tokenId,t.tokenId=i.newBuffer(i.base64.length(e.tokenId)),0):e.tokenId.length&&(t.tokenId=e.tokenId)),e.quant!=null&&(i.Long?(t.quant=i.Long.fromValue(e.quant)).unsigned=!1:typeof e.quant=="string"?t.quant=parseInt(e.quant,10):typeof e.quant=="number"?t.quant=e.quant:typeof e.quant=="object"&&(t.quant=new i.LongBits(e.quant.low>>>0,e.quant.high>>>0).toNumber())),e.expected!=null&&(i.Long?(t.expected=i.Long.fromValue(e.expected)).unsigned=!1:typeof e.expected=="string"?t.expected=parseInt(e.expected,10):typeof e.expected=="number"?t.expected=e.expected:typeof e.expected=="object"&&(t.expected=new i.LongBits(e.expected.low>>>0,e.expected.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),i.Long){var l=new i.Long(0,0,!1);n.exchangeId=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.exchangeId=t.longs===String?"0":0;if(t.bytes===String?n.tokenId="":(n.tokenId=[],t.bytes!==Array&&(n.tokenId=i.newBuffer(n.tokenId))),i.Long){var l=new i.Long(0,0,!1);n.quant=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.quant=t.longs===String?"0":0;if(i.Long){var l=new i.Long(0,0,!1);n.expected=t.longs===String?l.toString():t.longs===Number?l.toNumber():l}else n.expected=t.longs===String?"0":0}return e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.exchangeId!=null&&e.hasOwnProperty("exchangeId")&&(typeof e.exchangeId=="number"?n.exchangeId=t.longs===String?String(e.exchangeId):e.exchangeId:n.exchangeId=t.longs===String?i.Long.prototype.toString.call(e.exchangeId):t.longs===Number?new i.LongBits(e.exchangeId.low>>>0,e.exchangeId.high>>>0).toNumber():e.exchangeId),e.tokenId!=null&&e.hasOwnProperty("tokenId")&&(n.tokenId=t.bytes===String?i.base64.encode(e.tokenId,0,e.tokenId.length):t.bytes===Array?Array.prototype.slice.call(e.tokenId):e.tokenId),e.quant!=null&&e.hasOwnProperty("quant")&&(typeof e.quant=="number"?n.quant=t.longs===String?String(e.quant):e.quant:n.quant=t.longs===String?i.Long.prototype.toString.call(e.quant):t.longs===Number?new i.LongBits(e.quant.low>>>0,e.quant.high>>>0).toNumber():e.quant),e.expected!=null&&e.hasOwnProperty("expected")&&(typeof e.expected=="number"?n.expected=t.longs===String?String(e.expected):e.expected:n.expected=t.longs===String?i.Long.prototype.toString.call(e.expected):t.longs===Number?new i.LongBits(e.expected.low>>>0,e.expected.high>>>0).toNumber():e.expected),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f.AccountPermissionUpdateContract=function(){function r(o){if(this.actives=[],o)for(var e=Object.keys(o),t=0;t<e.length;++t)o[e[t]]!=null&&(this[e[t]]=o[e[t]])}return r.prototype.ownerAddress=i.newBuffer([]),r.prototype.owner=null,r.prototype.witness=null,r.prototype.actives=i.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=H.create()),e.ownerAddress!=null&&Object.hasOwnProperty.call(e,"ownerAddress")&&t.uint32(10).bytes(e.ownerAddress),e.owner!=null&&Object.hasOwnProperty.call(e,"owner")&&d.protocol.Permission.encode(e.owner,t.uint32(18).fork()).ldelim(),e.witness!=null&&Object.hasOwnProperty.call(e,"witness")&&d.protocol.Permission.encode(e.witness,t.uint32(26).fork()).ldelim(),e.actives!=null&&e.actives.length)for(var n=0;n<e.actives.length;++n)d.protocol.Permission.encode(e.actives[n],t.uint32(34).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t){e instanceof v||(e=v.create(e));for(var n=t===void 0?e.len:e.pos+t,l=new d.protocol.AccountPermissionUpdateContract;e.pos<n;){var c=e.uint32();switch(c>>>3){case 1:l.ownerAddress=e.bytes();break;case 2:l.owner=d.protocol.Permission.decode(e,e.uint32());break;case 3:l.witness=d.protocol.Permission.decode(e,e.uint32());break;case 4:l.actives&&l.actives.length||(l.actives=[]),l.actives.push(d.protocol.Permission.decode(e,e.uint32()));break;default:e.skipType(c&7);break}}return l},r.decodeDelimited=function(e){return e instanceof v||(e=new v(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&!(e.ownerAddress&&typeof e.ownerAddress.length=="number"||i.isString(e.ownerAddress)))return"ownerAddress: buffer expected";if(e.owner!=null&&e.hasOwnProperty("owner")){var t=d.protocol.Permission.verify(e.owner);if(t)return"owner."+t}if(e.witness!=null&&e.hasOwnProperty("witness")){var t=d.protocol.Permission.verify(e.witness);if(t)return"witness."+t}if(e.actives!=null&&e.hasOwnProperty("actives")){if(!Array.isArray(e.actives))return"actives: array expected";for(var n=0;n<e.actives.length;++n){var t=d.protocol.Permission.verify(e.actives[n]);if(t)return"actives."+t}}return null},r.fromObject=function(e){if(e instanceof d.protocol.AccountPermissionUpdateContract)return e;var t=new d.protocol.AccountPermissionUpdateContract;if(e.ownerAddress!=null&&(typeof e.ownerAddress=="string"?i.base64.decode(e.ownerAddress,t.ownerAddress=i.newBuffer(i.base64.length(e.ownerAddress)),0):e.ownerAddress.length&&(t.ownerAddress=e.ownerAddress)),e.owner!=null){if(typeof e.owner!="object")throw TypeError(".protocol.AccountPermissionUpdateContract.owner: object expected");t.owner=d.protocol.Permission.fromObject(e.owner)}if(e.witness!=null){if(typeof e.witness!="object")throw TypeError(".protocol.AccountPermissionUpdateContract.witness: object expected");t.witness=d.protocol.Permission.fromObject(e.witness)}if(e.actives){if(!Array.isArray(e.actives))throw TypeError(".protocol.AccountPermissionUpdateContract.actives: array expected");t.actives=[];for(var n=0;n<e.actives.length;++n){if(typeof e.actives[n]!="object")throw TypeError(".protocol.AccountPermissionUpdateContract.actives: object expected");t.actives[n]=d.protocol.Permission.fromObject(e.actives[n])}}return t},r.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.actives=[]),t.defaults&&(t.bytes===String?n.ownerAddress="":(n.ownerAddress=[],t.bytes!==Array&&(n.ownerAddress=i.newBuffer(n.ownerAddress))),n.owner=null,n.witness=null),e.ownerAddress!=null&&e.hasOwnProperty("ownerAddress")&&(n.ownerAddress=t.bytes===String?i.base64.encode(e.ownerAddress,0,e.ownerAddress.length):t.bytes===Array?Array.prototype.slice.call(e.ownerAddress):e.ownerAddress),e.owner!=null&&e.hasOwnProperty("owner")&&(n.owner=d.protocol.Permission.toObject(e.owner,t)),e.witness!=null&&e.hasOwnProperty("witness")&&(n.witness=d.protocol.Permission.toObject(e.witness,t)),e.actives&&e.actives.length){n.actives=[];for(var l=0;l<e.actives.length;++l)n.actives[l]=d.protocol.Permission.toObject(e.actives[l],t)}return n},r.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},r}(),f}();d.google=function(){var f={};return f.protobuf=function(){var r={};return r.Any=function(){function o(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)e[t[n]]!=null&&(this[t[n]]=e[t[n]])}return o.prototype.type_url="",o.prototype.value=i.newBuffer([]),o.create=function(t){return new o(t)},o.encode=function(t,n){return n||(n=H.create()),t.type_url!=null&&Object.hasOwnProperty.call(t,"type_url")&&n.uint32(10).string(t.type_url),t.value!=null&&Object.hasOwnProperty.call(t,"value")&&n.uint32(18).bytes(t.value),n},o.encodeDelimited=function(t,n){return this.encode(t,n).ldelim()},o.decode=function(t,n){t instanceof v||(t=v.create(t));for(var l=n===void 0?t.len:t.pos+n,c=new d.google.protobuf.Any;t.pos<l;){var u=t.uint32();switch(u>>>3){case 1:c.type_url=t.string();break;case 2:c.value=t.bytes();break;default:t.skipType(u&7);break}}return c},o.decodeDelimited=function(t){return t instanceof v||(t=new v(t)),this.decode(t,t.uint32())},o.verify=function(t){return typeof t!="object"||t===null?"object expected":t.type_url!=null&&t.hasOwnProperty("type_url")&&!i.isString(t.type_url)?"type_url: string expected":t.value!=null&&t.hasOwnProperty("value")&&!(t.value&&typeof t.value.length=="number"||i.isString(t.value))?"value: buffer expected":null},o.fromObject=function(t){if(t instanceof d.google.protobuf.Any)return t;var n=new d.google.protobuf.Any;return t.type_url!=null&&(n.type_url=String(t.type_url)),t.value!=null&&(typeof t.value=="string"?i.base64.decode(t.value,n.value=i.newBuffer(i.base64.length(t.value)),0):t.value.length&&(n.value=t.value)),n},o.toObject=function(t,n){n||(n={});var l={};return n.defaults&&(l.type_url="",n.bytes===String?l.value="":(l.value=[],n.bytes!==Array&&(l.value=i.newBuffer(l.value)))),t.type_url!=null&&t.hasOwnProperty("type_url")&&(l.type_url=t.type_url),t.value!=null&&t.hasOwnProperty("value")&&(l.value=n.bytes===String?i.base64.encode(t.value,0,t.value.length):n.bytes===Array?Array.prototype.slice.call(t.value):t.value),l},o.prototype.toJSON=function(){return this.constructor.toObject(this,V.util.toJSONOptions)},o}(),r}(),f}();Fd.exports=d});export{Gn as a,St as b,br as c,No as d,ol as e,Po as f,fl as g,to as h,pt as i,gl as j,Do as k,Rc as l,Hc as m,Pd as n,ul as o,sg as p};
|
||
|
||
window.inOKXExtension = true;
|
||
window.inMiniApp = false;
|
||
window.ASSETS_BUILD_TYPE = "publish";
|
||
|
||
//# sourceMappingURL=chunk-BZL7N66F.js.map
|