Skip to content

Commit

Permalink
Update deploy_new_sns types from did
Browse files Browse the repository at this point in the history
  • Loading branch information
mstrasinskis committed Jul 28, 2023
1 parent 325dabc commit 324f9e7
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 1 deletion.
36 changes: 36 additions & 0 deletions packages/nns/candid/sns_wasm.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ export const idlFactory = ({ IDL }) => {
'Hash' : IDL.Vec(IDL.Nat8),
});
const AddWasmResponse = IDL.Record({ 'result' : IDL.Opt(Result) });
const NeuronBasketConstructionParameters = IDL.Record({
'dissolve_delay_interval_seconds' : IDL.Nat64,
'count' : IDL.Nat64,
});
const Canister = IDL.Record({ 'id' : IDL.Opt(IDL.Principal) });
const DappCanisters = IDL.Record({ 'canisters' : IDL.Vec(Canister) });
const CfNeuron = IDL.Record({
'nns_neuron_id' : IDL.Nat64,
'amount_icp_e8s' : IDL.Nat64,
});
const CfParticipant = IDL.Record({
'hotkey_principal' : IDL.Text,
'cf_neurons' : IDL.Vec(CfNeuron),
});
const NeuronsFundParticipants = IDL.Record({
'participants' : IDL.Vec(CfParticipant),
});
const TreasuryDistribution = IDL.Record({ 'total_e8s' : IDL.Nat64 });
const NeuronDistribution = IDL.Record({
'controller' : IDL.Opt(IDL.Principal),
Expand Down Expand Up @@ -51,30 +68,48 @@ export const idlFactory = ({ IDL }) => {
'url' : IDL.Opt(IDL.Text),
'max_dissolve_delay_seconds' : IDL.Opt(IDL.Nat64),
'max_dissolve_delay_bonus_percentage' : IDL.Opt(IDL.Nat64),
'nns_proposal_id' : IDL.Opt(IDL.Nat64),
'min_participant_icp_e8s' : IDL.Opt(IDL.Nat64),
'neuron_basket_construction_parameters' : IDL.Opt(
NeuronBasketConstructionParameters
),
'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),
'token_symbol' : IDL.Opt(IDL.Text),
'final_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),
'max_icp_e8s' : IDL.Opt(IDL.Nat64),
'neuron_minimum_stake_e8s' : IDL.Opt(IDL.Nat64),
'confirmation_text' : IDL.Opt(IDL.Text),
'logo' : IDL.Opt(IDL.Text),
'name' : IDL.Opt(IDL.Text),
'swap_start_timestamp_seconds' : IDL.Opt(IDL.Nat64),
'swap_due_timestamp_seconds' : IDL.Opt(IDL.Nat64),
'initial_voting_period_seconds' : IDL.Opt(IDL.Nat64),
'neuron_minimum_dissolve_delay_to_vote_seconds' : IDL.Opt(IDL.Nat64),
'description' : IDL.Opt(IDL.Text),
'max_neuron_age_seconds_for_age_bonus' : IDL.Opt(IDL.Nat64),
'min_participants' : IDL.Opt(IDL.Nat64),
'initial_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),
'wait_for_quiet_deadline_increase_seconds' : IDL.Opt(IDL.Nat64),
'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),
'dapp_canisters' : IDL.Opt(DappCanisters),
'neurons_fund_participants' : IDL.Opt(NeuronsFundParticipants),
'max_age_bonus_percentage' : IDL.Opt(IDL.Nat64),
'initial_token_distribution' : IDL.Opt(InitialTokenDistribution),
'reward_rate_transition_duration_seconds' : IDL.Opt(IDL.Nat64),
'token_name' : IDL.Opt(IDL.Text),
'max_participant_icp_e8s' : IDL.Opt(IDL.Nat64),
'proposal_reject_cost_e8s' : IDL.Opt(IDL.Nat64),
'restricted_countries' : IDL.Opt(Countries),
'min_icp_e8s' : IDL.Opt(IDL.Nat64),
});
const DeployNewSnsRequest = IDL.Record({
'sns_init_payload' : IDL.Opt(SnsInitPayload),
});
const DappCanistersTransferResult = IDL.Record({
'restored_dapp_canisters' : IDL.Vec(Canister),
'nns_controlled_dapp_canisters' : IDL.Vec(Canister),
'sns_controlled_dapp_canisters' : IDL.Vec(Canister),
});
const SnsCanisterIds = IDL.Record({
'root' : IDL.Opt(IDL.Principal),
'swap' : IDL.Opt(IDL.Principal),
Expand All @@ -83,6 +118,7 @@ export const idlFactory = ({ IDL }) => {
'governance' : IDL.Opt(IDL.Principal),
});
const DeployNewSnsResponse = IDL.Record({
'dapp_canisters_transfer_result' : IDL.Opt(DappCanistersTransferResult),
'subnet_id' : IDL.Opt(IDL.Principal),
'error' : IDL.Opt(SnsWasmError),
'canisters' : IDL.Opt(SnsCanisterIds),
Expand Down
40 changes: 40 additions & 0 deletions packages/nns/candid/sns_wasm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,33 @@ export interface AddWasmResponse {
export interface AirdropDistribution {
airdrop_neurons: Array<NeuronDistribution>;
}
export interface Canister {
id: [] | [Principal];
}
export interface CfNeuron {
nns_neuron_id: bigint;
amount_icp_e8s: bigint;
}
export interface CfParticipant {
hotkey_principal: string;
cf_neurons: Array<CfNeuron>;
}
export interface Countries {
iso_codes: Array<string>;
}
export interface DappCanisters {
canisters: Array<Canister>;
}
export interface DappCanistersTransferResult {
restored_dapp_canisters: Array<Canister>;
nns_controlled_dapp_canisters: Array<Canister>;
sns_controlled_dapp_canisters: Array<Canister>;
}
export interface DeployNewSnsRequest {
sns_init_payload: [] | [SnsInitPayload];
}
export interface DeployNewSnsResponse {
dapp_canisters_transfer_result: [] | [DappCanistersTransferResult];
subnet_id: [] | [Principal];
error: [] | [SnsWasmError];
canisters: [] | [SnsCanisterIds];
Expand Down Expand Up @@ -82,13 +102,20 @@ export interface ListUpgradeStepsRequest {
export interface ListUpgradeStepsResponse {
steps: Array<ListUpgradeStep>;
}
export interface NeuronBasketConstructionParameters {
dissolve_delay_interval_seconds: bigint;
count: bigint;
}
export interface NeuronDistribution {
controller: [] | [Principal];
dissolve_delay_seconds: bigint;
memo: bigint;
stake_e8s: bigint;
vesting_period_seconds: [] | [bigint];
}
export interface NeuronsFundParticipants {
participants: Array<CfParticipant>;
}
export interface PrettySnsVersion {
archive_wasm_hash: string;
root_wasm_hash: string;
Expand All @@ -109,26 +136,39 @@ export interface SnsInitPayload {
url: [] | [string];
max_dissolve_delay_seconds: [] | [bigint];
max_dissolve_delay_bonus_percentage: [] | [bigint];
nns_proposal_id: [] | [bigint];
min_participant_icp_e8s: [] | [bigint];
neuron_basket_construction_parameters:
| []
| [NeuronBasketConstructionParameters];
fallback_controller_principal_ids: Array<string>;
token_symbol: [] | [string];
final_reward_rate_basis_points: [] | [bigint];
max_icp_e8s: [] | [bigint];
neuron_minimum_stake_e8s: [] | [bigint];
confirmation_text: [] | [string];
logo: [] | [string];
name: [] | [string];
swap_start_timestamp_seconds: [] | [bigint];
swap_due_timestamp_seconds: [] | [bigint];
initial_voting_period_seconds: [] | [bigint];
neuron_minimum_dissolve_delay_to_vote_seconds: [] | [bigint];
description: [] | [string];
max_neuron_age_seconds_for_age_bonus: [] | [bigint];
min_participants: [] | [bigint];
initial_reward_rate_basis_points: [] | [bigint];
wait_for_quiet_deadline_increase_seconds: [] | [bigint];
transaction_fee_e8s: [] | [bigint];
dapp_canisters: [] | [DappCanisters];
neurons_fund_participants: [] | [NeuronsFundParticipants];
max_age_bonus_percentage: [] | [bigint];
initial_token_distribution: [] | [InitialTokenDistribution];
reward_rate_transition_duration_seconds: [] | [bigint];
token_name: [] | [string];
max_participant_icp_e8s: [] | [bigint];
proposal_reject_cost_e8s: [] | [bigint];
restricted_countries: [] | [Countries];
min_icp_e8s: [] | [bigint];
}
export interface SnsUpgrade {
next_version: [] | [SnsVersion];
Expand Down
31 changes: 30 additions & 1 deletion packages/nns/candid/sns_wasm.did
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
// Generated from IC repo commit b9fc66eafca530e997313aa68aaac31d41e6a875 'rs/nns/sns-wasm/canister/sns-wasm.did' by import-candid
// Generated from IC repo commit 509bc5a87192031915768db6e24647cc26f86069 'rs/nns/sns-wasm/canister/sns-wasm.did' by import-candid
type AddWasmRequest = record { hash : vec nat8; wasm : opt SnsWasm };
type AddWasmResponse = record { result : opt Result };
type AirdropDistribution = record { airdrop_neurons : vec NeuronDistribution };
type Canister = record { id : opt principal };
type CfNeuron = record { nns_neuron_id : nat64; amount_icp_e8s : nat64 };
type CfParticipant = record {
hotkey_principal : text;
cf_neurons : vec CfNeuron;
};
type Countries = record { iso_codes : vec text };
type DappCanisters = record { canisters : vec Canister };
type DappCanistersTransferResult = record {
restored_dapp_canisters : vec Canister;
nns_controlled_dapp_canisters : vec Canister;
sns_controlled_dapp_canisters : vec Canister;
};
type DeployNewSnsRequest = record { sns_init_payload : opt SnsInitPayload };
type DeployNewSnsResponse = record {
dapp_canisters_transfer_result : opt DappCanistersTransferResult;
subnet_id : opt principal;
error : opt SnsWasmError;
canisters : opt SnsCanisterIds;
Expand Down Expand Up @@ -55,13 +68,18 @@ type ListUpgradeStepsRequest = record {
sns_governance_canister_id : opt principal;
};
type ListUpgradeStepsResponse = record { steps : vec ListUpgradeStep };
type NeuronBasketConstructionParameters = record {
dissolve_delay_interval_seconds : nat64;
count : nat64;
};
type NeuronDistribution = record {
controller : opt principal;
dissolve_delay_seconds : nat64;
memo : nat64;
stake_e8s : nat64;
vesting_period_seconds : opt nat64;
};
type NeuronsFundParticipants = record { participants : vec CfParticipant };
type PrettySnsVersion = record {
archive_wasm_hash : text;
root_wasm_hash : text;
Expand All @@ -82,26 +100,37 @@ type SnsInitPayload = record {
url : opt text;
max_dissolve_delay_seconds : opt nat64;
max_dissolve_delay_bonus_percentage : opt nat64;
nns_proposal_id : opt nat64;
min_participant_icp_e8s : opt nat64;
neuron_basket_construction_parameters : opt NeuronBasketConstructionParameters;
fallback_controller_principal_ids : vec text;
token_symbol : opt text;
final_reward_rate_basis_points : opt nat64;
max_icp_e8s : opt nat64;
neuron_minimum_stake_e8s : opt nat64;
confirmation_text : opt text;
logo : opt text;
name : opt text;
swap_start_timestamp_seconds : opt nat64;
swap_due_timestamp_seconds : opt nat64;
initial_voting_period_seconds : opt nat64;
neuron_minimum_dissolve_delay_to_vote_seconds : opt nat64;
description : opt text;
max_neuron_age_seconds_for_age_bonus : opt nat64;
min_participants : opt nat64;
initial_reward_rate_basis_points : opt nat64;
wait_for_quiet_deadline_increase_seconds : opt nat64;
transaction_fee_e8s : opt nat64;
dapp_canisters : opt DappCanisters;
neurons_fund_participants : opt NeuronsFundParticipants;
max_age_bonus_percentage : opt nat64;
initial_token_distribution : opt InitialTokenDistribution;
reward_rate_transition_duration_seconds : opt nat64;
token_name : opt text;
max_participant_icp_e8s : opt nat64;
proposal_reject_cost_e8s : opt nat64;
restricted_countries : opt Countries;
min_icp_e8s : opt nat64;
};
type SnsUpgrade = record {
next_version : opt SnsVersion;
Expand Down
36 changes: 36 additions & 0 deletions packages/nns/candid/sns_wasm.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ export const idlFactory = ({ IDL }) => {
'Hash' : IDL.Vec(IDL.Nat8),
});
const AddWasmResponse = IDL.Record({ 'result' : IDL.Opt(Result) });
const NeuronBasketConstructionParameters = IDL.Record({
'dissolve_delay_interval_seconds' : IDL.Nat64,
'count' : IDL.Nat64,
});
const Canister = IDL.Record({ 'id' : IDL.Opt(IDL.Principal) });
const DappCanisters = IDL.Record({ 'canisters' : IDL.Vec(Canister) });
const CfNeuron = IDL.Record({
'nns_neuron_id' : IDL.Nat64,
'amount_icp_e8s' : IDL.Nat64,
});
const CfParticipant = IDL.Record({
'hotkey_principal' : IDL.Text,
'cf_neurons' : IDL.Vec(CfNeuron),
});
const NeuronsFundParticipants = IDL.Record({
'participants' : IDL.Vec(CfParticipant),
});
const TreasuryDistribution = IDL.Record({ 'total_e8s' : IDL.Nat64 });
const NeuronDistribution = IDL.Record({
'controller' : IDL.Opt(IDL.Principal),
Expand Down Expand Up @@ -51,30 +68,48 @@ export const idlFactory = ({ IDL }) => {
'url' : IDL.Opt(IDL.Text),
'max_dissolve_delay_seconds' : IDL.Opt(IDL.Nat64),
'max_dissolve_delay_bonus_percentage' : IDL.Opt(IDL.Nat64),
'nns_proposal_id' : IDL.Opt(IDL.Nat64),
'min_participant_icp_e8s' : IDL.Opt(IDL.Nat64),
'neuron_basket_construction_parameters' : IDL.Opt(
NeuronBasketConstructionParameters
),
'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),
'token_symbol' : IDL.Opt(IDL.Text),
'final_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),
'max_icp_e8s' : IDL.Opt(IDL.Nat64),
'neuron_minimum_stake_e8s' : IDL.Opt(IDL.Nat64),
'confirmation_text' : IDL.Opt(IDL.Text),
'logo' : IDL.Opt(IDL.Text),
'name' : IDL.Opt(IDL.Text),
'swap_start_timestamp_seconds' : IDL.Opt(IDL.Nat64),
'swap_due_timestamp_seconds' : IDL.Opt(IDL.Nat64),
'initial_voting_period_seconds' : IDL.Opt(IDL.Nat64),
'neuron_minimum_dissolve_delay_to_vote_seconds' : IDL.Opt(IDL.Nat64),
'description' : IDL.Opt(IDL.Text),
'max_neuron_age_seconds_for_age_bonus' : IDL.Opt(IDL.Nat64),
'min_participants' : IDL.Opt(IDL.Nat64),
'initial_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),
'wait_for_quiet_deadline_increase_seconds' : IDL.Opt(IDL.Nat64),
'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),
'dapp_canisters' : IDL.Opt(DappCanisters),
'neurons_fund_participants' : IDL.Opt(NeuronsFundParticipants),
'max_age_bonus_percentage' : IDL.Opt(IDL.Nat64),
'initial_token_distribution' : IDL.Opt(InitialTokenDistribution),
'reward_rate_transition_duration_seconds' : IDL.Opt(IDL.Nat64),
'token_name' : IDL.Opt(IDL.Text),
'max_participant_icp_e8s' : IDL.Opt(IDL.Nat64),
'proposal_reject_cost_e8s' : IDL.Opt(IDL.Nat64),
'restricted_countries' : IDL.Opt(Countries),
'min_icp_e8s' : IDL.Opt(IDL.Nat64),
});
const DeployNewSnsRequest = IDL.Record({
'sns_init_payload' : IDL.Opt(SnsInitPayload),
});
const DappCanistersTransferResult = IDL.Record({
'restored_dapp_canisters' : IDL.Vec(Canister),
'nns_controlled_dapp_canisters' : IDL.Vec(Canister),
'sns_controlled_dapp_canisters' : IDL.Vec(Canister),
});
const SnsCanisterIds = IDL.Record({
'root' : IDL.Opt(IDL.Principal),
'swap' : IDL.Opt(IDL.Principal),
Expand All @@ -83,6 +118,7 @@ export const idlFactory = ({ IDL }) => {
'governance' : IDL.Opt(IDL.Principal),
});
const DeployNewSnsResponse = IDL.Record({
'dapp_canisters_transfer_result' : IDL.Opt(DappCanistersTransferResult),
'subnet_id' : IDL.Opt(IDL.Principal),
'error' : IDL.Opt(SnsWasmError),
'canisters' : IDL.Opt(SnsCanisterIds),
Expand Down

0 comments on commit 324f9e7

Please sign in to comment.