Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update IC Candid Files #473

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 8be68bc88db7332dd39a26509ddf62c564ca3415 'rs/bitcoin/ckbtc/minter/ckbtc_minter.did' by import-candid
// Generated from IC repo commit ec140b7 (2023-11-08 tags: release-2023-11-08_23-01) '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
38 changes: 38 additions & 0 deletions packages/cmc/candid/cmc.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,37 @@ export const idlFactory = ({ IDL }) => {
'minting_account_id' : IDL.Opt(AccountIdentifier),
'ledger_canister_id' : IDL.Opt(IDL.Principal),
});
const SubnetFilter = IDL.Record({ 'subnet_type' : IDL.Opt(IDL.Text) });
const SubnetSelection = IDL.Variant({
'Filter' : SubnetFilter,
'Subnet' : IDL.Record({ 'subnet' : IDL.Principal }),
});
const CanisterSettings = IDL.Record({
'freezing_threshold' : IDL.Opt(IDL.Nat),
'controllers' : IDL.Opt(IDL.Vec(IDL.Principal)),
'reserved_cycles_limit' : IDL.Opt(IDL.Nat),
'memory_allocation' : IDL.Opt(IDL.Nat),
'compute_allocation' : IDL.Opt(IDL.Nat),
});
const CreateCanisterArg = IDL.Record({
'subnet_selection' : IDL.Opt(SubnetSelection),
'settings' : IDL.Opt(CanisterSettings),
'subnet_type' : IDL.Opt(IDL.Text),
});
const CreateCanisterError = IDL.Variant({
'Refunded' : IDL.Record({
'create_error' : IDL.Text,
'refund_amount' : IDL.Nat,
}),
'RefundFailed' : IDL.Record({
'create_error' : IDL.Text,
'refund_error' : IDL.Text,
}),
});
const CreateCanisterResult = IDL.Variant({
'Ok' : IDL.Principal,
'Err' : CreateCanisterError,
});
const IcpXdrConversionRate = IDL.Record({
'xdr_permyriad_per_icp' : IDL.Nat64,
'timestamp_seconds' : IDL.Nat64,
Expand All @@ -31,6 +62,8 @@ export const idlFactory = ({ IDL }) => {
const NotifyCreateCanisterArg = IDL.Record({
'controller' : IDL.Principal,
'block_index' : BlockIndex,
'subnet_selection' : IDL.Opt(IDL.Vec(SubnetSelection)),
'settings' : IDL.Opt(CanisterSettings),
'subnet_type' : IDL.Opt(IDL.Text),
});
const NotifyError = IDL.Variant({
Expand All @@ -57,6 +90,11 @@ export const idlFactory = ({ IDL }) => {
const Cycles = IDL.Nat;
const NotifyTopUpResult = IDL.Variant({ 'Ok' : Cycles, 'Err' : NotifyError });
return IDL.Service({
'create_canister' : IDL.Func(
[CreateCanisterArg],
[CreateCanisterResult],
[],
),
'get_icp_xdr_conversion_rate' : IDL.Func(
[],
[IcpXdrConversionRateResponse],
Expand Down
29 changes: 29 additions & 0 deletions packages/cmc/candid/cmc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ export interface AccountIdentifier {
bytes: Uint8Array;
}
export type BlockIndex = bigint;
export interface CanisterSettings {
freezing_threshold: [] | [bigint];
controllers: [] | [Array<Principal>];
reserved_cycles_limit: [] | [bigint];
memory_allocation: [] | [bigint];
compute_allocation: [] | [bigint];
}
export interface CreateCanisterArg {
subnet_selection: [] | [SubnetSelection];
settings: [] | [CanisterSettings];
subnet_type: [] | [string];
}
export type CreateCanisterError =
| {
Refunded: { create_error: string; refund_amount: bigint };
}
| { RefundFailed: { create_error: string; refund_error: string } };
export type CreateCanisterResult =
| { Ok: Principal }
| { Err: CreateCanisterError };
export type Cycles = bigint;
export interface CyclesCanisterInitPayload {
exchange_rate_canister: [] | [ExchangeRateCanister];
Expand All @@ -26,6 +46,8 @@ export interface IcpXdrConversionRateResponse {
export interface NotifyCreateCanisterArg {
controller: Principal;
block_index: BlockIndex;
subnet_selection: [] | [Array<SubnetSelection>];
settings: [] | [CanisterSettings];
subnet_type: [] | [string];
}
export type NotifyCreateCanisterResult =
Expand All @@ -47,10 +69,17 @@ export type NotifyTopUpResult = { Ok: Cycles } | { Err: NotifyError };
export interface PrincipalsAuthorizedToCreateCanistersToSubnetsResponse {
data: Array<[Principal, Array<Principal>]>;
}
export interface SubnetFilter {
subnet_type: [] | [string];
}
export type SubnetSelection =
| { Filter: SubnetFilter }
| { Subnet: { subnet: Principal } };
export interface SubnetTypesToSubnetsResponse {
data: Array<[string, Array<Principal>]>;
}
export interface _SERVICE {
create_canister: ActorMethod<[CreateCanisterArg], CreateCanisterResult>;
get_icp_xdr_conversion_rate: ActorMethod<[], IcpXdrConversionRateResponse>;
get_principals_authorized_to_create_canisters_to_subnets: ActorMethod<
[],
Expand Down
77 changes: 75 additions & 2 deletions packages/cmc/candid/cmc.did
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
// Generated from IC repo commit d2331ec4b3c60f408b876427d7238ec15fb16ad5 'rs/nns/cmc/cmc.did' by import-candid
// Generated from IC repo commit ec140b7 (2023-11-08 tags: release-2023-11-08_23-01) 'rs/nns/cmc/cmc.did' by import-candid
type Cycles = nat;
type BlockIndex = nat64;
type CanisterSettings = record {
controllers : opt vec principal;
compute_allocation : opt nat;
memory_allocation : opt nat;
freezing_threshold : opt nat;
reserved_cycles_limit: opt nat;
};

// The argument of the [notify_top_up] method.
type NotifyTopUpArg = record {
Expand All @@ -11,6 +18,35 @@ type NotifyTopUpArg = record {
canister_id : principal;
};


type SubnetSelection = variant {
/// Choose a specific subnet
Subnet : record {
subnet: principal;
};
/// Choose a random subnet that fulfills the specified properties
Filter : SubnetFilter;
};

type SubnetFilter = record {
subnet_type: opt text;
};

// The argument of the [create_canister] method.
type CreateCanisterArg = record {
// Optional canister settings that, if set, are applied to the newly created canister.
// If not specified, the caller is the controller of the canister and the other settings are set to default values.
settings : opt CanisterSettings;

// An optional subnet type that, if set, determines what type of subnet
// the new canister will be created on.
// Deprecated. Use subnet_selection instead.
subnet_type: opt text;

// Optional instructions to select on which subnet the new canister will be created on.
subnet_selection: opt SubnetSelection;
};

// The argument of the [notify_create_canister] method.
type NotifyCreateCanisterArg = record {
// Index of the block on the ICP ledger that contains the payment.
Expand All @@ -21,7 +57,35 @@ type NotifyCreateCanisterArg = record {

// An optional subnet type that, if set, determines what type of subnet
// the new canister will be created on.
// Deprecated. Use subnet_selection instead.
subnet_type: opt text;

// Optional instructions to select on which subnet the new canister will be created on.
// vec may contain no more than one element.
subnet_selection: opt vec SubnetSelection;

// Optional canister settings that, if set, are applied to the newly created canister.
// If not specified, the caller is the controller of the canister and the other settings are set to default values.
settings : opt CanisterSettings;
};

// Canister creation failed and the cycles attached to the call were returned to the calling canister.
// A small fee may be charged.
type CreateCanisterError = variant {
Refunded : record {
// The amount of cycles returned to the calling canister
refund_amount: nat;

// The reason why creating a canister failed.
create_error: text;
};
RefundFailed : record {
// The reason why creating a canister failed.
create_error: text;

// The reason why refunding cycles failed.
refund_error: text;
};
};

type NotifyError = variant {
Expand Down Expand Up @@ -58,6 +122,12 @@ type NotifyTopUpResult = variant {
Err : NotifyError;
};

type CreateCanisterResult = variant {
// The principal of the newly created canister.
Ok : principal;
Err : CreateCanisterError;
};

type NotifyCreateCanisterResult = variant {
// The principal of the newly created canister.
Ok : principal;
Expand Down Expand Up @@ -124,10 +194,13 @@ type CyclesCanisterInitPayload = record {
};

service : (opt CyclesCanisterInitPayload) -> {
// Propmts the cycles minting canister to process a payment by converting ICP
// Prompts the cycles minting canister to process a payment by converting ICP
// into cycles and sending the cycles the specified canister.
notify_top_up : (NotifyTopUpArg) -> (NotifyTopUpResult);

// Creates a canister using the cycles attached to the function call.
create_canister : (CreateCanisterArg) -> (CreateCanisterResult);

// Prompts the cycles minting canister to process a payment for canister creation.
notify_create_canister : (NotifyCreateCanisterArg) -> (NotifyCreateCanisterResult);

Expand Down
38 changes: 38 additions & 0 deletions packages/cmc/candid/cmc.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,37 @@ export const idlFactory = ({ IDL }) => {
'minting_account_id' : IDL.Opt(AccountIdentifier),
'ledger_canister_id' : IDL.Opt(IDL.Principal),
});
const SubnetFilter = IDL.Record({ 'subnet_type' : IDL.Opt(IDL.Text) });
const SubnetSelection = IDL.Variant({
'Filter' : SubnetFilter,
'Subnet' : IDL.Record({ 'subnet' : IDL.Principal }),
});
const CanisterSettings = IDL.Record({
'freezing_threshold' : IDL.Opt(IDL.Nat),
'controllers' : IDL.Opt(IDL.Vec(IDL.Principal)),
'reserved_cycles_limit' : IDL.Opt(IDL.Nat),
'memory_allocation' : IDL.Opt(IDL.Nat),
'compute_allocation' : IDL.Opt(IDL.Nat),
});
const CreateCanisterArg = IDL.Record({
'subnet_selection' : IDL.Opt(SubnetSelection),
'settings' : IDL.Opt(CanisterSettings),
'subnet_type' : IDL.Opt(IDL.Text),
});
const CreateCanisterError = IDL.Variant({
'Refunded' : IDL.Record({
'create_error' : IDL.Text,
'refund_amount' : IDL.Nat,
}),
'RefundFailed' : IDL.Record({
'create_error' : IDL.Text,
'refund_error' : IDL.Text,
}),
});
const CreateCanisterResult = IDL.Variant({
'Ok' : IDL.Principal,
'Err' : CreateCanisterError,
});
const IcpXdrConversionRate = IDL.Record({
'xdr_permyriad_per_icp' : IDL.Nat64,
'timestamp_seconds' : IDL.Nat64,
Expand All @@ -31,6 +62,8 @@ export const idlFactory = ({ IDL }) => {
const NotifyCreateCanisterArg = IDL.Record({
'controller' : IDL.Principal,
'block_index' : BlockIndex,
'subnet_selection' : IDL.Opt(IDL.Vec(SubnetSelection)),
'settings' : IDL.Opt(CanisterSettings),
'subnet_type' : IDL.Opt(IDL.Text),
});
const NotifyError = IDL.Variant({
Expand All @@ -57,6 +90,11 @@ export const idlFactory = ({ IDL }) => {
const Cycles = IDL.Nat;
const NotifyTopUpResult = IDL.Variant({ 'Ok' : Cycles, 'Err' : NotifyError });
return IDL.Service({
'create_canister' : IDL.Func(
[CreateCanisterArg],
[CreateCanisterResult],
[],
),
'get_icp_xdr_conversion_rate' : IDL.Func(
[],
[IcpXdrConversionRateResponse],
Expand Down
52 changes: 51 additions & 1 deletion packages/ic-management/candid/ic-management.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@ export const idlFactory = ({ IDL }) => {
'body' : IDL.Vec(IDL.Nat8),
'headers' : IDL.Vec(http_header),
});
const chunk_hash = IDL.Vec(IDL.Nat8);
const wasm_module = IDL.Vec(IDL.Nat8);
return IDL.Service({
'bitcoin_get_balance' : IDL.Func([get_balance_request], [satoshi], []),
'bitcoin_get_balance_' : IDL.Func([get_balance_request], [satoshi], []),
'bitcoin_get_current_fee_percentiles' : IDL.Func(
[get_current_fee_percentiles_request],
[IDL.Vec(millisatoshi_per_byte)],
Expand All @@ -106,6 +108,11 @@ export const idlFactory = ({ IDL }) => {
[get_utxos_response],
[],
),
'bitcoin_get_utxos_' : IDL.Func(
[get_utxos_request],
[get_utxos_response],
[],
),
'bitcoin_send_transaction' : IDL.Func([send_transaction_request], [], []),
'canister_info' : IDL.Func(
[
Expand Down Expand Up @@ -142,6 +149,11 @@ export const idlFactory = ({ IDL }) => {
],
[],
),
'clear_chunk_store' : IDL.Func(
[IDL.Record({ 'canister_id' : canister_id })],
[],
[],
),
'create_canister' : IDL.Func(
[
IDL.Record({
Expand Down Expand Up @@ -210,14 +222,37 @@ export const idlFactory = ({ IDL }) => {
[http_response],
[],
),
'install_chunked_code' : IDL.Func(
[
IDL.Record({
'arg' : IDL.Vec(IDL.Nat8),
'wasm_module_hash' : IDL.Vec(IDL.Nat8),
'mode' : IDL.Variant({
'reinstall' : IDL.Null,
'upgrade' : IDL.Opt(
IDL.Record({ 'skip_pre_upgrade' : IDL.Opt(IDL.Bool) })
),
'install' : IDL.Null,
}),
'chunk_hashes_list' : IDL.Vec(chunk_hash),
'target_canister' : canister_id,
'sender_canister_version' : IDL.Opt(IDL.Nat64),
'storage_canister' : IDL.Opt(canister_id),
}),
],
[],
[],
),
'install_code' : IDL.Func(
[
IDL.Record({
'arg' : IDL.Vec(IDL.Nat8),
'wasm_module' : wasm_module,
'mode' : IDL.Variant({
'reinstall' : IDL.Null,
'upgrade' : IDL.Null,
'upgrade' : IDL.Opt(
IDL.Record({ 'skip_pre_upgrade' : IDL.Opt(IDL.Bool) })
),
'install' : IDL.Null,
}),
'canister_id' : canister_id,
Expand Down Expand Up @@ -266,6 +301,11 @@ export const idlFactory = ({ IDL }) => {
[],
[],
),
'stored_chunks' : IDL.Func(
[IDL.Record({ 'canister_id' : canister_id })],
[IDL.Vec(chunk_hash)],
[],
),
'uninstall_code' : IDL.Func(
[
IDL.Record({
Expand All @@ -287,6 +327,16 @@ export const idlFactory = ({ IDL }) => {
[],
[],
),
'upload_chunk' : IDL.Func(
[
IDL.Record({
'chunk' : IDL.Vec(IDL.Nat8),
'canister_id' : IDL.Principal,
}),
],
[chunk_hash],
[],
),
});
};
export const init = ({ IDL }) => { return []; };
Loading
Loading