diff --git a/CHANGELOG.md b/CHANGELOG.md index af544e36..b8634fac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ The current status of the libraries at the time of the release is as follows: - Extend `eip1559TransactionPrice` for Erc20. - Add "Protocol Canister Management" and "Service Nervous System Management" topics support. - Add `asNonNullish` function, like `assertNonNullish` but returns the value. +- Support conversion of `InstallCode` action. ## Fix diff --git a/packages/nns/candid/genesis_token.did b/packages/nns/candid/genesis_token.did index ea6409ce..14443070 100644 --- a/packages/nns/candid/genesis_token.did +++ b/packages/nns/candid/genesis_token.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit a3831c8 (2024-07-11 tags: release-2024-07-10_23-01-base) 'rs/nns/gtc/canister/gtc.did' by import-candid +// Generated from IC repo commit de29a1a55b (2024-07-18 tags: release-2024-07-18_01-30--github-base) 'rs/nns/gtc/canister/gtc.did' by import-candid type AccountState = record { authenticated_principal_id : opt principal; successfully_transferred_neurons : vec TransferredNeuron; diff --git a/packages/nns/candid/governance.certified.idl.js b/packages/nns/candid/governance.certified.idl.js index 3821ee87..25d2326b 100644 --- a/packages/nns/candid/governance.certified.idl.js +++ b/packages/nns/candid/governance.certified.idl.js @@ -101,6 +101,13 @@ export const idlFactory = ({ IDL }) => { 'command' : IDL.Opt(Command), 'neuron_id_or_subaccount' : IDL.Opt(NeuronIdOrSubaccount), }); + const InstallCode = IDL.Record({ + 'arg' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'wasm_module' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'skip_stopping_before_installing' : IDL.Opt(IDL.Bool), + 'canister_id' : IDL.Opt(IDL.Principal), + 'install_mode' : IDL.Opt(IDL.Int32), + }); const Percentage = IDL.Record({ 'basis_points' : IDL.Opt(IDL.Nat64) }); const Duration = IDL.Record({ 'seconds' : IDL.Opt(IDL.Nat64) }); const Tokens = IDL.Record({ 'e8s' : IDL.Opt(IDL.Nat64) }); @@ -271,9 +278,7 @@ export const idlFactory = ({ IDL }) => { 'maximum_node_provider_rewards_e8s' : IDL.Nat64, 'neurons_fund_economics' : IDL.Opt(NeuronsFundEconomics), }); - const ApproveGenesisKyc = IDL.Record({ - 'principals' : IDL.Vec(IDL.Principal), - }); + const Principals = IDL.Record({ 'principals' : IDL.Vec(IDL.Principal) }); const Change = IDL.Variant({ 'ToRemove' : NodeProvider, 'ToAdd' : NodeProvider, @@ -283,6 +288,7 @@ export const idlFactory = ({ IDL }) => { const Action = IDL.Variant({ 'RegisterKnownNeuron' : KnownNeuron, 'ManageNeuron' : ManageNeuron, + 'InstallCode' : InstallCode, 'CreateServiceNervousSystem' : CreateServiceNervousSystem, 'ExecuteNnsFunction' : ExecuteNnsFunction, 'RewardNodeProvider' : RewardNodeProvider, @@ -291,7 +297,7 @@ export const idlFactory = ({ IDL }) => { 'SetDefaultFollowees' : SetDefaultFollowees, 'RewardNodeProviders' : RewardNodeProviders, 'ManageNetworkEconomics' : NetworkEconomics, - 'ApproveGenesisKyc' : ApproveGenesisKyc, + 'ApproveGenesisKyc' : Principals, 'AddOrRemoveNodeProvider' : AddOrRemoveNodeProvider, 'Motion' : Motion, }); @@ -464,7 +470,9 @@ export const idlFactory = ({ IDL }) => { 'max_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundNeuronPortion = IDL.Record({ + 'controller' : IDL.Opt(IDL.Principal), 'hotkey_principal' : IDL.Opt(IDL.Principal), + 'hotkeys' : IDL.Vec(IDL.Principal), 'is_capped' : IDL.Opt(IDL.Bool), 'maturity_equivalent_icp_e8s' : IDL.Opt(IDL.Nat64), 'nns_neuron_id' : IDL.Opt(NeuronId), @@ -786,7 +794,9 @@ export const idlFactory = ({ IDL }) => { 'nns_proposal_id' : IDL.Opt(IDL.Nat64), }); const NeuronsFundNeuron = IDL.Record({ + 'controller' : IDL.Opt(IDL.Principal), 'hotkey_principal' : IDL.Opt(IDL.Text), + 'hotkeys' : IDL.Opt(Principals), 'is_capped' : IDL.Opt(IDL.Bool), 'nns_neuron_id' : IDL.Opt(IDL.Nat64), 'amount_icp_e8s' : IDL.Opt(IDL.Nat64), @@ -974,6 +984,13 @@ export const init = ({ IDL }) => { 'command' : IDL.Opt(Command), 'neuron_id_or_subaccount' : IDL.Opt(NeuronIdOrSubaccount), }); + const InstallCode = IDL.Record({ + 'arg' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'wasm_module' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'skip_stopping_before_installing' : IDL.Opt(IDL.Bool), + 'canister_id' : IDL.Opt(IDL.Principal), + 'install_mode' : IDL.Opt(IDL.Int32), + }); const Percentage = IDL.Record({ 'basis_points' : IDL.Opt(IDL.Nat64) }); const Duration = IDL.Record({ 'seconds' : IDL.Opt(IDL.Nat64) }); const Tokens = IDL.Record({ 'e8s' : IDL.Opt(IDL.Nat64) }); @@ -1144,9 +1161,7 @@ export const init = ({ IDL }) => { 'maximum_node_provider_rewards_e8s' : IDL.Nat64, 'neurons_fund_economics' : IDL.Opt(NeuronsFundEconomics), }); - const ApproveGenesisKyc = IDL.Record({ - 'principals' : IDL.Vec(IDL.Principal), - }); + const Principals = IDL.Record({ 'principals' : IDL.Vec(IDL.Principal) }); const Change = IDL.Variant({ 'ToRemove' : NodeProvider, 'ToAdd' : NodeProvider, @@ -1156,6 +1171,7 @@ export const init = ({ IDL }) => { const Action = IDL.Variant({ 'RegisterKnownNeuron' : KnownNeuron, 'ManageNeuron' : ManageNeuron, + 'InstallCode' : InstallCode, 'CreateServiceNervousSystem' : CreateServiceNervousSystem, 'ExecuteNnsFunction' : ExecuteNnsFunction, 'RewardNodeProvider' : RewardNodeProvider, @@ -1164,7 +1180,7 @@ export const init = ({ IDL }) => { 'SetDefaultFollowees' : SetDefaultFollowees, 'RewardNodeProviders' : RewardNodeProviders, 'ManageNetworkEconomics' : NetworkEconomics, - 'ApproveGenesisKyc' : ApproveGenesisKyc, + 'ApproveGenesisKyc' : Principals, 'AddOrRemoveNodeProvider' : AddOrRemoveNodeProvider, 'Motion' : Motion, }); @@ -1337,7 +1353,9 @@ export const init = ({ IDL }) => { 'max_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundNeuronPortion = IDL.Record({ + 'controller' : IDL.Opt(IDL.Principal), 'hotkey_principal' : IDL.Opt(IDL.Principal), + 'hotkeys' : IDL.Vec(IDL.Principal), 'is_capped' : IDL.Opt(IDL.Bool), 'maturity_equivalent_icp_e8s' : IDL.Opt(IDL.Nat64), 'nns_neuron_id' : IDL.Opt(NeuronId), diff --git a/packages/nns/candid/governance.d.ts b/packages/nns/candid/governance.d.ts index 5037ca22..55992820 100644 --- a/packages/nns/candid/governance.d.ts +++ b/packages/nns/candid/governance.d.ts @@ -8,6 +8,7 @@ export interface AccountIdentifier { export type Action = | { RegisterKnownNeuron: KnownNeuron } | { ManageNeuron: ManageNeuron } + | { InstallCode: InstallCode } | { CreateServiceNervousSystem: CreateServiceNervousSystem } | { ExecuteNnsFunction: ExecuteNnsFunction } | { RewardNodeProvider: RewardNodeProvider } @@ -16,7 +17,7 @@ export type Action = | { SetDefaultFollowees: SetDefaultFollowees } | { RewardNodeProviders: RewardNodeProviders } | { ManageNetworkEconomics: NetworkEconomics } - | { ApproveGenesisKyc: ApproveGenesisKyc } + | { ApproveGenesisKyc: Principals } | { AddOrRemoveNodeProvider: AddOrRemoveNodeProvider } | { Motion: Motion }; export interface AddHotKey { @@ -305,6 +306,13 @@ export interface InitialTokenDistribution { developer_distribution: [] | [DeveloperDistribution]; swap_distribution: [] | [SwapDistribution]; } +export interface InstallCode { + arg: [] | [Uint8Array | number[]]; + wasm_module: [] | [Uint8Array | number[]]; + skip_stopping_before_installing: [] | [boolean]; + canister_id: [] | [Principal]; + install_mode: [] | [number]; +} export interface KnownNeuron { id: [] | [NeuronId]; known_neuron_data: [] | [KnownNeuronData]; @@ -517,13 +525,17 @@ export interface NeuronsFundMatchedFundingCurveCoefficients { full_participation_milestone_xdr: [] | [Decimal]; } export interface NeuronsFundNeuron { + controller: [] | [Principal]; hotkey_principal: [] | [string]; + hotkeys: [] | [Principals]; is_capped: [] | [boolean]; nns_neuron_id: [] | [bigint]; amount_icp_e8s: [] | [bigint]; } export interface NeuronsFundNeuronPortion { + controller: [] | [Principal]; hotkey_principal: [] | [Principal]; + hotkeys: Array; is_capped: [] | [boolean]; maturity_equivalent_icp_e8s: [] | [bigint]; nns_neuron_id: [] | [NeuronId]; @@ -587,6 +599,9 @@ export interface Params { export interface Percentage { basis_points: [] | [bigint]; } +export interface Principals { + principals: Array; +} export type Progress = { LastNeuronId: NeuronId }; export interface Proposal { url: string; diff --git a/packages/nns/candid/governance.did b/packages/nns/candid/governance.did index ebf59ac3..61f7b65a 100644 --- a/packages/nns/candid/governance.did +++ b/packages/nns/candid/governance.did @@ -1,8 +1,9 @@ -// Generated from IC repo commit a3831c8 (2024-07-11 tags: release-2024-07-10_23-01-base) 'rs/nns/governance/canister/governance.did' by import-candid +// Generated from IC repo commit de29a1a55b (2024-07-18 tags: release-2024-07-18_01-30--github-base) 'rs/nns/governance/canister/governance.did' by import-candid type AccountIdentifier = record { hash : blob }; type Action = variant { RegisterKnownNeuron : KnownNeuron; ManageNeuron : ManageNeuron; + InstallCode : InstallCode; CreateServiceNervousSystem : CreateServiceNervousSystem; ExecuteNnsFunction : ExecuteNnsFunction; RewardNodeProvider : RewardNodeProvider; @@ -11,7 +12,7 @@ type Action = variant { SetDefaultFollowees : SetDefaultFollowees; RewardNodeProviders : RewardNodeProviders; ManageNetworkEconomics : NetworkEconomics; - ApproveGenesisKyc : ApproveGenesisKyc; + ApproveGenesisKyc : Principals; AddOrRemoveNodeProvider : AddOrRemoveNodeProvider; Motion : Motion; }; @@ -251,6 +252,13 @@ type InitialTokenDistribution = record { developer_distribution : opt DeveloperDistribution; swap_distribution : opt SwapDistribution; }; +type InstallCode = record { + arg : opt blob; + wasm_module : opt blob; + skip_stopping_before_installing : opt bool; + canister_id : opt principal; + install_mode : opt int32; +}; type KnownNeuron = record { id : opt NeuronId; known_neuron_data : opt KnownNeuronData; @@ -440,13 +448,17 @@ type NeuronsFundMatchedFundingCurveCoefficients = record { full_participation_milestone_xdr : opt Decimal; }; type NeuronsFundNeuron = record { + controller : opt principal; hotkey_principal : opt text; + hotkeys : opt Principals; is_capped : opt bool; nns_neuron_id : opt nat64; amount_icp_e8s : opt nat64; }; type NeuronsFundNeuronPortion = record { + controller : opt principal; hotkey_principal : opt principal; + hotkeys : vec principal; is_capped : opt bool; maturity_equivalent_icp_e8s : opt nat64; nns_neuron_id : opt NeuronId; @@ -501,6 +513,7 @@ type Params = record { max_direct_participation_icp_e8s : opt nat64; }; type Percentage = record { basis_points : opt nat64 }; +type Principals = record { principals : vec principal }; type Progress = variant { LastNeuronId : NeuronId }; type Proposal = record { url : text; diff --git a/packages/nns/candid/governance.idl.js b/packages/nns/candid/governance.idl.js index ca43eeb3..a7a31912 100644 --- a/packages/nns/candid/governance.idl.js +++ b/packages/nns/candid/governance.idl.js @@ -101,6 +101,13 @@ export const idlFactory = ({ IDL }) => { 'command' : IDL.Opt(Command), 'neuron_id_or_subaccount' : IDL.Opt(NeuronIdOrSubaccount), }); + const InstallCode = IDL.Record({ + 'arg' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'wasm_module' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'skip_stopping_before_installing' : IDL.Opt(IDL.Bool), + 'canister_id' : IDL.Opt(IDL.Principal), + 'install_mode' : IDL.Opt(IDL.Int32), + }); const Percentage = IDL.Record({ 'basis_points' : IDL.Opt(IDL.Nat64) }); const Duration = IDL.Record({ 'seconds' : IDL.Opt(IDL.Nat64) }); const Tokens = IDL.Record({ 'e8s' : IDL.Opt(IDL.Nat64) }); @@ -271,9 +278,7 @@ export const idlFactory = ({ IDL }) => { 'maximum_node_provider_rewards_e8s' : IDL.Nat64, 'neurons_fund_economics' : IDL.Opt(NeuronsFundEconomics), }); - const ApproveGenesisKyc = IDL.Record({ - 'principals' : IDL.Vec(IDL.Principal), - }); + const Principals = IDL.Record({ 'principals' : IDL.Vec(IDL.Principal) }); const Change = IDL.Variant({ 'ToRemove' : NodeProvider, 'ToAdd' : NodeProvider, @@ -283,6 +288,7 @@ export const idlFactory = ({ IDL }) => { const Action = IDL.Variant({ 'RegisterKnownNeuron' : KnownNeuron, 'ManageNeuron' : ManageNeuron, + 'InstallCode' : InstallCode, 'CreateServiceNervousSystem' : CreateServiceNervousSystem, 'ExecuteNnsFunction' : ExecuteNnsFunction, 'RewardNodeProvider' : RewardNodeProvider, @@ -291,7 +297,7 @@ export const idlFactory = ({ IDL }) => { 'SetDefaultFollowees' : SetDefaultFollowees, 'RewardNodeProviders' : RewardNodeProviders, 'ManageNetworkEconomics' : NetworkEconomics, - 'ApproveGenesisKyc' : ApproveGenesisKyc, + 'ApproveGenesisKyc' : Principals, 'AddOrRemoveNodeProvider' : AddOrRemoveNodeProvider, 'Motion' : Motion, }); @@ -464,7 +470,9 @@ export const idlFactory = ({ IDL }) => { 'max_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundNeuronPortion = IDL.Record({ + 'controller' : IDL.Opt(IDL.Principal), 'hotkey_principal' : IDL.Opt(IDL.Principal), + 'hotkeys' : IDL.Vec(IDL.Principal), 'is_capped' : IDL.Opt(IDL.Bool), 'maturity_equivalent_icp_e8s' : IDL.Opt(IDL.Nat64), 'nns_neuron_id' : IDL.Opt(NeuronId), @@ -786,7 +794,9 @@ export const idlFactory = ({ IDL }) => { 'nns_proposal_id' : IDL.Opt(IDL.Nat64), }); const NeuronsFundNeuron = IDL.Record({ + 'controller' : IDL.Opt(IDL.Principal), 'hotkey_principal' : IDL.Opt(IDL.Text), + 'hotkeys' : IDL.Opt(Principals), 'is_capped' : IDL.Opt(IDL.Bool), 'nns_neuron_id' : IDL.Opt(IDL.Nat64), 'amount_icp_e8s' : IDL.Opt(IDL.Nat64), @@ -990,6 +1000,13 @@ export const init = ({ IDL }) => { 'command' : IDL.Opt(Command), 'neuron_id_or_subaccount' : IDL.Opt(NeuronIdOrSubaccount), }); + const InstallCode = IDL.Record({ + 'arg' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'wasm_module' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'skip_stopping_before_installing' : IDL.Opt(IDL.Bool), + 'canister_id' : IDL.Opt(IDL.Principal), + 'install_mode' : IDL.Opt(IDL.Int32), + }); const Percentage = IDL.Record({ 'basis_points' : IDL.Opt(IDL.Nat64) }); const Duration = IDL.Record({ 'seconds' : IDL.Opt(IDL.Nat64) }); const Tokens = IDL.Record({ 'e8s' : IDL.Opt(IDL.Nat64) }); @@ -1160,9 +1177,7 @@ export const init = ({ IDL }) => { 'maximum_node_provider_rewards_e8s' : IDL.Nat64, 'neurons_fund_economics' : IDL.Opt(NeuronsFundEconomics), }); - const ApproveGenesisKyc = IDL.Record({ - 'principals' : IDL.Vec(IDL.Principal), - }); + const Principals = IDL.Record({ 'principals' : IDL.Vec(IDL.Principal) }); const Change = IDL.Variant({ 'ToRemove' : NodeProvider, 'ToAdd' : NodeProvider, @@ -1172,6 +1187,7 @@ export const init = ({ IDL }) => { const Action = IDL.Variant({ 'RegisterKnownNeuron' : KnownNeuron, 'ManageNeuron' : ManageNeuron, + 'InstallCode' : InstallCode, 'CreateServiceNervousSystem' : CreateServiceNervousSystem, 'ExecuteNnsFunction' : ExecuteNnsFunction, 'RewardNodeProvider' : RewardNodeProvider, @@ -1180,7 +1196,7 @@ export const init = ({ IDL }) => { 'SetDefaultFollowees' : SetDefaultFollowees, 'RewardNodeProviders' : RewardNodeProviders, 'ManageNetworkEconomics' : NetworkEconomics, - 'ApproveGenesisKyc' : ApproveGenesisKyc, + 'ApproveGenesisKyc' : Principals, 'AddOrRemoveNodeProvider' : AddOrRemoveNodeProvider, 'Motion' : Motion, }); @@ -1353,7 +1369,9 @@ export const init = ({ IDL }) => { 'max_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundNeuronPortion = IDL.Record({ + 'controller' : IDL.Opt(IDL.Principal), 'hotkey_principal' : IDL.Opt(IDL.Principal), + 'hotkeys' : IDL.Vec(IDL.Principal), 'is_capped' : IDL.Opt(IDL.Bool), 'maturity_equivalent_icp_e8s' : IDL.Opt(IDL.Nat64), 'nns_neuron_id' : IDL.Opt(NeuronId), diff --git a/packages/nns/candid/governance_test.certified.idl.js b/packages/nns/candid/governance_test.certified.idl.js index 7791de1b..c56bafed 100644 --- a/packages/nns/candid/governance_test.certified.idl.js +++ b/packages/nns/candid/governance_test.certified.idl.js @@ -101,6 +101,13 @@ export const idlFactory = ({ IDL }) => { 'command' : IDL.Opt(Command), 'neuron_id_or_subaccount' : IDL.Opt(NeuronIdOrSubaccount), }); + const InstallCode = IDL.Record({ + 'arg' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'wasm_module' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'skip_stopping_before_installing' : IDL.Opt(IDL.Bool), + 'canister_id' : IDL.Opt(IDL.Principal), + 'install_mode' : IDL.Opt(IDL.Int32), + }); const Percentage = IDL.Record({ 'basis_points' : IDL.Opt(IDL.Nat64) }); const Duration = IDL.Record({ 'seconds' : IDL.Opt(IDL.Nat64) }); const Tokens = IDL.Record({ 'e8s' : IDL.Opt(IDL.Nat64) }); @@ -271,9 +278,7 @@ export const idlFactory = ({ IDL }) => { 'maximum_node_provider_rewards_e8s' : IDL.Nat64, 'neurons_fund_economics' : IDL.Opt(NeuronsFundEconomics), }); - const ApproveGenesisKyc = IDL.Record({ - 'principals' : IDL.Vec(IDL.Principal), - }); + const Principals = IDL.Record({ 'principals' : IDL.Vec(IDL.Principal) }); const Change = IDL.Variant({ 'ToRemove' : NodeProvider, 'ToAdd' : NodeProvider, @@ -283,6 +288,7 @@ export const idlFactory = ({ IDL }) => { const Action = IDL.Variant({ 'RegisterKnownNeuron' : KnownNeuron, 'ManageNeuron' : ManageNeuron, + 'InstallCode' : InstallCode, 'CreateServiceNervousSystem' : CreateServiceNervousSystem, 'ExecuteNnsFunction' : ExecuteNnsFunction, 'RewardNodeProvider' : RewardNodeProvider, @@ -291,7 +297,7 @@ export const idlFactory = ({ IDL }) => { 'SetDefaultFollowees' : SetDefaultFollowees, 'RewardNodeProviders' : RewardNodeProviders, 'ManageNetworkEconomics' : NetworkEconomics, - 'ApproveGenesisKyc' : ApproveGenesisKyc, + 'ApproveGenesisKyc' : Principals, 'AddOrRemoveNodeProvider' : AddOrRemoveNodeProvider, 'Motion' : Motion, }); @@ -464,7 +470,9 @@ export const idlFactory = ({ IDL }) => { 'max_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundNeuronPortion = IDL.Record({ + 'controller' : IDL.Opt(IDL.Principal), 'hotkey_principal' : IDL.Opt(IDL.Principal), + 'hotkeys' : IDL.Vec(IDL.Principal), 'is_capped' : IDL.Opt(IDL.Bool), 'maturity_equivalent_icp_e8s' : IDL.Opt(IDL.Nat64), 'nns_neuron_id' : IDL.Opt(NeuronId), @@ -786,7 +794,9 @@ export const idlFactory = ({ IDL }) => { 'nns_proposal_id' : IDL.Opt(IDL.Nat64), }); const NeuronsFundNeuron = IDL.Record({ + 'controller' : IDL.Opt(IDL.Principal), 'hotkey_principal' : IDL.Opt(IDL.Text), + 'hotkeys' : IDL.Opt(Principals), 'is_capped' : IDL.Opt(IDL.Bool), 'nns_neuron_id' : IDL.Opt(IDL.Nat64), 'amount_icp_e8s' : IDL.Opt(IDL.Nat64), @@ -975,6 +985,13 @@ export const init = ({ IDL }) => { 'command' : IDL.Opt(Command), 'neuron_id_or_subaccount' : IDL.Opt(NeuronIdOrSubaccount), }); + const InstallCode = IDL.Record({ + 'arg' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'wasm_module' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'skip_stopping_before_installing' : IDL.Opt(IDL.Bool), + 'canister_id' : IDL.Opt(IDL.Principal), + 'install_mode' : IDL.Opt(IDL.Int32), + }); const Percentage = IDL.Record({ 'basis_points' : IDL.Opt(IDL.Nat64) }); const Duration = IDL.Record({ 'seconds' : IDL.Opt(IDL.Nat64) }); const Tokens = IDL.Record({ 'e8s' : IDL.Opt(IDL.Nat64) }); @@ -1145,9 +1162,7 @@ export const init = ({ IDL }) => { 'maximum_node_provider_rewards_e8s' : IDL.Nat64, 'neurons_fund_economics' : IDL.Opt(NeuronsFundEconomics), }); - const ApproveGenesisKyc = IDL.Record({ - 'principals' : IDL.Vec(IDL.Principal), - }); + const Principals = IDL.Record({ 'principals' : IDL.Vec(IDL.Principal) }); const Change = IDL.Variant({ 'ToRemove' : NodeProvider, 'ToAdd' : NodeProvider, @@ -1157,6 +1172,7 @@ export const init = ({ IDL }) => { const Action = IDL.Variant({ 'RegisterKnownNeuron' : KnownNeuron, 'ManageNeuron' : ManageNeuron, + 'InstallCode' : InstallCode, 'CreateServiceNervousSystem' : CreateServiceNervousSystem, 'ExecuteNnsFunction' : ExecuteNnsFunction, 'RewardNodeProvider' : RewardNodeProvider, @@ -1165,7 +1181,7 @@ export const init = ({ IDL }) => { 'SetDefaultFollowees' : SetDefaultFollowees, 'RewardNodeProviders' : RewardNodeProviders, 'ManageNetworkEconomics' : NetworkEconomics, - 'ApproveGenesisKyc' : ApproveGenesisKyc, + 'ApproveGenesisKyc' : Principals, 'AddOrRemoveNodeProvider' : AddOrRemoveNodeProvider, 'Motion' : Motion, }); @@ -1338,7 +1354,9 @@ export const init = ({ IDL }) => { 'max_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundNeuronPortion = IDL.Record({ + 'controller' : IDL.Opt(IDL.Principal), 'hotkey_principal' : IDL.Opt(IDL.Principal), + 'hotkeys' : IDL.Vec(IDL.Principal), 'is_capped' : IDL.Opt(IDL.Bool), 'maturity_equivalent_icp_e8s' : IDL.Opt(IDL.Nat64), 'nns_neuron_id' : IDL.Opt(NeuronId), diff --git a/packages/nns/candid/governance_test.d.ts b/packages/nns/candid/governance_test.d.ts index 3688e4c7..b1c75574 100644 --- a/packages/nns/candid/governance_test.d.ts +++ b/packages/nns/candid/governance_test.d.ts @@ -8,6 +8,7 @@ export interface AccountIdentifier { export type Action = | { RegisterKnownNeuron: KnownNeuron } | { ManageNeuron: ManageNeuron } + | { InstallCode: InstallCode } | { CreateServiceNervousSystem: CreateServiceNervousSystem } | { ExecuteNnsFunction: ExecuteNnsFunction } | { RewardNodeProvider: RewardNodeProvider } @@ -16,7 +17,7 @@ export type Action = | { SetDefaultFollowees: SetDefaultFollowees } | { RewardNodeProviders: RewardNodeProviders } | { ManageNetworkEconomics: NetworkEconomics } - | { ApproveGenesisKyc: ApproveGenesisKyc } + | { ApproveGenesisKyc: Principals } | { AddOrRemoveNodeProvider: AddOrRemoveNodeProvider } | { Motion: Motion }; export interface AddHotKey { @@ -305,6 +306,13 @@ export interface InitialTokenDistribution { developer_distribution: [] | [DeveloperDistribution]; swap_distribution: [] | [SwapDistribution]; } +export interface InstallCode { + arg: [] | [Uint8Array | number[]]; + wasm_module: [] | [Uint8Array | number[]]; + skip_stopping_before_installing: [] | [boolean]; + canister_id: [] | [Principal]; + install_mode: [] | [number]; +} export interface KnownNeuron { id: [] | [NeuronId]; known_neuron_data: [] | [KnownNeuronData]; @@ -517,13 +525,17 @@ export interface NeuronsFundMatchedFundingCurveCoefficients { full_participation_milestone_xdr: [] | [Decimal]; } export interface NeuronsFundNeuron { + controller: [] | [Principal]; hotkey_principal: [] | [string]; + hotkeys: [] | [Principals]; is_capped: [] | [boolean]; nns_neuron_id: [] | [bigint]; amount_icp_e8s: [] | [bigint]; } export interface NeuronsFundNeuronPortion { + controller: [] | [Principal]; hotkey_principal: [] | [Principal]; + hotkeys: Array; is_capped: [] | [boolean]; maturity_equivalent_icp_e8s: [] | [bigint]; nns_neuron_id: [] | [NeuronId]; @@ -587,6 +599,9 @@ export interface Params { export interface Percentage { basis_points: [] | [bigint]; } +export interface Principals { + principals: Array; +} export type Progress = { LastNeuronId: NeuronId }; export interface Proposal { url: string; diff --git a/packages/nns/candid/governance_test.did b/packages/nns/candid/governance_test.did index 38224435..f4e0e0b3 100644 --- a/packages/nns/candid/governance_test.did +++ b/packages/nns/candid/governance_test.did @@ -1,8 +1,9 @@ -// Generated from IC repo commit a3831c8 (2024-07-11 tags: release-2024-07-10_23-01-base) 'rs/nns/governance/canister/governance_test.did' by import-candid +// Generated from IC repo commit de29a1a55b (2024-07-18 tags: release-2024-07-18_01-30--github-base) 'rs/nns/governance/canister/governance_test.did' by import-candid type AccountIdentifier = record { hash : blob }; type Action = variant { RegisterKnownNeuron : KnownNeuron; ManageNeuron : ManageNeuron; + InstallCode : InstallCode; CreateServiceNervousSystem : CreateServiceNervousSystem; ExecuteNnsFunction : ExecuteNnsFunction; RewardNodeProvider : RewardNodeProvider; @@ -11,7 +12,7 @@ type Action = variant { SetDefaultFollowees : SetDefaultFollowees; RewardNodeProviders : RewardNodeProviders; ManageNetworkEconomics : NetworkEconomics; - ApproveGenesisKyc : ApproveGenesisKyc; + ApproveGenesisKyc : Principals; AddOrRemoveNodeProvider : AddOrRemoveNodeProvider; Motion : Motion; }; @@ -251,6 +252,13 @@ type InitialTokenDistribution = record { developer_distribution : opt DeveloperDistribution; swap_distribution : opt SwapDistribution; }; +type InstallCode = record { + arg : opt blob; + wasm_module : opt blob; + skip_stopping_before_installing : opt bool; + canister_id : opt principal; + install_mode : opt int32; +}; type KnownNeuron = record { id : opt NeuronId; known_neuron_data : opt KnownNeuronData; @@ -440,13 +448,17 @@ type NeuronsFundMatchedFundingCurveCoefficients = record { full_participation_milestone_xdr : opt Decimal; }; type NeuronsFundNeuron = record { + controller : opt principal; hotkey_principal : opt text; + hotkeys : opt Principals; is_capped : opt bool; nns_neuron_id : opt nat64; amount_icp_e8s : opt nat64; }; type NeuronsFundNeuronPortion = record { + controller : opt principal; hotkey_principal : opt principal; + hotkeys : vec principal; is_capped : opt bool; maturity_equivalent_icp_e8s : opt nat64; nns_neuron_id : opt NeuronId; @@ -501,6 +513,7 @@ type Params = record { max_direct_participation_icp_e8s : opt nat64; }; type Percentage = record { basis_points : opt nat64 }; +type Principals = record { principals : vec principal }; type Progress = variant { LastNeuronId : NeuronId }; type Proposal = record { url : text; diff --git a/packages/nns/candid/governance_test.idl.js b/packages/nns/candid/governance_test.idl.js index 902ab9c1..40d381d5 100644 --- a/packages/nns/candid/governance_test.idl.js +++ b/packages/nns/candid/governance_test.idl.js @@ -101,6 +101,13 @@ export const idlFactory = ({ IDL }) => { 'command' : IDL.Opt(Command), 'neuron_id_or_subaccount' : IDL.Opt(NeuronIdOrSubaccount), }); + const InstallCode = IDL.Record({ + 'arg' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'wasm_module' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'skip_stopping_before_installing' : IDL.Opt(IDL.Bool), + 'canister_id' : IDL.Opt(IDL.Principal), + 'install_mode' : IDL.Opt(IDL.Int32), + }); const Percentage = IDL.Record({ 'basis_points' : IDL.Opt(IDL.Nat64) }); const Duration = IDL.Record({ 'seconds' : IDL.Opt(IDL.Nat64) }); const Tokens = IDL.Record({ 'e8s' : IDL.Opt(IDL.Nat64) }); @@ -271,9 +278,7 @@ export const idlFactory = ({ IDL }) => { 'maximum_node_provider_rewards_e8s' : IDL.Nat64, 'neurons_fund_economics' : IDL.Opt(NeuronsFundEconomics), }); - const ApproveGenesisKyc = IDL.Record({ - 'principals' : IDL.Vec(IDL.Principal), - }); + const Principals = IDL.Record({ 'principals' : IDL.Vec(IDL.Principal) }); const Change = IDL.Variant({ 'ToRemove' : NodeProvider, 'ToAdd' : NodeProvider, @@ -283,6 +288,7 @@ export const idlFactory = ({ IDL }) => { const Action = IDL.Variant({ 'RegisterKnownNeuron' : KnownNeuron, 'ManageNeuron' : ManageNeuron, + 'InstallCode' : InstallCode, 'CreateServiceNervousSystem' : CreateServiceNervousSystem, 'ExecuteNnsFunction' : ExecuteNnsFunction, 'RewardNodeProvider' : RewardNodeProvider, @@ -291,7 +297,7 @@ export const idlFactory = ({ IDL }) => { 'SetDefaultFollowees' : SetDefaultFollowees, 'RewardNodeProviders' : RewardNodeProviders, 'ManageNetworkEconomics' : NetworkEconomics, - 'ApproveGenesisKyc' : ApproveGenesisKyc, + 'ApproveGenesisKyc' : Principals, 'AddOrRemoveNodeProvider' : AddOrRemoveNodeProvider, 'Motion' : Motion, }); @@ -464,7 +470,9 @@ export const idlFactory = ({ IDL }) => { 'max_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundNeuronPortion = IDL.Record({ + 'controller' : IDL.Opt(IDL.Principal), 'hotkey_principal' : IDL.Opt(IDL.Principal), + 'hotkeys' : IDL.Vec(IDL.Principal), 'is_capped' : IDL.Opt(IDL.Bool), 'maturity_equivalent_icp_e8s' : IDL.Opt(IDL.Nat64), 'nns_neuron_id' : IDL.Opt(NeuronId), @@ -786,7 +794,9 @@ export const idlFactory = ({ IDL }) => { 'nns_proposal_id' : IDL.Opt(IDL.Nat64), }); const NeuronsFundNeuron = IDL.Record({ + 'controller' : IDL.Opt(IDL.Principal), 'hotkey_principal' : IDL.Opt(IDL.Text), + 'hotkeys' : IDL.Opt(Principals), 'is_capped' : IDL.Opt(IDL.Bool), 'nns_neuron_id' : IDL.Opt(IDL.Nat64), 'amount_icp_e8s' : IDL.Opt(IDL.Nat64), @@ -991,6 +1001,13 @@ export const init = ({ IDL }) => { 'command' : IDL.Opt(Command), 'neuron_id_or_subaccount' : IDL.Opt(NeuronIdOrSubaccount), }); + const InstallCode = IDL.Record({ + 'arg' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'wasm_module' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'skip_stopping_before_installing' : IDL.Opt(IDL.Bool), + 'canister_id' : IDL.Opt(IDL.Principal), + 'install_mode' : IDL.Opt(IDL.Int32), + }); const Percentage = IDL.Record({ 'basis_points' : IDL.Opt(IDL.Nat64) }); const Duration = IDL.Record({ 'seconds' : IDL.Opt(IDL.Nat64) }); const Tokens = IDL.Record({ 'e8s' : IDL.Opt(IDL.Nat64) }); @@ -1161,9 +1178,7 @@ export const init = ({ IDL }) => { 'maximum_node_provider_rewards_e8s' : IDL.Nat64, 'neurons_fund_economics' : IDL.Opt(NeuronsFundEconomics), }); - const ApproveGenesisKyc = IDL.Record({ - 'principals' : IDL.Vec(IDL.Principal), - }); + const Principals = IDL.Record({ 'principals' : IDL.Vec(IDL.Principal) }); const Change = IDL.Variant({ 'ToRemove' : NodeProvider, 'ToAdd' : NodeProvider, @@ -1173,6 +1188,7 @@ export const init = ({ IDL }) => { const Action = IDL.Variant({ 'RegisterKnownNeuron' : KnownNeuron, 'ManageNeuron' : ManageNeuron, + 'InstallCode' : InstallCode, 'CreateServiceNervousSystem' : CreateServiceNervousSystem, 'ExecuteNnsFunction' : ExecuteNnsFunction, 'RewardNodeProvider' : RewardNodeProvider, @@ -1181,7 +1197,7 @@ export const init = ({ IDL }) => { 'SetDefaultFollowees' : SetDefaultFollowees, 'RewardNodeProviders' : RewardNodeProviders, 'ManageNetworkEconomics' : NetworkEconomics, - 'ApproveGenesisKyc' : ApproveGenesisKyc, + 'ApproveGenesisKyc' : Principals, 'AddOrRemoveNodeProvider' : AddOrRemoveNodeProvider, 'Motion' : Motion, }); @@ -1354,7 +1370,9 @@ export const init = ({ IDL }) => { 'max_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundNeuronPortion = IDL.Record({ + 'controller' : IDL.Opt(IDL.Principal), 'hotkey_principal' : IDL.Opt(IDL.Principal), + 'hotkeys' : IDL.Vec(IDL.Principal), 'is_capped' : IDL.Opt(IDL.Bool), 'maturity_equivalent_icp_e8s' : IDL.Opt(IDL.Nat64), 'nns_neuron_id' : IDL.Opt(NeuronId), diff --git a/packages/nns/candid/sns_wasm.did b/packages/nns/candid/sns_wasm.did index ac8a86c6..07afd040 100644 --- a/packages/nns/candid/sns_wasm.did +++ b/packages/nns/candid/sns_wasm.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit a3831c8 (2024-07-11 tags: release-2024-07-10_23-01-base) 'rs/nns/sns-wasm/canister/sns-wasm.did' by import-candid +// Generated from IC repo commit de29a1a55b (2024-07-18 tags: release-2024-07-18_01-30--github-base) 'rs/nns/sns-wasm/canister/sns-wasm.did' by import-candid type AddWasmRequest = record { hash : blob; wasm : opt SnsWasm }; type AddWasmResponse = record { result : opt Result }; type AirdropDistribution = record { airdrop_neurons : vec NeuronDistribution }; diff --git a/packages/nns/src/canisters/governance/request.converters.spec.ts b/packages/nns/src/canisters/governance/request.converters.spec.ts index 514a991e..f66210ae 100644 --- a/packages/nns/src/canisters/governance/request.converters.spec.ts +++ b/packages/nns/src/canisters/governance/request.converters.spec.ts @@ -1,7 +1,10 @@ import { Principal } from "@dfinity/principal"; import { arrayBufferToUint8Array, toNullable } from "@dfinity/utils"; import type { ManageNeuron as RawManageNeuron } from "../../../candid/governance"; -import { GovernanceParameters } from "../../types/governance_converters"; +import { + GovernanceParameters, + InstallMode, +} from "../../types/governance_converters"; import { toMakeProposalRawRequest } from "./request.converters"; describe("request.converters", () => { @@ -505,5 +508,61 @@ describe("request.converters", () => { const result = toMakeProposalRawRequest(mockRequest); expect(result).toEqual(expectedOutput); }); + + it("InstallCode", () => { + const principalId = + "xlmdg-vkosz-ceopx-7wtgu-g3xmd-koiyc-awqaq-7modz-zf6r6-364rh-oqe"; + const summary = "Proposal summary"; + + const mockRequest = { + url, + title, + summary, + action: { + InstallCode: { + arg: Uint8Array.from([1, 2, 3]), + wasmModule: Uint8Array.from([4, 5, 6]), + skipStoppingBeforeInstalling: true, + canisterId: "miw6j-knlcl-xq", + installMode: InstallMode.Reinstall, + }, + }, + neuronId, + }; + + const expectedOutput: RawManageNeuron = { + id: [], + command: [ + { + MakeProposal: { + url, + title: toNullable(title), + summary, + action: [ + { + InstallCode: { + arg: [Uint8Array.from([1, 2, 3])], + wasm_module: [Uint8Array.from([4, 5, 6])], + skip_stopping_before_installing: [true], + canister_id: [Principal.fromText("miw6j-knlcl-xq")], + install_mode: [2], + }, + }, + ], + }, + }, + ], + neuron_id_or_subaccount: [ + { + NeuronId: { + id: neuronId, + }, + }, + ], + }; + + const result = toMakeProposalRawRequest(mockRequest); + expect(result).toEqual(expectedOutput); + }); }); }); diff --git a/packages/nns/src/canisters/governance/request.converters.ts b/packages/nns/src/canisters/governance/request.converters.ts index f6f0db52..27791138 100644 --- a/packages/nns/src/canisters/governance/request.converters.ts +++ b/packages/nns/src/canisters/governance/request.converters.ts @@ -4,7 +4,12 @@ import type { } from "@dfinity/ledger-icp"; import { accountIdentifierToBytes } from "@dfinity/ledger-icp"; import { Principal } from "@dfinity/principal"; -import { arrayBufferToUint8Array, isNullish, toNullable } from "@dfinity/utils"; +import { + arrayBufferToUint8Array, + isNullish, + nonNullish, + toNullable, +} from "@dfinity/utils"; import type { Amount, ListProposalInfo, @@ -23,6 +28,7 @@ import type { GovernanceParameters as RawGovernanceParameters, Image as RawImage, InitialTokenDistribution as RawInitialTokenDistribution, + InstallCode as RawInstallCode, LedgerParameters as RawLedgerParameters, ListNeurons as RawListNeurons, ManageNeuron as RawManageNeuron, @@ -61,6 +67,7 @@ import type { GovernanceParameters, Image, InitialTokenDistribution, + InstallCode, LedgerParameters, ListProposalsRequest, MakeProposalRequest, @@ -80,6 +87,7 @@ import type { Tokens, VotingRewardParameters, } from "../../types/governance_converters"; +import { InstallMode } from "../../types/governance_converters"; const fromProposalId = (proposalId: ProposalId): RawNeuronId => ({ id: proposalId, @@ -414,6 +422,38 @@ const fromCreateServiceNervousSystem = ( : [], }); +const fromInstallMode = (installMode: Option): Option => { + if (isNullish(installMode)) { + return undefined; + } + switch (installMode) { + case InstallMode.Unspecified: + return 0; + case InstallMode.Install: + return 1; + case InstallMode.Reinstall: + return 2; + case InstallMode.Upgrade: + return 3; + default: + return 0; + } +}; + +const fromInstallCode = (installCode: InstallCode): RawInstallCode => ({ + arg: toNullable(installCode.arg), + wasm_module: toNullable(installCode.wasmModule), + skip_stopping_before_installing: toNullable( + installCode.skipStoppingBeforeInstalling, + ), + canister_id: toNullable( + nonNullish(installCode.canisterId) + ? Principal.fromText(installCode.canisterId) + : undefined, + ), + install_mode: toNullable(fromInstallMode(installCode.installMode)), +}); + const fromAction = (action: Action): RawAction => { if ("ExecuteNnsFunction" in action) { const executeNnsFunction = action.ExecuteNnsFunction; @@ -624,6 +664,12 @@ const fromAction = (action: Action): RawAction => { }; } + if ("InstallCode" in action) { + return { + InstallCode: fromInstallCode(action.InstallCode), + }; + } + // If there's a missing action, this line will cause a compiler error. throw new UnsupportedValueError(action); }; diff --git a/packages/nns/src/canisters/governance/response.converters.ts b/packages/nns/src/canisters/governance/response.converters.ts index 6de3effc..6420f667 100644 --- a/packages/nns/src/canisters/governance/response.converters.ts +++ b/packages/nns/src/canisters/governance/response.converters.ts @@ -104,6 +104,7 @@ import type { Tokens, VotingRewardParameters, } from "../../types/governance_converters"; +import { InstallMode } from "../../types/governance_converters"; export const toNeuronInfo = ({ neuronId, @@ -525,9 +526,48 @@ const toAction = (action: RawAction): Action => { }; } + if ("InstallCode" in action) { + const installCode = action.InstallCode; + return { + InstallCode: { + arg: installCode.arg.length + ? Uint8Array.from(fromDefinedNullable(installCode.arg)) + : undefined, + wasmModule: installCode.wasm_module.length + ? Uint8Array.from(fromDefinedNullable(installCode.wasm_module)) + : undefined, + skipStoppingBeforeInstalling: fromNullable( + installCode.skip_stopping_before_installing, + ), + canisterId: installCode.canister_id.length + ? installCode.canister_id[0].toString() + : undefined, + installMode: toInstallMode(fromNullable(installCode.install_mode)), + }, + }; + } + throw new UnsupportedValueError(action); }; +const toInstallMode = (installMode: Option): Option => { + if (isNullish(installMode)) { + return undefined; + } + switch (installMode) { + case 0: + return InstallMode.Unspecified; + case 1: + return InstallMode.Install; + case 2: + return InstallMode.Reinstall; + case 3: + return InstallMode.Upgrade; + default: + return InstallMode.Unspecified; + } +}; + const toTally = (tally: RawTally): Tally => { return { no: tally.no, diff --git a/packages/nns/src/governance.canister.spec.ts b/packages/nns/src/governance.canister.spec.ts index 8a452b69..65a2df0f 100644 --- a/packages/nns/src/governance.canister.spec.ts +++ b/packages/nns/src/governance.canister.spec.ts @@ -10,6 +10,7 @@ import { ListKnownNeuronsResponse, ManageNeuronResponse, NeuronsFundEconomics, + InstallCode as RawInstallCode, ProposalInfo as RawProposalInfo, Result, RewardEvent, @@ -29,6 +30,8 @@ import { } from "./mocks/governance.mock"; import { Action, + InstallCode, + InstallMode, MakeProposalRequest, NetworkEconomics, } from "./types/governance_converters"; @@ -806,6 +809,67 @@ describe("GovernanceCanister", () => { mockManageNetworkEconomicsAction.ManageNetworkEconomics, ); }); + + it("should fetch and convert InstallCode on ProposalInfo", async () => { + const service = mock>(); + const governance = GovernanceCanister.create({ + certifiedServiceOverride: service, + serviceOverride: service, + }); + + const rawInstallCode: RawInstallCode = { + arg: [Uint8Array.from([1, 2, 3])], + wasm_module: [Uint8Array.from([4, 5, 6])], + skip_stopping_before_installing: [true], + canister_id: [Principal.fromText("miw6j-knlcl-xq")], + install_mode: [3], + }; + + const expectedInstallCode: InstallCode = { + arg: Uint8Array.from([1, 2, 3]), + wasmModule: Uint8Array.from([4, 5, 6]), + skipStoppingBeforeInstalling: true, + canisterId: "miw6j-knlcl-xq", + installMode: InstallMode.Upgrade, + }; + + const rawProposal = { + id: [{ id: 1n }], + ballots: [], + proposal: [ + { + title: ["This is a title"], + url: "some-url", + summary: "Here it goes the summary", + action: [ + { + InstallCode: rawInstallCode, + }, + ], + }, + ], + proposer: [], + latest_tally: [], + } as unknown as RawProposalInfo; + service.get_proposal_info.mockResolvedValue( + Promise.resolve([rawProposal]), + ); + const proposalId = 5467n; + const response = await governance.getProposal({ + proposalId, + }); + + expect(service.get_proposal_info).toBeCalledWith(proposalId); + expect(service.get_proposal_info).toBeCalledTimes(1); + expect(response).not.toBeUndefined(); + expect(response).toHaveProperty("id", 1n); + + const { InstallCode } = response?.proposal?.action as { + InstallCode: InstallCode; + }; + + expect(InstallCode).toEqual(expectedInstallCode); + }); }); describe("GovernanceCanister.claimOrRefreshNeuronFromAccount", () => { diff --git a/packages/nns/src/types/governance_converters.ts b/packages/nns/src/types/governance_converters.ts index f450a05e..cbb2160b 100644 --- a/packages/nns/src/types/governance_converters.ts +++ b/packages/nns/src/types/governance_converters.ts @@ -24,6 +24,7 @@ export type Action = } | { CreateServiceNervousSystem: CreateServiceNervousSystem } | { ManageNeuron: ManageNeuron } + | { InstallCode: InstallCode } | { ApproveGenesisKyc: ApproveGenesisKyc } | { ManageNetworkEconomics: NetworkEconomics } | { RewardNodeProvider: RewardNodeProvider } @@ -183,6 +184,19 @@ export interface ManageNeuron { command: Option; neuronIdOrSubaccount: Option; } +export enum InstallMode { + Unspecified, + Install, + Reinstall, + Upgrade, +} +export interface InstallCode { + arg: Option; + wasmModule: Option; + skipStoppingBeforeInstalling: Option; + canisterId: Option; + installMode: Option; +} export interface Merge { sourceNeuronId: Option; }