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