Skip to content

Commit

Permalink
Update nns-js Candid Files
Browse files Browse the repository at this point in the history
  • Loading branch information
dskloetd committed Sep 9, 2024
1 parent a5c26b3 commit 5271c84
Show file tree
Hide file tree
Showing 12 changed files with 5 additions and 132 deletions.
2 changes: 1 addition & 1 deletion packages/nns/candid/genesis_token.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 35bfcad (2024-08-29 tags: release-2024-08-29_01-30-base) 'rs/nns/gtc/canister/gtc.did' by import-candid
// Generated from IC repo commit 20321d1029 (2024-09-07) 'rs/nns/gtc/canister/gtc.did' by import-candid
type AccountState = record {
authenticated_principal_id : opt principal;
successfully_transferred_neurons : vec TransferredNeuron;
Expand Down
6 changes: 0 additions & 6 deletions packages/nns/candid/governance.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ export const idlFactory = ({ IDL }) => {
});
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),
Expand Down Expand Up @@ -770,9 +769,6 @@ export const idlFactory = ({ IDL }) => {
'CreateServiceNervousSystem' : CreateServiceNervousSystem,
'ExecuteNnsFunction' : ExecuteNnsFunction,
'RewardNodeProvider' : RewardNodeProvider,
'OpenSnsTokenSwap' : OpenSnsTokenSwap,
'SetSnsTokenSwapOpenTimeWindow' : SetSnsTokenSwapOpenTimeWindow,
'SetDefaultFollowees' : SetDefaultFollowees,
'RewardNodeProviders' : RewardNodeProviders,
'ManageNetworkEconomics' : NetworkEconomics,
'ApproveGenesisKyc' : Principals,
Expand Down Expand Up @@ -873,7 +869,6 @@ export const idlFactory = ({ IDL }) => {
});
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),
Expand Down Expand Up @@ -1454,7 +1449,6 @@ export const init = ({ IDL }) => {
});
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),
Expand Down
5 changes: 0 additions & 5 deletions packages/nns/candid/governance.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -575,15 +575,13 @@ export interface NeuronsFundMatchedFundingCurveCoefficients {
}
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<Principal>;
is_capped: [] | [boolean];
maturity_equivalent_icp_e8s: [] | [bigint];
Expand Down Expand Up @@ -668,9 +666,6 @@ export type ProposalActionRequest =
| { CreateServiceNervousSystem: CreateServiceNervousSystem }
| { ExecuteNnsFunction: ExecuteNnsFunction }
| { RewardNodeProvider: RewardNodeProvider }
| { OpenSnsTokenSwap: OpenSnsTokenSwap }
| { SetSnsTokenSwapOpenTimeWindow: SetSnsTokenSwapOpenTimeWindow }
| { SetDefaultFollowees: SetDefaultFollowees }
| { RewardNodeProviders: RewardNodeProviders }
| { ManageNetworkEconomics: NetworkEconomics }
| { ApproveGenesisKyc: Principals }
Expand Down
7 changes: 1 addition & 6 deletions packages/nns/candid/governance.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 35bfcad (2024-08-29 tags: release-2024-08-29_01-30-base) 'rs/nns/governance/canister/governance.did' by import-candid
// Generated from IC repo commit 20321d1029 (2024-09-07) 'rs/nns/governance/canister/governance.did' by import-candid
type AccountIdentifier = record {
hash : blob;
};
Expand Down Expand Up @@ -677,7 +677,6 @@ type NeuronsFundMatchedFundingCurveCoefficients = record {

type NeuronsFundNeuron = record {
controller : opt principal;
hotkey_principal : opt text;
hotkeys : opt Principals;
is_capped : opt bool;
nns_neuron_id : opt nat64;
Expand All @@ -686,7 +685,6 @@ type NeuronsFundNeuron = record {

type NeuronsFundNeuronPortion = record {
controller : opt principal;
hotkey_principal : opt principal;
hotkeys : vec principal;
is_capped : opt bool;
maturity_equivalent_icp_e8s : opt nat64;
Expand Down Expand Up @@ -783,9 +781,6 @@ type ProposalActionRequest = variant {
CreateServiceNervousSystem : CreateServiceNervousSystem;
ExecuteNnsFunction : ExecuteNnsFunction;
RewardNodeProvider : RewardNodeProvider;
OpenSnsTokenSwap : OpenSnsTokenSwap;
SetSnsTokenSwapOpenTimeWindow : SetSnsTokenSwapOpenTimeWindow;
SetDefaultFollowees : SetDefaultFollowees;
RewardNodeProviders : RewardNodeProviders;
ManageNetworkEconomics : NetworkEconomics;
ApproveGenesisKyc : Principals;
Expand Down
6 changes: 0 additions & 6 deletions packages/nns/candid/governance.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ export const idlFactory = ({ IDL }) => {
});
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),
Expand Down Expand Up @@ -770,9 +769,6 @@ export const idlFactory = ({ IDL }) => {
'CreateServiceNervousSystem' : CreateServiceNervousSystem,
'ExecuteNnsFunction' : ExecuteNnsFunction,
'RewardNodeProvider' : RewardNodeProvider,
'OpenSnsTokenSwap' : OpenSnsTokenSwap,
'SetSnsTokenSwapOpenTimeWindow' : SetSnsTokenSwapOpenTimeWindow,
'SetDefaultFollowees' : SetDefaultFollowees,
'RewardNodeProviders' : RewardNodeProviders,
'ManageNetworkEconomics' : NetworkEconomics,
'ApproveGenesisKyc' : Principals,
Expand Down Expand Up @@ -873,7 +869,6 @@ export const idlFactory = ({ IDL }) => {
});
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),
Expand Down Expand Up @@ -1470,7 +1465,6 @@ export const init = ({ IDL }) => {
});
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),
Expand Down
6 changes: 0 additions & 6 deletions packages/nns/candid/governance_test.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ export const idlFactory = ({ IDL }) => {
});
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),
Expand Down Expand Up @@ -770,9 +769,6 @@ export const idlFactory = ({ IDL }) => {
'CreateServiceNervousSystem' : CreateServiceNervousSystem,
'ExecuteNnsFunction' : ExecuteNnsFunction,
'RewardNodeProvider' : RewardNodeProvider,
'OpenSnsTokenSwap' : OpenSnsTokenSwap,
'SetSnsTokenSwapOpenTimeWindow' : SetSnsTokenSwapOpenTimeWindow,
'SetDefaultFollowees' : SetDefaultFollowees,
'RewardNodeProviders' : RewardNodeProviders,
'ManageNetworkEconomics' : NetworkEconomics,
'ApproveGenesisKyc' : Principals,
Expand Down Expand Up @@ -873,7 +869,6 @@ export const idlFactory = ({ IDL }) => {
});
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),
Expand Down Expand Up @@ -1455,7 +1450,6 @@ export const init = ({ IDL }) => {
});
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),
Expand Down
5 changes: 0 additions & 5 deletions packages/nns/candid/governance_test.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -575,15 +575,13 @@ export interface NeuronsFundMatchedFundingCurveCoefficients {
}
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<Principal>;
is_capped: [] | [boolean];
maturity_equivalent_icp_e8s: [] | [bigint];
Expand Down Expand Up @@ -668,9 +666,6 @@ export type ProposalActionRequest =
| { CreateServiceNervousSystem: CreateServiceNervousSystem }
| { ExecuteNnsFunction: ExecuteNnsFunction }
| { RewardNodeProvider: RewardNodeProvider }
| { OpenSnsTokenSwap: OpenSnsTokenSwap }
| { SetSnsTokenSwapOpenTimeWindow: SetSnsTokenSwapOpenTimeWindow }
| { SetDefaultFollowees: SetDefaultFollowees }
| { RewardNodeProviders: RewardNodeProviders }
| { ManageNetworkEconomics: NetworkEconomics }
| { ApproveGenesisKyc: Principals }
Expand Down
7 changes: 1 addition & 6 deletions packages/nns/candid/governance_test.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 35bfcad (2024-08-29 tags: release-2024-08-29_01-30-base) 'rs/nns/governance/canister/governance_test.did' by import-candid
// Generated from IC repo commit 20321d1029 (2024-09-07) 'rs/nns/governance/canister/governance_test.did' by import-candid
type AccountIdentifier = record {
hash : blob;
};
Expand Down Expand Up @@ -679,7 +679,6 @@ type NeuronsFundMatchedFundingCurveCoefficients = record {

type NeuronsFundNeuron = record {
controller : opt principal;
hotkey_principal : opt text;
hotkeys : opt Principals;
is_capped : opt bool;
nns_neuron_id : opt nat64;
Expand All @@ -688,7 +687,6 @@ type NeuronsFundNeuron = record {

type NeuronsFundNeuronPortion = record {
controller : opt principal;
hotkey_principal : opt principal;
hotkeys : vec principal;
is_capped : opt bool;
maturity_equivalent_icp_e8s : opt nat64;
Expand Down Expand Up @@ -785,9 +783,6 @@ type ProposalActionRequest = variant {
CreateServiceNervousSystem : CreateServiceNervousSystem;
ExecuteNnsFunction : ExecuteNnsFunction;
RewardNodeProvider : RewardNodeProvider;
OpenSnsTokenSwap : OpenSnsTokenSwap;
SetSnsTokenSwapOpenTimeWindow : SetSnsTokenSwapOpenTimeWindow;
SetDefaultFollowees : SetDefaultFollowees;
RewardNodeProviders : RewardNodeProviders;
ManageNetworkEconomics : NetworkEconomics;
ApproveGenesisKyc : Principals;
Expand Down
6 changes: 0 additions & 6 deletions packages/nns/candid/governance_test.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ export const idlFactory = ({ IDL }) => {
});
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),
Expand Down Expand Up @@ -770,9 +769,6 @@ export const idlFactory = ({ IDL }) => {
'CreateServiceNervousSystem' : CreateServiceNervousSystem,
'ExecuteNnsFunction' : ExecuteNnsFunction,
'RewardNodeProvider' : RewardNodeProvider,
'OpenSnsTokenSwap' : OpenSnsTokenSwap,
'SetSnsTokenSwapOpenTimeWindow' : SetSnsTokenSwapOpenTimeWindow,
'SetDefaultFollowees' : SetDefaultFollowees,
'RewardNodeProviders' : RewardNodeProviders,
'ManageNetworkEconomics' : NetworkEconomics,
'ApproveGenesisKyc' : Principals,
Expand Down Expand Up @@ -873,7 +869,6 @@ export const idlFactory = ({ IDL }) => {
});
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),
Expand Down Expand Up @@ -1471,7 +1466,6 @@ export const init = ({ IDL }) => {
});
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),
Expand Down
2 changes: 1 addition & 1 deletion packages/nns/candid/sns_wasm.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 35bfcad (2024-08-29 tags: release-2024-08-29_01-30-base) 'rs/nns/sns-wasm/canister/sns-wasm.did' by import-candid
// Generated from IC repo commit 20321d1029 (2024-09-07) 'rs/nns/sns-wasm/canister/sns-wasm.did' by import-candid
type AddWasmRequest = record {
hash : blob;
wasm : opt SnsWasm;
Expand Down
80 changes: 0 additions & 80 deletions packages/nns/src/canisters/governance/request.converters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -574,18 +574,6 @@ const fromAction = (action: ProposalActionRequest): RawAction => {
};
}

