Skip to content

Commit

Permalink
Update Candid Files (#641)
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.

---------

Signed-off-by: David Dal Busco <[email protected]>
Co-authored-by: gix-bot <[email protected]>
Co-authored-by: David Dal Busco <[email protected]>
  • Loading branch information
3 people authored Jun 3, 2024
1 parent 0e762d9 commit 50904a9
Show file tree
Hide file tree
Showing 30 changed files with 220 additions and 25 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 ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/bitcoin/ckbtc/minter/ckbtc_minter.did' by import-candid
// Generated from IC repo commit b9a0f18 (2024-05-29 tags: release-2024-05-29_23-02-base) '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
1 change: 1 addition & 0 deletions packages/cketh/candid/minter.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ export const idlFactory = ({ IDL }) => {
'last_erc20_scraped_block_number' : IDL.Opt(IDL.Nat),
'supported_ckerc20_tokens' : IDL.Opt(IDL.Vec(CkErc20Token)),
'last_gas_fee_estimate' : IDL.Opt(GasFeeEstimate),
'cketh_ledger_id' : IDL.Opt(IDL.Principal),
'smart_contract_address' : IDL.Opt(IDL.Text),
'last_eth_scraped_block_number' : IDL.Opt(IDL.Nat),
'minimum_withdrawal_amount' : IDL.Opt(IDL.Nat),
Expand Down
1 change: 1 addition & 0 deletions packages/cketh/candid/minter.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ export interface MinterInfo {
last_erc20_scraped_block_number: [] | [bigint];
supported_ckerc20_tokens: [] | [Array<CkErc20Token>];
last_gas_fee_estimate: [] | [GasFeeEstimate];
cketh_ledger_id: [] | [Principal];
smart_contract_address: [] | [string];
last_eth_scraped_block_number: [] | [bigint];
minimum_withdrawal_amount: [] | [bigint];
Expand Down
5 changes: 4 additions & 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 ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/ethereum/cketh/minter/cketh_minter.did' by import-candid
// Generated from IC repo commit b9a0f18 (2024-05-29 tags: release-2024-05-29_23-02-base) 'rs/ethereum/cketh/minter/cketh_minter.did' by import-candid
type EthereumNetwork = variant {
// The public Ethereum mainnet.
Mainnet;
Expand Down Expand Up @@ -173,6 +173,9 @@ type MinterInfo = record {

// Last scraped block number for logs of the ERC20 helper contract.
last_erc20_scraped_block_number: opt nat;

// Canister ID of the ckETH ledger.
cketh_ledger_id: opt principal;
};


Expand Down
1 change: 1 addition & 0 deletions packages/cketh/candid/minter.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ export const idlFactory = ({ IDL }) => {
'last_erc20_scraped_block_number' : IDL.Opt(IDL.Nat),
'supported_ckerc20_tokens' : IDL.Opt(IDL.Vec(CkErc20Token)),
'last_gas_fee_estimate' : IDL.Opt(GasFeeEstimate),
'cketh_ledger_id' : IDL.Opt(IDL.Principal),
'smart_contract_address' : IDL.Opt(IDL.Text),
'last_eth_scraped_block_number' : IDL.Opt(IDL.Nat),
'minimum_withdrawal_amount' : IDL.Opt(IDL.Nat),
Expand Down
29 changes: 29 additions & 0 deletions packages/cketh/candid/orchestrator.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,34 @@ export const idlFactory = ({ IDL }) => {
'index' : IDL.Opt(IDL.Principal),
'archives' : IDL.Vec(IDL.Principal),
});
const CanisterStatusType = IDL.Variant({
'stopped' : IDL.Null,
'stopping' : IDL.Null,
'running' : IDL.Null,
});
const DefiniteCanisterSettings = IDL.Record({
'freezing_threshold' : IDL.Nat,
'controllers' : IDL.Vec(IDL.Principal),
'reserved_cycles_limit' : IDL.Nat,
'memory_allocation' : IDL.Nat,
'compute_allocation' : IDL.Nat,
});
const QueryStats = IDL.Record({
'response_payload_bytes_total' : IDL.Nat,
'num_instructions_total' : IDL.Nat,
'num_calls_total' : IDL.Nat,
'request_payload_bytes_total' : IDL.Nat,
});
const CanisterStatusResponse = IDL.Record({
'status' : CanisterStatusType,
'memory_size' : IDL.Nat,
'cycles' : IDL.Nat,
'settings' : DefiniteCanisterSettings,
'query_stats' : QueryStats,
'idle_cycles_burned_per_day' : IDL.Nat,
'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
'reserved_cycles' : IDL.Nat,
});
const ManagedCanisterStatus = IDL.Variant({
'Created' : IDL.Record({ 'canister_id' : IDL.Principal }),
'Installed' : IDL.Record({
Expand All @@ -91,6 +119,7 @@ export const idlFactory = ({ IDL }) => {
[IDL.Opt(ManagedCanisterIds)],
[],
),
'get_canister_status' : IDL.Func([], [CanisterStatusResponse], []),
'get_orchestrator_info' : IDL.Func([], [OrchestratorInfo], []),
});
};
Expand Down
28 changes: 28 additions & 0 deletions packages/cketh/candid/orchestrator.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,33 @@ export interface AddErc20Arg {
ledger_compressed_wasm_hash: string;
index_compressed_wasm_hash: string;
}
export interface CanisterStatusResponse {
status: CanisterStatusType;
memory_size: bigint;
cycles: bigint;
settings: DefiniteCanisterSettings;
query_stats: QueryStats;
idle_cycles_burned_per_day: bigint;
module_hash: [] | [Uint8Array | number[]];
reserved_cycles: bigint;
}
export type CanisterStatusType =
| { stopped: null }
| { stopping: null }
| { running: null };
export interface CyclesManagement {
cycles_top_up_increment: bigint;
cycles_for_ledger_creation: bigint;
cycles_for_archive_creation: bigint;
cycles_for_index_creation: bigint;
}
export interface DefiniteCanisterSettings {
freezing_threshold: bigint;
controllers: Array<Principal>;
reserved_cycles_limit: bigint;
memory_allocation: bigint;
compute_allocation: bigint;
}
export interface Erc20Contract {
chain_id: bigint;
address: string;
Expand Down Expand Up @@ -75,6 +96,12 @@ export interface OrchestratorInfo {
more_controller_ids: Array<Principal>;
minter_id: [] | [Principal];
}
export interface QueryStats {
response_payload_bytes_total: bigint;
num_instructions_total: bigint;
num_calls_total: bigint;
request_payload_bytes_total: bigint;
}
export interface UpdateCyclesManagement {
cycles_top_up_increment: [] | [bigint];
cycles_for_ledger_creation: [] | [bigint];
Expand All @@ -90,6 +117,7 @@ export interface UpgradeArg {
}
export interface _SERVICE {
canister_ids: ActorMethod<[Erc20Contract], [] | [ManagedCanisterIds]>;
get_canister_status: ActorMethod<[], CanisterStatusResponse>;
get_orchestrator_info: ActorMethod<[], OrchestratorInfo>;
}
export declare const idlFactory: IDL.InterfaceFactory;
Expand Down
33 changes: 32 additions & 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 ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/ethereum/ledger-suite-orchestrator/ledger_suite_orchestrator.did' by import-candid
// Generated from IC repo commit b9a0f18 (2024-05-29 tags: release-2024-05-29_23-02-base) 'rs/ethereum/ledger-suite-orchestrator/ledger_suite_orchestrator.did' by import-candid
type OrchestratorArg = variant {
UpgradeArg : UpgradeArg;
InitArg : InitArg;
Expand Down Expand Up @@ -177,6 +177,34 @@ type UpdateCyclesManagement = record {
cycles_top_up_increment: opt nat;
};

type CanisterStatusResponse = record {
query_stats : QueryStats;
status : CanisterStatusType;
memory_size : nat;
cycles : nat;
settings : DefiniteCanisterSettings;
idle_cycles_burned_per_day : nat;
module_hash : opt vec nat8;
reserved_cycles : nat;
};

type CanisterStatusType = variant { stopped; stopping; running };

type DefiniteCanisterSettings = record {
freezing_threshold : nat;
controllers : vec principal;
memory_allocation : nat;
compute_allocation : nat;
reserved_cycles_limit : nat;
};

type QueryStats = record {
response_payload_bytes_total : nat;
num_instructions_total : nat;
num_calls_total : nat;
request_payload_bytes_total : nat;
};

service : (OrchestratorArg) -> {

// Managed canister IDs for a given ERC20 contract
Expand All @@ -185,4 +213,7 @@ service : (OrchestratorArg) -> {
// Return internal orchestrator parameters
get_orchestrator_info : () -> (OrchestratorInfo) query;

// Retrieve the status of the minter canister.
get_canister_status : () -> (CanisterStatusResponse);

}
29 changes: 29 additions & 0 deletions packages/cketh/candid/orchestrator.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,34 @@ export const idlFactory = ({ IDL }) => {
'index' : IDL.Opt(IDL.Principal),
'archives' : IDL.Vec(IDL.Principal),
});
const CanisterStatusType = IDL.Variant({
'stopped' : IDL.Null,
'stopping' : IDL.Null,
'running' : IDL.Null,
});
const DefiniteCanisterSettings = IDL.Record({
'freezing_threshold' : IDL.Nat,
'controllers' : IDL.Vec(IDL.Principal),
'reserved_cycles_limit' : IDL.Nat,
'memory_allocation' : IDL.Nat,
'compute_allocation' : IDL.Nat,
});
const QueryStats = IDL.Record({
'response_payload_bytes_total' : IDL.Nat,
'num_instructions_total' : IDL.Nat,
'num_calls_total' : IDL.Nat,
'request_payload_bytes_total' : IDL.Nat,
});
const CanisterStatusResponse = IDL.Record({
'status' : CanisterStatusType,
'memory_size' : IDL.Nat,
'cycles' : IDL.Nat,
'settings' : DefiniteCanisterSettings,
'query_stats' : QueryStats,
'idle_cycles_burned_per_day' : IDL.Nat,
'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
'reserved_cycles' : IDL.Nat,
});
const ManagedCanisterStatus = IDL.Variant({
'Created' : IDL.Record({ 'canister_id' : IDL.Principal }),
'Installed' : IDL.Record({
Expand All @@ -91,6 +119,7 @@ export const idlFactory = ({ IDL }) => {
[IDL.Opt(ManagedCanisterIds)],
['query'],
),
'get_canister_status' : IDL.Func([], [CanisterStatusResponse], []),
'get_orchestrator_info' : IDL.Func([], [OrchestratorInfo], ['query']),
});
};
Expand Down
1 change: 1 addition & 0 deletions packages/cketh/src/minter.canister.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,7 @@ describe("ckETH minter canister", () => {
],
],
eth_helper_contract_address: toNullable(ckETHSmartContractAddressMock),
cketh_ledger_id: [ledgerCanisterIdMock],
smart_contract_address: toNullable(ckETHSmartContractAddressMock),
supported_ckerc20_tokens: [],
last_erc20_scraped_block_number: [5892643n],
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 ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/nns/cmc/cmc.did' by import-candid
// Generated from IC repo commit b9a0f18 (2024-05-29 tags: release-2024-05-29_23-02-base) 'rs/nns/cmc/cmc.did' by import-candid
type Cycles = nat;
type BlockIndex = nat64;
type log_visibility = variant {
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 ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/rosetta-api/icp_ledger/index/index.did' by import-candid
// Generated from IC repo commit b9a0f18 (2024-05-29 tags: release-2024-05-29_23-02-base) '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: 1 addition & 1 deletion 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 ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/rosetta-api/icp_ledger/ledger.did' by import-candid
// Generated from IC repo commit b9a0f18 (2024-05-29 tags: release-2024-05-29_23-02-base) '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
20 changes: 16 additions & 4 deletions packages/ledger-icrc/candid/icrc_index-ng.certified.idl.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_index-ng.did */
export const idlFactory = ({ IDL }) => {
const Value = IDL.Rec();
const UpgradeArg = IDL.Record({ 'ledger_id' : IDL.Opt(IDL.Principal) });
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 BlockIndex = IDL.Nat;
const SubAccount = IDL.Vec(IDL.Nat8);
Expand Down Expand Up @@ -120,8 +126,14 @@ export const idlFactory = ({ IDL }) => {
});
};
export const init = ({ IDL }) => {
const UpgradeArg = IDL.Record({ 'ledger_id' : IDL.Opt(IDL.Principal) });
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 [IDL.Opt(IndexArg)];
};
2 changes: 2 additions & 0 deletions packages/ledger-icrc/candid/icrc_index-ng.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export type GetTransactionsResult =
export type IndexArg = { Upgrade: UpgradeArg } | { Init: InitArg };
export interface InitArg {
ledger_id: Principal;
retrieve_blocks_from_ledger_interval_seconds: [] | [bigint];
}
export interface ListSubaccountsArgs {
owner: Principal;
Expand Down Expand Up @@ -95,6 +96,7 @@ export interface Transfer {
}
export interface UpgradeArg {
ledger_id: [] | [Principal];
retrieve_blocks_from_ledger_interval_seconds: [] | [bigint];
}
export type Value =
| { Int: bigint }
Expand Down
10 changes: 9 additions & 1 deletion packages/ledger-icrc/candid/icrc_index-ng.did
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/rosetta-api/icrc1/index-ng/index-ng.did' by import-candid
// Generated from IC repo commit b9a0f18 (2024-05-29 tags: release-2024-05-29_23-02-base) 'rs/rosetta-api/icrc1/index-ng/index-ng.did' by import-candid
type Tokens = nat;

type InitArg = record {
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 : opt nat64;
};

type UpgradeArg = record {
ledger_id: opt 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 : opt nat64;
};

type IndexArg = variant {
Expand Down
20 changes: 16 additions & 4 deletions packages/ledger-icrc/candid/icrc_index-ng.idl.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_index-ng.did */
export const idlFactory = ({ IDL }) => {
const Value = IDL.Rec();
const UpgradeArg = IDL.Record({ 'ledger_id' : IDL.Opt(IDL.Principal) });
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 BlockIndex = IDL.Nat;
const SubAccount = IDL.Vec(IDL.Nat8);
Expand Down Expand Up @@ -120,8 +126,14 @@ export const idlFactory = ({ IDL }) => {
});
};
export const init = ({ IDL }) => {
const UpgradeArg = IDL.Record({ 'ledger_id' : IDL.Opt(IDL.Principal) });
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 [IDL.Opt(IndexArg)];
};
2 changes: 1 addition & 1 deletion packages/ledger-icrc/candid/icrc_index.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/rosetta-api/icrc1/index/index.did' by import-candid
// Generated from IC repo commit b9a0f18 (2024-05-29 tags: release-2024-05-29_23-02-base) 'rs/rosetta-api/icrc1/index/index.did' by import-candid
type TxId = nat;

type Account = record { owner : principal; subaccount : opt blob };
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icrc/candid/icrc_ledger.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/rosetta-api/icrc1/ledger/ledger.did' by import-candid
// Generated from IC repo commit b9a0f18 (2024-05-29 tags: release-2024-05-29_23-02-base) 'rs/rosetta-api/icrc1/ledger/ledger.did' by import-candid
type BlockIndex = nat;
type Subaccount = blob;
// Number of nanoseconds since the UNIX epoch in UTC timezone.
Expand Down
2 changes: 1 addition & 1 deletion packages/nns/candid/genesis_token.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/nns/gtc/canister/gtc.did' by import-candid
// Generated from IC repo commit b9a0f18 (2024-05-29 tags: release-2024-05-29_23-02-base) 'rs/nns/gtc/canister/gtc.did' by import-candid
type AccountState = record {
authenticated_principal_id : opt principal;
successfully_transferred_neurons : vec TransferredNeuron;
Expand Down
2 changes: 1 addition & 1 deletion packages/nns/candid/governance.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/nns/governance/canister/governance.did' by import-candid
// Generated from IC repo commit b9a0f18 (2024-05-29 tags: release-2024-05-29_23-02-base) 'rs/nns/governance/canister/governance.did' by import-candid
type AccountIdentifier = record { hash : blob };
type Action = variant {
RegisterKnownNeuron : KnownNeuron;
Expand Down
2 changes: 1 addition & 1 deletion packages/nns/candid/governance_test.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/nns/governance/canister/governance_test.did' by import-candid
// Generated from IC repo commit b9a0f18 (2024-05-29 tags: release-2024-05-29_23-02-base) 'rs/nns/governance/canister/governance_test.did' by import-candid
type AccountIdentifier = record { hash : blob };
type Action = variant {
RegisterKnownNeuron : KnownNeuron;
Expand Down
Loading

0 comments on commit 50904a9

Please sign in to comment.