diff --git a/packages/ckbtc/candid/minter.did b/packages/ckbtc/candid/minter.did index 44961c9b5..47c884feb 100644 --- a/packages/ckbtc/candid/minter.did +++ b/packages/ckbtc/candid/minter.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit 8be68bc88db7332dd39a26509ddf62c564ca3415 'rs/bitcoin/ckbtc/minter/ckbtc_minter.did' by import-candid +// Generated from IC repo commit ec140b74dc4fef2f4bee3fad936e315380fa5af3 '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 051d790fc..aa96662a1 100644 --- a/packages/cmc/candid/cmc.d.ts +++ b/packages/cmc/candid/cmc.d.ts @@ -5,6 +5,26 @@ export interface AccountIdentifier { bytes: Uint8Array; } 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..7e49e4a5e 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 ec140b74dc4fef2f4bee3fad936e315380fa5af3 '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 f8f635771..ec4bc12f0 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; export interface definite_canister_settings { freezing_threshold: bigint; controllers: Array; @@ -90,11 +91,13 @@ export interface utxo { export type wasm_module = Uint8Array; 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 >; 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] }], @@ -116,6 +119,7 @@ export interface _SERVICE { module_hash: [] | [Uint8Array]; } >; + clear_chunk_store: ActorMethod<[{ canister_id: canister_id }], undefined>; create_canister: ActorMethod< [ { @@ -152,12 +156,32 @@ export interface _SERVICE { ], http_response >; + install_chunked_code: ActorMethod< + [ + { + arg: Uint8Array; + wasm_module_hash: Uint8Array; + 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; 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]; }, @@ -192,6 +216,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< [ { @@ -211,4 +236,8 @@ export interface _SERVICE { ], undefined >; + upload_chunk: ActorMethod< + [{ chunk: Uint8Array; 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..13f08c1cc 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 ec140b74dc4fef2f4bee3fad936e315380fa5af3 '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 33d4a136e..1b6fd0541 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; 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]; 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]; }; }; 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]; + 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..be3d5803a 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 ec140b74dc4fef2f4bee3fad936e315380fa5af3 '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..7b8b478ac 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 ec140b74dc4fef2f4bee3fad936e315380fa5af3 '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..38dffafaf 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 ec140b74dc4fef2f4bee3fad936e315380fa5af3 '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..9fc5d6c51 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 ec140b74dc4fef2f4bee3fad936e315380fa5af3 '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 130507b4b..78564f74b 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..49919395f 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 ec140b74dc4fef2f4bee3fad936e315380fa5af3 '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 5ba88ced3..9cba80888 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..0ba09926c 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 ec140b74dc4fef2f4bee3fad936e315380fa5af3 '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..395e3e872 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 diff --git a/packages/nns/candid/sns_wasm.d.ts b/packages/nns/candid/sns_wasm.d.ts index b54e02cef..3fe4effd8 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; } @@ -77,6 +78,9 @@ export interface GetWasmRequest { export interface GetWasmResponse { wasm: [] | [SnsWasm]; } +export interface IdealMatchedParticipationFunction { + serialized_representation: [] | [string]; +} export type InitialTokenDistribution = { FractionalDeveloperVotingPower: FractionalDeveloperVotingPower; }; @@ -127,6 +131,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 +156,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: | [] diff --git a/packages/nns/candid/sns_wasm.did b/packages/nns/candid/sns_wasm.did index d6ac740a9..d57200e07 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 ec140b74dc4fef2f4bee3fad936e315380fa5af3 '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; @@ -49,6 +53,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 +98,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 +121,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; diff --git a/packages/nns/candid/sns_wasm.idl.js b/packages/nns/candid/sns_wasm.idl.js index d6de2ef3f..6cc5f41fd 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 diff --git a/packages/sns/candid/sns_governance.certified.idl.js b/packages/sns/candid/sns_governance.certified.idl.js index 5ae7a8e9c..48a1b9011 100644 --- a/packages/sns/candid/sns_governance.certified.idl.js +++ b/packages/sns/candid/sns_governance.certified.idl.js @@ -113,6 +113,7 @@ export const idlFactory = ({ IDL }) => { 'cast_timestamp_seconds' : IDL.Nat64, 'voting_power' : IDL.Nat64, }); + const Percentage = IDL.Record({ 'basis_points' : IDL.Opt(IDL.Nat64) }); const Tally = IDL.Record({ 'no' : IDL.Nat64, 'yes' : IDL.Nat64, @@ -180,6 +181,7 @@ export const idlFactory = ({ IDL }) => { 'action' : IDL.Nat64, 'failure_reason' : IDL.Opt(GovernanceError), 'ballots' : IDL.Vec(IDL.Tuple(IDL.Text, Ballot)), + 'minimum_yes_proportion_of_total' : IDL.Opt(Percentage), 'reward_event_round' : IDL.Nat64, 'failed_timestamp_seconds' : IDL.Nat64, 'reward_event_end_timestamp_seconds' : IDL.Opt(IDL.Nat64), @@ -640,6 +642,7 @@ export const init = ({ IDL }) => { 'cast_timestamp_seconds' : IDL.Nat64, 'voting_power' : IDL.Nat64, }); + const Percentage = IDL.Record({ 'basis_points' : IDL.Opt(IDL.Nat64) }); const Tally = IDL.Record({ 'no' : IDL.Nat64, 'yes' : IDL.Nat64, @@ -707,6 +710,7 @@ export const init = ({ IDL }) => { 'action' : IDL.Nat64, 'failure_reason' : IDL.Opt(GovernanceError), 'ballots' : IDL.Vec(IDL.Tuple(IDL.Text, Ballot)), + 'minimum_yes_proportion_of_total' : IDL.Opt(Percentage), 'reward_event_round' : IDL.Nat64, 'failed_timestamp_seconds' : IDL.Nat64, 'reward_event_end_timestamp_seconds' : IDL.Opt(IDL.Nat64), diff --git a/packages/sns/candid/sns_governance.d.ts b/packages/sns/candid/sns_governance.d.ts index fc37a0bc1..1e49b495d 100644 --- a/packages/sns/candid/sns_governance.d.ts +++ b/packages/sns/candid/sns_governance.d.ts @@ -376,6 +376,9 @@ export type Operation = | { StartDissolving: {} } | { IncreaseDissolveDelay: IncreaseDissolveDelay } | { SetDissolveTimestamp: SetDissolveTimestamp }; +export interface Percentage { + basis_points: [] | [bigint]; +} export interface Proposal { url: string; title: string; @@ -388,6 +391,7 @@ export interface ProposalData { action: bigint; failure_reason: [] | [GovernanceError]; ballots: Array<[string, Ballot]>; + minimum_yes_proportion_of_total: [] | [Percentage]; reward_event_round: bigint; failed_timestamp_seconds: bigint; reward_event_end_timestamp_seconds: [] | [bigint]; diff --git a/packages/sns/candid/sns_governance.did b/packages/sns/candid/sns_governance.did index b449f446c..442b38b84 100644 --- a/packages/sns/candid/sns_governance.did +++ b/packages/sns/candid/sns_governance.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit dd51544944987556c978e774aa7a1992e5c11542 'rs/sns/governance/canister/governance.did' by import-candid +// Generated from IC repo commit ec140b74dc4fef2f4bee3fad936e315380fa5af3 'rs/sns/governance/canister/governance.did' by import-candid type Account = record { owner : opt principal; subaccount : opt Subaccount }; type Action = variant { ManageNervousSystemParameters : NervousSystemParameters; @@ -315,6 +315,7 @@ type Operation = variant { IncreaseDissolveDelay : IncreaseDissolveDelay; SetDissolveTimestamp : SetDissolveTimestamp; }; +type Percentage = record { basis_points : opt nat64 }; type Proposal = record { url : text; title : text; @@ -327,6 +328,7 @@ type ProposalData = record { action : nat64; failure_reason : opt GovernanceError; ballots : vec record { text; Ballot }; + minimum_yes_proportion_of_total : opt Percentage; reward_event_round : nat64; failed_timestamp_seconds : nat64; reward_event_end_timestamp_seconds : opt nat64; diff --git a/packages/sns/candid/sns_governance.idl.js b/packages/sns/candid/sns_governance.idl.js index 9a90b808f..e56129e9f 100644 --- a/packages/sns/candid/sns_governance.idl.js +++ b/packages/sns/candid/sns_governance.idl.js @@ -113,6 +113,7 @@ export const idlFactory = ({ IDL }) => { 'cast_timestamp_seconds' : IDL.Nat64, 'voting_power' : IDL.Nat64, }); + const Percentage = IDL.Record({ 'basis_points' : IDL.Opt(IDL.Nat64) }); const Tally = IDL.Record({ 'no' : IDL.Nat64, 'yes' : IDL.Nat64, @@ -180,6 +181,7 @@ export const idlFactory = ({ IDL }) => { 'action' : IDL.Nat64, 'failure_reason' : IDL.Opt(GovernanceError), 'ballots' : IDL.Vec(IDL.Tuple(IDL.Text, Ballot)), + 'minimum_yes_proportion_of_total' : IDL.Opt(Percentage), 'reward_event_round' : IDL.Nat64, 'failed_timestamp_seconds' : IDL.Nat64, 'reward_event_end_timestamp_seconds' : IDL.Opt(IDL.Nat64), @@ -648,6 +650,7 @@ export const init = ({ IDL }) => { 'cast_timestamp_seconds' : IDL.Nat64, 'voting_power' : IDL.Nat64, }); + const Percentage = IDL.Record({ 'basis_points' : IDL.Opt(IDL.Nat64) }); const Tally = IDL.Record({ 'no' : IDL.Nat64, 'yes' : IDL.Nat64, @@ -715,6 +718,7 @@ export const init = ({ IDL }) => { 'action' : IDL.Nat64, 'failure_reason' : IDL.Opt(GovernanceError), 'ballots' : IDL.Vec(IDL.Tuple(IDL.Text, Ballot)), + 'minimum_yes_proportion_of_total' : IDL.Opt(Percentage), 'reward_event_round' : IDL.Nat64, 'failed_timestamp_seconds' : IDL.Nat64, 'reward_event_end_timestamp_seconds' : IDL.Opt(IDL.Nat64), diff --git a/packages/sns/candid/sns_governance_test.certified.idl.js b/packages/sns/candid/sns_governance_test.certified.idl.js index d54c1585c..fe353ee7b 100644 --- a/packages/sns/candid/sns_governance_test.certified.idl.js +++ b/packages/sns/candid/sns_governance_test.certified.idl.js @@ -113,6 +113,7 @@ export const idlFactory = ({ IDL }) => { 'cast_timestamp_seconds' : IDL.Nat64, 'voting_power' : IDL.Nat64, }); + const Percentage = IDL.Record({ 'basis_points' : IDL.Opt(IDL.Nat64) }); const Tally = IDL.Record({ 'no' : IDL.Nat64, 'yes' : IDL.Nat64, @@ -180,6 +181,7 @@ export const idlFactory = ({ IDL }) => { 'action' : IDL.Nat64, 'failure_reason' : IDL.Opt(GovernanceError), 'ballots' : IDL.Vec(IDL.Tuple(IDL.Text, Ballot)), + 'minimum_yes_proportion_of_total' : IDL.Opt(Percentage), 'reward_event_round' : IDL.Nat64, 'failed_timestamp_seconds' : IDL.Nat64, 'reward_event_end_timestamp_seconds' : IDL.Opt(IDL.Nat64), @@ -654,6 +656,7 @@ export const init = ({ IDL }) => { 'cast_timestamp_seconds' : IDL.Nat64, 'voting_power' : IDL.Nat64, }); + const Percentage = IDL.Record({ 'basis_points' : IDL.Opt(IDL.Nat64) }); const Tally = IDL.Record({ 'no' : IDL.Nat64, 'yes' : IDL.Nat64, @@ -721,6 +724,7 @@ export const init = ({ IDL }) => { 'action' : IDL.Nat64, 'failure_reason' : IDL.Opt(GovernanceError), 'ballots' : IDL.Vec(IDL.Tuple(IDL.Text, Ballot)), + 'minimum_yes_proportion_of_total' : IDL.Opt(Percentage), 'reward_event_round' : IDL.Nat64, 'failed_timestamp_seconds' : IDL.Nat64, 'reward_event_end_timestamp_seconds' : IDL.Opt(IDL.Nat64), diff --git a/packages/sns/candid/sns_governance_test.d.ts b/packages/sns/candid/sns_governance_test.d.ts index f5228d5b7..49e0c70b1 100644 --- a/packages/sns/candid/sns_governance_test.d.ts +++ b/packages/sns/candid/sns_governance_test.d.ts @@ -387,6 +387,9 @@ export type Operation = | { StartDissolving: {} } | { IncreaseDissolveDelay: IncreaseDissolveDelay } | { SetDissolveTimestamp: SetDissolveTimestamp }; +export interface Percentage { + basis_points: [] | [bigint]; +} export interface Proposal { url: string; title: string; @@ -399,6 +402,7 @@ export interface ProposalData { action: bigint; failure_reason: [] | [GovernanceError]; ballots: Array<[string, Ballot]>; + minimum_yes_proportion_of_total: [] | [Percentage]; reward_event_round: bigint; failed_timestamp_seconds: bigint; reward_event_end_timestamp_seconds: [] | [bigint]; diff --git a/packages/sns/candid/sns_governance_test.did b/packages/sns/candid/sns_governance_test.did index ad79e42f6..39c3c1e6c 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 dd51544944987556c978e774aa7a1992e5c11542 'rs/sns/governance/canister/governance_test.did' by import-candid +// Generated from IC repo commit ec140b74dc4fef2f4bee3fad936e315380fa5af3 'rs/sns/governance/canister/governance_test.did' by import-candid type Account = record { owner : opt principal; subaccount : opt Subaccount }; type Action = variant { ManageNervousSystemParameters : NervousSystemParameters; @@ -321,6 +321,7 @@ type Operation = variant { IncreaseDissolveDelay : IncreaseDissolveDelay; SetDissolveTimestamp : SetDissolveTimestamp; }; +type Percentage = record { basis_points : opt nat64 }; type Proposal = record { url : text; title : text; @@ -333,6 +334,7 @@ type ProposalData = record { action : nat64; failure_reason : opt GovernanceError; ballots : vec record { text; Ballot }; + minimum_yes_proportion_of_total : opt Percentage; reward_event_round : nat64; failed_timestamp_seconds : nat64; reward_event_end_timestamp_seconds : opt nat64; diff --git a/packages/sns/candid/sns_governance_test.idl.js b/packages/sns/candid/sns_governance_test.idl.js index 4ad665646..548d31254 100644 --- a/packages/sns/candid/sns_governance_test.idl.js +++ b/packages/sns/candid/sns_governance_test.idl.js @@ -113,6 +113,7 @@ export const idlFactory = ({ IDL }) => { 'cast_timestamp_seconds' : IDL.Nat64, 'voting_power' : IDL.Nat64, }); + const Percentage = IDL.Record({ 'basis_points' : IDL.Opt(IDL.Nat64) }); const Tally = IDL.Record({ 'no' : IDL.Nat64, 'yes' : IDL.Nat64, @@ -180,6 +181,7 @@ export const idlFactory = ({ IDL }) => { 'action' : IDL.Nat64, 'failure_reason' : IDL.Opt(GovernanceError), 'ballots' : IDL.Vec(IDL.Tuple(IDL.Text, Ballot)), + 'minimum_yes_proportion_of_total' : IDL.Opt(Percentage), 'reward_event_round' : IDL.Nat64, 'failed_timestamp_seconds' : IDL.Nat64, 'reward_event_end_timestamp_seconds' : IDL.Opt(IDL.Nat64), @@ -662,6 +664,7 @@ export const init = ({ IDL }) => { 'cast_timestamp_seconds' : IDL.Nat64, 'voting_power' : IDL.Nat64, }); + const Percentage = IDL.Record({ 'basis_points' : IDL.Opt(IDL.Nat64) }); const Tally = IDL.Record({ 'no' : IDL.Nat64, 'yes' : IDL.Nat64, @@ -729,6 +732,7 @@ export const init = ({ IDL }) => { 'action' : IDL.Nat64, 'failure_reason' : IDL.Opt(GovernanceError), 'ballots' : IDL.Vec(IDL.Tuple(IDL.Text, Ballot)), + 'minimum_yes_proportion_of_total' : IDL.Opt(Percentage), 'reward_event_round' : IDL.Nat64, 'failed_timestamp_seconds' : IDL.Nat64, 'reward_event_end_timestamp_seconds' : IDL.Opt(IDL.Nat64), diff --git a/packages/sns/candid/sns_root.did b/packages/sns/candid/sns_root.did index 29e04df36..06bfadcf7 100644 --- a/packages/sns/candid/sns_root.did +++ b/packages/sns/candid/sns_root.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit dd51544944987556c978e774aa7a1992e5c11542 'rs/sns/root/canister/root.did' by import-candid +// Generated from IC repo commit ec140b74dc4fef2f4bee3fad936e315380fa5af3 'rs/sns/root/canister/root.did' by import-candid type AuthzChangeOp = variant { Authorize : record { add_self : bool }; Deauthorize; 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 4ebee7b5f..c1d4be2b7 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]; } +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]; @@ -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..57e84ce21 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 ec140b74dc4fef2f4bee3fad936e315380fa5af3 '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),