@dfinity/nns 0.16.2-next-2023-06-21.2 → 0.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/account_identifier.js +1 -1
- package/dist/esm/{chunk-QKP4DGGC.js → chunk-35ZY5H5F.js} +2 -2
- package/dist/esm/{chunk-FTHEQCOJ.js → chunk-NC5VQ5HX.js} +3 -3
- package/dist/esm/governance.canister.js +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +7 -7
- /package/dist/esm/{chunk-QKP4DGGC.js.map → chunk-35ZY5H5F.js.map} +0 -0
- /package/dist/esm/{chunk-FTHEQCOJ.js.map → chunk-NC5VQ5HX.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as a,c as b}from"./chunk-
|
|
1
|
+
import{b as a,c as b}from"./chunk-35ZY5H5F.js";import"./chunk-GNYECLYF.js";import"./chunk-Q3ETFEQV.js";export{a as AccountIdentifier,b as SubAccount};
|
|
2
2
|
//# sourceMappingURL=account_identifier.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as y}from"./chunk-GNYECLYF.js";import{a as v,b as w,c as _}from"./chunk-Q3ETFEQV.js";var C=v((exports,module)=>{(function(){"use strict";var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&typeof module=="object"&&module.exports,AMD=typeof define=="function"&&define.amd,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[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],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(t){return Object.prototype.toString.call(t)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(t){return typeof t=="object"&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t,r){return function(a){return new Sha256(r,!0).update(a)[t]()}},createMethod=function(t){var r=createOutputMethod("hex",t);NODE_JS&&(r=nodeWrap(r,t)),r.create=function(){return new Sha256(t)},r.update=function(s){return r.create().update(s)};for(var a=0;a<OUTPUT_TYPES.length;++a){var e=OUTPUT_TYPES[a];r[e]=createOutputMethod(e,t)}return r},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(t){if(typeof t=="string")return crypto.createHash(algorithm).update(t,"utf8").digest("hex");if(t==null)throw new Error(ERROR);return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),Array.isArray(t)||ArrayBuffer.isView(t)||t.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(t)).digest("hex"):method(t)};return nodeMethod},createHmacOutputMethod=function(t,r){return function(a,e){return new HmacSha256(a,r,!0).update(e)[t]()}},createHmacMethod=function(t){var r=createHmacOutputMethod("hex",t);r.create=function(s){return new HmacSha256(s,t)},r.update=function(s,i){return r.create(s).update(i)};for(var a=0;a<OUTPUT_TYPES.length;++a){var e=OUTPUT_TYPES[a];r[e]=createHmacOutputMethod(e,t)}return r};function Sha256(t,r){r?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}Sha256.prototype.update=function(t){if(!this.finalized){var r,a=typeof t;if(a!=="string"){if(a==="object"){if(t===null)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(t)))throw new Error(ERROR)}else throw new Error(ERROR);r=!0}for(var e,s=0,i,o=t.length,h=this.blocks;s<o;){if(this.hashed&&(this.hashed=!1,h[0]=this.block,h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0),r)for(i=this.start;s<o&&i<64;++s)h[i>>2]|=t[s]<<SHIFT[i++&3];else for(i=this.start;s<o&&i<64;++s)e=t.charCodeAt(s),e<128?h[i>>2]|=e<<SHIFT[i++&3]:e<2048?(h[i>>2]|=(192|e>>6)<<SHIFT[i++&3],h[i>>2]|=(128|e&63)<<SHIFT[i++&3]):e<55296||e>=57344?(h[i>>2]|=(224|e>>12)<<SHIFT[i++&3],h[i>>2]|=(128|e>>6&63)<<SHIFT[i++&3],h[i>>2]|=(128|e&63)<<SHIFT[i++&3]):(e=65536+((e&1023)<<10|t.charCodeAt(++s)&1023),h[i>>2]|=(240|e>>18)<<SHIFT[i++&3],h[i>>2]|=(128|e>>12&63)<<SHIFT[i++&3],h[i>>2]|=(128|e>>6&63)<<SHIFT[i++&3],h[i>>2]|=(128|e&63)<<SHIFT[i++&3]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.block=h[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,r=this.lastByteIndex;t[16]=this.block,t[r>>2]|=EXTRA[r&3],this.block=t[16],r>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var t=this.h0,r=this.h1,a=this.h2,e=this.h3,s=this.h4,i=this.h5,o=this.h6,h=this.h7,n=this.blocks,c,x,u,H,f,F,A,S,E,d,b;for(c=16;c<64;++c)f=n[c-15],x=(f>>>7|f<<25)^(f>>>18|f<<14)^f>>>3,f=n[c-2],u=(f>>>17|f<<15)^(f>>>19|f<<13)^f>>>10,n[c]=n[c-16]+x+n[c-7]+u<<0;for(b=r&a,c=0;c<64;c+=4)this.first?(this.is224?(S=300032,f=n[0]-1413257819,h=f-150054599<<0,e=f+24177077<<0):(S=704751109,f=n[0]-210244248,h=f-1521486534<<0,e=f+143694565<<0),this.first=!1):(x=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),u=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),S=t&r,H=S^t&a^b,A=s&i^~s&o,f=h+u+A+K[c]+n[c],F=x+H,h=e+f<<0,e=f+F<<0),x=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),u=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7),E=e&t,H=E^e&r^S,A=h&s^~h&i,f=o+u+A+K[c+1]+n[c+1],F=x+H,o=a+f<<0,a=f+F<<0,x=(a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10),u=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),d=a&e,H=d^a&t^E,A=o&h^~o&s,f=i+u+A+K[c+2]+n[c+2],F=x+H,i=r+f<<0,r=f+F<<0,x=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),u=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),b=r&a,H=b^r&e^d,A=i&o^~i&h,f=s+u+A+K[c+3]+n[c+3],F=x+H,s=t+f<<0,t=f+F<<0;this.h0=this.h0+t<<0,this.h1=this.h1+r<<0,this.h2=this.h2+a<<0,this.h3=this.h3+e<<0,this.h4=this.h4+s<<0,this.h5=this.h5+i<<0,this.h6=this.h6+o<<0,this.h7=this.h7+h<<0},Sha256.prototype.hex=function(){this.finalize();var t=this.h0,r=this.h1,a=this.h2,e=this.h3,s=this.h4,i=this.h5,o=this.h6,h=this.h7,n=HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[r&15]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[a&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[e&15]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[s&15]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[i&15]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[o&15];return this.is224||(n+=HEX_CHARS[h>>28&15]+HEX_CHARS[h>>24&15]+HEX_CHARS[h>>20&15]+HEX_CHARS[h>>16&15]+HEX_CHARS[h>>12&15]+HEX_CHARS[h>>8&15]+HEX_CHARS[h>>4&15]+HEX_CHARS[h&15]),n},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var t=this.h0,r=this.h1,a=this.h2,e=this.h3,s=this.h4,i=this.h5,o=this.h6,h=this.h7,n=[t>>24&255,t>>16&255,t>>8&255,t&255,r>>24&255,r>>16&255,r>>8&255,r&255,a>>24&255,a>>16&255,a>>8&255,a&255,e>>24&255,e>>16&255,e>>8&255,e&255,s>>24&255,s>>16&255,s>>8&255,s&255,i>>24&255,i>>16&255,i>>8&255,i&255,o>>24&255,o>>16&255,o>>8&255,o&255];return this.is224||n.push(h>>24&255,h>>16&255,h>>8&255,h&255),n},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),r=new DataView(t);return r.setUint32(0,this.h0),r.setUint32(4,this.h1),r.setUint32(8,this.h2),r.setUint32(12,this.h3),r.setUint32(16,this.h4),r.setUint32(20,this.h5),r.setUint32(24,this.h6),this.is224||r.setUint32(28,this.h7),t};function HmacSha256(t,r,a){var e,s=typeof t;if(s==="string"){var i=[],o=t.length,h=0,n;for(e=0;e<o;++e)n=t.charCodeAt(e),n<128?i[h++]=n:n<2048?(i[h++]=192|n>>6,i[h++]=128|n&63):n<55296||n>=57344?(i[h++]=224|n>>12,i[h++]=128|n>>6&63,i[h++]=128|n&63):(n=65536+((n&1023)<<10|t.charCodeAt(++e)&1023),i[h++]=240|n>>18,i[h++]=128|n>>12&63,i[h++]=128|n>>6&63,i[h++]=128|n&63);t=i}else if(s==="object"){if(t===null)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(t)))throw new Error(ERROR)}else throw new Error(ERROR);t.length>64&&(t=new Sha256(r,!0).update(t).array());var c=[],x=[];for(e=0;e<64;++e){var u=t[e]||0;c[e]=92^u,x[e]=54^u}Sha256.call(this,r,a),this.update(x),this.oKeyPad=c,this.inner=!0,this.sharedMemory=a}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&define(function(){return exports}))})()});var X=w(C());import{asciiStringToByteArray as O,bigEndianCrc32 as U,uint8ArrayToHexString as B}from"@dfinity/utils";var p=class{constructor(r){this.bytes=r}static fromHex(r){return new p(Uint8Array.from(Buffer.from(r,"hex")))}static fromPrincipal({principal:r,subAccount:a=R.ZERO}){let e=O(`
|
|
1
|
+
import{a as y}from"./chunk-GNYECLYF.js";import{a as v,b as w,c as _}from"./chunk-Q3ETFEQV.js";var C=v((exports,module)=>{(function(){"use strict";var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=window:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&typeof module=="object"&&module.exports,AMD=typeof define=="function"&&define.amd,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[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],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(t){return Object.prototype.toString.call(t)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(t){return typeof t=="object"&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t,r){return function(a){return new Sha256(r,!0).update(a)[t]()}},createMethod=function(t){var r=createOutputMethod("hex",t);NODE_JS&&(r=nodeWrap(r,t)),r.create=function(){return new Sha256(t)},r.update=function(s){return r.create().update(s)};for(var a=0;a<OUTPUT_TYPES.length;++a){var e=OUTPUT_TYPES[a];r[e]=createOutputMethod(e,t)}return r},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(t){if(typeof t=="string")return crypto.createHash(algorithm).update(t,"utf8").digest("hex");if(t==null)throw new Error(ERROR);return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),Array.isArray(t)||ArrayBuffer.isView(t)||t.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(t)).digest("hex"):method(t)};return nodeMethod},createHmacOutputMethod=function(t,r){return function(a,e){return new HmacSha256(a,r,!0).update(e)[t]()}},createHmacMethod=function(t){var r=createHmacOutputMethod("hex",t);r.create=function(s){return new HmacSha256(s,t)},r.update=function(s,i){return r.create(s).update(i)};for(var a=0;a<OUTPUT_TYPES.length;++a){var e=OUTPUT_TYPES[a];r[e]=createHmacOutputMethod(e,t)}return r};function Sha256(t,r){r?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}Sha256.prototype.update=function(t){if(!this.finalized){var r,a=typeof t;if(a!=="string"){if(a==="object"){if(t===null)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(t)))throw new Error(ERROR)}else throw new Error(ERROR);r=!0}for(var e,s=0,i,o=t.length,h=this.blocks;s<o;){if(this.hashed&&(this.hashed=!1,h[0]=this.block,h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0),r)for(i=this.start;s<o&&i<64;++s)h[i>>2]|=t[s]<<SHIFT[i++&3];else for(i=this.start;s<o&&i<64;++s)e=t.charCodeAt(s),e<128?h[i>>2]|=e<<SHIFT[i++&3]:e<2048?(h[i>>2]|=(192|e>>6)<<SHIFT[i++&3],h[i>>2]|=(128|e&63)<<SHIFT[i++&3]):e<55296||e>=57344?(h[i>>2]|=(224|e>>12)<<SHIFT[i++&3],h[i>>2]|=(128|e>>6&63)<<SHIFT[i++&3],h[i>>2]|=(128|e&63)<<SHIFT[i++&3]):(e=65536+((e&1023)<<10|t.charCodeAt(++s)&1023),h[i>>2]|=(240|e>>18)<<SHIFT[i++&3],h[i>>2]|=(128|e>>12&63)<<SHIFT[i++&3],h[i>>2]|=(128|e>>6&63)<<SHIFT[i++&3],h[i>>2]|=(128|e&63)<<SHIFT[i++&3]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.block=h[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,r=this.lastByteIndex;t[16]=this.block,t[r>>2]|=EXTRA[r&3],this.block=t[16],r>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var t=this.h0,r=this.h1,a=this.h2,e=this.h3,s=this.h4,i=this.h5,o=this.h6,h=this.h7,n=this.blocks,c,x,u,H,f,F,A,S,E,d,b;for(c=16;c<64;++c)f=n[c-15],x=(f>>>7|f<<25)^(f>>>18|f<<14)^f>>>3,f=n[c-2],u=(f>>>17|f<<15)^(f>>>19|f<<13)^f>>>10,n[c]=n[c-16]+x+n[c-7]+u<<0;for(b=r&a,c=0;c<64;c+=4)this.first?(this.is224?(S=300032,f=n[0]-1413257819,h=f-150054599<<0,e=f+24177077<<0):(S=704751109,f=n[0]-210244248,h=f-1521486534<<0,e=f+143694565<<0),this.first=!1):(x=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),u=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),S=t&r,H=S^t&a^b,A=s&i^~s&o,f=h+u+A+K[c]+n[c],F=x+H,h=e+f<<0,e=f+F<<0),x=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),u=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7),E=e&t,H=E^e&r^S,A=h&s^~h&i,f=o+u+A+K[c+1]+n[c+1],F=x+H,o=a+f<<0,a=f+F<<0,x=(a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10),u=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),d=a&e,H=d^a&t^E,A=o&h^~o&s,f=i+u+A+K[c+2]+n[c+2],F=x+H,i=r+f<<0,r=f+F<<0,x=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),u=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),b=r&a,H=b^r&e^d,A=i&o^~i&h,f=s+u+A+K[c+3]+n[c+3],F=x+H,s=t+f<<0,t=f+F<<0;this.h0=this.h0+t<<0,this.h1=this.h1+r<<0,this.h2=this.h2+a<<0,this.h3=this.h3+e<<0,this.h4=this.h4+s<<0,this.h5=this.h5+i<<0,this.h6=this.h6+o<<0,this.h7=this.h7+h<<0},Sha256.prototype.hex=function(){this.finalize();var t=this.h0,r=this.h1,a=this.h2,e=this.h3,s=this.h4,i=this.h5,o=this.h6,h=this.h7,n=HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[r&15]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[a&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[e&15]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[s&15]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[i&15]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[o&15];return this.is224||(n+=HEX_CHARS[h>>28&15]+HEX_CHARS[h>>24&15]+HEX_CHARS[h>>20&15]+HEX_CHARS[h>>16&15]+HEX_CHARS[h>>12&15]+HEX_CHARS[h>>8&15]+HEX_CHARS[h>>4&15]+HEX_CHARS[h&15]),n},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var t=this.h0,r=this.h1,a=this.h2,e=this.h3,s=this.h4,i=this.h5,o=this.h6,h=this.h7,n=[t>>24&255,t>>16&255,t>>8&255,t&255,r>>24&255,r>>16&255,r>>8&255,r&255,a>>24&255,a>>16&255,a>>8&255,a&255,e>>24&255,e>>16&255,e>>8&255,e&255,s>>24&255,s>>16&255,s>>8&255,s&255,i>>24&255,i>>16&255,i>>8&255,i&255,o>>24&255,o>>16&255,o>>8&255,o&255];return this.is224||n.push(h>>24&255,h>>16&255,h>>8&255,h&255),n},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),r=new DataView(t);return r.setUint32(0,this.h0),r.setUint32(4,this.h1),r.setUint32(8,this.h2),r.setUint32(12,this.h3),r.setUint32(16,this.h4),r.setUint32(20,this.h5),r.setUint32(24,this.h6),this.is224||r.setUint32(28,this.h7),t};function HmacSha256(t,r,a){var e,s=typeof t;if(s==="string"){var i=[],o=t.length,h=0,n;for(e=0;e<o;++e)n=t.charCodeAt(e),n<128?i[h++]=n:n<2048?(i[h++]=192|n>>6,i[h++]=128|n&63):n<55296||n>=57344?(i[h++]=224|n>>12,i[h++]=128|n>>6&63,i[h++]=128|n&63):(n=65536+((n&1023)<<10|t.charCodeAt(++e)&1023),i[h++]=240|n>>18,i[h++]=128|n>>12&63,i[h++]=128|n>>6&63,i[h++]=128|n&63);t=i}else if(s==="object"){if(t===null)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(t)))throw new Error(ERROR)}else throw new Error(ERROR);t.length>64&&(t=new Sha256(r,!0).update(t).array());var c=[],x=[];for(e=0;e<64;++e){var u=t[e]||0;c[e]=92^u,x[e]=54^u}Sha256.call(this,r,a),this.update(x),this.oKeyPad=c,this.inner=!0,this.sharedMemory=a}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&define(function(){return exports}))})()});var X=w(C());import{asciiStringToByteArray as O,bigEndianCrc32 as U,uint8ArrayToHexString as B}from"@dfinity/utils";var p=class{constructor(r){this.bytes=r}static fromHex(r){return new p(Uint8Array.from(Buffer.from(r,"hex")))}static fromPrincipal({principal:r,subAccount:a=R.ZERO}){let e=O(`
|
|
2
2
|
account-id`),s=X.sha224.create();s.update([...e,...r.toUint8Array(),...a.toUint8Array()]);let i=new Uint8Array(s.array()),o=U(i),h=new Uint8Array([...o,...i]);return new p(h)}async toProto(){let{AccountIdentifier:r}=await y(),a=new r;return a.setHash(this.bytes),a}toHex(){return B(this.bytes)}toUint8Array(){return this.bytes}toNumbers(){return Array.from(this.bytes)}toAccountIdentifierHash(){return{hash:this.toUint8Array()}}},l=class{constructor(r){this.bytes=r}static fromBytes(r){return r.length!=32?Error("Subaccount length must be 32-bytes"):new l(r)}static fromPrincipal(r){let a=new Uint8Array(32).fill(0),e=r.toUint8Array();a[0]=e.length;for(let s=0;s<e.length;s++)a[1+s]=e[s];return new l(a)}static fromID(r){if(r<0||r>255)throw"Subaccount ID must be >= 0 and <= 255";let a=new Uint8Array(32).fill(0);return a[31]=r,new l(a)}toUint8Array(){return this.bytes}},R=l;_(R,"ZERO",l.fromID(0));export{C as a,p as b,R as c};
|
|
3
3
|
/*! Bundled license information:
|
|
4
4
|
|
|
@@ -12,4 +12,4 @@ js-sha256/src/sha256.js:
|
|
|
12
12
|
* @license MIT
|
|
13
13
|
*)
|
|
14
14
|
*/
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-35ZY5H5F.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as Rr,b as I,c as xe}from"./chunk-QKP4DGGC.js";import{a as vr}from"./chunk-P5P36EQW.js";import{b as hr}from"./chunk-DGJWOAUC.js";import{a as O,b as Se}from"./chunk-GNYECLYF.js";import{a as Re,b as Oe}from"./chunk-Q3ETFEQV.js";var xr=Re(be=>{"use strict";be.byteLength=Xo;be.toByteArray=Qo;be.fromByteArray=Do;var M=[],k=[],$o=typeof Uint8Array<"u"?Uint8Array:Array,It="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Y=0,Or=It.length;Y<Or;++Y)M[Y]=It[Y],k[It.charCodeAt(Y)]=Y;var Y,Or;k["-".charCodeAt(0)]=62;k["_".charCodeAt(0)]=63;function Sr(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var o=r===t?0:4-r%4;return[r,o]}function Xo(e){var t=Sr(e),r=t[0],o=t[1];return(r+o)*3/4-o}function Yo(e,t,r){return(t+r)*3/4-r}function Qo(e){var t,r=Sr(e),o=r[0],n=r[1],a=new $o(Yo(e,o,n)),s=0,c=n>0?o-4:o,d;for(d=0;d<c;d+=4)t=k[e.charCodeAt(d)]<<18|k[e.charCodeAt(d+1)]<<12|k[e.charCodeAt(d+2)]<<6|k[e.charCodeAt(d+3)],a[s++]=t>>16&255,a[s++]=t>>8&255,a[s++]=t&255;return n===2&&(t=k[e.charCodeAt(d)]<<2|k[e.charCodeAt(d+1)]>>4,a[s++]=t&255),n===1&&(t=k[e.charCodeAt(d)]<<10|k[e.charCodeAt(d+1)]<<4|k[e.charCodeAt(d+2)]>>2,a[s++]=t>>8&255,a[s++]=t&255),a}function Zo(e){return M[e>>18&63]+M[e>>12&63]+M[e>>6&63]+M[e&63]}function Io(e,t,r){for(var o,n=[],a=t;a<r;a+=3)o=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),n.push(Zo(o));return n.join("")}function Do(e){for(var t,r=e.length,o=r%3,n=[],a=16383,s=0,c=r-o;s<c;s+=a)n.push(Io(e,s,s+a>c?c:s+a));return o===1?(t=e[r-1],n.push(M[t>>2]+M[t<<4&63]+"==")):o===2&&(t=(e[r-2]<<8)+e[r-1],n.push(M[t>>10]+M[t>>4&63]+M[t<<2&63]+"=")),n.join("")}});var br=Re(Dt=>{Dt.read=function(e,t,r,o,n){var a,s,c=n*8-o-1,d=(1<<c)-1,_=d>>1,m=-7,l=r?n-1:0,f=r?-1:1,w=e[t+l];for(l+=f,a=w&(1<<-m)-1,w>>=-m,m+=c;m>0;a=a*256+e[t+l],l+=f,m-=8);for(s=a&(1<<-m)-1,a>>=-m,m+=o;m>0;s=s*256+e[t+l],l+=f,m-=8);if(a===0)a=1-_;else{if(a===d)return s?NaN:(w?-1:1)*(1/0);s=s+Math.pow(2,o),a=a-_}return(w?-1:1)*s*Math.pow(2,a-o)};Dt.write=function(e,t,r,o,n,a){var s,c,d,_=a*8-n-1,m=(1<<_)-1,l=m>>1,f=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=o?0:a-1,b=o?1:-1,p=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=m):(s=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-s))<1&&(s--,d*=2),s+l>=1?t+=f/d:t+=f*Math.pow(2,1-l),t*d>=2&&(s++,d/=2),s+l>=m?(c=0,s=m):s+l>=1?(c=(t*d-1)*Math.pow(2,n),s=s+l):(c=t*Math.pow(2,l-1)*Math.pow(2,n),s=0));n>=8;e[r+w]=c&255,w+=b,c/=256,n-=8);for(s=s<<n|c,_+=n;_>0;e[r+w]=s&255,w+=b,s/=256,_-=8);e[r+w-b]|=p*128}});var sr=Re(L=>{"use strict";var Lt=xr(),D=br(),kr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;L.Buffer=i;L.SlowBuffer=nn;L.INSPECT_MAX_BYTES=50;var ke=2147483647;L.kMaxLength=ke;i.TYPED_ARRAY_SUPPORT=Lo();!i.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 Lo(){try{var 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(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}});Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}});function B(e){if(e>ke)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,i.prototype),t}function i(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return or(e)}return Cr(e,t,r)}i.poolSize=8192;function Cr(e,t,r){if(typeof e=="string")return tn(e,t);if(ArrayBuffer.isView(e))return rn(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(A(e,ArrayBuffer)||e&&A(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(A(e,SharedArrayBuffer)||e&&A(e.buffer,SharedArrayBuffer)))return tr(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var o=e.valueOf&&e.valueOf();if(o!=null&&o!==e)return i.from(o,t,r);var n=on(e);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return i.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}i.from=function(e,t,r){return Cr(e,t,r)};Object.setPrototypeOf(i.prototype,Uint8Array.prototype);Object.setPrototypeOf(i,Uint8Array);function Mr(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 en(e,t,r){return Mr(e),e<=0?B(e):t!==void 0?typeof r=="string"?B(e).fill(t,r):B(e).fill(t):B(e)}i.alloc=function(e,t,r){return en(e,t,r)};function or(e){return Mr(e),B(e<0?0:nr(e)|0)}i.allocUnsafe=function(e){return or(e)};i.allocUnsafeSlow=function(e){return or(e)};function tn(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!i.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=Ar(e,t)|0,o=B(r),n=o.write(e,t);return n!==r&&(o=o.slice(0,n)),o}function er(e){for(var t=e.length<0?0:nr(e.length)|0,r=B(t),o=0;o<t;o+=1)r[o]=e[o]&255;return r}function rn(e){if(A(e,Uint8Array)){var t=new Uint8Array(e);return tr(t.buffer,t.byteOffset,t.byteLength)}return er(e)}function tr(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var o;return t===void 0&&r===void 0?o=new Uint8Array(e):r===void 0?o=new Uint8Array(e,t):o=new Uint8Array(e,t,r),Object.setPrototypeOf(o,i.prototype),o}function on(e){if(i.isBuffer(e)){var t=nr(e.length)|0,r=B(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||ar(e.length)?B(0):er(e);if(e.type==="Buffer"&&Array.isArray(e.data))return er(e.data)}function nr(e){if(e>=ke)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ke.toString(16)+" bytes");return e|0}function nn(e){return+e!=e&&(e=0),i.alloc(+e)}i.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==i.prototype};i.compare=function(t,r){if(A(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),A(r,Uint8Array)&&(r=i.from(r,r.offset,r.byteLength)),!i.isBuffer(t)||!i.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var o=t.length,n=r.length,a=0,s=Math.min(o,n);a<s;++a)if(t[a]!==r[a]){o=t[a],n=r[a];break}return o<n?-1:n<o?1:0};i.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}};i.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return i.alloc(0);var o;if(r===void 0)for(r=0,o=0;o<t.length;++o)r+=t[o].length;var n=i.allocUnsafe(r),a=0;for(o=0;o<t.length;++o){var s=t[o];if(A(s,Uint8Array))a+s.length>n.length?i.from(s).copy(n,a):Uint8Array.prototype.set.call(n,s,a);else if(i.isBuffer(s))s.copy(n,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=s.length}return n};function Ar(e,t){if(i.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||A(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);var r=e.length,o=arguments.length>2&&arguments[2]===!0;if(!o&&r===0)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return rr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Ur(e).length;default:if(n)return o?-1:rr(e).length;t=(""+t).toLowerCase(),n=!0}}i.byteLength=Ar;function an(e,t,r){var o=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return wn(this,t,r);case"utf8":case"utf-8":return Vr(this,t,r);case"ascii":return mn(this,t,r);case"latin1":case"binary":return fn(this,t,r);case"base64":return ln(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nn(this,t,r);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}i.prototype._isBuffer=!0;function Q(e,t,r){var o=e[t];e[t]=e[r],e[r]=o}i.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)Q(this,r,r+1);return this};i.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)Q(this,r,r+3),Q(this,r+1,r+2);return this};i.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)Q(this,r,r+7),Q(this,r+1,r+6),Q(this,r+2,r+5),Q(this,r+3,r+4);return this};i.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?Vr(this,0,t):an.apply(this,arguments)};i.prototype.toLocaleString=i.prototype.toString;i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:i.compare(this,t)===0};i.prototype.inspect=function(){var t="",r=L.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};kr&&(i.prototype[kr]=i.prototype.inspect);i.prototype.compare=function(t,r,o,n,a){if(A(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),o===void 0&&(o=t?t.length:0),n===void 0&&(n=0),a===void 0&&(a=this.length),r<0||o>t.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&r>=o)return 0;if(n>=a)return-1;if(r>=o)return 1;if(r>>>=0,o>>>=0,n>>>=0,a>>>=0,this===t)return 0;for(var s=a-n,c=o-r,d=Math.min(s,c),_=this.slice(n,a),m=t.slice(r,o),l=0;l<d;++l)if(_[l]!==m[l]){s=_[l],c=m[l];break}return s<c?-1:c<s?1:0};function Er(e,t,r,o,n){if(e.length===0)return-1;if(typeof r=="string"?(o=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,ar(r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof t=="string"&&(t=i.from(t,o)),i.isBuffer(t))return t.length===0?-1:Tr(e,t,r,o,n);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Tr(e,[t],r,o,n);throw new TypeError("val must be string, number or Buffer")}function Tr(e,t,r,o,n){var a=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;a=2,s/=2,c/=2,r/=2}function d(w,b){return a===1?w[b]:w.readUInt16BE(b*a)}var _;if(n){var m=-1;for(_=r;_<s;_++)if(d(e,_)===d(t,m===-1?0:_-m)){if(m===-1&&(m=_),_-m+1===c)return m*a}else m!==-1&&(_-=_-m),m=-1}else for(r+c>s&&(r=s-c),_=r;_>=0;_--){for(var l=!0,f=0;f<c;f++)if(d(e,_+f)!==d(t,f)){l=!1;break}if(l)return _}return-1}i.prototype.includes=function(t,r,o){return this.indexOf(t,r,o)!==-1};i.prototype.indexOf=function(t,r,o){return Er(this,t,r,o,!0)};i.prototype.lastIndexOf=function(t,r,o){return Er(this,t,r,o,!1)};function sn(e,t,r,o){r=Number(r)||0;var n=e.length-r;o?(o=Number(o),o>n&&(o=n)):o=n;var a=t.length;o>a/2&&(o=a/2);for(var s=0;s<o;++s){var c=parseInt(t.substr(s*2,2),16);if(ar(c))return s;e[r+s]=c}return s}function cn(e,t,r,o){return Te(rr(t,e.length-r),e,r,o)}function un(e,t,r,o){return Te(Rn(t),e,r,o)}function dn(e,t,r,o){return Te(Ur(t),e,r,o)}function pn(e,t,r,o){return Te(vn(t,e.length-r),e,r,o)}i.prototype.write=function(t,r,o,n){if(r===void 0)n="utf8",o=this.length,r=0;else if(o===void 0&&typeof r=="string")n=r,o=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(o)?(o=o>>>0,n===void 0&&(n="utf8")):(n=o,o=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-r;if((o===void 0||o>a)&&(o=a),t.length>0&&(o<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return sn(this,t,r,o);case"utf8":case"utf-8":return cn(this,t,r,o);case"ascii":case"latin1":case"binary":return un(this,t,r,o);case"base64":return dn(this,t,r,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pn(this,t,r,o);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}};i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ln(e,t,r){return t===0&&r===e.length?Lt.fromByteArray(e):Lt.fromByteArray(e.slice(t,r))}function Vr(e,t,r){r=Math.min(e.length,r);for(var o=[],n=t;n<r;){var a=e[n],s=null,c=a>239?4:a>223?3:a>191?2:1;if(n+c<=r){var d,_,m,l;switch(c){case 1:a<128&&(s=a);break;case 2:d=e[n+1],(d&192)===128&&(l=(a&31)<<6|d&63,l>127&&(s=l));break;case 3:d=e[n+1],_=e[n+2],(d&192)===128&&(_&192)===128&&(l=(a&15)<<12|(d&63)<<6|_&63,l>2047&&(l<55296||l>57343)&&(s=l));break;case 4:d=e[n+1],_=e[n+2],m=e[n+3],(d&192)===128&&(_&192)===128&&(m&192)===128&&(l=(a&15)<<18|(d&63)<<12|(_&63)<<6|m&63,l>65535&&l<1114112&&(s=l))}}s===null?(s=65533,c=1):s>65535&&(s-=65536,o.push(s>>>10&1023|55296),s=56320|s&1023),o.push(s),n+=c}return _n(o)}var Pr=4096;function _n(e){var t=e.length;if(t<=Pr)return String.fromCharCode.apply(String,e);for(var r="",o=0;o<t;)r+=String.fromCharCode.apply(String,e.slice(o,o+=Pr));return r}function mn(e,t,r){var o="";r=Math.min(e.length,r);for(var n=t;n<r;++n)o+=String.fromCharCode(e[n]&127);return o}function fn(e,t,r){var o="";r=Math.min(e.length,r);for(var n=t;n<r;++n)o+=String.fromCharCode(e[n]);return o}function wn(e,t,r){var o=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>o)&&(r=o);for(var n="",a=t;a<r;++a)n+=hn[e[a]];return n}function Nn(e,t,r){for(var o=e.slice(t,r),n="",a=0;a<o.length-1;a+=2)n+=String.fromCharCode(o[a]+o[a+1]*256);return n}i.prototype.slice=function(t,r){var o=this.length;t=~~t,r=r===void 0?o:~~r,t<0?(t+=o,t<0&&(t=0)):t>o&&(t=o),r<0?(r+=o,r<0&&(r=0)):r>o&&(r=o),r<t&&(r=t);var n=this.subarray(t,r);return Object.setPrototypeOf(n,i.prototype),n};function g(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUintLE=i.prototype.readUIntLE=function(t,r,o){t=t>>>0,r=r>>>0,o||g(t,r,this.length);for(var n=this[t],a=1,s=0;++s<r&&(a*=256);)n+=this[t+s]*a;return n};i.prototype.readUintBE=i.prototype.readUIntBE=function(t,r,o){t=t>>>0,r=r>>>0,o||g(t,r,this.length);for(var n=this[t+--r],a=1;r>0&&(a*=256);)n+=this[t+--r]*a;return n};i.prototype.readUint8=i.prototype.readUInt8=function(t,r){return t=t>>>0,r||g(t,1,this.length),this[t]};i.prototype.readUint16LE=i.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||g(t,2,this.length),this[t]|this[t+1]<<8};i.prototype.readUint16BE=i.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||g(t,2,this.length),this[t]<<8|this[t+1]};i.prototype.readUint32LE=i.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||g(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};i.prototype.readUint32BE=i.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||g(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};i.prototype.readIntLE=function(t,r,o){t=t>>>0,r=r>>>0,o||g(t,r,this.length);for(var n=this[t],a=1,s=0;++s<r&&(a*=256);)n+=this[t+s]*a;return a*=128,n>=a&&(n-=Math.pow(2,8*r)),n};i.prototype.readIntBE=function(t,r,o){t=t>>>0,r=r>>>0,o||g(t,r,this.length);for(var n=r,a=1,s=this[t+--n];n>0&&(a*=256);)s+=this[t+--n]*a;return a*=128,s>=a&&(s-=Math.pow(2,8*r)),s};i.prototype.readInt8=function(t,r){return t=t>>>0,r||g(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};i.prototype.readInt16LE=function(t,r){t=t>>>0,r||g(t,2,this.length);var o=this[t]|this[t+1]<<8;return o&32768?o|4294901760:o};i.prototype.readInt16BE=function(t,r){t=t>>>0,r||g(t,2,this.length);var o=this[t+1]|this[t]<<8;return o&32768?o|4294901760:o};i.prototype.readInt32LE=function(t,r){return t=t>>>0,r||g(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};i.prototype.readInt32BE=function(t,r){return t=t>>>0,r||g(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};i.prototype.readFloatLE=function(t,r){return t=t>>>0,r||g(t,4,this.length),D.read(this,t,!0,23,4)};i.prototype.readFloatBE=function(t,r){return t=t>>>0,r||g(t,4,this.length),D.read(this,t,!1,23,4)};i.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||g(t,8,this.length),D.read(this,t,!0,52,8)};i.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||g(t,8,this.length),D.read(this,t,!1,52,8)};function S(e,t,r,o,n,a){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<a)throw new RangeError('"value" argument is out of bounds');if(r+o>e.length)throw new RangeError("Index out of range")}i.prototype.writeUintLE=i.prototype.writeUIntLE=function(t,r,o,n){if(t=+t,r=r>>>0,o=o>>>0,!n){var a=Math.pow(2,8*o)-1;S(this,t,r,o,a,0)}var s=1,c=0;for(this[r]=t&255;++c<o&&(s*=256);)this[r+c]=t/s&255;return r+o};i.prototype.writeUintBE=i.prototype.writeUIntBE=function(t,r,o,n){if(t=+t,r=r>>>0,o=o>>>0,!n){var a=Math.pow(2,8*o)-1;S(this,t,r,o,a,0)}var s=o-1,c=1;for(this[r+s]=t&255;--s>=0&&(c*=256);)this[r+s]=t/c&255;return r+o};i.prototype.writeUint8=i.prototype.writeUInt8=function(t,r,o){return t=+t,r=r>>>0,o||S(this,t,r,1,255,0),this[r]=t&255,r+1};i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(t,r,o){return t=+t,r=r>>>0,o||S(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(t,r,o){return t=+t,r=r>>>0,o||S(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(t,r,o){return t=+t,r=r>>>0,o||S(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(t,r,o){return t=+t,r=r>>>0,o||S(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};i.prototype.writeIntLE=function(t,r,o,n){if(t=+t,r=r>>>0,!n){var a=Math.pow(2,8*o-1);S(this,t,r,o,a-1,-a)}var s=0,c=1,d=0;for(this[r]=t&255;++s<o&&(c*=256);)t<0&&d===0&&this[r+s-1]!==0&&(d=1),this[r+s]=(t/c>>0)-d&255;return r+o};i.prototype.writeIntBE=function(t,r,o,n){if(t=+t,r=r>>>0,!n){var a=Math.pow(2,8*o-1);S(this,t,r,o,a-1,-a)}var s=o-1,c=1,d=0;for(this[r+s]=t&255;--s>=0&&(c*=256);)t<0&&d===0&&this[r+s+1]!==0&&(d=1),this[r+s]=(t/c>>0)-d&255;return r+o};i.prototype.writeInt8=function(t,r,o){return t=+t,r=r>>>0,o||S(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};i.prototype.writeInt16LE=function(t,r,o){return t=+t,r=r>>>0,o||S(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};i.prototype.writeInt16BE=function(t,r,o){return t=+t,r=r>>>0,o||S(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};i.prototype.writeInt32LE=function(t,r,o){return t=+t,r=r>>>0,o||S(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};i.prototype.writeInt32BE=function(t,r,o){return t=+t,r=r>>>0,o||S(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function Fr(e,t,r,o,n,a){if(r+o>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Br(e,t,r,o,n){return t=+t,r=r>>>0,n||Fr(e,t,r,4,34028234663852886e22,-34028234663852886e22),D.write(e,t,r,o,23,4),r+4}i.prototype.writeFloatLE=function(t,r,o){return Br(this,t,r,!0,o)};i.prototype.writeFloatBE=function(t,r,o){return Br(this,t,r,!1,o)};function qr(e,t,r,o,n){return t=+t,r=r>>>0,n||Fr(e,t,r,8,17976931348623157e292,-17976931348623157e292),D.write(e,t,r,o,52,8),r+8}i.prototype.writeDoubleLE=function(t,r,o){return qr(this,t,r,!0,o)};i.prototype.writeDoubleBE=function(t,r,o){return qr(this,t,r,!1,o)};i.prototype.copy=function(t,r,o,n){if(!i.isBuffer(t))throw new TypeError("argument should be a Buffer");if(o||(o=0),!n&&n!==0&&(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<o&&(n=o),n===o||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(o<0||o>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-o&&(n=t.length-r+o);var a=n-o;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,o,n):Uint8Array.prototype.set.call(t,this.subarray(o,n),r),a};i.prototype.fill=function(t,r,o,n){if(typeof t=="string"){if(typeof r=="string"?(n=r,r=0,o=this.length):typeof o=="string"&&(n=o,o=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(t.length===1){var a=t.charCodeAt(0);(n==="utf8"&&a<128||n==="latin1")&&(t=a)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<o)throw new RangeError("Out of range index");if(o<=r)return this;r=r>>>0,o=o===void 0?this.length:o>>>0,t||(t=0);var s;if(typeof t=="number")for(s=r;s<o;++s)this[s]=t;else{var c=i.isBuffer(t)?t:i.from(t,n),d=c.length;if(d===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<o-r;++s)this[s+r]=c[s%d]}return this};var yn=/[^+/0-9A-Za-z-_]/g;function gn(e){if(e=e.split("=")[0],e=e.trim().replace(yn,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function rr(e,t){t=t||1/0;for(var r,o=e.length,n=null,a=[],s=0;s<o;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(s+1===o){(t-=3)>-1&&a.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(t-=3)>-1&&a.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}function Rn(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function vn(e,t){for(var r,o,n,a=[],s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),o=r>>8,n=r%256,a.push(n),a.push(o);return a}function Ur(e){return Lt.toByteArray(gn(e))}function Te(e,t,r,o){for(var n=0;n<o&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function ar(e){return e!==e}var hn=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var o=r*16,n=0;n<16;++n)t[o+n]=e[r]+e[n];return t}()});var Wr=Re((ir,Hr)=>{var Pe=sr(),q=Pe.Buffer;function Kr(e,t){for(var r in e)t[r]=e[r]}q.from&&q.alloc&&q.allocUnsafe&&q.allocUnsafeSlow?Hr.exports=Pe:(Kr(Pe,ir),ir.Buffer=ee);function ee(e,t,r){return q(e,t,r)}Kr(q,ee);ee.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return q(e,t,r)};ee.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var o=q(e);return t!==void 0?typeof r=="string"?o.fill(t,r):o.fill(t):o.fill(0),o};ee.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return q(e)};ee.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Pe.SlowBuffer(e)}});var Gr=Re((ma,ur)=>{"use strict";var cr=65536,On=4294967295;function Sn(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
2
|
-
Use Chrome, Firefox or Internet Explorer 11`)}var xn=Wr().Buffer,Ce=global.crypto||global.msCrypto;Ce&&Ce.getRandomValues?ur.exports=bn:ur.exports=Sn;function bn(e,t){if(e>On)throw new RangeError("requested too many random bytes");var r=xn.allocUnsafe(e);if(e>0)if(e>cr)for(var o=0;o<e;o+=cr)Ce.getRandomValues(r.slice(o,o+cr));else Ce.getRandomValues(r);return typeof t=="function"?process.nextTick(function(){t(null,r)}):r}});var jo=Oe(Rr()),zo=Oe(Gr());import{asciiStringToByteArray as ca,assertPercentageNumber as gr,createServices as ua,fromNullable as x,isNullish as Go,nonNullish as C,uint8ArrayToBigInt as da}from"@dfinity/utils";var jr=({IDL:e})=>{let t=e.Rec(),r=e.Record({id:e.Nat64}),o=e.Record({followees:e.Vec(r)}),n=e.Record({hash:e.Vec(e.Nat8)}),a=e.Record({id:e.Opt(e.Principal),reward_account:e.Opt(n)}),s=e.Record({dissolve_delay_seconds:e.Nat64}),c=e.Record({to_account:e.Opt(n)}),d=e.Variant({RewardToNeuron:s,RewardToAccount:c}),_=e.Record({node_provider:e.Opt(a),reward_mode:e.Opt(d),amount_e8s:e.Nat64}),m=e.Record({timestamp:e.Nat64,rewards:e.Vec(_)}),l=e.Record({not_dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),garbage_collectable_neurons_count:e.Nat64,neurons_with_invalid_stake_count:e.Nat64,not_dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,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:e.Nat64,not_dissolving_neurons_count:e.Nat64,total_locked_e8s:e.Nat64,dissolved_neurons_e8s:e.Nat64,neurons_with_less_than_6_months_dissolve_delay_e8s:e.Nat64,dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),dissolving_neurons_count:e.Nat64,dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),community_fund_total_staked_e8s:e.Nat64,timestamp_seconds:e.Nat64}),f=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}),w=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(r)}),b=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}),p=e.Record({error_message:e.Text,error_type:e.Int32}),Ue=e.Record({nns_neuron_id:e.Nat64,amount_icp_e8s:e.Nat64}),Ke=e.Record({hotkey_principal:e.Text,cf_neurons:e.Vec(Ue)}),re=e.Record({vote:e.Int32,voting_power:e.Nat64}),He=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)}),h=e.Record({status:e.Opt(He),canister_id:e.Opt(e.Principal)}),We=e.Record({ledger_index_canister_summary:e.Opt(h),fallback_controller_principal_ids:e.Vec(e.Principal),ledger_archive_canister_summaries:e.Vec(h),ledger_canister_summary:e.Opt(h),swap_canister_summary:e.Opt(h),governance_canister_summary:e.Opt(h),root_canister_summary:e.Opt(h),dapp_canister_summaries:e.Vec(h)}),oe=e.Record({swap_background_information:e.Opt(We)}),ne=e.Record({no:e.Nat64,yes:e.Nat64,total:e.Nat64,timestamp_seconds:e.Nat64}),j=e.Record({name:e.Text,description:e.Opt(e.Text)}),ae=e.Record({id:e.Opt(r),known_neuron_data:e.Opt(j)}),Ge=e.Record({percentage_to_spawn:e.Opt(e.Nat32),new_controller:e.Opt(e.Principal),nonce:e.Opt(e.Nat64)}),se=e.Record({amount_e8s:e.Nat64}),je=e.Record({topic:e.Int32,followees:e.Vec(r)}),ie=e.Record({controller:e.Opt(e.Principal),memo:e.Nat64}),ze=e.Variant({NeuronIdOrSubaccount:e.Record({}),MemoAndController:ie,Memo:e.Nat64}),ce=e.Record({by:e.Opt(ze)}),Je=e.Record({hot_key_to_remove:e.Opt(e.Principal)}),$e=e.Record({new_hot_key:e.Opt(e.Principal)}),Xe=e.Record({requested_setting_for_auto_stake_maturity:e.Bool}),Ye=e.Record({additional_dissolve_delay_seconds:e.Nat32}),Qe=e.Record({dissolve_timestamp_seconds:e.Nat64}),Ze=e.Variant({RemoveHotKey:Je,AddHotKey:$e,ChangeAutoStakeMaturity:Xe,StopDissolving:e.Record({}),StartDissolving:e.Record({}),IncreaseDissolveDelay:Ye,JoinCommunityFund:e.Record({}),LeaveCommunityFund:e.Record({}),SetDissolveTimestamp:Qe}),ue=e.Record({operation:e.Opt(Ze)}),Ie=e.Record({vote:e.Int32,proposal:e.Opt(r)}),u=e.Record({source_neuron_id:e.Opt(r)}),de=e.Record({dissolve_delay_seconds:e.Nat64,kyc_verified:e.Bool,amount_e8s:e.Nat64,new_controller:e.Opt(e.Principal),nonce:e.Nat64}),De=e.Record({percentage_to_stake:e.Opt(e.Nat32)}),pe=e.Record({percentage_to_merge:e.Nat32}),Le=e.Record({e8s:e.Nat64}),le=e.Record({to_account:e.Opt(n),amount:e.Opt(Le)}),et=e.Variant({Spawn:Ge,Split:se,Follow:je,ClaimOrRefresh:ce,Configure:ue,RegisterVote:Ie,Merge:u,DisburseToNeuron:de,MakeProposal:t,StakeMaturity:De,MergeMaturity:pe,Disburse:le}),z=e.Variant({Subaccount:e.Vec(e.Nat8),NeuronId:r}),J=e.Record({id:e.Opt(r),command:e.Opt(et),neuron_id_or_subaccount:e.Opt(z)}),E=e.Record({basis_points:e.Opt(e.Nat64)}),N=e.Record({seconds:e.Opt(e.Nat64)}),y=e.Record({e8s:e.Opt(e.Nat64)}),tt=e.Record({reward_rate_transition_duration:e.Opt(N),initial_reward_rate:e.Opt(E),final_reward_rate:e.Opt(E)}),rt=e.Record({neuron_maximum_dissolve_delay_bonus:e.Opt(E),neuron_maximum_age_for_age_bonus:e.Opt(N),neuron_maximum_dissolve_delay:e.Opt(N),neuron_minimum_dissolve_delay_to_vote:e.Opt(N),neuron_maximum_age_bonus:e.Opt(E),neuron_minimum_stake:e.Opt(y),proposal_wait_for_quiet_deadline_increase:e.Opt(N),proposal_initial_voting_period:e.Opt(N),proposal_rejection_fee:e.Opt(y),voting_reward_parameters:e.Opt(tt)}),_e=e.Record({base64_encoding:e.Opt(e.Text)}),ot=e.Record({transaction_fee:e.Opt(y),token_symbol:e.Opt(e.Text),token_logo:e.Opt(_e),token_name:e.Opt(e.Text)}),nt=e.Record({id:e.Opt(e.Principal)}),at=e.Record({dissolve_delay_interval:e.Opt(N),count:e.Opt(e.Nat64)}),st=e.Record({minimum_participants:e.Opt(e.Nat64),neuron_basket_construction_parameters:e.Opt(at),maximum_participant_icp:e.Opt(y),minimum_icp:e.Opt(y),minimum_participant_icp:e.Opt(y),maximum_icp:e.Opt(y)}),me=e.Record({total:e.Opt(y)}),it=e.Record({controller:e.Opt(e.Principal),dissolve_delay:e.Opt(N),memo:e.Opt(e.Nat64),vesting_period:e.Opt(N),stake:e.Opt(y)}),ct=e.Record({developer_neurons:e.Vec(it)}),ut=e.Record({treasury_distribution:e.Opt(me),developer_distribution:e.Opt(ct),swap_distribution:e.Opt(me)}),dt=e.Record({url:e.Opt(e.Text),governance_parameters:e.Opt(rt),fallback_controller_principal_ids:e.Vec(e.Principal),logo:e.Opt(_e),name:e.Opt(e.Text),ledger_parameters:e.Opt(ot),description:e.Opt(e.Text),dapp_canisters:e.Vec(nt),swap_parameters:e.Opt(st),initial_token_distribution:e.Opt(ut)}),pt=e.Record({nns_function:e.Int32,payload:e.Vec(e.Nat8)}),lt=e.Record({dissolve_delay_interval_seconds:e.Nat64,count:e.Nat64}),_t=e.Record({min_participant_icp_e8s:e.Nat64,neuron_basket_construction_parameters:e.Opt(lt),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_icp_e8s:e.Nat64}),mt=e.Record({community_fund_investment_e8s:e.Opt(e.Nat64),target_swap_canister_id:e.Opt(e.Principal),params:e.Opt(_t)}),ft=e.Record({start_timestamp_seconds:e.Nat64,end_timestamp_seconds:e.Nat64}),wt=e.Record({open_time_window:e.Opt(ft)}),Nt=e.Record({request:e.Opt(wt),swap_canister_id:e.Opt(e.Principal)}),yt=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,o))}),fe=e.Record({use_registry_derived_rewards:e.Opt(e.Bool),rewards:e.Vec(_)}),gt=e.Record({principals:e.Vec(e.Principal)}),Rt=e.Variant({ToRemove:a,ToAdd:a}),vt=e.Record({change:e.Opt(Rt)}),ht=e.Record({motion_text:e.Text}),Ot=e.Variant({RegisterKnownNeuron:ae,ManageNeuron:J,CreateServiceNervousSystem:dt,ExecuteNnsFunction:pt,RewardNodeProvider:_,OpenSnsTokenSwap:mt,SetSnsTokenSwapOpenTimeWindow:Nt,SetDefaultFollowees:yt,RewardNodeProviders:fe,ManageNetworkEconomics:f,ApproveGenesisKyc:gt,AddOrRemoveNodeProvider:vt,Motion:ht});t.fill(e.Record({url:e.Text,title:e.Opt(e.Text),action:e.Opt(Ot),summary:e.Text}));let St=e.Record({current_deadline_timestamp_seconds:e.Nat64}),xt=e.Record({id:e.Opt(r),failure_reason:e.Opt(p),cf_participants:e.Vec(Ke),ballots:e.Vec(e.Tuple(e.Nat64,re)),proposal_timestamp_seconds:e.Nat64,reward_event_round:e.Nat64,failed_timestamp_seconds:e.Nat64,reject_cost_e8s:e.Nat64,derived_proposal_information:e.Opt(oe),latest_tally:e.Opt(ne),sns_token_swap_lifecycle:e.Opt(e.Int32),decided_timestamp_seconds:e.Nat64,proposal:e.Opt(t),proposer:e.Opt(r),wait_for_quiet_state:e.Opt(St),executed_timestamp_seconds:e.Nat64,original_total_community_fund_maturity_e8s_equivalent:e.Opt(e.Nat64)}),bt=e.Variant({Spawn:r,Split:se,Configure:ue,Merge:u,DisburseToNeuron:de,SyncCommand:e.Record({}),ClaimOrRefreshNeuron:ce,MergeMaturity:pe,Disburse:le}),kt=e.Record({command:e.Opt(bt),timestamp:e.Nat64}),we=e.Record({vote:e.Int32,proposal_id:e.Opt(r)}),Tt=e.Variant({DissolveDelaySeconds:e.Nat64,WhenDissolvedTimestampSeconds:e.Nat64}),T=e.Record({id:e.Opt(r),staked_maturity_e8s_equivalent:e.Opt(e.Nat64),controller:e.Opt(e.Principal),recent_ballots:e.Vec(we),kyc_verified:e.Bool,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(Tt),followees:e.Vec(e.Tuple(e.Int32,o)),neuron_fees_e8s:e.Nat64,transfer:e.Opt(b),known_neuron_data:e.Opt(j),spawn_at_timestamp_seconds:e.Opt(e.Nat64)}),Jo=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,o)),most_recent_monthly_node_provider_rewards:e.Opt(m),maturity_modulation_last_updated_at_timestamp_seconds:e.Opt(e.Nat64),wait_for_quiet_threshold_seconds:e.Nat64,metrics:e.Opt(l),node_providers:e.Vec(a),cached_daily_maturity_modulation_basis_points:e.Opt(e.Int32),economics:e.Opt(f),spawning_neurons:e.Opt(e.Bool),latest_reward_event:e.Opt(w),to_claim_transfers:e.Vec(b),short_voting_period_seconds:e.Nat64,proposals:e.Vec(e.Tuple(e.Nat64,xt)),in_flight_commands:e.Vec(e.Tuple(e.Nat64,kt)),neurons:e.Vec(e.Tuple(e.Nat64,T)),genesis_timestamp_seconds:e.Nat64}),V=e.Variant({Ok:e.Null,Err:p}),Pt=e.Variant({Error:p,NeuronId:r}),Ct=e.Record({result:e.Opt(Pt)}),Ne=e.Variant({Ok:T,Err:p}),Mt=e.Variant({Ok:l,Err:p}),At=e.Variant({Ok:fe,Err:p}),F=e.Record({dissolve_delay_seconds:e.Nat64,recent_ballots:e.Vec(we),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(j),voting_power:e.Nat64,age_seconds:e.Nat64}),ye=e.Variant({Ok:F,Err:p}),Et=e.Variant({Ok:a,Err:p}),$=e.Record({id:e.Opt(r),status:e.Int32,topic:e.Int32,failure_reason:e.Opt(p),ballots:e.Vec(e.Tuple(e.Nat64,re)),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(oe),latest_tally:e.Opt(ne),reward_status:e.Int32,decided_timestamp_seconds:e.Nat64,proposal:e.Opt(t),proposer:e.Opt(r),executed_timestamp_seconds:e.Nat64}),Vt=e.Record({known_neurons:e.Vec(ae)}),Ft=e.Record({neuron_ids:e.Vec(e.Nat64),include_neurons_readable_by_caller:e.Bool}),Bt=e.Record({neuron_infos:e.Vec(e.Tuple(e.Nat64,F)),full_neurons:e.Vec(T)}),qt=e.Record({node_providers:e.Vec(a)}),Ut=e.Record({include_reward_status:e.Vec(e.Int32),before_proposal:e.Opt(r),limit:e.Nat32,exclude_topic:e.Vec(e.Int32),include_status:e.Vec(e.Int32)}),Kt=e.Record({proposal_info:e.Vec($)}),X=e.Record({created_neuron_id:e.Opt(r)}),Ht=e.Record({refreshed_neuron_id:e.Opt(r)}),Wt=e.Record({target_neuron:e.Opt(T),source_neuron:e.Opt(T),target_neuron_info:e.Opt(F),source_neuron_info:e.Opt(F)}),Gt=e.Record({proposal_id:e.Opt(r)}),jt=e.Record({maturity_e8s:e.Nat64,staked_maturity_e8s:e.Nat64}),zt=e.Record({merged_maturity_e8s:e.Nat64,new_stake_e8s:e.Nat64}),Jt=e.Record({transfer_block_height:e.Nat64}),$t=e.Variant({Error:p,Spawn:X,Split:X,Follow:e.Record({}),ClaimOrRefresh:Ht,Configure:e.Record({}),RegisterVote:e.Record({}),Merge:Wt,DisburseToNeuron:X,MakeProposal:Gt,StakeMaturity:jt,MergeMaturity:zt,Disburse:Jt}),ge=e.Record({command:e.Opt($t)}),Xt=e.Record({sns_governance_canister_id:e.Opt(e.Principal)}),Yt=e.Variant({Committed:Xt,Aborted:e.Record({})}),Qt=e.Record({result:e.Opt(Yt),open_sns_token_swap_proposal_id:e.Opt(e.Nat64)}),Zt=e.Record({reward_account:e.Opt(n)});return e.Service({claim_gtc_neurons:e.Func([e.Principal,e.Vec(r)],[V],[]),claim_or_refresh_neuron_from_account:e.Func([ie],[Ct],[]),get_build_metadata:e.Func([],[e.Text],[]),get_full_neuron:e.Func([e.Nat64],[Ne],[]),get_full_neuron_by_id_or_subaccount:e.Func([z],[Ne],[]),get_latest_reward_event:e.Func([],[w],[]),get_metrics:e.Func([],[Mt],[]),get_monthly_node_provider_rewards:e.Func([],[At],[]),get_most_recent_monthly_node_provider_rewards:e.Func([],[e.Opt(m)],[]),get_network_economics_parameters:e.Func([],[f],[]),get_neuron_ids:e.Func([],[e.Vec(e.Nat64)],[]),get_neuron_info:e.Func([e.Nat64],[ye],[]),get_neuron_info_by_id_or_subaccount:e.Func([z],[ye],[]),get_node_provider_by_caller:e.Func([e.Null],[Et],[]),get_pending_proposals:e.Func([],[e.Vec($)],[]),get_proposal_info:e.Func([e.Nat64],[e.Opt($)],[]),list_known_neurons:e.Func([],[Vt],[]),list_neurons:e.Func([Ft],[Bt],[]),list_node_providers:e.Func([],[qt],[]),list_proposals:e.Func([Ut],[Kt],[]),manage_neuron:e.Func([J],[ge],[]),settle_community_fund_participation:e.Func([Qt],[V],[]),simulate_manage_neuron:e.Func([J],[ge],[]),transfer_gtc_neuron:e.Func([r,r],[V],[]),update_node_provider:e.Func([Zt],[V],[])})};var zr=({IDL:e})=>{let t=e.Rec(),r=e.Record({id:e.Nat64}),o=e.Record({followees:e.Vec(r)}),n=e.Record({hash:e.Vec(e.Nat8)}),a=e.Record({id:e.Opt(e.Principal),reward_account:e.Opt(n)}),s=e.Record({dissolve_delay_seconds:e.Nat64}),c=e.Record({to_account:e.Opt(n)}),d=e.Variant({RewardToNeuron:s,RewardToAccount:c}),_=e.Record({node_provider:e.Opt(a),reward_mode:e.Opt(d),amount_e8s:e.Nat64}),m=e.Record({timestamp:e.Nat64,rewards:e.Vec(_)}),l=e.Record({not_dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),garbage_collectable_neurons_count:e.Nat64,neurons_with_invalid_stake_count:e.Nat64,not_dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,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:e.Nat64,not_dissolving_neurons_count:e.Nat64,total_locked_e8s:e.Nat64,dissolved_neurons_e8s:e.Nat64,neurons_with_less_than_6_months_dissolve_delay_e8s:e.Nat64,dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),dissolving_neurons_count:e.Nat64,dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),community_fund_total_staked_e8s:e.Nat64,timestamp_seconds:e.Nat64}),f=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}),w=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(r)}),b=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}),p=e.Record({error_message:e.Text,error_type:e.Int32}),Ue=e.Record({nns_neuron_id:e.Nat64,amount_icp_e8s:e.Nat64}),Ke=e.Record({hotkey_principal:e.Text,cf_neurons:e.Vec(Ue)}),re=e.Record({vote:e.Int32,voting_power:e.Nat64}),He=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)}),h=e.Record({status:e.Opt(He),canister_id:e.Opt(e.Principal)}),We=e.Record({ledger_index_canister_summary:e.Opt(h),fallback_controller_principal_ids:e.Vec(e.Principal),ledger_archive_canister_summaries:e.Vec(h),ledger_canister_summary:e.Opt(h),swap_canister_summary:e.Opt(h),governance_canister_summary:e.Opt(h),root_canister_summary:e.Opt(h),dapp_canister_summaries:e.Vec(h)}),oe=e.Record({swap_background_information:e.Opt(We)}),ne=e.Record({no:e.Nat64,yes:e.Nat64,total:e.Nat64,timestamp_seconds:e.Nat64}),j=e.Record({name:e.Text,description:e.Opt(e.Text)}),ae=e.Record({id:e.Opt(r),known_neuron_data:e.Opt(j)}),Ge=e.Record({percentage_to_spawn:e.Opt(e.Nat32),new_controller:e.Opt(e.Principal),nonce:e.Opt(e.Nat64)}),se=e.Record({amount_e8s:e.Nat64}),je=e.Record({topic:e.Int32,followees:e.Vec(r)}),ie=e.Record({controller:e.Opt(e.Principal),memo:e.Nat64}),ze=e.Variant({NeuronIdOrSubaccount:e.Record({}),MemoAndController:ie,Memo:e.Nat64}),ce=e.Record({by:e.Opt(ze)}),Je=e.Record({hot_key_to_remove:e.Opt(e.Principal)}),$e=e.Record({new_hot_key:e.Opt(e.Principal)}),Xe=e.Record({requested_setting_for_auto_stake_maturity:e.Bool}),Ye=e.Record({additional_dissolve_delay_seconds:e.Nat32}),Qe=e.Record({dissolve_timestamp_seconds:e.Nat64}),Ze=e.Variant({RemoveHotKey:Je,AddHotKey:$e,ChangeAutoStakeMaturity:Xe,StopDissolving:e.Record({}),StartDissolving:e.Record({}),IncreaseDissolveDelay:Ye,JoinCommunityFund:e.Record({}),LeaveCommunityFund:e.Record({}),SetDissolveTimestamp:Qe}),ue=e.Record({operation:e.Opt(Ze)}),Ie=e.Record({vote:e.Int32,proposal:e.Opt(r)}),u=e.Record({source_neuron_id:e.Opt(r)}),de=e.Record({dissolve_delay_seconds:e.Nat64,kyc_verified:e.Bool,amount_e8s:e.Nat64,new_controller:e.Opt(e.Principal),nonce:e.Nat64}),De=e.Record({percentage_to_stake:e.Opt(e.Nat32)}),pe=e.Record({percentage_to_merge:e.Nat32}),Le=e.Record({e8s:e.Nat64}),le=e.Record({to_account:e.Opt(n),amount:e.Opt(Le)}),et=e.Variant({Spawn:Ge,Split:se,Follow:je,ClaimOrRefresh:ce,Configure:ue,RegisterVote:Ie,Merge:u,DisburseToNeuron:de,MakeProposal:t,StakeMaturity:De,MergeMaturity:pe,Disburse:le}),z=e.Variant({Subaccount:e.Vec(e.Nat8),NeuronId:r}),J=e.Record({id:e.Opt(r),command:e.Opt(et),neuron_id_or_subaccount:e.Opt(z)}),E=e.Record({basis_points:e.Opt(e.Nat64)}),N=e.Record({seconds:e.Opt(e.Nat64)}),y=e.Record({e8s:e.Opt(e.Nat64)}),tt=e.Record({reward_rate_transition_duration:e.Opt(N),initial_reward_rate:e.Opt(E),final_reward_rate:e.Opt(E)}),rt=e.Record({neuron_maximum_dissolve_delay_bonus:e.Opt(E),neuron_maximum_age_for_age_bonus:e.Opt(N),neuron_maximum_dissolve_delay:e.Opt(N),neuron_minimum_dissolve_delay_to_vote:e.Opt(N),neuron_maximum_age_bonus:e.Opt(E),neuron_minimum_stake:e.Opt(y),proposal_wait_for_quiet_deadline_increase:e.Opt(N),proposal_initial_voting_period:e.Opt(N),proposal_rejection_fee:e.Opt(y),voting_reward_parameters:e.Opt(tt)}),_e=e.Record({base64_encoding:e.Opt(e.Text)}),ot=e.Record({transaction_fee:e.Opt(y),token_symbol:e.Opt(e.Text),token_logo:e.Opt(_e),token_name:e.Opt(e.Text)}),nt=e.Record({id:e.Opt(e.Principal)}),at=e.Record({dissolve_delay_interval:e.Opt(N),count:e.Opt(e.Nat64)}),st=e.Record({minimum_participants:e.Opt(e.Nat64),neuron_basket_construction_parameters:e.Opt(at),maximum_participant_icp:e.Opt(y),minimum_icp:e.Opt(y),minimum_participant_icp:e.Opt(y),maximum_icp:e.Opt(y)}),me=e.Record({total:e.Opt(y)}),it=e.Record({controller:e.Opt(e.Principal),dissolve_delay:e.Opt(N),memo:e.Opt(e.Nat64),vesting_period:e.Opt(N),stake:e.Opt(y)}),ct=e.Record({developer_neurons:e.Vec(it)}),ut=e.Record({treasury_distribution:e.Opt(me),developer_distribution:e.Opt(ct),swap_distribution:e.Opt(me)}),dt=e.Record({url:e.Opt(e.Text),governance_parameters:e.Opt(rt),fallback_controller_principal_ids:e.Vec(e.Principal),logo:e.Opt(_e),name:e.Opt(e.Text),ledger_parameters:e.Opt(ot),description:e.Opt(e.Text),dapp_canisters:e.Vec(nt),swap_parameters:e.Opt(st),initial_token_distribution:e.Opt(ut)}),pt=e.Record({nns_function:e.Int32,payload:e.Vec(e.Nat8)}),lt=e.Record({dissolve_delay_interval_seconds:e.Nat64,count:e.Nat64}),_t=e.Record({min_participant_icp_e8s:e.Nat64,neuron_basket_construction_parameters:e.Opt(lt),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_icp_e8s:e.Nat64}),mt=e.Record({community_fund_investment_e8s:e.Opt(e.Nat64),target_swap_canister_id:e.Opt(e.Principal),params:e.Opt(_t)}),ft=e.Record({start_timestamp_seconds:e.Nat64,end_timestamp_seconds:e.Nat64}),wt=e.Record({open_time_window:e.Opt(ft)}),Nt=e.Record({request:e.Opt(wt),swap_canister_id:e.Opt(e.Principal)}),yt=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,o))}),fe=e.Record({use_registry_derived_rewards:e.Opt(e.Bool),rewards:e.Vec(_)}),gt=e.Record({principals:e.Vec(e.Principal)}),Rt=e.Variant({ToRemove:a,ToAdd:a}),vt=e.Record({change:e.Opt(Rt)}),ht=e.Record({motion_text:e.Text}),Ot=e.Variant({RegisterKnownNeuron:ae,ManageNeuron:J,CreateServiceNervousSystem:dt,ExecuteNnsFunction:pt,RewardNodeProvider:_,OpenSnsTokenSwap:mt,SetSnsTokenSwapOpenTimeWindow:Nt,SetDefaultFollowees:yt,RewardNodeProviders:fe,ManageNetworkEconomics:f,ApproveGenesisKyc:gt,AddOrRemoveNodeProvider:vt,Motion:ht});t.fill(e.Record({url:e.Text,title:e.Opt(e.Text),action:e.Opt(Ot),summary:e.Text}));let St=e.Record({current_deadline_timestamp_seconds:e.Nat64}),xt=e.Record({id:e.Opt(r),failure_reason:e.Opt(p),cf_participants:e.Vec(Ke),ballots:e.Vec(e.Tuple(e.Nat64,re)),proposal_timestamp_seconds:e.Nat64,reward_event_round:e.Nat64,failed_timestamp_seconds:e.Nat64,reject_cost_e8s:e.Nat64,derived_proposal_information:e.Opt(oe),latest_tally:e.Opt(ne),sns_token_swap_lifecycle:e.Opt(e.Int32),decided_timestamp_seconds:e.Nat64,proposal:e.Opt(t),proposer:e.Opt(r),wait_for_quiet_state:e.Opt(St),executed_timestamp_seconds:e.Nat64,original_total_community_fund_maturity_e8s_equivalent:e.Opt(e.Nat64)}),bt=e.Variant({Spawn:r,Split:se,Configure:ue,Merge:u,DisburseToNeuron:de,SyncCommand:e.Record({}),ClaimOrRefreshNeuron:ce,MergeMaturity:pe,Disburse:le}),kt=e.Record({command:e.Opt(bt),timestamp:e.Nat64}),we=e.Record({vote:e.Int32,proposal_id:e.Opt(r)}),Tt=e.Variant({DissolveDelaySeconds:e.Nat64,WhenDissolvedTimestampSeconds:e.Nat64}),T=e.Record({id:e.Opt(r),staked_maturity_e8s_equivalent:e.Opt(e.Nat64),controller:e.Opt(e.Principal),recent_ballots:e.Vec(we),kyc_verified:e.Bool,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(Tt),followees:e.Vec(e.Tuple(e.Int32,o)),neuron_fees_e8s:e.Nat64,transfer:e.Opt(b),known_neuron_data:e.Opt(j),spawn_at_timestamp_seconds:e.Opt(e.Nat64)}),Jo=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,o)),most_recent_monthly_node_provider_rewards:e.Opt(m),maturity_modulation_last_updated_at_timestamp_seconds:e.Opt(e.Nat64),wait_for_quiet_threshold_seconds:e.Nat64,metrics:e.Opt(l),node_providers:e.Vec(a),cached_daily_maturity_modulation_basis_points:e.Opt(e.Int32),economics:e.Opt(f),spawning_neurons:e.Opt(e.Bool),latest_reward_event:e.Opt(w),to_claim_transfers:e.Vec(b),short_voting_period_seconds:e.Nat64,proposals:e.Vec(e.Tuple(e.Nat64,xt)),in_flight_commands:e.Vec(e.Tuple(e.Nat64,kt)),neurons:e.Vec(e.Tuple(e.Nat64,T)),genesis_timestamp_seconds:e.Nat64}),V=e.Variant({Ok:e.Null,Err:p}),Pt=e.Variant({Error:p,NeuronId:r}),Ct=e.Record({result:e.Opt(Pt)}),Ne=e.Variant({Ok:T,Err:p}),Mt=e.Variant({Ok:l,Err:p}),At=e.Variant({Ok:fe,Err:p}),F=e.Record({dissolve_delay_seconds:e.Nat64,recent_ballots:e.Vec(we),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(j),voting_power:e.Nat64,age_seconds:e.Nat64}),ye=e.Variant({Ok:F,Err:p}),Et=e.Variant({Ok:a,Err:p}),$=e.Record({id:e.Opt(r),status:e.Int32,topic:e.Int32,failure_reason:e.Opt(p),ballots:e.Vec(e.Tuple(e.Nat64,re)),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(oe),latest_tally:e.Opt(ne),reward_status:e.Int32,decided_timestamp_seconds:e.Nat64,proposal:e.Opt(t),proposer:e.Opt(r),executed_timestamp_seconds:e.Nat64}),Vt=e.Record({known_neurons:e.Vec(ae)}),Ft=e.Record({neuron_ids:e.Vec(e.Nat64),include_neurons_readable_by_caller:e.Bool}),Bt=e.Record({neuron_infos:e.Vec(e.Tuple(e.Nat64,F)),full_neurons:e.Vec(T)}),qt=e.Record({node_providers:e.Vec(a)}),Ut=e.Record({include_reward_status:e.Vec(e.Int32),before_proposal:e.Opt(r),limit:e.Nat32,exclude_topic:e.Vec(e.Int32),include_status:e.Vec(e.Int32)}),Kt=e.Record({proposal_info:e.Vec($)}),X=e.Record({created_neuron_id:e.Opt(r)}),Ht=e.Record({refreshed_neuron_id:e.Opt(r)}),Wt=e.Record({target_neuron:e.Opt(T),source_neuron:e.Opt(T),target_neuron_info:e.Opt(F),source_neuron_info:e.Opt(F)}),Gt=e.Record({proposal_id:e.Opt(r)}),jt=e.Record({maturity_e8s:e.Nat64,staked_maturity_e8s:e.Nat64}),zt=e.Record({merged_maturity_e8s:e.Nat64,new_stake_e8s:e.Nat64}),Jt=e.Record({transfer_block_height:e.Nat64}),$t=e.Variant({Error:p,Spawn:X,Split:X,Follow:e.Record({}),ClaimOrRefresh:Ht,Configure:e.Record({}),RegisterVote:e.Record({}),Merge:Wt,DisburseToNeuron:X,MakeProposal:Gt,StakeMaturity:jt,MergeMaturity:zt,Disburse:Jt}),ge=e.Record({command:e.Opt($t)}),Xt=e.Record({sns_governance_canister_id:e.Opt(e.Principal)}),Yt=e.Variant({Committed:Xt,Aborted:e.Record({})}),Qt=e.Record({result:e.Opt(Yt),open_sns_token_swap_proposal_id:e.Opt(e.Nat64)}),Zt=e.Record({reward_account:e.Opt(n)});return e.Service({claim_gtc_neurons:e.Func([e.Principal,e.Vec(r)],[V],[]),claim_or_refresh_neuron_from_account:e.Func([ie],[Ct],[]),get_build_metadata:e.Func([],[e.Text],["query"]),get_full_neuron:e.Func([e.Nat64],[Ne],["query"]),get_full_neuron_by_id_or_subaccount:e.Func([z],[Ne],["query"]),get_latest_reward_event:e.Func([],[w],["query"]),get_metrics:e.Func([],[Mt],["query"]),get_monthly_node_provider_rewards:e.Func([],[At],[]),get_most_recent_monthly_node_provider_rewards:e.Func([],[e.Opt(m)],["query"]),get_network_economics_parameters:e.Func([],[f],["query"]),get_neuron_ids:e.Func([],[e.Vec(e.Nat64)],["query"]),get_neuron_info:e.Func([e.Nat64],[ye],["query"]),get_neuron_info_by_id_or_subaccount:e.Func([z],[ye],["query"]),get_node_provider_by_caller:e.Func([e.Null],[Et],["query"]),get_pending_proposals:e.Func([],[e.Vec($)],["query"]),get_proposal_info:e.Func([e.Nat64],[e.Opt($)],["query"]),list_known_neurons:e.Func([],[Vt],["query"]),list_neurons:e.Func([Ft],[Bt],["query"]),list_node_providers:e.Func([],[qt],["query"]),list_proposals:e.Func([Ut],[Kt],["query"]),manage_neuron:e.Func([J],[ge],[]),settle_community_fund_participation:e.Func([Qt],[V],[]),simulate_manage_neuron:e.Func([J],[ge],[]),transfer_gtc_neuron:e.Func([r,r],[V],[]),update_node_provider:e.Func([Zt],[V],[])})};import{Principal as Z}from"@dfinity/principal";import{arrayBufferToUint8Array as Cn,toNullable as te}from"@dfinity/utils";var Me=class extends Error{},Ae=class extends Me{},Ee=class extends Me{constructor(r){super();this.minimumAmount=r}},U=class extends Error{},P=class extends Error{constructor(r){super();this.detail=r}},ve=class extends Error{},R=class extends Error{constructor(t){super("Unsupported value: "+t)}},Ve=class extends Error{};var dr=Oe(sr()),Jr=Oe(Rr());import{asciiStringToByteArray as kn,bigEndianCrc32 as Tn,uint8ArrayToHexString as Pn}from"@dfinity/utils";var $r=e=>Uint8Array.from(dr.Buffer.from(e,"hex")).subarray(4),Xr=e=>dr.Buffer.from(e).toString("hex"),Yr=(e,t)=>{let r=kn(`
|
|
1
|
+
import{a as Rr,b as I,c as xe}from"./chunk-35ZY5H5F.js";import{a as vr}from"./chunk-P5P36EQW.js";import{b as hr}from"./chunk-DGJWOAUC.js";import{a as O,b as Se}from"./chunk-GNYECLYF.js";import{a as Re,b as Oe}from"./chunk-Q3ETFEQV.js";var xr=Re(be=>{"use strict";be.byteLength=Xo;be.toByteArray=Qo;be.fromByteArray=Do;var M=[],k=[],$o=typeof Uint8Array<"u"?Uint8Array:Array,It="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Y=0,Or=It.length;Y<Or;++Y)M[Y]=It[Y],k[It.charCodeAt(Y)]=Y;var Y,Or;k["-".charCodeAt(0)]=62;k["_".charCodeAt(0)]=63;function Sr(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var o=r===t?0:4-r%4;return[r,o]}function Xo(e){var t=Sr(e),r=t[0],o=t[1];return(r+o)*3/4-o}function Yo(e,t,r){return(t+r)*3/4-r}function Qo(e){var t,r=Sr(e),o=r[0],n=r[1],a=new $o(Yo(e,o,n)),s=0,c=n>0?o-4:o,d;for(d=0;d<c;d+=4)t=k[e.charCodeAt(d)]<<18|k[e.charCodeAt(d+1)]<<12|k[e.charCodeAt(d+2)]<<6|k[e.charCodeAt(d+3)],a[s++]=t>>16&255,a[s++]=t>>8&255,a[s++]=t&255;return n===2&&(t=k[e.charCodeAt(d)]<<2|k[e.charCodeAt(d+1)]>>4,a[s++]=t&255),n===1&&(t=k[e.charCodeAt(d)]<<10|k[e.charCodeAt(d+1)]<<4|k[e.charCodeAt(d+2)]>>2,a[s++]=t>>8&255,a[s++]=t&255),a}function Zo(e){return M[e>>18&63]+M[e>>12&63]+M[e>>6&63]+M[e&63]}function Io(e,t,r){for(var o,n=[],a=t;a<r;a+=3)o=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),n.push(Zo(o));return n.join("")}function Do(e){for(var t,r=e.length,o=r%3,n=[],a=16383,s=0,c=r-o;s<c;s+=a)n.push(Io(e,s,s+a>c?c:s+a));return o===1?(t=e[r-1],n.push(M[t>>2]+M[t<<4&63]+"==")):o===2&&(t=(e[r-2]<<8)+e[r-1],n.push(M[t>>10]+M[t>>4&63]+M[t<<2&63]+"=")),n.join("")}});var br=Re(Dt=>{Dt.read=function(e,t,r,o,n){var a,s,c=n*8-o-1,d=(1<<c)-1,_=d>>1,m=-7,l=r?n-1:0,f=r?-1:1,w=e[t+l];for(l+=f,a=w&(1<<-m)-1,w>>=-m,m+=c;m>0;a=a*256+e[t+l],l+=f,m-=8);for(s=a&(1<<-m)-1,a>>=-m,m+=o;m>0;s=s*256+e[t+l],l+=f,m-=8);if(a===0)a=1-_;else{if(a===d)return s?NaN:(w?-1:1)*(1/0);s=s+Math.pow(2,o),a=a-_}return(w?-1:1)*s*Math.pow(2,a-o)};Dt.write=function(e,t,r,o,n,a){var s,c,d,_=a*8-n-1,m=(1<<_)-1,l=m>>1,f=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=o?0:a-1,b=o?1:-1,p=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=m):(s=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-s))<1&&(s--,d*=2),s+l>=1?t+=f/d:t+=f*Math.pow(2,1-l),t*d>=2&&(s++,d/=2),s+l>=m?(c=0,s=m):s+l>=1?(c=(t*d-1)*Math.pow(2,n),s=s+l):(c=t*Math.pow(2,l-1)*Math.pow(2,n),s=0));n>=8;e[r+w]=c&255,w+=b,c/=256,n-=8);for(s=s<<n|c,_+=n;_>0;e[r+w]=s&255,w+=b,s/=256,_-=8);e[r+w-b]|=p*128}});var sr=Re(L=>{"use strict";var Lt=xr(),D=br(),kr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;L.Buffer=i;L.SlowBuffer=nn;L.INSPECT_MAX_BYTES=50;var ke=2147483647;L.kMaxLength=ke;i.TYPED_ARRAY_SUPPORT=Lo();!i.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 Lo(){try{var 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(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}});Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}});function B(e){if(e>ke)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,i.prototype),t}function i(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return or(e)}return Cr(e,t,r)}i.poolSize=8192;function Cr(e,t,r){if(typeof e=="string")return tn(e,t);if(ArrayBuffer.isView(e))return rn(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(A(e,ArrayBuffer)||e&&A(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(A(e,SharedArrayBuffer)||e&&A(e.buffer,SharedArrayBuffer)))return tr(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var o=e.valueOf&&e.valueOf();if(o!=null&&o!==e)return i.from(o,t,r);var n=on(e);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return i.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}i.from=function(e,t,r){return Cr(e,t,r)};Object.setPrototypeOf(i.prototype,Uint8Array.prototype);Object.setPrototypeOf(i,Uint8Array);function Mr(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 en(e,t,r){return Mr(e),e<=0?B(e):t!==void 0?typeof r=="string"?B(e).fill(t,r):B(e).fill(t):B(e)}i.alloc=function(e,t,r){return en(e,t,r)};function or(e){return Mr(e),B(e<0?0:nr(e)|0)}i.allocUnsafe=function(e){return or(e)};i.allocUnsafeSlow=function(e){return or(e)};function tn(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!i.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=Ar(e,t)|0,o=B(r),n=o.write(e,t);return n!==r&&(o=o.slice(0,n)),o}function er(e){for(var t=e.length<0?0:nr(e.length)|0,r=B(t),o=0;o<t;o+=1)r[o]=e[o]&255;return r}function rn(e){if(A(e,Uint8Array)){var t=new Uint8Array(e);return tr(t.buffer,t.byteOffset,t.byteLength)}return er(e)}function tr(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var o;return t===void 0&&r===void 0?o=new Uint8Array(e):r===void 0?o=new Uint8Array(e,t):o=new Uint8Array(e,t,r),Object.setPrototypeOf(o,i.prototype),o}function on(e){if(i.isBuffer(e)){var t=nr(e.length)|0,r=B(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||ar(e.length)?B(0):er(e);if(e.type==="Buffer"&&Array.isArray(e.data))return er(e.data)}function nr(e){if(e>=ke)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ke.toString(16)+" bytes");return e|0}function nn(e){return+e!=e&&(e=0),i.alloc(+e)}i.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==i.prototype};i.compare=function(t,r){if(A(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),A(r,Uint8Array)&&(r=i.from(r,r.offset,r.byteLength)),!i.isBuffer(t)||!i.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var o=t.length,n=r.length,a=0,s=Math.min(o,n);a<s;++a)if(t[a]!==r[a]){o=t[a],n=r[a];break}return o<n?-1:n<o?1:0};i.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}};i.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return i.alloc(0);var o;if(r===void 0)for(r=0,o=0;o<t.length;++o)r+=t[o].length;var n=i.allocUnsafe(r),a=0;for(o=0;o<t.length;++o){var s=t[o];if(A(s,Uint8Array))a+s.length>n.length?i.from(s).copy(n,a):Uint8Array.prototype.set.call(n,s,a);else if(i.isBuffer(s))s.copy(n,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=s.length}return n};function Ar(e,t){if(i.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||A(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);var r=e.length,o=arguments.length>2&&arguments[2]===!0;if(!o&&r===0)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return rr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Ur(e).length;default:if(n)return o?-1:rr(e).length;t=(""+t).toLowerCase(),n=!0}}i.byteLength=Ar;function an(e,t,r){var o=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return wn(this,t,r);case"utf8":case"utf-8":return Vr(this,t,r);case"ascii":return mn(this,t,r);case"latin1":case"binary":return fn(this,t,r);case"base64":return ln(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nn(this,t,r);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}i.prototype._isBuffer=!0;function Q(e,t,r){var o=e[t];e[t]=e[r],e[r]=o}i.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)Q(this,r,r+1);return this};i.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)Q(this,r,r+3),Q(this,r+1,r+2);return this};i.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)Q(this,r,r+7),Q(this,r+1,r+6),Q(this,r+2,r+5),Q(this,r+3,r+4);return this};i.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?Vr(this,0,t):an.apply(this,arguments)};i.prototype.toLocaleString=i.prototype.toString;i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:i.compare(this,t)===0};i.prototype.inspect=function(){var t="",r=L.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};kr&&(i.prototype[kr]=i.prototype.inspect);i.prototype.compare=function(t,r,o,n,a){if(A(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),o===void 0&&(o=t?t.length:0),n===void 0&&(n=0),a===void 0&&(a=this.length),r<0||o>t.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&r>=o)return 0;if(n>=a)return-1;if(r>=o)return 1;if(r>>>=0,o>>>=0,n>>>=0,a>>>=0,this===t)return 0;for(var s=a-n,c=o-r,d=Math.min(s,c),_=this.slice(n,a),m=t.slice(r,o),l=0;l<d;++l)if(_[l]!==m[l]){s=_[l],c=m[l];break}return s<c?-1:c<s?1:0};function Er(e,t,r,o,n){if(e.length===0)return-1;if(typeof r=="string"?(o=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,ar(r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof t=="string"&&(t=i.from(t,o)),i.isBuffer(t))return t.length===0?-1:Tr(e,t,r,o,n);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Tr(e,[t],r,o,n);throw new TypeError("val must be string, number or Buffer")}function Tr(e,t,r,o,n){var a=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;a=2,s/=2,c/=2,r/=2}function d(w,b){return a===1?w[b]:w.readUInt16BE(b*a)}var _;if(n){var m=-1;for(_=r;_<s;_++)if(d(e,_)===d(t,m===-1?0:_-m)){if(m===-1&&(m=_),_-m+1===c)return m*a}else m!==-1&&(_-=_-m),m=-1}else for(r+c>s&&(r=s-c),_=r;_>=0;_--){for(var l=!0,f=0;f<c;f++)if(d(e,_+f)!==d(t,f)){l=!1;break}if(l)return _}return-1}i.prototype.includes=function(t,r,o){return this.indexOf(t,r,o)!==-1};i.prototype.indexOf=function(t,r,o){return Er(this,t,r,o,!0)};i.prototype.lastIndexOf=function(t,r,o){return Er(this,t,r,o,!1)};function sn(e,t,r,o){r=Number(r)||0;var n=e.length-r;o?(o=Number(o),o>n&&(o=n)):o=n;var a=t.length;o>a/2&&(o=a/2);for(var s=0;s<o;++s){var c=parseInt(t.substr(s*2,2),16);if(ar(c))return s;e[r+s]=c}return s}function cn(e,t,r,o){return Te(rr(t,e.length-r),e,r,o)}function un(e,t,r,o){return Te(Rn(t),e,r,o)}function dn(e,t,r,o){return Te(Ur(t),e,r,o)}function pn(e,t,r,o){return Te(vn(t,e.length-r),e,r,o)}i.prototype.write=function(t,r,o,n){if(r===void 0)n="utf8",o=this.length,r=0;else if(o===void 0&&typeof r=="string")n=r,o=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(o)?(o=o>>>0,n===void 0&&(n="utf8")):(n=o,o=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-r;if((o===void 0||o>a)&&(o=a),t.length>0&&(o<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return sn(this,t,r,o);case"utf8":case"utf-8":return cn(this,t,r,o);case"ascii":case"latin1":case"binary":return un(this,t,r,o);case"base64":return dn(this,t,r,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pn(this,t,r,o);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}};i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ln(e,t,r){return t===0&&r===e.length?Lt.fromByteArray(e):Lt.fromByteArray(e.slice(t,r))}function Vr(e,t,r){r=Math.min(e.length,r);for(var o=[],n=t;n<r;){var a=e[n],s=null,c=a>239?4:a>223?3:a>191?2:1;if(n+c<=r){var d,_,m,l;switch(c){case 1:a<128&&(s=a);break;case 2:d=e[n+1],(d&192)===128&&(l=(a&31)<<6|d&63,l>127&&(s=l));break;case 3:d=e[n+1],_=e[n+2],(d&192)===128&&(_&192)===128&&(l=(a&15)<<12|(d&63)<<6|_&63,l>2047&&(l<55296||l>57343)&&(s=l));break;case 4:d=e[n+1],_=e[n+2],m=e[n+3],(d&192)===128&&(_&192)===128&&(m&192)===128&&(l=(a&15)<<18|(d&63)<<12|(_&63)<<6|m&63,l>65535&&l<1114112&&(s=l))}}s===null?(s=65533,c=1):s>65535&&(s-=65536,o.push(s>>>10&1023|55296),s=56320|s&1023),o.push(s),n+=c}return _n(o)}var Pr=4096;function _n(e){var t=e.length;if(t<=Pr)return String.fromCharCode.apply(String,e);for(var r="",o=0;o<t;)r+=String.fromCharCode.apply(String,e.slice(o,o+=Pr));return r}function mn(e,t,r){var o="";r=Math.min(e.length,r);for(var n=t;n<r;++n)o+=String.fromCharCode(e[n]&127);return o}function fn(e,t,r){var o="";r=Math.min(e.length,r);for(var n=t;n<r;++n)o+=String.fromCharCode(e[n]);return o}function wn(e,t,r){var o=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>o)&&(r=o);for(var n="",a=t;a<r;++a)n+=hn[e[a]];return n}function Nn(e,t,r){for(var o=e.slice(t,r),n="",a=0;a<o.length-1;a+=2)n+=String.fromCharCode(o[a]+o[a+1]*256);return n}i.prototype.slice=function(t,r){var o=this.length;t=~~t,r=r===void 0?o:~~r,t<0?(t+=o,t<0&&(t=0)):t>o&&(t=o),r<0?(r+=o,r<0&&(r=0)):r>o&&(r=o),r<t&&(r=t);var n=this.subarray(t,r);return Object.setPrototypeOf(n,i.prototype),n};function g(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUintLE=i.prototype.readUIntLE=function(t,r,o){t=t>>>0,r=r>>>0,o||g(t,r,this.length);for(var n=this[t],a=1,s=0;++s<r&&(a*=256);)n+=this[t+s]*a;return n};i.prototype.readUintBE=i.prototype.readUIntBE=function(t,r,o){t=t>>>0,r=r>>>0,o||g(t,r,this.length);for(var n=this[t+--r],a=1;r>0&&(a*=256);)n+=this[t+--r]*a;return n};i.prototype.readUint8=i.prototype.readUInt8=function(t,r){return t=t>>>0,r||g(t,1,this.length),this[t]};i.prototype.readUint16LE=i.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||g(t,2,this.length),this[t]|this[t+1]<<8};i.prototype.readUint16BE=i.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||g(t,2,this.length),this[t]<<8|this[t+1]};i.prototype.readUint32LE=i.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||g(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};i.prototype.readUint32BE=i.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||g(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};i.prototype.readIntLE=function(t,r,o){t=t>>>0,r=r>>>0,o||g(t,r,this.length);for(var n=this[t],a=1,s=0;++s<r&&(a*=256);)n+=this[t+s]*a;return a*=128,n>=a&&(n-=Math.pow(2,8*r)),n};i.prototype.readIntBE=function(t,r,o){t=t>>>0,r=r>>>0,o||g(t,r,this.length);for(var n=r,a=1,s=this[t+--n];n>0&&(a*=256);)s+=this[t+--n]*a;return a*=128,s>=a&&(s-=Math.pow(2,8*r)),s};i.prototype.readInt8=function(t,r){return t=t>>>0,r||g(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};i.prototype.readInt16LE=function(t,r){t=t>>>0,r||g(t,2,this.length);var o=this[t]|this[t+1]<<8;return o&32768?o|4294901760:o};i.prototype.readInt16BE=function(t,r){t=t>>>0,r||g(t,2,this.length);var o=this[t+1]|this[t]<<8;return o&32768?o|4294901760:o};i.prototype.readInt32LE=function(t,r){return t=t>>>0,r||g(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};i.prototype.readInt32BE=function(t,r){return t=t>>>0,r||g(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};i.prototype.readFloatLE=function(t,r){return t=t>>>0,r||g(t,4,this.length),D.read(this,t,!0,23,4)};i.prototype.readFloatBE=function(t,r){return t=t>>>0,r||g(t,4,this.length),D.read(this,t,!1,23,4)};i.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||g(t,8,this.length),D.read(this,t,!0,52,8)};i.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||g(t,8,this.length),D.read(this,t,!1,52,8)};function S(e,t,r,o,n,a){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<a)throw new RangeError('"value" argument is out of bounds');if(r+o>e.length)throw new RangeError("Index out of range")}i.prototype.writeUintLE=i.prototype.writeUIntLE=function(t,r,o,n){if(t=+t,r=r>>>0,o=o>>>0,!n){var a=Math.pow(2,8*o)-1;S(this,t,r,o,a,0)}var s=1,c=0;for(this[r]=t&255;++c<o&&(s*=256);)this[r+c]=t/s&255;return r+o};i.prototype.writeUintBE=i.prototype.writeUIntBE=function(t,r,o,n){if(t=+t,r=r>>>0,o=o>>>0,!n){var a=Math.pow(2,8*o)-1;S(this,t,r,o,a,0)}var s=o-1,c=1;for(this[r+s]=t&255;--s>=0&&(c*=256);)this[r+s]=t/c&255;return r+o};i.prototype.writeUint8=i.prototype.writeUInt8=function(t,r,o){return t=+t,r=r>>>0,o||S(this,t,r,1,255,0),this[r]=t&255,r+1};i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(t,r,o){return t=+t,r=r>>>0,o||S(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(t,r,o){return t=+t,r=r>>>0,o||S(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(t,r,o){return t=+t,r=r>>>0,o||S(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(t,r,o){return t=+t,r=r>>>0,o||S(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};i.prototype.writeIntLE=function(t,r,o,n){if(t=+t,r=r>>>0,!n){var a=Math.pow(2,8*o-1);S(this,t,r,o,a-1,-a)}var s=0,c=1,d=0;for(this[r]=t&255;++s<o&&(c*=256);)t<0&&d===0&&this[r+s-1]!==0&&(d=1),this[r+s]=(t/c>>0)-d&255;return r+o};i.prototype.writeIntBE=function(t,r,o,n){if(t=+t,r=r>>>0,!n){var a=Math.pow(2,8*o-1);S(this,t,r,o,a-1,-a)}var s=o-1,c=1,d=0;for(this[r+s]=t&255;--s>=0&&(c*=256);)t<0&&d===0&&this[r+s+1]!==0&&(d=1),this[r+s]=(t/c>>0)-d&255;return r+o};i.prototype.writeInt8=function(t,r,o){return t=+t,r=r>>>0,o||S(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};i.prototype.writeInt16LE=function(t,r,o){return t=+t,r=r>>>0,o||S(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};i.prototype.writeInt16BE=function(t,r,o){return t=+t,r=r>>>0,o||S(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};i.prototype.writeInt32LE=function(t,r,o){return t=+t,r=r>>>0,o||S(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};i.prototype.writeInt32BE=function(t,r,o){return t=+t,r=r>>>0,o||S(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function Fr(e,t,r,o,n,a){if(r+o>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Br(e,t,r,o,n){return t=+t,r=r>>>0,n||Fr(e,t,r,4,34028234663852886e22,-34028234663852886e22),D.write(e,t,r,o,23,4),r+4}i.prototype.writeFloatLE=function(t,r,o){return Br(this,t,r,!0,o)};i.prototype.writeFloatBE=function(t,r,o){return Br(this,t,r,!1,o)};function qr(e,t,r,o,n){return t=+t,r=r>>>0,n||Fr(e,t,r,8,17976931348623157e292,-17976931348623157e292),D.write(e,t,r,o,52,8),r+8}i.prototype.writeDoubleLE=function(t,r,o){return qr(this,t,r,!0,o)};i.prototype.writeDoubleBE=function(t,r,o){return qr(this,t,r,!1,o)};i.prototype.copy=function(t,r,o,n){if(!i.isBuffer(t))throw new TypeError("argument should be a Buffer");if(o||(o=0),!n&&n!==0&&(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<o&&(n=o),n===o||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(o<0||o>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-o&&(n=t.length-r+o);var a=n-o;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,o,n):Uint8Array.prototype.set.call(t,this.subarray(o,n),r),a};i.prototype.fill=function(t,r,o,n){if(typeof t=="string"){if(typeof r=="string"?(n=r,r=0,o=this.length):typeof o=="string"&&(n=o,o=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(t.length===1){var a=t.charCodeAt(0);(n==="utf8"&&a<128||n==="latin1")&&(t=a)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<o)throw new RangeError("Out of range index");if(o<=r)return this;r=r>>>0,o=o===void 0?this.length:o>>>0,t||(t=0);var s;if(typeof t=="number")for(s=r;s<o;++s)this[s]=t;else{var c=i.isBuffer(t)?t:i.from(t,n),d=c.length;if(d===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<o-r;++s)this[s+r]=c[s%d]}return this};var yn=/[^+/0-9A-Za-z-_]/g;function gn(e){if(e=e.split("=")[0],e=e.trim().replace(yn,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function rr(e,t){t=t||1/0;for(var r,o=e.length,n=null,a=[],s=0;s<o;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(s+1===o){(t-=3)>-1&&a.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(t-=3)>-1&&a.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}function Rn(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function vn(e,t){for(var r,o,n,a=[],s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),o=r>>8,n=r%256,a.push(n),a.push(o);return a}function Ur(e){return Lt.toByteArray(gn(e))}function Te(e,t,r,o){for(var n=0;n<o&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function A(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function ar(e){return e!==e}var hn=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var o=r*16,n=0;n<16;++n)t[o+n]=e[r]+e[n];return t}()});var Wr=Re((ir,Hr)=>{var Pe=sr(),q=Pe.Buffer;function Kr(e,t){for(var r in e)t[r]=e[r]}q.from&&q.alloc&&q.allocUnsafe&&q.allocUnsafeSlow?Hr.exports=Pe:(Kr(Pe,ir),ir.Buffer=ee);function ee(e,t,r){return q(e,t,r)}Kr(q,ee);ee.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return q(e,t,r)};ee.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var o=q(e);return t!==void 0?typeof r=="string"?o.fill(t,r):o.fill(t):o.fill(0),o};ee.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return q(e)};ee.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Pe.SlowBuffer(e)}});var Gr=Re((ma,ur)=>{"use strict";var cr=65536,On=4294967295;function Sn(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
2
|
+
Use Chrome, Firefox or Internet Explorer 11`)}var xn=Wr().Buffer,Ce=window.crypto||window.msCrypto;Ce&&Ce.getRandomValues?ur.exports=bn:ur.exports=Sn;function bn(e,t){if(e>On)throw new RangeError("requested too many random bytes");var r=xn.allocUnsafe(e);if(e>0)if(e>cr)for(var o=0;o<e;o+=cr)Ce.getRandomValues(r.slice(o,o+cr));else Ce.getRandomValues(r);return typeof t=="function"?process.nextTick(function(){t(null,r)}):r}});var jo=Oe(Rr()),zo=Oe(Gr());import{asciiStringToByteArray as ca,assertPercentageNumber as gr,createServices as ua,fromNullable as x,isNullish as Go,nonNullish as C,uint8ArrayToBigInt as da}from"@dfinity/utils";var jr=({IDL:e})=>{let t=e.Rec(),r=e.Record({id:e.Nat64}),o=e.Record({followees:e.Vec(r)}),n=e.Record({hash:e.Vec(e.Nat8)}),a=e.Record({id:e.Opt(e.Principal),reward_account:e.Opt(n)}),s=e.Record({dissolve_delay_seconds:e.Nat64}),c=e.Record({to_account:e.Opt(n)}),d=e.Variant({RewardToNeuron:s,RewardToAccount:c}),_=e.Record({node_provider:e.Opt(a),reward_mode:e.Opt(d),amount_e8s:e.Nat64}),m=e.Record({timestamp:e.Nat64,rewards:e.Vec(_)}),l=e.Record({not_dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),garbage_collectable_neurons_count:e.Nat64,neurons_with_invalid_stake_count:e.Nat64,not_dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,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:e.Nat64,not_dissolving_neurons_count:e.Nat64,total_locked_e8s:e.Nat64,dissolved_neurons_e8s:e.Nat64,neurons_with_less_than_6_months_dissolve_delay_e8s:e.Nat64,dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),dissolving_neurons_count:e.Nat64,dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),community_fund_total_staked_e8s:e.Nat64,timestamp_seconds:e.Nat64}),f=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}),w=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(r)}),b=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}),p=e.Record({error_message:e.Text,error_type:e.Int32}),Ue=e.Record({nns_neuron_id:e.Nat64,amount_icp_e8s:e.Nat64}),Ke=e.Record({hotkey_principal:e.Text,cf_neurons:e.Vec(Ue)}),re=e.Record({vote:e.Int32,voting_power:e.Nat64}),He=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)}),h=e.Record({status:e.Opt(He),canister_id:e.Opt(e.Principal)}),We=e.Record({ledger_index_canister_summary:e.Opt(h),fallback_controller_principal_ids:e.Vec(e.Principal),ledger_archive_canister_summaries:e.Vec(h),ledger_canister_summary:e.Opt(h),swap_canister_summary:e.Opt(h),governance_canister_summary:e.Opt(h),root_canister_summary:e.Opt(h),dapp_canister_summaries:e.Vec(h)}),oe=e.Record({swap_background_information:e.Opt(We)}),ne=e.Record({no:e.Nat64,yes:e.Nat64,total:e.Nat64,timestamp_seconds:e.Nat64}),j=e.Record({name:e.Text,description:e.Opt(e.Text)}),ae=e.Record({id:e.Opt(r),known_neuron_data:e.Opt(j)}),Ge=e.Record({percentage_to_spawn:e.Opt(e.Nat32),new_controller:e.Opt(e.Principal),nonce:e.Opt(e.Nat64)}),se=e.Record({amount_e8s:e.Nat64}),je=e.Record({topic:e.Int32,followees:e.Vec(r)}),ie=e.Record({controller:e.Opt(e.Principal),memo:e.Nat64}),ze=e.Variant({NeuronIdOrSubaccount:e.Record({}),MemoAndController:ie,Memo:e.Nat64}),ce=e.Record({by:e.Opt(ze)}),Je=e.Record({hot_key_to_remove:e.Opt(e.Principal)}),$e=e.Record({new_hot_key:e.Opt(e.Principal)}),Xe=e.Record({requested_setting_for_auto_stake_maturity:e.Bool}),Ye=e.Record({additional_dissolve_delay_seconds:e.Nat32}),Qe=e.Record({dissolve_timestamp_seconds:e.Nat64}),Ze=e.Variant({RemoveHotKey:Je,AddHotKey:$e,ChangeAutoStakeMaturity:Xe,StopDissolving:e.Record({}),StartDissolving:e.Record({}),IncreaseDissolveDelay:Ye,JoinCommunityFund:e.Record({}),LeaveCommunityFund:e.Record({}),SetDissolveTimestamp:Qe}),ue=e.Record({operation:e.Opt(Ze)}),Ie=e.Record({vote:e.Int32,proposal:e.Opt(r)}),u=e.Record({source_neuron_id:e.Opt(r)}),de=e.Record({dissolve_delay_seconds:e.Nat64,kyc_verified:e.Bool,amount_e8s:e.Nat64,new_controller:e.Opt(e.Principal),nonce:e.Nat64}),De=e.Record({percentage_to_stake:e.Opt(e.Nat32)}),pe=e.Record({percentage_to_merge:e.Nat32}),Le=e.Record({e8s:e.Nat64}),le=e.Record({to_account:e.Opt(n),amount:e.Opt(Le)}),et=e.Variant({Spawn:Ge,Split:se,Follow:je,ClaimOrRefresh:ce,Configure:ue,RegisterVote:Ie,Merge:u,DisburseToNeuron:de,MakeProposal:t,StakeMaturity:De,MergeMaturity:pe,Disburse:le}),z=e.Variant({Subaccount:e.Vec(e.Nat8),NeuronId:r}),J=e.Record({id:e.Opt(r),command:e.Opt(et),neuron_id_or_subaccount:e.Opt(z)}),E=e.Record({basis_points:e.Opt(e.Nat64)}),N=e.Record({seconds:e.Opt(e.Nat64)}),y=e.Record({e8s:e.Opt(e.Nat64)}),tt=e.Record({reward_rate_transition_duration:e.Opt(N),initial_reward_rate:e.Opt(E),final_reward_rate:e.Opt(E)}),rt=e.Record({neuron_maximum_dissolve_delay_bonus:e.Opt(E),neuron_maximum_age_for_age_bonus:e.Opt(N),neuron_maximum_dissolve_delay:e.Opt(N),neuron_minimum_dissolve_delay_to_vote:e.Opt(N),neuron_maximum_age_bonus:e.Opt(E),neuron_minimum_stake:e.Opt(y),proposal_wait_for_quiet_deadline_increase:e.Opt(N),proposal_initial_voting_period:e.Opt(N),proposal_rejection_fee:e.Opt(y),voting_reward_parameters:e.Opt(tt)}),_e=e.Record({base64_encoding:e.Opt(e.Text)}),ot=e.Record({transaction_fee:e.Opt(y),token_symbol:e.Opt(e.Text),token_logo:e.Opt(_e),token_name:e.Opt(e.Text)}),nt=e.Record({id:e.Opt(e.Principal)}),at=e.Record({dissolve_delay_interval:e.Opt(N),count:e.Opt(e.Nat64)}),st=e.Record({minimum_participants:e.Opt(e.Nat64),neuron_basket_construction_parameters:e.Opt(at),maximum_participant_icp:e.Opt(y),minimum_icp:e.Opt(y),minimum_participant_icp:e.Opt(y),maximum_icp:e.Opt(y)}),me=e.Record({total:e.Opt(y)}),it=e.Record({controller:e.Opt(e.Principal),dissolve_delay:e.Opt(N),memo:e.Opt(e.Nat64),vesting_period:e.Opt(N),stake:e.Opt(y)}),ct=e.Record({developer_neurons:e.Vec(it)}),ut=e.Record({treasury_distribution:e.Opt(me),developer_distribution:e.Opt(ct),swap_distribution:e.Opt(me)}),dt=e.Record({url:e.Opt(e.Text),governance_parameters:e.Opt(rt),fallback_controller_principal_ids:e.Vec(e.Principal),logo:e.Opt(_e),name:e.Opt(e.Text),ledger_parameters:e.Opt(ot),description:e.Opt(e.Text),dapp_canisters:e.Vec(nt),swap_parameters:e.Opt(st),initial_token_distribution:e.Opt(ut)}),pt=e.Record({nns_function:e.Int32,payload:e.Vec(e.Nat8)}),lt=e.Record({dissolve_delay_interval_seconds:e.Nat64,count:e.Nat64}),_t=e.Record({min_participant_icp_e8s:e.Nat64,neuron_basket_construction_parameters:e.Opt(lt),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_icp_e8s:e.Nat64}),mt=e.Record({community_fund_investment_e8s:e.Opt(e.Nat64),target_swap_canister_id:e.Opt(e.Principal),params:e.Opt(_t)}),ft=e.Record({start_timestamp_seconds:e.Nat64,end_timestamp_seconds:e.Nat64}),wt=e.Record({open_time_window:e.Opt(ft)}),Nt=e.Record({request:e.Opt(wt),swap_canister_id:e.Opt(e.Principal)}),yt=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,o))}),fe=e.Record({use_registry_derived_rewards:e.Opt(e.Bool),rewards:e.Vec(_)}),gt=e.Record({principals:e.Vec(e.Principal)}),Rt=e.Variant({ToRemove:a,ToAdd:a}),vt=e.Record({change:e.Opt(Rt)}),ht=e.Record({motion_text:e.Text}),Ot=e.Variant({RegisterKnownNeuron:ae,ManageNeuron:J,CreateServiceNervousSystem:dt,ExecuteNnsFunction:pt,RewardNodeProvider:_,OpenSnsTokenSwap:mt,SetSnsTokenSwapOpenTimeWindow:Nt,SetDefaultFollowees:yt,RewardNodeProviders:fe,ManageNetworkEconomics:f,ApproveGenesisKyc:gt,AddOrRemoveNodeProvider:vt,Motion:ht});t.fill(e.Record({url:e.Text,title:e.Opt(e.Text),action:e.Opt(Ot),summary:e.Text}));let St=e.Record({current_deadline_timestamp_seconds:e.Nat64}),xt=e.Record({id:e.Opt(r),failure_reason:e.Opt(p),cf_participants:e.Vec(Ke),ballots:e.Vec(e.Tuple(e.Nat64,re)),proposal_timestamp_seconds:e.Nat64,reward_event_round:e.Nat64,failed_timestamp_seconds:e.Nat64,reject_cost_e8s:e.Nat64,derived_proposal_information:e.Opt(oe),latest_tally:e.Opt(ne),sns_token_swap_lifecycle:e.Opt(e.Int32),decided_timestamp_seconds:e.Nat64,proposal:e.Opt(t),proposer:e.Opt(r),wait_for_quiet_state:e.Opt(St),executed_timestamp_seconds:e.Nat64,original_total_community_fund_maturity_e8s_equivalent:e.Opt(e.Nat64)}),bt=e.Variant({Spawn:r,Split:se,Configure:ue,Merge:u,DisburseToNeuron:de,SyncCommand:e.Record({}),ClaimOrRefreshNeuron:ce,MergeMaturity:pe,Disburse:le}),kt=e.Record({command:e.Opt(bt),timestamp:e.Nat64}),we=e.Record({vote:e.Int32,proposal_id:e.Opt(r)}),Tt=e.Variant({DissolveDelaySeconds:e.Nat64,WhenDissolvedTimestampSeconds:e.Nat64}),T=e.Record({id:e.Opt(r),staked_maturity_e8s_equivalent:e.Opt(e.Nat64),controller:e.Opt(e.Principal),recent_ballots:e.Vec(we),kyc_verified:e.Bool,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(Tt),followees:e.Vec(e.Tuple(e.Int32,o)),neuron_fees_e8s:e.Nat64,transfer:e.Opt(b),known_neuron_data:e.Opt(j),spawn_at_timestamp_seconds:e.Opt(e.Nat64)}),Jo=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,o)),most_recent_monthly_node_provider_rewards:e.Opt(m),maturity_modulation_last_updated_at_timestamp_seconds:e.Opt(e.Nat64),wait_for_quiet_threshold_seconds:e.Nat64,metrics:e.Opt(l),node_providers:e.Vec(a),cached_daily_maturity_modulation_basis_points:e.Opt(e.Int32),economics:e.Opt(f),spawning_neurons:e.Opt(e.Bool),latest_reward_event:e.Opt(w),to_claim_transfers:e.Vec(b),short_voting_period_seconds:e.Nat64,proposals:e.Vec(e.Tuple(e.Nat64,xt)),in_flight_commands:e.Vec(e.Tuple(e.Nat64,kt)),neurons:e.Vec(e.Tuple(e.Nat64,T)),genesis_timestamp_seconds:e.Nat64}),V=e.Variant({Ok:e.Null,Err:p}),Pt=e.Variant({Error:p,NeuronId:r}),Ct=e.Record({result:e.Opt(Pt)}),Ne=e.Variant({Ok:T,Err:p}),Mt=e.Variant({Ok:l,Err:p}),At=e.Variant({Ok:fe,Err:p}),F=e.Record({dissolve_delay_seconds:e.Nat64,recent_ballots:e.Vec(we),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(j),voting_power:e.Nat64,age_seconds:e.Nat64}),ye=e.Variant({Ok:F,Err:p}),Et=e.Variant({Ok:a,Err:p}),$=e.Record({id:e.Opt(r),status:e.Int32,topic:e.Int32,failure_reason:e.Opt(p),ballots:e.Vec(e.Tuple(e.Nat64,re)),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(oe),latest_tally:e.Opt(ne),reward_status:e.Int32,decided_timestamp_seconds:e.Nat64,proposal:e.Opt(t),proposer:e.Opt(r),executed_timestamp_seconds:e.Nat64}),Vt=e.Record({known_neurons:e.Vec(ae)}),Ft=e.Record({neuron_ids:e.Vec(e.Nat64),include_neurons_readable_by_caller:e.Bool}),Bt=e.Record({neuron_infos:e.Vec(e.Tuple(e.Nat64,F)),full_neurons:e.Vec(T)}),qt=e.Record({node_providers:e.Vec(a)}),Ut=e.Record({include_reward_status:e.Vec(e.Int32),before_proposal:e.Opt(r),limit:e.Nat32,exclude_topic:e.Vec(e.Int32),include_status:e.Vec(e.Int32)}),Kt=e.Record({proposal_info:e.Vec($)}),X=e.Record({created_neuron_id:e.Opt(r)}),Ht=e.Record({refreshed_neuron_id:e.Opt(r)}),Wt=e.Record({target_neuron:e.Opt(T),source_neuron:e.Opt(T),target_neuron_info:e.Opt(F),source_neuron_info:e.Opt(F)}),Gt=e.Record({proposal_id:e.Opt(r)}),jt=e.Record({maturity_e8s:e.Nat64,staked_maturity_e8s:e.Nat64}),zt=e.Record({merged_maturity_e8s:e.Nat64,new_stake_e8s:e.Nat64}),Jt=e.Record({transfer_block_height:e.Nat64}),$t=e.Variant({Error:p,Spawn:X,Split:X,Follow:e.Record({}),ClaimOrRefresh:Ht,Configure:e.Record({}),RegisterVote:e.Record({}),Merge:Wt,DisburseToNeuron:X,MakeProposal:Gt,StakeMaturity:jt,MergeMaturity:zt,Disburse:Jt}),ge=e.Record({command:e.Opt($t)}),Xt=e.Record({sns_governance_canister_id:e.Opt(e.Principal)}),Yt=e.Variant({Committed:Xt,Aborted:e.Record({})}),Qt=e.Record({result:e.Opt(Yt),open_sns_token_swap_proposal_id:e.Opt(e.Nat64)}),Zt=e.Record({reward_account:e.Opt(n)});return e.Service({claim_gtc_neurons:e.Func([e.Principal,e.Vec(r)],[V],[]),claim_or_refresh_neuron_from_account:e.Func([ie],[Ct],[]),get_build_metadata:e.Func([],[e.Text],[]),get_full_neuron:e.Func([e.Nat64],[Ne],[]),get_full_neuron_by_id_or_subaccount:e.Func([z],[Ne],[]),get_latest_reward_event:e.Func([],[w],[]),get_metrics:e.Func([],[Mt],[]),get_monthly_node_provider_rewards:e.Func([],[At],[]),get_most_recent_monthly_node_provider_rewards:e.Func([],[e.Opt(m)],[]),get_network_economics_parameters:e.Func([],[f],[]),get_neuron_ids:e.Func([],[e.Vec(e.Nat64)],[]),get_neuron_info:e.Func([e.Nat64],[ye],[]),get_neuron_info_by_id_or_subaccount:e.Func([z],[ye],[]),get_node_provider_by_caller:e.Func([e.Null],[Et],[]),get_pending_proposals:e.Func([],[e.Vec($)],[]),get_proposal_info:e.Func([e.Nat64],[e.Opt($)],[]),list_known_neurons:e.Func([],[Vt],[]),list_neurons:e.Func([Ft],[Bt],[]),list_node_providers:e.Func([],[qt],[]),list_proposals:e.Func([Ut],[Kt],[]),manage_neuron:e.Func([J],[ge],[]),settle_community_fund_participation:e.Func([Qt],[V],[]),simulate_manage_neuron:e.Func([J],[ge],[]),transfer_gtc_neuron:e.Func([r,r],[V],[]),update_node_provider:e.Func([Zt],[V],[])})};var zr=({IDL:e})=>{let t=e.Rec(),r=e.Record({id:e.Nat64}),o=e.Record({followees:e.Vec(r)}),n=e.Record({hash:e.Vec(e.Nat8)}),a=e.Record({id:e.Opt(e.Principal),reward_account:e.Opt(n)}),s=e.Record({dissolve_delay_seconds:e.Nat64}),c=e.Record({to_account:e.Opt(n)}),d=e.Variant({RewardToNeuron:s,RewardToAccount:c}),_=e.Record({node_provider:e.Opt(a),reward_mode:e.Opt(d),amount_e8s:e.Nat64}),m=e.Record({timestamp:e.Nat64,rewards:e.Vec(_)}),l=e.Record({not_dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),garbage_collectable_neurons_count:e.Nat64,neurons_with_invalid_stake_count:e.Nat64,not_dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,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:e.Nat64,not_dissolving_neurons_count:e.Nat64,total_locked_e8s:e.Nat64,dissolved_neurons_e8s:e.Nat64,neurons_with_less_than_6_months_dissolve_delay_e8s:e.Nat64,dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),dissolving_neurons_count:e.Nat64,dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),community_fund_total_staked_e8s:e.Nat64,timestamp_seconds:e.Nat64}),f=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}),w=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(r)}),b=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}),p=e.Record({error_message:e.Text,error_type:e.Int32}),Ue=e.Record({nns_neuron_id:e.Nat64,amount_icp_e8s:e.Nat64}),Ke=e.Record({hotkey_principal:e.Text,cf_neurons:e.Vec(Ue)}),re=e.Record({vote:e.Int32,voting_power:e.Nat64}),He=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)}),h=e.Record({status:e.Opt(He),canister_id:e.Opt(e.Principal)}),We=e.Record({ledger_index_canister_summary:e.Opt(h),fallback_controller_principal_ids:e.Vec(e.Principal),ledger_archive_canister_summaries:e.Vec(h),ledger_canister_summary:e.Opt(h),swap_canister_summary:e.Opt(h),governance_canister_summary:e.Opt(h),root_canister_summary:e.Opt(h),dapp_canister_summaries:e.Vec(h)}),oe=e.Record({swap_background_information:e.Opt(We)}),ne=e.Record({no:e.Nat64,yes:e.Nat64,total:e.Nat64,timestamp_seconds:e.Nat64}),j=e.Record({name:e.Text,description:e.Opt(e.Text)}),ae=e.Record({id:e.Opt(r),known_neuron_data:e.Opt(j)}),Ge=e.Record({percentage_to_spawn:e.Opt(e.Nat32),new_controller:e.Opt(e.Principal),nonce:e.Opt(e.Nat64)}),se=e.Record({amount_e8s:e.Nat64}),je=e.Record({topic:e.Int32,followees:e.Vec(r)}),ie=e.Record({controller:e.Opt(e.Principal),memo:e.Nat64}),ze=e.Variant({NeuronIdOrSubaccount:e.Record({}),MemoAndController:ie,Memo:e.Nat64}),ce=e.Record({by:e.Opt(ze)}),Je=e.Record({hot_key_to_remove:e.Opt(e.Principal)}),$e=e.Record({new_hot_key:e.Opt(e.Principal)}),Xe=e.Record({requested_setting_for_auto_stake_maturity:e.Bool}),Ye=e.Record({additional_dissolve_delay_seconds:e.Nat32}),Qe=e.Record({dissolve_timestamp_seconds:e.Nat64}),Ze=e.Variant({RemoveHotKey:Je,AddHotKey:$e,ChangeAutoStakeMaturity:Xe,StopDissolving:e.Record({}),StartDissolving:e.Record({}),IncreaseDissolveDelay:Ye,JoinCommunityFund:e.Record({}),LeaveCommunityFund:e.Record({}),SetDissolveTimestamp:Qe}),ue=e.Record({operation:e.Opt(Ze)}),Ie=e.Record({vote:e.Int32,proposal:e.Opt(r)}),u=e.Record({source_neuron_id:e.Opt(r)}),de=e.Record({dissolve_delay_seconds:e.Nat64,kyc_verified:e.Bool,amount_e8s:e.Nat64,new_controller:e.Opt(e.Principal),nonce:e.Nat64}),De=e.Record({percentage_to_stake:e.Opt(e.Nat32)}),pe=e.Record({percentage_to_merge:e.Nat32}),Le=e.Record({e8s:e.Nat64}),le=e.Record({to_account:e.Opt(n),amount:e.Opt(Le)}),et=e.Variant({Spawn:Ge,Split:se,Follow:je,ClaimOrRefresh:ce,Configure:ue,RegisterVote:Ie,Merge:u,DisburseToNeuron:de,MakeProposal:t,StakeMaturity:De,MergeMaturity:pe,Disburse:le}),z=e.Variant({Subaccount:e.Vec(e.Nat8),NeuronId:r}),J=e.Record({id:e.Opt(r),command:e.Opt(et),neuron_id_or_subaccount:e.Opt(z)}),E=e.Record({basis_points:e.Opt(e.Nat64)}),N=e.Record({seconds:e.Opt(e.Nat64)}),y=e.Record({e8s:e.Opt(e.Nat64)}),tt=e.Record({reward_rate_transition_duration:e.Opt(N),initial_reward_rate:e.Opt(E),final_reward_rate:e.Opt(E)}),rt=e.Record({neuron_maximum_dissolve_delay_bonus:e.Opt(E),neuron_maximum_age_for_age_bonus:e.Opt(N),neuron_maximum_dissolve_delay:e.Opt(N),neuron_minimum_dissolve_delay_to_vote:e.Opt(N),neuron_maximum_age_bonus:e.Opt(E),neuron_minimum_stake:e.Opt(y),proposal_wait_for_quiet_deadline_increase:e.Opt(N),proposal_initial_voting_period:e.Opt(N),proposal_rejection_fee:e.Opt(y),voting_reward_parameters:e.Opt(tt)}),_e=e.Record({base64_encoding:e.Opt(e.Text)}),ot=e.Record({transaction_fee:e.Opt(y),token_symbol:e.Opt(e.Text),token_logo:e.Opt(_e),token_name:e.Opt(e.Text)}),nt=e.Record({id:e.Opt(e.Principal)}),at=e.Record({dissolve_delay_interval:e.Opt(N),count:e.Opt(e.Nat64)}),st=e.Record({minimum_participants:e.Opt(e.Nat64),neuron_basket_construction_parameters:e.Opt(at),maximum_participant_icp:e.Opt(y),minimum_icp:e.Opt(y),minimum_participant_icp:e.Opt(y),maximum_icp:e.Opt(y)}),me=e.Record({total:e.Opt(y)}),it=e.Record({controller:e.Opt(e.Principal),dissolve_delay:e.Opt(N),memo:e.Opt(e.Nat64),vesting_period:e.Opt(N),stake:e.Opt(y)}),ct=e.Record({developer_neurons:e.Vec(it)}),ut=e.Record({treasury_distribution:e.Opt(me),developer_distribution:e.Opt(ct),swap_distribution:e.Opt(me)}),dt=e.Record({url:e.Opt(e.Text),governance_parameters:e.Opt(rt),fallback_controller_principal_ids:e.Vec(e.Principal),logo:e.Opt(_e),name:e.Opt(e.Text),ledger_parameters:e.Opt(ot),description:e.Opt(e.Text),dapp_canisters:e.Vec(nt),swap_parameters:e.Opt(st),initial_token_distribution:e.Opt(ut)}),pt=e.Record({nns_function:e.Int32,payload:e.Vec(e.Nat8)}),lt=e.Record({dissolve_delay_interval_seconds:e.Nat64,count:e.Nat64}),_t=e.Record({min_participant_icp_e8s:e.Nat64,neuron_basket_construction_parameters:e.Opt(lt),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_icp_e8s:e.Nat64}),mt=e.Record({community_fund_investment_e8s:e.Opt(e.Nat64),target_swap_canister_id:e.Opt(e.Principal),params:e.Opt(_t)}),ft=e.Record({start_timestamp_seconds:e.Nat64,end_timestamp_seconds:e.Nat64}),wt=e.Record({open_time_window:e.Opt(ft)}),Nt=e.Record({request:e.Opt(wt),swap_canister_id:e.Opt(e.Principal)}),yt=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,o))}),fe=e.Record({use_registry_derived_rewards:e.Opt(e.Bool),rewards:e.Vec(_)}),gt=e.Record({principals:e.Vec(e.Principal)}),Rt=e.Variant({ToRemove:a,ToAdd:a}),vt=e.Record({change:e.Opt(Rt)}),ht=e.Record({motion_text:e.Text}),Ot=e.Variant({RegisterKnownNeuron:ae,ManageNeuron:J,CreateServiceNervousSystem:dt,ExecuteNnsFunction:pt,RewardNodeProvider:_,OpenSnsTokenSwap:mt,SetSnsTokenSwapOpenTimeWindow:Nt,SetDefaultFollowees:yt,RewardNodeProviders:fe,ManageNetworkEconomics:f,ApproveGenesisKyc:gt,AddOrRemoveNodeProvider:vt,Motion:ht});t.fill(e.Record({url:e.Text,title:e.Opt(e.Text),action:e.Opt(Ot),summary:e.Text}));let St=e.Record({current_deadline_timestamp_seconds:e.Nat64}),xt=e.Record({id:e.Opt(r),failure_reason:e.Opt(p),cf_participants:e.Vec(Ke),ballots:e.Vec(e.Tuple(e.Nat64,re)),proposal_timestamp_seconds:e.Nat64,reward_event_round:e.Nat64,failed_timestamp_seconds:e.Nat64,reject_cost_e8s:e.Nat64,derived_proposal_information:e.Opt(oe),latest_tally:e.Opt(ne),sns_token_swap_lifecycle:e.Opt(e.Int32),decided_timestamp_seconds:e.Nat64,proposal:e.Opt(t),proposer:e.Opt(r),wait_for_quiet_state:e.Opt(St),executed_timestamp_seconds:e.Nat64,original_total_community_fund_maturity_e8s_equivalent:e.Opt(e.Nat64)}),bt=e.Variant({Spawn:r,Split:se,Configure:ue,Merge:u,DisburseToNeuron:de,SyncCommand:e.Record({}),ClaimOrRefreshNeuron:ce,MergeMaturity:pe,Disburse:le}),kt=e.Record({command:e.Opt(bt),timestamp:e.Nat64}),we=e.Record({vote:e.Int32,proposal_id:e.Opt(r)}),Tt=e.Variant({DissolveDelaySeconds:e.Nat64,WhenDissolvedTimestampSeconds:e.Nat64}),T=e.Record({id:e.Opt(r),staked_maturity_e8s_equivalent:e.Opt(e.Nat64),controller:e.Opt(e.Principal),recent_ballots:e.Vec(we),kyc_verified:e.Bool,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(Tt),followees:e.Vec(e.Tuple(e.Int32,o)),neuron_fees_e8s:e.Nat64,transfer:e.Opt(b),known_neuron_data:e.Opt(j),spawn_at_timestamp_seconds:e.Opt(e.Nat64)}),Jo=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,o)),most_recent_monthly_node_provider_rewards:e.Opt(m),maturity_modulation_last_updated_at_timestamp_seconds:e.Opt(e.Nat64),wait_for_quiet_threshold_seconds:e.Nat64,metrics:e.Opt(l),node_providers:e.Vec(a),cached_daily_maturity_modulation_basis_points:e.Opt(e.Int32),economics:e.Opt(f),spawning_neurons:e.Opt(e.Bool),latest_reward_event:e.Opt(w),to_claim_transfers:e.Vec(b),short_voting_period_seconds:e.Nat64,proposals:e.Vec(e.Tuple(e.Nat64,xt)),in_flight_commands:e.Vec(e.Tuple(e.Nat64,kt)),neurons:e.Vec(e.Tuple(e.Nat64,T)),genesis_timestamp_seconds:e.Nat64}),V=e.Variant({Ok:e.Null,Err:p}),Pt=e.Variant({Error:p,NeuronId:r}),Ct=e.Record({result:e.Opt(Pt)}),Ne=e.Variant({Ok:T,Err:p}),Mt=e.Variant({Ok:l,Err:p}),At=e.Variant({Ok:fe,Err:p}),F=e.Record({dissolve_delay_seconds:e.Nat64,recent_ballots:e.Vec(we),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(j),voting_power:e.Nat64,age_seconds:e.Nat64}),ye=e.Variant({Ok:F,Err:p}),Et=e.Variant({Ok:a,Err:p}),$=e.Record({id:e.Opt(r),status:e.Int32,topic:e.Int32,failure_reason:e.Opt(p),ballots:e.Vec(e.Tuple(e.Nat64,re)),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(oe),latest_tally:e.Opt(ne),reward_status:e.Int32,decided_timestamp_seconds:e.Nat64,proposal:e.Opt(t),proposer:e.Opt(r),executed_timestamp_seconds:e.Nat64}),Vt=e.Record({known_neurons:e.Vec(ae)}),Ft=e.Record({neuron_ids:e.Vec(e.Nat64),include_neurons_readable_by_caller:e.Bool}),Bt=e.Record({neuron_infos:e.Vec(e.Tuple(e.Nat64,F)),full_neurons:e.Vec(T)}),qt=e.Record({node_providers:e.Vec(a)}),Ut=e.Record({include_reward_status:e.Vec(e.Int32),before_proposal:e.Opt(r),limit:e.Nat32,exclude_topic:e.Vec(e.Int32),include_status:e.Vec(e.Int32)}),Kt=e.Record({proposal_info:e.Vec($)}),X=e.Record({created_neuron_id:e.Opt(r)}),Ht=e.Record({refreshed_neuron_id:e.Opt(r)}),Wt=e.Record({target_neuron:e.Opt(T),source_neuron:e.Opt(T),target_neuron_info:e.Opt(F),source_neuron_info:e.Opt(F)}),Gt=e.Record({proposal_id:e.Opt(r)}),jt=e.Record({maturity_e8s:e.Nat64,staked_maturity_e8s:e.Nat64}),zt=e.Record({merged_maturity_e8s:e.Nat64,new_stake_e8s:e.Nat64}),Jt=e.Record({transfer_block_height:e.Nat64}),$t=e.Variant({Error:p,Spawn:X,Split:X,Follow:e.Record({}),ClaimOrRefresh:Ht,Configure:e.Record({}),RegisterVote:e.Record({}),Merge:Wt,DisburseToNeuron:X,MakeProposal:Gt,StakeMaturity:jt,MergeMaturity:zt,Disburse:Jt}),ge=e.Record({command:e.Opt($t)}),Xt=e.Record({sns_governance_canister_id:e.Opt(e.Principal)}),Yt=e.Variant({Committed:Xt,Aborted:e.Record({})}),Qt=e.Record({result:e.Opt(Yt),open_sns_token_swap_proposal_id:e.Opt(e.Nat64)}),Zt=e.Record({reward_account:e.Opt(n)});return e.Service({claim_gtc_neurons:e.Func([e.Principal,e.Vec(r)],[V],[]),claim_or_refresh_neuron_from_account:e.Func([ie],[Ct],[]),get_build_metadata:e.Func([],[e.Text],["query"]),get_full_neuron:e.Func([e.Nat64],[Ne],["query"]),get_full_neuron_by_id_or_subaccount:e.Func([z],[Ne],["query"]),get_latest_reward_event:e.Func([],[w],["query"]),get_metrics:e.Func([],[Mt],["query"]),get_monthly_node_provider_rewards:e.Func([],[At],[]),get_most_recent_monthly_node_provider_rewards:e.Func([],[e.Opt(m)],["query"]),get_network_economics_parameters:e.Func([],[f],["query"]),get_neuron_ids:e.Func([],[e.Vec(e.Nat64)],["query"]),get_neuron_info:e.Func([e.Nat64],[ye],["query"]),get_neuron_info_by_id_or_subaccount:e.Func([z],[ye],["query"]),get_node_provider_by_caller:e.Func([e.Null],[Et],["query"]),get_pending_proposals:e.Func([],[e.Vec($)],["query"]),get_proposal_info:e.Func([e.Nat64],[e.Opt($)],["query"]),list_known_neurons:e.Func([],[Vt],["query"]),list_neurons:e.Func([Ft],[Bt],["query"]),list_node_providers:e.Func([],[qt],["query"]),list_proposals:e.Func([Ut],[Kt],["query"]),manage_neuron:e.Func([J],[ge],[]),settle_community_fund_participation:e.Func([Qt],[V],[]),simulate_manage_neuron:e.Func([J],[ge],[]),transfer_gtc_neuron:e.Func([r,r],[V],[]),update_node_provider:e.Func([Zt],[V],[])})};import{Principal as Z}from"@dfinity/principal";import{arrayBufferToUint8Array as Cn,toNullable as te}from"@dfinity/utils";var Me=class extends Error{},Ae=class extends Me{},Ee=class extends Me{constructor(r){super();this.minimumAmount=r}},U=class extends Error{},P=class extends Error{constructor(r){super();this.detail=r}},ve=class extends Error{},R=class extends Error{constructor(t){super("Unsupported value: "+t)}},Ve=class extends Error{};var dr=Oe(sr()),Jr=Oe(Rr());import{asciiStringToByteArray as kn,bigEndianCrc32 as Tn,uint8ArrayToHexString as Pn}from"@dfinity/utils";var $r=e=>Uint8Array.from(dr.Buffer.from(e,"hex")).subarray(4),Xr=e=>dr.Buffer.from(e).toString("hex"),Yr=(e,t)=>{let r=kn(`
|
|
3
3
|
account-id`),o=Jr.sha224.create();o.update([...r,...e.toUint8Array(),...t??Array(32).fill(0)]);let n=new Uint8Array(o.array()),a=Tn(n),s=new Uint8Array([...a,...n]);return Pn(s)};var Zr=e=>({id:e}),pr=e=>({id:e}),Mn=e=>({followees:e.map(pr)}),An=e=>{if("NeuronId"in e)return{NeuronId:{id:e.NeuronId}};if("Subaccount"in e)return{Subaccount:Uint8Array.from(e.Subaccount)};throw new R(e)},Ir=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:Cn(t.payloadBytes)}}}if("ManageNeuron"in e){let t=e.ManageNeuron;return{ManageNeuron:qn(t)}}if("ApproveGenesisKyc"in e)return{ApproveGenesisKyc:{principals:e.ApproveGenesisKyc.principals.map(Z.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}}}if("RewardNodeProvider"in e){let t=e.RewardNodeProvider;return{RewardNodeProvider:{node_provider:t.nodeProvider?[Fe(t.nodeProvider)]:[],amount_e8s:t.amountE8s,reward_mode:t.rewardMode!=null?[Qr(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(r=>({node_provider:r.nodeProvider?[Fe(r.nodeProvider)]:[],amount_e8s:r.amountE8s,reward_mode:r.rewardMode!=null?[Qr(r.rewardMode)]:[]}))}}}if("AddOrRemoveNodeProvider"in e){let t=e.AddOrRemoveNodeProvider;return{AddOrRemoveNodeProvider:{change:t.change?[Fn(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(r=>[r.topic,Mn(r.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:r}=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:r===void 0?[]:[Z.fromText(r)]}}}if("OpenSnsTokenSwap"in e){let{communityFundInvestmentE8s:t,targetSwapCanisterId:r,params:o}=e.OpenSnsTokenSwap;return{OpenSnsTokenSwap:{community_fund_investment_e8s:te(t),target_swap_canister_id:te(r),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:te(o.saleDelaySeconds),neuron_basket_construction_parameters:te(o.neuronBasketConstructionParameters)}]}}}if("CreateServiceNervousSystem"in e)return e;throw new R(e)},En=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(pr)}}}if("ClaimOrRefresh"in e){let t=e.ClaimOrRefresh;return{ClaimOrRefresh:{by:t.by?[Bn(t.by)]:[]}}}if("Configure"in e){let t=e.Configure;return{Configure:{operation:t.operation?[Vn(t.operation)]:[]}}}if("RegisterVote"in e){let t=e.RegisterVote;return{RegisterVote:{vote:t.vote,proposal:t.proposal?[Zr(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?[Z.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:te(t)}}}if("MakeProposal"in e){let t=e.MakeProposal;return{MakeProposal:{url:t.url,title:[],action:t.action?[Ir(t.action)]:[],summary:t.summary}}}if("Disburse"in e){let t=e.Disburse;return{Disburse:{to_account:t.toAccountId?[lr(t.toAccountId)]:[],amount:t.amount?[Dr(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?[Z.fromText(t.newController)]:[],nonce:[]}}}if("Merge"in e){let t=e.Merge;return{Merge:{source_neuron_id:t.sourceNeuronId?[{id:t.sourceNeuronId}]:[]}}}throw new R(e)},Vn=e=>{if("RemoveHotKey"in e){let t=e.RemoveHotKey;return{RemoveHotKey:{hot_key_to_remove:t.hotKeyToRemove!=null?[Z.fromText(t.hotKeyToRemove)]:[]}}}if("AddHotKey"in e){let t=e.AddHotKey;return{AddHotKey:{new_hot_key:t.newHotKey?[Z.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 R(e)},Fn=e=>{if("ToRemove"in e)return{ToRemove:Fe(e.ToRemove)};if("ToAdd"in e)return{ToAdd:Fe(e.ToAdd)};throw new R(e)},Fe=e=>({id:e.id!=null?[Z.fromText(e.id)]:[],reward_account:e.rewardAccount!=null?[lr(e.rewardAccount)]:[]}),Dr=e=>({e8s:e}),lr=e=>({hash:$r(e)}),Qr=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?[lr(e.RewardToAccount.toAccount)]:[]}};throw new R(e)},Bn=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 R(e)},Lr=e=>({neuron_ids:BigUint64Array.from(e??[]),include_neurons_readable_by_caller:!e}),qn=({id:e,command:t,neuronIdOrSubaccount:r})=>({id:e?[pr(e)]:[],command:t?[En(t)]:[],neuron_id_or_subaccount:r?[An(r)]:[]}),eo=({includeRewardStatus:e,beforeProposal:t,excludeTopic:r,includeStatus:o,limit:n})=>({include_reward_status:Int32Array.from(e),before_proposal:t?[Zr(t)]:[],limit:n,exclude_topic:Int32Array.from(r),include_status:Int32Array.from(o)}),to=e=>({id:[],command:[{ClaimOrRefresh:{by:[{NeuronIdOrSubaccount:{}}]}}],neuron_id_or_subaccount:[{NeuronId:{id:e.neuronId}}]}),ro=({memo:e,controller:t})=>{let r={ClaimOrRefresh:{by:[{MemoAndController:{controller:t==null?[]:[t],memo:e}}]}};return{id:[],command:[r],neuron_id_or_subaccount:[]}},oo=({neuronId:e,amount:t})=>({id:[],command:[{Split:{amount_e8s:t}}],neuron_id_or_subaccount:[{NeuronId:{id:e}}]});var no=({neuronId:e,vote:t,proposalId:r})=>W({neuronId:e,command:{RegisterVote:{vote:t,proposal:[{id:r}]}}}),ao=e=>{let t={MakeProposal:{url:e.url,title:e.title!=null?[e.title]:[],summary:e.summary,action:[Ir(e.action)]}};return{id:[],command:[t],neuron_id_or_subaccount:[{NeuronId:{id:e.neuronId}}]}},so=({neuronId:e,topic:t,followees:r})=>W({neuronId:e,command:{Follow:{topic:t,followees:r.map(o=>({id:o}))}}}),io=({neuronId:e,toAccountIdentifier:t,amount:r})=>W({neuronId:e,command:{Disburse:{to_account:t!==void 0?[t.toAccountIdentifierHash()]:[],amount:r!==void 0?[Dr(r)]:[]}}}),co=({neuronId:e,percentageToMerge:t})=>W({neuronId:e,command:{MergeMaturity:{percentage_to_merge:t}}}),uo=({neuronId:e,percentageToStake:t})=>W({neuronId:e,command:{StakeMaturity:{percentage_to_stake:te(t)}}}),po=({neuronId:e,percentageToSpawn:t,newController:r,nonce:o})=>W({neuronId:e,command:{Spawn:{percentage_to_spawn:t===void 0?[]:[t],new_controller:r===void 0?[]:[r],nonce:o===void 0?[]:[o]}}}),lo=({neuronId:e,principal:t})=>K({neuronId:e,operation:{AddHotKey:{new_hot_key:[t]}}}),_o=({neuronId:e,principal:t})=>K({neuronId:e,operation:{RemoveHotKey:{hot_key_to_remove:[t]}}}),mo=({neuronId:e,additionalDissolveDelaySeconds:t})=>K({neuronId:e,operation:{IncreaseDissolveDelay:{additional_dissolve_delay_seconds:t}}}),fo=({neuronId:e,dissolveDelaySeconds:t})=>K({neuronId:e,operation:{SetDissolveTimestamp:{dissolve_timestamp_seconds:BigInt(t)}}}),wo=e=>K({neuronId:e,operation:{JoinCommunityFund:{}}}),No=({neuronId:e,autoStake:t})=>K({neuronId:e,operation:{ChangeAutoStakeMaturity:{requested_setting_for_auto_stake_maturity:t}}}),yo=e=>K({neuronId:e,operation:{LeaveCommunityFund:{}}}),_r=({sourceNeuronId:e,targetNeuronId:t})=>W({neuronId:t,command:{Merge:{source_neuron_id:[{id:e}]}}}),go=e=>K({neuronId:e,operation:{StartDissolving:{}}}),Ro=e=>K({neuronId:e,operation:{StopDissolving:{}}}),W=({neuronId:e,command:t})=>({id:[{id:e}],command:[t],neuron_id_or_subaccount:[]}),K=({neuronId:e,operation:t})=>W({neuronId:e,command:{Configure:{operation:[t]}}});import{Principal as mr}from"@dfinity/principal";var vo=async e=>{let{PrincipalId:t,ManageNeuron:r,NeuronId:o}=await O(),n=new t;n.setSerializedId(mr.fromText(e.principal).toUint8Array());let a=new r.AddHotKey;a.setNewHotKey(n);let s=new r.Configure;s.setAddHotKey(a);let c=new r;c.setConfigure(s);let d=new o;return d.setId(e.neuronId.toString()),c.setNeuronId(d),c},ho=async e=>{let{PrincipalId:t,ManageNeuron:r,NeuronId:o}=await O(),n=new t;n.setSerializedId(mr.fromText(e.principal).toUint8Array());let a=new r.RemoveHotKey;a.setHotKeyToRemove(n);let s=new r.Configure;s.setRemoveHotKey(a);let c=new r;c.setConfigure(s);let d=new o;return d.setId(e.neuronId.toString()),c.setNeuronId(d),c},Oo=async({neuronId:e,additionalDissolveDelaySeconds:t})=>{let{ManageNeuron:r,NeuronId:o}=await O(),n=new r.IncreaseDissolveDelay;n.setAdditionalDissolveDelaySeconds(t);let a=new r.Configure;a.setIncreaseDissolveDelay(n);let s=new r;s.setConfigure(a);let c=new o;return c.setId(e.toString()),s.setNeuronId(c),s},So=async e=>{let{ManageNeuron:t,NeuronId:r}=await O(),o=new t.Configure;o.setStartDissolving(new t.StartDissolving);let n=new t;n.setConfigure(o);let a=new r;return a.setId(e.toString()),n.setNeuronId(a),n},xo=async e=>{let{ManageNeuron:t,NeuronId:r}=await O(),o=new t.Configure;o.setStopDissolving(new t.StopDissolving);let n=new t;n.setConfigure(o);let a=new r;return a.setId(e.toString()),n.setNeuronId(a),n},bo=async e=>{let{ManageNeuron:t,NeuronId:r}=await O(),o=new t.Configure;o.setJoinCommunityFund(new t.JoinCommunityFund);let n=new t;n.setConfigure(o);let a=new r;return a.setId(e.toString()),n.setNeuronId(a),n},ko=async e=>{let{ManageNeuron:t,NeuronId:r,AccountIdentifier:o}=await O(),n=new t.Disburse;if(e.toAccountId){let c=new o;c.setHash(Uint8Array.from(Buffer.from(e.toAccountId,"hex"))),n.setToAccount(c)}if(e.amount!=null){let c=new t.Disburse.Amount;c.setE8s(e.amount.toString()),n.setAmount(c)}let a=new t;a.setDisburse(n);let s=new r;return s.setId(e.neuronId.toString()),a.setNeuronId(s),a},To=async e=>{let{ManageNeuron:t,NeuronId:r}=await O(),o=new t.MergeMaturity;o.setPercentageToMerge(e.percentageToMerge);let n=new t,a=new r;return a.setId(e.neuronId.toString()),n.setNeuronId(a),n.setMergeMaturity(o),n},Po=async e=>{let{ManageNeuron:t,NeuronId:r,PrincipalId:o}=await O(),n=new t.Spawn;if(e.newController){let c=new o;c.setSerializedId(mr.fromText(e.newController).toUint8Array().slice(4)),n.setNewController(c)}e.percentageToSpawn!==void 0&&n.setPercentageToSpawn(e.percentageToSpawn);let a=new t;a.setSpawn(n);let s=new r;return s.setId(e.neuronId.toString()),a.setNeuronId(s),a};import{Principal as jn}from"@dfinity/principal";import{fromNullable as H,uint8ArrayToArrayOfNumber as zn}from"@dfinity/utils";var Co=(a=>(a[a.Unspecified=0]="Unspecified",a[a.Locked=1]="Locked",a[a.Dissolving=2]="Dissolving",a[a.Dissolved=3]="Dissolved",a[a.Spawning=4]="Spawning",a))(Co||{}),Un=(p=>(p[p.Unspecified=0]="Unspecified",p[p.ManageNeuron=1]="ManageNeuron",p[p.ExchangeRate=2]="ExchangeRate",p[p.NetworkEconomics=3]="NetworkEconomics",p[p.Governance=4]="Governance",p[p.NodeAdmin=5]="NodeAdmin",p[p.ParticipantManagement=6]="ParticipantManagement",p[p.SubnetManagement=7]="SubnetManagement",p[p.NetworkCanisterManagement=8]="NetworkCanisterManagement",p[p.Kyc=9]="Kyc",p[p.NodeProviderRewards=10]="NodeProviderRewards",p[p.SnsDecentralizationSale=11]="SnsDecentralizationSale",p[p.SubnetReplicaVersionManagement=12]="SubnetReplicaVersionManagement",p[p.ReplicaVersionManagement=13]="ReplicaVersionManagement",p[p.SnsAndCommunityFund=14]="SnsAndCommunityFund",p))(Un||{}),Kn=(a=>(a[a.Unknown=0]="Unknown",a[a.AcceptVotes=1]="AcceptVotes",a[a.ReadyToSettle=2]="ReadyToSettle",a[a.Settled=3]="Settled",a[a.Ineligible=4]="Ineligible",a))(Kn||{}),Hn=(s=>(s[s.Unknown=0]="Unknown",s[s.Open=1]="Open",s[s.Rejected=2]="Rejected",s[s.Accepted=3]="Accepted",s[s.Executed=4]="Executed",s[s.Failed=5]="Failed",s))(Hn||{}),Wn=(o=>(o[o.Unspecified=0]="Unspecified",o[o.Yes=1]="Yes",o[o.No=2]="No",o))(Wn||{}),Gn=(u=>(u[u.Unspecified=0]="Unspecified",u[u.CreateSubnet=1]="CreateSubnet",u[u.AddNodeToSubnet=2]="AddNodeToSubnet",u[u.NnsCanisterInstall=3]="NnsCanisterInstall",u[u.NnsCanisterUpgrade=4]="NnsCanisterUpgrade",u[u.BlessReplicaVersion=5]="BlessReplicaVersion",u[u.RecoverSubnet=6]="RecoverSubnet",u[u.UpdateConfigOfSubnet=7]="UpdateConfigOfSubnet",u[u.AssignNoid=8]="AssignNoid",u[u.NnsRootUpgrade=9]="NnsRootUpgrade",u[u.IcpXdrConversionRate=10]="IcpXdrConversionRate",u[u.UpdateSubnetReplicaVersion=11]="UpdateSubnetReplicaVersion",u[u.ClearProvisionalWhitelist=12]="ClearProvisionalWhitelist",u[u.RemoveNodesFromSubnet=13]="RemoveNodesFromSubnet",u[u.SetAuthorizedSubnetworks=14]="SetAuthorizedSubnetworks",u[u.SetFirewallConfig=15]="SetFirewallConfig",u[u.UpdateNodeOperatorConfig=16]="UpdateNodeOperatorConfig",u[u.StopOrStartNnsCanister=17]="StopOrStartNnsCanister",u[u.RemoveNodes=18]="RemoveNodes",u[u.UninstallCode=19]="UninstallCode",u[u.UpdateNodeRewardsTable=20]="UpdateNodeRewardsTable",u[u.AddOrRemoveDataCenters=21]="AddOrRemoveDataCenters",u[u.UpdateUnassignedNodesConfig=22]="UpdateUnassignedNodesConfig",u[u.RemoveNodeOperators=23]="RemoveNodeOperators",u[u.RerouteCanisterRanges=24]="RerouteCanisterRanges",u[u.AddFirewallRules=25]="AddFirewallRules",u[u.RemoveFirewallRules=26]="RemoveFirewallRules",u[u.UpdateFirewallRules=27]="UpdateFirewallRules",u[u.PrepareCanisterMigration=28]="PrepareCanisterMigration",u[u.CompleteCanisterMigration=29]="CompleteCanisterMigration",u[u.AddSnsWasm=30]="AddSnsWasm",u[u.ChangeSubnetMembership=31]="ChangeSubnetMembership",u[u.UpdateSubnetType=32]="UpdateSubnetType",u[u.ChangeSubnetTypeAssignment=33]="ChangeSubnetTypeAssignment",u[u.UpdateSnsWasmSnsSubnetIds=34]="UpdateSnsWasmSnsSubnetIds",u[u.UpdateAllowedPrincipals=35]="UpdateAllowedPrincipals",u[u.RetireReplicaVersion=36]="RetireReplicaVersion",u[u.InsertSnsWasmUpgradePathEntries=37]="InsertSnsWasmUpgradePathEntries",u[u.UpdateElectedReplicaVersions=38]="UpdateElectedReplicaVersions",u[u.BitcoinSetConfig=39]="BitcoinSetConfig",u))(Gn||{});var fr=({neuronId:e,neuronInfo:t,rawNeuron:r,canisterId:o})=>{let n=r?Jn({neuron:r,canisterId:o}):void 0;return{neuronId:e,dissolveDelaySeconds:t.dissolve_delay_seconds,recentBallots:t.recent_ballots.map(Eo),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:n}},Jn=({neuron:e,canisterId:t})=>({id:e.id.length?G(e.id[0]):void 0,stakedMaturityE8sEquivalent:H(e.staked_maturity_e8s_equivalent),controller:e.controller.length?e.controller[0].toString():void 0,recentBallots:e.recent_ballots.map(Eo),kycVerified:e.kyc_verified,notForProfit:e.not_for_profit,cachedNeuronStake:e.cached_neuron_stake_e8s,createdTimestampSeconds:e.created_timestamp_seconds,autoStakeMaturity:H(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(r=>r.toString()),accountIdentifier:Yr(t,e.account),joinedCommunityFundTimestampSeconds:e.joined_community_fund_timestamp_seconds.length?e.joined_community_fund_timestamp_seconds[0]:void 0,dissolveState:e.dissolve_state.length?$n(e.dissolve_state[0]):void 0,spawnAtTimesSeconds:e.spawn_at_timestamp_seconds[0],followees:e.followees.map(([r,o])=>Vo({topic:r,followees:o}))}),Eo=({vote:e,proposal_id:t})=>({vote:e,proposalId:t.length?G(t[0]):void 0}),$n=e=>"DissolveDelaySeconds"in e?{DissolveDelaySeconds:e.DissolveDelaySeconds}:{WhenDissolvedTimestampSeconds:e.WhenDissolvedTimestampSeconds},Vo=({topic:e,followees:t})=>({topic:e,followees:t.followees.map(G)}),G=({id:e})=>e,Xn=e=>{if("NeuronId"in e)return{NeuronId:e.NeuronId.id};if("Subaccount"in e)return{Subaccount:zn(e.Subaccount)};throw new R(e)},Yn=({neuronId:e,ballot:t})=>{let{vote:r,voting_power:o}=t;return{neuronId:e,vote:r,votingPower:o}},Qn=({title:e,url:t,action:r,summary:o})=>({title:e.length?e[0]:void 0,url:t,action:r.length?Fo(r[0]):void 0,summary:o}),Fo=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?G(t.id[0]):void 0,command:t.command.length?In(t.command[0]):void 0,neuronIdOrSubaccount:t.neuron_id_or_subaccount.length?Xn(t.neuron_id_or_subaccount[0]):void 0}}}if("ApproveGenesisKyc"in e)return{ApproveGenesisKyc:{principals:e.ApproveGenesisKyc.principals.map(r=>r.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}}}if("RewardNodeProvider"in e){let t=e.RewardNodeProvider;return{RewardNodeProvider:{nodeProvider:t.node_provider.length?Be(t.node_provider[0]):void 0,amountE8s:t.amount_e8s,rewardMode:t.reward_mode.length?Mo(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(r=>({nodeProvider:r.node_provider.length?Be(r.node_provider[0]):void 0,amountE8s:r.amount_e8s,rewardMode:r.reward_mode.length?Mo(r.reward_mode[0]):void 0}))}}}if("AddOrRemoveNodeProvider"in e){let t=e.AddOrRemoveNodeProvider;return{AddOrRemoveNodeProvider:{change:t.change.length?Ln(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(([r,o])=>Vo({topic:r,followees:o}))}};if("RegisterKnownNeuron"in e){let t=e.RegisterKnownNeuron;return{RegisterKnownNeuron:ra(t)}}if("SetSnsTokenSwapOpenTimeWindow"in e){let t=e.SetSnsTokenSwapOpenTimeWindow,r=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:r,swapCanisterId:o}}}if("OpenSnsTokenSwap"in e){let t=e.OpenSnsTokenSwap,r=H(t.params);return{OpenSnsTokenSwap:{communityFundInvestmentE8s:H(t.community_fund_investment_e8s),targetSwapCanisterId:H(t.target_swap_canister_id),...r!==void 0&&{params:{minParticipantIcpE8s:r.min_participant_icp_e8s,maxIcpE8s:r.max_icp_e8s,swapDueTimestampSeconds:r.swap_due_timestamp_seconds,minParticipants:r.min_participants,snsTokenE8s:r.sns_token_e8s,maxParticipantIcpE8s:r.max_participant_icp_e8s,minIcpE8s:r.min_icp_e8s,saleDelaySeconds:H(r.sale_delay_seconds),neuronBasketConstructionParameters:H(r.neuron_basket_construction_parameters)}}}}}if("CreateServiceNervousSystem"in e)return e;throw new R(e)},Zn=e=>({no:e.no,yes:e.yes,total:e.total,timestampSeconds:e.timestamp_seconds}),In=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(G)}}}if("ClaimOrRefresh"in e){let t=e.ClaimOrRefresh;return{ClaimOrRefresh:{by:t.by.length?ta(t.by[0]):void 0}}}if("Configure"in e){let t=e.Configure;return{Configure:{operation:t.operation.length?Dn(t.operation[0]):void 0}}}if("RegisterVote"in e){let t=e.RegisterVote;return{RegisterVote:{vote:t.vote,proposal:t.proposal.length?G(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:H(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?Fo(t.action[0]):void 0,summary:t.summary}}}if("Disburse"in e){let t=e.Disburse;return{Disburse:{toAccountId:t.to_account.length?wr(t.to_account[0]):void 0,amount:t.amount.length?ea(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 R(e)},Dn=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 R(e)},Ln=e=>{if("ToRemove"in e)return{ToRemove:Be(e.ToRemove)};if("ToAdd"in e)return{ToAdd:Be(e.ToAdd)};throw new R(e)},Be=e=>({id:e.id.length?e.id[0].toString():void 0,rewardAccount:e.reward_account.length?wr(e.reward_account[0]):void 0}),ea=e=>e.e8s,wr=e=>Xr(new Uint8Array(e.hash)),Mo=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?wr(e.RewardToAccount.to_account[0]):void 0}};throw new R(e)},ta=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 R(e)},Nr=e=>({id:e.id.length?G(e.id[0]):void 0,ballots:e.ballots.map(t=>Yn({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:H(e.deadline_timestamp_seconds),decidedTimestampSeconds:e.decided_timestamp_seconds,proposal:e.proposal.length?Qn(e.proposal[0]):void 0,proposer:e.proposer.length?G(e.proposer[0]):void 0,latestTally:e.latest_tally.length?Zn(e.latest_tally[0]):void 0,executedTimestampSeconds:e.executed_timestamp_seconds,topic:e.topic,status:e.status,rewardStatus:e.reward_status}),Bo=({response:{neuron_infos:e,full_neurons:t},canisterId:r})=>e.map(([o,n])=>fr({neuronId:o,neuronInfo:n,rawNeuron:t.find(a=>a.id.length&&a.id[0].id===o),canisterId:r})),qo=({proposal_info:e})=>({proposals:e.map(Nr)}),ra=({id:e,known_neuron_data:t})=>({id:e[0]?.id??BigInt(0),name:t[0]?.name??"",description:t[0]?.description[0]??""}),Uo=e=>{let t=e.getProposalId();return{vote:e.getVote(),proposalId:t!==void 0?BigInt(t.getId()):void 0}},oa=e=>e?.hasWhenDissolvedTimestampSeconds()?2:e?.hasDissolveDelaySeconds()?e.getDissolveDelaySeconds()==="0"?3:1:0,na=e=>e.toArray().map(([t,r])=>({topic:Number(t),followees:r.getFolloweesList?.().map(o=>BigInt(o.getId()))??[]})),Ao=e=>jn.fromUint8Array(e.getSerializedId_asU8()).toText(),aa=({neuron:e,canisterId:t})=>{let r=xe.fromBytes(e.getAccount_asU8());return I.fromPrincipal({principal:t,subAccount:r})},sa=({pbNeuron:e,pbNeuronInfo:t,canisterId:r})=>{let o=e.getId(),n=e.getController(),a=n===void 0?n:Ao(n),s;return e.hasWhenDissolvedTimestampSeconds()?s={WhenDissolvedTimestampSeconds:BigInt(e.getWhenDissolvedTimestampSeconds())}:e.hasDissolveDelaySeconds()&&(s={DissolveDelaySeconds:BigInt(e.getDissolveDelaySeconds())}),{id:o===void 0?void 0:BigInt(o.getId()),stakedMaturityE8sEquivalent:void 0,controller:a,recentBallots:t.getRecentBallotsList().map(Uo),kycVerified:e.getKycVerified(),notForProfit:e.getNotForProfit(),cachedNeuronStake:BigInt(e.getCachedNeuronStakeE8s()),createdTimestampSeconds:BigInt(e.getCreatedTimestampSeconds()),autoStakeMaturity:void 0,maturityE8sEquivalent:BigInt(e.getMaturityE8sEquivalent()),agingSinceTimestampSeconds:BigInt(e.getAgingSinceTimestampSeconds()),spawnAtTimesSeconds:e.hasSpawnAtTimestampSeconds()?BigInt(e.getSpawnAtTimestampSeconds()):void 0,neuronFees:BigInt(e.getNeuronFeesE8s()),hotKeys:e.getHotKeysList().map(Ao),accountIdentifier:aa({neuron:e,canisterId:r}).toHex(),joinedCommunityFundTimestampSeconds:void 0,dissolveState:s,followees:na(e.getFolloweesMap())}},Ko=({pbNeurons:e,canisterId:t})=>r=>{let o=e.find(a=>a.getId()?.getId()===r.getKey()),n=r.getValue();if(n===void 0)throw new Error(`NeuronInfo not present for neuron ${r.getKey()}`);return{neuronId:BigInt(r.getKey()),dissolveDelaySeconds:BigInt(n.getDissolveDelaySeconds()),recentBallots:n.getRecentBallotsList().map(Uo),createdTimestampSeconds:BigInt(n.getCreatedTimestampSeconds()),state:oa(o),joinedCommunityFundTimestampSeconds:void 0,retrievedAtTimestampSeconds:BigInt(n.getRetrievedAtTimestampSeconds()),votingPower:BigInt(n.getVotingPower()),ageSeconds:BigInt(n.getAgeSeconds()),fullNeuron:o===void 0?void 0:sa({pbNeuron:o,pbNeuronInfo:n,canisterId:t})}};var Ho=async e=>{let{ManageNeuronResponse:t}=await O(),o=t.deserializeBinary(e).getError();if(o)throw new P({error_message:o.getErrorMessage(),error_type:o.getErrorType()})};var he=e=>{let{command:t}=e,r=t[0];if(!r)throw new P({error_message:"Error updating neuron",error_type:0});if("Error"in r)throw new P(r.Error);return r},v=async({request:e,service:t})=>{let r=await t.manage_neuron(e);he(r)},Wo=async({request:e,service:t})=>{let r=await t.simulate_manage_neuron(e);return he(r)};import{bigEndianCrc32 as ia}from"@dfinity/utils";var yr=e=>{if(e.length!=64)throw new ve(`Invalid account identifier ${e}. The account identifier must be 64 chars in length.`);let t=Buffer.from(e,"hex"),r=t.slice(0,4),o=Buffer.from(ia(t.slice(4)));if(!o.equals(r))throw new ve(`Account identifier ${e} has an invalid checksum. Are you sure the account identifier is correct?
|
|
4
4
|
|
|
5
5
|
Expected checksum: ${o.toString("hex")}
|
|
@@ -17,4 +17,4 @@ buffer/index.js:
|
|
|
17
17
|
* @license MIT
|
|
18
18
|
*)
|
|
19
19
|
*/
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-NC5VQ5HX.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as a}from"./chunk-
|
|
1
|
+
import{s as a}from"./chunk-NC5VQ5HX.js";import"./chunk-35ZY5H5F.js";import"./chunk-P5P36EQW.js";import"./chunk-DGJWOAUC.js";import"./chunk-GNYECLYF.js";import"./chunk-Q3ETFEQV.js";export{a as GovernanceCanister};
|
|
2
2
|
//# sourceMappingURL=governance.canister.js.map
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-3ZQTZKH7.js";import{a as v,b as P,c as b,d as y,e as B,f as S,g as C,h as g,i as w,j as T,k as _,l as A,m as G,n as V,o as W,p as h,q as k,r as D,s as m}from"./chunk-
|
|
1
|
+
import{a as u}from"./chunk-3ZQTZKH7.js";import{a as v,b as P,c as b,d as y,e as B,f as S,g as C,h as g,i as w,j as T,k as _,l as A,m as G,n as V,o as W,p as h,q as k,r as D,s as m}from"./chunk-NC5VQ5HX.js";import{b as d,c as i}from"./chunk-35ZY5H5F.js";import{a as I}from"./chunk-TLCILTIJ.js";import{a as R,b as j,c as q,d as z,e as H,f as J,g as K,h as M,i as Q,j as c}from"./chunk-LR5VHO3M.js";import{a as x}from"./chunk-EGPZQYQK.js";import"./chunk-P5P36EQW.js";import{a as E,b as F,c as L,d as O}from"./chunk-ASECNG3R.js";import"./chunk-DGJWOAUC.js";import"./chunk-GNYECLYF.js";import"./chunk-Q3ETFEQV.js";var f=({recentBallots:e,proposalId:o})=>o?e.find(({proposalId:n})=>n===o)?.vote:void 0,N=({neurons:e,proposal:o})=>{let{ballots:r,proposalTimestampSeconds:n}=o;return e.filter(({createdTimestampSeconds:t,neuronId:s})=>{let p=t>n,a=r.find(({neuronId:l})=>l===s)===void 0;return p||a})},U=({neurons:e,proposal:o})=>{let{id:r}=o;return e.filter(({recentBallots:n,neuronId:t})=>f({recentBallots:n,proposalId:r})===void 0&&N({neurons:e,proposal:o}).find(({neuronId:s})=>s===t)===void 0)},X=({neurons:e,proposal:{id:o}})=>e.filter(({recentBallots:r})=>f({recentBallots:r,proposalId:o})!==void 0);export{d as AccountIdentifier,K as BadFeeError,P as CouldNotClaimNeuronError,g as FeatureNotSupportedError,E as FromStringToTokenError,u as GenesisTokenCanister,m as GovernanceCanister,B as GovernanceError,I as ICP,L as ICPToken,b as InsufficientAmountError,q as InsufficientFundsError,S as InvalidAccountIDError,j as InvalidSenderError,c as LedgerCanister,A as NeuronState,k as NnsFunction,V as ProposalRewardStatus,W as ProposalStatus,x as SnsWasmCanister,v as StakeNeuronError,i as SubAccount,O as TokenAmount,G as Topic,R as TransferError,H as TxCreatedInFutureError,J as TxDuplicateError,z as TxTooOldError,y as UnrecognizedTypeError,C as UnsupportedValueError,h as Vote,T as accountIdentifierFromBytes,w as accountIdentifierToBytes,D as checkAccountId,F as convertStringToE8s,N as ineligibleNeurons,M as mapTransferError,Q as mapTransferProtoError,_ as principalToAccountIdentifier,U as votableNeurons,X as votedNeurons};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dfinity/nns",
|
|
3
|
-
"version": "0.16.2
|
|
3
|
+
"version": "0.16.2",
|
|
4
4
|
"description": "A library for interfacing with the Internet Computer's Network Nervous System.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/cjs/index.cjs.js",
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"network-nervous-system"
|
|
52
52
|
],
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@dfinity/agent": "
|
|
55
|
-
"@dfinity/candid": "
|
|
56
|
-
"@dfinity/nns-proto": "
|
|
57
|
-
"@dfinity/principal": "
|
|
58
|
-
"@dfinity/utils": "
|
|
54
|
+
"@dfinity/agent": "^0.15.4",
|
|
55
|
+
"@dfinity/candid": "^0.15.4",
|
|
56
|
+
"@dfinity/nns-proto": "^0.0.3",
|
|
57
|
+
"@dfinity/principal": "^0.15.4",
|
|
58
|
+
"@dfinity/utils": "^0.0.17"
|
|
59
59
|
}
|
|
60
|
-
}
|
|
60
|
+
}
|
|
File without changes
|
|
File without changes
|