UNPKG

@dfinity/nns

Version:

A library for interfacing with the Internet Computer's Network Nervous System.

1 lines • 135 kB
import{a as _o,b as li,c as qo}from"./chunk-IIFH2XLR.js";var Yo=_o(_t=>{"use strict";_t.byteLength=yi;_t.toByteArray=Ri;_t.fromByteArray=bi;var H=[],E=[],wi=typeof Uint8Array<"u"?Uint8Array:Array,go="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Oe=0,Xo=go.length;Oe<Xo;++Oe)H[Oe]=go[Oe],E[go.charCodeAt(Oe)]=Oe;var Oe,Xo;E[45]=62;E[95]=63;function Jo(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var o=n===t?0:4-n%4;return[n,o]}function yi(e){var t=Jo(e),n=t[0],o=t[1];return(n+o)*3/4-o}function Oi(e,t,n){return(t+n)*3/4-n}function Ri(e){var t,n=Jo(e),o=n[0],r=n[1],i=new wi(Oi(e,o,r)),s=0,_=r>0?o-4:o,d;for(d=0;d<_;d+=4)t=E[e.charCodeAt(d)]<<18|E[e.charCodeAt(d+1)]<<12|E[e.charCodeAt(d+2)]<<6|E[e.charCodeAt(d+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=t&255;return r===2&&(t=E[e.charCodeAt(d)]<<2|E[e.charCodeAt(d+1)]>>4,i[s++]=t&255),r===1&&(t=E[e.charCodeAt(d)]<<10|E[e.charCodeAt(d+1)]<<4|E[e.charCodeAt(d+2)]>>2,i[s++]=t>>8&255,i[s++]=t&255),i}function hi(e){return H[e>>18&63]+H[e>>12&63]+H[e>>6&63]+H[e&63]}function vi(e,t,n){for(var o,r=[],i=t;i<n;i+=3)o=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),r.push(hi(o));return r.join("")}function bi(e){for(var t,n=e.length,o=n%3,r=[],i=16383,s=0,_=n-o;s<_;s+=i)r.push(vi(e,s,s+i>_?_:s+i));return o===1?(t=e[n-1],r.push(H[t>>2]+H[t<<4&63]+"==")):o===2&&(t=(e[n-2]<<8)+e[n-1],r.push(H[t>>10]+H[t>>4&63]+H[t<<2&63]+"=")),r.join("")}});var Qo=_o(wo=>{wo.read=function(e,t,n,o,r){var i,s,_=r*8-o-1,d=(1<<_)-1,m=d>>1,l=-7,p=n?r-1:0,w=n?-1:1,g=e[t+p];for(p+=w,i=g&(1<<-l)-1,g>>=-l,l+=_;l>0;i=i*256+e[t+p],p+=w,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=o;l>0;s=s*256+e[t+p],p+=w,l-=8);if(i===0)i=1-m;else{if(i===d)return s?NaN:(g?-1:1)*(1/0);s=s+Math.pow(2,o),i=i-m}return(g?-1:1)*s*Math.pow(2,i-o)};wo.write=function(e,t,n,o,r,i){var s,_,d,m=i*8-r-1,l=(1<<m)-1,p=l>>1,w=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=o?0:i-1,A=o?1:-1,J=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(_=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-s))<1&&(s--,d*=2),s+p>=1?t+=w/d:t+=w*Math.pow(2,1-p),t*d>=2&&(s++,d/=2),s+p>=l?(_=0,s=l):s+p>=1?(_=(t*d-1)*Math.pow(2,r),s=s+p):(_=t*Math.pow(2,p-1)*Math.pow(2,r),s=0));r>=8;e[n+g]=_&255,g+=A,_/=256,r-=8);for(s=s<<r|_,m+=r;m>0;e[n+g]=s&255,g+=A,s/=256,m-=8);e[n+g-A]|=J*128}});var pr=_o(ke=>{"use strict";var yo=Yo(),xe=Qo(),Zo=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ke.Buffer=a;ke.SlowBuffer=Ci;ke.INSPECT_MAX_BYTES=50;var dt=2147483647;ke.kMaxLength=dt;a.TYPED_ARRAY_SUPPORT=xi();!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function xi(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}});Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function re(e){if(e>dt)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,n){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return vo(e)}return er(e,t,n)}a.poolSize=8192;function er(e,t,n){if(typeof e=="string")return ki(e,t);if(ArrayBuffer.isView(e))return Pi(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(j(e,ArrayBuffer)||e&&j(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(j(e,SharedArrayBuffer)||e&&j(e.buffer,SharedArrayBuffer)))return Ro(e,t,n);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let o=e.valueOf&&e.valueOf();if(o!=null&&o!==e)return a.from(o,t,n);let r=Ti(e);if(r)return r;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return a.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}a.from=function(e,t,n){return er(e,t,n)};Object.setPrototypeOf(a.prototype,Uint8Array.prototype);Object.setPrototypeOf(a,Uint8Array);function tr(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function Si(e,t,n){return tr(e),e<=0?re(e):t!==void 0?typeof n=="string"?re(e).fill(t,n):re(e).fill(t):re(e)}a.alloc=function(e,t,n){return Si(e,t,n)};function vo(e){return tr(e),re(e<0?0:bo(e)|0)}a.allocUnsafe=function(e){return vo(e)};a.allocUnsafeSlow=function(e){return vo(e)};function ki(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let n=nr(e,t)|0,o=re(n),r=o.write(e,t);return r!==n&&(o=o.slice(0,r)),o}function Oo(e){let t=e.length<0?0:bo(e.length)|0,n=re(t);for(let o=0;o<t;o+=1)n[o]=e[o]&255;return n}function Pi(e){if(j(e,Uint8Array)){let t=new Uint8Array(e);return Ro(t.buffer,t.byteOffset,t.byteLength)}return Oo(e)}function Ro(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let o;return t===void 0&&n===void 0?o=new Uint8Array(e):n===void 0?o=new Uint8Array(e,t):o=new Uint8Array(e,t,n),Object.setPrototypeOf(o,a.prototype),o}function Ti(e){if(a.isBuffer(e)){let t=bo(e.length)|0,n=re(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!="number"||So(e.length)?re(0):Oo(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Oo(e.data)}function bo(e){if(e>=dt)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+dt.toString(16)+" bytes");return e|0}function Ci(e){return+e!=e&&(e=0),a.alloc(+e)}a.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==a.prototype};a.compare=function(t,n){if(j(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),j(n,Uint8Array)&&(n=a.from(n,n.offset,n.byteLength)),!a.isBuffer(t)||!a.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===n)return 0;let o=t.length,r=n.length;for(let i=0,s=Math.min(o,r);i<s;++i)if(t[i]!==n[i]){o=t[i],r=n[i];break}return o<r?-1:r<o?1:0};a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(t,n){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return a.alloc(0);let o;if(n===void 0)for(n=0,o=0;o<t.length;++o)n+=t[o].length;let r=a.allocUnsafe(n),i=0;for(o=0;o<t.length;++o){let s=t[o];if(j(s,Uint8Array))i+s.length>r.length?(a.isBuffer(s)||(s=a.from(s)),s.copy(r,i)):Uint8Array.prototype.set.call(r,s,i);else if(a.isBuffer(s))s.copy(r,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=s.length}return r};function nr(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||j(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let n=e.length,o=arguments.length>2&&arguments[2]===!0;if(!o&&n===0)return 0;let r=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return ho(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return dr(e).length;default:if(r)return o?-1:ho(e).length;t=(""+t).toLowerCase(),r=!0}}a.byteLength=nr;function Vi(e,t,n){let o=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Hi(this,t,n);case"utf8":case"utf-8":return rr(this,t,n);case"ascii":return Gi(this,t,n);case"latin1":case"binary":return Ki(this,t,n);case"base64":return qi(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ji(this,t,n);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}a.prototype._isBuffer=!0;function Re(e,t,n){let o=e[t];e[t]=e[n],e[n]=o}a.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let n=0;n<t;n+=2)Re(this,n,n+1);return this};a.prototype.swap32=function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let n=0;n<t;n+=4)Re(this,n,n+3),Re(this,n+1,n+2);return this};a.prototype.swap64=function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let n=0;n<t;n+=8)Re(this,n,n+7),Re(this,n+1,n+6),Re(this,n+2,n+5),Re(this,n+3,n+4);return this};a.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?rr(this,0,t):Vi.apply(this,arguments)};a.prototype.toLocaleString=a.prototype.toString;a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:a.compare(this,t)===0};a.prototype.inspect=function(){let t="",n=ke.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"};Zo&&(a.prototype[Zo]=a.prototype.inspect);a.prototype.compare=function(t,n,o,r,i){if(j(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(n===void 0&&(n=0),o===void 0&&(o=t?t.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),n<0||o>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&n>=o)return 0;if(r>=i)return-1;if(n>=o)return 1;if(n>>>=0,o>>>=0,r>>>=0,i>>>=0,this===t)return 0;let s=i-r,_=o-n,d=Math.min(s,_),m=this.slice(r,i),l=t.slice(n,o);for(let p=0;p<d;++p)if(m[p]!==l[p]){s=m[p],_=l[p];break}return s<_?-1:_<s?1:0};function or(e,t,n,o,r){if(e.length===0)return-1;if(typeof n=="string"?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,So(n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0)if(r)n=0;else return-1;if(typeof t=="string"&&(t=a.from(t,o)),a.isBuffer(t))return t.length===0?-1:Io(e,t,n,o,r);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):Io(e,[t],n,o,r);throw new TypeError("val must be string, number or Buffer")}function Io(e,t,n,o,r){let i=1,s=e.length,_=t.length;if(o!==void 0&&(o=String(o).toLowerCase(),o==="ucs2"||o==="ucs-2"||o==="utf16le"||o==="utf-16le")){if(e.length<2||t.length<2)return-1;i=2,s/=2,_/=2,n/=2}function d(l,p){return i===1?l[p]:l.readUInt16BE(p*i)}let m;if(r){let l=-1;for(m=n;m<s;m++)if(d(e,m)===d(t,l===-1?0:m-l)){if(l===-1&&(l=m),m-l+1===_)return l*i}else l!==-1&&(m-=m-l),l=-1}else for(n+_>s&&(n=s-_),m=n;m>=0;m--){let l=!0;for(let p=0;p<_;p++)if(d(e,m+p)!==d(t,p)){l=!1;break}if(l)return m}return-1}a.prototype.includes=function(t,n,o){return this.indexOf(t,n,o)!==-1};a.prototype.indexOf=function(t,n,o){return or(this,t,n,o,!0)};a.prototype.lastIndexOf=function(t,n,o){return or(this,t,n,o,!1)};function Mi(e,t,n,o){n=Number(n)||0;let r=e.length-n;o?(o=Number(o),o>r&&(o=r)):o=r;let i=t.length;o>i/2&&(o=i/2);let s;for(s=0;s<o;++s){let _=parseInt(t.substr(s*2,2),16);if(So(_))return s;e[n+s]=_}return s}function Ai(e,t,n,o){return pt(ho(t,e.length-n),e,n,o)}function Ei(e,t,n,o){return pt(Xi(t),e,n,o)}function Fi(e,t,n,o){return pt(dr(t),e,n,o)}function Bi(e,t,n,o){return pt(Ji(t,e.length-n),e,n,o)}a.prototype.write=function(t,n,o,r){if(n===void 0)r="utf8",o=this.length,n=0;else if(o===void 0&&typeof n=="string")r=n,o=this.length,n=0;else if(isFinite(n))n=n>>>0,isFinite(o)?(o=o>>>0,r===void 0&&(r="utf8")):(r=o,o=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-n;if((o===void 0||o>i)&&(o=i),t.length>0&&(o<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let s=!1;for(;;)switch(r){case"hex":return Mi(this,t,n,o);case"utf8":case"utf-8":return Ai(this,t,n,o);case"ascii":case"latin1":case"binary":return Ei(this,t,n,o);case"base64":return Fi(this,t,n,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Bi(this,t,n,o);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function qi(e,t,n){return t===0&&n===e.length?yo.fromByteArray(e):yo.fromByteArray(e.slice(t,n))}function rr(e,t,n){n=Math.min(e.length,n);let o=[],r=t;for(;r<n;){let i=e[r],s=null,_=i>239?4:i>223?3:i>191?2:1;if(r+_<=n){let d,m,l,p;switch(_){case 1:i<128&&(s=i);break;case 2:d=e[r+1],(d&192)===128&&(p=(i&31)<<6|d&63,p>127&&(s=p));break;case 3:d=e[r+1],m=e[r+2],(d&192)===128&&(m&192)===128&&(p=(i&15)<<12|(d&63)<<6|m&63,p>2047&&(p<55296||p>57343)&&(s=p));break;case 4:d=e[r+1],m=e[r+2],l=e[r+3],(d&192)===128&&(m&192)===128&&(l&192)===128&&(p=(i&15)<<18|(d&63)<<12|(m&63)<<6|l&63,p>65535&&p<1114112&&(s=p))}}s===null?(s=65533,_=1):s>65535&&(s-=65536,o.push(s>>>10&1023|55296),s=56320|s&1023),o.push(s),r+=_}return Ui(o)}var Do=4096;function Ui(e){let t=e.length;if(t<=Do)return String.fromCharCode.apply(String,e);let n="",o=0;for(;o<t;)n+=String.fromCharCode.apply(String,e.slice(o,o+=Do));return n}function Gi(e,t,n){let o="";n=Math.min(e.length,n);for(let r=t;r<n;++r)o+=String.fromCharCode(e[r]&127);return o}function Ki(e,t,n){let o="";n=Math.min(e.length,n);for(let r=t;r<n;++r)o+=String.fromCharCode(e[r]);return o}function Hi(e,t,n){let o=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>o)&&(n=o);let r="";for(let i=t;i<n;++i)r+=Yi[e[i]];return r}function ji(e,t,n){let o=e.slice(t,n),r="";for(let i=0;i<o.length-1;i+=2)r+=String.fromCharCode(o[i]+o[i+1]*256);return r}a.prototype.slice=function(t,n){let o=this.length;t=~~t,n=n===void 0?o:~~n,t<0?(t+=o,t<0&&(t=0)):t>o&&(t=o),n<0?(n+=o,n<0&&(n=0)):n>o&&(n=o),n<t&&(n=t);let r=this.subarray(t,n);return Object.setPrototypeOf(r,a.prototype),r};function x(e,t,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(t,n,o){t=t>>>0,n=n>>>0,o||x(t,n,this.length);let r=this[t],i=1,s=0;for(;++s<n&&(i*=256);)r+=this[t+s]*i;return r};a.prototype.readUintBE=a.prototype.readUIntBE=function(t,n,o){t=t>>>0,n=n>>>0,o||x(t,n,this.length);let r=this[t+--n],i=1;for(;n>0&&(i*=256);)r+=this[t+--n]*i;return r};a.prototype.readUint8=a.prototype.readUInt8=function(t,n){return t=t>>>0,n||x(t,1,this.length),this[t]};a.prototype.readUint16LE=a.prototype.readUInt16LE=function(t,n){return t=t>>>0,n||x(t,2,this.length),this[t]|this[t+1]<<8};a.prototype.readUint16BE=a.prototype.readUInt16BE=function(t,n){return t=t>>>0,n||x(t,2,this.length),this[t]<<8|this[t+1]};a.prototype.readUint32LE=a.prototype.readUInt32LE=function(t,n){return t=t>>>0,n||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};a.prototype.readUint32BE=a.prototype.readUInt32BE=function(t,n){return t=t>>>0,n||x(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};a.prototype.readBigUInt64LE=ce(function(t){t=t>>>0,Se(t,"offset");let n=this[t],o=this[t+7];(n===void 0||o===void 0)&&Le(t,this.length-8);let r=n+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,i=this[++t]+this[++t]*2**8+this[++t]*2**16+o*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))});a.prototype.readBigUInt64BE=ce(function(t){t=t>>>0,Se(t,"offset");let n=this[t],o=this[t+7];(n===void 0||o===void 0)&&Le(t,this.length-8);let r=n*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],i=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+o;return(BigInt(r)<<BigInt(32))+BigInt(i)});a.prototype.readIntLE=function(t,n,o){t=t>>>0,n=n>>>0,o||x(t,n,this.length);let r=this[t],i=1,s=0;for(;++s<n&&(i*=256);)r+=this[t+s]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*n)),r};a.prototype.readIntBE=function(t,n,o){t=t>>>0,n=n>>>0,o||x(t,n,this.length);let r=n,i=1,s=this[t+--r];for(;r>0&&(i*=256);)s+=this[t+--r]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*n)),s};a.prototype.readInt8=function(t,n){return t=t>>>0,n||x(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};a.prototype.readInt16LE=function(t,n){t=t>>>0,n||x(t,2,this.length);let o=this[t]|this[t+1]<<8;return o&32768?o|4294901760:o};a.prototype.readInt16BE=function(t,n){t=t>>>0,n||x(t,2,this.length);let o=this[t+1]|this[t]<<8;return o&32768?o|4294901760:o};a.prototype.readInt32LE=function(t,n){return t=t>>>0,n||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};a.prototype.readInt32BE=function(t,n){return t=t>>>0,n||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};a.prototype.readBigInt64LE=ce(function(t){t=t>>>0,Se(t,"offset");let n=this[t],o=this[t+7];(n===void 0||o===void 0)&&Le(t,this.length-8);let r=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(o<<24);return(BigInt(r)<<BigInt(32))+BigInt(n+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)});a.prototype.readBigInt64BE=ce(function(t){t=t>>>0,Se(t,"offset");let n=this[t],o=this[t+7];(n===void 0||o===void 0)&&Le(t,this.length-8);let r=(n<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(r)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+o)});a.prototype.readFloatLE=function(t,n){return t=t>>>0,n||x(t,4,this.length),xe.read(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,n){return t=t>>>0,n||x(t,4,this.length),xe.read(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,n){return t=t>>>0,n||x(t,8,this.length),xe.read(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,n){return t=t>>>0,n||x(t,8,this.length),xe.read(this,t,!1,52,8)};function C(e,t,n,o,r,i){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<i)throw new RangeError('"value" argument is out of bounds');if(n+o>e.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(t,n,o,r){if(t=+t,n=n>>>0,o=o>>>0,!r){let _=Math.pow(2,8*o)-1;C(this,t,n,o,_,0)}let i=1,s=0;for(this[n]=t&255;++s<o&&(i*=256);)this[n+s]=t/i&255;return n+o};a.prototype.writeUintBE=a.prototype.writeUIntBE=function(t,n,o,r){if(t=+t,n=n>>>0,o=o>>>0,!r){let _=Math.pow(2,8*o)-1;C(this,t,n,o,_,0)}let i=o-1,s=1;for(this[n+i]=t&255;--i>=0&&(s*=256);)this[n+i]=t/s&255;return n+o};a.prototype.writeUint8=a.prototype.writeUInt8=function(t,n,o){return t=+t,n=n>>>0,o||C(this,t,n,1,255,0),this[n]=t&255,n+1};a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(t,n,o){return t=+t,n=n>>>0,o||C(this,t,n,2,65535,0),this[n]=t&255,this[n+1]=t>>>8,n+2};a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(t,n,o){return t=+t,n=n>>>0,o||C(this,t,n,2,65535,0),this[n]=t>>>8,this[n+1]=t&255,n+2};a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(t,n,o){return t=+t,n=n>>>0,o||C(this,t,n,4,4294967295,0),this[n+3]=t>>>24,this[n+2]=t>>>16,this[n+1]=t>>>8,this[n]=t&255,n+4};a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(t,n,o){return t=+t,n=n>>>0,o||C(this,t,n,4,4294967295,0),this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255,n+4};function ir(e,t,n,o,r){_r(t,o,r,e,n,7);let i=Number(t&BigInt(4294967295));e[n++]=i,i=i>>8,e[n++]=i,i=i>>8,e[n++]=i,i=i>>8,e[n++]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=s,s=s>>8,e[n++]=s,s=s>>8,e[n++]=s,s=s>>8,e[n++]=s,n}function sr(e,t,n,o,r){_r(t,o,r,e,n,7);let i=Number(t&BigInt(4294967295));e[n+7]=i,i=i>>8,e[n+6]=i,i=i>>8,e[n+5]=i,i=i>>8,e[n+4]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=s,s=s>>8,e[n+2]=s,s=s>>8,e[n+1]=s,s=s>>8,e[n]=s,n+8}a.prototype.writeBigUInt64LE=ce(function(t,n=0){return ir(this,t,n,BigInt(0),BigInt("0xffffffffffffffff"))});a.prototype.writeBigUInt64BE=ce(function(t,n=0){return sr(this,t,n,BigInt(0),BigInt("0xffffffffffffffff"))});a.prototype.writeIntLE=function(t,n,o,r){if(t=+t,n=n>>>0,!r){let d=Math.pow(2,8*o-1);C(this,t,n,o,d-1,-d)}let i=0,s=1,_=0;for(this[n]=t&255;++i<o&&(s*=256);)t<0&&_===0&&this[n+i-1]!==0&&(_=1),this[n+i]=(t/s>>0)-_&255;return n+o};a.prototype.writeIntBE=function(t,n,o,r){if(t=+t,n=n>>>0,!r){let d=Math.pow(2,8*o-1);C(this,t,n,o,d-1,-d)}let i=o-1,s=1,_=0;for(this[n+i]=t&255;--i>=0&&(s*=256);)t<0&&_===0&&this[n+i+1]!==0&&(_=1),this[n+i]=(t/s>>0)-_&255;return n+o};a.prototype.writeInt8=function(t,n,o){return t=+t,n=n>>>0,o||C(this,t,n,1,127,-128),t<0&&(t=255+t+1),this[n]=t&255,n+1};a.prototype.writeInt16LE=function(t,n,o){return t=+t,n=n>>>0,o||C(this,t,n,2,32767,-32768),this[n]=t&255,this[n+1]=t>>>8,n+2};a.prototype.writeInt16BE=function(t,n,o){return t=+t,n=n>>>0,o||C(this,t,n,2,32767,-32768),this[n]=t>>>8,this[n+1]=t&255,n+2};a.prototype.writeInt32LE=function(t,n,o){return t=+t,n=n>>>0,o||C(this,t,n,4,2147483647,-2147483648),this[n]=t&255,this[n+1]=t>>>8,this[n+2]=t>>>16,this[n+3]=t>>>24,n+4};a.prototype.writeInt32BE=function(t,n,o){return t=+t,n=n>>>0,o||C(this,t,n,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255,n+4};a.prototype.writeBigInt64LE=ce(function(t,n=0){return ir(this,t,n,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});a.prototype.writeBigInt64BE=ce(function(t,n=0){return sr(this,t,n,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ar(e,t,n,o,r,i){if(n+o>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function cr(e,t,n,o,r){return t=+t,n=n>>>0,r||ar(e,t,n,4,34028234663852886e22,-34028234663852886e22),xe.write(e,t,n,o,23,4),n+4}a.prototype.writeFloatLE=function(t,n,o){return cr(this,t,n,!0,o)};a.prototype.writeFloatBE=function(t,n,o){return cr(this,t,n,!1,o)};function ur(e,t,n,o,r){return t=+t,n=n>>>0,r||ar(e,t,n,8,17976931348623157e292,-17976931348623157e292),xe.write(e,t,n,o,52,8),n+8}a.prototype.writeDoubleLE=function(t,n,o){return ur(this,t,n,!0,o)};a.prototype.writeDoubleBE=function(t,n,o){return ur(this,t,n,!1,o)};a.prototype.copy=function(t,n,o,r){if(!a.isBuffer(t))throw new TypeError("argument should be a Buffer");if(o||(o=0),!r&&r!==0&&(r=this.length),n>=t.length&&(n=t.length),n||(n=0),r>0&&r<o&&(r=o),r===o||t.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(o<0||o>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-n<r-o&&(r=t.length-n+o);let i=r-o;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(n,o,r):Uint8Array.prototype.set.call(t,this.subarray(o,r),n),i};a.prototype.fill=function(t,n,o,r){if(typeof t=="string"){if(typeof n=="string"?(r=n,n=0,o=this.length):typeof o=="string"&&(r=o,o=this.length),r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(t.length===1){let s=t.charCodeAt(0);(r==="utf8"&&s<128||r==="latin1")&&(t=s)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(n<0||this.length<n||this.length<o)throw new RangeError("Out of range index");if(o<=n)return this;n=n>>>0,o=o===void 0?this.length:o>>>0,t||(t=0);let i;if(typeof t=="number")for(i=n;i<o;++i)this[i]=t;else{let s=a.isBuffer(t)?t:a.from(t,r),_=s.length;if(_===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<o-n;++i)this[i+n]=s[i%_]}return this};var be={};function xo(e,t,n){be[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(r){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:r,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}xo("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);xo("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError);xo("ERR_OUT_OF_RANGE",function(e,t,n){let o=`The value of "${e}" is out of range.`,r=n;return Number.isInteger(n)&&Math.abs(n)>2**32?r=Lo(String(n)):typeof n=="bigint"&&(r=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(r=Lo(r)),r+="n"),o+=` It must be ${t}. Received ${r}`,o},RangeError);function Lo(e){let t="",n=e.length,o=e[0]==="-"?1:0;for(;n>=o+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function Wi(e,t,n){Se(t,"offset"),(e[t]===void 0||e[t+n]===void 0)&&Le(t,e.length-(n+1))}function _r(e,t,n,o,r,i){if(e>n||e<t){let s=typeof t=="bigint"?"n":"",_;throw i>3?t===0||t===BigInt(0)?_=`>= 0${s} and < 2${s} ** ${(i+1)*8}${s}`:_=`>= -(2${s} ** ${(i+1)*8-1}${s}) and < 2 ** ${(i+1)*8-1}${s}`:_=`>= ${t}${s} and <= ${n}${s}`,new be.ERR_OUT_OF_RANGE("value",_,e)}Wi(o,r,i)}function Se(e,t){if(typeof e!="number")throw new be.ERR_INVALID_ARG_TYPE(t,"number",e)}function Le(e,t,n){throw Math.floor(e)!==e?(Se(e,n),new be.ERR_OUT_OF_RANGE(n||"offset","an integer",e)):t<0?new be.ERR_BUFFER_OUT_OF_BOUNDS:new be.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}var zi=/[^+/0-9A-Za-z-_]/g;function $i(e){if(e=e.split("=")[0],e=e.trim().replace(zi,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function ho(e,t){t=t||1/0;let n,o=e.length,r=null,i=[];for(let s=0;s<o;++s){if(n=e.charCodeAt(s),n>55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}else if(s+1===o){(t-=3)>-1&&i.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),r=n;continue}n=(r-55296<<10|n-56320)+65536}else r&&(t-=3)>-1&&i.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return i}function Xi(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function Ji(e,t){let n,o,r,i=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),o=n>>8,r=n%256,i.push(r),i.push(o);return i}function dr(e){return yo.toByteArray($i(e))}function pt(e,t,n,o){let r;for(r=0;r<o&&!(r+n>=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function j(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function So(e){return e!==e}var Yi=function(){let e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){let o=n*16;for(let r=0;r<16;++r)t[o+r]=e[n]+e[r]}return t}();function ce(e){return typeof BigInt>"u"?Qi:e}function Qi(){throw new Error("BigInt not supported")}});import{Actor as fa}from"@dfinity/agent";import{AccountIdentifier as ui,checkAccountId as _i}from"@dfinity/ledger-icp";import{assertPercentageNumber as Bo,createServices as Na,fromNullable as T,isNullish as yt,nonNullish as X,uint8ArrayToBigInt as ga}from"@dfinity/utils";var Uo=({IDL:e})=>{let t=e.Rec(),n=e.Rec(),o=e.Record({id:e.Nat64}),r=e.Record({followees:e.Vec(o)}),i=e.Record({name:e.Text,description:e.Opt(e.Text)}),s=e.Record({id:e.Opt(o),known_neuron_data:e.Opt(i)}),_=e.Record({percentage_to_spawn:e.Opt(e.Nat32),new_controller:e.Opt(e.Principal),nonce:e.Opt(e.Nat64)}),d=e.Record({amount_e8s:e.Nat64}),m=e.Record({topic:e.Int32,followees:e.Vec(o)}),l=e.Record({hash:e.Vec(e.Nat8)}),p=e.Record({owner:e.Opt(e.Principal),subaccount:e.Opt(e.Vec(e.Nat8))}),w=e.Record({to_account_identifier:e.Opt(l),to_account:e.Opt(p),percentage_to_disburse:e.Nat32}),g=e.Record({}),A=e.Record({controller:e.Opt(e.Principal),memo:e.Nat64}),J=e.Variant({NeuronIdOrSubaccount:e.Record({}),MemoAndController:A,Memo:e.Nat64}),_e=e.Record({by:e.Opt(J)}),Ot=e.Record({hot_key_to_remove:e.Opt(e.Principal)}),Rt=e.Record({new_hot_key:e.Opt(e.Principal)}),f=e.Record({requested_setting_for_auto_stake_maturity:e.Bool}),ht=e.Record({additional_dissolve_delay_seconds:e.Nat32}),vt=e.Record({visibility:e.Opt(e.Int32)}),bt=e.Record({dissolve_timestamp_seconds:e.Nat64}),xt=e.Variant({RemoveHotKey:Ot,AddHotKey:Rt,ChangeAutoStakeMaturity:f,StopDissolving:e.Record({}),StartDissolving:e.Record({}),IncreaseDissolveDelay:ht,SetVisibility:vt,JoinCommunityFund:e.Record({}),LeaveCommunityFund:e.Record({}),SetDissolveTimestamp:bt}),de=e.Record({operation:e.Opt(xt)}),S=e.Record({id:e.Nat64}),Te=e.Record({vote:e.Int32,proposal:e.Opt(S)}),pe=e.Record({source_neuron_id:e.Opt(o)}),le=e.Record({dissolve_delay_seconds:e.Nat64,kyc_verified:e.Bool,amount_e8s:e.Nat64,new_controller:e.Opt(e.Principal),nonce:e.Nat64}),St=e.Record({topic:e.Opt(e.Int32),followees:e.Opt(e.Vec(o))}),Ce=e.Record({topic_following:e.Opt(e.Vec(St))}),Ve=e.Record({percentage_to_stake:e.Opt(e.Nat32)}),me=e.Record({percentage_to_merge:e.Nat32}),kt=e.Record({e8s:e.Nat64}),fe=e.Record({to_account:e.Opt(l),amount:e.Opt(kt)}),Pt=e.Variant({Spawn:_,Split:d,Follow:m,DisburseMaturity:w,RefreshVotingPower:g,ClaimOrRefresh:_e,Configure:de,RegisterVote:Te,Merge:pe,DisburseToNeuron:le,SetFollowing:Ce,MakeProposal:n,StakeMaturity:Ve,MergeMaturity:me,Disburse:fe}),Y=e.Variant({Subaccount:e.Vec(e.Nat8),NeuronId:o}),Tt=e.Record({id:e.Opt(o),command:e.Opt(Pt),neuron_id_or_subaccount:e.Opt(Y)}),Ct=e.Record({controllers:e.Vec(e.Principal)}),Vt=e.Record({freezing_threshold:e.Opt(e.Nat64),wasm_memory_threshold:e.Opt(e.Nat64),controllers:e.Opt(Ct),log_visibility:e.Opt(e.Int32),wasm_memory_limit:e.Opt(e.Nat64),memory_allocation:e.Opt(e.Nat64),compute_allocation:e.Opt(e.Nat64)}),Me=e.Record({canister_id:e.Opt(e.Principal),settings:e.Opt(Vt)}),Mt=e.Record({skip_stopping_before_installing:e.Opt(e.Bool),wasm_module_hash:e.Opt(e.Vec(e.Nat8)),canister_id:e.Opt(e.Principal),arg_hash:e.Opt(e.Vec(e.Nat8)),install_mode:e.Opt(e.Int32)}),Ae=e.Record({action:e.Opt(e.Int32),canister_id:e.Opt(e.Principal)}),V=e.Record({basis_points:e.Opt(e.Nat64)}),R=e.Record({seconds:e.Opt(e.Nat64)}),y=e.Record({e8s:e.Opt(e.Nat64)}),At=e.Record({reward_rate_transition_duration:e.Opt(R),initial_reward_rate:e.Opt(V),final_reward_rate:e.Opt(V)}),Et=e.Record({neuron_maximum_dissolve_delay_bonus:e.Opt(V),neuron_maximum_age_for_age_bonus:e.Opt(R),neuron_maximum_dissolve_delay:e.Opt(R),neuron_minimum_dissolve_delay_to_vote:e.Opt(R),neuron_maximum_age_bonus:e.Opt(V),neuron_minimum_stake:e.Opt(y),proposal_wait_for_quiet_deadline_increase:e.Opt(R),proposal_initial_voting_period:e.Opt(R),proposal_rejection_fee:e.Opt(y),voting_reward_parameters:e.Opt(At)}),Ee=e.Record({base64_encoding:e.Opt(e.Text)}),Ft=e.Record({transaction_fee:e.Opt(y),token_symbol:e.Opt(e.Text),token_logo:e.Opt(Ee),token_name:e.Opt(e.Text)}),Bt=e.Record({id:e.Opt(e.Principal)}),qt=e.Record({dissolve_delay_interval:e.Opt(R),count:e.Opt(e.Nat64)}),Ut=e.Record({seconds_after_utc_midnight:e.Opt(e.Nat64)}),u=e.Record({iso_codes:e.Vec(e.Text)}),Gt=e.Record({minimum_participants:e.Opt(e.Nat64),neurons_fund_participation:e.Opt(e.Bool),duration:e.Opt(R),neuron_basket_construction_parameters:e.Opt(qt),confirmation_text:e.Opt(e.Text),maximum_participant_icp:e.Opt(y),minimum_icp:e.Opt(y),minimum_direct_participation_icp:e.Opt(y),minimum_participant_icp:e.Opt(y),start_time:e.Opt(Ut),maximum_direct_participation_icp:e.Opt(y),maximum_icp:e.Opt(y),neurons_fund_investment_icp:e.Opt(y),restricted_countries:e.Opt(u)}),Fe=e.Record({total:e.Opt(y)}),Kt=e.Record({controller:e.Opt(e.Principal),dissolve_delay:e.Opt(R),memo:e.Opt(e.Nat64),vesting_period:e.Opt(R),stake:e.Opt(y)}),Ht=e.Record({developer_neurons:e.Vec(Kt)}),jt=e.Record({treasury_distribution:e.Opt(Fe),developer_distribution:e.Opt(Ht),swap_distribution:e.Opt(Fe)}),Be=e.Record({url:e.Opt(e.Text),governance_parameters:e.Opt(Et),fallback_controller_principal_ids:e.Vec(e.Principal),logo:e.Opt(Ee),name:e.Opt(e.Text),ledger_parameters:e.Opt(Ft),description:e.Opt(e.Text),dapp_canisters:e.Vec(Bt),swap_parameters:e.Opt(Gt),initial_token_distribution:e.Opt(jt)}),qe=e.Record({nns_function:e.Int32,payload:e.Vec(e.Nat8)}),k=e.Record({id:e.Opt(e.Principal),reward_account:e.Opt(l)}),Wt=e.Record({dissolve_delay_seconds:e.Nat64}),zt=e.Record({to_account:e.Opt(l)}),$t=e.Variant({RewardToNeuron:Wt,RewardToAccount:zt}),Q=e.Record({node_provider:e.Opt(k),reward_mode:e.Opt($t),amount_e8s:e.Nat64}),Xt=e.Record({dissolve_delay_interval_seconds:e.Nat64,count:e.Nat64}),Jt=e.Record({min_participant_icp_e8s:e.Nat64,neuron_basket_construction_parameters:e.Opt(Xt),max_icp_e8s:e.Nat64,swap_due_timestamp_seconds:e.Nat64,min_participants:e.Nat32,sns_token_e8s:e.Nat64,sale_delay_seconds:e.Opt(e.Nat64),max_participant_icp_e8s:e.Nat64,min_direct_participation_icp_e8s:e.Opt(e.Nat64),min_icp_e8s:e.Nat64,max_direct_participation_icp_e8s:e.Opt(e.Nat64)}),Yt=e.Record({community_fund_investment_e8s:e.Opt(e.Nat64),target_swap_canister_id:e.Opt(e.Principal),params:e.Opt(Jt)}),Qt=e.Record({start_timestamp_seconds:e.Nat64,end_timestamp_seconds:e.Nat64}),Zt=e.Record({open_time_window:e.Opt(Qt)}),It=e.Record({request:e.Opt(Zt),swap_canister_id:e.Opt(e.Principal)}),Dt=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,r))}),Ue=e.Record({use_registry_derived_rewards:e.Opt(e.Bool),rewards:e.Vec(Q)}),Lt=e.Record({start_reducing_voting_power_after_seconds:e.Opt(e.Nat64),neuron_minimum_dissolve_delay_to_vote_seconds:e.Opt(e.Nat64),clear_following_after_seconds:e.Opt(e.Nat64)}),Z=e.Record({human_readable:e.Opt(e.Text)}),en=e.Record({contribution_threshold_xdr:e.Opt(Z),one_third_participation_milestone_xdr:e.Opt(Z),full_participation_milestone_xdr:e.Opt(Z)}),tn=e.Record({maximum_icp_xdr_rate:e.Opt(V),neurons_fund_matched_funding_curve_coefficients:e.Opt(en),max_theoretical_neurons_fund_participation_amount_xdr:e.Opt(Z),minimum_icp_xdr_rate:e.Opt(V)}),I=e.Record({neuron_minimum_stake_e8s:e.Nat64,voting_power_economics:e.Opt(Lt),max_proposals_to_keep_per_topic:e.Nat32,neuron_management_fee_per_proposal_e8s:e.Nat64,reject_cost_e8s:e.Nat64,transaction_fee_e8s:e.Nat64,neuron_spawn_dissolve_delay_seconds:e.Nat64,minimum_icp_xdr_rate:e.Nat64,maximum_node_provider_rewards_e8s:e.Nat64,neurons_fund_economics:e.Opt(tn)}),Ne=e.Record({principals:e.Vec(e.Principal)}),nn=e.Variant({ToRemove:k,ToAdd:k}),Ge=e.Record({change:e.Opt(nn)}),Ke=e.Record({motion_text:e.Text}),on=e.Variant({RegisterKnownNeuron:s,ManageNeuron:Tt,UpdateCanisterSettings:Me,InstallCode:Mt,StopOrStartCanister:Ae,CreateServiceNervousSystem:Be,ExecuteNnsFunction:qe,RewardNodeProvider:Q,OpenSnsTokenSwap:Yt,SetSnsTokenSwapOpenTimeWindow:It,SetDefaultFollowees:Dt,RewardNodeProviders:Ue,ManageNetworkEconomics:I,ApproveGenesisKyc:Ne,AddOrRemoveNodeProvider:Ge,Motion:Ke});n.fill(e.Record({url:e.Text,title:e.Opt(e.Text),action:e.Opt(on),summary:e.Text}));let rn=e.Record({proposal:e.Opt(n),caller:e.Opt(e.Principal),proposer_id:e.Opt(o)}),He=e.Record({xdr_permyriad_per_icp:e.Opt(e.Nat64),timestamp_seconds:e.Opt(e.Nat64)}),D=e.Record({minimum_xdr_permyriad_per_icp:e.Opt(e.Nat64),registry_version:e.Opt(e.Nat64),node_providers:e.Vec(k),timestamp:e.Nat64,rewards:e.Vec(Q),xdr_conversion_rate:e.Opt(He),maximum_node_provider_rewards_e8s:e.Opt(e.Nat64)}),L=e.Record({total_maturity_e8s_equivalent:e.Opt(e.Nat64),maturity_e8s_equivalent_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),voting_power_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),total_staked_e8s:e.Opt(e.Nat64),count:e.Opt(e.Nat64),deciding_voting_power_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),total_staked_maturity_e8s_equivalent:e.Opt(e.Nat64),total_potential_voting_power:e.Opt(e.Nat64),total_deciding_voting_power:e.Opt(e.Nat64),staked_maturity_e8s_equivalent_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),staked_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),total_voting_power:e.Opt(e.Nat64),potential_voting_power_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64))}),je=e.Record({total_maturity_e8s_equivalent:e.Nat64,not_dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),dissolving_neurons_staked_maturity_e8s_equivalent_sum:e.Nat64,garbage_collectable_neurons_count:e.Nat64,dissolving_neurons_staked_maturity_e8s_equivalent_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),neurons_with_invalid_stake_count:e.Nat64,not_dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),ect_neuron_count:e.Nat64,total_supply_icp:e.Nat64,neurons_with_less_than_6_months_dissolve_delay_count:e.Nat64,dissolved_neurons_count:e.Nat64,community_fund_total_maturity_e8s_equivalent:e.Nat64,total_staked_e8s_seed:e.Nat64,total_staked_maturity_e8s_equivalent_ect:e.Nat64,total_staked_e8s:e.Nat64,fully_lost_voting_power_neuron_subset_metrics:e.Opt(L),not_dissolving_neurons_count:e.Nat64,total_locked_e8s:e.Nat64,neurons_fund_total_active_neurons:e.Nat64,total_voting_power_non_self_authenticating_controller:e.Opt(e.Nat64),total_staked_maturity_e8s_equivalent:e.Nat64,not_dissolving_neurons_e8s_buckets_ect:e.Vec(e.Tuple(e.Nat64,e.Float64)),spawning_neurons_count:e.Nat64,declining_voting_power_neuron_subset_metrics:e.Opt(L),total_staked_e8s_ect:e.Nat64,not_dissolving_neurons_staked_maturity_e8s_equivalent_sum:e.Nat64,dissolved_neurons_e8s:e.Nat64,total_staked_e8s_non_self_authenticating_controller:e.Opt(e.Nat64),dissolving_neurons_e8s_buckets_seed:e.Vec(e.Tuple(e.Nat64,e.Float64)),neurons_with_less_than_6_months_dissolve_delay_e8s:e.Nat64,not_dissolving_neurons_staked_maturity_e8s_equivalent_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),dissolving_neurons_e8s_buckets_ect:e.Vec(e.Tuple(e.Nat64,e.Float64)),non_self_authenticating_controller_neuron_subset_metrics:e.Opt(L),dissolving_neurons_count:e.Nat64,dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),total_staked_maturity_e8s_equivalent_seed:e.Nat64,community_fund_total_staked_e8s:e.Nat64,not_dissolving_neurons_e8s_buckets_seed:e.Vec(e.Tuple(e.Nat64,e.Float64)),public_neuron_subset_metrics:e.Opt(L),timestamp_seconds:e.Nat64,seed_neuron_count:e.Nat64}),sn=e.Record({count:e.Opt(e.Nat64),previous_total_stake_e8s:e.Opt(e.Nat64),current_total_stake_e8s:e.Opt(e.Nat64),group_type:e.Int32}),We=e.Record({groups:e.Vec(sn),timestamp_seconds:e.Opt(e.Nat64)}),ze=e.Record({rounds_since_last_distribution:e.Opt(e.Nat64),day_after_genesis:e.Nat64,actual_timestamp_seconds:e.Nat64,total_available_e8s_equivalent:e.Nat64,latest_round_available_e8s_equivalent:e.Opt(e.Nat64),distributed_e8s_equivalent:e.Nat64,settled_proposals:e.Vec(S)}),$e=e.Record({to_subaccount:e.Vec(e.Nat8),neuron_stake_e8s:e.Nat64,from:e.Opt(e.Principal),memo:e.Nat64,from_subaccount:e.Vec(e.Nat8),transfer_timestamp:e.Nat64,block_height:e.Nat64}),O=e.Record({error_message:e.Text,error_type:e.Int32}),Xe=e.Record({vote:e.Int32,voting_power:e.Nat64}),an=e.Record({min_participant_icp_e8s:e.Opt(e.Nat64),max_participant_icp_e8s:e.Opt(e.Nat64),min_direct_participation_icp_e8s:e.Opt(e.Nat64),max_direct_participation_icp_e8s:e.Opt(e.Nat64)}),cn=e.Record({controller:e.Opt(e.Principal),hotkeys:e.Vec(e.Principal),is_capped:e.Opt(e.Bool),maturity_equivalent_icp_e8s:e.Opt(e.Nat64),nns_neuron_id:e.Opt(o),amount_icp_e8s:e.Opt(e.Nat64)}),ge=e.Record({neurons_fund_neuron_portions:e.Vec(cn)}),un=e.Record({serialized_representation:e.Opt(e.Text)}),ee=e.Record({total_maturity_equivalent_icp_e8s:e.Opt(e.Nat64),intended_neurons_fund_participation_icp_e8s:e.Opt(e.Nat64),direct_participation_icp_e8s:e.Opt(e.Nat64),swap_participation_limits:e.Opt(an),max_neurons_fund_swap_participation_icp_e8s:e.Opt(e.Nat64),neurons_fund_reserves:e.Opt(ge),ideal_matched_participation_function:e.Opt(un),allocated_neurons_fund_participation_icp_e8s:e.Opt(e.Nat64)}),_n=e.Record({final_neurons_fund_participation:e.Opt(ee),initial_neurons_fund_participation:e.Opt(ee),neurons_fund_refunds:e.Opt(ge)}),dn=e.Record({status:e.Opt(e.Int32),freezing_threshold:e.Opt(e.Nat64),controllers:e.Vec(e.Principal),memory_size:e.Opt(e.Nat64),cycles:e.Opt(e.Nat64),idle_cycles_burned_per_day:e.Opt(e.Nat64),module_hash:e.Vec(e.Nat8)}),P=e.Record({status:e.Opt(dn),canister_id:e.Opt(e.Principal)}),pn=e.Record({ledger_index_canister_summary:e.Opt(P),fallback_controller_principal_ids:e.Vec(e.Principal),ledger_archive_canister_summaries:e.Vec(P),ledger_canister_summary:e.Opt(P),swap_canister_summary:e.Opt(P),governance_canister_summary:e.Opt(P),root_canister_summary:e.Opt(P),dapp_canister_summaries:e.Vec(P)}),Je=e.Record({swap_background_information:e.Opt(pn)}),Ye=e.Record({no:e.Nat64,yes:e.Nat64,total:e.Nat64,timestamp_seconds:e.Nat64}),ln=e.Record({current_deadline_timestamp_seconds:e.Nat64}),mn=e.Record({id:e.Opt(S),topic:e.Opt(e.Int32),failure_reason:e.Opt(O),ballots:e.Vec(e.Tuple(e.Nat64,Xe)),proposal_timestamp_seconds:e.Nat64,reward_event_round:e.Nat64,failed_timestamp_seconds:e.Nat64,neurons_fund_data:e.Opt(_n),reject_cost_e8s:e.Nat64,derived_proposal_information:e.Opt(Je),latest_tally:e.Opt(Ye),total_potential_voting_power:e.Opt(e.Nat64),sns_token_swap_lifecycle:e.Opt(e.Int32),decided_timestamp_seconds:e.Nat64,proposal:e.Opt(n),proposer:e.Opt(o),wait_for_quiet_state:e.Opt(ln),executed_timestamp_seconds:e.Nat64,original_total_community_fund_maturity_e8s_equivalent:e.Opt(e.Nat64)}),fn=e.Variant({Spawn:o,Split:d,Configure:de,Merge:pe,DisburseToNeuron:le,SyncCommand:e.Record({}),ClaimOrRefreshNeuron:_e,MergeMaturity:me,Disburse:fe}),Nn=e.Record({command:e.Opt(fn),timestamp:e.Nat64}),Qe=e.Record({vote:e.Int32,proposal_id:e.Opt(S)}),gn=e.Record({account_identifier_to_disburse_to:e.Opt(l),timestamp_of_disbursement_seconds:e.Opt(e.Nat64),amount_e8s:e.Opt(e.Nat64),account_to_disburse_to:e.Opt(p),finalize_disbursement_timestamp_seconds:e.Opt(e.Nat64)}),wn=e.Variant({DissolveDelaySeconds:e.Nat64,WhenDissolvedTimestampSeconds:e.Nat64}),q=e.Record({id:e.Opt(o),staked_maturity_e8s_equivalent:e.Opt(e.Nat64),controller:e.Opt(e.Principal),recent_ballots:e.Vec(Qe),voting_power_refreshed_timestamp_seconds:e.Opt(e.Nat64),kyc_verified:e.Bool,potential_voting_power:e.Opt(e.Nat64),neuron_type:e.Opt(e.Int32),not_for_profit:e.Bool,maturity_e8s_equivalent:e.Nat64,deciding_voting_power:e.Opt(e.Nat64),cached_neuron_stake_e8s:e.Nat64,created_timestamp_seconds:e.Nat64,auto_stake_maturity:e.Opt(e.Bool),aging_since_timestamp_seconds:e.Nat64,hot_keys:e.Vec(e.Principal),account:e.Vec(e.Nat8),joined_community_fund_timestamp_seconds:e.Opt(e.Nat64),maturity_disbursements_in_progress:e.Opt(e.Vec(gn)),dissolve_state:e.Opt(wn),followees:e.Vec(e.Tuple(e.Int32,r)),neuron_fees_e8s:e.Nat64,visibility:e.Opt(e.Int32),transfer:e.Opt($e),known_neuron_data:e.Opt(i),spawn_at_timestamp_seconds:e.Opt(e.Nat64)}),pi=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,r)),making_sns_proposal:e.Opt(rn),most_recent_monthly_node_provider_rewards:e.Opt(D),maturity_modulation_last_updated_at_timestamp_seconds:e.Opt(e.Nat64),wait_for_quiet_threshold_seconds:e.Nat64,metrics:e.Opt(je),neuron_management_voting_period_seconds:e.Opt(e.Nat64),node_providers:e.Vec(k),cached_daily_maturity_modulation_basis_points:e.Opt(e.Int32),economics:e.Opt(I),restore_aging_summary:e.Opt(We),spawning_neurons:e.Opt(e.Bool),latest_reward_event:e.Opt(ze),to_claim_transfers:e.Vec($e),short_voting_period_seconds:e.Nat64,proposals:e.Vec(e.Tuple(e.Nat64,mn)),xdr_conversion_rate:e.Opt(He),in_flight_commands:e.Vec(e.Tuple(e.Nat64,Nn)),neurons:e.Vec(e.Tuple(e.Nat64,q)),genesis_timestamp_seconds:e.Nat64}),te=e.Variant({Ok:e.Null,Err:O}),yn=e.Variant({Error:O,NeuronId:o}),On=e.Record({result:e.Opt(yn)}),Ze=e.Variant({Ok:q,Err:O}),Rn=e.Variant({Ok:je,Err:O}),hn=e.Variant({Ok:D,Err:O}),ne=e.Record({dissolve_delay_seconds:e.Nat64,recent_ballots:e.Vec(Qe),voting_power_refreshed_timestamp_seconds:e.Opt(e.Nat64),potential_voting_power:e.Opt(e.Nat64),neuron_type:e.Opt(e.Int32),deciding_voting_power:e.Opt(e.Nat64),created_timestamp_seconds:e.Nat64,state:e.Int32,stake_e8s:e.Nat64,joined_community_fund_timestamp_seconds:e.Opt(e.Nat64),retrieved_at_timestamp_seconds:e.Nat64,visibility:e.Opt(e.Int32),known_neuron_data:e.Opt(i),voting_power:e.Nat64,age_seconds:e.Nat64}),Ie=e.Variant({Ok:ne,Err:O}),vn=e.Record({nns_proposal_id:e.Opt(S)}),bn=e.Record({final_neurons_fund_participation:e.Opt(ee),initial_neurons_fund_participation:e.Opt(ee),neurons_fund_refunds:e.Opt(ge)}),xn=e.Record({neurons_fund_audit_info:e.Opt(bn)}),Sn=e.Variant({Ok:xn,Err:O}),kn=e.Record({result:e.Opt(Sn)}),Pn=e.Variant({Ok:k,Err:O}),we=e.Record({id:e.Opt(S),status:e.Int32,topic:e.Int32,failure_reason:e.Opt(O),ballots:e.Vec(e.Tuple(e.Nat64,Xe)),proposal_timestamp_seconds:e.Nat64,reward_event_round:e.Nat64,deadline_timestamp_seconds:e.Opt(e.Nat64),failed_timestamp_seconds:e.Nat64,reject_cost_e8s:e.Nat64,derived_proposal_information:e.Opt(Je),latest_tally:e.Opt(Ye),total_potential_voting_power:e.Opt(e.Nat64),reward_status:e.Int32,decided_timestamp_seconds:e.Nat64,proposal:e.Opt(n),proposer:e.Opt(o),executed_timestamp_seconds:e.Nat64}),Tn=e.Record({known_neurons:e.Vec(s)}),Cn=e.Record({subaccount:e.Vec(e.Nat8)}),Vn=e.Record({page_size:e.Opt(e.Nat64),include_public_neurons_in_full_neurons:e.Opt(e.Bool),neuron_ids:e.Vec(e.Nat64),page_number:e.Opt(e.Nat64),include_empty_neurons_readable_by_caller:e.Opt(e.Bool),neuron_subaccounts:e.Opt(e.Vec(Cn)),include_neurons_readable_by_caller:e.Bool}),Mn=e.Record({neuron_infos:e.Vec(e.Tuple(e.Nat64,ne)),full_neurons:e.Vec(q),total_pages_available:e.Opt(e.Nat64)}),An=e.Record({start_timestamp_seconds:e.Opt(e.Nat64),end_timestamp_seconds:e.Opt(e.Nat64)}),En=e.Record({date_filter:e.Opt(An)}),Fn=e.Record({rewards:e.Vec(D)}),Bn=e.Record({node_providers:e.Vec(k)}),qn=e.Record({include_reward_status:e.Vec(e.Int32),omit_large_fields:e.Opt(e.Bool),before_proposal:e.Opt(S),limit:e.Nat32,exclude_topic:e.Vec(e.Int32),include_all_manage_neuron_proposals:e.Opt(e.Bool),include_status:e.Vec(e.Int32)}),Un=e.Record({proposal_info:e.Vec(we)}),Gn=e.Record({arg:e.Opt(e.Vec(e.Nat8)),wasm_module:e.Opt(e.Vec(e.Nat8)),skip_stopping_before_installing:e.Opt(e.Bool),canister_id:e.Opt(e.Principal),install_mode:e.Opt(e.Int32)}),Kn=e.Variant({RegisterKnownNeuron:s,ManageNeuron:t,UpdateCanisterSettings:Me,InstallCode:Gn,StopOrStartCanister:Ae,CreateServiceNervousSystem:Be,ExecuteNnsFunction:qe,RewardNodeProvider:Q,RewardNodeProviders:Ue,ManageNetworkEconomics:I,ApproveGenesisKyc:Ne,AddOrRemoveNodeProvider:Ge,Motion:Ke}),Hn=e.Record({url:e.Text,title:e.Opt(e.Text),action:e.Opt(Kn),summary:e.Text}),jn=e.Variant({Spawn:_,Split:d,Follow:m,DisburseMaturity:w,RefreshVotingPower:g,ClaimOrRefresh:_e,Configure:de,RegisterVote:Te,Merge:pe,DisburseToNeuron:le,SetFollowing:Ce,MakeProposal:Hn,StakeMaturity:Ve,MergeMaturity:me,Disburse:fe});t.fill(e.Record({id:e.Opt(o),command:e.Opt(jn),neuron_id_or_subaccount:e.Opt(Y)}));let ye=e.Record({created_neuron_id:e.Opt(o)}),Wn=e.Record({amount_disbursed_e8s:e.Opt(e.Nat64)}),zn=e.Record({}),$n=e.Record({refreshed_neuron_id:e.Opt(o)}),Xn=e.Record({target_neuron:e.Opt(q),source_neuron:e.Opt(q),target_neuron_info:e.Opt(ne),source_neuron_info:e.Opt(ne)}),Jn=e.Record({}),Yn=e.Record({message:e.Opt(e.Text),proposal_id:e.Opt(S)}),Qn=e.Record({maturity_e8s:e.Nat64,staked_maturity_e8s:e.Nat64}),Zn=e.Record({merged_maturity_e8s:e.Nat64,new_stake_e8s:e.Nat64}),In=e.Record({transfer_block_height:e.Nat64}),Dn=e.Variant({Error:O,Spawn:ye,Split:ye,Follow:e.Record({}),DisburseMaturity:Wn,RefreshVotingPower:zn,ClaimOrRefresh:$n,Configure:e.Record({}),RegisterVote:e.Record({}),Merge:Xn,DisburseToNeuron:ye,SetFollowing:Jn,MakeProposal:Yn,StakeMaturity:Qn,MergeMaturity:Zn,Disburse:In}),De=e.Record({command:e.Opt(Dn)}),Ln=e.Record({total_direct_contribution_icp_e8s:e.Opt(e.Nat64),total_neurons_fund_contribution_icp_e8s:e.Opt(e.Nat64),sns_governance_canister_id:e.Opt(e.Principal)}),eo=e.Variant({Committed:Ln,Aborted:e.Record({})}),to=e.Record({result:e.Opt(eo),open_sns_token_swap_proposal_id:e.Opt(e.Nat64)}),no=e.Record({total_direct_participation_icp_e8s:e.Opt(e.Nat64),total_neurons_fund_participation_icp_e8s:e.Opt(e.Nat64),sns_governance_canister_id:e.Opt(e.Principal)}),oo=e.Variant({Committed:no,Aborted:e.Record({})}),ro=e.Record({result:e.Opt(oo),nns_proposal_id:e.Opt(e.Nat64)}),io=e.Record({controller:e.Opt(e.Principal),hotkeys:e.Opt(Ne),is_capped:e.Opt(e.Bool),nns_neuron_id:e.Opt(e.Nat64),amount_icp_e8s:e.Opt(e.Nat64)}),so=e.Record({neurons_fund_neuron_portions:e.Vec(io)}),ao=e.Variant({Ok:so,Err:O}),co=e.Record({result:e.Opt(ao)}),uo=e.Record({reward_account:e.Opt(l)});return e.Service({claim_gtc_neurons:e.Func([e.Principal,e.Vec(o)],[te],[]),claim_or_refresh_neuron_from_account:e.Func([A],[On],[]),get_build_metadata:e.Func([],[e.Text],[]),get_full_neuron:e.Func([e.Nat64],[Ze],[]),get_full_neuron_by_id_or_subaccount:e.Func([Y],[Ze],[]),get_latest_reward_event:e.Func([],[ze],[]),get_metrics:e.Func([],[Rn],[]),get_monthly_node_provider_rewards:e.Func([],[hn],[]),get_most_recent_monthly_node_provider_rewards:e.Func([],[e.Opt(D)],[]),get_network_economics_parameters:e.Func([],[I],[]),get_neuron_ids:e.Func([],[e.Vec(e.Nat64)],[]),get_neuron_info:e.Func([e.Nat64],[Ie],[]),get_neuron_info_by_id_or_subaccount:e.Func([Y],[Ie],[]),get_neurons_fund_audit_info:e.Func([vn],[kn],[]),get_node_provider_by_caller:e.Func([e.Null],[Pn],[]),get_pending_proposals:e.Func([],[e.V