@dfinity/nns 7.0.1 → 7.0.2
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/LICENSE +1 -1
- package/dist/candid/genesis_token.did +1 -1
- package/dist/candid/governance.certified.idl.js +14 -12
- package/dist/candid/governance.d.ts +11 -8
- package/dist/candid/governance.did +13 -9
- package/dist/candid/governance.idl.js +14 -12
- package/dist/candid/governance_test.certified.idl.js +14 -12
- package/dist/candid/governance_test.d.ts +11 -8
- package/dist/candid/governance_test.did +13 -9
- package/dist/candid/governance_test.idl.js +14 -12
- package/dist/candid/old_list_neurons_service.certified.idl.js +59 -56
- package/dist/candid/sns_wasm.did +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/index.cjs.js.map +3 -3
- package/dist/esm/chunk-BL4SIQCO.js +19 -0
- package/dist/esm/chunk-BL4SIQCO.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/package.json +3 -3
- package/dist/esm/chunk-QAGO7B5R.js +0 -19
- package/dist/esm/chunk-QAGO7B5R.js.map +0 -7
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{a as Ze,b as ni,c as Vo}from"./chunk-KCY3PAEP.js";var Ko=Ze(it=>{"use strict";it.byteLength=ci;it.toByteArray=di;it.fromByteArray=li;var E=[],P=[],ai=typeof Uint8Array<"u"?Uint8Array:Array,co="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(we=0,Uo=co.length;we<Uo;++we)E[we]=co[we],P[co.charCodeAt(we)]=we;var we,Uo;P[45]=62;P[95]=63;function Go(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 ci(e){var t=Go(e),n=t[0],o=t[1];return(n+o)*3/4-o}function ui(e,t,n){return(t+n)*3/4-n}function di(e){var t,n=Go(e),o=n[0],r=n[1],i=new ai(ui(e,o,r)),s=0,c=r>0?o-4:o,u;for(u=0;u<c;u+=4)t=P[e.charCodeAt(u)]<<18|P[e.charCodeAt(u+1)]<<12|P[e.charCodeAt(u+2)]<<6|P[e.charCodeAt(u+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=t&255;return r===2&&(t=P[e.charCodeAt(u)]<<2|P[e.charCodeAt(u+1)]>>4,i[s++]=t&255),r===1&&(t=P[e.charCodeAt(u)]<<10|P[e.charCodeAt(u+1)]<<4|P[e.charCodeAt(u+2)]>>2,i[s++]=t>>8&255,i[s++]=t&255),i}function _i(e){return E[e>>18&63]+E[e>>12&63]+E[e>>6&63]+E[e&63]}function pi(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(_i(o));return r.join("")}function li(e){for(var t,n=e.length,o=n%3,r=[],i=16383,s=0,c=n-o;s<c;s+=i)r.push(pi(e,s,s+i>c?c:s+i));return o===1?(t=e[n-1],r.push(E[t>>2]+E[t<<4&63]+"==")):o===2&&(t=(e[n-2]<<8)+e[n-1],r.push(E[t>>10]+E[t>>4&63]+E[t<<2&63]+"=")),r.join("")}});var Ho=Ze(uo=>{uo.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,m=n?-1:1,w=e[t+_];for(_+=m,i=w&(1<<-p)-1,w>>=-p,p+=c;p>0;i=i*256+e[t+_],_+=m,p-=8);for(s=i&(1<<-p)-1,i>>=-p,p+=o;p>0;s=s*256+e[t+_],_+=m,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)};uo.write=function(e,t,n,o,r,i){var s,c,u,l=i*8-r-1,p=(1<<l)-1,_=p>>1,m=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=o?0:i-1,B=o?1:-1,j=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+=m/u:t+=m*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+=B,c/=256,r-=8);for(s=s<<r|c,l+=r;l>0;e[n+w]=s&255,w+=B,s/=256,l-=8);e[n+w-B]|=j*128}});var rr=Ze(he=>{"use strict";var _o=Ko(),Re=Ho(),jo=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;he.Buffer=a;he.SlowBuffer=gi;he.INSPECT_MAX_BYTES=50;var st=2147483647;he.kMaxLength=st;a.TYPED_ARRAY_SUPPORT=mi();!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 mi(){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 D(e){if(e>st)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 fo(e)}return zo(e,t,n)}a.poolSize=8192;function zo(e,t,n){if(typeof e=="string")return Ni(e,t);if(ArrayBuffer.isView(e))return wi(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(q(e,ArrayBuffer)||e&&q(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(q(e,SharedArrayBuffer)||e&&q(e.buffer,SharedArrayBuffer)))return lo(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=yi(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 zo(e,t,n)};Object.setPrototypeOf(a.prototype,Uint8Array.prototype);Object.setPrototypeOf(a,Uint8Array);function Jo(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 fi(e,t,n){return Jo(e),e<=0?D(e):t!==void 0?typeof n=="string"?D(e).fill(t,n):D(e).fill(t):D(e)}a.alloc=function(e,t,n){return fi(e,t,n)};function fo(e){return Jo(e),D(e<0?0:No(e)|0)}a.allocUnsafe=function(e){return fo(e)};a.allocUnsafeSlow=function(e){return fo(e)};function Ni(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let n=Yo(e,t)|0,o=D(n),r=o.write(e,t);return r!==n&&(o=o.slice(0,r)),o}function po(e){let t=e.length<0?0:No(e.length)|0,n=D(t);for(let o=0;o<t;o+=1)n[o]=e[o]&255;return n}function wi(e){if(q(e,Uint8Array)){let t=new Uint8Array(e);return lo(t.buffer,t.byteOffset,t.byteLength)}return po(e)}function lo(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 yi(e){if(a.isBuffer(e)){let t=No(e.length)|0,n=D(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!="number"||yo(e.length)?D(0):po(e);if(e.type==="Buffer"&&Array.isArray(e.data))return po(e.data)}function No(e){if(e>=st)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+st.toString(16)+" bytes");return e|0}function gi(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(q(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),q(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(q(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 Yo(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||q(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 mo(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return or(e).length;default:if(r)return o?-1:mo(e).length;t=(""+t).toLowerCase(),r=!0}}a.byteLength=Yo;function Ri(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 Pi(this,t,n);case"utf8":case"utf-8":return Zo(this,t,n);case"ascii":return Ti(this,t,n);case"latin1":case"binary":return Ci(this,t,n);case"base64":return Si(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Fi(this,t,n);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}a.prototype._isBuffer=!0;function ye(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)ye(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)ye(this,n,n+3),ye(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)ye(this,n,n+7),ye(this,n+1,n+6),ye(this,n+2,n+5),ye(this,n+3,n+4);return this};a.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?Zo(this,0,t):Ri.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=he.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"};jo&&(a.prototype[jo]=a.prototype.inspect);a.prototype.compare=function(t,n,o,r,i){if(q(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 Qo(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,yo(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:Wo(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):Wo(e,[t],n,o,r);throw new TypeError("val must be string, number or Buffer")}function Wo(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 Qo(this,t,n,o,!0)};a.prototype.lastIndexOf=function(t,n,o){return Qo(this,t,n,o,!1)};function Oi(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(yo(c))return s;e[n+s]=c}return s}function hi(e,t,n,o){return at(mo(t,e.length-n),e,n,o)}function vi(e,t,n,o){return at(Bi(t),e,n,o)}function bi(e,t,n,o){return at(or(t),e,n,o)}function xi(e,t,n,o){return at(Ei(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 Oi(this,t,n,o);case"utf8":case"utf-8":return hi(this,t,n,o);case"ascii":case"latin1":case"binary":return vi(this,t,n,o);case"base64":return bi(this,t,n,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xi(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 Si(e,t,n){return t===0&&n===e.length?_o.fromByteArray(e):_o.fromByteArray(e.slice(t,n))}function Zo(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 ki(o)}var $o=4096;function ki(e){let t=e.length;if(t<=$o)return String.fromCharCode.apply(String,e);let n="",o=0;for(;o<t;)n+=String.fromCharCode.apply(String,e.slice(o,o+=$o));return n}function Ti(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 Ci(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 Pi(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+=qi[e[i]];return r}function Fi(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=oe(function(t){t=t>>>0,Oe(t,"offset");let n=this[t],o=this[t+7];(n===void 0||o===void 0)&&Ie(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=oe(function(t){t=t>>>0,Oe(t,"offset");let n=this[t],o=this[t+7];(n===void 0||o===void 0)&&Ie(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=oe(function(t){t=t>>>0,Oe(t,"offset");let n=this[t],o=this[t+7];(n===void 0||o===void 0)&&Ie(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=oe(function(t){t=t>>>0,Oe(t,"offset");let n=this[t],o=this[t+7];(n===void 0||o===void 0)&&Ie(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),Re.read(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,n){return t=t>>>0,n||R(t,4,this.length),Re.read(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,n){return t=t>>>0,n||R(t,8,this.length),Re.read(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,n){return t=t>>>0,n||R(t,8,this.length),Re.read(this,t,!1,52,8)};function S(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;S(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;S(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||S(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||S(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||S(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||S(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||S(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 Io(e,t,n,o,r){nr(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 Do(e,t,n,o,r){nr(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=oe(function(t,n=0){return Io(this,t,n,BigInt(0),BigInt("0xffffffffffffffff"))});a.prototype.writeBigUInt64BE=oe(function(t,n=0){return Do(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);S(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);S(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||S(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||S(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||S(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||S(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||S(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=oe(function(t,n=0){return Io(this,t,n,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});a.prototype.writeBigInt64BE=oe(function(t,n=0){return Do(this,t,n,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Lo(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 er(e,t,n,o,r){return t=+t,n=n>>>0,r||Lo(e,t,n,4,34028234663852886e22,-34028234663852886e22),Re.write(e,t,n,o,23,4),n+4}a.prototype.writeFloatLE=function(t,n,o){return er(this,t,n,!0,o)};a.prototype.writeFloatBE=function(t,n,o){return er(this,t,n,!1,o)};function tr(e,t,n,o,r){return t=+t,n=n>>>0,r||Lo(e,t,n,8,17976931348623157e292,-17976931348623157e292),Re.write(e,t,n,o,52,8),n+8}a.prototype.writeDoubleLE=function(t,n,o){return tr(this,t,n,!0,o)};a.prototype.writeDoubleBE=function(t,n,o){return tr(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 ge={};function wo(e,t,n){ge[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}`}}}wo("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);wo("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError);wo("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=Xo(String(n)):typeof n=="bigint"&&(r=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(r=Xo(r)),r+="n"),o+=` It must be ${t}. Received ${r}`,o},RangeError);function Xo(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 Vi(e,t,n){Oe(t,"offset"),(e[t]===void 0||e[t+n]===void 0)&&Ie(t,e.length-(n+1))}function nr(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 ge.ERR_OUT_OF_RANGE("value",c,e)}Vi(o,r,i)}function Oe(e,t){if(typeof e!="number")throw new ge.ERR_INVALID_ARG_TYPE(t,"number",e)}function Ie(e,t,n){throw Math.floor(e)!==e?(Oe(e,n),new ge.ERR_OUT_OF_RANGE(n||"offset","an integer",e)):t<0?new ge.ERR_BUFFER_OUT_OF_BOUNDS:new ge.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}var Mi=/[^+/0-9A-Za-z-_]/g;function Ai(e){if(e=e.split("=")[0],e=e.trim().replace(Mi,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function mo(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 Bi(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function Ei(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 or(e){return _o.toByteArray(Ai(e))}function at(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 q(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function yo(e){return e!==e}var qi=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 oe(e){return typeof BigInt>"u"?Ui:e}function Ui(){throw new Error("BigInt not supported")}});var ar=Ze((go,sr)=>{var ct=rr(),L=ct.Buffer;function ir(e,t){for(var n in e)t[n]=e[n]}L.from&&L.alloc&&L.allocUnsafe&&L.allocUnsafeSlow?sr.exports=ct:(ir(ct,go),go.Buffer=ve);function ve(e,t,n){return L(e,t,n)}ir(L,ve);ve.from=function(e,t,n){if(typeof e=="number")throw new TypeError("Argument must not be a number");return L(e,t,n)};ve.alloc=function(e,t,n){if(typeof e!="number")throw new TypeError("Argument must be a number");var o=L(e);return t!==void 0?typeof n=="string"?o.fill(t,n):o.fill(t):o.fill(0),o};ve.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return L(e)};ve.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return ct.SlowBuffer(e)}});var cr=Ze((ia,Oo)=>{"use strict";var Ro=65536,Gi=4294967295;function Ki(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
2
|
+
Use Chrome, Firefox or Internet Explorer 11`)}var Hi=ar().Buffer,ut=window.crypto||window.msCrypto;ut&&ut.getRandomValues?Oo.exports=ji:Oo.exports=Ki;function ji(e,t){if(e>Gi)throw new RangeError("requested too many random bytes");var n=Hi.allocUnsafe(e);if(e>0)if(e>Ro)for(var o=0;o<e;o+=Ro)ut.getRandomValues(n.slice(o,o+Ro));else ut.getRandomValues(n);return typeof t=="function"?process.nextTick(function(){t(null,n)}):n}});import{Actor as Gs}from"@dfinity/agent";import{AccountIdentifier as Co,SubAccount as Ks,checkAccountId as Dr}from"@dfinity/ledger-icp";import{arrayOfNumberToUint8Array as Hs,asciiStringToByteArray as js,assertPercentageNumber as Po,createServices as Ws,fromNullable as k,isNullish as tt,nonNullish as H,uint8ArrayToBigInt as Lr}from"@dfinity/utils";function oi(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function ro(e,...t){if(!oi(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 io(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 Mo(e,t){ro(e);let n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}var ot=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),A=(e,t)=>e<<32-t|e>>>t;var zs=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function ri(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function so(e){return typeof e=="string"&&(e=ri(e)),ro(e),e}var nt=class{clone(){return this._cloneInto()}},Js={}.toString;function Ao(e){let t=o=>e().update(so(o)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function ii(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 Bo=(e,t,n)=>e&t^~e&n,Eo=(e,t,n)=>e&t^e&n^t&n,rt=class extends nt{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=ot(this.buffer)}update(t){io(this);let{view:n,buffer:o,blockLen:r}=this;t=so(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=ot(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){io(this),Mo(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;ii(o,r-8,BigInt(this.length*8),i),this.process(o,0);let c=ot(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 si=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]),te=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ne=new Uint32Array(64),ao=class extends rt{constructor(){super(64,32,8,!1),this.A=te[0]|0,this.B=te[1]|0,this.C=te[2]|0,this.D=te[3]|0,this.E=te[4]|0,this.F=te[5]|0,this.G=te[6]|0,this.H=te[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)ne[_]=t.getUint32(n,!1);for(let _=16;_<64;_++){let m=ne[_-15],w=ne[_-2],B=A(m,7)^A(m,18)^m>>>3,j=A(w,17)^A(w,19)^w>>>10;ne[_]=j+ne[_-7]+B+ne[_-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 m=A(c,6)^A(c,11)^A(c,25),w=p+m+Bo(c,u,l)+si[_]+ne[_]|0,j=(A(o,2)^A(o,13)^A(o,22))+Eo(o,r,i)|0;p=l,l=u,u=c,c=s+w|0,s=i,i=r,r=o,o=w+j|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(){ne.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var qo=Ao(()=>new ao);var Fo=ni(cr());var ur=({IDL:e})=>{let t=e.Rec(),n=e.Rec(),o=e.Record({id:e.Nat64}),r=e.Record({followees:e.Vec(o)}),i=e.Record({name:e.Text,description:e.Opt(e.Text)}),s=e.Record({id:e.Opt(o),known_neuron_data:e.Opt(i)}),c=e.Record({percentage_to_spawn:e.Opt(e.Nat32),new_controller:e.Opt(e.Principal),nonce:e.Opt(e.Nat64)}),u=e.Record({amount_e8s:e.Nat64}),l=e.Record({topic:e.Int32,followees:e.Vec(o)}),p=e.Record({controller:e.Opt(e.Principal),memo:e.Nat64}),_=e.Variant({NeuronIdOrSubaccount:e.Record({}),MemoAndController:p,Memo:e.Nat64}),m=e.Record({by:e.Opt(_)}),w=e.Record({hot_key_to_remove:e.Opt(e.Principal)}),B=e.Record({new_hot_key:e.Opt(e.Principal)}),j=e.Record({requested_setting_for_auto_stake_maturity:e.Bool}),yt=e.Record({additional_dissolve_delay_seconds:e.Nat32}),gt=e.Record({visibility:e.Opt(e.Int32)}),Rt=e.Record({dissolve_timestamp_seconds:e.Nat64}),Ot=e.Variant({RemoveHotKey:w,AddHotKey:B,ChangeAutoStakeMaturity:j,StopDissolving:e.Record({}),StartDissolving:e.Record({}),IncreaseDissolveDelay:yt,SetVisibility:gt,JoinCommunityFund:e.Record({}),LeaveCommunityFund:e.Record({}),SetDissolveTimestamp:Rt}),ce=e.Record({operation:e.Opt(Ot)}),v=e.Record({id:e.Nat64}),xe=e.Record({vote:e.Int32,proposal:e.Opt(v)}),ue=e.Record({source_neuron_id:e.Opt(o)}),de=e.Record({dissolve_delay_seconds:e.Nat64,kyc_verified:e.Bool,amount_e8s:e.Nat64,new_controller:e.Opt(e.Principal),nonce:e.Nat64}),Se=e.Record({percentage_to_stake:e.Opt(e.Nat32)}),_e=e.Record({percentage_to_merge:e.Nat32}),W=e.Record({hash:e.Vec(e.Nat8)}),ht=e.Record({e8s:e.Nat64}),pe=e.Record({to_account:e.Opt(W),amount:e.Opt(ht)}),vt=e.Variant({Spawn:c,Split:u,Follow:l,ClaimOrRefresh:m,Configure:ce,RegisterVote:xe,Merge:ue,DisburseToNeuron:de,MakeProposal:n,StakeMaturity:Se,MergeMaturity:_e,Disburse:pe}),$=e.Variant({Subaccount:e.Vec(e.Nat8),NeuronId:o}),bt=e.Record({id:e.Opt(o),command:e.Opt(vt),neuron_id_or_subaccount:e.Opt($)}),xt=e.Record({controllers:e.Vec(e.Principal)}),St=e.Record({freezing_threshold:e.Opt(e.Nat64),controllers:e.Opt(xt),log_visibility:e.Opt(e.Int32),wasm_memory_limit:e.Opt(e.Nat64),memory_allocation:e.Opt(e.Nat64),compute_allocation:e.Opt(e.Nat64)}),ke=e.Record({canister_id:e.Opt(e.Principal),settings:e.Opt(St)}),kt=e.Record({skip_stopping_before_installing:e.Opt(e.Bool),wasm_module_hash:e.Opt(e.Vec(e.Nat8)),canister_id:e.Opt(e.Principal),arg_hash:e.Opt(e.Vec(e.Nat8)),install_mode:e.Opt(e.Int32)}),Te=e.Record({action:e.Opt(e.Int32),canister_id:e.Opt(e.Principal)}),T=e.Record({basis_points:e.Opt(e.Nat64)}),y=e.Record({seconds:e.Opt(e.Nat64)}),f=e.Record({e8s:e.Opt(e.Nat64)}),Tt=e.Record({reward_rate_transition_duration:e.Opt(y),initial_reward_rate:e.Opt(T),final_reward_rate:e.Opt(T)}),Ct=e.Record({neuron_maximum_dissolve_delay_bonus:e.Opt(T),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(T),neuron_minimum_stake:e.Opt(f),proposal_wait_for_quiet_deadline_increase:e.Opt(y),proposal_initial_voting_period:e.Opt(y),proposal_rejection_fee:e.Opt(f),voting_reward_parameters:e.Opt(Tt)}),Ce=e.Record({base64_encoding:e.Opt(e.Text)}),Pt=e.Record({transaction_fee:e.Opt(f),token_symbol:e.Opt(e.Text),token_logo:e.Opt(Ce),token_name:e.Opt(e.Text)}),Ft=e.Record({id:e.Opt(e.Principal)}),Vt=e.Record({dissolve_delay_interval:e.Opt(y),count:e.Opt(e.Nat64)}),Mt=e.Record({seconds_after_utc_midnight:e.Opt(e.Nat64)}),At=e.Record({iso_codes:e.Vec(e.Text)}),Bt=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(Vt),confirmation_text:e.Opt(e.Text),maximum_participant_icp:e.Opt(f),minimum_icp:e.Opt(f),minimum_direct_participation_icp:e.Opt(f),minimum_participant_icp:e.Opt(f),start_time:e.Opt(Mt),maximum_direct_participation_icp:e.Opt(f),maximum_icp:e.Opt(f),neurons_fund_investment_icp:e.Opt(f),restricted_countries:e.Opt(At)}),Pe=e.Record({total:e.Opt(f)}),Et=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(f)}),qt=e.Record({developer_neurons:e.Vec(Et)}),Ut=e.Record({treasury_distribution:e.Opt(Pe),developer_distribution:e.Opt(qt),swap_distribution:e.Opt(Pe)}),Fe=e.Record({url:e.Opt(e.Text),governance_parameters:e.Opt(Ct),fallback_controller_principal_ids:e.Vec(e.Principal),logo:e.Opt(Ce),name:e.Opt(e.Text),ledger_parameters:e.Opt(Pt),description:e.Opt(e.Text),dapp_canisters:e.Vec(Ft),swap_parameters:e.Opt(Bt),initial_token_distribution:e.Opt(Ut)}),Ve=e.Record({nns_function:e.Int32,payload:e.Vec(e.Nat8)}),b=e.Record({id:e.Opt(e.Principal),reward_account:e.Opt(W)}),Gt=e.Record({dissolve_delay_seconds:e.Nat64}),Kt=e.Record({to_account:e.Opt(W)}),Ht=e.Variant({RewardToNeuron:Gt,RewardToAccount:Kt}),X=e.Record({node_provider:e.Opt(b),reward_mode:e.Opt(Ht),amount_e8s:e.Nat64}),jt=e.Record({dissolve_delay_interval_seconds:e.Nat64,count:e.Nat64}),Wt=e.Record({min_participant_icp_e8s:e.Nat64,neuron_basket_construction_parameters:e.Opt(jt),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)}),$t=e.Record({community_fund_investment_e8s:e.Opt(e.Nat64),target_swap_canister_id:e.Opt(e.Principal),params:e.Opt(Wt)}),Xt=e.Record({start_timestamp_seconds:e.Nat64,end_timestamp_seconds:e.Nat64}),zt=e.Record({open_time_window:e.Opt(Xt)}),Jt=e.Record({request:e.Opt(zt),swap_canister_id:e.Opt(e.Principal)}),Yt=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,r))}),Me=e.Record({use_registry_derived_rewards:e.Opt(e.Bool),rewards:e.Vec(X)}),z=e.Record({human_readable:e.Opt(e.Text)}),Qt=e.Record({contribution_threshold_xdr:e.Opt(z),one_third_participation_milestone_xdr:e.Opt(z),full_participation_milestone_xdr:e.Opt(z)}),Zt=e.Record({maximum_icp_xdr_rate:e.Opt(T),neurons_fund_matched_funding_curve_coefficients:e.Opt(Qt),max_theoretical_neurons_fund_participation_amount_xdr:e.Opt(z),minimum_icp_xdr_rate:e.Opt(T)}),J=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(Zt)}),le=e.Record({principals:e.Vec(e.Principal)}),It=e.Variant({ToRemove:b,ToAdd:b}),Ae=e.Record({change:e.Opt(It)}),Be=e.Record({motion_text:e.Text}),Dt=e.Variant({RegisterKnownNeuron:s,ManageNeuron:bt,UpdateCanisterSettings:ke,InstallCode:kt,StopOrStartCanister:Te,CreateServiceNervousSystem:Fe,ExecuteNnsFunction:Ve,RewardNodeProvider:X,OpenSnsTokenSwap:$t,SetSnsTokenSwapOpenTimeWindow:Jt,SetDefaultFollowees:Yt,RewardNodeProviders:Me,ManageNetworkEconomics:J,ApproveGenesisKyc:le,AddOrRemoveNodeProvider:Ae,Motion:Be});n.fill(e.Record({url:e.Text,title:e.Opt(e.Text),action:e.Opt(Dt),summary:e.Text}));let Lt=e.Record({proposal:e.Opt(n),caller:e.Opt(e.Principal),proposer_id:e.Opt(o)}),Ee=e.Record({xdr_permyriad_per_icp:e.Opt(e.Nat64),timestamp_seconds:e.Opt(e.Nat64)}),Y=e.Record({minimum_xdr_permyriad_per_icp:e.Opt(e.Nat64),registry_version:e.Opt(e.Nat64),node_providers:e.Vec(b),timestamp:e.Nat64,rewards:e.Vec(X),xdr_conversion_rate:e.Opt(Ee),maximum_node_provider_rewards_e8s:e.Opt(e.Nat64)}),qe=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))}),Ue=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(qe),dissolving_neurons_count:e.Nat64,dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),total_staked_maturity_e8s_equivalent_seed:e.Nat64,community_fund_total_staked_e8s:e.Nat64,not_dissolving_neurons_e8s_buckets_seed:e.Vec(e.Tuple(e.Nat64,e.Float64)),public_neuron_subset_metrics:e.Opt(qe),timestamp_seconds:e.Nat64,seed_neuron_count:e.Nat64}),en=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}),Ge=e.Record({groups:e.Vec(en),timestamp_seconds:e.Opt(e.Nat64)}),Ke=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(v)}),He=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}),tn=e.Record({followers:e.Vec(o)}),nn=e.Record({followers_map:e.Vec(e.Tuple(e.Nat64,tn))}),on=e.Variant({LastNeuronId:o}),je=e.Record({status:e.Opt(e.Int32),failure_reason:e.Opt(e.Text),progress:e.Opt(on)}),rn=e.Record({neuron_indexes_migration:e.Opt(je),copy_inactive_neurons_to_stable_memory_migration:e.Opt(je)}),N=e.Record({error_message:e.Text,error_type:e.Int32}),We=e.Record({vote:e.Int32,voting_power:e.Nat64}),sn=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)}),an=e.Record({controller:e.Opt(e.Principal),hotkeys:e.Vec(e.Principal),is_capped:e.Opt(e.Bool),maturity_equivalent_icp_e8s:e.Opt(e.Nat64),nns_neuron_id:e.Opt(o),amount_icp_e8s:e.Opt(e.Nat64)}),me=e.Record({neurons_fund_neuron_portions:e.Vec(an)}),cn=e.Record({serialized_representation:e.Opt(e.Text)}),Q=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(sn),max_neurons_fund_swap_participation_icp_e8s:e.Opt(e.Nat64),neurons_fund_reserves:e.Opt(me),ideal_matched_participation_function:e.Opt(cn),allocated_neurons_fund_participation_icp_e8s:e.Opt(e.Nat64)}),un=e.Record({final_neurons_fund_participation:e.Opt(Q),initial_neurons_fund_participation:e.Opt(Q),neurons_fund_refunds:e.Opt(me)}),dn=e.Record({status:e.Opt(e.Int32),freezing_threshold:e.Opt(e.Nat64),controllers:e.Vec(e.Principal),memory_size:e.Opt(e.Nat64),cycles:e.Opt(e.Nat64),idle_cycles_burned_per_day:e.Opt(e.Nat64),module_hash:e.Vec(e.Nat8)}),x=e.Record({status:e.Opt(dn),canister_id:e.Opt(e.Principal)}),_n=e.Record({ledger_index_canister_summary:e.Opt(x),fallback_controller_principal_ids:e.Vec(e.Principal),ledger_archive_canister_summaries:e.Vec(x),ledger_canister_summary:e.Opt(x),swap_canister_summary:e.Opt(x),governance_canister_summary:e.Opt(x),root_canister_summary:e.Opt(x),dapp_canister_summaries:e.Vec(x)}),$e=e.Record({swap_background_information:e.Opt(_n)}),Xe=e.Record({no:e.Nat64,yes:e.Nat64,total:e.Nat64,timestamp_seconds:e.Nat64}),pn=e.Record({current_deadline_timestamp_seconds:e.Nat64}),ln=e.Record({id:e.Opt(v),failure_reason:e.Opt(N),ballots:e.Vec(e.Tuple(e.Nat64,We)),proposal_timestamp_seconds:e.Nat64,reward_event_round:e.Nat64,failed_timestamp_seconds:e.Nat64,neurons_fund_data:e.Opt(un),reject_cost_e8s:e.Nat64,derived_proposal_information:e.Opt($e),latest_tally:e.Opt(Xe),sns_token_swap_lifecycle:e.Opt(e.Int32),decided_timestamp_seconds:e.Nat64,proposal:e.Opt(n),proposer:e.Opt(o),wait_for_quiet_state:e.Opt(pn),executed_timestamp_seconds:e.Nat64,original_total_community_fund_maturity_e8s_equivalent:e.Opt(e.Nat64)}),mn=e.Variant({Spawn:o,Split:u,Configure:ce,Merge:ue,DisburseToNeuron:de,SyncCommand:e.Record({}),ClaimOrRefreshNeuron:m,MergeMaturity:_e,Disburse:pe}),fn=e.Record({command:e.Opt(mn),timestamp:e.Nat64}),ze=e.Record({vote:e.Int32,proposal_id:e.Opt(v)}),Nn=e.Variant({DissolveDelaySeconds:e.Nat64,WhenDissolvedTimestampSeconds:e.Nat64}),M=e.Record({id:e.Opt(o),staked_maturity_e8s_equivalent:e.Opt(e.Nat64),controller:e.Opt(e.Principal),recent_ballots:e.Vec(ze),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(Nn),followees:e.Vec(e.Tuple(e.Int32,r)),neuron_fees_e8s:e.Nat64,visibility:e.Opt(e.Int32),transfer:e.Opt(He),known_neuron_data:e.Opt(i),spawn_at_timestamp_seconds:e.Opt(e.Nat64)}),ti=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,r)),making_sns_proposal:e.Opt(Lt),most_recent_monthly_node_provider_rewards:e.Opt(Y),maturity_modulation_last_updated_at_timestamp_seconds:e.Opt(e.Nat64),wait_for_quiet_threshold_seconds:e.Nat64,metrics:e.Opt(Ue),neuron_management_voting_period_seconds:e.Opt(e.Nat64),node_providers:e.Vec(b),cached_daily_maturity_modulation_basis_points:e.Opt(e.Int32),economics:e.Opt(J),restore_aging_summary:e.Opt(Ge),spawning_neurons:e.Opt(e.Bool),latest_reward_event:e.Opt(Ke),to_claim_transfers:e.Vec(He),short_voting_period_seconds:e.Nat64,topic_followee_index:e.Vec(e.Tuple(e.Int32,nn)),migrations:e.Opt(rn),proposals:e.Vec(e.Tuple(e.Nat64,ln)),xdr_conversion_rate:e.Opt(Ee),in_flight_commands:e.Vec(e.Tuple(e.Nat64,fn)),neurons:e.Vec(e.Tuple(e.Nat64,M)),genesis_timestamp_seconds:e.Nat64}),Z=e.Variant({Ok:e.Null,Err:N}),wn=e.Variant({Error:N,NeuronId:o}),yn=e.Record({result:e.Opt(wn)}),Je=e.Variant({Ok:M,Err:N}),gn=e.Variant({Ok:Ue,Err:N}),Rn=e.Variant({Ok:Y,Err:N}),I=e.Record({dissolve_delay_seconds:e.Nat64,recent_ballots:e.Vec(ze),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,visibility:e.Opt(e.Int32),known_neuron_data:e.Opt(i),voting_power:e.Nat64,age_seconds:e.Nat64}),Ye=e.Variant({Ok:I,Err:N}),On=e.Record({nns_proposal_id:e.Opt(v)}),hn=e.Record({final_neurons_fund_participation:e.Opt(Q),initial_neurons_fund_participation:e.Opt(Q),neurons_fund_refunds:e.Opt(me)}),vn=e.Record({neurons_fund_audit_info:e.Opt(hn)}),bn=e.Variant({Ok:vn,Err:N}),xn=e.Record({result:e.Opt(bn)}),Sn=e.Variant({Ok:b,Err:N}),fe=e.Record({id:e.Opt(v),status:e.Int32,topic:e.Int32,failure_reason:e.Opt(N),ballots:e.Vec(e.Tuple(e.Nat64,We)),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($e),latest_tally:e.Opt(Xe),reward_status:e.Int32,decided_timestamp_seconds:e.Nat64,proposal:e.Opt(n),proposer:e.Opt(o),executed_timestamp_seconds:e.Nat64}),kn=e.Record({known_neurons:e.Vec(s)}),Tn=e.Record({include_public_neurons_in_full_neurons:e.Opt(e.Bool),neuron_ids:e.Vec(e.Nat64),include_empty_neurons_readable_by_caller:e.Opt(e.Bool),include_neurons_readable_by_caller:e.Bool}),Cn=e.Record({neuron_infos:e.Vec(e.Tuple(e.Nat64,I)),full_neurons:e.Vec(M)}),Pn=e.Record({start_timestamp_seconds:e.Opt(e.Nat64),end_timestamp_seconds:e.Opt(e.Nat64)}),Fn=e.Record({date_filter:e.Opt(Pn)}),Vn=e.Record({rewards:e.Vec(Y)}),Mn=e.Record({node_providers:e.Vec(b)}),An=e.Record({include_reward_status:e.Vec(e.Int32),omit_large_fields:e.Opt(e.Bool),before_proposal:e.Opt(v),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(fe)}),En=e.Record({arg:e.Opt(e.Vec(e.Nat8)),wasm_module:e.Opt(e.Vec(e.Nat8)),skip_stopping_before_installing:e.Opt(e.Bool),canister_id:e.Opt(e.Principal),install_mode:e.Opt(e.Int32)}),qn=e.Variant({RegisterKnownNeuron:s,ManageNeuron:t,UpdateCanisterSettings:ke,InstallCode:En,StopOrStartCanister:Te,CreateServiceNervousSystem:Fe,ExecuteNnsFunction:Ve,RewardNodeProvider:X,RewardNodeProviders:Me,ManageNetworkEconomics:J,ApproveGenesisKyc:le,AddOrRemoveNodeProvider:Ae,Motion:Be}),Un=e.Record({url:e.Text,title:e.Opt(e.Text),action:e.Opt(qn),summary:e.Text}),Gn=e.Variant({Spawn:c,Split:u,Follow:l,ClaimOrRefresh:m,Configure:ce,RegisterVote:xe,Merge:ue,DisburseToNeuron:de,MakeProposal:Un,StakeMaturity:Se,MergeMaturity:_e,Disburse:pe});t.fill(e.Record({id:e.Opt(o),command:e.Opt(Gn),neuron_id_or_subaccount:e.Opt($)}));let Ne=e.Record({created_neuron_id:e.Opt(o)}),Kn=e.Record({refreshed_neuron_id:e.Opt(o)}),Hn=e.Record({target_neuron:e.Opt(M),source_neuron:e.Opt(M),target_neuron_info:e.Opt(I),source_neuron_info:e.Opt(I)}),jn=e.Record({message:e.Opt(e.Text),proposal_id:e.Opt(v)}),Wn=e.Record({maturity_e8s:e.Nat64,staked_maturity_e8s:e.Nat64}),$n=e.Record({merged_maturity_e8s:e.Nat64,new_stake_e8s:e.Nat64}),Xn=e.Record({transfer_block_height:e.Nat64}),zn=e.Variant({Error:N,Spawn:Ne,Split:Ne,Follow:e.Record({}),ClaimOrRefresh:Kn,Configure:e.Record({}),RegisterVote:e.Record({}),Merge:Hn,DisburseToNeuron:Ne,MakeProposal:jn,StakeMaturity:Wn,MergeMaturity:$n,Disburse:Xn}),Qe=e.Record({command:e.Opt(zn)}),Jn=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)}),Yn=e.Variant({Committed:Jn,Aborted:e.Record({})}),Qn=e.Record({result:e.Opt(Yn),open_sns_token_swap_proposal_id:e.Opt(e.Nat64)}),Zn=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)}),In=e.Variant({Committed:Zn,Aborted:e.Record({})}),Dn=e.Record({result:e.Opt(In),nns_proposal_id:e.Opt(e.Nat64)}),Ln=e.Record({controller:e.Opt(e.Principal),hotkeys:e.Opt(le),is_capped:e.Opt(e.Bool),nns_neuron_id:e.Opt(e.Nat64),amount_icp_e8s:e.Opt(e.Nat64)}),eo=e.Record({neurons_fund_neuron_portions:e.Vec(Ln)}),to=e.Variant({Ok:eo,Err:N}),no=e.Record({result:e.Opt(to)}),oo=e.Record({reward_account:e.Opt(W)});return e.Service({claim_gtc_neurons:e.Func([e.Principal,e.Vec(o)],[Z],[]),claim_or_refresh_neuron_from_account:e.Func([p],[yn],[]),get_build_metadata:e.Func([],[e.Text],[]),get_full_neuron:e.Func([e.Nat64],[Je],[]),get_full_neuron_by_id_or_subaccount:e.Func([$],[Je],[]),get_latest_reward_event:e.Func([],[Ke],[]),get_metrics:e.Func([],[gn],[]),get_monthly_node_provider_rewards:e.Func([],[Rn],[]),get_most_recent_monthly_node_provider_rewards:e.Func([],[e.Opt(Y)],[]),get_network_economics_parameters:e.Func([],[J],[]),get_neuron_ids:e.Func([],[e.Vec(e.Nat64)],[]),get_neuron_info:e.Func([e.Nat64],[Ye],[]),get_neuron_info_by_id_or_subaccount:e.Func([$],[Ye],[]),get_neurons_fund_audit_info:e.Func([On],[xn],[]),get_node_provider_by_caller:e.Func([e.Null],[Sn],[]),get_pending_proposals:e.Func([],[e.Vec(fe)],[]),get_proposal_info:e.Func([e.Nat64],[e.Opt(fe)],[]),get_restore_aging_summary:e.Func([],[Ge],[]),list_known_neurons:e.Func([],[kn],[]),list_neurons:e.Func([Tn],[Cn],[]),list_node_provider_rewards:e.Func([Fn],[Vn],[]),list_node_providers:e.Func([],[Mn],[]),list_proposals:e.Func([An],[Bn],[]),manage_neuron:e.Func([t],[Qe],[]),settle_community_fund_participation:e.Func([Qn],[Z],[]),settle_neurons_fund_participation:e.Func([Dn],[no],[]),simulate_manage_neuron:e.Func([t],[Qe],[]),transfer_gtc_neuron:e.Func([o,o],[Z],[]),update_node_provider:e.Func([oo],[Z],[])})};var dr=({IDL:e})=>{let t=e.Rec(),n=e.Rec(),o=e.Record({id:e.Nat64}),r=e.Record({followees:e.Vec(o)}),i=e.Record({name:e.Text,description:e.Opt(e.Text)}),s=e.Record({id:e.Opt(o),known_neuron_data:e.Opt(i)}),c=e.Record({percentage_to_spawn:e.Opt(e.Nat32),new_controller:e.Opt(e.Principal),nonce:e.Opt(e.Nat64)}),u=e.Record({amount_e8s:e.Nat64}),l=e.Record({topic:e.Int32,followees:e.Vec(o)}),p=e.Record({controller:e.Opt(e.Principal),memo:e.Nat64}),_=e.Variant({NeuronIdOrSubaccount:e.Record({}),MemoAndController:p,Memo:e.Nat64}),m=e.Record({by:e.Opt(_)}),w=e.Record({hot_key_to_remove:e.Opt(e.Principal)}),B=e.Record({new_hot_key:e.Opt(e.Principal)}),j=e.Record({requested_setting_for_auto_stake_maturity:e.Bool}),yt=e.Record({additional_dissolve_delay_seconds:e.Nat32}),gt=e.Record({visibility:e.Opt(e.Int32)}),Rt=e.Record({dissolve_timestamp_seconds:e.Nat64}),Ot=e.Variant({RemoveHotKey:w,AddHotKey:B,ChangeAutoStakeMaturity:j,StopDissolving:e.Record({}),StartDissolving:e.Record({}),IncreaseDissolveDelay:yt,SetVisibility:gt,JoinCommunityFund:e.Record({}),LeaveCommunityFund:e.Record({}),SetDissolveTimestamp:Rt}),ce=e.Record({operation:e.Opt(Ot)}),v=e.Record({id:e.Nat64}),xe=e.Record({vote:e.Int32,proposal:e.Opt(v)}),ue=e.Record({source_neuron_id:e.Opt(o)}),de=e.Record({dissolve_delay_seconds:e.Nat64,kyc_verified:e.Bool,amount_e8s:e.Nat64,new_controller:e.Opt(e.Principal),nonce:e.Nat64}),Se=e.Record({percentage_to_stake:e.Opt(e.Nat32)}),_e=e.Record({percentage_to_merge:e.Nat32}),W=e.Record({hash:e.Vec(e.Nat8)}),ht=e.Record({e8s:e.Nat64}),pe=e.Record({to_account:e.Opt(W),amount:e.Opt(ht)}),vt=e.Variant({Spawn:c,Split:u,Follow:l,ClaimOrRefresh:m,Configure:ce,RegisterVote:xe,Merge:ue,DisburseToNeuron:de,MakeProposal:n,StakeMaturity:Se,MergeMaturity:_e,Disburse:pe}),$=e.Variant({Subaccount:e.Vec(e.Nat8),NeuronId:o}),bt=e.Record({id:e.Opt(o),command:e.Opt(vt),neuron_id_or_subaccount:e.Opt($)}),xt=e.Record({controllers:e.Vec(e.Principal)}),St=e.Record({freezing_threshold:e.Opt(e.Nat64),controllers:e.Opt(xt),log_visibility:e.Opt(e.Int32),wasm_memory_limit:e.Opt(e.Nat64),memory_allocation:e.Opt(e.Nat64),compute_allocation:e.Opt(e.Nat64)}),ke=e.Record({canister_id:e.Opt(e.Principal),settings:e.Opt(St)}),kt=e.Record({skip_stopping_before_installing:e.Opt(e.Bool),wasm_module_hash:e.Opt(e.Vec(e.Nat8)),canister_id:e.Opt(e.Principal),arg_hash:e.Opt(e.Vec(e.Nat8)),install_mode:e.Opt(e.Int32)}),Te=e.Record({action:e.Opt(e.Int32),canister_id:e.Opt(e.Principal)}),T=e.Record({basis_points:e.Opt(e.Nat64)}),y=e.Record({seconds:e.Opt(e.Nat64)}),f=e.Record({e8s:e.Opt(e.Nat64)}),Tt=e.Record({reward_rate_transition_duration:e.Opt(y),initial_reward_rate:e.Opt(T),final_reward_rate:e.Opt(T)}),Ct=e.Record({neuron_maximum_dissolve_delay_bonus:e.Opt(T),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(T),neuron_minimum_stake:e.Opt(f),proposal_wait_for_quiet_deadline_increase:e.Opt(y),proposal_initial_voting_period:e.Opt(y),proposal_rejection_fee:e.Opt(f),voting_reward_parameters:e.Opt(Tt)}),Ce=e.Record({base64_encoding:e.Opt(e.Text)}),Pt=e.Record({transaction_fee:e.Opt(f),token_symbol:e.Opt(e.Text),token_logo:e.Opt(Ce),token_name:e.Opt(e.Text)}),Ft=e.Record({id:e.Opt(e.Principal)}),Vt=e.Record({dissolve_delay_interval:e.Opt(y),count:e.Opt(e.Nat64)}),Mt=e.Record({seconds_after_utc_midnight:e.Opt(e.Nat64)}),At=e.Record({iso_codes:e.Vec(e.Text)}),Bt=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(Vt),confirmation_text:e.Opt(e.Text),maximum_participant_icp:e.Opt(f),minimum_icp:e.Opt(f),minimum_direct_participation_icp:e.Opt(f),minimum_participant_icp:e.Opt(f),start_time:e.Opt(Mt),maximum_direct_participation_icp:e.Opt(f),maximum_icp:e.Opt(f),neurons_fund_investment_icp:e.Opt(f),restricted_countries:e.Opt(At)}),Pe=e.Record({total:e.Opt(f)}),Et=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(f)}),qt=e.Record({developer_neurons:e.Vec(Et)}),Ut=e.Record({treasury_distribution:e.Opt(Pe),developer_distribution:e.Opt(qt),swap_distribution:e.Opt(Pe)}),Fe=e.Record({url:e.Opt(e.Text),governance_parameters:e.Opt(Ct),fallback_controller_principal_ids:e.Vec(e.Principal),logo:e.Opt(Ce),name:e.Opt(e.Text),ledger_parameters:e.Opt(Pt),description:e.Opt(e.Text),dapp_canisters:e.Vec(Ft),swap_parameters:e.Opt(Bt),initial_token_distribution:e.Opt(Ut)}),Ve=e.Record({nns_function:e.Int32,payload:e.Vec(e.Nat8)}),b=e.Record({id:e.Opt(e.Principal),reward_account:e.Opt(W)}),Gt=e.Record({dissolve_delay_seconds:e.Nat64}),Kt=e.Record({to_account:e.Opt(W)}),Ht=e.Variant({RewardToNeuron:Gt,RewardToAccount:Kt}),X=e.Record({node_provider:e.Opt(b),reward_mode:e.Opt(Ht),amount_e8s:e.Nat64}),jt=e.Record({dissolve_delay_interval_seconds:e.Nat64,count:e.Nat64}),Wt=e.Record({min_participant_icp_e8s:e.Nat64,neuron_basket_construction_parameters:e.Opt(jt),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)}),$t=e.Record({community_fund_investment_e8s:e.Opt(e.Nat64),target_swap_canister_id:e.Opt(e.Principal),params:e.Opt(Wt)}),Xt=e.Record({start_timestamp_seconds:e.Nat64,end_timestamp_seconds:e.Nat64}),zt=e.Record({open_time_window:e.Opt(Xt)}),Jt=e.Record({request:e.Opt(zt),swap_canister_id:e.Opt(e.Principal)}),Yt=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,r))}),Me=e.Record({use_registry_derived_rewards:e.Opt(e.Bool),rewards:e.Vec(X)}),z=e.Record({human_readable:e.Opt(e.Text)}),Qt=e.Record({contribution_threshold_xdr:e.Opt(z),one_third_participation_milestone_xdr:e.Opt(z),full_participation_milestone_xdr:e.Opt(z)}),Zt=e.Record({maximum_icp_xdr_rate:e.Opt(T),neurons_fund_matched_funding_curve_coefficients:e.Opt(Qt),max_theoretical_neurons_fund_participation_amount_xdr:e.Opt(z),minimum_icp_xdr_rate:e.Opt(T)}),J=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(Zt)}),le=e.Record({principals:e.Vec(e.Principal)}),It=e.Variant({ToRemove:b,ToAdd:b}),Ae=e.Record({change:e.Opt(It)}),Be=e.Record({motion_text:e.Text}),Dt=e.Variant({RegisterKnownNeuron:s,ManageNeuron:bt,UpdateCanisterSettings:ke,InstallCode:kt,StopOrStartCanister:Te,CreateServiceNervousSystem:Fe,ExecuteNnsFunction:Ve,RewardNodeProvider:X,OpenSnsTokenSwap:$t,SetSnsTokenSwapOpenTimeWindow:Jt,SetDefaultFollowees:Yt,RewardNodeProviders:Me,ManageNetworkEconomics:J,ApproveGenesisKyc:le,AddOrRemoveNodeProvider:Ae,Motion:Be});n.fill(e.Record({url:e.Text,title:e.Opt(e.Text),action:e.Opt(Dt),summary:e.Text}));let Lt=e.Record({proposal:e.Opt(n),caller:e.Opt(e.Principal),proposer_id:e.Opt(o)}),Ee=e.Record({xdr_permyriad_per_icp:e.Opt(e.Nat64),timestamp_seconds:e.Opt(e.Nat64)}),Y=e.Record({minimum_xdr_permyriad_per_icp:e.Opt(e.Nat64),registry_version:e.Opt(e.Nat64),node_providers:e.Vec(b),timestamp:e.Nat64,rewards:e.Vec(X),xdr_conversion_rate:e.Opt(Ee),maximum_node_provider_rewards_e8s:e.Opt(e.Nat64)}),qe=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))}),Ue=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(qe),dissolving_neurons_count:e.Nat64,dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),total_staked_maturity_e8s_equivalent_seed:e.Nat64,community_fund_total_staked_e8s:e.Nat64,not_dissolving_neurons_e8s_buckets_seed:e.Vec(e.Tuple(e.Nat64,e.Float64)),public_neuron_subset_metrics:e.Opt(qe),timestamp_seconds:e.Nat64,seed_neuron_count:e.Nat64}),en=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}),Ge=e.Record({groups:e.Vec(en),timestamp_seconds:e.Opt(e.Nat64)}),Ke=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(v)}),He=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}),tn=e.Record({followers:e.Vec(o)}),nn=e.Record({followers_map:e.Vec(e.Tuple(e.Nat64,tn))}),on=e.Variant({LastNeuronId:o}),je=e.Record({status:e.Opt(e.Int32),failure_reason:e.Opt(e.Text),progress:e.Opt(on)}),rn=e.Record({neuron_indexes_migration:e.Opt(je),copy_inactive_neurons_to_stable_memory_migration:e.Opt(je)}),N=e.Record({error_message:e.Text,error_type:e.Int32}),We=e.Record({vote:e.Int32,voting_power:e.Nat64}),sn=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)}),an=e.Record({controller:e.Opt(e.Principal),hotkeys:e.Vec(e.Principal),is_capped:e.Opt(e.Bool),maturity_equivalent_icp_e8s:e.Opt(e.Nat64),nns_neuron_id:e.Opt(o),amount_icp_e8s:e.Opt(e.Nat64)}),me=e.Record({neurons_fund_neuron_portions:e.Vec(an)}),cn=e.Record({serialized_representation:e.Opt(e.Text)}),Q=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(sn),max_neurons_fund_swap_participation_icp_e8s:e.Opt(e.Nat64),neurons_fund_reserves:e.Opt(me),ideal_matched_participation_function:e.Opt(cn),allocated_neurons_fund_participation_icp_e8s:e.Opt(e.Nat64)}),un=e.Record({final_neurons_fund_participation:e.Opt(Q),initial_neurons_fund_participation:e.Opt(Q),neurons_fund_refunds:e.Opt(me)}),dn=e.Record({status:e.Opt(e.Int32),freezing_threshold:e.Opt(e.Nat64),controllers:e.Vec(e.Principal),memory_size:e.Opt(e.Nat64),cycles:e.Opt(e.Nat64),idle_cycles_burned_per_day:e.Opt(e.Nat64),module_hash:e.Vec(e.Nat8)}),x=e.Record({status:e.Opt(dn),canister_id:e.Opt(e.Principal)}),_n=e.Record({ledger_index_canister_summary:e.Opt(x),fallback_controller_principal_ids:e.Vec(e.Principal),ledger_archive_canister_summaries:e.Vec(x),ledger_canister_summary:e.Opt(x),swap_canister_summary:e.Opt(x),governance_canister_summary:e.Opt(x),root_canister_summary:e.Opt(x),dapp_canister_summaries:e.Vec(x)}),$e=e.Record({swap_background_information:e.Opt(_n)}),Xe=e.Record({no:e.Nat64,yes:e.Nat64,total:e.Nat64,timestamp_seconds:e.Nat64}),pn=e.Record({current_deadline_timestamp_seconds:e.Nat64}),ln=e.Record({id:e.Opt(v),failure_reason:e.Opt(N),ballots:e.Vec(e.Tuple(e.Nat64,We)),proposal_timestamp_seconds:e.Nat64,reward_event_round:e.Nat64,failed_timestamp_seconds:e.Nat64,neurons_fund_data:e.Opt(un),reject_cost_e8s:e.Nat64,derived_proposal_information:e.Opt($e),latest_tally:e.Opt(Xe),sns_token_swap_lifecycle:e.Opt(e.Int32),decided_timestamp_seconds:e.Nat64,proposal:e.Opt(n),proposer:e.Opt(o),wait_for_quiet_state:e.Opt(pn),executed_timestamp_seconds:e.Nat64,original_total_community_fund_maturity_e8s_equivalent:e.Opt(e.Nat64)}),mn=e.Variant({Spawn:o,Split:u,Configure:ce,Merge:ue,DisburseToNeuron:de,SyncCommand:e.Record({}),ClaimOrRefreshNeuron:m,MergeMaturity:_e,Disburse:pe}),fn=e.Record({command:e.Opt(mn),timestamp:e.Nat64}),ze=e.Record({vote:e.Int32,proposal_id:e.Opt(v)}),Nn=e.Variant({DissolveDelaySeconds:e.Nat64,WhenDissolvedTimestampSeconds:e.Nat64}),M=e.Record({id:e.Opt(o),staked_maturity_e8s_equivalent:e.Opt(e.Nat64),controller:e.Opt(e.Principal),recent_ballots:e.Vec(ze),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(Nn),followees:e.Vec(e.Tuple(e.Int32,r)),neuron_fees_e8s:e.Nat64,visibility:e.Opt(e.Int32),transfer:e.Opt(He),known_neuron_data:e.Opt(i),spawn_at_timestamp_seconds:e.Opt(e.Nat64)}),ti=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,r)),making_sns_proposal:e.Opt(Lt),most_recent_monthly_node_provider_rewards:e.Opt(Y),maturity_modulation_last_updated_at_timestamp_seconds:e.Opt(e.Nat64),wait_for_quiet_threshold_seconds:e.Nat64,metrics:e.Opt(Ue),neuron_management_voting_period_seconds:e.Opt(e.Nat64),node_providers:e.Vec(b),cached_daily_maturity_modulation_basis_points:e.Opt(e.Int32),economics:e.Opt(J),restore_aging_summary:e.Opt(Ge),spawning_neurons:e.Opt(e.Bool),latest_reward_event:e.Opt(Ke),to_claim_transfers:e.Vec(He),short_voting_period_seconds:e.Nat64,topic_followee_index:e.Vec(e.Tuple(e.Int32,nn)),migrations:e.Opt(rn),proposals:e.Vec(e.Tuple(e.Nat64,ln)),xdr_conversion_rate:e.Opt(Ee),in_flight_commands:e.Vec(e.Tuple(e.Nat64,fn)),neurons:e.Vec(e.Tuple(e.Nat64,M)),genesis_timestamp_seconds:e.Nat64}),Z=e.Variant({Ok:e.Null,Err:N}),wn=e.Variant({Error:N,NeuronId:o}),yn=e.Record({result:e.Opt(wn)}),Je=e.Variant({Ok:M,Err:N}),gn=e.Variant({Ok:Ue,Err:N}),Rn=e.Variant({Ok:Y,Err:N}),I=e.Record({dissolve_delay_seconds:e.Nat64,recent_ballots:e.Vec(ze),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,visibility:e.Opt(e.Int32),known_neuron_data:e.Opt(i),voting_power:e.Nat64,age_seconds:e.Nat64}),Ye=e.Variant({Ok:I,Err:N}),On=e.Record({nns_proposal_id:e.Opt(v)}),hn=e.Record({final_neurons_fund_participation:e.Opt(Q),initial_neurons_fund_participation:e.Opt(Q),neurons_fund_refunds:e.Opt(me)}),vn=e.Record({neurons_fund_audit_info:e.Opt(hn)}),bn=e.Variant({Ok:vn,Err:N}),xn=e.Record({result:e.Opt(bn)}),Sn=e.Variant({Ok:b,Err:N}),fe=e.Record({id:e.Opt(v),status:e.Int32,topic:e.Int32,failure_reason:e.Opt(N),ballots:e.Vec(e.Tuple(e.Nat64,We)),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($e),latest_tally:e.Opt(Xe),reward_status:e.Int32,decided_timestamp_seconds:e.Nat64,proposal:e.Opt(n),proposer:e.Opt(o),executed_timestamp_seconds:e.Nat64}),kn=e.Record({known_neurons:e.Vec(s)}),Tn=e.Record({include_public_neurons_in_full_neurons:e.Opt(e.Bool),neuron_ids:e.Vec(e.Nat64),include_empty_neurons_readable_by_caller:e.Opt(e.Bool),include_neurons_readable_by_caller:e.Bool}),Cn=e.Record({neuron_infos:e.Vec(e.Tuple(e.Nat64,I)),full_neurons:e.Vec(M)}),Pn=e.Record({start_timestamp_seconds:e.Opt(e.Nat64),end_timestamp_seconds:e.Opt(e.Nat64)}),Fn=e.Record({date_filter:e.Opt(Pn)}),Vn=e.Record({rewards:e.Vec(Y)}),Mn=e.Record({node_providers:e.Vec(b)}),An=e.Record({include_reward_status:e.Vec(e.Int32),omit_large_fields:e.Opt(e.Bool),before_proposal:e.Opt(v),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(fe)}),En=e.Record({arg:e.Opt(e.Vec(e.Nat8)),wasm_module:e.Opt(e.Vec(e.Nat8)),skip_stopping_before_installing:e.Opt(e.Bool),canister_id:e.Opt(e.Principal),install_mode:e.Opt(e.Int32)}),qn=e.Variant({RegisterKnownNeuron:s,ManageNeuron:t,UpdateCanisterSettings:ke,InstallCode:En,StopOrStartCanister:Te,CreateServiceNervousSystem:Fe,ExecuteNnsFunction:Ve,RewardNodeProvider:X,RewardNodeProviders:Me,ManageNetworkEconomics:J,ApproveGenesisKyc:le,AddOrRemoveNodeProvider:Ae,Motion:Be}),Un=e.Record({url:e.Text,title:e.Opt(e.Text),action:e.Opt(qn),summary:e.Text}),Gn=e.Variant({Spawn:c,Split:u,Follow:l,ClaimOrRefresh:m,Configure:ce,RegisterVote:xe,Merge:ue,DisburseToNeuron:de,MakeProposal:Un,StakeMaturity:Se,MergeMaturity:_e,Disburse:pe});t.fill(e.Record({id:e.Opt(o),command:e.Opt(Gn),neuron_id_or_subaccount:e.Opt($)}));let Ne=e.Record({created_neuron_id:e.Opt(o)}),Kn=e.Record({refreshed_neuron_id:e.Opt(o)}),Hn=e.Record({target_neuron:e.Opt(M),source_neuron:e.Opt(M),target_neuron_info:e.Opt(I),source_neuron_info:e.Opt(I)}),jn=e.Record({message:e.Opt(e.Text),proposal_id:e.Opt(v)}),Wn=e.Record({maturity_e8s:e.Nat64,staked_maturity_e8s:e.Nat64}),$n=e.Record({merged_maturity_e8s:e.Nat64,new_stake_e8s:e.Nat64}),Xn=e.Record({transfer_block_height:e.Nat64}),zn=e.Variant({Error:N,Spawn:Ne,Split:Ne,Follow:e.Record({}),ClaimOrRefresh:Kn,Configure:e.Record({}),RegisterVote:e.Record({}),Merge:Hn,DisburseToNeuron:Ne,MakeProposal:jn,StakeMaturity:Wn,MergeMaturity:$n,Disburse:Xn}),Qe=e.Record({command:e.Opt(zn)}),Jn=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)}),Yn=e.Variant({Committed:Jn,Aborted:e.Record({})}),Qn=e.Record({result:e.Opt(Yn),open_sns_token_swap_proposal_id:e.Opt(e.Nat64)}),Zn=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)}),In=e.Variant({Committed:Zn,Aborted:e.Record({})}),Dn=e.Record({result:e.Opt(In),nns_proposal_id:e.Opt(e.Nat64)}),Ln=e.Record({controller:e.Opt(e.Principal),hotkeys:e.Opt(le),is_capped:e.Opt(e.Bool),nns_neuron_id:e.Opt(e.Nat64),amount_icp_e8s:e.Opt(e.Nat64)}),eo=e.Record({neurons_fund_neuron_portions:e.Vec(Ln)}),to=e.Variant({Ok:eo,Err:N}),no=e.Record({result:e.Opt(to)}),oo=e.Record({reward_account:e.Opt(W)});return e.Service({claim_gtc_neurons:e.Func([e.Principal,e.Vec(o)],[Z],[]),claim_or_refresh_neuron_from_account:e.Func([p],[yn],[]),get_build_metadata:e.Func([],[e.Text],["query"]),get_full_neuron:e.Func([e.Nat64],[Je],["query"]),get_full_neuron_by_id_or_subaccount:e.Func([$],[Je],["query"]),get_latest_reward_event:e.Func([],[Ke],["query"]),get_metrics:e.Func([],[gn],["query"]),get_monthly_node_provider_rewards:e.Func([],[Rn],[]),get_most_recent_monthly_node_provider_rewards:e.Func([],[e.Opt(Y)],["query"]),get_network_economics_parameters:e.Func([],[J],["query"]),get_neuron_ids:e.Func([],[e.Vec(e.Nat64)],["query"]),get_neuron_info:e.Func([e.Nat64],[Ye],["query"]),get_neuron_info_by_id_or_subaccount:e.Func([$],[Ye],["query"]),get_neurons_fund_audit_info:e.Func([On],[xn],["query"]),get_node_provider_by_caller:e.Func([e.Null],[Sn],["query"]),get_pending_proposals:e.Func([],[e.Vec(fe)],["query"]),get_proposal_info:e.Func([e.Nat64],[e.Opt(fe)],["query"]),get_restore_aging_summary:e.Func([],[Ge],["query"]),list_known_neurons:e.Func([],[kn],["query"]),list_neurons:e.Func([Tn],[Cn],["query"]),list_node_provider_rewards:e.Func([Fn],[Vn],["query"]),list_node_providers:e.Func([],[Mn],["query"]),list_proposals:e.Func([An],[Bn],["query"]),manage_neuron:e.Func([t],[Qe],[]),settle_community_fund_participation:e.Func([Qn],[Z],[]),settle_neurons_fund_participation:e.Func([Dn],[no],[]),simulate_manage_neuron:e.Func([t],[Qe],[]),transfer_gtc_neuron:e.Func([o,o],[Z],[]),update_node_provider:e.Func([oo],[Z],[])})};var _r=({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,visibility:e.Opt(e.Int32),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,visibility:e.Opt(e.Int32),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 Wi}from"@dfinity/ledger-icp";import{Principal as C}from"@dfinity/principal";import{arrayBufferToUint8Array as ho,isNullish as _t,nonNullish as $i,toNullable as g}from"@dfinity/utils";var dt=class extends Error{},De=class extends dt{},Le=class extends dt{constructor(n){super();this.minimumAmount=n}},re=class extends Error{},ie=class extends Error{constructor(n){super();this.detail=n}},O=class extends Error{constructor(t){super("Unsupported value: "+t)}};var mr=e=>({id:e}),fr=e=>({id:e}),Xi=e=>{if("NeuronId"in e)return{NeuronId:{id:e.NeuronId}};if("Subaccount"in e)return{Subaccount:Uint8Array.from(e.Subaccount)};throw new O(e)},pt=e=>e.basisPoints!==void 0?{basis_points:[e.basisPoints]}:{basis_points:[]},U=e=>e.seconds!==void 0?{seconds:[e.seconds]}:{seconds:[]},zi=e=>e.secondsAfterUtcMidnight!==void 0?{seconds_after_utc_midnight:[e.secondsAfterUtcMidnight]}:{seconds_after_utc_midnight:[]},Ji=e=>({iso_codes:e.isoCodes}),F=e=>e.e8s!==void 0?{e8s:[e.e8s]}:{e8s:[]},Nr=e=>e.base64Encoding!==void 0?{base64_encoding:[e.base64Encoding]}:{base64_encoding:[]},Yi=e=>({reward_rate_transition_duration:e.rewardRateTransitionDuration!==void 0?[U(e.rewardRateTransitionDuration)]:[],initial_reward_rate:e.initialRewardRate!==void 0?[pt(e.initialRewardRate)]:[],final_reward_rate:e.finalRewardRate!==void 0?[pt(e.finalRewardRate)]:[]}),Qi=e=>({transaction_fee:e.transactionFee!==void 0?[F(e.transactionFee)]:[],token_symbol:e.tokenSymbol!==void 0?[e.tokenSymbol]:[],token_logo:e.tokenLogo!==void 0?[Nr(e.tokenLogo)]:[],token_name:e.tokenName!==void 0?[e.tokenName]:[]}),Zi=e=>({minimum_participants:e.minimumParticipants!==void 0?[e.minimumParticipants]:[],duration:e.duration!==void 0?[U(e.duration)]:[],neuron_basket_construction_parameters:e.neuronBasketConstructionParameters!==void 0?[Ii(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?[zi(e.startTime)]:[],maximum_icp:e.maximumIcp!==void 0?[F(e.maximumIcp)]:[],restricted_countries:e.restrictedCountries!==void 0?[Ji(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:g(e.neuronsFundParticipation)}),Ii=e=>({dissolve_delay_interval:e.dissolveDelayInterval!==void 0?[U(e.dissolveDelayInterval)]:[],count:e.count!==void 0?[e.count]:[]}),Di=e=>({neuron_maximum_dissolve_delay_bonus:e.neuronMaximumDissolveDelayBonus!==void 0?[pt(e.neuronMaximumDissolveDelayBonus)]:[],neuron_maximum_age_for_age_bonus:e.neuronMaximumAgeForAgeBonus!==void 0?[U(e.neuronMaximumAgeForAgeBonus)]:[],neuron_maximum_dissolve_delay:e.neuronMaximumDissolveDelay!==void 0?[U(e.neuronMaximumDissolveDelay)]:[],neuron_minimum_dissolve_delay_to_vote:e.neuronMinimumDissolveDelayToVote!==void 0?[U(e.neuronMinimumDissolveDelayToVote)]:[],neuron_maximum_age_bonus:e.neuronMaximumAgeBonus!==void 0?[pt(e.neuronMaximumAgeBonus)]:[],neuron_minimum_stake:e.neuronMinimumStake!==void 0?[F(e.neuronMinimumStake)]:[],proposal_wait_for_quiet_deadline_increase:e.proposalWaitForQuietDeadlineIncrease!==void 0?[U(e.proposalWaitForQuietDeadlineIncrease)]:[],proposal_initial_voting_period:e.proposalInitialVotingPeriod!==void 0?[U(e.proposalInitialVotingPeriod)]:[],proposal_rejection_fee:e.proposalRejectionFee!==void 0?[F(e.proposalRejectionFee)]:[],voting_reward_parameters:e.votingRewardParameters!==void 0?[Yi(e.votingRewardParameters)]:[]}),pr=e=>({total:e.total!==void 0?[F(e.total)]:[]}),Li=e=>({treasury_distribution:e.treasuryDistribution!==void 0?[pr(e.treasuryDistribution)]:[],developer_distribution:e.developerDistribution!==void 0?[ts(e.developerDistribution)]:[],swap_distribution:e.swapDistribution!==void 0?[pr(e.swapDistribution)]:[]}),es=e=>({controller:e.controller!==void 0?[C.fromText(e.controller)]:[],dissolve_delay:e.dissolveDelay!==void 0?[U(e.dissolveDelay)]:[],memo:e.memo!==void 0?[e.memo]:[],vesting_period:e.vestingPeriod!==void 0?[U(e.vestingPeriod)]:[],stake:e.stake!==void 0?[F(e.stake)]:[]}),ts=e=>({developer_neurons:e.developerNeurons.map(es)}),ns=e=>({url:e.url!==void 0?[e.url]:[],governance_parameters:e.governanceParameters!==void 0?[Di(e.governanceParameters)]:[],fallback_controller_principal_ids:e.fallbackControllerPrincipalIds.map(t=>C.fromText(t)),logo:e.logo!==void 0?[Nr(e.logo)]:[],name:e.name!==void 0?[e.name]:[],ledger_parameters:e.ledgerParameters!==void 0?[Qi(e.ledgerParameters)]:[],description:e.description!==void 0?[e.description]:[],dapp_canisters:e.dappCanisters.map(t=>({id:[C.fromText(t)]})),swap_parameters:e.swapParameters!==void 0?[Zi(e.swapParameters)]:[],initial_token_distribution:e.initialTokenDistribution!==void 0?[Li(e.initialTokenDistribution)]:[]}),os=e=>{if(e.wasmModule===void 0)throw new Error("wasmModule not found");return{arg:g(ho(e.arg??new ArrayBuffer(0))),wasm_module:g(ho(e.wasmModule)),skip_stopping_before_installing:g(e.skipStoppingBeforeInstalling),canister_id:g($i(e.canisterId)?C.fromText(e.canisterId):void 0),install_mode:g(e.installMode)}},rs=e=>e===void 0?[]:[{freezing_threshold:g(e.freezingThreshold),controllers:e.controllers?[{controllers:e.controllers.map(t=>C.fromText(t))}]:[],log_visibility:g(e.logVisibility),wasm_memory_limit:g(e.wasmMemoryLimit),compute_allocation:g(e.computeAllocation),memory_allocation:g(e.memoryAllocation)}],wr=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:ho(t.payloadBytes)}}}if("ManageNeuron"in e){let t=e.ManageNeuron;return{ManageNeuron:ds(t)}}if("ApproveGenesisKyc"in e)return{ApproveGenesisKyc:{principals:e.ApproveGenesisKyc.principals.map(C.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:cs(t.neuronsFundEconomics)}}}if("RewardNodeProvider"in e){let t=e.RewardNodeProvider;return{RewardNodeProvider:{node_provider:t.nodeProvider?[lt(t.nodeProvider)]:[],amount_e8s:t.amountE8s,reward_mode:t.rewardMode!=null?[lr(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?[lt(n.nodeProvider)]:[],amount_e8s:n.amountE8s,reward_mode:n.rewardMode!=null?[lr(n.rewardMode)]:[]}))}}}if("AddOrRemoveNodeProvider"in e){let t=e.AddOrRemoveNodeProvider;return{AddOrRemoveNodeProvider:{change:t.change?[as(t.change)]:[]}}}if("Motion"in e)return{Motion:{motion_text:e.Motion.motionText}};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("CreateServiceNervousSystem"in e)return{CreateServiceNervousSystem:ns(e.CreateServiceNervousSystem)};if("InstallCode"in e)return{InstallCode:os(e.InstallCode)};if("StopOrStartCanister"in e){let t=e.StopOrStartCanister;return{StopOrStartCanister:{canister_id:t.canisterId?[C.fromText(t.canisterId)]:[],action:t.action?[t.action]:[]}}}if("UpdateCanisterSettings"in e){let t=e.UpdateCanisterSettings;return{UpdateCanisterSettings:{canister_id:t.canisterId?[C.fromText(t.canisterId)]:[],settings:rs(t.settings)}}}throw new O(e)},is=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(fr)}}}if("ClaimOrRefresh"in e){let t=e.ClaimOrRefresh;return{ClaimOrRefresh:{by:t.by?[us(t.by)]:[]}}}if("Configure"in e){let t=e.Configure;return{Configure:{operation:t.operation?[ss(t.operation)]:[]}}}if("RegisterVote"in e){let t=e.RegisterVote;return{RegisterVote:{vote:t.vote,proposal:t.proposal?[mr(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?[C.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:g(t)}}}if("MakeProposal"in e){let t=e.MakeProposal;return{MakeProposal:{url:t.url,title:[],action:t.action?[wr(t.action)]:[],summary:t.summary}}}if("Disburse"in e){let t=e.Disburse;return{Disburse:{to_account:t.toAccountId?[vo(t.toAccountId)]:[],amount:t.amount?[yr(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?[C.fromText(t.newController)]:[],nonce:[]}}}if("Merge"in e){let t=e.Merge;return{Merge:{source_neuron_id:t.sourceNeuronId?[{id:t.sourceNeuronId}]:[]}}}throw new O(e)},ss=e=>{if("RemoveHotKey"in e){let t=e.RemoveHotKey;return{RemoveHotKey:{hot_key_to_remove:t.hotKeyToRemove!=null?[C.fromText(t.hotKeyToRemove)]:[]}}}if("AddHotKey"in e){let t=e.AddHotKey;return{AddHotKey:{new_hot_key:t.newHotKey?[C.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}}}if("SetVisibility"in e){let t=e.SetVisibility;return{SetVisibility:{visibility:g(t.visibility)}}}throw new O(e)},as=e=>{if("ToRemove"in e)return{ToRemove:lt(e.ToRemove)};if("ToAdd"in e)return{ToAdd:lt(e.ToAdd)};throw new O(e)},lt=e=>({id:e.id!=null?[C.fromText(e.id)]:[],reward_account:e.rewardAccount!=null?[vo(e.rewardAccount)]:[]}),yr=e=>({e8s:e}),vo=e=>({hash:Wi(e)}),cs=e=>{if(_t(e))return[];let{maximumIcpXdrRate:t,maxTheoreticalNeuronsFundParticipationAmountXdr:n,neuronsFundMatchedFundingCurveCoefficients:o,minimumIcpXdrRate:r}=e,i=u=>_t(u)?[]:[{basis_points:g(u.basisPoints)}],s=u=>_t(u)?[]:[{human_readable:g(u.humanReadable)}],c=u=>_t(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)}]},lr=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?[vo(e.RewardToAccount.toAccount)]:[]}};throw new O(e)},us=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 O(e)},gr=({neuronIds:e,includeEmptyNeurons:t,includePublicNeurons:n})=>({neuron_ids:BigUint64Array.from(e??[]),include_neurons_readable_by_caller:!e,include_empty_neurons_readable_by_caller:g(t),include_public_neurons_in_full_neurons:g(n)}),ds=({id:e,command:t,neuronIdOrSubaccount:n})=>({id:e?[fr(e)]:[],command:t?[is(t)]:[],neuron_id_or_subaccount:n?[Xi(n)]:[]}),Rr=({includeRewardStatus:e,beforeProposal:t,excludeTopic:n,includeStatus:o,limit:r,includeAllManageNeuronProposals:i,omitLargeFields:s})=>({include_reward_status:Int32Array.from(e),before_proposal:t?[mr(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:g(s)}),Or=e=>({id:[],command:[{ClaimOrRefresh:{by:[{NeuronIdOrSubaccount:{}}]}}],neuron_id_or_subaccount:[{NeuronId:{id:e.neuronId}}]}),hr=({memo:e,controller:t})=>{let n={ClaimOrRefresh:{by:[{MemoAndController:{controller:t==null?[]:[t],memo:e}}]}};return{id:[],command:[n],neuron_id_or_subaccount:[]}},vr=({neuronId:e,amount:t})=>({id:[],command:[{Split:{amount_e8s:t}}],neuron_id_or_subaccount:[{NeuronId:{id:e}}]});var br=({neuronId:e,vote:t,proposalId:n})=>se({neuronId:e,command:{RegisterVote:{vote:t,proposal:[{id:n}]}}}),xr=e=>{let t={MakeProposal:{url:e.url,title:e.title!=null?[e.title]:[],summary:e.summary,action:[wr(e.action)]}};return{id:[],command:[t],neuron_id_or_subaccount:[{NeuronId:{id:e.neuronId}}]}},Sr=({neuronId:e,topic:t,followees:n})=>se({neuronId:e,command:{Follow:{topic:t,followees:n.map(o=>({id:o}))}}}),kr=({neuronId:e,toAccountIdentifier:t,amount:n})=>se({neuronId:e,command:{Disburse:{to_account:t!==void 0?[t.toAccountIdentifierHash()]:[],amount:n!==void 0?[yr(n)]:[]}}}),Tr=({neuronId:e,percentageToMerge:t})=>se({neuronId:e,command:{MergeMaturity:{percentage_to_merge:t}}}),Cr=({neuronId:e,percentageToStake:t})=>se({neuronId:e,command:{StakeMaturity:{percentage_to_stake:g(t)}}}),Pr=({neuronId:e,percentageToSpawn:t,newController:n,nonce:o})=>se({neuronId:e,command:{Spawn:{percentage_to_spawn:t===void 0?[]:[t],new_controller:n===void 0?[]:[n],nonce:o===void 0?[]:[o]}}}),Fr=({neuronId:e,principal:t})=>G({neuronId:e,operation:{AddHotKey:{new_hot_key:[t]}}}),Vr=({neuronId:e,principal:t})=>G({neuronId:e,operation:{RemoveHotKey:{hot_key_to_remove:[t]}}}),Mr=({neuronId:e,additionalDissolveDelaySeconds:t})=>G({neuronId:e,operation:{IncreaseDissolveDelay:{additional_dissolve_delay_seconds:t}}}),Ar=({neuronId:e,dissolveDelaySeconds:t})=>G({neuronId:e,operation:{SetDissolveTimestamp:{dissolve_timestamp_seconds:BigInt(t)}}}),Br=e=>G({neuronId:e,operation:{JoinCommunityFund:{}}}),Er=({neuronId:e,autoStake:t})=>G({neuronId:e,operation:{ChangeAutoStakeMaturity:{requested_setting_for_auto_stake_maturity:t}}}),qr=e=>G({neuronId:e,operation:{LeaveCommunityFund:{}}}),Ur=({neuronId:e,visibility:t})=>G({neuronId:e,operation:{SetVisibility:{visibility:[t]}}}),bo=({sourceNeuronId:e,targetNeuronId:t})=>se({neuronId:t,command:{Merge:{source_neuron_id:[{id:e}]}}}),Gr=e=>G({neuronId:e,operation:{StartDissolving:{}}}),Kr=e=>G({neuronId:e,operation:{StopDissolving:{}}}),se=({neuronId:e,command:t})=>({id:[{id:e}],command:[t],neuron_id_or_subaccount:[]}),G=({neuronId:e,operation:t})=>se({neuronId:e,command:{Configure:{operation:[t]}}});import{accountIdentifierFromBytes as _s,principalToAccountIdentifier as ps}from"@dfinity/ledger-icp";import{Principal as Hr}from"@dfinity/principal";import{fromDefinedNullable as ft,fromNullable as d,isNullish as mt,nonNullish as be,toNullable as ee,uint8ArrayToArrayOfNumber as ls,uint8ArrayToHexString as jr}from"@dfinity/utils";var xo=({neuronId:e,neuronInfo:t,rawNeuron:n,canisterId:o})=>{let r=n?ms({neuron:n,canisterId:o}):void 0;return{neuronId:e,dissolveDelaySeconds:t.dissolve_delay_seconds,recentBallots:t.recent_ballots.map(Xr),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,visibility:d(t.visibility),fullNeuron:r}},ms=({neuron:e,canisterId:t})=>({id:e.id.length?ae(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(Xr),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:ps(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?fs(e.dissolve_state[0]):void 0,spawnAtTimesSeconds:e.spawn_at_timestamp_seconds[0],followees:e.followees.map(([n,o])=>zr({topic:n,followees:o})),visibility:d(e.visibility)}),ga=({neuron:e,account:t})=>({id:be(e.id)?ee({id:e.id}):[],staked_maturity_e8s_equivalent:ee(e.stakedMaturityE8sEquivalent),controller:be(e.controller)?ee(Hr.from(e.controller)):[],recent_ballots:e.recentBallots.map(n=>({vote:n.vote,proposal_id:be(n.proposalId)?ee({id:n.proposalId}):[]})),kyc_verified:e.kycVerified,neuron_type:ee(e.neuronType),not_for_profit:e.notForProfit,cached_neuron_stake_e8s:e.cachedNeuronStake,created_timestamp_seconds:e.createdTimestampSeconds,auto_stake_maturity:ee(e.autoStakeMaturity),maturity_e8s_equivalent:e.maturityE8sEquivalent,aging_since_timestamp_seconds:e.agingSinceTimestampSeconds,neuron_fees_e8s:e.neuronFees,hot_keys:e.hotKeys.map(n=>Hr.from(n)),account:t,joined_community_fund_timestamp_seconds:ee(e.joinedCommunityFundTimestampSeconds),dissolve_state:be(e.dissolveState)?[e.dissolveState]:[],spawn_at_timestamp_seconds:ee(e.spawnAtTimesSeconds),followees:e.followees.map(n=>[n.topic,{followees:n.followees.map(o=>({id:o}))}]),visibility:ee(e.visibility),transfer:[],known_neuron_data:[]}),Xr=({vote:e,proposal_id:t})=>({vote:e,proposalId:t.length?ae(t[0]):void 0}),fs=e=>"DissolveDelaySeconds"in e?{DissolveDelaySeconds:e.DissolveDelaySeconds}:{WhenDissolvedTimestampSeconds:e.WhenDissolvedTimestampSeconds},zr=({topic:e,followees:t})=>({topic:e,followees:t.followees.map(ae)}),ae=({id:e})=>e,Ns=e=>{if("NeuronId"in e)return{NeuronId:e.NeuronId.id};if("Subaccount"in e)return{Subaccount:ls(Uint8Array.from(e.Subaccount))};throw new O(e)},ws=({neuronId:e,ballot:t})=>{let{vote:n,voting_power:o}=t;return{neuronId:e,vote:n,votingPower:o}},ys=({title:e,url:t,action:n,summary:o})=>({title:e.length?e[0]:void 0,url:t,action:n.length?Jr(n[0]):void 0,summary:o}),Jr=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?ae(t.id[0]):void 0,command:t.command.length?Rs(t.command[0]):void 0,neuronIdOrSubaccount:t.neuron_id_or_subaccount.length?Ns(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:vs(t.neurons_fund_economics)}}}if("RewardNodeProvider"in e){let t=e.RewardNodeProvider;return{RewardNodeProvider:{nodeProvider:t.node_provider.length?Nt(t.node_provider[0]):void 0,amountE8s:t.amount_e8s,rewardMode:t.reward_mode.length?Wr(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?Nt(n.node_provider[0]):void 0,amountE8s:n.amount_e8s,rewardMode:n.reward_mode.length?Wr(n.reward_mode[0]):void 0}))}}}if("AddOrRemoveNodeProvider"in e){let t=e.AddOrRemoveNodeProvider;return{AddOrRemoveNodeProvider:{change:t.change.length?hs(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])=>zr({topic:n,followees:o}))}};if("RegisterKnownNeuron"in e){let t=e.RegisterKnownNeuron;return{RegisterKnownNeuron:Ss(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:Vs(d(t.governance_parameters)),fallbackControllerPrincipalIds:t.fallback_controller_principal_ids.map(n=>n.toString()),logo:Zr(d(t.logo)),name:d(t.name),ledgerParameters:Ps(d(t.ledger_parameters)),description:d(t.description),dappCanisters:t.dapp_canisters.map(Cs)??[],swapParameters:As(d(t.swap_parameters)),initialTokenDistribution:qs(d(t.initial_token_distribution))}}}if("InstallCode"in e){let t=e.InstallCode;return{InstallCode:{skipStoppingBeforeInstalling:d(t.skip_stopping_before_installing),canisterId:t.canister_id.length?t.canister_id[0].toString():void 0,installMode:d(t.install_mode),wasmModuleHash:jr(ft(t.wasm_module_hash)),argHash:jr(ft(t.arg_hash))}}}if("StopOrStartCanister"in e){let t=e.StopOrStartCanister;return{StopOrStartCanister:{canisterId:t.canister_id.length?t.canister_id[0].toString():void 0,action:d(t.action)}}}if("UpdateCanisterSettings"in e)return{UpdateCanisterSettings:{canisterId:e.UpdateCanisterSettings.canister_id.length?e.UpdateCanisterSettings.canister_id[0].toString():void 0,settings:Us(ft(e.UpdateCanisterSettings.settings))}};throw new O(e)},gs=e=>({no:e.no,yes:e.yes,total:e.total,timestampSeconds:e.timestamp_seconds}),Rs=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(ae)}}}if("ClaimOrRefresh"in e){let t=e.ClaimOrRefresh;return{ClaimOrRefresh:{by:t.by.length?xs(t.by[0]):void 0}}}if("Configure"in e){let t=e.Configure;return{Configure:{operation:t.operation.length?Os(t.operation[0]):void 0}}}if("RegisterVote"in e){let t=e.RegisterVote;return{RegisterVote:{vote:t.vote,proposal:t.proposal.length?ae(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?Jr(t.action[0]):void 0,summary:t.summary}}}if("Disburse"in e){let t=e.Disburse;return{Disburse:{toAccountId:t.to_account.length?So(t.to_account[0]):void 0,amount:t.amount.length?bs(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 O(e)},Os=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}}}if("SetVisibility"in e){let t=e.SetVisibility;return{SetVisibility:{visibility:d(t.visibility)}}}throw new O(e)},hs=e=>{if("ToRemove"in e)return{ToRemove:Nt(e.ToRemove)};if("ToAdd"in e)return{ToAdd:Nt(e.ToAdd)};throw new O(e)},vs=e=>{let t=d(e);if(mt(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(mt(p))return;let{basis_points:_}=p,m=d(_);return be(m)?{basisPoints:m}:void 0},c=l=>{let p=d(l);if(mt(p))return;let{human_readable:_}=p,m=d(_);return be(m)?{humanReadable:m}:void 0},u=l=>{let p=d(l);if(mt(p))return;let{full_participation_milestone_xdr:_,one_third_participation_milestone_xdr:m,contribution_threshold_xdr:w}=p;return{fullParticipationMilestoneXdr:c(_),oneThirdParticipationMilestoneXdr:c(m),contributionThresholdXdr:c(w)}};return{maximumIcpXdrRate:s(n),neuronsFundMatchedFundingCurveCoefficients:u(o),maxTheoreticalNeuronsFundParticipationAmountXdr:c(r),minimumIcpXdrRate:s(i)}},Nt=e=>({id:e.id.length?e.id[0].toString():void 0,rewardAccount:e.reward_account.length?So(e.reward_account[0]):void 0}),bs=e=>e.e8s,So=e=>_s(new Uint8Array(e.hash)),Wr=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?So(e.RewardToAccount.to_account[0]):void 0}};throw new O(e)},xs=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 O(e)},ko=e=>({id:e.id.length?ae(e.id[0]):void 0,ballots:e.ballots.map(t=>ws({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?ys(e.proposal[0]):void 0,proposer:e.proposer.length?ae(e.proposer[0]):void 0,latestTally:e.latest_tally.length?gs(e.latest_tally[0]):void 0,executedTimestampSeconds:e.executed_timestamp_seconds,topic:e.topic,status:e.status,rewardStatus:e.reward_status}),Yr=({response:{neuron_infos:e,full_neurons:t},canisterId:n})=>e.map(([o,r])=>xo({neuronId:o,neuronInfo:r,rawNeuron:t.find(i=>i.id.length&&i.id[0].id===o),canisterId:n})),Qr=({proposal_info:e})=>({proposals:e.map(ko)}),Ss=({id:e,known_neuron_data:t})=>({id:e[0]?.id??BigInt(0),name:t[0]?.name??"",description:t[0]?.description[0]??""}),wt=e=>e===void 0?void 0:{basisPoints:d(e.basis_points)},K=e=>e===void 0?void 0:{seconds:d(e.seconds)},ks=e=>e===void 0?void 0:{secondsAfterUtcMidnight:d(e.seconds_after_utc_midnight)},Ts=e=>e===void 0?void 0:{isoCodes:e.iso_codes},V=e=>e===void 0?void 0:{e8s:d(e.e8s)},Cs=e=>e===void 0||e.id.length===0?void 0:ft(e.id).toString(),Zr=e=>e===void 0?void 0:{base64Encoding:d(e.base64_encoding)},Ps=e=>e===void 0?void 0:{transactionFee:V(d(e.transaction_fee)),tokenSymbol:d(e.token_symbol),tokenLogo:Zr(d(e.token_logo)),tokenName:d(e.token_name)},Fs=e=>e===void 0?void 0:{rewardRateTransitionDuration:K(d(e.reward_rate_transition_duration)),initialRewardRate:wt(d(e.initial_reward_rate)),finalRewardRate:wt(d(e.final_reward_rate))},Vs=e=>e===void 0?void 0:{neuronMaximumDissolveDelayBonus:wt(d(e.neuron_maximum_dissolve_delay_bonus)),neuronMaximumAgeForAgeBonus:K(d(e.neuron_maximum_age_for_age_bonus)),neuronMaximumDissolveDelay:K(d(e.neuron_maximum_dissolve_delay)),neuronMinimumDissolveDelayToVote:K(d(e.neuron_minimum_dissolve_delay_to_vote)),neuronMaximumAgeBonus:wt(d(e.neuron_maximum_age_bonus)),neuronMinimumStake:V(d(e.neuron_minimum_stake)),proposalWaitForQuietDeadlineIncrease:K(d(e.proposal_wait_for_quiet_deadline_increase)),proposalInitialVotingPeriod:K(d(e.proposal_initial_voting_period)),proposalRejectionFee:V(d(e.proposal_rejection_fee)),votingRewardParameters:Fs(d(e.voting_reward_parameters))},Ms=e=>e===void 0?void 0:{dissolveDelayInterval:K(d(e.dissolve_delay_interval)),count:d(e.count)},As=e=>e===void 0?void 0:{minimumParticipants:d(e.minimum_participants),duration:K(d(e.duration)),neuronBasketConstructionParameters:Ms(d(e.neuron_basket_construction_parameters)),confirmationText:d(e.confirmation_text),maximumParticipantIcp:V(d(e.maximum_participant_icp)),neuronsFundInvestmentIcp:V(d(e.neurons_fund_investment_icp)),minimumIcp:V(d(e.minimum_icp)),minimumParticipantIcp:V(d(e.minimum_participant_icp)),startTime:ks(d(e.start_time)),maximumIcp:V(d(e.maximum_icp)),restrictedCountries:Ts(d(e.restricted_countries)),maxDirectParticipationIcp:V(d(e.maximum_direct_participation_icp)),minDirectParticipationIcp:V(d(e.minimum_direct_participation_icp)),neuronsFundParticipation:d(e.neurons_fund_participation)},$r=e=>e===void 0?void 0:{total:V(d(e.total))},Bs=e=>e===void 0?void 0:{controller:e.controller.length===0?void 0:e.controller[0].toString(),dissolveDelay:K(d(e.dissolve_delay)),memo:d(e.memo),vestingPeriod:K(d(e.vesting_period)),stake:V(d(e.stake))},Es=e=>e===void 0?void 0:{developerNeurons:e.developer_neurons.map(Bs)},qs=e=>e===void 0?void 0:{treasuryDistribution:$r(d(e.treasury_distribution)),developerDistribution:Es(d(e.developer_distribution)),swapDistribution:$r(d(e.swap_distribution))},Us=e=>e===void 0?void 0:{freezingThreshold:d(e.freezing_threshold),controllers:d(e.controllers)?.controllers.map(t=>t.toString()),logVisibility:d(e.log_visibility),wasmMemoryLimit:d(e.wasm_memory_limit),computeAllocation:d(e.compute_allocation),memoryAllocation:d(e.memory_allocation)};var et=e=>{let{command:t}=e,n=t[0];if(!n)throw new ie({error_message:"Error updating neuron",error_type:0});if("Error"in n)throw new ie(n.Error);return n},h=async({request:e,service:t})=>{let n=await t.manage_neuron(e);return et(n)},Ir=async({request:e,service:t})=>{let n=await t.simulate_manage_neuron(e);return et(n)};var To=BigInt(1e8);var ei=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,includePublicNeurons:r})=>{let i=gr({neuronIds:n,includeEmptyNeurons:o,includePublicNeurons:r}),u=await(tt(o)&&tt(r)&&t?this.oldListNeuronsCertifiedService:this.getGovernanceService(t)).list_neurons(i);return Yr({response:u,canisterId:this.canisterId})};this.listKnownNeurons=async(t=!0)=>(await this.getGovernanceService(t).list_known_neurons()).known_neurons.map(o=>({id:k(o.id)?.id??BigInt(0),name:k(o.known_neuron_data)?.name??"",description:k(k(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=Rr(t),r=await this.getGovernanceService(n).list_proposals(o);return Qr(r)};this.stakeNeuron=async({stake:t,principal:n,fromSubAccount:o,ledgerCanister:r,createdAt:i,fee:s})=>{if(t<To)throw new Le(t);let c=new Uint8Array((0,Fo.default)(8)),u=Lr(c),l=this.buildNeuronStakeSubAccount(c,n),p=Co.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(tt(_))throw new De;return _};this.stakeNeuronIcrc1=async({stake:t,principal:n,fromSubAccount:o,ledgerCanister:r,createdAt:i,fee:s})=>{if(t<To)throw new Le(t);let c=new Uint8Array((0,Fo.default)(8)),u=Lr(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(tt(p))throw new De;return p};this.increaseDissolveDelay=async({neuronId:t,additionalDissolveDelaySeconds:n})=>{let o=Mr({neuronId:t,additionalDissolveDelaySeconds:n});await h({request:o,service:this.certifiedService})};this.setDissolveDelay=async({neuronId:t,dissolveDelaySeconds:n})=>{let o=Ar({neuronId:t,dissolveDelaySeconds:n});await h({request:o,service:this.certifiedService})};this.startDissolving=async t=>{let n=Gr(t);await h({request:n,service:this.certifiedService})};this.stopDissolving=async t=>{let n=Kr(t);await h({request:n,service:this.certifiedService})};this.joinCommunityFund=async t=>{let n=Br(t);await h({request:n,service:this.certifiedService})};this.autoStakeMaturity=async t=>{await h({request:Er(t),service:this.certifiedService})};this.leaveCommunityFund=async t=>{let n=qr(t);await h({request:n,service:this.certifiedService})};this.setVisibility=async(t,n)=>{let o=Ur({neuronId:t,visibility:n});await h({request:o,service:this.certifiedService})};this.setNodeProviderAccount=async t=>{Dr(t);let n=Co.fromHex(t),o=await this.certifiedService.update_node_provider({reward_account:[n.toAccountIdentifierHash()]});if("Err"in o)throw new ie(o.Err)};this.mergeNeurons=async t=>{let n=bo(t);await h({request:n,service:this.certifiedService})};this.simulateMergeNeurons=async t=>{let n=bo(t),o=await Ir({request:n,service:this.certifiedService}),r,i,s,c;if("Merge"in o&&H(r=o.Merge)&&H(i=k(r.target_neuron_info))&&H(s=k(r.target_neuron))&&H(c=k(s.id)?.id))return xo({neuronId:c,neuronInfo:i,rawNeuron:s,canisterId:this.canisterId});throw new re(`simulateMergeNeurons: Unrecognized Merge error in ${JSON.stringify(o)}`)};this.splitNeuron=async({neuronId:t,amount:n})=>{let o=vr({neuronId:t,amount:n}),r=await this.certifiedService.manage_neuron(o),i=et(r);if("Split"in i){let s=k(i.Split.created_neuron_id);if(tt(s))throw new ie({error_message:"Unexpected error splitting neuron. No neuronId in Split response.",error_type:0});return s.id}throw new re(`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?ko(o):void 0};this.makeProposal=async t=>{let n=xr(t),o=await h({request:n,service:this.certifiedService});return"MakeProposal"in o?k(o.MakeProposal.proposal_id)?.id:void 0};this.registerVote=async({neuronId:t,vote:n,proposalId:o})=>{let r=br({neuronId:t,vote:n,proposalId:o});await h({request:r,service:this.certifiedService})};this.setFollowees=async t=>{let n=Sr(t);await h({request:n,service:this.certifiedService})};this.disburse=async({neuronId:t,toAccountId:n,amount:o})=>{H(n)&&Dr(n);let r=H(n)?Co.fromHex(n):void 0,i=kr({neuronId:t,toAccountIdentifier:r,amount:o});await h({request:i,service:this.certifiedService})};this.mergeMaturity=async({neuronId:t,percentageToMerge:n})=>{Po(n);let o=Tr({neuronId:t,percentageToMerge:n});await h({request:o,service:this.certifiedService})};this.stakeMaturity=async({neuronId:t,percentageToStake:n})=>{Po(n??100),await h({request:Cr({neuronId:t,percentageToStake:n}),service:this.certifiedService})};this.spawnNeuron=async({neuronId:t,percentageToSpawn:n,newController:o,nonce:r})=>{H(n)&&Po(n);let i=Pr({neuronId:t,percentageToSpawn:n,newController:o,nonce:r}),s=await this.certifiedService.manage_neuron(i),c=et(s),u;if("Spawn"in c&&H(u=k(c.Spawn.created_neuron_id)?.id))return u;throw new re(`Unrecognized Spawn error in ${JSON.stringify(s)}`)};this.addHotkey=async({neuronId:t,principal:n})=>{let o=Fr({neuronId:t,principal:n});await h({request:o,service:this.certifiedService})};this.removeHotkey=async({neuronId:t,principal:n})=>{let o=Vr({neuronId:t,principal:n});await h({request:o,service:this.certifiedService})};this.claimOrRefreshNeuronFromAccount=async({memo:t,controller:n})=>{let o=hr({memo:t,controller:n}),r=await this.certifiedService.manage_neuron(o),i;if(H(i=k(r.command))&&"ClaimOrRefresh"in i)return k(i.ClaimOrRefresh.refreshed_neuron_id)?.id;throw new re(`Unrecognized ClaimOrRefresh error in ${JSON.stringify(r)}`)};this.claimOrRefreshNeuron=async t=>{let n=Or(t),o=await this.service.manage_neuron(n),r;if(H(r=k(o.command))&&"ClaimOrRefresh"in r)return k(r.ClaimOrRefresh.refreshed_neuron_id)?.id;throw new re(`Unrecognized ClaimOrRefresh error in ${JSON.stringify(o)}`)};this.buildNeuronStakeSubAccount=(t,n)=>Ks.fromBytes(this.getNeuronStakeSubAccountBytes(t,n));this.getNeuronStakeSubAccountBytes=(t,n)=>{let o=js("neuron-stake"),r=qo.create();return r.update(Hs([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??Vo,{service:o,certifiedService:r,agent:i}=Ws({options:{...t,canisterId:n},idlFactory:dr,certifiedIdlFactory:ur}),s=t.oldListNeuronsServiceOverride??Gs.createActor(_r,{agent:i,canisterId:n});return new e(n,o,r,s,i)}getGovernanceService(t){return t?this.certifiedService:this.service}};export{dr as a,dt as b,De as c,Le as d,re as e,ie as f,O as g,gr as h,ga as i,ei 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-BL4SIQCO.js.map
|