if ("SetDefaultFollowees" in action) {
const setDefaultFollowees = action.SetDefaultFollowees;
return {
SetDefaultFollowees: {
default_followees: setDefaultFollowees.defaultFollowees.map((f) => [
f.topic as number,
fromFollowees(f.followees),
]),
},
};
}

if ("RegisterKnownNeuron" in action) {
const knownNeuron = action.RegisterKnownNeuron;
return {
Expand All @@ -604,74 +592,6 @@ const fromAction = (action: ProposalActionRequest): RawAction => {
};
}

if ("SetSnsTokenSwapOpenTimeWindow" in action) {
const { request, swapCanisterId } = action.SetSnsTokenSwapOpenTimeWindow;

return {
SetSnsTokenSwapOpenTimeWindow: {
request:
request === undefined
? []
: [
{
open_time_window:
request.openTimeWindow === undefined
? []
: [
{
start_timestamp_seconds:
request.openTimeWindow.startTimestampSeconds,
end_timestamp_seconds:
request.openTimeWindow.endTimestampSeconds,
},
],
},
],

swap_canister_id:
swapCanisterId === undefined
? []
: [Principal.fromText(swapCanisterId)],
},
};
}

if ("OpenSnsTokenSwap" in action) {
const { communityFundInvestmentE8s, targetSwapCanisterId, params } =
action.OpenSnsTokenSwap;

return {
OpenSnsTokenSwap: {
community_fund_investment_e8s: toNullable(communityFundInvestmentE8s),
target_swap_canister_id: toNullable(targetSwapCanisterId),
params:
params === undefined
? []
: [
{
min_participant_icp_e8s: params.minParticipantIcpE8s,
max_icp_e8s: params.maxIcpE8s,
swap_due_timestamp_seconds: params.swapDueTimestampSeconds,
min_participants: params.minParticipants,
sns_token_e8s: params.snsTokenE8s,
max_participant_icp_e8s: params.maxParticipantIcpE8s,
min_icp_e8s: params.minIcpE8s,
sale_delay_seconds: toNullable(params.saleDelaySeconds),
neuron_basket_construction_parameters: toNullable(
params.neuronBasketConstructionParameters,
),
max_direct_participation_icp_e8s: toNullable(
params.maxDirectParticipationIcpE8s,
),
min_direct_participation_icp_e8s: toNullable(
params.minDirectParticipationIcpE8s,
),
},
],
},
};
}

if ("CreateServiceNervousSystem" in action) {
return {
CreateServiceNervousSystem: fromCreateServiceNervousSystem(
Expand Down
5 changes: 1 addition & 4 deletions packages/nns/src/types/governance_converters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ export type ProposalActionRequest =
| { RewardNodeProvider: RewardNodeProvider }
| { RewardNodeProviders: RewardNodeProviders }
| { AddOrRemoveNodeProvider: AddOrRemoveNodeProvider }
| { SetDefaultFollowees: SetDefaultFollowees }
| { Motion: Motion }
| { SetSnsTokenSwapOpenTimeWindow: SetSnsTokenSwapOpenTimeWindow }
| { OpenSnsTokenSwap: OpenSnsTokenSwap };
| { Motion: Motion };
export interface AddHotKey {
newHotKey: Option<PrincipalString>;
}
Expand Down

0 comments on commit 5271c84

Please sign in to comment.