Skip to content

Commit

Permalink
Merge pull request #2425 from demergent-labs/update_canister_bindings
Browse files Browse the repository at this point in the history
Update canister bindings
  • Loading branch information
lastmjs authored Jan 5, 2025
2 parents 902ee5f + 0e6fdf6 commit 8fccab9
Show file tree
Hide file tree
Showing 4 changed files with 201 additions and 5 deletions.
2 changes: 2 additions & 0 deletions canisters/icp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ export interface _SERVICE {
icrc2_allowance: ActorMethod<[AllowanceArgs], Allowance>;
icrc2_approve: ActorMethod<[ApproveArgs], ApproveResult>;
icrc2_transfer_from: ActorMethod<[TransferFromArgs], TransferFromResult>;
is_ledger_ready: ActorMethod<[], boolean>;
name: ActorMethod<[], NameResult>;
query_blocks: ActorMethod<[GetBlocksArgs], QueryBlocksResponse>;
query_encoded_blocks: ActorMethod<
Expand Down Expand Up @@ -1036,6 +1037,7 @@ export const idlFactory: idlFactory = ({ IDL }) => {
[TransferFromResult],
[]
),
is_ledger_ready: IDL.Func([], [IDL.Bool], ['query']),
name: IDL.Func([], [NameResult], ['query']),
query_blocks: IDL.Func(
[GetBlocksArgs],
Expand Down
4 changes: 3 additions & 1 deletion canisters/icp/ledger.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Taken from: https://github.com/dfinity/ic/blob/release-2024-09-12_01-30-canister-snapshots-hotfix-deprecated-assert/rs/rosetta-api/icp_ledger/ledger.did
// Taken from: https://github.com/dfinity/ic/blob/release-2025-01-03_03-07-base/rs/ledger_suite/icp/ledger.did

// This is the official Ledger interface that is guaranteed to be backward compatible.

Expand Down Expand Up @@ -552,4 +552,6 @@ service: (LedgerCanisterPayload) -> {

icrc21_canister_call_consent_message: (icrc21_consent_message_request) -> (icrc21_consent_message_response);
icrc10_supported_standards : () -> (vec record { name : text; url : text }) query;

is_ledger_ready: () -> (bool) query;
}
56 changes: 55 additions & 1 deletion canisters/management/ic.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Taken from: https://github.com/dfinity/interface-spec/blob/c28afe4269b14f102c78b69225b7c380b826cf0f/spec/_attachments/ic.did
// Taken from: https://github.com/dfinity/portal/blob/3279a2825c936f10df37f34c69f8789294e41816/docs/references/_attachments/ic.did

// Copyright 2021 DFINITY Foundation
//
Expand All @@ -16,10 +16,12 @@

type canister_id = principal;
type wasm_module = blob;
type snapshot_id = blob;

type log_visibility = variant {
controllers;
public;
allowed_viewers : vec principal;
};

type canister_settings = record {
Expand Down Expand Up @@ -61,6 +63,11 @@ type change_details = variant {
mode : variant { install; reinstall; upgrade };
module_hash : blob;
};
load_snapshot : record {
canister_version : nat64;
snapshot_id : snapshot_id;
taken_at_timestamp : nat64;
};
controllers_change : record {
controllers : vec principal;
};
Expand Down Expand Up @@ -360,6 +367,14 @@ type node_metrics_history_result = vec record {
node_metrics : vec node_metrics;
};

type subnet_info_args = record {
subnet_id : principal;
};

type subnet_info_result = record {
replica_version : text;
};

type provisional_create_canister_with_cycles_args = record {
amount : opt nat;
settings : opt canister_settings;
Expand All @@ -382,6 +397,36 @@ type stored_chunks_result = vec chunk_hash;

type upload_chunk_result = chunk_hash;

type snapshot = record {
id : snapshot_id;
taken_at_timestamp : nat64;
total_size : nat64;
};

type take_canister_snapshot_args = record {
canister_id : canister_id;
replace_snapshot : opt snapshot_id;
};

type take_canister_snapshot_result = snapshot;

type load_canister_snapshot_args = record {
canister_id : canister_id;
snapshot_id : snapshot_id;
sender_canister_version : opt nat64;
};

type list_canister_snapshots_args = record {
canister_id : canister_id;
};

type list_canister_snapshots_result = vec snapshot;

type delete_canister_snapshot_args = record {
canister_id : canister_id;
snapshot_id : snapshot_id;
};

type fetch_canister_logs_args = record {
canister_id : canister_id;
};
Expand Down Expand Up @@ -432,10 +477,19 @@ service ic : {
// metrics interface
node_metrics_history : (node_metrics_history_args) -> (node_metrics_history_result);

// subnet info
subnet_info : (subnet_info_args) -> (subnet_info_result);

// provisional interfaces for the pre-ledger world
provisional_create_canister_with_cycles : (provisional_create_canister_with_cycles_args) -> (provisional_create_canister_with_cycles_result);
provisional_top_up_canister : (provisional_top_up_canister_args) -> ();

// Canister snapshots
take_canister_snapshot : (take_canister_snapshot_args) -> (take_canister_snapshot_result);
load_canister_snapshot : (load_canister_snapshot_args) -> ();
list_canister_snapshots : (list_canister_snapshots_args) -> (list_canister_snapshots_result);
delete_canister_snapshot : (delete_canister_snapshot_args) -> ();

// canister logging
fetch_canister_logs : (fetch_canister_logs_args) -> (fetch_canister_logs_result) query;
};
Loading

0 comments on commit 8fccab9

Please sign in to comment.