@dfinity/sns 3.7.1 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/candid/sns_governance.certified.idl.js +41 -16
- package/dist/candid/sns_governance.d.ts +20 -0
- package/dist/candid/sns_governance.did +26 -1
- package/dist/candid/sns_governance.idl.js +41 -16
- package/dist/candid/sns_governance_test.certified.idl.js +41 -16
- package/dist/candid/sns_governance_test.d.ts +20 -0
- package/dist/candid/sns_governance_test.did +26 -1
- package/dist/candid/sns_governance_test.idl.js +41 -16
- package/dist/candid/sns_root.certified.idl.js +39 -3
- package/dist/candid/sns_root.d.ts +28 -0
- package/dist/candid/sns_root.did +34 -1
- package/dist/candid/sns_root.idl.js +39 -3
- package/dist/candid/sns_swap.certified.idl.js +11 -0
- package/dist/candid/sns_swap.d.ts +11 -0
- package/dist/candid/sns_swap.did +13 -1
- package/dist/candid/sns_swap.idl.js +11 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/index.cjs.js.map +4 -4
- package/dist/esm/chunk-2I22CLP7.js +7 -0
- package/dist/esm/chunk-2I22CLP7.js.map +7 -0
- package/dist/esm/chunk-4E6G4JED.js +2 -0
- package/dist/esm/chunk-4E6G4JED.js.map +7 -0
- package/dist/esm/chunk-EYIWJ4DL.js +2 -0
- package/dist/esm/chunk-EYIWJ4DL.js.map +7 -0
- package/dist/esm/{chunk-HZ2HBDQO.js → chunk-FRCSR552.js} +2 -2
- package/dist/esm/chunk-QXELTIRL.js +2 -0
- package/dist/esm/chunk-QXELTIRL.js.map +7 -0
- package/dist/esm/governance.canister.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +3 -3
- package/dist/esm/root.canister.js +1 -1
- package/dist/esm/sns.js +1 -1
- package/dist/esm/sns.wrapper.js +1 -1
- package/dist/esm/swap.canister.js +1 -1
- package/package.json +4 -4
- package/dist/esm/chunk-GDLCZEM5.js +0 -2
- package/dist/esm/chunk-GDLCZEM5.js.map +0 -7
- package/dist/esm/chunk-IMCH2CXJ.js +0 -2
- package/dist/esm/chunk-IMCH2CXJ.js.map +0 -7
- package/dist/esm/chunk-Q5AEWMZX.js +0 -7
- package/dist/esm/chunk-Q5AEWMZX.js.map +0 -7
- package/dist/esm/chunk-RABWAJNE.js +0 -2
- package/dist/esm/chunk-RABWAJNE.js.map +0 -7
- /package/dist/esm/{chunk-HZ2HBDQO.js.map → chunk-FRCSR552.js.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{a as g}from"./chunk-4INNMFYU.js";import{bigIntToUint8Array as W,toNullable as U}from"@dfinity/utils";import{arrayOfNumberToUint8Array as O,asciiStringToByteArray as M,numberToUint8Array as V}from"@dfinity/utils";function F(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function P(t,...e){if(!F(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function A(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function C(t,e){P(t);let r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function b(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function S(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function h(t,e){return t<<32-e|t>>>e}function E(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function I(t){return typeof t=="string"&&(t=E(t)),P(t),t}var y=class{};function T(t){let e=s=>t().update(I(s)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function _(t,e,r,s){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,s);let n=BigInt(32),o=BigInt(4294967295),i=Number(r>>n&o),a=Number(r&o),f=s?4:0,u=s?0:4;t.setUint32(e+f,i,s),t.setUint32(e+u,a,s)}function H(t,e,r){return t&e^~t&r}function k(t,e,r){return t&e^t&r^e&r}var w=class extends y{constructor(e,r,s,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=r,this.padOffset=s,this.isLE=n,this.buffer=new Uint8Array(e),this.view=S(this.buffer)}update(e){A(this),e=I(e),P(e);let{view:r,buffer:s,blockLen:n}=this,o=e.length;for(let i=0;i<o;){let a=Math.min(n-this.pos,o-i);if(a===n){let f=S(e);for(;n<=o-i;i+=n)this.process(f,i);continue}s.set(e.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===n&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){A(this),C(e,this),this.finished=!0;let{buffer:r,view:s,blockLen:n,isLE:o}=this,{pos:i}=this;r[i++]=128,b(this.buffer.subarray(i)),this.padOffset>n-i&&(this.process(s,0),i=0);for(let c=i;c<n;c++)r[c]=0;_(s,n-8,BigInt(this.length*8),o),this.process(s,0);let a=S(e),f=this.outputLen;if(f%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let u=f/4,x=this.get();if(u>x.length)throw new Error("_sha2: outputLen bigger than state");for(let c=0;c<u;c++)a.setUint32(4*c,x[c],o)}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let s=e.slice(0,r);return this.destroy(),s}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:r,buffer:s,length:n,finished:o,destroyed:i,pos:a}=this;return e.destroyed=i,e.finished=o,e.length=n,e.pos=a,n%r&&e.buffer.set(s),e}clone(){return this._cloneInto()}},d=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);var R=Uint32Array.from([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]),l=new Uint32Array(64),N=class extends w{constructor(e=32){super(64,e,8,!1),this.A=d[0]|0,this.B=d[1]|0,this.C=d[2]|0,this.D=d[3]|0,this.E=d[4]|0,this.F=d[5]|0,this.G=d[6]|0,this.H=d[7]|0}get(){let{A:e,B:r,C:s,D:n,E:o,F:i,G:a,H:f}=this;return[e,r,s,n,o,i,a,f]}set(e,r,s,n,o,i,a,f){this.A=e|0,this.B=r|0,this.C=s|0,this.D=n|0,this.E=o|0,this.F=i|0,this.G=a|0,this.H=f|0}process(e,r){for(let c=0;c<16;c++,r+=4)l[c]=e.getUint32(r,!1);for(let c=16;c<64;c++){let p=l[c-15],m=l[c-2],B=h(p,7)^h(p,18)^p>>>3,v=h(m,17)^h(m,19)^m>>>10;l[c]=v+l[c-7]+B+l[c-16]|0}let{A:s,B:n,C:o,D:i,E:a,F:f,G:u,H:x}=this;for(let c=0;c<64;c++){let p=h(a,6)^h(a,11)^h(a,25),m=x+p+H(a,f,u)+R[c]+l[c]|0,v=(h(s,2)^h(s,13)^h(s,22))+k(s,n,o)|0;x=u,u=f,f=a,a=i+m|0,i=o,o=n,n=s,s=m+v|0}s=s+this.A|0,n=n+this.B|0,o=o+this.C|0,i=i+this.D|0,a=a+this.E|0,f=f+this.F|0,u=u+this.G|0,x=x+this.H|0,this.set(s,n,o,i,a,f,u,x)}roundClean(){b(l)}destroy(){this.set(0,0,0,0,0,0,0,0),b(this.buffer)}};var L=T(()=>new N);var D=({index:t,controller:e})=>{let s=[12,...M("neuron-stake"),...e.toUint8Array(),...V(t)],n=L.create();return n.update(O(s)),n.digest()};var G=class{root;governance;ledger;swap;index;certified;constructor({root:e,governance:r,ledger:s,swap:n,index:o,certified:i}){this.root=e,this.governance=r,this.ledger=s,this.swap=n,this.index=o,this.certified=i}get canisterIds(){return{rootCanisterId:this.root.canisterId,ledgerCanisterId:this.ledger.canisterId,governanceCanisterId:this.governance.canisterId,swapCanisterId:this.swap.canisterId,indexCanisterId:this.index.canisterId}}listNeurons=e=>this.governance.listNeurons(this.mergeParams(e));listProposals=e=>this.governance.listProposals(this.mergeParams(e));getProposal=e=>this.governance.getProposal(this.mergeParams(e));listNervousSystemFunctions=e=>this.governance.listNervousSystemFunctions(this.mergeParams(e));metadata=e=>Promise.all([this.governance.metadata(this.mergeParams(e)),this.ledger.metadata(this.mergeParams(e))]);nervousSystemParameters=e=>this.governance.nervousSystemParameters(this.mergeParams(e));ledgerMetadata=e=>this.ledger.metadata(this.mergeParams(e));transactionFee=e=>this.ledger.transactionFee(this.mergeParams(e));totalTokensSupply=e=>this.ledger.totalTokensSupply(this.mergeParams(e));balance=e=>this.ledger.balance(this.mergeParams(e));transfer=e=>this.ledger.transfer(e);getNeuron=e=>this.governance.getNeuron(this.mergeParams(e));queryNeuron=e=>this.governance.queryNeuron(this.mergeParams(e));nextNeuronAccount=async e=>{for(let r=0;r<65536;r++){let s=D({index:r,controller:e}),n={id:s},o=await this.governance.queryNeuron({neuronId:n,certified:!1});if(o===void 0&&(o=await this.governance.queryNeuron({neuronId:n,certified:!0}),o===void 0))return{account:{...this.owner,subaccount:s},index:BigInt(r)}}throw new g("No more neuron accounts available")};stakeNeuron=async({stakeE8s:e,source:r,controller:s,createdAt:n,fee:o})=>{this.assertCertified("stakeNeuron");let{account:i,index:a}=await this.nextNeuronAccount(s);if(i.subaccount===void 0)throw new g("There was an error creating the neuron subaccount");return await this.ledger.transfer({amount:e,to:{owner:i.owner,subaccount:U(i.subaccount)},from_subaccount:r.subaccount,memo:W(a),created_at_time:n,fee:o}),this.governance.claimNeuron({memo:BigInt(a),controller:s,subaccount:i.subaccount})};increaseStakeNeuron=async({stakeE8s:e,source:r,neuronId:s})=>(this.assertCertified("stakeNeuron"),await this.ledger.transfer({amount:e,to:{...this.owner,subaccount:U(Uint8Array.from(s.id))},from_subaccount:r.subaccount}),this.governance.refreshNeuron(s));getNeuronBalance=e=>{let r={...this.owner,subaccount:Uint8Array.from(e.id)};return this.ledger.balance({...r,certified:this.certified})};addNeuronPermissions=e=>this.governance.addNeuronPermissions(e);refreshNeuron=e=>this.governance.refreshNeuron(e);claimNeuron=e=>this.governance.claimNeuron(e);removeNeuronPermissions=e=>this.governance.removeNeuronPermissions(e);splitNeuron=e=>this.governance.splitNeuron(e);disburse=e=>this.governance.disburse(e);startDissolving=e=>this.governance.startDissolving(e);stopDissolving=e=>this.governance.stopDissolving(e);setDissolveTimestamp=e=>this.governance.setDissolveTimestamp(e);increaseDissolveDelay=e=>this.governance.increaseDissolveDelay(e);setTopicFollowees=e=>this.governance.setTopicFollowees(e);setFollowing=e=>this.governance.setFollowing(e);registerVote=e=>this.governance.registerVote(e);swapState=e=>this.swap.state(this.mergeParams(e));notifyPaymentFailure=()=>this.swap.notifyPaymentFailure();notifyParticipation=e=>this.swap.notifyParticipation(e);getUserCommitment=e=>this.swap.getUserCommitment(this.mergeParams(e));getOpenTicket=e=>this.swap.getOpenTicket(this.mergeParams(e));newSaleTicket=e=>this.swap.newSaleTicket(e);getLifecycle=e=>this.swap.getLifecycle(this.mergeParams(e));getFinalizationStatus=e=>this.swap.getFinalizationStatus(this.mergeParams(e));getSaleParameters=e=>this.swap.getSaleParameters(this.mergeParams(e));getDerivedState=e=>this.swap.getDerivedState(this.mergeParams(e));getTransactions=e=>this.index.getTransactions(e);stakeMaturity=e=>this.governance.stakeMaturity(e);disburseMaturity=e=>this.governance.disburseMaturity(e);autoStakeMaturity=e=>this.governance.autoStakeMaturity(e);mergeParams(e){return{...e,certified:this.certified}}assertCertified=e=>{if(!this.certified)throw new g(`Call to ${e} needs to be certified`)};get owner(){return{owner:this.canisterIds.governanceCanisterId}}};export{D as a,G as b};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@noble/hashes/esm/utils.js:
|
|
5
|
+
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
6
|
+
*/
|
|
7
|
+
//# sourceMappingURL=chunk-2I22CLP7.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/sns.wrapper.ts", "../../src/utils/governance.utils.ts", "../../node_modules/@noble/hashes/src/utils.ts", "../../node_modules/@noble/hashes/src/_md.ts", "../../node_modules/@noble/hashes/src/sha2.ts"],
|
|
4
|
+
"sourcesContent": ["import type {\n BalanceParams,\n GetAccountTransactionsParams,\n IcrcAccount,\n IcrcBlockIndex,\n IcrcGetTransactions,\n IcrcIndexCanister,\n IcrcLedgerCanister,\n IcrcTokenMetadataResponse,\n IcrcTokens,\n TransferParams,\n} from \"@dfinity/ledger-icrc\";\nimport type { Principal } from \"@dfinity/principal\";\nimport {\n bigIntToUint8Array,\n toNullable,\n type QueryParams,\n} from \"@dfinity/utils\";\nimport type {\n GetMetadataResponse,\n ListNervousSystemFunctionsResponse,\n ListProposalsResponse,\n NervousSystemParameters,\n Neuron,\n NeuronId,\n ProposalData,\n} from \"../candid/sns_governance\";\nimport type {\n BuyerState,\n GetAutoFinalizationStatusResponse,\n GetBuyerStateRequest,\n GetDerivedStateResponse,\n GetLifecycleResponse,\n GetSaleParametersResponse,\n GetStateResponse,\n RefreshBuyerTokensRequest,\n RefreshBuyerTokensResponse,\n Ticket,\n} from \"../candid/sns_swap\";\nimport { MAX_NEURONS_SUBACCOUNTS } from \"./constants/governance.constants\";\nimport { SnsGovernanceError } from \"./errors/governance.errors\";\nimport type { SnsGovernanceCanister } from \"./governance.canister\";\nimport type { SnsRootCanister } from \"./root.canister\";\nimport type { SnsSwapCanister } from \"./swap.canister\";\nimport type {\n SnsClaimNeuronParams,\n SnsDisburseNeuronParams,\n SnsGetNeuronParams,\n SnsGetProposalParams,\n SnsIncreaseDissolveDelayParams,\n SnsIncreaseStakeNeuronParams,\n SnsListNeuronsParams,\n SnsListProposalsParams,\n SnsNeuronAutoStakeMaturityParams,\n SnsNeuronDisburseMaturityParams,\n SnsNeuronPermissionsParams,\n SnsNeuronStakeMaturityParams,\n SnsRegisterVoteParams,\n SnsSetDissolveTimestampParams,\n SnsSetFollowingParams,\n SnsSetTopicFollowees,\n SnsSplitNeuronParams,\n SnsStakeNeuronParams,\n} from \"./types/governance.params\";\nimport type { NewSaleTicketParams } from \"./types/swap.params\";\nimport { neuronSubaccount } from \"./utils/governance.utils\";\n\ninterface SnsWrapperOptions {\n /** The wrapper for the \"root\" canister of the particular Sns */\n root: SnsRootCanister;\n /** The wrapper for the \"governance\" canister of the particular Sns */\n governance: SnsGovernanceCanister;\n /** The wrapper for the \"ledger\" canister of the particular Sns */\n ledger: IcrcLedgerCanister;\n /** The wrapper for the \"swap\" canister of the particular Sns */\n swap: SnsSwapCanister;\n /** The wrapper for the \"index\" canister of the particular Sns */\n index: IcrcIndexCanister;\n\n /** The wrapper has been instantiated and should perform query or update calls */\n certified: boolean;\n}\n\n/**\n * Sns wrapper - notably used by NNS-dapp - ease the access to a particular Sns.\n * It knows all the Sns' canisters, wrap and enhance their available features.\n * A wrapper either performs query or update calls.\n */\nexport class SnsWrapper {\n private readonly root: SnsRootCanister;\n private readonly governance: SnsGovernanceCanister;\n private readonly ledger: IcrcLedgerCanister;\n private readonly swap: SnsSwapCanister;\n private readonly index: IcrcIndexCanister;\n private readonly certified: boolean;\n\n /**\n * Constructor to instantiate a Sns\n */\n constructor({\n root,\n governance,\n ledger,\n swap,\n index,\n certified,\n }: SnsWrapperOptions) {\n this.root = root;\n this.governance = governance;\n this.ledger = ledger;\n this.swap = swap;\n this.index = index;\n this.certified = certified;\n }\n\n /**\n * Binds the list of canister ids of the Sns.\n */\n get canisterIds(): {\n rootCanisterId: Principal;\n ledgerCanisterId: Principal;\n governanceCanisterId: Principal;\n swapCanisterId: Principal;\n indexCanisterId: Principal;\n } {\n return {\n rootCanisterId: this.root.canisterId,\n ledgerCanisterId: this.ledger.canisterId,\n governanceCanisterId: this.governance.canisterId,\n swapCanisterId: this.swap.canisterId,\n indexCanisterId: this.index.canisterId,\n };\n }\n\n listNeurons = (\n params: Omit<SnsListNeuronsParams, \"certified\">,\n ): Promise<Neuron[]> => this.governance.listNeurons(this.mergeParams(params));\n\n listProposals = (\n params: Omit<SnsListProposalsParams, \"certified\">,\n ): Promise<ListProposalsResponse> =>\n this.governance.listProposals(this.mergeParams(params));\n\n getProposal = (\n params: Omit<SnsGetProposalParams, \"certified\">,\n ): Promise<ProposalData> =>\n this.governance.getProposal(this.mergeParams(params));\n\n listNervousSystemFunctions = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<ListNervousSystemFunctionsResponse> =>\n this.governance.listNervousSystemFunctions(this.mergeParams(params));\n\n metadata = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<[GetMetadataResponse, IcrcTokenMetadataResponse]> =>\n Promise.all([\n this.governance.metadata(this.mergeParams(params)),\n this.ledger.metadata(this.mergeParams(params)),\n ]);\n\n nervousSystemParameters = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<NervousSystemParameters> =>\n this.governance.nervousSystemParameters(this.mergeParams(params));\n\n ledgerMetadata = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<IcrcTokenMetadataResponse> =>\n this.ledger.metadata(this.mergeParams(params));\n\n transactionFee = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<IcrcTokens> =>\n this.ledger.transactionFee(this.mergeParams(params));\n\n totalTokensSupply = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<IcrcTokens> =>\n this.ledger.totalTokensSupply(this.mergeParams(params));\n\n balance = (params: Omit<BalanceParams, \"certified\">): Promise<IcrcTokens> =>\n this.ledger.balance(this.mergeParams(params));\n\n // Always certified\n transfer = (params: TransferParams): Promise<IcrcBlockIndex> =>\n this.ledger.transfer(params);\n\n getNeuron = (\n params: Omit<SnsGetNeuronParams, \"certified\">,\n ): Promise<Neuron> => this.governance.getNeuron(this.mergeParams(params));\n\n queryNeuron = (\n params: Omit<SnsGetNeuronParams, \"certified\">,\n ): Promise<Neuron | undefined> =>\n this.governance.queryNeuron(this.mergeParams(params));\n\n /**\n * Returns the subaccount of the next neuron to be created.\n *\n * The neuron account is a subaccount of the governance canister.\n * The subaccount is derived from the controller and an ascending index.\n *\n * \u203C\uFE0F The id of the neuron is the subaccount (neuron ID = subaccount) \u203C\uFE0F.\n *\n * If the neuron does not exist for that subaccount, then we use it for the next neuron.\n *\n * The index is used in the memo of the transfer and when claiming the neuron.\n * This is how the backend can identify which neuron is being claimed.\n *\n * @param controller\n * @returns\n */\n nextNeuronAccount = async (\n controller: Principal,\n ): Promise<{ account: IcrcAccount; index: bigint }> => {\n // TODO: try parallilizing requests to improve performance\n // OR use binary search https://dfinity.atlassian.net/browse/FOLLOW-825\n for (let index = 0; index < MAX_NEURONS_SUBACCOUNTS; index++) {\n const subaccount = neuronSubaccount({ index, controller });\n\n const neuronId: NeuronId = { id: subaccount };\n let neuron = await this.governance.queryNeuron({\n neuronId,\n certified: false,\n });\n if (neuron === undefined) {\n // Recheck with update call whether the neuron does not exist\n neuron = await this.governance.queryNeuron({\n neuronId,\n certified: true,\n });\n // If the neuron does not exist, we can use this subaccount\n if (neuron === undefined) {\n return {\n account: {\n ...this.owner,\n subaccount,\n },\n index: BigInt(index),\n };\n }\n }\n }\n throw new SnsGovernanceError(\"No more neuron accounts available\");\n };\n\n /**\n * Stakes a neuron.\n *\n * This is a convenient method that transfers the stake to the neuron subaccount and then claims the neuron.\n *\n * \u26A0\uFE0F This feature is provided as it without warranty. It does not implement any additional checks of the validity of the payment flow - e.g. it does not handle refund nor retries claiming the neuron in case of errors.\n *\n * @param {SnsStakeNeuronParams} params\n * @param {Principal} params.controller\n * @param {bigint} params.stakeE8s\n * @param {source} params.source\n * @returns {NeuronId}\n */\n stakeNeuron = async ({\n stakeE8s,\n source,\n controller,\n createdAt,\n fee,\n }: SnsStakeNeuronParams): Promise<NeuronId> => {\n this.assertCertified(\"stakeNeuron\");\n const { account: neuronAccount, index } =\n await this.nextNeuronAccount(controller);\n // This should not happen. The neuron account is always a subaccount of the SNS governance canister.\n if (neuronAccount.subaccount === undefined) {\n throw new SnsGovernanceError(\n \"There was an error creating the neuron subaccount\",\n );\n }\n await this.ledger.transfer({\n amount: stakeE8s,\n to: {\n owner: neuronAccount.owner,\n subaccount: toNullable(neuronAccount.subaccount),\n },\n from_subaccount: source.subaccount,\n memo: bigIntToUint8Array(index),\n created_at_time: createdAt,\n fee,\n });\n return this.governance.claimNeuron({\n memo: BigInt(index),\n controller,\n subaccount: neuronAccount.subaccount,\n });\n };\n\n /**\n * Increase the stake of a neuron.\n *\n * This is a convenient method that transfers the stake to the neuron subaccount and then refresh the neuron.\n *\n * \u26A0\uFE0F This feature is provided as it without warranty. It does not implement any additional checks of the validity of the payment flow - e.g. it does not handle refund nor calls refresh again in case of errors.\n *\n * @param {SnsStakeNeuronParams} params\n * @param {Principal} params.controller\n * @param {bigint} params.stakeE8s\n * @param {source} params.source\n * @returns {NeuronId}\n */\n increaseStakeNeuron = async ({\n stakeE8s,\n source,\n neuronId,\n }: SnsIncreaseStakeNeuronParams): Promise<void> => {\n this.assertCertified(\"stakeNeuron\");\n\n await this.ledger.transfer({\n amount: stakeE8s,\n to: {\n ...this.owner,\n subaccount: toNullable(Uint8Array.from(neuronId.id)),\n },\n from_subaccount: source.subaccount,\n });\n\n return this.governance.refreshNeuron(neuronId);\n };\n\n getNeuronBalance = (neuronId: NeuronId): Promise<IcrcTokens> => {\n const account = {\n ...this.owner,\n subaccount: Uint8Array.from(neuronId.id),\n };\n return this.ledger.balance({ ...account, certified: this.certified });\n };\n\n // Always certified\n addNeuronPermissions = (params: SnsNeuronPermissionsParams): Promise<void> =>\n this.governance.addNeuronPermissions(params);\n\n // Always certified\n refreshNeuron = (neuronId: NeuronId): Promise<void> =>\n this.governance.refreshNeuron(neuronId);\n\n // Always certified\n claimNeuron = (params: SnsClaimNeuronParams): Promise<NeuronId> =>\n this.governance.claimNeuron(params);\n\n // Always certified\n removeNeuronPermissions = (\n params: SnsNeuronPermissionsParams,\n ): Promise<void> => this.governance.removeNeuronPermissions(params);\n\n // Always certified\n splitNeuron = (params: SnsSplitNeuronParams): Promise<NeuronId | undefined> =>\n this.governance.splitNeuron(params);\n\n // Always certified\n disburse = (params: SnsDisburseNeuronParams): Promise<void> =>\n this.governance.disburse(params);\n\n // Always certified\n startDissolving = (neuronId: NeuronId): Promise<void> =>\n this.governance.startDissolving(neuronId);\n\n // Always certified\n stopDissolving = (neuronId: NeuronId): Promise<void> =>\n this.governance.stopDissolving(neuronId);\n\n // Always certified\n setDissolveTimestamp = (\n params: SnsSetDissolveTimestampParams,\n ): Promise<void> => this.governance.setDissolveTimestamp(params);\n\n // Always certified\n increaseDissolveDelay = (\n params: SnsIncreaseDissolveDelayParams,\n ): Promise<void> => this.governance.increaseDissolveDelay(params);\n\n // Always certified\n setTopicFollowees = (params: SnsSetTopicFollowees): Promise<void> =>\n this.governance.setTopicFollowees(params);\n\n // Always certified\n setFollowing = (params: SnsSetFollowingParams): Promise<void> =>\n this.governance.setFollowing(params);\n\n // Always certified\n registerVote = (params: SnsRegisterVoteParams): Promise<void> =>\n this.governance.registerVote(params);\n\n swapState = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<GetStateResponse> => this.swap.state(this.mergeParams(params));\n\n /**\n * Returns the ticket if a ticket was found for the caller and the ticket\n * was removed successfully. Returns None if no ticket was found for the caller.\n * Only the owner of a ticket can remove it.\n *\n * Always certified\n *\n * @param params\n */\n notifyPaymentFailure = (): Promise<Ticket | undefined> =>\n this.swap.notifyPaymentFailure();\n\n // Always certified\n notifyParticipation = (\n params: RefreshBuyerTokensRequest,\n ): Promise<RefreshBuyerTokensResponse> =>\n this.swap.notifyParticipation(params);\n\n getUserCommitment = (\n params: GetBuyerStateRequest,\n ): Promise<BuyerState | undefined> =>\n this.swap.getUserCommitment(this.mergeParams(params));\n\n getOpenTicket = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<Ticket | undefined> =>\n this.swap.getOpenTicket(this.mergeParams(params));\n\n // Always certified\n newSaleTicket = (params: NewSaleTicketParams): Promise<Ticket> =>\n this.swap.newSaleTicket(params);\n\n getLifecycle = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<GetLifecycleResponse | undefined> =>\n this.swap.getLifecycle(this.mergeParams(params));\n\n getFinalizationStatus = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<GetAutoFinalizationStatusResponse | undefined> =>\n this.swap.getFinalizationStatus(this.mergeParams(params));\n\n getSaleParameters = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<GetSaleParametersResponse | undefined> =>\n this.swap.getSaleParameters(this.mergeParams(params));\n\n getDerivedState = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<GetDerivedStateResponse | undefined> =>\n this.swap.getDerivedState(this.mergeParams(params));\n\n // Always certified\n getTransactions = (\n params: GetAccountTransactionsParams,\n ): Promise<IcrcGetTransactions> => this.index.getTransactions(params);\n\n // Always certified\n stakeMaturity = (params: SnsNeuronStakeMaturityParams): Promise<void> =>\n this.governance.stakeMaturity(params);\n\n // Always certified\n disburseMaturity = (params: SnsNeuronDisburseMaturityParams): Promise<void> =>\n this.governance.disburseMaturity(params);\n\n // Always certified\n autoStakeMaturity = (\n params: SnsNeuronAutoStakeMaturityParams,\n ): Promise<void> => this.governance.autoStakeMaturity(params);\n\n private mergeParams<T>(params: T): QueryParams & T {\n return {\n ...params,\n certified: this.certified,\n };\n }\n\n private assertCertified = (name: string): void => {\n if (!this.certified) {\n throw new SnsGovernanceError(`Call to ${name} needs to be certified`);\n }\n };\n\n /**\n * Each Sns neuron id is a subaccount of the related Sns ledger account of the Sns governance canister.\n *\n * In other words, the Sns governance canister is the owner. It has an account in the related Sns ledger and each neuron is both a child of the Sns governance canister and a subaccount in the Sns ledger.\n *\n * @private\n */\n private get owner(): IcrcAccount {\n return {\n owner: this.canisterIds.governanceCanisterId,\n };\n }\n}\n", "import type { IcrcSubaccount } from \"@dfinity/ledger-icrc\";\nimport type { Principal } from \"@dfinity/principal\";\nimport {\n arrayOfNumberToUint8Array,\n asciiStringToByteArray,\n numberToUint8Array,\n} from \"@dfinity/utils\";\nimport { sha256 } from \"@noble/hashes/sha2\";\n\n/**\n * Neuron subaccount is calculated as \"sha256(0x0c . \u201Cneuron-stake\u201D . controller . i)\"\n *\n * @param params\n * @param {Principal} params.newController\n * @param {number} params.index\n * @returns\n */\nexport const neuronSubaccount = ({\n index,\n controller,\n}: {\n index: number;\n controller: Principal;\n}): IcrcSubaccount => {\n const padding = asciiStringToByteArray(\"neuron-stake\");\n const data = [\n 0x0c,\n ...padding,\n ...controller.toUint8Array(),\n ...numberToUint8Array(index),\n ];\n // TODO(#238): Implement without library and make it compatible with NodeJS and browser\n const shaObj = sha256.create();\n shaObj.update(arrayOfNumberToUint8Array(data));\n return shaObj.digest();\n};\n", "/**\n * Utilities for hex, bytes, CSPRNG.\n * @module\n */\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated (2025-04-30), we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\n\n/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */\nexport function isBytes(a: unknown): a is Uint8Array {\n return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\n\n/** Asserts something is positive integer. */\nexport function anumber(n: number): void {\n if (!Number.isSafeInteger(n) || n < 0) throw new Error('positive integer expected, got ' + n);\n}\n\n/** Asserts something is Uint8Array. */\nexport function abytes(b: Uint8Array | undefined, ...lengths: number[]): void {\n if (!isBytes(b)) throw new Error('Uint8Array expected');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length);\n}\n\n/** Asserts something is hash */\nexport function ahash(h: IHash): void {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new Error('Hash should be wrapped by utils.createHasher');\n anumber(h.outputLen);\n anumber(h.blockLen);\n}\n\n/** Asserts a hash instance has not been destroyed / finished */\nexport function aexists(instance: any, checkFinished = true): void {\n if (instance.destroyed) throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished) throw new Error('Hash#digest() has already been called');\n}\n\n/** Asserts output is properly-sized byte array */\nexport function aoutput(out: any, instance: any): void {\n abytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error('digestInto() expects output buffer of length at least ' + min);\n }\n}\n\n/** Generic type encompassing 8/16/32-byte arrays - but not 64-byte. */\n// prettier-ignore\nexport type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array |\n Uint16Array | Int16Array | Uint32Array | Int32Array;\n\n/** Cast u8 / u16 / u32 to u8. */\nexport function u8(arr: TypedArray): Uint8Array {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n\n/** Cast u8 / u16 / u32 to u32. */\nexport function u32(arr: TypedArray): Uint32Array {\n return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n\n/** Zeroize a byte array. Warning: JS provides no guarantees. */\nexport function clean(...arrays: TypedArray[]): void {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n\n/** Create DataView of an array for easy byte-level manipulation. */\nexport function createView(arr: TypedArray): DataView {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n\n/** The rotate right (circular right shift) operation for uint32 */\nexport function rotr(word: number, shift: number): number {\n return (word << (32 - shift)) | (word >>> shift);\n}\n\n/** The rotate left (circular left shift) operation for uint32 */\nexport function rotl(word: number, shift: number): number {\n return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n\n/** Is current platform little-endian? Most are. Big-Endian platform: IBM */\nexport const isLE: boolean = /* @__PURE__ */ (() =>\n new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\n\n/** The byte swap operation for uint32 */\nexport function byteSwap(word: number): number {\n return (\n ((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff)\n );\n}\n/** Conditionally byte swap if on a big-endian platform */\nexport const swap8IfBE: (n: number) => number = isLE\n ? (n: number) => n\n : (n: number) => byteSwap(n);\n\n/** @deprecated */\nexport const byteSwapIfBE: typeof swap8IfBE = swap8IfBE;\n/** In place byte swap for Uint32Array */\nexport function byteSwap32(arr: Uint32Array): Uint32Array {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = byteSwap(arr[i]);\n }\n return arr;\n}\n\nexport const swap32IfBE: (u: Uint32Array) => Uint32Array = isLE\n ? (u: Uint32Array) => u\n : byteSwap32;\n\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin: boolean = /* @__PURE__ */ (() =>\n // @ts-ignore\n typeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) =>\n i.toString(16).padStart(2, '0')\n);\n\n/**\n * Convert byte array to hex string. Uses built-in function, when available.\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes: Uint8Array): string {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin) return bytes.toHex();\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 } as const;\nfunction asciiToBase16(ch: number): number | undefined {\n if (ch >= asciis._0 && ch <= asciis._9) return ch - asciis._0; // '2' => 50-48\n if (ch >= asciis.A && ch <= asciis.F) return ch - (asciis.A - 10); // 'B' => 66-(65-10)\n if (ch >= asciis.a && ch <= asciis.f) return ch - (asciis.a - 10); // 'b' => 98-(97-10)\n return;\n}\n\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex: string): Uint8Array {\n if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex);\n // @ts-ignore\n if (hasHexBuiltin) return Uint8Array.fromHex(hex);\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2) throw new Error('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new Error('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163\n }\n return array;\n}\n\n/**\n * There is no setImmediate in browser and setTimeout is slow.\n * Call of async fn will return Promise, which will be fullfiled only on\n * next scheduler queue processing step and this is exactly what we need.\n */\nexport const nextTick = async (): Promise<void> => {};\n\n/** Returns control to thread each 'tick' ms to avoid blocking. */\nexport async function asyncLoop(\n iters: number,\n tick: number,\n cb: (i: number) => void\n): Promise<void> {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick) continue;\n await nextTick();\n ts += diff;\n }\n}\n\n// Global symbols, but ts doesn't see them: https://github.com/microsoft/TypeScript/issues/31535\ndeclare const TextEncoder: any;\ndeclare const TextDecoder: any;\n\n/**\n * Converts string to bytes using UTF8 encoding.\n * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99])\n */\nexport function utf8ToBytes(str: string): Uint8Array {\n if (typeof str !== 'string') throw new Error('string expected');\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n\n/**\n * Converts bytes to string using UTF8 encoding.\n * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc'\n */\nexport function bytesToUtf8(bytes: Uint8Array): string {\n return new TextDecoder().decode(bytes);\n}\n\n/** Accepted input of hash functions. Strings are converted to byte arrays. */\nexport type Input = string | Uint8Array;\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nexport function toBytes(data: Input): Uint8Array {\n if (typeof data === 'string') data = utf8ToBytes(data);\n abytes(data);\n return data;\n}\n\n/** KDFs can accept string or Uint8Array for user convenience. */\nexport type KDFInput = string | Uint8Array;\n/**\n * Helper for KDFs: consumes uint8array or string.\n * When string is passed, does utf8 decoding, using TextDecoder.\n */\nexport function kdfInputToBytes(data: KDFInput): Uint8Array {\n if (typeof data === 'string') data = utf8ToBytes(data);\n abytes(data);\n return data;\n}\n\n/** Copies several Uint8Arrays into one. */\nexport function concatBytes(...arrays: Uint8Array[]): Uint8Array {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n\ntype EmptyObj = {};\nexport function checkOpts<T1 extends EmptyObj, T2 extends EmptyObj>(\n defaults: T1,\n opts?: T2\n): T1 & T2 {\n if (opts !== undefined && {}.toString.call(opts) !== '[object Object]')\n throw new Error('options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged as T1 & T2;\n}\n\n/** Hash interface. */\nexport type IHash = {\n (data: Uint8Array): Uint8Array;\n blockLen: number;\n outputLen: number;\n create: any;\n};\n\n/** For runtime check if class implements interface */\nexport abstract class Hash<T extends Hash<T>> {\n abstract blockLen: number; // Bytes per block\n abstract outputLen: number; // Bytes in output\n abstract update(buf: Input): this;\n // Writes digest into buf\n abstract digestInto(buf: Uint8Array): void;\n abstract digest(): Uint8Array;\n /**\n * Resets internal state. Makes Hash instance unusable.\n * Reset is impossible for keyed hashes if key is consumed into state. If digest is not consumed\n * by user, they will need to manually call `destroy()` when zeroing is necessary.\n */\n abstract destroy(): void;\n /**\n * Clones hash instance. Unsafe: doesn't check whether `to` is valid. Can be used as `clone()`\n * when no options are passed.\n * Reasons to use `_cloneInto` instead of clone: 1) performance 2) reuse instance => all internal\n * buffers are overwritten => causes buffer overwrite which is used for digest in some cases.\n * There are no guarantees for clean-up because it's impossible in JS.\n */\n abstract _cloneInto(to?: T): T;\n // Safe version that clones internal state\n abstract clone(): T;\n}\n\n/**\n * XOF: streaming API to read digest in chunks.\n * Same as 'squeeze' in keccak/k12 and 'seek' in blake3, but more generic name.\n * When hash used in XOF mode it is up to user to call '.destroy' afterwards, since we cannot\n * destroy state, next call can require more bytes.\n */\nexport type HashXOF<T extends Hash<T>> = Hash<T> & {\n xof(bytes: number): Uint8Array; // Read 'bytes' bytes from digest stream\n xofInto(buf: Uint8Array): Uint8Array; // read buf.length bytes from digest stream into buf\n};\n\n/** Hash function */\nexport type CHash = ReturnType<typeof createHasher>;\n/** Hash function with output */\nexport type CHashO = ReturnType<typeof createOptHasher>;\n/** XOF with output */\nexport type CHashXO = ReturnType<typeof createXOFer>;\n\n/** Wraps hash function, creating an interface on top of it */\nexport function createHasher<T extends Hash<T>>(\n hashCons: () => Hash<T>\n): {\n (msg: Input): Uint8Array;\n outputLen: number;\n blockLen: number;\n create(): Hash<T>;\n} {\n const hashC = (msg: Input): Uint8Array => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\n\nexport function createOptHasher<H extends Hash<H>, T extends Object>(\n hashCons: (opts?: T) => Hash<H>\n): {\n (msg: Input, opts?: T): Uint8Array;\n outputLen: number;\n blockLen: number;\n create(opts?: T): Hash<H>;\n} {\n const hashC = (msg: Input, opts?: T): Uint8Array => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({} as T);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts?: T) => hashCons(opts);\n return hashC;\n}\n\nexport function createXOFer<H extends HashXOF<H>, T extends Object>(\n hashCons: (opts?: T) => HashXOF<H>\n): {\n (msg: Input, opts?: T): Uint8Array;\n outputLen: number;\n blockLen: number;\n create(opts?: T): HashXOF<H>;\n} {\n const hashC = (msg: Input, opts?: T): Uint8Array => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({} as T);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts?: T) => hashCons(opts);\n return hashC;\n}\nexport const wrapConstructor: typeof createHasher = createHasher;\nexport const wrapConstructorWithOpts: typeof createOptHasher = createOptHasher;\nexport const wrapXOFConstructorWithOpts: typeof createXOFer = createXOFer;\n\n/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */\nexport function randomBytes(bytesLength = 32): Uint8Array {\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n // Legacy Node.js compatibility\n if (crypto && typeof crypto.randomBytes === 'function') {\n return Uint8Array.from(crypto.randomBytes(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n", "/**\n * Internal Merkle-Damgard hash utils.\n * @module\n */\nimport { type Input, Hash, abytes, aexists, aoutput, clean, createView, toBytes } from './utils.ts';\n\n/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */\nexport function setBigUint64(\n view: DataView,\n byteOffset: number,\n value: bigint,\n isLE: boolean\n): void {\n if (typeof view.setBigUint64 === 'function') return view.setBigUint64(byteOffset, value, isLE);\n const _32n = BigInt(32);\n const _u32_max = BigInt(0xffffffff);\n const wh = Number((value >> _32n) & _u32_max);\n const wl = Number(value & _u32_max);\n const h = isLE ? 4 : 0;\n const l = isLE ? 0 : 4;\n view.setUint32(byteOffset + h, wh, isLE);\n view.setUint32(byteOffset + l, wl, isLE);\n}\n\n/** Choice: a ? b : c */\nexport function Chi(a: number, b: number, c: number): number {\n return (a & b) ^ (~a & c);\n}\n\n/** Majority function, true if any two inputs is true. */\nexport function Maj(a: number, b: number, c: number): number {\n return (a & b) ^ (a & c) ^ (b & c);\n}\n\n/**\n * Merkle-Damgard hash construction base class.\n * Could be used to create MD5, RIPEMD, SHA1, SHA2.\n */\nexport abstract class HashMD<T extends HashMD<T>> extends Hash<T> {\n protected abstract process(buf: DataView, offset: number): void;\n protected abstract get(): number[];\n protected abstract set(...args: number[]): void;\n abstract destroy(): void;\n protected abstract roundClean(): void;\n\n readonly blockLen: number;\n readonly outputLen: number;\n readonly padOffset: number;\n readonly isLE: boolean;\n\n // For partial updates less than block size\n protected buffer: Uint8Array;\n protected view: DataView;\n protected finished = false;\n protected length = 0;\n protected pos = 0;\n protected destroyed = false;\n\n constructor(blockLen: number, outputLen: number, padOffset: number, isLE: boolean) {\n super();\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data: Input): this {\n aexists(this);\n data = toBytes(data);\n abytes(data);\n const { view, buffer, blockLen } = this;\n const len = data.length;\n for (let pos = 0; pos < len; ) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path: we have at least one block in input, cast it to view and process\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen) this.process(dataView, pos);\n continue;\n }\n buffer.set(data.subarray(pos, pos + take), this.pos);\n this.pos += take;\n pos += take;\n if (this.pos === blockLen) {\n this.process(view, 0);\n this.pos = 0;\n }\n }\n this.length += data.length;\n this.roundClean();\n return this;\n }\n digestInto(out: Uint8Array): void {\n aexists(this);\n aoutput(out, this);\n this.finished = true;\n // Padding\n // We can avoid allocation of buffer for padding completely if it\n // was previously not allocated here. But it won't change performance.\n const { buffer, view, blockLen, isLE } = this;\n let { pos } = this;\n // append the bit '1' to the message\n buffer[pos++] = 0b10000000;\n clean(this.buffer.subarray(pos));\n // we have less than padOffset left in buffer, so we cannot put length in\n // current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n pos = 0;\n }\n // Pad until full block byte with zeros\n for (let i = pos; i < blockLen; i++) buffer[i] = 0;\n // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that\n // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.\n // So we just write lowest 64 bits of that value.\n setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);\n this.process(view, 0);\n const oview = createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT\n if (len % 4) throw new Error('_sha2: outputLen should be aligned to 32bit');\n const outLen = len / 4;\n const state = this.get();\n if (outLen > state.length) throw new Error('_sha2: outputLen bigger than state');\n for (let i = 0; i < outLen; i++) oview.setUint32(4 * i, state[i], isLE);\n }\n digest(): Uint8Array {\n const { buffer, outputLen } = this;\n this.digestInto(buffer);\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneInto(to?: T): T {\n to ||= new (this.constructor as any)() as T;\n to.set(...this.get());\n const { blockLen, buffer, length, finished, destroyed, pos } = this;\n to.destroyed = destroyed;\n to.finished = finished;\n to.length = length;\n to.pos = pos;\n if (length % blockLen) to.buffer.set(buffer);\n return to;\n }\n clone(): T {\n return this._cloneInto();\n }\n}\n\n/**\n * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.\n * Check out `test/misc/sha2-gen-iv.js` for recomputation guide.\n */\n\n/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */\nexport const SHA256_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\n\n/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */\nexport const SHA224_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,\n]);\n\n/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */\nexport const SHA384_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([\n 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4,\n]);\n\n/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */\nexport const SHA512_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,\n]);\n", "/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and\n * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).\n * @module\n */\nimport { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from './_md.ts';\nimport * as u64 from './_u64.ts';\nimport { type CHash, clean, createHasher, rotr } from './utils.ts';\n\n/**\n * Round constants:\n * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311)\n */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n\n/** Reusable temporary buffer. \"W\" comes straight from spec. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\nexport class SHA256 extends HashMD<SHA256> {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n protected A: number = SHA256_IV[0] | 0;\n protected B: number = SHA256_IV[1] | 0;\n protected C: number = SHA256_IV[2] | 0;\n protected D: number = SHA256_IV[3] | 0;\n protected E: number = SHA256_IV[4] | 0;\n protected F: number = SHA256_IV[5] | 0;\n protected G: number = SHA256_IV[6] | 0;\n protected H: number = SHA256_IV[7] | 0;\n\n constructor(outputLen: number = 32) {\n super(64, outputLen, 8, false);\n }\n protected get(): [number, number, number, number, number, number, number, number] {\n const { A, B, C, D, E, F, G, H } = this;\n return [A, B, C, D, E, F, G, H];\n }\n // prettier-ignore\n protected set(\n A: number, B: number, C: number, D: number, E: number, F: number, G: number, H: number\n ): void {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n this.E = E | 0;\n this.F = F | 0;\n this.G = G | 0;\n this.H = H | 0;\n }\n protected process(view: DataView, offset: number): void {\n // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) SHA256_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 64; i++) {\n const W15 = SHA256_W[i - 15];\n const W2 = SHA256_W[i - 2];\n const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3);\n const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10);\n SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;\n }\n // Compression function main loop, 64 rounds\n let { A, B, C, D, E, F, G, H } = this;\n for (let i = 0; i < 64; i++) {\n const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);\n const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);\n const T2 = (sigma0 + Maj(A, B, C)) | 0;\n H = G;\n G = F;\n F = E;\n E = (D + T1) | 0;\n D = C;\n C = B;\n B = A;\n A = (T1 + T2) | 0;\n }\n // Add the compressed chunk to the current hash value\n A = (A + this.A) | 0;\n B = (B + this.B) | 0;\n C = (C + this.C) | 0;\n D = (D + this.D) | 0;\n E = (E + this.E) | 0;\n F = (F + this.F) | 0;\n G = (G + this.G) | 0;\n H = (H + this.H) | 0;\n this.set(A, B, C, D, E, F, G, H);\n }\n protected roundClean(): void {\n clean(SHA256_W);\n }\n destroy(): void {\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n\nexport class SHA224 extends SHA256 {\n protected A: number = SHA224_IV[0] | 0;\n protected B: number = SHA224_IV[1] | 0;\n protected C: number = SHA224_IV[2] | 0;\n protected D: number = SHA224_IV[3] | 0;\n protected E: number = SHA224_IV[4] | 0;\n protected F: number = SHA224_IV[5] | 0;\n protected G: number = SHA224_IV[6] | 0;\n protected H: number = SHA224_IV[7] | 0;\n constructor() {\n super(28);\n }\n}\n\n// SHA2-512 is slower than sha256 in js because u64 operations are slow.\n\n// Round contants\n// First 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409\n// prettier-ignore\nconst K512 = /* @__PURE__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\nconst SHA512_Kh = /* @__PURE__ */ (() => K512[0])();\nconst SHA512_Kl = /* @__PURE__ */ (() => K512[1])();\n\n// Reusable temporary buffers\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\n\nexport class SHA512 extends HashMD<SHA512> {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n // h -- high 32 bits, l -- low 32 bits\n protected Ah: number = SHA512_IV[0] | 0;\n protected Al: number = SHA512_IV[1] | 0;\n protected Bh: number = SHA512_IV[2] | 0;\n protected Bl: number = SHA512_IV[3] | 0;\n protected Ch: number = SHA512_IV[4] | 0;\n protected Cl: number = SHA512_IV[5] | 0;\n protected Dh: number = SHA512_IV[6] | 0;\n protected Dl: number = SHA512_IV[7] | 0;\n protected Eh: number = SHA512_IV[8] | 0;\n protected El: number = SHA512_IV[9] | 0;\n protected Fh: number = SHA512_IV[10] | 0;\n protected Fl: number = SHA512_IV[11] | 0;\n protected Gh: number = SHA512_IV[12] | 0;\n protected Gl: number = SHA512_IV[13] | 0;\n protected Hh: number = SHA512_IV[14] | 0;\n protected Hl: number = SHA512_IV[15] | 0;\n\n constructor(outputLen: number = 64) {\n super(128, outputLen, 16, false);\n }\n // prettier-ignore\n protected get(): [\n number, number, number, number, number, number, number, number,\n number, number, number, number, number, number, number, number\n ] {\n const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n }\n // prettier-ignore\n protected set(\n Ah: number, Al: number, Bh: number, Bl: number, Ch: number, Cl: number, Dh: number, Dl: number,\n Eh: number, El: number, Fh: number, Fl: number, Gh: number, Gl: number, Hh: number, Hl: number\n ): void {\n this.Ah = Ah | 0;\n this.Al = Al | 0;\n this.Bh = Bh | 0;\n this.Bl = Bl | 0;\n this.Ch = Ch | 0;\n this.Cl = Cl | 0;\n this.Dh = Dh | 0;\n this.Dl = Dl | 0;\n this.Eh = Eh | 0;\n this.El = El | 0;\n this.Fh = Fh | 0;\n this.Fl = Fl | 0;\n this.Gh = Gh | 0;\n this.Gl = Gl | 0;\n this.Hh = Hh | 0;\n this.Hl = Hl | 0;\n }\n protected process(view: DataView, offset: number): void {\n // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) {\n SHA512_W_H[i] = view.getUint32(offset);\n SHA512_W_L[i] = view.getUint32((offset += 4));\n }\n for (let i = 16; i < 80; i++) {\n // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n const W15h = SHA512_W_H[i - 15] | 0;\n const W15l = SHA512_W_L[i - 15] | 0;\n const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n const W2h = SHA512_W_H[i - 2] | 0;\n const W2l = SHA512_W_L[i - 2] | 0;\n const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n SHA512_W_H[i] = SUMh | 0;\n SHA512_W_L[i] = SUMl | 0;\n }\n let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n // Compression function main loop, 80 rounds\n for (let i = 0; i < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n const T1l = T1ll | 0;\n // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n Hh = Gh | 0;\n Hl = Gl | 0;\n Gh = Fh | 0;\n Gl = Fl | 0;\n Fh = Eh | 0;\n Fl = El | 0;\n ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n Dh = Ch | 0;\n Dl = Cl | 0;\n Ch = Bh | 0;\n Cl = Bl | 0;\n Bh = Ah | 0;\n Bl = Al | 0;\n const All = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n Al = All | 0;\n }\n // Add the compressed chunk to the current hash value\n ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n }\n protected roundClean(): void {\n clean(SHA512_W_H, SHA512_W_L);\n }\n destroy(): void {\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n }\n}\n\nexport class SHA384 extends SHA512 {\n protected Ah: number = SHA384_IV[0] | 0;\n protected Al: number = SHA384_IV[1] | 0;\n protected Bh: number = SHA384_IV[2] | 0;\n protected Bl: number = SHA384_IV[3] | 0;\n protected Ch: number = SHA384_IV[4] | 0;\n protected Cl: number = SHA384_IV[5] | 0;\n protected Dh: number = SHA384_IV[6] | 0;\n protected Dl: number = SHA384_IV[7] | 0;\n protected Eh: number = SHA384_IV[8] | 0;\n protected El: number = SHA384_IV[9] | 0;\n protected Fh: number = SHA384_IV[10] | 0;\n protected Fl: number = SHA384_IV[11] | 0;\n protected Gh: number = SHA384_IV[12] | 0;\n protected Gl: number = SHA384_IV[13] | 0;\n protected Hh: number = SHA384_IV[14] | 0;\n protected Hl: number = SHA384_IV[15] | 0;\n\n constructor() {\n super(48);\n }\n}\n\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n * See `test/misc/sha2-gen-iv.js`.\n */\n\n/** SHA512/224 IV */\nconst T224_IV = /* @__PURE__ */ Uint32Array.from([\n 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,\n 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1,\n]);\n\n/** SHA512/256 IV */\nconst T256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd,\n 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2,\n]);\n\nexport class SHA512_224 extends SHA512 {\n protected Ah: number = T224_IV[0] | 0;\n protected Al: number = T224_IV[1] | 0;\n protected Bh: number = T224_IV[2] | 0;\n protected Bl: number = T224_IV[3] | 0;\n protected Ch: number = T224_IV[4] | 0;\n protected Cl: number = T224_IV[5] | 0;\n protected Dh: number = T224_IV[6] | 0;\n protected Dl: number = T224_IV[7] | 0;\n protected Eh: number = T224_IV[8] | 0;\n protected El: number = T224_IV[9] | 0;\n protected Fh: number = T224_IV[10] | 0;\n protected Fl: number = T224_IV[11] | 0;\n protected Gh: number = T224_IV[12] | 0;\n protected Gl: number = T224_IV[13] | 0;\n protected Hh: number = T224_IV[14] | 0;\n protected Hl: number = T224_IV[15] | 0;\n\n constructor() {\n super(28);\n }\n}\n\nexport class SHA512_256 extends SHA512 {\n protected Ah: number = T256_IV[0] | 0;\n protected Al: number = T256_IV[1] | 0;\n protected Bh: number = T256_IV[2] | 0;\n protected Bl: number = T256_IV[3] | 0;\n protected Ch: number = T256_IV[4] | 0;\n protected Cl: number = T256_IV[5] | 0;\n protected Dh: number = T256_IV[6] | 0;\n protected Dl: number = T256_IV[7] | 0;\n protected Eh: number = T256_IV[8] | 0;\n protected El: number = T256_IV[9] | 0;\n protected Fh: number = T256_IV[10] | 0;\n protected Fl: number = T256_IV[11] | 0;\n protected Gh: number = T256_IV[12] | 0;\n protected Gl: number = T256_IV[13] | 0;\n protected Hh: number = T256_IV[14] | 0;\n protected Hl: number = T256_IV[15] | 0;\n\n constructor() {\n super(32);\n }\n}\n\n/**\n * SHA2-256 hash function from RFC 4634.\n *\n * It is the fastest JS hash, even faster than Blake3.\n * To break sha256 using birthday attack, attackers need to try 2^128 hashes.\n * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n */\nexport const sha256: CHash = /* @__PURE__ */ createHasher(() => new SHA256());\n/** SHA2-224 hash function from RFC 4634 */\nexport const sha224: CHash = /* @__PURE__ */ createHasher(() => new SHA224());\n\n/** SHA2-512 hash function from RFC 4634. */\nexport const sha512: CHash = /* @__PURE__ */ createHasher(() => new SHA512());\n/** SHA2-384 hash function from RFC 4634. */\nexport const sha384: CHash = /* @__PURE__ */ createHasher(() => new SHA384());\n\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexport const sha512_256: CHash = /* @__PURE__ */ createHasher(() => new SHA512_256());\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexport const sha512_224: CHash = /* @__PURE__ */ createHasher(() => new SHA512_224());\n"],
|
|
5
|
+
"mappings": "wCAaA,OACE,sBAAAA,EACA,cAAAC,MAEK,iBCfP,OACE,6BAAAC,EACA,0BAAAC,EACA,sBAAAC,MACK,iBCSD,SAAUC,EAAQC,EAAU,CAChC,OAAOA,aAAa,YAAe,YAAY,OAAOA,CAAC,GAAKA,EAAE,YAAY,OAAS,YACrF,CAQM,SAAUC,EAAOC,KAA8BC,EAAiB,CACpE,GAAI,CAACC,EAAQF,CAAC,EAAG,MAAM,IAAI,MAAM,qBAAqB,EACtD,GAAIC,EAAQ,OAAS,GAA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MAAM,KAAK,YAAYA,CAAM,CAAC,EAWxE,qBAAuB,IACrB,KAAK,KAAK,qBAAqB,EAGjC,oBACEA,GAEA,KAAK,KAAK,oBAAoBA,CAAM,EAEtC,kBACEA,GAEA,KAAK,KAAK,kBAAkB,KAAK,YAAYA,CAAM,CAAC,EAEtD,cACEA,GAEA,KAAK,KAAK,cAAc,KAAK,YAAYA,CAAM,CAAC,EAGlD,cAAiBA,GACf,KAAK,KAAK,cAAcA,CAAM,EAEhC,aACEA,GAEA,KAAK,KAAK,aAAa,KAAK,YAAYA,CAAM,CAAC,EAEjD,sBACEA,GAEA,KAAK,KAAK,sBAAsB,KAAK,YAAYA,CAAM,CAAC,EAE1D,kBACEA,GAEA,KAAK,KAAK,kBAAkB,KAAK,YAAYA,CAAM,CAAC,EAEtD,gBACEA,GAEA,KAAK,KAAK,gBAAgB,KAAK,YAAYA,CAAM,CAAC,EAGpD,gBACEA,GACiC,KAAK,MAAM,gBAAgBA,CAAM,EAGpE,cAAiBA,GACf,KAAK,WAAW,cAAcA,CAAM,EAGtC,iBAAoBA,GAClB,KAAK,WAAW,iBAAiBA,CAAM,EAGzC,kBACEA,GACkB,KAAK,WAAW,kBAAkBA,CAAM,EAEpD,YAAeA,EAA4B,CACjD,MAAO,CACL,GAAGA,EACH,UAAW,KAAK,SAClB,CACF,CAEQ,gBAAmBe,GAAuB,CAChD,GAAI,CAAC,KAAK,UACR,MAAM,IAAIT,EAAmB,WAAWS,CAAI,wBAAwB,CAExE,EASA,IAAY,OAAqB,CAC/B,MAAO,CACL,MAAO,KAAK,YAAY,oBAC1B,CACF,CACF",
|
|
6
|
+
"names": ["bigIntToUint8Array", "toNullable", "arrayOfNumberToUint8Array", "asciiStringToByteArray", "numberToUint8Array", "isBytes", "a", "abytes", "b", "lengths", "isBytes", "aexists", "instance", "checkFinished", "aoutput", "out", "abytes", "min", "clean", "arrays", "i", "createView", "arr", "rotr", "word", "shift", "utf8ToBytes", "str", "toBytes", "data", "utf8ToBytes", "abytes", "Hash", "createHasher", "hashCons", "hashC", "msg", "toBytes", "tmp", "setBigUint64", "view", "byteOffset", "value", "isLE", "_32n", "_u32_max", "wh", "wl", "h", "l", "Chi", "a", "b", "c", "Maj", "HashMD", "Hash", "blockLen", "outputLen", "padOffset", "createView", "data", "aexists", "toBytes", "abytes", "buffer", "len", "pos", "take", "dataView", "out", "aoutput", "clean", "i", "oview", "outLen", "state", "res", "to", "length", "finished", "destroyed", "SHA256_IV", "SHA256_K", "SHA256_W", "SHA256", "HashMD", "outputLen", "SHA256_IV", "A", "B", "C", "D", "E", "F", "G", "H", "view", "offset", "i", "W15", "W2", "s0", "rotr", "s1", "sigma1", "T1", "Chi", "T2", "Maj", "clean", "sha256", "createHasher", "SHA256", "neuronSubaccount", "index", "controller", "data", "asciiStringToByteArray", "numberToUint8Array", "shaObj", "sha256", "arrayOfNumberToUint8Array", "SnsWrapper", "root", "governance", "ledger", "swap", "index", "certified", "params", "controller", "subaccount", "neuronSubaccount", "neuronId", "neuron", "SnsGovernanceError", "stakeE8s", "source", "createdAt", "fee", "neuronAccount", "toNullable", "bigIntToUint8Array", "account", "name"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Canister as T,createServices as B}from"@dfinity/utils";var z=({IDL:t})=>{let s=t.Record({last_spawned_timestamp_seconds:t.Opt(t.Nat64),last_reset_timestamp_seconds:t.Opt(t.Nat64),requires_periodic_tasks:t.Opt(t.Bool)}),i=t.Record({extension_canister_ids:t.Vec(t.Principal)}),_=t.Record({dapp_canister_ids:t.Vec(t.Principal),timers:t.Opt(s),testflight:t.Bool,extensions:t.Opt(i),archive_canister_ids:t.Vec(t.Principal),governance_canister_id:t.Opt(t.Principal),index_canister_id:t.Opt(t.Principal),swap_canister_id:t.Opt(t.Principal),ledger_canister_id:t.Opt(t.Principal)}),r=t.Record({canister_id:t.Principal}),a=t.Record({wasm_binary_size:t.Opt(t.Nat),wasm_chunk_store_size:t.Opt(t.Nat),canister_history_size:t.Opt(t.Nat),stable_memory_size:t.Opt(t.Nat),snapshots_size:t.Opt(t.Nat),wasm_memory_size:t.Opt(t.Nat),global_memory_size:t.Opt(t.Nat),custom_sections_size:t.Opt(t.Nat)}),n=t.Variant({stopped:t.Null,stopping:t.Null,running:t.Null}),l=t.Variant({controllers:t.Null,public:t.Null,allowed_viewers:t.Vec(t.Principal)}),d=t.Record({freezing_threshold:t.Opt(t.Nat),wasm_memory_threshold:t.Opt(t.Nat),controllers:t.Vec(t.Principal),reserved_cycles_limit:t.Opt(t.Nat),log_visibility:t.Opt(l),wasm_memory_limit:t.Opt(t.Nat),memory_allocation:t.Opt(t.Nat),compute_allocation:t.Opt(t.Nat)}),c=t.Record({response_payload_bytes_total:t.Opt(t.Nat),num_instructions_total:t.Opt(t.Nat),num_calls_total:t.Opt(t.Nat),request_payload_bytes_total:t.Opt(t.Nat)}),m=t.Record({memory_metrics:t.Opt(a),status:n,memory_size:t.Nat,cycles:t.Nat,settings:d,query_stats:t.Opt(c),idle_cycles_burned_per_day:t.Opt(t.Nat),module_hash:t.Opt(t.Vec(t.Nat8)),reserved_cycles:t.Opt(t.Nat)}),O=t.Variant({reinstall:t.Null,upgrade:t.Null,install:t.Null}),u=t.Record({wasm_module_hash:t.Vec(t.Nat8),chunk_hashes_list:t.Vec(t.Vec(t.Nat8)),store_canister_id:t.Principal}),R=t.Record({arg:t.Vec(t.Nat8),wasm_module:t.Vec(t.Nat8),stop_before_installing:t.Bool,mode:O,canister_id:t.Principal,chunked_canister_wasm:t.Opt(u)}),N=t.Record({update_canister_list:t.Opt(t.Bool)}),y=t.Record({freezing_threshold:t.Nat,wasm_memory_threshold:t.Opt(t.Nat),controllers:t.Vec(t.Principal),wasm_memory_limit:t.Opt(t.Nat),memory_allocation:t.Nat,compute_allocation:t.Nat}),g=t.Record({memory_metrics:t.Opt(a),status:n,memory_size:t.Nat,cycles:t.Nat,settings:y,query_stats:t.Opt(c),idle_cycles_burned_per_day:t.Nat,module_hash:t.Opt(t.Vec(t.Nat8))}),e=t.Record({status:t.Opt(g),canister_id:t.Opt(t.Principal)}),h=t.Record({root:t.Opt(e),swap:t.Opt(e),ledger:t.Opt(e),index:t.Opt(e),governance:t.Opt(e),dapps:t.Vec(e),archives:t.Vec(e)}),P=t.Record({timers:t.Opt(s)}),V=t.Record({root:t.Opt(t.Principal),swap:t.Opt(t.Principal),extensions:t.Opt(i),ledger:t.Opt(t.Principal),index:t.Opt(t.Principal),governance:t.Opt(t.Principal),dapps:t.Vec(t.Principal),archives:t.Vec(t.Principal)}),C=t.Record({freezing_threshold:t.Opt(t.Nat64),wasm_memory_threshold:t.Opt(t.Nat64),canister_ids:t.Vec(t.Principal),reserved_cycles_limit:t.Opt(t.Nat64),log_visibility:t.Opt(t.Int32),wasm_memory_limit:t.Opt(t.Nat64),memory_allocation:t.Opt(t.Nat64),compute_allocation:t.Opt(t.Nat64)}),S=t.Record({failure_reason:t.Opt(t.Text)}),x=t.Record({canister_id:t.Opt(t.Principal)}),o=t.Record({canister_ids:t.Vec(t.Principal)}),w=t.Record({canister_id:t.Opt(t.Principal)}),p=t.Record({code:t.Opt(t.Int32),description:t.Text}),v=t.Variant({Ok:t.Record({}),Err:p}),F=t.Record({result:t.Opt(v)}),f=t.Record({canister_ids:t.Opt(o),controller_principal_ids:t.Vec(t.Principal)}),b=t.Record({err:t.Opt(p),dapp_canister_id:t.Opt(t.Principal)}),q=t.Record({failed_updates:t.Vec(b)});return t.Service({canister_status:t.Func([r],[m],[]),change_canister:t.Func([R],[],[]),get_build_metadata:t.Func([],[t.Text],[]),get_sns_canisters_summary:t.Func([N],[h],[]),get_timers:t.Func([t.Record({})],[P],[]),list_sns_canisters:t.Func([t.Record({})],[V],[]),manage_dapp_canister_settings:t.Func([C],[S],[]),register_dapp_canister:t.Func([x],[t.Record({})],[]),register_dapp_canisters:t.Func([o],[t.Record({})],[]),register_extension:t.Func([w],[F],[]),reset_timers:t.Func([t.Record({})],[t.Record({})],[]),set_dapp_controllers:t.Func([f],[q],[])})};var E=({IDL:t})=>{let s=t.Record({last_spawned_timestamp_seconds:t.Opt(t.Nat64),last_reset_timestamp_seconds:t.Opt(t.Nat64),requires_periodic_tasks:t.Opt(t.Bool)}),i=t.Record({extension_canister_ids:t.Vec(t.Principal)}),_=t.Record({dapp_canister_ids:t.Vec(t.Principal),timers:t.Opt(s),testflight:t.Bool,extensions:t.Opt(i),archive_canister_ids:t.Vec(t.Principal),governance_canister_id:t.Opt(t.Principal),index_canister_id:t.Opt(t.Principal),swap_canister_id:t.Opt(t.Principal),ledger_canister_id:t.Opt(t.Principal)}),r=t.Record({canister_id:t.Principal}),a=t.Record({wasm_binary_size:t.Opt(t.Nat),wasm_chunk_store_size:t.Opt(t.Nat),canister_history_size:t.Opt(t.Nat),stable_memory_size:t.Opt(t.Nat),snapshots_size:t.Opt(t.Nat),wasm_memory_size:t.Opt(t.Nat),global_memory_size:t.Opt(t.Nat),custom_sections_size:t.Opt(t.Nat)}),n=t.Variant({stopped:t.Null,stopping:t.Null,running:t.Null}),l=t.Variant({controllers:t.Null,public:t.Null,allowed_viewers:t.Vec(t.Principal)}),d=t.Record({freezing_threshold:t.Opt(t.Nat),wasm_memory_threshold:t.Opt(t.Nat),controllers:t.Vec(t.Principal),reserved_cycles_limit:t.Opt(t.Nat),log_visibility:t.Opt(l),wasm_memory_limit:t.Opt(t.Nat),memory_allocation:t.Opt(t.Nat),compute_allocation:t.Opt(t.Nat)}),c=t.Record({response_payload_bytes_total:t.Opt(t.Nat),num_instructions_total:t.Opt(t.Nat),num_calls_total:t.Opt(t.Nat),request_payload_bytes_total:t.Opt(t.Nat)}),m=t.Record({memory_metrics:t.Opt(a),status:n,memory_size:t.Nat,cycles:t.Nat,settings:d,query_stats:t.Opt(c),idle_cycles_burned_per_day:t.Opt(t.Nat),module_hash:t.Opt(t.Vec(t.Nat8)),reserved_cycles:t.Opt(t.Nat)}),O=t.Variant({reinstall:t.Null,upgrade:t.Null,install:t.Null}),u=t.Record({wasm_module_hash:t.Vec(t.Nat8),chunk_hashes_list:t.Vec(t.Vec(t.Nat8)),store_canister_id:t.Principal}),R=t.Record({arg:t.Vec(t.Nat8),wasm_module:t.Vec(t.Nat8),stop_before_installing:t.Bool,mode:O,canister_id:t.Principal,chunked_canister_wasm:t.Opt(u)}),N=t.Record({update_canister_list:t.Opt(t.Bool)}),y=t.Record({freezing_threshold:t.Nat,wasm_memory_threshold:t.Opt(t.Nat),controllers:t.Vec(t.Principal),wasm_memory_limit:t.Opt(t.Nat),memory_allocation:t.Nat,compute_allocation:t.Nat}),g=t.Record({memory_metrics:t.Opt(a),status:n,memory_size:t.Nat,cycles:t.Nat,settings:y,query_stats:t.Opt(c),idle_cycles_burned_per_day:t.Nat,module_hash:t.Opt(t.Vec(t.Nat8))}),e=t.Record({status:t.Opt(g),canister_id:t.Opt(t.Principal)}),h=t.Record({root:t.Opt(e),swap:t.Opt(e),ledger:t.Opt(e),index:t.Opt(e),governance:t.Opt(e),dapps:t.Vec(e),archives:t.Vec(e)}),P=t.Record({timers:t.Opt(s)}),V=t.Record({root:t.Opt(t.Principal),swap:t.Opt(t.Principal),extensions:t.Opt(i),ledger:t.Opt(t.Principal),index:t.Opt(t.Principal),governance:t.Opt(t.Principal),dapps:t.Vec(t.Principal),archives:t.Vec(t.Principal)}),C=t.Record({freezing_threshold:t.Opt(t.Nat64),wasm_memory_threshold:t.Opt(t.Nat64),canister_ids:t.Vec(t.Principal),reserved_cycles_limit:t.Opt(t.Nat64),log_visibility:t.Opt(t.Int32),wasm_memory_limit:t.Opt(t.Nat64),memory_allocation:t.Opt(t.Nat64),compute_allocation:t.Opt(t.Nat64)}),S=t.Record({failure_reason:t.Opt(t.Text)}),x=t.Record({canister_id:t.Opt(t.Principal)}),o=t.Record({canister_ids:t.Vec(t.Principal)}),w=t.Record({canister_id:t.Opt(t.Principal)}),p=t.Record({code:t.Opt(t.Int32),description:t.Text}),v=t.Variant({Ok:t.Record({}),Err:p}),F=t.Record({result:t.Opt(v)}),f=t.Record({canister_ids:t.Opt(o),controller_principal_ids:t.Vec(t.Principal)}),b=t.Record({err:t.Opt(p),dapp_canister_id:t.Opt(t.Principal)}),q=t.Record({failed_updates:t.Vec(b)});return t.Service({canister_status:t.Func([r],[m],[]),change_canister:t.Func([R],[],[]),get_build_metadata:t.Func([],[t.Text],["query"]),get_sns_canisters_summary:t.Func([N],[h],[]),get_timers:t.Func([t.Record({})],[P],["query"]),list_sns_canisters:t.Func([t.Record({})],[V],["query"]),manage_dapp_canister_settings:t.Func([C],[S],[]),register_dapp_canister:t.Func([x],[t.Record({})],[]),register_dapp_canisters:t.Func([o],[t.Record({})],[]),register_extension:t.Func([w],[F],[]),reset_timers:t.Func([t.Record({})],[t.Record({})],[]),set_dapp_controllers:t.Func([f],[q],[])})};var k=class t extends T{static create(s){let{service:i,certifiedService:_,canisterId:r}=B({options:s,idlFactory:E,certifiedIdlFactory:z});return new t(r,i,_)}listSnsCanisters=({certified:s=!0})=>this.caller({certified:s}).list_sns_canisters({})};export{k as a};
|
|
2
|
+
//# sourceMappingURL=chunk-4E6G4JED.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/root.canister.ts", "../../candid/sns_root.certified.idl.js", "../../candid/sns_root.idl.js"],
|
|
4
|
+
"sourcesContent": ["import { Canister, createServices } from \"@dfinity/utils\";\nimport type {\n ListSnsCanistersResponse,\n _SERVICE as SnsRootService,\n} from \"../candid/sns_root\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/sns_root.certified.idl\";\nimport { idlFactory } from \"../candid/sns_root.idl\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\n\nexport class SnsRootCanister extends Canister<SnsRootService> {\n static create(options: SnsCanisterOptions<SnsRootService>) {\n const { service, certifiedService, canisterId } =\n createServices<SnsRootService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new SnsRootCanister(canisterId, service, certifiedService);\n }\n\n /**\n * List the canisters that are part of the Sns.\n *\n * Source code: https://github.com/dfinity/ic/blob/master/rs/sns/root/src/lib.rs\n *\n * @param {Object} params\n * @param {boolean} [params.certified=true] - Query or update calls\n *\n * @returns {ListSnsCanistersResponse} - A list of canisters ('root' | 'governance' | 'ledger' | 'dapps' | 'swap' | 'archives')\n */\n listSnsCanisters = ({\n certified = true,\n }: {\n certified?: boolean;\n }): Promise<ListSnsCanistersResponse> =>\n this.caller({ certified }).list_sns_canisters({});\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_root.did */\nexport const idlFactory = ({ IDL }) => {\n const Timers = IDL.Record({\n 'last_spawned_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'last_reset_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'requires_periodic_tasks' : IDL.Opt(IDL.Bool),\n });\n const Extensions = IDL.Record({\n 'extension_canister_ids' : IDL.Vec(IDL.Principal),\n });\n const SnsRootCanister = IDL.Record({\n 'dapp_canister_ids' : IDL.Vec(IDL.Principal),\n 'timers' : IDL.Opt(Timers),\n 'testflight' : IDL.Bool,\n 'extensions' : IDL.Opt(Extensions),\n 'archive_canister_ids' : IDL.Vec(IDL.Principal),\n 'governance_canister_id' : IDL.Opt(IDL.Principal),\n 'index_canister_id' : IDL.Opt(IDL.Principal),\n 'swap_canister_id' : IDL.Opt(IDL.Principal),\n 'ledger_canister_id' : IDL.Opt(IDL.Principal),\n });\n const CanisterIdRecord = IDL.Record({ 'canister_id' : IDL.Principal });\n const MemoryMetrics = IDL.Record({\n 'wasm_binary_size' : IDL.Opt(IDL.Nat),\n 'wasm_chunk_store_size' : IDL.Opt(IDL.Nat),\n 'canister_history_size' : IDL.Opt(IDL.Nat),\n 'stable_memory_size' : IDL.Opt(IDL.Nat),\n 'snapshots_size' : IDL.Opt(IDL.Nat),\n 'wasm_memory_size' : IDL.Opt(IDL.Nat),\n 'global_memory_size' : IDL.Opt(IDL.Nat),\n 'custom_sections_size' : IDL.Opt(IDL.Nat),\n });\n const CanisterStatusType = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const LogVisibility = IDL.Variant({\n 'controllers' : IDL.Null,\n 'public' : IDL.Null,\n 'allowed_viewers' : IDL.Vec(IDL.Principal),\n });\n const DefiniteCanisterSettings = IDL.Record({\n 'freezing_threshold' : IDL.Opt(IDL.Nat),\n 'wasm_memory_threshold' : IDL.Opt(IDL.Nat),\n 'controllers' : IDL.Vec(IDL.Principal),\n 'reserved_cycles_limit' : IDL.Opt(IDL.Nat),\n 'log_visibility' : IDL.Opt(LogVisibility),\n 'wasm_memory_limit' : IDL.Opt(IDL.Nat),\n 'memory_allocation' : IDL.Opt(IDL.Nat),\n 'compute_allocation' : IDL.Opt(IDL.Nat),\n });\n const QueryStats = IDL.Record({\n 'response_payload_bytes_total' : IDL.Opt(IDL.Nat),\n 'num_instructions_total' : IDL.Opt(IDL.Nat),\n 'num_calls_total' : IDL.Opt(IDL.Nat),\n 'request_payload_bytes_total' : IDL.Opt(IDL.Nat),\n });\n const CanisterStatusResult = IDL.Record({\n 'memory_metrics' : IDL.Opt(MemoryMetrics),\n 'status' : CanisterStatusType,\n 'memory_size' : IDL.Nat,\n 'cycles' : IDL.Nat,\n 'settings' : DefiniteCanisterSettings,\n 'query_stats' : IDL.Opt(QueryStats),\n 'idle_cycles_burned_per_day' : IDL.Opt(IDL.Nat),\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'reserved_cycles' : IDL.Opt(IDL.Nat),\n });\n const CanisterInstallMode = IDL.Variant({\n 'reinstall' : IDL.Null,\n 'upgrade' : IDL.Null,\n 'install' : IDL.Null,\n });\n const ChunkedCanisterWasm = IDL.Record({\n 'wasm_module_hash' : IDL.Vec(IDL.Nat8),\n 'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),\n 'store_canister_id' : IDL.Principal,\n });\n const ChangeCanisterRequest = IDL.Record({\n 'arg' : IDL.Vec(IDL.Nat8),\n 'wasm_module' : IDL.Vec(IDL.Nat8),\n 'stop_before_installing' : IDL.Bool,\n 'mode' : CanisterInstallMode,\n 'canister_id' : IDL.Principal,\n 'chunked_canister_wasm' : IDL.Opt(ChunkedCanisterWasm),\n });\n const GetSnsCanistersSummaryRequest = IDL.Record({\n 'update_canister_list' : IDL.Opt(IDL.Bool),\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n 'freezing_threshold' : IDL.Nat,\n 'wasm_memory_threshold' : IDL.Opt(IDL.Nat),\n 'controllers' : IDL.Vec(IDL.Principal),\n 'wasm_memory_limit' : IDL.Opt(IDL.Nat),\n 'memory_allocation' : IDL.Nat,\n 'compute_allocation' : IDL.Nat,\n });\n const CanisterStatusResultV2 = IDL.Record({\n 'memory_metrics' : IDL.Opt(MemoryMetrics),\n 'status' : CanisterStatusType,\n 'memory_size' : IDL.Nat,\n 'cycles' : IDL.Nat,\n 'settings' : DefiniteCanisterSettingsArgs,\n 'query_stats' : IDL.Opt(QueryStats),\n 'idle_cycles_burned_per_day' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const CanisterSummary = IDL.Record({\n 'status' : IDL.Opt(CanisterStatusResultV2),\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const GetSnsCanistersSummaryResponse = IDL.Record({\n 'root' : IDL.Opt(CanisterSummary),\n 'swap' : IDL.Opt(CanisterSummary),\n 'ledger' : IDL.Opt(CanisterSummary),\n 'index' : IDL.Opt(CanisterSummary),\n 'governance' : IDL.Opt(CanisterSummary),\n 'dapps' : IDL.Vec(CanisterSummary),\n 'archives' : IDL.Vec(CanisterSummary),\n });\n const GetTimersResponse = IDL.Record({ 'timers' : IDL.Opt(Timers) });\n const ListSnsCanistersResponse = IDL.Record({\n 'root' : IDL.Opt(IDL.Principal),\n 'swap' : IDL.Opt(IDL.Principal),\n 'extensions' : IDL.Opt(Extensions),\n 'ledger' : IDL.Opt(IDL.Principal),\n 'index' : IDL.Opt(IDL.Principal),\n 'governance' : IDL.Opt(IDL.Principal),\n 'dapps' : IDL.Vec(IDL.Principal),\n 'archives' : IDL.Vec(IDL.Principal),\n });\n const ManageDappCanisterSettingsRequest = IDL.Record({\n 'freezing_threshold' : IDL.Opt(IDL.Nat64),\n 'wasm_memory_threshold' : IDL.Opt(IDL.Nat64),\n 'canister_ids' : IDL.Vec(IDL.Principal),\n 'reserved_cycles_limit' : IDL.Opt(IDL.Nat64),\n 'log_visibility' : IDL.Opt(IDL.Int32),\n 'wasm_memory_limit' : IDL.Opt(IDL.Nat64),\n 'memory_allocation' : IDL.Opt(IDL.Nat64),\n 'compute_allocation' : IDL.Opt(IDL.Nat64),\n });\n const ManageDappCanisterSettingsResponse = IDL.Record({\n 'failure_reason' : IDL.Opt(IDL.Text),\n });\n const RegisterDappCanisterRequest = IDL.Record({\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const RegisterDappCanistersRequest = IDL.Record({\n 'canister_ids' : IDL.Vec(IDL.Principal),\n });\n const RegisterExtensionRequest = IDL.Record({\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const CanisterCallError = IDL.Record({\n 'code' : IDL.Opt(IDL.Int32),\n 'description' : IDL.Text,\n });\n const RegisterExtensionResult = IDL.Variant({\n 'Ok' : IDL.Record({}),\n 'Err' : CanisterCallError,\n });\n const RegisterExtensionResponse = IDL.Record({\n 'result' : IDL.Opt(RegisterExtensionResult),\n });\n const SetDappControllersRequest = IDL.Record({\n 'canister_ids' : IDL.Opt(RegisterDappCanistersRequest),\n 'controller_principal_ids' : IDL.Vec(IDL.Principal),\n });\n const FailedUpdate = IDL.Record({\n 'err' : IDL.Opt(CanisterCallError),\n 'dapp_canister_id' : IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n 'failed_updates' : IDL.Vec(FailedUpdate),\n });\n return IDL.Service({\n 'canister_status' : IDL.Func(\n [CanisterIdRecord],\n [CanisterStatusResult],\n [],\n ),\n 'change_canister' : IDL.Func([ChangeCanisterRequest], [], []),\n 'get_build_metadata' : IDL.Func([], [IDL.Text], []),\n 'get_sns_canisters_summary' : IDL.Func(\n [GetSnsCanistersSummaryRequest],\n [GetSnsCanistersSummaryResponse],\n [],\n ),\n 'get_timers' : IDL.Func([IDL.Record({})], [GetTimersResponse], []),\n 'list_sns_canisters' : IDL.Func(\n [IDL.Record({})],\n [ListSnsCanistersResponse],\n [],\n ),\n 'manage_dapp_canister_settings' : IDL.Func(\n [ManageDappCanisterSettingsRequest],\n [ManageDappCanisterSettingsResponse],\n [],\n ),\n 'register_dapp_canister' : IDL.Func(\n [RegisterDappCanisterRequest],\n [IDL.Record({})],\n [],\n ),\n 'register_dapp_canisters' : IDL.Func(\n [RegisterDappCanistersRequest],\n [IDL.Record({})],\n [],\n ),\n 'register_extension' : IDL.Func(\n [RegisterExtensionRequest],\n [RegisterExtensionResponse],\n [],\n ),\n 'reset_timers' : IDL.Func([IDL.Record({})], [IDL.Record({})], []),\n 'set_dapp_controllers' : IDL.Func(\n [SetDappControllersRequest],\n [SetDappControllersResponse],\n [],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const Timers = IDL.Record({\n 'last_spawned_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'last_reset_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'requires_periodic_tasks' : IDL.Opt(IDL.Bool),\n });\n const Extensions = IDL.Record({\n 'extension_canister_ids' : IDL.Vec(IDL.Principal),\n });\n const SnsRootCanister = IDL.Record({\n 'dapp_canister_ids' : IDL.Vec(IDL.Principal),\n 'timers' : IDL.Opt(Timers),\n 'testflight' : IDL.Bool,\n 'extensions' : IDL.Opt(Extensions),\n 'archive_canister_ids' : IDL.Vec(IDL.Principal),\n 'governance_canister_id' : IDL.Opt(IDL.Principal),\n 'index_canister_id' : IDL.Opt(IDL.Principal),\n 'swap_canister_id' : IDL.Opt(IDL.Principal),\n 'ledger_canister_id' : IDL.Opt(IDL.Principal),\n });\n return [SnsRootCanister];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_root.did */\nexport const idlFactory = ({ IDL }) => {\n const Timers = IDL.Record({\n 'last_spawned_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'last_reset_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'requires_periodic_tasks' : IDL.Opt(IDL.Bool),\n });\n const Extensions = IDL.Record({\n 'extension_canister_ids' : IDL.Vec(IDL.Principal),\n });\n const SnsRootCanister = IDL.Record({\n 'dapp_canister_ids' : IDL.Vec(IDL.Principal),\n 'timers' : IDL.Opt(Timers),\n 'testflight' : IDL.Bool,\n 'extensions' : IDL.Opt(Extensions),\n 'archive_canister_ids' : IDL.Vec(IDL.Principal),\n 'governance_canister_id' : IDL.Opt(IDL.Principal),\n 'index_canister_id' : IDL.Opt(IDL.Principal),\n 'swap_canister_id' : IDL.Opt(IDL.Principal),\n 'ledger_canister_id' : IDL.Opt(IDL.Principal),\n });\n const CanisterIdRecord = IDL.Record({ 'canister_id' : IDL.Principal });\n const MemoryMetrics = IDL.Record({\n 'wasm_binary_size' : IDL.Opt(IDL.Nat),\n 'wasm_chunk_store_size' : IDL.Opt(IDL.Nat),\n 'canister_history_size' : IDL.Opt(IDL.Nat),\n 'stable_memory_size' : IDL.Opt(IDL.Nat),\n 'snapshots_size' : IDL.Opt(IDL.Nat),\n 'wasm_memory_size' : IDL.Opt(IDL.Nat),\n 'global_memory_size' : IDL.Opt(IDL.Nat),\n 'custom_sections_size' : IDL.Opt(IDL.Nat),\n });\n const CanisterStatusType = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const LogVisibility = IDL.Variant({\n 'controllers' : IDL.Null,\n 'public' : IDL.Null,\n 'allowed_viewers' : IDL.Vec(IDL.Principal),\n });\n const DefiniteCanisterSettings = IDL.Record({\n 'freezing_threshold' : IDL.Opt(IDL.Nat),\n 'wasm_memory_threshold' : IDL.Opt(IDL.Nat),\n 'controllers' : IDL.Vec(IDL.Principal),\n 'reserved_cycles_limit' : IDL.Opt(IDL.Nat),\n 'log_visibility' : IDL.Opt(LogVisibility),\n 'wasm_memory_limit' : IDL.Opt(IDL.Nat),\n 'memory_allocation' : IDL.Opt(IDL.Nat),\n 'compute_allocation' : IDL.Opt(IDL.Nat),\n });\n const QueryStats = IDL.Record({\n 'response_payload_bytes_total' : IDL.Opt(IDL.Nat),\n 'num_instructions_total' : IDL.Opt(IDL.Nat),\n 'num_calls_total' : IDL.Opt(IDL.Nat),\n 'request_payload_bytes_total' : IDL.Opt(IDL.Nat),\n });\n const CanisterStatusResult = IDL.Record({\n 'memory_metrics' : IDL.Opt(MemoryMetrics),\n 'status' : CanisterStatusType,\n 'memory_size' : IDL.Nat,\n 'cycles' : IDL.Nat,\n 'settings' : DefiniteCanisterSettings,\n 'query_stats' : IDL.Opt(QueryStats),\n 'idle_cycles_burned_per_day' : IDL.Opt(IDL.Nat),\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'reserved_cycles' : IDL.Opt(IDL.Nat),\n });\n const CanisterInstallMode = IDL.Variant({\n 'reinstall' : IDL.Null,\n 'upgrade' : IDL.Null,\n 'install' : IDL.Null,\n });\n const ChunkedCanisterWasm = IDL.Record({\n 'wasm_module_hash' : IDL.Vec(IDL.Nat8),\n 'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),\n 'store_canister_id' : IDL.Principal,\n });\n const ChangeCanisterRequest = IDL.Record({\n 'arg' : IDL.Vec(IDL.Nat8),\n 'wasm_module' : IDL.Vec(IDL.Nat8),\n 'stop_before_installing' : IDL.Bool,\n 'mode' : CanisterInstallMode,\n 'canister_id' : IDL.Principal,\n 'chunked_canister_wasm' : IDL.Opt(ChunkedCanisterWasm),\n });\n const GetSnsCanistersSummaryRequest = IDL.Record({\n 'update_canister_list' : IDL.Opt(IDL.Bool),\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n 'freezing_threshold' : IDL.Nat,\n 'wasm_memory_threshold' : IDL.Opt(IDL.Nat),\n 'controllers' : IDL.Vec(IDL.Principal),\n 'wasm_memory_limit' : IDL.Opt(IDL.Nat),\n 'memory_allocation' : IDL.Nat,\n 'compute_allocation' : IDL.Nat,\n });\n const CanisterStatusResultV2 = IDL.Record({\n 'memory_metrics' : IDL.Opt(MemoryMetrics),\n 'status' : CanisterStatusType,\n 'memory_size' : IDL.Nat,\n 'cycles' : IDL.Nat,\n 'settings' : DefiniteCanisterSettingsArgs,\n 'query_stats' : IDL.Opt(QueryStats),\n 'idle_cycles_burned_per_day' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const CanisterSummary = IDL.Record({\n 'status' : IDL.Opt(CanisterStatusResultV2),\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const GetSnsCanistersSummaryResponse = IDL.Record({\n 'root' : IDL.Opt(CanisterSummary),\n 'swap' : IDL.Opt(CanisterSummary),\n 'ledger' : IDL.Opt(CanisterSummary),\n 'index' : IDL.Opt(CanisterSummary),\n 'governance' : IDL.Opt(CanisterSummary),\n 'dapps' : IDL.Vec(CanisterSummary),\n 'archives' : IDL.Vec(CanisterSummary),\n });\n const GetTimersResponse = IDL.Record({ 'timers' : IDL.Opt(Timers) });\n const ListSnsCanistersResponse = IDL.Record({\n 'root' : IDL.Opt(IDL.Principal),\n 'swap' : IDL.Opt(IDL.Principal),\n 'extensions' : IDL.Opt(Extensions),\n 'ledger' : IDL.Opt(IDL.Principal),\n 'index' : IDL.Opt(IDL.Principal),\n 'governance' : IDL.Opt(IDL.Principal),\n 'dapps' : IDL.Vec(IDL.Principal),\n 'archives' : IDL.Vec(IDL.Principal),\n });\n const ManageDappCanisterSettingsRequest = IDL.Record({\n 'freezing_threshold' : IDL.Opt(IDL.Nat64),\n 'wasm_memory_threshold' : IDL.Opt(IDL.Nat64),\n 'canister_ids' : IDL.Vec(IDL.Principal),\n 'reserved_cycles_limit' : IDL.Opt(IDL.Nat64),\n 'log_visibility' : IDL.Opt(IDL.Int32),\n 'wasm_memory_limit' : IDL.Opt(IDL.Nat64),\n 'memory_allocation' : IDL.Opt(IDL.Nat64),\n 'compute_allocation' : IDL.Opt(IDL.Nat64),\n });\n const ManageDappCanisterSettingsResponse = IDL.Record({\n 'failure_reason' : IDL.Opt(IDL.Text),\n });\n const RegisterDappCanisterRequest = IDL.Record({\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const RegisterDappCanistersRequest = IDL.Record({\n 'canister_ids' : IDL.Vec(IDL.Principal),\n });\n const RegisterExtensionRequest = IDL.Record({\n 'canister_id' : IDL.Opt(IDL.Principal),\n });\n const CanisterCallError = IDL.Record({\n 'code' : IDL.Opt(IDL.Int32),\n 'description' : IDL.Text,\n });\n const RegisterExtensionResult = IDL.Variant({\n 'Ok' : IDL.Record({}),\n 'Err' : CanisterCallError,\n });\n const RegisterExtensionResponse = IDL.Record({\n 'result' : IDL.Opt(RegisterExtensionResult),\n });\n const SetDappControllersRequest = IDL.Record({\n 'canister_ids' : IDL.Opt(RegisterDappCanistersRequest),\n 'controller_principal_ids' : IDL.Vec(IDL.Principal),\n });\n const FailedUpdate = IDL.Record({\n 'err' : IDL.Opt(CanisterCallError),\n 'dapp_canister_id' : IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n 'failed_updates' : IDL.Vec(FailedUpdate),\n });\n return IDL.Service({\n 'canister_status' : IDL.Func(\n [CanisterIdRecord],\n [CanisterStatusResult],\n [],\n ),\n 'change_canister' : IDL.Func([ChangeCanisterRequest], [], []),\n 'get_build_metadata' : IDL.Func([], [IDL.Text], ['query']),\n 'get_sns_canisters_summary' : IDL.Func(\n [GetSnsCanistersSummaryRequest],\n [GetSnsCanistersSummaryResponse],\n [],\n ),\n 'get_timers' : IDL.Func([IDL.Record({})], [GetTimersResponse], ['query']),\n 'list_sns_canisters' : IDL.Func(\n [IDL.Record({})],\n [ListSnsCanistersResponse],\n ['query'],\n ),\n 'manage_dapp_canister_settings' : IDL.Func(\n [ManageDappCanisterSettingsRequest],\n [ManageDappCanisterSettingsResponse],\n [],\n ),\n 'register_dapp_canister' : IDL.Func(\n [RegisterDappCanisterRequest],\n [IDL.Record({})],\n [],\n ),\n 'register_dapp_canisters' : IDL.Func(\n [RegisterDappCanistersRequest],\n [IDL.Record({})],\n [],\n ),\n 'register_extension' : IDL.Func(\n [RegisterExtensionRequest],\n [RegisterExtensionResponse],\n [],\n ),\n 'reset_timers' : IDL.Func([IDL.Record({})], [IDL.Record({})], []),\n 'set_dapp_controllers' : IDL.Func(\n [SetDappControllersRequest],\n [SetDappControllersResponse],\n [],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const Timers = IDL.Record({\n 'last_spawned_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'last_reset_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'requires_periodic_tasks' : IDL.Opt(IDL.Bool),\n });\n const Extensions = IDL.Record({\n 'extension_canister_ids' : IDL.Vec(IDL.Principal),\n });\n const SnsRootCanister = IDL.Record({\n 'dapp_canister_ids' : IDL.Vec(IDL.Principal),\n 'timers' : IDL.Opt(Timers),\n 'testflight' : IDL.Bool,\n 'extensions' : IDL.Opt(Extensions),\n 'archive_canister_ids' : IDL.Vec(IDL.Principal),\n 'governance_canister_id' : IDL.Opt(IDL.Principal),\n 'index_canister_id' : IDL.Opt(IDL.Principal),\n 'swap_canister_id' : IDL.Opt(IDL.Principal),\n 'ledger_canister_id' : IDL.Opt(IDL.Principal),\n });\n return [SnsRootCanister];\n};\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,YAAAA,EAAU,kBAAAC,MAAsB,iBCClC,IAAMC,EAAa,CAAC,CAAE,IAAAC,CAAI,IAAM,CACrC,IAAMC,EAASD,EAAI,OAAO,CACxB,+BAAmCA,EAAI,IAAIA,EAAI,KAAK,EACpD,6BAAiCA,EAAI,IAAIA,EAAI,K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,EACf,CAAC,CACH,EACF,wBAA4BA,EAAI,KAC5B,CAACwB,CAA4B,EAC7B,CAACxB,EAAI,OAAO,CAAC,CAAC,CAAC,EACf,CAAC,CACH,EACF,mBAAuBA,EAAI,KACvB,CAACyB,CAAwB,EACzB,CAACG,CAAyB,EAC1B,CAAC,CACH,EACF,aAAiB5B,EAAI,KAAK,CAACA,EAAI,OAAO,CAAC,CAAC,CAAC,EAAG,CAACA,EAAI,OAAO,CAAC,CAAC,CAAC,EAAG,CAAC,CAAC,EAChE,qBAAyBA,EAAI,KACzB,CAAC6B,CAAyB,EAC1B,CAACE,CAA0B,EAC3B,CAAC,CACH,CACJ,CAAC,CACH,EFrNO,IAAMC,EAAN,MAAMC,UAAwBC,CAAyB,CAC5D,OAAO,OAAOC,EAA6C,CACzD,GAAM,CAAE,QAAAC,EAAS,iBAAAC,EAAkB,WAAAC,CAAW,EAC5CC,EAA+B,CAC7B,QAAAJ,EACA,WAAAK,EACA,oBAAAA,CACF,CAAC,EAEH,OAAO,IAAIP,EAAgBK,EAAYF,EAASC,CAAgB,CAClE,CAYA,iBAAmB,CAAC,CAClB,UAAAI,EAAY,EACd,IAGE,KAAK,OAAO,CAAE,UAAAA,CAAU,CAAC,EAAE,mBAAmB,CAAC,CAAC,CACpD",
|
|
6
|
+
"names": ["Canister", "createServices", "idlFactory", "IDL", "Timers", "Extensions", "SnsRootCanister", "CanisterIdRecord", "MemoryMetrics", "CanisterStatusType", "LogVisibility", "DefiniteCanisterSettings", "QueryStats", "CanisterStatusResult", "CanisterInstallMode", "ChunkedCanisterWasm", "ChangeCanisterRequest", "GetSnsCanistersSummaryRequest", "DefiniteCanisterSettingsArgs", "CanisterStatusResultV2", "CanisterSummary", "GetSnsCanistersSummaryResponse", "GetTimersResponse", "ListSnsCanistersResponse", "ManageDappCanisterSettingsRequest", "ManageDappCanisterSettingsResponse", "RegisterDappCanisterRequest", "RegisterDappCanistersRequest", "RegisterExtensionRequest", "CanisterCallError", "RegisterExtensionResult", "RegisterExtensionResponse", "SetDappControllersRequest", "FailedUpdate", "SetDappControllersResponse", "idlFactory", "IDL", "Timers", "Extensions", "SnsRootCanister", "CanisterIdRecord", "MemoryMetrics", "CanisterStatusType", "LogVisibility", "DefiniteCanisterSettings", "QueryStats", "CanisterStatusResult", "CanisterInstallMode", "ChunkedCanisterWasm", "ChangeCanisterRequest", "GetSnsCanistersSummaryRequest", "DefiniteCanisterSettingsArgs", "CanisterStatusResultV2", "CanisterSummary", "GetSnsCanistersSummaryResponse", "GetTimersResponse", "ListSnsCanistersResponse", "ManageDappCanisterSettingsRequest", "ManageDappCanisterSettingsResponse", "RegisterDappCanisterRequest", "RegisterDappCanistersRequest", "RegisterExtensionRequest", "CanisterCallError", "RegisterExtensionResult", "RegisterExtensionResponse", "SetDappControllersRequest", "FailedUpdate", "SetDappControllersResponse", "SnsRootCanister", "_SnsRootCanister", "Canister", "options", "service", "certifiedService", "canisterId", "createServices", "idlFactory", "certified"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Canister as qt,createServices as Gt,fromDefinedNullable as g,fromNullable as f}from"@dfinity/utils";var vt=({IDL:t})=>{let e=t.Record({dissolve_delay_interval_seconds:t.Nat64,count:t.Nat64}),s=t.Record({slope_numerator:t.Opt(t.Nat64),intercept_icp_e8s:t.Opt(t.Nat64),from_direct_participation_icp_e8s:t.Opt(t.Nat64),slope_denominator:t.Opt(t.Nat64),to_direct_participation_icp_e8s:t.Opt(t.Nat64)}),i=t.Record({serialized_representation:t.Opt(t.Text)}),n=t.Record({coefficient_intervals:t.Vec(s),max_neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),min_direct_participation_threshold_icp_e8s:t.Opt(t.Nat64),ideal_matched_participation_function:t.Opt(i)}),o=t.Record({iso_codes:t.Vec(t.Text)}),d=t.Record({nns_proposal_id:t.Opt(t.Nat64),sns_root_canister_id:t.Text,neurons_fund_participation:t.Opt(t.Bool),min_participant_icp_e8s:t.Opt(t.Nat64),neuron_basket_construction_parameters:t.Opt(e),fallback_controller_principal_ids:t.Vec(t.Text),max_icp_e8s:t.Opt(t.Nat64),neuron_minimum_stake_e8s:t.Opt(t.Nat64),confirmation_text:t.Opt(t.Text),swap_start_timestamp_seconds:t.Opt(t.Nat64),swap_due_timestamp_seconds:t.Opt(t.Nat64),min_participants:t.Opt(t.Nat32),sns_token_e8s:t.Opt(t.Nat64),nns_governance_canister_id:t.Text,transaction_fee_e8s:t.Opt(t.Nat64),icp_ledger_canister_id:t.Text,sns_ledger_canister_id:t.Text,neurons_fund_participation_constraints:t.Opt(n),should_auto_finalize:t.Opt(t.Bool),max_participant_icp_e8s:t.Opt(t.Nat64),sns_governance_canister_id:t.Text,min_direct_participation_icp_e8s:t.Opt(t.Nat64),restricted_countries:t.Opt(o),min_icp_e8s:t.Opt(t.Nat64),max_direct_participation_icp_e8s:t.Opt(t.Nat64)}),S=t.Record({source_principal_id:t.Opt(t.Principal)}),w=t.Record({block_height:t.Opt(t.Nat64)}),h=t.Record({description:t.Opt(t.Text),error_type:t.Opt(t.Int32)}),b=t.Variant({Ok:w,Err:h}),P=t.Record({result:t.Opt(b)}),r=t.Record({code:t.Opt(t.Int32),description:t.Text}),F=t.Record({err:t.Opt(r),dapp_canister_id:t.Opt(t.Principal)}),v=t.Record({failed_updates:t.Vec(F)}),V=t.Variant({Ok:v,Err:r}),z=t.Record({possibility:t.Opt(V)}),a=t.Record({failure:t.Nat32,skipped:t.Nat32,invalid:t.Nat32,success:t.Nat32,global_failures:t.Nat32}),C=t.Record({error_message:t.Text,error_type:t.Int32}),B=t.Record({governance_error:t.Opt(C)}),E=t.Variant({Ok:B,Err:r}),q=t.Record({possibility:t.Opt(E)}),G=t.Record({neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),neurons_fund_neurons_count:t.Opt(t.Nat64)}),A=t.Record({message:t.Opt(t.Text)}),M=t.Variant({Ok:G,Err:A}),U=t.Record({possibility:t.Opt(M)}),Q=t.Variant({Ok:t.Record({}),Err:r}),j=t.Record({possibility:t.Opt(Q)}),c=t.Record({set_dapp_controllers_call_result:t.Opt(z),create_sns_neuron_recipes_result:t.Opt(a),settle_community_fund_participation_result:t.Opt(q),error_message:t.Opt(t.Text),settle_neurons_fund_participation_result:t.Opt(U),set_mode_call_result:t.Opt(j),sweep_icp_result:t.Opt(a),claim_neuron_result:t.Opt(a),sweep_sns_result:t.Opt(a)}),H=t.Record({auto_finalize_swap_response:t.Opt(c),has_auto_finalize_been_attempted:t.Opt(t.Bool),is_auto_finalize_enabled:t.Opt(t.Bool)}),J=t.Record({principal_id:t.Opt(t.Principal)}),u=t.Record({transfer_fee_paid_e8s:t.Opt(t.Nat64),transfer_start_timestamp_seconds:t.Nat64,amount_e8s:t.Nat64,amount_transferred_e8s:t.Opt(t.Nat64),transfer_success_timestamp_seconds:t.Nat64}),p=t.Record({icp:t.Opt(u),has_created_neuron_recipes:t.Opt(t.Bool)}),K=t.Record({buyer_state:t.Opt(p)}),W=t.Record({buyers_total:t.Nat64}),X=t.Record({wasm_binary_size:t.Opt(t.Nat),wasm_chunk_store_size:t.Opt(t.Nat),canister_history_size:t.Opt(t.Nat),stable_memory_size:t.Opt(t.Nat),snapshots_size:t.Opt(t.Nat),wasm_memory_size:t.Opt(t.Nat),global_memory_size:t.Opt(t.Nat),custom_sections_size:t.Opt(t.Nat)}),Y=t.Variant({stopped:t.Null,stopping:t.Null,running:t.Null}),Z=t.Record({freezing_threshold:t.Nat,wasm_memory_threshold:t.Opt(t.Nat),controllers:t.Vec(t.Principal),wasm_memory_limit:t.Opt(t.Nat),memory_allocation:t.Nat,compute_allocation:t.Nat}),$=t.Record({response_payload_bytes_total:t.Opt(t.Nat),num_instructions_total:t.Opt(t.Nat),num_calls_total:t.Opt(t.Nat),request_payload_bytes_total:t.Opt(t.Nat)}),I=t.Record({memory_metrics:t.Opt(X),status:Y,memory_size:t.Nat,cycles:t.Nat,settings:Z,query_stats:t.Opt($),idle_cycles_burned_per_day:t.Nat,module_hash:t.Opt(t.Vec(t.Nat8))}),D=t.Record({sns_tokens_per_icp:t.Opt(t.Float64),buyer_total_icp_e8s:t.Opt(t.Nat64),cf_participant_count:t.Opt(t.Nat64),neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),direct_participation_icp_e8s:t.Opt(t.Nat64),direct_participant_count:t.Opt(t.Nat64),cf_neuron_count:t.Opt(t.Nat64)}),L=t.Record({init:t.Opt(d)}),tt=t.Record({decentralization_sale_open_timestamp_seconds:t.Opt(t.Nat64),lifecycle:t.Opt(t.Int32),decentralization_swap_termination_timestamp_seconds:t.Opt(t.Nat64)}),et=t.Record({owner:t.Opt(t.Principal),subaccount:t.Opt(t.Vec(t.Nat8))}),l=t.Record({creation_time:t.Nat64,ticket_id:t.Nat64,account:t.Opt(et),amount_icp_e8s:t.Nat64}),_=t.Record({ticket:t.Opt(l)}),st=t.Record({error_type:t.Opt(t.Int32)}),it=t.Variant({Ok:_,Err:st}),nt=t.Record({result:t.Opt(it)}),m=t.Record({min_participant_icp_e8s:t.Nat64,neuron_basket_construction_parameters:t.Opt(e),max_icp_e8s:t.Nat64,swap_due_timestamp_seconds:t.Nat64,min_participants:t.Nat32,sns_token_e8s:t.Nat64,sale_delay_seconds:t.Opt(t.Nat64),max_participant_icp_e8s:t.Nat64,min_direct_participation_icp_e8s:t.Opt(t.Nat64),min_icp_e8s:t.Nat64,max_direct_participation_icp_e8s:t.Opt(t.Nat64)}),rt=t.Record({params:t.Opt(m)}),at=t.Record({id:t.Vec(t.Nat8)}),ot=t.Record({dissolve_delay_seconds:t.Nat64,memo:t.Nat64,followees:t.Vec(at)}),O=t.Record({principals:t.Vec(t.Principal)}),ct=t.Record({controller:t.Opt(t.Principal),hotkey_principal:t.Text,hotkeys:t.Opt(O),nns_neuron_id:t.Nat64}),pt=t.Record({buyer_principal:t.Text}),_t=t.Variant({CommunityFund:ct,Direct:pt}),N=t.Record({sns:t.Opt(u),claimed_status:t.Opt(t.Int32),neuron_attributes:t.Opt(ot),investor:t.Opt(_t)}),R=t.Record({last_spawned_timestamp_seconds:t.Opt(t.Nat64),last_reset_timestamp_seconds:t.Opt(t.Nat64),requires_periodic_tasks:t.Opt(t.Bool)}),dt=t.Record({has_created_neuron_recipes:t.Opt(t.Bool),hotkeys:t.Opt(O),nns_neuron_id:t.Nat64,amount_icp_e8s:t.Nat64}),y=t.Record({controller:t.Opt(t.Principal),hotkey_principal:t.Text,cf_neurons:t.Vec(dt)}),ut=t.Record({auto_finalize_swap_response:t.Opt(c),neuron_recipes:t.Vec(N),next_ticket_id:t.Opt(t.Nat64),decentralization_sale_open_timestamp_seconds:t.Opt(t.Nat64),finalize_swap_in_progress:t.Opt(t.Bool),timers:t.Opt(R),cf_participants:t.Vec(y),init:t.Opt(d),already_tried_to_auto_finalize:t.Opt(t.Bool),neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),purge_old_tickets_last_completion_timestamp_nanoseconds:t.Opt(t.Nat64),direct_participation_icp_e8s:t.Opt(t.Nat64),lifecycle:t.Int32,purge_old_tickets_next_principal:t.Opt(t.Vec(t.Nat8)),decentralization_swap_termination_timestamp_seconds:t.Opt(t.Nat64),buyers:t.Vec(t.Tuple(t.Text,p)),params:t.Opt(m),open_sns_token_swap_proposal_id:t.Opt(t.Nat64)}),lt=t.Record({sns_tokens_per_icp:t.Float32,buyer_total_icp_e8s:t.Nat64,cf_participant_count:t.Opt(t.Nat64),neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),direct_participation_icp_e8s:t.Opt(t.Nat64),direct_participant_count:t.Opt(t.Nat64),cf_neuron_count:t.Opt(t.Nat64)}),mt=t.Record({swap:t.Opt(ut),derived:t.Opt(lt)}),Ot=t.Record({timers:t.Opt(R)}),Nt=t.Record({offset:t.Opt(t.Nat64),limit:t.Opt(t.Nat32)}),Rt=t.Record({cf_participants:t.Vec(y)}),yt=t.Record({offset:t.Opt(t.Nat32),limit:t.Opt(t.Nat32)}),ft=t.Record({participation:t.Opt(p),participant_id:t.Opt(t.Principal)}),kt=t.Record({participants:t.Vec(ft)}),Tt=t.Record({offset:t.Opt(t.Nat64),limit:t.Opt(t.Nat32)}),xt=t.Record({sns_neuron_recipes:t.Vec(N)}),gt=t.Record({subaccount:t.Opt(t.Vec(t.Nat8)),amount_icp_e8s:t.Nat64}),St=t.Record({min_amount_icp_e8s_included:t.Nat64,max_amount_icp_e8s_included:t.Nat64}),wt=t.Record({invalid_user_amount:t.Opt(St),existing_ticket:t.Opt(l),error_type:t.Int32}),ht=t.Variant({Ok:_,Err:wt}),bt=t.Record({result:t.Opt(ht)}),Pt=t.Record({confirmation_text:t.Opt(t.Text),buyer:t.Text}),Ft=t.Record({icp_accepted_participation_e8s:t.Nat64,icp_ledger_account_balance_e8s:t.Nat64});return t.Service({error_refund_icp:t.Func([S],[P],[]),finalize_swap:t.Func([t.Record({})],[c],[]),get_auto_finalization_status:t.Func([t.Record({})],[H],[]),get_buyer_state:t.Func([J],[K],[]),get_buyers_total:t.Func([t.Record({})],[W],[]),get_canister_status:t.Func([t.Record({})],[I],[]),get_derived_state:t.Func([t.Record({})],[D],[]),get_init:t.Func([t.Record({})],[L],[]),get_lifecycle:t.Func([t.Record({})],[tt],[]),get_open_ticket:t.Func([t.Record({})],[nt],[]),get_sale_parameters:t.Func([t.Record({})],[rt],[]),get_state:t.Func([t.Record({})],[mt],[]),get_timers:t.Func([t.Record({})],[Ot],[]),list_community_fund_participants:t.Func([Nt],[Rt],[]),list_direct_participants:t.Func([yt],[kt],[]),list_sns_neuron_recipes:t.Func([Tt],[xt],[]),new_sale_ticket:t.Func([gt],[bt],[]),notify_payment_failure:t.Func([t.Record({})],[_],[]),refresh_buyer_tokens:t.Func([Pt],[Ft],[]),reset_timers:t.Func([t.Record({})],[t.Record({})],[])})};var Vt=({IDL:t})=>{let e=t.Record({dissolve_delay_interval_seconds:t.Nat64,count:t.Nat64}),s=t.Record({slope_numerator:t.Opt(t.Nat64),intercept_icp_e8s:t.Opt(t.Nat64),from_direct_participation_icp_e8s:t.Opt(t.Nat64),slope_denominator:t.Opt(t.Nat64),to_direct_participation_icp_e8s:t.Opt(t.Nat64)}),i=t.Record({serialized_representation:t.Opt(t.Text)}),n=t.Record({coefficient_intervals:t.Vec(s),max_neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),min_direct_participation_threshold_icp_e8s:t.Opt(t.Nat64),ideal_matched_participation_function:t.Opt(i)}),o=t.Record({iso_codes:t.Vec(t.Text)}),d=t.Record({nns_proposal_id:t.Opt(t.Nat64),sns_root_canister_id:t.Text,neurons_fund_participation:t.Opt(t.Bool),min_participant_icp_e8s:t.Opt(t.Nat64),neuron_basket_construction_parameters:t.Opt(e),fallback_controller_principal_ids:t.Vec(t.Text),max_icp_e8s:t.Opt(t.Nat64),neuron_minimum_stake_e8s:t.Opt(t.Nat64),confirmation_text:t.Opt(t.Text),swap_start_timestamp_seconds:t.Opt(t.Nat64),swap_due_timestamp_seconds:t.Opt(t.Nat64),min_participants:t.Opt(t.Nat32),sns_token_e8s:t.Opt(t.Nat64),nns_governance_canister_id:t.Text,transaction_fee_e8s:t.Opt(t.Nat64),icp_ledger_canister_id:t.Text,sns_ledger_canister_id:t.Text,neurons_fund_participation_constraints:t.Opt(n),should_auto_finalize:t.Opt(t.Bool),max_participant_icp_e8s:t.Opt(t.Nat64),sns_governance_canister_id:t.Text,min_direct_participation_icp_e8s:t.Opt(t.Nat64),restricted_countries:t.Opt(o),min_icp_e8s:t.Opt(t.Nat64),max_direct_participation_icp_e8s:t.Opt(t.Nat64)}),S=t.Record({source_principal_id:t.Opt(t.Principal)}),w=t.Record({block_height:t.Opt(t.Nat64)}),h=t.Record({description:t.Opt(t.Text),error_type:t.Opt(t.Int32)}),b=t.Variant({Ok:w,Err:h}),P=t.Record({result:t.Opt(b)}),r=t.Record({code:t.Opt(t.Int32),description:t.Text}),F=t.Record({err:t.Opt(r),dapp_canister_id:t.Opt(t.Principal)}),v=t.Record({failed_updates:t.Vec(F)}),V=t.Variant({Ok:v,Err:r}),z=t.Record({possibility:t.Opt(V)}),a=t.Record({failure:t.Nat32,skipped:t.Nat32,invalid:t.Nat32,success:t.Nat32,global_failures:t.Nat32}),C=t.Record({error_message:t.Text,error_type:t.Int32}),B=t.Record({governance_error:t.Opt(C)}),E=t.Variant({Ok:B,Err:r}),q=t.Record({possibility:t.Opt(E)}),G=t.Record({neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),neurons_fund_neurons_count:t.Opt(t.Nat64)}),A=t.Record({message:t.Opt(t.Text)}),M=t.Variant({Ok:G,Err:A}),U=t.Record({possibility:t.Opt(M)}),Q=t.Variant({Ok:t.Record({}),Err:r}),j=t.Record({possibility:t.Opt(Q)}),c=t.Record({set_dapp_controllers_call_result:t.Opt(z),create_sns_neuron_recipes_result:t.Opt(a),settle_community_fund_participation_result:t.Opt(q),error_message:t.Opt(t.Text),settle_neurons_fund_participation_result:t.Opt(U),set_mode_call_result:t.Opt(j),sweep_icp_result:t.Opt(a),claim_neuron_result:t.Opt(a),sweep_sns_result:t.Opt(a)}),H=t.Record({auto_finalize_swap_response:t.Opt(c),has_auto_finalize_been_attempted:t.Opt(t.Bool),is_auto_finalize_enabled:t.Opt(t.Bool)}),J=t.Record({principal_id:t.Opt(t.Principal)}),u=t.Record({transfer_fee_paid_e8s:t.Opt(t.Nat64),transfer_start_timestamp_seconds:t.Nat64,amount_e8s:t.Nat64,amount_transferred_e8s:t.Opt(t.Nat64),transfer_success_timestamp_seconds:t.Nat64}),p=t.Record({icp:t.Opt(u),has_created_neuron_recipes:t.Opt(t.Bool)}),K=t.Record({buyer_state:t.Opt(p)}),W=t.Record({buyers_total:t.Nat64}),X=t.Record({wasm_binary_size:t.Opt(t.Nat),wasm_chunk_store_size:t.Opt(t.Nat),canister_history_size:t.Opt(t.Nat),stable_memory_size:t.Opt(t.Nat),snapshots_size:t.Opt(t.Nat),wasm_memory_size:t.Opt(t.Nat),global_memory_size:t.Opt(t.Nat),custom_sections_size:t.Opt(t.Nat)}),Y=t.Variant({stopped:t.Null,stopping:t.Null,running:t.Null}),Z=t.Record({freezing_threshold:t.Nat,wasm_memory_threshold:t.Opt(t.Nat),controllers:t.Vec(t.Principal),wasm_memory_limit:t.Opt(t.Nat),memory_allocation:t.Nat,compute_allocation:t.Nat}),$=t.Record({response_payload_bytes_total:t.Opt(t.Nat),num_instructions_total:t.Opt(t.Nat),num_calls_total:t.Opt(t.Nat),request_payload_bytes_total:t.Opt(t.Nat)}),I=t.Record({memory_metrics:t.Opt(X),status:Y,memory_size:t.Nat,cycles:t.Nat,settings:Z,query_stats:t.Opt($),idle_cycles_burned_per_day:t.Nat,module_hash:t.Opt(t.Vec(t.Nat8))}),D=t.Record({sns_tokens_per_icp:t.Opt(t.Float64),buyer_total_icp_e8s:t.Opt(t.Nat64),cf_participant_count:t.Opt(t.Nat64),neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),direct_participation_icp_e8s:t.Opt(t.Nat64),direct_participant_count:t.Opt(t.Nat64),cf_neuron_count:t.Opt(t.Nat64)}),L=t.Record({init:t.Opt(d)}),tt=t.Record({decentralization_sale_open_timestamp_seconds:t.Opt(t.Nat64),lifecycle:t.Opt(t.Int32),decentralization_swap_termination_timestamp_seconds:t.Opt(t.Nat64)}),et=t.Record({owner:t.Opt(t.Principal),subaccount:t.Opt(t.Vec(t.Nat8))}),l=t.Record({creation_time:t.Nat64,ticket_id:t.Nat64,account:t.Opt(et),amount_icp_e8s:t.Nat64}),_=t.Record({ticket:t.Opt(l)}),st=t.Record({error_type:t.Opt(t.Int32)}),it=t.Variant({Ok:_,Err:st}),nt=t.Record({result:t.Opt(it)}),m=t.Record({min_participant_icp_e8s:t.Nat64,neuron_basket_construction_parameters:t.Opt(e),max_icp_e8s:t.Nat64,swap_due_timestamp_seconds:t.Nat64,min_participants:t.Nat32,sns_token_e8s:t.Nat64,sale_delay_seconds:t.Opt(t.Nat64),max_participant_icp_e8s:t.Nat64,min_direct_participation_icp_e8s:t.Opt(t.Nat64),min_icp_e8s:t.Nat64,max_direct_participation_icp_e8s:t.Opt(t.Nat64)}),rt=t.Record({params:t.Opt(m)}),at=t.Record({id:t.Vec(t.Nat8)}),ot=t.Record({dissolve_delay_seconds:t.Nat64,memo:t.Nat64,followees:t.Vec(at)}),O=t.Record({principals:t.Vec(t.Principal)}),ct=t.Record({controller:t.Opt(t.Principal),hotkey_principal:t.Text,hotkeys:t.Opt(O),nns_neuron_id:t.Nat64}),pt=t.Record({buyer_principal:t.Text}),_t=t.Variant({CommunityFund:ct,Direct:pt}),N=t.Record({sns:t.Opt(u),claimed_status:t.Opt(t.Int32),neuron_attributes:t.Opt(ot),investor:t.Opt(_t)}),R=t.Record({last_spawned_timestamp_seconds:t.Opt(t.Nat64),last_reset_timestamp_seconds:t.Opt(t.Nat64),requires_periodic_tasks:t.Opt(t.Bool)}),dt=t.Record({has_created_neuron_recipes:t.Opt(t.Bool),hotkeys:t.Opt(O),nns_neuron_id:t.Nat64,amount_icp_e8s:t.Nat64}),y=t.Record({controller:t.Opt(t.Principal),hotkey_principal:t.Text,cf_neurons:t.Vec(dt)}),ut=t.Record({auto_finalize_swap_response:t.Opt(c),neuron_recipes:t.Vec(N),next_ticket_id:t.Opt(t.Nat64),decentralization_sale_open_timestamp_seconds:t.Opt(t.Nat64),finalize_swap_in_progress:t.Opt(t.Bool),timers:t.Opt(R),cf_participants:t.Vec(y),init:t.Opt(d),already_tried_to_auto_finalize:t.Opt(t.Bool),neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),purge_old_tickets_last_completion_timestamp_nanoseconds:t.Opt(t.Nat64),direct_participation_icp_e8s:t.Opt(t.Nat64),lifecycle:t.Int32,purge_old_tickets_next_principal:t.Opt(t.Vec(t.Nat8)),decentralization_swap_termination_timestamp_seconds:t.Opt(t.Nat64),buyers:t.Vec(t.Tuple(t.Text,p)),params:t.Opt(m),open_sns_token_swap_proposal_id:t.Opt(t.Nat64)}),lt=t.Record({sns_tokens_per_icp:t.Float32,buyer_total_icp_e8s:t.Nat64,cf_participant_count:t.Opt(t.Nat64),neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),direct_participation_icp_e8s:t.Opt(t.Nat64),direct_participant_count:t.Opt(t.Nat64),cf_neuron_count:t.Opt(t.Nat64)}),mt=t.Record({swap:t.Opt(ut),derived:t.Opt(lt)}),Ot=t.Record({timers:t.Opt(R)}),Nt=t.Record({offset:t.Opt(t.Nat64),limit:t.Opt(t.Nat32)}),Rt=t.Record({cf_participants:t.Vec(y)}),yt=t.Record({offset:t.Opt(t.Nat32),limit:t.Opt(t.Nat32)}),ft=t.Record({participation:t.Opt(p),participant_id:t.Opt(t.Principal)}),kt=t.Record({participants:t.Vec(ft)}),Tt=t.Record({offset:t.Opt(t.Nat64),limit:t.Opt(t.Nat32)}),xt=t.Record({sns_neuron_recipes:t.Vec(N)}),gt=t.Record({subaccount:t.Opt(t.Vec(t.Nat8)),amount_icp_e8s:t.Nat64}),St=t.Record({min_amount_icp_e8s_included:t.Nat64,max_amount_icp_e8s_included:t.Nat64}),wt=t.Record({invalid_user_amount:t.Opt(St),existing_ticket:t.Opt(l),error_type:t.Int32}),ht=t.Variant({Ok:_,Err:wt}),bt=t.Record({result:t.Opt(ht)}),Pt=t.Record({confirmation_text:t.Opt(t.Text),buyer:t.Text}),Ft=t.Record({icp_accepted_participation_e8s:t.Nat64,icp_ledger_account_balance_e8s:t.Nat64});return t.Service({error_refund_icp:t.Func([S],[P],[]),finalize_swap:t.Func([t.Record({})],[c],[]),get_auto_finalization_status:t.Func([t.Record({})],[H],["query"]),get_buyer_state:t.Func([J],[K],["query"]),get_buyers_total:t.Func([t.Record({})],[W],[]),get_canister_status:t.Func([t.Record({})],[I],[]),get_derived_state:t.Func([t.Record({})],[D],["query"]),get_init:t.Func([t.Record({})],[L],["query"]),get_lifecycle:t.Func([t.Record({})],[tt],["query"]),get_open_ticket:t.Func([t.Record({})],[nt],["query"]),get_sale_parameters:t.Func([t.Record({})],[rt],["query"]),get_state:t.Func([t.Record({})],[mt],["query"]),get_timers:t.Func([t.Record({})],[Ot],["query"]),list_community_fund_participants:t.Func([Nt],[Rt],["query"]),list_direct_participants:t.Func([yt],[kt],["query"]),list_sns_neuron_recipes:t.Func([Tt],[xt],["query"]),new_sale_ticket:t.Func([gt],[bt],[]),notify_payment_failure:t.Func([t.Record({})],[_],[]),refresh_buyer_tokens:t.Func([Pt],[Ft],[]),reset_timers:t.Func([t.Record({})],[t.Record({})],[])})};var zt=({subaccount:t,amount_icp_e8s:e})=>({subaccount:t===void 0?[]:[t],amount_icp_e8s:e});var k=class extends Error{constructor(s){super();this.methodName=s}};var T=class extends Error{errorType;invalidUserAmount;existingTicket;constructor({errorType:e,invalidUserAmount:s,existingTicket:i}){super(),this.errorType=e,this.invalidUserAmount=s,this.existingTicket=i}},x=class extends Error{constructor(s){super();this.errorType=s}};import{nonNullish as Et}from"@dfinity/utils";var Ct=t=>{if(typeof t=="object"&&Et(t)&&"message"in t){let e=t.message;return e.includes("has no update method")||e.includes("has no query method")}return!1};var Bt=class t extends qt{static create(e){let{service:s,certifiedService:i,canisterId:n}=Gt({options:e,idlFactory:Vt,certifiedIdlFactory:vt});return new t(n,s,i)}state=e=>this.caller(e).get_state({});notifyPaymentFailure=async()=>{let{ticket:e}=await this.caller({certified:!0}).notify_payment_failure({});return f(e)};notifyParticipation=async e=>await this.caller({certified:!0}).refresh_buyer_tokens(e);getUserCommitment=async e=>{let{buyer_state:s}=await this.caller({certified:e.certified}).get_buyer_state({principal_id:e.principal_id});return f(s)};getDerivedState=({certified:e})=>this.caller({certified:e}).get_derived_state({});getSaleParameters=({certified:e})=>this.caller({certified:e}).get_sale_parameters({});getOpenTicket=async e=>{let{result:s}=await this.caller({certified:e.certified}).get_open_ticket({}),i=g(s);if("Ok"in i)return f(i.Ok.ticket);let n=g(i?.Err?.error_type);throw new x(n)};newSaleTicket=async e=>{let s=zt(e),{result:i}=await this.caller({certified:!0}).new_sale_ticket(s),n=g(i);if("Ok"in n)return g(n.Ok.ticket);let o=n.Err;throw new T({errorType:o.error_type,invalidUserAmount:f(o.invalid_user_amount??[]),existingTicket:f(o.existing_ticket??[])})};getLifecycle=e=>this.caller(e).get_lifecycle({});getFinalizationStatus=async e=>{try{return await this.caller(e).get_auto_finalization_status({})}catch(s){throw Ct(s)?new k("getFinalizationStatus"):s}}};export{k as a,T as b,x as c,Bt as d};
|
|
2
|
+
//# sourceMappingURL=chunk-EYIWJ4DL.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/swap.canister.ts", "../../candid/sns_swap.certified.idl.js", "../../candid/sns_swap.idl.js", "../../src/converters/swap.converters.ts", "../../src/errors/common.errors.ts", "../../src/errors/swap.errors.ts", "../../src/utils/error.utils.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n Canister,\n createServices,\n fromDefinedNullable,\n fromNullable,\n type QueryParams,\n} from \"@dfinity/utils\";\nimport type {\n BuyerState,\n GetAutoFinalizationStatusResponse,\n GetBuyerStateRequest,\n GetDerivedStateResponse,\n GetLifecycleResponse,\n GetSaleParametersResponse,\n GetStateResponse,\n RefreshBuyerTokensRequest,\n RefreshBuyerTokensResponse,\n _SERVICE as SnsSwapService,\n Ticket,\n} from \"../candid/sns_swap\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/sns_swap.certified.idl\";\nimport { idlFactory } from \"../candid/sns_swap.idl\";\nimport { toNewSaleTicketRequest } from \"./converters/swap.converters\";\nimport { UnsupportedMethodError } from \"./errors/common.errors\";\nimport {\n SnsSwapGetOpenTicketError,\n SnsSwapNewTicketError,\n} from \"./errors/swap.errors\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\nimport type { NewSaleTicketParams } from \"./types/swap.params\";\nimport { isMethodNotSupportedError } from \"./utils/error.utils\";\n\nexport class SnsSwapCanister extends Canister<SnsSwapService> {\n static create(options: SnsCanisterOptions<SnsSwapService>) {\n const { service, certifiedService, canisterId } =\n createServices<SnsSwapService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new SnsSwapCanister(canisterId, service, certifiedService);\n }\n\n /**\n * Get the state of the swap\n */\n state = (params: QueryParams): Promise<GetStateResponse> =>\n this.caller(params).get_state({});\n\n /**\n * Notify of the payment failure to remove the ticket\n */\n notifyPaymentFailure = async (): Promise<Ticket | undefined> => {\n const { ticket } = await this.caller({\n certified: true,\n }).notify_payment_failure({});\n return fromNullable(ticket);\n };\n\n /**\n * Notify of the user participating in the swap\n */\n notifyParticipation = async (\n params: RefreshBuyerTokensRequest,\n ): Promise<RefreshBuyerTokensResponse> =>\n await this.caller({ certified: true }).refresh_buyer_tokens(params);\n\n /**\n * Get user commitment\n */\n getUserCommitment = async (\n params: GetBuyerStateRequest & QueryParams,\n ): Promise<BuyerState | undefined> => {\n const { buyer_state } = await this.caller({\n certified: params.certified,\n }).get_buyer_state({ principal_id: params.principal_id });\n return fromNullable(buyer_state);\n };\n\n /**\n * Get sale buyers state\n */\n getDerivedState = ({\n certified,\n }: QueryParams): Promise<GetDerivedStateResponse> =>\n this.caller({ certified }).get_derived_state({});\n\n /**\n * Get sale parameters\n */\n getSaleParameters = ({\n certified,\n }: QueryParams): Promise<GetSaleParametersResponse> =>\n this.caller({ certified }).get_sale_parameters({});\n\n /**\n * Return a sale ticket if created and not yet removed (payment flow)\n */\n getOpenTicket = async (params: QueryParams): Promise<Ticket | undefined> => {\n const { result: response } = await this.caller({\n certified: params.certified,\n }).get_open_ticket({});\n const result = fromDefinedNullable(response);\n\n if (\"Ok\" in result) {\n return fromNullable(result.Ok.ticket);\n }\n\n const errorType = fromDefinedNullable(result?.Err?.error_type);\n throw new SnsSwapGetOpenTicketError(errorType);\n };\n\n /**\n * Create a sale ticket (payment flow)\n */\n newSaleTicket = async (params: NewSaleTicketParams): Promise<Ticket> => {\n const request = toNewSaleTicketRequest(params);\n const { result: response } = await this.caller({\n certified: true,\n }).new_sale_ticket(request);\n\n const result = fromDefinedNullable(response);\n\n if (\"Ok\" in result) {\n return fromDefinedNullable(result.Ok.ticket);\n }\n\n const errorData = result.Err;\n const error = new SnsSwapNewTicketError({\n errorType: errorData.error_type,\n invalidUserAmount: fromNullable(errorData.invalid_user_amount ?? []),\n existingTicket: fromNullable(errorData.existing_ticket ?? []),\n });\n\n throw error;\n };\n\n /**\n * Get sale lifecycle state\n */\n getLifecycle = (params: QueryParams): Promise<GetLifecycleResponse> =>\n this.caller(params).get_lifecycle({});\n\n /**\n * Get sale lifecycle state\n */\n getFinalizationStatus = async (\n params: QueryParams,\n ): Promise<GetAutoFinalizationStatusResponse> => {\n try {\n return await this.caller(params).get_auto_finalization_status({});\n } catch (error) {\n // Throw a custom error if the method is not supported by the canister\n if (isMethodNotSupportedError(error)) {\n throw new UnsupportedMethodError(\"getFinalizationStatus\");\n }\n throw error;\n }\n };\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_swap.did */\nexport const idlFactory = ({ IDL }) => {\n const NeuronBasketConstructionParameters = IDL.Record({\n 'dissolve_delay_interval_seconds' : IDL.Nat64,\n 'count' : IDL.Nat64,\n });\n const LinearScalingCoefficient = IDL.Record({\n 'slope_numerator' : IDL.Opt(IDL.Nat64),\n 'intercept_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'from_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'slope_denominator' : IDL.Opt(IDL.Nat64),\n 'to_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n const IdealMatchedParticipationFunction = IDL.Record({\n 'serialized_representation' : IDL.Opt(IDL.Text),\n });\n const NeuronsFundParticipationConstraints = IDL.Record({\n 'coefficient_intervals' : IDL.Vec(LinearScalingCoefficient),\n 'max_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'min_direct_participation_threshold_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'ideal_matched_participation_function' : IDL.Opt(\n IdealMatchedParticipationFunction\n ),\n });\n const Countries = IDL.Record({ 'iso_codes' : IDL.Vec(IDL.Text) });\n const Init = IDL.Record({\n 'nns_proposal_id' : IDL.Opt(IDL.Nat64),\n 'sns_root_canister_id' : IDL.Text,\n 'neurons_fund_participation' : IDL.Opt(IDL.Bool),\n 'min_participant_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'neuron_basket_construction_parameters' : IDL.Opt(\n NeuronBasketConstructionParameters\n ),\n 'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),\n 'max_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'neuron_minimum_stake_e8s' : IDL.Opt(IDL.Nat64),\n 'confirmation_text' : IDL.Opt(IDL.Text),\n 'swap_start_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'swap_due_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'min_participants' : IDL.Opt(IDL.Nat32),\n 'sns_token_e8s' : IDL.Opt(IDL.Nat64),\n 'nns_governance_canister_id' : IDL.Text,\n 'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),\n 'icp_ledger_canister_id' : IDL.Text,\n 'sns_ledger_canister_id' : IDL.Text,\n 'neurons_fund_participation_constraints' : IDL.Opt(\n NeuronsFundParticipationConstraints\n ),\n 'should_auto_finalize' : IDL.Opt(IDL.Bool),\n 'max_participant_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'sns_governance_canister_id' : IDL.Text,\n 'min_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'restricted_countries' : IDL.Opt(Countries),\n 'min_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'max_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n const ErrorRefundIcpRequest = IDL.Record({\n 'source_principal_id' : IDL.Opt(IDL.Principal),\n });\n const Ok = IDL.Record({ 'block_height' : IDL.Opt(IDL.Nat64) });\n const Err = IDL.Record({\n 'description' : IDL.Opt(IDL.Text),\n 'error_type' : IDL.Opt(IDL.Int32),\n });\n const Result = IDL.Variant({ 'Ok' : Ok, 'Err' : Err });\n const ErrorRefundIcpResponse = IDL.Record({ 'result' : IDL.Opt(Result) });\n const CanisterCallError = IDL.Record({\n 'code' : IDL.Opt(IDL.Int32),\n 'description' : IDL.Text,\n });\n const FailedUpdate = IDL.Record({\n 'err' : IDL.Opt(CanisterCallError),\n 'dapp_canister_id' : IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n 'failed_updates' : IDL.Vec(FailedUpdate),\n });\n const Possibility = IDL.Variant({\n 'Ok' : SetDappControllersResponse,\n 'Err' : CanisterCallError,\n });\n const SetDappControllersCallResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility),\n });\n const SweepResult = IDL.Record({\n 'failure' : IDL.Nat32,\n 'skipped' : IDL.Nat32,\n 'invalid' : IDL.Nat32,\n 'success' : IDL.Nat32,\n 'global_failures' : IDL.Nat32,\n });\n const GovernanceError = IDL.Record({\n 'error_message' : IDL.Text,\n 'error_type' : IDL.Int32,\n });\n const Response = IDL.Record({\n 'governance_error' : IDL.Opt(GovernanceError),\n });\n const Possibility_1 = IDL.Variant({\n 'Ok' : Response,\n 'Err' : CanisterCallError,\n });\n const SettleCommunityFundParticipationResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility_1),\n });\n const Ok_1 = IDL.Record({\n 'neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'neurons_fund_neurons_count' : IDL.Opt(IDL.Nat64),\n });\n const Error = IDL.Record({ 'message' : IDL.Opt(IDL.Text) });\n const Possibility_2 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : Error });\n const SettleNeuronsFundParticipationResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility_2),\n });\n const Possibility_3 = IDL.Variant({\n 'Ok' : IDL.Record({}),\n 'Err' : CanisterCallError,\n });\n const SetModeCallResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility_3),\n });\n const FinalizeSwapResponse = IDL.Record({\n 'set_dapp_controllers_call_result' : IDL.Opt(SetDappControllersCallResult),\n 'create_sns_neuron_recipes_result' : IDL.Opt(SweepResult),\n 'settle_community_fund_participation_result' : IDL.Opt(\n SettleCommunityFundParticipationResult\n ),\n 'error_message' : IDL.Opt(IDL.Text),\n 'settle_neurons_fund_participation_result' : IDL.Opt(\n SettleNeuronsFundParticipationResult\n ),\n 'set_mode_call_result' : IDL.Opt(SetModeCallResult),\n 'sweep_icp_result' : IDL.Opt(SweepResult),\n 'claim_neuron_result' : IDL.Opt(SweepResult),\n 'sweep_sns_result' : IDL.Opt(SweepResult),\n });\n const GetAutoFinalizationStatusResponse = IDL.Record({\n 'auto_finalize_swap_response' : IDL.Opt(FinalizeSwapResponse),\n 'has_auto_finalize_been_attempted' : IDL.Opt(IDL.Bool),\n 'is_auto_finalize_enabled' : IDL.Opt(IDL.Bool),\n });\n const GetBuyerStateRequest = IDL.Record({\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const TransferableAmount = IDL.Record({\n 'transfer_fee_paid_e8s' : IDL.Opt(IDL.Nat64),\n 'transfer_start_timestamp_seconds' : IDL.Nat64,\n 'amount_e8s' : IDL.Nat64,\n 'amount_transferred_e8s' : IDL.Opt(IDL.Nat64),\n 'transfer_success_timestamp_seconds' : IDL.Nat64,\n });\n const BuyerState = IDL.Record({\n 'icp' : IDL.Opt(TransferableAmount),\n 'has_created_neuron_recipes' : IDL.Opt(IDL.Bool),\n });\n const GetBuyerStateResponse = IDL.Record({\n 'buyer_state' : IDL.Opt(BuyerState),\n });\n const GetBuyersTotalResponse = IDL.Record({ 'buyers_total' : IDL.Nat64 });\n const MemoryMetrics = IDL.Record({\n 'wasm_binary_size' : IDL.Opt(IDL.Nat),\n 'wasm_chunk_store_size' : IDL.Opt(IDL.Nat),\n 'canister_history_size' : IDL.Opt(IDL.Nat),\n 'stable_memory_size' : IDL.Opt(IDL.Nat),\n 'snapshots_size' : IDL.Opt(IDL.Nat),\n 'wasm_memory_size' : IDL.Opt(IDL.Nat),\n 'global_memory_size' : IDL.Opt(IDL.Nat),\n 'custom_sections_size' : IDL.Opt(IDL.Nat),\n });\n const CanisterStatusType = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n 'freezing_threshold' : IDL.Nat,\n 'wasm_memory_threshold' : IDL.Opt(IDL.Nat),\n 'controllers' : IDL.Vec(IDL.Principal),\n 'wasm_memory_limit' : IDL.Opt(IDL.Nat),\n 'memory_allocation' : IDL.Nat,\n 'compute_allocation' : IDL.Nat,\n });\n const QueryStats = IDL.Record({\n 'response_payload_bytes_total' : IDL.Opt(IDL.Nat),\n 'num_instructions_total' : IDL.Opt(IDL.Nat),\n 'num_calls_total' : IDL.Opt(IDL.Nat),\n 'request_payload_bytes_total' : IDL.Opt(IDL.Nat),\n });\n const CanisterStatusResultV2 = IDL.Record({\n 'memory_metrics' : IDL.Opt(MemoryMetrics),\n 'status' : CanisterStatusType,\n 'memory_size' : IDL.Nat,\n 'cycles' : IDL.Nat,\n 'settings' : DefiniteCanisterSettingsArgs,\n 'query_stats' : IDL.Opt(QueryStats),\n 'idle_cycles_burned_per_day' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetDerivedStateResponse = IDL.Record({\n 'sns_tokens_per_icp' : IDL.Opt(IDL.Float64),\n 'buyer_total_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'cf_participant_count' : IDL.Opt(IDL.Nat64),\n 'neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'direct_participant_count' : IDL.Opt(IDL.Nat64),\n 'cf_neuron_count' : IDL.Opt(IDL.Nat64),\n });\n const GetInitResponse = IDL.Record({ 'init' : IDL.Opt(Init) });\n const GetLifecycleResponse = IDL.Record({\n 'decentralization_sale_open_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'lifecycle' : IDL.Opt(IDL.Int32),\n 'decentralization_swap_termination_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n });\n const Icrc1Account = IDL.Record({\n 'owner' : IDL.Opt(IDL.Principal),\n 'subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const Ticket = IDL.Record({\n 'creation_time' : IDL.Nat64,\n 'ticket_id' : IDL.Nat64,\n 'account' : IDL.Opt(Icrc1Account),\n 'amount_icp_e8s' : IDL.Nat64,\n });\n const Ok_2 = IDL.Record({ 'ticket' : IDL.Opt(Ticket) });\n const Err_1 = IDL.Record({ 'error_type' : IDL.Opt(IDL.Int32) });\n const Result_1 = IDL.Variant({ 'Ok' : Ok_2, 'Err' : Err_1 });\n const GetOpenTicketResponse = IDL.Record({ 'result' : IDL.Opt(Result_1) });\n const Params = IDL.Record({\n 'min_participant_icp_e8s' : IDL.Nat64,\n 'neuron_basket_construction_parameters' : IDL.Opt(\n NeuronBasketConstructionParameters\n ),\n 'max_icp_e8s' : IDL.Nat64,\n 'swap_due_timestamp_seconds' : IDL.Nat64,\n 'min_participants' : IDL.Nat32,\n 'sns_token_e8s' : IDL.Nat64,\n 'sale_delay_seconds' : IDL.Opt(IDL.Nat64),\n 'max_participant_icp_e8s' : IDL.Nat64,\n 'min_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'min_icp_e8s' : IDL.Nat64,\n 'max_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n const GetSaleParametersResponse = IDL.Record({ 'params' : IDL.Opt(Params) });\n const NeuronId = IDL.Record({ 'id' : IDL.Vec(IDL.Nat8) });\n const NeuronAttributes = IDL.Record({\n 'dissolve_delay_seconds' : IDL.Nat64,\n 'memo' : IDL.Nat64,\n 'followees' : IDL.Vec(NeuronId),\n });\n const Principals = IDL.Record({ 'principals' : IDL.Vec(IDL.Principal) });\n const CfInvestment = IDL.Record({\n 'controller' : IDL.Opt(IDL.Principal),\n 'hotkey_principal' : IDL.Text,\n 'hotkeys' : IDL.Opt(Principals),\n 'nns_neuron_id' : IDL.Nat64,\n });\n const DirectInvestment = IDL.Record({ 'buyer_principal' : IDL.Text });\n const Investor = IDL.Variant({\n 'CommunityFund' : CfInvestment,\n 'Direct' : DirectInvestment,\n });\n const SnsNeuronRecipe = IDL.Record({\n 'sns' : IDL.Opt(TransferableAmount),\n 'claimed_status' : IDL.Opt(IDL.Int32),\n 'neuron_attributes' : IDL.Opt(NeuronAttributes),\n 'investor' : IDL.Opt(Investor),\n });\n const Timers = IDL.Record({\n 'last_spawned_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'last_reset_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'requires_periodic_tasks' : IDL.Opt(IDL.Bool),\n });\n const CfNeuron = IDL.Record({\n 'has_created_neuron_recipes' : IDL.Opt(IDL.Bool),\n 'hotkeys' : IDL.Opt(Principals),\n 'nns_neuron_id' : IDL.Nat64,\n 'amount_icp_e8s' : IDL.Nat64,\n });\n const CfParticipant = IDL.Record({\n 'controller' : IDL.Opt(IDL.Principal),\n 'hotkey_principal' : IDL.Text,\n 'cf_neurons' : IDL.Vec(CfNeuron),\n });\n const Swap = IDL.Record({\n 'auto_finalize_swap_response' : IDL.Opt(FinalizeSwapResponse),\n 'neuron_recipes' : IDL.Vec(SnsNeuronRecipe),\n 'next_ticket_id' : IDL.Opt(IDL.Nat64),\n 'decentralization_sale_open_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'finalize_swap_in_progress' : IDL.Opt(IDL.Bool),\n 'timers' : IDL.Opt(Timers),\n 'cf_participants' : IDL.Vec(CfParticipant),\n 'init' : IDL.Opt(Init),\n 'already_tried_to_auto_finalize' : IDL.Opt(IDL.Bool),\n 'neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'purge_old_tickets_last_completion_timestamp_nanoseconds' : IDL.Opt(\n IDL.Nat64\n ),\n 'direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'lifecycle' : IDL.Int32,\n 'purge_old_tickets_next_principal' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'decentralization_swap_termination_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'buyers' : IDL.Vec(IDL.Tuple(IDL.Text, BuyerState)),\n 'params' : IDL.Opt(Params),\n 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64),\n });\n const DerivedState = IDL.Record({\n 'sns_tokens_per_icp' : IDL.Float32,\n 'buyer_total_icp_e8s' : IDL.Nat64,\n 'cf_participant_count' : IDL.Opt(IDL.Nat64),\n 'neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'direct_participant_count' : IDL.Opt(IDL.Nat64),\n 'cf_neuron_count' : IDL.Opt(IDL.Nat64),\n });\n const GetStateResponse = IDL.Record({\n 'swap' : IDL.Opt(Swap),\n 'derived' : IDL.Opt(DerivedState),\n });\n const GetTimersResponse = IDL.Record({ 'timers' : IDL.Opt(Timers) });\n const ListCommunityFundParticipantsRequest = IDL.Record({\n 'offset' : IDL.Opt(IDL.Nat64),\n 'limit' : IDL.Opt(IDL.Nat32),\n });\n const ListCommunityFundParticipantsResponse = IDL.Record({\n 'cf_participants' : IDL.Vec(CfParticipant),\n });\n const ListDirectParticipantsRequest = IDL.Record({\n 'offset' : IDL.Opt(IDL.Nat32),\n 'limit' : IDL.Opt(IDL.Nat32),\n });\n const Participant = IDL.Record({\n 'participation' : IDL.Opt(BuyerState),\n 'participant_id' : IDL.Opt(IDL.Principal),\n });\n const ListDirectParticipantsResponse = IDL.Record({\n 'participants' : IDL.Vec(Participant),\n });\n const ListSnsNeuronRecipesRequest = IDL.Record({\n 'offset' : IDL.Opt(IDL.Nat64),\n 'limit' : IDL.Opt(IDL.Nat32),\n });\n const ListSnsNeuronRecipesResponse = IDL.Record({\n 'sns_neuron_recipes' : IDL.Vec(SnsNeuronRecipe),\n });\n const NewSaleTicketRequest = IDL.Record({\n 'subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'amount_icp_e8s' : IDL.Nat64,\n });\n const InvalidUserAmount = IDL.Record({\n 'min_amount_icp_e8s_included' : IDL.Nat64,\n 'max_amount_icp_e8s_included' : IDL.Nat64,\n });\n const Err_2 = IDL.Record({\n 'invalid_user_amount' : IDL.Opt(InvalidUserAmount),\n 'existing_ticket' : IDL.Opt(Ticket),\n 'error_type' : IDL.Int32,\n });\n const Result_2 = IDL.Variant({ 'Ok' : Ok_2, 'Err' : Err_2 });\n const NewSaleTicketResponse = IDL.Record({ 'result' : IDL.Opt(Result_2) });\n const RefreshBuyerTokensRequest = IDL.Record({\n 'confirmation_text' : IDL.Opt(IDL.Text),\n 'buyer' : IDL.Text,\n });\n const RefreshBuyerTokensResponse = IDL.Record({\n 'icp_accepted_participation_e8s' : IDL.Nat64,\n 'icp_ledger_account_balance_e8s' : IDL.Nat64,\n });\n return IDL.Service({\n 'error_refund_icp' : IDL.Func(\n [ErrorRefundIcpRequest],\n [ErrorRefundIcpResponse],\n [],\n ),\n 'finalize_swap' : IDL.Func([IDL.Record({})], [FinalizeSwapResponse], []),\n 'get_auto_finalization_status' : IDL.Func(\n [IDL.Record({})],\n [GetAutoFinalizationStatusResponse],\n [],\n ),\n 'get_buyer_state' : IDL.Func(\n [GetBuyerStateRequest],\n [GetBuyerStateResponse],\n [],\n ),\n 'get_buyers_total' : IDL.Func(\n [IDL.Record({})],\n [GetBuyersTotalResponse],\n [],\n ),\n 'get_canister_status' : IDL.Func(\n [IDL.Record({})],\n [CanisterStatusResultV2],\n [],\n ),\n 'get_derived_state' : IDL.Func(\n [IDL.Record({})],\n [GetDerivedStateResponse],\n [],\n ),\n 'get_init' : IDL.Func([IDL.Record({})], [GetInitResponse], []),\n 'get_lifecycle' : IDL.Func([IDL.Record({})], [GetLifecycleResponse], []),\n 'get_open_ticket' : IDL.Func([IDL.Record({})], [GetOpenTicketResponse], []),\n 'get_sale_parameters' : IDL.Func(\n [IDL.Record({})],\n [GetSaleParametersResponse],\n [],\n ),\n 'get_state' : IDL.Func([IDL.Record({})], [GetStateResponse], []),\n 'get_timers' : IDL.Func([IDL.Record({})], [GetTimersResponse], []),\n 'list_community_fund_participants' : IDL.Func(\n [ListCommunityFundParticipantsRequest],\n [ListCommunityFundParticipantsResponse],\n [],\n ),\n 'list_direct_participants' : IDL.Func(\n [ListDirectParticipantsRequest],\n [ListDirectParticipantsResponse],\n [],\n ),\n 'list_sns_neuron_recipes' : IDL.Func(\n [ListSnsNeuronRecipesRequest],\n [ListSnsNeuronRecipesResponse],\n [],\n ),\n 'new_sale_ticket' : IDL.Func(\n [NewSaleTicketRequest],\n [NewSaleTicketResponse],\n [],\n ),\n 'notify_payment_failure' : IDL.Func([IDL.Record({})], [Ok_2], []),\n 'refresh_buyer_tokens' : IDL.Func(\n [RefreshBuyerTokensRequest],\n [RefreshBuyerTokensResponse],\n [],\n ),\n 'reset_timers' : IDL.Func([IDL.Record({})], [IDL.Record({})], []),\n });\n};\nexport const init = ({ IDL }) => {\n const NeuronBasketConstructionParameters = IDL.Record({\n 'dissolve_delay_interval_seconds' : IDL.Nat64,\n 'count' : IDL.Nat64,\n });\n const LinearScalingCoefficient = IDL.Record({\n 'slope_numerator' : IDL.Opt(IDL.Nat64),\n 'intercept_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'from_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'slope_denominator' : IDL.Opt(IDL.Nat64),\n 'to_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n const IdealMatchedParticipationFunction = IDL.Record({\n 'serialized_representation' : IDL.Opt(IDL.Text),\n });\n const NeuronsFundParticipationConstraints = IDL.Record({\n 'coefficient_intervals' : IDL.Vec(LinearScalingCoefficient),\n 'max_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'min_direct_participation_threshold_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'ideal_matched_participation_function' : IDL.Opt(\n IdealMatchedParticipationFunction\n ),\n });\n const Countries = IDL.Record({ 'iso_codes' : IDL.Vec(IDL.Text) });\n const Init = IDL.Record({\n 'nns_proposal_id' : IDL.Opt(IDL.Nat64),\n 'sns_root_canister_id' : IDL.Text,\n 'neurons_fund_participation' : IDL.Opt(IDL.Bool),\n 'min_participant_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'neuron_basket_construction_parameters' : IDL.Opt(\n NeuronBasketConstructionParameters\n ),\n 'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),\n 'max_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'neuron_minimum_stake_e8s' : IDL.Opt(IDL.Nat64),\n 'confirmation_text' : IDL.Opt(IDL.Text),\n 'swap_start_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'swap_due_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'min_participants' : IDL.Opt(IDL.Nat32),\n 'sns_token_e8s' : IDL.Opt(IDL.Nat64),\n 'nns_governance_canister_id' : IDL.Text,\n 'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),\n 'icp_ledger_canister_id' : IDL.Text,\n 'sns_ledger_canister_id' : IDL.Text,\n 'neurons_fund_participation_constraints' : IDL.Opt(\n NeuronsFundParticipationConstraints\n ),\n 'should_auto_finalize' : IDL.Opt(IDL.Bool),\n 'max_participant_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'sns_governance_canister_id' : IDL.Text,\n 'min_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'restricted_countries' : IDL.Opt(Countries),\n 'min_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'max_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n return [Init];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_swap.did */\nexport const idlFactory = ({ IDL }) => {\n const NeuronBasketConstructionParameters = IDL.Record({\n 'dissolve_delay_interval_seconds' : IDL.Nat64,\n 'count' : IDL.Nat64,\n });\n const LinearScalingCoefficient = IDL.Record({\n 'slope_numerator' : IDL.Opt(IDL.Nat64),\n 'intercept_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'from_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'slope_denominator' : IDL.Opt(IDL.Nat64),\n 'to_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n const IdealMatchedParticipationFunction = IDL.Record({\n 'serialized_representation' : IDL.Opt(IDL.Text),\n });\n const NeuronsFundParticipationConstraints = IDL.Record({\n 'coefficient_intervals' : IDL.Vec(LinearScalingCoefficient),\n 'max_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'min_direct_participation_threshold_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'ideal_matched_participation_function' : IDL.Opt(\n IdealMatchedParticipationFunction\n ),\n });\n const Countries = IDL.Record({ 'iso_codes' : IDL.Vec(IDL.Text) });\n const Init = IDL.Record({\n 'nns_proposal_id' : IDL.Opt(IDL.Nat64),\n 'sns_root_canister_id' : IDL.Text,\n 'neurons_fund_participation' : IDL.Opt(IDL.Bool),\n 'min_participant_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'neuron_basket_construction_parameters' : IDL.Opt(\n NeuronBasketConstructionParameters\n ),\n 'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),\n 'max_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'neuron_minimum_stake_e8s' : IDL.Opt(IDL.Nat64),\n 'confirmation_text' : IDL.Opt(IDL.Text),\n 'swap_start_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'swap_due_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'min_participants' : IDL.Opt(IDL.Nat32),\n 'sns_token_e8s' : IDL.Opt(IDL.Nat64),\n 'nns_governance_canister_id' : IDL.Text,\n 'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),\n 'icp_ledger_canister_id' : IDL.Text,\n 'sns_ledger_canister_id' : IDL.Text,\n 'neurons_fund_participation_constraints' : IDL.Opt(\n NeuronsFundParticipationConstraints\n ),\n 'should_auto_finalize' : IDL.Opt(IDL.Bool),\n 'max_participant_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'sns_governance_canister_id' : IDL.Text,\n 'min_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'restricted_countries' : IDL.Opt(Countries),\n 'min_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'max_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n const ErrorRefundIcpRequest = IDL.Record({\n 'source_principal_id' : IDL.Opt(IDL.Principal),\n });\n const Ok = IDL.Record({ 'block_height' : IDL.Opt(IDL.Nat64) });\n const Err = IDL.Record({\n 'description' : IDL.Opt(IDL.Text),\n 'error_type' : IDL.Opt(IDL.Int32),\n });\n const Result = IDL.Variant({ 'Ok' : Ok, 'Err' : Err });\n const ErrorRefundIcpResponse = IDL.Record({ 'result' : IDL.Opt(Result) });\n const CanisterCallError = IDL.Record({\n 'code' : IDL.Opt(IDL.Int32),\n 'description' : IDL.Text,\n });\n const FailedUpdate = IDL.Record({\n 'err' : IDL.Opt(CanisterCallError),\n 'dapp_canister_id' : IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n 'failed_updates' : IDL.Vec(FailedUpdate),\n });\n const Possibility = IDL.Variant({\n 'Ok' : SetDappControllersResponse,\n 'Err' : CanisterCallError,\n });\n const SetDappControllersCallResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility),\n });\n const SweepResult = IDL.Record({\n 'failure' : IDL.Nat32,\n 'skipped' : IDL.Nat32,\n 'invalid' : IDL.Nat32,\n 'success' : IDL.Nat32,\n 'global_failures' : IDL.Nat32,\n });\n const GovernanceError = IDL.Record({\n 'error_message' : IDL.Text,\n 'error_type' : IDL.Int32,\n });\n const Response = IDL.Record({\n 'governance_error' : IDL.Opt(GovernanceError),\n });\n const Possibility_1 = IDL.Variant({\n 'Ok' : Response,\n 'Err' : CanisterCallError,\n });\n const SettleCommunityFundParticipationResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility_1),\n });\n const Ok_1 = IDL.Record({\n 'neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'neurons_fund_neurons_count' : IDL.Opt(IDL.Nat64),\n });\n const Error = IDL.Record({ 'message' : IDL.Opt(IDL.Text) });\n const Possibility_2 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : Error });\n const SettleNeuronsFundParticipationResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility_2),\n });\n const Possibility_3 = IDL.Variant({\n 'Ok' : IDL.Record({}),\n 'Err' : CanisterCallError,\n });\n const SetModeCallResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility_3),\n });\n const FinalizeSwapResponse = IDL.Record({\n 'set_dapp_controllers_call_result' : IDL.Opt(SetDappControllersCallResult),\n 'create_sns_neuron_recipes_result' : IDL.Opt(SweepResult),\n 'settle_community_fund_participation_result' : IDL.Opt(\n SettleCommunityFundParticipationResult\n ),\n 'error_message' : IDL.Opt(IDL.Text),\n 'settle_neurons_fund_participation_result' : IDL.Opt(\n SettleNeuronsFundParticipationResult\n ),\n 'set_mode_call_result' : IDL.Opt(SetModeCallResult),\n 'sweep_icp_result' : IDL.Opt(SweepResult),\n 'claim_neuron_result' : IDL.Opt(SweepResult),\n 'sweep_sns_result' : IDL.Opt(SweepResult),\n });\n const GetAutoFinalizationStatusResponse = IDL.Record({\n 'auto_finalize_swap_response' : IDL.Opt(FinalizeSwapResponse),\n 'has_auto_finalize_been_attempted' : IDL.Opt(IDL.Bool),\n 'is_auto_finalize_enabled' : IDL.Opt(IDL.Bool),\n });\n const GetBuyerStateRequest = IDL.Record({\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const TransferableAmount = IDL.Record({\n 'transfer_fee_paid_e8s' : IDL.Opt(IDL.Nat64),\n 'transfer_start_timestamp_seconds' : IDL.Nat64,\n 'amount_e8s' : IDL.Nat64,\n 'amount_transferred_e8s' : IDL.Opt(IDL.Nat64),\n 'transfer_success_timestamp_seconds' : IDL.Nat64,\n });\n const BuyerState = IDL.Record({\n 'icp' : IDL.Opt(TransferableAmount),\n 'has_created_neuron_recipes' : IDL.Opt(IDL.Bool),\n });\n const GetBuyerStateResponse = IDL.Record({\n 'buyer_state' : IDL.Opt(BuyerState),\n });\n const GetBuyersTotalResponse = IDL.Record({ 'buyers_total' : IDL.Nat64 });\n const MemoryMetrics = IDL.Record({\n 'wasm_binary_size' : IDL.Opt(IDL.Nat),\n 'wasm_chunk_store_size' : IDL.Opt(IDL.Nat),\n 'canister_history_size' : IDL.Opt(IDL.Nat),\n 'stable_memory_size' : IDL.Opt(IDL.Nat),\n 'snapshots_size' : IDL.Opt(IDL.Nat),\n 'wasm_memory_size' : IDL.Opt(IDL.Nat),\n 'global_memory_size' : IDL.Opt(IDL.Nat),\n 'custom_sections_size' : IDL.Opt(IDL.Nat),\n });\n const CanisterStatusType = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n 'freezing_threshold' : IDL.Nat,\n 'wasm_memory_threshold' : IDL.Opt(IDL.Nat),\n 'controllers' : IDL.Vec(IDL.Principal),\n 'wasm_memory_limit' : IDL.Opt(IDL.Nat),\n 'memory_allocation' : IDL.Nat,\n 'compute_allocation' : IDL.Nat,\n });\n const QueryStats = IDL.Record({\n 'response_payload_bytes_total' : IDL.Opt(IDL.Nat),\n 'num_instructions_total' : IDL.Opt(IDL.Nat),\n 'num_calls_total' : IDL.Opt(IDL.Nat),\n 'request_payload_bytes_total' : IDL.Opt(IDL.Nat),\n });\n const CanisterStatusResultV2 = IDL.Record({\n 'memory_metrics' : IDL.Opt(MemoryMetrics),\n 'status' : CanisterStatusType,\n 'memory_size' : IDL.Nat,\n 'cycles' : IDL.Nat,\n 'settings' : DefiniteCanisterSettingsArgs,\n 'query_stats' : IDL.Opt(QueryStats),\n 'idle_cycles_burned_per_day' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetDerivedStateResponse = IDL.Record({\n 'sns_tokens_per_icp' : IDL.Opt(IDL.Float64),\n 'buyer_total_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'cf_participant_count' : IDL.Opt(IDL.Nat64),\n 'neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'direct_participant_count' : IDL.Opt(IDL.Nat64),\n 'cf_neuron_count' : IDL.Opt(IDL.Nat64),\n });\n const GetInitResponse = IDL.Record({ 'init' : IDL.Opt(Init) });\n const GetLifecycleResponse = IDL.Record({\n 'decentralization_sale_open_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'lifecycle' : IDL.Opt(IDL.Int32),\n 'decentralization_swap_termination_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n });\n const Icrc1Account = IDL.Record({\n 'owner' : IDL.Opt(IDL.Principal),\n 'subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const Ticket = IDL.Record({\n 'creation_time' : IDL.Nat64,\n 'ticket_id' : IDL.Nat64,\n 'account' : IDL.Opt(Icrc1Account),\n 'amount_icp_e8s' : IDL.Nat64,\n });\n const Ok_2 = IDL.Record({ 'ticket' : IDL.Opt(Ticket) });\n const Err_1 = IDL.Record({ 'error_type' : IDL.Opt(IDL.Int32) });\n const Result_1 = IDL.Variant({ 'Ok' : Ok_2, 'Err' : Err_1 });\n const GetOpenTicketResponse = IDL.Record({ 'result' : IDL.Opt(Result_1) });\n const Params = IDL.Record({\n 'min_participant_icp_e8s' : IDL.Nat64,\n 'neuron_basket_construction_parameters' : IDL.Opt(\n NeuronBasketConstructionParameters\n ),\n 'max_icp_e8s' : IDL.Nat64,\n 'swap_due_timestamp_seconds' : IDL.Nat64,\n 'min_participants' : IDL.Nat32,\n 'sns_token_e8s' : IDL.Nat64,\n 'sale_delay_seconds' : IDL.Opt(IDL.Nat64),\n 'max_participant_icp_e8s' : IDL.Nat64,\n 'min_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'min_icp_e8s' : IDL.Nat64,\n 'max_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n const GetSaleParametersResponse = IDL.Record({ 'params' : IDL.Opt(Params) });\n const NeuronId = IDL.Record({ 'id' : IDL.Vec(IDL.Nat8) });\n const NeuronAttributes = IDL.Record({\n 'dissolve_delay_seconds' : IDL.Nat64,\n 'memo' : IDL.Nat64,\n 'followees' : IDL.Vec(NeuronId),\n });\n const Principals = IDL.Record({ 'principals' : IDL.Vec(IDL.Principal) });\n const CfInvestment = IDL.Record({\n 'controller' : IDL.Opt(IDL.Principal),\n 'hotkey_principal' : IDL.Text,\n 'hotkeys' : IDL.Opt(Principals),\n 'nns_neuron_id' : IDL.Nat64,\n });\n const DirectInvestment = IDL.Record({ 'buyer_principal' : IDL.Text });\n const Investor = IDL.Variant({\n 'CommunityFund' : CfInvestment,\n 'Direct' : DirectInvestment,\n });\n const SnsNeuronRecipe = IDL.Record({\n 'sns' : IDL.Opt(TransferableAmount),\n 'claimed_status' : IDL.Opt(IDL.Int32),\n 'neuron_attributes' : IDL.Opt(NeuronAttributes),\n 'investor' : IDL.Opt(Investor),\n });\n const Timers = IDL.Record({\n 'last_spawned_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'last_reset_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'requires_periodic_tasks' : IDL.Opt(IDL.Bool),\n });\n const CfNeuron = IDL.Record({\n 'has_created_neuron_recipes' : IDL.Opt(IDL.Bool),\n 'hotkeys' : IDL.Opt(Principals),\n 'nns_neuron_id' : IDL.Nat64,\n 'amount_icp_e8s' : IDL.Nat64,\n });\n const CfParticipant = IDL.Record({\n 'controller' : IDL.Opt(IDL.Principal),\n 'hotkey_principal' : IDL.Text,\n 'cf_neurons' : IDL.Vec(CfNeuron),\n });\n const Swap = IDL.Record({\n 'auto_finalize_swap_response' : IDL.Opt(FinalizeSwapResponse),\n 'neuron_recipes' : IDL.Vec(SnsNeuronRecipe),\n 'next_ticket_id' : IDL.Opt(IDL.Nat64),\n 'decentralization_sale_open_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'finalize_swap_in_progress' : IDL.Opt(IDL.Bool),\n 'timers' : IDL.Opt(Timers),\n 'cf_participants' : IDL.Vec(CfParticipant),\n 'init' : IDL.Opt(Init),\n 'already_tried_to_auto_finalize' : IDL.Opt(IDL.Bool),\n 'neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'purge_old_tickets_last_completion_timestamp_nanoseconds' : IDL.Opt(\n IDL.Nat64\n ),\n 'direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'lifecycle' : IDL.Int32,\n 'purge_old_tickets_next_principal' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'decentralization_swap_termination_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'buyers' : IDL.Vec(IDL.Tuple(IDL.Text, BuyerState)),\n 'params' : IDL.Opt(Params),\n 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64),\n });\n const DerivedState = IDL.Record({\n 'sns_tokens_per_icp' : IDL.Float32,\n 'buyer_total_icp_e8s' : IDL.Nat64,\n 'cf_participant_count' : IDL.Opt(IDL.Nat64),\n 'neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'direct_participant_count' : IDL.Opt(IDL.Nat64),\n 'cf_neuron_count' : IDL.Opt(IDL.Nat64),\n });\n const GetStateResponse = IDL.Record({\n 'swap' : IDL.Opt(Swap),\n 'derived' : IDL.Opt(DerivedState),\n });\n const GetTimersResponse = IDL.Record({ 'timers' : IDL.Opt(Timers) });\n const ListCommunityFundParticipantsRequest = IDL.Record({\n 'offset' : IDL.Opt(IDL.Nat64),\n 'limit' : IDL.Opt(IDL.Nat32),\n });\n const ListCommunityFundParticipantsResponse = IDL.Record({\n 'cf_participants' : IDL.Vec(CfParticipant),\n });\n const ListDirectParticipantsRequest = IDL.Record({\n 'offset' : IDL.Opt(IDL.Nat32),\n 'limit' : IDL.Opt(IDL.Nat32),\n });\n const Participant = IDL.Record({\n 'participation' : IDL.Opt(BuyerState),\n 'participant_id' : IDL.Opt(IDL.Principal),\n });\n const ListDirectParticipantsResponse = IDL.Record({\n 'participants' : IDL.Vec(Participant),\n });\n const ListSnsNeuronRecipesRequest = IDL.Record({\n 'offset' : IDL.Opt(IDL.Nat64),\n 'limit' : IDL.Opt(IDL.Nat32),\n });\n const ListSnsNeuronRecipesResponse = IDL.Record({\n 'sns_neuron_recipes' : IDL.Vec(SnsNeuronRecipe),\n });\n const NewSaleTicketRequest = IDL.Record({\n 'subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'amount_icp_e8s' : IDL.Nat64,\n });\n const InvalidUserAmount = IDL.Record({\n 'min_amount_icp_e8s_included' : IDL.Nat64,\n 'max_amount_icp_e8s_included' : IDL.Nat64,\n });\n const Err_2 = IDL.Record({\n 'invalid_user_amount' : IDL.Opt(InvalidUserAmount),\n 'existing_ticket' : IDL.Opt(Ticket),\n 'error_type' : IDL.Int32,\n });\n const Result_2 = IDL.Variant({ 'Ok' : Ok_2, 'Err' : Err_2 });\n const NewSaleTicketResponse = IDL.Record({ 'result' : IDL.Opt(Result_2) });\n const RefreshBuyerTokensRequest = IDL.Record({\n 'confirmation_text' : IDL.Opt(IDL.Text),\n 'buyer' : IDL.Text,\n });\n const RefreshBuyerTokensResponse = IDL.Record({\n 'icp_accepted_participation_e8s' : IDL.Nat64,\n 'icp_ledger_account_balance_e8s' : IDL.Nat64,\n });\n return IDL.Service({\n 'error_refund_icp' : IDL.Func(\n [ErrorRefundIcpRequest],\n [ErrorRefundIcpResponse],\n [],\n ),\n 'finalize_swap' : IDL.Func([IDL.Record({})], [FinalizeSwapResponse], []),\n 'get_auto_finalization_status' : IDL.Func(\n [IDL.Record({})],\n [GetAutoFinalizationStatusResponse],\n ['query'],\n ),\n 'get_buyer_state' : IDL.Func(\n [GetBuyerStateRequest],\n [GetBuyerStateResponse],\n ['query'],\n ),\n 'get_buyers_total' : IDL.Func(\n [IDL.Record({})],\n [GetBuyersTotalResponse],\n [],\n ),\n 'get_canister_status' : IDL.Func(\n [IDL.Record({})],\n [CanisterStatusResultV2],\n [],\n ),\n 'get_derived_state' : IDL.Func(\n [IDL.Record({})],\n [GetDerivedStateResponse],\n ['query'],\n ),\n 'get_init' : IDL.Func([IDL.Record({})], [GetInitResponse], ['query']),\n 'get_lifecycle' : IDL.Func(\n [IDL.Record({})],\n [GetLifecycleResponse],\n ['query'],\n ),\n 'get_open_ticket' : IDL.Func(\n [IDL.Record({})],\n [GetOpenTicketResponse],\n ['query'],\n ),\n 'get_sale_parameters' : IDL.Func(\n [IDL.Record({})],\n [GetSaleParametersResponse],\n ['query'],\n ),\n 'get_state' : IDL.Func([IDL.Record({})], [GetStateResponse], ['query']),\n 'get_timers' : IDL.Func([IDL.Record({})], [GetTimersResponse], ['query']),\n 'list_community_fund_participants' : IDL.Func(\n [ListCommunityFundParticipantsRequest],\n [ListCommunityFundParticipantsResponse],\n ['query'],\n ),\n 'list_direct_participants' : IDL.Func(\n [ListDirectParticipantsRequest],\n [ListDirectParticipantsResponse],\n ['query'],\n ),\n 'list_sns_neuron_recipes' : IDL.Func(\n [ListSnsNeuronRecipesRequest],\n [ListSnsNeuronRecipesResponse],\n ['query'],\n ),\n 'new_sale_ticket' : IDL.Func(\n [NewSaleTicketRequest],\n [NewSaleTicketResponse],\n [],\n ),\n 'notify_payment_failure' : IDL.Func([IDL.Record({})], [Ok_2], []),\n 'refresh_buyer_tokens' : IDL.Func(\n [RefreshBuyerTokensRequest],\n [RefreshBuyerTokensResponse],\n [],\n ),\n 'reset_timers' : IDL.Func([IDL.Record({})], [IDL.Record({})], []),\n });\n};\nexport const init = ({ IDL }) => {\n const NeuronBasketConstructionParameters = IDL.Record({\n 'dissolve_delay_interval_seconds' : IDL.Nat64,\n 'count' : IDL.Nat64,\n });\n const LinearScalingCoefficient = IDL.Record({\n 'slope_numerator' : IDL.Opt(IDL.Nat64),\n 'intercept_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'from_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'slope_denominator' : IDL.Opt(IDL.Nat64),\n 'to_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n const IdealMatchedParticipationFunction = IDL.Record({\n 'serialized_representation' : IDL.Opt(IDL.Text),\n });\n const NeuronsFundParticipationConstraints = IDL.Record({\n 'coefficient_intervals' : IDL.Vec(LinearScalingCoefficient),\n 'max_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'min_direct_participation_threshold_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'ideal_matched_participation_function' : IDL.Opt(\n IdealMatchedParticipationFunction\n ),\n });\n const Countries = IDL.Record({ 'iso_codes' : IDL.Vec(IDL.Text) });\n const Init = IDL.Record({\n 'nns_proposal_id' : IDL.Opt(IDL.Nat64),\n 'sns_root_canister_id' : IDL.Text,\n 'neurons_fund_participation' : IDL.Opt(IDL.Bool),\n 'min_participant_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'neuron_basket_construction_parameters' : IDL.Opt(\n NeuronBasketConstructionParameters\n ),\n 'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),\n 'max_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'neuron_minimum_stake_e8s' : IDL.Opt(IDL.Nat64),\n 'confirmation_text' : IDL.Opt(IDL.Text),\n 'swap_start_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'swap_due_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'min_participants' : IDL.Opt(IDL.Nat32),\n 'sns_token_e8s' : IDL.Opt(IDL.Nat64),\n 'nns_governance_canister_id' : IDL.Text,\n 'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),\n 'icp_ledger_canister_id' : IDL.Text,\n 'sns_ledger_canister_id' : IDL.Text,\n 'neurons_fund_participation_constraints' : IDL.Opt(\n NeuronsFundParticipationConstraints\n ),\n 'should_auto_finalize' : IDL.Opt(IDL.Bool),\n 'max_participant_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'sns_governance_canister_id' : IDL.Text,\n 'min_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'restricted_countries' : IDL.Opt(Countries),\n 'min_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'max_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n return [Init];\n};\n", "import type { NewSaleTicketRequest } from \"../../candid/sns_swap\";\nimport type { NewSaleTicketParams } from \"../types/swap.params\";\n\n// Helper for building `NewSaleTicketRequest` structure\nexport const toNewSaleTicketRequest = ({\n subaccount,\n amount_icp_e8s,\n}: NewSaleTicketParams): NewSaleTicketRequest => ({\n subaccount: subaccount === undefined ? [] : [subaccount],\n amount_icp_e8s,\n});\n", "// This is possible specially in SNS projects/\n// Because they share the same canisters but in different versions.\nexport class UnsupportedMethodError extends Error {\n constructor(public readonly methodName: string) {\n super();\n }\n}\n", "import type { InvalidUserAmount, Ticket } from \"../../candid/sns_swap\";\nimport type {\n GetOpenTicketErrorType,\n NewSaleTicketResponseErrorType,\n} from \"../enums/swap.enums\";\n\nexport class SnsSwapNewTicketError extends Error {\n public errorType: NewSaleTicketResponseErrorType;\n public invalidUserAmount?: InvalidUserAmount;\n public existingTicket?: Ticket;\n\n constructor({\n errorType,\n invalidUserAmount,\n existingTicket,\n }: {\n errorType: NewSaleTicketResponseErrorType;\n invalidUserAmount?: InvalidUserAmount;\n existingTicket?: Ticket;\n }) {\n super();\n this.errorType = errorType;\n this.invalidUserAmount = invalidUserAmount;\n this.existingTicket = existingTicket;\n }\n}\n\nexport class SnsSwapGetOpenTicketError extends Error {\n constructor(public errorType: GetOpenTicketErrorType) {\n super();\n }\n}\n", "import { nonNullish } from \"@dfinity/utils\";\n\n/**\n * Identifies errors of method not being present in the canister.\n *\n * This is useful because SNS projects have different versions of SNS canisters.\n * Therefore, what works in the latest version might not work in the previous one.\n *\n * Error message example: \"Call was rejected:\n * Request ID: 3a6ef904b35fd19721c95c3df2b0b00b8abefba7f0ad188f5c472809b772c914\n * Reject code: 3\n * Reject text: Canister 75ffu-oaaaa-aaaaa-aabbq-cai has no update method 'get_auto_finalization_status'\"\n */\nexport const isMethodNotSupportedError = (err: unknown): boolean => {\n if (typeof err === \"object\" && nonNullish(err) && \"message\" in err) {\n const message = err.message as string;\n return (\n message.includes(\"has no update method\") ||\n message.includes(\"has no query method\")\n );\n }\n return false;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,OACE,YAAAA,GACA,kBAAAC,GACA,uBAAAC,EACA,gBAAAC,MAEK,iBCLA,IAAMC,GAAa,CAAC,CAAE,IAAAC,CAAI,IAAM,CACrC,IAAMC,EAAqCD,EAAI,OAAO,CACpD,gCAAoCA,EAAI,MACxC,MAAUA,EAAI,KAChB,CAAC,EACKE,EAA2BF,EAAI,OAAO,CAC1C,gBAAoBA,EAAI,IAAIA,EAAI,KAAK,EACrC,kBAAsBA,EAAI,IAAIA,EAAI,KAAK,EACvC,kCAAsCA,EAAI,IAAIA,EAAI,KAAK,EACvD,kBAAsBA,EAAI,IAAIA,EAAI,KAAK,EACvC,gCAAoCA,EAAI,IAAIA,EAAI,KAAK,CACvD,CAAC,EACKG,EAAoCH,EAAI,OAAO,CACnD,0BAA8BA,EAAI,IAAIA,EAAI,IAAI,CAChD,CAAC,EACKI,EAAsCJ,EAAI,OAAO,CACrD,sBAA0BA,EAAI,IAAIE,CAAwB,EAC1D,uCAA2CF,EAAI,IAAIA,EAAI,KAAK,EAC5D,2CAA+CA,EAAI,IAAIA,EAAI,KAAK,EAChE,qCAAyCA,EAAI,IAC3CG,CACF,CACF,CAAC,EACKE,EAAYL,EAAI,OAAO,CAAE,UAAcA,EAAI,IAAIA,EAAI,IAAI,CAAE,CAAC,EAC1DM,EAAON,EAAI,OAAO,CACtB,gBAAoBA,E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AAOJ,GAAqD,CAC1E,GAAM,CAAE,OAAQK,CAAS,EAAI,MAAM,KAAK,OAAO,CAC7C,UAAWL,EAAO,SACpB,CAAC,EAAE,gBAAgB,CAAC,CAAC,EACfM,EAASC,EAAoBF,CAAQ,EAE3C,GAAI,OAAQC,EACV,OAAOJ,EAAaI,EAAO,GAAG,MAAM,EAGtC,IAAME,EAAYD,EAAoBD,GAAQ,KAAK,UAAU,EAC7D,MAAM,IAAIG,EAA0BD,CAAS,CAC/C,EAKA,cAAgB,MAAOR,GAAiD,CACtE,IAAMU,EAAUC,GAAuBX,CAAM,EACvC,CAAE,OAAQK,CAAS,EAAI,MAAM,KAAK,OAAO,CAC7C,UAAW,EACb,CAAC,EAAE,gBAAgBK,CAAO,EAEpBJ,EAASC,EAAoBF,CAAQ,EAE3C,GAAI,OAAQC,EACV,OAAOC,EAAoBD,EAAO,GAAG,MAAM,EAG7C,IAAMM,EAAYN,EAAO,IAOzB,MANc,IAAIO,EAAsB,CACtC,UAAWD,EAAU,WACrB,kBAAmBV,EAAaU,EAAU,qBAAuB,CAAC,CAAC,EACnE,eAAgBV,EAAaU,EAAU,iBAAmB,CAAC,CAAC,CAC9D,CAAC,CAGH,EAKA,aAAgBZ,GACd,KAAK,OAAOA,CAAM,EAAE,cAAc,CAAC,CAAC,EAKtC,sBAAwB,MACtBA,GAC+C,CAC/C,GAAI,CACF,OAAO,MAAM,KAAK,OAAOA,CAAM,EAAE,6BAA6B,CAAC,CAAC,CAClE,OAASc,EAAO,CAEd,MAAIC,GAA0BD,CAAK,EAC3B,IAAIE,EAAuB,uBAAuB,EAEpDF,CACR,CACF,CACF",
|
|
6
|
+
"names": ["Canister", "createServices", "fromDefinedNullable", "fromNullable", "idlFactory", "IDL", "NeuronBasketConstructionParameters", "LinearScalingCoefficient", "IdealMatchedParticipationFunction", "NeuronsFundParticipationConstraints", "Countries", "Init", "ErrorRefundIcpRequest", "Ok", "Err", "Result", "ErrorRefundIcpResponse", "CanisterCallError", "FailedUpdate", "SetDappControllersResponse", "Possibility", "SetDappControllersCallResult", "SweepResult", "GovernanceError", "Response", "Possibility_1", "SettleCommunityFundParticipationResult", "Ok_1", "Error", "Possibility_2", "SettleNeuronsFundParticipationResult", "Possibility_3", "SetModeCallResult", "FinalizeSwapResponse", "GetAutoFinalizationStatusResponse", "GetBuyerStateRequest", "TransferableAmount", "BuyerState", "GetBuyerStateResponse", "GetBuyersTotalResponse", "MemoryMetrics", "CanisterStatusType", "DefiniteCanisterSettingsArgs", "QueryStats", "CanisterStatusResultV2", "GetDerivedStateResponse", "GetInitResponse", "GetLifecycleResponse", "Icrc1Account", "Ticket", "Ok_2", "Err_1", "Result_1", "GetOpenTicketResponse", "Params", "GetSaleParametersResponse", "NeuronId", "NeuronAttributes", "Principals", "CfInvestment", "DirectInvestment", "Investor", "SnsNeuronRecipe", "Timers", "CfNeuron", "CfParticipant", "Swap", "DerivedState", "GetStateResponse", "GetTimersResponse", "ListCommunityFundParticipantsRequest", "ListCommunityFundParticipantsResponse", "ListDirectParticipantsRequest", "Participant", "ListDirectParticipantsResponse", "ListSnsNeuronRecipesRequest", "ListSnsNeuronRecipesResponse", "NewSaleTicketRequest", "InvalidUserAmount", "Err_2", "Result_2", "NewSaleTicketResponse", "RefreshBuyerTokensRequest", "RefreshBuyerTokensResponse", "idlFactory", "IDL", "NeuronBasketConstructionParameters", "LinearScalingCoefficient", "IdealMatchedParticipationFunction", "NeuronsFundParticipationConstraints", "Countries", "Init", "ErrorRefundIcpRequest", "Ok", "Err", "Result", "ErrorRefundIcpResponse", "CanisterCallError", "FailedUpdate", "SetDappControllersResponse", "Possibility", "SetDappControllersCallResult", "SweepResult", "GovernanceError", "Response", "Possibility_1", "SettleCommunityFundParticipationResult", "Ok_1", "Error", "Possibility_2", "SettleNeuronsFundParticipationResult", "Possibility_3", "SetModeCallResult", "FinalizeSwapResponse", "GetAutoFinalizationStatusResponse", "GetBuyerStateRequest", "TransferableAmount", "BuyerState", "GetBuyerStateResponse", "GetBuyersTotalResponse", "MemoryMetrics", "CanisterStatusType", "DefiniteCanisterSettingsArgs", "QueryStats", "CanisterStatusResultV2", "GetDerivedStateResponse", "GetInitResponse", "GetLifecycleResponse", "Icrc1Account", "Ticket", "Ok_2", "Err_1", "Result_1", "GetOpenTicketResponse", "Params", "GetSaleParametersResponse", "NeuronId", "NeuronAttributes", "Principals", "CfInvestment", "DirectInvestment", "Investor", "SnsNeuronRecipe", "Timers", "CfNeuron", "CfParticipant", "Swap", "DerivedState", "GetStateResponse", "GetTimersResponse", "ListCommunityFundParticipantsRequest", "ListCommunityFundParticipantsResponse", "ListDirectParticipantsRequest", "Participant", "ListDirectParticipantsResponse", "ListSnsNeuronRecipesRequest", "ListSnsNeuronRecipesResponse", "NewSaleTicketRequest", "InvalidUserAmount", "Err_2", "Result_2", "NewSaleTicketResponse", "RefreshBuyerTokensRequest", "RefreshBuyerTokensResponse", "toNewSaleTicketRequest", "subaccount", "amount_icp_e8s", "UnsupportedMethodError", "methodName", "SnsSwapNewTicketError", "errorType", "invalidUserAmount", "existingTicket", "SnsSwapGetOpenTicketError", "nonNullish", "isMethodNotSupportedError", "err", "message", "SnsSwapCanister", "_SnsSwapCanister", "Canister", "options", "service", "certifiedService", "canisterId", "createServices", "idlFactory", "params", "ticket", "fromNullable", "buyer_state", "certified", "response", "result", "fromDefinedNullable", "errorType", "SnsSwapGetOpenTicketError", "request", "toNewSaleTicketRequest", "errorData", "SnsSwapNewTicketError", "error", "isMethodNotSupportedError", "UnsupportedMethodError"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as c}from"./chunk-QXELTIRL.js";import{a as d}from"./chunk-4E6G4JED.js";import{b as m}from"./chunk-2I22CLP7.js";import{d as S}from"./chunk-EYIWJ4DL.js";import{IcrcIndexCanister as u,IcrcLedgerCanister as P}from"@dfinity/ledger-icrc";import{assertNonNullish as e,fromNullable as r}from"@dfinity/utils";var W=async({agent:n,rootOptions:C,certified:t=!0})=>{let s=d.create({...C,agent:n}),{ledger:f,swap:I,governance:l,index:y}=await s.listSnsCanisters({certified:t}),i=r(l),o=r(f),a=r(I),p=r(y);return e(i),e(o),e(a),e(p),new m({root:s,governance:c.create({canisterId:i,agent:n}),ledger:P.create({canisterId:o,agent:n}),swap:S.create({canisterId:a,agent:n}),index:u.create({canisterId:p,agent:n}),certified:t})};export{W as a};
|
|
2
|
+
//# sourceMappingURL=chunk-FRCSR552.js.map
|