@dfinity/nns 5.1.2 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -35
- package/dist/candid/genesis_token.did +1 -1
- package/dist/candid/governance.certified.idl.js +70 -13
- package/dist/candid/governance.d.ts +26 -5
- package/dist/candid/governance.did +25 -4
- package/dist/candid/governance.idl.js +70 -13
- package/dist/candid/governance_test.certified.idl.js +70 -13
- package/dist/candid/governance_test.d.ts +26 -5
- package/dist/candid/governance_test.did +25 -4
- package/dist/candid/governance_test.idl.js +70 -13
- package/dist/candid/old_list_neurons_service.certified.idl.d.ts +2 -0
- package/dist/candid/old_list_neurons_service.certified.idl.js +78 -0
- package/dist/candid/sns_wasm.did +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/index.cjs.js.map +4 -4
- package/dist/esm/chunk-ZSTGGZGS.js +19 -0
- package/dist/esm/chunk-ZSTGGZGS.js.map +7 -0
- package/dist/esm/governance.canister.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +3 -3
- package/dist/types/canisters/governance/request.converters.d.ts +4 -1
- package/dist/types/canisters/governance/response.converters.d.ts +8 -1
- package/dist/types/enums/governance.enums.d.ts +3 -1
- package/dist/types/governance.canister.d.ts +4 -1
- package/dist/types/governance_test.canister.d.ts +2 -1
- package/dist/types/types/governance.options.d.ts +2 -0
- package/package.json +6 -6
- package/dist/esm/chunk-AN6DZS5M.js +0 -19
- package/dist/esm/chunk-AN6DZS5M.js.map +0 -7
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{a as Ke,b as Gr,c as yo}from"./chunk-KCY3PAEP.js";var ko=Ke(Ye=>{"use strict";Ye.byteLength=Xr;Ye.toByteArray=zr;Ye.fromByteArray=Zr;var M=[],T=[],$r=typeof Uint8Array<"u"?Uint8Array:Array,Yn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(_e=0,xo=Yn.length;_e<xo;++_e)M[_e]=Yn[_e],T[Yn.charCodeAt(_e)]=_e;var _e,xo;T[45]=62;T[95]=63;function bo(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 Xr(e){var t=bo(e),n=t[0],o=t[1];return(n+o)*3/4-o}function Jr(e,t,n){return(t+n)*3/4-n}function zr(e){var t,n=bo(e),o=n[0],r=n[1],i=new $r(Jr(e,o,r)),s=0,c=r>0?o-4:o,u;for(u=0;u<c;u+=4)t=T[e.charCodeAt(u)]<<18|T[e.charCodeAt(u+1)]<<12|T[e.charCodeAt(u+2)]<<6|T[e.charCodeAt(u+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=t&255;return r===2&&(t=T[e.charCodeAt(u)]<<2|T[e.charCodeAt(u+1)]>>4,i[s++]=t&255),r===1&&(t=T[e.charCodeAt(u)]<<10|T[e.charCodeAt(u+1)]<<4|T[e.charCodeAt(u+2)]>>2,i[s++]=t>>8&255,i[s++]=t&255),i}function Yr(e){return M[e>>18&63]+M[e>>12&63]+M[e>>6&63]+M[e&63]}function Qr(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(Yr(o));return r.join("")}function Zr(e){for(var t,n=e.length,o=n%3,r=[],i=16383,s=0,c=n-o;s<c;s+=i)r.push(Qr(e,s,s+i>c?c:s+i));return o===1?(t=e[n-1],r.push(M[t>>2]+M[t<<4&63]+"==")):o===2&&(t=(e[n-2]<<8)+e[n-1],r.push(M[t>>10]+M[t>>4&63]+M[t<<2&63]+"=")),r.join("")}});var So=Ke(Qn=>{Qn.read=function(e,t,n,o,r){var i,s,c=r*8-o-1,u=(1<<c)-1,l=u>>1,p=-7,_=n?r-1:0,N=n?-1:1,w=e[t+_];for(_+=N,i=w&(1<<-p)-1,w>>=-p,p+=c;p>0;i=i*256+e[t+_],_+=N,p-=8);for(s=i&(1<<-p)-1,i>>=-p,p+=o;p>0;s=s*256+e[t+_],_+=N,p-=8);if(i===0)i=1-l;else{if(i===u)return s?NaN:(w?-1:1)*(1/0);s=s+Math.pow(2,o),i=i-l}return(w?-1:1)*s*Math.pow(2,i-o)};Qn.write=function(e,t,n,o,r,i){var s,c,u,l=i*8-r-1,p=(1<<l)-1,_=p>>1,N=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=o?0:i-1,V=o?1:-1,K=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,s=p):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+_>=1?t+=N/u:t+=N*Math.pow(2,1-_),t*u>=2&&(s++,u/=2),s+_>=p?(c=0,s=p):s+_>=1?(c=(t*u-1)*Math.pow(2,r),s=s+_):(c=t*Math.pow(2,_-1)*Math.pow(2,r),s=0));r>=8;e[n+w]=c&255,w+=V,c/=256,r-=8);for(s=s<<r|c,l+=r;l>0;e[n+w]=s&255,w+=V,s/=256,l-=8);e[n+w-V]|=K*128}});var $o=Ke(fe=>{"use strict";var Zn=ko(),le=So(),To=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;fe.Buffer=a;fe.SlowBuffer=ni;fe.INSPECT_MAX_BYTES=50;var Qe=2147483647;fe.kMaxLength=Qe;a.TYPED_ARRAY_SUPPORT=Ir();!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 Ir(){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 J(e){if(e>Qe)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 eo(e)}return Ao(e,t,n)}a.poolSize=8192;function Ao(e,t,n){if(typeof e=="string")return Lr(e,t);if(ArrayBuffer.isView(e))return ei(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(B(e,ArrayBuffer)||e&&B(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(B(e,SharedArrayBuffer)||e&&B(e.buffer,SharedArrayBuffer)))return Dn(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 Ao(e,t,n)};Object.setPrototypeOf(a.prototype,Uint8Array.prototype);Object.setPrototypeOf(a,Uint8Array);function Vo(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 Dr(e,t,n){return Vo(e),e<=0?J(e):t!==void 0?typeof n=="string"?J(e).fill(t,n):J(e).fill(t):J(e)}a.alloc=function(e,t,n){return Dr(e,t,n)};function eo(e){return Vo(e),J(e<0?0:to(e)|0)}a.allocUnsafe=function(e){return eo(e)};a.allocUnsafeSlow=function(e){return eo(e)};function Lr(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let n=Mo(e,t)|0,o=J(n),r=o.write(e,t);return r!==n&&(o=o.slice(0,r)),o}function In(e){let t=e.length<0?0:to(e.length)|0,n=J(t);for(let o=0;o<t;o+=1)n[o]=e[o]&255;return n}function ei(e){if(B(e,Uint8Array)){let t=new Uint8Array(e);return Dn(t.buffer,t.byteOffset,t.byteLength)}return In(e)}function Dn(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=to(e.length)|0,n=J(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!="number"||oo(e.length)?J(0):In(e);if(e.type==="Buffer"&&Array.isArray(e.data))return In(e.data)}function to(e){if(e>=Qe)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Qe.toString(16)+" bytes");return e|0}function ni(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(B(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),B(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(B(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 Mo(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||B(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 Ln(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Wo(e).length;default:if(r)return o?-1:Ln(e).length;t=(""+t).toLowerCase(),r=!0}}a.byteLength=Mo;function oi(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 li(this,t,n);case"utf8":case"utf-8":return Eo(this,t,n);case"ascii":return di(this,t,n);case"latin1":case"binary":return pi(this,t,n);case"base64":return ui(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return mi(this,t,n);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}a.prototype._isBuffer=!0;function de(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)de(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)de(this,n,n+3),de(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)de(this,n,n+7),de(this,n+1,n+6),de(this,n+2,n+5),de(this,n+3,n+4);return this};a.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?Eo(this,0,t):oi.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=fe.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"};To&&(a.prototype[To]=a.prototype.inspect);a.prototype.compare=function(t,n,o,r,i){if(B(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,c=o-n,u=Math.min(s,c),l=this.slice(r,i),p=t.slice(n,o);for(let _=0;_<u;++_)if(l[_]!==p[_]){s=l[_],c=p[_];break}return s<c?-1:c<s?1:0};function Bo(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,oo(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:Fo(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):Fo(e,[t],n,o,r);throw new TypeError("val must be string, number or Buffer")}function Fo(e,t,n,o,r){let i=1,s=e.length,c=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,c/=2,n/=2}function u(p,_){return i===1?p[_]:p.readUInt16BE(_*i)}let l;if(r){let p=-1;for(l=n;l<s;l++)if(u(e,l)===u(t,p===-1?0:l-p)){if(p===-1&&(p=l),l-p+1===c)return p*i}else p!==-1&&(l-=l-p),p=-1}else for(n+c>s&&(n=s-c),l=n;l>=0;l--){let p=!0;for(let _=0;_<c;_++)if(u(e,l+_)!==u(t,_)){p=!1;break}if(p)return l}return-1}a.prototype.includes=function(t,n,o){return this.indexOf(t,n,o)!==-1};a.prototype.indexOf=function(t,n,o){return Bo(this,t,n,o,!0)};a.prototype.lastIndexOf=function(t,n,o){return Bo(this,t,n,o,!1)};function ri(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 c=parseInt(t.substr(s*2,2),16);if(oo(c))return s;e[n+s]=c}return s}function ii(e,t,n,o){return Ze(Ln(t,e.length-n),e,n,o)}function si(e,t,n,o){return Ze(yi(t),e,n,o)}function ai(e,t,n,o){return Ze(Wo(t),e,n,o)}function ci(e,t,n,o){return Ze(Ri(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 ri(this,t,n,o);case"utf8":case"utf-8":return ii(this,t,n,o);case"ascii":case"latin1":case"binary":return si(this,t,n,o);case"base64":return ai(this,t,n,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ci(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 ui(e,t,n){return t===0&&n===e.length?Zn.fromByteArray(e):Zn.fromByteArray(e.slice(t,n))}function Eo(e,t,n){n=Math.min(e.length,n);let o=[],r=t;for(;r<n;){let i=e[r],s=null,c=i>239?4:i>223?3:i>191?2:1;if(r+c<=n){let u,l,p,_;switch(c){case 1:i<128&&(s=i);break;case 2:u=e[r+1],(u&192)===128&&(_=(i&31)<<6|u&63,_>127&&(s=_));break;case 3:u=e[r+1],l=e[r+2],(u&192)===128&&(l&192)===128&&(_=(i&15)<<12|(u&63)<<6|l&63,_>2047&&(_<55296||_>57343)&&(s=_));break;case 4:u=e[r+1],l=e[r+2],p=e[r+3],(u&192)===128&&(l&192)===128&&(p&192)===128&&(_=(i&15)<<18|(u&63)<<12|(l&63)<<6|p&63,_>65535&&_<1114112&&(s=_))}}s===null?(s=65533,c=1):s>65535&&(s-=65536,o.push(s>>>10&1023|55296),s=56320|s&1023),o.push(s),r+=c}return _i(o)}var Po=4096;function _i(e){let t=e.length;if(t<=Po)return String.fromCharCode.apply(String,e);let n="",o=0;for(;o<t;)n+=String.fromCharCode.apply(String,e.slice(o,o+=Po));return n}function di(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 pi(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 li(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+=gi[e[i]];return r}function mi(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 R(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||R(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||R(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||R(t,1,this.length),this[t]};a.prototype.readUint16LE=a.prototype.readUInt16LE=function(t,n){return t=t>>>0,n||R(t,2,this.length),this[t]|this[t+1]<<8};a.prototype.readUint16BE=a.prototype.readUInt16BE=function(t,n){return t=t>>>0,n||R(t,2,this.length),this[t]<<8|this[t+1]};a.prototype.readUint32LE=a.prototype.readUInt32LE=function(t,n){return t=t>>>0,n||R(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||R(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};a.prototype.readBigUInt64LE=I(function(t){t=t>>>0,me(t,"offset");let n=this[t],o=this[t+7];(n===void 0||o===void 0)&&He(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=I(function(t){t=t>>>0,me(t,"offset");let n=this[t],o=this[t+7];(n===void 0||o===void 0)&&He(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||R(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||R(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||R(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};a.prototype.readInt16LE=function(t,n){t=t>>>0,n||R(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||R(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||R(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||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};a.prototype.readBigInt64LE=I(function(t){t=t>>>0,me(t,"offset");let n=this[t],o=this[t+7];(n===void 0||o===void 0)&&He(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=I(function(t){t=t>>>0,me(t,"offset");let n=this[t],o=this[t+7];(n===void 0||o===void 0)&&He(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||R(t,4,this.length),le.read(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,n){return t=t>>>0,n||R(t,4,this.length),le.read(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,n){return t=t>>>0,n||R(t,8,this.length),le.read(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,n){return t=t>>>0,n||R(t,8,this.length),le.read(this,t,!1,52,8)};function x(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 c=Math.pow(2,8*o)-1;x(this,t,n,o,c,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 c=Math.pow(2,8*o)-1;x(this,t,n,o,c,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||x(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||x(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||x(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||x(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||x(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 qo(e,t,n,o,r){jo(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 Uo(e,t,n,o,r){jo(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=I(function(t,n=0){return qo(this,t,n,BigInt(0),BigInt("0xffffffffffffffff"))});a.prototype.writeBigUInt64BE=I(function(t,n=0){return Uo(this,t,n,BigInt(0),BigInt("0xffffffffffffffff"))});a.prototype.writeIntLE=function(t,n,o,r){if(t=+t,n=n>>>0,!r){let u=Math.pow(2,8*o-1);x(this,t,n,o,u-1,-u)}let i=0,s=1,c=0;for(this[n]=t&255;++i<o&&(s*=256);)t<0&&c===0&&this[n+i-1]!==0&&(c=1),this[n+i]=(t/s>>0)-c&255;return n+o};a.prototype.writeIntBE=function(t,n,o,r){if(t=+t,n=n>>>0,!r){let u=Math.pow(2,8*o-1);x(this,t,n,o,u-1,-u)}let i=o-1,s=1,c=0;for(this[n+i]=t&255;--i>=0&&(s*=256);)t<0&&c===0&&this[n+i+1]!==0&&(c=1),this[n+i]=(t/s>>0)-c&255;return n+o};a.prototype.writeInt8=function(t,n,o){return t=+t,n=n>>>0,o||x(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||x(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||x(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||x(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||x(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=I(function(t,n=0){return qo(this,t,n,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});a.prototype.writeBigInt64BE=I(function(t,n=0){return Uo(this,t,n,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Go(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 Ko(e,t,n,o,r){return t=+t,n=n>>>0,r||Go(e,t,n,4,34028234663852886e22,-34028234663852886e22),le.write(e,t,n,o,23,4),n+4}a.prototype.writeFloatLE=function(t,n,o){return Ko(this,t,n,!0,o)};a.prototype.writeFloatBE=function(t,n,o){return Ko(this,t,n,!1,o)};function Ho(e,t,n,o,r){return t=+t,n=n>>>0,r||Go(e,t,n,8,17976931348623157e292,-17976931348623157e292),le.write(e,t,n,o,52,8),n+8}a.prototype.writeDoubleLE=function(t,n,o){return Ho(this,t,n,!0,o)};a.prototype.writeDoubleBE=function(t,n,o){return Ho(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),c=s.length;if(c===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<o-n;++i)this[i+n]=s[i%c]}return this};var pe={};function no(e,t,n){pe[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}`}}}no("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);no("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError);no("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=Co(String(n)):typeof n=="bigint"&&(r=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(r=Co(r)),r+="n"),o+=` It must be ${t}. Received ${r}`,o},RangeError);function Co(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 fi(e,t,n){me(t,"offset"),(e[t]===void 0||e[t+n]===void 0)&&He(t,e.length-(n+1))}function jo(e,t,n,o,r,i){if(e>n||e<t){let s=typeof t=="bigint"?"n":"",c;throw i>3?t===0||t===BigInt(0)?c=`>= 0${s} and < 2${s} ** ${(i+1)*8}${s}`:c=`>= -(2${s} ** ${(i+1)*8-1}${s}) and < 2 ** ${(i+1)*8-1}${s}`:c=`>= ${t}${s} and <= ${n}${s}`,new pe.ERR_OUT_OF_RANGE("value",c,e)}fi(o,r,i)}function me(e,t){if(typeof e!="number")throw new pe.ERR_INVALID_ARG_TYPE(t,"number",e)}function He(e,t,n){throw Math.floor(e)!==e?(me(e,n),new pe.ERR_OUT_OF_RANGE(n||"offset","an integer",e)):t<0?new pe.ERR_BUFFER_OUT_OF_BOUNDS:new pe.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}var Ni=/[^+/0-9A-Za-z-_]/g;function wi(e){if(e=e.split("=")[0],e=e.trim().replace(Ni,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Ln(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 yi(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function Ri(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 Wo(e){return Zn.toByteArray(wi(e))}function Ze(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 B(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function oo(e){return e!==e}var gi=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 I(e){return typeof BigInt>"u"?Oi:e}function Oi(){throw new Error("BigInt not supported")}});var zo=Ke((ro,Jo)=>{var Ie=$o(),z=Ie.Buffer;function Xo(e,t){for(var n in e)t[n]=e[n]}z.from&&z.alloc&&z.allocUnsafe&&z.allocUnsafeSlow?Jo.exports=Ie:(Xo(Ie,ro),ro.Buffer=Ne);function Ne(e,t,n){return z(e,t,n)}Xo(z,Ne);Ne.from=function(e,t,n){if(typeof e=="number")throw new TypeError("Argument must not be a number");return z(e,t,n)};Ne.alloc=function(e,t,n){if(typeof e!="number")throw new TypeError("Argument must be a number");var o=z(e);return t!==void 0?typeof n=="string"?o.fill(t,n):o.fill(t):o.fill(0),o};Ne.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return z(e)};Ne.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Ie.SlowBuffer(e)}});var Yo=Ke((Hs,so)=>{"use strict";var io=65536,hi=4294967295;function vi(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
2
|
+
Use Chrome, Firefox or Internet Explorer 11`)}var xi=zo().Buffer,De=window.crypto||window.msCrypto;De&&De.getRandomValues?so.exports=bi:so.exports=vi;function bi(e,t){if(e>hi)throw new RangeError("requested too many random bytes");var n=xi.allocUnsafe(e);if(e>0)if(e>io)for(var o=0;o<e;o+=io)De.getRandomValues(n.slice(o,o+io));else De.getRandomValues(n);return typeof t=="function"?process.nextTick(function(){t(null,n)}):n}});import{Actor as Os}from"@dfinity/agent";import{AccountIdentifier as fo,SubAccount as hs,checkAccountId as Br}from"@dfinity/ledger-icp";import{arrayOfNumberToUint8Array as vs,asciiStringToByteArray as xs,assertPercentageNumber as No,createServices as bs,fromNullable as b,isNullish as st,nonNullish as G,uint8ArrayToBigInt as Er}from"@dfinity/utils";function Kr(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function $n(e,...t){if(!Kr(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function Xn(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Ro(e,t){$n(e);let n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}var Je=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),A=(e,t)=>e<<32-t|e>>>t;var Ts=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Hr(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Jn(e){return typeof e=="string"&&(e=Hr(e)),$n(e),e}var Xe=class{clone(){return this._cloneInto()}},Fs={}.toString;function go(e){let t=o=>e().update(Jn(o)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function jr(e,t,n,o){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,o);let r=BigInt(32),i=BigInt(4294967295),s=Number(n>>r&i),c=Number(n&i),u=o?4:0,l=o?0:4;e.setUint32(t+u,s,o),e.setUint32(t+l,c,o)}var Oo=(e,t,n)=>e&t^~e&n,ho=(e,t,n)=>e&t^e&n^t&n,ze=class extends Xe{constructor(t,n,o,r){super(),this.blockLen=t,this.outputLen=n,this.padOffset=o,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Je(this.buffer)}update(t){Xn(this);let{view:n,buffer:o,blockLen:r}=this;t=Jn(t);let i=t.length;for(let s=0;s<i;){let c=Math.min(r-this.pos,i-s);if(c===r){let u=Je(t);for(;r<=i-s;s+=r)this.process(u,s);continue}o.set(t.subarray(s,s+c),this.pos),this.pos+=c,s+=c,this.pos===r&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Xn(this),Ro(t,this),this.finished=!0;let{buffer:n,view:o,blockLen:r,isLE:i}=this,{pos:s}=this;n[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>r-s&&(this.process(o,0),s=0);for(let _=s;_<r;_++)n[_]=0;jr(o,r-8,BigInt(this.length*8),i),this.process(o,0);let c=Je(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let l=u/4,p=this.get();if(l>p.length)throw new Error("_sha2: outputLen bigger than state");for(let _=0;_<l;_++)c.setUint32(4*_,p[_],i)}digest(){let{buffer:t,outputLen:n}=this;this.digestInto(t);let o=t.slice(0,n);return this.destroy(),o}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:n,buffer:o,length:r,finished:i,destroyed:s,pos:c}=this;return t.length=r,t.pos=c,t.finished=i,t.destroyed=s,r%n&&t.buffer.set(o),t}};var Wr=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Q=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Z=new Uint32Array(64),zn=class extends ze{constructor(){super(64,32,8,!1),this.A=Q[0]|0,this.B=Q[1]|0,this.C=Q[2]|0,this.D=Q[3]|0,this.E=Q[4]|0,this.F=Q[5]|0,this.G=Q[6]|0,this.H=Q[7]|0}get(){let{A:t,B:n,C:o,D:r,E:i,F:s,G:c,H:u}=this;return[t,n,o,r,i,s,c,u]}set(t,n,o,r,i,s,c,u){this.A=t|0,this.B=n|0,this.C=o|0,this.D=r|0,this.E=i|0,this.F=s|0,this.G=c|0,this.H=u|0}process(t,n){for(let _=0;_<16;_++,n+=4)Z[_]=t.getUint32(n,!1);for(let _=16;_<64;_++){let N=Z[_-15],w=Z[_-2],V=A(N,7)^A(N,18)^N>>>3,K=A(w,17)^A(w,19)^w>>>10;Z[_]=K+Z[_-7]+V+Z[_-16]|0}let{A:o,B:r,C:i,D:s,E:c,F:u,G:l,H:p}=this;for(let _=0;_<64;_++){let N=A(c,6)^A(c,11)^A(c,25),w=p+N+Oo(c,u,l)+Wr[_]+Z[_]|0,K=(A(o,2)^A(o,13)^A(o,22))+ho(o,r,i)|0;p=l,l=u,u=c,c=s+w|0,s=i,i=r,r=o,o=w+K|0}o=o+this.A|0,r=r+this.B|0,i=i+this.C|0,s=s+this.D|0,c=c+this.E|0,u=u+this.F|0,l=l+this.G|0,p=p+this.H|0,this.set(o,r,i,s,c,u,l,p)}roundClean(){Z.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var vo=go(()=>new zn);var wo=Gr(Yo());var Qo=({IDL:e})=>{let t=e.Rec(),n=e.Record({id:e.Nat64}),o=e.Record({followees:e.Vec(n)}),r=e.Record({name:e.Text,description:e.Opt(e.Text)}),i=e.Record({id:e.Opt(n),known_neuron_data:e.Opt(r)}),s=e.Record({percentage_to_spawn:e.Opt(e.Nat32),new_controller:e.Opt(e.Principal),nonce:e.Opt(e.Nat64)}),c=e.Record({amount_e8s:e.Nat64}),u=e.Record({topic:e.Int32,followees:e.Vec(n)}),l=e.Record({controller:e.Opt(e.Principal),memo:e.Nat64}),p=e.Variant({NeuronIdOrSubaccount:e.Record({}),MemoAndController:l,Memo:e.Nat64}),_=e.Record({by:e.Opt(p)}),N=e.Record({hot_key_to_remove:e.Opt(e.Principal)}),w=e.Record({new_hot_key:e.Opt(e.Principal)}),V=e.Record({requested_setting_for_auto_stake_maturity:e.Bool}),K=e.Record({additional_dissolve_delay_seconds:e.Nat32}),at=e.Record({dissolve_timestamp_seconds:e.Nat64}),ct=e.Variant({RemoveHotKey:N,AddHotKey:w,ChangeAutoStakeMaturity:V,StopDissolving:e.Record({}),StartDissolving:e.Record({}),IncreaseDissolveDelay:K,JoinCommunityFund:e.Record({}),LeaveCommunityFund:e.Record({}),SetDissolveTimestamp:at}),ye=e.Record({operation:e.Opt(ct)}),ut=e.Record({vote:e.Int32,proposal:e.Opt(n)}),Re=e.Record({source_neuron_id:e.Opt(n)}),ge=e.Record({dissolve_delay_seconds:e.Nat64,kyc_verified:e.Bool,amount_e8s:e.Nat64,new_controller:e.Opt(e.Principal),nonce:e.Nat64}),_t=e.Record({percentage_to_stake:e.Opt(e.Nat32)}),Oe=e.Record({percentage_to_merge:e.Nat32}),H=e.Record({hash:e.Vec(e.Nat8)}),dt=e.Record({e8s:e.Nat64}),he=e.Record({to_account:e.Opt(H),amount:e.Opt(dt)}),pt=e.Variant({Spawn:s,Split:c,Follow:u,ClaimOrRefresh:_,Configure:ye,RegisterVote:ut,Merge:Re,DisburseToNeuron:ge,MakeProposal:t,StakeMaturity:_t,MergeMaturity:Oe,Disburse:he}),oe=e.Variant({Subaccount:e.Vec(e.Nat8),NeuronId:n}),re=e.Record({id:e.Opt(n),command:e.Opt(pt),neuron_id_or_subaccount:e.Opt(oe)}),k=e.Record({basis_points:e.Opt(e.Nat64)}),y=e.Record({seconds:e.Opt(e.Nat64)}),m=e.Record({e8s:e.Opt(e.Nat64)}),lt=e.Record({reward_rate_transition_duration:e.Opt(y),initial_reward_rate:e.Opt(k),final_reward_rate:e.Opt(k)}),mt=e.Record({neuron_maximum_dissolve_delay_bonus:e.Opt(k),neuron_maximum_age_for_age_bonus:e.Opt(y),neuron_maximum_dissolve_delay:e.Opt(y),neuron_minimum_dissolve_delay_to_vote:e.Opt(y),neuron_maximum_age_bonus:e.Opt(k),neuron_minimum_stake:e.Opt(m),proposal_wait_for_quiet_deadline_increase:e.Opt(y),proposal_initial_voting_period:e.Opt(y),proposal_rejection_fee:e.Opt(m),voting_reward_parameters:e.Opt(lt)}),ve=e.Record({base64_encoding:e.Opt(e.Text)}),ft=e.Record({transaction_fee:e.Opt(m),token_symbol:e.Opt(e.Text),token_logo:e.Opt(ve),token_name:e.Opt(e.Text)}),Nt=e.Record({id:e.Opt(e.Principal)}),wt=e.Record({dissolve_delay_interval:e.Opt(y),count:e.Opt(e.Nat64)}),yt=e.Record({seconds_after_utc_midnight:e.Opt(e.Nat64)}),Rt=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(y),neuron_basket_construction_parameters:e.Opt(wt),confirmation_text:e.Opt(e.Text),maximum_participant_icp:e.Opt(m),minimum_icp:e.Opt(m),minimum_direct_participation_icp:e.Opt(m),minimum_participant_icp:e.Opt(m),start_time:e.Opt(yt),maximum_direct_participation_icp:e.Opt(m),maximum_icp:e.Opt(m),neurons_fund_investment_icp:e.Opt(m),restricted_countries:e.Opt(Rt)}),xe=e.Record({total:e.Opt(m)}),Ot=e.Record({controller:e.Opt(e.Principal),dissolve_delay:e.Opt(y),memo:e.Opt(e.Nat64),vesting_period:e.Opt(y),stake:e.Opt(m)}),ht=e.Record({developer_neurons:e.Vec(Ot)}),vt=e.Record({treasury_distribution:e.Opt(xe),developer_distribution:e.Opt(ht),swap_distribution:e.Opt(xe)}),xt=e.Record({url:e.Opt(e.Text),governance_parameters:e.Opt(mt),fallback_controller_principal_ids:e.Vec(e.Principal),logo:e.Opt(ve),name:e.Opt(e.Text),ledger_parameters:e.Opt(ft),description:e.Opt(e.Text),dapp_canisters:e.Vec(Nt),swap_parameters:e.Opt(gt),initial_token_distribution:e.Opt(vt)}),bt=e.Record({nns_function:e.Int32,payload:e.Vec(e.Nat8)}),h=e.Record({id:e.Opt(e.Principal),reward_account:e.Opt(H)}),kt=e.Record({dissolve_delay_seconds:e.Nat64}),St=e.Record({to_account:e.Opt(H)}),Tt=e.Variant({RewardToNeuron:kt,RewardToAccount:St}),ie=e.Record({node_provider:e.Opt(h),reward_mode:e.Opt(Tt),amount_e8s:e.Nat64}),Ft=e.Record({dissolve_delay_interval_seconds:e.Nat64,count:e.Nat64}),Pt=e.Record({min_participant_icp_e8s:e.Nat64,neuron_basket_construction_parameters:e.Opt(Ft),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)}),Ct=e.Record({community_fund_investment_e8s:e.Opt(e.Nat64),target_swap_canister_id:e.Opt(e.Principal),params:e.Opt(Pt)}),At=e.Record({start_timestamp_seconds:e.Nat64,end_timestamp_seconds:e.Nat64}),Vt=e.Record({open_time_window:e.Opt(At)}),Mt=e.Record({request:e.Opt(Vt),swap_canister_id:e.Opt(e.Principal)}),Bt=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,o))}),be=e.Record({use_registry_derived_rewards:e.Opt(e.Bool),rewards:e.Vec(ie)}),j=e.Record({human_readable:e.Opt(e.Text)}),Et=e.Record({contribution_threshold_xdr:e.Opt(j),one_third_participation_milestone_xdr:e.Opt(j),full_participation_milestone_xdr:e.Opt(j)}),qt=e.Record({maximum_icp_xdr_rate:e.Opt(k),neurons_fund_matched_funding_curve_coefficients:e.Opt(Et),max_theoretical_neurons_fund_participation_amount_xdr:e.Opt(j),minimum_icp_xdr_rate:e.Opt(k)}),se=e.Record({neuron_minimum_stake_e8s:e.Nat64,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(qt)}),Ut=e.Record({principals:e.Vec(e.Principal)}),Gt=e.Variant({ToRemove:h,ToAdd:h}),Kt=e.Record({change:e.Opt(Gt)}),Ht=e.Record({motion_text:e.Text}),jt=e.Variant({RegisterKnownNeuron:i,ManageNeuron:re,CreateServiceNervousSystem:xt,ExecuteNnsFunction:bt,RewardNodeProvider:ie,OpenSnsTokenSwap:Ct,SetSnsTokenSwapOpenTimeWindow:Mt,SetDefaultFollowees:Bt,RewardNodeProviders:be,ManageNetworkEconomics:se,ApproveGenesisKyc:Ut,AddOrRemoveNodeProvider:Kt,Motion:Ht});t.fill(e.Record({url:e.Text,title:e.Opt(e.Text),action:e.Opt(jt),summary:e.Text}));let Wt=e.Record({proposal:e.Opt(t),caller:e.Opt(e.Principal),proposer_id:e.Opt(n)}),ke=e.Record({xdr_permyriad_per_icp:e.Opt(e.Nat64),timestamp_seconds:e.Opt(e.Nat64)}),Se=e.Record({minimum_xdr_permyriad_per_icp:e.Opt(e.Nat64),registry_version:e.Opt(e.Nat64),node_providers:e.Vec(h),timestamp:e.Nat64,rewards:e.Vec(ie),xdr_conversion_rate:e.Opt(ke),maximum_node_provider_rewards_e8s:e.Opt(e.Nat64)}),$t=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),total_staked_maturity_e8s_equivalent: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),count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64))}),Te=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,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)),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($t),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)),timestamp_seconds:e.Nat64,seed_neuron_count:e.Nat64}),Xt=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}),Fe=e.Record({groups:e.Vec(Xt),timestamp_seconds:e.Opt(e.Nat64)}),Pe=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(n)}),Ce=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}),Jt=e.Record({followers:e.Vec(n)}),zt=e.Record({followers_map:e.Vec(e.Tuple(e.Nat64,Jt))}),Yt=e.Variant({LastNeuronId:n}),Ae=e.Record({status:e.Opt(e.Int32),failure_reason:e.Opt(e.Text),progress:e.Opt(Yt)}),Qt=e.Record({neuron_indexes_migration:e.Opt(Ae),copy_inactive_neurons_to_stable_memory_migration:e.Opt(Ae)}),f=e.Record({error_message:e.Text,error_type:e.Int32}),Zt=e.Record({has_created_neuron_recipes:e.Opt(e.Bool),nns_neuron_id:e.Nat64,amount_icp_e8s:e.Nat64}),It=e.Record({hotkey_principal:e.Text,cf_neurons:e.Vec(Zt)}),Ve=e.Record({vote:e.Int32,voting_power:e.Nat64}),Dt=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)}),Lt=e.Record({hotkey_principal:e.Opt(e.Principal),is_capped:e.Opt(e.Bool),maturity_equivalent_icp_e8s:e.Opt(e.Nat64),nns_neuron_id:e.Opt(n),amount_icp_e8s:e.Opt(e.Nat64)}),ae=e.Record({neurons_fund_neuron_portions:e.Vec(Lt)}),en=e.Record({serialized_representation:e.Opt(e.Text)}),W=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(Dt),max_neurons_fund_swap_participation_icp_e8s:e.Opt(e.Nat64),neurons_fund_reserves:e.Opt(ae),ideal_matched_participation_function:e.Opt(en),allocated_neurons_fund_participation_icp_e8s:e.Opt(e.Nat64)}),tn=e.Record({final_neurons_fund_participation:e.Opt(W),initial_neurons_fund_participation:e.Opt(W),neurons_fund_refunds:e.Opt(ae)}),nn=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)}),v=e.Record({status:e.Opt(nn),canister_id:e.Opt(e.Principal)}),on=e.Record({ledger_index_canister_summary:e.Opt(v),fallback_controller_principal_ids:e.Vec(e.Principal),ledger_archive_canister_summaries:e.Vec(v),ledger_canister_summary:e.Opt(v),swap_canister_summary:e.Opt(v),governance_canister_summary:e.Opt(v),root_canister_summary:e.Opt(v),dapp_canister_summaries:e.Vec(v)}),Me=e.Record({swap_background_information:e.Opt(on)}),Be=e.Record({no:e.Nat64,yes:e.Nat64,total:e.Nat64,timestamp_seconds:e.Nat64}),rn=e.Record({current_deadline_timestamp_seconds:e.Nat64}),sn=e.Record({id:e.Opt(n),failure_reason:e.Opt(f),cf_participants:e.Vec(It),ballots:e.Vec(e.Tuple(e.Nat64,Ve)),proposal_timestamp_seconds:e.Nat64,reward_event_round:e.Nat64,failed_timestamp_seconds:e.Nat64,neurons_fund_data:e.Opt(tn),reject_cost_e8s:e.Nat64,derived_proposal_information:e.Opt(Me),latest_tally:e.Opt(Be),sns_token_swap_lifecycle:e.Opt(e.Int32),decided_timestamp_seconds:e.Nat64,proposal:e.Opt(t),proposer:e.Opt(n),wait_for_quiet_state:e.Opt(rn),executed_timestamp_seconds:e.Nat64,original_total_community_fund_maturity_e8s_equivalent:e.Opt(e.Nat64)}),an=e.Variant({Spawn:n,Split:c,Configure:ye,Merge:Re,DisburseToNeuron:ge,SyncCommand:e.Record({}),ClaimOrRefreshNeuron:_,MergeMaturity:Oe,Disburse:he}),cn=e.Record({command:e.Opt(an),timestamp:e.Nat64}),Ee=e.Record({vote:e.Int32,proposal_id:e.Opt(n)}),un=e.Variant({DissolveDelaySeconds:e.Nat64,WhenDissolvedTimestampSeconds:e.Nat64}),C=e.Record({id:e.Opt(n),staked_maturity_e8s_equivalent:e.Opt(e.Nat64),controller:e.Opt(e.Principal),recent_ballots:e.Vec(Ee),kyc_verified:e.Bool,neuron_type:e.Opt(e.Int32),not_for_profit:e.Bool,maturity_e8s_equivalent: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),dissolve_state:e.Opt(un),followees:e.Vec(e.Tuple(e.Int32,o)),neuron_fees_e8s:e.Nat64,transfer:e.Opt(Ce),known_neuron_data:e.Opt(r),spawn_at_timestamp_seconds:e.Opt(e.Nat64)}),Ur=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,o)),making_sns_proposal:e.Opt(Wt),most_recent_monthly_node_provider_rewards:e.Opt(Se),maturity_modulation_last_updated_at_timestamp_seconds:e.Opt(e.Nat64),wait_for_quiet_threshold_seconds:e.Nat64,metrics:e.Opt(Te),neuron_management_voting_period_seconds:e.Opt(e.Nat64),node_providers:e.Vec(h),cached_daily_maturity_modulation_basis_points:e.Opt(e.Int32),economics:e.Opt(se),restore_aging_summary:e.Opt(Fe),spawning_neurons:e.Opt(e.Bool),latest_reward_event:e.Opt(Pe),to_claim_transfers:e.Vec(Ce),short_voting_period_seconds:e.Nat64,topic_followee_index:e.Vec(e.Tuple(e.Int32,zt)),migrations:e.Opt(Qt),proposals:e.Vec(e.Tuple(e.Nat64,sn)),xdr_conversion_rate:e.Opt(ke),in_flight_commands:e.Vec(e.Tuple(e.Nat64,cn)),neurons:e.Vec(e.Tuple(e.Nat64,C)),genesis_timestamp_seconds:e.Nat64}),$=e.Variant({Ok:e.Null,Err:f}),_n=e.Variant({Error:f,NeuronId:n}),dn=e.Record({result:e.Opt(_n)}),qe=e.Variant({Ok:C,Err:f}),pn=e.Variant({Ok:Te,Err:f}),ln=e.Variant({Ok:be,Err:f}),X=e.Record({dissolve_delay_seconds:e.Nat64,recent_ballots:e.Vec(Ee),neuron_type:e.Opt(e.Int32),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,known_neuron_data:e.Opt(r),voting_power:e.Nat64,age_seconds:e.Nat64}),Ue=e.Variant({Ok:X,Err:f}),mn=e.Record({nns_proposal_id:e.Opt(n)}),fn=e.Record({final_neurons_fund_participation:e.Opt(W),initial_neurons_fund_participation:e.Opt(W),neurons_fund_refunds:e.Opt(ae)}),Nn=e.Record({neurons_fund_audit_info:e.Opt(fn)}),wn=e.Variant({Ok:Nn,Err:f}),yn=e.Record({result:e.Opt(wn)}),Rn=e.Variant({Ok:h,Err:f}),ce=e.Record({id:e.Opt(n),status:e.Int32,topic:e.Int32,failure_reason:e.Opt(f),ballots:e.Vec(e.Tuple(e.Nat64,Ve)),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(Me),latest_tally:e.Opt(Be),reward_status:e.Int32,decided_timestamp_seconds:e.Nat64,proposal:e.Opt(t),proposer:e.Opt(n),executed_timestamp_seconds:e.Nat64}),gn=e.Record({known_neurons:e.Vec(i)}),On=e.Record({neuron_ids:e.Vec(e.Nat64),include_empty_neurons_readable_by_caller:e.Opt(e.Bool),include_neurons_readable_by_caller:e.Bool}),hn=e.Record({neuron_infos:e.Vec(e.Tuple(e.Nat64,X)),full_neurons:e.Vec(C)}),vn=e.Record({node_providers:e.Vec(h)}),xn=e.Record({include_reward_status:e.Vec(e.Int32),omit_large_fields:e.Opt(e.Bool),before_proposal:e.Opt(n),limit:e.Nat32,exclude_topic:e.Vec(e.Int32),include_all_manage_neuron_proposals:e.Opt(e.Bool),include_status:e.Vec(e.Int32)}),bn=e.Record({proposal_info:e.Vec(ce)}),ue=e.Record({created_neuron_id:e.Opt(n)}),kn=e.Record({refreshed_neuron_id:e.Opt(n)}),Sn=e.Record({target_neuron:e.Opt(C),source_neuron:e.Opt(C),target_neuron_info:e.Opt(X),source_neuron_info:e.Opt(X)}),Tn=e.Record({message:e.Opt(e.Text),proposal_id:e.Opt(n)}),Fn=e.Record({maturity_e8s:e.Nat64,staked_maturity_e8s:e.Nat64}),Pn=e.Record({merged_maturity_e8s:e.Nat64,new_stake_e8s:e.Nat64}),Cn=e.Record({transfer_block_height:e.Nat64}),An=e.Variant({Error:f,Spawn:ue,Split:ue,Follow:e.Record({}),ClaimOrRefresh:kn,Configure:e.Record({}),RegisterVote:e.Record({}),Merge:Sn,DisburseToNeuron:ue,MakeProposal:Tn,StakeMaturity:Fn,MergeMaturity:Pn,Disburse:Cn}),Ge=e.Record({command:e.Opt(An)}),Vn=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)}),Mn=e.Variant({Committed:Vn,Aborted:e.Record({})}),Bn=e.Record({result:e.Opt(Mn),open_sns_token_swap_proposal_id:e.Opt(e.Nat64)}),En=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)}),qn=e.Variant({Committed:En,Aborted:e.Record({})}),Un=e.Record({result:e.Opt(qn),nns_proposal_id:e.Opt(e.Nat64)}),Gn=e.Record({hotkey_principal:e.Opt(e.Text),is_capped:e.Opt(e.Bool),nns_neuron_id:e.Opt(e.Nat64),amount_icp_e8s:e.Opt(e.Nat64)}),Kn=e.Record({neurons_fund_neuron_portions:e.Vec(Gn)}),Hn=e.Variant({Ok:Kn,Err:f}),jn=e.Record({result:e.Opt(Hn)}),Wn=e.Record({reward_account:e.Opt(H)});return e.Service({claim_gtc_neurons:e.Func([e.Principal,e.Vec(n)],[$],[]),claim_or_refresh_neuron_from_account:e.Func([l],[dn],[]),get_build_metadata:e.Func([],[e.Text],[]),get_full_neuron:e.Func([e.Nat64],[qe],[]),get_full_neuron_by_id_or_subaccount:e.Func([oe],[qe],[]),get_latest_reward_event:e.Func([],[Pe],[]),get_metrics:e.Func([],[pn],[]),get_monthly_node_provider_rewards:e.Func([],[ln],[]),get_most_recent_monthly_node_provider_rewards:e.Func([],[e.Opt(Se)],[]),get_network_economics_parameters:e.Func([],[se],[]),get_neuron_ids:e.Func([],[e.Vec(e.Nat64)],[]),get_neuron_info:e.Func([e.Nat64],[Ue],[]),get_neuron_info_by_id_or_subaccount:e.Func([oe],[Ue],[]),get_neurons_fund_audit_info:e.Func([mn],[yn],[]),get_node_provider_by_caller:e.Func([e.Null],[Rn],[]),get_pending_proposals:e.Func([],[e.Vec(ce)],[]),get_proposal_info:e.Func([e.Nat64],[e.Opt(ce)],[]),get_restore_aging_summary:e.Func([],[Fe],[]),list_known_neurons:e.Func([],[gn],[]),list_neurons:e.Func([On],[hn],[]),list_node_providers:e.Func([],[vn],[]),list_proposals:e.Func([xn],[bn],[]),manage_neuron:e.Func([re],[Ge],[]),settle_community_fund_participation:e.Func([Bn],[$],[]),settle_neurons_fund_participation:e.Func([Un],[jn],[]),simulate_manage_neuron:e.Func([re],[Ge],[]),transfer_gtc_neuron:e.Func([n,n],[$],[]),update_node_provider:e.Func([Wn],[$],[])})};var Zo=({IDL:e})=>{let t=e.Rec(),n=e.Record({id:e.Nat64}),o=e.Record({followees:e.Vec(n)}),r=e.Record({name:e.Text,description:e.Opt(e.Text)}),i=e.Record({id:e.Opt(n),known_neuron_data:e.Opt(r)}),s=e.Record({percentage_to_spawn:e.Opt(e.Nat32),new_controller:e.Opt(e.Principal),nonce:e.Opt(e.Nat64)}),c=e.Record({amount_e8s:e.Nat64}),u=e.Record({topic:e.Int32,followees:e.Vec(n)}),l=e.Record({controller:e.Opt(e.Principal),memo:e.Nat64}),p=e.Variant({NeuronIdOrSubaccount:e.Record({}),MemoAndController:l,Memo:e.Nat64}),_=e.Record({by:e.Opt(p)}),N=e.Record({hot_key_to_remove:e.Opt(e.Principal)}),w=e.Record({new_hot_key:e.Opt(e.Principal)}),V=e.Record({requested_setting_for_auto_stake_maturity:e.Bool}),K=e.Record({additional_dissolve_delay_seconds:e.Nat32}),at=e.Record({dissolve_timestamp_seconds:e.Nat64}),ct=e.Variant({RemoveHotKey:N,AddHotKey:w,ChangeAutoStakeMaturity:V,StopDissolving:e.Record({}),StartDissolving:e.Record({}),IncreaseDissolveDelay:K,JoinCommunityFund:e.Record({}),LeaveCommunityFund:e.Record({}),SetDissolveTimestamp:at}),ye=e.Record({operation:e.Opt(ct)}),ut=e.Record({vote:e.Int32,proposal:e.Opt(n)}),Re=e.Record({source_neuron_id:e.Opt(n)}),ge=e.Record({dissolve_delay_seconds:e.Nat64,kyc_verified:e.Bool,amount_e8s:e.Nat64,new_controller:e.Opt(e.Principal),nonce:e.Nat64}),_t=e.Record({percentage_to_stake:e.Opt(e.Nat32)}),Oe=e.Record({percentage_to_merge:e.Nat32}),H=e.Record({hash:e.Vec(e.Nat8)}),dt=e.Record({e8s:e.Nat64}),he=e.Record({to_account:e.Opt(H),amount:e.Opt(dt)}),pt=e.Variant({Spawn:s,Split:c,Follow:u,ClaimOrRefresh:_,Configure:ye,RegisterVote:ut,Merge:Re,DisburseToNeuron:ge,MakeProposal:t,StakeMaturity:_t,MergeMaturity:Oe,Disburse:he}),oe=e.Variant({Subaccount:e.Vec(e.Nat8),NeuronId:n}),re=e.Record({id:e.Opt(n),command:e.Opt(pt),neuron_id_or_subaccount:e.Opt(oe)}),k=e.Record({basis_points:e.Opt(e.Nat64)}),y=e.Record({seconds:e.Opt(e.Nat64)}),m=e.Record({e8s:e.Opt(e.Nat64)}),lt=e.Record({reward_rate_transition_duration:e.Opt(y),initial_reward_rate:e.Opt(k),final_reward_rate:e.Opt(k)}),mt=e.Record({neuron_maximum_dissolve_delay_bonus:e.Opt(k),neuron_maximum_age_for_age_bonus:e.Opt(y),neuron_maximum_dissolve_delay:e.Opt(y),neuron_minimum_dissolve_delay_to_vote:e.Opt(y),neuron_maximum_age_bonus:e.Opt(k),neuron_minimum_stake:e.Opt(m),proposal_wait_for_quiet_deadline_increase:e.Opt(y),proposal_initial_voting_period:e.Opt(y),proposal_rejection_fee:e.Opt(m),voting_reward_parameters:e.Opt(lt)}),ve=e.Record({base64_encoding:e.Opt(e.Text)}),ft=e.Record({transaction_fee:e.Opt(m),token_symbol:e.Opt(e.Text),token_logo:e.Opt(ve),token_name:e.Opt(e.Text)}),Nt=e.Record({id:e.Opt(e.Principal)}),wt=e.Record({dissolve_delay_interval:e.Opt(y),count:e.Opt(e.Nat64)}),yt=e.Record({seconds_after_utc_midnight:e.Opt(e.Nat64)}),Rt=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(y),neuron_basket_construction_parameters:e.Opt(wt),confirmation_text:e.Opt(e.Text),maximum_participant_icp:e.Opt(m),minimum_icp:e.Opt(m),minimum_direct_participation_icp:e.Opt(m),minimum_participant_icp:e.Opt(m),start_time:e.Opt(yt),maximum_direct_participation_icp:e.Opt(m),maximum_icp:e.Opt(m),neurons_fund_investment_icp:e.Opt(m),restricted_countries:e.Opt(Rt)}),xe=e.Record({total:e.Opt(m)}),Ot=e.Record({controller:e.Opt(e.Principal),dissolve_delay:e.Opt(y),memo:e.Opt(e.Nat64),vesting_period:e.Opt(y),stake:e.Opt(m)}),ht=e.Record({developer_neurons:e.Vec(Ot)}),vt=e.Record({treasury_distribution:e.Opt(xe),developer_distribution:e.Opt(ht),swap_distribution:e.Opt(xe)}),xt=e.Record({url:e.Opt(e.Text),governance_parameters:e.Opt(mt),fallback_controller_principal_ids:e.Vec(e.Principal),logo:e.Opt(ve),name:e.Opt(e.Text),ledger_parameters:e.Opt(ft),description:e.Opt(e.Text),dapp_canisters:e.Vec(Nt),swap_parameters:e.Opt(gt),initial_token_distribution:e.Opt(vt)}),bt=e.Record({nns_function:e.Int32,payload:e.Vec(e.Nat8)}),h=e.Record({id:e.Opt(e.Principal),reward_account:e.Opt(H)}),kt=e.Record({dissolve_delay_seconds:e.Nat64}),St=e.Record({to_account:e.Opt(H)}),Tt=e.Variant({RewardToNeuron:kt,RewardToAccount:St}),ie=e.Record({node_provider:e.Opt(h),reward_mode:e.Opt(Tt),amount_e8s:e.Nat64}),Ft=e.Record({dissolve_delay_interval_seconds:e.Nat64,count:e.Nat64}),Pt=e.Record({min_participant_icp_e8s:e.Nat64,neuron_basket_construction_parameters:e.Opt(Ft),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)}),Ct=e.Record({community_fund_investment_e8s:e.Opt(e.Nat64),target_swap_canister_id:e.Opt(e.Principal),params:e.Opt(Pt)}),At=e.Record({start_timestamp_seconds:e.Nat64,end_timestamp_seconds:e.Nat64}),Vt=e.Record({open_time_window:e.Opt(At)}),Mt=e.Record({request:e.Opt(Vt),swap_canister_id:e.Opt(e.Principal)}),Bt=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,o))}),be=e.Record({use_registry_derived_rewards:e.Opt(e.Bool),rewards:e.Vec(ie)}),j=e.Record({human_readable:e.Opt(e.Text)}),Et=e.Record({contribution_threshold_xdr:e.Opt(j),one_third_participation_milestone_xdr:e.Opt(j),full_participation_milestone_xdr:e.Opt(j)}),qt=e.Record({maximum_icp_xdr_rate:e.Opt(k),neurons_fund_matched_funding_curve_coefficients:e.Opt(Et),max_theoretical_neurons_fund_participation_amount_xdr:e.Opt(j),minimum_icp_xdr_rate:e.Opt(k)}),se=e.Record({neuron_minimum_stake_e8s:e.Nat64,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(qt)}),Ut=e.Record({principals:e.Vec(e.Principal)}),Gt=e.Variant({ToRemove:h,ToAdd:h}),Kt=e.Record({change:e.Opt(Gt)}),Ht=e.Record({motion_text:e.Text}),jt=e.Variant({RegisterKnownNeuron:i,ManageNeuron:re,CreateServiceNervousSystem:xt,ExecuteNnsFunction:bt,RewardNodeProvider:ie,OpenSnsTokenSwap:Ct,SetSnsTokenSwapOpenTimeWindow:Mt,SetDefaultFollowees:Bt,RewardNodeProviders:be,ManageNetworkEconomics:se,ApproveGenesisKyc:Ut,AddOrRemoveNodeProvider:Kt,Motion:Ht});t.fill(e.Record({url:e.Text,title:e.Opt(e.Text),action:e.Opt(jt),summary:e.Text}));let Wt=e.Record({proposal:e.Opt(t),caller:e.Opt(e.Principal),proposer_id:e.Opt(n)}),ke=e.Record({xdr_permyriad_per_icp:e.Opt(e.Nat64),timestamp_seconds:e.Opt(e.Nat64)}),Se=e.Record({minimum_xdr_permyriad_per_icp:e.Opt(e.Nat64),registry_version:e.Opt(e.Nat64),node_providers:e.Vec(h),timestamp:e.Nat64,rewards:e.Vec(ie),xdr_conversion_rate:e.Opt(ke),maximum_node_provider_rewards_e8s:e.Opt(e.Nat64)}),$t=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),total_staked_maturity_e8s_equivalent: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),count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64))}),Te=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,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)),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($t),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)),timestamp_seconds:e.Nat64,seed_neuron_count:e.Nat64}),Xt=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}),Fe=e.Record({groups:e.Vec(Xt),timestamp_seconds:e.Opt(e.Nat64)}),Pe=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(n)}),Ce=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}),Jt=e.Record({followers:e.Vec(n)}),zt=e.Record({followers_map:e.Vec(e.Tuple(e.Nat64,Jt))}),Yt=e.Variant({LastNeuronId:n}),Ae=e.Record({status:e.Opt(e.Int32),failure_reason:e.Opt(e.Text),progress:e.Opt(Yt)}),Qt=e.Record({neuron_indexes_migration:e.Opt(Ae),copy_inactive_neurons_to_stable_memory_migration:e.Opt(Ae)}),f=e.Record({error_message:e.Text,error_type:e.Int32}),Zt=e.Record({has_created_neuron_recipes:e.Opt(e.Bool),nns_neuron_id:e.Nat64,amount_icp_e8s:e.Nat64}),It=e.Record({hotkey_principal:e.Text,cf_neurons:e.Vec(Zt)}),Ve=e.Record({vote:e.Int32,voting_power:e.Nat64}),Dt=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)}),Lt=e.Record({hotkey_principal:e.Opt(e.Principal),is_capped:e.Opt(e.Bool),maturity_equivalent_icp_e8s:e.Opt(e.Nat64),nns_neuron_id:e.Opt(n),amount_icp_e8s:e.Opt(e.Nat64)}),ae=e.Record({neurons_fund_neuron_portions:e.Vec(Lt)}),en=e.Record({serialized_representation:e.Opt(e.Text)}),W=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(Dt),max_neurons_fund_swap_participation_icp_e8s:e.Opt(e.Nat64),neurons_fund_reserves:e.Opt(ae),ideal_matched_participation_function:e.Opt(en),allocated_neurons_fund_participation_icp_e8s:e.Opt(e.Nat64)}),tn=e.Record({final_neurons_fund_participation:e.Opt(W),initial_neurons_fund_participation:e.Opt(W),neurons_fund_refunds:e.Opt(ae)}),nn=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)}),v=e.Record({status:e.Opt(nn),canister_id:e.Opt(e.Principal)}),on=e.Record({ledger_index_canister_summary:e.Opt(v),fallback_controller_principal_ids:e.Vec(e.Principal),ledger_archive_canister_summaries:e.Vec(v),ledger_canister_summary:e.Opt(v),swap_canister_summary:e.Opt(v),governance_canister_summary:e.Opt(v),root_canister_summary:e.Opt(v),dapp_canister_summaries:e.Vec(v)}),Me=e.Record({swap_background_information:e.Opt(on)}),Be=e.Record({no:e.Nat64,yes:e.Nat64,total:e.Nat64,timestamp_seconds:e.Nat64}),rn=e.Record({current_deadline_timestamp_seconds:e.Nat64}),sn=e.Record({id:e.Opt(n),failure_reason:e.Opt(f),cf_participants:e.Vec(It),ballots:e.Vec(e.Tuple(e.Nat64,Ve)),proposal_timestamp_seconds:e.Nat64,reward_event_round:e.Nat64,failed_timestamp_seconds:e.Nat64,neurons_fund_data:e.Opt(tn),reject_cost_e8s:e.Nat64,derived_proposal_information:e.Opt(Me),latest_tally:e.Opt(Be),sns_token_swap_lifecycle:e.Opt(e.Int32),decided_timestamp_seconds:e.Nat64,proposal:e.Opt(t),proposer:e.Opt(n),wait_for_quiet_state:e.Opt(rn),executed_timestamp_seconds:e.Nat64,original_total_community_fund_maturity_e8s_equivalent:e.Opt(e.Nat64)}),an=e.Variant({Spawn:n,Split:c,Configure:ye,Merge:Re,DisburseToNeuron:ge,SyncCommand:e.Record({}),ClaimOrRefreshNeuron:_,MergeMaturity:Oe,Disburse:he}),cn=e.Record({command:e.Opt(an),timestamp:e.Nat64}),Ee=e.Record({vote:e.Int32,proposal_id:e.Opt(n)}),un=e.Variant({DissolveDelaySeconds:e.Nat64,WhenDissolvedTimestampSeconds:e.Nat64}),C=e.Record({id:e.Opt(n),staked_maturity_e8s_equivalent:e.Opt(e.Nat64),controller:e.Opt(e.Principal),recent_ballots:e.Vec(Ee),kyc_verified:e.Bool,neuron_type:e.Opt(e.Int32),not_for_profit:e.Bool,maturity_e8s_equivalent: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),dissolve_state:e.Opt(un),followees:e.Vec(e.Tuple(e.Int32,o)),neuron_fees_e8s:e.Nat64,transfer:e.Opt(Ce),known_neuron_data:e.Opt(r),spawn_at_timestamp_seconds:e.Opt(e.Nat64)}),Ur=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,o)),making_sns_proposal:e.Opt(Wt),most_recent_monthly_node_provider_rewards:e.Opt(Se),maturity_modulation_last_updated_at_timestamp_seconds:e.Opt(e.Nat64),wait_for_quiet_threshold_seconds:e.Nat64,metrics:e.Opt(Te),neuron_management_voting_period_seconds:e.Opt(e.Nat64),node_providers:e.Vec(h),cached_daily_maturity_modulation_basis_points:e.Opt(e.Int32),economics:e.Opt(se),restore_aging_summary:e.Opt(Fe),spawning_neurons:e.Opt(e.Bool),latest_reward_event:e.Opt(Pe),to_claim_transfers:e.Vec(Ce),short_voting_period_seconds:e.Nat64,topic_followee_index:e.Vec(e.Tuple(e.Int32,zt)),migrations:e.Opt(Qt),proposals:e.Vec(e.Tuple(e.Nat64,sn)),xdr_conversion_rate:e.Opt(ke),in_flight_commands:e.Vec(e.Tuple(e.Nat64,cn)),neurons:e.Vec(e.Tuple(e.Nat64,C)),genesis_timestamp_seconds:e.Nat64}),$=e.Variant({Ok:e.Null,Err:f}),_n=e.Variant({Error:f,NeuronId:n}),dn=e.Record({result:e.Opt(_n)}),qe=e.Variant({Ok:C,Err:f}),pn=e.Variant({Ok:Te,Err:f}),ln=e.Variant({Ok:be,Err:f}),X=e.Record({dissolve_delay_seconds:e.Nat64,recent_ballots:e.Vec(Ee),neuron_type:e.Opt(e.Int32),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,known_neuron_data:e.Opt(r),voting_power:e.Nat64,age_seconds:e.Nat64}),Ue=e.Variant({Ok:X,Err:f}),mn=e.Record({nns_proposal_id:e.Opt(n)}),fn=e.Record({final_neurons_fund_participation:e.Opt(W),initial_neurons_fund_participation:e.Opt(W),neurons_fund_refunds:e.Opt(ae)}),Nn=e.Record({neurons_fund_audit_info:e.Opt(fn)}),wn=e.Variant({Ok:Nn,Err:f}),yn=e.Record({result:e.Opt(wn)}),Rn=e.Variant({Ok:h,Err:f}),ce=e.Record({id:e.Opt(n),status:e.Int32,topic:e.Int32,failure_reason:e.Opt(f),ballots:e.Vec(e.Tuple(e.Nat64,Ve)),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(Me),latest_tally:e.Opt(Be),reward_status:e.Int32,decided_timestamp_seconds:e.Nat64,proposal:e.Opt(t),proposer:e.Opt(n),executed_timestamp_seconds:e.Nat64}),gn=e.Record({known_neurons:e.Vec(i)}),On=e.Record({neuron_ids:e.Vec(e.Nat64),include_empty_neurons_readable_by_caller:e.Opt(e.Bool),include_neurons_readable_by_caller:e.Bool}),hn=e.Record({neuron_infos:e.Vec(e.Tuple(e.Nat64,X)),full_neurons:e.Vec(C)}),vn=e.Record({node_providers:e.Vec(h)}),xn=e.Record({include_reward_status:e.Vec(e.Int32),omit_large_fields:e.Opt(e.Bool),before_proposal:e.Opt(n),limit:e.Nat32,exclude_topic:e.Vec(e.Int32),include_all_manage_neuron_proposals:e.Opt(e.Bool),include_status:e.Vec(e.Int32)}),bn=e.Record({proposal_info:e.Vec(ce)}),ue=e.Record({created_neuron_id:e.Opt(n)}),kn=e.Record({refreshed_neuron_id:e.Opt(n)}),Sn=e.Record({target_neuron:e.Opt(C),source_neuron:e.Opt(C),target_neuron_info:e.Opt(X),source_neuron_info:e.Opt(X)}),Tn=e.Record({message:e.Opt(e.Text),proposal_id:e.Opt(n)}),Fn=e.Record({maturity_e8s:e.Nat64,staked_maturity_e8s:e.Nat64}),Pn=e.Record({merged_maturity_e8s:e.Nat64,new_stake_e8s:e.Nat64}),Cn=e.Record({transfer_block_height:e.Nat64}),An=e.Variant({Error:f,Spawn:ue,Split:ue,Follow:e.Record({}),ClaimOrRefresh:kn,Configure:e.Record({}),RegisterVote:e.Record({}),Merge:Sn,DisburseToNeuron:ue,MakeProposal:Tn,StakeMaturity:Fn,MergeMaturity:Pn,Disburse:Cn}),Ge=e.Record({command:e.Opt(An)}),Vn=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)}),Mn=e.Variant({Committed:Vn,Aborted:e.Record({})}),Bn=e.Record({result:e.Opt(Mn),open_sns_token_swap_proposal_id:e.Opt(e.Nat64)}),En=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)}),qn=e.Variant({Committed:En,Aborted:e.Record({})}),Un=e.Record({result:e.Opt(qn),nns_proposal_id:e.Opt(e.Nat64)}),Gn=e.Record({hotkey_principal:e.Opt(e.Text),is_capped:e.Opt(e.Bool),nns_neuron_id:e.Opt(e.Nat64),amount_icp_e8s:e.Opt(e.Nat64)}),Kn=e.Record({neurons_fund_neuron_portions:e.Vec(Gn)}),Hn=e.Variant({Ok:Kn,Err:f}),jn=e.Record({result:e.Opt(Hn)}),Wn=e.Record({reward_account:e.Opt(H)});return e.Service({claim_gtc_neurons:e.Func([e.Principal,e.Vec(n)],[$],[]),claim_or_refresh_neuron_from_account:e.Func([l],[dn],[]),get_build_metadata:e.Func([],[e.Text],["query"]),get_full_neuron:e.Func([e.Nat64],[qe],["query"]),get_full_neuron_by_id_or_subaccount:e.Func([oe],[qe],["query"]),get_latest_reward_event:e.Func([],[Pe],["query"]),get_metrics:e.Func([],[pn],["query"]),get_monthly_node_provider_rewards:e.Func([],[ln],[]),get_most_recent_monthly_node_provider_rewards:e.Func([],[e.Opt(Se)],["query"]),get_network_economics_parameters:e.Func([],[se],["query"]),get_neuron_ids:e.Func([],[e.Vec(e.Nat64)],["query"]),get_neuron_info:e.Func([e.Nat64],[Ue],["query"]),get_neuron_info_by_id_or_subaccount:e.Func([oe],[Ue],["query"]),get_neurons_fund_audit_info:e.Func([mn],[yn],["query"]),get_node_provider_by_caller:e.Func([e.Null],[Rn],["query"]),get_pending_proposals:e.Func([],[e.Vec(ce)],["query"]),get_proposal_info:e.Func([e.Nat64],[e.Opt(ce)],["query"]),get_restore_aging_summary:e.Func([],[Fe],["query"]),list_known_neurons:e.Func([],[gn],["query"]),list_neurons:e.Func([On],[hn],["query"]),list_node_providers:e.Func([],[vn],["query"]),list_proposals:e.Func([xn],[bn],["query"]),manage_neuron:e.Func([re],[Ge],[]),settle_community_fund_participation:e.Func([Bn],[$],[]),settle_neurons_fund_participation:e.Func([Un],[jn],[]),simulate_manage_neuron:e.Func([re],[Ge],[]),transfer_gtc_neuron:e.Func([n,n],[$],[]),update_node_provider:e.Func([Wn],[$],[])})};var Io=({IDL:e})=>{let t=e.Record({id:e.Nat64}),n=e.Record({followees:e.Vec(t)}),o=e.Record({name:e.Text,description:e.Opt(e.Text)}),r=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}),i=e.Record({vote:e.Int32,proposal_id:e.Opt(t)}),s=e.Variant({DissolveDelaySeconds:e.Nat64,WhenDissolvedTimestampSeconds:e.Nat64}),c=e.Record({id:e.Opt(t),staked_maturity_e8s_equivalent:e.Opt(e.Nat64),controller:e.Opt(e.Principal),recent_ballots:e.Vec(i),kyc_verified:e.Bool,neuron_type:e.Opt(e.Int32),not_for_profit:e.Bool,maturity_e8s_equivalent: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),dissolve_state:e.Opt(s),followees:e.Vec(e.Tuple(e.Int32,n)),neuron_fees_e8s:e.Nat64,transfer:e.Opt(r),known_neuron_data:e.Opt(o),spawn_at_timestamp_seconds:e.Opt(e.Nat64)}),u=e.Record({dissolve_delay_seconds:e.Nat64,recent_ballots:e.Vec(i),neuron_type:e.Opt(e.Int32),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,known_neuron_data:e.Opt(o),voting_power:e.Nat64,age_seconds:e.Nat64}),l=e.Record({neuron_ids:e.Vec(e.Nat64),include_neurons_readable_by_caller:e.Bool}),p=e.Record({neuron_infos:e.Vec(e.Tuple(e.Nat64,u)),full_neurons:e.Vec(c)});return e.Service({list_neurons:e.Func([l],[p],[])})};import{accountIdentifierToBytes as ki}from"@dfinity/ledger-icp";import{Principal as q}from"@dfinity/principal";import{arrayBufferToUint8Array as Si,isNullish as et,toNullable as S}from"@dfinity/utils";var Le=class extends Error{},je=class extends Le{},We=class extends Le{constructor(n){super();this.minimumAmount=n}},D=class extends Error{},L=class extends Error{constructor(n){super();this.detail=n}},g=class extends Error{constructor(t){super("Unsupported value: "+t)}};var er=e=>({id:e}),ao=e=>({id:e}),Ti=e=>({followees:e.map(ao)}),Fi=e=>{if("NeuronId"in e)return{NeuronId:{id:e.NeuronId}};if("Subaccount"in e)return{Subaccount:Uint8Array.from(e.Subaccount)};throw new g(e)},tt=e=>e.basisPoints!==void 0?{basis_points:[e.basisPoints]}:{basis_points:[]},E=e=>e.seconds!==void 0?{seconds:[e.seconds]}:{seconds:[]},Pi=e=>e.secondsAfterUtcMidnight!==void 0?{seconds_after_utc_midnight:[e.secondsAfterUtcMidnight]}:{seconds_after_utc_midnight:[]},Ci=e=>({iso_codes:e.isoCodes}),F=e=>e.e8s!==void 0?{e8s:[e.e8s]}:{e8s:[]},tr=e=>e.base64Encoding!==void 0?{base64_encoding:[e.base64Encoding]}:{base64_encoding:[]},Ai=e=>({reward_rate_transition_duration:e.rewardRateTransitionDuration!==void 0?[E(e.rewardRateTransitionDuration)]:[],initial_reward_rate:e.initialRewardRate!==void 0?[tt(e.initialRewardRate)]:[],final_reward_rate:e.finalRewardRate!==void 0?[tt(e.finalRewardRate)]:[]}),Vi=e=>({transaction_fee:e.transactionFee!==void 0?[F(e.transactionFee)]:[],token_symbol:e.tokenSymbol!==void 0?[e.tokenSymbol]:[],token_logo:e.tokenLogo!==void 0?[tr(e.tokenLogo)]:[],token_name:e.tokenName!==void 0?[e.tokenName]:[]}),Mi=e=>({minimum_participants:e.minimumParticipants!==void 0?[e.minimumParticipants]:[],duration:e.duration!==void 0?[E(e.duration)]:[],neuron_basket_construction_parameters:e.neuronBasketConstructionParameters!==void 0?[Bi(e.neuronBasketConstructionParameters)]:[],confirmation_text:e.confirmationText!==void 0?[e.confirmationText]:[],maximum_participant_icp:e.maximumParticipantIcp!==void 0?[F(e.maximumParticipantIcp)]:[],neurons_fund_investment_icp:e.neuronsFundInvestmentIcp!==void 0?[F(e.neuronsFundInvestmentIcp)]:[],minimum_icp:e.minimumIcp!==void 0?[F(e.minimumIcp)]:[],minimum_participant_icp:e.minimumParticipantIcp!==void 0?[F(e.minimumParticipantIcp)]:[],start_time:e.startTime!==void 0?[Pi(e.startTime)]:[],maximum_icp:e.maximumIcp!==void 0?[F(e.maximumIcp)]:[],restricted_countries:e.restrictedCountries!==void 0?[Ci(e.restrictedCountries)]:[],maximum_direct_participation_icp:e.maxDirectParticipationIcp!==void 0?[F(e.maxDirectParticipationIcp)]:[],minimum_direct_participation_icp:e.minDirectParticipationIcp!==void 0?[F(e.minDirectParticipationIcp)]:[],neurons_fund_participation:S(e.neuronsFundParticipation)}),Bi=e=>({dissolve_delay_interval:e.dissolveDelayInterval!==void 0?[E(e.dissolveDelayInterval)]:[],count:e.count!==void 0?[e.count]:[]}),Ei=e=>({neuron_maximum_dissolve_delay_bonus:e.neuronMaximumDissolveDelayBonus!==void 0?[tt(e.neuronMaximumDissolveDelayBonus)]:[],neuron_maximum_age_for_age_bonus:e.neuronMaximumAgeForAgeBonus!==void 0?[E(e.neuronMaximumAgeForAgeBonus)]:[],neuron_maximum_dissolve_delay:e.neuronMaximumDissolveDelay!==void 0?[E(e.neuronMaximumDissolveDelay)]:[],neuron_minimum_dissolve_delay_to_vote:e.neuronMinimumDissolveDelayToVote!==void 0?[E(e.neuronMinimumDissolveDelayToVote)]:[],neuron_maximum_age_bonus:e.neuronMaximumAgeBonus!==void 0?[tt(e.neuronMaximumAgeBonus)]:[],neuron_minimum_stake:e.neuronMinimumStake!==void 0?[F(e.neuronMinimumStake)]:[],proposal_wait_for_quiet_deadline_increase:e.proposalWaitForQuietDeadlineIncrease!==void 0?[E(e.proposalWaitForQuietDeadlineIncrease)]:[],proposal_initial_voting_period:e.proposalInitialVotingPeriod!==void 0?[E(e.proposalInitialVotingPeriod)]:[],proposal_rejection_fee:e.proposalRejectionFee!==void 0?[F(e.proposalRejectionFee)]:[],voting_reward_parameters:e.votingRewardParameters!==void 0?[Ai(e.votingRewardParameters)]:[]}),Do=e=>({total:e.total!==void 0?[F(e.total)]:[]}),qi=e=>({treasury_distribution:e.treasuryDistribution!==void 0?[Do(e.treasuryDistribution)]:[],developer_distribution:e.developerDistribution!==void 0?[Gi(e.developerDistribution)]:[],swap_distribution:e.swapDistribution!==void 0?[Do(e.swapDistribution)]:[]}),Ui=e=>({controller:e.controller!==void 0?[q.fromText(e.controller)]:[],dissolve_delay:e.dissolveDelay!==void 0?[E(e.dissolveDelay)]:[],memo:e.memo!==void 0?[e.memo]:[],vesting_period:e.vestingPeriod!==void 0?[E(e.vestingPeriod)]:[],stake:e.stake!==void 0?[F(e.stake)]:[]}),Gi=e=>({developer_neurons:e.developerNeurons.map(Ui)}),Ki=e=>({url:e.url!==void 0?[e.url]:[],governance_parameters:e.governanceParameters!==void 0?[Ei(e.governanceParameters)]:[],fallback_controller_principal_ids:e.fallbackControllerPrincipalIds.map(t=>q.fromText(t)),logo:e.logo!==void 0?[tr(e.logo)]:[],name:e.name!==void 0?[e.name]:[],ledger_parameters:e.ledgerParameters!==void 0?[Vi(e.ledgerParameters)]:[],description:e.description!==void 0?[e.description]:[],dapp_canisters:e.dappCanisters.map(t=>({id:[q.fromText(t)]})),swap_parameters:e.swapParameters!==void 0?[Mi(e.swapParameters)]:[],initial_token_distribution:e.initialTokenDistribution!==void 0?[qi(e.initialTokenDistribution)]:[]}),nr=e=>{if("ExecuteNnsFunction"in e){let t=e.ExecuteNnsFunction;if(t.payloadBytes===void 0)throw new Error("payloadBytes not found");return{ExecuteNnsFunction:{nns_function:t.nnsFunctionId,payload:Si(t.payloadBytes)}}}if("ManageNeuron"in e){let t=e.ManageNeuron;return{ManageNeuron:Ji(t)}}if("ApproveGenesisKyc"in e)return{ApproveGenesisKyc:{principals:e.ApproveGenesisKyc.principals.map(q.fromText)}};if("ManageNetworkEconomics"in e){let t=e.ManageNetworkEconomics;return{ManageNetworkEconomics:{neuron_minimum_stake_e8s:t.neuronMinimumStake,max_proposals_to_keep_per_topic:t.maxProposalsToKeepPerTopic,neuron_management_fee_per_proposal_e8s:t.neuronManagementFeePerProposal,reject_cost_e8s:t.rejectCost,transaction_fee_e8s:t.transactionFee,neuron_spawn_dissolve_delay_seconds:t.neuronSpawnDissolveDelaySeconds,minimum_icp_xdr_rate:t.minimumIcpXdrRate,maximum_node_provider_rewards_e8s:t.maximumNodeProviderRewards,neurons_fund_economics:$i(t.neuronsFundEconomics)}}}if("RewardNodeProvider"in e){let t=e.RewardNodeProvider;return{RewardNodeProvider:{node_provider:t.nodeProvider?[nt(t.nodeProvider)]:[],amount_e8s:t.amountE8s,reward_mode:t.rewardMode!=null?[Lo(t.rewardMode)]:[]}}}if("RewardNodeProviders"in e){let t=e.RewardNodeProviders;return{RewardNodeProviders:{use_registry_derived_rewards:t.useRegistryDerivedRewards===void 0?[]:[t.useRegistryDerivedRewards],rewards:t.rewards.map(n=>({node_provider:n.nodeProvider?[nt(n.nodeProvider)]:[],amount_e8s:n.amountE8s,reward_mode:n.rewardMode!=null?[Lo(n.rewardMode)]:[]}))}}}if("AddOrRemoveNodeProvider"in e){let t=e.AddOrRemoveNodeProvider;return{AddOrRemoveNodeProvider:{change:t.change?[Wi(t.change)]:[]}}}if("Motion"in e)return{Motion:{motion_text:e.Motion.motionText}};if("SetDefaultFollowees"in e)return{SetDefaultFollowees:{default_followees:e.SetDefaultFollowees.defaultFollowees.map(n=>[n.topic,Ti(n.followees)])}};if("RegisterKnownNeuron"in e){let t=e.RegisterKnownNeuron;return{RegisterKnownNeuron:{id:[{id:t.id}],known_neuron_data:[{name:t.name,description:t.description!==void 0?[t.description]:[]}]}}}if("SetSnsTokenSwapOpenTimeWindow"in e){let{request:t,swapCanisterId:n}=e.SetSnsTokenSwapOpenTimeWindow;return{SetSnsTokenSwapOpenTimeWindow:{request:t===void 0?[]:[{open_time_window:t.openTimeWindow===void 0?[]:[{start_timestamp_seconds:t.openTimeWindow.startTimestampSeconds,end_timestamp_seconds:t.openTimeWindow.endTimestampSeconds}]}],swap_canister_id:n===void 0?[]:[q.fromText(n)]}}}if("OpenSnsTokenSwap"in e){let{communityFundInvestmentE8s:t,targetSwapCanisterId:n,params:o}=e.OpenSnsTokenSwap;return{OpenSnsTokenSwap:{community_fund_investment_e8s:S(t),target_swap_canister_id:S(n),params:o===void 0?[]:[{min_participant_icp_e8s:o.minParticipantIcpE8s,max_icp_e8s:o.maxIcpE8s,swap_due_timestamp_seconds:o.swapDueTimestampSeconds,min_participants:o.minParticipants,sns_token_e8s:o.snsTokenE8s,max_participant_icp_e8s:o.maxParticipantIcpE8s,min_icp_e8s:o.minIcpE8s,sale_delay_seconds:S(o.saleDelaySeconds),neuron_basket_construction_parameters:S(o.neuronBasketConstructionParameters),max_direct_participation_icp_e8s:S(o.maxDirectParticipationIcpE8s),min_direct_participation_icp_e8s:S(o.minDirectParticipationIcpE8s)}]}}}if("CreateServiceNervousSystem"in e)return{CreateServiceNervousSystem:Ki(e.CreateServiceNervousSystem)};throw new g(e)},Hi=e=>{if("Split"in e)return{Split:{amount_e8s:e.Split.amount}};if("Follow"in e){let t=e.Follow;return{Follow:{topic:t.topic,followees:t.followees.map(ao)}}}if("ClaimOrRefresh"in e){let t=e.ClaimOrRefresh;return{ClaimOrRefresh:{by:t.by?[Xi(t.by)]:[]}}}if("Configure"in e){let t=e.Configure;return{Configure:{operation:t.operation?[ji(t.operation)]:[]}}}if("RegisterVote"in e){let t=e.RegisterVote;return{RegisterVote:{vote:t.vote,proposal:t.proposal?[er(t.proposal)]:[]}}}if("DisburseToNeuron"in e){let t=e.DisburseToNeuron;return{DisburseToNeuron:{dissolve_delay_seconds:t.dissolveDelaySeconds,kyc_verified:t.kycVerified,amount_e8s:t.amount,new_controller:t.newController?[q.fromText(t.newController)]:[],nonce:t.nonce}}}if("MergeMaturity"in e)return{MergeMaturity:{percentage_to_merge:e.MergeMaturity.percentageToMerge}};if("StakeMaturity"in e){let{percentageToStake:t}=e.StakeMaturity;return{StakeMaturity:{percentage_to_stake:S(t)}}}if("MakeProposal"in e){let t=e.MakeProposal;return{MakeProposal:{url:t.url,title:[],action:t.action?[nr(t.action)]:[],summary:t.summary}}}if("Disburse"in e){let t=e.Disburse;return{Disburse:{to_account:t.toAccountId?[co(t.toAccountId)]:[],amount:t.amount?[or(t.amount)]:[]}}}if("Spawn"in e){let t=e.Spawn;return{Spawn:{percentage_to_spawn:t.percentageToSpawn===void 0?[]:[t.percentageToSpawn],new_controller:t.newController?[q.fromText(t.newController)]:[],nonce:[]}}}if("Merge"in e){let t=e.Merge;return{Merge:{source_neuron_id:t.sourceNeuronId?[{id:t.sourceNeuronId}]:[]}}}throw new g(e)},ji=e=>{if("RemoveHotKey"in e){let t=e.RemoveHotKey;return{RemoveHotKey:{hot_key_to_remove:t.hotKeyToRemove!=null?[q.fromText(t.hotKeyToRemove)]:[]}}}if("AddHotKey"in e){let t=e.AddHotKey;return{AddHotKey:{new_hot_key:t.newHotKey?[q.fromText(t.newHotKey)]:[]}}}if("StopDissolving"in e)return{StopDissolving:{}};if("StartDissolving"in e)return{StartDissolving:{}};if("IncreaseDissolveDelay"in e)return{IncreaseDissolveDelay:{additional_dissolve_delay_seconds:e.IncreaseDissolveDelay.additionalDissolveDelaySeconds}};if("JoinCommunityFund"in e||"LeaveCommunityFund"in e)return e;if("SetDissolveTimestamp"in e)return{SetDissolveTimestamp:{dissolve_timestamp_seconds:e.SetDissolveTimestamp.dissolveTimestampSeconds}};if("ChangeAutoStakeMaturity"in e){let{requestedSettingForAutoStakeMaturity:t}=e.ChangeAutoStakeMaturity;return{ChangeAutoStakeMaturity:{requested_setting_for_auto_stake_maturity:t}}}throw new g(e)},Wi=e=>{if("ToRemove"in e)return{ToRemove:nt(e.ToRemove)};if("ToAdd"in e)return{ToAdd:nt(e.ToAdd)};throw new g(e)},nt=e=>({id:e.id!=null?[q.fromText(e.id)]:[],reward_account:e.rewardAccount!=null?[co(e.rewardAccount)]:[]}),or=e=>({e8s:e}),co=e=>({hash:ki(e)}),$i=e=>{if(et(e))return[];let{maximumIcpXdrRate:t,maxTheoreticalNeuronsFundParticipationAmountXdr:n,neuronsFundMatchedFundingCurveCoefficients:o,minimumIcpXdrRate:r}=e,i=u=>et(u)?[]:[{basis_points:S(u.basisPoints)}],s=u=>et(u)?[]:[{human_readable:S(u.humanReadable)}],c=u=>et(u)?[]:[{contribution_threshold_xdr:s(u.contributionThresholdXdr),full_participation_milestone_xdr:s(u.fullParticipationMilestoneXdr),one_third_participation_milestone_xdr:s(u.oneThirdParticipationMilestoneXdr)}];return[{maximum_icp_xdr_rate:i(t),neurons_fund_matched_funding_curve_coefficients:c(o),minimum_icp_xdr_rate:i(r),max_theoretical_neurons_fund_participation_amount_xdr:s(n)}]},Lo=e=>{if("RewardToNeuron"in e)return{RewardToNeuron:{dissolve_delay_seconds:e.RewardToNeuron.dissolveDelaySeconds}};if("RewardToAccount"in e)return{RewardToAccount:{to_account:e.RewardToAccount.toAccount!=null?[co(e.RewardToAccount.toAccount)]:[]}};throw new g(e)},Xi=e=>{if("NeuronIdOrSubaccount"in e)return{NeuronIdOrSubaccount:{}};if("Memo"in e)return{Memo:e.Memo};if("MemoAndController"in e)return{MemoAndController:{memo:e.MemoAndController.memo,controller:e.MemoAndController.controller?[e.MemoAndController.controller]:[]}};throw new g(e)},rr=({neuronIds:e,includeEmptyNeurons:t})=>({neuron_ids:BigUint64Array.from(e??[]),include_neurons_readable_by_caller:!e,include_empty_neurons_readable_by_caller:S(t)}),Ji=({id:e,command:t,neuronIdOrSubaccount:n})=>({id:e?[ao(e)]:[],command:t?[Hi(t)]:[],neuron_id_or_subaccount:n?[Fi(n)]:[]}),ir=({includeRewardStatus:e,beforeProposal:t,excludeTopic:n,includeStatus:o,limit:r,includeAllManageNeuronProposals:i,omitLargeFields:s})=>({include_reward_status:Int32Array.from(e),before_proposal:t?[er(t)]:[],limit:r,exclude_topic:Int32Array.from(n),include_all_manage_neuron_proposals:i!==void 0?[i]:[],include_status:Int32Array.from(o),omit_large_fields:S(s)}),sr=e=>({id:[],command:[{ClaimOrRefresh:{by:[{NeuronIdOrSubaccount:{}}]}}],neuron_id_or_subaccount:[{NeuronId:{id:e.neuronId}}]}),ar=({memo:e,controller:t})=>{let n={ClaimOrRefresh:{by:[{MemoAndController:{controller:t==null?[]:[t],memo:e}}]}};return{id:[],command:[n],neuron_id_or_subaccount:[]}},cr=({neuronId:e,amount:t})=>({id:[],command:[{Split:{amount_e8s:t}}],neuron_id_or_subaccount:[{NeuronId:{id:e}}]});var ur=({neuronId:e,vote:t,proposalId:n})=>ee({neuronId:e,command:{RegisterVote:{vote:t,proposal:[{id:n}]}}}),_r=e=>{let t={MakeProposal:{url:e.url,title:e.title!=null?[e.title]:[],summary:e.summary,action:[nr(e.action)]}};return{id:[],command:[t],neuron_id_or_subaccount:[{NeuronId:{id:e.neuronId}}]}},dr=({neuronId:e,topic:t,followees:n})=>ee({neuronId:e,command:{Follow:{topic:t,followees:n.map(o=>({id:o}))}}}),pr=({neuronId:e,toAccountIdentifier:t,amount:n})=>ee({neuronId:e,command:{Disburse:{to_account:t!==void 0?[t.toAccountIdentifierHash()]:[],amount:n!==void 0?[or(n)]:[]}}}),lr=({neuronId:e,percentageToMerge:t})=>ee({neuronId:e,command:{MergeMaturity:{percentage_to_merge:t}}}),mr=({neuronId:e,percentageToStake:t})=>ee({neuronId:e,command:{StakeMaturity:{percentage_to_stake:S(t)}}}),fr=({neuronId:e,percentageToSpawn:t,newController:n,nonce:o})=>ee({neuronId:e,command:{Spawn:{percentage_to_spawn:t===void 0?[]:[t],new_controller:n===void 0?[]:[n],nonce:o===void 0?[]:[o]}}}),Nr=({neuronId:e,principal:t})=>Y({neuronId:e,operation:{AddHotKey:{new_hot_key:[t]}}}),wr=({neuronId:e,principal:t})=>Y({neuronId:e,operation:{RemoveHotKey:{hot_key_to_remove:[t]}}}),yr=({neuronId:e,additionalDissolveDelaySeconds:t})=>Y({neuronId:e,operation:{IncreaseDissolveDelay:{additional_dissolve_delay_seconds:t}}}),Rr=({neuronId:e,dissolveDelaySeconds:t})=>Y({neuronId:e,operation:{SetDissolveTimestamp:{dissolve_timestamp_seconds:BigInt(t)}}}),gr=e=>Y({neuronId:e,operation:{JoinCommunityFund:{}}}),Or=({neuronId:e,autoStake:t})=>Y({neuronId:e,operation:{ChangeAutoStakeMaturity:{requested_setting_for_auto_stake_maturity:t}}}),hr=e=>Y({neuronId:e,operation:{LeaveCommunityFund:{}}}),uo=({sourceNeuronId:e,targetNeuronId:t})=>ee({neuronId:t,command:{Merge:{source_neuron_id:[{id:e}]}}}),vr=e=>Y({neuronId:e,operation:{StartDissolving:{}}}),xr=e=>Y({neuronId:e,operation:{StopDissolving:{}}}),ee=({neuronId:e,command:t})=>({id:[{id:e}],command:[t],neuron_id_or_subaccount:[]}),Y=({neuronId:e,operation:t})=>ee({neuronId:e,command:{Configure:{operation:[t]}}});import{accountIdentifierFromBytes as zi,principalToAccountIdentifier as Yi}from"@dfinity/ledger-icp";import{Principal as br}from"@dfinity/principal";import{fromDefinedNullable as Qi,fromNullable as d,isNullish as ot,nonNullish as we,toNullable as te,uint8ArrayToArrayOfNumber as Zi}from"@dfinity/utils";var _o=({neuronId:e,neuronInfo:t,rawNeuron:n,canisterId:o})=>{let r=n?Ii({neuron:n,canisterId:o}):void 0;return{neuronId:e,dissolveDelaySeconds:t.dissolve_delay_seconds,recentBallots:t.recent_ballots.map(Tr),neuronType:d(t.neuron_type),createdTimestampSeconds:t.created_timestamp_seconds,state:t.state,joinedCommunityFundTimestampSeconds:t.joined_community_fund_timestamp_seconds.length?t.joined_community_fund_timestamp_seconds[0]:void 0,retrievedAtTimestampSeconds:t.retrieved_at_timestamp_seconds,votingPower:t.voting_power,ageSeconds:t.age_seconds,fullNeuron:r}},Ii=({neuron:e,canisterId:t})=>({id:e.id.length?ne(e.id[0]):void 0,stakedMaturityE8sEquivalent:d(e.staked_maturity_e8s_equivalent),controller:e.controller.length?e.controller[0].toString():void 0,recentBallots:e.recent_ballots.map(Tr),neuronType:d(e.neuron_type),kycVerified:e.kyc_verified,notForProfit:e.not_for_profit,cachedNeuronStake:e.cached_neuron_stake_e8s,createdTimestampSeconds:e.created_timestamp_seconds,autoStakeMaturity:d(e.auto_stake_maturity),maturityE8sEquivalent:e.maturity_e8s_equivalent,agingSinceTimestampSeconds:e.aging_since_timestamp_seconds,neuronFees:e.neuron_fees_e8s,hotKeys:e.hot_keys.map(n=>n.toString()),accountIdentifier:Yi(t,Uint8Array.from(e.account)),joinedCommunityFundTimestampSeconds:e.joined_community_fund_timestamp_seconds.length?e.joined_community_fund_timestamp_seconds[0]:void 0,dissolveState:e.dissolve_state.length?Di(e.dissolve_state[0]):void 0,spawnAtTimesSeconds:e.spawn_at_timestamp_seconds[0],followees:e.followees.map(([n,o])=>Fr({topic:n,followees:o}))}),ta=({neuron:e,account:t})=>({id:we(e.id)?te({id:e.id}):[],staked_maturity_e8s_equivalent:te(e.stakedMaturityE8sEquivalent),controller:we(e.controller)?te(br.from(e.controller)):[],recent_ballots:e.recentBallots.map(n=>({vote:n.vote,proposal_id:we(n.proposalId)?te({id:n.proposalId}):[]})),kyc_verified:e.kycVerified,neuron_type:te(e.neuronType),not_for_profit:e.notForProfit,cached_neuron_stake_e8s:e.cachedNeuronStake,created_timestamp_seconds:e.createdTimestampSeconds,auto_stake_maturity:te(e.autoStakeMaturity),maturity_e8s_equivalent:e.maturityE8sEquivalent,aging_since_timestamp_seconds:e.agingSinceTimestampSeconds,neuron_fees_e8s:e.neuronFees,hot_keys:e.hotKeys.map(n=>br.from(n)),account:t,joined_community_fund_timestamp_seconds:te(e.joinedCommunityFundTimestampSeconds),dissolve_state:we(e.dissolveState)?[e.dissolveState]:[],spawn_at_timestamp_seconds:te(e.spawnAtTimesSeconds),followees:e.followees.map(n=>[n.topic,{followees:n.followees.map(o=>({id:o}))}]),transfer:[],known_neuron_data:[]}),Tr=({vote:e,proposal_id:t})=>({vote:e,proposalId:t.length?ne(t[0]):void 0}),Di=e=>"DissolveDelaySeconds"in e?{DissolveDelaySeconds:e.DissolveDelaySeconds}:{WhenDissolvedTimestampSeconds:e.WhenDissolvedTimestampSeconds},Fr=({topic:e,followees:t})=>({topic:e,followees:t.followees.map(ne)}),ne=({id:e})=>e,Li=e=>{if("NeuronId"in e)return{NeuronId:e.NeuronId.id};if("Subaccount"in e)return{Subaccount:Zi(Uint8Array.from(e.Subaccount))};throw new g(e)},es=({neuronId:e,ballot:t})=>{let{vote:n,voting_power:o}=t;return{neuronId:e,vote:n,votingPower:o}},ts=({title:e,url:t,action:n,summary:o})=>({title:e.length?e[0]:void 0,url:t,action:n.length?Pr(n[0]):void 0,summary:o}),Pr=e=>{if("ExecuteNnsFunction"in e)return{ExecuteNnsFunction:{nnsFunctionId:e.ExecuteNnsFunction.nns_function}};if("ManageNeuron"in e){let t=e.ManageNeuron;return{ManageNeuron:{id:t.id.length?ne(t.id[0]):void 0,command:t.command.length?os(t.command[0]):void 0,neuronIdOrSubaccount:t.neuron_id_or_subaccount.length?Li(t.neuron_id_or_subaccount[0]):void 0}}}if("ApproveGenesisKyc"in e)return{ApproveGenesisKyc:{principals:e.ApproveGenesisKyc.principals.map(n=>n.toString())}};if("ManageNetworkEconomics"in e){let t=e.ManageNetworkEconomics;return{ManageNetworkEconomics:{neuronMinimumStake:t.neuron_minimum_stake_e8s,maxProposalsToKeepPerTopic:t.max_proposals_to_keep_per_topic,neuronManagementFeePerProposal:t.neuron_management_fee_per_proposal_e8s,rejectCost:t.reject_cost_e8s,transactionFee:t.transaction_fee_e8s,neuronSpawnDissolveDelaySeconds:t.neuron_spawn_dissolve_delay_seconds,minimumIcpXdrRate:t.minimum_icp_xdr_rate,maximumNodeProviderRewards:t.maximum_node_provider_rewards_e8s,neuronsFundEconomics:ss(t.neurons_fund_economics)}}}if("RewardNodeProvider"in e){let t=e.RewardNodeProvider;return{RewardNodeProvider:{nodeProvider:t.node_provider.length?rt(t.node_provider[0]):void 0,amountE8s:t.amount_e8s,rewardMode:t.reward_mode.length?kr(t.reward_mode[0]):void 0}}}if("RewardNodeProviders"in e){let t=e.RewardNodeProviders;return{RewardNodeProviders:{useRegistryDerivedRewards:t.use_registry_derived_rewards.length?t.use_registry_derived_rewards[0]:void 0,rewards:t.rewards.map(n=>({nodeProvider:n.node_provider.length?rt(n.node_provider[0]):void 0,amountE8s:n.amount_e8s,rewardMode:n.reward_mode.length?kr(n.reward_mode[0]):void 0}))}}}if("AddOrRemoveNodeProvider"in e){let t=e.AddOrRemoveNodeProvider;return{AddOrRemoveNodeProvider:{change:t.change.length?is(t.change[0]):void 0}}}if("Motion"in e)return{Motion:{motionText:e.Motion.motion_text}};if("SetDefaultFollowees"in e)return{SetDefaultFollowees:{defaultFollowees:e.SetDefaultFollowees.default_followees.map(([n,o])=>Fr({topic:n,followees:o}))}};if("RegisterKnownNeuron"in e){let t=e.RegisterKnownNeuron;return{RegisterKnownNeuron:us(t)}}if("SetSnsTokenSwapOpenTimeWindow"in e){let t=e.SetSnsTokenSwapOpenTimeWindow,n=t.request?.length?{openTimeWindow:t.request[0].open_time_window.length?{startTimestampSeconds:t.request[0].open_time_window[0].start_timestamp_seconds,endTimestampSeconds:t.request[0].open_time_window[0].end_timestamp_seconds}:void 0}:void 0,o=t?.swap_canister_id.length?t.swap_canister_id[0].toString():void 0;return{SetSnsTokenSwapOpenTimeWindow:{request:n,swapCanisterId:o}}}if("OpenSnsTokenSwap"in e){let t=e.OpenSnsTokenSwap,n=d(t.params);return{OpenSnsTokenSwap:{communityFundInvestmentE8s:d(t.community_fund_investment_e8s),targetSwapCanisterId:d(t.target_swap_canister_id),params:n&&{minParticipantIcpE8s:n.min_participant_icp_e8s,maxIcpE8s:n.max_icp_e8s,swapDueTimestampSeconds:n.swap_due_timestamp_seconds,minParticipants:n.min_participants,snsTokenE8s:n.sns_token_e8s,maxParticipantIcpE8s:n.max_participant_icp_e8s,minIcpE8s:n.min_icp_e8s,saleDelaySeconds:d(n.sale_delay_seconds),neuronBasketConstructionParameters:d(n.neuron_basket_construction_parameters),maxDirectParticipationIcpE8s:d(n.max_direct_participation_icp_e8s),minDirectParticipationIcpE8s:d(n.min_direct_participation_icp_e8s)}}}}if("CreateServiceNervousSystem"in e){let t=e.CreateServiceNervousSystem;return{CreateServiceNervousSystem:{url:d(t.url),governanceParameters:fs(d(t.governance_parameters)),fallbackControllerPrincipalIds:t.fallback_controller_principal_ids.map(n=>n.toString()),logo:Vr(d(t.logo)),name:d(t.name),ledgerParameters:ls(d(t.ledger_parameters)),description:d(t.description),dappCanisters:t.dapp_canisters.map(ps)??[],swapParameters:ws(d(t.swap_parameters)),initialTokenDistribution:gs(d(t.initial_token_distribution))}}}throw new g(e)},ns=e=>({no:e.no,yes:e.yes,total:e.total,timestampSeconds:e.timestamp_seconds}),os=e=>{if("Spawn"in e){let t=e.Spawn;return{Spawn:{newController:t.new_controller.length?t.new_controller[0].toString():void 0,percentageToSpawn:t.percentage_to_spawn.length?t.percentage_to_spawn[0]:0}}}if("Split"in e)return{Split:{amount:e.Split.amount_e8s}};if("Follow"in e){let t=e.Follow;return{Follow:{topic:t.topic,followees:t.followees.map(ne)}}}if("ClaimOrRefresh"in e){let t=e.ClaimOrRefresh;return{ClaimOrRefresh:{by:t.by.length?cs(t.by[0]):void 0}}}if("Configure"in e){let t=e.Configure;return{Configure:{operation:t.operation.length?rs(t.operation[0]):void 0}}}if("RegisterVote"in e){let t=e.RegisterVote;return{RegisterVote:{vote:t.vote,proposal:t.proposal.length?ne(t.proposal[0]):void 0}}}if("DisburseToNeuron"in e){let t=e.DisburseToNeuron;return{DisburseToNeuron:{dissolveDelaySeconds:t.dissolve_delay_seconds,kycVerified:t.kyc_verified,amount:t.amount_e8s,newController:t.new_controller.length?t.new_controller[0].toString():void 0,nonce:t.nonce}}}if("MergeMaturity"in e)return{MergeMaturity:{percentageToMerge:e.MergeMaturity.percentage_to_merge}};if("StakeMaturity"in e){let{percentage_to_stake:t}=e.StakeMaturity;return{StakeMaturity:{percentageToStake:d(t)}}}if("MakeProposal"in e){let t=e.MakeProposal;return{MakeProposal:{title:t.title.length?t.title[0]:void 0,url:t.url,action:t.action.length?Pr(t.action[0]):void 0,summary:t.summary}}}if("Disburse"in e){let t=e.Disburse;return{Disburse:{toAccountId:t.to_account.length?po(t.to_account[0]):void 0,amount:t.amount.length?as(t.amount[0]):void 0}}}if("Merge"in e){let t=e.Merge;return{Merge:{sourceNeuronId:t.source_neuron_id.length?t.source_neuron_id[0].id:void 0}}}throw new g(e)},rs=e=>{if("RemoveHotKey"in e){let t=e.RemoveHotKey;return{RemoveHotKey:{hotKeyToRemove:t.hot_key_to_remove.length?t.hot_key_to_remove[0].toString():void 0}}}if("AddHotKey"in e){let t=e.AddHotKey;return{AddHotKey:{newHotKey:t.new_hot_key.length?t.new_hot_key[0].toString():void 0}}}if("StopDissolving"in e)return{StopDissolving:{}};if("StartDissolving"in e)return{StartDissolving:{}};if("IncreaseDissolveDelay"in e)return{IncreaseDissolveDelay:{additionalDissolveDelaySeconds:e.IncreaseDissolveDelay.additional_dissolve_delay_seconds}};if("JoinCommunityFund"in e||"LeaveCommunityFund"in e)return e;if("SetDissolveTimestamp"in e)return{SetDissolveTimestamp:{dissolveTimestampSeconds:e.SetDissolveTimestamp.dissolve_timestamp_seconds}};if("ChangeAutoStakeMaturity"in e){let{requested_setting_for_auto_stake_maturity:t}=e.ChangeAutoStakeMaturity;return{ChangeAutoStakeMaturity:{requestedSettingForAutoStakeMaturity:t}}}throw new g(e)},is=e=>{if("ToRemove"in e)return{ToRemove:rt(e.ToRemove)};if("ToAdd"in e)return{ToAdd:rt(e.ToAdd)};throw new g(e)},ss=e=>{let t=d(e);if(ot(t))return;let{maximum_icp_xdr_rate:n,neurons_fund_matched_funding_curve_coefficients:o,max_theoretical_neurons_fund_participation_amount_xdr:r,minimum_icp_xdr_rate:i}=t,s=l=>{let p=d(l);if(ot(p))return;let{basis_points:_}=p,N=d(_);return we(N)?{basisPoints:N}:void 0},c=l=>{let p=d(l);if(ot(p))return;let{human_readable:_}=p,N=d(_);return we(N)?{humanReadable:N}:void 0},u=l=>{let p=d(l);if(ot(p))return;let{full_participation_milestone_xdr:_,one_third_participation_milestone_xdr:N,contribution_threshold_xdr:w}=p;return{fullParticipationMilestoneXdr:c(_),oneThirdParticipationMilestoneXdr:c(N),contributionThresholdXdr:c(w)}};return{maximumIcpXdrRate:s(n),neuronsFundMatchedFundingCurveCoefficients:u(o),maxTheoreticalNeuronsFundParticipationAmountXdr:c(r),minimumIcpXdrRate:s(i)}},rt=e=>({id:e.id.length?e.id[0].toString():void 0,rewardAccount:e.reward_account.length?po(e.reward_account[0]):void 0}),as=e=>e.e8s,po=e=>zi(new Uint8Array(e.hash)),kr=e=>{if("RewardToNeuron"in e)return{RewardToNeuron:{dissolveDelaySeconds:e.RewardToNeuron.dissolve_delay_seconds}};if("RewardToAccount"in e)return{RewardToAccount:{toAccount:e.RewardToAccount.to_account!=null&&e.RewardToAccount.to_account.length?po(e.RewardToAccount.to_account[0]):void 0}};throw new g(e)},cs=e=>{if("NeuronIdOrSubaccount"in e)return{NeuronIdOrSubaccount:{}};if("Memo"in e)return{Memo:e.Memo};if("MemoAndController"in e)return{MemoAndController:{memo:e.MemoAndController.memo,controller:e.MemoAndController.controller.length?e.MemoAndController.controller[0]:void 0}};throw new g(e)},lo=e=>({id:e.id.length?ne(e.id[0]):void 0,ballots:e.ballots.map(t=>es({neuronId:t[0],ballot:t[1]})),rejectCost:e.reject_cost_e8s,proposalTimestampSeconds:e.proposal_timestamp_seconds,rewardEventRound:e.reward_event_round,failedTimestampSeconds:e.failed_timestamp_seconds,deadlineTimestampSeconds:d(e.deadline_timestamp_seconds),decidedTimestampSeconds:e.decided_timestamp_seconds,proposal:e.proposal.length?ts(e.proposal[0]):void 0,proposer:e.proposer.length?ne(e.proposer[0]):void 0,latestTally:e.latest_tally.length?ns(e.latest_tally[0]):void 0,executedTimestampSeconds:e.executed_timestamp_seconds,topic:e.topic,status:e.status,rewardStatus:e.reward_status}),Cr=({response:{neuron_infos:e,full_neurons:t},canisterId:n})=>e.map(([o,r])=>_o({neuronId:o,neuronInfo:r,rawNeuron:t.find(i=>i.id.length&&i.id[0].id===o),canisterId:n})),Ar=({proposal_info:e})=>({proposals:e.map(lo)}),us=({id:e,known_neuron_data:t})=>({id:e[0]?.id??BigInt(0),name:t[0]?.name??"",description:t[0]?.description[0]??""}),it=e=>e===void 0?void 0:{basisPoints:d(e.basis_points)},U=e=>e===void 0?void 0:{seconds:d(e.seconds)},_s=e=>e===void 0?void 0:{secondsAfterUtcMidnight:d(e.seconds_after_utc_midnight)},ds=e=>e===void 0?void 0:{isoCodes:e.iso_codes},P=e=>e===void 0?void 0:{e8s:d(e.e8s)},ps=e=>e===void 0||e.id.length===0?void 0:Qi(e.id).toString(),Vr=e=>e===void 0?void 0:{base64Encoding:d(e.base64_encoding)},ls=e=>e===void 0?void 0:{transactionFee:P(d(e.transaction_fee)),tokenSymbol:d(e.token_symbol),tokenLogo:Vr(d(e.token_logo)),tokenName:d(e.token_name)},ms=e=>e===void 0?void 0:{rewardRateTransitionDuration:U(d(e.reward_rate_transition_duration)),initialRewardRate:it(d(e.initial_reward_rate)),finalRewardRate:it(d(e.final_reward_rate))},fs=e=>e===void 0?void 0:{neuronMaximumDissolveDelayBonus:it(d(e.neuron_maximum_dissolve_delay_bonus)),neuronMaximumAgeForAgeBonus:U(d(e.neuron_maximum_age_for_age_bonus)),neuronMaximumDissolveDelay:U(d(e.neuron_maximum_dissolve_delay)),neuronMinimumDissolveDelayToVote:U(d(e.neuron_minimum_dissolve_delay_to_vote)),neuronMaximumAgeBonus:it(d(e.neuron_maximum_age_bonus)),neuronMinimumStake:P(d(e.neuron_minimum_stake)),proposalWaitForQuietDeadlineIncrease:U(d(e.proposal_wait_for_quiet_deadline_increase)),proposalInitialVotingPeriod:U(d(e.proposal_initial_voting_period)),proposalRejectionFee:P(d(e.proposal_rejection_fee)),votingRewardParameters:ms(d(e.voting_reward_parameters))},Ns=e=>e===void 0?void 0:{dissolveDelayInterval:U(d(e.dissolve_delay_interval)),count:d(e.count)},ws=e=>e===void 0?void 0:{minimumParticipants:d(e.minimum_participants),duration:U(d(e.duration)),neuronBasketConstructionParameters:Ns(d(e.neuron_basket_construction_parameters)),confirmationText:d(e.confirmation_text),maximumParticipantIcp:P(d(e.maximum_participant_icp)),neuronsFundInvestmentIcp:P(d(e.neurons_fund_investment_icp)),minimumIcp:P(d(e.minimum_icp)),minimumParticipantIcp:P(d(e.minimum_participant_icp)),startTime:_s(d(e.start_time)),maximumIcp:P(d(e.maximum_icp)),restrictedCountries:ds(d(e.restricted_countries)),maxDirectParticipationIcp:P(d(e.maximum_direct_participation_icp)),minDirectParticipationIcp:P(d(e.minimum_direct_participation_icp)),neuronsFundParticipation:d(e.neurons_fund_participation)},Sr=e=>e===void 0?void 0:{total:P(d(e.total))},ys=e=>e===void 0?void 0:{controller:e.controller.length===0?void 0:e.controller[0].toString(),dissolveDelay:U(d(e.dissolve_delay)),memo:d(e.memo),vestingPeriod:U(d(e.vesting_period)),stake:P(d(e.stake))},Rs=e=>e===void 0?void 0:{developerNeurons:e.developer_neurons.map(ys)},gs=e=>e===void 0?void 0:{treasuryDistribution:Sr(d(e.treasury_distribution)),developerDistribution:Rs(d(e.developer_distribution)),swapDistribution:Sr(d(e.swap_distribution))};var $e=e=>{let{command:t}=e,n=t[0];if(!n)throw new L({error_message:"Error updating neuron",error_type:0});if("Error"in n)throw new L(n.Error);return n},O=async({request:e,service:t})=>{let n=await t.manage_neuron(e);return $e(n)},Mr=async({request:e,service:t})=>{let n=await t.simulate_manage_neuron(e);return $e(n)};var mo=BigInt(1e8);var qr=class e{constructor(t,n,o,r,i){this.canisterId=t;this.service=n;this.certifiedService=o;this.oldListNeuronsCertifiedService=r;this.agent=i;this.listNeurons=async({certified:t=!0,neuronIds:n,includeEmptyNeurons:o})=>{let r=rr({neuronIds:n,includeEmptyNeurons:o}),c=await(st(o)&&t?this.oldListNeuronsCertifiedService:this.getGovernanceService(t)).list_neurons(r);return Cr({response:c,canisterId:this.canisterId})};this.listKnownNeurons=async(t=!0)=>(await this.getGovernanceService(t).list_known_neurons()).known_neurons.map(o=>({id:b(o.id)?.id??BigInt(0),name:b(o.known_neuron_data)?.name??"",description:b(b(o.known_neuron_data)?.description??[])}));this.getLastestRewardEvent=async(t=!0)=>this.getGovernanceService(t).get_latest_reward_event();this.listProposals=async({request:t,certified:n=!0})=>{let o=ir(t),r=await this.getGovernanceService(n).list_proposals(o);return Ar(r)};this.stakeNeuron=async({stake:t,principal:n,fromSubAccount:o,ledgerCanister:r,createdAt:i,fee:s})=>{if(t<mo)throw new We(t);let c=new Uint8Array((0,wo.default)(8)),u=Er(c),l=this.buildNeuronStakeSubAccount(c,n),p=fo.fromPrincipal({principal:this.canisterId,subAccount:l});await r.transfer({memo:u,amount:t,fromSubAccount:o,to:p,createdAt:i,fee:s});let _=await this.claimOrRefreshNeuronFromAccount({controller:n,memo:u});if(st(_))throw new je;return _};this.stakeNeuronIcrc1=async({stake:t,principal:n,fromSubAccount:o,ledgerCanister:r,createdAt:i,fee:s})=>{if(t<mo)throw new We(t);let c=new Uint8Array((0,wo.default)(8)),u=Er(c),l=this.getNeuronStakeSubAccountBytes(c,n);await r.icrc1Transfer({icrc1Memo:c,amount:t,fromSubAccount:o,to:{owner:this.canisterId,subaccount:[l]},createdAt:i,fee:s});let p=await this.claimOrRefreshNeuronFromAccount({controller:n,memo:u});if(st(p))throw new je;return p};this.increaseDissolveDelay=async({neuronId:t,additionalDissolveDelaySeconds:n})=>{let o=yr({neuronId:t,additionalDissolveDelaySeconds:n});await O({request:o,service:this.certifiedService})};this.setDissolveDelay=async({neuronId:t,dissolveDelaySeconds:n})=>{let o=Rr({neuronId:t,dissolveDelaySeconds:n});await O({request:o,service:this.certifiedService})};this.startDissolving=async t=>{let n=vr(t);await O({request:n,service:this.certifiedService})};this.stopDissolving=async t=>{let n=xr(t);await O({request:n,service:this.certifiedService})};this.joinCommunityFund=async t=>{let n=gr(t);await O({request:n,service:this.certifiedService})};this.autoStakeMaturity=async t=>{await O({request:Or(t),service:this.certifiedService})};this.leaveCommunityFund=async t=>{let n=hr(t);await O({request:n,service:this.certifiedService})};this.setNodeProviderAccount=async t=>{Br(t);let n=fo.fromHex(t),o=await this.certifiedService.update_node_provider({reward_account:[n.toAccountIdentifierHash()]});if("Err"in o)throw new L(o.Err)};this.mergeNeurons=async t=>{let n=uo(t);await O({request:n,service:this.certifiedService})};this.simulateMergeNeurons=async t=>{let n=uo(t),o=await Mr({request:n,service:this.certifiedService}),r,i,s,c;if("Merge"in o&&G(r=o.Merge)&&G(i=b(r.target_neuron_info))&&G(s=b(r.target_neuron))&&G(c=b(s.id)?.id))return _o({neuronId:c,neuronInfo:i,rawNeuron:s,canisterId:this.canisterId});throw new D(`simulateMergeNeurons: Unrecognized Merge error in ${JSON.stringify(o)}`)};this.splitNeuron=async({neuronId:t,amount:n})=>{let o=cr({neuronId:t,amount:n}),r=await this.certifiedService.manage_neuron(o),i=$e(r);if("Split"in i){let s=b(i.Split.created_neuron_id);if(st(s))throw new L({error_message:"Unexpected error splitting neuron. No neuronId in Split response.",error_type:0});return s.id}throw new D(`Unrecognized Split error in ${JSON.stringify(r)}`)};this.getProposal=async({proposalId:t,certified:n=!0})=>{let[o]=await this.getGovernanceService(n).get_proposal_info(t);return o?lo(o):void 0};this.makeProposal=async t=>{let n=_r(t),o=await O({request:n,service:this.certifiedService});return"MakeProposal"in o?b(o.MakeProposal.proposal_id)?.id:void 0};this.registerVote=async({neuronId:t,vote:n,proposalId:o})=>{let r=ur({neuronId:t,vote:n,proposalId:o});await O({request:r,service:this.certifiedService})};this.setFollowees=async t=>{let n=dr(t);await O({request:n,service:this.certifiedService})};this.disburse=async({neuronId:t,toAccountId:n,amount:o})=>{G(n)&&Br(n);let r=G(n)?fo.fromHex(n):void 0,i=pr({neuronId:t,toAccountIdentifier:r,amount:o});await O({request:i,service:this.certifiedService})};this.mergeMaturity=async({neuronId:t,percentageToMerge:n})=>{No(n);let o=lr({neuronId:t,percentageToMerge:n});await O({request:o,service:this.certifiedService})};this.stakeMaturity=async({neuronId:t,percentageToStake:n})=>{No(n??100),await O({request:mr({neuronId:t,percentageToStake:n}),service:this.certifiedService})};this.spawnNeuron=async({neuronId:t,percentageToSpawn:n,newController:o,nonce:r})=>{G(n)&&No(n);let i=fr({neuronId:t,percentageToSpawn:n,newController:o,nonce:r}),s=await this.certifiedService.manage_neuron(i),c=$e(s),u;if("Spawn"in c&&G(u=b(c.Spawn.created_neuron_id)?.id))return u;throw new D(`Unrecognized Spawn error in ${JSON.stringify(s)}`)};this.addHotkey=async({neuronId:t,principal:n})=>{let o=Nr({neuronId:t,principal:n});await O({request:o,service:this.certifiedService})};this.removeHotkey=async({neuronId:t,principal:n})=>{let o=wr({neuronId:t,principal:n});await O({request:o,service:this.certifiedService})};this.claimOrRefreshNeuronFromAccount=async({memo:t,controller:n})=>{let o=ar({memo:t,controller:n}),r=await this.certifiedService.manage_neuron(o),i;if(G(i=b(r.command))&&"ClaimOrRefresh"in i)return b(i.ClaimOrRefresh.refreshed_neuron_id)?.id;throw new D(`Unrecognized ClaimOrRefresh error in ${JSON.stringify(r)}`)};this.claimOrRefreshNeuron=async t=>{let n=sr(t),o=await this.service.manage_neuron(n),r;if(G(r=b(o.command))&&"ClaimOrRefresh"in r)return b(r.ClaimOrRefresh.refreshed_neuron_id)?.id;throw new D(`Unrecognized ClaimOrRefresh error in ${JSON.stringify(o)}`)};this.buildNeuronStakeSubAccount=(t,n)=>hs.fromBytes(this.getNeuronStakeSubAccountBytes(t,n));this.getNeuronStakeSubAccountBytes=(t,n)=>{let o=xs("neuron-stake"),r=vo.create();return r.update(vs([12,...o,...n.toUint8Array(),...t])),r.digest()};this.getNeuron=async({certified:t=!0,neuronId:n})=>{let[o]=await this.listNeurons({certified:t,neuronIds:[n]});return o};this.canisterId=t,this.service=n,this.certifiedService=o,this.oldListNeuronsCertifiedService=r,this.agent=i}static create(t={}){let n=t.canisterId??yo,{service:o,certifiedService:r,agent:i}=bs({options:{...t,canisterId:n},idlFactory:Zo,certifiedIdlFactory:Qo}),s=t.oldListNeuronsServiceOverride??Os.createActor(Io,{agent:i,canisterId:n});return new e(n,o,r,s,i)}getGovernanceService(t){return t?this.certifiedService:this.service}};export{Zo as a,Le as b,je as c,We as d,D as e,L as f,g,rr as h,ta as i,qr as j};
|
|
3
|
+
/*! Bundled license information:
|
|
4
|
+
|
|
5
|
+
ieee754/index.js:
|
|
6
|
+
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
7
|
+
|
|
8
|
+
buffer/index.js:
|
|
9
|
+
(*!
|
|
10
|
+
* The buffer module from node.js, for the browser.
|
|
11
|
+
*
|
|
12
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
13
|
+
* @license MIT
|
|
14
|
+
*)
|
|
15
|
+
|
|
16
|
+
@noble/hashes/esm/utils.js:
|
|
17
|
+
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
18
|
+
*/
|
|
19
|
+
//# sourceMappingURL=chunk-ZSTGGZGS.js.map
|