@dfinity/sns 3.4.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +126 -97
- package/dist/candid/sns_governance.certified.idl.js +42 -0
- package/dist/candid/sns_governance.d.ts +18 -9
- package/dist/candid/sns_governance.did +23 -12
- package/dist/candid/sns_governance.idl.js +42 -0
- package/dist/candid/sns_governance_test.certified.idl.js +42 -0
- package/dist/candid/sns_governance_test.d.ts +18 -9
- package/dist/candid/sns_governance_test.did +23 -12
- package/dist/candid/sns_governance_test.idl.js +42 -0
- package/dist/candid/sns_root.did +1 -1
- package/dist/candid/sns_swap.did +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/index.cjs.js.map +3 -3
- package/dist/esm/{chunk-CMVA2R27.js → chunk-63KCLBLM.js} +2 -2
- package/dist/esm/chunk-ERFZ4WF4.js +2 -0
- package/dist/esm/chunk-ERFZ4WF4.js.map +7 -0
- package/dist/esm/{chunk-Q55ZUKOX.js → chunk-TJDVNGQZ.js} +2 -2
- package/dist/esm/chunk-TJDVNGQZ.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/sns.js +1 -1
- package/dist/esm/sns.wrapper.js +1 -1
- package/dist/types/converters/governance.converters.d.ts +2 -1
- package/dist/types/governance.canister.d.ts +7 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/sns.wrapper.d.ts +2 -1
- package/dist/types/types/governance.params.d.ts +14 -2
- package/package.json +3 -3
- package/dist/esm/chunk-IVTJXPAO.js +0 -2
- package/dist/esm/chunk-IVTJXPAO.js.map +0 -7
- package/dist/esm/chunk-Q55ZUKOX.js.map +0 -7
- /package/dist/esm/{chunk-CMVA2R27.js.map → chunk-63KCLBLM.js.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/sns.wrapper.ts", "../../src/utils/governance.utils.ts", "../../../../node_modules/@noble/hashes/src/_assert.ts", "../../../../node_modules/@noble/hashes/src/utils.ts", "../../../../node_modules/@noble/hashes/src/_md.ts", "../../../../node_modules/@noble/hashes/src/sha256.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 type { QueryParams } from \"@dfinity/utils\";\nimport { bigIntToUint8Array, toNullable } 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: 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 = async (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 = async (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/sha256\";\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", "function number(n: number) {\n if (!Number.isSafeInteger(n) || n < 0) throw new Error(`positive integer expected, not ${n}`);\n}\n\nfunction bool(b: boolean) {\n if (typeof b !== 'boolean') throw new Error(`boolean expected, not ${b}`);\n}\n\n// copied from utils\nexport function isBytes(a: unknown): a is Uint8Array {\n return (\n a instanceof Uint8Array ||\n (a != null && typeof a === 'object' && a.constructor.name === 'Uint8Array')\n );\n}\n\nfunction bytes(b: Uint8Array | undefined, ...lengths: number[]) {\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}, not of length=${b.length}`);\n}\n\ntype Hash = {\n (data: Uint8Array): Uint8Array;\n blockLen: number;\n outputLen: number;\n create: any;\n};\nfunction hash(h: Hash) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new Error('Hash should be wrapped by utils.wrapConstructor');\n number(h.outputLen);\n number(h.blockLen);\n}\n\nfunction exists(instance: any, checkFinished = true) {\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}\nfunction output(out: any, instance: any) {\n bytes(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\nexport { number, bool, bytes, hash, exists, output };\n\nconst assert = { number, bool, bytes, hash, exists, output };\nexport default assert;\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';\nimport { bytes as abytes } from './_assert.js';\n// export { isBytes } from './_assert.js';\n// We can't reuse isBytes from _assert, because somehow this causes huge perf issues\nexport function isBytes(a: unknown): a is Uint8Array {\n return (\n a instanceof Uint8Array ||\n (a != null && typeof a === 'object' && a.constructor.name === 'Uint8Array')\n );\n}\n\n// prettier-ignore\nexport type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array |\n Uint16Array | Int16Array | Uint32Array | Int32Array;\n\n// Cast array to different type\nexport const u8 = (arr: TypedArray) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\nexport const u32 = (arr: TypedArray) =>\n new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n\n// Cast array to view\nexport const createView = (arr: TypedArray) =>\n new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n\n// The rotate right (circular right shift) operation for uint32\nexport const rotr = (word: number, shift: number) => (word << (32 - shift)) | (word >>> shift);\n// The rotate left (circular left shift) operation for uint32\nexport const rotl = (word: number, shift: number) =>\n (word << shift) | ((word >>> (32 - shift)) >>> 0);\n\nexport const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;\n// The byte swap operation for uint32\nexport const byteSwap = (word: number) =>\n ((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff);\n// Conditionally byte swap if on a big-endian platform\nexport const byteSwapIfBE = isLE ? (n: number) => n : (n: number) => byteSwap(n);\n\n// In place byte swap for Uint32Array\nexport function byteSwap32(arr: Uint32Array) {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = byteSwap(arr[i]);\n }\n}\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 * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes: Uint8Array): string {\n abytes(bytes);\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(char: number): number | undefined {\n if (char >= asciis._0 && char <= asciis._9) return char - asciis._0;\n if (char >= asciis._A && char <= asciis._F) return char - (asciis._A - 10);\n if (char >= asciis._a && char <= asciis._f) return char - (asciis._a - 10);\n return;\n}\n\n/**\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 const hl = hex.length;\n const al = hl / 2;\n if (hl % 2) throw new Error('padded 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;\n }\n return array;\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.\nexport const nextTick = async () => {};\n\n// Returns control to thread each 'tick' ms to avoid blocking\nexport async function asyncLoop(iters: number, tick: number, cb: (i: number) => 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 in both browsers and Node.js since v11\n// See https://github.com/microsoft/TypeScript/issues/31535\ndeclare const TextEncoder: any;\n\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str: string): Uint8Array {\n if (typeof str !== 'string') throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n\nexport type Input = Uint8Array | string;\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/**\n * Copies several Uint8Arrays into one.\n */\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\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 clone(): T {\n return this._cloneInto();\n }\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\nconst toStr = {}.toString;\ntype EmptyObj = {};\nexport function checkOpts<T1 extends EmptyObj, T2 extends EmptyObj>(\n defaults: T1,\n opts?: T2\n): T1 & T2 {\n if (opts !== undefined && toStr.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\nexport type CHash = ReturnType<typeof wrapConstructor>;\n\nexport function wrapConstructor<T extends Hash<T>>(hashCons: () => Hash<T>) {\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 wrapConstructorWithOpts<H extends Hash<H>, T extends Object>(\n hashCons: (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 wrapXOFConstructorWithOpts<H extends HashXOF<H>, T extends Object>(\n hashCons: (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}\n\n/**\n * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS.\n */\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 crypto.randomBytes(bytesLength);\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n", "import { exists, output } from './_assert.js';\nimport { Hash, createView, Input, toBytes } from './utils.js';\n\n/**\n * Polyfill for Safari 14\n */\nfunction setBigUint64(view: DataView, byteOffset: number, value: bigint, isLE: boolean): 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/**\n * Choice: a ? b : c\n */\nexport const Chi = (a: number, b: number, c: number) => (a & b) ^ (~a & c);\n\n/**\n * Majority function, true if any two inputs is true\n */\nexport const Maj = (a: number, b: number, c: number) => (a & b) ^ (a & c) ^ (b & c);\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 // 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(\n readonly blockLen: number,\n public outputLen: number,\n readonly padOffset: number,\n readonly isLE: boolean\n ) {\n super();\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data: Input): this {\n exists(this);\n const { view, buffer, blockLen } = this;\n data = toBytes(data);\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) {\n exists(this);\n output(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 this.buffer.subarray(pos).fill(0);\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() {\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.length = length;\n to.pos = pos;\n to.finished = finished;\n to.destroyed = destroyed;\n if (length % blockLen) to.buffer.set(buffer);\n return to;\n }\n}\n", "import { HashMD, Chi, Maj } from './_md.js';\nimport { rotr, wrapConstructor } from './utils.js';\n\n// SHA2-256 need to try 2^128 hashes to execute birthday attack.\n// BTC network is doing 2^67 hashes/sec as per early 2023.\n\n// Round constants:\n// first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311)\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ new Uint32Array([\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// Initial state:\n// first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19\n// prettier-ignore\nconst SHA256_IV = /* @__PURE__ */ new Uint32Array([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\n]);\n\n// Temporary buffer, not used to store anything between runs\n// Named this way because it matches specification.\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 A = SHA256_IV[0] | 0;\n B = SHA256_IV[1] | 0;\n C = SHA256_IV[2] | 0;\n D = SHA256_IV[3] | 0;\n E = SHA256_IV[4] | 0;\n F = SHA256_IV[5] | 0;\n G = SHA256_IV[6] | 0;\n H = SHA256_IV[7] | 0;\n\n constructor() {\n super(64, 32, 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 ) {\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() {\n SHA256_W.fill(0);\n }\n destroy() {\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n this.buffer.fill(0);\n }\n}\n// Constants from https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\nclass SHA224 extends SHA256 {\n A = 0xc1059ed8 | 0;\n B = 0x367cd507 | 0;\n C = 0x3070dd17 | 0;\n D = 0xf70e5939 | 0;\n E = 0xffc00b31 | 0;\n F = 0x68581511 | 0;\n G = 0x64f98fa7 | 0;\n H = 0xbefa4fa4 | 0;\n constructor() {\n super();\n this.outputLen = 28;\n }\n}\n\n/**\n * SHA2-256 hash function\n * @param message - data that would be hashed\n */\nexport const sha256 = /* @__PURE__ */ wrapConstructor(() => new SHA256());\n/**\n * SHA2-224 hash function\n */\nexport const sha224 = /* @__PURE__ */ wrapConstructor(() => new SHA224());\n"],
|
|
5
|
+
"mappings": "w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MAAO,KAAK,YAAY,oBAC1B,CACF,CACF",
|
|
6
|
+
"names": ["bigIntToUint8Array", "toNullable", "arrayOfNumberToUint8Array", "asciiStringToByteArray", "numberToUint8Array", "isBytes", "a", "bytes", "b", "lengths", "exists", "instance", "checkFinished", "output", "out", "bytes", "min", "createView", "arr", "rotr", "word", "shift", "isLE", "utf8ToBytes", "str", "toBytes", "data", "bytes", "Hash", "toStr", "wrapConstructor", "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", "exists", "buffer", "toBytes", "len", "pos", "take", "dataView", "out", "output", "i", "oview", "outLen", "state", "res", "to", "length", "finished", "destroyed", "SHA256_K", "SHA256_IV", "SHA256_W", "SHA256", "HashMD", "A", "B", "C", "D", "E", "F", "G", "H", "view", "offset", "i", "W15", "W2", "s0", "rotr", "s1", "sigma1", "T1", "Chi", "T2", "Maj", "sha256", "wrapConstructor", "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
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as a}from"./chunk-
|
|
1
|
+
import{b as a}from"./chunk-ERFZ4WF4.js";import"./chunk-4INNMFYU.js";export{a as SnsGovernanceCanister};
|
|
2
2
|
//# sourceMappingURL=governance.canister.js.map
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as es}from"./chunk-CMVA2R27.js";import{a as Ee,b as Ue}from"./chunk-IVTJXPAO.js";import{a as Ge}from"./chunk-PUAIJI6X.js";import{a as Le,b as ts}from"./chunk-Q55ZUKOX.js";import{a as Me}from"./chunk-4INNMFYU.js";import{a as $e,b as Ie,c as De,d as qe}from"./chunk-7RSE53BN.js";var Be=(a=>(a[a.NEURON_PERMISSION_TYPE_UNSPECIFIED=0]="NEURON_PERMISSION_TYPE_UNSPECIFIED",a[a.NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE=1]="NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE",a[a.NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS=2]="NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS",a[a.NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL=3]="NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL",a[a.NEURON_PERMISSION_TYPE_VOTE=4]="NEURON_PERMISSION_TYPE_VOTE",a[a.NEURON_PERMISSION_TYPE_DISBURSE=5]="NEURON_PERMISSION_TYPE_DISBURSE",a[a.NEURON_PERMISSION_TYPE_SPLIT=6]="NEURON_PERMISSION_TYPE_SPLIT",a[a.NEURON_PERMISSION_TYPE_MERGE_MATURITY=7]="NEURON_PERMISSION_TYPE_MERGE_MATURITY",a[a.NEURON_PERMISSION_TYPE_DISBURSE_MATURITY=8]="NEURON_PERMISSION_TYPE_DISBURSE_MATURITY",a[a.NEURON_PERMISSION_TYPE_STAKE_MATURITY=9]="NEURON_PERMISSION_TYPE_STAKE_MATURITY",a[a.NEURON_PERMISSION_TYPE_MANAGE_VOTING_PERMISSION=10]="NEURON_PERMISSION_TYPE_MANAGE_VOTING_PERMISSION",a))(Be||{}),ze=(i=>(i[i.PROPOSAL_REWARD_STATUS_UNSPECIFIED=0]="PROPOSAL_REWARD_STATUS_UNSPECIFIED",i[i.PROPOSAL_REWARD_STATUS_ACCEPT_VOTES=1]="PROPOSAL_REWARD_STATUS_ACCEPT_VOTES",i[i.PROPOSAL_REWARD_STATUS_READY_TO_SETTLE=2]="PROPOSAL_REWARD_STATUS_READY_TO_SETTLE",i[i.PROPOSAL_REWARD_STATUS_SETTLED=3]="PROPOSAL_REWARD_STATUS_SETTLED",i))(ze||{}),Ye=(s=>(s[s.PROPOSAL_DECISION_STATUS_UNSPECIFIED=0]="PROPOSAL_DECISION_STATUS_UNSPECIFIED",s[s.PROPOSAL_DECISION_STATUS_OPEN=1]="PROPOSAL_DECISION_STATUS_OPEN",s[s.PROPOSAL_DECISION_STATUS_REJECTED=2]="PROPOSAL_DECISION_STATUS_REJECTED",s[s.PROPOSAL_DECISION_STATUS_ADOPTED=3]="PROPOSAL_DECISION_STATUS_ADOPTED",s[s.PROPOSAL_DECISION_STATUS_EXECUTED=4]="PROPOSAL_DECISION_STATUS_EXECUTED",s[s.PROPOSAL_DECISION_STATUS_FAILED=5]="PROPOSAL_DECISION_STATUS_FAILED",s))(Ye||{}),je=(o=>(o[o.Unspecified=0]="Unspecified",o[o.Yes=1]="Yes",o[o.No=2]="No",o))(je||{});var We=(s=>(s[s.Unspecified=0]="Unspecified",s[s.Pending=1]="Pending",s[s.Open=2]="Open",s[s.Committed=3]="Committed",s[s.Aborted=4]="Aborted",s[s.Adopted=5]="Adopted",s))(We||{}),Je=(o=>(o[o.TYPE_UNSPECIFIED=0]="TYPE_UNSPECIFIED",o[o.TYPE_SALE_NOT_OPEN=1]="TYPE_SALE_NOT_OPEN",o[o.TYPE_SALE_CLOSED=2]="TYPE_SALE_CLOSED",o))(Je||{}),Qe=(r=>(r[r.TYPE_UNSPECIFIED=0]="TYPE_UNSPECIFIED",r[r.TYPE_SALE_NOT_OPEN=1]="TYPE_SALE_NOT_OPEN",r[r.TYPE_SALE_CLOSED=2]="TYPE_SALE_CLOSED",r[r.TYPE_TICKET_EXISTS=3]="TYPE_TICKET_EXISTS",r[r.TYPE_INVALID_USER_AMOUNT=4]="TYPE_INVALID_USER_AMOUNT",r[r.TYPE_INVALID_SUBACCOUNT=5]="TYPE_INVALID_SUBACCOUNT",r[r.TYPE_INVALID_PRINCIPAL=6]="TYPE_INVALID_PRINCIPAL",r))(Qe||{});import{Canister as Ke,createServices as Xe,fromNullable as He,isNullish as Ze,toNullable as Ae}from"@dfinity/utils";var Fe=({IDL:t})=>{let v=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)}),e=t.Record({archive_wasm_hash:t.Vec(t.Nat8),root_wasm_hash:t.Vec(t.Nat8),swap_wasm_hash:t.Vec(t.Nat8),ledger_wasm_hash:t.Vec(t.Nat8),governance_wasm_hash:t.Vec(t.Nat8),index_wasm_hash:t.Vec(t.Nat8)}),o=t.Record({versions:t.Vec(e)}),i=t.Record({upgrade_steps:t.Opt(o),response_timestamp_seconds:t.Opt(t.Nat64),requested_timestamp_seconds:t.Opt(t.Nat64)}),d=t.Variant({DappCanisterManagement:t.Null,DaoCommunitySettings:t.Null,ApplicationBusinessLogic:t.Null,CriticalDappOperations:t.Null,TreasuryAssetManagement:t.Null,Governance:t.Null,SnsFrameworkManagement:t.Null}),s=t.Record({topic:t.Opt(d),validator_canister_id:t.Opt(t.Principal),target_canister_id:t.Opt(t.Principal),validator_method_name:t.Opt(t.Text),target_method_name:t.Opt(t.Text)}),r=t.Variant({NativeNervousSystemFunction:t.Record({}),GenericNervousSystemFunction:s}),c=t.Record({id:t.Nat64,name:t.Text,description:t.Opt(t.Text),function_type:t.Opt(r)}),z=t.Record({not_dissolving_neurons_e8s_buckets:t.Vec(t.Tuple(t.Nat64,t.Float64)),garbage_collectable_neurons_count:t.Nat64,neurons_with_invalid_stake_count:t.Nat64,not_dissolving_neurons_count_buckets:t.Vec(t.Tuple(t.Nat64,t.Nat64)),neurons_with_less_than_6_months_dissolve_delay_count:t.Nat64,dissolved_neurons_count:t.Nat64,total_staked_e8s:t.Nat64,total_supply_governance_tokens:t.Nat64,not_dissolving_neurons_count:t.Nat64,dissolved_neurons_e8s:t.Nat64,neurons_with_less_than_6_months_dissolve_delay_e8s:t.Nat64,dissolving_neurons_count_buckets:t.Vec(t.Tuple(t.Nat64,t.Nat64)),dissolving_neurons_count:t.Nat64,dissolving_neurons_e8s_buckets:t.Vec(t.Tuple(t.Nat64,t.Float64)),timestamp_seconds:t.Nat64}),y=t.Record({current_basis_points:t.Opt(t.Int32),updated_at_timestamp_seconds:t.Opt(t.Nat64)}),a=t.Record({old_target_version:t.Opt(e),new_target_version:t.Opt(e),is_advanced_automatically:t.Opt(t.Bool)}),Y=t.Record({human_readable:t.Opt(t.Text),upgrade_steps:t.Opt(o)}),j=t.Record({status:t.Opt(t.Variant({Success:t.Record({}),Timeout:t.Record({}),ExternalFailure:t.Record({}),InvalidState:t.Record({version:t.Opt(e)})})),human_readable:t.Opt(t.Text)}),_=t.Record({id:t.Nat64}),W=t.Record({current_version:t.Opt(e),expected_version:t.Opt(e),reason:t.Opt(t.Variant({UpgradeSnsToNextVersionProposal:_,BehindTargetVersion:t.Record({})}))}),J=t.Record({upgrade_steps:t.Opt(o)}),Q=t.Record({human_readable:t.Opt(t.Text),old_target_version:t.Opt(e),new_target_version:t.Opt(e)}),K=t.Record({event:t.Opt(t.Variant({TargetVersionSet:a,UpgradeStepsReset:Y,UpgradeOutcome:j,UpgradeStarted:W,UpgradeStepsRefreshed:J,TargetVersionReset:Q})),timestamp_seconds:t.Opt(t.Nat64)}),V=t.Record({entries:t.Vec(K)}),n=t.Record({id:t.Vec(t.Nat8)}),S=t.Record({followees:t.Vec(n)}),X=t.Record({followees:t.Vec(t.Tuple(t.Nat64,S))}),l=t.Record({permissions:t.Vec(t.Int32)}),H=t.Record({final_reward_rate_basis_points:t.Opt(t.Nat64),initial_reward_rate_basis_points:t.Opt(t.Nat64),reward_rate_transition_duration_seconds:t.Opt(t.Nat64),round_duration_seconds:t.Opt(t.Nat64)}),O=t.Record({default_followees:t.Opt(X),max_dissolve_delay_seconds:t.Opt(t.Nat64),max_dissolve_delay_bonus_percentage:t.Opt(t.Nat64),max_followees_per_function:t.Opt(t.Nat64),automatically_advance_target_version:t.Opt(t.Bool),neuron_claimer_permissions:t.Opt(l),neuron_minimum_stake_e8s:t.Opt(t.Nat64),max_neuron_age_for_age_bonus:t.Opt(t.Nat64),initial_voting_period_seconds:t.Opt(t.Nat64),neuron_minimum_dissolve_delay_to_vote_seconds:t.Opt(t.Nat64),reject_cost_e8s:t.Opt(t.Nat64),max_proposals_to_keep_per_action:t.Opt(t.Nat32),wait_for_quiet_deadline_increase_seconds:t.Opt(t.Nat64),max_number_of_neurons:t.Opt(t.Nat64),transaction_fee_e8s:t.Opt(t.Nat64),max_number_of_proposals_with_ballots:t.Opt(t.Nat64),max_age_bonus_percentage:t.Opt(t.Nat64),neuron_grantable_permissions:t.Opt(l),voting_rewards_parameters:t.Opt(H),maturity_modulation_disabled:t.Opt(t.Bool),max_number_of_principals_per_neuron:t.Opt(t.Nat64)}),T=t.Record({rounds_since_last_distribution:t.Opt(t.Nat64),actual_timestamp_seconds:t.Nat64,end_timestamp_seconds:t.Opt(t.Nat64),total_available_e8s_equivalent:t.Opt(t.Nat64),distributed_e8s_equivalent:t.Nat64,round:t.Nat64,settled_proposals:t.Vec(_)}),Z=t.Record({mark_failed_at_seconds:t.Nat64,checking_upgrade_lock:t.Nat64,proposal_id:t.Opt(t.Nat64),target_version:t.Opt(e)}),u=t.Record({error_message:t.Text,error_type:t.Int32}),N=t.Record({subaccount:t.Vec(t.Nat8)}),p=t.Record({owner:t.Opt(t.Principal),subaccount:t.Opt(N)}),h=t.Record({human_readable:t.Opt(t.Text)}),$=t.Record({e8s:t.Opt(t.Nat64)}),I=t.Record({xdrs_per_icp:t.Opt(h),icps_per_token:t.Opt(h),tokens:t.Opt($)}),D=t.Record({token:t.Opt(t.Int32),account:t.Opt(p),valuation_factors:t.Opt(I),timestamp_seconds:t.Opt(t.Nat64)}),f=t.Record({valuation:t.Opt(D)}),x=t.Record({archive_wasm_hash:t.Opt(t.Vec(t.Nat8)),root_wasm_hash:t.Opt(t.Vec(t.Nat8)),swap_wasm_hash:t.Opt(t.Vec(t.Nat8)),ledger_wasm_hash:t.Opt(t.Vec(t.Nat8)),governance_wasm_hash:t.Opt(t.Vec(t.Nat8)),index_wasm_hash:t.Opt(t.Vec(t.Nat8))}),L=t.Record({target_version:t.Opt(x)}),tt=t.Variant({TransferSnsTreasuryFunds:f,MintSnsTokens:f,AdvanceSnsTargetVersion:L}),et=t.Record({vote:t.Int32,cast_timestamp_seconds:t.Nat64,voting_power:t.Nat64}),w=t.Record({basis_points:t.Opt(t.Nat64)}),st=t.Record({no:t.Nat64,yes:t.Nat64,total:t.Nat64,timestamp_seconds:t.Nat64}),ot=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)}),at=t.Record({custom_function_id_to_topic:t.Vec(t.Tuple(t.Nat64,d))}),nt=t.Record({canister_ids:t.Vec(t.Principal)}),rt=t.Record({from_treasury:t.Int32,to_principal:t.Opt(t.Principal),to_subaccount:t.Opt(N),memo:t.Opt(t.Nat64),amount_e8s:t.Nat64}),it=t.Record({wasm_module_hash:t.Vec(t.Nat8),chunk_hashes_list:t.Vec(t.Vec(t.Nat8)),store_canister_id:t.Opt(t.Principal)}),ct=t.Record({new_canister_wasm:t.Vec(t.Nat8),mode:t.Opt(t.Int32),canister_id:t.Opt(t.Principal),chunked_canister_wasm:t.Opt(it),canister_upgrade_arg:t.Opt(t.Vec(t.Nat8))}),_t=t.Record({canister_ids:t.Vec(t.Principal),new_controllers:t.Vec(t.Principal)}),pt=t.Record({to_principal:t.Opt(t.Principal),to_subaccount:t.Opt(N),memo:t.Opt(t.Nat64),amount_e8s:t.Opt(t.Nat64)}),dt=t.Record({new_target:t.Opt(x)}),P=t.Record({url:t.Opt(t.Text),logo:t.Opt(t.Text),name:t.Opt(t.Text),description:t.Opt(t.Text)}),ut=t.Record({function_id:t.Nat64,payload:t.Vec(t.Nat8)}),lt=t.Record({token_symbol:t.Opt(t.Text),transfer_fee:t.Opt(t.Nat64),token_logo:t.Opt(t.Text),token_name:t.Opt(t.Text)}),mt=t.Record({motion_text:t.Text}),Ot=t.Variant({ManageNervousSystemParameters:O,AddGenericNervousSystemFunction:c,ManageDappCanisterSettings:ot,RemoveGenericNervousSystemFunction:t.Nat64,SetTopicsForCustomProposals:at,UpgradeSnsToNextVersion:t.Record({}),RegisterDappCanisters:nt,TransferSnsTreasuryFunds:rt,UpgradeSnsControlledCanister:ct,DeregisterDappCanisters:_t,MintSnsTokens:pt,AdvanceSnsTargetVersion:dt,Unspecified:t.Record({}),ManageSnsMetadata:P,ExecuteGenericNervousSystemFunction:ut,ManageLedgerParameters:lt,Motion:mt}),R=t.Record({url:t.Text,title:t.Text,action:t.Opt(Ot),summary:t.Text}),Nt=t.Record({current_deadline_timestamp_seconds:t.Nat64}),g=t.Record({id:t.Opt(_),payload_text_rendering:t.Opt(t.Text),action:t.Nat64,failure_reason:t.Opt(u),action_auxiliary:t.Opt(tt),ballots:t.Vec(t.Tuple(t.Text,et)),minimum_yes_proportion_of_total:t.Opt(w),reward_event_round:t.Nat64,failed_timestamp_seconds:t.Nat64,reward_event_end_timestamp_seconds:t.Opt(t.Nat64),proposal_creation_timestamp_seconds:t.Nat64,initial_voting_period_seconds:t.Nat64,reject_cost_e8s:t.Nat64,latest_tally:t.Opt(st),wait_for_quiet_deadline_increase_seconds:t.Nat64,decided_timestamp_seconds:t.Nat64,proposal:t.Opt(R),proposer:t.Opt(n),wait_for_quiet_state:t.Opt(Nt),minimum_yes_proportion_of_exercised:t.Opt(w),is_eligible_for_rewards:t.Bool,executed_timestamp_seconds:t.Nat64}),b=t.Record({memo:t.Nat64,amount_e8s:t.Nat64}),M=t.Record({function_id:t.Nat64,followees:t.Vec(n)}),F=t.Record({to_account:t.Opt(p),percentage_to_disburse:t.Nat32}),Rt=t.Record({requested_setting_for_auto_stake_maturity:t.Bool}),gt=t.Record({additional_dissolve_delay_seconds:t.Nat32}),vt=t.Record({dissolve_timestamp_seconds:t.Nat64}),yt=t.Variant({ChangeAutoStakeMaturity:Rt,StopDissolving:t.Record({}),StartDissolving:t.Record({}),IncreaseDissolveDelay:gt,SetDissolveTimestamp:vt}),C=t.Record({operation:t.Opt(yt)}),A=t.Record({vote:t.Int32,proposal:t.Opt(_)}),Vt=t.Record({amount_to_be_disbursed_e8s:t.Nat64,to_account:t.Opt(p)}),St=t.Record({controller:t.Opt(t.Principal),memo:t.Nat64}),Tt=t.Variant({MemoAndController:St,NeuronId:t.Record({})}),k=t.Record({by:t.Opt(Tt)}),E=t.Record({permissions_to_remove:t.Opt(l),principal_id:t.Opt(t.Principal)}),U=t.Record({permissions_to_add:t.Opt(l),principal_id:t.Opt(t.Principal)}),G=t.Record({percentage_to_merge:t.Nat32}),ht=t.Record({e8s:t.Nat64}),q=t.Record({to_account:t.Opt(p),amount:t.Opt(ht)}),ft=t.Variant({Split:b,Follow:M,DisburseMaturity:F,Configure:C,RegisterVote:A,SyncCommand:t.Record({}),MakeProposal:R,FinalizeDisburseMaturity:Vt,ClaimOrRefreshNeuron:k,RemoveNeuronPermissions:E,AddNeuronPermissions:U,MergeMaturity:G,Disburse:q}),xt=t.Record({command:t.Opt(ft),timestamp:t.Nat64}),wt=t.Record({principal:t.Opt(t.Principal),permission_type:t.Vec(t.Int32)}),Pt=t.Variant({DissolveDelaySeconds:t.Nat64,WhenDissolvedTimestampSeconds:t.Nat64}),bt=t.Record({timestamp_of_disbursement_seconds:t.Nat64,amount_e8s:t.Nat64,account_to_disburse_to:t.Opt(p),finalize_disbursement_timestamp_seconds:t.Opt(t.Nat64)}),m=t.Record({id:t.Opt(n),staked_maturity_e8s_equivalent:t.Opt(t.Nat64),permissions:t.Vec(wt),maturity_e8s_equivalent:t.Nat64,cached_neuron_stake_e8s:t.Nat64,created_timestamp_seconds:t.Nat64,source_nns_neuron_id:t.Opt(t.Nat64),auto_stake_maturity:t.Opt(t.Bool),aging_since_timestamp_seconds:t.Nat64,dissolve_state:t.Opt(Pt),voting_power_percentage_multiplier:t.Nat64,vesting_period_seconds:t.Opt(t.Nat64),disburse_maturity_in_progress:t.Vec(bt),followees:t.Vec(t.Tuple(t.Nat64,S)),neuron_fees_e8s:t.Nat64}),ke=t.Record({root_canister_id:t.Opt(t.Principal),timers:t.Opt(v),cached_upgrade_steps:t.Opt(i),id_to_nervous_system_functions:t.Vec(t.Tuple(t.Nat64,c)),metrics:t.Opt(z),maturity_modulation:t.Opt(y),upgrade_journal:t.Opt(V),mode:t.Int32,parameters:t.Opt(O),is_finalizing_disburse_maturity:t.Opt(t.Bool),deployed_version:t.Opt(e),sns_initialization_parameters:t.Text,latest_reward_event:t.Opt(T),pending_version:t.Opt(Z),swap_canister_id:t.Opt(t.Principal),ledger_canister_id:t.Opt(t.Principal),proposals:t.Vec(t.Tuple(t.Nat64,g)),in_flight_commands:t.Vec(t.Tuple(t.Text,xt)),sns_metadata:t.Opt(P),neurons:t.Vec(t.Tuple(t.Text,m)),target_version:t.Opt(e),genesis_timestamp_seconds:t.Nat64}),Mt=t.Record({id:t.Opt(n),amount_e8s:t.Opt(t.Nat64)}),Ft=t.Record({new_maturity_e8s:t.Opt(t.Nat64)}),Ct=t.Record({target_version:t.Opt(e)}),At=t.Record({}),kt=t.Record({principals:t.Vec(t.Principal)}),Et=t.Record({nns_neuron_hotkeys:t.Opt(kt),nns_neuron_controller:t.Opt(t.Principal),nns_neuron_id:t.Opt(t.Nat64)}),Ut=t.Variant({NeuronsFund:Et,Direct:t.Record({})}),Gt=t.Record({neuron_ids:t.Vec(n)}),qt=t.Record({controller:t.Opt(t.Principal),dissolve_delay_seconds:t.Opt(t.Nat64),participant:t.Opt(Ut),stake_e8s:t.Opt(t.Nat64),followees:t.Opt(Gt),neuron_id:t.Opt(n)}),Bt=t.Record({neuron_recipes:t.Vec(qt)}),zt=t.Record({neuron_recipes:t.Opt(Bt)}),Yt=t.Record({id:t.Opt(n),status:t.Int32}),jt=t.Record({swap_neurons:t.Vec(Yt)}),Wt=t.Variant({Ok:jt,Err:t.Int32}),Jt=t.Record({claim_swap_neurons_result:t.Opt(Wt)}),Qt=t.Record({maturity_modulation:t.Opt(y)}),Kt=t.Record({url:t.Opt(t.Text),logo:t.Opt(t.Text),name:t.Opt(t.Text),description:t.Opt(t.Text)}),Xt=t.Record({mode:t.Opt(t.Int32)}),Ht=t.Record({neuron_id:t.Opt(n)}),Zt=t.Variant({Error:u,Neuron:m}),$t=t.Record({result:t.Opt(Zt)}),B=t.Record({proposal_id:t.Opt(_)}),It=t.Variant({Error:u,Proposal:g}),Dt=t.Record({result:t.Opt(It)}),Lt=t.Variant({stopped:t.Null,stopping:t.Null,running:t.Null}),te=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}),ee=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)}),se=t.Record({status:Lt,memory_size:t.Nat,cycles:t.Nat,settings:te,query_stats:t.Opt(ee),idle_cycles_burned_per_day:t.Nat,module_hash:t.Opt(t.Vec(t.Nat8))}),oe=t.Record({deployed_version:t.Opt(e),pending_version:t.Opt(t.Record({mark_failed_at_seconds:t.Nat64,checking_upgrade_lock:t.Nat64,proposal_id:t.Nat64,target_version:t.Opt(e)}))}),ae=t.Record({sns_initialization_parameters:t.Text}),ne=t.Record({timers:t.Opt(v)}),re=t.Record({offset:t.Opt(t.Nat64),limit:t.Opt(t.Nat64)}),ie=t.Record({upgrade_journal:t.Opt(V),upgrade_steps:t.Opt(o),response_timestamp_seconds:t.Opt(t.Nat64),deployed_version:t.Opt(e),target_version:t.Opt(e),upgrade_journal_entry_count:t.Opt(t.Nat64)}),ce=t.Record({reserved_ids:t.Vec(t.Nat64),functions:t.Vec(c)}),_e=t.Record({of_principal:t.Opt(t.Principal),limit:t.Nat32,start_page_at:t.Opt(n)}),pe=t.Record({neurons:t.Vec(m)}),de=t.Record({include_reward_status:t.Vec(t.Int32),before_proposal:t.Opt(_),limit:t.Nat32,exclude_type:t.Vec(t.Nat64),include_status:t.Vec(t.Int32)}),ue=t.Record({include_ballots_by_caller:t.Opt(t.Bool),proposals:t.Vec(g)}),le=t.Record({}),me=t.Record({native_functions:t.Opt(t.Vec(c)),topic:t.Opt(d),is_critical:t.Opt(t.Bool),name:t.Opt(t.Text),description:t.Opt(t.Text),custom_functions:t.Opt(t.Vec(c))}),Oe=t.Record({uncategorized_functions:t.Opt(t.Vec(c)),topics:t.Opt(t.Vec(me))}),Ne=t.Record({percentage_to_stake:t.Opt(t.Nat32)}),Re=t.Variant({Split:b,Follow:M,DisburseMaturity:F,ClaimOrRefresh:k,Configure:C,RegisterVote:A,MakeProposal:R,StakeMaturity:Ne,RemoveNeuronPermissions:E,AddNeuronPermissions:U,MergeMaturity:G,Disburse:q}),ge=t.Record({subaccount:t.Vec(t.Nat8),command:t.Opt(Re)}),ve=t.Record({created_neuron_id:t.Opt(n)}),ye=t.Record({amount_disbursed_e8s:t.Nat64,amount_deducted_e8s:t.Opt(t.Nat64)}),Ve=t.Record({refreshed_neuron_id:t.Opt(n)}),Se=t.Record({maturity_e8s:t.Nat64,staked_maturity_e8s:t.Nat64}),Te=t.Record({merged_maturity_e8s:t.Nat64,new_stake_e8s:t.Nat64}),he=t.Record({transfer_block_height:t.Nat64}),fe=t.Variant({Error:u,Split:ve,Follow:t.Record({}),DisburseMaturity:ye,ClaimOrRefresh:Ve,Configure:t.Record({}),RegisterVote:t.Record({}),MakeProposal:B,RemoveNeuronPermission:t.Record({}),StakeMaturity:Se,MergeMaturity:Te,Disburse:he,AddNeuronPermission:t.Record({})}),xe=t.Record({command:t.Opt(fe)}),we=t.Record({recipient:t.Opt(p),amount_e8s:t.Opt(t.Nat64)}),Pe=t.Record({mode:t.Int32});return t.Service({add_maturity:t.Func([Mt],[Ft],[]),advance_target_version:t.Func([Ct],[At],[]),claim_swap_neurons:t.Func([zt],[Jt],[]),fail_stuck_upgrade_in_progress:t.Func([t.Record({})],[t.Record({})],[]),get_build_metadata:t.Func([],[t.Text],[]),get_latest_reward_event:t.Func([],[T],[]),get_maturity_modulation:t.Func([t.Record({})],[Qt],[]),get_metadata:t.Func([t.Record({})],[Kt],[]),get_mode:t.Func([t.Record({})],[Xt],[]),get_nervous_system_parameters:t.Func([t.Null],[O],[]),get_neuron:t.Func([Ht],[$t],[]),get_proposal:t.Func([B],[Dt],[]),get_root_canister_status:t.Func([t.Null],[se],[]),get_running_sns_version:t.Func([t.Record({})],[oe],[]),get_sns_initialization_parameters:t.Func([t.Record({})],[ae],[]),get_timers:t.Func([t.Record({})],[ne],[]),get_upgrade_journal:t.Func([re],[ie],[]),list_nervous_system_functions:t.Func([],[ce],[]),list_neurons:t.Func([_e],[pe],[]),list_proposals:t.Func([de],[ue],[]),list_topics:t.Func([le],[Oe],[]),manage_neuron:t.Func([ge],[xe],[]),mint_tokens:t.Func([we],[t.Record({})],[]),refresh_cached_upgrade_steps:t.Func([t.Record({})],[t.Record({})],[]),reset_timers:t.Func([t.Record({})],[t.Record({})],[]),set_mode:t.Func([Pe],[t.Record({})],[]),update_neuron:t.Func([m],[t.Opt(u)],[])})};var Ce=({IDL:t})=>{let v=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)}),e=t.Record({archive_wasm_hash:t.Vec(t.Nat8),root_wasm_hash:t.Vec(t.Nat8),swap_wasm_hash:t.Vec(t.Nat8),ledger_wasm_hash:t.Vec(t.Nat8),governance_wasm_hash:t.Vec(t.Nat8),index_wasm_hash:t.Vec(t.Nat8)}),o=t.Record({versions:t.Vec(e)}),i=t.Record({upgrade_steps:t.Opt(o),response_timestamp_seconds:t.Opt(t.Nat64),requested_timestamp_seconds:t.Opt(t.Nat64)}),d=t.Variant({DappCanisterManagement:t.Null,DaoCommunitySettings:t.Null,ApplicationBusinessLogic:t.Null,CriticalDappOperations:t.Null,TreasuryAssetManagement:t.Null,Governance:t.Null,SnsFrameworkManagement:t.Null}),s=t.Record({topic:t.Opt(d),validator_canister_id:t.Opt(t.Principal),target_canister_id:t.Opt(t.Principal),validator_method_name:t.Opt(t.Text),target_method_name:t.Opt(t.Text)}),r=t.Variant({NativeNervousSystemFunction:t.Record({}),GenericNervousSystemFunction:s}),c=t.Record({id:t.Nat64,name:t.Text,description:t.Opt(t.Text),function_type:t.Opt(r)}),z=t.Record({not_dissolving_neurons_e8s_buckets:t.Vec(t.Tuple(t.Nat64,t.Float64)),garbage_collectable_neurons_count:t.Nat64,neurons_with_invalid_stake_count:t.Nat64,not_dissolving_neurons_count_buckets:t.Vec(t.Tuple(t.Nat64,t.Nat64)),neurons_with_less_than_6_months_dissolve_delay_count:t.Nat64,dissolved_neurons_count:t.Nat64,total_staked_e8s:t.Nat64,total_supply_governance_tokens:t.Nat64,not_dissolving_neurons_count:t.Nat64,dissolved_neurons_e8s:t.Nat64,neurons_with_less_than_6_months_dissolve_delay_e8s:t.Nat64,dissolving_neurons_count_buckets:t.Vec(t.Tuple(t.Nat64,t.Nat64)),dissolving_neurons_count:t.Nat64,dissolving_neurons_e8s_buckets:t.Vec(t.Tuple(t.Nat64,t.Float64)),timestamp_seconds:t.Nat64}),y=t.Record({current_basis_points:t.Opt(t.Int32),updated_at_timestamp_seconds:t.Opt(t.Nat64)}),a=t.Record({old_target_version:t.Opt(e),new_target_version:t.Opt(e),is_advanced_automatically:t.Opt(t.Bool)}),Y=t.Record({human_readable:t.Opt(t.Text),upgrade_steps:t.Opt(o)}),j=t.Record({status:t.Opt(t.Variant({Success:t.Record({}),Timeout:t.Record({}),ExternalFailure:t.Record({}),InvalidState:t.Record({version:t.Opt(e)})})),human_readable:t.Opt(t.Text)}),_=t.Record({id:t.Nat64}),W=t.Record({current_version:t.Opt(e),expected_version:t.Opt(e),reason:t.Opt(t.Variant({UpgradeSnsToNextVersionProposal:_,BehindTargetVersion:t.Record({})}))}),J=t.Record({upgrade_steps:t.Opt(o)}),Q=t.Record({human_readable:t.Opt(t.Text),old_target_version:t.Opt(e),new_target_version:t.Opt(e)}),K=t.Record({event:t.Opt(t.Variant({TargetVersionSet:a,UpgradeStepsReset:Y,UpgradeOutcome:j,UpgradeStarted:W,UpgradeStepsRefreshed:J,TargetVersionReset:Q})),timestamp_seconds:t.Opt(t.Nat64)}),V=t.Record({entries:t.Vec(K)}),n=t.Record({id:t.Vec(t.Nat8)}),S=t.Record({followees:t.Vec(n)}),X=t.Record({followees:t.Vec(t.Tuple(t.Nat64,S))}),l=t.Record({permissions:t.Vec(t.Int32)}),H=t.Record({final_reward_rate_basis_points:t.Opt(t.Nat64),initial_reward_rate_basis_points:t.Opt(t.Nat64),reward_rate_transition_duration_seconds:t.Opt(t.Nat64),round_duration_seconds:t.Opt(t.Nat64)}),O=t.Record({default_followees:t.Opt(X),max_dissolve_delay_seconds:t.Opt(t.Nat64),max_dissolve_delay_bonus_percentage:t.Opt(t.Nat64),max_followees_per_function:t.Opt(t.Nat64),automatically_advance_target_version:t.Opt(t.Bool),neuron_claimer_permissions:t.Opt(l),neuron_minimum_stake_e8s:t.Opt(t.Nat64),max_neuron_age_for_age_bonus:t.Opt(t.Nat64),initial_voting_period_seconds:t.Opt(t.Nat64),neuron_minimum_dissolve_delay_to_vote_seconds:t.Opt(t.Nat64),reject_cost_e8s:t.Opt(t.Nat64),max_proposals_to_keep_per_action:t.Opt(t.Nat32),wait_for_quiet_deadline_increase_seconds:t.Opt(t.Nat64),max_number_of_neurons:t.Opt(t.Nat64),transaction_fee_e8s:t.Opt(t.Nat64),max_number_of_proposals_with_ballots:t.Opt(t.Nat64),max_age_bonus_percentage:t.Opt(t.Nat64),neuron_grantable_permissions:t.Opt(l),voting_rewards_parameters:t.Opt(H),maturity_modulation_disabled:t.Opt(t.Bool),max_number_of_principals_per_neuron:t.Opt(t.Nat64)}),T=t.Record({rounds_since_last_distribution:t.Opt(t.Nat64),actual_timestamp_seconds:t.Nat64,end_timestamp_seconds:t.Opt(t.Nat64),total_available_e8s_equivalent:t.Opt(t.Nat64),distributed_e8s_equivalent:t.Nat64,round:t.Nat64,settled_proposals:t.Vec(_)}),Z=t.Record({mark_failed_at_seconds:t.Nat64,checking_upgrade_lock:t.Nat64,proposal_id:t.Opt(t.Nat64),target_version:t.Opt(e)}),u=t.Record({error_message:t.Text,error_type:t.Int32}),N=t.Record({subaccount:t.Vec(t.Nat8)}),p=t.Record({owner:t.Opt(t.Principal),subaccount:t.Opt(N)}),h=t.Record({human_readable:t.Opt(t.Text)}),$=t.Record({e8s:t.Opt(t.Nat64)}),I=t.Record({xdrs_per_icp:t.Opt(h),icps_per_token:t.Opt(h),tokens:t.Opt($)}),D=t.Record({token:t.Opt(t.Int32),account:t.Opt(p),valuation_factors:t.Opt(I),timestamp_seconds:t.Opt(t.Nat64)}),f=t.Record({valuation:t.Opt(D)}),x=t.Record({archive_wasm_hash:t.Opt(t.Vec(t.Nat8)),root_wasm_hash:t.Opt(t.Vec(t.Nat8)),swap_wasm_hash:t.Opt(t.Vec(t.Nat8)),ledger_wasm_hash:t.Opt(t.Vec(t.Nat8)),governance_wasm_hash:t.Opt(t.Vec(t.Nat8)),index_wasm_hash:t.Opt(t.Vec(t.Nat8))}),L=t.Record({target_version:t.Opt(x)}),tt=t.Variant({TransferSnsTreasuryFunds:f,MintSnsTokens:f,AdvanceSnsTargetVersion:L}),et=t.Record({vote:t.Int32,cast_timestamp_seconds:t.Nat64,voting_power:t.Nat64}),w=t.Record({basis_points:t.Opt(t.Nat64)}),st=t.Record({no:t.Nat64,yes:t.Nat64,total:t.Nat64,timestamp_seconds:t.Nat64}),ot=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)}),at=t.Record({custom_function_id_to_topic:t.Vec(t.Tuple(t.Nat64,d))}),nt=t.Record({canister_ids:t.Vec(t.Principal)}),rt=t.Record({from_treasury:t.Int32,to_principal:t.Opt(t.Principal),to_subaccount:t.Opt(N),memo:t.Opt(t.Nat64),amount_e8s:t.Nat64}),it=t.Record({wasm_module_hash:t.Vec(t.Nat8),chunk_hashes_list:t.Vec(t.Vec(t.Nat8)),store_canister_id:t.Opt(t.Principal)}),ct=t.Record({new_canister_wasm:t.Vec(t.Nat8),mode:t.Opt(t.Int32),canister_id:t.Opt(t.Principal),chunked_canister_wasm:t.Opt(it),canister_upgrade_arg:t.Opt(t.Vec(t.Nat8))}),_t=t.Record({canister_ids:t.Vec(t.Principal),new_controllers:t.Vec(t.Principal)}),pt=t.Record({to_principal:t.Opt(t.Principal),to_subaccount:t.Opt(N),memo:t.Opt(t.Nat64),amount_e8s:t.Opt(t.Nat64)}),dt=t.Record({new_target:t.Opt(x)}),P=t.Record({url:t.Opt(t.Text),logo:t.Opt(t.Text),name:t.Opt(t.Text),description:t.Opt(t.Text)}),ut=t.Record({function_id:t.Nat64,payload:t.Vec(t.Nat8)}),lt=t.Record({token_symbol:t.Opt(t.Text),transfer_fee:t.Opt(t.Nat64),token_logo:t.Opt(t.Text),token_name:t.Opt(t.Text)}),mt=t.Record({motion_text:t.Text}),Ot=t.Variant({ManageNervousSystemParameters:O,AddGenericNervousSystemFunction:c,ManageDappCanisterSettings:ot,RemoveGenericNervousSystemFunction:t.Nat64,SetTopicsForCustomProposals:at,UpgradeSnsToNextVersion:t.Record({}),RegisterDappCanisters:nt,TransferSnsTreasuryFunds:rt,UpgradeSnsControlledCanister:ct,DeregisterDappCanisters:_t,MintSnsTokens:pt,AdvanceSnsTargetVersion:dt,Unspecified:t.Record({}),ManageSnsMetadata:P,ExecuteGenericNervousSystemFunction:ut,ManageLedgerParameters:lt,Motion:mt}),R=t.Record({url:t.Text,title:t.Text,action:t.Opt(Ot),summary:t.Text}),Nt=t.Record({current_deadline_timestamp_seconds:t.Nat64}),g=t.Record({id:t.Opt(_),payload_text_rendering:t.Opt(t.Text),action:t.Nat64,failure_reason:t.Opt(u),action_auxiliary:t.Opt(tt),ballots:t.Vec(t.Tuple(t.Text,et)),minimum_yes_proportion_of_total:t.Opt(w),reward_event_round:t.Nat64,failed_timestamp_seconds:t.Nat64,reward_event_end_timestamp_seconds:t.Opt(t.Nat64),proposal_creation_timestamp_seconds:t.Nat64,initial_voting_period_seconds:t.Nat64,reject_cost_e8s:t.Nat64,latest_tally:t.Opt(st),wait_for_quiet_deadline_increase_seconds:t.Nat64,decided_timestamp_seconds:t.Nat64,proposal:t.Opt(R),proposer:t.Opt(n),wait_for_quiet_state:t.Opt(Nt),minimum_yes_proportion_of_exercised:t.Opt(w),is_eligible_for_rewards:t.Bool,executed_timestamp_seconds:t.Nat64}),b=t.Record({memo:t.Nat64,amount_e8s:t.Nat64}),M=t.Record({function_id:t.Nat64,followees:t.Vec(n)}),F=t.Record({to_account:t.Opt(p),percentage_to_disburse:t.Nat32}),Rt=t.Record({requested_setting_for_auto_stake_maturity:t.Bool}),gt=t.Record({additional_dissolve_delay_seconds:t.Nat32}),vt=t.Record({dissolve_timestamp_seconds:t.Nat64}),yt=t.Variant({ChangeAutoStakeMaturity:Rt,StopDissolving:t.Record({}),StartDissolving:t.Record({}),IncreaseDissolveDelay:gt,SetDissolveTimestamp:vt}),C=t.Record({operation:t.Opt(yt)}),A=t.Record({vote:t.Int32,proposal:t.Opt(_)}),Vt=t.Record({amount_to_be_disbursed_e8s:t.Nat64,to_account:t.Opt(p)}),St=t.Record({controller:t.Opt(t.Principal),memo:t.Nat64}),Tt=t.Variant({MemoAndController:St,NeuronId:t.Record({})}),k=t.Record({by:t.Opt(Tt)}),E=t.Record({permissions_to_remove:t.Opt(l),principal_id:t.Opt(t.Principal)}),U=t.Record({permissions_to_add:t.Opt(l),principal_id:t.Opt(t.Principal)}),G=t.Record({percentage_to_merge:t.Nat32}),ht=t.Record({e8s:t.Nat64}),q=t.Record({to_account:t.Opt(p),amount:t.Opt(ht)}),ft=t.Variant({Split:b,Follow:M,DisburseMaturity:F,Configure:C,RegisterVote:A,SyncCommand:t.Record({}),MakeProposal:R,FinalizeDisburseMaturity:Vt,ClaimOrRefreshNeuron:k,RemoveNeuronPermissions:E,AddNeuronPermissions:U,MergeMaturity:G,Disburse:q}),xt=t.Record({command:t.Opt(ft),timestamp:t.Nat64}),wt=t.Record({principal:t.Opt(t.Principal),permission_type:t.Vec(t.Int32)}),Pt=t.Variant({DissolveDelaySeconds:t.Nat64,WhenDissolvedTimestampSeconds:t.Nat64}),bt=t.Record({timestamp_of_disbursement_seconds:t.Nat64,amount_e8s:t.Nat64,account_to_disburse_to:t.Opt(p),finalize_disbursement_timestamp_seconds:t.Opt(t.Nat64)}),m=t.Record({id:t.Opt(n),staked_maturity_e8s_equivalent:t.Opt(t.Nat64),permissions:t.Vec(wt),maturity_e8s_equivalent:t.Nat64,cached_neuron_stake_e8s:t.Nat64,created_timestamp_seconds:t.Nat64,source_nns_neuron_id:t.Opt(t.Nat64),auto_stake_maturity:t.Opt(t.Bool),aging_since_timestamp_seconds:t.Nat64,dissolve_state:t.Opt(Pt),voting_power_percentage_multiplier:t.Nat64,vesting_period_seconds:t.Opt(t.Nat64),disburse_maturity_in_progress:t.Vec(bt),followees:t.Vec(t.Tuple(t.Nat64,S)),neuron_fees_e8s:t.Nat64}),ke=t.Record({root_canister_id:t.Opt(t.Principal),timers:t.Opt(v),cached_upgrade_steps:t.Opt(i),id_to_nervous_system_functions:t.Vec(t.Tuple(t.Nat64,c)),metrics:t.Opt(z),maturity_modulation:t.Opt(y),upgrade_journal:t.Opt(V),mode:t.Int32,parameters:t.Opt(O),is_finalizing_disburse_maturity:t.Opt(t.Bool),deployed_version:t.Opt(e),sns_initialization_parameters:t.Text,latest_reward_event:t.Opt(T),pending_version:t.Opt(Z),swap_canister_id:t.Opt(t.Principal),ledger_canister_id:t.Opt(t.Principal),proposals:t.Vec(t.Tuple(t.Nat64,g)),in_flight_commands:t.Vec(t.Tuple(t.Text,xt)),sns_metadata:t.Opt(P),neurons:t.Vec(t.Tuple(t.Text,m)),target_version:t.Opt(e),genesis_timestamp_seconds:t.Nat64}),Mt=t.Record({id:t.Opt(n),amount_e8s:t.Opt(t.Nat64)}),Ft=t.Record({new_maturity_e8s:t.Opt(t.Nat64)}),Ct=t.Record({target_version:t.Opt(e)}),At=t.Record({}),kt=t.Record({principals:t.Vec(t.Principal)}),Et=t.Record({nns_neuron_hotkeys:t.Opt(kt),nns_neuron_controller:t.Opt(t.Principal),nns_neuron_id:t.Opt(t.Nat64)}),Ut=t.Variant({NeuronsFund:Et,Direct:t.Record({})}),Gt=t.Record({neuron_ids:t.Vec(n)}),qt=t.Record({controller:t.Opt(t.Principal),dissolve_delay_seconds:t.Opt(t.Nat64),participant:t.Opt(Ut),stake_e8s:t.Opt(t.Nat64),followees:t.Opt(Gt),neuron_id:t.Opt(n)}),Bt=t.Record({neuron_recipes:t.Vec(qt)}),zt=t.Record({neuron_recipes:t.Opt(Bt)}),Yt=t.Record({id:t.Opt(n),status:t.Int32}),jt=t.Record({swap_neurons:t.Vec(Yt)}),Wt=t.Variant({Ok:jt,Err:t.Int32}),Jt=t.Record({claim_swap_neurons_result:t.Opt(Wt)}),Qt=t.Record({maturity_modulation:t.Opt(y)}),Kt=t.Record({url:t.Opt(t.Text),logo:t.Opt(t.Text),name:t.Opt(t.Text),description:t.Opt(t.Text)}),Xt=t.Record({mode:t.Opt(t.Int32)}),Ht=t.Record({neuron_id:t.Opt(n)}),Zt=t.Variant({Error:u,Neuron:m}),$t=t.Record({result:t.Opt(Zt)}),B=t.Record({proposal_id:t.Opt(_)}),It=t.Variant({Error:u,Proposal:g}),Dt=t.Record({result:t.Opt(It)}),Lt=t.Variant({stopped:t.Null,stopping:t.Null,running:t.Null}),te=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}),ee=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)}),se=t.Record({status:Lt,memory_size:t.Nat,cycles:t.Nat,settings:te,query_stats:t.Opt(ee),idle_cycles_burned_per_day:t.Nat,module_hash:t.Opt(t.Vec(t.Nat8))}),oe=t.Record({deployed_version:t.Opt(e),pending_version:t.Opt(t.Record({mark_failed_at_seconds:t.Nat64,checking_upgrade_lock:t.Nat64,proposal_id:t.Nat64,target_version:t.Opt(e)}))}),ae=t.Record({sns_initialization_parameters:t.Text}),ne=t.Record({timers:t.Opt(v)}),re=t.Record({offset:t.Opt(t.Nat64),limit:t.Opt(t.Nat64)}),ie=t.Record({upgrade_journal:t.Opt(V),upgrade_steps:t.Opt(o),response_timestamp_seconds:t.Opt(t.Nat64),deployed_version:t.Opt(e),target_version:t.Opt(e),upgrade_journal_entry_count:t.Opt(t.Nat64)}),ce=t.Record({reserved_ids:t.Vec(t.Nat64),functions:t.Vec(c)}),_e=t.Record({of_principal:t.Opt(t.Principal),limit:t.Nat32,start_page_at:t.Opt(n)}),pe=t.Record({neurons:t.Vec(m)}),de=t.Record({include_reward_status:t.Vec(t.Int32),before_proposal:t.Opt(_),limit:t.Nat32,exclude_type:t.Vec(t.Nat64),include_status:t.Vec(t.Int32)}),ue=t.Record({include_ballots_by_caller:t.Opt(t.Bool),proposals:t.Vec(g)}),le=t.Record({}),me=t.Record({native_functions:t.Opt(t.Vec(c)),topic:t.Opt(d),is_critical:t.Opt(t.Bool),name:t.Opt(t.Text),description:t.Opt(t.Text),custom_functions:t.Opt(t.Vec(c))}),Oe=t.Record({uncategorized_functions:t.Opt(t.Vec(c)),topics:t.Opt(t.Vec(me))}),Ne=t.Record({percentage_to_stake:t.Opt(t.Nat32)}),Re=t.Variant({Split:b,Follow:M,DisburseMaturity:F,ClaimOrRefresh:k,Configure:C,RegisterVote:A,MakeProposal:R,StakeMaturity:Ne,RemoveNeuronPermissions:E,AddNeuronPermissions:U,MergeMaturity:G,Disburse:q}),ge=t.Record({subaccount:t.Vec(t.Nat8),command:t.Opt(Re)}),ve=t.Record({created_neuron_id:t.Opt(n)}),ye=t.Record({amount_disbursed_e8s:t.Nat64,amount_deducted_e8s:t.Opt(t.Nat64)}),Ve=t.Record({refreshed_neuron_id:t.Opt(n)}),Se=t.Record({maturity_e8s:t.Nat64,staked_maturity_e8s:t.Nat64}),Te=t.Record({merged_maturity_e8s:t.Nat64,new_stake_e8s:t.Nat64}),he=t.Record({transfer_block_height:t.Nat64}),fe=t.Variant({Error:u,Split:ve,Follow:t.Record({}),DisburseMaturity:ye,ClaimOrRefresh:Ve,Configure:t.Record({}),RegisterVote:t.Record({}),MakeProposal:B,RemoveNeuronPermission:t.Record({}),StakeMaturity:Se,MergeMaturity:Te,Disburse:he,AddNeuronPermission:t.Record({})}),xe=t.Record({command:t.Opt(fe)}),we=t.Record({recipient:t.Opt(p),amount_e8s:t.Opt(t.Nat64)}),Pe=t.Record({mode:t.Int32});return t.Service({add_maturity:t.Func([Mt],[Ft],[]),advance_target_version:t.Func([Ct],[At],[]),claim_swap_neurons:t.Func([zt],[Jt],[]),fail_stuck_upgrade_in_progress:t.Func([t.Record({})],[t.Record({})],[]),get_build_metadata:t.Func([],[t.Text],["query"]),get_latest_reward_event:t.Func([],[T],["query"]),get_maturity_modulation:t.Func([t.Record({})],[Qt],[]),get_metadata:t.Func([t.Record({})],[Kt],["query"]),get_mode:t.Func([t.Record({})],[Xt],["query"]),get_nervous_system_parameters:t.Func([t.Null],[O],["query"]),get_neuron:t.Func([Ht],[$t],["query"]),get_proposal:t.Func([B],[Dt],["query"]),get_root_canister_status:t.Func([t.Null],[se],[]),get_running_sns_version:t.Func([t.Record({})],[oe],["query"]),get_sns_initialization_parameters:t.Func([t.Record({})],[ae],["query"]),get_timers:t.Func([t.Record({})],[ne],["query"]),get_upgrade_journal:t.Func([re],[ie],["query"]),list_nervous_system_functions:t.Func([],[ce],["query"]),list_neurons:t.Func([_e],[pe],["query"]),list_proposals:t.Func([de],[ue],["query"]),list_topics:t.Func([le],[Oe],["query"]),manage_neuron:t.Func([ge],[xe],[]),mint_tokens:t.Func([we],[t.Record({})],[]),refresh_cached_upgrade_steps:t.Func([t.Record({})],[t.Record({})],[]),reset_timers:t.Func([t.Record({})],[t.Record({})],[]),set_mode:t.Func([Pe],[t.Record({})],[]),update_neuron:t.Func([m],[t.Opt(u)],[])})};var be=class t extends Ke{constructor(){super(...arguments);this.addMaturity=async e=>{let{id:o,amountE8s:i}=e,{new_maturity_e8s:d}=await this.caller(e).add_maturity({id:Ae(o),amount_e8s:Ae(i)}),s=He(d);if(Ze(s)||s<i)throw new Me("No maturity added")}}static create(e){let{service:o,certifiedService:i,canisterId:d}=Xe({options:e,idlFactory:Ce,certifiedIdlFactory:Fe});return new t(d,o,i)}};export{Je as GetOpenTicketErrorType,Qe as NewSaleTicketResponseErrorType,Ue as SnsGovernanceCanister,Me as SnsGovernanceError,be as SnsGovernanceTestCanister,Be as SnsNeuronPermissionType,Ye as SnsProposalDecisionStatus,ze as SnsProposalRewardStatus,Ge as SnsRootCanister,qe as SnsSwapCanister,De as SnsSwapGetOpenTicketError,We as SnsSwapLifecycle,Ie as SnsSwapNewTicketError,je as SnsVote,ts as SnsWrapper,$e as UnsupportedMethodError,Ee as fromCandidAction,es as initSnsWrapper,Le as neuronSubaccount};
|
|
1
|
+
import{a as ao}from"./chunk-63KCLBLM.js";import{a as qt,b as Bt}from"./chunk-ERFZ4WF4.js";import{a as zt}from"./chunk-PUAIJI6X.js";import{a as oo,b as so}from"./chunk-TJDVNGQZ.js";import{a as At}from"./chunk-4INNMFYU.js";import{a as Lt,b as eo,c as to,d as Yt}from"./chunk-7RSE53BN.js";var jt=(n=>(n[n.NEURON_PERMISSION_TYPE_UNSPECIFIED=0]="NEURON_PERMISSION_TYPE_UNSPECIFIED",n[n.NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE=1]="NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE",n[n.NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS=2]="NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS",n[n.NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL=3]="NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL",n[n.NEURON_PERMISSION_TYPE_VOTE=4]="NEURON_PERMISSION_TYPE_VOTE",n[n.NEURON_PERMISSION_TYPE_DISBURSE=5]="NEURON_PERMISSION_TYPE_DISBURSE",n[n.NEURON_PERMISSION_TYPE_SPLIT=6]="NEURON_PERMISSION_TYPE_SPLIT",n[n.NEURON_PERMISSION_TYPE_MERGE_MATURITY=7]="NEURON_PERMISSION_TYPE_MERGE_MATURITY",n[n.NEURON_PERMISSION_TYPE_DISBURSE_MATURITY=8]="NEURON_PERMISSION_TYPE_DISBURSE_MATURITY",n[n.NEURON_PERMISSION_TYPE_STAKE_MATURITY=9]="NEURON_PERMISSION_TYPE_STAKE_MATURITY",n[n.NEURON_PERMISSION_TYPE_MANAGE_VOTING_PERMISSION=10]="NEURON_PERMISSION_TYPE_MANAGE_VOTING_PERMISSION",n))(jt||{}),Wt=(i=>(i[i.PROPOSAL_REWARD_STATUS_UNSPECIFIED=0]="PROPOSAL_REWARD_STATUS_UNSPECIFIED",i[i.PROPOSAL_REWARD_STATUS_ACCEPT_VOTES=1]="PROPOSAL_REWARD_STATUS_ACCEPT_VOTES",i[i.PROPOSAL_REWARD_STATUS_READY_TO_SETTLE=2]="PROPOSAL_REWARD_STATUS_READY_TO_SETTLE",i[i.PROPOSAL_REWARD_STATUS_SETTLED=3]="PROPOSAL_REWARD_STATUS_SETTLED",i))(Wt||{}),Jt=(o=>(o[o.PROPOSAL_DECISION_STATUS_UNSPECIFIED=0]="PROPOSAL_DECISION_STATUS_UNSPECIFIED",o[o.PROPOSAL_DECISION_STATUS_OPEN=1]="PROPOSAL_DECISION_STATUS_OPEN",o[o.PROPOSAL_DECISION_STATUS_REJECTED=2]="PROPOSAL_DECISION_STATUS_REJECTED",o[o.PROPOSAL_DECISION_STATUS_ADOPTED=3]="PROPOSAL_DECISION_STATUS_ADOPTED",o[o.PROPOSAL_DECISION_STATUS_EXECUTED=4]="PROPOSAL_DECISION_STATUS_EXECUTED",o[o.PROPOSAL_DECISION_STATUS_FAILED=5]="PROPOSAL_DECISION_STATUS_FAILED",o))(Jt||{}),Qt=(s=>(s[s.Unspecified=0]="Unspecified",s[s.Yes=1]="Yes",s[s.No=2]="No",s))(Qt||{});var Kt=(o=>(o[o.Unspecified=0]="Unspecified",o[o.Pending=1]="Pending",o[o.Open=2]="Open",o[o.Committed=3]="Committed",o[o.Aborted=4]="Aborted",o[o.Adopted=5]="Adopted",o))(Kt||{}),Xt=(s=>(s[s.TYPE_UNSPECIFIED=0]="TYPE_UNSPECIFIED",s[s.TYPE_SALE_NOT_OPEN=1]="TYPE_SALE_NOT_OPEN",s[s.TYPE_SALE_CLOSED=2]="TYPE_SALE_CLOSED",s))(Xt||{}),Ht=(r=>(r[r.TYPE_UNSPECIFIED=0]="TYPE_UNSPECIFIED",r[r.TYPE_SALE_NOT_OPEN=1]="TYPE_SALE_NOT_OPEN",r[r.TYPE_SALE_CLOSED=2]="TYPE_SALE_CLOSED",r[r.TYPE_TICKET_EXISTS=3]="TYPE_TICKET_EXISTS",r[r.TYPE_INVALID_USER_AMOUNT=4]="TYPE_INVALID_USER_AMOUNT",r[r.TYPE_INVALID_SUBACCOUNT=5]="TYPE_INVALID_SUBACCOUNT",r[r.TYPE_INVALID_PRINCIPAL=6]="TYPE_INVALID_PRINCIPAL",r))(Ht||{});import{Canister as Zt,createServices as $t,fromNullable as It,isNullish as Dt,toNullable as Ut}from"@dfinity/utils";var kt=({IDL:e})=>{let v=e.Record({last_spawned_timestamp_seconds:e.Opt(e.Nat64),last_reset_timestamp_seconds:e.Opt(e.Nat64),requires_periodic_tasks:e.Opt(e.Bool)}),t=e.Record({archive_wasm_hash:e.Vec(e.Nat8),root_wasm_hash:e.Vec(e.Nat8),swap_wasm_hash:e.Vec(e.Nat8),ledger_wasm_hash:e.Vec(e.Nat8),governance_wasm_hash:e.Vec(e.Nat8),index_wasm_hash:e.Vec(e.Nat8)}),s=e.Record({versions:e.Vec(t)}),i=e.Record({upgrade_steps:e.Opt(s),response_timestamp_seconds:e.Opt(e.Nat64),requested_timestamp_seconds:e.Opt(e.Nat64)}),c=e.Variant({DappCanisterManagement:e.Null,DaoCommunitySettings:e.Null,ApplicationBusinessLogic:e.Null,CriticalDappOperations:e.Null,TreasuryAssetManagement:e.Null,Governance:e.Null,SnsFrameworkManagement:e.Null}),o=e.Record({topic:e.Opt(c),validator_canister_id:e.Opt(e.Principal),target_canister_id:e.Opt(e.Principal),validator_method_name:e.Opt(e.Text),target_method_name:e.Opt(e.Text)}),r=e.Variant({NativeNervousSystemFunction:e.Record({}),GenericNervousSystemFunction:o}),_=e.Record({id:e.Nat64,name:e.Text,description:e.Opt(e.Text),function_type:e.Opt(r)}),j=e.Record({not_dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),garbage_collectable_neurons_count:e.Nat64,neurons_with_invalid_stake_count:e.Nat64,not_dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),neurons_with_less_than_6_months_dissolve_delay_count:e.Nat64,dissolved_neurons_count:e.Nat64,total_staked_e8s:e.Nat64,total_supply_governance_tokens:e.Nat64,not_dissolving_neurons_count:e.Nat64,dissolved_neurons_e8s:e.Nat64,neurons_with_less_than_6_months_dissolve_delay_e8s:e.Nat64,dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),dissolving_neurons_count:e.Nat64,dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),timestamp_seconds:e.Nat64}),y=e.Record({current_basis_points:e.Opt(e.Int32),updated_at_timestamp_seconds:e.Opt(e.Nat64)}),n=e.Record({old_target_version:e.Opt(t),new_target_version:e.Opt(t),is_advanced_automatically:e.Opt(e.Bool)}),W=e.Record({human_readable:e.Opt(e.Text),upgrade_steps:e.Opt(s)}),J=e.Record({status:e.Opt(e.Variant({Success:e.Record({}),Timeout:e.Record({}),ExternalFailure:e.Record({}),InvalidState:e.Record({version:e.Opt(t)})})),human_readable:e.Opt(e.Text)}),p=e.Record({id:e.Nat64}),Q=e.Record({current_version:e.Opt(t),expected_version:e.Opt(t),reason:e.Opt(e.Variant({UpgradeSnsToNextVersionProposal:p,BehindTargetVersion:e.Record({})}))}),K=e.Record({upgrade_steps:e.Opt(s)}),X=e.Record({human_readable:e.Opt(e.Text),old_target_version:e.Opt(t),new_target_version:e.Opt(t)}),H=e.Record({event:e.Opt(e.Variant({TargetVersionSet:n,UpgradeStepsReset:W,UpgradeOutcome:J,UpgradeStarted:Q,UpgradeStepsRefreshed:K,TargetVersionReset:X})),timestamp_seconds:e.Opt(e.Nat64)}),V=e.Record({entries:e.Vec(H)}),a=e.Record({id:e.Vec(e.Nat8)}),S=e.Record({followees:e.Vec(a)}),Z=e.Record({followees:e.Vec(e.Tuple(e.Nat64,S))}),l=e.Record({permissions:e.Vec(e.Int32)}),$=e.Record({final_reward_rate_basis_points:e.Opt(e.Nat64),initial_reward_rate_basis_points:e.Opt(e.Nat64),reward_rate_transition_duration_seconds:e.Opt(e.Nat64),round_duration_seconds:e.Opt(e.Nat64)}),O=e.Record({default_followees:e.Opt(Z),max_dissolve_delay_seconds:e.Opt(e.Nat64),max_dissolve_delay_bonus_percentage:e.Opt(e.Nat64),max_followees_per_function:e.Opt(e.Nat64),automatically_advance_target_version:e.Opt(e.Bool),neuron_claimer_permissions:e.Opt(l),neuron_minimum_stake_e8s:e.Opt(e.Nat64),max_neuron_age_for_age_bonus:e.Opt(e.Nat64),initial_voting_period_seconds:e.Opt(e.Nat64),neuron_minimum_dissolve_delay_to_vote_seconds:e.Opt(e.Nat64),reject_cost_e8s:e.Opt(e.Nat64),max_proposals_to_keep_per_action:e.Opt(e.Nat32),wait_for_quiet_deadline_increase_seconds:e.Opt(e.Nat64),max_number_of_neurons:e.Opt(e.Nat64),transaction_fee_e8s:e.Opt(e.Nat64),max_number_of_proposals_with_ballots:e.Opt(e.Nat64),max_age_bonus_percentage:e.Opt(e.Nat64),neuron_grantable_permissions:e.Opt(l),voting_rewards_parameters:e.Opt($),maturity_modulation_disabled:e.Opt(e.Bool),max_number_of_principals_per_neuron:e.Opt(e.Nat64)}),T=e.Record({rounds_since_last_distribution:e.Opt(e.Nat64),actual_timestamp_seconds:e.Nat64,end_timestamp_seconds:e.Opt(e.Nat64),total_available_e8s_equivalent:e.Opt(e.Nat64),distributed_e8s_equivalent:e.Nat64,round:e.Nat64,settled_proposals:e.Vec(p)}),I=e.Record({mark_failed_at_seconds:e.Nat64,checking_upgrade_lock:e.Nat64,proposal_id:e.Opt(e.Nat64),target_version:e.Opt(t)}),u=e.Record({error_message:e.Text,error_type:e.Int32}),N=e.Record({subaccount:e.Vec(e.Nat8)}),d=e.Record({owner:e.Opt(e.Principal),subaccount:e.Opt(N)}),h=e.Record({human_readable:e.Opt(e.Text)}),D=e.Record({e8s:e.Opt(e.Nat64)}),L=e.Record({xdrs_per_icp:e.Opt(h),icps_per_token:e.Opt(h),tokens:e.Opt(D)}),ee=e.Record({token:e.Opt(e.Int32),account:e.Opt(d),valuation_factors:e.Opt(L),timestamp_seconds:e.Opt(e.Nat64)}),f=e.Record({valuation:e.Opt(ee)}),w=e.Record({archive_wasm_hash:e.Opt(e.Vec(e.Nat8)),root_wasm_hash:e.Opt(e.Vec(e.Nat8)),swap_wasm_hash:e.Opt(e.Vec(e.Nat8)),ledger_wasm_hash:e.Opt(e.Vec(e.Nat8)),governance_wasm_hash:e.Opt(e.Vec(e.Nat8)),index_wasm_hash:e.Opt(e.Vec(e.Nat8))}),te=e.Record({target_version:e.Opt(w)}),oe=e.Variant({TransferSnsTreasuryFunds:f,MintSnsTokens:f,AdvanceSnsTargetVersion:te}),se=e.Record({vote:e.Int32,cast_timestamp_seconds:e.Nat64,voting_power:e.Nat64}),x=e.Record({basis_points:e.Opt(e.Nat64)}),ae=e.Record({no:e.Nat64,yes:e.Nat64,total:e.Nat64,timestamp_seconds:e.Nat64}),ne=e.Record({freezing_threshold:e.Opt(e.Nat64),wasm_memory_threshold:e.Opt(e.Nat64),canister_ids:e.Vec(e.Principal),reserved_cycles_limit:e.Opt(e.Nat64),log_visibility:e.Opt(e.Int32),wasm_memory_limit:e.Opt(e.Nat64),memory_allocation:e.Opt(e.Nat64),compute_allocation:e.Opt(e.Nat64)}),re=e.Record({custom_function_id_to_topic:e.Vec(e.Tuple(e.Nat64,c))}),ie=e.Record({canister_ids:e.Vec(e.Principal)}),ce=e.Record({from_treasury:e.Int32,to_principal:e.Opt(e.Principal),to_subaccount:e.Opt(N),memo:e.Opt(e.Nat64),amount_e8s:e.Nat64}),_e=e.Record({wasm_module_hash:e.Vec(e.Nat8),chunk_hashes_list:e.Vec(e.Vec(e.Nat8)),store_canister_id:e.Opt(e.Principal)}),pe=e.Record({new_canister_wasm:e.Vec(e.Nat8),mode:e.Opt(e.Int32),canister_id:e.Opt(e.Principal),chunked_canister_wasm:e.Opt(_e),canister_upgrade_arg:e.Opt(e.Vec(e.Nat8))}),de=e.Record({canister_ids:e.Vec(e.Principal),new_controllers:e.Vec(e.Principal)}),ue=e.Record({to_principal:e.Opt(e.Principal),to_subaccount:e.Opt(N),memo:e.Opt(e.Nat64),amount_e8s:e.Opt(e.Nat64)}),le=e.Record({new_target:e.Opt(w)}),P=e.Record({url:e.Opt(e.Text),logo:e.Opt(e.Text),name:e.Opt(e.Text),description:e.Opt(e.Text)}),me=e.Record({function_id:e.Nat64,payload:e.Vec(e.Nat8)}),Oe=e.Record({token_symbol:e.Opt(e.Text),transfer_fee:e.Opt(e.Nat64),token_logo:e.Opt(e.Text),token_name:e.Opt(e.Text)}),Ne=e.Record({motion_text:e.Text}),Re=e.Variant({ManageNervousSystemParameters:O,AddGenericNervousSystemFunction:_,ManageDappCanisterSettings:ne,RemoveGenericNervousSystemFunction:e.Nat64,SetTopicsForCustomProposals:re,UpgradeSnsToNextVersion:e.Record({}),RegisterDappCanisters:ie,TransferSnsTreasuryFunds:ce,UpgradeSnsControlledCanister:pe,DeregisterDappCanisters:de,MintSnsTokens:ue,AdvanceSnsTargetVersion:le,Unspecified:e.Record({}),ManageSnsMetadata:P,ExecuteGenericNervousSystemFunction:me,ManageLedgerParameters:Oe,Motion:Ne}),R=e.Record({url:e.Text,title:e.Text,action:e.Opt(Re),summary:e.Text}),ge=e.Record({current_deadline_timestamp_seconds:e.Nat64}),g=e.Record({id:e.Opt(p),payload_text_rendering:e.Opt(e.Text),topic:e.Opt(c),action:e.Nat64,failure_reason:e.Opt(u),action_auxiliary:e.Opt(oe),ballots:e.Vec(e.Tuple(e.Text,se)),minimum_yes_proportion_of_total:e.Opt(x),reward_event_round:e.Nat64,failed_timestamp_seconds:e.Nat64,reward_event_end_timestamp_seconds:e.Opt(e.Nat64),proposal_creation_timestamp_seconds:e.Nat64,initial_voting_period_seconds:e.Nat64,reject_cost_e8s:e.Nat64,latest_tally:e.Opt(ae),wait_for_quiet_deadline_increase_seconds:e.Nat64,decided_timestamp_seconds:e.Nat64,proposal:e.Opt(R),proposer:e.Opt(a),wait_for_quiet_state:e.Opt(ge),minimum_yes_proportion_of_exercised:e.Opt(x),is_eligible_for_rewards:e.Bool,executed_timestamp_seconds:e.Nat64}),b=e.Record({memo:e.Nat64,amount_e8s:e.Nat64}),F=e.Record({function_id:e.Nat64,followees:e.Vec(a)}),M=e.Record({to_account:e.Opt(d),percentage_to_disburse:e.Nat32}),ve=e.Record({requested_setting_for_auto_stake_maturity:e.Bool}),ye=e.Record({additional_dissolve_delay_seconds:e.Nat32}),Ve=e.Record({dissolve_timestamp_seconds:e.Nat64}),Se=e.Variant({ChangeAutoStakeMaturity:ve,StopDissolving:e.Record({}),StartDissolving:e.Record({}),IncreaseDissolveDelay:ye,SetDissolveTimestamp:Ve}),C=e.Record({operation:e.Opt(Se)}),A=e.Record({vote:e.Int32,proposal:e.Opt(p)}),Te=e.Record({alias:e.Opt(e.Text),neuron_id:e.Opt(a)}),k=e.Record({topic:e.Opt(c),followees:e.Vec(Te)}),E=e.Record({topic_following:e.Vec(k)}),he=e.Record({amount_to_be_disbursed_e8s:e.Nat64,to_account:e.Opt(d)}),fe=e.Record({controller:e.Opt(e.Principal),memo:e.Nat64}),we=e.Variant({MemoAndController:fe,NeuronId:e.Record({})}),U=e.Record({by:e.Opt(we)}),G=e.Record({permissions_to_remove:e.Opt(l),principal_id:e.Opt(e.Principal)}),q=e.Record({permissions_to_add:e.Opt(l),principal_id:e.Opt(e.Principal)}),B=e.Record({percentage_to_merge:e.Nat32}),xe=e.Record({e8s:e.Nat64}),z=e.Record({to_account:e.Opt(d),amount:e.Opt(xe)}),Pe=e.Variant({Split:b,Follow:F,DisburseMaturity:M,Configure:C,RegisterVote:A,SetFollowing:E,SyncCommand:e.Record({}),MakeProposal:R,FinalizeDisburseMaturity:he,ClaimOrRefreshNeuron:U,RemoveNeuronPermissions:G,AddNeuronPermissions:q,MergeMaturity:B,Disburse:z}),be=e.Record({command:e.Opt(Pe),timestamp:e.Nat64}),Fe=e.Record({principal:e.Opt(e.Principal),permission_type:e.Vec(e.Int32)}),Me=e.Variant({DissolveDelaySeconds:e.Nat64,WhenDissolvedTimestampSeconds:e.Nat64}),Ce=e.Record({timestamp_of_disbursement_seconds:e.Nat64,amount_e8s:e.Nat64,account_to_disburse_to:e.Opt(d),finalize_disbursement_timestamp_seconds:e.Opt(e.Nat64)}),m=e.Record({id:e.Opt(a),staked_maturity_e8s_equivalent:e.Opt(e.Nat64),permissions:e.Vec(Fe),maturity_e8s_equivalent:e.Nat64,cached_neuron_stake_e8s:e.Nat64,created_timestamp_seconds:e.Nat64,topic_followees:e.Opt(e.Record({topic_id_to_followees:e.Vec(e.Tuple(e.Int32,k))})),source_nns_neuron_id:e.Opt(e.Nat64),auto_stake_maturity:e.Opt(e.Bool),aging_since_timestamp_seconds:e.Nat64,dissolve_state:e.Opt(Me),voting_power_percentage_multiplier:e.Nat64,vesting_period_seconds:e.Opt(e.Nat64),disburse_maturity_in_progress:e.Vec(Ce),followees:e.Vec(e.Tuple(e.Nat64,S)),neuron_fees_e8s:e.Nat64}),Gt=e.Record({root_canister_id:e.Opt(e.Principal),timers:e.Opt(v),cached_upgrade_steps:e.Opt(i),id_to_nervous_system_functions:e.Vec(e.Tuple(e.Nat64,_)),metrics:e.Opt(j),maturity_modulation:e.Opt(y),upgrade_journal:e.Opt(V),mode:e.Int32,parameters:e.Opt(O),is_finalizing_disburse_maturity:e.Opt(e.Bool),deployed_version:e.Opt(t),sns_initialization_parameters:e.Text,latest_reward_event:e.Opt(T),pending_version:e.Opt(I),swap_canister_id:e.Opt(e.Principal),ledger_canister_id:e.Opt(e.Principal),proposals:e.Vec(e.Tuple(e.Nat64,g)),in_flight_commands:e.Vec(e.Tuple(e.Text,be)),sns_metadata:e.Opt(P),neurons:e.Vec(e.Tuple(e.Text,m)),target_version:e.Opt(t),genesis_timestamp_seconds:e.Nat64}),Ae=e.Record({id:e.Opt(a),amount_e8s:e.Opt(e.Nat64)}),ke=e.Record({new_maturity_e8s:e.Opt(e.Nat64)}),Ee=e.Record({target_version:e.Opt(t)}),Ue=e.Record({}),Ge=e.Record({principals:e.Vec(e.Principal)}),qe=e.Record({nns_neuron_hotkeys:e.Opt(Ge),nns_neuron_controller:e.Opt(e.Principal),nns_neuron_id:e.Opt(e.Nat64)}),Be=e.Variant({NeuronsFund:qe,Direct:e.Record({})}),ze=e.Record({neuron_ids:e.Vec(a)}),Ye=e.Record({controller:e.Opt(e.Principal),dissolve_delay_seconds:e.Opt(e.Nat64),participant:e.Opt(Be),stake_e8s:e.Opt(e.Nat64),followees:e.Opt(ze),neuron_id:e.Opt(a)}),je=e.Record({neuron_recipes:e.Vec(Ye)}),We=e.Record({neuron_recipes:e.Opt(je)}),Je=e.Record({id:e.Opt(a),status:e.Int32}),Qe=e.Record({swap_neurons:e.Vec(Je)}),Ke=e.Variant({Ok:Qe,Err:e.Int32}),Xe=e.Record({claim_swap_neurons_result:e.Opt(Ke)}),He=e.Record({maturity_modulation:e.Opt(y)}),Ze=e.Record({url:e.Opt(e.Text),logo:e.Opt(e.Text),name:e.Opt(e.Text),description:e.Opt(e.Text)}),$e=e.Record({mode:e.Opt(e.Int32)}),Ie=e.Record({neuron_id:e.Opt(a)}),De=e.Variant({Error:u,Neuron:m}),Le=e.Record({result:e.Opt(De)}),Y=e.Record({proposal_id:e.Opt(p)}),et=e.Variant({Error:u,Proposal:g}),tt=e.Record({result:e.Opt(et)}),ot=e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),st=e.Record({freezing_threshold:e.Nat,wasm_memory_threshold:e.Opt(e.Nat),controllers:e.Vec(e.Principal),wasm_memory_limit:e.Opt(e.Nat),memory_allocation:e.Nat,compute_allocation:e.Nat}),at=e.Record({response_payload_bytes_total:e.Opt(e.Nat),num_instructions_total:e.Opt(e.Nat),num_calls_total:e.Opt(e.Nat),request_payload_bytes_total:e.Opt(e.Nat)}),nt=e.Record({status:ot,memory_size:e.Nat,cycles:e.Nat,settings:st,query_stats:e.Opt(at),idle_cycles_burned_per_day:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))}),rt=e.Record({deployed_version:e.Opt(t),pending_version:e.Opt(e.Record({mark_failed_at_seconds:e.Nat64,checking_upgrade_lock:e.Nat64,proposal_id:e.Nat64,target_version:e.Opt(t)}))}),it=e.Record({sns_initialization_parameters:e.Text}),ct=e.Record({timers:e.Opt(v)}),_t=e.Record({offset:e.Opt(e.Nat64),limit:e.Opt(e.Nat64)}),pt=e.Record({upgrade_journal:e.Opt(V),upgrade_steps:e.Opt(s),response_timestamp_seconds:e.Opt(e.Nat64),deployed_version:e.Opt(t),target_version:e.Opt(t),upgrade_journal_entry_count:e.Opt(e.Nat64)}),dt=e.Record({reserved_ids:e.Vec(e.Nat64),functions:e.Vec(_)}),ut=e.Record({of_principal:e.Opt(e.Principal),limit:e.Nat32,start_page_at:e.Opt(a)}),lt=e.Record({neurons:e.Vec(m)}),mt=e.Record({include_reward_status:e.Vec(e.Int32),before_proposal:e.Opt(p),limit:e.Nat32,exclude_type:e.Vec(e.Nat64),include_status:e.Vec(e.Int32)}),Ot=e.Record({include_ballots_by_caller:e.Opt(e.Bool),proposals:e.Vec(g)}),Nt=e.Record({}),Rt=e.Record({native_functions:e.Opt(e.Vec(_)),topic:e.Opt(c),is_critical:e.Opt(e.Bool),name:e.Opt(e.Text),description:e.Opt(e.Text),custom_functions:e.Opt(e.Vec(_))}),gt=e.Record({uncategorized_functions:e.Opt(e.Vec(_)),topics:e.Opt(e.Vec(Rt))}),vt=e.Record({percentage_to_stake:e.Opt(e.Nat32)}),yt=e.Variant({Split:b,Follow:F,DisburseMaturity:M,ClaimOrRefresh:U,Configure:C,RegisterVote:A,SetFollowing:E,MakeProposal:R,StakeMaturity:vt,RemoveNeuronPermissions:G,AddNeuronPermissions:q,MergeMaturity:B,Disburse:z}),Vt=e.Record({subaccount:e.Vec(e.Nat8),command:e.Opt(yt)}),St=e.Record({created_neuron_id:e.Opt(a)}),Tt=e.Record({amount_disbursed_e8s:e.Nat64,amount_deducted_e8s:e.Opt(e.Nat64)}),ht=e.Record({refreshed_neuron_id:e.Opt(a)}),ft=e.Record({maturity_e8s:e.Nat64,staked_maturity_e8s:e.Nat64}),wt=e.Record({merged_maturity_e8s:e.Nat64,new_stake_e8s:e.Nat64}),xt=e.Record({transfer_block_height:e.Nat64}),Pt=e.Variant({Error:u,Split:St,Follow:e.Record({}),DisburseMaturity:Tt,ClaimOrRefresh:ht,Configure:e.Record({}),RegisterVote:e.Record({}),SetFollowing:e.Record({}),MakeProposal:Y,RemoveNeuronPermission:e.Record({}),StakeMaturity:ft,MergeMaturity:wt,Disburse:xt,AddNeuronPermission:e.Record({})}),bt=e.Record({command:e.Opt(Pt)}),Ft=e.Record({recipient:e.Opt(d),amount_e8s:e.Opt(e.Nat64)}),Mt=e.Record({mode:e.Int32});return e.Service({add_maturity:e.Func([Ae],[ke],[]),advance_target_version:e.Func([Ee],[Ue],[]),claim_swap_neurons:e.Func([We],[Xe],[]),fail_stuck_upgrade_in_progress:e.Func([e.Record({})],[e.Record({})],[]),get_build_metadata:e.Func([],[e.Text],[]),get_latest_reward_event:e.Func([],[T],[]),get_maturity_modulation:e.Func([e.Record({})],[He],[]),get_metadata:e.Func([e.Record({})],[Ze],[]),get_mode:e.Func([e.Record({})],[$e],[]),get_nervous_system_parameters:e.Func([e.Null],[O],[]),get_neuron:e.Func([Ie],[Le],[]),get_proposal:e.Func([Y],[tt],[]),get_root_canister_status:e.Func([e.Null],[nt],[]),get_running_sns_version:e.Func([e.Record({})],[rt],[]),get_sns_initialization_parameters:e.Func([e.Record({})],[it],[]),get_timers:e.Func([e.Record({})],[ct],[]),get_upgrade_journal:e.Func([_t],[pt],[]),list_nervous_system_functions:e.Func([],[dt],[]),list_neurons:e.Func([ut],[lt],[]),list_proposals:e.Func([mt],[Ot],[]),list_topics:e.Func([Nt],[gt],[]),manage_neuron:e.Func([Vt],[bt],[]),mint_tokens:e.Func([Ft],[e.Record({})],[]),refresh_cached_upgrade_steps:e.Func([e.Record({})],[e.Record({})],[]),reset_timers:e.Func([e.Record({})],[e.Record({})],[]),set_mode:e.Func([Mt],[e.Record({})],[]),update_neuron:e.Func([m],[e.Opt(u)],[])})};var Et=({IDL:e})=>{let v=e.Record({last_spawned_timestamp_seconds:e.Opt(e.Nat64),last_reset_timestamp_seconds:e.Opt(e.Nat64),requires_periodic_tasks:e.Opt(e.Bool)}),t=e.Record({archive_wasm_hash:e.Vec(e.Nat8),root_wasm_hash:e.Vec(e.Nat8),swap_wasm_hash:e.Vec(e.Nat8),ledger_wasm_hash:e.Vec(e.Nat8),governance_wasm_hash:e.Vec(e.Nat8),index_wasm_hash:e.Vec(e.Nat8)}),s=e.Record({versions:e.Vec(t)}),i=e.Record({upgrade_steps:e.Opt(s),response_timestamp_seconds:e.Opt(e.Nat64),requested_timestamp_seconds:e.Opt(e.Nat64)}),c=e.Variant({DappCanisterManagement:e.Null,DaoCommunitySettings:e.Null,ApplicationBusinessLogic:e.Null,CriticalDappOperations:e.Null,TreasuryAssetManagement:e.Null,Governance:e.Null,SnsFrameworkManagement:e.Null}),o=e.Record({topic:e.Opt(c),validator_canister_id:e.Opt(e.Principal),target_canister_id:e.Opt(e.Principal),validator_method_name:e.Opt(e.Text),target_method_name:e.Opt(e.Text)}),r=e.Variant({NativeNervousSystemFunction:e.Record({}),GenericNervousSystemFunction:o}),_=e.Record({id:e.Nat64,name:e.Text,description:e.Opt(e.Text),function_type:e.Opt(r)}),j=e.Record({not_dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),garbage_collectable_neurons_count:e.Nat64,neurons_with_invalid_stake_count:e.Nat64,not_dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),neurons_with_less_than_6_months_dissolve_delay_count:e.Nat64,dissolved_neurons_count:e.Nat64,total_staked_e8s:e.Nat64,total_supply_governance_tokens:e.Nat64,not_dissolving_neurons_count:e.Nat64,dissolved_neurons_e8s:e.Nat64,neurons_with_less_than_6_months_dissolve_delay_e8s:e.Nat64,dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),dissolving_neurons_count:e.Nat64,dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),timestamp_seconds:e.Nat64}),y=e.Record({current_basis_points:e.Opt(e.Int32),updated_at_timestamp_seconds:e.Opt(e.Nat64)}),n=e.Record({old_target_version:e.Opt(t),new_target_version:e.Opt(t),is_advanced_automatically:e.Opt(e.Bool)}),W=e.Record({human_readable:e.Opt(e.Text),upgrade_steps:e.Opt(s)}),J=e.Record({status:e.Opt(e.Variant({Success:e.Record({}),Timeout:e.Record({}),ExternalFailure:e.Record({}),InvalidState:e.Record({version:e.Opt(t)})})),human_readable:e.Opt(e.Text)}),p=e.Record({id:e.Nat64}),Q=e.Record({current_version:e.Opt(t),expected_version:e.Opt(t),reason:e.Opt(e.Variant({UpgradeSnsToNextVersionProposal:p,BehindTargetVersion:e.Record({})}))}),K=e.Record({upgrade_steps:e.Opt(s)}),X=e.Record({human_readable:e.Opt(e.Text),old_target_version:e.Opt(t),new_target_version:e.Opt(t)}),H=e.Record({event:e.Opt(e.Variant({TargetVersionSet:n,UpgradeStepsReset:W,UpgradeOutcome:J,UpgradeStarted:Q,UpgradeStepsRefreshed:K,TargetVersionReset:X})),timestamp_seconds:e.Opt(e.Nat64)}),V=e.Record({entries:e.Vec(H)}),a=e.Record({id:e.Vec(e.Nat8)}),S=e.Record({followees:e.Vec(a)}),Z=e.Record({followees:e.Vec(e.Tuple(e.Nat64,S))}),l=e.Record({permissions:e.Vec(e.Int32)}),$=e.Record({final_reward_rate_basis_points:e.Opt(e.Nat64),initial_reward_rate_basis_points:e.Opt(e.Nat64),reward_rate_transition_duration_seconds:e.Opt(e.Nat64),round_duration_seconds:e.Opt(e.Nat64)}),O=e.Record({default_followees:e.Opt(Z),max_dissolve_delay_seconds:e.Opt(e.Nat64),max_dissolve_delay_bonus_percentage:e.Opt(e.Nat64),max_followees_per_function:e.Opt(e.Nat64),automatically_advance_target_version:e.Opt(e.Bool),neuron_claimer_permissions:e.Opt(l),neuron_minimum_stake_e8s:e.Opt(e.Nat64),max_neuron_age_for_age_bonus:e.Opt(e.Nat64),initial_voting_period_seconds:e.Opt(e.Nat64),neuron_minimum_dissolve_delay_to_vote_seconds:e.Opt(e.Nat64),reject_cost_e8s:e.Opt(e.Nat64),max_proposals_to_keep_per_action:e.Opt(e.Nat32),wait_for_quiet_deadline_increase_seconds:e.Opt(e.Nat64),max_number_of_neurons:e.Opt(e.Nat64),transaction_fee_e8s:e.Opt(e.Nat64),max_number_of_proposals_with_ballots:e.Opt(e.Nat64),max_age_bonus_percentage:e.Opt(e.Nat64),neuron_grantable_permissions:e.Opt(l),voting_rewards_parameters:e.Opt($),maturity_modulation_disabled:e.Opt(e.Bool),max_number_of_principals_per_neuron:e.Opt(e.Nat64)}),T=e.Record({rounds_since_last_distribution:e.Opt(e.Nat64),actual_timestamp_seconds:e.Nat64,end_timestamp_seconds:e.Opt(e.Nat64),total_available_e8s_equivalent:e.Opt(e.Nat64),distributed_e8s_equivalent:e.Nat64,round:e.Nat64,settled_proposals:e.Vec(p)}),I=e.Record({mark_failed_at_seconds:e.Nat64,checking_upgrade_lock:e.Nat64,proposal_id:e.Opt(e.Nat64),target_version:e.Opt(t)}),u=e.Record({error_message:e.Text,error_type:e.Int32}),N=e.Record({subaccount:e.Vec(e.Nat8)}),d=e.Record({owner:e.Opt(e.Principal),subaccount:e.Opt(N)}),h=e.Record({human_readable:e.Opt(e.Text)}),D=e.Record({e8s:e.Opt(e.Nat64)}),L=e.Record({xdrs_per_icp:e.Opt(h),icps_per_token:e.Opt(h),tokens:e.Opt(D)}),ee=e.Record({token:e.Opt(e.Int32),account:e.Opt(d),valuation_factors:e.Opt(L),timestamp_seconds:e.Opt(e.Nat64)}),f=e.Record({valuation:e.Opt(ee)}),w=e.Record({archive_wasm_hash:e.Opt(e.Vec(e.Nat8)),root_wasm_hash:e.Opt(e.Vec(e.Nat8)),swap_wasm_hash:e.Opt(e.Vec(e.Nat8)),ledger_wasm_hash:e.Opt(e.Vec(e.Nat8)),governance_wasm_hash:e.Opt(e.Vec(e.Nat8)),index_wasm_hash:e.Opt(e.Vec(e.Nat8))}),te=e.Record({target_version:e.Opt(w)}),oe=e.Variant({TransferSnsTreasuryFunds:f,MintSnsTokens:f,AdvanceSnsTargetVersion:te}),se=e.Record({vote:e.Int32,cast_timestamp_seconds:e.Nat64,voting_power:e.Nat64}),x=e.Record({basis_points:e.Opt(e.Nat64)}),ae=e.Record({no:e.Nat64,yes:e.Nat64,total:e.Nat64,timestamp_seconds:e.Nat64}),ne=e.Record({freezing_threshold:e.Opt(e.Nat64),wasm_memory_threshold:e.Opt(e.Nat64),canister_ids:e.Vec(e.Principal),reserved_cycles_limit:e.Opt(e.Nat64),log_visibility:e.Opt(e.Int32),wasm_memory_limit:e.Opt(e.Nat64),memory_allocation:e.Opt(e.Nat64),compute_allocation:e.Opt(e.Nat64)}),re=e.Record({custom_function_id_to_topic:e.Vec(e.Tuple(e.Nat64,c))}),ie=e.Record({canister_ids:e.Vec(e.Principal)}),ce=e.Record({from_treasury:e.Int32,to_principal:e.Opt(e.Principal),to_subaccount:e.Opt(N),memo:e.Opt(e.Nat64),amount_e8s:e.Nat64}),_e=e.Record({wasm_module_hash:e.Vec(e.Nat8),chunk_hashes_list:e.Vec(e.Vec(e.Nat8)),store_canister_id:e.Opt(e.Principal)}),pe=e.Record({new_canister_wasm:e.Vec(e.Nat8),mode:e.Opt(e.Int32),canister_id:e.Opt(e.Principal),chunked_canister_wasm:e.Opt(_e),canister_upgrade_arg:e.Opt(e.Vec(e.Nat8))}),de=e.Record({canister_ids:e.Vec(e.Principal),new_controllers:e.Vec(e.Principal)}),ue=e.Record({to_principal:e.Opt(e.Principal),to_subaccount:e.Opt(N),memo:e.Opt(e.Nat64),amount_e8s:e.Opt(e.Nat64)}),le=e.Record({new_target:e.Opt(w)}),P=e.Record({url:e.Opt(e.Text),logo:e.Opt(e.Text),name:e.Opt(e.Text),description:e.Opt(e.Text)}),me=e.Record({function_id:e.Nat64,payload:e.Vec(e.Nat8)}),Oe=e.Record({token_symbol:e.Opt(e.Text),transfer_fee:e.Opt(e.Nat64),token_logo:e.Opt(e.Text),token_name:e.Opt(e.Text)}),Ne=e.Record({motion_text:e.Text}),Re=e.Variant({ManageNervousSystemParameters:O,AddGenericNervousSystemFunction:_,ManageDappCanisterSettings:ne,RemoveGenericNervousSystemFunction:e.Nat64,SetTopicsForCustomProposals:re,UpgradeSnsToNextVersion:e.Record({}),RegisterDappCanisters:ie,TransferSnsTreasuryFunds:ce,UpgradeSnsControlledCanister:pe,DeregisterDappCanisters:de,MintSnsTokens:ue,AdvanceSnsTargetVersion:le,Unspecified:e.Record({}),ManageSnsMetadata:P,ExecuteGenericNervousSystemFunction:me,ManageLedgerParameters:Oe,Motion:Ne}),R=e.Record({url:e.Text,title:e.Text,action:e.Opt(Re),summary:e.Text}),ge=e.Record({current_deadline_timestamp_seconds:e.Nat64}),g=e.Record({id:e.Opt(p),payload_text_rendering:e.Opt(e.Text),topic:e.Opt(c),action:e.Nat64,failure_reason:e.Opt(u),action_auxiliary:e.Opt(oe),ballots:e.Vec(e.Tuple(e.Text,se)),minimum_yes_proportion_of_total:e.Opt(x),reward_event_round:e.Nat64,failed_timestamp_seconds:e.Nat64,reward_event_end_timestamp_seconds:e.Opt(e.Nat64),proposal_creation_timestamp_seconds:e.Nat64,initial_voting_period_seconds:e.Nat64,reject_cost_e8s:e.Nat64,latest_tally:e.Opt(ae),wait_for_quiet_deadline_increase_seconds:e.Nat64,decided_timestamp_seconds:e.Nat64,proposal:e.Opt(R),proposer:e.Opt(a),wait_for_quiet_state:e.Opt(ge),minimum_yes_proportion_of_exercised:e.Opt(x),is_eligible_for_rewards:e.Bool,executed_timestamp_seconds:e.Nat64}),b=e.Record({memo:e.Nat64,amount_e8s:e.Nat64}),F=e.Record({function_id:e.Nat64,followees:e.Vec(a)}),M=e.Record({to_account:e.Opt(d),percentage_to_disburse:e.Nat32}),ve=e.Record({requested_setting_for_auto_stake_maturity:e.Bool}),ye=e.Record({additional_dissolve_delay_seconds:e.Nat32}),Ve=e.Record({dissolve_timestamp_seconds:e.Nat64}),Se=e.Variant({ChangeAutoStakeMaturity:ve,StopDissolving:e.Record({}),StartDissolving:e.Record({}),IncreaseDissolveDelay:ye,SetDissolveTimestamp:Ve}),C=e.Record({operation:e.Opt(Se)}),A=e.Record({vote:e.Int32,proposal:e.Opt(p)}),Te=e.Record({alias:e.Opt(e.Text),neuron_id:e.Opt(a)}),k=e.Record({topic:e.Opt(c),followees:e.Vec(Te)}),E=e.Record({topic_following:e.Vec(k)}),he=e.Record({amount_to_be_disbursed_e8s:e.Nat64,to_account:e.Opt(d)}),fe=e.Record({controller:e.Opt(e.Principal),memo:e.Nat64}),we=e.Variant({MemoAndController:fe,NeuronId:e.Record({})}),U=e.Record({by:e.Opt(we)}),G=e.Record({permissions_to_remove:e.Opt(l),principal_id:e.Opt(e.Principal)}),q=e.Record({permissions_to_add:e.Opt(l),principal_id:e.Opt(e.Principal)}),B=e.Record({percentage_to_merge:e.Nat32}),xe=e.Record({e8s:e.Nat64}),z=e.Record({to_account:e.Opt(d),amount:e.Opt(xe)}),Pe=e.Variant({Split:b,Follow:F,DisburseMaturity:M,Configure:C,RegisterVote:A,SetFollowing:E,SyncCommand:e.Record({}),MakeProposal:R,FinalizeDisburseMaturity:he,ClaimOrRefreshNeuron:U,RemoveNeuronPermissions:G,AddNeuronPermissions:q,MergeMaturity:B,Disburse:z}),be=e.Record({command:e.Opt(Pe),timestamp:e.Nat64}),Fe=e.Record({principal:e.Opt(e.Principal),permission_type:e.Vec(e.Int32)}),Me=e.Variant({DissolveDelaySeconds:e.Nat64,WhenDissolvedTimestampSeconds:e.Nat64}),Ce=e.Record({timestamp_of_disbursement_seconds:e.Nat64,amount_e8s:e.Nat64,account_to_disburse_to:e.Opt(d),finalize_disbursement_timestamp_seconds:e.Opt(e.Nat64)}),m=e.Record({id:e.Opt(a),staked_maturity_e8s_equivalent:e.Opt(e.Nat64),permissions:e.Vec(Fe),maturity_e8s_equivalent:e.Nat64,cached_neuron_stake_e8s:e.Nat64,created_timestamp_seconds:e.Nat64,topic_followees:e.Opt(e.Record({topic_id_to_followees:e.Vec(e.Tuple(e.Int32,k))})),source_nns_neuron_id:e.Opt(e.Nat64),auto_stake_maturity:e.Opt(e.Bool),aging_since_timestamp_seconds:e.Nat64,dissolve_state:e.Opt(Me),voting_power_percentage_multiplier:e.Nat64,vesting_period_seconds:e.Opt(e.Nat64),disburse_maturity_in_progress:e.Vec(Ce),followees:e.Vec(e.Tuple(e.Nat64,S)),neuron_fees_e8s:e.Nat64}),Gt=e.Record({root_canister_id:e.Opt(e.Principal),timers:e.Opt(v),cached_upgrade_steps:e.Opt(i),id_to_nervous_system_functions:e.Vec(e.Tuple(e.Nat64,_)),metrics:e.Opt(j),maturity_modulation:e.Opt(y),upgrade_journal:e.Opt(V),mode:e.Int32,parameters:e.Opt(O),is_finalizing_disburse_maturity:e.Opt(e.Bool),deployed_version:e.Opt(t),sns_initialization_parameters:e.Text,latest_reward_event:e.Opt(T),pending_version:e.Opt(I),swap_canister_id:e.Opt(e.Principal),ledger_canister_id:e.Opt(e.Principal),proposals:e.Vec(e.Tuple(e.Nat64,g)),in_flight_commands:e.Vec(e.Tuple(e.Text,be)),sns_metadata:e.Opt(P),neurons:e.Vec(e.Tuple(e.Text,m)),target_version:e.Opt(t),genesis_timestamp_seconds:e.Nat64}),Ae=e.Record({id:e.Opt(a),amount_e8s:e.Opt(e.Nat64)}),ke=e.Record({new_maturity_e8s:e.Opt(e.Nat64)}),Ee=e.Record({target_version:e.Opt(t)}),Ue=e.Record({}),Ge=e.Record({principals:e.Vec(e.Principal)}),qe=e.Record({nns_neuron_hotkeys:e.Opt(Ge),nns_neuron_controller:e.Opt(e.Principal),nns_neuron_id:e.Opt(e.Nat64)}),Be=e.Variant({NeuronsFund:qe,Direct:e.Record({})}),ze=e.Record({neuron_ids:e.Vec(a)}),Ye=e.Record({controller:e.Opt(e.Principal),dissolve_delay_seconds:e.Opt(e.Nat64),participant:e.Opt(Be),stake_e8s:e.Opt(e.Nat64),followees:e.Opt(ze),neuron_id:e.Opt(a)}),je=e.Record({neuron_recipes:e.Vec(Ye)}),We=e.Record({neuron_recipes:e.Opt(je)}),Je=e.Record({id:e.Opt(a),status:e.Int32}),Qe=e.Record({swap_neurons:e.Vec(Je)}),Ke=e.Variant({Ok:Qe,Err:e.Int32}),Xe=e.Record({claim_swap_neurons_result:e.Opt(Ke)}),He=e.Record({maturity_modulation:e.Opt(y)}),Ze=e.Record({url:e.Opt(e.Text),logo:e.Opt(e.Text),name:e.Opt(e.Text),description:e.Opt(e.Text)}),$e=e.Record({mode:e.Opt(e.Int32)}),Ie=e.Record({neuron_id:e.Opt(a)}),De=e.Variant({Error:u,Neuron:m}),Le=e.Record({result:e.Opt(De)}),Y=e.Record({proposal_id:e.Opt(p)}),et=e.Variant({Error:u,Proposal:g}),tt=e.Record({result:e.Opt(et)}),ot=e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),st=e.Record({freezing_threshold:e.Nat,wasm_memory_threshold:e.Opt(e.Nat),controllers:e.Vec(e.Principal),wasm_memory_limit:e.Opt(e.Nat),memory_allocation:e.Nat,compute_allocation:e.Nat}),at=e.Record({response_payload_bytes_total:e.Opt(e.Nat),num_instructions_total:e.Opt(e.Nat),num_calls_total:e.Opt(e.Nat),request_payload_bytes_total:e.Opt(e.Nat)}),nt=e.Record({status:ot,memory_size:e.Nat,cycles:e.Nat,settings:st,query_stats:e.Opt(at),idle_cycles_burned_per_day:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))}),rt=e.Record({deployed_version:e.Opt(t),pending_version:e.Opt(e.Record({mark_failed_at_seconds:e.Nat64,checking_upgrade_lock:e.Nat64,proposal_id:e.Nat64,target_version:e.Opt(t)}))}),it=e.Record({sns_initialization_parameters:e.Text}),ct=e.Record({timers:e.Opt(v)}),_t=e.Record({offset:e.Opt(e.Nat64),limit:e.Opt(e.Nat64)}),pt=e.Record({upgrade_journal:e.Opt(V),upgrade_steps:e.Opt(s),response_timestamp_seconds:e.Opt(e.Nat64),deployed_version:e.Opt(t),target_version:e.Opt(t),upgrade_journal_entry_count:e.Opt(e.Nat64)}),dt=e.Record({reserved_ids:e.Vec(e.Nat64),functions:e.Vec(_)}),ut=e.Record({of_principal:e.Opt(e.Principal),limit:e.Nat32,start_page_at:e.Opt(a)}),lt=e.Record({neurons:e.Vec(m)}),mt=e.Record({include_reward_status:e.Vec(e.Int32),before_proposal:e.Opt(p),limit:e.Nat32,exclude_type:e.Vec(e.Nat64),include_status:e.Vec(e.Int32)}),Ot=e.Record({include_ballots_by_caller:e.Opt(e.Bool),proposals:e.Vec(g)}),Nt=e.Record({}),Rt=e.Record({native_functions:e.Opt(e.Vec(_)),topic:e.Opt(c),is_critical:e.Opt(e.Bool),name:e.Opt(e.Text),description:e.Opt(e.Text),custom_functions:e.Opt(e.Vec(_))}),gt=e.Record({uncategorized_functions:e.Opt(e.Vec(_)),topics:e.Opt(e.Vec(Rt))}),vt=e.Record({percentage_to_stake:e.Opt(e.Nat32)}),yt=e.Variant({Split:b,Follow:F,DisburseMaturity:M,ClaimOrRefresh:U,Configure:C,RegisterVote:A,SetFollowing:E,MakeProposal:R,StakeMaturity:vt,RemoveNeuronPermissions:G,AddNeuronPermissions:q,MergeMaturity:B,Disburse:z}),Vt=e.Record({subaccount:e.Vec(e.Nat8),command:e.Opt(yt)}),St=e.Record({created_neuron_id:e.Opt(a)}),Tt=e.Record({amount_disbursed_e8s:e.Nat64,amount_deducted_e8s:e.Opt(e.Nat64)}),ht=e.Record({refreshed_neuron_id:e.Opt(a)}),ft=e.Record({maturity_e8s:e.Nat64,staked_maturity_e8s:e.Nat64}),wt=e.Record({merged_maturity_e8s:e.Nat64,new_stake_e8s:e.Nat64}),xt=e.Record({transfer_block_height:e.Nat64}),Pt=e.Variant({Error:u,Split:St,Follow:e.Record({}),DisburseMaturity:Tt,ClaimOrRefresh:ht,Configure:e.Record({}),RegisterVote:e.Record({}),SetFollowing:e.Record({}),MakeProposal:Y,RemoveNeuronPermission:e.Record({}),StakeMaturity:ft,MergeMaturity:wt,Disburse:xt,AddNeuronPermission:e.Record({})}),bt=e.Record({command:e.Opt(Pt)}),Ft=e.Record({recipient:e.Opt(d),amount_e8s:e.Opt(e.Nat64)}),Mt=e.Record({mode:e.Int32});return e.Service({add_maturity:e.Func([Ae],[ke],[]),advance_target_version:e.Func([Ee],[Ue],[]),claim_swap_neurons:e.Func([We],[Xe],[]),fail_stuck_upgrade_in_progress:e.Func([e.Record({})],[e.Record({})],[]),get_build_metadata:e.Func([],[e.Text],["query"]),get_latest_reward_event:e.Func([],[T],["query"]),get_maturity_modulation:e.Func([e.Record({})],[He],[]),get_metadata:e.Func([e.Record({})],[Ze],["query"]),get_mode:e.Func([e.Record({})],[$e],["query"]),get_nervous_system_parameters:e.Func([e.Null],[O],["query"]),get_neuron:e.Func([Ie],[Le],["query"]),get_proposal:e.Func([Y],[tt],["query"]),get_root_canister_status:e.Func([e.Null],[nt],[]),get_running_sns_version:e.Func([e.Record({})],[rt],["query"]),get_sns_initialization_parameters:e.Func([e.Record({})],[it],["query"]),get_timers:e.Func([e.Record({})],[ct],["query"]),get_upgrade_journal:e.Func([_t],[pt],["query"]),list_nervous_system_functions:e.Func([],[dt],["query"]),list_neurons:e.Func([ut],[lt],["query"]),list_proposals:e.Func([mt],[Ot],["query"]),list_topics:e.Func([Nt],[gt],["query"]),manage_neuron:e.Func([Vt],[bt],[]),mint_tokens:e.Func([Ft],[e.Record({})],[]),refresh_cached_upgrade_steps:e.Func([e.Record({})],[e.Record({})],[]),reset_timers:e.Func([e.Record({})],[e.Record({})],[]),set_mode:e.Func([Mt],[e.Record({})],[]),update_neuron:e.Func([m],[e.Opt(u)],[])})};var Ct=class e extends Zt{constructor(){super(...arguments);this.addMaturity=async t=>{let{id:s,amountE8s:i}=t,{new_maturity_e8s:c}=await this.caller(t).add_maturity({id:Ut(s),amount_e8s:Ut(i)}),o=It(c);if(Dt(o)||o<i)throw new At("No maturity added")}}static create(t){let{service:s,certifiedService:i,canisterId:c}=$t({options:t,idlFactory:Et,certifiedIdlFactory:kt});return new e(c,s,i)}};export{Xt as GetOpenTicketErrorType,Ht as NewSaleTicketResponseErrorType,Bt as SnsGovernanceCanister,At as SnsGovernanceError,Ct as SnsGovernanceTestCanister,jt as SnsNeuronPermissionType,Jt as SnsProposalDecisionStatus,Wt as SnsProposalRewardStatus,zt as SnsRootCanister,Yt as SnsSwapCanister,to as SnsSwapGetOpenTicketError,Kt as SnsSwapLifecycle,eo as SnsSwapNewTicketError,Qt as SnsVote,so as SnsWrapper,Lt as UnsupportedMethodError,qt as fromCandidAction,ao as initSnsWrapper,oo as neuronSubaccount};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|