dash-platform-sdk 1.4.0-dev.16 → 1.4.0-dev.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bundle.min.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).t={})}(this,function(t){"use strict";function e(t){let e=typeof t;if("object"==e){if(Array.isArray(t))return"array";if(null===t)return"null"}return e}function n(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)}let r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),i=[];for(let t=0;t<r.length;t++)i[r[t].charCodeAt(0)]=t;function o(t){let e=3*t.length/4;"="==t[t.length-2]?e-=2:"="==t[t.length-1]&&(e-=1);let n,r=new Uint8Array(e),o=0,s=0,a=0;for(let e=0;e<t.length;e++){if(n=i[t.charCodeAt(e)],void 0===n)switch(t[e]){case"=":s=0;case"\n":case"\r":case"\t":case" ":continue;default:throw Error("invalid base64 string.")}switch(s){case 0:a=n,s=1;break;case 1:r[o++]=a<<2|(48&n)>>4,a=n,s=2;break;case 2:r[o++]=(15&a)<<4|(60&n)>>2,a=n,s=3;break;case 3:r[o++]=(3&a)<<6|n,s=0}}if(1==s)throw Error("invalid base64 string.");return r.subarray(0,o)}function s(t){let e,n="",i=0,o=0;for(let s=0;s<t.length;s++)switch(e=t[s],i){case 0:n+=r[e>>2],o=(3&e)<<4,i=1;break;case 1:n+=r[o|e>>4],o=(15&e)<<2,i=2;break;case 2:n+=r[o|e>>6],n+=r[63&e],i=0}return i&&(n+=r[o],n+="=",1==i&&(n+="=")),n}var a,c;function l(t,e){return Object.assign(Object.assign({},t),e)}function u(){let t=0,e=0;for(let n=0;n<28;n+=7){let r=this.i[this.o++];if(t|=(127&r)<<n,!(128&r))return this.l(),[t,e]}let n=this.i[this.o++];if(t|=(15&n)<<28,e=(112&n)>>4,!(128&n))return this.l(),[t,e];for(let n=3;n<=31;n+=7){let r=this.i[this.o++];if(e|=(127&r)<<n,!(128&r))return this.l(),[t,e]}throw new Error("invalid varint")}function h(t,e,n){for(let r=0;r<28;r+=7){const i=t>>>r,o=!(i>>>7==0&&0==e),s=255&(o?128|i:i);if(n.push(s),!o)return}const r=t>>>28&15|(7&e)<<4,i=!!(e>>3);if(n.push(255&(i?128|r:r)),i){for(let t=3;t<31;t+=7){const r=e>>>t,i=!(r>>>7==0),o=255&(i?128|r:r);if(n.push(o),!i)return}n.push(e>>>31&1)}}i["-".charCodeAt(0)]=r.indexOf("+"),i["_".charCodeAt(0)]=r.indexOf("/"),function(t){t.u=Symbol.for("protobuf-ts/unknown"),t.h=(n,r,i,o,s)=>{(e(r)?r[t.u]:r[t.u]=[]).push({p:i,m:o,data:s})},t.v=(e,n,r)=>{for(let{p:e,m:i,data:o}of t.list(n))r.tag(e,i).raw(o)},t.list=(n,r)=>{if(e(n)){let e=n[t.u];return r?e.filter(t=>t.p==r):e}return[]},t.I=(e,n)=>t.list(e,n).slice(-1)[0];const e=e=>e&&Array.isArray(e[t.u])}(a||(a={})),function(t){t[t.k=0]="Varint",t[t.T=1]="Bit64",t[t.A=2]="LengthDelimited",t[t.B=3]="StartGroup",t[t.R=4]="EndGroup",t[t.P=5]="Bit32"}(c||(c={}));const f=4294967296;function d(t){let e="-"==t[0];e&&(t=t.slice(1));const n=1e6;let r=0,i=0;function o(e,o){const s=Number(t.slice(e,o));i*=n,r=r*n+s,r>=f&&(i+=r/f|0,r%=f)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),[e,r,i]}function w(t,e){if(e>>>0<=2097151)return""+(f*e+(t>>>0));let n=(t>>>24|e<<8)>>>0&16777215,r=e>>16&65535,i=(16777215&t)+6777216*n+6710656*r,o=n+8147497*r,s=2*r,a=1e7;function c(t,e){let n=t?String(t):"";return e?"0000000".slice(n.length)+n:n}return i>=a&&(o+=Math.floor(i/a),i%=a),o>=a&&(s+=Math.floor(o/a),o%=a),c(s,0)+c(o,s)+c(i,1)}function p(t,e){if(t>=0){for(;t>127;)e.push(127&t|128),t>>>=7;e.push(t)}else{for(let n=0;n<9;n++)e.push(127&t|128),t>>=7;e.push(1)}}function y(){let t=this.i[this.o++],e=127&t;if(!(128&t))return this.l(),e;if(t=this.i[this.o++],e|=(127&t)<<7,!(128&t))return this.l(),e;if(t=this.i[this.o++],e|=(127&t)<<14,!(128&t))return this.l(),e;if(t=this.i[this.o++],e|=(127&t)<<21,!(128&t))return this.l(),e;t=this.i[this.o++],e|=(15&t)<<28;for(let e=5;128&t&&e<10;e++)t=this.i[this.o++];if(128&t)throw new Error("invalid varint");return this.l(),e>>>0}let g;function b(t){if(!t)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}!function(){const t=new DataView(new ArrayBuffer(8)),e=void 0!==globalThis.BigInt&&"function"==typeof t.getBigInt64&&"function"==typeof t.getBigUint64&&"function"==typeof t.setBigInt64&&"function"==typeof t.setBigUint64;g=e?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),N:BigInt("0"),$:BigInt("18446744073709551615"),U:BigInt,S:t}:void 0}();const m=/^-?[0-9]+$/,v=4294967296,I=2147483648;class k{constructor(t,e){this.C=0|t,this.G=0|e}V(){return 0==this.C&&0==this.G}K(){let t=this.G*v+(this.C>>>0);if(!Number.isSafeInteger(t))throw new Error("cannot convert to safe number");return t}}class T extends k{static from(t){if(g)switch(typeof t){case"string":if("0"==t)return this.ZERO;if(""==t)throw new Error("string is no integer");t=g.U(t);case"number":if(0===t)return this.ZERO;t=g.U(t);case"bigint":if(!t)return this.ZERO;if(t<g.N)throw new Error("signed value for ulong");if(t>g.$)throw new Error("ulong too large");return g.S.setBigUint64(0,t,!0),new T(g.S.getInt32(0,!0),g.S.getInt32(4,!0))}else switch(typeof t){case"string":if("0"==t)return this.ZERO;if(t=t.trim(),!m.test(t))throw new Error("string is no integer");let[e,n,r]=d(t);if(e)throw new Error("signed value for ulong");return new T(n,r);case"number":if(0==t)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");if(t<0)throw new Error("signed value for ulong");return new T(t,t/v)}throw new Error("unknown value "+typeof t)}toString(){return g?this.O().toString():w(this.C,this.G)}O(){return b(g),g.S.setInt32(0,this.C,!0),g.S.setInt32(4,this.G,!0),g.S.getBigUint64(0,!0)}}T.ZERO=new T(0,0);class A extends k{static from(t){if(g)switch(typeof t){case"string":if("0"==t)return this.ZERO;if(""==t)throw new Error("string is no integer");t=g.U(t);case"number":if(0===t)return this.ZERO;t=g.U(t);case"bigint":if(!t)return this.ZERO;if(t<g.MIN)throw new Error("signed long too small");if(t>g.MAX)throw new Error("signed long too large");return g.S.setBigInt64(0,t,!0),new A(g.S.getInt32(0,!0),g.S.getInt32(4,!0))}else switch(typeof t){case"string":if("0"==t)return this.ZERO;if(t=t.trim(),!m.test(t))throw new Error("string is no integer");let[e,n,r]=d(t);if(e){if(r>I||r==I&&0!=n)throw new Error("signed long too small")}else if(r>=I)throw new Error("signed long too large");let i=new A(n,r);return e?i.F():i;case"number":if(0==t)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");return t>0?new A(t,t/v):new A(-t,-t/v).F()}throw new Error("unknown value "+typeof t)}W(){return 0!==(this.G&I)}F(){let t=~this.G,e=this.C;return e?e=1+~e:t+=1,new A(e,t)}toString(){if(g)return this.O().toString();if(this.W()){let t=this.F();return"-"+w(t.C,t.G)}return w(this.C,this.G)}O(){return b(g),g.S.setInt32(0,this.C,!0),g.S.setInt32(4,this.G,!0),g.S.getBigInt64(0,!0)}}A.ZERO=new A(0,0);const B={D:!0,_:t=>new E(t)};class E{constructor(t,e){this.H=u,this.uint32=y,this.i=t,this.j=t.length,this.o=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.M=null!=e?e:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}tag(){let t=this.uint32(),e=t>>>3,n=7&t;if(e<=0||n<0||n>5)throw new Error("illegal tag: field no "+e+" wire type "+n);return[e,n]}L(t){let e=this.o;switch(t){case c.k:for(;128&this.i[this.o++];);break;case c.T:this.o+=4;case c.P:this.o+=4;break;case c.A:let e=this.uint32();this.o+=e;break;case c.B:let n;for(;(n=this.tag()[1])!==c.R;)this.L(n);break;default:throw new Error("cant skip wire type "+t)}return this.l(),this.i.subarray(e,this.o)}l(){if(this.o>this.j)throw new RangeError("premature EOF")}int32(){return 0|this.uint32()}Z(){let t=this.uint32();return t>>>1^-(1&t)}q(){return new A(...this.H())}Y(){return new T(...this.H())}X(){let[t,e]=this.H(),n=-(1&t);return t=(t>>>1|(1&e)<<31)^n,e=e>>>1^n,new A(t,e)}J(){let[t,e]=this.H();return 0!==t||0!==e}tt(){return this.view.getUint32((this.o+=4)-4,!0)}et(){return this.view.getInt32((this.o+=4)-4,!0)}nt(){return new T(this.et(),this.et())}rt(){return new A(this.et(),this.et())}float(){return this.view.getFloat32((this.o+=4)-4,!0)}it(){return this.view.getFloat64((this.o+=8)-8,!0)}bytes(){let t=this.uint32(),e=this.o;return this.o+=t,this.l(),this.i.subarray(e,e+t)}string(){return this.M.decode(this.bytes())}}function R(t,e){if(!t)throw new Error(e)}function P(t){if("number"!=typeof t)throw new Error("invalid int 32: "+typeof t);if(!Number.isInteger(t)||t>2147483647||t<-2147483648)throw new Error("invalid int 32: "+t)}function N(t){if("number"!=typeof t)throw new Error("invalid uint 32: "+typeof t);if(!Number.isInteger(t)||t>4294967295||t<0)throw new Error("invalid uint 32: "+t)}function x(t){if("number"!=typeof t)throw new Error("invalid float 32: "+typeof t);if(Number.isFinite(t)&&(t>34028234663852886e22||t<-34028234663852886e22))throw new Error("invalid float 32: "+t)}const $={ot:!0,st:()=>new U};let U=class{constructor(t){this.stack=[],this.ct=null!=t?t:new TextEncoder,this.lt=[],this.i=[]}finish(){this.lt.push(new Uint8Array(this.i));let t=0;for(let e=0;e<this.lt.length;e++)t+=this.lt[e].length;let e=new Uint8Array(t),n=0;for(let t=0;t<this.lt.length;t++)e.set(this.lt[t],n),n+=this.lt[t].length;return this.lt=[],e}ut(){return this.stack.push({lt:this.lt,i:this.i}),this.lt=[],this.i=[],this}join(){let t=this.finish(),e=this.stack.pop();if(!e)throw new Error("invalid state, fork stack empty");return this.lt=e.lt,this.i=e.i,this.uint32(t.byteLength),this.raw(t)}tag(t,e){return this.uint32((t<<3|e)>>>0)}raw(t){return this.i.length&&(this.lt.push(new Uint8Array(this.i)),this.i=[]),this.lt.push(t),this}uint32(t){for(N(t);t>127;)this.i.push(127&t|128),t>>>=7;return this.i.push(t),this}int32(t){return P(t),p(t,this.i),this}J(t){return this.i.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let e=this.ct.encode(t);return this.uint32(e.byteLength),this.raw(e)}float(t){x(t);let e=new Uint8Array(4);return new DataView(e.buffer).setFloat32(0,t,!0),this.raw(e)}it(t){let e=new Uint8Array(8);return new DataView(e.buffer).setFloat64(0,t,!0),this.raw(e)}tt(t){N(t);let e=new Uint8Array(4);return new DataView(e.buffer).setUint32(0,t,!0),this.raw(e)}et(t){P(t);let e=new Uint8Array(4);return new DataView(e.buffer).setInt32(0,t,!0),this.raw(e)}Z(t){return P(t),p(t=(t<<1^t>>31)>>>0,this.i),this}rt(t){let e=new Uint8Array(8),n=new DataView(e.buffer),r=A.from(t);return n.setInt32(0,r.C,!0),n.setInt32(4,r.G,!0),this.raw(e)}nt(t){let e=new Uint8Array(8),n=new DataView(e.buffer),r=T.from(t);return n.setInt32(0,r.C,!0),n.setInt32(4,r.G,!0),this.raw(e)}q(t){let e=A.from(t);return h(e.C,e.G,this.i),this}X(t){let e=A.from(t),n=e.G>>31;return h(e.C<<1^n,(e.G<<1|e.C>>>31)^n,this.i),this}Y(t){let e=T.from(t);return h(e.C,e.G,this.i),this}};const S={ht:!1,ft:!1,dt:!1,wt:0},C={yt:!1};function G(t,e){var n,r;let i=Object.assign(Object.assign({},t),e);return i.gt=[...null!==(n=null==t?void 0:t.gt)&&void 0!==n?n:[],...null!==(r=null==e?void 0:e.gt)&&void 0!==r?r:[]],i}const V=Symbol.for("protobuf-ts/message-type");function K(t){let e=!1;const n=[];for(let r=0;r<t.length;r++){let i=t.charAt(r);"_"==i?e=!0:/\d/.test(i)?(n.push(i),e=!0):e?(n.push(i.toUpperCase()),e=!1):0==r?n.push(i.toLowerCase()):n.push(i)}return n.join("")}var O,F,W;function D(t){var e,n,r,i;return t.localName=null!==(e=t.localName)&&void 0!==e?e:K(t.name),t.bt=null!==(n=t.bt)&&void 0!==n?n:K(t.name),t.repeat=null!==(r=t.repeat)&&void 0!==r?r:W.vt,t.It=null!==(i=t.It)&&void 0!==i?i:!t.repeat&&(!t.kt&&"message"==t.kind),t}function _(t){if("object"!=typeof t||null===t||!t.hasOwnProperty("oneofKind"))return!1;switch(typeof t.Tt){case"string":return void 0!==t[t.Tt]&&2==Object.keys(t).length;case"undefined":return 1==Object.keys(t).length;default:return!1}}!function(t){t[t.At=1]="DOUBLE",t[t.FLOAT=2]="FLOAT",t[t.Bt=3]="INT64",t[t.Et=4]="UINT64",t[t.Rt=5]="INT32",t[t.Pt=6]="FIXED64",t[t.Nt=7]="FIXED32",t[t.BOOL=8]="BOOL",t[t.xt=9]="STRING",t[t.$t=12]="BYTES",t[t.Ut=13]="UINT32",t[t.St=15]="SFIXED32",t[t.Ct=16]="SFIXED64",t[t.Gt=17]="SINT32",t[t.Vt=18]="SINT64"}(O||(O={})),function(t){t[t.Kt=0]="BIGINT",t[t.xt=1]="STRING",t[t.Ot=2]="NUMBER"}(F||(F={})),function(t){t[t.vt=0]="NO",t[t.Ft=1]="PACKED",t[t.Wt=2]="UNPACKED"}(W||(W={}));class H{constructor(t){var e;this.Dt=null!==(e=t.Dt)&&void 0!==e?e:[]}_t(){if(this.data)return;const t=[],e=[],n=[];for(let r of this.Dt)if(r.kt)n.includes(r.kt)||(n.push(r.kt),t.push(r.kt),e.push(r.kt));else switch(e.push(r.localName),r.kind){case"scalar":case"enum":r.It&&!r.repeat||t.push(r.localName);break;case"message":r.repeat&&t.push(r.localName);break;case"map":t.push(r.localName)}this.data={Ht:t,jt:e,Mt:Object.values(n)}}is(t,e,n=!1){if(e<0)return!0;if(null==t||"object"!=typeof t)return!1;this._t();let r=Object.keys(t),i=this.data;if(r.length<i.Ht.length||i.Ht.some(t=>!r.includes(t)))return!1;if(!n&&r.some(t=>!i.jt.includes(t)))return!1;if(e<1)return!0;for(const r of i.Mt){const i=t[r];if(!_(i))return!1;if(void 0===i.Tt)continue;const o=this.Dt.find(t=>t.localName===i.Tt);if(!o)return!1;if(!this.Lt(i[i.Tt],o,n,e))return!1}for(const r of this.Dt)if(void 0===r.kt&&!this.Lt(t[r.localName],r,n,e))return!1;return!0}Lt(t,e,n,r){let i=e.repeat;switch(e.kind){case"scalar":return void 0===t?e.It:i?this.Zt(t,e.qt,r,e.Yt):this.zt(t,e.qt,e.Yt);case"enum":return void 0===t?e.It:i?this.Zt(t,O.Rt,r):this.zt(t,O.Rt);case"message":return void 0===t||(i?this.messages(t,e.qt(),n,r):this.message(t,e.qt(),n,r));case"map":if("object"!=typeof t||null===t)return!1;if(r<2)return!0;if(!this.Xt(t,e.Jt,r))return!1;switch(e.S.kind){case"scalar":return this.Zt(Object.values(t),e.S.qt,r,e.S.Yt);case"enum":return this.Zt(Object.values(t),O.Rt,r);case"message":return this.messages(Object.values(t),e.S.qt(),n,r)}}return!0}message(t,e,n,r){return n?e.Qt(t,r):e.is(t,r)}messages(t,e,n,r){if(!Array.isArray(t))return!1;if(r<2)return!0;if(n){for(let n=0;n<t.length&&n<r;n++)if(!e.Qt(t[n],r-1))return!1}else for(let n=0;n<t.length&&n<r;n++)if(!e.is(t[n],r-1))return!1;return!0}zt(t,e,n){let r=typeof t;switch(e){case O.Et:case O.Pt:case O.Bt:case O.Ct:case O.Vt:switch(n){case F.Kt:return"bigint"==r;case F.Ot:return"number"==r&&!isNaN(t);default:return"string"==r}case O.BOOL:return"boolean"==r;case O.xt:return"string"==r;case O.$t:return t instanceof Uint8Array;case O.At:case O.FLOAT:return"number"==r&&!isNaN(t);default:return"number"==r&&Number.isInteger(t)}}Zt(t,e,n,r){if(!Array.isArray(t))return!1;if(n<2)return!0;if(Array.isArray(t))for(let i=0;i<t.length&&i<n;i++)if(!this.zt(t[i],e,r))return!1;return!0}Xt(t,e,n){let r=Object.keys(t);switch(e){case O.Rt:case O.Nt:case O.St:case O.Gt:case O.Ut:return this.Zt(r.slice(0,n).map(t=>parseInt(t)),e,n);case O.BOOL:return this.Zt(r.slice(0,n).map(t=>"true"==t||"false"!=t&&t),e,n);default:return this.Zt(r,e,n,F.xt)}}}function j(t,e){switch(e){case F.Kt:return t.O();case F.Ot:return t.K();default:return t.toString()}}class M{constructor(t){this.info=t}_t(){var t;if(void 0===this.te){this.te={};const e=null!==(t=this.info.Dt)&&void 0!==t?t:[];for(const t of e)this.te[t.name]=t,this.te[t.bt]=t,this.te[t.localName]=t}}assert(t,n,r){if(!t){let t=e(r);throw"number"!=t&&"boolean"!=t||(t=r.toString()),new Error(`Cannot parse JSON ${t} for ${this.info.ee}#${n}`)}}read(t,e,r){this._t();const i=[];for(const[o,s]of Object.entries(t)){const t=this.te[o];if(!t){if(!r.yt)throw new Error(`Found unknown field while reading ${this.info.ee} from JSON format. JSON key: ${o}`);continue}const a=t.localName;let c;if(t.kt){if(null===s&&("enum"!==t.kind||"google.protobuf.NullValue"!==t.qt()[0]))continue;if(i.includes(t.kt))throw new Error(`Multiple members of the oneof group "${t.kt}" of ${this.info.ee} are present in JSON.`);i.push(t.kt),c=e[t.kt]={Tt:a}}else c=e;if("map"==t.kind){if(null===s)continue;this.assert(n(s),t.name,s);const e=c[a];for(const[n,i]of Object.entries(s)){let o;switch(this.assert(null!==i,t.name+" map value",null),t.S.kind){case"message":o=t.S.qt().ne(i,r);break;case"enum":if(o=this.re(t.S.qt(),i,t.name,r.yt),!1===o)continue;break;case"scalar":o=this.zt(i,t.S.qt,t.S.Yt,t.name)}this.assert(void 0!==o,t.name+" map value",i);let s=n;t.Jt==O.BOOL&&(s="true"==s||"false"!=s&&s),s=this.zt(s,t.Jt,F.xt,t.name).toString(),e[s]=o}}else if(t.repeat){if(null===s)continue;this.assert(Array.isArray(s),t.name,s);const e=c[a];for(const n of s){let i;switch(this.assert(null!==n,t.name,null),t.kind){case"message":i=t.qt().ne(n,r);break;case"enum":if(i=this.re(t.qt(),n,t.name,r.yt),!1===i)continue;break;case"scalar":i=this.zt(n,t.qt,t.Yt,t.name)}this.assert(void 0!==i,t.name,s),e.push(i)}}else switch(t.kind){case"message":if(null===s&&"google.protobuf.Value"!=t.qt().ee){this.assert(void 0===t.kt,t.name+" (oneof member)",null);continue}c[a]=t.qt().ne(s,r,c[a]);break;case"enum":if(null===s)continue;let e=this.re(t.qt(),s,t.name,r.yt);if(!1===e)continue;c[a]=e;break;case"scalar":if(null===s)continue;c[a]=this.zt(s,t.qt,t.Yt,t.name)}}}re(t,e,n,r){if("google.protobuf.NullValue"==t[0]&&R(null===e||"NULL_VALUE"===e,`Unable to parse field ${this.info.ee}#${n}, enum ${t[0]} only accepts null.`),null===e)return 0;switch(typeof e){case"number":return R(Number.isInteger(e),`Unable to parse field ${this.info.ee}#${n}, enum can only be integral number, got ${e}.`),e;case"string":let i=e;t[2]&&e.substring(0,t[2].length)===t[2]&&(i=e.substring(t[2].length));let o=t[1][i];return(void 0!==o||!r)&&(R("number"==typeof o,`Unable to parse field ${this.info.ee}#${n}, enum ${t[0]} has no value for "${e}".`),o)}R(!1,`Unable to parse field ${this.info.ee}#${n}, cannot parse enum value from ${typeof e}".`)}zt(t,e,n,r){let i;try{switch(e){case O.At:case O.FLOAT:if(null===t)return 0;if("NaN"===t)return Number.NaN;if("Infinity"===t)return Number.POSITIVE_INFINITY;if("-Infinity"===t)return Number.NEGATIVE_INFINITY;if(""===t){i="empty string";break}if("string"==typeof t&&t.trim().length!==t.length){i="extra whitespace";break}if("string"!=typeof t&&"number"!=typeof t)break;let r=Number(t);if(Number.isNaN(r)){i="not a number";break}if(!Number.isFinite(r)){i="too large or small";break}return e==O.FLOAT&&x(r),r;case O.Rt:case O.Nt:case O.St:case O.Gt:case O.Ut:if(null===t)return 0;let s;if("number"==typeof t?s=t:""===t?i="empty string":"string"==typeof t&&(t.trim().length!==t.length?i="extra whitespace":s=Number(t)),void 0===s)break;return e==O.Ut?N(s):P(s),s;case O.Bt:case O.Ct:case O.Vt:if(null===t)return j(A.ZERO,n);if("number"!=typeof t&&"string"!=typeof t)break;return j(A.from(t),n);case O.Pt:case O.Et:if(null===t)return j(T.ZERO,n);if("number"!=typeof t&&"string"!=typeof t)break;return j(T.from(t),n);case O.BOOL:if(null===t)return!1;if("boolean"!=typeof t)break;return t;case O.xt:if(null===t)return"";if("string"!=typeof t){i="extra whitespace";break}try{encodeURIComponent(t)}catch(i){i="invalid UTF8";break}return t;case O.$t:if(null===t||""===t)return new Uint8Array(0);if("string"!=typeof t)break;return o(t)}}catch(t){i=t.message}this.assert(!1,r+(i?" - "+i:""),t)}}class L{constructor(t){var e;this.Dt=null!==(e=t.Dt)&&void 0!==e?e:[]}write(t,e){const n={},r=t;for(const t of this.Dt){if(!t.kt){let i=this.Lt(t,r[t.localName],e);void 0!==i&&(n[e.dt?t.name:t.bt]=i);continue}const i=r[t.kt];if(i.Tt!==t.localName)continue;const o="scalar"==t.kind||"enum"==t.kind?Object.assign(Object.assign({},e),{ht:!0}):e;let s=this.Lt(t,i[t.localName],o);R(void 0!==s),n[e.dt?t.name:t.bt]=s}return n}Lt(t,e,n){let r;if("map"==t.kind){R("object"==typeof e&&null!==e);const i={};switch(t.S.kind){case"scalar":for(const[n,r]of Object.entries(e)){const e=this.zt(t.S.qt,r,t.name,!1,!0);R(void 0!==e),i[n.toString()]=e}break;case"message":const r=t.S.qt();for(const[o,s]of Object.entries(e)){const e=this.message(r,s,t.name,n);R(void 0!==e),i[o.toString()]=e}break;case"enum":const o=t.S.qt();for(const[r,s]of Object.entries(e)){R(void 0===s||"number"==typeof s);const e=this.re(o,s,t.name,!1,!0,n.ft);R(void 0!==e),i[r.toString()]=e}}(n.ht||Object.keys(i).length>0)&&(r=i)}else if(t.repeat){R(Array.isArray(e));const i=[];switch(t.kind){case"scalar":for(let n=0;n<e.length;n++){const r=this.zt(t.qt,e[n],t.name,t.It,!0);R(void 0!==r),i.push(r)}break;case"enum":const r=t.qt();for(let o=0;o<e.length;o++){R(void 0===e[o]||"number"==typeof e[o]);const s=this.re(r,e[o],t.name,t.It,!0,n.ft);R(void 0!==s),i.push(s)}break;case"message":const o=t.qt();for(let r=0;r<e.length;r++){const s=this.message(o,e[r],t.name,n);R(void 0!==s),i.push(s)}}(n.ht||i.length>0||n.ht)&&(r=i)}else switch(t.kind){case"scalar":r=this.zt(t.qt,e,t.name,t.It,n.ht);break;case"enum":r=this.re(t.qt(),e,t.name,t.It,n.ht,n.ft);break;case"message":r=this.message(t.qt(),e,t.name,n)}return r}re(t,e,n,r,i,o){if("google.protobuf.NullValue"==t[0])return i||r?null:void 0;if(void 0!==e){if(0!==e||i||r)return R("number"==typeof e),R(Number.isInteger(e)),o||!t[1].hasOwnProperty(e)?e:t[2]?t[2]+t[1][e]:t[1][e]}else R(r)}message(t,e,n,r){return void 0===e?r.ht?null:void 0:t.ie(e,r)}zt(t,e,n,r,i){if(void 0===e)return void R(r);const o=i||r;switch(t){case O.Rt:case O.St:case O.Gt:return 0===e?o?0:void 0:(P(e),e);case O.Nt:case O.Ut:return 0===e?o?0:void 0:(N(e),e);case O.FLOAT:x(e);case O.At:return 0===e?o?0:void 0:(R("number"==typeof e),Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e);case O.xt:return""===e?o?"":void 0:(R("string"==typeof e),e);case O.BOOL:return!1===e?!o&&void 0:(R("boolean"==typeof e),e);case O.Et:case O.Pt:R("number"==typeof e||"string"==typeof e||"bigint"==typeof e);let t=T.from(e);if(t.V()&&!o)return;return t.toString();case O.Bt:case O.Ct:case O.Vt:R("number"==typeof e||"string"==typeof e||"bigint"==typeof e);let n=A.from(e);if(n.V()&&!o)return;return n.toString();case O.$t:return R(e instanceof Uint8Array),e.byteLength?s(e):o?"":void 0}}}function Z(t,e=F.xt){switch(t){case O.BOOL:return!1;case O.Et:case O.Pt:return j(T.ZERO,e);case O.Bt:case O.Ct:case O.Vt:return j(A.ZERO,e);case O.At:case O.FLOAT:return 0;case O.$t:return new Uint8Array(0);case O.xt:return"";default:return 0}}class q{constructor(t){this.info=t}_t(){var t;if(!this.oe){const e=null!==(t=this.info.Dt)&&void 0!==t?t:[];this.oe=new Map(e.map(t=>[t.p,t]))}}read(t,e,n,r){this._t();const i=void 0===r?t.j:t.o+r;for(;t.o<i;){const[r,i]=t.tag(),o=this.oe.get(r);if(!o){let o=n.D;if("throw"==o)throw new Error(`Unknown field ${r} (wire type ${i}) for ${this.info.ee}`);let s=t.L(i);!1!==o&&(!0===o?a.h:o)(this.info.ee,e,r,i,s);continue}let s=e,l=o.repeat,u=o.localName;switch(o.kt&&(s=s[o.kt],s.Tt!==u&&(s=e[o.kt]={Tt:u})),o.kind){case"scalar":case"enum":let e="enum"==o.kind?O.Rt:o.qt,r="scalar"==o.kind?o.Yt:void 0;if(l){let n=s[u];if(i==c.A&&e!=O.xt&&e!=O.$t){let i=t.uint32()+t.o;for(;t.o<i;)n.push(this.zt(t,e,r))}else n.push(this.zt(t,e,r))}else s[u]=this.zt(t,e,r);break;case"message":if(l){let e=s[u],r=o.qt().se(t,t.uint32(),n);e.push(r)}else s[u]=o.qt().se(t,t.uint32(),n,s[u]);break;case"map":let[a,h]=this.ae(o,t,n);s[u][a]=h}}}ae(t,e,n){let r,i,o=e.uint32(),s=e.o+o;for(;e.o<s;){let[o,s]=e.tag();switch(o){case 1:r=t.Jt==O.BOOL?e.J().toString():this.zt(e,t.Jt,F.xt);break;case 2:switch(t.S.kind){case"scalar":i=this.zt(e,t.S.qt,t.S.Yt);break;case"enum":i=e.int32();break;case"message":i=t.S.qt().se(e,e.uint32(),n)}break;default:throw new Error(`Unknown field ${o} (wire type ${s}) in map entry for ${this.info.ee}#${t.name}`)}}if(void 0===r){let e=Z(t.Jt);r=t.Jt==O.BOOL?e.toString():e}if(void 0===i)switch(t.S.kind){case"scalar":i=Z(t.S.qt,t.S.Yt);break;case"enum":i=0;break;case"message":i=t.S.qt().create()}return[r,i]}zt(t,e,n){switch(e){case O.Rt:return t.int32();case O.xt:return t.string();case O.BOOL:return t.J();case O.At:return t.it();case O.FLOAT:return t.float();case O.Bt:return j(t.q(),n);case O.Et:return j(t.Y(),n);case O.Pt:return j(t.nt(),n);case O.Nt:return t.tt();case O.$t:return t.bytes();case O.Ut:return t.uint32();case O.St:return t.et();case O.Ct:return j(t.rt(),n);case O.Gt:return t.Z();case O.Vt:return j(t.X(),n)}}}class Y{constructor(t){this.info=t}_t(){if(!this.Dt){const t=this.info.Dt?this.info.Dt.concat():[];this.Dt=t.sort((t,e)=>t.p-e.p)}}write(t,e,n){this._t();for(const r of this.Dt){let i,o,s=r.repeat,a=r.localName;if(r.kt){const e=t[r.kt];if(e.Tt!==a)continue;i=e[a],o=!0}else i=t[a],o=!1;switch(r.kind){case"scalar":case"enum":let t="enum"==r.kind?O.Rt:r.qt;if(s)if(R(Array.isArray(i)),s==W.Ft)this.ce(e,t,r.p,i);else for(const n of i)this.zt(e,t,r.p,n,!0);else void 0===i?R(r.It):this.zt(e,t,r.p,i,o||r.It);break;case"message":if(s){R(Array.isArray(i));for(const t of i)this.message(e,n,r.qt(),r.p,t)}else this.message(e,n,r.qt(),r.p,i);break;case"map":R("object"==typeof i&&null!==i);for(const[t,o]of Object.entries(i))this.ae(e,n,r,t,o)}}let r=n.ot;!1!==r&&(!0===r?a.v:r)(this.info.ee,t,e)}ae(t,e,n,r,i){t.tag(n.p,c.A),t.ut();let o=r;switch(n.Jt){case O.Rt:case O.Nt:case O.Ut:case O.St:case O.Gt:o=Number.parseInt(r);break;case O.BOOL:R("true"==r||"false"==r),o="true"==r}switch(this.zt(t,n.Jt,1,o,!0),n.S.kind){case"scalar":this.zt(t,n.S.qt,2,i,!0);break;case"enum":this.zt(t,O.Rt,2,i,!0);break;case"message":this.message(t,e,n.S.qt(),2,i)}t.join()}message(t,e,n,r,i){void 0!==i&&(n.le(i,t.tag(r,c.A).ut(),e),t.join())}zt(t,e,n,r,i){let[o,s,a]=this.ue(e,r);a&&!i||(t.tag(n,o),t[s](r))}ce(t,e,n,r){if(!r.length)return;R(e!==O.$t&&e!==O.xt),t.tag(n,c.A),t.ut();let[,i]=this.ue(e);for(let e=0;e<r.length;e++)t[i](r[e]);t.join()}ue(t,e){let n,r=c.k,i=void 0===e,o=0===e;switch(t){case O.Rt:n="int32";break;case O.xt:o=i||!e.length,r=c.A,n="string";break;case O.BOOL:o=!1===e,n="bool";break;case O.Ut:n="uint32";break;case O.At:r=c.T,n="double";break;case O.FLOAT:r=c.P,n="float";break;case O.Bt:o=i||A.from(e).V(),n="int64";break;case O.Et:o=i||T.from(e).V(),n="uint64";break;case O.Pt:o=i||T.from(e).V(),r=c.T,n="fixed64";break;case O.$t:o=i||!e.byteLength,r=c.A,n="bytes";break;case O.Nt:r=c.P,n="fixed32";break;case O.St:r=c.P,n="sfixed32";break;case O.Ct:o=i||A.from(e).V(),r=c.T,n="sfixed64";break;case O.Gt:n="sint32";break;case O.Vt:o=i||A.from(e).V(),n="sint64"}return[r,n,i||o]}}function z(t,e,n){let r,i,o=n;for(let n of t.Dt){let t=n.localName;if(n.kt){const s=o[n.kt];if(null==(null==s?void 0:s.Tt))continue;if(r=s[t],i=e[n.kt],i.Tt=s.Tt,null==r){delete i[t];continue}}else if(r=o[t],i=e,null==r)continue;switch(n.repeat&&(i[t].length=r.length),n.kind){case"scalar":case"enum":if(n.repeat)for(let e=0;e<r.length;e++)i[t][e]=r[e];else i[t]=r;break;case"message":let e=n.qt();if(n.repeat)for(let n=0;n<r.length;n++)i[t][n]=e.create(r[n]);else void 0===i[t]?i[t]=e.create(r):e.he(i[t],r);break;case"map":switch(n.S.kind){case"scalar":case"enum":Object.assign(i[t],r);break;case"message":let e=n.S.qt();for(let n of Object.keys(r))i[t][n]=e.create(r[n])}}}}const X=Object.values;function J(t,e,n){if(e===n)return!0;if(t!==O.$t)return!1;let r=e,i=n;if(r.length!==i.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!=i[t])return!1;return!0}function Q(t,e,n){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(!J(t,e[r],n[r]))return!1;return!0}function tt(t,e,n){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(!t.equals(e[r],n[r]))return!1;return!0}const et=Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})),nt=et[V]={};class rt{constructor(t,e,n){this.fe=16,this.ee=t,this.Dt=e.map(D),this.options=null!=n?n:{},nt.value=this,this.de=Object.create(null,et),this.we=new H(this),this.pe=new M(this),this.ye=new L(this),this.ge=new q(this),this.be=new Y(this)}create(t){let e=function(t){const e=t.de?Object.create(t.de):Object.defineProperty({},V,{value:t});for(let n of t.Dt){let t=n.localName;if(!n.It)if(n.kt)e[n.kt]={Tt:void 0};else if(n.repeat)e[t]=[];else switch(n.kind){case"scalar":e[t]=Z(n.qt,n.Yt);break;case"enum":e[t]=0;break;case"map":e[t]={}}}return e}(this);return void 0!==t&&z(this,e,t),e}clone(t){let e=this.create();return z(this,e,t),e}equals(t,e){return function(t,e,n){if(e===n)return!0;if(!e||!n)return!1;for(let r of t.Dt){let t=r.localName,i=r.kt?e[r.kt][t]:e[t],o=r.kt?n[r.kt][t]:n[t];switch(r.kind){case"enum":case"scalar":let t="enum"==r.kind?O.Rt:r.qt;if(!(r.repeat?Q(t,i,o):J(t,i,o)))return!1;break;case"map":if(!("message"==r.S.kind?tt(r.S.qt(),X(i),X(o)):Q("enum"==r.S.kind?O.Rt:r.S.qt,X(i),X(o))))return!1;break;case"message":let e=r.qt();if(!(r.repeat?tt(e,i,o):e.equals(i,o)))return!1}}return!0}(this,t,e)}is(t,e=this.fe){return this.we.is(t,e,!1)}Qt(t,e=this.fe){return this.we.is(t,e,!0)}he(t,e){z(this,t,e)}me(t,e){let n=function(t){return t?Object.assign(Object.assign({},B),t):B}(e);return this.se(n._(t),t.byteLength,n)}ve(t,e){return this.ne(t,function(t){return t?Object.assign(Object.assign({},C),t):C}(e))}Ie(t,e){let n=JSON.parse(t);return this.ve(n,e)}ke(t,e){return this.ie(t,function(t){return t?Object.assign(Object.assign({},S),t):S}(e))}Te(t,e){var n;let r=this.ke(t,e);return JSON.stringify(r,null,null!==(n=null==e?void 0:e.wt)&&void 0!==n?n:0)}Ae(t,e){let n=function(t){return t?Object.assign(Object.assign({},$),t):$}(e);return this.le(t,n.st(),n).finish()}ne(t,n,r){if(null!==t&&"object"==typeof t&&!Array.isArray(t)){let e=null!=r?r:this.create();return this.pe.read(t,e,n),e}throw new Error(`Unable to parse message ${this.ee} from JSON ${e(t)}.`)}ie(t,e){return this.ye.write(t,e)}le(t,e,n){return this.be.write(t,e,n),e}se(t,e,n,r){let i=null!=r?r:this.create();return this.ge.read(t,i,n,e),i}}class it extends Error{constructor(t,e="UNKNOWN",n){super(t),this.name="RpcError",Object.setPrototypeOf(this,new.target.prototype),this.code=e,this.Be=null!=n?n:{}}toString(){const t=[this.name+": "+this.message];this.code&&(t.push(""),t.push("Code: "+this.code)),this.Ee&&this.methodName&&t.push("Method: "+this.Ee+"/"+this.methodName);let e=Object.entries(this.Be);if(e.length){t.push(""),t.push("Meta:");for(let[n,r]of e)t.push(` ${n}: ${r}`)}return t.join("\n")}}function ot(t,e){if(!t)return;let n=e;for(let[e,r]of Object.entries(t))r instanceof Date?n[e]=new Date(r.getTime()):Array.isArray(r)?n[e]=r.concat():n[e]=r}var st;!function(t){t[t.Re=0]="PENDING",t[t.Pe=1]="REJECTED",t[t.Ne=2]="RESOLVED"}(st||(st={}));class at{constructor(t=!0){this.xe=st.Re,this.$e=new Promise((t,e)=>{this.Ue=t,this.Se=e}),t&&this.$e.catch(t=>{})}get state(){return this.xe}get promise(){return this.$e}resolve(t){if(this.state!==st.Re)throw new Error(`cannot resolve ${st[this.state].toLowerCase()}`);this.Ue(t),this.xe=st.Ne}reject(t){if(this.state!==st.Re)throw new Error(`cannot reject ${st[this.state].toLowerCase()}`);this.Se(t),this.xe=st.Pe}Ce(t){this.xe===st.Re&&this.resolve(t)}Ge(t){this.xe===st.Re&&this.reject(t)}}class ct{constructor(){this.Ve={Ke:[],Oe:[],Fe:[],cmp:[]},this.We=!1,this.De={_e:[]}}He(t){return this.je(t,this.Ve.Ke)}onMessage(t){return this.je(t,this.Ve.Oe)}Me(t){return this.je(t,this.Ve.Fe)}Le(t){return this.je(t,this.Ve.cmp)}je(t,e){return e.push(t),()=>{let n=e.indexOf(t);n>=0&&e.splice(n,1)}}Ze(){for(let t of Object.values(this.Ve))t.splice(0,t.length)}get closed(){return!1!==this.We}qe(t,e,n){R((t?1:0)+(e?1:0)+(n?1:0)<=1,"only one emission at a time"),t&&this.Ye(t),e&&this.ze(e),n&&this.Xe()}Ye(t){R(!this.closed,"stream is closed"),this.Je({value:t,done:!1}),this.Ve.Oe.forEach(e=>e(t)),this.Ve.Ke.forEach(e=>e(t,void 0,!1))}ze(t){R(!this.closed,"stream is closed"),this.We=t,this.Je(t),this.Ve.Fe.forEach(e=>e(t)),this.Ve.Ke.forEach(e=>e(void 0,t,!1)),this.Ze()}Xe(){R(!this.closed,"stream is closed"),this.We=!0,this.Je({value:null,done:!0}),this.Ve.cmp.forEach(t=>t()),this.Ve.Ke.forEach(t=>t(void 0,void 0,!0)),this.Ze()}[Symbol.asyncIterator](){return!0===this.We?this.Je({value:null,done:!0}):!1!==this.We&&this.Je(this.We),{next:()=>{let t=this.De;R(t,"bad state"),R(!t.Qe,"iterator contract broken");let e=t._e.shift();return e?"value"in e?Promise.resolve(e):Promise.reject(e):(t.Qe=new at,t.Qe.promise)}}}Je(t){let e=this.De;if(e.Qe){const n=e.Qe;R(n.state==st.Re,"iterator contract broken"),"value"in t?n.resolve(t):n.reject(t),delete e.Qe}else e._e.push(t)}}var lt=function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.tn(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}c((r=r.apply(t,e||[])).next())})};class ut{constructor(t,e,n,r,i,o,s){this.method=t,this.en=e,this.request=n,this.headers=r,this.response=i,this.status=o,this.nn=s}then(t,e){return this.rn().then(e=>t?Promise.resolve(t(e)):e,t=>e?Promise.resolve(e(t)):Promise.reject(t))}rn(){return lt(this,void 0,void 0,function*(){let[t,e,n,r]=yield Promise.all([this.headers,this.response,this.status,this.nn]);return{method:this.method,en:this.en,request:this.request,headers:t,response:e,status:n,nn:r}})}}var ht,ft=function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.tn(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}c((r=r.apply(t,e||[])).next())})};class dt{constructor(t,e,n,r,i,o,s){this.method=t,this.en=e,this.request=n,this.headers=r,this.sn=i,this.status=o,this.nn=s}then(t,e){return this.rn().then(e=>t?Promise.resolve(t(e)):e,t=>e?Promise.resolve(e(t)):Promise.reject(t))}rn(){return ft(this,void 0,void 0,function*(){let[t,e,n]=yield Promise.all([this.headers,this.status,this.nn]);return{method:this.method,en:this.en,request:this.request,headers:t,status:e,nn:n}})}}function wt(t,e,n,r,i){var o;{let t=(t,n,r)=>e.an(t,n,r);for(const e of(null!==(o=r.cn)&&void 0!==o?o:[]).filter(t=>t.ln).reverse()){const n=t;t=(t,r,i)=>e.ln(n,t,r,i)}return t(n,i,r)}}!function(t){t[t.OK=0]="OK",t[t.un=1]="CANCELLED",t[t.hn=2]="UNKNOWN",t[t.fn=3]="INVALID_ARGUMENT",t[t.dn=4]="DEADLINE_EXCEEDED",t[t.wn=5]="NOT_FOUND",t[t.pn=6]="ALREADY_EXISTS",t[t.PERMISSION_DENIED=7]="PERMISSION_DENIED",t[t.yn=16]="UNAUTHENTICATED",t[t.gn=8]="RESOURCE_EXHAUSTED",t[t.bn=9]="FAILED_PRECONDITION",t[t.mn=10]="ABORTED",t[t.vn=11]="OUT_OF_RANGE",t[t.In=12]="UNIMPLEMENTED",t[t.kn=13]="INTERNAL",t[t.Tn=14]="UNAVAILABLE",t[t.An=15]="DATA_LOSS"}(ht||(ht={}));var pt,yt=function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.tn(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}c((r=r.apply(t,e||[])).next())})};function gt(t,e,n,r,i){if(r)for(let[e,n]of Object.entries(r))if("string"==typeof n)t.append(e,n);else for(let r of n)t.append(e,r);if(t.set("Content-Type","text"===e?"application/grpc-web-text":"application/grpc-web+proto"),"text"==e&&t.set("Accept","application/grpc-web-text"),t.set("X-Grpc-Web","1"),"number"==typeof n){if(n<=0)throw new it(`timeout ${n} ms exceeded`,ht[ht.dn]);t.set("grpc-timeout",`${n}m`)}else if(n){const e=n.getTime(),r=Date.now();if(e<=r)throw new it(`deadline ${n} exceeded`,ht[ht.dn]);t.set("grpc-timeout",e-r+"m")}return t}function bt(t,e){let n=new Uint8Array(5+t.length);n[0]=pt.Bn;for(let e=t.length,r=4;r>0;r--)n[r]=e%256,e>>>=8;return n.set(t,5),"binary"===e?n:s(n)}function mt(t,e,n){if(1===arguments.length){let e,n=t;try{e=n.type}catch(t){}switch(e){case"error":case"opaque":case"opaqueredirect":throw new it(`fetch response type ${n.type}`,ht[ht.hn])}return mt(function(t){let e={};return t.forEach((t,n)=>{let r=e[n];"string"==typeof r?e[n]=[r,t]:Array.isArray(r)?r.push(t):e[n]=t}),e}(n.headers),n.status,n.statusText)}let r=t,i=e>=200&&e<300,o=Bt(r),[s,a]=At(r);return void 0!==s&&s!==ht.OK||i||(s=function(t){switch(t){case 200:return ht.OK;case 400:return ht.fn;case 401:return ht.yn;case 403:return ht.PERMISSION_DENIED;case 404:return ht.wn;case 409:return ht.mn;case 412:return ht.bn;case 429:return ht.gn;case 499:return ht.un;case 500:default:return ht.hn;case 501:return ht.In;case 503:return ht.Tn;case 504:return ht.dn}}(e),a=n),[s,a,o]}function vt(t){let e=function(t){let e={};for(let n of String.fromCharCode.apply(String,t).trim().split("\r\n")){if(""==n)continue;let[t,...r]=n.split(":");const i=r.join(":").trim();t=t.trim();let o=e[t];"string"==typeof o?e[t]=[o,i]:Array.isArray(o)?o.push(i):e[t]=i}return e}(t),[n,r]=At(e),i=Bt(e);return[null!=n?n:ht.OK,r,i]}function It(t,e,n){return yt(this,void 0,void 0,function*(){let r,i="",s=new Uint8Array(0),a=function(t){switch(t){case"application/grpc-web-text":case"application/grpc-web-text+proto":return"text";case"application/grpc-web":case"application/grpc-web+proto":return"binary";case void 0:case null:throw new it("missing response content type",ht[ht.kn]);default:throw new it("unexpected response content type: "+t,ht[ht.kn])}}(e);if(kt(t)){let e=t.getReader();r={next:()=>e.read()}}else r=t[Symbol.asyncIterator]();for(;;){let t=yield r.next();if(void 0!==t.value){if("text"===a){for(let e=0;e<t.value.length;e++)i+=String.fromCharCode(t.value[e]);let e=i.length-i.length%4;if(0===e)continue;s=Tt(s,o(i.substring(0,e))),i=i.substring(e)}else s=Tt(s,t.value);for(;s.length>=5&&s[0]===pt.Bn;){let t=0;for(let e=1;e<5;e++)t=(t<<8)+s[e];if(!(s.length-5>=t))break;n(pt.Bn,s.subarray(5,5+t)),s=s.subarray(5+t)}}if(t.done){if(0===s.length)break;if(s[0]!==pt.En||s.length<5)throw new it("premature EOF",ht[ht.An]);n(pt.En,s.subarray(5));break}}})}!function(t){t[t.Bn=0]="DATA",t[t.En=128]="TRAILER"}(pt||(pt={}));const kt=t=>"function"==typeof t.getReader;function Tt(t,e){let n=new Uint8Array(t.length+e.length);return n.set(t),n.set(e,t.length),n}function At(t){let e,n,r=t["Rn"];if(void 0!==r){if(Array.isArray(r))return[ht.kn,"invalid grpc-web message"];n=r}let i=t["Pn"];if(void 0!==i){if(Array.isArray(i))return[ht.kn,"invalid grpc-web status"];if(e=parseInt(i,10),void 0===ht[e])return[ht.kn,"invalid grpc-web status"]}return[e,n]}function Bt(t){let e={};for(let[n,r]of Object.entries(t))switch(n){case"grpc-message":case"grpc-status":case"content-type":break;default:e[n]=r}return e}class Et{constructor(t){this.Nn=t}xn(t){return function(t,e){if(!e)return t;let n={};ot(t,n),ot(e,n);for(let r of Object.keys(e)){let i=e[r];switch(r){case"jsonOptions":n.$n=G(t.$n,n.$n);break;case"binaryOptions":n.Un=l(t.Un,n.Un);break;case"meta":n.Be={},ot(t.Be,n.Be),ot(e.Be,n.Be);break;case"interceptors":n.cn=t.cn?t.cn.concat(i):i.concat()}}return n}(this.Nn,t)}Sn(t,e){let n=e.Cn;return n.endsWith("/")&&(n=n.substring(0,n.length-1)),`${n}/${t.service.ee}/${t.name}`}Gn(t){const e=new it("Client streaming is not supported by grpc-web",ht[ht.In]);throw e.methodName=t.name,e.Ee=t.service.ee,e}duplex(t){const e=new it("Duplex streaming is not supported by grpc-web",ht[ht.In]);throw e.methodName=t.name,e.Ee=t.service.ee,e}Vn(t,e,n){var r,i,o,s,a;let c,l,u=n,h=null!==(r=u.format)&&void 0!==r?r:"text",f=null!==(i=u.fetch)&&void 0!==i?i:globalThis.fetch,d=null!==(o=u.Kn)&&void 0!==o?o:{},w=this.Sn(t,u),p=t.On.Ae(e,u.Un),y=new at,g=new ct,b=!0,m=new at,v=new at;return f(w,Object.assign(Object.assign({},d),{method:"POST",headers:gt(new globalThis.Headers,h,u.timeout,u.Be),body:bt(p,h),signal:null!==(s=n.abort)&&void 0!==s?s:null})).then(t=>{let[e,n,r]=mt(t);if(y.resolve(r),null!=e&&e!==ht.OK)throw new it(null!=n?n:ht[e],ht[e],r);return null!=e&&(c={code:ht[e],detail:null!=n?n:ht[e]}),t}).then(e=>{if(!e.body)throw new it("missing response body",ht[ht.kn]);return It(e.body,e.headers.get("content-type"),(e,n)=>{switch(e){case pt.Bn:g.Ye(t.Fn.me(n,u.Un)),b=!1;break;case pt.En:let e,r;[e,r,l]=vt(n),c={code:ht[e],detail:null!=r?r:ht[e]}}})}).then(()=>{if(!l&&!b)throw new it("missing trailers",ht[ht.An]);if(!c)throw new it("missing status",ht[ht.kn]);if("OK"!==c.code)throw new it(c.detail,c.code,l);g.Xe(),m.resolve(c),v.resolve(l||{})}).catch(e=>{let n;n=e instanceof it?e:e instanceof Error&&"AbortError"===e.name?new it(e.message,ht[ht.un]):new it(e instanceof Error?e.message:""+e,ht[ht.kn]),n.methodName=t.name,n.Ee=t.service.ee,y.Ge(n),g.ze(n),m.Ge(n),v.Ge(n)}),new dt(t,null!==(a=u.Be)&&void 0!==a?a:{},e,y.promise,g,m.promise,v.promise)}an(t,e,n){var r,i,o,s,a;let c,l,u,h=n,f=null!==(r=h.format)&&void 0!==r?r:"text",d=null!==(i=h.fetch)&&void 0!==i?i:globalThis.fetch,w=null!==(o=h.Kn)&&void 0!==o?o:{},p=this.Sn(t,h),y=t.On.Ae(e,h.Un),g=new at,b=new at,m=new at,v=new at;return d(p,Object.assign(Object.assign({},w),{method:"POST",headers:gt(new globalThis.Headers,f,h.timeout,h.Be),body:bt(y,f),signal:null!==(s=n.abort)&&void 0!==s?s:null})).then(t=>{let[e,n,r]=mt(t);if(g.resolve(r),null!=e&&e!==ht.OK)throw new it(null!=n?n:ht[e],ht[e],r);return null!=e&&(l={code:ht[e],detail:null!=n?n:ht[e]}),t}).then(e=>{if(!e.body)throw new it("missing response body",ht[ht.kn]);return It(e.body,e.headers.get("content-type"),(e,n)=>{switch(e){case pt.Bn:if(c)throw new it("unary call received 2nd message",ht[ht.An]);c=t.Fn.me(n,h.Un);break;case pt.En:let e,r;[e,r,u]=vt(n),l={code:ht[e],detail:null!=r?r:ht[e]}}})}).then(()=>{if(!u&&c)throw new it("missing trailers",ht[ht.An]);if(!l)throw new it("missing status",ht[ht.kn]);if(!c&&"OK"===l.code)throw new it("expected error status",ht[ht.An]);if(!c)throw new it(l.detail,l.code,u);if(b.resolve(c),"OK"!==l.code)throw new it(l.detail,l.code,u);m.resolve(l),v.resolve(u||{})}).catch(e=>{let n;n=e instanceof it?e:e instanceof Error&&"AbortError"===e.name?new it(e.message,ht[ht.un]):new it(e instanceof Error?e.message:""+e,ht[ht.kn]),n.methodName=t.name,n.Ee=t.service.ee,g.Ge(n),b.Ge(n),m.Ge(n),v.Ge(n)}),new ut(t,null!==(a=h.Be)&&void 0!==a?a:{},e,g.promise,b.promise,m.promise,v.promise)}}new class extends rt{constructor(){super("google.protobuf.DoubleValue",[{p:1,name:"value",kind:"scalar",qt:1}])}ie(t,e){return this.ye.zt(2,t.value,"value",!1,!0)}ne(t,e,n){return n||(n=this.create()),n.value=this.pe.zt(t,1,void 0,"value"),n}create(t){const e=globalThis.Object.create(this.de);return e.value=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.value=t.it();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.value&&e.tag(1,c.T).it(t.value);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};new class extends rt{constructor(){super("google.protobuf.FloatValue",[{p:1,name:"value",kind:"scalar",qt:2}])}ie(t,e){return this.ye.zt(1,t.value,"value",!1,!0)}ne(t,e,n){return n||(n=this.create()),n.value=this.pe.zt(t,1,void 0,"value"),n}create(t){const e=globalThis.Object.create(this.de);return e.value=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.value=t.float();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.value&&e.tag(1,c.P).float(t.value);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};new class extends rt{constructor(){super("google.protobuf.Int64Value",[{p:1,name:"value",kind:"scalar",qt:3}])}ie(t,e){return this.ye.zt(O.Bt,t.value,"value",!1,!0)}ne(t,e,n){return n||(n=this.create()),n.value=this.pe.zt(t,O.Bt,F.xt,"value"),n}create(t){const e=globalThis.Object.create(this.de);return e.value="0",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.value=t.q().toString();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"0"!==t.value&&e.tag(1,c.k).q(t.value);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};new class extends rt{constructor(){super("google.protobuf.UInt64Value",[{p:1,name:"value",kind:"scalar",qt:4}])}ie(t,e){return this.ye.zt(O.Et,t.value,"value",!1,!0)}ne(t,e,n){return n||(n=this.create()),n.value=this.pe.zt(t,O.Et,F.xt,"value"),n}create(t){const e=globalThis.Object.create(this.de);return e.value="0",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.value=t.Y().toString();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"0"!==t.value&&e.tag(1,c.k).Y(t.value);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};new class extends rt{constructor(){super("google.protobuf.Int32Value",[{p:1,name:"value",kind:"scalar",qt:5}])}ie(t,e){return this.ye.zt(5,t.value,"value",!1,!0)}ne(t,e,n){return n||(n=this.create()),n.value=this.pe.zt(t,5,void 0,"value"),n}create(t){const e=globalThis.Object.create(this.de);return e.value=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.value=t.int32();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.value&&e.tag(1,c.k).int32(t.value);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Rt=new class extends rt{constructor(){super("google.protobuf.UInt32Value",[{p:1,name:"value",kind:"scalar",qt:13}])}ie(t,e){return this.ye.zt(13,t.value,"value",!1,!0)}ne(t,e,n){return n||(n=this.create()),n.value=this.pe.zt(t,13,void 0,"value"),n}create(t){const e=globalThis.Object.create(this.de);return e.value=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.value=t.uint32();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.value&&e.tag(1,c.k).uint32(t.value);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};new class extends rt{constructor(){super("google.protobuf.BoolValue",[{p:1,name:"value",kind:"scalar",qt:8}])}ie(t,e){return t.value}ne(t,e,n){return n||(n=this.create()),n.value=this.pe.zt(t,8,void 0,"value"),n}create(t){const e=globalThis.Object.create(this.de);return e.value=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.value=t.J();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){!1!==t.value&&e.tag(1,c.k).J(t.value);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};new class extends rt{constructor(){super("google.protobuf.StringValue",[{p:1,name:"value",kind:"scalar",qt:9}])}ie(t,e){return t.value}ne(t,e,n){return n||(n=this.create()),n.value=this.pe.zt(t,9,void 0,"value"),n}create(t){const e=globalThis.Object.create(this.de);return e.value="",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.value=t.string();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){""!==t.value&&e.tag(1,c.A).string(t.value);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};var Pt,Nt,xt,$t,Ut;new class extends rt{constructor(){super("google.protobuf.BytesValue",[{p:1,name:"value",kind:"scalar",qt:12}])}ie(t,e){return this.ye.zt(12,t.value,"value",!1,!0)}ne(t,e,n){return n||(n=this.create()),n.value=this.pe.zt(t,12,void 0,"value"),n}create(t){const e=globalThis.Object.create(this.de);return e.value=new Uint8Array(0),void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.value=t.bytes();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.value.length&&e.tag(1,c.A).bytes(t.value);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}},function(t){t[t.Wn=0]="CURRENT_KEY_OF_KIND_REQUEST",t[t.Dn=1]="ALL_KEYS_OF_KIND_REQUEST"}(Pt||(Pt={})),function(t){t[t._n=0]="DOCUMENTS",t[t.Hn=1]="VOTE_TALLY",t[t.jn=2]="DOCUMENTS_AND_VOTE_TALLY"}(Nt||(Nt={})),function(t){t[t.Mn=0]="TOWARDS_IDENTITY",t[t.Ln=1]="LOCKED",t[t.Zn=2]="NO_PREVIOUS_WINNER"}(xt||(xt={})),function(t){t[t.qn=0]="AUTHENTICATION",t[t.Yn=1]="ENCRYPTION",t[t.zn=2]="DECRYPTION",t[t.Xn=3]="TRANSFER",t[t.Jn=5]="VOTING"}($t||($t={})),function(t){t[t.hn=0]="UNKNOWN",t[t.Qn=1]="PREVOTE",t[t.tr=2]="PRECOMMIT",t[t.er=32]="PROPOSAL"}(Ut||(Ut={}));const St=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.Proof",[{p:1,name:"grovedb_proof",kind:"scalar",qt:12},{p:2,name:"quorum_hash",kind:"scalar",qt:12},{p:3,name:"signature",kind:"scalar",qt:12},{p:4,name:"round",kind:"scalar",qt:13},{p:5,name:"block_id_hash",kind:"scalar",qt:12},{p:6,name:"quorum_type",kind:"scalar",qt:13}])}create(t){const e=globalThis.Object.create(this.de);return e.nr=new Uint8Array(0),e.rr=new Uint8Array(0),e.signature=new Uint8Array(0),e.round=0,e.ir=new Uint8Array(0),e.sr=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.nr=t.bytes();break;case 2:i.rr=t.bytes();break;case 3:i.signature=t.bytes();break;case 4:i.round=t.uint32();break;case 5:i.ir=t.bytes();break;case 6:i.sr=t.uint32();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.nr.length&&e.tag(1,c.A).bytes(t.nr),t.rr.length&&e.tag(2,c.A).bytes(t.rr),t.signature.length&&e.tag(3,c.A).bytes(t.signature),0!==t.round&&e.tag(4,c.k).uint32(t.round),t.ir.length&&e.tag(5,c.A).bytes(t.ir),0!==t.sr&&e.tag(6,c.k).uint32(t.sr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ct=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.ResponseMetadata",[{p:1,name:"height",kind:"scalar",qt:4},{p:2,name:"core_chain_locked_height",kind:"scalar",qt:13},{p:3,name:"epoch",kind:"scalar",qt:13},{p:4,name:"time_ms",kind:"scalar",qt:4},{p:5,name:"protocol_version",kind:"scalar",qt:13},{p:6,name:"chain_id",kind:"scalar",qt:9}])}create(t){const e=globalThis.Object.create(this.de);return e.height="0",e.ar=0,e.cr=0,e.lr="0",e.ur=0,e.hr="",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.height=t.Y().toString();break;case 2:i.ar=t.uint32();break;case 3:i.cr=t.uint32();break;case 4:i.lr=t.Y().toString();break;case 5:i.ur=t.uint32();break;case 6:i.hr=t.string();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"0"!==t.height&&e.tag(1,c.k).Y(t.height),0!==t.ar&&e.tag(2,c.k).uint32(t.ar),0!==t.cr&&e.tag(3,c.k).uint32(t.cr),"0"!==t.lr&&e.tag(4,c.k).Y(t.lr),0!==t.ur&&e.tag(5,c.k).uint32(t.ur),""!==t.hr&&e.tag(6,c.A).string(t.hr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Gt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.StateTransitionBroadcastError",[{p:1,name:"code",kind:"scalar",qt:13},{p:2,name:"message",kind:"scalar",qt:9},{p:3,name:"data",kind:"scalar",qt:12}])}create(t){const e=globalThis.Object.create(this.de);return e.code=0,e.message="",e.data=new Uint8Array(0),void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.code=t.uint32();break;case 2:i.message=t.string();break;case 3:i.data=t.bytes();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.code&&e.tag(1,c.k).uint32(t.code),""!==t.message&&e.tag(2,c.A).string(t.message),t.data.length&&e.tag(3,c.A).bytes(t.data);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Vt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.BroadcastStateTransitionRequest",[{p:1,name:"state_transition",kind:"scalar",qt:12}])}create(t){const e=globalThis.Object.create(this.de);return e.dr=new Uint8Array(0),void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.dr=t.bytes();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.dr.length&&e.tag(1,c.A).bytes(t.dr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Kt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.BroadcastStateTransitionResponse",[])}create(t){const e=globalThis.Object.create(this.de);return void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ot=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Ft}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Ft.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Ft.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ft=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0",[{p:1,name:"id",kind:"scalar",qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.id=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.id=t.bytes();break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.id.length&&e.tag(1,c.A).bytes(t.id),!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Wt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityNonceRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Dt}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Dt.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Dt.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Dt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0",[{p:1,name:"identity_id",kind:"scalar",qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.yr=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.yr=t.bytes();break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.yr.length&&e.tag(1,c.A).bytes(t.yr),!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const _t=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityContractNonceRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Ht}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Ht.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Ht.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ht=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0",[{p:1,name:"identity_id",kind:"scalar",qt:12},{p:2,name:"contract_id",kind:"scalar",qt:12},{p:3,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.yr=new Uint8Array(0),e.gr=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.yr=t.bytes();break;case 2:i.gr=t.bytes();break;case 3:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.yr.length&&e.tag(1,c.A).bytes(t.yr),t.gr.length&&e.tag(2,c.A).bytes(t.gr),!1!==t.pr&&e.tag(3,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const jt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityBalanceRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Mt}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Mt.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Mt.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Mt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0",[{p:1,name:"id",kind:"scalar",qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.id=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.id=t.bytes();break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.id.length&&e.tag(1,c.A).bytes(t.id),!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Lt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Zt}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Zt.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Zt.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Zt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0",[{p:1,name:"id",kind:"scalar",qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.id=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.id=t.bytes();break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.id.length&&e.tag(1,c.A).bytes(t.id),!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const qt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Yt}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Yt.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Yt.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Yt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0",[{p:1,name:"identity",kind:"scalar",kt:"result",qt:12},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"identity",identity:t.bytes()};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"identity"===t.result.Tt&&e.tag(1,c.A).bytes(t.result.identity),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const zt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityNonceResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Xt}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Xt.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Xt.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Xt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0",[{p:1,name:"identity_nonce",kind:"scalar",kt:"result",qt:4},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"identityNonce",mr:t.Y().toString()};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"identityNonce"===t.result.Tt&&e.tag(1,c.k).Y(t.result.mr),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Jt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityContractNonceResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Qt}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Qt.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Qt.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Qt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0",[{p:1,name:"identity_contract_nonce",kind:"scalar",kt:"result",qt:4},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"identityContractNonce",vr:t.Y().toString()};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"identityContractNonce"===t.result.Tt&&e.tag(1,c.k).Y(t.result.vr),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const te=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityBalanceResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>ee}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:ee.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&ee.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ee=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0",[{p:1,name:"balance",kind:"scalar",kt:"result",qt:4},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"balance",balance:t.Y().toString()};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"balance"===t.result.Tt&&e.tag(1,c.k).Y(t.result.balance),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ne=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>re}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:re.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&re.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const re=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0",[{p:1,name:"balance_and_revision",kind:"message",kt:"result",qt:()=>ie},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"balanceAndRevision",Ir:ie.se(t,t.uint32(),n,i.result.Ir)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"balanceAndRevision"===t.result.Tt&&ie.le(t.result.Ir,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ie=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision",[{p:1,name:"balance",kind:"scalar",qt:4},{p:2,name:"revision",kind:"scalar",qt:4}])}create(t){const e=globalThis.Object.create(this.de);return e.balance="0",e.kr="0",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.balance=t.Y().toString();break;case 2:i.kr=t.Y().toString();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"0"!==t.balance&&e.tag(1,c.k).Y(t.balance),"0"!==t.kr&&e.tag(2,c.k).Y(t.kr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const oe=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.KeyRequestType",[{p:1,name:"all_keys",kind:"message",kt:"request",qt:()=>se},{p:2,name:"specific_keys",kind:"message",kt:"request",qt:()=>ae},{p:3,name:"search_key",kind:"message",kt:"request",qt:()=>ce}])}create(t){const e=globalThis.Object.create(this.de);return e.request={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.request={Tt:"allKeys",Tr:se.se(t,t.uint32(),n,i.request.Tr)};break;case 2:i.request={Tt:"specificKeys",Ar:ae.se(t,t.uint32(),n,i.request.Ar)};break;case 3:i.request={Tt:"searchKey",Br:ce.se(t,t.uint32(),n,i.request.Br)};break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"allKeys"===t.request.Tt&&se.le(t.request.Tr,e.tag(1,c.A).ut(),n).join(),"specificKeys"===t.request.Tt&&ae.le(t.request.Ar,e.tag(2,c.A).ut(),n).join(),"searchKey"===t.request.Tt&&ce.le(t.request.Br,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const se=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.AllKeys",[])}create(t){const e=globalThis.Object.create(this.de);return void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ae=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.SpecificKeys",[{p:1,name:"key_ids",kind:"scalar",repeat:1,qt:13}])}create(t){const e=globalThis.Object.create(this.de);return e.Er=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)if(r===c.A)for(let e=t.int32()+t.o;t.o<e;)i.Er.push(t.uint32());else i.Er.push(t.uint32());else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){if(t.Er.length){e.tag(1,c.A).ut();for(let n=0;n<t.Er.length;n++)e.uint32(t.Er[n]);e.join()}let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ce=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.SearchKey",[{p:1,name:"purpose_map",kind:"map",Jt:13,S:{kind:"message",qt:()=>le}}])}create(t){const e=globalThis.Object.create(this.de);return e.Rr={},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)this.Pr(i.Rr,t,n);else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}Pr(t,e,n){let r,i,o=e.uint32(),s=e.o+o;for(;e.o<s;){let[t,o]=e.tag();switch(t){case 1:r=e.uint32();break;case 2:i=le.se(e,e.uint32(),n);break;default:throw new globalThis.Error("unknown map entry field for org.dash.platform.dapi.v0.SearchKey.purpose_map")}}t[r??0]=i??le.create()}le(t,e,n){for(let r of globalThis.Object.keys(t.Rr))e.tag(1,c.A).ut().tag(1,c.k).uint32(parseInt(r)),e.tag(2,c.A).ut(),le.le(t.Rr[r],e,n),e.join().join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const le=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.SecurityLevelMap",[{p:1,name:"security_level_map",kind:"map",Jt:13,S:{kind:"enum",qt:()=>["org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType",Pt]}}])}create(t){const e=globalThis.Object.create(this.de);return e.Nr={},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)this.Pr(i.Nr,t,n);else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}Pr(t,e,n){let r,i,o=e.uint32(),s=e.o+o;for(;e.o<s;){let[t,n]=e.tag();switch(t){case 1:r=e.uint32();break;case 2:i=e.int32();break;default:throw new globalThis.Error("unknown map entry field for org.dash.platform.dapi.v0.SecurityLevelMap.security_level_map")}}t[r??0]=i??0}le(t,e,n){for(let n of globalThis.Object.keys(t.Nr))e.tag(1,c.A).ut().tag(1,c.k).uint32(parseInt(n)).tag(2,c.k).int32(t.Nr[n]).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ue=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityKeysRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>he}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:he.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&he.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const he=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0",[{p:1,name:"identity_id",kind:"scalar",qt:12},{p:2,name:"request_type",kind:"message",qt:()=>oe},{p:3,name:"limit",kind:"message",qt:()=>Rt},{p:4,name:"offset",kind:"message",qt:()=>Rt},{p:5,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.yr=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.yr=t.bytes();break;case 2:i.$r=oe.se(t,t.uint32(),n,i.$r);break;case 3:i.Ur=Rt.se(t,t.uint32(),n,i.Ur);break;case 4:i.offset=Rt.se(t,t.uint32(),n,i.offset);break;case 5:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.yr.length&&e.tag(1,c.A).bytes(t.yr),t.$r&&oe.le(t.$r,e.tag(2,c.A).ut(),n).join(),t.Ur&&Rt.le(t.Ur,e.tag(3,c.A).ut(),n).join(),t.offset&&Rt.le(t.offset,e.tag(4,c.A).ut(),n).join(),!1!==t.pr&&e.tag(5,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const fe=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityKeysResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>de}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:de.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&de.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const de=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0",[{p:1,name:"keys",kind:"message",kt:"result",qt:()=>we},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"keys",keys:we.se(t,t.uint32(),n,i.result.keys)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"keys"===t.result.Tt&&we.le(t.result.keys,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const we=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys",[{p:1,name:"keys_bytes",kind:"scalar",repeat:2,qt:12}])}create(t){const e=globalThis.Object.create(this.de);return e.Sr=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.Sr.push(t.bytes());else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let n=0;n<t.Sr.length;n++)e.tag(1,c.A).bytes(t.Sr[n]);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const pe=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>ye}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:ye.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&ye.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ye=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0",[{p:1,name:"identities_ids",kind:"scalar",repeat:2,qt:12},{p:2,name:"contract_id",kind:"scalar",qt:12},{p:3,name:"document_type_name",kind:"scalar",It:!0,qt:9},{p:4,name:"purposes",kind:"enum",repeat:1,qt:()=>["org.dash.platform.dapi.v0.KeyPurpose",$t]},{p:5,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.Cr=[],e.gr=new Uint8Array(0),e.Gr=[],e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Cr.push(t.bytes());break;case 2:i.gr=t.bytes();break;case 3:i.Vr=t.string();break;case 4:if(r===c.A)for(let e=t.int32()+t.o;t.o<e;)i.Gr.push(t.int32());else i.Gr.push(t.int32());break;case 5:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let n=0;n<t.Cr.length;n++)e.tag(1,c.A).bytes(t.Cr[n]);if(t.gr.length&&e.tag(2,c.A).bytes(t.gr),void 0!==t.Vr&&e.tag(3,c.A).string(t.Vr),t.Gr.length){e.tag(4,c.A).ut();for(let n=0;n<t.Gr.length;n++)e.int32(t.Gr[n]);e.join()}!1!==t.pr&&e.tag(5,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ge=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>be}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:be.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&be.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const be=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0",[{p:1,name:"identities_keys",kind:"message",kt:"result",qt:()=>Ie},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"identitiesKeys",Kr:Ie.se(t,t.uint32(),n,i.result.Kr)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"identitiesKeys"===t.result.Tt&&Ie.le(t.result.Kr,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const me=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys",[{p:1,name:"purpose",kind:"enum",qt:()=>["org.dash.platform.dapi.v0.KeyPurpose",$t]},{p:2,name:"keys_bytes",kind:"scalar",repeat:2,qt:12}])}create(t){const e=globalThis.Object.create(this.de);return e.Or=0,e.Sr=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Or=t.int32();break;case 2:i.Sr.push(t.bytes());break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.Or&&e.tag(1,c.k).int32(t.Or);for(let n=0;n<t.Sr.length;n++)e.tag(2,c.A).bytes(t.Sr[n]);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ve=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys",[{p:1,name:"identity_id",kind:"scalar",qt:12},{p:2,name:"keys",kind:"message",repeat:2,qt:()=>me}])}create(t){const e=globalThis.Object.create(this.de);return e.yr=new Uint8Array(0),e.keys=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.yr=t.bytes();break;case 2:i.keys.push(me.se(t,t.uint32(),n));break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.yr.length&&e.tag(1,c.A).bytes(t.yr);for(let r=0;r<t.keys.length;r++)me.le(t.keys[r],e.tag(2,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ie=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys",[{p:1,name:"entries",kind:"message",repeat:2,qt:()=>ve}])}create(t){const e=globalThis.Object.create(this.de);return e.entries=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.entries.push(ve.se(t,t.uint32(),n));else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let r=0;r<t.entries.length;r++)ve.le(t.entries[r],e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ke=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Te}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Te.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Te.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Te=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0",[{p:1,name:"ids",kind:"scalar",repeat:2,qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.Fr=[],e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Fr.push(t.bytes());break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let n=0;n<t.Fr.length;n++)e.tag(1,c.A).bytes(t.Fr[n]);!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ae=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Be}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Be.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Be.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Be=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0",[{p:1,name:"identities_balances",kind:"message",kt:"result",qt:()=>Re},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"identitiesBalances",Wr:Re.se(t,t.uint32(),n,i.result.Wr)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"identitiesBalances"===t.result.Tt&&Re.le(t.result.Wr,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ee=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance",[{p:1,name:"identity_id",kind:"scalar",qt:12},{p:2,name:"balance",kind:"scalar",It:!0,qt:4}])}create(t){const e=globalThis.Object.create(this.de);return e.yr=new Uint8Array(0),void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.yr=t.bytes();break;case 2:i.balance=t.Y().toString();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.yr.length&&e.tag(1,c.A).bytes(t.yr),void 0!==t.balance&&e.tag(2,c.k).Y(t.balance);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Re=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances",[{p:1,name:"entries",kind:"message",repeat:2,qt:()=>Ee}])}create(t){const e=globalThis.Object.create(this.de);return e.entries=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.entries.push(Ee.se(t,t.uint32(),n));else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let r=0;r<t.entries.length;r++)Ee.le(t.entries[r],e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Pe=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetDataContractRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Ne}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Ne.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Ne.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ne=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0",[{p:1,name:"id",kind:"scalar",qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.id=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.id=t.bytes();break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.id.length&&e.tag(1,c.A).bytes(t.id),!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const xe=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetDataContractResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>$e}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:$e.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&$e.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const $e=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0",[{p:1,name:"data_contract",kind:"scalar",kt:"result",qt:12},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"dataContract",Dr:t.bytes()};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"dataContract"===t.result.Tt&&e.tag(1,c.A).bytes(t.result.Dr),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ue=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetDocumentsRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Se}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Se.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Se.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Se=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0",[{p:1,name:"data_contract_id",kind:"scalar",qt:12},{p:2,name:"document_type",kind:"scalar",qt:9},{p:3,name:"where",kind:"scalar",qt:12},{p:4,name:"order_by",kind:"scalar",qt:12},{p:5,name:"limit",kind:"scalar",qt:13},{p:6,name:"start_after",kind:"scalar",kt:"start",qt:12},{p:7,name:"start_at",kind:"scalar",kt:"start",qt:12},{p:8,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e._r=new Uint8Array(0),e.Hr="",e.jr=new Uint8Array(0),e.Mr=new Uint8Array(0),e.Ur=0,e.start={Tt:void 0},e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i._r=t.bytes();break;case 2:i.Hr=t.string();break;case 3:i.jr=t.bytes();break;case 4:i.Mr=t.bytes();break;case 5:i.Ur=t.uint32();break;case 6:i.start={Tt:"startAfter",Lr:t.bytes()};break;case 7:i.start={Tt:"startAt",Zr:t.bytes()};break;case 8:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t._r.length&&e.tag(1,c.A).bytes(t._r),""!==t.Hr&&e.tag(2,c.A).string(t.Hr),t.jr.length&&e.tag(3,c.A).bytes(t.jr),t.Mr.length&&e.tag(4,c.A).bytes(t.Mr),0!==t.Ur&&e.tag(5,c.k).uint32(t.Ur),"startAfter"===t.start.Tt&&e.tag(6,c.A).bytes(t.start.Lr),"startAt"===t.start.Tt&&e.tag(7,c.A).bytes(t.start.Zr),!1!==t.pr&&e.tag(8,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ce=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetDocumentsResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Ge}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Ge.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Ge.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ge=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0",[{p:1,name:"documents",kind:"message",kt:"result",qt:()=>Ve},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"documents",qr:Ve.se(t,t.uint32(),n,i.result.qr)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"documents"===t.result.Tt&&Ve.le(t.result.qr,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ve=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents",[{p:1,name:"documents",kind:"scalar",repeat:2,qt:12}])}create(t){const e=globalThis.Object.create(this.de);return e.qr=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.qr.push(t.bytes());else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let n=0;n<t.qr.length;n++)e.tag(1,c.A).bytes(t.qr[n]);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ke=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Oe}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Oe.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Oe.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Oe=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0",[{p:1,name:"public_key_hash",kind:"scalar",qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.Yr=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Yr=t.bytes();break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.Yr.length&&e.tag(1,c.A).bytes(t.Yr),!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Fe=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>We}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:We.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&We.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const We=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0",[{p:1,name:"identity",kind:"scalar",kt:"result",qt:12},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"identity",identity:t.bytes()};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"identity"===t.result.Tt&&e.tag(1,c.A).bytes(t.result.identity),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const De=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>_e}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:_e.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&_e.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const _e=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashRequest.GetIdentityByNonUniquePublicKeyHashRequestV0",[{p:1,name:"public_key_hash",kind:"scalar",qt:12},{p:2,name:"start_after",kind:"scalar",It:!0,qt:12},{p:3,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.Yr=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Yr=t.bytes();break;case 2:i.Lr=t.bytes();break;case 3:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.Yr.length&&e.tag(1,c.A).bytes(t.Yr),void 0!==t.Lr&&e.tag(2,c.A).bytes(t.Lr),!1!==t.pr&&e.tag(3,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const He=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>je}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:je.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&je.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const je=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0",[{p:1,name:"identity",kind:"message",kt:"result",qt:()=>Me},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>Le},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"identity",identity:Me.se(t,t.uint32(),n,i.result.identity)};break;case 2:i.result={Tt:"proof",br:Le.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"identity"===t.result.Tt&&Me.le(t.result.identity,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&Le.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Me=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityResponse",[{p:1,name:"identity",kind:"scalar",It:!0,qt:12}])}create(t){const e=globalThis.Object.create(this.de);return void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.identity=t.bytes();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){void 0!==t.identity&&e.tag(1,c.A).bytes(t.identity);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Le=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse",[{p:1,name:"grovedb_identity_public_key_hash_proof",kind:"message",qt:()=>St},{p:2,name:"identity_proof_bytes",kind:"scalar",It:!0,qt:12}])}create(t){const e=globalThis.Object.create(this.de);return void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.zr=St.se(t,t.uint32(),n,i.zr);break;case 2:i.Xr=t.bytes();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.zr&&St.le(t.zr,e.tag(1,c.A).ut(),n).join(),void 0!==t.Xr&&e.tag(2,c.A).bytes(t.Xr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ze=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetEpochsInfoRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>qe}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:qe.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&qe.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const qe=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0",[{p:1,name:"start_epoch",kind:"message",qt:()=>Rt},{p:2,name:"count",kind:"scalar",qt:13},{p:3,name:"ascending",kind:"scalar",qt:8},{p:4,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.count=0,e.Jr=!1,e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Qr=Rt.se(t,t.uint32(),n,i.Qr);break;case 2:i.count=t.uint32();break;case 3:i.Jr=t.J();break;case 4:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.Qr&&Rt.le(t.Qr,e.tag(1,c.A).ut(),n).join(),0!==t.count&&e.tag(2,c.k).uint32(t.count),!1!==t.Jr&&e.tag(3,c.k).J(t.Jr),!1!==t.pr&&e.tag(4,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ye=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetEpochsInfoResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>ze}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:ze.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&ze.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ze=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0",[{p:1,name:"epochs",kind:"message",kt:"result",qt:()=>Xe},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"epochs",ti:Xe.se(t,t.uint32(),n,i.result.ti)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"epochs"===t.result.Tt&&Xe.le(t.result.ti,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Xe=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos",[{p:1,name:"epoch_infos",kind:"message",repeat:2,qt:()=>Je}])}create(t){const e=globalThis.Object.create(this.de);return e.ei=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.ei.push(Je.se(t,t.uint32(),n));else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let r=0;r<t.ei.length;r++)Je.le(t.ei[r],e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Je=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo",[{p:1,name:"number",kind:"scalar",qt:13},{p:2,name:"first_block_height",kind:"scalar",qt:4},{p:3,name:"first_core_block_height",kind:"scalar",qt:13},{p:4,name:"start_time",kind:"scalar",qt:4},{p:5,name:"fee_multiplier",kind:"scalar",qt:1},{p:6,name:"protocol_version",kind:"scalar",qt:13}])}create(t){const e=globalThis.Object.create(this.de);return e.number=0,e.ni="0",e.ri=0,e.startTime="0",e.ii=0,e.ur=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.number=t.uint32();break;case 2:i.ni=t.Y().toString();break;case 3:i.ri=t.uint32();break;case 4:i.startTime=t.Y().toString();break;case 5:i.ii=t.it();break;case 6:i.ur=t.uint32();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.number&&e.tag(1,c.k).uint32(t.number),"0"!==t.ni&&e.tag(2,c.k).Y(t.ni),0!==t.ri&&e.tag(3,c.k).uint32(t.ri),"0"!==t.startTime&&e.tag(4,c.k).Y(t.startTime),0!==t.ii&&e.tag(5,c.T).it(t.ii),0!==t.ur&&e.tag(6,c.k).uint32(t.ur);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Qe=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourcesRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>tn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:tn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&tn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const tn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0",[{p:1,name:"contract_id",kind:"scalar",qt:12},{p:2,name:"document_type_name",kind:"scalar",qt:9},{p:3,name:"index_name",kind:"scalar",qt:9},{p:4,name:"start_index_values",kind:"scalar",repeat:2,qt:12},{p:5,name:"end_index_values",kind:"scalar",repeat:2,qt:12},{p:6,name:"start_at_value_info",kind:"message",qt:()=>en},{p:7,name:"count",kind:"scalar",It:!0,qt:13},{p:8,name:"order_ascending",kind:"scalar",qt:8},{p:9,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.gr=new Uint8Array(0),e.Vr="",e.oi="",e.si=[],e.ai=[],e.ci=!1,e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.gr=t.bytes();break;case 2:i.Vr=t.string();break;case 3:i.oi=t.string();break;case 4:i.si.push(t.bytes());break;case 5:i.ai.push(t.bytes());break;case 6:i.li=en.se(t,t.uint32(),n,i.li);break;case 7:i.count=t.uint32();break;case 8:i.ci=t.J();break;case 9:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.gr.length&&e.tag(1,c.A).bytes(t.gr),""!==t.Vr&&e.tag(2,c.A).string(t.Vr),""!==t.oi&&e.tag(3,c.A).string(t.oi);for(let n=0;n<t.si.length;n++)e.tag(4,c.A).bytes(t.si[n]);for(let n=0;n<t.ai.length;n++)e.tag(5,c.A).bytes(t.ai[n]);t.li&&en.le(t.li,e.tag(6,c.A).ut(),n).join(),void 0!==t.count&&e.tag(7,c.k).uint32(t.count),!1!==t.ci&&e.tag(8,c.k).J(t.ci),!1!==t.pr&&e.tag(9,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const en=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo",[{p:1,name:"start_value",kind:"scalar",qt:12},{p:2,name:"start_value_included",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.ui=new Uint8Array(0),e.hi=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.ui=t.bytes();break;case 2:i.hi=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.ui.length&&e.tag(1,c.A).bytes(t.ui),!1!==t.hi&&e.tag(2,c.k).J(t.hi);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const nn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourcesResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>rn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:rn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&rn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const rn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0",[{p:1,name:"contested_resource_values",kind:"message",kt:"result",qt:()=>on},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"contestedResourceValues",fi:on.se(t,t.uint32(),n,i.result.fi)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"contestedResourceValues"===t.result.Tt&&on.le(t.result.fi,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const on=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues",[{p:1,name:"contested_resource_values",kind:"scalar",repeat:2,qt:12}])}create(t){const e=globalThis.Object.create(this.de);return e.fi=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.fi.push(t.bytes());else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let n=0;n<t.fi.length;n++)e.tag(1,c.A).bytes(t.fi[n]);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const sn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>an}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:an.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&an.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const an=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0",[{p:1,name:"contract_id",kind:"scalar",qt:12},{p:2,name:"document_type_name",kind:"scalar",qt:9},{p:3,name:"index_name",kind:"scalar",qt:9},{p:4,name:"index_values",kind:"scalar",repeat:2,qt:12},{p:5,name:"result_type",kind:"enum",qt:()=>["org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType",Nt]},{p:6,name:"allow_include_locked_and_abstaining_vote_tally",kind:"scalar",qt:8},{p:7,name:"start_at_identifier_info",kind:"message",qt:()=>cn},{p:8,name:"count",kind:"scalar",It:!0,qt:13},{p:9,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.gr=new Uint8Array(0),e.Vr="",e.oi="",e.di=[],e.resultType=0,e.wi=!1,e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.gr=t.bytes();break;case 2:i.Vr=t.string();break;case 3:i.oi=t.string();break;case 4:i.di.push(t.bytes());break;case 5:i.resultType=t.int32();break;case 6:i.wi=t.J();break;case 7:i.pi=cn.se(t,t.uint32(),n,i.pi);break;case 8:i.count=t.uint32();break;case 9:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.gr.length&&e.tag(1,c.A).bytes(t.gr),""!==t.Vr&&e.tag(2,c.A).string(t.Vr),""!==t.oi&&e.tag(3,c.A).string(t.oi);for(let n=0;n<t.di.length;n++)e.tag(4,c.A).bytes(t.di[n]);0!==t.resultType&&e.tag(5,c.k).int32(t.resultType),!1!==t.wi&&e.tag(6,c.k).J(t.wi),t.pi&&cn.le(t.pi,e.tag(7,c.A).ut(),n).join(),void 0!==t.count&&e.tag(8,c.k).uint32(t.count),!1!==t.pr&&e.tag(9,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const cn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo",[{p:1,name:"start_identifier",kind:"scalar",qt:12},{p:2,name:"start_identifier_included",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.yi=new Uint8Array(0),e.gi=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.yi=t.bytes();break;case 2:i.gi=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.yi.length&&e.tag(1,c.A).bytes(t.yi),!1!==t.gi&&e.tag(2,c.k).J(t.gi);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ln=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>un}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:un.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&un.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const un=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0",[{p:1,name:"contested_resource_contenders",kind:"message",kt:"result",qt:()=>fn},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"contestedResourceContenders",bi:fn.se(t,t.uint32(),n,i.result.bi)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"contestedResourceContenders"===t.result.Tt&&fn.le(t.result.bi,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const hn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo",[{p:1,name:"finished_vote_outcome",kind:"enum",qt:()=>["org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome",xt]},{p:2,name:"won_by_identity_id",kind:"scalar",It:!0,qt:12},{p:3,name:"finished_at_block_height",kind:"scalar",qt:4},{p:4,name:"finished_at_core_block_height",kind:"scalar",qt:13},{p:5,name:"finished_at_block_time_ms",kind:"scalar",qt:4},{p:6,name:"finished_at_epoch",kind:"scalar",qt:13}])}create(t){const e=globalThis.Object.create(this.de);return e.mi=0,e.Ii="0",e.ki=0,e.Ti="0",e.Ai=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.mi=t.int32();break;case 2:i.Bi=t.bytes();break;case 3:i.Ii=t.Y().toString();break;case 4:i.ki=t.uint32();break;case 5:i.Ti=t.Y().toString();break;case 6:i.Ai=t.uint32();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.mi&&e.tag(1,c.k).int32(t.mi),void 0!==t.Bi&&e.tag(2,c.A).bytes(t.Bi),"0"!==t.Ii&&e.tag(3,c.k).Y(t.Ii),0!==t.ki&&e.tag(4,c.k).uint32(t.ki),"0"!==t.Ti&&e.tag(5,c.k).Y(t.Ti),0!==t.Ai&&e.tag(6,c.k).uint32(t.Ai);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const fn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders",[{p:1,name:"contenders",kind:"message",repeat:2,qt:()=>dn},{p:2,name:"abstain_vote_tally",kind:"scalar",It:!0,qt:13},{p:3,name:"lock_vote_tally",kind:"scalar",It:!0,qt:13},{p:4,name:"finished_vote_info",kind:"message",qt:()=>hn}])}create(t){const e=globalThis.Object.create(this.de);return e.Ei=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Ei.push(dn.se(t,t.uint32(),n));break;case 2:i.Ri=t.uint32();break;case 3:i.Pi=t.uint32();break;case 4:i.Ni=hn.se(t,t.uint32(),n,i.Ni);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let r=0;r<t.Ei.length;r++)dn.le(t.Ei[r],e.tag(1,c.A).ut(),n).join();void 0!==t.Ri&&e.tag(2,c.k).uint32(t.Ri),void 0!==t.Pi&&e.tag(3,c.k).uint32(t.Pi),t.Ni&&hn.le(t.Ni,e.tag(4,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const dn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender",[{p:1,name:"identifier",kind:"scalar",qt:12},{p:2,name:"vote_count",kind:"scalar",It:!0,qt:13},{p:3,name:"document",kind:"scalar",It:!0,qt:12}])}create(t){const e=globalThis.Object.create(this.de);return e.identifier=new Uint8Array(0),void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.identifier=t.bytes();break;case 2:i.xi=t.uint32();break;case 3:i.document=t.bytes();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.identifier.length&&e.tag(1,c.A).bytes(t.identifier),void 0!==t.xi&&e.tag(2,c.k).uint32(t.xi),void 0!==t.document&&e.tag(3,c.A).bytes(t.document);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const wn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>pn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:pn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&pn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const pn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0",[{p:1,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.pr=t.J();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){!1!==t.pr&&e.tag(1,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const yn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>gn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:gn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&gn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const gn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0",[{p:1,name:"credits",kind:"scalar",kt:"result",qt:4},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"credits",$i:t.Y().toString()};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"credits"===t.result.Tt&&e.tag(1,c.k).Y(t.result.$i),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const bn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>mn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:mn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&mn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const mn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0",[])}create(t){const e=globalThis.Object.create(this.de);return void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const vn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>In}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:In.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&In.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const In=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0",[{p:1,name:"version",kind:"message",qt:()=>kn},{p:2,name:"node",kind:"message",qt:()=>Pn},{p:3,name:"chain",kind:"message",qt:()=>Nn},{p:4,name:"network",kind:"message",qt:()=>xn},{p:5,name:"state_sync",kind:"message",qt:()=>$n},{p:6,name:"time",kind:"message",qt:()=>Rn}])}create(t){const e=globalThis.Object.create(this.de);return void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.version=kn.se(t,t.uint32(),n,i.version);break;case 2:i.node=Pn.se(t,t.uint32(),n,i.node);break;case 3:i.chain=Nn.se(t,t.uint32(),n,i.chain);break;case 4:i.Ui=xn.se(t,t.uint32(),n,i.Ui);break;case 5:i.Si=$n.se(t,t.uint32(),n,i.Si);break;case 6:i.time=Rn.se(t,t.uint32(),n,i.time);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.version&&kn.le(t.version,e.tag(1,c.A).ut(),n).join(),t.node&&Pn.le(t.node,e.tag(2,c.A).ut(),n).join(),t.chain&&Nn.le(t.chain,e.tag(3,c.A).ut(),n).join(),t.Ui&&xn.le(t.Ui,e.tag(4,c.A).ut(),n).join(),t.Si&&$n.le(t.Si,e.tag(5,c.A).ut(),n).join(),t.time&&Rn.le(t.time,e.tag(6,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const kn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version",[{p:1,name:"software",kind:"message",qt:()=>Tn},{p:2,name:"protocol",kind:"message",qt:()=>An}])}create(t){const e=globalThis.Object.create(this.de);return void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Ci=Tn.se(t,t.uint32(),n,i.Ci);break;case 2:i.protocol=An.se(t,t.uint32(),n,i.protocol);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.Ci&&Tn.le(t.Ci,e.tag(1,c.A).ut(),n).join(),t.protocol&&An.le(t.protocol,e.tag(2,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Tn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software",[{p:1,name:"dapi",kind:"scalar",qt:9},{p:2,name:"drive",kind:"scalar",It:!0,qt:9},{p:3,name:"tenderdash",kind:"scalar",It:!0,qt:9}])}create(t){const e=globalThis.Object.create(this.de);return e.Gi="",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Gi=t.string();break;case 2:i.Vi=t.string();break;case 3:i.Ki=t.string();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){""!==t.Gi&&e.tag(1,c.A).string(t.Gi),void 0!==t.Vi&&e.tag(2,c.A).string(t.Vi),void 0!==t.Ki&&e.tag(3,c.A).string(t.Ki);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const An=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol",[{p:1,name:"tenderdash",kind:"message",qt:()=>Bn},{p:2,name:"drive",kind:"message",qt:()=>En}])}create(t){const e=globalThis.Object.create(this.de);return void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Ki=Bn.se(t,t.uint32(),n,i.Ki);break;case 2:i.Vi=En.se(t,t.uint32(),n,i.Vi);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.Ki&&Bn.le(t.Ki,e.tag(1,c.A).ut(),n).join(),t.Vi&&En.le(t.Vi,e.tag(2,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Bn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash",[{p:1,name:"p2p",kind:"scalar",bt:"p2p",qt:13},{p:2,name:"block",kind:"scalar",qt:13}])}create(t){const e=globalThis.Object.create(this.de);return e.Oi=0,e.Fi=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Oi=t.uint32();break;case 2:i.Fi=t.uint32();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.Oi&&e.tag(1,c.k).uint32(t.Oi),0!==t.Fi&&e.tag(2,c.k).uint32(t.Fi);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const En=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive",[{p:3,name:"latest",kind:"scalar",qt:13},{p:4,name:"current",kind:"scalar",qt:13}])}create(t){const e=globalThis.Object.create(this.de);return e.Wi=0,e.Di=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 3:i.Wi=t.uint32();break;case 4:i.Di=t.uint32();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.Wi&&e.tag(3,c.k).uint32(t.Wi),0!==t.Di&&e.tag(4,c.k).uint32(t.Di);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Rn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time",[{p:1,name:"local",kind:"scalar",qt:4},{p:2,name:"block",kind:"scalar",It:!0,qt:4},{p:3,name:"genesis",kind:"scalar",It:!0,qt:4},{p:4,name:"epoch",kind:"scalar",It:!0,qt:13}])}create(t){const e=globalThis.Object.create(this.de);return e._i="0",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i._i=t.Y().toString();break;case 2:i.Fi=t.Y().toString();break;case 3:i.Hi=t.Y().toString();break;case 4:i.cr=t.uint32();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"0"!==t._i&&e.tag(1,c.k).Y(t._i),void 0!==t.Fi&&e.tag(2,c.k).Y(t.Fi),void 0!==t.Hi&&e.tag(3,c.k).Y(t.Hi),void 0!==t.cr&&e.tag(4,c.k).uint32(t.cr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Pn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node",[{p:1,name:"id",kind:"scalar",qt:12},{p:2,name:"pro_tx_hash",kind:"scalar",It:!0,qt:12}])}create(t){const e=globalThis.Object.create(this.de);return e.id=new Uint8Array(0),void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.id=t.bytes();break;case 2:i.ji=t.bytes();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.id.length&&e.tag(1,c.A).bytes(t.id),void 0!==t.ji&&e.tag(2,c.A).bytes(t.ji);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Nn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain",[{p:1,name:"catching_up",kind:"scalar",qt:8},{p:2,name:"latest_block_hash",kind:"scalar",qt:12},{p:3,name:"latest_app_hash",kind:"scalar",qt:12},{p:4,name:"latest_block_height",kind:"scalar",qt:4},{p:5,name:"earliest_block_hash",kind:"scalar",qt:12},{p:6,name:"earliest_app_hash",kind:"scalar",qt:12},{p:7,name:"earliest_block_height",kind:"scalar",qt:4},{p:9,name:"max_peer_block_height",kind:"scalar",qt:4},{p:10,name:"core_chain_locked_height",kind:"scalar",It:!0,qt:13}])}create(t){const e=globalThis.Object.create(this.de);return e.Mi=!1,e.Li=new Uint8Array(0),e.Zi=new Uint8Array(0),e.qi="0",e.Yi=new Uint8Array(0),e.zi=new Uint8Array(0),e.Xi="0",e.Ji="0",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Mi=t.J();break;case 2:i.Li=t.bytes();break;case 3:i.Zi=t.bytes();break;case 4:i.qi=t.Y().toString();break;case 5:i.Yi=t.bytes();break;case 6:i.zi=t.bytes();break;case 7:i.Xi=t.Y().toString();break;case 9:i.Ji=t.Y().toString();break;case 10:i.ar=t.uint32();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){!1!==t.Mi&&e.tag(1,c.k).J(t.Mi),t.Li.length&&e.tag(2,c.A).bytes(t.Li),t.Zi.length&&e.tag(3,c.A).bytes(t.Zi),"0"!==t.qi&&e.tag(4,c.k).Y(t.qi),t.Yi.length&&e.tag(5,c.A).bytes(t.Yi),t.zi.length&&e.tag(6,c.A).bytes(t.zi),"0"!==t.Xi&&e.tag(7,c.k).Y(t.Xi),"0"!==t.Ji&&e.tag(9,c.k).Y(t.Ji),void 0!==t.ar&&e.tag(10,c.k).uint32(t.ar);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const xn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network",[{p:1,name:"chain_id",kind:"scalar",qt:9},{p:2,name:"peers_count",kind:"scalar",qt:13},{p:3,name:"listening",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.hr="",e.Qi=0,e.eo=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.hr=t.string();break;case 2:i.Qi=t.uint32();break;case 3:i.eo=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){""!==t.hr&&e.tag(1,c.A).string(t.hr),0!==t.Qi&&e.tag(2,c.k).uint32(t.Qi),!1!==t.eo&&e.tag(3,c.k).J(t.eo);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const $n=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync",[{p:1,name:"total_synced_time",kind:"scalar",qt:4},{p:2,name:"remaining_time",kind:"scalar",qt:4},{p:3,name:"total_snapshots",kind:"scalar",qt:13},{p:4,name:"chunk_process_avg_time",kind:"scalar",qt:4},{p:5,name:"snapshot_height",kind:"scalar",qt:4},{p:6,name:"snapshot_chunks_count",kind:"scalar",qt:4},{p:7,name:"backfilled_blocks",kind:"scalar",qt:4},{p:8,name:"backfill_blocks_total",kind:"scalar",qt:4}])}create(t){const e=globalThis.Object.create(this.de);return e.no="0",e.ro="0",e.io=0,e.oo="0",e.so="0",e.ao="0",e.co="0",e.lo="0",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.no=t.Y().toString();break;case 2:i.ro=t.Y().toString();break;case 3:i.io=t.uint32();break;case 4:i.oo=t.Y().toString();break;case 5:i.so=t.Y().toString();break;case 6:i.ao=t.Y().toString();break;case 7:i.co=t.Y().toString();break;case 8:i.lo=t.Y().toString();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"0"!==t.no&&e.tag(1,c.k).Y(t.no),"0"!==t.ro&&e.tag(2,c.k).Y(t.ro),0!==t.io&&e.tag(3,c.k).uint32(t.io),"0"!==t.oo&&e.tag(4,c.k).Y(t.oo),"0"!==t.so&&e.tag(5,c.k).Y(t.so),"0"!==t.ao&&e.tag(6,c.k).Y(t.ao),"0"!==t.co&&e.tag(7,c.k).Y(t.co),"0"!==t.lo&&e.tag(8,c.k).Y(t.lo);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Un=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Sn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Sn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Sn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Sn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0",[{p:1,name:"identity_id",kind:"scalar",qt:12},{p:2,name:"token_ids",kind:"scalar",repeat:2,qt:12},{p:3,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.yr=new Uint8Array(0),e.uo=[],e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.yr=t.bytes();break;case 2:i.uo.push(t.bytes());break;case 3:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.yr.length&&e.tag(1,c.A).bytes(t.yr);for(let n=0;n<t.uo.length;n++)e.tag(2,c.A).bytes(t.uo[n]);!1!==t.pr&&e.tag(3,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Cn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Gn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Gn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Gn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Gn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0",[{p:1,name:"token_balances",kind:"message",kt:"result",qt:()=>Kn},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"tokenBalances",ho:Kn.se(t,t.uint32(),n,i.result.ho)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"tokenBalances"===t.result.Tt&&Kn.le(t.result.ho,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Vn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry",[{p:1,name:"token_id",kind:"scalar",qt:12},{p:2,name:"balance",kind:"scalar",It:!0,qt:4}])}create(t){const e=globalThis.Object.create(this.de);return e.fo=new Uint8Array(0),void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.fo=t.bytes();break;case 2:i.balance=t.Y().toString();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.fo.length&&e.tag(1,c.A).bytes(t.fo),void 0!==t.balance&&e.tag(2,c.k).Y(t.balance);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Kn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances",[{p:1,name:"token_balances",kind:"message",repeat:2,qt:()=>Vn}])}create(t){const e=globalThis.Object.create(this.de);return e.ho=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.ho.push(Vn.se(t,t.uint32(),n));else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let r=0;r<t.ho.length;r++)Vn.le(t.ho[r],e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const On=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Fn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Fn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Fn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Fn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0",[{p:1,name:"token_id",kind:"scalar",qt:12},{p:2,name:"identity_ids",kind:"scalar",repeat:2,qt:12},{p:3,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.fo=new Uint8Array(0),e.do=[],e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.fo=t.bytes();break;case 2:i.do.push(t.bytes());break;case 3:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.fo.length&&e.tag(1,c.A).bytes(t.fo);for(let n=0;n<t.do.length;n++)e.tag(2,c.A).bytes(t.do[n]);!1!==t.pr&&e.tag(3,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Wn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Dn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Dn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Dn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Dn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0",[{p:1,name:"identity_token_balances",kind:"message",kt:"result",qt:()=>Hn},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"identityTokenBalances",wo:Hn.se(t,t.uint32(),n,i.result.wo)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"identityTokenBalances"===t.result.Tt&&Hn.le(t.result.wo,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const _n=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry",[{p:1,name:"identity_id",kind:"scalar",qt:12},{p:2,name:"balance",kind:"scalar",It:!0,qt:4}])}create(t){const e=globalThis.Object.create(this.de);return e.yr=new Uint8Array(0),void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.yr=t.bytes();break;case 2:i.balance=t.Y().toString();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.yr.length&&e.tag(1,c.A).bytes(t.yr),void 0!==t.balance&&e.tag(2,c.k).Y(t.balance);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Hn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances",[{p:1,name:"identity_token_balances",kind:"message",repeat:2,qt:()=>_n}])}create(t){const e=globalThis.Object.create(this.de);return e.wo=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.wo.push(_n.se(t,t.uint32(),n));else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let r=0;r<t.wo.length;r++)_n.le(t.wo[r],e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const jn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenContractInfoRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Mn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Mn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Mn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Mn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenContractInfoRequest.GetTokenContractInfoRequestV0",[{p:1,name:"token_id",kind:"scalar",qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.fo=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.fo=t.bytes();break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.fo.length&&e.tag(1,c.A).bytes(t.fo),!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ln=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenContractInfoResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Zn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Zn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Zn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Zn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenContractInfoResponse.GetTokenContractInfoResponseV0",[{p:1,name:"data",kind:"message",kt:"result",qt:()=>qn},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"data",data:qn.se(t,t.uint32(),n,i.result.data)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"data"===t.result.Tt&&qn.le(t.result.data,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const qn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenContractInfoResponse.GetTokenContractInfoResponseV0.TokenContractInfoData",[{p:1,name:"contract_id",kind:"scalar",qt:12},{p:2,name:"token_contract_position",kind:"scalar",qt:13}])}create(t){const e=globalThis.Object.create(this.de);return e.gr=new Uint8Array(0),e.po=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.gr=t.bytes();break;case 2:i.po=t.uint32();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.gr.length&&e.tag(1,c.A).bytes(t.gr),0!==t.po&&e.tag(2,c.k).uint32(t.po);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Yn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>zn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:zn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&zn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const zn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0",[{p:1,name:"token_ids",kind:"scalar",repeat:2,qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.uo=[],e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.uo.push(t.bytes());break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let n=0;n<t.uo.length;n++)e.tag(1,c.A).bytes(t.uo[n]);!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Xn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Jn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Jn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Jn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Jn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0",[{p:1,name:"token_direct_purchase_prices",kind:"message",kt:"result",qt:()=>nr},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"tokenDirectPurchasePrices",yo:nr.se(t,t.uint32(),n,i.result.yo)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"tokenDirectPurchasePrices"===t.result.Tt&&nr.le(t.result.yo,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Qn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity",[{p:1,name:"quantity",kind:"scalar",qt:4},{p:2,name:"price",kind:"scalar",qt:4}])}create(t){const e=globalThis.Object.create(this.de);return e.bo="0",e.mo="0",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.bo=t.Y().toString();break;case 2:i.mo=t.Y().toString();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"0"!==t.bo&&e.tag(1,c.k).Y(t.bo),"0"!==t.mo&&e.tag(2,c.k).Y(t.mo);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const tr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule",[{p:1,name:"price_for_quantity",kind:"message",repeat:2,qt:()=>Qn}])}create(t){const e=globalThis.Object.create(this.de);return e.vo=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.vo.push(Qn.se(t,t.uint32(),n));else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let r=0;r<t.vo.length;r++)Qn.le(t.vo[r],e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const er=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry",[{p:1,name:"token_id",kind:"scalar",qt:12},{p:2,name:"fixed_price",kind:"scalar",kt:"price",qt:4},{p:3,name:"variable_price",kind:"message",kt:"price",qt:()=>tr}])}create(t){const e=globalThis.Object.create(this.de);return e.fo=new Uint8Array(0),e.mo={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.fo=t.bytes();break;case 2:i.mo={Tt:"fixedPrice",Io:t.Y().toString()};break;case 3:i.mo={Tt:"variablePrice",ko:tr.se(t,t.uint32(),n,i.mo.ko)};break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.fo.length&&e.tag(1,c.A).bytes(t.fo),"fixedPrice"===t.mo.Tt&&e.tag(2,c.k).Y(t.mo.Io),"variablePrice"===t.mo.Tt&&tr.le(t.mo.ko,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const nr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices",[{p:1,name:"token_direct_purchase_price",kind:"message",repeat:2,qt:()=>er}])}create(t){const e=globalThis.Object.create(this.de);return e.To=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.To.push(er.se(t,t.uint32(),n));else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let r=0;r<t.To.length;r++)er.le(t.To[r],e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const rr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>ir}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:ir.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&ir.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ir=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0",[{p:1,name:"token_id",kind:"scalar",qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.fo=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.fo=t.bytes();break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.fo.length&&e.tag(1,c.A).bytes(t.fo),!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const or=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>sr}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:sr.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&sr.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const sr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0",[{p:1,name:"token_total_supply",kind:"message",kt:"result",qt:()=>ar},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"tokenTotalSupply",Ao:ar.se(t,t.uint32(),n,i.result.Ao)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"tokenTotalSupply"===t.result.Tt&&ar.le(t.result.Ao,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ar=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry",[{p:1,name:"token_id",kind:"scalar",qt:12},{p:2,name:"total_aggregated_amount_in_user_accounts",kind:"scalar",qt:4},{p:3,name:"total_system_amount",kind:"scalar",qt:4}])}create(t){const e=globalThis.Object.create(this.de);return e.fo=new Uint8Array(0),e.Bo="0",e.Eo="0",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.fo=t.bytes();break;case 2:i.Bo=t.Y().toString();break;case 3:i.Eo=t.Y().toString();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.fo.length&&e.tag(1,c.A).bytes(t.fo),"0"!==t.Bo&&e.tag(2,c.k).Y(t.Bo),"0"!==t.Eo&&e.tag(3,c.k).Y(t.Eo);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const cr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.StateId",[{p:1,name:"app_version",kind:"scalar",qt:6},{p:2,name:"height",kind:"scalar",qt:6},{p:3,name:"app_hash",kind:"scalar",qt:12},{p:4,name:"core_chain_locked_height",kind:"scalar",qt:7},{p:5,name:"time",kind:"scalar",qt:6}])}create(t){const e=globalThis.Object.create(this.de);return e.appVersion="0",e.height="0",e.Ro=new Uint8Array(0),e.ar=0,e.time="0",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.appVersion=t.nt().toString();break;case 2:i.height=t.nt().toString();break;case 3:i.Ro=t.bytes();break;case 4:i.ar=t.tt();break;case 5:i.time=t.nt().toString();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"0"!==t.appVersion&&e.tag(1,c.T).nt(t.appVersion),"0"!==t.height&&e.tag(2,c.T).nt(t.height),t.Ro.length&&e.tag(3,c.A).bytes(t.Ro),0!==t.ar&&e.tag(4,c.P).tt(t.ar),"0"!==t.time&&e.tag(5,c.T).nt(t.time);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const lr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.CanonicalVote",[{p:1,name:"type",kind:"enum",qt:()=>["org.dash.platform.dapi.v0.SignedMsgType",Ut]},{p:2,name:"height",kind:"scalar",qt:16},{p:3,name:"round",kind:"scalar",qt:16},{p:4,name:"block_id",kind:"scalar",qt:12},{p:5,name:"state_id",kind:"scalar",qt:12},{p:99,name:"chain_id",kind:"scalar",qt:9}])}create(t){const e=globalThis.Object.create(this.de);return e.type=0,e.height="0",e.round="0",e.Po=new Uint8Array(0),e.No=new Uint8Array(0),e.hr="",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.type=t.int32();break;case 2:i.height=t.rt().toString();break;case 3:i.round=t.rt().toString();break;case 4:i.Po=t.bytes();break;case 5:i.No=t.bytes();break;case 99:i.hr=t.string();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.type&&e.tag(1,c.k).int32(t.type),"0"!==t.height&&e.tag(2,c.T).rt(t.height),"0"!==t.round&&e.tag(3,c.T).rt(t.round),t.Po.length&&e.tag(4,c.A).bytes(t.Po),t.No.length&&e.tag(5,c.A).bytes(t.No),""!==t.hr&&e.tag(99,c.A).string(t.hr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ur=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>hr}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:hr.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&hr.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const hr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0",[{p:1,name:"state_transition_hash",kind:"scalar",qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.xo=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.xo=t.bytes();break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.xo.length&&e.tag(1,c.A).bytes(t.xo),!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const fr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>dr}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:dr.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&dr.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const dr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0",[{p:1,name:"error",kind:"message",kt:"result",qt:()=>Gt},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"error",error:Gt.se(t,t.uint32(),n,i.result.error)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"error"===t.result.Tt&&Gt.le(t.result.error,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const wr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetAddressInfoRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>pr}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:pr.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&pr.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const pr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetAddressInfoRequest.GetAddressInfoRequestV0",[{p:1,name:"address",kind:"scalar",qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.address=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.address=t.bytes();break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.address.length&&e.tag(1,c.A).bytes(t.address),!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const yr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.AddressInfoEntry",[{p:1,name:"address",kind:"scalar",qt:12},{p:2,name:"balance_and_nonce",kind:"message",qt:()=>gr}])}create(t){const e=globalThis.Object.create(this.de);return e.address=new Uint8Array(0),void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.address=t.bytes();break;case 2:i.$o=gr.se(t,t.uint32(),n,i.$o);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.address.length&&e.tag(1,c.A).bytes(t.address),t.$o&&gr.le(t.$o,e.tag(2,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const gr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.BalanceAndNonce",[{p:1,name:"balance",kind:"scalar",qt:4},{p:2,name:"nonce",kind:"scalar",qt:13}])}create(t){const e=globalThis.Object.create(this.de);return e.balance="0",e.nonce=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.balance=t.Y().toString();break;case 2:i.nonce=t.uint32();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"0"!==t.balance&&e.tag(1,c.k).Y(t.balance),0!==t.nonce&&e.tag(2,c.k).uint32(t.nonce);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const br=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetAddressInfoResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>mr}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:mr.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&mr.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const mr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetAddressInfoResponse.GetAddressInfoResponseV0",[{p:1,name:"address_info_entry",kind:"message",kt:"result",qt:()=>yr},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"addressInfoEntry",Uo:yr.se(t,t.uint32(),n,i.result.Uo)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"addressInfoEntry"===t.result.Tt&&yr.le(t.result.Uo,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const vr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetAddressesInfosRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Ir}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Ir.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Ir.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ir=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetAddressesInfosRequest.GetAddressesInfosRequestV0",[{p:1,name:"addresses",kind:"scalar",repeat:2,qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.So=[],e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.So.push(t.bytes());break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let n=0;n<t.So.length;n++)e.tag(1,c.A).bytes(t.So[n]);!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const kr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.AddressInfoEntries",[{p:1,name:"address_info_entries",kind:"message",repeat:2,qt:()=>yr}])}create(t){const e=globalThis.Object.create(this.de);return e.Co=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.Co.push(yr.se(t,t.uint32(),n));else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let r=0;r<t.Co.length;r++)yr.le(t.Co[r],e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Tr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetAddressesInfosResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Ar}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Ar.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Ar.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ar=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetAddressesInfosResponse.GetAddressesInfosResponseV0",[{p:1,name:"address_info_entries",kind:"message",kt:"result",qt:()=>kr},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"addressInfoEntries",Co:kr.se(t,t.uint32(),n,i.result.Co)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"addressInfoEntries"===t.result.Tt&&kr.le(t.result.Co,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}},Br=new class{constructor(t,e,n){this.ee=t,this.Go=e.map(t=>function(t,e){var n,r,i;let o=t;return o.service=e,o.localName=null!==(n=o.localName)&&void 0!==n?n:K(o.name),o.Vn=!!o.Vn,o.Gn=!!o.Gn,o.options=null!==(r=o.options)&&void 0!==r?r:{},o.Vo=null!==(i=o.Vo)&&void 0!==i?i:void 0,o}(t,this)),this.options=null!=n?n:{}}}("org.dash.platform.dapi.v0.Platform",[{name:"broadcastStateTransition",options:{},On:Vt,Fn:Kt},{name:"getIdentity",options:{},On:Ot,Fn:qt},{name:"getIdentityKeys",options:{},On:ue,Fn:fe},{name:"getIdentitiesContractKeys",options:{},On:pe,Fn:ge},{name:"getIdentityNonce",options:{},On:Wt,Fn:zt},{name:"getIdentityContractNonce",options:{},On:_t,Fn:Jt},{name:"getIdentityBalance",options:{},On:jt,Fn:te},{name:"getIdentitiesBalances",options:{},On:ke,Fn:Ae},{name:"getIdentityBalanceAndRevision",options:{},On:Lt,Fn:ne},{name:"getDataContract",options:{},On:Pe,Fn:xe},{name:"getDocuments",options:{},On:Ue,Fn:Ce},{name:"getIdentityByPublicKeyHash",options:{},On:Ke,Fn:Fe},{name:"getIdentityByNonUniquePublicKeyHash",options:{},On:De,Fn:He},{name:"getEpochsInfo",options:{},On:Ze,Fn:Ye},{name:"getContestedResources",options:{},On:Qe,Fn:nn},{name:"getContestedResourceVoteState",options:{},On:sn,Fn:ln},{name:"getTotalCreditsInPlatform",options:{},On:wn,Fn:yn},{name:"getStatus",options:{},On:bn,Fn:vn},{name:"getIdentityTokenBalances",options:{},On:Un,Fn:Cn},{name:"getIdentitiesTokenBalances",options:{},On:On,Fn:Wn},{name:"getTokenContractInfo",options:{},On:jn,Fn:Ln},{name:"getTokenDirectPurchasePrices",options:{},On:Yn,Fn:Xn},{name:"getTokenTotalSupply",options:{},On:rr,Fn:or},{name:"waitForStateTransitionResult",options:{},On:ur,Fn:fr},{name:"getAddressInfo",options:{},On:wr,Fn:br},{name:"getAddressesInfos",options:{},On:vr,Fn:Tr}]);class Er{Ko;ee=Br.ee;Go=Br.Go;options=Br.options;constructor(t){this.Ko=t}Oo(t,e){const n=this.Go[0],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Fo(t,e){const n=this.Go[1],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Wo(t,e){const n=this.Go[2],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Do(t,e){const n=this.Go[3],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}_o(t,e){const n=this.Go[4],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Ho(t,e){const n=this.Go[5],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}jo(t,e){const n=this.Go[6],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Mo(t,e){const n=this.Go[7],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Lo(t,e){const n=this.Go[8],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Zo(t,e){const n=this.Go[9],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}qo(t,e){const n=this.Go[10],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Yo(t,e){const n=this.Go[11],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}zo(t,e){const n=this.Go[12],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Xo(t,e){const n=this.Go[13],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Jo(t,e){const n=this.Go[14],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Qo(t,e){const n=this.Go[15],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}ts(t,e){const n=this.Go[16],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}es(t,e){const n=this.Go[17],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}ns(t,e){const n=this.Go[18],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}rs(t,e){const n=this.Go[19],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}ss(t,e){const n=this.Go[20],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}cs(t,e){const n=this.Go[21],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}ls(t,e){const n=this.Go[22],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}us(t,e){const n=this.Go[23],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}hs(t,e){const n=this.Go[24],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}fs(t,e){const n=this.Go[25],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}}const Rr={ds:["https://158.160.14.115:1443"],ws:["https://158.160.14.115:443"]},Pr=(t,e)=>new Er(new Et({Cn:t,abort:e?.signal}));class Nr{ps;Ui;constructor(t,e){const n=e?.ys??5;this.Ui=t,this.gs(t,n,e?.bs).catch(console.error)}async gs(t,e,n){if("string"==typeof n)return void(this.ps=[n]);if(Array.isArray(n))return void(this.ps=n);if(null!=n)throw new Error("Unrecognized DAPI URL");this.ps=Rr[t];const r=await async function(t){const e=`https://${"mainnet"===t?"":"testnet."}platform-explorer.pshenmic.dev/validators?isActive=true`,n=await fetch(e);if(200!==n.status)throw new Error("Failed to query Platform Explorer for active validators");const{vs:r}=await n.json();return r.map(e=>e?.Is?.state?.service?`https://${e.Is.state.service.split(":")[0]}${"mainnet"===t?"":":1443"}`:void 0).filter(t=>null!=t)}(t),i=Object.entries(r).map(([,t])=>t).filter(t=>"ENABLED"===t.status).map(t=>{const[e]=t.address.split(":");return`https://${e}:${t.ks}`});for(const t of i){if(this.ps.length>e)break;try{const e=Pr(t),{response:n}=await e.es(bn.create({}));"v0"===n.version.Tt&&null!=n.version.wr.chain&&this.ps.push(t)}catch(t){}}}Ts(t){const e=function(t){return t[Math.floor(Math.random()*t.length)]}(this.ps);return Pr(e,t)}}const{As:xr}=require("@tybys/wasm-util"),{Bs:$r}=require("@emnapi/runtime"),{Es:Ur}=require("@emnapi/core"),{bytes:Sr}=require("./wasm/wasmBytes.cjs"),{decode:Cr}=require("../utils/base122.cjs"),{Rs:Gr}=require("fflate"),Vr=new Uint8Array(Cr(Sr)),Kr=new xr({version:"preview1",print:function(){console.log.apply(console,arguments)},Ps:function(){console.error.apply(console,arguments)}}),Or=$r();Or.xs.Ns=!1,Or.xs.$s=!1;const Fr=new WebAssembly.Memory({Us:1e3,Ss:2e3,Cs:!0}),Wr=Ur(Gr(Vr),{context:Or,Gs:Kr,Vs(t){t.Ks={...t.Ks,...t.Os,...t.Fs,memory:Fr}},Ws({Ds:t}){for(const e of Object.keys(t.exports))e.startsWith("__napi_register__")&&t.exports[e]()}});module.exports=Wr._s.exports,module.exports.default=Wr._s.exports;const{Hs:Dr,js:_r,Ms:Hr,Ls:jr,Zs:Mr,qs:Lr,Ys:Zr,zs:qr,Xs:Yr,Js:zr,Qs:Xr,ta:Jr,ea:Qr,na:ti,ra:ei,ia:ni,oa:ri,sa:ii,aa:oi,ca:si,la:ai,ua:ci,ha:li,fa:ui,da:hi,wa:fi,pa:di,ya:wi,ga:pi,ba:yi,ma:gi,va:bi,Ia:mi,ka:vi,Ta:Ii,Aa:ki,Ba:Ti,Ea:Ai,Ra:Bi,Pa:Ei,Na:Ri,xa:Pi,$a:Ni,Ua:xi,Sa:$i,Ca:Ui,Ga:Si,Va:Ci,Ka:Gi,Oa:Vi,Fa:Ki,Wa:Oi,Da:Fi,_a:Wi,Ha:Di,ja:_i,Ma:Hi,La:ji,Za:Mi,qa:Li,Ya:Zi,za:qi,Xa:Yi,Ja:zi,Qa:Xi,tc:Ji,ec:Qi,nc:to,rc:eo,oc:no,sc:ro,ac:io,cc:oo,lc:so,uc:ao,hc:co,fc:lo,dc:uo,wc:ho,yc:fo,gc:wo,bc:po,mc:yo,vc:go,Ic:bo,kc:mo,Tc:vo,Ac:Io,Bc:ko,Ec:To,Rc:Ao,Pc:Bo,Nc:Eo,xc:Ro,$c:Po,Uc:No,Sc:xo,Cc:$o,Gc:Uo,Vc:So,Kc:Co,Oc:Go,Fc:Vo,Wc:Ko,Dc:Oo,_c:Fo,Hc:Wo,jc:Do,Mc:_o,Lc:Ho,Zc:jo,qc:Mo,Yc:Lo,zc:Zo,Xc:qo,Jc:Yo,Qc:zo,tl:Xo,el:Jo,nl:Qo,rl:ts,il:es,ol:ns,sl:rs,al:is,cl:os,ll:ss,ul:as,hl:cs,fl:ls,dl:us,wl:hs,pl:fs,yl:ds,gl:ws,bl:ps,ml:ys,vl:gs,Il:bs,kl:ms,Tl:vs,Al:Is,Bl:ks,El:Ts,Rl:As,Pl:Bs,Nl:Es,xl:Rs,$l:Ps,Ul:Ns,Sl:xs,Cl:$s,Gl:Us,Vl:Ss,Kl:Cs,Ol:Gs,Fl:Vs,Wl:Ks,Dl:Os,_l:Fs,Hl:Ws,jl:Ds,Ml:_s,Ll:Hs,Zl:js,ql:Ms,Yl:Ls,zl:Zs,Xl:qs,Jl:Ys,Ql:zs,tu:Xs,eu:Js,nu:Qs,ru:ta,iu:ea,ou:na,su:ra,au:ia,cu:oa}=void 0;var sa=Object.freeze({__proto__:null,Yl:Ls,ua:ci,ha:li,fa:ui,da:hi,wa:fi,pa:di,ya:wi,zl:Zs,ga:pi,ba:yi,va:bi,Xl:qs,ma:gi,Ia:mi,ka:vi,Ta:Ii,Aa:ki,Ba:Ti,Ea:Ai,Ra:Bi,Pa:Ei,Na:Ri,xa:Pi,$a:Ni,Ua:xi,Sa:$i,Ca:Ui,Ga:Si,Va:Ci,Ka:Gi,Oa:Vi,Fa:Ki,Wa:Oi,Da:Fi,_a:Wi,Ha:Di,ja:_i,Ma:Hi,Jl:Ys,Ql:zs,La:ji,Za:Mi,qa:Li,Ya:Zi,za:qi,Xa:Yi,Ja:zi,Qa:Xi,tc:Ji,ec:Qi,nc:to,rc:eo,oc:no,sc:ro,ac:io,cc:oo,lc:so,uc:ao,hc:co,fc:lo,dc:uo,tu:Xs,wc:ho,eu:Js,yc:fo,gc:wo,bc:po,mc:yo,vc:go,Ic:bo,nu:Qs,ru:ta,kc:mo,Tc:vo,Ac:Io,Bc:ko,iu:ea,Ec:To,Rc:Ao,ou:na,Pc:Bo,Nc:Eo,Uc:No,Sc:xo,xc:Ro,$c:Po,Cc:$o,Gc:Uo,Vc:So,Kc:Co,Oc:Go,Fc:Vo,Wc:Ko,Dc:Oo,_c:Fo,Hc:Wo,jc:Do,Mc:_o,Lc:Ho,Zc:jo,qc:Mo,Yc:Lo,su:ra,au:ia,zc:Zo,Xc:qo,Jc:Yo,Qc:zo,tl:Xo,el:Jo,nl:Qo,rl:ts,il:es,ol:ns,sl:rs,al:is,cl:os,ll:ss,ul:as,hl:cs,fl:ls,dl:us,wl:hs,pl:fs,yl:ds,gl:ws,bl:ps,ml:ys,vl:gs,Il:bs,kl:ms,Tl:vs,Al:Is,Bl:ks,El:Ts,Rl:As,Pl:Bs,Nl:Es,xl:Rs,Ul:Ns,$l:Ps,Sl:xs,Cl:$s,Gl:Us,Vl:Ss,Kl:Cs,Ol:Gs,Fl:Vs,Wl:Ks,Dl:Os,Hl:Ws,_l:Fs,jl:Ds,Ml:_s,Ll:Hs,Zl:js,cu:oa,ql:Ms,js:_r,Hs:Dr,Ms:Hr,Ls:jr,Zs:Mr,qs:Lr,Ys:Zr,zs:qr,Xs:Yr,Js:zr,Qs:Xr,ta:Jr,ea:Qr,na:ti,ra:ei,ia:ni,oa:ri,aa:oi,sa:ii,ca:si,la:ai});class aa{static Ds;lu=null;constructor(){}static uu(){return null==aa.Ds&&(aa.Ds=new aa),aa.Ds}hu(t){this.lu=t}get fu(){if(null==this.lu)throw new Error("DashPlatformProtocol (dpp) has not been set. Call setDpp() before using SDK classes.");return this.lu}}const ca=aa.uu();var la,ua,ha,fa,da,wa,pa,ya,ga,ba,ma,va,Ia,ka;!function(t){t[t.du=0]="ActionCompletion",t[t.wu=1]="ActionParticipation"}(la||(la={})),function(t){t[t.pu=0]="Instant",t[t.yu=1]="Chain"}(ua||(ua={})),function(t){t[t.gu=0]="Create",t[t.bu=1]="Replace",t[t.mu=2]="Delete",t[t.vu=3]="Transfer",t[t.Iu=4]="Purchase",t[t.ku=5]="UpdatePrice",t[t.Tu=6]="IgnoreWhileBumpingRevision"}(ha||(ha={})),function(t){t[t.Au=0]="DocumentOwner",t[t.Bu=1]="ContractOwner",t[t.Eu=2]="PreferContractOwner"}(fa||(fa={})),function(t){t[t.Ru=0]="ActionActive",t[t.Pu=1]="ActionClosed"}(da||(da={})),function(t){t[t.Nu=0]="ECDSA_SECP256K1",t[t.xu=1]="BLS12_381",t[t.$u=2]="ECDSA_HASH160",t[t.Uu=3]="BIP13_SCRIPT_HASH",t[t.Su=4]="EDDSA_25519_HASH160"}(wa||(wa={})),function(t){t[t.Cu=0]="Mainnet",t[t.Gu=1]="Testnet",t[t.Vu=2]="Devnet",t[t.Ku=3]="Regtest"}(pa||(pa={})),function(t){t[t.Ou=1]="PLATFORM_V1",t[t.Fu=2]="PLATFORM_V2",t[t.Wu=3]="PLATFORM_V3",t[t.Du=4]="PLATFORM_V4",t[t._u=5]="PLATFORM_V5",t[t.Hu=6]="PLATFORM_V6",t[t.ju=7]="PLATFORM_V7",t[t.Mu=8]="PLATFORM_V8",t[t.Lu=9]="PLATFORM_V9",t[t.Zu=10]="PLATFORM_V10",t[t.qu=11]="PLATFORM_V11",t[t.Yu=12]="PLATFORM_V12"}(ya||(ya={})),function(t){t[t.zu=0]="Never",t[t.Xu=1]="IfAvailable",t[t.Ju=2]="Standard"}(ga||(ga={})),function(t){t[t.qn=0]="AUTHENTICATION",t[t.Yn=1]="ENCRYPTION",t[t.zn=2]="DECRYPTION",t[t.Xn=3]="TRANSFER",t[t.Qu=4]="SYSTEM",t[t.Jn=5]="VOTING",t[t.th=6]="OWNER"}(ba||(ba={})),function(t){t[t.eh=0]="MASTER",t[t.nh=1]="CRITICAL",t[t.rh=2]="HIGH",t[t.ih=3]="MEDIUM"}(ma||(ma={})),function(t){t[t.oh=0]="PreProgrammed",t[t.sh=1]="Perpetual"}(va||(va={})),function(t){t[t.ah=0]="Pause",t[t.uh=1]="Resume"}(Ia||(Ia={})),function(t){t[t._n=0]="DOCUMENTS",t[t.Hn=1]="VOTE_TALLY",t[t.jn=2]="DOCUMENTS_AND_VOTE_TALLY"}(ka||(ka={}));class Ta{hh;constructor(t,e){const n=t.toString();this.hh=new ca.fu.wl(n,e)}get value(){return BigInt(this.hh.value)}set value(t){this.hh.value=t.toString()}get fh(){return this.hh.fh}set fh(t){this.hh.fh=t}get dh(){return this.hh.dh}set dh(t){this.hh.dh=t}wh(){return this.hh.wh()}static ph(t){const e=Object.create(Ta.prototype);return e.hh=t,e}}class Aa{yh;constructor(t,e){this.yh=new ca.fu.yc(t,e)}gh(){return this.yh.gh()}bh(){return this.yh.bh()}bytes(){return this.yh.bytes()}mh(){return this.yh.mh()}Ih(){return this.yh.Ih()}static kh(t){const e=ca.fu.yc.kh(t);return Aa.ph(e)}static fromHex(t){const e=ca.fu.yc.fromHex(t);return Aa.ph(e)}static fromBase64(t){const e=ca.fu.yc.fromBase64(t);return Aa.ph(e)}static ph(t){const e=Object.create(Aa.prototype);return e.yh=t,e}}class Ba{Th;constructor(t,e,n,r,i){this.Th=new ca.fu.dc(t,e.map(t=>t.yh),n,r,i)}get version(){return this.Th.version}set version(t){this.Th.version=t}get inputs(){return this.inputs.map(Aa.ph)}set inputs(t){this.Th.inputs=t.map(t=>t.yh)}get Ah(){return this.Th.Ah}set Ah(t){this.Th.Ah=t}get Bh(){return this.Th.Bh}set Bh(t){this.Th.Bh=t}get Eh(){return this.Th.Eh}set Eh(t){this.Th.Eh=t}static ph(t){const e=Object.create(Ba.prototype);return e.Th=t,e}}class Ea{Rh;constructor(t){const e=ca.fu;if(t instanceof Ea)return t;if(!(t instanceof Uint8Array||"string"==typeof t))throw new Error("Invalid raw ID");{const n=new e.Ha(t);this.Rh=new e.qa(n)}}Ph(){return this.Rh.Ph()}mh(){return this.Rh.mh()}Ih(){return this.Rh.Ih()}bytes(){return this.Rh.bytes()}static Nh(t){return this.ph(ca.fu.qa.Nh(t))}static fromBase64(t){return this.ph(ca.fu.qa.fromBase64(t))}static fromHex(t){return this.ph(ca.fu.qa.fromHex(t))}static kh(t){return this.ph(ca.fu.qa.kh(t))}static ph(t){const e=Object.create(Ea.prototype);return e.Rh=t,e}xh(){return this.Rh}}class Ra{$h;constructor(t,e,n){this.$h=new ca.fu.fc(t,e,n)}get Uh(){return this.$h.Uh}set Uh(t){this.$h.Uh=t}get Sh(){return Ba.ph(this.$h.Sh)}set Sh(t){this.$h.Sh=t.Th}Ch(){const t=this.$h.Ch();return t instanceof ca.fu.wl?Ta.ph(t):t}Gh(){const t=this.$h.Gh();return t instanceof ca.fu.yc?Aa.ph(t):t}Vh(){return this.$h.Vh()}Kh(){return this.$h.Kh()}Oh(){return Ea.ph(this.$h.Oh())}static Fh(t){return Ra.ph(ca.fu.fc.Fh(t))}static ph(t){const e=Object.create(Ra.prototype);return e.$h=t,e}}class Pa{$h;constructor(t,e){this.$h=new ca.fu.Ta(t,e.yh)}set ar(t){this.$h.ar=t}get ar(){return this.$h.ar}set Wh(t){this.$h.Wh=t.yh}get Wh(){return Aa.ph(this.$h.Wh)}Oh(){return Ea.ph(this.$h.Oh())}static Fh(t){const e=t.Wh instanceof Uint8Array?t.Wh:t.Wh.bytes();return Pa.ph(ca.fu.Ta.Fh({ar:t.ar,Wh:e}))}static ph(t){const e=Object.create(Pa.prototype);return e.$h=t,e}}class Na{Dh;constructor(t){this.Dh=new ca.fu.ya(t.$h)}static _h(t,e,n){return Na.ph(ca.fu.ya._h(t,e,n))}static Hh(t,e){return Na.ph(ca.fu.ya.Hh(t,e.yh))}jh(){return this.Dh.jh()}Mh(){return Ra.ph(this.Dh.Mh())}Lh(){return Pa.ph(this.Dh.Lh())}Gh(){const t=this.Dh.Gh();return null!=t?Aa.ph(t):null}Oh(){return Ea.ph(this.Dh.Oh())}Ih(){return this.Dh.Ih()}static fromHex(t){return Na.ph(ca.fu.ya.fromHex(t))}static ph(t){const e=Object.create(Na.prototype);return e.Dh=t,e}}class xa{Zh;constructor(t){t instanceof ca.fu.Ba?this.Zh=t:this.Zh=t instanceof xa?t.Zh:ca.fu.Ba.qh(t)}static qh(t){return new xa(ca.fu.Ba.qh(t))}get message(){return this.Zh.message}}class $a{Yh;constructor(t){this.Yh=new ca.fu.Ic(Ga(t))}bytes(){return this.Yh.bytes()}zh(t){return this.Yh.zh(Ua(t))}Xh(t){return this.Yh.Xh(Ua(t))}Jh(){return this.Yh.Jh()}Qh(){return this.Yh.Qh()}hash(){return this.Yh.hash()}static tf(t){return $a.ph(ca.fu.Ic.tf(t))}static kh(t){return $a.ph(ca.fu.Ic.kh(t))}static ph(t){const e=Object.create($a.prototype);return e.Yh=t,e}}function Ua(t){if("bigint"==typeof t||t>4294967295&&"string"!=typeof t)return ca.fu.Ha.ef(BigInt(t.toString()).toString());if(t instanceof Ea||t instanceof ca.fu.qa)return new ca.fu.Ha(t.bytes());if(t instanceof Uint8Array)return new ca.fu.Ha(t);if(Array.isArray(t))return new ca.fu.Ha(t.map(Ua));if("object"==typeof t&&null!==t){const e=Object.keys(t),n=Object.assign({},t);for(const r of e)n[r]=Ua(t[r]);return new ca.fu.Ha(n)}if("function"==typeof t)throw new Error("Cannot parse value from function");return"number"==typeof t?Number.isInteger(t)?t>4294967295||t<0?ca.fu.Ha.nf(t):ca.fu.Ha.rf(t):ca.fu.Ha.if(t):new ca.fu.Ha(t)}function Sa(t,e=!1){if(t.value instanceof ca.fu.Ha)return Sa(t.value,e);if(t.sf()){const n=BigInt(t.value);return e&&n<BigInt(Number.MAX_SAFE_INTEGER)&&n>BigInt(Number.MIN_SAFE_INTEGER)?Number(t.value):n}if(Array.isArray(t.value))return t.value.map(t=>Sa(t,e));if("object"!=typeof t.value||t.value instanceof Uint8Array||null===t.value)return t.value;{const n={},r=Object.keys(t.value);for(const i of r)n[i]=Sa(t.value[i],e);return n}}function Ca(t){return t instanceof Ea?t.Rh:t instanceof ca.fu.qa?t:new ca.fu.Ha(t)}function Ga(t){return t instanceof $a?t.Yh:t instanceof ca.fu.Ic?t:new ca.fu.Ha(t)}class Va{af;constructor(t,e){this.af=new ca.fu.Pa(Ca(t),e)}get identifier(){return Ea.ph(this.af.identifier)}set identifier(t){this.af.identifier=Ca(t)}get Vr(){return this.af.Vr}set Vr(t){this.af.Vr=t}get cf(){return this.af.cf}get lf(){return this.af.lf}static uf(t){return new Va(t)}static hf(t,e){return new Va(t,e)}static ph(t){const e=Object.create(Va.prototype);return e.af=t,e}}class Ka{ff;constructor(t,e){this.ff=new ca.fu.Bc(t,e)}get df(){return this.ff.df}set df(t){this.ff.df=t}get inner(){return this.ff.inner}set inner(t){this.ff.inner=t}wf(){return this.ff.wf()}pf(){return this.ff.pf()}bytes(){return this.ff.bytes()}static kh(t){return Ka.ph(ca.fu.Bc.kh(t))}static ph(t){const e=Object.create(Ka.prototype);return e.ff=t,e}}class Oa{yf;constructor(t,e){this.yf=new ca.fu.Ac(Ua(t),Ua(e))}getPublicKey(){return Ka.ph(this.yf.getPublicKey())}gf(){return this.yf.gf()}bf(){return this.yf.bf()}bytes(){return this.yf.bytes()}Ih(){return this.yf.Ih()}wf(){return this.yf.wf()}sign(t){return this.yf.sign(t)}mf(t){return this.yf.mf(t)}static vf(t){return Oa.ph(ca.fu.Ac.vf(t))}static kh(t,e){return Oa.ph(ca.fu.Ac.kh(t,Ua(e)))}static fromHex(t,e){return Oa.ph(ca.fu.Ac.fromHex(t,Ua(e)))}static ph(t){const e=Object.create(Oa.prototype);return e.yf=t,e}}class Fa{If;constructor(t,e,n,r,i,o,s,a){const c=ca.fu;if(null==e||null==n||null==r)throw new Error("purpose, securityLevel, keyType must be specified");this.If=new c.rc(t,new c.Ha(e),new c.Ha(n),new c.Ha(r),i,o,s?.toString(),a?.af)}get kf(){return this.If.kf}set kf(t){this.If.kf=t}get Or(){return this.If.Or}set Or(t){const e=ca.fu;this.If.Or=new e.Ha(t)}get Tf(){return this.If.Tf}set Tf(t){this.If.Tf=t}get Af(){return this.If.Af}set Af(t){const e=ca.fu;this.If.Af=new e.Ha(t)}get Bf(){return this.If.Bf}set Bf(t){this.If.Bf=t}get Ef(){return this.If.Ef}set Ef(t){const e=ca.fu;this.If.Ef=new e.Ha(t)}get Rf(){return this.If.Rf}set Rf(t){this.If.Rf=t}get readOnly(){return this.If.readOnly}set readOnly(t){this.If.readOnly=t}get data(){return this.If.data}set data(t){this.If.data=t}get Pf(){const t=this.If.Pf;return null!=t?BigInt(t):void 0}set Pf(t){this.If.Pf=t.toString()}get Nf(){if(null!=this.If.Nf)return Va.ph(this.If.Nf)}set Nf(t){this.If.Nf=t?.af}xf(){if(null!=this.If.Nf)return Va.ph(this.If.Nf)}$f(){this.If.$f()}wf(){return this.If.wf()}Uf(){return this.If.Uf()}bytes(){return this.If.bytes()}Ih(){return this.If.Ih()}mh(){return this.If.mh()}Sf(t,e){const n=t instanceof Oa?t.yf:Ua(t);return this.If.Sf(n,Ua(e))}static kh(t){const e=ca.fu.rc.kh(t);return this.ph(e)}static fromHex(t){const e=ca.fu.rc.fromHex(t);return this.ph(e)}static fromBase64(t){const e=ca.fu.rc.fromBase64(t);return this.ph(e)}static ph(t){const e=Object.create(Fa.prototype);return e.If=t,e}}class Wa{Cf;constructor(t,e){const n=ca.fu;this.Cf=new n.ec(Ca(t),Ua(e))}set id(t){this.Cf.id=Ca(t)}get id(){return Ea.ph(this.Cf.id)}set balance(t){this.Cf.balance=t.toString()}get balance(){return BigInt(this.Cf.balance)}set kr(t){this.Cf.kr=t.toString()}get kr(){return BigInt(this.Cf.kr)}Gf(t){this.Cf.Gf(t.If)}Vf(t){const e=this.Cf.Vf(t);if(null!=e)return Fa.ph(e)}Kf(){return this.Cf.Kf().map(t=>Fa.ph(t))}static fromHex(t){const e=ca.fu.ec.fromHex(t);return this.ph(e)}static fromBase64(t){const e=ca.fu.ec.fromBase64(t);return this.ph(e)}static kh(t){const e=ca.fu.ec.kh(t);return this.ph(e)}bytes(){return this.Cf.bytes()}Ih(){return this.Cf.Ih()}mh(){return this.Cf.mh()}static ph(t){const e=Object.create(Wa.prototype);return e.Cf=t,e}xh(){return this.Cf}}class Da{Of;zh(t){return this.Of.zh(Ua(t))}toString(){return this.Of.toString()}bytes(){return this.Of.bytes()}Ih(){return this.Of.Ih()}mh(){return this.Of.mh()}Ff(){return this.Of.Ff()}static kh(t){return Da.ph(ca.fu.Na.kh(t))}static Wf(t){return Da.ph(ca.fu.Na.Wf(t))}static Df(t){return Da.ph(ca.fu.Na.Df(t))}static ph(t){const e=Object.create(Da.prototype);return e.Of=t,e}}class _a{_f;constructor(t,e,n,r,i,o,s,a){this._f=new ca.fu.nc(t,Ua(e),Ua(n),Ua(r),i,o,s,a?.af)}Hf(){return Fa.ph(this._f.Hf())}Sf(t,e){const n=t instanceof Oa?t.yf:Ua(t);return this._f.Sf(n,Ua(e))}jf(){return this._f.jf()}xf(){if(null!=this._f.Nf)return Va.ph(this._f.Nf)}get Nf(){if(null!=this._f.Nf)return Va.ph(this._f.Nf)}set Nf(t){this._f.Nf=t.af}get kf(){return this._f.kf}set kf(t){this._f.kf=t}get Or(){return this._f.Or}set Or(t){this._f.Or=Ua(t)}get Af(){return this._f.Af}set Af(t){this._f.Af=Ua(t)}get Ef(){return this._f.Ef}set Ef(t){this._f.Ef=Ua(t)}get readOnly(){return this._f.readOnly}set readOnly(t){this._f.readOnly=t}get data(){return this._f.data}set data(t){this._f.data=t}get signature(){return this._f.signature}set signature(t){this._f.signature=t}static ph(t){const e=Object.create(_a.prototype);return e._f=t,e}}class Ha{Mf;constructor(t,e,n,r,i){const o=Object.keys(e),s=[];for(const t of o)s.push([Number(t),e[Number(t)].If]);this.Mf=new ca.fu.mc(Ca(t),s,n?.toString(),r?.toString(),i)}get id(){return Ea.ph(this.Mf.id)}set id(t){this.Mf.id=Ca(t)}get Lf(){const t=this.Mf.Lf,e={};for(const n of t)e[n[0]]=Fa.ph(n[1]);return e}set Lf(t){const e=Object.keys(t),n=[];for(const r of e)n.push([Number(r),t[Number(r)].If]);this.Mf.Lf=n}get balance(){const t=this.Mf.balance;return null!=t?BigInt(t):void 0}set balance(t){this.Mf.balance=t?.toString()}get kr(){const t=this.Mf.kr;return null!=t?BigInt(t):void 0}set kr(t){this.Mf.kr=t?.toString()}get Zf(){return this.Mf.Zf}set Zf(t){this.Mf.Zf=t}static ph(t){const e=Object.create(Ha.prototype);return e.Mf=t,e}}class ja{qf;constructor(t){this.qf=t}get signature(){return this.qf.signature??void 0}set signature(t){this.qf.signature=t}get Yf(){return this.qf.Yf??void 0}set Yf(t){this.qf.Yf=t}get zf(){return this.qf.zf}set zf(t){this.qf.zf=t}sign(t,e){const n=t instanceof Oa?t.yf:Ua(t);return this.qf.sign(n,e.If)}Xf(t,e,n){const r=t instanceof Oa?t.yf:Ua(t);return this.qf.Xf(r,e,n?Ua(n):void 0)}Jf(t,e,n){this.qf.Jf(t.If,e,n)}hash(t){return this.qf.hash(t)}Qf(){return this.qf.Qf()}td(){return this.qf.td()}ed(){return this.qf.ed()}nd(){const t=this.qf.nd();return null!=t?Ea.ph(t):void 0}rd(){return this.qf.rd()??void 0}od(t){return this.qf.od(Ua(t))??void 0}Ho(){const t=this.qf.Ho();return null!=t?BigInt(t):void 0}_o(){const t=this.qf._o();return null!=t?BigInt(t):void 0}sd(t){this.qf.sd(Ca(t))}ad(t){this.qf.ad(t.toString())}ld(t){this.qf.ld(t.toString())}ud(){return this.qf.ud()}bytes(){return this.qf.bytes()}Ih(){return this.qf.Ih()}mh(){return this.qf.mh()}static kh(t){return new ja(ca.fu.Cc.kh(t))}static fromHex(t){return new ja(ca.fu.Cc.fromHex(t))}static fromBase64(t){return new ja(ca.fu.Cc.fromBase64(t))}static ph(t){return new ja(t)}}class Ma{hd;constructor(t,e,n){this.hd=new ca.fu.Tc(t,e,n)}get fd(){return this.hd.fd}set fd(t){this.hd.fd=t}get dd(){return this.hd.dd}set dd(t){this.hd.dd=t}get value(){return this.hd.value}set value(t){this.hd.value=t}static ph(t){const e=Object.create(Ma.prototype);return e.hd=t,e}}class La{wd;constructor(t,e,n){this.wd=new ca.fu.Nc(t,e,n)}get pd(){return this.wd.pd}set pd(t){this.wd.pd=t}get yd(){return this.wd.yd}set yd(t){this.wd.yd=t}get value(){return this.wd.value}set value(t){this.wd.value=t}static ph(t){const e=Object.create(La.prototype);return e.wd=t,e}}class Za{gd;constructor(t,e,n){this.gd=new ca.fu.Za(t,Ca(e),n)}get bd(){return this.gd.bd}set bd(t){this.gd.bd=t}get md(){return Ea.ph(this.gd.md)}set md(t){this.gd.md=Ca(t)}get vd(){return this.gd.vd}set vd(t){this.gd.vd=t}static ph(t){const e=Object.create(Za.prototype);return e.gd=t,e}}class qa{Id;constructor(t,e,n,r){this.Id=new ca.fu.Xa(t.map(t=>t._f),e.Dh,n,r)}get kd(){return this.Id.kd.map(_a.ph)}set kd(t){this.Id.kd=t.map(t=>t._f)}get zf(){return this.Id.zf}set zf(t){this.Id.zf=t}get signature(){return this.Id.signature}set signature(t){this.Id.signature=t}get Td(){return Na.ph(this.Id.Td)}set Td(t){this.Id.Td=t.Dh}ud(){return this.Id.ud()}Ad(){return Ea.ph(this.Id.Ad())}bytes(){return this.Id.bytes()}Bd(){return ja.ph(this.Id.Bd())}static default(t){return qa.ph(ca.fu.Xa.default(Ua(t)))}static fromHex(t){return qa.ph(ca.fu.Xa.fromHex(t))}static fromBase64(t){return qa.ph(ca.fu.Xa.fromBase64(t))}static kh(t){return qa.ph(ca.fu.Xa.kh(t))}static Ed(t){return qa.ph(ca.fu.Xa.Ed(t.qf))}static ph(t){const e=Object.create(qa.prototype);return e.Id=t,e}}class Ya{Rd;constructor(t,e,n){this.Rd=new ca.fu.lc(t.Dh,Ca(e),n)}get zf(){return this.Rd.zf}set zf(t){this.Rd.zf=t}get Pd(){return Ea.ph(this.Rd.Pd)}set Pd(t){this.Rd.Pd=Ca(t)}get Nd(){return Na.ph(this.Rd.Nd)}set Nd(t){this.Rd.Nd=t.Dh}get signature(){return this.Rd.signature}set signature(t){this.Rd.signature=t}ud(){return this.Rd.ud()}xd(){return this.Rd.xd().map(Ea.ph)}$d(){const t=this.Rd.$d();return null!=t?Na.ph(t):void 0}bytes(){return this.Rd.bytes()}Ih(){return this.Rd.Ih()}mh(){return this.Rd.mh()}Bd(){return ja.ph(this.Rd.Bd())}static kh(t){return Ya.ph(ca.fu.lc.kh(t))}static fromHex(t){return Ya.ph(ca.fu.lc.fromHex(t))}static fromBase64(t){return Ya.ph(ca.fu.lc.fromBase64(t))}static Ed(t){return Ya.ph(ca.fu.lc.Ed(t.qf))}static ph(t){const e=Object.create(Ya.prototype);return e.Rd=t,e}}class za{Ud;constructor(t,e,n,r,i,o){this.Ud=new ca.fu.uc(Ca(t),e.toString(),n.toString(),r.map(t=>t._f),i,o)}get kr(){return BigInt(this.Ud.kr)}set kr(t){this.Ud.kr=t.toString()}get nonce(){return BigInt(this.Ud.nonce)}set nonce(t){this.Ud.nonce=t.toString()}get Pd(){return Ea.ph(this.Ud.Pd)}set Pd(t){this.Ud.Pd=Ca(t)}get Sd(){return this.Ud.Sd}set Sd(t){this.Ud.Sd=t}get Cd(){return this.Ud.Cd.map(_a.ph)}set Cd(t){this.Ud.Cd=t.map(t=>t._f)}get zf(){return this.Ud.zf}set zf(t){this.Ud.zf=t}get signature(){return this.Ud.signature}set signature(t){this.Ud.signature=t}get Yf(){return this.Ud.Yf}set Yf(t){this.Ud.Yf=t}ud(){return this.Ud.ud()}rd(){return this.Ud.rd()}xd(){return this.Ud.xd().map(Ea.ph)}$d(){const t=this.Ud.$d();return null!=t?Na.ph(t):void 0}bytes(){return this.Ud.bytes()}Ih(){return this.Ud.Ih()}mh(){return this.Ud.mh()}Bd(){return ja.ph(this.Ud.Bd())}static kh(t){return za.ph(ca.fu.uc.kh(t))}static fromHex(t){return za.ph(ca.fu.uc.fromHex(t))}static fromBase64(t){return za.ph(ca.fu.uc.fromBase64(t))}static Ed(t){return za.ph(ca.fu.uc.Ed(t.qf))}static ph(t){const e=Object.create(za.prototype);return e.Ud=t,e}}class Xa{Gd;constructor(t,e,n,r,i){this.Gd=new ca.fu.Ja(Ca(t),e.toString(),Ca(n),r.toString(),i)}get Vd(){return Ea.ph(this.Gd.Vd)}set Vd(t){this.Gd.Vd=Ca(t)}get Kd(){return Ea.ph(this.Gd.Kd)}set Kd(t){this.Gd.Vd=Ca(t)}get Od(){return BigInt(this.Gd.Od)}set Od(t){this.Gd.Od=t.toString()}get nonce(){return BigInt(this.Gd.nonce)}set nonce(t){this.Gd.nonce=t.toString()}get signature(){return this.Gd.signature}set signature(t){this.Gd.signature=t}get Yf(){return this.Gd.Yf}set Yf(t){this.Gd.Yf=t}get zf(){return this.Gd.zf}set zf(t){this.Gd.zf=t}ud(){return this.Gd.ud()}bytes(){return this.Gd.bytes()}Ih(){return this.Gd.Ih()}mh(){return this.Gd.mh()}Bd(){return ja.ph(this.Gd.Bd())}static kh(t){return Xa.ph(ca.fu.Ja.kh(t))}static fromHex(t){return Xa.ph(ca.fu.Ja.fromHex(t))}static fromBase64(t){return Xa.ph(ca.fu.Ja.fromBase64(t))}static Ed(t){return Xa.ph(ca.fu.Ja.Ed(t.qf))}static ph(t){const e=Object.create(Xa.prototype);return e.Gd=t,e}}class Ja{Fd;constructor(t,e,n,r,i,o,s){this.Fd=new ca.fu.tc(Ca(t),e.toString(),n,Ua(r),i.toString(),o?.Of,s)}get Wd(){const t=this.Fd.Wd;if(null!=t)return Da.ph(t)}set Wd(t){this.Fd.Wd=t?.Of}get Dd(){return this.Fd.Dd}set Dd(t){this.Fd.Dd=Ua(t)}get yr(){return Ea.ph(this.Fd.yr)}set yr(t){this.Fd.yr=Ca(t)}get zf(){return this.Fd.zf}set zf(t){this.Fd.zf=t}get nonce(){return BigInt(this.Fd.nonce)}set nonce(t){this.Fd.nonce=t.toString()}get Od(){return BigInt(this.Fd.Od)}set Od(t){this.Fd.Od=t.toString()}get _d(){return this.Fd._d}set _d(t){this.Fd._d=t}get signature(){return this.Fd.signature}set signature(t){this.Fd.signature=t}get Yf(){return this.Fd.Yf}set Yf(t){this.Fd.Yf=t}ud(){return this.Fd.ud()}rd(){return this.Fd.rd()}xd(){return this.Fd.xd().map(Ea.ph)}$d(){const t=this.Fd.$d();if(null!=t)return Na.ph(t)}bytes(){return this.Fd.bytes()}Ih(){return this.Fd.Ih()}mh(){return this.Fd.mh()}Bd(){return ja.ph(this.Fd.Bd())}static kh(t){return Ja.ph(ca.fu.tc.kh(t))}static fromHex(t){return Ja.ph(ca.fu.tc.fromHex(t))}static fromBase64(t){return Ja.ph(ca.fu.tc.fromBase64(t))}static Ed(t){return Ja.ph(ca.fu.tc.Ed(t.qf))}static ph(t){const e=Object.create(Ja.prototype);return e.Fd=t,e}}class Qa{Hd;constructor(t){this.Hd=t}jd(){const t=this.Hd.jd();return null!=t?Ea.ph(t):void 0}getType(){return this.Hd.getType()}static Md(t){return Qa.ph(ca.fu.Ec.Md(Ca(t)))}static Ld(){return Qa.ph(ca.fu.Ec.Ld())}static Lock(){return Qa.ph(ca.fu.Ec.Lock())}static ph(t){return new Qa(t)}}class tc{Zd;constructor(t,e,n,r){this.Zd=new ca.fu.Zl(Ca(t),e,n,Ua(r))}get gr(){return Ea.ph(this.Zd.gr)}set gr(t){this.Zd.gr=Ca(t)}get Vr(){return this.Zd.Vr}set Vr(t){this.Zd.Vr=t}get oi(){return this.Zd.oi}set oi(t){this.Zd.oi=t}get di(){return this.Zd.di}set di(t){this.Zd.di=Ua(t)}toString(){return this.Zd.toString()}static ph(t){const e=Object.create(tc.prototype);return e.Zd=t,e}}class ec{qd;constructor(t,e){this.qd=new ca.fu.Ll(t.Zd,e.Hd)}get Yd(){return tc.ph(this.qd.Yd)}set Yd(t){this.qd.Yd=t.Zd}get zd(){return Qa.ph(this.qd.zd)}set zd(t){this.qd.zd=t.Hd}static ph(t){const e=Object.create(ec.prototype);return e.qd=t,e}}class nc{Xd;constructor(t,e,n,r,i,o){this.Xd=new ca.fu.wc(Ca(t),Ca(e),n.qd,r.toString(),i,o)}get ji(){return Ea.ph(this.Xd.ji)}set ji(t){this.Xd.ji=Ca(t)}get Jd(){return Ea.ph(this.Xd.Jd)}set Jd(t){this.Xd.Jd=Ca(t)}get Qd(){return ec.ph(this.Xd.Qd)}set Qd(t){this.Xd.Qd=t.qd}get nonce(){return BigInt(this.Xd.nonce)}set nonce(t){this.Xd.nonce=t.toString()}get Yf(){return this.Xd.Yf}set Yf(t){this.Xd.Yf=t}get signature(){return this.Xd.signature}set signature(t){this.Xd.signature=t}get Td(){const t=this.Xd.Td;if(null!=t)return Na.ph(t)}get tw(){return this.Xd.tw.map(Ea.ph)}ud(){return this.Xd.ud()}bytes(){return this.Xd.bytes()}Ih(){return this.Xd.Ih()}mh(){return this.Xd.mh()}Bd(){return ja.ph(this.Xd.Bd())}static kh(t){return nc.ph(ca.fu.wc.kh(t))}static fromHex(t){return nc.ph(ca.fu.wc.fromHex(t))}static fromBase64(t){return nc.ph(ca.fu.wc.fromBase64(t))}static Ed(t){return nc.ph(ca.fu.wc.Ed(t.qf))}static ph(t){const e=Object.create(nc.prototype);return e.Xd=t,e}}class rc{ew;constructor(t){this.ew=t}nw(){return this.ew.nw()}jd(){const t=this.ew.jd();return void 0===t?void 0:"number"==typeof t?Number(t):Ea.ph(t)}static rw(){return new rc(ca.fu.ba.rw())}static Bu(){return new rc(ca.fu.ba.Bu())}static iw(t){return new rc(ca.fu.ba.iw(Ca(t)))}static ow(){return new rc(ca.fu.ba.ow())}static sw(t){return new rc(ca.fu.ba.sw(t))}static ph(t){return new rc(t)}}class ic{aw;constructor(t,e,n,r,i){this.aw=new ca.fu.Aa(t.ew,e.ew,n,r,i)}get cw(){return rc.ph(this.aw.cw)}set cw(t){this.aw.cw=t.ew}get lw(){return rc.ph(this.aw.lw)}set lw(t){this.aw.lw=t.ew}get uw(){return this.aw.uw}set uw(t){this.aw.uw=t}get hw(){return this.aw.hw}set hw(t){this.aw.hw=t}get fw(){return this.aw.fw}set fw(t){this.aw.fw=t}dw(t,e,n,r,i,o){const s=Object.keys(n),a=[];for(const t of s)a.push([Number(t),n[Number(t)].ww]);return this.aw.dw(t.ew,Ca(e),o,a,r.pw,Ua(i))}static ph(t){const e=Object.create(ic.prototype);return e.aw=t,e}}class oc{yw;constructor(t,e,n){this.yw=new ca.fu.Hc(t,e,n)}get gw(){return this.yw.gw}set gw(t){this.yw.gw=t}get bw(){return this.yw.bw}set bw(t){this.yw.bw=t}get mw(){return this.yw.mw}set mw(t){this.yw.mw=t}toJSON(){return this.yw.toJSON()}static ph(t){const e=Object.create(oc.prototype);return e.yw=t,e}}class sc{Iw;constructor(t,e){const n=Object.keys(t),r=[];for(const e of n){if(null==t[e])throw new Error(`Localization cannot be undefined (${e})`);r.push([e,t[e].yw])}this.Iw=new ca.fu._c(r,e)}get kw(){return this.Iw.kw}set kw(t){this.Iw.kw=t}get Tw(){const t={},e=this.Iw.Tw;for(const[n,r]of e)t[n]=oc.ph(r);return t}set Tw(t){const e=Object.keys(t),n=[];for(const r of e){if(null==t[r])throw new Error(`Localization cannot be undefined (${r})`);n.push([r,t[r].yw])}this.Iw.Tw=n}static ph(t){const e=Object.create(sc.prototype);return e.Iw=t,e}}class ac{Aw;constructor(t){this.Aw=t}static Bw(t){return new ac(ca.fu.Sa.Bw(t.toString()))}Ew(){return this.Aw.Ew()}Rw(){const t=this.Aw.Rw();return Array.isArray(t)?t.map(t=>({step:BigInt(t.step),Od:BigInt(t.Od)})):t}static Pw(t,e){return new ac(ca.fu.Sa.Pw(t.toString(),e.toString()))}static Nw(t,e,n,r,i,o,s,a){return new ac(ca.fu.Sa.Nw(t,e,n,o?.toString(),s,r?.toString(),i?.toString(),a?.toString()))}static xw(t){return new ac(ca.fu.Sa.xw(t.map(t=>({step:t.step.toString(),Od:t.Od.toString()}))))}static $w(t,e,n,r,i,o){return new ac(ca.fu.Sa.$w(t,e.toString(),r?.toString(),n.toString(),i?.toString(),o?.toString()))}static Uw(t,e,n,r,i,o,s,a,c){return new ac(ca.fu.Sa.Uw(t,e.toString(),n,r.toString(),i,s?.toString(),o.toString(),a?.toString(),c?.toString()))}static Sw(t,e,n,r,i,o,s,a,c){return new ac(ca.fu.Sa.Sw(t.toString(),e.toString(),n,r.toString(),i,s?.toString(),o.toString(),a?.toString(),c?.toString()))}static Cw(t,e,n,r,i,o,s,a,c){return new ac(ca.fu.Sa.Cw(t,e.toString(),n.toString(),r.toString(),i,s?.toString(),o.toString(),a?.toString(),c?.toString()))}static Gw(t,e,n,r,i,o,s,a,c){return new ac(ca.fu.Sa.Gw(t,e.toString(),n.toString(),r.toString(),i,s?.toString(),o.toString(),a?.toString(),c?.toString()))}static ph(t){return new ac(t)}}class cc{Vw;constructor(t){this.Vw=t}getType(){return this.Vw.getType()}jd(){const t=this.Vw.jd();if(void 0!==t)return Ea.ph(t)}static Bu(){return new cc(ca.fu.qc.Bu())}static iw(t){return new cc(ca.fu.qc.iw(Ca(t)))}static Kw(){return new cc(ca.fu.qc.Kw())}static ph(t){return new cc(t)}}class lc{Ow;constructor(t){this.Ow=t}Fw(){const t=this.Ow.Fw(),e="number"==typeof t.interval?t.interval:BigInt(t.interval);let n;return n=t instanceof ca.fu.Ia?"BlockBasedDistribution":t instanceof ca.fu.Vc?"TimeBasedDistribution":"EpochBasedDistribution",{interval:e,Ww:ac.ph(t.Ww),Dw:n}}static _w(t,e){return new lc(ca.fu.Rc._w(t.toString(),e.Aw))}static Hw(t,e){return new lc(ca.fu.Rc.Hw(t.toString(),e.Aw))}static jw(t,e){return new lc(ca.fu.Rc.jw(t,e.Aw))}static ph(t){return new lc(t)}}class uc{Mw;constructor(t,e){this.Mw=new ca.fu.nl(t.Ow,e.Vw)}get Dw(){return lc.ph(this.Mw.Dw)}set Dw(t){this.Mw.Dw=t.Ow}get Lw(){return cc.ph(this.Mw.Lw)}set Lw(t){this.Mw.Lw=t.Vw}static ph(t){const e=Object.create(uc.prototype);return e.Mw=t,e}}function hc(t){const e=Object.keys(t),n=[];for(const r of e){const e=Object.keys(t[r]),i=[];for(const n of e)i.push([Ca(n),t[r][n].toString()]);n.push([r,i])}return n}class fc{Zw;constructor(t){this.Zw=new ca.fu.rl(hc(t))}get qw(){const t=this.Zw.qw,e={};for(const[n,r]of t){const t={};for(const[e,n]of r)t[e.Ph()]=BigInt(n);e[n]=t}return e}set qw(t){this.Zw.qw=hc(t)}static ph(t){const e=Object.create(fc.prototype);return e.Zw=t,e}}class dc{Yw;constructor(t,e,n,r,i,o,s,a){this.Yw=new ca.fu.Yc(o?.Mw,t.aw,s?.Zw,null!=a?Ca(a):void 0,e.aw,n,r?.aw,i?.aw)}get zw(){const t=this.Yw.zw;if(null!=t)return uc.ph(t)}set zw(t){this.Yw.zw=t.Mw}get Xw(){return ic.ph(this.Yw.Xw)}set Xw(t){this.Yw.Xw=t.aw}get Jw(){const t=this.Yw.Jw;if(null!=t)return fc.ph(t)}set Jw(t){this.Yw.Jw=t.Zw}get Qw(){const t=this.Yw.Qw;if(null!=t)return Ea.ph(t)}set Qw(t){this.Yw.Qw=null!=t?Ca(t):void 0}get tp(){return ic.ph(this.Yw.tp)}set tp(t){this.Yw.tp=t.aw}get ep(){return this.Yw.ep}set ep(t){this.Yw.ep=t}get np(){return ic.ph(this.Yw.np)}set np(t){this.Yw.np=t.aw}get rp(){return ic.ph(this.Yw.rp)}set rp(t){this.Yw.rp=t.aw}static ph(t){const e=Object.create(dc.prototype);return e.Yw=t,e}}class wc{ww;constructor(t,e){const n=Object.keys(t),r=[];for(const e of n)r.push([Ua(e),t[e]]);this.ww=new ca.fu.La(r,e)}get ip(){const t=this.ww.ip,e={};for(const[n,r]of t)e[n.Ph()]=r;return e}set ip(t){const e=Object.keys(t),n=[];for(const r of e)n.push([Ua(r),t[r]]);this.ww.ip=n}get op(){return this.ww.op}set op(t){this.ww.op=t}sp(t,e){this.ww.sp(Ca(t),e)}static ph(t){const e=Object.create(wc.prototype);return e.ww=t,e}}class pc{ap;constructor(t,e,n,r,i,o){this.ap=new ca.fu.Jc(t,e,n,r,i,o)}get cp(){return this.ap.cp}set cp(t){this.ap.cp=t}get lp(){return this.ap.lp}set lp(t){this.ap.lp=t}get up(){return this.ap.up}set up(t){this.ap.up=t}get hp(){return this.ap.hp}set hp(t){this.ap.hp=t}get fp(){return this.ap.fp}set fp(t){this.ap.fp=t}get dp(){return this.ap.dp}set dp(t){this.ap.dp=t}static ph(t){const e=Object.create(pc.prototype);return e.ap=t,e}}class yc{wp;constructor(t){this.wp=t}jd(){return this.wp.jd()}static pp(){return yc.ph(ca.fu.al.pp())}static ph(t){return new yc(t)}}class gc{yp;constructor(t,e){this.yp=new ca.fu.Qc(t.wp,e.aw)}get gp(){return yc.ph(this.yp.gp)}set gp(t){this.yp.gp=t.wp}get bp(){return ic.ph(this.yp.bp)}set bp(t){this.yp.bp=t.aw}static ph(t){const e=Object.create(gc.prototype);return e.yp=t,e}}class bc{mp;constructor(t){this.mp=t}vp(){return this.mp.vp()}getItem(){const t=this.mp.getItem();return t instanceof ca.fu._c?sc.ph(t):t instanceof ca.fu.ba?rc.ph(t):t instanceof ca.fu.nl?uc.ph(t):t instanceof ca.fu.al?yc.ph(t):t instanceof ca.fu.qa?Ea.ph(t):"string"==typeof t&&"MaxSupply"===this.mp.vp()?BigInt(t):t}static Ip(t){return new bc(ca.fu.Dc.Ip(t.Iw))}static kp(t){return new bc(ca.fu.Dc.kp(t.ew))}static Tp(t){return new bc(ca.fu.Dc.Tp(t.ew))}static Ap(t){return new bc(ca.fu.Dc.Ap(t.ew))}static Bp(t){return new bc(ca.fu.Dc.Bp(t.ew))}static Ep(t){return new bc(ca.fu.Dc.Ep(t.ew))}static Rp(t){return new bc(ca.fu.Dc.Rp(t.ew))}static Pp(t){return new bc(ca.fu.Dc.Pp(t.ew))}static Np(t){return new bc(ca.fu.Dc.Np(t.ew))}static xp(t){return new bc(ca.fu.Dc.xp(t))}static $p(t){return new bc(ca.fu.Dc.$p(t.ew))}static Up(t){return new bc(ca.fu.Dc.Up(t.ew))}static Sp(t){return new bc(ca.fu.Dc.Sp(t.ew))}static Cp(t){return new bc(ca.fu.Dc.Cp(t.ew))}static Gp(t){return new bc(ca.fu.Dc.Gp(t.wp))}static Vp(t){return new bc(ca.fu.Dc.Vp(t.ew))}static Kp(t){return new bc(ca.fu.Dc.Kp(t.ew))}static Op(t){return new bc(ca.fu.Dc.Op(t?.toString()))}static Fp(t){return new bc(ca.fu.Dc.Fp(t.ew))}static Wp(t){return new bc(ca.fu.Dc.Wp(t.ew))}static Dp(t){return new bc(ca.fu.Dc.Dp(t))}static _p(t){return new bc(ca.fu.Dc._p(t.ew))}static Hp(t){return new bc(ca.fu.Dc.Hp(t.ew))}static jp(t){return new bc(ca.fu.Dc.jp(null!=t?Ca(t):void 0))}static Mp(t){return new bc(ca.fu.Dc.Mp(t.ew))}static Lp(t){return new bc(ca.fu.Dc.Lp(t.ew))}static Zp(){return new bc(ca.fu.Dc.Zp())}static qp(t){return new bc(ca.fu.Dc.qp(t?.Mw))}static Yp(t){return new bc(ca.fu.Dc.Yp(t.ew))}static zp(t){return new bc(ca.fu.Dc.zp(t.ew))}static Xp(t){return new bc(ca.fu.Dc.Xp(t.ew))}static Jp(t){return new bc(ca.fu.Dc.Jp(t.ew))}static ph(t){return new bc(t)}}class mc{Qp;constructor(t,e,n,r,i,o,s,a,c,l,u,h,f,d,w,p,y,g,b){this.Qp=new ca.fu.jc(t.Iw,e.aw,n.toString(),y?.toString(),r.ap,i,o,s.aw,a.Yw,c.yp,l.aw,u.aw,h.aw,f.aw,d.aw,w.aw,g,p?.ew,b)}get ty(){return sc.ph(this.Qp.ty)}set ty(t){this.Qp.ty=t.Iw}get ey(){return ic.ph(this.Qp.ey)}set ey(t){this.Qp.ey=t.aw}get ny(){return BigInt(this.Qp.ny)}set ny(t){this.Qp.ny=t.toString()}get iy(){return pc.ph(this.Qp.iy)}set iy(t){this.Qp.iy=t.ap}get oy(){return this.Qp.oy}set oy(t){this.Qp.oy=t}get sy(){return this.Qp.sy}set sy(t){this.Qp.sy=t}get ly(){const t=this.Qp.ly;return null!=t?BigInt(t):void 0}set ly(t){this.Qp.ly=t?.toString()}get uy(){return ic.ph(this.Qp.uy)}set uy(t){this.Qp.uy=t.aw}get hy(){return dc.ph(this.Qp.hy)}set hy(t){this.Qp.hy=t.Yw}get wy(){return gc.ph(this.Qp.wy)}set wy(t){this.Qp.wy=t.yp}get py(){return ic.ph(this.Qp.py)}set py(t){this.Qp.py=t.aw}get yy(){return ic.ph(this.Qp.yy)}set yy(t){this.Qp.yy=t.aw}get gy(){return ic.ph(this.Qp.gy)}set gy(t){this.Qp.gy=t.aw}get by(){return ic.ph(this.Qp.by)}set by(t){this.Qp.by=t.aw}get my(){return ic.ph(this.Qp.my)}set my(t){this.Qp.my=t.aw}get vy(){return ic.ph(this.Qp.vy)}set vy(t){this.Qp.vy=t.aw}get Iy(){return this.Qp.Iy??void 0}set Iy(t){this.Qp.Iy=t}get ky(){return rc.ph(this.Qp.ky)}set ky(t){this.Qp.ky=t.ew}get description(){return this.Qp.description??void 0}set description(t){this.Qp.description=t}static Ty(t,e){return Ea.ph(ca.fu.jc.Ty(Ca(t),e))}static ph(t){const e=Object.create(mc.prototype);return e.Qp=t,e}}class vc{Ay;constructor(t,e,n,r,i,o,s){let a;if(null!=i){a=[];for(const t of i)a.push([t.position,t.By.Qp])}this.Ay=new ca.fu.$a(Ca(t),e.toString(),Ua(n),Ua(r),a,o,Ua(s))}get Ey(){return this.Ay.Ey}set Ey(t){this.Ay.Ey=t}get version(){return this.Ay.version}set version(t){this.Ay.version=t}get id(){return Ea.ph(this.Ay.id)}set id(t){this.Ay.id=Ca(t)}get Ry(){return Ea.ph(this.Ay.Ry)}set Ry(t){this.Ay.Ry=Ca(t)}get Py(){return this.Ay.Py.map(([t,e])=>({position:t,By:mc.ph(e)}))}set Py(t){let e;if(null!=t){e=[];for(const n of t)e.push([n.position,n.By.Qp])}this.Ay.Py=e}get groups(){return this.Ay.groups.map(([t,e])=>({position:t,group:wc.ph(e)}))}set groups(t){this.Ay.groups=t.map(({group:t,position:e})=>[e,t.ww])}get description(){return this.Ay.description??void 0}set description(t){this.Ay.description=t}get Ny(){return this.Ay.Ny}set Ny(t){this.Ay.Ny=t}xy(){return Sa(this.Ay.xy(),!0)}$y(){return Sa(this.Ay.$y())}Uy(t,e){this.Ay.Uy(Ua(t),Ua(e))}bytes(t){return this.Ay.bytes(Ua(t))}Ih(t){return this.Ay.Ih(Ua(t))}mh(t){return this.Ay.mh(Ua(t))}toJSON(t){return this.Ay.ke(Ua(t))}Sy(t){return Sa(this.Ay.Sy(Ua(t)))}static Cy(t,e,n){return vc.ph(ca.fu.$a.Cy(Ua(t),e,Ua(n)))}static kh(t,e,n){return vc.ph(ca.fu.$a.kh(t,e,Ua(n)))}static fromHex(t,e,n){return vc.ph(ca.fu.$a.fromHex(t,e,Ua(n)))}static fromBase64(t,e,n){return vc.ph(ca.fu.$a.fromBase64(t,e,Ua(n)))}static Gy(t,e){return Ea.ph(ca.fu.$a.Gy(Ca(t),e.toString()))}static ph(t){const e=Object.create(vc.prototype);return e.Ay=t,e}}class Ic{Vy;constructor(t,e,n){this.Vy=new ca.fu.xa(t.Ay,e.toString(),Ua(n))}get Ky(){return this.Vy.Ky}get mr(){return BigInt(this.Vy.mr)}Oy(t){return this.Vy.Oy(t)}Fy(t,e){this.Vy.Fy(t.Ay,Ua(e))}Zo(t,e){return vc.ph(this.Vy.Zo(Ua(t),e))}bytes(){return this.Vy.bytes()}Ih(){return this.Vy.Ih()}mh(){return this.Vy.mh()}Bd(){return ja.ph(this.Vy.Bd())}static kh(t){return Ic.ph(ca.fu.xa.kh(t))}static fromHex(t){return Ic.ph(ca.fu.xa.fromHex(t))}static fromBase64(t){return Ic.ph(ca.fu.xa.fromBase64(t))}static Ed(t){return Ic.ph(ca.fu.xa.Ed(t.qf))}static ph(t){const e=Object.create(Ic.prototype);return e.Vy=t,e}}class kc{Wy;constructor(t,e,n){this.Wy=new ca.fu.Ua(t.Ay,e.toString(),Ua(n))}get Ky(){return this.Wy.Ky}get vr(){return BigInt(this.Wy.vr)}Oy(t){return this.Wy.Oy(t)}Fy(t,e){this.Wy.Fy(t.Ay,Ua(e))}Zo(t,e){return vc.ph(this.Wy.Zo(t,Ua(e)))}bytes(){return this.Wy.bytes()}Ih(){return this.Wy.Ih()}mh(){return this.Wy.mh()}Bd(){return ja.ph(this.Wy.Bd())}static kh(t){return kc.ph(ca.fu.Ua.kh(t))}static fromHex(t){return kc.ph(ca.fu.Ua.fromHex(t))}static fromBase64(t){return kc.ph(ca.fu.Ua.fromBase64(t))}static Ed(t){return kc.ph(ca.fu.Ua.Ed(t.qf))}static ph(t){const e=Object.create(kc.prototype);return e.Wy=t,e}}class Tc{Dy;constructor(t,e,n,r,i,o,s){this.Dy=new ca.fu.Ka(Ua(t),e,n.toString(),Ca(r),Ca(i),null!=o?Ca(o):void 0,null!=s?Ca(s):void 0)}get id(){return Ea.ph(this.Dy.id)}set id(t){this.Dy.id=Ca(t)}get _y(){return this.Dy._y??void 0}set _y(t){this.Dy._y=t}get _r(){return Ea.ph(this.Dy._r)}set _r(t){this.Dy._r=Ca(t)}get Ry(){return Ea.ph(this.Dy.Ry)}set Ry(t){this.Dy.Ry=Ca(t)}get properties(){return Sa(this.Dy.properties,!0)}set properties(t){this.Dy.properties=Ua(t)}get kr(){const t=this.Dy.kr;return null!=t?BigInt(t):void 0}set kr(t){this.Dy.kr=t?.toString()}get Hy(){const t=this.Dy.Hy;if(null!=t)return BigInt(t)}set Hy(t){t instanceof Date?this.Dy.Hy=t.getTime().toString():this.Dy.Hy=null==t?void 0:t.toString()}get jy(){const t=this.Dy.jy;if(null!=t)return BigInt(t)}set jy(t){t instanceof Date?this.Dy.jy=t.getTime().toString():this.Dy.jy=null==t?void 0:t.toString()}get My(){const t=this.Dy.My;if(null!=t)return BigInt(t)}set My(t){t instanceof Date?this.Dy.My=t.getTime().toString():this.Dy.My=null==t?void 0:t.toString()}get Ly(){const t=this.Dy.Ly;if(null!=t)return BigInt(t)}set Ly(t){this.Dy.Ly=t?.toString()}get Zy(){const t=this.Dy.Ly;if(null!=t)return BigInt(t)}set Zy(t){this.Dy.Ly=t?.toString()}get qy(){const t=this.Dy.Ly;if(null!=t)return BigInt(t)}set qy(t){this.Dy.Ly=t?.toString()}get Yy(){return this.Dy.Yy??void 0}set Yy(t){this.Dy.Yy=t}get zy(){return this.Dy.zy??void 0}set zy(t){this.Dy.Yy=t}get Xy(){return this.Dy.Xy??void 0}set Xy(t){this.Dy.Yy=t}get Vr(){return this.Dy.Vr}set Vr(t){this.Dy.Vr=t}get Jy(){const t=this.Dy.Jy;if(null!=t)return Ea.ph(t)}set Jy(t){this.Dy.Jy=Ca(t)}bytes(t,e){return this.Dy.bytes(t.Ay,Ua(e))}Ih(t,e){return this.Dy.Ih(t.Ay,Ua(e))}mh(t,e){return this.Dy.mh(t.Ay,Ua(e))}static kh(t,e,n,r){return Tc.ph(ca.fu.Ka.kh(t,e.Ay,n,Ua(r)))}static fromHex(t,e,n,r){return Tc.ph(ca.fu.Ka.fromHex(t,e.Ay,n,Ua(r)))}static fromBase64(t,e,n,r){return Tc.ph(ca.fu.Ka.fromBase64(t,e.Ay,n,Ua(r)))}static Gy(t,e,n,r){return Ea.ph(ca.fu.Ka.Gy(t,Ca(e),Ca(n),r))}static ph(t){const e=Object.create(Tc.prototype);return e.Dy=t,e}}class Ac{Qy;constructor(t,e,n,r,i){this.Qy=new ca.fu.el(null!=t?Ca(t):void 0,e,n?.toString(),r?.toString(),Ua(i))}get tg(){const t=this.Qy.tg;if(null!=t)return Ea.ph(t)}set tg(t){this.Qy.tg=null!=t?Ca(t):void 0}get po(){return this.Qy.po}set po(t){this.Qy.po=t}get eg(){const t=this.Qy.eg;if(null!=t)return BigInt(t)}set eg(t){this.Qy.eg=t?.toString()}get ng(){const t=this.Qy.ng;if(null!=t)return BigInt(t)}set ng(t){this.Qy.ng=t?.toString()}get rg(){return this.Qy.rg}set rg(t){this.Qy.rg=Ua(t)}static ig(t){const e=Object.create(Ac.prototype);return e.Qy=t,e}}class Bc{og;constructor(t,e,n,r,i){this.og=new ca.fu.Ca(Ca(t),e?.toString(),n,Ca(r),i?.Qy)}get id(){return Ea.ph(this.og.id)}set id(t){this.og.id=Ca(t)}get vr(){return BigInt(this.og.vr)}set vr(t){this.og.vr=t?.toString()}get _r(){return Ea.ph(this.og._r)}set _r(t){this.og._r=Ca(t)}get Vr(){return this.og.Vr}set Vr(t){this.og.Vr=t}get sg(){const t=this.og.sg;if(null!=t)return Ac.ig(t)}set sg(t){null!=t?this.og.sg=t.Qy:this.og.ag()}static ph(t){const e=Object.create(Bc.prototype);return e.og=t,e}}class Ec{cg;constructor(t,e){this.cg=new ca.fu.kc(t,e?.toString())}get oi(){return this.cg.oi}get $i(){return BigInt(this.cg.$i)}static ph(t){const e=Object.create(Ec.prototype);return e.cg=t,e}}class Rc{lg;constructor(t,e,n){this.lg=new ca.fu.Fa(t.Dy,e.toString(),n?.Qy)}get data(){return Sa(this.lg.data,!0)}set data(t){this.lg.data=Ua(t)}get ug(){return Bc.ph(this.lg.ug)}set ug(t){this.lg.ug=t.og}get kr(){return BigInt(this.lg.kr)}set kr(t){this.lg.kr=t.toString()}hg(){return Uc.ph(this.lg.hg())}static fg(t){return Rc.ph(ca.fu.Fa.fg(t.dg))}static ph(t){const e=Object.create(Rc.prototype);return e.lg=t,e}}class Pc{wg;constructor(t,e,n){this.wg=new ca.fu.Va(t.Dy,e?.toString(),n?.Qy)}get ug(){return Bc.ph(this.wg.ug)}set ug(t){this.wg.ug=t.og}hg(){return Uc.ph(this.wg.hg())}static fg(t){return Pc.ph(ca.fu.Va.fg(t.dg))}static ph(t){const e=Object.create(Pc.prototype);return e.wg=t,e}}class Nc{pg;constructor(t,e,n,r){this.pg=new ca.fu.Oa(t.Dy,e.toString(),n.toString(),r?.Qy)}get ug(){return Bc.ph(this.pg.ug)}set ug(t){this.pg.ug=t.og}get mo(){return BigInt(this.pg.mo)}set mo(t){this.pg.mo=t.toString()}get kr(){return BigInt(this.pg.kr)}set kr(t){this.pg.kr=t.toString()}hg(){return Uc.ph(this.pg.hg())}static fg(t){return Nc.ph(ca.fu.Oa.fg(t.dg))}static ph(t){const e=Object.create(Nc.prototype);return e.pg=t,e}}class xc{yg;constructor(t,e,n,r){this.yg=new ca.fu.Wa(t.Dy,e.toString(),Ca(n),r?.Qy)}get ug(){return Bc.ph(this.yg.ug)}set ug(t){this.yg.ug=t.og}get Vd(){return Ea.ph(this.yg.Vd)}set Vd(t){this.yg.Vd=Ca(t)}hg(){return Uc.ph(this.yg.hg())}static fg(t){return xc.ph(ca.fu.Wa.fg(t.dg))}static ph(t){const e=Object.create(xc.prototype);return e.yg=t,e}}class $c{gg;constructor(t,e,n,r){this.gg=new ca.fu._a(t.Dy,e.toString(),n.toString(),r?.Qy)}get ug(){return Bc.ph(this.gg.ug)}set ug(t){this.gg.ug=t.og}get mo(){return BigInt(this.gg.mo)}set mo(t){this.gg.mo=t.toString()}hg(){return Uc.ph(this.gg.hg())}static fg(t){return $c.ph(ca.fu._a.fg(t.dg))}static ph(t){const e=Object.create($c.prototype);return e.gg=t,e}}class Uc{dg;constructor(t){this.dg=t.hg().dg}get bg(){return this.dg.bg}get mg(){return this.dg.mg}get _r(){return Ea.ph(this.dg._r)}set _r(t){this.dg._r=Ca(t)}get id(){return Ea.ph(this.dg.id)}get Vr(){return this.dg.Vr}get vr(){return BigInt(this.dg.vr)}set vr(t){this.dg.vr=t.toString()}get kr(){const t=this.dg.kr;if(null!=t)return BigInt(t)}set kr(t){this.dg.kr=t.toString()}get _y(){return this.dg._y??void 0}get vg(){return Sc.ph(this.dg.vg)}get Ig(){return Pc.ph(this.dg.Ig)}get kg(){return Nc.ph(this.dg.kg)}get Tg(){return Rc.ph(this.dg.Tg)}get Ag(){return xc.ph(this.dg.Ag)}get Bg(){return $c.ph(this.dg.Bg)}Eg(){return!0}static ph(t){const e=Object.create(Uc.prototype);return e.dg=t,e}}class Sc{Rg;constructor(t,e,n,r){this.Rg=new ca.fu.Ga(t.Dy,e.toString(),n?.cg,r?.Qy)}get data(){return Sa(this.Rg.data,!0)}set data(t){this.Rg.data=Ua(t)}get ug(){return Bc.ph(this.Rg.ug)}set ug(t){this.Rg.ug=t.og}get _y(){return this.Rg._y}set _y(t){this.Rg._y=t}get Pg(){const t=this.Rg.Pg;if(null!=t)return Ec.ph(t)}set Pg(t){null!=t?this.Rg.Pg=t.cg:this.Rg.Ng()}Ng(){this.Rg.Ng()}hg(){return Uc.ph(this.Rg.hg())}static fg(t){return Sc.ph(ca.fu.Ga.fg(t.dg))}static ph(t){const e=Object.create(Sc.prototype);return e.Rg=t,e}}class Cc{xg;constructor(t){return"bigint"==typeof t?Cc.$g(t):Cc.Ug(t)}Sg(){return this.xg.Sg()}jd(){const t=this.xg.jd();if("string"==typeof t)return BigInt(t);{const e=Sa(t);for(const t of Object.keys(e))e[t]=BigInt(e[t]);return e}}static $g(t){return Cc.ph(ca.fu.il.$g(t.toString()))}static Ug(t){return Cc.ph(ca.fu.il.Ug(Ua(t)))}static ph(t){const e=Object.create(Cc.prototype);return e.xg=t,e}}class Gc{Cg;constructor(t,e,n,r,i){this.Cg=new ca.fu.Kc(t.toString(),e,Ca(n),Ca(r),i?.gd)}get vr(){return BigInt(this.Cg.vr)}set vr(t){this.Cg.vr=t.toString()}get po(){return this.Cg.po}set po(t){this.Cg.po=t}get _r(){return Ea.ph(this.Cg._r)}set _r(t){this.Cg._r=Ca(t)}get fo(){return Ea.ph(this.Cg.fo)}set fo(t){this.Cg.fo=Ca(t)}get Gg(){const t=this.Cg.Gg;if(null!=t)return Za.ph(t)}set Gg(t){this.Cg.Gg=t?.gd}static ph(t){const e=Object.create(Gc.prototype);return e.Cg=t,e}}class Vc{dg;constructor(t,e,n){this.dg=new ca.fu.Wc(t.Cg,e.mp,n)}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get Vg(){return this.dg.Vg??void 0}set Vg(t){this.dg.Vg=t}get Kg(){return bc.ph(this.dg.Kg)}set Kg(t){this.dg.Kg=t.mp}static ph(t){const e=Object.create(Vc.prototype);return e.dg=t,e}}class Kc{dg;constructor(t,e,n){this.dg=new ca.fu.Zc(t.Cg,e.toString(),n.toString())}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get Og(){return BigInt(this.dg.Og)}set Og(t){this.dg.Og=t.toString()}get Fg(){return BigInt(this.dg.Fg)}set Fg(t){this.dg.Fg=t.toString()}static ph(t){const e=Object.create(Kc.prototype);return e.dg=t,e}}class Oc{dg;constructor(t,e,n){this.dg=new ca.fu.ol(t.Cg,e?.xg,n)}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get mo(){const t=this.dg.mo;if(null!=t)return Cc.ph(t)}set mo(t){this.dg.mo=t?.xg}get Vg(){return this.dg.Vg??void 0}set Vg(t){this.dg.Vg=t}static ph(t){const e=Object.create(Oc.prototype);return e.dg=t,e}}class Fc{dg;constructor(t,e,n){this.dg=new ca.fu.Oc(t.Cg,e.toString(),n)}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get Wg(){return BigInt(this.dg.Wg)}set Wg(t){this.dg.Wg=t.toString()}get Vg(){return this.dg.Vg??void 0}set Vg(t){this.dg.Vg=t}static ph(t){const e=Object.create(Fc.prototype);return e.dg=t,e}}class Wc{dg;constructor(t,e,n){this.dg=new ca.fu.Fc(t.Cg,Ua(e),n)}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get Dw(){return this.dg.Dw}set Dw(t){this.dg.Dw=Ua(t)}get Vg(){return this.dg.Vg??void 0}set Vg(t){this.dg.Vg=t}static ph(t){const e=Object.create(Wc.prototype);return e.dg=t,e}}class Dc{dg;constructor(t,e,n){this.dg=new ca.fu.Lc(t.Cg,Ca(e),n)}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get Dg(){return Ea.ph(this.dg.Dg)}set Dg(t){this.dg.Dg=Ca(t)}get Vg(){return this.dg.Vg??void 0}set Vg(t){this.dg.Vg=t}static ph(t){const e=Object.create(Dc.prototype);return e.dg=t,e}}class _c{dg;constructor(t,e,n){this.dg=new ca.fu.zc(t.Cg,Ua(e),n)}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get _g(){return this.dg._g}set _g(t){this.dg._g=Ua(t)}get Vg(){return this.dg.Vg??void 0}set Vg(t){this.dg.Vg=t}static ph(t){const e=Object.create(_c.prototype);return e.dg=t,e}}class Hc{dg;constructor(t,e,n){this.dg=new ca.fu.Xc(t.Cg,Ca(e),n)}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get Dg(){return Ea.ph(this.dg.Dg)}set Dg(t){this.dg.Dg=Ca(t)}get Vg(){return this.dg.Vg??void 0}set Vg(t){this.dg.Vg=t}static ph(t){const e=Object.create(Hc.prototype);return e.dg=t,e}}class jc{dg;constructor(t,e,n,r){this.dg=new ca.fu.tl(t.Cg,null!=e?Ca(e):void 0,n.toString(),r)}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get Hg(){const t=this.dg.Hg;if(null!=t)return Ea.ph(t)}set Hg(t){this.dg.Hg=null!=t?Ca(t):void 0}get Od(){return BigInt(this.dg.Od)}set Od(t){this.dg.Od=t.toString()}get Vg(){return this.dg.Vg??void 0}set Vg(t){this.dg.Vg=t}static ph(t){const e=Object.create(jc.prototype);return e.dg=t,e}}class Mc{dg;constructor(t,e,n,r,i,o){this.dg=new ca.fu.cl(t.Cg,Ca(e),n.toString(),r,i?.wd,o?.hd)}get Vd(){return Ea.ph(this.dg.Vd)}set Vd(t){this.dg.Vd=Ca(t)}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get Od(){return BigInt(this.dg.Od)}set Od(t){this.dg.Od=t.toString()}get Vg(){return this.dg.Vg??void 0}set Vg(t){this.dg.Vg=t}get jg(){const t=this.dg.jg;if(null!=t)return La.ph(t)}set jg(t){this.dg.jg=t?.wd}get Mg(){const t=this.dg.Mg;if(null!=t)return Ma.ph(t)}set Mg(t){this.dg.Mg=t?.hd}static ph(t){const e=Object.create(Mc.prototype);return e.dg=t,e}}class Lc{dg;constructor(t,e,n){this.dg=new ca.fu.ul(t.Cg,Ca(e),n)}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get Dg(){return Ea.ph(this.dg.Dg)}set Dg(t){this.dg.Dg=Ca(t)}get Vg(){return this.dg.Vg??void 0}set Vg(t){this.dg.Vg=t}static ph(t){const e=Object.create(Lc.prototype);return e.dg=t,e}}class Zc{Lg;constructor(t){this.Lg=new ca.fu.ll(t.dg)}get vr(){return BigInt(this.Lg.vr)}set vr(t){this.Lg.vr=t.toString()}get fo(){return Ea.ph(this.Lg.fo)}set fo(t){this.Lg.fo=Ca(t)}get gr(){return Ea.ph(this.Lg.gr)}set gr(t){this.Lg.gr=Ca(t)}Zg(){const t=this.Lg.Zg();return t instanceof ca.fu.Oc?Fc.ph(t):t instanceof ca.fu.Fc?Wc.ph(t):t instanceof ca.fu.Wc?Vc.ph(t):t instanceof ca.fu.Lc?Dc.ph(t):t instanceof ca.fu.Zc?Kc.ph(t):t instanceof ca.fu.zc?_c.ph(t):t instanceof ca.fu.Xc?Hc.ph(t):t instanceof ca.fu.tl?jc.ph(t):t instanceof ca.fu.ol?Oc.ph(t):t instanceof ca.fu.cl?Mc.ph(t):Lc.ph(t)}qg(){return this.Lg.qg()}Yg(){return this.Lg.Yg()}zg(){return this.Lg.zg()}Xg(t){return Ea.ph(this.Lg.Xg(Ca(t)))}Eg(){return!1}static ph(t){const e=Object.create(Zc.prototype);return e.Lg=t,e}}class qc{dg;constructor(t){let e;e=t instanceof Uc?new ca.fu.ma(t.dg):new ca.fu.ma(t.Lg),this.dg=e}get _r(){return Ea.ph(this.dg._r)}set _r(t){this.dg._r=Ca(t)}Jg(){const t=this.dg.Jg();return t instanceof ca.fu.Da?Uc.ph(t):Zc.ph(t)}static ph(t){const e=Object.create(qc.prototype);return e.dg=t,e}}class Yc{Qg;constructor(t,e,n,r,i){if(0===t.length)throw new Error("transitions array must not be empty");const[o]=t;this.Qg=o instanceof qc?ca.fu.va.tb(t.map(t=>t.dg),Ca(e),n,r,i):ca.fu.va.eb(t.map(t=>t.dg),Ca(e),n,r,i)}get nb(){return this.Qg.nb.map(qc.ph)}set nb(t){this.Qg.nb=t.map(t=>t.dg)}get signature(){return this.Qg.signature}set signature(t){this.Qg.signature=t}get Yf(){return this.Qg.Yf}set Yf(t){this.Qg.Yf=t}get rb(){const t=this.Qg.rb;if(null!=t)return BigInt(t)}get Ry(){return Ea.ph(this.Qg.Ry)}get tw(){return this.Qg.tw.map(Ea.ph)}get ib(){const t=this.Qg.ib;if(null!=t)return BigInt(t)}ad(t){this.Qg.ad(t.toString())}bytes(){return this.Qg.bytes()}Ih(){return this.Qg.Ih()}mh(){return this.Qg.mh()}Bd(){return ja.ph(this.Qg.Bd())}static tb(t,e,n,r,i){return Yc.ph(ca.fu.va.tb(t.map(t=>t.dg),Ca(e),n,r,i))}static eb(t,e,n,r,i){return Yc.ph(ca.fu.va.eb(t.map(t=>t.dg),Ca(e),n,r,i))}static kh(t){return Yc.ph(ca.fu.va.kh(t))}static fromBase64(t){return Yc.ph(ca.fu.va.fromBase64(t))}static fromHex(t){return Yc.ph(ca.fu.va.fromHex(t))}static Ed(t){return Yc.ph(ca.fu.va.Ed(t.qf))}static ph(t){const e=Object.create(Yc.prototype);return e.Qg=t,e}}function zc(t){return t.map(t=>({nonce:t.nonce,address:$a.ph(t.address),balance:null!=t.$i?BigInt(t.$i):void 0}))}function Xc(t){return t.map(t=>({id:Ea.ph(t.id),document:null!=t.document?Tc.ph(t.document):void 0}))}function Jc(t){return{ob:BigInt(t.ob),sb:t.sb,ab:BigInt(t.ab),cb:t.cb}}function Qc(t){return{type:t.type,value:null!=t.value?Jc(t.value):void 0}}function tl(t){const[e,n]=t;if(e instanceof ca.fu.Gc)return{lb:Qc(e),ub:zc(n)};if(e instanceof ca.fu.ec)return{identity:Wa.ph(e),hb:n};if(Array.isArray(e)&&Array.isArray(n)){const t=n[0];return null!=t&&t instanceof ca.fu.bl?{hb:e,qr:Xc(n)}:{hb:e,ub:null!=t?zc(n):[]}}throw new Error("Unknown tuple type")}function el(t){if(Array.isArray(t)){if(2===t.length){const[e]=t;if(e instanceof ca.fu.Gc||e instanceof ca.fu.ec)return tl(t);if(Array.isArray(e)&&(0===e.length||Array.isArray(e[0])))return tl(t)}const[e]=t;return null!=e&&Array.isArray(e)&&e[0]instanceof Uint8Array?t:function(t){const[e]=t;if(null==e)return[];if(e instanceof ca.fu.oc)return t.map(t=>({id:Ea.ph(t.id),balance:BigInt(t.balance)}));if(e instanceof ca.fu.bl)return Xc(t);if(e instanceof ca.fu.vc)return zc(t);throw new Error("Unknown array type")}(t)}if(t instanceof ca.fu.Gc)return Qc(t);for(const[e,n]of new Map([[ca.fu.$a,t=>vc.ph(t)],[ca.fu.ec,t=>Wa.ph(t)],[ca.fu.qa,t=>Ea.ph(t)],[ca.fu.mc,t=>Ha.ph(t)],[ca.fu.Ka,t=>Tc.ph(t)],[ca.fu.Ll,t=>ec.ph(t)],[ca.fu.oc,t=>({id:Ea.ph(t.id),balance:BigInt(t.balance)})],[ca.fu.Nl,t=>({fo:Ea.ph(t.id),fb:{wb:t.fb.wb}})],[ca.fu.Dl,t=>({fo:Ea.ph(t.id),pb:null!=t.pb?Cc.ph(t.pb):void 0})],[ca.fu.sl,t=>({paused:t.paused})],[ca.fu.yl,t=>({sender:Ha.ph(t.sender),recipient:Ha.ph(t.recipient)})],[ca.fu.Kl,t=>({yb:t.yb,document:null!=t.document?Tc.ph(t.document):void 0})],[ca.fu.Ol,t=>({yb:t.yb,gb:t.gb,Od:null!=t.Od?BigInt(t.Od):void 0})],[ca.fu.Fl,t=>({yb:t.yb,gb:t.gb,fb:null!=t.fb?{wb:t.fb.wb}:void 0})],[ca.fu.Wl,t=>({yb:t.yb,gb:t.gb,pb:null!=t.pb?Cc.ph(t.pb):void 0})],[ca.fu.El,t=>({identity:Wa.ph(t.identity),ub:t.ub.map(t=>({nonce:t.nonce,address:$a.ph(t.address),balance:null!=t.$i?BigInt(t.$i):void 0}))})],[ca.fu.xl,t=>({identity:Ha.ph(t.identity),ub:t.ub.map(t=>({nonce:t.nonce,address:$a.ph(t.address),balance:null!=t.$i?BigInt(t.$i):void 0}))})]]))if(t instanceof e)return n(t);throw new Error(`Unknown result type: ${t?.constructor?.name}`)}ca.hu(sa);const nl={};async function rl(t,e,n){const r=nl[`${e}_${n}`];if(null!=r)return r;const i=`https://${"mainnet"===t?"":"testnet."}platform-explorer.pshenmic.dev/quorum/info?quorumType=${e}&quorumHash=${n}`,o=await fetch(i,{method:"GET"});if(200!==o.status)throw new Error("Failed to query Platform Explorer for quorum public keys");const s=await o.json(),{bb:a}=s;return nl[`${e}_${n}`]=a,a}function il(t){return Array.prototype.map.call(t,t=>("00"+t.toString(16)).slice(-2)).join("")}async function ol(t){if("string"==typeof t){const e=(new TextEncoder).encode(t),n=await crypto.subtle.digest("SHA-256",e);return il(new Uint8Array(n))}{const e=function(t){return t.buffer.slice(t.byteOffset,t.byteLength+t.byteOffset)}(t),n=await crypto.subtle.digest("SHA-256",e);return new Uint8Array(n)}}async function sl(t,e,n,r,i,o){const s=await async function(t,e,n){const r=(new TextEncoder).encode(t),i=r.length+8+4,o=new ArrayBuffer(i),s=new DataView(o),a=new Uint8Array(o);let c=0;return a.set(r,c),c+=r.length,s.setBigUint64(c,e,!0),c+=8,s.setInt32(c,n,!0),await ol(a)}("dpbvote",i,o),a=await async function(t,e,n,r,i,o){const s=(new TextEncoder).encode(t),a=84+s.length,c=new ArrayBuffer(a),l=new DataView(c),u=new Uint8Array(c);let h=0;if(l.setInt32(h,r,!0),h+=4,l.setBigUint64(h,e,!0),h+=8,l.setBigUint64(h,BigInt(n),!0),h+=8,u.set(i,h),h+=32,u.set(o,h),h+=32,84!==h)throw new Error("Invalid input length while encoding sign bytes");return u.set(s,h),await ol(u)}(e,i,o,t.type,t.Po,t.No);return await async function(t,e,n,r){const i=1+e.length+n.length+r.length,o=new Uint8Array(i);let s=0;o[s]=t,s+=1;const a=new Uint8Array(e).reverse();o.set(a,s),s+=e.length;const c=new Uint8Array(n).reverse();o.set(c,s),s+=n.length;const l=new Uint8Array(r).reverse();return o.set(l,s),await ol(await ol(o))}(n,r,s,a)}function al(t,e,n){for(let r=0;r<28;r+=7){const i=t>>>r,o=!(i>>>7==0&&0==e),s=255&(o?128|i:i);if(n.push(s),!o)return}const r=t>>>28&15|(7&e)<<4,i=!!(e>>3);if(n.push(255&(i?128|r:r)),i){for(let t=3;t<31;t+=7){const r=e>>>t,i=!(r>>>7==0),o=255&(i?128|r:r);if(n.push(o),!i)return}n.push(e>>>31&1)}}const cl=4294967296;function ll(t){const e="-"===t[0];e&&(t=t.slice(1));const n=1e6;let r=0,i=0;function o(e,o){const s=Number(t.slice(e,o));i*=n,r=r*n+s,r>=cl&&(i+=r/cl|0,r%=cl)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),e?fl(r,i):hl(r,i)}function ul(t,e){if(({C:t,G:e}=function(t,e){return{C:t>>>0,G:e>>>0}}(t,e)),e<=2097151)return String(cl*e+t);const n=16777215&(t>>>24|e<<8),r=e>>16&65535;let i=(16777215&t)+6777216*n+6710656*r,o=n+8147497*r,s=2*r;const a=1e7;return i>=a&&(o+=Math.floor(i/a),i%=a),o>=a&&(s+=Math.floor(o/a),o%=a),s.toString()+dl(o)+dl(i)}function hl(t,e){return{C:0|t,G:0|e}}function fl(t,e){return e=~e,t?t=1+~t:e+=1,hl(t,e)}const dl=t=>{const e=String(t);return"0000000".slice(e.length)+e};function wl(t,e){if(t>=0){for(;t>127;)e.push(127&t|128),t>>>=7;e.push(t)}else{for(let n=0;n<9;n++)e.push(127&t|128),t>>=7;e.push(1)}}const pl=yl();function yl(){const t=new DataView(new ArrayBuffer(8));if("function"==typeof BigInt&&"function"==typeof t.getBigInt64&&"function"==typeof t.getBigUint64&&"function"==typeof t.setBigInt64&&"function"==typeof t.setBigUint64&&("object"!=typeof process||"object"!=typeof process.Ks||"1"!==process.Ks.BUF_BIGINT_DISABLE)){const e=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),r=BigInt("0"),i=BigInt("18446744073709551615");return{mb:BigInt(0),supported:!0,parse(t){const r="bigint"==typeof t?t:BigInt(t);if(r>n||r<e)throw new Error(`invalid int64: ${t}`);return r},Ib(t){const e="bigint"==typeof t?t:BigInt(t);if(e>i||e<r)throw new Error(`invalid uint64: ${t}`);return e},kb(e){return t.setBigInt64(0,this.parse(e),!0),{C:t.getInt32(0,!0),G:t.getInt32(4,!0)}},Tb(e){return t.setBigInt64(0,this.Ib(e),!0),{C:t.getInt32(0,!0),G:t.getInt32(4,!0)}},Ab:(e,n)=>(t.setInt32(0,e,!0),t.setInt32(4,n,!0),t.getBigInt64(0,!0)),Bb:(e,n)=>(t.setInt32(0,e,!0),t.setInt32(4,n,!0),t.getBigUint64(0,!0))}}return{mb:"0",supported:!1,parse:t=>("string"!=typeof t&&(t=t.toString()),gl(t),t),Ib:t=>("string"!=typeof t&&(t=t.toString()),bl(t),t),kb:t=>("string"!=typeof t&&(t=t.toString()),gl(t),ll(t)),Tb:t=>("string"!=typeof t&&(t=t.toString()),bl(t),ll(t)),Ab:(t,e)=>function(t,e){let n=hl(t,e);const r=2147483648&n.G;r&&(n=fl(n.C,n.G));const i=ul(n.C,n.G);return r?"-"+i:i}(t,e),Bb:(t,e)=>ul(t,e)}}function gl(t){if(!/^-?[0-9]+$/.test(t))throw new Error("invalid int64: "+t)}function bl(t){if(!/^[0-9]+$/.test(t))throw new Error("invalid uint64: "+t)}const ml=Symbol.for("@bufbuild/protobuf/text-encoding");var vl;!function(t){t[t.k=0]="Varint",t[t.T=1]="Bit64",t[t.A=2]="LengthDelimited",t[t.B=3]="StartGroup",t[t.R=4]="EndGroup",t[t.P=5]="Bit32"}(vl||(vl={}));const Il=34028234663852886e22,kl=-34028234663852886e22;class Tl{constructor(t=function(){if(null==globalThis[ml]){const t=new globalThis.TextEncoder,e=new globalThis.TextDecoder;globalThis[ml]={Eb:e=>t.encode(e),Rb:t=>e.decode(t),Pb(t){try{return encodeURIComponent(t),!0}catch(t){return!1}}}}return globalThis[ml]}().Eb){this.Eb=t,this.stack=[],this.lt=[],this.i=[]}finish(){this.i.length&&(this.lt.push(new Uint8Array(this.i)),this.i=[]);let t=0;for(let e=0;e<this.lt.length;e++)t+=this.lt[e].length;let e=new Uint8Array(t),n=0;for(let t=0;t<this.lt.length;t++)e.set(this.lt[t],n),n+=this.lt[t].length;return this.lt=[],e}ut(){return this.stack.push({lt:this.lt,i:this.i}),this.lt=[],this.i=[],this}join(){let t=this.finish(),e=this.stack.pop();if(!e)throw new Error("invalid state, fork stack empty");return this.lt=e.lt,this.i=e.i,this.uint32(t.byteLength),this.raw(t)}tag(t,e){return this.uint32((t<<3|e)>>>0)}raw(t){return this.i.length&&(this.lt.push(new Uint8Array(this.i)),this.i=[]),this.lt.push(t),this}uint32(t){for(Bl(t);t>127;)this.i.push(127&t|128),t>>>=7;return this.i.push(t),this}int32(t){return Al(t),wl(t,this.i),this}J(t){return this.i.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let e=this.Eb(t);return this.uint32(e.byteLength),this.raw(e)}float(t){!function(t){if("string"==typeof t){const e=t;if(t=Number(t),Number.isNaN(t)&&"NaN"!==e)throw new Error("invalid float32: "+e)}else if("number"!=typeof t)throw new Error("invalid float32: "+typeof t);if(Number.isFinite(t)&&(t>Il||t<kl))throw new Error("invalid float32: "+t)}(t);let e=new Uint8Array(4);return new DataView(e.buffer).setFloat32(0,t,!0),this.raw(e)}it(t){let e=new Uint8Array(8);return new DataView(e.buffer).setFloat64(0,t,!0),this.raw(e)}tt(t){Bl(t);let e=new Uint8Array(4);return new DataView(e.buffer).setUint32(0,t,!0),this.raw(e)}et(t){Al(t);let e=new Uint8Array(4);return new DataView(e.buffer).setInt32(0,t,!0),this.raw(e)}Z(t){return Al(t),wl(t=(t<<1^t>>31)>>>0,this.i),this}rt(t){let e=new Uint8Array(8),n=new DataView(e.buffer),r=pl.kb(t);return n.setInt32(0,r.C,!0),n.setInt32(4,r.G,!0),this.raw(e)}nt(t){let e=new Uint8Array(8),n=new DataView(e.buffer),r=pl.Tb(t);return n.setInt32(0,r.C,!0),n.setInt32(4,r.G,!0),this.raw(e)}q(t){let e=pl.kb(t);return al(e.C,e.G,this.i),this}X(t){const e=pl.kb(t),n=e.G>>31;return al(e.C<<1^n,(e.G<<1|e.C>>>31)^n,this.i),this}Y(t){const e=pl.Tb(t);return al(e.C,e.G,this.i),this}}function Al(t){if("string"==typeof t)t=Number(t);else if("number"!=typeof t)throw new Error("invalid int32: "+typeof t);if(!Number.isInteger(t)||t>2147483647||t<-2147483648)throw new Error("invalid int32: "+t)}function Bl(t){if("string"==typeof t)t=Number(t);else if("number"!=typeof t)throw new Error("invalid uint32: "+typeof t);if(!Number.isInteger(t)||t>4294967295||t<0)throw new Error("invalid uint32: "+t)}function El(t){return Uint8Array.from((t.match(/.{1,2}/g)??[]).map(t=>parseInt(t,16)))}async function Rl(t,e,n,r){const i=cr.create({appVersion:String(e.ur),ar:e.ar,time:e.lr,Ro:n,height:e.height}),o=await async function(t){const e=new Tl,n=cr.le(t,e,{ot:!1}).finish();return e.bytes(n),await ol(e.finish())}(i),s=lr.create({type:Ut.tr,Po:t.ir,hr:e.hr,height:e.height,round:String(t.round),No:o}),a=await sl(s,e.hr,t.sr,t.rr,BigInt(e.height),t.round),{signature:c}=t;return function(t,e,n){return ca.fu.ea(t,e,n)}(Uint8Array.from(a),c,El(r))}const Pl="GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec",Nl=12,xl=BigInt(0xffffffffff);async function $l(t,e,n){const r=new Ea(e),i=new Ea(n),o=_t.create({version:{Tt:"v0",wr:{yr:r.bytes(),gr:i.bytes(),pr:!0}}}),{response:s}=await t.Ts().Ho(o),{version:a}=s;if("v0"!==a.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be v0)");const{wr:c}=a;if("proof"!==c.result.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be proof)");const{result:{br:l},metadata:u}=c;if(null==u)throw new Error("Metadata not found");const{Nb:h,xb:f}=function(t,e,n,r,i){const o=ca.fu.Js(t,Ca(e),Ca(n),r,Ua(i));return{Nb:o.Nb,xb:null!=o.xb?BigInt(o.xb):void 0}}(l.nr,r.bytes(),i.bytes(),!0,Nl);if(null==f)return BigInt(0);const d=await rl(t.Ui,l.sr,il(l.rr));if(!await Rl(l,u,h,d))throw new Error("Failed to verify query");return BigInt(f)&xl}async function Ul(t,e,n){const r=new Ea(e);let i={request:{Tt:"allKeys",Tr:{}}};null!=n&&(i={request:{Tt:"specificKeys",Ar:{Er:n}}});const o=ue.create({version:{Tt:"v0",wr:{yr:r.bytes(),$r:oe.create(i),pr:!0}}}),{response:s}=await t.Ts().Wo(o),{version:a}=s;if("v0"!==a.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be v0)");const{wr:c}=a;if("proof"!==c.result.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be proof)");const{result:{br:l},metadata:u}=c;if(null==u)throw new Error("Metadata not found");const{Nb:h,identity:f}=function(t,e,n,r,i,o,s,a,c){const l=ca.fu.Qs(t,Ca(e),n,r,i,o,s,a,Ua(c));return{Nb:l.Nb,identity:null!=l.identity?Ha.ph(l.identity):void 0}}(l.nr,r.bytes(),null!=n?n:null,!1,!1,!0,null,null,Nl);if(null==f)throw new Error(`Identity with identifier ${r.Ph()} not found`);const d=await rl(t.Ui,l.sr,il(l.rr));if(!await Rl(l,u,h,d))throw new Error("Failed to verify query");return Object.keys(f.Lf).map(t=>f.Lf[t])}const Sl=BigInt(0xffffffffff);async function Cl(t,e){const n=new Ea(e),r=Wt.create({version:{Tt:"v0",wr:{yr:n.bytes(),pr:!0}}}),{response:i}=await t.Ts()._o(r),{version:o}=i;if("v0"!==o.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be v0)");const{wr:s}=o;if("proof"!==s.result.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be proof)");const{result:{br:a},metadata:c}=s;if(null==c)throw new Error("Metadata not found");const{Nb:l,nonce:u}=function(t,e,n,r){const i=ca.fu.ta(t,Ca(e),n,Ua(r));return{Nb:i.Nb,nonce:null!=i.nonce?BigInt(i.nonce):void 0}}(a.nr,n.bytes(),!0,Nl);if(null==u)return BigInt(0);const h=await rl(t.Ui,a.sr,il(a.rr));if(!await Rl(a,c,l,h))throw new Error("Failed to verify query");return BigInt(u)&Sl}async function Gl(t,e){const n=new Ea(e),r=jt.create({version:{Tt:"v0",wr:{id:n.bytes(),pr:!0}}}),{response:i}=await t.Ts().jo(r),{version:o}=i;if("v0"!==o.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be v0)");const{wr:s}=o;if("proof"!==s.result.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be proof)");const{result:{br:a},metadata:c}=s;if(null==c)throw new Error("Metadata not found");const{Nb:l,balance:u}=function(t,e,n,r){const i=ca.fu.Ys(t,Ca(e),n,Ua(r));return{Nb:i.Nb,balance:null!=i.balance?BigInt(i.balance):void 0}}(a.nr,n.bytes(),!0,Nl);if(null==u)throw new Error(`Failed to fetch balance for identifier ${n.Ph()}`);const h=await rl(t.Ui,a.sr,il(a.rr));if(!await Rl(a,c,l,h))throw new Error("Failed to verify query");return BigInt(u)}async function Vl(t,e){const n=Ke.create({version:{Tt:"v0",wr:{Yr:El(e),pr:!0}}}),{response:r}=await t.Ts().Yo(n),{version:i}=r;if("v0"!==i.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be v0)");const{wr:o}=i;if("proof"!==o.result.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be proof)");const{result:{br:s},metadata:a}=o;if(null==a)throw new Error("Metadata not found");const{Nb:c,identity:l}=function(t,e,n){const r=ca.fu.Xs(t,e,Ua(n));return{Nb:r.Nb,identity:null!=r.identity?Wa.ph(r.identity):void 0}}(s.nr,El(e),Nl);if(null==l)throw new Error(`Identity with public key hash ${e} not found`);const u=await rl(t.Ui,s.sr,il(s.rr));if(!await Rl(s,a,c,u))throw new Error("Failed to verify query");return l}async function Kl(t,e){const n=new Ea(e),r=Ot.create({version:{Tt:"v0",wr:{id:n.bytes(),pr:!0}}}),{response:i}=await t.Ts().Fo(r),{version:o}=i;if("v0"!==o.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be v0)");const{wr:s}=o;if("proof"!==s.result.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be proof)");const{result:{br:a},metadata:c}=s;if(null==c)throw new Error("Metadata not found");const{Nb:l,identity:u}=function(t,e,n,r){const i=ca.fu.zs(t,Ca(e),n,Ua(r));return{Nb:i.Nb,identity:null!=i.identity?Wa.ph(i.identity):void 0}}(a.nr,n,!0,Nl);if(null==u)throw new Error(`Identity with identifier ${n.Ph()} not found`);const h=await rl(t.Ui,a.sr,il(a.rr));if(!await Rl(a,c,l,h))throw new Error("Failed to verify query");return u}const Ol={create:{$b:qa,arguments:["publicKeys","assetLockProof"],Ub:["signature","userFeeIncrease"]},Sb:{$b:Ya,arguments:["assetLockProof","identityId"],Ub:["userFeeIncrease"]},update:{$b:za,arguments:["identityId","revision","identityNonce","addPublicKeys","disablePublicKeyIds"],Ub:["userFeeIncrease"]},Cb:{$b:Xa,arguments:["identityId","amount","recipientId","identityNonce"],Ub:["userFeeIncrease"]},Gb:{$b:Ja,arguments:["identityId","amount","coreFeePerByte","pooling","identityNonce","outputScript"],Ub:["userFeeIncrease"]}};async function Fl(t,e){const n=De.create({version:{Tt:"v0",wr:{Yr:El(e),pr:!0}}}),{response:r}=await t.Ts().zo(n),{version:i}=r;if("v0"!==i.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be v0)");const{wr:o}=i;if("proof"!==o.result.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be proof)");const{result:{br:s},metadata:a}=o;if(null==a)throw new Error("Metadata not found");if(null==s.zr)throw new Error("GroveDB proof not found for identity by non unique public key request");const{Nb:c,identifier:l}=function(t,e,n,r,i){const o=ca.fu.qs(t,e,n,void 0,Ua(i));return{Nb:o.Nb,identifier:null!=o.identifier?Ea.ph(o.identifier):void 0}}(s.zr.nr,!1,El(e),0,Nl);if(null==l)throw new Error(`Identity with non unique public key hash ${e} not found`);const u=await rl(t.Ui,s.zr.sr,il(s.zr.rr));if(!await Rl(s.zr,a,c,u))throw new Error("Failed to verify query");return await Kl(t,l)}
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).t={})}(this,function(t){"use strict";function e(t){let e=typeof t;if("object"==e){if(Array.isArray(t))return"array";if(null===t)return"null"}return e}function n(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)}let r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),i=[];for(let t=0;t<r.length;t++)i[r[t].charCodeAt(0)]=t;function o(t){let e=3*t.length/4;"="==t[t.length-2]?e-=2:"="==t[t.length-1]&&(e-=1);let n,r=new Uint8Array(e),o=0,s=0,a=0;for(let e=0;e<t.length;e++){if(n=i[t.charCodeAt(e)],void 0===n)switch(t[e]){case"=":s=0;case"\n":case"\r":case"\t":case" ":continue;default:throw Error("invalid base64 string.")}switch(s){case 0:a=n,s=1;break;case 1:r[o++]=a<<2|(48&n)>>4,a=n,s=2;break;case 2:r[o++]=(15&a)<<4|(60&n)>>2,a=n,s=3;break;case 3:r[o++]=(3&a)<<6|n,s=0}}if(1==s)throw Error("invalid base64 string.");return r.subarray(0,o)}function s(t){let e,n="",i=0,o=0;for(let s=0;s<t.length;s++)switch(e=t[s],i){case 0:n+=r[e>>2],o=(3&e)<<4,i=1;break;case 1:n+=r[o|e>>4],o=(15&e)<<2,i=2;break;case 2:n+=r[o|e>>6],n+=r[63&e],i=0}return i&&(n+=r[o],n+="=",1==i&&(n+="=")),n}var a,c;function l(t,e){return Object.assign(Object.assign({},t),e)}function u(){let t=0,e=0;for(let n=0;n<28;n+=7){let r=this.i[this.o++];if(t|=(127&r)<<n,!(128&r))return this.l(),[t,e]}let n=this.i[this.o++];if(t|=(15&n)<<28,e=(112&n)>>4,!(128&n))return this.l(),[t,e];for(let n=3;n<=31;n+=7){let r=this.i[this.o++];if(e|=(127&r)<<n,!(128&r))return this.l(),[t,e]}throw new Error("invalid varint")}function h(t,e,n){for(let r=0;r<28;r+=7){const i=t>>>r,o=!(i>>>7==0&&0==e),s=255&(o?128|i:i);if(n.push(s),!o)return}const r=t>>>28&15|(7&e)<<4,i=!!(e>>3);if(n.push(255&(i?128|r:r)),i){for(let t=3;t<31;t+=7){const r=e>>>t,i=!(r>>>7==0),o=255&(i?128|r:r);if(n.push(o),!i)return}n.push(e>>>31&1)}}i["-".charCodeAt(0)]=r.indexOf("+"),i["_".charCodeAt(0)]=r.indexOf("/"),function(t){t.u=Symbol.for("protobuf-ts/unknown"),t.h=(n,r,i,o,s)=>{(e(r)?r[t.u]:r[t.u]=[]).push({p:i,m:o,data:s})},t.v=(e,n,r)=>{for(let{p:e,m:i,data:o}of t.list(n))r.tag(e,i).raw(o)},t.list=(n,r)=>{if(e(n)){let e=n[t.u];return r?e.filter(t=>t.p==r):e}return[]},t.I=(e,n)=>t.list(e,n).slice(-1)[0];const e=e=>e&&Array.isArray(e[t.u])}(a||(a={})),function(t){t[t.k=0]="Varint",t[t.T=1]="Bit64",t[t.A=2]="LengthDelimited",t[t.B=3]="StartGroup",t[t.R=4]="EndGroup",t[t.P=5]="Bit32"}(c||(c={}));const f=4294967296;function d(t){let e="-"==t[0];e&&(t=t.slice(1));const n=1e6;let r=0,i=0;function o(e,o){const s=Number(t.slice(e,o));i*=n,r=r*n+s,r>=f&&(i+=r/f|0,r%=f)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),[e,r,i]}function w(t,e){if(e>>>0<=2097151)return""+(f*e+(t>>>0));let n=(t>>>24|e<<8)>>>0&16777215,r=e>>16&65535,i=(16777215&t)+6777216*n+6710656*r,o=n+8147497*r,s=2*r,a=1e7;function c(t,e){let n=t?String(t):"";return e?"0000000".slice(n.length)+n:n}return i>=a&&(o+=Math.floor(i/a),i%=a),o>=a&&(s+=Math.floor(o/a),o%=a),c(s,0)+c(o,s)+c(i,1)}function p(t,e){if(t>=0){for(;t>127;)e.push(127&t|128),t>>>=7;e.push(t)}else{for(let n=0;n<9;n++)e.push(127&t|128),t>>=7;e.push(1)}}function y(){let t=this.i[this.o++],e=127&t;if(!(128&t))return this.l(),e;if(t=this.i[this.o++],e|=(127&t)<<7,!(128&t))return this.l(),e;if(t=this.i[this.o++],e|=(127&t)<<14,!(128&t))return this.l(),e;if(t=this.i[this.o++],e|=(127&t)<<21,!(128&t))return this.l(),e;t=this.i[this.o++],e|=(15&t)<<28;for(let e=5;128&t&&e<10;e++)t=this.i[this.o++];if(128&t)throw new Error("invalid varint");return this.l(),e>>>0}let g;function b(t){if(!t)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}!function(){const t=new DataView(new ArrayBuffer(8)),e=void 0!==globalThis.BigInt&&"function"==typeof t.getBigInt64&&"function"==typeof t.getBigUint64&&"function"==typeof t.setBigInt64&&"function"==typeof t.setBigUint64;g=e?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),N:BigInt("0"),$:BigInt("18446744073709551615"),U:BigInt,S:t}:void 0}();const m=/^-?[0-9]+$/,v=4294967296,I=2147483648;class k{constructor(t,e){this.C=0|t,this.G=0|e}V(){return 0==this.C&&0==this.G}K(){let t=this.G*v+(this.C>>>0);if(!Number.isSafeInteger(t))throw new Error("cannot convert to safe number");return t}}class T extends k{static from(t){if(g)switch(typeof t){case"string":if("0"==t)return this.ZERO;if(""==t)throw new Error("string is no integer");t=g.U(t);case"number":if(0===t)return this.ZERO;t=g.U(t);case"bigint":if(!t)return this.ZERO;if(t<g.N)throw new Error("signed value for ulong");if(t>g.$)throw new Error("ulong too large");return g.S.setBigUint64(0,t,!0),new T(g.S.getInt32(0,!0),g.S.getInt32(4,!0))}else switch(typeof t){case"string":if("0"==t)return this.ZERO;if(t=t.trim(),!m.test(t))throw new Error("string is no integer");let[e,n,r]=d(t);if(e)throw new Error("signed value for ulong");return new T(n,r);case"number":if(0==t)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");if(t<0)throw new Error("signed value for ulong");return new T(t,t/v)}throw new Error("unknown value "+typeof t)}toString(){return g?this.O().toString():w(this.C,this.G)}O(){return b(g),g.S.setInt32(0,this.C,!0),g.S.setInt32(4,this.G,!0),g.S.getBigUint64(0,!0)}}T.ZERO=new T(0,0);class A extends k{static from(t){if(g)switch(typeof t){case"string":if("0"==t)return this.ZERO;if(""==t)throw new Error("string is no integer");t=g.U(t);case"number":if(0===t)return this.ZERO;t=g.U(t);case"bigint":if(!t)return this.ZERO;if(t<g.MIN)throw new Error("signed long too small");if(t>g.MAX)throw new Error("signed long too large");return g.S.setBigInt64(0,t,!0),new A(g.S.getInt32(0,!0),g.S.getInt32(4,!0))}else switch(typeof t){case"string":if("0"==t)return this.ZERO;if(t=t.trim(),!m.test(t))throw new Error("string is no integer");let[e,n,r]=d(t);if(e){if(r>I||r==I&&0!=n)throw new Error("signed long too small")}else if(r>=I)throw new Error("signed long too large");let i=new A(n,r);return e?i.F():i;case"number":if(0==t)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");return t>0?new A(t,t/v):new A(-t,-t/v).F()}throw new Error("unknown value "+typeof t)}W(){return 0!==(this.G&I)}F(){let t=~this.G,e=this.C;return e?e=1+~e:t+=1,new A(e,t)}toString(){if(g)return this.O().toString();if(this.W()){let t=this.F();return"-"+w(t.C,t.G)}return w(this.C,this.G)}O(){return b(g),g.S.setInt32(0,this.C,!0),g.S.setInt32(4,this.G,!0),g.S.getBigInt64(0,!0)}}A.ZERO=new A(0,0);const B={D:!0,_:t=>new E(t)};class E{constructor(t,e){this.H=u,this.uint32=y,this.i=t,this.j=t.length,this.o=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.M=null!=e?e:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}tag(){let t=this.uint32(),e=t>>>3,n=7&t;if(e<=0||n<0||n>5)throw new Error("illegal tag: field no "+e+" wire type "+n);return[e,n]}L(t){let e=this.o;switch(t){case c.k:for(;128&this.i[this.o++];);break;case c.T:this.o+=4;case c.P:this.o+=4;break;case c.A:let e=this.uint32();this.o+=e;break;case c.B:let n;for(;(n=this.tag()[1])!==c.R;)this.L(n);break;default:throw new Error("cant skip wire type "+t)}return this.l(),this.i.subarray(e,this.o)}l(){if(this.o>this.j)throw new RangeError("premature EOF")}int32(){return 0|this.uint32()}Z(){let t=this.uint32();return t>>>1^-(1&t)}q(){return new A(...this.H())}Y(){return new T(...this.H())}X(){let[t,e]=this.H(),n=-(1&t);return t=(t>>>1|(1&e)<<31)^n,e=e>>>1^n,new A(t,e)}J(){let[t,e]=this.H();return 0!==t||0!==e}tt(){return this.view.getUint32((this.o+=4)-4,!0)}et(){return this.view.getInt32((this.o+=4)-4,!0)}nt(){return new T(this.et(),this.et())}rt(){return new A(this.et(),this.et())}float(){return this.view.getFloat32((this.o+=4)-4,!0)}it(){return this.view.getFloat64((this.o+=8)-8,!0)}bytes(){let t=this.uint32(),e=this.o;return this.o+=t,this.l(),this.i.subarray(e,e+t)}string(){return this.M.decode(this.bytes())}}function R(t,e){if(!t)throw new Error(e)}function P(t){if("number"!=typeof t)throw new Error("invalid int 32: "+typeof t);if(!Number.isInteger(t)||t>2147483647||t<-2147483648)throw new Error("invalid int 32: "+t)}function N(t){if("number"!=typeof t)throw new Error("invalid uint 32: "+typeof t);if(!Number.isInteger(t)||t>4294967295||t<0)throw new Error("invalid uint 32: "+t)}function x(t){if("number"!=typeof t)throw new Error("invalid float 32: "+typeof t);if(Number.isFinite(t)&&(t>34028234663852886e22||t<-34028234663852886e22))throw new Error("invalid float 32: "+t)}const $={ot:!0,st:()=>new U};let U=class{constructor(t){this.stack=[],this.ct=null!=t?t:new TextEncoder,this.lt=[],this.i=[]}finish(){this.lt.push(new Uint8Array(this.i));let t=0;for(let e=0;e<this.lt.length;e++)t+=this.lt[e].length;let e=new Uint8Array(t),n=0;for(let t=0;t<this.lt.length;t++)e.set(this.lt[t],n),n+=this.lt[t].length;return this.lt=[],e}ut(){return this.stack.push({lt:this.lt,i:this.i}),this.lt=[],this.i=[],this}join(){let t=this.finish(),e=this.stack.pop();if(!e)throw new Error("invalid state, fork stack empty");return this.lt=e.lt,this.i=e.i,this.uint32(t.byteLength),this.raw(t)}tag(t,e){return this.uint32((t<<3|e)>>>0)}raw(t){return this.i.length&&(this.lt.push(new Uint8Array(this.i)),this.i=[]),this.lt.push(t),this}uint32(t){for(N(t);t>127;)this.i.push(127&t|128),t>>>=7;return this.i.push(t),this}int32(t){return P(t),p(t,this.i),this}J(t){return this.i.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let e=this.ct.encode(t);return this.uint32(e.byteLength),this.raw(e)}float(t){x(t);let e=new Uint8Array(4);return new DataView(e.buffer).setFloat32(0,t,!0),this.raw(e)}it(t){let e=new Uint8Array(8);return new DataView(e.buffer).setFloat64(0,t,!0),this.raw(e)}tt(t){N(t);let e=new Uint8Array(4);return new DataView(e.buffer).setUint32(0,t,!0),this.raw(e)}et(t){P(t);let e=new Uint8Array(4);return new DataView(e.buffer).setInt32(0,t,!0),this.raw(e)}Z(t){return P(t),p(t=(t<<1^t>>31)>>>0,this.i),this}rt(t){let e=new Uint8Array(8),n=new DataView(e.buffer),r=A.from(t);return n.setInt32(0,r.C,!0),n.setInt32(4,r.G,!0),this.raw(e)}nt(t){let e=new Uint8Array(8),n=new DataView(e.buffer),r=T.from(t);return n.setInt32(0,r.C,!0),n.setInt32(4,r.G,!0),this.raw(e)}q(t){let e=A.from(t);return h(e.C,e.G,this.i),this}X(t){let e=A.from(t),n=e.G>>31;return h(e.C<<1^n,(e.G<<1|e.C>>>31)^n,this.i),this}Y(t){let e=T.from(t);return h(e.C,e.G,this.i),this}};const S={ht:!1,ft:!1,dt:!1,wt:0},C={yt:!1};function G(t,e){var n,r;let i=Object.assign(Object.assign({},t),e);return i.gt=[...null!==(n=null==t?void 0:t.gt)&&void 0!==n?n:[],...null!==(r=null==e?void 0:e.gt)&&void 0!==r?r:[]],i}const V=Symbol.for("protobuf-ts/message-type");function K(t){let e=!1;const n=[];for(let r=0;r<t.length;r++){let i=t.charAt(r);"_"==i?e=!0:/\d/.test(i)?(n.push(i),e=!0):e?(n.push(i.toUpperCase()),e=!1):0==r?n.push(i.toLowerCase()):n.push(i)}return n.join("")}var O,F,W;function D(t){var e,n,r,i;return t.localName=null!==(e=t.localName)&&void 0!==e?e:K(t.name),t.bt=null!==(n=t.bt)&&void 0!==n?n:K(t.name),t.repeat=null!==(r=t.repeat)&&void 0!==r?r:W.vt,t.It=null!==(i=t.It)&&void 0!==i?i:!t.repeat&&(!t.kt&&"message"==t.kind),t}function _(t){if("object"!=typeof t||null===t||!t.hasOwnProperty("oneofKind"))return!1;switch(typeof t.Tt){case"string":return void 0!==t[t.Tt]&&2==Object.keys(t).length;case"undefined":return 1==Object.keys(t).length;default:return!1}}!function(t){t[t.At=1]="DOUBLE",t[t.FLOAT=2]="FLOAT",t[t.Bt=3]="INT64",t[t.Et=4]="UINT64",t[t.Rt=5]="INT32",t[t.Pt=6]="FIXED64",t[t.Nt=7]="FIXED32",t[t.BOOL=8]="BOOL",t[t.xt=9]="STRING",t[t.$t=12]="BYTES",t[t.Ut=13]="UINT32",t[t.St=15]="SFIXED32",t[t.Ct=16]="SFIXED64",t[t.Gt=17]="SINT32",t[t.Vt=18]="SINT64"}(O||(O={})),function(t){t[t.Kt=0]="BIGINT",t[t.xt=1]="STRING",t[t.Ot=2]="NUMBER"}(F||(F={})),function(t){t[t.vt=0]="NO",t[t.Ft=1]="PACKED",t[t.Wt=2]="UNPACKED"}(W||(W={}));class H{constructor(t){var e;this.Dt=null!==(e=t.Dt)&&void 0!==e?e:[]}_t(){if(this.data)return;const t=[],e=[],n=[];for(let r of this.Dt)if(r.kt)n.includes(r.kt)||(n.push(r.kt),t.push(r.kt),e.push(r.kt));else switch(e.push(r.localName),r.kind){case"scalar":case"enum":r.It&&!r.repeat||t.push(r.localName);break;case"message":r.repeat&&t.push(r.localName);break;case"map":t.push(r.localName)}this.data={Ht:t,jt:e,Mt:Object.values(n)}}is(t,e,n=!1){if(e<0)return!0;if(null==t||"object"!=typeof t)return!1;this._t();let r=Object.keys(t),i=this.data;if(r.length<i.Ht.length||i.Ht.some(t=>!r.includes(t)))return!1;if(!n&&r.some(t=>!i.jt.includes(t)))return!1;if(e<1)return!0;for(const r of i.Mt){const i=t[r];if(!_(i))return!1;if(void 0===i.Tt)continue;const o=this.Dt.find(t=>t.localName===i.Tt);if(!o)return!1;if(!this.Lt(i[i.Tt],o,n,e))return!1}for(const r of this.Dt)if(void 0===r.kt&&!this.Lt(t[r.localName],r,n,e))return!1;return!0}Lt(t,e,n,r){let i=e.repeat;switch(e.kind){case"scalar":return void 0===t?e.It:i?this.Zt(t,e.qt,r,e.Yt):this.zt(t,e.qt,e.Yt);case"enum":return void 0===t?e.It:i?this.Zt(t,O.Rt,r):this.zt(t,O.Rt);case"message":return void 0===t||(i?this.messages(t,e.qt(),n,r):this.message(t,e.qt(),n,r));case"map":if("object"!=typeof t||null===t)return!1;if(r<2)return!0;if(!this.Xt(t,e.Jt,r))return!1;switch(e.S.kind){case"scalar":return this.Zt(Object.values(t),e.S.qt,r,e.S.Yt);case"enum":return this.Zt(Object.values(t),O.Rt,r);case"message":return this.messages(Object.values(t),e.S.qt(),n,r)}}return!0}message(t,e,n,r){return n?e.Qt(t,r):e.is(t,r)}messages(t,e,n,r){if(!Array.isArray(t))return!1;if(r<2)return!0;if(n){for(let n=0;n<t.length&&n<r;n++)if(!e.Qt(t[n],r-1))return!1}else for(let n=0;n<t.length&&n<r;n++)if(!e.is(t[n],r-1))return!1;return!0}zt(t,e,n){let r=typeof t;switch(e){case O.Et:case O.Pt:case O.Bt:case O.Ct:case O.Vt:switch(n){case F.Kt:return"bigint"==r;case F.Ot:return"number"==r&&!isNaN(t);default:return"string"==r}case O.BOOL:return"boolean"==r;case O.xt:return"string"==r;case O.$t:return t instanceof Uint8Array;case O.At:case O.FLOAT:return"number"==r&&!isNaN(t);default:return"number"==r&&Number.isInteger(t)}}Zt(t,e,n,r){if(!Array.isArray(t))return!1;if(n<2)return!0;if(Array.isArray(t))for(let i=0;i<t.length&&i<n;i++)if(!this.zt(t[i],e,r))return!1;return!0}Xt(t,e,n){let r=Object.keys(t);switch(e){case O.Rt:case O.Nt:case O.St:case O.Gt:case O.Ut:return this.Zt(r.slice(0,n).map(t=>parseInt(t)),e,n);case O.BOOL:return this.Zt(r.slice(0,n).map(t=>"true"==t||"false"!=t&&t),e,n);default:return this.Zt(r,e,n,F.xt)}}}function j(t,e){switch(e){case F.Kt:return t.O();case F.Ot:return t.K();default:return t.toString()}}class M{constructor(t){this.info=t}_t(){var t;if(void 0===this.te){this.te={};const e=null!==(t=this.info.Dt)&&void 0!==t?t:[];for(const t of e)this.te[t.name]=t,this.te[t.bt]=t,this.te[t.localName]=t}}assert(t,n,r){if(!t){let t=e(r);throw"number"!=t&&"boolean"!=t||(t=r.toString()),new Error(`Cannot parse JSON ${t} for ${this.info.ee}#${n}`)}}read(t,e,r){this._t();const i=[];for(const[o,s]of Object.entries(t)){const t=this.te[o];if(!t){if(!r.yt)throw new Error(`Found unknown field while reading ${this.info.ee} from JSON format. JSON key: ${o}`);continue}const a=t.localName;let c;if(t.kt){if(null===s&&("enum"!==t.kind||"google.protobuf.NullValue"!==t.qt()[0]))continue;if(i.includes(t.kt))throw new Error(`Multiple members of the oneof group "${t.kt}" of ${this.info.ee} are present in JSON.`);i.push(t.kt),c=e[t.kt]={Tt:a}}else c=e;if("map"==t.kind){if(null===s)continue;this.assert(n(s),t.name,s);const e=c[a];for(const[n,i]of Object.entries(s)){let o;switch(this.assert(null!==i,t.name+" map value",null),t.S.kind){case"message":o=t.S.qt().ne(i,r);break;case"enum":if(o=this.re(t.S.qt(),i,t.name,r.yt),!1===o)continue;break;case"scalar":o=this.zt(i,t.S.qt,t.S.Yt,t.name)}this.assert(void 0!==o,t.name+" map value",i);let s=n;t.Jt==O.BOOL&&(s="true"==s||"false"!=s&&s),s=this.zt(s,t.Jt,F.xt,t.name).toString(),e[s]=o}}else if(t.repeat){if(null===s)continue;this.assert(Array.isArray(s),t.name,s);const e=c[a];for(const n of s){let i;switch(this.assert(null!==n,t.name,null),t.kind){case"message":i=t.qt().ne(n,r);break;case"enum":if(i=this.re(t.qt(),n,t.name,r.yt),!1===i)continue;break;case"scalar":i=this.zt(n,t.qt,t.Yt,t.name)}this.assert(void 0!==i,t.name,s),e.push(i)}}else switch(t.kind){case"message":if(null===s&&"google.protobuf.Value"!=t.qt().ee){this.assert(void 0===t.kt,t.name+" (oneof member)",null);continue}c[a]=t.qt().ne(s,r,c[a]);break;case"enum":if(null===s)continue;let e=this.re(t.qt(),s,t.name,r.yt);if(!1===e)continue;c[a]=e;break;case"scalar":if(null===s)continue;c[a]=this.zt(s,t.qt,t.Yt,t.name)}}}re(t,e,n,r){if("google.protobuf.NullValue"==t[0]&&R(null===e||"NULL_VALUE"===e,`Unable to parse field ${this.info.ee}#${n}, enum ${t[0]} only accepts null.`),null===e)return 0;switch(typeof e){case"number":return R(Number.isInteger(e),`Unable to parse field ${this.info.ee}#${n}, enum can only be integral number, got ${e}.`),e;case"string":let i=e;t[2]&&e.substring(0,t[2].length)===t[2]&&(i=e.substring(t[2].length));let o=t[1][i];return(void 0!==o||!r)&&(R("number"==typeof o,`Unable to parse field ${this.info.ee}#${n}, enum ${t[0]} has no value for "${e}".`),o)}R(!1,`Unable to parse field ${this.info.ee}#${n}, cannot parse enum value from ${typeof e}".`)}zt(t,e,n,r){let i;try{switch(e){case O.At:case O.FLOAT:if(null===t)return 0;if("NaN"===t)return Number.NaN;if("Infinity"===t)return Number.POSITIVE_INFINITY;if("-Infinity"===t)return Number.NEGATIVE_INFINITY;if(""===t){i="empty string";break}if("string"==typeof t&&t.trim().length!==t.length){i="extra whitespace";break}if("string"!=typeof t&&"number"!=typeof t)break;let r=Number(t);if(Number.isNaN(r)){i="not a number";break}if(!Number.isFinite(r)){i="too large or small";break}return e==O.FLOAT&&x(r),r;case O.Rt:case O.Nt:case O.St:case O.Gt:case O.Ut:if(null===t)return 0;let s;if("number"==typeof t?s=t:""===t?i="empty string":"string"==typeof t&&(t.trim().length!==t.length?i="extra whitespace":s=Number(t)),void 0===s)break;return e==O.Ut?N(s):P(s),s;case O.Bt:case O.Ct:case O.Vt:if(null===t)return j(A.ZERO,n);if("number"!=typeof t&&"string"!=typeof t)break;return j(A.from(t),n);case O.Pt:case O.Et:if(null===t)return j(T.ZERO,n);if("number"!=typeof t&&"string"!=typeof t)break;return j(T.from(t),n);case O.BOOL:if(null===t)return!1;if("boolean"!=typeof t)break;return t;case O.xt:if(null===t)return"";if("string"!=typeof t){i="extra whitespace";break}try{encodeURIComponent(t)}catch(i){i="invalid UTF8";break}return t;case O.$t:if(null===t||""===t)return new Uint8Array(0);if("string"!=typeof t)break;return o(t)}}catch(t){i=t.message}this.assert(!1,r+(i?" - "+i:""),t)}}class L{constructor(t){var e;this.Dt=null!==(e=t.Dt)&&void 0!==e?e:[]}write(t,e){const n={},r=t;for(const t of this.Dt){if(!t.kt){let i=this.Lt(t,r[t.localName],e);void 0!==i&&(n[e.dt?t.name:t.bt]=i);continue}const i=r[t.kt];if(i.Tt!==t.localName)continue;const o="scalar"==t.kind||"enum"==t.kind?Object.assign(Object.assign({},e),{ht:!0}):e;let s=this.Lt(t,i[t.localName],o);R(void 0!==s),n[e.dt?t.name:t.bt]=s}return n}Lt(t,e,n){let r;if("map"==t.kind){R("object"==typeof e&&null!==e);const i={};switch(t.S.kind){case"scalar":for(const[n,r]of Object.entries(e)){const e=this.zt(t.S.qt,r,t.name,!1,!0);R(void 0!==e),i[n.toString()]=e}break;case"message":const r=t.S.qt();for(const[o,s]of Object.entries(e)){const e=this.message(r,s,t.name,n);R(void 0!==e),i[o.toString()]=e}break;case"enum":const o=t.S.qt();for(const[r,s]of Object.entries(e)){R(void 0===s||"number"==typeof s);const e=this.re(o,s,t.name,!1,!0,n.ft);R(void 0!==e),i[r.toString()]=e}}(n.ht||Object.keys(i).length>0)&&(r=i)}else if(t.repeat){R(Array.isArray(e));const i=[];switch(t.kind){case"scalar":for(let n=0;n<e.length;n++){const r=this.zt(t.qt,e[n],t.name,t.It,!0);R(void 0!==r),i.push(r)}break;case"enum":const r=t.qt();for(let o=0;o<e.length;o++){R(void 0===e[o]||"number"==typeof e[o]);const s=this.re(r,e[o],t.name,t.It,!0,n.ft);R(void 0!==s),i.push(s)}break;case"message":const o=t.qt();for(let r=0;r<e.length;r++){const s=this.message(o,e[r],t.name,n);R(void 0!==s),i.push(s)}}(n.ht||i.length>0||n.ht)&&(r=i)}else switch(t.kind){case"scalar":r=this.zt(t.qt,e,t.name,t.It,n.ht);break;case"enum":r=this.re(t.qt(),e,t.name,t.It,n.ht,n.ft);break;case"message":r=this.message(t.qt(),e,t.name,n)}return r}re(t,e,n,r,i,o){if("google.protobuf.NullValue"==t[0])return i||r?null:void 0;if(void 0!==e){if(0!==e||i||r)return R("number"==typeof e),R(Number.isInteger(e)),o||!t[1].hasOwnProperty(e)?e:t[2]?t[2]+t[1][e]:t[1][e]}else R(r)}message(t,e,n,r){return void 0===e?r.ht?null:void 0:t.ie(e,r)}zt(t,e,n,r,i){if(void 0===e)return void R(r);const o=i||r;switch(t){case O.Rt:case O.St:case O.Gt:return 0===e?o?0:void 0:(P(e),e);case O.Nt:case O.Ut:return 0===e?o?0:void 0:(N(e),e);case O.FLOAT:x(e);case O.At:return 0===e?o?0:void 0:(R("number"==typeof e),Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e);case O.xt:return""===e?o?"":void 0:(R("string"==typeof e),e);case O.BOOL:return!1===e?!o&&void 0:(R("boolean"==typeof e),e);case O.Et:case O.Pt:R("number"==typeof e||"string"==typeof e||"bigint"==typeof e);let t=T.from(e);if(t.V()&&!o)return;return t.toString();case O.Bt:case O.Ct:case O.Vt:R("number"==typeof e||"string"==typeof e||"bigint"==typeof e);let n=A.from(e);if(n.V()&&!o)return;return n.toString();case O.$t:return R(e instanceof Uint8Array),e.byteLength?s(e):o?"":void 0}}}function Z(t,e=F.xt){switch(t){case O.BOOL:return!1;case O.Et:case O.Pt:return j(T.ZERO,e);case O.Bt:case O.Ct:case O.Vt:return j(A.ZERO,e);case O.At:case O.FLOAT:return 0;case O.$t:return new Uint8Array(0);case O.xt:return"";default:return 0}}class q{constructor(t){this.info=t}_t(){var t;if(!this.oe){const e=null!==(t=this.info.Dt)&&void 0!==t?t:[];this.oe=new Map(e.map(t=>[t.p,t]))}}read(t,e,n,r){this._t();const i=void 0===r?t.j:t.o+r;for(;t.o<i;){const[r,i]=t.tag(),o=this.oe.get(r);if(!o){let o=n.D;if("throw"==o)throw new Error(`Unknown field ${r} (wire type ${i}) for ${this.info.ee}`);let s=t.L(i);!1!==o&&(!0===o?a.h:o)(this.info.ee,e,r,i,s);continue}let s=e,l=o.repeat,u=o.localName;switch(o.kt&&(s=s[o.kt],s.Tt!==u&&(s=e[o.kt]={Tt:u})),o.kind){case"scalar":case"enum":let e="enum"==o.kind?O.Rt:o.qt,r="scalar"==o.kind?o.Yt:void 0;if(l){let n=s[u];if(i==c.A&&e!=O.xt&&e!=O.$t){let i=t.uint32()+t.o;for(;t.o<i;)n.push(this.zt(t,e,r))}else n.push(this.zt(t,e,r))}else s[u]=this.zt(t,e,r);break;case"message":if(l){let e=s[u],r=o.qt().se(t,t.uint32(),n);e.push(r)}else s[u]=o.qt().se(t,t.uint32(),n,s[u]);break;case"map":let[a,h]=this.ae(o,t,n);s[u][a]=h}}}ae(t,e,n){let r,i,o=e.uint32(),s=e.o+o;for(;e.o<s;){let[o,s]=e.tag();switch(o){case 1:r=t.Jt==O.BOOL?e.J().toString():this.zt(e,t.Jt,F.xt);break;case 2:switch(t.S.kind){case"scalar":i=this.zt(e,t.S.qt,t.S.Yt);break;case"enum":i=e.int32();break;case"message":i=t.S.qt().se(e,e.uint32(),n)}break;default:throw new Error(`Unknown field ${o} (wire type ${s}) in map entry for ${this.info.ee}#${t.name}`)}}if(void 0===r){let e=Z(t.Jt);r=t.Jt==O.BOOL?e.toString():e}if(void 0===i)switch(t.S.kind){case"scalar":i=Z(t.S.qt,t.S.Yt);break;case"enum":i=0;break;case"message":i=t.S.qt().create()}return[r,i]}zt(t,e,n){switch(e){case O.Rt:return t.int32();case O.xt:return t.string();case O.BOOL:return t.J();case O.At:return t.it();case O.FLOAT:return t.float();case O.Bt:return j(t.q(),n);case O.Et:return j(t.Y(),n);case O.Pt:return j(t.nt(),n);case O.Nt:return t.tt();case O.$t:return t.bytes();case O.Ut:return t.uint32();case O.St:return t.et();case O.Ct:return j(t.rt(),n);case O.Gt:return t.Z();case O.Vt:return j(t.X(),n)}}}class Y{constructor(t){this.info=t}_t(){if(!this.Dt){const t=this.info.Dt?this.info.Dt.concat():[];this.Dt=t.sort((t,e)=>t.p-e.p)}}write(t,e,n){this._t();for(const r of this.Dt){let i,o,s=r.repeat,a=r.localName;if(r.kt){const e=t[r.kt];if(e.Tt!==a)continue;i=e[a],o=!0}else i=t[a],o=!1;switch(r.kind){case"scalar":case"enum":let t="enum"==r.kind?O.Rt:r.qt;if(s)if(R(Array.isArray(i)),s==W.Ft)this.ce(e,t,r.p,i);else for(const n of i)this.zt(e,t,r.p,n,!0);else void 0===i?R(r.It):this.zt(e,t,r.p,i,o||r.It);break;case"message":if(s){R(Array.isArray(i));for(const t of i)this.message(e,n,r.qt(),r.p,t)}else this.message(e,n,r.qt(),r.p,i);break;case"map":R("object"==typeof i&&null!==i);for(const[t,o]of Object.entries(i))this.ae(e,n,r,t,o)}}let r=n.ot;!1!==r&&(!0===r?a.v:r)(this.info.ee,t,e)}ae(t,e,n,r,i){t.tag(n.p,c.A),t.ut();let o=r;switch(n.Jt){case O.Rt:case O.Nt:case O.Ut:case O.St:case O.Gt:o=Number.parseInt(r);break;case O.BOOL:R("true"==r||"false"==r),o="true"==r}switch(this.zt(t,n.Jt,1,o,!0),n.S.kind){case"scalar":this.zt(t,n.S.qt,2,i,!0);break;case"enum":this.zt(t,O.Rt,2,i,!0);break;case"message":this.message(t,e,n.S.qt(),2,i)}t.join()}message(t,e,n,r,i){void 0!==i&&(n.le(i,t.tag(r,c.A).ut(),e),t.join())}zt(t,e,n,r,i){let[o,s,a]=this.ue(e,r);a&&!i||(t.tag(n,o),t[s](r))}ce(t,e,n,r){if(!r.length)return;R(e!==O.$t&&e!==O.xt),t.tag(n,c.A),t.ut();let[,i]=this.ue(e);for(let e=0;e<r.length;e++)t[i](r[e]);t.join()}ue(t,e){let n,r=c.k,i=void 0===e,o=0===e;switch(t){case O.Rt:n="int32";break;case O.xt:o=i||!e.length,r=c.A,n="string";break;case O.BOOL:o=!1===e,n="bool";break;case O.Ut:n="uint32";break;case O.At:r=c.T,n="double";break;case O.FLOAT:r=c.P,n="float";break;case O.Bt:o=i||A.from(e).V(),n="int64";break;case O.Et:o=i||T.from(e).V(),n="uint64";break;case O.Pt:o=i||T.from(e).V(),r=c.T,n="fixed64";break;case O.$t:o=i||!e.byteLength,r=c.A,n="bytes";break;case O.Nt:r=c.P,n="fixed32";break;case O.St:r=c.P,n="sfixed32";break;case O.Ct:o=i||A.from(e).V(),r=c.T,n="sfixed64";break;case O.Gt:n="sint32";break;case O.Vt:o=i||A.from(e).V(),n="sint64"}return[r,n,i||o]}}function z(t,e,n){let r,i,o=n;for(let n of t.Dt){let t=n.localName;if(n.kt){const s=o[n.kt];if(null==(null==s?void 0:s.Tt))continue;if(r=s[t],i=e[n.kt],i.Tt=s.Tt,null==r){delete i[t];continue}}else if(r=o[t],i=e,null==r)continue;switch(n.repeat&&(i[t].length=r.length),n.kind){case"scalar":case"enum":if(n.repeat)for(let e=0;e<r.length;e++)i[t][e]=r[e];else i[t]=r;break;case"message":let e=n.qt();if(n.repeat)for(let n=0;n<r.length;n++)i[t][n]=e.create(r[n]);else void 0===i[t]?i[t]=e.create(r):e.he(i[t],r);break;case"map":switch(n.S.kind){case"scalar":case"enum":Object.assign(i[t],r);break;case"message":let e=n.S.qt();for(let n of Object.keys(r))i[t][n]=e.create(r[n])}}}}const X=Object.values;function J(t,e,n){if(e===n)return!0;if(t!==O.$t)return!1;let r=e,i=n;if(r.length!==i.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!=i[t])return!1;return!0}function Q(t,e,n){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(!J(t,e[r],n[r]))return!1;return!0}function tt(t,e,n){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(!t.equals(e[r],n[r]))return!1;return!0}const et=Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})),nt=et[V]={};class rt{constructor(t,e,n){this.fe=16,this.ee=t,this.Dt=e.map(D),this.options=null!=n?n:{},nt.value=this,this.de=Object.create(null,et),this.we=new H(this),this.pe=new M(this),this.ye=new L(this),this.ge=new q(this),this.be=new Y(this)}create(t){let e=function(t){const e=t.de?Object.create(t.de):Object.defineProperty({},V,{value:t});for(let n of t.Dt){let t=n.localName;if(!n.It)if(n.kt)e[n.kt]={Tt:void 0};else if(n.repeat)e[t]=[];else switch(n.kind){case"scalar":e[t]=Z(n.qt,n.Yt);break;case"enum":e[t]=0;break;case"map":e[t]={}}}return e}(this);return void 0!==t&&z(this,e,t),e}clone(t){let e=this.create();return z(this,e,t),e}equals(t,e){return function(t,e,n){if(e===n)return!0;if(!e||!n)return!1;for(let r of t.Dt){let t=r.localName,i=r.kt?e[r.kt][t]:e[t],o=r.kt?n[r.kt][t]:n[t];switch(r.kind){case"enum":case"scalar":let t="enum"==r.kind?O.Rt:r.qt;if(!(r.repeat?Q(t,i,o):J(t,i,o)))return!1;break;case"map":if(!("message"==r.S.kind?tt(r.S.qt(),X(i),X(o)):Q("enum"==r.S.kind?O.Rt:r.S.qt,X(i),X(o))))return!1;break;case"message":let e=r.qt();if(!(r.repeat?tt(e,i,o):e.equals(i,o)))return!1}}return!0}(this,t,e)}is(t,e=this.fe){return this.we.is(t,e,!1)}Qt(t,e=this.fe){return this.we.is(t,e,!0)}he(t,e){z(this,t,e)}me(t,e){let n=function(t){return t?Object.assign(Object.assign({},B),t):B}(e);return this.se(n._(t),t.byteLength,n)}ve(t,e){return this.ne(t,function(t){return t?Object.assign(Object.assign({},C),t):C}(e))}Ie(t,e){let n=JSON.parse(t);return this.ve(n,e)}ke(t,e){return this.ie(t,function(t){return t?Object.assign(Object.assign({},S),t):S}(e))}Te(t,e){var n;let r=this.ke(t,e);return JSON.stringify(r,null,null!==(n=null==e?void 0:e.wt)&&void 0!==n?n:0)}Ae(t,e){let n=function(t){return t?Object.assign(Object.assign({},$),t):$}(e);return this.le(t,n.st(),n).finish()}ne(t,n,r){if(null!==t&&"object"==typeof t&&!Array.isArray(t)){let e=null!=r?r:this.create();return this.pe.read(t,e,n),e}throw new Error(`Unable to parse message ${this.ee} from JSON ${e(t)}.`)}ie(t,e){return this.ye.write(t,e)}le(t,e,n){return this.be.write(t,e,n),e}se(t,e,n,r){let i=null!=r?r:this.create();return this.ge.read(t,i,n,e),i}}class it extends Error{constructor(t,e="UNKNOWN",n){super(t),this.name="RpcError",Object.setPrototypeOf(this,new.target.prototype),this.code=e,this.Be=null!=n?n:{}}toString(){const t=[this.name+": "+this.message];this.code&&(t.push(""),t.push("Code: "+this.code)),this.Ee&&this.methodName&&t.push("Method: "+this.Ee+"/"+this.methodName);let e=Object.entries(this.Be);if(e.length){t.push(""),t.push("Meta:");for(let[n,r]of e)t.push(` ${n}: ${r}`)}return t.join("\n")}}function ot(t,e){if(!t)return;let n=e;for(let[e,r]of Object.entries(t))r instanceof Date?n[e]=new Date(r.getTime()):Array.isArray(r)?n[e]=r.concat():n[e]=r}var st;!function(t){t[t.Re=0]="PENDING",t[t.Pe=1]="REJECTED",t[t.Ne=2]="RESOLVED"}(st||(st={}));class at{constructor(t=!0){this.xe=st.Re,this.$e=new Promise((t,e)=>{this.Ue=t,this.Se=e}),t&&this.$e.catch(t=>{})}get state(){return this.xe}get promise(){return this.$e}resolve(t){if(this.state!==st.Re)throw new Error(`cannot resolve ${st[this.state].toLowerCase()}`);this.Ue(t),this.xe=st.Ne}reject(t){if(this.state!==st.Re)throw new Error(`cannot reject ${st[this.state].toLowerCase()}`);this.Se(t),this.xe=st.Pe}Ce(t){this.xe===st.Re&&this.resolve(t)}Ge(t){this.xe===st.Re&&this.reject(t)}}class ct{constructor(){this.Ve={Ke:[],Oe:[],Fe:[],cmp:[]},this.We=!1,this.De={_e:[]}}He(t){return this.je(t,this.Ve.Ke)}onMessage(t){return this.je(t,this.Ve.Oe)}Me(t){return this.je(t,this.Ve.Fe)}Le(t){return this.je(t,this.Ve.cmp)}je(t,e){return e.push(t),()=>{let n=e.indexOf(t);n>=0&&e.splice(n,1)}}Ze(){for(let t of Object.values(this.Ve))t.splice(0,t.length)}get closed(){return!1!==this.We}qe(t,e,n){R((t?1:0)+(e?1:0)+(n?1:0)<=1,"only one emission at a time"),t&&this.Ye(t),e&&this.ze(e),n&&this.Xe()}Ye(t){R(!this.closed,"stream is closed"),this.Je({value:t,done:!1}),this.Ve.Oe.forEach(e=>e(t)),this.Ve.Ke.forEach(e=>e(t,void 0,!1))}ze(t){R(!this.closed,"stream is closed"),this.We=t,this.Je(t),this.Ve.Fe.forEach(e=>e(t)),this.Ve.Ke.forEach(e=>e(void 0,t,!1)),this.Ze()}Xe(){R(!this.closed,"stream is closed"),this.We=!0,this.Je({value:null,done:!0}),this.Ve.cmp.forEach(t=>t()),this.Ve.Ke.forEach(t=>t(void 0,void 0,!0)),this.Ze()}[Symbol.asyncIterator](){return!0===this.We?this.Je({value:null,done:!0}):!1!==this.We&&this.Je(this.We),{next:()=>{let t=this.De;R(t,"bad state"),R(!t.Qe,"iterator contract broken");let e=t._e.shift();return e?"value"in e?Promise.resolve(e):Promise.reject(e):(t.Qe=new at,t.Qe.promise)}}}Je(t){let e=this.De;if(e.Qe){const n=e.Qe;R(n.state==st.Re,"iterator contract broken"),"value"in t?n.resolve(t):n.reject(t),delete e.Qe}else e._e.push(t)}}var lt=function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.tn(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}c((r=r.apply(t,e||[])).next())})};class ut{constructor(t,e,n,r,i,o,s){this.method=t,this.en=e,this.request=n,this.headers=r,this.response=i,this.status=o,this.nn=s}then(t,e){return this.rn().then(e=>t?Promise.resolve(t(e)):e,t=>e?Promise.resolve(e(t)):Promise.reject(t))}rn(){return lt(this,void 0,void 0,function*(){let[t,e,n,r]=yield Promise.all([this.headers,this.response,this.status,this.nn]);return{method:this.method,en:this.en,request:this.request,headers:t,response:e,status:n,nn:r}})}}var ht,ft=function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.tn(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}c((r=r.apply(t,e||[])).next())})};class dt{constructor(t,e,n,r,i,o,s){this.method=t,this.en=e,this.request=n,this.headers=r,this.sn=i,this.status=o,this.nn=s}then(t,e){return this.rn().then(e=>t?Promise.resolve(t(e)):e,t=>e?Promise.resolve(e(t)):Promise.reject(t))}rn(){return ft(this,void 0,void 0,function*(){let[t,e,n]=yield Promise.all([this.headers,this.status,this.nn]);return{method:this.method,en:this.en,request:this.request,headers:t,status:e,nn:n}})}}function wt(t,e,n,r,i){var o;{let t=(t,n,r)=>e.an(t,n,r);for(const e of(null!==(o=r.cn)&&void 0!==o?o:[]).filter(t=>t.ln).reverse()){const n=t;t=(t,r,i)=>e.ln(n,t,r,i)}return t(n,i,r)}}!function(t){t[t.OK=0]="OK",t[t.un=1]="CANCELLED",t[t.hn=2]="UNKNOWN",t[t.fn=3]="INVALID_ARGUMENT",t[t.dn=4]="DEADLINE_EXCEEDED",t[t.wn=5]="NOT_FOUND",t[t.pn=6]="ALREADY_EXISTS",t[t.PERMISSION_DENIED=7]="PERMISSION_DENIED",t[t.yn=16]="UNAUTHENTICATED",t[t.gn=8]="RESOURCE_EXHAUSTED",t[t.bn=9]="FAILED_PRECONDITION",t[t.mn=10]="ABORTED",t[t.vn=11]="OUT_OF_RANGE",t[t.In=12]="UNIMPLEMENTED",t[t.kn=13]="INTERNAL",t[t.Tn=14]="UNAVAILABLE",t[t.An=15]="DATA_LOSS"}(ht||(ht={}));var pt,yt=function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.tn(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}c((r=r.apply(t,e||[])).next())})};function gt(t,e,n,r,i){if(r)for(let[e,n]of Object.entries(r))if("string"==typeof n)t.append(e,n);else for(let r of n)t.append(e,r);if(t.set("Content-Type","text"===e?"application/grpc-web-text":"application/grpc-web+proto"),"text"==e&&t.set("Accept","application/grpc-web-text"),t.set("X-Grpc-Web","1"),"number"==typeof n){if(n<=0)throw new it(`timeout ${n} ms exceeded`,ht[ht.dn]);t.set("grpc-timeout",`${n}m`)}else if(n){const e=n.getTime(),r=Date.now();if(e<=r)throw new it(`deadline ${n} exceeded`,ht[ht.dn]);t.set("grpc-timeout",e-r+"m")}return t}function bt(t,e){let n=new Uint8Array(5+t.length);n[0]=pt.Bn;for(let e=t.length,r=4;r>0;r--)n[r]=e%256,e>>>=8;return n.set(t,5),"binary"===e?n:s(n)}function mt(t,e,n){if(1===arguments.length){let e,n=t;try{e=n.type}catch(t){}switch(e){case"error":case"opaque":case"opaqueredirect":throw new it(`fetch response type ${n.type}`,ht[ht.hn])}return mt(function(t){let e={};return t.forEach((t,n)=>{let r=e[n];"string"==typeof r?e[n]=[r,t]:Array.isArray(r)?r.push(t):e[n]=t}),e}(n.headers),n.status,n.statusText)}let r=t,i=e>=200&&e<300,o=Bt(r),[s,a]=At(r);return void 0!==s&&s!==ht.OK||i||(s=function(t){switch(t){case 200:return ht.OK;case 400:return ht.fn;case 401:return ht.yn;case 403:return ht.PERMISSION_DENIED;case 404:return ht.wn;case 409:return ht.mn;case 412:return ht.bn;case 429:return ht.gn;case 499:return ht.un;case 500:default:return ht.hn;case 501:return ht.In;case 503:return ht.Tn;case 504:return ht.dn}}(e),a=n),[s,a,o]}function vt(t){let e=function(t){let e={};for(let n of String.fromCharCode.apply(String,t).trim().split("\r\n")){if(""==n)continue;let[t,...r]=n.split(":");const i=r.join(":").trim();t=t.trim();let o=e[t];"string"==typeof o?e[t]=[o,i]:Array.isArray(o)?o.push(i):e[t]=i}return e}(t),[n,r]=At(e),i=Bt(e);return[null!=n?n:ht.OK,r,i]}function It(t,e,n){return yt(this,void 0,void 0,function*(){let r,i="",s=new Uint8Array(0),a=function(t){switch(t){case"application/grpc-web-text":case"application/grpc-web-text+proto":return"text";case"application/grpc-web":case"application/grpc-web+proto":return"binary";case void 0:case null:throw new it("missing response content type",ht[ht.kn]);default:throw new it("unexpected response content type: "+t,ht[ht.kn])}}(e);if(kt(t)){let e=t.getReader();r={next:()=>e.read()}}else r=t[Symbol.asyncIterator]();for(;;){let t=yield r.next();if(void 0!==t.value){if("text"===a){for(let e=0;e<t.value.length;e++)i+=String.fromCharCode(t.value[e]);let e=i.length-i.length%4;if(0===e)continue;s=Tt(s,o(i.substring(0,e))),i=i.substring(e)}else s=Tt(s,t.value);for(;s.length>=5&&s[0]===pt.Bn;){let t=0;for(let e=1;e<5;e++)t=(t<<8)+s[e];if(!(s.length-5>=t))break;n(pt.Bn,s.subarray(5,5+t)),s=s.subarray(5+t)}}if(t.done){if(0===s.length)break;if(s[0]!==pt.En||s.length<5)throw new it("premature EOF",ht[ht.An]);n(pt.En,s.subarray(5));break}}})}!function(t){t[t.Bn=0]="DATA",t[t.En=128]="TRAILER"}(pt||(pt={}));const kt=t=>"function"==typeof t.getReader;function Tt(t,e){let n=new Uint8Array(t.length+e.length);return n.set(t),n.set(e,t.length),n}function At(t){let e,n,r=t["Rn"];if(void 0!==r){if(Array.isArray(r))return[ht.kn,"invalid grpc-web message"];n=r}let i=t["Pn"];if(void 0!==i){if(Array.isArray(i))return[ht.kn,"invalid grpc-web status"];if(e=parseInt(i,10),void 0===ht[e])return[ht.kn,"invalid grpc-web status"]}return[e,n]}function Bt(t){let e={};for(let[n,r]of Object.entries(t))switch(n){case"grpc-message":case"grpc-status":case"content-type":break;default:e[n]=r}return e}class Et{constructor(t){this.Nn=t}xn(t){return function(t,e){if(!e)return t;let n={};ot(t,n),ot(e,n);for(let r of Object.keys(e)){let i=e[r];switch(r){case"jsonOptions":n.$n=G(t.$n,n.$n);break;case"binaryOptions":n.Un=l(t.Un,n.Un);break;case"meta":n.Be={},ot(t.Be,n.Be),ot(e.Be,n.Be);break;case"interceptors":n.cn=t.cn?t.cn.concat(i):i.concat()}}return n}(this.Nn,t)}Sn(t,e){let n=e.Cn;return n.endsWith("/")&&(n=n.substring(0,n.length-1)),`${n}/${t.service.ee}/${t.name}`}Gn(t){const e=new it("Client streaming is not supported by grpc-web",ht[ht.In]);throw e.methodName=t.name,e.Ee=t.service.ee,e}duplex(t){const e=new it("Duplex streaming is not supported by grpc-web",ht[ht.In]);throw e.methodName=t.name,e.Ee=t.service.ee,e}Vn(t,e,n){var r,i,o,s,a;let c,l,u=n,h=null!==(r=u.format)&&void 0!==r?r:"text",f=null!==(i=u.fetch)&&void 0!==i?i:globalThis.fetch,d=null!==(o=u.Kn)&&void 0!==o?o:{},w=this.Sn(t,u),p=t.On.Ae(e,u.Un),y=new at,g=new ct,b=!0,m=new at,v=new at;return f(w,Object.assign(Object.assign({},d),{method:"POST",headers:gt(new globalThis.Headers,h,u.timeout,u.Be),body:bt(p,h),signal:null!==(s=n.abort)&&void 0!==s?s:null})).then(t=>{let[e,n,r]=mt(t);if(y.resolve(r),null!=e&&e!==ht.OK)throw new it(null!=n?n:ht[e],ht[e],r);return null!=e&&(c={code:ht[e],detail:null!=n?n:ht[e]}),t}).then(e=>{if(!e.body)throw new it("missing response body",ht[ht.kn]);return It(e.body,e.headers.get("content-type"),(e,n)=>{switch(e){case pt.Bn:g.Ye(t.Fn.me(n,u.Un)),b=!1;break;case pt.En:let e,r;[e,r,l]=vt(n),c={code:ht[e],detail:null!=r?r:ht[e]}}})}).then(()=>{if(!l&&!b)throw new it("missing trailers",ht[ht.An]);if(!c)throw new it("missing status",ht[ht.kn]);if("OK"!==c.code)throw new it(c.detail,c.code,l);g.Xe(),m.resolve(c),v.resolve(l||{})}).catch(e=>{let n;n=e instanceof it?e:e instanceof Error&&"AbortError"===e.name?new it(e.message,ht[ht.un]):new it(e instanceof Error?e.message:""+e,ht[ht.kn]),n.methodName=t.name,n.Ee=t.service.ee,y.Ge(n),g.ze(n),m.Ge(n),v.Ge(n)}),new dt(t,null!==(a=u.Be)&&void 0!==a?a:{},e,y.promise,g,m.promise,v.promise)}an(t,e,n){var r,i,o,s,a;let c,l,u,h=n,f=null!==(r=h.format)&&void 0!==r?r:"text",d=null!==(i=h.fetch)&&void 0!==i?i:globalThis.fetch,w=null!==(o=h.Kn)&&void 0!==o?o:{},p=this.Sn(t,h),y=t.On.Ae(e,h.Un),g=new at,b=new at,m=new at,v=new at;return d(p,Object.assign(Object.assign({},w),{method:"POST",headers:gt(new globalThis.Headers,f,h.timeout,h.Be),body:bt(y,f),signal:null!==(s=n.abort)&&void 0!==s?s:null})).then(t=>{let[e,n,r]=mt(t);if(g.resolve(r),null!=e&&e!==ht.OK)throw new it(null!=n?n:ht[e],ht[e],r);return null!=e&&(l={code:ht[e],detail:null!=n?n:ht[e]}),t}).then(e=>{if(!e.body)throw new it("missing response body",ht[ht.kn]);return It(e.body,e.headers.get("content-type"),(e,n)=>{switch(e){case pt.Bn:if(c)throw new it("unary call received 2nd message",ht[ht.An]);c=t.Fn.me(n,h.Un);break;case pt.En:let e,r;[e,r,u]=vt(n),l={code:ht[e],detail:null!=r?r:ht[e]}}})}).then(()=>{if(!u&&c)throw new it("missing trailers",ht[ht.An]);if(!l)throw new it("missing status",ht[ht.kn]);if(!c&&"OK"===l.code)throw new it("expected error status",ht[ht.An]);if(!c)throw new it(l.detail,l.code,u);if(b.resolve(c),"OK"!==l.code)throw new it(l.detail,l.code,u);m.resolve(l),v.resolve(u||{})}).catch(e=>{let n;n=e instanceof it?e:e instanceof Error&&"AbortError"===e.name?new it(e.message,ht[ht.un]):new it(e instanceof Error?e.message:""+e,ht[ht.kn]),n.methodName=t.name,n.Ee=t.service.ee,g.Ge(n),b.Ge(n),m.Ge(n),v.Ge(n)}),new ut(t,null!==(a=h.Be)&&void 0!==a?a:{},e,g.promise,b.promise,m.promise,v.promise)}}new class extends rt{constructor(){super("google.protobuf.DoubleValue",[{p:1,name:"value",kind:"scalar",qt:1}])}ie(t,e){return this.ye.zt(2,t.value,"value",!1,!0)}ne(t,e,n){return n||(n=this.create()),n.value=this.pe.zt(t,1,void 0,"value"),n}create(t){const e=globalThis.Object.create(this.de);return e.value=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.value=t.it();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.value&&e.tag(1,c.T).it(t.value);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};new class extends rt{constructor(){super("google.protobuf.FloatValue",[{p:1,name:"value",kind:"scalar",qt:2}])}ie(t,e){return this.ye.zt(1,t.value,"value",!1,!0)}ne(t,e,n){return n||(n=this.create()),n.value=this.pe.zt(t,1,void 0,"value"),n}create(t){const e=globalThis.Object.create(this.de);return e.value=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.value=t.float();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.value&&e.tag(1,c.P).float(t.value);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};new class extends rt{constructor(){super("google.protobuf.Int64Value",[{p:1,name:"value",kind:"scalar",qt:3}])}ie(t,e){return this.ye.zt(O.Bt,t.value,"value",!1,!0)}ne(t,e,n){return n||(n=this.create()),n.value=this.pe.zt(t,O.Bt,F.xt,"value"),n}create(t){const e=globalThis.Object.create(this.de);return e.value="0",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.value=t.q().toString();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"0"!==t.value&&e.tag(1,c.k).q(t.value);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};new class extends rt{constructor(){super("google.protobuf.UInt64Value",[{p:1,name:"value",kind:"scalar",qt:4}])}ie(t,e){return this.ye.zt(O.Et,t.value,"value",!1,!0)}ne(t,e,n){return n||(n=this.create()),n.value=this.pe.zt(t,O.Et,F.xt,"value"),n}create(t){const e=globalThis.Object.create(this.de);return e.value="0",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.value=t.Y().toString();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"0"!==t.value&&e.tag(1,c.k).Y(t.value);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};new class extends rt{constructor(){super("google.protobuf.Int32Value",[{p:1,name:"value",kind:"scalar",qt:5}])}ie(t,e){return this.ye.zt(5,t.value,"value",!1,!0)}ne(t,e,n){return n||(n=this.create()),n.value=this.pe.zt(t,5,void 0,"value"),n}create(t){const e=globalThis.Object.create(this.de);return e.value=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.value=t.int32();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.value&&e.tag(1,c.k).int32(t.value);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Rt=new class extends rt{constructor(){super("google.protobuf.UInt32Value",[{p:1,name:"value",kind:"scalar",qt:13}])}ie(t,e){return this.ye.zt(13,t.value,"value",!1,!0)}ne(t,e,n){return n||(n=this.create()),n.value=this.pe.zt(t,13,void 0,"value"),n}create(t){const e=globalThis.Object.create(this.de);return e.value=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.value=t.uint32();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.value&&e.tag(1,c.k).uint32(t.value);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};new class extends rt{constructor(){super("google.protobuf.BoolValue",[{p:1,name:"value",kind:"scalar",qt:8}])}ie(t,e){return t.value}ne(t,e,n){return n||(n=this.create()),n.value=this.pe.zt(t,8,void 0,"value"),n}create(t){const e=globalThis.Object.create(this.de);return e.value=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.value=t.J();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){!1!==t.value&&e.tag(1,c.k).J(t.value);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};new class extends rt{constructor(){super("google.protobuf.StringValue",[{p:1,name:"value",kind:"scalar",qt:9}])}ie(t,e){return t.value}ne(t,e,n){return n||(n=this.create()),n.value=this.pe.zt(t,9,void 0,"value"),n}create(t){const e=globalThis.Object.create(this.de);return e.value="",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.value=t.string();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){""!==t.value&&e.tag(1,c.A).string(t.value);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};var Pt,Nt,xt,$t,Ut;new class extends rt{constructor(){super("google.protobuf.BytesValue",[{p:1,name:"value",kind:"scalar",qt:12}])}ie(t,e){return this.ye.zt(12,t.value,"value",!1,!0)}ne(t,e,n){return n||(n=this.create()),n.value=this.pe.zt(t,12,void 0,"value"),n}create(t){const e=globalThis.Object.create(this.de);return e.value=new Uint8Array(0),void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.value=t.bytes();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.value.length&&e.tag(1,c.A).bytes(t.value);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}},function(t){t[t.Wn=0]="CURRENT_KEY_OF_KIND_REQUEST",t[t.Dn=1]="ALL_KEYS_OF_KIND_REQUEST"}(Pt||(Pt={})),function(t){t[t._n=0]="DOCUMENTS",t[t.Hn=1]="VOTE_TALLY",t[t.jn=2]="DOCUMENTS_AND_VOTE_TALLY"}(Nt||(Nt={})),function(t){t[t.Mn=0]="TOWARDS_IDENTITY",t[t.Ln=1]="LOCKED",t[t.Zn=2]="NO_PREVIOUS_WINNER"}(xt||(xt={})),function(t){t[t.qn=0]="AUTHENTICATION",t[t.Yn=1]="ENCRYPTION",t[t.zn=2]="DECRYPTION",t[t.Xn=3]="TRANSFER",t[t.Jn=5]="VOTING"}($t||($t={})),function(t){t[t.hn=0]="UNKNOWN",t[t.Qn=1]="PREVOTE",t[t.tr=2]="PRECOMMIT",t[t.er=32]="PROPOSAL"}(Ut||(Ut={}));const St=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.Proof",[{p:1,name:"grovedb_proof",kind:"scalar",qt:12},{p:2,name:"quorum_hash",kind:"scalar",qt:12},{p:3,name:"signature",kind:"scalar",qt:12},{p:4,name:"round",kind:"scalar",qt:13},{p:5,name:"block_id_hash",kind:"scalar",qt:12},{p:6,name:"quorum_type",kind:"scalar",qt:13}])}create(t){const e=globalThis.Object.create(this.de);return e.nr=new Uint8Array(0),e.rr=new Uint8Array(0),e.signature=new Uint8Array(0),e.round=0,e.ir=new Uint8Array(0),e.sr=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.nr=t.bytes();break;case 2:i.rr=t.bytes();break;case 3:i.signature=t.bytes();break;case 4:i.round=t.uint32();break;case 5:i.ir=t.bytes();break;case 6:i.sr=t.uint32();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.nr.length&&e.tag(1,c.A).bytes(t.nr),t.rr.length&&e.tag(2,c.A).bytes(t.rr),t.signature.length&&e.tag(3,c.A).bytes(t.signature),0!==t.round&&e.tag(4,c.k).uint32(t.round),t.ir.length&&e.tag(5,c.A).bytes(t.ir),0!==t.sr&&e.tag(6,c.k).uint32(t.sr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ct=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.ResponseMetadata",[{p:1,name:"height",kind:"scalar",qt:4},{p:2,name:"core_chain_locked_height",kind:"scalar",qt:13},{p:3,name:"epoch",kind:"scalar",qt:13},{p:4,name:"time_ms",kind:"scalar",qt:4},{p:5,name:"protocol_version",kind:"scalar",qt:13},{p:6,name:"chain_id",kind:"scalar",qt:9}])}create(t){const e=globalThis.Object.create(this.de);return e.height="0",e.ar=0,e.cr=0,e.lr="0",e.ur=0,e.hr="",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.height=t.Y().toString();break;case 2:i.ar=t.uint32();break;case 3:i.cr=t.uint32();break;case 4:i.lr=t.Y().toString();break;case 5:i.ur=t.uint32();break;case 6:i.hr=t.string();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"0"!==t.height&&e.tag(1,c.k).Y(t.height),0!==t.ar&&e.tag(2,c.k).uint32(t.ar),0!==t.cr&&e.tag(3,c.k).uint32(t.cr),"0"!==t.lr&&e.tag(4,c.k).Y(t.lr),0!==t.ur&&e.tag(5,c.k).uint32(t.ur),""!==t.hr&&e.tag(6,c.A).string(t.hr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Gt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.StateTransitionBroadcastError",[{p:1,name:"code",kind:"scalar",qt:13},{p:2,name:"message",kind:"scalar",qt:9},{p:3,name:"data",kind:"scalar",qt:12}])}create(t){const e=globalThis.Object.create(this.de);return e.code=0,e.message="",e.data=new Uint8Array(0),void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.code=t.uint32();break;case 2:i.message=t.string();break;case 3:i.data=t.bytes();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.code&&e.tag(1,c.k).uint32(t.code),""!==t.message&&e.tag(2,c.A).string(t.message),t.data.length&&e.tag(3,c.A).bytes(t.data);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Vt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.BroadcastStateTransitionRequest",[{p:1,name:"state_transition",kind:"scalar",qt:12}])}create(t){const e=globalThis.Object.create(this.de);return e.dr=new Uint8Array(0),void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.dr=t.bytes();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.dr.length&&e.tag(1,c.A).bytes(t.dr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Kt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.BroadcastStateTransitionResponse",[])}create(t){const e=globalThis.Object.create(this.de);return void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ot=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Ft}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Ft.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Ft.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ft=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityRequest.GetIdentityRequestV0",[{p:1,name:"id",kind:"scalar",qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.id=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.id=t.bytes();break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.id.length&&e.tag(1,c.A).bytes(t.id),!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Wt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityNonceRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Dt}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Dt.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Dt.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Dt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityNonceRequest.GetIdentityNonceRequestV0",[{p:1,name:"identity_id",kind:"scalar",qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.yr=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.yr=t.bytes();break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.yr.length&&e.tag(1,c.A).bytes(t.yr),!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const _t=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityContractNonceRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Ht}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Ht.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Ht.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ht=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityContractNonceRequest.GetIdentityContractNonceRequestV0",[{p:1,name:"identity_id",kind:"scalar",qt:12},{p:2,name:"contract_id",kind:"scalar",qt:12},{p:3,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.yr=new Uint8Array(0),e.gr=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.yr=t.bytes();break;case 2:i.gr=t.bytes();break;case 3:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.yr.length&&e.tag(1,c.A).bytes(t.yr),t.gr.length&&e.tag(2,c.A).bytes(t.gr),!1!==t.pr&&e.tag(3,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const jt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityBalanceRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Mt}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Mt.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Mt.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Mt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityBalanceRequest.GetIdentityBalanceRequestV0",[{p:1,name:"id",kind:"scalar",qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.id=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.id=t.bytes();break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.id.length&&e.tag(1,c.A).bytes(t.id),!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Lt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Zt}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Zt.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Zt.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Zt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionRequest.GetIdentityBalanceAndRevisionRequestV0",[{p:1,name:"id",kind:"scalar",qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.id=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.id=t.bytes();break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.id.length&&e.tag(1,c.A).bytes(t.id),!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const qt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Yt}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Yt.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Yt.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Yt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityResponse.GetIdentityResponseV0",[{p:1,name:"identity",kind:"scalar",kt:"result",qt:12},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"identity",identity:t.bytes()};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"identity"===t.result.Tt&&e.tag(1,c.A).bytes(t.result.identity),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const zt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityNonceResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Xt}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Xt.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Xt.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Xt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityNonceResponse.GetIdentityNonceResponseV0",[{p:1,name:"identity_nonce",kind:"scalar",kt:"result",qt:4},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"identityNonce",mr:t.Y().toString()};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"identityNonce"===t.result.Tt&&e.tag(1,c.k).Y(t.result.mr),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Jt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityContractNonceResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Qt}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Qt.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Qt.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Qt=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityContractNonceResponse.GetIdentityContractNonceResponseV0",[{p:1,name:"identity_contract_nonce",kind:"scalar",kt:"result",qt:4},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"identityContractNonce",vr:t.Y().toString()};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"identityContractNonce"===t.result.Tt&&e.tag(1,c.k).Y(t.result.vr),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const te=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityBalanceResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>ee}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:ee.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&ee.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ee=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityBalanceResponse.GetIdentityBalanceResponseV0",[{p:1,name:"balance",kind:"scalar",kt:"result",qt:4},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"balance",balance:t.Y().toString()};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"balance"===t.result.Tt&&e.tag(1,c.k).Y(t.result.balance),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ne=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>re}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:re.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&re.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const re=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0",[{p:1,name:"balance_and_revision",kind:"message",kt:"result",qt:()=>ie},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"balanceAndRevision",Ir:ie.se(t,t.uint32(),n,i.result.Ir)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"balanceAndRevision"===t.result.Tt&&ie.le(t.result.Ir,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ie=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.GetIdentityBalanceAndRevisionResponseV0.BalanceAndRevision",[{p:1,name:"balance",kind:"scalar",qt:4},{p:2,name:"revision",kind:"scalar",qt:4}])}create(t){const e=globalThis.Object.create(this.de);return e.balance="0",e.kr="0",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.balance=t.Y().toString();break;case 2:i.kr=t.Y().toString();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"0"!==t.balance&&e.tag(1,c.k).Y(t.balance),"0"!==t.kr&&e.tag(2,c.k).Y(t.kr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const oe=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.KeyRequestType",[{p:1,name:"all_keys",kind:"message",kt:"request",qt:()=>se},{p:2,name:"specific_keys",kind:"message",kt:"request",qt:()=>ae},{p:3,name:"search_key",kind:"message",kt:"request",qt:()=>ce}])}create(t){const e=globalThis.Object.create(this.de);return e.request={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.request={Tt:"allKeys",Tr:se.se(t,t.uint32(),n,i.request.Tr)};break;case 2:i.request={Tt:"specificKeys",Ar:ae.se(t,t.uint32(),n,i.request.Ar)};break;case 3:i.request={Tt:"searchKey",Br:ce.se(t,t.uint32(),n,i.request.Br)};break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"allKeys"===t.request.Tt&&se.le(t.request.Tr,e.tag(1,c.A).ut(),n).join(),"specificKeys"===t.request.Tt&&ae.le(t.request.Ar,e.tag(2,c.A).ut(),n).join(),"searchKey"===t.request.Tt&&ce.le(t.request.Br,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const se=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.AllKeys",[])}create(t){const e=globalThis.Object.create(this.de);return void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ae=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.SpecificKeys",[{p:1,name:"key_ids",kind:"scalar",repeat:1,qt:13}])}create(t){const e=globalThis.Object.create(this.de);return e.Er=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)if(r===c.A)for(let e=t.int32()+t.o;t.o<e;)i.Er.push(t.uint32());else i.Er.push(t.uint32());else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){if(t.Er.length){e.tag(1,c.A).ut();for(let n=0;n<t.Er.length;n++)e.uint32(t.Er[n]);e.join()}let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ce=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.SearchKey",[{p:1,name:"purpose_map",kind:"map",Jt:13,S:{kind:"message",qt:()=>le}}])}create(t){const e=globalThis.Object.create(this.de);return e.Rr={},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)this.Pr(i.Rr,t,n);else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}Pr(t,e,n){let r,i,o=e.uint32(),s=e.o+o;for(;e.o<s;){let[t,o]=e.tag();switch(t){case 1:r=e.uint32();break;case 2:i=le.se(e,e.uint32(),n);break;default:throw new globalThis.Error("unknown map entry field for org.dash.platform.dapi.v0.SearchKey.purpose_map")}}t[r??0]=i??le.create()}le(t,e,n){for(let r of globalThis.Object.keys(t.Rr))e.tag(1,c.A).ut().tag(1,c.k).uint32(parseInt(r)),e.tag(2,c.A).ut(),le.le(t.Rr[r],e,n),e.join().join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const le=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.SecurityLevelMap",[{p:1,name:"security_level_map",kind:"map",Jt:13,S:{kind:"enum",qt:()=>["org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType",Pt]}}])}create(t){const e=globalThis.Object.create(this.de);return e.Nr={},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)this.Pr(i.Nr,t,n);else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}Pr(t,e,n){let r,i,o=e.uint32(),s=e.o+o;for(;e.o<s;){let[t,n]=e.tag();switch(t){case 1:r=e.uint32();break;case 2:i=e.int32();break;default:throw new globalThis.Error("unknown map entry field for org.dash.platform.dapi.v0.SecurityLevelMap.security_level_map")}}t[r??0]=i??0}le(t,e,n){for(let n of globalThis.Object.keys(t.Nr))e.tag(1,c.A).ut().tag(1,c.k).uint32(parseInt(n)).tag(2,c.k).int32(t.Nr[n]).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ue=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityKeysRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>he}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:he.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&he.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const he=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityKeysRequest.GetIdentityKeysRequestV0",[{p:1,name:"identity_id",kind:"scalar",qt:12},{p:2,name:"request_type",kind:"message",qt:()=>oe},{p:3,name:"limit",kind:"message",qt:()=>Rt},{p:4,name:"offset",kind:"message",qt:()=>Rt},{p:5,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.yr=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.yr=t.bytes();break;case 2:i.$r=oe.se(t,t.uint32(),n,i.$r);break;case 3:i.Ur=Rt.se(t,t.uint32(),n,i.Ur);break;case 4:i.offset=Rt.se(t,t.uint32(),n,i.offset);break;case 5:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.yr.length&&e.tag(1,c.A).bytes(t.yr),t.$r&&oe.le(t.$r,e.tag(2,c.A).ut(),n).join(),t.Ur&&Rt.le(t.Ur,e.tag(3,c.A).ut(),n).join(),t.offset&&Rt.le(t.offset,e.tag(4,c.A).ut(),n).join(),!1!==t.pr&&e.tag(5,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const fe=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityKeysResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>de}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:de.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&de.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const de=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0",[{p:1,name:"keys",kind:"message",kt:"result",qt:()=>we},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"keys",keys:we.se(t,t.uint32(),n,i.result.keys)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"keys"===t.result.Tt&&we.le(t.result.keys,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const we=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityKeysResponse.GetIdentityKeysResponseV0.Keys",[{p:1,name:"keys_bytes",kind:"scalar",repeat:2,qt:12}])}create(t){const e=globalThis.Object.create(this.de);return e.Sr=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.Sr.push(t.bytes());else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let n=0;n<t.Sr.length;n++)e.tag(1,c.A).bytes(t.Sr[n]);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const pe=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>ye}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:ye.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&ye.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ye=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesContractKeysRequest.GetIdentitiesContractKeysRequestV0",[{p:1,name:"identities_ids",kind:"scalar",repeat:2,qt:12},{p:2,name:"contract_id",kind:"scalar",qt:12},{p:3,name:"document_type_name",kind:"scalar",It:!0,qt:9},{p:4,name:"purposes",kind:"enum",repeat:1,qt:()=>["org.dash.platform.dapi.v0.KeyPurpose",$t]},{p:5,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.Cr=[],e.gr=new Uint8Array(0),e.Gr=[],e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Cr.push(t.bytes());break;case 2:i.gr=t.bytes();break;case 3:i.Vr=t.string();break;case 4:if(r===c.A)for(let e=t.int32()+t.o;t.o<e;)i.Gr.push(t.int32());else i.Gr.push(t.int32());break;case 5:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let n=0;n<t.Cr.length;n++)e.tag(1,c.A).bytes(t.Cr[n]);if(t.gr.length&&e.tag(2,c.A).bytes(t.gr),void 0!==t.Vr&&e.tag(3,c.A).string(t.Vr),t.Gr.length){e.tag(4,c.A).ut();for(let n=0;n<t.Gr.length;n++)e.int32(t.Gr[n]);e.join()}!1!==t.pr&&e.tag(5,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ge=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>be}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:be.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&be.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const be=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0",[{p:1,name:"identities_keys",kind:"message",kt:"result",qt:()=>Ie},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"identitiesKeys",Kr:Ie.se(t,t.uint32(),n,i.result.Kr)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"identitiesKeys"===t.result.Tt&&Ie.le(t.result.Kr,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const me=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.PurposeKeys",[{p:1,name:"purpose",kind:"enum",qt:()=>["org.dash.platform.dapi.v0.KeyPurpose",$t]},{p:2,name:"keys_bytes",kind:"scalar",repeat:2,qt:12}])}create(t){const e=globalThis.Object.create(this.de);return e.Or=0,e.Sr=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Or=t.int32();break;case 2:i.Sr.push(t.bytes());break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.Or&&e.tag(1,c.k).int32(t.Or);for(let n=0;n<t.Sr.length;n++)e.tag(2,c.A).bytes(t.Sr[n]);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ve=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentityKeys",[{p:1,name:"identity_id",kind:"scalar",qt:12},{p:2,name:"keys",kind:"message",repeat:2,qt:()=>me}])}create(t){const e=globalThis.Object.create(this.de);return e.yr=new Uint8Array(0),e.keys=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.yr=t.bytes();break;case 2:i.keys.push(me.se(t,t.uint32(),n));break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.yr.length&&e.tag(1,c.A).bytes(t.yr);for(let r=0;r<t.keys.length;r++)me.le(t.keys[r],e.tag(2,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ie=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesContractKeysResponse.GetIdentitiesContractKeysResponseV0.IdentitiesKeys",[{p:1,name:"entries",kind:"message",repeat:2,qt:()=>ve}])}create(t){const e=globalThis.Object.create(this.de);return e.entries=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.entries.push(ve.se(t,t.uint32(),n));else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let r=0;r<t.entries.length;r++)ve.le(t.entries[r],e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ke=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Te}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Te.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Te.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Te=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesBalancesRequest.GetIdentitiesBalancesRequestV0",[{p:1,name:"ids",kind:"scalar",repeat:2,qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.Fr=[],e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Fr.push(t.bytes());break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let n=0;n<t.Fr.length;n++)e.tag(1,c.A).bytes(t.Fr[n]);!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ae=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Be}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Be.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Be.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Be=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0",[{p:1,name:"identities_balances",kind:"message",kt:"result",qt:()=>Re},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"identitiesBalances",Wr:Re.se(t,t.uint32(),n,i.result.Wr)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"identitiesBalances"===t.result.Tt&&Re.le(t.result.Wr,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ee=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentityBalance",[{p:1,name:"identity_id",kind:"scalar",qt:12},{p:2,name:"balance",kind:"scalar",It:!0,qt:4}])}create(t){const e=globalThis.Object.create(this.de);return e.yr=new Uint8Array(0),void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.yr=t.bytes();break;case 2:i.balance=t.Y().toString();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.yr.length&&e.tag(1,c.A).bytes(t.yr),void 0!==t.balance&&e.tag(2,c.k).Y(t.balance);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Re=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesBalancesResponse.GetIdentitiesBalancesResponseV0.IdentitiesBalances",[{p:1,name:"entries",kind:"message",repeat:2,qt:()=>Ee}])}create(t){const e=globalThis.Object.create(this.de);return e.entries=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.entries.push(Ee.se(t,t.uint32(),n));else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let r=0;r<t.entries.length;r++)Ee.le(t.entries[r],e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Pe=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetDataContractRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Ne}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Ne.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Ne.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ne=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetDataContractRequest.GetDataContractRequestV0",[{p:1,name:"id",kind:"scalar",qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.id=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.id=t.bytes();break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.id.length&&e.tag(1,c.A).bytes(t.id),!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const xe=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetDataContractResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>$e}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:$e.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&$e.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const $e=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetDataContractResponse.GetDataContractResponseV0",[{p:1,name:"data_contract",kind:"scalar",kt:"result",qt:12},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"dataContract",Dr:t.bytes()};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"dataContract"===t.result.Tt&&e.tag(1,c.A).bytes(t.result.Dr),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ue=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetDocumentsRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Se}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Se.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Se.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Se=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetDocumentsRequest.GetDocumentsRequestV0",[{p:1,name:"data_contract_id",kind:"scalar",qt:12},{p:2,name:"document_type",kind:"scalar",qt:9},{p:3,name:"where",kind:"scalar",qt:12},{p:4,name:"order_by",kind:"scalar",qt:12},{p:5,name:"limit",kind:"scalar",qt:13},{p:6,name:"start_after",kind:"scalar",kt:"start",qt:12},{p:7,name:"start_at",kind:"scalar",kt:"start",qt:12},{p:8,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e._r=new Uint8Array(0),e.Hr="",e.jr=new Uint8Array(0),e.Mr=new Uint8Array(0),e.Ur=0,e.start={Tt:void 0},e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i._r=t.bytes();break;case 2:i.Hr=t.string();break;case 3:i.jr=t.bytes();break;case 4:i.Mr=t.bytes();break;case 5:i.Ur=t.uint32();break;case 6:i.start={Tt:"startAfter",Lr:t.bytes()};break;case 7:i.start={Tt:"startAt",Zr:t.bytes()};break;case 8:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t._r.length&&e.tag(1,c.A).bytes(t._r),""!==t.Hr&&e.tag(2,c.A).string(t.Hr),t.jr.length&&e.tag(3,c.A).bytes(t.jr),t.Mr.length&&e.tag(4,c.A).bytes(t.Mr),0!==t.Ur&&e.tag(5,c.k).uint32(t.Ur),"startAfter"===t.start.Tt&&e.tag(6,c.A).bytes(t.start.Lr),"startAt"===t.start.Tt&&e.tag(7,c.A).bytes(t.start.Zr),!1!==t.pr&&e.tag(8,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ce=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetDocumentsResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Ge}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Ge.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Ge.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ge=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0",[{p:1,name:"documents",kind:"message",kt:"result",qt:()=>Ve},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"documents",qr:Ve.se(t,t.uint32(),n,i.result.qr)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"documents"===t.result.Tt&&Ve.le(t.result.qr,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ve=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetDocumentsResponse.GetDocumentsResponseV0.Documents",[{p:1,name:"documents",kind:"scalar",repeat:2,qt:12}])}create(t){const e=globalThis.Object.create(this.de);return e.qr=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.qr.push(t.bytes());else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let n=0;n<t.qr.length;n++)e.tag(1,c.A).bytes(t.qr[n]);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ke=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Oe}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Oe.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Oe.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Oe=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashRequest.GetIdentityByPublicKeyHashRequestV0",[{p:1,name:"public_key_hash",kind:"scalar",qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.Yr=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Yr=t.bytes();break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.Yr.length&&e.tag(1,c.A).bytes(t.Yr),!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Fe=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>We}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:We.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&We.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const We=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashResponse.GetIdentityByPublicKeyHashResponseV0",[{p:1,name:"identity",kind:"scalar",kt:"result",qt:12},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"identity",identity:t.bytes()};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"identity"===t.result.Tt&&e.tag(1,c.A).bytes(t.result.identity),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const De=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>_e}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:_e.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&_e.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const _e=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashRequest.GetIdentityByNonUniquePublicKeyHashRequestV0",[{p:1,name:"public_key_hash",kind:"scalar",qt:12},{p:2,name:"start_after",kind:"scalar",It:!0,qt:12},{p:3,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.Yr=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Yr=t.bytes();break;case 2:i.Lr=t.bytes();break;case 3:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.Yr.length&&e.tag(1,c.A).bytes(t.Yr),void 0!==t.Lr&&e.tag(2,c.A).bytes(t.Lr),!1!==t.pr&&e.tag(3,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const He=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>je}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:je.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&je.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const je=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0",[{p:1,name:"identity",kind:"message",kt:"result",qt:()=>Me},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>Le},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"identity",identity:Me.se(t,t.uint32(),n,i.result.identity)};break;case 2:i.result={Tt:"proof",br:Le.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"identity"===t.result.Tt&&Me.le(t.result.identity,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&Le.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Me=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityResponse",[{p:1,name:"identity",kind:"scalar",It:!0,qt:12}])}create(t){const e=globalThis.Object.create(this.de);return void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.identity=t.bytes();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){void 0!==t.identity&&e.tag(1,c.A).bytes(t.identity);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Le=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityByNonUniquePublicKeyHashResponse.GetIdentityByNonUniquePublicKeyHashResponseV0.IdentityProvedResponse",[{p:1,name:"grovedb_identity_public_key_hash_proof",kind:"message",qt:()=>St},{p:2,name:"identity_proof_bytes",kind:"scalar",It:!0,qt:12}])}create(t){const e=globalThis.Object.create(this.de);return void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.zr=St.se(t,t.uint32(),n,i.zr);break;case 2:i.Xr=t.bytes();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.zr&&St.le(t.zr,e.tag(1,c.A).ut(),n).join(),void 0!==t.Xr&&e.tag(2,c.A).bytes(t.Xr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ze=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetEpochsInfoRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>qe}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:qe.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&qe.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const qe=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetEpochsInfoRequest.GetEpochsInfoRequestV0",[{p:1,name:"start_epoch",kind:"message",qt:()=>Rt},{p:2,name:"count",kind:"scalar",qt:13},{p:3,name:"ascending",kind:"scalar",qt:8},{p:4,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.count=0,e.Jr=!1,e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Qr=Rt.se(t,t.uint32(),n,i.Qr);break;case 2:i.count=t.uint32();break;case 3:i.Jr=t.J();break;case 4:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.Qr&&Rt.le(t.Qr,e.tag(1,c.A).ut(),n).join(),0!==t.count&&e.tag(2,c.k).uint32(t.count),!1!==t.Jr&&e.tag(3,c.k).J(t.Jr),!1!==t.pr&&e.tag(4,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ye=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetEpochsInfoResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>ze}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:ze.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&ze.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ze=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0",[{p:1,name:"epochs",kind:"message",kt:"result",qt:()=>Xe},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"epochs",ti:Xe.se(t,t.uint32(),n,i.result.ti)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"epochs"===t.result.Tt&&Xe.le(t.result.ti,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Xe=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfos",[{p:1,name:"epoch_infos",kind:"message",repeat:2,qt:()=>Je}])}create(t){const e=globalThis.Object.create(this.de);return e.ei=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.ei.push(Je.se(t,t.uint32(),n));else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let r=0;r<t.ei.length;r++)Je.le(t.ei[r],e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Je=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetEpochsInfoResponse.GetEpochsInfoResponseV0.EpochInfo",[{p:1,name:"number",kind:"scalar",qt:13},{p:2,name:"first_block_height",kind:"scalar",qt:4},{p:3,name:"first_core_block_height",kind:"scalar",qt:13},{p:4,name:"start_time",kind:"scalar",qt:4},{p:5,name:"fee_multiplier",kind:"scalar",qt:1},{p:6,name:"protocol_version",kind:"scalar",qt:13}])}create(t){const e=globalThis.Object.create(this.de);return e.number=0,e.ni="0",e.ri=0,e.startTime="0",e.ii=0,e.ur=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.number=t.uint32();break;case 2:i.ni=t.Y().toString();break;case 3:i.ri=t.uint32();break;case 4:i.startTime=t.Y().toString();break;case 5:i.ii=t.it();break;case 6:i.ur=t.uint32();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.number&&e.tag(1,c.k).uint32(t.number),"0"!==t.ni&&e.tag(2,c.k).Y(t.ni),0!==t.ri&&e.tag(3,c.k).uint32(t.ri),"0"!==t.startTime&&e.tag(4,c.k).Y(t.startTime),0!==t.ii&&e.tag(5,c.T).it(t.ii),0!==t.ur&&e.tag(6,c.k).uint32(t.ur);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Qe=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourcesRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>tn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:tn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&tn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const tn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0",[{p:1,name:"contract_id",kind:"scalar",qt:12},{p:2,name:"document_type_name",kind:"scalar",qt:9},{p:3,name:"index_name",kind:"scalar",qt:9},{p:4,name:"start_index_values",kind:"scalar",repeat:2,qt:12},{p:5,name:"end_index_values",kind:"scalar",repeat:2,qt:12},{p:6,name:"start_at_value_info",kind:"message",qt:()=>en},{p:7,name:"count",kind:"scalar",It:!0,qt:13},{p:8,name:"order_ascending",kind:"scalar",qt:8},{p:9,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.gr=new Uint8Array(0),e.Vr="",e.oi="",e.si=[],e.ai=[],e.ci=!1,e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.gr=t.bytes();break;case 2:i.Vr=t.string();break;case 3:i.oi=t.string();break;case 4:i.si.push(t.bytes());break;case 5:i.ai.push(t.bytes());break;case 6:i.li=en.se(t,t.uint32(),n,i.li);break;case 7:i.count=t.uint32();break;case 8:i.ci=t.J();break;case 9:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.gr.length&&e.tag(1,c.A).bytes(t.gr),""!==t.Vr&&e.tag(2,c.A).string(t.Vr),""!==t.oi&&e.tag(3,c.A).string(t.oi);for(let n=0;n<t.si.length;n++)e.tag(4,c.A).bytes(t.si[n]);for(let n=0;n<t.ai.length;n++)e.tag(5,c.A).bytes(t.ai[n]);t.li&&en.le(t.li,e.tag(6,c.A).ut(),n).join(),void 0!==t.count&&e.tag(7,c.k).uint32(t.count),!1!==t.ci&&e.tag(8,c.k).J(t.ci),!1!==t.pr&&e.tag(9,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const en=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourcesRequest.GetContestedResourcesRequestV0.StartAtValueInfo",[{p:1,name:"start_value",kind:"scalar",qt:12},{p:2,name:"start_value_included",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.ui=new Uint8Array(0),e.hi=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.ui=t.bytes();break;case 2:i.hi=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.ui.length&&e.tag(1,c.A).bytes(t.ui),!1!==t.hi&&e.tag(2,c.k).J(t.hi);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const nn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourcesResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>rn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:rn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&rn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const rn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0",[{p:1,name:"contested_resource_values",kind:"message",kt:"result",qt:()=>on},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"contestedResourceValues",fi:on.se(t,t.uint32(),n,i.result.fi)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"contestedResourceValues"===t.result.Tt&&on.le(t.result.fi,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const on=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourcesResponse.GetContestedResourcesResponseV0.ContestedResourceValues",[{p:1,name:"contested_resource_values",kind:"scalar",repeat:2,qt:12}])}create(t){const e=globalThis.Object.create(this.de);return e.fi=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.fi.push(t.bytes());else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let n=0;n<t.fi.length;n++)e.tag(1,c.A).bytes(t.fi[n]);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const sn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>an}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:an.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&an.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const an=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0",[{p:1,name:"contract_id",kind:"scalar",qt:12},{p:2,name:"document_type_name",kind:"scalar",qt:9},{p:3,name:"index_name",kind:"scalar",qt:9},{p:4,name:"index_values",kind:"scalar",repeat:2,qt:12},{p:5,name:"result_type",kind:"enum",qt:()=>["org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.ResultType",Nt]},{p:6,name:"allow_include_locked_and_abstaining_vote_tally",kind:"scalar",qt:8},{p:7,name:"start_at_identifier_info",kind:"message",qt:()=>cn},{p:8,name:"count",kind:"scalar",It:!0,qt:13},{p:9,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.gr=new Uint8Array(0),e.Vr="",e.oi="",e.di=[],e.resultType=0,e.wi=!1,e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.gr=t.bytes();break;case 2:i.Vr=t.string();break;case 3:i.oi=t.string();break;case 4:i.di.push(t.bytes());break;case 5:i.resultType=t.int32();break;case 6:i.wi=t.J();break;case 7:i.pi=cn.se(t,t.uint32(),n,i.pi);break;case 8:i.count=t.uint32();break;case 9:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.gr.length&&e.tag(1,c.A).bytes(t.gr),""!==t.Vr&&e.tag(2,c.A).string(t.Vr),""!==t.oi&&e.tag(3,c.A).string(t.oi);for(let n=0;n<t.di.length;n++)e.tag(4,c.A).bytes(t.di[n]);0!==t.resultType&&e.tag(5,c.k).int32(t.resultType),!1!==t.wi&&e.tag(6,c.k).J(t.wi),t.pi&&cn.le(t.pi,e.tag(7,c.A).ut(),n).join(),void 0!==t.count&&e.tag(8,c.k).uint32(t.count),!1!==t.pr&&e.tag(9,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const cn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourceVoteStateRequest.GetContestedResourceVoteStateRequestV0.StartAtIdentifierInfo",[{p:1,name:"start_identifier",kind:"scalar",qt:12},{p:2,name:"start_identifier_included",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.yi=new Uint8Array(0),e.gi=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.yi=t.bytes();break;case 2:i.gi=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.yi.length&&e.tag(1,c.A).bytes(t.yi),!1!==t.gi&&e.tag(2,c.k).J(t.gi);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ln=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>un}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:un.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&un.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const un=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0",[{p:1,name:"contested_resource_contenders",kind:"message",kt:"result",qt:()=>fn},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"contestedResourceContenders",bi:fn.se(t,t.uint32(),n,i.result.bi)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"contestedResourceContenders"===t.result.Tt&&fn.le(t.result.bi,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const hn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo",[{p:1,name:"finished_vote_outcome",kind:"enum",qt:()=>["org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.FinishedVoteInfo.FinishedVoteOutcome",xt]},{p:2,name:"won_by_identity_id",kind:"scalar",It:!0,qt:12},{p:3,name:"finished_at_block_height",kind:"scalar",qt:4},{p:4,name:"finished_at_core_block_height",kind:"scalar",qt:13},{p:5,name:"finished_at_block_time_ms",kind:"scalar",qt:4},{p:6,name:"finished_at_epoch",kind:"scalar",qt:13}])}create(t){const e=globalThis.Object.create(this.de);return e.mi=0,e.Ii="0",e.ki=0,e.Ti="0",e.Ai=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.mi=t.int32();break;case 2:i.Bi=t.bytes();break;case 3:i.Ii=t.Y().toString();break;case 4:i.ki=t.uint32();break;case 5:i.Ti=t.Y().toString();break;case 6:i.Ai=t.uint32();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.mi&&e.tag(1,c.k).int32(t.mi),void 0!==t.Bi&&e.tag(2,c.A).bytes(t.Bi),"0"!==t.Ii&&e.tag(3,c.k).Y(t.Ii),0!==t.ki&&e.tag(4,c.k).uint32(t.ki),"0"!==t.Ti&&e.tag(5,c.k).Y(t.Ti),0!==t.Ai&&e.tag(6,c.k).uint32(t.Ai);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const fn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.ContestedResourceContenders",[{p:1,name:"contenders",kind:"message",repeat:2,qt:()=>dn},{p:2,name:"abstain_vote_tally",kind:"scalar",It:!0,qt:13},{p:3,name:"lock_vote_tally",kind:"scalar",It:!0,qt:13},{p:4,name:"finished_vote_info",kind:"message",qt:()=>hn}])}create(t){const e=globalThis.Object.create(this.de);return e.Ei=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Ei.push(dn.se(t,t.uint32(),n));break;case 2:i.Ri=t.uint32();break;case 3:i.Pi=t.uint32();break;case 4:i.Ni=hn.se(t,t.uint32(),n,i.Ni);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let r=0;r<t.Ei.length;r++)dn.le(t.Ei[r],e.tag(1,c.A).ut(),n).join();void 0!==t.Ri&&e.tag(2,c.k).uint32(t.Ri),void 0!==t.Pi&&e.tag(3,c.k).uint32(t.Pi),t.Ni&&hn.le(t.Ni,e.tag(4,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const dn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetContestedResourceVoteStateResponse.GetContestedResourceVoteStateResponseV0.Contender",[{p:1,name:"identifier",kind:"scalar",qt:12},{p:2,name:"vote_count",kind:"scalar",It:!0,qt:13},{p:3,name:"document",kind:"scalar",It:!0,qt:12}])}create(t){const e=globalThis.Object.create(this.de);return e.identifier=new Uint8Array(0),void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.identifier=t.bytes();break;case 2:i.xi=t.uint32();break;case 3:i.document=t.bytes();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.identifier.length&&e.tag(1,c.A).bytes(t.identifier),void 0!==t.xi&&e.tag(2,c.k).uint32(t.xi),void 0!==t.document&&e.tag(3,c.A).bytes(t.document);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const wn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>pn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:pn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&pn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const pn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTotalCreditsInPlatformRequest.GetTotalCreditsInPlatformRequestV0",[{p:1,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.pr=t.J();else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){!1!==t.pr&&e.tag(1,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const yn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>gn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:gn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&gn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const gn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTotalCreditsInPlatformResponse.GetTotalCreditsInPlatformResponseV0",[{p:1,name:"credits",kind:"scalar",kt:"result",qt:4},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"credits",$i:t.Y().toString()};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"credits"===t.result.Tt&&e.tag(1,c.k).Y(t.result.$i),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const bn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>mn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:mn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&mn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const mn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusRequest.GetStatusRequestV0",[])}create(t){const e=globalThis.Object.create(this.de);return void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const vn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>In}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:In.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&In.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const In=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0",[{p:1,name:"version",kind:"message",qt:()=>kn},{p:2,name:"node",kind:"message",qt:()=>Pn},{p:3,name:"chain",kind:"message",qt:()=>Nn},{p:4,name:"network",kind:"message",qt:()=>xn},{p:5,name:"state_sync",kind:"message",qt:()=>$n},{p:6,name:"time",kind:"message",qt:()=>Rn}])}create(t){const e=globalThis.Object.create(this.de);return void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.version=kn.se(t,t.uint32(),n,i.version);break;case 2:i.node=Pn.se(t,t.uint32(),n,i.node);break;case 3:i.chain=Nn.se(t,t.uint32(),n,i.chain);break;case 4:i.Ui=xn.se(t,t.uint32(),n,i.Ui);break;case 5:i.Si=$n.se(t,t.uint32(),n,i.Si);break;case 6:i.time=Rn.se(t,t.uint32(),n,i.time);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.version&&kn.le(t.version,e.tag(1,c.A).ut(),n).join(),t.node&&Pn.le(t.node,e.tag(2,c.A).ut(),n).join(),t.chain&&Nn.le(t.chain,e.tag(3,c.A).ut(),n).join(),t.Ui&&xn.le(t.Ui,e.tag(4,c.A).ut(),n).join(),t.Si&&$n.le(t.Si,e.tag(5,c.A).ut(),n).join(),t.time&&Rn.le(t.time,e.tag(6,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const kn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version",[{p:1,name:"software",kind:"message",qt:()=>Tn},{p:2,name:"protocol",kind:"message",qt:()=>An}])}create(t){const e=globalThis.Object.create(this.de);return void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Ci=Tn.se(t,t.uint32(),n,i.Ci);break;case 2:i.protocol=An.se(t,t.uint32(),n,i.protocol);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.Ci&&Tn.le(t.Ci,e.tag(1,c.A).ut(),n).join(),t.protocol&&An.le(t.protocol,e.tag(2,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Tn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Software",[{p:1,name:"dapi",kind:"scalar",qt:9},{p:2,name:"drive",kind:"scalar",It:!0,qt:9},{p:3,name:"tenderdash",kind:"scalar",It:!0,qt:9}])}create(t){const e=globalThis.Object.create(this.de);return e.Gi="",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Gi=t.string();break;case 2:i.Vi=t.string();break;case 3:i.Ki=t.string();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){""!==t.Gi&&e.tag(1,c.A).string(t.Gi),void 0!==t.Vi&&e.tag(2,c.A).string(t.Vi),void 0!==t.Ki&&e.tag(3,c.A).string(t.Ki);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const An=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol",[{p:1,name:"tenderdash",kind:"message",qt:()=>Bn},{p:2,name:"drive",kind:"message",qt:()=>En}])}create(t){const e=globalThis.Object.create(this.de);return void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Ki=Bn.se(t,t.uint32(),n,i.Ki);break;case 2:i.Vi=En.se(t,t.uint32(),n,i.Vi);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.Ki&&Bn.le(t.Ki,e.tag(1,c.A).ut(),n).join(),t.Vi&&En.le(t.Vi,e.tag(2,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Bn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Tenderdash",[{p:1,name:"p2p",kind:"scalar",bt:"p2p",qt:13},{p:2,name:"block",kind:"scalar",qt:13}])}create(t){const e=globalThis.Object.create(this.de);return e.Oi=0,e.Fi=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Oi=t.uint32();break;case 2:i.Fi=t.uint32();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.Oi&&e.tag(1,c.k).uint32(t.Oi),0!==t.Fi&&e.tag(2,c.k).uint32(t.Fi);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const En=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Version.Protocol.Drive",[{p:3,name:"latest",kind:"scalar",qt:13},{p:4,name:"current",kind:"scalar",qt:13}])}create(t){const e=globalThis.Object.create(this.de);return e.Wi=0,e.Di=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 3:i.Wi=t.uint32();break;case 4:i.Di=t.uint32();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.Wi&&e.tag(3,c.k).uint32(t.Wi),0!==t.Di&&e.tag(4,c.k).uint32(t.Di);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Rn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Time",[{p:1,name:"local",kind:"scalar",qt:4},{p:2,name:"block",kind:"scalar",It:!0,qt:4},{p:3,name:"genesis",kind:"scalar",It:!0,qt:4},{p:4,name:"epoch",kind:"scalar",It:!0,qt:13}])}create(t){const e=globalThis.Object.create(this.de);return e._i="0",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i._i=t.Y().toString();break;case 2:i.Fi=t.Y().toString();break;case 3:i.Hi=t.Y().toString();break;case 4:i.cr=t.uint32();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"0"!==t._i&&e.tag(1,c.k).Y(t._i),void 0!==t.Fi&&e.tag(2,c.k).Y(t.Fi),void 0!==t.Hi&&e.tag(3,c.k).Y(t.Hi),void 0!==t.cr&&e.tag(4,c.k).uint32(t.cr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Pn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Node",[{p:1,name:"id",kind:"scalar",qt:12},{p:2,name:"pro_tx_hash",kind:"scalar",It:!0,qt:12}])}create(t){const e=globalThis.Object.create(this.de);return e.id=new Uint8Array(0),void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.id=t.bytes();break;case 2:i.ji=t.bytes();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.id.length&&e.tag(1,c.A).bytes(t.id),void 0!==t.ji&&e.tag(2,c.A).bytes(t.ji);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Nn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Chain",[{p:1,name:"catching_up",kind:"scalar",qt:8},{p:2,name:"latest_block_hash",kind:"scalar",qt:12},{p:3,name:"latest_app_hash",kind:"scalar",qt:12},{p:4,name:"latest_block_height",kind:"scalar",qt:4},{p:5,name:"earliest_block_hash",kind:"scalar",qt:12},{p:6,name:"earliest_app_hash",kind:"scalar",qt:12},{p:7,name:"earliest_block_height",kind:"scalar",qt:4},{p:9,name:"max_peer_block_height",kind:"scalar",qt:4},{p:10,name:"core_chain_locked_height",kind:"scalar",It:!0,qt:13}])}create(t){const e=globalThis.Object.create(this.de);return e.Mi=!1,e.Li=new Uint8Array(0),e.Zi=new Uint8Array(0),e.qi="0",e.Yi=new Uint8Array(0),e.zi=new Uint8Array(0),e.Xi="0",e.Ji="0",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.Mi=t.J();break;case 2:i.Li=t.bytes();break;case 3:i.Zi=t.bytes();break;case 4:i.qi=t.Y().toString();break;case 5:i.Yi=t.bytes();break;case 6:i.zi=t.bytes();break;case 7:i.Xi=t.Y().toString();break;case 9:i.Ji=t.Y().toString();break;case 10:i.ar=t.uint32();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){!1!==t.Mi&&e.tag(1,c.k).J(t.Mi),t.Li.length&&e.tag(2,c.A).bytes(t.Li),t.Zi.length&&e.tag(3,c.A).bytes(t.Zi),"0"!==t.qi&&e.tag(4,c.k).Y(t.qi),t.Yi.length&&e.tag(5,c.A).bytes(t.Yi),t.zi.length&&e.tag(6,c.A).bytes(t.zi),"0"!==t.Xi&&e.tag(7,c.k).Y(t.Xi),"0"!==t.Ji&&e.tag(9,c.k).Y(t.Ji),void 0!==t.ar&&e.tag(10,c.k).uint32(t.ar);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const xn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.Network",[{p:1,name:"chain_id",kind:"scalar",qt:9},{p:2,name:"peers_count",kind:"scalar",qt:13},{p:3,name:"listening",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.hr="",e.Qi=0,e.eo=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.hr=t.string();break;case 2:i.Qi=t.uint32();break;case 3:i.eo=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){""!==t.hr&&e.tag(1,c.A).string(t.hr),0!==t.Qi&&e.tag(2,c.k).uint32(t.Qi),!1!==t.eo&&e.tag(3,c.k).J(t.eo);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const $n=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetStatusResponse.GetStatusResponseV0.StateSync",[{p:1,name:"total_synced_time",kind:"scalar",qt:4},{p:2,name:"remaining_time",kind:"scalar",qt:4},{p:3,name:"total_snapshots",kind:"scalar",qt:13},{p:4,name:"chunk_process_avg_time",kind:"scalar",qt:4},{p:5,name:"snapshot_height",kind:"scalar",qt:4},{p:6,name:"snapshot_chunks_count",kind:"scalar",qt:4},{p:7,name:"backfilled_blocks",kind:"scalar",qt:4},{p:8,name:"backfill_blocks_total",kind:"scalar",qt:4}])}create(t){const e=globalThis.Object.create(this.de);return e.no="0",e.ro="0",e.io=0,e.oo="0",e.so="0",e.ao="0",e.co="0",e.lo="0",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.no=t.Y().toString();break;case 2:i.ro=t.Y().toString();break;case 3:i.io=t.uint32();break;case 4:i.oo=t.Y().toString();break;case 5:i.so=t.Y().toString();break;case 6:i.ao=t.Y().toString();break;case 7:i.co=t.Y().toString();break;case 8:i.lo=t.Y().toString();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"0"!==t.no&&e.tag(1,c.k).Y(t.no),"0"!==t.ro&&e.tag(2,c.k).Y(t.ro),0!==t.io&&e.tag(3,c.k).uint32(t.io),"0"!==t.oo&&e.tag(4,c.k).Y(t.oo),"0"!==t.so&&e.tag(5,c.k).Y(t.so),"0"!==t.ao&&e.tag(6,c.k).Y(t.ao),"0"!==t.co&&e.tag(7,c.k).Y(t.co),"0"!==t.lo&&e.tag(8,c.k).Y(t.lo);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Un=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Sn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Sn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Sn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Sn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityTokenBalancesRequest.GetIdentityTokenBalancesRequestV0",[{p:1,name:"identity_id",kind:"scalar",qt:12},{p:2,name:"token_ids",kind:"scalar",repeat:2,qt:12},{p:3,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.yr=new Uint8Array(0),e.uo=[],e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.yr=t.bytes();break;case 2:i.uo.push(t.bytes());break;case 3:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.yr.length&&e.tag(1,c.A).bytes(t.yr);for(let n=0;n<t.uo.length;n++)e.tag(2,c.A).bytes(t.uo[n]);!1!==t.pr&&e.tag(3,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Cn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Gn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Gn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Gn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Gn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0",[{p:1,name:"token_balances",kind:"message",kt:"result",qt:()=>Kn},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"tokenBalances",ho:Kn.se(t,t.uint32(),n,i.result.ho)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"tokenBalances"===t.result.Tt&&Kn.le(t.result.ho,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Vn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalanceEntry",[{p:1,name:"token_id",kind:"scalar",qt:12},{p:2,name:"balance",kind:"scalar",It:!0,qt:4}])}create(t){const e=globalThis.Object.create(this.de);return e.fo=new Uint8Array(0),void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.fo=t.bytes();break;case 2:i.balance=t.Y().toString();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.fo.length&&e.tag(1,c.A).bytes(t.fo),void 0!==t.balance&&e.tag(2,c.k).Y(t.balance);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Kn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentityTokenBalancesResponse.GetIdentityTokenBalancesResponseV0.TokenBalances",[{p:1,name:"token_balances",kind:"message",repeat:2,qt:()=>Vn}])}create(t){const e=globalThis.Object.create(this.de);return e.ho=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.ho.push(Vn.se(t,t.uint32(),n));else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let r=0;r<t.ho.length;r++)Vn.le(t.ho[r],e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const On=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Fn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Fn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Fn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Fn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesRequest.GetIdentitiesTokenBalancesRequestV0",[{p:1,name:"token_id",kind:"scalar",qt:12},{p:2,name:"identity_ids",kind:"scalar",repeat:2,qt:12},{p:3,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.fo=new Uint8Array(0),e.do=[],e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.fo=t.bytes();break;case 2:i.do.push(t.bytes());break;case 3:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.fo.length&&e.tag(1,c.A).bytes(t.fo);for(let n=0;n<t.do.length;n++)e.tag(2,c.A).bytes(t.do[n]);!1!==t.pr&&e.tag(3,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Wn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Dn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Dn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Dn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Dn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0",[{p:1,name:"identity_token_balances",kind:"message",kt:"result",qt:()=>Hn},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"identityTokenBalances",wo:Hn.se(t,t.uint32(),n,i.result.wo)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"identityTokenBalances"===t.result.Tt&&Hn.le(t.result.wo,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const _n=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalanceEntry",[{p:1,name:"identity_id",kind:"scalar",qt:12},{p:2,name:"balance",kind:"scalar",It:!0,qt:4}])}create(t){const e=globalThis.Object.create(this.de);return e.yr=new Uint8Array(0),void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.yr=t.bytes();break;case 2:i.balance=t.Y().toString();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.yr.length&&e.tag(1,c.A).bytes(t.yr),void 0!==t.balance&&e.tag(2,c.k).Y(t.balance);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Hn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetIdentitiesTokenBalancesResponse.GetIdentitiesTokenBalancesResponseV0.IdentityTokenBalances",[{p:1,name:"identity_token_balances",kind:"message",repeat:2,qt:()=>_n}])}create(t){const e=globalThis.Object.create(this.de);return e.wo=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.wo.push(_n.se(t,t.uint32(),n));else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let r=0;r<t.wo.length;r++)_n.le(t.wo[r],e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const jn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenContractInfoRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Mn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Mn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Mn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Mn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenContractInfoRequest.GetTokenContractInfoRequestV0",[{p:1,name:"token_id",kind:"scalar",qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.fo=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.fo=t.bytes();break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.fo.length&&e.tag(1,c.A).bytes(t.fo),!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ln=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenContractInfoResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Zn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Zn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Zn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Zn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenContractInfoResponse.GetTokenContractInfoResponseV0",[{p:1,name:"data",kind:"message",kt:"result",qt:()=>qn},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"data",data:qn.se(t,t.uint32(),n,i.result.data)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"data"===t.result.Tt&&qn.le(t.result.data,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const qn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenContractInfoResponse.GetTokenContractInfoResponseV0.TokenContractInfoData",[{p:1,name:"contract_id",kind:"scalar",qt:12},{p:2,name:"token_contract_position",kind:"scalar",qt:13}])}create(t){const e=globalThis.Object.create(this.de);return e.gr=new Uint8Array(0),e.po=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.gr=t.bytes();break;case 2:i.po=t.uint32();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.gr.length&&e.tag(1,c.A).bytes(t.gr),0!==t.po&&e.tag(2,c.k).uint32(t.po);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Yn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>zn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:zn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&zn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const zn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesRequest.GetTokenDirectPurchasePricesRequestV0",[{p:1,name:"token_ids",kind:"scalar",repeat:2,qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.uo=[],e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.uo.push(t.bytes());break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let n=0;n<t.uo.length;n++)e.tag(1,c.A).bytes(t.uo[n]);!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Xn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Jn}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Jn.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Jn.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Jn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0",[{p:1,name:"token_direct_purchase_prices",kind:"message",kt:"result",qt:()=>nr},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"tokenDirectPurchasePrices",yo:nr.se(t,t.uint32(),n,i.result.yo)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"tokenDirectPurchasePrices"===t.result.Tt&&nr.le(t.result.yo,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Qn=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PriceForQuantity",[{p:1,name:"quantity",kind:"scalar",qt:4},{p:2,name:"price",kind:"scalar",qt:4}])}create(t){const e=globalThis.Object.create(this.de);return e.bo="0",e.mo="0",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.bo=t.Y().toString();break;case 2:i.mo=t.Y().toString();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"0"!==t.bo&&e.tag(1,c.k).Y(t.bo),"0"!==t.mo&&e.tag(2,c.k).Y(t.mo);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const tr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.PricingSchedule",[{p:1,name:"price_for_quantity",kind:"message",repeat:2,qt:()=>Qn}])}create(t){const e=globalThis.Object.create(this.de);return e.vo=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.vo.push(Qn.se(t,t.uint32(),n));else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let r=0;r<t.vo.length;r++)Qn.le(t.vo[r],e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const er=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePriceEntry",[{p:1,name:"token_id",kind:"scalar",qt:12},{p:2,name:"fixed_price",kind:"scalar",kt:"price",qt:4},{p:3,name:"variable_price",kind:"message",kt:"price",qt:()=>tr}])}create(t){const e=globalThis.Object.create(this.de);return e.fo=new Uint8Array(0),e.mo={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.fo=t.bytes();break;case 2:i.mo={Tt:"fixedPrice",Io:t.Y().toString()};break;case 3:i.mo={Tt:"variablePrice",ko:tr.se(t,t.uint32(),n,i.mo.ko)};break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.fo.length&&e.tag(1,c.A).bytes(t.fo),"fixedPrice"===t.mo.Tt&&e.tag(2,c.k).Y(t.mo.Io),"variablePrice"===t.mo.Tt&&tr.le(t.mo.ko,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const nr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenDirectPurchasePricesResponse.GetTokenDirectPurchasePricesResponseV0.TokenDirectPurchasePrices",[{p:1,name:"token_direct_purchase_price",kind:"message",repeat:2,qt:()=>er}])}create(t){const e=globalThis.Object.create(this.de);return e.To=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.To.push(er.se(t,t.uint32(),n));else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let r=0;r<t.To.length;r++)er.le(t.To[r],e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const rr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>ir}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:ir.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&ir.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ir=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenTotalSupplyRequest.GetTokenTotalSupplyRequestV0",[{p:1,name:"token_id",kind:"scalar",qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.fo=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.fo=t.bytes();break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.fo.length&&e.tag(1,c.A).bytes(t.fo),!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const or=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>sr}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:sr.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&sr.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const sr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0",[{p:1,name:"token_total_supply",kind:"message",kt:"result",qt:()=>ar},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"tokenTotalSupply",Ao:ar.se(t,t.uint32(),n,i.result.Ao)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"tokenTotalSupply"===t.result.Tt&&ar.le(t.result.Ao,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ar=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetTokenTotalSupplyResponse.GetTokenTotalSupplyResponseV0.TokenTotalSupplyEntry",[{p:1,name:"token_id",kind:"scalar",qt:12},{p:2,name:"total_aggregated_amount_in_user_accounts",kind:"scalar",qt:4},{p:3,name:"total_system_amount",kind:"scalar",qt:4}])}create(t){const e=globalThis.Object.create(this.de);return e.fo=new Uint8Array(0),e.Bo="0",e.Eo="0",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.fo=t.bytes();break;case 2:i.Bo=t.Y().toString();break;case 3:i.Eo=t.Y().toString();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.fo.length&&e.tag(1,c.A).bytes(t.fo),"0"!==t.Bo&&e.tag(2,c.k).Y(t.Bo),"0"!==t.Eo&&e.tag(3,c.k).Y(t.Eo);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const cr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.StateId",[{p:1,name:"app_version",kind:"scalar",qt:6},{p:2,name:"height",kind:"scalar",qt:6},{p:3,name:"app_hash",kind:"scalar",qt:12},{p:4,name:"core_chain_locked_height",kind:"scalar",qt:7},{p:5,name:"time",kind:"scalar",qt:6}])}create(t){const e=globalThis.Object.create(this.de);return e.appVersion="0",e.height="0",e.Ro=new Uint8Array(0),e.ar=0,e.time="0",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.appVersion=t.nt().toString();break;case 2:i.height=t.nt().toString();break;case 3:i.Ro=t.bytes();break;case 4:i.ar=t.tt();break;case 5:i.time=t.nt().toString();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"0"!==t.appVersion&&e.tag(1,c.T).nt(t.appVersion),"0"!==t.height&&e.tag(2,c.T).nt(t.height),t.Ro.length&&e.tag(3,c.A).bytes(t.Ro),0!==t.ar&&e.tag(4,c.P).tt(t.ar),"0"!==t.time&&e.tag(5,c.T).nt(t.time);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const lr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.CanonicalVote",[{p:1,name:"type",kind:"enum",qt:()=>["org.dash.platform.dapi.v0.SignedMsgType",Ut]},{p:2,name:"height",kind:"scalar",qt:16},{p:3,name:"round",kind:"scalar",qt:16},{p:4,name:"block_id",kind:"scalar",qt:12},{p:5,name:"state_id",kind:"scalar",qt:12},{p:99,name:"chain_id",kind:"scalar",qt:9}])}create(t){const e=globalThis.Object.create(this.de);return e.type=0,e.height="0",e.round="0",e.Po=new Uint8Array(0),e.No=new Uint8Array(0),e.hr="",void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.type=t.int32();break;case 2:i.height=t.rt().toString();break;case 3:i.round=t.rt().toString();break;case 4:i.Po=t.bytes();break;case 5:i.No=t.bytes();break;case 99:i.hr=t.string();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){0!==t.type&&e.tag(1,c.k).int32(t.type),"0"!==t.height&&e.tag(2,c.T).rt(t.height),"0"!==t.round&&e.tag(3,c.T).rt(t.round),t.Po.length&&e.tag(4,c.A).bytes(t.Po),t.No.length&&e.tag(5,c.A).bytes(t.No),""!==t.hr&&e.tag(99,c.A).string(t.hr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const ur=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>hr}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:hr.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&hr.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const hr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.WaitForStateTransitionResultRequestV0",[{p:1,name:"state_transition_hash",kind:"scalar",qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.xo=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.xo=t.bytes();break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.xo.length&&e.tag(1,c.A).bytes(t.xo),!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const fr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>dr}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:dr.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&dr.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const dr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.WaitForStateTransitionResultResponseV0",[{p:1,name:"error",kind:"message",kt:"result",qt:()=>Gt},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"error",error:Gt.se(t,t.uint32(),n,i.result.error)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"error"===t.result.Tt&&Gt.le(t.result.error,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const wr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetAddressInfoRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>pr}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:pr.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&pr.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const pr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetAddressInfoRequest.GetAddressInfoRequestV0",[{p:1,name:"address",kind:"scalar",qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.address=new Uint8Array(0),e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.address=t.bytes();break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.address.length&&e.tag(1,c.A).bytes(t.address),!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const yr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.AddressInfoEntry",[{p:1,name:"address",kind:"scalar",qt:12},{p:2,name:"balance_and_nonce",kind:"message",qt:()=>gr}])}create(t){const e=globalThis.Object.create(this.de);return e.address=new Uint8Array(0),void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.address=t.bytes();break;case 2:i.$o=gr.se(t,t.uint32(),n,i.$o);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){t.address.length&&e.tag(1,c.A).bytes(t.address),t.$o&&gr.le(t.$o,e.tag(2,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const gr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.BalanceAndNonce",[{p:1,name:"balance",kind:"scalar",qt:4},{p:2,name:"nonce",kind:"scalar",qt:13}])}create(t){const e=globalThis.Object.create(this.de);return e.balance="0",e.nonce=0,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.balance=t.Y().toString();break;case 2:i.nonce=t.uint32();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"0"!==t.balance&&e.tag(1,c.k).Y(t.balance),0!==t.nonce&&e.tag(2,c.k).uint32(t.nonce);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const br=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetAddressInfoResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>mr}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:mr.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&mr.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const mr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetAddressInfoResponse.GetAddressInfoResponseV0",[{p:1,name:"address_info_entry",kind:"message",kt:"result",qt:()=>yr},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"addressInfoEntry",Uo:yr.se(t,t.uint32(),n,i.result.Uo)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"addressInfoEntry"===t.result.Tt&&yr.le(t.result.Uo,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const vr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetAddressesInfosRequest",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Ir}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Ir.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Ir.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ir=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetAddressesInfosRequest.GetAddressesInfosRequestV0",[{p:1,name:"addresses",kind:"scalar",repeat:2,qt:12},{p:2,name:"prove",kind:"scalar",qt:8}])}create(t){const e=globalThis.Object.create(this.de);return e.So=[],e.pr=!1,void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.So.push(t.bytes());break;case 2:i.pr=t.J();break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let n=0;n<t.So.length;n++)e.tag(1,c.A).bytes(t.So[n]);!1!==t.pr&&e.tag(2,c.k).J(t.pr);let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const kr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.AddressInfoEntries",[{p:1,name:"address_info_entries",kind:"message",repeat:2,qt:()=>yr}])}create(t){const e=globalThis.Object.create(this.de);return e.Co=[],void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.Co.push(yr.se(t,t.uint32(),n));else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){for(let r=0;r<t.Co.length;r++)yr.le(t.Co[r],e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Tr=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetAddressesInfosResponse",[{p:1,name:"v0",kind:"message",kt:"version",qt:()=>Ar}])}create(t){const e=globalThis.Object.create(this.de);return e.version={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();if(1===e)i.version={Tt:"v0",wr:Ar.se(t,t.uint32(),n,i.version.wr)};else{let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"v0"===t.version.Tt&&Ar.le(t.version.wr,e.tag(1,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}};const Ar=new class extends rt{constructor(){super("org.dash.platform.dapi.v0.GetAddressesInfosResponse.GetAddressesInfosResponseV0",[{p:1,name:"address_info_entries",kind:"message",kt:"result",qt:()=>kr},{p:2,name:"proof",kind:"message",kt:"result",qt:()=>St},{p:3,name:"metadata",kind:"message",qt:()=>Ct}])}create(t){const e=globalThis.Object.create(this.de);return e.result={Tt:void 0},void 0!==t&&z(this,e,t),e}se(t,e,n,r){let i=r??this.create(),o=t.o+e;for(;t.o<o;){let[e,r]=t.tag();switch(e){case 1:i.result={Tt:"addressInfoEntries",Co:kr.se(t,t.uint32(),n,i.result.Co)};break;case 2:i.result={Tt:"proof",br:St.se(t,t.uint32(),n,i.result.br)};break;case 3:i.metadata=Ct.se(t,t.uint32(),n,i.metadata);break;default:let o=n.D;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.ee}`);let s=t.L(r);!1!==o&&(!0===o?a.h:o)(this.ee,i,e,r,s)}}return i}le(t,e,n){"addressInfoEntries"===t.result.Tt&&kr.le(t.result.Co,e.tag(1,c.A).ut(),n).join(),"proof"===t.result.Tt&&St.le(t.result.br,e.tag(2,c.A).ut(),n).join(),t.metadata&&Ct.le(t.metadata,e.tag(3,c.A).ut(),n).join();let r=n.ot;return!1!==r&&(1==r?a.v:r)(this.ee,t,e),e}},Br=new class{constructor(t,e,n){this.ee=t,this.Go=e.map(t=>function(t,e){var n,r,i;let o=t;return o.service=e,o.localName=null!==(n=o.localName)&&void 0!==n?n:K(o.name),o.Vn=!!o.Vn,o.Gn=!!o.Gn,o.options=null!==(r=o.options)&&void 0!==r?r:{},o.Vo=null!==(i=o.Vo)&&void 0!==i?i:void 0,o}(t,this)),this.options=null!=n?n:{}}}("org.dash.platform.dapi.v0.Platform",[{name:"broadcastStateTransition",options:{},On:Vt,Fn:Kt},{name:"getIdentity",options:{},On:Ot,Fn:qt},{name:"getIdentityKeys",options:{},On:ue,Fn:fe},{name:"getIdentitiesContractKeys",options:{},On:pe,Fn:ge},{name:"getIdentityNonce",options:{},On:Wt,Fn:zt},{name:"getIdentityContractNonce",options:{},On:_t,Fn:Jt},{name:"getIdentityBalance",options:{},On:jt,Fn:te},{name:"getIdentitiesBalances",options:{},On:ke,Fn:Ae},{name:"getIdentityBalanceAndRevision",options:{},On:Lt,Fn:ne},{name:"getDataContract",options:{},On:Pe,Fn:xe},{name:"getDocuments",options:{},On:Ue,Fn:Ce},{name:"getIdentityByPublicKeyHash",options:{},On:Ke,Fn:Fe},{name:"getIdentityByNonUniquePublicKeyHash",options:{},On:De,Fn:He},{name:"getEpochsInfo",options:{},On:Ze,Fn:Ye},{name:"getContestedResources",options:{},On:Qe,Fn:nn},{name:"getContestedResourceVoteState",options:{},On:sn,Fn:ln},{name:"getTotalCreditsInPlatform",options:{},On:wn,Fn:yn},{name:"getStatus",options:{},On:bn,Fn:vn},{name:"getIdentityTokenBalances",options:{},On:Un,Fn:Cn},{name:"getIdentitiesTokenBalances",options:{},On:On,Fn:Wn},{name:"getTokenContractInfo",options:{},On:jn,Fn:Ln},{name:"getTokenDirectPurchasePrices",options:{},On:Yn,Fn:Xn},{name:"getTokenTotalSupply",options:{},On:rr,Fn:or},{name:"waitForStateTransitionResult",options:{},On:ur,Fn:fr},{name:"getAddressInfo",options:{},On:wr,Fn:br},{name:"getAddressesInfos",options:{},On:vr,Fn:Tr}]);class Er{Ko;ee=Br.ee;Go=Br.Go;options=Br.options;constructor(t){this.Ko=t}Oo(t,e){const n=this.Go[0],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Fo(t,e){const n=this.Go[1],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Wo(t,e){const n=this.Go[2],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Do(t,e){const n=this.Go[3],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}_o(t,e){const n=this.Go[4],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Ho(t,e){const n=this.Go[5],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}jo(t,e){const n=this.Go[6],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Mo(t,e){const n=this.Go[7],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Lo(t,e){const n=this.Go[8],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Zo(t,e){const n=this.Go[9],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}qo(t,e){const n=this.Go[10],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Yo(t,e){const n=this.Go[11],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}zo(t,e){const n=this.Go[12],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Xo(t,e){const n=this.Go[13],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Jo(t,e){const n=this.Go[14],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}Qo(t,e){const n=this.Go[15],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}ts(t,e){const n=this.Go[16],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}es(t,e){const n=this.Go[17],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}ns(t,e){const n=this.Go[18],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}rs(t,e){const n=this.Go[19],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}ss(t,e){const n=this.Go[20],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}cs(t,e){const n=this.Go[21],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}ls(t,e){const n=this.Go[22],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}us(t,e){const n=this.Go[23],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}hs(t,e){const n=this.Go[24],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}fs(t,e){const n=this.Go[25],r=this.Ko.xn(e);return wt(0,this.Ko,n,r,t)}}const Rr={ds:["https://158.160.14.115:1443"],ws:["https://158.160.14.115:443"]},Pr=(t,e)=>new Er(new Et({Cn:t,abort:e?.signal}));class Nr{ps;Ui;constructor(t,e){const n=e?.ys??5;this.Ui=t,this.gs(t,n,e?.bs).catch(console.error)}async gs(t,e,n){if("string"==typeof n)return void(this.ps=[n]);if(Array.isArray(n))return void(this.ps=n);if(null!=n)throw new Error("Unrecognized DAPI URL");this.ps=Rr[t];const r=await async function(t){const e=`https://${"mainnet"===t?"":"testnet."}platform-explorer.pshenmic.dev/validators?isActive=true`,n=await fetch(e);if(200!==n.status)throw new Error("Failed to query Platform Explorer for active validators");const{vs:r}=await n.json();return r.map(e=>e?.Is?.state?.service?`https://${e.Is.state.service.split(":")[0]}${"mainnet"===t?"":":1443"}`:void 0).filter(t=>null!=t)}(t),i=Object.entries(r).map(([,t])=>t).filter(t=>"ENABLED"===t.status).map(t=>{const[e]=t.address.split(":");return`https://${e}:${t.ks}`});for(const t of i){if(this.ps.length>e)break;try{const e=Pr(t),{response:n}=await e.es(bn.create({}));"v0"===n.version.Tt&&null!=n.version.wr.chain&&this.ps.push(t)}catch(t){}}}Ts(t){const e=function(t){return t[Math.floor(Math.random()*t.length)]}(this.ps);return Pr(e,t)}}const{As:xr}=require("@tybys/wasm-util"),{Bs:$r}=require("@emnapi/runtime"),{Es:Ur}=require("@emnapi/core"),{bytes:Sr}=require("./wasm/wasmBytes.cjs"),{decode:Cr}=require("../utils/base122.cjs"),{Rs:Gr}=require("fflate"),Vr=new Uint8Array(Cr(Sr)),Kr=new xr({version:"preview1",print:function(){console.log.apply(console,arguments)},Ps:function(){console.error.apply(console,arguments)}}),Or=$r();Or.xs.Ns=!1,Or.xs.$s=!1;const Fr=new WebAssembly.Memory({Us:1e3,Ss:2e3,Cs:!0}),Wr=Ur(Gr(Vr),{context:Or,Gs:Kr,Vs(t){t.Ks={...t.Ks,...t.Os,...t.Fs,memory:Fr}},Ws({Ds:t}){for(const e of Object.keys(t.exports))e.startsWith("__napi_register__")&&t.exports[e]()}});module.exports=Wr._s.exports,module.exports.default=Wr._s.exports;const{Hs:Dr,js:_r,Ms:Hr,Ls:jr,Zs:Mr,qs:Lr,Ys:Zr,zs:qr,Xs:Yr,Js:zr,Qs:Xr,ta:Jr,ea:Qr,na:ti,ra:ei,ia:ni,oa:ri,sa:ii,aa:oi,ca:si,la:ai,ua:ci,ha:li,fa:ui,da:hi,wa:fi,pa:di,ya:wi,ga:pi,ba:yi,ma:gi,va:bi,Ia:mi,ka:vi,Ta:Ii,Aa:ki,Ba:Ti,Ea:Ai,Ra:Bi,Pa:Ei,Na:Ri,xa:Pi,$a:Ni,Ua:xi,Sa:$i,Ca:Ui,Ga:Si,Va:Ci,Ka:Gi,Oa:Vi,Fa:Ki,Wa:Oi,Da:Fi,_a:Wi,Ha:Di,ja:_i,Ma:Hi,La:ji,Za:Mi,qa:Li,Ya:Zi,za:qi,Xa:Yi,Ja:zi,Qa:Xi,tc:Ji,ec:Qi,nc:to,rc:eo,oc:no,sc:ro,ac:io,cc:oo,lc:so,uc:ao,hc:co,fc:lo,dc:uo,wc:ho,yc:fo,gc:wo,bc:po,mc:yo,vc:go,Ic:bo,kc:mo,Tc:vo,Ac:Io,Bc:ko,Ec:To,Rc:Ao,Pc:Bo,Nc:Eo,xc:Ro,$c:Po,Uc:No,Sc:xo,Cc:$o,Gc:Uo,Vc:So,Kc:Co,Oc:Go,Fc:Vo,Wc:Ko,Dc:Oo,_c:Fo,Hc:Wo,jc:Do,Mc:_o,Lc:Ho,Zc:jo,qc:Mo,Yc:Lo,zc:Zo,Xc:qo,Jc:Yo,Qc:zo,tl:Xo,el:Jo,nl:Qo,rl:ts,il:es,ol:ns,sl:rs,al:is,cl:os,ll:ss,ul:as,hl:cs,fl:ls,dl:us,wl:hs,pl:fs,yl:ds,gl:ws,bl:ps,ml:ys,vl:gs,Il:bs,kl:ms,Tl:vs,Al:Is,Bl:ks,El:Ts,Rl:As,Pl:Bs,Nl:Es,xl:Rs,$l:Ps,Ul:Ns,Sl:xs,Cl:$s,Gl:Us,Vl:Ss,Kl:Cs,Ol:Gs,Fl:Vs,Wl:Ks,Dl:Os,_l:Fs,Hl:Ws,jl:Ds,Ml:_s,Ll:Hs,Zl:js,ql:Ms,Yl:Ls,zl:Zs,Xl:qs,Jl:Ys,Ql:zs,tu:Xs,eu:Js,nu:Qs,ru:ta,iu:ea,ou:na,su:ra,au:ia,cu:oa}=void 0;var sa=Object.freeze({__proto__:null,Yl:Ls,ua:ci,ha:li,fa:ui,da:hi,wa:fi,pa:di,ya:wi,zl:Zs,ga:pi,ba:yi,va:bi,Xl:qs,ma:gi,Ia:mi,ka:vi,Ta:Ii,Aa:ki,Ba:Ti,Ea:Ai,Ra:Bi,Pa:Ei,Na:Ri,xa:Pi,$a:Ni,Ua:xi,Sa:$i,Ca:Ui,Ga:Si,Va:Ci,Ka:Gi,Oa:Vi,Fa:Ki,Wa:Oi,Da:Fi,_a:Wi,Ha:Di,ja:_i,Ma:Hi,Jl:Ys,Ql:zs,La:ji,Za:Mi,qa:Li,Ya:Zi,za:qi,Xa:Yi,Ja:zi,Qa:Xi,tc:Ji,ec:Qi,nc:to,rc:eo,oc:no,sc:ro,ac:io,cc:oo,lc:so,uc:ao,hc:co,fc:lo,dc:uo,tu:Xs,wc:ho,eu:Js,yc:fo,gc:wo,bc:po,mc:yo,vc:go,Ic:bo,nu:Qs,ru:ta,kc:mo,Tc:vo,Ac:Io,Bc:ko,iu:ea,Ec:To,Rc:Ao,ou:na,Pc:Bo,Nc:Eo,Uc:No,Sc:xo,xc:Ro,$c:Po,Cc:$o,Gc:Uo,Vc:So,Kc:Co,Oc:Go,Fc:Vo,Wc:Ko,Dc:Oo,_c:Fo,Hc:Wo,jc:Do,Mc:_o,Lc:Ho,Zc:jo,qc:Mo,Yc:Lo,su:ra,au:ia,zc:Zo,Xc:qo,Jc:Yo,Qc:zo,tl:Xo,el:Jo,nl:Qo,rl:ts,il:es,ol:ns,sl:rs,al:is,cl:os,ll:ss,ul:as,hl:cs,fl:ls,dl:us,wl:hs,pl:fs,yl:ds,gl:ws,bl:ps,ml:ys,vl:gs,Il:bs,kl:ms,Tl:vs,Al:Is,Bl:ks,El:Ts,Rl:As,Pl:Bs,Nl:Es,xl:Rs,Ul:Ns,$l:Ps,Sl:xs,Cl:$s,Gl:Us,Vl:Ss,Kl:Cs,Ol:Gs,Fl:Vs,Wl:Ks,Dl:Os,Hl:Ws,_l:Fs,jl:Ds,Ml:_s,Ll:Hs,Zl:js,cu:oa,ql:Ms,js:_r,Hs:Dr,Ms:Hr,Ls:jr,Zs:Mr,qs:Lr,Ys:Zr,zs:qr,Xs:Yr,Js:zr,Qs:Xr,ta:Jr,ea:Qr,na:ti,ra:ei,ia:ni,oa:ri,aa:oi,sa:ii,ca:si,la:ai});class aa{static Ds;lu=null;constructor(){}static uu(){return null==aa.Ds&&(aa.Ds=new aa),aa.Ds}hu(t){this.lu=t}get fu(){if(null==this.lu)throw new Error("DashPlatformProtocol (dpp) has not been set. Call setDpp() before using SDK classes.");return this.lu}}const ca=aa.uu();var la,ua,ha,fa,da,wa,pa,ya,ga,ba,ma,va,Ia,ka;!function(t){t[t.du=0]="ActionCompletion",t[t.wu=1]="ActionParticipation"}(la||(la={})),function(t){t[t.pu=0]="Instant",t[t.yu=1]="Chain"}(ua||(ua={})),function(t){t[t.gu=0]="Create",t[t.bu=1]="Replace",t[t.mu=2]="Delete",t[t.vu=3]="Transfer",t[t.Iu=4]="Purchase",t[t.ku=5]="UpdatePrice",t[t.Tu=6]="IgnoreWhileBumpingRevision"}(ha||(ha={})),function(t){t[t.Au=0]="DocumentOwner",t[t.Bu=1]="ContractOwner",t[t.Eu=2]="PreferContractOwner"}(fa||(fa={})),function(t){t[t.Ru=0]="ActionActive",t[t.Pu=1]="ActionClosed"}(da||(da={})),function(t){t[t.Nu=0]="ECDSA_SECP256K1",t[t.xu=1]="BLS12_381",t[t.$u=2]="ECDSA_HASH160",t[t.Uu=3]="BIP13_SCRIPT_HASH",t[t.Su=4]="EDDSA_25519_HASH160"}(wa||(wa={})),function(t){t[t.Cu=0]="Mainnet",t[t.Gu=1]="Testnet",t[t.Vu=2]="Devnet",t[t.Ku=3]="Regtest"}(pa||(pa={})),function(t){t[t.Ou=1]="PLATFORM_V1",t[t.Fu=2]="PLATFORM_V2",t[t.Wu=3]="PLATFORM_V3",t[t.Du=4]="PLATFORM_V4",t[t._u=5]="PLATFORM_V5",t[t.Hu=6]="PLATFORM_V6",t[t.ju=7]="PLATFORM_V7",t[t.Mu=8]="PLATFORM_V8",t[t.Lu=9]="PLATFORM_V9",t[t.Zu=10]="PLATFORM_V10",t[t.qu=11]="PLATFORM_V11",t[t.Yu=12]="PLATFORM_V12"}(ya||(ya={})),function(t){t[t.zu=0]="Never",t[t.Xu=1]="IfAvailable",t[t.Ju=2]="Standard"}(ga||(ga={})),function(t){t[t.qn=0]="AUTHENTICATION",t[t.Yn=1]="ENCRYPTION",t[t.zn=2]="DECRYPTION",t[t.Xn=3]="TRANSFER",t[t.Qu=4]="SYSTEM",t[t.Jn=5]="VOTING",t[t.th=6]="OWNER"}(ba||(ba={})),function(t){t[t.eh=0]="MASTER",t[t.nh=1]="CRITICAL",t[t.rh=2]="HIGH",t[t.ih=3]="MEDIUM"}(ma||(ma={})),function(t){t[t.oh=0]="PreProgrammed",t[t.sh=1]="Perpetual"}(va||(va={})),function(t){t[t.ah=0]="Pause",t[t.uh=1]="Resume"}(Ia||(Ia={})),function(t){t[t._n=0]="DOCUMENTS",t[t.Hn=1]="VOTE_TALLY",t[t.jn=2]="DOCUMENTS_AND_VOTE_TALLY"}(ka||(ka={}));class Ta{hh;constructor(t,e){const n=t.toString();this.hh=new ca.fu.wl(n,e)}get value(){return BigInt(this.hh.value)}set value(t){this.hh.value=t.toString()}get fh(){return this.hh.fh}set fh(t){this.hh.fh=t}get dh(){return this.hh.dh}set dh(t){this.hh.dh=t}wh(){return this.hh.wh()}static ph(t){const e=Object.create(Ta.prototype);return e.hh=t,e}}class Aa{yh;constructor(t,e){this.yh=new ca.fu.yc(t,e)}gh(){return this.yh.gh()}bh(){return this.yh.bh()}bytes(){return this.yh.bytes()}mh(){return this.yh.mh()}Ih(){return this.yh.Ih()}static kh(t){const e=ca.fu.yc.kh(t);return Aa.ph(e)}static fromHex(t){const e=ca.fu.yc.fromHex(t);return Aa.ph(e)}static fromBase64(t){const e=ca.fu.yc.fromBase64(t);return Aa.ph(e)}static ph(t){const e=Object.create(Aa.prototype);return e.yh=t,e}}class Ba{Th;constructor(t,e,n,r,i){this.Th=new ca.fu.dc(t,e.map(t=>t.yh),n,r,i)}get version(){return this.Th.version}set version(t){this.Th.version=t}get inputs(){return this.inputs.map(Aa.ph)}set inputs(t){this.Th.inputs=t.map(t=>t.yh)}get Ah(){return this.Th.Ah}set Ah(t){this.Th.Ah=t}get Bh(){return this.Th.Bh}set Bh(t){this.Th.Bh=t}get Eh(){return this.Th.Eh}set Eh(t){this.Th.Eh=t}static ph(t){const e=Object.create(Ba.prototype);return e.Th=t,e}}class Ea{Rh;constructor(t){const e=ca.fu;if(t instanceof Ea)return t;if(!(t instanceof Uint8Array||"string"==typeof t))throw new Error("Invalid raw ID");{const n=new e.Ha(t);this.Rh=new e.qa(n)}}Ph(){return this.Rh.Ph()}mh(){return this.Rh.mh()}Ih(){return this.Rh.Ih()}bytes(){return this.Rh.bytes()}static Nh(t){return this.ph(ca.fu.qa.Nh(t))}static fromBase64(t){return this.ph(ca.fu.qa.fromBase64(t))}static fromHex(t){return this.ph(ca.fu.qa.fromHex(t))}static kh(t){return this.ph(ca.fu.qa.kh(t))}static ph(t){const e=Object.create(Ea.prototype);return e.Rh=t,e}xh(){return this.Rh}}class Ra{$h;constructor(t,e,n){this.$h=new ca.fu.fc(t,e,n)}get Uh(){return this.$h.Uh}set Uh(t){this.$h.Uh=t}get Sh(){return Ba.ph(this.$h.Sh)}set Sh(t){this.$h.Sh=t.Th}Ch(){const t=this.$h.Ch();return t instanceof ca.fu.wl?Ta.ph(t):t}Gh(){const t=this.$h.Gh();return t instanceof ca.fu.yc?Aa.ph(t):t}Vh(){return this.$h.Vh()}Kh(){return this.$h.Kh()}Oh(){return Ea.ph(this.$h.Oh())}static Fh(t){return Ra.ph(ca.fu.fc.Fh(t))}static ph(t){const e=Object.create(Ra.prototype);return e.$h=t,e}}class Pa{$h;constructor(t,e){this.$h=new ca.fu.Ta(t,e.yh)}set ar(t){this.$h.ar=t}get ar(){return this.$h.ar}set Wh(t){this.$h.Wh=t.yh}get Wh(){return Aa.ph(this.$h.Wh)}Oh(){return Ea.ph(this.$h.Oh())}static Fh(t){const e=t.Wh instanceof Uint8Array?t.Wh:t.Wh.bytes();return Pa.ph(ca.fu.Ta.Fh({ar:t.ar,Wh:e}))}static ph(t){const e=Object.create(Pa.prototype);return e.$h=t,e}}class Na{Dh;constructor(t){this.Dh=new ca.fu.ya(t.$h)}static _h(t,e,n){return Na.ph(ca.fu.ya._h(t,e,n))}static Hh(t,e){return Na.ph(ca.fu.ya.Hh(t,e.yh))}jh(){return this.Dh.jh()}Mh(){return Ra.ph(this.Dh.Mh())}Lh(){return Pa.ph(this.Dh.Lh())}Gh(){const t=this.Dh.Gh();return null!=t?Aa.ph(t):null}Oh(){return Ea.ph(this.Dh.Oh())}Ih(){return this.Dh.Ih()}static fromHex(t){return Na.ph(ca.fu.ya.fromHex(t))}static ph(t){const e=Object.create(Na.prototype);return e.Dh=t,e}}class xa{Zh;constructor(t){t instanceof ca.fu.Ba?this.Zh=t:this.Zh=t instanceof xa?t.Zh:ca.fu.Ba.qh(t)}static qh(t){return new xa(ca.fu.Ba.qh(t))}get message(){return this.Zh.message}}class $a{Yh;constructor(t){this.Yh=new ca.fu.Ic(Ga(t))}bytes(){return this.Yh.bytes()}zh(t){return this.Yh.zh(Ua(t))}Xh(t){return this.Yh.Xh(Ua(t))}Jh(){return this.Yh.Jh()}Qh(){return this.Yh.Qh()}hash(){return this.Yh.hash()}static tf(t){return $a.ph(ca.fu.Ic.tf(t))}static kh(t){return $a.ph(ca.fu.Ic.kh(t))}static ph(t){const e=Object.create($a.prototype);return e.Yh=t,e}}function Ua(t){if("bigint"==typeof t||t>4294967295&&"string"!=typeof t)return ca.fu.Ha.ef(BigInt(t.toString()).toString());if(t instanceof Ea||t instanceof ca.fu.qa)return new ca.fu.Ha(t.bytes());if(t instanceof Uint8Array)return new ca.fu.Ha(t);if(Array.isArray(t))return new ca.fu.Ha(t.map(Ua));if("object"==typeof t&&null!==t){const e=Object.keys(t),n=Object.assign({},t);for(const r of e)n[r]=Ua(t[r]);return new ca.fu.Ha(n)}if("function"==typeof t)throw new Error("Cannot parse value from function");return"number"==typeof t?Number.isInteger(t)?t>4294967295||t<0?ca.fu.Ha.nf(t):ca.fu.Ha.rf(t):ca.fu.Ha.if(t):new ca.fu.Ha(t)}function Sa(t,e=!1){if(t.value instanceof ca.fu.Ha)return Sa(t.value,e);if(t.sf()){const n=BigInt(t.value);return e&&n<BigInt(Number.MAX_SAFE_INTEGER)&&n>BigInt(Number.MIN_SAFE_INTEGER)?Number(t.value):n}if(Array.isArray(t.value))return t.value.map(t=>Sa(t,e));if("object"!=typeof t.value||t.value instanceof Uint8Array||null===t.value)return t.value;{const n={},r=Object.keys(t.value);for(const i of r)n[i]=Sa(t.value[i],e);return n}}function Ca(t){return t instanceof Ea?t.Rh:t instanceof ca.fu.qa?t:new ca.fu.Ha(t)}function Ga(t){return t instanceof $a?t.Yh:t instanceof ca.fu.Ic?t:new ca.fu.Ha(t)}class Va{af;constructor(t,e){this.af=new ca.fu.Pa(Ca(t),e)}get identifier(){return Ea.ph(this.af.identifier)}set identifier(t){this.af.identifier=Ca(t)}get Vr(){return this.af.Vr}set Vr(t){this.af.Vr=t}get cf(){return this.af.cf}get lf(){return this.af.lf}static uf(t){return new Va(t)}static hf(t,e){return new Va(t,e)}static ph(t){const e=Object.create(Va.prototype);return e.af=t,e}}class Ka{ff;constructor(t,e){this.ff=new ca.fu.Bc(t,e)}get df(){return this.ff.df}set df(t){this.ff.df=t}get inner(){return this.ff.inner}set inner(t){this.ff.inner=t}wf(){return this.ff.wf()}pf(){return this.ff.pf()}bytes(){return this.ff.bytes()}static kh(t){return Ka.ph(ca.fu.Bc.kh(t))}static ph(t){const e=Object.create(Ka.prototype);return e.ff=t,e}}class Oa{yf;constructor(t,e){this.yf=new ca.fu.Ac(Ua(t),Ua(e))}getPublicKey(){return Ka.ph(this.yf.getPublicKey())}gf(){return this.yf.gf()}bf(){return this.yf.bf()}bytes(){return this.yf.bytes()}Ih(){return this.yf.Ih()}wf(){return this.yf.wf()}sign(t){return this.yf.sign(t)}mf(t){return this.yf.mf(t)}static vf(t){return Oa.ph(ca.fu.Ac.vf(t))}static kh(t,e){return Oa.ph(ca.fu.Ac.kh(t,Ua(e)))}static fromHex(t,e){return Oa.ph(ca.fu.Ac.fromHex(t,Ua(e)))}static ph(t){const e=Object.create(Oa.prototype);return e.yf=t,e}}class Fa{If;constructor(t,e,n,r,i,o,s,a){const c=ca.fu;if(null==e||null==n||null==r)throw new Error("purpose, securityLevel, keyType must be specified");this.If=new c.rc(t,new c.Ha(e),new c.Ha(n),new c.Ha(r),i,o,s?.toString(),a?.af)}get kf(){return this.If.kf}set kf(t){this.If.kf=t}get Or(){return this.If.Or}set Or(t){const e=ca.fu;this.If.Or=new e.Ha(t)}get Tf(){return this.If.Tf}set Tf(t){this.If.Tf=t}get Af(){return this.If.Af}set Af(t){const e=ca.fu;this.If.Af=new e.Ha(t)}get Bf(){return this.If.Bf}set Bf(t){this.If.Bf=t}get Ef(){return this.If.Ef}set Ef(t){const e=ca.fu;this.If.Ef=new e.Ha(t)}get Rf(){return this.If.Rf}set Rf(t){this.If.Rf=t}get readOnly(){return this.If.readOnly}set readOnly(t){this.If.readOnly=t}get data(){return this.If.data}set data(t){this.If.data=t}get Pf(){const t=this.If.Pf;return null!=t?BigInt(t):void 0}set Pf(t){this.If.Pf=t.toString()}get Nf(){if(null!=this.If.Nf)return Va.ph(this.If.Nf)}set Nf(t){this.If.Nf=t?.af}xf(){if(null!=this.If.Nf)return Va.ph(this.If.Nf)}$f(){this.If.$f()}wf(){return this.If.wf()}Uf(){return this.If.Uf()}bytes(){return this.If.bytes()}Ih(){return this.If.Ih()}mh(){return this.If.mh()}Sf(t,e){const n=t instanceof Oa?t.yf:Ua(t);return this.If.Sf(n,Ua(e))}static kh(t){const e=ca.fu.rc.kh(t);return this.ph(e)}static fromHex(t){const e=ca.fu.rc.fromHex(t);return this.ph(e)}static fromBase64(t){const e=ca.fu.rc.fromBase64(t);return this.ph(e)}static ph(t){const e=Object.create(Fa.prototype);return e.If=t,e}}class Wa{Cf;constructor(t,e){const n=ca.fu;this.Cf=new n.ec(Ca(t),Ua(e))}set id(t){this.Cf.id=Ca(t)}get id(){return Ea.ph(this.Cf.id)}set balance(t){this.Cf.balance=t.toString()}get balance(){return BigInt(this.Cf.balance)}set kr(t){this.Cf.kr=t.toString()}get kr(){return BigInt(this.Cf.kr)}Gf(t){this.Cf.Gf(t.If)}Vf(t){const e=this.Cf.Vf(t);if(null!=e)return Fa.ph(e)}Kf(){return this.Cf.Kf().map(t=>Fa.ph(t))}static fromHex(t){const e=ca.fu.ec.fromHex(t);return this.ph(e)}static fromBase64(t){const e=ca.fu.ec.fromBase64(t);return this.ph(e)}static kh(t){const e=ca.fu.ec.kh(t);return this.ph(e)}bytes(){return this.Cf.bytes()}Ih(){return this.Cf.Ih()}mh(){return this.Cf.mh()}static ph(t){const e=Object.create(Wa.prototype);return e.Cf=t,e}xh(){return this.Cf}}class Da{Of;zh(t){return this.Of.zh(Ua(t))}toString(){return this.Of.toString()}bytes(){return this.Of.bytes()}Ih(){return this.Of.Ih()}mh(){return this.Of.mh()}Ff(){return this.Of.Ff()}static kh(t){return Da.ph(ca.fu.Na.kh(t))}static Wf(t){return Da.ph(ca.fu.Na.Wf(t))}static Df(t){return Da.ph(ca.fu.Na.Df(t))}static ph(t){const e=Object.create(Da.prototype);return e.Of=t,e}}class _a{_f;constructor(t,e,n,r,i,o,s,a){this._f=new ca.fu.nc(t,Ua(e),Ua(n),Ua(r),i,o,s,a?.af)}Hf(){return Fa.ph(this._f.Hf())}Sf(t,e){const n=t instanceof Oa?t.yf:Ua(t);return this._f.Sf(n,Ua(e))}jf(){return this._f.jf()}xf(){if(null!=this._f.Nf)return Va.ph(this._f.Nf)}get Nf(){if(null!=this._f.Nf)return Va.ph(this._f.Nf)}set Nf(t){this._f.Nf=t.af}get kf(){return this._f.kf}set kf(t){this._f.kf=t}get Or(){return this._f.Or}set Or(t){this._f.Or=Ua(t)}get Af(){return this._f.Af}set Af(t){this._f.Af=Ua(t)}get Ef(){return this._f.Ef}set Ef(t){this._f.Ef=Ua(t)}get readOnly(){return this._f.readOnly}set readOnly(t){this._f.readOnly=t}get data(){return this._f.data}set data(t){this._f.data=t}get signature(){return this._f.signature}set signature(t){this._f.signature=t}static ph(t){const e=Object.create(_a.prototype);return e._f=t,e}}class Ha{Mf;constructor(t,e,n,r,i){const o=Object.keys(e),s=[];for(const t of o)s.push([Number(t),e[Number(t)].If]);this.Mf=new ca.fu.mc(Ca(t),s,n?.toString(),r?.toString(),i)}get id(){return Ea.ph(this.Mf.id)}set id(t){this.Mf.id=Ca(t)}get Lf(){const t=this.Mf.Lf,e={};for(const n of t)e[n[0]]=Fa.ph(n[1]);return e}set Lf(t){const e=Object.keys(t),n=[];for(const r of e)n.push([Number(r),t[Number(r)].If]);this.Mf.Lf=n}get balance(){const t=this.Mf.balance;return null!=t?BigInt(t):void 0}set balance(t){this.Mf.balance=t?.toString()}get kr(){const t=this.Mf.kr;return null!=t?BigInt(t):void 0}set kr(t){this.Mf.kr=t?.toString()}get Zf(){return this.Mf.Zf}set Zf(t){this.Mf.Zf=t}static ph(t){const e=Object.create(Ha.prototype);return e.Mf=t,e}}class ja{qf;constructor(t){this.qf=t}get signature(){return this.qf.signature??void 0}set signature(t){this.qf.signature=t}get Yf(){return this.qf.Yf??void 0}set Yf(t){this.qf.Yf=t}get zf(){return this.qf.zf}set zf(t){this.qf.zf=t}sign(t,e){const n=t instanceof Oa?t.yf:Ua(t);return this.qf.sign(n,e.If)}Xf(t,e,n){const r=t instanceof Oa?t.yf:Ua(t);return this.qf.Xf(r,e,n?Ua(n):void 0)}Jf(t,e,n){this.qf.Jf(t.If,e,n)}hash(t){return this.qf.hash(t)}Qf(){return this.qf.Qf()}td(){return this.qf.td()}ed(){return this.qf.ed()}nd(){const t=this.qf.nd();return null!=t?Ea.ph(t):void 0}rd(){return this.qf.rd()??void 0}od(t){return this.qf.od(Ua(t))??void 0}Ho(){const t=this.qf.Ho();return null!=t?BigInt(t):void 0}_o(){const t=this.qf._o();return null!=t?BigInt(t):void 0}sd(t){this.qf.sd(Ca(t))}ad(t){this.qf.ad(t.toString())}ld(t){this.qf.ld(t.toString())}ud(){return this.qf.ud()}bytes(){return this.qf.bytes()}Ih(){return this.qf.Ih()}mh(){return this.qf.mh()}static kh(t){return new ja(ca.fu.Cc.kh(t))}static fromHex(t){return new ja(ca.fu.Cc.fromHex(t))}static fromBase64(t){return new ja(ca.fu.Cc.fromBase64(t))}static ph(t){return new ja(t)}}class Ma{hd;constructor(t,e,n){this.hd=new ca.fu.Tc(t,e,n)}get fd(){return this.hd.fd}set fd(t){this.hd.fd=t}get dd(){return this.hd.dd}set dd(t){this.hd.dd=t}get value(){return this.hd.value}set value(t){this.hd.value=t}static ph(t){const e=Object.create(Ma.prototype);return e.hd=t,e}}class La{wd;constructor(t,e,n){this.wd=new ca.fu.Nc(t,e,n)}get pd(){return this.wd.pd}set pd(t){this.wd.pd=t}get yd(){return this.wd.yd}set yd(t){this.wd.yd=t}get value(){return this.wd.value}set value(t){this.wd.value=t}static ph(t){const e=Object.create(La.prototype);return e.wd=t,e}}class Za{gd;constructor(t,e,n){this.gd=new ca.fu.Za(t,Ca(e),n)}get bd(){return this.gd.bd}set bd(t){this.gd.bd=t}get md(){return Ea.ph(this.gd.md)}set md(t){this.gd.md=Ca(t)}get vd(){return this.gd.vd}set vd(t){this.gd.vd=t}static ph(t){const e=Object.create(Za.prototype);return e.gd=t,e}}class qa{Id;constructor(t,e,n,r){this.Id=new ca.fu.Xa(t.map(t=>t._f),e.Dh,n,r)}get kd(){return this.Id.kd.map(_a.ph)}set kd(t){this.Id.kd=t.map(t=>t._f)}get zf(){return this.Id.zf}set zf(t){this.Id.zf=t}get signature(){return this.Id.signature}set signature(t){this.Id.signature=t}get Td(){return Na.ph(this.Id.Td)}set Td(t){this.Id.Td=t.Dh}ud(){return this.Id.ud()}Ad(){return Ea.ph(this.Id.Ad())}bytes(){return this.Id.bytes()}Bd(){return ja.ph(this.Id.Bd())}static default(t){return qa.ph(ca.fu.Xa.default(Ua(t)))}static fromHex(t){return qa.ph(ca.fu.Xa.fromHex(t))}static fromBase64(t){return qa.ph(ca.fu.Xa.fromBase64(t))}static kh(t){return qa.ph(ca.fu.Xa.kh(t))}static Ed(t){return qa.ph(ca.fu.Xa.Ed(t.qf))}static ph(t){const e=Object.create(qa.prototype);return e.Id=t,e}}class Ya{Rd;constructor(t,e,n){this.Rd=new ca.fu.lc(t.Dh,Ca(e),n)}get zf(){return this.Rd.zf}set zf(t){this.Rd.zf=t}get Pd(){return Ea.ph(this.Rd.Pd)}set Pd(t){this.Rd.Pd=Ca(t)}get Nd(){return Na.ph(this.Rd.Nd)}set Nd(t){this.Rd.Nd=t.Dh}get signature(){return this.Rd.signature}set signature(t){this.Rd.signature=t}ud(){return this.Rd.ud()}xd(){return this.Rd.xd().map(Ea.ph)}$d(){const t=this.Rd.$d();return null!=t?Na.ph(t):void 0}bytes(){return this.Rd.bytes()}Ih(){return this.Rd.Ih()}mh(){return this.Rd.mh()}Bd(){return ja.ph(this.Rd.Bd())}static kh(t){return Ya.ph(ca.fu.lc.kh(t))}static fromHex(t){return Ya.ph(ca.fu.lc.fromHex(t))}static fromBase64(t){return Ya.ph(ca.fu.lc.fromBase64(t))}static Ed(t){return Ya.ph(ca.fu.lc.Ed(t.qf))}static ph(t){const e=Object.create(Ya.prototype);return e.Rd=t,e}}class za{Ud;constructor(t,e,n,r,i,o){this.Ud=new ca.fu.uc(Ca(t),e.toString(),n.toString(),r.map(t=>t._f),i,o)}get kr(){return BigInt(this.Ud.kr)}set kr(t){this.Ud.kr=t.toString()}get nonce(){return BigInt(this.Ud.nonce)}set nonce(t){this.Ud.nonce=t.toString()}get Pd(){return Ea.ph(this.Ud.Pd)}set Pd(t){this.Ud.Pd=Ca(t)}get Sd(){return this.Ud.Sd}set Sd(t){this.Ud.Sd=t}get Cd(){return this.Ud.Cd.map(_a.ph)}set Cd(t){this.Ud.Cd=t.map(t=>t._f)}get zf(){return this.Ud.zf}set zf(t){this.Ud.zf=t}get signature(){return this.Ud.signature}set signature(t){this.Ud.signature=t}get Yf(){return this.Ud.Yf}set Yf(t){this.Ud.Yf=t}ud(){return this.Ud.ud()}rd(){return this.Ud.rd()}xd(){return this.Ud.xd().map(Ea.ph)}$d(){const t=this.Ud.$d();return null!=t?Na.ph(t):void 0}bytes(){return this.Ud.bytes()}Ih(){return this.Ud.Ih()}mh(){return this.Ud.mh()}Bd(){return ja.ph(this.Ud.Bd())}static kh(t){return za.ph(ca.fu.uc.kh(t))}static fromHex(t){return za.ph(ca.fu.uc.fromHex(t))}static fromBase64(t){return za.ph(ca.fu.uc.fromBase64(t))}static Ed(t){return za.ph(ca.fu.uc.Ed(t.qf))}static ph(t){const e=Object.create(za.prototype);return e.Ud=t,e}}class Xa{Gd;constructor(t,e,n,r,i){this.Gd=new ca.fu.Ja(Ca(t),e.toString(),Ca(n),r.toString(),i)}get Vd(){return Ea.ph(this.Gd.Vd)}set Vd(t){this.Gd.Vd=Ca(t)}get Kd(){return Ea.ph(this.Gd.Kd)}set Kd(t){this.Gd.Vd=Ca(t)}get Od(){return BigInt(this.Gd.Od)}set Od(t){this.Gd.Od=t.toString()}get nonce(){return BigInt(this.Gd.nonce)}set nonce(t){this.Gd.nonce=t.toString()}get signature(){return this.Gd.signature}set signature(t){this.Gd.signature=t}get Yf(){return this.Gd.Yf}set Yf(t){this.Gd.Yf=t}get zf(){return this.Gd.zf}set zf(t){this.Gd.zf=t}ud(){return this.Gd.ud()}bytes(){return this.Gd.bytes()}Ih(){return this.Gd.Ih()}mh(){return this.Gd.mh()}Bd(){return ja.ph(this.Gd.Bd())}static kh(t){return Xa.ph(ca.fu.Ja.kh(t))}static fromHex(t){return Xa.ph(ca.fu.Ja.fromHex(t))}static fromBase64(t){return Xa.ph(ca.fu.Ja.fromBase64(t))}static Ed(t){return Xa.ph(ca.fu.Ja.Ed(t.qf))}static ph(t){const e=Object.create(Xa.prototype);return e.Gd=t,e}}class Ja{Fd;constructor(t,e,n,r,i,o,s){this.Fd=new ca.fu.tc(Ca(t),e.toString(),n,Ua(r),i.toString(),o?.Of,s)}get Wd(){const t=this.Fd.Wd;if(null!=t)return Da.ph(t)}set Wd(t){this.Fd.Wd=t?.Of}get Dd(){return this.Fd.Dd}set Dd(t){this.Fd.Dd=Ua(t)}get yr(){return Ea.ph(this.Fd.yr)}set yr(t){this.Fd.yr=Ca(t)}get zf(){return this.Fd.zf}set zf(t){this.Fd.zf=t}get nonce(){return BigInt(this.Fd.nonce)}set nonce(t){this.Fd.nonce=t.toString()}get Od(){return BigInt(this.Fd.Od)}set Od(t){this.Fd.Od=t.toString()}get _d(){return this.Fd._d}set _d(t){this.Fd._d=t}get signature(){return this.Fd.signature}set signature(t){this.Fd.signature=t}get Yf(){return this.Fd.Yf}set Yf(t){this.Fd.Yf=t}ud(){return this.Fd.ud()}rd(){return this.Fd.rd()}xd(){return this.Fd.xd().map(Ea.ph)}$d(){const t=this.Fd.$d();if(null!=t)return Na.ph(t)}bytes(){return this.Fd.bytes()}Ih(){return this.Fd.Ih()}mh(){return this.Fd.mh()}Bd(){return ja.ph(this.Fd.Bd())}static kh(t){return Ja.ph(ca.fu.tc.kh(t))}static fromHex(t){return Ja.ph(ca.fu.tc.fromHex(t))}static fromBase64(t){return Ja.ph(ca.fu.tc.fromBase64(t))}static Ed(t){return Ja.ph(ca.fu.tc.Ed(t.qf))}static ph(t){const e=Object.create(Ja.prototype);return e.Fd=t,e}}class Qa{Hd;constructor(t){this.Hd=t}jd(){const t=this.Hd.jd();return null!=t?Ea.ph(t):void 0}getType(){return this.Hd.getType()}static Md(t){return Qa.ph(ca.fu.Ec.Md(Ca(t)))}static Ld(){return Qa.ph(ca.fu.Ec.Ld())}static Lock(){return Qa.ph(ca.fu.Ec.Lock())}static ph(t){return new Qa(t)}}class tc{Zd;constructor(t,e,n,r){this.Zd=new ca.fu.Zl(Ca(t),e,n,Ua(r))}get gr(){return Ea.ph(this.Zd.gr)}set gr(t){this.Zd.gr=Ca(t)}get Vr(){return this.Zd.Vr}set Vr(t){this.Zd.Vr=t}get oi(){return this.Zd.oi}set oi(t){this.Zd.oi=t}get di(){return this.Zd.di}set di(t){this.Zd.di=Ua(t)}toString(){return this.Zd.toString()}static ph(t){const e=Object.create(tc.prototype);return e.Zd=t,e}}class ec{qd;constructor(t,e){this.qd=new ca.fu.Ll(t.Zd,e.Hd)}get Yd(){return tc.ph(this.qd.Yd)}set Yd(t){this.qd.Yd=t.Zd}get zd(){return Qa.ph(this.qd.zd)}set zd(t){this.qd.zd=t.Hd}static ph(t){const e=Object.create(ec.prototype);return e.qd=t,e}}class nc{Xd;constructor(t,e,n,r,i,o){this.Xd=new ca.fu.wc(Ca(t),Ca(e),n.qd,r.toString(),i,o)}get ji(){return Ea.ph(this.Xd.ji)}set ji(t){this.Xd.ji=Ca(t)}get Jd(){return Ea.ph(this.Xd.Jd)}set Jd(t){this.Xd.Jd=Ca(t)}get Qd(){return ec.ph(this.Xd.Qd)}set Qd(t){this.Xd.Qd=t.qd}get nonce(){return BigInt(this.Xd.nonce)}set nonce(t){this.Xd.nonce=t.toString()}get Yf(){return this.Xd.Yf}set Yf(t){this.Xd.Yf=t}get signature(){return this.Xd.signature}set signature(t){this.Xd.signature=t}get Td(){const t=this.Xd.Td;if(null!=t)return Na.ph(t)}get tw(){return this.Xd.tw.map(Ea.ph)}ud(){return this.Xd.ud()}bytes(){return this.Xd.bytes()}Ih(){return this.Xd.Ih()}mh(){return this.Xd.mh()}Bd(){return ja.ph(this.Xd.Bd())}static kh(t){return nc.ph(ca.fu.wc.kh(t))}static fromHex(t){return nc.ph(ca.fu.wc.fromHex(t))}static fromBase64(t){return nc.ph(ca.fu.wc.fromBase64(t))}static Ed(t){return nc.ph(ca.fu.wc.Ed(t.qf))}static ph(t){const e=Object.create(nc.prototype);return e.Xd=t,e}}class rc{ew;constructor(t){this.ew=t}nw(){return this.ew.nw()}jd(){const t=this.ew.jd();return void 0===t?void 0:"number"==typeof t?Number(t):Ea.ph(t)}static rw(){return new rc(ca.fu.ba.rw())}static Bu(){return new rc(ca.fu.ba.Bu())}static iw(t){return new rc(ca.fu.ba.iw(Ca(t)))}static ow(){return new rc(ca.fu.ba.ow())}static sw(t){return new rc(ca.fu.ba.sw(t))}static ph(t){return new rc(t)}}class ic{aw;constructor(t,e,n,r,i){this.aw=new ca.fu.Aa(t.ew,e.ew,n,r,i)}get cw(){return rc.ph(this.aw.cw)}set cw(t){this.aw.cw=t.ew}get lw(){return rc.ph(this.aw.lw)}set lw(t){this.aw.lw=t.ew}get uw(){return this.aw.uw}set uw(t){this.aw.uw=t}get hw(){return this.aw.hw}set hw(t){this.aw.hw=t}get fw(){return this.aw.fw}set fw(t){this.aw.fw=t}dw(t,e,n,r,i,o){const s=Object.keys(n),a=[];for(const t of s)a.push([Number(t),n[Number(t)].ww]);return this.aw.dw(t.ew,Ca(e),o,a,r.pw,Ua(i))}static ph(t){const e=Object.create(ic.prototype);return e.aw=t,e}}class oc{yw;constructor(t,e,n){this.yw=new ca.fu.Hc(t,e,n)}get gw(){return this.yw.gw}set gw(t){this.yw.gw=t}get bw(){return this.yw.bw}set bw(t){this.yw.bw=t}get mw(){return this.yw.mw}set mw(t){this.yw.mw=t}toJSON(){return this.yw.toJSON()}static ph(t){const e=Object.create(oc.prototype);return e.yw=t,e}}class sc{Iw;constructor(t,e){const n=Object.keys(t),r=[];for(const e of n){if(null==t[e])throw new Error(`Localization cannot be undefined (${e})`);r.push([e,t[e].yw])}this.Iw=new ca.fu._c(r,e)}get kw(){return this.Iw.kw}set kw(t){this.Iw.kw=t}get Tw(){const t={},e=this.Iw.Tw;for(const[n,r]of e)t[n]=oc.ph(r);return t}set Tw(t){const e=Object.keys(t),n=[];for(const r of e){if(null==t[r])throw new Error(`Localization cannot be undefined (${r})`);n.push([r,t[r].yw])}this.Iw.Tw=n}static ph(t){const e=Object.create(sc.prototype);return e.Iw=t,e}}class ac{Aw;constructor(t){this.Aw=t}static Bw(t){return new ac(ca.fu.Sa.Bw(t.toString()))}Ew(){return this.Aw.Ew()}Rw(){const t=this.Aw.Rw();return Array.isArray(t)?t.map(t=>({step:BigInt(t.step),Od:BigInt(t.Od)})):t}static Pw(t,e){return new ac(ca.fu.Sa.Pw(t.toString(),e.toString()))}static Nw(t,e,n,r,i,o,s,a){return new ac(ca.fu.Sa.Nw(t,e,n,o?.toString(),s,r?.toString(),i?.toString(),a?.toString()))}static xw(t){return new ac(ca.fu.Sa.xw(t.map(t=>({step:t.step.toString(),Od:t.Od.toString()}))))}static $w(t,e,n,r,i,o){return new ac(ca.fu.Sa.$w(t,e.toString(),r?.toString(),n.toString(),i?.toString(),o?.toString()))}static Uw(t,e,n,r,i,o,s,a,c){return new ac(ca.fu.Sa.Uw(t,e.toString(),n,r.toString(),i,s?.toString(),o.toString(),a?.toString(),c?.toString()))}static Sw(t,e,n,r,i,o,s,a,c){return new ac(ca.fu.Sa.Sw(t.toString(),e.toString(),n,r.toString(),i,s?.toString(),o.toString(),a?.toString(),c?.toString()))}static Cw(t,e,n,r,i,o,s,a,c){return new ac(ca.fu.Sa.Cw(t,e.toString(),n.toString(),r.toString(),i,s?.toString(),o.toString(),a?.toString(),c?.toString()))}static Gw(t,e,n,r,i,o,s,a,c){return new ac(ca.fu.Sa.Gw(t,e.toString(),n.toString(),r.toString(),i,s?.toString(),o.toString(),a?.toString(),c?.toString()))}static ph(t){return new ac(t)}}class cc{Vw;constructor(t){this.Vw=t}getType(){return this.Vw.getType()}jd(){const t=this.Vw.jd();if(void 0!==t)return Ea.ph(t)}static Bu(){return new cc(ca.fu.qc.Bu())}static iw(t){return new cc(ca.fu.qc.iw(Ca(t)))}static Kw(){return new cc(ca.fu.qc.Kw())}static ph(t){return new cc(t)}}class lc{Ow;constructor(t){this.Ow=t}Fw(){const t=this.Ow.Fw(),e="number"==typeof t.interval?t.interval:BigInt(t.interval);let n;return n=t instanceof ca.fu.Ia?"BlockBasedDistribution":t instanceof ca.fu.Vc?"TimeBasedDistribution":"EpochBasedDistribution",{interval:e,Ww:ac.ph(t.Ww),Dw:n}}static _w(t,e){return new lc(ca.fu.Rc._w(t.toString(),e.Aw))}static Hw(t,e){return new lc(ca.fu.Rc.Hw(t.toString(),e.Aw))}static jw(t,e){return new lc(ca.fu.Rc.jw(t,e.Aw))}static ph(t){return new lc(t)}}class uc{Mw;constructor(t,e){this.Mw=new ca.fu.nl(t.Ow,e.Vw)}get Dw(){return lc.ph(this.Mw.Dw)}set Dw(t){this.Mw.Dw=t.Ow}get Lw(){return cc.ph(this.Mw.Lw)}set Lw(t){this.Mw.Lw=t.Vw}static ph(t){const e=Object.create(uc.prototype);return e.Mw=t,e}}function hc(t){const e=Object.keys(t),n=[];for(const r of e){const e=Object.keys(t[r]),i=[];for(const n of e)i.push([Ca(n),t[r][n].toString()]);n.push([r,i])}return n}class fc{Zw;constructor(t){this.Zw=new ca.fu.rl(hc(t))}get qw(){const t=this.Zw.qw,e={};for(const[n,r]of t){const t={};for(const[e,n]of r)t[e.Ph()]=BigInt(n);e[n]=t}return e}set qw(t){this.Zw.qw=hc(t)}static ph(t){const e=Object.create(fc.prototype);return e.Zw=t,e}}class dc{Yw;constructor(t,e,n,r,i,o,s,a){this.Yw=new ca.fu.Yc(o?.Mw,t.aw,s?.Zw,null!=a?Ca(a):void 0,e.aw,n,r?.aw,i?.aw)}get zw(){const t=this.Yw.zw;if(null!=t)return uc.ph(t)}set zw(t){this.Yw.zw=t.Mw}get Xw(){return ic.ph(this.Yw.Xw)}set Xw(t){this.Yw.Xw=t.aw}get Jw(){const t=this.Yw.Jw;if(null!=t)return fc.ph(t)}set Jw(t){this.Yw.Jw=t.Zw}get Qw(){const t=this.Yw.Qw;if(null!=t)return Ea.ph(t)}set Qw(t){this.Yw.Qw=null!=t?Ca(t):void 0}get tp(){return ic.ph(this.Yw.tp)}set tp(t){this.Yw.tp=t.aw}get ep(){return this.Yw.ep}set ep(t){this.Yw.ep=t}get np(){return ic.ph(this.Yw.np)}set np(t){this.Yw.np=t.aw}get rp(){return ic.ph(this.Yw.rp)}set rp(t){this.Yw.rp=t.aw}static ph(t){const e=Object.create(dc.prototype);return e.Yw=t,e}}class wc{ww;constructor(t,e){const n=Object.keys(t),r=[];for(const e of n)r.push([Ua(e),t[e]]);this.ww=new ca.fu.La(r,e)}get ip(){const t=this.ww.ip,e={};for(const[n,r]of t)e[n.Ph()]=r;return e}set ip(t){const e=Object.keys(t),n=[];for(const r of e)n.push([Ua(r),t[r]]);this.ww.ip=n}get op(){return this.ww.op}set op(t){this.ww.op=t}sp(t,e){this.ww.sp(Ca(t),e)}static ph(t){const e=Object.create(wc.prototype);return e.ww=t,e}}class pc{ap;constructor(t,e,n,r,i,o){this.ap=new ca.fu.Jc(t,e,n,r,i,o)}get cp(){return this.ap.cp}set cp(t){this.ap.cp=t}get lp(){return this.ap.lp}set lp(t){this.ap.lp=t}get up(){return this.ap.up}set up(t){this.ap.up=t}get hp(){return this.ap.hp}set hp(t){this.ap.hp=t}get fp(){return this.ap.fp}set fp(t){this.ap.fp=t}get dp(){return this.ap.dp}set dp(t){this.ap.dp=t}static ph(t){const e=Object.create(pc.prototype);return e.ap=t,e}}class yc{wp;constructor(t){this.wp=t}jd(){return this.wp.jd()}static pp(){return yc.ph(ca.fu.al.pp())}static ph(t){return new yc(t)}}class gc{yp;constructor(t,e){this.yp=new ca.fu.Qc(t.wp,e.aw)}get gp(){return yc.ph(this.yp.gp)}set gp(t){this.yp.gp=t.wp}get bp(){return ic.ph(this.yp.bp)}set bp(t){this.yp.bp=t.aw}static ph(t){const e=Object.create(gc.prototype);return e.yp=t,e}}class bc{mp;constructor(t){this.mp=t}vp(){return this.mp.vp()}getItem(){const t=this.mp.getItem();return t instanceof ca.fu._c?sc.ph(t):t instanceof ca.fu.ba?rc.ph(t):t instanceof ca.fu.nl?uc.ph(t):t instanceof ca.fu.al?yc.ph(t):t instanceof ca.fu.qa?Ea.ph(t):"string"==typeof t&&"MaxSupply"===this.mp.vp()?BigInt(t):t}static Ip(t){return new bc(ca.fu.Dc.Ip(t.Iw))}static kp(t){return new bc(ca.fu.Dc.kp(t.ew))}static Tp(t){return new bc(ca.fu.Dc.Tp(t.ew))}static Ap(t){return new bc(ca.fu.Dc.Ap(t.ew))}static Bp(t){return new bc(ca.fu.Dc.Bp(t.ew))}static Ep(t){return new bc(ca.fu.Dc.Ep(t.ew))}static Rp(t){return new bc(ca.fu.Dc.Rp(t.ew))}static Pp(t){return new bc(ca.fu.Dc.Pp(t.ew))}static Np(t){return new bc(ca.fu.Dc.Np(t.ew))}static xp(t){return new bc(ca.fu.Dc.xp(t))}static $p(t){return new bc(ca.fu.Dc.$p(t.ew))}static Up(t){return new bc(ca.fu.Dc.Up(t.ew))}static Sp(t){return new bc(ca.fu.Dc.Sp(t.ew))}static Cp(t){return new bc(ca.fu.Dc.Cp(t.ew))}static Gp(t){return new bc(ca.fu.Dc.Gp(t.wp))}static Vp(t){return new bc(ca.fu.Dc.Vp(t.ew))}static Kp(t){return new bc(ca.fu.Dc.Kp(t.ew))}static Op(t){return new bc(ca.fu.Dc.Op(t?.toString()))}static Fp(t){return new bc(ca.fu.Dc.Fp(t.ew))}static Wp(t){return new bc(ca.fu.Dc.Wp(t.ew))}static Dp(t){return new bc(ca.fu.Dc.Dp(t))}static _p(t){return new bc(ca.fu.Dc._p(t.ew))}static Hp(t){return new bc(ca.fu.Dc.Hp(t.ew))}static jp(t){return new bc(ca.fu.Dc.jp(null!=t?Ca(t):void 0))}static Mp(t){return new bc(ca.fu.Dc.Mp(t.ew))}static Lp(t){return new bc(ca.fu.Dc.Lp(t.ew))}static Zp(){return new bc(ca.fu.Dc.Zp())}static qp(t){return new bc(ca.fu.Dc.qp(t?.Mw))}static Yp(t){return new bc(ca.fu.Dc.Yp(t.ew))}static zp(t){return new bc(ca.fu.Dc.zp(t.ew))}static Xp(t){return new bc(ca.fu.Dc.Xp(t.ew))}static Jp(t){return new bc(ca.fu.Dc.Jp(t.ew))}static ph(t){return new bc(t)}}class mc{Qp;constructor(t,e,n,r,i,o,s,a,c,l,u,h,f,d,w,p,y,g,b){this.Qp=new ca.fu.jc(t.Iw,e.aw,n.toString(),y?.toString(),r.ap,i,o,s.aw,a.Yw,c.yp,l.aw,u.aw,h.aw,f.aw,d.aw,w.aw,g,p?.ew,b)}get ty(){return sc.ph(this.Qp.ty)}set ty(t){this.Qp.ty=t.Iw}get ey(){return ic.ph(this.Qp.ey)}set ey(t){this.Qp.ey=t.aw}get ny(){return BigInt(this.Qp.ny)}set ny(t){this.Qp.ny=t.toString()}get iy(){return pc.ph(this.Qp.iy)}set iy(t){this.Qp.iy=t.ap}get oy(){return this.Qp.oy}set oy(t){this.Qp.oy=t}get sy(){return this.Qp.sy}set sy(t){this.Qp.sy=t}get ly(){const t=this.Qp.ly;return null!=t?BigInt(t):void 0}set ly(t){this.Qp.ly=t?.toString()}get uy(){return ic.ph(this.Qp.uy)}set uy(t){this.Qp.uy=t.aw}get hy(){return dc.ph(this.Qp.hy)}set hy(t){this.Qp.hy=t.Yw}get wy(){return gc.ph(this.Qp.wy)}set wy(t){this.Qp.wy=t.yp}get py(){return ic.ph(this.Qp.py)}set py(t){this.Qp.py=t.aw}get yy(){return ic.ph(this.Qp.yy)}set yy(t){this.Qp.yy=t.aw}get gy(){return ic.ph(this.Qp.gy)}set gy(t){this.Qp.gy=t.aw}get by(){return ic.ph(this.Qp.by)}set by(t){this.Qp.by=t.aw}get my(){return ic.ph(this.Qp.my)}set my(t){this.Qp.my=t.aw}get vy(){return ic.ph(this.Qp.vy)}set vy(t){this.Qp.vy=t.aw}get Iy(){return this.Qp.Iy??void 0}set Iy(t){this.Qp.Iy=t}get ky(){return rc.ph(this.Qp.ky)}set ky(t){this.Qp.ky=t.ew}get description(){return this.Qp.description??void 0}set description(t){this.Qp.description=t}static Ty(t,e){return Ea.ph(ca.fu.jc.Ty(Ca(t),e))}static ph(t){const e=Object.create(mc.prototype);return e.Qp=t,e}}class vc{Ay;constructor(t,e,n,r,i,o,s){let a;if(null!=i){a=[];for(const t of i)a.push([t.position,t.By.Qp])}this.Ay=new ca.fu.$a(Ca(t),e.toString(),Ua(n),Ua(r),a,o,Ua(s))}get Ey(){return this.Ay.Ey}set Ey(t){this.Ay.Ey=t}get version(){return this.Ay.version}set version(t){this.Ay.version=t}get id(){return Ea.ph(this.Ay.id)}set id(t){this.Ay.id=Ca(t)}get Ry(){return Ea.ph(this.Ay.Ry)}set Ry(t){this.Ay.Ry=Ca(t)}get Py(){return this.Ay.Py.map(([t,e])=>({position:t,By:mc.ph(e)}))}set Py(t){let e;if(null!=t){e=[];for(const n of t)e.push([n.position,n.By.Qp])}this.Ay.Py=e}get groups(){return this.Ay.groups.map(([t,e])=>({position:t,group:wc.ph(e)}))}set groups(t){this.Ay.groups=t.map(({group:t,position:e})=>[e,t.ww])}get description(){return this.Ay.description??void 0}set description(t){this.Ay.description=t}get Ny(){return this.Ay.Ny}set Ny(t){this.Ay.Ny=t}xy(){return Sa(this.Ay.xy(),!0)}$y(){return Sa(this.Ay.$y())}Uy(t,e){this.Ay.Uy(Ua(t),Ua(e))}bytes(t){return this.Ay.bytes(Ua(t))}Ih(t){return this.Ay.Ih(Ua(t))}mh(t){return this.Ay.mh(Ua(t))}toJSON(t){return this.Ay.ke(Ua(t))}Sy(t){return Sa(this.Ay.Sy(Ua(t)))}static Cy(t,e,n){return vc.ph(ca.fu.$a.Cy(Ua(t),e,Ua(n)))}static kh(t,e,n){return vc.ph(ca.fu.$a.kh(t,e,Ua(n)))}static fromHex(t,e,n){return vc.ph(ca.fu.$a.fromHex(t,e,Ua(n)))}static fromBase64(t,e,n){return vc.ph(ca.fu.$a.fromBase64(t,e,Ua(n)))}static Gy(t,e){return Ea.ph(ca.fu.$a.Gy(Ca(t),e.toString()))}static ph(t){const e=Object.create(vc.prototype);return e.Ay=t,e}}class Ic{Vy;constructor(t,e,n){this.Vy=new ca.fu.xa(t.Ay,e.toString(),Ua(n))}get Ky(){return this.Vy.Ky}get mr(){return BigInt(this.Vy.mr)}Oy(t){return this.Vy.Oy(t)}Fy(t,e){this.Vy.Fy(t.Ay,Ua(e))}Zo(t,e){return vc.ph(this.Vy.Zo(Ua(t),e))}bytes(){return this.Vy.bytes()}Ih(){return this.Vy.Ih()}mh(){return this.Vy.mh()}Bd(){return ja.ph(this.Vy.Bd())}static kh(t){return Ic.ph(ca.fu.xa.kh(t))}static fromHex(t){return Ic.ph(ca.fu.xa.fromHex(t))}static fromBase64(t){return Ic.ph(ca.fu.xa.fromBase64(t))}static Ed(t){return Ic.ph(ca.fu.xa.Ed(t.qf))}static ph(t){const e=Object.create(Ic.prototype);return e.Vy=t,e}}class kc{Wy;constructor(t,e,n){this.Wy=new ca.fu.Ua(t.Ay,e.toString(),Ua(n))}get Ky(){return this.Wy.Ky}get vr(){return BigInt(this.Wy.vr)}Oy(t){return this.Wy.Oy(t)}Fy(t,e){this.Wy.Fy(t.Ay,Ua(e))}Zo(t,e){return vc.ph(this.Wy.Zo(t,Ua(e)))}bytes(){return this.Wy.bytes()}Ih(){return this.Wy.Ih()}mh(){return this.Wy.mh()}Bd(){return ja.ph(this.Wy.Bd())}static kh(t){return kc.ph(ca.fu.Ua.kh(t))}static fromHex(t){return kc.ph(ca.fu.Ua.fromHex(t))}static fromBase64(t){return kc.ph(ca.fu.Ua.fromBase64(t))}static Ed(t){return kc.ph(ca.fu.Ua.Ed(t.qf))}static ph(t){const e=Object.create(kc.prototype);return e.Wy=t,e}}class Tc{Dy;constructor(t,e,n,r,i,o,s){this.Dy=new ca.fu.Ka(Ua(t),e,n.toString(),Ca(r),Ca(i),null!=o?Ca(o):void 0,null!=s?Ca(s):void 0)}get id(){return Ea.ph(this.Dy.id)}set id(t){this.Dy.id=Ca(t)}get _y(){return this.Dy._y??void 0}set _y(t){this.Dy._y=t}get _r(){return Ea.ph(this.Dy._r)}set _r(t){this.Dy._r=Ca(t)}get Ry(){return Ea.ph(this.Dy.Ry)}set Ry(t){this.Dy.Ry=Ca(t)}get properties(){return Sa(this.Dy.properties,!0)}set properties(t){this.Dy.properties=Ua(t)}get kr(){const t=this.Dy.kr;return null!=t?BigInt(t):void 0}set kr(t){this.Dy.kr=t?.toString()}get Hy(){const t=this.Dy.Hy;if(null!=t)return BigInt(t)}set Hy(t){t instanceof Date?this.Dy.Hy=t.getTime().toString():this.Dy.Hy=null==t?void 0:t.toString()}get jy(){const t=this.Dy.jy;if(null!=t)return BigInt(t)}set jy(t){t instanceof Date?this.Dy.jy=t.getTime().toString():this.Dy.jy=null==t?void 0:t.toString()}get My(){const t=this.Dy.My;if(null!=t)return BigInt(t)}set My(t){t instanceof Date?this.Dy.My=t.getTime().toString():this.Dy.My=null==t?void 0:t.toString()}get Ly(){const t=this.Dy.Ly;if(null!=t)return BigInt(t)}set Ly(t){this.Dy.Ly=t?.toString()}get Zy(){const t=this.Dy.Ly;if(null!=t)return BigInt(t)}set Zy(t){this.Dy.Ly=t?.toString()}get qy(){const t=this.Dy.Ly;if(null!=t)return BigInt(t)}set qy(t){this.Dy.Ly=t?.toString()}get Yy(){return this.Dy.Yy??void 0}set Yy(t){this.Dy.Yy=t}get zy(){return this.Dy.zy??void 0}set zy(t){this.Dy.Yy=t}get Xy(){return this.Dy.Xy??void 0}set Xy(t){this.Dy.Yy=t}get Vr(){return this.Dy.Vr}set Vr(t){this.Dy.Vr=t}get Jy(){const t=this.Dy.Jy;if(null!=t)return Ea.ph(t)}set Jy(t){this.Dy.Jy=Ca(t)}bytes(t,e){return this.Dy.bytes(t.Ay,Ua(e))}Ih(t,e){return this.Dy.Ih(t.Ay,Ua(e))}mh(t,e){return this.Dy.mh(t.Ay,Ua(e))}static kh(t,e,n,r){return Tc.ph(ca.fu.Ka.kh(t,e.Ay,n,Ua(r)))}static fromHex(t,e,n,r){return Tc.ph(ca.fu.Ka.fromHex(t,e.Ay,n,Ua(r)))}static fromBase64(t,e,n,r){return Tc.ph(ca.fu.Ka.fromBase64(t,e.Ay,n,Ua(r)))}static Gy(t,e,n,r){return Ea.ph(ca.fu.Ka.Gy(t,Ca(e),Ca(n),r))}static ph(t){const e=Object.create(Tc.prototype);return e.Dy=t,e}}class Ac{Qy;constructor(t,e,n,r,i){this.Qy=new ca.fu.el(null!=t?Ca(t):void 0,e,n?.toString(),r?.toString(),Ua(i))}get tg(){const t=this.Qy.tg;if(null!=t)return Ea.ph(t)}set tg(t){this.Qy.tg=null!=t?Ca(t):void 0}get po(){return this.Qy.po}set po(t){this.Qy.po=t}get eg(){const t=this.Qy.eg;if(null!=t)return BigInt(t)}set eg(t){this.Qy.eg=t?.toString()}get ng(){const t=this.Qy.ng;if(null!=t)return BigInt(t)}set ng(t){this.Qy.ng=t?.toString()}get rg(){return this.Qy.rg}set rg(t){this.Qy.rg=Ua(t)}static ig(t){const e=Object.create(Ac.prototype);return e.Qy=t,e}}class Bc{og;constructor(t,e,n,r,i){this.og=new ca.fu.Ca(Ca(t),e?.toString(),n,Ca(r),i?.Qy)}get id(){return Ea.ph(this.og.id)}set id(t){this.og.id=Ca(t)}get vr(){return BigInt(this.og.vr)}set vr(t){this.og.vr=t?.toString()}get _r(){return Ea.ph(this.og._r)}set _r(t){this.og._r=Ca(t)}get Vr(){return this.og.Vr}set Vr(t){this.og.Vr=t}get sg(){const t=this.og.sg;if(null!=t)return Ac.ig(t)}set sg(t){null!=t?this.og.sg=t.Qy:this.og.ag()}static ph(t){const e=Object.create(Bc.prototype);return e.og=t,e}}class Ec{cg;constructor(t,e){this.cg=new ca.fu.kc(t,e?.toString())}get oi(){return this.cg.oi}get $i(){return BigInt(this.cg.$i)}static ph(t){const e=Object.create(Ec.prototype);return e.cg=t,e}}class Rc{lg;constructor(t,e,n){this.lg=new ca.fu.Fa(t.Dy,e.toString(),n?.Qy)}get data(){return Sa(this.lg.data,!0)}set data(t){this.lg.data=Ua(t)}get ug(){return Bc.ph(this.lg.ug)}set ug(t){this.lg.ug=t.og}get kr(){return BigInt(this.lg.kr)}set kr(t){this.lg.kr=t.toString()}hg(){return Uc.ph(this.lg.hg())}static fg(t){return Rc.ph(ca.fu.Fa.fg(t.dg))}static ph(t){const e=Object.create(Rc.prototype);return e.lg=t,e}}class Pc{wg;constructor(t,e,n){this.wg=new ca.fu.Va(t.Dy,e?.toString(),n?.Qy)}get ug(){return Bc.ph(this.wg.ug)}set ug(t){this.wg.ug=t.og}hg(){return Uc.ph(this.wg.hg())}static fg(t){return Pc.ph(ca.fu.Va.fg(t.dg))}static ph(t){const e=Object.create(Pc.prototype);return e.wg=t,e}}class Nc{pg;constructor(t,e,n,r){this.pg=new ca.fu.Oa(t.Dy,e.toString(),n.toString(),r?.Qy)}get ug(){return Bc.ph(this.pg.ug)}set ug(t){this.pg.ug=t.og}get mo(){return BigInt(this.pg.mo)}set mo(t){this.pg.mo=t.toString()}get kr(){return BigInt(this.pg.kr)}set kr(t){this.pg.kr=t.toString()}hg(){return Uc.ph(this.pg.hg())}static fg(t){return Nc.ph(ca.fu.Oa.fg(t.dg))}static ph(t){const e=Object.create(Nc.prototype);return e.pg=t,e}}class xc{yg;constructor(t,e,n,r){this.yg=new ca.fu.Wa(t.Dy,e.toString(),Ca(n),r?.Qy)}get ug(){return Bc.ph(this.yg.ug)}set ug(t){this.yg.ug=t.og}get Vd(){return Ea.ph(this.yg.Vd)}set Vd(t){this.yg.Vd=Ca(t)}hg(){return Uc.ph(this.yg.hg())}static fg(t){return xc.ph(ca.fu.Wa.fg(t.dg))}static ph(t){const e=Object.create(xc.prototype);return e.yg=t,e}}class $c{gg;constructor(t,e,n,r){this.gg=new ca.fu._a(t.Dy,e.toString(),n.toString(),r?.Qy)}get ug(){return Bc.ph(this.gg.ug)}set ug(t){this.gg.ug=t.og}get mo(){return BigInt(this.gg.mo)}set mo(t){this.gg.mo=t.toString()}hg(){return Uc.ph(this.gg.hg())}static fg(t){return $c.ph(ca.fu._a.fg(t.dg))}static ph(t){const e=Object.create($c.prototype);return e.gg=t,e}}class Uc{dg;constructor(t){this.dg=t.hg().dg}get bg(){return this.dg.bg}get mg(){return this.dg.mg}get _r(){return Ea.ph(this.dg._r)}set _r(t){this.dg._r=Ca(t)}get id(){return Ea.ph(this.dg.id)}get Vr(){return this.dg.Vr}get vr(){return BigInt(this.dg.vr)}set vr(t){this.dg.vr=t.toString()}get kr(){const t=this.dg.kr;if(null!=t)return BigInt(t)}set kr(t){this.dg.kr=t.toString()}get _y(){return this.dg._y??void 0}get vg(){return Sc.ph(this.dg.vg)}get Ig(){return Pc.ph(this.dg.Ig)}get kg(){return Nc.ph(this.dg.kg)}get Tg(){return Rc.ph(this.dg.Tg)}get Ag(){return xc.ph(this.dg.Ag)}get Bg(){return $c.ph(this.dg.Bg)}Eg(){return!0}static ph(t){const e=Object.create(Uc.prototype);return e.dg=t,e}}class Sc{Rg;constructor(t,e,n,r){this.Rg=new ca.fu.Ga(t.Dy,e.toString(),n?.cg,r?.Qy)}get data(){return Sa(this.Rg.data,!0)}set data(t){this.Rg.data=Ua(t)}get ug(){return Bc.ph(this.Rg.ug)}set ug(t){this.Rg.ug=t.og}get _y(){return this.Rg._y}set _y(t){this.Rg._y=t}get Pg(){const t=this.Rg.Pg;if(null!=t)return Ec.ph(t)}set Pg(t){null!=t?this.Rg.Pg=t.cg:this.Rg.Ng()}Ng(){this.Rg.Ng()}hg(){return Uc.ph(this.Rg.hg())}static fg(t){return Sc.ph(ca.fu.Ga.fg(t.dg))}static ph(t){const e=Object.create(Sc.prototype);return e.Rg=t,e}}class Cc{xg;constructor(t){return"bigint"==typeof t?Cc.$g(t):Cc.Ug(t)}Sg(){return this.xg.Sg()}jd(){const t=this.xg.jd();if("string"==typeof t)return BigInt(t);{const e=Sa(t);for(const t of Object.keys(e))e[t]=BigInt(e[t]);return e}}static $g(t){return Cc.ph(ca.fu.il.$g(t.toString()))}static Ug(t){return Cc.ph(ca.fu.il.Ug(Ua(t)))}static ph(t){const e=Object.create(Cc.prototype);return e.xg=t,e}}class Gc{Cg;constructor(t,e,n,r,i){this.Cg=new ca.fu.Kc(t.toString(),e,Ca(n),Ca(r),i?.gd)}get vr(){return BigInt(this.Cg.vr)}set vr(t){this.Cg.vr=t.toString()}get po(){return this.Cg.po}set po(t){this.Cg.po=t}get _r(){return Ea.ph(this.Cg._r)}set _r(t){this.Cg._r=Ca(t)}get fo(){return Ea.ph(this.Cg.fo)}set fo(t){this.Cg.fo=Ca(t)}get Gg(){const t=this.Cg.Gg;if(null!=t)return Za.ph(t)}set Gg(t){this.Cg.Gg=t?.gd}static ph(t){const e=Object.create(Gc.prototype);return e.Cg=t,e}}class Vc{dg;constructor(t,e,n){this.dg=new ca.fu.Wc(t.Cg,e.mp,n)}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get Vg(){return this.dg.Vg??void 0}set Vg(t){this.dg.Vg=t}get Kg(){return bc.ph(this.dg.Kg)}set Kg(t){this.dg.Kg=t.mp}static ph(t){const e=Object.create(Vc.prototype);return e.dg=t,e}}class Kc{dg;constructor(t,e,n){this.dg=new ca.fu.Zc(t.Cg,e.toString(),n.toString())}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get Og(){return BigInt(this.dg.Og)}set Og(t){this.dg.Og=t.toString()}get Fg(){return BigInt(this.dg.Fg)}set Fg(t){this.dg.Fg=t.toString()}static ph(t){const e=Object.create(Kc.prototype);return e.dg=t,e}}class Oc{dg;constructor(t,e,n){this.dg=new ca.fu.ol(t.Cg,e?.xg,n)}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get mo(){const t=this.dg.mo;if(null!=t)return Cc.ph(t)}set mo(t){this.dg.mo=t?.xg}get Vg(){return this.dg.Vg??void 0}set Vg(t){this.dg.Vg=t}static ph(t){const e=Object.create(Oc.prototype);return e.dg=t,e}}class Fc{dg;constructor(t,e,n){this.dg=new ca.fu.Oc(t.Cg,e.toString(),n)}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get Wg(){return BigInt(this.dg.Wg)}set Wg(t){this.dg.Wg=t.toString()}get Vg(){return this.dg.Vg??void 0}set Vg(t){this.dg.Vg=t}static ph(t){const e=Object.create(Fc.prototype);return e.dg=t,e}}class Wc{dg;constructor(t,e,n){this.dg=new ca.fu.Fc(t.Cg,Ua(e),n)}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get Dw(){return this.dg.Dw}set Dw(t){this.dg.Dw=Ua(t)}get Vg(){return this.dg.Vg??void 0}set Vg(t){this.dg.Vg=t}static ph(t){const e=Object.create(Wc.prototype);return e.dg=t,e}}class Dc{dg;constructor(t,e,n){this.dg=new ca.fu.Lc(t.Cg,Ca(e),n)}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get Dg(){return Ea.ph(this.dg.Dg)}set Dg(t){this.dg.Dg=Ca(t)}get Vg(){return this.dg.Vg??void 0}set Vg(t){this.dg.Vg=t}static ph(t){const e=Object.create(Dc.prototype);return e.dg=t,e}}class _c{dg;constructor(t,e,n){this.dg=new ca.fu.zc(t.Cg,Ua(e),n)}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get _g(){return this.dg._g}set _g(t){this.dg._g=Ua(t)}get Vg(){return this.dg.Vg??void 0}set Vg(t){this.dg.Vg=t}static ph(t){const e=Object.create(_c.prototype);return e.dg=t,e}}class Hc{dg;constructor(t,e,n){this.dg=new ca.fu.Xc(t.Cg,Ca(e),n)}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get Dg(){return Ea.ph(this.dg.Dg)}set Dg(t){this.dg.Dg=Ca(t)}get Vg(){return this.dg.Vg??void 0}set Vg(t){this.dg.Vg=t}static ph(t){const e=Object.create(Hc.prototype);return e.dg=t,e}}class jc{dg;constructor(t,e,n,r){this.dg=new ca.fu.tl(t.Cg,null!=e?Ca(e):void 0,n.toString(),r)}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get Hg(){const t=this.dg.Hg;if(null!=t)return Ea.ph(t)}set Hg(t){this.dg.Hg=null!=t?Ca(t):void 0}get Od(){return BigInt(this.dg.Od)}set Od(t){this.dg.Od=t.toString()}get Vg(){return this.dg.Vg??void 0}set Vg(t){this.dg.Vg=t}static ph(t){const e=Object.create(jc.prototype);return e.dg=t,e}}class Mc{dg;constructor(t,e,n,r,i,o){this.dg=new ca.fu.cl(t.Cg,Ca(e),n.toString(),r,i?.wd,o?.hd)}get Vd(){return Ea.ph(this.dg.Vd)}set Vd(t){this.dg.Vd=Ca(t)}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get Od(){return BigInt(this.dg.Od)}set Od(t){this.dg.Od=t.toString()}get Vg(){return this.dg.Vg??void 0}set Vg(t){this.dg.Vg=t}get jg(){const t=this.dg.jg;if(null!=t)return La.ph(t)}set jg(t){this.dg.jg=t?.wd}get Mg(){const t=this.dg.Mg;if(null!=t)return Ma.ph(t)}set Mg(t){this.dg.Mg=t?.hd}static ph(t){const e=Object.create(Mc.prototype);return e.dg=t,e}}class Lc{dg;constructor(t,e,n){this.dg=new ca.fu.ul(t.Cg,Ca(e),n)}get ug(){return Gc.ph(this.dg.ug)}set ug(t){this.dg.ug=t.Cg}get Dg(){return Ea.ph(this.dg.Dg)}set Dg(t){this.dg.Dg=Ca(t)}get Vg(){return this.dg.Vg??void 0}set Vg(t){this.dg.Vg=t}static ph(t){const e=Object.create(Lc.prototype);return e.dg=t,e}}class Zc{Lg;constructor(t){this.Lg=new ca.fu.ll(t.dg)}get vr(){return BigInt(this.Lg.vr)}set vr(t){this.Lg.vr=t.toString()}get fo(){return Ea.ph(this.Lg.fo)}set fo(t){this.Lg.fo=Ca(t)}get gr(){return Ea.ph(this.Lg.gr)}set gr(t){this.Lg.gr=Ca(t)}Zg(){const t=this.Lg.Zg();return t instanceof ca.fu.Oc?Fc.ph(t):t instanceof ca.fu.Fc?Wc.ph(t):t instanceof ca.fu.Wc?Vc.ph(t):t instanceof ca.fu.Lc?Dc.ph(t):t instanceof ca.fu.Zc?Kc.ph(t):t instanceof ca.fu.zc?_c.ph(t):t instanceof ca.fu.Xc?Hc.ph(t):t instanceof ca.fu.tl?jc.ph(t):t instanceof ca.fu.ol?Oc.ph(t):t instanceof ca.fu.cl?Mc.ph(t):Lc.ph(t)}qg(){return this.Lg.qg()}Yg(){return this.Lg.Yg()}zg(){return this.Lg.zg()}Xg(t){return Ea.ph(this.Lg.Xg(Ca(t)))}Eg(){return!1}static ph(t){const e=Object.create(Zc.prototype);return e.Lg=t,e}}class qc{dg;constructor(t){let e;e=t instanceof Uc?new ca.fu.ma(t.dg):new ca.fu.ma(t.Lg),this.dg=e}get _r(){return Ea.ph(this.dg._r)}set _r(t){this.dg._r=Ca(t)}Jg(){const t=this.dg.Jg();return t instanceof ca.fu.Da?Uc.ph(t):Zc.ph(t)}static ph(t){const e=Object.create(qc.prototype);return e.dg=t,e}}class Yc{Qg;constructor(t,e,n,r,i){if(0===t.length)throw new Error("transitions array must not be empty");const[o]=t;this.Qg=o instanceof qc?ca.fu.va.tb(t.map(t=>t.dg),Ca(e),n,r,i):ca.fu.va.eb(t.map(t=>t.dg),Ca(e),n,r,i)}get nb(){return this.Qg.nb.map(qc.ph)}set nb(t){this.Qg.nb=t.map(t=>t.dg)}get signature(){return this.Qg.signature}set signature(t){this.Qg.signature=t}get Yf(){return this.Qg.Yf}set Yf(t){this.Qg.Yf=t}get rb(){const t=this.Qg.rb;if(null!=t)return BigInt(t)}get Ry(){return Ea.ph(this.Qg.Ry)}get tw(){return this.Qg.tw.map(Ea.ph)}get ib(){const t=this.Qg.ib;if(null!=t)return BigInt(t)}ad(t){this.Qg.ad(t.toString())}bytes(){return this.Qg.bytes()}Ih(){return this.Qg.Ih()}mh(){return this.Qg.mh()}Bd(){return ja.ph(this.Qg.Bd())}static tb(t,e,n,r,i){return Yc.ph(ca.fu.va.tb(t.map(t=>t.dg),Ca(e),n,r,i))}static eb(t,e,n,r,i){return Yc.ph(ca.fu.va.eb(t.map(t=>t.dg),Ca(e),n,r,i))}static kh(t){return Yc.ph(ca.fu.va.kh(t))}static fromBase64(t){return Yc.ph(ca.fu.va.fromBase64(t))}static fromHex(t){return Yc.ph(ca.fu.va.fromHex(t))}static Ed(t){return Yc.ph(ca.fu.va.Ed(t.qf))}static ph(t){const e=Object.create(Yc.prototype);return e.Qg=t,e}}function zc(t){return t.map(t=>({nonce:t.nonce,address:$a.ph(t.address),balance:null!=t.$i?BigInt(t.$i):void 0}))}function Xc(t){return t.map(t=>({id:Ea.ph(t.id),document:null!=t.document?Tc.ph(t.document):void 0}))}function Jc(t){return{ob:BigInt(t.ob),sb:t.sb,ab:BigInt(t.ab),cb:t.cb}}function Qc(t){return{type:t.type,value:null!=t.value?Jc(t.value):void 0}}function tl(t){const[e,n]=t;if(e instanceof ca.fu.Gc)return{lb:Qc(e),ub:zc(n)};if(e instanceof ca.fu.ec)return{identity:Wa.ph(e),hb:n};if(Array.isArray(e)&&Array.isArray(n)){const t=n[0];return null!=t&&t instanceof ca.fu.bl?{hb:e,qr:Xc(n)}:{hb:e,ub:null!=t?zc(n):[]}}throw new Error("Unknown tuple type")}function el(t){if(Array.isArray(t)){if(2===t.length){const[e]=t;if(e instanceof ca.fu.Gc||e instanceof ca.fu.ec)return tl(t);if(Array.isArray(e)&&(0===e.length||Array.isArray(e[0])))return tl(t)}const[e]=t;return null!=e&&Array.isArray(e)&&e[0]instanceof Uint8Array?t:function(t){const[e]=t;if(null==e)return[];if(e instanceof ca.fu.oc)return t.map(t=>({id:Ea.ph(t.id),balance:BigInt(t.balance)}));if(e instanceof ca.fu.bl)return Xc(t);if(e instanceof ca.fu.vc)return zc(t);throw new Error("Unknown array type")}(t)}if(t instanceof ca.fu.Gc)return Qc(t);for(const[e,n]of new Map([[ca.fu.$a,t=>vc.ph(t)],[ca.fu.ec,t=>Wa.ph(t)],[ca.fu.qa,t=>Ea.ph(t)],[ca.fu.mc,t=>Ha.ph(t)],[ca.fu.Ka,t=>Tc.ph(t)],[ca.fu.Ll,t=>ec.ph(t)],[ca.fu.oc,t=>({id:Ea.ph(t.id),balance:BigInt(t.balance)})],[ca.fu.Nl,t=>({fo:Ea.ph(t.id),fb:{wb:t.fb.wb}})],[ca.fu.Dl,t=>({fo:Ea.ph(t.id),pb:null!=t.pb?Cc.ph(t.pb):void 0})],[ca.fu.sl,t=>({paused:t.paused})],[ca.fu.yl,t=>({sender:Ha.ph(t.sender),recipient:Ha.ph(t.recipient)})],[ca.fu.Kl,t=>({yb:t.yb,document:null!=t.document?Tc.ph(t.document):void 0})],[ca.fu.Ol,t=>({yb:t.yb,gb:t.gb,Od:null!=t.Od?BigInt(t.Od):void 0})],[ca.fu.Fl,t=>({yb:t.yb,gb:t.gb,fb:null!=t.fb?{wb:t.fb.wb}:void 0})],[ca.fu.Wl,t=>({yb:t.yb,gb:t.gb,pb:null!=t.pb?Cc.ph(t.pb):void 0})],[ca.fu.El,t=>({identity:Wa.ph(t.identity),ub:t.ub.map(t=>({nonce:t.nonce,address:$a.ph(t.address),balance:null!=t.$i?BigInt(t.$i):void 0}))})],[ca.fu.xl,t=>({identity:Ha.ph(t.identity),ub:t.ub.map(t=>({nonce:t.nonce,address:$a.ph(t.address),balance:null!=t.$i?BigInt(t.$i):void 0}))})]]))if(t instanceof e)return n(t);throw new Error(`Unknown result type: ${t?.constructor?.name}`)}ca.hu(sa);const nl={};async function rl(t,e,n){const r=nl[`${e}_${n}`];if(null!=r)return r;const i=`https://${"mainnet"===t?"":"testnet."}platform-explorer.pshenmic.dev/quorum/info?quorumType=${e}&quorumHash=${n}`,o=await fetch(i,{method:"GET"});if(200!==o.status)throw new Error("Failed to query Platform Explorer for quorum public keys");const s=await o.json(),{bb:a}=s;return nl[`${e}_${n}`]=a,a}function il(t){return Array.prototype.map.call(t,t=>("00"+t.toString(16)).slice(-2)).join("")}async function ol(t){if("string"==typeof t){const e=(new TextEncoder).encode(t),n=await crypto.subtle.digest("SHA-256",e);return il(new Uint8Array(n))}{const e=function(t){return t.buffer.slice(t.byteOffset,t.byteLength+t.byteOffset)}(t),n=await crypto.subtle.digest("SHA-256",e);return new Uint8Array(n)}}async function sl(t,e,n,r,i,o){const s=await async function(t,e,n){const r=(new TextEncoder).encode(t),i=r.length+8+4,o=new ArrayBuffer(i),s=new DataView(o),a=new Uint8Array(o);let c=0;return a.set(r,c),c+=r.length,s.setBigUint64(c,e,!0),c+=8,s.setInt32(c,n,!0),await ol(a)}("dpbvote",i,o),a=await async function(t,e,n,r,i,o){const s=(new TextEncoder).encode(t),a=84+s.length,c=new ArrayBuffer(a),l=new DataView(c),u=new Uint8Array(c);let h=0;if(l.setInt32(h,r,!0),h+=4,l.setBigUint64(h,e,!0),h+=8,l.setBigUint64(h,BigInt(n),!0),h+=8,u.set(i,h),h+=32,u.set(o,h),h+=32,84!==h)throw new Error("Invalid input length while encoding sign bytes");return u.set(s,h),await ol(u)}(e,i,o,t.type,t.Po,t.No);return await async function(t,e,n,r){const i=1+e.length+n.length+r.length,o=new Uint8Array(i);let s=0;o[s]=t,s+=1;const a=new Uint8Array(e).reverse();o.set(a,s),s+=e.length;const c=new Uint8Array(n).reverse();o.set(c,s),s+=n.length;const l=new Uint8Array(r).reverse();return o.set(l,s),await ol(await ol(o))}(n,r,s,a)}function al(t,e,n){for(let r=0;r<28;r+=7){const i=t>>>r,o=!(i>>>7==0&&0==e),s=255&(o?128|i:i);if(n.push(s),!o)return}const r=t>>>28&15|(7&e)<<4,i=!!(e>>3);if(n.push(255&(i?128|r:r)),i){for(let t=3;t<31;t+=7){const r=e>>>t,i=!(r>>>7==0),o=255&(i?128|r:r);if(n.push(o),!i)return}n.push(e>>>31&1)}}const cl=4294967296;function ll(t){const e="-"===t[0];e&&(t=t.slice(1));const n=1e6;let r=0,i=0;function o(e,o){const s=Number(t.slice(e,o));i*=n,r=r*n+s,r>=cl&&(i+=r/cl|0,r%=cl)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),e?fl(r,i):hl(r,i)}function ul(t,e){if(({C:t,G:e}=function(t,e){return{C:t>>>0,G:e>>>0}}(t,e)),e<=2097151)return String(cl*e+t);const n=16777215&(t>>>24|e<<8),r=e>>16&65535;let i=(16777215&t)+6777216*n+6710656*r,o=n+8147497*r,s=2*r;const a=1e7;return i>=a&&(o+=Math.floor(i/a),i%=a),o>=a&&(s+=Math.floor(o/a),o%=a),s.toString()+dl(o)+dl(i)}function hl(t,e){return{C:0|t,G:0|e}}function fl(t,e){return e=~e,t?t=1+~t:e+=1,hl(t,e)}const dl=t=>{const e=String(t);return"0000000".slice(e.length)+e};function wl(t,e){if(t>=0){for(;t>127;)e.push(127&t|128),t>>>=7;e.push(t)}else{for(let n=0;n<9;n++)e.push(127&t|128),t>>=7;e.push(1)}}const pl=yl();function yl(){const t=new DataView(new ArrayBuffer(8));if("function"==typeof BigInt&&"function"==typeof t.getBigInt64&&"function"==typeof t.getBigUint64&&"function"==typeof t.setBigInt64&&"function"==typeof t.setBigUint64&&("object"!=typeof process||"object"!=typeof process.Ks||"1"!==process.Ks.BUF_BIGINT_DISABLE)){const e=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),r=BigInt("0"),i=BigInt("18446744073709551615");return{mb:BigInt(0),supported:!0,parse(t){const r="bigint"==typeof t?t:BigInt(t);if(r>n||r<e)throw new Error(`invalid int64: ${t}`);return r},Ib(t){const e="bigint"==typeof t?t:BigInt(t);if(e>i||e<r)throw new Error(`invalid uint64: ${t}`);return e},kb(e){return t.setBigInt64(0,this.parse(e),!0),{C:t.getInt32(0,!0),G:t.getInt32(4,!0)}},Tb(e){return t.setBigInt64(0,this.Ib(e),!0),{C:t.getInt32(0,!0),G:t.getInt32(4,!0)}},Ab:(e,n)=>(t.setInt32(0,e,!0),t.setInt32(4,n,!0),t.getBigInt64(0,!0)),Bb:(e,n)=>(t.setInt32(0,e,!0),t.setInt32(4,n,!0),t.getBigUint64(0,!0))}}return{mb:"0",supported:!1,parse:t=>("string"!=typeof t&&(t=t.toString()),gl(t),t),Ib:t=>("string"!=typeof t&&(t=t.toString()),bl(t),t),kb:t=>("string"!=typeof t&&(t=t.toString()),gl(t),ll(t)),Tb:t=>("string"!=typeof t&&(t=t.toString()),bl(t),ll(t)),Ab:(t,e)=>function(t,e){let n=hl(t,e);const r=2147483648&n.G;r&&(n=fl(n.C,n.G));const i=ul(n.C,n.G);return r?"-"+i:i}(t,e),Bb:(t,e)=>ul(t,e)}}function gl(t){if(!/^-?[0-9]+$/.test(t))throw new Error("invalid int64: "+t)}function bl(t){if(!/^[0-9]+$/.test(t))throw new Error("invalid uint64: "+t)}const ml=Symbol.for("@bufbuild/protobuf/text-encoding");var vl;!function(t){t[t.k=0]="Varint",t[t.T=1]="Bit64",t[t.A=2]="LengthDelimited",t[t.B=3]="StartGroup",t[t.R=4]="EndGroup",t[t.P=5]="Bit32"}(vl||(vl={}));const Il=34028234663852886e22,kl=-34028234663852886e22;class Tl{constructor(t=function(){if(null==globalThis[ml]){const t=new globalThis.TextEncoder,e=new globalThis.TextDecoder;globalThis[ml]={Eb:e=>t.encode(e),Rb:t=>e.decode(t),Pb(t){try{return encodeURIComponent(t),!0}catch(t){return!1}}}}return globalThis[ml]}().Eb){this.Eb=t,this.stack=[],this.lt=[],this.i=[]}finish(){this.i.length&&(this.lt.push(new Uint8Array(this.i)),this.i=[]);let t=0;for(let e=0;e<this.lt.length;e++)t+=this.lt[e].length;let e=new Uint8Array(t),n=0;for(let t=0;t<this.lt.length;t++)e.set(this.lt[t],n),n+=this.lt[t].length;return this.lt=[],e}ut(){return this.stack.push({lt:this.lt,i:this.i}),this.lt=[],this.i=[],this}join(){let t=this.finish(),e=this.stack.pop();if(!e)throw new Error("invalid state, fork stack empty");return this.lt=e.lt,this.i=e.i,this.uint32(t.byteLength),this.raw(t)}tag(t,e){return this.uint32((t<<3|e)>>>0)}raw(t){return this.i.length&&(this.lt.push(new Uint8Array(this.i)),this.i=[]),this.lt.push(t),this}uint32(t){for(Bl(t);t>127;)this.i.push(127&t|128),t>>>=7;return this.i.push(t),this}int32(t){return Al(t),wl(t,this.i),this}J(t){return this.i.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let e=this.Eb(t);return this.uint32(e.byteLength),this.raw(e)}float(t){!function(t){if("string"==typeof t){const e=t;if(t=Number(t),Number.isNaN(t)&&"NaN"!==e)throw new Error("invalid float32: "+e)}else if("number"!=typeof t)throw new Error("invalid float32: "+typeof t);if(Number.isFinite(t)&&(t>Il||t<kl))throw new Error("invalid float32: "+t)}(t);let e=new Uint8Array(4);return new DataView(e.buffer).setFloat32(0,t,!0),this.raw(e)}it(t){let e=new Uint8Array(8);return new DataView(e.buffer).setFloat64(0,t,!0),this.raw(e)}tt(t){Bl(t);let e=new Uint8Array(4);return new DataView(e.buffer).setUint32(0,t,!0),this.raw(e)}et(t){Al(t);let e=new Uint8Array(4);return new DataView(e.buffer).setInt32(0,t,!0),this.raw(e)}Z(t){return Al(t),wl(t=(t<<1^t>>31)>>>0,this.i),this}rt(t){let e=new Uint8Array(8),n=new DataView(e.buffer),r=pl.kb(t);return n.setInt32(0,r.C,!0),n.setInt32(4,r.G,!0),this.raw(e)}nt(t){let e=new Uint8Array(8),n=new DataView(e.buffer),r=pl.Tb(t);return n.setInt32(0,r.C,!0),n.setInt32(4,r.G,!0),this.raw(e)}q(t){let e=pl.kb(t);return al(e.C,e.G,this.i),this}X(t){const e=pl.kb(t),n=e.G>>31;return al(e.C<<1^n,(e.G<<1|e.C>>>31)^n,this.i),this}Y(t){const e=pl.Tb(t);return al(e.C,e.G,this.i),this}}function Al(t){if("string"==typeof t)t=Number(t);else if("number"!=typeof t)throw new Error("invalid int32: "+typeof t);if(!Number.isInteger(t)||t>2147483647||t<-2147483648)throw new Error("invalid int32: "+t)}function Bl(t){if("string"==typeof t)t=Number(t);else if("number"!=typeof t)throw new Error("invalid uint32: "+typeof t);if(!Number.isInteger(t)||t>4294967295||t<0)throw new Error("invalid uint32: "+t)}function El(t){return Uint8Array.from((t.match(/.{1,2}/g)??[]).map(t=>parseInt(t,16)))}async function Rl(t,e,n,r){const i=cr.create({appVersion:String(e.ur),ar:e.ar,time:e.lr,Ro:n,height:e.height}),o=await async function(t){const e=new Tl,n=cr.le(t,e,{ot:!1}).finish();return e.bytes(n),await ol(e.finish())}(i),s=lr.create({type:Ut.tr,Po:t.ir,hr:e.hr,height:e.height,round:String(t.round),No:o}),a=await sl(s,e.hr,t.sr,t.rr,BigInt(e.height),t.round),{signature:c}=t;return function(t,e,n){return ca.fu.ea(t,e,n)}(Uint8Array.from(a),c,El(r))}const Pl="GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec",Nl=ya.Yu,xl=BigInt(0xffffffffff);async function $l(t,e,n){const r=new Ea(e),i=new Ea(n),o=_t.create({version:{Tt:"v0",wr:{yr:r.bytes(),gr:i.bytes(),pr:!0}}}),{response:s}=await t.Ts().Ho(o),{version:a}=s;if("v0"!==a.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be v0)");const{wr:c}=a;if("proof"!==c.result.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be proof)");const{result:{br:l},metadata:u}=c;if(null==u)throw new Error("Metadata not found");const{Nb:h,xb:f}=function(t,e,n,r,i){const o=ca.fu.Js(t,Ca(e),Ca(n),r,Ua(i));return{Nb:o.Nb,xb:null!=o.xb?BigInt(o.xb):void 0}}(l.nr,r.bytes(),i.bytes(),!0,Nl);if(null==f)return BigInt(0);const d=await rl(t.Ui,l.sr,il(l.rr));if(!await Rl(l,u,h,d))throw new Error("Failed to verify query");return BigInt(f)&xl}async function Ul(t,e,n){const r=new Ea(e);let i={request:{Tt:"allKeys",Tr:{}}};null!=n&&(i={request:{Tt:"specificKeys",Ar:{Er:n}}});const o=ue.create({version:{Tt:"v0",wr:{yr:r.bytes(),$r:oe.create(i),pr:!0}}}),{response:s}=await t.Ts().Wo(o),{version:a}=s;if("v0"!==a.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be v0)");const{wr:c}=a;if("proof"!==c.result.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be proof)");const{result:{br:l},metadata:u}=c;if(null==u)throw new Error("Metadata not found");const{Nb:h,identity:f}=function(t,e,n,r,i,o,s,a,c){const l=ca.fu.Qs(t,Ca(e),n,r,i,o,s,a,Ua(c));return{Nb:l.Nb,identity:null!=l.identity?Ha.ph(l.identity):void 0}}(l.nr,r.bytes(),null!=n?n:null,!1,!1,!0,null,null,Nl);if(null==f)throw new Error(`Identity with identifier ${r.Ph()} not found`);const d=await rl(t.Ui,l.sr,il(l.rr));if(!await Rl(l,u,h,d))throw new Error("Failed to verify query");return Object.keys(f.Lf).map(t=>f.Lf[t])}const Sl=BigInt(0xffffffffff);async function Cl(t,e){const n=new Ea(e),r=Wt.create({version:{Tt:"v0",wr:{yr:n.bytes(),pr:!0}}}),{response:i}=await t.Ts()._o(r),{version:o}=i;if("v0"!==o.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be v0)");const{wr:s}=o;if("proof"!==s.result.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be proof)");const{result:{br:a},metadata:c}=s;if(null==c)throw new Error("Metadata not found");const{Nb:l,nonce:u}=function(t,e,n,r){const i=ca.fu.ta(t,Ca(e),n,Ua(r));return{Nb:i.Nb,nonce:null!=i.nonce?BigInt(i.nonce):void 0}}(a.nr,n.bytes(),!0,Nl);if(null==u)return BigInt(0);const h=await rl(t.Ui,a.sr,il(a.rr));if(!await Rl(a,c,l,h))throw new Error("Failed to verify query");return BigInt(u)&Sl}async function Gl(t,e){const n=new Ea(e),r=jt.create({version:{Tt:"v0",wr:{id:n.bytes(),pr:!0}}}),{response:i}=await t.Ts().jo(r),{version:o}=i;if("v0"!==o.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be v0)");const{wr:s}=o;if("proof"!==s.result.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be proof)");const{result:{br:a},metadata:c}=s;if(null==c)throw new Error("Metadata not found");const{Nb:l,balance:u}=function(t,e,n,r){const i=ca.fu.Ys(t,Ca(e),n,Ua(r));return{Nb:i.Nb,balance:null!=i.balance?BigInt(i.balance):void 0}}(a.nr,n.bytes(),!0,Nl);if(null==u)throw new Error(`Failed to fetch balance for identifier ${n.Ph()}`);const h=await rl(t.Ui,a.sr,il(a.rr));if(!await Rl(a,c,l,h))throw new Error("Failed to verify query");return BigInt(u)}async function Vl(t,e){const n=Ke.create({version:{Tt:"v0",wr:{Yr:El(e),pr:!0}}}),{response:r}=await t.Ts().Yo(n),{version:i}=r;if("v0"!==i.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be v0)");const{wr:o}=i;if("proof"!==o.result.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be proof)");const{result:{br:s},metadata:a}=o;if(null==a)throw new Error("Metadata not found");const{Nb:c,identity:l}=function(t,e,n){const r=ca.fu.Xs(t,e,Ua(n));return{Nb:r.Nb,identity:null!=r.identity?Wa.ph(r.identity):void 0}}(s.nr,El(e),Nl);if(null==l)throw new Error(`Identity with public key hash ${e} not found`);const u=await rl(t.Ui,s.sr,il(s.rr));if(!await Rl(s,a,c,u))throw new Error("Failed to verify query");return l}async function Kl(t,e){const n=new Ea(e),r=Ot.create({version:{Tt:"v0",wr:{id:n.bytes(),pr:!0}}}),{response:i}=await t.Ts().Fo(r),{version:o}=i;if("v0"!==o.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be v0)");const{wr:s}=o;if("proof"!==s.result.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be proof)");const{result:{br:a},metadata:c}=s;if(null==c)throw new Error("Metadata not found");const{Nb:l,identity:u}=function(t,e,n,r){const i=ca.fu.zs(t,Ca(e),n,Ua(r));return{Nb:i.Nb,identity:null!=i.identity?Wa.ph(i.identity):void 0}}(a.nr,n,!0,Nl);if(null==u)throw new Error(`Identity with identifier ${n.Ph()} not found`);const h=await rl(t.Ui,a.sr,il(a.rr));if(!await Rl(a,c,l,h))throw new Error("Failed to verify query");return u}const Ol={create:{$b:qa,arguments:["publicKeys","assetLockProof"],Ub:["signature","userFeeIncrease"]},Sb:{$b:Ya,arguments:["assetLockProof","identityId"],Ub:["userFeeIncrease"]},update:{$b:za,arguments:["identityId","revision","identityNonce","addPublicKeys","disablePublicKeyIds"],Ub:["userFeeIncrease"]},Cb:{$b:Xa,arguments:["identityId","amount","recipientId","identityNonce"],Ub:["userFeeIncrease"]},Gb:{$b:Ja,arguments:["identityId","amount","coreFeePerByte","pooling","identityNonce","outputScript"],Ub:["userFeeIncrease"]}};async function Fl(t,e){const n=De.create({version:{Tt:"v0",wr:{Yr:El(e),pr:!0}}}),{response:r}=await t.Ts().zo(n),{version:i}=r;if("v0"!==i.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be v0)");const{wr:o}=i;if("proof"!==o.result.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be proof)");const{result:{br:s},metadata:a}=o;if(null==a)throw new Error("Metadata not found");if(null==s.zr)throw new Error("GroveDB proof not found for identity by non unique public key request");const{Nb:c,identifier:l}=function(t,e,n,r,i){const o=ca.fu.qs(t,e,n,void 0,Ua(i));return{Nb:o.Nb,identifier:null!=o.identifier?Ea.ph(o.identifier):void 0}}(s.zr.nr,!1,El(e),0,Nl);if(null==l)throw new Error(`Identity with non unique public key hash ${e} not found`);const u=await rl(t.Ui,s.zr.sr,il(s.zr.rr));if(!await Rl(s.zr,a,c,u))throw new Error("Failed to verify query");return await Kl(t,l)}
2
2
  /*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Wl(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function Dl(t,e){return!!Array.isArray(e)&&(0===e.length||(t?e.every(t=>"string"==typeof t):e.every(t=>Number.isSafeInteger(t))))}function _l(t,e){if("string"!=typeof e)throw new Error(`${t}: string expected`);return!0}function Hl(t){if(!Number.isSafeInteger(t))throw new Error(`invalid integer: ${t}`)}function jl(t){if(!Array.isArray(t))throw new Error("array expected")}function Ml(t,e){if(!Dl(!0,e))throw new Error(`${t}: array of strings expected`)}function Ll(t,e){if(!Dl(!1,e))throw new Error(`${t}: array of numbers expected`)}function Zl(...t){const e=t=>t,n=(t,e)=>n=>t(e(n));return{encode:t.map(t=>t.encode).reduceRight(n,e),decode:t.map(t=>t.decode).reduce(n,e)}}function ql(t){const e="string"==typeof t?t.split(""):t,n=e.length;Ml("alphabet",e);const r=new Map(e.map((t,e)=>[t,e]));return{encode:r=>(jl(r),r.map(r=>{if(!Number.isSafeInteger(r)||r<0||r>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${r}". Allowed: ${t}`);return e[r]})),decode:e=>(jl(e),e.map(e=>{_l("alphabet.decode",e);const n=r.get(e);if(void 0===n)throw new Error(`Unknown letter: "${e}". Allowed: ${t}`);return n}))}}function Yl(t=""){return _l("join",t),{encode:e=>(Ml("join.decode",e),e.join(t)),decode:e=>(_l("join.decode",e),e.split(t))}}function zl(t,e,n){if(e<2)throw new Error(`convertRadix: invalid from=${e}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(jl(t),!t.length)return[];let r=0;const i=[],o=Array.from(t,t=>{if(Hl(t),t<0||t>=e)throw new Error(`invalid integer: ${t}`);return t}),s=o.length;for(;;){let t=0,a=!0;for(let i=r;i<s;i++){const s=o[i],c=e*t,l=c+s;if(!Number.isSafeInteger(l)||c/e!==t||l-s!==c)throw new Error("convertRadix: carry overflow");const u=l/n;t=l%n;const h=Math.floor(u);if(o[i]=h,!Number.isSafeInteger(h)||h*n+t!==l)throw new Error("convertRadix: carry overflow");a&&(h?a=!1:r=i)}if(i.push(t),a)break}for(let e=0;e<t.length-1&&0===t[e];e++)i.push(0);return i.reverse()}const Xl=(t,e)=>0===e?t:Xl(e,t%e),Jl=(t,e)=>t+(e-Xl(t,e)),Ql=(()=>{let t=[];for(let e=0;e<40;e++)t.push(2**e);return t})();function tu(t,e,n,r){if(jl(t),e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(Jl(e,n)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${n} carryBits=${Jl(e,n)}`);let i=0,o=0;const s=Ql[e],a=Ql[n]-1,c=[];for(const r of t){if(Hl(r),r>=s)throw new Error(`convertRadix2: invalid data word=${r} from=${e}`);if(i=i<<e|r,o+e>32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${e}`);for(o+=e;o>=n;o-=n)c.push((i>>o-n&a)>>>0);const t=Ql[o];if(void 0===t)throw new Error("invalid carry");i&=t-1}if(i=i<<n-o&a,!r&&o>=e)throw new Error("Excess padding");if(!r&&i>0)throw new Error(`Non-zero padding: ${i}`);return r&&o>0&&c.push(i>>>0),c}const eu=(()=>"function"==typeof Uint8Array.from([]).toBase64&&"function"==typeof Uint8Array.fromBase64)()?{encode:t=>(function(t,...e){if(!Wl(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}(t),t.toBase64()),decode:t=>(t=>{if(_l("base64",t),t.length>0&&!/^[A-Za-z0-9=+/]+$/.test(t))throw new Error("invalid base64");return Uint8Array.fromBase64(t,{Vb:"base64",Kb:"strict"})})(t)}:Zl(function(t,e=!1){if(Hl(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(Jl(8,t)>32||Jl(t,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!Wl(n))throw new Error("radix2.encode input should be Uint8Array");return tu(Array.from(n),8,t,!e)},decode:n=>(Ll("radix2.decode",n),Uint8Array.from(tu(n,t,8,e)))}}(6),ql("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),function(t,e="="){return Hl(t),_l("padding",e),{encode(n){for(Ml("padding.encode",n);n.length*t%8;)n.push(e);return n},decode(n){Ml("padding.decode",n);let r=n.length;if(r*t%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;r>0&&n[r-1]===e;r--){if((r-1)*t%8==0)throw new Error("padding: invalid, string has too much padding")}return n.slice(0,r)}}}(6),Yl("")),nu=(ru="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",Zl(function(t){return Hl(t),{encode:e=>{if(!Wl(e))throw new Error("radix.encode input should be Uint8Array");return zl(Array.from(e),256,t)},decode:e=>(Ll("radix.decode",e),Uint8Array.from(zl(e,t,256)))}}(58),ql(ru),Yl("")));var ru;class iu{Ob;constructor(t){this.Ob=t}async jo(t){return await Gl(this.Ob,t)}async Yo(t){if(40!==t.length)throw new Error("Public key hash should equal 40");return await Vl(this.Ob,t)}async zo(t){if(40!==t.length)throw new Error("Public key hash should equal 40");return await Fl(this.Ob,t)}async Fb(t){return await Kl(this.Ob,t)}async _o(t){return await Cl(this.Ob,t)}async Ho(t,e){return await $l(this.Ob,t,e)}async Wb(t,e){return await Ul(this.Ob,t,e)}Db(t,e){if(null!=e.yr&&(e.yr=new Ea(e.yr)),null==e._b&&(e._b=[]),null!=e.Nd){const{type:t}=e.Nd;if("chainLock"===t){const{Ah:t,Uh:n,ar:r}=e.Nd;e.Nd=Na.Hh(r,new Aa(t,n))}else{if("instantLock"!==t)throw null==t?new Error("Missing Asset Lock type in the params"):new Error(`Unknown Asset Lock type: ${t}`);{const{transaction:t,Uh:n,Sh:r}=e.Nd;e.Nd=Na._h(El(r),El(t),n)}}}return null!=e.Hb&&(e.Hb=e.Hb.map(({id:t,Or:e,Af:n,Ef:r,readOnly:i,data:o,signature:s,Nf:a})=>new _a(t,e,n,r,i,o,s,null!=a?new Va(a._r,a.Hr):void 0))),null!=e.kd&&(e.kd=e.kd.map(({id:t,Or:e,Af:n,Ef:r,readOnly:i,data:o,signature:s,Nf:a})=>new _a(t,e,n,r,i,o,s,null!=a?new Va(a._r,a.Hr):void 0))),null!=e.Vd&&(e.Vd=new Ea(e.Vd)),"withdrawal"===t&&(e.Dd=e.Dd??"Standard",e._d=e._d??1,e.Wd=e.Wd??(null!=e.jb?Da.Wf(nu.decode(e.jb).slice(1,21)):void 0)),function(t,e){const{$b:n,arguments:r,Ub:i}=Ol[t];if(null==n)throw new Error(`Unimplemented transition type: ${t}`);const[o]=r.filter(t=>null==e[t]&&!i.includes(t));if(null!=o)throw new Error(`Token transition param "${o}" is missing`);return new n(...r.map(t=>e[t])).Bd()}(t,e)}}async function ou(t,e){const n=new Ea(e);if(n.Ph()===Pl)return vc.fromBase64("AeZoxlmvZq7h5ywYbd57W34KHXEqCcQNVyH2Ir9TxTFVAAAAAAABAQAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIGZG9tYWluFgsSEGRvY3VtZW50c011dGFibGUTABIMY2FuQmVEZWxldGVkEwESDHRyYW5zZmVyYWJsZQIBEgl0cmFkZU1vZGUCARIEdHlwZRIGb2JqZWN0EgdpbmRpY2VzFQIWBBIEbmFtZRIScGFyZW50TmFtZUFuZExhYmVsEgpwcm9wZXJ0aWVzFQIWARIabm9ybWFsaXplZFBhcmVudERvbWFpbk5hbWUSA2FzYxYBEg9ub3JtYWxpemVkTGFiZWwSA2FzYxIGdW5pcXVlEwESCWNvbnRlc3RlZBYDEgxmaWVsZE1hdGNoZXMVARYCEgVmaWVsZBIPbm9ybWFsaXplZExhYmVsEgxyZWdleFBhdHRlcm4SE15bYS16QS1aMDEtXXszLDE5fSQSCnJlc29sdXRpb24CABILZGVzY3JpcHRpb24SqklmIHRoZSBub3JtYWxpemVkIGxhYmVsIHBhcnQgb2YgdGhpcyBpbmRleCBpcyBsZXNzIHRoYW4gMjAgY2hhcmFjdGVycyAoYWxsIGFscGhhYmV0IGEteiwgQS1aLCAwLCAxLCBhbmQgLSkgdGhlbiBhIG1hc3Rlcm5vZGUgdm90ZSBjb250ZXN0IHRha2VzIHBsYWNlIHRvIGdpdmUgb3V0IHRoZSBuYW1lFgMSBG5hbWUSCmlkZW50aXR5SWQSDm51bGxTZWFyY2hhYmxlEwASCnByb3BlcnRpZXMVARYBEhByZWNvcmRzLmlkZW50aXR5EgNhc2MSCnByb3BlcnRpZXMWBxIFbGFiZWwWBhIEdHlwZRIGc3RyaW5nEgdwYXR0ZXJuEipeW2EtekEtWjAtOV1bYS16QS1aMC05LV17MCw2MX1bYS16QS1aMC05XSQSCW1pbkxlbmd0aAIDEgltYXhMZW5ndGgCPxIIcG9zaXRpb24CABILZGVzY3JpcHRpb24SGURvbWFpbiBsYWJlbC4gZS5nLiAnQm9iJy4SD25vcm1hbGl6ZWRMYWJlbBYGEgR0eXBlEgZzdHJpbmcSB3BhdHRlcm4SPF5bYS1oai1rbS1ucC16MC05XVthLWhqLWttLW5wLXowLTktXXswLDYxfVthLWhqLWttLW5wLXowLTldJBIJbWF4TGVuZ3RoAj8SCHBvc2l0aW9uAgESC2Rlc2NyaXB0aW9uEqNEb21haW4gbGFiZWwgY29udmVydGVkIHRvIGxvd2VyY2FzZSBmb3IgY2FzZS1pbnNlbnNpdGl2ZSB1bmlxdWVuZXNzIHZhbGlkYXRpb24uICJvIiwgImkiIGFuZCAibCIgcmVwbGFjZWQgd2l0aCAiMCIgYW5kICIxIiB0byBtaXRpZ2F0ZSBob21vZ3JhcGggYXR0YWNrLiBlLmcuICdiMGInEggkY29tbWVudBJcTXVzdCBiZSBlcXVhbCB0byB0aGUgbGFiZWwgaW4gbG93ZXJjYXNlLiAibyIsICJpIiBhbmQgImwiIG11c3QgYmUgcmVwbGFjZWQgd2l0aCAiMCIgYW5kICIxIi4SEHBhcmVudERvbWFpbk5hbWUWBhIEdHlwZRIGc3RyaW5nEgdwYXR0ZXJuEi1eJHxeW2EtekEtWjAtOV1bYS16QS1aMC05LV17MCw2MX1bYS16QS1aMC05XSQSCW1pbkxlbmd0aAIAEgltYXhMZW5ndGgCPxIIcG9zaXRpb24CAhILZGVzY3JpcHRpb24SJ0EgZnVsbCBwYXJlbnQgZG9tYWluIG5hbWUuIGUuZy4gJ2Rhc2gnLhIabm9ybWFsaXplZFBhcmVudERvbWFpbk5hbWUWBxIEdHlwZRIGc3RyaW5nEgdwYXR0ZXJuEkFeJHxeW2EtaGota20tbnAtejAtOV1bYS1oai1rbS1ucC16MC05LVwuXXswLDYxfVthLWhqLWttLW5wLXowLTldJBIJbWluTGVuZ3RoAgASCW1heExlbmd0aAI/Eghwb3NpdGlvbgIDEgtkZXNjcmlwdGlvbhKiQSBwYXJlbnQgZG9tYWluIG5hbWUgaW4gbG93ZXJjYXNlIGZvciBjYXNlLWluc2Vuc2l0aXZlIHVuaXF1ZW5lc3MgdmFsaWRhdGlvbi4gIm8iLCAiaSIgYW5kICJsIiByZXBsYWNlZCB3aXRoICIwIiBhbmQgIjEiIHRvIG1pdGlnYXRlIGhvbW9ncmFwaCBhdHRhY2suIGUuZy4gJ2Rhc2gnEggkY29tbWVudBLATXVzdCBlaXRoZXIgYmUgZXF1YWwgdG8gYW4gZXhpc3RpbmcgZG9tYWluIG9yIGVtcHR5IHRvIGNyZWF0ZSBhIHRvcCBsZXZlbCBkb21haW4uICJvIiwgImkiIGFuZCAibCIgbXVzdCBiZSByZXBsYWNlZCB3aXRoICIwIiBhbmQgIjEiLiBPbmx5IHRoZSBkYXRhIGNvbnRyYWN0IG93bmVyIGNhbiBjcmVhdGUgdG9wIGxldmVsIGRvbWFpbnMuEgxwcmVvcmRlclNhbHQWBhIEdHlwZRIFYXJyYXkSCWJ5dGVBcnJheRMBEghtaW5JdGVtcwIgEghtYXhJdGVtcwIgEghwb3NpdGlvbgIEEgtkZXNjcmlwdGlvbhIiU2FsdCB1c2VkIGluIHRoZSBwcmVvcmRlciBkb2N1bWVudBIHcmVjb3JkcxYFEgR0eXBlEgZvYmplY3QSCnByb3BlcnRpZXMWARIIaWRlbnRpdHkWBxIEdHlwZRIFYXJyYXkSCWJ5dGVBcnJheRMBEghtaW5JdGVtcwIgEghtYXhJdGVtcwIgEghwb3NpdGlvbgIBEhBjb250ZW50TWVkaWFUeXBlEiFhcHBsaWNhdGlvbi94LmRhc2guZHBwLmlkZW50aWZpZXISC2Rlc2NyaXB0aW9uEjFJZGVudGlmaWVyIG5hbWUgcmVjb3JkIHRoYXQgcmVmZXJzIHRvIGFuIElkZW50aXR5Eg1taW5Qcm9wZXJ0aWVzAgESCHBvc2l0aW9uAgUSFGFkZGl0aW9uYWxQcm9wZXJ0aWVzEwASDnN1YmRvbWFpblJ1bGVzFgYSBHR5cGUSBm9iamVjdBIKcHJvcGVydGllcxYBEg9hbGxvd1N1YmRvbWFpbnMWBBIEdHlwZRIHYm9vbGVhbhILZGVzY3JpcHRpb24SW1RoaXMgb3B0aW9uIGRlZmluZXMgd2hvIGNhbiBjcmVhdGUgc3ViZG9tYWluczogdHJ1ZSAtIGFueW9uZTsgZmFsc2UgLSBvbmx5IHRoZSBkb21haW4gb3duZXISCCRjb21tZW50Ek9Pbmx5IHRoZSBkb21haW4gb3duZXIgaXMgYWxsb3dlZCB0byBjcmVhdGUgc3ViZG9tYWlucyBmb3Igbm9uIHRvcC1sZXZlbCBkb21haW5zEghwb3NpdGlvbgIAEghwb3NpdGlvbgIGEgtkZXNjcmlwdGlvbhJCU3ViZG9tYWluIHJ1bGVzIGFsbG93IGRvbWFpbiBvd25lcnMgdG8gZGVmaW5lIHJ1bGVzIGZvciBzdWJkb21haW5zEhRhZGRpdGlvbmFsUHJvcGVydGllcxMAEghyZXF1aXJlZBUBEg9hbGxvd1N1YmRvbWFpbnMSCHJlcXVpcmVkFQkSCiRjcmVhdGVkQXQSCiR1cGRhdGVkQXQSDiR0cmFuc2ZlcnJlZEF0EgVsYWJlbBIPbm9ybWFsaXplZExhYmVsEhpub3JtYWxpemVkUGFyZW50RG9tYWluTmFtZRIMcHJlb3JkZXJTYWx0EgdyZWNvcmRzEg5zdWJkb21haW5SdWxlcxIJdHJhbnNpZW50FQESDHByZW9yZGVyU2FsdBIUYWRkaXRpb25hbFByb3BlcnRpZXMTABIIJGNvbW1lbnQS+wE3SW4gb3JkZXIgdG8gcmVnaXN0ZXIgYSBkb21haW4geW91IG5lZWQgdG8gY3JlYXRlIGEgcHJlb3JkZXIuIFRoZSBwcmVvcmRlciBzdGVwIGlzIG5lZWRlZCB0byBwcmV2ZW50IG1hbi1pbi10aGUtbWlkZGxlIGF0dGFja3MuIG5vcm1hbGl6ZWRMYWJlbCArICcuJyArIG5vcm1hbGl6ZWRQYXJlbnREb21haW4gbXVzdCBub3QgYmUgbG9uZ2VyIHRoYW4gMjUzIGNoYXJzIGxlbmd0aCBhcyBkZWZpbmVkIGJ5IFJGQyAxMDM1LiBEb21haW4gZG9jdW1lbnRzIGFyZSBpbW11dGFibGU6IG1vZGlmaWNhdGlvbiBhbmQgZGVsZXRpb24gYXJlIHJlc3RyaWN0ZWQIcHJlb3JkZXIWCBIQZG9jdW1lbnRzTXV0YWJsZRMAEgxjYW5CZURlbGV0ZWQTARIEdHlwZRIGb2JqZWN0EgdpbmRpY2VzFQEWAxIEbmFtZRIKc2FsdGVkSGFzaBIKcHJvcGVydGllcxUBFgESEHNhbHRlZERvbWFpbkhhc2gSA2FzYxIGdW5pcXVlEwESCnByb3BlcnRpZXMWARIQc2FsdGVkRG9tYWluSGFzaBYGEgR0eXBlEgVhcnJheRIJYnl0ZUFycmF5EwESCG1pbkl0ZW1zAiASCG1heEl0ZW1zAiASCHBvc2l0aW9uAgASC2Rlc2NyaXB0aW9uEllEb3VibGUgc2hhLTI1NiBvZiB0aGUgY29uY2F0ZW5hdGlvbiBvZiBhIDMyIGJ5dGUgcmFuZG9tIHNhbHQgYW5kIGEgbm9ybWFsaXplZCBkb21haW4gbmFtZRIIcmVxdWlyZWQVARIQc2FsdGVkRG9tYWluSGFzaBIUYWRkaXRpb25hbFByb3BlcnRpZXMTABIIJGNvbW1lbnQSSlByZW9yZGVyIGRvY3VtZW50cyBhcmUgaW1tdXRhYmxlOiBtb2RpZmljYXRpb24gYW5kIGRlbGV0aW9uIGFyZSByZXN0cmljdGVkAAAAAAAAAAAAAA==",!0,9);const r=Pe.create({version:{Tt:"v0",wr:{id:n.bytes(),pr:!0}}}),{response:i}=await t.Ts().Zo(r),{version:o}=i;if("v0"!==o.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be v0)");const{wr:s}=o;if("proof"!==s.result.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be proof)");const{result:{br:a},metadata:c}=s;if(null==c)throw new Error("Metadata not found");const{Nb:l,Dr:u}=function(t,e,n,r,i,o){const s=ca.fu.Ms(t,e,n,r,Ca(i),Ua(o));let a;return null!=s.Dr&&(a=vc.ph(s.Dr)),{Nb:s.Nb,Dr:a}}(a.nr,void 0,!1,!1,n.bytes(),Nl);if(null==u)throw new Error(`Data Contract with identifier ${n.Ph()} not found`);const h=await rl(t.Ui,a.sr,il(a.rr));if(!await Rl(a,c,l,h))throw new Error("Failed to verify query");return u}async function su(t,e){const n=e.hash(!1),r=ur.create({version:{Tt:"v0",wr:{xo:El(n),pr:!0}}}),{response:i}=await t.Ts().us(r),{version:o}=i;if("v0"!==o.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be v0)");const{wr:s}=o;if("proof"!==s.result.Tt&&"error"!==s.result.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be proof)");if("proof"!==s.result.Tt){if("error"===s.result.Tt){const{code:t,message:e,data:r}=s.result.error;throw new Error(`State transition ${n} failed to execute with code ${String(t)}, message: ${String(e)}, data: ${eu.encode(r)}`)}throw new Error("Unexpected oneOfKind returned for waitForStateTransitionResult")}{const{result:{br:n},metadata:r}=s;if(null==r)throw new Error("Metadata not found");const{lr:i,height:o,ar:a,cr:c}=r,l=[];if("BATCH"===e.td()){const n=Yc.Ed(e),[r]=n.nb,i=await ou(t,r._r);l.push(i)}if("MASTERNODE_VOTE"===e.td()){const n=nc.Ed(e),r=await ou(t,n.Qd.Yd.gr);l.push(r)}const u={lr:BigInt(i),height:BigInt(o),Mb:a,cr:c},{Nb:h,result:f}=function(t,e,n,r,i){const o=ca.fu.na(t,e.qf,new ca.fu.ka(n.lr.toString(),n.height.toString(),n.Mb,n.cr),r.map(t=>t.Ay),Ua(i));return{Nb:o.Nb,result:el(o.result)}}(n.nr,e,u,l,Nl);if(null==f)throw new Error("State transition result was null");const d=await rl(t.Ui,n.sr,il(n.rr));if(!await Rl(n,r,h,d))throw new Error("Failed to verify wait for state transition result query")}}function au(t){let e;if("string"==typeof t){const n=t.length%4;0!==n&&(t+="=".repeat(4-n)),e=eu.decode(t)}else e=t;return xa.qh(e).message}async function cu(t,e){try{if(0===e.signature?.length)throw new Error("State Transition is not signed");const n=Vt.create({dr:e.bytes()});await t.Ts().Oo(n)}catch(t){throw 0!==t.Be?.["Lb"]?.length?new Error(au(t.Be["Lb"])):t}}class lu{Ob;constructor(t){this.Ob=t}async broadcast(t){return await cu(this.Ob,t)}async us(t){return await su(this.Ob,t)}}function uu(t,e,n,r,i,o){return new Tc(n,e,i??BigInt(1),t,r,o,r)}const hu={create:{$b:Sc,arguments:["identityContractNonce"],Ub:["prefundedVotingBalance","tokenPaymentInfo"]},replace:{$b:Rc,arguments:["identityContractNonce"],Ub:["tokenPaymentInfo"]},delete:{$b:Pc,arguments:["identityContractNonce"],Ub:["tokenPaymentInfo"]},Zb:{$b:$c,arguments:["identityContractNonce","price"],Ub:["tokenPaymentInfo"]},transfer:{$b:xc,arguments:["identityContractNonce","recipientId"],Ub:["tokenPaymentInfo"]},qb:{$b:Nc,arguments:["identityContractNonce","amount"],Ub:["tokenPaymentInfo"]}};function fu(t,e,n){const{$b:r,arguments:i,Ub:o}=hu[e];if(null==r)throw new Error(`Unimplemented transition type: ${e}`);const[s]=i.filter(t=>null==n[t]&&!o.includes(t));if(null!=s)throw new Error(`Document transition param "${s}" is missing`);const a=new r(t,...i.concat(o).map(t=>n[t])).hg(),c=new qc(a);return Yc.tb([c],t.Ry,1).Bd()}let du,wu,pu;try{du=new TextDecoder}catch(t){}let yu=0;const gu={};let bu,mu,vu,Iu,ku,Tu,Au,Bu=11281e4,Eu=1681e4,Ru={},Pu=0,Nu=0,xu=[],$u=[],Uu={Yb:!1,zb:!0},Su=!1,Cu=2;try{new Function("")}catch(t){Cu=1/0}class Gu{constructor(t){if(t&&(!t.Xb&&!t.Jb||t.Yb||(t.Yb=!1,t.zb=!0),!1===t.Yb&&void 0===t.zb&&(t.zb=!0),t.Qb&&(t.tm=t.Qb),t.tm&&!t.nm&&((t.nm=[]).rm=!0),t.Xb)){this.im=new Map;for(let[e,n]of Object.entries(t.Xb))this.im.set(n,e)}Object.assign(this,t)}om(t){return this.Xb&&this.im.get(t)||t}sm(t){return this.Xb&&this.Xb.hasOwnProperty(t)?this.Xb[t]:t}am(t){if(!this.Jb)return t;let e=new Map;for(let[n,r]of Object.entries(t))e.set(this.Jb.hasOwnProperty(n)?this.Jb[n]:n,r);return e}lm(t){if(!this.Jb||"Map"!=t.constructor.name)return t;if(!this.um){this.um=new Map;for(let[t,e]of Object.entries(this.Jb))this.um.set(e,t)}let e={};return t.forEach((t,n)=>e[Wu(this.um.has(n)?this.um.get(n):n)]=t),e}hm(t,e){let n=this.decode(t);return this.Jb&&"Array"===n.constructor.name?n.map(t=>this.lm(t)):n}decode(t,e){if(wu)return oh(()=>(sh(),this?this.decode(t,e):Gu.prototype.decode.call(Uu,t,e)));pu=e>-1?e:t.length,yu=0,Nu=0,mu=null,vu=null,wu=t;try{Tu=t.fm||(t.fm=new DataView(t.buffer,t.byteOffset,t.byteLength))}catch(e){if(wu=null,t instanceof Uint8Array)throw e;throw new Error("Source must be a Uint8Array or Buffer but was a "+(t&&"object"==typeof t?t.constructor.name:typeof t))}if(this instanceof Gu){if(Ru=this,ku=this.dm&&(this.wm?new Array(this.pm||16).concat(this.dm):this.dm),this.nm)return bu=this.nm,Vu();(!bu||bu.length>0)&&(bu=[])}else Ru=Uu,(!bu||bu.length>0)&&(bu=[]),ku=null;return Vu()}ym(t,e){let n,r=0;try{let i=t.length;Su=!0;let o=this?this.decode(t,i):hh.decode(t,i);if(!e){for(n=[o];yu<i;)r=yu,n.push(Vu());return n}if(!1===e(o))return;for(;yu<i;)if(r=yu,!1===e(Vu()))return}catch(t){throw t.gm=r,t.values=n,t}finally{Su=!1,sh()}}}function Vu(){try{let t=Ku();if(vu){if(yu>=vu.bm){let t=new Error("Unexpected bundle position");throw t.vm=!0,t}yu=vu.bm,vu=null}if(yu==pu)bu=null,wu=null,Iu&&(Iu=null);else{if(yu>pu){let t=new Error("Unexpected end of CBOR data");throw t.vm=!0,t}if(!Su)throw new Error("Data read, but end of buffer not reached")}return t}catch(t){throw sh(),(t instanceof RangeError||t.message.startsWith("Unexpected end of buffer"))&&(t.vm=!0),t}}function Ku(){let t=wu[yu++],e=t>>5;if(t&=31,t>23)switch(t){case 24:t=wu[yu++];break;case 25:if(7==e)return function(){let t=wu[yu++],e=wu[yu++],n=(127&t)>>2;if(31===n)return e||3&t?NaN:128&t?-1/0:1/0;if(0===n){let n=((3&t)<<8|e)/(1<<24);return 128&t?-n:n}return Lu[3]=128&t|56+(n>>1),Lu[2]=(7&t)<<5|e>>3,Lu[1]=e<<5,Lu[0]=0,Mu[0]}();t=Tu.getUint16(yu),yu+=2;break;case 26:if(7==e){let t=Tu.getFloat32(yu);if(Ru.Im>2){let e=ah[(127&wu[yu])<<1|wu[yu+1]>>7];return yu+=4,(e*t+(t>0?.5:-.5)|0)/e}return yu+=4,t}t=Tu.getUint32(yu),yu+=4;break;case 27:if(7==e){let t=Tu.getFloat64(yu);return yu+=8,t}if(e>1){if(Tu.getUint32(yu)>0)throw new Error("JavaScript does not support arrays, maps, or strings with length over 4294967295");t=Tu.getUint32(yu+4)}else Ru.km?(t=4294967296*Tu.getUint32(yu),t+=Tu.getUint32(yu+4)):t=Tu.getBigUint64(yu);yu+=8;break;case 31:switch(e){case 2:case 3:throw new Error("Indefinite length not supported for byte or text strings");case 4:let t,n=[],r=0;for(;(t=Ku())!=gu;){if(r>=Bu)throw new Error("Array length exceeds 112810000");n[r++]=t}return 4==e?n:3==e?n.join(""):Buffer.concat(n);case 5:let i;if(Ru.zb){let t={},e=0;if(Ru.Xb)for(;(i=Ku())!=gu;){if(e++>=Eu)throw new Error("Property count exceeds 16810000");t[Wu(Ru.om(i))]=Ku()}else for(;(i=Ku())!=gu;){if(e++>=Eu)throw new Error("Property count exceeds 16810000");t[Wu(i)]=Ku()}return t}{Au&&(Ru.zb=!0,Au=!1);let t=new Map;if(Ru.Xb){let e=0;for(;(i=Ku())!=gu;){if(e++>=Eu)throw new Error("Map size exceeds 16810000");t.set(Ru.om(i),Ku())}}else{let e=0;for(;(i=Ku())!=gu;){if(e++>=Eu)throw new Error("Map size exceeds 16810000");t.set(i,Ku())}}return t}case 7:return gu;default:throw new Error("Invalid major type for indefinite length "+e)}default:throw new Error("Unknown token "+t)}switch(e){case 0:return t;case 1:return~t;case 2:return n=t,Ru.Tm?Uint8Array.prototype.slice.call(wu,yu,yu+=n):wu.subarray(yu,yu+=n);case 3:if(Nu>=yu)return mu.slice(yu-Pu,(yu+=t)-Pu);if(0==Nu&&pu<140&&t<32){let e=t<16?ju(t):function(t){let e=yu,n=new Array(t);for(let r=0;r<t;r++){const t=wu[yu++];if((128&t)>0)return void(yu=e);n[r]=t}return Hu.apply(String,n)}(t);if(null!=e)return e}return Du(t);case 4:if(t>=Bu)throw new Error("Array length exceeds 112810000");let e=new Array(t);for(let n=0;n<t;n++)e[n]=Ku();return e;case 5:if(t>=Eu)throw new Error("Map size exceeds 112810000");if(Ru.zb){let e={};if(Ru.Xb)for(let n=0;n<t;n++)e[Wu(Ru.om(Ku()))]=Ku();else for(let n=0;n<t;n++)e[Wu(Ku())]=Ku();return e}{Au&&(Ru.zb=!0,Au=!1);let e=new Map;if(Ru.Xb)for(let n=0;n<t;n++)e.set(Ru.om(Ku()),Ku());else for(let n=0;n<t;n++)e.set(Ku(),Ku());return e}case 6:if(t>=57337){let e=bu[8191&t];if(e)return e.read||(e.read=Fu(e)),e.read();if(t<65536){if(57343==t){let t=rh(),e=Ku(),n=Ku();qu(e,n);let r={};if(Ru.Xb)for(let e=2;e<t;e++){r[Wu(Ru.om(n[e-2]))]=Ku()}else for(let e=2;e<t;e++){r[Wu(n[e-2])]=Ku()}return r}if(57342==t){let t=rh(),e=Ku();for(let n=2;n<t;n++)qu(e++,Ku());return Ku()}if(57337==t)return function(){let t=rh(),e=yu+Ku();for(let e=2;e<t;e++){let t=rh();yu+=t}let n=yu;return yu=e,vu=[_u(rh()),_u(rh())],vu.Am=0,vu.Bm=0,vu.bm=yu,yu=n,Ku()}();if(Ru.tm&&(ih(),e=bu[8191&t],e))return e.read||(e.read=Fu(e)),e.read()}}let r=xu[t];if(r)return r.Em?r(Ku):r(Ku());{let e=Ku();for(let n=0;n<$u.length;n++){let r=$u[n](t,e);if(void 0!==r)return r}return new Zu(e,t)}case 7:switch(t){case 20:return!1;case 21:return!0;case 22:return null;case 23:return;default:let e=(ku||Ju())[t];if(void 0!==e)return e;throw new Error("Unknown token "+t)}default:if(isNaN(t)){let t=new Error("Unexpected end of CBOR data");throw t.vm=!0,t}throw new Error("Unknown CBOR token "+t)}var n}const Ou=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function Fu(t){if(!t)throw new Error("Structure is required in record definition");return t.Rm=0,function(){let t=wu[yu++];if(t&=31,t>23)switch(t){case 24:t=wu[yu++];break;case 25:t=Tu.getUint16(yu),yu+=2;break;case 26:t=Tu.getUint32(yu),yu+=4;break;default:throw new Error("Expected array header, but got "+wu[yu-1])}let e=this.Pm;for(;e;){if(e.Nm===t)return e(Ku);e=e.next}if(this.Rm++>=Cu){let n=this.length==t?this:this.slice(0,t);return e=Ru.Xb?new Function("r","return {"+n.map(t=>Ru.om(t)).map(t=>Ou.test(t)?Wu(t)+":r()":"["+JSON.stringify(t)+"]:r()").join(",")+"}"):new Function("r","return {"+n.map(t=>Ou.test(t)?Wu(t)+":r()":"["+JSON.stringify(t)+"]:r()").join(",")+"}"),this.Pm&&(e.next=this.Pm),e.Nm=t,this.Pm=e,e(Ku)}let n={};if(Ru.Xb)for(let e=0;e<t;e++)n[Wu(Ru.om(this[e]))]=Ku();else for(let e=0;e<t;e++)n[Wu(this[e])]=Ku();return n}}function Wu(t){if("string"==typeof t)return"__proto__"===t?"__proto_":t;if("number"==typeof t||"boolean"==typeof t||"bigint"==typeof t)return t.toString();if(null==t)return t+"";throw new Error("Invalid property name type "+typeof t)}let Du=_u;function _u(t){let e;if(t<16&&(e=ju(t)))return e;if(t>64&&du)return du.decode(wu.subarray(yu,yu+=t));const n=yu+t,r=[];for(e="";yu<n;){const t=wu[yu++];if(128&t)if(192==(224&t)){const e=63&wu[yu++];r.push((31&t)<<6|e)}else if(224==(240&t)){const e=63&wu[yu++],n=63&wu[yu++];r.push((31&t)<<12|e<<6|n)}else if(240==(248&t)){let e=(7&t)<<18|(63&wu[yu++])<<12|(63&wu[yu++])<<6|63&wu[yu++];e>65535&&(e-=65536,r.push(e>>>10&1023|55296),e=56320|1023&e),r.push(e)}else r.push(t);else r.push(t);r.length>=4096&&(e+=Hu.apply(String,r),r.length=0)}return r.length>0&&(e+=Hu.apply(String,r)),e}let Hu=String.fromCharCode;function ju(t){if(t<4){if(t<2){if(0===t)return"";{let t=wu[yu++];return(128&t)>1?void(yu-=1):Hu(t)}}{let e=wu[yu++],n=wu[yu++];if((128&e)>0||(128&n)>0)return void(yu-=2);if(t<3)return Hu(e,n);let r=wu[yu++];return(128&r)>0?void(yu-=3):Hu(e,n,r)}}{let e=wu[yu++],n=wu[yu++],r=wu[yu++],i=wu[yu++];if((128&e)>0||(128&n)>0||(128&r)>0||(128&i)>0)return void(yu-=4);if(t<6){if(4===t)return Hu(e,n,r,i);{let t=wu[yu++];return(128&t)>0?void(yu-=5):Hu(e,n,r,i,t)}}if(t<8){let o=wu[yu++],s=wu[yu++];if((128&o)>0||(128&s)>0)return void(yu-=6);if(t<7)return Hu(e,n,r,i,o,s);let a=wu[yu++];return(128&a)>0?void(yu-=7):Hu(e,n,r,i,o,s,a)}{let o=wu[yu++],s=wu[yu++],a=wu[yu++],c=wu[yu++];if((128&o)>0||(128&s)>0||(128&a)>0||(128&c)>0)return void(yu-=8);if(t<10){if(8===t)return Hu(e,n,r,i,o,s,a,c);{let t=wu[yu++];return(128&t)>0?void(yu-=9):Hu(e,n,r,i,o,s,a,c,t)}}if(t<12){let l=wu[yu++],u=wu[yu++];if((128&l)>0||(128&u)>0)return void(yu-=10);if(t<11)return Hu(e,n,r,i,o,s,a,c,l,u);let h=wu[yu++];return(128&h)>0?void(yu-=11):Hu(e,n,r,i,o,s,a,c,l,u,h)}{let l=wu[yu++],u=wu[yu++],h=wu[yu++],f=wu[yu++];if((128&l)>0||(128&u)>0||(128&h)>0||(128&f)>0)return void(yu-=12);if(t<14){if(12===t)return Hu(e,n,r,i,o,s,a,c,l,u,h,f);{let t=wu[yu++];return(128&t)>0?void(yu-=13):Hu(e,n,r,i,o,s,a,c,l,u,h,f,t)}}{let d=wu[yu++],w=wu[yu++];if((128&d)>0||(128&w)>0)return void(yu-=14);if(t<15)return Hu(e,n,r,i,o,s,a,c,l,u,h,f,d,w);let p=wu[yu++];return(128&p)>0?void(yu-=15):Hu(e,n,r,i,o,s,a,c,l,u,h,f,d,w,p)}}}}}let Mu=new Float32Array(1),Lu=new Uint8Array(Mu.buffer,0,4);new Array(4096);class Zu{constructor(t,e){this.value=t,this.tag=e}}xu[0]=t=>new Date(t),xu[1]=t=>new Date(Math.round(1e3*t)),xu[2]=t=>{let e=BigInt(0);for(let n=0,r=t.byteLength;n<r;n++)e=BigInt(t[n])+(e<<BigInt(8));return e},xu[3]=t=>BigInt(-1)-xu[2](t),xu[4]=t=>+(t[1]+"e"+t[0]),xu[5]=t=>t[1]*Math.exp(t[0]*Math.log(2));const qu=(t,e)=>{let n=bu[t-=57344];n&&n.xm&&((bu.$m||(bu.$m=[]))[t]=n),bu[t]=e,e.read=Fu(e)};xu[105]=t=>{let e=t.length,n=t[1];qu(t[0],n);let r={};for(let i=2;i<e;i++){r[Wu(n[i-2])]=t[i]}return r},xu[14]=t=>vu?vu[0].slice(vu.Am,vu.Am+=t):new Zu(t,14),xu[15]=t=>vu?vu[1].slice(vu.Bm,vu.Bm+=t):new Zu(t,15);let Yu={Error:Error,RegExp:RegExp};xu[27]=t=>(Yu[t[0]]||Error)(t[1],t[2]);const zu=t=>{if(132!=wu[yu++]){let t=new Error("Packed values structure must be followed by a 4 element array");throw wu.length<yu&&(t.vm=!0),t}let e=t();if(!e||!e.length){let t=new Error("Packed values structure must be followed by a 4 element array");throw t.vm=!0,t}return ku=ku?e.concat(ku.slice(e.length)):e,ku.Um=t(),ku.suffixes=t(),t()};function Xu(t,e){return"string"==typeof t?t+e:t instanceof Array?t.concat(e):Object.assign({},t,e)}function Ju(){if(!ku){if(!Ru.tm)throw new Error("No packed values available");ih()}return ku}zu.Em=!0,xu[51]=zu,xu[6]=t=>{if(!ku){if(!Ru.tm)return new Zu(t,6);ih()}if("number"==typeof t)return ku[16+(t>=0?2*t:-2*t-1)];let e=new Error("No support for non-integer packed references yet");throw void 0===t&&(e.vm=!0),e},xu[28]=t=>{Iu||(Iu=new Map,Iu.id=0);let e,n=Iu.id++,r=yu;e=wu[yu]>>5==4?[]:{};let i={target:e};Iu.set(n,i);let o=t();return i.Sm?(Object.getPrototypeOf(e)!==Object.getPrototypeOf(o)&&(yu=r,e=o,Iu.set(n,{target:e}),o=t()),Object.assign(e,o)):(i.target=o,o)},xu[28].Em=!0,xu[29]=t=>{let e=Iu.get(t);return e.Sm=!0,e.target},xu[258]=t=>new Set(t),(xu[259]=t=>(Ru.zb&&(Ru.zb=!1,Au=!0),t())).Em=!0;$u.push((t,e)=>t>=225&&t<=255?Xu(Ju().Um[t-224],e):t>=28704&&t<=32767?Xu(Ju().Um[t-28672],e):t>=1879052288&&t<=2147483647?Xu(Ju().Um[t-1879048192],e):t>=216&&t<=223?Xu(e,Ju().suffixes[t-216]):t>=27647&&t<=28671?Xu(e,Ju().suffixes[t-27639]):t>=1811940352&&t<=1879048191?Xu(e,Ju().suffixes[t-1811939328]):1399353956==t?{Cm:ku,nm:bu.slice(0),version:e}:55799==t?e:void 0);const Qu=1==new Uint8Array(new Uint16Array([1]).buffer)[0],th=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,"undefined"==typeof BigUint64Array?{name:"BigUint64Array"}:BigUint64Array,Int8Array,Int16Array,Int32Array,"undefined"==typeof BigInt64Array?{name:"BigInt64Array"}:BigInt64Array,Float32Array,Float64Array],eh=[64,68,69,70,71,72,77,78,79,85,86];for(let t=0;t<th.length;t++)nh(th[t],eh[t]);function nh(t,e){let n,r="get"+t.name.slice(0,-5);"function"==typeof t?n=t.BYTES_PER_ELEMENT:t=null;for(let i=0;i<2;i++){if(!i&&1==n)continue;let o=2==n?1:4==n?2:8==n?3:0;xu[i?e:e-4]=1==n||i==Qu?r=>{if(!t)throw new Error("Could not find typed array for code "+e);return Ru.Tm||1!==n&&(2!==n||1&r.byteOffset)&&(4!==n||3&r.byteOffset)&&(8!==n||7&r.byteOffset)?new t(Uint8Array.prototype.slice.call(r,0).buffer):new t(r.buffer,r.byteOffset,r.byteLength>>o)}:n=>{if(!t)throw new Error("Could not find typed array for code "+e);let s=new DataView(n.buffer,n.byteOffset,n.byteLength),a=n.length>>o,c=new t(a),l=s[r];for(let t=0;t<a;t++)c[t]=l.call(s,t<<o,i);return c}}}function rh(){let t=31&wu[yu++];if(t>23)switch(t){case 24:t=wu[yu++];break;case 25:t=Tu.getUint16(yu),yu+=2;break;case 26:t=Tu.getUint32(yu),yu+=4}return t}function ih(){if(Ru.tm){let t=oh(()=>(wu=null,Ru.tm()))||{},e=t.nm||[];Ru.Gm=t.version,ku=Ru.dm=t.Cm,!0===bu?Ru.nm=bu=e:bu.splice.apply(bu,[0,e.length].concat(e))}}function oh(t){let e=pu,n=yu,r=Pu,i=Nu,o=mu,s=Iu,a=vu,c=new Uint8Array(wu.slice(0,pu)),l=bu,u=Ru,h=Su,f=t();return pu=e,yu=n,Pu=r,Nu=i,mu=o,Iu=s,vu=a,wu=c,Su=h,bu=l,Ru=u,Tu=new DataView(wu.buffer,wu.byteOffset,wu.byteLength),f}function sh(){wu=null,Iu=null,bu=null}const ah=new Array(147);for(let t=0;t<256;t++)ah[t]=+("1e"+Math.floor(45.15-.30103*t));let ch,lh,uh,hh=new Gu({Yb:!1});hh.decode,hh.ym;try{ch=new TextEncoder}catch(t){}const fh="object"==typeof globalThis&&globalThis.Buffer,dh=void 0!==fh,wh=dh?fh.Vm:Uint8Array,ph=dh?fh:Uint8Array,yh=dh?4294967296:2144337920;let gh,bh,mh,vh,Ih=0,kh=null;const Th=/[\u0080-\uFFFF]/,Ah=Symbol("record-id");function Bh(t,e){t<24?bh[Ih++]=e|t:t<256?(bh[Ih++]=24|e,bh[Ih++]=t):t<65536?(bh[Ih++]=25|e,bh[Ih++]=t>>8,bh[Ih++]=255&t):(bh[Ih++]=26|e,mh.setUint32(Ih,t),Ih+=4)}class Eh{constructor(t,e,n){this.nm=t,this.Cm=e,this.version=n}}function Rh(t){t<24?bh[Ih++]=128|t:t<256?(bh[Ih++]=152,bh[Ih++]=t):t<65536?(bh[Ih++]=153,bh[Ih++]=t>>8,bh[Ih++]=255&t):(bh[Ih++]=154,mh.setUint32(Ih,t),Ih+=4)}const Ph="undefined"==typeof Blob?function(){}:Blob;function Nh(t){if(t instanceof Ph)return!0;let e=t[Symbol.toStringTag];return"Blob"===e||"File"===e}function xh(t,e){switch(typeof t){case"string":if(t.length>3){if(e.Km[t]>-1||e.values.length>=e.Om)return;let n=e.get(t);if(n)2==++n.count&&e.values.push(t);else if(e.set(t,{count:1}),e.Fm){let n=e.Fm.get(t);n?n.count++:e.Fm.set(t,{count:1})}}break;case"object":if(t)if(t instanceof Array)for(let n=0,r=t.length;n<r;n++)xh(t[n],e);else{let r=!e.Wm.Yb;for(var n in t)t.hasOwnProperty(n)&&(r&&xh(n,e),xh(t[n],e))}break;case"function":console.log(t)}}const $h=1==new Uint8Array(new Uint16Array([1]).buffer)[0];function Uh(t,e){return!$h&&e>1&&(t-=4),{tag:t,encode:function(t,e){let n=t.byteLength,r=t.byteOffset||0,i=t.buffer||t;e(dh?fh.from(i,r,n):new Uint8Array(i,r,n))}}}function Sh(t,e){let n=t.byteLength;n<24?bh[Ih++]=64+n:n<256?(bh[Ih++]=88,bh[Ih++]=n):n<65536?(bh[Ih++]=89,bh[Ih++]=n>>8,bh[Ih++]=255&n):(bh[Ih++]=90,mh.setUint32(Ih,n),Ih+=4),Ih+n>=bh.length&&e(Ih+n),bh.set(t.buffer?t:new Uint8Array(t),Ih),Ih+=n}function Ch(t,e){mh.setUint32(kh.position+t,Ih-kh.position-t+1);let n=kh;kh=null,e(n[0]),e(n[1])}uh=[Date,Set,Error,RegExp,Zu,ArrayBuffer,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,"undefined"==typeof BigUint64Array?function(){}:BigUint64Array,Int8Array,Int16Array,Int32Array,"undefined"==typeof BigInt64Array?function(){}:BigInt64Array,Float32Array,Float64Array,Eh],lh=[{tag:1,encode(t,e){let n=t.getTime()/1e3;(this.Dm||0===t.getMilliseconds())&&n>=0&&n<4294967296?(bh[Ih++]=26,mh.setUint32(Ih,n),Ih+=4):(bh[Ih++]=251,mh.setFloat64(Ih,n),Ih+=8)}},{tag:258,encode(t,e){e(Array.from(t))}},{tag:27,encode(t,e){e([t.name,t.message])}},{tag:27,encode(t,e){e(["RegExp",t.source,t.flags])}},{_m:t=>t.tag,encode(t,e){e(t.value)}},{encode(t,e,n){Sh(t,n)}},{_m(t){if(t.constructor===Uint8Array&&(this.Hm||dh&&!1!==this.Hm))return 64},encode(t,e,n){Sh(t,n)}},Uh(68,1),Uh(69,2),Uh(70,4),Uh(71,8),Uh(72,1),Uh(77,2),Uh(78,4),Uh(79,8),Uh(85,4),Uh(86,8),{encode(t,e){let n=t.Cm||[],r=t.nm||[];if(n.values.length>0){bh[Ih++]=216,bh[Ih++]=51,Rh(4);let t=n.values;e(t),Rh(0),Rh(0),packedObjectMap=Object.create(sharedPackedObjectMap||null);for(let e=0,n=t.length;e<n;e++)packedObjectMap[t[e]]=e}if(r){mh.setUint32(Ih,3655335424),Ih+=3;let n=r.slice(0);n.unshift(57344),n.push(new Zu(t.version,1399353956)),e(n)}else e(new Zu(t.version,1399353956))}}];let Gh=new class extends Gu{constructor(t){let e,n,r,i,o;super(t),this.offset=0,t=t||{};let s=ph.prototype.jm?function(t,e,n){return bh.jm(t,e,n)}:!(!ch||!ch.encodeInto)&&function(t,e){return ch.encodeInto(t,bh.subarray(e)).Mm},a=this,c=t.nm||t.Lm,l=t.Zm;if(null==l&&(l=c?128:0),l>8190)throw new Error("Maximum maxSharedStructure is 8190");let u=t.qm;u&&(l=0),this.nm||(this.nm=[]),this.Lm&&(this.Ym=this.Lm);let h,f,d,w=t.dm;if(w){d=Object.create(null);for(let t=0,e=w.length;t<e;t++)d[w[t]]=t}let p=[],y=0,g=0;this.zm=function(t,e){if(this.Jb&&!this.Xm&&"Array"===t.constructor.name)t=t.map(t=>this.am(t));return this.encode(t,e)},this.encode=function(s,c){if(bh||(bh=new wh(8192),mh=new DataView(bh.buffer,0,8192),Ih=0),vh=bh.length-10,vh-Ih<2048?(bh=new wh(bh.length),mh=new DataView(bh.buffer,0,bh.length),vh=bh.length-10,Ih=0):c===Kh&&(Ih=Ih+7&2147483640),e=Ih,a.Jm&&(mh.setUint32(Ih,3654940416),Ih+=3),o=a.structuredClone?new Map:null,a.Qm&&"string"!=typeof s?(kh=[],kh.size=1/0):kh=null,n=a.nm,n){if(n.rm){let t=a.tm()||{};a.nm=n=t.nm||[],a.Gm=t.version;let e=a.dm=t.Cm;if(e){d={};for(let t=0,n=e.length;t<n;t++)d[e[t]]=t}}let t=n.length;if(t>l&&!u&&(t=l),!n.nb){n.nb=Object.create(null);for(let e=0;e<t;e++){let t=n[e];if(!t)continue;let r,i=n.nb;for(let n=0,o=t.length;n<o;n++){void 0===i[Ah]&&(i[Ah]=e);let o=t[n];r=i[o],r||(r=i[o]=Object.create(null)),i=r}i[Ah]=1048576|e}}u||(n.tv=t)}if(r&&(r=!1),i=n||[],f=d,t.wm){let e=new Map;if(e.values=[],e.Wm=a,e.Om=t.pm||(d?16:1/0),e.Km=d||!1,e.Fm=h,xh(s,e),e.values.length>0){bh[Ih++]=216,bh[Ih++]=51,Rh(4);let t=e.values;b(t),Rh(0),Rh(0),f=Object.create(d||null);for(let e=0,n=t.length;e<n;e++)f[t[e]]=e}}gh=c&Fh;try{if(gh)return;if(b(s),kh&&Ch(e,b),a.offset=Ih,o&&o.ev){Ih+=2*o.ev.length,Ih>vh&&v(Ih),a.offset=Ih;let t=function(t,e){let n,r=2*e.length,i=t.length-r;e.sort((t,e)=>t.offset>e.offset?1:-1);for(let n=0;n<e.length;n++){let r=e[n];r.id=n;for(let e of r.nv)t[e++]=n>>8,t[e]=255&n}for(;n=e.pop();){let e=n.offset;t.copyWithin(e+r,e,i),r-=2;let o=e+r;t[o++]=216,t[o++]=28,i=e}return t}(bh.subarray(e,Ih),o.ev);return o=null,t}return c&Kh?(bh.start=e,bh.end=Ih,bh):bh.subarray(e,Ih)}finally{if(n)if(g<10&&g++,n.length>l&&(n.length=l),y>1e4)n.nb=null,g=0,y=0,p.length>0&&(p=[]);else if(p.length>0&&!u){for(let t=0,e=p.length;t<e;t++)p[t][Ah]=void 0;p=[]}if(r&&a.Ym){a.nm.length>l&&(a.nm=a.nm.slice(0,l));let t=bh.subarray(e,Ih);return!1===a.rv()?a.encode(s):t}c&Oh&&(Ih=e)}},this.iv=()=>(h=new Map,d||(d=Object.create(null)),t=>{let e=t&&t.threshold||4,n=this.wm?t.pm||16:0;w||(w=this.dm=[]);for(let[t,i]of h)i.count>e&&(d[t]=n++,w.push(t),r=!0);for(;this.Ym&&!1===this.rv(););h=null});const b=n=>{Ih>vh&&(bh=v(Ih));var r,i=typeof n;if("string"===i){if(f){let e=f[n];if(e>=0)return void(e<16?bh[Ih++]=e+224:(bh[Ih++]=198,b(1&e?15-e>>1:e-16>>1)));if(h&&!t.wm){let t=h.get(n);t?t.count++:h.set(n,{count:1})}}let i,o=n.length;if(kh&&o>=4&&o<1024){if((kh.size+=o)>61440){let t,n=(kh[0]?3*kh[0].length+kh[1].length:0)+10;Ih+n>vh&&(bh=v(Ih+n)),bh[Ih++]=217,bh[Ih++]=223,bh[Ih++]=249,bh[Ih++]=kh.position?132:130,bh[Ih++]=26,t=Ih-e,Ih+=4,kh.position&&Ch(e,b),kh=["",""],kh.size=0,kh.position=t}let t=Th.test(n);return kh[t?0:1]+=n,bh[Ih++]=t?206:207,void b(o)}i=o<32?1:o<256?2:o<65536?3:5;let a=3*o;if(Ih+a>vh&&(bh=v(Ih+a)),o<64||!s){let t,e,s,a=Ih+i;for(t=0;t<o;t++)e=n.charCodeAt(t),e<128?bh[a++]=e:e<2048?(bh[a++]=e>>6|192,bh[a++]=63&e|128):55296==(64512&e)&&56320==(64512&(s=n.charCodeAt(t+1)))?(e=65536+((1023&e)<<10)+(1023&s),t++,bh[a++]=e>>18|240,bh[a++]=e>>12&63|128,bh[a++]=e>>6&63|128,bh[a++]=63&e|128):(bh[a++]=e>>12|224,bh[a++]=e>>6&63|128,bh[a++]=63&e|128);r=a-Ih-i}else r=s(n,Ih+i,a);r<24?bh[Ih++]=96|r:r<256?(i<2&&bh.copyWithin(Ih+2,Ih+1,Ih+1+r),bh[Ih++]=120,bh[Ih++]=r):r<65536?(i<3&&bh.copyWithin(Ih+3,Ih+2,Ih+2+r),bh[Ih++]=121,bh[Ih++]=r>>8,bh[Ih++]=255&r):(i<5&&bh.copyWithin(Ih+5,Ih+3,Ih+3+r),bh[Ih++]=122,mh.setUint32(Ih,r),Ih+=4),Ih+=r}else if("number"===i)if(this.ov||n>>>0!==n)if(this.ov||(n|0)!==n){let t;if((t=this.Im)>0&&n<4294967296&&n>=-2147483648){let e;if(bh[Ih++]=250,mh.setFloat32(Ih,n),t<4||((e=n*ah[(127&bh[Ih])<<1|bh[Ih+1]>>7])|0)===e)return void(Ih+=4);Ih--}bh[Ih++]=251,mh.setFloat64(Ih,n),Ih+=8}else n>=-24?bh[Ih++]=31-n:n>=-256?(bh[Ih++]=56,bh[Ih++]=~n):n>=-65536?(bh[Ih++]=57,mh.setUint16(Ih,~n),Ih+=2):(bh[Ih++]=58,mh.setUint32(Ih,~n),Ih+=4);else n<24?bh[Ih++]=n:n<256?(bh[Ih++]=24,bh[Ih++]=n):n<65536?(bh[Ih++]=25,bh[Ih++]=n>>8,bh[Ih++]=255&n):(bh[Ih++]=26,mh.setUint32(Ih,n),Ih+=4);else if("object"===i)if(n){if(o){let t=o.get(n);if(t){if(bh[Ih++]=216,bh[Ih++]=29,bh[Ih++]=25,!t.nv){let e=o.ev||(o.ev=[]);t.nv=[],e.push(t)}return t.nv.push(Ih-e),void(Ih+=2)}o.set(n,{offset:Ih-e})}let t=n.constructor;if(t===Object)m(n);else if(t===Array){(r=n.length)<24?bh[Ih++]=128|r:Rh(r);for(let t=0;t<r;t++)b(n[t])}else if(t===Map)if((this.zb?!1!==this.sv:this.sv)&&(bh[Ih++]=217,bh[Ih++]=1,bh[Ih++]=3),(r=n.size)<24?bh[Ih++]=160|r:r<256?(bh[Ih++]=184,bh[Ih++]=r):r<65536?(bh[Ih++]=185,bh[Ih++]=r>>8,bh[Ih++]=255&r):(bh[Ih++]=186,mh.setUint32(Ih,r),Ih+=4),a.Xb)for(let[t,e]of n)b(a.sm(t)),b(e);else for(let[t,e]of n)b(t),b(e);else{for(let t=0,e=lh.length;t<e;t++){if(n instanceof uh[t]){let e=lh[t],r=e.tag;return null==r&&(r=e._m&&e._m.call(this,n)),r<24?bh[Ih++]=192|r:r<256?(bh[Ih++]=216,bh[Ih++]=r):r<65536?(bh[Ih++]=217,bh[Ih++]=r>>8,bh[Ih++]=255&r):r>-1&&(bh[Ih++]=218,mh.setUint32(Ih,r),Ih+=4),void e.encode.call(this,n,b,v)}}if(n[Symbol.iterator]){if(gh){let t=new Error("Iterable should be serialized as iterator");throw t.av=!0,t}bh[Ih++]=159;for(let t of n)b(t);return void(bh[Ih++]=255)}if(n[Symbol.asyncIterator]||Nh(n)){let t=new Error("Iterable/blob should be serialized as iterator");throw t.av=!0,t}if(this.cv&&n.toJSON){const t=n.toJSON();if(t!==n)return b(t)}m(n)}}else bh[Ih++]=246;else if("boolean"===i)bh[Ih++]=n?245:244;else if("bigint"===i){if(n<BigInt(1)<<BigInt(64)&&n>=0)bh[Ih++]=27,mh.setBigUint64(Ih,n);else if(n>-(BigInt(1)<<BigInt(64))&&n<0)bh[Ih++]=59,mh.setBigUint64(Ih,-n-BigInt(1));else{if(!this.lv){n>=BigInt(0)?bh[Ih++]=194:(bh[Ih++]=195,n=BigInt(-1)-n);let t=[];for(;n;)t.push(Number(n&BigInt(255))),n>>=BigInt(8);return void Sh(new Uint8Array(t.reverse()),v)}bh[Ih++]=251,mh.setFloat64(Ih,Number(n))}Ih+=8}else{if("undefined"!==i)throw new Error("Unknown type: "+i);bh[Ih++]=247}},m=!1===this.Yb?this.uv?t=>{let e=Object.keys(t),n=Object.values(t),r=e.length;if(r<24?bh[Ih++]=160|r:r<256?(bh[Ih++]=184,bh[Ih++]=r):r<65536?(bh[Ih++]=185,bh[Ih++]=r>>8,bh[Ih++]=255&r):(bh[Ih++]=186,mh.setUint32(Ih,r),Ih+=4),a.Xb)for(let t=0;t<r;t++)b(a.sm(e[t])),b(n[t]);else for(let t=0;t<r;t++)b(e[t]),b(n[t])}:t=>{bh[Ih++]=185;let n=Ih-e;Ih+=2;let r=0;if(a.Xb)for(let e in t)("function"!=typeof t.hasOwnProperty||t.hasOwnProperty(e))&&(b(a.sm(e)),b(t[e]),r++);else for(let e in t)("function"!=typeof t.hasOwnProperty||t.hasOwnProperty(e))&&(b(e),b(t[e]),r++);bh[n+++e]=r>>8,bh[n+e]=255&r}:(t,e)=>{let n,o,s,a=i.nb||(i.nb=Object.create(null)),c=0,u=0;if(this.Xb){s=Object.keys(t).map(t=>this.sm(t)),u=s.length;for(let t=0;t<u;t++){let e=s[t];n=a[e],n||(n=a[e]=Object.create(null),c++),a=n}}else for(let e in t)("function"!=typeof t.hasOwnProperty||t.hasOwnProperty(e))&&(n=a[e],n||(1048576&a[Ah]&&(o=65535&a[Ah]),n=a[e]=Object.create(null),c++),a=n,u++);let h=a[Ah];if(void 0!==h)h&=65535,bh[Ih++]=217,bh[Ih++]=h>>8|224,bh[Ih++]=255&h;else{if(s||(s=a.hv||(a.hv=Object.keys(t))),void 0===o?(h=i.tv++,h||(h=0,i.tv=1),h>=256&&(i.tv=(h=l)+1)):h=o,i[h]=s,!(h<l)){if(a[Ah]=h,mh.setUint32(Ih,3655335680),Ih+=3,c&&(y+=g*c),p.length>=256-l&&(p.shift()[Ah]=void 0),p.push(a),Rh(u+2),b(57344+h),b(s),e)return;for(let e in t)("function"!=typeof t.hasOwnProperty||t.hasOwnProperty(e))&&b(t[e]);return}bh[Ih++]=217,bh[Ih++]=h>>8|224,bh[Ih++]=255&h,a=i.nb;for(let t=0;t<u;t++)(void 0===a[Ah]||1048576&a[Ah])&&(a[Ah]=h),a=a[s[t]];a[Ah]=1048576|h,r=!0}if(u<24?bh[Ih++]=128|u:Rh(u),!e)for(let e in t)("function"!=typeof t.hasOwnProperty||t.hasOwnProperty(e))&&b(t[e])},v=t=>{let n;if(t>16777216){if(t-e>yh)throw new Error("Encoded buffer would be larger than maximum buffer size");n=Math.min(yh,4096*Math.round(Math.max((t-e)*(t>67108864?1.25:2),4194304)/4096))}else n=1+(Math.max(t-e<<2,bh.length-1)>>12)<<12;let r=new wh(n);return mh=new DataView(r.buffer,0,n),bh.fv?bh.fv(r,0,e,t):r.set(bh.slice(e,t)),Ih-=e,e=0,vh=r.length-10,bh=r};let I=100,k=1e3;function*T(t,n,r){let i=t.constructor;if(i===Object){let e=!1!==a.Yb;e?m(t,!0):Bh(Object.keys(t).length,160);for(let r in t){let i=t[r];e||b(r),i&&"object"==typeof i?n[r]?yield*T(i,n[r]):yield*A(i,n,r):b(i)}}else if(i===Array){let r=t.length;Rh(r);for(let i=0;i<r;i++){let r=t[i];r&&("object"==typeof r||Ih-e>I)?n.element?yield*T(r,n.element):yield*A(r,n,"element"):b(r)}}else if(t[Symbol.iterator]&&!t.buffer){bh[Ih++]=159;for(let r of t)r&&("object"==typeof r||Ih-e>I)?n.element?yield*T(r,n.element):yield*A(r,n,"element"):b(r);bh[Ih++]=255}else Nh(t)?(Bh(t.size,64),yield bh.subarray(e,Ih),yield t,B()):t[Symbol.asyncIterator]?(bh[Ih++]=159,yield bh.subarray(e,Ih),yield t,B(),bh[Ih++]=255):b(t);r&&Ih>e?yield bh.subarray(e,Ih):Ih-e>I&&(yield bh.subarray(e,Ih),B())}function*A(t,n,r){let i=Ih-e;try{b(t),Ih-e>I&&(yield bh.subarray(e,Ih),B())}catch(o){if(!o.av)throw o;n[r]={},Ih=e+i,yield*T.call(this,t,n[r])}}function B(){I=k,a.encode(null,Fh)}function E(t,e,n){return I=e&&e.dv?k=e.dv:100,t&&"object"==typeof t?(a.encode(null,Fh),n(t,a.wv||(a.wv={}),!0)):[a.encode(t)]}async function*R(t,e){for(let n of T(t,e,!0)){let t=n.constructor;if(t===ph||t===Uint8Array)yield n;else if(Nh(n)){let t,e=n.stream().getReader();for(;!(t=await e.read()).done;)yield t.value}else if(n[Symbol.asyncIterator])for await(let t of n)B(),t?yield*R(t,e.async||(e.async={})):yield a.encode(t);else yield n}}this.pv=function(t,e){return E(t,e,T)},this.yv=function(t,e){return E(t,e,R)}}gv(t){bh=t,mh=new DataView(bh.buffer,bh.byteOffset,bh.byteLength),Ih=0}bv(){this.nm&&(this.nm=[]),this.dm&&(this.dm=void 0)}rv(){let t=this.Gm||0;this.Gm=t+1;let e=this.nm.slice(0),n=new Eh(e,this.dm,this.Gm),r=this.Ym(n,e=>(e&&e.version||0)==t);return!1===r?(n=this.tm()||{},this.nm=n.nm||[],this.dm=n.Cm,this.Gm=n.version,this.nm.tv=this.nm.length):e.forEach((t,e)=>this.nm[e]=t),r}}({Yb:!1});const Vh=Gh.encode;Gh.pv,Gh.yv;const Kh=512,Oh=1024,Fh=2048;async function Wh(t,e,n,r,i,o=100,s,a){let c;null!=s&&(c={Tt:"startAt",Zr:s.bytes()}),null!=a&&(c={Tt:"startAfter",Lr:a.bytes()});const l=Ue.create({version:{Tt:"v0",wr:{_r:new Ea(e).bytes(),Hr:n,jr:Vh(r),Mr:Vh(i),Ur:o??100,start:c,pr:!0}}}),u=await ou(t,e),{response:h}=await t.Ts().qo(l),{version:f}=h;if("v0"!==f.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be v0)");const{wr:d}=f;if("proof"!==d.result.Tt)throw new Error("Unexpected oneOf type returned from DAPI (must be proof)");const{result:{br:w},metadata:p}=d;if(null==p)throw new Error("Metadata not found");const y=null!=s,g=s??a,{Nb:b,qr:m}=function(t,e,n,r,i,o,s,a,c,l){const u=ca.fu.Ls(t,e.Ay,n,Ua(r),i??[],o,null!=s?Ca(s):void 0,a,c?.toString(),Ua(l));return{Nb:u.Nb,qr:u.qr.map(Tc.ph)}}(w.nr,u,n,r,i,o,g?.bytes(),y,BigInt(p?.lr),Nl),v=await rl(t.Ui,w.sr,il(w.rr));if(!await Rl(w,p,b,v))throw new Error("Failed to verify query");return m??[]}class Dh{Ob;constructor(t){this.Ob=t}create(t,e,n,r,i){return uu(new Ea(t),e,n,new Ea(r),i)}async query(t,e,n,r,i,o,s){if(null!=s&&null!=o)throw new Error("You may only set either startAfter or startAt at once");return await Wh(this.Ob,new Ea(t),e,n,r,i??100,o,s)}Db(t,e,n){if("transfer"===e&&null==n.Vd)throw new Error("Recipient is required for transfer transition");if("updatePrice"===e&&null==n.mo)throw new Error("Price is required for updatePrice transition");if("purchase"===e&&null==n.Od)throw new Error("Amount is required for updatePrice transition");if(null!=n.Pg){const{oi:t,Od:e}=n.Pg;n.Pg=new Ec(t,e)}if(null!=n.sg){const{mv:t,po:e,eg:r,ng:i,rg:o}=n.sg;n.sg=new Ac(new Ea(t),e,r,i,o)}return fu(t,e,n)}}function _h(t){return t.toLowerCase().replace(/[oli]/g,t=>"o"===t?"0":"l"===t||"i"===t?"1":t)}async function Hh(t,e){const n=El(t),r=El(e),i=new Uint8Array(n.length+r.length);i.set(n),i.set(r,n.length);const o=await ol(i);return Ea.fromHex(il(o))}class jh{vv(t){return nu.decode(t)}Iv(t){return nu.encode(t)}kv(t){return il(t)}Tv(t){return El(t)}Av(t){return _h(t)}async Bv(t,e){return await Hh(t,e)}Ev(t){return function(t){return Ea.fromHex(t)}(t)}Rv(t){try{return new Ea(t),!0}catch(t){return!1}}Pv(t){return au(t)}}
3
3
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Mh(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function Lh(t,e=""){if(!Number.isSafeInteger(t)||t<0){throw new Error(`${e&&`"${e}" `}expected integer >0, got ${t}`)}}function Zh(t,e,n=""){const r=Mh(t),i=t?.length,o=void 0!==e;if(!r||o&&i!==e){throw new Error((n&&`"${n}" `)+"expected Uint8Array"+(o?` of length ${e}`:"")+", got "+(r?`length=${i}`:"type="+typeof t))}return t}function qh(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash must wrapped by utils.createHasher");Lh(t.Nv),Lh(t.xv)}function Yh(t,e=!0){if(t.$v)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function zh(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function Xh(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Jh(t,e){return t<<32-e|t>>>e}function Qh(t,e){return t<<e|t>>>32-e>>>0}const tf=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),ef=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function nf(t){if(Zh(t),tf)return t.toHex();let e="";for(let n=0;n<t.length;n++)e+=ef[t[n]];return e}const rf=48,of=57,sf=65,af=70,cf=97,lf=102;function uf(t){return t>=rf&&t<=of?t-rf:t>=sf&&t<=af?t-(sf-10):t>=cf&&t<=lf?t-(cf-10):void 0}function hf(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);if(tf)return Uint8Array.fromHex(t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let e=0,i=0;e<n;e++,i+=2){const n=uf(t.charCodeAt(i)),o=uf(t.charCodeAt(i+1));if(void 0===n||void 0===o){const e=t[i]+t[i+1];throw new Error('hex string expected, got non-hex character "'+e+'" at index '+i)}r[e]=16*n+o}return r}function ff(t,e=""){return"string"==typeof t?function(t){if("string"!=typeof t)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(t))}(t):Zh(t,void 0,e)}function df(...t){let e=0;for(let n=0;n<t.length;n++){const r=t[n];Zh(r),e+=r.length}const n=new Uint8Array(e);for(let e=0,r=0;e<t.length;e++){const i=t[e];n.set(i,r),r+=i.length}return n}function wf(t,e={}){const n=(e,n)=>t(n).update(e).digest(),r=t(void 0);return n.Nv=r.Nv,n.xv=r.xv,n.create=e=>t(e),Object.assign(n,e),Object.freeze(n)}function pf(t=32){const e="object"==typeof globalThis?globalThis.crypto:null;if("function"!=typeof e?.getRandomValues)throw new Error("crypto.getRandomValues must be defined");return e.getRandomValues(new Uint8Array(t))}const yf=t=>({Uv:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});function gf(t,e,n){return t&e^~t&n}function bf(t,e,n){return t&e^t&n^e&n}let mf=class{xv;Nv;Sv;Cv;buffer;view;finished=!1;length=0;o=0;$v=!1;constructor(t,e,n,r){this.xv=t,this.Nv=e,this.Sv=n,this.Cv=r,this.buffer=new Uint8Array(t),this.view=Xh(this.buffer)}update(t){Yh(this),Zh(t);const{view:e,buffer:n,xv:r}=this,i=t.length;for(let o=0;o<i;){const s=Math.min(r-this.o,i-o);if(s===r){const e=Xh(t);for(;r<=i-o;o+=r)this.process(e,o);continue}n.set(t.subarray(o,o+s),this.o),this.o+=s,o+=s,this.o===r&&(this.process(e,0),this.o=0)}return this.length+=t.length,this.Gv(),this}Vv(t){Yh(this),function(t,e){Zh(t,void 0,"digestInto() output");const n=e.Nv;if(t.length<n)throw new Error('"digestInto() output" expected to be of length >='+n)}(t,this),this.finished=!0;const{buffer:e,view:n,xv:r,Cv:i}=this;let{o:o}=this;e[o++]=128,zh(this.buffer.subarray(o)),this.Sv>r-o&&(this.process(n,0),o=0);for(let t=o;t<r;t++)e[t]=0;n.setBigUint64(r-8,BigInt(8*this.length),i),this.process(n,0);const s=Xh(t),a=this.Nv;if(a%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const c=a/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<c;t++)s.setUint32(4*t,l[t],i)}digest(){const{buffer:t,Nv:e}=this;this.Vv(t);const n=t.slice(0,e);return this.destroy(),n}Kv(t){t||=new this.constructor,t.set(...this.get());const{xv:e,buffer:n,length:r,finished:i,$v:o,o:s}=this;return t.$v=o,t.finished=i,t.length=r,t.o=s,r%e&&t.buffer.set(n),t}clone(){return this.Kv()}};const vf=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),If=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),kf=BigInt(2**32-1),Tf=BigInt(32);function Af(t,e=!1){return e?{Ov:Number(t&kf),Fv:Number(t>>Tf&kf)}:{Ov:0|Number(t>>Tf&kf),Fv:0|Number(t&kf)}}const Bf=(t,e,n)=>t>>>n,Ef=(t,e,n)=>t<<32-n|e>>>n,Rf=(t,e,n)=>t>>>n|e<<32-n,Pf=(t,e,n)=>t<<32-n|e>>>n,Nf=(t,e,n)=>t<<64-n|e>>>n-32,xf=(t,e,n)=>t>>>n-32|e<<64-n;function $f(t,e,n,r){const i=(e>>>0)+(r>>>0);return{Ov:t+n+(i/2**32|0)|0,Fv:0|i}}const Uf=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),Sf=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,Cf=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),Gf=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,Vf=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),Kf=(t,e,n,r,i,o)=>e+n+r+i+o+(t/2**32|0)|0,Of=Uint32Array.from([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]),Ff=new Uint32Array(64);let Wf=class extends mf{constructor(t){super(64,t,8,!1)}get(){const{Wv:t,Dv:e,U:n,_v:r,E:i,Hv:o,jv:s,Mv:a}=this;return[t,e,n,r,i,o,s,a]}set(t,e,n,r,i,o,s,a){this.Wv=0|t,this.Dv=0|e,this.U=0|n,this._v=0|r,this.E=0|i,this.Hv=0|o,this.jv=0|s,this.Mv=0|a}process(t,e){for(let n=0;n<16;n++,e+=4)Ff[n]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=Ff[t-15],n=Ff[t-2],r=Jh(e,7)^Jh(e,18)^e>>>3,i=Jh(n,17)^Jh(n,19)^n>>>10;Ff[t]=i+Ff[t-7]+r+Ff[t-16]|0}let{Wv:n,Dv:r,U:i,_v:o,E:s,Hv:a,jv:c,Mv:l}=this;for(let t=0;t<64;t++){const e=l+(Jh(s,6)^Jh(s,11)^Jh(s,25))+gf(s,a,c)+Of[t]+Ff[t]|0,u=(Jh(n,2)^Jh(n,13)^Jh(n,22))+bf(n,r,i)|0;l=c,c=a,a=s,s=o+e|0,o=i,i=r,r=n,n=e+u|0}n=n+this.Wv|0,r=r+this.Dv|0,i=i+this.U|0,o=o+this._v|0,s=s+this.E|0,a=a+this.Hv|0,c=c+this.jv|0,l=l+this.Mv|0,this.set(n,r,i,o,s,a,c,l)}Gv(){zh(Ff)}destroy(){this.set(0,0,0,0,0,0,0,0),zh(this.buffer)}},Df=class extends Wf{Wv=0|vf[0];Dv=0|vf[1];U=0|vf[2];_v=0|vf[3];E=0|vf[4];Hv=0|vf[5];jv=0|vf[6];Mv=0|vf[7];constructor(){super(32)}};const _f=(()=>function(t,e=!1){const n=t.length;let r=new Uint32Array(n),i=new Uint32Array(n);for(let o=0;o<n;o++){const{Ov:n,Fv:s}=Af(t[o],e);[r[o],i[o]]=[n,s]}return[r,i]}(["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(t=>BigInt(t))))(),Hf=(()=>_f[0])(),jf=(()=>_f[1])(),Mf=new Uint32Array(80),Lf=new Uint32Array(80);class Zf extends mf{constructor(t){super(128,t,16,!1)}get(){const{Lv:t,Zv:e,qv:n,Yv:r,zv:i,Xv:o,Jv:s,Qv:a,tI:c,eI:l,nI:u,rI:h,iI:f,oI:d,sI:w,aI:p}=this;return[t,e,n,r,i,o,s,a,c,l,u,h,f,d,w,p]}set(t,e,n,r,i,o,s,a,c,l,u,h,f,d,w,p){this.Lv=0|t,this.Zv=0|e,this.qv=0|n,this.Yv=0|r,this.zv=0|i,this.Xv=0|o,this.Jv=0|s,this.Qv=0|a,this.tI=0|c,this.eI=0|l,this.nI=0|u,this.rI=0|h,this.iI=0|f,this.oI=0|d,this.sI=0|w,this.aI=0|p}process(t,e){for(let n=0;n<16;n++,e+=4)Mf[n]=t.getUint32(e),Lf[n]=t.getUint32(e+=4);for(let t=16;t<80;t++){const e=0|Mf[t-15],n=0|Lf[t-15],r=Rf(e,n,1)^Rf(e,n,8)^Bf(e,0,7),i=Pf(e,n,1)^Pf(e,n,8)^Ef(e,n,7),o=0|Mf[t-2],s=0|Lf[t-2],a=Rf(o,s,19)^Nf(o,s,61)^Bf(o,0,6),c=Pf(o,s,19)^xf(o,s,61)^Ef(o,s,6),l=Cf(i,c,Lf[t-7],Lf[t-16]),u=Gf(l,r,a,Mf[t-7],Mf[t-16]);Mf[t]=0|u,Lf[t]=0|l}let{Lv:n,Zv:r,qv:i,Yv:o,zv:s,Xv:a,Jv:c,Qv:l,tI:u,eI:h,nI:f,rI:d,iI:w,oI:p,sI:y,aI:g}=this;for(let t=0;t<80;t++){const e=Rf(u,h,14)^Rf(u,h,18)^Nf(u,h,41),b=Pf(u,h,14)^Pf(u,h,18)^xf(u,h,41),m=u&f^~u&w,v=Vf(g,b,h&d^~h&p,jf[t],Lf[t]),I=Kf(v,y,e,m,Hf[t],Mf[t]),k=0|v,T=Rf(n,r,28)^Nf(n,r,34)^Nf(n,r,39),A=Pf(n,r,28)^xf(n,r,34)^xf(n,r,39),B=n&i^n&s^i&s,E=r&o^r&a^o&a;y=0|w,g=0|p,w=0|f,p=0|d,f=0|u,d=0|h,({Ov:u,Fv:h}=$f(0|c,0|l,0|I,0|k)),c=0|s,l=0|a,s=0|i,a=0|o,i=0|n,o=0|r;const R=Uf(k,A,E);n=Sf(R,I,T,B),r=0|R}({Ov:n,Fv:r}=$f(0|this.Lv,0|this.Zv,0|n,0|r)),({Ov:i,Fv:o}=$f(0|this.qv,0|this.Yv,0|i,0|o)),({Ov:s,Fv:a}=$f(0|this.zv,0|this.Xv,0|s,0|a)),({Ov:c,Fv:l}=$f(0|this.Jv,0|this.Qv,0|c,0|l)),({Ov:u,Fv:h}=$f(0|this.tI,0|this.eI,0|u,0|h)),({Ov:f,Fv:d}=$f(0|this.nI,0|this.rI,0|f,0|d)),({Ov:w,Fv:p}=$f(0|this.iI,0|this.oI,0|w,0|p)),({Ov:y,Fv:g}=$f(0|this.sI,0|this.aI,0|y,0|g)),this.set(n,r,i,o,s,a,c,l,u,h,f,d,w,p,y,g)}Gv(){zh(Mf,Lf)}destroy(){zh(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class qf extends Zf{Lv=0|If[0];Zv=0|If[1];qv=0|If[2];Yv=0|If[3];zv=0|If[4];Xv=0|If[5];Jv=0|If[6];Qv=0|If[7];tI=0|If[8];eI=0|If[9];nI=0|If[10];rI=0|If[11];iI=0|If[12];oI=0|If[13];sI=0|If[14];aI=0|If[15];constructor(){super(64)}}const Yf=wf(()=>new Df,yf(1)),zf=wf(()=>new qf,yf(3)),Xf=BigInt(0),Jf=BigInt(1);function Qf(t,e=""){if("boolean"!=typeof t){throw new Error((e&&`"${e}" `)+"expected boolean, got type="+typeof t)}return t}function td(t){if("bigint"==typeof t){if(!ad(t))throw new Error("positive bigint expected, got "+t)}else Lh(t);return t}function ed(t){const e=td(t).toString(16);return 1&e.length?"0"+e:e}function nd(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);return""===t?Xf:BigInt("0x"+t)}function rd(t){return nd(nf(t))}function id(t){return nd(nf(function(t){return Uint8Array.from(t)}(Zh(t)).reverse()))}function od(t,e){Lh(e);const n=hf((t=td(t)).toString(16).padStart(2*e,"0"));if(n.length!==e)throw new Error("number too large");return n}function sd(t,e){return od(t,e).reverse()}const ad=t=>"bigint"==typeof t&&Xf<=t;function cd(t,e,n,r){if(!function(t,e,n){return ad(t)&&ad(e)&&ad(n)&&e<=t&&t<n}(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}const ld=t=>(Jf<<BigInt(t))-Jf;function ud(t,e={},n={}){if(!t||"object"!=typeof t)throw new Error("expected valid options object");const r=(e,n)=>Object.entries(e).forEach(([e,r])=>function(e,n,r){const i=t[e];if(r&&void 0===i)return;const o=typeof i;if(o!==n||null===i)throw new Error(`param "${e}" is invalid: expected ${n}, got ${o}`)}(e,r,n));r(e,!1),r(n,!0)}function hd(t){const e=new WeakMap;return(n,...r)=>{const i=e.get(n);if(void 0!==i)return i;const o=t(n,...r);return e.set(n,o),o}}
4
4
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const fd=BigInt(0),dd=BigInt(1),wd=BigInt(2),pd=BigInt(3),yd=BigInt(4),gd=BigInt(5),bd=BigInt(7),md=BigInt(8),vd=BigInt(9),Id=BigInt(16);function kd(t,e){const n=t%e;return n>=fd?n:e+n}function Td(t,e,n){let r=t;for(;e-- >fd;)r*=r,r%=n;return r}function Ad(t,e){if(t===fd)throw new Error("invert: expected non-zero number");if(e<=fd)throw new Error("invert: expected positive modulus, got "+e);let n=kd(t,e),r=e,i=fd,o=dd;for(;n!==fd;){const t=r%n,e=i-o*(r/n);r=n,n=t,i=o,o=e}if(r!==dd)throw new Error("invert: does not exist");return kd(i,e)}function Bd(t,e,n){if(!t.cI(t.lI(e),n))throw new Error("Cannot find square root")}function Ed(t,e){const n=(t.uI+dd)/yd,r=t.pow(e,n);return Bd(t,r,e),r}function Rd(t,e){const n=(t.uI-gd)/md,r=t.mul(e,wd),i=t.pow(r,n),o=t.mul(e,i),s=t.mul(t.mul(o,wd),i),a=t.mul(o,t.sub(s,t.ONE));return Bd(t,a,e),a}function Pd(t){if(t<pd)throw new Error("sqrt is not defined for small field");let e=t-dd,n=0;for(;e%wd===fd;)e/=wd,n++;let r=wd;const i=Cd(t);for(;1===Ud(i,r);)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===n)return Ed;let o=i.pow(r,e);const s=(e+dd)/wd;return function(t,r){if(t.hI(r))return r;if(1!==Ud(t,r))throw new Error("Cannot find square root");let i=n,a=t.mul(t.ONE,o),c=t.pow(r,e),l=t.pow(r,s);for(;!t.cI(c,t.ONE);){if(t.hI(c))return t.ZERO;let e=1,n=t.lI(c);for(;!t.cI(n,t.ONE);)if(e++,n=t.lI(n),e===i)throw new Error("Cannot find square root");const r=dd<<BigInt(i-e-1),o=t.pow(a,r);i=e,a=t.lI(o),c=t.mul(c,a),l=t.mul(l,o)}return l}}function Nd(t){return t%yd===pd?Ed:t%md===gd?Rd:t%Id===vd?function(t){const e=Cd(t),n=Pd(t),r=n(e,e.fI(e.ONE)),i=n(e,r),o=n(e,e.fI(r)),s=(t+bd)/Id;return(t,e)=>{let n=t.pow(e,s),a=t.mul(n,r);const c=t.mul(n,i),l=t.mul(n,o),u=t.cI(t.lI(a),e),h=t.cI(t.lI(c),e);n=t.dI(n,a,u),a=t.dI(l,c,h);const f=t.cI(t.lI(a),e),d=t.dI(n,a,f);return Bd(t,d,e),d}}(t):Pd(t)}const xd=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function $d(t,e,n=!1){const r=new Array(e.length).fill(n?t.ZERO:void 0),i=e.reduce((e,n,i)=>t.hI(n)?e:(r[i]=e,t.mul(e,n)),t.ONE),o=t.wI(i);return e.reduceRight((e,n,i)=>t.hI(n)?e:(r[i]=t.mul(e,r[i]),t.mul(e,n)),o),r}function Ud(t,e){const n=(t.uI-dd)/wd,r=t.pow(e,n),i=t.cI(r,t.ONE),o=t.cI(r,t.ZERO),s=t.cI(r,t.fI(t.ONE));if(!i&&!o&&!s)throw new Error("invalid Legendre symbol result");return i?1:o?0:-1}let Sd=class{uI;pI;$t;Cv;ZERO=fd;ONE=dd;yI;gI;bI;constructor(t,e={}){if(t<=fd)throw new Error("invalid field: expected ORDER > 0, got "+t);let n;this.Cv=!1,null!=e&&"object"==typeof e&&("number"==typeof e.pI&&(n=e.pI),"function"==typeof e.sqrt&&(this.sqrt=e.sqrt),"boolean"==typeof e.Cv&&(this.Cv=e.Cv),e.mI&&(this.yI=e.mI?.slice()),"boolean"==typeof e.vI&&(this.bI=e.vI));const{II:r,kI:i}=function(t,e){void 0!==e&&Lh(e);const n=void 0!==e?e:t.toString(2).length;return{II:n,kI:Math.ceil(n/8)}}(t,n);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.uI=t,this.pI=r,this.$t=i,this.gI=void 0,Object.preventExtensions(this)}create(t){return kd(t,this.uI)}TI(t){if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return fd<=t&&t<this.uI}hI(t){return t===fd}AI(t){return!this.hI(t)&&this.TI(t)}BI(t){return(t&dd)===dd}fI(t){return kd(-t,this.uI)}cI(t,e){return t===e}lI(t){return kd(t*t,this.uI)}add(t,e){return kd(t+e,this.uI)}sub(t,e){return kd(t-e,this.uI)}mul(t,e){return kd(t*e,this.uI)}pow(t,e){return function(t,e,n){if(n<fd)throw new Error("invalid exponent, negatives unsupported");if(n===fd)return t.ONE;if(n===dd)return e;let r=t.ONE,i=e;for(;n>fd;)n&dd&&(r=t.mul(r,i)),i=t.lI(i),n>>=dd;return r}(this,t,e)}div(t,e){return kd(t*Ad(e,this.uI),this.uI)}EI(t){return t*t}RI(t,e){return t+e}NI(t,e){return t-e}xI(t,e){return t*e}wI(t){return Ad(t,this.uI)}sqrt(t){return this.gI||(this.gI=Nd(this.uI)),this.gI(this,t)}$I(t){return this.Cv?sd(t,this.$t):od(t,this.$t)}kh(t,e=!1){Zh(t);const{yI:n,$t:r,Cv:i,uI:o,bI:s}=this;if(n){if(!n.includes(t.length)||t.length>r)throw new Error("Field.fromBytes: expected "+n+" bytes, got "+t.length);const e=new Uint8Array(r);e.set(t,i?0:e.length-t.length),t=e}if(t.length!==r)throw new Error("Field.fromBytes: expected "+r+" bytes, got "+t.length);let a=i?id(t):rd(t);if(s&&(a=kd(a,o)),!e&&!this.TI(a))throw new Error("invalid field element: outside of range 0..ORDER");return a}UI(t){return $d(this,t)}dI(t,e,n){return n?e:t}};function Cd(t,e={}){return new Sd(t,e)}function Gd(t){if("bigint"!=typeof t)throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function Vd(t){const e=Gd(t);return e+Math.ceil(e/2)}