diff --git a/candid/candid_test.go b/candid/candid_test.go index 9c4562f..9283108 100644 --- a/candid/candid_test.go +++ b/candid/candid_test.go @@ -173,3 +173,41 @@ func TestParseDID(t *testing.T) { t.Error(err) } } + +func TestRecordSubtyping(t *testing.T) { + type T struct{ X idl.Nat } + type T_ struct { + X idl.Nat + Y *idl.Nat + } + ONE := idl.NewNat(uint(1)) + t.Run("missing field", func(t *testing.T) { + encoded, err := idl.Marshal([]any{T_{X: ONE, Y: &ONE}}) + if err != nil { + t.Fatal(err) + } + var value T + if err := idl.Unmarshal(encoded, []any{&value}); err != nil { + t.Fatal(err) + } + if value.X.BigInt().Int64() != 1 { + t.Error(value.X) + } + }) + t.Run("extra field", func(t *testing.T) { + encoded, err := idl.Marshal([]any{T{X: ONE}}) + if err != nil { + t.Fatal(err) + } + var value T_ + if err := idl.Unmarshal(encoded, []any{&value}); err != nil { + t.Fatal(err) + } + if value.X.BigInt().Int64() != 1 { + t.Error(value.X) + } + if value.Y != nil { + t.Error(value.Y) + } + }) +} diff --git a/candid/idl/record.go b/candid/idl/record.go index 7c46e6c..b7c6e97 100644 --- a/candid/idl/record.go +++ b/candid/idl/record.go @@ -206,6 +206,9 @@ func (record RecordType) unmarshalStruct(raw map[string]any, _v reflect.Value) e for _, f := range record.Fields { v, ok := findField(f.Name) if !ok { + if _, ok := f.Type.(*OptionalType); ok { + continue + } return NewUnmarshalGoError(raw, _v.Interface()) } v = v.Addr() diff --git a/candid/internal/candid/grammar.go b/candid/internal/candid/grammar.go index 48f3b28..14fe086 100755 --- a/candid/internal/candid/grammar.go +++ b/candid/internal/candid/grammar.go @@ -733,9 +733,7 @@ func TupType(p *ast.Parser) (*ast.Node, error) { ), }, ), - op.Optional( - Sp, - ), + Ws, ')', }, ArgType, diff --git a/candid/internal/candid/grammar.pegn b/candid/internal/candid/grammar.pegn index 3762624..38c61b4 100644 --- a/candid/internal/candid/grammar.pegn +++ b/candid/internal/candid/grammar.pegn @@ -11,7 +11,7 @@ ActorType <-- '{' Ws (MethType (';' Ws MethType)* ';'? Ws)? '}' MethType <-- Name Sp? ':' Ws (FuncType / Id) FuncType <-- TupType (Sp '->' Ws TupType (Sp FuncAnn)?)? FuncAnn <-- 'oneway' / 'query' -TupType <-- '(' Ws (ArgType (',' Sp ArgType)* (',' Ws)?)? Sp? ')' / ArgType +TupType <-- '(' Ws (ArgType (',' Sp ArgType)* (',' Ws)?)? Ws ')' / ArgType ArgType <-- (Name Sp? ':' Sp)? DataType FieldType <-- ((Nat / Name) Sp? ':' Sp)? DataType / Nat / Name DataType <-- ConsType / RefType / PrimType / Id diff --git a/ic/assetstorage/agent.go b/ic/assetstorage/agent.go index e0579d0..9d897ce 100755 --- a/ic/assetstorage/agent.go +++ b/ic/assetstorage/agent.go @@ -193,6 +193,27 @@ func (a Agent) CreateChunk(arg0 struct { return &r0, nil } +// CreateChunks calls the "create_chunks" method on the "assetstorage" canister. +func (a Agent) CreateChunks(arg0 struct { + BatchId BatchId `ic:"batch_id" json:"batch_id"` + Content [][]byte `ic:"content" json:"content"` +}) (*struct { + ChunkIds []ChunkId `ic:"chunk_ids" json:"chunk_ids"` +}, error) { + var r0 struct { + ChunkIds []ChunkId `ic:"chunk_ids" json:"chunk_ids"` + } + if err := a.Agent.Call( + a.CanisterId, + "create_chunks", + []any{arg0}, + []any{&r0}, + ); err != nil { + return nil, err + } + return &r0, nil +} + // Deauthorize calls the "deauthorize" method on the "assetstorage" canister. func (a Agent) Deauthorize(arg0 principal.Principal) error { if err := a.Agent.Call( diff --git a/ic/cmc/agent.go b/ic/cmc/agent.go index 85d898f..b3553f6 100755 --- a/ic/cmc/agent.go +++ b/ic/cmc/agent.go @@ -143,7 +143,6 @@ func (a Agent) NotifyTopUp(arg0 NotifyTopUpArg) (*NotifyTopUpResult, error) { type BlockIndex = uint64 type CanisterSettings struct { - Controller *principal.Principal `ic:"controller,omitempty" json:"controller,omitempty"` Controllers *[]principal.Principal `ic:"controllers,omitempty" json:"controllers,omitempty"` ComputeAllocation *idl.Nat `ic:"compute_allocation,omitempty" json:"compute_allocation,omitempty"` MemoryAllocation *idl.Nat `ic:"memory_allocation,omitempty" json:"memory_allocation,omitempty"` @@ -151,6 +150,7 @@ type CanisterSettings struct { ReservedCyclesLimit *idl.Nat `ic:"reserved_cycles_limit,omitempty" json:"reserved_cycles_limit,omitempty"` LogVisibility *LogVisibility `ic:"log_visibility,omitempty" json:"log_visibility,omitempty"` WasmMemoryLimit *idl.Nat `ic:"wasm_memory_limit,omitempty" json:"wasm_memory_limit,omitempty"` + WasmMemoryThreshold *idl.Nat `ic:"wasm_memory_threshold,omitempty" json:"wasm_memory_threshold,omitempty"` } type CreateCanisterArg struct { @@ -164,10 +164,6 @@ type CreateCanisterError struct { RefundAmount idl.Nat `ic:"refund_amount" json:"refund_amount"` CreateError string `ic:"create_error" json:"create_error"` } `ic:"Refunded,variant"` - RefundFailed *struct { - CreateError string `ic:"create_error" json:"create_error"` - RefundError string `ic:"refund_error" json:"refund_error"` - } `ic:"RefundFailed,variant"` } type CreateCanisterResult struct { diff --git a/ic/governance/agent.go b/ic/governance/agent.go index 486e698..5b2c4d2 100755 --- a/ic/governance/agent.go +++ b/ic/governance/agent.go @@ -15,6 +15,9 @@ type AccountIdentifier struct { type Action struct { RegisterKnownNeuron *KnownNeuron `ic:"RegisterKnownNeuron,variant"` ManageNeuron *ManageNeuron `ic:"ManageNeuron,variant"` + UpdateCanisterSettings *UpdateCanisterSettings `ic:"UpdateCanisterSettings,variant"` + InstallCode *InstallCode `ic:"InstallCode,variant"` + StopOrStartCanister *StopOrStartCanister `ic:"StopOrStartCanister,variant"` CreateServiceNervousSystem *CreateServiceNervousSystem `ic:"CreateServiceNervousSystem,variant"` ExecuteNnsFunction *ExecuteNnsFunction `ic:"ExecuteNnsFunction,variant"` RewardNodeProvider *RewardNodeProvider `ic:"RewardNodeProvider,variant"` @@ -23,7 +26,7 @@ type Action struct { SetDefaultFollowees *SetDefaultFollowees `ic:"SetDefaultFollowees,variant"` RewardNodeProviders *RewardNodeProviders `ic:"RewardNodeProviders,variant"` ManageNetworkEconomics *NetworkEconomics `ic:"ManageNetworkEconomics,variant"` - ApproveGenesisKyc *ApproveGenesisKyc `ic:"ApproveGenesisKyc,variant"` + ApproveGenesisKyc *Principals `ic:"ApproveGenesisKyc,variant"` AddOrRemoveNodeProvider *AddOrRemoveNodeProvider `ic:"AddOrRemoveNodeProvider,variant"` Motion *Motion `ic:"Motion,variant"` } @@ -167,8 +170,8 @@ func (a Agent) GetMonthlyNodeProviderRewards() (*Result4, error) { } // GetMostRecentMonthlyNodeProviderRewards calls the "get_most_recent_monthly_node_provider_rewards" method on the "governance" canister. -func (a Agent) GetMostRecentMonthlyNodeProviderRewards() (**MostRecentMonthlyNodeProviderRewards, error) { - var r0 *MostRecentMonthlyNodeProviderRewards +func (a Agent) GetMostRecentMonthlyNodeProviderRewards() (**MonthlyNodeProviderRewards, error) { + var r0 *MonthlyNodeProviderRewards if err := a.Agent.Query( a.CanisterId, "get_most_recent_monthly_node_provider_rewards", @@ -334,6 +337,20 @@ func (a Agent) ListNeurons(arg0 ListNeurons) (*ListNeuronsResponse, error) { return &r0, nil } +// ListNodeProviderRewards calls the "list_node_provider_rewards" method on the "governance" canister. +func (a Agent) ListNodeProviderRewards(arg0 ListNodeProviderRewardsRequest) (*ListNodeProviderRewardsResponse, error) { + var r0 ListNodeProviderRewardsResponse + if err := a.Agent.Query( + a.CanisterId, + "list_node_provider_rewards", + []any{arg0}, + []any{&r0}, + ); err != nil { + return nil, err + } + return &r0, nil +} + // ListNodeProviders calls the "list_node_providers" method on the "governance" canister. func (a Agent) ListNodeProviders() (*ListNodeProvidersResponse, error) { var r0 ListNodeProvidersResponse @@ -363,7 +380,7 @@ func (a Agent) ListProposals(arg0 ListProposalInfo) (*ListProposalInfoResponse, } // ManageNeuron calls the "manage_neuron" method on the "governance" canister. -func (a Agent) ManageNeuron(arg0 ManageNeuron) (*ManageNeuronResponse, error) { +func (a Agent) ManageNeuron(arg0 ManageNeuronRequest) (*ManageNeuronResponse, error) { var r0 ManageNeuronResponse if err := a.Agent.Call( a.CanisterId, @@ -405,7 +422,7 @@ func (a Agent) SettleNeuronsFundParticipation(arg0 SettleNeuronsFundParticipatio } // SimulateManageNeuron calls the "simulate_manage_neuron" method on the "governance" canister. -func (a Agent) SimulateManageNeuron(arg0 ManageNeuron) (*ManageNeuronResponse, error) { +func (a Agent) SimulateManageNeuron(arg0 ManageNeuronRequest) (*ManageNeuronResponse, error) { var r0 ManageNeuronResponse if err := a.Agent.Call( a.CanisterId, @@ -475,6 +492,15 @@ type Canister struct { Id *principal.Principal `ic:"id,omitempty" json:"id,omitempty"` } +type CanisterSettings struct { + FreezingThreshold *uint64 `ic:"freezing_threshold,omitempty" json:"freezing_threshold,omitempty"` + Controllers *Controllers `ic:"controllers,omitempty" json:"controllers,omitempty"` + LogVisibility *int32 `ic:"log_visibility,omitempty" json:"log_visibility,omitempty"` + WasmMemoryLimit *uint64 `ic:"wasm_memory_limit,omitempty" json:"wasm_memory_limit,omitempty"` + MemoryAllocation *uint64 `ic:"memory_allocation,omitempty" json:"memory_allocation,omitempty"` + ComputeAllocation *uint64 `ic:"compute_allocation,omitempty" json:"compute_allocation,omitempty"` +} + type CanisterStatusResultV2 struct { Status *int32 `ic:"status,omitempty" json:"status,omitempty"` FreezingThreshold *uint64 `ic:"freezing_threshold,omitempty" json:"freezing_threshold,omitempty"` @@ -490,17 +516,6 @@ type CanisterSummary struct { CanisterId *principal.Principal `ic:"canister_id,omitempty" json:"canister_id,omitempty"` } -type CfNeuron struct { - HasCreatedNeuronRecipes *bool `ic:"has_created_neuron_recipes,omitempty" json:"has_created_neuron_recipes,omitempty"` - NnsNeuronId uint64 `ic:"nns_neuron_id" json:"nns_neuron_id"` - AmountIcpE8s uint64 `ic:"amount_icp_e8s" json:"amount_icp_e8s"` -} - -type CfParticipant struct { - HotkeyPrincipal string `ic:"hotkey_principal" json:"hotkey_principal"` - CfNeurons []CfNeuron `ic:"cf_neurons" json:"cf_neurons"` -} - type Change struct { ToRemove *NodeProvider `ic:"ToRemove,variant"` ToAdd *NodeProvider `ic:"ToAdd,variant"` @@ -590,6 +605,10 @@ type Configure struct { Operation *Operation `ic:"operation,omitempty" json:"operation,omitempty"` } +type Controllers struct { + Controllers []principal.Principal `ic:"controllers" json:"controllers"` +} + type Countries struct { IsoCodes []string `ic:"iso_codes" json:"iso_codes"` } @@ -607,6 +626,11 @@ type CreateServiceNervousSystem struct { InitialTokenDistribution *InitialTokenDistribution `ic:"initial_token_distribution,omitempty" json:"initial_token_distribution,omitempty"` } +type DateRangeFilter struct { + StartTimestampSeconds *uint64 `ic:"start_timestamp_seconds,omitempty" json:"start_timestamp_seconds,omitempty"` + EndTimestampSeconds *uint64 `ic:"end_timestamp_seconds,omitempty" json:"end_timestamp_seconds,omitempty"` +} + type Decimal struct { HumanReadable *string `ic:"human_readable,omitempty" json:"human_readable,omitempty"` } @@ -687,20 +711,20 @@ type Governance struct { Field0 int32 `ic:"0" json:"0"` Field1 Followees `ic:"1" json:"1"` } `ic:"default_followees" json:"default_followees"` - MakingSnsProposal *MakingSnsProposal `ic:"making_sns_proposal,omitempty" json:"making_sns_proposal,omitempty"` - MostRecentMonthlyNodeProviderRewards *MostRecentMonthlyNodeProviderRewards `ic:"most_recent_monthly_node_provider_rewards,omitempty" json:"most_recent_monthly_node_provider_rewards,omitempty"` - MaturityModulationLastUpdatedAtTimestampSeconds *uint64 `ic:"maturity_modulation_last_updated_at_timestamp_seconds,omitempty" json:"maturity_modulation_last_updated_at_timestamp_seconds,omitempty"` - WaitForQuietThresholdSeconds uint64 `ic:"wait_for_quiet_threshold_seconds" json:"wait_for_quiet_threshold_seconds"` - Metrics *GovernanceCachedMetrics `ic:"metrics,omitempty" json:"metrics,omitempty"` - NeuronManagementVotingPeriodSeconds *uint64 `ic:"neuron_management_voting_period_seconds,omitempty" json:"neuron_management_voting_period_seconds,omitempty"` - NodeProviders []NodeProvider `ic:"node_providers" json:"node_providers"` - CachedDailyMaturityModulationBasisPoints *int32 `ic:"cached_daily_maturity_modulation_basis_points,omitempty" json:"cached_daily_maturity_modulation_basis_points,omitempty"` - Economics *NetworkEconomics `ic:"economics,omitempty" json:"economics,omitempty"` - RestoreAgingSummary *RestoreAgingSummary `ic:"restore_aging_summary,omitempty" json:"restore_aging_summary,omitempty"` - SpawningNeurons *bool `ic:"spawning_neurons,omitempty" json:"spawning_neurons,omitempty"` - LatestRewardEvent *RewardEvent `ic:"latest_reward_event,omitempty" json:"latest_reward_event,omitempty"` - ToClaimTransfers []NeuronStakeTransfer `ic:"to_claim_transfers" json:"to_claim_transfers"` - ShortVotingPeriodSeconds uint64 `ic:"short_voting_period_seconds" json:"short_voting_period_seconds"` + MakingSnsProposal *MakingSnsProposal `ic:"making_sns_proposal,omitempty" json:"making_sns_proposal,omitempty"` + MostRecentMonthlyNodeProviderRewards *MonthlyNodeProviderRewards `ic:"most_recent_monthly_node_provider_rewards,omitempty" json:"most_recent_monthly_node_provider_rewards,omitempty"` + MaturityModulationLastUpdatedAtTimestampSeconds *uint64 `ic:"maturity_modulation_last_updated_at_timestamp_seconds,omitempty" json:"maturity_modulation_last_updated_at_timestamp_seconds,omitempty"` + WaitForQuietThresholdSeconds uint64 `ic:"wait_for_quiet_threshold_seconds" json:"wait_for_quiet_threshold_seconds"` + Metrics *GovernanceCachedMetrics `ic:"metrics,omitempty" json:"metrics,omitempty"` + NeuronManagementVotingPeriodSeconds *uint64 `ic:"neuron_management_voting_period_seconds,omitempty" json:"neuron_management_voting_period_seconds,omitempty"` + NodeProviders []NodeProvider `ic:"node_providers" json:"node_providers"` + CachedDailyMaturityModulationBasisPoints *int32 `ic:"cached_daily_maturity_modulation_basis_points,omitempty" json:"cached_daily_maturity_modulation_basis_points,omitempty"` + Economics *NetworkEconomics `ic:"economics,omitempty" json:"economics,omitempty"` + RestoreAgingSummary *RestoreAgingSummary `ic:"restore_aging_summary,omitempty" json:"restore_aging_summary,omitempty"` + SpawningNeurons *bool `ic:"spawning_neurons,omitempty" json:"spawning_neurons,omitempty"` + LatestRewardEvent *RewardEvent `ic:"latest_reward_event,omitempty" json:"latest_reward_event,omitempty"` + ToClaimTransfers []NeuronStakeTransfer `ic:"to_claim_transfers" json:"to_claim_transfers"` + ShortVotingPeriodSeconds uint64 `ic:"short_voting_period_seconds" json:"short_voting_period_seconds"` TopicFolloweeIndex []struct { Field0 int32 `ic:"0" json:"0"` Field1 FollowersMap `ic:"1" json:"1"` @@ -739,25 +763,27 @@ type GovernanceCachedMetrics struct { Field0 uint64 `ic:"0" json:"0"` Field1 uint64 `ic:"1" json:"1"` } `ic:"not_dissolving_neurons_count_buckets" json:"not_dissolving_neurons_count_buckets"` - EctNeuronCount uint64 `ic:"ect_neuron_count" json:"ect_neuron_count"` - TotalSupplyIcp uint64 `ic:"total_supply_icp" json:"total_supply_icp"` - NeuronsWithLessThan6MonthsDissolveDelayCount uint64 `ic:"neurons_with_less_than_6_months_dissolve_delay_count" json:"neurons_with_less_than_6_months_dissolve_delay_count"` - DissolvedNeuronsCount uint64 `ic:"dissolved_neurons_count" json:"dissolved_neurons_count"` - CommunityFundTotalMaturityE8sEquivalent uint64 `ic:"community_fund_total_maturity_e8s_equivalent" json:"community_fund_total_maturity_e8s_equivalent"` - TotalStakedE8sSeed uint64 `ic:"total_staked_e8s_seed" json:"total_staked_e8s_seed"` - TotalStakedMaturityE8sEquivalentEct uint64 `ic:"total_staked_maturity_e8s_equivalent_ect" json:"total_staked_maturity_e8s_equivalent_ect"` - TotalStakedE8s uint64 `ic:"total_staked_e8s" json:"total_staked_e8s"` - NotDissolvingNeuronsCount uint64 `ic:"not_dissolving_neurons_count" json:"not_dissolving_neurons_count"` - TotalLockedE8s uint64 `ic:"total_locked_e8s" json:"total_locked_e8s"` - NeuronsFundTotalActiveNeurons uint64 `ic:"neurons_fund_total_active_neurons" json:"neurons_fund_total_active_neurons"` - TotalStakedMaturityE8sEquivalent uint64 `ic:"total_staked_maturity_e8s_equivalent" json:"total_staked_maturity_e8s_equivalent"` - NotDissolvingNeuronsE8sBucketsEct []struct { + EctNeuronCount uint64 `ic:"ect_neuron_count" json:"ect_neuron_count"` + TotalSupplyIcp uint64 `ic:"total_supply_icp" json:"total_supply_icp"` + NeuronsWithLessThan6MonthsDissolveDelayCount uint64 `ic:"neurons_with_less_than_6_months_dissolve_delay_count" json:"neurons_with_less_than_6_months_dissolve_delay_count"` + DissolvedNeuronsCount uint64 `ic:"dissolved_neurons_count" json:"dissolved_neurons_count"` + CommunityFundTotalMaturityE8sEquivalent uint64 `ic:"community_fund_total_maturity_e8s_equivalent" json:"community_fund_total_maturity_e8s_equivalent"` + TotalStakedE8sSeed uint64 `ic:"total_staked_e8s_seed" json:"total_staked_e8s_seed"` + TotalStakedMaturityE8sEquivalentEct uint64 `ic:"total_staked_maturity_e8s_equivalent_ect" json:"total_staked_maturity_e8s_equivalent_ect"` + TotalStakedE8s uint64 `ic:"total_staked_e8s" json:"total_staked_e8s"` + NotDissolvingNeuronsCount uint64 `ic:"not_dissolving_neurons_count" json:"not_dissolving_neurons_count"` + TotalLockedE8s uint64 `ic:"total_locked_e8s" json:"total_locked_e8s"` + NeuronsFundTotalActiveNeurons uint64 `ic:"neurons_fund_total_active_neurons" json:"neurons_fund_total_active_neurons"` + TotalVotingPowerNonSelfAuthenticatingController *uint64 `ic:"total_voting_power_non_self_authenticating_controller,omitempty" json:"total_voting_power_non_self_authenticating_controller,omitempty"` + TotalStakedMaturityE8sEquivalent uint64 `ic:"total_staked_maturity_e8s_equivalent" json:"total_staked_maturity_e8s_equivalent"` + NotDissolvingNeuronsE8sBucketsEct []struct { Field0 uint64 `ic:"0" json:"0"` Field1 float64 `ic:"1" json:"1"` } `ic:"not_dissolving_neurons_e8s_buckets_ect" json:"not_dissolving_neurons_e8s_buckets_ect"` - TotalStakedE8sEct uint64 `ic:"total_staked_e8s_ect" json:"total_staked_e8s_ect"` - NotDissolvingNeuronsStakedMaturityE8sEquivalentSum uint64 `ic:"not_dissolving_neurons_staked_maturity_e8s_equivalent_sum" json:"not_dissolving_neurons_staked_maturity_e8s_equivalent_sum"` - DissolvedNeuronsE8s uint64 `ic:"dissolved_neurons_e8s" json:"dissolved_neurons_e8s"` + TotalStakedE8sEct uint64 `ic:"total_staked_e8s_ect" json:"total_staked_e8s_ect"` + NotDissolvingNeuronsStakedMaturityE8sEquivalentSum uint64 `ic:"not_dissolving_neurons_staked_maturity_e8s_equivalent_sum" json:"not_dissolving_neurons_staked_maturity_e8s_equivalent_sum"` + DissolvedNeuronsE8s uint64 `ic:"dissolved_neurons_e8s" json:"dissolved_neurons_e8s"` + TotalStakedE8sNonSelfAuthenticatingController *uint64 `ic:"total_staked_e8s_non_self_authenticating_controller,omitempty" json:"total_staked_e8s_non_self_authenticating_controller,omitempty"` DissolvingNeuronsE8sBucketsSeed []struct { Field0 uint64 `ic:"0" json:"0"` Field1 float64 `ic:"1" json:"1"` @@ -775,8 +801,9 @@ type GovernanceCachedMetrics struct { Field0 uint64 `ic:"0" json:"0"` Field1 float64 `ic:"1" json:"1"` } `ic:"dissolving_neurons_e8s_buckets_ect" json:"dissolving_neurons_e8s_buckets_ect"` - DissolvingNeuronsCount uint64 `ic:"dissolving_neurons_count" json:"dissolving_neurons_count"` - DissolvingNeuronsE8sBuckets []struct { + NonSelfAuthenticatingControllerNeuronSubsetMetrics *NeuronSubsetMetrics `ic:"non_self_authenticating_controller_neuron_subset_metrics,omitempty" json:"non_self_authenticating_controller_neuron_subset_metrics,omitempty"` + DissolvingNeuronsCount uint64 `ic:"dissolving_neurons_count" json:"dissolving_neurons_count"` + DissolvingNeuronsE8sBuckets []struct { Field0 uint64 `ic:"0" json:"0"` Field1 float64 `ic:"1" json:"1"` } `ic:"dissolving_neurons_e8s_buckets" json:"dissolving_neurons_e8s_buckets"` @@ -786,8 +813,9 @@ type GovernanceCachedMetrics struct { Field0 uint64 `ic:"0" json:"0"` Field1 float64 `ic:"1" json:"1"` } `ic:"not_dissolving_neurons_e8s_buckets_seed" json:"not_dissolving_neurons_e8s_buckets_seed"` - TimestampSeconds uint64 `ic:"timestamp_seconds" json:"timestamp_seconds"` - SeedNeuronCount uint64 `ic:"seed_neuron_count" json:"seed_neuron_count"` + PublicNeuronSubsetMetrics *NeuronSubsetMetrics `ic:"public_neuron_subset_metrics,omitempty" json:"public_neuron_subset_metrics,omitempty"` + TimestampSeconds uint64 `ic:"timestamp_seconds" json:"timestamp_seconds"` + SeedNeuronCount uint64 `ic:"seed_neuron_count" json:"seed_neuron_count"` } type GovernanceError struct { @@ -826,6 +854,22 @@ type InitialTokenDistribution struct { SwapDistribution *SwapDistribution `ic:"swap_distribution,omitempty" json:"swap_distribution,omitempty"` } +type InstallCode struct { + SkipStoppingBeforeInstalling *bool `ic:"skip_stopping_before_installing,omitempty" json:"skip_stopping_before_installing,omitempty"` + WasmModuleHash *[]byte `ic:"wasm_module_hash,omitempty" json:"wasm_module_hash,omitempty"` + CanisterId *principal.Principal `ic:"canister_id,omitempty" json:"canister_id,omitempty"` + ArgHash *[]byte `ic:"arg_hash,omitempty" json:"arg_hash,omitempty"` + InstallMode *int32 `ic:"install_mode,omitempty" json:"install_mode,omitempty"` +} + +type InstallCodeRequest struct { + Arg *[]byte `ic:"arg,omitempty" json:"arg,omitempty"` + WasmModule *[]byte `ic:"wasm_module,omitempty" json:"wasm_module,omitempty"` + SkipStoppingBeforeInstalling *bool `ic:"skip_stopping_before_installing,omitempty" json:"skip_stopping_before_installing,omitempty"` + CanisterId *principal.Principal `ic:"canister_id,omitempty" json:"canister_id,omitempty"` + InstallMode *int32 `ic:"install_mode,omitempty" json:"install_mode,omitempty"` +} + type KnownNeuron struct { Id *NeuronId `ic:"id,omitempty" json:"id,omitempty"` KnownNeuronData *KnownNeuronData `ic:"known_neuron_data,omitempty" json:"known_neuron_data,omitempty"` @@ -848,8 +892,10 @@ type ListKnownNeuronsResponse struct { } type ListNeurons struct { - NeuronIds []uint64 `ic:"neuron_ids" json:"neuron_ids"` - IncludeNeuronsReadableByCaller bool `ic:"include_neurons_readable_by_caller" json:"include_neurons_readable_by_caller"` + IncludePublicNeuronsInFullNeurons *bool `ic:"include_public_neurons_in_full_neurons,omitempty" json:"include_public_neurons_in_full_neurons,omitempty"` + NeuronIds []uint64 `ic:"neuron_ids" json:"neuron_ids"` + IncludeEmptyNeuronsReadableByCaller *bool `ic:"include_empty_neurons_readable_by_caller,omitempty" json:"include_empty_neurons_readable_by_caller,omitempty"` + IncludeNeuronsReadableByCaller bool `ic:"include_neurons_readable_by_caller" json:"include_neurons_readable_by_caller"` } type ListNeuronsResponse struct { @@ -860,6 +906,14 @@ type ListNeuronsResponse struct { FullNeurons []Neuron `ic:"full_neurons" json:"full_neurons"` } +type ListNodeProviderRewardsRequest struct { + DateFilter *DateRangeFilter `ic:"date_filter,omitempty" json:"date_filter,omitempty"` +} + +type ListNodeProviderRewardsResponse struct { + Rewards []MonthlyNodeProviderRewards `ic:"rewards" json:"rewards"` +} + type ListNodeProvidersResponse struct { NodeProviders []NodeProvider `ic:"node_providers" json:"node_providers"` } @@ -878,6 +932,13 @@ type ListProposalInfoResponse struct { ProposalInfo []ProposalInfo `ic:"proposal_info" json:"proposal_info"` } +type MakeProposalRequest struct { + Url string `ic:"url" json:"url"` + Title *string `ic:"title,omitempty" json:"title,omitempty"` + Action *ProposalActionRequest `ic:"action,omitempty" json:"action,omitempty"` + Summary string `ic:"summary" json:"summary"` +} + type MakeProposalResponse struct { Message *string `ic:"message,omitempty" json:"message,omitempty"` ProposalId *NeuronId `ic:"proposal_id,omitempty" json:"proposal_id,omitempty"` @@ -895,6 +956,27 @@ type ManageNeuron struct { NeuronIdOrSubaccount *NeuronIdOrSubaccount `ic:"neuron_id_or_subaccount,omitempty" json:"neuron_id_or_subaccount,omitempty"` } +type ManageNeuronCommandRequest struct { + Spawn *Spawn `ic:"Spawn,variant"` + Split *Split `ic:"Split,variant"` + Follow *Follow `ic:"Follow,variant"` + ClaimOrRefresh *ClaimOrRefresh `ic:"ClaimOrRefresh,variant"` + Configure *Configure `ic:"Configure,variant"` + RegisterVote *RegisterVote `ic:"RegisterVote,variant"` + Merge *Merge `ic:"Merge,variant"` + DisburseToNeuron *DisburseToNeuron `ic:"DisburseToNeuron,variant"` + MakeProposal *MakeProposalRequest `ic:"MakeProposal,variant"` + StakeMaturity *StakeMaturity `ic:"StakeMaturity,variant"` + MergeMaturity *MergeMaturity `ic:"MergeMaturity,variant"` + Disburse *Disburse `ic:"Disburse,variant"` +} + +type ManageNeuronRequest struct { + Id *NeuronId `ic:"id,omitempty" json:"id,omitempty"` + Command *ManageNeuronCommandRequest `ic:"command,omitempty" json:"command,omitempty"` + NeuronIdOrSubaccount *NeuronIdOrSubaccount `ic:"neuron_id_or_subaccount,omitempty" json:"neuron_id_or_subaccount,omitempty"` +} + type ManageNeuronResponse struct { Command *Command1 `ic:"command,omitempty" json:"command,omitempty"` } @@ -930,9 +1012,14 @@ type Migrations struct { CopyInactiveNeuronsToStableMemoryMigration *Migration `ic:"copy_inactive_neurons_to_stable_memory_migration,omitempty" json:"copy_inactive_neurons_to_stable_memory_migration,omitempty"` } -type MostRecentMonthlyNodeProviderRewards struct { - Timestamp uint64 `ic:"timestamp" json:"timestamp"` - Rewards []RewardNodeProvider `ic:"rewards" json:"rewards"` +type MonthlyNodeProviderRewards struct { + MinimumXdrPermyriadPerIcp *uint64 `ic:"minimum_xdr_permyriad_per_icp,omitempty" json:"minimum_xdr_permyriad_per_icp,omitempty"` + RegistryVersion *uint64 `ic:"registry_version,omitempty" json:"registry_version,omitempty"` + NodeProviders []NodeProvider `ic:"node_providers" json:"node_providers"` + Timestamp uint64 `ic:"timestamp" json:"timestamp"` + Rewards []RewardNodeProvider `ic:"rewards" json:"rewards"` + XdrConversionRate *XdrConversionRate `ic:"xdr_conversion_rate,omitempty" json:"xdr_conversion_rate,omitempty"` + MaximumNodeProviderRewardsE8s *uint64 `ic:"maximum_node_provider_rewards_e8s,omitempty" json:"maximum_node_provider_rewards_e8s,omitempty"` } type Motion struct { @@ -973,6 +1060,7 @@ type Neuron struct { Field1 Followees `ic:"1" json:"1"` } `ic:"followees" json:"followees"` NeuronFeesE8s uint64 `ic:"neuron_fees_e8s" json:"neuron_fees_e8s"` + Visibility *int32 `ic:"visibility,omitempty" json:"visibility,omitempty"` Transfer *NeuronStakeTransfer `ic:"transfer,omitempty" json:"transfer,omitempty"` KnownNeuronData *KnownNeuronData `ic:"known_neuron_data,omitempty" json:"known_neuron_data,omitempty"` SpawnAtTimestampSeconds *uint64 `ic:"spawn_at_timestamp_seconds,omitempty" json:"spawn_at_timestamp_seconds,omitempty"` @@ -1019,6 +1107,7 @@ type NeuronInfo struct { StakeE8s uint64 `ic:"stake_e8s" json:"stake_e8s"` JoinedCommunityFundTimestampSeconds *uint64 `ic:"joined_community_fund_timestamp_seconds,omitempty" json:"joined_community_fund_timestamp_seconds,omitempty"` RetrievedAtTimestampSeconds uint64 `ic:"retrieved_at_timestamp_seconds" json:"retrieved_at_timestamp_seconds"` + Visibility *int32 `ic:"visibility,omitempty" json:"visibility,omitempty"` KnownNeuronData *KnownNeuronData `ic:"known_neuron_data,omitempty" json:"known_neuron_data,omitempty"` VotingPower uint64 `ic:"voting_power" json:"voting_power"` AgeSeconds uint64 `ic:"age_seconds" json:"age_seconds"` @@ -1034,6 +1123,34 @@ type NeuronStakeTransfer struct { BlockHeight uint64 `ic:"block_height" json:"block_height"` } +type NeuronSubsetMetrics struct { + TotalMaturityE8sEquivalent *uint64 `ic:"total_maturity_e8s_equivalent,omitempty" json:"total_maturity_e8s_equivalent,omitempty"` + MaturityE8sEquivalentBuckets []struct { + Field0 uint64 `ic:"0" json:"0"` + Field1 uint64 `ic:"1" json:"1"` + } `ic:"maturity_e8s_equivalent_buckets" json:"maturity_e8s_equivalent_buckets"` + VotingPowerBuckets []struct { + Field0 uint64 `ic:"0" json:"0"` + Field1 uint64 `ic:"1" json:"1"` + } `ic:"voting_power_buckets" json:"voting_power_buckets"` + TotalStakedE8s *uint64 `ic:"total_staked_e8s,omitempty" json:"total_staked_e8s,omitempty"` + Count *uint64 `ic:"count,omitempty" json:"count,omitempty"` + TotalStakedMaturityE8sEquivalent *uint64 `ic:"total_staked_maturity_e8s_equivalent,omitempty" json:"total_staked_maturity_e8s_equivalent,omitempty"` + StakedMaturityE8sEquivalentBuckets []struct { + Field0 uint64 `ic:"0" json:"0"` + Field1 uint64 `ic:"1" json:"1"` + } `ic:"staked_maturity_e8s_equivalent_buckets" json:"staked_maturity_e8s_equivalent_buckets"` + StakedE8sBuckets []struct { + Field0 uint64 `ic:"0" json:"0"` + Field1 uint64 `ic:"1" json:"1"` + } `ic:"staked_e8s_buckets" json:"staked_e8s_buckets"` + TotalVotingPower *uint64 `ic:"total_voting_power,omitempty" json:"total_voting_power,omitempty"` + CountBuckets []struct { + Field0 uint64 `ic:"0" json:"0"` + Field1 uint64 `ic:"1" json:"1"` + } `ic:"count_buckets" json:"count_buckets"` +} + type NeuronsFundAuditInfo struct { FinalNeuronsFundParticipation *NeuronsFundParticipation `ic:"final_neurons_fund_participation,omitempty" json:"final_neurons_fund_participation,omitempty"` InitialNeuronsFundParticipation *NeuronsFundParticipation `ic:"initial_neurons_fund_participation,omitempty" json:"initial_neurons_fund_participation,omitempty"` @@ -1060,18 +1177,20 @@ type NeuronsFundMatchedFundingCurveCoefficients struct { } type NeuronsFundNeuron struct { - HotkeyPrincipal *string `ic:"hotkey_principal,omitempty" json:"hotkey_principal,omitempty"` - IsCapped *bool `ic:"is_capped,omitempty" json:"is_capped,omitempty"` - NnsNeuronId *uint64 `ic:"nns_neuron_id,omitempty" json:"nns_neuron_id,omitempty"` - AmountIcpE8s *uint64 `ic:"amount_icp_e8s,omitempty" json:"amount_icp_e8s,omitempty"` + Controller *principal.Principal `ic:"controller,omitempty" json:"controller,omitempty"` + Hotkeys *Principals `ic:"hotkeys,omitempty" json:"hotkeys,omitempty"` + IsCapped *bool `ic:"is_capped,omitempty" json:"is_capped,omitempty"` + NnsNeuronId *uint64 `ic:"nns_neuron_id,omitempty" json:"nns_neuron_id,omitempty"` + AmountIcpE8s *uint64 `ic:"amount_icp_e8s,omitempty" json:"amount_icp_e8s,omitempty"` } type NeuronsFundNeuronPortion struct { - HotkeyPrincipal *principal.Principal `ic:"hotkey_principal,omitempty" json:"hotkey_principal,omitempty"` - IsCapped *bool `ic:"is_capped,omitempty" json:"is_capped,omitempty"` - MaturityEquivalentIcpE8s *uint64 `ic:"maturity_equivalent_icp_e8s,omitempty" json:"maturity_equivalent_icp_e8s,omitempty"` - NnsNeuronId *NeuronId `ic:"nns_neuron_id,omitempty" json:"nns_neuron_id,omitempty"` - AmountIcpE8s *uint64 `ic:"amount_icp_e8s,omitempty" json:"amount_icp_e8s,omitempty"` + Controller *principal.Principal `ic:"controller,omitempty" json:"controller,omitempty"` + Hotkeys []principal.Principal `ic:"hotkeys" json:"hotkeys"` + IsCapped *bool `ic:"is_capped,omitempty" json:"is_capped,omitempty"` + MaturityEquivalentIcpE8s *uint64 `ic:"maturity_equivalent_icp_e8s,omitempty" json:"maturity_equivalent_icp_e8s,omitempty"` + NnsNeuronId *NeuronId `ic:"nns_neuron_id,omitempty" json:"nns_neuron_id,omitempty"` + AmountIcpE8s *uint64 `ic:"amount_icp_e8s,omitempty" json:"amount_icp_e8s,omitempty"` } type NeuronsFundParticipation struct { @@ -1117,6 +1236,7 @@ type Operation struct { StartDissolving *struct { } `ic:"StartDissolving,variant"` IncreaseDissolveDelay *IncreaseDissolveDelay `ic:"IncreaseDissolveDelay,variant"` + SetVisibility *SetVisibility `ic:"SetVisibility,variant"` JoinCommunityFund *struct { } `ic:"JoinCommunityFund,variant"` LeaveCommunityFund *struct { @@ -1142,6 +1262,10 @@ type Percentage struct { BasisPoints *uint64 `ic:"basis_points,omitempty" json:"basis_points,omitempty"` } +type Principals struct { + Principals []principal.Principal `ic:"principals" json:"principals"` +} + type Progress struct { LastNeuronId *NeuronId `ic:"LastNeuronId,variant"` } @@ -1153,11 +1277,26 @@ type Proposal struct { Summary string `ic:"summary" json:"summary"` } +type ProposalActionRequest struct { + RegisterKnownNeuron *KnownNeuron `ic:"RegisterKnownNeuron,variant"` + ManageNeuron *ManageNeuronRequest `ic:"ManageNeuron,variant"` + UpdateCanisterSettings *UpdateCanisterSettings `ic:"UpdateCanisterSettings,variant"` + InstallCode *InstallCodeRequest `ic:"InstallCode,variant"` + StopOrStartCanister *StopOrStartCanister `ic:"StopOrStartCanister,variant"` + CreateServiceNervousSystem *CreateServiceNervousSystem `ic:"CreateServiceNervousSystem,variant"` + ExecuteNnsFunction *ExecuteNnsFunction `ic:"ExecuteNnsFunction,variant"` + RewardNodeProvider *RewardNodeProvider `ic:"RewardNodeProvider,variant"` + RewardNodeProviders *RewardNodeProviders `ic:"RewardNodeProviders,variant"` + ManageNetworkEconomics *NetworkEconomics `ic:"ManageNetworkEconomics,variant"` + ApproveGenesisKyc *Principals `ic:"ApproveGenesisKyc,variant"` + AddOrRemoveNodeProvider *AddOrRemoveNodeProvider `ic:"AddOrRemoveNodeProvider,variant"` + Motion *Motion `ic:"Motion,variant"` +} + type ProposalData struct { - Id *NeuronId `ic:"id,omitempty" json:"id,omitempty"` - FailureReason *GovernanceError `ic:"failure_reason,omitempty" json:"failure_reason,omitempty"` - CfParticipants []CfParticipant `ic:"cf_participants" json:"cf_participants"` - Ballots []struct { + Id *NeuronId `ic:"id,omitempty" json:"id,omitempty"` + FailureReason *GovernanceError `ic:"failure_reason,omitempty" json:"failure_reason,omitempty"` + Ballots []struct { Field0 uint64 `ic:"0" json:"0"` Field1 Ballot `ic:"1" json:"1"` } `ic:"ballots" json:"ballots"` @@ -1247,8 +1386,8 @@ type Result3 struct { } type Result4 struct { - Ok *RewardNodeProviders `ic:"Ok,variant"` - Err *GovernanceError `ic:"Err,variant"` + Ok *MonthlyNodeProviderRewards `ic:"Ok,variant"` + Err *GovernanceError `ic:"Err,variant"` } type Result5 struct { @@ -1332,6 +1471,10 @@ type SetSnsTokenSwapOpenTimeWindow struct { SwapCanisterId *principal.Principal `ic:"swap_canister_id,omitempty" json:"swap_canister_id,omitempty"` } +type SetVisibility struct { + Visibility *int32 `ic:"visibility,omitempty" json:"visibility,omitempty"` +} + type SettleCommunityFundParticipation struct { Result *Result8 `ic:"result,omitempty" json:"result,omitempty"` OpenSnsTokenSwapProposalId *uint64 `ic:"open_sns_token_swap_proposal_id,omitempty" json:"open_sns_token_swap_proposal_id,omitempty"` @@ -1369,6 +1512,11 @@ type StakeMaturityResponse struct { StakedMaturityE8s uint64 `ic:"staked_maturity_e8s" json:"staked_maturity_e8s"` } +type StopOrStartCanister struct { + Action *int32 `ic:"action,omitempty" json:"action,omitempty"` + CanisterId *principal.Principal `ic:"canister_id,omitempty" json:"canister_id,omitempty"` +} + type SwapBackgroundInformation struct { LedgerIndexCanisterSummary *CanisterSummary `ic:"ledger_index_canister_summary,omitempty" json:"ledger_index_canister_summary,omitempty"` FallbackControllerPrincipalIds []principal.Principal `ic:"fallback_controller_principal_ids" json:"fallback_controller_principal_ids"` @@ -1424,6 +1572,11 @@ type Tokens struct { E8s *uint64 `ic:"e8s,omitempty" json:"e8s,omitempty"` } +type UpdateCanisterSettings struct { + CanisterId *principal.Principal `ic:"canister_id,omitempty" json:"canister_id,omitempty"` + Settings *CanisterSettings `ic:"settings,omitempty" json:"settings,omitempty"` +} + type UpdateNodeProvider struct { RewardAccount *AccountIdentifier `ic:"reward_account,omitempty" json:"reward_account,omitempty"` } diff --git a/ic/ic/agent.go b/ic/ic/agent.go index 3ef4537..72efc6c 100755 --- a/ic/ic/agent.go +++ b/ic/ic/agent.go @@ -334,30 +334,6 @@ func (a Agent) EcdsaPublicKeyCall(arg0 EcdsaPublicKeyArgs) (*agent.CandidAPIRequ ) } -// FetchCanisterLogs calls the "fetch_canister_logs" method on the "ic" canister. -func (a Agent) FetchCanisterLogs(arg0 FetchCanisterLogsArgs) (*FetchCanisterLogsResult, error) { - var r0 FetchCanisterLogsResult - if err := a.Agent.Query( - a.CanisterId, - "fetch_canister_logs", - []any{arg0}, - []any{&r0}, - ); err != nil { - return nil, err - } - return &r0, nil -} - -// FetchCanisterLogsQuery creates an indirect representation of the "fetch_canister_logs" method on the "ic" canister. -func (a Agent) FetchCanisterLogsQuery(arg0 FetchCanisterLogsArgs) (*agent.CandidAPIRequest, error) { - return a.Agent.CreateCandidAPIRequest( - agent.RequestTypeQuery, - a.CanisterId, - "fetch_canister_logs", - arg0, - ) -} - // HttpRequest calls the "http_request" method on the "ic" canister. func (a Agent) HttpRequest(arg0 HttpRequestArgs) (*HttpRequestResult, error) { var r0 HttpRequestResult @@ -768,32 +744,12 @@ type CanisterInfoResult struct { Controllers []principal.Principal `ic:"controllers" json:"controllers"` } -type CanisterInstallMode struct { - Install *idl.Null `ic:"install,variant"` - Reinstall *idl.Null `ic:"reinstall,variant"` - Upgrade **struct { - SkipPreUpgrade *bool `ic:"skip_pre_upgrade,omitempty" json:"skip_pre_upgrade,omitempty"` - WasmMemoryPersistence *struct { - Keep *idl.Null `ic:"keep,variant"` - Replace *idl.Null `ic:"replace,variant"` - } `ic:"wasm_memory_persistence,omitempty" json:"wasm_memory_persistence,omitempty"` - } `ic:"upgrade,variant"` -} - -type CanisterLogRecord struct { - Idx uint64 `ic:"idx" json:"idx"` - TimestampNanos uint64 `ic:"timestamp_nanos" json:"timestamp_nanos"` - Content []byte `ic:"content" json:"content"` -} - type CanisterSettings struct { Controllers *[]principal.Principal `ic:"controllers,omitempty" json:"controllers,omitempty"` ComputeAllocation *idl.Nat `ic:"compute_allocation,omitempty" json:"compute_allocation,omitempty"` MemoryAllocation *idl.Nat `ic:"memory_allocation,omitempty" json:"memory_allocation,omitempty"` FreezingThreshold *idl.Nat `ic:"freezing_threshold,omitempty" json:"freezing_threshold,omitempty"` ReservedCyclesLimit *idl.Nat `ic:"reserved_cycles_limit,omitempty" json:"reserved_cycles_limit,omitempty"` - LogVisibility *LogVisibility `ic:"log_visibility,omitempty" json:"log_visibility,omitempty"` - WasmMemoryLimit *idl.Nat `ic:"wasm_memory_limit,omitempty" json:"wasm_memory_limit,omitempty"` } type CanisterStatusArgs struct { @@ -812,12 +768,6 @@ type CanisterStatusResult struct { Cycles idl.Nat `ic:"cycles" json:"cycles"` ReservedCycles idl.Nat `ic:"reserved_cycles" json:"reserved_cycles"` IdleCyclesBurnedPerDay idl.Nat `ic:"idle_cycles_burned_per_day" json:"idle_cycles_burned_per_day"` - QueryStats struct { - NumCallsTotal idl.Nat `ic:"num_calls_total" json:"num_calls_total"` - NumInstructionsTotal idl.Nat `ic:"num_instructions_total" json:"num_instructions_total"` - RequestPayloadBytesTotal idl.Nat `ic:"request_payload_bytes_total" json:"request_payload_bytes_total"` - ResponsePayloadBytesTotal idl.Nat `ic:"response_payload_bytes_total" json:"response_payload_bytes_total"` - } `ic:"query_stats" json:"query_stats"` } type Change struct { @@ -855,9 +805,7 @@ type ChangeOrigin struct { } `ic:"from_canister,variant"` } -type ChunkHash struct { - Hash []byte `ic:"hash" json:"hash"` -} +type ChunkHash = []byte type ClearChunkStoreArgs struct { CanisterId CanisterId `ic:"canister_id" json:"canister_id"` @@ -878,8 +826,6 @@ type DefiniteCanisterSettings struct { MemoryAllocation idl.Nat `ic:"memory_allocation" json:"memory_allocation"` FreezingThreshold idl.Nat `ic:"freezing_threshold" json:"freezing_threshold"` ReservedCyclesLimit idl.Nat `ic:"reserved_cycles_limit" json:"reserved_cycles_limit"` - LogVisibility LogVisibility `ic:"log_visibility" json:"log_visibility"` - WasmMemoryLimit idl.Nat `ic:"wasm_memory_limit" json:"wasm_memory_limit"` } type DeleteCanisterArgs struct { @@ -908,14 +854,6 @@ type EcdsaPublicKeyResult struct { ChainCode []byte `ic:"chain_code" json:"chain_code"` } -type FetchCanisterLogsArgs struct { - CanisterId CanisterId `ic:"canister_id" json:"canister_id"` -} - -type FetchCanisterLogsResult struct { - CanisterLogRecords []CanisterLogRecord `ic:"canister_log_records" json:"canister_log_records"` -} - type HttpHeader struct { Name string `ic:"name" json:"name"` Value string `ic:"value" json:"value"` @@ -945,34 +883,41 @@ type HttpRequestResult struct { } type InstallChunkedCodeArgs struct { - Mode CanisterInstallMode `ic:"mode" json:"mode"` - TargetCanister CanisterId `ic:"target_canister" json:"target_canister"` - StoreCanister *CanisterId `ic:"store_canister,omitempty" json:"store_canister,omitempty"` - ChunkHashesList []ChunkHash `ic:"chunk_hashes_list" json:"chunk_hashes_list"` - WasmModuleHash []byte `ic:"wasm_module_hash" json:"wasm_module_hash"` - Arg []byte `ic:"arg" json:"arg"` - SenderCanisterVersion *uint64 `ic:"sender_canister_version,omitempty" json:"sender_canister_version,omitempty"` + Mode struct { + Install *idl.Null `ic:"install,variant"` + Reinstall *idl.Null `ic:"reinstall,variant"` + Upgrade **struct { + SkipPreUpgrade *bool `ic:"skip_pre_upgrade,omitempty" json:"skip_pre_upgrade,omitempty"` + } `ic:"upgrade,variant"` + } `ic:"mode" json:"mode"` + TargetCanister CanisterId `ic:"target_canister" json:"target_canister"` + StorageCanister *CanisterId `ic:"storage_canister,omitempty" json:"storage_canister,omitempty"` + ChunkHashesList []ChunkHash `ic:"chunk_hashes_list" json:"chunk_hashes_list"` + WasmModuleHash []byte `ic:"wasm_module_hash" json:"wasm_module_hash"` + Arg []byte `ic:"arg" json:"arg"` + SenderCanisterVersion *uint64 `ic:"sender_canister_version,omitempty" json:"sender_canister_version,omitempty"` } type InstallCodeArgs struct { - Mode CanisterInstallMode `ic:"mode" json:"mode"` - CanisterId CanisterId `ic:"canister_id" json:"canister_id"` - WasmModule WasmModule `ic:"wasm_module" json:"wasm_module"` - Arg []byte `ic:"arg" json:"arg"` - SenderCanisterVersion *uint64 `ic:"sender_canister_version,omitempty" json:"sender_canister_version,omitempty"` -} - -type LogVisibility struct { - Controllers *idl.Null `ic:"controllers,variant"` - Public *idl.Null `ic:"public,variant"` + Mode struct { + Install *idl.Null `ic:"install,variant"` + Reinstall *idl.Null `ic:"reinstall,variant"` + Upgrade **struct { + SkipPreUpgrade *bool `ic:"skip_pre_upgrade,omitempty" json:"skip_pre_upgrade,omitempty"` + } `ic:"upgrade,variant"` + } `ic:"mode" json:"mode"` + CanisterId CanisterId `ic:"canister_id" json:"canister_id"` + WasmModule WasmModule `ic:"wasm_module" json:"wasm_module"` + Arg []byte `ic:"arg" json:"arg"` + SenderCanisterVersion *uint64 `ic:"sender_canister_version,omitempty" json:"sender_canister_version,omitempty"` } type MillisatoshiPerByte = uint64 type NodeMetrics struct { - NodeId principal.Principal `ic:"node_id" json:"node_id"` - NumBlocksProposedTotal uint64 `ic:"num_blocks_proposed_total" json:"num_blocks_proposed_total"` - NumBlockFailuresTotal uint64 `ic:"num_block_failures_total" json:"num_block_failures_total"` + NodeId principal.Principal `ic:"node_id" json:"node_id"` + NumBlocksTotal uint64 `ic:"num_blocks_total" json:"num_blocks_total"` + NumBlockFailuresTotal uint64 `ic:"num_block_failures_total" json:"num_block_failures_total"` } type NodeMetricsHistoryArgs struct { diff --git a/ic/icpledger/agent.go b/ic/icpledger/agent.go index b84ccf8..8649705 100755 --- a/ic/icpledger/agent.go +++ b/ic/icpledger/agent.go @@ -610,7 +610,8 @@ type Icrc21ConsentMessage struct { } type Icrc21ConsentMessageMetadata struct { - Language string `ic:"language" json:"language"` + Language string `ic:"language" json:"language"` + UtcOffsetMinutes *int16 `ic:"utc_offset_minutes,omitempty" json:"utc_offset_minutes,omitempty"` } type Icrc21ConsentMessageRequest struct { @@ -855,9 +856,8 @@ type TransferResult struct { } type UpgradeArgs struct { - MaximumNumberOfAccounts *uint64 `ic:"maximum_number_of_accounts,omitempty" json:"maximum_number_of_accounts,omitempty"` - Icrc1MintingAccount *Account `ic:"icrc1_minting_account,omitempty" json:"icrc1_minting_account,omitempty"` - FeatureFlags *FeatureFlags `ic:"feature_flags,omitempty" json:"feature_flags,omitempty"` + Icrc1MintingAccount *Account `ic:"icrc1_minting_account,omitempty" json:"icrc1_minting_account,omitempty"` + FeatureFlags *FeatureFlags `ic:"feature_flags,omitempty" json:"feature_flags,omitempty"` } type Value struct { diff --git a/ic/registry/agent.go b/ic/registry/agent.go index 7592519..3a3a335 100755 --- a/ic/registry/agent.go +++ b/ic/registry/agent.go @@ -154,19 +154,6 @@ func (a Agent) AddOrRemoveDataCenters(arg0 AddOrRemoveDataCentersProposalPayload return nil } -// BlessReplicaVersion calls the "bless_replica_version" method on the "registry" canister. -func (a Agent) BlessReplicaVersion(arg0 BlessReplicaVersionPayload) error { - if err := a.Agent.Call( - a.CanisterId, - "bless_replica_version", - []any{arg0}, - []any{}, - ); err != nil { - return err - } - return nil -} - // ChangeSubnetMembership calls the "change_subnet_membership" method on the "registry" canister. func (a Agent) ChangeSubnetMembership(arg0 ChangeSubnetMembershipPayload) error { if err := a.Agent.Call( @@ -245,6 +232,46 @@ func (a Agent) DeployGuestosToAllUnassignedNodes(arg0 DeployGuestosToAllUnassign return nil } +// DeployGuestosToSomeApiBoundaryNodes calls the "deploy_guestos_to_some_api_boundary_nodes" method on the "registry" canister. +func (a Agent) DeployGuestosToSomeApiBoundaryNodes(arg0 DeployGuestosToSomeApiBoundaryNodes) error { + if err := a.Agent.Call( + a.CanisterId, + "deploy_guestos_to_some_api_boundary_nodes", + []any{arg0}, + []any{}, + ); err != nil { + return err + } + return nil +} + +// DeployHostosToSomeNodes calls the "deploy_hostos_to_some_nodes" method on the "registry" canister. +func (a Agent) DeployHostosToSomeNodes(arg0 DeployHostosToSomeNodes) error { + if err := a.Agent.Call( + a.CanisterId, + "deploy_hostos_to_some_nodes", + []any{arg0}, + []any{}, + ); err != nil { + return err + } + return nil +} + +// GetApiBoundaryNodeIds calls the "get_api_boundary_node_ids" method on the "registry" canister. +func (a Agent) GetApiBoundaryNodeIds(arg0 GetApiBoundaryNodeIdsRequest) (*GetApiBoundaryNodeIdsResponse, error) { + var r0 GetApiBoundaryNodeIdsResponse + if err := a.Agent.Query( + a.CanisterId, + "get_api_boundary_node_ids", + []any{arg0}, + []any{&r0}, + ); err != nil { + return nil, err + } + return &r0, nil +} + // GetBuildMetadata calls the "get_build_metadata" method on the "registry" canister. func (a Agent) GetBuildMetadata() (*string, error) { var r0 string @@ -418,11 +445,24 @@ func (a Agent) RerouteCanisterRanges(arg0 RerouteCanisterRangesPayload) error { return nil } -// RetireReplicaVersion calls the "retire_replica_version" method on the "registry" canister. -func (a Agent) RetireReplicaVersion(arg0 RetireReplicaVersionPayload) error { +// ReviseElectedGuestosVersions calls the "revise_elected_guestos_versions" method on the "registry" canister. +func (a Agent) ReviseElectedGuestosVersions(arg0 ReviseElectedGuestosVersionsPayload) error { if err := a.Agent.Call( a.CanisterId, - "retire_replica_version", + "revise_elected_guestos_versions", + []any{arg0}, + []any{}, + ); err != nil { + return err + } + return nil +} + +// ReviseElectedHostosVersions calls the "revise_elected_hostos_versions" method on the "registry" canister. +func (a Agent) ReviseElectedHostosVersions(arg0 ReviseElectedHostosVersionsPayload) error { + if err := a.Agent.Call( + a.CanisterId, + "revise_elected_hostos_versions", []any{arg0}, []any{}, ); err != nil { @@ -483,19 +523,6 @@ func (a Agent) UpdateElectedHostosVersions(arg0 UpdateElectedHostosVersionsPaylo return nil } -// UpdateElectedReplicaVersions calls the "update_elected_replica_versions" method on the "registry" canister. -func (a Agent) UpdateElectedReplicaVersions(arg0 ReviseElectedGuestosVersionsPayload) error { - if err := a.Agent.Call( - a.CanisterId, - "update_elected_replica_versions", - []any{arg0}, - []any{}, - ); err != nil { - return err - } - return nil -} - // UpdateFirewallRules calls the "update_firewall_rules" method on the "registry" canister. func (a Agent) UpdateFirewallRules(arg0 UpdateFirewallRulesPayload) error { if err := a.Agent.Call( @@ -628,19 +655,6 @@ func (a Agent) UpdateSubnet(arg0 UpdateSubnetPayload) error { return nil } -// UpdateSubnetReplicaVersion calls the "update_subnet_replica_version" method on the "registry" canister. -func (a Agent) UpdateSubnetReplicaVersion(arg0 DeployGuestosToAllSubnetNodesPayload) error { - if err := a.Agent.Call( - a.CanisterId, - "update_subnet_replica_version", - []any{arg0}, - []any{}, - ); err != nil { - return err - } - return nil -} - // UpdateUnassignedNodesConfig calls the "update_unassigned_nodes_config" method on the "registry" canister. func (a Agent) UpdateUnassignedNodesConfig(arg0 UpdateUnassignedNodesConfigPayload) error { if err := a.Agent.Call( @@ -654,16 +668,8 @@ func (a Agent) UpdateUnassignedNodesConfig(arg0 UpdateUnassignedNodesConfigPaylo return nil } -type BlessReplicaVersionPayload struct { - ReleasePackageUrls *[]string `ic:"release_package_urls,omitempty" json:"release_package_urls,omitempty"` - NodeManagerSha256Hex string `ic:"node_manager_sha256_hex" json:"node_manager_sha256_hex"` - ReleasePackageUrl string `ic:"release_package_url" json:"release_package_url"` - Sha256Hex string `ic:"sha256_hex" json:"sha256_hex"` - GuestLaunchMeasurementSha256Hex *string `ic:"guest_launch_measurement_sha256_hex,omitempty" json:"guest_launch_measurement_sha256_hex,omitempty"` - ReplicaVersionId string `ic:"replica_version_id" json:"replica_version_id"` - ReleasePackageSha256Hex string `ic:"release_package_sha256_hex" json:"release_package_sha256_hex"` - NodeManagerBinaryUrl string `ic:"node_manager_binary_url" json:"node_manager_binary_url"` - BinaryUrl string `ic:"binary_url" json:"binary_url"` +type ApiBoundaryNodeIdRecord struct { + Id *principal.Principal `ic:"id,omitempty" json:"id,omitempty"` } type CanisterIdRange struct { @@ -671,6 +677,12 @@ type CanisterIdRange struct { Start principal.Principal `ic:"start" json:"start"` } +type ChainKeyConfig struct { + KeyConfigs []KeyConfig `ic:"key_configs" json:"key_configs"` + SignatureRequestTimeoutNs *uint64 `ic:"signature_request_timeout_ns,omitempty" json:"signature_request_timeout_ns,omitempty"` + IdkgKeyRotationPeriodMs *uint64 `ic:"idkg_key_rotation_period_ms,omitempty" json:"idkg_key_rotation_period_ms,omitempty"` +} + type ChangeSubnetMembershipPayload struct { NodeIdsAdd []principal.Principal `ic:"node_ids_add" json:"node_ids_add"` SubnetId principal.Principal `ic:"subnet_id" json:"subnet_id"` @@ -683,36 +695,34 @@ type CompleteCanisterMigrationPayload struct { } type CreateSubnetPayload struct { - UnitDelayMillis uint64 `ic:"unit_delay_millis" json:"unit_delay_millis"` - MaxInstructionsPerRound uint64 `ic:"max_instructions_per_round" json:"max_instructions_per_round"` - Features SubnetFeatures `ic:"features" json:"features"` - MaxInstructionsPerMessage uint64 `ic:"max_instructions_per_message" json:"max_instructions_per_message"` - GossipRegistryPollPeriodMs uint32 `ic:"gossip_registry_poll_period_ms" json:"gossip_registry_poll_period_ms"` - MaxIngressBytesPerMessage uint64 `ic:"max_ingress_bytes_per_message" json:"max_ingress_bytes_per_message"` - DkgDealingsPerBlock uint64 `ic:"dkg_dealings_per_block" json:"dkg_dealings_per_block"` - MaxBlockPayloadSize uint64 `ic:"max_block_payload_size" json:"max_block_payload_size"` - MaxInstructionsPerInstallCode uint64 `ic:"max_instructions_per_install_code" json:"max_instructions_per_install_code"` - StartAsNns bool `ic:"start_as_nns" json:"start_as_nns"` - IsHalted bool `ic:"is_halted" json:"is_halted"` - GossipPfnEvaluationPeriodMs uint32 `ic:"gossip_pfn_evaluation_period_ms" json:"gossip_pfn_evaluation_period_ms"` - MaxIngressMessagesPerBlock uint64 `ic:"max_ingress_messages_per_block" json:"max_ingress_messages_per_block"` - MaxNumberOfCanisters uint64 `ic:"max_number_of_canisters" json:"max_number_of_canisters"` - EcdsaConfig *EcdsaInitialConfig `ic:"ecdsa_config,omitempty" json:"ecdsa_config,omitempty"` - GossipMaxArtifactStreamsPerPeer uint32 `ic:"gossip_max_artifact_streams_per_peer" json:"gossip_max_artifact_streams_per_peer"` - ReplicaVersionId string `ic:"replica_version_id" json:"replica_version_id"` - GossipMaxDuplicity uint32 `ic:"gossip_max_duplicity" json:"gossip_max_duplicity"` - GossipMaxChunkWaitMs uint32 `ic:"gossip_max_chunk_wait_ms" json:"gossip_max_chunk_wait_ms"` - DkgIntervalLength uint64 `ic:"dkg_interval_length" json:"dkg_interval_length"` - SubnetIdOverride *principal.Principal `ic:"subnet_id_override,omitempty" json:"subnet_id_override,omitempty"` - SshBackupAccess []string `ic:"ssh_backup_access" json:"ssh_backup_access"` - IngressBytesPerBlockSoftCap uint64 `ic:"ingress_bytes_per_block_soft_cap" json:"ingress_bytes_per_block_soft_cap"` - InitialNotaryDelayMillis uint64 `ic:"initial_notary_delay_millis" json:"initial_notary_delay_millis"` - GossipMaxChunkSize uint32 `ic:"gossip_max_chunk_size" json:"gossip_max_chunk_size"` - SubnetType SubnetType `ic:"subnet_type" json:"subnet_type"` - SshReadonlyAccess []string `ic:"ssh_readonly_access" json:"ssh_readonly_access"` - GossipRetransmissionRequestMs uint32 `ic:"gossip_retransmission_request_ms" json:"gossip_retransmission_request_ms"` - GossipReceiveCheckCacheSize uint32 `ic:"gossip_receive_check_cache_size" json:"gossip_receive_check_cache_size"` - NodeIds []principal.Principal `ic:"node_ids" json:"node_ids"` + UnitDelayMillis uint64 `ic:"unit_delay_millis" json:"unit_delay_millis"` + Features SubnetFeatures `ic:"features" json:"features"` + GossipRegistryPollPeriodMs uint32 `ic:"gossip_registry_poll_period_ms" json:"gossip_registry_poll_period_ms"` + MaxIngressBytesPerMessage uint64 `ic:"max_ingress_bytes_per_message" json:"max_ingress_bytes_per_message"` + DkgDealingsPerBlock uint64 `ic:"dkg_dealings_per_block" json:"dkg_dealings_per_block"` + MaxBlockPayloadSize uint64 `ic:"max_block_payload_size" json:"max_block_payload_size"` + StartAsNns bool `ic:"start_as_nns" json:"start_as_nns"` + IsHalted bool `ic:"is_halted" json:"is_halted"` + GossipPfnEvaluationPeriodMs uint32 `ic:"gossip_pfn_evaluation_period_ms" json:"gossip_pfn_evaluation_period_ms"` + MaxIngressMessagesPerBlock uint64 `ic:"max_ingress_messages_per_block" json:"max_ingress_messages_per_block"` + MaxNumberOfCanisters uint64 `ic:"max_number_of_canisters" json:"max_number_of_canisters"` + EcdsaConfig *EcdsaInitialConfig `ic:"ecdsa_config,omitempty" json:"ecdsa_config,omitempty"` + ChainKeyConfig *InitialChainKeyConfig `ic:"chain_key_config,omitempty" json:"chain_key_config,omitempty"` + GossipMaxArtifactStreamsPerPeer uint32 `ic:"gossip_max_artifact_streams_per_peer" json:"gossip_max_artifact_streams_per_peer"` + ReplicaVersionId string `ic:"replica_version_id" json:"replica_version_id"` + GossipMaxDuplicity uint32 `ic:"gossip_max_duplicity" json:"gossip_max_duplicity"` + GossipMaxChunkWaitMs uint32 `ic:"gossip_max_chunk_wait_ms" json:"gossip_max_chunk_wait_ms"` + DkgIntervalLength uint64 `ic:"dkg_interval_length" json:"dkg_interval_length"` + SubnetIdOverride *principal.Principal `ic:"subnet_id_override,omitempty" json:"subnet_id_override,omitempty"` + SshBackupAccess []string `ic:"ssh_backup_access" json:"ssh_backup_access"` + IngressBytesPerBlockSoftCap uint64 `ic:"ingress_bytes_per_block_soft_cap" json:"ingress_bytes_per_block_soft_cap"` + InitialNotaryDelayMillis uint64 `ic:"initial_notary_delay_millis" json:"initial_notary_delay_millis"` + GossipMaxChunkSize uint32 `ic:"gossip_max_chunk_size" json:"gossip_max_chunk_size"` + SubnetType SubnetType `ic:"subnet_type" json:"subnet_type"` + SshReadonlyAccess []string `ic:"ssh_readonly_access" json:"ssh_readonly_access"` + GossipRetransmissionRequestMs uint32 `ic:"gossip_retransmission_request_ms" json:"gossip_retransmission_request_ms"` + GossipReceiveCheckCacheSize uint32 `ic:"gossip_receive_check_cache_size" json:"gossip_receive_check_cache_size"` + NodeIds []principal.Principal `ic:"node_ids" json:"node_ids"` } type DataCenterRecord struct { @@ -722,10 +732,6 @@ type DataCenterRecord struct { Owner string `ic:"owner" json:"owner"` } -type DeleteSubnetPayload struct { - SubnetId *principal.Principal `ic:"subnet_id,omitempty" json:"subnet_id,omitempty"` -} - type DeployGuestosToAllSubnetNodesPayload struct { SubnetId principal.Principal `ic:"subnet_id" json:"subnet_id"` ReplicaVersionId string `ic:"replica_version_id" json:"replica_version_id"` @@ -735,6 +741,16 @@ type DeployGuestosToAllUnassignedNodesPayload struct { ElectedReplicaVersion string `ic:"elected_replica_version" json:"elected_replica_version"` } +type DeployGuestosToSomeApiBoundaryNodes struct { + Version string `ic:"version" json:"version"` + NodeIds []principal.Principal `ic:"node_ids" json:"node_ids"` +} + +type DeployHostosToSomeNodes struct { + HostosVersionId *string `ic:"hostos_version_id,omitempty" json:"hostos_version_id,omitempty"` + NodeIds []principal.Principal `ic:"node_ids" json:"node_ids"` +} + type EcdsaConfig struct { QuadruplesToCreateInAdvance uint32 `ic:"quadruples_to_create_in_advance" json:"quadruples_to_create_in_advance"` MaxQueueSize *uint32 `ic:"max_queue_size,omitempty" json:"max_queue_size,omitempty"` @@ -783,6 +799,14 @@ type FirewallRulesScope struct { Global *idl.Null `ic:"Global,variant"` } +type GetApiBoundaryNodeIdsRequest struct { +} + +type GetApiBoundaryNodeIdsResponse struct { + Ok *[]ApiBoundaryNodeIdRecord `ic:"Ok,variant"` + Err *string `ic:"Err,variant"` +} + type GetNodeOperatorsAndDcsOfNodeProviderResponse struct { Ok *[]struct { Field0 DataCenterRecord `ic:"0" json:"0"` @@ -818,6 +842,28 @@ type IPv4Config struct { IpAddr string `ic:"ip_addr" json:"ip_addr"` } +type InitialChainKeyConfig struct { + KeyConfigs []KeyConfigRequest `ic:"key_configs" json:"key_configs"` + SignatureRequestTimeoutNs *uint64 `ic:"signature_request_timeout_ns,omitempty" json:"signature_request_timeout_ns,omitempty"` + IdkgKeyRotationPeriodMs *uint64 `ic:"idkg_key_rotation_period_ms,omitempty" json:"idkg_key_rotation_period_ms,omitempty"` +} + +type KeyConfig struct { + KeyId *MasterPublicKeyId `ic:"key_id,omitempty" json:"key_id,omitempty"` + PreSignaturesToCreateInAdvance *uint32 `ic:"pre_signatures_to_create_in_advance,omitempty" json:"pre_signatures_to_create_in_advance,omitempty"` + MaxQueueSize *uint32 `ic:"max_queue_size,omitempty" json:"max_queue_size,omitempty"` +} + +type KeyConfigRequest struct { + KeyConfig *KeyConfig `ic:"key_config,omitempty" json:"key_config,omitempty"` + SubnetId *principal.Principal `ic:"subnet_id,omitempty" json:"subnet_id,omitempty"` +} + +type MasterPublicKeyId struct { + Schnorr *SchnorrKeyId `ic:"Schnorr,variant"` + Ecdsa *EcdsaKeyId `ic:"Ecdsa,variant"` +} + type NodeOperatorRecord struct { Ipv6 *string `ic:"ipv6,omitempty" json:"ipv6,omitempty"` NodeOperatorPrincipalId []byte `ic:"node_operator_principal_id" json:"node_operator_principal_id"` @@ -835,6 +881,7 @@ type NodeProvidersMonthlyXdrRewards struct { Field0 string `ic:"0" json:"0"` Field1 uint64 `ic:"1" json:"1"` } `ic:"rewards" json:"rewards"` + RegistryVersion *uint64 `ic:"registry_version,omitempty" json:"registry_version,omitempty"` } type NodeRewardRate struct { @@ -864,9 +911,10 @@ type RecoverSubnetPayload struct { Field1 string `ic:"1" json:"1"` Field2 uint64 `ic:"2" json:"2"` } `ic:"registry_store_uri,omitempty" json:"registry_store_uri,omitempty"` - EcdsaConfig *EcdsaInitialConfig `ic:"ecdsa_config,omitempty" json:"ecdsa_config,omitempty"` - StateHash []byte `ic:"state_hash" json:"state_hash"` - TimeNs uint64 `ic:"time_ns" json:"time_ns"` + EcdsaConfig *EcdsaInitialConfig `ic:"ecdsa_config,omitempty" json:"ecdsa_config,omitempty"` + ChainKeyConfig *InitialChainKeyConfig `ic:"chain_key_config,omitempty" json:"chain_key_config,omitempty"` + StateHash []byte `ic:"state_hash" json:"state_hash"` + TimeNs uint64 `ic:"time_ns" json:"time_ns"` } type RemoveApiBoundaryNodesPayload struct { @@ -901,10 +949,6 @@ type RerouteCanisterRangesPayload struct { DestinationSubnet principal.Principal `ic:"destination_subnet" json:"destination_subnet"` } -type RetireReplicaVersionPayload struct { - ReplicaVersionIds []string `ic:"replica_version_ids" json:"replica_version_ids"` -} - type ReviseElectedGuestosVersionsPayload struct { ReleasePackageUrls []string `ic:"release_package_urls" json:"release_package_urls"` ReplicaVersionsToUnelect []string `ic:"replica_versions_to_unelect" json:"replica_versions_to_unelect"` @@ -913,6 +957,23 @@ type ReviseElectedGuestosVersionsPayload struct { ReleasePackageSha256Hex *string `ic:"release_package_sha256_hex,omitempty" json:"release_package_sha256_hex,omitempty"` } +type ReviseElectedHostosVersionsPayload struct { + ReleasePackageUrls []string `ic:"release_package_urls" json:"release_package_urls"` + HostosVersionToElect *string `ic:"hostos_version_to_elect,omitempty" json:"hostos_version_to_elect,omitempty"` + HostosVersionsToUnelect []string `ic:"hostos_versions_to_unelect" json:"hostos_versions_to_unelect"` + ReleasePackageSha256Hex *string `ic:"release_package_sha256_hex,omitempty" json:"release_package_sha256_hex,omitempty"` +} + +type SchnorrAlgorithm struct { + Ed25519 *idl.Null `ic:"ed25519,variant"` + Bip340secp256k1 *idl.Null `ic:"bip340secp256k1,variant"` +} + +type SchnorrKeyId struct { + Algorithm SchnorrAlgorithm `ic:"algorithm" json:"algorithm"` + Name string `ic:"name" json:"name"` +} + type SetFirewallConfigPayload struct { Ipv4Prefixes []string `ic:"ipv4_prefixes" json:"ipv4_prefixes"` FirewallConfig string `ic:"firewall_config" json:"firewall_config"` @@ -1009,37 +1070,37 @@ type UpdateSshReadOnlyAccessForAllUnassignedNodesPayload struct { } type UpdateSubnetPayload struct { - UnitDelayMillis *uint64 `ic:"unit_delay_millis,omitempty" json:"unit_delay_millis,omitempty"` - MaxDuplicity *uint32 `ic:"max_duplicity,omitempty" json:"max_duplicity,omitempty"` - MaxInstructionsPerRound *uint64 `ic:"max_instructions_per_round,omitempty" json:"max_instructions_per_round,omitempty"` - Features *SubnetFeatures `ic:"features,omitempty" json:"features,omitempty"` - SetGossipConfigToDefault bool `ic:"set_gossip_config_to_default" json:"set_gossip_config_to_default"` - MaxInstructionsPerMessage *uint64 `ic:"max_instructions_per_message,omitempty" json:"max_instructions_per_message,omitempty"` - HaltAtCupHeight *bool `ic:"halt_at_cup_height,omitempty" json:"halt_at_cup_height,omitempty"` - PfnEvaluationPeriodMs *uint32 `ic:"pfn_evaluation_period_ms,omitempty" json:"pfn_evaluation_period_ms,omitempty"` - SubnetId principal.Principal `ic:"subnet_id" json:"subnet_id"` - MaxIngressBytesPerMessage *uint64 `ic:"max_ingress_bytes_per_message,omitempty" json:"max_ingress_bytes_per_message,omitempty"` - DkgDealingsPerBlock *uint64 `ic:"dkg_dealings_per_block,omitempty" json:"dkg_dealings_per_block,omitempty"` - EcdsaKeySigningDisable *[]EcdsaKeyId `ic:"ecdsa_key_signing_disable,omitempty" json:"ecdsa_key_signing_disable,omitempty"` - MaxBlockPayloadSize *uint64 `ic:"max_block_payload_size,omitempty" json:"max_block_payload_size,omitempty"` - MaxInstructionsPerInstallCode *uint64 `ic:"max_instructions_per_install_code,omitempty" json:"max_instructions_per_install_code,omitempty"` - StartAsNns *bool `ic:"start_as_nns,omitempty" json:"start_as_nns,omitempty"` - IsHalted *bool `ic:"is_halted,omitempty" json:"is_halted,omitempty"` - MaxIngressMessagesPerBlock *uint64 `ic:"max_ingress_messages_per_block,omitempty" json:"max_ingress_messages_per_block,omitempty"` - MaxNumberOfCanisters *uint64 `ic:"max_number_of_canisters,omitempty" json:"max_number_of_canisters,omitempty"` - EcdsaConfig *EcdsaConfig `ic:"ecdsa_config,omitempty" json:"ecdsa_config,omitempty"` - RetransmissionRequestMs *uint32 `ic:"retransmission_request_ms,omitempty" json:"retransmission_request_ms,omitempty"` - DkgIntervalLength *uint64 `ic:"dkg_interval_length,omitempty" json:"dkg_interval_length,omitempty"` - RegistryPollPeriodMs *uint32 `ic:"registry_poll_period_ms,omitempty" json:"registry_poll_period_ms,omitempty"` - MaxChunkWaitMs *uint32 `ic:"max_chunk_wait_ms,omitempty" json:"max_chunk_wait_ms,omitempty"` - ReceiveCheckCacheSize *uint32 `ic:"receive_check_cache_size,omitempty" json:"receive_check_cache_size,omitempty"` - EcdsaKeySigningEnable *[]EcdsaKeyId `ic:"ecdsa_key_signing_enable,omitempty" json:"ecdsa_key_signing_enable,omitempty"` - SshBackupAccess *[]string `ic:"ssh_backup_access,omitempty" json:"ssh_backup_access,omitempty"` - MaxChunkSize *uint32 `ic:"max_chunk_size,omitempty" json:"max_chunk_size,omitempty"` - InitialNotaryDelayMillis *uint64 `ic:"initial_notary_delay_millis,omitempty" json:"initial_notary_delay_millis,omitempty"` - MaxArtifactStreamsPerPeer *uint32 `ic:"max_artifact_streams_per_peer,omitempty" json:"max_artifact_streams_per_peer,omitempty"` - SubnetType *SubnetType `ic:"subnet_type,omitempty" json:"subnet_type,omitempty"` - SshReadonlyAccess *[]string `ic:"ssh_readonly_access,omitempty" json:"ssh_readonly_access,omitempty"` + UnitDelayMillis *uint64 `ic:"unit_delay_millis,omitempty" json:"unit_delay_millis,omitempty"` + MaxDuplicity *uint32 `ic:"max_duplicity,omitempty" json:"max_duplicity,omitempty"` + Features *SubnetFeatures `ic:"features,omitempty" json:"features,omitempty"` + SetGossipConfigToDefault bool `ic:"set_gossip_config_to_default" json:"set_gossip_config_to_default"` + HaltAtCupHeight *bool `ic:"halt_at_cup_height,omitempty" json:"halt_at_cup_height,omitempty"` + PfnEvaluationPeriodMs *uint32 `ic:"pfn_evaluation_period_ms,omitempty" json:"pfn_evaluation_period_ms,omitempty"` + SubnetId principal.Principal `ic:"subnet_id" json:"subnet_id"` + MaxIngressBytesPerMessage *uint64 `ic:"max_ingress_bytes_per_message,omitempty" json:"max_ingress_bytes_per_message,omitempty"` + DkgDealingsPerBlock *uint64 `ic:"dkg_dealings_per_block,omitempty" json:"dkg_dealings_per_block,omitempty"` + MaxBlockPayloadSize *uint64 `ic:"max_block_payload_size,omitempty" json:"max_block_payload_size,omitempty"` + StartAsNns *bool `ic:"start_as_nns,omitempty" json:"start_as_nns,omitempty"` + IsHalted *bool `ic:"is_halted,omitempty" json:"is_halted,omitempty"` + MaxIngressMessagesPerBlock *uint64 `ic:"max_ingress_messages_per_block,omitempty" json:"max_ingress_messages_per_block,omitempty"` + MaxNumberOfCanisters *uint64 `ic:"max_number_of_canisters,omitempty" json:"max_number_of_canisters,omitempty"` + RetransmissionRequestMs *uint32 `ic:"retransmission_request_ms,omitempty" json:"retransmission_request_ms,omitempty"` + DkgIntervalLength *uint64 `ic:"dkg_interval_length,omitempty" json:"dkg_interval_length,omitempty"` + RegistryPollPeriodMs *uint32 `ic:"registry_poll_period_ms,omitempty" json:"registry_poll_period_ms,omitempty"` + MaxChunkWaitMs *uint32 `ic:"max_chunk_wait_ms,omitempty" json:"max_chunk_wait_ms,omitempty"` + ReceiveCheckCacheSize *uint32 `ic:"receive_check_cache_size,omitempty" json:"receive_check_cache_size,omitempty"` + SshBackupAccess *[]string `ic:"ssh_backup_access,omitempty" json:"ssh_backup_access,omitempty"` + MaxChunkSize *uint32 `ic:"max_chunk_size,omitempty" json:"max_chunk_size,omitempty"` + InitialNotaryDelayMillis *uint64 `ic:"initial_notary_delay_millis,omitempty" json:"initial_notary_delay_millis,omitempty"` + MaxArtifactStreamsPerPeer *uint32 `ic:"max_artifact_streams_per_peer,omitempty" json:"max_artifact_streams_per_peer,omitempty"` + SubnetType *SubnetType `ic:"subnet_type,omitempty" json:"subnet_type,omitempty"` + SshReadonlyAccess *[]string `ic:"ssh_readonly_access,omitempty" json:"ssh_readonly_access,omitempty"` + ChainKeyConfig *ChainKeyConfig `ic:"chain_key_config,omitempty" json:"chain_key_config,omitempty"` + ChainKeySigningEnable *[]MasterPublicKeyId `ic:"chain_key_signing_enable,omitempty" json:"chain_key_signing_enable,omitempty"` + ChainKeySigningDisable *[]MasterPublicKeyId `ic:"chain_key_signing_disable,omitempty" json:"chain_key_signing_disable,omitempty"` + EcdsaConfig *EcdsaConfig `ic:"ecdsa_config,omitempty" json:"ecdsa_config,omitempty"` + EcdsaKeySigningEnable *[]EcdsaKeyId `ic:"ecdsa_key_signing_enable,omitempty" json:"ecdsa_key_signing_enable,omitempty"` + EcdsaKeySigningDisable *[]EcdsaKeyId `ic:"ecdsa_key_signing_disable,omitempty" json:"ecdsa_key_signing_disable,omitempty"` } type UpdateUnassignedNodesConfigPayload struct { diff --git a/ic/sns/agent.go b/ic/sns/agent.go index 999ae49..9dde42b 100755 --- a/ic/sns/agent.go +++ b/ic/sns/agent.go @@ -262,17 +262,6 @@ type Canister struct { Id *principal.Principal `ic:"id,omitempty" json:"id,omitempty"` } -type CfNeuron struct { - HasCreatedNeuronRecipes *bool `ic:"has_created_neuron_recipes,omitempty" json:"has_created_neuron_recipes,omitempty"` - NnsNeuronId uint64 `ic:"nns_neuron_id" json:"nns_neuron_id"` - AmountIcpE8s uint64 `ic:"amount_icp_e8s" json:"amount_icp_e8s"` -} - -type CfParticipant struct { - HotkeyPrincipal string `ic:"hotkey_principal" json:"hotkey_principal"` - CfNeurons []CfNeuron `ic:"cf_neurons" json:"cf_neurons"` -} - type Countries struct { IsoCodes []string `ic:"iso_codes" json:"iso_codes"` } @@ -434,10 +423,6 @@ type NeuronDistribution struct { VestingPeriodSeconds *uint64 `ic:"vesting_period_seconds,omitempty" json:"vesting_period_seconds,omitempty"` } -type NeuronsFundParticipants struct { - Participants []CfParticipant `ic:"participants" json:"participants"` -} - type NeuronsFundParticipationConstraints struct { CoefficientIntervals []LinearScalingCoefficient `ic:"coefficient_intervals" json:"coefficient_intervals"` MaxNeuronsFundParticipationIcpE8s *uint64 `ic:"max_neurons_fund_participation_icp_e8s,omitempty" json:"max_neurons_fund_participation_icp_e8s,omitempty"` @@ -504,7 +489,6 @@ type SnsInitPayload struct { TransactionFeeE8s *uint64 `ic:"transaction_fee_e8s,omitempty" json:"transaction_fee_e8s,omitempty"` DappCanisters *DappCanisters `ic:"dapp_canisters,omitempty" json:"dapp_canisters,omitempty"` NeuronsFundParticipationConstraints *NeuronsFundParticipationConstraints `ic:"neurons_fund_participation_constraints,omitempty" json:"neurons_fund_participation_constraints,omitempty"` - NeuronsFundParticipants *NeuronsFundParticipants `ic:"neurons_fund_participants,omitempty" json:"neurons_fund_participants,omitempty"` MaxAgeBonusPercentage *uint64 `ic:"max_age_bonus_percentage,omitempty" json:"max_age_bonus_percentage,omitempty"` InitialTokenDistribution *InitialTokenDistribution `ic:"initial_token_distribution,omitempty" json:"initial_token_distribution,omitempty"` RewardRateTransitionDurationSeconds *uint64 `ic:"reward_rate_transition_duration_seconds,omitempty" json:"reward_rate_transition_duration_seconds,omitempty"` diff --git a/ic/sns/governance/agent.go b/ic/sns/governance/agent.go index 2a7b1f6..7d07bbd 100755 --- a/ic/sns/governance/agent.go +++ b/ic/sns/governance/agent.go @@ -193,6 +193,27 @@ func (a Agent) CreateChunk(arg0 struct { return &r0, nil } +// CreateChunks calls the "create_chunks" method on the "governance" canister. +func (a Agent) CreateChunks(arg0 struct { + BatchId BatchId `ic:"batch_id" json:"batch_id"` + Content [][]byte `ic:"content" json:"content"` +}) (*struct { + ChunkIds []ChunkId `ic:"chunk_ids" json:"chunk_ids"` +}, error) { + var r0 struct { + ChunkIds []ChunkId `ic:"chunk_ids" json:"chunk_ids"` + } + if err := a.Agent.Call( + a.CanisterId, + "create_chunks", + []any{arg0}, + []any{&r0}, + ); err != nil { + return nil, err + } + return &r0, nil +} + // Deauthorize calls the "deauthorize" method on the "governance" canister. func (a Agent) Deauthorize(arg0 principal.Principal) error { if err := a.Agent.Call( diff --git a/ic/sns/ledger/agent.go b/ic/sns/ledger/agent.go index ae5e401..d3987c8 100755 --- a/ic/sns/ledger/agent.go +++ b/ic/sns/ledger/agent.go @@ -591,7 +591,8 @@ type Icrc21ConsentMessage struct { } type Icrc21ConsentMessageMetadata struct { - Language string `ic:"language" json:"language"` + Language string `ic:"language" json:"language"` + UtcOffsetMinutes *int16 `ic:"utc_offset_minutes,omitempty" json:"utc_offset_minutes,omitempty"` } type Icrc21ConsentMessageRequest struct { @@ -818,7 +819,6 @@ type UpgradeArgs struct { ChangeFeeCollector *ChangeFeeCollector `ic:"change_fee_collector,omitempty" json:"change_fee_collector,omitempty"` MaxMemoLength *uint16 `ic:"max_memo_length,omitempty" json:"max_memo_length,omitempty"` FeatureFlags *FeatureFlags `ic:"feature_flags,omitempty" json:"feature_flags,omitempty"` - MaximumNumberOfAccounts *uint64 `ic:"maximum_number_of_accounts,omitempty" json:"maximum_number_of_accounts,omitempty"` AccountsOverflowTrimQuantity *uint64 `ic:"accounts_overflow_trim_quantity,omitempty" json:"accounts_overflow_trim_quantity,omitempty"` ChangeArchiveOptions *ChangeArchiveOptions `ic:"change_archive_options,omitempty" json:"change_archive_options,omitempty"` } diff --git a/ic/sns/root/agent.go b/ic/sns/root/agent.go index 622a01e..865ac58 100755 --- a/ic/sns/root/agent.go +++ b/ic/sns/root/agent.go @@ -215,6 +215,8 @@ type DefiniteCanisterSettings struct { FreezingThreshold *idl.Nat `ic:"freezing_threshold,omitempty" json:"freezing_threshold,omitempty"` Controllers []principal.Principal `ic:"controllers" json:"controllers"` ReservedCyclesLimit *idl.Nat `ic:"reserved_cycles_limit,omitempty" json:"reserved_cycles_limit,omitempty"` + LogVisibility *LogVisibility `ic:"log_visibility,omitempty" json:"log_visibility,omitempty"` + WasmMemoryLimit *idl.Nat `ic:"wasm_memory_limit,omitempty" json:"wasm_memory_limit,omitempty"` MemoryAllocation *idl.Nat `ic:"memory_allocation,omitempty" json:"memory_allocation,omitempty"` ComputeAllocation *idl.Nat `ic:"compute_allocation,omitempty" json:"compute_allocation,omitempty"` } @@ -222,6 +224,7 @@ type DefiniteCanisterSettings struct { type DefiniteCanisterSettingsArgs struct { FreezingThreshold idl.Nat `ic:"freezing_threshold" json:"freezing_threshold"` Controllers []principal.Principal `ic:"controllers" json:"controllers"` + WasmMemoryLimit *idl.Nat `ic:"wasm_memory_limit,omitempty" json:"wasm_memory_limit,omitempty"` MemoryAllocation idl.Nat `ic:"memory_allocation" json:"memory_allocation"` ComputeAllocation idl.Nat `ic:"compute_allocation" json:"compute_allocation"` } @@ -255,6 +258,11 @@ type ListSnsCanistersResponse struct { Archives []principal.Principal `ic:"archives" json:"archives"` } +type LogVisibility struct { + Controllers *idl.Null `ic:"controllers,variant"` + Public *idl.Null `ic:"public,variant"` +} + type ManageDappCanisterSettingsRequest struct { FreezingThreshold *uint64 `ic:"freezing_threshold,omitempty" json:"freezing_threshold,omitempty"` CanisterIds []principal.Principal `ic:"canister_ids" json:"canister_ids"` @@ -287,12 +295,11 @@ type SetDappControllersResponse struct { } type SnsRootCanister struct { - DappCanisterIds []principal.Principal `ic:"dapp_canister_ids" json:"dapp_canister_ids"` - Testflight bool `ic:"testflight" json:"testflight"` - LatestLedgerArchivePollTimestampSeconds *uint64 `ic:"latest_ledger_archive_poll_timestamp_seconds,omitempty" json:"latest_ledger_archive_poll_timestamp_seconds,omitempty"` - ArchiveCanisterIds []principal.Principal `ic:"archive_canister_ids" json:"archive_canister_ids"` - GovernanceCanisterId *principal.Principal `ic:"governance_canister_id,omitempty" json:"governance_canister_id,omitempty"` - IndexCanisterId *principal.Principal `ic:"index_canister_id,omitempty" json:"index_canister_id,omitempty"` - SwapCanisterId *principal.Principal `ic:"swap_canister_id,omitempty" json:"swap_canister_id,omitempty"` - LedgerCanisterId *principal.Principal `ic:"ledger_canister_id,omitempty" json:"ledger_canister_id,omitempty"` + DappCanisterIds []principal.Principal `ic:"dapp_canister_ids" json:"dapp_canister_ids"` + Testflight bool `ic:"testflight" json:"testflight"` + ArchiveCanisterIds []principal.Principal `ic:"archive_canister_ids" json:"archive_canister_ids"` + GovernanceCanisterId *principal.Principal `ic:"governance_canister_id,omitempty" json:"governance_canister_id,omitempty"` + IndexCanisterId *principal.Principal `ic:"index_canister_id,omitempty" json:"index_canister_id,omitempty"` + SwapCanisterId *principal.Principal `ic:"swap_canister_id,omitempty" json:"swap_canister_id,omitempty"` + LedgerCanisterId *principal.Principal `ic:"ledger_canister_id,omitempty" json:"ledger_canister_id,omitempty"` } diff --git a/ic/sns/swap/agent.go b/ic/sns/swap/agent.go index 17708d5..0a1676b 100755 --- a/ic/sns/swap/agent.go +++ b/ic/sns/swap/agent.go @@ -205,8 +205,8 @@ func (a Agent) GetState(arg0 struct { } // ListCommunityFundParticipants calls the "list_community_fund_participants" method on the "swap" canister. -func (a Agent) ListCommunityFundParticipants(arg0 ListCommunityFundParticipantsRequest) (*NeuronsFundParticipants, error) { - var r0 NeuronsFundParticipants +func (a Agent) ListCommunityFundParticipants(arg0 ListCommunityFundParticipantsRequest) (*ListCommunityFundParticipantsResponse, error) { + var r0 ListCommunityFundParticipantsResponse if err := a.Agent.Query( a.CanisterId, "list_community_fund_participants", @@ -275,22 +275,6 @@ func (a Agent) NotifyPaymentFailure(arg0 struct { return &r0, nil } -// Open calls the "open" method on the "swap" canister. -func (a Agent) Open(arg0 OpenRequest) (*struct { -}, error) { - var r0 struct { - } - if err := a.Agent.Call( - a.CanisterId, - "open", - []any{arg0}, - []any{&r0}, - ); err != nil { - return nil, err - } - return &r0, nil -} - // RefreshBuyerTokens calls the "refresh_buyer_tokens" method on the "swap" canister. func (a Agent) RefreshBuyerTokens(arg0 RefreshBuyerTokensRequest) (*RefreshBuyerTokensResponse, error) { var r0 RefreshBuyerTokensResponse @@ -331,19 +315,23 @@ type CanisterStatusType struct { } type CfInvestment struct { - HotkeyPrincipal string `ic:"hotkey_principal" json:"hotkey_principal"` - NnsNeuronId uint64 `ic:"nns_neuron_id" json:"nns_neuron_id"` + Controller *principal.Principal `ic:"controller,omitempty" json:"controller,omitempty"` + HotkeyPrincipal string `ic:"hotkey_principal" json:"hotkey_principal"` + Hotkeys *Principals `ic:"hotkeys,omitempty" json:"hotkeys,omitempty"` + NnsNeuronId uint64 `ic:"nns_neuron_id" json:"nns_neuron_id"` } type CfNeuron struct { - HasCreatedNeuronRecipes *bool `ic:"has_created_neuron_recipes,omitempty" json:"has_created_neuron_recipes,omitempty"` - NnsNeuronId uint64 `ic:"nns_neuron_id" json:"nns_neuron_id"` - AmountIcpE8s uint64 `ic:"amount_icp_e8s" json:"amount_icp_e8s"` + HasCreatedNeuronRecipes *bool `ic:"has_created_neuron_recipes,omitempty" json:"has_created_neuron_recipes,omitempty"` + Hotkeys *Principals `ic:"hotkeys,omitempty" json:"hotkeys,omitempty"` + NnsNeuronId uint64 `ic:"nns_neuron_id" json:"nns_neuron_id"` + AmountIcpE8s uint64 `ic:"amount_icp_e8s" json:"amount_icp_e8s"` } type CfParticipant struct { - HotkeyPrincipal string `ic:"hotkey_principal" json:"hotkey_principal"` - CfNeurons []CfNeuron `ic:"cf_neurons" json:"cf_neurons"` + Controller *principal.Principal `ic:"controller,omitempty" json:"controller,omitempty"` + HotkeyPrincipal string `ic:"hotkey_principal" json:"hotkey_principal"` + CfNeurons []CfNeuron `ic:"cf_neurons" json:"cf_neurons"` } type Countries struct { @@ -353,6 +341,7 @@ type Countries struct { type DefiniteCanisterSettingsArgs struct { FreezingThreshold idl.Nat `ic:"freezing_threshold" json:"freezing_threshold"` Controllers []principal.Principal `ic:"controllers" json:"controllers"` + WasmMemoryLimit *idl.Nat `ic:"wasm_memory_limit,omitempty" json:"wasm_memory_limit,omitempty"` MemoryAllocation idl.Nat `ic:"memory_allocation" json:"memory_allocation"` ComputeAllocation idl.Nat `ic:"compute_allocation" json:"compute_allocation"` } @@ -499,7 +488,6 @@ type Init struct { IcpLedgerCanisterId string `ic:"icp_ledger_canister_id" json:"icp_ledger_canister_id"` SnsLedgerCanisterId string `ic:"sns_ledger_canister_id" json:"sns_ledger_canister_id"` NeuronsFundParticipationConstraints *NeuronsFundParticipationConstraints `ic:"neurons_fund_participation_constraints,omitempty" json:"neurons_fund_participation_constraints,omitempty"` - NeuronsFundParticipants *NeuronsFundParticipants `ic:"neurons_fund_participants,omitempty" json:"neurons_fund_participants,omitempty"` ShouldAutoFinalize *bool `ic:"should_auto_finalize,omitempty" json:"should_auto_finalize,omitempty"` MaxParticipantIcpE8s *uint64 `ic:"max_participant_icp_e8s,omitempty" json:"max_participant_icp_e8s,omitempty"` SnsGovernanceCanisterId string `ic:"sns_governance_canister_id" json:"sns_governance_canister_id"` @@ -532,6 +520,10 @@ type ListCommunityFundParticipantsRequest struct { Limit *uint32 `ic:"limit,omitempty" json:"limit,omitempty"` } +type ListCommunityFundParticipantsResponse struct { + CfParticipants []CfParticipant `ic:"cf_participants" json:"cf_participants"` +} + type ListDirectParticipantsRequest struct { Offset *uint32 `ic:"offset,omitempty" json:"offset,omitempty"` Limit *uint32 `ic:"limit,omitempty" json:"limit,omitempty"` @@ -565,10 +557,6 @@ type NeuronId struct { Id []byte `ic:"id" json:"id"` } -type NeuronsFundParticipants struct { - CfParticipants []CfParticipant `ic:"cf_participants" json:"cf_participants"` -} - type NeuronsFundParticipationConstraints struct { CoefficientIntervals []LinearScalingCoefficient `ic:"coefficient_intervals" json:"coefficient_intervals"` MaxNeuronsFundParticipationIcpE8s *uint64 `ic:"max_neurons_fund_participation_icp_e8s,omitempty" json:"max_neurons_fund_participation_icp_e8s,omitempty"` @@ -598,12 +586,6 @@ type Ok2 struct { Ticket *Ticket `ic:"ticket,omitempty" json:"ticket,omitempty"` } -type OpenRequest struct { - CfParticipants []CfParticipant `ic:"cf_participants" json:"cf_participants"` - Params *Params `ic:"params,omitempty" json:"params,omitempty"` - OpenSnsTokenSwapProposalId *uint64 `ic:"open_sns_token_swap_proposal_id,omitempty" json:"open_sns_token_swap_proposal_id,omitempty"` -} - type Params struct { MinParticipantIcpE8s uint64 `ic:"min_participant_icp_e8s" json:"min_participant_icp_e8s"` NeuronBasketConstructionParameters *NeuronBasketConstructionParameters `ic:"neuron_basket_construction_parameters,omitempty" json:"neuron_basket_construction_parameters,omitempty"` @@ -644,6 +626,10 @@ type Possibility3 struct { Err *CanisterCallError `ic:"Err,variant"` } +type Principals struct { + Principals []principal.Principal `ic:"principals" json:"principals"` +} + type RefreshBuyerTokensRequest struct { ConfirmationText *string `ic:"confirmation_text,omitempty" json:"confirmation_text,omitempty"` Buyer string `ic:"buyer" json:"buyer"` diff --git a/ic/sns/testdata/did/governance.did b/ic/sns/testdata/did/governance.did index 51bb1a2..ccf075f 100644 --- a/ic/sns/testdata/did/governance.did +++ b/ic/sns/testdata/did/governance.did @@ -199,6 +199,7 @@ service: (asset_canister_args: opt AssetCanisterArgs) -> { create_batch : (record {}) -> (record { batch_id: BatchId }); create_chunk: (record { batch_id: BatchId; content: blob }) -> (record { chunk_id: ChunkId }); + create_chunks: (record { batch_id: BatchId; content: vec blob }) -> (record { chunk_ids: vec ChunkId }); // Perform all operations successfully, or reject commit_batch: (CommitBatchArguments) -> (); diff --git a/ic/sns/testdata/did/ledger.did b/ic/sns/testdata/did/ledger.did index e2799db..ac3a7bf 100644 --- a/ic/sns/testdata/did/ledger.did +++ b/ic/sns/testdata/did/ledger.did @@ -144,7 +144,6 @@ type UpgradeArgs = record { change_fee_collector : opt ChangeFeeCollector; max_memo_length : opt nat16; feature_flags : opt FeatureFlags; - maximum_number_of_accounts: opt nat64; accounts_overflow_trim_quantity: opt nat64; change_archive_options : opt ChangeArchiveOptions; }; @@ -425,6 +424,63 @@ type ICRC3DataCertificate = record { hash_tree : blob; }; +type icrc21_consent_message_metadata = record { + language: text; + utc_offset_minutes: opt int16; +}; + +type icrc21_consent_message_spec = record { + metadata: icrc21_consent_message_metadata; + device_spec: opt variant { + GenericDisplay; + LineDisplay: record { + characters_per_line: nat16; + lines_per_page: nat16; + }; + }; +}; + +type icrc21_consent_message_request = record { + method: text; + arg: blob; + user_preferences: icrc21_consent_message_spec; +}; + +type icrc21_consent_message = variant { + GenericDisplayMessage: text; + LineDisplayMessage: record { + pages: vec record { + lines: vec text; + }; + }; +}; + +type icrc21_consent_info = record { + consent_message: icrc21_consent_message; + metadata: icrc21_consent_message_metadata; +}; + +type icrc21_error_info = record { + description: text; +}; + +type icrc21_error = variant { + UnsupportedCanisterCall: icrc21_error_info; + ConsentMessageUnavailable: icrc21_error_info; + InsufficientPayment: icrc21_error_info; + + // Any error not covered by the above variants. + GenericError: record { + error_code: nat; + description: text; + }; +}; + +type icrc21_consent_message_response = variant { + Ok: icrc21_consent_info; + Err: icrc21_error; +}; + service : (ledger_arg : LedgerArg) -> { archives : () -> (vec ArchiveInfo) query; get_transactions : (GetTransactionsRequest) -> (GetTransactionsResponse) query; @@ -450,4 +506,7 @@ service : (ledger_arg : LedgerArg) -> { icrc3_get_tip_certificate : () -> (opt ICRC3DataCertificate) query; icrc3_get_blocks : (vec GetBlocksArgs) -> (GetBlocksResult) query; icrc3_supported_block_types : () -> (vec record { block_type : text; url : text }) query; + + icrc21_canister_call_consent_message: (icrc21_consent_message_request) -> (icrc21_consent_message_response); + icrc10_supported_standards : () -> (vec record { name : text; url : text }) query; } diff --git a/ic/sns/testdata/did/root.did b/ic/sns/testdata/did/root.did index b8b96aa..75cbcfb 100644 --- a/ic/sns/testdata/did/root.did +++ b/ic/sns/testdata/did/root.did @@ -1,6 +1,18 @@ -type CanisterCallError = record { code : opt int32; description : text }; -type CanisterIdRecord = record { canister_id : principal }; -type CanisterInstallMode = variant { reinstall; upgrade; install }; +type CanisterCallError = record { + code : opt int32; + description : text; +}; + +type CanisterIdRecord = record { + canister_id : principal; +}; + +type CanisterInstallMode = variant { + reinstall; + upgrade; + install; +}; + type CanisterStatusResult = record { status : CanisterStatusType; memory_size : nat; @@ -10,6 +22,7 @@ type CanisterStatusResult = record { module_hash : opt blob; reserved_cycles : opt nat; }; + type CanisterStatusResultV2 = record { status : CanisterStatusType; memory_size : nat; @@ -18,11 +31,18 @@ type CanisterStatusResultV2 = record { idle_cycles_burned_per_day : nat; module_hash : opt blob; }; -type CanisterStatusType = variant { stopped; stopping; running }; + +type CanisterStatusType = variant { + stopped; + stopping; + running; +}; + type CanisterSummary = record { status : opt CanisterStatusResultV2; canister_id : opt principal; }; + type ChangeCanisterRequest = record { arg : blob; wasm_module : blob; @@ -32,24 +52,34 @@ type ChangeCanisterRequest = record { memory_allocation : opt nat; compute_allocation : opt nat; }; + type DefiniteCanisterSettings = record { freezing_threshold : opt nat; controllers : vec principal; reserved_cycles_limit : opt nat; + log_visibility : opt LogVisibility; + wasm_memory_limit : opt nat; memory_allocation : opt nat; compute_allocation : opt nat; }; + type DefiniteCanisterSettingsArgs = record { freezing_threshold : nat; controllers : vec principal; + wasm_memory_limit : opt nat; memory_allocation : nat; compute_allocation : nat; }; + type FailedUpdate = record { err : opt CanisterCallError; dapp_canister_id : opt principal; }; -type GetSnsCanistersSummaryRequest = record { update_canister_list : opt bool }; + +type GetSnsCanistersSummaryRequest = record { + update_canister_list : opt bool; +}; + type GetSnsCanistersSummaryResponse = record { root : opt CanisterSummary; swap : opt CanisterSummary; @@ -59,6 +89,7 @@ type GetSnsCanistersSummaryResponse = record { dapps : vec CanisterSummary; archives : vec CanisterSummary; }; + type ListSnsCanistersResponse = record { root : opt principal; swap : opt principal; @@ -68,6 +99,12 @@ type ListSnsCanistersResponse = record { dapps : vec principal; archives : vec principal; }; + +type LogVisibility = variant { + controllers; + public; +}; + type ManageDappCanisterSettingsRequest = record { freezing_threshold : opt nat64; canister_ids : vec principal; @@ -77,24 +114,38 @@ type ManageDappCanisterSettingsRequest = record { memory_allocation : opt nat64; compute_allocation : opt nat64; }; -type ManageDappCanisterSettingsResponse = record { failure_reason : opt text }; -type RegisterDappCanisterRequest = record { canister_id : opt principal }; -type RegisterDappCanistersRequest = record { canister_ids : vec principal }; + +type ManageDappCanisterSettingsResponse = record { + failure_reason : opt text; +}; + +type RegisterDappCanisterRequest = record { + canister_id : opt principal; +}; + +type RegisterDappCanistersRequest = record { + canister_ids : vec principal; +}; + type SetDappControllersRequest = record { canister_ids : opt RegisterDappCanistersRequest; controller_principal_ids : vec principal; }; -type SetDappControllersResponse = record { failed_updates : vec FailedUpdate }; + +type SetDappControllersResponse = record { + failed_updates : vec FailedUpdate; +}; + type SnsRootCanister = record { dapp_canister_ids : vec principal; testflight : bool; - latest_ledger_archive_poll_timestamp_seconds : opt nat64; archive_canister_ids : vec principal; governance_canister_id : opt principal; index_canister_id : opt principal; swap_canister_id : opt principal; ledger_canister_id : opt principal; }; + service : (SnsRootCanister) -> { canister_status : (CanisterIdRecord) -> (CanisterStatusResult); change_canister : (ChangeCanisterRequest) -> (); @@ -111,4 +162,4 @@ service : (SnsRootCanister) -> { set_dapp_controllers : (SetDappControllersRequest) -> ( SetDappControllersResponse, ); -} \ No newline at end of file +} diff --git a/ic/sns/testdata/did/sns.did b/ic/sns/testdata/did/sns.did index 88dfd79..7baa58b 100644 --- a/ic/sns/testdata/did/sns.did +++ b/ic/sns/testdata/did/sns.did @@ -1,30 +1,45 @@ -type AddWasmRequest = record { hash : blob; 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 { - has_created_neuron_recipes : opt bool; - 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 AddWasmRequest = record { + hash : blob; + wasm : opt SnsWasm; +}; + +type AddWasmResponse = record { + result : opt Result; +}; + +type AirdropDistribution = record { + airdrop_neurons : vec NeuronDistribution; +}; + +type Canister = record { + id : opt principal; +}; + +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 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; }; + type DeployedSns = record { root_canister_id : opt principal; governance_canister_id : opt principal; @@ -32,49 +47,89 @@ type DeployedSns = record { swap_canister_id : opt principal; ledger_canister_id : opt principal; }; + type DeveloperDistribution = record { developer_neurons : vec NeuronDistribution; }; + type FractionalDeveloperVotingPower = record { treasury_distribution : opt TreasuryDistribution; developer_distribution : opt DeveloperDistribution; airdrop_distribution : opt AirdropDistribution; swap_distribution : opt SwapDistribution; }; + type GetAllowedPrincipalsResponse = record { allowed_principals : vec principal; }; -type GetDeployedSnsByProposalIdRequest = record { proposal_id : nat64 }; + +type GetDeployedSnsByProposalIdRequest = record { + proposal_id : nat64; +}; + type GetDeployedSnsByProposalIdResponse = record { get_deployed_sns_by_proposal_id_result : opt GetDeployedSnsByProposalIdResult; }; + type GetDeployedSnsByProposalIdResult = variant { Error : SnsWasmError; DeployedSns : DeployedSns; }; + type GetNextSnsVersionRequest = record { governance_canister_id : opt principal; current_version : opt SnsVersion; }; -type GetNextSnsVersionResponse = record { next_version : opt SnsVersion }; -type GetProposalIdThatAddedWasmRequest = record { hash : blob }; -type GetProposalIdThatAddedWasmResponse = record { proposal_id : opt nat64 }; -type GetSnsSubnetIdsResponse = record { sns_subnet_ids : vec principal }; -type GetWasmMetadataRequest = record { hash : opt blob }; -type GetWasmMetadataResponse = record { result : opt Result_1 }; -type GetWasmRequest = record { hash : blob }; -type GetWasmResponse = record { wasm : opt SnsWasm }; + +type GetNextSnsVersionResponse = record { + next_version : opt SnsVersion; +}; + +type GetProposalIdThatAddedWasmRequest = record { + hash : blob; +}; + +type GetProposalIdThatAddedWasmResponse = record { + proposal_id : opt nat64; +}; + +type GetSnsSubnetIdsResponse = record { + sns_subnet_ids : vec principal; +}; + +type GetWasmMetadataRequest = record { + hash : opt blob; +}; + +type GetWasmMetadataResponse = record { + result : opt Result_1; +}; + +type GetWasmRequest = record { + hash : blob; +}; + +type GetWasmResponse = record { + wasm : opt SnsWasm; +}; + type IdealMatchedParticipationFunction = record { serialized_representation : opt text; }; + type InitialTokenDistribution = variant { FractionalDeveloperVotingPower : FractionalDeveloperVotingPower; }; + type InsertUpgradePathEntriesRequest = record { upgrade_path : vec SnsUpgrade; sns_governance_canister_id : opt principal; }; -type InsertUpgradePathEntriesResponse = record { error : opt SnsWasmError }; + +type InsertUpgradePathEntriesResponse = record { + error : opt SnsWasmError; +}; + type LinearScalingCoefficient = record { slope_numerator : opt nat64; intercept_icp_e8s : opt nat64; @@ -82,26 +137,37 @@ type LinearScalingCoefficient = record { slope_denominator : opt nat64; to_direct_participation_icp_e8s : opt nat64; }; -type ListDeployedSnsesResponse = record { instances : vec DeployedSns }; + +type ListDeployedSnsesResponse = record { + instances : vec DeployedSns; +}; + type ListUpgradeStep = record { pretty_version : opt PrettySnsVersion; version : opt SnsVersion; }; + type ListUpgradeStepsRequest = record { limit : nat32; starting_at : opt SnsVersion; sns_governance_canister_id : opt principal; }; -type ListUpgradeStepsResponse = record { steps : vec ListUpgradeStep }; + +type ListUpgradeStepsResponse = record { + steps : vec ListUpgradeStep; +}; + type MetadataSection = record { contents : opt blob; name : opt text; visibility : opt text; }; + type NeuronBasketConstructionParameters = record { dissolve_delay_interval_seconds : nat64; count : nat64; }; + type NeuronDistribution = record { controller : opt principal; dissolve_delay_seconds : nat64; @@ -109,14 +175,18 @@ type NeuronDistribution = record { stake_e8s : nat64; vesting_period_seconds : opt nat64; }; -type NeuronsFundParticipants = record { participants : vec CfParticipant }; + type NeuronsFundParticipationConstraints = record { coefficient_intervals : vec LinearScalingCoefficient; max_neurons_fund_participation_icp_e8s : opt nat64; min_direct_participation_threshold_icp_e8s : opt nat64; ideal_matched_participation_function : opt IdealMatchedParticipationFunction; }; -type Ok = record { sections : vec MetadataSection }; + +type Ok = record { + sections : vec MetadataSection; +}; + type PrettySnsVersion = record { archive_wasm_hash : text; root_wasm_hash : text; @@ -125,8 +195,17 @@ type PrettySnsVersion = record { governance_wasm_hash : text; index_wasm_hash : text; }; -type Result = variant { Error : SnsWasmError; Hash : blob }; -type Result_1 = variant { Ok : Ok; Error : SnsWasmError }; + +type Result = variant { + Error : SnsWasmError; + Hash : blob; +}; + +type Result_1 = variant { + Ok : Ok; + Error : SnsWasmError; +}; + type SnsCanisterIds = record { root : opt principal; swap : opt principal; @@ -134,6 +213,7 @@ type SnsCanisterIds = record { index : opt principal; governance : opt principal; }; + type SnsInitPayload = record { url : opt text; max_dissolve_delay_seconds : opt nat64; @@ -162,7 +242,6 @@ type SnsInitPayload = record { transaction_fee_e8s : opt nat64; dapp_canisters : opt DappCanisters; neurons_fund_participation_constraints : opt NeuronsFundParticipationConstraints; - neurons_fund_participants : opt NeuronsFundParticipants; max_age_bonus_percentage : opt nat64; initial_token_distribution : opt InitialTokenDistribution; reward_rate_transition_duration_seconds : opt nat64; @@ -175,10 +254,12 @@ type SnsInitPayload = record { min_icp_e8s : opt nat64; max_direct_participation_icp_e8s : opt nat64; }; + type SnsUpgrade = record { next_version : opt SnsVersion; current_version : opt SnsVersion; }; + type SnsVersion = record { archive_wasm_hash : blob; root_wasm_hash : blob; @@ -187,38 +268,55 @@ type SnsVersion = record { governance_wasm_hash : blob; index_wasm_hash : blob; }; + type SnsWasm = record { wasm : blob; proposal_id : opt nat64; canister_type : int32; }; + type SnsWasmCanisterInitPayload = record { allowed_principals : vec principal; access_controls_enabled : bool; sns_subnet_ids : vec principal; }; -type SnsWasmError = record { message : text }; + +type SnsWasmError = record { + message : text; +}; + type SwapDistribution = record { total_e8s : nat64; initial_swap_amount_e8s : nat64; }; -type TreasuryDistribution = record { total_e8s : nat64 }; + +type TreasuryDistribution = record { + total_e8s : nat64; +}; + type UpdateAllowedPrincipalsRequest = record { added_principals : vec principal; removed_principals : vec principal; }; + type UpdateAllowedPrincipalsResponse = record { update_allowed_principals_result : opt UpdateAllowedPrincipalsResult; }; + type UpdateAllowedPrincipalsResult = variant { Error : SnsWasmError; AllowedPrincipals : GetAllowedPrincipalsResponse; }; + type UpdateSnsSubnetListRequest = record { sns_subnet_ids_to_add : vec principal; sns_subnet_ids_to_remove : vec principal; }; -type UpdateSnsSubnetListResponse = record { error : opt SnsWasmError }; + +type UpdateSnsSubnetListResponse = record { + error : opt SnsWasmError; +}; + service : (SnsWasmCanisterInitPayload) -> { add_wasm : (AddWasmRequest) -> (AddWasmResponse); deploy_new_sns : (DeployNewSnsRequest) -> (DeployNewSnsResponse); @@ -251,4 +349,4 @@ service : (SnsWasmCanisterInitPayload) -> { update_sns_subnet_list : (UpdateSnsSubnetListRequest) -> ( UpdateSnsSubnetListResponse, ); -} \ No newline at end of file +} diff --git a/ic/sns/testdata/did/swap.did b/ic/sns/testdata/did/swap.did index 8b5ca1b..9242cf9 100644 --- a/ic/sns/testdata/did/swap.did +++ b/ic/sns/testdata/did/swap.did @@ -2,7 +2,12 @@ type BuyerState = record { icp : opt TransferableAmount; has_created_neuron_recipes : opt bool; }; -type CanisterCallError = record { code : opt int32; description : text }; + +type CanisterCallError = record { + code : opt int32; + description : text; +}; + type CanisterStatusResultV2 = record { status : CanisterStatusType; memory_size : nat; @@ -11,24 +16,45 @@ type CanisterStatusResultV2 = record { idle_cycles_burned_per_day : nat; module_hash : opt blob; }; -type CanisterStatusType = variant { stopped; stopping; running }; -type CfInvestment = record { hotkey_principal : text; nns_neuron_id : nat64 }; + +type CanisterStatusType = variant { + stopped; + stopping; + running; +}; + +type CfInvestment = record { + controller : opt principal; + hotkey_principal : text; + hotkeys : opt Principals; + nns_neuron_id : nat64; +}; + type CfNeuron = record { has_created_neuron_recipes : opt bool; + hotkeys : opt Principals; nns_neuron_id : nat64; amount_icp_e8s : nat64; }; + type CfParticipant = record { + controller : opt principal; hotkey_principal : text; cf_neurons : vec CfNeuron; }; -type Countries = record { iso_codes : vec text }; + +type Countries = record { + iso_codes : vec text; +}; + type DefiniteCanisterSettingsArgs = record { freezing_threshold : nat; controllers : vec principal; + wasm_memory_limit : opt nat; memory_allocation : nat; compute_allocation : nat; }; + type DerivedState = record { sns_tokens_per_icp : float32; buyer_total_icp_e8s : nat64; @@ -38,21 +64,43 @@ type DerivedState = record { direct_participant_count : opt nat64; cf_neuron_count : opt nat64; }; -type DirectInvestment = record { buyer_principal : text }; -type Err = record { description : opt text; error_type : opt int32 }; -type Err_1 = record { error_type : opt int32 }; + +type DirectInvestment = record { + buyer_principal : text; +}; + +type Err = record { + description : opt text; + error_type : opt int32; +}; + +type Err_1 = record { + error_type : opt int32; +}; + type Err_2 = record { invalid_user_amount : opt InvalidUserAmount; existing_ticket : opt Ticket; error_type : int32; }; -type Error = record { message : opt text }; -type ErrorRefundIcpRequest = record { source_principal_id : opt principal }; -type ErrorRefundIcpResponse = record { result : opt Result }; + +type Error = record { + message : opt text; +}; + +type ErrorRefundIcpRequest = record { + source_principal_id : opt principal; +}; + +type ErrorRefundIcpResponse = record { + result : opt Result; +}; + type FailedUpdate = record { err : opt CanisterCallError; dapp_canister_id : opt principal; }; + type FinalizeSwapResponse = record { set_dapp_controllers_call_result : opt SetDappControllersCallResult; create_sns_neuron_recipes_result : opt SweepResult; @@ -64,14 +112,25 @@ type FinalizeSwapResponse = record { claim_neuron_result : opt SweepResult; sweep_sns_result : opt SweepResult; }; + type GetAutoFinalizationStatusResponse = record { auto_finalize_swap_response : opt FinalizeSwapResponse; has_auto_finalize_been_attempted : opt bool; is_auto_finalize_enabled : opt bool; }; -type GetBuyerStateRequest = record { principal_id : opt principal }; -type GetBuyerStateResponse = record { buyer_state : opt BuyerState }; -type GetBuyersTotalResponse = record { buyers_total : nat64 }; + +type GetBuyerStateRequest = record { + principal_id : opt principal; +}; + +type GetBuyerStateResponse = record { + buyer_state : opt BuyerState; +}; + +type GetBuyersTotalResponse = record { + buyers_total : nat64; +}; + type GetDerivedStateResponse = record { sns_tokens_per_icp : opt float64; buyer_total_icp_e8s : opt nat64; @@ -81,20 +140,44 @@ type GetDerivedStateResponse = record { direct_participant_count : opt nat64; cf_neuron_count : opt nat64; }; -type GetInitResponse = record { init : opt Init }; + +type GetInitResponse = record { + init : opt Init; +}; + type GetLifecycleResponse = record { decentralization_sale_open_timestamp_seconds : opt nat64; lifecycle : opt int32; decentralization_swap_termination_timestamp_seconds : opt nat64; }; -type GetOpenTicketResponse = record { result : opt Result_1 }; -type GetSaleParametersResponse = record { params : opt Params }; -type GetStateResponse = record { swap : opt Swap; derived : opt DerivedState }; -type GovernanceError = record { error_message : text; error_type : int32 }; -type Icrc1Account = record { owner : opt principal; subaccount : opt blob }; + +type GetOpenTicketResponse = record { + result : opt Result_1; +}; + +type GetSaleParametersResponse = record { + params : opt Params; +}; + +type GetStateResponse = record { + swap : opt Swap; + derived : opt DerivedState; +}; + +type GovernanceError = record { + error_message : text; + error_type : int32; +}; + +type Icrc1Account = record { + owner : opt principal; + subaccount : opt blob; +}; + type IdealMatchedParticipationFunction = record { serialized_representation : opt text; }; + type Init = record { nns_proposal_id : opt nat64; sns_root_canister_id : text; @@ -114,7 +197,6 @@ type Init = record { icp_ledger_canister_id : text; sns_ledger_canister_id : text; neurons_fund_participation_constraints : opt NeuronsFundParticipationConstraints; - neurons_fund_participants : opt NeuronsFundParticipants; should_auto_finalize : opt bool; max_participant_icp_e8s : opt nat64; sns_governance_canister_id : text; @@ -123,14 +205,17 @@ type Init = record { min_icp_e8s : opt nat64; max_direct_participation_icp_e8s : opt nat64; }; + type InvalidUserAmount = record { min_amount_icp_e8s_included : nat64; max_amount_icp_e8s_included : nat64; }; + type Investor = variant { CommunityFund : CfInvestment; Direct : DirectInvestment; }; + type LinearScalingCoefficient = record { slope_numerator : opt nat64; intercept_icp_e8s : opt nat64; @@ -138,55 +223,78 @@ type LinearScalingCoefficient = record { slope_denominator : opt nat64; to_direct_participation_icp_e8s : opt nat64; }; + type ListCommunityFundParticipantsRequest = record { offset : opt nat64; limit : opt nat32; }; + +type ListCommunityFundParticipantsResponse = record { + cf_participants : vec CfParticipant; +}; + type ListDirectParticipantsRequest = record { offset : opt nat32; limit : opt nat32; }; -type ListDirectParticipantsResponse = record { participants : vec Participant }; + +type ListDirectParticipantsResponse = record { + participants : vec Participant; +}; + type ListSnsNeuronRecipesRequest = record { offset : opt nat64; limit : opt nat32; }; + type ListSnsNeuronRecipesResponse = record { sns_neuron_recipes : vec SnsNeuronRecipe; }; + type NeuronAttributes = record { dissolve_delay_seconds : nat64; memo : nat64; followees : vec NeuronId; }; + type NeuronBasketConstructionParameters = record { dissolve_delay_interval_seconds : nat64; count : nat64; }; -type NeuronId = record { id : blob }; -type NeuronsFundParticipants = record { cf_participants : vec CfParticipant }; + +type NeuronId = record { + id : blob; +}; + type NeuronsFundParticipationConstraints = record { coefficient_intervals : vec LinearScalingCoefficient; max_neurons_fund_participation_icp_e8s : opt nat64; min_direct_participation_threshold_icp_e8s : opt nat64; ideal_matched_participation_function : opt IdealMatchedParticipationFunction; }; + type NewSaleTicketRequest = record { subaccount : opt blob; amount_icp_e8s : nat64; }; -type NewSaleTicketResponse = record { result : opt Result_2 }; -type Ok = record { block_height : opt nat64 }; + +type NewSaleTicketResponse = record { + result : opt Result_2; +}; + +type Ok = record { + block_height : opt nat64; +}; + type Ok_1 = record { neurons_fund_participation_icp_e8s : opt nat64; neurons_fund_neurons_count : opt nat64; }; -type Ok_2 = record { ticket : opt Ticket }; -type OpenRequest = record { - cf_participants : vec CfParticipant; - params : opt Params; - open_sns_token_swap_proposal_id : opt nat64; + +type Ok_2 = record { + ticket : opt Ticket; }; + type Params = record { min_participant_icp_e8s : nat64; neuron_basket_construction_parameters : opt NeuronBasketConstructionParameters; @@ -200,44 +308,92 @@ type Params = record { min_icp_e8s : nat64; max_direct_participation_icp_e8s : opt nat64; }; + type Participant = record { participation : opt BuyerState; participant_id : opt principal; }; + type Possibility = variant { Ok : SetDappControllersResponse; Err : CanisterCallError; }; -type Possibility_1 = variant { Ok : Response; Err : CanisterCallError }; -type Possibility_2 = variant { Ok : Ok_1; Err : Error }; -type Possibility_3 = variant { Ok : record {}; Err : CanisterCallError }; + +type Possibility_1 = variant { + Ok : Response; + Err : CanisterCallError; +}; + +type Possibility_2 = variant { + Ok : Ok_1; + Err : Error; +}; + +type Possibility_3 = variant { + Ok : record {}; + Err : CanisterCallError; +}; + +type Principals = record { + principals : vec principal; +}; + type RefreshBuyerTokensRequest = record { confirmation_text : opt text; buyer : text; }; + type RefreshBuyerTokensResponse = record { icp_accepted_participation_e8s : nat64; icp_ledger_account_balance_e8s : nat64; }; -type Response = record { governance_error : opt GovernanceError }; -type Result = variant { Ok : Ok; Err : Err }; -type Result_1 = variant { Ok : Ok_2; Err : Err_1 }; -type Result_2 = variant { Ok : Ok_2; Err : Err_2 }; -type SetDappControllersCallResult = record { possibility : opt Possibility }; -type SetDappControllersResponse = record { failed_updates : vec FailedUpdate }; -type SetModeCallResult = record { possibility : opt Possibility_3 }; + +type Response = record { + governance_error : opt GovernanceError; +}; + +type Result = variant { + Ok : Ok; + Err : Err; +}; + +type Result_1 = variant { + Ok : Ok_2; + Err : Err_1; +}; + +type Result_2 = variant { + Ok : Ok_2; + Err : Err_2; +}; + +type SetDappControllersCallResult = record { + possibility : opt Possibility; +}; + +type SetDappControllersResponse = record { + failed_updates : vec FailedUpdate; +}; + +type SetModeCallResult = record { + possibility : opt Possibility_3; +}; + type SettleCommunityFundParticipationResult = record { possibility : opt Possibility_1; }; + type SettleNeuronsFundParticipationResult = record { possibility : opt Possibility_2; }; + type SnsNeuronRecipe = record { sns : opt TransferableAmount; claimed_status : opt int32; neuron_attributes : opt NeuronAttributes; investor : opt Investor; }; + type Swap = record { auto_finalize_swap_response : opt FinalizeSwapResponse; neuron_recipes : vec SnsNeuronRecipe; @@ -257,6 +413,7 @@ type Swap = record { params : opt Params; open_sns_token_swap_proposal_id : opt nat64; }; + type SweepResult = record { failure : nat32; skipped : nat32; @@ -264,12 +421,14 @@ type SweepResult = record { success : nat32; global_failures : nat32; }; + type Ticket = record { creation_time : nat64; ticket_id : nat64; account : opt Icrc1Account; amount_icp_e8s : nat64; }; + type TransferableAmount = record { transfer_fee_paid_e8s : opt nat64; transfer_start_timestamp_seconds : nat64; @@ -277,6 +436,7 @@ type TransferableAmount = record { amount_transferred_e8s : opt nat64; transfer_success_timestamp_seconds : nat64; }; + service : (Init) -> { error_refund_icp : (ErrorRefundIcpRequest) -> (ErrorRefundIcpResponse); finalize_swap : (record {}) -> (FinalizeSwapResponse); @@ -293,7 +453,7 @@ service : (Init) -> { get_sale_parameters : (record {}) -> (GetSaleParametersResponse) query; get_state : (record {}) -> (GetStateResponse) query; list_community_fund_participants : (ListCommunityFundParticipantsRequest) -> ( - NeuronsFundParticipants, + ListCommunityFundParticipantsResponse, ) query; list_direct_participants : (ListDirectParticipantsRequest) -> ( ListDirectParticipantsResponse, @@ -303,9 +463,7 @@ service : (Init) -> { ) query; new_sale_ticket : (NewSaleTicketRequest) -> (NewSaleTicketResponse); notify_payment_failure : (record {}) -> (Ok_2); - open : (OpenRequest) -> (record {}); refresh_buyer_tokens : (RefreshBuyerTokensRequest) -> ( RefreshBuyerTokensResponse, ); - restore_dapp_controllers : (record {}) -> (SetDappControllersCallResult); -} \ No newline at end of file +} diff --git a/ic/sns/testdata/gen.go b/ic/sns/testdata/gen.go index df863a0..9390c06 100644 --- a/ic/sns/testdata/gen.go +++ b/ic/sns/testdata/gen.go @@ -17,8 +17,8 @@ var ( //go:embed did dids embed.FS - ICVersion = "release-2024-06-05_23-01-base" - SDKVersion = "0.20.1" + ICVersion = "release-2024-09-19_01-31-base" + SDKVersion = "0.23.0" ) func checkLatest() error { diff --git a/ic/testdata/did/assetstorage.did b/ic/testdata/did/assetstorage.did index 51bb1a2..ccf075f 100644 --- a/ic/testdata/did/assetstorage.did +++ b/ic/testdata/did/assetstorage.did @@ -199,6 +199,7 @@ service: (asset_canister_args: opt AssetCanisterArgs) -> { create_batch : (record {}) -> (record { batch_id: BatchId }); create_chunk: (record { batch_id: BatchId; content: blob }) -> (record { chunk_id: ChunkId }); + create_chunks: (record { batch_id: BatchId; content: vec blob }) -> (record { chunk_ids: vec ChunkId }); // Perform all operations successfully, or reject commit_batch: (CommitBatchArguments) -> (); diff --git a/ic/testdata/did/cmc.did b/ic/testdata/did/cmc.did index a7885ea..a302108 100644 --- a/ic/testdata/did/cmc.did +++ b/ic/testdata/did/cmc.did @@ -5,14 +5,14 @@ type log_visibility = variant { public; }; type CanisterSettings = record { - controller : opt principal; controllers : opt vec principal; compute_allocation : opt nat; memory_allocation : opt nat; freezing_threshold : opt nat; - reserved_cycles_limit: opt nat; + reserved_cycles_limit : opt nat; log_visibility : opt log_visibility; - wasm_memory_limit: opt nat; + wasm_memory_limit : opt nat; + wasm_memory_threshold : opt nat; }; type Subaccount = opt blob; type Memo = opt blob; @@ -26,18 +26,17 @@ type NotifyTopUpArg = record { canister_id : principal; }; - type SubnetSelection = variant { - /// Choose a specific subnet - Subnet : record { - subnet: principal; - }; - /// Choose a random subnet that fulfills the specified properties - Filter : SubnetFilter; + /// Choose a specific subnet + Subnet : record { + subnet : principal; + }; + /// Choose a random subnet that fulfills the specified properties + Filter : SubnetFilter; }; type SubnetFilter = record { - subnet_type: opt text; + subnet_type : opt text; }; // The argument of the [create_canister] method. @@ -49,10 +48,10 @@ type CreateCanisterArg = record { // An optional subnet type that, if set, determines what type of subnet // the new canister will be created on. // Deprecated. Use subnet_selection instead. - subnet_type: opt text; + subnet_type : opt text; // Optional instructions to select on which subnet the new canister will be created on. - subnet_selection: opt SubnetSelection; + subnet_selection : opt SubnetSelection; }; // The argument of the [notify_create_canister] method. @@ -66,11 +65,11 @@ type NotifyCreateCanisterArg = record { // An optional subnet type that, if set, determines what type of subnet // the new canister will be created on. // Deprecated. Use subnet_selection instead. - subnet_type: opt text; + subnet_type : opt text; // Optional instructions to select on which subnet the new canister will be created on. // vec may contain no more than one element. - subnet_selection: opt SubnetSelection; + subnet_selection : opt SubnetSelection; // Optional canister settings that, if set, are applied to the newly created canister. // If not specified, the caller is the controller of the canister and the other settings are set to default values. @@ -82,17 +81,10 @@ type NotifyCreateCanisterArg = record { type CreateCanisterError = variant { Refunded : record { // The amount of cycles returned to the calling canister - refund_amount: nat; + refund_amount : nat; // The reason why creating a canister failed. - create_error: text; - }; - RefundFailed : record { - // The reason why creating a canister failed. - create_error: text; - - // The reason why refunding cycles failed. - refund_error: text; + create_error : text; }; }; @@ -152,7 +144,6 @@ type IcpXdrConversionRate = record { xdr_permyriad_per_icp : nat64; }; - type IcpXdrConversionRateResponse = record { // The latest ICP/XDR conversion rate. data : IcpXdrConversionRate; @@ -175,49 +166,49 @@ type IcpXdrConversionRateResponse = record { }; type SubnetTypesToSubnetsResponse = record { - data: vec record { text; vec principal }; + data : vec record { text; vec principal }; }; type PrincipalsAuthorizedToCreateCanistersToSubnetsResponse = record { - data: vec record { principal; vec principal }; + data : vec record { principal; vec principal }; }; type AccountIdentifier = text; type ExchangeRateCanister = variant { - /// Enables the exchange rate canister with the given canister ID. - Set: principal; - /// Disable the exchange rate canister. - Unset; + /// Enables the exchange rate canister with the given canister ID. + Set : principal; + /// Disable the exchange rate canister. + Unset; }; type CyclesCanisterInitPayload = record { - ledger_canister_id: opt principal; - governance_canister_id: opt principal; - minting_account_id: opt AccountIdentifier; - last_purged_notification: opt nat64; - exchange_rate_canister: opt ExchangeRateCanister; - cycles_ledger_canister_id: opt principal; + ledger_canister_id : opt principal; + governance_canister_id : opt principal; + minting_account_id : opt AccountIdentifier; + last_purged_notification : opt nat64; + exchange_rate_canister : opt ExchangeRateCanister; + cycles_ledger_canister_id : opt principal; }; type NotifyMintCyclesArg = record { - block_index: BlockIndex; - to_subaccount: Subaccount; - deposit_memo: Memo; + block_index : BlockIndex; + to_subaccount : Subaccount; + deposit_memo : Memo; }; type NotifyMintCyclesResult = variant { - Ok: NotifyMintCyclesSuccess; - Err: NotifyError; + Ok : NotifyMintCyclesSuccess; + Err : NotifyError; }; type NotifyMintCyclesSuccess = record { - // Cycles ledger block index of deposit - block_index: nat; - // Amount of cycles that were minted and deposited to the cycles ledger - minted: nat; - // New balance of the cycles ledger account - balance: nat; + // Cycles ledger block index of deposit + block_index : nat; + // Amount of cycles that were minted and deposited to the cycles ledger + minted : nat; + // New balance of the cycles ledger account + balance : nat; }; service : (opt CyclesCanisterInitPayload) -> { @@ -245,4 +236,4 @@ service : (opt CyclesCanisterInitPayload) -> { get_principals_authorized_to_create_canisters_to_subnets : () -> (PrincipalsAuthorizedToCreateCanistersToSubnetsResponse) query; get_build_metadata : () -> (text) query; -} +}; diff --git a/ic/testdata/did/governance.did b/ic/testdata/did/governance.did index 40eaf16..ffa575e 100644 --- a/ic/testdata/did/governance.did +++ b/ic/testdata/did/governance.did @@ -1,7 +1,13 @@ -type AccountIdentifier = record { hash : blob }; +type AccountIdentifier = record { + hash : blob; +}; + type Action = variant { RegisterKnownNeuron : KnownNeuron; ManageNeuron : ManageNeuron; + UpdateCanisterSettings : UpdateCanisterSettings; + InstallCode : InstallCode; + StopOrStartCanister : StopOrStartCanister; CreateServiceNervousSystem : CreateServiceNervousSystem; ExecuteNnsFunction : ExecuteNnsFunction; RewardNodeProvider : RewardNodeProvider; @@ -10,22 +16,56 @@ type Action = variant { SetDefaultFollowees : SetDefaultFollowees; RewardNodeProviders : RewardNodeProviders; ManageNetworkEconomics : NetworkEconomics; - ApproveGenesisKyc : ApproveGenesisKyc; + ApproveGenesisKyc : Principals; AddOrRemoveNodeProvider : AddOrRemoveNodeProvider; Motion : Motion; }; -type AddHotKey = record { new_hot_key : opt principal }; -type AddOrRemoveNodeProvider = record { change : opt Change }; -type Amount = record { e8s : nat64 }; -type ApproveGenesisKyc = record { principals : vec principal }; -type Ballot = record { vote : int32; voting_power : nat64 }; -type BallotInfo = record { vote : int32; proposal_id : opt NeuronId }; + +type AddHotKey = record { + new_hot_key : opt principal; +}; + +type AddOrRemoveNodeProvider = record { + change : opt Change; +}; + +type Amount = record { + e8s : nat64; +}; + +type ApproveGenesisKyc = record { + principals : vec principal; +}; + +type Ballot = record { + vote : int32; + voting_power : nat64; +}; + +type BallotInfo = record { + vote : int32; + proposal_id : opt NeuronId; +}; + type By = variant { NeuronIdOrSubaccount : record {}; MemoAndController : ClaimOrRefreshNeuronFromAccount; Memo : nat64; }; -type Canister = record { id : opt principal }; + +type Canister = record { + id : opt principal; +}; + +type CanisterSettings = record { + freezing_threshold : opt nat64; + controllers : opt Controllers; + log_visibility : opt int32; + wasm_memory_limit : opt nat64; + memory_allocation : opt nat64; + compute_allocation : opt nat64; +}; + type CanisterStatusResultV2 = record { status : opt int32; freezing_threshold : opt nat64; @@ -35,30 +75,38 @@ type CanisterStatusResultV2 = record { idle_cycles_burned_per_day : opt nat64; module_hash : blob; }; + type CanisterSummary = record { status : opt CanisterStatusResultV2; canister_id : opt principal; }; -type CfNeuron = record { - has_created_neuron_recipes : opt bool; - nns_neuron_id : nat64; - amount_icp_e8s : nat64; -}; -type CfParticipant = record { - hotkey_principal : text; - cf_neurons : vec CfNeuron; + +type Change = variant { + ToRemove : NodeProvider; + ToAdd : NodeProvider; }; -type Change = variant { ToRemove : NodeProvider; ToAdd : NodeProvider }; + type ChangeAutoStakeMaturity = record { requested_setting_for_auto_stake_maturity : bool; }; -type ClaimOrRefresh = record { by : opt By }; + +type ClaimOrRefresh = record { + by : opt By; +}; + type ClaimOrRefreshNeuronFromAccount = record { controller : opt principal; memo : nat64; }; -type ClaimOrRefreshNeuronFromAccountResponse = record { result : opt Result_1 }; -type ClaimOrRefreshResponse = record { refreshed_neuron_id : opt NeuronId }; + +type ClaimOrRefreshNeuronFromAccountResponse = record { + result : opt Result_1; +}; + +type ClaimOrRefreshResponse = record { + refreshed_neuron_id : opt NeuronId; +}; + type Command = variant { Spawn : Spawn; Split : Split; @@ -73,6 +121,7 @@ type Command = variant { MergeMaturity : MergeMaturity; Disburse : Disburse; }; + type Command_1 = variant { Error : GovernanceError; Spawn : SpawnResponse; @@ -88,6 +137,7 @@ type Command_1 = variant { MergeMaturity : MergeMaturityResponse; Disburse : DisburseResponse; }; + type Command_2 = variant { Spawn : NeuronId; Split : Split; @@ -99,18 +149,31 @@ type Command_2 = variant { MergeMaturity : MergeMaturity; Disburse : Disburse; }; + type Committed = record { total_direct_contribution_icp_e8s : opt nat64; total_neurons_fund_contribution_icp_e8s : opt nat64; sns_governance_canister_id : opt principal; }; + type Committed_1 = record { total_direct_participation_icp_e8s : opt nat64; total_neurons_fund_participation_icp_e8s : opt nat64; sns_governance_canister_id : opt principal; }; -type Configure = record { operation : opt Operation }; -type Countries = record { iso_codes : vec text }; + +type Configure = record { + operation : opt Operation; +}; + +type Controllers = record { + controllers : vec principal; +}; + +type Countries = record { + iso_codes : vec text; +}; + type CreateServiceNervousSystem = record { url : opt text; governance_parameters : opt GovernanceParameters; @@ -123,18 +186,33 @@ type CreateServiceNervousSystem = record { swap_parameters : opt SwapParameters; initial_token_distribution : opt InitialTokenDistribution; }; -type Decimal = record { human_readable : opt text }; + +type DateRangeFilter = record { + start_timestamp_seconds : opt nat64; + end_timestamp_seconds : opt nat64; +}; + +type Decimal = record { + human_readable : opt text; +}; + type DerivedProposalInformation = record { swap_background_information : opt SwapBackgroundInformation; }; + type DeveloperDistribution = record { developer_neurons : vec NeuronDistribution; }; + type Disburse = record { to_account : opt AccountIdentifier; amount : opt Amount; }; -type DisburseResponse = record { transfer_block_height : nat64 }; + +type DisburseResponse = record { + transfer_block_height : nat64; +}; + type DisburseToNeuron = record { dissolve_delay_seconds : nat64; kyc_verified : bool; @@ -142,23 +220,54 @@ type DisburseToNeuron = record { new_controller : opt principal; nonce : nat64; }; + type DissolveState = variant { DissolveDelaySeconds : nat64; WhenDissolvedTimestampSeconds : nat64; }; -type Duration = record { seconds : opt nat64 }; -type ExecuteNnsFunction = record { nns_function : int32; payload : blob }; -type Follow = record { topic : int32; followees : vec NeuronId }; -type Followees = record { followees : vec NeuronId }; -type Followers = record { followers : vec NeuronId }; -type FollowersMap = record { followers_map : vec record { nat64; Followers } }; -type GetNeuronsFundAuditInfoRequest = record { nns_proposal_id : opt NeuronId }; -type GetNeuronsFundAuditInfoResponse = record { result : opt Result_6 }; -type GlobalTimeOfDay = record { seconds_after_utc_midnight : opt nat64 }; + +type Duration = record { + seconds : opt nat64; +}; + +type ExecuteNnsFunction = record { + nns_function : int32; + payload : blob; +}; + +type Follow = record { + topic : int32; + followees : vec NeuronId; +}; + +type Followees = record { + followees : vec NeuronId; +}; + +type Followers = record { + followers : vec NeuronId; +}; + +type FollowersMap = record { + followers_map : vec record { nat64; Followers }; +}; + +type GetNeuronsFundAuditInfoRequest = record { + nns_proposal_id : opt NeuronId; +}; + +type GetNeuronsFundAuditInfoResponse = record { + result : opt Result_6; +}; + +type GlobalTimeOfDay = record { + seconds_after_utc_midnight : opt nat64; +}; + type Governance = record { default_followees : vec record { int32; Followees }; making_sns_proposal : opt MakingSnsProposal; - most_recent_monthly_node_provider_rewards : opt MostRecentMonthlyNodeProviderRewards; + most_recent_monthly_node_provider_rewards : opt MonthlyNodeProviderRewards; maturity_modulation_last_updated_at_timestamp_seconds : opt nat64; wait_for_quiet_threshold_seconds : nat64; metrics : opt GovernanceCachedMetrics; @@ -179,6 +288,7 @@ type Governance = record { neurons : vec record { nat64; Neuron }; genesis_timestamp_seconds : nat64; }; + type GovernanceCachedMetrics = record { total_maturity_e8s_equivalent : nat64; not_dissolving_neurons_e8s_buckets : vec record { nat64; float64 }; @@ -201,11 +311,13 @@ type GovernanceCachedMetrics = record { not_dissolving_neurons_count : nat64; total_locked_e8s : nat64; neurons_fund_total_active_neurons : nat64; + total_voting_power_non_self_authenticating_controller : opt nat64; total_staked_maturity_e8s_equivalent : nat64; not_dissolving_neurons_e8s_buckets_ect : vec record { nat64; float64 }; total_staked_e8s_ect : nat64; not_dissolving_neurons_staked_maturity_e8s_equivalent_sum : nat64; dissolved_neurons_e8s : nat64; + total_staked_e8s_non_self_authenticating_controller : opt nat64; dissolving_neurons_e8s_buckets_seed : vec record { nat64; float64 }; neurons_with_less_than_6_months_dissolve_delay_e8s : nat64; not_dissolving_neurons_staked_maturity_e8s_equivalent_buckets : vec record { @@ -214,15 +326,22 @@ type GovernanceCachedMetrics = record { }; dissolving_neurons_count_buckets : vec record { nat64; nat64 }; dissolving_neurons_e8s_buckets_ect : vec record { nat64; float64 }; + non_self_authenticating_controller_neuron_subset_metrics : opt NeuronSubsetMetrics; dissolving_neurons_count : nat64; dissolving_neurons_e8s_buckets : vec record { nat64; float64 }; total_staked_maturity_e8s_equivalent_seed : nat64; community_fund_total_staked_e8s : nat64; not_dissolving_neurons_e8s_buckets_seed : vec record { nat64; float64 }; + public_neuron_subset_metrics : opt NeuronSubsetMetrics; timestamp_seconds : nat64; seed_neuron_count : nat64; }; -type GovernanceError = record { error_message : text; error_type : int32 }; + +type GovernanceError = record { + error_message : text; + error_type : int32; +}; + type GovernanceParameters = record { neuron_maximum_dissolve_delay_bonus : opt Percentage; neuron_maximum_age_for_age_bonus : opt Duration; @@ -235,39 +354,86 @@ type GovernanceParameters = record { proposal_rejection_fee : opt Tokens; voting_reward_parameters : opt VotingRewardParameters; }; + type IdealMatchedParticipationFunction = record { serialized_representation : opt text; }; -type Image = record { base64_encoding : opt text }; + +type Image = record { + base64_encoding : opt text; +}; + type IncreaseDissolveDelay = record { additional_dissolve_delay_seconds : nat32; }; + type InitialTokenDistribution = record { treasury_distribution : opt SwapDistribution; developer_distribution : opt DeveloperDistribution; swap_distribution : opt SwapDistribution; }; + +type InstallCode = record { + skip_stopping_before_installing : opt bool; + wasm_module_hash : opt blob; + canister_id : opt principal; + arg_hash : opt blob; + install_mode : opt int32; +}; + +type InstallCodeRequest = 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; }; -type KnownNeuronData = record { name : text; description : opt text }; + +type KnownNeuronData = record { + name : text; + description : opt text; +}; + type LedgerParameters = record { transaction_fee : opt Tokens; token_symbol : opt text; token_logo : opt Image; token_name : opt text; }; -type ListKnownNeuronsResponse = record { known_neurons : vec KnownNeuron }; + +type ListKnownNeuronsResponse = record { + known_neurons : vec KnownNeuron; +}; + type ListNeurons = record { + include_public_neurons_in_full_neurons : opt bool; neuron_ids : vec nat64; + include_empty_neurons_readable_by_caller : opt bool; include_neurons_readable_by_caller : bool; }; + type ListNeuronsResponse = record { neuron_infos : vec record { nat64; NeuronInfo }; full_neurons : vec Neuron; }; -type ListNodeProvidersResponse = record { node_providers : vec NodeProvider }; + +type ListNodeProviderRewardsRequest = record { + date_filter : opt DateRangeFilter; +}; + +type ListNodeProviderRewardsResponse = record { + rewards : vec MonthlyNodeProviderRewards; +}; + +type ListNodeProvidersResponse = record { + node_providers : vec NodeProvider; +}; + type ListProposalInfo = record { include_reward_status : vec int32; omit_large_fields : opt bool; @@ -277,48 +443,105 @@ type ListProposalInfo = record { include_all_manage_neuron_proposals : opt bool; include_status : vec int32; }; -type ListProposalInfoResponse = record { proposal_info : vec ProposalInfo }; + +type ListProposalInfoResponse = record { + proposal_info : vec ProposalInfo; +}; + +type MakeProposalRequest = record { + url : text; + title : opt text; + action : opt ProposalActionRequest; + summary : text; +}; + type MakeProposalResponse = record { message : opt text; proposal_id : opt NeuronId; }; + type MakingSnsProposal = record { proposal : opt Proposal; caller : opt principal; proposer_id : opt NeuronId; }; + type ManageNeuron = record { id : opt NeuronId; command : opt Command; neuron_id_or_subaccount : opt NeuronIdOrSubaccount; }; -type ManageNeuronResponse = record { command : opt Command_1 }; -type Merge = record { source_neuron_id : opt NeuronId }; -type MergeMaturity = record { percentage_to_merge : nat32 }; + +type ManageNeuronCommandRequest = variant { + Spawn : Spawn; + Split : Split; + Follow : Follow; + ClaimOrRefresh : ClaimOrRefresh; + Configure : Configure; + RegisterVote : RegisterVote; + Merge : Merge; + DisburseToNeuron : DisburseToNeuron; + MakeProposal : MakeProposalRequest; + StakeMaturity : StakeMaturity; + MergeMaturity : MergeMaturity; + Disburse : Disburse; +}; + +type ManageNeuronRequest = record { + id : opt NeuronId; + command : opt ManageNeuronCommandRequest; + neuron_id_or_subaccount : opt NeuronIdOrSubaccount; +}; + +type ManageNeuronResponse = record { + command : opt Command_1; +}; + +type Merge = record { + source_neuron_id : opt NeuronId; +}; + +type MergeMaturity = record { + percentage_to_merge : nat32; +}; + type MergeMaturityResponse = record { merged_maturity_e8s : nat64; new_stake_e8s : nat64; }; + type MergeResponse = record { target_neuron : opt Neuron; source_neuron : opt Neuron; target_neuron_info : opt NeuronInfo; source_neuron_info : opt NeuronInfo; }; + type Migration = record { status : opt int32; failure_reason : opt text; progress : opt Progress; }; + type Migrations = record { neuron_indexes_migration : opt Migration; copy_inactive_neurons_to_stable_memory_migration : opt Migration; }; -type MostRecentMonthlyNodeProviderRewards = record { + +type MonthlyNodeProviderRewards = record { + minimum_xdr_permyriad_per_icp : opt nat64; + registry_version : opt nat64; + node_providers : vec NodeProvider; timestamp : nat64; rewards : vec RewardNodeProvider; + xdr_conversion_rate : opt XdrConversionRate; + maximum_node_provider_rewards_e8s : opt nat64; }; -type Motion = record { motion_text : text }; + +type Motion = record { + motion_text : text; +}; + type NetworkEconomics = record { neuron_minimum_stake_e8s : nat64; max_proposals_to_keep_per_topic : nat32; @@ -330,6 +553,7 @@ type NetworkEconomics = record { maximum_node_provider_rewards_e8s : nat64; neurons_fund_economics : opt NeuronsFundEconomics; }; + type Neuron = record { id : opt NeuronId; staked_maturity_e8s_equivalent : opt nat64; @@ -349,18 +573,22 @@ type Neuron = record { dissolve_state : opt DissolveState; followees : vec record { int32; Followees }; neuron_fees_e8s : nat64; + visibility : opt int32; transfer : opt NeuronStakeTransfer; known_neuron_data : opt KnownNeuronData; spawn_at_timestamp_seconds : opt nat64; }; + type NeuronBasketConstructionParameters = record { dissolve_delay_interval : opt Duration; count : opt nat64; }; + type NeuronBasketConstructionParameters_1 = record { dissolve_delay_interval_seconds : nat64; count : nat64; }; + type NeuronDistribution = record { controller : opt principal; dissolve_delay : opt Duration; @@ -368,12 +596,21 @@ type NeuronDistribution = record { vesting_period : opt Duration; stake : opt Tokens; }; -type NeuronId = record { id : nat64 }; -type NeuronIdOrSubaccount = variant { Subaccount : blob; NeuronId : NeuronId }; + +type NeuronId = record { + id : nat64; +}; + +type NeuronIdOrSubaccount = variant { + Subaccount : blob; + NeuronId : NeuronId; +}; + type NeuronInFlightCommand = record { command : opt Command_2; timestamp : nat64; }; + type NeuronInfo = record { dissolve_delay_seconds : nat64; recent_ballots : vec BallotInfo; @@ -383,10 +620,12 @@ type NeuronInfo = record { stake_e8s : nat64; joined_community_fund_timestamp_seconds : opt nat64; retrieved_at_timestamp_seconds : nat64; + visibility : opt int32; known_neuron_data : opt KnownNeuronData; voting_power : nat64; age_seconds : nat64; }; + type NeuronStakeTransfer = record { to_subaccount : blob; neuron_stake_e8s : nat64; @@ -396,40 +635,62 @@ type NeuronStakeTransfer = record { transfer_timestamp : nat64; block_height : nat64; }; + +type NeuronSubsetMetrics = record { + total_maturity_e8s_equivalent : opt nat64; + maturity_e8s_equivalent_buckets : vec record { nat64; nat64 }; + voting_power_buckets : vec record { nat64; nat64 }; + total_staked_e8s : opt nat64; + count : opt nat64; + total_staked_maturity_e8s_equivalent : opt nat64; + staked_maturity_e8s_equivalent_buckets : vec record { nat64; nat64 }; + staked_e8s_buckets : vec record { nat64; nat64 }; + total_voting_power : opt nat64; + count_buckets : vec record { nat64; nat64 }; +}; + type NeuronsFundAuditInfo = record { final_neurons_fund_participation : opt NeuronsFundParticipation; initial_neurons_fund_participation : opt NeuronsFundParticipation; neurons_fund_refunds : opt NeuronsFundSnapshot; }; + type NeuronsFundData = record { final_neurons_fund_participation : opt NeuronsFundParticipation; initial_neurons_fund_participation : opt NeuronsFundParticipation; neurons_fund_refunds : opt NeuronsFundSnapshot; }; + type NeuronsFundEconomics = record { maximum_icp_xdr_rate : opt Percentage; neurons_fund_matched_funding_curve_coefficients : opt NeuronsFundMatchedFundingCurveCoefficients; max_theoretical_neurons_fund_participation_amount_xdr : opt Decimal; minimum_icp_xdr_rate : opt Percentage; }; + type NeuronsFundMatchedFundingCurveCoefficients = record { contribution_threshold_xdr : opt Decimal; one_third_participation_milestone_xdr : opt Decimal; full_participation_milestone_xdr : opt Decimal; }; + type NeuronsFundNeuron = record { - hotkey_principal : opt text; + controller : opt principal; + hotkeys : opt Principals; is_capped : opt bool; nns_neuron_id : opt nat64; amount_icp_e8s : opt nat64; }; + type NeuronsFundNeuronPortion = record { - hotkey_principal : opt principal; + controller : opt principal; + hotkeys : vec principal; is_capped : opt bool; maturity_equivalent_icp_e8s : opt nat64; nns_neuron_id : opt NeuronId; amount_icp_e8s : opt nat64; }; + type NeuronsFundParticipation = record { total_maturity_equivalent_icp_e8s : opt nat64; intended_neurons_fund_participation_icp_e8s : opt nat64; @@ -440,20 +701,30 @@ type NeuronsFundParticipation = record { ideal_matched_participation_function : opt IdealMatchedParticipationFunction; allocated_neurons_fund_participation_icp_e8s : opt nat64; }; + type NeuronsFundSnapshot = record { neurons_fund_neuron_portions : vec NeuronsFundNeuronPortion; }; + type NodeProvider = record { id : opt principal; reward_account : opt AccountIdentifier; }; -type Ok = record { neurons_fund_audit_info : opt NeuronsFundAuditInfo }; -type Ok_1 = record { neurons_fund_neuron_portions : vec NeuronsFundNeuron }; + +type Ok = record { + neurons_fund_audit_info : opt NeuronsFundAuditInfo; +}; + +type Ok_1 = record { + neurons_fund_neuron_portions : vec NeuronsFundNeuron; +}; + type OpenSnsTokenSwap = record { community_fund_investment_e8s : opt nat64; target_swap_canister_id : opt principal; params : opt Params; }; + type Operation = variant { RemoveHotKey : RemoveHotKey; AddHotKey : AddHotKey; @@ -461,10 +732,12 @@ type Operation = variant { StopDissolving : record {}; StartDissolving : record {}; IncreaseDissolveDelay : IncreaseDissolveDelay; + SetVisibility : SetVisibility; JoinCommunityFund : record {}; LeaveCommunityFund : record {}; SetDissolveTimestamp : SetDissolveTimestamp; }; + type Params = record { min_participant_icp_e8s : nat64; neuron_basket_construction_parameters : opt NeuronBasketConstructionParameters_1; @@ -478,18 +751,45 @@ type Params = record { min_icp_e8s : nat64; max_direct_participation_icp_e8s : opt nat64; }; -type Percentage = record { basis_points : opt nat64 }; -type Progress = variant { LastNeuronId : NeuronId }; + +type Percentage = record { + basis_points : opt nat64; +}; + +type Principals = record { + principals : vec principal; +}; + +type Progress = variant { + LastNeuronId : NeuronId; +}; + type Proposal = record { url : text; title : opt text; action : opt Action; summary : text; }; + +type ProposalActionRequest = variant { + RegisterKnownNeuron : KnownNeuron; + ManageNeuron : ManageNeuronRequest; + UpdateCanisterSettings : UpdateCanisterSettings; + InstallCode : InstallCodeRequest; + StopOrStartCanister : StopOrStartCanister; + CreateServiceNervousSystem : CreateServiceNervousSystem; + ExecuteNnsFunction : ExecuteNnsFunction; + RewardNodeProvider : RewardNodeProvider; + RewardNodeProviders : RewardNodeProviders; + ManageNetworkEconomics : NetworkEconomics; + ApproveGenesisKyc : Principals; + AddOrRemoveNodeProvider : AddOrRemoveNodeProvider; + Motion : Motion; +}; + type ProposalData = record { id : opt NeuronId; failure_reason : opt GovernanceError; - cf_participants : vec CfParticipant; ballots : vec record { nat64; Ballot }; proposal_timestamp_seconds : nat64; reward_event_round : nat64; @@ -506,6 +806,7 @@ type ProposalData = record { executed_timestamp_seconds : nat64; original_total_community_fund_maturity_e8s_equivalent : opt nat64; }; + type ProposalInfo = record { id : opt NeuronId; status : int32; @@ -525,29 +826,81 @@ type ProposalInfo = record { proposer : opt NeuronId; executed_timestamp_seconds : nat64; }; -type RegisterVote = record { vote : int32; proposal : opt NeuronId }; -type RemoveHotKey = record { hot_key_to_remove : opt principal }; + +type RegisterVote = record { + vote : int32; + proposal : opt NeuronId; +}; + +type RemoveHotKey = record { + hot_key_to_remove : opt principal; +}; + type RestoreAgingNeuronGroup = record { count : opt nat64; previous_total_stake_e8s : opt nat64; current_total_stake_e8s : opt nat64; group_type : int32; }; + type RestoreAgingSummary = record { groups : vec RestoreAgingNeuronGroup; timestamp_seconds : opt nat64; }; -type Result = variant { Ok; Err : GovernanceError }; -type Result_1 = variant { Error : GovernanceError; NeuronId : NeuronId }; -type Result_10 = variant { Ok : Ok_1; Err : GovernanceError }; -type Result_2 = variant { Ok : Neuron; Err : GovernanceError }; -type Result_3 = variant { Ok : GovernanceCachedMetrics; Err : GovernanceError }; -type Result_4 = variant { Ok : RewardNodeProviders; Err : GovernanceError }; -type Result_5 = variant { Ok : NeuronInfo; Err : GovernanceError }; -type Result_6 = variant { Ok : Ok; Err : GovernanceError }; -type Result_7 = variant { Ok : NodeProvider; Err : GovernanceError }; -type Result_8 = variant { Committed : Committed; Aborted : record {} }; -type Result_9 = variant { Committed : Committed_1; Aborted : record {} }; + +type Result = variant { + Ok; + Err : GovernanceError; +}; + +type Result_1 = variant { + Error : GovernanceError; + NeuronId : NeuronId; +}; + +type Result_10 = variant { + Ok : Ok_1; + Err : GovernanceError; +}; + +type Result_2 = variant { + Ok : Neuron; + Err : GovernanceError; +}; + +type Result_3 = variant { + Ok : GovernanceCachedMetrics; + Err : GovernanceError; +}; + +type Result_4 = variant { + Ok : MonthlyNodeProviderRewards; + Err : GovernanceError; +}; + +type Result_5 = variant { + Ok : NeuronInfo; + Err : GovernanceError; +}; + +type Result_6 = variant { + Ok : Ok; + Err : GovernanceError; +}; + +type Result_7 = variant { + Ok : NodeProvider; + Err : GovernanceError; +}; + +type Result_8 = variant { + Committed : Committed; + Aborted : record {} }; + +type Result_9 = variant { + Committed : Committed_1; + Aborted : record {} }; + type RewardEvent = record { rounds_since_last_distribution : opt nat64; day_after_genesis : nat64; @@ -557,51 +910,94 @@ type RewardEvent = record { distributed_e8s_equivalent : nat64; settled_proposals : vec NeuronId; }; + type RewardMode = variant { RewardToNeuron : RewardToNeuron; RewardToAccount : RewardToAccount; }; + type RewardNodeProvider = record { node_provider : opt NodeProvider; reward_mode : opt RewardMode; amount_e8s : nat64; }; + type RewardNodeProviders = record { use_registry_derived_rewards : opt bool; rewards : vec RewardNodeProvider; }; -type RewardToAccount = record { to_account : opt AccountIdentifier }; -type RewardToNeuron = record { dissolve_delay_seconds : nat64 }; + +type RewardToAccount = record { + to_account : opt AccountIdentifier; +}; + +type RewardToNeuron = record { + dissolve_delay_seconds : nat64; +}; + type SetDefaultFollowees = record { default_followees : vec record { int32; Followees }; }; -type SetDissolveTimestamp = record { dissolve_timestamp_seconds : nat64 }; -type SetOpenTimeWindowRequest = record { open_time_window : opt TimeWindow }; + +type SetDissolveTimestamp = record { + dissolve_timestamp_seconds : nat64; +}; + +type SetOpenTimeWindowRequest = record { + open_time_window : opt TimeWindow; +}; + type SetSnsTokenSwapOpenTimeWindow = record { request : opt SetOpenTimeWindowRequest; swap_canister_id : opt principal; }; + +type SetVisibility = record { + visibility : opt int32; +}; + type SettleCommunityFundParticipation = record { result : opt Result_8; open_sns_token_swap_proposal_id : opt nat64; }; + type SettleNeuronsFundParticipationRequest = record { result : opt Result_9; nns_proposal_id : opt nat64; }; -type SettleNeuronsFundParticipationResponse = record { result : opt Result_10 }; + +type SettleNeuronsFundParticipationResponse = record { + result : opt Result_10; +}; + type Spawn = record { percentage_to_spawn : opt nat32; new_controller : opt principal; nonce : opt nat64; }; -type SpawnResponse = record { created_neuron_id : opt NeuronId }; -type Split = record { amount_e8s : nat64 }; -type StakeMaturity = record { percentage_to_stake : opt nat32 }; + +type SpawnResponse = record { + created_neuron_id : opt NeuronId; +}; + +type Split = record { + amount_e8s : nat64; +}; + +type StakeMaturity = record { + percentage_to_stake : opt nat32; +}; + type StakeMaturityResponse = record { maturity_e8s : nat64; staked_maturity_e8s : nat64; }; + +type StopOrStartCanister = record { + action : opt int32; + canister_id : opt principal; +}; + type SwapBackgroundInformation = record { ledger_index_canister_summary : opt CanisterSummary; fallback_controller_principal_ids : vec principal; @@ -612,7 +1008,11 @@ type SwapBackgroundInformation = record { root_canister_summary : opt CanisterSummary; dapp_canister_summaries : vec CanisterSummary; }; -type SwapDistribution = record { total : opt Tokens }; + +type SwapDistribution = record { + total : opt Tokens; +}; + type SwapParameters = record { minimum_participants : opt nat64; neurons_fund_participation : opt bool; @@ -629,34 +1029,54 @@ type SwapParameters = record { neurons_fund_investment_icp : opt Tokens; restricted_countries : opt Countries; }; + type SwapParticipationLimits = record { min_participant_icp_e8s : opt nat64; max_participant_icp_e8s : opt nat64; min_direct_participation_icp_e8s : opt nat64; max_direct_participation_icp_e8s : opt nat64; }; + type Tally = record { no : nat64; yes : nat64; total : nat64; timestamp_seconds : nat64; }; + type TimeWindow = record { start_timestamp_seconds : nat64; end_timestamp_seconds : nat64; }; -type Tokens = record { e8s : opt nat64 }; -type UpdateNodeProvider = record { reward_account : opt AccountIdentifier }; + +type Tokens = record { + e8s : opt nat64; +}; + +type UpdateCanisterSettings = record { + canister_id : opt principal; + settings : opt CanisterSettings; +}; + +type UpdateNodeProvider = record { + reward_account : opt AccountIdentifier; +}; + type VotingRewardParameters = record { reward_rate_transition_duration : opt Duration; initial_reward_rate : opt Percentage; final_reward_rate : opt Percentage; }; -type WaitForQuietState = record { current_deadline_timestamp_seconds : nat64 }; + +type WaitForQuietState = record { + current_deadline_timestamp_seconds : nat64; +}; + type XdrConversionRate = record { xdr_permyriad_per_icp : opt nat64; timestamp_seconds : opt nat64; }; + service : (Governance) -> { claim_gtc_neurons : (principal, vec NeuronId) -> (Result); claim_or_refresh_neuron_from_account : (ClaimOrRefreshNeuronFromAccount) -> ( @@ -671,7 +1091,7 @@ service : (Governance) -> { get_metrics : () -> (Result_3) query; get_monthly_node_provider_rewards : () -> (Result_4); get_most_recent_monthly_node_provider_rewards : () -> ( - opt MostRecentMonthlyNodeProviderRewards, + opt MonthlyNodeProviderRewards, ) query; get_network_economics_parameters : () -> (NetworkEconomics) query; get_neuron_ids : () -> (vec nat64) query; @@ -688,16 +1108,19 @@ service : (Governance) -> { get_restore_aging_summary : () -> (RestoreAgingSummary) query; list_known_neurons : () -> (ListKnownNeuronsResponse) query; list_neurons : (ListNeurons) -> (ListNeuronsResponse) query; + list_node_provider_rewards : (ListNodeProviderRewardsRequest) -> ( + ListNodeProviderRewardsResponse, + ) query; list_node_providers : () -> (ListNodeProvidersResponse) query; list_proposals : (ListProposalInfo) -> (ListProposalInfoResponse) query; - manage_neuron : (ManageNeuron) -> (ManageNeuronResponse); + manage_neuron : (ManageNeuronRequest) -> (ManageNeuronResponse); settle_community_fund_participation : (SettleCommunityFundParticipation) -> ( Result, ); settle_neurons_fund_participation : ( SettleNeuronsFundParticipationRequest, ) -> (SettleNeuronsFundParticipationResponse); - simulate_manage_neuron : (ManageNeuron) -> (ManageNeuronResponse); + simulate_manage_neuron : (ManageNeuronRequest) -> (ManageNeuronResponse); transfer_gtc_neuron : (NeuronId, NeuronId) -> (Result); update_node_provider : (UpdateNodeProvider) -> (Result); -} \ No newline at end of file +} diff --git a/ic/testdata/did/icpledger.did b/ic/testdata/did/icpledger.did index a7d4e63..e35a627 100644 --- a/ic/testdata/did/icpledger.did +++ b/ic/testdata/did/icpledger.did @@ -350,7 +350,6 @@ type Value = variant { }; type UpgradeArgs = record { - maximum_number_of_accounts : opt nat64; icrc1_minting_account : opt Account; feature_flags : opt FeatureFlags; }; @@ -427,6 +426,7 @@ type TransferFromError = variant { type icrc21_consent_message_metadata = record { language: text; + utc_offset_minutes: opt int16; }; type icrc21_consent_message_spec = record { diff --git a/ic/testdata/did/registry.did b/ic/testdata/did/registry.did index 7cc0e87..669a44a 100644 --- a/ic/testdata/did/registry.did +++ b/ic/testdata/did/registry.did @@ -54,18 +54,6 @@ type AddOrRemoveDataCentersProposalPayload = record { data_centers_to_remove : vec text; }; -type BlessReplicaVersionPayload = record { - release_package_urls : opt vec text; - node_manager_sha256_hex : text; - release_package_url : text; - sha256_hex : text; - guest_launch_measurement_sha256_hex : opt text; - replica_version_id : text; - release_package_sha256_hex : text; - node_manager_binary_url : text; - binary_url : text; -}; - type CanisterIdRange = record { end : principal; start : principal }; type ChangeSubnetMembershipPayload = record { @@ -81,20 +69,18 @@ type CompleteCanisterMigrationPayload = record { type CreateSubnetPayload = record { unit_delay_millis : nat64; - max_instructions_per_round : nat64; features : SubnetFeatures; - max_instructions_per_message : nat64; gossip_registry_poll_period_ms : nat32; max_ingress_bytes_per_message : nat64; dkg_dealings_per_block : nat64; max_block_payload_size : nat64; - max_instructions_per_install_code : nat64; start_as_nns : bool; is_halted : bool; gossip_pfn_evaluation_period_ms : nat32; max_ingress_messages_per_block : nat64; max_number_of_canisters : nat64; ecdsa_config : opt EcdsaInitialConfig; + chain_key_config : opt InitialChainKeyConfig; gossip_max_artifact_streams_per_peer : nat32; replica_version_id : text; gossip_max_duplicity : nat32; @@ -119,8 +105,6 @@ type DataCenterRecord = record { owner : text; }; -type DeleteSubnetPayload = record { subnet_id : opt principal }; - type DeployGuestosToAllSubnetNodesPayload = record { subnet_id : principal; replica_version_id : text; @@ -130,6 +114,29 @@ type DeployGuestosToAllUnassignedNodesPayload = record { elected_replica_version : text; }; +type InitialChainKeyConfig = record { + key_configs : vec KeyConfigRequest; + signature_request_timeout_ns : opt nat64; + idkg_key_rotation_period_ms : opt nat64; +}; + +type KeyConfigRequest = record { + key_config : opt KeyConfig; + subnet_id : opt principal; +}; + +type KeyConfig = record { + key_id : opt MasterPublicKeyId; + pre_signatures_to_create_in_advance : opt nat32; + max_queue_size : opt nat32; +}; + +type MasterPublicKeyId = variant { Schnorr : SchnorrKeyId; Ecdsa : EcdsaKeyId }; + +type SchnorrKeyId = record { algorithm : SchnorrAlgorithm; name : text }; + +type SchnorrAlgorithm = variant { ed25519; bip340secp256k1 }; + type EcdsaConfig = record { quadruples_to_create_in_advance : nat32; max_queue_size : opt nat32; @@ -173,6 +180,19 @@ type FirewallRulesScope = variant { Global; }; +type GetApiBoundaryNodeIdsRequest = record { + +}; + +type GetApiBoundaryNodeIdsResponse = variant { + Ok : vec ApiBoundaryNodeIdRecord; + Err : text; +}; + +type ApiBoundaryNodeIdRecord = record { + id : opt principal; +}; + type GetNodeOperatorsAndDcsOfNodeProviderResponse = variant { Ok : vec record { DataCenterRecord; NodeOperatorRecord }; Err : text; @@ -209,6 +229,7 @@ type NodeOperatorRecord = record { type NodeProvidersMonthlyXdrRewards = record { rewards : vec record { text; nat64 }; + registry_version : opt nat64; }; type NodeRewardRate = record { @@ -230,6 +251,7 @@ type RecoverSubnetPayload = record { subnet_id : principal; registry_store_uri : opt record { text; text; nat64 }; ecdsa_config : opt EcdsaInitialConfig; + chain_key_config : opt InitialChainKeyConfig; state_hash : blob; time_ns : nat64; }; @@ -258,8 +280,6 @@ type RerouteCanisterRangesPayload = record { destination_subnet : principal; }; -type RetireReplicaVersionPayload = record { replica_version_ids : vec text }; - type ReviseElectedGuestosVersionsPayload = record { release_package_urls : vec text; replica_versions_to_unelect : vec text; @@ -287,6 +307,11 @@ type UpdateApiBoundaryNodesVersionPayload = record { node_ids : vec principal; }; +type DeployGuestosToSomeApiBoundaryNodes = record { + version : text; + node_ids : vec principal; +}; + type UpdateElectedHostosVersionsPayload = record { release_package_urls : vec text; hostos_version_to_elect : opt text; @@ -294,6 +319,13 @@ type UpdateElectedHostosVersionsPayload = record { release_package_sha256_hex : opt text; }; +type ReviseElectedHostosVersionsPayload = record { + release_package_urls : vec text; + hostos_version_to_elect : opt text; + hostos_versions_to_unelect : vec text; + release_package_sha256_hex : opt text; +}; + type UpdateFirewallRulesPayload = record { expected_hash : text; scope : FirewallRulesScope; @@ -343,6 +375,11 @@ type UpdateNodesHostosVersionPayload = record { node_ids : vec principal; }; +type DeployHostosToSomeNodes = record { + hostos_version_id : opt text; + node_ids : vec principal; +}; + type UpdateSshReadOnlyAccessForAllUnassignedNodesPayload = record { ssh_readonly_keys : vec text; }; @@ -350,35 +387,41 @@ type UpdateSshReadOnlyAccessForAllUnassignedNodesPayload = record { type UpdateSubnetPayload = record { unit_delay_millis : opt nat64; max_duplicity : opt nat32; - max_instructions_per_round : opt nat64; features : opt SubnetFeatures; set_gossip_config_to_default : bool; - max_instructions_per_message : opt nat64; halt_at_cup_height : opt bool; pfn_evaluation_period_ms : opt nat32; subnet_id : principal; max_ingress_bytes_per_message : opt nat64; dkg_dealings_per_block : opt nat64; - ecdsa_key_signing_disable : opt vec EcdsaKeyId; max_block_payload_size : opt nat64; - max_instructions_per_install_code : opt nat64; start_as_nns : opt bool; is_halted : opt bool; max_ingress_messages_per_block : opt nat64; max_number_of_canisters : opt nat64; - ecdsa_config : opt EcdsaConfig; retransmission_request_ms : opt nat32; dkg_interval_length : opt nat64; registry_poll_period_ms : opt nat32; max_chunk_wait_ms : opt nat32; receive_check_cache_size : opt nat32; - ecdsa_key_signing_enable : opt vec EcdsaKeyId; ssh_backup_access : opt vec text; max_chunk_size : opt nat32; initial_notary_delay_millis : opt nat64; max_artifact_streams_per_peer : opt nat32; subnet_type : opt SubnetType; ssh_readonly_access : opt vec text; + chain_key_config : opt ChainKeyConfig; + chain_key_signing_enable : opt vec MasterPublicKeyId; + chain_key_signing_disable : opt vec MasterPublicKeyId; + ecdsa_config : opt EcdsaConfig; + ecdsa_key_signing_enable : opt vec EcdsaKeyId; + ecdsa_key_signing_disable : opt vec EcdsaKeyId; +}; + +type ChainKeyConfig = record { + key_configs : vec KeyConfig; + signature_request_timeout_ns : opt nat64; + idkg_key_rotation_period_ms : opt nat64; }; type UpdateUnassignedNodesConfigPayload = record { @@ -393,18 +436,19 @@ service : { add_node_operator : (AddNodeOperatorPayload) -> (); add_nodes_to_subnet : (AddNodesToSubnetPayload) -> (); add_or_remove_data_centers : (AddOrRemoveDataCentersProposalPayload) -> (); - bless_replica_version : (BlessReplicaVersionPayload) -> (); change_subnet_membership : (ChangeSubnetMembershipPayload) -> (); clear_provisional_whitelist : () -> (); complete_canister_migration : (CompleteCanisterMigrationPayload) -> (); create_subnet : (CreateSubnetPayload) -> (); - delete_subnet : (DeleteSubnetPayload) -> (); deploy_guestos_to_all_subnet_nodes : ( - DeployGuestosToAllSubnetNodesPayload, - ) -> (); + DeployGuestosToAllSubnetNodesPayload + ) -> (); deploy_guestos_to_all_unassigned_nodes : ( - DeployGuestosToAllUnassignedNodesPayload, - ) -> (); + DeployGuestosToAllUnassignedNodesPayload + ) -> (); + deploy_guestos_to_some_api_boundary_nodes : (DeployGuestosToSomeApiBoundaryNodes) -> (); + deploy_hostos_to_some_nodes : (DeployHostosToSomeNodes) -> (); + get_api_boundary_node_ids : (GetApiBoundaryNodeIdsRequest) -> (GetApiBoundaryNodeIdsResponse) query; get_build_metadata : () -> (text) query; get_node_operators_and_dcs_of_node_provider : (principal) -> (GetNodeOperatorsAndDcsOfNodeProviderResponse) query; get_node_providers_monthly_xdr_rewards : () -> (GetNodeProvidersMonthlyXdrRewardsResponse) query; @@ -418,28 +462,27 @@ service : { remove_nodes : (RemoveNodesPayload) -> (); remove_nodes_from_subnet : (RemoveNodesPayload) -> (); reroute_canister_ranges : (RerouteCanisterRangesPayload) -> (); - retire_replica_version : (RetireReplicaVersionPayload) -> (); + revise_elected_guestos_versions : (ReviseElectedGuestosVersionsPayload) -> (); revise_elected_replica_versions : (ReviseElectedGuestosVersionsPayload) -> (); set_firewall_config : (SetFirewallConfigPayload) -> (); update_api_boundary_nodes_version : (UpdateApiBoundaryNodesVersionPayload) -> (); update_elected_hostos_versions : (UpdateElectedHostosVersionsPayload) -> (); - update_elected_replica_versions : (ReviseElectedGuestosVersionsPayload) -> (); + revise_elected_hostos_versions : (ReviseElectedHostosVersionsPayload) -> (); update_firewall_rules : (UpdateFirewallRulesPayload) -> (); update_node_directly : (UpdateNodeDirectlyPayload) -> (); update_node_domain_directly : (UpdateNodeDomainDirectlyPayload) -> (UpdateNodeDomainDirectlyResponse); update_node_ipv4_config_directly : (UpdateNodeIPv4ConfigDirectlyPayload) -> ( - UpdateNodeIpv4ConfigDirectlyResponse, - ); + UpdateNodeIpv4ConfigDirectlyResponse + ); update_node_operator_config : (UpdateNodeOperatorConfigPayload) -> (); update_node_operator_config_directly : ( - UpdateNodeOperatorConfigDirectlyPayload, - ) -> (); + UpdateNodeOperatorConfigDirectlyPayload + ) -> (); update_node_rewards_table : (UpdateNodeRewardsTableProposalPayload) -> (); update_nodes_hostos_version : (UpdateNodesHostosVersionPayload) -> (); update_ssh_readonly_access_for_all_unassigned_nodes : ( - UpdateSshReadOnlyAccessForAllUnassignedNodesPayload, - ) -> (); + UpdateSshReadOnlyAccessForAllUnassignedNodesPayload + ) -> (); update_subnet : (UpdateSubnetPayload) -> (); - update_subnet_replica_version : (DeployGuestosToAllSubnetNodesPayload) -> (); update_unassigned_nodes_config : (UpdateUnassignedNodesConfigPayload) -> (); -} +}; diff --git a/ic/testdata/gen.go b/ic/testdata/gen.go index 19b6aee..99eff96 100644 --- a/ic/testdata/gen.go +++ b/ic/testdata/gen.go @@ -4,22 +4,23 @@ import ( "bytes" "embed" "fmt" - "github.com/aviate-labs/agent-go/gen" "io" "log" "net/http" "os" "strings" "unicode" + + "github.com/aviate-labs/agent-go/gen" ) var ( //go:embed did dids embed.FS - ICVersion = "release-2024-06-05_23-01-base" + ICVersion = "release-2024-09-19_01-31-base" InterfaceSpecVersion = "0.23.0" - SDKVersion = "0.20.1" + SDKVersion = "0.23.0" ) func checkLatest() error { diff --git a/pocketic/management.go b/pocketic/management.go index a87cd55..fbb4451 100644 --- a/pocketic/management.go +++ b/pocketic/management.go @@ -64,7 +64,13 @@ func (pic PocketIC) InstallCode(canisterID principal.Principal, wasmModule []byt sender = *optSender } payload, err := idl.Marshal([]any{ic0.InstallCodeArgs{ - Mode: ic0.CanisterInstallMode{ + Mode: struct { + Install *idl.Null `ic:"install,variant"` + Reinstall *idl.Null `ic:"reinstall,variant"` + Upgrade **struct { + SkipPreUpgrade *bool `ic:"skip_pre_upgrade,omitempty" json:"skip_pre_upgrade,omitempty"` + } `ic:"upgrade,variant"` + }{ Install: new(idl.Null), }, WasmModule: wasmModule, diff --git a/pocketic/pocketic_test.go b/pocketic/pocketic_test.go index 3bba2b2..4d09468 100644 --- a/pocketic/pocketic_test.go +++ b/pocketic/pocketic_test.go @@ -107,7 +107,13 @@ func TestHttpGateway(t *testing.T) { wasmModule := compileMotoko(t, "testdata/main.mo", "testdata/main.wasm") if err := mgmtAgent.InstallCode(ic0.InstallCodeArgs{ - Mode: ic0.CanisterInstallMode{ + Mode: struct { + Install *idl.Null `ic:"install,variant"` + Reinstall *idl.Null `ic:"reinstall,variant"` + Upgrade **struct { + SkipPreUpgrade *bool `ic:"skip_pre_upgrade,omitempty" json:"skip_pre_upgrade,omitempty"` + } `ic:"upgrade,variant"` + }{ Install: new(idl.Null), }, CanisterId: result.CanisterId,