From c91ba0f2a5a26e8acbd6a2a4a720ceea7cb65173 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Thu, 16 Apr 2026 21:53:40 +0200 Subject: [PATCH] feat(functions): update latest did --- .../declarations/ckbtc/bitcoin.did.d.ts | 8 + .../declarations/ckbtc/bitcoin.did.idl.js | 16 ++ .../declarations/ckbtc/minter.did.d.ts | 190 ++++++++++++++++++ .../declarations/ckbtc/minter.did.idl.js | 118 +++++++++++ .../declarations/cketh/minter.did.d.ts | 140 +++++++++++++ .../declarations/cketh/minter.did.idl.js | 78 +++++++ .../ic-management/ic-management.did.d.ts | 22 +- .../ic-management/ic-management.did.idl.js | 40 +++- .../declarations/ledger-icp/index.did.d.ts | 21 +- .../declarations/ledger-icp/index.did.idl.js | 37 +++- .../ledger-icrc/icrc_index.did.d.ts | 1 + .../ledger-icrc/icrc_index.did.idl.js | 2 + .../ledger-icrc/icrc_ledger.did.d.ts | 1 + .../ledger-icrc/icrc_ledger.did.idl.js | 2 + .../declarations/nns/governance.did.d.ts | 100 +++++++++ .../declarations/nns/governance.did.idl.js | 132 ++++++++++++ .../declarations/nns/governance_test.did.d.ts | 100 +++++++++ .../nns/governance_test.did.idl.js | 132 ++++++++++++ .../declarations/nns/sns_wasm.did.d.ts | 4 + .../declarations/nns/sns_wasm.did.idl.js | 8 + .../declarations/sns/governance.did.d.ts | 4 + .../declarations/sns/governance.did.idl.js | 12 ++ .../declarations/sns/governance_test.did.d.ts | 4 + .../sns/governance_test.did.idl.js | 12 ++ 24 files changed, 1166 insertions(+), 18 deletions(-) diff --git a/packages/functions/src/canisters/declarations/ckbtc/bitcoin.did.d.ts b/packages/functions/src/canisters/declarations/ckbtc/bitcoin.did.d.ts index fdb5d4f32..1fc47f574 100644 --- a/packages/functions/src/canisters/declarations/ckbtc/bitcoin.did.d.ts +++ b/packages/functions/src/canisters/declarations/ckbtc/bitcoin.did.d.ts @@ -14,6 +14,13 @@ export type address = string; export type block_hash = Uint8Array; export type block_header = Uint8Array; export type block_height = number; +export interface blockchain_info { + 'height' : block_height, + 'block_hash' : block_hash, + 'difficulty' : bigint, + 'timestamp' : number, + 'utxos_length' : bigint, +} export type canister_arg = { 'init' : init_config } | { 'upgrade' : [] | [set_config_request] }; export interface config { @@ -127,6 +134,7 @@ export interface _SERVICE { [send_transaction_request], undefined >, + 'get_blockchain_info' : ActorMethod<[], blockchain_info>, 'get_config' : ActorMethod<[], config>, 'set_config' : ActorMethod<[set_config_request], undefined>, } diff --git a/packages/functions/src/canisters/declarations/ckbtc/bitcoin.did.idl.js b/packages/functions/src/canisters/declarations/ckbtc/bitcoin.did.idl.js index 1f67b1980..4064c0123 100644 --- a/packages/functions/src/canisters/declarations/ckbtc/bitcoin.did.idl.js +++ b/packages/functions/src/canisters/declarations/ckbtc/bitcoin.did.idl.js @@ -104,6 +104,13 @@ export const send_transaction_request = IDL.Record({ transaction: IDL.Vec(IDL.Nat8), network: network }); +export const blockchain_info = IDL.Record({ + height: block_height, + block_hash: block_hash, + difficulty: IDL.Nat, + timestamp: IDL.Nat32, + utxos_length: IDL.Nat64 +}); export const config = IDL.Record({ api_access: flag, lazily_evaluate_fee_percentiles: flag, @@ -133,6 +140,7 @@ export const idlService = IDL.Service({ bitcoin_get_utxos: IDL.Func([get_utxos_request], [get_utxos_response], []), bitcoin_get_utxos_query: IDL.Func([get_utxos_request], [get_utxos_response], ['query']), bitcoin_send_transaction: IDL.Func([send_transaction_request], [], []), + get_blockchain_info: IDL.Func([], [blockchain_info], ['query']), get_config: IDL.Func([], [config], ['query']), set_config: IDL.Func([set_config_request], [], []) }); @@ -238,6 +246,13 @@ export const idlFactory = ({IDL}) => { transaction: IDL.Vec(IDL.Nat8), network: network }); + const blockchain_info = IDL.Record({ + height: block_height, + block_hash: block_hash, + difficulty: IDL.Nat, + timestamp: IDL.Nat32, + utxos_length: IDL.Nat64 + }); const config = IDL.Record({ api_access: flag, lazily_evaluate_fee_percentiles: flag, @@ -267,6 +282,7 @@ export const idlFactory = ({IDL}) => { bitcoin_get_utxos: IDL.Func([get_utxos_request], [get_utxos_response], []), bitcoin_get_utxos_query: IDL.Func([get_utxos_request], [get_utxos_response], ['query']), bitcoin_send_transaction: IDL.Func([send_transaction_request], [], []), + get_blockchain_info: IDL.Func([], [blockchain_info], ['query']), get_config: IDL.Func([], [config], ['query']), set_config: IDL.Func([set_config_request], [], []) }); diff --git a/packages/functions/src/canisters/declarations/ckbtc/minter.did.d.ts b/packages/functions/src/canisters/declarations/ckbtc/minter.did.d.ts index 7860486f2..60d47fa92 100644 --- a/packages/functions/src/canisters/declarations/ckbtc/minter.did.d.ts +++ b/packages/functions/src/canisters/declarations/ckbtc/minter.did.d.ts @@ -40,6 +40,40 @@ export type BtcNetwork = { */ 'Testnet' : null }; +export type BurnMemo = { + /** + * The minter consolidated UTXOs. + */ + 'Consolidate' : { + /** + * The total value of the consolidated UTXOs. + */ + 'value' : bigint, + /** + * The number of input UTXOs that were consolidated. + */ + 'inputs' : bigint, + } + } | + { + /** + * The minter processed a retrieve_btc request. + */ + 'Convert' : { + /** + * The status of the Bitcoin check. + */ + 'status' : [] | [Status], + /** + * The destination of the retrieve BTC request. + */ + 'address' : [] | [string], + /** + * The check fee for the burn. + */ + 'kyt_fee' : [] | [bigint], + } + }; export interface CanisterStatusResponse { 'memory_metrics' : MemoryMetrics, 'status' : CanisterStatusType, @@ -56,6 +90,48 @@ export interface CanisterStatusResponse { export type CanisterStatusType = { 'stopped' : null } | { 'stopping' : null } | { 'running' : null }; +export interface DecodeLedgerMemoArgs { + /** + * The encoded memo type + */ + 'memo_type' : MemoType, + /** + * The encoded memo from a minter transaction on the ledger + */ + 'encoded_memo' : Uint8Array, +} +export type DecodeLedgerMemoError = { + /** + * The provided memo could not be decoded. + */ + 'InvalidMemo' : string + }; +export type DecodeLedgerMemoResult = { + /** + * The decoded memo, if the minter was able to decode it. This field is `opt`, so that other memo types can be + * added in the future. + */ + 'Ok' : [] | [DecodedMemo] + } | + { + /** + * An error in case the minter was not able to decode the provided memo. This field is `opt`, so that other error + * types can be added in the future. + */ + 'Err' : [] | [DecodeLedgerMemoError] + }; +export type DecodedMemo = { + /** + * The decoded BurnMemo - `opt` since other variants of `BurnMemo` could be added in the future. + */ + 'Burn' : [] | [BurnMemo] + } | + { + /** + * The decoded MintMemo - `opt` since other variants of `MintMemo` could be added in the future. + */ + 'Mint' : [] | [MintMemo] + }; export interface DefiniteCanisterSettings { 'freezing_threshold' : bigint, 'wasm_memory_threshold' : bigint, @@ -88,6 +164,7 @@ export type EventType = { 'fee' : [] | [bigint], 'change_output' : [] | [{ 'value' : bigint, 'vout' : number }], 'txid' : Uint8Array, + 'signed_tx' : [] | [Uint8Array], 'withdrawal_fee' : [] | [WithdrawalFee], 'utxos' : Array, 'requests' : BigUint64Array, @@ -164,6 +241,14 @@ export type EventType = { { 'checked_utxo_v2' : { 'utxo' : Utxo, 'account' : Account } } | { 'ignored_utxo' : { 'utxo' : Utxo } } | { 'checked_utxo_mint_unknown' : { 'utxo' : Utxo, 'account' : Account } } | + { + 'created_consolidate_utxos_request' : { + 'received_at' : bigint, + 'block_index' : bigint, + 'address' : BitcoinAddress, + 'amount' : bigint, + } + } | { 'reimbursed_failed_deposit' : { 'burn_block_index' : bigint, @@ -201,6 +286,11 @@ export interface InitArgs { * The minimal amount of ckBTC that can be converted to BTC. */ 'retrieve_btc_min_amount' : bigint, + /** + * The minimal amount of BTC that can be converted to ckBTC. + * UTXOs with lower values will be ignored. + */ + 'deposit_btc_min_amount' : [] | [bigint], /** * The principal of the ledger that handles ckBTC transfers. * The default account of the ckBTC minter must be configured as @@ -220,6 +310,14 @@ export interface InitArgs { * / The fee paid per Bitcoin check. */ 'check_fee' : [] | [bigint], + /** + * / The maximum number of input UTXOs allowed in a transaction. + */ + 'max_num_inputs_in_transaction' : [] | [bigint], + /** + * / The minimum number of available UTXOs to trigger a consolidation. + */ + 'utxo_consolidation_threshold' : [] | [bigint], /** * / The canister id of the Bitcoin checker canister. */ @@ -240,6 +338,8 @@ export type InvalidTransactionError = { export type LogVisibility = { 'controllers' : null } | { 'public' : null } | { 'allowed_viewers' : Array }; +export type MemoType = { 'Burn' : null } | + { 'Mint' : null }; export interface MemoryMetrics { 'wasm_binary_size' : bigint, 'wasm_chunk_store_size' : bigint, @@ -250,6 +350,57 @@ export interface MemoryMetrics { 'global_memory_size' : bigint, 'custom_sections_size' : bigint, } +export type MintMemo = { + /** + * [deprecated] The minter minted accumulated check fees to the KYT provider. + */ + 'Kyt' : null + } | + { + 'ReimburseWithdrawal' : { + /** + * The id corresponding to the withdrawal request, + * which corresponds to the ledger burn index. + */ + 'withdrawal_id' : bigint, + } + } | + { + /** + * [deprecated] The minter failed to check retrieve btc destination address + * or the destination address is tainted. + */ + 'KytFail' : { + /** + * The status of the Bitcoin check. + */ + 'status' : [] | [Status], + 'associated_burn_index' : [] | [bigint], + /** + * The Bitcoin check fee. + */ + 'kyt_fee' : [] | [bigint], + } + } | + { + /** + * The minter converted a single UTXO to ckBTC. + */ + 'Convert' : { + /** + * The transaction ID of the accepted UTXO. + */ + 'txid' : [] | [Uint8Array], + /** + * UTXO's output index within the BTC transaction. + */ + 'vout' : [] | [number], + /** + * The Bitcoin check fee. + */ + 'kyt_fee' : [] | [bigint], + } + }; export type MinterArg = { 'Upgrade' : [] | [UpgradeArgs] } | { 'Init' : InitArgs }; export interface MinterInfo { @@ -258,6 +409,11 @@ export interface MinterInfo { * initialization or upgrades, but may vary according to current network fees. */ 'retrieve_btc_min_amount' : bigint, + /** + * Minimal amount of BTC that can be deposited to be converted into ckBTC. + * UTXOs with lower values will be ignored. + */ + 'deposit_btc_min_amount' : [] | [bigint], 'min_confirmations' : number, /** * The same as `check_fee`, but the old name is kept here to be backward compatible. @@ -546,6 +702,19 @@ export type RetrieveBtcWithApprovalError = { */ 'InsufficientFunds' : { 'balance' : bigint } }; +export type Status = { 'CallFailed' : null } | + { + /** + * The minter rejected a retrieve_btc due to a failed Bitcoin check. + */ + 'Rejected' : null + } | + { + /** + * The minter accepted a retrieve_btc request. + */ + 'Accepted' : null + }; export type SuspendedReason = { /** * The minter ignored this UTXO because UTXO's value is too small to pay @@ -618,6 +787,11 @@ export interface UpgradeArgs { * The minimal amount of ckBTC that the minter converts to BTC. */ 'retrieve_btc_min_amount' : [] | [bigint], + /** + * The minimal amount of BTC that can be converted to ckBTC. + * UTXOs with lower values will be ignored. + */ + 'deposit_btc_min_amount' : [] | [bigint], /** * / Maximum time in nanoseconds that a transaction should spend in the queue * / before being sent. @@ -627,6 +801,14 @@ export interface UpgradeArgs { * / The fee per Bitcoin check. */ 'check_fee' : [] | [bigint], + /** + * / The maximum number of input UTXOs allowed in a transaction. + */ + 'max_num_inputs_in_transaction' : [] | [bigint], + /** + * / The minimum number of available UTXOs to trigger a consolidation. + */ + 'utxo_consolidation_threshold' : [] | [bigint], /** * / The principal of the Bitcoin checker canister. */ @@ -686,6 +868,14 @@ export type WithdrawalReimbursementReason = { }; export interface environment_variable { 'value' : string, 'name' : string } export interface _SERVICE { + /** + * Section "Transaction Information" {{{ + * Returns information related to minter transactions. + */ + 'decode_ledger_memo' : ActorMethod< + [DecodeLedgerMemoArgs], + DecodeLedgerMemoResult + >, /** * / Returns an estimate of the user's fee (in Satoshi) for a * / retrieve_btc request based on the current status of the Bitcoin network. diff --git a/packages/functions/src/canisters/declarations/ckbtc/minter.did.idl.js b/packages/functions/src/canisters/declarations/ckbtc/minter.did.idl.js index 4f2e0d66f..f71471d80 100644 --- a/packages/functions/src/canisters/declarations/ckbtc/minter.did.idl.js +++ b/packages/functions/src/canisters/declarations/ckbtc/minter.did.idl.js @@ -19,8 +19,11 @@ export const UpgradeArgs = IDL.Record({ kyt_principal: IDL.Opt(IDL.Principal), mode: IDL.Opt(Mode), retrieve_btc_min_amount: IDL.Opt(IDL.Nat64), + deposit_btc_min_amount: IDL.Opt(IDL.Nat64), max_time_in_queue_nanos: IDL.Opt(IDL.Nat64), check_fee: IDL.Opt(IDL.Nat64), + max_num_inputs_in_transaction: IDL.Opt(IDL.Nat64), + utxo_consolidation_threshold: IDL.Opt(IDL.Nat64), btc_checker_principal: IDL.Opt(IDL.Principal), min_confirmations: IDL.Opt(IDL.Nat32), kyt_fee: IDL.Opt(IDL.Nat64) @@ -36,10 +39,13 @@ export const InitArgs = IDL.Record({ ecdsa_key_name: IDL.Text, mode: Mode, retrieve_btc_min_amount: IDL.Nat64, + deposit_btc_min_amount: IDL.Opt(IDL.Nat64), ledger_id: IDL.Principal, max_time_in_queue_nanos: IDL.Nat64, btc_network: BtcNetwork, check_fee: IDL.Opt(IDL.Nat64), + max_num_inputs_in_transaction: IDL.Opt(IDL.Nat64), + utxo_consolidation_threshold: IDL.Opt(IDL.Nat64), btc_checker_principal: IDL.Opt(IDL.Principal), min_confirmations: IDL.Opt(IDL.Nat32), kyt_fee: IDL.Opt(IDL.Nat64) @@ -48,6 +54,47 @@ export const MinterArg = IDL.Variant({ Upgrade: IDL.Opt(UpgradeArgs), Init: InitArgs }); +export const MemoType = IDL.Variant({Burn: IDL.Null, Mint: IDL.Null}); +export const DecodeLedgerMemoArgs = IDL.Record({ + memo_type: MemoType, + encoded_memo: IDL.Vec(IDL.Nat8) +}); +export const Status = IDL.Variant({ + CallFailed: IDL.Null, + Rejected: IDL.Null, + Accepted: IDL.Null +}); +export const BurnMemo = IDL.Variant({ + Consolidate: IDL.Record({value: IDL.Nat64, inputs: IDL.Nat64}), + Convert: IDL.Record({ + status: IDL.Opt(Status), + address: IDL.Opt(IDL.Text), + kyt_fee: IDL.Opt(IDL.Nat64) + }) +}); +export const MintMemo = IDL.Variant({ + Kyt: IDL.Null, + ReimburseWithdrawal: IDL.Record({withdrawal_id: IDL.Nat64}), + KytFail: IDL.Record({ + status: IDL.Opt(Status), + associated_burn_index: IDL.Opt(IDL.Nat64), + kyt_fee: IDL.Opt(IDL.Nat64) + }), + Convert: IDL.Record({ + txid: IDL.Opt(IDL.Vec(IDL.Nat8)), + vout: IDL.Opt(IDL.Nat32), + kyt_fee: IDL.Opt(IDL.Nat64) + }) +}); +export const DecodedMemo = IDL.Variant({ + Burn: IDL.Opt(BurnMemo), + Mint: IDL.Opt(MintMemo) +}); +export const DecodeLedgerMemoError = IDL.Variant({InvalidMemo: IDL.Text}); +export const DecodeLedgerMemoResult = IDL.Variant({ + Ok: IDL.Opt(DecodedMemo), + Err: IDL.Opt(DecodeLedgerMemoError) +}); export const MemoryMetrics = IDL.Record({ wasm_binary_size: IDL.Nat, wasm_chunk_store_size: IDL.Nat, @@ -162,6 +209,7 @@ export const EventType = IDL.Variant({ fee: IDL.Opt(IDL.Nat64), change_output: IDL.Opt(IDL.Record({value: IDL.Nat64, vout: IDL.Nat32})), txid: IDL.Vec(IDL.Nat8), + signed_tx: IDL.Opt(IDL.Vec(IDL.Nat8)), withdrawal_fee: IDL.Opt(WithdrawalFee), utxos: IDL.Vec(Utxo), requests: IDL.Vec(IDL.Nat64), @@ -228,6 +276,12 @@ export const EventType = IDL.Variant({ utxo: Utxo, account: Account }), + created_consolidate_utxos_request: IDL.Record({ + received_at: IDL.Nat64, + block_index: IDL.Nat64, + address: BitcoinAddress, + amount: IDL.Nat64 + }), reimbursed_failed_deposit: IDL.Record({ burn_block_index: IDL.Nat64, mint_block_index: IDL.Nat64 @@ -243,6 +297,7 @@ export const Event = IDL.Record({ }); export const MinterInfo = IDL.Record({ retrieve_btc_min_amount: IDL.Nat64, + deposit_btc_min_amount: IDL.Opt(IDL.Nat64), min_confirmations: IDL.Nat32, kyt_fee: IDL.Nat64 }); @@ -347,6 +402,7 @@ export const UpdateBalanceError = IDL.Variant({ }); export const idlService = IDL.Service({ + decode_ledger_memo: IDL.Func([DecodeLedgerMemoArgs], [DecodeLedgerMemoResult], ['query']), estimate_withdrawal_fee: IDL.Func( [IDL.Record({amount: IDL.Opt(IDL.Nat64)})], [IDL.Record({minter_fee: IDL.Nat64, bitcoin_fee: IDL.Nat64})], @@ -444,8 +500,11 @@ export const idlFactory = ({IDL}) => { kyt_principal: IDL.Opt(IDL.Principal), mode: IDL.Opt(Mode), retrieve_btc_min_amount: IDL.Opt(IDL.Nat64), + deposit_btc_min_amount: IDL.Opt(IDL.Nat64), max_time_in_queue_nanos: IDL.Opt(IDL.Nat64), check_fee: IDL.Opt(IDL.Nat64), + max_num_inputs_in_transaction: IDL.Opt(IDL.Nat64), + utxo_consolidation_threshold: IDL.Opt(IDL.Nat64), btc_checker_principal: IDL.Opt(IDL.Principal), min_confirmations: IDL.Opt(IDL.Nat32), kyt_fee: IDL.Opt(IDL.Nat64) @@ -461,10 +520,13 @@ export const idlFactory = ({IDL}) => { ecdsa_key_name: IDL.Text, mode: Mode, retrieve_btc_min_amount: IDL.Nat64, + deposit_btc_min_amount: IDL.Opt(IDL.Nat64), ledger_id: IDL.Principal, max_time_in_queue_nanos: IDL.Nat64, btc_network: BtcNetwork, check_fee: IDL.Opt(IDL.Nat64), + max_num_inputs_in_transaction: IDL.Opt(IDL.Nat64), + utxo_consolidation_threshold: IDL.Opt(IDL.Nat64), btc_checker_principal: IDL.Opt(IDL.Principal), min_confirmations: IDL.Opt(IDL.Nat32), kyt_fee: IDL.Opt(IDL.Nat64) @@ -473,6 +535,47 @@ export const idlFactory = ({IDL}) => { Upgrade: IDL.Opt(UpgradeArgs), Init: InitArgs }); + const MemoType = IDL.Variant({Burn: IDL.Null, Mint: IDL.Null}); + const DecodeLedgerMemoArgs = IDL.Record({ + memo_type: MemoType, + encoded_memo: IDL.Vec(IDL.Nat8) + }); + const Status = IDL.Variant({ + CallFailed: IDL.Null, + Rejected: IDL.Null, + Accepted: IDL.Null + }); + const BurnMemo = IDL.Variant({ + Consolidate: IDL.Record({value: IDL.Nat64, inputs: IDL.Nat64}), + Convert: IDL.Record({ + status: IDL.Opt(Status), + address: IDL.Opt(IDL.Text), + kyt_fee: IDL.Opt(IDL.Nat64) + }) + }); + const MintMemo = IDL.Variant({ + Kyt: IDL.Null, + ReimburseWithdrawal: IDL.Record({withdrawal_id: IDL.Nat64}), + KytFail: IDL.Record({ + status: IDL.Opt(Status), + associated_burn_index: IDL.Opt(IDL.Nat64), + kyt_fee: IDL.Opt(IDL.Nat64) + }), + Convert: IDL.Record({ + txid: IDL.Opt(IDL.Vec(IDL.Nat8)), + vout: IDL.Opt(IDL.Nat32), + kyt_fee: IDL.Opt(IDL.Nat64) + }) + }); + const DecodedMemo = IDL.Variant({ + Burn: IDL.Opt(BurnMemo), + Mint: IDL.Opt(MintMemo) + }); + const DecodeLedgerMemoError = IDL.Variant({InvalidMemo: IDL.Text}); + const DecodeLedgerMemoResult = IDL.Variant({ + Ok: IDL.Opt(DecodedMemo), + Err: IDL.Opt(DecodeLedgerMemoError) + }); const MemoryMetrics = IDL.Record({ wasm_binary_size: IDL.Nat, wasm_chunk_store_size: IDL.Nat, @@ -587,6 +690,7 @@ export const idlFactory = ({IDL}) => { fee: IDL.Opt(IDL.Nat64), change_output: IDL.Opt(IDL.Record({value: IDL.Nat64, vout: IDL.Nat32})), txid: IDL.Vec(IDL.Nat8), + signed_tx: IDL.Opt(IDL.Vec(IDL.Nat8)), withdrawal_fee: IDL.Opt(WithdrawalFee), utxos: IDL.Vec(Utxo), requests: IDL.Vec(IDL.Nat64), @@ -653,6 +757,12 @@ export const idlFactory = ({IDL}) => { utxo: Utxo, account: Account }), + created_consolidate_utxos_request: IDL.Record({ + received_at: IDL.Nat64, + block_index: IDL.Nat64, + address: BitcoinAddress, + amount: IDL.Nat64 + }), reimbursed_failed_deposit: IDL.Record({ burn_block_index: IDL.Nat64, mint_block_index: IDL.Nat64 @@ -668,6 +778,7 @@ export const idlFactory = ({IDL}) => { }); const MinterInfo = IDL.Record({ retrieve_btc_min_amount: IDL.Nat64, + deposit_btc_min_amount: IDL.Opt(IDL.Nat64), min_confirmations: IDL.Nat32, kyt_fee: IDL.Nat64 }); @@ -772,6 +883,7 @@ export const idlFactory = ({IDL}) => { }); return IDL.Service({ + decode_ledger_memo: IDL.Func([DecodeLedgerMemoArgs], [DecodeLedgerMemoResult], ['query']), estimate_withdrawal_fee: IDL.Func( [IDL.Record({amount: IDL.Opt(IDL.Nat64)})], [IDL.Record({minter_fee: IDL.Nat64, bitcoin_fee: IDL.Nat64})], @@ -873,8 +985,11 @@ export const init = ({IDL}) => { kyt_principal: IDL.Opt(IDL.Principal), mode: IDL.Opt(Mode), retrieve_btc_min_amount: IDL.Opt(IDL.Nat64), + deposit_btc_min_amount: IDL.Opt(IDL.Nat64), max_time_in_queue_nanos: IDL.Opt(IDL.Nat64), check_fee: IDL.Opt(IDL.Nat64), + max_num_inputs_in_transaction: IDL.Opt(IDL.Nat64), + utxo_consolidation_threshold: IDL.Opt(IDL.Nat64), btc_checker_principal: IDL.Opt(IDL.Principal), min_confirmations: IDL.Opt(IDL.Nat32), kyt_fee: IDL.Opt(IDL.Nat64) @@ -890,10 +1005,13 @@ export const init = ({IDL}) => { ecdsa_key_name: IDL.Text, mode: Mode, retrieve_btc_min_amount: IDL.Nat64, + deposit_btc_min_amount: IDL.Opt(IDL.Nat64), ledger_id: IDL.Principal, max_time_in_queue_nanos: IDL.Nat64, btc_network: BtcNetwork, check_fee: IDL.Opt(IDL.Nat64), + max_num_inputs_in_transaction: IDL.Opt(IDL.Nat64), + utxo_consolidation_threshold: IDL.Opt(IDL.Nat64), btc_checker_principal: IDL.Opt(IDL.Principal), min_confirmations: IDL.Opt(IDL.Nat32), kyt_fee: IDL.Opt(IDL.Nat64) diff --git a/packages/functions/src/canisters/declarations/cketh/minter.did.d.ts b/packages/functions/src/canisters/declarations/cketh/minter.did.d.ts index 5584a32eb..45cf6cb30 100644 --- a/packages/functions/src/canisters/declarations/cketh/minter.did.d.ts +++ b/packages/functions/src/canisters/declarations/cketh/minter.did.d.ts @@ -53,6 +53,52 @@ export type BlockTag = { */ 'Latest' : null }; +export type BurnMemo = { + /** + * The minter processed a ckERC20 withdrawal request. + */ + 'Erc20Convert' : { + /** + * ckETH ledger burn index identifying the burn to pay for the transaction fee. + */ + 'ckerc20_withdrawal_id' : bigint, + /** + * The destination of the withdrawal request. + */ + 'to_address' : string, + } + } | + { + /** + * The minter processed a ckERC20 withdrawal request + * and that burn pays the transaction fee. + */ + 'Erc20GasFee' : { + /** + * The destination of the withdrawal request. + */ + 'to_address' : string, + /** + * The amount of the ckERC20 withdrawal request. + */ + 'ckerc20_withdrawal_amount' : bigint, + /** + * ckERC20 token symbol of the withdrawal request. + */ + 'ckerc20_token_symbol' : string, + } + } | + { + /** + * The minter processed a withdrawal request. + */ + 'Convert' : { + /** + * The destination of the withdrawal request. + */ + 'to_address' : string, + } + }; export interface CanisterStatusResponse { 'status' : CanisterStatusType, 'memory_size' : bigint, @@ -71,6 +117,48 @@ export interface CkErc20Token { 'ledger_canister_id' : Principal, 'ckerc20_token_symbol' : string, } +export interface DecodeLedgerMemoArgs { + /** + * The encoded memo type + */ + 'memo_type' : MemoType, + /** + * The encoded memo from a minter transaction on the ledger + */ + 'encoded_memo' : Uint8Array, +} +export type DecodeLedgerMemoError = { + /** + * The provided memo could not be decoded. + */ + 'InvalidMemo' : string + }; +export type DecodeLedgerMemoResult = { + /** + * The decoded memo, if the minter was able to decode it. This field is `opt`, so that other memo types can be + * added in the future. + */ + 'Ok' : [] | [DecodedMemo] + } | + { + /** + * An error in case the minter was not able to decode the provided memo. This field is `opt`, so that other error + * types can be added in the future. + */ + 'Err' : [] | [DecodeLedgerMemoError] + }; +export type DecodedMemo = { + /** + * The decoded BurnMemo - `opt` since other variants of `BurnMemo` could be added in the future. + */ + 'Burn' : [] | [BurnMemo] + } | + { + /** + * The decoded MintMemo - `opt` since other variants of `MintMemo` could be added in the future. + */ + 'Mint' : [] | [MintMemo] + }; export interface DefiniteCanisterSettings { 'freezing_threshold' : bigint, 'controllers' : Array, @@ -382,6 +470,51 @@ export type LedgerError = { export type LogVisibility = { 'controllers' : null } | { 'public' : null } | { 'allowed_viewers' : Array }; +export type MemoType = { 'Burn' : null } | + { 'Mint' : null }; +export type MintMemo = { + /** + * The minter failed to process a withdrawal request, + * so no transaction was issued, but some reimbursement was made. + */ + 'ReimburseWithdrawal' : { + /** + * The id corresponding to the withdrawal request. + */ + 'withdrawal_id' : bigint, + } + } | + { + 'ReimburseTransaction' : { + /** + * The id corresponding to the withdrawal request. + */ + 'withdrawal_id' : bigint, + /** + * Hash of the failed transaction. + */ + 'tx_hash' : string, + } + } | + { + /** + * The minter received some ETH or ERC20 token. + */ + 'Convert' : { + /** + * Integer of the log index position in the block. + */ + 'log_index' : bigint, + /** + * The sender of the ETH or ERC20 token. + */ + 'from_address' : string, + /** + * Hash of the transaction. + */ + 'tx_hash' : string, + } + }; export type MinterArg = { 'UpgradeArg' : UpgradeArg } | { 'InitArg' : InitArg }; export interface MinterInfo { @@ -813,6 +946,13 @@ export interface _SERVICE { * This call is restricted to the orchestrator ID. */ 'add_ckerc20_token' : ActorMethod<[AddCkErc20Token], undefined>, + /** + * Decode ledger memos produced by the minter when minting (deposits) or burning (withdrawals). + */ + 'decode_ledger_memo' : ActorMethod< + [DecodeLedgerMemoArgs], + DecodeLedgerMemoResult + >, /** * Estimate the price of a transaction issued by the minter when converting ckETH to ETH. */ diff --git a/packages/functions/src/canisters/declarations/cketh/minter.did.idl.js b/packages/functions/src/canisters/declarations/cketh/minter.did.idl.js index b7f9496b6..3ae68f0d7 100644 --- a/packages/functions/src/canisters/declarations/cketh/minter.did.idl.js +++ b/packages/functions/src/canisters/declarations/cketh/minter.did.idl.js @@ -50,6 +50,44 @@ export const AddCkErc20Token = IDL.Record({ address: IDL.Text, ckerc20_token_symbol: IDL.Text }); +export const MemoType = IDL.Variant({Burn: IDL.Null, Mint: IDL.Null}); +export const DecodeLedgerMemoArgs = IDL.Record({ + memo_type: MemoType, + encoded_memo: IDL.Vec(IDL.Nat8) +}); +export const BurnMemo = IDL.Variant({ + Erc20Convert: IDL.Record({ + ckerc20_withdrawal_id: IDL.Nat64, + to_address: IDL.Text + }), + Erc20GasFee: IDL.Record({ + to_address: IDL.Text, + ckerc20_withdrawal_amount: IDL.Nat, + ckerc20_token_symbol: IDL.Text + }), + Convert: IDL.Record({to_address: IDL.Text}) +}); +export const MintMemo = IDL.Variant({ + ReimburseWithdrawal: IDL.Record({withdrawal_id: IDL.Nat64}), + ReimburseTransaction: IDL.Record({ + withdrawal_id: IDL.Nat64, + tx_hash: IDL.Text + }), + Convert: IDL.Record({ + log_index: IDL.Nat, + from_address: IDL.Text, + tx_hash: IDL.Text + }) +}); +export const DecodedMemo = IDL.Variant({ + Burn: IDL.Opt(BurnMemo), + Mint: IDL.Opt(MintMemo) +}); +export const DecodeLedgerMemoError = IDL.Variant({InvalidMemo: IDL.Text}); +export const DecodeLedgerMemoResult = IDL.Variant({ + Ok: IDL.Opt(DecodedMemo), + Err: IDL.Opt(DecodeLedgerMemoError) +}); export const Eip1559TransactionPriceArg = IDL.Record({ ckerc20_ledger_id: IDL.Principal }); @@ -381,6 +419,7 @@ export const WithdrawalDetail = IDL.Record({ export const idlService = IDL.Service({ add_ckerc20_token: IDL.Func([AddCkErc20Token], [], []), + decode_ledger_memo: IDL.Func([DecodeLedgerMemoArgs], [DecodeLedgerMemoResult], ['query']), eip_1559_transaction_price: IDL.Func( [IDL.Opt(Eip1559TransactionPriceArg)], [Eip1559TransactionPrice], @@ -465,6 +504,44 @@ export const idlFactory = ({IDL}) => { address: IDL.Text, ckerc20_token_symbol: IDL.Text }); + const MemoType = IDL.Variant({Burn: IDL.Null, Mint: IDL.Null}); + const DecodeLedgerMemoArgs = IDL.Record({ + memo_type: MemoType, + encoded_memo: IDL.Vec(IDL.Nat8) + }); + const BurnMemo = IDL.Variant({ + Erc20Convert: IDL.Record({ + ckerc20_withdrawal_id: IDL.Nat64, + to_address: IDL.Text + }), + Erc20GasFee: IDL.Record({ + to_address: IDL.Text, + ckerc20_withdrawal_amount: IDL.Nat, + ckerc20_token_symbol: IDL.Text + }), + Convert: IDL.Record({to_address: IDL.Text}) + }); + const MintMemo = IDL.Variant({ + ReimburseWithdrawal: IDL.Record({withdrawal_id: IDL.Nat64}), + ReimburseTransaction: IDL.Record({ + withdrawal_id: IDL.Nat64, + tx_hash: IDL.Text + }), + Convert: IDL.Record({ + log_index: IDL.Nat, + from_address: IDL.Text, + tx_hash: IDL.Text + }) + }); + const DecodedMemo = IDL.Variant({ + Burn: IDL.Opt(BurnMemo), + Mint: IDL.Opt(MintMemo) + }); + const DecodeLedgerMemoError = IDL.Variant({InvalidMemo: IDL.Text}); + const DecodeLedgerMemoResult = IDL.Variant({ + Ok: IDL.Opt(DecodedMemo), + Err: IDL.Opt(DecodeLedgerMemoError) + }); const Eip1559TransactionPriceArg = IDL.Record({ ckerc20_ledger_id: IDL.Principal }); @@ -796,6 +873,7 @@ export const idlFactory = ({IDL}) => { return IDL.Service({ add_ckerc20_token: IDL.Func([AddCkErc20Token], [], []), + decode_ledger_memo: IDL.Func([DecodeLedgerMemoArgs], [DecodeLedgerMemoResult], ['query']), eip_1559_transaction_price: IDL.Func( [IDL.Opt(Eip1559TransactionPriceArg)], [Eip1559TransactionPrice], diff --git a/packages/functions/src/canisters/declarations/ic-management/ic-management.did.d.ts b/packages/functions/src/canisters/declarations/ic-management/ic-management.did.d.ts index f19e5b006..e5adc8e10 100644 --- a/packages/functions/src/canisters/declarations/ic-management/ic-management.did.d.ts +++ b/packages/functions/src/canisters/declarations/ic-management/ic-management.did.d.ts @@ -155,13 +155,25 @@ export type change_details = { 'snapshot_id' : snapshot_id, } } | + { + 'rename_canister' : { + 'rename_to' : { + 'canister_id' : canister_id, + 'version' : bigint, + 'total_num_changes' : bigint, + }, + 'canister_id' : canister_id, + 'requested_by' : Principal, + 'total_num_changes' : bigint, + } + } | { 'controllers_change' : { 'controllers' : Array } } | { 'code_uninstall' : null }; export type change_origin = { 'from_user' : { 'user_id' : Principal } } | { 'from_canister' : { 'canister_version' : [] | [bigint], - 'canister_id' : Principal, + 'canister_id' : canister_id, } }; export interface chunk_hash { 'hash' : Uint8Array } @@ -207,8 +219,10 @@ export interface http_header { 'value' : string, 'name' : string } export interface http_request_args { 'url' : string, 'method' : { 'get' : null } | + { 'put' : null } | { 'head' : null } | - { 'post' : null }, + { 'post' : null } | + { 'delete' : null }, 'max_response_bytes' : [] | [bigint], 'body' : [] | [Uint8Array], 'transform' : [] | [ @@ -366,7 +380,7 @@ export interface uninstall_code_args { 'sender_canister_version' : [] | [bigint], } export interface update_settings_args { - 'canister_id' : Principal, + 'canister_id' : canister_id, 'settings' : canister_settings, 'sender_canister_version' : [] | [bigint], } @@ -405,7 +419,7 @@ export interface upload_canister_snapshot_metadata_response { } export interface upload_chunk_args { 'chunk' : Uint8Array, - 'canister_id' : Principal, + 'canister_id' : canister_id, } export type upload_chunk_result = chunk_hash; export interface utxo { diff --git a/packages/functions/src/canisters/declarations/ic-management/ic-management.did.idl.js b/packages/functions/src/canisters/declarations/ic-management/ic-management.did.idl.js index 112d9514e..34c623569 100644 --- a/packages/functions/src/canisters/declarations/ic-management/ic-management.did.idl.js +++ b/packages/functions/src/canisters/declarations/ic-management/ic-management.did.idl.js @@ -70,7 +70,7 @@ export const change_origin = IDL.Variant({ from_user: IDL.Record({user_id: IDL.Principal}), from_canister: IDL.Record({ canister_version: IDL.Opt(IDL.Nat64), - canister_id: IDL.Principal + canister_id: canister_id }) }); export const snapshot_id = IDL.Vec(IDL.Nat8); @@ -97,6 +97,16 @@ export const change_details = IDL.Variant({ taken_at_timestamp: IDL.Nat64, snapshot_id: snapshot_id }), + rename_canister: IDL.Record({ + rename_to: IDL.Record({ + canister_id: canister_id, + version: IDL.Nat64, + total_num_changes: IDL.Nat64 + }), + canister_id: canister_id, + requested_by: IDL.Principal, + total_num_changes: IDL.Nat64 + }), controllers_change: IDL.Record({controllers: IDL.Vec(IDL.Principal)}), code_uninstall: IDL.Null }); @@ -232,8 +242,10 @@ export const http_request_args = IDL.Record({ url: IDL.Text, method: IDL.Variant({ get: IDL.Null, + put: IDL.Null, head: IDL.Null, - post: IDL.Null + post: IDL.Null, + delete: IDL.Null }), max_response_bytes: IDL.Opt(IDL.Nat64), body: IDL.Opt(IDL.Vec(IDL.Nat8)), @@ -427,7 +439,7 @@ export const uninstall_code_args = IDL.Record({ sender_canister_version: IDL.Opt(IDL.Nat64) }); export const update_settings_args = IDL.Record({ - canister_id: IDL.Principal, + canister_id: canister_id, settings: canister_settings, sender_canister_version: IDL.Opt(IDL.Nat64) }); @@ -472,7 +484,7 @@ export const upload_canister_snapshot_metadata_response = IDL.Record({ }); export const upload_chunk_args = IDL.Record({ chunk: IDL.Vec(IDL.Nat8), - canister_id: IDL.Principal + canister_id: canister_id }); export const upload_chunk_result = chunk_hash; export const vetkd_curve = IDL.Variant({bls12_381_g2: IDL.Null}); @@ -644,7 +656,7 @@ export const idlFactory = ({IDL}) => { from_user: IDL.Record({user_id: IDL.Principal}), from_canister: IDL.Record({ canister_version: IDL.Opt(IDL.Nat64), - canister_id: IDL.Principal + canister_id: canister_id }) }); const snapshot_id = IDL.Vec(IDL.Nat8); @@ -671,6 +683,16 @@ export const idlFactory = ({IDL}) => { taken_at_timestamp: IDL.Nat64, snapshot_id: snapshot_id }), + rename_canister: IDL.Record({ + rename_to: IDL.Record({ + canister_id: canister_id, + version: IDL.Nat64, + total_num_changes: IDL.Nat64 + }), + canister_id: canister_id, + requested_by: IDL.Principal, + total_num_changes: IDL.Nat64 + }), controllers_change: IDL.Record({ controllers: IDL.Vec(IDL.Principal) }), @@ -797,8 +819,10 @@ export const idlFactory = ({IDL}) => { url: IDL.Text, method: IDL.Variant({ get: IDL.Null, + put: IDL.Null, head: IDL.Null, - post: IDL.Null + post: IDL.Null, + delete: IDL.Null }), max_response_bytes: IDL.Opt(IDL.Nat64), body: IDL.Opt(IDL.Vec(IDL.Nat8)), @@ -1001,7 +1025,7 @@ export const idlFactory = ({IDL}) => { sender_canister_version: IDL.Opt(IDL.Nat64) }); const update_settings_args = IDL.Record({ - canister_id: IDL.Principal, + canister_id: canister_id, settings: canister_settings, sender_canister_version: IDL.Opt(IDL.Nat64) }); @@ -1046,7 +1070,7 @@ export const idlFactory = ({IDL}) => { }); const upload_chunk_args = IDL.Record({ chunk: IDL.Vec(IDL.Nat8), - canister_id: IDL.Principal + canister_id: canister_id }); const upload_chunk_result = chunk_hash; const vetkd_curve = IDL.Variant({bls12_381_g2: IDL.Null}); diff --git a/packages/functions/src/canisters/declarations/ledger-icp/index.did.d.ts b/packages/functions/src/canisters/declarations/ledger-icp/index.did.d.ts index a3e4abfb7..bf6a05076 100644 --- a/packages/functions/src/canisters/declarations/ledger-icp/index.did.d.ts +++ b/packages/functions/src/canisters/declarations/ledger-icp/index.did.d.ts @@ -59,7 +59,17 @@ export interface HttpResponse { 'headers' : Array<[string, string]>, 'status_code' : number, } -export interface InitArg { 'ledger_id' : Principal } +export type IndexArg = { 'Upgrade' : UpgradeArg } | + { 'Init' : InitArg }; +export interface InitArg { + 'ledger_id' : Principal, + /** + * The interval in seconds in which to retrieve blocks from the ledger. A lower value makes the index more + * responsive in showing new blocks, but increases the consumption of cycles of both the index and ledger canisters. + * A higher values means that it takes longer for new blocks to show up in the index. + */ + 'retrieve_blocks_from_ledger_interval_seconds' : [] | [bigint], +} export type Operation = { 'Approve' : { 'fee' : Tokens, @@ -97,6 +107,15 @@ export interface TransactionWithId { 'id' : bigint, 'transaction' : Transaction, } +export interface UpgradeArg { + 'ledger_id' : [] | [Principal], + /** + * The interval in seconds in which to retrieve blocks from the ledger. A lower value makes the index more + * responsive in showing new blocks, but increases the consumption of cycles of both the index and ledger canisters. + * A higher values means that it takes longer for new blocks to show up in the index. + */ + 'retrieve_blocks_from_ledger_interval_seconds' : [] | [bigint], +} export interface _SERVICE { 'get_account_identifier_balance' : ActorMethod<[string], bigint>, 'get_account_identifier_transactions' : ActorMethod< diff --git a/packages/functions/src/canisters/declarations/ledger-icp/index.did.idl.js b/packages/functions/src/canisters/declarations/ledger-icp/index.did.idl.js index 6fb2cc9dd..09d052c23 100644 --- a/packages/functions/src/canisters/declarations/ledger-icp/index.did.idl.js +++ b/packages/functions/src/canisters/declarations/ledger-icp/index.did.idl.js @@ -8,7 +8,18 @@ import {IDL} from '@icp-sdk/core/candid'; -export const InitArg = IDL.Record({ledger_id: IDL.Principal}); +export const UpgradeArg = IDL.Record({ + ledger_id: IDL.Opt(IDL.Principal), + retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64) +}); +export const InitArg = IDL.Record({ + ledger_id: IDL.Principal, + retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64) +}); +export const IndexArg = IDL.Variant({ + Upgrade: UpgradeArg, + Init: InitArg +}); export const GetAccountIdentifierTransactionsArgs = IDL.Record({ max_results: IDL.Nat64, start: IDL.Opt(IDL.Nat64), @@ -111,10 +122,18 @@ export const idlService = IDL.Service({ status: IDL.Func([], [Status], ['query']) }); -export const idlInitArgs = [InitArg]; +export const idlInitArgs = [IDL.Opt(IndexArg)]; export const idlFactory = ({IDL}) => { - const InitArg = IDL.Record({ledger_id: IDL.Principal}); + const UpgradeArg = IDL.Record({ + ledger_id: IDL.Opt(IDL.Principal), + retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64) + }); + const InitArg = IDL.Record({ + ledger_id: IDL.Principal, + retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64) + }); + const IndexArg = IDL.Variant({Upgrade: UpgradeArg, Init: InitArg}); const GetAccountIdentifierTransactionsArgs = IDL.Record({ max_results: IDL.Nat64, start: IDL.Opt(IDL.Nat64), @@ -219,7 +238,15 @@ export const idlFactory = ({IDL}) => { }; export const init = ({IDL}) => { - const InitArg = IDL.Record({ledger_id: IDL.Principal}); + const UpgradeArg = IDL.Record({ + ledger_id: IDL.Opt(IDL.Principal), + retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64) + }); + const InitArg = IDL.Record({ + ledger_id: IDL.Principal, + retrieve_blocks_from_ledger_interval_seconds: IDL.Opt(IDL.Nat64) + }); + const IndexArg = IDL.Variant({Upgrade: UpgradeArg, Init: InitArg}); - return [InitArg]; + return [IDL.Opt(IndexArg)]; }; diff --git a/packages/functions/src/canisters/declarations/ledger-icrc/icrc_index.did.d.ts b/packages/functions/src/canisters/declarations/ledger-icrc/icrc_index.did.d.ts index 8cb934171..c3728a55b 100644 --- a/packages/functions/src/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +++ b/packages/functions/src/canisters/declarations/ledger-icrc/icrc_index.did.d.ts @@ -36,6 +36,7 @@ export interface Burn { } export interface FeeCollector { 'ts' : [] | [bigint], + 'mthd' : [] | [string], 'fee_collector' : [] | [Account], 'caller' : [] | [Principal], } diff --git a/packages/functions/src/canisters/declarations/ledger-icrc/icrc_index.did.idl.js b/packages/functions/src/canisters/declarations/ledger-icrc/icrc_index.did.idl.js index 37f35ded2..91fd3ea1d 100644 --- a/packages/functions/src/canisters/declarations/ledger-icrc/icrc_index.did.idl.js +++ b/packages/functions/src/canisters/declarations/ledger-icrc/icrc_index.did.idl.js @@ -60,6 +60,7 @@ export const Approve = IDL.Record({ }); export const FeeCollector = IDL.Record({ ts: IDL.Opt(IDL.Nat64), + mthd: IDL.Opt(IDL.Text), fee_collector: IDL.Opt(Account), caller: IDL.Opt(IDL.Principal) }); @@ -191,6 +192,7 @@ export const idlFactory = ({IDL}) => { }); const FeeCollector = IDL.Record({ ts: IDL.Opt(IDL.Nat64), + mthd: IDL.Opt(IDL.Text), fee_collector: IDL.Opt(Account), caller: IDL.Opt(IDL.Principal) }); diff --git a/packages/functions/src/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts b/packages/functions/src/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts index b775e3715..b5e319928 100644 --- a/packages/functions/src/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +++ b/packages/functions/src/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts @@ -122,6 +122,7 @@ export type Duration = bigint; export interface FeatureFlags { 'icrc2' : boolean } export interface FeeCollector { 'ts' : [] | [bigint], + 'mthd' : [] | [string], 'fee_collector' : [] | [Account], 'caller' : [] | [Principal], } diff --git a/packages/functions/src/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.js b/packages/functions/src/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.js index 5b5438420..ea162c351 100644 --- a/packages/functions/src/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.js +++ b/packages/functions/src/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.js @@ -150,6 +150,7 @@ export const Approve = IDL.Record({ }); export const FeeCollector = IDL.Record({ ts: IDL.Opt(IDL.Nat64), + mthd: IDL.Opt(IDL.Text), fee_collector: IDL.Opt(Account), caller: IDL.Opt(IDL.Principal) }); @@ -575,6 +576,7 @@ export const idlFactory = ({IDL}) => { }); const FeeCollector = IDL.Record({ ts: IDL.Opt(IDL.Nat64), + mthd: IDL.Opt(IDL.Text), fee_collector: IDL.Opt(Account), caller: IDL.Opt(IDL.Principal) }); diff --git a/packages/functions/src/canisters/declarations/nns/governance.did.d.ts b/packages/functions/src/canisters/declarations/nns/governance.did.d.ts index 8a39e2e7d..6379da84d 100644 --- a/packages/functions/src/canisters/declarations/nns/governance.did.d.ts +++ b/packages/functions/src/canisters/declarations/nns/governance.did.d.ts @@ -18,9 +18,12 @@ export interface AccountIdentifier { 'hash' : Uint8Array } export type Action = { 'RegisterKnownNeuron' : KnownNeuron } | { 'FulfillSubnetRentalRequest' : FulfillSubnetRentalRequest } | { 'ManageNeuron' : ManageNeuronProposal } | + { 'LoadCanisterSnapshot' : LoadCanisterSnapshot } | + { 'BlessAlternativeGuestOsVersion' : BlessAlternativeGuestOsVersion } | { 'UpdateCanisterSettings' : UpdateCanisterSettings } | { 'InstallCode' : InstallCode } | { 'DeregisterKnownNeuron' : DeregisterKnownNeuron } | + { 'TakeCanisterSnapshot' : TakeCanisterSnapshot } | { 'StopOrStartCanister' : StopOrStartCanister } | { 'CreateServiceNervousSystem' : CreateServiceNervousSystem } | { 'ExecuteNnsFunction' : ExecuteNnsFunction } | @@ -42,6 +45,29 @@ export interface BallotInfo { 'vote' : number, 'proposal_id' : [] | [ProposalId], } +/** + * Declares an approved set of alternative replica virtual machine software for + * disaster recovery purposes. + */ +export interface BlessAlternativeGuestOsVersion { + /** + * Hexadecimal fingerprint of the recovery rootfs. + * Must contain only hexadecimal characters (0-9, A-F, a-f). + */ + 'rootfs_hash' : [] | [string], + /** + * AMD Secure Processor chip IDs that are allowed to run this software. + * Each chip ID must be exactly 64 bytes. + */ + 'chip_ids' : [] | [Array], + /** + * The version being replaced by this (alternative version) must match this + * field (or one of the possibilities therein). + * + * (Here, we refer to the version being replaced as the "base" version.) + */ + 'base_guest_launch_measurements' : [] | [GuestLaunchMeasurements], +} export type By = { 'NeuronIdOrSubaccount' : {} } | { 'MemoAndController' : ClaimOrRefreshNeuronFromAccount } | { 'Memo' : bigint }; @@ -122,6 +148,42 @@ export interface Committed_1 { export interface Configure { 'operation' : [] | [Operation] } export interface Controllers { 'controllers' : Array } export interface Countries { 'iso_codes' : Array } +/** + * Request to create a new neuron using ICRC-2 transfer_from. + * The caller must have previously approved the governance canister to spend the specified amount. + */ +export interface CreateNeuronRequest { + /** + * The controller of the new neuron. Defaults to the caller. + */ + 'controller' : [] | [Principal], + /** + * The subaccount of the caller to transfer ICP from. Defaults to the default subaccount. + */ + 'source_subaccount' : [] | [Uint8Array], + /** + * The dissolve delay in seconds. Defaults to 7 days. Clamped to [0, 8 years]. + */ + 'dissolve_delay_seconds' : [] | [bigint], + /** + * Whether to automatically stake maturity. Defaults to false. + */ + 'auto_stake_maturity' : [] | [boolean], + /** + * Required. The amount of ICP to stake in e8s. + */ + 'amount_e8s' : [] | [bigint], + /** + * The followees to set for the new neuron. Defaults to the network's default followees. + */ + 'followees' : [] | [SetFollowing], + /** + * Whether the neuron should start dissolving immediately. Defaults to false. + */ + 'dissolving' : [] | [boolean], +} +export type CreateNeuronResponse = { 'Ok' : CreatedNeuron } | + { 'Err' : GovernanceError }; export interface CreateServiceNervousSystem { 'url' : [] | [string], 'governance_parameters' : [] | [GovernanceParameters], @@ -134,6 +196,10 @@ export interface CreateServiceNervousSystem { 'swap_parameters' : [] | [SwapParameters], 'initial_token_distribution' : [] | [InitialTokenDistribution], } +export interface CreatedNeuron { 'neuron_id' : [] | [NeuronId] } +export interface CustomProposalCriticality { + 'additional_critical_native_action_ids' : [] | [BigUint64Array], +} export interface DateRangeFilter { 'start_timestamp_seconds' : [] | [bigint], 'end_timestamp_seconds' : [] | [bigint], @@ -319,9 +385,29 @@ export interface GovernanceParameters { 'neuron_minimum_stake' : [] | [Tokens], 'proposal_wait_for_quiet_deadline_increase' : [] | [Duration], 'proposal_initial_voting_period' : [] | [Duration], + 'custom_proposal_criticality' : [] | [CustomProposalCriticality], 'proposal_rejection_fee' : [] | [Tokens], 'voting_reward_parameters' : [] | [VotingRewardParameters], } +export interface GuestLaunchMeasurement { + /** + * Metadata associated with the measurement. + */ + 'metadata' : [] | [GuestLaunchMeasurementMetadata], + /** + * SEV-SNP measurement (48 bytes). + */ + 'measurement' : [] | [Uint8Array], +} +export interface GuestLaunchMeasurementMetadata { + /** + * Kernel command line used for this measurement. + */ + 'kernel_cmdline' : [] | [string], +} +export interface GuestLaunchMeasurements { + 'guest_launch_measurements' : [] | [Array], +} export interface IdealMatchedParticipationFunction { 'serialized_representation' : [] | [string], } @@ -473,6 +559,10 @@ export interface ListProposalInfoRequest { export interface ListProposalInfoResponse { 'proposal_info' : Array, } +export interface LoadCanisterSnapshot { + 'canister_id' : [] | [Principal], + 'snapshot_id' : [] | [Uint8Array], +} export interface MakeProposalRequest { 'url' : string, 'title' : [] | [string], @@ -892,9 +982,12 @@ export interface Proposal { export type ProposalActionRequest = { 'RegisterKnownNeuron' : KnownNeuron } | { 'FulfillSubnetRentalRequest' : FulfillSubnetRentalRequest } | { 'ManageNeuron' : ManageNeuronRequest } | + { 'LoadCanisterSnapshot' : LoadCanisterSnapshot } | + { 'BlessAlternativeGuestOsVersion' : BlessAlternativeGuestOsVersion } | { 'UpdateCanisterSettings' : UpdateCanisterSettings } | { 'InstallCode' : InstallCodeRequest } | { 'DeregisterKnownNeuron' : DeregisterKnownNeuron } | + { 'TakeCanisterSnapshot' : TakeCanisterSnapshot } | { 'StopOrStartCanister' : StopOrStartCanister } | { 'CreateServiceNervousSystem' : CreateServiceNervousSystem } | { 'ExecuteNnsFunction' : ExecuteNnsFunction } | @@ -1021,6 +1114,8 @@ export type SelfDescribingValue = { 'Int' : bigint } | { 'Map' : Array<[string, SelfDescribingValue]> } | { 'Nat' : bigint } | { 'Blob' : Uint8Array } | + { 'Bool' : boolean } | + { 'Null' : null } | { 'Text' : string } | { 'Array' : Array }; export interface SetDefaultFollowees { @@ -1101,6 +1196,10 @@ export interface SwapParticipationLimits { 'min_direct_participation_icp_e8s' : [] | [bigint], 'max_direct_participation_icp_e8s' : [] | [bigint], } +export interface TakeCanisterSnapshot { + 'replace_snapshot' : [] | [Uint8Array], + 'canister_id' : [] | [Principal], +} export interface Tally { 'no' : bigint, 'yes' : bigint, @@ -1206,6 +1305,7 @@ export interface _SERVICE { [ClaimOrRefreshNeuronFromAccount], ClaimOrRefreshNeuronFromAccountResponse >, + 'create_neuron' : ActorMethod<[CreateNeuronRequest], CreateNeuronResponse>, 'get_build_metadata' : ActorMethod<[], string>, 'get_full_neuron' : ActorMethod<[bigint], Result_2>, 'get_full_neuron_by_id_or_subaccount' : ActorMethod< diff --git a/packages/functions/src/canisters/declarations/nns/governance.did.idl.js b/packages/functions/src/canisters/declarations/nns/governance.did.idl.js index 3d141b6e3..202abc7ac 100644 --- a/packages/functions/src/canisters/declarations/nns/governance.did.idl.js +++ b/packages/functions/src/canisters/declarations/nns/governance.did.idl.js @@ -403,6 +403,25 @@ export const ManageNeuronProposal = IDL.Record({ command: IDL.Opt(ManageNeuronProposalCommand), neuron_id_or_subaccount: IDL.Opt(NeuronIdOrSubaccount) }); +export const LoadCanisterSnapshot = IDL.Record({ + canister_id: IDL.Opt(IDL.Principal), + snapshot_id: IDL.Opt(IDL.Vec(IDL.Nat8)) +}); +export const GuestLaunchMeasurementMetadata = IDL.Record({ + kernel_cmdline: IDL.Opt(IDL.Text) +}); +export const GuestLaunchMeasurement = IDL.Record({ + metadata: IDL.Opt(GuestLaunchMeasurementMetadata), + measurement: IDL.Opt(IDL.Vec(IDL.Nat8)) +}); +export const GuestLaunchMeasurements = IDL.Record({ + guest_launch_measurements: IDL.Opt(IDL.Vec(GuestLaunchMeasurement)) +}); +export const BlessAlternativeGuestOsVersion = IDL.Record({ + rootfs_hash: IDL.Opt(IDL.Text), + chip_ids: IDL.Opt(IDL.Vec(IDL.Vec(IDL.Nat8))), + base_guest_launch_measurements: IDL.Opt(GuestLaunchMeasurements) +}); export const Controllers = IDL.Record({ controllers: IDL.Vec(IDL.Principal) }); @@ -427,12 +446,19 @@ export const InstallCode = IDL.Record({ install_mode: IDL.Opt(IDL.Int32) }); export const DeregisterKnownNeuron = IDL.Record({id: IDL.Opt(NeuronId)}); +export const TakeCanisterSnapshot = IDL.Record({ + replace_snapshot: IDL.Opt(IDL.Vec(IDL.Nat8)), + canister_id: IDL.Opt(IDL.Principal) +}); export const StopOrStartCanister = IDL.Record({ action: IDL.Opt(IDL.Int32), canister_id: IDL.Opt(IDL.Principal) }); export const Duration = IDL.Record({seconds: IDL.Opt(IDL.Nat64)}); export const Tokens = IDL.Record({e8s: IDL.Opt(IDL.Nat64)}); +export const CustomProposalCriticality = IDL.Record({ + additional_critical_native_action_ids: IDL.Opt(IDL.Vec(IDL.Nat64)) +}); export const VotingRewardParameters = IDL.Record({ reward_rate_transition_duration: IDL.Opt(Duration), initial_reward_rate: IDL.Opt(Percentage), @@ -447,6 +473,7 @@ export const GovernanceParameters = IDL.Record({ neuron_minimum_stake: IDL.Opt(Tokens), proposal_wait_for_quiet_deadline_increase: IDL.Opt(Duration), proposal_initial_voting_period: IDL.Opt(Duration), + custom_proposal_criticality: IDL.Opt(CustomProposalCriticality), proposal_rejection_fee: IDL.Opt(Tokens), voting_reward_parameters: IDL.Opt(VotingRewardParameters) }); @@ -567,9 +594,12 @@ export const Action = IDL.Variant({ RegisterKnownNeuron: KnownNeuron, FulfillSubnetRentalRequest: FulfillSubnetRentalRequest, ManageNeuron: ManageNeuronProposal, + LoadCanisterSnapshot: LoadCanisterSnapshot, + BlessAlternativeGuestOsVersion: BlessAlternativeGuestOsVersion, UpdateCanisterSettings: UpdateCanisterSettings, InstallCode: InstallCode, DeregisterKnownNeuron: DeregisterKnownNeuron, + TakeCanisterSnapshot: TakeCanisterSnapshot, StopOrStartCanister: StopOrStartCanister, CreateServiceNervousSystem: CreateServiceNervousSystem, ExecuteNnsFunction: ExecuteNnsFunction, @@ -589,6 +619,8 @@ SelfDescribingValue.fill( Map: IDL.Vec(IDL.Tuple(IDL.Text, SelfDescribingValue)), Nat: IDL.Nat, Blob: IDL.Vec(IDL.Nat8), + Bool: IDL.Bool, + Null: IDL.Null, Text: IDL.Text, Array: IDL.Vec(SelfDescribingValue) }) @@ -718,6 +750,20 @@ export const Result_1 = IDL.Variant({ export const ClaimOrRefreshNeuronFromAccountResponse = IDL.Record({ result: IDL.Opt(Result_1) }); +export const CreateNeuronRequest = IDL.Record({ + controller: IDL.Opt(IDL.Principal), + source_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)), + dissolve_delay_seconds: IDL.Opt(IDL.Nat64), + auto_stake_maturity: IDL.Opt(IDL.Bool), + amount_e8s: IDL.Opt(IDL.Nat64), + followees: IDL.Opt(SetFollowing), + dissolving: IDL.Opt(IDL.Bool) +}); +export const CreatedNeuron = IDL.Record({neuron_id: IDL.Opt(NeuronId)}); +export const CreateNeuronResponse = IDL.Variant({ + Ok: CreatedNeuron, + Err: GovernanceError +}); export const Result_2 = IDL.Variant({Ok: Neuron, Err: GovernanceError}); export const Result_3 = IDL.Variant({ Ok: GovernanceCachedMetrics, @@ -878,9 +924,12 @@ export const ProposalActionRequest = IDL.Variant({ RegisterKnownNeuron: KnownNeuron, FulfillSubnetRentalRequest: FulfillSubnetRentalRequest, ManageNeuron: ManageNeuronRequest, + LoadCanisterSnapshot: LoadCanisterSnapshot, + BlessAlternativeGuestOsVersion: BlessAlternativeGuestOsVersion, UpdateCanisterSettings: UpdateCanisterSettings, InstallCode: InstallCodeRequest, DeregisterKnownNeuron: DeregisterKnownNeuron, + TakeCanisterSnapshot: TakeCanisterSnapshot, StopOrStartCanister: StopOrStartCanister, CreateServiceNervousSystem: CreateServiceNervousSystem, ExecuteNnsFunction: ExecuteNnsFunction, @@ -1025,6 +1074,7 @@ export const idlService = IDL.Service({ [ClaimOrRefreshNeuronFromAccountResponse], [] ), + create_neuron: IDL.Func([CreateNeuronRequest], [CreateNeuronResponse], []), get_build_metadata: IDL.Func([], [IDL.Text], ['query']), get_full_neuron: IDL.Func([IDL.Nat64], [Result_2], ['query']), get_full_neuron_by_id_or_subaccount: IDL.Func([NeuronIdOrSubaccount], [Result_2], ['query']), @@ -1469,6 +1519,25 @@ export const idlFactory = ({IDL}) => { command: IDL.Opt(ManageNeuronProposalCommand), neuron_id_or_subaccount: IDL.Opt(NeuronIdOrSubaccount) }); + const LoadCanisterSnapshot = IDL.Record({ + canister_id: IDL.Opt(IDL.Principal), + snapshot_id: IDL.Opt(IDL.Vec(IDL.Nat8)) + }); + const GuestLaunchMeasurementMetadata = IDL.Record({ + kernel_cmdline: IDL.Opt(IDL.Text) + }); + const GuestLaunchMeasurement = IDL.Record({ + metadata: IDL.Opt(GuestLaunchMeasurementMetadata), + measurement: IDL.Opt(IDL.Vec(IDL.Nat8)) + }); + const GuestLaunchMeasurements = IDL.Record({ + guest_launch_measurements: IDL.Opt(IDL.Vec(GuestLaunchMeasurement)) + }); + const BlessAlternativeGuestOsVersion = IDL.Record({ + rootfs_hash: IDL.Opt(IDL.Text), + chip_ids: IDL.Opt(IDL.Vec(IDL.Vec(IDL.Nat8))), + base_guest_launch_measurements: IDL.Opt(GuestLaunchMeasurements) + }); const Controllers = IDL.Record({controllers: IDL.Vec(IDL.Principal)}); const CanisterSettings = IDL.Record({ freezing_threshold: IDL.Opt(IDL.Nat64), @@ -1491,12 +1560,19 @@ export const idlFactory = ({IDL}) => { install_mode: IDL.Opt(IDL.Int32) }); const DeregisterKnownNeuron = IDL.Record({id: IDL.Opt(NeuronId)}); + const TakeCanisterSnapshot = IDL.Record({ + replace_snapshot: IDL.Opt(IDL.Vec(IDL.Nat8)), + canister_id: IDL.Opt(IDL.Principal) + }); const StopOrStartCanister = IDL.Record({ action: IDL.Opt(IDL.Int32), canister_id: IDL.Opt(IDL.Principal) }); const Duration = IDL.Record({seconds: IDL.Opt(IDL.Nat64)}); const Tokens = IDL.Record({e8s: IDL.Opt(IDL.Nat64)}); + const CustomProposalCriticality = IDL.Record({ + additional_critical_native_action_ids: IDL.Opt(IDL.Vec(IDL.Nat64)) + }); const VotingRewardParameters = IDL.Record({ reward_rate_transition_duration: IDL.Opt(Duration), initial_reward_rate: IDL.Opt(Percentage), @@ -1511,6 +1587,7 @@ export const idlFactory = ({IDL}) => { neuron_minimum_stake: IDL.Opt(Tokens), proposal_wait_for_quiet_deadline_increase: IDL.Opt(Duration), proposal_initial_voting_period: IDL.Opt(Duration), + custom_proposal_criticality: IDL.Opt(CustomProposalCriticality), proposal_rejection_fee: IDL.Opt(Tokens), voting_reward_parameters: IDL.Opt(VotingRewardParameters) }); @@ -1629,9 +1706,12 @@ export const idlFactory = ({IDL}) => { RegisterKnownNeuron: KnownNeuron, FulfillSubnetRentalRequest: FulfillSubnetRentalRequest, ManageNeuron: ManageNeuronProposal, + LoadCanisterSnapshot: LoadCanisterSnapshot, + BlessAlternativeGuestOsVersion: BlessAlternativeGuestOsVersion, UpdateCanisterSettings: UpdateCanisterSettings, InstallCode: InstallCode, DeregisterKnownNeuron: DeregisterKnownNeuron, + TakeCanisterSnapshot: TakeCanisterSnapshot, StopOrStartCanister: StopOrStartCanister, CreateServiceNervousSystem: CreateServiceNervousSystem, ExecuteNnsFunction: ExecuteNnsFunction, @@ -1651,6 +1731,8 @@ export const idlFactory = ({IDL}) => { Map: IDL.Vec(IDL.Tuple(IDL.Text, SelfDescribingValue)), Nat: IDL.Nat, Blob: IDL.Vec(IDL.Nat8), + Bool: IDL.Bool, + Null: IDL.Null, Text: IDL.Text, Array: IDL.Vec(SelfDescribingValue) }) @@ -1780,6 +1862,20 @@ export const idlFactory = ({IDL}) => { const ClaimOrRefreshNeuronFromAccountResponse = IDL.Record({ result: IDL.Opt(Result_1) }); + const CreateNeuronRequest = IDL.Record({ + controller: IDL.Opt(IDL.Principal), + source_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)), + dissolve_delay_seconds: IDL.Opt(IDL.Nat64), + auto_stake_maturity: IDL.Opt(IDL.Bool), + amount_e8s: IDL.Opt(IDL.Nat64), + followees: IDL.Opt(SetFollowing), + dissolving: IDL.Opt(IDL.Bool) + }); + const CreatedNeuron = IDL.Record({neuron_id: IDL.Opt(NeuronId)}); + const CreateNeuronResponse = IDL.Variant({ + Ok: CreatedNeuron, + Err: GovernanceError + }); const Result_2 = IDL.Variant({Ok: Neuron, Err: GovernanceError}); const Result_3 = IDL.Variant({ Ok: GovernanceCachedMetrics, @@ -1935,9 +2031,12 @@ export const idlFactory = ({IDL}) => { RegisterKnownNeuron: KnownNeuron, FulfillSubnetRentalRequest: FulfillSubnetRentalRequest, ManageNeuron: ManageNeuronRequest, + LoadCanisterSnapshot: LoadCanisterSnapshot, + BlessAlternativeGuestOsVersion: BlessAlternativeGuestOsVersion, UpdateCanisterSettings: UpdateCanisterSettings, InstallCode: InstallCodeRequest, DeregisterKnownNeuron: DeregisterKnownNeuron, + TakeCanisterSnapshot: TakeCanisterSnapshot, StopOrStartCanister: StopOrStartCanister, CreateServiceNervousSystem: CreateServiceNervousSystem, ExecuteNnsFunction: ExecuteNnsFunction, @@ -2076,6 +2175,7 @@ export const idlFactory = ({IDL}) => { [ClaimOrRefreshNeuronFromAccountResponse], [] ), + create_neuron: IDL.Func([CreateNeuronRequest], [CreateNeuronResponse], []), get_build_metadata: IDL.Func([], [IDL.Text], ['query']), get_full_neuron: IDL.Func([IDL.Nat64], [Result_2], ['query']), get_full_neuron_by_id_or_subaccount: IDL.Func([NeuronIdOrSubaccount], [Result_2], ['query']), @@ -2518,6 +2618,25 @@ export const init = ({IDL}) => { command: IDL.Opt(ManageNeuronProposalCommand), neuron_id_or_subaccount: IDL.Opt(NeuronIdOrSubaccount) }); + const LoadCanisterSnapshot = IDL.Record({ + canister_id: IDL.Opt(IDL.Principal), + snapshot_id: IDL.Opt(IDL.Vec(IDL.Nat8)) + }); + const GuestLaunchMeasurementMetadata = IDL.Record({ + kernel_cmdline: IDL.Opt(IDL.Text) + }); + const GuestLaunchMeasurement = IDL.Record({ + metadata: IDL.Opt(GuestLaunchMeasurementMetadata), + measurement: IDL.Opt(IDL.Vec(IDL.Nat8)) + }); + const GuestLaunchMeasurements = IDL.Record({ + guest_launch_measurements: IDL.Opt(IDL.Vec(GuestLaunchMeasurement)) + }); + const BlessAlternativeGuestOsVersion = IDL.Record({ + rootfs_hash: IDL.Opt(IDL.Text), + chip_ids: IDL.Opt(IDL.Vec(IDL.Vec(IDL.Nat8))), + base_guest_launch_measurements: IDL.Opt(GuestLaunchMeasurements) + }); const Controllers = IDL.Record({controllers: IDL.Vec(IDL.Principal)}); const CanisterSettings = IDL.Record({ freezing_threshold: IDL.Opt(IDL.Nat64), @@ -2540,12 +2659,19 @@ export const init = ({IDL}) => { install_mode: IDL.Opt(IDL.Int32) }); const DeregisterKnownNeuron = IDL.Record({id: IDL.Opt(NeuronId)}); + const TakeCanisterSnapshot = IDL.Record({ + replace_snapshot: IDL.Opt(IDL.Vec(IDL.Nat8)), + canister_id: IDL.Opt(IDL.Principal) + }); const StopOrStartCanister = IDL.Record({ action: IDL.Opt(IDL.Int32), canister_id: IDL.Opt(IDL.Principal) }); const Duration = IDL.Record({seconds: IDL.Opt(IDL.Nat64)}); const Tokens = IDL.Record({e8s: IDL.Opt(IDL.Nat64)}); + const CustomProposalCriticality = IDL.Record({ + additional_critical_native_action_ids: IDL.Opt(IDL.Vec(IDL.Nat64)) + }); const VotingRewardParameters = IDL.Record({ reward_rate_transition_duration: IDL.Opt(Duration), initial_reward_rate: IDL.Opt(Percentage), @@ -2560,6 +2686,7 @@ export const init = ({IDL}) => { neuron_minimum_stake: IDL.Opt(Tokens), proposal_wait_for_quiet_deadline_increase: IDL.Opt(Duration), proposal_initial_voting_period: IDL.Opt(Duration), + custom_proposal_criticality: IDL.Opt(CustomProposalCriticality), proposal_rejection_fee: IDL.Opt(Tokens), voting_reward_parameters: IDL.Opt(VotingRewardParameters) }); @@ -2678,9 +2805,12 @@ export const init = ({IDL}) => { RegisterKnownNeuron: KnownNeuron, FulfillSubnetRentalRequest: FulfillSubnetRentalRequest, ManageNeuron: ManageNeuronProposal, + LoadCanisterSnapshot: LoadCanisterSnapshot, + BlessAlternativeGuestOsVersion: BlessAlternativeGuestOsVersion, UpdateCanisterSettings: UpdateCanisterSettings, InstallCode: InstallCode, DeregisterKnownNeuron: DeregisterKnownNeuron, + TakeCanisterSnapshot: TakeCanisterSnapshot, StopOrStartCanister: StopOrStartCanister, CreateServiceNervousSystem: CreateServiceNervousSystem, ExecuteNnsFunction: ExecuteNnsFunction, @@ -2700,6 +2830,8 @@ export const init = ({IDL}) => { Map: IDL.Vec(IDL.Tuple(IDL.Text, SelfDescribingValue)), Nat: IDL.Nat, Blob: IDL.Vec(IDL.Nat8), + Bool: IDL.Bool, + Null: IDL.Null, Text: IDL.Text, Array: IDL.Vec(SelfDescribingValue) }) diff --git a/packages/functions/src/canisters/declarations/nns/governance_test.did.d.ts b/packages/functions/src/canisters/declarations/nns/governance_test.did.d.ts index 71f9647c6..d3bf6111f 100644 --- a/packages/functions/src/canisters/declarations/nns/governance_test.did.d.ts +++ b/packages/functions/src/canisters/declarations/nns/governance_test.did.d.ts @@ -18,9 +18,12 @@ export interface AccountIdentifier { 'hash' : Uint8Array } export type Action = { 'RegisterKnownNeuron' : KnownNeuron } | { 'FulfillSubnetRentalRequest' : FulfillSubnetRentalRequest } | { 'ManageNeuron' : ManageNeuronProposal } | + { 'LoadCanisterSnapshot' : LoadCanisterSnapshot } | + { 'BlessAlternativeGuestOsVersion' : BlessAlternativeGuestOsVersion } | { 'UpdateCanisterSettings' : UpdateCanisterSettings } | { 'InstallCode' : InstallCode } | { 'DeregisterKnownNeuron' : DeregisterKnownNeuron } | + { 'TakeCanisterSnapshot' : TakeCanisterSnapshot } | { 'StopOrStartCanister' : StopOrStartCanister } | { 'CreateServiceNervousSystem' : CreateServiceNervousSystem } | { 'ExecuteNnsFunction' : ExecuteNnsFunction } | @@ -42,6 +45,29 @@ export interface BallotInfo { 'vote' : number, 'proposal_id' : [] | [ProposalId], } +/** + * Declares an approved set of alternative replica virtual machine software for + * disaster recovery purposes. + */ +export interface BlessAlternativeGuestOsVersion { + /** + * Hexadecimal fingerprint of the recovery rootfs. + * Must contain only hexadecimal characters (0-9, A-F, a-f). + */ + 'rootfs_hash' : [] | [string], + /** + * AMD Secure Processor chip IDs that are allowed to run this software. + * Each chip ID must be exactly 64 bytes. + */ + 'chip_ids' : [] | [Array], + /** + * The version being replaced by this (alternative version) must match this + * field (or one of the possibilities therein). + * + * (Here, we refer to the version being replaced as the "base" version.) + */ + 'base_guest_launch_measurements' : [] | [GuestLaunchMeasurements], +} export type By = { 'NeuronIdOrSubaccount' : {} } | { 'MemoAndController' : ClaimOrRefreshNeuronFromAccount } | { 'Memo' : bigint }; @@ -122,6 +148,42 @@ export interface Committed_1 { export interface Configure { 'operation' : [] | [Operation] } export interface Controllers { 'controllers' : Array } export interface Countries { 'iso_codes' : Array } +/** + * Request to create a new neuron using ICRC-2 transfer_from. + * The caller must have previously approved the governance canister to spend the specified amount. + */ +export interface CreateNeuronRequest { + /** + * The controller of the new neuron. Defaults to the caller. + */ + 'controller' : [] | [Principal], + /** + * The subaccount of the caller to transfer ICP from. Defaults to the default subaccount. + */ + 'source_subaccount' : [] | [Uint8Array], + /** + * The dissolve delay in seconds. Defaults to 7 days. Clamped to [0, 8 years]. + */ + 'dissolve_delay_seconds' : [] | [bigint], + /** + * Whether to automatically stake maturity. Defaults to false. + */ + 'auto_stake_maturity' : [] | [boolean], + /** + * Required. The amount of ICP to stake in e8s. + */ + 'amount_e8s' : [] | [bigint], + /** + * The followees to set for the new neuron. Defaults to the network's default followees. + */ + 'followees' : [] | [SetFollowing], + /** + * Whether the neuron should start dissolving immediately. Defaults to false. + */ + 'dissolving' : [] | [boolean], +} +export type CreateNeuronResponse = { 'Ok' : CreatedNeuron } | + { 'Err' : GovernanceError }; export interface CreateServiceNervousSystem { 'url' : [] | [string], 'governance_parameters' : [] | [GovernanceParameters], @@ -134,6 +196,10 @@ export interface CreateServiceNervousSystem { 'swap_parameters' : [] | [SwapParameters], 'initial_token_distribution' : [] | [InitialTokenDistribution], } +export interface CreatedNeuron { 'neuron_id' : [] | [NeuronId] } +export interface CustomProposalCriticality { + 'additional_critical_native_action_ids' : [] | [BigUint64Array], +} export interface DateRangeFilter { 'start_timestamp_seconds' : [] | [bigint], 'end_timestamp_seconds' : [] | [bigint], @@ -319,9 +385,29 @@ export interface GovernanceParameters { 'neuron_minimum_stake' : [] | [Tokens], 'proposal_wait_for_quiet_deadline_increase' : [] | [Duration], 'proposal_initial_voting_period' : [] | [Duration], + 'custom_proposal_criticality' : [] | [CustomProposalCriticality], 'proposal_rejection_fee' : [] | [Tokens], 'voting_reward_parameters' : [] | [VotingRewardParameters], } +export interface GuestLaunchMeasurement { + /** + * Metadata associated with the measurement. + */ + 'metadata' : [] | [GuestLaunchMeasurementMetadata], + /** + * SEV-SNP measurement (48 bytes). + */ + 'measurement' : [] | [Uint8Array], +} +export interface GuestLaunchMeasurementMetadata { + /** + * Kernel command line used for this measurement. + */ + 'kernel_cmdline' : [] | [string], +} +export interface GuestLaunchMeasurements { + 'guest_launch_measurements' : [] | [Array], +} export interface IdealMatchedParticipationFunction { 'serialized_representation' : [] | [string], } @@ -473,6 +559,10 @@ export interface ListProposalInfoRequest { export interface ListProposalInfoResponse { 'proposal_info' : Array, } +export interface LoadCanisterSnapshot { + 'canister_id' : [] | [Principal], + 'snapshot_id' : [] | [Uint8Array], +} export interface MakeProposalRequest { 'url' : string, 'title' : [] | [string], @@ -892,9 +982,12 @@ export interface Proposal { export type ProposalActionRequest = { 'RegisterKnownNeuron' : KnownNeuron } | { 'FulfillSubnetRentalRequest' : FulfillSubnetRentalRequest } | { 'ManageNeuron' : ManageNeuronRequest } | + { 'LoadCanisterSnapshot' : LoadCanisterSnapshot } | + { 'BlessAlternativeGuestOsVersion' : BlessAlternativeGuestOsVersion } | { 'UpdateCanisterSettings' : UpdateCanisterSettings } | { 'InstallCode' : InstallCodeRequest } | { 'DeregisterKnownNeuron' : DeregisterKnownNeuron } | + { 'TakeCanisterSnapshot' : TakeCanisterSnapshot } | { 'StopOrStartCanister' : StopOrStartCanister } | { 'CreateServiceNervousSystem' : CreateServiceNervousSystem } | { 'ExecuteNnsFunction' : ExecuteNnsFunction } | @@ -1021,6 +1114,8 @@ export type SelfDescribingValue = { 'Int' : bigint } | { 'Map' : Array<[string, SelfDescribingValue]> } | { 'Nat' : bigint } | { 'Blob' : Uint8Array } | + { 'Bool' : boolean } | + { 'Null' : null } | { 'Text' : string } | { 'Array' : Array }; export interface SetDefaultFollowees { @@ -1101,6 +1196,10 @@ export interface SwapParticipationLimits { 'min_direct_participation_icp_e8s' : [] | [bigint], 'max_direct_participation_icp_e8s' : [] | [bigint], } +export interface TakeCanisterSnapshot { + 'replace_snapshot' : [] | [Uint8Array], + 'canister_id' : [] | [Principal], +} export interface Tally { 'no' : bigint, 'yes' : bigint, @@ -1206,6 +1305,7 @@ export interface _SERVICE { [ClaimOrRefreshNeuronFromAccount], ClaimOrRefreshNeuronFromAccountResponse >, + 'create_neuron' : ActorMethod<[CreateNeuronRequest], CreateNeuronResponse>, 'get_build_metadata' : ActorMethod<[], string>, 'get_full_neuron' : ActorMethod<[bigint], Result_2>, 'get_full_neuron_by_id_or_subaccount' : ActorMethod< diff --git a/packages/functions/src/canisters/declarations/nns/governance_test.did.idl.js b/packages/functions/src/canisters/declarations/nns/governance_test.did.idl.js index 827a53bc0..ebcb759a6 100644 --- a/packages/functions/src/canisters/declarations/nns/governance_test.did.idl.js +++ b/packages/functions/src/canisters/declarations/nns/governance_test.did.idl.js @@ -403,6 +403,25 @@ export const ManageNeuronProposal = IDL.Record({ command: IDL.Opt(ManageNeuronProposalCommand), neuron_id_or_subaccount: IDL.Opt(NeuronIdOrSubaccount) }); +export const LoadCanisterSnapshot = IDL.Record({ + canister_id: IDL.Opt(IDL.Principal), + snapshot_id: IDL.Opt(IDL.Vec(IDL.Nat8)) +}); +export const GuestLaunchMeasurementMetadata = IDL.Record({ + kernel_cmdline: IDL.Opt(IDL.Text) +}); +export const GuestLaunchMeasurement = IDL.Record({ + metadata: IDL.Opt(GuestLaunchMeasurementMetadata), + measurement: IDL.Opt(IDL.Vec(IDL.Nat8)) +}); +export const GuestLaunchMeasurements = IDL.Record({ + guest_launch_measurements: IDL.Opt(IDL.Vec(GuestLaunchMeasurement)) +}); +export const BlessAlternativeGuestOsVersion = IDL.Record({ + rootfs_hash: IDL.Opt(IDL.Text), + chip_ids: IDL.Opt(IDL.Vec(IDL.Vec(IDL.Nat8))), + base_guest_launch_measurements: IDL.Opt(GuestLaunchMeasurements) +}); export const Controllers = IDL.Record({ controllers: IDL.Vec(IDL.Principal) }); @@ -427,12 +446,19 @@ export const InstallCode = IDL.Record({ install_mode: IDL.Opt(IDL.Int32) }); export const DeregisterKnownNeuron = IDL.Record({id: IDL.Opt(NeuronId)}); +export const TakeCanisterSnapshot = IDL.Record({ + replace_snapshot: IDL.Opt(IDL.Vec(IDL.Nat8)), + canister_id: IDL.Opt(IDL.Principal) +}); export const StopOrStartCanister = IDL.Record({ action: IDL.Opt(IDL.Int32), canister_id: IDL.Opt(IDL.Principal) }); export const Duration = IDL.Record({seconds: IDL.Opt(IDL.Nat64)}); export const Tokens = IDL.Record({e8s: IDL.Opt(IDL.Nat64)}); +export const CustomProposalCriticality = IDL.Record({ + additional_critical_native_action_ids: IDL.Opt(IDL.Vec(IDL.Nat64)) +}); export const VotingRewardParameters = IDL.Record({ reward_rate_transition_duration: IDL.Opt(Duration), initial_reward_rate: IDL.Opt(Percentage), @@ -447,6 +473,7 @@ export const GovernanceParameters = IDL.Record({ neuron_minimum_stake: IDL.Opt(Tokens), proposal_wait_for_quiet_deadline_increase: IDL.Opt(Duration), proposal_initial_voting_period: IDL.Opt(Duration), + custom_proposal_criticality: IDL.Opt(CustomProposalCriticality), proposal_rejection_fee: IDL.Opt(Tokens), voting_reward_parameters: IDL.Opt(VotingRewardParameters) }); @@ -567,9 +594,12 @@ export const Action = IDL.Variant({ RegisterKnownNeuron: KnownNeuron, FulfillSubnetRentalRequest: FulfillSubnetRentalRequest, ManageNeuron: ManageNeuronProposal, + LoadCanisterSnapshot: LoadCanisterSnapshot, + BlessAlternativeGuestOsVersion: BlessAlternativeGuestOsVersion, UpdateCanisterSettings: UpdateCanisterSettings, InstallCode: InstallCode, DeregisterKnownNeuron: DeregisterKnownNeuron, + TakeCanisterSnapshot: TakeCanisterSnapshot, StopOrStartCanister: StopOrStartCanister, CreateServiceNervousSystem: CreateServiceNervousSystem, ExecuteNnsFunction: ExecuteNnsFunction, @@ -589,6 +619,8 @@ SelfDescribingValue.fill( Map: IDL.Vec(IDL.Tuple(IDL.Text, SelfDescribingValue)), Nat: IDL.Nat, Blob: IDL.Vec(IDL.Nat8), + Bool: IDL.Bool, + Null: IDL.Null, Text: IDL.Text, Array: IDL.Vec(SelfDescribingValue) }) @@ -718,6 +750,20 @@ export const Result_1 = IDL.Variant({ export const ClaimOrRefreshNeuronFromAccountResponse = IDL.Record({ result: IDL.Opt(Result_1) }); +export const CreateNeuronRequest = IDL.Record({ + controller: IDL.Opt(IDL.Principal), + source_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)), + dissolve_delay_seconds: IDL.Opt(IDL.Nat64), + auto_stake_maturity: IDL.Opt(IDL.Bool), + amount_e8s: IDL.Opt(IDL.Nat64), + followees: IDL.Opt(SetFollowing), + dissolving: IDL.Opt(IDL.Bool) +}); +export const CreatedNeuron = IDL.Record({neuron_id: IDL.Opt(NeuronId)}); +export const CreateNeuronResponse = IDL.Variant({ + Ok: CreatedNeuron, + Err: GovernanceError +}); export const Result_2 = IDL.Variant({Ok: Neuron, Err: GovernanceError}); export const Result_3 = IDL.Variant({ Ok: GovernanceCachedMetrics, @@ -878,9 +924,12 @@ export const ProposalActionRequest = IDL.Variant({ RegisterKnownNeuron: KnownNeuron, FulfillSubnetRentalRequest: FulfillSubnetRentalRequest, ManageNeuron: ManageNeuronRequest, + LoadCanisterSnapshot: LoadCanisterSnapshot, + BlessAlternativeGuestOsVersion: BlessAlternativeGuestOsVersion, UpdateCanisterSettings: UpdateCanisterSettings, InstallCode: InstallCodeRequest, DeregisterKnownNeuron: DeregisterKnownNeuron, + TakeCanisterSnapshot: TakeCanisterSnapshot, StopOrStartCanister: StopOrStartCanister, CreateServiceNervousSystem: CreateServiceNervousSystem, ExecuteNnsFunction: ExecuteNnsFunction, @@ -1025,6 +1074,7 @@ export const idlService = IDL.Service({ [ClaimOrRefreshNeuronFromAccountResponse], [] ), + create_neuron: IDL.Func([CreateNeuronRequest], [CreateNeuronResponse], []), get_build_metadata: IDL.Func([], [IDL.Text], ['query']), get_full_neuron: IDL.Func([IDL.Nat64], [Result_2], ['query']), get_full_neuron_by_id_or_subaccount: IDL.Func([NeuronIdOrSubaccount], [Result_2], ['query']), @@ -1470,6 +1520,25 @@ export const idlFactory = ({IDL}) => { command: IDL.Opt(ManageNeuronProposalCommand), neuron_id_or_subaccount: IDL.Opt(NeuronIdOrSubaccount) }); + const LoadCanisterSnapshot = IDL.Record({ + canister_id: IDL.Opt(IDL.Principal), + snapshot_id: IDL.Opt(IDL.Vec(IDL.Nat8)) + }); + const GuestLaunchMeasurementMetadata = IDL.Record({ + kernel_cmdline: IDL.Opt(IDL.Text) + }); + const GuestLaunchMeasurement = IDL.Record({ + metadata: IDL.Opt(GuestLaunchMeasurementMetadata), + measurement: IDL.Opt(IDL.Vec(IDL.Nat8)) + }); + const GuestLaunchMeasurements = IDL.Record({ + guest_launch_measurements: IDL.Opt(IDL.Vec(GuestLaunchMeasurement)) + }); + const BlessAlternativeGuestOsVersion = IDL.Record({ + rootfs_hash: IDL.Opt(IDL.Text), + chip_ids: IDL.Opt(IDL.Vec(IDL.Vec(IDL.Nat8))), + base_guest_launch_measurements: IDL.Opt(GuestLaunchMeasurements) + }); const Controllers = IDL.Record({controllers: IDL.Vec(IDL.Principal)}); const CanisterSettings = IDL.Record({ freezing_threshold: IDL.Opt(IDL.Nat64), @@ -1492,12 +1561,19 @@ export const idlFactory = ({IDL}) => { install_mode: IDL.Opt(IDL.Int32) }); const DeregisterKnownNeuron = IDL.Record({id: IDL.Opt(NeuronId)}); + const TakeCanisterSnapshot = IDL.Record({ + replace_snapshot: IDL.Opt(IDL.Vec(IDL.Nat8)), + canister_id: IDL.Opt(IDL.Principal) + }); const StopOrStartCanister = IDL.Record({ action: IDL.Opt(IDL.Int32), canister_id: IDL.Opt(IDL.Principal) }); const Duration = IDL.Record({seconds: IDL.Opt(IDL.Nat64)}); const Tokens = IDL.Record({e8s: IDL.Opt(IDL.Nat64)}); + const CustomProposalCriticality = IDL.Record({ + additional_critical_native_action_ids: IDL.Opt(IDL.Vec(IDL.Nat64)) + }); const VotingRewardParameters = IDL.Record({ reward_rate_transition_duration: IDL.Opt(Duration), initial_reward_rate: IDL.Opt(Percentage), @@ -1512,6 +1588,7 @@ export const idlFactory = ({IDL}) => { neuron_minimum_stake: IDL.Opt(Tokens), proposal_wait_for_quiet_deadline_increase: IDL.Opt(Duration), proposal_initial_voting_period: IDL.Opt(Duration), + custom_proposal_criticality: IDL.Opt(CustomProposalCriticality), proposal_rejection_fee: IDL.Opt(Tokens), voting_reward_parameters: IDL.Opt(VotingRewardParameters) }); @@ -1630,9 +1707,12 @@ export const idlFactory = ({IDL}) => { RegisterKnownNeuron: KnownNeuron, FulfillSubnetRentalRequest: FulfillSubnetRentalRequest, ManageNeuron: ManageNeuronProposal, + LoadCanisterSnapshot: LoadCanisterSnapshot, + BlessAlternativeGuestOsVersion: BlessAlternativeGuestOsVersion, UpdateCanisterSettings: UpdateCanisterSettings, InstallCode: InstallCode, DeregisterKnownNeuron: DeregisterKnownNeuron, + TakeCanisterSnapshot: TakeCanisterSnapshot, StopOrStartCanister: StopOrStartCanister, CreateServiceNervousSystem: CreateServiceNervousSystem, ExecuteNnsFunction: ExecuteNnsFunction, @@ -1652,6 +1732,8 @@ export const idlFactory = ({IDL}) => { Map: IDL.Vec(IDL.Tuple(IDL.Text, SelfDescribingValue)), Nat: IDL.Nat, Blob: IDL.Vec(IDL.Nat8), + Bool: IDL.Bool, + Null: IDL.Null, Text: IDL.Text, Array: IDL.Vec(SelfDescribingValue) }) @@ -1781,6 +1863,20 @@ export const idlFactory = ({IDL}) => { const ClaimOrRefreshNeuronFromAccountResponse = IDL.Record({ result: IDL.Opt(Result_1) }); + const CreateNeuronRequest = IDL.Record({ + controller: IDL.Opt(IDL.Principal), + source_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)), + dissolve_delay_seconds: IDL.Opt(IDL.Nat64), + auto_stake_maturity: IDL.Opt(IDL.Bool), + amount_e8s: IDL.Opt(IDL.Nat64), + followees: IDL.Opt(SetFollowing), + dissolving: IDL.Opt(IDL.Bool) + }); + const CreatedNeuron = IDL.Record({neuron_id: IDL.Opt(NeuronId)}); + const CreateNeuronResponse = IDL.Variant({ + Ok: CreatedNeuron, + Err: GovernanceError + }); const Result_2 = IDL.Variant({Ok: Neuron, Err: GovernanceError}); const Result_3 = IDL.Variant({ Ok: GovernanceCachedMetrics, @@ -1936,9 +2032,12 @@ export const idlFactory = ({IDL}) => { RegisterKnownNeuron: KnownNeuron, FulfillSubnetRentalRequest: FulfillSubnetRentalRequest, ManageNeuron: ManageNeuronRequest, + LoadCanisterSnapshot: LoadCanisterSnapshot, + BlessAlternativeGuestOsVersion: BlessAlternativeGuestOsVersion, UpdateCanisterSettings: UpdateCanisterSettings, InstallCode: InstallCodeRequest, DeregisterKnownNeuron: DeregisterKnownNeuron, + TakeCanisterSnapshot: TakeCanisterSnapshot, StopOrStartCanister: StopOrStartCanister, CreateServiceNervousSystem: CreateServiceNervousSystem, ExecuteNnsFunction: ExecuteNnsFunction, @@ -2077,6 +2176,7 @@ export const idlFactory = ({IDL}) => { [ClaimOrRefreshNeuronFromAccountResponse], [] ), + create_neuron: IDL.Func([CreateNeuronRequest], [CreateNeuronResponse], []), get_build_metadata: IDL.Func([], [IDL.Text], ['query']), get_full_neuron: IDL.Func([IDL.Nat64], [Result_2], ['query']), get_full_neuron_by_id_or_subaccount: IDL.Func([NeuronIdOrSubaccount], [Result_2], ['query']), @@ -2520,6 +2620,25 @@ export const init = ({IDL}) => { command: IDL.Opt(ManageNeuronProposalCommand), neuron_id_or_subaccount: IDL.Opt(NeuronIdOrSubaccount) }); + const LoadCanisterSnapshot = IDL.Record({ + canister_id: IDL.Opt(IDL.Principal), + snapshot_id: IDL.Opt(IDL.Vec(IDL.Nat8)) + }); + const GuestLaunchMeasurementMetadata = IDL.Record({ + kernel_cmdline: IDL.Opt(IDL.Text) + }); + const GuestLaunchMeasurement = IDL.Record({ + metadata: IDL.Opt(GuestLaunchMeasurementMetadata), + measurement: IDL.Opt(IDL.Vec(IDL.Nat8)) + }); + const GuestLaunchMeasurements = IDL.Record({ + guest_launch_measurements: IDL.Opt(IDL.Vec(GuestLaunchMeasurement)) + }); + const BlessAlternativeGuestOsVersion = IDL.Record({ + rootfs_hash: IDL.Opt(IDL.Text), + chip_ids: IDL.Opt(IDL.Vec(IDL.Vec(IDL.Nat8))), + base_guest_launch_measurements: IDL.Opt(GuestLaunchMeasurements) + }); const Controllers = IDL.Record({controllers: IDL.Vec(IDL.Principal)}); const CanisterSettings = IDL.Record({ freezing_threshold: IDL.Opt(IDL.Nat64), @@ -2542,12 +2661,19 @@ export const init = ({IDL}) => { install_mode: IDL.Opt(IDL.Int32) }); const DeregisterKnownNeuron = IDL.Record({id: IDL.Opt(NeuronId)}); + const TakeCanisterSnapshot = IDL.Record({ + replace_snapshot: IDL.Opt(IDL.Vec(IDL.Nat8)), + canister_id: IDL.Opt(IDL.Principal) + }); const StopOrStartCanister = IDL.Record({ action: IDL.Opt(IDL.Int32), canister_id: IDL.Opt(IDL.Principal) }); const Duration = IDL.Record({seconds: IDL.Opt(IDL.Nat64)}); const Tokens = IDL.Record({e8s: IDL.Opt(IDL.Nat64)}); + const CustomProposalCriticality = IDL.Record({ + additional_critical_native_action_ids: IDL.Opt(IDL.Vec(IDL.Nat64)) + }); const VotingRewardParameters = IDL.Record({ reward_rate_transition_duration: IDL.Opt(Duration), initial_reward_rate: IDL.Opt(Percentage), @@ -2562,6 +2688,7 @@ export const init = ({IDL}) => { neuron_minimum_stake: IDL.Opt(Tokens), proposal_wait_for_quiet_deadline_increase: IDL.Opt(Duration), proposal_initial_voting_period: IDL.Opt(Duration), + custom_proposal_criticality: IDL.Opt(CustomProposalCriticality), proposal_rejection_fee: IDL.Opt(Tokens), voting_reward_parameters: IDL.Opt(VotingRewardParameters) }); @@ -2680,9 +2807,12 @@ export const init = ({IDL}) => { RegisterKnownNeuron: KnownNeuron, FulfillSubnetRentalRequest: FulfillSubnetRentalRequest, ManageNeuron: ManageNeuronProposal, + LoadCanisterSnapshot: LoadCanisterSnapshot, + BlessAlternativeGuestOsVersion: BlessAlternativeGuestOsVersion, UpdateCanisterSettings: UpdateCanisterSettings, InstallCode: InstallCode, DeregisterKnownNeuron: DeregisterKnownNeuron, + TakeCanisterSnapshot: TakeCanisterSnapshot, StopOrStartCanister: StopOrStartCanister, CreateServiceNervousSystem: CreateServiceNervousSystem, ExecuteNnsFunction: ExecuteNnsFunction, @@ -2702,6 +2832,8 @@ export const init = ({IDL}) => { Map: IDL.Vec(IDL.Tuple(IDL.Text, SelfDescribingValue)), Nat: IDL.Nat, Blob: IDL.Vec(IDL.Nat8), + Bool: IDL.Bool, + Null: IDL.Null, Text: IDL.Text, Array: IDL.Vec(SelfDescribingValue) }) diff --git a/packages/functions/src/canisters/declarations/nns/sns_wasm.did.d.ts b/packages/functions/src/canisters/declarations/nns/sns_wasm.did.d.ts index 2a7bb063c..c2dbcdc1d 100644 --- a/packages/functions/src/canisters/declarations/nns/sns_wasm.did.d.ts +++ b/packages/functions/src/canisters/declarations/nns/sns_wasm.did.d.ts @@ -18,6 +18,9 @@ export interface AddWasmRequest { export interface AddWasmResponse { 'result' : [] | [Result] } export interface Canister { 'id' : [] | [Principal] } export interface Countries { 'iso_codes' : Array } +export interface CustomProposalCriticality { + 'additional_critical_native_action_ids' : BigUint64Array, +} export interface DappCanisters { 'canisters' : Array } export interface DappCanistersTransferResult { 'restored_dapp_canisters' : Array, @@ -179,6 +182,7 @@ export interface SnsInitPayload { 'wait_for_quiet_deadline_increase_seconds' : [] | [bigint], 'transaction_fee_e8s' : [] | [bigint], 'dapp_canisters' : [] | [DappCanisters], + 'custom_proposal_criticality' : [] | [CustomProposalCriticality], 'neurons_fund_participation_constraints' : [] | [ NeuronsFundParticipationConstraints ], diff --git a/packages/functions/src/canisters/declarations/nns/sns_wasm.did.idl.js b/packages/functions/src/canisters/declarations/nns/sns_wasm.did.idl.js index 1a3909190..5deeba8da 100644 --- a/packages/functions/src/canisters/declarations/nns/sns_wasm.did.idl.js +++ b/packages/functions/src/canisters/declarations/nns/sns_wasm.did.idl.js @@ -35,6 +35,9 @@ export const NeuronBasketConstructionParameters = IDL.Record({ }); export const Canister = IDL.Record({id: IDL.Opt(IDL.Principal)}); export const DappCanisters = IDL.Record({canisters: IDL.Vec(Canister)}); +export const CustomProposalCriticality = IDL.Record({ + additional_critical_native_action_ids: IDL.Vec(IDL.Nat64) +}); export const LinearScalingCoefficient = IDL.Record({ slope_numerator: IDL.Opt(IDL.Nat64), intercept_icp_e8s: IDL.Opt(IDL.Nat64), @@ -102,6 +105,7 @@ export const SnsInitPayload = IDL.Record({ wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64), transaction_fee_e8s: IDL.Opt(IDL.Nat64), dapp_canisters: IDL.Opt(DappCanisters), + custom_proposal_criticality: IDL.Opt(CustomProposalCriticality), neurons_fund_participation_constraints: IDL.Opt(NeuronsFundParticipationConstraints), max_age_bonus_percentage: IDL.Opt(IDL.Nat64), initial_token_distribution: IDL.Opt(InitialTokenDistribution), @@ -320,6 +324,9 @@ export const idlFactory = ({IDL}) => { }); const Canister = IDL.Record({id: IDL.Opt(IDL.Principal)}); const DappCanisters = IDL.Record({canisters: IDL.Vec(Canister)}); + const CustomProposalCriticality = IDL.Record({ + additional_critical_native_action_ids: IDL.Vec(IDL.Nat64) + }); const LinearScalingCoefficient = IDL.Record({ slope_numerator: IDL.Opt(IDL.Nat64), intercept_icp_e8s: IDL.Opt(IDL.Nat64), @@ -387,6 +394,7 @@ export const idlFactory = ({IDL}) => { wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64), transaction_fee_e8s: IDL.Opt(IDL.Nat64), dapp_canisters: IDL.Opt(DappCanisters), + custom_proposal_criticality: IDL.Opt(CustomProposalCriticality), neurons_fund_participation_constraints: IDL.Opt(NeuronsFundParticipationConstraints), max_age_bonus_percentage: IDL.Opt(IDL.Nat64), initial_token_distribution: IDL.Opt(InitialTokenDistribution), diff --git a/packages/functions/src/canisters/declarations/sns/governance.did.d.ts b/packages/functions/src/canisters/declarations/sns/governance.did.d.ts index 4c092a0a5..f11eebc78 100644 --- a/packages/functions/src/canisters/declarations/sns/governance.did.d.ts +++ b/packages/functions/src/canisters/declarations/sns/governance.did.d.ts @@ -140,6 +140,9 @@ export type Command_2 = { 'Split' : Split } | { 'MergeMaturity' : MergeMaturity } | { 'Disburse' : Disburse }; export interface Configure { 'operation' : [] | [Operation] } +export interface CustomProposalCriticality { + 'additional_critical_native_action_ids' : BigUint64Array, +} export interface Decimal { 'human_readable' : [] | [string] } export interface DefaultFollowees { 'followees' : Array<[bigint, Followees]> } export interface DefiniteCanisterSettingsArgs { @@ -438,6 +441,7 @@ export interface NervousSystemParameters { 'wait_for_quiet_deadline_increase_seconds' : [] | [bigint], 'max_number_of_neurons' : [] | [bigint], 'transaction_fee_e8s' : [] | [bigint], + 'custom_proposal_criticality' : [] | [CustomProposalCriticality], 'max_number_of_proposals_with_ballots' : [] | [bigint], 'max_age_bonus_percentage' : [] | [bigint], 'neuron_grantable_permissions' : [] | [NeuronPermissionList], diff --git a/packages/functions/src/canisters/declarations/sns/governance.did.idl.js b/packages/functions/src/canisters/declarations/sns/governance.did.idl.js index 75c93cbe6..53ff0bd96 100644 --- a/packages/functions/src/canisters/declarations/sns/governance.did.idl.js +++ b/packages/functions/src/canisters/declarations/sns/governance.did.idl.js @@ -158,6 +158,9 @@ export const DefaultFollowees = IDL.Record({ export const NeuronPermissionList = IDL.Record({ permissions: IDL.Vec(IDL.Int32) }); +export const CustomProposalCriticality = IDL.Record({ + additional_critical_native_action_ids: IDL.Vec(IDL.Nat64) +}); export const VotingRewardsParameters = IDL.Record({ final_reward_rate_basis_points: IDL.Opt(IDL.Nat64), initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64), @@ -180,6 +183,7 @@ export const NervousSystemParameters = IDL.Record({ wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64), max_number_of_neurons: IDL.Opt(IDL.Nat64), transaction_fee_e8s: IDL.Opt(IDL.Nat64), + custom_proposal_criticality: IDL.Opt(CustomProposalCriticality), max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64), max_age_bonus_percentage: IDL.Opt(IDL.Nat64), neuron_grantable_permissions: IDL.Opt(NeuronPermissionList), @@ -1004,6 +1008,9 @@ export const idlFactory = ({IDL}) => { const NeuronPermissionList = IDL.Record({ permissions: IDL.Vec(IDL.Int32) }); + const CustomProposalCriticality = IDL.Record({ + additional_critical_native_action_ids: IDL.Vec(IDL.Nat64) + }); const VotingRewardsParameters = IDL.Record({ final_reward_rate_basis_points: IDL.Opt(IDL.Nat64), initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64), @@ -1026,6 +1033,7 @@ export const idlFactory = ({IDL}) => { wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64), max_number_of_neurons: IDL.Opt(IDL.Nat64), transaction_fee_e8s: IDL.Opt(IDL.Nat64), + custom_proposal_criticality: IDL.Opt(CustomProposalCriticality), max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64), max_age_bonus_percentage: IDL.Opt(IDL.Nat64), neuron_grantable_permissions: IDL.Opt(NeuronPermissionList), @@ -1837,6 +1845,9 @@ export const init = ({IDL}) => { const NeuronPermissionList = IDL.Record({ permissions: IDL.Vec(IDL.Int32) }); + const CustomProposalCriticality = IDL.Record({ + additional_critical_native_action_ids: IDL.Vec(IDL.Nat64) + }); const VotingRewardsParameters = IDL.Record({ final_reward_rate_basis_points: IDL.Opt(IDL.Nat64), initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64), @@ -1859,6 +1870,7 @@ export const init = ({IDL}) => { wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64), max_number_of_neurons: IDL.Opt(IDL.Nat64), transaction_fee_e8s: IDL.Opt(IDL.Nat64), + custom_proposal_criticality: IDL.Opt(CustomProposalCriticality), max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64), max_age_bonus_percentage: IDL.Opt(IDL.Nat64), neuron_grantable_permissions: IDL.Opt(NeuronPermissionList), diff --git a/packages/functions/src/canisters/declarations/sns/governance_test.did.d.ts b/packages/functions/src/canisters/declarations/sns/governance_test.did.d.ts index bf8818fb8..6dd3d750e 100644 --- a/packages/functions/src/canisters/declarations/sns/governance_test.did.d.ts +++ b/packages/functions/src/canisters/declarations/sns/governance_test.did.d.ts @@ -152,6 +152,9 @@ export type Command_2 = { 'Split' : Split } | { 'MergeMaturity' : MergeMaturity } | { 'Disburse' : Disburse }; export interface Configure { 'operation' : [] | [Operation] } +export interface CustomProposalCriticality { + 'additional_critical_native_action_ids' : BigUint64Array, +} export interface Decimal { 'human_readable' : [] | [string] } export interface DefaultFollowees { 'followees' : Array<[bigint, Followees]> } export interface DefiniteCanisterSettingsArgs { @@ -454,6 +457,7 @@ export interface NervousSystemParameters { 'wait_for_quiet_deadline_increase_seconds' : [] | [bigint], 'max_number_of_neurons' : [] | [bigint], 'transaction_fee_e8s' : [] | [bigint], + 'custom_proposal_criticality' : [] | [CustomProposalCriticality], 'max_number_of_proposals_with_ballots' : [] | [bigint], 'max_age_bonus_percentage' : [] | [bigint], 'neuron_grantable_permissions' : [] | [NeuronPermissionList], diff --git a/packages/functions/src/canisters/declarations/sns/governance_test.did.idl.js b/packages/functions/src/canisters/declarations/sns/governance_test.did.idl.js index 47e65c678..c0db9ef00 100644 --- a/packages/functions/src/canisters/declarations/sns/governance_test.did.idl.js +++ b/packages/functions/src/canisters/declarations/sns/governance_test.did.idl.js @@ -158,6 +158,9 @@ export const DefaultFollowees = IDL.Record({ export const NeuronPermissionList = IDL.Record({ permissions: IDL.Vec(IDL.Int32) }); +export const CustomProposalCriticality = IDL.Record({ + additional_critical_native_action_ids: IDL.Vec(IDL.Nat64) +}); export const VotingRewardsParameters = IDL.Record({ final_reward_rate_basis_points: IDL.Opt(IDL.Nat64), initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64), @@ -180,6 +183,7 @@ export const NervousSystemParameters = IDL.Record({ wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64), max_number_of_neurons: IDL.Opt(IDL.Nat64), transaction_fee_e8s: IDL.Opt(IDL.Nat64), + custom_proposal_criticality: IDL.Opt(CustomProposalCriticality), max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64), max_age_bonus_percentage: IDL.Opt(IDL.Nat64), neuron_grantable_permissions: IDL.Opt(NeuronPermissionList), @@ -1028,6 +1032,9 @@ export const idlFactory = ({IDL}) => { const NeuronPermissionList = IDL.Record({ permissions: IDL.Vec(IDL.Int32) }); + const CustomProposalCriticality = IDL.Record({ + additional_critical_native_action_ids: IDL.Vec(IDL.Nat64) + }); const VotingRewardsParameters = IDL.Record({ final_reward_rate_basis_points: IDL.Opt(IDL.Nat64), initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64), @@ -1050,6 +1057,7 @@ export const idlFactory = ({IDL}) => { wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64), max_number_of_neurons: IDL.Opt(IDL.Nat64), transaction_fee_e8s: IDL.Opt(IDL.Nat64), + custom_proposal_criticality: IDL.Opt(CustomProposalCriticality), max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64), max_age_bonus_percentage: IDL.Opt(IDL.Nat64), neuron_grantable_permissions: IDL.Opt(NeuronPermissionList), @@ -1885,6 +1893,9 @@ export const init = ({IDL}) => { const NeuronPermissionList = IDL.Record({ permissions: IDL.Vec(IDL.Int32) }); + const CustomProposalCriticality = IDL.Record({ + additional_critical_native_action_ids: IDL.Vec(IDL.Nat64) + }); const VotingRewardsParameters = IDL.Record({ final_reward_rate_basis_points: IDL.Opt(IDL.Nat64), initial_reward_rate_basis_points: IDL.Opt(IDL.Nat64), @@ -1907,6 +1918,7 @@ export const init = ({IDL}) => { wait_for_quiet_deadline_increase_seconds: IDL.Opt(IDL.Nat64), max_number_of_neurons: IDL.Opt(IDL.Nat64), transaction_fee_e8s: IDL.Opt(IDL.Nat64), + custom_proposal_criticality: IDL.Opt(CustomProposalCriticality), max_number_of_proposals_with_ballots: IDL.Opt(IDL.Nat64), max_age_bonus_percentage: IDL.Opt(IDL.Nat64), neuron_grantable_permissions: IDL.Opt(NeuronPermissionList),