@dfinity/nns 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -24
- package/dist/candid/genesis_token.did +1 -1
- package/dist/candid/governance.certified.idl.js +488 -312
- package/dist/candid/governance.d.ts +101 -0
- package/dist/candid/governance.did +104 -3
- package/dist/candid/governance.idl.js +496 -320
- package/dist/candid/governance_test.certified.idl.js +115 -0
- package/dist/candid/governance_test.d.ts +69 -0
- package/dist/candid/governance_test.did +67 -2
- package/dist/candid/governance_test.idl.js +115 -0
- package/dist/candid/sns_wasm.certified.idl.js +2 -0
- package/dist/candid/sns_wasm.d.ts +2 -0
- package/dist/candid/sns_wasm.did +3 -1
- package/dist/candid/sns_wasm.idl.js +2 -0
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/index.cjs.js.map +4 -4
- package/dist/esm/chunk-2MR4JA3T.js +20 -0
- package/dist/esm/chunk-2MR4JA3T.js.map +7 -0
- package/dist/esm/chunk-YGDWD6VV.js +2 -0
- package/dist/esm/chunk-YGDWD6VV.js.map +7 -0
- package/dist/esm/governance.canister.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +4 -4
- package/dist/esm/sns_wasm.canister.js +1 -1
- package/dist/types/canisters/governance/request.converters.d.ts +1 -1
- package/dist/types/canisters/governance/response.converters.d.ts +2 -1
- package/dist/types/enums/governance.enums.d.ts +3 -1
- package/dist/types/governance_test.canister.d.ts +14 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types/governance_converters.d.ts +17 -11
- package/package.json +1 -1
- package/dist/esm/chunk-IJWQXUQ5.js +0 -2
- package/dist/esm/chunk-IJWQXUQ5.js.map +0 -7
- package/dist/esm/chunk-LARRGLCK.js +0 -20
- package/dist/esm/chunk-LARRGLCK.js.map +0 -7
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/sns_wasm.canister.ts", "../../candid/sns_wasm.certified.idl.js", "../../candid/sns_wasm.idl.js"],
|
|
4
|
-
"sourcesContent": ["import { createServices, type CanisterOptions } from \"@dfinity/utils\";\nimport type {\n DeployedSns,\n _SERVICE as SnsWasmService,\n} from \"../candid/sns_wasm\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/sns_wasm.certified.idl\";\nimport { idlFactory } from \"../candid/sns_wasm.idl\";\nimport { MAINNET_SNS_WASM_CANISTER_ID } from \"./constants/canister_ids\";\n\nexport class SnsWasmCanister {\n private constructor(\n private readonly service: SnsWasmService,\n private readonly certifiedService: SnsWasmService,\n ) {}\n\n public static create(options: CanisterOptions<SnsWasmService> = {}) {\n const { service, certifiedService } = createServices<SnsWasmService>({\n options: {\n ...options,\n canisterId: options.canisterId ?? MAINNET_SNS_WASM_CANISTER_ID,\n },\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new SnsWasmCanister(service, certifiedService);\n }\n\n public listSnses = async ({\n certified = true,\n }: {\n certified?: boolean;\n }): Promise<DeployedSns[]> => {\n const service = certified ? this.certifiedService : this.service;\n\n const { instances } = await service.list_deployed_snses({});\n return instances;\n };\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/nns/candid/sns_wasm.did */\nexport const idlFactory = ({ IDL }) => {\n const SnsWasmCanisterInitPayload = IDL.Record({\n 'allowed_principals' : IDL.Vec(IDL.Principal),\n 'access_controls_enabled' : IDL.Bool,\n 'sns_subnet_ids' : IDL.Vec(IDL.Principal),\n });\n const SnsWasm = IDL.Record({\n 'wasm' : IDL.Vec(IDL.Nat8),\n 'canister_type' : IDL.Int32,\n });\n const AddWasmRequest = IDL.Record({\n 'hash' : IDL.Vec(IDL.Nat8),\n 'wasm' : IDL.Opt(SnsWasm),\n });\n const SnsWasmError = IDL.Record({ 'message' : IDL.Text });\n const Result = IDL.Variant({\n 'Error' : SnsWasmError,\n 'Hash' : IDL.Vec(IDL.Nat8),\n });\n const AddWasmResponse = IDL.Record({ 'result' : IDL.Opt(Result) });\n const NeuronBasketConstructionParameters = IDL.Record({\n 'dissolve_delay_interval_seconds' : IDL.Nat64,\n 'count' : IDL.Nat64,\n });\n const Canister = IDL.Record({ 'id' : IDL.Opt(IDL.Principal) });\n const DappCanisters = IDL.Record({ 'canisters' : IDL.Vec(Canister) });\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 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 });\n const CfNeuron = IDL.Record({\n 'nns_neuron_id' : IDL.Nat64,\n 'amount_icp_e8s' : IDL.Nat64,\n });\n const CfParticipant = IDL.Record({\n 'hotkey_principal' : IDL.Text,\n 'cf_neurons' : IDL.Vec(CfNeuron),\n });\n const NeuronsFundParticipants = IDL.Record({\n 'participants' : IDL.Vec(CfParticipant),\n });\n const TreasuryDistribution = IDL.Record({ 'total_e8s' : IDL.Nat64 });\n const NeuronDistribution = IDL.Record({\n 'controller' : IDL.Opt(IDL.Principal),\n 'dissolve_delay_seconds' : IDL.Nat64,\n 'memo' : IDL.Nat64,\n 'stake_e8s' : IDL.Nat64,\n 'vesting_period_seconds' : IDL.Opt(IDL.Nat64),\n });\n const DeveloperDistribution = IDL.Record({\n 'developer_neurons' : IDL.Vec(NeuronDistribution),\n });\n const AirdropDistribution = IDL.Record({\n 'airdrop_neurons' : IDL.Vec(NeuronDistribution),\n });\n const SwapDistribution = IDL.Record({\n 'total_e8s' : IDL.Nat64,\n 'initial_swap_amount_e8s' : IDL.Nat64,\n });\n const FractionalDeveloperVotingPower = IDL.Record({\n 'treasury_distribution' : IDL.Opt(TreasuryDistribution),\n 'developer_distribution' : IDL.Opt(DeveloperDistribution),\n 'airdrop_distribution' : IDL.Opt(AirdropDistribution),\n 'swap_distribution' : IDL.Opt(SwapDistribution),\n });\n const InitialTokenDistribution = IDL.Variant({\n 'FractionalDeveloperVotingPower' : FractionalDeveloperVotingPower,\n });\n const Countries = IDL.Record({ 'iso_codes' : IDL.Vec(IDL.Text) });\n const SnsInitPayload = IDL.Record({\n 'url' : IDL.Opt(IDL.Text),\n 'max_dissolve_delay_seconds' : IDL.Opt(IDL.Nat64),\n 'max_dissolve_delay_bonus_percentage' : IDL.Opt(IDL.Nat64),\n 'nns_proposal_id' : IDL.Opt(IDL.Nat64),\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 'token_symbol' : IDL.Opt(IDL.Text),\n 'final_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),\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 'logo' : IDL.Opt(IDL.Text),\n 'name' : IDL.Opt(IDL.Text),\n 'swap_start_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'swap_due_timestamp_seconds' : 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 'description' : IDL.Opt(IDL.Text),\n 'max_neuron_age_seconds_for_age_bonus' : IDL.Opt(IDL.Nat64),\n 'min_participants' : IDL.Opt(IDL.Nat64),\n 'initial_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),\n 'wait_for_quiet_deadline_increase_seconds' : IDL.Opt(IDL.Nat64),\n 'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),\n 'dapp_canisters' : IDL.Opt(DappCanisters),\n 'neurons_fund_participation_constraints' : IDL.Opt(\n NeuronsFundParticipationConstraints\n ),\n 'neurons_fund_participants' : IDL.Opt(NeuronsFundParticipants),\n 'max_age_bonus_percentage' : IDL.Opt(IDL.Nat64),\n 'initial_token_distribution' : IDL.Opt(InitialTokenDistribution),\n 'reward_rate_transition_duration_seconds' : IDL.Opt(IDL.Nat64),\n 'token_logo' : IDL.Opt(IDL.Text),\n 'token_name' : IDL.Opt(IDL.Text),\n 'max_participant_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'proposal_reject_cost_e8s' : IDL.Opt(IDL.Nat64),\n 'restricted_countries' : IDL.Opt(Countries),\n 'min_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n const DeployNewSnsRequest = IDL.Record({\n 'sns_init_payload' : IDL.Opt(SnsInitPayload),\n });\n const DappCanistersTransferResult = IDL.Record({\n 'restored_dapp_canisters' : IDL.Vec(Canister),\n 'nns_controlled_dapp_canisters' : IDL.Vec(Canister),\n 'sns_controlled_dapp_canisters' : IDL.Vec(Canister),\n });\n const SnsCanisterIds = IDL.Record({\n 'root' : IDL.Opt(IDL.Principal),\n 'swap' : IDL.Opt(IDL.Principal),\n 'ledger' : IDL.Opt(IDL.Principal),\n 'index' : IDL.Opt(IDL.Principal),\n 'governance' : IDL.Opt(IDL.Principal),\n });\n const DeployNewSnsResponse = IDL.Record({\n 'dapp_canisters_transfer_result' : IDL.Opt(DappCanistersTransferResult),\n 'subnet_id' : IDL.Opt(IDL.Principal),\n 'error' : IDL.Opt(SnsWasmError),\n 'canisters' : IDL.Opt(SnsCanisterIds),\n });\n const GetAllowedPrincipalsResponse = IDL.Record({\n 'allowed_principals' : IDL.Vec(IDL.Principal),\n });\n const SnsVersion = 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 GetNextSnsVersionRequest = IDL.Record({\n 'governance_canister_id' : IDL.Opt(IDL.Principal),\n 'current_version' : IDL.Opt(SnsVersion),\n });\n const GetNextSnsVersionResponse = IDL.Record({\n 'next_version' : IDL.Opt(SnsVersion),\n });\n const GetSnsSubnetIdsResponse = IDL.Record({\n 'sns_subnet_ids' : IDL.Vec(IDL.Principal),\n });\n const GetWasmRequest = IDL.Record({ 'hash' : IDL.Vec(IDL.Nat8) });\n const GetWasmResponse = IDL.Record({ 'wasm' : IDL.Opt(SnsWasm) });\n const SnsUpgrade = IDL.Record({\n 'next_version' : IDL.Opt(SnsVersion),\n 'current_version' : IDL.Opt(SnsVersion),\n });\n const InsertUpgradePathEntriesRequest = IDL.Record({\n 'upgrade_path' : IDL.Vec(SnsUpgrade),\n 'sns_governance_canister_id' : IDL.Opt(IDL.Principal),\n });\n const InsertUpgradePathEntriesResponse = IDL.Record({\n 'error' : IDL.Opt(SnsWasmError),\n });\n const DeployedSns = IDL.Record({\n 'root_canister_id' : IDL.Opt(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 ListDeployedSnsesResponse = IDL.Record({\n 'instances' : IDL.Vec(DeployedSns),\n });\n const ListUpgradeStepsRequest = IDL.Record({\n 'limit' : IDL.Nat32,\n 'starting_at' : IDL.Opt(SnsVersion),\n 'sns_governance_canister_id' : IDL.Opt(IDL.Principal),\n });\n const PrettySnsVersion = IDL.Record({\n 'archive_wasm_hash' : IDL.Text,\n 'root_wasm_hash' : IDL.Text,\n 'swap_wasm_hash' : IDL.Text,\n 'ledger_wasm_hash' : IDL.Text,\n 'governance_wasm_hash' : IDL.Text,\n 'index_wasm_hash' : IDL.Text,\n });\n const ListUpgradeStep = IDL.Record({\n 'pretty_version' : IDL.Opt(PrettySnsVersion),\n 'version' : IDL.Opt(SnsVersion),\n });\n const ListUpgradeStepsResponse = IDL.Record({\n 'steps' : IDL.Vec(ListUpgradeStep),\n });\n const UpdateAllowedPrincipalsRequest = IDL.Record({\n 'added_principals' : IDL.Vec(IDL.Principal),\n 'removed_principals' : IDL.Vec(IDL.Principal),\n });\n const UpdateAllowedPrincipalsResult = IDL.Variant({\n 'Error' : SnsWasmError,\n 'AllowedPrincipals' : GetAllowedPrincipalsResponse,\n });\n const UpdateAllowedPrincipalsResponse = IDL.Record({\n 'update_allowed_principals_result' : IDL.Opt(UpdateAllowedPrincipalsResult),\n });\n const UpdateSnsSubnetListRequest = IDL.Record({\n 'sns_subnet_ids_to_add' : IDL.Vec(IDL.Principal),\n 'sns_subnet_ids_to_remove' : IDL.Vec(IDL.Principal),\n });\n const UpdateSnsSubnetListResponse = IDL.Record({\n 'error' : IDL.Opt(SnsWasmError),\n });\n return IDL.Service({\n 'add_wasm' : IDL.Func([AddWasmRequest], [AddWasmResponse], []),\n 'deploy_new_sns' : IDL.Func(\n [DeployNewSnsRequest],\n [DeployNewSnsResponse],\n [],\n ),\n 'get_allowed_principals' : IDL.Func(\n [IDL.Record({})],\n [GetAllowedPrincipalsResponse],\n [],\n ),\n 'get_latest_sns_version_pretty' : IDL.Func(\n [IDL.Null],\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n [],\n ),\n 'get_next_sns_version' : IDL.Func(\n [GetNextSnsVersionRequest],\n [GetNextSnsVersionResponse],\n [],\n ),\n 'get_sns_subnet_ids' : IDL.Func(\n [IDL.Record({})],\n [GetSnsSubnetIdsResponse],\n [],\n ),\n 'get_wasm' : IDL.Func([GetWasmRequest], [GetWasmResponse], []),\n 'insert_upgrade_path_entries' : IDL.Func(\n [InsertUpgradePathEntriesRequest],\n [InsertUpgradePathEntriesResponse],\n [],\n ),\n 'list_deployed_snses' : IDL.Func(\n [IDL.Record({})],\n [ListDeployedSnsesResponse],\n [],\n ),\n 'list_upgrade_steps' : IDL.Func(\n [ListUpgradeStepsRequest],\n [ListUpgradeStepsResponse],\n [],\n ),\n 'update_allowed_principals' : IDL.Func(\n [UpdateAllowedPrincipalsRequest],\n [UpdateAllowedPrincipalsResponse],\n [],\n ),\n 'update_sns_subnet_list' : IDL.Func(\n [UpdateSnsSubnetListRequest],\n [UpdateSnsSubnetListResponse],\n [],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const SnsWasmCanisterInitPayload = IDL.Record({\n 'allowed_principals' : IDL.Vec(IDL.Principal),\n 'access_controls_enabled' : IDL.Bool,\n 'sns_subnet_ids' : IDL.Vec(IDL.Principal),\n });\n return [SnsWasmCanisterInitPayload];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/nns/candid/sns_wasm.did */\nexport const idlFactory = ({ IDL }) => {\n const SnsWasmCanisterInitPayload = IDL.Record({\n 'allowed_principals' : IDL.Vec(IDL.Principal),\n 'access_controls_enabled' : IDL.Bool,\n 'sns_subnet_ids' : IDL.Vec(IDL.Principal),\n });\n const SnsWasm = IDL.Record({\n 'wasm' : IDL.Vec(IDL.Nat8),\n 'canister_type' : IDL.Int32,\n });\n const AddWasmRequest = IDL.Record({\n 'hash' : IDL.Vec(IDL.Nat8),\n 'wasm' : IDL.Opt(SnsWasm),\n });\n const SnsWasmError = IDL.Record({ 'message' : IDL.Text });\n const Result = IDL.Variant({\n 'Error' : SnsWasmError,\n 'Hash' : IDL.Vec(IDL.Nat8),\n });\n const AddWasmResponse = IDL.Record({ 'result' : IDL.Opt(Result) });\n const NeuronBasketConstructionParameters = IDL.Record({\n 'dissolve_delay_interval_seconds' : IDL.Nat64,\n 'count' : IDL.Nat64,\n });\n const Canister = IDL.Record({ 'id' : IDL.Opt(IDL.Principal) });\n const DappCanisters = IDL.Record({ 'canisters' : IDL.Vec(Canister) });\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 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 });\n const CfNeuron = IDL.Record({\n 'nns_neuron_id' : IDL.Nat64,\n 'amount_icp_e8s' : IDL.Nat64,\n });\n const CfParticipant = IDL.Record({\n 'hotkey_principal' : IDL.Text,\n 'cf_neurons' : IDL.Vec(CfNeuron),\n });\n const NeuronsFundParticipants = IDL.Record({\n 'participants' : IDL.Vec(CfParticipant),\n });\n const TreasuryDistribution = IDL.Record({ 'total_e8s' : IDL.Nat64 });\n const NeuronDistribution = IDL.Record({\n 'controller' : IDL.Opt(IDL.Principal),\n 'dissolve_delay_seconds' : IDL.Nat64,\n 'memo' : IDL.Nat64,\n 'stake_e8s' : IDL.Nat64,\n 'vesting_period_seconds' : IDL.Opt(IDL.Nat64),\n });\n const DeveloperDistribution = IDL.Record({\n 'developer_neurons' : IDL.Vec(NeuronDistribution),\n });\n const AirdropDistribution = IDL.Record({\n 'airdrop_neurons' : IDL.Vec(NeuronDistribution),\n });\n const SwapDistribution = IDL.Record({\n 'total_e8s' : IDL.Nat64,\n 'initial_swap_amount_e8s' : IDL.Nat64,\n });\n const FractionalDeveloperVotingPower = IDL.Record({\n 'treasury_distribution' : IDL.Opt(TreasuryDistribution),\n 'developer_distribution' : IDL.Opt(DeveloperDistribution),\n 'airdrop_distribution' : IDL.Opt(AirdropDistribution),\n 'swap_distribution' : IDL.Opt(SwapDistribution),\n });\n const InitialTokenDistribution = IDL.Variant({\n 'FractionalDeveloperVotingPower' : FractionalDeveloperVotingPower,\n });\n const Countries = IDL.Record({ 'iso_codes' : IDL.Vec(IDL.Text) });\n const SnsInitPayload = IDL.Record({\n 'url' : IDL.Opt(IDL.Text),\n 'max_dissolve_delay_seconds' : IDL.Opt(IDL.Nat64),\n 'max_dissolve_delay_bonus_percentage' : IDL.Opt(IDL.Nat64),\n 'nns_proposal_id' : IDL.Opt(IDL.Nat64),\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 'token_symbol' : IDL.Opt(IDL.Text),\n 'final_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),\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 'logo' : IDL.Opt(IDL.Text),\n 'name' : IDL.Opt(IDL.Text),\n 'swap_start_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'swap_due_timestamp_seconds' : 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 'description' : IDL.Opt(IDL.Text),\n 'max_neuron_age_seconds_for_age_bonus' : IDL.Opt(IDL.Nat64),\n 'min_participants' : IDL.Opt(IDL.Nat64),\n 'initial_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),\n 'wait_for_quiet_deadline_increase_seconds' : IDL.Opt(IDL.Nat64),\n 'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),\n 'dapp_canisters' : IDL.Opt(DappCanisters),\n 'neurons_fund_participation_constraints' : IDL.Opt(\n NeuronsFundParticipationConstraints\n ),\n 'neurons_fund_participants' : IDL.Opt(NeuronsFundParticipants),\n 'max_age_bonus_percentage' : IDL.Opt(IDL.Nat64),\n 'initial_token_distribution' : IDL.Opt(InitialTokenDistribution),\n 'reward_rate_transition_duration_seconds' : IDL.Opt(IDL.Nat64),\n 'token_logo' : IDL.Opt(IDL.Text),\n 'token_name' : IDL.Opt(IDL.Text),\n 'max_participant_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'proposal_reject_cost_e8s' : IDL.Opt(IDL.Nat64),\n 'restricted_countries' : IDL.Opt(Countries),\n 'min_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n const DeployNewSnsRequest = IDL.Record({\n 'sns_init_payload' : IDL.Opt(SnsInitPayload),\n });\n const DappCanistersTransferResult = IDL.Record({\n 'restored_dapp_canisters' : IDL.Vec(Canister),\n 'nns_controlled_dapp_canisters' : IDL.Vec(Canister),\n 'sns_controlled_dapp_canisters' : IDL.Vec(Canister),\n });\n const SnsCanisterIds = IDL.Record({\n 'root' : IDL.Opt(IDL.Principal),\n 'swap' : IDL.Opt(IDL.Principal),\n 'ledger' : IDL.Opt(IDL.Principal),\n 'index' : IDL.Opt(IDL.Principal),\n 'governance' : IDL.Opt(IDL.Principal),\n });\n const DeployNewSnsResponse = IDL.Record({\n 'dapp_canisters_transfer_result' : IDL.Opt(DappCanistersTransferResult),\n 'subnet_id' : IDL.Opt(IDL.Principal),\n 'error' : IDL.Opt(SnsWasmError),\n 'canisters' : IDL.Opt(SnsCanisterIds),\n });\n const GetAllowedPrincipalsResponse = IDL.Record({\n 'allowed_principals' : IDL.Vec(IDL.Principal),\n });\n const SnsVersion = 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 GetNextSnsVersionRequest = IDL.Record({\n 'governance_canister_id' : IDL.Opt(IDL.Principal),\n 'current_version' : IDL.Opt(SnsVersion),\n });\n const GetNextSnsVersionResponse = IDL.Record({\n 'next_version' : IDL.Opt(SnsVersion),\n });\n const GetSnsSubnetIdsResponse = IDL.Record({\n 'sns_subnet_ids' : IDL.Vec(IDL.Principal),\n });\n const GetWasmRequest = IDL.Record({ 'hash' : IDL.Vec(IDL.Nat8) });\n const GetWasmResponse = IDL.Record({ 'wasm' : IDL.Opt(SnsWasm) });\n const SnsUpgrade = IDL.Record({\n 'next_version' : IDL.Opt(SnsVersion),\n 'current_version' : IDL.Opt(SnsVersion),\n });\n const InsertUpgradePathEntriesRequest = IDL.Record({\n 'upgrade_path' : IDL.Vec(SnsUpgrade),\n 'sns_governance_canister_id' : IDL.Opt(IDL.Principal),\n });\n const InsertUpgradePathEntriesResponse = IDL.Record({\n 'error' : IDL.Opt(SnsWasmError),\n });\n const DeployedSns = IDL.Record({\n 'root_canister_id' : IDL.Opt(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 ListDeployedSnsesResponse = IDL.Record({\n 'instances' : IDL.Vec(DeployedSns),\n });\n const ListUpgradeStepsRequest = IDL.Record({\n 'limit' : IDL.Nat32,\n 'starting_at' : IDL.Opt(SnsVersion),\n 'sns_governance_canister_id' : IDL.Opt(IDL.Principal),\n });\n const PrettySnsVersion = IDL.Record({\n 'archive_wasm_hash' : IDL.Text,\n 'root_wasm_hash' : IDL.Text,\n 'swap_wasm_hash' : IDL.Text,\n 'ledger_wasm_hash' : IDL.Text,\n 'governance_wasm_hash' : IDL.Text,\n 'index_wasm_hash' : IDL.Text,\n });\n const ListUpgradeStep = IDL.Record({\n 'pretty_version' : IDL.Opt(PrettySnsVersion),\n 'version' : IDL.Opt(SnsVersion),\n });\n const ListUpgradeStepsResponse = IDL.Record({\n 'steps' : IDL.Vec(ListUpgradeStep),\n });\n const UpdateAllowedPrincipalsRequest = IDL.Record({\n 'added_principals' : IDL.Vec(IDL.Principal),\n 'removed_principals' : IDL.Vec(IDL.Principal),\n });\n const UpdateAllowedPrincipalsResult = IDL.Variant({\n 'Error' : SnsWasmError,\n 'AllowedPrincipals' : GetAllowedPrincipalsResponse,\n });\n const UpdateAllowedPrincipalsResponse = IDL.Record({\n 'update_allowed_principals_result' : IDL.Opt(UpdateAllowedPrincipalsResult),\n });\n const UpdateSnsSubnetListRequest = IDL.Record({\n 'sns_subnet_ids_to_add' : IDL.Vec(IDL.Principal),\n 'sns_subnet_ids_to_remove' : IDL.Vec(IDL.Principal),\n });\n const UpdateSnsSubnetListResponse = IDL.Record({\n 'error' : IDL.Opt(SnsWasmError),\n });\n return IDL.Service({\n 'add_wasm' : IDL.Func([AddWasmRequest], [AddWasmResponse], []),\n 'deploy_new_sns' : IDL.Func(\n [DeployNewSnsRequest],\n [DeployNewSnsResponse],\n [],\n ),\n 'get_allowed_principals' : IDL.Func(\n [IDL.Record({})],\n [GetAllowedPrincipalsResponse],\n ['query'],\n ),\n 'get_latest_sns_version_pretty' : IDL.Func(\n [IDL.Null],\n [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],\n ['query'],\n ),\n 'get_next_sns_version' : IDL.Func(\n [GetNextSnsVersionRequest],\n [GetNextSnsVersionResponse],\n ['query'],\n ),\n 'get_sns_subnet_ids' : IDL.Func(\n [IDL.Record({})],\n [GetSnsSubnetIdsResponse],\n ['query'],\n ),\n 'get_wasm' : IDL.Func([GetWasmRequest], [GetWasmResponse], ['query']),\n 'insert_upgrade_path_entries' : IDL.Func(\n [InsertUpgradePathEntriesRequest],\n [InsertUpgradePathEntriesResponse],\n [],\n ),\n 'list_deployed_snses' : IDL.Func(\n [IDL.Record({})],\n [ListDeployedSnsesResponse],\n ['query'],\n ),\n 'list_upgrade_steps' : IDL.Func(\n [ListUpgradeStepsRequest],\n [ListUpgradeStepsResponse],\n ['query'],\n ),\n 'update_allowed_principals' : IDL.Func(\n [UpdateAllowedPrincipalsRequest],\n [UpdateAllowedPrincipalsResponse],\n [],\n ),\n 'update_sns_subnet_list' : IDL.Func(\n [UpdateSnsSubnetListRequest],\n [UpdateSnsSubnetListResponse],\n [],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const SnsWasmCanisterInitPayload = IDL.Record({\n 'allowed_principals' : IDL.Vec(IDL.Principal),\n 'access_controls_enabled' : IDL.Bool,\n 'sns_subnet_ids' : IDL.Vec(IDL.Principal),\n });\n return [SnsWasmCanisterInitPayload];\n};\n"],
|
|
5
|
-
"mappings": "wCAAA,OAAS,kBAAAA,MAA4C,iBCC9C,IAAMC,EAAa,CAAC,CAAE,IAAAC,CAAI,IAAM,CACrC,IAAMC,EAA6BD,EAAI,OAAO,CAC5C,mBAAuBA,EAAI,IAAIA,EAAI,SAAS,EAC5C,wBAA4BA,EAAI,KAChC,eAAmBA,EAAI,IAAIA,EAAI,SAAS,CAC1C,CAAC,EACKE,EAAUF,EAAI,OAAO,CACzB,KAASA,EAAI,IAAIA,EAAI,IAAI,EACzB,cAAkBA,EAAI,KACxB,CAAC,EACKG,EAAiBH,EAAI,OAAO,CAChC,KAASA,EAAI,IAAIA,EAAI,IAAI,EACzB,KAASA,EAAI,IAAIE,CAAO,CAC1B,CAAC,EACKE,EAAeJ,EAAI,OAAO,CAAE,QAAYA,EAAI,IAAK,CAAC,EAClDK,EAASL,EAAI,QAAQ,CACzB,MAAUI,EACV,KAASJ,EAAI,IAAIA,EAAI,IAAI,CAC3B,CAAC,EACKM,EAAkBN,EAAI,OAAO,CAAE,OAAWA,EAAI,IAAIK,CAAM,CAAE,CAAC,EAC3DE,EAAqCP,EAAI,OAAO,CACpD,gCAAoCA,EAAI,MACxC,MAAUA,EAAI,KAChB,CAAC,EACKQ,EA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EAAI,KAChC,CAACoC,CAA+B,EAChC,CAACC,CAAgC,EACjC,CAAC,CACH,EACF,oBAAwBrC,EAAI,KACxB,CAACA,EAAI,OAAO,CAAC,CAAC,CAAC,EACf,CAACuC,CAAyB,EAC1B,CAAC,OAAO,CACV,EACF,mBAAuBvC,EAAI,KACvB,CAACwC,CAAuB,EACxB,CAACG,CAAwB,EACzB,CAAC,OAAO,CACV,EACF,0BAA8B3C,EAAI,KAC9B,CAAC4C,CAA8B,EAC/B,CAACE,CAA+B,EAChC,CAAC,CACH,EACF,uBAA2B9C,EAAI,KAC3B,CAAC+C,CAA0B,EAC3B,CAACC,CAA2B,EAC5B,CAAC,CACH,CACJ,CAAC,CACH,EF5QO,IAAMC,EAAN,MAAMC,CAAgB,CACnB,YACWC,EACAC,EACjB,CAFiB,aAAAD,EACA,sBAAAC,EAgBnB,KAAO,UAAY,MAAO,CACxB,UAAAC,EAAY,EACd,IAE8B,CAC5B,IAAMF,EAAUE,EAAY,KAAK,iBAAmB,KAAK,QAEnD,CAAE,UAAAC,CAAU,EAAI,MAAMH,EAAQ,oBAAoB,CAAC,CAAC,EAC1D,OAAOG,CACT,CAxBG,CAEH,OAAc,OAAOC,EAA2C,CAAC,EAAG,CAClE,GAAM,CAAE,QAAAJ,EAAS,iBAAAC,CAAiB,EAAII,EAA+B,CACnE,QAAS,CACP,GAAGD,EACH,WAAYA,EAAQ,YAAcE,CACpC,EACA,WAAAC,EACA,oBAAAA,CACF,CAAC,EAED,OAAO,IAAIR,EAAgBC,EAASC,CAAgB,CACtD,CAYF",
|
|
6
|
-
"names": ["createServices", "idlFactory", "IDL", "SnsWasmCanisterInitPayload", "SnsWasm", "AddWasmRequest", "SnsWasmError", "Result", "AddWasmResponse", "NeuronBasketConstructionParameters", "Canister", "DappCanisters", "LinearScalingCoefficient", "NeuronsFundParticipationConstraints", "CfNeuron", "CfParticipant", "NeuronsFundParticipants", "TreasuryDistribution", "NeuronDistribution", "DeveloperDistribution", "AirdropDistribution", "SwapDistribution", "FractionalDeveloperVotingPower", "InitialTokenDistribution", "Countries", "SnsInitPayload", "DeployNewSnsRequest", "DappCanistersTransferResult", "SnsCanisterIds", "DeployNewSnsResponse", "GetAllowedPrincipalsResponse", "SnsVersion", "GetNextSnsVersionRequest", "GetNextSnsVersionResponse", "GetSnsSubnetIdsResponse", "GetWasmRequest", "GetWasmResponse", "SnsUpgrade", "InsertUpgradePathEntriesRequest", "InsertUpgradePathEntriesResponse", "DeployedSns", "ListDeployedSnsesResponse", "ListUpgradeStepsRequest", "PrettySnsVersion", "ListUpgradeStep", "ListUpgradeStepsResponse", "UpdateAllowedPrincipalsRequest", "UpdateAllowedPrincipalsResult", "UpdateAllowedPrincipalsResponse", "UpdateSnsSubnetListRequest", "UpdateSnsSubnetListResponse", "idlFactory", "IDL", "SnsWasmCanisterInitPayload", "SnsWasm", "AddWasmRequest", "SnsWasmError", "Result", "AddWasmResponse", "NeuronBasketConstructionParameters", "Canister", "DappCanisters", "LinearScalingCoefficient", "NeuronsFundParticipationConstraints", "CfNeuron", "CfParticipant", "NeuronsFundParticipants", "TreasuryDistribution", "NeuronDistribution", "DeveloperDistribution", "AirdropDistribution", "SwapDistribution", "FractionalDeveloperVotingPower", "InitialTokenDistribution", "Countries", "SnsInitPayload", "DeployNewSnsRequest", "DappCanistersTransferResult", "SnsCanisterIds", "DeployNewSnsResponse", "GetAllowedPrincipalsResponse", "SnsVersion", "GetNextSnsVersionRequest", "GetNextSnsVersionResponse", "GetSnsSubnetIdsResponse", "GetWasmRequest", "GetWasmResponse", "SnsUpgrade", "InsertUpgradePathEntriesRequest", "InsertUpgradePathEntriesResponse", "DeployedSns", "ListDeployedSnsesResponse", "ListUpgradeStepsRequest", "PrettySnsVersion", "ListUpgradeStep", "ListUpgradeStepsResponse", "UpdateAllowedPrincipalsRequest", "UpdateAllowedPrincipalsResult", "UpdateAllowedPrincipalsResponse", "UpdateSnsSubnetListRequest", "UpdateSnsSubnetListResponse", "SnsWasmCanister", "_SnsWasmCanister", "service", "certifiedService", "certified", "instances", "options", "createServices", "MAINNET_SNS_WASM_CANISTER_ID", "idlFactory"]
|
|
7
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{a as Se,b as ur,c as Vn}from"./chunk-KCY3PAEP.js";var Hn=Se(Ee=>{"use strict";Ee.byteLength=Nr;Ee.toByteArray=hr;Ee.fromByteArray=br;var E=[],T=[],gr=typeof Uint8Array<"u"?Uint8Array:Array,dn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ne=0,Un=dn.length;ne<Un;++ne)E[ne]=dn[ne],T[dn.charCodeAt(ne)]=ne;var ne,Un;T["-".charCodeAt(0)]=62;T["_".charCodeAt(0)]=63;function Kn(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var o=n===t?0:4-n%4;return[n,o]}function Nr(e){var t=Kn(e),n=t[0],o=t[1];return(n+o)*3/4-o}function Rr(e,t,n){return(t+n)*3/4-n}function hr(e){var t,n=Kn(e),o=n[0],r=n[1],i=new gr(Rr(e,o,r)),s=0,c=r>0?o-4:o,u;for(u=0;u<c;u+=4)t=T[e.charCodeAt(u)]<<18|T[e.charCodeAt(u+1)]<<12|T[e.charCodeAt(u+2)]<<6|T[e.charCodeAt(u+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=t&255;return r===2&&(t=T[e.charCodeAt(u)]<<2|T[e.charCodeAt(u+1)]>>4,i[s++]=t&255),r===1&&(t=T[e.charCodeAt(u)]<<10|T[e.charCodeAt(u+1)]<<4|T[e.charCodeAt(u+2)]>>2,i[s++]=t>>8&255,i[s++]=t&255),i}function vr(e){return E[e>>18&63]+E[e>>12&63]+E[e>>6&63]+E[e&63]}function Or(e,t,n){for(var o,r=[],i=t;i<n;i+=3)o=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),r.push(vr(o));return r.join("")}function br(e){for(var t,n=e.length,o=n%3,r=[],i=16383,s=0,c=n-o;s<c;s+=i)r.push(Or(e,s,s+i>c?c:s+i));return o===1?(t=e[n-1],r.push(E[t>>2]+E[t<<4&63]+"==")):o===2&&(t=(e[n-2]<<8)+e[n-1],r.push(E[t>>10]+E[t>>4&63]+E[t<<2&63]+"=")),r.join("")}});var Wn=Se(pn=>{pn.read=function(e,t,n,o,r){var i,s,c=r*8-o-1,u=(1<<c)-1,m=u>>1,f=-7,p=n?r-1:0,y=n?-1:1,w=e[t+p];for(p+=y,i=w&(1<<-f)-1,w>>=-f,f+=c;f>0;i=i*256+e[t+p],p+=y,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=o;f>0;s=s*256+e[t+p],p+=y,f-=8);if(i===0)i=1-m;else{if(i===u)return s?NaN:(w?-1:1)*(1/0);s=s+Math.pow(2,o),i=i-m}return(w?-1:1)*s*Math.pow(2,i-o)};pn.write=function(e,t,n,o,r,i){var s,c,u,m=i*8-r-1,f=(1<<m)-1,p=f>>1,y=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=o?0:i-1,O=o?1:-1,_=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+p>=1?t+=y/u:t+=y*Math.pow(2,1-p),t*u>=2&&(s++,u/=2),s+p>=f?(c=0,s=f):s+p>=1?(c=(t*u-1)*Math.pow(2,r),s=s+p):(c=t*Math.pow(2,p-1)*Math.pow(2,r),s=0));r>=8;e[n+w]=c&255,w+=O,c/=256,r-=8);for(s=s<<r|c,m+=r;m>0;e[n+w]=s&255,w+=O,s/=256,m-=8);e[n+w-O]|=_*128}});var eo=Se(ie=>{"use strict";var ln=Hn(),re=Wn(),Gn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ie.Buffer=a;ie.SlowBuffer=Pr;ie.INSPECT_MAX_BYTES=50;var Ve=2147483647;ie.kMaxLength=Ve;a.TYPED_ARRAY_SUPPORT=xr();!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function xr(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}});Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function j(e){if(e>Ve)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,n){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return wn(e)}return zn(e,t,n)}a.poolSize=8192;function zn(e,t,n){if(typeof e=="string")return kr(e,t);if(ArrayBuffer.isView(e))return Tr(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(V(e,ArrayBuffer)||e&&V(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(V(e,SharedArrayBuffer)||e&&V(e.buffer,SharedArrayBuffer)))return mn(e,t,n);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var o=e.valueOf&&e.valueOf();if(o!=null&&o!==e)return a.from(o,t,n);var r=Cr(e);if(r)return r;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return a.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}a.from=function(e,t,n){return zn(e,t,n)};Object.setPrototypeOf(a.prototype,Uint8Array.prototype);Object.setPrototypeOf(a,Uint8Array);function Jn(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function Sr(e,t,n){return Jn(e),e<=0?j(e):t!==void 0?typeof n=="string"?j(e).fill(t,n):j(e).fill(t):j(e)}a.alloc=function(e,t,n){return Sr(e,t,n)};function wn(e){return Jn(e),j(e<0?0:yn(e)|0)}a.allocUnsafe=function(e){return wn(e)};a.allocUnsafeSlow=function(e){return wn(e)};function kr(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=Xn(e,t)|0,o=j(n),r=o.write(e,t);return r!==n&&(o=o.slice(0,r)),o}function _n(e){for(var t=e.length<0?0:yn(e.length)|0,n=j(t),o=0;o<t;o+=1)n[o]=e[o]&255;return n}function Tr(e){if(V(e,Uint8Array)){var t=new Uint8Array(e);return mn(t.buffer,t.byteOffset,t.byteLength)}return _n(e)}function mn(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var o;return t===void 0&&n===void 0?o=new Uint8Array(e):n===void 0?o=new Uint8Array(e,t):o=new Uint8Array(e,t,n),Object.setPrototypeOf(o,a.prototype),o}function Cr(e){if(a.isBuffer(e)){var t=yn(e.length)|0,n=j(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!="number"||gn(e.length)?j(0):_n(e);if(e.type==="Buffer"&&Array.isArray(e.data))return _n(e.data)}function yn(e){if(e>=Ve)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ve.toString(16)+" bytes");return e|0}function Pr(e){return+e!=e&&(e=0),a.alloc(+e)}a.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==a.prototype};a.compare=function(t,n){if(V(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),V(n,Uint8Array)&&(n=a.from(n,n.offset,n.byteLength)),!a.isBuffer(t)||!a.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===n)return 0;for(var o=t.length,r=n.length,i=0,s=Math.min(o,r);i<s;++i)if(t[i]!==n[i]){o=t[i],r=n[i];break}return o<r?-1:r<o?1:0};a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(t,n){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return a.alloc(0);var o;if(n===void 0)for(n=0,o=0;o<t.length;++o)n+=t[o].length;var r=a.allocUnsafe(n),i=0;for(o=0;o<t.length;++o){var s=t[o];if(V(s,Uint8Array))i+s.length>r.length?a.from(s).copy(r,i):Uint8Array.prototype.set.call(r,s,i);else if(a.isBuffer(s))s.copy(r,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=s.length}return r};function Xn(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||V(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,o=arguments.length>2&&arguments[2]===!0;if(!o&&n===0)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return fn(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Ln(e).length;default:if(r)return o?-1:fn(e).length;t=(""+t).toLowerCase(),r=!0}}a.byteLength=Xn;function Mr(e,t,n){var o=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Wr(this,t,n);case"utf8":case"utf-8":return Qn(this,t,n);case"ascii":return Kr(this,t,n);case"latin1":case"binary":return Hr(this,t,n);case"base64":return qr(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Gr(this,t,n);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}a.prototype._isBuffer=!0;function oe(e,t,n){var o=e[t];e[t]=e[n],e[n]=o}a.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<t;n+=2)oe(this,n,n+1);return this};a.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<t;n+=4)oe(this,n,n+3),oe(this,n+1,n+2);return this};a.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<t;n+=8)oe(this,n,n+7),oe(this,n+1,n+6),oe(this,n+2,n+5),oe(this,n+3,n+4);return this};a.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?Qn(this,0,t):Mr.apply(this,arguments)};a.prototype.toLocaleString=a.prototype.toString;a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:a.compare(this,t)===0};a.prototype.inspect=function(){var t="",n=ie.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"};Gn&&(a.prototype[Gn]=a.prototype.inspect);a.prototype.compare=function(t,n,o,r,i){if(V(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(n===void 0&&(n=0),o===void 0&&(o=t?t.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),n<0||o>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&n>=o)return 0;if(r>=i)return-1;if(n>=o)return 1;if(n>>>=0,o>>>=0,r>>>=0,i>>>=0,this===t)return 0;for(var s=i-r,c=o-n,u=Math.min(s,c),m=this.slice(r,i),f=t.slice(n,o),p=0;p<u;++p)if(m[p]!==f[p]){s=m[p],c=f[p];break}return s<c?-1:c<s?1:0};function Yn(e,t,n,o,r){if(e.length===0)return-1;if(typeof n=="string"?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,gn(n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0)if(r)n=0;else return-1;if(typeof t=="string"&&(t=a.from(t,o)),a.isBuffer(t))return t.length===0?-1:jn(e,t,n,o,r);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):jn(e,[t],n,o,r);throw new TypeError("val must be string, number or Buffer")}function jn(e,t,n,o,r){var i=1,s=e.length,c=t.length;if(o!==void 0&&(o=String(o).toLowerCase(),o==="ucs2"||o==="ucs-2"||o==="utf16le"||o==="utf-16le")){if(e.length<2||t.length<2)return-1;i=2,s/=2,c/=2,n/=2}function u(w,O){return i===1?w[O]:w.readUInt16BE(O*i)}var m;if(r){var f=-1;for(m=n;m<s;m++)if(u(e,m)===u(t,f===-1?0:m-f)){if(f===-1&&(f=m),m-f+1===c)return f*i}else f!==-1&&(m-=m-f),f=-1}else for(n+c>s&&(n=s-c),m=n;m>=0;m--){for(var p=!0,y=0;y<c;y++)if(u(e,m+y)!==u(t,y)){p=!1;break}if(p)return m}return-1}a.prototype.includes=function(t,n,o){return this.indexOf(t,n,o)!==-1};a.prototype.indexOf=function(t,n,o){return Yn(this,t,n,o,!0)};a.prototype.lastIndexOf=function(t,n,o){return Yn(this,t,n,o,!1)};function Ar(e,t,n,o){n=Number(n)||0;var r=e.length-n;o?(o=Number(o),o>r&&(o=r)):o=r;var i=t.length;o>i/2&&(o=i/2);for(var s=0;s<o;++s){var c=parseInt(t.substr(s*2,2),16);if(gn(c))return s;e[n+s]=c}return s}function Er(e,t,n,o){return Be(fn(t,e.length-n),e,n,o)}function Vr(e,t,n,o){return Be(zr(t),e,n,o)}function Br(e,t,n,o){return Be(Ln(t),e,n,o)}function Fr(e,t,n,o){return Be(Jr(t,e.length-n),e,n,o)}a.prototype.write=function(t,n,o,r){if(n===void 0)r="utf8",o=this.length,n=0;else if(o===void 0&&typeof n=="string")r=n,o=this.length,n=0;else if(isFinite(n))n=n>>>0,isFinite(o)?(o=o>>>0,r===void 0&&(r="utf8")):(r=o,o=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-n;if((o===void 0||o>i)&&(o=i),t.length>0&&(o<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return Ar(this,t,n,o);case"utf8":case"utf-8":return Er(this,t,n,o);case"ascii":case"latin1":case"binary":return Vr(this,t,n,o);case"base64":return Br(this,t,n,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Fr(this,t,n,o);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function qr(e,t,n){return t===0&&n===e.length?ln.fromByteArray(e):ln.fromByteArray(e.slice(t,n))}function Qn(e,t,n){n=Math.min(e.length,n);for(var o=[],r=t;r<n;){var i=e[r],s=null,c=i>239?4:i>223?3:i>191?2:1;if(r+c<=n){var u,m,f,p;switch(c){case 1:i<128&&(s=i);break;case 2:u=e[r+1],(u&192)===128&&(p=(i&31)<<6|u&63,p>127&&(s=p));break;case 3:u=e[r+1],m=e[r+2],(u&192)===128&&(m&192)===128&&(p=(i&15)<<12|(u&63)<<6|m&63,p>2047&&(p<55296||p>57343)&&(s=p));break;case 4:u=e[r+1],m=e[r+2],f=e[r+3],(u&192)===128&&(m&192)===128&&(f&192)===128&&(p=(i&15)<<18|(u&63)<<12|(m&63)<<6|f&63,p>65535&&p<1114112&&(s=p))}}s===null?(s=65533,c=1):s>65535&&(s-=65536,o.push(s>>>10&1023|55296),s=56320|s&1023),o.push(s),r+=c}return Ur(o)}var $n=4096;function Ur(e){var t=e.length;if(t<=$n)return String.fromCharCode.apply(String,e);for(var n="",o=0;o<t;)n+=String.fromCharCode.apply(String,e.slice(o,o+=$n));return n}function Kr(e,t,n){var o="";n=Math.min(e.length,n);for(var r=t;r<n;++r)o+=String.fromCharCode(e[r]&127);return o}function Hr(e,t,n){var o="";n=Math.min(e.length,n);for(var r=t;r<n;++r)o+=String.fromCharCode(e[r]);return o}function Wr(e,t,n){var o=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>o)&&(n=o);for(var r="",i=t;i<n;++i)r+=Xr[e[i]];return r}function Gr(e,t,n){for(var o=e.slice(t,n),r="",i=0;i<o.length-1;i+=2)r+=String.fromCharCode(o[i]+o[i+1]*256);return r}a.prototype.slice=function(t,n){var o=this.length;t=~~t,n=n===void 0?o:~~n,t<0?(t+=o,t<0&&(t=0)):t>o&&(t=o),n<0?(n+=o,n<0&&(n=0)):n>o&&(n=o),n<t&&(n=t);var r=this.subarray(t,n);return Object.setPrototypeOf(r,a.prototype),r};function R(e,t,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(t,n,o){t=t>>>0,n=n>>>0,o||R(t,n,this.length);for(var r=this[t],i=1,s=0;++s<n&&(i*=256);)r+=this[t+s]*i;return r};a.prototype.readUintBE=a.prototype.readUIntBE=function(t,n,o){t=t>>>0,n=n>>>0,o||R(t,n,this.length);for(var r=this[t+--n],i=1;n>0&&(i*=256);)r+=this[t+--n]*i;return r};a.prototype.readUint8=a.prototype.readUInt8=function(t,n){return t=t>>>0,n||R(t,1,this.length),this[t]};a.prototype.readUint16LE=a.prototype.readUInt16LE=function(t,n){return t=t>>>0,n||R(t,2,this.length),this[t]|this[t+1]<<8};a.prototype.readUint16BE=a.prototype.readUInt16BE=function(t,n){return t=t>>>0,n||R(t,2,this.length),this[t]<<8|this[t+1]};a.prototype.readUint32LE=a.prototype.readUInt32LE=function(t,n){return t=t>>>0,n||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};a.prototype.readUint32BE=a.prototype.readUInt32BE=function(t,n){return t=t>>>0,n||R(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};a.prototype.readIntLE=function(t,n,o){t=t>>>0,n=n>>>0,o||R(t,n,this.length);for(var r=this[t],i=1,s=0;++s<n&&(i*=256);)r+=this[t+s]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*n)),r};a.prototype.readIntBE=function(t,n,o){t=t>>>0,n=n>>>0,o||R(t,n,this.length);for(var r=n,i=1,s=this[t+--r];r>0&&(i*=256);)s+=this[t+--r]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*n)),s};a.prototype.readInt8=function(t,n){return t=t>>>0,n||R(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};a.prototype.readInt16LE=function(t,n){t=t>>>0,n||R(t,2,this.length);var o=this[t]|this[t+1]<<8;return o&32768?o|4294901760:o};a.prototype.readInt16BE=function(t,n){t=t>>>0,n||R(t,2,this.length);var o=this[t+1]|this[t]<<8;return o&32768?o|4294901760:o};a.prototype.readInt32LE=function(t,n){return t=t>>>0,n||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};a.prototype.readInt32BE=function(t,n){return t=t>>>0,n||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};a.prototype.readFloatLE=function(t,n){return t=t>>>0,n||R(t,4,this.length),re.read(this,t,!0,23,4)};a.prototype.readFloatBE=function(t,n){return t=t>>>0,n||R(t,4,this.length),re.read(this,t,!1,23,4)};a.prototype.readDoubleLE=function(t,n){return t=t>>>0,n||R(t,8,this.length),re.read(this,t,!0,52,8)};a.prototype.readDoubleBE=function(t,n){return t=t>>>0,n||R(t,8,this.length),re.read(this,t,!1,52,8)};function S(e,t,n,o,r,i){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<i)throw new RangeError('"value" argument is out of bounds');if(n+o>e.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(t,n,o,r){if(t=+t,n=n>>>0,o=o>>>0,!r){var i=Math.pow(2,8*o)-1;S(this,t,n,o,i,0)}var s=1,c=0;for(this[n]=t&255;++c<o&&(s*=256);)this[n+c]=t/s&255;return n+o};a.prototype.writeUintBE=a.prototype.writeUIntBE=function(t,n,o,r){if(t=+t,n=n>>>0,o=o>>>0,!r){var i=Math.pow(2,8*o)-1;S(this,t,n,o,i,0)}var s=o-1,c=1;for(this[n+s]=t&255;--s>=0&&(c*=256);)this[n+s]=t/c&255;return n+o};a.prototype.writeUint8=a.prototype.writeUInt8=function(t,n,o){return t=+t,n=n>>>0,o||S(this,t,n,1,255,0),this[n]=t&255,n+1};a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(t,n,o){return t=+t,n=n>>>0,o||S(this,t,n,2,65535,0),this[n]=t&255,this[n+1]=t>>>8,n+2};a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(t,n,o){return t=+t,n=n>>>0,o||S(this,t,n,2,65535,0),this[n]=t>>>8,this[n+1]=t&255,n+2};a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(t,n,o){return t=+t,n=n>>>0,o||S(this,t,n,4,4294967295,0),this[n+3]=t>>>24,this[n+2]=t>>>16,this[n+1]=t>>>8,this[n]=t&255,n+4};a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(t,n,o){return t=+t,n=n>>>0,o||S(this,t,n,4,4294967295,0),this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255,n+4};a.prototype.writeIntLE=function(t,n,o,r){if(t=+t,n=n>>>0,!r){var i=Math.pow(2,8*o-1);S(this,t,n,o,i-1,-i)}var s=0,c=1,u=0;for(this[n]=t&255;++s<o&&(c*=256);)t<0&&u===0&&this[n+s-1]!==0&&(u=1),this[n+s]=(t/c>>0)-u&255;return n+o};a.prototype.writeIntBE=function(t,n,o,r){if(t=+t,n=n>>>0,!r){var i=Math.pow(2,8*o-1);S(this,t,n,o,i-1,-i)}var s=o-1,c=1,u=0;for(this[n+s]=t&255;--s>=0&&(c*=256);)t<0&&u===0&&this[n+s+1]!==0&&(u=1),this[n+s]=(t/c>>0)-u&255;return n+o};a.prototype.writeInt8=function(t,n,o){return t=+t,n=n>>>0,o||S(this,t,n,1,127,-128),t<0&&(t=255+t+1),this[n]=t&255,n+1};a.prototype.writeInt16LE=function(t,n,o){return t=+t,n=n>>>0,o||S(this,t,n,2,32767,-32768),this[n]=t&255,this[n+1]=t>>>8,n+2};a.prototype.writeInt16BE=function(t,n,o){return t=+t,n=n>>>0,o||S(this,t,n,2,32767,-32768),this[n]=t>>>8,this[n+1]=t&255,n+2};a.prototype.writeInt32LE=function(t,n,o){return t=+t,n=n>>>0,o||S(this,t,n,4,2147483647,-2147483648),this[n]=t&255,this[n+1]=t>>>8,this[n+2]=t>>>16,this[n+3]=t>>>24,n+4};a.prototype.writeInt32BE=function(t,n,o){return t=+t,n=n>>>0,o||S(this,t,n,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255,n+4};function Zn(e,t,n,o,r,i){if(n+o>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function In(e,t,n,o,r){return t=+t,n=n>>>0,r||Zn(e,t,n,4,34028234663852886e22,-34028234663852886e22),re.write(e,t,n,o,23,4),n+4}a.prototype.writeFloatLE=function(t,n,o){return In(this,t,n,!0,o)};a.prototype.writeFloatBE=function(t,n,o){return In(this,t,n,!1,o)};function Dn(e,t,n,o,r){return t=+t,n=n>>>0,r||Zn(e,t,n,8,17976931348623157e292,-17976931348623157e292),re.write(e,t,n,o,52,8),n+8}a.prototype.writeDoubleLE=function(t,n,o){return Dn(this,t,n,!0,o)};a.prototype.writeDoubleBE=function(t,n,o){return Dn(this,t,n,!1,o)};a.prototype.copy=function(t,n,o,r){if(!a.isBuffer(t))throw new TypeError("argument should be a Buffer");if(o||(o=0),!r&&r!==0&&(r=this.length),n>=t.length&&(n=t.length),n||(n=0),r>0&&r<o&&(r=o),r===o||t.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(o<0||o>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-n<r-o&&(r=t.length-n+o);var i=r-o;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(n,o,r):Uint8Array.prototype.set.call(t,this.subarray(o,r),n),i};a.prototype.fill=function(t,n,o,r){if(typeof t=="string"){if(typeof n=="string"?(r=n,n=0,o=this.length):typeof o=="string"&&(r=o,o=this.length),r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(t.length===1){var i=t.charCodeAt(0);(r==="utf8"&&i<128||r==="latin1")&&(t=i)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(n<0||this.length<n||this.length<o)throw new RangeError("Out of range index");if(o<=n)return this;n=n>>>0,o=o===void 0?this.length:o>>>0,t||(t=0);var s;if(typeof t=="number")for(s=n;s<o;++s)this[s]=t;else{var c=a.isBuffer(t)?t:a.from(t,r),u=c.length;if(u===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<o-n;++s)this[s+n]=c[s%u]}return this};var jr=/[^+/0-9A-Za-z-_]/g;function $r(e){if(e=e.split("=")[0],e=e.trim().replace(jr,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function fn(e,t){t=t||1/0;for(var n,o=e.length,r=null,i=[],s=0;s<o;++s){if(n=e.charCodeAt(s),n>55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}else if(s+1===o){(t-=3)>-1&&i.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),r=n;continue}n=(r-55296<<10|n-56320)+65536}else r&&(t-=3)>-1&&i.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return i}function zr(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function Jr(e,t){for(var n,o,r,i=[],s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),o=n>>8,r=n%256,i.push(r),i.push(o);return i}function Ln(e){return ln.toByteArray($r(e))}function Be(e,t,n,o){for(var r=0;r<o&&!(r+n>=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function V(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function gn(e){return e!==e}var Xr=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var o=n*16,r=0;r<16;++r)t[o+r]=e[n]+e[r];return t}()});var oo=Se((Nn,no)=>{var Fe=eo(),$=Fe.Buffer;function to(e,t){for(var n in e)t[n]=e[n]}$.from&&$.alloc&&$.allocUnsafe&&$.allocUnsafeSlow?no.exports=Fe:(to(Fe,Nn),Nn.Buffer=se);function se(e,t,n){return $(e,t,n)}to($,se);se.from=function(e,t,n){if(typeof e=="number")throw new TypeError("Argument must not be a number");return $(e,t,n)};se.alloc=function(e,t,n){if(typeof e!="number")throw new TypeError("Argument must be a number");var o=$(e);return t!==void 0?typeof n=="string"?o.fill(t,n):o.fill(t):o.fill(0),o};se.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return $(e)};se.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Fe.SlowBuffer(e)}});var ro=Se((Ns,hn)=>{"use strict";var Rn=65536,Yr=4294967295;function Qr(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
2
|
-
Use Chrome, Firefox or Internet Explorer 11`)}var Zr=oo().Buffer,qe=window.crypto||window.msCrypto;qe&&qe.getRandomValues?hn.exports=Ir:hn.exports=Qr;function Ir(e,t){if(e>Yr)throw new RangeError("requested too many random bytes");var n=Zr.allocUnsafe(e);if(e>0)if(e>Rn)for(var o=0;o<e;o+=Rn)qe.getRandomValues(n.slice(o,o+Rn));else qe.getRandomValues(n);return typeof t=="function"?process.nextTick(function(){t(null,n)}):n}});import{AccountIdentifier as Pn,SubAccount as os,checkAccountId as ir}from"@dfinity/ledger-icp";import{arrayOfNumberToUint8Array as rs,asciiStringToByteArray as is,assertPercentageNumber as Mn,createServices as ss,fromNullable as k,isNullish as An,nonNullish as A,uint8ArrayToBigInt as sr}from"@dfinity/utils";function dr(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function an(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Bn(e,t){dr(e);let n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}var pr=e=>e instanceof Uint8Array;var Me=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),P=(e,t)=>e<<32-t|e>>>t,lr=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!lr)throw new Error("Non little-endian hardware is not supported");function _r(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function cn(e){if(typeof e=="string"&&(e=_r(e)),!pr(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}var Pe=class{clone(){return this._cloneInto()}},cs={}.toString;function Fn(e){let t=o=>e().update(cn(o)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function mr(e,t,n,o){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,o);let r=BigInt(32),i=BigInt(4294967295),s=Number(n>>r&i),c=Number(n&i),u=o?4:0,m=o?0:4;e.setUint32(t+u,s,o),e.setUint32(t+m,c,o)}var Ae=class extends Pe{constructor(t,n,o,r){super(),this.blockLen=t,this.outputLen=n,this.padOffset=o,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Me(this.buffer)}update(t){an(this);let{view:n,buffer:o,blockLen:r}=this;t=cn(t);let i=t.length;for(let s=0;s<i;){let c=Math.min(r-this.pos,i-s);if(c===r){let u=Me(t);for(;r<=i-s;s+=r)this.process(u,s);continue}o.set(t.subarray(s,s+c),this.pos),this.pos+=c,s+=c,this.pos===r&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){an(this),Bn(t,this),this.finished=!0;let{buffer:n,view:o,blockLen:r,isLE:i}=this,{pos:s}=this;n[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>r-s&&(this.process(o,0),s=0);for(let p=s;p<r;p++)n[p]=0;mr(o,r-8,BigInt(this.length*8),i),this.process(o,0);let c=Me(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let m=u/4,f=this.get();if(m>f.length)throw new Error("_sha2: outputLen bigger than state");for(let p=0;p<m;p++)c.setUint32(4*p,f[p],i)}digest(){let{buffer:t,outputLen:n}=this;this.digestInto(t);let o=t.slice(0,n);return this.destroy(),o}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:n,buffer:o,length:r,finished:i,destroyed:s,pos:c}=this;return t.length=r,t.pos=c,t.finished=i,t.destroyed=s,r%n&&t.buffer.set(o),t}};var fr=(e,t,n)=>e&t^~e&n,wr=(e,t,n)=>e&t^e&n^t&n,yr=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),X=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Y=new Uint32Array(64),un=class extends Ae{constructor(){super(64,32,8,!1),this.A=X[0]|0,this.B=X[1]|0,this.C=X[2]|0,this.D=X[3]|0,this.E=X[4]|0,this.F=X[5]|0,this.G=X[6]|0,this.H=X[7]|0}get(){let{A:t,B:n,C:o,D:r,E:i,F:s,G:c,H:u}=this;return[t,n,o,r,i,s,c,u]}set(t,n,o,r,i,s,c,u){this.A=t|0,this.B=n|0,this.C=o|0,this.D=r|0,this.E=i|0,this.F=s|0,this.G=c|0,this.H=u|0}process(t,n){for(let p=0;p<16;p++,n+=4)Y[p]=t.getUint32(n,!1);for(let p=16;p<64;p++){let y=Y[p-15],w=Y[p-2],O=P(y,7)^P(y,18)^y>>>3,_=P(w,17)^P(w,19)^w>>>10;Y[p]=_+Y[p-7]+O+Y[p-16]|0}let{A:o,B:r,C:i,D:s,E:c,F:u,G:m,H:f}=this;for(let p=0;p<64;p++){let y=P(c,6)^P(c,11)^P(c,25),w=f+y+fr(c,u,m)+yr[p]+Y[p]|0,_=(P(o,2)^P(o,13)^P(o,22))+wr(o,r,i)|0;f=m,m=u,u=c,c=s+w|0,s=i,i=r,r=o,o=w+_|0}o=o+this.A|0,r=r+this.B|0,i=i+this.C|0,s=s+this.D|0,c=c+this.E|0,u=u+this.F|0,m=m+this.G|0,f=f+this.H|0,this.set(o,r,i,s,c,u,m,f)}roundClean(){Y.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var qn=Fn(()=>new un);var En=ur(ro());var io=({IDL:e})=>{let t=e.Rec(),n=e.Record({id:e.Nat64}),o=e.Record({followees:e.Vec(n)}),r=e.Record({hash:e.Vec(e.Nat8)}),i=e.Record({id:e.Opt(e.Principal),reward_account:e.Opt(r)}),s=e.Record({dissolve_delay_seconds:e.Nat64}),c=e.Record({to_account:e.Opt(r)}),u=e.Variant({RewardToNeuron:s,RewardToAccount:c}),m=e.Record({node_provider:e.Opt(i),reward_mode:e.Opt(u),amount_e8s:e.Nat64}),f=e.Record({timestamp:e.Nat64,rewards:e.Vec(m)}),p=e.Record({not_dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),garbage_collectable_neurons_count:e.Nat64,neurons_with_invalid_stake_count:e.Nat64,not_dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),total_supply_icp:e.Nat64,neurons_with_less_than_6_months_dissolve_delay_count:e.Nat64,dissolved_neurons_count:e.Nat64,community_fund_total_maturity_e8s_equivalent:e.Nat64,total_staked_e8s:e.Nat64,not_dissolving_neurons_count:e.Nat64,total_locked_e8s:e.Nat64,dissolved_neurons_e8s:e.Nat64,neurons_with_less_than_6_months_dissolve_delay_e8s:e.Nat64,dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),dissolving_neurons_count:e.Nat64,dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),community_fund_total_staked_e8s:e.Nat64,timestamp_seconds:e.Nat64}),y=e.Record({neuron_minimum_stake_e8s:e.Nat64,max_proposals_to_keep_per_topic:e.Nat32,neuron_management_fee_per_proposal_e8s:e.Nat64,reject_cost_e8s:e.Nat64,transaction_fee_e8s:e.Nat64,neuron_spawn_dissolve_delay_seconds:e.Nat64,minimum_icp_xdr_rate:e.Nat64,maximum_node_provider_rewards_e8s:e.Nat64}),w=e.Record({rounds_since_last_distribution:e.Opt(e.Nat64),day_after_genesis:e.Nat64,actual_timestamp_seconds:e.Nat64,total_available_e8s_equivalent:e.Nat64,latest_round_available_e8s_equivalent:e.Opt(e.Nat64),distributed_e8s_equivalent:e.Nat64,settled_proposals:e.Vec(n)}),O=e.Record({to_subaccount:e.Vec(e.Nat8),neuron_stake_e8s:e.Nat64,from:e.Opt(e.Principal),memo:e.Nat64,from_subaccount:e.Vec(e.Nat8),transfer_timestamp:e.Nat64,block_height:e.Nat64}),_=e.Record({error_message:e.Text,error_type:e.Int32}),ze=e.Record({nns_neuron_id:e.Nat64,amount_icp_e8s:e.Nat64}),Je=e.Record({hotkey_principal:e.Text,cf_neurons:e.Vec(ze)}),ce=e.Record({vote:e.Int32,voting_power:e.Nat64}),Xe=e.Record({status:e.Opt(e.Int32),freezing_threshold:e.Opt(e.Nat64),controllers:e.Vec(e.Principal),memory_size:e.Opt(e.Nat64),cycles:e.Opt(e.Nat64),idle_cycles_burned_per_day:e.Opt(e.Nat64),module_hash:e.Vec(e.Nat8)}),b=e.Record({status:e.Opt(Xe),canister_id:e.Opt(e.Principal)}),Ye=e.Record({ledger_index_canister_summary:e.Opt(b),fallback_controller_principal_ids:e.Vec(e.Principal),ledger_archive_canister_summaries:e.Vec(b),ledger_canister_summary:e.Opt(b),swap_canister_summary:e.Opt(b),governance_canister_summary:e.Opt(b),root_canister_summary:e.Opt(b),dapp_canister_summaries:e.Vec(b)}),ue=e.Record({swap_background_information:e.Opt(Ye)}),de=e.Record({no:e.Nat64,yes:e.Nat64,total:e.Nat64,timestamp_seconds:e.Nat64}),I=e.Record({name:e.Text,description:e.Opt(e.Text)}),pe=e.Record({id:e.Opt(n),known_neuron_data:e.Opt(I)}),Qe=e.Record({percentage_to_spawn:e.Opt(e.Nat32),new_controller:e.Opt(e.Principal),nonce:e.Opt(e.Nat64)}),le=e.Record({amount_e8s:e.Nat64}),Ze=e.Record({topic:e.Int32,followees:e.Vec(n)}),_e=e.Record({controller:e.Opt(e.Principal),memo:e.Nat64}),Ie=e.Variant({NeuronIdOrSubaccount:e.Record({}),MemoAndController:_e,Memo:e.Nat64}),me=e.Record({by:e.Opt(Ie)}),De=e.Record({hot_key_to_remove:e.Opt(e.Principal)}),Le=e.Record({new_hot_key:e.Opt(e.Principal)}),et=e.Record({requested_setting_for_auto_stake_maturity:e.Bool}),tt=e.Record({additional_dissolve_delay_seconds:e.Nat32}),nt=e.Record({dissolve_timestamp_seconds:e.Nat64}),ot=e.Variant({RemoveHotKey:De,AddHotKey:Le,ChangeAutoStakeMaturity:et,StopDissolving:e.Record({}),StartDissolving:e.Record({}),IncreaseDissolveDelay:tt,JoinCommunityFund:e.Record({}),LeaveCommunityFund:e.Record({}),SetDissolveTimestamp:nt}),fe=e.Record({operation:e.Opt(ot)}),rt=e.Record({vote:e.Int32,proposal:e.Opt(n)}),d=e.Record({source_neuron_id:e.Opt(n)}),we=e.Record({dissolve_delay_seconds:e.Nat64,kyc_verified:e.Bool,amount_e8s:e.Nat64,new_controller:e.Opt(e.Principal),nonce:e.Nat64}),it=e.Record({percentage_to_stake:e.Opt(e.Nat32)}),ye=e.Record({percentage_to_merge:e.Nat32}),st=e.Record({e8s:e.Nat64}),ge=e.Record({to_account:e.Opt(r),amount:e.Opt(st)}),at=e.Variant({Spawn:Qe,Split:le,Follow:Ze,ClaimOrRefresh:me,Configure:fe,RegisterVote:rt,Merge:d,DisburseToNeuron:we,MakeProposal:t,StakeMaturity:it,MergeMaturity:ye,Disburse:ge}),D=e.Variant({Subaccount:e.Vec(e.Nat8),NeuronId:n}),L=e.Record({id:e.Opt(n),command:e.Opt(at),neuron_id_or_subaccount:e.Opt(D)}),H=e.Record({basis_points:e.Opt(e.Nat64)}),g=e.Record({seconds:e.Opt(e.Nat64)}),N=e.Record({e8s:e.Opt(e.Nat64)}),ct=e.Record({reward_rate_transition_duration:e.Opt(g),initial_reward_rate:e.Opt(H),final_reward_rate:e.Opt(H)}),ut=e.Record({neuron_maximum_dissolve_delay_bonus:e.Opt(H),neuron_maximum_age_for_age_bonus:e.Opt(g),neuron_maximum_dissolve_delay:e.Opt(g),neuron_minimum_dissolve_delay_to_vote:e.Opt(g),neuron_maximum_age_bonus:e.Opt(H),neuron_minimum_stake:e.Opt(N),proposal_wait_for_quiet_deadline_increase:e.Opt(g),proposal_initial_voting_period:e.Opt(g),proposal_rejection_fee:e.Opt(N),voting_reward_parameters:e.Opt(ct)}),Ne=e.Record({base64_encoding:e.Opt(e.Text)}),dt=e.Record({transaction_fee:e.Opt(N),token_symbol:e.Opt(e.Text),token_logo:e.Opt(Ne),token_name:e.Opt(e.Text)}),pt=e.Record({id:e.Opt(e.Principal)}),lt=e.Record({dissolve_delay_interval:e.Opt(g),count:e.Opt(e.Nat64)}),_t=e.Record({seconds_after_utc_midnight:e.Opt(e.Nat64)}),mt=e.Record({iso_codes:e.Vec(e.Text)}),ft=e.Record({minimum_participants:e.Opt(e.Nat64),duration:e.Opt(g),neuron_basket_construction_parameters:e.Opt(lt),confirmation_text:e.Opt(e.Text),maximum_participant_icp:e.Opt(N),minimum_icp:e.Opt(N),minimum_participant_icp:e.Opt(N),start_time:e.Opt(_t),maximum_icp:e.Opt(N),neurons_fund_investment_icp:e.Opt(N),restricted_countries:e.Opt(mt)}),Re=e.Record({total:e.Opt(N)}),wt=e.Record({controller:e.Opt(e.Principal),dissolve_delay:e.Opt(g),memo:e.Opt(e.Nat64),vesting_period:e.Opt(g),stake:e.Opt(N)}),yt=e.Record({developer_neurons:e.Vec(wt)}),gt=e.Record({treasury_distribution:e.Opt(Re),developer_distribution:e.Opt(yt),swap_distribution:e.Opt(Re)}),Nt=e.Record({url:e.Opt(e.Text),governance_parameters:e.Opt(ut),fallback_controller_principal_ids:e.Vec(e.Principal),logo:e.Opt(Ne),name:e.Opt(e.Text),ledger_parameters:e.Opt(dt),description:e.Opt(e.Text),dapp_canisters:e.Vec(pt),swap_parameters:e.Opt(ft),initial_token_distribution:e.Opt(gt)}),Rt=e.Record({nns_function:e.Int32,payload:e.Vec(e.Nat8)}),ht=e.Record({dissolve_delay_interval_seconds:e.Nat64,count:e.Nat64}),vt=e.Record({min_participant_icp_e8s:e.Nat64,neuron_basket_construction_parameters:e.Opt(ht),max_icp_e8s:e.Nat64,swap_due_timestamp_seconds:e.Nat64,min_participants:e.Nat32,sns_token_e8s:e.Nat64,sale_delay_seconds:e.Opt(e.Nat64),max_participant_icp_e8s:e.Nat64,min_icp_e8s:e.Nat64}),Ot=e.Record({community_fund_investment_e8s:e.Opt(e.Nat64),target_swap_canister_id:e.Opt(e.Principal),params:e.Opt(vt)}),bt=e.Record({start_timestamp_seconds:e.Nat64,end_timestamp_seconds:e.Nat64}),xt=e.Record({open_time_window:e.Opt(bt)}),St=e.Record({request:e.Opt(xt),swap_canister_id:e.Opt(e.Principal)}),kt=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,o))}),he=e.Record({use_registry_derived_rewards:e.Opt(e.Bool),rewards:e.Vec(m)}),Tt=e.Record({principals:e.Vec(e.Principal)}),Ct=e.Variant({ToRemove:i,ToAdd:i}),Pt=e.Record({change:e.Opt(Ct)}),Mt=e.Record({motion_text:e.Text}),At=e.Variant({RegisterKnownNeuron:pe,ManageNeuron:L,CreateServiceNervousSystem:Nt,ExecuteNnsFunction:Rt,RewardNodeProvider:m,OpenSnsTokenSwap:Ot,SetSnsTokenSwapOpenTimeWindow:St,SetDefaultFollowees:kt,RewardNodeProviders:he,ManageNetworkEconomics:y,ApproveGenesisKyc:Tt,AddOrRemoveNodeProvider:Pt,Motion:Mt});t.fill(e.Record({url:e.Text,title:e.Opt(e.Text),action:e.Opt(At),summary:e.Text}));let Et=e.Record({current_deadline_timestamp_seconds:e.Nat64}),Vt=e.Record({id:e.Opt(n),failure_reason:e.Opt(_),cf_participants:e.Vec(Je),ballots:e.Vec(e.Tuple(e.Nat64,ce)),proposal_timestamp_seconds:e.Nat64,reward_event_round:e.Nat64,failed_timestamp_seconds:e.Nat64,reject_cost_e8s:e.Nat64,derived_proposal_information:e.Opt(ue),latest_tally:e.Opt(de),sns_token_swap_lifecycle:e.Opt(e.Int32),decided_timestamp_seconds:e.Nat64,proposal:e.Opt(t),proposer:e.Opt(n),wait_for_quiet_state:e.Opt(Et),executed_timestamp_seconds:e.Nat64,original_total_community_fund_maturity_e8s_equivalent:e.Opt(e.Nat64)}),Bt=e.Variant({Spawn:n,Split:le,Configure:fe,Merge:d,DisburseToNeuron:we,SyncCommand:e.Record({}),ClaimOrRefreshNeuron:me,MergeMaturity:ye,Disburse:ge}),Ft=e.Record({command:e.Opt(Bt),timestamp:e.Nat64}),ve=e.Record({vote:e.Int32,proposal_id:e.Opt(n)}),qt=e.Variant({DissolveDelaySeconds:e.Nat64,WhenDissolvedTimestampSeconds:e.Nat64}),C=e.Record({id:e.Opt(n),staked_maturity_e8s_equivalent:e.Opt(e.Nat64),controller:e.Opt(e.Principal),recent_ballots:e.Vec(ve),kyc_verified:e.Bool,not_for_profit:e.Bool,maturity_e8s_equivalent:e.Nat64,cached_neuron_stake_e8s:e.Nat64,created_timestamp_seconds:e.Nat64,auto_stake_maturity:e.Opt(e.Bool),aging_since_timestamp_seconds:e.Nat64,hot_keys:e.Vec(e.Principal),account:e.Vec(e.Nat8),joined_community_fund_timestamp_seconds:e.Opt(e.Nat64),dissolve_state:e.Opt(qt),followees:e.Vec(e.Tuple(e.Int32,o)),neuron_fees_e8s:e.Nat64,transfer:e.Opt(O),known_neuron_data:e.Opt(I),spawn_at_timestamp_seconds:e.Opt(e.Nat64)}),cr=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,o)),most_recent_monthly_node_provider_rewards:e.Opt(f),maturity_modulation_last_updated_at_timestamp_seconds:e.Opt(e.Nat64),wait_for_quiet_threshold_seconds:e.Nat64,metrics:e.Opt(p),node_providers:e.Vec(i),cached_daily_maturity_modulation_basis_points:e.Opt(e.Int32),economics:e.Opt(y),spawning_neurons:e.Opt(e.Bool),latest_reward_event:e.Opt(w),to_claim_transfers:e.Vec(O),short_voting_period_seconds:e.Nat64,proposals:e.Vec(e.Tuple(e.Nat64,Vt)),in_flight_commands:e.Vec(e.Tuple(e.Nat64,Ft)),neurons:e.Vec(e.Tuple(e.Nat64,C)),genesis_timestamp_seconds:e.Nat64}),W=e.Variant({Ok:e.Null,Err:_}),Ut=e.Variant({Error:_,NeuronId:n}),Kt=e.Record({result:e.Opt(Ut)}),Oe=e.Variant({Ok:C,Err:_}),Ht=e.Variant({Ok:p,Err:_}),Wt=e.Variant({Ok:he,Err:_}),G=e.Record({dissolve_delay_seconds:e.Nat64,recent_ballots:e.Vec(ve),created_timestamp_seconds:e.Nat64,state:e.Int32,stake_e8s:e.Nat64,joined_community_fund_timestamp_seconds:e.Opt(e.Nat64),retrieved_at_timestamp_seconds:e.Nat64,known_neuron_data:e.Opt(I),voting_power:e.Nat64,age_seconds:e.Nat64}),be=e.Variant({Ok:G,Err:_}),Gt=e.Variant({Ok:i,Err:_}),ee=e.Record({id:e.Opt(n),status:e.Int32,topic:e.Int32,failure_reason:e.Opt(_),ballots:e.Vec(e.Tuple(e.Nat64,ce)),proposal_timestamp_seconds:e.Nat64,reward_event_round:e.Nat64,deadline_timestamp_seconds:e.Opt(e.Nat64),failed_timestamp_seconds:e.Nat64,reject_cost_e8s:e.Nat64,derived_proposal_information:e.Opt(ue),latest_tally:e.Opt(de),reward_status:e.Int32,decided_timestamp_seconds:e.Nat64,proposal:e.Opt(t),proposer:e.Opt(n),executed_timestamp_seconds:e.Nat64}),jt=e.Record({known_neurons:e.Vec(pe)}),$t=e.Record({neuron_ids:e.Vec(e.Nat64),include_neurons_readable_by_caller:e.Bool}),zt=e.Record({neuron_infos:e.Vec(e.Tuple(e.Nat64,G)),full_neurons:e.Vec(C)}),Jt=e.Record({node_providers:e.Vec(i)}),Xt=e.Record({include_reward_status:e.Vec(e.Int32),before_proposal:e.Opt(n),limit:e.Nat32,exclude_topic:e.Vec(e.Int32),include_all_manage_neuron_proposals:e.Opt(e.Bool),include_status:e.Vec(e.Int32)}),Yt=e.Record({proposal_info:e.Vec(ee)}),te=e.Record({created_neuron_id:e.Opt(n)}),Qt=e.Record({refreshed_neuron_id:e.Opt(n)}),Zt=e.Record({target_neuron:e.Opt(C),source_neuron:e.Opt(C),target_neuron_info:e.Opt(G),source_neuron_info:e.Opt(G)}),It=e.Record({proposal_id:e.Opt(n)}),Dt=e.Record({maturity_e8s:e.Nat64,staked_maturity_e8s:e.Nat64}),Lt=e.Record({merged_maturity_e8s:e.Nat64,new_stake_e8s:e.Nat64}),en=e.Record({transfer_block_height:e.Nat64}),tn=e.Variant({Error:_,Spawn:te,Split:te,Follow:e.Record({}),ClaimOrRefresh:Qt,Configure:e.Record({}),RegisterVote:e.Record({}),Merge:Zt,DisburseToNeuron:te,MakeProposal:It,StakeMaturity:Dt,MergeMaturity:Lt,Disburse:en}),xe=e.Record({command:e.Opt(tn)}),nn=e.Record({sns_governance_canister_id:e.Opt(e.Principal)}),on=e.Variant({Committed:nn,Aborted:e.Record({})}),rn=e.Record({result:e.Opt(on),open_sns_token_swap_proposal_id:e.Opt(e.Nat64)}),sn=e.Record({reward_account:e.Opt(r)});return e.Service({claim_gtc_neurons:e.Func([e.Principal,e.Vec(n)],[W],[]),claim_or_refresh_neuron_from_account:e.Func([_e],[Kt],[]),get_build_metadata:e.Func([],[e.Text],[]),get_full_neuron:e.Func([e.Nat64],[Oe],[]),get_full_neuron_by_id_or_subaccount:e.Func([D],[Oe],[]),get_latest_reward_event:e.Func([],[w],[]),get_metrics:e.Func([],[Ht],[]),get_monthly_node_provider_rewards:e.Func([],[Wt],[]),get_most_recent_monthly_node_provider_rewards:e.Func([],[e.Opt(f)],[]),get_network_economics_parameters:e.Func([],[y],[]),get_neuron_ids:e.Func([],[e.Vec(e.Nat64)],[]),get_neuron_info:e.Func([e.Nat64],[be],[]),get_neuron_info_by_id_or_subaccount:e.Func([D],[be],[]),get_node_provider_by_caller:e.Func([e.Null],[Gt],[]),get_pending_proposals:e.Func([],[e.Vec(ee)],[]),get_proposal_info:e.Func([e.Nat64],[e.Opt(ee)],[]),list_known_neurons:e.Func([],[jt],[]),list_neurons:e.Func([$t],[zt],[]),list_node_providers:e.Func([],[Jt],[]),list_proposals:e.Func([Xt],[Yt],[]),manage_neuron:e.Func([L],[xe],[]),settle_community_fund_participation:e.Func([rn],[W],[]),simulate_manage_neuron:e.Func([L],[xe],[]),transfer_gtc_neuron:e.Func([n,n],[W],[]),update_node_provider:e.Func([sn],[W],[])})};var so=({IDL:e})=>{let t=e.Rec(),n=e.Record({id:e.Nat64}),o=e.Record({followees:e.Vec(n)}),r=e.Record({hash:e.Vec(e.Nat8)}),i=e.Record({id:e.Opt(e.Principal),reward_account:e.Opt(r)}),s=e.Record({dissolve_delay_seconds:e.Nat64}),c=e.Record({to_account:e.Opt(r)}),u=e.Variant({RewardToNeuron:s,RewardToAccount:c}),m=e.Record({node_provider:e.Opt(i),reward_mode:e.Opt(u),amount_e8s:e.Nat64}),f=e.Record({timestamp:e.Nat64,rewards:e.Vec(m)}),p=e.Record({not_dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),garbage_collectable_neurons_count:e.Nat64,neurons_with_invalid_stake_count:e.Nat64,not_dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),total_supply_icp:e.Nat64,neurons_with_less_than_6_months_dissolve_delay_count:e.Nat64,dissolved_neurons_count:e.Nat64,community_fund_total_maturity_e8s_equivalent:e.Nat64,total_staked_e8s:e.Nat64,not_dissolving_neurons_count:e.Nat64,total_locked_e8s:e.Nat64,dissolved_neurons_e8s:e.Nat64,neurons_with_less_than_6_months_dissolve_delay_e8s:e.Nat64,dissolving_neurons_count_buckets:e.Vec(e.Tuple(e.Nat64,e.Nat64)),dissolving_neurons_count:e.Nat64,dissolving_neurons_e8s_buckets:e.Vec(e.Tuple(e.Nat64,e.Float64)),community_fund_total_staked_e8s:e.Nat64,timestamp_seconds:e.Nat64}),y=e.Record({neuron_minimum_stake_e8s:e.Nat64,max_proposals_to_keep_per_topic:e.Nat32,neuron_management_fee_per_proposal_e8s:e.Nat64,reject_cost_e8s:e.Nat64,transaction_fee_e8s:e.Nat64,neuron_spawn_dissolve_delay_seconds:e.Nat64,minimum_icp_xdr_rate:e.Nat64,maximum_node_provider_rewards_e8s:e.Nat64}),w=e.Record({rounds_since_last_distribution:e.Opt(e.Nat64),day_after_genesis:e.Nat64,actual_timestamp_seconds:e.Nat64,total_available_e8s_equivalent:e.Nat64,latest_round_available_e8s_equivalent:e.Opt(e.Nat64),distributed_e8s_equivalent:e.Nat64,settled_proposals:e.Vec(n)}),O=e.Record({to_subaccount:e.Vec(e.Nat8),neuron_stake_e8s:e.Nat64,from:e.Opt(e.Principal),memo:e.Nat64,from_subaccount:e.Vec(e.Nat8),transfer_timestamp:e.Nat64,block_height:e.Nat64}),_=e.Record({error_message:e.Text,error_type:e.Int32}),ze=e.Record({nns_neuron_id:e.Nat64,amount_icp_e8s:e.Nat64}),Je=e.Record({hotkey_principal:e.Text,cf_neurons:e.Vec(ze)}),ce=e.Record({vote:e.Int32,voting_power:e.Nat64}),Xe=e.Record({status:e.Opt(e.Int32),freezing_threshold:e.Opt(e.Nat64),controllers:e.Vec(e.Principal),memory_size:e.Opt(e.Nat64),cycles:e.Opt(e.Nat64),idle_cycles_burned_per_day:e.Opt(e.Nat64),module_hash:e.Vec(e.Nat8)}),b=e.Record({status:e.Opt(Xe),canister_id:e.Opt(e.Principal)}),Ye=e.Record({ledger_index_canister_summary:e.Opt(b),fallback_controller_principal_ids:e.Vec(e.Principal),ledger_archive_canister_summaries:e.Vec(b),ledger_canister_summary:e.Opt(b),swap_canister_summary:e.Opt(b),governance_canister_summary:e.Opt(b),root_canister_summary:e.Opt(b),dapp_canister_summaries:e.Vec(b)}),ue=e.Record({swap_background_information:e.Opt(Ye)}),de=e.Record({no:e.Nat64,yes:e.Nat64,total:e.Nat64,timestamp_seconds:e.Nat64}),I=e.Record({name:e.Text,description:e.Opt(e.Text)}),pe=e.Record({id:e.Opt(n),known_neuron_data:e.Opt(I)}),Qe=e.Record({percentage_to_spawn:e.Opt(e.Nat32),new_controller:e.Opt(e.Principal),nonce:e.Opt(e.Nat64)}),le=e.Record({amount_e8s:e.Nat64}),Ze=e.Record({topic:e.Int32,followees:e.Vec(n)}),_e=e.Record({controller:e.Opt(e.Principal),memo:e.Nat64}),Ie=e.Variant({NeuronIdOrSubaccount:e.Record({}),MemoAndController:_e,Memo:e.Nat64}),me=e.Record({by:e.Opt(Ie)}),De=e.Record({hot_key_to_remove:e.Opt(e.Principal)}),Le=e.Record({new_hot_key:e.Opt(e.Principal)}),et=e.Record({requested_setting_for_auto_stake_maturity:e.Bool}),tt=e.Record({additional_dissolve_delay_seconds:e.Nat32}),nt=e.Record({dissolve_timestamp_seconds:e.Nat64}),ot=e.Variant({RemoveHotKey:De,AddHotKey:Le,ChangeAutoStakeMaturity:et,StopDissolving:e.Record({}),StartDissolving:e.Record({}),IncreaseDissolveDelay:tt,JoinCommunityFund:e.Record({}),LeaveCommunityFund:e.Record({}),SetDissolveTimestamp:nt}),fe=e.Record({operation:e.Opt(ot)}),rt=e.Record({vote:e.Int32,proposal:e.Opt(n)}),d=e.Record({source_neuron_id:e.Opt(n)}),we=e.Record({dissolve_delay_seconds:e.Nat64,kyc_verified:e.Bool,amount_e8s:e.Nat64,new_controller:e.Opt(e.Principal),nonce:e.Nat64}),it=e.Record({percentage_to_stake:e.Opt(e.Nat32)}),ye=e.Record({percentage_to_merge:e.Nat32}),st=e.Record({e8s:e.Nat64}),ge=e.Record({to_account:e.Opt(r),amount:e.Opt(st)}),at=e.Variant({Spawn:Qe,Split:le,Follow:Ze,ClaimOrRefresh:me,Configure:fe,RegisterVote:rt,Merge:d,DisburseToNeuron:we,MakeProposal:t,StakeMaturity:it,MergeMaturity:ye,Disburse:ge}),D=e.Variant({Subaccount:e.Vec(e.Nat8),NeuronId:n}),L=e.Record({id:e.Opt(n),command:e.Opt(at),neuron_id_or_subaccount:e.Opt(D)}),H=e.Record({basis_points:e.Opt(e.Nat64)}),g=e.Record({seconds:e.Opt(e.Nat64)}),N=e.Record({e8s:e.Opt(e.Nat64)}),ct=e.Record({reward_rate_transition_duration:e.Opt(g),initial_reward_rate:e.Opt(H),final_reward_rate:e.Opt(H)}),ut=e.Record({neuron_maximum_dissolve_delay_bonus:e.Opt(H),neuron_maximum_age_for_age_bonus:e.Opt(g),neuron_maximum_dissolve_delay:e.Opt(g),neuron_minimum_dissolve_delay_to_vote:e.Opt(g),neuron_maximum_age_bonus:e.Opt(H),neuron_minimum_stake:e.Opt(N),proposal_wait_for_quiet_deadline_increase:e.Opt(g),proposal_initial_voting_period:e.Opt(g),proposal_rejection_fee:e.Opt(N),voting_reward_parameters:e.Opt(ct)}),Ne=e.Record({base64_encoding:e.Opt(e.Text)}),dt=e.Record({transaction_fee:e.Opt(N),token_symbol:e.Opt(e.Text),token_logo:e.Opt(Ne),token_name:e.Opt(e.Text)}),pt=e.Record({id:e.Opt(e.Principal)}),lt=e.Record({dissolve_delay_interval:e.Opt(g),count:e.Opt(e.Nat64)}),_t=e.Record({seconds_after_utc_midnight:e.Opt(e.Nat64)}),mt=e.Record({iso_codes:e.Vec(e.Text)}),ft=e.Record({minimum_participants:e.Opt(e.Nat64),duration:e.Opt(g),neuron_basket_construction_parameters:e.Opt(lt),confirmation_text:e.Opt(e.Text),maximum_participant_icp:e.Opt(N),minimum_icp:e.Opt(N),minimum_participant_icp:e.Opt(N),start_time:e.Opt(_t),maximum_icp:e.Opt(N),neurons_fund_investment_icp:e.Opt(N),restricted_countries:e.Opt(mt)}),Re=e.Record({total:e.Opt(N)}),wt=e.Record({controller:e.Opt(e.Principal),dissolve_delay:e.Opt(g),memo:e.Opt(e.Nat64),vesting_period:e.Opt(g),stake:e.Opt(N)}),yt=e.Record({developer_neurons:e.Vec(wt)}),gt=e.Record({treasury_distribution:e.Opt(Re),developer_distribution:e.Opt(yt),swap_distribution:e.Opt(Re)}),Nt=e.Record({url:e.Opt(e.Text),governance_parameters:e.Opt(ut),fallback_controller_principal_ids:e.Vec(e.Principal),logo:e.Opt(Ne),name:e.Opt(e.Text),ledger_parameters:e.Opt(dt),description:e.Opt(e.Text),dapp_canisters:e.Vec(pt),swap_parameters:e.Opt(ft),initial_token_distribution:e.Opt(gt)}),Rt=e.Record({nns_function:e.Int32,payload:e.Vec(e.Nat8)}),ht=e.Record({dissolve_delay_interval_seconds:e.Nat64,count:e.Nat64}),vt=e.Record({min_participant_icp_e8s:e.Nat64,neuron_basket_construction_parameters:e.Opt(ht),max_icp_e8s:e.Nat64,swap_due_timestamp_seconds:e.Nat64,min_participants:e.Nat32,sns_token_e8s:e.Nat64,sale_delay_seconds:e.Opt(e.Nat64),max_participant_icp_e8s:e.Nat64,min_icp_e8s:e.Nat64}),Ot=e.Record({community_fund_investment_e8s:e.Opt(e.Nat64),target_swap_canister_id:e.Opt(e.Principal),params:e.Opt(vt)}),bt=e.Record({start_timestamp_seconds:e.Nat64,end_timestamp_seconds:e.Nat64}),xt=e.Record({open_time_window:e.Opt(bt)}),St=e.Record({request:e.Opt(xt),swap_canister_id:e.Opt(e.Principal)}),kt=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,o))}),he=e.Record({use_registry_derived_rewards:e.Opt(e.Bool),rewards:e.Vec(m)}),Tt=e.Record({principals:e.Vec(e.Principal)}),Ct=e.Variant({ToRemove:i,ToAdd:i}),Pt=e.Record({change:e.Opt(Ct)}),Mt=e.Record({motion_text:e.Text}),At=e.Variant({RegisterKnownNeuron:pe,ManageNeuron:L,CreateServiceNervousSystem:Nt,ExecuteNnsFunction:Rt,RewardNodeProvider:m,OpenSnsTokenSwap:Ot,SetSnsTokenSwapOpenTimeWindow:St,SetDefaultFollowees:kt,RewardNodeProviders:he,ManageNetworkEconomics:y,ApproveGenesisKyc:Tt,AddOrRemoveNodeProvider:Pt,Motion:Mt});t.fill(e.Record({url:e.Text,title:e.Opt(e.Text),action:e.Opt(At),summary:e.Text}));let Et=e.Record({current_deadline_timestamp_seconds:e.Nat64}),Vt=e.Record({id:e.Opt(n),failure_reason:e.Opt(_),cf_participants:e.Vec(Je),ballots:e.Vec(e.Tuple(e.Nat64,ce)),proposal_timestamp_seconds:e.Nat64,reward_event_round:e.Nat64,failed_timestamp_seconds:e.Nat64,reject_cost_e8s:e.Nat64,derived_proposal_information:e.Opt(ue),latest_tally:e.Opt(de),sns_token_swap_lifecycle:e.Opt(e.Int32),decided_timestamp_seconds:e.Nat64,proposal:e.Opt(t),proposer:e.Opt(n),wait_for_quiet_state:e.Opt(Et),executed_timestamp_seconds:e.Nat64,original_total_community_fund_maturity_e8s_equivalent:e.Opt(e.Nat64)}),Bt=e.Variant({Spawn:n,Split:le,Configure:fe,Merge:d,DisburseToNeuron:we,SyncCommand:e.Record({}),ClaimOrRefreshNeuron:me,MergeMaturity:ye,Disburse:ge}),Ft=e.Record({command:e.Opt(Bt),timestamp:e.Nat64}),ve=e.Record({vote:e.Int32,proposal_id:e.Opt(n)}),qt=e.Variant({DissolveDelaySeconds:e.Nat64,WhenDissolvedTimestampSeconds:e.Nat64}),C=e.Record({id:e.Opt(n),staked_maturity_e8s_equivalent:e.Opt(e.Nat64),controller:e.Opt(e.Principal),recent_ballots:e.Vec(ve),kyc_verified:e.Bool,not_for_profit:e.Bool,maturity_e8s_equivalent:e.Nat64,cached_neuron_stake_e8s:e.Nat64,created_timestamp_seconds:e.Nat64,auto_stake_maturity:e.Opt(e.Bool),aging_since_timestamp_seconds:e.Nat64,hot_keys:e.Vec(e.Principal),account:e.Vec(e.Nat8),joined_community_fund_timestamp_seconds:e.Opt(e.Nat64),dissolve_state:e.Opt(qt),followees:e.Vec(e.Tuple(e.Int32,o)),neuron_fees_e8s:e.Nat64,transfer:e.Opt(O),known_neuron_data:e.Opt(I),spawn_at_timestamp_seconds:e.Opt(e.Nat64)}),cr=e.Record({default_followees:e.Vec(e.Tuple(e.Int32,o)),most_recent_monthly_node_provider_rewards:e.Opt(f),maturity_modulation_last_updated_at_timestamp_seconds:e.Opt(e.Nat64),wait_for_quiet_threshold_seconds:e.Nat64,metrics:e.Opt(p),node_providers:e.Vec(i),cached_daily_maturity_modulation_basis_points:e.Opt(e.Int32),economics:e.Opt(y),spawning_neurons:e.Opt(e.Bool),latest_reward_event:e.Opt(w),to_claim_transfers:e.Vec(O),short_voting_period_seconds:e.Nat64,proposals:e.Vec(e.Tuple(e.Nat64,Vt)),in_flight_commands:e.Vec(e.Tuple(e.Nat64,Ft)),neurons:e.Vec(e.Tuple(e.Nat64,C)),genesis_timestamp_seconds:e.Nat64}),W=e.Variant({Ok:e.Null,Err:_}),Ut=e.Variant({Error:_,NeuronId:n}),Kt=e.Record({result:e.Opt(Ut)}),Oe=e.Variant({Ok:C,Err:_}),Ht=e.Variant({Ok:p,Err:_}),Wt=e.Variant({Ok:he,Err:_}),G=e.Record({dissolve_delay_seconds:e.Nat64,recent_ballots:e.Vec(ve),created_timestamp_seconds:e.Nat64,state:e.Int32,stake_e8s:e.Nat64,joined_community_fund_timestamp_seconds:e.Opt(e.Nat64),retrieved_at_timestamp_seconds:e.Nat64,known_neuron_data:e.Opt(I),voting_power:e.Nat64,age_seconds:e.Nat64}),be=e.Variant({Ok:G,Err:_}),Gt=e.Variant({Ok:i,Err:_}),ee=e.Record({id:e.Opt(n),status:e.Int32,topic:e.Int32,failure_reason:e.Opt(_),ballots:e.Vec(e.Tuple(e.Nat64,ce)),proposal_timestamp_seconds:e.Nat64,reward_event_round:e.Nat64,deadline_timestamp_seconds:e.Opt(e.Nat64),failed_timestamp_seconds:e.Nat64,reject_cost_e8s:e.Nat64,derived_proposal_information:e.Opt(ue),latest_tally:e.Opt(de),reward_status:e.Int32,decided_timestamp_seconds:e.Nat64,proposal:e.Opt(t),proposer:e.Opt(n),executed_timestamp_seconds:e.Nat64}),jt=e.Record({known_neurons:e.Vec(pe)}),$t=e.Record({neuron_ids:e.Vec(e.Nat64),include_neurons_readable_by_caller:e.Bool}),zt=e.Record({neuron_infos:e.Vec(e.Tuple(e.Nat64,G)),full_neurons:e.Vec(C)}),Jt=e.Record({node_providers:e.Vec(i)}),Xt=e.Record({include_reward_status:e.Vec(e.Int32),before_proposal:e.Opt(n),limit:e.Nat32,exclude_topic:e.Vec(e.Int32),include_all_manage_neuron_proposals:e.Opt(e.Bool),include_status:e.Vec(e.Int32)}),Yt=e.Record({proposal_info:e.Vec(ee)}),te=e.Record({created_neuron_id:e.Opt(n)}),Qt=e.Record({refreshed_neuron_id:e.Opt(n)}),Zt=e.Record({target_neuron:e.Opt(C),source_neuron:e.Opt(C),target_neuron_info:e.Opt(G),source_neuron_info:e.Opt(G)}),It=e.Record({proposal_id:e.Opt(n)}),Dt=e.Record({maturity_e8s:e.Nat64,staked_maturity_e8s:e.Nat64}),Lt=e.Record({merged_maturity_e8s:e.Nat64,new_stake_e8s:e.Nat64}),en=e.Record({transfer_block_height:e.Nat64}),tn=e.Variant({Error:_,Spawn:te,Split:te,Follow:e.Record({}),ClaimOrRefresh:Qt,Configure:e.Record({}),RegisterVote:e.Record({}),Merge:Zt,DisburseToNeuron:te,MakeProposal:It,StakeMaturity:Dt,MergeMaturity:Lt,Disburse:en}),xe=e.Record({command:e.Opt(tn)}),nn=e.Record({sns_governance_canister_id:e.Opt(e.Principal)}),on=e.Variant({Committed:nn,Aborted:e.Record({})}),rn=e.Record({result:e.Opt(on),open_sns_token_swap_proposal_id:e.Opt(e.Nat64)}),sn=e.Record({reward_account:e.Opt(r)});return e.Service({claim_gtc_neurons:e.Func([e.Principal,e.Vec(n)],[W],[]),claim_or_refresh_neuron_from_account:e.Func([_e],[Kt],[]),get_build_metadata:e.Func([],[e.Text],["query"]),get_full_neuron:e.Func([e.Nat64],[Oe],["query"]),get_full_neuron_by_id_or_subaccount:e.Func([D],[Oe],["query"]),get_latest_reward_event:e.Func([],[w],["query"]),get_metrics:e.Func([],[Ht],["query"]),get_monthly_node_provider_rewards:e.Func([],[Wt],[]),get_most_recent_monthly_node_provider_rewards:e.Func([],[e.Opt(f)],["query"]),get_network_economics_parameters:e.Func([],[y],["query"]),get_neuron_ids:e.Func([],[e.Vec(e.Nat64)],["query"]),get_neuron_info:e.Func([e.Nat64],[be],["query"]),get_neuron_info_by_id_or_subaccount:e.Func([D],[be],["query"]),get_node_provider_by_caller:e.Func([e.Null],[Gt],["query"]),get_pending_proposals:e.Func([],[e.Vec(ee)],["query"]),get_proposal_info:e.Func([e.Nat64],[e.Opt(ee)],["query"]),list_known_neurons:e.Func([],[jt],["query"]),list_neurons:e.Func([$t],[zt],["query"]),list_node_providers:e.Func([],[Jt],["query"]),list_proposals:e.Func([Xt],[Yt],["query"]),manage_neuron:e.Func([L],[xe],[]),settle_community_fund_participation:e.Func([rn],[W],[]),simulate_manage_neuron:e.Func([L],[xe],[]),transfer_gtc_neuron:e.Func([n,n],[W],[]),update_node_provider:e.Func([sn],[W],[])})};import{accountIdentifierToBytes as Dr}from"@dfinity/ledger-icp";import{Principal as q}from"@dfinity/principal";import{arrayBufferToUint8Array as Lr,toNullable as ae}from"@dfinity/utils";var Ue=class extends Error{},ke=class extends Ue{},Te=class extends Ue{constructor(n){super();this.minimumAmount=n}},z=class extends Error{},M=class extends Error{constructor(n){super();this.detail=n}},h=class extends Error{constructor(t){super("Unsupported value: "+t)}},Ke=class extends Error{};var uo=e=>({id:e}),vn=e=>({id:e}),ei=e=>({followees:e.map(vn)}),ti=e=>{if("NeuronId"in e)return{NeuronId:{id:e.NeuronId}};if("Subaccount"in e)return{Subaccount:Uint8Array.from(e.Subaccount)};throw new h(e)},He=e=>e.basisPoints!==void 0?{basis_points:[e.basisPoints]}:{basis_points:[]},B=e=>e.seconds!==void 0?{seconds:[e.seconds]}:{seconds:[]},ni=e=>e.secondsAfterUtcMidnight!==void 0?{seconds_after_utc_midnight:[e.secondsAfterUtcMidnight]}:{seconds_after_utc_midnight:[]},oi=e=>({iso_codes:e.isoCodes}),F=e=>e.e8s!==void 0?{e8s:[e.e8s]}:{e8s:[]},po=e=>e.base64Encoding!==void 0?{base64_encoding:[e.base64Encoding]}:{base64_encoding:[]},ri=e=>({reward_rate_transition_duration:e.rewardRateTransitionDuration!==void 0?[B(e.rewardRateTransitionDuration)]:[],initial_reward_rate:e.initialRewardRate!==void 0?[He(e.initialRewardRate)]:[],final_reward_rate:e.finalRewardRate!==void 0?[He(e.finalRewardRate)]:[]}),ii=e=>({transaction_fee:e.transactionFee!==void 0?[F(e.transactionFee)]:[],token_symbol:e.tokenSymbol!==void 0?[e.tokenSymbol]:[],token_logo:e.tokenLogo!==void 0?[po(e.tokenLogo)]:[],token_name:e.tokenName!==void 0?[e.tokenName]:[]}),si=e=>({minimum_participants:e.minimumParticipants!==void 0?[e.minimumParticipants]:[],duration:e.duration!==void 0?[B(e.duration)]:[],neuron_basket_construction_parameters:e.neuronBasketConstructionParameters!==void 0?[ai(e.neuronBasketConstructionParameters)]:[],confirmation_text:e.confirmationText!==void 0?[e.confirmationText]:[],maximum_participant_icp:e.maximumParticipantIcp!==void 0?[F(e.maximumParticipantIcp)]:[],neurons_fund_investment_icp:e.neuronsFundInvestmentIcp!==void 0?[F(e.neuronsFundInvestmentIcp)]:[],minimum_icp:e.minimumIcp!==void 0?[F(e.minimumIcp)]:[],minimum_participant_icp:e.minimumParticipantIcp!==void 0?[F(e.minimumParticipantIcp)]:[],start_time:e.startTime!==void 0?[ni(e.startTime)]:[],maximum_icp:e.maximumIcp!==void 0?[F(e.maximumIcp)]:[],restricted_countries:e.restrictedCountries!==void 0?[oi(e.restrictedCountries)]:[]}),ai=e=>({dissolve_delay_interval:e.dissolveDelayInterval!==void 0?[B(e.dissolveDelayInterval)]:[],count:e.count!==void 0?[e.count]:[]}),ci=e=>({neuron_maximum_dissolve_delay_bonus:e.neuronMaximumDissolveDelayBonus!==void 0?[He(e.neuronMaximumDissolveDelayBonus)]:[],neuron_maximum_age_for_age_bonus:e.neuronMaximumAgeForAgeBonus!==void 0?[B(e.neuronMaximumAgeForAgeBonus)]:[],neuron_maximum_dissolve_delay:e.neuronMaximumDissolveDelay!==void 0?[B(e.neuronMaximumDissolveDelay)]:[],neuron_minimum_dissolve_delay_to_vote:e.neuronMinimumDissolveDelayToVote!==void 0?[B(e.neuronMinimumDissolveDelayToVote)]:[],neuron_maximum_age_bonus:e.neuronMaximumAgeBonus!==void 0?[He(e.neuronMaximumAgeBonus)]:[],neuron_minimum_stake:e.neuronMinimumStake!==void 0?[F(e.neuronMinimumStake)]:[],proposal_wait_for_quiet_deadline_increase:e.proposalWaitForQuietDeadlineIncrease!==void 0?[B(e.proposalWaitForQuietDeadlineIncrease)]:[],proposal_initial_voting_period:e.proposalInitialVotingPeriod!==void 0?[B(e.proposalInitialVotingPeriod)]:[],proposal_rejection_fee:e.proposalRejectionFee!==void 0?[F(e.proposalRejectionFee)]:[],voting_reward_parameters:e.votingRewardParameters!==void 0?[ri(e.votingRewardParameters)]:[]}),ao=e=>({total:e.total!==void 0?[F(e.total)]:[]}),ui=e=>({treasury_distribution:e.treasuryDistribution!==void 0?[ao(e.treasuryDistribution)]:[],developer_distribution:e.developerDistribution!==void 0?[pi(e.developerDistribution)]:[],swap_distribution:e.swapDistribution!==void 0?[ao(e.swapDistribution)]:[]}),di=e=>({controller:e.controller!==void 0?[q.fromText(e.controller)]:[],dissolve_delay:e.dissolveDelay!==void 0?[B(e.dissolveDelay)]:[],memo:e.memo!==void 0?[e.memo]:[],vesting_period:e.vestingPeriod!==void 0?[B(e.vestingPeriod)]:[],stake:e.stake!==void 0?[F(e.stake)]:[]}),pi=e=>({developer_neurons:e.developerNeurons.map(di)}),li=e=>({url:e.url!==void 0?[e.url]:[],governance_parameters:e.governanceParameters!==void 0?[ci(e.governanceParameters)]:[],fallback_controller_principal_ids:e.fallbackControllerPrincipalIds.map(q.fromText),logo:e.logo!==void 0?[po(e.logo)]:[],name:e.name!==void 0?[e.name]:[],ledger_parameters:e.ledgerParameters!==void 0?[ii(e.ledgerParameters)]:[],description:e.description!==void 0?[e.description]:[],dapp_canisters:e.dappCanisters.map(t=>({id:[q.fromText(t)]})),swap_parameters:e.swapParameters!==void 0?[si(e.swapParameters)]:[],initial_token_distribution:e.initialTokenDistribution!==void 0?[ui(e.initialTokenDistribution)]:[]}),lo=e=>{if("ExecuteNnsFunction"in e){let t=e.ExecuteNnsFunction;if(t.payloadBytes===void 0)throw new Error("payloadBytes not found");return{ExecuteNnsFunction:{nns_function:t.nnsFunctionId,payload:Lr(t.payloadBytes)}}}if("ManageNeuron"in e){let t=e.ManageNeuron;return{ManageNeuron:yi(t)}}if("ApproveGenesisKyc"in e)return{ApproveGenesisKyc:{principals:e.ApproveGenesisKyc.principals.map(q.fromText)}};if("ManageNetworkEconomics"in e){let t=e.ManageNetworkEconomics;return{ManageNetworkEconomics:{neuron_minimum_stake_e8s:t.neuronMinimumStake,max_proposals_to_keep_per_topic:t.maxProposalsToKeepPerTopic,neuron_management_fee_per_proposal_e8s:t.neuronManagementFeePerProposal,reject_cost_e8s:t.rejectCost,transaction_fee_e8s:t.transactionFee,neuron_spawn_dissolve_delay_seconds:t.neuronSpawnDissolveDelaySeconds,minimum_icp_xdr_rate:t.minimumIcpXdrRate,maximum_node_provider_rewards_e8s:t.maximumNodeProviderRewards}}}if("RewardNodeProvider"in e){let t=e.RewardNodeProvider;return{RewardNodeProvider:{node_provider:t.nodeProvider?[We(t.nodeProvider)]:[],amount_e8s:t.amountE8s,reward_mode:t.rewardMode!=null?[co(t.rewardMode)]:[]}}}if("RewardNodeProviders"in e){let t=e.RewardNodeProviders;return{RewardNodeProviders:{use_registry_derived_rewards:t.useRegistryDerivedRewards===void 0?[]:[t.useRegistryDerivedRewards],rewards:t.rewards.map(n=>({node_provider:n.nodeProvider?[We(n.nodeProvider)]:[],amount_e8s:n.amountE8s,reward_mode:n.rewardMode!=null?[co(n.rewardMode)]:[]}))}}}if("AddOrRemoveNodeProvider"in e){let t=e.AddOrRemoveNodeProvider;return{AddOrRemoveNodeProvider:{change:t.change?[fi(t.change)]:[]}}}if("Motion"in e)return{Motion:{motion_text:e.Motion.motionText}};if("SetDefaultFollowees"in e)return{SetDefaultFollowees:{default_followees:e.SetDefaultFollowees.defaultFollowees.map(n=>[n.topic,ei(n.followees)])}};if("RegisterKnownNeuron"in e){let t=e.RegisterKnownNeuron;return{RegisterKnownNeuron:{id:[{id:t.id}],known_neuron_data:[{name:t.name,description:t.description!==void 0?[t.description]:[]}]}}}if("SetSnsTokenSwapOpenTimeWindow"in e){let{request:t,swapCanisterId:n}=e.SetSnsTokenSwapOpenTimeWindow;return{SetSnsTokenSwapOpenTimeWindow:{request:t===void 0?[]:[{open_time_window:t.openTimeWindow===void 0?[]:[{start_timestamp_seconds:t.openTimeWindow.startTimestampSeconds,end_timestamp_seconds:t.openTimeWindow.endTimestampSeconds}]}],swap_canister_id:n===void 0?[]:[q.fromText(n)]}}}if("OpenSnsTokenSwap"in e){let{communityFundInvestmentE8s:t,targetSwapCanisterId:n,params:o}=e.OpenSnsTokenSwap;return{OpenSnsTokenSwap:{community_fund_investment_e8s:ae(t),target_swap_canister_id:ae(n),params:o===void 0?[]:[{min_participant_icp_e8s:o.minParticipantIcpE8s,max_icp_e8s:o.maxIcpE8s,swap_due_timestamp_seconds:o.swapDueTimestampSeconds,min_participants:o.minParticipants,sns_token_e8s:o.snsTokenE8s,max_participant_icp_e8s:o.maxParticipantIcpE8s,min_icp_e8s:o.minIcpE8s,sale_delay_seconds:ae(o.saleDelaySeconds),neuron_basket_construction_parameters:ae(o.neuronBasketConstructionParameters)}]}}}if("CreateServiceNervousSystem"in e)return{CreateServiceNervousSystem:li(e.CreateServiceNervousSystem)};throw new h(e)},_i=e=>{if("Split"in e)return{Split:{amount_e8s:e.Split.amount}};if("Follow"in e){let t=e.Follow;return{Follow:{topic:t.topic,followees:t.followees.map(vn)}}}if("ClaimOrRefresh"in e){let t=e.ClaimOrRefresh;return{ClaimOrRefresh:{by:t.by?[wi(t.by)]:[]}}}if("Configure"in e){let t=e.Configure;return{Configure:{operation:t.operation?[mi(t.operation)]:[]}}}if("RegisterVote"in e){let t=e.RegisterVote;return{RegisterVote:{vote:t.vote,proposal:t.proposal?[uo(t.proposal)]:[]}}}if("DisburseToNeuron"in e){let t=e.DisburseToNeuron;return{DisburseToNeuron:{dissolve_delay_seconds:t.dissolveDelaySeconds,kyc_verified:t.kycVerified,amount_e8s:t.amount,new_controller:t.newController?[q.fromText(t.newController)]:[],nonce:t.nonce}}}if("MergeMaturity"in e)return{MergeMaturity:{percentage_to_merge:e.MergeMaturity.percentageToMerge}};if("StakeMaturity"in e){let{percentageToStake:t}=e.StakeMaturity;return{StakeMaturity:{percentage_to_stake:ae(t)}}}if("MakeProposal"in e){let t=e.MakeProposal;return{MakeProposal:{url:t.url,title:[],action:t.action?[lo(t.action)]:[],summary:t.summary}}}if("Disburse"in e){let t=e.Disburse;return{Disburse:{to_account:t.toAccountId?[On(t.toAccountId)]:[],amount:t.amount?[_o(t.amount)]:[]}}}if("Spawn"in e){let t=e.Spawn;return{Spawn:{percentage_to_spawn:t.percentageToSpawn===void 0?[]:[t.percentageToSpawn],new_controller:t.newController?[q.fromText(t.newController)]:[],nonce:[]}}}if("Merge"in e){let t=e.Merge;return{Merge:{source_neuron_id:t.sourceNeuronId?[{id:t.sourceNeuronId}]:[]}}}throw new h(e)},mi=e=>{if("RemoveHotKey"in e){let t=e.RemoveHotKey;return{RemoveHotKey:{hot_key_to_remove:t.hotKeyToRemove!=null?[q.fromText(t.hotKeyToRemove)]:[]}}}if("AddHotKey"in e){let t=e.AddHotKey;return{AddHotKey:{new_hot_key:t.newHotKey?[q.fromText(t.newHotKey)]:[]}}}if("StopDissolving"in e)return{StopDissolving:{}};if("StartDissolving"in e)return{StartDissolving:{}};if("IncreaseDissolveDelay"in e)return{IncreaseDissolveDelay:{additional_dissolve_delay_seconds:e.IncreaseDissolveDelay.additionalDissolveDelaySeconds}};if("JoinCommunityFund"in e||"LeaveCommunityFund"in e)return e;if("SetDissolveTimestamp"in e)return{SetDissolveTimestamp:{dissolve_timestamp_seconds:e.SetDissolveTimestamp.dissolveTimestampSeconds}};if("ChangeAutoStakeMaturity"in e){let{requestedSettingForAutoStakeMaturity:t}=e.ChangeAutoStakeMaturity;return{ChangeAutoStakeMaturity:{requested_setting_for_auto_stake_maturity:t}}}throw new h(e)},fi=e=>{if("ToRemove"in e)return{ToRemove:We(e.ToRemove)};if("ToAdd"in e)return{ToAdd:We(e.ToAdd)};throw new h(e)},We=e=>({id:e.id!=null?[q.fromText(e.id)]:[],reward_account:e.rewardAccount!=null?[On(e.rewardAccount)]:[]}),_o=e=>({e8s:e}),On=e=>({hash:Dr(e)}),co=e=>{if("RewardToNeuron"in e)return{RewardToNeuron:{dissolve_delay_seconds:e.RewardToNeuron.dissolveDelaySeconds}};if("RewardToAccount"in e)return{RewardToAccount:{to_account:e.RewardToAccount.toAccount!=null?[On(e.RewardToAccount.toAccount)]:[]}};throw new h(e)},wi=e=>{if("NeuronIdOrSubaccount"in e)return{NeuronIdOrSubaccount:{}};if("Memo"in e)return{Memo:e.Memo};if("MemoAndController"in e)return{MemoAndController:{memo:e.MemoAndController.memo,controller:e.MemoAndController.controller?[e.MemoAndController.controller]:[]}};throw new h(e)},mo=e=>({neuron_ids:BigUint64Array.from(e??[]),include_neurons_readable_by_caller:!e}),yi=({id:e,command:t,neuronIdOrSubaccount:n})=>({id:e?[vn(e)]:[],command:t?[_i(t)]:[],neuron_id_or_subaccount:n?[ti(n)]:[]}),fo=({includeRewardStatus:e,beforeProposal:t,excludeTopic:n,includeStatus:o,limit:r,includeAllManageNeuronProposals:i})=>({include_reward_status:Int32Array.from(e),before_proposal:t?[uo(t)]:[],limit:r,exclude_topic:Int32Array.from(n),include_all_manage_neuron_proposals:i!==void 0?[i]:[],include_status:Int32Array.from(o)}),wo=e=>({id:[],command:[{ClaimOrRefresh:{by:[{NeuronIdOrSubaccount:{}}]}}],neuron_id_or_subaccount:[{NeuronId:{id:e.neuronId}}]}),yo=({memo:e,controller:t})=>{let n={ClaimOrRefresh:{by:[{MemoAndController:{controller:t==null?[]:[t],memo:e}}]}};return{id:[],command:[n],neuron_id_or_subaccount:[]}},go=({neuronId:e,amount:t})=>({id:[],command:[{Split:{amount_e8s:t}}],neuron_id_or_subaccount:[{NeuronId:{id:e}}]});var No=({neuronId:e,vote:t,proposalId:n})=>Q({neuronId:e,command:{RegisterVote:{vote:t,proposal:[{id:n}]}}}),Ro=e=>{let t={MakeProposal:{url:e.url,title:e.title!=null?[e.title]:[],summary:e.summary,action:[lo(e.action)]}};return{id:[],command:[t],neuron_id_or_subaccount:[{NeuronId:{id:e.neuronId}}]}},ho=({neuronId:e,topic:t,followees:n})=>Q({neuronId:e,command:{Follow:{topic:t,followees:n.map(o=>({id:o}))}}}),vo=({neuronId:e,toAccountIdentifier:t,amount:n})=>Q({neuronId:e,command:{Disburse:{to_account:t!==void 0?[t.toAccountIdentifierHash()]:[],amount:n!==void 0?[_o(n)]:[]}}}),Oo=({neuronId:e,percentageToMerge:t})=>Q({neuronId:e,command:{MergeMaturity:{percentage_to_merge:t}}}),bo=({neuronId:e,percentageToStake:t})=>Q({neuronId:e,command:{StakeMaturity:{percentage_to_stake:ae(t)}}}),xo=({neuronId:e,percentageToSpawn:t,newController:n,nonce:o})=>Q({neuronId:e,command:{Spawn:{percentage_to_spawn:t===void 0?[]:[t],new_controller:n===void 0?[]:[n],nonce:o===void 0?[]:[o]}}}),So=({neuronId:e,principal:t})=>J({neuronId:e,operation:{AddHotKey:{new_hot_key:[t]}}}),ko=({neuronId:e,principal:t})=>J({neuronId:e,operation:{RemoveHotKey:{hot_key_to_remove:[t]}}}),To=({neuronId:e,additionalDissolveDelaySeconds:t})=>J({neuronId:e,operation:{IncreaseDissolveDelay:{additional_dissolve_delay_seconds:t}}}),Co=({neuronId:e,dissolveDelaySeconds:t})=>J({neuronId:e,operation:{SetDissolveTimestamp:{dissolve_timestamp_seconds:BigInt(t)}}}),Po=e=>J({neuronId:e,operation:{JoinCommunityFund:{}}}),Mo=({neuronId:e,autoStake:t})=>J({neuronId:e,operation:{ChangeAutoStakeMaturity:{requested_setting_for_auto_stake_maturity:t}}}),Ao=e=>J({neuronId:e,operation:{LeaveCommunityFund:{}}}),bn=({sourceNeuronId:e,targetNeuronId:t})=>Q({neuronId:t,command:{Merge:{source_neuron_id:[{id:e}]}}}),Eo=e=>J({neuronId:e,operation:{StartDissolving:{}}}),Vo=e=>J({neuronId:e,operation:{StopDissolving:{}}}),Q=({neuronId:e,command:t})=>({id:[{id:e}],command:[t],neuron_id_or_subaccount:[]}),J=({neuronId:e,operation:t})=>Q({neuronId:e,command:{Configure:{operation:[t]}}});import{Principal as xn}from"@dfinity/principal";import{polling as Bo}from"@dfinity/agent";var x=()=>import("@dfinity/nns-proto"),Ge=async({agent:e,canisterId:t,methodName:n,arg:o})=>{let r=await e.call(t,{methodName:n,arg:o,effectiveCanisterId:t});if(!r.response.ok)throw new Error(["Call failed:",` Method: ${n}`,` Canister ID: ${t}`,` Request ID: ${r.requestId}`,` HTTP status code: ${r.response.status}`,` HTTP status text: ${r.response.statusText}`].join(`
|
|
3
|
-
`));let i=await Bo.pollForResponse(e,t,r.requestId,Bo.defaultStrategy());return new Uint8Array(i)};var Fo=async e=>{let{PrincipalId:t,ManageNeuron:n,NeuronId:o}=await x(),r=new t;r.setSerializedId(xn.fromText(e.principal).toUint8Array());let i=new n.AddHotKey;i.setNewHotKey(r);let s=new n.Configure;s.setAddHotKey(i);let c=new n;c.setConfigure(s);let u=new o;return u.setId(e.neuronId.toString()),c.setNeuronId(u),c},qo=async e=>{let{PrincipalId:t,ManageNeuron:n,NeuronId:o}=await x(),r=new t;r.setSerializedId(xn.fromText(e.principal).toUint8Array());let i=new n.RemoveHotKey;i.setHotKeyToRemove(r);let s=new n.Configure;s.setRemoveHotKey(i);let c=new n;c.setConfigure(s);let u=new o;return u.setId(e.neuronId.toString()),c.setNeuronId(u),c},Uo=async({neuronId:e,additionalDissolveDelaySeconds:t})=>{let{ManageNeuron:n,NeuronId:o}=await x(),r=new n.IncreaseDissolveDelay;r.setAdditionalDissolveDelaySeconds(t);let i=new n.Configure;i.setIncreaseDissolveDelay(r);let s=new n;s.setConfigure(i);let c=new o;return c.setId(e.toString()),s.setNeuronId(c),s},Ko=async e=>{let{ManageNeuron:t,NeuronId:n}=await x(),o=new t.Configure;o.setStartDissolving(new t.StartDissolving);let r=new t;r.setConfigure(o);let i=new n;return i.setId(e.toString()),r.setNeuronId(i),r},Ho=async e=>{let{ManageNeuron:t,NeuronId:n}=await x(),o=new t.Configure;o.setStopDissolving(new t.StopDissolving);let r=new t;r.setConfigure(o);let i=new n;return i.setId(e.toString()),r.setNeuronId(i),r},Wo=async e=>{let{ManageNeuron:t,NeuronId:n}=await x(),o=new t.Configure;o.setJoinCommunityFund(new t.JoinCommunityFund);let r=new t;r.setConfigure(o);let i=new n;return i.setId(e.toString()),r.setNeuronId(i),r},Go=async e=>{let{ManageNeuron:t,NeuronId:n,AccountIdentifier:o}=await x(),r=new t.Disburse;if(e.toAccountId){let c=new o;c.setHash(Uint8Array.from(Buffer.from(e.toAccountId,"hex"))),r.setToAccount(c)}if(e.amount!=null){let c=new t.Disburse.Amount;c.setE8s(e.amount.toString()),r.setAmount(c)}let i=new t;i.setDisburse(r);let s=new n;return s.setId(e.neuronId.toString()),i.setNeuronId(s),i},jo=async e=>{let{ManageNeuron:t,NeuronId:n}=await x(),o=new t.MergeMaturity;o.setPercentageToMerge(e.percentageToMerge);let r=new t,i=new n;return i.setId(e.neuronId.toString()),r.setNeuronId(i),r.setMergeMaturity(o),r},$o=async e=>{let{ManageNeuron:t,NeuronId:n,PrincipalId:o}=await x(),r=new t.Spawn;if(e.newController){let c=new o;c.setSerializedId(xn.fromText(e.newController).toUint8Array().slice(4)),r.setNewController(c)}e.percentageToSpawn!==void 0&&r.setPercentageToSpawn(e.percentageToSpawn);let i=new t;i.setSpawn(r);let s=new n;return s.setId(e.neuronId.toString()),i.setNeuronId(s),i};import{AccountIdentifier as Oi,SubAccount as bi,accountIdentifierFromBytes as xi,principalToAccountIdentifier as Si}from"@dfinity/ledger-icp";import{Principal as ki}from"@dfinity/principal";import{fromDefinedNullable as Ti,fromNullable as l,uint8ArrayToArrayOfNumber as Ci}from"@dfinity/utils";var zo=(i=>(i[i.Unspecified=0]="Unspecified",i[i.Locked=1]="Locked",i[i.Dissolving=2]="Dissolving",i[i.Dissolved=3]="Dissolved",i[i.Spawning=4]="Spawning",i))(zo||{}),gi=(_=>(_[_.Unspecified=0]="Unspecified",_[_.ManageNeuron=1]="ManageNeuron",_[_.ExchangeRate=2]="ExchangeRate",_[_.NetworkEconomics=3]="NetworkEconomics",_[_.Governance=4]="Governance",_[_.NodeAdmin=5]="NodeAdmin",_[_.ParticipantManagement=6]="ParticipantManagement",_[_.SubnetManagement=7]="SubnetManagement",_[_.NetworkCanisterManagement=8]="NetworkCanisterManagement",_[_.Kyc=9]="Kyc",_[_.NodeProviderRewards=10]="NodeProviderRewards",_[_.SnsDecentralizationSale=11]="SnsDecentralizationSale",_[_.SubnetReplicaVersionManagement=12]="SubnetReplicaVersionManagement",_[_.ReplicaVersionManagement=13]="ReplicaVersionManagement",_[_.SnsAndCommunityFund=14]="SnsAndCommunityFund",_))(gi||{}),Ni=(i=>(i[i.Unknown=0]="Unknown",i[i.AcceptVotes=1]="AcceptVotes",i[i.ReadyToSettle=2]="ReadyToSettle",i[i.Settled=3]="Settled",i[i.Ineligible=4]="Ineligible",i))(Ni||{}),Ri=(s=>(s[s.Unknown=0]="Unknown",s[s.Open=1]="Open",s[s.Rejected=2]="Rejected",s[s.Accepted=3]="Accepted",s[s.Executed=4]="Executed",s[s.Failed=5]="Failed",s))(Ri||{}),hi=(o=>(o[o.Unspecified=0]="Unspecified",o[o.Yes=1]="Yes",o[o.No=2]="No",o))(hi||{}),vi=(d=>(d[d.Unspecified=0]="Unspecified",d[d.CreateSubnet=1]="CreateSubnet",d[d.AddNodeToSubnet=2]="AddNodeToSubnet",d[d.NnsCanisterInstall=3]="NnsCanisterInstall",d[d.NnsCanisterUpgrade=4]="NnsCanisterUpgrade",d[d.BlessReplicaVersion=5]="BlessReplicaVersion",d[d.RecoverSubnet=6]="RecoverSubnet",d[d.UpdateConfigOfSubnet=7]="UpdateConfigOfSubnet",d[d.AssignNoid=8]="AssignNoid",d[d.NnsRootUpgrade=9]="NnsRootUpgrade",d[d.IcpXdrConversionRate=10]="IcpXdrConversionRate",d[d.UpdateSubnetReplicaVersion=11]="UpdateSubnetReplicaVersion",d[d.ClearProvisionalWhitelist=12]="ClearProvisionalWhitelist",d[d.RemoveNodesFromSubnet=13]="RemoveNodesFromSubnet",d[d.SetAuthorizedSubnetworks=14]="SetAuthorizedSubnetworks",d[d.SetFirewallConfig=15]="SetFirewallConfig",d[d.UpdateNodeOperatorConfig=16]="UpdateNodeOperatorConfig",d[d.StopOrStartNnsCanister=17]="StopOrStartNnsCanister",d[d.RemoveNodes=18]="RemoveNodes",d[d.UninstallCode=19]="UninstallCode",d[d.UpdateNodeRewardsTable=20]="UpdateNodeRewardsTable",d[d.AddOrRemoveDataCenters=21]="AddOrRemoveDataCenters",d[d.UpdateUnassignedNodesConfig=22]="UpdateUnassignedNodesConfig",d[d.RemoveNodeOperators=23]="RemoveNodeOperators",d[d.RerouteCanisterRanges=24]="RerouteCanisterRanges",d[d.AddFirewallRules=25]="AddFirewallRules",d[d.RemoveFirewallRules=26]="RemoveFirewallRules",d[d.UpdateFirewallRules=27]="UpdateFirewallRules",d[d.PrepareCanisterMigration=28]="PrepareCanisterMigration",d[d.CompleteCanisterMigration=29]="CompleteCanisterMigration",d[d.AddSnsWasm=30]="AddSnsWasm",d[d.ChangeSubnetMembership=31]="ChangeSubnetMembership",d[d.UpdateSubnetType=32]="UpdateSubnetType",d[d.ChangeSubnetTypeAssignment=33]="ChangeSubnetTypeAssignment",d[d.UpdateSnsWasmSnsSubnetIds=34]="UpdateSnsWasmSnsSubnetIds",d[d.UpdateAllowedPrincipals=35]="UpdateAllowedPrincipals",d[d.RetireReplicaVersion=36]="RetireReplicaVersion",d[d.InsertSnsWasmUpgradePathEntries=37]="InsertSnsWasmUpgradePathEntries",d[d.UpdateElectedReplicaVersions=38]="UpdateElectedReplicaVersions",d[d.BitcoinSetConfig=39]="BitcoinSetConfig",d))(vi||{});var Sn=({neuronId:e,neuronInfo:t,rawNeuron:n,canisterId:o})=>{let r=n?Pi({neuron:n,canisterId:o}):void 0;return{neuronId:e,dissolveDelaySeconds:t.dissolve_delay_seconds,recentBallots:t.recent_ballots.map(Qo),createdTimestampSeconds:t.created_timestamp_seconds,state:t.state,joinedCommunityFundTimestampSeconds:t.joined_community_fund_timestamp_seconds.length?t.joined_community_fund_timestamp_seconds[0]:void 0,retrievedAtTimestampSeconds:t.retrieved_at_timestamp_seconds,votingPower:t.voting_power,ageSeconds:t.age_seconds,fullNeuron:r}},Pi=({neuron:e,canisterId:t})=>({id:e.id.length?Z(e.id[0]):void 0,stakedMaturityE8sEquivalent:l(e.staked_maturity_e8s_equivalent),controller:e.controller.length?e.controller[0].toString():void 0,recentBallots:e.recent_ballots.map(Qo),kycVerified:e.kyc_verified,notForProfit:e.not_for_profit,cachedNeuronStake:e.cached_neuron_stake_e8s,createdTimestampSeconds:e.created_timestamp_seconds,autoStakeMaturity:l(e.auto_stake_maturity),maturityE8sEquivalent:e.maturity_e8s_equivalent,agingSinceTimestampSeconds:e.aging_since_timestamp_seconds,neuronFees:e.neuron_fees_e8s,hotKeys:e.hot_keys.map(n=>n.toString()),accountIdentifier:Si(t,e.account),joinedCommunityFundTimestampSeconds:e.joined_community_fund_timestamp_seconds.length?e.joined_community_fund_timestamp_seconds[0]:void 0,dissolveState:e.dissolve_state.length?Mi(e.dissolve_state[0]):void 0,spawnAtTimesSeconds:e.spawn_at_timestamp_seconds[0],followees:e.followees.map(([n,o])=>Zo({topic:n,followees:o}))}),Qo=({vote:e,proposal_id:t})=>({vote:e,proposalId:t.length?Z(t[0]):void 0}),Mi=e=>"DissolveDelaySeconds"in e?{DissolveDelaySeconds:e.DissolveDelaySeconds}:{WhenDissolvedTimestampSeconds:e.WhenDissolvedTimestampSeconds},Zo=({topic:e,followees:t})=>({topic:e,followees:t.followees.map(Z)}),Z=({id:e})=>e,Ai=e=>{if("NeuronId"in e)return{NeuronId:e.NeuronId.id};if("Subaccount"in e)return{Subaccount:Ci(e.Subaccount)};throw new h(e)},Ei=({neuronId:e,ballot:t})=>{let{vote:n,voting_power:o}=t;return{neuronId:e,vote:n,votingPower:o}},Vi=({title:e,url:t,action:n,summary:o})=>({title:e.length?e[0]:void 0,url:t,action:n.length?Io(n[0]):void 0,summary:o}),Io=e=>{if("ExecuteNnsFunction"in e)return{ExecuteNnsFunction:{nnsFunctionId:e.ExecuteNnsFunction.nns_function}};if("ManageNeuron"in e){let t=e.ManageNeuron;return{ManageNeuron:{id:t.id.length?Z(t.id[0]):void 0,command:t.command.length?Fi(t.command[0]):void 0,neuronIdOrSubaccount:t.neuron_id_or_subaccount.length?Ai(t.neuron_id_or_subaccount[0]):void 0}}}if("ApproveGenesisKyc"in e)return{ApproveGenesisKyc:{principals:e.ApproveGenesisKyc.principals.map(n=>n.toString())}};if("ManageNetworkEconomics"in e){let t=e.ManageNetworkEconomics;return{ManageNetworkEconomics:{neuronMinimumStake:t.neuron_minimum_stake_e8s,maxProposalsToKeepPerTopic:t.max_proposals_to_keep_per_topic,neuronManagementFeePerProposal:t.neuron_management_fee_per_proposal_e8s,rejectCost:t.reject_cost_e8s,transactionFee:t.transaction_fee_e8s,neuronSpawnDissolveDelaySeconds:t.neuron_spawn_dissolve_delay_seconds,minimumIcpXdrRate:t.minimum_icp_xdr_rate,maximumNodeProviderRewards:t.maximum_node_provider_rewards_e8s}}}if("RewardNodeProvider"in e){let t=e.RewardNodeProvider;return{RewardNodeProvider:{nodeProvider:t.node_provider.length?je(t.node_provider[0]):void 0,amountE8s:t.amount_e8s,rewardMode:t.reward_mode.length?Jo(t.reward_mode[0]):void 0}}}if("RewardNodeProviders"in e){let t=e.RewardNodeProviders;return{RewardNodeProviders:{useRegistryDerivedRewards:t.use_registry_derived_rewards.length?t.use_registry_derived_rewards[0]:void 0,rewards:t.rewards.map(n=>({nodeProvider:n.node_provider.length?je(n.node_provider[0]):void 0,amountE8s:n.amount_e8s,rewardMode:n.reward_mode.length?Jo(n.reward_mode[0]):void 0}))}}}if("AddOrRemoveNodeProvider"in e){let t=e.AddOrRemoveNodeProvider;return{AddOrRemoveNodeProvider:{change:t.change.length?Ui(t.change[0]):void 0}}}if("Motion"in e)return{Motion:{motionText:e.Motion.motion_text}};if("SetDefaultFollowees"in e)return{SetDefaultFollowees:{defaultFollowees:e.SetDefaultFollowees.default_followees.map(([n,o])=>Zo({topic:n,followees:o}))}};if("RegisterKnownNeuron"in e){let t=e.RegisterKnownNeuron;return{RegisterKnownNeuron:Wi(t)}}if("SetSnsTokenSwapOpenTimeWindow"in e){let t=e.SetSnsTokenSwapOpenTimeWindow,n=t.request?.length?{openTimeWindow:t.request[0].open_time_window.length?{startTimestampSeconds:t.request[0].open_time_window[0].start_timestamp_seconds,endTimestampSeconds:t.request[0].open_time_window[0].end_timestamp_seconds}:void 0}:void 0,o=t?.swap_canister_id.length?t.swap_canister_id[0].toString():void 0;return{SetSnsTokenSwapOpenTimeWindow:{request:n,swapCanisterId:o}}}if("OpenSnsTokenSwap"in e){let t=e.OpenSnsTokenSwap,n=l(t.params);return{OpenSnsTokenSwap:{communityFundInvestmentE8s:l(t.community_fund_investment_e8s),targetSwapCanisterId:l(t.target_swap_canister_id),...n!==void 0&&{params:{minParticipantIcpE8s:n.min_participant_icp_e8s,maxIcpE8s:n.max_icp_e8s,swapDueTimestampSeconds:n.swap_due_timestamp_seconds,minParticipants:n.min_participants,snsTokenE8s:n.sns_token_e8s,maxParticipantIcpE8s:n.max_participant_icp_e8s,minIcpE8s:n.min_icp_e8s,saleDelaySeconds:l(n.sale_delay_seconds),neuronBasketConstructionParameters:l(n.neuron_basket_construction_parameters)}}}}}if("CreateServiceNervousSystem"in e){let t=e.CreateServiceNervousSystem;return{CreateServiceNervousSystem:{url:l(t.url),governanceParameters:Ii(l(t.governance_parameters)),fallbackControllerPrincipalIds:t.fallback_controller_principal_ids.map(n=>n.toString()),logo:nr(l(t.logo)),name:l(t.name),ledgerParameters:Qi(l(t.ledger_parameters)),description:l(t.description),dappCanisters:t.dapp_canisters.map(Yi)??[],swapParameters:Li(l(t.swap_parameters)),initialTokenDistribution:ns(l(t.initial_token_distribution))}}}throw new h(e)},Bi=e=>({no:e.no,yes:e.yes,total:e.total,timestampSeconds:e.timestamp_seconds}),Fi=e=>{if("Spawn"in e){let t=e.Spawn;return{Spawn:{newController:t.new_controller.length?t.new_controller[0].toString():void 0,percentageToSpawn:t.percentage_to_spawn.length?t.percentage_to_spawn[0]:0}}}if("Split"in e)return{Split:{amount:e.Split.amount_e8s}};if("Follow"in e){let t=e.Follow;return{Follow:{topic:t.topic,followees:t.followees.map(Z)}}}if("ClaimOrRefresh"in e){let t=e.ClaimOrRefresh;return{ClaimOrRefresh:{by:t.by.length?Hi(t.by[0]):void 0}}}if("Configure"in e){let t=e.Configure;return{Configure:{operation:t.operation.length?qi(t.operation[0]):void 0}}}if("RegisterVote"in e){let t=e.RegisterVote;return{RegisterVote:{vote:t.vote,proposal:t.proposal.length?Z(t.proposal[0]):void 0}}}if("DisburseToNeuron"in e){let t=e.DisburseToNeuron;return{DisburseToNeuron:{dissolveDelaySeconds:t.dissolve_delay_seconds,kycVerified:t.kyc_verified,amount:t.amount_e8s,newController:t.new_controller.length?t.new_controller[0].toString():void 0,nonce:t.nonce}}}if("MergeMaturity"in e)return{MergeMaturity:{percentageToMerge:e.MergeMaturity.percentage_to_merge}};if("StakeMaturity"in e){let{percentage_to_stake:t}=e.StakeMaturity;return{StakeMaturity:{percentageToStake:l(t)}}}if("MakeProposal"in e){let t=e.MakeProposal;return{MakeProposal:{title:t.title.length?t.title[0]:void 0,url:t.url,action:t.action.length?Io(t.action[0]):void 0,summary:t.summary}}}if("Disburse"in e){let t=e.Disburse;return{Disburse:{toAccountId:t.to_account.length?kn(t.to_account[0]):void 0,amount:t.amount.length?Ki(t.amount[0]):void 0}}}if("Merge"in e){let t=e.Merge;return{Merge:{sourceNeuronId:t.source_neuron_id.length?t.source_neuron_id[0].id:void 0}}}throw new h(e)},qi=e=>{if("RemoveHotKey"in e){let t=e.RemoveHotKey;return{RemoveHotKey:{hotKeyToRemove:t.hot_key_to_remove.length?t.hot_key_to_remove[0].toString():void 0}}}if("AddHotKey"in e){let t=e.AddHotKey;return{AddHotKey:{newHotKey:t.new_hot_key.length?t.new_hot_key[0].toString():void 0}}}if("StopDissolving"in e)return{StopDissolving:{}};if("StartDissolving"in e)return{StartDissolving:{}};if("IncreaseDissolveDelay"in e)return{IncreaseDissolveDelay:{additionalDissolveDelaySeconds:e.IncreaseDissolveDelay.additional_dissolve_delay_seconds}};if("JoinCommunityFund"in e||"LeaveCommunityFund"in e)return e;if("SetDissolveTimestamp"in e)return{SetDissolveTimestamp:{dissolveTimestampSeconds:e.SetDissolveTimestamp.dissolve_timestamp_seconds}};if("ChangeAutoStakeMaturity"in e){let{requested_setting_for_auto_stake_maturity:t}=e.ChangeAutoStakeMaturity;return{ChangeAutoStakeMaturity:{requestedSettingForAutoStakeMaturity:t}}}throw new h(e)},Ui=e=>{if("ToRemove"in e)return{ToRemove:je(e.ToRemove)};if("ToAdd"in e)return{ToAdd:je(e.ToAdd)};throw new h(e)},je=e=>({id:e.id.length?e.id[0].toString():void 0,rewardAccount:e.reward_account.length?kn(e.reward_account[0]):void 0}),Ki=e=>e.e8s,kn=e=>xi(new Uint8Array(e.hash)),Jo=e=>{if("RewardToNeuron"in e)return{RewardToNeuron:{dissolveDelaySeconds:e.RewardToNeuron.dissolve_delay_seconds}};if("RewardToAccount"in e)return{RewardToAccount:{toAccount:e.RewardToAccount.to_account!=null&&e.RewardToAccount.to_account.length?kn(e.RewardToAccount.to_account[0]):void 0}};throw new h(e)},Hi=e=>{if("NeuronIdOrSubaccount"in e)return{NeuronIdOrSubaccount:{}};if("Memo"in e)return{Memo:e.Memo};if("MemoAndController"in e)return{MemoAndController:{memo:e.MemoAndController.memo,controller:e.MemoAndController.controller.length?e.MemoAndController.controller[0]:void 0}};throw new h(e)},Tn=e=>({id:e.id.length?Z(e.id[0]):void 0,ballots:e.ballots.map(t=>Ei({neuronId:t[0],ballot:t[1]})),rejectCost:e.reject_cost_e8s,proposalTimestampSeconds:e.proposal_timestamp_seconds,rewardEventRound:e.reward_event_round,failedTimestampSeconds:e.failed_timestamp_seconds,deadlineTimestampSeconds:l(e.deadline_timestamp_seconds),decidedTimestampSeconds:e.decided_timestamp_seconds,proposal:e.proposal.length?Vi(e.proposal[0]):void 0,proposer:e.proposer.length?Z(e.proposer[0]):void 0,latestTally:e.latest_tally.length?Bi(e.latest_tally[0]):void 0,executedTimestampSeconds:e.executed_timestamp_seconds,topic:e.topic,status:e.status,rewardStatus:e.reward_status}),Do=({response:{neuron_infos:e,full_neurons:t},canisterId:n})=>e.map(([o,r])=>Sn({neuronId:o,neuronInfo:r,rawNeuron:t.find(i=>i.id.length&&i.id[0].id===o),canisterId:n})),Lo=({proposal_info:e})=>({proposals:e.map(Tn)}),Wi=({id:e,known_neuron_data:t})=>({id:e[0]?.id??BigInt(0),name:t[0]?.name??"",description:t[0]?.description[0]??""}),er=e=>{let t=e.getProposalId();return{vote:e.getVote(),proposalId:t!==void 0?BigInt(t.getId()):void 0}},Gi=e=>e?.hasWhenDissolvedTimestampSeconds()?2:e?.hasDissolveDelaySeconds()?e.getDissolveDelaySeconds()==="0"?3:1:0,ji=e=>e.toArray().map(([t,n])=>({topic:Number(t),followees:n.getFolloweesList?.().map(o=>BigInt(o.getId()))??[]})),Xo=e=>ki.fromUint8Array(e.getSerializedId_asU8()).toText(),$i=({neuron:e,canisterId:t})=>{let n=bi.fromBytes(e.getAccount_asU8());return Oi.fromPrincipal({principal:t,subAccount:n})},zi=({pbNeuron:e,pbNeuronInfo:t,canisterId:n})=>{let o=e.getId(),r=e.getController(),i=r===void 0?r:Xo(r),s;return e.hasWhenDissolvedTimestampSeconds()?s={WhenDissolvedTimestampSeconds:BigInt(e.getWhenDissolvedTimestampSeconds())}:e.hasDissolveDelaySeconds()&&(s={DissolveDelaySeconds:BigInt(e.getDissolveDelaySeconds())}),{id:o===void 0?void 0:BigInt(o.getId()),stakedMaturityE8sEquivalent:void 0,controller:i,recentBallots:t.getRecentBallotsList().map(er),kycVerified:e.getKycVerified(),notForProfit:e.getNotForProfit(),cachedNeuronStake:BigInt(e.getCachedNeuronStakeE8s()),createdTimestampSeconds:BigInt(e.getCreatedTimestampSeconds()),autoStakeMaturity:void 0,maturityE8sEquivalent:BigInt(e.getMaturityE8sEquivalent()),agingSinceTimestampSeconds:BigInt(e.getAgingSinceTimestampSeconds()),spawnAtTimesSeconds:e.hasSpawnAtTimestampSeconds()?BigInt(e.getSpawnAtTimestampSeconds()):void 0,neuronFees:BigInt(e.getNeuronFeesE8s()),hotKeys:e.getHotKeysList().map(Xo),accountIdentifier:$i({neuron:e,canisterId:n}).toHex(),joinedCommunityFundTimestampSeconds:void 0,dissolveState:s,followees:ji(e.getFolloweesMap())}},tr=({pbNeurons:e,canisterId:t})=>n=>{let o=e.find(i=>i.getId()?.getId()===n.getKey()),r=n.getValue();if(r===void 0)throw new Error(`NeuronInfo not present for neuron ${n.getKey()}`);return{neuronId:BigInt(n.getKey()),dissolveDelaySeconds:BigInt(r.getDissolveDelaySeconds()),recentBallots:r.getRecentBallotsList().map(er),createdTimestampSeconds:BigInt(r.getCreatedTimestampSeconds()),state:Gi(o),joinedCommunityFundTimestampSeconds:void 0,retrievedAtTimestampSeconds:BigInt(r.getRetrievedAtTimestampSeconds()),votingPower:BigInt(r.getVotingPower()),ageSeconds:BigInt(r.getAgeSeconds()),fullNeuron:o===void 0?void 0:zi({pbNeuron:o,pbNeuronInfo:r,canisterId:t})}},$e=e=>e===void 0?void 0:{basisPoints:l(e.basis_points)},U=e=>e===void 0?void 0:{seconds:l(e.seconds)},Ji=e=>e===void 0?void 0:{secondsAfterUtcMidnight:l(e.seconds_after_utc_midnight)},Xi=e=>e===void 0?void 0:{isoCodes:e.iso_codes},K=e=>e===void 0?void 0:{e8s:l(e.e8s)},Yi=e=>e===void 0||e.id.length===0?void 0:Ti(e.id).toString(),nr=e=>e===void 0?void 0:{base64Encoding:l(e.base64_encoding)},Qi=e=>e===void 0?void 0:{transactionFee:K(l(e.transaction_fee)),tokenSymbol:l(e.token_symbol),tokenLogo:nr(l(e.token_logo)),tokenName:l(e.token_name)},Zi=e=>e===void 0?void 0:{rewardRateTransitionDuration:U(l(e.reward_rate_transition_duration)),initialRewardRate:$e(l(e.initial_reward_rate)),finalRewardRate:$e(l(e.final_reward_rate))},Ii=e=>e===void 0?void 0:{neuronMaximumDissolveDelayBonus:$e(l(e.neuron_maximum_dissolve_delay_bonus)),neuronMaximumAgeForAgeBonus:U(l(e.neuron_maximum_age_for_age_bonus)),neuronMaximumDissolveDelay:U(l(e.neuron_maximum_dissolve_delay)),neuronMinimumDissolveDelayToVote:U(l(e.neuron_minimum_dissolve_delay_to_vote)),neuronMaximumAgeBonus:$e(l(e.neuron_maximum_age_bonus)),neuronMinimumStake:K(l(e.neuron_minimum_stake)),proposalWaitForQuietDeadlineIncrease:U(l(e.proposal_wait_for_quiet_deadline_increase)),proposalInitialVotingPeriod:U(l(e.proposal_initial_voting_period)),proposalRejectionFee:K(l(e.proposal_rejection_fee)),votingRewardParameters:Zi(l(e.voting_reward_parameters))},Di=e=>e===void 0?void 0:{dissolveDelayInterval:U(l(e.dissolve_delay_interval)),count:l(e.count)},Li=e=>e===void 0?void 0:{minimumParticipants:l(e.minimum_participants),duration:U(l(e.duration)),neuronBasketConstructionParameters:Di(l(e.neuron_basket_construction_parameters)),confirmationText:l(e.confirmation_text),maximumParticipantIcp:K(l(e.maximum_participant_icp)),neuronsFundInvestmentIcp:K(l(e.neurons_fund_investment_icp)),minimumIcp:K(l(e.minimum_icp)),minimumParticipantIcp:K(l(e.minimum_participant_icp)),startTime:Ji(l(e.start_time)),maximumIcp:K(l(e.maximum_icp)),restrictedCountries:Xi(l(e.restricted_countries))},Yo=e=>e===void 0?void 0:{total:K(l(e.total))},es=e=>e===void 0?void 0:{controller:e.controller.length===0?void 0:e.controller[0].toString(),dissolveDelay:U(l(e.dissolve_delay)),memo:l(e.memo),vestingPeriod:U(l(e.vesting_period)),stake:K(l(e.stake))},ts=e=>e===void 0?void 0:{developerNeurons:e.developer_neurons.map(es)},ns=e=>e===void 0?void 0:{treasuryDistribution:Yo(l(e.treasury_distribution)),developerDistribution:ts(l(e.developer_distribution)),swapDistribution:Yo(l(e.swap_distribution))};var or=async e=>{let{ManageNeuronResponse:t}=await x(),o=t.deserializeBinary(e).getError();if(o)throw new M({error_message:o.getErrorMessage(),error_type:o.getErrorType()})};var Ce=e=>{let{command:t}=e,n=t[0];if(!n)throw new M({error_message:"Error updating neuron",error_type:0});if("Error"in n)throw new M(n.Error);return n},v=async({request:e,service:t})=>{let n=await t.manage_neuron(e);Ce(n)},rr=async({request:e,service:t})=>{let n=await t.simulate_manage_neuron(e);return Ce(n)};var Cn=BigInt(1e8);var ar=class e{constructor(t,n,o,r,i=!1){this.canisterId=t;this.service=n;this.certifiedService=o;this.agent=r;this.hardwareWallet=i;this.listNeurons=async({certified:t=!0,neuronIds:n})=>{if(this.hardwareWallet&&!t)throw new Ke;if(this.hardwareWallet)return this.listNeuronsHardwareWallet();let o=mo(n),r=await this.getGovernanceService(t).list_neurons(o);return Do({response:r,canisterId:this.canisterId})};this.listKnownNeurons=async(t=!0)=>(await this.getGovernanceService(t).list_known_neurons()).known_neurons.map(o=>({id:k(o.id)?.id??BigInt(0),name:k(o.known_neuron_data)?.name??"",description:k(k(o.known_neuron_data)?.description??[])}));this.getLastestRewardEvent=async(t=!0)=>this.getGovernanceService(t).get_latest_reward_event();this.listProposals=async({request:t,certified:n=!0})=>{let o=fo(t),r=await this.getGovernanceService(n).list_proposals(o);return Lo(r)};this.stakeNeuron=async({stake:t,principal:n,fromSubAccount:o,ledgerCanister:r,createdAt:i,fee:s})=>{if(t<Cn)throw new Te(t);let c=new Uint8Array((0,En.default)(8)),u=sr(c),m=this.buildNeuronStakeSubAccount(c,n),f=Pn.fromPrincipal({principal:this.canisterId,subAccount:m});await r.transfer({memo:u,amount:t,fromSubAccount:o,to:f,createdAt:i,fee:s});let p=await this.claimOrRefreshNeuronFromAccount({controller:n,memo:u});if(An(p))throw new ke;return p};this.stakeNeuronIcrc1=async({stake:t,principal:n,fromSubAccount:o,ledgerCanister:r,createdAt:i,fee:s})=>{if(t<Cn)throw new Te(t);let c=new Uint8Array((0,En.default)(8)),u=sr(c),m=this.getNeuronStakeSubAccountBytes(c,n);await r.icrc1Transfer({icrc1Memo:c,amount:t,fromSubAccount:o,to:{owner:this.canisterId,subaccount:[m]},createdAt:i,fee:s});let f=await this.claimOrRefreshNeuronFromAccount({controller:n,memo:u});if(An(f))throw new ke;return f};this.increaseDissolveDelay=async({neuronId:t,additionalDissolveDelaySeconds:n})=>{if(this.hardwareWallet)return this.increaseDissolveDelayHardwareWallet({neuronId:t,additionalDissolveDelaySeconds:n});let o=To({neuronId:t,additionalDissolveDelaySeconds:n});return v({request:o,service:this.certifiedService})};this.setDissolveDelay=async({neuronId:t,dissolveDelaySeconds:n})=>{let o=Co({neuronId:t,dissolveDelaySeconds:n});return v({request:o,service:this.certifiedService})};this.startDissolving=async t=>{if(this.hardwareWallet)return this.startDissolvingHardwareWallet(t);let n=Eo(t);return v({request:n,service:this.certifiedService})};this.stopDissolving=async t=>{if(this.hardwareWallet)return this.stopDissolvingHardwareWallet(t);let n=Vo(t);return v({request:n,service:this.certifiedService})};this.joinCommunityFund=async t=>{if(this.hardwareWallet)return this.joinCommunityFundHardwareWallet(t);let n=Po(t);return v({request:n,service:this.certifiedService})};this.autoStakeMaturity=t=>v({request:Mo(t),service:this.certifiedService});this.leaveCommunityFund=async t=>{let n=Ao(t);return v({request:n,service:this.certifiedService})};this.setNodeProviderAccount=async t=>{ir(t);let n=Pn.fromHex(t),o=await this.certifiedService.update_node_provider({reward_account:[n.toAccountIdentifierHash()]});if("Err"in o)throw new M(o.Err)};this.mergeNeurons=async t=>{let n=bn(t);return v({request:n,service:this.certifiedService})};this.simulateMergeNeurons=async t=>{let n=bn(t),o=await rr({request:n,service:this.certifiedService}),r,i,s,c;if("Merge"in o&&A(r=o.Merge)&&A(i=k(r.target_neuron_info))&&A(s=k(r.target_neuron))&&A(c=k(s.id)?.id))return Sn({neuronId:c,neuronInfo:i,rawNeuron:s,canisterId:this.canisterId});throw new z(`simulateMergeNeurons: Unrecognized Merge error in ${JSON.stringify(o)}`)};this.splitNeuron=async({neuronId:t,amount:n})=>{let o=go({neuronId:t,amount:n}),r=await this.certifiedService.manage_neuron(o),i=Ce(r);if("Split"in i){let s=k(i.Split.created_neuron_id);if(An(s))throw new M({error_message:"Unexpected error splitting neuron. No neuronId in Split response.",error_type:0});return s.id}throw new z(`Unrecognized Split error in ${JSON.stringify(r)}`)};this.getProposal=async({proposalId:t,certified:n=!0})=>{let[o]=await this.getGovernanceService(n).get_proposal_info(t);return o?Tn(o):void 0};this.makeProposal=async t=>{let n=Ro(t);return v({request:n,service:this.certifiedService})};this.registerVote=async({neuronId:t,vote:n,proposalId:o})=>{let r=No({neuronId:t,vote:n,proposalId:o});return v({request:r,service:this.certifiedService})};this.setFollowees=async t=>{let n=ho(t);return v({request:n,service:this.certifiedService})};this.disburse=async({neuronId:t,toAccountId:n,amount:o})=>{if(A(n)&&ir(n),this.hardwareWallet)return this.disburseHardwareWallet({neuronId:t,toAccountId:n,amount:o});let r=A(n)?Pn.fromHex(n):void 0,i=vo({neuronId:t,toAccountIdentifier:r,amount:o});return v({request:i,service:this.certifiedService})};this.mergeMaturity=async({neuronId:t,percentageToMerge:n})=>{if(Mn(n),this.hardwareWallet)return this.mergeMaturityHardwareWallet({neuronId:t,percentageToMerge:n});let o=Oo({neuronId:t,percentageToMerge:n});return v({request:o,service:this.certifiedService})};this.stakeMaturity=async({neuronId:t,percentageToStake:n})=>{Mn(n??100),await v({request:bo({neuronId:t,percentageToStake:n}),service:this.certifiedService})};this.spawnNeuron=async({neuronId:t,percentageToSpawn:n,newController:o,nonce:r})=>{if(A(n)&&Mn(n),this.hardwareWallet)return this.spawnHardwareWallet({neuronId:t,percentageToSpawn:n,newController:o?.toText()});let i=xo({neuronId:t,percentageToSpawn:n,newController:o,nonce:r}),s=await this.certifiedService.manage_neuron(i),c=Ce(s),u;if("Spawn"in c&&A(u=k(c.Spawn.created_neuron_id)?.id))return u;throw new z(`Unrecognized Spawn error in ${JSON.stringify(s)}`)};this.addHotkey=async({neuronId:t,principal:n})=>{if(this.hardwareWallet)return this.addHotkeyHardwareWallet({neuronId:t,principal:n});let o=So({neuronId:t,principal:n});return v({request:o,service:this.certifiedService})};this.removeHotkey=async({neuronId:t,principal:n})=>{if(this.hardwareWallet)return this.removeHotkeyHardwareWallet({neuronId:t,principal:n});let o=ko({neuronId:t,principal:n});return v({request:o,service:this.certifiedService})};this.claimOrRefreshNeuronFromAccount=async({memo:t,controller:n})=>{let o=yo({memo:t,controller:n}),r=await this.certifiedService.manage_neuron(o),i;if(A(i=k(r.command))&&"ClaimOrRefresh"in i)return k(i.ClaimOrRefresh.refreshed_neuron_id)?.id;throw new z(`Unrecognized ClaimOrRefresh error in ${JSON.stringify(r)}`)};this.claimOrRefreshNeuron=async t=>{let n=wo(t),o=await this.service.manage_neuron(n),r;if(A(r=k(o.command))&&"ClaimOrRefresh"in r)return k(r.ClaimOrRefresh.refreshed_neuron_id)?.id;throw new z(`Unrecognized ClaimOrRefresh error in ${JSON.stringify(o)}`)};this.buildNeuronStakeSubAccount=(t,n)=>os.fromBytes(this.getNeuronStakeSubAccountBytes(t,n));this.getNeuronStakeSubAccountBytes=(t,n)=>{let o=is("neuron-stake"),r=qn.create();return r.update(rs([12,...o,...n.toUint8Array(),...t])),r.digest()};this.getNeuron=async({certified:t=!0,neuronId:n})=>{let[o]=await this.listNeurons({certified:t,neuronIds:[n]});return o};this.listNeuronsHardwareWallet=async()=>{let{ListNeurons:t,ListNeuronsResponse:n}=await x(),o=new t;o.setIncludeNeuronsReadableByCaller(!0);let r=await Ge({agent:this.agent,canisterId:this.canisterId,methodName:"list_neurons_pb",arg:o.serializeBinary()}),i=n.deserializeBinary(r),s=i.getFullNeuronsList();return i.getNeuronIdsList().map(tr({pbNeurons:s,canisterId:this.canisterId}))};this.manageNeuronUpdateCall=async t=>{let n=await Ge({agent:this.agent,canisterId:this.canisterId,methodName:"manage_neuron_pb",arg:t.serializeBinary()});await or(n)};this.addHotkeyHardwareWallet=async({neuronId:t,principal:n})=>{let o=await Fo({neuronId:t,principal:n.toText()});await this.manageNeuronUpdateCall(o)};this.removeHotkeyHardwareWallet=async({neuronId:t,principal:n})=>{let o=await qo({neuronId:t,principal:n.toText()});await this.manageNeuronUpdateCall(o)};this.increaseDissolveDelayHardwareWallet=async({neuronId:t,additionalDissolveDelaySeconds:n})=>{let o=await Uo({neuronId:t,additionalDissolveDelaySeconds:n});await this.manageNeuronUpdateCall(o)};this.startDissolvingHardwareWallet=async t=>{let n=await Ko(t);await this.manageNeuronUpdateCall(n)};this.stopDissolvingHardwareWallet=async t=>{let n=await Ho(t);await this.manageNeuronUpdateCall(n)};this.joinCommunityFundHardwareWallet=async t=>{let n=await Wo(t);await this.manageNeuronUpdateCall(n)};this.disburseHardwareWallet=async t=>{let n=await Go(t);await this.manageNeuronUpdateCall(n)};this.mergeMaturityHardwareWallet=async t=>{let n=await jo(t);await this.manageNeuronUpdateCall(n)};this.spawnHardwareWallet=async t=>{let n=await $o(t),o=await Ge({agent:this.agent,canisterId:this.canisterId,methodName:"manage_neuron_pb",arg:n.serializeBinary()}),{ManageNeuronResponse:r}=await x(),i=r.deserializeBinary(o),s=i.getError();if(s)throw new M({error_message:s.getErrorMessage(),error_type:s.getErrorType()});let c=i.getSpawn()?.getCreatedNeuronId();if(A(c))return BigInt(c.getId());throw new z(`Unrecognized Spawn error in ${JSON.stringify(i)}`)};this.canisterId=t,this.service=n,this.certifiedService=o,this.agent=r,this.hardwareWallet=i}static create(t={}){let n=t.canisterId??Vn,{service:o,certifiedService:r,agent:i}=ss({options:{...t,canisterId:n},idlFactory:so,certifiedIdlFactory:io});return new e(n,o,r,i,t.hardwareWallet)}getGovernanceService(t){return t?this.certifiedService:this.service}};export{Ue as a,ke as b,Te as c,z as d,M as e,h as f,Ke as g,zo as h,gi as i,Ni as j,Ri as k,hi as l,vi as m,ar as n};
|
|
4
|
-
/*! Bundled license information:
|
|
5
|
-
|
|
6
|
-
ieee754/index.js:
|
|
7
|
-
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
8
|
-
|
|
9
|
-
buffer/index.js:
|
|
10
|
-
(*!
|
|
11
|
-
* The buffer module from node.js, for the browser.
|
|
12
|
-
*
|
|
13
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
14
|
-
* @license MIT
|
|
15
|
-
*)
|
|
16
|
-
|
|
17
|
-
@noble/hashes/esm/utils.js:
|
|
18
|
-
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
19
|
-
*/
|
|
20
|
-
//# sourceMappingURL=chunk-LARRGLCK.js.map
|