Skip to content

Commit

Permalink
Update Candid Files (#702)
Browse files Browse the repository at this point in the history
# Motivation
The canisters APIs have been updated.

# Changes
* Updated the candid interface files for the canisters used in this
library.
* Updated the javascript bindings for the latest candid interfaces.

# Tests
- [ ] Please check the API updates for any breaking changes that affect
our code.

Co-authored-by: gix-bot <[email protected]>
  • Loading branch information
sa-github-api and gix-bot authored Aug 26, 2024
1 parent 497ff4d commit e0c7606
Show file tree
Hide file tree
Showing 42 changed files with 289 additions and 204 deletions.
2 changes: 1 addition & 1 deletion packages/ckbtc/candid/minter.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 3d0b3f1 (2024-08-02 tags: release-2024-08-02_01-30-base) 'rs/bitcoin/ckbtc/minter/ckbtc_minter.did' by import-candid
// Generated from IC repo commit 3d6a76e (2024-08-14 tags: release-2024-08-21_15-36-canister-snapshots) 'rs/bitcoin/ckbtc/minter/ckbtc_minter.did' by import-candid
// Represents an account on the ckBTC ledger.
type Account = record { owner : principal; subaccount : opt blob };

Expand Down
2 changes: 1 addition & 1 deletion packages/cketh/candid/minter.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 3d0b3f1 (2024-08-02 tags: release-2024-08-02_01-30-base) 'rs/ethereum/cketh/minter/cketh_minter.did' by import-candid
// Generated from IC repo commit 3d6a76e (2024-08-14 tags: release-2024-08-21_15-36-canister-snapshots) 'rs/ethereum/cketh/minter/cketh_minter.did' by import-candid
type EthereumNetwork = variant {
// The public Ethereum mainnet.
Mainnet;
Expand Down
2 changes: 1 addition & 1 deletion packages/cketh/candid/orchestrator.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 3d0b3f1 (2024-08-02 tags: release-2024-08-02_01-30-base) 'rs/ethereum/ledger-suite-orchestrator/ledger_suite_orchestrator.did' by import-candid
// Generated from IC repo commit 3d6a76e (2024-08-14 tags: release-2024-08-21_15-36-canister-snapshots) 'rs/ethereum/ledger-suite-orchestrator/ledger_suite_orchestrator.did' by import-candid
type OrchestratorArg = variant {
UpgradeArg : UpgradeArg;
InitArg : InitArg;
Expand Down
2 changes: 1 addition & 1 deletion packages/cmc/candid/cmc.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 3d0b3f1 (2024-08-02 tags: release-2024-08-02_01-30-base) 'rs/nns/cmc/cmc.did' by import-candid
// Generated from IC repo commit 3d6a76e (2024-08-14 tags: release-2024-08-21_15-36-canister-snapshots) 'rs/nns/cmc/cmc.did' by import-candid
type Cycles = nat;
type BlockIndex = nat64;
type log_visibility = variant {
Expand Down
26 changes: 21 additions & 5 deletions packages/ic-management/candid/ic-management.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ export const idlFactory = ({ IDL }) => {
'min_confirmations' : IDL.Opt(IDL.Nat32),
});
const bitcoin_get_balance_query_result = satoshi;
const bitcoin_block_height = IDL.Nat32;
const bitcoin_get_block_headers_args = IDL.Record({
'start_height' : bitcoin_block_height,
'end_height' : IDL.Opt(bitcoin_block_height),
'network' : bitcoin_network,
});
const bitcoin_block_header = IDL.Vec(IDL.Nat8);
const bitcoin_get_block_headers_result = IDL.Record({
'tip_height' : bitcoin_block_height,
'block_headers' : IDL.Vec(bitcoin_block_header),
});
const bitcoin_get_current_fee_percentiles_args = IDL.Record({
'network' : bitcoin_network,
});
Expand All @@ -35,7 +46,7 @@ export const idlFactory = ({ IDL }) => {
),
'address' : bitcoin_address,
});
const block_hash = IDL.Vec(IDL.Nat8);
const bitcoin_block_hash = IDL.Vec(IDL.Nat8);
const outpoint = IDL.Record({
'txid' : IDL.Vec(IDL.Nat8),
'vout' : IDL.Nat32,
Expand All @@ -47,8 +58,8 @@ export const idlFactory = ({ IDL }) => {
});
const bitcoin_get_utxos_result = IDL.Record({
'next_page' : IDL.Opt(IDL.Vec(IDL.Nat8)),
'tip_height' : IDL.Nat32,
'tip_block_hash' : block_hash,
'tip_height' : bitcoin_block_height,
'tip_block_hash' : bitcoin_block_hash,
'utxos' : IDL.Vec(utxo),
});
const bitcoin_get_utxos_query_args = IDL.Record({
Expand All @@ -63,8 +74,8 @@ export const idlFactory = ({ IDL }) => {
});
const bitcoin_get_utxos_query_result = IDL.Record({
'next_page' : IDL.Opt(IDL.Vec(IDL.Nat8)),
'tip_height' : IDL.Nat32,
'tip_block_hash' : block_hash,
'tip_height' : bitcoin_block_height,
'tip_block_hash' : bitcoin_block_hash,
'utxos' : IDL.Vec(utxo),
});
const bitcoin_send_transaction_args = IDL.Record({
Expand Down Expand Up @@ -334,6 +345,11 @@ export const idlFactory = ({ IDL }) => {
[bitcoin_get_balance_query_result],
[],
),
'bitcoin_get_block_headers' : IDL.Func(
[bitcoin_get_block_headers_args],
[bitcoin_get_block_headers_result],
[],
),
'bitcoin_get_current_fee_percentiles' : IDL.Func(
[bitcoin_get_current_fee_percentiles_args],
[bitcoin_get_current_fee_percentiles_result],
Expand Down
25 changes: 20 additions & 5 deletions packages/ic-management/candid/ic-management.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import type { IDL } from "@dfinity/candid";
import type { Principal } from "@dfinity/principal";

export type bitcoin_address = string;
export type bitcoin_block_hash = Uint8Array | number[];
export type bitcoin_block_header = Uint8Array | number[];
export type bitcoin_block_height = number;
export interface bitcoin_get_balance_args {
network: bitcoin_network;
address: bitcoin_address;
Expand All @@ -15,6 +18,15 @@ export interface bitcoin_get_balance_query_args {
}
export type bitcoin_get_balance_query_result = satoshi;
export type bitcoin_get_balance_result = satoshi;
export interface bitcoin_get_block_headers_args {
start_height: bitcoin_block_height;
end_height: [] | [bitcoin_block_height];
network: bitcoin_network;
}
export interface bitcoin_get_block_headers_result {
tip_height: bitcoin_block_height;
block_headers: Array<bitcoin_block_header>;
}
export interface bitcoin_get_current_fee_percentiles_args {
network: bitcoin_network;
}
Expand All @@ -37,22 +49,21 @@ export interface bitcoin_get_utxos_query_args {
}
export interface bitcoin_get_utxos_query_result {
next_page: [] | [Uint8Array | number[]];
tip_height: number;
tip_block_hash: block_hash;
tip_height: bitcoin_block_height;
tip_block_hash: bitcoin_block_hash;
utxos: Array<utxo>;
}
export interface bitcoin_get_utxos_result {
next_page: [] | [Uint8Array | number[]];
tip_height: number;
tip_block_hash: block_hash;
tip_height: bitcoin_block_height;
tip_block_hash: bitcoin_block_hash;
utxos: Array<utxo>;
}
export type bitcoin_network = { mainnet: null } | { testnet: null };
export interface bitcoin_send_transaction_args {
transaction: Uint8Array | number[];
network: bitcoin_network;
}
export type block_hash = Uint8Array | number[];
export type canister_id = Principal;
export interface canister_info_args {
canister_id: canister_id;
Expand Down Expand Up @@ -315,6 +326,10 @@ export interface _SERVICE {
[bitcoin_get_balance_query_args],
bitcoin_get_balance_query_result
>;
bitcoin_get_block_headers: ActorMethod<
[bitcoin_get_block_headers_args],
bitcoin_get_block_headers_result
>;
bitcoin_get_current_fee_percentiles: ActorMethod<
[bitcoin_get_current_fee_percentiles_args],
bitcoin_get_current_fee_percentiles_result
Expand Down
60 changes: 38 additions & 22 deletions packages/ic-management/candid/ic-management.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from dfinity/interface-spec commit 99bc27cb00159f4413c320d68c76baec4b230644 for file 'spec/_attachments/ic.did'
// Generated from dfinity/interface-spec commit 0a50e0c1eac44dbc0c02116ff110096a17c4c022 for file 'spec/_attachments/ic.did'
type canister_id = principal;
type wasm_module = blob;

Expand Down Expand Up @@ -91,7 +91,13 @@ type bitcoin_network = variant {

type bitcoin_address = text;

type block_hash = blob;
type bitcoin_block_hash = blob;

type bitcoin_block_header = blob;

type millisatoshi_per_byte = nat64;

type bitcoin_block_height = nat32;

type outpoint = record {
txid : blob;
Expand All @@ -113,6 +119,13 @@ type bitcoin_get_utxos_args = record {
};
};

type bitcoin_get_utxos_result = record {
utxos : vec utxo;
tip_block_hash : bitcoin_block_hash;
tip_height : bitcoin_block_height;
next_page : opt blob;
};

type bitcoin_get_utxos_query_args = record {
address : bitcoin_address;
network : bitcoin_network;
Expand All @@ -122,21 +135,10 @@ type bitcoin_get_utxos_query_args = record {
};
};

type bitcoin_get_current_fee_percentiles_args = record {
network : bitcoin_network;
};

type bitcoin_get_utxos_result = record {
utxos : vec utxo;
tip_block_hash : block_hash;
tip_height : nat32;
next_page : opt blob;
};

type bitcoin_get_utxos_query_result = record {
utxos : vec utxo;
tip_block_hash : block_hash;
tip_height : nat32;
tip_block_hash : bitcoin_block_hash;
tip_height : bitcoin_block_height;
next_page : opt blob;
};

Expand All @@ -146,18 +148,37 @@ type bitcoin_get_balance_args = record {
min_confirmations : opt nat32;
};

type bitcoin_get_balance_result = satoshi;

type bitcoin_get_balance_query_args = record {
address : bitcoin_address;
network : bitcoin_network;
min_confirmations : opt nat32;
};

type bitcoin_get_balance_query_result = satoshi;

type bitcoin_get_current_fee_percentiles_args = record {
network : bitcoin_network;
};

type bitcoin_get_current_fee_percentiles_result = vec millisatoshi_per_byte;

type bitcoin_send_transaction_args = record {
transaction : blob;
network : bitcoin_network;
};

type millisatoshi_per_byte = nat64;
type bitcoin_get_block_headers_args = record {
start_height : bitcoin_block_height;
end_height : opt bitcoin_block_height;
network: bitcoin_network;
};

type bitcoin_get_block_headers_result = record {
tip_height : bitcoin_block_height;
block_headers : vec bitcoin_block_header;
};

type node_metrics = record {
node_id : principal;
Expand Down Expand Up @@ -362,12 +383,6 @@ type stored_chunks_result = vec chunk_hash;

type upload_chunk_result = chunk_hash;

type bitcoin_get_balance_result = satoshi;

type bitcoin_get_balance_query_result = satoshi;

type bitcoin_get_current_fee_percentiles_result = vec millisatoshi_per_byte;

type fetch_canister_logs_args = record {
canister_id : canister_id;
};
Expand Down Expand Up @@ -415,6 +430,7 @@ service ic : {
bitcoin_get_utxos_query : (bitcoin_get_utxos_query_args) -> (bitcoin_get_utxos_query_result) query;
bitcoin_send_transaction : (bitcoin_send_transaction_args) -> ();
bitcoin_get_current_fee_percentiles : (bitcoin_get_current_fee_percentiles_args) -> (bitcoin_get_current_fee_percentiles_result);
bitcoin_get_block_headers : (bitcoin_get_block_headers_args) -> (bitcoin_get_block_headers_result);

// metrics interface
node_metrics_history : (node_metrics_history_args) -> (node_metrics_history_result);
Expand Down
26 changes: 21 additions & 5 deletions packages/ic-management/candid/ic-management.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ export const idlFactory = ({ IDL }) => {
'min_confirmations' : IDL.Opt(IDL.Nat32),
});
const bitcoin_get_balance_query_result = satoshi;
const bitcoin_block_height = IDL.Nat32;
const bitcoin_get_block_headers_args = IDL.Record({
'start_height' : bitcoin_block_height,
'end_height' : IDL.Opt(bitcoin_block_height),
'network' : bitcoin_network,
});
const bitcoin_block_header = IDL.Vec(IDL.Nat8);
const bitcoin_get_block_headers_result = IDL.Record({
'tip_height' : bitcoin_block_height,
'block_headers' : IDL.Vec(bitcoin_block_header),
});
const bitcoin_get_current_fee_percentiles_args = IDL.Record({
'network' : bitcoin_network,
});
Expand All @@ -35,7 +46,7 @@ export const idlFactory = ({ IDL }) => {
),
'address' : bitcoin_address,
});
const block_hash = IDL.Vec(IDL.Nat8);
const bitcoin_block_hash = IDL.Vec(IDL.Nat8);
const outpoint = IDL.Record({
'txid' : IDL.Vec(IDL.Nat8),
'vout' : IDL.Nat32,
Expand All @@ -47,8 +58,8 @@ export const idlFactory = ({ IDL }) => {
});
const bitcoin_get_utxos_result = IDL.Record({
'next_page' : IDL.Opt(IDL.Vec(IDL.Nat8)),
'tip_height' : IDL.Nat32,
'tip_block_hash' : block_hash,
'tip_height' : bitcoin_block_height,
'tip_block_hash' : bitcoin_block_hash,
'utxos' : IDL.Vec(utxo),
});
const bitcoin_get_utxos_query_args = IDL.Record({
Expand All @@ -63,8 +74,8 @@ export const idlFactory = ({ IDL }) => {
});
const bitcoin_get_utxos_query_result = IDL.Record({
'next_page' : IDL.Opt(IDL.Vec(IDL.Nat8)),
'tip_height' : IDL.Nat32,
'tip_block_hash' : block_hash,
'tip_height' : bitcoin_block_height,
'tip_block_hash' : bitcoin_block_hash,
'utxos' : IDL.Vec(utxo),
});
const bitcoin_send_transaction_args = IDL.Record({
Expand Down Expand Up @@ -334,6 +345,11 @@ export const idlFactory = ({ IDL }) => {
[bitcoin_get_balance_query_result],
['query'],
),
'bitcoin_get_block_headers' : IDL.Func(
[bitcoin_get_block_headers_args],
[bitcoin_get_block_headers_result],
[],
),
'bitcoin_get_current_fee_percentiles' : IDL.Func(
[bitcoin_get_current_fee_percentiles_args],
[bitcoin_get_current_fee_percentiles_result],
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icp/candid/index.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 3d0b3f1 (2024-08-02 tags: release-2024-08-02_01-30-base) 'rs/rosetta-api/icp_ledger/index/index.did' by import-candid
// Generated from IC repo commit 3d6a76e (2024-08-14 tags: release-2024-08-21_15-36-canister-snapshots) 'rs/rosetta-api/icp_ledger/index/index.did' by import-candid
type Account = record { owner : principal; subaccount : opt vec nat8 };
type GetAccountIdentifierTransactionsArgs = record {
max_results : nat64;
Expand Down
2 changes: 0 additions & 2 deletions packages/ledger-icp/candid/ledger.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export const idlFactory = ({ IDL }) => {
});
const FeatureFlags = IDL.Record({ 'icrc2' : IDL.Bool });
const UpgradeArgs = IDL.Record({
'maximum_number_of_accounts' : IDL.Opt(IDL.Nat64),
'icrc1_minting_account' : IDL.Opt(Account),
'feature_flags' : IDL.Opt(FeatureFlags),
});
Expand Down Expand Up @@ -370,7 +369,6 @@ export const init = ({ IDL }) => {
});
const FeatureFlags = IDL.Record({ 'icrc2' : IDL.Bool });
const UpgradeArgs = IDL.Record({
'maximum_number_of_accounts' : IDL.Opt(IDL.Nat64),
'icrc1_minting_account' : IDL.Opt(Account),
'feature_flags' : IDL.Opt(FeatureFlags),
});
Expand Down
1 change: 0 additions & 1 deletion packages/ledger-icp/candid/ledger.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ export type TransferFromResult =
| { Err: TransferFromError };
export type TransferResult = { Ok: BlockIndex } | { Err: TransferError };
export interface UpgradeArgs {
maximum_number_of_accounts: [] | [bigint];
icrc1_minting_account: [] | [Account];
feature_flags: [] | [FeatureFlags];
}
Expand Down
3 changes: 1 addition & 2 deletions packages/ledger-icp/candid/ledger.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 3d0b3f1 (2024-08-02 tags: release-2024-08-02_01-30-base) 'rs/rosetta-api/icp_ledger/ledger.did' by import-candid
// Generated from IC repo commit 3d6a76e (2024-08-14 tags: release-2024-08-21_15-36-canister-snapshots) 'rs/rosetta-api/icp_ledger/ledger.did' by import-candid
// This is the official Ledger interface that is guaranteed to be backward compatible.

// Amount of tokens, measured in 10^-8 of a token.
Expand Down Expand Up @@ -351,7 +351,6 @@ type Value = variant {
};

type UpgradeArgs = record {
maximum_number_of_accounts : opt nat64;
icrc1_minting_account : opt Account;
feature_flags : opt FeatureFlags;
};
Expand Down
2 changes: 0 additions & 2 deletions packages/ledger-icp/candid/ledger.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export const idlFactory = ({ IDL }) => {
});
const FeatureFlags = IDL.Record({ 'icrc2' : IDL.Bool });
const UpgradeArgs = IDL.Record({
'maximum_number_of_accounts' : IDL.Opt(IDL.Nat64),
'icrc1_minting_account' : IDL.Opt(Account),
'feature_flags' : IDL.Opt(FeatureFlags),
});
Expand Down Expand Up @@ -390,7 +389,6 @@ export const init = ({ IDL }) => {
});
const FeatureFlags = IDL.Record({ 'icrc2' : IDL.Bool });
const UpgradeArgs = IDL.Record({
'maximum_number_of_accounts' : IDL.Opt(IDL.Nat64),
'icrc1_minting_account' : IDL.Opt(Account),
'feature_flags' : IDL.Opt(FeatureFlags),
});
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icrc/candid/icrc_index-ng.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 3d0b3f1 (2024-08-02 tags: release-2024-08-02_01-30-base) 'rs/rosetta-api/icrc1/index-ng/index-ng.did' by import-candid
// Generated from IC repo commit 3d6a76e (2024-08-14 tags: release-2024-08-21_15-36-canister-snapshots) 'rs/rosetta-api/icrc1/index-ng/index-ng.did' by import-candid
type Tokens = nat;

type InitArg = record {
Expand Down
Loading

0 comments on commit e0c7606

Please sign in to comment.