diff --git a/packages/ckbtc/candid/minter.did b/packages/ckbtc/candid/minter.did index 586ed6f67..cfd2bf021 100644 --- a/packages/ckbtc/candid/minter.did +++ b/packages/ckbtc/candid/minter.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit 4de99bc27b (2023-11-20) 'rs/bitcoin/ckbtc/minter/ckbtc_minter.did' by import-candid +// Generated from IC repo commit 4778b79 (2023-12-08 tags: release-2023-12-06_23-01+p2p) '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..412e2b67c 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({ @@ -50,6 +83,22 @@ export const idlFactory = ({ IDL }) => { 'Ok' : IDL.Principal, 'Err' : NotifyError, }); + const Memo = IDL.Nat64; + const Subaccount = IDL.Vec(IDL.Nat8); + const NotifyMintCyclesArg = IDL.Record({ + 'block_index' : BlockIndex, + 'deposit_memo' : Memo, + 'to_subaccount' : Subaccount, + }); + const NotifyMintCyclesSuccess = IDL.Record({ + 'balance' : IDL.Nat, + 'block_index' : IDL.Nat, + 'minted' : IDL.Nat, + }); + const NotifyMintCyclesResult = IDL.Variant({ + 'Ok' : NotifyMintCyclesSuccess, + 'Err' : NotifyError, + }); const NotifyTopUpArg = IDL.Record({ 'block_index' : BlockIndex, 'canister_id' : IDL.Principal, @@ -57,6 +106,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], @@ -77,6 +131,11 @@ export const idlFactory = ({ IDL }) => { [NotifyCreateCanisterResult], [], ), + 'notify_mint_cycles' : IDL.Func( + [NotifyMintCyclesArg], + [NotifyMintCyclesResult], + [], + ), 'notify_top_up' : IDL.Func([NotifyTopUpArg], [NotifyTopUpResult], []), }); }; diff --git a/packages/cmc/candid/cmc.d.ts b/packages/cmc/candid/cmc.d.ts index 21b3bf5b4..1df348bce 100644 --- a/packages/cmc/candid/cmc.d.ts +++ b/packages/cmc/candid/cmc.d.ts @@ -5,6 +5,26 @@ export interface AccountIdentifier { bytes: Uint8Array | number[]; } export type BlockIndex = bigint; +export interface CanisterSettings { + freezing_threshold: [] | [bigint]; + controllers: [] | [Array]; + reserved_cycles_limit: [] | [bigint]; + memory_allocation: [] | [bigint]; + compute_allocation: [] | [bigint]; +} +export interface CreateCanisterArg { + subnet_selection: [] | [SubnetSelection]; + settings: [] | [CanisterSettings]; + subnet_type: [] | [string]; +} +export type CreateCanisterError = + | { + Refunded: { create_error: string; refund_amount: bigint }; + } + | { RefundFailed: { create_error: string; refund_error: string } }; +export type CreateCanisterResult = + | { Ok: Principal } + | { Err: CreateCanisterError }; export type Cycles = bigint; export interface CyclesCanisterInitPayload { exchange_rate_canister: [] | [ExchangeRateCanister]; @@ -23,9 +43,12 @@ export interface IcpXdrConversionRateResponse { data: IcpXdrConversionRate; hash_tree: Uint8Array | number[]; } +export type Memo = bigint; export interface NotifyCreateCanisterArg { controller: Principal; block_index: BlockIndex; + subnet_selection: [] | [Array]; + settings: [] | [CanisterSettings]; subnet_type: [] | [string]; } export type NotifyCreateCanisterResult = @@ -39,6 +62,19 @@ export type NotifyError = | { Other: { error_message: string; error_code: bigint } } | { Processing: null } | { TransactionTooOld: BlockIndex }; +export interface NotifyMintCyclesArg { + block_index: BlockIndex; + deposit_memo: Memo; + to_subaccount: Subaccount; +} +export type NotifyMintCyclesResult = + | { Ok: NotifyMintCyclesSuccess } + | { Err: NotifyError }; +export interface NotifyMintCyclesSuccess { + balance: bigint; + block_index: bigint; + minted: bigint; +} export interface NotifyTopUpArg { block_index: BlockIndex; canister_id: Principal; @@ -47,10 +83,18 @@ export type NotifyTopUpResult = { Ok: Cycles } | { Err: NotifyError }; export interface PrincipalsAuthorizedToCreateCanistersToSubnetsResponse { data: Array<[Principal, Array]>; } +export type Subaccount = Uint8Array | number[]; +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< [], @@ -61,5 +105,9 @@ export interface _SERVICE { [NotifyCreateCanisterArg], NotifyCreateCanisterResult >; + notify_mint_cycles: ActorMethod< + [NotifyMintCyclesArg], + NotifyMintCyclesResult + >; notify_top_up: ActorMethod<[NotifyTopUpArg], NotifyTopUpResult>; } diff --git a/packages/cmc/candid/cmc.did b/packages/cmc/candid/cmc.did index bbbb9bf1c..8434e3aab 100644 --- a/packages/cmc/candid/cmc.did +++ b/packages/cmc/candid/cmc.did @@ -1,6 +1,15 @@ -// Generated from IC repo commit d2331ec4b3c60f408b876427d7238ec15fb16ad5 'rs/nns/cmc/cmc.did' by import-candid +// Generated from IC repo commit 4778b79 (2023-12-08 tags: release-2023-12-06_23-01+p2p) '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; +}; +type Subaccount = blob; +type Memo = nat64; // The argument of the [notify_top_up] method. type NotifyTopUpArg = record { @@ -11,6 +20,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 +59,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 +124,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; @@ -123,14 +195,40 @@ type CyclesCanisterInitPayload = record { exchange_rate_canister: opt ExchangeRateCanister; }; +type NotifyMintCyclesArg = record { + block_index: BlockIndex; + to_subaccount: Subaccount; + deposit_memo: Memo; +}; + +type NotifyMintCyclesResult = variant { + Ok: NotifyMintCyclesSuccess; + Err: NotifyError; +}; + +type NotifyMintCyclesSuccess = record { + // Cycles ledger block index of deposit + block_index: nat; + // Amount of cycles that were minted and deposited to the cycles ledger + minted: nat; + // New balance of the cycles ledger account + balance: nat; +}; + 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); + // Mints cycles and deposits them to the cycles ledger + notify_mint_cycles : (NotifyMintCyclesArg) -> (NotifyMintCyclesResult); + // Returns the ICP/XDR conversion rate. get_icp_xdr_conversion_rate : () -> (IcpXdrConversionRateResponse) query; diff --git a/packages/cmc/candid/cmc.idl.js b/packages/cmc/candid/cmc.idl.js index 83a4a6aed..378a5c9c8 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({ @@ -50,6 +83,22 @@ export const idlFactory = ({ IDL }) => { 'Ok' : IDL.Principal, 'Err' : NotifyError, }); + const Memo = IDL.Nat64; + const Subaccount = IDL.Vec(IDL.Nat8); + const NotifyMintCyclesArg = IDL.Record({ + 'block_index' : BlockIndex, + 'deposit_memo' : Memo, + 'to_subaccount' : Subaccount, + }); + const NotifyMintCyclesSuccess = IDL.Record({ + 'balance' : IDL.Nat, + 'block_index' : IDL.Nat, + 'minted' : IDL.Nat, + }); + const NotifyMintCyclesResult = IDL.Variant({ + 'Ok' : NotifyMintCyclesSuccess, + 'Err' : NotifyError, + }); const NotifyTopUpArg = IDL.Record({ 'block_index' : BlockIndex, 'canister_id' : IDL.Principal, @@ -57,6 +106,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], @@ -77,6 +131,11 @@ export const idlFactory = ({ IDL }) => { [NotifyCreateCanisterResult], [], ), + 'notify_mint_cycles' : IDL.Func( + [NotifyMintCyclesArg], + [NotifyMintCyclesResult], + [], + ), 'notify_top_up' : IDL.Func([NotifyTopUpArg], [NotifyTopUpResult], []), }); }; diff --git a/packages/ic-management/candid/ic-management.certified.idl.js b/packages/ic-management/candid/ic-management.certified.idl.js index 27ccaa55a..668fe44ce 100644 --- a/packages/ic-management/candid/ic-management.certified.idl.js +++ b/packages/ic-management/candid/ic-management.certified.idl.js @@ -77,12 +77,14 @@ export const idlFactory = ({ IDL }) => { const definite_canister_settings = IDL.Record({ 'freezing_threshold' : IDL.Nat, 'controllers' : IDL.Vec(IDL.Principal), + 'reserved_cycles_limit' : IDL.Nat, 'memory_allocation' : IDL.Nat, 'compute_allocation' : IDL.Nat, }); const canister_settings = 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), }); @@ -93,9 +95,16 @@ 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); + const node_metrics = IDL.Record({ + 'num_block_failures_total' : IDL.Nat64, + 'node_id' : IDL.Principal, + 'num_blocks_total' : IDL.Nat64, + }); 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 +115,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( [ @@ -138,10 +152,16 @@ export const idlFactory = ({ IDL }) => { 'settings' : definite_canister_settings, 'idle_cycles_burned_per_day' : IDL.Nat, 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'reserved_cycles' : IDL.Nat, }), ], [], ), + 'clear_chunk_store' : IDL.Func( + [IDL.Record({ 'canister_id' : canister_id })], + [], + [], + ), 'create_canister' : IDL.Func( [ IDL.Record({ @@ -210,6 +230,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 +258,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, @@ -227,6 +270,23 @@ export const idlFactory = ({ IDL }) => { [], [], ), + 'node_metrics_history' : IDL.Func( + [ + IDL.Record({ + 'start_at_timestamp_nanos' : IDL.Nat64, + 'subnet_id' : IDL.Principal, + }), + ], + [ + IDL.Vec( + IDL.Record({ + 'timestamp_nanos' : IDL.Nat64, + 'node_metrics' : IDL.Vec(node_metrics), + }) + ), + ], + [], + ), 'provisional_create_canister_with_cycles' : IDL.Func( [ IDL.Record({ @@ -266,6 +326,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 +352,16 @@ export const idlFactory = ({ IDL }) => { [], [], ), + 'upload_chunk' : IDL.Func( + [ + IDL.Record({ + 'chunk' : IDL.Vec(IDL.Nat8), + 'canister_id' : IDL.Principal, + }), + ], + [chunk_hash], + [], + ), }); }; export const init = ({ IDL }) => { return []; }; diff --git a/packages/ic-management/candid/ic-management.d.ts b/packages/ic-management/candid/ic-management.d.ts index c60714059..bac980629 100644 --- a/packages/ic-management/candid/ic-management.d.ts +++ b/packages/ic-management/candid/ic-management.d.ts @@ -8,6 +8,7 @@ export type canister_id = Principal; export interface canister_settings { freezing_threshold: [] | [bigint]; controllers: [] | [Array]; + reserved_cycles_limit: [] | [bigint]; memory_allocation: [] | [bigint]; compute_allocation: [] | [bigint]; } @@ -37,9 +38,11 @@ export type change_origin = canister_id: Principal; }; }; +export type chunk_hash = Uint8Array | number[]; export interface definite_canister_settings { freezing_threshold: bigint; controllers: Array; + reserved_cycles_limit: bigint; memory_allocation: bigint; compute_allocation: bigint; } @@ -75,6 +78,11 @@ export interface http_response { headers: Array; } export type millisatoshi_per_byte = bigint; +export interface node_metrics { + num_block_failures_total: bigint; + node_id: Principal; + num_blocks_total: bigint; +} export interface outpoint { txid: Uint8Array | number[]; vout: number; @@ -92,11 +100,13 @@ export interface utxo { export type wasm_module = Uint8Array | number[]; export interface _SERVICE { bitcoin_get_balance: ActorMethod<[get_balance_request], satoshi>; + bitcoin_get_balance_query: ActorMethod<[get_balance_request], satoshi>; bitcoin_get_current_fee_percentiles: ActorMethod< [get_current_fee_percentiles_request], BigUint64Array | bigint[] >; bitcoin_get_utxos: ActorMethod<[get_utxos_request], get_utxos_response>; + bitcoin_get_utxos_query: ActorMethod<[get_utxos_request], get_utxos_response>; bitcoin_send_transaction: ActorMethod<[send_transaction_request], undefined>; canister_info: ActorMethod< [{ canister_id: canister_id; num_requested_changes: [] | [bigint] }], @@ -116,8 +126,10 @@ export interface _SERVICE { settings: definite_canister_settings; idle_cycles_burned_per_day: bigint; module_hash: [] | [Uint8Array | number[]]; + reserved_cycles: bigint; } >; + clear_chunk_store: ActorMethod<[{ canister_id: canister_id }], undefined>; create_canister: ActorMethod< [ { @@ -162,18 +174,42 @@ export interface _SERVICE { ], http_response >; + install_chunked_code: ActorMethod< + [ + { + arg: Uint8Array | number[]; + wasm_module_hash: Uint8Array | number[]; + mode: + | { reinstall: null } + | { upgrade: [] | [{ skip_pre_upgrade: [] | [boolean] }] } + | { install: null }; + chunk_hashes_list: Array; + target_canister: canister_id; + sender_canister_version: [] | [bigint]; + storage_canister: [] | [canister_id]; + }, + ], + undefined + >; install_code: ActorMethod< [ { arg: Uint8Array | number[]; wasm_module: wasm_module; - mode: { reinstall: null } | { upgrade: null } | { install: null }; + mode: + | { reinstall: null } + | { upgrade: [] | [{ skip_pre_upgrade: [] | [boolean] }] } + | { install: null }; canister_id: canister_id; sender_canister_version: [] | [bigint]; }, ], undefined >; + node_metrics_history: ActorMethod< + [{ start_at_timestamp_nanos: bigint; subnet_id: Principal }], + Array<{ timestamp_nanos: bigint; node_metrics: Array }> + >; provisional_create_canister_with_cycles: ActorMethod< [ { @@ -202,6 +238,7 @@ export interface _SERVICE { >; start_canister: ActorMethod<[{ canister_id: canister_id }], undefined>; stop_canister: ActorMethod<[{ canister_id: canister_id }], undefined>; + stored_chunks: ActorMethod<[{ canister_id: canister_id }], Array>; uninstall_code: ActorMethod< [ { @@ -221,4 +258,8 @@ export interface _SERVICE { ], undefined >; + upload_chunk: ActorMethod< + [{ chunk: Uint8Array | number[]; canister_id: Principal }], + chunk_hash + >; } diff --git a/packages/ic-management/candid/ic-management.did b/packages/ic-management/candid/ic-management.did index 44b44e722..714c0aa3b 100644 --- a/packages/ic-management/candid/ic-management.did +++ b/packages/ic-management/candid/ic-management.did @@ -6,6 +6,7 @@ type canister_settings = record { compute_allocation : opt nat; memory_allocation : opt nat; freezing_threshold : opt nat; + reserved_cycles_limit : opt nat; }; type definite_canister_settings = record { @@ -13,6 +14,7 @@ type definite_canister_settings = record { compute_allocation : nat; memory_allocation : nat; freezing_threshold : nat; + reserved_cycles_limit : nat; }; type change_origin = variant { @@ -46,6 +48,8 @@ type change = record { details : change_details; }; +type chunk_hash = blob; + type http_header = record { name: text; value: text }; type http_response = record { @@ -111,6 +115,12 @@ type send_transaction_request = record { type millisatoshi_per_byte = nat64; +type node_metrics = record { + node_id : principal; + num_blocks_total : nat64; + num_block_failures_total : nat64; +}; + service ic : { create_canister : (record { settings : opt canister_settings; @@ -121,13 +131,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; @@ -141,6 +178,7 @@ service ic : { memory_size: nat; cycles: nat; idle_cycles_burned_per_day: nat; + reserved_cycles: nat; }); canister_info : (record { canister_id : canister_id; @@ -180,10 +218,21 @@ 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); + // metrics interface + node_metrics_history : (record { + subnet_id : principal; + start_at_timestamp_nanos: nat64; + }) -> (vec record { + timestamp_nanos : nat64; + node_metrics : vec node_metrics; + }); + // provisional interfaces for the pre-ledger world provisional_create_canister_with_cycles : (record { amount: opt nat; diff --git a/packages/ic-management/candid/ic-management.idl.js b/packages/ic-management/candid/ic-management.idl.js index c42435d50..2264d4a8c 100644 --- a/packages/ic-management/candid/ic-management.idl.js +++ b/packages/ic-management/candid/ic-management.idl.js @@ -77,12 +77,14 @@ export const idlFactory = ({ IDL }) => { const definite_canister_settings = IDL.Record({ 'freezing_threshold' : IDL.Nat, 'controllers' : IDL.Vec(IDL.Principal), + 'reserved_cycles_limit' : IDL.Nat, 'memory_allocation' : IDL.Nat, 'compute_allocation' : IDL.Nat, }); const canister_settings = 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), }); @@ -93,9 +95,20 @@ 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); + const node_metrics = IDL.Record({ + 'num_block_failures_total' : IDL.Nat64, + 'node_id' : IDL.Principal, + 'num_blocks_total' : IDL.Nat64, + }); 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 +119,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( [ @@ -138,10 +156,16 @@ export const idlFactory = ({ IDL }) => { 'settings' : definite_canister_settings, 'idle_cycles_burned_per_day' : IDL.Nat, 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'reserved_cycles' : IDL.Nat, }), ], [], ), + 'clear_chunk_store' : IDL.Func( + [IDL.Record({ 'canister_id' : canister_id })], + [], + [], + ), 'create_canister' : IDL.Func( [ IDL.Record({ @@ -210,6 +234,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 +262,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, @@ -227,6 +274,23 @@ export const idlFactory = ({ IDL }) => { [], [], ), + 'node_metrics_history' : IDL.Func( + [ + IDL.Record({ + 'start_at_timestamp_nanos' : IDL.Nat64, + 'subnet_id' : IDL.Principal, + }), + ], + [ + IDL.Vec( + IDL.Record({ + 'timestamp_nanos' : IDL.Nat64, + 'node_metrics' : IDL.Vec(node_metrics), + }) + ), + ], + [], + ), 'provisional_create_canister_with_cycles' : IDL.Func( [ IDL.Record({ @@ -266,6 +330,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 +356,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..78419be6e 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 4778b79 (2023-12-08 tags: release-2023-12-06_23-01+p2p) 'rs/rosetta-api/icp_ledger/index/index.did' by import-candid type Account = record { owner : principal; subaccount : opt vec nat8 }; type GetAccountIdentifierTransactionsArgs = record { max_results : nat64; diff --git a/packages/ledger-icp/candid/ledger.certified.idl.js b/packages/ledger-icp/candid/ledger.certified.idl.js index a3ab1bf34..162a384f5 100644 --- a/packages/ledger-icp/candid/ledger.certified.idl.js +++ b/packages/ledger-icp/candid/ledger.certified.idl.js @@ -16,6 +16,7 @@ export const idlFactory = ({ IDL }) => { const Duration = IDL.Record({ 'secs' : IDL.Nat64, 'nanos' : IDL.Nat32 }); const ArchiveOptions = IDL.Record({ 'num_blocks_to_archive' : IDL.Nat64, + 'max_transactions_per_response' : IDL.Opt(IDL.Nat64), 'trigger_threshold' : IDL.Nat64, 'max_message_size_bytes' : IDL.Opt(IDL.Nat64), 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64), @@ -55,6 +56,7 @@ export const idlFactory = ({ IDL }) => { 'from' : AccountIdentifier, 'allowance_e8s' : IDL.Int, 'allowance' : Tokens, + 'expected_allowance' : IDL.Opt(Tokens), 'expires_at' : IDL.Opt(TimeStamp), 'spender' : AccountIdentifier, }), @@ -69,13 +71,7 @@ export const idlFactory = ({ IDL }) => { 'fee' : Tokens, 'from' : AccountIdentifier, 'amount' : Tokens, - }), - 'TransferFrom' : IDL.Record({ - 'to' : AccountIdentifier, - 'fee' : Tokens, - 'from' : AccountIdentifier, - 'amount' : Tokens, - 'spender' : AccountIdentifier, + 'spender' : IDL.Opt(IDL.Vec(IDL.Nat8)), }), }); const Transaction = IDL.Record({ @@ -184,16 +180,16 @@ export const idlFactory = ({ IDL }) => { }); const Allowance = IDL.Record({ 'allowance' : Icrc1Tokens, - 'expires_at' : IDL.Opt(TimeStamp), + 'expires_at' : IDL.Opt(Icrc1Timestamp), }); const ApproveArgs = IDL.Record({ 'fee' : IDL.Opt(Icrc1Tokens), 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)), 'from_subaccount' : IDL.Opt(SubAccount), - 'created_at_time' : IDL.Opt(TimeStamp), + 'created_at_time' : IDL.Opt(Icrc1Timestamp), 'amount' : Icrc1Tokens, 'expected_allowance' : IDL.Opt(Icrc1Tokens), - 'expires_at' : IDL.Opt(TimeStamp), + 'expires_at' : IDL.Opt(Icrc1Timestamp), 'spender' : Account, }); const ApproveError = IDL.Variant({ @@ -214,6 +210,33 @@ export const idlFactory = ({ IDL }) => { 'Ok' : Icrc1BlockIndex, 'Err' : ApproveError, }); + const TransferFromArgs = IDL.Record({ + 'to' : Account, + 'fee' : IDL.Opt(Icrc1Tokens), + 'spender_subaccount' : IDL.Opt(SubAccount), + 'from' : Account, + 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)), + 'created_at_time' : IDL.Opt(Icrc1Timestamp), + 'amount' : Icrc1Tokens, + }); + const TransferFromError = IDL.Variant({ + 'GenericError' : IDL.Record({ + 'message' : IDL.Text, + 'error_code' : IDL.Nat, + }), + 'TemporarilyUnavailable' : IDL.Null, + 'InsufficientAllowance' : IDL.Record({ 'allowance' : Icrc1Tokens }), + 'BadBurn' : IDL.Record({ 'min_burn_amount' : Icrc1Tokens }), + 'Duplicate' : IDL.Record({ 'duplicate_of' : Icrc1BlockIndex }), + 'BadFee' : IDL.Record({ 'expected_fee' : Icrc1Tokens }), + 'CreatedInFuture' : IDL.Record({ 'ledger_time' : Icrc1Timestamp }), + 'TooOld' : IDL.Null, + 'InsufficientFunds' : IDL.Record({ 'balance' : Icrc1Tokens }), + }); + const TransferFromResult = IDL.Variant({ + 'Ok' : Icrc1BlockIndex, + 'Err' : TransferFromError, + }); const SendArgs = IDL.Record({ 'to' : TextAccountIdentifier, 'fee' : Tokens, @@ -271,6 +294,11 @@ export const idlFactory = ({ IDL }) => { 'icrc1_transfer' : IDL.Func([TransferArg], [Icrc1TransferResult], []), 'icrc2_allowance' : IDL.Func([AllowanceArgs], [Allowance], []), 'icrc2_approve' : IDL.Func([ApproveArgs], [ApproveResult], []), + 'icrc2_transfer_from' : IDL.Func( + [TransferFromArgs], + [TransferFromResult], + [], + ), 'name' : IDL.Func([], [IDL.Record({ 'name' : IDL.Text })], []), 'send_dfx' : IDL.Func([SendArgs], [BlockIndex], []), 'symbol' : IDL.Func([], [IDL.Record({ 'symbol' : IDL.Text })], []), @@ -295,6 +323,7 @@ export const init = ({ IDL }) => { const Duration = IDL.Record({ 'secs' : IDL.Nat64, 'nanos' : IDL.Nat32 }); const ArchiveOptions = IDL.Record({ 'num_blocks_to_archive' : IDL.Nat64, + 'max_transactions_per_response' : IDL.Opt(IDL.Nat64), 'trigger_threshold' : IDL.Nat64, 'max_message_size_bytes' : IDL.Opt(IDL.Nat64), 'cycles_for_archive_creation' : IDL.Opt(IDL.Nat64), diff --git a/packages/ledger-icp/candid/ledger.d.ts b/packages/ledger-icp/candid/ledger.d.ts index 03edf0cb9..afb0c1c56 100644 --- a/packages/ledger-icp/candid/ledger.d.ts +++ b/packages/ledger-icp/candid/ledger.d.ts @@ -14,7 +14,7 @@ export interface AccountBalanceArgsDfx { export type AccountIdentifier = Uint8Array | number[]; export interface Allowance { allowance: Icrc1Tokens; - expires_at: [] | [TimeStamp]; + expires_at: [] | [Icrc1Timestamp]; } export interface AllowanceArgs { account: Account; @@ -24,10 +24,10 @@ export interface ApproveArgs { fee: [] | [Icrc1Tokens]; memo: [] | [Uint8Array | number[]]; from_subaccount: [] | [SubAccount]; - created_at_time: [] | [TimeStamp]; + created_at_time: [] | [Icrc1Timestamp]; amount: Icrc1Tokens; expected_allowance: [] | [Icrc1Tokens]; - expires_at: [] | [TimeStamp]; + expires_at: [] | [Icrc1Timestamp]; spender: Account; } export type ApproveError = @@ -48,6 +48,7 @@ export interface Archive { } export interface ArchiveOptions { num_blocks_to_archive: bigint; + max_transactions_per_response: [] | [bigint]; trigger_threshold: bigint; max_message_size_bytes: [] | [bigint]; cycles_for_archive_creation: [] | [bigint]; @@ -130,6 +131,7 @@ export type Operation = from: AccountIdentifier; allowance_e8s: bigint; allowance: Tokens; + expected_allowance: [] | [Tokens]; expires_at: [] | [TimeStamp]; spender: AccountIdentifier; }; @@ -148,15 +150,7 @@ export type Operation = fee: Tokens; from: AccountIdentifier; amount: Tokens; - }; - } - | { - TransferFrom: { - to: AccountIdentifier; - fee: Tokens; - from: AccountIdentifier; - amount: Tokens; - spender: AccountIdentifier; + spender: [] | [Uint8Array | number[]]; }; }; export type QueryArchiveError = @@ -235,6 +229,30 @@ export interface TransferFee { transfer_fee: Tokens; } export type TransferFeeArg = {}; +export interface TransferFromArgs { + to: Account; + fee: [] | [Icrc1Tokens]; + spender_subaccount: [] | [SubAccount]; + from: Account; + memo: [] | [Uint8Array | number[]]; + created_at_time: [] | [Icrc1Timestamp]; + amount: Icrc1Tokens; +} +export type TransferFromError = + | { + GenericError: { message: string; error_code: bigint }; + } + | { TemporarilyUnavailable: null } + | { InsufficientAllowance: { allowance: Icrc1Tokens } } + | { BadBurn: { min_burn_amount: Icrc1Tokens } } + | { Duplicate: { duplicate_of: Icrc1BlockIndex } } + | { BadFee: { expected_fee: Icrc1Tokens } } + | { CreatedInFuture: { ledger_time: Icrc1Timestamp } } + | { TooOld: null } + | { InsufficientFunds: { balance: Icrc1Tokens } }; +export type TransferFromResult = + | { Ok: Icrc1BlockIndex } + | { Err: TransferFromError }; export type TransferResult = { Ok: BlockIndex } | { Err: TransferError }; export interface UpgradeArgs { maximum_number_of_accounts: [] | [bigint]; @@ -267,6 +285,7 @@ export interface _SERVICE { icrc1_transfer: ActorMethod<[TransferArg], Icrc1TransferResult>; icrc2_allowance: ActorMethod<[AllowanceArgs], Allowance>; icrc2_approve: ActorMethod<[ApproveArgs], ApproveResult>; + icrc2_transfer_from: ActorMethod<[TransferFromArgs], TransferFromResult>; name: ActorMethod<[], { name: string }>; query_blocks: ActorMethod<[GetBlocksArgs], QueryBlocksResponse>; query_encoded_blocks: ActorMethod< diff --git a/packages/ledger-icp/candid/ledger.did b/packages/ledger-icp/candid/ledger.did index 7c7904875..8e8cf10ac 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 4778b79 (2023-12-08 tags: release-2023-12-06_23-01+p2p) '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..4ebf791ea 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 4778b79 (2023-12-08 tags: release-2023-12-06_23-01+p2p) '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..e6635bc4e 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 4778b79 (2023-12-08 tags: release-2023-12-06_23-01+p2p) '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..d74e94967 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 4778b79 (2023-12-08 tags: release-2023-12-06_23-01+p2p) '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.did b/packages/nns/candid/governance.did index 60480a02e..88db384b0 100644 --- a/packages/nns/candid/governance.did +++ b/packages/nns/candid/governance.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit 0ee9960d6 (2023-12-06) 'rs/nns/governance/canister/governance.did' by import-candid +// Generated from IC repo commit 4778b79 (2023-12-08 tags: release-2023-12-06_23-01+p2p) 'rs/nns/governance/canister/governance.did' by import-candid type AccountIdentifier = record { hash : vec nat8 }; type Action = variant { RegisterKnownNeuron : KnownNeuron; diff --git a/packages/nns/candid/governance_test.did b/packages/nns/candid/governance_test.did index 40378b941..dd381f886 100644 --- a/packages/nns/candid/governance_test.did +++ b/packages/nns/candid/governance_test.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit 0ee9960d6 (2023-12-06) 'rs/nns/governance/canister/governance_test.did' by import-candid +// Generated from IC repo commit 4778b79 (2023-12-08 tags: release-2023-12-06_23-01+p2p) 'rs/nns/governance/canister/governance_test.did' by import-candid type AccountIdentifier = record { hash : vec nat8 }; type Action = variant { RegisterKnownNeuron : KnownNeuron; diff --git a/packages/nns/candid/sns_wasm.certified.idl.js b/packages/nns/candid/sns_wasm.certified.idl.js index 55ced4218..7aaf8d00a 100644 --- a/packages/nns/candid/sns_wasm.certified.idl.js +++ b/packages/nns/candid/sns_wasm.certified.idl.js @@ -32,12 +32,19 @@ export const idlFactory = ({ IDL }) => { 'slope_denominator' : IDL.Opt(IDL.Nat64), 'to_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); + const IdealMatchedParticipationFunction = IDL.Record({ + 'serialized_representation' : IDL.Opt(IDL.Text), + }); const NeuronsFundParticipationConstraints = IDL.Record({ 'coefficient_intervals' : IDL.Vec(LinearScalingCoefficient), 'max_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), 'min_direct_participation_threshold_icp_e8s' : IDL.Opt(IDL.Nat64), + 'ideal_matched_participation_function' : IDL.Opt( + IdealMatchedParticipationFunction + ), }); const CfNeuron = IDL.Record({ + 'has_created_neuron_recipes' : IDL.Opt(IDL.Bool), 'nns_neuron_id' : IDL.Nat64, 'amount_icp_e8s' : IDL.Nat64, }); @@ -81,6 +88,7 @@ export const idlFactory = ({ IDL }) => { 'max_dissolve_delay_seconds' : IDL.Opt(IDL.Nat64), 'max_dissolve_delay_bonus_percentage' : IDL.Opt(IDL.Nat64), 'nns_proposal_id' : IDL.Opt(IDL.Nat64), + 'neurons_fund_participation' : IDL.Opt(IDL.Bool), 'min_participant_icp_e8s' : IDL.Opt(IDL.Nat64), 'neuron_basket_construction_parameters' : IDL.Opt( NeuronBasketConstructionParameters @@ -144,6 +152,25 @@ export const idlFactory = ({ IDL }) => { const GetAllowedPrincipalsResponse = IDL.Record({ 'allowed_principals' : IDL.Vec(IDL.Principal), }); + const GetDeployedSnsByProposalIdRequest = IDL.Record({ + 'proposal_id' : IDL.Nat64, + }); + const DeployedSns = IDL.Record({ + 'root_canister_id' : IDL.Opt(IDL.Principal), + 'governance_canister_id' : IDL.Opt(IDL.Principal), + 'index_canister_id' : IDL.Opt(IDL.Principal), + 'swap_canister_id' : IDL.Opt(IDL.Principal), + 'ledger_canister_id' : IDL.Opt(IDL.Principal), + }); + const GetDeployedSnsByProposalIdResult = IDL.Variant({ + 'Error' : SnsWasmError, + 'DeployedSns' : DeployedSns, + }); + const GetDeployedSnsByProposalIdResponse = IDL.Record({ + 'get_deployed_sns_by_proposal_id_result' : IDL.Opt( + GetDeployedSnsByProposalIdResult + ), + }); const SnsVersion = IDL.Record({ 'archive_wasm_hash' : IDL.Vec(IDL.Nat8), 'root_wasm_hash' : IDL.Vec(IDL.Nat8), @@ -175,13 +202,6 @@ export const idlFactory = ({ IDL }) => { const InsertUpgradePathEntriesResponse = IDL.Record({ 'error' : IDL.Opt(SnsWasmError), }); - const DeployedSns = IDL.Record({ - 'root_canister_id' : IDL.Opt(IDL.Principal), - 'governance_canister_id' : IDL.Opt(IDL.Principal), - 'index_canister_id' : IDL.Opt(IDL.Principal), - 'swap_canister_id' : IDL.Opt(IDL.Principal), - 'ledger_canister_id' : IDL.Opt(IDL.Principal), - }); const ListDeployedSnsesResponse = IDL.Record({ 'instances' : IDL.Vec(DeployedSns), }); @@ -235,6 +255,11 @@ export const idlFactory = ({ IDL }) => { [GetAllowedPrincipalsResponse], [], ), + 'get_deployed_sns_by_proposal_id' : IDL.Func( + [GetDeployedSnsByProposalIdRequest], + [GetDeployedSnsByProposalIdResponse], + [], + ), 'get_latest_sns_version_pretty' : IDL.Func( [IDL.Null], [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], diff --git a/packages/nns/candid/sns_wasm.d.ts b/packages/nns/candid/sns_wasm.d.ts index 53667ef1b..0a84318a3 100644 --- a/packages/nns/candid/sns_wasm.d.ts +++ b/packages/nns/candid/sns_wasm.d.ts @@ -15,6 +15,7 @@ export interface Canister { id: [] | [Principal]; } export interface CfNeuron { + has_created_neuron_recipes: [] | [boolean]; nns_neuron_id: bigint; amount_icp_e8s: bigint; } @@ -61,6 +62,17 @@ export interface FractionalDeveloperVotingPower { export interface GetAllowedPrincipalsResponse { allowed_principals: Array; } +export interface GetDeployedSnsByProposalIdRequest { + proposal_id: bigint; +} +export interface GetDeployedSnsByProposalIdResponse { + get_deployed_sns_by_proposal_id_result: + | [] + | [GetDeployedSnsByProposalIdResult]; +} +export type GetDeployedSnsByProposalIdResult = + | { Error: SnsWasmError } + | { DeployedSns: DeployedSns }; export interface GetNextSnsVersionRequest { governance_canister_id: [] | [Principal]; current_version: [] | [SnsVersion]; @@ -77,6 +89,9 @@ export interface GetWasmRequest { export interface GetWasmResponse { wasm: [] | [SnsWasm]; } +export interface IdealMatchedParticipationFunction { + serialized_representation: [] | [string]; +} export type InitialTokenDistribution = { FractionalDeveloperVotingPower: FractionalDeveloperVotingPower; }; @@ -127,6 +142,9 @@ export interface NeuronsFundParticipationConstraints { coefficient_intervals: Array; max_neurons_fund_participation_icp_e8s: [] | [bigint]; min_direct_participation_threshold_icp_e8s: [] | [bigint]; + ideal_matched_participation_function: + | [] + | [IdealMatchedParticipationFunction]; } export interface PrettySnsVersion { archive_wasm_hash: string; @@ -149,6 +167,7 @@ export interface SnsInitPayload { max_dissolve_delay_seconds: [] | [bigint]; max_dissolve_delay_bonus_percentage: [] | [bigint]; nns_proposal_id: [] | [bigint]; + neurons_fund_participation: [] | [boolean]; min_participant_icp_e8s: [] | [bigint]; neuron_basket_construction_parameters: | [] @@ -240,6 +259,10 @@ export interface _SERVICE { add_wasm: ActorMethod<[AddWasmRequest], AddWasmResponse>; deploy_new_sns: ActorMethod<[DeployNewSnsRequest], DeployNewSnsResponse>; get_allowed_principals: ActorMethod<[{}], GetAllowedPrincipalsResponse>; + get_deployed_sns_by_proposal_id: ActorMethod< + [GetDeployedSnsByProposalIdRequest], + GetDeployedSnsByProposalIdResponse + >; get_latest_sns_version_pretty: ActorMethod<[null], Array<[string, string]>>; get_next_sns_version: ActorMethod< [GetNextSnsVersionRequest], diff --git a/packages/nns/candid/sns_wasm.did b/packages/nns/candid/sns_wasm.did index d6ac740a9..81f37ecd9 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 4778b79 (2023-12-08 tags: release-2023-12-06_23-01+p2p) 'rs/nns/sns-wasm/canister/sns-wasm.did' by import-candid type AddWasmRequest = record { hash : vec nat8; wasm : opt SnsWasm }; type AddWasmResponse = record { result : opt Result }; type AirdropDistribution = record { airdrop_neurons : vec NeuronDistribution }; type Canister = record { id : opt principal }; -type CfNeuron = record { nns_neuron_id : nat64; amount_icp_e8s : nat64 }; +type CfNeuron = record { + has_created_neuron_recipes : opt bool; + nns_neuron_id : nat64; + amount_icp_e8s : nat64; +}; type CfParticipant = record { hotkey_principal : text; cf_neurons : vec CfNeuron; @@ -41,6 +45,14 @@ type FractionalDeveloperVotingPower = record { type GetAllowedPrincipalsResponse = record { allowed_principals : vec principal; }; +type GetDeployedSnsByProposalIdRequest = record { proposal_id : nat64 }; +type GetDeployedSnsByProposalIdResponse = record { + get_deployed_sns_by_proposal_id_result : opt GetDeployedSnsByProposalIdResult; +}; +type GetDeployedSnsByProposalIdResult = variant { + Error : SnsWasmError; + DeployedSns : DeployedSns; +}; type GetNextSnsVersionRequest = record { governance_canister_id : opt principal; current_version : opt SnsVersion; @@ -49,6 +61,9 @@ type GetNextSnsVersionResponse = record { next_version : opt SnsVersion }; type GetSnsSubnetIdsResponse = record { sns_subnet_ids : vec principal }; type GetWasmRequest = record { hash : vec nat8 }; type GetWasmResponse = record { wasm : opt SnsWasm }; +type IdealMatchedParticipationFunction = record { + serialized_representation : opt text; +}; type InitialTokenDistribution = variant { FractionalDeveloperVotingPower : FractionalDeveloperVotingPower; }; @@ -91,6 +106,7 @@ type NeuronsFundParticipationConstraints = record { coefficient_intervals : vec LinearScalingCoefficient; max_neurons_fund_participation_icp_e8s : opt nat64; min_direct_participation_threshold_icp_e8s : opt nat64; + ideal_matched_participation_function : opt IdealMatchedParticipationFunction; }; type PrettySnsVersion = record { archive_wasm_hash : text; @@ -113,6 +129,7 @@ type SnsInitPayload = record { max_dissolve_delay_seconds : opt nat64; max_dissolve_delay_bonus_percentage : opt nat64; nns_proposal_id : opt nat64; + neurons_fund_participation : opt bool; min_participant_icp_e8s : opt nat64; neuron_basket_construction_parameters : opt NeuronBasketConstructionParameters; fallback_controller_principal_ids : vec text; @@ -192,6 +209,9 @@ service : (SnsWasmCanisterInitPayload) -> { add_wasm : (AddWasmRequest) -> (AddWasmResponse); deploy_new_sns : (DeployNewSnsRequest) -> (DeployNewSnsResponse); get_allowed_principals : (record {}) -> (GetAllowedPrincipalsResponse) query; + get_deployed_sns_by_proposal_id : (GetDeployedSnsByProposalIdRequest) -> ( + GetDeployedSnsByProposalIdResponse, + ) query; get_latest_sns_version_pretty : (null) -> (vec record { text; text }) query; get_next_sns_version : (GetNextSnsVersionRequest) -> ( GetNextSnsVersionResponse, diff --git a/packages/nns/candid/sns_wasm.idl.js b/packages/nns/candid/sns_wasm.idl.js index d6de2ef3f..c21ca1e41 100644 --- a/packages/nns/candid/sns_wasm.idl.js +++ b/packages/nns/candid/sns_wasm.idl.js @@ -32,12 +32,19 @@ export const idlFactory = ({ IDL }) => { 'slope_denominator' : IDL.Opt(IDL.Nat64), 'to_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); + const IdealMatchedParticipationFunction = IDL.Record({ + 'serialized_representation' : IDL.Opt(IDL.Text), + }); const NeuronsFundParticipationConstraints = IDL.Record({ 'coefficient_intervals' : IDL.Vec(LinearScalingCoefficient), 'max_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), 'min_direct_participation_threshold_icp_e8s' : IDL.Opt(IDL.Nat64), + 'ideal_matched_participation_function' : IDL.Opt( + IdealMatchedParticipationFunction + ), }); const CfNeuron = IDL.Record({ + 'has_created_neuron_recipes' : IDL.Opt(IDL.Bool), 'nns_neuron_id' : IDL.Nat64, 'amount_icp_e8s' : IDL.Nat64, }); @@ -81,6 +88,7 @@ export const idlFactory = ({ IDL }) => { 'max_dissolve_delay_seconds' : IDL.Opt(IDL.Nat64), 'max_dissolve_delay_bonus_percentage' : IDL.Opt(IDL.Nat64), 'nns_proposal_id' : IDL.Opt(IDL.Nat64), + 'neurons_fund_participation' : IDL.Opt(IDL.Bool), 'min_participant_icp_e8s' : IDL.Opt(IDL.Nat64), 'neuron_basket_construction_parameters' : IDL.Opt( NeuronBasketConstructionParameters @@ -144,6 +152,25 @@ export const idlFactory = ({ IDL }) => { const GetAllowedPrincipalsResponse = IDL.Record({ 'allowed_principals' : IDL.Vec(IDL.Principal), }); + const GetDeployedSnsByProposalIdRequest = IDL.Record({ + 'proposal_id' : IDL.Nat64, + }); + const DeployedSns = IDL.Record({ + 'root_canister_id' : IDL.Opt(IDL.Principal), + 'governance_canister_id' : IDL.Opt(IDL.Principal), + 'index_canister_id' : IDL.Opt(IDL.Principal), + 'swap_canister_id' : IDL.Opt(IDL.Principal), + 'ledger_canister_id' : IDL.Opt(IDL.Principal), + }); + const GetDeployedSnsByProposalIdResult = IDL.Variant({ + 'Error' : SnsWasmError, + 'DeployedSns' : DeployedSns, + }); + const GetDeployedSnsByProposalIdResponse = IDL.Record({ + 'get_deployed_sns_by_proposal_id_result' : IDL.Opt( + GetDeployedSnsByProposalIdResult + ), + }); const SnsVersion = IDL.Record({ 'archive_wasm_hash' : IDL.Vec(IDL.Nat8), 'root_wasm_hash' : IDL.Vec(IDL.Nat8), @@ -175,13 +202,6 @@ export const idlFactory = ({ IDL }) => { const InsertUpgradePathEntriesResponse = IDL.Record({ 'error' : IDL.Opt(SnsWasmError), }); - const DeployedSns = IDL.Record({ - 'root_canister_id' : IDL.Opt(IDL.Principal), - 'governance_canister_id' : IDL.Opt(IDL.Principal), - 'index_canister_id' : IDL.Opt(IDL.Principal), - 'swap_canister_id' : IDL.Opt(IDL.Principal), - 'ledger_canister_id' : IDL.Opt(IDL.Principal), - }); const ListDeployedSnsesResponse = IDL.Record({ 'instances' : IDL.Vec(DeployedSns), }); @@ -235,6 +255,11 @@ export const idlFactory = ({ IDL }) => { [GetAllowedPrincipalsResponse], ['query'], ), + 'get_deployed_sns_by_proposal_id' : IDL.Func( + [GetDeployedSnsByProposalIdRequest], + [GetDeployedSnsByProposalIdResponse], + ['query'], + ), 'get_latest_sns_version_pretty' : IDL.Func( [IDL.Null], [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], diff --git a/packages/sns/candid/sns_governance.certified.idl.js b/packages/sns/candid/sns_governance.certified.idl.js index cd04cbc5a..15df82012 100644 --- a/packages/sns/candid/sns_governance.certified.idl.js +++ b/packages/sns/candid/sns_governance.certified.idl.js @@ -142,6 +142,12 @@ export const idlFactory = ({ IDL }) => { 'canister_ids' : IDL.Vec(IDL.Principal), 'new_controllers' : IDL.Vec(IDL.Principal), }); + const MintSnsTokens = IDL.Record({ + 'to_principal' : IDL.Opt(IDL.Principal), + 'to_subaccount' : IDL.Opt(Subaccount), + 'memo' : IDL.Opt(IDL.Nat64), + 'amount_e8s' : IDL.Opt(IDL.Nat64), + }); const ManageSnsMetadata = IDL.Record({ 'url' : IDL.Opt(IDL.Text), 'logo' : IDL.Opt(IDL.Text), @@ -162,6 +168,7 @@ export const idlFactory = ({ IDL }) => { 'TransferSnsTreasuryFunds' : TransferSnsTreasuryFunds, 'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister, 'DeregisterDappCanisters' : DeregisterDappCanisters, + 'MintSnsTokens' : MintSnsTokens, 'Unspecified' : IDL.Record({}), 'ManageSnsMetadata' : ManageSnsMetadata, 'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction, @@ -673,6 +680,12 @@ export const init = ({ IDL }) => { 'canister_ids' : IDL.Vec(IDL.Principal), 'new_controllers' : IDL.Vec(IDL.Principal), }); + const MintSnsTokens = IDL.Record({ + 'to_principal' : IDL.Opt(IDL.Principal), + 'to_subaccount' : IDL.Opt(Subaccount), + 'memo' : IDL.Opt(IDL.Nat64), + 'amount_e8s' : IDL.Opt(IDL.Nat64), + }); const ManageSnsMetadata = IDL.Record({ 'url' : IDL.Opt(IDL.Text), 'logo' : IDL.Opt(IDL.Text), @@ -693,6 +706,7 @@ export const init = ({ IDL }) => { 'TransferSnsTreasuryFunds' : TransferSnsTreasuryFunds, 'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister, 'DeregisterDappCanisters' : DeregisterDappCanisters, + 'MintSnsTokens' : MintSnsTokens, 'Unspecified' : IDL.Record({}), 'ManageSnsMetadata' : ManageSnsMetadata, 'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction, diff --git a/packages/sns/candid/sns_governance.d.ts b/packages/sns/candid/sns_governance.d.ts index 382f5518d..3397d2ea0 100644 --- a/packages/sns/candid/sns_governance.d.ts +++ b/packages/sns/candid/sns_governance.d.ts @@ -16,6 +16,7 @@ export type Action = | { TransferSnsTreasuryFunds: TransferSnsTreasuryFunds } | { UpgradeSnsControlledCanister: UpgradeSnsControlledCanister } | { DeregisterDappCanisters: DeregisterDappCanisters } + | { MintSnsTokens: MintSnsTokens } | { Unspecified: {} } | { ManageSnsMetadata: ManageSnsMetadata } | { @@ -297,6 +298,12 @@ export interface MergeMaturityResponse { merged_maturity_e8s: bigint; new_stake_e8s: bigint; } +export interface MintSnsTokens { + to_principal: [] | [Principal]; + to_subaccount: [] | [Subaccount]; + memo: [] | [bigint]; + amount_e8s: [] | [bigint]; +} export interface Motion { motion_text: string; } diff --git a/packages/sns/candid/sns_governance.did b/packages/sns/candid/sns_governance.did index f7292ec45..6667e13f6 100644 --- a/packages/sns/candid/sns_governance.did +++ b/packages/sns/candid/sns_governance.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit 57f0e39e3 (2023-11-22) 'rs/sns/governance/canister/governance.did' by import-candid +// Generated from IC repo commit 4778b79 (2023-12-08 tags: release-2023-12-06_23-01+p2p) 'rs/sns/governance/canister/governance.did' by import-candid type Account = record { owner : opt principal; subaccount : opt Subaccount }; type Action = variant { ManageNervousSystemParameters : NervousSystemParameters; @@ -9,6 +9,7 @@ type Action = variant { TransferSnsTreasuryFunds : TransferSnsTreasuryFunds; UpgradeSnsControlledCanister : UpgradeSnsControlledCanister; DeregisterDappCanisters : DeregisterDappCanisters; + MintSnsTokens : MintSnsTokens; Unspecified : record {}; ManageSnsMetadata : ManageSnsMetadata; ExecuteGenericNervousSystemFunction : ExecuteGenericNervousSystemFunction; @@ -243,6 +244,12 @@ type MergeMaturityResponse = record { merged_maturity_e8s : nat64; new_stake_e8s : nat64; }; +type MintSnsTokens = record { + to_principal : opt principal; + to_subaccount : opt Subaccount; + memo : opt nat64; + amount_e8s : opt nat64; +}; type Motion = record { motion_text : text }; type NervousSystemFunction = record { id : nat64; diff --git a/packages/sns/candid/sns_governance.idl.js b/packages/sns/candid/sns_governance.idl.js index 9fb215dd6..09a51da74 100644 --- a/packages/sns/candid/sns_governance.idl.js +++ b/packages/sns/candid/sns_governance.idl.js @@ -142,6 +142,12 @@ export const idlFactory = ({ IDL }) => { 'canister_ids' : IDL.Vec(IDL.Principal), 'new_controllers' : IDL.Vec(IDL.Principal), }); + const MintSnsTokens = IDL.Record({ + 'to_principal' : IDL.Opt(IDL.Principal), + 'to_subaccount' : IDL.Opt(Subaccount), + 'memo' : IDL.Opt(IDL.Nat64), + 'amount_e8s' : IDL.Opt(IDL.Nat64), + }); const ManageSnsMetadata = IDL.Record({ 'url' : IDL.Opt(IDL.Text), 'logo' : IDL.Opt(IDL.Text), @@ -162,6 +168,7 @@ export const idlFactory = ({ IDL }) => { 'TransferSnsTreasuryFunds' : TransferSnsTreasuryFunds, 'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister, 'DeregisterDappCanisters' : DeregisterDappCanisters, + 'MintSnsTokens' : MintSnsTokens, 'Unspecified' : IDL.Record({}), 'ManageSnsMetadata' : ManageSnsMetadata, 'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction, @@ -681,6 +688,12 @@ export const init = ({ IDL }) => { 'canister_ids' : IDL.Vec(IDL.Principal), 'new_controllers' : IDL.Vec(IDL.Principal), }); + const MintSnsTokens = IDL.Record({ + 'to_principal' : IDL.Opt(IDL.Principal), + 'to_subaccount' : IDL.Opt(Subaccount), + 'memo' : IDL.Opt(IDL.Nat64), + 'amount_e8s' : IDL.Opt(IDL.Nat64), + }); const ManageSnsMetadata = IDL.Record({ 'url' : IDL.Opt(IDL.Text), 'logo' : IDL.Opt(IDL.Text), @@ -701,6 +714,7 @@ export const init = ({ IDL }) => { 'TransferSnsTreasuryFunds' : TransferSnsTreasuryFunds, 'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister, 'DeregisterDappCanisters' : DeregisterDappCanisters, + 'MintSnsTokens' : MintSnsTokens, 'Unspecified' : IDL.Record({}), 'ManageSnsMetadata' : ManageSnsMetadata, 'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction, diff --git a/packages/sns/candid/sns_governance_test.certified.idl.js b/packages/sns/candid/sns_governance_test.certified.idl.js index 0b9b3650b..ada4c19ce 100644 --- a/packages/sns/candid/sns_governance_test.certified.idl.js +++ b/packages/sns/candid/sns_governance_test.certified.idl.js @@ -142,6 +142,12 @@ export const idlFactory = ({ IDL }) => { 'canister_ids' : IDL.Vec(IDL.Principal), 'new_controllers' : IDL.Vec(IDL.Principal), }); + const MintSnsTokens = IDL.Record({ + 'to_principal' : IDL.Opt(IDL.Principal), + 'to_subaccount' : IDL.Opt(Subaccount), + 'memo' : IDL.Opt(IDL.Nat64), + 'amount_e8s' : IDL.Opt(IDL.Nat64), + }); const ManageSnsMetadata = IDL.Record({ 'url' : IDL.Opt(IDL.Text), 'logo' : IDL.Opt(IDL.Text), @@ -162,6 +168,7 @@ export const idlFactory = ({ IDL }) => { 'TransferSnsTreasuryFunds' : TransferSnsTreasuryFunds, 'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister, 'DeregisterDappCanisters' : DeregisterDappCanisters, + 'MintSnsTokens' : MintSnsTokens, 'Unspecified' : IDL.Record({}), 'ManageSnsMetadata' : ManageSnsMetadata, 'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction, @@ -687,6 +694,12 @@ export const init = ({ IDL }) => { 'canister_ids' : IDL.Vec(IDL.Principal), 'new_controllers' : IDL.Vec(IDL.Principal), }); + const MintSnsTokens = IDL.Record({ + 'to_principal' : IDL.Opt(IDL.Principal), + 'to_subaccount' : IDL.Opt(Subaccount), + 'memo' : IDL.Opt(IDL.Nat64), + 'amount_e8s' : IDL.Opt(IDL.Nat64), + }); const ManageSnsMetadata = IDL.Record({ 'url' : IDL.Opt(IDL.Text), 'logo' : IDL.Opt(IDL.Text), @@ -707,6 +720,7 @@ export const init = ({ IDL }) => { 'TransferSnsTreasuryFunds' : TransferSnsTreasuryFunds, 'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister, 'DeregisterDappCanisters' : DeregisterDappCanisters, + 'MintSnsTokens' : MintSnsTokens, 'Unspecified' : IDL.Record({}), 'ManageSnsMetadata' : ManageSnsMetadata, 'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction, diff --git a/packages/sns/candid/sns_governance_test.d.ts b/packages/sns/candid/sns_governance_test.d.ts index 9f3c8eb7a..8b1bf8bd9 100644 --- a/packages/sns/candid/sns_governance_test.d.ts +++ b/packages/sns/candid/sns_governance_test.d.ts @@ -16,6 +16,7 @@ export type Action = | { TransferSnsTreasuryFunds: TransferSnsTreasuryFunds } | { UpgradeSnsControlledCanister: UpgradeSnsControlledCanister } | { DeregisterDappCanisters: DeregisterDappCanisters } + | { MintSnsTokens: MintSnsTokens } | { Unspecified: {} } | { ManageSnsMetadata: ManageSnsMetadata } | { @@ -304,6 +305,12 @@ export interface MergeMaturityResponse { merged_maturity_e8s: bigint; new_stake_e8s: bigint; } +export interface MintSnsTokens { + to_principal: [] | [Principal]; + to_subaccount: [] | [Subaccount]; + memo: [] | [bigint]; + amount_e8s: [] | [bigint]; +} export interface MintTokensRequest { recipient: [] | [Account]; amount_e8s: [] | [bigint]; diff --git a/packages/sns/candid/sns_governance_test.did b/packages/sns/candid/sns_governance_test.did index 9f7264d0f..52f1133f0 100644 --- a/packages/sns/candid/sns_governance_test.did +++ b/packages/sns/candid/sns_governance_test.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit 57f0e39e3 (2023-11-22) 'rs/sns/governance/canister/governance_test.did' by import-candid +// Generated from IC repo commit 4778b79 (2023-12-08 tags: release-2023-12-06_23-01+p2p) 'rs/sns/governance/canister/governance_test.did' by import-candid type Account = record { owner : opt principal; subaccount : opt Subaccount }; type Action = variant { ManageNervousSystemParameters : NervousSystemParameters; @@ -9,6 +9,7 @@ type Action = variant { TransferSnsTreasuryFunds : TransferSnsTreasuryFunds; UpgradeSnsControlledCanister : UpgradeSnsControlledCanister; DeregisterDappCanisters : DeregisterDappCanisters; + MintSnsTokens : MintSnsTokens; Unspecified : record {}; ManageSnsMetadata : ManageSnsMetadata; ExecuteGenericNervousSystemFunction : ExecuteGenericNervousSystemFunction; @@ -245,6 +246,12 @@ type MergeMaturityResponse = record { merged_maturity_e8s : nat64; new_stake_e8s : nat64; }; +type MintSnsTokens = record { + to_principal : opt principal; + to_subaccount : opt Subaccount; + memo : opt nat64; + amount_e8s : opt nat64; +}; type MintTokensRequest = record { recipient : opt Account; amount_e8s : opt nat64; diff --git a/packages/sns/candid/sns_governance_test.idl.js b/packages/sns/candid/sns_governance_test.idl.js index 71245e55d..fb34edd93 100644 --- a/packages/sns/candid/sns_governance_test.idl.js +++ b/packages/sns/candid/sns_governance_test.idl.js @@ -142,6 +142,12 @@ export const idlFactory = ({ IDL }) => { 'canister_ids' : IDL.Vec(IDL.Principal), 'new_controllers' : IDL.Vec(IDL.Principal), }); + const MintSnsTokens = IDL.Record({ + 'to_principal' : IDL.Opt(IDL.Principal), + 'to_subaccount' : IDL.Opt(Subaccount), + 'memo' : IDL.Opt(IDL.Nat64), + 'amount_e8s' : IDL.Opt(IDL.Nat64), + }); const ManageSnsMetadata = IDL.Record({ 'url' : IDL.Opt(IDL.Text), 'logo' : IDL.Opt(IDL.Text), @@ -162,6 +168,7 @@ export const idlFactory = ({ IDL }) => { 'TransferSnsTreasuryFunds' : TransferSnsTreasuryFunds, 'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister, 'DeregisterDappCanisters' : DeregisterDappCanisters, + 'MintSnsTokens' : MintSnsTokens, 'Unspecified' : IDL.Record({}), 'ManageSnsMetadata' : ManageSnsMetadata, 'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction, @@ -695,6 +702,12 @@ export const init = ({ IDL }) => { 'canister_ids' : IDL.Vec(IDL.Principal), 'new_controllers' : IDL.Vec(IDL.Principal), }); + const MintSnsTokens = IDL.Record({ + 'to_principal' : IDL.Opt(IDL.Principal), + 'to_subaccount' : IDL.Opt(Subaccount), + 'memo' : IDL.Opt(IDL.Nat64), + 'amount_e8s' : IDL.Opt(IDL.Nat64), + }); const ManageSnsMetadata = IDL.Record({ 'url' : IDL.Opt(IDL.Text), 'logo' : IDL.Opt(IDL.Text), @@ -715,6 +728,7 @@ export const init = ({ IDL }) => { 'TransferSnsTreasuryFunds' : TransferSnsTreasuryFunds, 'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister, 'DeregisterDappCanisters' : DeregisterDappCanisters, + 'MintSnsTokens' : MintSnsTokens, 'Unspecified' : IDL.Record({}), 'ManageSnsMetadata' : ManageSnsMetadata, 'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction, diff --git a/packages/sns/candid/sns_root.certified.idl.js b/packages/sns/candid/sns_root.certified.idl.js index 8e1915f5f..462c7ff45 100644 --- a/packages/sns/candid/sns_root.certified.idl.js +++ b/packages/sns/candid/sns_root.certified.idl.js @@ -31,23 +31,12 @@ export const idlFactory = ({ IDL }) => { 'upgrade' : IDL.Null, 'install' : IDL.Null, }); - const AuthzChangeOp = IDL.Variant({ - 'Authorize' : IDL.Record({ 'add_self' : IDL.Bool }), - 'Deauthorize' : IDL.Null, - }); - const MethodAuthzChange = IDL.Record({ - 'principal' : IDL.Opt(IDL.Principal), - 'method_name' : IDL.Text, - 'canister' : IDL.Principal, - 'operation' : AuthzChangeOp, - }); - const ChangeCanisterProposal = IDL.Record({ + const ChangeCanisterRequest = IDL.Record({ 'arg' : IDL.Vec(IDL.Nat8), 'wasm_module' : IDL.Vec(IDL.Nat8), 'stop_before_installing' : IDL.Bool, 'mode' : CanisterInstallMode, 'canister_id' : IDL.Principal, - 'authz_changes' : IDL.Vec(MethodAuthzChange), '_allocation' : IDL.Opt(IDL.Nat), 'memory_allocation' : IDL.Opt(IDL.Nat), 'compute_allocation' : IDL.Opt(IDL.Nat), @@ -118,7 +107,7 @@ export const idlFactory = ({ IDL }) => { [CanisterStatusResult], [], ), - 'change_canister' : IDL.Func([ChangeCanisterProposal], [], []), + 'change_canister' : IDL.Func([ChangeCanisterRequest], [], []), 'get_build_metadata' : IDL.Func([], [IDL.Text], []), 'get_sns_canisters_summary' : IDL.Func( [GetSnsCanistersSummaryRequest], diff --git a/packages/sns/candid/sns_root.d.ts b/packages/sns/candid/sns_root.d.ts index 37d65e195..a10744dc8 100644 --- a/packages/sns/candid/sns_root.d.ts +++ b/packages/sns/candid/sns_root.d.ts @@ -1,9 +1,6 @@ import type { ActorMethod } from "@dfinity/agent"; import type { Principal } from "@dfinity/principal"; -export type AuthzChangeOp = - | { Authorize: { add_self: boolean } } - | { Deauthorize: null }; export interface CanisterCallError { code: [] | [number]; description: string; @@ -38,14 +35,13 @@ export interface CanisterSummary { status: [] | [CanisterStatusResultV2]; canister_id: [] | [Principal]; } -export interface ChangeCanisterProposal { +export interface ChangeCanisterRequest { arg: Uint8Array | number[]; wasm_module: Uint8Array | number[]; stop_before_installing: boolean; mode: CanisterInstallMode; canister_id: Principal; query_allocation: [] | [bigint]; - authz_changes: Array; memory_allocation: [] | [bigint]; compute_allocation: [] | [bigint]; } @@ -83,12 +79,6 @@ export interface ListSnsCanistersResponse { dapps: Array; archives: Array; } -export interface MethodAuthzChange { - principal: [] | [Principal]; - method_name: string; - canister: Principal; - operation: AuthzChangeOp; -} export interface RegisterDappCanisterRequest { canister_id: [] | [Principal]; } @@ -114,7 +104,7 @@ export interface SnsRootCanister { } export interface _SERVICE { canister_status: ActorMethod<[CanisterIdRecord], CanisterStatusResult>; - change_canister: ActorMethod<[ChangeCanisterProposal], undefined>; + change_canister: ActorMethod<[ChangeCanisterRequest], undefined>; get_build_metadata: ActorMethod<[], string>; get_sns_canisters_summary: ActorMethod< [GetSnsCanistersSummaryRequest], diff --git a/packages/sns/candid/sns_root.did b/packages/sns/candid/sns_root.did index 29e04df36..84f2c1f4c 100644 --- a/packages/sns/candid/sns_root.did +++ b/packages/sns/candid/sns_root.did @@ -1,8 +1,4 @@ -// Generated from IC repo commit dd51544944987556c978e774aa7a1992e5c11542 'rs/sns/root/canister/root.did' by import-candid -type AuthzChangeOp = variant { - Authorize : record { add_self : bool }; - Deauthorize; -}; +// Generated from IC repo commit 4778b79 (2023-12-08 tags: release-2023-12-06_23-01+p2p) 'rs/sns/root/canister/root.did' by import-candid type CanisterCallError = record { code : opt int32; description : text }; type CanisterIdRecord = record { canister_id : principal }; type CanisterInstallMode = variant { reinstall; upgrade; install }; @@ -26,14 +22,13 @@ type CanisterSummary = record { status : opt CanisterStatusResultV2; canister_id : opt principal; }; -type ChangeCanisterProposal = record { +type ChangeCanisterRequest = record { arg : vec nat8; wasm_module : vec nat8; stop_before_installing : bool; mode : CanisterInstallMode; canister_id : principal; query_allocation : opt nat; - authz_changes : vec MethodAuthzChange; memory_allocation : opt nat; compute_allocation : opt nat; }; @@ -67,12 +62,6 @@ type ListSnsCanistersResponse = record { dapps : vec principal; archives : vec principal; }; -type MethodAuthzChange = record { - "principal" : opt principal; - method_name : text; - canister : principal; - operation : AuthzChangeOp; -}; type RegisterDappCanisterRequest = record { canister_id : opt principal }; type RegisterDappCanistersRequest = record { canister_ids : vec principal }; type SetDappControllersRequest = record { @@ -92,7 +81,7 @@ type SnsRootCanister = record { }; service : (SnsRootCanister) -> { canister_status : (CanisterIdRecord) -> (CanisterStatusResult); - change_canister : (ChangeCanisterProposal) -> (); + change_canister : (ChangeCanisterRequest) -> (); get_build_metadata : () -> (text) query; get_sns_canisters_summary : (GetSnsCanistersSummaryRequest) -> ( GetSnsCanistersSummaryResponse, diff --git a/packages/sns/candid/sns_root.idl.js b/packages/sns/candid/sns_root.idl.js index 956648488..184c5dc40 100644 --- a/packages/sns/candid/sns_root.idl.js +++ b/packages/sns/candid/sns_root.idl.js @@ -31,24 +31,13 @@ export const idlFactory = ({ IDL }) => { 'upgrade' : IDL.Null, 'install' : IDL.Null, }); - const AuthzChangeOp = IDL.Variant({ - 'Authorize' : IDL.Record({ 'add_self' : IDL.Bool }), - 'Deauthorize' : IDL.Null, - }); - const MethodAuthzChange = IDL.Record({ - 'principal' : IDL.Opt(IDL.Principal), - 'method_name' : IDL.Text, - 'canister' : IDL.Principal, - 'operation' : AuthzChangeOp, - }); - const ChangeCanisterProposal = IDL.Record({ + const ChangeCanisterRequest = IDL.Record({ 'arg' : IDL.Vec(IDL.Nat8), 'wasm_module' : IDL.Vec(IDL.Nat8), 'stop_before_installing' : IDL.Bool, 'mode' : CanisterInstallMode, 'canister_id' : IDL.Principal, 'query_allocation' : IDL.Opt(IDL.Nat), - 'authz_changes' : IDL.Vec(MethodAuthzChange), 'memory_allocation' : IDL.Opt(IDL.Nat), 'compute_allocation' : IDL.Opt(IDL.Nat), }); @@ -118,7 +107,7 @@ export const idlFactory = ({ IDL }) => { [CanisterStatusResult], [], ), - 'change_canister' : IDL.Func([ChangeCanisterProposal], [], []), + 'change_canister' : IDL.Func([ChangeCanisterRequest], [], []), 'get_build_metadata' : IDL.Func([], [IDL.Text], ['query']), 'get_sns_canisters_summary' : IDL.Func( [GetSnsCanistersSummaryRequest], diff --git a/packages/sns/candid/sns_swap.certified.idl.js b/packages/sns/candid/sns_swap.certified.idl.js index 7e85c000b..6b7a98e9f 100644 --- a/packages/sns/candid/sns_swap.certified.idl.js +++ b/packages/sns/candid/sns_swap.certified.idl.js @@ -11,10 +11,16 @@ export const idlFactory = ({ IDL }) => { 'slope_denominator' : IDL.Opt(IDL.Nat64), 'to_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); + const IdealMatchedParticipationFunction = IDL.Record({ + 'serialized_representation' : IDL.Opt(IDL.Text), + }); const NeuronsFundParticipationConstraints = IDL.Record({ 'coefficient_intervals' : IDL.Vec(LinearScalingCoefficient), 'max_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), 'min_direct_participation_threshold_icp_e8s' : IDL.Opt(IDL.Nat64), + 'ideal_matched_participation_function' : IDL.Opt( + IdealMatchedParticipationFunction + ), }); const CfNeuron = IDL.Record({ 'has_created_neuron_recipes' : IDL.Opt(IDL.Bool), @@ -89,6 +95,13 @@ export const idlFactory = ({ IDL }) => { const SetDappControllersCallResult = IDL.Record({ 'possibility' : IDL.Opt(Possibility), }); + const SweepResult = IDL.Record({ + 'failure' : IDL.Nat32, + 'skipped' : IDL.Nat32, + 'invalid' : IDL.Nat32, + 'success' : IDL.Nat32, + 'global_failures' : IDL.Nat32, + }); const GovernanceError = IDL.Record({ 'error_message' : IDL.Text, 'error_type' : IDL.Int32, @@ -103,26 +116,32 @@ export const idlFactory = ({ IDL }) => { const SettleCommunityFundParticipationResult = IDL.Record({ 'possibility' : IDL.Opt(Possibility_1), }); - const Possibility_2 = IDL.Variant({ + const Ok_1 = IDL.Record({ + 'neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), + 'neurons_fund_neurons_count' : IDL.Opt(IDL.Nat64), + }); + const Error = IDL.Record({ 'message' : IDL.Opt(IDL.Text) }); + const Possibility_2 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : Error }); + const SettleNeuronsFundParticipationResult = IDL.Record({ + 'possibility' : IDL.Opt(Possibility_2), + }); + const Possibility_3 = IDL.Variant({ 'Ok' : IDL.Record({}), 'Err' : CanisterCallError, }); const SetModeCallResult = IDL.Record({ - 'possibility' : IDL.Opt(Possibility_2), - }); - const SweepResult = IDL.Record({ - 'failure' : IDL.Nat32, - 'skipped' : IDL.Nat32, - 'invalid' : IDL.Nat32, - 'success' : IDL.Nat32, - 'global_failures' : IDL.Nat32, + 'possibility' : IDL.Opt(Possibility_3), }); const FinalizeSwapResponse = IDL.Record({ 'set_dapp_controllers_call_result' : IDL.Opt(SetDappControllersCallResult), + 'create_sns_neuron_recipes_result' : IDL.Opt(SweepResult), 'settle_community_fund_participation_result' : IDL.Opt( SettleCommunityFundParticipationResult ), 'error_message' : IDL.Opt(IDL.Text), + 'settle_neurons_fund_participation_result' : IDL.Opt( + SettleNeuronsFundParticipationResult + ), 'set_mode_call_result' : IDL.Opt(SetModeCallResult), 'sweep_icp_result' : IDL.Opt(SweepResult), 'claim_neuron_result' : IDL.Opt(SweepResult), @@ -194,9 +213,9 @@ export const idlFactory = ({ IDL }) => { 'account' : IDL.Opt(Icrc1Account), 'amount_icp_e8s' : IDL.Nat64, }); - const Ok_1 = IDL.Record({ 'ticket' : IDL.Opt(Ticket) }); + const Ok_2 = IDL.Record({ 'ticket' : IDL.Opt(Ticket) }); const Err_1 = IDL.Record({ 'error_type' : IDL.Opt(IDL.Int32) }); - const Result_1 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : Err_1 }); + const Result_1 = IDL.Variant({ 'Ok' : Ok_2, 'Err' : Err_1 }); const GetOpenTicketResponse = IDL.Record({ 'result' : IDL.Opt(Result_1) }); const Params = IDL.Record({ 'min_participant_icp_e8s' : IDL.Nat64, @@ -303,7 +322,7 @@ export const idlFactory = ({ IDL }) => { 'existing_ticket' : IDL.Opt(Ticket), 'error_type' : IDL.Int32, }); - const Result_2 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : Err_2 }); + const Result_2 = IDL.Variant({ 'Ok' : Ok_2, 'Err' : Err_2 }); const NewSaleTicketResponse = IDL.Record({ 'result' : IDL.Opt(Result_2) }); const OpenRequest = IDL.Record({ 'cf_participants' : IDL.Vec(CfParticipant), @@ -379,7 +398,7 @@ export const idlFactory = ({ IDL }) => { [NewSaleTicketResponse], [], ), - 'notify_payment_failure' : IDL.Func([IDL.Record({})], [Ok_1], []), + 'notify_payment_failure' : IDL.Func([IDL.Record({})], [Ok_2], []), 'open' : IDL.Func([OpenRequest], [IDL.Record({})], []), 'refresh_buyer_tokens' : IDL.Func( [RefreshBuyerTokensRequest], @@ -405,10 +424,16 @@ export const init = ({ IDL }) => { 'slope_denominator' : IDL.Opt(IDL.Nat64), 'to_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); + const IdealMatchedParticipationFunction = IDL.Record({ + 'serialized_representation' : IDL.Opt(IDL.Text), + }); const NeuronsFundParticipationConstraints = IDL.Record({ 'coefficient_intervals' : IDL.Vec(LinearScalingCoefficient), 'max_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), 'min_direct_participation_threshold_icp_e8s' : IDL.Opt(IDL.Nat64), + 'ideal_matched_participation_function' : IDL.Opt( + IdealMatchedParticipationFunction + ), }); const CfNeuron = IDL.Record({ 'has_created_neuron_recipes' : IDL.Opt(IDL.Bool), diff --git a/packages/sns/candid/sns_swap.d.ts b/packages/sns/candid/sns_swap.d.ts index 5b5cd5387..81920da87 100644 --- a/packages/sns/candid/sns_swap.d.ts +++ b/packages/sns/candid/sns_swap.d.ts @@ -67,6 +67,9 @@ export interface Err_2 { existing_ticket: [] | [Ticket]; error_type: number; } +export interface Error { + message: [] | [string]; +} export interface ErrorRefundIcpRequest { source_principal_id: [] | [Principal]; } @@ -79,10 +82,14 @@ export interface FailedUpdate { } export interface FinalizeSwapResponse { set_dapp_controllers_call_result: [] | [SetDappControllersCallResult]; + create_sns_neuron_recipes_result: [] | [SweepResult]; settle_community_fund_participation_result: | [] | [SettleCommunityFundParticipationResult]; error_message: [] | [string]; + settle_neurons_fund_participation_result: + | [] + | [SettleNeuronsFundParticipationResult]; set_mode_call_result: [] | [SetModeCallResult]; sweep_icp_result: [] | [SweepResult]; claim_neuron_result: [] | [SweepResult]; @@ -136,6 +143,9 @@ export interface Icrc1Account { owner: [] | [Principal]; subaccount: [] | [Uint8Array | number[]]; } +export interface IdealMatchedParticipationFunction { + serialized_representation: [] | [string]; +} export interface Init { nns_proposal_id: [] | [bigint]; sns_root_canister_id: string; @@ -219,6 +229,9 @@ export interface NeuronsFundParticipationConstraints { coefficient_intervals: Array; max_neurons_fund_participation_icp_e8s: [] | [bigint]; min_direct_participation_threshold_icp_e8s: [] | [bigint]; + ideal_matched_participation_function: + | [] + | [IdealMatchedParticipationFunction]; } export interface NewSaleTicketRequest { subaccount: [] | [Uint8Array | number[]]; @@ -231,6 +244,10 @@ export interface Ok { block_height: [] | [bigint]; } export interface Ok_1 { + neurons_fund_participation_icp_e8s: [] | [bigint]; + neurons_fund_neurons_count: [] | [bigint]; +} +export interface Ok_2 { ticket: [] | [Ticket]; } export interface OpenRequest { @@ -261,7 +278,8 @@ export type Possibility = | { Ok: SetDappControllersResponse } | { Err: CanisterCallError }; export type Possibility_1 = { Ok: Response } | { Err: CanisterCallError }; -export type Possibility_2 = { Ok: {} } | { Err: CanisterCallError }; +export type Possibility_2 = { Ok: Ok_1 } | { Err: Error }; +export type Possibility_3 = { Ok: {} } | { Err: CanisterCallError }; export interface RefreshBuyerTokensRequest { confirmation_text: [] | [string]; buyer: string; @@ -274,8 +292,8 @@ export interface Response { governance_error: [] | [GovernanceError]; } export type Result = { Ok: Ok } | { Err: Err }; -export type Result_1 = { Ok: Ok_1 } | { Err: Err_1 }; -export type Result_2 = { Ok: Ok_1 } | { Err: Err_2 }; +export type Result_1 = { Ok: Ok_2 } | { Err: Err_1 }; +export type Result_2 = { Ok: Ok_2 } | { Err: Err_2 }; export interface SetDappControllersCallResult { possibility: [] | [Possibility]; } @@ -283,11 +301,14 @@ export interface SetDappControllersResponse { failed_updates: Array; } export interface SetModeCallResult { - possibility: [] | [Possibility_2]; + possibility: [] | [Possibility_3]; } export interface SettleCommunityFundParticipationResult { possibility: [] | [Possibility_1]; } +export interface SettleNeuronsFundParticipationResult { + possibility: [] | [Possibility_2]; +} export interface SnsNeuronRecipe { sns: [] | [TransferableAmount]; claimed_status: [] | [number]; @@ -364,7 +385,7 @@ export interface _SERVICE { ListSnsNeuronRecipesResponse >; new_sale_ticket: ActorMethod<[NewSaleTicketRequest], NewSaleTicketResponse>; - notify_payment_failure: ActorMethod<[{}], Ok_1>; + notify_payment_failure: ActorMethod<[{}], Ok_2>; open: ActorMethod<[OpenRequest], {}>; refresh_buyer_tokens: ActorMethod< [RefreshBuyerTokensRequest], diff --git a/packages/sns/candid/sns_swap.did b/packages/sns/candid/sns_swap.did index a542f19fa..3424c4f6d 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 4778b79 (2023-12-08 tags: release-2023-12-06_23-01+p2p) '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),