diff --git a/packages/ckbtc/candid/minter.did b/packages/ckbtc/candid/minter.did index 586ed6f67..80bf87f7c 100644 --- a/packages/ckbtc/candid/minter.did +++ b/packages/ckbtc/candid/minter.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit 4de99bc27b (2023-11-20) 'rs/bitcoin/ckbtc/minter/ckbtc_minter.did' by import-candid +// Generated from IC repo commit 69e1408 (2023-11-23 tags: release-2023-11-23_23-01) 'rs/bitcoin/ckbtc/minter/ckbtc_minter.did' by import-candid // Represents an account on the ckBTC ledger. type Account = record { owner : principal; subaccount : opt blob }; diff --git a/packages/cmc/candid/cmc.certified.idl.js b/packages/cmc/candid/cmc.certified.idl.js index 85b6cbed7..8945cb4bd 100644 --- a/packages/cmc/candid/cmc.certified.idl.js +++ b/packages/cmc/candid/cmc.certified.idl.js @@ -12,6 +12,37 @@ export const idlFactory = ({ IDL }) => { 'minting_account_id' : IDL.Opt(AccountIdentifier), 'ledger_canister_id' : IDL.Opt(IDL.Principal), }); + const SubnetFilter = IDL.Record({ 'subnet_type' : IDL.Opt(IDL.Text) }); + const SubnetSelection = IDL.Variant({ + 'Filter' : SubnetFilter, + 'Subnet' : IDL.Record({ 'subnet' : IDL.Principal }), + }); + const CanisterSettings = IDL.Record({ + 'freezing_threshold' : IDL.Opt(IDL.Nat), + 'controllers' : IDL.Opt(IDL.Vec(IDL.Principal)), + 'reserved_cycles_limit' : IDL.Opt(IDL.Nat), + 'memory_allocation' : IDL.Opt(IDL.Nat), + 'compute_allocation' : IDL.Opt(IDL.Nat), + }); + const CreateCanisterArg = IDL.Record({ + 'subnet_selection' : IDL.Opt(SubnetSelection), + 'settings' : IDL.Opt(CanisterSettings), + 'subnet_type' : IDL.Opt(IDL.Text), + }); + const CreateCanisterError = IDL.Variant({ + 'Refunded' : IDL.Record({ + 'create_error' : IDL.Text, + 'refund_amount' : IDL.Nat, + }), + 'RefundFailed' : IDL.Record({ + 'create_error' : IDL.Text, + 'refund_error' : IDL.Text, + }), + }); + const CreateCanisterResult = IDL.Variant({ + 'Ok' : IDL.Principal, + 'Err' : CreateCanisterError, + }); const IcpXdrConversionRate = IDL.Record({ 'xdr_permyriad_per_icp' : IDL.Nat64, 'timestamp_seconds' : IDL.Nat64, @@ -31,6 +62,8 @@ export const idlFactory = ({ IDL }) => { const NotifyCreateCanisterArg = IDL.Record({ 'controller' : IDL.Principal, 'block_index' : BlockIndex, + 'subnet_selection' : IDL.Opt(IDL.Vec(SubnetSelection)), + 'settings' : IDL.Opt(CanisterSettings), 'subnet_type' : IDL.Opt(IDL.Text), }); const NotifyError = IDL.Variant({ @@ -57,6 +90,11 @@ export const idlFactory = ({ IDL }) => { const Cycles = IDL.Nat; const NotifyTopUpResult = IDL.Variant({ 'Ok' : Cycles, 'Err' : NotifyError }); return IDL.Service({ + 'create_canister' : IDL.Func( + [CreateCanisterArg], + [CreateCanisterResult], + [], + ), 'get_icp_xdr_conversion_rate' : IDL.Func( [], [IcpXdrConversionRateResponse], diff --git a/packages/cmc/candid/cmc.d.ts b/packages/cmc/candid/cmc.d.ts index 21b3bf5b4..b712e709a 100644 --- a/packages/cmc/candid/cmc.d.ts +++ b/packages/cmc/candid/cmc.d.ts @@ -5,6 +5,26 @@ export interface AccountIdentifier { bytes: Uint8Array | number[]; } export type BlockIndex = bigint; +export interface CanisterSettings { + freezing_threshold: [] | [bigint]; + controllers: [] | [Array]; + reserved_cycles_limit: [] | [bigint]; + memory_allocation: [] | [bigint]; + compute_allocation: [] | [bigint]; +} +export interface CreateCanisterArg { + subnet_selection: [] | [SubnetSelection]; + settings: [] | [CanisterSettings]; + subnet_type: [] | [string]; +} +export type CreateCanisterError = + | { + Refunded: { create_error: string; refund_amount: bigint }; + } + | { RefundFailed: { create_error: string; refund_error: string } }; +export type CreateCanisterResult = + | { Ok: Principal } + | { Err: CreateCanisterError }; export type Cycles = bigint; export interface CyclesCanisterInitPayload { exchange_rate_canister: [] | [ExchangeRateCanister]; @@ -26,6 +46,8 @@ export interface IcpXdrConversionRateResponse { export interface NotifyCreateCanisterArg { controller: Principal; block_index: BlockIndex; + subnet_selection: [] | [Array]; + settings: [] | [CanisterSettings]; subnet_type: [] | [string]; } export type NotifyCreateCanisterResult = @@ -47,10 +69,17 @@ export type NotifyTopUpResult = { Ok: Cycles } | { Err: NotifyError }; export interface PrincipalsAuthorizedToCreateCanistersToSubnetsResponse { data: Array<[Principal, Array]>; } +export interface SubnetFilter { + subnet_type: [] | [string]; +} +export type SubnetSelection = + | { Filter: SubnetFilter } + | { Subnet: { subnet: Principal } }; export interface SubnetTypesToSubnetsResponse { data: Array<[string, Array]>; } export interface _SERVICE { + create_canister: ActorMethod<[CreateCanisterArg], CreateCanisterResult>; get_icp_xdr_conversion_rate: ActorMethod<[], IcpXdrConversionRateResponse>; get_principals_authorized_to_create_canisters_to_subnets: ActorMethod< [], diff --git a/packages/cmc/candid/cmc.did b/packages/cmc/candid/cmc.did index bbbb9bf1c..d743dd594 100644 --- a/packages/cmc/candid/cmc.did +++ b/packages/cmc/candid/cmc.did @@ -1,6 +1,13 @@ -// Generated from IC repo commit d2331ec4b3c60f408b876427d7238ec15fb16ad5 'rs/nns/cmc/cmc.did' by import-candid +// Generated from IC repo commit 69e1408 (2023-11-23 tags: release-2023-11-23_23-01) 'rs/nns/cmc/cmc.did' by import-candid type Cycles = nat; type BlockIndex = nat64; +type CanisterSettings = record { + controllers : opt vec principal; + compute_allocation : opt nat; + memory_allocation : opt nat; + freezing_threshold : opt nat; + reserved_cycles_limit: opt nat; +}; // The argument of the [notify_top_up] method. type NotifyTopUpArg = record { @@ -11,6 +18,35 @@ 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; +}; + +type SubnetFilter = record { + subnet_type: opt text; +}; + +// The argument of the [create_canister] method. +type CreateCanisterArg = record { + // 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. + settings : opt CanisterSettings; + + // 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; + + // Optional instructions to select on which subnet the new canister will be created on. + subnet_selection: opt SubnetSelection; +}; + // The argument of the [notify_create_canister] method. type NotifyCreateCanisterArg = record { // Index of the block on the ICP ledger that contains the payment. @@ -21,7 +57,35 @@ 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; + + // 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 vec 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. + settings : opt CanisterSettings; +}; + +// Canister creation failed and the cycles attached to the call were returned to the calling canister. +// A small fee may be charged. +type CreateCanisterError = variant { + Refunded : record { + // The amount of cycles returned to the calling canister + 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; + }; }; type NotifyError = variant { @@ -58,6 +122,12 @@ type NotifyTopUpResult = variant { Err : NotifyError; }; +type CreateCanisterResult = variant { + // The principal of the newly created canister. + Ok : principal; + Err : CreateCanisterError; +}; + type NotifyCreateCanisterResult = variant { // The principal of the newly created canister. Ok : principal; @@ -124,10 +194,13 @@ type CyclesCanisterInitPayload = record { }; service : (opt CyclesCanisterInitPayload) -> { - // Propmts the cycles minting canister to process a payment by converting ICP + // Prompts the cycles minting canister to process a payment by converting ICP // into cycles and sending the cycles the specified canister. notify_top_up : (NotifyTopUpArg) -> (NotifyTopUpResult); + // Creates a canister using the cycles attached to the function call. + create_canister : (CreateCanisterArg) -> (CreateCanisterResult); + // Prompts the cycles minting canister to process a payment for canister creation. notify_create_canister : (NotifyCreateCanisterArg) -> (NotifyCreateCanisterResult); diff --git a/packages/cmc/candid/cmc.idl.js b/packages/cmc/candid/cmc.idl.js index 83a4a6aed..ac20d6bce 100644 --- a/packages/cmc/candid/cmc.idl.js +++ b/packages/cmc/candid/cmc.idl.js @@ -12,6 +12,37 @@ export const idlFactory = ({ IDL }) => { 'minting_account_id' : IDL.Opt(AccountIdentifier), 'ledger_canister_id' : IDL.Opt(IDL.Principal), }); + const SubnetFilter = IDL.Record({ 'subnet_type' : IDL.Opt(IDL.Text) }); + const SubnetSelection = IDL.Variant({ + 'Filter' : SubnetFilter, + 'Subnet' : IDL.Record({ 'subnet' : IDL.Principal }), + }); + const CanisterSettings = IDL.Record({ + 'freezing_threshold' : IDL.Opt(IDL.Nat), + 'controllers' : IDL.Opt(IDL.Vec(IDL.Principal)), + 'reserved_cycles_limit' : IDL.Opt(IDL.Nat), + 'memory_allocation' : IDL.Opt(IDL.Nat), + 'compute_allocation' : IDL.Opt(IDL.Nat), + }); + const CreateCanisterArg = IDL.Record({ + 'subnet_selection' : IDL.Opt(SubnetSelection), + 'settings' : IDL.Opt(CanisterSettings), + 'subnet_type' : IDL.Opt(IDL.Text), + }); + const CreateCanisterError = IDL.Variant({ + 'Refunded' : IDL.Record({ + 'create_error' : IDL.Text, + 'refund_amount' : IDL.Nat, + }), + 'RefundFailed' : IDL.Record({ + 'create_error' : IDL.Text, + 'refund_error' : IDL.Text, + }), + }); + const CreateCanisterResult = IDL.Variant({ + 'Ok' : IDL.Principal, + 'Err' : CreateCanisterError, + }); const IcpXdrConversionRate = IDL.Record({ 'xdr_permyriad_per_icp' : IDL.Nat64, 'timestamp_seconds' : IDL.Nat64, @@ -31,6 +62,8 @@ export const idlFactory = ({ IDL }) => { const NotifyCreateCanisterArg = IDL.Record({ 'controller' : IDL.Principal, 'block_index' : BlockIndex, + 'subnet_selection' : IDL.Opt(IDL.Vec(SubnetSelection)), + 'settings' : IDL.Opt(CanisterSettings), 'subnet_type' : IDL.Opt(IDL.Text), }); const NotifyError = IDL.Variant({ @@ -57,6 +90,11 @@ export const idlFactory = ({ IDL }) => { const Cycles = IDL.Nat; const NotifyTopUpResult = IDL.Variant({ 'Ok' : Cycles, 'Err' : NotifyError }); return IDL.Service({ + 'create_canister' : IDL.Func( + [CreateCanisterArg], + [CreateCanisterResult], + [], + ), 'get_icp_xdr_conversion_rate' : IDL.Func( [], [IcpXdrConversionRateResponse], diff --git a/packages/ic-management/candid/ic-management.certified.idl.js b/packages/ic-management/candid/ic-management.certified.idl.js index 27ccaa55a..34e493dbe 100644 --- a/packages/ic-management/candid/ic-management.certified.idl.js +++ b/packages/ic-management/candid/ic-management.certified.idl.js @@ -93,9 +93,11 @@ export const idlFactory = ({ IDL }) => { 'body' : IDL.Vec(IDL.Nat8), 'headers' : IDL.Vec(http_header), }); + const chunk_hash = IDL.Vec(IDL.Nat8); const wasm_module = IDL.Vec(IDL.Nat8); return IDL.Service({ 'bitcoin_get_balance' : IDL.Func([get_balance_request], [satoshi], []), + 'bitcoin_get_balance_' : IDL.Func([get_balance_request], [satoshi], []), 'bitcoin_get_current_fee_percentiles' : IDL.Func( [get_current_fee_percentiles_request], [IDL.Vec(millisatoshi_per_byte)], @@ -106,6 +108,11 @@ export const idlFactory = ({ IDL }) => { [get_utxos_response], [], ), + 'bitcoin_get_utxos_' : IDL.Func( + [get_utxos_request], + [get_utxos_response], + [], + ), 'bitcoin_send_transaction' : IDL.Func([send_transaction_request], [], []), 'canister_info' : IDL.Func( [ @@ -142,6 +149,11 @@ export const idlFactory = ({ IDL }) => { ], [], ), + 'clear_chunk_store' : IDL.Func( + [IDL.Record({ 'canister_id' : canister_id })], + [], + [], + ), 'create_canister' : IDL.Func( [ IDL.Record({ @@ -210,6 +222,27 @@ export const idlFactory = ({ IDL }) => { [http_response], [], ), + 'install_chunked_code' : IDL.Func( + [ + IDL.Record({ + 'arg' : IDL.Vec(IDL.Nat8), + 'wasm_module_hash' : IDL.Vec(IDL.Nat8), + 'mode' : IDL.Variant({ + 'reinstall' : IDL.Null, + 'upgrade' : IDL.Opt( + IDL.Record({ 'skip_pre_upgrade' : IDL.Opt(IDL.Bool) }) + ), + 'install' : IDL.Null, + }), + 'chunk_hashes_list' : IDL.Vec(chunk_hash), + 'target_canister' : canister_id, + 'sender_canister_version' : IDL.Opt(IDL.Nat64), + 'storage_canister' : IDL.Opt(canister_id), + }), + ], + [], + [], + ), 'install_code' : IDL.Func( [ IDL.Record({ @@ -217,7 +250,9 @@ export const idlFactory = ({ IDL }) => { 'wasm_module' : wasm_module, 'mode' : IDL.Variant({ 'reinstall' : IDL.Null, - 'upgrade' : IDL.Null, + 'upgrade' : IDL.Opt( + IDL.Record({ 'skip_pre_upgrade' : IDL.Opt(IDL.Bool) }) + ), 'install' : IDL.Null, }), 'canister_id' : canister_id, @@ -266,6 +301,11 @@ export const idlFactory = ({ IDL }) => { [], [], ), + 'stored_chunks' : IDL.Func( + [IDL.Record({ 'canister_id' : canister_id })], + [IDL.Vec(chunk_hash)], + [], + ), 'uninstall_code' : IDL.Func( [ IDL.Record({ @@ -287,6 +327,16 @@ export const idlFactory = ({ IDL }) => { [], [], ), + 'upload_chunk' : IDL.Func( + [ + IDL.Record({ + 'chunk' : IDL.Vec(IDL.Nat8), + 'canister_id' : IDL.Principal, + }), + ], + [chunk_hash], + [], + ), }); }; export const init = ({ IDL }) => { return []; }; diff --git a/packages/ic-management/candid/ic-management.d.ts b/packages/ic-management/candid/ic-management.d.ts index c60714059..ffd48a6ac 100644 --- a/packages/ic-management/candid/ic-management.d.ts +++ b/packages/ic-management/candid/ic-management.d.ts @@ -37,6 +37,7 @@ export type change_origin = canister_id: Principal; }; }; +export type chunk_hash = Uint8Array | number[]; export interface definite_canister_settings { freezing_threshold: bigint; controllers: Array; @@ -92,11 +93,13 @@ export interface utxo { export type wasm_module = Uint8Array | number[]; export interface _SERVICE { bitcoin_get_balance: ActorMethod<[get_balance_request], satoshi>; + bitcoin_get_balance_query: ActorMethod<[get_balance_request], satoshi>; bitcoin_get_current_fee_percentiles: ActorMethod< [get_current_fee_percentiles_request], BigUint64Array | bigint[] >; bitcoin_get_utxos: ActorMethod<[get_utxos_request], get_utxos_response>; + bitcoin_get_utxos_query: ActorMethod<[get_utxos_request], get_utxos_response>; bitcoin_send_transaction: ActorMethod<[send_transaction_request], undefined>; canister_info: ActorMethod< [{ canister_id: canister_id; num_requested_changes: [] | [bigint] }], @@ -118,6 +121,7 @@ export interface _SERVICE { module_hash: [] | [Uint8Array | number[]]; } >; + clear_chunk_store: ActorMethod<[{ canister_id: canister_id }], undefined>; create_canister: ActorMethod< [ { @@ -162,12 +166,32 @@ export interface _SERVICE { ], http_response >; + install_chunked_code: ActorMethod< + [ + { + arg: Uint8Array | number[]; + wasm_module_hash: Uint8Array | number[]; + mode: + | { reinstall: null } + | { upgrade: [] | [{ skip_pre_upgrade: [] | [boolean] }] } + | { install: null }; + chunk_hashes_list: Array; + target_canister: canister_id; + sender_canister_version: [] | [bigint]; + storage_canister: [] | [canister_id]; + }, + ], + undefined + >; install_code: ActorMethod< [ { arg: Uint8Array | number[]; wasm_module: wasm_module; - mode: { reinstall: null } | { upgrade: null } | { install: null }; + mode: + | { reinstall: null } + | { upgrade: [] | [{ skip_pre_upgrade: [] | [boolean] }] } + | { install: null }; canister_id: canister_id; sender_canister_version: [] | [bigint]; }, @@ -202,6 +226,7 @@ export interface _SERVICE { >; start_canister: ActorMethod<[{ canister_id: canister_id }], undefined>; stop_canister: ActorMethod<[{ canister_id: canister_id }], undefined>; + stored_chunks: ActorMethod<[{ canister_id: canister_id }], Array>; uninstall_code: ActorMethod< [ { @@ -221,4 +246,8 @@ export interface _SERVICE { ], undefined >; + upload_chunk: ActorMethod< + [{ chunk: Uint8Array | number[]; canister_id: Principal }], + chunk_hash + >; } diff --git a/packages/ic-management/candid/ic-management.did b/packages/ic-management/candid/ic-management.did index 44b44e722..c0d684461 100644 --- a/packages/ic-management/candid/ic-management.did +++ b/packages/ic-management/candid/ic-management.did @@ -46,6 +46,8 @@ type change = record { details : change_details; }; +type chunk_hash = blob; + type http_header = record { name: text; value: text }; type http_response = record { @@ -121,13 +123,40 @@ service ic : { settings : canister_settings; sender_canister_version : opt nat64; }) -> (); + upload_chunk : (record { + canister_id : principal; + chunk : blob; + }) -> (chunk_hash); + clear_chunk_store: (record {canister_id : canister_id}) -> (); + stored_chunks: (record {canister_id : canister_id}) -> (vec chunk_hash); install_code : (record { - mode : variant {install; reinstall; upgrade}; + mode : variant { + install; + reinstall; + upgrade : opt record { + skip_pre_upgrade: opt bool; + } + }; canister_id : canister_id; wasm_module : wasm_module; arg : blob; sender_canister_version : opt nat64; }) -> (); + install_chunked_code: (record { + mode : variant { + install; + reinstall; + upgrade : opt record { + skip_pre_upgrade: opt bool; + }; + }; + target_canister: canister_id; + storage_canister: opt canister_id; + chunk_hashes_list: vec chunk_hash; + wasm_module_hash: blob; + arg : blob; + sender_canister_version : opt nat64; + }) -> (); uninstall_code : (record { canister_id : canister_id; sender_canister_version : opt nat64; @@ -180,7 +209,9 @@ service ic : { // bitcoin interface bitcoin_get_balance: (get_balance_request) -> (satoshi); + bitcoin_get_balance_query: (get_balance_request) -> (satoshi) query; bitcoin_get_utxos: (get_utxos_request) -> (get_utxos_response); + bitcoin_get_utxos_query: (get_utxos_request) -> (get_utxos_response) query; bitcoin_send_transaction: (send_transaction_request) -> (); bitcoin_get_current_fee_percentiles: (get_current_fee_percentiles_request) -> (vec millisatoshi_per_byte); diff --git a/packages/ic-management/candid/ic-management.idl.js b/packages/ic-management/candid/ic-management.idl.js index c42435d50..52ea9217f 100644 --- a/packages/ic-management/candid/ic-management.idl.js +++ b/packages/ic-management/candid/ic-management.idl.js @@ -93,9 +93,15 @@ export const idlFactory = ({ IDL }) => { 'body' : IDL.Vec(IDL.Nat8), 'headers' : IDL.Vec(http_header), }); + const chunk_hash = IDL.Vec(IDL.Nat8); const wasm_module = IDL.Vec(IDL.Nat8); return IDL.Service({ 'bitcoin_get_balance' : IDL.Func([get_balance_request], [satoshi], []), + 'bitcoin_get_balance_query' : IDL.Func( + [get_balance_request], + [satoshi], + ['query'], + ), 'bitcoin_get_current_fee_percentiles' : IDL.Func( [get_current_fee_percentiles_request], [IDL.Vec(millisatoshi_per_byte)], @@ -106,6 +112,11 @@ export const idlFactory = ({ IDL }) => { [get_utxos_response], [], ), + 'bitcoin_get_utxos_query' : IDL.Func( + [get_utxos_request], + [get_utxos_response], + ['query'], + ), 'bitcoin_send_transaction' : IDL.Func([send_transaction_request], [], []), 'canister_info' : IDL.Func( [ @@ -142,6 +153,11 @@ export const idlFactory = ({ IDL }) => { ], [], ), + 'clear_chunk_store' : IDL.Func( + [IDL.Record({ 'canister_id' : canister_id })], + [], + [], + ), 'create_canister' : IDL.Func( [ IDL.Record({ @@ -210,6 +226,27 @@ export const idlFactory = ({ IDL }) => { [http_response], [], ), + 'install_chunked_code' : IDL.Func( + [ + IDL.Record({ + 'arg' : IDL.Vec(IDL.Nat8), + 'wasm_module_hash' : IDL.Vec(IDL.Nat8), + 'mode' : IDL.Variant({ + 'reinstall' : IDL.Null, + 'upgrade' : IDL.Opt( + IDL.Record({ 'skip_pre_upgrade' : IDL.Opt(IDL.Bool) }) + ), + 'install' : IDL.Null, + }), + 'chunk_hashes_list' : IDL.Vec(chunk_hash), + 'target_canister' : canister_id, + 'sender_canister_version' : IDL.Opt(IDL.Nat64), + 'storage_canister' : IDL.Opt(canister_id), + }), + ], + [], + [], + ), 'install_code' : IDL.Func( [ IDL.Record({ @@ -217,7 +254,9 @@ export const idlFactory = ({ IDL }) => { 'wasm_module' : wasm_module, 'mode' : IDL.Variant({ 'reinstall' : IDL.Null, - 'upgrade' : IDL.Null, + 'upgrade' : IDL.Opt( + IDL.Record({ 'skip_pre_upgrade' : IDL.Opt(IDL.Bool) }) + ), 'install' : IDL.Null, }), 'canister_id' : canister_id, @@ -266,6 +305,11 @@ export const idlFactory = ({ IDL }) => { [], [], ), + 'stored_chunks' : IDL.Func( + [IDL.Record({ 'canister_id' : canister_id })], + [IDL.Vec(chunk_hash)], + [], + ), 'uninstall_code' : IDL.Func( [ IDL.Record({ @@ -287,6 +331,16 @@ export const idlFactory = ({ IDL }) => { [], [], ), + 'upload_chunk' : IDL.Func( + [ + IDL.Record({ + 'chunk' : IDL.Vec(IDL.Nat8), + 'canister_id' : IDL.Principal, + }), + ], + [chunk_hash], + [], + ), }); }; export const init = ({ IDL }) => { return []; }; diff --git a/packages/ledger-icp/candid/index.did b/packages/ledger-icp/candid/index.did index 6794e1c0d..80dd0ca2b 100644 --- a/packages/ledger-icp/candid/index.did +++ b/packages/ledger-icp/candid/index.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit b501a71346fa465cb5d7817c895295150979c180 'rs/rosetta-api/icp_ledger/index/index.did' by import-candid +// Generated from IC repo commit 69e1408 (2023-11-23 tags: release-2023-11-23_23-01) 'rs/rosetta-api/icp_ledger/index/index.did' by import-candid type Account = record { owner : principal; subaccount : opt vec nat8 }; type GetAccountIdentifierTransactionsArgs = record { max_results : nat64; diff --git a/packages/ledger-icp/candid/ledger.certified.idl.js b/packages/ledger-icp/candid/ledger.certified.idl.js index a3ab1bf34..162a384f5 100644 --- a/packages/ledger-icp/candid/ledger.certified.idl.js +++ b/packages/ledger-icp/candid/ledger.certified.idl.js @@ -16,6 +16,7 @@ export const idlFactory = ({ IDL }) => { const Duration = IDL.Record({ 'secs' : IDL.Nat64, 'nanos' : IDL.Nat32 }); const ArchiveOptions = IDL.Record({ 'num_blocks_to_archive' : IDL.Nat64, + 'max_transactions_per_response' : IDL.Opt(IDL.Nat64), 'trigger_threshold' : IDL.Nat64, 'max_message_size_bytes' : IDL.Opt(IDL.Nat64), 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64), @@ -55,6 +56,7 @@ export const idlFactory = ({ IDL }) => { 'from' : AccountIdentifier, 'allowance_e8s' : IDL.Int, 'allowance' : Tokens, + 'expected_allowance' : IDL.Opt(Tokens), 'expires_at' : IDL.Opt(TimeStamp), 'spender' : AccountIdentifier, }), @@ -69,13 +71,7 @@ export const idlFactory = ({ IDL }) => { 'fee' : Tokens, 'from' : AccountIdentifier, 'amount' : Tokens, - }), - 'TransferFrom' : IDL.Record({ - 'to' : AccountIdentifier, - 'fee' : Tokens, - 'from' : AccountIdentifier, - 'amount' : Tokens, - 'spender' : AccountIdentifier, + 'spender' : IDL.Opt(IDL.Vec(IDL.Nat8)), }), }); const Transaction = IDL.Record({ @@ -184,16 +180,16 @@ export const idlFactory = ({ IDL }) => { }); const Allowance = IDL.Record({ 'allowance' : Icrc1Tokens, - 'expires_at' : IDL.Opt(TimeStamp), + 'expires_at' : IDL.Opt(Icrc1Timestamp), }); const ApproveArgs = IDL.Record({ 'fee' : IDL.Opt(Icrc1Tokens), 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)), 'from_subaccount' : IDL.Opt(SubAccount), - 'created_at_time' : IDL.Opt(TimeStamp), + 'created_at_time' : IDL.Opt(Icrc1Timestamp), 'amount' : Icrc1Tokens, 'expected_allowance' : IDL.Opt(Icrc1Tokens), - 'expires_at' : IDL.Opt(TimeStamp), + 'expires_at' : IDL.Opt(Icrc1Timestamp), 'spender' : Account, }); const ApproveError = IDL.Variant({ @@ -214,6 +210,33 @@ export const idlFactory = ({ IDL }) => { 'Ok' : Icrc1BlockIndex, 'Err' : ApproveError, }); + const TransferFromArgs = IDL.Record({ + 'to' : Account, + 'fee' : IDL.Opt(Icrc1Tokens), + 'spender_subaccount' : IDL.Opt(SubAccount), + 'from' : Account, + 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'created_at_time' : IDL.Opt(Icrc1Timestamp), + 'amount' : Icrc1Tokens, + }); + const TransferFromError = IDL.Variant({ + 'GenericError' : IDL.Record({ + 'message' : IDL.Text, + 'error_code' : IDL.Nat, + }), + 'TemporarilyUnavailable' : IDL.Null, + 'InsufficientAllowance' : IDL.Record({ 'allowance' : Icrc1Tokens }), + 'BadBurn' : IDL.Record({ 'min_burn_amount' : Icrc1Tokens }), + 'Duplicate' : IDL.Record({ 'duplicate_of' : Icrc1BlockIndex }), + 'BadFee' : IDL.Record({ 'expected_fee' : Icrc1Tokens }), + 'CreatedInFuture' : IDL.Record({ 'ledger_time' : Icrc1Timestamp }), + 'TooOld' : IDL.Null, + 'InsufficientFunds' : IDL.Record({ 'balance' : Icrc1Tokens }), + }); + const TransferFromResult = IDL.Variant({ + 'Ok' : Icrc1BlockIndex, + 'Err' : TransferFromError, + }); const SendArgs = IDL.Record({ 'to' : TextAccountIdentifier, 'fee' : Tokens, @@ -271,6 +294,11 @@ export const idlFactory = ({ IDL }) => { 'icrc1_transfer' : IDL.Func([TransferArg], [Icrc1TransferResult], []), 'icrc2_allowance' : IDL.Func([AllowanceArgs], [Allowance], []), 'icrc2_approve' : IDL.Func([ApproveArgs], [ApproveResult], []), + 'icrc2_transfer_from' : IDL.Func( + [TransferFromArgs], + [TransferFromResult], + [], + ), 'name' : IDL.Func([], [IDL.Record({ 'name' : IDL.Text })], []), 'send_dfx' : IDL.Func([SendArgs], [BlockIndex], []), 'symbol' : IDL.Func([], [IDL.Record({ 'symbol' : IDL.Text })], []), @@ -295,6 +323,7 @@ export const init = ({ IDL }) => { const Duration = IDL.Record({ 'secs' : IDL.Nat64, 'nanos' : IDL.Nat32 }); const ArchiveOptions = IDL.Record({ 'num_blocks_to_archive' : IDL.Nat64, + 'max_transactions_per_response' : IDL.Opt(IDL.Nat64), 'trigger_threshold' : IDL.Nat64, 'max_message_size_bytes' : IDL.Opt(IDL.Nat64), 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64), diff --git a/packages/ledger-icp/candid/ledger.d.ts b/packages/ledger-icp/candid/ledger.d.ts index 03edf0cb9..afb0c1c56 100644 --- a/packages/ledger-icp/candid/ledger.d.ts +++ b/packages/ledger-icp/candid/ledger.d.ts @@ -14,7 +14,7 @@ export interface AccountBalanceArgsDfx { export type AccountIdentifier = Uint8Array | number[]; export interface Allowance { allowance: Icrc1Tokens; - expires_at: [] | [TimeStamp]; + expires_at: [] | [Icrc1Timestamp]; } export interface AllowanceArgs { account: Account; @@ -24,10 +24,10 @@ export interface ApproveArgs { fee: [] | [Icrc1Tokens]; memo: [] | [Uint8Array | number[]]; from_subaccount: [] | [SubAccount]; - created_at_time: [] | [TimeStamp]; + created_at_time: [] | [Icrc1Timestamp]; amount: Icrc1Tokens; expected_allowance: [] | [Icrc1Tokens]; - expires_at: [] | [TimeStamp]; + expires_at: [] | [Icrc1Timestamp]; spender: Account; } export type ApproveError = @@ -48,6 +48,7 @@ export interface Archive { } export interface ArchiveOptions { num_blocks_to_archive: bigint; + max_transactions_per_response: [] | [bigint]; trigger_threshold: bigint; max_message_size_bytes: [] | [bigint]; cycles_for_archive_creation: [] | [bigint]; @@ -130,6 +131,7 @@ export type Operation = from: AccountIdentifier; allowance_e8s: bigint; allowance: Tokens; + expected_allowance: [] | [Tokens]; expires_at: [] | [TimeStamp]; spender: AccountIdentifier; }; @@ -148,15 +150,7 @@ export type Operation = fee: Tokens; from: AccountIdentifier; amount: Tokens; - }; - } - | { - TransferFrom: { - to: AccountIdentifier; - fee: Tokens; - from: AccountIdentifier; - amount: Tokens; - spender: AccountIdentifier; + spender: [] | [Uint8Array | number[]]; }; }; export type QueryArchiveError = @@ -235,6 +229,30 @@ export interface TransferFee { transfer_fee: Tokens; } export type TransferFeeArg = {}; +export interface TransferFromArgs { + to: Account; + fee: [] | [Icrc1Tokens]; + spender_subaccount: [] | [SubAccount]; + from: Account; + memo: [] | [Uint8Array | number[]]; + created_at_time: [] | [Icrc1Timestamp]; + amount: Icrc1Tokens; +} +export type TransferFromError = + | { + GenericError: { message: string; error_code: bigint }; + } + | { TemporarilyUnavailable: null } + | { InsufficientAllowance: { allowance: Icrc1Tokens } } + | { BadBurn: { min_burn_amount: Icrc1Tokens } } + | { Duplicate: { duplicate_of: Icrc1BlockIndex } } + | { BadFee: { expected_fee: Icrc1Tokens } } + | { CreatedInFuture: { ledger_time: Icrc1Timestamp } } + | { TooOld: null } + | { InsufficientFunds: { balance: Icrc1Tokens } }; +export type TransferFromResult = + | { Ok: Icrc1BlockIndex } + | { Err: TransferFromError }; export type TransferResult = { Ok: BlockIndex } | { Err: TransferError }; export interface UpgradeArgs { maximum_number_of_accounts: [] | [bigint]; @@ -267,6 +285,7 @@ export interface _SERVICE { icrc1_transfer: ActorMethod<[TransferArg], Icrc1TransferResult>; icrc2_allowance: ActorMethod<[AllowanceArgs], Allowance>; icrc2_approve: ActorMethod<[ApproveArgs], ApproveResult>; + icrc2_transfer_from: ActorMethod<[TransferFromArgs], TransferFromResult>; name: ActorMethod<[], { name: string }>; query_blocks: ActorMethod<[GetBlocksArgs], QueryBlocksResponse>; query_encoded_blocks: ActorMethod< diff --git a/packages/ledger-icp/candid/ledger.did b/packages/ledger-icp/candid/ledger.did index 7c7904875..4817b84cf 100644 --- a/packages/ledger-icp/candid/ledger.did +++ b/packages/ledger-icp/candid/ledger.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit 117db5eb586321cf0a1a49ff03106a0e55502715 'rs/rosetta-api/icp_ledger/ledger.did' by import-candid +// Generated from IC repo commit 69e1408 (2023-11-23 tags: release-2023-11-23_23-01) 'rs/rosetta-api/icp_ledger/ledger.did' by import-candid // This is the official Ledger interface that is guaranteed to be backward compatible. // Amount of tokens, measured in 10^-8 of a token. @@ -113,6 +113,7 @@ type Operation = variant { to : AccountIdentifier; amount : Tokens; fee : Tokens; + spender : opt vec nat8; }; Approve : record { from : AccountIdentifier; @@ -122,13 +123,7 @@ type Operation = variant { allowance: Tokens; fee : Tokens; expires_at : opt TimeStamp; - }; - TransferFrom : record { - from : AccountIdentifier; - to : AccountIdentifier; - spender : AccountIdentifier; - amount : Tokens; - fee : Tokens; + expected_allowance : opt Tokens; }; }; @@ -267,10 +262,11 @@ type Duration = record { type ArchiveOptions = record { trigger_threshold : nat64; num_blocks_to_archive : nat64; - node_max_memory_size_bytes: opt nat64; - max_message_size_bytes: opt nat64; - controller_id: principal; - cycles_for_archive_creation: opt nat64; + node_max_memory_size_bytes : opt nat64; + max_message_size_bytes : opt nat64; + controller_id : principal; + cycles_for_archive_creation : opt nat64; + max_transactions_per_response : opt nat64; }; // Account identifier encoded as a 64-byte ASCII hex string. @@ -369,10 +365,10 @@ type ApproveArgs = record { spender : Account; amount : Icrc1Tokens; expected_allowance : opt Icrc1Tokens; - expires_at : opt TimeStamp; + expires_at : opt Icrc1Timestamp; fee : opt Icrc1Tokens; memo : opt blob; - created_at_time: opt TimeStamp; + created_at_time: opt Icrc1Timestamp; }; type ApproveError = variant { @@ -399,7 +395,34 @@ type AllowanceArgs = record { type Allowance = record { allowance : Icrc1Tokens; - expires_at : opt TimeStamp; + expires_at : opt Icrc1Timestamp; +}; + +type TransferFromArgs = record { + spender_subaccount : opt SubAccount; + from : Account; + to : Account; + amount : Icrc1Tokens; + fee : opt Icrc1Tokens; + memo : opt blob; + created_at_time: opt Icrc1Timestamp; +}; + +type TransferFromResult = variant { + Ok : Icrc1BlockIndex; + Err : TransferFromError; +}; + +type TransferFromError = variant { + BadFee : record { expected_fee : Icrc1Tokens }; + BadBurn : record { min_burn_amount : Icrc1Tokens }; + InsufficientFunds : record { balance : Icrc1Tokens }; + InsufficientAllowance : record { allowance : Icrc1Tokens }; + TooOld; + CreatedInFuture : record { ledger_time : Icrc1Timestamp }; + Duplicate : record { duplicate_of : Icrc1BlockIndex }; + TemporarilyUnavailable; + GenericError : record { error_code : nat; message : text }; }; service: (LedgerCanisterPayload) -> { @@ -452,4 +475,5 @@ service: (LedgerCanisterPayload) -> { icrc1_supported_standards : () -> (vec record { name : text; url : text }) query; icrc2_approve : (ApproveArgs) -> (ApproveResult); icrc2_allowance : (AllowanceArgs) -> (Allowance) query; + icrc2_transfer_from : (TransferFromArgs) -> (TransferFromResult); } diff --git a/packages/ledger-icp/candid/ledger.idl.js b/packages/ledger-icp/candid/ledger.idl.js index 49275a90c..71649d01d 100644 --- a/packages/ledger-icp/candid/ledger.idl.js +++ b/packages/ledger-icp/candid/ledger.idl.js @@ -16,6 +16,7 @@ export const idlFactory = ({ IDL }) => { const Duration = IDL.Record({ 'secs' : IDL.Nat64, 'nanos' : IDL.Nat32 }); const ArchiveOptions = IDL.Record({ 'num_blocks_to_archive' : IDL.Nat64, + 'max_transactions_per_response' : IDL.Opt(IDL.Nat64), 'trigger_threshold' : IDL.Nat64, 'max_message_size_bytes' : IDL.Opt(IDL.Nat64), 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64), @@ -86,19 +87,18 @@ export const idlFactory = ({ IDL }) => { 'account' : Account, 'spender' : Account, }); - const TimeStamp = IDL.Record({ 'timestamp_nanos' : IDL.Nat64 }); const Allowance = IDL.Record({ 'allowance' : Icrc1Tokens, - 'expires_at' : IDL.Opt(TimeStamp), + 'expires_at' : IDL.Opt(Icrc1Timestamp), }); const ApproveArgs = IDL.Record({ 'fee' : IDL.Opt(Icrc1Tokens), 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)), 'from_subaccount' : IDL.Opt(SubAccount), - 'created_at_time' : IDL.Opt(TimeStamp), + 'created_at_time' : IDL.Opt(Icrc1Timestamp), 'amount' : Icrc1Tokens, 'expected_allowance' : IDL.Opt(Icrc1Tokens), - 'expires_at' : IDL.Opt(TimeStamp), + 'expires_at' : IDL.Opt(Icrc1Timestamp), 'spender' : Account, }); const ApproveError = IDL.Variant({ @@ -119,18 +119,47 @@ export const idlFactory = ({ IDL }) => { 'Ok' : Icrc1BlockIndex, 'Err' : ApproveError, }); + const TransferFromArgs = IDL.Record({ + 'to' : Account, + 'fee' : IDL.Opt(Icrc1Tokens), + 'spender_subaccount' : IDL.Opt(SubAccount), + 'from' : Account, + 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'created_at_time' : IDL.Opt(Icrc1Timestamp), + 'amount' : Icrc1Tokens, + }); + const TransferFromError = IDL.Variant({ + 'GenericError' : IDL.Record({ + 'message' : IDL.Text, + 'error_code' : IDL.Nat, + }), + 'TemporarilyUnavailable' : IDL.Null, + 'InsufficientAllowance' : IDL.Record({ 'allowance' : Icrc1Tokens }), + 'BadBurn' : IDL.Record({ 'min_burn_amount' : Icrc1Tokens }), + 'Duplicate' : IDL.Record({ 'duplicate_of' : Icrc1BlockIndex }), + 'BadFee' : IDL.Record({ 'expected_fee' : Icrc1Tokens }), + 'CreatedInFuture' : IDL.Record({ 'ledger_time' : Icrc1Timestamp }), + 'TooOld' : IDL.Null, + 'InsufficientFunds' : IDL.Record({ 'balance' : Icrc1Tokens }), + }); + const TransferFromResult = IDL.Variant({ + 'Ok' : Icrc1BlockIndex, + 'Err' : TransferFromError, + }); const BlockIndex = IDL.Nat64; const GetBlocksArgs = IDL.Record({ 'start' : BlockIndex, 'length' : IDL.Nat64, }); const Memo = IDL.Nat64; + const TimeStamp = IDL.Record({ 'timestamp_nanos' : IDL.Nat64 }); const Operation = IDL.Variant({ 'Approve' : IDL.Record({ 'fee' : Tokens, 'from' : AccountIdentifier, 'allowance_e8s' : IDL.Int, 'allowance' : Tokens, + 'expected_allowance' : IDL.Opt(Tokens), 'expires_at' : IDL.Opt(TimeStamp), 'spender' : AccountIdentifier, }), @@ -145,13 +174,7 @@ export const idlFactory = ({ IDL }) => { 'fee' : Tokens, 'from' : AccountIdentifier, 'amount' : Tokens, - }), - 'TransferFrom' : IDL.Record({ - 'to' : AccountIdentifier, - 'fee' : Tokens, - 'from' : AccountIdentifier, - 'amount' : Tokens, - 'spender' : AccountIdentifier, + 'spender' : IDL.Opt(IDL.Vec(IDL.Nat8)), }), }); const Transaction = IDL.Record({ @@ -281,6 +304,11 @@ export const idlFactory = ({ IDL }) => { 'icrc1_transfer' : IDL.Func([TransferArg], [Icrc1TransferResult], []), 'icrc2_allowance' : IDL.Func([AllowanceArgs], [Allowance], ['query']), 'icrc2_approve' : IDL.Func([ApproveArgs], [ApproveResult], []), + 'icrc2_transfer_from' : IDL.Func( + [TransferFromArgs], + [TransferFromResult], + [], + ), 'name' : IDL.Func([], [IDL.Record({ 'name' : IDL.Text })], ['query']), 'query_blocks' : IDL.Func( [GetBlocksArgs], @@ -315,6 +343,7 @@ export const init = ({ IDL }) => { const Duration = IDL.Record({ 'secs' : IDL.Nat64, 'nanos' : IDL.Nat32 }); const ArchiveOptions = IDL.Record({ 'num_blocks_to_archive' : IDL.Nat64, + 'max_transactions_per_response' : IDL.Opt(IDL.Nat64), 'trigger_threshold' : IDL.Nat64, 'max_message_size_bytes' : IDL.Opt(IDL.Nat64), 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64), diff --git a/packages/ledger-icrc/candid/icrc_index.did b/packages/ledger-icrc/candid/icrc_index.did index c5599fd35..602d3c1b7 100644 --- a/packages/ledger-icrc/candid/icrc_index.did +++ b/packages/ledger-icrc/candid/icrc_index.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit 695f05aacf69371fc5743fa6d1619f7d9993ea87 'rs/rosetta-api/icrc1/index/index.did' by import-candid +// Generated from IC repo commit 69e1408 (2023-11-23 tags: release-2023-11-23_23-01) 'rs/rosetta-api/icrc1/index/index.did' by import-candid type TxId = nat; type Account = record { owner : principal; subaccount : opt blob }; diff --git a/packages/ledger-icrc/candid/icrc_ledger.did b/packages/ledger-icrc/candid/icrc_ledger.did index 60021acd9..35ba410f9 100644 --- a/packages/ledger-icrc/candid/icrc_ledger.did +++ b/packages/ledger-icrc/candid/icrc_ledger.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit 695f05aacf69371fc5743fa6d1619f7d9993ea87 'rs/rosetta-api/icrc1/ledger/ledger.did' by import-candid +// Generated from IC repo commit 69e1408 (2023-11-23 tags: release-2023-11-23_23-01) 'rs/rosetta-api/icrc1/ledger/ledger.did' by import-candid type BlockIndex = nat; type Subaccount = blob; // Number of nanoseconds since the UNIX epoch in UTC timezone. diff --git a/packages/nns/candid/genesis_token.did b/packages/nns/candid/genesis_token.did index b05fb11ba..dc1f4efad 100644 --- a/packages/nns/candid/genesis_token.did +++ b/packages/nns/candid/genesis_token.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit 1a01f85fc1994e69dd5ba72b4d87fe9f9c4093ee 'rs/nns/gtc/canister/gtc.did' by import-candid +// Generated from IC repo commit 69e1408 (2023-11-23 tags: release-2023-11-23_23-01) 'rs/nns/gtc/canister/gtc.did' by import-candid type AccountState = record { authenticated_principal_id : opt principal; successfully_transferred_neurons : vec TransferredNeuron; diff --git a/packages/nns/candid/governance.certified.idl.js b/packages/nns/candid/governance.certified.idl.js index 771383c01..e39122ac9 100644 --- a/packages/nns/candid/governance.certified.idl.js +++ b/packages/nns/candid/governance.certified.idl.js @@ -354,6 +354,10 @@ export const idlFactory = ({ IDL }) => { 'transfer_timestamp' : IDL.Nat64, 'block_height' : IDL.Nat64, }); + const Followers = IDL.Record({ 'followers' : IDL.Vec(NeuronId) }); + const FollowersMap = IDL.Record({ + 'followers_map' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followers)), + }); const Progress = IDL.Variant({ 'LastNeuronId' : NeuronId }); const Migration = IDL.Record({ 'status' : IDL.Opt(IDL.Int32), @@ -407,6 +411,7 @@ export const idlFactory = ({ IDL }) => { 'ideal_matched_participation_function' : IDL.Opt( IdealMatchedParticipationFunction ), + 'allocated_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundData = IDL.Record({ 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), @@ -534,6 +539,7 @@ export const idlFactory = ({ IDL }) => { 'latest_reward_event' : IDL.Opt(RewardEvent), 'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer), 'short_voting_period_seconds' : IDL.Nat64, + 'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)), 'migrations' : IDL.Opt(Migrations), 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)), 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)), @@ -570,7 +576,22 @@ export const idlFactory = ({ IDL }) => { 'age_seconds' : IDL.Nat64, }); const Result_5 = IDL.Variant({ 'Ok' : NeuronInfo, 'Err' : GovernanceError }); - const Result_6 = IDL.Variant({ + const GetNeuronsFundAuditInfoRequest = IDL.Record({ + 'nns_proposal_id' : IDL.Opt(NeuronId), + }); + const NeuronsFundAuditInfo = IDL.Record({ + 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), + 'initial_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), + 'neurons_fund_refunds' : IDL.Opt(NeuronsFundSnapshot), + }); + const Ok = IDL.Record({ + 'neurons_fund_audit_info' : IDL.Opt(NeuronsFundAuditInfo), + }); + const Result_6 = IDL.Variant({ 'Ok' : Ok, 'Err' : GovernanceError }); + const GetNeuronsFundAuditInfoResponse = IDL.Record({ + 'result' : IDL.Opt(Result_6), + }); + const Result_7 = IDL.Variant({ 'Ok' : NodeProvider, 'Err' : GovernanceError, }); @@ -662,12 +683,12 @@ export const idlFactory = ({ IDL }) => { 'total_neurons_fund_contribution_icp_e8s' : IDL.Opt(IDL.Nat64), 'sns_governance_canister_id' : IDL.Opt(IDL.Principal), }); - const Result_7 = IDL.Variant({ + const Result_8 = IDL.Variant({ 'Committed' : Committed, 'Aborted' : IDL.Record({}), }); const SettleCommunityFundParticipation = IDL.Record({ - 'result' : IDL.Opt(Result_7), + 'result' : IDL.Opt(Result_8), 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64), }); const Committed_1 = IDL.Record({ @@ -675,12 +696,12 @@ export const idlFactory = ({ IDL }) => { 'total_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), 'sns_governance_canister_id' : IDL.Opt(IDL.Principal), }); - const Result_8 = IDL.Variant({ + const Result_9 = IDL.Variant({ 'Committed' : Committed_1, 'Aborted' : IDL.Record({}), }); const SettleNeuronsFundParticipationRequest = IDL.Record({ - 'result' : IDL.Opt(Result_8), + 'result' : IDL.Opt(Result_9), 'nns_proposal_id' : IDL.Opt(IDL.Nat64), }); const NeuronsFundNeuron = IDL.Record({ @@ -689,12 +710,12 @@ export const idlFactory = ({ IDL }) => { 'nns_neuron_id' : IDL.Opt(IDL.Nat64), 'amount_icp_e8s' : IDL.Opt(IDL.Nat64), }); - const Ok = IDL.Record({ + const Ok_1 = IDL.Record({ 'neurons_fund_neuron_portions' : IDL.Vec(NeuronsFundNeuron), }); - const Result_9 = IDL.Variant({ 'Ok' : Ok, 'Err' : GovernanceError }); + const Result_10 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : GovernanceError }); const SettleNeuronsFundParticipationResponse = IDL.Record({ - 'result' : IDL.Opt(Result_9), + 'result' : IDL.Opt(Result_10), }); const UpdateNodeProvider = IDL.Record({ 'reward_account' : IDL.Opt(AccountIdentifier), @@ -733,7 +754,12 @@ export const idlFactory = ({ IDL }) => { [Result_5], [], ), - 'get_node_provider_by_caller' : IDL.Func([IDL.Null], [Result_6], []), + 'get_neurons_fund_audit_info' : IDL.Func( + [GetNeuronsFundAuditInfoRequest], + [GetNeuronsFundAuditInfoResponse], + [], + ), + 'get_node_provider_by_caller' : IDL.Func([IDL.Null], [Result_7], []), 'get_pending_proposals' : IDL.Func([], [IDL.Vec(ProposalInfo)], []), 'get_proposal_info' : IDL.Func([IDL.Nat64], [IDL.Opt(ProposalInfo)], []), 'list_known_neurons' : IDL.Func([], [ListKnownNeuronsResponse], []), @@ -1119,6 +1145,10 @@ export const init = ({ IDL }) => { 'transfer_timestamp' : IDL.Nat64, 'block_height' : IDL.Nat64, }); + const Followers = IDL.Record({ 'followers' : IDL.Vec(NeuronId) }); + const FollowersMap = IDL.Record({ + 'followers_map' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followers)), + }); const Progress = IDL.Variant({ 'LastNeuronId' : NeuronId }); const Migration = IDL.Record({ 'status' : IDL.Opt(IDL.Int32), @@ -1172,6 +1202,7 @@ export const init = ({ IDL }) => { 'ideal_matched_participation_function' : IDL.Opt( IdealMatchedParticipationFunction ), + 'allocated_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundData = IDL.Record({ 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), @@ -1299,6 +1330,7 @@ export const init = ({ IDL }) => { 'latest_reward_event' : IDL.Opt(RewardEvent), 'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer), 'short_voting_period_seconds' : IDL.Nat64, + 'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)), 'migrations' : IDL.Opt(Migrations), 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)), 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)), diff --git a/packages/nns/candid/governance.d.ts b/packages/nns/candid/governance.d.ts index c366b47ba..3fb6060b9 100644 --- a/packages/nns/candid/governance.d.ts +++ b/packages/nns/candid/governance.d.ts @@ -186,6 +186,18 @@ export interface Follow { export interface Followees { followees: Array; } +export interface Followers { + followers: Array; +} +export interface FollowersMap { + followers_map: Array<[bigint, Followers]>; +} +export interface GetNeuronsFundAuditInfoRequest { + nns_proposal_id: [] | [NeuronId]; +} +export interface GetNeuronsFundAuditInfoResponse { + result: [] | [Result_6]; +} export interface GlobalTimeOfDay { seconds_after_utc_midnight: [] | [bigint]; } @@ -206,6 +218,7 @@ export interface Governance { latest_reward_event: [] | [RewardEvent]; to_claim_transfers: Array; short_voting_period_seconds: bigint; + topic_followee_index: Array<[number, FollowersMap]>; migrations: [] | [Migrations]; proposals: Array<[bigint, ProposalData]>; in_flight_commands: Array<[bigint, NeuronInFlightCommand]>; @@ -439,6 +452,11 @@ export interface NeuronStakeTransfer { transfer_timestamp: bigint; block_height: bigint; } +export interface NeuronsFundAuditInfo { + final_neurons_fund_participation: [] | [NeuronsFundParticipation]; + initial_neurons_fund_participation: [] | [NeuronsFundParticipation]; + neurons_fund_refunds: [] | [NeuronsFundSnapshot]; +} export interface NeuronsFundData { final_neurons_fund_participation: [] | [NeuronsFundParticipation]; initial_neurons_fund_participation: [] | [NeuronsFundParticipation]; @@ -467,6 +485,7 @@ export interface NeuronsFundParticipation { ideal_matched_participation_function: | [] | [IdealMatchedParticipationFunction]; + allocated_neurons_fund_participation_icp_e8s: [] | [bigint]; } export interface NeuronsFundSnapshot { neurons_fund_neuron_portions: Array; @@ -476,6 +495,9 @@ export interface NodeProvider { reward_account: [] | [AccountIdentifier]; } export interface Ok { + neurons_fund_audit_info: [] | [NeuronsFundAuditInfo]; +} +export interface Ok_1 { neurons_fund_neuron_portions: Array; } export interface OpenSnsTokenSwap { @@ -566,16 +588,17 @@ export interface RemoveHotKey { } export type Result = { Ok: null } | { Err: GovernanceError }; export type Result_1 = { Error: GovernanceError } | { NeuronId: NeuronId }; +export type Result_10 = { Ok: Ok_1 } | { Err: GovernanceError }; export type Result_2 = { Ok: Neuron } | { Err: GovernanceError }; export type Result_3 = | { Ok: GovernanceCachedMetrics } | { Err: GovernanceError }; export type Result_4 = { Ok: RewardNodeProviders } | { Err: GovernanceError }; export type Result_5 = { Ok: NeuronInfo } | { Err: GovernanceError }; -export type Result_6 = { Ok: NodeProvider } | { Err: GovernanceError }; -export type Result_7 = { Committed: Committed } | { Aborted: {} }; -export type Result_8 = { Committed: Committed_1 } | { Aborted: {} }; -export type Result_9 = { Ok: Ok } | { Err: GovernanceError }; +export type Result_6 = { Ok: Ok } | { Err: GovernanceError }; +export type Result_7 = { Ok: NodeProvider } | { Err: GovernanceError }; +export type Result_8 = { Committed: Committed } | { Aborted: {} }; +export type Result_9 = { Committed: Committed_1 } | { Aborted: {} }; export interface RewardEvent { rounds_since_last_distribution: [] | [bigint]; day_after_genesis: bigint; @@ -617,15 +640,15 @@ export interface SetSnsTokenSwapOpenTimeWindow { swap_canister_id: [] | [Principal]; } export interface SettleCommunityFundParticipation { - result: [] | [Result_7]; + result: [] | [Result_8]; open_sns_token_swap_proposal_id: [] | [bigint]; } export interface SettleNeuronsFundParticipationRequest { - result: [] | [Result_8]; + result: [] | [Result_9]; nns_proposal_id: [] | [bigint]; } export interface SettleNeuronsFundParticipationResponse { - result: [] | [Result_9]; + result: [] | [Result_10]; } export interface Spawn { percentage_to_spawn: [] | [number]; @@ -732,7 +755,11 @@ export interface _SERVICE { [NeuronIdOrSubaccount], Result_5 >; - get_node_provider_by_caller: ActorMethod<[null], Result_6>; + get_neurons_fund_audit_info: ActorMethod< + [GetNeuronsFundAuditInfoRequest], + GetNeuronsFundAuditInfoResponse + >; + get_node_provider_by_caller: ActorMethod<[null], Result_7>; get_pending_proposals: ActorMethod<[], Array>; get_proposal_info: ActorMethod<[bigint], [] | [ProposalInfo]>; list_known_neurons: ActorMethod<[], ListKnownNeuronsResponse>; diff --git a/packages/nns/candid/governance.did b/packages/nns/candid/governance.did index 5690e7548..55e8c484a 100644 --- a/packages/nns/candid/governance.did +++ b/packages/nns/candid/governance.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit 1a01f85fc1994e69dd5ba72b4d87fe9f9c4093ee 'rs/nns/governance/canister/governance.did' by import-candid +// Generated from IC repo commit 69e1408 (2023-11-23 tags: release-2023-11-23_23-01) 'rs/nns/governance/canister/governance.did' by import-candid type AccountIdentifier = record { hash : vec nat8 }; type Action = variant { RegisterKnownNeuron : KnownNeuron; @@ -150,6 +150,10 @@ type Duration = record { seconds : opt nat64 }; type ExecuteNnsFunction = record { nns_function : int32; payload : vec nat8 }; 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 }; @@ -166,6 +170,7 @@ type Governance = record { latest_reward_event : opt RewardEvent; to_claim_transfers : vec NeuronStakeTransfer; short_voting_period_seconds : nat64; + topic_followee_index : vec record { int32; FollowersMap }; migrations : opt Migrations; proposals : vec record { nat64; ProposalData }; in_flight_commands : vec record { nat64; NeuronInFlightCommand }; @@ -376,6 +381,11 @@ type NeuronStakeTransfer = record { transfer_timestamp : nat64; block_height : 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; @@ -402,6 +412,7 @@ type NeuronsFundParticipation = record { max_neurons_fund_swap_participation_icp_e8s : opt nat64; neurons_fund_reserves : opt NeuronsFundSnapshot; ideal_matched_participation_function : opt IdealMatchedParticipationFunction; + allocated_neurons_fund_participation_icp_e8s : opt nat64; }; type NeuronsFundSnapshot = record { neurons_fund_neuron_portions : vec NeuronsFundNeuronPortion; @@ -410,7 +421,8 @@ type NodeProvider = record { id : opt principal; reward_account : opt AccountIdentifier; }; -type Ok = 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; @@ -491,14 +503,15 @@ type RegisterVote = record { vote : int32; proposal : opt NeuronId }; type RemoveHotKey = record { hot_key_to_remove : opt principal }; 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 : NodeProvider; Err : GovernanceError }; -type Result_7 = variant { Committed : Committed; Aborted : record {} }; -type Result_8 = variant { Committed : Committed_1; Aborted : record {} }; -type Result_9 = variant { Ok : Ok; 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; @@ -533,14 +546,14 @@ type SetSnsTokenSwapOpenTimeWindow = record { swap_canister_id : opt principal; }; type SettleCommunityFundParticipation = record { - result : opt Result_7; + result : opt Result_8; open_sns_token_swap_proposal_id : opt nat64; }; type SettleNeuronsFundParticipationRequest = record { - result : opt Result_8; + result : opt Result_9; nns_proposal_id : opt nat64; }; -type SettleNeuronsFundParticipationResponse = record { result : opt Result_9 }; +type SettleNeuronsFundParticipationResponse = record { result : opt Result_10 }; type Spawn = record { percentage_to_spawn : opt nat32; new_controller : opt principal; @@ -626,7 +639,10 @@ service : (Governance) -> { get_neuron_info_by_id_or_subaccount : (NeuronIdOrSubaccount) -> ( Result_5, ) query; - get_node_provider_by_caller : (null) -> (Result_6) query; + get_neurons_fund_audit_info : (GetNeuronsFundAuditInfoRequest) -> ( + GetNeuronsFundAuditInfoResponse, + ) query; + get_node_provider_by_caller : (null) -> (Result_7) query; get_pending_proposals : () -> (vec ProposalInfo) query; get_proposal_info : (nat64) -> (opt ProposalInfo) query; list_known_neurons : () -> (ListKnownNeuronsResponse) query; diff --git a/packages/nns/candid/governance.idl.js b/packages/nns/candid/governance.idl.js index 3a2fd741c..5ea98ddf0 100644 --- a/packages/nns/candid/governance.idl.js +++ b/packages/nns/candid/governance.idl.js @@ -354,6 +354,10 @@ export const idlFactory = ({ IDL }) => { 'transfer_timestamp' : IDL.Nat64, 'block_height' : IDL.Nat64, }); + const Followers = IDL.Record({ 'followers' : IDL.Vec(NeuronId) }); + const FollowersMap = IDL.Record({ + 'followers_map' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followers)), + }); const Progress = IDL.Variant({ 'LastNeuronId' : NeuronId }); const Migration = IDL.Record({ 'status' : IDL.Opt(IDL.Int32), @@ -407,6 +411,7 @@ export const idlFactory = ({ IDL }) => { 'ideal_matched_participation_function' : IDL.Opt( IdealMatchedParticipationFunction ), + 'allocated_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundData = IDL.Record({ 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), @@ -534,6 +539,7 @@ export const idlFactory = ({ IDL }) => { 'latest_reward_event' : IDL.Opt(RewardEvent), 'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer), 'short_voting_period_seconds' : IDL.Nat64, + 'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)), 'migrations' : IDL.Opt(Migrations), 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)), 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)), @@ -570,7 +576,22 @@ export const idlFactory = ({ IDL }) => { 'age_seconds' : IDL.Nat64, }); const Result_5 = IDL.Variant({ 'Ok' : NeuronInfo, 'Err' : GovernanceError }); - const Result_6 = IDL.Variant({ + const GetNeuronsFundAuditInfoRequest = IDL.Record({ + 'nns_proposal_id' : IDL.Opt(NeuronId), + }); + const NeuronsFundAuditInfo = IDL.Record({ + 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), + 'initial_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), + 'neurons_fund_refunds' : IDL.Opt(NeuronsFundSnapshot), + }); + const Ok = IDL.Record({ + 'neurons_fund_audit_info' : IDL.Opt(NeuronsFundAuditInfo), + }); + const Result_6 = IDL.Variant({ 'Ok' : Ok, 'Err' : GovernanceError }); + const GetNeuronsFundAuditInfoResponse = IDL.Record({ + 'result' : IDL.Opt(Result_6), + }); + const Result_7 = IDL.Variant({ 'Ok' : NodeProvider, 'Err' : GovernanceError, }); @@ -662,12 +683,12 @@ export const idlFactory = ({ IDL }) => { 'total_neurons_fund_contribution_icp_e8s' : IDL.Opt(IDL.Nat64), 'sns_governance_canister_id' : IDL.Opt(IDL.Principal), }); - const Result_7 = IDL.Variant({ + const Result_8 = IDL.Variant({ 'Committed' : Committed, 'Aborted' : IDL.Record({}), }); const SettleCommunityFundParticipation = IDL.Record({ - 'result' : IDL.Opt(Result_7), + 'result' : IDL.Opt(Result_8), 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64), }); const Committed_1 = IDL.Record({ @@ -675,12 +696,12 @@ export const idlFactory = ({ IDL }) => { 'total_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), 'sns_governance_canister_id' : IDL.Opt(IDL.Principal), }); - const Result_8 = IDL.Variant({ + const Result_9 = IDL.Variant({ 'Committed' : Committed_1, 'Aborted' : IDL.Record({}), }); const SettleNeuronsFundParticipationRequest = IDL.Record({ - 'result' : IDL.Opt(Result_8), + 'result' : IDL.Opt(Result_9), 'nns_proposal_id' : IDL.Opt(IDL.Nat64), }); const NeuronsFundNeuron = IDL.Record({ @@ -689,12 +710,12 @@ export const idlFactory = ({ IDL }) => { 'nns_neuron_id' : IDL.Opt(IDL.Nat64), 'amount_icp_e8s' : IDL.Opt(IDL.Nat64), }); - const Ok = IDL.Record({ + const Ok_1 = IDL.Record({ 'neurons_fund_neuron_portions' : IDL.Vec(NeuronsFundNeuron), }); - const Result_9 = IDL.Variant({ 'Ok' : Ok, 'Err' : GovernanceError }); + const Result_10 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : GovernanceError }); const SettleNeuronsFundParticipationResponse = IDL.Record({ - 'result' : IDL.Opt(Result_9), + 'result' : IDL.Opt(Result_10), }); const UpdateNodeProvider = IDL.Record({ 'reward_account' : IDL.Opt(AccountIdentifier), @@ -737,7 +758,12 @@ export const idlFactory = ({ IDL }) => { [Result_5], ['query'], ), - 'get_node_provider_by_caller' : IDL.Func([IDL.Null], [Result_6], ['query']), + 'get_neurons_fund_audit_info' : IDL.Func( + [GetNeuronsFundAuditInfoRequest], + [GetNeuronsFundAuditInfoResponse], + ['query'], + ), + 'get_node_provider_by_caller' : IDL.Func([IDL.Null], [Result_7], ['query']), 'get_pending_proposals' : IDL.Func([], [IDL.Vec(ProposalInfo)], ['query']), 'get_proposal_info' : IDL.Func( [IDL.Nat64], @@ -1131,6 +1157,10 @@ export const init = ({ IDL }) => { 'transfer_timestamp' : IDL.Nat64, 'block_height' : IDL.Nat64, }); + const Followers = IDL.Record({ 'followers' : IDL.Vec(NeuronId) }); + const FollowersMap = IDL.Record({ + 'followers_map' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followers)), + }); const Progress = IDL.Variant({ 'LastNeuronId' : NeuronId }); const Migration = IDL.Record({ 'status' : IDL.Opt(IDL.Int32), @@ -1184,6 +1214,7 @@ export const init = ({ IDL }) => { 'ideal_matched_participation_function' : IDL.Opt( IdealMatchedParticipationFunction ), + 'allocated_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundData = IDL.Record({ 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), @@ -1311,6 +1342,7 @@ export const init = ({ IDL }) => { 'latest_reward_event' : IDL.Opt(RewardEvent), 'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer), 'short_voting_period_seconds' : IDL.Nat64, + 'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)), 'migrations' : IDL.Opt(Migrations), 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)), 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)), diff --git a/packages/nns/candid/governance_test.certified.idl.js b/packages/nns/candid/governance_test.certified.idl.js index 709f60aed..6c23a81fb 100644 --- a/packages/nns/candid/governance_test.certified.idl.js +++ b/packages/nns/candid/governance_test.certified.idl.js @@ -354,6 +354,10 @@ export const idlFactory = ({ IDL }) => { 'transfer_timestamp' : IDL.Nat64, 'block_height' : IDL.Nat64, }); + const Followers = IDL.Record({ 'followers' : IDL.Vec(NeuronId) }); + const FollowersMap = IDL.Record({ + 'followers_map' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followers)), + }); const Progress = IDL.Variant({ 'LastNeuronId' : NeuronId }); const Migration = IDL.Record({ 'status' : IDL.Opt(IDL.Int32), @@ -407,6 +411,7 @@ export const idlFactory = ({ IDL }) => { 'ideal_matched_participation_function' : IDL.Opt( IdealMatchedParticipationFunction ), + 'allocated_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundData = IDL.Record({ 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), @@ -534,6 +539,7 @@ export const idlFactory = ({ IDL }) => { 'latest_reward_event' : IDL.Opt(RewardEvent), 'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer), 'short_voting_period_seconds' : IDL.Nat64, + 'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)), 'migrations' : IDL.Opt(Migrations), 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)), 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)), @@ -570,7 +576,22 @@ export const idlFactory = ({ IDL }) => { 'age_seconds' : IDL.Nat64, }); const Result_5 = IDL.Variant({ 'Ok' : NeuronInfo, 'Err' : GovernanceError }); - const Result_6 = IDL.Variant({ + const GetNeuronsFundAuditInfoRequest = IDL.Record({ + 'nns_proposal_id' : IDL.Opt(NeuronId), + }); + const NeuronsFundAuditInfo = IDL.Record({ + 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), + 'initial_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), + 'neurons_fund_refunds' : IDL.Opt(NeuronsFundSnapshot), + }); + const Ok = IDL.Record({ + 'neurons_fund_audit_info' : IDL.Opt(NeuronsFundAuditInfo), + }); + const Result_6 = IDL.Variant({ 'Ok' : Ok, 'Err' : GovernanceError }); + const GetNeuronsFundAuditInfoResponse = IDL.Record({ + 'result' : IDL.Opt(Result_6), + }); + const Result_7 = IDL.Variant({ 'Ok' : NodeProvider, 'Err' : GovernanceError, }); @@ -662,12 +683,12 @@ export const idlFactory = ({ IDL }) => { 'total_neurons_fund_contribution_icp_e8s' : IDL.Opt(IDL.Nat64), 'sns_governance_canister_id' : IDL.Opt(IDL.Principal), }); - const Result_7 = IDL.Variant({ + const Result_8 = IDL.Variant({ 'Committed' : Committed, 'Aborted' : IDL.Record({}), }); const SettleCommunityFundParticipation = IDL.Record({ - 'result' : IDL.Opt(Result_7), + 'result' : IDL.Opt(Result_8), 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64), }); const Committed_1 = IDL.Record({ @@ -675,12 +696,12 @@ export const idlFactory = ({ IDL }) => { 'total_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), 'sns_governance_canister_id' : IDL.Opt(IDL.Principal), }); - const Result_8 = IDL.Variant({ + const Result_9 = IDL.Variant({ 'Committed' : Committed_1, 'Aborted' : IDL.Record({}), }); const SettleNeuronsFundParticipationRequest = IDL.Record({ - 'result' : IDL.Opt(Result_8), + 'result' : IDL.Opt(Result_9), 'nns_proposal_id' : IDL.Opt(IDL.Nat64), }); const NeuronsFundNeuron = IDL.Record({ @@ -689,12 +710,12 @@ export const idlFactory = ({ IDL }) => { 'nns_neuron_id' : IDL.Opt(IDL.Nat64), 'amount_icp_e8s' : IDL.Opt(IDL.Nat64), }); - const Ok = IDL.Record({ + const Ok_1 = IDL.Record({ 'neurons_fund_neuron_portions' : IDL.Vec(NeuronsFundNeuron), }); - const Result_9 = IDL.Variant({ 'Ok' : Ok, 'Err' : GovernanceError }); + const Result_10 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : GovernanceError }); const SettleNeuronsFundParticipationResponse = IDL.Record({ - 'result' : IDL.Opt(Result_9), + 'result' : IDL.Opt(Result_10), }); const UpdateNodeProvider = IDL.Record({ 'reward_account' : IDL.Opt(AccountIdentifier), @@ -733,7 +754,12 @@ export const idlFactory = ({ IDL }) => { [Result_5], [], ), - 'get_node_provider_by_caller' : IDL.Func([IDL.Null], [Result_6], []), + 'get_neurons_fund_audit_info' : IDL.Func( + [GetNeuronsFundAuditInfoRequest], + [GetNeuronsFundAuditInfoResponse], + [], + ), + 'get_node_provider_by_caller' : IDL.Func([IDL.Null], [Result_7], []), 'get_pending_proposals' : IDL.Func([], [IDL.Vec(ProposalInfo)], []), 'get_proposal_info' : IDL.Func([IDL.Nat64], [IDL.Opt(ProposalInfo)], []), 'list_known_neurons' : IDL.Func([], [ListKnownNeuronsResponse], []), @@ -1120,6 +1146,10 @@ export const init = ({ IDL }) => { 'transfer_timestamp' : IDL.Nat64, 'block_height' : IDL.Nat64, }); + const Followers = IDL.Record({ 'followers' : IDL.Vec(NeuronId) }); + const FollowersMap = IDL.Record({ + 'followers_map' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followers)), + }); const Progress = IDL.Variant({ 'LastNeuronId' : NeuronId }); const Migration = IDL.Record({ 'status' : IDL.Opt(IDL.Int32), @@ -1173,6 +1203,7 @@ export const init = ({ IDL }) => { 'ideal_matched_participation_function' : IDL.Opt( IdealMatchedParticipationFunction ), + 'allocated_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundData = IDL.Record({ 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), @@ -1300,6 +1331,7 @@ export const init = ({ IDL }) => { 'latest_reward_event' : IDL.Opt(RewardEvent), 'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer), 'short_voting_period_seconds' : IDL.Nat64, + 'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)), 'migrations' : IDL.Opt(Migrations), 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)), 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)), diff --git a/packages/nns/candid/governance_test.d.ts b/packages/nns/candid/governance_test.d.ts index 70449c3f1..849554aef 100644 --- a/packages/nns/candid/governance_test.d.ts +++ b/packages/nns/candid/governance_test.d.ts @@ -186,6 +186,18 @@ export interface Follow { export interface Followees { followees: Array; } +export interface Followers { + followers: Array; +} +export interface FollowersMap { + followers_map: Array<[bigint, Followers]>; +} +export interface GetNeuronsFundAuditInfoRequest { + nns_proposal_id: [] | [NeuronId]; +} +export interface GetNeuronsFundAuditInfoResponse { + result: [] | [Result_6]; +} export interface GlobalTimeOfDay { seconds_after_utc_midnight: [] | [bigint]; } @@ -206,6 +218,7 @@ export interface Governance { latest_reward_event: [] | [RewardEvent]; to_claim_transfers: Array; short_voting_period_seconds: bigint; + topic_followee_index: Array<[number, FollowersMap]>; migrations: [] | [Migrations]; proposals: Array<[bigint, ProposalData]>; in_flight_commands: Array<[bigint, NeuronInFlightCommand]>; @@ -439,6 +452,11 @@ export interface NeuronStakeTransfer { transfer_timestamp: bigint; block_height: bigint; } +export interface NeuronsFundAuditInfo { + final_neurons_fund_participation: [] | [NeuronsFundParticipation]; + initial_neurons_fund_participation: [] | [NeuronsFundParticipation]; + neurons_fund_refunds: [] | [NeuronsFundSnapshot]; +} export interface NeuronsFundData { final_neurons_fund_participation: [] | [NeuronsFundParticipation]; initial_neurons_fund_participation: [] | [NeuronsFundParticipation]; @@ -467,6 +485,7 @@ export interface NeuronsFundParticipation { ideal_matched_participation_function: | [] | [IdealMatchedParticipationFunction]; + allocated_neurons_fund_participation_icp_e8s: [] | [bigint]; } export interface NeuronsFundSnapshot { neurons_fund_neuron_portions: Array; @@ -476,6 +495,9 @@ export interface NodeProvider { reward_account: [] | [AccountIdentifier]; } export interface Ok { + neurons_fund_audit_info: [] | [NeuronsFundAuditInfo]; +} +export interface Ok_1 { neurons_fund_neuron_portions: Array; } export interface OpenSnsTokenSwap { @@ -566,16 +588,17 @@ export interface RemoveHotKey { } export type Result = { Ok: null } | { Err: GovernanceError }; export type Result_1 = { Error: GovernanceError } | { NeuronId: NeuronId }; +export type Result_10 = { Ok: Ok_1 } | { Err: GovernanceError }; export type Result_2 = { Ok: Neuron } | { Err: GovernanceError }; export type Result_3 = | { Ok: GovernanceCachedMetrics } | { Err: GovernanceError }; export type Result_4 = { Ok: RewardNodeProviders } | { Err: GovernanceError }; export type Result_5 = { Ok: NeuronInfo } | { Err: GovernanceError }; -export type Result_6 = { Ok: NodeProvider } | { Err: GovernanceError }; -export type Result_7 = { Committed: Committed } | { Aborted: {} }; -export type Result_8 = { Committed: Committed_1 } | { Aborted: {} }; -export type Result_9 = { Ok: Ok } | { Err: GovernanceError }; +export type Result_6 = { Ok: Ok } | { Err: GovernanceError }; +export type Result_7 = { Ok: NodeProvider } | { Err: GovernanceError }; +export type Result_8 = { Committed: Committed } | { Aborted: {} }; +export type Result_9 = { Committed: Committed_1 } | { Aborted: {} }; export interface RewardEvent { rounds_since_last_distribution: [] | [bigint]; day_after_genesis: bigint; @@ -617,15 +640,15 @@ export interface SetSnsTokenSwapOpenTimeWindow { swap_canister_id: [] | [Principal]; } export interface SettleCommunityFundParticipation { - result: [] | [Result_7]; + result: [] | [Result_8]; open_sns_token_swap_proposal_id: [] | [bigint]; } export interface SettleNeuronsFundParticipationRequest { - result: [] | [Result_8]; + result: [] | [Result_9]; nns_proposal_id: [] | [bigint]; } export interface SettleNeuronsFundParticipationResponse { - result: [] | [Result_9]; + result: [] | [Result_10]; } export interface Spawn { percentage_to_spawn: [] | [number]; @@ -732,7 +755,11 @@ export interface _SERVICE { [NeuronIdOrSubaccount], Result_5 >; - get_node_provider_by_caller: ActorMethod<[null], Result_6>; + get_neurons_fund_audit_info: ActorMethod< + [GetNeuronsFundAuditInfoRequest], + GetNeuronsFundAuditInfoResponse + >; + get_node_provider_by_caller: ActorMethod<[null], Result_7>; get_pending_proposals: ActorMethod<[], Array>; get_proposal_info: ActorMethod<[bigint], [] | [ProposalInfo]>; list_known_neurons: ActorMethod<[], ListKnownNeuronsResponse>; diff --git a/packages/nns/candid/governance_test.did b/packages/nns/candid/governance_test.did index 0e79f8cd4..b1855d76d 100644 --- a/packages/nns/candid/governance_test.did +++ b/packages/nns/candid/governance_test.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit 1a01f85fc1994e69dd5ba72b4d87fe9f9c4093ee 'rs/nns/governance/canister/governance_test.did' by import-candid +// Generated from IC repo commit 69e1408 (2023-11-23 tags: release-2023-11-23_23-01) 'rs/nns/governance/canister/governance_test.did' by import-candid type AccountIdentifier = record { hash : vec nat8 }; type Action = variant { RegisterKnownNeuron : KnownNeuron; @@ -150,6 +150,10 @@ type Duration = record { seconds : opt nat64 }; type ExecuteNnsFunction = record { nns_function : int32; payload : vec nat8 }; 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 }; @@ -166,6 +170,7 @@ type Governance = record { latest_reward_event : opt RewardEvent; to_claim_transfers : vec NeuronStakeTransfer; short_voting_period_seconds : nat64; + topic_followee_index : vec record { int32; FollowersMap }; migrations : opt Migrations; proposals : vec record { nat64; ProposalData }; in_flight_commands : vec record { nat64; NeuronInFlightCommand }; @@ -376,6 +381,11 @@ type NeuronStakeTransfer = record { transfer_timestamp : nat64; block_height : 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; @@ -402,6 +412,7 @@ type NeuronsFundParticipation = record { max_neurons_fund_swap_participation_icp_e8s : opt nat64; neurons_fund_reserves : opt NeuronsFundSnapshot; ideal_matched_participation_function : opt IdealMatchedParticipationFunction; + allocated_neurons_fund_participation_icp_e8s : opt nat64; }; type NeuronsFundSnapshot = record { neurons_fund_neuron_portions : vec NeuronsFundNeuronPortion; @@ -410,7 +421,8 @@ type NodeProvider = record { id : opt principal; reward_account : opt AccountIdentifier; }; -type Ok = 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; @@ -491,14 +503,15 @@ type RegisterVote = record { vote : int32; proposal : opt NeuronId }; type RemoveHotKey = record { hot_key_to_remove : opt principal }; 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 : NodeProvider; Err : GovernanceError }; -type Result_7 = variant { Committed : Committed; Aborted : record {} }; -type Result_8 = variant { Committed : Committed_1; Aborted : record {} }; -type Result_9 = variant { Ok : Ok; 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; @@ -533,14 +546,14 @@ type SetSnsTokenSwapOpenTimeWindow = record { swap_canister_id : opt principal; }; type SettleCommunityFundParticipation = record { - result : opt Result_7; + result : opt Result_8; open_sns_token_swap_proposal_id : opt nat64; }; type SettleNeuronsFundParticipationRequest = record { - result : opt Result_8; + result : opt Result_9; nns_proposal_id : opt nat64; }; -type SettleNeuronsFundParticipationResponse = record { result : opt Result_9 }; +type SettleNeuronsFundParticipationResponse = record { result : opt Result_10 }; type Spawn = record { percentage_to_spawn : opt nat32; new_controller : opt principal; @@ -626,7 +639,10 @@ service : (Governance) -> { get_neuron_info_by_id_or_subaccount : (NeuronIdOrSubaccount) -> ( Result_5, ) query; - get_node_provider_by_caller : (null) -> (Result_6) query; + get_neurons_fund_audit_info : (GetNeuronsFundAuditInfoRequest) -> ( + GetNeuronsFundAuditInfoResponse, + ) query; + get_node_provider_by_caller : (null) -> (Result_7) query; get_pending_proposals : () -> (vec ProposalInfo) query; get_proposal_info : (nat64) -> (opt ProposalInfo) query; list_known_neurons : () -> (ListKnownNeuronsResponse) query; diff --git a/packages/nns/candid/governance_test.idl.js b/packages/nns/candid/governance_test.idl.js index d2021a53a..5d8ed2172 100644 --- a/packages/nns/candid/governance_test.idl.js +++ b/packages/nns/candid/governance_test.idl.js @@ -354,6 +354,10 @@ export const idlFactory = ({ IDL }) => { 'transfer_timestamp' : IDL.Nat64, 'block_height' : IDL.Nat64, }); + const Followers = IDL.Record({ 'followers' : IDL.Vec(NeuronId) }); + const FollowersMap = IDL.Record({ + 'followers_map' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followers)), + }); const Progress = IDL.Variant({ 'LastNeuronId' : NeuronId }); const Migration = IDL.Record({ 'status' : IDL.Opt(IDL.Int32), @@ -407,6 +411,7 @@ export const idlFactory = ({ IDL }) => { 'ideal_matched_participation_function' : IDL.Opt( IdealMatchedParticipationFunction ), + 'allocated_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundData = IDL.Record({ 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), @@ -534,6 +539,7 @@ export const idlFactory = ({ IDL }) => { 'latest_reward_event' : IDL.Opt(RewardEvent), 'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer), 'short_voting_period_seconds' : IDL.Nat64, + 'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)), 'migrations' : IDL.Opt(Migrations), 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)), 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)), @@ -570,7 +576,22 @@ export const idlFactory = ({ IDL }) => { 'age_seconds' : IDL.Nat64, }); const Result_5 = IDL.Variant({ 'Ok' : NeuronInfo, 'Err' : GovernanceError }); - const Result_6 = IDL.Variant({ + const GetNeuronsFundAuditInfoRequest = IDL.Record({ + 'nns_proposal_id' : IDL.Opt(NeuronId), + }); + const NeuronsFundAuditInfo = IDL.Record({ + 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), + 'initial_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), + 'neurons_fund_refunds' : IDL.Opt(NeuronsFundSnapshot), + }); + const Ok = IDL.Record({ + 'neurons_fund_audit_info' : IDL.Opt(NeuronsFundAuditInfo), + }); + const Result_6 = IDL.Variant({ 'Ok' : Ok, 'Err' : GovernanceError }); + const GetNeuronsFundAuditInfoResponse = IDL.Record({ + 'result' : IDL.Opt(Result_6), + }); + const Result_7 = IDL.Variant({ 'Ok' : NodeProvider, 'Err' : GovernanceError, }); @@ -662,12 +683,12 @@ export const idlFactory = ({ IDL }) => { 'total_neurons_fund_contribution_icp_e8s' : IDL.Opt(IDL.Nat64), 'sns_governance_canister_id' : IDL.Opt(IDL.Principal), }); - const Result_7 = IDL.Variant({ + const Result_8 = IDL.Variant({ 'Committed' : Committed, 'Aborted' : IDL.Record({}), }); const SettleCommunityFundParticipation = IDL.Record({ - 'result' : IDL.Opt(Result_7), + 'result' : IDL.Opt(Result_8), 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64), }); const Committed_1 = IDL.Record({ @@ -675,12 +696,12 @@ export const idlFactory = ({ IDL }) => { 'total_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), 'sns_governance_canister_id' : IDL.Opt(IDL.Principal), }); - const Result_8 = IDL.Variant({ + const Result_9 = IDL.Variant({ 'Committed' : Committed_1, 'Aborted' : IDL.Record({}), }); const SettleNeuronsFundParticipationRequest = IDL.Record({ - 'result' : IDL.Opt(Result_8), + 'result' : IDL.Opt(Result_9), 'nns_proposal_id' : IDL.Opt(IDL.Nat64), }); const NeuronsFundNeuron = IDL.Record({ @@ -689,12 +710,12 @@ export const idlFactory = ({ IDL }) => { 'nns_neuron_id' : IDL.Opt(IDL.Nat64), 'amount_icp_e8s' : IDL.Opt(IDL.Nat64), }); - const Ok = IDL.Record({ + const Ok_1 = IDL.Record({ 'neurons_fund_neuron_portions' : IDL.Vec(NeuronsFundNeuron), }); - const Result_9 = IDL.Variant({ 'Ok' : Ok, 'Err' : GovernanceError }); + const Result_10 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : GovernanceError }); const SettleNeuronsFundParticipationResponse = IDL.Record({ - 'result' : IDL.Opt(Result_9), + 'result' : IDL.Opt(Result_10), }); const UpdateNodeProvider = IDL.Record({ 'reward_account' : IDL.Opt(AccountIdentifier), @@ -737,7 +758,12 @@ export const idlFactory = ({ IDL }) => { [Result_5], ['query'], ), - 'get_node_provider_by_caller' : IDL.Func([IDL.Null], [Result_6], ['query']), + 'get_neurons_fund_audit_info' : IDL.Func( + [GetNeuronsFundAuditInfoRequest], + [GetNeuronsFundAuditInfoResponse], + ['query'], + ), + 'get_node_provider_by_caller' : IDL.Func([IDL.Null], [Result_7], ['query']), 'get_pending_proposals' : IDL.Func([], [IDL.Vec(ProposalInfo)], ['query']), 'get_proposal_info' : IDL.Func( [IDL.Nat64], @@ -1132,6 +1158,10 @@ export const init = ({ IDL }) => { 'transfer_timestamp' : IDL.Nat64, 'block_height' : IDL.Nat64, }); + const Followers = IDL.Record({ 'followers' : IDL.Vec(NeuronId) }); + const FollowersMap = IDL.Record({ + 'followers_map' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followers)), + }); const Progress = IDL.Variant({ 'LastNeuronId' : NeuronId }); const Migration = IDL.Record({ 'status' : IDL.Opt(IDL.Int32), @@ -1185,6 +1215,7 @@ export const init = ({ IDL }) => { 'ideal_matched_participation_function' : IDL.Opt( IdealMatchedParticipationFunction ), + 'allocated_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundData = IDL.Record({ 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), @@ -1312,6 +1343,7 @@ export const init = ({ IDL }) => { 'latest_reward_event' : IDL.Opt(RewardEvent), 'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer), 'short_voting_period_seconds' : IDL.Nat64, + 'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)), 'migrations' : IDL.Opt(Migrations), 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)), 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)), diff --git a/packages/nns/candid/sns_wasm.certified.idl.js b/packages/nns/candid/sns_wasm.certified.idl.js index 55ced4218..7aaf8d00a 100644 --- a/packages/nns/candid/sns_wasm.certified.idl.js +++ b/packages/nns/candid/sns_wasm.certified.idl.js @@ -32,12 +32,19 @@ export const idlFactory = ({ IDL }) => { 'slope_denominator' : IDL.Opt(IDL.Nat64), 'to_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); + const IdealMatchedParticipationFunction = IDL.Record({ + 'serialized_representation' : IDL.Opt(IDL.Text), + }); const NeuronsFundParticipationConstraints = IDL.Record({ 'coefficient_intervals' : IDL.Vec(LinearScalingCoefficient), 'max_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), 'min_direct_participation_threshold_icp_e8s' : IDL.Opt(IDL.Nat64), + 'ideal_matched_participation_function' : IDL.Opt( + IdealMatchedParticipationFunction + ), }); const CfNeuron = IDL.Record({ + 'has_created_neuron_recipes' : IDL.Opt(IDL.Bool), 'nns_neuron_id' : IDL.Nat64, 'amount_icp_e8s' : IDL.Nat64, }); @@ -81,6 +88,7 @@ export const idlFactory = ({ IDL }) => { 'max_dissolve_delay_seconds' : IDL.Opt(IDL.Nat64), 'max_dissolve_delay_bonus_percentage' : IDL.Opt(IDL.Nat64), 'nns_proposal_id' : IDL.Opt(IDL.Nat64), + 'neurons_fund_participation' : IDL.Opt(IDL.Bool), 'min_participant_icp_e8s' : IDL.Opt(IDL.Nat64), 'neuron_basket_construction_parameters' : IDL.Opt( NeuronBasketConstructionParameters @@ -144,6 +152,25 @@ export const idlFactory = ({ IDL }) => { const GetAllowedPrincipalsResponse = IDL.Record({ 'allowed_principals' : IDL.Vec(IDL.Principal), }); + const GetDeployedSnsByProposalIdRequest = IDL.Record({ + 'proposal_id' : IDL.Nat64, + }); + const DeployedSns = IDL.Record({ + 'root_canister_id' : IDL.Opt(IDL.Principal), + 'governance_canister_id' : IDL.Opt(IDL.Principal), + 'index_canister_id' : IDL.Opt(IDL.Principal), + 'swap_canister_id' : IDL.Opt(IDL.Principal), + 'ledger_canister_id' : IDL.Opt(IDL.Principal), + }); + const GetDeployedSnsByProposalIdResult = IDL.Variant({ + 'Error' : SnsWasmError, + 'DeployedSns' : DeployedSns, + }); + const GetDeployedSnsByProposalIdResponse = IDL.Record({ + 'get_deployed_sns_by_proposal_id_result' : IDL.Opt( + GetDeployedSnsByProposalIdResult + ), + }); const SnsVersion = IDL.Record({ 'archive_wasm_hash' : IDL.Vec(IDL.Nat8), 'root_wasm_hash' : IDL.Vec(IDL.Nat8), @@ -175,13 +202,6 @@ export const idlFactory = ({ IDL }) => { const InsertUpgradePathEntriesResponse = IDL.Record({ 'error' : IDL.Opt(SnsWasmError), }); - const DeployedSns = IDL.Record({ - 'root_canister_id' : IDL.Opt(IDL.Principal), - 'governance_canister_id' : IDL.Opt(IDL.Principal), - 'index_canister_id' : IDL.Opt(IDL.Principal), - 'swap_canister_id' : IDL.Opt(IDL.Principal), - 'ledger_canister_id' : IDL.Opt(IDL.Principal), - }); const ListDeployedSnsesResponse = IDL.Record({ 'instances' : IDL.Vec(DeployedSns), }); @@ -235,6 +255,11 @@ export const idlFactory = ({ IDL }) => { [GetAllowedPrincipalsResponse], [], ), + 'get_deployed_sns_by_proposal_id' : IDL.Func( + [GetDeployedSnsByProposalIdRequest], + [GetDeployedSnsByProposalIdResponse], + [], + ), 'get_latest_sns_version_pretty' : IDL.Func( [IDL.Null], [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], diff --git a/packages/nns/candid/sns_wasm.d.ts b/packages/nns/candid/sns_wasm.d.ts index 53667ef1b..0a84318a3 100644 --- a/packages/nns/candid/sns_wasm.d.ts +++ b/packages/nns/candid/sns_wasm.d.ts @@ -15,6 +15,7 @@ export interface Canister { id: [] | [Principal]; } export interface CfNeuron { + has_created_neuron_recipes: [] | [boolean]; nns_neuron_id: bigint; amount_icp_e8s: bigint; } @@ -61,6 +62,17 @@ export interface FractionalDeveloperVotingPower { export interface GetAllowedPrincipalsResponse { allowed_principals: Array; } +export interface GetDeployedSnsByProposalIdRequest { + proposal_id: bigint; +} +export interface GetDeployedSnsByProposalIdResponse { + get_deployed_sns_by_proposal_id_result: + | [] + | [GetDeployedSnsByProposalIdResult]; +} +export type GetDeployedSnsByProposalIdResult = + | { Error: SnsWasmError } + | { DeployedSns: DeployedSns }; export interface GetNextSnsVersionRequest { governance_canister_id: [] | [Principal]; current_version: [] | [SnsVersion]; @@ -77,6 +89,9 @@ export interface GetWasmRequest { export interface GetWasmResponse { wasm: [] | [SnsWasm]; } +export interface IdealMatchedParticipationFunction { + serialized_representation: [] | [string]; +} export type InitialTokenDistribution = { FractionalDeveloperVotingPower: FractionalDeveloperVotingPower; }; @@ -127,6 +142,9 @@ export interface NeuronsFundParticipationConstraints { coefficient_intervals: Array; max_neurons_fund_participation_icp_e8s: [] | [bigint]; min_direct_participation_threshold_icp_e8s: [] | [bigint]; + ideal_matched_participation_function: + | [] + | [IdealMatchedParticipationFunction]; } export interface PrettySnsVersion { archive_wasm_hash: string; @@ -149,6 +167,7 @@ export interface SnsInitPayload { max_dissolve_delay_seconds: [] | [bigint]; max_dissolve_delay_bonus_percentage: [] | [bigint]; nns_proposal_id: [] | [bigint]; + neurons_fund_participation: [] | [boolean]; min_participant_icp_e8s: [] | [bigint]; neuron_basket_construction_parameters: | [] @@ -240,6 +259,10 @@ export interface _SERVICE { add_wasm: ActorMethod<[AddWasmRequest], AddWasmResponse>; deploy_new_sns: ActorMethod<[DeployNewSnsRequest], DeployNewSnsResponse>; get_allowed_principals: ActorMethod<[{}], GetAllowedPrincipalsResponse>; + get_deployed_sns_by_proposal_id: ActorMethod< + [GetDeployedSnsByProposalIdRequest], + GetDeployedSnsByProposalIdResponse + >; get_latest_sns_version_pretty: ActorMethod<[null], Array<[string, string]>>; get_next_sns_version: ActorMethod< [GetNextSnsVersionRequest], diff --git a/packages/nns/candid/sns_wasm.did b/packages/nns/candid/sns_wasm.did index d6ac740a9..9b172b026 100644 --- a/packages/nns/candid/sns_wasm.did +++ b/packages/nns/candid/sns_wasm.did @@ -1,9 +1,13 @@ -// Generated from IC repo commit 2d57e93dabc5f13258d0dee1ffb2363ddce7fe62 'rs/nns/sns-wasm/canister/sns-wasm.did' by import-candid +// Generated from IC repo commit 69e1408 (2023-11-23 tags: release-2023-11-23_23-01) 'rs/nns/sns-wasm/canister/sns-wasm.did' by import-candid type AddWasmRequest = record { hash : vec nat8; wasm : opt SnsWasm }; type AddWasmResponse = record { result : opt Result }; type AirdropDistribution = record { airdrop_neurons : vec NeuronDistribution }; type Canister = record { id : opt principal }; -type CfNeuron = record { nns_neuron_id : nat64; amount_icp_e8s : nat64 }; +type 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; @@ -41,6 +45,14 @@ type FractionalDeveloperVotingPower = record { type GetAllowedPrincipalsResponse = record { allowed_principals : vec principal; }; +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; @@ -49,6 +61,9 @@ type GetNextSnsVersionResponse = record { next_version : opt SnsVersion }; type GetSnsSubnetIdsResponse = record { sns_subnet_ids : vec principal }; type GetWasmRequest = record { hash : vec nat8 }; type GetWasmResponse = record { wasm : opt SnsWasm }; +type IdealMatchedParticipationFunction = record { + serialized_representation : opt text; +}; type InitialTokenDistribution = variant { FractionalDeveloperVotingPower : FractionalDeveloperVotingPower; }; @@ -91,6 +106,7 @@ 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 PrettySnsVersion = record { archive_wasm_hash : text; @@ -113,6 +129,7 @@ type SnsInitPayload = record { max_dissolve_delay_seconds : opt nat64; max_dissolve_delay_bonus_percentage : opt nat64; nns_proposal_id : opt nat64; + neurons_fund_participation : opt bool; min_participant_icp_e8s : opt nat64; neuron_basket_construction_parameters : opt NeuronBasketConstructionParameters; fallback_controller_principal_ids : vec text; @@ -192,6 +209,9 @@ service : (SnsWasmCanisterInitPayload) -> { add_wasm : (AddWasmRequest) -> (AddWasmResponse); deploy_new_sns : (DeployNewSnsRequest) -> (DeployNewSnsResponse); get_allowed_principals : (record {}) -> (GetAllowedPrincipalsResponse) query; + get_deployed_sns_by_proposal_id : (GetDeployedSnsByProposalIdRequest) -> ( + GetDeployedSnsByProposalIdResponse, + ) query; get_latest_sns_version_pretty : (null) -> (vec record { text; text }) query; get_next_sns_version : (GetNextSnsVersionRequest) -> ( GetNextSnsVersionResponse, diff --git a/packages/nns/candid/sns_wasm.idl.js b/packages/nns/candid/sns_wasm.idl.js index d6de2ef3f..c21ca1e41 100644 --- a/packages/nns/candid/sns_wasm.idl.js +++ b/packages/nns/candid/sns_wasm.idl.js @@ -32,12 +32,19 @@ export const idlFactory = ({ IDL }) => { 'slope_denominator' : IDL.Opt(IDL.Nat64), 'to_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); + const IdealMatchedParticipationFunction = IDL.Record({ + 'serialized_representation' : IDL.Opt(IDL.Text), + }); const NeuronsFundParticipationConstraints = IDL.Record({ 'coefficient_intervals' : IDL.Vec(LinearScalingCoefficient), 'max_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), 'min_direct_participation_threshold_icp_e8s' : IDL.Opt(IDL.Nat64), + 'ideal_matched_participation_function' : IDL.Opt( + IdealMatchedParticipationFunction + ), }); const CfNeuron = IDL.Record({ + 'has_created_neuron_recipes' : IDL.Opt(IDL.Bool), 'nns_neuron_id' : IDL.Nat64, 'amount_icp_e8s' : IDL.Nat64, }); @@ -81,6 +88,7 @@ export const idlFactory = ({ IDL }) => { 'max_dissolve_delay_seconds' : IDL.Opt(IDL.Nat64), 'max_dissolve_delay_bonus_percentage' : IDL.Opt(IDL.Nat64), 'nns_proposal_id' : IDL.Opt(IDL.Nat64), + 'neurons_fund_participation' : IDL.Opt(IDL.Bool), 'min_participant_icp_e8s' : IDL.Opt(IDL.Nat64), 'neuron_basket_construction_parameters' : IDL.Opt( NeuronBasketConstructionParameters @@ -144,6 +152,25 @@ export const idlFactory = ({ IDL }) => { const GetAllowedPrincipalsResponse = IDL.Record({ 'allowed_principals' : IDL.Vec(IDL.Principal), }); + const GetDeployedSnsByProposalIdRequest = IDL.Record({ + 'proposal_id' : IDL.Nat64, + }); + const DeployedSns = IDL.Record({ + 'root_canister_id' : IDL.Opt(IDL.Principal), + 'governance_canister_id' : IDL.Opt(IDL.Principal), + 'index_canister_id' : IDL.Opt(IDL.Principal), + 'swap_canister_id' : IDL.Opt(IDL.Principal), + 'ledger_canister_id' : IDL.Opt(IDL.Principal), + }); + const GetDeployedSnsByProposalIdResult = IDL.Variant({ + 'Error' : SnsWasmError, + 'DeployedSns' : DeployedSns, + }); + const GetDeployedSnsByProposalIdResponse = IDL.Record({ + 'get_deployed_sns_by_proposal_id_result' : IDL.Opt( + GetDeployedSnsByProposalIdResult + ), + }); const SnsVersion = IDL.Record({ 'archive_wasm_hash' : IDL.Vec(IDL.Nat8), 'root_wasm_hash' : IDL.Vec(IDL.Nat8), @@ -175,13 +202,6 @@ export const idlFactory = ({ IDL }) => { const InsertUpgradePathEntriesResponse = IDL.Record({ 'error' : IDL.Opt(SnsWasmError), }); - const DeployedSns = IDL.Record({ - 'root_canister_id' : IDL.Opt(IDL.Principal), - 'governance_canister_id' : IDL.Opt(IDL.Principal), - 'index_canister_id' : IDL.Opt(IDL.Principal), - 'swap_canister_id' : IDL.Opt(IDL.Principal), - 'ledger_canister_id' : IDL.Opt(IDL.Principal), - }); const ListDeployedSnsesResponse = IDL.Record({ 'instances' : IDL.Vec(DeployedSns), }); @@ -235,6 +255,11 @@ export const idlFactory = ({ IDL }) => { [GetAllowedPrincipalsResponse], ['query'], ), + 'get_deployed_sns_by_proposal_id' : IDL.Func( + [GetDeployedSnsByProposalIdRequest], + [GetDeployedSnsByProposalIdResponse], + ['query'], + ), 'get_latest_sns_version_pretty' : IDL.Func( [IDL.Null], [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], diff --git a/packages/sns/candid/sns_governance.did b/packages/sns/candid/sns_governance.did index f7292ec45..0875654be 100644 --- a/packages/sns/candid/sns_governance.did +++ b/packages/sns/candid/sns_governance.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit 57f0e39e3 (2023-11-22) 'rs/sns/governance/canister/governance.did' by import-candid +// Generated from IC repo commit 69e1408 (2023-11-23 tags: release-2023-11-23_23-01) 'rs/sns/governance/canister/governance.did' by import-candid type Account = record { owner : opt principal; subaccount : opt Subaccount }; type Action = variant { ManageNervousSystemParameters : NervousSystemParameters; diff --git a/packages/sns/candid/sns_governance_test.did b/packages/sns/candid/sns_governance_test.did index 9f7264d0f..abbbb899c 100644 --- a/packages/sns/candid/sns_governance_test.did +++ b/packages/sns/candid/sns_governance_test.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit 57f0e39e3 (2023-11-22) 'rs/sns/governance/canister/governance_test.did' by import-candid +// Generated from IC repo commit 69e1408 (2023-11-23 tags: release-2023-11-23_23-01) 'rs/sns/governance/canister/governance_test.did' by import-candid type Account = record { owner : opt principal; subaccount : opt Subaccount }; type Action = variant { ManageNervousSystemParameters : NervousSystemParameters; diff --git a/packages/sns/candid/sns_root.certified.idl.js b/packages/sns/candid/sns_root.certified.idl.js index 8e1915f5f..462c7ff45 100644 --- a/packages/sns/candid/sns_root.certified.idl.js +++ b/packages/sns/candid/sns_root.certified.idl.js @@ -31,23 +31,12 @@ export const idlFactory = ({ IDL }) => { 'upgrade' : IDL.Null, 'install' : IDL.Null, }); - const AuthzChangeOp = IDL.Variant({ - 'Authorize' : IDL.Record({ 'add_self' : IDL.Bool }), - 'Deauthorize' : IDL.Null, - }); - const MethodAuthzChange = IDL.Record({ - 'principal' : IDL.Opt(IDL.Principal), - 'method_name' : IDL.Text, - 'canister' : IDL.Principal, - 'operation' : AuthzChangeOp, - }); - const ChangeCanisterProposal = IDL.Record({ + const ChangeCanisterRequest = IDL.Record({ 'arg' : IDL.Vec(IDL.Nat8), 'wasm_module' : IDL.Vec(IDL.Nat8), 'stop_before_installing' : IDL.Bool, 'mode' : CanisterInstallMode, 'canister_id' : IDL.Principal, - 'authz_changes' : IDL.Vec(MethodAuthzChange), '_allocation' : IDL.Opt(IDL.Nat), 'memory_allocation' : IDL.Opt(IDL.Nat), 'compute_allocation' : IDL.Opt(IDL.Nat), @@ -118,7 +107,7 @@ export const idlFactory = ({ IDL }) => { [CanisterStatusResult], [], ), - 'change_canister' : IDL.Func([ChangeCanisterProposal], [], []), + 'change_canister' : IDL.Func([ChangeCanisterRequest], [], []), 'get_build_metadata' : IDL.Func([], [IDL.Text], []), 'get_sns_canisters_summary' : IDL.Func( [GetSnsCanistersSummaryRequest], diff --git a/packages/sns/candid/sns_root.d.ts b/packages/sns/candid/sns_root.d.ts index 37d65e195..a10744dc8 100644 --- a/packages/sns/candid/sns_root.d.ts +++ b/packages/sns/candid/sns_root.d.ts @@ -1,9 +1,6 @@ import type { ActorMethod } from "@dfinity/agent"; import type { Principal } from "@dfinity/principal"; -export type AuthzChangeOp = - | { Authorize: { add_self: boolean } } - | { Deauthorize: null }; export interface CanisterCallError { code: [] | [number]; description: string; @@ -38,14 +35,13 @@ export interface CanisterSummary { status: [] | [CanisterStatusResultV2]; canister_id: [] | [Principal]; } -export interface ChangeCanisterProposal { +export interface ChangeCanisterRequest { arg: Uint8Array | number[]; wasm_module: Uint8Array | number[]; stop_before_installing: boolean; mode: CanisterInstallMode; canister_id: Principal; query_allocation: [] | [bigint]; - authz_changes: Array; memory_allocation: [] | [bigint]; compute_allocation: [] | [bigint]; } @@ -83,12 +79,6 @@ export interface ListSnsCanistersResponse { dapps: Array; archives: Array; } -export interface MethodAuthzChange { - principal: [] | [Principal]; - method_name: string; - canister: Principal; - operation: AuthzChangeOp; -} export interface RegisterDappCanisterRequest { canister_id: [] | [Principal]; } @@ -114,7 +104,7 @@ export interface SnsRootCanister { } export interface _SERVICE { canister_status: ActorMethod<[CanisterIdRecord], CanisterStatusResult>; - change_canister: ActorMethod<[ChangeCanisterProposal], undefined>; + change_canister: ActorMethod<[ChangeCanisterRequest], undefined>; get_build_metadata: ActorMethod<[], string>; get_sns_canisters_summary: ActorMethod< [GetSnsCanistersSummaryRequest], diff --git a/packages/sns/candid/sns_root.did b/packages/sns/candid/sns_root.did index 29e04df36..a70457b04 100644 --- a/packages/sns/candid/sns_root.did +++ b/packages/sns/candid/sns_root.did @@ -1,8 +1,4 @@ -// Generated from IC repo commit dd51544944987556c978e774aa7a1992e5c11542 'rs/sns/root/canister/root.did' by import-candid -type AuthzChangeOp = variant { - Authorize : record { add_self : bool }; - Deauthorize; -}; +// Generated from IC repo commit 69e1408 (2023-11-23 tags: release-2023-11-23_23-01) 'rs/sns/root/canister/root.did' by import-candid type CanisterCallError = record { code : opt int32; description : text }; type CanisterIdRecord = record { canister_id : principal }; type CanisterInstallMode = variant { reinstall; upgrade; install }; @@ -26,14 +22,13 @@ type CanisterSummary = record { status : opt CanisterStatusResultV2; canister_id : opt principal; }; -type ChangeCanisterProposal = record { +type ChangeCanisterRequest = record { arg : vec nat8; wasm_module : vec nat8; stop_before_installing : bool; mode : CanisterInstallMode; canister_id : principal; query_allocation : opt nat; - authz_changes : vec MethodAuthzChange; memory_allocation : opt nat; compute_allocation : opt nat; }; @@ -67,12 +62,6 @@ type ListSnsCanistersResponse = record { dapps : vec principal; archives : vec principal; }; -type MethodAuthzChange = record { - "principal" : opt principal; - method_name : text; - canister : principal; - operation : AuthzChangeOp; -}; type RegisterDappCanisterRequest = record { canister_id : opt principal }; type RegisterDappCanistersRequest = record { canister_ids : vec principal }; type SetDappControllersRequest = record { @@ -92,7 +81,7 @@ type SnsRootCanister = record { }; service : (SnsRootCanister) -> { canister_status : (CanisterIdRecord) -> (CanisterStatusResult); - change_canister : (ChangeCanisterProposal) -> (); + change_canister : (ChangeCanisterRequest) -> (); get_build_metadata : () -> (text) query; get_sns_canisters_summary : (GetSnsCanistersSummaryRequest) -> ( GetSnsCanistersSummaryResponse, diff --git a/packages/sns/candid/sns_root.idl.js b/packages/sns/candid/sns_root.idl.js index 956648488..184c5dc40 100644 --- a/packages/sns/candid/sns_root.idl.js +++ b/packages/sns/candid/sns_root.idl.js @@ -31,24 +31,13 @@ export const idlFactory = ({ IDL }) => { 'upgrade' : IDL.Null, 'install' : IDL.Null, }); - const AuthzChangeOp = IDL.Variant({ - 'Authorize' : IDL.Record({ 'add_self' : IDL.Bool }), - 'Deauthorize' : IDL.Null, - }); - const MethodAuthzChange = IDL.Record({ - 'principal' : IDL.Opt(IDL.Principal), - 'method_name' : IDL.Text, - 'canister' : IDL.Principal, - 'operation' : AuthzChangeOp, - }); - const ChangeCanisterProposal = IDL.Record({ + const ChangeCanisterRequest = IDL.Record({ 'arg' : IDL.Vec(IDL.Nat8), 'wasm_module' : IDL.Vec(IDL.Nat8), 'stop_before_installing' : IDL.Bool, 'mode' : CanisterInstallMode, 'canister_id' : IDL.Principal, 'query_allocation' : IDL.Opt(IDL.Nat), - 'authz_changes' : IDL.Vec(MethodAuthzChange), 'memory_allocation' : IDL.Opt(IDL.Nat), 'compute_allocation' : IDL.Opt(IDL.Nat), }); @@ -118,7 +107,7 @@ export const idlFactory = ({ IDL }) => { [CanisterStatusResult], [], ), - 'change_canister' : IDL.Func([ChangeCanisterProposal], [], []), + 'change_canister' : IDL.Func([ChangeCanisterRequest], [], []), 'get_build_metadata' : IDL.Func([], [IDL.Text], ['query']), 'get_sns_canisters_summary' : IDL.Func( [GetSnsCanistersSummaryRequest], diff --git a/packages/sns/candid/sns_swap.certified.idl.js b/packages/sns/candid/sns_swap.certified.idl.js index 7e85c000b..6b7a98e9f 100644 --- a/packages/sns/candid/sns_swap.certified.idl.js +++ b/packages/sns/candid/sns_swap.certified.idl.js @@ -11,10 +11,16 @@ export const idlFactory = ({ IDL }) => { 'slope_denominator' : IDL.Opt(IDL.Nat64), 'to_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); + const IdealMatchedParticipationFunction = IDL.Record({ + 'serialized_representation' : IDL.Opt(IDL.Text), + }); const NeuronsFundParticipationConstraints = IDL.Record({ 'coefficient_intervals' : IDL.Vec(LinearScalingCoefficient), 'max_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), 'min_direct_participation_threshold_icp_e8s' : IDL.Opt(IDL.Nat64), + 'ideal_matched_participation_function' : IDL.Opt( + IdealMatchedParticipationFunction + ), }); const CfNeuron = IDL.Record({ 'has_created_neuron_recipes' : IDL.Opt(IDL.Bool), @@ -89,6 +95,13 @@ export const idlFactory = ({ IDL }) => { const SetDappControllersCallResult = IDL.Record({ 'possibility' : IDL.Opt(Possibility), }); + const SweepResult = IDL.Record({ + 'failure' : IDL.Nat32, + 'skipped' : IDL.Nat32, + 'invalid' : IDL.Nat32, + 'success' : IDL.Nat32, + 'global_failures' : IDL.Nat32, + }); const GovernanceError = IDL.Record({ 'error_message' : IDL.Text, 'error_type' : IDL.Int32, @@ -103,26 +116,32 @@ export const idlFactory = ({ IDL }) => { const SettleCommunityFundParticipationResult = IDL.Record({ 'possibility' : IDL.Opt(Possibility_1), }); - const Possibility_2 = IDL.Variant({ + const Ok_1 = IDL.Record({ + 'neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), + 'neurons_fund_neurons_count' : IDL.Opt(IDL.Nat64), + }); + const Error = IDL.Record({ 'message' : IDL.Opt(IDL.Text) }); + const Possibility_2 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : Error }); + const SettleNeuronsFundParticipationResult = IDL.Record({ + 'possibility' : IDL.Opt(Possibility_2), + }); + const Possibility_3 = IDL.Variant({ 'Ok' : IDL.Record({}), 'Err' : CanisterCallError, }); const SetModeCallResult = IDL.Record({ - 'possibility' : IDL.Opt(Possibility_2), - }); - const SweepResult = IDL.Record({ - 'failure' : IDL.Nat32, - 'skipped' : IDL.Nat32, - 'invalid' : IDL.Nat32, - 'success' : IDL.Nat32, - 'global_failures' : IDL.Nat32, + 'possibility' : IDL.Opt(Possibility_3), }); const FinalizeSwapResponse = IDL.Record({ 'set_dapp_controllers_call_result' : IDL.Opt(SetDappControllersCallResult), + 'create_sns_neuron_recipes_result' : IDL.Opt(SweepResult), 'settle_community_fund_participation_result' : IDL.Opt( SettleCommunityFundParticipationResult ), 'error_message' : IDL.Opt(IDL.Text), + 'settle_neurons_fund_participation_result' : IDL.Opt( + SettleNeuronsFundParticipationResult + ), 'set_mode_call_result' : IDL.Opt(SetModeCallResult), 'sweep_icp_result' : IDL.Opt(SweepResult), 'claim_neuron_result' : IDL.Opt(SweepResult), @@ -194,9 +213,9 @@ export const idlFactory = ({ IDL }) => { 'account' : IDL.Opt(Icrc1Account), 'amount_icp_e8s' : IDL.Nat64, }); - const Ok_1 = IDL.Record({ 'ticket' : IDL.Opt(Ticket) }); + const Ok_2 = IDL.Record({ 'ticket' : IDL.Opt(Ticket) }); const Err_1 = IDL.Record({ 'error_type' : IDL.Opt(IDL.Int32) }); - const Result_1 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : Err_1 }); + const Result_1 = IDL.Variant({ 'Ok' : Ok_2, 'Err' : Err_1 }); const GetOpenTicketResponse = IDL.Record({ 'result' : IDL.Opt(Result_1) }); const Params = IDL.Record({ 'min_participant_icp_e8s' : IDL.Nat64, @@ -303,7 +322,7 @@ export const idlFactory = ({ IDL }) => { 'existing_ticket' : IDL.Opt(Ticket), 'error_type' : IDL.Int32, }); - const Result_2 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : Err_2 }); + const Result_2 = IDL.Variant({ 'Ok' : Ok_2, 'Err' : Err_2 }); const NewSaleTicketResponse = IDL.Record({ 'result' : IDL.Opt(Result_2) }); const OpenRequest = IDL.Record({ 'cf_participants' : IDL.Vec(CfParticipant), @@ -379,7 +398,7 @@ export const idlFactory = ({ IDL }) => { [NewSaleTicketResponse], [], ), - 'notify_payment_failure' : IDL.Func([IDL.Record({})], [Ok_1], []), + 'notify_payment_failure' : IDL.Func([IDL.Record({})], [Ok_2], []), 'open' : IDL.Func([OpenRequest], [IDL.Record({})], []), 'refresh_buyer_tokens' : IDL.Func( [RefreshBuyerTokensRequest], @@ -405,10 +424,16 @@ export const init = ({ IDL }) => { 'slope_denominator' : IDL.Opt(IDL.Nat64), 'to_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); + const IdealMatchedParticipationFunction = IDL.Record({ + 'serialized_representation' : IDL.Opt(IDL.Text), + }); const NeuronsFundParticipationConstraints = IDL.Record({ 'coefficient_intervals' : IDL.Vec(LinearScalingCoefficient), 'max_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), 'min_direct_participation_threshold_icp_e8s' : IDL.Opt(IDL.Nat64), + 'ideal_matched_participation_function' : IDL.Opt( + IdealMatchedParticipationFunction + ), }); const CfNeuron = IDL.Record({ 'has_created_neuron_recipes' : IDL.Opt(IDL.Bool), diff --git a/packages/sns/candid/sns_swap.d.ts b/packages/sns/candid/sns_swap.d.ts index 5b5cd5387..81920da87 100644 --- a/packages/sns/candid/sns_swap.d.ts +++ b/packages/sns/candid/sns_swap.d.ts @@ -67,6 +67,9 @@ export interface Err_2 { existing_ticket: [] | [Ticket]; error_type: number; } +export interface Error { + message: [] | [string]; +} export interface ErrorRefundIcpRequest { source_principal_id: [] | [Principal]; } @@ -79,10 +82,14 @@ export interface FailedUpdate { } export interface FinalizeSwapResponse { set_dapp_controllers_call_result: [] | [SetDappControllersCallResult]; + create_sns_neuron_recipes_result: [] | [SweepResult]; settle_community_fund_participation_result: | [] | [SettleCommunityFundParticipationResult]; error_message: [] | [string]; + settle_neurons_fund_participation_result: + | [] + | [SettleNeuronsFundParticipationResult]; set_mode_call_result: [] | [SetModeCallResult]; sweep_icp_result: [] | [SweepResult]; claim_neuron_result: [] | [SweepResult]; @@ -136,6 +143,9 @@ export interface Icrc1Account { owner: [] | [Principal]; subaccount: [] | [Uint8Array | number[]]; } +export interface IdealMatchedParticipationFunction { + serialized_representation: [] | [string]; +} export interface Init { nns_proposal_id: [] | [bigint]; sns_root_canister_id: string; @@ -219,6 +229,9 @@ export interface NeuronsFundParticipationConstraints { coefficient_intervals: Array; max_neurons_fund_participation_icp_e8s: [] | [bigint]; min_direct_participation_threshold_icp_e8s: [] | [bigint]; + ideal_matched_participation_function: + | [] + | [IdealMatchedParticipationFunction]; } export interface NewSaleTicketRequest { subaccount: [] | [Uint8Array | number[]]; @@ -231,6 +244,10 @@ export interface Ok { block_height: [] | [bigint]; } export interface Ok_1 { + neurons_fund_participation_icp_e8s: [] | [bigint]; + neurons_fund_neurons_count: [] | [bigint]; +} +export interface Ok_2 { ticket: [] | [Ticket]; } export interface OpenRequest { @@ -261,7 +278,8 @@ export type Possibility = | { Ok: SetDappControllersResponse } | { Err: CanisterCallError }; export type Possibility_1 = { Ok: Response } | { Err: CanisterCallError }; -export type Possibility_2 = { Ok: {} } | { Err: CanisterCallError }; +export type Possibility_2 = { Ok: Ok_1 } | { Err: Error }; +export type Possibility_3 = { Ok: {} } | { Err: CanisterCallError }; export interface RefreshBuyerTokensRequest { confirmation_text: [] | [string]; buyer: string; @@ -274,8 +292,8 @@ export interface Response { governance_error: [] | [GovernanceError]; } export type Result = { Ok: Ok } | { Err: Err }; -export type Result_1 = { Ok: Ok_1 } | { Err: Err_1 }; -export type Result_2 = { Ok: Ok_1 } | { Err: Err_2 }; +export type Result_1 = { Ok: Ok_2 } | { Err: Err_1 }; +export type Result_2 = { Ok: Ok_2 } | { Err: Err_2 }; export interface SetDappControllersCallResult { possibility: [] | [Possibility]; } @@ -283,11 +301,14 @@ export interface SetDappControllersResponse { failed_updates: Array; } export interface SetModeCallResult { - possibility: [] | [Possibility_2]; + possibility: [] | [Possibility_3]; } export interface SettleCommunityFundParticipationResult { possibility: [] | [Possibility_1]; } +export interface SettleNeuronsFundParticipationResult { + possibility: [] | [Possibility_2]; +} export interface SnsNeuronRecipe { sns: [] | [TransferableAmount]; claimed_status: [] | [number]; @@ -364,7 +385,7 @@ export interface _SERVICE { ListSnsNeuronRecipesResponse >; new_sale_ticket: ActorMethod<[NewSaleTicketRequest], NewSaleTicketResponse>; - notify_payment_failure: ActorMethod<[{}], Ok_1>; + notify_payment_failure: ActorMethod<[{}], Ok_2>; open: ActorMethod<[OpenRequest], {}>; refresh_buyer_tokens: ActorMethod< [RefreshBuyerTokensRequest], diff --git a/packages/sns/candid/sns_swap.did b/packages/sns/candid/sns_swap.did index a542f19fa..8223dafe6 100644 --- a/packages/sns/candid/sns_swap.did +++ b/packages/sns/candid/sns_swap.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit dd51544944987556c978e774aa7a1992e5c11542 'rs/sns/swap/canister/swap.did' by import-candid +// Generated from IC repo commit 69e1408 (2023-11-23 tags: release-2023-11-23_23-01) 'rs/sns/swap/canister/swap.did' by import-candid type BuyerState = record { icp : opt TransferableAmount; has_created_neuron_recipes : opt bool; @@ -47,6 +47,7 @@ type Err_2 = record { 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 FailedUpdate = record { @@ -55,8 +56,10 @@ type FailedUpdate = record { }; type FinalizeSwapResponse = record { set_dapp_controllers_call_result : opt SetDappControllersCallResult; + create_sns_neuron_recipes_result : opt SweepResult; settle_community_fund_participation_result : opt SettleCommunityFundParticipationResult; error_message : opt text; + settle_neurons_fund_participation_result : opt SettleNeuronsFundParticipationResult; set_mode_call_result : opt SetModeCallResult; sweep_icp_result : opt SweepResult; claim_neuron_result : opt SweepResult; @@ -89,6 +92,9 @@ 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 vec nat8 }; +type IdealMatchedParticipationFunction = record { + serialized_representation : opt text; +}; type Init = record { nns_proposal_id : opt nat64; sns_root_canister_id : text; @@ -163,6 +169,7 @@ 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 vec nat8; @@ -170,7 +177,11 @@ type NewSaleTicketRequest = record { }; type NewSaleTicketResponse = record { result : opt Result_2 }; type Ok = record { block_height : opt nat64 }; -type Ok_1 = record { ticket : opt Ticket }; +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; @@ -198,7 +209,8 @@ type Possibility = variant { Err : CanisterCallError; }; type Possibility_1 = variant { Ok : Response; Err : CanisterCallError }; -type Possibility_2 = variant { Ok : record {}; Err : CanisterCallError }; +type Possibility_2 = variant { Ok : Ok_1; Err : Error }; +type Possibility_3 = variant { Ok : record {}; Err : CanisterCallError }; type RefreshBuyerTokensRequest = record { confirmation_text : opt text; buyer : text; @@ -209,14 +221,17 @@ type RefreshBuyerTokensResponse = record { }; type Response = record { governance_error : opt GovernanceError }; type Result = variant { Ok : Ok; Err : Err }; -type Result_1 = variant { Ok : Ok_1; Err : Err_1 }; -type Result_2 = variant { Ok : Ok_1; Err : Err_2 }; +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_2 }; +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; @@ -286,7 +301,7 @@ service : (Init) -> { ListSnsNeuronRecipesResponse, ) query; new_sale_ticket : (NewSaleTicketRequest) -> (NewSaleTicketResponse); - notify_payment_failure : (record {}) -> (Ok_1); + notify_payment_failure : (record {}) -> (Ok_2); open : (OpenRequest) -> (record {}); refresh_buyer_tokens : (RefreshBuyerTokensRequest) -> ( RefreshBuyerTokensResponse, diff --git a/packages/sns/candid/sns_swap.idl.js b/packages/sns/candid/sns_swap.idl.js index dccc32c45..42676a685 100644 --- a/packages/sns/candid/sns_swap.idl.js +++ b/packages/sns/candid/sns_swap.idl.js @@ -11,10 +11,16 @@ export const idlFactory = ({ IDL }) => { 'slope_denominator' : IDL.Opt(IDL.Nat64), 'to_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); + const IdealMatchedParticipationFunction = IDL.Record({ + 'serialized_representation' : IDL.Opt(IDL.Text), + }); const NeuronsFundParticipationConstraints = IDL.Record({ 'coefficient_intervals' : IDL.Vec(LinearScalingCoefficient), 'max_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), 'min_direct_participation_threshold_icp_e8s' : IDL.Opt(IDL.Nat64), + 'ideal_matched_participation_function' : IDL.Opt( + IdealMatchedParticipationFunction + ), }); const CfNeuron = IDL.Record({ 'has_created_neuron_recipes' : IDL.Opt(IDL.Bool), @@ -89,6 +95,13 @@ export const idlFactory = ({ IDL }) => { const SetDappControllersCallResult = IDL.Record({ 'possibility' : IDL.Opt(Possibility), }); + const SweepResult = IDL.Record({ + 'failure' : IDL.Nat32, + 'skipped' : IDL.Nat32, + 'invalid' : IDL.Nat32, + 'success' : IDL.Nat32, + 'global_failures' : IDL.Nat32, + }); const GovernanceError = IDL.Record({ 'error_message' : IDL.Text, 'error_type' : IDL.Int32, @@ -103,26 +116,32 @@ export const idlFactory = ({ IDL }) => { const SettleCommunityFundParticipationResult = IDL.Record({ 'possibility' : IDL.Opt(Possibility_1), }); - const Possibility_2 = IDL.Variant({ + const Ok_1 = IDL.Record({ + 'neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), + 'neurons_fund_neurons_count' : IDL.Opt(IDL.Nat64), + }); + const Error = IDL.Record({ 'message' : IDL.Opt(IDL.Text) }); + const Possibility_2 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : Error }); + const SettleNeuronsFundParticipationResult = IDL.Record({ + 'possibility' : IDL.Opt(Possibility_2), + }); + const Possibility_3 = IDL.Variant({ 'Ok' : IDL.Record({}), 'Err' : CanisterCallError, }); const SetModeCallResult = IDL.Record({ - 'possibility' : IDL.Opt(Possibility_2), - }); - const SweepResult = IDL.Record({ - 'failure' : IDL.Nat32, - 'skipped' : IDL.Nat32, - 'invalid' : IDL.Nat32, - 'success' : IDL.Nat32, - 'global_failures' : IDL.Nat32, + 'possibility' : IDL.Opt(Possibility_3), }); const FinalizeSwapResponse = IDL.Record({ 'set_dapp_controllers_call_result' : IDL.Opt(SetDappControllersCallResult), + 'create_sns_neuron_recipes_result' : IDL.Opt(SweepResult), 'settle_community_fund_participation_result' : IDL.Opt( SettleCommunityFundParticipationResult ), 'error_message' : IDL.Opt(IDL.Text), + 'settle_neurons_fund_participation_result' : IDL.Opt( + SettleNeuronsFundParticipationResult + ), 'set_mode_call_result' : IDL.Opt(SetModeCallResult), 'sweep_icp_result' : IDL.Opt(SweepResult), 'claim_neuron_result' : IDL.Opt(SweepResult), @@ -194,9 +213,9 @@ export const idlFactory = ({ IDL }) => { 'account' : IDL.Opt(Icrc1Account), 'amount_icp_e8s' : IDL.Nat64, }); - const Ok_1 = IDL.Record({ 'ticket' : IDL.Opt(Ticket) }); + const Ok_2 = IDL.Record({ 'ticket' : IDL.Opt(Ticket) }); const Err_1 = IDL.Record({ 'error_type' : IDL.Opt(IDL.Int32) }); - const Result_1 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : Err_1 }); + const Result_1 = IDL.Variant({ 'Ok' : Ok_2, 'Err' : Err_1 }); const GetOpenTicketResponse = IDL.Record({ 'result' : IDL.Opt(Result_1) }); const Params = IDL.Record({ 'min_participant_icp_e8s' : IDL.Nat64, @@ -303,7 +322,7 @@ export const idlFactory = ({ IDL }) => { 'existing_ticket' : IDL.Opt(Ticket), 'error_type' : IDL.Int32, }); - const Result_2 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : Err_2 }); + const Result_2 = IDL.Variant({ 'Ok' : Ok_2, 'Err' : Err_2 }); const NewSaleTicketResponse = IDL.Record({ 'result' : IDL.Opt(Result_2) }); const OpenRequest = IDL.Record({ 'cf_participants' : IDL.Vec(CfParticipant), @@ -387,7 +406,7 @@ export const idlFactory = ({ IDL }) => { [NewSaleTicketResponse], [], ), - 'notify_payment_failure' : IDL.Func([IDL.Record({})], [Ok_1], []), + 'notify_payment_failure' : IDL.Func([IDL.Record({})], [Ok_2], []), 'open' : IDL.Func([OpenRequest], [IDL.Record({})], []), 'refresh_buyer_tokens' : IDL.Func( [RefreshBuyerTokensRequest], @@ -413,10 +432,16 @@ export const init = ({ IDL }) => { 'slope_denominator' : IDL.Opt(IDL.Nat64), 'to_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); + const IdealMatchedParticipationFunction = IDL.Record({ + 'serialized_representation' : IDL.Opt(IDL.Text), + }); const NeuronsFundParticipationConstraints = IDL.Record({ 'coefficient_intervals' : IDL.Vec(LinearScalingCoefficient), 'max_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), 'min_direct_participation_threshold_icp_e8s' : IDL.Opt(IDL.Nat64), + 'ideal_matched_participation_function' : IDL.Opt( + IdealMatchedParticipationFunction + ), }); const CfNeuron = IDL.Record({ 'has_created_neuron_recipes' : IDL.Opt(IDL.Bool),