@dfinity/sns 5.0.1 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/converters/governance.converters.ts", "../src/enums/governance.enums.ts", "../src/enums/swap.enums.ts", "../src/errors/common.errors.ts", "../src/errors/governance.errors.ts", "../src/errors/swap.errors.ts", "../src/governance.canister.ts", "../src/candid/sns_governance.certified.idl.js", "../src/candid/sns_governance.idl.js", "../src/governance_test.canister.ts", "../src/candid/sns_governance_test.certified.idl.js", "../src/candid/sns_governance_test.idl.js", "../src/root.canister.ts", "../src/candid/sns_root.certified.idl.js", "../src/candid/sns_root.idl.js", "../src/sns.ts", "../src/sns.wrapper.ts", "../src/utils/governance.utils.ts", "../../../node_modules/@noble/hashes/src/utils.ts", "../../../node_modules/@noble/hashes/src/_md.ts", "../../../node_modules/@noble/hashes/src/sha2.ts", "../src/swap.canister.ts", "../src/candid/sns_swap.certified.idl.js", "../src/candid/sns_swap.idl.js", "../src/converters/swap.converters.ts", "../src/utils/error.utils.ts"],
4
- "sourcesContent": ["import type { IcrcAccount } from \"@dfinity/ledger-icrc\";\nimport {\n assertNever,\n fromNullable,\n jsonReplacer,\n toNullable,\n} from \"@dfinity/utils\";\nimport type {\n Account,\n Action as ActionCandid,\n AdvanceSnsTargetVersion as AdvanceSnsTargetVersionCandid,\n ChunkedCanisterWasm as ChunkedCanisterWasmCandid,\n Command,\n ExecuteExtensionOperation as ExecuteExtensionOperationCandid,\n ExtensionOperationArg as ExtensionOperationArgCandid,\n ExtensionUpgradeArg as ExtensionUpgradeArgCandid,\n FunctionType as FunctionTypeCandid,\n GenericNervousSystemFunction as GenericNervousSystemFunctionCandid,\n ListProposals,\n ManageDappCanisterSettings as ManageDappCanisterSettingsCandid,\n ManageLedgerParameters as ManageLedgerParametersCandid,\n ManageNeuron,\n ManageSnsMetadata as ManageSnsMetadataCandid,\n MintSnsTokens as MintSnsTokensCandid,\n NervousSystemFunction as NervousSystemFunctionCandid,\n NervousSystemParameters as NervousSystemParametersCandid,\n NeuronId,\n Operation,\n PreciseValue as PreciseValueCandid,\n RegisterExtension as RegisterExtensionCandid,\n SnsVersion as SnsVersionCandid,\n TransferSnsTreasuryFunds as TransferSnsTreasuryFundsCandid,\n UpgradeExtension as UpgradeExtensionCandid,\n UpgradeSnsControlledCanister as UpgradeSnsControlledCanisterCandid,\n VotingRewardsParameters as VotingRewardsParametersCandid,\n Wasm as WasmCandid,\n} from \"../candid/sns_governance\";\nimport { DEFAULT_PROPOSALS_LIMIT } from \"../constants/governance.constants\";\nimport type {\n Action,\n AdvanceSnsTargetVersion,\n ChunkedCanisterWasm,\n ExecuteExtensionOperation,\n ExtensionOperationArg,\n ExtensionUpgradeArg,\n FunctionType,\n GenericNervousSystemFunction,\n ManageDappCanisterSettings,\n ManageLedgerParameters,\n ManageSnsMetadata,\n MintSnsTokens,\n NervousSystemFunction,\n NervousSystemParameters,\n PreciseValue,\n RegisterExtension,\n SnsVersion,\n TransferSnsTreasuryFunds,\n UpgradeExtension,\n UpgradeSnsControlledCanister,\n VotingRewardsParameters,\n Wasm,\n} from \"../types/actions\";\nimport type {\n SnsClaimOrRefreshArgs,\n SnsDisburseNeuronParams,\n SnsIncreaseDissolveDelayParams,\n SnsListProposalsParams,\n SnsNeuronAutoStakeMaturityParams,\n SnsNeuronDisburseMaturityParams,\n SnsNeuronPermissionsParams,\n SnsNeuronStakeMaturityParams,\n SnsRegisterVoteParams,\n SnsSetDissolveTimestampParams,\n SnsSetFollowingParams,\n SnsSetTopicFollowees,\n SnsSplitNeuronParams,\n} from \"../types/governance.params\";\n\n// Helper for building `ManageNeuron` structure\nconst toManageNeuronCommand = ({\n neuronId: { id },\n command,\n}: {\n neuronId: NeuronId;\n command: Command;\n}): ManageNeuron => ({\n subaccount: id,\n command: [command],\n});\n\n// Helper for building `ManageNeuron` structure for type `Operation` commands\nconst toManageNeuronConfigureCommand = ({\n neuronId,\n operation,\n}: {\n neuronId: NeuronId;\n operation: Operation;\n}): ManageNeuron =>\n toManageNeuronCommand({\n neuronId,\n command: {\n Configure: {\n operation: [operation],\n },\n },\n });\n\nexport const toCandidAccount = ({\n owner,\n subaccount,\n}: IcrcAccount): Account => ({\n owner: toNullable(owner),\n subaccount: subaccount === undefined ? [] : toNullable({ subaccount }),\n});\n\nexport const toAddPermissionsRequest = ({\n neuronId,\n permissions,\n principal,\n}: SnsNeuronPermissionsParams): ManageNeuron =>\n toManageNeuronCommand({\n neuronId,\n command: {\n AddNeuronPermissions: {\n permissions_to_add: [{ permissions: Int32Array.from(permissions) }],\n principal_id: [principal],\n },\n },\n });\n\nexport const toRemovePermissionsRequest = ({\n neuronId,\n permissions,\n principal,\n}: SnsNeuronPermissionsParams): ManageNeuron =>\n toManageNeuronCommand({\n neuronId,\n command: {\n RemoveNeuronPermissions: {\n permissions_to_remove: [{ permissions: Int32Array.from(permissions) }],\n principal_id: [principal],\n },\n },\n });\n\nexport const toSplitNeuronRequest = ({\n neuronId,\n memo,\n amount: amount_e8s,\n}: SnsSplitNeuronParams): ManageNeuron =>\n toManageNeuronCommand({\n neuronId,\n command: {\n Split: {\n memo,\n amount_e8s,\n },\n },\n });\n\nexport const toDisburseNeuronRequest = ({\n neuronId,\n amount,\n toAccount,\n}: SnsDisburseNeuronParams): ManageNeuron =>\n toManageNeuronCommand({\n neuronId,\n command: {\n Disburse: {\n // currently there is a main account only support\n to_account:\n toAccount === undefined ? [] : toNullable(toCandidAccount(toAccount)),\n amount:\n amount === undefined\n ? []\n : [\n {\n e8s: amount,\n },\n ],\n },\n },\n });\n\nexport const toStartDissolvingNeuronRequest = (\n neuronId: NeuronId,\n): ManageNeuron =>\n toManageNeuronConfigureCommand({\n neuronId,\n operation: { StartDissolving: {} },\n });\n\nexport const toStopDissolvingNeuronRequest = (\n neuronId: NeuronId,\n): ManageNeuron =>\n toManageNeuronConfigureCommand({\n neuronId,\n operation: { StopDissolving: {} },\n });\n\nexport const toStakeMaturityRequest = ({\n neuronId,\n percentageToStake,\n}: SnsNeuronStakeMaturityParams): ManageNeuron =>\n toManageNeuronCommand({\n neuronId,\n command: {\n StakeMaturity: {\n percentage_to_stake: toNullable(percentageToStake),\n },\n },\n });\n\nexport const toDisburseMaturityRequest = ({\n neuronId,\n percentageToDisburse,\n toAccount,\n}: SnsNeuronDisburseMaturityParams): ManageNeuron =>\n toManageNeuronCommand({\n neuronId,\n command: {\n DisburseMaturity: {\n // currently there is a main account only support\n to_account:\n toAccount === undefined ? [] : toNullable(toCandidAccount(toAccount)),\n percentage_to_disburse: percentageToDisburse,\n },\n },\n });\n\nexport const toAutoStakeMaturityNeuronRequest = ({\n neuronId,\n autoStake: requested_setting_for_auto_stake_maturity,\n}: SnsNeuronAutoStakeMaturityParams): ManageNeuron =>\n toManageNeuronConfigureCommand({\n neuronId,\n operation: {\n ChangeAutoStakeMaturity: {\n requested_setting_for_auto_stake_maturity,\n },\n },\n });\n\nexport const toSetDissolveTimestampRequest = ({\n neuronId,\n dissolveTimestampSeconds,\n}: SnsSetDissolveTimestampParams): ManageNeuron =>\n toManageNeuronConfigureCommand({\n neuronId,\n operation: {\n SetDissolveTimestamp: {\n dissolve_timestamp_seconds: dissolveTimestampSeconds,\n },\n },\n });\n\nexport const toIncreaseDissolveDelayRequest = ({\n neuronId,\n additionalDissolveDelaySeconds,\n}: SnsIncreaseDissolveDelayParams): ManageNeuron =>\n toManageNeuronConfigureCommand({\n neuronId,\n operation: {\n IncreaseDissolveDelay: {\n additional_dissolve_delay_seconds: additionalDissolveDelaySeconds,\n },\n },\n });\n\nexport const toFollowRequest = ({\n neuronId,\n functionId,\n followees,\n}: SnsSetTopicFollowees): ManageNeuron => ({\n subaccount: neuronId.id,\n command: [\n {\n Follow: {\n function_id: functionId,\n followees,\n },\n },\n ],\n});\n\nexport const toSetFollowingRequest = ({\n neuronId,\n topicFollowing,\n}: SnsSetFollowingParams): ManageNeuron => ({\n subaccount: neuronId.id,\n command: [\n {\n SetFollowing: {\n topic_following: topicFollowing.map(({ topic, followees }) => ({\n topic: [topic],\n followees: followees.map(({ neuronId, alias }) => ({\n neuron_id: toNullable(neuronId),\n alias: toNullable(alias),\n })),\n })),\n },\n },\n ],\n});\n\nexport const toRegisterVoteRequest = ({\n neuronId,\n proposalId,\n vote,\n}: SnsRegisterVoteParams): ManageNeuron => ({\n subaccount: neuronId.id,\n command: [\n {\n RegisterVote: {\n vote,\n proposal: [proposalId],\n },\n },\n ],\n});\n\nexport const toClaimOrRefreshRequest = ({\n subaccount,\n memo,\n controller,\n}: SnsClaimOrRefreshArgs): ManageNeuron => ({\n subaccount,\n command: [\n {\n ClaimOrRefresh: {\n by: [\n // If memo is not passed, we consider it a neuronId request because the memo is mandatory for MemoAndController\n memo === undefined\n ? { NeuronId: {} }\n : {\n MemoAndController: { memo, controller: toNullable(controller) },\n },\n ],\n },\n },\n ],\n});\n\nexport const toListProposalRequest = ({\n excludeType,\n beforeProposal,\n includeRewardStatus,\n includeStatus,\n limit,\n includeTopics,\n}: SnsListProposalsParams): ListProposals => ({\n exclude_type: BigUint64Array.from(excludeType ?? []),\n before_proposal: toNullable(beforeProposal),\n include_reward_status: Int32Array.from(includeRewardStatus ?? []),\n include_status: Int32Array.from(includeStatus ?? []),\n limit: limit ?? DEFAULT_PROPOSALS_LIMIT,\n include_topics: toNullable(\n includeTopics?.map((topic) => ({\n topic: toNullable(topic),\n })) ?? [],\n ),\n});\n\nexport const fromCandidAction = (action: ActionCandid): Action => {\n if (\"ManageNervousSystemParameters\" in action) {\n return {\n ManageNervousSystemParameters: convertNervousSystemParams(\n action.ManageNervousSystemParameters,\n ),\n };\n }\n\n if (\"AdvanceSnsTargetVersion\" in action) {\n return {\n AdvanceSnsTargetVersion: convertAdvanceSnsTargetVersion(\n action.AdvanceSnsTargetVersion,\n ),\n };\n }\n\n if (\"AddGenericNervousSystemFunction\" in action) {\n return {\n AddGenericNervousSystemFunction: convertNervousSystemFunction(\n action.AddGenericNervousSystemFunction,\n ),\n };\n }\n\n if (\"ManageDappCanisterSettings\" in action) {\n return {\n ManageDappCanisterSettings: convertManageDappCanisterSettings(\n action.ManageDappCanisterSettings,\n ),\n };\n }\n\n if (\"ManageLedgerParameters\" in action) {\n return {\n ManageLedgerParameters: convertManageLedgerParameters(\n action.ManageLedgerParameters,\n ),\n };\n }\n\n if (\"ExecuteExtensionOperation\" in action) {\n return {\n ExecuteExtensionOperation: convertExecuteExtensionOperation(\n action.ExecuteExtensionOperation,\n ),\n };\n }\n\n if (\"UpgradeExtension\" in action) {\n return {\n UpgradeExtension: convertUpgradeExtension(action.UpgradeExtension),\n };\n }\n\n if (\"SetTopicsForCustomProposals\" in action) {\n return {\n SetTopicsForCustomProposals: action.SetTopicsForCustomProposals,\n };\n }\n\n if (\"RegisterExtension\" in action) {\n return {\n RegisterExtension: convertRegisterExtension(action.RegisterExtension),\n };\n }\n\n if (\"RemoveGenericNervousSystemFunction\" in action) {\n return {\n RemoveGenericNervousSystemFunction:\n action.RemoveGenericNervousSystemFunction,\n };\n }\n\n if (\"UpgradeSnsToNextVersion\" in action) {\n return { UpgradeSnsToNextVersion: action.UpgradeSnsToNextVersion };\n }\n\n if (\"RegisterDappCanisters\" in action) {\n return { RegisterDappCanisters: action.RegisterDappCanisters };\n }\n\n if (\"TransferSnsTreasuryFunds\" in action) {\n return {\n TransferSnsTreasuryFunds: convertTransferSnsTreasuryFunds(\n action.TransferSnsTreasuryFunds,\n ),\n };\n }\n\n if (\"UpgradeSnsControlledCanister\" in action) {\n return {\n UpgradeSnsControlledCanister: convertUpgradeSnsControlledCanister(\n action.UpgradeSnsControlledCanister,\n ),\n };\n }\n\n if (\"DeregisterDappCanisters\" in action) {\n return { DeregisterDappCanisters: action.DeregisterDappCanisters };\n }\n\n if (\"MintSnsTokens\" in action) {\n return {\n MintSnsTokens: convertMintSnsTokens(action.MintSnsTokens),\n };\n }\n\n if (\"Unspecified\" in action) {\n return { Unspecified: action.Unspecified };\n }\n\n if (\"ManageSnsMetadata\" in action) {\n return {\n ManageSnsMetadata: convertManageSnsMetadata(action.ManageSnsMetadata),\n };\n }\n\n if (\"ExecuteGenericNervousSystemFunction\" in action) {\n return {\n ExecuteGenericNervousSystemFunction:\n action.ExecuteGenericNervousSystemFunction,\n };\n }\n\n if (\"Motion\" in action) {\n return { Motion: action.Motion };\n }\n\n assertNever(action, `Unknown action type ${JSON.stringify(action)}`);\n};\n\nconst convertManageSnsMetadata = (\n params: ManageSnsMetadataCandid,\n): ManageSnsMetadata => ({\n url: fromNullable(params.url),\n logo: fromNullable(params.logo),\n name: fromNullable(params.name),\n description: fromNullable(params.description),\n});\n\nconst convertManageLedgerParameters = (\n params: ManageLedgerParametersCandid,\n): ManageLedgerParameters => ({\n token_symbol: fromNullable(params.token_symbol),\n transfer_fee: fromNullable(params.transfer_fee),\n token_logo: fromNullable(params.token_logo),\n token_name: fromNullable(params.token_name),\n});\n\nconst convertAdvanceSnsTargetVersion = (\n params: AdvanceSnsTargetVersionCandid,\n): AdvanceSnsTargetVersion => ({\n new_target: convertSnsVersion(fromNullable(params.new_target)),\n});\n\nconst convertManageDappCanisterSettings = (\n params: ManageDappCanisterSettingsCandid,\n): ManageDappCanisterSettings => ({\n freezing_threshold: fromNullable(params.freezing_threshold),\n wasm_memory_threshold: fromNullable(params.wasm_memory_threshold),\n canister_ids: params.canister_ids,\n reserved_cycles_limit: fromNullable(params.reserved_cycles_limit),\n log_visibility: fromNullable(params.log_visibility),\n wasm_memory_limit: fromNullable(params.wasm_memory_limit),\n memory_allocation: fromNullable(params.memory_allocation),\n compute_allocation: fromNullable(params.compute_allocation),\n});\n\nconst convertExecuteExtensionOperation = (\n params: ExecuteExtensionOperationCandid,\n): ExecuteExtensionOperation => ({\n extension_canister_id: fromNullable(params.extension_canister_id),\n operation_name: fromNullable(params.operation_name),\n operation_arg: convertExtensionOperationArg(\n fromNullable(params.operation_arg),\n ),\n});\n\nconst convertUpgradeExtension = (\n params: UpgradeExtensionCandid,\n): UpgradeExtension => ({\n extension_canister_id: fromNullable(params.extension_canister_id),\n wasm: convertWasm(fromNullable(params.wasm)),\n canister_upgrade_arg: convertExtensionUpgradeArg(\n fromNullable(params.canister_upgrade_arg),\n ),\n});\n\nconst convertChunkedCanisterWasm = (\n params: ChunkedCanisterWasmCandid,\n): ChunkedCanisterWasm => ({\n wasm_module_hash: params.wasm_module_hash,\n store_canister_id: fromNullable(params.store_canister_id),\n chunk_hashes_list: params.chunk_hashes_list,\n});\n\nconst convertExtensionOperationArg = (\n params: ExtensionOperationArgCandid | undefined,\n): ExtensionOperationArg | undefined =>\n convertExtensionArg(params) as ExtensionOperationArg | undefined;\n\nconst convertExtensionUpgradeArg = (\n params: ExtensionUpgradeArgCandid | undefined,\n): ExtensionUpgradeArg | undefined =>\n convertExtensionArg(params) as ExtensionUpgradeArg | undefined;\n\nconst convertExtensionArg = (\n params: ExtensionOperationArgCandid | ExtensionUpgradeArgCandid | undefined,\n):\n | {\n value: PreciseValue | undefined;\n }\n | undefined => {\n if (params === undefined) {\n return undefined;\n }\n\n const preciseValue = fromNullable(params.value);\n\n return {\n value:\n preciseValue === undefined\n ? undefined\n : convertPreciseValue(preciseValue),\n };\n};\n\nconst convertPreciseValue = (value: PreciseValueCandid): PreciseValue => {\n if (\"Int\" in value) {\n return { Int: value.Int };\n }\n\n if (\"Nat\" in value) {\n return { Nat: value.Nat };\n }\n\n if (\"Blob\" in value) {\n return { Blob: value.Blob };\n }\n\n if (\"Bool\" in value) {\n return { Bool: value.Bool };\n }\n\n if (\"Text\" in value) {\n return { Text: value.Text };\n }\n\n if (\"Array\" in value) {\n return {\n Array: value.Array.map(convertPreciseValue),\n };\n }\n\n if (\"Map\" in value) {\n return {\n Map: value.Map.map(([key, val]) => [key, convertPreciseValue(val)]),\n };\n }\n\n assertNever(\n value,\n `Unknown PreciseValue ${JSON.stringify(value, jsonReplacer)}`,\n );\n};\n\nconst convertWasm = (params: WasmCandid | undefined): Wasm | undefined => {\n if (params === undefined) {\n return undefined;\n }\n\n if (\"Chunked\" in params) {\n return {\n Chunked: convertChunkedCanisterWasm(params.Chunked),\n };\n }\n\n if (\"Bytes\" in params) {\n return { Bytes: params.Bytes };\n }\n\n assertNever(\n params,\n `Unknown Wasm type ${JSON.stringify(params, jsonReplacer)}`,\n );\n};\n\nconst convertUpgradeSnsControlledCanister = (\n params: UpgradeSnsControlledCanisterCandid,\n): UpgradeSnsControlledCanister => ({\n new_canister_wasm: params.new_canister_wasm,\n chunked_canister_wasm:\n params.chunked_canister_wasm?.[0] !== undefined\n ? convertChunkedCanisterWasm(params.chunked_canister_wasm[0])\n : undefined,\n canister_id: fromNullable(params.canister_id),\n canister_upgrade_arg: fromNullable(params.canister_upgrade_arg),\n mode: fromNullable(params.mode),\n});\n\nconst convertTransferSnsTreasuryFunds = (\n params: TransferSnsTreasuryFundsCandid,\n): TransferSnsTreasuryFunds => ({\n from_treasury: params.from_treasury,\n to_principal: fromNullable(params.to_principal),\n to_subaccount: fromNullable(params.to_subaccount),\n memo: fromNullable(params.memo),\n amount_e8s: params.amount_e8s,\n});\n\nconst convertMintSnsTokens = (params: MintSnsTokensCandid): MintSnsTokens => ({\n to_principal: fromNullable(params.to_principal),\n to_subaccount: fromNullable(params.to_subaccount),\n memo: fromNullable(params.memo),\n amount_e8s: fromNullable(params.amount_e8s),\n});\n\nconst convertSnsVersion = (\n params: SnsVersionCandid | undefined,\n): SnsVersion | undefined => {\n if (params === undefined) {\n return undefined;\n }\n\n return {\n archive_wasm_hash: fromNullable(params.archive_wasm_hash),\n root_wasm_hash: fromNullable(params.root_wasm_hash),\n swap_wasm_hash: fromNullable(params.swap_wasm_hash),\n ledger_wasm_hash: fromNullable(params.ledger_wasm_hash),\n governance_wasm_hash: fromNullable(params.governance_wasm_hash),\n index_wasm_hash: fromNullable(params.index_wasm_hash),\n };\n};\n\nconst convertGenericNervousSystemFunction = (\n params: GenericNervousSystemFunctionCandid,\n): GenericNervousSystemFunction => ({\n validator_canister_id: fromNullable(params.validator_canister_id),\n target_canister_id: fromNullable(params.target_canister_id),\n validator_method_name: fromNullable(params.validator_method_name),\n target_method_name: fromNullable(params.target_method_name),\n topic: fromNullable(params.topic),\n});\n\nconst convertFunctionType = (\n params: FunctionTypeCandid | undefined,\n): FunctionType | undefined => {\n if (params === undefined) {\n return undefined;\n }\n\n if (\"NativeNervousSystemFunction\" in params) {\n return { NativeNervousSystemFunction: params.NativeNervousSystemFunction };\n }\n\n if (\"GenericNervousSystemFunction\" in params) {\n return {\n GenericNervousSystemFunction: convertGenericNervousSystemFunction(\n params.GenericNervousSystemFunction,\n ),\n };\n }\n\n assertNever(params, `Unknown FunctionType ${JSON.stringify(params)}`);\n};\n\nconst convertNervousSystemFunction = (\n params: NervousSystemFunctionCandid,\n): NervousSystemFunction => ({\n id: params.id,\n name: params.name,\n description: fromNullable(params.description),\n function_type: convertFunctionType(fromNullable(params.function_type)),\n});\n\nconst convertVotingRewardsParameters = (\n params: VotingRewardsParametersCandid | undefined,\n): VotingRewardsParameters | undefined =>\n params && {\n final_reward_rate_basis_points: fromNullable(\n params.final_reward_rate_basis_points,\n ),\n initial_reward_rate_basis_points: fromNullable(\n params.initial_reward_rate_basis_points,\n ),\n reward_rate_transition_duration_seconds: fromNullable(\n params.reward_rate_transition_duration_seconds,\n ),\n round_duration_seconds: fromNullable(params.round_duration_seconds),\n };\n\nconst convertNervousSystemParams = (\n params: NervousSystemParametersCandid,\n): NervousSystemParameters => ({\n default_followees: fromNullable(params.default_followees),\n max_dissolve_delay_seconds: fromNullable(params.max_dissolve_delay_seconds),\n max_dissolve_delay_bonus_percentage: fromNullable(\n params.max_dissolve_delay_bonus_percentage,\n ),\n max_followees_per_function: fromNullable(params.max_followees_per_function),\n neuron_claimer_permissions: fromNullable(params.neuron_claimer_permissions),\n neuron_minimum_stake_e8s: fromNullable(params.neuron_minimum_stake_e8s),\n max_neuron_age_for_age_bonus: fromNullable(\n params.max_neuron_age_for_age_bonus,\n ),\n initial_voting_period_seconds: fromNullable(\n params.initial_voting_period_seconds,\n ),\n neuron_minimum_dissolve_delay_to_vote_seconds: fromNullable(\n params.neuron_minimum_dissolve_delay_to_vote_seconds,\n ),\n reject_cost_e8s: fromNullable(params.reject_cost_e8s),\n max_proposals_to_keep_per_action: fromNullable(\n params.max_proposals_to_keep_per_action,\n ),\n wait_for_quiet_deadline_increase_seconds: fromNullable(\n params.wait_for_quiet_deadline_increase_seconds,\n ),\n max_number_of_neurons: fromNullable(params.max_number_of_neurons),\n transaction_fee_e8s: fromNullable(params.transaction_fee_e8s),\n max_number_of_proposals_with_ballots: fromNullable(\n params.max_number_of_proposals_with_ballots,\n ),\n max_age_bonus_percentage: fromNullable(params.max_age_bonus_percentage),\n neuron_grantable_permissions: fromNullable(\n params.neuron_grantable_permissions,\n ),\n voting_rewards_parameters: convertVotingRewardsParameters(\n fromNullable(params.voting_rewards_parameters),\n ),\n max_number_of_principals_per_neuron: fromNullable(\n params.max_number_of_principals_per_neuron,\n ),\n automatically_advance_target_version: fromNullable(\n params.automatically_advance_target_version,\n ),\n});\n\nconst convertRegisterExtension = (\n params: RegisterExtensionCandid,\n): RegisterExtension => ({\n chunked_canister_wasm:\n params.chunked_canister_wasm?.[0] !== undefined\n ? convertChunkedCanisterWasm(params.chunked_canister_wasm[0])\n : undefined,\n extension_init: fromNullable(params.extension_init),\n});\n", "// Source: https://github.com/dfinity/ic/blob/master/rs/sns/governance/proto/ic_sns_governance/pb/v1/governance.proto\nexport enum SnsNeuronPermissionType {\n NEURON_PERMISSION_TYPE_UNSPECIFIED = 0,\n\n // The principal has permission to configure the neuron's dissolve state. This includes\n // start dissolving, stop dissolving, and increasing the dissolve delay for the neuron.\n NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE = 1,\n\n // The principal has permission to add additional principals to modify the neuron.\n // The nervous system parameter `NervousSystemParameters::neuron_grantable_permissions`\n // determines the maximum set of privileges that a principal can grant to another principal in\n // the given SNS.\n NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS = 2,\n\n // The principal has permission to submit proposals on behalf of the neuron.\n // Submitting proposals can change a neuron's stake and thus this\n // is potentially a balance changing operation.\n NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL = 3,\n\n // The principal has permission to vote and follow other neurons on behalf of the neuron.\n NEURON_PERMISSION_TYPE_VOTE = 4,\n\n // The principal has permission to disburse the neuron.\n NEURON_PERMISSION_TYPE_DISBURSE = 5,\n\n // The principal has permission to split the neuron.\n NEURON_PERMISSION_TYPE_SPLIT = 6,\n\n // The principal has permission to merge the neuron's maturity into\n // the neuron's stake.\n /**\n * @deprecated\n */\n NEURON_PERMISSION_TYPE_MERGE_MATURITY = 7,\n\n // The principal has permission to disburse the neuron's maturity to a\n // given ledger account.\n NEURON_PERMISSION_TYPE_DISBURSE_MATURITY = 8,\n\n // The principal has permission to stake the neuron's maturity.\n NEURON_PERMISSION_TYPE_STAKE_MATURITY = 9,\n\n // The principal has permission to grant/revoke permission to vote and submit\n // proposals on behalf of the neuron to other principals.\n NEURON_PERMISSION_TYPE_MANAGE_VOTING_PERMISSION = 10,\n}\n\nexport enum SnsProposalRewardStatus {\n PROPOSAL_REWARD_STATUS_UNSPECIFIED = 0,\n\n // The proposal still accepts votes, for the purpose of\n // voting rewards. This implies nothing on the\n // ProposalDecisionStatus, i.e., a proposal can be decided\n // due to an absolute majority being in favor or against it,\n // but other neuron holders can still cast their vote to get rewards.\n PROPOSAL_REWARD_STATUS_ACCEPT_VOTES = 1,\n\n // The proposal no longer accepts votes. It is due to settle\n // rewards at the next reward event.\n PROPOSAL_REWARD_STATUS_READY_TO_SETTLE = 2,\n\n // The proposal has been taken into account in a reward event, i.e.,\n // the associated rewards have been settled.\n PROPOSAL_REWARD_STATUS_SETTLED = 3,\n}\n\nexport enum SnsProposalDecisionStatus {\n PROPOSAL_DECISION_STATUS_UNSPECIFIED = 0,\n\n // The proposal is open for voting and a decision (adopt/reject) has yet to be made.\n PROPOSAL_DECISION_STATUS_OPEN = 1,\n\n // The proposal has been rejected.\n PROPOSAL_DECISION_STATUS_REJECTED = 2,\n\n // The proposal has been adopted but either execution has not yet started\n // or it has started but its outcome is not yet known.\n PROPOSAL_DECISION_STATUS_ADOPTED = 3,\n\n // The proposal was adopted and successfully executed.\n PROPOSAL_DECISION_STATUS_EXECUTED = 4,\n\n // The proposal was adopted, but execution failed.\n PROPOSAL_DECISION_STATUS_FAILED = 5,\n}\n\nexport enum SnsVote {\n Unspecified = 0,\n Yes = 1,\n No = 2,\n}\n", "// Source: https://github.com/dfinity/ic/blob/master/rs/sns/swap/gen/ic_sns_swap.pb.v1.rs - Lifecycle\nexport enum SnsSwapLifecycle {\n Unspecified = 0,\n Pending = 1,\n Open = 2,\n Committed = 3,\n Aborted = 4,\n Adopted = 5,\n}\n\n// Source: https://gitlab.com/dfinity-lab/public/ic/-/blob/5936d73770dbd16dab9b23379367a8bd5513fb88/rs/sns/swap/proto/ic_sns_swap/pb/v1/swap.proto#L887\nexport enum GetOpenTicketErrorType {\n TYPE_UNSPECIFIED = 0,\n TYPE_SALE_NOT_OPEN = 1,\n TYPE_SALE_CLOSED = 2,\n}\n\n// Source: https://gitlab.com/dfinity-lab/public/ic/-/blob/5936d73770dbd16dab9b23379367a8bd5513fb88/rs/sns/swap/proto/ic_sns_swap/pb/v1/swap.proto#L928\nexport enum NewSaleTicketResponseErrorType {\n TYPE_UNSPECIFIED = 0,\n TYPE_SALE_NOT_OPEN = 1,\n TYPE_SALE_CLOSED = 2,\n // There is already an open ticket associated with the caller.\n //\n // When this is the `error_type`, then the field existing_ticket\n // is set and contains the ticket itself.\n TYPE_TICKET_EXISTS = 3,\n // The amount sent by the user is not within the Sale parameters.\n //\n // When this is the `error_type`, then the field invalid_user_amount\n // is set and describes minimum and maximum amounts.\n TYPE_INVALID_USER_AMOUNT = 4,\n // The specified subaccount is not a valid subaccount (length != 32 bytes).\n TYPE_INVALID_SUBACCOUNT = 5,\n // The specified principal is forbidden from creating tickets.\n TYPE_INVALID_PRINCIPAL = 6,\n}\n", "// This is possible specially in SNS projects/\n// Because they share the same canisters but in different versions.\nexport class UnsupportedMethodError extends Error {\n constructor(public readonly methodName: string) {\n super();\n }\n}\n", "export class SnsGovernanceError extends Error {}\n", "import type { InvalidUserAmount, Ticket } from \"../candid/sns_swap\";\nimport type {\n GetOpenTicketErrorType,\n NewSaleTicketResponseErrorType,\n} from \"../enums/swap.enums\";\n\nexport class SnsSwapNewTicketError extends Error {\n public errorType: NewSaleTicketResponseErrorType;\n public invalidUserAmount?: InvalidUserAmount;\n public existingTicket?: Ticket;\n\n constructor({\n errorType,\n invalidUserAmount,\n existingTicket,\n }: {\n errorType: NewSaleTicketResponseErrorType;\n invalidUserAmount?: InvalidUserAmount;\n existingTicket?: Ticket;\n }) {\n super();\n this.errorType = errorType;\n this.invalidUserAmount = invalidUserAmount;\n this.existingTicket = existingTicket;\n }\n}\n\nexport class SnsSwapGetOpenTicketError extends Error {\n constructor(public errorType: GetOpenTicketErrorType) {\n super();\n }\n}\n", "import {\n Canister,\n assertPercentageNumber,\n createServices,\n fromNullable,\n toNullable,\n type QueryParams,\n} from \"@dfinity/utils\";\nimport type { Principal } from \"@icp-sdk/core/principal\";\nimport type {\n GetMetadataResponse,\n ListNervousSystemFunctionsResponse,\n ListProposalsResponse,\n ListTopicsResponse,\n ManageNeuron,\n ManageNeuronResponse,\n NervousSystemParameters,\n Neuron,\n NeuronId,\n ProposalData,\n _SERVICE as SnsGovernanceService,\n} from \"./candid/sns_governance\";\nimport { idlFactory as certifiedIdlFactory } from \"./candid/sns_governance.certified.idl\";\nimport { idlFactory } from \"./candid/sns_governance.idl\";\nimport { MAX_LIST_NEURONS_RESULTS } from \"./constants/governance.constants\";\nimport {\n toAddPermissionsRequest,\n toAutoStakeMaturityNeuronRequest,\n toClaimOrRefreshRequest,\n toDisburseMaturityRequest,\n toDisburseNeuronRequest,\n toFollowRequest,\n toIncreaseDissolveDelayRequest,\n toListProposalRequest,\n toRegisterVoteRequest,\n toRemovePermissionsRequest,\n toSetDissolveTimestampRequest,\n toSetFollowingRequest,\n toSplitNeuronRequest,\n toStakeMaturityRequest,\n toStartDissolvingNeuronRequest,\n toStopDissolvingNeuronRequest,\n} from \"./converters/governance.converters\";\nimport { SnsGovernanceError } from \"./errors/governance.errors\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\nimport type {\n SnsClaimNeuronParams,\n SnsDisburseNeuronParams,\n SnsGetNeuronParams,\n SnsGetProposalParams,\n SnsIncreaseDissolveDelayParams,\n SnsListNeuronsParams,\n SnsListProposalsParams,\n SnsListTopicsParams,\n SnsNeuronAutoStakeMaturityParams,\n SnsNeuronDisburseMaturityParams,\n SnsNeuronPermissionsParams,\n SnsNeuronStakeMaturityParams,\n SnsRegisterVoteParams,\n SnsSetDissolveTimestampParams,\n SnsSetFollowingParams,\n SnsSetTopicFollowees,\n SnsSplitNeuronParams,\n} from \"./types/governance.params\";\n\nexport class SnsGovernanceCanister extends Canister<SnsGovernanceService> {\n /**\n * Instantiate a canister to interact with the governance of a Sns project.\n *\n * @param {SnsCanisterOptions} options Miscellaneous options to initialize the canister. Its ID being the only mandatory parammeter.\n */\n static create(options: SnsCanisterOptions<SnsGovernanceService>) {\n const { service, certifiedService, canisterId } =\n createServices<SnsGovernanceService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new SnsGovernanceCanister(canisterId, service, certifiedService);\n }\n\n /**\n * List the neurons of the Sns\n */\n listNeurons = async (params: SnsListNeuronsParams): Promise<Neuron[]> => {\n const { principal, limit, beforeNeuronId } = params;\n\n const { neurons } = await this.caller(params).list_neurons({\n of_principal: toNullable<Principal>(principal),\n limit: limit ?? MAX_LIST_NEURONS_RESULTS,\n start_page_at: toNullable<NeuronId>(beforeNeuronId),\n });\n return neurons;\n };\n\n /**\n * List the proposals of the Sns\n */\n listProposals = async (\n params: SnsListProposalsParams,\n ): Promise<ListProposalsResponse> => {\n const { certified } = params;\n\n const response = await this.caller({ certified }).list_proposals(\n toListProposalRequest(params),\n );\n return response;\n };\n\n /**\n *\n * List the topics of the Sns\n */\n listTopics = async (\n params: SnsListTopicsParams,\n ): Promise<ListTopicsResponse> => {\n const { certified } = params;\n const response = await this.caller({ certified }).list_topics({});\n return response;\n };\n\n /**\n * Get the proposal of the Sns\n */\n getProposal = async (params: SnsGetProposalParams): Promise<ProposalData> => {\n const { proposalId } = params;\n\n const { result } = await this.caller(params).get_proposal({\n proposal_id: toNullable(proposalId),\n });\n const data = fromNullable(result);\n if (data === undefined || \"Error\" in data) {\n throw new SnsGovernanceError(\n data?.Error.error_message ?? \"Response type not supported\",\n );\n }\n return data.Proposal;\n };\n\n /**\n * List Nervous System Functions\n * Neurons can follow other neurons in specific Nervous System Functions.\n */\n listNervousSystemFunctions = (\n params: QueryParams,\n ): Promise<ListNervousSystemFunctionsResponse> =>\n this.caller(params).list_nervous_system_functions();\n\n /**\n * Get the Sns metadata (title, description, etc.)\n */\n metadata = (params: QueryParams): Promise<GetMetadataResponse> =>\n this.caller(params).get_metadata({});\n\n /**\n * Get the Sns nervous system parameters (default followees, max dissolve delay, max number of neurons, etc.)\n */\n nervousSystemParameters = (\n params: QueryParams,\n ): Promise<NervousSystemParameters> =>\n this.caller(params).get_nervous_system_parameters(null);\n\n /**\n * Get the neuron of the Sns\n */\n getNeuron = async (params: SnsGetNeuronParams): Promise<Neuron> => {\n const { neuronId } = params;\n\n const { result } = await this.caller(params).get_neuron({\n neuron_id: toNullable(neuronId),\n });\n const data = fromNullable(result);\n if (data === undefined || \"Error\" in data) {\n throw new SnsGovernanceError(\n data?.Error.error_message ?? \"Response type not supported\",\n );\n }\n return data.Neuron;\n };\n\n /**\n * Same as `getNeuron` but returns undefined instead of raising error when not found.\n */\n queryNeuron = async (\n params: SnsGetNeuronParams,\n ): Promise<Neuron | undefined> => {\n try {\n return await this.getNeuron(params);\n } catch (error: unknown) {\n // Source: https://github.com/dfinity/ic/blob/master/rs/sns/governance/src/governance.rs#L914\n if (\n error instanceof Error &&\n error.message.includes(\"No neuron for given NeuronId\")\n ) {\n return undefined;\n }\n throw error;\n }\n };\n\n /**\n * Manage neuron. For advanced users.\n */\n manageNeuron = async (\n request: ManageNeuron,\n ): Promise<ManageNeuronResponse> => {\n const response = await this.caller({ certified: true }).manage_neuron(\n request,\n );\n this.assertManageNeuronError(response);\n return response;\n };\n\n /**\n * Add permissions to a neuron for a specific principal\n */\n addNeuronPermissions = async (\n params: SnsNeuronPermissionsParams,\n ): Promise<void> => {\n const request: ManageNeuron = toAddPermissionsRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Remove permissions to a neuron for a specific principal\n */\n removeNeuronPermissions = async (\n params: SnsNeuronPermissionsParams,\n ): Promise<void> => {\n const request: ManageNeuron = toRemovePermissionsRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Split neuron\n */\n public splitNeuron = async (\n params: SnsSplitNeuronParams,\n ): Promise<NeuronId | undefined> => {\n const request: ManageNeuron = toSplitNeuronRequest(params);\n const { command } = await this.manageNeuron(request);\n const response = fromNullable(command);\n const errorMessage = (details: string) =>\n `Split neuron failed (${details})`;\n\n // Validate response\n if (response === undefined) {\n throw new SnsGovernanceError(errorMessage(\"no response\"));\n }\n\n if (\"Split\" in response) {\n const split = response.Split;\n const neuronId = fromNullable(split.created_neuron_id) as NeuronId;\n\n if (neuronId !== undefined) {\n return neuronId;\n }\n\n throw new SnsGovernanceError(errorMessage(\"no id\"));\n }\n\n throw new SnsGovernanceError(errorMessage(\"unknown\"));\n };\n\n /**\n * Disburse neuron on Account\n */\n disburse = async (params: SnsDisburseNeuronParams): Promise<void> => {\n const request: ManageNeuron = toDisburseNeuronRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Start dissolving process of a neuron\n */\n startDissolving = async (neuronId: NeuronId): Promise<void> => {\n const request: ManageNeuron = toStartDissolvingNeuronRequest(neuronId);\n await this.manageNeuron(request);\n };\n\n /**\n * Stop dissolving process of a neuron\n */\n stopDissolving = async (neuronId: NeuronId): Promise<void> => {\n const request: ManageNeuron = toStopDissolvingNeuronRequest(neuronId);\n await this.manageNeuron(request);\n };\n\n /**\n * Stake the maturity of a neuron.\n *\n * @param {neuronId: NeuronId; percentageToStake: number;} params\n * @param {NeuronId} neuronId The id of the neuron for which to stake the maturity\n * @param {number} percentageToStake Optional. Percentage of the current maturity to stake. If not provided, all of the neuron's current maturity will be staked.\n */\n stakeMaturity = async ({\n neuronId,\n percentageToStake,\n }: SnsNeuronStakeMaturityParams): Promise<void> => {\n assertPercentageNumber(percentageToStake ?? 100);\n\n const request: ManageNeuron = toStakeMaturityRequest({\n neuronId,\n percentageToStake,\n });\n await this.manageNeuron(request);\n };\n\n /**\n * Disburse the maturity of a neuron.\n *\n * @param {neuronId: NeuronId; toAccount?: IcrcAccount; percentageToDisburse: number; } params\n * @param {IcrcAccount} toAccount. Account to disburse maturity.\n * @param {NeuronId} neuronId The id of the neuron for which to disburse the maturity\n * @param {number} percentageToDisburse What percentage of the available maturity to disburse.\n */\n disburseMaturity = async (\n params: SnsNeuronDisburseMaturityParams,\n ): Promise<void> => {\n assertPercentageNumber(params.percentageToDisburse);\n\n const request: ManageNeuron = toDisburseMaturityRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Changes auto-stake maturity for a Neuron.\n *\n * @param {neuronId: NeuronId; autoStake: boolean;} params\n * @param {NeuronId} neuronId The id of the neuron for which to request a change of the auto stake feature\n * @param {number} autoStake `true` to enable the auto-stake maturity for this neuron, `false` to turn it off\n */\n autoStakeMaturity = async (\n params: SnsNeuronAutoStakeMaturityParams,\n ): Promise<void> => {\n const request: ManageNeuron = toAutoStakeMaturityNeuronRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Increase dissolve delay of a neuron\n */\n setDissolveTimestamp = async (\n params: SnsSetDissolveTimestampParams,\n ): Promise<void> => {\n const request: ManageNeuron = toSetDissolveTimestampRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Increase dissolve delay of a neuron\n */\n increaseDissolveDelay = async (\n params: SnsIncreaseDissolveDelayParams,\n ): Promise<void> => {\n const request: ManageNeuron = toIncreaseDissolveDelayRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Sets followees of a neuron for a specific Nervous System Function\n * @deprecated will be replaced by `setFollowing` in the future.\n */\n setTopicFollowees = async (params: SnsSetTopicFollowees): Promise<void> => {\n const request: ManageNeuron = toFollowRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Sets followees of a neuron for topics\n */\n setFollowing = async (params: SnsSetFollowingParams): Promise<void> => {\n const request: ManageNeuron = toSetFollowingRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Registers vote for a proposal from the neuron passed.\n */\n registerVote = async (params: SnsRegisterVoteParams): Promise<void> => {\n const request: ManageNeuron = toRegisterVoteRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Refresh neuron\n */\n refreshNeuron = async (neuronId: NeuronId): Promise<void> => {\n const request: ManageNeuron = toClaimOrRefreshRequest({\n subaccount: neuronId.id,\n });\n await this.manageNeuron(request);\n };\n\n /**\n * Claim neuron\n */\n claimNeuron = async ({\n memo,\n controller,\n subaccount,\n }: SnsClaimNeuronParams): Promise<NeuronId> => {\n const request: ManageNeuron = toClaimOrRefreshRequest({\n subaccount,\n memo,\n controller,\n });\n const { command } = await this.manageNeuron(request);\n const response = fromNullable(command);\n // Edge case. This should not happen\n if (response === undefined) {\n throw new SnsGovernanceError(\"Claim neuron failed\");\n }\n if (\"ClaimOrRefresh\" in response) {\n const neuronId = fromNullable(\n response.ClaimOrRefresh.refreshed_neuron_id,\n );\n // This might happen.\n if (neuronId === undefined) {\n throw new SnsGovernanceError(\"Claim neuron failed\");\n }\n return neuronId;\n }\n // Edge case. manage_neuron for ClaimOrRefresh returns only ClaimOrRefresh response.\n throw new SnsGovernanceError(\"Claim neuron failed\");\n };\n\n /**\n *\n * @param response ManageNeuronResponse\n * @throws SnsGovernanceError\n */\n private assertManageNeuronError = ({\n command,\n }: ManageNeuronResponse): void => {\n // TODO: use upcoming fromDefinedNullable\n const [firstCommand] = command;\n if (firstCommand !== undefined && \"Error\" in firstCommand) {\n throw new SnsGovernanceError(firstCommand.Error.error_message);\n }\n };\n}\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.0-patch-typed-arrays.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({ IDL }) => {\n const PreciseValue = IDL.Rec();\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Version = IDL.Record({\n archive_wasm_hash: IDL.Vec(IDL.Nat8),\n root_wasm_hash: IDL.Vec(IDL.Nat8),\n swap_wasm_hash: IDL.Vec(IDL.Nat8),\n ledger_wasm_hash: IDL.Vec(IDL.Nat8),\n governance_wasm_hash: IDL.Vec(IDL.Nat8),\n index_wasm_hash: IDL.Vec(IDL.Nat8),\n });\n const Versions = IDL.Record({ versions: IDL.Vec(Version) });\n const CachedUpgradeSteps = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requested_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Topic = IDL.Variant({\n DappCanisterManagement: IDL.Null,\n DaoCommunitySettings: IDL.Null,\n ApplicationBusinessLogic: IDL.Null,\n CriticalDappOperations: IDL.Null,\n TreasuryAssetManagement: IDL.Null,\n Governance: IDL.Null,\n SnsFrameworkManagement: IDL.Null,\n });\n const GenericNervousSystemFunction = IDL.Record({\n topic: IDL.Opt(Topic),\n validator_canister_id: IDL.Opt(IDL.Principal),\n target_canister_id: IDL.Opt(IDL.Principal),\n validator_method_name: IDL.Opt(IDL.Text),\n target_method_name: IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n NativeNervousSystemFunction: IDL.Record({}),\n GenericNervousSystemFunction: GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n id: IDL.Nat64,\n name: IDL.Text,\n description: IDL.Opt(IDL.Text),\n function_type: IDL.Opt(FunctionType),\n });\n const Subaccount = IDL.Record({ subaccount: IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n owner: IDL.Opt(IDL.Principal),\n subaccount: IDL.Opt(Subaccount),\n });\n const TreasuryMetrics = IDL.Record({\n name: IDL.Opt(IDL.Text),\n original_amount_e8s: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n account: IDL.Opt(Account),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n treasury: IDL.Int32,\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const VotingPowerMetrics = IDL.Record({\n governance_total_potential_voting_power: IDL.Opt(IDL.Nat64),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GovernanceCachedMetrics = IDL.Record({\n treasury_metrics: IDL.Vec(TreasuryMetrics),\n not_dissolving_neurons_e8s_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64),\n ),\n garbage_collectable_neurons_count: IDL.Nat64,\n neurons_with_invalid_stake_count: IDL.Nat64,\n not_dissolving_neurons_count_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64),\n ),\n neurons_with_less_than_6_months_dissolve_delay_count: IDL.Nat64,\n dissolved_neurons_count: IDL.Nat64,\n total_staked_e8s: IDL.Nat64,\n total_supply_governance_tokens: IDL.Nat64,\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n not_dissolving_neurons_count: IDL.Nat64,\n dissolved_neurons_e8s: IDL.Nat64,\n neurons_with_less_than_6_months_dissolve_delay_e8s: IDL.Nat64,\n dissolving_neurons_count_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Nat64)),\n dissolving_neurons_count: IDL.Nat64,\n dissolving_neurons_e8s_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Float64)),\n timestamp_seconds: IDL.Nat64,\n });\n const MaturityModulation = IDL.Record({\n current_basis_points: IDL.Opt(IDL.Int32),\n updated_at_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const TargetVersionSet = IDL.Record({\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n is_advanced_automatically: IDL.Opt(IDL.Bool),\n });\n const UpgradeStepsReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n upgrade_steps: IDL.Opt(Versions),\n });\n const UpgradeOutcome = IDL.Record({\n status: IDL.Opt(\n IDL.Variant({\n Success: IDL.Record({}),\n Timeout: IDL.Record({}),\n ExternalFailure: IDL.Record({}),\n InvalidState: IDL.Record({ version: IDL.Opt(Version) }),\n }),\n ),\n human_readable: IDL.Opt(IDL.Text),\n });\n const ProposalId = IDL.Record({ id: IDL.Nat64 });\n const UpgradeStarted = IDL.Record({\n current_version: IDL.Opt(Version),\n expected_version: IDL.Opt(Version),\n reason: IDL.Opt(\n IDL.Variant({\n UpgradeSnsToNextVersionProposal: ProposalId,\n BehindTargetVersion: IDL.Record({}),\n }),\n ),\n });\n const UpgradeStepsRefreshed = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n });\n const TargetVersionReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n });\n const UpgradeJournalEntry = IDL.Record({\n event: IDL.Opt(\n IDL.Variant({\n TargetVersionSet: TargetVersionSet,\n UpgradeStepsReset: UpgradeStepsReset,\n UpgradeOutcome: UpgradeOutcome,\n UpgradeStarted: UpgradeStarted,\n UpgradeStepsRefreshed: UpgradeStepsRefreshed,\n TargetVersionReset: TargetVersionReset,\n }),\n ),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const UpgradeJournal = IDL.Record({\n entries: IDL.Vec(UpgradeJournalEntry),\n });\n const NeuronId = IDL.Record({ id: IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ followees: IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n permissions: IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n final_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n reward_rate_transition_duration_seconds: IDL.Opt(IDL.Nat64),\n round_duration_seconds: IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n default_followees: IDL.Opt(DefaultFollowees),\n max_dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n max_dissolve_delay_bonus_percentage: IDL.Opt(IDL.Nat64),\n max_followees_per_function: IDL.Opt(IDL.Nat64),\n automatically_advance_target_version: IDL.Opt(IDL.Bool),\n neuron_claimer_permissions: IDL.Opt(NeuronPermissionList),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n max_neuron_age_for_age_bonus: IDL.Opt(IDL.Nat64),\n initial_voting_period_seconds: IDL.Opt(IDL.Nat64),\n neuron_minimum_dissolve_delay_to_vote_seconds: IDL.Opt(IDL.Nat64),\n reject_cost_e8s: IDL.Opt(IDL.Nat64),\n max_proposals_to_keep_per_action: IDL.Opt(IDL.Nat32),\n wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64),\n max_number_of_neurons: IDL.Opt(IDL.Nat64),\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64),\n max_age_bonus_percentage: IDL.Opt(IDL.Nat64),\n neuron_grantable_permissions: IDL.Opt(NeuronPermissionList),\n voting_rewards_parameters: IDL.Opt(VotingRewardsParameters),\n maturity_modulation_disabled: IDL.Opt(IDL.Bool),\n max_number_of_principals_per_neuron: IDL.Opt(IDL.Nat64),\n });\n const RewardEvent = IDL.Record({\n rounds_since_last_distribution: IDL.Opt(IDL.Nat64),\n actual_timestamp_seconds: IDL.Nat64,\n end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n total_available_e8s_equivalent: IDL.Opt(IDL.Nat64),\n distributed_e8s_equivalent: IDL.Nat64,\n round: IDL.Nat64,\n settled_proposals: IDL.Vec(ProposalId),\n });\n const PendingVersion = IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Opt(IDL.Nat64),\n target_version: IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n error_message: IDL.Text,\n error_type: IDL.Int32,\n });\n const Decimal = IDL.Record({ human_readable: IDL.Opt(IDL.Text) });\n const Tokens = IDL.Record({ e8s: IDL.Opt(IDL.Nat64) });\n const ValuationFactors = IDL.Record({\n xdrs_per_icp: IDL.Opt(Decimal),\n icps_per_token: IDL.Opt(Decimal),\n tokens: IDL.Opt(Tokens),\n });\n const Valuation = IDL.Record({\n token: IDL.Opt(IDL.Int32),\n account: IDL.Opt(Account),\n valuation_factors: IDL.Opt(ValuationFactors),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const MintSnsTokensActionAuxiliary = IDL.Record({\n valuation: IDL.Opt(Valuation),\n });\n const SnsVersion = IDL.Record({\n archive_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n root_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n swap_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n ledger_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n governance_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n index_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const AdvanceSnsTargetVersionActionAuxiliary = IDL.Record({\n target_version: IDL.Opt(SnsVersion),\n });\n const ActionAuxiliary = IDL.Variant({\n TransferSnsTreasuryFunds: MintSnsTokensActionAuxiliary,\n MintSnsTokens: MintSnsTokensActionAuxiliary,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersionActionAuxiliary,\n });\n const Ballot = IDL.Record({\n vote: IDL.Int32,\n cast_timestamp_seconds: IDL.Nat64,\n voting_power: IDL.Nat64,\n });\n const Percentage = IDL.Record({ basis_points: IDL.Opt(IDL.Nat64) });\n const Tally = IDL.Record({\n no: IDL.Nat64,\n yes: IDL.Nat64,\n total: IDL.Nat64,\n timestamp_seconds: IDL.Nat64,\n });\n const ManageDappCanisterSettings = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat64),\n wasm_memory_threshold: IDL.Opt(IDL.Nat64),\n canister_ids: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat64),\n log_visibility: IDL.Opt(IDL.Int32),\n wasm_memory_limit: IDL.Opt(IDL.Nat64),\n memory_allocation: IDL.Opt(IDL.Nat64),\n compute_allocation: IDL.Opt(IDL.Nat64),\n });\n PreciseValue.fill(\n IDL.Variant({\n Int: IDL.Int64,\n Map: IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),\n Nat: IDL.Nat64,\n Blob: IDL.Vec(IDL.Nat8),\n Bool: IDL.Bool,\n Text: IDL.Text,\n Array: IDL.Vec(PreciseValue),\n }),\n );\n const ExtensionOperationArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const ExecuteExtensionOperation = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n operation_name: IDL.Opt(IDL.Text),\n operation_arg: IDL.Opt(ExtensionOperationArg),\n });\n const ChunkedCanisterWasm = IDL.Record({\n wasm_module_hash: IDL.Vec(IDL.Nat8),\n chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),\n store_canister_id: IDL.Opt(IDL.Principal),\n });\n const Wasm = IDL.Variant({\n Chunked: ChunkedCanisterWasm,\n Bytes: IDL.Vec(IDL.Nat8),\n });\n const ExtensionUpgradeArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const UpgradeExtension = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n wasm: IDL.Opt(Wasm),\n canister_upgrade_arg: IDL.Opt(ExtensionUpgradeArg),\n });\n const SetTopicsForCustomProposals = IDL.Record({\n custom_function_id_to_topic: IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),\n });\n const ExtensionInit = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const RegisterExtension = IDL.Record({\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n extension_init: IDL.Opt(ExtensionInit),\n });\n const RegisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n });\n const TransferSnsTreasuryFunds = IDL.Record({\n from_treasury: IDL.Int32,\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n new_canister_wasm: IDL.Vec(IDL.Nat8),\n mode: IDL.Opt(IDL.Int32),\n canister_id: IDL.Opt(IDL.Principal),\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n canister_upgrade_arg: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const DeregisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n new_controllers: IDL.Vec(IDL.Principal),\n });\n const MintSnsTokens = IDL.Record({\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const AdvanceSnsTargetVersion = IDL.Record({\n new_target: IDL.Opt(SnsVersion),\n });\n const ManageSnsMetadata = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n function_id: IDL.Nat64,\n payload: IDL.Vec(IDL.Nat8),\n });\n const ManageLedgerParameters = IDL.Record({\n token_symbol: IDL.Opt(IDL.Text),\n transfer_fee: IDL.Opt(IDL.Nat64),\n token_logo: IDL.Opt(IDL.Text),\n token_name: IDL.Opt(IDL.Text),\n });\n const Motion = IDL.Record({ motion_text: IDL.Text });\n const Action = IDL.Variant({\n ManageNervousSystemParameters: NervousSystemParameters,\n AddGenericNervousSystemFunction: NervousSystemFunction,\n ManageDappCanisterSettings: ManageDappCanisterSettings,\n ExecuteExtensionOperation: ExecuteExtensionOperation,\n UpgradeExtension: UpgradeExtension,\n RemoveGenericNervousSystemFunction: IDL.Nat64,\n SetTopicsForCustomProposals: SetTopicsForCustomProposals,\n RegisterExtension: RegisterExtension,\n UpgradeSnsToNextVersion: IDL.Record({}),\n RegisterDappCanisters: RegisterDappCanisters,\n TransferSnsTreasuryFunds: TransferSnsTreasuryFunds,\n UpgradeSnsControlledCanister: UpgradeSnsControlledCanister,\n DeregisterDappCanisters: DeregisterDappCanisters,\n MintSnsTokens: MintSnsTokens,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersion,\n Unspecified: IDL.Record({}),\n ManageSnsMetadata: ManageSnsMetadata,\n ExecuteGenericNervousSystemFunction: ExecuteGenericNervousSystemFunction,\n ManageLedgerParameters: ManageLedgerParameters,\n Motion: Motion,\n });\n const Proposal = IDL.Record({\n url: IDL.Text,\n title: IDL.Text,\n action: IDL.Opt(Action),\n summary: IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n current_deadline_timestamp_seconds: IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n id: IDL.Opt(ProposalId),\n payload_text_rendering: IDL.Opt(IDL.Text),\n topic: IDL.Opt(Topic),\n action: IDL.Nat64,\n failure_reason: IDL.Opt(GovernanceError),\n action_auxiliary: IDL.Opt(ActionAuxiliary),\n ballots: IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n minimum_yes_proportion_of_total: IDL.Opt(Percentage),\n reward_event_round: IDL.Nat64,\n failed_timestamp_seconds: IDL.Nat64,\n reward_event_end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n proposal_creation_timestamp_seconds: IDL.Nat64,\n initial_voting_period_seconds: IDL.Nat64,\n reject_cost_e8s: IDL.Nat64,\n latest_tally: IDL.Opt(Tally),\n wait_for_quiet_deadline_increase_seconds: IDL.Nat64,\n decided_timestamp_seconds: IDL.Nat64,\n proposal: IDL.Opt(Proposal),\n proposer: IDL.Opt(NeuronId),\n wait_for_quiet_state: IDL.Opt(WaitForQuietState),\n minimum_yes_proportion_of_exercised: IDL.Opt(Percentage),\n is_eligible_for_rewards: IDL.Bool,\n executed_timestamp_seconds: IDL.Nat64,\n });\n const Split = IDL.Record({ memo: IDL.Nat64, amount_e8s: IDL.Nat64 });\n const Follow = IDL.Record({\n function_id: IDL.Nat64,\n followees: IDL.Vec(NeuronId),\n });\n const DisburseMaturity = IDL.Record({\n to_account: IDL.Opt(Account),\n percentage_to_disburse: IDL.Nat32,\n });\n const ChangeAutoStakeMaturity = IDL.Record({\n requested_setting_for_auto_stake_maturity: IDL.Bool,\n });\n const IncreaseDissolveDelay = IDL.Record({\n additional_dissolve_delay_seconds: IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n dissolve_timestamp_seconds: IDL.Nat64,\n });\n const Operation = IDL.Variant({\n ChangeAutoStakeMaturity: ChangeAutoStakeMaturity,\n StopDissolving: IDL.Record({}),\n StartDissolving: IDL.Record({}),\n IncreaseDissolveDelay: IncreaseDissolveDelay,\n SetDissolveTimestamp: SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ operation: IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n vote: IDL.Int32,\n proposal: IDL.Opt(ProposalId),\n });\n const Followee = IDL.Record({\n alias: IDL.Opt(IDL.Text),\n neuron_id: IDL.Opt(NeuronId),\n });\n const FolloweesForTopic = IDL.Record({\n topic: IDL.Opt(Topic),\n followees: IDL.Vec(Followee),\n });\n const SetFollowing = IDL.Record({\n topic_following: IDL.Vec(FolloweesForTopic),\n });\n const FinalizeDisburseMaturity = IDL.Record({\n amount_to_be_disbursed_e8s: IDL.Nat64,\n to_account: IDL.Opt(Account),\n });\n const MemoAndController = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n memo: IDL.Nat64,\n });\n const By = IDL.Variant({\n MemoAndController: MemoAndController,\n NeuronId: IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ by: IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n permissions_to_remove: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n permissions_to_add: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ percentage_to_merge: IDL.Nat32 });\n const Amount = IDL.Record({ e8s: IDL.Nat64 });\n const Disburse = IDL.Record({\n to_account: IDL.Opt(Account),\n amount: IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n SyncCommand: IDL.Record({}),\n MakeProposal: Proposal,\n FinalizeDisburseMaturity: FinalizeDisburseMaturity,\n ClaimOrRefreshNeuron: ClaimOrRefresh,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n command: IDL.Opt(Command_2),\n timestamp: IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n principal: IDL.Opt(IDL.Principal),\n permission_type: IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n DissolveDelaySeconds: IDL.Nat64,\n WhenDissolvedTimestampSeconds: IDL.Nat64,\n });\n const DisburseMaturityInProgress = IDL.Record({\n timestamp_of_disbursement_seconds: IDL.Nat64,\n amount_e8s: IDL.Nat64,\n account_to_disburse_to: IDL.Opt(Account),\n finalize_disbursement_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Neuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n staked_maturity_e8s_equivalent: IDL.Opt(IDL.Nat64),\n permissions: IDL.Vec(NeuronPermission),\n maturity_e8s_equivalent: IDL.Nat64,\n cached_neuron_stake_e8s: IDL.Nat64,\n created_timestamp_seconds: IDL.Nat64,\n topic_followees: IDL.Opt(\n IDL.Record({\n topic_id_to_followees: IDL.Vec(IDL.Tuple(IDL.Int32, FolloweesForTopic)),\n }),\n ),\n source_nns_neuron_id: IDL.Opt(IDL.Nat64),\n auto_stake_maturity: IDL.Opt(IDL.Bool),\n aging_since_timestamp_seconds: IDL.Nat64,\n dissolve_state: IDL.Opt(DissolveState),\n voting_power_percentage_multiplier: IDL.Nat64,\n vesting_period_seconds: IDL.Opt(IDL.Nat64),\n disburse_maturity_in_progress: IDL.Vec(DisburseMaturityInProgress),\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n neuron_fees_e8s: IDL.Nat64,\n });\n const Governance = IDL.Record({\n root_canister_id: IDL.Opt(IDL.Principal),\n timers: IDL.Opt(Timers),\n cached_upgrade_steps: IDL.Opt(CachedUpgradeSteps),\n id_to_nervous_system_functions: IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction),\n ),\n metrics: IDL.Opt(GovernanceCachedMetrics),\n maturity_modulation: IDL.Opt(MaturityModulation),\n upgrade_journal: IDL.Opt(UpgradeJournal),\n mode: IDL.Int32,\n parameters: IDL.Opt(NervousSystemParameters),\n is_finalizing_disburse_maturity: IDL.Opt(IDL.Bool),\n deployed_version: IDL.Opt(Version),\n sns_initialization_parameters: IDL.Text,\n latest_reward_event: IDL.Opt(RewardEvent),\n pending_version: IDL.Opt(PendingVersion),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n proposals: IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n in_flight_commands: IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n sns_metadata: IDL.Opt(ManageSnsMetadata),\n neurons: IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n target_version: IDL.Opt(Version),\n genesis_timestamp_seconds: IDL.Nat64,\n });\n const Principals = IDL.Record({ principals: IDL.Vec(IDL.Principal) });\n const NeuronsFund = IDL.Record({\n nns_neuron_hotkeys: IDL.Opt(Principals),\n nns_neuron_controller: IDL.Opt(IDL.Principal),\n nns_neuron_id: IDL.Opt(IDL.Nat64),\n });\n const Participant = IDL.Variant({\n NeuronsFund: NeuronsFund,\n Direct: IDL.Record({}),\n });\n const NeuronIds = IDL.Record({ neuron_ids: IDL.Vec(NeuronId) });\n const NeuronRecipe = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n participant: IDL.Opt(Participant),\n stake_e8s: IDL.Opt(IDL.Nat64),\n followees: IDL.Opt(NeuronIds),\n neuron_id: IDL.Opt(NeuronId),\n });\n const NeuronRecipes = IDL.Record({\n neuron_recipes: IDL.Vec(NeuronRecipe),\n });\n const ClaimSwapNeuronsRequest = IDL.Record({\n neuron_recipes: IDL.Opt(NeuronRecipes),\n });\n const SwapNeuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n status: IDL.Int32,\n });\n const ClaimedSwapNeurons = IDL.Record({\n swap_neurons: IDL.Vec(SwapNeuron),\n });\n const ClaimSwapNeuronsResult = IDL.Variant({\n Ok: ClaimedSwapNeurons,\n Err: IDL.Int32,\n });\n const ClaimSwapNeuronsResponse = IDL.Record({\n claim_swap_neurons_result: IDL.Opt(ClaimSwapNeuronsResult),\n });\n const GetMaturityModulationResponse = IDL.Record({\n maturity_modulation: IDL.Opt(MaturityModulation),\n });\n const GetMetadataResponse = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const GetMetricsRequest = IDL.Record({\n time_window_seconds: IDL.Opt(IDL.Nat64),\n });\n const Metrics = IDL.Record({\n treasury_metrics: IDL.Opt(IDL.Vec(TreasuryMetrics)),\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n last_ledger_block_timestamp: IDL.Opt(IDL.Nat64),\n num_recently_executed_proposals: IDL.Opt(IDL.Nat64),\n num_recently_submitted_proposals: IDL.Opt(IDL.Nat64),\n genesis_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GetMetricsResult = IDL.Variant({\n Ok: Metrics,\n Err: GovernanceError,\n });\n const GetMetricsResponse = IDL.Record({\n get_metrics_result: IDL.Opt(GetMetricsResult),\n });\n const GetModeResponse = IDL.Record({ mode: IDL.Opt(IDL.Int32) });\n const GetNeuron = IDL.Record({ neuron_id: IDL.Opt(NeuronId) });\n const Result = IDL.Variant({ Error: GovernanceError, Neuron: Neuron });\n const GetNeuronResponse = IDL.Record({ result: IDL.Opt(Result) });\n const GetProposal = IDL.Record({ proposal_id: IDL.Opt(ProposalId) });\n const Result_1 = IDL.Variant({\n Error: GovernanceError,\n Proposal: ProposalData,\n });\n const GetProposalResponse = IDL.Record({ result: IDL.Opt(Result_1) });\n const MemoryMetrics = IDL.Record({\n wasm_binary_size: IDL.Opt(IDL.Nat),\n wasm_chunk_store_size: IDL.Opt(IDL.Nat),\n canister_history_size: IDL.Opt(IDL.Nat),\n stable_memory_size: IDL.Opt(IDL.Nat),\n snapshots_size: IDL.Opt(IDL.Nat),\n wasm_memory_size: IDL.Opt(IDL.Nat),\n global_memory_size: IDL.Opt(IDL.Nat),\n custom_sections_size: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusType = IDL.Variant({\n stopped: IDL.Null,\n stopping: IDL.Null,\n running: IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n freezing_threshold: IDL.Nat,\n wasm_memory_threshold: IDL.Opt(IDL.Nat),\n controllers: IDL.Vec(IDL.Principal),\n wasm_memory_limit: IDL.Opt(IDL.Nat),\n memory_allocation: IDL.Nat,\n compute_allocation: IDL.Nat,\n });\n const QueryStats = IDL.Record({\n response_payload_bytes_total: IDL.Opt(IDL.Nat),\n num_instructions_total: IDL.Opt(IDL.Nat),\n num_calls_total: IDL.Opt(IDL.Nat),\n request_payload_bytes_total: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusResultV2 = IDL.Record({\n memory_metrics: IDL.Opt(MemoryMetrics),\n status: CanisterStatusType,\n memory_size: IDL.Nat,\n cycles: IDL.Nat,\n settings: DefiniteCanisterSettingsArgs,\n query_stats: IDL.Opt(QueryStats),\n idle_cycles_burned_per_day: IDL.Nat,\n module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetRunningSnsVersionResponse = IDL.Record({\n deployed_version: IDL.Opt(Version),\n pending_version: IDL.Opt(\n IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Nat64,\n target_version: IDL.Opt(Version),\n }),\n ),\n });\n const GetSnsInitializationParametersResponse = IDL.Record({\n sns_initialization_parameters: IDL.Text,\n });\n const GetTimersResponse = IDL.Record({ timers: IDL.Opt(Timers) });\n const GetUpgradeJournalRequest = IDL.Record({\n offset: IDL.Opt(IDL.Nat64),\n limit: IDL.Opt(IDL.Nat64),\n });\n const GetUpgradeJournalResponse = IDL.Record({\n upgrade_journal: IDL.Opt(UpgradeJournal),\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n deployed_version: IDL.Opt(Version),\n target_version: IDL.Opt(Version),\n upgrade_journal_entry_count: IDL.Opt(IDL.Nat64),\n });\n const ListNervousSystemFunctionsResponse = IDL.Record({\n reserved_ids: IDL.Vec(IDL.Nat64),\n functions: IDL.Vec(NervousSystemFunction),\n });\n const ListNeurons = IDL.Record({\n of_principal: IDL.Opt(IDL.Principal),\n limit: IDL.Nat32,\n start_page_at: IDL.Opt(NeuronId),\n });\n const ListNeuronsResponse = IDL.Record({ neurons: IDL.Vec(Neuron) });\n const TopicSelector = IDL.Record({ topic: IDL.Opt(Topic) });\n const ListProposals = IDL.Record({\n include_reward_status: IDL.Vec(IDL.Int32),\n before_proposal: IDL.Opt(ProposalId),\n limit: IDL.Nat32,\n exclude_type: IDL.Vec(IDL.Nat64),\n include_topics: IDL.Opt(IDL.Vec(TopicSelector)),\n include_status: IDL.Vec(IDL.Int32),\n });\n const ListProposalsResponse = IDL.Record({\n include_ballots_by_caller: IDL.Opt(IDL.Bool),\n proposals: IDL.Vec(ProposalData),\n include_topic_filtering: IDL.Opt(IDL.Bool),\n });\n const ListTopicsRequest = IDL.Record({});\n const ExtensionOperationType = IDL.Variant({\n TreasuryManagerWithdraw: IDL.Null,\n TreasuryManagerDeposit: IDL.Null,\n });\n const ExtensionType = IDL.Variant({ TreasuryManager: IDL.Null });\n const ExtensionOperationSpec = IDL.Record({\n topic: IDL.Opt(Topic),\n operation_type: IDL.Opt(ExtensionOperationType),\n description: IDL.Opt(IDL.Text),\n extension_type: IDL.Opt(ExtensionType),\n });\n const RegisteredExtensionOperationSpec = IDL.Record({\n spec: IDL.Opt(ExtensionOperationSpec),\n canister_id: IDL.Opt(IDL.Principal),\n });\n const TopicInfo = IDL.Record({\n extension_operations: IDL.Opt(IDL.Vec(RegisteredExtensionOperationSpec)),\n native_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n topic: IDL.Opt(Topic),\n is_critical: IDL.Opt(IDL.Bool),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n custom_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n });\n const ListTopicsResponse = IDL.Record({\n uncategorized_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n topics: IDL.Opt(IDL.Vec(TopicInfo)),\n });\n const StakeMaturity = IDL.Record({\n percentage_to_stake: IDL.Opt(IDL.Nat32),\n });\n const Command = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n ClaimOrRefresh: ClaimOrRefresh,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n MakeProposal: Proposal,\n StakeMaturity: StakeMaturity,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const ManageNeuron = IDL.Record({\n subaccount: IDL.Vec(IDL.Nat8),\n command: IDL.Opt(Command),\n });\n const SplitResponse = IDL.Record({ created_neuron_id: IDL.Opt(NeuronId) });\n const DisburseMaturityResponse = IDL.Record({\n amount_disbursed_e8s: IDL.Nat64,\n amount_deducted_e8s: IDL.Opt(IDL.Nat64),\n });\n const ClaimOrRefreshResponse = IDL.Record({\n refreshed_neuron_id: IDL.Opt(NeuronId),\n });\n const StakeMaturityResponse = IDL.Record({\n maturity_e8s: IDL.Nat64,\n staked_maturity_e8s: IDL.Nat64,\n });\n const MergeMaturityResponse = IDL.Record({\n merged_maturity_e8s: IDL.Nat64,\n new_stake_e8s: IDL.Nat64,\n });\n const DisburseResponse = IDL.Record({ transfer_block_height: IDL.Nat64 });\n const Command_1 = IDL.Variant({\n Error: GovernanceError,\n Split: SplitResponse,\n Follow: IDL.Record({}),\n DisburseMaturity: DisburseMaturityResponse,\n ClaimOrRefresh: ClaimOrRefreshResponse,\n Configure: IDL.Record({}),\n RegisterVote: IDL.Record({}),\n SetFollowing: IDL.Record({}),\n MakeProposal: GetProposal,\n RemoveNeuronPermission: IDL.Record({}),\n StakeMaturity: StakeMaturityResponse,\n MergeMaturity: MergeMaturityResponse,\n Disburse: DisburseResponse,\n AddNeuronPermission: IDL.Record({}),\n });\n const ManageNeuronResponse = IDL.Record({ command: IDL.Opt(Command_1) });\n const SetMode = IDL.Record({ mode: IDL.Int32 });\n\n return IDL.Service({\n claim_swap_neurons: IDL.Func(\n [ClaimSwapNeuronsRequest],\n [ClaimSwapNeuronsResponse],\n [],\n ),\n fail_stuck_upgrade_in_progress: IDL.Func(\n [IDL.Record({})],\n [IDL.Record({})],\n [],\n ),\n get_build_metadata: IDL.Func([], [IDL.Text], []),\n get_latest_reward_event: IDL.Func([], [RewardEvent], []),\n get_maturity_modulation: IDL.Func(\n [IDL.Record({})],\n [GetMaturityModulationResponse],\n [],\n ),\n get_metadata: IDL.Func([IDL.Record({})], [GetMetadataResponse], []),\n get_metrics: IDL.Func([GetMetricsRequest], [GetMetricsResponse], []),\n get_metrics_replicated: IDL.Func(\n [GetMetricsRequest],\n [GetMetricsResponse],\n [],\n ),\n get_mode: IDL.Func([IDL.Record({})], [GetModeResponse], []),\n get_nervous_system_parameters: IDL.Func(\n [IDL.Null],\n [NervousSystemParameters],\n [],\n ),\n get_neuron: IDL.Func([GetNeuron], [GetNeuronResponse], []),\n get_proposal: IDL.Func([GetProposal], [GetProposalResponse], []),\n get_root_canister_status: IDL.Func(\n [IDL.Null],\n [CanisterStatusResultV2],\n [],\n ),\n get_running_sns_version: IDL.Func(\n [IDL.Record({})],\n [GetRunningSnsVersionResponse],\n [],\n ),\n get_sns_initialization_parameters: IDL.Func(\n [IDL.Record({})],\n [GetSnsInitializationParametersResponse],\n [],\n ),\n get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], []),\n get_upgrade_journal: IDL.Func(\n [GetUpgradeJournalRequest],\n [GetUpgradeJournalResponse],\n [],\n ),\n list_nervous_system_functions: IDL.Func(\n [],\n [ListNervousSystemFunctionsResponse],\n [],\n ),\n list_neurons: IDL.Func([ListNeurons], [ListNeuronsResponse], []),\n list_proposals: IDL.Func([ListProposals], [ListProposalsResponse], []),\n list_topics: IDL.Func([ListTopicsRequest], [ListTopicsResponse], []),\n manage_neuron: IDL.Func([ManageNeuron], [ManageNeuronResponse], []),\n reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], []),\n set_mode: IDL.Func([SetMode], [IDL.Record({})], []),\n });\n};\n\nexport const init = ({ IDL }) => {\n const PreciseValue = IDL.Rec();\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Version = IDL.Record({\n archive_wasm_hash: IDL.Vec(IDL.Nat8),\n root_wasm_hash: IDL.Vec(IDL.Nat8),\n swap_wasm_hash: IDL.Vec(IDL.Nat8),\n ledger_wasm_hash: IDL.Vec(IDL.Nat8),\n governance_wasm_hash: IDL.Vec(IDL.Nat8),\n index_wasm_hash: IDL.Vec(IDL.Nat8),\n });\n const Versions = IDL.Record({ versions: IDL.Vec(Version) });\n const CachedUpgradeSteps = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requested_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Topic = IDL.Variant({\n DappCanisterManagement: IDL.Null,\n DaoCommunitySettings: IDL.Null,\n ApplicationBusinessLogic: IDL.Null,\n CriticalDappOperations: IDL.Null,\n TreasuryAssetManagement: IDL.Null,\n Governance: IDL.Null,\n SnsFrameworkManagement: IDL.Null,\n });\n const GenericNervousSystemFunction = IDL.Record({\n topic: IDL.Opt(Topic),\n validator_canister_id: IDL.Opt(IDL.Principal),\n target_canister_id: IDL.Opt(IDL.Principal),\n validator_method_name: IDL.Opt(IDL.Text),\n target_method_name: IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n NativeNervousSystemFunction: IDL.Record({}),\n GenericNervousSystemFunction: GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n id: IDL.Nat64,\n name: IDL.Text,\n description: IDL.Opt(IDL.Text),\n function_type: IDL.Opt(FunctionType),\n });\n const Subaccount = IDL.Record({ subaccount: IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n owner: IDL.Opt(IDL.Principal),\n subaccount: IDL.Opt(Subaccount),\n });\n const TreasuryMetrics = IDL.Record({\n name: IDL.Opt(IDL.Text),\n original_amount_e8s: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n account: IDL.Opt(Account),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n treasury: IDL.Int32,\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const VotingPowerMetrics = IDL.Record({\n governance_total_potential_voting_power: IDL.Opt(IDL.Nat64),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GovernanceCachedMetrics = IDL.Record({\n treasury_metrics: IDL.Vec(TreasuryMetrics),\n not_dissolving_neurons_e8s_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64),\n ),\n garbage_collectable_neurons_count: IDL.Nat64,\n neurons_with_invalid_stake_count: IDL.Nat64,\n not_dissolving_neurons_count_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64),\n ),\n neurons_with_less_than_6_months_dissolve_delay_count: IDL.Nat64,\n dissolved_neurons_count: IDL.Nat64,\n total_staked_e8s: IDL.Nat64,\n total_supply_governance_tokens: IDL.Nat64,\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n not_dissolving_neurons_count: IDL.Nat64,\n dissolved_neurons_e8s: IDL.Nat64,\n neurons_with_less_than_6_months_dissolve_delay_e8s: IDL.Nat64,\n dissolving_neurons_count_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Nat64)),\n dissolving_neurons_count: IDL.Nat64,\n dissolving_neurons_e8s_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Float64)),\n timestamp_seconds: IDL.Nat64,\n });\n const MaturityModulation = IDL.Record({\n current_basis_points: IDL.Opt(IDL.Int32),\n updated_at_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const TargetVersionSet = IDL.Record({\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n is_advanced_automatically: IDL.Opt(IDL.Bool),\n });\n const UpgradeStepsReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n upgrade_steps: IDL.Opt(Versions),\n });\n const UpgradeOutcome = IDL.Record({\n status: IDL.Opt(\n IDL.Variant({\n Success: IDL.Record({}),\n Timeout: IDL.Record({}),\n ExternalFailure: IDL.Record({}),\n InvalidState: IDL.Record({ version: IDL.Opt(Version) }),\n }),\n ),\n human_readable: IDL.Opt(IDL.Text),\n });\n const ProposalId = IDL.Record({ id: IDL.Nat64 });\n const UpgradeStarted = IDL.Record({\n current_version: IDL.Opt(Version),\n expected_version: IDL.Opt(Version),\n reason: IDL.Opt(\n IDL.Variant({\n UpgradeSnsToNextVersionProposal: ProposalId,\n BehindTargetVersion: IDL.Record({}),\n }),\n ),\n });\n const UpgradeStepsRefreshed = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n });\n const TargetVersionReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n });\n const UpgradeJournalEntry = IDL.Record({\n event: IDL.Opt(\n IDL.Variant({\n TargetVersionSet: TargetVersionSet,\n UpgradeStepsReset: UpgradeStepsReset,\n UpgradeOutcome: UpgradeOutcome,\n UpgradeStarted: UpgradeStarted,\n UpgradeStepsRefreshed: UpgradeStepsRefreshed,\n TargetVersionReset: TargetVersionReset,\n }),\n ),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const UpgradeJournal = IDL.Record({\n entries: IDL.Vec(UpgradeJournalEntry),\n });\n const NeuronId = IDL.Record({ id: IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ followees: IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n permissions: IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n final_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n reward_rate_transition_duration_seconds: IDL.Opt(IDL.Nat64),\n round_duration_seconds: IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n default_followees: IDL.Opt(DefaultFollowees),\n max_dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n max_dissolve_delay_bonus_percentage: IDL.Opt(IDL.Nat64),\n max_followees_per_function: IDL.Opt(IDL.Nat64),\n automatically_advance_target_version: IDL.Opt(IDL.Bool),\n neuron_claimer_permissions: IDL.Opt(NeuronPermissionList),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n max_neuron_age_for_age_bonus: IDL.Opt(IDL.Nat64),\n initial_voting_period_seconds: IDL.Opt(IDL.Nat64),\n neuron_minimum_dissolve_delay_to_vote_seconds: IDL.Opt(IDL.Nat64),\n reject_cost_e8s: IDL.Opt(IDL.Nat64),\n max_proposals_to_keep_per_action: IDL.Opt(IDL.Nat32),\n wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64),\n max_number_of_neurons: IDL.Opt(IDL.Nat64),\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64),\n max_age_bonus_percentage: IDL.Opt(IDL.Nat64),\n neuron_grantable_permissions: IDL.Opt(NeuronPermissionList),\n voting_rewards_parameters: IDL.Opt(VotingRewardsParameters),\n maturity_modulation_disabled: IDL.Opt(IDL.Bool),\n max_number_of_principals_per_neuron: IDL.Opt(IDL.Nat64),\n });\n const RewardEvent = IDL.Record({\n rounds_since_last_distribution: IDL.Opt(IDL.Nat64),\n actual_timestamp_seconds: IDL.Nat64,\n end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n total_available_e8s_equivalent: IDL.Opt(IDL.Nat64),\n distributed_e8s_equivalent: IDL.Nat64,\n round: IDL.Nat64,\n settled_proposals: IDL.Vec(ProposalId),\n });\n const PendingVersion = IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Opt(IDL.Nat64),\n target_version: IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n error_message: IDL.Text,\n error_type: IDL.Int32,\n });\n const Decimal = IDL.Record({ human_readable: IDL.Opt(IDL.Text) });\n const Tokens = IDL.Record({ e8s: IDL.Opt(IDL.Nat64) });\n const ValuationFactors = IDL.Record({\n xdrs_per_icp: IDL.Opt(Decimal),\n icps_per_token: IDL.Opt(Decimal),\n tokens: IDL.Opt(Tokens),\n });\n const Valuation = IDL.Record({\n token: IDL.Opt(IDL.Int32),\n account: IDL.Opt(Account),\n valuation_factors: IDL.Opt(ValuationFactors),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const MintSnsTokensActionAuxiliary = IDL.Record({\n valuation: IDL.Opt(Valuation),\n });\n const SnsVersion = IDL.Record({\n archive_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n root_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n swap_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n ledger_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n governance_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n index_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const AdvanceSnsTargetVersionActionAuxiliary = IDL.Record({\n target_version: IDL.Opt(SnsVersion),\n });\n const ActionAuxiliary = IDL.Variant({\n TransferSnsTreasuryFunds: MintSnsTokensActionAuxiliary,\n MintSnsTokens: MintSnsTokensActionAuxiliary,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersionActionAuxiliary,\n });\n const Ballot = IDL.Record({\n vote: IDL.Int32,\n cast_timestamp_seconds: IDL.Nat64,\n voting_power: IDL.Nat64,\n });\n const Percentage = IDL.Record({ basis_points: IDL.Opt(IDL.Nat64) });\n const Tally = IDL.Record({\n no: IDL.Nat64,\n yes: IDL.Nat64,\n total: IDL.Nat64,\n timestamp_seconds: IDL.Nat64,\n });\n const ManageDappCanisterSettings = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat64),\n wasm_memory_threshold: IDL.Opt(IDL.Nat64),\n canister_ids: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat64),\n log_visibility: IDL.Opt(IDL.Int32),\n wasm_memory_limit: IDL.Opt(IDL.Nat64),\n memory_allocation: IDL.Opt(IDL.Nat64),\n compute_allocation: IDL.Opt(IDL.Nat64),\n });\n PreciseValue.fill(\n IDL.Variant({\n Int: IDL.Int64,\n Map: IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),\n Nat: IDL.Nat64,\n Blob: IDL.Vec(IDL.Nat8),\n Bool: IDL.Bool,\n Text: IDL.Text,\n Array: IDL.Vec(PreciseValue),\n }),\n );\n const ExtensionOperationArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const ExecuteExtensionOperation = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n operation_name: IDL.Opt(IDL.Text),\n operation_arg: IDL.Opt(ExtensionOperationArg),\n });\n const ChunkedCanisterWasm = IDL.Record({\n wasm_module_hash: IDL.Vec(IDL.Nat8),\n chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),\n store_canister_id: IDL.Opt(IDL.Principal),\n });\n const Wasm = IDL.Variant({\n Chunked: ChunkedCanisterWasm,\n Bytes: IDL.Vec(IDL.Nat8),\n });\n const ExtensionUpgradeArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const UpgradeExtension = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n wasm: IDL.Opt(Wasm),\n canister_upgrade_arg: IDL.Opt(ExtensionUpgradeArg),\n });\n const SetTopicsForCustomProposals = IDL.Record({\n custom_function_id_to_topic: IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),\n });\n const ExtensionInit = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const RegisterExtension = IDL.Record({\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n extension_init: IDL.Opt(ExtensionInit),\n });\n const RegisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n });\n const TransferSnsTreasuryFunds = IDL.Record({\n from_treasury: IDL.Int32,\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n new_canister_wasm: IDL.Vec(IDL.Nat8),\n mode: IDL.Opt(IDL.Int32),\n canister_id: IDL.Opt(IDL.Principal),\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n canister_upgrade_arg: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const DeregisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n new_controllers: IDL.Vec(IDL.Principal),\n });\n const MintSnsTokens = IDL.Record({\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const AdvanceSnsTargetVersion = IDL.Record({\n new_target: IDL.Opt(SnsVersion),\n });\n const ManageSnsMetadata = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n function_id: IDL.Nat64,\n payload: IDL.Vec(IDL.Nat8),\n });\n const ManageLedgerParameters = IDL.Record({\n token_symbol: IDL.Opt(IDL.Text),\n transfer_fee: IDL.Opt(IDL.Nat64),\n token_logo: IDL.Opt(IDL.Text),\n token_name: IDL.Opt(IDL.Text),\n });\n const Motion = IDL.Record({ motion_text: IDL.Text });\n const Action = IDL.Variant({\n ManageNervousSystemParameters: NervousSystemParameters,\n AddGenericNervousSystemFunction: NervousSystemFunction,\n ManageDappCanisterSettings: ManageDappCanisterSettings,\n ExecuteExtensionOperation: ExecuteExtensionOperation,\n UpgradeExtension: UpgradeExtension,\n RemoveGenericNervousSystemFunction: IDL.Nat64,\n SetTopicsForCustomProposals: SetTopicsForCustomProposals,\n RegisterExtension: RegisterExtension,\n UpgradeSnsToNextVersion: IDL.Record({}),\n RegisterDappCanisters: RegisterDappCanisters,\n TransferSnsTreasuryFunds: TransferSnsTreasuryFunds,\n UpgradeSnsControlledCanister: UpgradeSnsControlledCanister,\n DeregisterDappCanisters: DeregisterDappCanisters,\n MintSnsTokens: MintSnsTokens,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersion,\n Unspecified: IDL.Record({}),\n ManageSnsMetadata: ManageSnsMetadata,\n ExecuteGenericNervousSystemFunction: ExecuteGenericNervousSystemFunction,\n ManageLedgerParameters: ManageLedgerParameters,\n Motion: Motion,\n });\n const Proposal = IDL.Record({\n url: IDL.Text,\n title: IDL.Text,\n action: IDL.Opt(Action),\n summary: IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n current_deadline_timestamp_seconds: IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n id: IDL.Opt(ProposalId),\n payload_text_rendering: IDL.Opt(IDL.Text),\n topic: IDL.Opt(Topic),\n action: IDL.Nat64,\n failure_reason: IDL.Opt(GovernanceError),\n action_auxiliary: IDL.Opt(ActionAuxiliary),\n ballots: IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n minimum_yes_proportion_of_total: IDL.Opt(Percentage),\n reward_event_round: IDL.Nat64,\n failed_timestamp_seconds: IDL.Nat64,\n reward_event_end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n proposal_creation_timestamp_seconds: IDL.Nat64,\n initial_voting_period_seconds: IDL.Nat64,\n reject_cost_e8s: IDL.Nat64,\n latest_tally: IDL.Opt(Tally),\n wait_for_quiet_deadline_increase_seconds: IDL.Nat64,\n decided_timestamp_seconds: IDL.Nat64,\n proposal: IDL.Opt(Proposal),\n proposer: IDL.Opt(NeuronId),\n wait_for_quiet_state: IDL.Opt(WaitForQuietState),\n minimum_yes_proportion_of_exercised: IDL.Opt(Percentage),\n is_eligible_for_rewards: IDL.Bool,\n executed_timestamp_seconds: IDL.Nat64,\n });\n const Split = IDL.Record({ memo: IDL.Nat64, amount_e8s: IDL.Nat64 });\n const Follow = IDL.Record({\n function_id: IDL.Nat64,\n followees: IDL.Vec(NeuronId),\n });\n const DisburseMaturity = IDL.Record({\n to_account: IDL.Opt(Account),\n percentage_to_disburse: IDL.Nat32,\n });\n const ChangeAutoStakeMaturity = IDL.Record({\n requested_setting_for_auto_stake_maturity: IDL.Bool,\n });\n const IncreaseDissolveDelay = IDL.Record({\n additional_dissolve_delay_seconds: IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n dissolve_timestamp_seconds: IDL.Nat64,\n });\n const Operation = IDL.Variant({\n ChangeAutoStakeMaturity: ChangeAutoStakeMaturity,\n StopDissolving: IDL.Record({}),\n StartDissolving: IDL.Record({}),\n IncreaseDissolveDelay: IncreaseDissolveDelay,\n SetDissolveTimestamp: SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ operation: IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n vote: IDL.Int32,\n proposal: IDL.Opt(ProposalId),\n });\n const Followee = IDL.Record({\n alias: IDL.Opt(IDL.Text),\n neuron_id: IDL.Opt(NeuronId),\n });\n const FolloweesForTopic = IDL.Record({\n topic: IDL.Opt(Topic),\n followees: IDL.Vec(Followee),\n });\n const SetFollowing = IDL.Record({\n topic_following: IDL.Vec(FolloweesForTopic),\n });\n const FinalizeDisburseMaturity = IDL.Record({\n amount_to_be_disbursed_e8s: IDL.Nat64,\n to_account: IDL.Opt(Account),\n });\n const MemoAndController = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n memo: IDL.Nat64,\n });\n const By = IDL.Variant({\n MemoAndController: MemoAndController,\n NeuronId: IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ by: IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n permissions_to_remove: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n permissions_to_add: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ percentage_to_merge: IDL.Nat32 });\n const Amount = IDL.Record({ e8s: IDL.Nat64 });\n const Disburse = IDL.Record({\n to_account: IDL.Opt(Account),\n amount: IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n SyncCommand: IDL.Record({}),\n MakeProposal: Proposal,\n FinalizeDisburseMaturity: FinalizeDisburseMaturity,\n ClaimOrRefreshNeuron: ClaimOrRefresh,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n command: IDL.Opt(Command_2),\n timestamp: IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n principal: IDL.Opt(IDL.Principal),\n permission_type: IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n DissolveDelaySeconds: IDL.Nat64,\n WhenDissolvedTimestampSeconds: IDL.Nat64,\n });\n const DisburseMaturityInProgress = IDL.Record({\n timestamp_of_disbursement_seconds: IDL.Nat64,\n amount_e8s: IDL.Nat64,\n account_to_disburse_to: IDL.Opt(Account),\n finalize_disbursement_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Neuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n staked_maturity_e8s_equivalent: IDL.Opt(IDL.Nat64),\n permissions: IDL.Vec(NeuronPermission),\n maturity_e8s_equivalent: IDL.Nat64,\n cached_neuron_stake_e8s: IDL.Nat64,\n created_timestamp_seconds: IDL.Nat64,\n topic_followees: IDL.Opt(\n IDL.Record({\n topic_id_to_followees: IDL.Vec(IDL.Tuple(IDL.Int32, FolloweesForTopic)),\n }),\n ),\n source_nns_neuron_id: IDL.Opt(IDL.Nat64),\n auto_stake_maturity: IDL.Opt(IDL.Bool),\n aging_since_timestamp_seconds: IDL.Nat64,\n dissolve_state: IDL.Opt(DissolveState),\n voting_power_percentage_multiplier: IDL.Nat64,\n vesting_period_seconds: IDL.Opt(IDL.Nat64),\n disburse_maturity_in_progress: IDL.Vec(DisburseMaturityInProgress),\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n neuron_fees_e8s: IDL.Nat64,\n });\n const Governance = IDL.Record({\n root_canister_id: IDL.Opt(IDL.Principal),\n timers: IDL.Opt(Timers),\n cached_upgrade_steps: IDL.Opt(CachedUpgradeSteps),\n id_to_nervous_system_functions: IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction),\n ),\n metrics: IDL.Opt(GovernanceCachedMetrics),\n maturity_modulation: IDL.Opt(MaturityModulation),\n upgrade_journal: IDL.Opt(UpgradeJournal),\n mode: IDL.Int32,\n parameters: IDL.Opt(NervousSystemParameters),\n is_finalizing_disburse_maturity: IDL.Opt(IDL.Bool),\n deployed_version: IDL.Opt(Version),\n sns_initialization_parameters: IDL.Text,\n latest_reward_event: IDL.Opt(RewardEvent),\n pending_version: IDL.Opt(PendingVersion),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n proposals: IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n in_flight_commands: IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n sns_metadata: IDL.Opt(ManageSnsMetadata),\n neurons: IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n target_version: IDL.Opt(Version),\n genesis_timestamp_seconds: IDL.Nat64,\n });\n\n return [Governance];\n};\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.0-patch-typed-arrays.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({ IDL }) => {\n const PreciseValue = IDL.Rec();\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Version = IDL.Record({\n archive_wasm_hash: IDL.Vec(IDL.Nat8),\n root_wasm_hash: IDL.Vec(IDL.Nat8),\n swap_wasm_hash: IDL.Vec(IDL.Nat8),\n ledger_wasm_hash: IDL.Vec(IDL.Nat8),\n governance_wasm_hash: IDL.Vec(IDL.Nat8),\n index_wasm_hash: IDL.Vec(IDL.Nat8),\n });\n const Versions = IDL.Record({ versions: IDL.Vec(Version) });\n const CachedUpgradeSteps = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requested_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Topic = IDL.Variant({\n DappCanisterManagement: IDL.Null,\n DaoCommunitySettings: IDL.Null,\n ApplicationBusinessLogic: IDL.Null,\n CriticalDappOperations: IDL.Null,\n TreasuryAssetManagement: IDL.Null,\n Governance: IDL.Null,\n SnsFrameworkManagement: IDL.Null,\n });\n const GenericNervousSystemFunction = IDL.Record({\n topic: IDL.Opt(Topic),\n validator_canister_id: IDL.Opt(IDL.Principal),\n target_canister_id: IDL.Opt(IDL.Principal),\n validator_method_name: IDL.Opt(IDL.Text),\n target_method_name: IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n NativeNervousSystemFunction: IDL.Record({}),\n GenericNervousSystemFunction: GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n id: IDL.Nat64,\n name: IDL.Text,\n description: IDL.Opt(IDL.Text),\n function_type: IDL.Opt(FunctionType),\n });\n const Subaccount = IDL.Record({ subaccount: IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n owner: IDL.Opt(IDL.Principal),\n subaccount: IDL.Opt(Subaccount),\n });\n const TreasuryMetrics = IDL.Record({\n name: IDL.Opt(IDL.Text),\n original_amount_e8s: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n account: IDL.Opt(Account),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n treasury: IDL.Int32,\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const VotingPowerMetrics = IDL.Record({\n governance_total_potential_voting_power: IDL.Opt(IDL.Nat64),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GovernanceCachedMetrics = IDL.Record({\n treasury_metrics: IDL.Vec(TreasuryMetrics),\n not_dissolving_neurons_e8s_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64),\n ),\n garbage_collectable_neurons_count: IDL.Nat64,\n neurons_with_invalid_stake_count: IDL.Nat64,\n not_dissolving_neurons_count_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64),\n ),\n neurons_with_less_than_6_months_dissolve_delay_count: IDL.Nat64,\n dissolved_neurons_count: IDL.Nat64,\n total_staked_e8s: IDL.Nat64,\n total_supply_governance_tokens: IDL.Nat64,\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n not_dissolving_neurons_count: IDL.Nat64,\n dissolved_neurons_e8s: IDL.Nat64,\n neurons_with_less_than_6_months_dissolve_delay_e8s: IDL.Nat64,\n dissolving_neurons_count_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Nat64)),\n dissolving_neurons_count: IDL.Nat64,\n dissolving_neurons_e8s_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Float64)),\n timestamp_seconds: IDL.Nat64,\n });\n const MaturityModulation = IDL.Record({\n current_basis_points: IDL.Opt(IDL.Int32),\n updated_at_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const TargetVersionSet = IDL.Record({\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n is_advanced_automatically: IDL.Opt(IDL.Bool),\n });\n const UpgradeStepsReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n upgrade_steps: IDL.Opt(Versions),\n });\n const UpgradeOutcome = IDL.Record({\n status: IDL.Opt(\n IDL.Variant({\n Success: IDL.Record({}),\n Timeout: IDL.Record({}),\n ExternalFailure: IDL.Record({}),\n InvalidState: IDL.Record({ version: IDL.Opt(Version) }),\n }),\n ),\n human_readable: IDL.Opt(IDL.Text),\n });\n const ProposalId = IDL.Record({ id: IDL.Nat64 });\n const UpgradeStarted = IDL.Record({\n current_version: IDL.Opt(Version),\n expected_version: IDL.Opt(Version),\n reason: IDL.Opt(\n IDL.Variant({\n UpgradeSnsToNextVersionProposal: ProposalId,\n BehindTargetVersion: IDL.Record({}),\n }),\n ),\n });\n const UpgradeStepsRefreshed = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n });\n const TargetVersionReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n });\n const UpgradeJournalEntry = IDL.Record({\n event: IDL.Opt(\n IDL.Variant({\n TargetVersionSet: TargetVersionSet,\n UpgradeStepsReset: UpgradeStepsReset,\n UpgradeOutcome: UpgradeOutcome,\n UpgradeStarted: UpgradeStarted,\n UpgradeStepsRefreshed: UpgradeStepsRefreshed,\n TargetVersionReset: TargetVersionReset,\n }),\n ),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const UpgradeJournal = IDL.Record({\n entries: IDL.Vec(UpgradeJournalEntry),\n });\n const NeuronId = IDL.Record({ id: IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ followees: IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n permissions: IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n final_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n reward_rate_transition_duration_seconds: IDL.Opt(IDL.Nat64),\n round_duration_seconds: IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n default_followees: IDL.Opt(DefaultFollowees),\n max_dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n max_dissolve_delay_bonus_percentage: IDL.Opt(IDL.Nat64),\n max_followees_per_function: IDL.Opt(IDL.Nat64),\n automatically_advance_target_version: IDL.Opt(IDL.Bool),\n neuron_claimer_permissions: IDL.Opt(NeuronPermissionList),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n max_neuron_age_for_age_bonus: IDL.Opt(IDL.Nat64),\n initial_voting_period_seconds: IDL.Opt(IDL.Nat64),\n neuron_minimum_dissolve_delay_to_vote_seconds: IDL.Opt(IDL.Nat64),\n reject_cost_e8s: IDL.Opt(IDL.Nat64),\n max_proposals_to_keep_per_action: IDL.Opt(IDL.Nat32),\n wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64),\n max_number_of_neurons: IDL.Opt(IDL.Nat64),\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64),\n max_age_bonus_percentage: IDL.Opt(IDL.Nat64),\n neuron_grantable_permissions: IDL.Opt(NeuronPermissionList),\n voting_rewards_parameters: IDL.Opt(VotingRewardsParameters),\n maturity_modulation_disabled: IDL.Opt(IDL.Bool),\n max_number_of_principals_per_neuron: IDL.Opt(IDL.Nat64),\n });\n const RewardEvent = IDL.Record({\n rounds_since_last_distribution: IDL.Opt(IDL.Nat64),\n actual_timestamp_seconds: IDL.Nat64,\n end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n total_available_e8s_equivalent: IDL.Opt(IDL.Nat64),\n distributed_e8s_equivalent: IDL.Nat64,\n round: IDL.Nat64,\n settled_proposals: IDL.Vec(ProposalId),\n });\n const PendingVersion = IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Opt(IDL.Nat64),\n target_version: IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n error_message: IDL.Text,\n error_type: IDL.Int32,\n });\n const Decimal = IDL.Record({ human_readable: IDL.Opt(IDL.Text) });\n const Tokens = IDL.Record({ e8s: IDL.Opt(IDL.Nat64) });\n const ValuationFactors = IDL.Record({\n xdrs_per_icp: IDL.Opt(Decimal),\n icps_per_token: IDL.Opt(Decimal),\n tokens: IDL.Opt(Tokens),\n });\n const Valuation = IDL.Record({\n token: IDL.Opt(IDL.Int32),\n account: IDL.Opt(Account),\n valuation_factors: IDL.Opt(ValuationFactors),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const MintSnsTokensActionAuxiliary = IDL.Record({\n valuation: IDL.Opt(Valuation),\n });\n const SnsVersion = IDL.Record({\n archive_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n root_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n swap_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n ledger_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n governance_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n index_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const AdvanceSnsTargetVersionActionAuxiliary = IDL.Record({\n target_version: IDL.Opt(SnsVersion),\n });\n const ActionAuxiliary = IDL.Variant({\n TransferSnsTreasuryFunds: MintSnsTokensActionAuxiliary,\n MintSnsTokens: MintSnsTokensActionAuxiliary,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersionActionAuxiliary,\n });\n const Ballot = IDL.Record({\n vote: IDL.Int32,\n cast_timestamp_seconds: IDL.Nat64,\n voting_power: IDL.Nat64,\n });\n const Percentage = IDL.Record({ basis_points: IDL.Opt(IDL.Nat64) });\n const Tally = IDL.Record({\n no: IDL.Nat64,\n yes: IDL.Nat64,\n total: IDL.Nat64,\n timestamp_seconds: IDL.Nat64,\n });\n const ManageDappCanisterSettings = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat64),\n wasm_memory_threshold: IDL.Opt(IDL.Nat64),\n canister_ids: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat64),\n log_visibility: IDL.Opt(IDL.Int32),\n wasm_memory_limit: IDL.Opt(IDL.Nat64),\n memory_allocation: IDL.Opt(IDL.Nat64),\n compute_allocation: IDL.Opt(IDL.Nat64),\n });\n PreciseValue.fill(\n IDL.Variant({\n Int: IDL.Int64,\n Map: IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),\n Nat: IDL.Nat64,\n Blob: IDL.Vec(IDL.Nat8),\n Bool: IDL.Bool,\n Text: IDL.Text,\n Array: IDL.Vec(PreciseValue),\n }),\n );\n const ExtensionOperationArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const ExecuteExtensionOperation = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n operation_name: IDL.Opt(IDL.Text),\n operation_arg: IDL.Opt(ExtensionOperationArg),\n });\n const ChunkedCanisterWasm = IDL.Record({\n wasm_module_hash: IDL.Vec(IDL.Nat8),\n chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),\n store_canister_id: IDL.Opt(IDL.Principal),\n });\n const Wasm = IDL.Variant({\n Chunked: ChunkedCanisterWasm,\n Bytes: IDL.Vec(IDL.Nat8),\n });\n const ExtensionUpgradeArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const UpgradeExtension = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n wasm: IDL.Opt(Wasm),\n canister_upgrade_arg: IDL.Opt(ExtensionUpgradeArg),\n });\n const SetTopicsForCustomProposals = IDL.Record({\n custom_function_id_to_topic: IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),\n });\n const ExtensionInit = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const RegisterExtension = IDL.Record({\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n extension_init: IDL.Opt(ExtensionInit),\n });\n const RegisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n });\n const TransferSnsTreasuryFunds = IDL.Record({\n from_treasury: IDL.Int32,\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n new_canister_wasm: IDL.Vec(IDL.Nat8),\n mode: IDL.Opt(IDL.Int32),\n canister_id: IDL.Opt(IDL.Principal),\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n canister_upgrade_arg: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const DeregisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n new_controllers: IDL.Vec(IDL.Principal),\n });\n const MintSnsTokens = IDL.Record({\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const AdvanceSnsTargetVersion = IDL.Record({\n new_target: IDL.Opt(SnsVersion),\n });\n const ManageSnsMetadata = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n function_id: IDL.Nat64,\n payload: IDL.Vec(IDL.Nat8),\n });\n const ManageLedgerParameters = IDL.Record({\n token_symbol: IDL.Opt(IDL.Text),\n transfer_fee: IDL.Opt(IDL.Nat64),\n token_logo: IDL.Opt(IDL.Text),\n token_name: IDL.Opt(IDL.Text),\n });\n const Motion = IDL.Record({ motion_text: IDL.Text });\n const Action = IDL.Variant({\n ManageNervousSystemParameters: NervousSystemParameters,\n AddGenericNervousSystemFunction: NervousSystemFunction,\n ManageDappCanisterSettings: ManageDappCanisterSettings,\n ExecuteExtensionOperation: ExecuteExtensionOperation,\n UpgradeExtension: UpgradeExtension,\n RemoveGenericNervousSystemFunction: IDL.Nat64,\n SetTopicsForCustomProposals: SetTopicsForCustomProposals,\n RegisterExtension: RegisterExtension,\n UpgradeSnsToNextVersion: IDL.Record({}),\n RegisterDappCanisters: RegisterDappCanisters,\n TransferSnsTreasuryFunds: TransferSnsTreasuryFunds,\n UpgradeSnsControlledCanister: UpgradeSnsControlledCanister,\n DeregisterDappCanisters: DeregisterDappCanisters,\n MintSnsTokens: MintSnsTokens,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersion,\n Unspecified: IDL.Record({}),\n ManageSnsMetadata: ManageSnsMetadata,\n ExecuteGenericNervousSystemFunction: ExecuteGenericNervousSystemFunction,\n ManageLedgerParameters: ManageLedgerParameters,\n Motion: Motion,\n });\n const Proposal = IDL.Record({\n url: IDL.Text,\n title: IDL.Text,\n action: IDL.Opt(Action),\n summary: IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n current_deadline_timestamp_seconds: IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n id: IDL.Opt(ProposalId),\n payload_text_rendering: IDL.Opt(IDL.Text),\n topic: IDL.Opt(Topic),\n action: IDL.Nat64,\n failure_reason: IDL.Opt(GovernanceError),\n action_auxiliary: IDL.Opt(ActionAuxiliary),\n ballots: IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n minimum_yes_proportion_of_total: IDL.Opt(Percentage),\n reward_event_round: IDL.Nat64,\n failed_timestamp_seconds: IDL.Nat64,\n reward_event_end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n proposal_creation_timestamp_seconds: IDL.Nat64,\n initial_voting_period_seconds: IDL.Nat64,\n reject_cost_e8s: IDL.Nat64,\n latest_tally: IDL.Opt(Tally),\n wait_for_quiet_deadline_increase_seconds: IDL.Nat64,\n decided_timestamp_seconds: IDL.Nat64,\n proposal: IDL.Opt(Proposal),\n proposer: IDL.Opt(NeuronId),\n wait_for_quiet_state: IDL.Opt(WaitForQuietState),\n minimum_yes_proportion_of_exercised: IDL.Opt(Percentage),\n is_eligible_for_rewards: IDL.Bool,\n executed_timestamp_seconds: IDL.Nat64,\n });\n const Split = IDL.Record({ memo: IDL.Nat64, amount_e8s: IDL.Nat64 });\n const Follow = IDL.Record({\n function_id: IDL.Nat64,\n followees: IDL.Vec(NeuronId),\n });\n const DisburseMaturity = IDL.Record({\n to_account: IDL.Opt(Account),\n percentage_to_disburse: IDL.Nat32,\n });\n const ChangeAutoStakeMaturity = IDL.Record({\n requested_setting_for_auto_stake_maturity: IDL.Bool,\n });\n const IncreaseDissolveDelay = IDL.Record({\n additional_dissolve_delay_seconds: IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n dissolve_timestamp_seconds: IDL.Nat64,\n });\n const Operation = IDL.Variant({\n ChangeAutoStakeMaturity: ChangeAutoStakeMaturity,\n StopDissolving: IDL.Record({}),\n StartDissolving: IDL.Record({}),\n IncreaseDissolveDelay: IncreaseDissolveDelay,\n SetDissolveTimestamp: SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ operation: IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n vote: IDL.Int32,\n proposal: IDL.Opt(ProposalId),\n });\n const Followee = IDL.Record({\n alias: IDL.Opt(IDL.Text),\n neuron_id: IDL.Opt(NeuronId),\n });\n const FolloweesForTopic = IDL.Record({\n topic: IDL.Opt(Topic),\n followees: IDL.Vec(Followee),\n });\n const SetFollowing = IDL.Record({\n topic_following: IDL.Vec(FolloweesForTopic),\n });\n const FinalizeDisburseMaturity = IDL.Record({\n amount_to_be_disbursed_e8s: IDL.Nat64,\n to_account: IDL.Opt(Account),\n });\n const MemoAndController = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n memo: IDL.Nat64,\n });\n const By = IDL.Variant({\n MemoAndController: MemoAndController,\n NeuronId: IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ by: IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n permissions_to_remove: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n permissions_to_add: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ percentage_to_merge: IDL.Nat32 });\n const Amount = IDL.Record({ e8s: IDL.Nat64 });\n const Disburse = IDL.Record({\n to_account: IDL.Opt(Account),\n amount: IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n SyncCommand: IDL.Record({}),\n MakeProposal: Proposal,\n FinalizeDisburseMaturity: FinalizeDisburseMaturity,\n ClaimOrRefreshNeuron: ClaimOrRefresh,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n command: IDL.Opt(Command_2),\n timestamp: IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n principal: IDL.Opt(IDL.Principal),\n permission_type: IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n DissolveDelaySeconds: IDL.Nat64,\n WhenDissolvedTimestampSeconds: IDL.Nat64,\n });\n const DisburseMaturityInProgress = IDL.Record({\n timestamp_of_disbursement_seconds: IDL.Nat64,\n amount_e8s: IDL.Nat64,\n account_to_disburse_to: IDL.Opt(Account),\n finalize_disbursement_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Neuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n staked_maturity_e8s_equivalent: IDL.Opt(IDL.Nat64),\n permissions: IDL.Vec(NeuronPermission),\n maturity_e8s_equivalent: IDL.Nat64,\n cached_neuron_stake_e8s: IDL.Nat64,\n created_timestamp_seconds: IDL.Nat64,\n topic_followees: IDL.Opt(\n IDL.Record({\n topic_id_to_followees: IDL.Vec(IDL.Tuple(IDL.Int32, FolloweesForTopic)),\n }),\n ),\n source_nns_neuron_id: IDL.Opt(IDL.Nat64),\n auto_stake_maturity: IDL.Opt(IDL.Bool),\n aging_since_timestamp_seconds: IDL.Nat64,\n dissolve_state: IDL.Opt(DissolveState),\n voting_power_percentage_multiplier: IDL.Nat64,\n vesting_period_seconds: IDL.Opt(IDL.Nat64),\n disburse_maturity_in_progress: IDL.Vec(DisburseMaturityInProgress),\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n neuron_fees_e8s: IDL.Nat64,\n });\n const Governance = IDL.Record({\n root_canister_id: IDL.Opt(IDL.Principal),\n timers: IDL.Opt(Timers),\n cached_upgrade_steps: IDL.Opt(CachedUpgradeSteps),\n id_to_nervous_system_functions: IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction),\n ),\n metrics: IDL.Opt(GovernanceCachedMetrics),\n maturity_modulation: IDL.Opt(MaturityModulation),\n upgrade_journal: IDL.Opt(UpgradeJournal),\n mode: IDL.Int32,\n parameters: IDL.Opt(NervousSystemParameters),\n is_finalizing_disburse_maturity: IDL.Opt(IDL.Bool),\n deployed_version: IDL.Opt(Version),\n sns_initialization_parameters: IDL.Text,\n latest_reward_event: IDL.Opt(RewardEvent),\n pending_version: IDL.Opt(PendingVersion),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n proposals: IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n in_flight_commands: IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n sns_metadata: IDL.Opt(ManageSnsMetadata),\n neurons: IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n target_version: IDL.Opt(Version),\n genesis_timestamp_seconds: IDL.Nat64,\n });\n const Principals = IDL.Record({ principals: IDL.Vec(IDL.Principal) });\n const NeuronsFund = IDL.Record({\n nns_neuron_hotkeys: IDL.Opt(Principals),\n nns_neuron_controller: IDL.Opt(IDL.Principal),\n nns_neuron_id: IDL.Opt(IDL.Nat64),\n });\n const Participant = IDL.Variant({\n NeuronsFund: NeuronsFund,\n Direct: IDL.Record({}),\n });\n const NeuronIds = IDL.Record({ neuron_ids: IDL.Vec(NeuronId) });\n const NeuronRecipe = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n participant: IDL.Opt(Participant),\n stake_e8s: IDL.Opt(IDL.Nat64),\n followees: IDL.Opt(NeuronIds),\n neuron_id: IDL.Opt(NeuronId),\n });\n const NeuronRecipes = IDL.Record({\n neuron_recipes: IDL.Vec(NeuronRecipe),\n });\n const ClaimSwapNeuronsRequest = IDL.Record({\n neuron_recipes: IDL.Opt(NeuronRecipes),\n });\n const SwapNeuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n status: IDL.Int32,\n });\n const ClaimedSwapNeurons = IDL.Record({\n swap_neurons: IDL.Vec(SwapNeuron),\n });\n const ClaimSwapNeuronsResult = IDL.Variant({\n Ok: ClaimedSwapNeurons,\n Err: IDL.Int32,\n });\n const ClaimSwapNeuronsResponse = IDL.Record({\n claim_swap_neurons_result: IDL.Opt(ClaimSwapNeuronsResult),\n });\n const GetMaturityModulationResponse = IDL.Record({\n maturity_modulation: IDL.Opt(MaturityModulation),\n });\n const GetMetadataResponse = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const GetMetricsRequest = IDL.Record({\n time_window_seconds: IDL.Opt(IDL.Nat64),\n });\n const Metrics = IDL.Record({\n treasury_metrics: IDL.Opt(IDL.Vec(TreasuryMetrics)),\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n last_ledger_block_timestamp: IDL.Opt(IDL.Nat64),\n num_recently_executed_proposals: IDL.Opt(IDL.Nat64),\n num_recently_submitted_proposals: IDL.Opt(IDL.Nat64),\n genesis_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GetMetricsResult = IDL.Variant({\n Ok: Metrics,\n Err: GovernanceError,\n });\n const GetMetricsResponse = IDL.Record({\n get_metrics_result: IDL.Opt(GetMetricsResult),\n });\n const GetModeResponse = IDL.Record({ mode: IDL.Opt(IDL.Int32) });\n const GetNeuron = IDL.Record({ neuron_id: IDL.Opt(NeuronId) });\n const Result = IDL.Variant({ Error: GovernanceError, Neuron: Neuron });\n const GetNeuronResponse = IDL.Record({ result: IDL.Opt(Result) });\n const GetProposal = IDL.Record({ proposal_id: IDL.Opt(ProposalId) });\n const Result_1 = IDL.Variant({\n Error: GovernanceError,\n Proposal: ProposalData,\n });\n const GetProposalResponse = IDL.Record({ result: IDL.Opt(Result_1) });\n const MemoryMetrics = IDL.Record({\n wasm_binary_size: IDL.Opt(IDL.Nat),\n wasm_chunk_store_size: IDL.Opt(IDL.Nat),\n canister_history_size: IDL.Opt(IDL.Nat),\n stable_memory_size: IDL.Opt(IDL.Nat),\n snapshots_size: IDL.Opt(IDL.Nat),\n wasm_memory_size: IDL.Opt(IDL.Nat),\n global_memory_size: IDL.Opt(IDL.Nat),\n custom_sections_size: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusType = IDL.Variant({\n stopped: IDL.Null,\n stopping: IDL.Null,\n running: IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n freezing_threshold: IDL.Nat,\n wasm_memory_threshold: IDL.Opt(IDL.Nat),\n controllers: IDL.Vec(IDL.Principal),\n wasm_memory_limit: IDL.Opt(IDL.Nat),\n memory_allocation: IDL.Nat,\n compute_allocation: IDL.Nat,\n });\n const QueryStats = IDL.Record({\n response_payload_bytes_total: IDL.Opt(IDL.Nat),\n num_instructions_total: IDL.Opt(IDL.Nat),\n num_calls_total: IDL.Opt(IDL.Nat),\n request_payload_bytes_total: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusResultV2 = IDL.Record({\n memory_metrics: IDL.Opt(MemoryMetrics),\n status: CanisterStatusType,\n memory_size: IDL.Nat,\n cycles: IDL.Nat,\n settings: DefiniteCanisterSettingsArgs,\n query_stats: IDL.Opt(QueryStats),\n idle_cycles_burned_per_day: IDL.Nat,\n module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetRunningSnsVersionResponse = IDL.Record({\n deployed_version: IDL.Opt(Version),\n pending_version: IDL.Opt(\n IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Nat64,\n target_version: IDL.Opt(Version),\n }),\n ),\n });\n const GetSnsInitializationParametersResponse = IDL.Record({\n sns_initialization_parameters: IDL.Text,\n });\n const GetTimersResponse = IDL.Record({ timers: IDL.Opt(Timers) });\n const GetUpgradeJournalRequest = IDL.Record({\n offset: IDL.Opt(IDL.Nat64),\n limit: IDL.Opt(IDL.Nat64),\n });\n const GetUpgradeJournalResponse = IDL.Record({\n upgrade_journal: IDL.Opt(UpgradeJournal),\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n deployed_version: IDL.Opt(Version),\n target_version: IDL.Opt(Version),\n upgrade_journal_entry_count: IDL.Opt(IDL.Nat64),\n });\n const ListNervousSystemFunctionsResponse = IDL.Record({\n reserved_ids: IDL.Vec(IDL.Nat64),\n functions: IDL.Vec(NervousSystemFunction),\n });\n const ListNeurons = IDL.Record({\n of_principal: IDL.Opt(IDL.Principal),\n limit: IDL.Nat32,\n start_page_at: IDL.Opt(NeuronId),\n });\n const ListNeuronsResponse = IDL.Record({ neurons: IDL.Vec(Neuron) });\n const TopicSelector = IDL.Record({ topic: IDL.Opt(Topic) });\n const ListProposals = IDL.Record({\n include_reward_status: IDL.Vec(IDL.Int32),\n before_proposal: IDL.Opt(ProposalId),\n limit: IDL.Nat32,\n exclude_type: IDL.Vec(IDL.Nat64),\n include_topics: IDL.Opt(IDL.Vec(TopicSelector)),\n include_status: IDL.Vec(IDL.Int32),\n });\n const ListProposalsResponse = IDL.Record({\n include_ballots_by_caller: IDL.Opt(IDL.Bool),\n proposals: IDL.Vec(ProposalData),\n include_topic_filtering: IDL.Opt(IDL.Bool),\n });\n const ListTopicsRequest = IDL.Record({});\n const ExtensionOperationType = IDL.Variant({\n TreasuryManagerWithdraw: IDL.Null,\n TreasuryManagerDeposit: IDL.Null,\n });\n const ExtensionType = IDL.Variant({ TreasuryManager: IDL.Null });\n const ExtensionOperationSpec = IDL.Record({\n topic: IDL.Opt(Topic),\n operation_type: IDL.Opt(ExtensionOperationType),\n description: IDL.Opt(IDL.Text),\n extension_type: IDL.Opt(ExtensionType),\n });\n const RegisteredExtensionOperationSpec = IDL.Record({\n spec: IDL.Opt(ExtensionOperationSpec),\n canister_id: IDL.Opt(IDL.Principal),\n });\n const TopicInfo = IDL.Record({\n extension_operations: IDL.Opt(IDL.Vec(RegisteredExtensionOperationSpec)),\n native_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n topic: IDL.Opt(Topic),\n is_critical: IDL.Opt(IDL.Bool),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n custom_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n });\n const ListTopicsResponse = IDL.Record({\n uncategorized_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n topics: IDL.Opt(IDL.Vec(TopicInfo)),\n });\n const StakeMaturity = IDL.Record({\n percentage_to_stake: IDL.Opt(IDL.Nat32),\n });\n const Command = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n ClaimOrRefresh: ClaimOrRefresh,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n MakeProposal: Proposal,\n StakeMaturity: StakeMaturity,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const ManageNeuron = IDL.Record({\n subaccount: IDL.Vec(IDL.Nat8),\n command: IDL.Opt(Command),\n });\n const SplitResponse = IDL.Record({ created_neuron_id: IDL.Opt(NeuronId) });\n const DisburseMaturityResponse = IDL.Record({\n amount_disbursed_e8s: IDL.Nat64,\n amount_deducted_e8s: IDL.Opt(IDL.Nat64),\n });\n const ClaimOrRefreshResponse = IDL.Record({\n refreshed_neuron_id: IDL.Opt(NeuronId),\n });\n const StakeMaturityResponse = IDL.Record({\n maturity_e8s: IDL.Nat64,\n staked_maturity_e8s: IDL.Nat64,\n });\n const MergeMaturityResponse = IDL.Record({\n merged_maturity_e8s: IDL.Nat64,\n new_stake_e8s: IDL.Nat64,\n });\n const DisburseResponse = IDL.Record({ transfer_block_height: IDL.Nat64 });\n const Command_1 = IDL.Variant({\n Error: GovernanceError,\n Split: SplitResponse,\n Follow: IDL.Record({}),\n DisburseMaturity: DisburseMaturityResponse,\n ClaimOrRefresh: ClaimOrRefreshResponse,\n Configure: IDL.Record({}),\n RegisterVote: IDL.Record({}),\n SetFollowing: IDL.Record({}),\n MakeProposal: GetProposal,\n RemoveNeuronPermission: IDL.Record({}),\n StakeMaturity: StakeMaturityResponse,\n MergeMaturity: MergeMaturityResponse,\n Disburse: DisburseResponse,\n AddNeuronPermission: IDL.Record({}),\n });\n const ManageNeuronResponse = IDL.Record({ command: IDL.Opt(Command_1) });\n const SetMode = IDL.Record({ mode: IDL.Int32 });\n\n return IDL.Service({\n claim_swap_neurons: IDL.Func(\n [ClaimSwapNeuronsRequest],\n [ClaimSwapNeuronsResponse],\n [],\n ),\n fail_stuck_upgrade_in_progress: IDL.Func(\n [IDL.Record({})],\n [IDL.Record({})],\n [],\n ),\n get_build_metadata: IDL.Func([], [IDL.Text], [\"query\"]),\n get_latest_reward_event: IDL.Func([], [RewardEvent], [\"query\"]),\n get_maturity_modulation: IDL.Func(\n [IDL.Record({})],\n [GetMaturityModulationResponse],\n [],\n ),\n get_metadata: IDL.Func([IDL.Record({})], [GetMetadataResponse], [\"query\"]),\n get_metrics: IDL.Func(\n [GetMetricsRequest],\n [GetMetricsResponse],\n [\"composite_query\"],\n ),\n get_metrics_replicated: IDL.Func(\n [GetMetricsRequest],\n [GetMetricsResponse],\n [],\n ),\n get_mode: IDL.Func([IDL.Record({})], [GetModeResponse], [\"query\"]),\n get_nervous_system_parameters: IDL.Func(\n [IDL.Null],\n [NervousSystemParameters],\n [\"query\"],\n ),\n get_neuron: IDL.Func([GetNeuron], [GetNeuronResponse], [\"query\"]),\n get_proposal: IDL.Func([GetProposal], [GetProposalResponse], [\"query\"]),\n get_root_canister_status: IDL.Func(\n [IDL.Null],\n [CanisterStatusResultV2],\n [],\n ),\n get_running_sns_version: IDL.Func(\n [IDL.Record({})],\n [GetRunningSnsVersionResponse],\n [\"query\"],\n ),\n get_sns_initialization_parameters: IDL.Func(\n [IDL.Record({})],\n [GetSnsInitializationParametersResponse],\n [\"query\"],\n ),\n get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], [\"query\"]),\n get_upgrade_journal: IDL.Func(\n [GetUpgradeJournalRequest],\n [GetUpgradeJournalResponse],\n [\"query\"],\n ),\n list_nervous_system_functions: IDL.Func(\n [],\n [ListNervousSystemFunctionsResponse],\n [\"query\"],\n ),\n list_neurons: IDL.Func([ListNeurons], [ListNeuronsResponse], [\"query\"]),\n list_proposals: IDL.Func(\n [ListProposals],\n [ListProposalsResponse],\n [\"query\"],\n ),\n list_topics: IDL.Func([ListTopicsRequest], [ListTopicsResponse], [\"query\"]),\n manage_neuron: IDL.Func([ManageNeuron], [ManageNeuronResponse], []),\n reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], []),\n set_mode: IDL.Func([SetMode], [IDL.Record({})], []),\n });\n};\n\nexport const init = ({ IDL }) => {\n const PreciseValue = IDL.Rec();\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Version = IDL.Record({\n archive_wasm_hash: IDL.Vec(IDL.Nat8),\n root_wasm_hash: IDL.Vec(IDL.Nat8),\n swap_wasm_hash: IDL.Vec(IDL.Nat8),\n ledger_wasm_hash: IDL.Vec(IDL.Nat8),\n governance_wasm_hash: IDL.Vec(IDL.Nat8),\n index_wasm_hash: IDL.Vec(IDL.Nat8),\n });\n const Versions = IDL.Record({ versions: IDL.Vec(Version) });\n const CachedUpgradeSteps = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requested_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Topic = IDL.Variant({\n DappCanisterManagement: IDL.Null,\n DaoCommunitySettings: IDL.Null,\n ApplicationBusinessLogic: IDL.Null,\n CriticalDappOperations: IDL.Null,\n TreasuryAssetManagement: IDL.Null,\n Governance: IDL.Null,\n SnsFrameworkManagement: IDL.Null,\n });\n const GenericNervousSystemFunction = IDL.Record({\n topic: IDL.Opt(Topic),\n validator_canister_id: IDL.Opt(IDL.Principal),\n target_canister_id: IDL.Opt(IDL.Principal),\n validator_method_name: IDL.Opt(IDL.Text),\n target_method_name: IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n NativeNervousSystemFunction: IDL.Record({}),\n GenericNervousSystemFunction: GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n id: IDL.Nat64,\n name: IDL.Text,\n description: IDL.Opt(IDL.Text),\n function_type: IDL.Opt(FunctionType),\n });\n const Subaccount = IDL.Record({ subaccount: IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n owner: IDL.Opt(IDL.Principal),\n subaccount: IDL.Opt(Subaccount),\n });\n const TreasuryMetrics = IDL.Record({\n name: IDL.Opt(IDL.Text),\n original_amount_e8s: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n account: IDL.Opt(Account),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n treasury: IDL.Int32,\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const VotingPowerMetrics = IDL.Record({\n governance_total_potential_voting_power: IDL.Opt(IDL.Nat64),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GovernanceCachedMetrics = IDL.Record({\n treasury_metrics: IDL.Vec(TreasuryMetrics),\n not_dissolving_neurons_e8s_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64),\n ),\n garbage_collectable_neurons_count: IDL.Nat64,\n neurons_with_invalid_stake_count: IDL.Nat64,\n not_dissolving_neurons_count_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64),\n ),\n neurons_with_less_than_6_months_dissolve_delay_count: IDL.Nat64,\n dissolved_neurons_count: IDL.Nat64,\n total_staked_e8s: IDL.Nat64,\n total_supply_governance_tokens: IDL.Nat64,\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n not_dissolving_neurons_count: IDL.Nat64,\n dissolved_neurons_e8s: IDL.Nat64,\n neurons_with_less_than_6_months_dissolve_delay_e8s: IDL.Nat64,\n dissolving_neurons_count_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Nat64)),\n dissolving_neurons_count: IDL.Nat64,\n dissolving_neurons_e8s_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Float64)),\n timestamp_seconds: IDL.Nat64,\n });\n const MaturityModulation = IDL.Record({\n current_basis_points: IDL.Opt(IDL.Int32),\n updated_at_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const TargetVersionSet = IDL.Record({\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n is_advanced_automatically: IDL.Opt(IDL.Bool),\n });\n const UpgradeStepsReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n upgrade_steps: IDL.Opt(Versions),\n });\n const UpgradeOutcome = IDL.Record({\n status: IDL.Opt(\n IDL.Variant({\n Success: IDL.Record({}),\n Timeout: IDL.Record({}),\n ExternalFailure: IDL.Record({}),\n InvalidState: IDL.Record({ version: IDL.Opt(Version) }),\n }),\n ),\n human_readable: IDL.Opt(IDL.Text),\n });\n const ProposalId = IDL.Record({ id: IDL.Nat64 });\n const UpgradeStarted = IDL.Record({\n current_version: IDL.Opt(Version),\n expected_version: IDL.Opt(Version),\n reason: IDL.Opt(\n IDL.Variant({\n UpgradeSnsToNextVersionProposal: ProposalId,\n BehindTargetVersion: IDL.Record({}),\n }),\n ),\n });\n const UpgradeStepsRefreshed = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n });\n const TargetVersionReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n });\n const UpgradeJournalEntry = IDL.Record({\n event: IDL.Opt(\n IDL.Variant({\n TargetVersionSet: TargetVersionSet,\n UpgradeStepsReset: UpgradeStepsReset,\n UpgradeOutcome: UpgradeOutcome,\n UpgradeStarted: UpgradeStarted,\n UpgradeStepsRefreshed: UpgradeStepsRefreshed,\n TargetVersionReset: TargetVersionReset,\n }),\n ),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const UpgradeJournal = IDL.Record({\n entries: IDL.Vec(UpgradeJournalEntry),\n });\n const NeuronId = IDL.Record({ id: IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ followees: IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n permissions: IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n final_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n reward_rate_transition_duration_seconds: IDL.Opt(IDL.Nat64),\n round_duration_seconds: IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n default_followees: IDL.Opt(DefaultFollowees),\n max_dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n max_dissolve_delay_bonus_percentage: IDL.Opt(IDL.Nat64),\n max_followees_per_function: IDL.Opt(IDL.Nat64),\n automatically_advance_target_version: IDL.Opt(IDL.Bool),\n neuron_claimer_permissions: IDL.Opt(NeuronPermissionList),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n max_neuron_age_for_age_bonus: IDL.Opt(IDL.Nat64),\n initial_voting_period_seconds: IDL.Opt(IDL.Nat64),\n neuron_minimum_dissolve_delay_to_vote_seconds: IDL.Opt(IDL.Nat64),\n reject_cost_e8s: IDL.Opt(IDL.Nat64),\n max_proposals_to_keep_per_action: IDL.Opt(IDL.Nat32),\n wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64),\n max_number_of_neurons: IDL.Opt(IDL.Nat64),\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64),\n max_age_bonus_percentage: IDL.Opt(IDL.Nat64),\n neuron_grantable_permissions: IDL.Opt(NeuronPermissionList),\n voting_rewards_parameters: IDL.Opt(VotingRewardsParameters),\n maturity_modulation_disabled: IDL.Opt(IDL.Bool),\n max_number_of_principals_per_neuron: IDL.Opt(IDL.Nat64),\n });\n const RewardEvent = IDL.Record({\n rounds_since_last_distribution: IDL.Opt(IDL.Nat64),\n actual_timestamp_seconds: IDL.Nat64,\n end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n total_available_e8s_equivalent: IDL.Opt(IDL.Nat64),\n distributed_e8s_equivalent: IDL.Nat64,\n round: IDL.Nat64,\n settled_proposals: IDL.Vec(ProposalId),\n });\n const PendingVersion = IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Opt(IDL.Nat64),\n target_version: IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n error_message: IDL.Text,\n error_type: IDL.Int32,\n });\n const Decimal = IDL.Record({ human_readable: IDL.Opt(IDL.Text) });\n const Tokens = IDL.Record({ e8s: IDL.Opt(IDL.Nat64) });\n const ValuationFactors = IDL.Record({\n xdrs_per_icp: IDL.Opt(Decimal),\n icps_per_token: IDL.Opt(Decimal),\n tokens: IDL.Opt(Tokens),\n });\n const Valuation = IDL.Record({\n token: IDL.Opt(IDL.Int32),\n account: IDL.Opt(Account),\n valuation_factors: IDL.Opt(ValuationFactors),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const MintSnsTokensActionAuxiliary = IDL.Record({\n valuation: IDL.Opt(Valuation),\n });\n const SnsVersion = IDL.Record({\n archive_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n root_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n swap_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n ledger_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n governance_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n index_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const AdvanceSnsTargetVersionActionAuxiliary = IDL.Record({\n target_version: IDL.Opt(SnsVersion),\n });\n const ActionAuxiliary = IDL.Variant({\n TransferSnsTreasuryFunds: MintSnsTokensActionAuxiliary,\n MintSnsTokens: MintSnsTokensActionAuxiliary,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersionActionAuxiliary,\n });\n const Ballot = IDL.Record({\n vote: IDL.Int32,\n cast_timestamp_seconds: IDL.Nat64,\n voting_power: IDL.Nat64,\n });\n const Percentage = IDL.Record({ basis_points: IDL.Opt(IDL.Nat64) });\n const Tally = IDL.Record({\n no: IDL.Nat64,\n yes: IDL.Nat64,\n total: IDL.Nat64,\n timestamp_seconds: IDL.Nat64,\n });\n const ManageDappCanisterSettings = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat64),\n wasm_memory_threshold: IDL.Opt(IDL.Nat64),\n canister_ids: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat64),\n log_visibility: IDL.Opt(IDL.Int32),\n wasm_memory_limit: IDL.Opt(IDL.Nat64),\n memory_allocation: IDL.Opt(IDL.Nat64),\n compute_allocation: IDL.Opt(IDL.Nat64),\n });\n PreciseValue.fill(\n IDL.Variant({\n Int: IDL.Int64,\n Map: IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),\n Nat: IDL.Nat64,\n Blob: IDL.Vec(IDL.Nat8),\n Bool: IDL.Bool,\n Text: IDL.Text,\n Array: IDL.Vec(PreciseValue),\n }),\n );\n const ExtensionOperationArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const ExecuteExtensionOperation = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n operation_name: IDL.Opt(IDL.Text),\n operation_arg: IDL.Opt(ExtensionOperationArg),\n });\n const ChunkedCanisterWasm = IDL.Record({\n wasm_module_hash: IDL.Vec(IDL.Nat8),\n chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),\n store_canister_id: IDL.Opt(IDL.Principal),\n });\n const Wasm = IDL.Variant({\n Chunked: ChunkedCanisterWasm,\n Bytes: IDL.Vec(IDL.Nat8),\n });\n const ExtensionUpgradeArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const UpgradeExtension = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n wasm: IDL.Opt(Wasm),\n canister_upgrade_arg: IDL.Opt(ExtensionUpgradeArg),\n });\n const SetTopicsForCustomProposals = IDL.Record({\n custom_function_id_to_topic: IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),\n });\n const ExtensionInit = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const RegisterExtension = IDL.Record({\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n extension_init: IDL.Opt(ExtensionInit),\n });\n const RegisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n });\n const TransferSnsTreasuryFunds = IDL.Record({\n from_treasury: IDL.Int32,\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n new_canister_wasm: IDL.Vec(IDL.Nat8),\n mode: IDL.Opt(IDL.Int32),\n canister_id: IDL.Opt(IDL.Principal),\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n canister_upgrade_arg: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const DeregisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n new_controllers: IDL.Vec(IDL.Principal),\n });\n const MintSnsTokens = IDL.Record({\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const AdvanceSnsTargetVersion = IDL.Record({\n new_target: IDL.Opt(SnsVersion),\n });\n const ManageSnsMetadata = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n function_id: IDL.Nat64,\n payload: IDL.Vec(IDL.Nat8),\n });\n const ManageLedgerParameters = IDL.Record({\n token_symbol: IDL.Opt(IDL.Text),\n transfer_fee: IDL.Opt(IDL.Nat64),\n token_logo: IDL.Opt(IDL.Text),\n token_name: IDL.Opt(IDL.Text),\n });\n const Motion = IDL.Record({ motion_text: IDL.Text });\n const Action = IDL.Variant({\n ManageNervousSystemParameters: NervousSystemParameters,\n AddGenericNervousSystemFunction: NervousSystemFunction,\n ManageDappCanisterSettings: ManageDappCanisterSettings,\n ExecuteExtensionOperation: ExecuteExtensionOperation,\n UpgradeExtension: UpgradeExtension,\n RemoveGenericNervousSystemFunction: IDL.Nat64,\n SetTopicsForCustomProposals: SetTopicsForCustomProposals,\n RegisterExtension: RegisterExtension,\n UpgradeSnsToNextVersion: IDL.Record({}),\n RegisterDappCanisters: RegisterDappCanisters,\n TransferSnsTreasuryFunds: TransferSnsTreasuryFunds,\n UpgradeSnsControlledCanister: UpgradeSnsControlledCanister,\n DeregisterDappCanisters: DeregisterDappCanisters,\n MintSnsTokens: MintSnsTokens,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersion,\n Unspecified: IDL.Record({}),\n ManageSnsMetadata: ManageSnsMetadata,\n ExecuteGenericNervousSystemFunction: ExecuteGenericNervousSystemFunction,\n ManageLedgerParameters: ManageLedgerParameters,\n Motion: Motion,\n });\n const Proposal = IDL.Record({\n url: IDL.Text,\n title: IDL.Text,\n action: IDL.Opt(Action),\n summary: IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n current_deadline_timestamp_seconds: IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n id: IDL.Opt(ProposalId),\n payload_text_rendering: IDL.Opt(IDL.Text),\n topic: IDL.Opt(Topic),\n action: IDL.Nat64,\n failure_reason: IDL.Opt(GovernanceError),\n action_auxiliary: IDL.Opt(ActionAuxiliary),\n ballots: IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n minimum_yes_proportion_of_total: IDL.Opt(Percentage),\n reward_event_round: IDL.Nat64,\n failed_timestamp_seconds: IDL.Nat64,\n reward_event_end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n proposal_creation_timestamp_seconds: IDL.Nat64,\n initial_voting_period_seconds: IDL.Nat64,\n reject_cost_e8s: IDL.Nat64,\n latest_tally: IDL.Opt(Tally),\n wait_for_quiet_deadline_increase_seconds: IDL.Nat64,\n decided_timestamp_seconds: IDL.Nat64,\n proposal: IDL.Opt(Proposal),\n proposer: IDL.Opt(NeuronId),\n wait_for_quiet_state: IDL.Opt(WaitForQuietState),\n minimum_yes_proportion_of_exercised: IDL.Opt(Percentage),\n is_eligible_for_rewards: IDL.Bool,\n executed_timestamp_seconds: IDL.Nat64,\n });\n const Split = IDL.Record({ memo: IDL.Nat64, amount_e8s: IDL.Nat64 });\n const Follow = IDL.Record({\n function_id: IDL.Nat64,\n followees: IDL.Vec(NeuronId),\n });\n const DisburseMaturity = IDL.Record({\n to_account: IDL.Opt(Account),\n percentage_to_disburse: IDL.Nat32,\n });\n const ChangeAutoStakeMaturity = IDL.Record({\n requested_setting_for_auto_stake_maturity: IDL.Bool,\n });\n const IncreaseDissolveDelay = IDL.Record({\n additional_dissolve_delay_seconds: IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n dissolve_timestamp_seconds: IDL.Nat64,\n });\n const Operation = IDL.Variant({\n ChangeAutoStakeMaturity: ChangeAutoStakeMaturity,\n StopDissolving: IDL.Record({}),\n StartDissolving: IDL.Record({}),\n IncreaseDissolveDelay: IncreaseDissolveDelay,\n SetDissolveTimestamp: SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ operation: IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n vote: IDL.Int32,\n proposal: IDL.Opt(ProposalId),\n });\n const Followee = IDL.Record({\n alias: IDL.Opt(IDL.Text),\n neuron_id: IDL.Opt(NeuronId),\n });\n const FolloweesForTopic = IDL.Record({\n topic: IDL.Opt(Topic),\n followees: IDL.Vec(Followee),\n });\n const SetFollowing = IDL.Record({\n topic_following: IDL.Vec(FolloweesForTopic),\n });\n const FinalizeDisburseMaturity = IDL.Record({\n amount_to_be_disbursed_e8s: IDL.Nat64,\n to_account: IDL.Opt(Account),\n });\n const MemoAndController = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n memo: IDL.Nat64,\n });\n const By = IDL.Variant({\n MemoAndController: MemoAndController,\n NeuronId: IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ by: IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n permissions_to_remove: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n permissions_to_add: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ percentage_to_merge: IDL.Nat32 });\n const Amount = IDL.Record({ e8s: IDL.Nat64 });\n const Disburse = IDL.Record({\n to_account: IDL.Opt(Account),\n amount: IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n SyncCommand: IDL.Record({}),\n MakeProposal: Proposal,\n FinalizeDisburseMaturity: FinalizeDisburseMaturity,\n ClaimOrRefreshNeuron: ClaimOrRefresh,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n command: IDL.Opt(Command_2),\n timestamp: IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n principal: IDL.Opt(IDL.Principal),\n permission_type: IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n DissolveDelaySeconds: IDL.Nat64,\n WhenDissolvedTimestampSeconds: IDL.Nat64,\n });\n const DisburseMaturityInProgress = IDL.Record({\n timestamp_of_disbursement_seconds: IDL.Nat64,\n amount_e8s: IDL.Nat64,\n account_to_disburse_to: IDL.Opt(Account),\n finalize_disbursement_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Neuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n staked_maturity_e8s_equivalent: IDL.Opt(IDL.Nat64),\n permissions: IDL.Vec(NeuronPermission),\n maturity_e8s_equivalent: IDL.Nat64,\n cached_neuron_stake_e8s: IDL.Nat64,\n created_timestamp_seconds: IDL.Nat64,\n topic_followees: IDL.Opt(\n IDL.Record({\n topic_id_to_followees: IDL.Vec(IDL.Tuple(IDL.Int32, FolloweesForTopic)),\n }),\n ),\n source_nns_neuron_id: IDL.Opt(IDL.Nat64),\n auto_stake_maturity: IDL.Opt(IDL.Bool),\n aging_since_timestamp_seconds: IDL.Nat64,\n dissolve_state: IDL.Opt(DissolveState),\n voting_power_percentage_multiplier: IDL.Nat64,\n vesting_period_seconds: IDL.Opt(IDL.Nat64),\n disburse_maturity_in_progress: IDL.Vec(DisburseMaturityInProgress),\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n neuron_fees_e8s: IDL.Nat64,\n });\n const Governance = IDL.Record({\n root_canister_id: IDL.Opt(IDL.Principal),\n timers: IDL.Opt(Timers),\n cached_upgrade_steps: IDL.Opt(CachedUpgradeSteps),\n id_to_nervous_system_functions: IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction),\n ),\n metrics: IDL.Opt(GovernanceCachedMetrics),\n maturity_modulation: IDL.Opt(MaturityModulation),\n upgrade_journal: IDL.Opt(UpgradeJournal),\n mode: IDL.Int32,\n parameters: IDL.Opt(NervousSystemParameters),\n is_finalizing_disburse_maturity: IDL.Opt(IDL.Bool),\n deployed_version: IDL.Opt(Version),\n sns_initialization_parameters: IDL.Text,\n latest_reward_event: IDL.Opt(RewardEvent),\n pending_version: IDL.Opt(PendingVersion),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n proposals: IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n in_flight_commands: IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n sns_metadata: IDL.Opt(ManageSnsMetadata),\n neurons: IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n target_version: IDL.Opt(Version),\n genesis_timestamp_seconds: IDL.Nat64,\n });\n\n return [Governance];\n};\n", "import {\n Canister,\n createServices,\n fromNullable,\n isNullish,\n toNullable,\n} from \"@dfinity/utils\";\nimport type {\n NeuronId,\n _SERVICE as SnsGovernanceTestService,\n} from \"./candid/sns_governance_test\";\nimport { idlFactory as certifiedIdlFactory } from \"./candid/sns_governance_test.certified.idl\";\nimport { idlFactory } from \"./candid/sns_governance_test.idl\";\nimport { SnsGovernanceError } from \"./errors/governance.errors\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\nimport type { SnsAddMaturityParams } from \"./types/governance_test.params\";\n\nexport class SnsGovernanceTestCanister extends Canister<SnsGovernanceTestService> {\n /**\n * Instantiate a canister to interact with the governance of a Sns project.\n *\n * @param {SnsCanisterOptions} options Miscellaneous options to initialize the canister. Its ID being the only mandatory parammeter.\n */\n static create(options: SnsCanisterOptions<SnsGovernanceTestService>) {\n const { service, certifiedService, canisterId } =\n createServices<SnsGovernanceTestService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new SnsGovernanceTestCanister(canisterId, service, certifiedService);\n }\n\n /**\n * Add maturity to a neuron (only for testing purposes. Testnet only.)\n */\n addMaturity = async (params: SnsAddMaturityParams): Promise<void> => {\n const { id, amountE8s } = params;\n\n const { new_maturity_e8s } = await this.caller(params).add_maturity({\n id: toNullable<NeuronId>(id),\n amount_e8s: toNullable(amountE8s),\n });\n const newMaturity = fromNullable(new_maturity_e8s);\n\n if (isNullish(newMaturity) || newMaturity < amountE8s) {\n throw new SnsGovernanceError(\"No maturity added\");\n }\n };\n}\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.0-patch-typed-arrays.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({ IDL }) => {\n const PreciseValue = IDL.Rec();\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Version = IDL.Record({\n archive_wasm_hash: IDL.Vec(IDL.Nat8),\n root_wasm_hash: IDL.Vec(IDL.Nat8),\n swap_wasm_hash: IDL.Vec(IDL.Nat8),\n ledger_wasm_hash: IDL.Vec(IDL.Nat8),\n governance_wasm_hash: IDL.Vec(IDL.Nat8),\n index_wasm_hash: IDL.Vec(IDL.Nat8),\n });\n const Versions = IDL.Record({ versions: IDL.Vec(Version) });\n const CachedUpgradeSteps = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requested_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Topic = IDL.Variant({\n DappCanisterManagement: IDL.Null,\n DaoCommunitySettings: IDL.Null,\n ApplicationBusinessLogic: IDL.Null,\n CriticalDappOperations: IDL.Null,\n TreasuryAssetManagement: IDL.Null,\n Governance: IDL.Null,\n SnsFrameworkManagement: IDL.Null,\n });\n const GenericNervousSystemFunction = IDL.Record({\n topic: IDL.Opt(Topic),\n validator_canister_id: IDL.Opt(IDL.Principal),\n target_canister_id: IDL.Opt(IDL.Principal),\n validator_method_name: IDL.Opt(IDL.Text),\n target_method_name: IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n NativeNervousSystemFunction: IDL.Record({}),\n GenericNervousSystemFunction: GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n id: IDL.Nat64,\n name: IDL.Text,\n description: IDL.Opt(IDL.Text),\n function_type: IDL.Opt(FunctionType),\n });\n const Subaccount = IDL.Record({ subaccount: IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n owner: IDL.Opt(IDL.Principal),\n subaccount: IDL.Opt(Subaccount),\n });\n const TreasuryMetrics = IDL.Record({\n name: IDL.Opt(IDL.Text),\n original_amount_e8s: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n account: IDL.Opt(Account),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n treasury: IDL.Int32,\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const VotingPowerMetrics = IDL.Record({\n governance_total_potential_voting_power: IDL.Opt(IDL.Nat64),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GovernanceCachedMetrics = IDL.Record({\n treasury_metrics: IDL.Vec(TreasuryMetrics),\n not_dissolving_neurons_e8s_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64),\n ),\n garbage_collectable_neurons_count: IDL.Nat64,\n neurons_with_invalid_stake_count: IDL.Nat64,\n not_dissolving_neurons_count_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64),\n ),\n neurons_with_less_than_6_months_dissolve_delay_count: IDL.Nat64,\n dissolved_neurons_count: IDL.Nat64,\n total_staked_e8s: IDL.Nat64,\n total_supply_governance_tokens: IDL.Nat64,\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n not_dissolving_neurons_count: IDL.Nat64,\n dissolved_neurons_e8s: IDL.Nat64,\n neurons_with_less_than_6_months_dissolve_delay_e8s: IDL.Nat64,\n dissolving_neurons_count_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Nat64)),\n dissolving_neurons_count: IDL.Nat64,\n dissolving_neurons_e8s_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Float64)),\n timestamp_seconds: IDL.Nat64,\n });\n const MaturityModulation = IDL.Record({\n current_basis_points: IDL.Opt(IDL.Int32),\n updated_at_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const TargetVersionSet = IDL.Record({\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n is_advanced_automatically: IDL.Opt(IDL.Bool),\n });\n const UpgradeStepsReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n upgrade_steps: IDL.Opt(Versions),\n });\n const UpgradeOutcome = IDL.Record({\n status: IDL.Opt(\n IDL.Variant({\n Success: IDL.Record({}),\n Timeout: IDL.Record({}),\n ExternalFailure: IDL.Record({}),\n InvalidState: IDL.Record({ version: IDL.Opt(Version) }),\n }),\n ),\n human_readable: IDL.Opt(IDL.Text),\n });\n const ProposalId = IDL.Record({ id: IDL.Nat64 });\n const UpgradeStarted = IDL.Record({\n current_version: IDL.Opt(Version),\n expected_version: IDL.Opt(Version),\n reason: IDL.Opt(\n IDL.Variant({\n UpgradeSnsToNextVersionProposal: ProposalId,\n BehindTargetVersion: IDL.Record({}),\n }),\n ),\n });\n const UpgradeStepsRefreshed = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n });\n const TargetVersionReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n });\n const UpgradeJournalEntry = IDL.Record({\n event: IDL.Opt(\n IDL.Variant({\n TargetVersionSet: TargetVersionSet,\n UpgradeStepsReset: UpgradeStepsReset,\n UpgradeOutcome: UpgradeOutcome,\n UpgradeStarted: UpgradeStarted,\n UpgradeStepsRefreshed: UpgradeStepsRefreshed,\n TargetVersionReset: TargetVersionReset,\n }),\n ),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const UpgradeJournal = IDL.Record({\n entries: IDL.Vec(UpgradeJournalEntry),\n });\n const NeuronId = IDL.Record({ id: IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ followees: IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n permissions: IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n final_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n reward_rate_transition_duration_seconds: IDL.Opt(IDL.Nat64),\n round_duration_seconds: IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n default_followees: IDL.Opt(DefaultFollowees),\n max_dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n max_dissolve_delay_bonus_percentage: IDL.Opt(IDL.Nat64),\n max_followees_per_function: IDL.Opt(IDL.Nat64),\n automatically_advance_target_version: IDL.Opt(IDL.Bool),\n neuron_claimer_permissions: IDL.Opt(NeuronPermissionList),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n max_neuron_age_for_age_bonus: IDL.Opt(IDL.Nat64),\n initial_voting_period_seconds: IDL.Opt(IDL.Nat64),\n neuron_minimum_dissolve_delay_to_vote_seconds: IDL.Opt(IDL.Nat64),\n reject_cost_e8s: IDL.Opt(IDL.Nat64),\n max_proposals_to_keep_per_action: IDL.Opt(IDL.Nat32),\n wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64),\n max_number_of_neurons: IDL.Opt(IDL.Nat64),\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64),\n max_age_bonus_percentage: IDL.Opt(IDL.Nat64),\n neuron_grantable_permissions: IDL.Opt(NeuronPermissionList),\n voting_rewards_parameters: IDL.Opt(VotingRewardsParameters),\n maturity_modulation_disabled: IDL.Opt(IDL.Bool),\n max_number_of_principals_per_neuron: IDL.Opt(IDL.Nat64),\n });\n const RewardEvent = IDL.Record({\n rounds_since_last_distribution: IDL.Opt(IDL.Nat64),\n actual_timestamp_seconds: IDL.Nat64,\n end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n total_available_e8s_equivalent: IDL.Opt(IDL.Nat64),\n distributed_e8s_equivalent: IDL.Nat64,\n round: IDL.Nat64,\n settled_proposals: IDL.Vec(ProposalId),\n });\n const PendingVersion = IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Opt(IDL.Nat64),\n target_version: IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n error_message: IDL.Text,\n error_type: IDL.Int32,\n });\n const Decimal = IDL.Record({ human_readable: IDL.Opt(IDL.Text) });\n const Tokens = IDL.Record({ e8s: IDL.Opt(IDL.Nat64) });\n const ValuationFactors = IDL.Record({\n xdrs_per_icp: IDL.Opt(Decimal),\n icps_per_token: IDL.Opt(Decimal),\n tokens: IDL.Opt(Tokens),\n });\n const Valuation = IDL.Record({\n token: IDL.Opt(IDL.Int32),\n account: IDL.Opt(Account),\n valuation_factors: IDL.Opt(ValuationFactors),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const MintSnsTokensActionAuxiliary = IDL.Record({\n valuation: IDL.Opt(Valuation),\n });\n const SnsVersion = IDL.Record({\n archive_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n root_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n swap_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n ledger_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n governance_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n index_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const AdvanceSnsTargetVersionActionAuxiliary = IDL.Record({\n target_version: IDL.Opt(SnsVersion),\n });\n const ActionAuxiliary = IDL.Variant({\n TransferSnsTreasuryFunds: MintSnsTokensActionAuxiliary,\n MintSnsTokens: MintSnsTokensActionAuxiliary,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersionActionAuxiliary,\n });\n const Ballot = IDL.Record({\n vote: IDL.Int32,\n cast_timestamp_seconds: IDL.Nat64,\n voting_power: IDL.Nat64,\n });\n const Percentage = IDL.Record({ basis_points: IDL.Opt(IDL.Nat64) });\n const Tally = IDL.Record({\n no: IDL.Nat64,\n yes: IDL.Nat64,\n total: IDL.Nat64,\n timestamp_seconds: IDL.Nat64,\n });\n const ManageDappCanisterSettings = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat64),\n wasm_memory_threshold: IDL.Opt(IDL.Nat64),\n canister_ids: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat64),\n log_visibility: IDL.Opt(IDL.Int32),\n wasm_memory_limit: IDL.Opt(IDL.Nat64),\n memory_allocation: IDL.Opt(IDL.Nat64),\n compute_allocation: IDL.Opt(IDL.Nat64),\n });\n PreciseValue.fill(\n IDL.Variant({\n Int: IDL.Int64,\n Map: IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),\n Nat: IDL.Nat64,\n Blob: IDL.Vec(IDL.Nat8),\n Bool: IDL.Bool,\n Text: IDL.Text,\n Array: IDL.Vec(PreciseValue),\n }),\n );\n const ExtensionOperationArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const ExecuteExtensionOperation = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n operation_name: IDL.Opt(IDL.Text),\n operation_arg: IDL.Opt(ExtensionOperationArg),\n });\n const ChunkedCanisterWasm = IDL.Record({\n wasm_module_hash: IDL.Vec(IDL.Nat8),\n chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),\n store_canister_id: IDL.Opt(IDL.Principal),\n });\n const Wasm = IDL.Variant({\n Chunked: ChunkedCanisterWasm,\n Bytes: IDL.Vec(IDL.Nat8),\n });\n const ExtensionUpgradeArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const UpgradeExtension = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n wasm: IDL.Opt(Wasm),\n canister_upgrade_arg: IDL.Opt(ExtensionUpgradeArg),\n });\n const SetTopicsForCustomProposals = IDL.Record({\n custom_function_id_to_topic: IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),\n });\n const ExtensionInit = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const RegisterExtension = IDL.Record({\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n extension_init: IDL.Opt(ExtensionInit),\n });\n const RegisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n });\n const TransferSnsTreasuryFunds = IDL.Record({\n from_treasury: IDL.Int32,\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n new_canister_wasm: IDL.Vec(IDL.Nat8),\n mode: IDL.Opt(IDL.Int32),\n canister_id: IDL.Opt(IDL.Principal),\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n canister_upgrade_arg: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const DeregisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n new_controllers: IDL.Vec(IDL.Principal),\n });\n const MintSnsTokens = IDL.Record({\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const AdvanceSnsTargetVersion = IDL.Record({\n new_target: IDL.Opt(SnsVersion),\n });\n const ManageSnsMetadata = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n function_id: IDL.Nat64,\n payload: IDL.Vec(IDL.Nat8),\n });\n const ManageLedgerParameters = IDL.Record({\n token_symbol: IDL.Opt(IDL.Text),\n transfer_fee: IDL.Opt(IDL.Nat64),\n token_logo: IDL.Opt(IDL.Text),\n token_name: IDL.Opt(IDL.Text),\n });\n const Motion = IDL.Record({ motion_text: IDL.Text });\n const Action = IDL.Variant({\n ManageNervousSystemParameters: NervousSystemParameters,\n AddGenericNervousSystemFunction: NervousSystemFunction,\n ManageDappCanisterSettings: ManageDappCanisterSettings,\n ExecuteExtensionOperation: ExecuteExtensionOperation,\n UpgradeExtension: UpgradeExtension,\n RemoveGenericNervousSystemFunction: IDL.Nat64,\n SetTopicsForCustomProposals: SetTopicsForCustomProposals,\n RegisterExtension: RegisterExtension,\n UpgradeSnsToNextVersion: IDL.Record({}),\n RegisterDappCanisters: RegisterDappCanisters,\n TransferSnsTreasuryFunds: TransferSnsTreasuryFunds,\n UpgradeSnsControlledCanister: UpgradeSnsControlledCanister,\n DeregisterDappCanisters: DeregisterDappCanisters,\n MintSnsTokens: MintSnsTokens,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersion,\n Unspecified: IDL.Record({}),\n ManageSnsMetadata: ManageSnsMetadata,\n ExecuteGenericNervousSystemFunction: ExecuteGenericNervousSystemFunction,\n ManageLedgerParameters: ManageLedgerParameters,\n Motion: Motion,\n });\n const Proposal = IDL.Record({\n url: IDL.Text,\n title: IDL.Text,\n action: IDL.Opt(Action),\n summary: IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n current_deadline_timestamp_seconds: IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n id: IDL.Opt(ProposalId),\n payload_text_rendering: IDL.Opt(IDL.Text),\n topic: IDL.Opt(Topic),\n action: IDL.Nat64,\n failure_reason: IDL.Opt(GovernanceError),\n action_auxiliary: IDL.Opt(ActionAuxiliary),\n ballots: IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n minimum_yes_proportion_of_total: IDL.Opt(Percentage),\n reward_event_round: IDL.Nat64,\n failed_timestamp_seconds: IDL.Nat64,\n reward_event_end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n proposal_creation_timestamp_seconds: IDL.Nat64,\n initial_voting_period_seconds: IDL.Nat64,\n reject_cost_e8s: IDL.Nat64,\n latest_tally: IDL.Opt(Tally),\n wait_for_quiet_deadline_increase_seconds: IDL.Nat64,\n decided_timestamp_seconds: IDL.Nat64,\n proposal: IDL.Opt(Proposal),\n proposer: IDL.Opt(NeuronId),\n wait_for_quiet_state: IDL.Opt(WaitForQuietState),\n minimum_yes_proportion_of_exercised: IDL.Opt(Percentage),\n is_eligible_for_rewards: IDL.Bool,\n executed_timestamp_seconds: IDL.Nat64,\n });\n const Split = IDL.Record({ memo: IDL.Nat64, amount_e8s: IDL.Nat64 });\n const Follow = IDL.Record({\n function_id: IDL.Nat64,\n followees: IDL.Vec(NeuronId),\n });\n const DisburseMaturity = IDL.Record({\n to_account: IDL.Opt(Account),\n percentage_to_disburse: IDL.Nat32,\n });\n const ChangeAutoStakeMaturity = IDL.Record({\n requested_setting_for_auto_stake_maturity: IDL.Bool,\n });\n const IncreaseDissolveDelay = IDL.Record({\n additional_dissolve_delay_seconds: IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n dissolve_timestamp_seconds: IDL.Nat64,\n });\n const Operation = IDL.Variant({\n ChangeAutoStakeMaturity: ChangeAutoStakeMaturity,\n StopDissolving: IDL.Record({}),\n StartDissolving: IDL.Record({}),\n IncreaseDissolveDelay: IncreaseDissolveDelay,\n SetDissolveTimestamp: SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ operation: IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n vote: IDL.Int32,\n proposal: IDL.Opt(ProposalId),\n });\n const Followee = IDL.Record({\n alias: IDL.Opt(IDL.Text),\n neuron_id: IDL.Opt(NeuronId),\n });\n const FolloweesForTopic = IDL.Record({\n topic: IDL.Opt(Topic),\n followees: IDL.Vec(Followee),\n });\n const SetFollowing = IDL.Record({\n topic_following: IDL.Vec(FolloweesForTopic),\n });\n const FinalizeDisburseMaturity = IDL.Record({\n amount_to_be_disbursed_e8s: IDL.Nat64,\n to_account: IDL.Opt(Account),\n });\n const MemoAndController = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n memo: IDL.Nat64,\n });\n const By = IDL.Variant({\n MemoAndController: MemoAndController,\n NeuronId: IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ by: IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n permissions_to_remove: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n permissions_to_add: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ percentage_to_merge: IDL.Nat32 });\n const Amount = IDL.Record({ e8s: IDL.Nat64 });\n const Disburse = IDL.Record({\n to_account: IDL.Opt(Account),\n amount: IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n SyncCommand: IDL.Record({}),\n MakeProposal: Proposal,\n FinalizeDisburseMaturity: FinalizeDisburseMaturity,\n ClaimOrRefreshNeuron: ClaimOrRefresh,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n command: IDL.Opt(Command_2),\n timestamp: IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n principal: IDL.Opt(IDL.Principal),\n permission_type: IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n DissolveDelaySeconds: IDL.Nat64,\n WhenDissolvedTimestampSeconds: IDL.Nat64,\n });\n const DisburseMaturityInProgress = IDL.Record({\n timestamp_of_disbursement_seconds: IDL.Nat64,\n amount_e8s: IDL.Nat64,\n account_to_disburse_to: IDL.Opt(Account),\n finalize_disbursement_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Neuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n staked_maturity_e8s_equivalent: IDL.Opt(IDL.Nat64),\n permissions: IDL.Vec(NeuronPermission),\n maturity_e8s_equivalent: IDL.Nat64,\n cached_neuron_stake_e8s: IDL.Nat64,\n created_timestamp_seconds: IDL.Nat64,\n topic_followees: IDL.Opt(\n IDL.Record({\n topic_id_to_followees: IDL.Vec(IDL.Tuple(IDL.Int32, FolloweesForTopic)),\n }),\n ),\n source_nns_neuron_id: IDL.Opt(IDL.Nat64),\n auto_stake_maturity: IDL.Opt(IDL.Bool),\n aging_since_timestamp_seconds: IDL.Nat64,\n dissolve_state: IDL.Opt(DissolveState),\n voting_power_percentage_multiplier: IDL.Nat64,\n vesting_period_seconds: IDL.Opt(IDL.Nat64),\n disburse_maturity_in_progress: IDL.Vec(DisburseMaturityInProgress),\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n neuron_fees_e8s: IDL.Nat64,\n });\n const Governance = IDL.Record({\n root_canister_id: IDL.Opt(IDL.Principal),\n timers: IDL.Opt(Timers),\n cached_upgrade_steps: IDL.Opt(CachedUpgradeSteps),\n id_to_nervous_system_functions: IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction),\n ),\n metrics: IDL.Opt(GovernanceCachedMetrics),\n maturity_modulation: IDL.Opt(MaturityModulation),\n upgrade_journal: IDL.Opt(UpgradeJournal),\n mode: IDL.Int32,\n parameters: IDL.Opt(NervousSystemParameters),\n is_finalizing_disburse_maturity: IDL.Opt(IDL.Bool),\n deployed_version: IDL.Opt(Version),\n sns_initialization_parameters: IDL.Text,\n latest_reward_event: IDL.Opt(RewardEvent),\n pending_version: IDL.Opt(PendingVersion),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n proposals: IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n in_flight_commands: IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n sns_metadata: IDL.Opt(ManageSnsMetadata),\n neurons: IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n target_version: IDL.Opt(Version),\n genesis_timestamp_seconds: IDL.Nat64,\n });\n const AddMaturityRequest = IDL.Record({\n id: IDL.Opt(NeuronId),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const AddMaturityResponse = IDL.Record({\n new_maturity_e8s: IDL.Opt(IDL.Nat64),\n });\n const AdvanceTargetVersionRequest = IDL.Record({\n target_version: IDL.Opt(Version),\n });\n const AdvanceTargetVersionResponse = IDL.Record({});\n const Principals = IDL.Record({ principals: IDL.Vec(IDL.Principal) });\n const NeuronsFund = IDL.Record({\n nns_neuron_hotkeys: IDL.Opt(Principals),\n nns_neuron_controller: IDL.Opt(IDL.Principal),\n nns_neuron_id: IDL.Opt(IDL.Nat64),\n });\n const Participant = IDL.Variant({\n NeuronsFund: NeuronsFund,\n Direct: IDL.Record({}),\n });\n const NeuronIds = IDL.Record({ neuron_ids: IDL.Vec(NeuronId) });\n const NeuronRecipe = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n participant: IDL.Opt(Participant),\n stake_e8s: IDL.Opt(IDL.Nat64),\n followees: IDL.Opt(NeuronIds),\n neuron_id: IDL.Opt(NeuronId),\n });\n const NeuronRecipes = IDL.Record({\n neuron_recipes: IDL.Vec(NeuronRecipe),\n });\n const ClaimSwapNeuronsRequest = IDL.Record({\n neuron_recipes: IDL.Opt(NeuronRecipes),\n });\n const SwapNeuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n status: IDL.Int32,\n });\n const ClaimedSwapNeurons = IDL.Record({\n swap_neurons: IDL.Vec(SwapNeuron),\n });\n const ClaimSwapNeuronsResult = IDL.Variant({\n Ok: ClaimedSwapNeurons,\n Err: IDL.Int32,\n });\n const ClaimSwapNeuronsResponse = IDL.Record({\n claim_swap_neurons_result: IDL.Opt(ClaimSwapNeuronsResult),\n });\n const GetMaturityModulationResponse = IDL.Record({\n maturity_modulation: IDL.Opt(MaturityModulation),\n });\n const GetMetadataResponse = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const GetMetricsRequest = IDL.Record({\n time_window_seconds: IDL.Opt(IDL.Nat64),\n });\n const Metrics = IDL.Record({\n treasury_metrics: IDL.Opt(IDL.Vec(TreasuryMetrics)),\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n last_ledger_block_timestamp: IDL.Opt(IDL.Nat64),\n num_recently_executed_proposals: IDL.Opt(IDL.Nat64),\n num_recently_submitted_proposals: IDL.Opt(IDL.Nat64),\n genesis_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GetMetricsResult = IDL.Variant({\n Ok: Metrics,\n Err: GovernanceError,\n });\n const GetMetricsResponse = IDL.Record({\n get_metrics_result: IDL.Opt(GetMetricsResult),\n });\n const GetModeResponse = IDL.Record({ mode: IDL.Opt(IDL.Int32) });\n const GetNeuron = IDL.Record({ neuron_id: IDL.Opt(NeuronId) });\n const Result = IDL.Variant({ Error: GovernanceError, Neuron: Neuron });\n const GetNeuronResponse = IDL.Record({ result: IDL.Opt(Result) });\n const GetProposal = IDL.Record({ proposal_id: IDL.Opt(ProposalId) });\n const Result_1 = IDL.Variant({\n Error: GovernanceError,\n Proposal: ProposalData,\n });\n const GetProposalResponse = IDL.Record({ result: IDL.Opt(Result_1) });\n const MemoryMetrics = IDL.Record({\n wasm_binary_size: IDL.Opt(IDL.Nat),\n wasm_chunk_store_size: IDL.Opt(IDL.Nat),\n canister_history_size: IDL.Opt(IDL.Nat),\n stable_memory_size: IDL.Opt(IDL.Nat),\n snapshots_size: IDL.Opt(IDL.Nat),\n wasm_memory_size: IDL.Opt(IDL.Nat),\n global_memory_size: IDL.Opt(IDL.Nat),\n custom_sections_size: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusType = IDL.Variant({\n stopped: IDL.Null,\n stopping: IDL.Null,\n running: IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n freezing_threshold: IDL.Nat,\n wasm_memory_threshold: IDL.Opt(IDL.Nat),\n controllers: IDL.Vec(IDL.Principal),\n wasm_memory_limit: IDL.Opt(IDL.Nat),\n memory_allocation: IDL.Nat,\n compute_allocation: IDL.Nat,\n });\n const QueryStats = IDL.Record({\n response_payload_bytes_total: IDL.Opt(IDL.Nat),\n num_instructions_total: IDL.Opt(IDL.Nat),\n num_calls_total: IDL.Opt(IDL.Nat),\n request_payload_bytes_total: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusResultV2 = IDL.Record({\n memory_metrics: IDL.Opt(MemoryMetrics),\n status: CanisterStatusType,\n memory_size: IDL.Nat,\n cycles: IDL.Nat,\n settings: DefiniteCanisterSettingsArgs,\n query_stats: IDL.Opt(QueryStats),\n idle_cycles_burned_per_day: IDL.Nat,\n module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetRunningSnsVersionResponse = IDL.Record({\n deployed_version: IDL.Opt(Version),\n pending_version: IDL.Opt(\n IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Nat64,\n target_version: IDL.Opt(Version),\n }),\n ),\n });\n const GetSnsInitializationParametersResponse = IDL.Record({\n sns_initialization_parameters: IDL.Text,\n });\n const GetTimersResponse = IDL.Record({ timers: IDL.Opt(Timers) });\n const GetUpgradeJournalRequest = IDL.Record({\n offset: IDL.Opt(IDL.Nat64),\n limit: IDL.Opt(IDL.Nat64),\n });\n const GetUpgradeJournalResponse = IDL.Record({\n upgrade_journal: IDL.Opt(UpgradeJournal),\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n deployed_version: IDL.Opt(Version),\n target_version: IDL.Opt(Version),\n upgrade_journal_entry_count: IDL.Opt(IDL.Nat64),\n });\n const ListNervousSystemFunctionsResponse = IDL.Record({\n reserved_ids: IDL.Vec(IDL.Nat64),\n functions: IDL.Vec(NervousSystemFunction),\n });\n const ListNeurons = IDL.Record({\n of_principal: IDL.Opt(IDL.Principal),\n limit: IDL.Nat32,\n start_page_at: IDL.Opt(NeuronId),\n });\n const ListNeuronsResponse = IDL.Record({ neurons: IDL.Vec(Neuron) });\n const TopicSelector = IDL.Record({ topic: IDL.Opt(Topic) });\n const ListProposals = IDL.Record({\n include_reward_status: IDL.Vec(IDL.Int32),\n before_proposal: IDL.Opt(ProposalId),\n limit: IDL.Nat32,\n exclude_type: IDL.Vec(IDL.Nat64),\n include_topics: IDL.Opt(IDL.Vec(TopicSelector)),\n include_status: IDL.Vec(IDL.Int32),\n });\n const ListProposalsResponse = IDL.Record({\n include_ballots_by_caller: IDL.Opt(IDL.Bool),\n proposals: IDL.Vec(ProposalData),\n include_topic_filtering: IDL.Opt(IDL.Bool),\n });\n const ListTopicsRequest = IDL.Record({});\n const ExtensionOperationType = IDL.Variant({\n TreasuryManagerWithdraw: IDL.Null,\n TreasuryManagerDeposit: IDL.Null,\n });\n const ExtensionType = IDL.Variant({ TreasuryManager: IDL.Null });\n const ExtensionOperationSpec = IDL.Record({\n topic: IDL.Opt(Topic),\n operation_type: IDL.Opt(ExtensionOperationType),\n description: IDL.Opt(IDL.Text),\n extension_type: IDL.Opt(ExtensionType),\n });\n const RegisteredExtensionOperationSpec = IDL.Record({\n spec: IDL.Opt(ExtensionOperationSpec),\n canister_id: IDL.Opt(IDL.Principal),\n });\n const TopicInfo = IDL.Record({\n extension_operations: IDL.Opt(IDL.Vec(RegisteredExtensionOperationSpec)),\n native_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n topic: IDL.Opt(Topic),\n is_critical: IDL.Opt(IDL.Bool),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n custom_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n });\n const ListTopicsResponse = IDL.Record({\n uncategorized_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n topics: IDL.Opt(IDL.Vec(TopicInfo)),\n });\n const StakeMaturity = IDL.Record({\n percentage_to_stake: IDL.Opt(IDL.Nat32),\n });\n const Command = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n ClaimOrRefresh: ClaimOrRefresh,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n MakeProposal: Proposal,\n StakeMaturity: StakeMaturity,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const ManageNeuron = IDL.Record({\n subaccount: IDL.Vec(IDL.Nat8),\n command: IDL.Opt(Command),\n });\n const SplitResponse = IDL.Record({ created_neuron_id: IDL.Opt(NeuronId) });\n const DisburseMaturityResponse = IDL.Record({\n amount_disbursed_e8s: IDL.Nat64,\n amount_deducted_e8s: IDL.Opt(IDL.Nat64),\n });\n const ClaimOrRefreshResponse = IDL.Record({\n refreshed_neuron_id: IDL.Opt(NeuronId),\n });\n const StakeMaturityResponse = IDL.Record({\n maturity_e8s: IDL.Nat64,\n staked_maturity_e8s: IDL.Nat64,\n });\n const MergeMaturityResponse = IDL.Record({\n merged_maturity_e8s: IDL.Nat64,\n new_stake_e8s: IDL.Nat64,\n });\n const DisburseResponse = IDL.Record({ transfer_block_height: IDL.Nat64 });\n const Command_1 = IDL.Variant({\n Error: GovernanceError,\n Split: SplitResponse,\n Follow: IDL.Record({}),\n DisburseMaturity: DisburseMaturityResponse,\n ClaimOrRefresh: ClaimOrRefreshResponse,\n Configure: IDL.Record({}),\n RegisterVote: IDL.Record({}),\n SetFollowing: IDL.Record({}),\n MakeProposal: GetProposal,\n RemoveNeuronPermission: IDL.Record({}),\n StakeMaturity: StakeMaturityResponse,\n MergeMaturity: MergeMaturityResponse,\n Disburse: DisburseResponse,\n AddNeuronPermission: IDL.Record({}),\n });\n const ManageNeuronResponse = IDL.Record({ command: IDL.Opt(Command_1) });\n const MintTokensRequest = IDL.Record({\n recipient: IDL.Opt(Account),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const SetMode = IDL.Record({ mode: IDL.Int32 });\n\n return IDL.Service({\n add_maturity: IDL.Func([AddMaturityRequest], [AddMaturityResponse], []),\n advance_target_version: IDL.Func(\n [AdvanceTargetVersionRequest],\n [AdvanceTargetVersionResponse],\n [],\n ),\n claim_swap_neurons: IDL.Func(\n [ClaimSwapNeuronsRequest],\n [ClaimSwapNeuronsResponse],\n [],\n ),\n fail_stuck_upgrade_in_progress: IDL.Func(\n [IDL.Record({})],\n [IDL.Record({})],\n [],\n ),\n get_build_metadata: IDL.Func([], [IDL.Text], []),\n get_latest_reward_event: IDL.Func([], [RewardEvent], []),\n get_maturity_modulation: IDL.Func(\n [IDL.Record({})],\n [GetMaturityModulationResponse],\n [],\n ),\n get_metadata: IDL.Func([IDL.Record({})], [GetMetadataResponse], []),\n get_metrics: IDL.Func([GetMetricsRequest], [GetMetricsResponse], []),\n get_metrics_replicated: IDL.Func(\n [GetMetricsRequest],\n [GetMetricsResponse],\n [],\n ),\n get_mode: IDL.Func([IDL.Record({})], [GetModeResponse], []),\n get_nervous_system_parameters: IDL.Func(\n [IDL.Null],\n [NervousSystemParameters],\n [],\n ),\n get_neuron: IDL.Func([GetNeuron], [GetNeuronResponse], []),\n get_proposal: IDL.Func([GetProposal], [GetProposalResponse], []),\n get_root_canister_status: IDL.Func(\n [IDL.Null],\n [CanisterStatusResultV2],\n [],\n ),\n get_running_sns_version: IDL.Func(\n [IDL.Record({})],\n [GetRunningSnsVersionResponse],\n [],\n ),\n get_sns_initialization_parameters: IDL.Func(\n [IDL.Record({})],\n [GetSnsInitializationParametersResponse],\n [],\n ),\n get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], []),\n get_upgrade_journal: IDL.Func(\n [GetUpgradeJournalRequest],\n [GetUpgradeJournalResponse],\n [],\n ),\n list_nervous_system_functions: IDL.Func(\n [],\n [ListNervousSystemFunctionsResponse],\n [],\n ),\n list_neurons: IDL.Func([ListNeurons], [ListNeuronsResponse], []),\n list_proposals: IDL.Func([ListProposals], [ListProposalsResponse], []),\n list_topics: IDL.Func([ListTopicsRequest], [ListTopicsResponse], []),\n manage_neuron: IDL.Func([ManageNeuron], [ManageNeuronResponse], []),\n mint_tokens: IDL.Func([MintTokensRequest], [IDL.Record({})], []),\n refresh_cached_upgrade_steps: IDL.Func(\n [IDL.Record({})],\n [IDL.Record({})],\n [],\n ),\n reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], []),\n set_mode: IDL.Func([SetMode], [IDL.Record({})], []),\n update_neuron: IDL.Func([Neuron], [IDL.Opt(GovernanceError)], []),\n });\n};\n\nexport const init = ({ IDL }) => {\n const PreciseValue = IDL.Rec();\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Version = IDL.Record({\n archive_wasm_hash: IDL.Vec(IDL.Nat8),\n root_wasm_hash: IDL.Vec(IDL.Nat8),\n swap_wasm_hash: IDL.Vec(IDL.Nat8),\n ledger_wasm_hash: IDL.Vec(IDL.Nat8),\n governance_wasm_hash: IDL.Vec(IDL.Nat8),\n index_wasm_hash: IDL.Vec(IDL.Nat8),\n });\n const Versions = IDL.Record({ versions: IDL.Vec(Version) });\n const CachedUpgradeSteps = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requested_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Topic = IDL.Variant({\n DappCanisterManagement: IDL.Null,\n DaoCommunitySettings: IDL.Null,\n ApplicationBusinessLogic: IDL.Null,\n CriticalDappOperations: IDL.Null,\n TreasuryAssetManagement: IDL.Null,\n Governance: IDL.Null,\n SnsFrameworkManagement: IDL.Null,\n });\n const GenericNervousSystemFunction = IDL.Record({\n topic: IDL.Opt(Topic),\n validator_canister_id: IDL.Opt(IDL.Principal),\n target_canister_id: IDL.Opt(IDL.Principal),\n validator_method_name: IDL.Opt(IDL.Text),\n target_method_name: IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n NativeNervousSystemFunction: IDL.Record({}),\n GenericNervousSystemFunction: GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n id: IDL.Nat64,\n name: IDL.Text,\n description: IDL.Opt(IDL.Text),\n function_type: IDL.Opt(FunctionType),\n });\n const Subaccount = IDL.Record({ subaccount: IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n owner: IDL.Opt(IDL.Principal),\n subaccount: IDL.Opt(Subaccount),\n });\n const TreasuryMetrics = IDL.Record({\n name: IDL.Opt(IDL.Text),\n original_amount_e8s: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n account: IDL.Opt(Account),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n treasury: IDL.Int32,\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const VotingPowerMetrics = IDL.Record({\n governance_total_potential_voting_power: IDL.Opt(IDL.Nat64),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GovernanceCachedMetrics = IDL.Record({\n treasury_metrics: IDL.Vec(TreasuryMetrics),\n not_dissolving_neurons_e8s_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64),\n ),\n garbage_collectable_neurons_count: IDL.Nat64,\n neurons_with_invalid_stake_count: IDL.Nat64,\n not_dissolving_neurons_count_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64),\n ),\n neurons_with_less_than_6_months_dissolve_delay_count: IDL.Nat64,\n dissolved_neurons_count: IDL.Nat64,\n total_staked_e8s: IDL.Nat64,\n total_supply_governance_tokens: IDL.Nat64,\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n not_dissolving_neurons_count: IDL.Nat64,\n dissolved_neurons_e8s: IDL.Nat64,\n neurons_with_less_than_6_months_dissolve_delay_e8s: IDL.Nat64,\n dissolving_neurons_count_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Nat64)),\n dissolving_neurons_count: IDL.Nat64,\n dissolving_neurons_e8s_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Float64)),\n timestamp_seconds: IDL.Nat64,\n });\n const MaturityModulation = IDL.Record({\n current_basis_points: IDL.Opt(IDL.Int32),\n updated_at_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const TargetVersionSet = IDL.Record({\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n is_advanced_automatically: IDL.Opt(IDL.Bool),\n });\n const UpgradeStepsReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n upgrade_steps: IDL.Opt(Versions),\n });\n const UpgradeOutcome = IDL.Record({\n status: IDL.Opt(\n IDL.Variant({\n Success: IDL.Record({}),\n Timeout: IDL.Record({}),\n ExternalFailure: IDL.Record({}),\n InvalidState: IDL.Record({ version: IDL.Opt(Version) }),\n }),\n ),\n human_readable: IDL.Opt(IDL.Text),\n });\n const ProposalId = IDL.Record({ id: IDL.Nat64 });\n const UpgradeStarted = IDL.Record({\n current_version: IDL.Opt(Version),\n expected_version: IDL.Opt(Version),\n reason: IDL.Opt(\n IDL.Variant({\n UpgradeSnsToNextVersionProposal: ProposalId,\n BehindTargetVersion: IDL.Record({}),\n }),\n ),\n });\n const UpgradeStepsRefreshed = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n });\n const TargetVersionReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n });\n const UpgradeJournalEntry = IDL.Record({\n event: IDL.Opt(\n IDL.Variant({\n TargetVersionSet: TargetVersionSet,\n UpgradeStepsReset: UpgradeStepsReset,\n UpgradeOutcome: UpgradeOutcome,\n UpgradeStarted: UpgradeStarted,\n UpgradeStepsRefreshed: UpgradeStepsRefreshed,\n TargetVersionReset: TargetVersionReset,\n }),\n ),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const UpgradeJournal = IDL.Record({\n entries: IDL.Vec(UpgradeJournalEntry),\n });\n const NeuronId = IDL.Record({ id: IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ followees: IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n permissions: IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n final_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n reward_rate_transition_duration_seconds: IDL.Opt(IDL.Nat64),\n round_duration_seconds: IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n default_followees: IDL.Opt(DefaultFollowees),\n max_dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n max_dissolve_delay_bonus_percentage: IDL.Opt(IDL.Nat64),\n max_followees_per_function: IDL.Opt(IDL.Nat64),\n automatically_advance_target_version: IDL.Opt(IDL.Bool),\n neuron_claimer_permissions: IDL.Opt(NeuronPermissionList),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n max_neuron_age_for_age_bonus: IDL.Opt(IDL.Nat64),\n initial_voting_period_seconds: IDL.Opt(IDL.Nat64),\n neuron_minimum_dissolve_delay_to_vote_seconds: IDL.Opt(IDL.Nat64),\n reject_cost_e8s: IDL.Opt(IDL.Nat64),\n max_proposals_to_keep_per_action: IDL.Opt(IDL.Nat32),\n wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64),\n max_number_of_neurons: IDL.Opt(IDL.Nat64),\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64),\n max_age_bonus_percentage: IDL.Opt(IDL.Nat64),\n neuron_grantable_permissions: IDL.Opt(NeuronPermissionList),\n voting_rewards_parameters: IDL.Opt(VotingRewardsParameters),\n maturity_modulation_disabled: IDL.Opt(IDL.Bool),\n max_number_of_principals_per_neuron: IDL.Opt(IDL.Nat64),\n });\n const RewardEvent = IDL.Record({\n rounds_since_last_distribution: IDL.Opt(IDL.Nat64),\n actual_timestamp_seconds: IDL.Nat64,\n end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n total_available_e8s_equivalent: IDL.Opt(IDL.Nat64),\n distributed_e8s_equivalent: IDL.Nat64,\n round: IDL.Nat64,\n settled_proposals: IDL.Vec(ProposalId),\n });\n const PendingVersion = IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Opt(IDL.Nat64),\n target_version: IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n error_message: IDL.Text,\n error_type: IDL.Int32,\n });\n const Decimal = IDL.Record({ human_readable: IDL.Opt(IDL.Text) });\n const Tokens = IDL.Record({ e8s: IDL.Opt(IDL.Nat64) });\n const ValuationFactors = IDL.Record({\n xdrs_per_icp: IDL.Opt(Decimal),\n icps_per_token: IDL.Opt(Decimal),\n tokens: IDL.Opt(Tokens),\n });\n const Valuation = IDL.Record({\n token: IDL.Opt(IDL.Int32),\n account: IDL.Opt(Account),\n valuation_factors: IDL.Opt(ValuationFactors),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const MintSnsTokensActionAuxiliary = IDL.Record({\n valuation: IDL.Opt(Valuation),\n });\n const SnsVersion = IDL.Record({\n archive_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n root_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n swap_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n ledger_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n governance_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n index_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const AdvanceSnsTargetVersionActionAuxiliary = IDL.Record({\n target_version: IDL.Opt(SnsVersion),\n });\n const ActionAuxiliary = IDL.Variant({\n TransferSnsTreasuryFunds: MintSnsTokensActionAuxiliary,\n MintSnsTokens: MintSnsTokensActionAuxiliary,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersionActionAuxiliary,\n });\n const Ballot = IDL.Record({\n vote: IDL.Int32,\n cast_timestamp_seconds: IDL.Nat64,\n voting_power: IDL.Nat64,\n });\n const Percentage = IDL.Record({ basis_points: IDL.Opt(IDL.Nat64) });\n const Tally = IDL.Record({\n no: IDL.Nat64,\n yes: IDL.Nat64,\n total: IDL.Nat64,\n timestamp_seconds: IDL.Nat64,\n });\n const ManageDappCanisterSettings = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat64),\n wasm_memory_threshold: IDL.Opt(IDL.Nat64),\n canister_ids: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat64),\n log_visibility: IDL.Opt(IDL.Int32),\n wasm_memory_limit: IDL.Opt(IDL.Nat64),\n memory_allocation: IDL.Opt(IDL.Nat64),\n compute_allocation: IDL.Opt(IDL.Nat64),\n });\n PreciseValue.fill(\n IDL.Variant({\n Int: IDL.Int64,\n Map: IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),\n Nat: IDL.Nat64,\n Blob: IDL.Vec(IDL.Nat8),\n Bool: IDL.Bool,\n Text: IDL.Text,\n Array: IDL.Vec(PreciseValue),\n }),\n );\n const ExtensionOperationArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const ExecuteExtensionOperation = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n operation_name: IDL.Opt(IDL.Text),\n operation_arg: IDL.Opt(ExtensionOperationArg),\n });\n const ChunkedCanisterWasm = IDL.Record({\n wasm_module_hash: IDL.Vec(IDL.Nat8),\n chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),\n store_canister_id: IDL.Opt(IDL.Principal),\n });\n const Wasm = IDL.Variant({\n Chunked: ChunkedCanisterWasm,\n Bytes: IDL.Vec(IDL.Nat8),\n });\n const ExtensionUpgradeArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const UpgradeExtension = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n wasm: IDL.Opt(Wasm),\n canister_upgrade_arg: IDL.Opt(ExtensionUpgradeArg),\n });\n const SetTopicsForCustomProposals = IDL.Record({\n custom_function_id_to_topic: IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),\n });\n const ExtensionInit = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const RegisterExtension = IDL.Record({\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n extension_init: IDL.Opt(ExtensionInit),\n });\n const RegisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n });\n const TransferSnsTreasuryFunds = IDL.Record({\n from_treasury: IDL.Int32,\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n new_canister_wasm: IDL.Vec(IDL.Nat8),\n mode: IDL.Opt(IDL.Int32),\n canister_id: IDL.Opt(IDL.Principal),\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n canister_upgrade_arg: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const DeregisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n new_controllers: IDL.Vec(IDL.Principal),\n });\n const MintSnsTokens = IDL.Record({\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const AdvanceSnsTargetVersion = IDL.Record({\n new_target: IDL.Opt(SnsVersion),\n });\n const ManageSnsMetadata = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n function_id: IDL.Nat64,\n payload: IDL.Vec(IDL.Nat8),\n });\n const ManageLedgerParameters = IDL.Record({\n token_symbol: IDL.Opt(IDL.Text),\n transfer_fee: IDL.Opt(IDL.Nat64),\n token_logo: IDL.Opt(IDL.Text),\n token_name: IDL.Opt(IDL.Text),\n });\n const Motion = IDL.Record({ motion_text: IDL.Text });\n const Action = IDL.Variant({\n ManageNervousSystemParameters: NervousSystemParameters,\n AddGenericNervousSystemFunction: NervousSystemFunction,\n ManageDappCanisterSettings: ManageDappCanisterSettings,\n ExecuteExtensionOperation: ExecuteExtensionOperation,\n UpgradeExtension: UpgradeExtension,\n RemoveGenericNervousSystemFunction: IDL.Nat64,\n SetTopicsForCustomProposals: SetTopicsForCustomProposals,\n RegisterExtension: RegisterExtension,\n UpgradeSnsToNextVersion: IDL.Record({}),\n RegisterDappCanisters: RegisterDappCanisters,\n TransferSnsTreasuryFunds: TransferSnsTreasuryFunds,\n UpgradeSnsControlledCanister: UpgradeSnsControlledCanister,\n DeregisterDappCanisters: DeregisterDappCanisters,\n MintSnsTokens: MintSnsTokens,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersion,\n Unspecified: IDL.Record({}),\n ManageSnsMetadata: ManageSnsMetadata,\n ExecuteGenericNervousSystemFunction: ExecuteGenericNervousSystemFunction,\n ManageLedgerParameters: ManageLedgerParameters,\n Motion: Motion,\n });\n const Proposal = IDL.Record({\n url: IDL.Text,\n title: IDL.Text,\n action: IDL.Opt(Action),\n summary: IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n current_deadline_timestamp_seconds: IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n id: IDL.Opt(ProposalId),\n payload_text_rendering: IDL.Opt(IDL.Text),\n topic: IDL.Opt(Topic),\n action: IDL.Nat64,\n failure_reason: IDL.Opt(GovernanceError),\n action_auxiliary: IDL.Opt(ActionAuxiliary),\n ballots: IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n minimum_yes_proportion_of_total: IDL.Opt(Percentage),\n reward_event_round: IDL.Nat64,\n failed_timestamp_seconds: IDL.Nat64,\n reward_event_end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n proposal_creation_timestamp_seconds: IDL.Nat64,\n initial_voting_period_seconds: IDL.Nat64,\n reject_cost_e8s: IDL.Nat64,\n latest_tally: IDL.Opt(Tally),\n wait_for_quiet_deadline_increase_seconds: IDL.Nat64,\n decided_timestamp_seconds: IDL.Nat64,\n proposal: IDL.Opt(Proposal),\n proposer: IDL.Opt(NeuronId),\n wait_for_quiet_state: IDL.Opt(WaitForQuietState),\n minimum_yes_proportion_of_exercised: IDL.Opt(Percentage),\n is_eligible_for_rewards: IDL.Bool,\n executed_timestamp_seconds: IDL.Nat64,\n });\n const Split = IDL.Record({ memo: IDL.Nat64, amount_e8s: IDL.Nat64 });\n const Follow = IDL.Record({\n function_id: IDL.Nat64,\n followees: IDL.Vec(NeuronId),\n });\n const DisburseMaturity = IDL.Record({\n to_account: IDL.Opt(Account),\n percentage_to_disburse: IDL.Nat32,\n });\n const ChangeAutoStakeMaturity = IDL.Record({\n requested_setting_for_auto_stake_maturity: IDL.Bool,\n });\n const IncreaseDissolveDelay = IDL.Record({\n additional_dissolve_delay_seconds: IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n dissolve_timestamp_seconds: IDL.Nat64,\n });\n const Operation = IDL.Variant({\n ChangeAutoStakeMaturity: ChangeAutoStakeMaturity,\n StopDissolving: IDL.Record({}),\n StartDissolving: IDL.Record({}),\n IncreaseDissolveDelay: IncreaseDissolveDelay,\n SetDissolveTimestamp: SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ operation: IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n vote: IDL.Int32,\n proposal: IDL.Opt(ProposalId),\n });\n const Followee = IDL.Record({\n alias: IDL.Opt(IDL.Text),\n neuron_id: IDL.Opt(NeuronId),\n });\n const FolloweesForTopic = IDL.Record({\n topic: IDL.Opt(Topic),\n followees: IDL.Vec(Followee),\n });\n const SetFollowing = IDL.Record({\n topic_following: IDL.Vec(FolloweesForTopic),\n });\n const FinalizeDisburseMaturity = IDL.Record({\n amount_to_be_disbursed_e8s: IDL.Nat64,\n to_account: IDL.Opt(Account),\n });\n const MemoAndController = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n memo: IDL.Nat64,\n });\n const By = IDL.Variant({\n MemoAndController: MemoAndController,\n NeuronId: IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ by: IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n permissions_to_remove: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n permissions_to_add: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ percentage_to_merge: IDL.Nat32 });\n const Amount = IDL.Record({ e8s: IDL.Nat64 });\n const Disburse = IDL.Record({\n to_account: IDL.Opt(Account),\n amount: IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n SyncCommand: IDL.Record({}),\n MakeProposal: Proposal,\n FinalizeDisburseMaturity: FinalizeDisburseMaturity,\n ClaimOrRefreshNeuron: ClaimOrRefresh,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n command: IDL.Opt(Command_2),\n timestamp: IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n principal: IDL.Opt(IDL.Principal),\n permission_type: IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n DissolveDelaySeconds: IDL.Nat64,\n WhenDissolvedTimestampSeconds: IDL.Nat64,\n });\n const DisburseMaturityInProgress = IDL.Record({\n timestamp_of_disbursement_seconds: IDL.Nat64,\n amount_e8s: IDL.Nat64,\n account_to_disburse_to: IDL.Opt(Account),\n finalize_disbursement_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Neuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n staked_maturity_e8s_equivalent: IDL.Opt(IDL.Nat64),\n permissions: IDL.Vec(NeuronPermission),\n maturity_e8s_equivalent: IDL.Nat64,\n cached_neuron_stake_e8s: IDL.Nat64,\n created_timestamp_seconds: IDL.Nat64,\n topic_followees: IDL.Opt(\n IDL.Record({\n topic_id_to_followees: IDL.Vec(IDL.Tuple(IDL.Int32, FolloweesForTopic)),\n }),\n ),\n source_nns_neuron_id: IDL.Opt(IDL.Nat64),\n auto_stake_maturity: IDL.Opt(IDL.Bool),\n aging_since_timestamp_seconds: IDL.Nat64,\n dissolve_state: IDL.Opt(DissolveState),\n voting_power_percentage_multiplier: IDL.Nat64,\n vesting_period_seconds: IDL.Opt(IDL.Nat64),\n disburse_maturity_in_progress: IDL.Vec(DisburseMaturityInProgress),\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n neuron_fees_e8s: IDL.Nat64,\n });\n const Governance = IDL.Record({\n root_canister_id: IDL.Opt(IDL.Principal),\n timers: IDL.Opt(Timers),\n cached_upgrade_steps: IDL.Opt(CachedUpgradeSteps),\n id_to_nervous_system_functions: IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction),\n ),\n metrics: IDL.Opt(GovernanceCachedMetrics),\n maturity_modulation: IDL.Opt(MaturityModulation),\n upgrade_journal: IDL.Opt(UpgradeJournal),\n mode: IDL.Int32,\n parameters: IDL.Opt(NervousSystemParameters),\n is_finalizing_disburse_maturity: IDL.Opt(IDL.Bool),\n deployed_version: IDL.Opt(Version),\n sns_initialization_parameters: IDL.Text,\n latest_reward_event: IDL.Opt(RewardEvent),\n pending_version: IDL.Opt(PendingVersion),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n proposals: IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n in_flight_commands: IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n sns_metadata: IDL.Opt(ManageSnsMetadata),\n neurons: IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n target_version: IDL.Opt(Version),\n genesis_timestamp_seconds: IDL.Nat64,\n });\n\n return [Governance];\n};\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.0-patch-typed-arrays.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({ IDL }) => {\n const PreciseValue = IDL.Rec();\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Version = IDL.Record({\n archive_wasm_hash: IDL.Vec(IDL.Nat8),\n root_wasm_hash: IDL.Vec(IDL.Nat8),\n swap_wasm_hash: IDL.Vec(IDL.Nat8),\n ledger_wasm_hash: IDL.Vec(IDL.Nat8),\n governance_wasm_hash: IDL.Vec(IDL.Nat8),\n index_wasm_hash: IDL.Vec(IDL.Nat8),\n });\n const Versions = IDL.Record({ versions: IDL.Vec(Version) });\n const CachedUpgradeSteps = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requested_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Topic = IDL.Variant({\n DappCanisterManagement: IDL.Null,\n DaoCommunitySettings: IDL.Null,\n ApplicationBusinessLogic: IDL.Null,\n CriticalDappOperations: IDL.Null,\n TreasuryAssetManagement: IDL.Null,\n Governance: IDL.Null,\n SnsFrameworkManagement: IDL.Null,\n });\n const GenericNervousSystemFunction = IDL.Record({\n topic: IDL.Opt(Topic),\n validator_canister_id: IDL.Opt(IDL.Principal),\n target_canister_id: IDL.Opt(IDL.Principal),\n validator_method_name: IDL.Opt(IDL.Text),\n target_method_name: IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n NativeNervousSystemFunction: IDL.Record({}),\n GenericNervousSystemFunction: GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n id: IDL.Nat64,\n name: IDL.Text,\n description: IDL.Opt(IDL.Text),\n function_type: IDL.Opt(FunctionType),\n });\n const Subaccount = IDL.Record({ subaccount: IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n owner: IDL.Opt(IDL.Principal),\n subaccount: IDL.Opt(Subaccount),\n });\n const TreasuryMetrics = IDL.Record({\n name: IDL.Opt(IDL.Text),\n original_amount_e8s: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n account: IDL.Opt(Account),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n treasury: IDL.Int32,\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const VotingPowerMetrics = IDL.Record({\n governance_total_potential_voting_power: IDL.Opt(IDL.Nat64),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GovernanceCachedMetrics = IDL.Record({\n treasury_metrics: IDL.Vec(TreasuryMetrics),\n not_dissolving_neurons_e8s_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64),\n ),\n garbage_collectable_neurons_count: IDL.Nat64,\n neurons_with_invalid_stake_count: IDL.Nat64,\n not_dissolving_neurons_count_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64),\n ),\n neurons_with_less_than_6_months_dissolve_delay_count: IDL.Nat64,\n dissolved_neurons_count: IDL.Nat64,\n total_staked_e8s: IDL.Nat64,\n total_supply_governance_tokens: IDL.Nat64,\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n not_dissolving_neurons_count: IDL.Nat64,\n dissolved_neurons_e8s: IDL.Nat64,\n neurons_with_less_than_6_months_dissolve_delay_e8s: IDL.Nat64,\n dissolving_neurons_count_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Nat64)),\n dissolving_neurons_count: IDL.Nat64,\n dissolving_neurons_e8s_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Float64)),\n timestamp_seconds: IDL.Nat64,\n });\n const MaturityModulation = IDL.Record({\n current_basis_points: IDL.Opt(IDL.Int32),\n updated_at_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const TargetVersionSet = IDL.Record({\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n is_advanced_automatically: IDL.Opt(IDL.Bool),\n });\n const UpgradeStepsReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n upgrade_steps: IDL.Opt(Versions),\n });\n const UpgradeOutcome = IDL.Record({\n status: IDL.Opt(\n IDL.Variant({\n Success: IDL.Record({}),\n Timeout: IDL.Record({}),\n ExternalFailure: IDL.Record({}),\n InvalidState: IDL.Record({ version: IDL.Opt(Version) }),\n }),\n ),\n human_readable: IDL.Opt(IDL.Text),\n });\n const ProposalId = IDL.Record({ id: IDL.Nat64 });\n const UpgradeStarted = IDL.Record({\n current_version: IDL.Opt(Version),\n expected_version: IDL.Opt(Version),\n reason: IDL.Opt(\n IDL.Variant({\n UpgradeSnsToNextVersionProposal: ProposalId,\n BehindTargetVersion: IDL.Record({}),\n }),\n ),\n });\n const UpgradeStepsRefreshed = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n });\n const TargetVersionReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n });\n const UpgradeJournalEntry = IDL.Record({\n event: IDL.Opt(\n IDL.Variant({\n TargetVersionSet: TargetVersionSet,\n UpgradeStepsReset: UpgradeStepsReset,\n UpgradeOutcome: UpgradeOutcome,\n UpgradeStarted: UpgradeStarted,\n UpgradeStepsRefreshed: UpgradeStepsRefreshed,\n TargetVersionReset: TargetVersionReset,\n }),\n ),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const UpgradeJournal = IDL.Record({\n entries: IDL.Vec(UpgradeJournalEntry),\n });\n const NeuronId = IDL.Record({ id: IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ followees: IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n permissions: IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n final_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n reward_rate_transition_duration_seconds: IDL.Opt(IDL.Nat64),\n round_duration_seconds: IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n default_followees: IDL.Opt(DefaultFollowees),\n max_dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n max_dissolve_delay_bonus_percentage: IDL.Opt(IDL.Nat64),\n max_followees_per_function: IDL.Opt(IDL.Nat64),\n automatically_advance_target_version: IDL.Opt(IDL.Bool),\n neuron_claimer_permissions: IDL.Opt(NeuronPermissionList),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n max_neuron_age_for_age_bonus: IDL.Opt(IDL.Nat64),\n initial_voting_period_seconds: IDL.Opt(IDL.Nat64),\n neuron_minimum_dissolve_delay_to_vote_seconds: IDL.Opt(IDL.Nat64),\n reject_cost_e8s: IDL.Opt(IDL.Nat64),\n max_proposals_to_keep_per_action: IDL.Opt(IDL.Nat32),\n wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64),\n max_number_of_neurons: IDL.Opt(IDL.Nat64),\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64),\n max_age_bonus_percentage: IDL.Opt(IDL.Nat64),\n neuron_grantable_permissions: IDL.Opt(NeuronPermissionList),\n voting_rewards_parameters: IDL.Opt(VotingRewardsParameters),\n maturity_modulation_disabled: IDL.Opt(IDL.Bool),\n max_number_of_principals_per_neuron: IDL.Opt(IDL.Nat64),\n });\n const RewardEvent = IDL.Record({\n rounds_since_last_distribution: IDL.Opt(IDL.Nat64),\n actual_timestamp_seconds: IDL.Nat64,\n end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n total_available_e8s_equivalent: IDL.Opt(IDL.Nat64),\n distributed_e8s_equivalent: IDL.Nat64,\n round: IDL.Nat64,\n settled_proposals: IDL.Vec(ProposalId),\n });\n const PendingVersion = IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Opt(IDL.Nat64),\n target_version: IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n error_message: IDL.Text,\n error_type: IDL.Int32,\n });\n const Decimal = IDL.Record({ human_readable: IDL.Opt(IDL.Text) });\n const Tokens = IDL.Record({ e8s: IDL.Opt(IDL.Nat64) });\n const ValuationFactors = IDL.Record({\n xdrs_per_icp: IDL.Opt(Decimal),\n icps_per_token: IDL.Opt(Decimal),\n tokens: IDL.Opt(Tokens),\n });\n const Valuation = IDL.Record({\n token: IDL.Opt(IDL.Int32),\n account: IDL.Opt(Account),\n valuation_factors: IDL.Opt(ValuationFactors),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const MintSnsTokensActionAuxiliary = IDL.Record({\n valuation: IDL.Opt(Valuation),\n });\n const SnsVersion = IDL.Record({\n archive_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n root_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n swap_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n ledger_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n governance_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n index_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const AdvanceSnsTargetVersionActionAuxiliary = IDL.Record({\n target_version: IDL.Opt(SnsVersion),\n });\n const ActionAuxiliary = IDL.Variant({\n TransferSnsTreasuryFunds: MintSnsTokensActionAuxiliary,\n MintSnsTokens: MintSnsTokensActionAuxiliary,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersionActionAuxiliary,\n });\n const Ballot = IDL.Record({\n vote: IDL.Int32,\n cast_timestamp_seconds: IDL.Nat64,\n voting_power: IDL.Nat64,\n });\n const Percentage = IDL.Record({ basis_points: IDL.Opt(IDL.Nat64) });\n const Tally = IDL.Record({\n no: IDL.Nat64,\n yes: IDL.Nat64,\n total: IDL.Nat64,\n timestamp_seconds: IDL.Nat64,\n });\n const ManageDappCanisterSettings = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat64),\n wasm_memory_threshold: IDL.Opt(IDL.Nat64),\n canister_ids: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat64),\n log_visibility: IDL.Opt(IDL.Int32),\n wasm_memory_limit: IDL.Opt(IDL.Nat64),\n memory_allocation: IDL.Opt(IDL.Nat64),\n compute_allocation: IDL.Opt(IDL.Nat64),\n });\n PreciseValue.fill(\n IDL.Variant({\n Int: IDL.Int64,\n Map: IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),\n Nat: IDL.Nat64,\n Blob: IDL.Vec(IDL.Nat8),\n Bool: IDL.Bool,\n Text: IDL.Text,\n Array: IDL.Vec(PreciseValue),\n }),\n );\n const ExtensionOperationArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const ExecuteExtensionOperation = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n operation_name: IDL.Opt(IDL.Text),\n operation_arg: IDL.Opt(ExtensionOperationArg),\n });\n const ChunkedCanisterWasm = IDL.Record({\n wasm_module_hash: IDL.Vec(IDL.Nat8),\n chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),\n store_canister_id: IDL.Opt(IDL.Principal),\n });\n const Wasm = IDL.Variant({\n Chunked: ChunkedCanisterWasm,\n Bytes: IDL.Vec(IDL.Nat8),\n });\n const ExtensionUpgradeArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const UpgradeExtension = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n wasm: IDL.Opt(Wasm),\n canister_upgrade_arg: IDL.Opt(ExtensionUpgradeArg),\n });\n const SetTopicsForCustomProposals = IDL.Record({\n custom_function_id_to_topic: IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),\n });\n const ExtensionInit = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const RegisterExtension = IDL.Record({\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n extension_init: IDL.Opt(ExtensionInit),\n });\n const RegisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n });\n const TransferSnsTreasuryFunds = IDL.Record({\n from_treasury: IDL.Int32,\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n new_canister_wasm: IDL.Vec(IDL.Nat8),\n mode: IDL.Opt(IDL.Int32),\n canister_id: IDL.Opt(IDL.Principal),\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n canister_upgrade_arg: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const DeregisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n new_controllers: IDL.Vec(IDL.Principal),\n });\n const MintSnsTokens = IDL.Record({\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const AdvanceSnsTargetVersion = IDL.Record({\n new_target: IDL.Opt(SnsVersion),\n });\n const ManageSnsMetadata = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n function_id: IDL.Nat64,\n payload: IDL.Vec(IDL.Nat8),\n });\n const ManageLedgerParameters = IDL.Record({\n token_symbol: IDL.Opt(IDL.Text),\n transfer_fee: IDL.Opt(IDL.Nat64),\n token_logo: IDL.Opt(IDL.Text),\n token_name: IDL.Opt(IDL.Text),\n });\n const Motion = IDL.Record({ motion_text: IDL.Text });\n const Action = IDL.Variant({\n ManageNervousSystemParameters: NervousSystemParameters,\n AddGenericNervousSystemFunction: NervousSystemFunction,\n ManageDappCanisterSettings: ManageDappCanisterSettings,\n ExecuteExtensionOperation: ExecuteExtensionOperation,\n UpgradeExtension: UpgradeExtension,\n RemoveGenericNervousSystemFunction: IDL.Nat64,\n SetTopicsForCustomProposals: SetTopicsForCustomProposals,\n RegisterExtension: RegisterExtension,\n UpgradeSnsToNextVersion: IDL.Record({}),\n RegisterDappCanisters: RegisterDappCanisters,\n TransferSnsTreasuryFunds: TransferSnsTreasuryFunds,\n UpgradeSnsControlledCanister: UpgradeSnsControlledCanister,\n DeregisterDappCanisters: DeregisterDappCanisters,\n MintSnsTokens: MintSnsTokens,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersion,\n Unspecified: IDL.Record({}),\n ManageSnsMetadata: ManageSnsMetadata,\n ExecuteGenericNervousSystemFunction: ExecuteGenericNervousSystemFunction,\n ManageLedgerParameters: ManageLedgerParameters,\n Motion: Motion,\n });\n const Proposal = IDL.Record({\n url: IDL.Text,\n title: IDL.Text,\n action: IDL.Opt(Action),\n summary: IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n current_deadline_timestamp_seconds: IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n id: IDL.Opt(ProposalId),\n payload_text_rendering: IDL.Opt(IDL.Text),\n topic: IDL.Opt(Topic),\n action: IDL.Nat64,\n failure_reason: IDL.Opt(GovernanceError),\n action_auxiliary: IDL.Opt(ActionAuxiliary),\n ballots: IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n minimum_yes_proportion_of_total: IDL.Opt(Percentage),\n reward_event_round: IDL.Nat64,\n failed_timestamp_seconds: IDL.Nat64,\n reward_event_end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n proposal_creation_timestamp_seconds: IDL.Nat64,\n initial_voting_period_seconds: IDL.Nat64,\n reject_cost_e8s: IDL.Nat64,\n latest_tally: IDL.Opt(Tally),\n wait_for_quiet_deadline_increase_seconds: IDL.Nat64,\n decided_timestamp_seconds: IDL.Nat64,\n proposal: IDL.Opt(Proposal),\n proposer: IDL.Opt(NeuronId),\n wait_for_quiet_state: IDL.Opt(WaitForQuietState),\n minimum_yes_proportion_of_exercised: IDL.Opt(Percentage),\n is_eligible_for_rewards: IDL.Bool,\n executed_timestamp_seconds: IDL.Nat64,\n });\n const Split = IDL.Record({ memo: IDL.Nat64, amount_e8s: IDL.Nat64 });\n const Follow = IDL.Record({\n function_id: IDL.Nat64,\n followees: IDL.Vec(NeuronId),\n });\n const DisburseMaturity = IDL.Record({\n to_account: IDL.Opt(Account),\n percentage_to_disburse: IDL.Nat32,\n });\n const ChangeAutoStakeMaturity = IDL.Record({\n requested_setting_for_auto_stake_maturity: IDL.Bool,\n });\n const IncreaseDissolveDelay = IDL.Record({\n additional_dissolve_delay_seconds: IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n dissolve_timestamp_seconds: IDL.Nat64,\n });\n const Operation = IDL.Variant({\n ChangeAutoStakeMaturity: ChangeAutoStakeMaturity,\n StopDissolving: IDL.Record({}),\n StartDissolving: IDL.Record({}),\n IncreaseDissolveDelay: IncreaseDissolveDelay,\n SetDissolveTimestamp: SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ operation: IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n vote: IDL.Int32,\n proposal: IDL.Opt(ProposalId),\n });\n const Followee = IDL.Record({\n alias: IDL.Opt(IDL.Text),\n neuron_id: IDL.Opt(NeuronId),\n });\n const FolloweesForTopic = IDL.Record({\n topic: IDL.Opt(Topic),\n followees: IDL.Vec(Followee),\n });\n const SetFollowing = IDL.Record({\n topic_following: IDL.Vec(FolloweesForTopic),\n });\n const FinalizeDisburseMaturity = IDL.Record({\n amount_to_be_disbursed_e8s: IDL.Nat64,\n to_account: IDL.Opt(Account),\n });\n const MemoAndController = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n memo: IDL.Nat64,\n });\n const By = IDL.Variant({\n MemoAndController: MemoAndController,\n NeuronId: IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ by: IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n permissions_to_remove: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n permissions_to_add: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ percentage_to_merge: IDL.Nat32 });\n const Amount = IDL.Record({ e8s: IDL.Nat64 });\n const Disburse = IDL.Record({\n to_account: IDL.Opt(Account),\n amount: IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n SyncCommand: IDL.Record({}),\n MakeProposal: Proposal,\n FinalizeDisburseMaturity: FinalizeDisburseMaturity,\n ClaimOrRefreshNeuron: ClaimOrRefresh,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n command: IDL.Opt(Command_2),\n timestamp: IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n principal: IDL.Opt(IDL.Principal),\n permission_type: IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n DissolveDelaySeconds: IDL.Nat64,\n WhenDissolvedTimestampSeconds: IDL.Nat64,\n });\n const DisburseMaturityInProgress = IDL.Record({\n timestamp_of_disbursement_seconds: IDL.Nat64,\n amount_e8s: IDL.Nat64,\n account_to_disburse_to: IDL.Opt(Account),\n finalize_disbursement_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Neuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n staked_maturity_e8s_equivalent: IDL.Opt(IDL.Nat64),\n permissions: IDL.Vec(NeuronPermission),\n maturity_e8s_equivalent: IDL.Nat64,\n cached_neuron_stake_e8s: IDL.Nat64,\n created_timestamp_seconds: IDL.Nat64,\n topic_followees: IDL.Opt(\n IDL.Record({\n topic_id_to_followees: IDL.Vec(IDL.Tuple(IDL.Int32, FolloweesForTopic)),\n }),\n ),\n source_nns_neuron_id: IDL.Opt(IDL.Nat64),\n auto_stake_maturity: IDL.Opt(IDL.Bool),\n aging_since_timestamp_seconds: IDL.Nat64,\n dissolve_state: IDL.Opt(DissolveState),\n voting_power_percentage_multiplier: IDL.Nat64,\n vesting_period_seconds: IDL.Opt(IDL.Nat64),\n disburse_maturity_in_progress: IDL.Vec(DisburseMaturityInProgress),\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n neuron_fees_e8s: IDL.Nat64,\n });\n const Governance = IDL.Record({\n root_canister_id: IDL.Opt(IDL.Principal),\n timers: IDL.Opt(Timers),\n cached_upgrade_steps: IDL.Opt(CachedUpgradeSteps),\n id_to_nervous_system_functions: IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction),\n ),\n metrics: IDL.Opt(GovernanceCachedMetrics),\n maturity_modulation: IDL.Opt(MaturityModulation),\n upgrade_journal: IDL.Opt(UpgradeJournal),\n mode: IDL.Int32,\n parameters: IDL.Opt(NervousSystemParameters),\n is_finalizing_disburse_maturity: IDL.Opt(IDL.Bool),\n deployed_version: IDL.Opt(Version),\n sns_initialization_parameters: IDL.Text,\n latest_reward_event: IDL.Opt(RewardEvent),\n pending_version: IDL.Opt(PendingVersion),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n proposals: IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n in_flight_commands: IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n sns_metadata: IDL.Opt(ManageSnsMetadata),\n neurons: IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n target_version: IDL.Opt(Version),\n genesis_timestamp_seconds: IDL.Nat64,\n });\n const AddMaturityRequest = IDL.Record({\n id: IDL.Opt(NeuronId),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const AddMaturityResponse = IDL.Record({\n new_maturity_e8s: IDL.Opt(IDL.Nat64),\n });\n const AdvanceTargetVersionRequest = IDL.Record({\n target_version: IDL.Opt(Version),\n });\n const AdvanceTargetVersionResponse = IDL.Record({});\n const Principals = IDL.Record({ principals: IDL.Vec(IDL.Principal) });\n const NeuronsFund = IDL.Record({\n nns_neuron_hotkeys: IDL.Opt(Principals),\n nns_neuron_controller: IDL.Opt(IDL.Principal),\n nns_neuron_id: IDL.Opt(IDL.Nat64),\n });\n const Participant = IDL.Variant({\n NeuronsFund: NeuronsFund,\n Direct: IDL.Record({}),\n });\n const NeuronIds = IDL.Record({ neuron_ids: IDL.Vec(NeuronId) });\n const NeuronRecipe = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n participant: IDL.Opt(Participant),\n stake_e8s: IDL.Opt(IDL.Nat64),\n followees: IDL.Opt(NeuronIds),\n neuron_id: IDL.Opt(NeuronId),\n });\n const NeuronRecipes = IDL.Record({\n neuron_recipes: IDL.Vec(NeuronRecipe),\n });\n const ClaimSwapNeuronsRequest = IDL.Record({\n neuron_recipes: IDL.Opt(NeuronRecipes),\n });\n const SwapNeuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n status: IDL.Int32,\n });\n const ClaimedSwapNeurons = IDL.Record({\n swap_neurons: IDL.Vec(SwapNeuron),\n });\n const ClaimSwapNeuronsResult = IDL.Variant({\n Ok: ClaimedSwapNeurons,\n Err: IDL.Int32,\n });\n const ClaimSwapNeuronsResponse = IDL.Record({\n claim_swap_neurons_result: IDL.Opt(ClaimSwapNeuronsResult),\n });\n const GetMaturityModulationResponse = IDL.Record({\n maturity_modulation: IDL.Opt(MaturityModulation),\n });\n const GetMetadataResponse = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const GetMetricsRequest = IDL.Record({\n time_window_seconds: IDL.Opt(IDL.Nat64),\n });\n const Metrics = IDL.Record({\n treasury_metrics: IDL.Opt(IDL.Vec(TreasuryMetrics)),\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n last_ledger_block_timestamp: IDL.Opt(IDL.Nat64),\n num_recently_executed_proposals: IDL.Opt(IDL.Nat64),\n num_recently_submitted_proposals: IDL.Opt(IDL.Nat64),\n genesis_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GetMetricsResult = IDL.Variant({\n Ok: Metrics,\n Err: GovernanceError,\n });\n const GetMetricsResponse = IDL.Record({\n get_metrics_result: IDL.Opt(GetMetricsResult),\n });\n const GetModeResponse = IDL.Record({ mode: IDL.Opt(IDL.Int32) });\n const GetNeuron = IDL.Record({ neuron_id: IDL.Opt(NeuronId) });\n const Result = IDL.Variant({ Error: GovernanceError, Neuron: Neuron });\n const GetNeuronResponse = IDL.Record({ result: IDL.Opt(Result) });\n const GetProposal = IDL.Record({ proposal_id: IDL.Opt(ProposalId) });\n const Result_1 = IDL.Variant({\n Error: GovernanceError,\n Proposal: ProposalData,\n });\n const GetProposalResponse = IDL.Record({ result: IDL.Opt(Result_1) });\n const MemoryMetrics = IDL.Record({\n wasm_binary_size: IDL.Opt(IDL.Nat),\n wasm_chunk_store_size: IDL.Opt(IDL.Nat),\n canister_history_size: IDL.Opt(IDL.Nat),\n stable_memory_size: IDL.Opt(IDL.Nat),\n snapshots_size: IDL.Opt(IDL.Nat),\n wasm_memory_size: IDL.Opt(IDL.Nat),\n global_memory_size: IDL.Opt(IDL.Nat),\n custom_sections_size: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusType = IDL.Variant({\n stopped: IDL.Null,\n stopping: IDL.Null,\n running: IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n freezing_threshold: IDL.Nat,\n wasm_memory_threshold: IDL.Opt(IDL.Nat),\n controllers: IDL.Vec(IDL.Principal),\n wasm_memory_limit: IDL.Opt(IDL.Nat),\n memory_allocation: IDL.Nat,\n compute_allocation: IDL.Nat,\n });\n const QueryStats = IDL.Record({\n response_payload_bytes_total: IDL.Opt(IDL.Nat),\n num_instructions_total: IDL.Opt(IDL.Nat),\n num_calls_total: IDL.Opt(IDL.Nat),\n request_payload_bytes_total: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusResultV2 = IDL.Record({\n memory_metrics: IDL.Opt(MemoryMetrics),\n status: CanisterStatusType,\n memory_size: IDL.Nat,\n cycles: IDL.Nat,\n settings: DefiniteCanisterSettingsArgs,\n query_stats: IDL.Opt(QueryStats),\n idle_cycles_burned_per_day: IDL.Nat,\n module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetRunningSnsVersionResponse = IDL.Record({\n deployed_version: IDL.Opt(Version),\n pending_version: IDL.Opt(\n IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Nat64,\n target_version: IDL.Opt(Version),\n }),\n ),\n });\n const GetSnsInitializationParametersResponse = IDL.Record({\n sns_initialization_parameters: IDL.Text,\n });\n const GetTimersResponse = IDL.Record({ timers: IDL.Opt(Timers) });\n const GetUpgradeJournalRequest = IDL.Record({\n offset: IDL.Opt(IDL.Nat64),\n limit: IDL.Opt(IDL.Nat64),\n });\n const GetUpgradeJournalResponse = IDL.Record({\n upgrade_journal: IDL.Opt(UpgradeJournal),\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n deployed_version: IDL.Opt(Version),\n target_version: IDL.Opt(Version),\n upgrade_journal_entry_count: IDL.Opt(IDL.Nat64),\n });\n const ListNervousSystemFunctionsResponse = IDL.Record({\n reserved_ids: IDL.Vec(IDL.Nat64),\n functions: IDL.Vec(NervousSystemFunction),\n });\n const ListNeurons = IDL.Record({\n of_principal: IDL.Opt(IDL.Principal),\n limit: IDL.Nat32,\n start_page_at: IDL.Opt(NeuronId),\n });\n const ListNeuronsResponse = IDL.Record({ neurons: IDL.Vec(Neuron) });\n const TopicSelector = IDL.Record({ topic: IDL.Opt(Topic) });\n const ListProposals = IDL.Record({\n include_reward_status: IDL.Vec(IDL.Int32),\n before_proposal: IDL.Opt(ProposalId),\n limit: IDL.Nat32,\n exclude_type: IDL.Vec(IDL.Nat64),\n include_topics: IDL.Opt(IDL.Vec(TopicSelector)),\n include_status: IDL.Vec(IDL.Int32),\n });\n const ListProposalsResponse = IDL.Record({\n include_ballots_by_caller: IDL.Opt(IDL.Bool),\n proposals: IDL.Vec(ProposalData),\n include_topic_filtering: IDL.Opt(IDL.Bool),\n });\n const ListTopicsRequest = IDL.Record({});\n const ExtensionOperationType = IDL.Variant({\n TreasuryManagerWithdraw: IDL.Null,\n TreasuryManagerDeposit: IDL.Null,\n });\n const ExtensionType = IDL.Variant({ TreasuryManager: IDL.Null });\n const ExtensionOperationSpec = IDL.Record({\n topic: IDL.Opt(Topic),\n operation_type: IDL.Opt(ExtensionOperationType),\n description: IDL.Opt(IDL.Text),\n extension_type: IDL.Opt(ExtensionType),\n });\n const RegisteredExtensionOperationSpec = IDL.Record({\n spec: IDL.Opt(ExtensionOperationSpec),\n canister_id: IDL.Opt(IDL.Principal),\n });\n const TopicInfo = IDL.Record({\n extension_operations: IDL.Opt(IDL.Vec(RegisteredExtensionOperationSpec)),\n native_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n topic: IDL.Opt(Topic),\n is_critical: IDL.Opt(IDL.Bool),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n custom_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n });\n const ListTopicsResponse = IDL.Record({\n uncategorized_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n topics: IDL.Opt(IDL.Vec(TopicInfo)),\n });\n const StakeMaturity = IDL.Record({\n percentage_to_stake: IDL.Opt(IDL.Nat32),\n });\n const Command = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n ClaimOrRefresh: ClaimOrRefresh,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n MakeProposal: Proposal,\n StakeMaturity: StakeMaturity,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const ManageNeuron = IDL.Record({\n subaccount: IDL.Vec(IDL.Nat8),\n command: IDL.Opt(Command),\n });\n const SplitResponse = IDL.Record({ created_neuron_id: IDL.Opt(NeuronId) });\n const DisburseMaturityResponse = IDL.Record({\n amount_disbursed_e8s: IDL.Nat64,\n amount_deducted_e8s: IDL.Opt(IDL.Nat64),\n });\n const ClaimOrRefreshResponse = IDL.Record({\n refreshed_neuron_id: IDL.Opt(NeuronId),\n });\n const StakeMaturityResponse = IDL.Record({\n maturity_e8s: IDL.Nat64,\n staked_maturity_e8s: IDL.Nat64,\n });\n const MergeMaturityResponse = IDL.Record({\n merged_maturity_e8s: IDL.Nat64,\n new_stake_e8s: IDL.Nat64,\n });\n const DisburseResponse = IDL.Record({ transfer_block_height: IDL.Nat64 });\n const Command_1 = IDL.Variant({\n Error: GovernanceError,\n Split: SplitResponse,\n Follow: IDL.Record({}),\n DisburseMaturity: DisburseMaturityResponse,\n ClaimOrRefresh: ClaimOrRefreshResponse,\n Configure: IDL.Record({}),\n RegisterVote: IDL.Record({}),\n SetFollowing: IDL.Record({}),\n MakeProposal: GetProposal,\n RemoveNeuronPermission: IDL.Record({}),\n StakeMaturity: StakeMaturityResponse,\n MergeMaturity: MergeMaturityResponse,\n Disburse: DisburseResponse,\n AddNeuronPermission: IDL.Record({}),\n });\n const ManageNeuronResponse = IDL.Record({ command: IDL.Opt(Command_1) });\n const MintTokensRequest = IDL.Record({\n recipient: IDL.Opt(Account),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const SetMode = IDL.Record({ mode: IDL.Int32 });\n\n return IDL.Service({\n add_maturity: IDL.Func([AddMaturityRequest], [AddMaturityResponse], []),\n advance_target_version: IDL.Func(\n [AdvanceTargetVersionRequest],\n [AdvanceTargetVersionResponse],\n [],\n ),\n claim_swap_neurons: IDL.Func(\n [ClaimSwapNeuronsRequest],\n [ClaimSwapNeuronsResponse],\n [],\n ),\n fail_stuck_upgrade_in_progress: IDL.Func(\n [IDL.Record({})],\n [IDL.Record({})],\n [],\n ),\n get_build_metadata: IDL.Func([], [IDL.Text], [\"query\"]),\n get_latest_reward_event: IDL.Func([], [RewardEvent], [\"query\"]),\n get_maturity_modulation: IDL.Func(\n [IDL.Record({})],\n [GetMaturityModulationResponse],\n [],\n ),\n get_metadata: IDL.Func([IDL.Record({})], [GetMetadataResponse], [\"query\"]),\n get_metrics: IDL.Func(\n [GetMetricsRequest],\n [GetMetricsResponse],\n [\"composite_query\"],\n ),\n get_metrics_replicated: IDL.Func(\n [GetMetricsRequest],\n [GetMetricsResponse],\n [],\n ),\n get_mode: IDL.Func([IDL.Record({})], [GetModeResponse], [\"query\"]),\n get_nervous_system_parameters: IDL.Func(\n [IDL.Null],\n [NervousSystemParameters],\n [\"query\"],\n ),\n get_neuron: IDL.Func([GetNeuron], [GetNeuronResponse], [\"query\"]),\n get_proposal: IDL.Func([GetProposal], [GetProposalResponse], [\"query\"]),\n get_root_canister_status: IDL.Func(\n [IDL.Null],\n [CanisterStatusResultV2],\n [],\n ),\n get_running_sns_version: IDL.Func(\n [IDL.Record({})],\n [GetRunningSnsVersionResponse],\n [\"query\"],\n ),\n get_sns_initialization_parameters: IDL.Func(\n [IDL.Record({})],\n [GetSnsInitializationParametersResponse],\n [\"query\"],\n ),\n get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], [\"query\"]),\n get_upgrade_journal: IDL.Func(\n [GetUpgradeJournalRequest],\n [GetUpgradeJournalResponse],\n [\"query\"],\n ),\n list_nervous_system_functions: IDL.Func(\n [],\n [ListNervousSystemFunctionsResponse],\n [\"query\"],\n ),\n list_neurons: IDL.Func([ListNeurons], [ListNeuronsResponse], [\"query\"]),\n list_proposals: IDL.Func(\n [ListProposals],\n [ListProposalsResponse],\n [\"query\"],\n ),\n list_topics: IDL.Func([ListTopicsRequest], [ListTopicsResponse], [\"query\"]),\n manage_neuron: IDL.Func([ManageNeuron], [ManageNeuronResponse], []),\n mint_tokens: IDL.Func([MintTokensRequest], [IDL.Record({})], []),\n refresh_cached_upgrade_steps: IDL.Func(\n [IDL.Record({})],\n [IDL.Record({})],\n [],\n ),\n reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], []),\n set_mode: IDL.Func([SetMode], [IDL.Record({})], []),\n update_neuron: IDL.Func([Neuron], [IDL.Opt(GovernanceError)], []),\n });\n};\n\nexport const init = ({ IDL }) => {\n const PreciseValue = IDL.Rec();\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Version = IDL.Record({\n archive_wasm_hash: IDL.Vec(IDL.Nat8),\n root_wasm_hash: IDL.Vec(IDL.Nat8),\n swap_wasm_hash: IDL.Vec(IDL.Nat8),\n ledger_wasm_hash: IDL.Vec(IDL.Nat8),\n governance_wasm_hash: IDL.Vec(IDL.Nat8),\n index_wasm_hash: IDL.Vec(IDL.Nat8),\n });\n const Versions = IDL.Record({ versions: IDL.Vec(Version) });\n const CachedUpgradeSteps = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requested_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Topic = IDL.Variant({\n DappCanisterManagement: IDL.Null,\n DaoCommunitySettings: IDL.Null,\n ApplicationBusinessLogic: IDL.Null,\n CriticalDappOperations: IDL.Null,\n TreasuryAssetManagement: IDL.Null,\n Governance: IDL.Null,\n SnsFrameworkManagement: IDL.Null,\n });\n const GenericNervousSystemFunction = IDL.Record({\n topic: IDL.Opt(Topic),\n validator_canister_id: IDL.Opt(IDL.Principal),\n target_canister_id: IDL.Opt(IDL.Principal),\n validator_method_name: IDL.Opt(IDL.Text),\n target_method_name: IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n NativeNervousSystemFunction: IDL.Record({}),\n GenericNervousSystemFunction: GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n id: IDL.Nat64,\n name: IDL.Text,\n description: IDL.Opt(IDL.Text),\n function_type: IDL.Opt(FunctionType),\n });\n const Subaccount = IDL.Record({ subaccount: IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n owner: IDL.Opt(IDL.Principal),\n subaccount: IDL.Opt(Subaccount),\n });\n const TreasuryMetrics = IDL.Record({\n name: IDL.Opt(IDL.Text),\n original_amount_e8s: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n account: IDL.Opt(Account),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n treasury: IDL.Int32,\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const VotingPowerMetrics = IDL.Record({\n governance_total_potential_voting_power: IDL.Opt(IDL.Nat64),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GovernanceCachedMetrics = IDL.Record({\n treasury_metrics: IDL.Vec(TreasuryMetrics),\n not_dissolving_neurons_e8s_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64),\n ),\n garbage_collectable_neurons_count: IDL.Nat64,\n neurons_with_invalid_stake_count: IDL.Nat64,\n not_dissolving_neurons_count_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64),\n ),\n neurons_with_less_than_6_months_dissolve_delay_count: IDL.Nat64,\n dissolved_neurons_count: IDL.Nat64,\n total_staked_e8s: IDL.Nat64,\n total_supply_governance_tokens: IDL.Nat64,\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n not_dissolving_neurons_count: IDL.Nat64,\n dissolved_neurons_e8s: IDL.Nat64,\n neurons_with_less_than_6_months_dissolve_delay_e8s: IDL.Nat64,\n dissolving_neurons_count_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Nat64)),\n dissolving_neurons_count: IDL.Nat64,\n dissolving_neurons_e8s_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Float64)),\n timestamp_seconds: IDL.Nat64,\n });\n const MaturityModulation = IDL.Record({\n current_basis_points: IDL.Opt(IDL.Int32),\n updated_at_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const TargetVersionSet = IDL.Record({\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n is_advanced_automatically: IDL.Opt(IDL.Bool),\n });\n const UpgradeStepsReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n upgrade_steps: IDL.Opt(Versions),\n });\n const UpgradeOutcome = IDL.Record({\n status: IDL.Opt(\n IDL.Variant({\n Success: IDL.Record({}),\n Timeout: IDL.Record({}),\n ExternalFailure: IDL.Record({}),\n InvalidState: IDL.Record({ version: IDL.Opt(Version) }),\n }),\n ),\n human_readable: IDL.Opt(IDL.Text),\n });\n const ProposalId = IDL.Record({ id: IDL.Nat64 });\n const UpgradeStarted = IDL.Record({\n current_version: IDL.Opt(Version),\n expected_version: IDL.Opt(Version),\n reason: IDL.Opt(\n IDL.Variant({\n UpgradeSnsToNextVersionProposal: ProposalId,\n BehindTargetVersion: IDL.Record({}),\n }),\n ),\n });\n const UpgradeStepsRefreshed = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n });\n const TargetVersionReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n });\n const UpgradeJournalEntry = IDL.Record({\n event: IDL.Opt(\n IDL.Variant({\n TargetVersionSet: TargetVersionSet,\n UpgradeStepsReset: UpgradeStepsReset,\n UpgradeOutcome: UpgradeOutcome,\n UpgradeStarted: UpgradeStarted,\n UpgradeStepsRefreshed: UpgradeStepsRefreshed,\n TargetVersionReset: TargetVersionReset,\n }),\n ),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const UpgradeJournal = IDL.Record({\n entries: IDL.Vec(UpgradeJournalEntry),\n });\n const NeuronId = IDL.Record({ id: IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ followees: IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n permissions: IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n final_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n reward_rate_transition_duration_seconds: IDL.Opt(IDL.Nat64),\n round_duration_seconds: IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n default_followees: IDL.Opt(DefaultFollowees),\n max_dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n max_dissolve_delay_bonus_percentage: IDL.Opt(IDL.Nat64),\n max_followees_per_function: IDL.Opt(IDL.Nat64),\n automatically_advance_target_version: IDL.Opt(IDL.Bool),\n neuron_claimer_permissions: IDL.Opt(NeuronPermissionList),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n max_neuron_age_for_age_bonus: IDL.Opt(IDL.Nat64),\n initial_voting_period_seconds: IDL.Opt(IDL.Nat64),\n neuron_minimum_dissolve_delay_to_vote_seconds: IDL.Opt(IDL.Nat64),\n reject_cost_e8s: IDL.Opt(IDL.Nat64),\n max_proposals_to_keep_per_action: IDL.Opt(IDL.Nat32),\n wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64),\n max_number_of_neurons: IDL.Opt(IDL.Nat64),\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64),\n max_age_bonus_percentage: IDL.Opt(IDL.Nat64),\n neuron_grantable_permissions: IDL.Opt(NeuronPermissionList),\n voting_rewards_parameters: IDL.Opt(VotingRewardsParameters),\n maturity_modulation_disabled: IDL.Opt(IDL.Bool),\n max_number_of_principals_per_neuron: IDL.Opt(IDL.Nat64),\n });\n const RewardEvent = IDL.Record({\n rounds_since_last_distribution: IDL.Opt(IDL.Nat64),\n actual_timestamp_seconds: IDL.Nat64,\n end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n total_available_e8s_equivalent: IDL.Opt(IDL.Nat64),\n distributed_e8s_equivalent: IDL.Nat64,\n round: IDL.Nat64,\n settled_proposals: IDL.Vec(ProposalId),\n });\n const PendingVersion = IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Opt(IDL.Nat64),\n target_version: IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n error_message: IDL.Text,\n error_type: IDL.Int32,\n });\n const Decimal = IDL.Record({ human_readable: IDL.Opt(IDL.Text) });\n const Tokens = IDL.Record({ e8s: IDL.Opt(IDL.Nat64) });\n const ValuationFactors = IDL.Record({\n xdrs_per_icp: IDL.Opt(Decimal),\n icps_per_token: IDL.Opt(Decimal),\n tokens: IDL.Opt(Tokens),\n });\n const Valuation = IDL.Record({\n token: IDL.Opt(IDL.Int32),\n account: IDL.Opt(Account),\n valuation_factors: IDL.Opt(ValuationFactors),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const MintSnsTokensActionAuxiliary = IDL.Record({\n valuation: IDL.Opt(Valuation),\n });\n const SnsVersion = IDL.Record({\n archive_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n root_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n swap_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n ledger_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n governance_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n index_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const AdvanceSnsTargetVersionActionAuxiliary = IDL.Record({\n target_version: IDL.Opt(SnsVersion),\n });\n const ActionAuxiliary = IDL.Variant({\n TransferSnsTreasuryFunds: MintSnsTokensActionAuxiliary,\n MintSnsTokens: MintSnsTokensActionAuxiliary,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersionActionAuxiliary,\n });\n const Ballot = IDL.Record({\n vote: IDL.Int32,\n cast_timestamp_seconds: IDL.Nat64,\n voting_power: IDL.Nat64,\n });\n const Percentage = IDL.Record({ basis_points: IDL.Opt(IDL.Nat64) });\n const Tally = IDL.Record({\n no: IDL.Nat64,\n yes: IDL.Nat64,\n total: IDL.Nat64,\n timestamp_seconds: IDL.Nat64,\n });\n const ManageDappCanisterSettings = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat64),\n wasm_memory_threshold: IDL.Opt(IDL.Nat64),\n canister_ids: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat64),\n log_visibility: IDL.Opt(IDL.Int32),\n wasm_memory_limit: IDL.Opt(IDL.Nat64),\n memory_allocation: IDL.Opt(IDL.Nat64),\n compute_allocation: IDL.Opt(IDL.Nat64),\n });\n PreciseValue.fill(\n IDL.Variant({\n Int: IDL.Int64,\n Map: IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),\n Nat: IDL.Nat64,\n Blob: IDL.Vec(IDL.Nat8),\n Bool: IDL.Bool,\n Text: IDL.Text,\n Array: IDL.Vec(PreciseValue),\n }),\n );\n const ExtensionOperationArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const ExecuteExtensionOperation = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n operation_name: IDL.Opt(IDL.Text),\n operation_arg: IDL.Opt(ExtensionOperationArg),\n });\n const ChunkedCanisterWasm = IDL.Record({\n wasm_module_hash: IDL.Vec(IDL.Nat8),\n chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),\n store_canister_id: IDL.Opt(IDL.Principal),\n });\n const Wasm = IDL.Variant({\n Chunked: ChunkedCanisterWasm,\n Bytes: IDL.Vec(IDL.Nat8),\n });\n const ExtensionUpgradeArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const UpgradeExtension = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n wasm: IDL.Opt(Wasm),\n canister_upgrade_arg: IDL.Opt(ExtensionUpgradeArg),\n });\n const SetTopicsForCustomProposals = IDL.Record({\n custom_function_id_to_topic: IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),\n });\n const ExtensionInit = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const RegisterExtension = IDL.Record({\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n extension_init: IDL.Opt(ExtensionInit),\n });\n const RegisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n });\n const TransferSnsTreasuryFunds = IDL.Record({\n from_treasury: IDL.Int32,\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n new_canister_wasm: IDL.Vec(IDL.Nat8),\n mode: IDL.Opt(IDL.Int32),\n canister_id: IDL.Opt(IDL.Principal),\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n canister_upgrade_arg: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const DeregisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n new_controllers: IDL.Vec(IDL.Principal),\n });\n const MintSnsTokens = IDL.Record({\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const AdvanceSnsTargetVersion = IDL.Record({\n new_target: IDL.Opt(SnsVersion),\n });\n const ManageSnsMetadata = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n function_id: IDL.Nat64,\n payload: IDL.Vec(IDL.Nat8),\n });\n const ManageLedgerParameters = IDL.Record({\n token_symbol: IDL.Opt(IDL.Text),\n transfer_fee: IDL.Opt(IDL.Nat64),\n token_logo: IDL.Opt(IDL.Text),\n token_name: IDL.Opt(IDL.Text),\n });\n const Motion = IDL.Record({ motion_text: IDL.Text });\n const Action = IDL.Variant({\n ManageNervousSystemParameters: NervousSystemParameters,\n AddGenericNervousSystemFunction: NervousSystemFunction,\n ManageDappCanisterSettings: ManageDappCanisterSettings,\n ExecuteExtensionOperation: ExecuteExtensionOperation,\n UpgradeExtension: UpgradeExtension,\n RemoveGenericNervousSystemFunction: IDL.Nat64,\n SetTopicsForCustomProposals: SetTopicsForCustomProposals,\n RegisterExtension: RegisterExtension,\n UpgradeSnsToNextVersion: IDL.Record({}),\n RegisterDappCanisters: RegisterDappCanisters,\n TransferSnsTreasuryFunds: TransferSnsTreasuryFunds,\n UpgradeSnsControlledCanister: UpgradeSnsControlledCanister,\n DeregisterDappCanisters: DeregisterDappCanisters,\n MintSnsTokens: MintSnsTokens,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersion,\n Unspecified: IDL.Record({}),\n ManageSnsMetadata: ManageSnsMetadata,\n ExecuteGenericNervousSystemFunction: ExecuteGenericNervousSystemFunction,\n ManageLedgerParameters: ManageLedgerParameters,\n Motion: Motion,\n });\n const Proposal = IDL.Record({\n url: IDL.Text,\n title: IDL.Text,\n action: IDL.Opt(Action),\n summary: IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n current_deadline_timestamp_seconds: IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n id: IDL.Opt(ProposalId),\n payload_text_rendering: IDL.Opt(IDL.Text),\n topic: IDL.Opt(Topic),\n action: IDL.Nat64,\n failure_reason: IDL.Opt(GovernanceError),\n action_auxiliary: IDL.Opt(ActionAuxiliary),\n ballots: IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n minimum_yes_proportion_of_total: IDL.Opt(Percentage),\n reward_event_round: IDL.Nat64,\n failed_timestamp_seconds: IDL.Nat64,\n reward_event_end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n proposal_creation_timestamp_seconds: IDL.Nat64,\n initial_voting_period_seconds: IDL.Nat64,\n reject_cost_e8s: IDL.Nat64,\n latest_tally: IDL.Opt(Tally),\n wait_for_quiet_deadline_increase_seconds: IDL.Nat64,\n decided_timestamp_seconds: IDL.Nat64,\n proposal: IDL.Opt(Proposal),\n proposer: IDL.Opt(NeuronId),\n wait_for_quiet_state: IDL.Opt(WaitForQuietState),\n minimum_yes_proportion_of_exercised: IDL.Opt(Percentage),\n is_eligible_for_rewards: IDL.Bool,\n executed_timestamp_seconds: IDL.Nat64,\n });\n const Split = IDL.Record({ memo: IDL.Nat64, amount_e8s: IDL.Nat64 });\n const Follow = IDL.Record({\n function_id: IDL.Nat64,\n followees: IDL.Vec(NeuronId),\n });\n const DisburseMaturity = IDL.Record({\n to_account: IDL.Opt(Account),\n percentage_to_disburse: IDL.Nat32,\n });\n const ChangeAutoStakeMaturity = IDL.Record({\n requested_setting_for_auto_stake_maturity: IDL.Bool,\n });\n const IncreaseDissolveDelay = IDL.Record({\n additional_dissolve_delay_seconds: IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n dissolve_timestamp_seconds: IDL.Nat64,\n });\n const Operation = IDL.Variant({\n ChangeAutoStakeMaturity: ChangeAutoStakeMaturity,\n StopDissolving: IDL.Record({}),\n StartDissolving: IDL.Record({}),\n IncreaseDissolveDelay: IncreaseDissolveDelay,\n SetDissolveTimestamp: SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ operation: IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n vote: IDL.Int32,\n proposal: IDL.Opt(ProposalId),\n });\n const Followee = IDL.Record({\n alias: IDL.Opt(IDL.Text),\n neuron_id: IDL.Opt(NeuronId),\n });\n const FolloweesForTopic = IDL.Record({\n topic: IDL.Opt(Topic),\n followees: IDL.Vec(Followee),\n });\n const SetFollowing = IDL.Record({\n topic_following: IDL.Vec(FolloweesForTopic),\n });\n const FinalizeDisburseMaturity = IDL.Record({\n amount_to_be_disbursed_e8s: IDL.Nat64,\n to_account: IDL.Opt(Account),\n });\n const MemoAndController = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n memo: IDL.Nat64,\n });\n const By = IDL.Variant({\n MemoAndController: MemoAndController,\n NeuronId: IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ by: IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n permissions_to_remove: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n permissions_to_add: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ percentage_to_merge: IDL.Nat32 });\n const Amount = IDL.Record({ e8s: IDL.Nat64 });\n const Disburse = IDL.Record({\n to_account: IDL.Opt(Account),\n amount: IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n SyncCommand: IDL.Record({}),\n MakeProposal: Proposal,\n FinalizeDisburseMaturity: FinalizeDisburseMaturity,\n ClaimOrRefreshNeuron: ClaimOrRefresh,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n command: IDL.Opt(Command_2),\n timestamp: IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n principal: IDL.Opt(IDL.Principal),\n permission_type: IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n DissolveDelaySeconds: IDL.Nat64,\n WhenDissolvedTimestampSeconds: IDL.Nat64,\n });\n const DisburseMaturityInProgress = IDL.Record({\n timestamp_of_disbursement_seconds: IDL.Nat64,\n amount_e8s: IDL.Nat64,\n account_to_disburse_to: IDL.Opt(Account),\n finalize_disbursement_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Neuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n staked_maturity_e8s_equivalent: IDL.Opt(IDL.Nat64),\n permissions: IDL.Vec(NeuronPermission),\n maturity_e8s_equivalent: IDL.Nat64,\n cached_neuron_stake_e8s: IDL.Nat64,\n created_timestamp_seconds: IDL.Nat64,\n topic_followees: IDL.Opt(\n IDL.Record({\n topic_id_to_followees: IDL.Vec(IDL.Tuple(IDL.Int32, FolloweesForTopic)),\n }),\n ),\n source_nns_neuron_id: IDL.Opt(IDL.Nat64),\n auto_stake_maturity: IDL.Opt(IDL.Bool),\n aging_since_timestamp_seconds: IDL.Nat64,\n dissolve_state: IDL.Opt(DissolveState),\n voting_power_percentage_multiplier: IDL.Nat64,\n vesting_period_seconds: IDL.Opt(IDL.Nat64),\n disburse_maturity_in_progress: IDL.Vec(DisburseMaturityInProgress),\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n neuron_fees_e8s: IDL.Nat64,\n });\n const Governance = IDL.Record({\n root_canister_id: IDL.Opt(IDL.Principal),\n timers: IDL.Opt(Timers),\n cached_upgrade_steps: IDL.Opt(CachedUpgradeSteps),\n id_to_nervous_system_functions: IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction),\n ),\n metrics: IDL.Opt(GovernanceCachedMetrics),\n maturity_modulation: IDL.Opt(MaturityModulation),\n upgrade_journal: IDL.Opt(UpgradeJournal),\n mode: IDL.Int32,\n parameters: IDL.Opt(NervousSystemParameters),\n is_finalizing_disburse_maturity: IDL.Opt(IDL.Bool),\n deployed_version: IDL.Opt(Version),\n sns_initialization_parameters: IDL.Text,\n latest_reward_event: IDL.Opt(RewardEvent),\n pending_version: IDL.Opt(PendingVersion),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n proposals: IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n in_flight_commands: IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n sns_metadata: IDL.Opt(ManageSnsMetadata),\n neurons: IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n target_version: IDL.Opt(Version),\n genesis_timestamp_seconds: IDL.Nat64,\n });\n\n return [Governance];\n};\n", "import { Canister, createServices } from \"@dfinity/utils\";\nimport type {\n ListSnsCanistersResponse,\n _SERVICE as SnsRootService,\n} from \"./candid/sns_root\";\nimport { idlFactory as certifiedIdlFactory } from \"./candid/sns_root.certified.idl\";\nimport { idlFactory } from \"./candid/sns_root.idl\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\n\nexport class SnsRootCanister extends Canister<SnsRootService> {\n static create(options: SnsCanisterOptions<SnsRootService>) {\n const { service, certifiedService, canisterId } =\n createServices<SnsRootService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new SnsRootCanister(canisterId, service, certifiedService);\n }\n\n /**\n * List the canisters that are part of the Sns.\n *\n * Source code: https://github.com/dfinity/ic/blob/master/rs/sns/root/src/lib.rs\n *\n * @param {Object} params\n * @param {boolean} [params.certified=true] - Query or update calls\n *\n * @returns {ListSnsCanistersResponse} - A list of canisters ('root' | 'governance' | 'ledger' | 'dapps' | 'swap' | 'archives')\n */\n listSnsCanisters = ({\n certified = true,\n }: {\n certified?: boolean;\n }): Promise<ListSnsCanistersResponse> =>\n this.caller({ certified }).list_sns_canisters({});\n}\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.0-patch-typed-arrays.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({ IDL }) => {\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Extensions = IDL.Record({\n extension_canister_ids: IDL.Vec(IDL.Principal),\n });\n const SnsRootCanister = IDL.Record({\n dapp_canister_ids: IDL.Vec(IDL.Principal),\n timers: IDL.Opt(Timers),\n testflight: IDL.Bool,\n extensions: IDL.Opt(Extensions),\n archive_canister_ids: IDL.Vec(IDL.Principal),\n governance_canister_id: IDL.Opt(IDL.Principal),\n index_canister_id: IDL.Opt(IDL.Principal),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n });\n const CanisterIdRecord = IDL.Record({ canister_id: IDL.Principal });\n const MemoryMetrics = IDL.Record({\n wasm_binary_size: IDL.Opt(IDL.Nat),\n wasm_chunk_store_size: IDL.Opt(IDL.Nat),\n canister_history_size: IDL.Opt(IDL.Nat),\n stable_memory_size: IDL.Opt(IDL.Nat),\n snapshots_size: IDL.Opt(IDL.Nat),\n wasm_memory_size: IDL.Opt(IDL.Nat),\n global_memory_size: IDL.Opt(IDL.Nat),\n custom_sections_size: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusType = IDL.Variant({\n stopped: IDL.Null,\n stopping: IDL.Null,\n running: IDL.Null,\n });\n const LogVisibility = IDL.Variant({\n controllers: IDL.Null,\n public: IDL.Null,\n allowed_viewers: IDL.Vec(IDL.Principal),\n });\n const DefiniteCanisterSettings = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat),\n wasm_memory_threshold: IDL.Opt(IDL.Nat),\n controllers: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat),\n log_visibility: IDL.Opt(LogVisibility),\n wasm_memory_limit: IDL.Opt(IDL.Nat),\n memory_allocation: IDL.Opt(IDL.Nat),\n compute_allocation: IDL.Opt(IDL.Nat),\n });\n const QueryStats = IDL.Record({\n response_payload_bytes_total: IDL.Opt(IDL.Nat),\n num_instructions_total: IDL.Opt(IDL.Nat),\n num_calls_total: IDL.Opt(IDL.Nat),\n request_payload_bytes_total: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusResult = IDL.Record({\n memory_metrics: IDL.Opt(MemoryMetrics),\n status: CanisterStatusType,\n memory_size: IDL.Nat,\n cycles: IDL.Nat,\n settings: DefiniteCanisterSettings,\n query_stats: IDL.Opt(QueryStats),\n idle_cycles_burned_per_day: IDL.Opt(IDL.Nat),\n module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n reserved_cycles: IDL.Opt(IDL.Nat),\n });\n const CanisterInstallMode = IDL.Variant({\n reinstall: IDL.Null,\n upgrade: IDL.Null,\n install: IDL.Null,\n });\n const ChunkedCanisterWasm = IDL.Record({\n wasm_module_hash: IDL.Vec(IDL.Nat8),\n chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),\n store_canister_id: IDL.Principal,\n });\n const ChangeCanisterRequest = IDL.Record({\n arg: IDL.Vec(IDL.Nat8),\n wasm_module: IDL.Vec(IDL.Nat8),\n stop_before_installing: IDL.Bool,\n mode: CanisterInstallMode,\n canister_id: IDL.Principal,\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n });\n const GetSnsCanistersSummaryRequest = IDL.Record({\n update_canister_list: IDL.Opt(IDL.Bool),\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n freezing_threshold: IDL.Nat,\n wasm_memory_threshold: IDL.Opt(IDL.Nat),\n controllers: IDL.Vec(IDL.Principal),\n wasm_memory_limit: IDL.Opt(IDL.Nat),\n memory_allocation: IDL.Nat,\n compute_allocation: IDL.Nat,\n });\n const CanisterStatusResultV2 = IDL.Record({\n memory_metrics: IDL.Opt(MemoryMetrics),\n status: CanisterStatusType,\n memory_size: IDL.Nat,\n cycles: IDL.Nat,\n settings: DefiniteCanisterSettingsArgs,\n query_stats: IDL.Opt(QueryStats),\n idle_cycles_burned_per_day: IDL.Nat,\n module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const CanisterSummary = IDL.Record({\n status: IDL.Opt(CanisterStatusResultV2),\n canister_id: IDL.Opt(IDL.Principal),\n });\n const GetSnsCanistersSummaryResponse = IDL.Record({\n root: IDL.Opt(CanisterSummary),\n swap: IDL.Opt(CanisterSummary),\n ledger: IDL.Opt(CanisterSummary),\n index: IDL.Opt(CanisterSummary),\n governance: IDL.Opt(CanisterSummary),\n dapps: IDL.Vec(CanisterSummary),\n archives: IDL.Vec(CanisterSummary),\n });\n const GetTimersResponse = IDL.Record({ timers: IDL.Opt(Timers) });\n const ListSnsCanistersResponse = IDL.Record({\n root: IDL.Opt(IDL.Principal),\n swap: IDL.Opt(IDL.Principal),\n extensions: IDL.Opt(Extensions),\n ledger: IDL.Opt(IDL.Principal),\n index: IDL.Opt(IDL.Principal),\n governance: IDL.Opt(IDL.Principal),\n dapps: IDL.Vec(IDL.Principal),\n archives: IDL.Vec(IDL.Principal),\n });\n const ManageDappCanisterSettingsRequest = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat64),\n wasm_memory_threshold: IDL.Opt(IDL.Nat64),\n canister_ids: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat64),\n log_visibility: IDL.Opt(IDL.Int32),\n wasm_memory_limit: IDL.Opt(IDL.Nat64),\n memory_allocation: IDL.Opt(IDL.Nat64),\n compute_allocation: IDL.Opt(IDL.Nat64),\n });\n const ManageDappCanisterSettingsResponse = IDL.Record({\n failure_reason: IDL.Opt(IDL.Text),\n });\n const RegisterDappCanisterRequest = IDL.Record({\n canister_id: IDL.Opt(IDL.Principal),\n });\n const RegisterDappCanistersRequest = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n });\n const RegisterExtensionRequest = IDL.Record({\n canister_id: IDL.Opt(IDL.Principal),\n });\n const CanisterCallError = IDL.Record({\n code: IDL.Opt(IDL.Int32),\n description: IDL.Text,\n });\n const RegisterExtensionResult = IDL.Variant({\n Ok: IDL.Record({}),\n Err: CanisterCallError,\n });\n const RegisterExtensionResponse = IDL.Record({\n result: IDL.Opt(RegisterExtensionResult),\n });\n const SetDappControllersRequest = IDL.Record({\n canister_ids: IDL.Opt(RegisterDappCanistersRequest),\n controller_principal_ids: IDL.Vec(IDL.Principal),\n });\n const FailedUpdate = IDL.Record({\n err: IDL.Opt(CanisterCallError),\n dapp_canister_id: IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n failed_updates: IDL.Vec(FailedUpdate),\n });\n\n return IDL.Service({\n canister_status: IDL.Func([CanisterIdRecord], [CanisterStatusResult], []),\n change_canister: IDL.Func([ChangeCanisterRequest], [], []),\n get_build_metadata: IDL.Func([], [IDL.Text], []),\n get_sns_canisters_summary: IDL.Func(\n [GetSnsCanistersSummaryRequest],\n [GetSnsCanistersSummaryResponse],\n [],\n ),\n get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], []),\n list_sns_canisters: IDL.Func(\n [IDL.Record({})],\n [ListSnsCanistersResponse],\n [],\n ),\n manage_dapp_canister_settings: IDL.Func(\n [ManageDappCanisterSettingsRequest],\n [ManageDappCanisterSettingsResponse],\n [],\n ),\n register_dapp_canister: IDL.Func(\n [RegisterDappCanisterRequest],\n [IDL.Record({})],\n [],\n ),\n register_dapp_canisters: IDL.Func(\n [RegisterDappCanistersRequest],\n [IDL.Record({})],\n [],\n ),\n register_extension: IDL.Func(\n [RegisterExtensionRequest],\n [RegisterExtensionResponse],\n [],\n ),\n reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], []),\n set_dapp_controllers: IDL.Func(\n [SetDappControllersRequest],\n [SetDappControllersResponse],\n [],\n ),\n });\n};\n\nexport const init = ({ IDL }) => {\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Extensions = IDL.Record({\n extension_canister_ids: IDL.Vec(IDL.Principal),\n });\n const SnsRootCanister = IDL.Record({\n dapp_canister_ids: IDL.Vec(IDL.Principal),\n timers: IDL.Opt(Timers),\n testflight: IDL.Bool,\n extensions: IDL.Opt(Extensions),\n archive_canister_ids: IDL.Vec(IDL.Principal),\n governance_canister_id: IDL.Opt(IDL.Principal),\n index_canister_id: IDL.Opt(IDL.Principal),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n });\n\n return [SnsRootCanister];\n};\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.0-patch-typed-arrays.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({ IDL }) => {\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Extensions = IDL.Record({\n extension_canister_ids: IDL.Vec(IDL.Principal),\n });\n const SnsRootCanister = IDL.Record({\n dapp_canister_ids: IDL.Vec(IDL.Principal),\n timers: IDL.Opt(Timers),\n testflight: IDL.Bool,\n extensions: IDL.Opt(Extensions),\n archive_canister_ids: IDL.Vec(IDL.Principal),\n governance_canister_id: IDL.Opt(IDL.Principal),\n index_canister_id: IDL.Opt(IDL.Principal),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n });\n const CanisterIdRecord = IDL.Record({ canister_id: IDL.Principal });\n const MemoryMetrics = IDL.Record({\n wasm_binary_size: IDL.Opt(IDL.Nat),\n wasm_chunk_store_size: IDL.Opt(IDL.Nat),\n canister_history_size: IDL.Opt(IDL.Nat),\n stable_memory_size: IDL.Opt(IDL.Nat),\n snapshots_size: IDL.Opt(IDL.Nat),\n wasm_memory_size: IDL.Opt(IDL.Nat),\n global_memory_size: IDL.Opt(IDL.Nat),\n custom_sections_size: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusType = IDL.Variant({\n stopped: IDL.Null,\n stopping: IDL.Null,\n running: IDL.Null,\n });\n const LogVisibility = IDL.Variant({\n controllers: IDL.Null,\n public: IDL.Null,\n allowed_viewers: IDL.Vec(IDL.Principal),\n });\n const DefiniteCanisterSettings = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat),\n wasm_memory_threshold: IDL.Opt(IDL.Nat),\n controllers: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat),\n log_visibility: IDL.Opt(LogVisibility),\n wasm_memory_limit: IDL.Opt(IDL.Nat),\n memory_allocation: IDL.Opt(IDL.Nat),\n compute_allocation: IDL.Opt(IDL.Nat),\n });\n const QueryStats = IDL.Record({\n response_payload_bytes_total: IDL.Opt(IDL.Nat),\n num_instructions_total: IDL.Opt(IDL.Nat),\n num_calls_total: IDL.Opt(IDL.Nat),\n request_payload_bytes_total: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusResult = IDL.Record({\n memory_metrics: IDL.Opt(MemoryMetrics),\n status: CanisterStatusType,\n memory_size: IDL.Nat,\n cycles: IDL.Nat,\n settings: DefiniteCanisterSettings,\n query_stats: IDL.Opt(QueryStats),\n idle_cycles_burned_per_day: IDL.Opt(IDL.Nat),\n module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n reserved_cycles: IDL.Opt(IDL.Nat),\n });\n const CanisterInstallMode = IDL.Variant({\n reinstall: IDL.Null,\n upgrade: IDL.Null,\n install: IDL.Null,\n });\n const ChunkedCanisterWasm = IDL.Record({\n wasm_module_hash: IDL.Vec(IDL.Nat8),\n chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),\n store_canister_id: IDL.Principal,\n });\n const ChangeCanisterRequest = IDL.Record({\n arg: IDL.Vec(IDL.Nat8),\n wasm_module: IDL.Vec(IDL.Nat8),\n stop_before_installing: IDL.Bool,\n mode: CanisterInstallMode,\n canister_id: IDL.Principal,\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n });\n const GetSnsCanistersSummaryRequest = IDL.Record({\n update_canister_list: IDL.Opt(IDL.Bool),\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n freezing_threshold: IDL.Nat,\n wasm_memory_threshold: IDL.Opt(IDL.Nat),\n controllers: IDL.Vec(IDL.Principal),\n wasm_memory_limit: IDL.Opt(IDL.Nat),\n memory_allocation: IDL.Nat,\n compute_allocation: IDL.Nat,\n });\n const CanisterStatusResultV2 = IDL.Record({\n memory_metrics: IDL.Opt(MemoryMetrics),\n status: CanisterStatusType,\n memory_size: IDL.Nat,\n cycles: IDL.Nat,\n settings: DefiniteCanisterSettingsArgs,\n query_stats: IDL.Opt(QueryStats),\n idle_cycles_burned_per_day: IDL.Nat,\n module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const CanisterSummary = IDL.Record({\n status: IDL.Opt(CanisterStatusResultV2),\n canister_id: IDL.Opt(IDL.Principal),\n });\n const GetSnsCanistersSummaryResponse = IDL.Record({\n root: IDL.Opt(CanisterSummary),\n swap: IDL.Opt(CanisterSummary),\n ledger: IDL.Opt(CanisterSummary),\n index: IDL.Opt(CanisterSummary),\n governance: IDL.Opt(CanisterSummary),\n dapps: IDL.Vec(CanisterSummary),\n archives: IDL.Vec(CanisterSummary),\n });\n const GetTimersResponse = IDL.Record({ timers: IDL.Opt(Timers) });\n const ListSnsCanistersResponse = IDL.Record({\n root: IDL.Opt(IDL.Principal),\n swap: IDL.Opt(IDL.Principal),\n extensions: IDL.Opt(Extensions),\n ledger: IDL.Opt(IDL.Principal),\n index: IDL.Opt(IDL.Principal),\n governance: IDL.Opt(IDL.Principal),\n dapps: IDL.Vec(IDL.Principal),\n archives: IDL.Vec(IDL.Principal),\n });\n const ManageDappCanisterSettingsRequest = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat64),\n wasm_memory_threshold: IDL.Opt(IDL.Nat64),\n canister_ids: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat64),\n log_visibility: IDL.Opt(IDL.Int32),\n wasm_memory_limit: IDL.Opt(IDL.Nat64),\n memory_allocation: IDL.Opt(IDL.Nat64),\n compute_allocation: IDL.Opt(IDL.Nat64),\n });\n const ManageDappCanisterSettingsResponse = IDL.Record({\n failure_reason: IDL.Opt(IDL.Text),\n });\n const RegisterDappCanisterRequest = IDL.Record({\n canister_id: IDL.Opt(IDL.Principal),\n });\n const RegisterDappCanistersRequest = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n });\n const RegisterExtensionRequest = IDL.Record({\n canister_id: IDL.Opt(IDL.Principal),\n });\n const CanisterCallError = IDL.Record({\n code: IDL.Opt(IDL.Int32),\n description: IDL.Text,\n });\n const RegisterExtensionResult = IDL.Variant({\n Ok: IDL.Record({}),\n Err: CanisterCallError,\n });\n const RegisterExtensionResponse = IDL.Record({\n result: IDL.Opt(RegisterExtensionResult),\n });\n const SetDappControllersRequest = IDL.Record({\n canister_ids: IDL.Opt(RegisterDappCanistersRequest),\n controller_principal_ids: IDL.Vec(IDL.Principal),\n });\n const FailedUpdate = IDL.Record({\n err: IDL.Opt(CanisterCallError),\n dapp_canister_id: IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n failed_updates: IDL.Vec(FailedUpdate),\n });\n\n return IDL.Service({\n canister_status: IDL.Func([CanisterIdRecord], [CanisterStatusResult], []),\n change_canister: IDL.Func([ChangeCanisterRequest], [], []),\n get_build_metadata: IDL.Func([], [IDL.Text], [\"query\"]),\n get_sns_canisters_summary: IDL.Func(\n [GetSnsCanistersSummaryRequest],\n [GetSnsCanistersSummaryResponse],\n [],\n ),\n get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], [\"query\"]),\n list_sns_canisters: IDL.Func(\n [IDL.Record({})],\n [ListSnsCanistersResponse],\n [\"query\"],\n ),\n manage_dapp_canister_settings: IDL.Func(\n [ManageDappCanisterSettingsRequest],\n [ManageDappCanisterSettingsResponse],\n [],\n ),\n register_dapp_canister: IDL.Func(\n [RegisterDappCanisterRequest],\n [IDL.Record({})],\n [],\n ),\n register_dapp_canisters: IDL.Func(\n [RegisterDappCanistersRequest],\n [IDL.Record({})],\n [],\n ),\n register_extension: IDL.Func(\n [RegisterExtensionRequest],\n [RegisterExtensionResponse],\n [],\n ),\n reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], []),\n set_dapp_controllers: IDL.Func(\n [SetDappControllersRequest],\n [SetDappControllersResponse],\n [],\n ),\n });\n};\n\nexport const init = ({ IDL }) => {\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Extensions = IDL.Record({\n extension_canister_ids: IDL.Vec(IDL.Principal),\n });\n const SnsRootCanister = IDL.Record({\n dapp_canister_ids: IDL.Vec(IDL.Principal),\n timers: IDL.Opt(Timers),\n testflight: IDL.Bool,\n extensions: IDL.Opt(Extensions),\n archive_canister_ids: IDL.Vec(IDL.Principal),\n governance_canister_id: IDL.Opt(IDL.Principal),\n index_canister_id: IDL.Opt(IDL.Principal),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n });\n\n return [SnsRootCanister];\n};\n", "import { IcrcIndexCanister, IcrcLedgerCanister } from \"@dfinity/ledger-icrc\";\nimport {\n assertNonNullish,\n fromNullable,\n type QueryParams,\n} from \"@dfinity/utils\";\nimport type { Agent } from \"@icp-sdk/core/agent\";\nimport type { Principal } from \"@icp-sdk/core/principal\";\nimport type {\n ListSnsCanistersResponse,\n _SERVICE as SnsRootService,\n} from \"./candid/sns_root\";\nimport { SnsGovernanceCanister } from \"./governance.canister\";\nimport { SnsRootCanister } from \"./root.canister\";\nimport { SnsWrapper } from \"./sns.wrapper\";\nimport { SnsSwapCanister } from \"./swap.canister\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\n\n/**\n * Options to discover and initialize all canisters of a Sns.\n */\nexport interface InitSnsCanistersOptions extends QueryParams {\n /** An agent that can be used to override the default agent. Useful to target another environment that mainnet. */\n agent?: Agent;\n /** The options that will be used to instantiate the actors of the root canister of the particular Sns. */\n rootOptions: Omit<SnsCanisterOptions<SnsRootService>, \"agent\">;\n}\n\nexport interface InitSnsWrapper {\n (options: InitSnsCanistersOptions): Promise<SnsWrapper>;\n}\n\n/**\n * Lookup for the canister ids of a Sns and initialize the wrapper to access its features.\n */\nexport const initSnsWrapper: InitSnsWrapper = async ({\n agent,\n rootOptions,\n certified = true,\n}: InitSnsCanistersOptions): Promise<SnsWrapper> => {\n const rootCanister: SnsRootCanister = SnsRootCanister.create({\n ...rootOptions,\n agent,\n });\n\n const { ledger, swap, governance, index }: ListSnsCanistersResponse =\n await rootCanister.listSnsCanisters({ certified });\n\n const governanceCanisterId: Principal | undefined = fromNullable(governance);\n const ledgerCanisterId: Principal | undefined = fromNullable(ledger);\n const swapCanisterId: Principal | undefined = fromNullable(swap);\n const indexCanisterId: Principal | undefined = fromNullable(index);\n\n assertNonNullish(governanceCanisterId);\n assertNonNullish(ledgerCanisterId);\n assertNonNullish(swapCanisterId);\n assertNonNullish(indexCanisterId);\n\n return new SnsWrapper({\n root: rootCanister,\n governance: SnsGovernanceCanister.create({\n canisterId: governanceCanisterId,\n agent,\n }),\n ledger: IcrcLedgerCanister.create({ canisterId: ledgerCanisterId, agent }),\n swap: SnsSwapCanister.create({ canisterId: swapCanisterId, agent }),\n index: IcrcIndexCanister.create({ canisterId: indexCanisterId, agent }),\n certified,\n });\n};\n", "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 {\n bigIntToUint8Array,\n toNullable,\n type QueryParams,\n} from \"@dfinity/utils\";\nimport type { Principal } from \"@icp-sdk/core/principal\";\nimport type {\n GetMetadataResponse,\n ListNervousSystemFunctionsResponse,\n ListProposalsResponse,\n NervousSystemParameters,\n Neuron,\n NeuronId,\n ProposalData,\n} from \"./candid/sns_governance\";\nimport type {\n BuyerState,\n GetAutoFinalizationStatusResponse,\n GetBuyerStateRequest,\n GetDerivedStateResponse,\n GetLifecycleResponse,\n GetSaleParametersResponse,\n GetStateResponse,\n RefreshBuyerTokensRequest,\n RefreshBuyerTokensResponse,\n Ticket,\n} from \"./candid/sns_swap\";\nimport { MAX_NEURONS_SUBACCOUNTS } from \"./constants/governance.constants\";\nimport { SnsGovernanceError } from \"./errors/governance.errors\";\nimport type { SnsGovernanceCanister } from \"./governance.canister\";\nimport type { SnsRootCanister } from \"./root.canister\";\nimport type { SnsSwapCanister } from \"./swap.canister\";\nimport type {\n SnsClaimNeuronParams,\n SnsDisburseNeuronParams,\n SnsGetNeuronParams,\n SnsGetProposalParams,\n SnsIncreaseDissolveDelayParams,\n SnsIncreaseStakeNeuronParams,\n SnsListNeuronsParams,\n SnsListProposalsParams,\n SnsNeuronAutoStakeMaturityParams,\n SnsNeuronDisburseMaturityParams,\n SnsNeuronPermissionsParams,\n SnsNeuronStakeMaturityParams,\n SnsRegisterVoteParams,\n SnsSetDissolveTimestampParams,\n SnsSetFollowingParams,\n SnsSetTopicFollowees,\n SnsSplitNeuronParams,\n SnsStakeNeuronParams,\n} from \"./types/governance.params\";\nimport type { NewSaleTicketParams } from \"./types/swap.params\";\nimport { neuronSubaccount } from \"./utils/governance.utils\";\n\ninterface SnsWrapperOptions {\n /** The wrapper for the \"root\" canister of the particular Sns */\n root: SnsRootCanister;\n /** The wrapper for the \"governance\" canister of the particular Sns */\n governance: SnsGovernanceCanister;\n /** The wrapper for the \"ledger\" canister of the particular Sns */\n ledger: IcrcLedgerCanister;\n /** The wrapper for the \"swap\" canister of the particular Sns */\n swap: SnsSwapCanister;\n /** The wrapper for the \"index\" canister of the particular Sns */\n index: IcrcIndexCanister;\n\n /** The wrapper has been instantiated and should perform query or update calls */\n certified: boolean;\n}\n\n/**\n * Sns wrapper - notably used by NNS-dapp - ease the access to a particular Sns.\n * It knows all the Sns' canisters, wrap and enhance their available features.\n * A wrapper either performs query or update calls.\n */\nexport class SnsWrapper {\n private readonly root: SnsRootCanister;\n private readonly governance: SnsGovernanceCanister;\n private readonly ledger: IcrcLedgerCanister;\n private readonly swap: SnsSwapCanister;\n private readonly index: IcrcIndexCanister;\n private readonly certified: boolean;\n\n /**\n * Constructor to instantiate a Sns\n */\n constructor({\n root,\n governance,\n ledger,\n swap,\n index,\n certified,\n }: SnsWrapperOptions) {\n this.root = root;\n this.governance = governance;\n this.ledger = ledger;\n this.swap = swap;\n this.index = index;\n this.certified = certified;\n }\n\n /**\n * Binds the list of canister ids of the Sns.\n */\n get canisterIds(): {\n rootCanisterId: Principal;\n ledgerCanisterId: Principal;\n governanceCanisterId: Principal;\n swapCanisterId: Principal;\n indexCanisterId: Principal;\n } {\n return {\n rootCanisterId: this.root.canisterId,\n ledgerCanisterId: this.ledger.canisterId,\n governanceCanisterId: this.governance.canisterId,\n swapCanisterId: this.swap.canisterId,\n indexCanisterId: this.index.canisterId,\n };\n }\n\n listNeurons = (\n params: Omit<SnsListNeuronsParams, \"certified\">,\n ): Promise<Neuron[]> => this.governance.listNeurons(this.mergeParams(params));\n\n listProposals = (\n params: Omit<SnsListProposalsParams, \"certified\">,\n ): Promise<ListProposalsResponse> =>\n this.governance.listProposals(this.mergeParams(params));\n\n getProposal = (\n params: Omit<SnsGetProposalParams, \"certified\">,\n ): Promise<ProposalData> =>\n this.governance.getProposal(this.mergeParams(params));\n\n listNervousSystemFunctions = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<ListNervousSystemFunctionsResponse> =>\n this.governance.listNervousSystemFunctions(this.mergeParams(params));\n\n metadata = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<[GetMetadataResponse, IcrcTokenMetadataResponse]> =>\n Promise.all([\n this.governance.metadata(this.mergeParams(params)),\n this.ledger.metadata(this.mergeParams(params)),\n ]);\n\n nervousSystemParameters = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<NervousSystemParameters> =>\n this.governance.nervousSystemParameters(this.mergeParams(params));\n\n ledgerMetadata = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<IcrcTokenMetadataResponse> =>\n this.ledger.metadata(this.mergeParams(params));\n\n transactionFee = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<IcrcTokens> =>\n this.ledger.transactionFee(this.mergeParams(params));\n\n totalTokensSupply = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<IcrcTokens> =>\n this.ledger.totalTokensSupply(this.mergeParams(params));\n\n balance = (params: Omit<BalanceParams, \"certified\">): Promise<IcrcTokens> =>\n this.ledger.balance(this.mergeParams(params));\n\n // Always certified\n transfer = (params: TransferParams): Promise<IcrcBlockIndex> =>\n this.ledger.transfer(params);\n\n getNeuron = (\n params: Omit<SnsGetNeuronParams, \"certified\">,\n ): Promise<Neuron> => this.governance.getNeuron(this.mergeParams(params));\n\n queryNeuron = (\n params: Omit<SnsGetNeuronParams, \"certified\">,\n ): Promise<Neuron | undefined> =>\n this.governance.queryNeuron(this.mergeParams(params));\n\n /**\n * Returns the subaccount of the next neuron to be created.\n *\n * The neuron account is a subaccount of the governance canister.\n * The subaccount is derived from the controller and an ascending index.\n *\n * \u203C\uFE0F The id of the neuron is the subaccount (neuron ID = subaccount) \u203C\uFE0F.\n *\n * If the neuron does not exist for that subaccount, then we use it for the next neuron.\n *\n * The index is used in the memo of the transfer and when claiming the neuron.\n * This is how the backend can identify which neuron is being claimed.\n *\n * @param controller\n * @returns\n */\n nextNeuronAccount = async (\n controller: Principal,\n ): Promise<{ account: IcrcAccount; index: bigint }> => {\n // TODO: try parallilizing requests to improve performance\n // OR use binary search https://dfinity.atlassian.net/browse/FOLLOW-825\n for (let index = 0; index < MAX_NEURONS_SUBACCOUNTS; index++) {\n const subaccount = neuronSubaccount({ index, controller });\n\n const neuronId: NeuronId = { id: subaccount };\n let neuron = await this.governance.queryNeuron({\n neuronId,\n certified: false,\n });\n if (neuron === undefined) {\n // Recheck with update call whether the neuron does not exist\n neuron = await this.governance.queryNeuron({\n neuronId,\n certified: true,\n });\n // If the neuron does not exist, we can use this subaccount\n if (neuron === undefined) {\n return {\n account: {\n ...this.owner,\n subaccount,\n },\n index: BigInt(index),\n };\n }\n }\n }\n throw new SnsGovernanceError(\"No more neuron accounts available\");\n };\n\n /**\n * Stakes a neuron.\n *\n * This is a convenient method that transfers the stake to the neuron subaccount and then claims the neuron.\n *\n * \u26A0\uFE0F This feature is provided as it without warranty. It does not implement any additional checks of the validity of the payment flow - e.g. it does not handle refund nor retries claiming the neuron in case of errors.\n *\n * @param {SnsStakeNeuronParams} params\n * @param {Principal} params.controller\n * @param {bigint} params.stakeE8s\n * @param {source} params.source\n * @returns {NeuronId}\n */\n stakeNeuron = async ({\n stakeE8s,\n source,\n controller,\n createdAt,\n fee,\n }: SnsStakeNeuronParams): Promise<NeuronId> => {\n this.assertCertified(\"stakeNeuron\");\n const { account: neuronAccount, index } =\n await this.nextNeuronAccount(controller);\n // This should not happen. The neuron account is always a subaccount of the SNS governance canister.\n if (neuronAccount.subaccount === undefined) {\n throw new SnsGovernanceError(\n \"There was an error creating the neuron subaccount\",\n );\n }\n await this.ledger.transfer({\n amount: stakeE8s,\n to: {\n owner: neuronAccount.owner,\n subaccount: toNullable(neuronAccount.subaccount),\n },\n from_subaccount: source.subaccount,\n memo: bigIntToUint8Array(index),\n created_at_time: createdAt,\n fee,\n });\n return this.governance.claimNeuron({\n memo: BigInt(index),\n controller,\n subaccount: neuronAccount.subaccount,\n });\n };\n\n /**\n * Increase the stake of a neuron.\n *\n * This is a convenient method that transfers the stake to the neuron subaccount and then refresh the neuron.\n *\n * \u26A0\uFE0F This feature is provided as it without warranty. It does not implement any additional checks of the validity of the payment flow - e.g. it does not handle refund nor calls refresh again in case of errors.\n *\n * @param {SnsStakeNeuronParams} params\n * @param {Principal} params.controller\n * @param {bigint} params.stakeE8s\n * @param {source} params.source\n * @returns {NeuronId}\n */\n increaseStakeNeuron = async ({\n stakeE8s,\n source,\n neuronId,\n }: SnsIncreaseStakeNeuronParams): Promise<void> => {\n this.assertCertified(\"stakeNeuron\");\n\n await this.ledger.transfer({\n amount: stakeE8s,\n to: {\n ...this.owner,\n subaccount: toNullable(Uint8Array.from(neuronId.id)),\n },\n from_subaccount: source.subaccount,\n });\n\n return this.governance.refreshNeuron(neuronId);\n };\n\n getNeuronBalance = (neuronId: NeuronId): Promise<IcrcTokens> => {\n const account = {\n ...this.owner,\n subaccount: Uint8Array.from(neuronId.id),\n };\n return this.ledger.balance({ ...account, certified: this.certified });\n };\n\n // Always certified\n addNeuronPermissions = (params: SnsNeuronPermissionsParams): Promise<void> =>\n this.governance.addNeuronPermissions(params);\n\n // Always certified\n refreshNeuron = (neuronId: NeuronId): Promise<void> =>\n this.governance.refreshNeuron(neuronId);\n\n // Always certified\n claimNeuron = (params: SnsClaimNeuronParams): Promise<NeuronId> =>\n this.governance.claimNeuron(params);\n\n // Always certified\n removeNeuronPermissions = (\n params: SnsNeuronPermissionsParams,\n ): Promise<void> => this.governance.removeNeuronPermissions(params);\n\n // Always certified\n splitNeuron = (params: SnsSplitNeuronParams): Promise<NeuronId | undefined> =>\n this.governance.splitNeuron(params);\n\n // Always certified\n disburse = (params: SnsDisburseNeuronParams): Promise<void> =>\n this.governance.disburse(params);\n\n // Always certified\n startDissolving = (neuronId: NeuronId): Promise<void> =>\n this.governance.startDissolving(neuronId);\n\n // Always certified\n stopDissolving = (neuronId: NeuronId): Promise<void> =>\n this.governance.stopDissolving(neuronId);\n\n // Always certified\n setDissolveTimestamp = (\n params: SnsSetDissolveTimestampParams,\n ): Promise<void> => this.governance.setDissolveTimestamp(params);\n\n // Always certified\n increaseDissolveDelay = (\n params: SnsIncreaseDissolveDelayParams,\n ): Promise<void> => this.governance.increaseDissolveDelay(params);\n\n // Always certified\n setTopicFollowees = (params: SnsSetTopicFollowees): Promise<void> =>\n this.governance.setTopicFollowees(params);\n\n // Always certified\n setFollowing = (params: SnsSetFollowingParams): Promise<void> =>\n this.governance.setFollowing(params);\n\n // Always certified\n registerVote = (params: SnsRegisterVoteParams): Promise<void> =>\n this.governance.registerVote(params);\n\n swapState = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<GetStateResponse> => this.swap.state(this.mergeParams(params));\n\n /**\n * Returns the ticket if a ticket was found for the caller and the ticket\n * was removed successfully. Returns None if no ticket was found for the caller.\n * Only the owner of a ticket can remove it.\n *\n * Always certified\n *\n * @param params\n */\n notifyPaymentFailure = (): Promise<Ticket | undefined> =>\n this.swap.notifyPaymentFailure();\n\n // Always certified\n notifyParticipation = (\n params: RefreshBuyerTokensRequest,\n ): Promise<RefreshBuyerTokensResponse> =>\n this.swap.notifyParticipation(params);\n\n getUserCommitment = (\n params: GetBuyerStateRequest,\n ): Promise<BuyerState | undefined> =>\n this.swap.getUserCommitment(this.mergeParams(params));\n\n getOpenTicket = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<Ticket | undefined> =>\n this.swap.getOpenTicket(this.mergeParams(params));\n\n // Always certified\n newSaleTicket = (params: NewSaleTicketParams): Promise<Ticket> =>\n this.swap.newSaleTicket(params);\n\n getLifecycle = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<GetLifecycleResponse | undefined> =>\n this.swap.getLifecycle(this.mergeParams(params));\n\n getFinalizationStatus = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<GetAutoFinalizationStatusResponse | undefined> =>\n this.swap.getFinalizationStatus(this.mergeParams(params));\n\n getSaleParameters = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<GetSaleParametersResponse | undefined> =>\n this.swap.getSaleParameters(this.mergeParams(params));\n\n getDerivedState = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<GetDerivedStateResponse | undefined> =>\n this.swap.getDerivedState(this.mergeParams(params));\n\n // Always certified\n getTransactions = (\n params: GetAccountTransactionsParams,\n ): Promise<IcrcGetTransactions> => this.index.getTransactions(params);\n\n // Always certified\n stakeMaturity = (params: SnsNeuronStakeMaturityParams): Promise<void> =>\n this.governance.stakeMaturity(params);\n\n // Always certified\n disburseMaturity = (params: SnsNeuronDisburseMaturityParams): Promise<void> =>\n this.governance.disburseMaturity(params);\n\n // Always certified\n autoStakeMaturity = (\n params: SnsNeuronAutoStakeMaturityParams,\n ): Promise<void> => this.governance.autoStakeMaturity(params);\n\n private mergeParams<T>(params: T): QueryParams & T {\n return {\n ...params,\n certified: this.certified,\n };\n }\n\n private assertCertified = (name: string): void => {\n if (!this.certified) {\n throw new SnsGovernanceError(`Call to ${name} needs to be certified`);\n }\n };\n\n /**\n * Each Sns neuron id is a subaccount of the related Sns ledger account of the Sns governance canister.\n *\n * In other words, the Sns governance canister is the owner. It has an account in the related Sns ledger and each neuron is both a child of the Sns governance canister and a subaccount in the Sns ledger.\n *\n * @private\n */\n private get owner(): IcrcAccount {\n return {\n owner: this.canisterIds.governanceCanisterId,\n };\n }\n}\n", "import type { IcrcSubaccount } from \"@dfinity/ledger-icrc\";\nimport {\n arrayOfNumberToUint8Array,\n asciiStringToByteArray,\n numberToUint8Array,\n} from \"@dfinity/utils\";\nimport type { Principal } from \"@icp-sdk/core/principal\";\nimport { sha256 } from \"@noble/hashes/sha2\";\n\n/**\n * Neuron subaccount is calculated as \"sha256(0x0c . \u201Cneuron-stake\u201D . controller . i)\"\n *\n * @param params\n * @param {Principal} params.newController\n * @param {number} params.index\n * @returns\n */\nexport const neuronSubaccount = ({\n index,\n controller,\n}: {\n index: number;\n controller: Principal;\n}): IcrcSubaccount => {\n const padding = asciiStringToByteArray(\"neuron-stake\");\n const data = [\n 0x0c,\n ...padding,\n ...controller.toUint8Array(),\n ...numberToUint8Array(index),\n ];\n // TODO(#238): Implement without library and make it compatible with NodeJS and browser\n const shaObj = sha256.create();\n shaObj.update(arrayOfNumberToUint8Array(data));\n return shaObj.digest();\n};\n", "/**\n * Utilities for hex, bytes, CSPRNG.\n * @module\n */\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated (2025-04-30), we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\n\n/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */\nexport function isBytes(a: unknown): a is Uint8Array {\n return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\n\n/** Asserts something is positive integer. */\nexport function anumber(n: number): void {\n if (!Number.isSafeInteger(n) || n < 0) throw new Error('positive integer expected, got ' + n);\n}\n\n/** Asserts something is Uint8Array. */\nexport function abytes(b: Uint8Array | undefined, ...lengths: number[]): void {\n if (!isBytes(b)) throw new Error('Uint8Array expected');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length);\n}\n\n/** Asserts something is hash */\nexport function ahash(h: IHash): void {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new Error('Hash should be wrapped by utils.createHasher');\n anumber(h.outputLen);\n anumber(h.blockLen);\n}\n\n/** Asserts a hash instance has not been destroyed / finished */\nexport function aexists(instance: any, checkFinished = true): void {\n if (instance.destroyed) throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished) throw new Error('Hash#digest() has already been called');\n}\n\n/** Asserts output is properly-sized byte array */\nexport function aoutput(out: any, instance: any): void {\n abytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error('digestInto() expects output buffer of length at least ' + min);\n }\n}\n\n/** Generic type encompassing 8/16/32-byte arrays - but not 64-byte. */\n// prettier-ignore\nexport type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array |\n Uint16Array | Int16Array | Uint32Array | Int32Array;\n\n/** Cast u8 / u16 / u32 to u8. */\nexport function u8(arr: TypedArray): Uint8Array {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n\n/** Cast u8 / u16 / u32 to u32. */\nexport function u32(arr: TypedArray): Uint32Array {\n return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n\n/** Zeroize a byte array. Warning: JS provides no guarantees. */\nexport function clean(...arrays: TypedArray[]): void {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n\n/** Create DataView of an array for easy byte-level manipulation. */\nexport function createView(arr: TypedArray): DataView {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n\n/** The rotate right (circular right shift) operation for uint32 */\nexport function rotr(word: number, shift: number): number {\n return (word << (32 - shift)) | (word >>> shift);\n}\n\n/** The rotate left (circular left shift) operation for uint32 */\nexport function rotl(word: number, shift: number): number {\n return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n\n/** Is current platform little-endian? Most are. Big-Endian platform: IBM */\nexport const isLE: boolean = /* @__PURE__ */ (() =>\n new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\n\n/** The byte swap operation for uint32 */\nexport function byteSwap(word: number): number {\n return (\n ((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff)\n );\n}\n/** Conditionally byte swap if on a big-endian platform */\nexport const swap8IfBE: (n: number) => number = isLE\n ? (n: number) => n\n : (n: number) => byteSwap(n);\n\n/** @deprecated */\nexport const byteSwapIfBE: typeof swap8IfBE = swap8IfBE;\n/** In place byte swap for Uint32Array */\nexport function byteSwap32(arr: Uint32Array): Uint32Array {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = byteSwap(arr[i]);\n }\n return arr;\n}\n\nexport const swap32IfBE: (u: Uint32Array) => Uint32Array = isLE\n ? (u: Uint32Array) => u\n : byteSwap32;\n\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin: boolean = /* @__PURE__ */ (() =>\n // @ts-ignore\n typeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) =>\n i.toString(16).padStart(2, '0')\n);\n\n/**\n * Convert byte array to hex string. Uses built-in function, when available.\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes: Uint8Array): string {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin) return bytes.toHex();\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 } as const;\nfunction asciiToBase16(ch: number): number | undefined {\n if (ch >= asciis._0 && ch <= asciis._9) return ch - asciis._0; // '2' => 50-48\n if (ch >= asciis.A && ch <= asciis.F) return ch - (asciis.A - 10); // 'B' => 66-(65-10)\n if (ch >= asciis.a && ch <= asciis.f) return ch - (asciis.a - 10); // 'b' => 98-(97-10)\n return;\n}\n\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex: string): Uint8Array {\n if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex);\n // @ts-ignore\n if (hasHexBuiltin) return Uint8Array.fromHex(hex);\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2) throw new Error('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new Error('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163\n }\n return array;\n}\n\n/**\n * There is no setImmediate in browser and setTimeout is slow.\n * Call of async fn will return Promise, which will be fullfiled only on\n * next scheduler queue processing step and this is exactly what we need.\n */\nexport const nextTick = async (): Promise<void> => {};\n\n/** Returns control to thread each 'tick' ms to avoid blocking. */\nexport async function asyncLoop(\n iters: number,\n tick: number,\n cb: (i: number) => void\n): Promise<void> {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick) continue;\n await nextTick();\n ts += diff;\n }\n}\n\n// Global symbols, but ts doesn't see them: https://github.com/microsoft/TypeScript/issues/31535\ndeclare const TextEncoder: any;\ndeclare const TextDecoder: any;\n\n/**\n * Converts string to bytes using UTF8 encoding.\n * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99])\n */\nexport function utf8ToBytes(str: string): Uint8Array {\n if (typeof str !== 'string') throw new Error('string expected');\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n\n/**\n * Converts bytes to string using UTF8 encoding.\n * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc'\n */\nexport function bytesToUtf8(bytes: Uint8Array): string {\n return new TextDecoder().decode(bytes);\n}\n\n/** Accepted input of hash functions. Strings are converted to byte arrays. */\nexport type Input = string | Uint8Array;\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nexport function toBytes(data: Input): Uint8Array {\n if (typeof data === 'string') data = utf8ToBytes(data);\n abytes(data);\n return data;\n}\n\n/** KDFs can accept string or Uint8Array for user convenience. */\nexport type KDFInput = string | Uint8Array;\n/**\n * Helper for KDFs: consumes uint8array or string.\n * When string is passed, does utf8 decoding, using TextDecoder.\n */\nexport function kdfInputToBytes(data: KDFInput): Uint8Array {\n if (typeof data === 'string') data = utf8ToBytes(data);\n abytes(data);\n return data;\n}\n\n/** Copies several Uint8Arrays into one. */\nexport function concatBytes(...arrays: Uint8Array[]): Uint8Array {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n\ntype EmptyObj = {};\nexport function checkOpts<T1 extends EmptyObj, T2 extends EmptyObj>(\n defaults: T1,\n opts?: T2\n): T1 & T2 {\n if (opts !== undefined && {}.toString.call(opts) !== '[object Object]')\n throw new Error('options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged as T1 & T2;\n}\n\n/** Hash interface. */\nexport type IHash = {\n (data: Uint8Array): Uint8Array;\n blockLen: number;\n outputLen: number;\n create: any;\n};\n\n/** For runtime check if class implements interface */\nexport abstract class Hash<T extends Hash<T>> {\n abstract blockLen: number; // Bytes per block\n abstract outputLen: number; // Bytes in output\n abstract update(buf: Input): this;\n // Writes digest into buf\n abstract digestInto(buf: Uint8Array): void;\n abstract digest(): Uint8Array;\n /**\n * Resets internal state. Makes Hash instance unusable.\n * Reset is impossible for keyed hashes if key is consumed into state. If digest is not consumed\n * by user, they will need to manually call `destroy()` when zeroing is necessary.\n */\n abstract destroy(): void;\n /**\n * Clones hash instance. Unsafe: doesn't check whether `to` is valid. Can be used as `clone()`\n * when no options are passed.\n * Reasons to use `_cloneInto` instead of clone: 1) performance 2) reuse instance => all internal\n * buffers are overwritten => causes buffer overwrite which is used for digest in some cases.\n * There are no guarantees for clean-up because it's impossible in JS.\n */\n abstract _cloneInto(to?: T): T;\n // Safe version that clones internal state\n abstract clone(): T;\n}\n\n/**\n * XOF: streaming API to read digest in chunks.\n * Same as 'squeeze' in keccak/k12 and 'seek' in blake3, but more generic name.\n * When hash used in XOF mode it is up to user to call '.destroy' afterwards, since we cannot\n * destroy state, next call can require more bytes.\n */\nexport type HashXOF<T extends Hash<T>> = Hash<T> & {\n xof(bytes: number): Uint8Array; // Read 'bytes' bytes from digest stream\n xofInto(buf: Uint8Array): Uint8Array; // read buf.length bytes from digest stream into buf\n};\n\n/** Hash function */\nexport type CHash = ReturnType<typeof createHasher>;\n/** Hash function with output */\nexport type CHashO = ReturnType<typeof createOptHasher>;\n/** XOF with output */\nexport type CHashXO = ReturnType<typeof createXOFer>;\n\n/** Wraps hash function, creating an interface on top of it */\nexport function createHasher<T extends Hash<T>>(\n hashCons: () => Hash<T>\n): {\n (msg: Input): Uint8Array;\n outputLen: number;\n blockLen: number;\n create(): Hash<T>;\n} {\n const hashC = (msg: Input): Uint8Array => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\n\nexport function createOptHasher<H extends Hash<H>, T extends Object>(\n hashCons: (opts?: T) => Hash<H>\n): {\n (msg: Input, opts?: T): Uint8Array;\n outputLen: number;\n blockLen: number;\n create(opts?: T): Hash<H>;\n} {\n const hashC = (msg: Input, opts?: T): Uint8Array => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({} as T);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts?: T) => hashCons(opts);\n return hashC;\n}\n\nexport function createXOFer<H extends HashXOF<H>, T extends Object>(\n hashCons: (opts?: T) => HashXOF<H>\n): {\n (msg: Input, opts?: T): Uint8Array;\n outputLen: number;\n blockLen: number;\n create(opts?: T): HashXOF<H>;\n} {\n const hashC = (msg: Input, opts?: T): Uint8Array => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({} as T);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts?: T) => hashCons(opts);\n return hashC;\n}\nexport const wrapConstructor: typeof createHasher = createHasher;\nexport const wrapConstructorWithOpts: typeof createOptHasher = createOptHasher;\nexport const wrapXOFConstructorWithOpts: typeof createXOFer = createXOFer;\n\n/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */\nexport function randomBytes(bytesLength = 32): Uint8Array {\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n // Legacy Node.js compatibility\n if (crypto && typeof crypto.randomBytes === 'function') {\n return Uint8Array.from(crypto.randomBytes(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n", "/**\n * Internal Merkle-Damgard hash utils.\n * @module\n */\nimport { type Input, Hash, abytes, aexists, aoutput, clean, createView, toBytes } from './utils.ts';\n\n/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */\nexport function setBigUint64(\n view: DataView,\n byteOffset: number,\n value: bigint,\n isLE: boolean\n): void {\n if (typeof view.setBigUint64 === 'function') return view.setBigUint64(byteOffset, value, isLE);\n const _32n = BigInt(32);\n const _u32_max = BigInt(0xffffffff);\n const wh = Number((value >> _32n) & _u32_max);\n const wl = Number(value & _u32_max);\n const h = isLE ? 4 : 0;\n const l = isLE ? 0 : 4;\n view.setUint32(byteOffset + h, wh, isLE);\n view.setUint32(byteOffset + l, wl, isLE);\n}\n\n/** Choice: a ? b : c */\nexport function Chi(a: number, b: number, c: number): number {\n return (a & b) ^ (~a & c);\n}\n\n/** Majority function, true if any two inputs is true. */\nexport function Maj(a: number, b: number, c: number): number {\n return (a & b) ^ (a & c) ^ (b & c);\n}\n\n/**\n * Merkle-Damgard hash construction base class.\n * Could be used to create MD5, RIPEMD, SHA1, SHA2.\n */\nexport abstract class HashMD<T extends HashMD<T>> extends Hash<T> {\n protected abstract process(buf: DataView, offset: number): void;\n protected abstract get(): number[];\n protected abstract set(...args: number[]): void;\n abstract destroy(): void;\n protected abstract roundClean(): void;\n\n readonly blockLen: number;\n readonly outputLen: number;\n readonly padOffset: number;\n readonly isLE: boolean;\n\n // For partial updates less than block size\n protected buffer: Uint8Array;\n protected view: DataView;\n protected finished = false;\n protected length = 0;\n protected pos = 0;\n protected destroyed = false;\n\n constructor(blockLen: number, outputLen: number, padOffset: number, isLE: boolean) {\n super();\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data: Input): this {\n aexists(this);\n data = toBytes(data);\n abytes(data);\n const { view, buffer, blockLen } = this;\n const len = data.length;\n for (let pos = 0; pos < len; ) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path: we have at least one block in input, cast it to view and process\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen) this.process(dataView, pos);\n continue;\n }\n buffer.set(data.subarray(pos, pos + take), this.pos);\n this.pos += take;\n pos += take;\n if (this.pos === blockLen) {\n this.process(view, 0);\n this.pos = 0;\n }\n }\n this.length += data.length;\n this.roundClean();\n return this;\n }\n digestInto(out: Uint8Array): void {\n aexists(this);\n aoutput(out, this);\n this.finished = true;\n // Padding\n // We can avoid allocation of buffer for padding completely if it\n // was previously not allocated here. But it won't change performance.\n const { buffer, view, blockLen, isLE } = this;\n let { pos } = this;\n // append the bit '1' to the message\n buffer[pos++] = 0b10000000;\n clean(this.buffer.subarray(pos));\n // we have less than padOffset left in buffer, so we cannot put length in\n // current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n pos = 0;\n }\n // Pad until full block byte with zeros\n for (let i = pos; i < blockLen; i++) buffer[i] = 0;\n // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that\n // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.\n // So we just write lowest 64 bits of that value.\n setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);\n this.process(view, 0);\n const oview = createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT\n if (len % 4) throw new Error('_sha2: outputLen should be aligned to 32bit');\n const outLen = len / 4;\n const state = this.get();\n if (outLen > state.length) throw new Error('_sha2: outputLen bigger than state');\n for (let i = 0; i < outLen; i++) oview.setUint32(4 * i, state[i], isLE);\n }\n digest(): Uint8Array {\n const { buffer, outputLen } = this;\n this.digestInto(buffer);\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneInto(to?: T): T {\n to ||= new (this.constructor as any)() as T;\n to.set(...this.get());\n const { blockLen, buffer, length, finished, destroyed, pos } = this;\n to.destroyed = destroyed;\n to.finished = finished;\n to.length = length;\n to.pos = pos;\n if (length % blockLen) to.buffer.set(buffer);\n return to;\n }\n clone(): T {\n return this._cloneInto();\n }\n}\n\n/**\n * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.\n * Check out `test/misc/sha2-gen-iv.js` for recomputation guide.\n */\n\n/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */\nexport const SHA256_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\n\n/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */\nexport const SHA224_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,\n]);\n\n/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */\nexport const SHA384_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([\n 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4,\n]);\n\n/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */\nexport const SHA512_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,\n]);\n", "/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and\n * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).\n * @module\n */\nimport { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from './_md.ts';\nimport * as u64 from './_u64.ts';\nimport { type CHash, clean, createHasher, rotr } from './utils.ts';\n\n/**\n * Round constants:\n * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311)\n */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n\n/** Reusable temporary buffer. \"W\" comes straight from spec. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\nexport class SHA256 extends HashMD<SHA256> {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n protected A: number = SHA256_IV[0] | 0;\n protected B: number = SHA256_IV[1] | 0;\n protected C: number = SHA256_IV[2] | 0;\n protected D: number = SHA256_IV[3] | 0;\n protected E: number = SHA256_IV[4] | 0;\n protected F: number = SHA256_IV[5] | 0;\n protected G: number = SHA256_IV[6] | 0;\n protected H: number = SHA256_IV[7] | 0;\n\n constructor(outputLen: number = 32) {\n super(64, outputLen, 8, false);\n }\n protected get(): [number, number, number, number, number, number, number, number] {\n const { A, B, C, D, E, F, G, H } = this;\n return [A, B, C, D, E, F, G, H];\n }\n // prettier-ignore\n protected set(\n A: number, B: number, C: number, D: number, E: number, F: number, G: number, H: number\n ): void {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n this.E = E | 0;\n this.F = F | 0;\n this.G = G | 0;\n this.H = H | 0;\n }\n protected process(view: DataView, offset: number): void {\n // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) SHA256_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 64; i++) {\n const W15 = SHA256_W[i - 15];\n const W2 = SHA256_W[i - 2];\n const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3);\n const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10);\n SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;\n }\n // Compression function main loop, 64 rounds\n let { A, B, C, D, E, F, G, H } = this;\n for (let i = 0; i < 64; i++) {\n const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);\n const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);\n const T2 = (sigma0 + Maj(A, B, C)) | 0;\n H = G;\n G = F;\n F = E;\n E = (D + T1) | 0;\n D = C;\n C = B;\n B = A;\n A = (T1 + T2) | 0;\n }\n // Add the compressed chunk to the current hash value\n A = (A + this.A) | 0;\n B = (B + this.B) | 0;\n C = (C + this.C) | 0;\n D = (D + this.D) | 0;\n E = (E + this.E) | 0;\n F = (F + this.F) | 0;\n G = (G + this.G) | 0;\n H = (H + this.H) | 0;\n this.set(A, B, C, D, E, F, G, H);\n }\n protected roundClean(): void {\n clean(SHA256_W);\n }\n destroy(): void {\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n\nexport class SHA224 extends SHA256 {\n protected A: number = SHA224_IV[0] | 0;\n protected B: number = SHA224_IV[1] | 0;\n protected C: number = SHA224_IV[2] | 0;\n protected D: number = SHA224_IV[3] | 0;\n protected E: number = SHA224_IV[4] | 0;\n protected F: number = SHA224_IV[5] | 0;\n protected G: number = SHA224_IV[6] | 0;\n protected H: number = SHA224_IV[7] | 0;\n constructor() {\n super(28);\n }\n}\n\n// SHA2-512 is slower than sha256 in js because u64 operations are slow.\n\n// Round contants\n// First 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409\n// prettier-ignore\nconst K512 = /* @__PURE__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\nconst SHA512_Kh = /* @__PURE__ */ (() => K512[0])();\nconst SHA512_Kl = /* @__PURE__ */ (() => K512[1])();\n\n// Reusable temporary buffers\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\n\nexport class SHA512 extends HashMD<SHA512> {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n // h -- high 32 bits, l -- low 32 bits\n protected Ah: number = SHA512_IV[0] | 0;\n protected Al: number = SHA512_IV[1] | 0;\n protected Bh: number = SHA512_IV[2] | 0;\n protected Bl: number = SHA512_IV[3] | 0;\n protected Ch: number = SHA512_IV[4] | 0;\n protected Cl: number = SHA512_IV[5] | 0;\n protected Dh: number = SHA512_IV[6] | 0;\n protected Dl: number = SHA512_IV[7] | 0;\n protected Eh: number = SHA512_IV[8] | 0;\n protected El: number = SHA512_IV[9] | 0;\n protected Fh: number = SHA512_IV[10] | 0;\n protected Fl: number = SHA512_IV[11] | 0;\n protected Gh: number = SHA512_IV[12] | 0;\n protected Gl: number = SHA512_IV[13] | 0;\n protected Hh: number = SHA512_IV[14] | 0;\n protected Hl: number = SHA512_IV[15] | 0;\n\n constructor(outputLen: number = 64) {\n super(128, outputLen, 16, false);\n }\n // prettier-ignore\n protected get(): [\n number, number, number, number, number, number, number, number,\n number, number, number, number, number, number, number, number\n ] {\n const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n }\n // prettier-ignore\n protected set(\n Ah: number, Al: number, Bh: number, Bl: number, Ch: number, Cl: number, Dh: number, Dl: number,\n Eh: number, El: number, Fh: number, Fl: number, Gh: number, Gl: number, Hh: number, Hl: number\n ): void {\n this.Ah = Ah | 0;\n this.Al = Al | 0;\n this.Bh = Bh | 0;\n this.Bl = Bl | 0;\n this.Ch = Ch | 0;\n this.Cl = Cl | 0;\n this.Dh = Dh | 0;\n this.Dl = Dl | 0;\n this.Eh = Eh | 0;\n this.El = El | 0;\n this.Fh = Fh | 0;\n this.Fl = Fl | 0;\n this.Gh = Gh | 0;\n this.Gl = Gl | 0;\n this.Hh = Hh | 0;\n this.Hl = Hl | 0;\n }\n protected process(view: DataView, offset: number): void {\n // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) {\n SHA512_W_H[i] = view.getUint32(offset);\n SHA512_W_L[i] = view.getUint32((offset += 4));\n }\n for (let i = 16; i < 80; i++) {\n // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n const W15h = SHA512_W_H[i - 15] | 0;\n const W15l = SHA512_W_L[i - 15] | 0;\n const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n const W2h = SHA512_W_H[i - 2] | 0;\n const W2l = SHA512_W_L[i - 2] | 0;\n const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n SHA512_W_H[i] = SUMh | 0;\n SHA512_W_L[i] = SUMl | 0;\n }\n let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n // Compression function main loop, 80 rounds\n for (let i = 0; i < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n const T1l = T1ll | 0;\n // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n Hh = Gh | 0;\n Hl = Gl | 0;\n Gh = Fh | 0;\n Gl = Fl | 0;\n Fh = Eh | 0;\n Fl = El | 0;\n ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n Dh = Ch | 0;\n Dl = Cl | 0;\n Ch = Bh | 0;\n Cl = Bl | 0;\n Bh = Ah | 0;\n Bl = Al | 0;\n const All = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n Al = All | 0;\n }\n // Add the compressed chunk to the current hash value\n ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n }\n protected roundClean(): void {\n clean(SHA512_W_H, SHA512_W_L);\n }\n destroy(): void {\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n }\n}\n\nexport class SHA384 extends SHA512 {\n protected Ah: number = SHA384_IV[0] | 0;\n protected Al: number = SHA384_IV[1] | 0;\n protected Bh: number = SHA384_IV[2] | 0;\n protected Bl: number = SHA384_IV[3] | 0;\n protected Ch: number = SHA384_IV[4] | 0;\n protected Cl: number = SHA384_IV[5] | 0;\n protected Dh: number = SHA384_IV[6] | 0;\n protected Dl: number = SHA384_IV[7] | 0;\n protected Eh: number = SHA384_IV[8] | 0;\n protected El: number = SHA384_IV[9] | 0;\n protected Fh: number = SHA384_IV[10] | 0;\n protected Fl: number = SHA384_IV[11] | 0;\n protected Gh: number = SHA384_IV[12] | 0;\n protected Gl: number = SHA384_IV[13] | 0;\n protected Hh: number = SHA384_IV[14] | 0;\n protected Hl: number = SHA384_IV[15] | 0;\n\n constructor() {\n super(48);\n }\n}\n\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n * See `test/misc/sha2-gen-iv.js`.\n */\n\n/** SHA512/224 IV */\nconst T224_IV = /* @__PURE__ */ Uint32Array.from([\n 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,\n 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1,\n]);\n\n/** SHA512/256 IV */\nconst T256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd,\n 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2,\n]);\n\nexport class SHA512_224 extends SHA512 {\n protected Ah: number = T224_IV[0] | 0;\n protected Al: number = T224_IV[1] | 0;\n protected Bh: number = T224_IV[2] | 0;\n protected Bl: number = T224_IV[3] | 0;\n protected Ch: number = T224_IV[4] | 0;\n protected Cl: number = T224_IV[5] | 0;\n protected Dh: number = T224_IV[6] | 0;\n protected Dl: number = T224_IV[7] | 0;\n protected Eh: number = T224_IV[8] | 0;\n protected El: number = T224_IV[9] | 0;\n protected Fh: number = T224_IV[10] | 0;\n protected Fl: number = T224_IV[11] | 0;\n protected Gh: number = T224_IV[12] | 0;\n protected Gl: number = T224_IV[13] | 0;\n protected Hh: number = T224_IV[14] | 0;\n protected Hl: number = T224_IV[15] | 0;\n\n constructor() {\n super(28);\n }\n}\n\nexport class SHA512_256 extends SHA512 {\n protected Ah: number = T256_IV[0] | 0;\n protected Al: number = T256_IV[1] | 0;\n protected Bh: number = T256_IV[2] | 0;\n protected Bl: number = T256_IV[3] | 0;\n protected Ch: number = T256_IV[4] | 0;\n protected Cl: number = T256_IV[5] | 0;\n protected Dh: number = T256_IV[6] | 0;\n protected Dl: number = T256_IV[7] | 0;\n protected Eh: number = T256_IV[8] | 0;\n protected El: number = T256_IV[9] | 0;\n protected Fh: number = T256_IV[10] | 0;\n protected Fl: number = T256_IV[11] | 0;\n protected Gh: number = T256_IV[12] | 0;\n protected Gl: number = T256_IV[13] | 0;\n protected Hh: number = T256_IV[14] | 0;\n protected Hl: number = T256_IV[15] | 0;\n\n constructor() {\n super(32);\n }\n}\n\n/**\n * SHA2-256 hash function from RFC 4634.\n *\n * It is the fastest JS hash, even faster than Blake3.\n * To break sha256 using birthday attack, attackers need to try 2^128 hashes.\n * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n */\nexport const sha256: CHash = /* @__PURE__ */ createHasher(() => new SHA256());\n/** SHA2-224 hash function from RFC 4634 */\nexport const sha224: CHash = /* @__PURE__ */ createHasher(() => new SHA224());\n\n/** SHA2-512 hash function from RFC 4634. */\nexport const sha512: CHash = /* @__PURE__ */ createHasher(() => new SHA512());\n/** SHA2-384 hash function from RFC 4634. */\nexport const sha384: CHash = /* @__PURE__ */ createHasher(() => new SHA384());\n\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexport const sha512_256: CHash = /* @__PURE__ */ createHasher(() => new SHA512_256());\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexport const sha512_224: CHash = /* @__PURE__ */ createHasher(() => new SHA512_224());\n", "import {\n Canister,\n createServices,\n fromDefinedNullable,\n fromNullable,\n type QueryParams,\n} from \"@dfinity/utils\";\nimport type {\n BuyerState,\n GetAutoFinalizationStatusResponse,\n GetBuyerStateRequest,\n GetDerivedStateResponse,\n GetLifecycleResponse,\n GetSaleParametersResponse,\n GetStateResponse,\n RefreshBuyerTokensRequest,\n RefreshBuyerTokensResponse,\n _SERVICE as SnsSwapService,\n Ticket,\n} from \"./candid/sns_swap\";\nimport { idlFactory as certifiedIdlFactory } from \"./candid/sns_swap.certified.idl\";\nimport { idlFactory } from \"./candid/sns_swap.idl\";\nimport { toNewSaleTicketRequest } from \"./converters/swap.converters\";\nimport { UnsupportedMethodError } from \"./errors/common.errors\";\nimport {\n SnsSwapGetOpenTicketError,\n SnsSwapNewTicketError,\n} from \"./errors/swap.errors\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\nimport type { NewSaleTicketParams } from \"./types/swap.params\";\nimport { isMethodNotSupportedError } from \"./utils/error.utils\";\n\nexport class SnsSwapCanister extends Canister<SnsSwapService> {\n static create(options: SnsCanisterOptions<SnsSwapService>) {\n const { service, certifiedService, canisterId } =\n createServices<SnsSwapService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new SnsSwapCanister(canisterId, service, certifiedService);\n }\n\n /**\n * Get the state of the swap\n */\n state = (params: QueryParams): Promise<GetStateResponse> =>\n this.caller(params).get_state({});\n\n /**\n * Notify of the payment failure to remove the ticket\n */\n notifyPaymentFailure = async (): Promise<Ticket | undefined> => {\n const { ticket } = await this.caller({\n certified: true,\n }).notify_payment_failure({});\n return fromNullable(ticket);\n };\n\n /**\n * Notify of the user participating in the swap\n */\n notifyParticipation = async (\n params: RefreshBuyerTokensRequest,\n ): Promise<RefreshBuyerTokensResponse> =>\n await this.caller({ certified: true }).refresh_buyer_tokens(params);\n\n /**\n * Get user commitment\n */\n getUserCommitment = async (\n params: GetBuyerStateRequest & QueryParams,\n ): Promise<BuyerState | undefined> => {\n const { buyer_state } = await this.caller({\n certified: params.certified,\n }).get_buyer_state({ principal_id: params.principal_id });\n return fromNullable(buyer_state);\n };\n\n /**\n * Get sale buyers state\n */\n getDerivedState = ({\n certified,\n }: QueryParams): Promise<GetDerivedStateResponse> =>\n this.caller({ certified }).get_derived_state({});\n\n /**\n * Get sale parameters\n */\n getSaleParameters = ({\n certified,\n }: QueryParams): Promise<GetSaleParametersResponse> =>\n this.caller({ certified }).get_sale_parameters({});\n\n /**\n * Return a sale ticket if created and not yet removed (payment flow)\n */\n getOpenTicket = async (params: QueryParams): Promise<Ticket | undefined> => {\n const { result: response } = await this.caller({\n certified: params.certified,\n }).get_open_ticket({});\n const result = fromDefinedNullable(response);\n\n if (\"Ok\" in result) {\n return fromNullable(result.Ok.ticket);\n }\n\n const errorType = fromDefinedNullable(result?.Err?.error_type);\n throw new SnsSwapGetOpenTicketError(errorType);\n };\n\n /**\n * Create a sale ticket (payment flow)\n */\n newSaleTicket = async (params: NewSaleTicketParams): Promise<Ticket> => {\n const request = toNewSaleTicketRequest(params);\n const { result: response } = await this.caller({\n certified: true,\n }).new_sale_ticket(request);\n\n const result = fromDefinedNullable(response);\n\n if (\"Ok\" in result) {\n return fromDefinedNullable(result.Ok.ticket);\n }\n\n const errorData = result.Err;\n const error = new SnsSwapNewTicketError({\n errorType: errorData.error_type,\n invalidUserAmount: fromNullable(errorData.invalid_user_amount ?? []),\n existingTicket: fromNullable(errorData.existing_ticket ?? []),\n });\n\n throw error;\n };\n\n /**\n * Get sale lifecycle state\n */\n getLifecycle = (params: QueryParams): Promise<GetLifecycleResponse> =>\n this.caller(params).get_lifecycle({});\n\n /**\n * Get sale lifecycle state\n */\n getFinalizationStatus = async (\n params: QueryParams,\n ): Promise<GetAutoFinalizationStatusResponse> => {\n try {\n return await this.caller(params).get_auto_finalization_status({});\n } catch (error) {\n // Throw a custom error if the method is not supported by the canister\n if (isMethodNotSupportedError(error)) {\n throw new UnsupportedMethodError(\"getFinalizationStatus\");\n }\n throw error;\n }\n };\n}\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.0-patch-typed-arrays.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({ IDL }) => {\n const NeuronBasketConstructionParameters = IDL.Record({\n dissolve_delay_interval_seconds: IDL.Nat64,\n count: IDL.Nat64,\n });\n const LinearScalingCoefficient = IDL.Record({\n slope_numerator: IDL.Opt(IDL.Nat64),\n intercept_icp_e8s: IDL.Opt(IDL.Nat64),\n from_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n slope_denominator: IDL.Opt(IDL.Nat64),\n to_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n });\n const IdealMatchedParticipationFunction = IDL.Record({\n serialized_representation: IDL.Opt(IDL.Text),\n });\n const NeuronsFundParticipationConstraints = IDL.Record({\n coefficient_intervals: IDL.Vec(LinearScalingCoefficient),\n max_neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n min_direct_participation_threshold_icp_e8s: IDL.Opt(IDL.Nat64),\n ideal_matched_participation_function: IDL.Opt(\n IdealMatchedParticipationFunction,\n ),\n });\n const Countries = IDL.Record({ iso_codes: IDL.Vec(IDL.Text) });\n const Init = IDL.Record({\n nns_proposal_id: IDL.Opt(IDL.Nat64),\n sns_root_canister_id: IDL.Text,\n neurons_fund_participation: IDL.Opt(IDL.Bool),\n min_participant_icp_e8s: IDL.Opt(IDL.Nat64),\n neuron_basket_construction_parameters: IDL.Opt(\n NeuronBasketConstructionParameters,\n ),\n fallback_controller_principal_ids: IDL.Vec(IDL.Text),\n max_icp_e8s: IDL.Opt(IDL.Nat64),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n confirmation_text: IDL.Opt(IDL.Text),\n swap_start_timestamp_seconds: IDL.Opt(IDL.Nat64),\n swap_due_timestamp_seconds: IDL.Opt(IDL.Nat64),\n min_participants: IDL.Opt(IDL.Nat32),\n sns_token_e8s: IDL.Opt(IDL.Nat64),\n nns_governance_canister_id: IDL.Text,\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n icp_ledger_canister_id: IDL.Text,\n sns_ledger_canister_id: IDL.Text,\n neurons_fund_participation_constraints: IDL.Opt(\n NeuronsFundParticipationConstraints,\n ),\n should_auto_finalize: IDL.Opt(IDL.Bool),\n max_participant_icp_e8s: IDL.Opt(IDL.Nat64),\n sns_governance_canister_id: IDL.Text,\n min_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n restricted_countries: IDL.Opt(Countries),\n min_icp_e8s: IDL.Opt(IDL.Nat64),\n max_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n });\n const ErrorRefundIcpRequest = IDL.Record({\n source_principal_id: IDL.Opt(IDL.Principal),\n });\n const Ok = IDL.Record({ block_height: IDL.Opt(IDL.Nat64) });\n const Err = IDL.Record({\n description: IDL.Opt(IDL.Text),\n error_type: IDL.Opt(IDL.Int32),\n });\n const Result = IDL.Variant({ Ok: Ok, Err: Err });\n const ErrorRefundIcpResponse = IDL.Record({ result: IDL.Opt(Result) });\n const CanisterCallError = IDL.Record({\n code: IDL.Opt(IDL.Int32),\n description: IDL.Text,\n });\n const FailedUpdate = IDL.Record({\n err: IDL.Opt(CanisterCallError),\n dapp_canister_id: IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n failed_updates: IDL.Vec(FailedUpdate),\n });\n const Possibility = IDL.Variant({\n Ok: SetDappControllersResponse,\n Err: CanisterCallError,\n });\n const SetDappControllersCallResult = IDL.Record({\n possibility: IDL.Opt(Possibility),\n });\n const SweepResult = IDL.Record({\n failure: IDL.Nat32,\n skipped: IDL.Nat32,\n invalid: IDL.Nat32,\n success: IDL.Nat32,\n global_failures: IDL.Nat32,\n });\n const GovernanceError = IDL.Record({\n error_message: IDL.Text,\n error_type: IDL.Int32,\n });\n const Response = IDL.Record({\n governance_error: IDL.Opt(GovernanceError),\n });\n const Possibility_1 = IDL.Variant({\n Ok: Response,\n Err: CanisterCallError,\n });\n const SettleCommunityFundParticipationResult = IDL.Record({\n possibility: IDL.Opt(Possibility_1),\n });\n const Ok_1 = IDL.Record({\n neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n neurons_fund_neurons_count: IDL.Opt(IDL.Nat64),\n });\n const Error = IDL.Record({ message: IDL.Opt(IDL.Text) });\n const Possibility_2 = IDL.Variant({ Ok: Ok_1, Err: Error });\n const SettleNeuronsFundParticipationResult = IDL.Record({\n possibility: IDL.Opt(Possibility_2),\n });\n const Possibility_3 = IDL.Variant({\n Ok: IDL.Record({}),\n Err: CanisterCallError,\n });\n const SetModeCallResult = IDL.Record({\n possibility: IDL.Opt(Possibility_3),\n });\n const FinalizeSwapResponse = IDL.Record({\n set_dapp_controllers_call_result: IDL.Opt(SetDappControllersCallResult),\n create_sns_neuron_recipes_result: IDL.Opt(SweepResult),\n settle_community_fund_participation_result: IDL.Opt(\n SettleCommunityFundParticipationResult,\n ),\n error_message: IDL.Opt(IDL.Text),\n settle_neurons_fund_participation_result: IDL.Opt(\n SettleNeuronsFundParticipationResult,\n ),\n set_mode_call_result: IDL.Opt(SetModeCallResult),\n sweep_icp_result: IDL.Opt(SweepResult),\n claim_neuron_result: IDL.Opt(SweepResult),\n sweep_sns_result: IDL.Opt(SweepResult),\n });\n const GetAutoFinalizationStatusResponse = IDL.Record({\n auto_finalize_swap_response: IDL.Opt(FinalizeSwapResponse),\n has_auto_finalize_been_attempted: IDL.Opt(IDL.Bool),\n is_auto_finalize_enabled: IDL.Opt(IDL.Bool),\n });\n const GetBuyerStateRequest = IDL.Record({\n principal_id: IDL.Opt(IDL.Principal),\n });\n const TransferableAmount = IDL.Record({\n transfer_fee_paid_e8s: IDL.Opt(IDL.Nat64),\n transfer_start_timestamp_seconds: IDL.Nat64,\n amount_e8s: IDL.Nat64,\n amount_transferred_e8s: IDL.Opt(IDL.Nat64),\n transfer_success_timestamp_seconds: IDL.Nat64,\n });\n const BuyerState = IDL.Record({\n icp: IDL.Opt(TransferableAmount),\n has_created_neuron_recipes: IDL.Opt(IDL.Bool),\n });\n const GetBuyerStateResponse = IDL.Record({\n buyer_state: IDL.Opt(BuyerState),\n });\n const GetBuyersTotalResponse = IDL.Record({ buyers_total: IDL.Nat64 });\n const MemoryMetrics = IDL.Record({\n wasm_binary_size: IDL.Opt(IDL.Nat),\n wasm_chunk_store_size: IDL.Opt(IDL.Nat),\n canister_history_size: IDL.Opt(IDL.Nat),\n stable_memory_size: IDL.Opt(IDL.Nat),\n snapshots_size: IDL.Opt(IDL.Nat),\n wasm_memory_size: IDL.Opt(IDL.Nat),\n global_memory_size: IDL.Opt(IDL.Nat),\n custom_sections_size: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusType = IDL.Variant({\n stopped: IDL.Null,\n stopping: IDL.Null,\n running: IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n freezing_threshold: IDL.Nat,\n wasm_memory_threshold: IDL.Opt(IDL.Nat),\n controllers: IDL.Vec(IDL.Principal),\n wasm_memory_limit: IDL.Opt(IDL.Nat),\n memory_allocation: IDL.Nat,\n compute_allocation: IDL.Nat,\n });\n const QueryStats = IDL.Record({\n response_payload_bytes_total: IDL.Opt(IDL.Nat),\n num_instructions_total: IDL.Opt(IDL.Nat),\n num_calls_total: IDL.Opt(IDL.Nat),\n request_payload_bytes_total: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusResultV2 = IDL.Record({\n memory_metrics: IDL.Opt(MemoryMetrics),\n status: CanisterStatusType,\n memory_size: IDL.Nat,\n cycles: IDL.Nat,\n settings: DefiniteCanisterSettingsArgs,\n query_stats: IDL.Opt(QueryStats),\n idle_cycles_burned_per_day: IDL.Nat,\n module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetDerivedStateResponse = IDL.Record({\n sns_tokens_per_icp: IDL.Opt(IDL.Float64),\n buyer_total_icp_e8s: IDL.Opt(IDL.Nat64),\n cf_participant_count: IDL.Opt(IDL.Nat64),\n neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n direct_participant_count: IDL.Opt(IDL.Nat64),\n cf_neuron_count: IDL.Opt(IDL.Nat64),\n });\n const GetInitResponse = IDL.Record({ init: IDL.Opt(Init) });\n const GetLifecycleResponse = IDL.Record({\n decentralization_sale_open_timestamp_seconds: IDL.Opt(IDL.Nat64),\n lifecycle: IDL.Opt(IDL.Int32),\n decentralization_swap_termination_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Icrc1Account = IDL.Record({\n owner: IDL.Opt(IDL.Principal),\n subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const Ticket = IDL.Record({\n creation_time: IDL.Nat64,\n ticket_id: IDL.Nat64,\n account: IDL.Opt(Icrc1Account),\n amount_icp_e8s: IDL.Nat64,\n });\n const Ok_2 = IDL.Record({ ticket: IDL.Opt(Ticket) });\n const Err_1 = IDL.Record({ error_type: IDL.Opt(IDL.Int32) });\n const Result_1 = IDL.Variant({ Ok: Ok_2, Err: Err_1 });\n const GetOpenTicketResponse = IDL.Record({ result: IDL.Opt(Result_1) });\n const Params = IDL.Record({\n min_participant_icp_e8s: IDL.Nat64,\n neuron_basket_construction_parameters: IDL.Opt(\n NeuronBasketConstructionParameters,\n ),\n max_icp_e8s: IDL.Nat64,\n swap_due_timestamp_seconds: IDL.Nat64,\n min_participants: IDL.Nat32,\n sns_token_e8s: IDL.Nat64,\n sale_delay_seconds: IDL.Opt(IDL.Nat64),\n max_participant_icp_e8s: IDL.Nat64,\n min_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n min_icp_e8s: IDL.Nat64,\n max_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n });\n const GetSaleParametersResponse = IDL.Record({ params: IDL.Opt(Params) });\n const NeuronId = IDL.Record({ id: IDL.Vec(IDL.Nat8) });\n const NeuronAttributes = IDL.Record({\n dissolve_delay_seconds: IDL.Nat64,\n memo: IDL.Nat64,\n followees: IDL.Vec(NeuronId),\n });\n const Principals = IDL.Record({ principals: IDL.Vec(IDL.Principal) });\n const CfInvestment = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n hotkey_principal: IDL.Text,\n hotkeys: IDL.Opt(Principals),\n nns_neuron_id: IDL.Nat64,\n });\n const DirectInvestment = IDL.Record({ buyer_principal: IDL.Text });\n const Investor = IDL.Variant({\n CommunityFund: CfInvestment,\n Direct: DirectInvestment,\n });\n const SnsNeuronRecipe = IDL.Record({\n sns: IDL.Opt(TransferableAmount),\n claimed_status: IDL.Opt(IDL.Int32),\n neuron_attributes: IDL.Opt(NeuronAttributes),\n investor: IDL.Opt(Investor),\n });\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const CfNeuron = IDL.Record({\n has_created_neuron_recipes: IDL.Opt(IDL.Bool),\n hotkeys: IDL.Opt(Principals),\n nns_neuron_id: IDL.Nat64,\n amount_icp_e8s: IDL.Nat64,\n });\n const CfParticipant = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n hotkey_principal: IDL.Text,\n cf_neurons: IDL.Vec(CfNeuron),\n });\n const Swap = IDL.Record({\n auto_finalize_swap_response: IDL.Opt(FinalizeSwapResponse),\n neuron_recipes: IDL.Vec(SnsNeuronRecipe),\n next_ticket_id: IDL.Opt(IDL.Nat64),\n decentralization_sale_open_timestamp_seconds: IDL.Opt(IDL.Nat64),\n finalize_swap_in_progress: IDL.Opt(IDL.Bool),\n timers: IDL.Opt(Timers),\n cf_participants: IDL.Vec(CfParticipant),\n init: IDL.Opt(Init),\n already_tried_to_auto_finalize: IDL.Opt(IDL.Bool),\n neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n purge_old_tickets_last_completion_timestamp_nanoseconds: IDL.Opt(IDL.Nat64),\n direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n lifecycle: IDL.Int32,\n purge_old_tickets_next_principal: IDL.Opt(IDL.Vec(IDL.Nat8)),\n decentralization_swap_termination_timestamp_seconds: IDL.Opt(IDL.Nat64),\n buyers: IDL.Vec(IDL.Tuple(IDL.Text, BuyerState)),\n params: IDL.Opt(Params),\n open_sns_token_swap_proposal_id: IDL.Opt(IDL.Nat64),\n });\n const DerivedState = IDL.Record({\n sns_tokens_per_icp: IDL.Float32,\n buyer_total_icp_e8s: IDL.Nat64,\n cf_participant_count: IDL.Opt(IDL.Nat64),\n neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n direct_participant_count: IDL.Opt(IDL.Nat64),\n cf_neuron_count: IDL.Opt(IDL.Nat64),\n });\n const GetStateResponse = IDL.Record({\n swap: IDL.Opt(Swap),\n derived: IDL.Opt(DerivedState),\n });\n const GetTimersResponse = IDL.Record({ timers: IDL.Opt(Timers) });\n const ListCommunityFundParticipantsRequest = IDL.Record({\n offset: IDL.Opt(IDL.Nat64),\n limit: IDL.Opt(IDL.Nat32),\n });\n const ListCommunityFundParticipantsResponse = IDL.Record({\n cf_participants: IDL.Vec(CfParticipant),\n });\n const ListDirectParticipantsRequest = IDL.Record({\n offset: IDL.Opt(IDL.Nat32),\n limit: IDL.Opt(IDL.Nat32),\n });\n const Participant = IDL.Record({\n participation: IDL.Opt(BuyerState),\n participant_id: IDL.Opt(IDL.Principal),\n });\n const ListDirectParticipantsResponse = IDL.Record({\n participants: IDL.Vec(Participant),\n });\n const ListSnsNeuronRecipesRequest = IDL.Record({\n offset: IDL.Opt(IDL.Nat64),\n limit: IDL.Opt(IDL.Nat32),\n });\n const ListSnsNeuronRecipesResponse = IDL.Record({\n sns_neuron_recipes: IDL.Vec(SnsNeuronRecipe),\n });\n const NewSaleTicketRequest = IDL.Record({\n subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),\n amount_icp_e8s: IDL.Nat64,\n });\n const InvalidUserAmount = IDL.Record({\n min_amount_icp_e8s_included: IDL.Nat64,\n max_amount_icp_e8s_included: IDL.Nat64,\n });\n const Err_2 = IDL.Record({\n invalid_user_amount: IDL.Opt(InvalidUserAmount),\n existing_ticket: IDL.Opt(Ticket),\n error_type: IDL.Int32,\n });\n const Result_2 = IDL.Variant({ Ok: Ok_2, Err: Err_2 });\n const NewSaleTicketResponse = IDL.Record({ result: IDL.Opt(Result_2) });\n const RefreshBuyerTokensRequest = IDL.Record({\n confirmation_text: IDL.Opt(IDL.Text),\n buyer: IDL.Text,\n });\n const RefreshBuyerTokensResponse = IDL.Record({\n icp_accepted_participation_e8s: IDL.Nat64,\n icp_ledger_account_balance_e8s: IDL.Nat64,\n });\n\n return IDL.Service({\n error_refund_icp: IDL.Func(\n [ErrorRefundIcpRequest],\n [ErrorRefundIcpResponse],\n [],\n ),\n finalize_swap: IDL.Func([IDL.Record({})], [FinalizeSwapResponse], []),\n get_auto_finalization_status: IDL.Func(\n [IDL.Record({})],\n [GetAutoFinalizationStatusResponse],\n [],\n ),\n get_buyer_state: IDL.Func(\n [GetBuyerStateRequest],\n [GetBuyerStateResponse],\n [],\n ),\n get_buyers_total: IDL.Func([IDL.Record({})], [GetBuyersTotalResponse], []),\n get_canister_status: IDL.Func(\n [IDL.Record({})],\n [CanisterStatusResultV2],\n [],\n ),\n get_derived_state: IDL.Func(\n [IDL.Record({})],\n [GetDerivedStateResponse],\n [],\n ),\n get_init: IDL.Func([IDL.Record({})], [GetInitResponse], []),\n get_lifecycle: IDL.Func([IDL.Record({})], [GetLifecycleResponse], []),\n get_open_ticket: IDL.Func([IDL.Record({})], [GetOpenTicketResponse], []),\n get_sale_parameters: IDL.Func(\n [IDL.Record({})],\n [GetSaleParametersResponse],\n [],\n ),\n get_state: IDL.Func([IDL.Record({})], [GetStateResponse], []),\n get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], []),\n list_community_fund_participants: IDL.Func(\n [ListCommunityFundParticipantsRequest],\n [ListCommunityFundParticipantsResponse],\n [],\n ),\n list_direct_participants: IDL.Func(\n [ListDirectParticipantsRequest],\n [ListDirectParticipantsResponse],\n [],\n ),\n list_sns_neuron_recipes: IDL.Func(\n [ListSnsNeuronRecipesRequest],\n [ListSnsNeuronRecipesResponse],\n [],\n ),\n new_sale_ticket: IDL.Func(\n [NewSaleTicketRequest],\n [NewSaleTicketResponse],\n [],\n ),\n notify_payment_failure: IDL.Func([IDL.Record({})], [Ok_2], []),\n refresh_buyer_tokens: IDL.Func(\n [RefreshBuyerTokensRequest],\n [RefreshBuyerTokensResponse],\n [],\n ),\n reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], []),\n });\n};\n\nexport const init = ({ IDL }) => {\n const NeuronBasketConstructionParameters = IDL.Record({\n dissolve_delay_interval_seconds: IDL.Nat64,\n count: IDL.Nat64,\n });\n const LinearScalingCoefficient = IDL.Record({\n slope_numerator: IDL.Opt(IDL.Nat64),\n intercept_icp_e8s: IDL.Opt(IDL.Nat64),\n from_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n slope_denominator: IDL.Opt(IDL.Nat64),\n to_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n });\n const IdealMatchedParticipationFunction = IDL.Record({\n serialized_representation: IDL.Opt(IDL.Text),\n });\n const NeuronsFundParticipationConstraints = IDL.Record({\n coefficient_intervals: IDL.Vec(LinearScalingCoefficient),\n max_neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n min_direct_participation_threshold_icp_e8s: IDL.Opt(IDL.Nat64),\n ideal_matched_participation_function: IDL.Opt(\n IdealMatchedParticipationFunction,\n ),\n });\n const Countries = IDL.Record({ iso_codes: IDL.Vec(IDL.Text) });\n const Init = IDL.Record({\n nns_proposal_id: IDL.Opt(IDL.Nat64),\n sns_root_canister_id: IDL.Text,\n neurons_fund_participation: IDL.Opt(IDL.Bool),\n min_participant_icp_e8s: IDL.Opt(IDL.Nat64),\n neuron_basket_construction_parameters: IDL.Opt(\n NeuronBasketConstructionParameters,\n ),\n fallback_controller_principal_ids: IDL.Vec(IDL.Text),\n max_icp_e8s: IDL.Opt(IDL.Nat64),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n confirmation_text: IDL.Opt(IDL.Text),\n swap_start_timestamp_seconds: IDL.Opt(IDL.Nat64),\n swap_due_timestamp_seconds: IDL.Opt(IDL.Nat64),\n min_participants: IDL.Opt(IDL.Nat32),\n sns_token_e8s: IDL.Opt(IDL.Nat64),\n nns_governance_canister_id: IDL.Text,\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n icp_ledger_canister_id: IDL.Text,\n sns_ledger_canister_id: IDL.Text,\n neurons_fund_participation_constraints: IDL.Opt(\n NeuronsFundParticipationConstraints,\n ),\n should_auto_finalize: IDL.Opt(IDL.Bool),\n max_participant_icp_e8s: IDL.Opt(IDL.Nat64),\n sns_governance_canister_id: IDL.Text,\n min_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n restricted_countries: IDL.Opt(Countries),\n min_icp_e8s: IDL.Opt(IDL.Nat64),\n max_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n });\n\n return [Init];\n};\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.0-patch-typed-arrays.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({ IDL }) => {\n const NeuronBasketConstructionParameters = IDL.Record({\n dissolve_delay_interval_seconds: IDL.Nat64,\n count: IDL.Nat64,\n });\n const LinearScalingCoefficient = IDL.Record({\n slope_numerator: IDL.Opt(IDL.Nat64),\n intercept_icp_e8s: IDL.Opt(IDL.Nat64),\n from_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n slope_denominator: IDL.Opt(IDL.Nat64),\n to_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n });\n const IdealMatchedParticipationFunction = IDL.Record({\n serialized_representation: IDL.Opt(IDL.Text),\n });\n const NeuronsFundParticipationConstraints = IDL.Record({\n coefficient_intervals: IDL.Vec(LinearScalingCoefficient),\n max_neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n min_direct_participation_threshold_icp_e8s: IDL.Opt(IDL.Nat64),\n ideal_matched_participation_function: IDL.Opt(\n IdealMatchedParticipationFunction,\n ),\n });\n const Countries = IDL.Record({ iso_codes: IDL.Vec(IDL.Text) });\n const Init = IDL.Record({\n nns_proposal_id: IDL.Opt(IDL.Nat64),\n sns_root_canister_id: IDL.Text,\n neurons_fund_participation: IDL.Opt(IDL.Bool),\n min_participant_icp_e8s: IDL.Opt(IDL.Nat64),\n neuron_basket_construction_parameters: IDL.Opt(\n NeuronBasketConstructionParameters,\n ),\n fallback_controller_principal_ids: IDL.Vec(IDL.Text),\n max_icp_e8s: IDL.Opt(IDL.Nat64),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n confirmation_text: IDL.Opt(IDL.Text),\n swap_start_timestamp_seconds: IDL.Opt(IDL.Nat64),\n swap_due_timestamp_seconds: IDL.Opt(IDL.Nat64),\n min_participants: IDL.Opt(IDL.Nat32),\n sns_token_e8s: IDL.Opt(IDL.Nat64),\n nns_governance_canister_id: IDL.Text,\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n icp_ledger_canister_id: IDL.Text,\n sns_ledger_canister_id: IDL.Text,\n neurons_fund_participation_constraints: IDL.Opt(\n NeuronsFundParticipationConstraints,\n ),\n should_auto_finalize: IDL.Opt(IDL.Bool),\n max_participant_icp_e8s: IDL.Opt(IDL.Nat64),\n sns_governance_canister_id: IDL.Text,\n min_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n restricted_countries: IDL.Opt(Countries),\n min_icp_e8s: IDL.Opt(IDL.Nat64),\n max_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n });\n const ErrorRefundIcpRequest = IDL.Record({\n source_principal_id: IDL.Opt(IDL.Principal),\n });\n const Ok = IDL.Record({ block_height: IDL.Opt(IDL.Nat64) });\n const Err = IDL.Record({\n description: IDL.Opt(IDL.Text),\n error_type: IDL.Opt(IDL.Int32),\n });\n const Result = IDL.Variant({ Ok: Ok, Err: Err });\n const ErrorRefundIcpResponse = IDL.Record({ result: IDL.Opt(Result) });\n const CanisterCallError = IDL.Record({\n code: IDL.Opt(IDL.Int32),\n description: IDL.Text,\n });\n const FailedUpdate = IDL.Record({\n err: IDL.Opt(CanisterCallError),\n dapp_canister_id: IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n failed_updates: IDL.Vec(FailedUpdate),\n });\n const Possibility = IDL.Variant({\n Ok: SetDappControllersResponse,\n Err: CanisterCallError,\n });\n const SetDappControllersCallResult = IDL.Record({\n possibility: IDL.Opt(Possibility),\n });\n const SweepResult = IDL.Record({\n failure: IDL.Nat32,\n skipped: IDL.Nat32,\n invalid: IDL.Nat32,\n success: IDL.Nat32,\n global_failures: IDL.Nat32,\n });\n const GovernanceError = IDL.Record({\n error_message: IDL.Text,\n error_type: IDL.Int32,\n });\n const Response = IDL.Record({\n governance_error: IDL.Opt(GovernanceError),\n });\n const Possibility_1 = IDL.Variant({\n Ok: Response,\n Err: CanisterCallError,\n });\n const SettleCommunityFundParticipationResult = IDL.Record({\n possibility: IDL.Opt(Possibility_1),\n });\n const Ok_1 = IDL.Record({\n neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n neurons_fund_neurons_count: IDL.Opt(IDL.Nat64),\n });\n const Error = IDL.Record({ message: IDL.Opt(IDL.Text) });\n const Possibility_2 = IDL.Variant({ Ok: Ok_1, Err: Error });\n const SettleNeuronsFundParticipationResult = IDL.Record({\n possibility: IDL.Opt(Possibility_2),\n });\n const Possibility_3 = IDL.Variant({\n Ok: IDL.Record({}),\n Err: CanisterCallError,\n });\n const SetModeCallResult = IDL.Record({\n possibility: IDL.Opt(Possibility_3),\n });\n const FinalizeSwapResponse = IDL.Record({\n set_dapp_controllers_call_result: IDL.Opt(SetDappControllersCallResult),\n create_sns_neuron_recipes_result: IDL.Opt(SweepResult),\n settle_community_fund_participation_result: IDL.Opt(\n SettleCommunityFundParticipationResult,\n ),\n error_message: IDL.Opt(IDL.Text),\n settle_neurons_fund_participation_result: IDL.Opt(\n SettleNeuronsFundParticipationResult,\n ),\n set_mode_call_result: IDL.Opt(SetModeCallResult),\n sweep_icp_result: IDL.Opt(SweepResult),\n claim_neuron_result: IDL.Opt(SweepResult),\n sweep_sns_result: IDL.Opt(SweepResult),\n });\n const GetAutoFinalizationStatusResponse = IDL.Record({\n auto_finalize_swap_response: IDL.Opt(FinalizeSwapResponse),\n has_auto_finalize_been_attempted: IDL.Opt(IDL.Bool),\n is_auto_finalize_enabled: IDL.Opt(IDL.Bool),\n });\n const GetBuyerStateRequest = IDL.Record({\n principal_id: IDL.Opt(IDL.Principal),\n });\n const TransferableAmount = IDL.Record({\n transfer_fee_paid_e8s: IDL.Opt(IDL.Nat64),\n transfer_start_timestamp_seconds: IDL.Nat64,\n amount_e8s: IDL.Nat64,\n amount_transferred_e8s: IDL.Opt(IDL.Nat64),\n transfer_success_timestamp_seconds: IDL.Nat64,\n });\n const BuyerState = IDL.Record({\n icp: IDL.Opt(TransferableAmount),\n has_created_neuron_recipes: IDL.Opt(IDL.Bool),\n });\n const GetBuyerStateResponse = IDL.Record({\n buyer_state: IDL.Opt(BuyerState),\n });\n const GetBuyersTotalResponse = IDL.Record({ buyers_total: IDL.Nat64 });\n const MemoryMetrics = IDL.Record({\n wasm_binary_size: IDL.Opt(IDL.Nat),\n wasm_chunk_store_size: IDL.Opt(IDL.Nat),\n canister_history_size: IDL.Opt(IDL.Nat),\n stable_memory_size: IDL.Opt(IDL.Nat),\n snapshots_size: IDL.Opt(IDL.Nat),\n wasm_memory_size: IDL.Opt(IDL.Nat),\n global_memory_size: IDL.Opt(IDL.Nat),\n custom_sections_size: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusType = IDL.Variant({\n stopped: IDL.Null,\n stopping: IDL.Null,\n running: IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n freezing_threshold: IDL.Nat,\n wasm_memory_threshold: IDL.Opt(IDL.Nat),\n controllers: IDL.Vec(IDL.Principal),\n wasm_memory_limit: IDL.Opt(IDL.Nat),\n memory_allocation: IDL.Nat,\n compute_allocation: IDL.Nat,\n });\n const QueryStats = IDL.Record({\n response_payload_bytes_total: IDL.Opt(IDL.Nat),\n num_instructions_total: IDL.Opt(IDL.Nat),\n num_calls_total: IDL.Opt(IDL.Nat),\n request_payload_bytes_total: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusResultV2 = IDL.Record({\n memory_metrics: IDL.Opt(MemoryMetrics),\n status: CanisterStatusType,\n memory_size: IDL.Nat,\n cycles: IDL.Nat,\n settings: DefiniteCanisterSettingsArgs,\n query_stats: IDL.Opt(QueryStats),\n idle_cycles_burned_per_day: IDL.Nat,\n module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetDerivedStateResponse = IDL.Record({\n sns_tokens_per_icp: IDL.Opt(IDL.Float64),\n buyer_total_icp_e8s: IDL.Opt(IDL.Nat64),\n cf_participant_count: IDL.Opt(IDL.Nat64),\n neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n direct_participant_count: IDL.Opt(IDL.Nat64),\n cf_neuron_count: IDL.Opt(IDL.Nat64),\n });\n const GetInitResponse = IDL.Record({ init: IDL.Opt(Init) });\n const GetLifecycleResponse = IDL.Record({\n decentralization_sale_open_timestamp_seconds: IDL.Opt(IDL.Nat64),\n lifecycle: IDL.Opt(IDL.Int32),\n decentralization_swap_termination_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Icrc1Account = IDL.Record({\n owner: IDL.Opt(IDL.Principal),\n subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const Ticket = IDL.Record({\n creation_time: IDL.Nat64,\n ticket_id: IDL.Nat64,\n account: IDL.Opt(Icrc1Account),\n amount_icp_e8s: IDL.Nat64,\n });\n const Ok_2 = IDL.Record({ ticket: IDL.Opt(Ticket) });\n const Err_1 = IDL.Record({ error_type: IDL.Opt(IDL.Int32) });\n const Result_1 = IDL.Variant({ Ok: Ok_2, Err: Err_1 });\n const GetOpenTicketResponse = IDL.Record({ result: IDL.Opt(Result_1) });\n const Params = IDL.Record({\n min_participant_icp_e8s: IDL.Nat64,\n neuron_basket_construction_parameters: IDL.Opt(\n NeuronBasketConstructionParameters,\n ),\n max_icp_e8s: IDL.Nat64,\n swap_due_timestamp_seconds: IDL.Nat64,\n min_participants: IDL.Nat32,\n sns_token_e8s: IDL.Nat64,\n sale_delay_seconds: IDL.Opt(IDL.Nat64),\n max_participant_icp_e8s: IDL.Nat64,\n min_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n min_icp_e8s: IDL.Nat64,\n max_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n });\n const GetSaleParametersResponse = IDL.Record({ params: IDL.Opt(Params) });\n const NeuronId = IDL.Record({ id: IDL.Vec(IDL.Nat8) });\n const NeuronAttributes = IDL.Record({\n dissolve_delay_seconds: IDL.Nat64,\n memo: IDL.Nat64,\n followees: IDL.Vec(NeuronId),\n });\n const Principals = IDL.Record({ principals: IDL.Vec(IDL.Principal) });\n const CfInvestment = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n hotkey_principal: IDL.Text,\n hotkeys: IDL.Opt(Principals),\n nns_neuron_id: IDL.Nat64,\n });\n const DirectInvestment = IDL.Record({ buyer_principal: IDL.Text });\n const Investor = IDL.Variant({\n CommunityFund: CfInvestment,\n Direct: DirectInvestment,\n });\n const SnsNeuronRecipe = IDL.Record({\n sns: IDL.Opt(TransferableAmount),\n claimed_status: IDL.Opt(IDL.Int32),\n neuron_attributes: IDL.Opt(NeuronAttributes),\n investor: IDL.Opt(Investor),\n });\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const CfNeuron = IDL.Record({\n has_created_neuron_recipes: IDL.Opt(IDL.Bool),\n hotkeys: IDL.Opt(Principals),\n nns_neuron_id: IDL.Nat64,\n amount_icp_e8s: IDL.Nat64,\n });\n const CfParticipant = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n hotkey_principal: IDL.Text,\n cf_neurons: IDL.Vec(CfNeuron),\n });\n const Swap = IDL.Record({\n auto_finalize_swap_response: IDL.Opt(FinalizeSwapResponse),\n neuron_recipes: IDL.Vec(SnsNeuronRecipe),\n next_ticket_id: IDL.Opt(IDL.Nat64),\n decentralization_sale_open_timestamp_seconds: IDL.Opt(IDL.Nat64),\n finalize_swap_in_progress: IDL.Opt(IDL.Bool),\n timers: IDL.Opt(Timers),\n cf_participants: IDL.Vec(CfParticipant),\n init: IDL.Opt(Init),\n already_tried_to_auto_finalize: IDL.Opt(IDL.Bool),\n neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n purge_old_tickets_last_completion_timestamp_nanoseconds: IDL.Opt(IDL.Nat64),\n direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n lifecycle: IDL.Int32,\n purge_old_tickets_next_principal: IDL.Opt(IDL.Vec(IDL.Nat8)),\n decentralization_swap_termination_timestamp_seconds: IDL.Opt(IDL.Nat64),\n buyers: IDL.Vec(IDL.Tuple(IDL.Text, BuyerState)),\n params: IDL.Opt(Params),\n open_sns_token_swap_proposal_id: IDL.Opt(IDL.Nat64),\n });\n const DerivedState = IDL.Record({\n sns_tokens_per_icp: IDL.Float32,\n buyer_total_icp_e8s: IDL.Nat64,\n cf_participant_count: IDL.Opt(IDL.Nat64),\n neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n direct_participant_count: IDL.Opt(IDL.Nat64),\n cf_neuron_count: IDL.Opt(IDL.Nat64),\n });\n const GetStateResponse = IDL.Record({\n swap: IDL.Opt(Swap),\n derived: IDL.Opt(DerivedState),\n });\n const GetTimersResponse = IDL.Record({ timers: IDL.Opt(Timers) });\n const ListCommunityFundParticipantsRequest = IDL.Record({\n offset: IDL.Opt(IDL.Nat64),\n limit: IDL.Opt(IDL.Nat32),\n });\n const ListCommunityFundParticipantsResponse = IDL.Record({\n cf_participants: IDL.Vec(CfParticipant),\n });\n const ListDirectParticipantsRequest = IDL.Record({\n offset: IDL.Opt(IDL.Nat32),\n limit: IDL.Opt(IDL.Nat32),\n });\n const Participant = IDL.Record({\n participation: IDL.Opt(BuyerState),\n participant_id: IDL.Opt(IDL.Principal),\n });\n const ListDirectParticipantsResponse = IDL.Record({\n participants: IDL.Vec(Participant),\n });\n const ListSnsNeuronRecipesRequest = IDL.Record({\n offset: IDL.Opt(IDL.Nat64),\n limit: IDL.Opt(IDL.Nat32),\n });\n const ListSnsNeuronRecipesResponse = IDL.Record({\n sns_neuron_recipes: IDL.Vec(SnsNeuronRecipe),\n });\n const NewSaleTicketRequest = IDL.Record({\n subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),\n amount_icp_e8s: IDL.Nat64,\n });\n const InvalidUserAmount = IDL.Record({\n min_amount_icp_e8s_included: IDL.Nat64,\n max_amount_icp_e8s_included: IDL.Nat64,\n });\n const Err_2 = IDL.Record({\n invalid_user_amount: IDL.Opt(InvalidUserAmount),\n existing_ticket: IDL.Opt(Ticket),\n error_type: IDL.Int32,\n });\n const Result_2 = IDL.Variant({ Ok: Ok_2, Err: Err_2 });\n const NewSaleTicketResponse = IDL.Record({ result: IDL.Opt(Result_2) });\n const RefreshBuyerTokensRequest = IDL.Record({\n confirmation_text: IDL.Opt(IDL.Text),\n buyer: IDL.Text,\n });\n const RefreshBuyerTokensResponse = IDL.Record({\n icp_accepted_participation_e8s: IDL.Nat64,\n icp_ledger_account_balance_e8s: IDL.Nat64,\n });\n\n return IDL.Service({\n error_refund_icp: IDL.Func(\n [ErrorRefundIcpRequest],\n [ErrorRefundIcpResponse],\n [],\n ),\n finalize_swap: IDL.Func([IDL.Record({})], [FinalizeSwapResponse], []),\n get_auto_finalization_status: IDL.Func(\n [IDL.Record({})],\n [GetAutoFinalizationStatusResponse],\n [\"query\"],\n ),\n get_buyer_state: IDL.Func(\n [GetBuyerStateRequest],\n [GetBuyerStateResponse],\n [\"query\"],\n ),\n get_buyers_total: IDL.Func([IDL.Record({})], [GetBuyersTotalResponse], []),\n get_canister_status: IDL.Func(\n [IDL.Record({})],\n [CanisterStatusResultV2],\n [],\n ),\n get_derived_state: IDL.Func(\n [IDL.Record({})],\n [GetDerivedStateResponse],\n [\"query\"],\n ),\n get_init: IDL.Func([IDL.Record({})], [GetInitResponse], [\"query\"]),\n get_lifecycle: IDL.Func(\n [IDL.Record({})],\n [GetLifecycleResponse],\n [\"query\"],\n ),\n get_open_ticket: IDL.Func(\n [IDL.Record({})],\n [GetOpenTicketResponse],\n [\"query\"],\n ),\n get_sale_parameters: IDL.Func(\n [IDL.Record({})],\n [GetSaleParametersResponse],\n [\"query\"],\n ),\n get_state: IDL.Func([IDL.Record({})], [GetStateResponse], [\"query\"]),\n get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], [\"query\"]),\n list_community_fund_participants: IDL.Func(\n [ListCommunityFundParticipantsRequest],\n [ListCommunityFundParticipantsResponse],\n [\"query\"],\n ),\n list_direct_participants: IDL.Func(\n [ListDirectParticipantsRequest],\n [ListDirectParticipantsResponse],\n [\"query\"],\n ),\n list_sns_neuron_recipes: IDL.Func(\n [ListSnsNeuronRecipesRequest],\n [ListSnsNeuronRecipesResponse],\n [\"query\"],\n ),\n new_sale_ticket: IDL.Func(\n [NewSaleTicketRequest],\n [NewSaleTicketResponse],\n [],\n ),\n notify_payment_failure: IDL.Func([IDL.Record({})], [Ok_2], []),\n refresh_buyer_tokens: IDL.Func(\n [RefreshBuyerTokensRequest],\n [RefreshBuyerTokensResponse],\n [],\n ),\n reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], []),\n });\n};\n\nexport const init = ({ IDL }) => {\n const NeuronBasketConstructionParameters = IDL.Record({\n dissolve_delay_interval_seconds: IDL.Nat64,\n count: IDL.Nat64,\n });\n const LinearScalingCoefficient = IDL.Record({\n slope_numerator: IDL.Opt(IDL.Nat64),\n intercept_icp_e8s: IDL.Opt(IDL.Nat64),\n from_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n slope_denominator: IDL.Opt(IDL.Nat64),\n to_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n });\n const IdealMatchedParticipationFunction = IDL.Record({\n serialized_representation: IDL.Opt(IDL.Text),\n });\n const NeuronsFundParticipationConstraints = IDL.Record({\n coefficient_intervals: IDL.Vec(LinearScalingCoefficient),\n max_neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n min_direct_participation_threshold_icp_e8s: IDL.Opt(IDL.Nat64),\n ideal_matched_participation_function: IDL.Opt(\n IdealMatchedParticipationFunction,\n ),\n });\n const Countries = IDL.Record({ iso_codes: IDL.Vec(IDL.Text) });\n const Init = IDL.Record({\n nns_proposal_id: IDL.Opt(IDL.Nat64),\n sns_root_canister_id: IDL.Text,\n neurons_fund_participation: IDL.Opt(IDL.Bool),\n min_participant_icp_e8s: IDL.Opt(IDL.Nat64),\n neuron_basket_construction_parameters: IDL.Opt(\n NeuronBasketConstructionParameters,\n ),\n fallback_controller_principal_ids: IDL.Vec(IDL.Text),\n max_icp_e8s: IDL.Opt(IDL.Nat64),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n confirmation_text: IDL.Opt(IDL.Text),\n swap_start_timestamp_seconds: IDL.Opt(IDL.Nat64),\n swap_due_timestamp_seconds: IDL.Opt(IDL.Nat64),\n min_participants: IDL.Opt(IDL.Nat32),\n sns_token_e8s: IDL.Opt(IDL.Nat64),\n nns_governance_canister_id: IDL.Text,\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n icp_ledger_canister_id: IDL.Text,\n sns_ledger_canister_id: IDL.Text,\n neurons_fund_participation_constraints: IDL.Opt(\n NeuronsFundParticipationConstraints,\n ),\n should_auto_finalize: IDL.Opt(IDL.Bool),\n max_participant_icp_e8s: IDL.Opt(IDL.Nat64),\n sns_governance_canister_id: IDL.Text,\n min_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n restricted_countries: IDL.Opt(Countries),\n min_icp_e8s: IDL.Opt(IDL.Nat64),\n max_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n });\n\n return [Init];\n};\n", "import type { NewSaleTicketRequest } from \"../candid/sns_swap\";\nimport type { NewSaleTicketParams } from \"../types/swap.params\";\n\n// Helper for building `NewSaleTicketRequest` structure\nexport const toNewSaleTicketRequest = ({\n subaccount,\n amount_icp_e8s,\n}: NewSaleTicketParams): NewSaleTicketRequest => ({\n subaccount: subaccount === undefined ? [] : [subaccount],\n amount_icp_e8s,\n});\n", "import { nonNullish } from \"@dfinity/utils\";\n\n/**\n * Identifies errors of method not being present in the canister.\n *\n * This is useful because SNS projects have different versions of SNS canisters.\n * Therefore, what works in the latest version might not work in the previous one.\n *\n * Error message example: \"Call was rejected:\n * Request ID: 3a6ef904b35fd19721c95c3df2b0b00b8abefba7f0ad188f5c472809b772c914\n * Reject code: 3\n * Reject text: Canister 75ffu-oaaaa-aaaaa-aabbq-cai has no update method 'get_auto_finalization_status'\"\n */\nexport const isMethodNotSupportedError = (err: unknown): boolean => {\n if (typeof err === \"object\" && nonNullish(err) && \"message\" in err) {\n const message = err.message as string;\n return (\n message.includes(\"has no update method\") ||\n message.includes(\"has no query method\")\n );\n }\n return false;\n};\n"],
4
+ "sourcesContent": ["import type { IcrcAccount } from \"@dfinity/ledger-icrc\";\nimport {\n assertNever,\n fromNullable,\n jsonReplacer,\n toNullable,\n} from \"@dfinity/utils\";\nimport type {\n Account,\n Action as ActionCandid,\n AdvanceSnsTargetVersion as AdvanceSnsTargetVersionCandid,\n ChunkedCanisterWasm as ChunkedCanisterWasmCandid,\n Command,\n ExecuteExtensionOperation as ExecuteExtensionOperationCandid,\n ExtensionOperationArg as ExtensionOperationArgCandid,\n ExtensionUpgradeArg as ExtensionUpgradeArgCandid,\n FunctionType as FunctionTypeCandid,\n GenericNervousSystemFunction as GenericNervousSystemFunctionCandid,\n ListProposals,\n ManageDappCanisterSettings as ManageDappCanisterSettingsCandid,\n ManageLedgerParameters as ManageLedgerParametersCandid,\n ManageNeuron,\n ManageSnsMetadata as ManageSnsMetadataCandid,\n MintSnsTokens as MintSnsTokensCandid,\n NervousSystemFunction as NervousSystemFunctionCandid,\n NervousSystemParameters as NervousSystemParametersCandid,\n NeuronId,\n Operation,\n PreciseValue as PreciseValueCandid,\n RegisterExtension as RegisterExtensionCandid,\n SnsVersion as SnsVersionCandid,\n TransferSnsTreasuryFunds as TransferSnsTreasuryFundsCandid,\n UpgradeExtension as UpgradeExtensionCandid,\n UpgradeSnsControlledCanister as UpgradeSnsControlledCanisterCandid,\n VotingRewardsParameters as VotingRewardsParametersCandid,\n Wasm as WasmCandid,\n} from \"../candid/sns_governance\";\nimport { DEFAULT_PROPOSALS_LIMIT } from \"../constants/governance.constants\";\nimport type {\n Action,\n AdvanceSnsTargetVersion,\n ChunkedCanisterWasm,\n ExecuteExtensionOperation,\n ExtensionOperationArg,\n ExtensionUpgradeArg,\n FunctionType,\n GenericNervousSystemFunction,\n ManageDappCanisterSettings,\n ManageLedgerParameters,\n ManageSnsMetadata,\n MintSnsTokens,\n NervousSystemFunction,\n NervousSystemParameters,\n PreciseValue,\n RegisterExtension,\n SnsVersion,\n TransferSnsTreasuryFunds,\n UpgradeExtension,\n UpgradeSnsControlledCanister,\n VotingRewardsParameters,\n Wasm,\n} from \"../types/actions\";\nimport type {\n SnsClaimOrRefreshArgs,\n SnsDisburseNeuronParams,\n SnsIncreaseDissolveDelayParams,\n SnsListProposalsParams,\n SnsNeuronAutoStakeMaturityParams,\n SnsNeuronDisburseMaturityParams,\n SnsNeuronPermissionsParams,\n SnsNeuronStakeMaturityParams,\n SnsRegisterVoteParams,\n SnsSetDissolveTimestampParams,\n SnsSetFollowingParams,\n SnsSetTopicFollowees,\n SnsSplitNeuronParams,\n} from \"../types/governance.params\";\n\n// Helper for building `ManageNeuron` structure\nconst toManageNeuronCommand = ({\n neuronId: { id },\n command,\n}: {\n neuronId: NeuronId;\n command: Command;\n}): ManageNeuron => ({\n subaccount: id,\n command: [command],\n});\n\n// Helper for building `ManageNeuron` structure for type `Operation` commands\nconst toManageNeuronConfigureCommand = ({\n neuronId,\n operation,\n}: {\n neuronId: NeuronId;\n operation: Operation;\n}): ManageNeuron =>\n toManageNeuronCommand({\n neuronId,\n command: {\n Configure: {\n operation: [operation],\n },\n },\n });\n\nexport const toCandidAccount = ({\n owner,\n subaccount,\n}: IcrcAccount): Account => ({\n owner: toNullable(owner),\n subaccount: subaccount === undefined ? [] : toNullable({ subaccount }),\n});\n\nexport const toAddPermissionsRequest = ({\n neuronId,\n permissions,\n principal,\n}: SnsNeuronPermissionsParams): ManageNeuron =>\n toManageNeuronCommand({\n neuronId,\n command: {\n AddNeuronPermissions: {\n permissions_to_add: [{ permissions: Int32Array.from(permissions) }],\n principal_id: [principal],\n },\n },\n });\n\nexport const toRemovePermissionsRequest = ({\n neuronId,\n permissions,\n principal,\n}: SnsNeuronPermissionsParams): ManageNeuron =>\n toManageNeuronCommand({\n neuronId,\n command: {\n RemoveNeuronPermissions: {\n permissions_to_remove: [{ permissions: Int32Array.from(permissions) }],\n principal_id: [principal],\n },\n },\n });\n\nexport const toSplitNeuronRequest = ({\n neuronId,\n memo,\n amount: amount_e8s,\n}: SnsSplitNeuronParams): ManageNeuron =>\n toManageNeuronCommand({\n neuronId,\n command: {\n Split: {\n memo,\n amount_e8s,\n },\n },\n });\n\nexport const toDisburseNeuronRequest = ({\n neuronId,\n amount,\n toAccount,\n}: SnsDisburseNeuronParams): ManageNeuron =>\n toManageNeuronCommand({\n neuronId,\n command: {\n Disburse: {\n // currently there is a main account only support\n to_account:\n toAccount === undefined ? [] : toNullable(toCandidAccount(toAccount)),\n amount:\n amount === undefined\n ? []\n : [\n {\n e8s: amount,\n },\n ],\n },\n },\n });\n\nexport const toStartDissolvingNeuronRequest = (\n neuronId: NeuronId,\n): ManageNeuron =>\n toManageNeuronConfigureCommand({\n neuronId,\n operation: { StartDissolving: {} },\n });\n\nexport const toStopDissolvingNeuronRequest = (\n neuronId: NeuronId,\n): ManageNeuron =>\n toManageNeuronConfigureCommand({\n neuronId,\n operation: { StopDissolving: {} },\n });\n\nexport const toStakeMaturityRequest = ({\n neuronId,\n percentageToStake,\n}: SnsNeuronStakeMaturityParams): ManageNeuron =>\n toManageNeuronCommand({\n neuronId,\n command: {\n StakeMaturity: {\n percentage_to_stake: toNullable(percentageToStake),\n },\n },\n });\n\nexport const toDisburseMaturityRequest = ({\n neuronId,\n percentageToDisburse,\n toAccount,\n}: SnsNeuronDisburseMaturityParams): ManageNeuron =>\n toManageNeuronCommand({\n neuronId,\n command: {\n DisburseMaturity: {\n // currently there is a main account only support\n to_account:\n toAccount === undefined ? [] : toNullable(toCandidAccount(toAccount)),\n percentage_to_disburse: percentageToDisburse,\n },\n },\n });\n\nexport const toAutoStakeMaturityNeuronRequest = ({\n neuronId,\n autoStake: requested_setting_for_auto_stake_maturity,\n}: SnsNeuronAutoStakeMaturityParams): ManageNeuron =>\n toManageNeuronConfigureCommand({\n neuronId,\n operation: {\n ChangeAutoStakeMaturity: {\n requested_setting_for_auto_stake_maturity,\n },\n },\n });\n\nexport const toSetDissolveTimestampRequest = ({\n neuronId,\n dissolveTimestampSeconds,\n}: SnsSetDissolveTimestampParams): ManageNeuron =>\n toManageNeuronConfigureCommand({\n neuronId,\n operation: {\n SetDissolveTimestamp: {\n dissolve_timestamp_seconds: dissolveTimestampSeconds,\n },\n },\n });\n\nexport const toIncreaseDissolveDelayRequest = ({\n neuronId,\n additionalDissolveDelaySeconds,\n}: SnsIncreaseDissolveDelayParams): ManageNeuron =>\n toManageNeuronConfigureCommand({\n neuronId,\n operation: {\n IncreaseDissolveDelay: {\n additional_dissolve_delay_seconds: additionalDissolveDelaySeconds,\n },\n },\n });\n\nexport const toFollowRequest = ({\n neuronId,\n functionId,\n followees,\n}: SnsSetTopicFollowees): ManageNeuron => ({\n subaccount: neuronId.id,\n command: [\n {\n Follow: {\n function_id: functionId,\n followees,\n },\n },\n ],\n});\n\nexport const toSetFollowingRequest = ({\n neuronId,\n topicFollowing,\n}: SnsSetFollowingParams): ManageNeuron => ({\n subaccount: neuronId.id,\n command: [\n {\n SetFollowing: {\n topic_following: topicFollowing.map(({ topic, followees }) => ({\n topic: [topic],\n followees: followees.map(({ neuronId, alias }) => ({\n neuron_id: toNullable(neuronId),\n alias: toNullable(alias),\n })),\n })),\n },\n },\n ],\n});\n\nexport const toRegisterVoteRequest = ({\n neuronId,\n proposalId,\n vote,\n}: SnsRegisterVoteParams): ManageNeuron => ({\n subaccount: neuronId.id,\n command: [\n {\n RegisterVote: {\n vote,\n proposal: [proposalId],\n },\n },\n ],\n});\n\nexport const toClaimOrRefreshRequest = ({\n subaccount,\n memo,\n controller,\n}: SnsClaimOrRefreshArgs): ManageNeuron => ({\n subaccount,\n command: [\n {\n ClaimOrRefresh: {\n by: [\n // If memo is not passed, we consider it a neuronId request because the memo is mandatory for MemoAndController\n memo === undefined\n ? { NeuronId: {} }\n : {\n MemoAndController: { memo, controller: toNullable(controller) },\n },\n ],\n },\n },\n ],\n});\n\nexport const toListProposalRequest = ({\n excludeType,\n beforeProposal,\n includeRewardStatus,\n includeStatus,\n limit,\n includeTopics,\n}: SnsListProposalsParams): ListProposals => ({\n exclude_type: BigUint64Array.from(excludeType ?? []),\n before_proposal: toNullable(beforeProposal),\n include_reward_status: Int32Array.from(includeRewardStatus ?? []),\n include_status: Int32Array.from(includeStatus ?? []),\n limit: limit ?? DEFAULT_PROPOSALS_LIMIT,\n include_topics: toNullable(\n includeTopics?.map((topic) => ({\n topic: toNullable(topic),\n })) ?? [],\n ),\n});\n\nexport const fromCandidAction = (action: ActionCandid): Action => {\n if (\"ManageNervousSystemParameters\" in action) {\n return {\n ManageNervousSystemParameters: convertNervousSystemParams(\n action.ManageNervousSystemParameters,\n ),\n };\n }\n\n if (\"AdvanceSnsTargetVersion\" in action) {\n return {\n AdvanceSnsTargetVersion: convertAdvanceSnsTargetVersion(\n action.AdvanceSnsTargetVersion,\n ),\n };\n }\n\n if (\"AddGenericNervousSystemFunction\" in action) {\n return {\n AddGenericNervousSystemFunction: convertNervousSystemFunction(\n action.AddGenericNervousSystemFunction,\n ),\n };\n }\n\n if (\"ManageDappCanisterSettings\" in action) {\n return {\n ManageDappCanisterSettings: convertManageDappCanisterSettings(\n action.ManageDappCanisterSettings,\n ),\n };\n }\n\n if (\"ManageLedgerParameters\" in action) {\n return {\n ManageLedgerParameters: convertManageLedgerParameters(\n action.ManageLedgerParameters,\n ),\n };\n }\n\n if (\"ExecuteExtensionOperation\" in action) {\n return {\n ExecuteExtensionOperation: convertExecuteExtensionOperation(\n action.ExecuteExtensionOperation,\n ),\n };\n }\n\n if (\"UpgradeExtension\" in action) {\n return {\n UpgradeExtension: convertUpgradeExtension(action.UpgradeExtension),\n };\n }\n\n if (\"SetTopicsForCustomProposals\" in action) {\n return {\n SetTopicsForCustomProposals: action.SetTopicsForCustomProposals,\n };\n }\n\n if (\"RegisterExtension\" in action) {\n return {\n RegisterExtension: convertRegisterExtension(action.RegisterExtension),\n };\n }\n\n if (\"RemoveGenericNervousSystemFunction\" in action) {\n return {\n RemoveGenericNervousSystemFunction:\n action.RemoveGenericNervousSystemFunction,\n };\n }\n\n if (\"UpgradeSnsToNextVersion\" in action) {\n return { UpgradeSnsToNextVersion: action.UpgradeSnsToNextVersion };\n }\n\n if (\"RegisterDappCanisters\" in action) {\n return { RegisterDappCanisters: action.RegisterDappCanisters };\n }\n\n if (\"TransferSnsTreasuryFunds\" in action) {\n return {\n TransferSnsTreasuryFunds: convertTransferSnsTreasuryFunds(\n action.TransferSnsTreasuryFunds,\n ),\n };\n }\n\n if (\"UpgradeSnsControlledCanister\" in action) {\n return {\n UpgradeSnsControlledCanister: convertUpgradeSnsControlledCanister(\n action.UpgradeSnsControlledCanister,\n ),\n };\n }\n\n if (\"DeregisterDappCanisters\" in action) {\n return { DeregisterDappCanisters: action.DeregisterDappCanisters };\n }\n\n if (\"MintSnsTokens\" in action) {\n return {\n MintSnsTokens: convertMintSnsTokens(action.MintSnsTokens),\n };\n }\n\n if (\"Unspecified\" in action) {\n return { Unspecified: action.Unspecified };\n }\n\n if (\"ManageSnsMetadata\" in action) {\n return {\n ManageSnsMetadata: convertManageSnsMetadata(action.ManageSnsMetadata),\n };\n }\n\n if (\"ExecuteGenericNervousSystemFunction\" in action) {\n return {\n ExecuteGenericNervousSystemFunction:\n action.ExecuteGenericNervousSystemFunction,\n };\n }\n\n if (\"Motion\" in action) {\n return { Motion: action.Motion };\n }\n\n assertNever(action, `Unknown action type ${JSON.stringify(action)}`);\n};\n\nconst convertManageSnsMetadata = (\n params: ManageSnsMetadataCandid,\n): ManageSnsMetadata => ({\n url: fromNullable(params.url),\n logo: fromNullable(params.logo),\n name: fromNullable(params.name),\n description: fromNullable(params.description),\n});\n\nconst convertManageLedgerParameters = (\n params: ManageLedgerParametersCandid,\n): ManageLedgerParameters => ({\n token_symbol: fromNullable(params.token_symbol),\n transfer_fee: fromNullable(params.transfer_fee),\n token_logo: fromNullable(params.token_logo),\n token_name: fromNullable(params.token_name),\n});\n\nconst convertAdvanceSnsTargetVersion = (\n params: AdvanceSnsTargetVersionCandid,\n): AdvanceSnsTargetVersion => ({\n new_target: convertSnsVersion(fromNullable(params.new_target)),\n});\n\nconst convertManageDappCanisterSettings = (\n params: ManageDappCanisterSettingsCandid,\n): ManageDappCanisterSettings => ({\n freezing_threshold: fromNullable(params.freezing_threshold),\n wasm_memory_threshold: fromNullable(params.wasm_memory_threshold),\n canister_ids: params.canister_ids,\n reserved_cycles_limit: fromNullable(params.reserved_cycles_limit),\n log_visibility: fromNullable(params.log_visibility),\n wasm_memory_limit: fromNullable(params.wasm_memory_limit),\n memory_allocation: fromNullable(params.memory_allocation),\n compute_allocation: fromNullable(params.compute_allocation),\n});\n\nconst convertExecuteExtensionOperation = (\n params: ExecuteExtensionOperationCandid,\n): ExecuteExtensionOperation => ({\n extension_canister_id: fromNullable(params.extension_canister_id),\n operation_name: fromNullable(params.operation_name),\n operation_arg: convertExtensionOperationArg(\n fromNullable(params.operation_arg),\n ),\n});\n\nconst convertUpgradeExtension = (\n params: UpgradeExtensionCandid,\n): UpgradeExtension => ({\n extension_canister_id: fromNullable(params.extension_canister_id),\n wasm: convertWasm(fromNullable(params.wasm)),\n canister_upgrade_arg: convertExtensionUpgradeArg(\n fromNullable(params.canister_upgrade_arg),\n ),\n});\n\nconst convertChunkedCanisterWasm = (\n params: ChunkedCanisterWasmCandid,\n): ChunkedCanisterWasm => ({\n wasm_module_hash: params.wasm_module_hash,\n store_canister_id: fromNullable(params.store_canister_id),\n chunk_hashes_list: params.chunk_hashes_list,\n});\n\nconst convertExtensionOperationArg = (\n params: ExtensionOperationArgCandid | undefined,\n): ExtensionOperationArg | undefined =>\n convertExtensionArg(params) as ExtensionOperationArg | undefined;\n\nconst convertExtensionUpgradeArg = (\n params: ExtensionUpgradeArgCandid | undefined,\n): ExtensionUpgradeArg | undefined =>\n convertExtensionArg(params) as ExtensionUpgradeArg | undefined;\n\nconst convertExtensionArg = (\n params: ExtensionOperationArgCandid | ExtensionUpgradeArgCandid | undefined,\n):\n | {\n value: PreciseValue | undefined;\n }\n | undefined => {\n if (params === undefined) {\n return undefined;\n }\n\n const preciseValue = fromNullable(params.value);\n\n return {\n value:\n preciseValue === undefined\n ? undefined\n : convertPreciseValue(preciseValue),\n };\n};\n\nconst convertPreciseValue = (value: PreciseValueCandid): PreciseValue => {\n if (\"Int\" in value) {\n return { Int: value.Int };\n }\n\n if (\"Nat\" in value) {\n return { Nat: value.Nat };\n }\n\n if (\"Blob\" in value) {\n return { Blob: value.Blob };\n }\n\n if (\"Bool\" in value) {\n return { Bool: value.Bool };\n }\n\n if (\"Text\" in value) {\n return { Text: value.Text };\n }\n\n if (\"Array\" in value) {\n return {\n Array: value.Array.map(convertPreciseValue),\n };\n }\n\n if (\"Map\" in value) {\n return {\n Map: value.Map.map(([key, val]) => [key, convertPreciseValue(val)]),\n };\n }\n\n assertNever(\n value,\n `Unknown PreciseValue ${JSON.stringify(value, jsonReplacer)}`,\n );\n};\n\nconst convertWasm = (params: WasmCandid | undefined): Wasm | undefined => {\n if (params === undefined) {\n return undefined;\n }\n\n if (\"Chunked\" in params) {\n return {\n Chunked: convertChunkedCanisterWasm(params.Chunked),\n };\n }\n\n if (\"Bytes\" in params) {\n return { Bytes: params.Bytes };\n }\n\n assertNever(\n params,\n `Unknown Wasm type ${JSON.stringify(params, jsonReplacer)}`,\n );\n};\n\nconst convertUpgradeSnsControlledCanister = (\n params: UpgradeSnsControlledCanisterCandid,\n): UpgradeSnsControlledCanister => ({\n new_canister_wasm: params.new_canister_wasm,\n chunked_canister_wasm:\n params.chunked_canister_wasm?.[0] !== undefined\n ? convertChunkedCanisterWasm(params.chunked_canister_wasm[0])\n : undefined,\n canister_id: fromNullable(params.canister_id),\n canister_upgrade_arg: fromNullable(params.canister_upgrade_arg),\n mode: fromNullable(params.mode),\n});\n\nconst convertTransferSnsTreasuryFunds = (\n params: TransferSnsTreasuryFundsCandid,\n): TransferSnsTreasuryFunds => ({\n from_treasury: params.from_treasury,\n to_principal: fromNullable(params.to_principal),\n to_subaccount: fromNullable(params.to_subaccount),\n memo: fromNullable(params.memo),\n amount_e8s: params.amount_e8s,\n});\n\nconst convertMintSnsTokens = (params: MintSnsTokensCandid): MintSnsTokens => ({\n to_principal: fromNullable(params.to_principal),\n to_subaccount: fromNullable(params.to_subaccount),\n memo: fromNullable(params.memo),\n amount_e8s: fromNullable(params.amount_e8s),\n});\n\nconst convertSnsVersion = (\n params: SnsVersionCandid | undefined,\n): SnsVersion | undefined => {\n if (params === undefined) {\n return undefined;\n }\n\n return {\n archive_wasm_hash: fromNullable(params.archive_wasm_hash),\n root_wasm_hash: fromNullable(params.root_wasm_hash),\n swap_wasm_hash: fromNullable(params.swap_wasm_hash),\n ledger_wasm_hash: fromNullable(params.ledger_wasm_hash),\n governance_wasm_hash: fromNullable(params.governance_wasm_hash),\n index_wasm_hash: fromNullable(params.index_wasm_hash),\n };\n};\n\nconst convertGenericNervousSystemFunction = (\n params: GenericNervousSystemFunctionCandid,\n): GenericNervousSystemFunction => ({\n validator_canister_id: fromNullable(params.validator_canister_id),\n target_canister_id: fromNullable(params.target_canister_id),\n validator_method_name: fromNullable(params.validator_method_name),\n target_method_name: fromNullable(params.target_method_name),\n topic: fromNullable(params.topic),\n});\n\nconst convertFunctionType = (\n params: FunctionTypeCandid | undefined,\n): FunctionType | undefined => {\n if (params === undefined) {\n return undefined;\n }\n\n if (\"NativeNervousSystemFunction\" in params) {\n return { NativeNervousSystemFunction: params.NativeNervousSystemFunction };\n }\n\n if (\"GenericNervousSystemFunction\" in params) {\n return {\n GenericNervousSystemFunction: convertGenericNervousSystemFunction(\n params.GenericNervousSystemFunction,\n ),\n };\n }\n\n assertNever(params, `Unknown FunctionType ${JSON.stringify(params)}`);\n};\n\nconst convertNervousSystemFunction = (\n params: NervousSystemFunctionCandid,\n): NervousSystemFunction => ({\n id: params.id,\n name: params.name,\n description: fromNullable(params.description),\n function_type: convertFunctionType(fromNullable(params.function_type)),\n});\n\nconst convertVotingRewardsParameters = (\n params: VotingRewardsParametersCandid | undefined,\n): VotingRewardsParameters | undefined =>\n params && {\n final_reward_rate_basis_points: fromNullable(\n params.final_reward_rate_basis_points,\n ),\n initial_reward_rate_basis_points: fromNullable(\n params.initial_reward_rate_basis_points,\n ),\n reward_rate_transition_duration_seconds: fromNullable(\n params.reward_rate_transition_duration_seconds,\n ),\n round_duration_seconds: fromNullable(params.round_duration_seconds),\n };\n\nconst convertNervousSystemParams = (\n params: NervousSystemParametersCandid,\n): NervousSystemParameters => ({\n default_followees: fromNullable(params.default_followees),\n max_dissolve_delay_seconds: fromNullable(params.max_dissolve_delay_seconds),\n max_dissolve_delay_bonus_percentage: fromNullable(\n params.max_dissolve_delay_bonus_percentage,\n ),\n max_followees_per_function: fromNullable(params.max_followees_per_function),\n neuron_claimer_permissions: fromNullable(params.neuron_claimer_permissions),\n neuron_minimum_stake_e8s: fromNullable(params.neuron_minimum_stake_e8s),\n max_neuron_age_for_age_bonus: fromNullable(\n params.max_neuron_age_for_age_bonus,\n ),\n initial_voting_period_seconds: fromNullable(\n params.initial_voting_period_seconds,\n ),\n neuron_minimum_dissolve_delay_to_vote_seconds: fromNullable(\n params.neuron_minimum_dissolve_delay_to_vote_seconds,\n ),\n reject_cost_e8s: fromNullable(params.reject_cost_e8s),\n max_proposals_to_keep_per_action: fromNullable(\n params.max_proposals_to_keep_per_action,\n ),\n wait_for_quiet_deadline_increase_seconds: fromNullable(\n params.wait_for_quiet_deadline_increase_seconds,\n ),\n max_number_of_neurons: fromNullable(params.max_number_of_neurons),\n transaction_fee_e8s: fromNullable(params.transaction_fee_e8s),\n max_number_of_proposals_with_ballots: fromNullable(\n params.max_number_of_proposals_with_ballots,\n ),\n max_age_bonus_percentage: fromNullable(params.max_age_bonus_percentage),\n neuron_grantable_permissions: fromNullable(\n params.neuron_grantable_permissions,\n ),\n voting_rewards_parameters: convertVotingRewardsParameters(\n fromNullable(params.voting_rewards_parameters),\n ),\n max_number_of_principals_per_neuron: fromNullable(\n params.max_number_of_principals_per_neuron,\n ),\n automatically_advance_target_version: fromNullable(\n params.automatically_advance_target_version,\n ),\n});\n\nconst convertRegisterExtension = (\n params: RegisterExtensionCandid,\n): RegisterExtension => ({\n chunked_canister_wasm:\n params.chunked_canister_wasm?.[0] !== undefined\n ? convertChunkedCanisterWasm(params.chunked_canister_wasm[0])\n : undefined,\n extension_init: fromNullable(params.extension_init),\n});\n", "// Source: https://github.com/dfinity/ic/blob/master/rs/sns/governance/proto/ic_sns_governance/pb/v1/governance.proto\nexport enum SnsNeuronPermissionType {\n NEURON_PERMISSION_TYPE_UNSPECIFIED = 0,\n\n // The principal has permission to configure the neuron's dissolve state. This includes\n // start dissolving, stop dissolving, and increasing the dissolve delay for the neuron.\n NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE = 1,\n\n // The principal has permission to add additional principals to modify the neuron.\n // The nervous system parameter `NervousSystemParameters::neuron_grantable_permissions`\n // determines the maximum set of privileges that a principal can grant to another principal in\n // the given SNS.\n NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS = 2,\n\n // The principal has permission to submit proposals on behalf of the neuron.\n // Submitting proposals can change a neuron's stake and thus this\n // is potentially a balance changing operation.\n NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL = 3,\n\n // The principal has permission to vote and follow other neurons on behalf of the neuron.\n NEURON_PERMISSION_TYPE_VOTE = 4,\n\n // The principal has permission to disburse the neuron.\n NEURON_PERMISSION_TYPE_DISBURSE = 5,\n\n // The principal has permission to split the neuron.\n NEURON_PERMISSION_TYPE_SPLIT = 6,\n\n // The principal has permission to merge the neuron's maturity into\n // the neuron's stake.\n /**\n * @deprecated\n */\n NEURON_PERMISSION_TYPE_MERGE_MATURITY = 7,\n\n // The principal has permission to disburse the neuron's maturity to a\n // given ledger account.\n NEURON_PERMISSION_TYPE_DISBURSE_MATURITY = 8,\n\n // The principal has permission to stake the neuron's maturity.\n NEURON_PERMISSION_TYPE_STAKE_MATURITY = 9,\n\n // The principal has permission to grant/revoke permission to vote and submit\n // proposals on behalf of the neuron to other principals.\n NEURON_PERMISSION_TYPE_MANAGE_VOTING_PERMISSION = 10,\n}\n\nexport enum SnsProposalRewardStatus {\n PROPOSAL_REWARD_STATUS_UNSPECIFIED = 0,\n\n // The proposal still accepts votes, for the purpose of\n // voting rewards. This implies nothing on the\n // ProposalDecisionStatus, i.e., a proposal can be decided\n // due to an absolute majority being in favor or against it,\n // but other neuron holders can still cast their vote to get rewards.\n PROPOSAL_REWARD_STATUS_ACCEPT_VOTES = 1,\n\n // The proposal no longer accepts votes. It is due to settle\n // rewards at the next reward event.\n PROPOSAL_REWARD_STATUS_READY_TO_SETTLE = 2,\n\n // The proposal has been taken into account in a reward event, i.e.,\n // the associated rewards have been settled.\n PROPOSAL_REWARD_STATUS_SETTLED = 3,\n}\n\nexport enum SnsProposalDecisionStatus {\n PROPOSAL_DECISION_STATUS_UNSPECIFIED = 0,\n\n // The proposal is open for voting and a decision (adopt/reject) has yet to be made.\n PROPOSAL_DECISION_STATUS_OPEN = 1,\n\n // The proposal has been rejected.\n PROPOSAL_DECISION_STATUS_REJECTED = 2,\n\n // The proposal has been adopted but either execution has not yet started\n // or it has started but its outcome is not yet known.\n PROPOSAL_DECISION_STATUS_ADOPTED = 3,\n\n // The proposal was adopted and successfully executed.\n PROPOSAL_DECISION_STATUS_EXECUTED = 4,\n\n // The proposal was adopted, but execution failed.\n PROPOSAL_DECISION_STATUS_FAILED = 5,\n}\n\nexport enum SnsVote {\n Unspecified = 0,\n Yes = 1,\n No = 2,\n}\n", "// Source: https://github.com/dfinity/ic/blob/master/rs/sns/swap/gen/ic_sns_swap.pb.v1.rs - Lifecycle\nexport enum SnsSwapLifecycle {\n Unspecified = 0,\n Pending = 1,\n Open = 2,\n Committed = 3,\n Aborted = 4,\n Adopted = 5,\n}\n\n// Source: https://gitlab.com/dfinity-lab/public/ic/-/blob/5936d73770dbd16dab9b23379367a8bd5513fb88/rs/sns/swap/proto/ic_sns_swap/pb/v1/swap.proto#L887\nexport enum GetOpenTicketErrorType {\n TYPE_UNSPECIFIED = 0,\n TYPE_SALE_NOT_OPEN = 1,\n TYPE_SALE_CLOSED = 2,\n}\n\n// Source: https://gitlab.com/dfinity-lab/public/ic/-/blob/5936d73770dbd16dab9b23379367a8bd5513fb88/rs/sns/swap/proto/ic_sns_swap/pb/v1/swap.proto#L928\nexport enum NewSaleTicketResponseErrorType {\n TYPE_UNSPECIFIED = 0,\n TYPE_SALE_NOT_OPEN = 1,\n TYPE_SALE_CLOSED = 2,\n // There is already an open ticket associated with the caller.\n //\n // When this is the `error_type`, then the field existing_ticket\n // is set and contains the ticket itself.\n TYPE_TICKET_EXISTS = 3,\n // The amount sent by the user is not within the Sale parameters.\n //\n // When this is the `error_type`, then the field invalid_user_amount\n // is set and describes minimum and maximum amounts.\n TYPE_INVALID_USER_AMOUNT = 4,\n // The specified subaccount is not a valid subaccount (length != 32 bytes).\n TYPE_INVALID_SUBACCOUNT = 5,\n // The specified principal is forbidden from creating tickets.\n TYPE_INVALID_PRINCIPAL = 6,\n}\n", "// This is possible specially in SNS projects/\n// Because they share the same canisters but in different versions.\nexport class UnsupportedMethodError extends Error {\n constructor(public readonly methodName: string) {\n super();\n }\n}\n", "export class SnsGovernanceError extends Error {}\n", "import type { InvalidUserAmount, Ticket } from \"../candid/sns_swap\";\nimport type {\n GetOpenTicketErrorType,\n NewSaleTicketResponseErrorType,\n} from \"../enums/swap.enums\";\n\nexport class SnsSwapNewTicketError extends Error {\n public errorType: NewSaleTicketResponseErrorType;\n public invalidUserAmount?: InvalidUserAmount;\n public existingTicket?: Ticket;\n\n constructor({\n errorType,\n invalidUserAmount,\n existingTicket,\n }: {\n errorType: NewSaleTicketResponseErrorType;\n invalidUserAmount?: InvalidUserAmount;\n existingTicket?: Ticket;\n }) {\n super();\n this.errorType = errorType;\n this.invalidUserAmount = invalidUserAmount;\n this.existingTicket = existingTicket;\n }\n}\n\nexport class SnsSwapGetOpenTicketError extends Error {\n constructor(public errorType: GetOpenTicketErrorType) {\n super();\n }\n}\n", "import {\n Canister,\n assertPercentageNumber,\n createServices,\n fromNullable,\n toNullable,\n type QueryParams,\n} from \"@dfinity/utils\";\nimport type { Principal } from \"@icp-sdk/core/principal\";\nimport type {\n GetMetadataResponse,\n ListNervousSystemFunctionsResponse,\n ListProposalsResponse,\n ListTopicsResponse,\n ManageNeuron,\n ManageNeuronResponse,\n NervousSystemParameters,\n Neuron,\n NeuronId,\n ProposalData,\n _SERVICE as SnsGovernanceService,\n} from \"./candid/sns_governance\";\nimport { idlFactory as certifiedIdlFactory } from \"./candid/sns_governance.certified.idl\";\nimport { idlFactory } from \"./candid/sns_governance.idl\";\nimport { MAX_LIST_NEURONS_RESULTS } from \"./constants/governance.constants\";\nimport {\n toAddPermissionsRequest,\n toAutoStakeMaturityNeuronRequest,\n toClaimOrRefreshRequest,\n toDisburseMaturityRequest,\n toDisburseNeuronRequest,\n toFollowRequest,\n toIncreaseDissolveDelayRequest,\n toListProposalRequest,\n toRegisterVoteRequest,\n toRemovePermissionsRequest,\n toSetDissolveTimestampRequest,\n toSetFollowingRequest,\n toSplitNeuronRequest,\n toStakeMaturityRequest,\n toStartDissolvingNeuronRequest,\n toStopDissolvingNeuronRequest,\n} from \"./converters/governance.converters\";\nimport { SnsGovernanceError } from \"./errors/governance.errors\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\nimport type {\n SnsClaimNeuronParams,\n SnsDisburseNeuronParams,\n SnsGetNeuronParams,\n SnsGetProposalParams,\n SnsIncreaseDissolveDelayParams,\n SnsListNeuronsParams,\n SnsListProposalsParams,\n SnsListTopicsParams,\n SnsNeuronAutoStakeMaturityParams,\n SnsNeuronDisburseMaturityParams,\n SnsNeuronPermissionsParams,\n SnsNeuronStakeMaturityParams,\n SnsRegisterVoteParams,\n SnsSetDissolveTimestampParams,\n SnsSetFollowingParams,\n SnsSetTopicFollowees,\n SnsSplitNeuronParams,\n} from \"./types/governance.params\";\n\nexport class SnsGovernanceCanister extends Canister<SnsGovernanceService> {\n /**\n * Instantiate a canister to interact with the governance of a Sns project.\n *\n * @param {SnsCanisterOptions} options Miscellaneous options to initialize the canister. Its ID being the only mandatory parammeter.\n */\n static create(options: SnsCanisterOptions<SnsGovernanceService>) {\n const { service, certifiedService, canisterId } =\n createServices<SnsGovernanceService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new SnsGovernanceCanister(canisterId, service, certifiedService);\n }\n\n /**\n * List the neurons of the Sns\n */\n listNeurons = async (params: SnsListNeuronsParams): Promise<Neuron[]> => {\n const { principal, limit, beforeNeuronId } = params;\n\n const { neurons } = await this.caller(params).list_neurons({\n of_principal: toNullable<Principal>(principal),\n limit: limit ?? MAX_LIST_NEURONS_RESULTS,\n start_page_at: toNullable<NeuronId>(beforeNeuronId),\n });\n return neurons;\n };\n\n /**\n * List the proposals of the Sns\n */\n listProposals = async (\n params: SnsListProposalsParams,\n ): Promise<ListProposalsResponse> => {\n const { certified } = params;\n\n const response = await this.caller({ certified }).list_proposals(\n toListProposalRequest(params),\n );\n return response;\n };\n\n /**\n *\n * List the topics of the Sns\n */\n listTopics = async (\n params: SnsListTopicsParams,\n ): Promise<ListTopicsResponse> => {\n const { certified } = params;\n const response = await this.caller({ certified }).list_topics({});\n return response;\n };\n\n /**\n * Get the proposal of the Sns\n */\n getProposal = async (params: SnsGetProposalParams): Promise<ProposalData> => {\n const { proposalId } = params;\n\n const { result } = await this.caller(params).get_proposal({\n proposal_id: toNullable(proposalId),\n });\n const data = fromNullable(result);\n if (data === undefined || \"Error\" in data) {\n throw new SnsGovernanceError(\n data?.Error.error_message ?? \"Response type not supported\",\n );\n }\n return data.Proposal;\n };\n\n /**\n * List Nervous System Functions\n * Neurons can follow other neurons in specific Nervous System Functions.\n */\n listNervousSystemFunctions = (\n params: QueryParams,\n ): Promise<ListNervousSystemFunctionsResponse> =>\n this.caller(params).list_nervous_system_functions();\n\n /**\n * Get the Sns metadata (title, description, etc.)\n */\n metadata = (params: QueryParams): Promise<GetMetadataResponse> =>\n this.caller(params).get_metadata({});\n\n /**\n * Get the Sns nervous system parameters (default followees, max dissolve delay, max number of neurons, etc.)\n */\n nervousSystemParameters = (\n params: QueryParams,\n ): Promise<NervousSystemParameters> =>\n this.caller(params).get_nervous_system_parameters(null);\n\n /**\n * Get the neuron of the Sns\n */\n getNeuron = async (params: SnsGetNeuronParams): Promise<Neuron> => {\n const { neuronId } = params;\n\n const { result } = await this.caller(params).get_neuron({\n neuron_id: toNullable(neuronId),\n });\n const data = fromNullable(result);\n if (data === undefined || \"Error\" in data) {\n throw new SnsGovernanceError(\n data?.Error.error_message ?? \"Response type not supported\",\n );\n }\n return data.Neuron;\n };\n\n /**\n * Same as `getNeuron` but returns undefined instead of raising error when not found.\n */\n queryNeuron = async (\n params: SnsGetNeuronParams,\n ): Promise<Neuron | undefined> => {\n try {\n return await this.getNeuron(params);\n } catch (error: unknown) {\n // Source: https://github.com/dfinity/ic/blob/master/rs/sns/governance/src/governance.rs#L914\n if (\n error instanceof Error &&\n error.message.includes(\"No neuron for given NeuronId\")\n ) {\n return undefined;\n }\n throw error;\n }\n };\n\n /**\n * Manage neuron. For advanced users.\n */\n manageNeuron = async (\n request: ManageNeuron,\n ): Promise<ManageNeuronResponse> => {\n const response = await this.caller({ certified: true }).manage_neuron(\n request,\n );\n this.assertManageNeuronError(response);\n return response;\n };\n\n /**\n * Add permissions to a neuron for a specific principal\n */\n addNeuronPermissions = async (\n params: SnsNeuronPermissionsParams,\n ): Promise<void> => {\n const request: ManageNeuron = toAddPermissionsRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Remove permissions to a neuron for a specific principal\n */\n removeNeuronPermissions = async (\n params: SnsNeuronPermissionsParams,\n ): Promise<void> => {\n const request: ManageNeuron = toRemovePermissionsRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Split neuron\n */\n public splitNeuron = async (\n params: SnsSplitNeuronParams,\n ): Promise<NeuronId | undefined> => {\n const request: ManageNeuron = toSplitNeuronRequest(params);\n const { command } = await this.manageNeuron(request);\n const response = fromNullable(command);\n const errorMessage = (details: string) =>\n `Split neuron failed (${details})`;\n\n // Validate response\n if (response === undefined) {\n throw new SnsGovernanceError(errorMessage(\"no response\"));\n }\n\n if (\"Split\" in response) {\n const split = response.Split;\n const neuronId = fromNullable(split.created_neuron_id) as NeuronId;\n\n if (neuronId !== undefined) {\n return neuronId;\n }\n\n throw new SnsGovernanceError(errorMessage(\"no id\"));\n }\n\n throw new SnsGovernanceError(errorMessage(\"unknown\"));\n };\n\n /**\n * Disburse neuron on Account\n */\n disburse = async (params: SnsDisburseNeuronParams): Promise<void> => {\n const request: ManageNeuron = toDisburseNeuronRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Start dissolving process of a neuron\n */\n startDissolving = async (neuronId: NeuronId): Promise<void> => {\n const request: ManageNeuron = toStartDissolvingNeuronRequest(neuronId);\n await this.manageNeuron(request);\n };\n\n /**\n * Stop dissolving process of a neuron\n */\n stopDissolving = async (neuronId: NeuronId): Promise<void> => {\n const request: ManageNeuron = toStopDissolvingNeuronRequest(neuronId);\n await this.manageNeuron(request);\n };\n\n /**\n * Stake the maturity of a neuron.\n *\n * @param {neuronId: NeuronId; percentageToStake: number;} params\n * @param {NeuronId} neuronId The id of the neuron for which to stake the maturity\n * @param {number} percentageToStake Optional. Percentage of the current maturity to stake. If not provided, all of the neuron's current maturity will be staked.\n */\n stakeMaturity = async ({\n neuronId,\n percentageToStake,\n }: SnsNeuronStakeMaturityParams): Promise<void> => {\n assertPercentageNumber(percentageToStake ?? 100);\n\n const request: ManageNeuron = toStakeMaturityRequest({\n neuronId,\n percentageToStake,\n });\n await this.manageNeuron(request);\n };\n\n /**\n * Disburse the maturity of a neuron.\n *\n * @param {neuronId: NeuronId; toAccount?: IcrcAccount; percentageToDisburse: number; } params\n * @param {IcrcAccount} toAccount. Account to disburse maturity.\n * @param {NeuronId} neuronId The id of the neuron for which to disburse the maturity\n * @param {number} percentageToDisburse What percentage of the available maturity to disburse.\n */\n disburseMaturity = async (\n params: SnsNeuronDisburseMaturityParams,\n ): Promise<void> => {\n assertPercentageNumber(params.percentageToDisburse);\n\n const request: ManageNeuron = toDisburseMaturityRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Changes auto-stake maturity for a Neuron.\n *\n * @param {neuronId: NeuronId; autoStake: boolean;} params\n * @param {NeuronId} neuronId The id of the neuron for which to request a change of the auto stake feature\n * @param {number} autoStake `true` to enable the auto-stake maturity for this neuron, `false` to turn it off\n */\n autoStakeMaturity = async (\n params: SnsNeuronAutoStakeMaturityParams,\n ): Promise<void> => {\n const request: ManageNeuron = toAutoStakeMaturityNeuronRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Increase dissolve delay of a neuron\n */\n setDissolveTimestamp = async (\n params: SnsSetDissolveTimestampParams,\n ): Promise<void> => {\n const request: ManageNeuron = toSetDissolveTimestampRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Increase dissolve delay of a neuron\n */\n increaseDissolveDelay = async (\n params: SnsIncreaseDissolveDelayParams,\n ): Promise<void> => {\n const request: ManageNeuron = toIncreaseDissolveDelayRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Sets followees of a neuron for a specific Nervous System Function\n * @deprecated will be replaced by `setFollowing` in the future.\n */\n setTopicFollowees = async (params: SnsSetTopicFollowees): Promise<void> => {\n const request: ManageNeuron = toFollowRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Sets followees of a neuron for topics\n */\n setFollowing = async (params: SnsSetFollowingParams): Promise<void> => {\n const request: ManageNeuron = toSetFollowingRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Registers vote for a proposal from the neuron passed.\n */\n registerVote = async (params: SnsRegisterVoteParams): Promise<void> => {\n const request: ManageNeuron = toRegisterVoteRequest(params);\n await this.manageNeuron(request);\n };\n\n /**\n * Refresh neuron\n */\n refreshNeuron = async (neuronId: NeuronId): Promise<void> => {\n const request: ManageNeuron = toClaimOrRefreshRequest({\n subaccount: neuronId.id,\n });\n await this.manageNeuron(request);\n };\n\n /**\n * Claim neuron\n */\n claimNeuron = async ({\n memo,\n controller,\n subaccount,\n }: SnsClaimNeuronParams): Promise<NeuronId> => {\n const request: ManageNeuron = toClaimOrRefreshRequest({\n subaccount,\n memo,\n controller,\n });\n const { command } = await this.manageNeuron(request);\n const response = fromNullable(command);\n // Edge case. This should not happen\n if (response === undefined) {\n throw new SnsGovernanceError(\"Claim neuron failed\");\n }\n if (\"ClaimOrRefresh\" in response) {\n const neuronId = fromNullable(\n response.ClaimOrRefresh.refreshed_neuron_id,\n );\n // This might happen.\n if (neuronId === undefined) {\n throw new SnsGovernanceError(\"Claim neuron failed\");\n }\n return neuronId;\n }\n // Edge case. manage_neuron for ClaimOrRefresh returns only ClaimOrRefresh response.\n throw new SnsGovernanceError(\"Claim neuron failed\");\n };\n\n /**\n *\n * @param response ManageNeuronResponse\n * @throws SnsGovernanceError\n */\n private assertManageNeuronError = ({\n command,\n }: ManageNeuronResponse): void => {\n // TODO: use upcoming fromDefinedNullable\n const [firstCommand] = command;\n if (firstCommand !== undefined && \"Error\" in firstCommand) {\n throw new SnsGovernanceError(firstCommand.Error.error_message);\n }\n };\n}\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.0.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({ IDL }) => {\n const PreciseValue = IDL.Rec();\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Version = IDL.Record({\n archive_wasm_hash: IDL.Vec(IDL.Nat8),\n root_wasm_hash: IDL.Vec(IDL.Nat8),\n swap_wasm_hash: IDL.Vec(IDL.Nat8),\n ledger_wasm_hash: IDL.Vec(IDL.Nat8),\n governance_wasm_hash: IDL.Vec(IDL.Nat8),\n index_wasm_hash: IDL.Vec(IDL.Nat8),\n });\n const Versions = IDL.Record({ versions: IDL.Vec(Version) });\n const CachedUpgradeSteps = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requested_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Topic = IDL.Variant({\n DappCanisterManagement: IDL.Null,\n DaoCommunitySettings: IDL.Null,\n ApplicationBusinessLogic: IDL.Null,\n CriticalDappOperations: IDL.Null,\n TreasuryAssetManagement: IDL.Null,\n Governance: IDL.Null,\n SnsFrameworkManagement: IDL.Null,\n });\n const GenericNervousSystemFunction = IDL.Record({\n topic: IDL.Opt(Topic),\n validator_canister_id: IDL.Opt(IDL.Principal),\n target_canister_id: IDL.Opt(IDL.Principal),\n validator_method_name: IDL.Opt(IDL.Text),\n target_method_name: IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n NativeNervousSystemFunction: IDL.Record({}),\n GenericNervousSystemFunction: GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n id: IDL.Nat64,\n name: IDL.Text,\n description: IDL.Opt(IDL.Text),\n function_type: IDL.Opt(FunctionType),\n });\n const Subaccount = IDL.Record({ subaccount: IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n owner: IDL.Opt(IDL.Principal),\n subaccount: IDL.Opt(Subaccount),\n });\n const TreasuryMetrics = IDL.Record({\n name: IDL.Opt(IDL.Text),\n original_amount_e8s: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n account: IDL.Opt(Account),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n treasury: IDL.Int32,\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const VotingPowerMetrics = IDL.Record({\n governance_total_potential_voting_power: IDL.Opt(IDL.Nat64),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GovernanceCachedMetrics = IDL.Record({\n treasury_metrics: IDL.Vec(TreasuryMetrics),\n not_dissolving_neurons_e8s_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64),\n ),\n garbage_collectable_neurons_count: IDL.Nat64,\n neurons_with_invalid_stake_count: IDL.Nat64,\n not_dissolving_neurons_count_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64),\n ),\n neurons_with_less_than_6_months_dissolve_delay_count: IDL.Nat64,\n dissolved_neurons_count: IDL.Nat64,\n total_staked_e8s: IDL.Nat64,\n total_supply_governance_tokens: IDL.Nat64,\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n not_dissolving_neurons_count: IDL.Nat64,\n dissolved_neurons_e8s: IDL.Nat64,\n neurons_with_less_than_6_months_dissolve_delay_e8s: IDL.Nat64,\n dissolving_neurons_count_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Nat64)),\n dissolving_neurons_count: IDL.Nat64,\n dissolving_neurons_e8s_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Float64)),\n timestamp_seconds: IDL.Nat64,\n });\n const MaturityModulation = IDL.Record({\n current_basis_points: IDL.Opt(IDL.Int32),\n updated_at_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const TargetVersionSet = IDL.Record({\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n is_advanced_automatically: IDL.Opt(IDL.Bool),\n });\n const UpgradeStepsReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n upgrade_steps: IDL.Opt(Versions),\n });\n const UpgradeOutcome = IDL.Record({\n status: IDL.Opt(\n IDL.Variant({\n Success: IDL.Record({}),\n Timeout: IDL.Record({}),\n ExternalFailure: IDL.Record({}),\n InvalidState: IDL.Record({ version: IDL.Opt(Version) }),\n }),\n ),\n human_readable: IDL.Opt(IDL.Text),\n });\n const ProposalId = IDL.Record({ id: IDL.Nat64 });\n const UpgradeStarted = IDL.Record({\n current_version: IDL.Opt(Version),\n expected_version: IDL.Opt(Version),\n reason: IDL.Opt(\n IDL.Variant({\n UpgradeSnsToNextVersionProposal: ProposalId,\n BehindTargetVersion: IDL.Record({}),\n }),\n ),\n });\n const UpgradeStepsRefreshed = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n });\n const TargetVersionReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n });\n const UpgradeJournalEntry = IDL.Record({\n event: IDL.Opt(\n IDL.Variant({\n TargetVersionSet: TargetVersionSet,\n UpgradeStepsReset: UpgradeStepsReset,\n UpgradeOutcome: UpgradeOutcome,\n UpgradeStarted: UpgradeStarted,\n UpgradeStepsRefreshed: UpgradeStepsRefreshed,\n TargetVersionReset: TargetVersionReset,\n }),\n ),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const UpgradeJournal = IDL.Record({\n entries: IDL.Vec(UpgradeJournalEntry),\n });\n const NeuronId = IDL.Record({ id: IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ followees: IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n permissions: IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n final_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n reward_rate_transition_duration_seconds: IDL.Opt(IDL.Nat64),\n round_duration_seconds: IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n default_followees: IDL.Opt(DefaultFollowees),\n max_dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n max_dissolve_delay_bonus_percentage: IDL.Opt(IDL.Nat64),\n max_followees_per_function: IDL.Opt(IDL.Nat64),\n automatically_advance_target_version: IDL.Opt(IDL.Bool),\n neuron_claimer_permissions: IDL.Opt(NeuronPermissionList),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n max_neuron_age_for_age_bonus: IDL.Opt(IDL.Nat64),\n initial_voting_period_seconds: IDL.Opt(IDL.Nat64),\n neuron_minimum_dissolve_delay_to_vote_seconds: IDL.Opt(IDL.Nat64),\n reject_cost_e8s: IDL.Opt(IDL.Nat64),\n max_proposals_to_keep_per_action: IDL.Opt(IDL.Nat32),\n wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64),\n max_number_of_neurons: IDL.Opt(IDL.Nat64),\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64),\n max_age_bonus_percentage: IDL.Opt(IDL.Nat64),\n neuron_grantable_permissions: IDL.Opt(NeuronPermissionList),\n voting_rewards_parameters: IDL.Opt(VotingRewardsParameters),\n maturity_modulation_disabled: IDL.Opt(IDL.Bool),\n max_number_of_principals_per_neuron: IDL.Opt(IDL.Nat64),\n });\n const RewardEvent = IDL.Record({\n rounds_since_last_distribution: IDL.Opt(IDL.Nat64),\n actual_timestamp_seconds: IDL.Nat64,\n end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n total_available_e8s_equivalent: IDL.Opt(IDL.Nat64),\n distributed_e8s_equivalent: IDL.Nat64,\n round: IDL.Nat64,\n settled_proposals: IDL.Vec(ProposalId),\n });\n const PendingVersion = IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Opt(IDL.Nat64),\n target_version: IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n error_message: IDL.Text,\n error_type: IDL.Int32,\n });\n const Decimal = IDL.Record({ human_readable: IDL.Opt(IDL.Text) });\n const Tokens = IDL.Record({ e8s: IDL.Opt(IDL.Nat64) });\n const ValuationFactors = IDL.Record({\n xdrs_per_icp: IDL.Opt(Decimal),\n icps_per_token: IDL.Opt(Decimal),\n tokens: IDL.Opt(Tokens),\n });\n const Valuation = IDL.Record({\n token: IDL.Opt(IDL.Int32),\n account: IDL.Opt(Account),\n valuation_factors: IDL.Opt(ValuationFactors),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const MintSnsTokensActionAuxiliary = IDL.Record({\n valuation: IDL.Opt(Valuation),\n });\n const SnsVersion = IDL.Record({\n archive_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n root_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n swap_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n ledger_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n governance_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n index_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const AdvanceSnsTargetVersionActionAuxiliary = IDL.Record({\n target_version: IDL.Opt(SnsVersion),\n });\n const ActionAuxiliary = IDL.Variant({\n TransferSnsTreasuryFunds: MintSnsTokensActionAuxiliary,\n MintSnsTokens: MintSnsTokensActionAuxiliary,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersionActionAuxiliary,\n });\n const Ballot = IDL.Record({\n vote: IDL.Int32,\n cast_timestamp_seconds: IDL.Nat64,\n voting_power: IDL.Nat64,\n });\n const Percentage = IDL.Record({ basis_points: IDL.Opt(IDL.Nat64) });\n const Tally = IDL.Record({\n no: IDL.Nat64,\n yes: IDL.Nat64,\n total: IDL.Nat64,\n timestamp_seconds: IDL.Nat64,\n });\n const ManageDappCanisterSettings = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat64),\n wasm_memory_threshold: IDL.Opt(IDL.Nat64),\n canister_ids: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat64),\n log_visibility: IDL.Opt(IDL.Int32),\n wasm_memory_limit: IDL.Opt(IDL.Nat64),\n memory_allocation: IDL.Opt(IDL.Nat64),\n compute_allocation: IDL.Opt(IDL.Nat64),\n });\n PreciseValue.fill(\n IDL.Variant({\n Int: IDL.Int64,\n Map: IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),\n Nat: IDL.Nat64,\n Blob: IDL.Vec(IDL.Nat8),\n Bool: IDL.Bool,\n Text: IDL.Text,\n Array: IDL.Vec(PreciseValue),\n }),\n );\n const ExtensionOperationArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const ExecuteExtensionOperation = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n operation_name: IDL.Opt(IDL.Text),\n operation_arg: IDL.Opt(ExtensionOperationArg),\n });\n const ChunkedCanisterWasm = IDL.Record({\n wasm_module_hash: IDL.Vec(IDL.Nat8),\n chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),\n store_canister_id: IDL.Opt(IDL.Principal),\n });\n const Wasm = IDL.Variant({\n Chunked: ChunkedCanisterWasm,\n Bytes: IDL.Vec(IDL.Nat8),\n });\n const ExtensionUpgradeArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const UpgradeExtension = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n wasm: IDL.Opt(Wasm),\n canister_upgrade_arg: IDL.Opt(ExtensionUpgradeArg),\n });\n const SetTopicsForCustomProposals = IDL.Record({\n custom_function_id_to_topic: IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),\n });\n const ExtensionInit = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const RegisterExtension = IDL.Record({\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n extension_init: IDL.Opt(ExtensionInit),\n });\n const RegisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n });\n const TransferSnsTreasuryFunds = IDL.Record({\n from_treasury: IDL.Int32,\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n new_canister_wasm: IDL.Vec(IDL.Nat8),\n mode: IDL.Opt(IDL.Int32),\n canister_id: IDL.Opt(IDL.Principal),\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n canister_upgrade_arg: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const DeregisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n new_controllers: IDL.Vec(IDL.Principal),\n });\n const MintSnsTokens = IDL.Record({\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const AdvanceSnsTargetVersion = IDL.Record({\n new_target: IDL.Opt(SnsVersion),\n });\n const ManageSnsMetadata = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n function_id: IDL.Nat64,\n payload: IDL.Vec(IDL.Nat8),\n });\n const ManageLedgerParameters = IDL.Record({\n token_symbol: IDL.Opt(IDL.Text),\n transfer_fee: IDL.Opt(IDL.Nat64),\n token_logo: IDL.Opt(IDL.Text),\n token_name: IDL.Opt(IDL.Text),\n });\n const Motion = IDL.Record({ motion_text: IDL.Text });\n const Action = IDL.Variant({\n ManageNervousSystemParameters: NervousSystemParameters,\n AddGenericNervousSystemFunction: NervousSystemFunction,\n ManageDappCanisterSettings: ManageDappCanisterSettings,\n ExecuteExtensionOperation: ExecuteExtensionOperation,\n UpgradeExtension: UpgradeExtension,\n RemoveGenericNervousSystemFunction: IDL.Nat64,\n SetTopicsForCustomProposals: SetTopicsForCustomProposals,\n RegisterExtension: RegisterExtension,\n UpgradeSnsToNextVersion: IDL.Record({}),\n RegisterDappCanisters: RegisterDappCanisters,\n TransferSnsTreasuryFunds: TransferSnsTreasuryFunds,\n UpgradeSnsControlledCanister: UpgradeSnsControlledCanister,\n DeregisterDappCanisters: DeregisterDappCanisters,\n MintSnsTokens: MintSnsTokens,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersion,\n Unspecified: IDL.Record({}),\n ManageSnsMetadata: ManageSnsMetadata,\n ExecuteGenericNervousSystemFunction: ExecuteGenericNervousSystemFunction,\n ManageLedgerParameters: ManageLedgerParameters,\n Motion: Motion,\n });\n const Proposal = IDL.Record({\n url: IDL.Text,\n title: IDL.Text,\n action: IDL.Opt(Action),\n summary: IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n current_deadline_timestamp_seconds: IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n id: IDL.Opt(ProposalId),\n payload_text_rendering: IDL.Opt(IDL.Text),\n topic: IDL.Opt(Topic),\n action: IDL.Nat64,\n failure_reason: IDL.Opt(GovernanceError),\n action_auxiliary: IDL.Opt(ActionAuxiliary),\n ballots: IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n minimum_yes_proportion_of_total: IDL.Opt(Percentage),\n reward_event_round: IDL.Nat64,\n failed_timestamp_seconds: IDL.Nat64,\n reward_event_end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n proposal_creation_timestamp_seconds: IDL.Nat64,\n initial_voting_period_seconds: IDL.Nat64,\n reject_cost_e8s: IDL.Nat64,\n latest_tally: IDL.Opt(Tally),\n wait_for_quiet_deadline_increase_seconds: IDL.Nat64,\n decided_timestamp_seconds: IDL.Nat64,\n proposal: IDL.Opt(Proposal),\n proposer: IDL.Opt(NeuronId),\n wait_for_quiet_state: IDL.Opt(WaitForQuietState),\n minimum_yes_proportion_of_exercised: IDL.Opt(Percentage),\n is_eligible_for_rewards: IDL.Bool,\n executed_timestamp_seconds: IDL.Nat64,\n });\n const Split = IDL.Record({ memo: IDL.Nat64, amount_e8s: IDL.Nat64 });\n const Follow = IDL.Record({\n function_id: IDL.Nat64,\n followees: IDL.Vec(NeuronId),\n });\n const DisburseMaturity = IDL.Record({\n to_account: IDL.Opt(Account),\n percentage_to_disburse: IDL.Nat32,\n });\n const ChangeAutoStakeMaturity = IDL.Record({\n requested_setting_for_auto_stake_maturity: IDL.Bool,\n });\n const IncreaseDissolveDelay = IDL.Record({\n additional_dissolve_delay_seconds: IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n dissolve_timestamp_seconds: IDL.Nat64,\n });\n const Operation = IDL.Variant({\n ChangeAutoStakeMaturity: ChangeAutoStakeMaturity,\n StopDissolving: IDL.Record({}),\n StartDissolving: IDL.Record({}),\n IncreaseDissolveDelay: IncreaseDissolveDelay,\n SetDissolveTimestamp: SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ operation: IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n vote: IDL.Int32,\n proposal: IDL.Opt(ProposalId),\n });\n const Followee = IDL.Record({\n alias: IDL.Opt(IDL.Text),\n neuron_id: IDL.Opt(NeuronId),\n });\n const FolloweesForTopic = IDL.Record({\n topic: IDL.Opt(Topic),\n followees: IDL.Vec(Followee),\n });\n const SetFollowing = IDL.Record({\n topic_following: IDL.Vec(FolloweesForTopic),\n });\n const FinalizeDisburseMaturity = IDL.Record({\n amount_to_be_disbursed_e8s: IDL.Nat64,\n to_account: IDL.Opt(Account),\n });\n const MemoAndController = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n memo: IDL.Nat64,\n });\n const By = IDL.Variant({\n MemoAndController: MemoAndController,\n NeuronId: IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ by: IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n permissions_to_remove: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n permissions_to_add: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ percentage_to_merge: IDL.Nat32 });\n const Amount = IDL.Record({ e8s: IDL.Nat64 });\n const Disburse = IDL.Record({\n to_account: IDL.Opt(Account),\n amount: IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n SyncCommand: IDL.Record({}),\n MakeProposal: Proposal,\n FinalizeDisburseMaturity: FinalizeDisburseMaturity,\n ClaimOrRefreshNeuron: ClaimOrRefresh,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n command: IDL.Opt(Command_2),\n timestamp: IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n principal: IDL.Opt(IDL.Principal),\n permission_type: IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n DissolveDelaySeconds: IDL.Nat64,\n WhenDissolvedTimestampSeconds: IDL.Nat64,\n });\n const DisburseMaturityInProgress = IDL.Record({\n timestamp_of_disbursement_seconds: IDL.Nat64,\n amount_e8s: IDL.Nat64,\n account_to_disburse_to: IDL.Opt(Account),\n finalize_disbursement_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Neuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n staked_maturity_e8s_equivalent: IDL.Opt(IDL.Nat64),\n permissions: IDL.Vec(NeuronPermission),\n maturity_e8s_equivalent: IDL.Nat64,\n cached_neuron_stake_e8s: IDL.Nat64,\n created_timestamp_seconds: IDL.Nat64,\n topic_followees: IDL.Opt(\n IDL.Record({\n topic_id_to_followees: IDL.Vec(IDL.Tuple(IDL.Int32, FolloweesForTopic)),\n }),\n ),\n source_nns_neuron_id: IDL.Opt(IDL.Nat64),\n auto_stake_maturity: IDL.Opt(IDL.Bool),\n aging_since_timestamp_seconds: IDL.Nat64,\n dissolve_state: IDL.Opt(DissolveState),\n voting_power_percentage_multiplier: IDL.Nat64,\n vesting_period_seconds: IDL.Opt(IDL.Nat64),\n disburse_maturity_in_progress: IDL.Vec(DisburseMaturityInProgress),\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n neuron_fees_e8s: IDL.Nat64,\n });\n const Governance = IDL.Record({\n root_canister_id: IDL.Opt(IDL.Principal),\n timers: IDL.Opt(Timers),\n cached_upgrade_steps: IDL.Opt(CachedUpgradeSteps),\n id_to_nervous_system_functions: IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction),\n ),\n metrics: IDL.Opt(GovernanceCachedMetrics),\n maturity_modulation: IDL.Opt(MaturityModulation),\n upgrade_journal: IDL.Opt(UpgradeJournal),\n mode: IDL.Int32,\n parameters: IDL.Opt(NervousSystemParameters),\n is_finalizing_disburse_maturity: IDL.Opt(IDL.Bool),\n deployed_version: IDL.Opt(Version),\n sns_initialization_parameters: IDL.Text,\n latest_reward_event: IDL.Opt(RewardEvent),\n pending_version: IDL.Opt(PendingVersion),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n proposals: IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n in_flight_commands: IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n sns_metadata: IDL.Opt(ManageSnsMetadata),\n neurons: IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n target_version: IDL.Opt(Version),\n genesis_timestamp_seconds: IDL.Nat64,\n });\n const Principals = IDL.Record({ principals: IDL.Vec(IDL.Principal) });\n const NeuronsFund = IDL.Record({\n nns_neuron_hotkeys: IDL.Opt(Principals),\n nns_neuron_controller: IDL.Opt(IDL.Principal),\n nns_neuron_id: IDL.Opt(IDL.Nat64),\n });\n const Participant = IDL.Variant({\n NeuronsFund: NeuronsFund,\n Direct: IDL.Record({}),\n });\n const NeuronIds = IDL.Record({ neuron_ids: IDL.Vec(NeuronId) });\n const NeuronRecipe = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n participant: IDL.Opt(Participant),\n stake_e8s: IDL.Opt(IDL.Nat64),\n followees: IDL.Opt(NeuronIds),\n neuron_id: IDL.Opt(NeuronId),\n });\n const NeuronRecipes = IDL.Record({\n neuron_recipes: IDL.Vec(NeuronRecipe),\n });\n const ClaimSwapNeuronsRequest = IDL.Record({\n neuron_recipes: IDL.Opt(NeuronRecipes),\n });\n const SwapNeuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n status: IDL.Int32,\n });\n const ClaimedSwapNeurons = IDL.Record({\n swap_neurons: IDL.Vec(SwapNeuron),\n });\n const ClaimSwapNeuronsResult = IDL.Variant({\n Ok: ClaimedSwapNeurons,\n Err: IDL.Int32,\n });\n const ClaimSwapNeuronsResponse = IDL.Record({\n claim_swap_neurons_result: IDL.Opt(ClaimSwapNeuronsResult),\n });\n const GetMaturityModulationResponse = IDL.Record({\n maturity_modulation: IDL.Opt(MaturityModulation),\n });\n const GetMetadataResponse = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const GetMetricsRequest = IDL.Record({\n time_window_seconds: IDL.Opt(IDL.Nat64),\n });\n const Metrics = IDL.Record({\n treasury_metrics: IDL.Opt(IDL.Vec(TreasuryMetrics)),\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n last_ledger_block_timestamp: IDL.Opt(IDL.Nat64),\n num_recently_executed_proposals: IDL.Opt(IDL.Nat64),\n num_recently_submitted_proposals: IDL.Opt(IDL.Nat64),\n genesis_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GetMetricsResult = IDL.Variant({\n Ok: Metrics,\n Err: GovernanceError,\n });\n const GetMetricsResponse = IDL.Record({\n get_metrics_result: IDL.Opt(GetMetricsResult),\n });\n const GetModeResponse = IDL.Record({ mode: IDL.Opt(IDL.Int32) });\n const GetNeuron = IDL.Record({ neuron_id: IDL.Opt(NeuronId) });\n const Result = IDL.Variant({ Error: GovernanceError, Neuron: Neuron });\n const GetNeuronResponse = IDL.Record({ result: IDL.Opt(Result) });\n const GetProposal = IDL.Record({ proposal_id: IDL.Opt(ProposalId) });\n const Result_1 = IDL.Variant({\n Error: GovernanceError,\n Proposal: ProposalData,\n });\n const GetProposalResponse = IDL.Record({ result: IDL.Opt(Result_1) });\n const MemoryMetrics = IDL.Record({\n wasm_binary_size: IDL.Opt(IDL.Nat),\n wasm_chunk_store_size: IDL.Opt(IDL.Nat),\n canister_history_size: IDL.Opt(IDL.Nat),\n stable_memory_size: IDL.Opt(IDL.Nat),\n snapshots_size: IDL.Opt(IDL.Nat),\n wasm_memory_size: IDL.Opt(IDL.Nat),\n global_memory_size: IDL.Opt(IDL.Nat),\n custom_sections_size: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusType = IDL.Variant({\n stopped: IDL.Null,\n stopping: IDL.Null,\n running: IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n freezing_threshold: IDL.Nat,\n wasm_memory_threshold: IDL.Opt(IDL.Nat),\n controllers: IDL.Vec(IDL.Principal),\n wasm_memory_limit: IDL.Opt(IDL.Nat),\n memory_allocation: IDL.Nat,\n compute_allocation: IDL.Nat,\n });\n const QueryStats = IDL.Record({\n response_payload_bytes_total: IDL.Opt(IDL.Nat),\n num_instructions_total: IDL.Opt(IDL.Nat),\n num_calls_total: IDL.Opt(IDL.Nat),\n request_payload_bytes_total: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusResultV2 = IDL.Record({\n memory_metrics: IDL.Opt(MemoryMetrics),\n status: CanisterStatusType,\n memory_size: IDL.Nat,\n cycles: IDL.Nat,\n settings: DefiniteCanisterSettingsArgs,\n query_stats: IDL.Opt(QueryStats),\n idle_cycles_burned_per_day: IDL.Nat,\n module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetRunningSnsVersionResponse = IDL.Record({\n deployed_version: IDL.Opt(Version),\n pending_version: IDL.Opt(\n IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Nat64,\n target_version: IDL.Opt(Version),\n }),\n ),\n });\n const GetSnsInitializationParametersResponse = IDL.Record({\n sns_initialization_parameters: IDL.Text,\n });\n const GetTimersResponse = IDL.Record({ timers: IDL.Opt(Timers) });\n const GetUpgradeJournalRequest = IDL.Record({\n offset: IDL.Opt(IDL.Nat64),\n limit: IDL.Opt(IDL.Nat64),\n });\n const GetUpgradeJournalResponse = IDL.Record({\n upgrade_journal: IDL.Opt(UpgradeJournal),\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n deployed_version: IDL.Opt(Version),\n target_version: IDL.Opt(Version),\n upgrade_journal_entry_count: IDL.Opt(IDL.Nat64),\n });\n const ListNervousSystemFunctionsResponse = IDL.Record({\n reserved_ids: IDL.Vec(IDL.Nat64),\n functions: IDL.Vec(NervousSystemFunction),\n });\n const ListNeurons = IDL.Record({\n of_principal: IDL.Opt(IDL.Principal),\n limit: IDL.Nat32,\n start_page_at: IDL.Opt(NeuronId),\n });\n const ListNeuronsResponse = IDL.Record({ neurons: IDL.Vec(Neuron) });\n const TopicSelector = IDL.Record({ topic: IDL.Opt(Topic) });\n const ListProposals = IDL.Record({\n include_reward_status: IDL.Vec(IDL.Int32),\n before_proposal: IDL.Opt(ProposalId),\n limit: IDL.Nat32,\n exclude_type: IDL.Vec(IDL.Nat64),\n include_topics: IDL.Opt(IDL.Vec(TopicSelector)),\n include_status: IDL.Vec(IDL.Int32),\n });\n const ListProposalsResponse = IDL.Record({\n include_ballots_by_caller: IDL.Opt(IDL.Bool),\n proposals: IDL.Vec(ProposalData),\n include_topic_filtering: IDL.Opt(IDL.Bool),\n });\n const ListTopicsRequest = IDL.Record({});\n const ExtensionOperationType = IDL.Variant({\n TreasuryManagerWithdraw: IDL.Null,\n TreasuryManagerDeposit: IDL.Null,\n });\n const ExtensionType = IDL.Variant({ TreasuryManager: IDL.Null });\n const ExtensionOperationSpec = IDL.Record({\n topic: IDL.Opt(Topic),\n operation_type: IDL.Opt(ExtensionOperationType),\n description: IDL.Opt(IDL.Text),\n extension_type: IDL.Opt(ExtensionType),\n });\n const RegisteredExtensionOperationSpec = IDL.Record({\n spec: IDL.Opt(ExtensionOperationSpec),\n canister_id: IDL.Opt(IDL.Principal),\n });\n const TopicInfo = IDL.Record({\n extension_operations: IDL.Opt(IDL.Vec(RegisteredExtensionOperationSpec)),\n native_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n topic: IDL.Opt(Topic),\n is_critical: IDL.Opt(IDL.Bool),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n custom_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n });\n const ListTopicsResponse = IDL.Record({\n uncategorized_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n topics: IDL.Opt(IDL.Vec(TopicInfo)),\n });\n const StakeMaturity = IDL.Record({\n percentage_to_stake: IDL.Opt(IDL.Nat32),\n });\n const Command = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n ClaimOrRefresh: ClaimOrRefresh,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n MakeProposal: Proposal,\n StakeMaturity: StakeMaturity,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const ManageNeuron = IDL.Record({\n subaccount: IDL.Vec(IDL.Nat8),\n command: IDL.Opt(Command),\n });\n const SplitResponse = IDL.Record({ created_neuron_id: IDL.Opt(NeuronId) });\n const DisburseMaturityResponse = IDL.Record({\n amount_disbursed_e8s: IDL.Nat64,\n amount_deducted_e8s: IDL.Opt(IDL.Nat64),\n });\n const ClaimOrRefreshResponse = IDL.Record({\n refreshed_neuron_id: IDL.Opt(NeuronId),\n });\n const StakeMaturityResponse = IDL.Record({\n maturity_e8s: IDL.Nat64,\n staked_maturity_e8s: IDL.Nat64,\n });\n const MergeMaturityResponse = IDL.Record({\n merged_maturity_e8s: IDL.Nat64,\n new_stake_e8s: IDL.Nat64,\n });\n const DisburseResponse = IDL.Record({ transfer_block_height: IDL.Nat64 });\n const Command_1 = IDL.Variant({\n Error: GovernanceError,\n Split: SplitResponse,\n Follow: IDL.Record({}),\n DisburseMaturity: DisburseMaturityResponse,\n ClaimOrRefresh: ClaimOrRefreshResponse,\n Configure: IDL.Record({}),\n RegisterVote: IDL.Record({}),\n SetFollowing: IDL.Record({}),\n MakeProposal: GetProposal,\n RemoveNeuronPermission: IDL.Record({}),\n StakeMaturity: StakeMaturityResponse,\n MergeMaturity: MergeMaturityResponse,\n Disburse: DisburseResponse,\n AddNeuronPermission: IDL.Record({}),\n });\n const ManageNeuronResponse = IDL.Record({ command: IDL.Opt(Command_1) });\n const SetMode = IDL.Record({ mode: IDL.Int32 });\n\n return IDL.Service({\n claim_swap_neurons: IDL.Func(\n [ClaimSwapNeuronsRequest],\n [ClaimSwapNeuronsResponse],\n [],\n ),\n fail_stuck_upgrade_in_progress: IDL.Func(\n [IDL.Record({})],\n [IDL.Record({})],\n [],\n ),\n get_build_metadata: IDL.Func([], [IDL.Text], []),\n get_latest_reward_event: IDL.Func([], [RewardEvent], []),\n get_maturity_modulation: IDL.Func(\n [IDL.Record({})],\n [GetMaturityModulationResponse],\n [],\n ),\n get_metadata: IDL.Func([IDL.Record({})], [GetMetadataResponse], []),\n get_metrics: IDL.Func([GetMetricsRequest], [GetMetricsResponse], []),\n get_metrics_replicated: IDL.Func(\n [GetMetricsRequest],\n [GetMetricsResponse],\n [],\n ),\n get_mode: IDL.Func([IDL.Record({})], [GetModeResponse], []),\n get_nervous_system_parameters: IDL.Func(\n [IDL.Null],\n [NervousSystemParameters],\n [],\n ),\n get_neuron: IDL.Func([GetNeuron], [GetNeuronResponse], []),\n get_proposal: IDL.Func([GetProposal], [GetProposalResponse], []),\n get_root_canister_status: IDL.Func(\n [IDL.Null],\n [CanisterStatusResultV2],\n [],\n ),\n get_running_sns_version: IDL.Func(\n [IDL.Record({})],\n [GetRunningSnsVersionResponse],\n [],\n ),\n get_sns_initialization_parameters: IDL.Func(\n [IDL.Record({})],\n [GetSnsInitializationParametersResponse],\n [],\n ),\n get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], []),\n get_upgrade_journal: IDL.Func(\n [GetUpgradeJournalRequest],\n [GetUpgradeJournalResponse],\n [],\n ),\n list_nervous_system_functions: IDL.Func(\n [],\n [ListNervousSystemFunctionsResponse],\n [],\n ),\n list_neurons: IDL.Func([ListNeurons], [ListNeuronsResponse], []),\n list_proposals: IDL.Func([ListProposals], [ListProposalsResponse], []),\n list_topics: IDL.Func([ListTopicsRequest], [ListTopicsResponse], []),\n manage_neuron: IDL.Func([ManageNeuron], [ManageNeuronResponse], []),\n reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], []),\n set_mode: IDL.Func([SetMode], [IDL.Record({})], []),\n });\n};\n\nexport const init = ({ IDL }) => {\n const PreciseValue = IDL.Rec();\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Version = IDL.Record({\n archive_wasm_hash: IDL.Vec(IDL.Nat8),\n root_wasm_hash: IDL.Vec(IDL.Nat8),\n swap_wasm_hash: IDL.Vec(IDL.Nat8),\n ledger_wasm_hash: IDL.Vec(IDL.Nat8),\n governance_wasm_hash: IDL.Vec(IDL.Nat8),\n index_wasm_hash: IDL.Vec(IDL.Nat8),\n });\n const Versions = IDL.Record({ versions: IDL.Vec(Version) });\n const CachedUpgradeSteps = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requested_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Topic = IDL.Variant({\n DappCanisterManagement: IDL.Null,\n DaoCommunitySettings: IDL.Null,\n ApplicationBusinessLogic: IDL.Null,\n CriticalDappOperations: IDL.Null,\n TreasuryAssetManagement: IDL.Null,\n Governance: IDL.Null,\n SnsFrameworkManagement: IDL.Null,\n });\n const GenericNervousSystemFunction = IDL.Record({\n topic: IDL.Opt(Topic),\n validator_canister_id: IDL.Opt(IDL.Principal),\n target_canister_id: IDL.Opt(IDL.Principal),\n validator_method_name: IDL.Opt(IDL.Text),\n target_method_name: IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n NativeNervousSystemFunction: IDL.Record({}),\n GenericNervousSystemFunction: GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n id: IDL.Nat64,\n name: IDL.Text,\n description: IDL.Opt(IDL.Text),\n function_type: IDL.Opt(FunctionType),\n });\n const Subaccount = IDL.Record({ subaccount: IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n owner: IDL.Opt(IDL.Principal),\n subaccount: IDL.Opt(Subaccount),\n });\n const TreasuryMetrics = IDL.Record({\n name: IDL.Opt(IDL.Text),\n original_amount_e8s: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n account: IDL.Opt(Account),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n treasury: IDL.Int32,\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const VotingPowerMetrics = IDL.Record({\n governance_total_potential_voting_power: IDL.Opt(IDL.Nat64),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GovernanceCachedMetrics = IDL.Record({\n treasury_metrics: IDL.Vec(TreasuryMetrics),\n not_dissolving_neurons_e8s_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64),\n ),\n garbage_collectable_neurons_count: IDL.Nat64,\n neurons_with_invalid_stake_count: IDL.Nat64,\n not_dissolving_neurons_count_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64),\n ),\n neurons_with_less_than_6_months_dissolve_delay_count: IDL.Nat64,\n dissolved_neurons_count: IDL.Nat64,\n total_staked_e8s: IDL.Nat64,\n total_supply_governance_tokens: IDL.Nat64,\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n not_dissolving_neurons_count: IDL.Nat64,\n dissolved_neurons_e8s: IDL.Nat64,\n neurons_with_less_than_6_months_dissolve_delay_e8s: IDL.Nat64,\n dissolving_neurons_count_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Nat64)),\n dissolving_neurons_count: IDL.Nat64,\n dissolving_neurons_e8s_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Float64)),\n timestamp_seconds: IDL.Nat64,\n });\n const MaturityModulation = IDL.Record({\n current_basis_points: IDL.Opt(IDL.Int32),\n updated_at_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const TargetVersionSet = IDL.Record({\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n is_advanced_automatically: IDL.Opt(IDL.Bool),\n });\n const UpgradeStepsReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n upgrade_steps: IDL.Opt(Versions),\n });\n const UpgradeOutcome = IDL.Record({\n status: IDL.Opt(\n IDL.Variant({\n Success: IDL.Record({}),\n Timeout: IDL.Record({}),\n ExternalFailure: IDL.Record({}),\n InvalidState: IDL.Record({ version: IDL.Opt(Version) }),\n }),\n ),\n human_readable: IDL.Opt(IDL.Text),\n });\n const ProposalId = IDL.Record({ id: IDL.Nat64 });\n const UpgradeStarted = IDL.Record({\n current_version: IDL.Opt(Version),\n expected_version: IDL.Opt(Version),\n reason: IDL.Opt(\n IDL.Variant({\n UpgradeSnsToNextVersionProposal: ProposalId,\n BehindTargetVersion: IDL.Record({}),\n }),\n ),\n });\n const UpgradeStepsRefreshed = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n });\n const TargetVersionReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n });\n const UpgradeJournalEntry = IDL.Record({\n event: IDL.Opt(\n IDL.Variant({\n TargetVersionSet: TargetVersionSet,\n UpgradeStepsReset: UpgradeStepsReset,\n UpgradeOutcome: UpgradeOutcome,\n UpgradeStarted: UpgradeStarted,\n UpgradeStepsRefreshed: UpgradeStepsRefreshed,\n TargetVersionReset: TargetVersionReset,\n }),\n ),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const UpgradeJournal = IDL.Record({\n entries: IDL.Vec(UpgradeJournalEntry),\n });\n const NeuronId = IDL.Record({ id: IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ followees: IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n permissions: IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n final_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n reward_rate_transition_duration_seconds: IDL.Opt(IDL.Nat64),\n round_duration_seconds: IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n default_followees: IDL.Opt(DefaultFollowees),\n max_dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n max_dissolve_delay_bonus_percentage: IDL.Opt(IDL.Nat64),\n max_followees_per_function: IDL.Opt(IDL.Nat64),\n automatically_advance_target_version: IDL.Opt(IDL.Bool),\n neuron_claimer_permissions: IDL.Opt(NeuronPermissionList),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n max_neuron_age_for_age_bonus: IDL.Opt(IDL.Nat64),\n initial_voting_period_seconds: IDL.Opt(IDL.Nat64),\n neuron_minimum_dissolve_delay_to_vote_seconds: IDL.Opt(IDL.Nat64),\n reject_cost_e8s: IDL.Opt(IDL.Nat64),\n max_proposals_to_keep_per_action: IDL.Opt(IDL.Nat32),\n wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64),\n max_number_of_neurons: IDL.Opt(IDL.Nat64),\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64),\n max_age_bonus_percentage: IDL.Opt(IDL.Nat64),\n neuron_grantable_permissions: IDL.Opt(NeuronPermissionList),\n voting_rewards_parameters: IDL.Opt(VotingRewardsParameters),\n maturity_modulation_disabled: IDL.Opt(IDL.Bool),\n max_number_of_principals_per_neuron: IDL.Opt(IDL.Nat64),\n });\n const RewardEvent = IDL.Record({\n rounds_since_last_distribution: IDL.Opt(IDL.Nat64),\n actual_timestamp_seconds: IDL.Nat64,\n end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n total_available_e8s_equivalent: IDL.Opt(IDL.Nat64),\n distributed_e8s_equivalent: IDL.Nat64,\n round: IDL.Nat64,\n settled_proposals: IDL.Vec(ProposalId),\n });\n const PendingVersion = IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Opt(IDL.Nat64),\n target_version: IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n error_message: IDL.Text,\n error_type: IDL.Int32,\n });\n const Decimal = IDL.Record({ human_readable: IDL.Opt(IDL.Text) });\n const Tokens = IDL.Record({ e8s: IDL.Opt(IDL.Nat64) });\n const ValuationFactors = IDL.Record({\n xdrs_per_icp: IDL.Opt(Decimal),\n icps_per_token: IDL.Opt(Decimal),\n tokens: IDL.Opt(Tokens),\n });\n const Valuation = IDL.Record({\n token: IDL.Opt(IDL.Int32),\n account: IDL.Opt(Account),\n valuation_factors: IDL.Opt(ValuationFactors),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const MintSnsTokensActionAuxiliary = IDL.Record({\n valuation: IDL.Opt(Valuation),\n });\n const SnsVersion = IDL.Record({\n archive_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n root_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n swap_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n ledger_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n governance_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n index_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const AdvanceSnsTargetVersionActionAuxiliary = IDL.Record({\n target_version: IDL.Opt(SnsVersion),\n });\n const ActionAuxiliary = IDL.Variant({\n TransferSnsTreasuryFunds: MintSnsTokensActionAuxiliary,\n MintSnsTokens: MintSnsTokensActionAuxiliary,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersionActionAuxiliary,\n });\n const Ballot = IDL.Record({\n vote: IDL.Int32,\n cast_timestamp_seconds: IDL.Nat64,\n voting_power: IDL.Nat64,\n });\n const Percentage = IDL.Record({ basis_points: IDL.Opt(IDL.Nat64) });\n const Tally = IDL.Record({\n no: IDL.Nat64,\n yes: IDL.Nat64,\n total: IDL.Nat64,\n timestamp_seconds: IDL.Nat64,\n });\n const ManageDappCanisterSettings = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat64),\n wasm_memory_threshold: IDL.Opt(IDL.Nat64),\n canister_ids: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat64),\n log_visibility: IDL.Opt(IDL.Int32),\n wasm_memory_limit: IDL.Opt(IDL.Nat64),\n memory_allocation: IDL.Opt(IDL.Nat64),\n compute_allocation: IDL.Opt(IDL.Nat64),\n });\n PreciseValue.fill(\n IDL.Variant({\n Int: IDL.Int64,\n Map: IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),\n Nat: IDL.Nat64,\n Blob: IDL.Vec(IDL.Nat8),\n Bool: IDL.Bool,\n Text: IDL.Text,\n Array: IDL.Vec(PreciseValue),\n }),\n );\n const ExtensionOperationArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const ExecuteExtensionOperation = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n operation_name: IDL.Opt(IDL.Text),\n operation_arg: IDL.Opt(ExtensionOperationArg),\n });\n const ChunkedCanisterWasm = IDL.Record({\n wasm_module_hash: IDL.Vec(IDL.Nat8),\n chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),\n store_canister_id: IDL.Opt(IDL.Principal),\n });\n const Wasm = IDL.Variant({\n Chunked: ChunkedCanisterWasm,\n Bytes: IDL.Vec(IDL.Nat8),\n });\n const ExtensionUpgradeArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const UpgradeExtension = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n wasm: IDL.Opt(Wasm),\n canister_upgrade_arg: IDL.Opt(ExtensionUpgradeArg),\n });\n const SetTopicsForCustomProposals = IDL.Record({\n custom_function_id_to_topic: IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),\n });\n const ExtensionInit = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const RegisterExtension = IDL.Record({\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n extension_init: IDL.Opt(ExtensionInit),\n });\n const RegisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n });\n const TransferSnsTreasuryFunds = IDL.Record({\n from_treasury: IDL.Int32,\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n new_canister_wasm: IDL.Vec(IDL.Nat8),\n mode: IDL.Opt(IDL.Int32),\n canister_id: IDL.Opt(IDL.Principal),\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n canister_upgrade_arg: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const DeregisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n new_controllers: IDL.Vec(IDL.Principal),\n });\n const MintSnsTokens = IDL.Record({\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const AdvanceSnsTargetVersion = IDL.Record({\n new_target: IDL.Opt(SnsVersion),\n });\n const ManageSnsMetadata = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n function_id: IDL.Nat64,\n payload: IDL.Vec(IDL.Nat8),\n });\n const ManageLedgerParameters = IDL.Record({\n token_symbol: IDL.Opt(IDL.Text),\n transfer_fee: IDL.Opt(IDL.Nat64),\n token_logo: IDL.Opt(IDL.Text),\n token_name: IDL.Opt(IDL.Text),\n });\n const Motion = IDL.Record({ motion_text: IDL.Text });\n const Action = IDL.Variant({\n ManageNervousSystemParameters: NervousSystemParameters,\n AddGenericNervousSystemFunction: NervousSystemFunction,\n ManageDappCanisterSettings: ManageDappCanisterSettings,\n ExecuteExtensionOperation: ExecuteExtensionOperation,\n UpgradeExtension: UpgradeExtension,\n RemoveGenericNervousSystemFunction: IDL.Nat64,\n SetTopicsForCustomProposals: SetTopicsForCustomProposals,\n RegisterExtension: RegisterExtension,\n UpgradeSnsToNextVersion: IDL.Record({}),\n RegisterDappCanisters: RegisterDappCanisters,\n TransferSnsTreasuryFunds: TransferSnsTreasuryFunds,\n UpgradeSnsControlledCanister: UpgradeSnsControlledCanister,\n DeregisterDappCanisters: DeregisterDappCanisters,\n MintSnsTokens: MintSnsTokens,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersion,\n Unspecified: IDL.Record({}),\n ManageSnsMetadata: ManageSnsMetadata,\n ExecuteGenericNervousSystemFunction: ExecuteGenericNervousSystemFunction,\n ManageLedgerParameters: ManageLedgerParameters,\n Motion: Motion,\n });\n const Proposal = IDL.Record({\n url: IDL.Text,\n title: IDL.Text,\n action: IDL.Opt(Action),\n summary: IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n current_deadline_timestamp_seconds: IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n id: IDL.Opt(ProposalId),\n payload_text_rendering: IDL.Opt(IDL.Text),\n topic: IDL.Opt(Topic),\n action: IDL.Nat64,\n failure_reason: IDL.Opt(GovernanceError),\n action_auxiliary: IDL.Opt(ActionAuxiliary),\n ballots: IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n minimum_yes_proportion_of_total: IDL.Opt(Percentage),\n reward_event_round: IDL.Nat64,\n failed_timestamp_seconds: IDL.Nat64,\n reward_event_end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n proposal_creation_timestamp_seconds: IDL.Nat64,\n initial_voting_period_seconds: IDL.Nat64,\n reject_cost_e8s: IDL.Nat64,\n latest_tally: IDL.Opt(Tally),\n wait_for_quiet_deadline_increase_seconds: IDL.Nat64,\n decided_timestamp_seconds: IDL.Nat64,\n proposal: IDL.Opt(Proposal),\n proposer: IDL.Opt(NeuronId),\n wait_for_quiet_state: IDL.Opt(WaitForQuietState),\n minimum_yes_proportion_of_exercised: IDL.Opt(Percentage),\n is_eligible_for_rewards: IDL.Bool,\n executed_timestamp_seconds: IDL.Nat64,\n });\n const Split = IDL.Record({ memo: IDL.Nat64, amount_e8s: IDL.Nat64 });\n const Follow = IDL.Record({\n function_id: IDL.Nat64,\n followees: IDL.Vec(NeuronId),\n });\n const DisburseMaturity = IDL.Record({\n to_account: IDL.Opt(Account),\n percentage_to_disburse: IDL.Nat32,\n });\n const ChangeAutoStakeMaturity = IDL.Record({\n requested_setting_for_auto_stake_maturity: IDL.Bool,\n });\n const IncreaseDissolveDelay = IDL.Record({\n additional_dissolve_delay_seconds: IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n dissolve_timestamp_seconds: IDL.Nat64,\n });\n const Operation = IDL.Variant({\n ChangeAutoStakeMaturity: ChangeAutoStakeMaturity,\n StopDissolving: IDL.Record({}),\n StartDissolving: IDL.Record({}),\n IncreaseDissolveDelay: IncreaseDissolveDelay,\n SetDissolveTimestamp: SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ operation: IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n vote: IDL.Int32,\n proposal: IDL.Opt(ProposalId),\n });\n const Followee = IDL.Record({\n alias: IDL.Opt(IDL.Text),\n neuron_id: IDL.Opt(NeuronId),\n });\n const FolloweesForTopic = IDL.Record({\n topic: IDL.Opt(Topic),\n followees: IDL.Vec(Followee),\n });\n const SetFollowing = IDL.Record({\n topic_following: IDL.Vec(FolloweesForTopic),\n });\n const FinalizeDisburseMaturity = IDL.Record({\n amount_to_be_disbursed_e8s: IDL.Nat64,\n to_account: IDL.Opt(Account),\n });\n const MemoAndController = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n memo: IDL.Nat64,\n });\n const By = IDL.Variant({\n MemoAndController: MemoAndController,\n NeuronId: IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ by: IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n permissions_to_remove: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n permissions_to_add: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ percentage_to_merge: IDL.Nat32 });\n const Amount = IDL.Record({ e8s: IDL.Nat64 });\n const Disburse = IDL.Record({\n to_account: IDL.Opt(Account),\n amount: IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n SyncCommand: IDL.Record({}),\n MakeProposal: Proposal,\n FinalizeDisburseMaturity: FinalizeDisburseMaturity,\n ClaimOrRefreshNeuron: ClaimOrRefresh,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n command: IDL.Opt(Command_2),\n timestamp: IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n principal: IDL.Opt(IDL.Principal),\n permission_type: IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n DissolveDelaySeconds: IDL.Nat64,\n WhenDissolvedTimestampSeconds: IDL.Nat64,\n });\n const DisburseMaturityInProgress = IDL.Record({\n timestamp_of_disbursement_seconds: IDL.Nat64,\n amount_e8s: IDL.Nat64,\n account_to_disburse_to: IDL.Opt(Account),\n finalize_disbursement_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Neuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n staked_maturity_e8s_equivalent: IDL.Opt(IDL.Nat64),\n permissions: IDL.Vec(NeuronPermission),\n maturity_e8s_equivalent: IDL.Nat64,\n cached_neuron_stake_e8s: IDL.Nat64,\n created_timestamp_seconds: IDL.Nat64,\n topic_followees: IDL.Opt(\n IDL.Record({\n topic_id_to_followees: IDL.Vec(IDL.Tuple(IDL.Int32, FolloweesForTopic)),\n }),\n ),\n source_nns_neuron_id: IDL.Opt(IDL.Nat64),\n auto_stake_maturity: IDL.Opt(IDL.Bool),\n aging_since_timestamp_seconds: IDL.Nat64,\n dissolve_state: IDL.Opt(DissolveState),\n voting_power_percentage_multiplier: IDL.Nat64,\n vesting_period_seconds: IDL.Opt(IDL.Nat64),\n disburse_maturity_in_progress: IDL.Vec(DisburseMaturityInProgress),\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n neuron_fees_e8s: IDL.Nat64,\n });\n const Governance = IDL.Record({\n root_canister_id: IDL.Opt(IDL.Principal),\n timers: IDL.Opt(Timers),\n cached_upgrade_steps: IDL.Opt(CachedUpgradeSteps),\n id_to_nervous_system_functions: IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction),\n ),\n metrics: IDL.Opt(GovernanceCachedMetrics),\n maturity_modulation: IDL.Opt(MaturityModulation),\n upgrade_journal: IDL.Opt(UpgradeJournal),\n mode: IDL.Int32,\n parameters: IDL.Opt(NervousSystemParameters),\n is_finalizing_disburse_maturity: IDL.Opt(IDL.Bool),\n deployed_version: IDL.Opt(Version),\n sns_initialization_parameters: IDL.Text,\n latest_reward_event: IDL.Opt(RewardEvent),\n pending_version: IDL.Opt(PendingVersion),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n proposals: IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n in_flight_commands: IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n sns_metadata: IDL.Opt(ManageSnsMetadata),\n neurons: IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n target_version: IDL.Opt(Version),\n genesis_timestamp_seconds: IDL.Nat64,\n });\n\n return [Governance];\n};\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.0.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({ IDL }) => {\n const PreciseValue = IDL.Rec();\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Version = IDL.Record({\n archive_wasm_hash: IDL.Vec(IDL.Nat8),\n root_wasm_hash: IDL.Vec(IDL.Nat8),\n swap_wasm_hash: IDL.Vec(IDL.Nat8),\n ledger_wasm_hash: IDL.Vec(IDL.Nat8),\n governance_wasm_hash: IDL.Vec(IDL.Nat8),\n index_wasm_hash: IDL.Vec(IDL.Nat8),\n });\n const Versions = IDL.Record({ versions: IDL.Vec(Version) });\n const CachedUpgradeSteps = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requested_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Topic = IDL.Variant({\n DappCanisterManagement: IDL.Null,\n DaoCommunitySettings: IDL.Null,\n ApplicationBusinessLogic: IDL.Null,\n CriticalDappOperations: IDL.Null,\n TreasuryAssetManagement: IDL.Null,\n Governance: IDL.Null,\n SnsFrameworkManagement: IDL.Null,\n });\n const GenericNervousSystemFunction = IDL.Record({\n topic: IDL.Opt(Topic),\n validator_canister_id: IDL.Opt(IDL.Principal),\n target_canister_id: IDL.Opt(IDL.Principal),\n validator_method_name: IDL.Opt(IDL.Text),\n target_method_name: IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n NativeNervousSystemFunction: IDL.Record({}),\n GenericNervousSystemFunction: GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n id: IDL.Nat64,\n name: IDL.Text,\n description: IDL.Opt(IDL.Text),\n function_type: IDL.Opt(FunctionType),\n });\n const Subaccount = IDL.Record({ subaccount: IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n owner: IDL.Opt(IDL.Principal),\n subaccount: IDL.Opt(Subaccount),\n });\n const TreasuryMetrics = IDL.Record({\n name: IDL.Opt(IDL.Text),\n original_amount_e8s: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n account: IDL.Opt(Account),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n treasury: IDL.Int32,\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const VotingPowerMetrics = IDL.Record({\n governance_total_potential_voting_power: IDL.Opt(IDL.Nat64),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GovernanceCachedMetrics = IDL.Record({\n treasury_metrics: IDL.Vec(TreasuryMetrics),\n not_dissolving_neurons_e8s_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64),\n ),\n garbage_collectable_neurons_count: IDL.Nat64,\n neurons_with_invalid_stake_count: IDL.Nat64,\n not_dissolving_neurons_count_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64),\n ),\n neurons_with_less_than_6_months_dissolve_delay_count: IDL.Nat64,\n dissolved_neurons_count: IDL.Nat64,\n total_staked_e8s: IDL.Nat64,\n total_supply_governance_tokens: IDL.Nat64,\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n not_dissolving_neurons_count: IDL.Nat64,\n dissolved_neurons_e8s: IDL.Nat64,\n neurons_with_less_than_6_months_dissolve_delay_e8s: IDL.Nat64,\n dissolving_neurons_count_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Nat64)),\n dissolving_neurons_count: IDL.Nat64,\n dissolving_neurons_e8s_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Float64)),\n timestamp_seconds: IDL.Nat64,\n });\n const MaturityModulation = IDL.Record({\n current_basis_points: IDL.Opt(IDL.Int32),\n updated_at_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const TargetVersionSet = IDL.Record({\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n is_advanced_automatically: IDL.Opt(IDL.Bool),\n });\n const UpgradeStepsReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n upgrade_steps: IDL.Opt(Versions),\n });\n const UpgradeOutcome = IDL.Record({\n status: IDL.Opt(\n IDL.Variant({\n Success: IDL.Record({}),\n Timeout: IDL.Record({}),\n ExternalFailure: IDL.Record({}),\n InvalidState: IDL.Record({ version: IDL.Opt(Version) }),\n }),\n ),\n human_readable: IDL.Opt(IDL.Text),\n });\n const ProposalId = IDL.Record({ id: IDL.Nat64 });\n const UpgradeStarted = IDL.Record({\n current_version: IDL.Opt(Version),\n expected_version: IDL.Opt(Version),\n reason: IDL.Opt(\n IDL.Variant({\n UpgradeSnsToNextVersionProposal: ProposalId,\n BehindTargetVersion: IDL.Record({}),\n }),\n ),\n });\n const UpgradeStepsRefreshed = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n });\n const TargetVersionReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n });\n const UpgradeJournalEntry = IDL.Record({\n event: IDL.Opt(\n IDL.Variant({\n TargetVersionSet: TargetVersionSet,\n UpgradeStepsReset: UpgradeStepsReset,\n UpgradeOutcome: UpgradeOutcome,\n UpgradeStarted: UpgradeStarted,\n UpgradeStepsRefreshed: UpgradeStepsRefreshed,\n TargetVersionReset: TargetVersionReset,\n }),\n ),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const UpgradeJournal = IDL.Record({\n entries: IDL.Vec(UpgradeJournalEntry),\n });\n const NeuronId = IDL.Record({ id: IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ followees: IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n permissions: IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n final_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n reward_rate_transition_duration_seconds: IDL.Opt(IDL.Nat64),\n round_duration_seconds: IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n default_followees: IDL.Opt(DefaultFollowees),\n max_dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n max_dissolve_delay_bonus_percentage: IDL.Opt(IDL.Nat64),\n max_followees_per_function: IDL.Opt(IDL.Nat64),\n automatically_advance_target_version: IDL.Opt(IDL.Bool),\n neuron_claimer_permissions: IDL.Opt(NeuronPermissionList),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n max_neuron_age_for_age_bonus: IDL.Opt(IDL.Nat64),\n initial_voting_period_seconds: IDL.Opt(IDL.Nat64),\n neuron_minimum_dissolve_delay_to_vote_seconds: IDL.Opt(IDL.Nat64),\n reject_cost_e8s: IDL.Opt(IDL.Nat64),\n max_proposals_to_keep_per_action: IDL.Opt(IDL.Nat32),\n wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64),\n max_number_of_neurons: IDL.Opt(IDL.Nat64),\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64),\n max_age_bonus_percentage: IDL.Opt(IDL.Nat64),\n neuron_grantable_permissions: IDL.Opt(NeuronPermissionList),\n voting_rewards_parameters: IDL.Opt(VotingRewardsParameters),\n maturity_modulation_disabled: IDL.Opt(IDL.Bool),\n max_number_of_principals_per_neuron: IDL.Opt(IDL.Nat64),\n });\n const RewardEvent = IDL.Record({\n rounds_since_last_distribution: IDL.Opt(IDL.Nat64),\n actual_timestamp_seconds: IDL.Nat64,\n end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n total_available_e8s_equivalent: IDL.Opt(IDL.Nat64),\n distributed_e8s_equivalent: IDL.Nat64,\n round: IDL.Nat64,\n settled_proposals: IDL.Vec(ProposalId),\n });\n const PendingVersion = IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Opt(IDL.Nat64),\n target_version: IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n error_message: IDL.Text,\n error_type: IDL.Int32,\n });\n const Decimal = IDL.Record({ human_readable: IDL.Opt(IDL.Text) });\n const Tokens = IDL.Record({ e8s: IDL.Opt(IDL.Nat64) });\n const ValuationFactors = IDL.Record({\n xdrs_per_icp: IDL.Opt(Decimal),\n icps_per_token: IDL.Opt(Decimal),\n tokens: IDL.Opt(Tokens),\n });\n const Valuation = IDL.Record({\n token: IDL.Opt(IDL.Int32),\n account: IDL.Opt(Account),\n valuation_factors: IDL.Opt(ValuationFactors),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const MintSnsTokensActionAuxiliary = IDL.Record({\n valuation: IDL.Opt(Valuation),\n });\n const SnsVersion = IDL.Record({\n archive_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n root_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n swap_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n ledger_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n governance_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n index_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const AdvanceSnsTargetVersionActionAuxiliary = IDL.Record({\n target_version: IDL.Opt(SnsVersion),\n });\n const ActionAuxiliary = IDL.Variant({\n TransferSnsTreasuryFunds: MintSnsTokensActionAuxiliary,\n MintSnsTokens: MintSnsTokensActionAuxiliary,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersionActionAuxiliary,\n });\n const Ballot = IDL.Record({\n vote: IDL.Int32,\n cast_timestamp_seconds: IDL.Nat64,\n voting_power: IDL.Nat64,\n });\n const Percentage = IDL.Record({ basis_points: IDL.Opt(IDL.Nat64) });\n const Tally = IDL.Record({\n no: IDL.Nat64,\n yes: IDL.Nat64,\n total: IDL.Nat64,\n timestamp_seconds: IDL.Nat64,\n });\n const ManageDappCanisterSettings = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat64),\n wasm_memory_threshold: IDL.Opt(IDL.Nat64),\n canister_ids: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat64),\n log_visibility: IDL.Opt(IDL.Int32),\n wasm_memory_limit: IDL.Opt(IDL.Nat64),\n memory_allocation: IDL.Opt(IDL.Nat64),\n compute_allocation: IDL.Opt(IDL.Nat64),\n });\n PreciseValue.fill(\n IDL.Variant({\n Int: IDL.Int64,\n Map: IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),\n Nat: IDL.Nat64,\n Blob: IDL.Vec(IDL.Nat8),\n Bool: IDL.Bool,\n Text: IDL.Text,\n Array: IDL.Vec(PreciseValue),\n }),\n );\n const ExtensionOperationArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const ExecuteExtensionOperation = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n operation_name: IDL.Opt(IDL.Text),\n operation_arg: IDL.Opt(ExtensionOperationArg),\n });\n const ChunkedCanisterWasm = IDL.Record({\n wasm_module_hash: IDL.Vec(IDL.Nat8),\n chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),\n store_canister_id: IDL.Opt(IDL.Principal),\n });\n const Wasm = IDL.Variant({\n Chunked: ChunkedCanisterWasm,\n Bytes: IDL.Vec(IDL.Nat8),\n });\n const ExtensionUpgradeArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const UpgradeExtension = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n wasm: IDL.Opt(Wasm),\n canister_upgrade_arg: IDL.Opt(ExtensionUpgradeArg),\n });\n const SetTopicsForCustomProposals = IDL.Record({\n custom_function_id_to_topic: IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),\n });\n const ExtensionInit = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const RegisterExtension = IDL.Record({\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n extension_init: IDL.Opt(ExtensionInit),\n });\n const RegisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n });\n const TransferSnsTreasuryFunds = IDL.Record({\n from_treasury: IDL.Int32,\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n new_canister_wasm: IDL.Vec(IDL.Nat8),\n mode: IDL.Opt(IDL.Int32),\n canister_id: IDL.Opt(IDL.Principal),\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n canister_upgrade_arg: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const DeregisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n new_controllers: IDL.Vec(IDL.Principal),\n });\n const MintSnsTokens = IDL.Record({\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const AdvanceSnsTargetVersion = IDL.Record({\n new_target: IDL.Opt(SnsVersion),\n });\n const ManageSnsMetadata = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n function_id: IDL.Nat64,\n payload: IDL.Vec(IDL.Nat8),\n });\n const ManageLedgerParameters = IDL.Record({\n token_symbol: IDL.Opt(IDL.Text),\n transfer_fee: IDL.Opt(IDL.Nat64),\n token_logo: IDL.Opt(IDL.Text),\n token_name: IDL.Opt(IDL.Text),\n });\n const Motion = IDL.Record({ motion_text: IDL.Text });\n const Action = IDL.Variant({\n ManageNervousSystemParameters: NervousSystemParameters,\n AddGenericNervousSystemFunction: NervousSystemFunction,\n ManageDappCanisterSettings: ManageDappCanisterSettings,\n ExecuteExtensionOperation: ExecuteExtensionOperation,\n UpgradeExtension: UpgradeExtension,\n RemoveGenericNervousSystemFunction: IDL.Nat64,\n SetTopicsForCustomProposals: SetTopicsForCustomProposals,\n RegisterExtension: RegisterExtension,\n UpgradeSnsToNextVersion: IDL.Record({}),\n RegisterDappCanisters: RegisterDappCanisters,\n TransferSnsTreasuryFunds: TransferSnsTreasuryFunds,\n UpgradeSnsControlledCanister: UpgradeSnsControlledCanister,\n DeregisterDappCanisters: DeregisterDappCanisters,\n MintSnsTokens: MintSnsTokens,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersion,\n Unspecified: IDL.Record({}),\n ManageSnsMetadata: ManageSnsMetadata,\n ExecuteGenericNervousSystemFunction: ExecuteGenericNervousSystemFunction,\n ManageLedgerParameters: ManageLedgerParameters,\n Motion: Motion,\n });\n const Proposal = IDL.Record({\n url: IDL.Text,\n title: IDL.Text,\n action: IDL.Opt(Action),\n summary: IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n current_deadline_timestamp_seconds: IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n id: IDL.Opt(ProposalId),\n payload_text_rendering: IDL.Opt(IDL.Text),\n topic: IDL.Opt(Topic),\n action: IDL.Nat64,\n failure_reason: IDL.Opt(GovernanceError),\n action_auxiliary: IDL.Opt(ActionAuxiliary),\n ballots: IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n minimum_yes_proportion_of_total: IDL.Opt(Percentage),\n reward_event_round: IDL.Nat64,\n failed_timestamp_seconds: IDL.Nat64,\n reward_event_end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n proposal_creation_timestamp_seconds: IDL.Nat64,\n initial_voting_period_seconds: IDL.Nat64,\n reject_cost_e8s: IDL.Nat64,\n latest_tally: IDL.Opt(Tally),\n wait_for_quiet_deadline_increase_seconds: IDL.Nat64,\n decided_timestamp_seconds: IDL.Nat64,\n proposal: IDL.Opt(Proposal),\n proposer: IDL.Opt(NeuronId),\n wait_for_quiet_state: IDL.Opt(WaitForQuietState),\n minimum_yes_proportion_of_exercised: IDL.Opt(Percentage),\n is_eligible_for_rewards: IDL.Bool,\n executed_timestamp_seconds: IDL.Nat64,\n });\n const Split = IDL.Record({ memo: IDL.Nat64, amount_e8s: IDL.Nat64 });\n const Follow = IDL.Record({\n function_id: IDL.Nat64,\n followees: IDL.Vec(NeuronId),\n });\n const DisburseMaturity = IDL.Record({\n to_account: IDL.Opt(Account),\n percentage_to_disburse: IDL.Nat32,\n });\n const ChangeAutoStakeMaturity = IDL.Record({\n requested_setting_for_auto_stake_maturity: IDL.Bool,\n });\n const IncreaseDissolveDelay = IDL.Record({\n additional_dissolve_delay_seconds: IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n dissolve_timestamp_seconds: IDL.Nat64,\n });\n const Operation = IDL.Variant({\n ChangeAutoStakeMaturity: ChangeAutoStakeMaturity,\n StopDissolving: IDL.Record({}),\n StartDissolving: IDL.Record({}),\n IncreaseDissolveDelay: IncreaseDissolveDelay,\n SetDissolveTimestamp: SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ operation: IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n vote: IDL.Int32,\n proposal: IDL.Opt(ProposalId),\n });\n const Followee = IDL.Record({\n alias: IDL.Opt(IDL.Text),\n neuron_id: IDL.Opt(NeuronId),\n });\n const FolloweesForTopic = IDL.Record({\n topic: IDL.Opt(Topic),\n followees: IDL.Vec(Followee),\n });\n const SetFollowing = IDL.Record({\n topic_following: IDL.Vec(FolloweesForTopic),\n });\n const FinalizeDisburseMaturity = IDL.Record({\n amount_to_be_disbursed_e8s: IDL.Nat64,\n to_account: IDL.Opt(Account),\n });\n const MemoAndController = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n memo: IDL.Nat64,\n });\n const By = IDL.Variant({\n MemoAndController: MemoAndController,\n NeuronId: IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ by: IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n permissions_to_remove: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n permissions_to_add: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ percentage_to_merge: IDL.Nat32 });\n const Amount = IDL.Record({ e8s: IDL.Nat64 });\n const Disburse = IDL.Record({\n to_account: IDL.Opt(Account),\n amount: IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n SyncCommand: IDL.Record({}),\n MakeProposal: Proposal,\n FinalizeDisburseMaturity: FinalizeDisburseMaturity,\n ClaimOrRefreshNeuron: ClaimOrRefresh,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n command: IDL.Opt(Command_2),\n timestamp: IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n principal: IDL.Opt(IDL.Principal),\n permission_type: IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n DissolveDelaySeconds: IDL.Nat64,\n WhenDissolvedTimestampSeconds: IDL.Nat64,\n });\n const DisburseMaturityInProgress = IDL.Record({\n timestamp_of_disbursement_seconds: IDL.Nat64,\n amount_e8s: IDL.Nat64,\n account_to_disburse_to: IDL.Opt(Account),\n finalize_disbursement_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Neuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n staked_maturity_e8s_equivalent: IDL.Opt(IDL.Nat64),\n permissions: IDL.Vec(NeuronPermission),\n maturity_e8s_equivalent: IDL.Nat64,\n cached_neuron_stake_e8s: IDL.Nat64,\n created_timestamp_seconds: IDL.Nat64,\n topic_followees: IDL.Opt(\n IDL.Record({\n topic_id_to_followees: IDL.Vec(IDL.Tuple(IDL.Int32, FolloweesForTopic)),\n }),\n ),\n source_nns_neuron_id: IDL.Opt(IDL.Nat64),\n auto_stake_maturity: IDL.Opt(IDL.Bool),\n aging_since_timestamp_seconds: IDL.Nat64,\n dissolve_state: IDL.Opt(DissolveState),\n voting_power_percentage_multiplier: IDL.Nat64,\n vesting_period_seconds: IDL.Opt(IDL.Nat64),\n disburse_maturity_in_progress: IDL.Vec(DisburseMaturityInProgress),\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n neuron_fees_e8s: IDL.Nat64,\n });\n const Governance = IDL.Record({\n root_canister_id: IDL.Opt(IDL.Principal),\n timers: IDL.Opt(Timers),\n cached_upgrade_steps: IDL.Opt(CachedUpgradeSteps),\n id_to_nervous_system_functions: IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction),\n ),\n metrics: IDL.Opt(GovernanceCachedMetrics),\n maturity_modulation: IDL.Opt(MaturityModulation),\n upgrade_journal: IDL.Opt(UpgradeJournal),\n mode: IDL.Int32,\n parameters: IDL.Opt(NervousSystemParameters),\n is_finalizing_disburse_maturity: IDL.Opt(IDL.Bool),\n deployed_version: IDL.Opt(Version),\n sns_initialization_parameters: IDL.Text,\n latest_reward_event: IDL.Opt(RewardEvent),\n pending_version: IDL.Opt(PendingVersion),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n proposals: IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n in_flight_commands: IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n sns_metadata: IDL.Opt(ManageSnsMetadata),\n neurons: IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n target_version: IDL.Opt(Version),\n genesis_timestamp_seconds: IDL.Nat64,\n });\n const Principals = IDL.Record({ principals: IDL.Vec(IDL.Principal) });\n const NeuronsFund = IDL.Record({\n nns_neuron_hotkeys: IDL.Opt(Principals),\n nns_neuron_controller: IDL.Opt(IDL.Principal),\n nns_neuron_id: IDL.Opt(IDL.Nat64),\n });\n const Participant = IDL.Variant({\n NeuronsFund: NeuronsFund,\n Direct: IDL.Record({}),\n });\n const NeuronIds = IDL.Record({ neuron_ids: IDL.Vec(NeuronId) });\n const NeuronRecipe = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n participant: IDL.Opt(Participant),\n stake_e8s: IDL.Opt(IDL.Nat64),\n followees: IDL.Opt(NeuronIds),\n neuron_id: IDL.Opt(NeuronId),\n });\n const NeuronRecipes = IDL.Record({\n neuron_recipes: IDL.Vec(NeuronRecipe),\n });\n const ClaimSwapNeuronsRequest = IDL.Record({\n neuron_recipes: IDL.Opt(NeuronRecipes),\n });\n const SwapNeuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n status: IDL.Int32,\n });\n const ClaimedSwapNeurons = IDL.Record({\n swap_neurons: IDL.Vec(SwapNeuron),\n });\n const ClaimSwapNeuronsResult = IDL.Variant({\n Ok: ClaimedSwapNeurons,\n Err: IDL.Int32,\n });\n const ClaimSwapNeuronsResponse = IDL.Record({\n claim_swap_neurons_result: IDL.Opt(ClaimSwapNeuronsResult),\n });\n const GetMaturityModulationResponse = IDL.Record({\n maturity_modulation: IDL.Opt(MaturityModulation),\n });\n const GetMetadataResponse = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const GetMetricsRequest = IDL.Record({\n time_window_seconds: IDL.Opt(IDL.Nat64),\n });\n const Metrics = IDL.Record({\n treasury_metrics: IDL.Opt(IDL.Vec(TreasuryMetrics)),\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n last_ledger_block_timestamp: IDL.Opt(IDL.Nat64),\n num_recently_executed_proposals: IDL.Opt(IDL.Nat64),\n num_recently_submitted_proposals: IDL.Opt(IDL.Nat64),\n genesis_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GetMetricsResult = IDL.Variant({\n Ok: Metrics,\n Err: GovernanceError,\n });\n const GetMetricsResponse = IDL.Record({\n get_metrics_result: IDL.Opt(GetMetricsResult),\n });\n const GetModeResponse = IDL.Record({ mode: IDL.Opt(IDL.Int32) });\n const GetNeuron = IDL.Record({ neuron_id: IDL.Opt(NeuronId) });\n const Result = IDL.Variant({ Error: GovernanceError, Neuron: Neuron });\n const GetNeuronResponse = IDL.Record({ result: IDL.Opt(Result) });\n const GetProposal = IDL.Record({ proposal_id: IDL.Opt(ProposalId) });\n const Result_1 = IDL.Variant({\n Error: GovernanceError,\n Proposal: ProposalData,\n });\n const GetProposalResponse = IDL.Record({ result: IDL.Opt(Result_1) });\n const MemoryMetrics = IDL.Record({\n wasm_binary_size: IDL.Opt(IDL.Nat),\n wasm_chunk_store_size: IDL.Opt(IDL.Nat),\n canister_history_size: IDL.Opt(IDL.Nat),\n stable_memory_size: IDL.Opt(IDL.Nat),\n snapshots_size: IDL.Opt(IDL.Nat),\n wasm_memory_size: IDL.Opt(IDL.Nat),\n global_memory_size: IDL.Opt(IDL.Nat),\n custom_sections_size: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusType = IDL.Variant({\n stopped: IDL.Null,\n stopping: IDL.Null,\n running: IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n freezing_threshold: IDL.Nat,\n wasm_memory_threshold: IDL.Opt(IDL.Nat),\n controllers: IDL.Vec(IDL.Principal),\n wasm_memory_limit: IDL.Opt(IDL.Nat),\n memory_allocation: IDL.Nat,\n compute_allocation: IDL.Nat,\n });\n const QueryStats = IDL.Record({\n response_payload_bytes_total: IDL.Opt(IDL.Nat),\n num_instructions_total: IDL.Opt(IDL.Nat),\n num_calls_total: IDL.Opt(IDL.Nat),\n request_payload_bytes_total: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusResultV2 = IDL.Record({\n memory_metrics: IDL.Opt(MemoryMetrics),\n status: CanisterStatusType,\n memory_size: IDL.Nat,\n cycles: IDL.Nat,\n settings: DefiniteCanisterSettingsArgs,\n query_stats: IDL.Opt(QueryStats),\n idle_cycles_burned_per_day: IDL.Nat,\n module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetRunningSnsVersionResponse = IDL.Record({\n deployed_version: IDL.Opt(Version),\n pending_version: IDL.Opt(\n IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Nat64,\n target_version: IDL.Opt(Version),\n }),\n ),\n });\n const GetSnsInitializationParametersResponse = IDL.Record({\n sns_initialization_parameters: IDL.Text,\n });\n const GetTimersResponse = IDL.Record({ timers: IDL.Opt(Timers) });\n const GetUpgradeJournalRequest = IDL.Record({\n offset: IDL.Opt(IDL.Nat64),\n limit: IDL.Opt(IDL.Nat64),\n });\n const GetUpgradeJournalResponse = IDL.Record({\n upgrade_journal: IDL.Opt(UpgradeJournal),\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n deployed_version: IDL.Opt(Version),\n target_version: IDL.Opt(Version),\n upgrade_journal_entry_count: IDL.Opt(IDL.Nat64),\n });\n const ListNervousSystemFunctionsResponse = IDL.Record({\n reserved_ids: IDL.Vec(IDL.Nat64),\n functions: IDL.Vec(NervousSystemFunction),\n });\n const ListNeurons = IDL.Record({\n of_principal: IDL.Opt(IDL.Principal),\n limit: IDL.Nat32,\n start_page_at: IDL.Opt(NeuronId),\n });\n const ListNeuronsResponse = IDL.Record({ neurons: IDL.Vec(Neuron) });\n const TopicSelector = IDL.Record({ topic: IDL.Opt(Topic) });\n const ListProposals = IDL.Record({\n include_reward_status: IDL.Vec(IDL.Int32),\n before_proposal: IDL.Opt(ProposalId),\n limit: IDL.Nat32,\n exclude_type: IDL.Vec(IDL.Nat64),\n include_topics: IDL.Opt(IDL.Vec(TopicSelector)),\n include_status: IDL.Vec(IDL.Int32),\n });\n const ListProposalsResponse = IDL.Record({\n include_ballots_by_caller: IDL.Opt(IDL.Bool),\n proposals: IDL.Vec(ProposalData),\n include_topic_filtering: IDL.Opt(IDL.Bool),\n });\n const ListTopicsRequest = IDL.Record({});\n const ExtensionOperationType = IDL.Variant({\n TreasuryManagerWithdraw: IDL.Null,\n TreasuryManagerDeposit: IDL.Null,\n });\n const ExtensionType = IDL.Variant({ TreasuryManager: IDL.Null });\n const ExtensionOperationSpec = IDL.Record({\n topic: IDL.Opt(Topic),\n operation_type: IDL.Opt(ExtensionOperationType),\n description: IDL.Opt(IDL.Text),\n extension_type: IDL.Opt(ExtensionType),\n });\n const RegisteredExtensionOperationSpec = IDL.Record({\n spec: IDL.Opt(ExtensionOperationSpec),\n canister_id: IDL.Opt(IDL.Principal),\n });\n const TopicInfo = IDL.Record({\n extension_operations: IDL.Opt(IDL.Vec(RegisteredExtensionOperationSpec)),\n native_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n topic: IDL.Opt(Topic),\n is_critical: IDL.Opt(IDL.Bool),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n custom_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n });\n const ListTopicsResponse = IDL.Record({\n uncategorized_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n topics: IDL.Opt(IDL.Vec(TopicInfo)),\n });\n const StakeMaturity = IDL.Record({\n percentage_to_stake: IDL.Opt(IDL.Nat32),\n });\n const Command = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n ClaimOrRefresh: ClaimOrRefresh,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n MakeProposal: Proposal,\n StakeMaturity: StakeMaturity,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const ManageNeuron = IDL.Record({\n subaccount: IDL.Vec(IDL.Nat8),\n command: IDL.Opt(Command),\n });\n const SplitResponse = IDL.Record({ created_neuron_id: IDL.Opt(NeuronId) });\n const DisburseMaturityResponse = IDL.Record({\n amount_disbursed_e8s: IDL.Nat64,\n amount_deducted_e8s: IDL.Opt(IDL.Nat64),\n });\n const ClaimOrRefreshResponse = IDL.Record({\n refreshed_neuron_id: IDL.Opt(NeuronId),\n });\n const StakeMaturityResponse = IDL.Record({\n maturity_e8s: IDL.Nat64,\n staked_maturity_e8s: IDL.Nat64,\n });\n const MergeMaturityResponse = IDL.Record({\n merged_maturity_e8s: IDL.Nat64,\n new_stake_e8s: IDL.Nat64,\n });\n const DisburseResponse = IDL.Record({ transfer_block_height: IDL.Nat64 });\n const Command_1 = IDL.Variant({\n Error: GovernanceError,\n Split: SplitResponse,\n Follow: IDL.Record({}),\n DisburseMaturity: DisburseMaturityResponse,\n ClaimOrRefresh: ClaimOrRefreshResponse,\n Configure: IDL.Record({}),\n RegisterVote: IDL.Record({}),\n SetFollowing: IDL.Record({}),\n MakeProposal: GetProposal,\n RemoveNeuronPermission: IDL.Record({}),\n StakeMaturity: StakeMaturityResponse,\n MergeMaturity: MergeMaturityResponse,\n Disburse: DisburseResponse,\n AddNeuronPermission: IDL.Record({}),\n });\n const ManageNeuronResponse = IDL.Record({ command: IDL.Opt(Command_1) });\n const SetMode = IDL.Record({ mode: IDL.Int32 });\n\n return IDL.Service({\n claim_swap_neurons: IDL.Func(\n [ClaimSwapNeuronsRequest],\n [ClaimSwapNeuronsResponse],\n [],\n ),\n fail_stuck_upgrade_in_progress: IDL.Func(\n [IDL.Record({})],\n [IDL.Record({})],\n [],\n ),\n get_build_metadata: IDL.Func([], [IDL.Text], [\"query\"]),\n get_latest_reward_event: IDL.Func([], [RewardEvent], [\"query\"]),\n get_maturity_modulation: IDL.Func(\n [IDL.Record({})],\n [GetMaturityModulationResponse],\n [],\n ),\n get_metadata: IDL.Func([IDL.Record({})], [GetMetadataResponse], [\"query\"]),\n get_metrics: IDL.Func(\n [GetMetricsRequest],\n [GetMetricsResponse],\n [\"composite_query\"],\n ),\n get_metrics_replicated: IDL.Func(\n [GetMetricsRequest],\n [GetMetricsResponse],\n [],\n ),\n get_mode: IDL.Func([IDL.Record({})], [GetModeResponse], [\"query\"]),\n get_nervous_system_parameters: IDL.Func(\n [IDL.Null],\n [NervousSystemParameters],\n [\"query\"],\n ),\n get_neuron: IDL.Func([GetNeuron], [GetNeuronResponse], [\"query\"]),\n get_proposal: IDL.Func([GetProposal], [GetProposalResponse], [\"query\"]),\n get_root_canister_status: IDL.Func(\n [IDL.Null],\n [CanisterStatusResultV2],\n [],\n ),\n get_running_sns_version: IDL.Func(\n [IDL.Record({})],\n [GetRunningSnsVersionResponse],\n [\"query\"],\n ),\n get_sns_initialization_parameters: IDL.Func(\n [IDL.Record({})],\n [GetSnsInitializationParametersResponse],\n [\"query\"],\n ),\n get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], [\"query\"]),\n get_upgrade_journal: IDL.Func(\n [GetUpgradeJournalRequest],\n [GetUpgradeJournalResponse],\n [\"query\"],\n ),\n list_nervous_system_functions: IDL.Func(\n [],\n [ListNervousSystemFunctionsResponse],\n [\"query\"],\n ),\n list_neurons: IDL.Func([ListNeurons], [ListNeuronsResponse], [\"query\"]),\n list_proposals: IDL.Func(\n [ListProposals],\n [ListProposalsResponse],\n [\"query\"],\n ),\n list_topics: IDL.Func([ListTopicsRequest], [ListTopicsResponse], [\"query\"]),\n manage_neuron: IDL.Func([ManageNeuron], [ManageNeuronResponse], []),\n reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], []),\n set_mode: IDL.Func([SetMode], [IDL.Record({})], []),\n });\n};\n\nexport const init = ({ IDL }) => {\n const PreciseValue = IDL.Rec();\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Version = IDL.Record({\n archive_wasm_hash: IDL.Vec(IDL.Nat8),\n root_wasm_hash: IDL.Vec(IDL.Nat8),\n swap_wasm_hash: IDL.Vec(IDL.Nat8),\n ledger_wasm_hash: IDL.Vec(IDL.Nat8),\n governance_wasm_hash: IDL.Vec(IDL.Nat8),\n index_wasm_hash: IDL.Vec(IDL.Nat8),\n });\n const Versions = IDL.Record({ versions: IDL.Vec(Version) });\n const CachedUpgradeSteps = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requested_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Topic = IDL.Variant({\n DappCanisterManagement: IDL.Null,\n DaoCommunitySettings: IDL.Null,\n ApplicationBusinessLogic: IDL.Null,\n CriticalDappOperations: IDL.Null,\n TreasuryAssetManagement: IDL.Null,\n Governance: IDL.Null,\n SnsFrameworkManagement: IDL.Null,\n });\n const GenericNervousSystemFunction = IDL.Record({\n topic: IDL.Opt(Topic),\n validator_canister_id: IDL.Opt(IDL.Principal),\n target_canister_id: IDL.Opt(IDL.Principal),\n validator_method_name: IDL.Opt(IDL.Text),\n target_method_name: IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n NativeNervousSystemFunction: IDL.Record({}),\n GenericNervousSystemFunction: GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n id: IDL.Nat64,\n name: IDL.Text,\n description: IDL.Opt(IDL.Text),\n function_type: IDL.Opt(FunctionType),\n });\n const Subaccount = IDL.Record({ subaccount: IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n owner: IDL.Opt(IDL.Principal),\n subaccount: IDL.Opt(Subaccount),\n });\n const TreasuryMetrics = IDL.Record({\n name: IDL.Opt(IDL.Text),\n original_amount_e8s: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n account: IDL.Opt(Account),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n treasury: IDL.Int32,\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const VotingPowerMetrics = IDL.Record({\n governance_total_potential_voting_power: IDL.Opt(IDL.Nat64),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GovernanceCachedMetrics = IDL.Record({\n treasury_metrics: IDL.Vec(TreasuryMetrics),\n not_dissolving_neurons_e8s_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64),\n ),\n garbage_collectable_neurons_count: IDL.Nat64,\n neurons_with_invalid_stake_count: IDL.Nat64,\n not_dissolving_neurons_count_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64),\n ),\n neurons_with_less_than_6_months_dissolve_delay_count: IDL.Nat64,\n dissolved_neurons_count: IDL.Nat64,\n total_staked_e8s: IDL.Nat64,\n total_supply_governance_tokens: IDL.Nat64,\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n not_dissolving_neurons_count: IDL.Nat64,\n dissolved_neurons_e8s: IDL.Nat64,\n neurons_with_less_than_6_months_dissolve_delay_e8s: IDL.Nat64,\n dissolving_neurons_count_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Nat64)),\n dissolving_neurons_count: IDL.Nat64,\n dissolving_neurons_e8s_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Float64)),\n timestamp_seconds: IDL.Nat64,\n });\n const MaturityModulation = IDL.Record({\n current_basis_points: IDL.Opt(IDL.Int32),\n updated_at_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const TargetVersionSet = IDL.Record({\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n is_advanced_automatically: IDL.Opt(IDL.Bool),\n });\n const UpgradeStepsReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n upgrade_steps: IDL.Opt(Versions),\n });\n const UpgradeOutcome = IDL.Record({\n status: IDL.Opt(\n IDL.Variant({\n Success: IDL.Record({}),\n Timeout: IDL.Record({}),\n ExternalFailure: IDL.Record({}),\n InvalidState: IDL.Record({ version: IDL.Opt(Version) }),\n }),\n ),\n human_readable: IDL.Opt(IDL.Text),\n });\n const ProposalId = IDL.Record({ id: IDL.Nat64 });\n const UpgradeStarted = IDL.Record({\n current_version: IDL.Opt(Version),\n expected_version: IDL.Opt(Version),\n reason: IDL.Opt(\n IDL.Variant({\n UpgradeSnsToNextVersionProposal: ProposalId,\n BehindTargetVersion: IDL.Record({}),\n }),\n ),\n });\n const UpgradeStepsRefreshed = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n });\n const TargetVersionReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n });\n const UpgradeJournalEntry = IDL.Record({\n event: IDL.Opt(\n IDL.Variant({\n TargetVersionSet: TargetVersionSet,\n UpgradeStepsReset: UpgradeStepsReset,\n UpgradeOutcome: UpgradeOutcome,\n UpgradeStarted: UpgradeStarted,\n UpgradeStepsRefreshed: UpgradeStepsRefreshed,\n TargetVersionReset: TargetVersionReset,\n }),\n ),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const UpgradeJournal = IDL.Record({\n entries: IDL.Vec(UpgradeJournalEntry),\n });\n const NeuronId = IDL.Record({ id: IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ followees: IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n permissions: IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n final_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n reward_rate_transition_duration_seconds: IDL.Opt(IDL.Nat64),\n round_duration_seconds: IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n default_followees: IDL.Opt(DefaultFollowees),\n max_dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n max_dissolve_delay_bonus_percentage: IDL.Opt(IDL.Nat64),\n max_followees_per_function: IDL.Opt(IDL.Nat64),\n automatically_advance_target_version: IDL.Opt(IDL.Bool),\n neuron_claimer_permissions: IDL.Opt(NeuronPermissionList),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n max_neuron_age_for_age_bonus: IDL.Opt(IDL.Nat64),\n initial_voting_period_seconds: IDL.Opt(IDL.Nat64),\n neuron_minimum_dissolve_delay_to_vote_seconds: IDL.Opt(IDL.Nat64),\n reject_cost_e8s: IDL.Opt(IDL.Nat64),\n max_proposals_to_keep_per_action: IDL.Opt(IDL.Nat32),\n wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64),\n max_number_of_neurons: IDL.Opt(IDL.Nat64),\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64),\n max_age_bonus_percentage: IDL.Opt(IDL.Nat64),\n neuron_grantable_permissions: IDL.Opt(NeuronPermissionList),\n voting_rewards_parameters: IDL.Opt(VotingRewardsParameters),\n maturity_modulation_disabled: IDL.Opt(IDL.Bool),\n max_number_of_principals_per_neuron: IDL.Opt(IDL.Nat64),\n });\n const RewardEvent = IDL.Record({\n rounds_since_last_distribution: IDL.Opt(IDL.Nat64),\n actual_timestamp_seconds: IDL.Nat64,\n end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n total_available_e8s_equivalent: IDL.Opt(IDL.Nat64),\n distributed_e8s_equivalent: IDL.Nat64,\n round: IDL.Nat64,\n settled_proposals: IDL.Vec(ProposalId),\n });\n const PendingVersion = IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Opt(IDL.Nat64),\n target_version: IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n error_message: IDL.Text,\n error_type: IDL.Int32,\n });\n const Decimal = IDL.Record({ human_readable: IDL.Opt(IDL.Text) });\n const Tokens = IDL.Record({ e8s: IDL.Opt(IDL.Nat64) });\n const ValuationFactors = IDL.Record({\n xdrs_per_icp: IDL.Opt(Decimal),\n icps_per_token: IDL.Opt(Decimal),\n tokens: IDL.Opt(Tokens),\n });\n const Valuation = IDL.Record({\n token: IDL.Opt(IDL.Int32),\n account: IDL.Opt(Account),\n valuation_factors: IDL.Opt(ValuationFactors),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const MintSnsTokensActionAuxiliary = IDL.Record({\n valuation: IDL.Opt(Valuation),\n });\n const SnsVersion = IDL.Record({\n archive_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n root_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n swap_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n ledger_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n governance_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n index_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const AdvanceSnsTargetVersionActionAuxiliary = IDL.Record({\n target_version: IDL.Opt(SnsVersion),\n });\n const ActionAuxiliary = IDL.Variant({\n TransferSnsTreasuryFunds: MintSnsTokensActionAuxiliary,\n MintSnsTokens: MintSnsTokensActionAuxiliary,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersionActionAuxiliary,\n });\n const Ballot = IDL.Record({\n vote: IDL.Int32,\n cast_timestamp_seconds: IDL.Nat64,\n voting_power: IDL.Nat64,\n });\n const Percentage = IDL.Record({ basis_points: IDL.Opt(IDL.Nat64) });\n const Tally = IDL.Record({\n no: IDL.Nat64,\n yes: IDL.Nat64,\n total: IDL.Nat64,\n timestamp_seconds: IDL.Nat64,\n });\n const ManageDappCanisterSettings = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat64),\n wasm_memory_threshold: IDL.Opt(IDL.Nat64),\n canister_ids: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat64),\n log_visibility: IDL.Opt(IDL.Int32),\n wasm_memory_limit: IDL.Opt(IDL.Nat64),\n memory_allocation: IDL.Opt(IDL.Nat64),\n compute_allocation: IDL.Opt(IDL.Nat64),\n });\n PreciseValue.fill(\n IDL.Variant({\n Int: IDL.Int64,\n Map: IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),\n Nat: IDL.Nat64,\n Blob: IDL.Vec(IDL.Nat8),\n Bool: IDL.Bool,\n Text: IDL.Text,\n Array: IDL.Vec(PreciseValue),\n }),\n );\n const ExtensionOperationArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const ExecuteExtensionOperation = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n operation_name: IDL.Opt(IDL.Text),\n operation_arg: IDL.Opt(ExtensionOperationArg),\n });\n const ChunkedCanisterWasm = IDL.Record({\n wasm_module_hash: IDL.Vec(IDL.Nat8),\n chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),\n store_canister_id: IDL.Opt(IDL.Principal),\n });\n const Wasm = IDL.Variant({\n Chunked: ChunkedCanisterWasm,\n Bytes: IDL.Vec(IDL.Nat8),\n });\n const ExtensionUpgradeArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const UpgradeExtension = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n wasm: IDL.Opt(Wasm),\n canister_upgrade_arg: IDL.Opt(ExtensionUpgradeArg),\n });\n const SetTopicsForCustomProposals = IDL.Record({\n custom_function_id_to_topic: IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),\n });\n const ExtensionInit = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const RegisterExtension = IDL.Record({\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n extension_init: IDL.Opt(ExtensionInit),\n });\n const RegisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n });\n const TransferSnsTreasuryFunds = IDL.Record({\n from_treasury: IDL.Int32,\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n new_canister_wasm: IDL.Vec(IDL.Nat8),\n mode: IDL.Opt(IDL.Int32),\n canister_id: IDL.Opt(IDL.Principal),\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n canister_upgrade_arg: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const DeregisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n new_controllers: IDL.Vec(IDL.Principal),\n });\n const MintSnsTokens = IDL.Record({\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const AdvanceSnsTargetVersion = IDL.Record({\n new_target: IDL.Opt(SnsVersion),\n });\n const ManageSnsMetadata = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n function_id: IDL.Nat64,\n payload: IDL.Vec(IDL.Nat8),\n });\n const ManageLedgerParameters = IDL.Record({\n token_symbol: IDL.Opt(IDL.Text),\n transfer_fee: IDL.Opt(IDL.Nat64),\n token_logo: IDL.Opt(IDL.Text),\n token_name: IDL.Opt(IDL.Text),\n });\n const Motion = IDL.Record({ motion_text: IDL.Text });\n const Action = IDL.Variant({\n ManageNervousSystemParameters: NervousSystemParameters,\n AddGenericNervousSystemFunction: NervousSystemFunction,\n ManageDappCanisterSettings: ManageDappCanisterSettings,\n ExecuteExtensionOperation: ExecuteExtensionOperation,\n UpgradeExtension: UpgradeExtension,\n RemoveGenericNervousSystemFunction: IDL.Nat64,\n SetTopicsForCustomProposals: SetTopicsForCustomProposals,\n RegisterExtension: RegisterExtension,\n UpgradeSnsToNextVersion: IDL.Record({}),\n RegisterDappCanisters: RegisterDappCanisters,\n TransferSnsTreasuryFunds: TransferSnsTreasuryFunds,\n UpgradeSnsControlledCanister: UpgradeSnsControlledCanister,\n DeregisterDappCanisters: DeregisterDappCanisters,\n MintSnsTokens: MintSnsTokens,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersion,\n Unspecified: IDL.Record({}),\n ManageSnsMetadata: ManageSnsMetadata,\n ExecuteGenericNervousSystemFunction: ExecuteGenericNervousSystemFunction,\n ManageLedgerParameters: ManageLedgerParameters,\n Motion: Motion,\n });\n const Proposal = IDL.Record({\n url: IDL.Text,\n title: IDL.Text,\n action: IDL.Opt(Action),\n summary: IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n current_deadline_timestamp_seconds: IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n id: IDL.Opt(ProposalId),\n payload_text_rendering: IDL.Opt(IDL.Text),\n topic: IDL.Opt(Topic),\n action: IDL.Nat64,\n failure_reason: IDL.Opt(GovernanceError),\n action_auxiliary: IDL.Opt(ActionAuxiliary),\n ballots: IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n minimum_yes_proportion_of_total: IDL.Opt(Percentage),\n reward_event_round: IDL.Nat64,\n failed_timestamp_seconds: IDL.Nat64,\n reward_event_end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n proposal_creation_timestamp_seconds: IDL.Nat64,\n initial_voting_period_seconds: IDL.Nat64,\n reject_cost_e8s: IDL.Nat64,\n latest_tally: IDL.Opt(Tally),\n wait_for_quiet_deadline_increase_seconds: IDL.Nat64,\n decided_timestamp_seconds: IDL.Nat64,\n proposal: IDL.Opt(Proposal),\n proposer: IDL.Opt(NeuronId),\n wait_for_quiet_state: IDL.Opt(WaitForQuietState),\n minimum_yes_proportion_of_exercised: IDL.Opt(Percentage),\n is_eligible_for_rewards: IDL.Bool,\n executed_timestamp_seconds: IDL.Nat64,\n });\n const Split = IDL.Record({ memo: IDL.Nat64, amount_e8s: IDL.Nat64 });\n const Follow = IDL.Record({\n function_id: IDL.Nat64,\n followees: IDL.Vec(NeuronId),\n });\n const DisburseMaturity = IDL.Record({\n to_account: IDL.Opt(Account),\n percentage_to_disburse: IDL.Nat32,\n });\n const ChangeAutoStakeMaturity = IDL.Record({\n requested_setting_for_auto_stake_maturity: IDL.Bool,\n });\n const IncreaseDissolveDelay = IDL.Record({\n additional_dissolve_delay_seconds: IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n dissolve_timestamp_seconds: IDL.Nat64,\n });\n const Operation = IDL.Variant({\n ChangeAutoStakeMaturity: ChangeAutoStakeMaturity,\n StopDissolving: IDL.Record({}),\n StartDissolving: IDL.Record({}),\n IncreaseDissolveDelay: IncreaseDissolveDelay,\n SetDissolveTimestamp: SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ operation: IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n vote: IDL.Int32,\n proposal: IDL.Opt(ProposalId),\n });\n const Followee = IDL.Record({\n alias: IDL.Opt(IDL.Text),\n neuron_id: IDL.Opt(NeuronId),\n });\n const FolloweesForTopic = IDL.Record({\n topic: IDL.Opt(Topic),\n followees: IDL.Vec(Followee),\n });\n const SetFollowing = IDL.Record({\n topic_following: IDL.Vec(FolloweesForTopic),\n });\n const FinalizeDisburseMaturity = IDL.Record({\n amount_to_be_disbursed_e8s: IDL.Nat64,\n to_account: IDL.Opt(Account),\n });\n const MemoAndController = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n memo: IDL.Nat64,\n });\n const By = IDL.Variant({\n MemoAndController: MemoAndController,\n NeuronId: IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ by: IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n permissions_to_remove: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n permissions_to_add: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ percentage_to_merge: IDL.Nat32 });\n const Amount = IDL.Record({ e8s: IDL.Nat64 });\n const Disburse = IDL.Record({\n to_account: IDL.Opt(Account),\n amount: IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n SyncCommand: IDL.Record({}),\n MakeProposal: Proposal,\n FinalizeDisburseMaturity: FinalizeDisburseMaturity,\n ClaimOrRefreshNeuron: ClaimOrRefresh,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n command: IDL.Opt(Command_2),\n timestamp: IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n principal: IDL.Opt(IDL.Principal),\n permission_type: IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n DissolveDelaySeconds: IDL.Nat64,\n WhenDissolvedTimestampSeconds: IDL.Nat64,\n });\n const DisburseMaturityInProgress = IDL.Record({\n timestamp_of_disbursement_seconds: IDL.Nat64,\n amount_e8s: IDL.Nat64,\n account_to_disburse_to: IDL.Opt(Account),\n finalize_disbursement_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Neuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n staked_maturity_e8s_equivalent: IDL.Opt(IDL.Nat64),\n permissions: IDL.Vec(NeuronPermission),\n maturity_e8s_equivalent: IDL.Nat64,\n cached_neuron_stake_e8s: IDL.Nat64,\n created_timestamp_seconds: IDL.Nat64,\n topic_followees: IDL.Opt(\n IDL.Record({\n topic_id_to_followees: IDL.Vec(IDL.Tuple(IDL.Int32, FolloweesForTopic)),\n }),\n ),\n source_nns_neuron_id: IDL.Opt(IDL.Nat64),\n auto_stake_maturity: IDL.Opt(IDL.Bool),\n aging_since_timestamp_seconds: IDL.Nat64,\n dissolve_state: IDL.Opt(DissolveState),\n voting_power_percentage_multiplier: IDL.Nat64,\n vesting_period_seconds: IDL.Opt(IDL.Nat64),\n disburse_maturity_in_progress: IDL.Vec(DisburseMaturityInProgress),\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n neuron_fees_e8s: IDL.Nat64,\n });\n const Governance = IDL.Record({\n root_canister_id: IDL.Opt(IDL.Principal),\n timers: IDL.Opt(Timers),\n cached_upgrade_steps: IDL.Opt(CachedUpgradeSteps),\n id_to_nervous_system_functions: IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction),\n ),\n metrics: IDL.Opt(GovernanceCachedMetrics),\n maturity_modulation: IDL.Opt(MaturityModulation),\n upgrade_journal: IDL.Opt(UpgradeJournal),\n mode: IDL.Int32,\n parameters: IDL.Opt(NervousSystemParameters),\n is_finalizing_disburse_maturity: IDL.Opt(IDL.Bool),\n deployed_version: IDL.Opt(Version),\n sns_initialization_parameters: IDL.Text,\n latest_reward_event: IDL.Opt(RewardEvent),\n pending_version: IDL.Opt(PendingVersion),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n proposals: IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n in_flight_commands: IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n sns_metadata: IDL.Opt(ManageSnsMetadata),\n neurons: IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n target_version: IDL.Opt(Version),\n genesis_timestamp_seconds: IDL.Nat64,\n });\n\n return [Governance];\n};\n", "import {\n Canister,\n createServices,\n fromNullable,\n isNullish,\n toNullable,\n} from \"@dfinity/utils\";\nimport type {\n NeuronId,\n _SERVICE as SnsGovernanceTestService,\n} from \"./candid/sns_governance_test\";\nimport { idlFactory as certifiedIdlFactory } from \"./candid/sns_governance_test.certified.idl\";\nimport { idlFactory } from \"./candid/sns_governance_test.idl\";\nimport { SnsGovernanceError } from \"./errors/governance.errors\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\nimport type { SnsAddMaturityParams } from \"./types/governance_test.params\";\n\nexport class SnsGovernanceTestCanister extends Canister<SnsGovernanceTestService> {\n /**\n * Instantiate a canister to interact with the governance of a Sns project.\n *\n * @param {SnsCanisterOptions} options Miscellaneous options to initialize the canister. Its ID being the only mandatory parammeter.\n */\n static create(options: SnsCanisterOptions<SnsGovernanceTestService>) {\n const { service, certifiedService, canisterId } =\n createServices<SnsGovernanceTestService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new SnsGovernanceTestCanister(canisterId, service, certifiedService);\n }\n\n /**\n * Add maturity to a neuron (only for testing purposes. Testnet only.)\n */\n addMaturity = async (params: SnsAddMaturityParams): Promise<void> => {\n const { id, amountE8s } = params;\n\n const { new_maturity_e8s } = await this.caller(params).add_maturity({\n id: toNullable<NeuronId>(id),\n amount_e8s: toNullable(amountE8s),\n });\n const newMaturity = fromNullable(new_maturity_e8s);\n\n if (isNullish(newMaturity) || newMaturity < amountE8s) {\n throw new SnsGovernanceError(\"No maturity added\");\n }\n };\n}\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.0.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({ IDL }) => {\n const PreciseValue = IDL.Rec();\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Version = IDL.Record({\n archive_wasm_hash: IDL.Vec(IDL.Nat8),\n root_wasm_hash: IDL.Vec(IDL.Nat8),\n swap_wasm_hash: IDL.Vec(IDL.Nat8),\n ledger_wasm_hash: IDL.Vec(IDL.Nat8),\n governance_wasm_hash: IDL.Vec(IDL.Nat8),\n index_wasm_hash: IDL.Vec(IDL.Nat8),\n });\n const Versions = IDL.Record({ versions: IDL.Vec(Version) });\n const CachedUpgradeSteps = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requested_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Topic = IDL.Variant({\n DappCanisterManagement: IDL.Null,\n DaoCommunitySettings: IDL.Null,\n ApplicationBusinessLogic: IDL.Null,\n CriticalDappOperations: IDL.Null,\n TreasuryAssetManagement: IDL.Null,\n Governance: IDL.Null,\n SnsFrameworkManagement: IDL.Null,\n });\n const GenericNervousSystemFunction = IDL.Record({\n topic: IDL.Opt(Topic),\n validator_canister_id: IDL.Opt(IDL.Principal),\n target_canister_id: IDL.Opt(IDL.Principal),\n validator_method_name: IDL.Opt(IDL.Text),\n target_method_name: IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n NativeNervousSystemFunction: IDL.Record({}),\n GenericNervousSystemFunction: GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n id: IDL.Nat64,\n name: IDL.Text,\n description: IDL.Opt(IDL.Text),\n function_type: IDL.Opt(FunctionType),\n });\n const Subaccount = IDL.Record({ subaccount: IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n owner: IDL.Opt(IDL.Principal),\n subaccount: IDL.Opt(Subaccount),\n });\n const TreasuryMetrics = IDL.Record({\n name: IDL.Opt(IDL.Text),\n original_amount_e8s: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n account: IDL.Opt(Account),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n treasury: IDL.Int32,\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const VotingPowerMetrics = IDL.Record({\n governance_total_potential_voting_power: IDL.Opt(IDL.Nat64),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GovernanceCachedMetrics = IDL.Record({\n treasury_metrics: IDL.Vec(TreasuryMetrics),\n not_dissolving_neurons_e8s_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64),\n ),\n garbage_collectable_neurons_count: IDL.Nat64,\n neurons_with_invalid_stake_count: IDL.Nat64,\n not_dissolving_neurons_count_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64),\n ),\n neurons_with_less_than_6_months_dissolve_delay_count: IDL.Nat64,\n dissolved_neurons_count: IDL.Nat64,\n total_staked_e8s: IDL.Nat64,\n total_supply_governance_tokens: IDL.Nat64,\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n not_dissolving_neurons_count: IDL.Nat64,\n dissolved_neurons_e8s: IDL.Nat64,\n neurons_with_less_than_6_months_dissolve_delay_e8s: IDL.Nat64,\n dissolving_neurons_count_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Nat64)),\n dissolving_neurons_count: IDL.Nat64,\n dissolving_neurons_e8s_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Float64)),\n timestamp_seconds: IDL.Nat64,\n });\n const MaturityModulation = IDL.Record({\n current_basis_points: IDL.Opt(IDL.Int32),\n updated_at_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const TargetVersionSet = IDL.Record({\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n is_advanced_automatically: IDL.Opt(IDL.Bool),\n });\n const UpgradeStepsReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n upgrade_steps: IDL.Opt(Versions),\n });\n const UpgradeOutcome = IDL.Record({\n status: IDL.Opt(\n IDL.Variant({\n Success: IDL.Record({}),\n Timeout: IDL.Record({}),\n ExternalFailure: IDL.Record({}),\n InvalidState: IDL.Record({ version: IDL.Opt(Version) }),\n }),\n ),\n human_readable: IDL.Opt(IDL.Text),\n });\n const ProposalId = IDL.Record({ id: IDL.Nat64 });\n const UpgradeStarted = IDL.Record({\n current_version: IDL.Opt(Version),\n expected_version: IDL.Opt(Version),\n reason: IDL.Opt(\n IDL.Variant({\n UpgradeSnsToNextVersionProposal: ProposalId,\n BehindTargetVersion: IDL.Record({}),\n }),\n ),\n });\n const UpgradeStepsRefreshed = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n });\n const TargetVersionReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n });\n const UpgradeJournalEntry = IDL.Record({\n event: IDL.Opt(\n IDL.Variant({\n TargetVersionSet: TargetVersionSet,\n UpgradeStepsReset: UpgradeStepsReset,\n UpgradeOutcome: UpgradeOutcome,\n UpgradeStarted: UpgradeStarted,\n UpgradeStepsRefreshed: UpgradeStepsRefreshed,\n TargetVersionReset: TargetVersionReset,\n }),\n ),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const UpgradeJournal = IDL.Record({\n entries: IDL.Vec(UpgradeJournalEntry),\n });\n const NeuronId = IDL.Record({ id: IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ followees: IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n permissions: IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n final_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n reward_rate_transition_duration_seconds: IDL.Opt(IDL.Nat64),\n round_duration_seconds: IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n default_followees: IDL.Opt(DefaultFollowees),\n max_dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n max_dissolve_delay_bonus_percentage: IDL.Opt(IDL.Nat64),\n max_followees_per_function: IDL.Opt(IDL.Nat64),\n automatically_advance_target_version: IDL.Opt(IDL.Bool),\n neuron_claimer_permissions: IDL.Opt(NeuronPermissionList),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n max_neuron_age_for_age_bonus: IDL.Opt(IDL.Nat64),\n initial_voting_period_seconds: IDL.Opt(IDL.Nat64),\n neuron_minimum_dissolve_delay_to_vote_seconds: IDL.Opt(IDL.Nat64),\n reject_cost_e8s: IDL.Opt(IDL.Nat64),\n max_proposals_to_keep_per_action: IDL.Opt(IDL.Nat32),\n wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64),\n max_number_of_neurons: IDL.Opt(IDL.Nat64),\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64),\n max_age_bonus_percentage: IDL.Opt(IDL.Nat64),\n neuron_grantable_permissions: IDL.Opt(NeuronPermissionList),\n voting_rewards_parameters: IDL.Opt(VotingRewardsParameters),\n maturity_modulation_disabled: IDL.Opt(IDL.Bool),\n max_number_of_principals_per_neuron: IDL.Opt(IDL.Nat64),\n });\n const RewardEvent = IDL.Record({\n rounds_since_last_distribution: IDL.Opt(IDL.Nat64),\n actual_timestamp_seconds: IDL.Nat64,\n end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n total_available_e8s_equivalent: IDL.Opt(IDL.Nat64),\n distributed_e8s_equivalent: IDL.Nat64,\n round: IDL.Nat64,\n settled_proposals: IDL.Vec(ProposalId),\n });\n const PendingVersion = IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Opt(IDL.Nat64),\n target_version: IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n error_message: IDL.Text,\n error_type: IDL.Int32,\n });\n const Decimal = IDL.Record({ human_readable: IDL.Opt(IDL.Text) });\n const Tokens = IDL.Record({ e8s: IDL.Opt(IDL.Nat64) });\n const ValuationFactors = IDL.Record({\n xdrs_per_icp: IDL.Opt(Decimal),\n icps_per_token: IDL.Opt(Decimal),\n tokens: IDL.Opt(Tokens),\n });\n const Valuation = IDL.Record({\n token: IDL.Opt(IDL.Int32),\n account: IDL.Opt(Account),\n valuation_factors: IDL.Opt(ValuationFactors),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const MintSnsTokensActionAuxiliary = IDL.Record({\n valuation: IDL.Opt(Valuation),\n });\n const SnsVersion = IDL.Record({\n archive_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n root_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n swap_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n ledger_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n governance_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n index_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const AdvanceSnsTargetVersionActionAuxiliary = IDL.Record({\n target_version: IDL.Opt(SnsVersion),\n });\n const ActionAuxiliary = IDL.Variant({\n TransferSnsTreasuryFunds: MintSnsTokensActionAuxiliary,\n MintSnsTokens: MintSnsTokensActionAuxiliary,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersionActionAuxiliary,\n });\n const Ballot = IDL.Record({\n vote: IDL.Int32,\n cast_timestamp_seconds: IDL.Nat64,\n voting_power: IDL.Nat64,\n });\n const Percentage = IDL.Record({ basis_points: IDL.Opt(IDL.Nat64) });\n const Tally = IDL.Record({\n no: IDL.Nat64,\n yes: IDL.Nat64,\n total: IDL.Nat64,\n timestamp_seconds: IDL.Nat64,\n });\n const ManageDappCanisterSettings = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat64),\n wasm_memory_threshold: IDL.Opt(IDL.Nat64),\n canister_ids: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat64),\n log_visibility: IDL.Opt(IDL.Int32),\n wasm_memory_limit: IDL.Opt(IDL.Nat64),\n memory_allocation: IDL.Opt(IDL.Nat64),\n compute_allocation: IDL.Opt(IDL.Nat64),\n });\n PreciseValue.fill(\n IDL.Variant({\n Int: IDL.Int64,\n Map: IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),\n Nat: IDL.Nat64,\n Blob: IDL.Vec(IDL.Nat8),\n Bool: IDL.Bool,\n Text: IDL.Text,\n Array: IDL.Vec(PreciseValue),\n }),\n );\n const ExtensionOperationArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const ExecuteExtensionOperation = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n operation_name: IDL.Opt(IDL.Text),\n operation_arg: IDL.Opt(ExtensionOperationArg),\n });\n const ChunkedCanisterWasm = IDL.Record({\n wasm_module_hash: IDL.Vec(IDL.Nat8),\n chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),\n store_canister_id: IDL.Opt(IDL.Principal),\n });\n const Wasm = IDL.Variant({\n Chunked: ChunkedCanisterWasm,\n Bytes: IDL.Vec(IDL.Nat8),\n });\n const ExtensionUpgradeArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const UpgradeExtension = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n wasm: IDL.Opt(Wasm),\n canister_upgrade_arg: IDL.Opt(ExtensionUpgradeArg),\n });\n const SetTopicsForCustomProposals = IDL.Record({\n custom_function_id_to_topic: IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),\n });\n const ExtensionInit = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const RegisterExtension = IDL.Record({\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n extension_init: IDL.Opt(ExtensionInit),\n });\n const RegisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n });\n const TransferSnsTreasuryFunds = IDL.Record({\n from_treasury: IDL.Int32,\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n new_canister_wasm: IDL.Vec(IDL.Nat8),\n mode: IDL.Opt(IDL.Int32),\n canister_id: IDL.Opt(IDL.Principal),\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n canister_upgrade_arg: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const DeregisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n new_controllers: IDL.Vec(IDL.Principal),\n });\n const MintSnsTokens = IDL.Record({\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const AdvanceSnsTargetVersion = IDL.Record({\n new_target: IDL.Opt(SnsVersion),\n });\n const ManageSnsMetadata = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n function_id: IDL.Nat64,\n payload: IDL.Vec(IDL.Nat8),\n });\n const ManageLedgerParameters = IDL.Record({\n token_symbol: IDL.Opt(IDL.Text),\n transfer_fee: IDL.Opt(IDL.Nat64),\n token_logo: IDL.Opt(IDL.Text),\n token_name: IDL.Opt(IDL.Text),\n });\n const Motion = IDL.Record({ motion_text: IDL.Text });\n const Action = IDL.Variant({\n ManageNervousSystemParameters: NervousSystemParameters,\n AddGenericNervousSystemFunction: NervousSystemFunction,\n ManageDappCanisterSettings: ManageDappCanisterSettings,\n ExecuteExtensionOperation: ExecuteExtensionOperation,\n UpgradeExtension: UpgradeExtension,\n RemoveGenericNervousSystemFunction: IDL.Nat64,\n SetTopicsForCustomProposals: SetTopicsForCustomProposals,\n RegisterExtension: RegisterExtension,\n UpgradeSnsToNextVersion: IDL.Record({}),\n RegisterDappCanisters: RegisterDappCanisters,\n TransferSnsTreasuryFunds: TransferSnsTreasuryFunds,\n UpgradeSnsControlledCanister: UpgradeSnsControlledCanister,\n DeregisterDappCanisters: DeregisterDappCanisters,\n MintSnsTokens: MintSnsTokens,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersion,\n Unspecified: IDL.Record({}),\n ManageSnsMetadata: ManageSnsMetadata,\n ExecuteGenericNervousSystemFunction: ExecuteGenericNervousSystemFunction,\n ManageLedgerParameters: ManageLedgerParameters,\n Motion: Motion,\n });\n const Proposal = IDL.Record({\n url: IDL.Text,\n title: IDL.Text,\n action: IDL.Opt(Action),\n summary: IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n current_deadline_timestamp_seconds: IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n id: IDL.Opt(ProposalId),\n payload_text_rendering: IDL.Opt(IDL.Text),\n topic: IDL.Opt(Topic),\n action: IDL.Nat64,\n failure_reason: IDL.Opt(GovernanceError),\n action_auxiliary: IDL.Opt(ActionAuxiliary),\n ballots: IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n minimum_yes_proportion_of_total: IDL.Opt(Percentage),\n reward_event_round: IDL.Nat64,\n failed_timestamp_seconds: IDL.Nat64,\n reward_event_end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n proposal_creation_timestamp_seconds: IDL.Nat64,\n initial_voting_period_seconds: IDL.Nat64,\n reject_cost_e8s: IDL.Nat64,\n latest_tally: IDL.Opt(Tally),\n wait_for_quiet_deadline_increase_seconds: IDL.Nat64,\n decided_timestamp_seconds: IDL.Nat64,\n proposal: IDL.Opt(Proposal),\n proposer: IDL.Opt(NeuronId),\n wait_for_quiet_state: IDL.Opt(WaitForQuietState),\n minimum_yes_proportion_of_exercised: IDL.Opt(Percentage),\n is_eligible_for_rewards: IDL.Bool,\n executed_timestamp_seconds: IDL.Nat64,\n });\n const Split = IDL.Record({ memo: IDL.Nat64, amount_e8s: IDL.Nat64 });\n const Follow = IDL.Record({\n function_id: IDL.Nat64,\n followees: IDL.Vec(NeuronId),\n });\n const DisburseMaturity = IDL.Record({\n to_account: IDL.Opt(Account),\n percentage_to_disburse: IDL.Nat32,\n });\n const ChangeAutoStakeMaturity = IDL.Record({\n requested_setting_for_auto_stake_maturity: IDL.Bool,\n });\n const IncreaseDissolveDelay = IDL.Record({\n additional_dissolve_delay_seconds: IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n dissolve_timestamp_seconds: IDL.Nat64,\n });\n const Operation = IDL.Variant({\n ChangeAutoStakeMaturity: ChangeAutoStakeMaturity,\n StopDissolving: IDL.Record({}),\n StartDissolving: IDL.Record({}),\n IncreaseDissolveDelay: IncreaseDissolveDelay,\n SetDissolveTimestamp: SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ operation: IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n vote: IDL.Int32,\n proposal: IDL.Opt(ProposalId),\n });\n const Followee = IDL.Record({\n alias: IDL.Opt(IDL.Text),\n neuron_id: IDL.Opt(NeuronId),\n });\n const FolloweesForTopic = IDL.Record({\n topic: IDL.Opt(Topic),\n followees: IDL.Vec(Followee),\n });\n const SetFollowing = IDL.Record({\n topic_following: IDL.Vec(FolloweesForTopic),\n });\n const FinalizeDisburseMaturity = IDL.Record({\n amount_to_be_disbursed_e8s: IDL.Nat64,\n to_account: IDL.Opt(Account),\n });\n const MemoAndController = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n memo: IDL.Nat64,\n });\n const By = IDL.Variant({\n MemoAndController: MemoAndController,\n NeuronId: IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ by: IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n permissions_to_remove: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n permissions_to_add: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ percentage_to_merge: IDL.Nat32 });\n const Amount = IDL.Record({ e8s: IDL.Nat64 });\n const Disburse = IDL.Record({\n to_account: IDL.Opt(Account),\n amount: IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n SyncCommand: IDL.Record({}),\n MakeProposal: Proposal,\n FinalizeDisburseMaturity: FinalizeDisburseMaturity,\n ClaimOrRefreshNeuron: ClaimOrRefresh,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n command: IDL.Opt(Command_2),\n timestamp: IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n principal: IDL.Opt(IDL.Principal),\n permission_type: IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n DissolveDelaySeconds: IDL.Nat64,\n WhenDissolvedTimestampSeconds: IDL.Nat64,\n });\n const DisburseMaturityInProgress = IDL.Record({\n timestamp_of_disbursement_seconds: IDL.Nat64,\n amount_e8s: IDL.Nat64,\n account_to_disburse_to: IDL.Opt(Account),\n finalize_disbursement_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Neuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n staked_maturity_e8s_equivalent: IDL.Opt(IDL.Nat64),\n permissions: IDL.Vec(NeuronPermission),\n maturity_e8s_equivalent: IDL.Nat64,\n cached_neuron_stake_e8s: IDL.Nat64,\n created_timestamp_seconds: IDL.Nat64,\n topic_followees: IDL.Opt(\n IDL.Record({\n topic_id_to_followees: IDL.Vec(IDL.Tuple(IDL.Int32, FolloweesForTopic)),\n }),\n ),\n source_nns_neuron_id: IDL.Opt(IDL.Nat64),\n auto_stake_maturity: IDL.Opt(IDL.Bool),\n aging_since_timestamp_seconds: IDL.Nat64,\n dissolve_state: IDL.Opt(DissolveState),\n voting_power_percentage_multiplier: IDL.Nat64,\n vesting_period_seconds: IDL.Opt(IDL.Nat64),\n disburse_maturity_in_progress: IDL.Vec(DisburseMaturityInProgress),\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n neuron_fees_e8s: IDL.Nat64,\n });\n const Governance = IDL.Record({\n root_canister_id: IDL.Opt(IDL.Principal),\n timers: IDL.Opt(Timers),\n cached_upgrade_steps: IDL.Opt(CachedUpgradeSteps),\n id_to_nervous_system_functions: IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction),\n ),\n metrics: IDL.Opt(GovernanceCachedMetrics),\n maturity_modulation: IDL.Opt(MaturityModulation),\n upgrade_journal: IDL.Opt(UpgradeJournal),\n mode: IDL.Int32,\n parameters: IDL.Opt(NervousSystemParameters),\n is_finalizing_disburse_maturity: IDL.Opt(IDL.Bool),\n deployed_version: IDL.Opt(Version),\n sns_initialization_parameters: IDL.Text,\n latest_reward_event: IDL.Opt(RewardEvent),\n pending_version: IDL.Opt(PendingVersion),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n proposals: IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n in_flight_commands: IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n sns_metadata: IDL.Opt(ManageSnsMetadata),\n neurons: IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n target_version: IDL.Opt(Version),\n genesis_timestamp_seconds: IDL.Nat64,\n });\n const AddMaturityRequest = IDL.Record({\n id: IDL.Opt(NeuronId),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const AddMaturityResponse = IDL.Record({\n new_maturity_e8s: IDL.Opt(IDL.Nat64),\n });\n const AdvanceTargetVersionRequest = IDL.Record({\n target_version: IDL.Opt(Version),\n });\n const AdvanceTargetVersionResponse = IDL.Record({});\n const Principals = IDL.Record({ principals: IDL.Vec(IDL.Principal) });\n const NeuronsFund = IDL.Record({\n nns_neuron_hotkeys: IDL.Opt(Principals),\n nns_neuron_controller: IDL.Opt(IDL.Principal),\n nns_neuron_id: IDL.Opt(IDL.Nat64),\n });\n const Participant = IDL.Variant({\n NeuronsFund: NeuronsFund,\n Direct: IDL.Record({}),\n });\n const NeuronIds = IDL.Record({ neuron_ids: IDL.Vec(NeuronId) });\n const NeuronRecipe = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n participant: IDL.Opt(Participant),\n stake_e8s: IDL.Opt(IDL.Nat64),\n followees: IDL.Opt(NeuronIds),\n neuron_id: IDL.Opt(NeuronId),\n });\n const NeuronRecipes = IDL.Record({\n neuron_recipes: IDL.Vec(NeuronRecipe),\n });\n const ClaimSwapNeuronsRequest = IDL.Record({\n neuron_recipes: IDL.Opt(NeuronRecipes),\n });\n const SwapNeuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n status: IDL.Int32,\n });\n const ClaimedSwapNeurons = IDL.Record({\n swap_neurons: IDL.Vec(SwapNeuron),\n });\n const ClaimSwapNeuronsResult = IDL.Variant({\n Ok: ClaimedSwapNeurons,\n Err: IDL.Int32,\n });\n const ClaimSwapNeuronsResponse = IDL.Record({\n claim_swap_neurons_result: IDL.Opt(ClaimSwapNeuronsResult),\n });\n const GetMaturityModulationResponse = IDL.Record({\n maturity_modulation: IDL.Opt(MaturityModulation),\n });\n const GetMetadataResponse = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const GetMetricsRequest = IDL.Record({\n time_window_seconds: IDL.Opt(IDL.Nat64),\n });\n const Metrics = IDL.Record({\n treasury_metrics: IDL.Opt(IDL.Vec(TreasuryMetrics)),\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n last_ledger_block_timestamp: IDL.Opt(IDL.Nat64),\n num_recently_executed_proposals: IDL.Opt(IDL.Nat64),\n num_recently_submitted_proposals: IDL.Opt(IDL.Nat64),\n genesis_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GetMetricsResult = IDL.Variant({\n Ok: Metrics,\n Err: GovernanceError,\n });\n const GetMetricsResponse = IDL.Record({\n get_metrics_result: IDL.Opt(GetMetricsResult),\n });\n const GetModeResponse = IDL.Record({ mode: IDL.Opt(IDL.Int32) });\n const GetNeuron = IDL.Record({ neuron_id: IDL.Opt(NeuronId) });\n const Result = IDL.Variant({ Error: GovernanceError, Neuron: Neuron });\n const GetNeuronResponse = IDL.Record({ result: IDL.Opt(Result) });\n const GetProposal = IDL.Record({ proposal_id: IDL.Opt(ProposalId) });\n const Result_1 = IDL.Variant({\n Error: GovernanceError,\n Proposal: ProposalData,\n });\n const GetProposalResponse = IDL.Record({ result: IDL.Opt(Result_1) });\n const MemoryMetrics = IDL.Record({\n wasm_binary_size: IDL.Opt(IDL.Nat),\n wasm_chunk_store_size: IDL.Opt(IDL.Nat),\n canister_history_size: IDL.Opt(IDL.Nat),\n stable_memory_size: IDL.Opt(IDL.Nat),\n snapshots_size: IDL.Opt(IDL.Nat),\n wasm_memory_size: IDL.Opt(IDL.Nat),\n global_memory_size: IDL.Opt(IDL.Nat),\n custom_sections_size: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusType = IDL.Variant({\n stopped: IDL.Null,\n stopping: IDL.Null,\n running: IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n freezing_threshold: IDL.Nat,\n wasm_memory_threshold: IDL.Opt(IDL.Nat),\n controllers: IDL.Vec(IDL.Principal),\n wasm_memory_limit: IDL.Opt(IDL.Nat),\n memory_allocation: IDL.Nat,\n compute_allocation: IDL.Nat,\n });\n const QueryStats = IDL.Record({\n response_payload_bytes_total: IDL.Opt(IDL.Nat),\n num_instructions_total: IDL.Opt(IDL.Nat),\n num_calls_total: IDL.Opt(IDL.Nat),\n request_payload_bytes_total: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusResultV2 = IDL.Record({\n memory_metrics: IDL.Opt(MemoryMetrics),\n status: CanisterStatusType,\n memory_size: IDL.Nat,\n cycles: IDL.Nat,\n settings: DefiniteCanisterSettingsArgs,\n query_stats: IDL.Opt(QueryStats),\n idle_cycles_burned_per_day: IDL.Nat,\n module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetRunningSnsVersionResponse = IDL.Record({\n deployed_version: IDL.Opt(Version),\n pending_version: IDL.Opt(\n IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Nat64,\n target_version: IDL.Opt(Version),\n }),\n ),\n });\n const GetSnsInitializationParametersResponse = IDL.Record({\n sns_initialization_parameters: IDL.Text,\n });\n const GetTimersResponse = IDL.Record({ timers: IDL.Opt(Timers) });\n const GetUpgradeJournalRequest = IDL.Record({\n offset: IDL.Opt(IDL.Nat64),\n limit: IDL.Opt(IDL.Nat64),\n });\n const GetUpgradeJournalResponse = IDL.Record({\n upgrade_journal: IDL.Opt(UpgradeJournal),\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n deployed_version: IDL.Opt(Version),\n target_version: IDL.Opt(Version),\n upgrade_journal_entry_count: IDL.Opt(IDL.Nat64),\n });\n const ListNervousSystemFunctionsResponse = IDL.Record({\n reserved_ids: IDL.Vec(IDL.Nat64),\n functions: IDL.Vec(NervousSystemFunction),\n });\n const ListNeurons = IDL.Record({\n of_principal: IDL.Opt(IDL.Principal),\n limit: IDL.Nat32,\n start_page_at: IDL.Opt(NeuronId),\n });\n const ListNeuronsResponse = IDL.Record({ neurons: IDL.Vec(Neuron) });\n const TopicSelector = IDL.Record({ topic: IDL.Opt(Topic) });\n const ListProposals = IDL.Record({\n include_reward_status: IDL.Vec(IDL.Int32),\n before_proposal: IDL.Opt(ProposalId),\n limit: IDL.Nat32,\n exclude_type: IDL.Vec(IDL.Nat64),\n include_topics: IDL.Opt(IDL.Vec(TopicSelector)),\n include_status: IDL.Vec(IDL.Int32),\n });\n const ListProposalsResponse = IDL.Record({\n include_ballots_by_caller: IDL.Opt(IDL.Bool),\n proposals: IDL.Vec(ProposalData),\n include_topic_filtering: IDL.Opt(IDL.Bool),\n });\n const ListTopicsRequest = IDL.Record({});\n const ExtensionOperationType = IDL.Variant({\n TreasuryManagerWithdraw: IDL.Null,\n TreasuryManagerDeposit: IDL.Null,\n });\n const ExtensionType = IDL.Variant({ TreasuryManager: IDL.Null });\n const ExtensionOperationSpec = IDL.Record({\n topic: IDL.Opt(Topic),\n operation_type: IDL.Opt(ExtensionOperationType),\n description: IDL.Opt(IDL.Text),\n extension_type: IDL.Opt(ExtensionType),\n });\n const RegisteredExtensionOperationSpec = IDL.Record({\n spec: IDL.Opt(ExtensionOperationSpec),\n canister_id: IDL.Opt(IDL.Principal),\n });\n const TopicInfo = IDL.Record({\n extension_operations: IDL.Opt(IDL.Vec(RegisteredExtensionOperationSpec)),\n native_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n topic: IDL.Opt(Topic),\n is_critical: IDL.Opt(IDL.Bool),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n custom_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n });\n const ListTopicsResponse = IDL.Record({\n uncategorized_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n topics: IDL.Opt(IDL.Vec(TopicInfo)),\n });\n const StakeMaturity = IDL.Record({\n percentage_to_stake: IDL.Opt(IDL.Nat32),\n });\n const Command = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n ClaimOrRefresh: ClaimOrRefresh,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n MakeProposal: Proposal,\n StakeMaturity: StakeMaturity,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const ManageNeuron = IDL.Record({\n subaccount: IDL.Vec(IDL.Nat8),\n command: IDL.Opt(Command),\n });\n const SplitResponse = IDL.Record({ created_neuron_id: IDL.Opt(NeuronId) });\n const DisburseMaturityResponse = IDL.Record({\n amount_disbursed_e8s: IDL.Nat64,\n amount_deducted_e8s: IDL.Opt(IDL.Nat64),\n });\n const ClaimOrRefreshResponse = IDL.Record({\n refreshed_neuron_id: IDL.Opt(NeuronId),\n });\n const StakeMaturityResponse = IDL.Record({\n maturity_e8s: IDL.Nat64,\n staked_maturity_e8s: IDL.Nat64,\n });\n const MergeMaturityResponse = IDL.Record({\n merged_maturity_e8s: IDL.Nat64,\n new_stake_e8s: IDL.Nat64,\n });\n const DisburseResponse = IDL.Record({ transfer_block_height: IDL.Nat64 });\n const Command_1 = IDL.Variant({\n Error: GovernanceError,\n Split: SplitResponse,\n Follow: IDL.Record({}),\n DisburseMaturity: DisburseMaturityResponse,\n ClaimOrRefresh: ClaimOrRefreshResponse,\n Configure: IDL.Record({}),\n RegisterVote: IDL.Record({}),\n SetFollowing: IDL.Record({}),\n MakeProposal: GetProposal,\n RemoveNeuronPermission: IDL.Record({}),\n StakeMaturity: StakeMaturityResponse,\n MergeMaturity: MergeMaturityResponse,\n Disburse: DisburseResponse,\n AddNeuronPermission: IDL.Record({}),\n });\n const ManageNeuronResponse = IDL.Record({ command: IDL.Opt(Command_1) });\n const MintTokensRequest = IDL.Record({\n recipient: IDL.Opt(Account),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const SetMode = IDL.Record({ mode: IDL.Int32 });\n\n return IDL.Service({\n add_maturity: IDL.Func([AddMaturityRequest], [AddMaturityResponse], []),\n advance_target_version: IDL.Func(\n [AdvanceTargetVersionRequest],\n [AdvanceTargetVersionResponse],\n [],\n ),\n claim_swap_neurons: IDL.Func(\n [ClaimSwapNeuronsRequest],\n [ClaimSwapNeuronsResponse],\n [],\n ),\n fail_stuck_upgrade_in_progress: IDL.Func(\n [IDL.Record({})],\n [IDL.Record({})],\n [],\n ),\n get_build_metadata: IDL.Func([], [IDL.Text], []),\n get_latest_reward_event: IDL.Func([], [RewardEvent], []),\n get_maturity_modulation: IDL.Func(\n [IDL.Record({})],\n [GetMaturityModulationResponse],\n [],\n ),\n get_metadata: IDL.Func([IDL.Record({})], [GetMetadataResponse], []),\n get_metrics: IDL.Func([GetMetricsRequest], [GetMetricsResponse], []),\n get_metrics_replicated: IDL.Func(\n [GetMetricsRequest],\n [GetMetricsResponse],\n [],\n ),\n get_mode: IDL.Func([IDL.Record({})], [GetModeResponse], []),\n get_nervous_system_parameters: IDL.Func(\n [IDL.Null],\n [NervousSystemParameters],\n [],\n ),\n get_neuron: IDL.Func([GetNeuron], [GetNeuronResponse], []),\n get_proposal: IDL.Func([GetProposal], [GetProposalResponse], []),\n get_root_canister_status: IDL.Func(\n [IDL.Null],\n [CanisterStatusResultV2],\n [],\n ),\n get_running_sns_version: IDL.Func(\n [IDL.Record({})],\n [GetRunningSnsVersionResponse],\n [],\n ),\n get_sns_initialization_parameters: IDL.Func(\n [IDL.Record({})],\n [GetSnsInitializationParametersResponse],\n [],\n ),\n get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], []),\n get_upgrade_journal: IDL.Func(\n [GetUpgradeJournalRequest],\n [GetUpgradeJournalResponse],\n [],\n ),\n list_nervous_system_functions: IDL.Func(\n [],\n [ListNervousSystemFunctionsResponse],\n [],\n ),\n list_neurons: IDL.Func([ListNeurons], [ListNeuronsResponse], []),\n list_proposals: IDL.Func([ListProposals], [ListProposalsResponse], []),\n list_topics: IDL.Func([ListTopicsRequest], [ListTopicsResponse], []),\n manage_neuron: IDL.Func([ManageNeuron], [ManageNeuronResponse], []),\n mint_tokens: IDL.Func([MintTokensRequest], [IDL.Record({})], []),\n refresh_cached_upgrade_steps: IDL.Func(\n [IDL.Record({})],\n [IDL.Record({})],\n [],\n ),\n reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], []),\n set_mode: IDL.Func([SetMode], [IDL.Record({})], []),\n update_neuron: IDL.Func([Neuron], [IDL.Opt(GovernanceError)], []),\n });\n};\n\nexport const init = ({ IDL }) => {\n const PreciseValue = IDL.Rec();\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Version = IDL.Record({\n archive_wasm_hash: IDL.Vec(IDL.Nat8),\n root_wasm_hash: IDL.Vec(IDL.Nat8),\n swap_wasm_hash: IDL.Vec(IDL.Nat8),\n ledger_wasm_hash: IDL.Vec(IDL.Nat8),\n governance_wasm_hash: IDL.Vec(IDL.Nat8),\n index_wasm_hash: IDL.Vec(IDL.Nat8),\n });\n const Versions = IDL.Record({ versions: IDL.Vec(Version) });\n const CachedUpgradeSteps = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requested_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Topic = IDL.Variant({\n DappCanisterManagement: IDL.Null,\n DaoCommunitySettings: IDL.Null,\n ApplicationBusinessLogic: IDL.Null,\n CriticalDappOperations: IDL.Null,\n TreasuryAssetManagement: IDL.Null,\n Governance: IDL.Null,\n SnsFrameworkManagement: IDL.Null,\n });\n const GenericNervousSystemFunction = IDL.Record({\n topic: IDL.Opt(Topic),\n validator_canister_id: IDL.Opt(IDL.Principal),\n target_canister_id: IDL.Opt(IDL.Principal),\n validator_method_name: IDL.Opt(IDL.Text),\n target_method_name: IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n NativeNervousSystemFunction: IDL.Record({}),\n GenericNervousSystemFunction: GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n id: IDL.Nat64,\n name: IDL.Text,\n description: IDL.Opt(IDL.Text),\n function_type: IDL.Opt(FunctionType),\n });\n const Subaccount = IDL.Record({ subaccount: IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n owner: IDL.Opt(IDL.Principal),\n subaccount: IDL.Opt(Subaccount),\n });\n const TreasuryMetrics = IDL.Record({\n name: IDL.Opt(IDL.Text),\n original_amount_e8s: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n account: IDL.Opt(Account),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n treasury: IDL.Int32,\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const VotingPowerMetrics = IDL.Record({\n governance_total_potential_voting_power: IDL.Opt(IDL.Nat64),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GovernanceCachedMetrics = IDL.Record({\n treasury_metrics: IDL.Vec(TreasuryMetrics),\n not_dissolving_neurons_e8s_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64),\n ),\n garbage_collectable_neurons_count: IDL.Nat64,\n neurons_with_invalid_stake_count: IDL.Nat64,\n not_dissolving_neurons_count_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64),\n ),\n neurons_with_less_than_6_months_dissolve_delay_count: IDL.Nat64,\n dissolved_neurons_count: IDL.Nat64,\n total_staked_e8s: IDL.Nat64,\n total_supply_governance_tokens: IDL.Nat64,\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n not_dissolving_neurons_count: IDL.Nat64,\n dissolved_neurons_e8s: IDL.Nat64,\n neurons_with_less_than_6_months_dissolve_delay_e8s: IDL.Nat64,\n dissolving_neurons_count_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Nat64)),\n dissolving_neurons_count: IDL.Nat64,\n dissolving_neurons_e8s_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Float64)),\n timestamp_seconds: IDL.Nat64,\n });\n const MaturityModulation = IDL.Record({\n current_basis_points: IDL.Opt(IDL.Int32),\n updated_at_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const TargetVersionSet = IDL.Record({\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n is_advanced_automatically: IDL.Opt(IDL.Bool),\n });\n const UpgradeStepsReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n upgrade_steps: IDL.Opt(Versions),\n });\n const UpgradeOutcome = IDL.Record({\n status: IDL.Opt(\n IDL.Variant({\n Success: IDL.Record({}),\n Timeout: IDL.Record({}),\n ExternalFailure: IDL.Record({}),\n InvalidState: IDL.Record({ version: IDL.Opt(Version) }),\n }),\n ),\n human_readable: IDL.Opt(IDL.Text),\n });\n const ProposalId = IDL.Record({ id: IDL.Nat64 });\n const UpgradeStarted = IDL.Record({\n current_version: IDL.Opt(Version),\n expected_version: IDL.Opt(Version),\n reason: IDL.Opt(\n IDL.Variant({\n UpgradeSnsToNextVersionProposal: ProposalId,\n BehindTargetVersion: IDL.Record({}),\n }),\n ),\n });\n const UpgradeStepsRefreshed = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n });\n const TargetVersionReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n });\n const UpgradeJournalEntry = IDL.Record({\n event: IDL.Opt(\n IDL.Variant({\n TargetVersionSet: TargetVersionSet,\n UpgradeStepsReset: UpgradeStepsReset,\n UpgradeOutcome: UpgradeOutcome,\n UpgradeStarted: UpgradeStarted,\n UpgradeStepsRefreshed: UpgradeStepsRefreshed,\n TargetVersionReset: TargetVersionReset,\n }),\n ),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const UpgradeJournal = IDL.Record({\n entries: IDL.Vec(UpgradeJournalEntry),\n });\n const NeuronId = IDL.Record({ id: IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ followees: IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n permissions: IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n final_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n reward_rate_transition_duration_seconds: IDL.Opt(IDL.Nat64),\n round_duration_seconds: IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n default_followees: IDL.Opt(DefaultFollowees),\n max_dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n max_dissolve_delay_bonus_percentage: IDL.Opt(IDL.Nat64),\n max_followees_per_function: IDL.Opt(IDL.Nat64),\n automatically_advance_target_version: IDL.Opt(IDL.Bool),\n neuron_claimer_permissions: IDL.Opt(NeuronPermissionList),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n max_neuron_age_for_age_bonus: IDL.Opt(IDL.Nat64),\n initial_voting_period_seconds: IDL.Opt(IDL.Nat64),\n neuron_minimum_dissolve_delay_to_vote_seconds: IDL.Opt(IDL.Nat64),\n reject_cost_e8s: IDL.Opt(IDL.Nat64),\n max_proposals_to_keep_per_action: IDL.Opt(IDL.Nat32),\n wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64),\n max_number_of_neurons: IDL.Opt(IDL.Nat64),\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64),\n max_age_bonus_percentage: IDL.Opt(IDL.Nat64),\n neuron_grantable_permissions: IDL.Opt(NeuronPermissionList),\n voting_rewards_parameters: IDL.Opt(VotingRewardsParameters),\n maturity_modulation_disabled: IDL.Opt(IDL.Bool),\n max_number_of_principals_per_neuron: IDL.Opt(IDL.Nat64),\n });\n const RewardEvent = IDL.Record({\n rounds_since_last_distribution: IDL.Opt(IDL.Nat64),\n actual_timestamp_seconds: IDL.Nat64,\n end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n total_available_e8s_equivalent: IDL.Opt(IDL.Nat64),\n distributed_e8s_equivalent: IDL.Nat64,\n round: IDL.Nat64,\n settled_proposals: IDL.Vec(ProposalId),\n });\n const PendingVersion = IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Opt(IDL.Nat64),\n target_version: IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n error_message: IDL.Text,\n error_type: IDL.Int32,\n });\n const Decimal = IDL.Record({ human_readable: IDL.Opt(IDL.Text) });\n const Tokens = IDL.Record({ e8s: IDL.Opt(IDL.Nat64) });\n const ValuationFactors = IDL.Record({\n xdrs_per_icp: IDL.Opt(Decimal),\n icps_per_token: IDL.Opt(Decimal),\n tokens: IDL.Opt(Tokens),\n });\n const Valuation = IDL.Record({\n token: IDL.Opt(IDL.Int32),\n account: IDL.Opt(Account),\n valuation_factors: IDL.Opt(ValuationFactors),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const MintSnsTokensActionAuxiliary = IDL.Record({\n valuation: IDL.Opt(Valuation),\n });\n const SnsVersion = IDL.Record({\n archive_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n root_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n swap_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n ledger_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n governance_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n index_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const AdvanceSnsTargetVersionActionAuxiliary = IDL.Record({\n target_version: IDL.Opt(SnsVersion),\n });\n const ActionAuxiliary = IDL.Variant({\n TransferSnsTreasuryFunds: MintSnsTokensActionAuxiliary,\n MintSnsTokens: MintSnsTokensActionAuxiliary,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersionActionAuxiliary,\n });\n const Ballot = IDL.Record({\n vote: IDL.Int32,\n cast_timestamp_seconds: IDL.Nat64,\n voting_power: IDL.Nat64,\n });\n const Percentage = IDL.Record({ basis_points: IDL.Opt(IDL.Nat64) });\n const Tally = IDL.Record({\n no: IDL.Nat64,\n yes: IDL.Nat64,\n total: IDL.Nat64,\n timestamp_seconds: IDL.Nat64,\n });\n const ManageDappCanisterSettings = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat64),\n wasm_memory_threshold: IDL.Opt(IDL.Nat64),\n canister_ids: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat64),\n log_visibility: IDL.Opt(IDL.Int32),\n wasm_memory_limit: IDL.Opt(IDL.Nat64),\n memory_allocation: IDL.Opt(IDL.Nat64),\n compute_allocation: IDL.Opt(IDL.Nat64),\n });\n PreciseValue.fill(\n IDL.Variant({\n Int: IDL.Int64,\n Map: IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),\n Nat: IDL.Nat64,\n Blob: IDL.Vec(IDL.Nat8),\n Bool: IDL.Bool,\n Text: IDL.Text,\n Array: IDL.Vec(PreciseValue),\n }),\n );\n const ExtensionOperationArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const ExecuteExtensionOperation = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n operation_name: IDL.Opt(IDL.Text),\n operation_arg: IDL.Opt(ExtensionOperationArg),\n });\n const ChunkedCanisterWasm = IDL.Record({\n wasm_module_hash: IDL.Vec(IDL.Nat8),\n chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),\n store_canister_id: IDL.Opt(IDL.Principal),\n });\n const Wasm = IDL.Variant({\n Chunked: ChunkedCanisterWasm,\n Bytes: IDL.Vec(IDL.Nat8),\n });\n const ExtensionUpgradeArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const UpgradeExtension = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n wasm: IDL.Opt(Wasm),\n canister_upgrade_arg: IDL.Opt(ExtensionUpgradeArg),\n });\n const SetTopicsForCustomProposals = IDL.Record({\n custom_function_id_to_topic: IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),\n });\n const ExtensionInit = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const RegisterExtension = IDL.Record({\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n extension_init: IDL.Opt(ExtensionInit),\n });\n const RegisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n });\n const TransferSnsTreasuryFunds = IDL.Record({\n from_treasury: IDL.Int32,\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n new_canister_wasm: IDL.Vec(IDL.Nat8),\n mode: IDL.Opt(IDL.Int32),\n canister_id: IDL.Opt(IDL.Principal),\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n canister_upgrade_arg: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const DeregisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n new_controllers: IDL.Vec(IDL.Principal),\n });\n const MintSnsTokens = IDL.Record({\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const AdvanceSnsTargetVersion = IDL.Record({\n new_target: IDL.Opt(SnsVersion),\n });\n const ManageSnsMetadata = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n function_id: IDL.Nat64,\n payload: IDL.Vec(IDL.Nat8),\n });\n const ManageLedgerParameters = IDL.Record({\n token_symbol: IDL.Opt(IDL.Text),\n transfer_fee: IDL.Opt(IDL.Nat64),\n token_logo: IDL.Opt(IDL.Text),\n token_name: IDL.Opt(IDL.Text),\n });\n const Motion = IDL.Record({ motion_text: IDL.Text });\n const Action = IDL.Variant({\n ManageNervousSystemParameters: NervousSystemParameters,\n AddGenericNervousSystemFunction: NervousSystemFunction,\n ManageDappCanisterSettings: ManageDappCanisterSettings,\n ExecuteExtensionOperation: ExecuteExtensionOperation,\n UpgradeExtension: UpgradeExtension,\n RemoveGenericNervousSystemFunction: IDL.Nat64,\n SetTopicsForCustomProposals: SetTopicsForCustomProposals,\n RegisterExtension: RegisterExtension,\n UpgradeSnsToNextVersion: IDL.Record({}),\n RegisterDappCanisters: RegisterDappCanisters,\n TransferSnsTreasuryFunds: TransferSnsTreasuryFunds,\n UpgradeSnsControlledCanister: UpgradeSnsControlledCanister,\n DeregisterDappCanisters: DeregisterDappCanisters,\n MintSnsTokens: MintSnsTokens,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersion,\n Unspecified: IDL.Record({}),\n ManageSnsMetadata: ManageSnsMetadata,\n ExecuteGenericNervousSystemFunction: ExecuteGenericNervousSystemFunction,\n ManageLedgerParameters: ManageLedgerParameters,\n Motion: Motion,\n });\n const Proposal = IDL.Record({\n url: IDL.Text,\n title: IDL.Text,\n action: IDL.Opt(Action),\n summary: IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n current_deadline_timestamp_seconds: IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n id: IDL.Opt(ProposalId),\n payload_text_rendering: IDL.Opt(IDL.Text),\n topic: IDL.Opt(Topic),\n action: IDL.Nat64,\n failure_reason: IDL.Opt(GovernanceError),\n action_auxiliary: IDL.Opt(ActionAuxiliary),\n ballots: IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n minimum_yes_proportion_of_total: IDL.Opt(Percentage),\n reward_event_round: IDL.Nat64,\n failed_timestamp_seconds: IDL.Nat64,\n reward_event_end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n proposal_creation_timestamp_seconds: IDL.Nat64,\n initial_voting_period_seconds: IDL.Nat64,\n reject_cost_e8s: IDL.Nat64,\n latest_tally: IDL.Opt(Tally),\n wait_for_quiet_deadline_increase_seconds: IDL.Nat64,\n decided_timestamp_seconds: IDL.Nat64,\n proposal: IDL.Opt(Proposal),\n proposer: IDL.Opt(NeuronId),\n wait_for_quiet_state: IDL.Opt(WaitForQuietState),\n minimum_yes_proportion_of_exercised: IDL.Opt(Percentage),\n is_eligible_for_rewards: IDL.Bool,\n executed_timestamp_seconds: IDL.Nat64,\n });\n const Split = IDL.Record({ memo: IDL.Nat64, amount_e8s: IDL.Nat64 });\n const Follow = IDL.Record({\n function_id: IDL.Nat64,\n followees: IDL.Vec(NeuronId),\n });\n const DisburseMaturity = IDL.Record({\n to_account: IDL.Opt(Account),\n percentage_to_disburse: IDL.Nat32,\n });\n const ChangeAutoStakeMaturity = IDL.Record({\n requested_setting_for_auto_stake_maturity: IDL.Bool,\n });\n const IncreaseDissolveDelay = IDL.Record({\n additional_dissolve_delay_seconds: IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n dissolve_timestamp_seconds: IDL.Nat64,\n });\n const Operation = IDL.Variant({\n ChangeAutoStakeMaturity: ChangeAutoStakeMaturity,\n StopDissolving: IDL.Record({}),\n StartDissolving: IDL.Record({}),\n IncreaseDissolveDelay: IncreaseDissolveDelay,\n SetDissolveTimestamp: SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ operation: IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n vote: IDL.Int32,\n proposal: IDL.Opt(ProposalId),\n });\n const Followee = IDL.Record({\n alias: IDL.Opt(IDL.Text),\n neuron_id: IDL.Opt(NeuronId),\n });\n const FolloweesForTopic = IDL.Record({\n topic: IDL.Opt(Topic),\n followees: IDL.Vec(Followee),\n });\n const SetFollowing = IDL.Record({\n topic_following: IDL.Vec(FolloweesForTopic),\n });\n const FinalizeDisburseMaturity = IDL.Record({\n amount_to_be_disbursed_e8s: IDL.Nat64,\n to_account: IDL.Opt(Account),\n });\n const MemoAndController = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n memo: IDL.Nat64,\n });\n const By = IDL.Variant({\n MemoAndController: MemoAndController,\n NeuronId: IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ by: IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n permissions_to_remove: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n permissions_to_add: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ percentage_to_merge: IDL.Nat32 });\n const Amount = IDL.Record({ e8s: IDL.Nat64 });\n const Disburse = IDL.Record({\n to_account: IDL.Opt(Account),\n amount: IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n SyncCommand: IDL.Record({}),\n MakeProposal: Proposal,\n FinalizeDisburseMaturity: FinalizeDisburseMaturity,\n ClaimOrRefreshNeuron: ClaimOrRefresh,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n command: IDL.Opt(Command_2),\n timestamp: IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n principal: IDL.Opt(IDL.Principal),\n permission_type: IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n DissolveDelaySeconds: IDL.Nat64,\n WhenDissolvedTimestampSeconds: IDL.Nat64,\n });\n const DisburseMaturityInProgress = IDL.Record({\n timestamp_of_disbursement_seconds: IDL.Nat64,\n amount_e8s: IDL.Nat64,\n account_to_disburse_to: IDL.Opt(Account),\n finalize_disbursement_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Neuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n staked_maturity_e8s_equivalent: IDL.Opt(IDL.Nat64),\n permissions: IDL.Vec(NeuronPermission),\n maturity_e8s_equivalent: IDL.Nat64,\n cached_neuron_stake_e8s: IDL.Nat64,\n created_timestamp_seconds: IDL.Nat64,\n topic_followees: IDL.Opt(\n IDL.Record({\n topic_id_to_followees: IDL.Vec(IDL.Tuple(IDL.Int32, FolloweesForTopic)),\n }),\n ),\n source_nns_neuron_id: IDL.Opt(IDL.Nat64),\n auto_stake_maturity: IDL.Opt(IDL.Bool),\n aging_since_timestamp_seconds: IDL.Nat64,\n dissolve_state: IDL.Opt(DissolveState),\n voting_power_percentage_multiplier: IDL.Nat64,\n vesting_period_seconds: IDL.Opt(IDL.Nat64),\n disburse_maturity_in_progress: IDL.Vec(DisburseMaturityInProgress),\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n neuron_fees_e8s: IDL.Nat64,\n });\n const Governance = IDL.Record({\n root_canister_id: IDL.Opt(IDL.Principal),\n timers: IDL.Opt(Timers),\n cached_upgrade_steps: IDL.Opt(CachedUpgradeSteps),\n id_to_nervous_system_functions: IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction),\n ),\n metrics: IDL.Opt(GovernanceCachedMetrics),\n maturity_modulation: IDL.Opt(MaturityModulation),\n upgrade_journal: IDL.Opt(UpgradeJournal),\n mode: IDL.Int32,\n parameters: IDL.Opt(NervousSystemParameters),\n is_finalizing_disburse_maturity: IDL.Opt(IDL.Bool),\n deployed_version: IDL.Opt(Version),\n sns_initialization_parameters: IDL.Text,\n latest_reward_event: IDL.Opt(RewardEvent),\n pending_version: IDL.Opt(PendingVersion),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n proposals: IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n in_flight_commands: IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n sns_metadata: IDL.Opt(ManageSnsMetadata),\n neurons: IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n target_version: IDL.Opt(Version),\n genesis_timestamp_seconds: IDL.Nat64,\n });\n\n return [Governance];\n};\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.0.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({ IDL }) => {\n const PreciseValue = IDL.Rec();\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Version = IDL.Record({\n archive_wasm_hash: IDL.Vec(IDL.Nat8),\n root_wasm_hash: IDL.Vec(IDL.Nat8),\n swap_wasm_hash: IDL.Vec(IDL.Nat8),\n ledger_wasm_hash: IDL.Vec(IDL.Nat8),\n governance_wasm_hash: IDL.Vec(IDL.Nat8),\n index_wasm_hash: IDL.Vec(IDL.Nat8),\n });\n const Versions = IDL.Record({ versions: IDL.Vec(Version) });\n const CachedUpgradeSteps = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requested_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Topic = IDL.Variant({\n DappCanisterManagement: IDL.Null,\n DaoCommunitySettings: IDL.Null,\n ApplicationBusinessLogic: IDL.Null,\n CriticalDappOperations: IDL.Null,\n TreasuryAssetManagement: IDL.Null,\n Governance: IDL.Null,\n SnsFrameworkManagement: IDL.Null,\n });\n const GenericNervousSystemFunction = IDL.Record({\n topic: IDL.Opt(Topic),\n validator_canister_id: IDL.Opt(IDL.Principal),\n target_canister_id: IDL.Opt(IDL.Principal),\n validator_method_name: IDL.Opt(IDL.Text),\n target_method_name: IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n NativeNervousSystemFunction: IDL.Record({}),\n GenericNervousSystemFunction: GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n id: IDL.Nat64,\n name: IDL.Text,\n description: IDL.Opt(IDL.Text),\n function_type: IDL.Opt(FunctionType),\n });\n const Subaccount = IDL.Record({ subaccount: IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n owner: IDL.Opt(IDL.Principal),\n subaccount: IDL.Opt(Subaccount),\n });\n const TreasuryMetrics = IDL.Record({\n name: IDL.Opt(IDL.Text),\n original_amount_e8s: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n account: IDL.Opt(Account),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n treasury: IDL.Int32,\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const VotingPowerMetrics = IDL.Record({\n governance_total_potential_voting_power: IDL.Opt(IDL.Nat64),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GovernanceCachedMetrics = IDL.Record({\n treasury_metrics: IDL.Vec(TreasuryMetrics),\n not_dissolving_neurons_e8s_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64),\n ),\n garbage_collectable_neurons_count: IDL.Nat64,\n neurons_with_invalid_stake_count: IDL.Nat64,\n not_dissolving_neurons_count_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64),\n ),\n neurons_with_less_than_6_months_dissolve_delay_count: IDL.Nat64,\n dissolved_neurons_count: IDL.Nat64,\n total_staked_e8s: IDL.Nat64,\n total_supply_governance_tokens: IDL.Nat64,\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n not_dissolving_neurons_count: IDL.Nat64,\n dissolved_neurons_e8s: IDL.Nat64,\n neurons_with_less_than_6_months_dissolve_delay_e8s: IDL.Nat64,\n dissolving_neurons_count_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Nat64)),\n dissolving_neurons_count: IDL.Nat64,\n dissolving_neurons_e8s_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Float64)),\n timestamp_seconds: IDL.Nat64,\n });\n const MaturityModulation = IDL.Record({\n current_basis_points: IDL.Opt(IDL.Int32),\n updated_at_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const TargetVersionSet = IDL.Record({\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n is_advanced_automatically: IDL.Opt(IDL.Bool),\n });\n const UpgradeStepsReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n upgrade_steps: IDL.Opt(Versions),\n });\n const UpgradeOutcome = IDL.Record({\n status: IDL.Opt(\n IDL.Variant({\n Success: IDL.Record({}),\n Timeout: IDL.Record({}),\n ExternalFailure: IDL.Record({}),\n InvalidState: IDL.Record({ version: IDL.Opt(Version) }),\n }),\n ),\n human_readable: IDL.Opt(IDL.Text),\n });\n const ProposalId = IDL.Record({ id: IDL.Nat64 });\n const UpgradeStarted = IDL.Record({\n current_version: IDL.Opt(Version),\n expected_version: IDL.Opt(Version),\n reason: IDL.Opt(\n IDL.Variant({\n UpgradeSnsToNextVersionProposal: ProposalId,\n BehindTargetVersion: IDL.Record({}),\n }),\n ),\n });\n const UpgradeStepsRefreshed = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n });\n const TargetVersionReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n });\n const UpgradeJournalEntry = IDL.Record({\n event: IDL.Opt(\n IDL.Variant({\n TargetVersionSet: TargetVersionSet,\n UpgradeStepsReset: UpgradeStepsReset,\n UpgradeOutcome: UpgradeOutcome,\n UpgradeStarted: UpgradeStarted,\n UpgradeStepsRefreshed: UpgradeStepsRefreshed,\n TargetVersionReset: TargetVersionReset,\n }),\n ),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const UpgradeJournal = IDL.Record({\n entries: IDL.Vec(UpgradeJournalEntry),\n });\n const NeuronId = IDL.Record({ id: IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ followees: IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n permissions: IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n final_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n reward_rate_transition_duration_seconds: IDL.Opt(IDL.Nat64),\n round_duration_seconds: IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n default_followees: IDL.Opt(DefaultFollowees),\n max_dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n max_dissolve_delay_bonus_percentage: IDL.Opt(IDL.Nat64),\n max_followees_per_function: IDL.Opt(IDL.Nat64),\n automatically_advance_target_version: IDL.Opt(IDL.Bool),\n neuron_claimer_permissions: IDL.Opt(NeuronPermissionList),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n max_neuron_age_for_age_bonus: IDL.Opt(IDL.Nat64),\n initial_voting_period_seconds: IDL.Opt(IDL.Nat64),\n neuron_minimum_dissolve_delay_to_vote_seconds: IDL.Opt(IDL.Nat64),\n reject_cost_e8s: IDL.Opt(IDL.Nat64),\n max_proposals_to_keep_per_action: IDL.Opt(IDL.Nat32),\n wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64),\n max_number_of_neurons: IDL.Opt(IDL.Nat64),\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64),\n max_age_bonus_percentage: IDL.Opt(IDL.Nat64),\n neuron_grantable_permissions: IDL.Opt(NeuronPermissionList),\n voting_rewards_parameters: IDL.Opt(VotingRewardsParameters),\n maturity_modulation_disabled: IDL.Opt(IDL.Bool),\n max_number_of_principals_per_neuron: IDL.Opt(IDL.Nat64),\n });\n const RewardEvent = IDL.Record({\n rounds_since_last_distribution: IDL.Opt(IDL.Nat64),\n actual_timestamp_seconds: IDL.Nat64,\n end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n total_available_e8s_equivalent: IDL.Opt(IDL.Nat64),\n distributed_e8s_equivalent: IDL.Nat64,\n round: IDL.Nat64,\n settled_proposals: IDL.Vec(ProposalId),\n });\n const PendingVersion = IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Opt(IDL.Nat64),\n target_version: IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n error_message: IDL.Text,\n error_type: IDL.Int32,\n });\n const Decimal = IDL.Record({ human_readable: IDL.Opt(IDL.Text) });\n const Tokens = IDL.Record({ e8s: IDL.Opt(IDL.Nat64) });\n const ValuationFactors = IDL.Record({\n xdrs_per_icp: IDL.Opt(Decimal),\n icps_per_token: IDL.Opt(Decimal),\n tokens: IDL.Opt(Tokens),\n });\n const Valuation = IDL.Record({\n token: IDL.Opt(IDL.Int32),\n account: IDL.Opt(Account),\n valuation_factors: IDL.Opt(ValuationFactors),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const MintSnsTokensActionAuxiliary = IDL.Record({\n valuation: IDL.Opt(Valuation),\n });\n const SnsVersion = IDL.Record({\n archive_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n root_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n swap_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n ledger_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n governance_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n index_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const AdvanceSnsTargetVersionActionAuxiliary = IDL.Record({\n target_version: IDL.Opt(SnsVersion),\n });\n const ActionAuxiliary = IDL.Variant({\n TransferSnsTreasuryFunds: MintSnsTokensActionAuxiliary,\n MintSnsTokens: MintSnsTokensActionAuxiliary,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersionActionAuxiliary,\n });\n const Ballot = IDL.Record({\n vote: IDL.Int32,\n cast_timestamp_seconds: IDL.Nat64,\n voting_power: IDL.Nat64,\n });\n const Percentage = IDL.Record({ basis_points: IDL.Opt(IDL.Nat64) });\n const Tally = IDL.Record({\n no: IDL.Nat64,\n yes: IDL.Nat64,\n total: IDL.Nat64,\n timestamp_seconds: IDL.Nat64,\n });\n const ManageDappCanisterSettings = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat64),\n wasm_memory_threshold: IDL.Opt(IDL.Nat64),\n canister_ids: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat64),\n log_visibility: IDL.Opt(IDL.Int32),\n wasm_memory_limit: IDL.Opt(IDL.Nat64),\n memory_allocation: IDL.Opt(IDL.Nat64),\n compute_allocation: IDL.Opt(IDL.Nat64),\n });\n PreciseValue.fill(\n IDL.Variant({\n Int: IDL.Int64,\n Map: IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),\n Nat: IDL.Nat64,\n Blob: IDL.Vec(IDL.Nat8),\n Bool: IDL.Bool,\n Text: IDL.Text,\n Array: IDL.Vec(PreciseValue),\n }),\n );\n const ExtensionOperationArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const ExecuteExtensionOperation = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n operation_name: IDL.Opt(IDL.Text),\n operation_arg: IDL.Opt(ExtensionOperationArg),\n });\n const ChunkedCanisterWasm = IDL.Record({\n wasm_module_hash: IDL.Vec(IDL.Nat8),\n chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),\n store_canister_id: IDL.Opt(IDL.Principal),\n });\n const Wasm = IDL.Variant({\n Chunked: ChunkedCanisterWasm,\n Bytes: IDL.Vec(IDL.Nat8),\n });\n const ExtensionUpgradeArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const UpgradeExtension = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n wasm: IDL.Opt(Wasm),\n canister_upgrade_arg: IDL.Opt(ExtensionUpgradeArg),\n });\n const SetTopicsForCustomProposals = IDL.Record({\n custom_function_id_to_topic: IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),\n });\n const ExtensionInit = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const RegisterExtension = IDL.Record({\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n extension_init: IDL.Opt(ExtensionInit),\n });\n const RegisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n });\n const TransferSnsTreasuryFunds = IDL.Record({\n from_treasury: IDL.Int32,\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n new_canister_wasm: IDL.Vec(IDL.Nat8),\n mode: IDL.Opt(IDL.Int32),\n canister_id: IDL.Opt(IDL.Principal),\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n canister_upgrade_arg: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const DeregisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n new_controllers: IDL.Vec(IDL.Principal),\n });\n const MintSnsTokens = IDL.Record({\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const AdvanceSnsTargetVersion = IDL.Record({\n new_target: IDL.Opt(SnsVersion),\n });\n const ManageSnsMetadata = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n function_id: IDL.Nat64,\n payload: IDL.Vec(IDL.Nat8),\n });\n const ManageLedgerParameters = IDL.Record({\n token_symbol: IDL.Opt(IDL.Text),\n transfer_fee: IDL.Opt(IDL.Nat64),\n token_logo: IDL.Opt(IDL.Text),\n token_name: IDL.Opt(IDL.Text),\n });\n const Motion = IDL.Record({ motion_text: IDL.Text });\n const Action = IDL.Variant({\n ManageNervousSystemParameters: NervousSystemParameters,\n AddGenericNervousSystemFunction: NervousSystemFunction,\n ManageDappCanisterSettings: ManageDappCanisterSettings,\n ExecuteExtensionOperation: ExecuteExtensionOperation,\n UpgradeExtension: UpgradeExtension,\n RemoveGenericNervousSystemFunction: IDL.Nat64,\n SetTopicsForCustomProposals: SetTopicsForCustomProposals,\n RegisterExtension: RegisterExtension,\n UpgradeSnsToNextVersion: IDL.Record({}),\n RegisterDappCanisters: RegisterDappCanisters,\n TransferSnsTreasuryFunds: TransferSnsTreasuryFunds,\n UpgradeSnsControlledCanister: UpgradeSnsControlledCanister,\n DeregisterDappCanisters: DeregisterDappCanisters,\n MintSnsTokens: MintSnsTokens,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersion,\n Unspecified: IDL.Record({}),\n ManageSnsMetadata: ManageSnsMetadata,\n ExecuteGenericNervousSystemFunction: ExecuteGenericNervousSystemFunction,\n ManageLedgerParameters: ManageLedgerParameters,\n Motion: Motion,\n });\n const Proposal = IDL.Record({\n url: IDL.Text,\n title: IDL.Text,\n action: IDL.Opt(Action),\n summary: IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n current_deadline_timestamp_seconds: IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n id: IDL.Opt(ProposalId),\n payload_text_rendering: IDL.Opt(IDL.Text),\n topic: IDL.Opt(Topic),\n action: IDL.Nat64,\n failure_reason: IDL.Opt(GovernanceError),\n action_auxiliary: IDL.Opt(ActionAuxiliary),\n ballots: IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n minimum_yes_proportion_of_total: IDL.Opt(Percentage),\n reward_event_round: IDL.Nat64,\n failed_timestamp_seconds: IDL.Nat64,\n reward_event_end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n proposal_creation_timestamp_seconds: IDL.Nat64,\n initial_voting_period_seconds: IDL.Nat64,\n reject_cost_e8s: IDL.Nat64,\n latest_tally: IDL.Opt(Tally),\n wait_for_quiet_deadline_increase_seconds: IDL.Nat64,\n decided_timestamp_seconds: IDL.Nat64,\n proposal: IDL.Opt(Proposal),\n proposer: IDL.Opt(NeuronId),\n wait_for_quiet_state: IDL.Opt(WaitForQuietState),\n minimum_yes_proportion_of_exercised: IDL.Opt(Percentage),\n is_eligible_for_rewards: IDL.Bool,\n executed_timestamp_seconds: IDL.Nat64,\n });\n const Split = IDL.Record({ memo: IDL.Nat64, amount_e8s: IDL.Nat64 });\n const Follow = IDL.Record({\n function_id: IDL.Nat64,\n followees: IDL.Vec(NeuronId),\n });\n const DisburseMaturity = IDL.Record({\n to_account: IDL.Opt(Account),\n percentage_to_disburse: IDL.Nat32,\n });\n const ChangeAutoStakeMaturity = IDL.Record({\n requested_setting_for_auto_stake_maturity: IDL.Bool,\n });\n const IncreaseDissolveDelay = IDL.Record({\n additional_dissolve_delay_seconds: IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n dissolve_timestamp_seconds: IDL.Nat64,\n });\n const Operation = IDL.Variant({\n ChangeAutoStakeMaturity: ChangeAutoStakeMaturity,\n StopDissolving: IDL.Record({}),\n StartDissolving: IDL.Record({}),\n IncreaseDissolveDelay: IncreaseDissolveDelay,\n SetDissolveTimestamp: SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ operation: IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n vote: IDL.Int32,\n proposal: IDL.Opt(ProposalId),\n });\n const Followee = IDL.Record({\n alias: IDL.Opt(IDL.Text),\n neuron_id: IDL.Opt(NeuronId),\n });\n const FolloweesForTopic = IDL.Record({\n topic: IDL.Opt(Topic),\n followees: IDL.Vec(Followee),\n });\n const SetFollowing = IDL.Record({\n topic_following: IDL.Vec(FolloweesForTopic),\n });\n const FinalizeDisburseMaturity = IDL.Record({\n amount_to_be_disbursed_e8s: IDL.Nat64,\n to_account: IDL.Opt(Account),\n });\n const MemoAndController = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n memo: IDL.Nat64,\n });\n const By = IDL.Variant({\n MemoAndController: MemoAndController,\n NeuronId: IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ by: IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n permissions_to_remove: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n permissions_to_add: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ percentage_to_merge: IDL.Nat32 });\n const Amount = IDL.Record({ e8s: IDL.Nat64 });\n const Disburse = IDL.Record({\n to_account: IDL.Opt(Account),\n amount: IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n SyncCommand: IDL.Record({}),\n MakeProposal: Proposal,\n FinalizeDisburseMaturity: FinalizeDisburseMaturity,\n ClaimOrRefreshNeuron: ClaimOrRefresh,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n command: IDL.Opt(Command_2),\n timestamp: IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n principal: IDL.Opt(IDL.Principal),\n permission_type: IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n DissolveDelaySeconds: IDL.Nat64,\n WhenDissolvedTimestampSeconds: IDL.Nat64,\n });\n const DisburseMaturityInProgress = IDL.Record({\n timestamp_of_disbursement_seconds: IDL.Nat64,\n amount_e8s: IDL.Nat64,\n account_to_disburse_to: IDL.Opt(Account),\n finalize_disbursement_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Neuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n staked_maturity_e8s_equivalent: IDL.Opt(IDL.Nat64),\n permissions: IDL.Vec(NeuronPermission),\n maturity_e8s_equivalent: IDL.Nat64,\n cached_neuron_stake_e8s: IDL.Nat64,\n created_timestamp_seconds: IDL.Nat64,\n topic_followees: IDL.Opt(\n IDL.Record({\n topic_id_to_followees: IDL.Vec(IDL.Tuple(IDL.Int32, FolloweesForTopic)),\n }),\n ),\n source_nns_neuron_id: IDL.Opt(IDL.Nat64),\n auto_stake_maturity: IDL.Opt(IDL.Bool),\n aging_since_timestamp_seconds: IDL.Nat64,\n dissolve_state: IDL.Opt(DissolveState),\n voting_power_percentage_multiplier: IDL.Nat64,\n vesting_period_seconds: IDL.Opt(IDL.Nat64),\n disburse_maturity_in_progress: IDL.Vec(DisburseMaturityInProgress),\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n neuron_fees_e8s: IDL.Nat64,\n });\n const Governance = IDL.Record({\n root_canister_id: IDL.Opt(IDL.Principal),\n timers: IDL.Opt(Timers),\n cached_upgrade_steps: IDL.Opt(CachedUpgradeSteps),\n id_to_nervous_system_functions: IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction),\n ),\n metrics: IDL.Opt(GovernanceCachedMetrics),\n maturity_modulation: IDL.Opt(MaturityModulation),\n upgrade_journal: IDL.Opt(UpgradeJournal),\n mode: IDL.Int32,\n parameters: IDL.Opt(NervousSystemParameters),\n is_finalizing_disburse_maturity: IDL.Opt(IDL.Bool),\n deployed_version: IDL.Opt(Version),\n sns_initialization_parameters: IDL.Text,\n latest_reward_event: IDL.Opt(RewardEvent),\n pending_version: IDL.Opt(PendingVersion),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n proposals: IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n in_flight_commands: IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n sns_metadata: IDL.Opt(ManageSnsMetadata),\n neurons: IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n target_version: IDL.Opt(Version),\n genesis_timestamp_seconds: IDL.Nat64,\n });\n const AddMaturityRequest = IDL.Record({\n id: IDL.Opt(NeuronId),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const AddMaturityResponse = IDL.Record({\n new_maturity_e8s: IDL.Opt(IDL.Nat64),\n });\n const AdvanceTargetVersionRequest = IDL.Record({\n target_version: IDL.Opt(Version),\n });\n const AdvanceTargetVersionResponse = IDL.Record({});\n const Principals = IDL.Record({ principals: IDL.Vec(IDL.Principal) });\n const NeuronsFund = IDL.Record({\n nns_neuron_hotkeys: IDL.Opt(Principals),\n nns_neuron_controller: IDL.Opt(IDL.Principal),\n nns_neuron_id: IDL.Opt(IDL.Nat64),\n });\n const Participant = IDL.Variant({\n NeuronsFund: NeuronsFund,\n Direct: IDL.Record({}),\n });\n const NeuronIds = IDL.Record({ neuron_ids: IDL.Vec(NeuronId) });\n const NeuronRecipe = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n participant: IDL.Opt(Participant),\n stake_e8s: IDL.Opt(IDL.Nat64),\n followees: IDL.Opt(NeuronIds),\n neuron_id: IDL.Opt(NeuronId),\n });\n const NeuronRecipes = IDL.Record({\n neuron_recipes: IDL.Vec(NeuronRecipe),\n });\n const ClaimSwapNeuronsRequest = IDL.Record({\n neuron_recipes: IDL.Opt(NeuronRecipes),\n });\n const SwapNeuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n status: IDL.Int32,\n });\n const ClaimedSwapNeurons = IDL.Record({\n swap_neurons: IDL.Vec(SwapNeuron),\n });\n const ClaimSwapNeuronsResult = IDL.Variant({\n Ok: ClaimedSwapNeurons,\n Err: IDL.Int32,\n });\n const ClaimSwapNeuronsResponse = IDL.Record({\n claim_swap_neurons_result: IDL.Opt(ClaimSwapNeuronsResult),\n });\n const GetMaturityModulationResponse = IDL.Record({\n maturity_modulation: IDL.Opt(MaturityModulation),\n });\n const GetMetadataResponse = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const GetMetricsRequest = IDL.Record({\n time_window_seconds: IDL.Opt(IDL.Nat64),\n });\n const Metrics = IDL.Record({\n treasury_metrics: IDL.Opt(IDL.Vec(TreasuryMetrics)),\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n last_ledger_block_timestamp: IDL.Opt(IDL.Nat64),\n num_recently_executed_proposals: IDL.Opt(IDL.Nat64),\n num_recently_submitted_proposals: IDL.Opt(IDL.Nat64),\n genesis_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GetMetricsResult = IDL.Variant({\n Ok: Metrics,\n Err: GovernanceError,\n });\n const GetMetricsResponse = IDL.Record({\n get_metrics_result: IDL.Opt(GetMetricsResult),\n });\n const GetModeResponse = IDL.Record({ mode: IDL.Opt(IDL.Int32) });\n const GetNeuron = IDL.Record({ neuron_id: IDL.Opt(NeuronId) });\n const Result = IDL.Variant({ Error: GovernanceError, Neuron: Neuron });\n const GetNeuronResponse = IDL.Record({ result: IDL.Opt(Result) });\n const GetProposal = IDL.Record({ proposal_id: IDL.Opt(ProposalId) });\n const Result_1 = IDL.Variant({\n Error: GovernanceError,\n Proposal: ProposalData,\n });\n const GetProposalResponse = IDL.Record({ result: IDL.Opt(Result_1) });\n const MemoryMetrics = IDL.Record({\n wasm_binary_size: IDL.Opt(IDL.Nat),\n wasm_chunk_store_size: IDL.Opt(IDL.Nat),\n canister_history_size: IDL.Opt(IDL.Nat),\n stable_memory_size: IDL.Opt(IDL.Nat),\n snapshots_size: IDL.Opt(IDL.Nat),\n wasm_memory_size: IDL.Opt(IDL.Nat),\n global_memory_size: IDL.Opt(IDL.Nat),\n custom_sections_size: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusType = IDL.Variant({\n stopped: IDL.Null,\n stopping: IDL.Null,\n running: IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n freezing_threshold: IDL.Nat,\n wasm_memory_threshold: IDL.Opt(IDL.Nat),\n controllers: IDL.Vec(IDL.Principal),\n wasm_memory_limit: IDL.Opt(IDL.Nat),\n memory_allocation: IDL.Nat,\n compute_allocation: IDL.Nat,\n });\n const QueryStats = IDL.Record({\n response_payload_bytes_total: IDL.Opt(IDL.Nat),\n num_instructions_total: IDL.Opt(IDL.Nat),\n num_calls_total: IDL.Opt(IDL.Nat),\n request_payload_bytes_total: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusResultV2 = IDL.Record({\n memory_metrics: IDL.Opt(MemoryMetrics),\n status: CanisterStatusType,\n memory_size: IDL.Nat,\n cycles: IDL.Nat,\n settings: DefiniteCanisterSettingsArgs,\n query_stats: IDL.Opt(QueryStats),\n idle_cycles_burned_per_day: IDL.Nat,\n module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetRunningSnsVersionResponse = IDL.Record({\n deployed_version: IDL.Opt(Version),\n pending_version: IDL.Opt(\n IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Nat64,\n target_version: IDL.Opt(Version),\n }),\n ),\n });\n const GetSnsInitializationParametersResponse = IDL.Record({\n sns_initialization_parameters: IDL.Text,\n });\n const GetTimersResponse = IDL.Record({ timers: IDL.Opt(Timers) });\n const GetUpgradeJournalRequest = IDL.Record({\n offset: IDL.Opt(IDL.Nat64),\n limit: IDL.Opt(IDL.Nat64),\n });\n const GetUpgradeJournalResponse = IDL.Record({\n upgrade_journal: IDL.Opt(UpgradeJournal),\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n deployed_version: IDL.Opt(Version),\n target_version: IDL.Opt(Version),\n upgrade_journal_entry_count: IDL.Opt(IDL.Nat64),\n });\n const ListNervousSystemFunctionsResponse = IDL.Record({\n reserved_ids: IDL.Vec(IDL.Nat64),\n functions: IDL.Vec(NervousSystemFunction),\n });\n const ListNeurons = IDL.Record({\n of_principal: IDL.Opt(IDL.Principal),\n limit: IDL.Nat32,\n start_page_at: IDL.Opt(NeuronId),\n });\n const ListNeuronsResponse = IDL.Record({ neurons: IDL.Vec(Neuron) });\n const TopicSelector = IDL.Record({ topic: IDL.Opt(Topic) });\n const ListProposals = IDL.Record({\n include_reward_status: IDL.Vec(IDL.Int32),\n before_proposal: IDL.Opt(ProposalId),\n limit: IDL.Nat32,\n exclude_type: IDL.Vec(IDL.Nat64),\n include_topics: IDL.Opt(IDL.Vec(TopicSelector)),\n include_status: IDL.Vec(IDL.Int32),\n });\n const ListProposalsResponse = IDL.Record({\n include_ballots_by_caller: IDL.Opt(IDL.Bool),\n proposals: IDL.Vec(ProposalData),\n include_topic_filtering: IDL.Opt(IDL.Bool),\n });\n const ListTopicsRequest = IDL.Record({});\n const ExtensionOperationType = IDL.Variant({\n TreasuryManagerWithdraw: IDL.Null,\n TreasuryManagerDeposit: IDL.Null,\n });\n const ExtensionType = IDL.Variant({ TreasuryManager: IDL.Null });\n const ExtensionOperationSpec = IDL.Record({\n topic: IDL.Opt(Topic),\n operation_type: IDL.Opt(ExtensionOperationType),\n description: IDL.Opt(IDL.Text),\n extension_type: IDL.Opt(ExtensionType),\n });\n const RegisteredExtensionOperationSpec = IDL.Record({\n spec: IDL.Opt(ExtensionOperationSpec),\n canister_id: IDL.Opt(IDL.Principal),\n });\n const TopicInfo = IDL.Record({\n extension_operations: IDL.Opt(IDL.Vec(RegisteredExtensionOperationSpec)),\n native_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n topic: IDL.Opt(Topic),\n is_critical: IDL.Opt(IDL.Bool),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n custom_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n });\n const ListTopicsResponse = IDL.Record({\n uncategorized_functions: IDL.Opt(IDL.Vec(NervousSystemFunction)),\n topics: IDL.Opt(IDL.Vec(TopicInfo)),\n });\n const StakeMaturity = IDL.Record({\n percentage_to_stake: IDL.Opt(IDL.Nat32),\n });\n const Command = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n ClaimOrRefresh: ClaimOrRefresh,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n MakeProposal: Proposal,\n StakeMaturity: StakeMaturity,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const ManageNeuron = IDL.Record({\n subaccount: IDL.Vec(IDL.Nat8),\n command: IDL.Opt(Command),\n });\n const SplitResponse = IDL.Record({ created_neuron_id: IDL.Opt(NeuronId) });\n const DisburseMaturityResponse = IDL.Record({\n amount_disbursed_e8s: IDL.Nat64,\n amount_deducted_e8s: IDL.Opt(IDL.Nat64),\n });\n const ClaimOrRefreshResponse = IDL.Record({\n refreshed_neuron_id: IDL.Opt(NeuronId),\n });\n const StakeMaturityResponse = IDL.Record({\n maturity_e8s: IDL.Nat64,\n staked_maturity_e8s: IDL.Nat64,\n });\n const MergeMaturityResponse = IDL.Record({\n merged_maturity_e8s: IDL.Nat64,\n new_stake_e8s: IDL.Nat64,\n });\n const DisburseResponse = IDL.Record({ transfer_block_height: IDL.Nat64 });\n const Command_1 = IDL.Variant({\n Error: GovernanceError,\n Split: SplitResponse,\n Follow: IDL.Record({}),\n DisburseMaturity: DisburseMaturityResponse,\n ClaimOrRefresh: ClaimOrRefreshResponse,\n Configure: IDL.Record({}),\n RegisterVote: IDL.Record({}),\n SetFollowing: IDL.Record({}),\n MakeProposal: GetProposal,\n RemoveNeuronPermission: IDL.Record({}),\n StakeMaturity: StakeMaturityResponse,\n MergeMaturity: MergeMaturityResponse,\n Disburse: DisburseResponse,\n AddNeuronPermission: IDL.Record({}),\n });\n const ManageNeuronResponse = IDL.Record({ command: IDL.Opt(Command_1) });\n const MintTokensRequest = IDL.Record({\n recipient: IDL.Opt(Account),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const SetMode = IDL.Record({ mode: IDL.Int32 });\n\n return IDL.Service({\n add_maturity: IDL.Func([AddMaturityRequest], [AddMaturityResponse], []),\n advance_target_version: IDL.Func(\n [AdvanceTargetVersionRequest],\n [AdvanceTargetVersionResponse],\n [],\n ),\n claim_swap_neurons: IDL.Func(\n [ClaimSwapNeuronsRequest],\n [ClaimSwapNeuronsResponse],\n [],\n ),\n fail_stuck_upgrade_in_progress: IDL.Func(\n [IDL.Record({})],\n [IDL.Record({})],\n [],\n ),\n get_build_metadata: IDL.Func([], [IDL.Text], [\"query\"]),\n get_latest_reward_event: IDL.Func([], [RewardEvent], [\"query\"]),\n get_maturity_modulation: IDL.Func(\n [IDL.Record({})],\n [GetMaturityModulationResponse],\n [],\n ),\n get_metadata: IDL.Func([IDL.Record({})], [GetMetadataResponse], [\"query\"]),\n get_metrics: IDL.Func(\n [GetMetricsRequest],\n [GetMetricsResponse],\n [\"composite_query\"],\n ),\n get_metrics_replicated: IDL.Func(\n [GetMetricsRequest],\n [GetMetricsResponse],\n [],\n ),\n get_mode: IDL.Func([IDL.Record({})], [GetModeResponse], [\"query\"]),\n get_nervous_system_parameters: IDL.Func(\n [IDL.Null],\n [NervousSystemParameters],\n [\"query\"],\n ),\n get_neuron: IDL.Func([GetNeuron], [GetNeuronResponse], [\"query\"]),\n get_proposal: IDL.Func([GetProposal], [GetProposalResponse], [\"query\"]),\n get_root_canister_status: IDL.Func(\n [IDL.Null],\n [CanisterStatusResultV2],\n [],\n ),\n get_running_sns_version: IDL.Func(\n [IDL.Record({})],\n [GetRunningSnsVersionResponse],\n [\"query\"],\n ),\n get_sns_initialization_parameters: IDL.Func(\n [IDL.Record({})],\n [GetSnsInitializationParametersResponse],\n [\"query\"],\n ),\n get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], [\"query\"]),\n get_upgrade_journal: IDL.Func(\n [GetUpgradeJournalRequest],\n [GetUpgradeJournalResponse],\n [\"query\"],\n ),\n list_nervous_system_functions: IDL.Func(\n [],\n [ListNervousSystemFunctionsResponse],\n [\"query\"],\n ),\n list_neurons: IDL.Func([ListNeurons], [ListNeuronsResponse], [\"query\"]),\n list_proposals: IDL.Func(\n [ListProposals],\n [ListProposalsResponse],\n [\"query\"],\n ),\n list_topics: IDL.Func([ListTopicsRequest], [ListTopicsResponse], [\"query\"]),\n manage_neuron: IDL.Func([ManageNeuron], [ManageNeuronResponse], []),\n mint_tokens: IDL.Func([MintTokensRequest], [IDL.Record({})], []),\n refresh_cached_upgrade_steps: IDL.Func(\n [IDL.Record({})],\n [IDL.Record({})],\n [],\n ),\n reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], []),\n set_mode: IDL.Func([SetMode], [IDL.Record({})], []),\n update_neuron: IDL.Func([Neuron], [IDL.Opt(GovernanceError)], []),\n });\n};\n\nexport const init = ({ IDL }) => {\n const PreciseValue = IDL.Rec();\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Version = IDL.Record({\n archive_wasm_hash: IDL.Vec(IDL.Nat8),\n root_wasm_hash: IDL.Vec(IDL.Nat8),\n swap_wasm_hash: IDL.Vec(IDL.Nat8),\n ledger_wasm_hash: IDL.Vec(IDL.Nat8),\n governance_wasm_hash: IDL.Vec(IDL.Nat8),\n index_wasm_hash: IDL.Vec(IDL.Nat8),\n });\n const Versions = IDL.Record({ versions: IDL.Vec(Version) });\n const CachedUpgradeSteps = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n response_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requested_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Topic = IDL.Variant({\n DappCanisterManagement: IDL.Null,\n DaoCommunitySettings: IDL.Null,\n ApplicationBusinessLogic: IDL.Null,\n CriticalDappOperations: IDL.Null,\n TreasuryAssetManagement: IDL.Null,\n Governance: IDL.Null,\n SnsFrameworkManagement: IDL.Null,\n });\n const GenericNervousSystemFunction = IDL.Record({\n topic: IDL.Opt(Topic),\n validator_canister_id: IDL.Opt(IDL.Principal),\n target_canister_id: IDL.Opt(IDL.Principal),\n validator_method_name: IDL.Opt(IDL.Text),\n target_method_name: IDL.Opt(IDL.Text),\n });\n const FunctionType = IDL.Variant({\n NativeNervousSystemFunction: IDL.Record({}),\n GenericNervousSystemFunction: GenericNervousSystemFunction,\n });\n const NervousSystemFunction = IDL.Record({\n id: IDL.Nat64,\n name: IDL.Text,\n description: IDL.Opt(IDL.Text),\n function_type: IDL.Opt(FunctionType),\n });\n const Subaccount = IDL.Record({ subaccount: IDL.Vec(IDL.Nat8) });\n const Account = IDL.Record({\n owner: IDL.Opt(IDL.Principal),\n subaccount: IDL.Opt(Subaccount),\n });\n const TreasuryMetrics = IDL.Record({\n name: IDL.Opt(IDL.Text),\n original_amount_e8s: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n account: IDL.Opt(Account),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n treasury: IDL.Int32,\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const VotingPowerMetrics = IDL.Record({\n governance_total_potential_voting_power: IDL.Opt(IDL.Nat64),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const GovernanceCachedMetrics = IDL.Record({\n treasury_metrics: IDL.Vec(TreasuryMetrics),\n not_dissolving_neurons_e8s_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Float64),\n ),\n garbage_collectable_neurons_count: IDL.Nat64,\n neurons_with_invalid_stake_count: IDL.Nat64,\n not_dissolving_neurons_count_buckets: IDL.Vec(\n IDL.Tuple(IDL.Nat64, IDL.Nat64),\n ),\n neurons_with_less_than_6_months_dissolve_delay_count: IDL.Nat64,\n dissolved_neurons_count: IDL.Nat64,\n total_staked_e8s: IDL.Nat64,\n total_supply_governance_tokens: IDL.Nat64,\n voting_power_metrics: IDL.Opt(VotingPowerMetrics),\n not_dissolving_neurons_count: IDL.Nat64,\n dissolved_neurons_e8s: IDL.Nat64,\n neurons_with_less_than_6_months_dissolve_delay_e8s: IDL.Nat64,\n dissolving_neurons_count_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Nat64)),\n dissolving_neurons_count: IDL.Nat64,\n dissolving_neurons_e8s_buckets: IDL.Vec(IDL.Tuple(IDL.Nat64, IDL.Float64)),\n timestamp_seconds: IDL.Nat64,\n });\n const MaturityModulation = IDL.Record({\n current_basis_points: IDL.Opt(IDL.Int32),\n updated_at_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const TargetVersionSet = IDL.Record({\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n is_advanced_automatically: IDL.Opt(IDL.Bool),\n });\n const UpgradeStepsReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n upgrade_steps: IDL.Opt(Versions),\n });\n const UpgradeOutcome = IDL.Record({\n status: IDL.Opt(\n IDL.Variant({\n Success: IDL.Record({}),\n Timeout: IDL.Record({}),\n ExternalFailure: IDL.Record({}),\n InvalidState: IDL.Record({ version: IDL.Opt(Version) }),\n }),\n ),\n human_readable: IDL.Opt(IDL.Text),\n });\n const ProposalId = IDL.Record({ id: IDL.Nat64 });\n const UpgradeStarted = IDL.Record({\n current_version: IDL.Opt(Version),\n expected_version: IDL.Opt(Version),\n reason: IDL.Opt(\n IDL.Variant({\n UpgradeSnsToNextVersionProposal: ProposalId,\n BehindTargetVersion: IDL.Record({}),\n }),\n ),\n });\n const UpgradeStepsRefreshed = IDL.Record({\n upgrade_steps: IDL.Opt(Versions),\n });\n const TargetVersionReset = IDL.Record({\n human_readable: IDL.Opt(IDL.Text),\n old_target_version: IDL.Opt(Version),\n new_target_version: IDL.Opt(Version),\n });\n const UpgradeJournalEntry = IDL.Record({\n event: IDL.Opt(\n IDL.Variant({\n TargetVersionSet: TargetVersionSet,\n UpgradeStepsReset: UpgradeStepsReset,\n UpgradeOutcome: UpgradeOutcome,\n UpgradeStarted: UpgradeStarted,\n UpgradeStepsRefreshed: UpgradeStepsRefreshed,\n TargetVersionReset: TargetVersionReset,\n }),\n ),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const UpgradeJournal = IDL.Record({\n entries: IDL.Vec(UpgradeJournalEntry),\n });\n const NeuronId = IDL.Record({ id: IDL.Vec(IDL.Nat8) });\n const Followees = IDL.Record({ followees: IDL.Vec(NeuronId) });\n const DefaultFollowees = IDL.Record({\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n });\n const NeuronPermissionList = IDL.Record({\n permissions: IDL.Vec(IDL.Int32),\n });\n const VotingRewardsParameters = IDL.Record({\n final_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64),\n reward_rate_transition_duration_seconds: IDL.Opt(IDL.Nat64),\n round_duration_seconds: IDL.Opt(IDL.Nat64),\n });\n const NervousSystemParameters = IDL.Record({\n default_followees: IDL.Opt(DefaultFollowees),\n max_dissolve_delay_seconds: IDL.Opt(IDL.Nat64),\n max_dissolve_delay_bonus_percentage: IDL.Opt(IDL.Nat64),\n max_followees_per_function: IDL.Opt(IDL.Nat64),\n automatically_advance_target_version: IDL.Opt(IDL.Bool),\n neuron_claimer_permissions: IDL.Opt(NeuronPermissionList),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n max_neuron_age_for_age_bonus: IDL.Opt(IDL.Nat64),\n initial_voting_period_seconds: IDL.Opt(IDL.Nat64),\n neuron_minimum_dissolve_delay_to_vote_seconds: IDL.Opt(IDL.Nat64),\n reject_cost_e8s: IDL.Opt(IDL.Nat64),\n max_proposals_to_keep_per_action: IDL.Opt(IDL.Nat32),\n wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64),\n max_number_of_neurons: IDL.Opt(IDL.Nat64),\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64),\n max_age_bonus_percentage: IDL.Opt(IDL.Nat64),\n neuron_grantable_permissions: IDL.Opt(NeuronPermissionList),\n voting_rewards_parameters: IDL.Opt(VotingRewardsParameters),\n maturity_modulation_disabled: IDL.Opt(IDL.Bool),\n max_number_of_principals_per_neuron: IDL.Opt(IDL.Nat64),\n });\n const RewardEvent = IDL.Record({\n rounds_since_last_distribution: IDL.Opt(IDL.Nat64),\n actual_timestamp_seconds: IDL.Nat64,\n end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n total_available_e8s_equivalent: IDL.Opt(IDL.Nat64),\n distributed_e8s_equivalent: IDL.Nat64,\n round: IDL.Nat64,\n settled_proposals: IDL.Vec(ProposalId),\n });\n const PendingVersion = IDL.Record({\n mark_failed_at_seconds: IDL.Nat64,\n checking_upgrade_lock: IDL.Nat64,\n proposal_id: IDL.Opt(IDL.Nat64),\n target_version: IDL.Opt(Version),\n });\n const GovernanceError = IDL.Record({\n error_message: IDL.Text,\n error_type: IDL.Int32,\n });\n const Decimal = IDL.Record({ human_readable: IDL.Opt(IDL.Text) });\n const Tokens = IDL.Record({ e8s: IDL.Opt(IDL.Nat64) });\n const ValuationFactors = IDL.Record({\n xdrs_per_icp: IDL.Opt(Decimal),\n icps_per_token: IDL.Opt(Decimal),\n tokens: IDL.Opt(Tokens),\n });\n const Valuation = IDL.Record({\n token: IDL.Opt(IDL.Int32),\n account: IDL.Opt(Account),\n valuation_factors: IDL.Opt(ValuationFactors),\n timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const MintSnsTokensActionAuxiliary = IDL.Record({\n valuation: IDL.Opt(Valuation),\n });\n const SnsVersion = IDL.Record({\n archive_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n root_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n swap_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n ledger_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n governance_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n index_wasm_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const AdvanceSnsTargetVersionActionAuxiliary = IDL.Record({\n target_version: IDL.Opt(SnsVersion),\n });\n const ActionAuxiliary = IDL.Variant({\n TransferSnsTreasuryFunds: MintSnsTokensActionAuxiliary,\n MintSnsTokens: MintSnsTokensActionAuxiliary,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersionActionAuxiliary,\n });\n const Ballot = IDL.Record({\n vote: IDL.Int32,\n cast_timestamp_seconds: IDL.Nat64,\n voting_power: IDL.Nat64,\n });\n const Percentage = IDL.Record({ basis_points: IDL.Opt(IDL.Nat64) });\n const Tally = IDL.Record({\n no: IDL.Nat64,\n yes: IDL.Nat64,\n total: IDL.Nat64,\n timestamp_seconds: IDL.Nat64,\n });\n const ManageDappCanisterSettings = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat64),\n wasm_memory_threshold: IDL.Opt(IDL.Nat64),\n canister_ids: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat64),\n log_visibility: IDL.Opt(IDL.Int32),\n wasm_memory_limit: IDL.Opt(IDL.Nat64),\n memory_allocation: IDL.Opt(IDL.Nat64),\n compute_allocation: IDL.Opt(IDL.Nat64),\n });\n PreciseValue.fill(\n IDL.Variant({\n Int: IDL.Int64,\n Map: IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),\n Nat: IDL.Nat64,\n Blob: IDL.Vec(IDL.Nat8),\n Bool: IDL.Bool,\n Text: IDL.Text,\n Array: IDL.Vec(PreciseValue),\n }),\n );\n const ExtensionOperationArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const ExecuteExtensionOperation = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n operation_name: IDL.Opt(IDL.Text),\n operation_arg: IDL.Opt(ExtensionOperationArg),\n });\n const ChunkedCanisterWasm = IDL.Record({\n wasm_module_hash: IDL.Vec(IDL.Nat8),\n chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),\n store_canister_id: IDL.Opt(IDL.Principal),\n });\n const Wasm = IDL.Variant({\n Chunked: ChunkedCanisterWasm,\n Bytes: IDL.Vec(IDL.Nat8),\n });\n const ExtensionUpgradeArg = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const UpgradeExtension = IDL.Record({\n extension_canister_id: IDL.Opt(IDL.Principal),\n wasm: IDL.Opt(Wasm),\n canister_upgrade_arg: IDL.Opt(ExtensionUpgradeArg),\n });\n const SetTopicsForCustomProposals = IDL.Record({\n custom_function_id_to_topic: IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),\n });\n const ExtensionInit = IDL.Record({ value: IDL.Opt(PreciseValue) });\n const RegisterExtension = IDL.Record({\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n extension_init: IDL.Opt(ExtensionInit),\n });\n const RegisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n });\n const TransferSnsTreasuryFunds = IDL.Record({\n from_treasury: IDL.Int32,\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Nat64,\n });\n const UpgradeSnsControlledCanister = IDL.Record({\n new_canister_wasm: IDL.Vec(IDL.Nat8),\n mode: IDL.Opt(IDL.Int32),\n canister_id: IDL.Opt(IDL.Principal),\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n canister_upgrade_arg: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const DeregisterDappCanisters = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n new_controllers: IDL.Vec(IDL.Principal),\n });\n const MintSnsTokens = IDL.Record({\n to_principal: IDL.Opt(IDL.Principal),\n to_subaccount: IDL.Opt(Subaccount),\n memo: IDL.Opt(IDL.Nat64),\n amount_e8s: IDL.Opt(IDL.Nat64),\n });\n const AdvanceSnsTargetVersion = IDL.Record({\n new_target: IDL.Opt(SnsVersion),\n });\n const ManageSnsMetadata = IDL.Record({\n url: IDL.Opt(IDL.Text),\n logo: IDL.Opt(IDL.Text),\n name: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text),\n });\n const ExecuteGenericNervousSystemFunction = IDL.Record({\n function_id: IDL.Nat64,\n payload: IDL.Vec(IDL.Nat8),\n });\n const ManageLedgerParameters = IDL.Record({\n token_symbol: IDL.Opt(IDL.Text),\n transfer_fee: IDL.Opt(IDL.Nat64),\n token_logo: IDL.Opt(IDL.Text),\n token_name: IDL.Opt(IDL.Text),\n });\n const Motion = IDL.Record({ motion_text: IDL.Text });\n const Action = IDL.Variant({\n ManageNervousSystemParameters: NervousSystemParameters,\n AddGenericNervousSystemFunction: NervousSystemFunction,\n ManageDappCanisterSettings: ManageDappCanisterSettings,\n ExecuteExtensionOperation: ExecuteExtensionOperation,\n UpgradeExtension: UpgradeExtension,\n RemoveGenericNervousSystemFunction: IDL.Nat64,\n SetTopicsForCustomProposals: SetTopicsForCustomProposals,\n RegisterExtension: RegisterExtension,\n UpgradeSnsToNextVersion: IDL.Record({}),\n RegisterDappCanisters: RegisterDappCanisters,\n TransferSnsTreasuryFunds: TransferSnsTreasuryFunds,\n UpgradeSnsControlledCanister: UpgradeSnsControlledCanister,\n DeregisterDappCanisters: DeregisterDappCanisters,\n MintSnsTokens: MintSnsTokens,\n AdvanceSnsTargetVersion: AdvanceSnsTargetVersion,\n Unspecified: IDL.Record({}),\n ManageSnsMetadata: ManageSnsMetadata,\n ExecuteGenericNervousSystemFunction: ExecuteGenericNervousSystemFunction,\n ManageLedgerParameters: ManageLedgerParameters,\n Motion: Motion,\n });\n const Proposal = IDL.Record({\n url: IDL.Text,\n title: IDL.Text,\n action: IDL.Opt(Action),\n summary: IDL.Text,\n });\n const WaitForQuietState = IDL.Record({\n current_deadline_timestamp_seconds: IDL.Nat64,\n });\n const ProposalData = IDL.Record({\n id: IDL.Opt(ProposalId),\n payload_text_rendering: IDL.Opt(IDL.Text),\n topic: IDL.Opt(Topic),\n action: IDL.Nat64,\n failure_reason: IDL.Opt(GovernanceError),\n action_auxiliary: IDL.Opt(ActionAuxiliary),\n ballots: IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),\n minimum_yes_proportion_of_total: IDL.Opt(Percentage),\n reward_event_round: IDL.Nat64,\n failed_timestamp_seconds: IDL.Nat64,\n reward_event_end_timestamp_seconds: IDL.Opt(IDL.Nat64),\n proposal_creation_timestamp_seconds: IDL.Nat64,\n initial_voting_period_seconds: IDL.Nat64,\n reject_cost_e8s: IDL.Nat64,\n latest_tally: IDL.Opt(Tally),\n wait_for_quiet_deadline_increase_seconds: IDL.Nat64,\n decided_timestamp_seconds: IDL.Nat64,\n proposal: IDL.Opt(Proposal),\n proposer: IDL.Opt(NeuronId),\n wait_for_quiet_state: IDL.Opt(WaitForQuietState),\n minimum_yes_proportion_of_exercised: IDL.Opt(Percentage),\n is_eligible_for_rewards: IDL.Bool,\n executed_timestamp_seconds: IDL.Nat64,\n });\n const Split = IDL.Record({ memo: IDL.Nat64, amount_e8s: IDL.Nat64 });\n const Follow = IDL.Record({\n function_id: IDL.Nat64,\n followees: IDL.Vec(NeuronId),\n });\n const DisburseMaturity = IDL.Record({\n to_account: IDL.Opt(Account),\n percentage_to_disburse: IDL.Nat32,\n });\n const ChangeAutoStakeMaturity = IDL.Record({\n requested_setting_for_auto_stake_maturity: IDL.Bool,\n });\n const IncreaseDissolveDelay = IDL.Record({\n additional_dissolve_delay_seconds: IDL.Nat32,\n });\n const SetDissolveTimestamp = IDL.Record({\n dissolve_timestamp_seconds: IDL.Nat64,\n });\n const Operation = IDL.Variant({\n ChangeAutoStakeMaturity: ChangeAutoStakeMaturity,\n StopDissolving: IDL.Record({}),\n StartDissolving: IDL.Record({}),\n IncreaseDissolveDelay: IncreaseDissolveDelay,\n SetDissolveTimestamp: SetDissolveTimestamp,\n });\n const Configure = IDL.Record({ operation: IDL.Opt(Operation) });\n const RegisterVote = IDL.Record({\n vote: IDL.Int32,\n proposal: IDL.Opt(ProposalId),\n });\n const Followee = IDL.Record({\n alias: IDL.Opt(IDL.Text),\n neuron_id: IDL.Opt(NeuronId),\n });\n const FolloweesForTopic = IDL.Record({\n topic: IDL.Opt(Topic),\n followees: IDL.Vec(Followee),\n });\n const SetFollowing = IDL.Record({\n topic_following: IDL.Vec(FolloweesForTopic),\n });\n const FinalizeDisburseMaturity = IDL.Record({\n amount_to_be_disbursed_e8s: IDL.Nat64,\n to_account: IDL.Opt(Account),\n });\n const MemoAndController = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n memo: IDL.Nat64,\n });\n const By = IDL.Variant({\n MemoAndController: MemoAndController,\n NeuronId: IDL.Record({}),\n });\n const ClaimOrRefresh = IDL.Record({ by: IDL.Opt(By) });\n const RemoveNeuronPermissions = IDL.Record({\n permissions_to_remove: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const AddNeuronPermissions = IDL.Record({\n permissions_to_add: IDL.Opt(NeuronPermissionList),\n principal_id: IDL.Opt(IDL.Principal),\n });\n const MergeMaturity = IDL.Record({ percentage_to_merge: IDL.Nat32 });\n const Amount = IDL.Record({ e8s: IDL.Nat64 });\n const Disburse = IDL.Record({\n to_account: IDL.Opt(Account),\n amount: IDL.Opt(Amount),\n });\n const Command_2 = IDL.Variant({\n Split: Split,\n Follow: Follow,\n DisburseMaturity: DisburseMaturity,\n Configure: Configure,\n RegisterVote: RegisterVote,\n SetFollowing: SetFollowing,\n SyncCommand: IDL.Record({}),\n MakeProposal: Proposal,\n FinalizeDisburseMaturity: FinalizeDisburseMaturity,\n ClaimOrRefreshNeuron: ClaimOrRefresh,\n RemoveNeuronPermissions: RemoveNeuronPermissions,\n AddNeuronPermissions: AddNeuronPermissions,\n MergeMaturity: MergeMaturity,\n Disburse: Disburse,\n });\n const NeuronInFlightCommand = IDL.Record({\n command: IDL.Opt(Command_2),\n timestamp: IDL.Nat64,\n });\n const NeuronPermission = IDL.Record({\n principal: IDL.Opt(IDL.Principal),\n permission_type: IDL.Vec(IDL.Int32),\n });\n const DissolveState = IDL.Variant({\n DissolveDelaySeconds: IDL.Nat64,\n WhenDissolvedTimestampSeconds: IDL.Nat64,\n });\n const DisburseMaturityInProgress = IDL.Record({\n timestamp_of_disbursement_seconds: IDL.Nat64,\n amount_e8s: IDL.Nat64,\n account_to_disburse_to: IDL.Opt(Account),\n finalize_disbursement_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Neuron = IDL.Record({\n id: IDL.Opt(NeuronId),\n staked_maturity_e8s_equivalent: IDL.Opt(IDL.Nat64),\n permissions: IDL.Vec(NeuronPermission),\n maturity_e8s_equivalent: IDL.Nat64,\n cached_neuron_stake_e8s: IDL.Nat64,\n created_timestamp_seconds: IDL.Nat64,\n topic_followees: IDL.Opt(\n IDL.Record({\n topic_id_to_followees: IDL.Vec(IDL.Tuple(IDL.Int32, FolloweesForTopic)),\n }),\n ),\n source_nns_neuron_id: IDL.Opt(IDL.Nat64),\n auto_stake_maturity: IDL.Opt(IDL.Bool),\n aging_since_timestamp_seconds: IDL.Nat64,\n dissolve_state: IDL.Opt(DissolveState),\n voting_power_percentage_multiplier: IDL.Nat64,\n vesting_period_seconds: IDL.Opt(IDL.Nat64),\n disburse_maturity_in_progress: IDL.Vec(DisburseMaturityInProgress),\n followees: IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),\n neuron_fees_e8s: IDL.Nat64,\n });\n const Governance = IDL.Record({\n root_canister_id: IDL.Opt(IDL.Principal),\n timers: IDL.Opt(Timers),\n cached_upgrade_steps: IDL.Opt(CachedUpgradeSteps),\n id_to_nervous_system_functions: IDL.Vec(\n IDL.Tuple(IDL.Nat64, NervousSystemFunction),\n ),\n metrics: IDL.Opt(GovernanceCachedMetrics),\n maturity_modulation: IDL.Opt(MaturityModulation),\n upgrade_journal: IDL.Opt(UpgradeJournal),\n mode: IDL.Int32,\n parameters: IDL.Opt(NervousSystemParameters),\n is_finalizing_disburse_maturity: IDL.Opt(IDL.Bool),\n deployed_version: IDL.Opt(Version),\n sns_initialization_parameters: IDL.Text,\n latest_reward_event: IDL.Opt(RewardEvent),\n pending_version: IDL.Opt(PendingVersion),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n proposals: IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),\n in_flight_commands: IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),\n sns_metadata: IDL.Opt(ManageSnsMetadata),\n neurons: IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),\n target_version: IDL.Opt(Version),\n genesis_timestamp_seconds: IDL.Nat64,\n });\n\n return [Governance];\n};\n", "import { Canister, createServices } from \"@dfinity/utils\";\nimport type {\n ListSnsCanistersResponse,\n _SERVICE as SnsRootService,\n} from \"./candid/sns_root\";\nimport { idlFactory as certifiedIdlFactory } from \"./candid/sns_root.certified.idl\";\nimport { idlFactory } from \"./candid/sns_root.idl\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\n\nexport class SnsRootCanister extends Canister<SnsRootService> {\n static create(options: SnsCanisterOptions<SnsRootService>) {\n const { service, certifiedService, canisterId } =\n createServices<SnsRootService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new SnsRootCanister(canisterId, service, certifiedService);\n }\n\n /**\n * List the canisters that are part of the Sns.\n *\n * Source code: https://github.com/dfinity/ic/blob/master/rs/sns/root/src/lib.rs\n *\n * @param {Object} params\n * @param {boolean} [params.certified=true] - Query or update calls\n *\n * @returns {ListSnsCanistersResponse} - A list of canisters ('root' | 'governance' | 'ledger' | 'dapps' | 'swap' | 'archives')\n */\n listSnsCanisters = ({\n certified = true,\n }: {\n certified?: boolean;\n }): Promise<ListSnsCanistersResponse> =>\n this.caller({ certified }).list_sns_canisters({});\n}\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.0.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({ IDL }) => {\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Extensions = IDL.Record({\n extension_canister_ids: IDL.Vec(IDL.Principal),\n });\n const SnsRootCanister = IDL.Record({\n dapp_canister_ids: IDL.Vec(IDL.Principal),\n timers: IDL.Opt(Timers),\n testflight: IDL.Bool,\n extensions: IDL.Opt(Extensions),\n archive_canister_ids: IDL.Vec(IDL.Principal),\n governance_canister_id: IDL.Opt(IDL.Principal),\n index_canister_id: IDL.Opt(IDL.Principal),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n });\n const CanisterIdRecord = IDL.Record({ canister_id: IDL.Principal });\n const MemoryMetrics = IDL.Record({\n wasm_binary_size: IDL.Opt(IDL.Nat),\n wasm_chunk_store_size: IDL.Opt(IDL.Nat),\n canister_history_size: IDL.Opt(IDL.Nat),\n stable_memory_size: IDL.Opt(IDL.Nat),\n snapshots_size: IDL.Opt(IDL.Nat),\n wasm_memory_size: IDL.Opt(IDL.Nat),\n global_memory_size: IDL.Opt(IDL.Nat),\n custom_sections_size: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusType = IDL.Variant({\n stopped: IDL.Null,\n stopping: IDL.Null,\n running: IDL.Null,\n });\n const LogVisibility = IDL.Variant({\n controllers: IDL.Null,\n public: IDL.Null,\n allowed_viewers: IDL.Vec(IDL.Principal),\n });\n const DefiniteCanisterSettings = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat),\n wasm_memory_threshold: IDL.Opt(IDL.Nat),\n controllers: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat),\n log_visibility: IDL.Opt(LogVisibility),\n wasm_memory_limit: IDL.Opt(IDL.Nat),\n memory_allocation: IDL.Opt(IDL.Nat),\n compute_allocation: IDL.Opt(IDL.Nat),\n });\n const QueryStats = IDL.Record({\n response_payload_bytes_total: IDL.Opt(IDL.Nat),\n num_instructions_total: IDL.Opt(IDL.Nat),\n num_calls_total: IDL.Opt(IDL.Nat),\n request_payload_bytes_total: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusResult = IDL.Record({\n memory_metrics: IDL.Opt(MemoryMetrics),\n status: CanisterStatusType,\n memory_size: IDL.Nat,\n cycles: IDL.Nat,\n settings: DefiniteCanisterSettings,\n query_stats: IDL.Opt(QueryStats),\n idle_cycles_burned_per_day: IDL.Opt(IDL.Nat),\n module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n reserved_cycles: IDL.Opt(IDL.Nat),\n });\n const CanisterInstallMode = IDL.Variant({\n reinstall: IDL.Null,\n upgrade: IDL.Null,\n install: IDL.Null,\n });\n const ChunkedCanisterWasm = IDL.Record({\n wasm_module_hash: IDL.Vec(IDL.Nat8),\n chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),\n store_canister_id: IDL.Principal,\n });\n const ChangeCanisterRequest = IDL.Record({\n arg: IDL.Vec(IDL.Nat8),\n wasm_module: IDL.Vec(IDL.Nat8),\n stop_before_installing: IDL.Bool,\n mode: CanisterInstallMode,\n canister_id: IDL.Principal,\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n });\n const GetSnsCanistersSummaryRequest = IDL.Record({\n update_canister_list: IDL.Opt(IDL.Bool),\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n freezing_threshold: IDL.Nat,\n wasm_memory_threshold: IDL.Opt(IDL.Nat),\n controllers: IDL.Vec(IDL.Principal),\n wasm_memory_limit: IDL.Opt(IDL.Nat),\n memory_allocation: IDL.Nat,\n compute_allocation: IDL.Nat,\n });\n const CanisterStatusResultV2 = IDL.Record({\n memory_metrics: IDL.Opt(MemoryMetrics),\n status: CanisterStatusType,\n memory_size: IDL.Nat,\n cycles: IDL.Nat,\n settings: DefiniteCanisterSettingsArgs,\n query_stats: IDL.Opt(QueryStats),\n idle_cycles_burned_per_day: IDL.Nat,\n module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const CanisterSummary = IDL.Record({\n status: IDL.Opt(CanisterStatusResultV2),\n canister_id: IDL.Opt(IDL.Principal),\n });\n const GetSnsCanistersSummaryResponse = IDL.Record({\n root: IDL.Opt(CanisterSummary),\n swap: IDL.Opt(CanisterSummary),\n ledger: IDL.Opt(CanisterSummary),\n index: IDL.Opt(CanisterSummary),\n governance: IDL.Opt(CanisterSummary),\n dapps: IDL.Vec(CanisterSummary),\n archives: IDL.Vec(CanisterSummary),\n });\n const GetTimersResponse = IDL.Record({ timers: IDL.Opt(Timers) });\n const ListSnsCanistersResponse = IDL.Record({\n root: IDL.Opt(IDL.Principal),\n swap: IDL.Opt(IDL.Principal),\n extensions: IDL.Opt(Extensions),\n ledger: IDL.Opt(IDL.Principal),\n index: IDL.Opt(IDL.Principal),\n governance: IDL.Opt(IDL.Principal),\n dapps: IDL.Vec(IDL.Principal),\n archives: IDL.Vec(IDL.Principal),\n });\n const ManageDappCanisterSettingsRequest = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat64),\n wasm_memory_threshold: IDL.Opt(IDL.Nat64),\n canister_ids: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat64),\n log_visibility: IDL.Opt(IDL.Int32),\n wasm_memory_limit: IDL.Opt(IDL.Nat64),\n memory_allocation: IDL.Opt(IDL.Nat64),\n compute_allocation: IDL.Opt(IDL.Nat64),\n });\n const ManageDappCanisterSettingsResponse = IDL.Record({\n failure_reason: IDL.Opt(IDL.Text),\n });\n const RegisterDappCanisterRequest = IDL.Record({\n canister_id: IDL.Opt(IDL.Principal),\n });\n const RegisterDappCanistersRequest = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n });\n const RegisterExtensionRequest = IDL.Record({\n canister_id: IDL.Opt(IDL.Principal),\n });\n const CanisterCallError = IDL.Record({\n code: IDL.Opt(IDL.Int32),\n description: IDL.Text,\n });\n const RegisterExtensionResult = IDL.Variant({\n Ok: IDL.Record({}),\n Err: CanisterCallError,\n });\n const RegisterExtensionResponse = IDL.Record({\n result: IDL.Opt(RegisterExtensionResult),\n });\n const SetDappControllersRequest = IDL.Record({\n canister_ids: IDL.Opt(RegisterDappCanistersRequest),\n controller_principal_ids: IDL.Vec(IDL.Principal),\n });\n const FailedUpdate = IDL.Record({\n err: IDL.Opt(CanisterCallError),\n dapp_canister_id: IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n failed_updates: IDL.Vec(FailedUpdate),\n });\n\n return IDL.Service({\n canister_status: IDL.Func([CanisterIdRecord], [CanisterStatusResult], []),\n change_canister: IDL.Func([ChangeCanisterRequest], [], []),\n get_build_metadata: IDL.Func([], [IDL.Text], []),\n get_sns_canisters_summary: IDL.Func(\n [GetSnsCanistersSummaryRequest],\n [GetSnsCanistersSummaryResponse],\n [],\n ),\n get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], []),\n list_sns_canisters: IDL.Func(\n [IDL.Record({})],\n [ListSnsCanistersResponse],\n [],\n ),\n manage_dapp_canister_settings: IDL.Func(\n [ManageDappCanisterSettingsRequest],\n [ManageDappCanisterSettingsResponse],\n [],\n ),\n register_dapp_canister: IDL.Func(\n [RegisterDappCanisterRequest],\n [IDL.Record({})],\n [],\n ),\n register_dapp_canisters: IDL.Func(\n [RegisterDappCanistersRequest],\n [IDL.Record({})],\n [],\n ),\n register_extension: IDL.Func(\n [RegisterExtensionRequest],\n [RegisterExtensionResponse],\n [],\n ),\n reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], []),\n set_dapp_controllers: IDL.Func(\n [SetDappControllersRequest],\n [SetDappControllersResponse],\n [],\n ),\n });\n};\n\nexport const init = ({ IDL }) => {\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Extensions = IDL.Record({\n extension_canister_ids: IDL.Vec(IDL.Principal),\n });\n const SnsRootCanister = IDL.Record({\n dapp_canister_ids: IDL.Vec(IDL.Principal),\n timers: IDL.Opt(Timers),\n testflight: IDL.Bool,\n extensions: IDL.Opt(Extensions),\n archive_canister_ids: IDL.Vec(IDL.Principal),\n governance_canister_id: IDL.Opt(IDL.Principal),\n index_canister_id: IDL.Opt(IDL.Principal),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n });\n\n return [SnsRootCanister];\n};\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.0.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({ IDL }) => {\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Extensions = IDL.Record({\n extension_canister_ids: IDL.Vec(IDL.Principal),\n });\n const SnsRootCanister = IDL.Record({\n dapp_canister_ids: IDL.Vec(IDL.Principal),\n timers: IDL.Opt(Timers),\n testflight: IDL.Bool,\n extensions: IDL.Opt(Extensions),\n archive_canister_ids: IDL.Vec(IDL.Principal),\n governance_canister_id: IDL.Opt(IDL.Principal),\n index_canister_id: IDL.Opt(IDL.Principal),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n });\n const CanisterIdRecord = IDL.Record({ canister_id: IDL.Principal });\n const MemoryMetrics = IDL.Record({\n wasm_binary_size: IDL.Opt(IDL.Nat),\n wasm_chunk_store_size: IDL.Opt(IDL.Nat),\n canister_history_size: IDL.Opt(IDL.Nat),\n stable_memory_size: IDL.Opt(IDL.Nat),\n snapshots_size: IDL.Opt(IDL.Nat),\n wasm_memory_size: IDL.Opt(IDL.Nat),\n global_memory_size: IDL.Opt(IDL.Nat),\n custom_sections_size: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusType = IDL.Variant({\n stopped: IDL.Null,\n stopping: IDL.Null,\n running: IDL.Null,\n });\n const LogVisibility = IDL.Variant({\n controllers: IDL.Null,\n public: IDL.Null,\n allowed_viewers: IDL.Vec(IDL.Principal),\n });\n const DefiniteCanisterSettings = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat),\n wasm_memory_threshold: IDL.Opt(IDL.Nat),\n controllers: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat),\n log_visibility: IDL.Opt(LogVisibility),\n wasm_memory_limit: IDL.Opt(IDL.Nat),\n memory_allocation: IDL.Opt(IDL.Nat),\n compute_allocation: IDL.Opt(IDL.Nat),\n });\n const QueryStats = IDL.Record({\n response_payload_bytes_total: IDL.Opt(IDL.Nat),\n num_instructions_total: IDL.Opt(IDL.Nat),\n num_calls_total: IDL.Opt(IDL.Nat),\n request_payload_bytes_total: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusResult = IDL.Record({\n memory_metrics: IDL.Opt(MemoryMetrics),\n status: CanisterStatusType,\n memory_size: IDL.Nat,\n cycles: IDL.Nat,\n settings: DefiniteCanisterSettings,\n query_stats: IDL.Opt(QueryStats),\n idle_cycles_burned_per_day: IDL.Opt(IDL.Nat),\n module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n reserved_cycles: IDL.Opt(IDL.Nat),\n });\n const CanisterInstallMode = IDL.Variant({\n reinstall: IDL.Null,\n upgrade: IDL.Null,\n install: IDL.Null,\n });\n const ChunkedCanisterWasm = IDL.Record({\n wasm_module_hash: IDL.Vec(IDL.Nat8),\n chunk_hashes_list: IDL.Vec(IDL.Vec(IDL.Nat8)),\n store_canister_id: IDL.Principal,\n });\n const ChangeCanisterRequest = IDL.Record({\n arg: IDL.Vec(IDL.Nat8),\n wasm_module: IDL.Vec(IDL.Nat8),\n stop_before_installing: IDL.Bool,\n mode: CanisterInstallMode,\n canister_id: IDL.Principal,\n chunked_canister_wasm: IDL.Opt(ChunkedCanisterWasm),\n });\n const GetSnsCanistersSummaryRequest = IDL.Record({\n update_canister_list: IDL.Opt(IDL.Bool),\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n freezing_threshold: IDL.Nat,\n wasm_memory_threshold: IDL.Opt(IDL.Nat),\n controllers: IDL.Vec(IDL.Principal),\n wasm_memory_limit: IDL.Opt(IDL.Nat),\n memory_allocation: IDL.Nat,\n compute_allocation: IDL.Nat,\n });\n const CanisterStatusResultV2 = IDL.Record({\n memory_metrics: IDL.Opt(MemoryMetrics),\n status: CanisterStatusType,\n memory_size: IDL.Nat,\n cycles: IDL.Nat,\n settings: DefiniteCanisterSettingsArgs,\n query_stats: IDL.Opt(QueryStats),\n idle_cycles_burned_per_day: IDL.Nat,\n module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const CanisterSummary = IDL.Record({\n status: IDL.Opt(CanisterStatusResultV2),\n canister_id: IDL.Opt(IDL.Principal),\n });\n const GetSnsCanistersSummaryResponse = IDL.Record({\n root: IDL.Opt(CanisterSummary),\n swap: IDL.Opt(CanisterSummary),\n ledger: IDL.Opt(CanisterSummary),\n index: IDL.Opt(CanisterSummary),\n governance: IDL.Opt(CanisterSummary),\n dapps: IDL.Vec(CanisterSummary),\n archives: IDL.Vec(CanisterSummary),\n });\n const GetTimersResponse = IDL.Record({ timers: IDL.Opt(Timers) });\n const ListSnsCanistersResponse = IDL.Record({\n root: IDL.Opt(IDL.Principal),\n swap: IDL.Opt(IDL.Principal),\n extensions: IDL.Opt(Extensions),\n ledger: IDL.Opt(IDL.Principal),\n index: IDL.Opt(IDL.Principal),\n governance: IDL.Opt(IDL.Principal),\n dapps: IDL.Vec(IDL.Principal),\n archives: IDL.Vec(IDL.Principal),\n });\n const ManageDappCanisterSettingsRequest = IDL.Record({\n freezing_threshold: IDL.Opt(IDL.Nat64),\n wasm_memory_threshold: IDL.Opt(IDL.Nat64),\n canister_ids: IDL.Vec(IDL.Principal),\n reserved_cycles_limit: IDL.Opt(IDL.Nat64),\n log_visibility: IDL.Opt(IDL.Int32),\n wasm_memory_limit: IDL.Opt(IDL.Nat64),\n memory_allocation: IDL.Opt(IDL.Nat64),\n compute_allocation: IDL.Opt(IDL.Nat64),\n });\n const ManageDappCanisterSettingsResponse = IDL.Record({\n failure_reason: IDL.Opt(IDL.Text),\n });\n const RegisterDappCanisterRequest = IDL.Record({\n canister_id: IDL.Opt(IDL.Principal),\n });\n const RegisterDappCanistersRequest = IDL.Record({\n canister_ids: IDL.Vec(IDL.Principal),\n });\n const RegisterExtensionRequest = IDL.Record({\n canister_id: IDL.Opt(IDL.Principal),\n });\n const CanisterCallError = IDL.Record({\n code: IDL.Opt(IDL.Int32),\n description: IDL.Text,\n });\n const RegisterExtensionResult = IDL.Variant({\n Ok: IDL.Record({}),\n Err: CanisterCallError,\n });\n const RegisterExtensionResponse = IDL.Record({\n result: IDL.Opt(RegisterExtensionResult),\n });\n const SetDappControllersRequest = IDL.Record({\n canister_ids: IDL.Opt(RegisterDappCanistersRequest),\n controller_principal_ids: IDL.Vec(IDL.Principal),\n });\n const FailedUpdate = IDL.Record({\n err: IDL.Opt(CanisterCallError),\n dapp_canister_id: IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n failed_updates: IDL.Vec(FailedUpdate),\n });\n\n return IDL.Service({\n canister_status: IDL.Func([CanisterIdRecord], [CanisterStatusResult], []),\n change_canister: IDL.Func([ChangeCanisterRequest], [], []),\n get_build_metadata: IDL.Func([], [IDL.Text], [\"query\"]),\n get_sns_canisters_summary: IDL.Func(\n [GetSnsCanistersSummaryRequest],\n [GetSnsCanistersSummaryResponse],\n [],\n ),\n get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], [\"query\"]),\n list_sns_canisters: IDL.Func(\n [IDL.Record({})],\n [ListSnsCanistersResponse],\n [\"query\"],\n ),\n manage_dapp_canister_settings: IDL.Func(\n [ManageDappCanisterSettingsRequest],\n [ManageDappCanisterSettingsResponse],\n [],\n ),\n register_dapp_canister: IDL.Func(\n [RegisterDappCanisterRequest],\n [IDL.Record({})],\n [],\n ),\n register_dapp_canisters: IDL.Func(\n [RegisterDappCanistersRequest],\n [IDL.Record({})],\n [],\n ),\n register_extension: IDL.Func(\n [RegisterExtensionRequest],\n [RegisterExtensionResponse],\n [],\n ),\n reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], []),\n set_dapp_controllers: IDL.Func(\n [SetDappControllersRequest],\n [SetDappControllersResponse],\n [],\n ),\n });\n};\n\nexport const init = ({ IDL }) => {\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const Extensions = IDL.Record({\n extension_canister_ids: IDL.Vec(IDL.Principal),\n });\n const SnsRootCanister = IDL.Record({\n dapp_canister_ids: IDL.Vec(IDL.Principal),\n timers: IDL.Opt(Timers),\n testflight: IDL.Bool,\n extensions: IDL.Opt(Extensions),\n archive_canister_ids: IDL.Vec(IDL.Principal),\n governance_canister_id: IDL.Opt(IDL.Principal),\n index_canister_id: IDL.Opt(IDL.Principal),\n swap_canister_id: IDL.Opt(IDL.Principal),\n ledger_canister_id: IDL.Opt(IDL.Principal),\n });\n\n return [SnsRootCanister];\n};\n", "import { IcrcIndexCanister, IcrcLedgerCanister } from \"@dfinity/ledger-icrc\";\nimport {\n assertNonNullish,\n fromNullable,\n type QueryParams,\n} from \"@dfinity/utils\";\nimport type { Agent } from \"@icp-sdk/core/agent\";\nimport type { Principal } from \"@icp-sdk/core/principal\";\nimport type {\n ListSnsCanistersResponse,\n _SERVICE as SnsRootService,\n} from \"./candid/sns_root\";\nimport { SnsGovernanceCanister } from \"./governance.canister\";\nimport { SnsRootCanister } from \"./root.canister\";\nimport { SnsWrapper } from \"./sns.wrapper\";\nimport { SnsSwapCanister } from \"./swap.canister\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\n\n/**\n * Options to discover and initialize all canisters of a Sns.\n */\nexport interface InitSnsCanistersOptions extends QueryParams {\n /** An agent that can be used to override the default agent. Useful to target another environment that mainnet. */\n agent?: Agent;\n /** The options that will be used to instantiate the actors of the root canister of the particular Sns. */\n rootOptions: Omit<SnsCanisterOptions<SnsRootService>, \"agent\">;\n}\n\nexport interface InitSnsWrapper {\n (options: InitSnsCanistersOptions): Promise<SnsWrapper>;\n}\n\n/**\n * Lookup for the canister ids of a Sns and initialize the wrapper to access its features.\n */\nexport const initSnsWrapper: InitSnsWrapper = async ({\n agent,\n rootOptions,\n certified = true,\n}: InitSnsCanistersOptions): Promise<SnsWrapper> => {\n const rootCanister: SnsRootCanister = SnsRootCanister.create({\n ...rootOptions,\n agent,\n });\n\n const { ledger, swap, governance, index }: ListSnsCanistersResponse =\n await rootCanister.listSnsCanisters({ certified });\n\n const governanceCanisterId: Principal | undefined = fromNullable(governance);\n const ledgerCanisterId: Principal | undefined = fromNullable(ledger);\n const swapCanisterId: Principal | undefined = fromNullable(swap);\n const indexCanisterId: Principal | undefined = fromNullable(index);\n\n assertNonNullish(governanceCanisterId);\n assertNonNullish(ledgerCanisterId);\n assertNonNullish(swapCanisterId);\n assertNonNullish(indexCanisterId);\n\n return new SnsWrapper({\n root: rootCanister,\n governance: SnsGovernanceCanister.create({\n canisterId: governanceCanisterId,\n agent,\n }),\n ledger: IcrcLedgerCanister.create({ canisterId: ledgerCanisterId, agent }),\n swap: SnsSwapCanister.create({ canisterId: swapCanisterId, agent }),\n index: IcrcIndexCanister.create({ canisterId: indexCanisterId, agent }),\n certified,\n });\n};\n", "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 {\n bigIntToUint8Array,\n toNullable,\n type QueryParams,\n} from \"@dfinity/utils\";\nimport type { Principal } from \"@icp-sdk/core/principal\";\nimport type {\n GetMetadataResponse,\n ListNervousSystemFunctionsResponse,\n ListProposalsResponse,\n NervousSystemParameters,\n Neuron,\n NeuronId,\n ProposalData,\n} from \"./candid/sns_governance\";\nimport type {\n BuyerState,\n GetAutoFinalizationStatusResponse,\n GetBuyerStateRequest,\n GetDerivedStateResponse,\n GetLifecycleResponse,\n GetSaleParametersResponse,\n GetStateResponse,\n RefreshBuyerTokensRequest,\n RefreshBuyerTokensResponse,\n Ticket,\n} from \"./candid/sns_swap\";\nimport { MAX_NEURONS_SUBACCOUNTS } from \"./constants/governance.constants\";\nimport { SnsGovernanceError } from \"./errors/governance.errors\";\nimport type { SnsGovernanceCanister } from \"./governance.canister\";\nimport type { SnsRootCanister } from \"./root.canister\";\nimport type { SnsSwapCanister } from \"./swap.canister\";\nimport type {\n SnsClaimNeuronParams,\n SnsDisburseNeuronParams,\n SnsGetNeuronParams,\n SnsGetProposalParams,\n SnsIncreaseDissolveDelayParams,\n SnsIncreaseStakeNeuronParams,\n SnsListNeuronsParams,\n SnsListProposalsParams,\n SnsNeuronAutoStakeMaturityParams,\n SnsNeuronDisburseMaturityParams,\n SnsNeuronPermissionsParams,\n SnsNeuronStakeMaturityParams,\n SnsRegisterVoteParams,\n SnsSetDissolveTimestampParams,\n SnsSetFollowingParams,\n SnsSetTopicFollowees,\n SnsSplitNeuronParams,\n SnsStakeNeuronParams,\n} from \"./types/governance.params\";\nimport type { NewSaleTicketParams } from \"./types/swap.params\";\nimport { neuronSubaccount } from \"./utils/governance.utils\";\n\ninterface SnsWrapperOptions {\n /** The wrapper for the \"root\" canister of the particular Sns */\n root: SnsRootCanister;\n /** The wrapper for the \"governance\" canister of the particular Sns */\n governance: SnsGovernanceCanister;\n /** The wrapper for the \"ledger\" canister of the particular Sns */\n ledger: IcrcLedgerCanister;\n /** The wrapper for the \"swap\" canister of the particular Sns */\n swap: SnsSwapCanister;\n /** The wrapper for the \"index\" canister of the particular Sns */\n index: IcrcIndexCanister;\n\n /** The wrapper has been instantiated and should perform query or update calls */\n certified: boolean;\n}\n\n/**\n * Sns wrapper - notably used by NNS-dapp - ease the access to a particular Sns.\n * It knows all the Sns' canisters, wrap and enhance their available features.\n * A wrapper either performs query or update calls.\n */\nexport class SnsWrapper {\n private readonly root: SnsRootCanister;\n private readonly governance: SnsGovernanceCanister;\n private readonly ledger: IcrcLedgerCanister;\n private readonly swap: SnsSwapCanister;\n private readonly index: IcrcIndexCanister;\n private readonly certified: boolean;\n\n /**\n * Constructor to instantiate a Sns\n */\n constructor({\n root,\n governance,\n ledger,\n swap,\n index,\n certified,\n }: SnsWrapperOptions) {\n this.root = root;\n this.governance = governance;\n this.ledger = ledger;\n this.swap = swap;\n this.index = index;\n this.certified = certified;\n }\n\n /**\n * Binds the list of canister ids of the Sns.\n */\n get canisterIds(): {\n rootCanisterId: Principal;\n ledgerCanisterId: Principal;\n governanceCanisterId: Principal;\n swapCanisterId: Principal;\n indexCanisterId: Principal;\n } {\n return {\n rootCanisterId: this.root.canisterId,\n ledgerCanisterId: this.ledger.canisterId,\n governanceCanisterId: this.governance.canisterId,\n swapCanisterId: this.swap.canisterId,\n indexCanisterId: this.index.canisterId,\n };\n }\n\n listNeurons = (\n params: Omit<SnsListNeuronsParams, \"certified\">,\n ): Promise<Neuron[]> => this.governance.listNeurons(this.mergeParams(params));\n\n listProposals = (\n params: Omit<SnsListProposalsParams, \"certified\">,\n ): Promise<ListProposalsResponse> =>\n this.governance.listProposals(this.mergeParams(params));\n\n getProposal = (\n params: Omit<SnsGetProposalParams, \"certified\">,\n ): Promise<ProposalData> =>\n this.governance.getProposal(this.mergeParams(params));\n\n listNervousSystemFunctions = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<ListNervousSystemFunctionsResponse> =>\n this.governance.listNervousSystemFunctions(this.mergeParams(params));\n\n metadata = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<[GetMetadataResponse, IcrcTokenMetadataResponse]> =>\n Promise.all([\n this.governance.metadata(this.mergeParams(params)),\n this.ledger.metadata(this.mergeParams(params)),\n ]);\n\n nervousSystemParameters = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<NervousSystemParameters> =>\n this.governance.nervousSystemParameters(this.mergeParams(params));\n\n ledgerMetadata = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<IcrcTokenMetadataResponse> =>\n this.ledger.metadata(this.mergeParams(params));\n\n transactionFee = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<IcrcTokens> =>\n this.ledger.transactionFee(this.mergeParams(params));\n\n totalTokensSupply = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<IcrcTokens> =>\n this.ledger.totalTokensSupply(this.mergeParams(params));\n\n balance = (params: Omit<BalanceParams, \"certified\">): Promise<IcrcTokens> =>\n this.ledger.balance(this.mergeParams(params));\n\n // Always certified\n transfer = (params: TransferParams): Promise<IcrcBlockIndex> =>\n this.ledger.transfer(params);\n\n getNeuron = (\n params: Omit<SnsGetNeuronParams, \"certified\">,\n ): Promise<Neuron> => this.governance.getNeuron(this.mergeParams(params));\n\n queryNeuron = (\n params: Omit<SnsGetNeuronParams, \"certified\">,\n ): Promise<Neuron | undefined> =>\n this.governance.queryNeuron(this.mergeParams(params));\n\n /**\n * Returns the subaccount of the next neuron to be created.\n *\n * The neuron account is a subaccount of the governance canister.\n * The subaccount is derived from the controller and an ascending index.\n *\n * \u203C\uFE0F The id of the neuron is the subaccount (neuron ID = subaccount) \u203C\uFE0F.\n *\n * If the neuron does not exist for that subaccount, then we use it for the next neuron.\n *\n * The index is used in the memo of the transfer and when claiming the neuron.\n * This is how the backend can identify which neuron is being claimed.\n *\n * @param controller\n * @returns\n */\n nextNeuronAccount = async (\n controller: Principal,\n ): Promise<{ account: IcrcAccount; index: bigint }> => {\n // TODO: try parallilizing requests to improve performance\n // OR use binary search https://dfinity.atlassian.net/browse/FOLLOW-825\n for (let index = 0; index < MAX_NEURONS_SUBACCOUNTS; index++) {\n const subaccount = neuronSubaccount({ index, controller });\n\n const neuronId: NeuronId = { id: subaccount };\n let neuron = await this.governance.queryNeuron({\n neuronId,\n certified: false,\n });\n if (neuron === undefined) {\n // Recheck with update call whether the neuron does not exist\n neuron = await this.governance.queryNeuron({\n neuronId,\n certified: true,\n });\n // If the neuron does not exist, we can use this subaccount\n if (neuron === undefined) {\n return {\n account: {\n ...this.owner,\n subaccount,\n },\n index: BigInt(index),\n };\n }\n }\n }\n throw new SnsGovernanceError(\"No more neuron accounts available\");\n };\n\n /**\n * Stakes a neuron.\n *\n * This is a convenient method that transfers the stake to the neuron subaccount and then claims the neuron.\n *\n * \u26A0\uFE0F This feature is provided as it without warranty. It does not implement any additional checks of the validity of the payment flow - e.g. it does not handle refund nor retries claiming the neuron in case of errors.\n *\n * @param {SnsStakeNeuronParams} params\n * @param {Principal} params.controller\n * @param {bigint} params.stakeE8s\n * @param {source} params.source\n * @returns {NeuronId}\n */\n stakeNeuron = async ({\n stakeE8s,\n source,\n controller,\n createdAt,\n fee,\n }: SnsStakeNeuronParams): Promise<NeuronId> => {\n this.assertCertified(\"stakeNeuron\");\n const { account: neuronAccount, index } =\n await this.nextNeuronAccount(controller);\n // This should not happen. The neuron account is always a subaccount of the SNS governance canister.\n if (neuronAccount.subaccount === undefined) {\n throw new SnsGovernanceError(\n \"There was an error creating the neuron subaccount\",\n );\n }\n await this.ledger.transfer({\n amount: stakeE8s,\n to: {\n owner: neuronAccount.owner,\n subaccount: toNullable(neuronAccount.subaccount),\n },\n from_subaccount: source.subaccount,\n memo: bigIntToUint8Array(index),\n created_at_time: createdAt,\n fee,\n });\n return this.governance.claimNeuron({\n memo: BigInt(index),\n controller,\n subaccount: neuronAccount.subaccount,\n });\n };\n\n /**\n * Increase the stake of a neuron.\n *\n * This is a convenient method that transfers the stake to the neuron subaccount and then refresh the neuron.\n *\n * \u26A0\uFE0F This feature is provided as it without warranty. It does not implement any additional checks of the validity of the payment flow - e.g. it does not handle refund nor calls refresh again in case of errors.\n *\n * @param {SnsStakeNeuronParams} params\n * @param {Principal} params.controller\n * @param {bigint} params.stakeE8s\n * @param {source} params.source\n * @returns {NeuronId}\n */\n increaseStakeNeuron = async ({\n stakeE8s,\n source,\n neuronId,\n }: SnsIncreaseStakeNeuronParams): Promise<void> => {\n this.assertCertified(\"stakeNeuron\");\n\n await this.ledger.transfer({\n amount: stakeE8s,\n to: {\n ...this.owner,\n subaccount: toNullable(Uint8Array.from(neuronId.id)),\n },\n from_subaccount: source.subaccount,\n });\n\n return this.governance.refreshNeuron(neuronId);\n };\n\n getNeuronBalance = (neuronId: NeuronId): Promise<IcrcTokens> => {\n const account = {\n ...this.owner,\n subaccount: Uint8Array.from(neuronId.id),\n };\n return this.ledger.balance({ ...account, certified: this.certified });\n };\n\n // Always certified\n addNeuronPermissions = (params: SnsNeuronPermissionsParams): Promise<void> =>\n this.governance.addNeuronPermissions(params);\n\n // Always certified\n refreshNeuron = (neuronId: NeuronId): Promise<void> =>\n this.governance.refreshNeuron(neuronId);\n\n // Always certified\n claimNeuron = (params: SnsClaimNeuronParams): Promise<NeuronId> =>\n this.governance.claimNeuron(params);\n\n // Always certified\n removeNeuronPermissions = (\n params: SnsNeuronPermissionsParams,\n ): Promise<void> => this.governance.removeNeuronPermissions(params);\n\n // Always certified\n splitNeuron = (params: SnsSplitNeuronParams): Promise<NeuronId | undefined> =>\n this.governance.splitNeuron(params);\n\n // Always certified\n disburse = (params: SnsDisburseNeuronParams): Promise<void> =>\n this.governance.disburse(params);\n\n // Always certified\n startDissolving = (neuronId: NeuronId): Promise<void> =>\n this.governance.startDissolving(neuronId);\n\n // Always certified\n stopDissolving = (neuronId: NeuronId): Promise<void> =>\n this.governance.stopDissolving(neuronId);\n\n // Always certified\n setDissolveTimestamp = (\n params: SnsSetDissolveTimestampParams,\n ): Promise<void> => this.governance.setDissolveTimestamp(params);\n\n // Always certified\n increaseDissolveDelay = (\n params: SnsIncreaseDissolveDelayParams,\n ): Promise<void> => this.governance.increaseDissolveDelay(params);\n\n // Always certified\n setTopicFollowees = (params: SnsSetTopicFollowees): Promise<void> =>\n this.governance.setTopicFollowees(params);\n\n // Always certified\n setFollowing = (params: SnsSetFollowingParams): Promise<void> =>\n this.governance.setFollowing(params);\n\n // Always certified\n registerVote = (params: SnsRegisterVoteParams): Promise<void> =>\n this.governance.registerVote(params);\n\n swapState = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<GetStateResponse> => this.swap.state(this.mergeParams(params));\n\n /**\n * Returns the ticket if a ticket was found for the caller and the ticket\n * was removed successfully. Returns None if no ticket was found for the caller.\n * Only the owner of a ticket can remove it.\n *\n * Always certified\n *\n * @param params\n */\n notifyPaymentFailure = (): Promise<Ticket | undefined> =>\n this.swap.notifyPaymentFailure();\n\n // Always certified\n notifyParticipation = (\n params: RefreshBuyerTokensRequest,\n ): Promise<RefreshBuyerTokensResponse> =>\n this.swap.notifyParticipation(params);\n\n getUserCommitment = (\n params: GetBuyerStateRequest,\n ): Promise<BuyerState | undefined> =>\n this.swap.getUserCommitment(this.mergeParams(params));\n\n getOpenTicket = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<Ticket | undefined> =>\n this.swap.getOpenTicket(this.mergeParams(params));\n\n // Always certified\n newSaleTicket = (params: NewSaleTicketParams): Promise<Ticket> =>\n this.swap.newSaleTicket(params);\n\n getLifecycle = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<GetLifecycleResponse | undefined> =>\n this.swap.getLifecycle(this.mergeParams(params));\n\n getFinalizationStatus = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<GetAutoFinalizationStatusResponse | undefined> =>\n this.swap.getFinalizationStatus(this.mergeParams(params));\n\n getSaleParameters = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<GetSaleParametersResponse | undefined> =>\n this.swap.getSaleParameters(this.mergeParams(params));\n\n getDerivedState = (\n params: Omit<QueryParams, \"certified\">,\n ): Promise<GetDerivedStateResponse | undefined> =>\n this.swap.getDerivedState(this.mergeParams(params));\n\n // Always certified\n getTransactions = (\n params: GetAccountTransactionsParams,\n ): Promise<IcrcGetTransactions> => this.index.getTransactions(params);\n\n // Always certified\n stakeMaturity = (params: SnsNeuronStakeMaturityParams): Promise<void> =>\n this.governance.stakeMaturity(params);\n\n // Always certified\n disburseMaturity = (params: SnsNeuronDisburseMaturityParams): Promise<void> =>\n this.governance.disburseMaturity(params);\n\n // Always certified\n autoStakeMaturity = (\n params: SnsNeuronAutoStakeMaturityParams,\n ): Promise<void> => this.governance.autoStakeMaturity(params);\n\n private mergeParams<T>(params: T): QueryParams & T {\n return {\n ...params,\n certified: this.certified,\n };\n }\n\n private assertCertified = (name: string): void => {\n if (!this.certified) {\n throw new SnsGovernanceError(`Call to ${name} needs to be certified`);\n }\n };\n\n /**\n * Each Sns neuron id is a subaccount of the related Sns ledger account of the Sns governance canister.\n *\n * In other words, the Sns governance canister is the owner. It has an account in the related Sns ledger and each neuron is both a child of the Sns governance canister and a subaccount in the Sns ledger.\n *\n * @private\n */\n private get owner(): IcrcAccount {\n return {\n owner: this.canisterIds.governanceCanisterId,\n };\n }\n}\n", "import type { IcrcSubaccount } from \"@dfinity/ledger-icrc\";\nimport {\n arrayOfNumberToUint8Array,\n asciiStringToByteArray,\n numberToUint8Array,\n} from \"@dfinity/utils\";\nimport type { Principal } from \"@icp-sdk/core/principal\";\nimport { sha256 } from \"@noble/hashes/sha2\";\n\n/**\n * Neuron subaccount is calculated as \"sha256(0x0c . \u201Cneuron-stake\u201D . controller . i)\"\n *\n * @param params\n * @param {Principal} params.newController\n * @param {number} params.index\n * @returns\n */\nexport const neuronSubaccount = ({\n index,\n controller,\n}: {\n index: number;\n controller: Principal;\n}): IcrcSubaccount => {\n const padding = asciiStringToByteArray(\"neuron-stake\");\n const data = [\n 0x0c,\n ...padding,\n ...controller.toUint8Array(),\n ...numberToUint8Array(index),\n ];\n // TODO(#238): Implement without library and make it compatible with NodeJS and browser\n const shaObj = sha256.create();\n shaObj.update(arrayOfNumberToUint8Array(data));\n return shaObj.digest();\n};\n", "/**\n * Utilities for hex, bytes, CSPRNG.\n * @module\n */\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated (2025-04-30), we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\n\n/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */\nexport function isBytes(a: unknown): a is Uint8Array {\n return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\n\n/** Asserts something is positive integer. */\nexport function anumber(n: number): void {\n if (!Number.isSafeInteger(n) || n < 0) throw new Error('positive integer expected, got ' + n);\n}\n\n/** Asserts something is Uint8Array. */\nexport function abytes(b: Uint8Array | undefined, ...lengths: number[]): void {\n if (!isBytes(b)) throw new Error('Uint8Array expected');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length);\n}\n\n/** Asserts something is hash */\nexport function ahash(h: IHash): void {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new Error('Hash should be wrapped by utils.createHasher');\n anumber(h.outputLen);\n anumber(h.blockLen);\n}\n\n/** Asserts a hash instance has not been destroyed / finished */\nexport function aexists(instance: any, checkFinished = true): void {\n if (instance.destroyed) throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished) throw new Error('Hash#digest() has already been called');\n}\n\n/** Asserts output is properly-sized byte array */\nexport function aoutput(out: any, instance: any): void {\n abytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error('digestInto() expects output buffer of length at least ' + min);\n }\n}\n\n/** Generic type encompassing 8/16/32-byte arrays - but not 64-byte. */\n// prettier-ignore\nexport type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array |\n Uint16Array | Int16Array | Uint32Array | Int32Array;\n\n/** Cast u8 / u16 / u32 to u8. */\nexport function u8(arr: TypedArray): Uint8Array {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n\n/** Cast u8 / u16 / u32 to u32. */\nexport function u32(arr: TypedArray): Uint32Array {\n return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n\n/** Zeroize a byte array. Warning: JS provides no guarantees. */\nexport function clean(...arrays: TypedArray[]): void {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n\n/** Create DataView of an array for easy byte-level manipulation. */\nexport function createView(arr: TypedArray): DataView {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n\n/** The rotate right (circular right shift) operation for uint32 */\nexport function rotr(word: number, shift: number): number {\n return (word << (32 - shift)) | (word >>> shift);\n}\n\n/** The rotate left (circular left shift) operation for uint32 */\nexport function rotl(word: number, shift: number): number {\n return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n\n/** Is current platform little-endian? Most are. Big-Endian platform: IBM */\nexport const isLE: boolean = /* @__PURE__ */ (() =>\n new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\n\n/** The byte swap operation for uint32 */\nexport function byteSwap(word: number): number {\n return (\n ((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff)\n );\n}\n/** Conditionally byte swap if on a big-endian platform */\nexport const swap8IfBE: (n: number) => number = isLE\n ? (n: number) => n\n : (n: number) => byteSwap(n);\n\n/** @deprecated */\nexport const byteSwapIfBE: typeof swap8IfBE = swap8IfBE;\n/** In place byte swap for Uint32Array */\nexport function byteSwap32(arr: Uint32Array): Uint32Array {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = byteSwap(arr[i]);\n }\n return arr;\n}\n\nexport const swap32IfBE: (u: Uint32Array) => Uint32Array = isLE\n ? (u: Uint32Array) => u\n : byteSwap32;\n\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin: boolean = /* @__PURE__ */ (() =>\n // @ts-ignore\n typeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) =>\n i.toString(16).padStart(2, '0')\n);\n\n/**\n * Convert byte array to hex string. Uses built-in function, when available.\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes: Uint8Array): string {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin) return bytes.toHex();\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 } as const;\nfunction asciiToBase16(ch: number): number | undefined {\n if (ch >= asciis._0 && ch <= asciis._9) return ch - asciis._0; // '2' => 50-48\n if (ch >= asciis.A && ch <= asciis.F) return ch - (asciis.A - 10); // 'B' => 66-(65-10)\n if (ch >= asciis.a && ch <= asciis.f) return ch - (asciis.a - 10); // 'b' => 98-(97-10)\n return;\n}\n\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex: string): Uint8Array {\n if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex);\n // @ts-ignore\n if (hasHexBuiltin) return Uint8Array.fromHex(hex);\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2) throw new Error('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new Error('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163\n }\n return array;\n}\n\n/**\n * There is no setImmediate in browser and setTimeout is slow.\n * Call of async fn will return Promise, which will be fullfiled only on\n * next scheduler queue processing step and this is exactly what we need.\n */\nexport const nextTick = async (): Promise<void> => {};\n\n/** Returns control to thread each 'tick' ms to avoid blocking. */\nexport async function asyncLoop(\n iters: number,\n tick: number,\n cb: (i: number) => void\n): Promise<void> {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick) continue;\n await nextTick();\n ts += diff;\n }\n}\n\n// Global symbols, but ts doesn't see them: https://github.com/microsoft/TypeScript/issues/31535\ndeclare const TextEncoder: any;\ndeclare const TextDecoder: any;\n\n/**\n * Converts string to bytes using UTF8 encoding.\n * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99])\n */\nexport function utf8ToBytes(str: string): Uint8Array {\n if (typeof str !== 'string') throw new Error('string expected');\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n\n/**\n * Converts bytes to string using UTF8 encoding.\n * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc'\n */\nexport function bytesToUtf8(bytes: Uint8Array): string {\n return new TextDecoder().decode(bytes);\n}\n\n/** Accepted input of hash functions. Strings are converted to byte arrays. */\nexport type Input = string | Uint8Array;\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nexport function toBytes(data: Input): Uint8Array {\n if (typeof data === 'string') data = utf8ToBytes(data);\n abytes(data);\n return data;\n}\n\n/** KDFs can accept string or Uint8Array for user convenience. */\nexport type KDFInput = string | Uint8Array;\n/**\n * Helper for KDFs: consumes uint8array or string.\n * When string is passed, does utf8 decoding, using TextDecoder.\n */\nexport function kdfInputToBytes(data: KDFInput): Uint8Array {\n if (typeof data === 'string') data = utf8ToBytes(data);\n abytes(data);\n return data;\n}\n\n/** Copies several Uint8Arrays into one. */\nexport function concatBytes(...arrays: Uint8Array[]): Uint8Array {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n\ntype EmptyObj = {};\nexport function checkOpts<T1 extends EmptyObj, T2 extends EmptyObj>(\n defaults: T1,\n opts?: T2\n): T1 & T2 {\n if (opts !== undefined && {}.toString.call(opts) !== '[object Object]')\n throw new Error('options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged as T1 & T2;\n}\n\n/** Hash interface. */\nexport type IHash = {\n (data: Uint8Array): Uint8Array;\n blockLen: number;\n outputLen: number;\n create: any;\n};\n\n/** For runtime check if class implements interface */\nexport abstract class Hash<T extends Hash<T>> {\n abstract blockLen: number; // Bytes per block\n abstract outputLen: number; // Bytes in output\n abstract update(buf: Input): this;\n // Writes digest into buf\n abstract digestInto(buf: Uint8Array): void;\n abstract digest(): Uint8Array;\n /**\n * Resets internal state. Makes Hash instance unusable.\n * Reset is impossible for keyed hashes if key is consumed into state. If digest is not consumed\n * by user, they will need to manually call `destroy()` when zeroing is necessary.\n */\n abstract destroy(): void;\n /**\n * Clones hash instance. Unsafe: doesn't check whether `to` is valid. Can be used as `clone()`\n * when no options are passed.\n * Reasons to use `_cloneInto` instead of clone: 1) performance 2) reuse instance => all internal\n * buffers are overwritten => causes buffer overwrite which is used for digest in some cases.\n * There are no guarantees for clean-up because it's impossible in JS.\n */\n abstract _cloneInto(to?: T): T;\n // Safe version that clones internal state\n abstract clone(): T;\n}\n\n/**\n * XOF: streaming API to read digest in chunks.\n * Same as 'squeeze' in keccak/k12 and 'seek' in blake3, but more generic name.\n * When hash used in XOF mode it is up to user to call '.destroy' afterwards, since we cannot\n * destroy state, next call can require more bytes.\n */\nexport type HashXOF<T extends Hash<T>> = Hash<T> & {\n xof(bytes: number): Uint8Array; // Read 'bytes' bytes from digest stream\n xofInto(buf: Uint8Array): Uint8Array; // read buf.length bytes from digest stream into buf\n};\n\n/** Hash function */\nexport type CHash = ReturnType<typeof createHasher>;\n/** Hash function with output */\nexport type CHashO = ReturnType<typeof createOptHasher>;\n/** XOF with output */\nexport type CHashXO = ReturnType<typeof createXOFer>;\n\n/** Wraps hash function, creating an interface on top of it */\nexport function createHasher<T extends Hash<T>>(\n hashCons: () => Hash<T>\n): {\n (msg: Input): Uint8Array;\n outputLen: number;\n blockLen: number;\n create(): Hash<T>;\n} {\n const hashC = (msg: Input): Uint8Array => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\n\nexport function createOptHasher<H extends Hash<H>, T extends Object>(\n hashCons: (opts?: T) => Hash<H>\n): {\n (msg: Input, opts?: T): Uint8Array;\n outputLen: number;\n blockLen: number;\n create(opts?: T): Hash<H>;\n} {\n const hashC = (msg: Input, opts?: T): Uint8Array => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({} as T);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts?: T) => hashCons(opts);\n return hashC;\n}\n\nexport function createXOFer<H extends HashXOF<H>, T extends Object>(\n hashCons: (opts?: T) => HashXOF<H>\n): {\n (msg: Input, opts?: T): Uint8Array;\n outputLen: number;\n blockLen: number;\n create(opts?: T): HashXOF<H>;\n} {\n const hashC = (msg: Input, opts?: T): Uint8Array => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({} as T);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts?: T) => hashCons(opts);\n return hashC;\n}\nexport const wrapConstructor: typeof createHasher = createHasher;\nexport const wrapConstructorWithOpts: typeof createOptHasher = createOptHasher;\nexport const wrapXOFConstructorWithOpts: typeof createXOFer = createXOFer;\n\n/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */\nexport function randomBytes(bytesLength = 32): Uint8Array {\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n // Legacy Node.js compatibility\n if (crypto && typeof crypto.randomBytes === 'function') {\n return Uint8Array.from(crypto.randomBytes(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n", "/**\n * Internal Merkle-Damgard hash utils.\n * @module\n */\nimport { type Input, Hash, abytes, aexists, aoutput, clean, createView, toBytes } from './utils.ts';\n\n/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */\nexport function setBigUint64(\n view: DataView,\n byteOffset: number,\n value: bigint,\n isLE: boolean\n): void {\n if (typeof view.setBigUint64 === 'function') return view.setBigUint64(byteOffset, value, isLE);\n const _32n = BigInt(32);\n const _u32_max = BigInt(0xffffffff);\n const wh = Number((value >> _32n) & _u32_max);\n const wl = Number(value & _u32_max);\n const h = isLE ? 4 : 0;\n const l = isLE ? 0 : 4;\n view.setUint32(byteOffset + h, wh, isLE);\n view.setUint32(byteOffset + l, wl, isLE);\n}\n\n/** Choice: a ? b : c */\nexport function Chi(a: number, b: number, c: number): number {\n return (a & b) ^ (~a & c);\n}\n\n/** Majority function, true if any two inputs is true. */\nexport function Maj(a: number, b: number, c: number): number {\n return (a & b) ^ (a & c) ^ (b & c);\n}\n\n/**\n * Merkle-Damgard hash construction base class.\n * Could be used to create MD5, RIPEMD, SHA1, SHA2.\n */\nexport abstract class HashMD<T extends HashMD<T>> extends Hash<T> {\n protected abstract process(buf: DataView, offset: number): void;\n protected abstract get(): number[];\n protected abstract set(...args: number[]): void;\n abstract destroy(): void;\n protected abstract roundClean(): void;\n\n readonly blockLen: number;\n readonly outputLen: number;\n readonly padOffset: number;\n readonly isLE: boolean;\n\n // For partial updates less than block size\n protected buffer: Uint8Array;\n protected view: DataView;\n protected finished = false;\n protected length = 0;\n protected pos = 0;\n protected destroyed = false;\n\n constructor(blockLen: number, outputLen: number, padOffset: number, isLE: boolean) {\n super();\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data: Input): this {\n aexists(this);\n data = toBytes(data);\n abytes(data);\n const { view, buffer, blockLen } = this;\n const len = data.length;\n for (let pos = 0; pos < len; ) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path: we have at least one block in input, cast it to view and process\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen) this.process(dataView, pos);\n continue;\n }\n buffer.set(data.subarray(pos, pos + take), this.pos);\n this.pos += take;\n pos += take;\n if (this.pos === blockLen) {\n this.process(view, 0);\n this.pos = 0;\n }\n }\n this.length += data.length;\n this.roundClean();\n return this;\n }\n digestInto(out: Uint8Array): void {\n aexists(this);\n aoutput(out, this);\n this.finished = true;\n // Padding\n // We can avoid allocation of buffer for padding completely if it\n // was previously not allocated here. But it won't change performance.\n const { buffer, view, blockLen, isLE } = this;\n let { pos } = this;\n // append the bit '1' to the message\n buffer[pos++] = 0b10000000;\n clean(this.buffer.subarray(pos));\n // we have less than padOffset left in buffer, so we cannot put length in\n // current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n pos = 0;\n }\n // Pad until full block byte with zeros\n for (let i = pos; i < blockLen; i++) buffer[i] = 0;\n // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that\n // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.\n // So we just write lowest 64 bits of that value.\n setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);\n this.process(view, 0);\n const oview = createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT\n if (len % 4) throw new Error('_sha2: outputLen should be aligned to 32bit');\n const outLen = len / 4;\n const state = this.get();\n if (outLen > state.length) throw new Error('_sha2: outputLen bigger than state');\n for (let i = 0; i < outLen; i++) oview.setUint32(4 * i, state[i], isLE);\n }\n digest(): Uint8Array {\n const { buffer, outputLen } = this;\n this.digestInto(buffer);\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneInto(to?: T): T {\n to ||= new (this.constructor as any)() as T;\n to.set(...this.get());\n const { blockLen, buffer, length, finished, destroyed, pos } = this;\n to.destroyed = destroyed;\n to.finished = finished;\n to.length = length;\n to.pos = pos;\n if (length % blockLen) to.buffer.set(buffer);\n return to;\n }\n clone(): T {\n return this._cloneInto();\n }\n}\n\n/**\n * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.\n * Check out `test/misc/sha2-gen-iv.js` for recomputation guide.\n */\n\n/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */\nexport const SHA256_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\n\n/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */\nexport const SHA224_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,\n]);\n\n/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */\nexport const SHA384_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([\n 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4,\n]);\n\n/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */\nexport const SHA512_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,\n]);\n", "/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and\n * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).\n * @module\n */\nimport { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from './_md.ts';\nimport * as u64 from './_u64.ts';\nimport { type CHash, clean, createHasher, rotr } from './utils.ts';\n\n/**\n * Round constants:\n * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311)\n */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n\n/** Reusable temporary buffer. \"W\" comes straight from spec. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\nexport class SHA256 extends HashMD<SHA256> {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n protected A: number = SHA256_IV[0] | 0;\n protected B: number = SHA256_IV[1] | 0;\n protected C: number = SHA256_IV[2] | 0;\n protected D: number = SHA256_IV[3] | 0;\n protected E: number = SHA256_IV[4] | 0;\n protected F: number = SHA256_IV[5] | 0;\n protected G: number = SHA256_IV[6] | 0;\n protected H: number = SHA256_IV[7] | 0;\n\n constructor(outputLen: number = 32) {\n super(64, outputLen, 8, false);\n }\n protected get(): [number, number, number, number, number, number, number, number] {\n const { A, B, C, D, E, F, G, H } = this;\n return [A, B, C, D, E, F, G, H];\n }\n // prettier-ignore\n protected set(\n A: number, B: number, C: number, D: number, E: number, F: number, G: number, H: number\n ): void {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n this.E = E | 0;\n this.F = F | 0;\n this.G = G | 0;\n this.H = H | 0;\n }\n protected process(view: DataView, offset: number): void {\n // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) SHA256_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 64; i++) {\n const W15 = SHA256_W[i - 15];\n const W2 = SHA256_W[i - 2];\n const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3);\n const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10);\n SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;\n }\n // Compression function main loop, 64 rounds\n let { A, B, C, D, E, F, G, H } = this;\n for (let i = 0; i < 64; i++) {\n const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);\n const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);\n const T2 = (sigma0 + Maj(A, B, C)) | 0;\n H = G;\n G = F;\n F = E;\n E = (D + T1) | 0;\n D = C;\n C = B;\n B = A;\n A = (T1 + T2) | 0;\n }\n // Add the compressed chunk to the current hash value\n A = (A + this.A) | 0;\n B = (B + this.B) | 0;\n C = (C + this.C) | 0;\n D = (D + this.D) | 0;\n E = (E + this.E) | 0;\n F = (F + this.F) | 0;\n G = (G + this.G) | 0;\n H = (H + this.H) | 0;\n this.set(A, B, C, D, E, F, G, H);\n }\n protected roundClean(): void {\n clean(SHA256_W);\n }\n destroy(): void {\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n\nexport class SHA224 extends SHA256 {\n protected A: number = SHA224_IV[0] | 0;\n protected B: number = SHA224_IV[1] | 0;\n protected C: number = SHA224_IV[2] | 0;\n protected D: number = SHA224_IV[3] | 0;\n protected E: number = SHA224_IV[4] | 0;\n protected F: number = SHA224_IV[5] | 0;\n protected G: number = SHA224_IV[6] | 0;\n protected H: number = SHA224_IV[7] | 0;\n constructor() {\n super(28);\n }\n}\n\n// SHA2-512 is slower than sha256 in js because u64 operations are slow.\n\n// Round contants\n// First 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409\n// prettier-ignore\nconst K512 = /* @__PURE__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\nconst SHA512_Kh = /* @__PURE__ */ (() => K512[0])();\nconst SHA512_Kl = /* @__PURE__ */ (() => K512[1])();\n\n// Reusable temporary buffers\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\n\nexport class SHA512 extends HashMD<SHA512> {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n // h -- high 32 bits, l -- low 32 bits\n protected Ah: number = SHA512_IV[0] | 0;\n protected Al: number = SHA512_IV[1] | 0;\n protected Bh: number = SHA512_IV[2] | 0;\n protected Bl: number = SHA512_IV[3] | 0;\n protected Ch: number = SHA512_IV[4] | 0;\n protected Cl: number = SHA512_IV[5] | 0;\n protected Dh: number = SHA512_IV[6] | 0;\n protected Dl: number = SHA512_IV[7] | 0;\n protected Eh: number = SHA512_IV[8] | 0;\n protected El: number = SHA512_IV[9] | 0;\n protected Fh: number = SHA512_IV[10] | 0;\n protected Fl: number = SHA512_IV[11] | 0;\n protected Gh: number = SHA512_IV[12] | 0;\n protected Gl: number = SHA512_IV[13] | 0;\n protected Hh: number = SHA512_IV[14] | 0;\n protected Hl: number = SHA512_IV[15] | 0;\n\n constructor(outputLen: number = 64) {\n super(128, outputLen, 16, false);\n }\n // prettier-ignore\n protected get(): [\n number, number, number, number, number, number, number, number,\n number, number, number, number, number, number, number, number\n ] {\n const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n }\n // prettier-ignore\n protected set(\n Ah: number, Al: number, Bh: number, Bl: number, Ch: number, Cl: number, Dh: number, Dl: number,\n Eh: number, El: number, Fh: number, Fl: number, Gh: number, Gl: number, Hh: number, Hl: number\n ): void {\n this.Ah = Ah | 0;\n this.Al = Al | 0;\n this.Bh = Bh | 0;\n this.Bl = Bl | 0;\n this.Ch = Ch | 0;\n this.Cl = Cl | 0;\n this.Dh = Dh | 0;\n this.Dl = Dl | 0;\n this.Eh = Eh | 0;\n this.El = El | 0;\n this.Fh = Fh | 0;\n this.Fl = Fl | 0;\n this.Gh = Gh | 0;\n this.Gl = Gl | 0;\n this.Hh = Hh | 0;\n this.Hl = Hl | 0;\n }\n protected process(view: DataView, offset: number): void {\n // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) {\n SHA512_W_H[i] = view.getUint32(offset);\n SHA512_W_L[i] = view.getUint32((offset += 4));\n }\n for (let i = 16; i < 80; i++) {\n // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n const W15h = SHA512_W_H[i - 15] | 0;\n const W15l = SHA512_W_L[i - 15] | 0;\n const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n const W2h = SHA512_W_H[i - 2] | 0;\n const W2l = SHA512_W_L[i - 2] | 0;\n const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n SHA512_W_H[i] = SUMh | 0;\n SHA512_W_L[i] = SUMl | 0;\n }\n let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n // Compression function main loop, 80 rounds\n for (let i = 0; i < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n const T1l = T1ll | 0;\n // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n Hh = Gh | 0;\n Hl = Gl | 0;\n Gh = Fh | 0;\n Gl = Fl | 0;\n Fh = Eh | 0;\n Fl = El | 0;\n ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n Dh = Ch | 0;\n Dl = Cl | 0;\n Ch = Bh | 0;\n Cl = Bl | 0;\n Bh = Ah | 0;\n Bl = Al | 0;\n const All = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n Al = All | 0;\n }\n // Add the compressed chunk to the current hash value\n ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n }\n protected roundClean(): void {\n clean(SHA512_W_H, SHA512_W_L);\n }\n destroy(): void {\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n }\n}\n\nexport class SHA384 extends SHA512 {\n protected Ah: number = SHA384_IV[0] | 0;\n protected Al: number = SHA384_IV[1] | 0;\n protected Bh: number = SHA384_IV[2] | 0;\n protected Bl: number = SHA384_IV[3] | 0;\n protected Ch: number = SHA384_IV[4] | 0;\n protected Cl: number = SHA384_IV[5] | 0;\n protected Dh: number = SHA384_IV[6] | 0;\n protected Dl: number = SHA384_IV[7] | 0;\n protected Eh: number = SHA384_IV[8] | 0;\n protected El: number = SHA384_IV[9] | 0;\n protected Fh: number = SHA384_IV[10] | 0;\n protected Fl: number = SHA384_IV[11] | 0;\n protected Gh: number = SHA384_IV[12] | 0;\n protected Gl: number = SHA384_IV[13] | 0;\n protected Hh: number = SHA384_IV[14] | 0;\n protected Hl: number = SHA384_IV[15] | 0;\n\n constructor() {\n super(48);\n }\n}\n\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n * See `test/misc/sha2-gen-iv.js`.\n */\n\n/** SHA512/224 IV */\nconst T224_IV = /* @__PURE__ */ Uint32Array.from([\n 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,\n 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1,\n]);\n\n/** SHA512/256 IV */\nconst T256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd,\n 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2,\n]);\n\nexport class SHA512_224 extends SHA512 {\n protected Ah: number = T224_IV[0] | 0;\n protected Al: number = T224_IV[1] | 0;\n protected Bh: number = T224_IV[2] | 0;\n protected Bl: number = T224_IV[3] | 0;\n protected Ch: number = T224_IV[4] | 0;\n protected Cl: number = T224_IV[5] | 0;\n protected Dh: number = T224_IV[6] | 0;\n protected Dl: number = T224_IV[7] | 0;\n protected Eh: number = T224_IV[8] | 0;\n protected El: number = T224_IV[9] | 0;\n protected Fh: number = T224_IV[10] | 0;\n protected Fl: number = T224_IV[11] | 0;\n protected Gh: number = T224_IV[12] | 0;\n protected Gl: number = T224_IV[13] | 0;\n protected Hh: number = T224_IV[14] | 0;\n protected Hl: number = T224_IV[15] | 0;\n\n constructor() {\n super(28);\n }\n}\n\nexport class SHA512_256 extends SHA512 {\n protected Ah: number = T256_IV[0] | 0;\n protected Al: number = T256_IV[1] | 0;\n protected Bh: number = T256_IV[2] | 0;\n protected Bl: number = T256_IV[3] | 0;\n protected Ch: number = T256_IV[4] | 0;\n protected Cl: number = T256_IV[5] | 0;\n protected Dh: number = T256_IV[6] | 0;\n protected Dl: number = T256_IV[7] | 0;\n protected Eh: number = T256_IV[8] | 0;\n protected El: number = T256_IV[9] | 0;\n protected Fh: number = T256_IV[10] | 0;\n protected Fl: number = T256_IV[11] | 0;\n protected Gh: number = T256_IV[12] | 0;\n protected Gl: number = T256_IV[13] | 0;\n protected Hh: number = T256_IV[14] | 0;\n protected Hl: number = T256_IV[15] | 0;\n\n constructor() {\n super(32);\n }\n}\n\n/**\n * SHA2-256 hash function from RFC 4634.\n *\n * It is the fastest JS hash, even faster than Blake3.\n * To break sha256 using birthday attack, attackers need to try 2^128 hashes.\n * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n */\nexport const sha256: CHash = /* @__PURE__ */ createHasher(() => new SHA256());\n/** SHA2-224 hash function from RFC 4634 */\nexport const sha224: CHash = /* @__PURE__ */ createHasher(() => new SHA224());\n\n/** SHA2-512 hash function from RFC 4634. */\nexport const sha512: CHash = /* @__PURE__ */ createHasher(() => new SHA512());\n/** SHA2-384 hash function from RFC 4634. */\nexport const sha384: CHash = /* @__PURE__ */ createHasher(() => new SHA384());\n\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexport const sha512_256: CHash = /* @__PURE__ */ createHasher(() => new SHA512_256());\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexport const sha512_224: CHash = /* @__PURE__ */ createHasher(() => new SHA512_224());\n", "import {\n Canister,\n createServices,\n fromDefinedNullable,\n fromNullable,\n type QueryParams,\n} from \"@dfinity/utils\";\nimport type {\n BuyerState,\n GetAutoFinalizationStatusResponse,\n GetBuyerStateRequest,\n GetDerivedStateResponse,\n GetLifecycleResponse,\n GetSaleParametersResponse,\n GetStateResponse,\n RefreshBuyerTokensRequest,\n RefreshBuyerTokensResponse,\n _SERVICE as SnsSwapService,\n Ticket,\n} from \"./candid/sns_swap\";\nimport { idlFactory as certifiedIdlFactory } from \"./candid/sns_swap.certified.idl\";\nimport { idlFactory } from \"./candid/sns_swap.idl\";\nimport { toNewSaleTicketRequest } from \"./converters/swap.converters\";\nimport { UnsupportedMethodError } from \"./errors/common.errors\";\nimport {\n SnsSwapGetOpenTicketError,\n SnsSwapNewTicketError,\n} from \"./errors/swap.errors\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\nimport type { NewSaleTicketParams } from \"./types/swap.params\";\nimport { isMethodNotSupportedError } from \"./utils/error.utils\";\n\nexport class SnsSwapCanister extends Canister<SnsSwapService> {\n static create(options: SnsCanisterOptions<SnsSwapService>) {\n const { service, certifiedService, canisterId } =\n createServices<SnsSwapService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new SnsSwapCanister(canisterId, service, certifiedService);\n }\n\n /**\n * Get the state of the swap\n */\n state = (params: QueryParams): Promise<GetStateResponse> =>\n this.caller(params).get_state({});\n\n /**\n * Notify of the payment failure to remove the ticket\n */\n notifyPaymentFailure = async (): Promise<Ticket | undefined> => {\n const { ticket } = await this.caller({\n certified: true,\n }).notify_payment_failure({});\n return fromNullable(ticket);\n };\n\n /**\n * Notify of the user participating in the swap\n */\n notifyParticipation = async (\n params: RefreshBuyerTokensRequest,\n ): Promise<RefreshBuyerTokensResponse> =>\n await this.caller({ certified: true }).refresh_buyer_tokens(params);\n\n /**\n * Get user commitment\n */\n getUserCommitment = async (\n params: GetBuyerStateRequest & QueryParams,\n ): Promise<BuyerState | undefined> => {\n const { buyer_state } = await this.caller({\n certified: params.certified,\n }).get_buyer_state({ principal_id: params.principal_id });\n return fromNullable(buyer_state);\n };\n\n /**\n * Get sale buyers state\n */\n getDerivedState = ({\n certified,\n }: QueryParams): Promise<GetDerivedStateResponse> =>\n this.caller({ certified }).get_derived_state({});\n\n /**\n * Get sale parameters\n */\n getSaleParameters = ({\n certified,\n }: QueryParams): Promise<GetSaleParametersResponse> =>\n this.caller({ certified }).get_sale_parameters({});\n\n /**\n * Return a sale ticket if created and not yet removed (payment flow)\n */\n getOpenTicket = async (params: QueryParams): Promise<Ticket | undefined> => {\n const { result: response } = await this.caller({\n certified: params.certified,\n }).get_open_ticket({});\n const result = fromDefinedNullable(response);\n\n if (\"Ok\" in result) {\n return fromNullable(result.Ok.ticket);\n }\n\n const errorType = fromDefinedNullable(result?.Err?.error_type);\n throw new SnsSwapGetOpenTicketError(errorType);\n };\n\n /**\n * Create a sale ticket (payment flow)\n */\n newSaleTicket = async (params: NewSaleTicketParams): Promise<Ticket> => {\n const request = toNewSaleTicketRequest(params);\n const { result: response } = await this.caller({\n certified: true,\n }).new_sale_ticket(request);\n\n const result = fromDefinedNullable(response);\n\n if (\"Ok\" in result) {\n return fromDefinedNullable(result.Ok.ticket);\n }\n\n const errorData = result.Err;\n const error = new SnsSwapNewTicketError({\n errorType: errorData.error_type,\n invalidUserAmount: fromNullable(errorData.invalid_user_amount ?? []),\n existingTicket: fromNullable(errorData.existing_ticket ?? []),\n });\n\n throw error;\n };\n\n /**\n * Get sale lifecycle state\n */\n getLifecycle = (params: QueryParams): Promise<GetLifecycleResponse> =>\n this.caller(params).get_lifecycle({});\n\n /**\n * Get sale lifecycle state\n */\n getFinalizationStatus = async (\n params: QueryParams,\n ): Promise<GetAutoFinalizationStatusResponse> => {\n try {\n return await this.caller(params).get_auto_finalization_status({});\n } catch (error) {\n // Throw a custom error if the method is not supported by the canister\n if (isMethodNotSupportedError(error)) {\n throw new UnsupportedMethodError(\"getFinalizationStatus\");\n }\n throw error;\n }\n };\n}\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.0.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({ IDL }) => {\n const NeuronBasketConstructionParameters = IDL.Record({\n dissolve_delay_interval_seconds: IDL.Nat64,\n count: IDL.Nat64,\n });\n const LinearScalingCoefficient = IDL.Record({\n slope_numerator: IDL.Opt(IDL.Nat64),\n intercept_icp_e8s: IDL.Opt(IDL.Nat64),\n from_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n slope_denominator: IDL.Opt(IDL.Nat64),\n to_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n });\n const IdealMatchedParticipationFunction = IDL.Record({\n serialized_representation: IDL.Opt(IDL.Text),\n });\n const NeuronsFundParticipationConstraints = IDL.Record({\n coefficient_intervals: IDL.Vec(LinearScalingCoefficient),\n max_neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n min_direct_participation_threshold_icp_e8s: IDL.Opt(IDL.Nat64),\n ideal_matched_participation_function: IDL.Opt(\n IdealMatchedParticipationFunction,\n ),\n });\n const Countries = IDL.Record({ iso_codes: IDL.Vec(IDL.Text) });\n const Init = IDL.Record({\n nns_proposal_id: IDL.Opt(IDL.Nat64),\n sns_root_canister_id: IDL.Text,\n neurons_fund_participation: IDL.Opt(IDL.Bool),\n min_participant_icp_e8s: IDL.Opt(IDL.Nat64),\n neuron_basket_construction_parameters: IDL.Opt(\n NeuronBasketConstructionParameters,\n ),\n fallback_controller_principal_ids: IDL.Vec(IDL.Text),\n max_icp_e8s: IDL.Opt(IDL.Nat64),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n confirmation_text: IDL.Opt(IDL.Text),\n swap_start_timestamp_seconds: IDL.Opt(IDL.Nat64),\n swap_due_timestamp_seconds: IDL.Opt(IDL.Nat64),\n min_participants: IDL.Opt(IDL.Nat32),\n sns_token_e8s: IDL.Opt(IDL.Nat64),\n nns_governance_canister_id: IDL.Text,\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n icp_ledger_canister_id: IDL.Text,\n sns_ledger_canister_id: IDL.Text,\n neurons_fund_participation_constraints: IDL.Opt(\n NeuronsFundParticipationConstraints,\n ),\n should_auto_finalize: IDL.Opt(IDL.Bool),\n max_participant_icp_e8s: IDL.Opt(IDL.Nat64),\n sns_governance_canister_id: IDL.Text,\n min_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n restricted_countries: IDL.Opt(Countries),\n min_icp_e8s: IDL.Opt(IDL.Nat64),\n max_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n });\n const ErrorRefundIcpRequest = IDL.Record({\n source_principal_id: IDL.Opt(IDL.Principal),\n });\n const Ok = IDL.Record({ block_height: IDL.Opt(IDL.Nat64) });\n const Err = IDL.Record({\n description: IDL.Opt(IDL.Text),\n error_type: IDL.Opt(IDL.Int32),\n });\n const Result = IDL.Variant({ Ok: Ok, Err: Err });\n const ErrorRefundIcpResponse = IDL.Record({ result: IDL.Opt(Result) });\n const CanisterCallError = IDL.Record({\n code: IDL.Opt(IDL.Int32),\n description: IDL.Text,\n });\n const FailedUpdate = IDL.Record({\n err: IDL.Opt(CanisterCallError),\n dapp_canister_id: IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n failed_updates: IDL.Vec(FailedUpdate),\n });\n const Possibility = IDL.Variant({\n Ok: SetDappControllersResponse,\n Err: CanisterCallError,\n });\n const SetDappControllersCallResult = IDL.Record({\n possibility: IDL.Opt(Possibility),\n });\n const SweepResult = IDL.Record({\n failure: IDL.Nat32,\n skipped: IDL.Nat32,\n invalid: IDL.Nat32,\n success: IDL.Nat32,\n global_failures: IDL.Nat32,\n });\n const GovernanceError = IDL.Record({\n error_message: IDL.Text,\n error_type: IDL.Int32,\n });\n const Response = IDL.Record({\n governance_error: IDL.Opt(GovernanceError),\n });\n const Possibility_1 = IDL.Variant({\n Ok: Response,\n Err: CanisterCallError,\n });\n const SettleCommunityFundParticipationResult = IDL.Record({\n possibility: IDL.Opt(Possibility_1),\n });\n const Ok_1 = IDL.Record({\n neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n neurons_fund_neurons_count: IDL.Opt(IDL.Nat64),\n });\n const Error = IDL.Record({ message: IDL.Opt(IDL.Text) });\n const Possibility_2 = IDL.Variant({ Ok: Ok_1, Err: Error });\n const SettleNeuronsFundParticipationResult = IDL.Record({\n possibility: IDL.Opt(Possibility_2),\n });\n const Possibility_3 = IDL.Variant({\n Ok: IDL.Record({}),\n Err: CanisterCallError,\n });\n const SetModeCallResult = IDL.Record({\n possibility: IDL.Opt(Possibility_3),\n });\n const FinalizeSwapResponse = IDL.Record({\n set_dapp_controllers_call_result: IDL.Opt(SetDappControllersCallResult),\n create_sns_neuron_recipes_result: IDL.Opt(SweepResult),\n settle_community_fund_participation_result: IDL.Opt(\n SettleCommunityFundParticipationResult,\n ),\n error_message: IDL.Opt(IDL.Text),\n settle_neurons_fund_participation_result: IDL.Opt(\n SettleNeuronsFundParticipationResult,\n ),\n set_mode_call_result: IDL.Opt(SetModeCallResult),\n sweep_icp_result: IDL.Opt(SweepResult),\n claim_neuron_result: IDL.Opt(SweepResult),\n sweep_sns_result: IDL.Opt(SweepResult),\n });\n const GetAutoFinalizationStatusResponse = IDL.Record({\n auto_finalize_swap_response: IDL.Opt(FinalizeSwapResponse),\n has_auto_finalize_been_attempted: IDL.Opt(IDL.Bool),\n is_auto_finalize_enabled: IDL.Opt(IDL.Bool),\n });\n const GetBuyerStateRequest = IDL.Record({\n principal_id: IDL.Opt(IDL.Principal),\n });\n const TransferableAmount = IDL.Record({\n transfer_fee_paid_e8s: IDL.Opt(IDL.Nat64),\n transfer_start_timestamp_seconds: IDL.Nat64,\n amount_e8s: IDL.Nat64,\n amount_transferred_e8s: IDL.Opt(IDL.Nat64),\n transfer_success_timestamp_seconds: IDL.Nat64,\n });\n const BuyerState = IDL.Record({\n icp: IDL.Opt(TransferableAmount),\n has_created_neuron_recipes: IDL.Opt(IDL.Bool),\n });\n const GetBuyerStateResponse = IDL.Record({\n buyer_state: IDL.Opt(BuyerState),\n });\n const GetBuyersTotalResponse = IDL.Record({ buyers_total: IDL.Nat64 });\n const MemoryMetrics = IDL.Record({\n wasm_binary_size: IDL.Opt(IDL.Nat),\n wasm_chunk_store_size: IDL.Opt(IDL.Nat),\n canister_history_size: IDL.Opt(IDL.Nat),\n stable_memory_size: IDL.Opt(IDL.Nat),\n snapshots_size: IDL.Opt(IDL.Nat),\n wasm_memory_size: IDL.Opt(IDL.Nat),\n global_memory_size: IDL.Opt(IDL.Nat),\n custom_sections_size: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusType = IDL.Variant({\n stopped: IDL.Null,\n stopping: IDL.Null,\n running: IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n freezing_threshold: IDL.Nat,\n wasm_memory_threshold: IDL.Opt(IDL.Nat),\n controllers: IDL.Vec(IDL.Principal),\n wasm_memory_limit: IDL.Opt(IDL.Nat),\n memory_allocation: IDL.Nat,\n compute_allocation: IDL.Nat,\n });\n const QueryStats = IDL.Record({\n response_payload_bytes_total: IDL.Opt(IDL.Nat),\n num_instructions_total: IDL.Opt(IDL.Nat),\n num_calls_total: IDL.Opt(IDL.Nat),\n request_payload_bytes_total: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusResultV2 = IDL.Record({\n memory_metrics: IDL.Opt(MemoryMetrics),\n status: CanisterStatusType,\n memory_size: IDL.Nat,\n cycles: IDL.Nat,\n settings: DefiniteCanisterSettingsArgs,\n query_stats: IDL.Opt(QueryStats),\n idle_cycles_burned_per_day: IDL.Nat,\n module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetDerivedStateResponse = IDL.Record({\n sns_tokens_per_icp: IDL.Opt(IDL.Float64),\n buyer_total_icp_e8s: IDL.Opt(IDL.Nat64),\n cf_participant_count: IDL.Opt(IDL.Nat64),\n neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n direct_participant_count: IDL.Opt(IDL.Nat64),\n cf_neuron_count: IDL.Opt(IDL.Nat64),\n });\n const GetInitResponse = IDL.Record({ init: IDL.Opt(Init) });\n const GetLifecycleResponse = IDL.Record({\n decentralization_sale_open_timestamp_seconds: IDL.Opt(IDL.Nat64),\n lifecycle: IDL.Opt(IDL.Int32),\n decentralization_swap_termination_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Icrc1Account = IDL.Record({\n owner: IDL.Opt(IDL.Principal),\n subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const Ticket = IDL.Record({\n creation_time: IDL.Nat64,\n ticket_id: IDL.Nat64,\n account: IDL.Opt(Icrc1Account),\n amount_icp_e8s: IDL.Nat64,\n });\n const Ok_2 = IDL.Record({ ticket: IDL.Opt(Ticket) });\n const Err_1 = IDL.Record({ error_type: IDL.Opt(IDL.Int32) });\n const Result_1 = IDL.Variant({ Ok: Ok_2, Err: Err_1 });\n const GetOpenTicketResponse = IDL.Record({ result: IDL.Opt(Result_1) });\n const Params = IDL.Record({\n min_participant_icp_e8s: IDL.Nat64,\n neuron_basket_construction_parameters: IDL.Opt(\n NeuronBasketConstructionParameters,\n ),\n max_icp_e8s: IDL.Nat64,\n swap_due_timestamp_seconds: IDL.Nat64,\n min_participants: IDL.Nat32,\n sns_token_e8s: IDL.Nat64,\n sale_delay_seconds: IDL.Opt(IDL.Nat64),\n max_participant_icp_e8s: IDL.Nat64,\n min_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n min_icp_e8s: IDL.Nat64,\n max_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n });\n const GetSaleParametersResponse = IDL.Record({ params: IDL.Opt(Params) });\n const NeuronId = IDL.Record({ id: IDL.Vec(IDL.Nat8) });\n const NeuronAttributes = IDL.Record({\n dissolve_delay_seconds: IDL.Nat64,\n memo: IDL.Nat64,\n followees: IDL.Vec(NeuronId),\n });\n const Principals = IDL.Record({ principals: IDL.Vec(IDL.Principal) });\n const CfInvestment = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n hotkey_principal: IDL.Text,\n hotkeys: IDL.Opt(Principals),\n nns_neuron_id: IDL.Nat64,\n });\n const DirectInvestment = IDL.Record({ buyer_principal: IDL.Text });\n const Investor = IDL.Variant({\n CommunityFund: CfInvestment,\n Direct: DirectInvestment,\n });\n const SnsNeuronRecipe = IDL.Record({\n sns: IDL.Opt(TransferableAmount),\n claimed_status: IDL.Opt(IDL.Int32),\n neuron_attributes: IDL.Opt(NeuronAttributes),\n investor: IDL.Opt(Investor),\n });\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const CfNeuron = IDL.Record({\n has_created_neuron_recipes: IDL.Opt(IDL.Bool),\n hotkeys: IDL.Opt(Principals),\n nns_neuron_id: IDL.Nat64,\n amount_icp_e8s: IDL.Nat64,\n });\n const CfParticipant = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n hotkey_principal: IDL.Text,\n cf_neurons: IDL.Vec(CfNeuron),\n });\n const Swap = IDL.Record({\n auto_finalize_swap_response: IDL.Opt(FinalizeSwapResponse),\n neuron_recipes: IDL.Vec(SnsNeuronRecipe),\n next_ticket_id: IDL.Opt(IDL.Nat64),\n decentralization_sale_open_timestamp_seconds: IDL.Opt(IDL.Nat64),\n finalize_swap_in_progress: IDL.Opt(IDL.Bool),\n timers: IDL.Opt(Timers),\n cf_participants: IDL.Vec(CfParticipant),\n init: IDL.Opt(Init),\n already_tried_to_auto_finalize: IDL.Opt(IDL.Bool),\n neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n purge_old_tickets_last_completion_timestamp_nanoseconds: IDL.Opt(IDL.Nat64),\n direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n lifecycle: IDL.Int32,\n purge_old_tickets_next_principal: IDL.Opt(IDL.Vec(IDL.Nat8)),\n decentralization_swap_termination_timestamp_seconds: IDL.Opt(IDL.Nat64),\n buyers: IDL.Vec(IDL.Tuple(IDL.Text, BuyerState)),\n params: IDL.Opt(Params),\n open_sns_token_swap_proposal_id: IDL.Opt(IDL.Nat64),\n });\n const DerivedState = IDL.Record({\n sns_tokens_per_icp: IDL.Float32,\n buyer_total_icp_e8s: IDL.Nat64,\n cf_participant_count: IDL.Opt(IDL.Nat64),\n neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n direct_participant_count: IDL.Opt(IDL.Nat64),\n cf_neuron_count: IDL.Opt(IDL.Nat64),\n });\n const GetStateResponse = IDL.Record({\n swap: IDL.Opt(Swap),\n derived: IDL.Opt(DerivedState),\n });\n const GetTimersResponse = IDL.Record({ timers: IDL.Opt(Timers) });\n const ListCommunityFundParticipantsRequest = IDL.Record({\n offset: IDL.Opt(IDL.Nat64),\n limit: IDL.Opt(IDL.Nat32),\n });\n const ListCommunityFundParticipantsResponse = IDL.Record({\n cf_participants: IDL.Vec(CfParticipant),\n });\n const ListDirectParticipantsRequest = IDL.Record({\n offset: IDL.Opt(IDL.Nat32),\n limit: IDL.Opt(IDL.Nat32),\n });\n const Participant = IDL.Record({\n participation: IDL.Opt(BuyerState),\n participant_id: IDL.Opt(IDL.Principal),\n });\n const ListDirectParticipantsResponse = IDL.Record({\n participants: IDL.Vec(Participant),\n });\n const ListSnsNeuronRecipesRequest = IDL.Record({\n offset: IDL.Opt(IDL.Nat64),\n limit: IDL.Opt(IDL.Nat32),\n });\n const ListSnsNeuronRecipesResponse = IDL.Record({\n sns_neuron_recipes: IDL.Vec(SnsNeuronRecipe),\n });\n const NewSaleTicketRequest = IDL.Record({\n subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),\n amount_icp_e8s: IDL.Nat64,\n });\n const InvalidUserAmount = IDL.Record({\n min_amount_icp_e8s_included: IDL.Nat64,\n max_amount_icp_e8s_included: IDL.Nat64,\n });\n const Err_2 = IDL.Record({\n invalid_user_amount: IDL.Opt(InvalidUserAmount),\n existing_ticket: IDL.Opt(Ticket),\n error_type: IDL.Int32,\n });\n const Result_2 = IDL.Variant({ Ok: Ok_2, Err: Err_2 });\n const NewSaleTicketResponse = IDL.Record({ result: IDL.Opt(Result_2) });\n const RefreshBuyerTokensRequest = IDL.Record({\n confirmation_text: IDL.Opt(IDL.Text),\n buyer: IDL.Text,\n });\n const RefreshBuyerTokensResponse = IDL.Record({\n icp_accepted_participation_e8s: IDL.Nat64,\n icp_ledger_account_balance_e8s: IDL.Nat64,\n });\n\n return IDL.Service({\n error_refund_icp: IDL.Func(\n [ErrorRefundIcpRequest],\n [ErrorRefundIcpResponse],\n [],\n ),\n finalize_swap: IDL.Func([IDL.Record({})], [FinalizeSwapResponse], []),\n get_auto_finalization_status: IDL.Func(\n [IDL.Record({})],\n [GetAutoFinalizationStatusResponse],\n [],\n ),\n get_buyer_state: IDL.Func(\n [GetBuyerStateRequest],\n [GetBuyerStateResponse],\n [],\n ),\n get_buyers_total: IDL.Func([IDL.Record({})], [GetBuyersTotalResponse], []),\n get_canister_status: IDL.Func(\n [IDL.Record({})],\n [CanisterStatusResultV2],\n [],\n ),\n get_derived_state: IDL.Func(\n [IDL.Record({})],\n [GetDerivedStateResponse],\n [],\n ),\n get_init: IDL.Func([IDL.Record({})], [GetInitResponse], []),\n get_lifecycle: IDL.Func([IDL.Record({})], [GetLifecycleResponse], []),\n get_open_ticket: IDL.Func([IDL.Record({})], [GetOpenTicketResponse], []),\n get_sale_parameters: IDL.Func(\n [IDL.Record({})],\n [GetSaleParametersResponse],\n [],\n ),\n get_state: IDL.Func([IDL.Record({})], [GetStateResponse], []),\n get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], []),\n list_community_fund_participants: IDL.Func(\n [ListCommunityFundParticipantsRequest],\n [ListCommunityFundParticipantsResponse],\n [],\n ),\n list_direct_participants: IDL.Func(\n [ListDirectParticipantsRequest],\n [ListDirectParticipantsResponse],\n [],\n ),\n list_sns_neuron_recipes: IDL.Func(\n [ListSnsNeuronRecipesRequest],\n [ListSnsNeuronRecipesResponse],\n [],\n ),\n new_sale_ticket: IDL.Func(\n [NewSaleTicketRequest],\n [NewSaleTicketResponse],\n [],\n ),\n notify_payment_failure: IDL.Func([IDL.Record({})], [Ok_2], []),\n refresh_buyer_tokens: IDL.Func(\n [RefreshBuyerTokensRequest],\n [RefreshBuyerTokensResponse],\n [],\n ),\n reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], []),\n });\n};\n\nexport const init = ({ IDL }) => {\n const NeuronBasketConstructionParameters = IDL.Record({\n dissolve_delay_interval_seconds: IDL.Nat64,\n count: IDL.Nat64,\n });\n const LinearScalingCoefficient = IDL.Record({\n slope_numerator: IDL.Opt(IDL.Nat64),\n intercept_icp_e8s: IDL.Opt(IDL.Nat64),\n from_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n slope_denominator: IDL.Opt(IDL.Nat64),\n to_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n });\n const IdealMatchedParticipationFunction = IDL.Record({\n serialized_representation: IDL.Opt(IDL.Text),\n });\n const NeuronsFundParticipationConstraints = IDL.Record({\n coefficient_intervals: IDL.Vec(LinearScalingCoefficient),\n max_neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n min_direct_participation_threshold_icp_e8s: IDL.Opt(IDL.Nat64),\n ideal_matched_participation_function: IDL.Opt(\n IdealMatchedParticipationFunction,\n ),\n });\n const Countries = IDL.Record({ iso_codes: IDL.Vec(IDL.Text) });\n const Init = IDL.Record({\n nns_proposal_id: IDL.Opt(IDL.Nat64),\n sns_root_canister_id: IDL.Text,\n neurons_fund_participation: IDL.Opt(IDL.Bool),\n min_participant_icp_e8s: IDL.Opt(IDL.Nat64),\n neuron_basket_construction_parameters: IDL.Opt(\n NeuronBasketConstructionParameters,\n ),\n fallback_controller_principal_ids: IDL.Vec(IDL.Text),\n max_icp_e8s: IDL.Opt(IDL.Nat64),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n confirmation_text: IDL.Opt(IDL.Text),\n swap_start_timestamp_seconds: IDL.Opt(IDL.Nat64),\n swap_due_timestamp_seconds: IDL.Opt(IDL.Nat64),\n min_participants: IDL.Opt(IDL.Nat32),\n sns_token_e8s: IDL.Opt(IDL.Nat64),\n nns_governance_canister_id: IDL.Text,\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n icp_ledger_canister_id: IDL.Text,\n sns_ledger_canister_id: IDL.Text,\n neurons_fund_participation_constraints: IDL.Opt(\n NeuronsFundParticipationConstraints,\n ),\n should_auto_finalize: IDL.Opt(IDL.Bool),\n max_participant_icp_e8s: IDL.Opt(IDL.Nat64),\n sns_governance_canister_id: IDL.Text,\n min_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n restricted_countries: IDL.Opt(Countries),\n min_icp_e8s: IDL.Opt(IDL.Nat64),\n max_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n });\n\n return [Init];\n};\n", "/* eslint-disable */\n\n// @ts-nocheck\n\n// This file was automatically generated by @icp-sdk/bindgen@0.2.0.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nexport const idlFactory = ({ IDL }) => {\n const NeuronBasketConstructionParameters = IDL.Record({\n dissolve_delay_interval_seconds: IDL.Nat64,\n count: IDL.Nat64,\n });\n const LinearScalingCoefficient = IDL.Record({\n slope_numerator: IDL.Opt(IDL.Nat64),\n intercept_icp_e8s: IDL.Opt(IDL.Nat64),\n from_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n slope_denominator: IDL.Opt(IDL.Nat64),\n to_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n });\n const IdealMatchedParticipationFunction = IDL.Record({\n serialized_representation: IDL.Opt(IDL.Text),\n });\n const NeuronsFundParticipationConstraints = IDL.Record({\n coefficient_intervals: IDL.Vec(LinearScalingCoefficient),\n max_neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n min_direct_participation_threshold_icp_e8s: IDL.Opt(IDL.Nat64),\n ideal_matched_participation_function: IDL.Opt(\n IdealMatchedParticipationFunction,\n ),\n });\n const Countries = IDL.Record({ iso_codes: IDL.Vec(IDL.Text) });\n const Init = IDL.Record({\n nns_proposal_id: IDL.Opt(IDL.Nat64),\n sns_root_canister_id: IDL.Text,\n neurons_fund_participation: IDL.Opt(IDL.Bool),\n min_participant_icp_e8s: IDL.Opt(IDL.Nat64),\n neuron_basket_construction_parameters: IDL.Opt(\n NeuronBasketConstructionParameters,\n ),\n fallback_controller_principal_ids: IDL.Vec(IDL.Text),\n max_icp_e8s: IDL.Opt(IDL.Nat64),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n confirmation_text: IDL.Opt(IDL.Text),\n swap_start_timestamp_seconds: IDL.Opt(IDL.Nat64),\n swap_due_timestamp_seconds: IDL.Opt(IDL.Nat64),\n min_participants: IDL.Opt(IDL.Nat32),\n sns_token_e8s: IDL.Opt(IDL.Nat64),\n nns_governance_canister_id: IDL.Text,\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n icp_ledger_canister_id: IDL.Text,\n sns_ledger_canister_id: IDL.Text,\n neurons_fund_participation_constraints: IDL.Opt(\n NeuronsFundParticipationConstraints,\n ),\n should_auto_finalize: IDL.Opt(IDL.Bool),\n max_participant_icp_e8s: IDL.Opt(IDL.Nat64),\n sns_governance_canister_id: IDL.Text,\n min_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n restricted_countries: IDL.Opt(Countries),\n min_icp_e8s: IDL.Opt(IDL.Nat64),\n max_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n });\n const ErrorRefundIcpRequest = IDL.Record({\n source_principal_id: IDL.Opt(IDL.Principal),\n });\n const Ok = IDL.Record({ block_height: IDL.Opt(IDL.Nat64) });\n const Err = IDL.Record({\n description: IDL.Opt(IDL.Text),\n error_type: IDL.Opt(IDL.Int32),\n });\n const Result = IDL.Variant({ Ok: Ok, Err: Err });\n const ErrorRefundIcpResponse = IDL.Record({ result: IDL.Opt(Result) });\n const CanisterCallError = IDL.Record({\n code: IDL.Opt(IDL.Int32),\n description: IDL.Text,\n });\n const FailedUpdate = IDL.Record({\n err: IDL.Opt(CanisterCallError),\n dapp_canister_id: IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n failed_updates: IDL.Vec(FailedUpdate),\n });\n const Possibility = IDL.Variant({\n Ok: SetDappControllersResponse,\n Err: CanisterCallError,\n });\n const SetDappControllersCallResult = IDL.Record({\n possibility: IDL.Opt(Possibility),\n });\n const SweepResult = IDL.Record({\n failure: IDL.Nat32,\n skipped: IDL.Nat32,\n invalid: IDL.Nat32,\n success: IDL.Nat32,\n global_failures: IDL.Nat32,\n });\n const GovernanceError = IDL.Record({\n error_message: IDL.Text,\n error_type: IDL.Int32,\n });\n const Response = IDL.Record({\n governance_error: IDL.Opt(GovernanceError),\n });\n const Possibility_1 = IDL.Variant({\n Ok: Response,\n Err: CanisterCallError,\n });\n const SettleCommunityFundParticipationResult = IDL.Record({\n possibility: IDL.Opt(Possibility_1),\n });\n const Ok_1 = IDL.Record({\n neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n neurons_fund_neurons_count: IDL.Opt(IDL.Nat64),\n });\n const Error = IDL.Record({ message: IDL.Opt(IDL.Text) });\n const Possibility_2 = IDL.Variant({ Ok: Ok_1, Err: Error });\n const SettleNeuronsFundParticipationResult = IDL.Record({\n possibility: IDL.Opt(Possibility_2),\n });\n const Possibility_3 = IDL.Variant({\n Ok: IDL.Record({}),\n Err: CanisterCallError,\n });\n const SetModeCallResult = IDL.Record({\n possibility: IDL.Opt(Possibility_3),\n });\n const FinalizeSwapResponse = IDL.Record({\n set_dapp_controllers_call_result: IDL.Opt(SetDappControllersCallResult),\n create_sns_neuron_recipes_result: IDL.Opt(SweepResult),\n settle_community_fund_participation_result: IDL.Opt(\n SettleCommunityFundParticipationResult,\n ),\n error_message: IDL.Opt(IDL.Text),\n settle_neurons_fund_participation_result: IDL.Opt(\n SettleNeuronsFundParticipationResult,\n ),\n set_mode_call_result: IDL.Opt(SetModeCallResult),\n sweep_icp_result: IDL.Opt(SweepResult),\n claim_neuron_result: IDL.Opt(SweepResult),\n sweep_sns_result: IDL.Opt(SweepResult),\n });\n const GetAutoFinalizationStatusResponse = IDL.Record({\n auto_finalize_swap_response: IDL.Opt(FinalizeSwapResponse),\n has_auto_finalize_been_attempted: IDL.Opt(IDL.Bool),\n is_auto_finalize_enabled: IDL.Opt(IDL.Bool),\n });\n const GetBuyerStateRequest = IDL.Record({\n principal_id: IDL.Opt(IDL.Principal),\n });\n const TransferableAmount = IDL.Record({\n transfer_fee_paid_e8s: IDL.Opt(IDL.Nat64),\n transfer_start_timestamp_seconds: IDL.Nat64,\n amount_e8s: IDL.Nat64,\n amount_transferred_e8s: IDL.Opt(IDL.Nat64),\n transfer_success_timestamp_seconds: IDL.Nat64,\n });\n const BuyerState = IDL.Record({\n icp: IDL.Opt(TransferableAmount),\n has_created_neuron_recipes: IDL.Opt(IDL.Bool),\n });\n const GetBuyerStateResponse = IDL.Record({\n buyer_state: IDL.Opt(BuyerState),\n });\n const GetBuyersTotalResponse = IDL.Record({ buyers_total: IDL.Nat64 });\n const MemoryMetrics = IDL.Record({\n wasm_binary_size: IDL.Opt(IDL.Nat),\n wasm_chunk_store_size: IDL.Opt(IDL.Nat),\n canister_history_size: IDL.Opt(IDL.Nat),\n stable_memory_size: IDL.Opt(IDL.Nat),\n snapshots_size: IDL.Opt(IDL.Nat),\n wasm_memory_size: IDL.Opt(IDL.Nat),\n global_memory_size: IDL.Opt(IDL.Nat),\n custom_sections_size: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusType = IDL.Variant({\n stopped: IDL.Null,\n stopping: IDL.Null,\n running: IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n freezing_threshold: IDL.Nat,\n wasm_memory_threshold: IDL.Opt(IDL.Nat),\n controllers: IDL.Vec(IDL.Principal),\n wasm_memory_limit: IDL.Opt(IDL.Nat),\n memory_allocation: IDL.Nat,\n compute_allocation: IDL.Nat,\n });\n const QueryStats = IDL.Record({\n response_payload_bytes_total: IDL.Opt(IDL.Nat),\n num_instructions_total: IDL.Opt(IDL.Nat),\n num_calls_total: IDL.Opt(IDL.Nat),\n request_payload_bytes_total: IDL.Opt(IDL.Nat),\n });\n const CanisterStatusResultV2 = IDL.Record({\n memory_metrics: IDL.Opt(MemoryMetrics),\n status: CanisterStatusType,\n memory_size: IDL.Nat,\n cycles: IDL.Nat,\n settings: DefiniteCanisterSettingsArgs,\n query_stats: IDL.Opt(QueryStats),\n idle_cycles_burned_per_day: IDL.Nat,\n module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetDerivedStateResponse = IDL.Record({\n sns_tokens_per_icp: IDL.Opt(IDL.Float64),\n buyer_total_icp_e8s: IDL.Opt(IDL.Nat64),\n cf_participant_count: IDL.Opt(IDL.Nat64),\n neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n direct_participant_count: IDL.Opt(IDL.Nat64),\n cf_neuron_count: IDL.Opt(IDL.Nat64),\n });\n const GetInitResponse = IDL.Record({ init: IDL.Opt(Init) });\n const GetLifecycleResponse = IDL.Record({\n decentralization_sale_open_timestamp_seconds: IDL.Opt(IDL.Nat64),\n lifecycle: IDL.Opt(IDL.Int32),\n decentralization_swap_termination_timestamp_seconds: IDL.Opt(IDL.Nat64),\n });\n const Icrc1Account = IDL.Record({\n owner: IDL.Opt(IDL.Principal),\n subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const Ticket = IDL.Record({\n creation_time: IDL.Nat64,\n ticket_id: IDL.Nat64,\n account: IDL.Opt(Icrc1Account),\n amount_icp_e8s: IDL.Nat64,\n });\n const Ok_2 = IDL.Record({ ticket: IDL.Opt(Ticket) });\n const Err_1 = IDL.Record({ error_type: IDL.Opt(IDL.Int32) });\n const Result_1 = IDL.Variant({ Ok: Ok_2, Err: Err_1 });\n const GetOpenTicketResponse = IDL.Record({ result: IDL.Opt(Result_1) });\n const Params = IDL.Record({\n min_participant_icp_e8s: IDL.Nat64,\n neuron_basket_construction_parameters: IDL.Opt(\n NeuronBasketConstructionParameters,\n ),\n max_icp_e8s: IDL.Nat64,\n swap_due_timestamp_seconds: IDL.Nat64,\n min_participants: IDL.Nat32,\n sns_token_e8s: IDL.Nat64,\n sale_delay_seconds: IDL.Opt(IDL.Nat64),\n max_participant_icp_e8s: IDL.Nat64,\n min_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n min_icp_e8s: IDL.Nat64,\n max_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n });\n const GetSaleParametersResponse = IDL.Record({ params: IDL.Opt(Params) });\n const NeuronId = IDL.Record({ id: IDL.Vec(IDL.Nat8) });\n const NeuronAttributes = IDL.Record({\n dissolve_delay_seconds: IDL.Nat64,\n memo: IDL.Nat64,\n followees: IDL.Vec(NeuronId),\n });\n const Principals = IDL.Record({ principals: IDL.Vec(IDL.Principal) });\n const CfInvestment = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n hotkey_principal: IDL.Text,\n hotkeys: IDL.Opt(Principals),\n nns_neuron_id: IDL.Nat64,\n });\n const DirectInvestment = IDL.Record({ buyer_principal: IDL.Text });\n const Investor = IDL.Variant({\n CommunityFund: CfInvestment,\n Direct: DirectInvestment,\n });\n const SnsNeuronRecipe = IDL.Record({\n sns: IDL.Opt(TransferableAmount),\n claimed_status: IDL.Opt(IDL.Int32),\n neuron_attributes: IDL.Opt(NeuronAttributes),\n investor: IDL.Opt(Investor),\n });\n const Timers = IDL.Record({\n last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),\n last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),\n requires_periodic_tasks: IDL.Opt(IDL.Bool),\n });\n const CfNeuron = IDL.Record({\n has_created_neuron_recipes: IDL.Opt(IDL.Bool),\n hotkeys: IDL.Opt(Principals),\n nns_neuron_id: IDL.Nat64,\n amount_icp_e8s: IDL.Nat64,\n });\n const CfParticipant = IDL.Record({\n controller: IDL.Opt(IDL.Principal),\n hotkey_principal: IDL.Text,\n cf_neurons: IDL.Vec(CfNeuron),\n });\n const Swap = IDL.Record({\n auto_finalize_swap_response: IDL.Opt(FinalizeSwapResponse),\n neuron_recipes: IDL.Vec(SnsNeuronRecipe),\n next_ticket_id: IDL.Opt(IDL.Nat64),\n decentralization_sale_open_timestamp_seconds: IDL.Opt(IDL.Nat64),\n finalize_swap_in_progress: IDL.Opt(IDL.Bool),\n timers: IDL.Opt(Timers),\n cf_participants: IDL.Vec(CfParticipant),\n init: IDL.Opt(Init),\n already_tried_to_auto_finalize: IDL.Opt(IDL.Bool),\n neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n purge_old_tickets_last_completion_timestamp_nanoseconds: IDL.Opt(IDL.Nat64),\n direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n lifecycle: IDL.Int32,\n purge_old_tickets_next_principal: IDL.Opt(IDL.Vec(IDL.Nat8)),\n decentralization_swap_termination_timestamp_seconds: IDL.Opt(IDL.Nat64),\n buyers: IDL.Vec(IDL.Tuple(IDL.Text, BuyerState)),\n params: IDL.Opt(Params),\n open_sns_token_swap_proposal_id: IDL.Opt(IDL.Nat64),\n });\n const DerivedState = IDL.Record({\n sns_tokens_per_icp: IDL.Float32,\n buyer_total_icp_e8s: IDL.Nat64,\n cf_participant_count: IDL.Opt(IDL.Nat64),\n neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n direct_participant_count: IDL.Opt(IDL.Nat64),\n cf_neuron_count: IDL.Opt(IDL.Nat64),\n });\n const GetStateResponse = IDL.Record({\n swap: IDL.Opt(Swap),\n derived: IDL.Opt(DerivedState),\n });\n const GetTimersResponse = IDL.Record({ timers: IDL.Opt(Timers) });\n const ListCommunityFundParticipantsRequest = IDL.Record({\n offset: IDL.Opt(IDL.Nat64),\n limit: IDL.Opt(IDL.Nat32),\n });\n const ListCommunityFundParticipantsResponse = IDL.Record({\n cf_participants: IDL.Vec(CfParticipant),\n });\n const ListDirectParticipantsRequest = IDL.Record({\n offset: IDL.Opt(IDL.Nat32),\n limit: IDL.Opt(IDL.Nat32),\n });\n const Participant = IDL.Record({\n participation: IDL.Opt(BuyerState),\n participant_id: IDL.Opt(IDL.Principal),\n });\n const ListDirectParticipantsResponse = IDL.Record({\n participants: IDL.Vec(Participant),\n });\n const ListSnsNeuronRecipesRequest = IDL.Record({\n offset: IDL.Opt(IDL.Nat64),\n limit: IDL.Opt(IDL.Nat32),\n });\n const ListSnsNeuronRecipesResponse = IDL.Record({\n sns_neuron_recipes: IDL.Vec(SnsNeuronRecipe),\n });\n const NewSaleTicketRequest = IDL.Record({\n subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),\n amount_icp_e8s: IDL.Nat64,\n });\n const InvalidUserAmount = IDL.Record({\n min_amount_icp_e8s_included: IDL.Nat64,\n max_amount_icp_e8s_included: IDL.Nat64,\n });\n const Err_2 = IDL.Record({\n invalid_user_amount: IDL.Opt(InvalidUserAmount),\n existing_ticket: IDL.Opt(Ticket),\n error_type: IDL.Int32,\n });\n const Result_2 = IDL.Variant({ Ok: Ok_2, Err: Err_2 });\n const NewSaleTicketResponse = IDL.Record({ result: IDL.Opt(Result_2) });\n const RefreshBuyerTokensRequest = IDL.Record({\n confirmation_text: IDL.Opt(IDL.Text),\n buyer: IDL.Text,\n });\n const RefreshBuyerTokensResponse = IDL.Record({\n icp_accepted_participation_e8s: IDL.Nat64,\n icp_ledger_account_balance_e8s: IDL.Nat64,\n });\n\n return IDL.Service({\n error_refund_icp: IDL.Func(\n [ErrorRefundIcpRequest],\n [ErrorRefundIcpResponse],\n [],\n ),\n finalize_swap: IDL.Func([IDL.Record({})], [FinalizeSwapResponse], []),\n get_auto_finalization_status: IDL.Func(\n [IDL.Record({})],\n [GetAutoFinalizationStatusResponse],\n [\"query\"],\n ),\n get_buyer_state: IDL.Func(\n [GetBuyerStateRequest],\n [GetBuyerStateResponse],\n [\"query\"],\n ),\n get_buyers_total: IDL.Func([IDL.Record({})], [GetBuyersTotalResponse], []),\n get_canister_status: IDL.Func(\n [IDL.Record({})],\n [CanisterStatusResultV2],\n [],\n ),\n get_derived_state: IDL.Func(\n [IDL.Record({})],\n [GetDerivedStateResponse],\n [\"query\"],\n ),\n get_init: IDL.Func([IDL.Record({})], [GetInitResponse], [\"query\"]),\n get_lifecycle: IDL.Func(\n [IDL.Record({})],\n [GetLifecycleResponse],\n [\"query\"],\n ),\n get_open_ticket: IDL.Func(\n [IDL.Record({})],\n [GetOpenTicketResponse],\n [\"query\"],\n ),\n get_sale_parameters: IDL.Func(\n [IDL.Record({})],\n [GetSaleParametersResponse],\n [\"query\"],\n ),\n get_state: IDL.Func([IDL.Record({})], [GetStateResponse], [\"query\"]),\n get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], [\"query\"]),\n list_community_fund_participants: IDL.Func(\n [ListCommunityFundParticipantsRequest],\n [ListCommunityFundParticipantsResponse],\n [\"query\"],\n ),\n list_direct_participants: IDL.Func(\n [ListDirectParticipantsRequest],\n [ListDirectParticipantsResponse],\n [\"query\"],\n ),\n list_sns_neuron_recipes: IDL.Func(\n [ListSnsNeuronRecipesRequest],\n [ListSnsNeuronRecipesResponse],\n [\"query\"],\n ),\n new_sale_ticket: IDL.Func(\n [NewSaleTicketRequest],\n [NewSaleTicketResponse],\n [],\n ),\n notify_payment_failure: IDL.Func([IDL.Record({})], [Ok_2], []),\n refresh_buyer_tokens: IDL.Func(\n [RefreshBuyerTokensRequest],\n [RefreshBuyerTokensResponse],\n [],\n ),\n reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], []),\n });\n};\n\nexport const init = ({ IDL }) => {\n const NeuronBasketConstructionParameters = IDL.Record({\n dissolve_delay_interval_seconds: IDL.Nat64,\n count: IDL.Nat64,\n });\n const LinearScalingCoefficient = IDL.Record({\n slope_numerator: IDL.Opt(IDL.Nat64),\n intercept_icp_e8s: IDL.Opt(IDL.Nat64),\n from_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n slope_denominator: IDL.Opt(IDL.Nat64),\n to_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n });\n const IdealMatchedParticipationFunction = IDL.Record({\n serialized_representation: IDL.Opt(IDL.Text),\n });\n const NeuronsFundParticipationConstraints = IDL.Record({\n coefficient_intervals: IDL.Vec(LinearScalingCoefficient),\n max_neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n min_direct_participation_threshold_icp_e8s: IDL.Opt(IDL.Nat64),\n ideal_matched_participation_function: IDL.Opt(\n IdealMatchedParticipationFunction,\n ),\n });\n const Countries = IDL.Record({ iso_codes: IDL.Vec(IDL.Text) });\n const Init = IDL.Record({\n nns_proposal_id: IDL.Opt(IDL.Nat64),\n sns_root_canister_id: IDL.Text,\n neurons_fund_participation: IDL.Opt(IDL.Bool),\n min_participant_icp_e8s: IDL.Opt(IDL.Nat64),\n neuron_basket_construction_parameters: IDL.Opt(\n NeuronBasketConstructionParameters,\n ),\n fallback_controller_principal_ids: IDL.Vec(IDL.Text),\n max_icp_e8s: IDL.Opt(IDL.Nat64),\n neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),\n confirmation_text: IDL.Opt(IDL.Text),\n swap_start_timestamp_seconds: IDL.Opt(IDL.Nat64),\n swap_due_timestamp_seconds: IDL.Opt(IDL.Nat64),\n min_participants: IDL.Opt(IDL.Nat32),\n sns_token_e8s: IDL.Opt(IDL.Nat64),\n nns_governance_canister_id: IDL.Text,\n transaction_fee_e8s: IDL.Opt(IDL.Nat64),\n icp_ledger_canister_id: IDL.Text,\n sns_ledger_canister_id: IDL.Text,\n neurons_fund_participation_constraints: IDL.Opt(\n NeuronsFundParticipationConstraints,\n ),\n should_auto_finalize: IDL.Opt(IDL.Bool),\n max_participant_icp_e8s: IDL.Opt(IDL.Nat64),\n sns_governance_canister_id: IDL.Text,\n min_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n restricted_countries: IDL.Opt(Countries),\n min_icp_e8s: IDL.Opt(IDL.Nat64),\n max_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),\n });\n\n return [Init];\n};\n", "import type { NewSaleTicketRequest } from \"../candid/sns_swap\";\nimport type { NewSaleTicketParams } from \"../types/swap.params\";\n\n// Helper for building `NewSaleTicketRequest` structure\nexport const toNewSaleTicketRequest = ({\n subaccount,\n amount_icp_e8s,\n}: NewSaleTicketParams): NewSaleTicketRequest => ({\n subaccount: subaccount === undefined ? [] : [subaccount],\n amount_icp_e8s,\n});\n", "import { nonNullish } from \"@dfinity/utils\";\n\n/**\n * Identifies errors of method not being present in the canister.\n *\n * This is useful because SNS projects have different versions of SNS canisters.\n * Therefore, what works in the latest version might not work in the previous one.\n *\n * Error message example: \"Call was rejected:\n * Request ID: 3a6ef904b35fd19721c95c3df2b0b00b8abefba7f0ad188f5c472809b772c914\n * Reject code: 3\n * Reject text: Canister 75ffu-oaaaa-aaaaa-aabbq-cai has no update method 'get_auto_finalization_status'\"\n */\nexport const isMethodNotSupportedError = (err: unknown): boolean => {\n if (typeof err === \"object\" && nonNullish(err) && \"message\" in err) {\n const message = err.message as string;\n return (\n message.includes(\"has no update method\") ||\n message.includes(\"has no query method\")\n );\n }\n return false;\n};\n"],
5
5
  "mappings": ";;AACA,OACE,eAAAA,GACA,gBAAAC,EACA,gBAAAC,GACA,cAAAC,OACK,iBAyEP,IAAMC,GAAwB,CAAC,CAC7B,SAAU,CAAE,GAAAC,CAAG,EACf,QAAAC,CACF,KAGqB,CACnB,WAAYD,EACZ,QAAS,CAACC,CAAO,CACnB,GAGMC,GAAiC,CAAC,CACtC,SAAAC,EACA,UAAAC,CACF,IAIEL,GAAsB,CACpB,SAAAI,EACA,QAAS,CACP,UAAW,CACT,UAAW,CAACC,CAAS,CACvB,CACF,CACF,CAAC,EAEUC,GAAkB,CAAC,CAC9B,MAAAC,EACA,WAAAC,CACF,KAA6B,CAC3B,MAAOC,GAAWF,CAAK,EACvB,WAAYC,IAAe,OAAY,CAAC,EAAIC,GAAW,CAAE,WAAAD,CAAW,CAAC,CACvE,GAEaE,GAA0B,CAAC,CACtC,SAAAN,EACA,YAAAO,EACA,UAAAC,CACF,IACEZ,GAAsB,CACpB,SAAAI,EACA,QAAS,CACP,qBAAsB,CACpB,mBAAoB,CAAC,CAAE,YAAa,WAAW,KAAKO,CAAW,CAAE,CAAC,EAClE,aAAc,CAACC,CAAS,CAC1B,CACF,CACF,CAAC,EAEUC,GAA6B,CAAC,CACzC,SAAAT,EACA,YAAAO,EACA,UAAAC,CACF,IACEZ,GAAsB,CACpB,SAAAI,EACA,QAAS,CACP,wBAAyB,CACvB,sBAAuB,CAAC,CAAE,YAAa,WAAW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ACtC,MAAML,EAAa,iBAAiB,CAAE,UAAAD,CAAU,CAAC,EAE7CO,EAA8CC,GAAaH,CAAU,EACrEI,EAA0CD,GAAaL,CAAM,EAC7DO,EAAwCF,GAAaJ,CAAI,EACzDO,EAAyCH,GAAaF,CAAK,EAEjE,OAAAM,GAAiBL,CAAoB,EACrCK,GAAiBH,CAAgB,EACjCG,GAAiBF,CAAc,EAC/BE,GAAiBD,CAAe,EAEzB,IAAIE,GAAW,CACpB,KAAMZ,EACN,WAAYa,GAAsB,OAAO,CACvC,WAAYP,EACZ,MAAAT,CACF,CAAC,EACD,OAAQiB,GAAmB,OAAO,CAAE,WAAYN,EAAkB,MAAAX,CAAM,CAAC,EACzE,KAAMkB,GAAgB,OAAO,CAAE,WAAYN,EAAgB,MAAAZ,CAAM,CAAC,EAClE,MAAOmB,GAAkB,OAAO,CAAE,WAAYN,EAAiB,MAAAb,CAAM,CAAC,EACtE,UAAAE,CACF,CAAC,CACH",
6
6
  "names": ["assertNever", "fromNullable", "jsonReplacer", "toNullable", "toManageNeuronCommand", "id", "command", "toManageNeuronConfigureCommand", "neuronId", "operation", "toCandidAccount", "owner", "subaccount", "toNullable", "toAddPermissionsRequest", "permissions", "principal", "toRemovePermissionsRequest", "toSplitNeuronRequest", "memo", "amount_e8s", "toDisburseNeuronRequest", "amount", "toAccount", "toStartDissolvingNeuronRequest", "toStopDissolvingNeuronRequest", "toStakeMaturityRequest", "percentageToStake", "toDisburseMaturityRequest", "percentageToDisburse", "toAutoStakeMaturityNeuronRequest", "requested_setting_for_auto_stake_maturity", "toSetDissolveTimestampRequest", "dissolveTimestampSeconds", "toIncreaseDissolveDelayRequest", "additionalDissolveDelaySeconds", "toFollowRequest", "functionId", "followees", "toSetFollowingRequest", "topicFollowing", "topic", "alias", "toRegisterVoteRequest", "proposalId", "vote", "toClaimOrRefreshRequest", "controller", "toListProposalRequest", "excludeType", "beforeProposal", "includeRewardStatus", "includeStatus", "limit", "includeTopics", "fromCandidAction", "action", "convertNervousSystemParams", "convertAdvanceSnsTargetVersion", "convertNervousSystemFunction", "convertManageDappCanisterSettings", "convertManageLedgerParameters", "convertExecuteExtensionOperation", "convertUpgradeExtension", "convertRegisterExtension", "convertTransferSnsTreasuryFunds", "convertUpgradeSnsControlledCanister", "convertMintSnsTokens", "convertManageSnsMetadata", "assertNever", "params", "fromNullable", "convertSnsVersion", "convertExtensionOperationArg", "convertWasm", "convertExtensionUpgradeArg", "convertChunkedCanisterWasm", "convertExtensionArg", "preciseValue", "convertPreciseValue", "value", "key", "val", "jsonReplacer", "convertGenericNervousSystemFunction", "convertFunctionType", "convertVotingRewardsParameters", "SnsNeuronPermissionType", "SnsProposalRewardStatus", "SnsProposalDecisionStatus", "SnsVote", "SnsSwapLifecycle", "GetOpenTicketErrorType", "NewSaleTicketResponseErrorType", "UnsupportedMethodError", "methodName", "SnsGovernanceError", "SnsSwapNewTicketError", "errorType", "invalidUserAmount", "existingTicket", "SnsSwapGetOpenTicketError", "Canister", "assertPercentageNumber", "createServices", "fromNullable", "toNullable", "idlFactory", "IDL", "PreciseValue", "Timers", "Version", "Versions", "CachedUpgradeSteps", "Topic", "GenericNervousSystemFunction", "FunctionType", "NervousSystemFunction", "Subaccount", "Account", "TreasuryMetrics", "VotingPowerMetrics", "GovernanceCachedMetrics", "MaturityModulation", "TargetVersionSet", "UpgradeStepsReset", "UpgradeOutcome", "ProposalId", "UpgradeStarted", "UpgradeStepsRefreshed", "TargetVersionReset", "UpgradeJournalEntry", "UpgradeJournal", "NeuronId", "Followees", "DefaultFollowees", "NeuronPermissionList", "VotingRewardsParameters", "NervousSystemParameters", "RewardEvent", "PendingVersion", "GovernanceError", "Decimal", "Tokens", "ValuationFactors", "Valuation", "MintSnsTokensActionAuxiliary", "SnsVersion", "AdvanceSnsTargetVersionActionAuxiliary", "ActionAuxiliary", "Ballot", "Percentage", "Tally", "ManageDappCanisterSettings", "ExtensionOperationArg", "ExecuteExtensionOperation", "ChunkedCanisterWasm", "Wasm", "ExtensionUpgradeArg", "UpgradeExtension", "SetTopicsForCustomProposals", "ExtensionInit", "RegisterExtension", "RegisterDappCanisters", "TransferSnsTreasuryFunds", "UpgradeSnsControlledCanister", "DeregisterDappCanisters", "MintSnsTokens", "AdvanceSnsTargetVersion", "ManageSnsMetadata", "ExecuteGenericNervousSystemFunction", "ManageLedgerParameters", "Motion", "Action", "Proposal", "WaitForQuietState", "ProposalData", "Split", "Follow", "DisburseMaturity", "ChangeAutoStakeMaturity", "IncreaseDissolveDelay", "SetDissolveTimestamp", "Operation", "Configure", "RegisterVote", "Followee", "FolloweesForTopic", "SetFollowing", "FinalizeDisburseMaturity", "MemoAndController", "By", "ClaimOrRefresh", "RemoveNeuronPermissions", "AddNeuronPermissions", "MergeMaturity", "Amount", "Disburse", "Command_2", "NeuronInFlightCommand", "NeuronPermission", "DissolveState", "DisburseMaturityInProgress", "Neuron", "Governance", "Principals", "NeuronsFund", "Participant", "NeuronIds", "NeuronRecipe", "NeuronRecipes", "ClaimSwapNeuronsRequest", "SwapNeuron", "ClaimedSwapNeurons", "ClaimSwapNeuronsResult", "ClaimSwapNeuronsResponse", "GetMaturityModulationResponse", "GetMetadataResponse", "GetMetricsRequest", "Metrics", "GetMetricsResult", "GetMetricsResponse", "GetModeResponse", "GetNeuron", "Result", "GetNeuronResponse", "GetProposal", "Result_1", "GetProposalResponse", "MemoryMetrics", "CanisterStatusType", "DefiniteCanisterSettingsArgs", "QueryStats", "CanisterStatusResultV2", "GetRunningSnsVersionResponse", "GetSnsInitializationParametersResponse", "GetTimersResponse", "GetUpgradeJournalRequest", "GetUpgradeJournalResponse", "ListNervousSystemFunctionsResponse", "ListNeurons", "ListNeuronsResponse", "TopicSelector", "ListProposals", "ListProposalsResponse", "ListTopicsRequest", "ExtensionOperationType", "ExtensionType", "ExtensionOperationSpec", "RegisteredExtensionOperationSpec", "TopicInfo", "ListTopicsResponse", "StakeMaturity", "Command", "ManageNeuron", "SplitResponse", "DisburseMaturityResponse", "ClaimOrRefreshResponse", "StakeMaturityResponse", "MergeMaturityResponse", "DisburseResponse", "Command_1", "ManageNeuronResponse", "SetMode", "idlFactory", "IDL", "PreciseValue", "Timers", "Version", "Versions", "CachedUpgradeSteps", "Topic", "GenericNervousSystemFunction", "FunctionType", "NervousSystemFunction", "Subaccount", "Account", "TreasuryMetrics", "VotingPowerMetrics", "GovernanceCachedMetrics", "MaturityModulation", "TargetVersionSet", "UpgradeStepsReset", "UpgradeOutcome", "ProposalId", "UpgradeStarted", "UpgradeStepsRefreshed", "TargetVersionReset", "UpgradeJournalEntry", "UpgradeJournal", "NeuronId", "Followees", "DefaultFollowees", "NeuronPermissionList", "VotingRewardsParameters", "NervousSystemParameters", "RewardEvent", "PendingVersion", "GovernanceError", "Decimal", "Tokens", "ValuationFactors", "Valuation", "MintSnsTokensActionAuxiliary", "SnsVersion", "AdvanceSnsTargetVersionActionAuxiliary", "ActionAuxiliary", "Ballot", "Percentage", "Tally", "ManageDappCanisterSettings", "ExtensionOperationArg", "ExecuteExtensionOperation", "ChunkedCanisterWasm", "Wasm", "ExtensionUpgradeArg", "UpgradeExtension", "SetTopicsForCustomProposals", "ExtensionInit", "RegisterExtension", "RegisterDappCanisters", "TransferSnsTreasuryFunds", "UpgradeSnsControlledCanister", "DeregisterDappCanisters", "MintSnsTokens", "AdvanceSnsTargetVersion", "ManageSnsMetadata", "ExecuteGenericNervousSystemFunction", "ManageLedgerParameters", "Motion", "Action", "Proposal", "WaitForQuietState", "ProposalData", "Split", "Follow", "DisburseMaturity", "ChangeAutoStakeMaturity", "IncreaseDissolveDelay", "SetDissolveTimestamp", "Operation", "Configure", "RegisterVote", "Followee", "FolloweesForTopic", "SetFollowing", "FinalizeDisburseMaturity", "MemoAndController", "By", "ClaimOrRefresh", "RemoveNeuronPermissions", "AddNeuronPermissions", "MergeMaturity", "Amount", "Disburse", "Command_2", "NeuronInFlightCommand", "NeuronPermission", "DissolveState", "DisburseMaturityInProgress", "Neuron", "Governance", "Principals", "NeuronsFund", "Participant", "NeuronIds", "NeuronRecipe", "NeuronRecipes", "ClaimSwapNeuronsRequest", "SwapNeuron", "ClaimedSwapNeurons", "ClaimSwapNeuronsResult", "ClaimSwapNeuronsResponse", "GetMaturityModulationResponse", "GetMetadataResponse", "GetMetricsRequest", "Metrics", "GetMetricsResult", "GetMetricsResponse", "GetModeResponse", "GetNeuron", "Result", "GetNeuronResponse", "GetProposal", "Result_1", "GetProposalResponse", "MemoryMetrics", "CanisterStatusType", "DefiniteCanisterSettingsArgs", "QueryStats", "CanisterStatusResultV2", "GetRunningSnsVersionResponse", "GetSnsInitializationParametersResponse", "GetTimersResponse", "GetUpgradeJournalRequest", "GetUpgradeJournalResponse", "ListNervousSystemFunctionsResponse", "ListNeurons", "ListNeuronsResponse", "TopicSelector", "ListProposals", "ListProposalsResponse", "ListTopicsRequest", "ExtensionOperationType", "ExtensionType", "ExtensionOperationSpec", "RegisteredExtensionOperationSpec", "TopicInfo", "ListTopicsResponse", "StakeMaturity", "Command", "ManageNeuron", "SplitResponse", "DisburseMaturityResponse", "ClaimOrRefreshResponse", "StakeMaturityResponse", "MergeMaturityResponse", "DisburseResponse", "Command_1", "ManageNeuronResponse", "SetMode", "SnsGovernanceCanister", "_SnsGovernanceCanister", "Canister", "options", "service", "certifiedService", "canisterId", "createServices", "idlFactory", "params", "principal", "limit", "beforeNeuronId", "neurons", "toNullable", "certified", "toListProposalRequest", "proposalId", "result", "data", "fromNullable", "SnsGovernanceError", "neuronId", "error", "request", "response", "toAddPermissionsRequest", "toRemovePermissionsRequest", "toSplitNeuronRequest", "command", "errorMessage", "details", "split", "toDisburseNeuronRequest", "toStartDissolvingNeuronRequest", "toStopDissolvingNeuronRequest", "percentageToStake", "assertPercentageNumber", "toStakeMaturityRequest", "toDisburseMaturityRequest", "toAutoStakeMaturityNeuronRequest", "toSetDissolveTimestampRequest", "toIncreaseDissolveDelayRequest", "toFollowRequest", "toSetFollowingRequest", "toRegisterVoteRequest", "toClaimOrRefreshRequest", "memo", "controller", "subaccount", "firstCommand", "Canister", "createServices", "fromNullable", "isNullish", "toNullable", "idlFactory", "IDL", "PreciseValue", "Timers", "Version", "Versions", "CachedUpgradeSteps", "Topic", "GenericNervousSystemFunction", "FunctionType", "NervousSystemFunction", "Subaccount", "Account", "TreasuryMetrics", "VotingPowerMetrics", "GovernanceCachedMetrics", "MaturityModulation", "TargetVersionSet", "UpgradeStepsReset", "UpgradeOutcome", "ProposalId", "UpgradeStarted", "UpgradeStepsRefreshed", "TargetVersionReset", "UpgradeJournalEntry", "UpgradeJournal", "NeuronId", "Followees", "DefaultFollowees", "NeuronPermissionList", "VotingRewardsParameters", "NervousSystemParameters", "RewardEvent", "PendingVersion", "GovernanceError", "Decimal", "Tokens", "ValuationFactors", "Valuation", "MintSnsTokensActionAuxiliary", "SnsVersion", "AdvanceSnsTargetVersionActionAuxiliary", "ActionAuxiliary", "Ballot", "Percentage", "Tally", "ManageDappCanisterSettings", "ExtensionOperationArg", "ExecuteExtensionOperation", "ChunkedCanisterWasm", "Wasm", "ExtensionUpgradeArg", "UpgradeExtension", "SetTopicsForCustomProposals", "ExtensionInit", "RegisterExtension", "RegisterDappCanisters", "TransferSnsTreasuryFunds", "UpgradeSnsControlledCanister", "DeregisterDappCanisters", "MintSnsTokens", "AdvanceSnsTargetVersion", "ManageSnsMetadata", "ExecuteGenericNervousSystemFunction", "ManageLedgerParameters", "Motion", "Action", "Proposal", "WaitForQuietState", "ProposalData", "Split", "Follow", "DisburseMaturity", "ChangeAutoStakeMaturity", "IncreaseDissolveDelay", "SetDissolveTimestamp", "Operation", "Configure", "RegisterVote", "Followee", "FolloweesForTopic", "SetFollowing", "FinalizeDisburseMaturity", "MemoAndController", "By", "ClaimOrRefresh", "RemoveNeuronPermissions", "AddNeuronPermissions", "MergeMaturity", "Amount", "Disburse", "Command_2", "NeuronInFlightCommand", "NeuronPermission", "DissolveState", "DisburseMaturityInProgress", "Neuron", "Governance", "AddMaturityRequest", "AddMaturityResponse", "AdvanceTargetVersionRequest", "AdvanceTargetVersionResponse", "Principals", "NeuronsFund", "Participant", "NeuronIds", "NeuronRecipe", "NeuronRecipes", "ClaimSwapNeuronsRequest", "SwapNeuron", "ClaimedSwapNeurons", "ClaimSwapNeuronsResult", "ClaimSwapNeuronsResponse", "GetMaturityModulationResponse", "GetMetadataResponse", "GetMetricsRequest", "Metrics", "GetMetricsResult", "GetMetricsResponse", "GetModeResponse", "GetNeuron", "Result", "GetNeuronResponse", "GetProposal", "Result_1", "GetProposalResponse", "MemoryMetrics", "CanisterStatusType", "DefiniteCanisterSettingsArgs", "QueryStats", "CanisterStatusResultV2", "GetRunningSnsVersionResponse", "GetSnsInitializationParametersResponse", "GetTimersResponse", "GetUpgradeJournalRequest", "GetUpgradeJournalResponse", "ListNervousSystemFunctionsResponse", "ListNeurons", "ListNeuronsResponse", "TopicSelector", "ListProposals", "ListProposalsResponse", "ListTopicsRequest", "ExtensionOperationType", "ExtensionType", "ExtensionOperationSpec", "RegisteredExtensionOperationSpec", "TopicInfo", "ListTopicsResponse", "StakeMaturity", "Command", "ManageNeuron", "SplitResponse", "DisburseMaturityResponse", "ClaimOrRefreshResponse", "StakeMaturityResponse", "MergeMaturityResponse", "DisburseResponse", "Command_1", "ManageNeuronResponse", "MintTokensRequest", "SetMode", "idlFactory", "IDL", "PreciseValue", "Timers", "Version", "Versions", "CachedUpgradeSteps", "Topic", "GenericNervousSystemFunction", "FunctionType", "NervousSystemFunction", "Subaccount", "Account", "TreasuryMetrics", "VotingPowerMetrics", "GovernanceCachedMetrics", "MaturityModulation", "TargetVersionSet", "UpgradeStepsReset", "UpgradeOutcome", "ProposalId", "UpgradeStarted", "UpgradeStepsRefreshed", "TargetVersionReset", "UpgradeJournalEntry", "UpgradeJournal", "NeuronId", "Followees", "DefaultFollowees", "NeuronPermissionList", "VotingRewardsParameters", "NervousSystemParameters", "RewardEvent", "PendingVersion", "GovernanceError", "Decimal", "Tokens", "ValuationFactors", "Valuation", "MintSnsTokensActionAuxiliary", "SnsVersion", "AdvanceSnsTargetVersionActionAuxiliary", "ActionAuxiliary", "Ballot", "Percentage", "Tally", "ManageDappCanisterSettings", "ExtensionOperationArg", "ExecuteExtensionOperation", "ChunkedCanisterWasm", "Wasm", "ExtensionUpgradeArg", "UpgradeExtension", "SetTopicsForCustomProposals", "ExtensionInit", "RegisterExtension", "RegisterDappCanisters", "TransferSnsTreasuryFunds", "UpgradeSnsControlledCanister", "DeregisterDappCanisters", "MintSnsTokens", "AdvanceSnsTargetVersion", "ManageSnsMetadata", "ExecuteGenericNervousSystemFunction", "ManageLedgerParameters", "Motion", "Action", "Proposal", "WaitForQuietState", "ProposalData", "Split", "Follow", "DisburseMaturity", "ChangeAutoStakeMaturity", "IncreaseDissolveDelay", "SetDissolveTimestamp", "Operation", "Configure", "RegisterVote", "Followee", "FolloweesForTopic", "SetFollowing", "FinalizeDisburseMaturity", "MemoAndController", "By", "ClaimOrRefresh", "RemoveNeuronPermissions", "AddNeuronPermissions", "MergeMaturity", "Amount", "Disburse", "Command_2", "NeuronInFlightCommand", "NeuronPermission", "DissolveState", "DisburseMaturityInProgress", "Neuron", "Governance", "AddMaturityRequest", "AddMaturityResponse", "AdvanceTargetVersionRequest", "AdvanceTargetVersionResponse", "Principals", "NeuronsFund", "Participant", "NeuronIds", "NeuronRecipe", "NeuronRecipes", "ClaimSwapNeuronsRequest", "SwapNeuron", "ClaimedSwapNeurons", "ClaimSwapNeuronsResult", "ClaimSwapNeuronsResponse", "GetMaturityModulationResponse", "GetMetadataResponse", "GetMetricsRequest", "Metrics", "GetMetricsResult", "GetMetricsResponse", "GetModeResponse", "GetNeuron", "Result", "GetNeuronResponse", "GetProposal", "Result_1", "GetProposalResponse", "MemoryMetrics", "CanisterStatusType", "DefiniteCanisterSettingsArgs", "QueryStats", "CanisterStatusResultV2", "GetRunningSnsVersionResponse", "GetSnsInitializationParametersResponse", "GetTimersResponse", "GetUpgradeJournalRequest", "GetUpgradeJournalResponse", "ListNervousSystemFunctionsResponse", "ListNeurons", "ListNeuronsResponse", "TopicSelector", "ListProposals", "ListProposalsResponse", "ListTopicsRequest", "ExtensionOperationType", "ExtensionType", "ExtensionOperationSpec", "RegisteredExtensionOperationSpec", "TopicInfo", "ListTopicsResponse", "StakeMaturity", "Command", "ManageNeuron", "SplitResponse", "DisburseMaturityResponse", "ClaimOrRefreshResponse", "StakeMaturityResponse", "MergeMaturityResponse", "DisburseResponse", "Command_1", "ManageNeuronResponse", "MintTokensRequest", "SetMode", "SnsGovernanceTestCanister", "_SnsGovernanceTestCanister", "Canister", "options", "service", "certifiedService", "canisterId", "createServices", "idlFactory", "params", "id", "amountE8s", "new_maturity_e8s", "toNullable", "newMaturity", "fromNullable", "isNullish", "SnsGovernanceError", "Canister", "createServices", "idlFactory", "IDL", "Timers", "Extensions", "SnsRootCanister", "CanisterIdRecord", "MemoryMetrics", "CanisterStatusType", "LogVisibility", "DefiniteCanisterSettings", "QueryStats", "CanisterStatusResult", "CanisterInstallMode", "ChunkedCanisterWasm", "ChangeCanisterRequest", "GetSnsCanistersSummaryRequest", "DefiniteCanisterSettingsArgs", "CanisterStatusResultV2", "CanisterSummary", "GetSnsCanistersSummaryResponse", "GetTimersResponse", "ListSnsCanistersResponse", "ManageDappCanisterSettingsRequest", "ManageDappCanisterSettingsResponse", "RegisterDappCanisterRequest", "RegisterDappCanistersRequest", "RegisterExtensionRequest", "CanisterCallError", "RegisterExtensionResult", "RegisterExtensionResponse", "SetDappControllersRequest", "FailedUpdate", "SetDappControllersResponse", "idlFactory", "IDL", "Timers", "Extensions", "SnsRootCanister", "CanisterIdRecord", "MemoryMetrics", "CanisterStatusType", "LogVisibility", "DefiniteCanisterSettings", "QueryStats", "CanisterStatusResult", "CanisterInstallMode", "ChunkedCanisterWasm", "ChangeCanisterRequest", "GetSnsCanistersSummaryRequest", "DefiniteCanisterSettingsArgs", "CanisterStatusResultV2", "CanisterSummary", "GetSnsCanistersSummaryResponse", "GetTimersResponse", "ListSnsCanistersResponse", "ManageDappCanisterSettingsRequest", "ManageDappCanisterSettingsResponse", "RegisterDappCanisterRequest", "RegisterDappCanistersRequest", "RegisterExtensionRequest", "CanisterCallError", "RegisterExtensionResult", "RegisterExtensionResponse", "SetDappControllersRequest", "FailedUpdate", "SetDappControllersResponse", "SnsRootCanister", "_SnsRootCanister", "Canister", "options", "service", "certifiedService", "canisterId", "createServices", "idlFactory", "certified", "IcrcIndexCanister", "IcrcLedgerCanister", "assertNonNullish", "fromNullable", "bigIntToUint8Array", "toNullable", "arrayOfNumberToUint8Array", "asciiStringToByteArray", "numberToUint8Array", "isBytes", "a", "abytes", "b", "lengths", "isBytes", "aexists", "instance", "checkFinished", "aoutput", "out", "abytes", "min", "clean", "arrays", "i", "createView", "arr", "rotr", "word", "shift", "utf8ToBytes", "str", "toBytes", "data", "utf8ToBytes", "abytes", "Hash", "createHasher", "hashCons", "hashC", "msg", "toBytes", "tmp", "setBigUint64", "view", "byteOffset", "value", "isLE", "_32n", "_u32_max", "wh", "wl", "h", "l", "Chi", "a", "b", "c", "Maj", "HashMD", "Hash", "blockLen", "outputLen", "padOffset", "createView", "data", "aexists", "toBytes", "abytes", "buffer", "len", "pos", "take", "dataView", "out", "aoutput", "clean", "i", "oview", "outLen", "state", "res", "to", "length", "finished", "destroyed", "SHA256_IV", "SHA256_K", "SHA256_W", "SHA256", "HashMD", "outputLen", "SHA256_IV", "A", "B", "C", "D", "E", "F", "G", "H", "view", "offset", "i", "W15", "W2", "s0", "rotr", "s1", "sigma1", "T1", "Chi", "T2", "Maj", "clean", "sha256", "createHasher", "SHA256", "neuronSubaccount", "index", "controller", "data", "asciiStringToByteArray", "numberToUint8Array", "shaObj", "sha256", "arrayOfNumberToUint8Array", "SnsWrapper", "root", "governance", "ledger", "swap", "index", "certified", "params", "controller", "subaccount", "neuronSubaccount", "neuronId", "neuron", "SnsGovernanceError", "stakeE8s", "source", "createdAt", "fee", "neuronAccount", "toNullable", "bigIntToUint8Array", "account", "name", "Canister", "createServices", "fromDefinedNullable", "fromNullable", "idlFactory", "IDL", "NeuronBasketConstructionParameters", "LinearScalingCoefficient", "IdealMatchedParticipationFunction", "NeuronsFundParticipationConstraints", "Countries", "Init", "ErrorRefundIcpRequest", "Ok", "Err", "Result", "ErrorRefundIcpResponse", "CanisterCallError", "FailedUpdate", "SetDappControllersResponse", "Possibility", "SetDappControllersCallResult", "SweepResult", "GovernanceError", "Response", "Possibility_1", "SettleCommunityFundParticipationResult", "Ok_1", "Error", "Possibility_2", "SettleNeuronsFundParticipationResult", "Possibility_3", "SetModeCallResult", "FinalizeSwapResponse", "GetAutoFinalizationStatusResponse", "GetBuyerStateRequest", "TransferableAmount", "BuyerState", "GetBuyerStateResponse", "GetBuyersTotalResponse", "MemoryMetrics", "CanisterStatusType", "DefiniteCanisterSettingsArgs", "QueryStats", "CanisterStatusResultV2", "GetDerivedStateResponse", "GetInitResponse", "GetLifecycleResponse", "Icrc1Account", "Ticket", "Ok_2", "Err_1", "Result_1", "GetOpenTicketResponse", "Params", "GetSaleParametersResponse", "NeuronId", "NeuronAttributes", "Principals", "CfInvestment", "DirectInvestment", "Investor", "SnsNeuronRecipe", "Timers", "CfNeuron", "CfParticipant", "Swap", "DerivedState", "GetStateResponse", "GetTimersResponse", "ListCommunityFundParticipantsRequest", "ListCommunityFundParticipantsResponse", "ListDirectParticipantsRequest", "Participant", "ListDirectParticipantsResponse", "ListSnsNeuronRecipesRequest", "ListSnsNeuronRecipesResponse", "NewSaleTicketRequest", "InvalidUserAmount", "Err_2", "Result_2", "NewSaleTicketResponse", "RefreshBuyerTokensRequest", "RefreshBuyerTokensResponse", "idlFactory", "IDL", "NeuronBasketConstructionParameters", "LinearScalingCoefficient", "IdealMatchedParticipationFunction", "NeuronsFundParticipationConstraints", "Countries", "Init", "ErrorRefundIcpRequest", "Ok", "Err", "Result", "ErrorRefundIcpResponse", "CanisterCallError", "FailedUpdate", "SetDappControllersResponse", "Possibility", "SetDappControllersCallResult", "SweepResult", "GovernanceError", "Response", "Possibility_1", "SettleCommunityFundParticipationResult", "Ok_1", "Error", "Possibility_2", "SettleNeuronsFundParticipationResult", "Possibility_3", "SetModeCallResult", "FinalizeSwapResponse", "GetAutoFinalizationStatusResponse", "GetBuyerStateRequest", "TransferableAmount", "BuyerState", "GetBuyerStateResponse", "GetBuyersTotalResponse", "MemoryMetrics", "CanisterStatusType", "DefiniteCanisterSettingsArgs", "QueryStats", "CanisterStatusResultV2", "GetDerivedStateResponse", "GetInitResponse", "GetLifecycleResponse", "Icrc1Account", "Ticket", "Ok_2", "Err_1", "Result_1", "GetOpenTicketResponse", "Params", "GetSaleParametersResponse", "NeuronId", "NeuronAttributes", "Principals", "CfInvestment", "DirectInvestment", "Investor", "SnsNeuronRecipe", "Timers", "CfNeuron", "CfParticipant", "Swap", "DerivedState", "GetStateResponse", "GetTimersResponse", "ListCommunityFundParticipantsRequest", "ListCommunityFundParticipantsResponse", "ListDirectParticipantsRequest", "Participant", "ListDirectParticipantsResponse", "ListSnsNeuronRecipesRequest", "ListSnsNeuronRecipesResponse", "NewSaleTicketRequest", "InvalidUserAmount", "Err_2", "Result_2", "NewSaleTicketResponse", "RefreshBuyerTokensRequest", "RefreshBuyerTokensResponse", "toNewSaleTicketRequest", "subaccount", "amount_icp_e8s", "nonNullish", "isMethodNotSupportedError", "err", "message", "SnsSwapCanister", "_SnsSwapCanister", "Canister", "options", "service", "certifiedService", "canisterId", "createServices", "idlFactory", "params", "ticket", "fromNullable", "buyer_state", "certified", "response", "result", "fromDefinedNullable", "errorType", "SnsSwapGetOpenTicketError", "request", "toNewSaleTicketRequest", "errorData", "SnsSwapNewTicketError", "error", "isMethodNotSupportedError", "UnsupportedMethodError", "initSnsWrapper", "agent", "rootOptions", "certified", "rootCanister", "SnsRootCanister", "ledger", "swap", "governance", "index", "governanceCanisterId", "fromNullable", "ledgerCanisterId", "swapCanisterId", "indexCanisterId", "assertNonNullish", "SnsWrapper", "SnsGovernanceCanister", "IcrcLedgerCanister", "SnsSwapCanister", "IcrcIndexCanister"]
7
7
  }