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 #484

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
6 changes: 0 additions & 6 deletions packages/ckbtc/candid/minter.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,6 @@ export const idlFactory = ({ IDL }) => {
}),
'Checked' : Utxo,
});
const PendingUtxo = IDL.Record({
'confirmations' : IDL.Nat32,
'value' : IDL.Nat64,
'outpoint' : IDL.Record({ 'txid' : IDL.Vec(IDL.Nat8), 'vout' : IDL.Nat32 }),
});
const UpdateBalanceError = IDL.Variant({
'GenericError' : IDL.Record({
'error_message' : IDL.Text,
Expand All @@ -212,7 +207,6 @@ export const idlFactory = ({ IDL }) => {
'AlreadyProcessing' : IDL.Null,
'NoNewUtxos' : IDL.Record({
'required_confirmations' : IDL.Nat32,
'pending_utxos' : IDL.Opt(IDL.Vec(PendingUtxo)),
'current_confirmations' : IDL.Opt(IDL.Nat32),
}),
});
Expand Down
6 changes: 0 additions & 6 deletions packages/ckbtc/candid/minter.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,6 @@ export type Mode =
| { DepositsRestrictedTo: Array<Principal> }
| { ReadOnly: null }
| { GeneralAvailability: null };
export interface PendingUtxo {
confirmations: number;
value: bigint;
outpoint: { txid: Uint8Array | number[]; vout: number };
}
export type ReimbursementReason =
| { CallFailed: null }
| { TaintedDestination: { kyt_fee: bigint; kyt_provider: Principal } };
Expand Down Expand Up @@ -187,7 +182,6 @@ export type UpdateBalanceError =
| {
NoNewUtxos: {
required_confirmations: number;
pending_utxos: [] | [Array<PendingUtxo>];
current_confirmations: [] | [number];
};
};
Expand Down
12 changes: 2 additions & 10 deletions packages/ckbtc/candid/minter.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 4de99bc27b (2023-11-20) 'rs/bitcoin/ckbtc/minter/ckbtc_minter.did' by import-candid
// Generated from IC repo commit d73659a (2023-11-17 tags: release-2023-11-15_23-00) '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 Expand Up @@ -101,19 +101,11 @@ type UtxoStatus = variant {
};
};

// Utxos that don't have enough confirmations to be processed.
type PendingUtxo = record {
outpoint : record { txid : vec nat8; vout : nat32 };
value : nat64;
confirmations: nat32;
};

type UpdateBalanceError = variant {
// There are no new UTXOs to process.
NoNewUtxos : record {
current_confirmations: opt nat32;
required_confirmations: nat32;
pending_utxos: opt vec PendingUtxo;
required_confirmations: nat32
};
// The minter is already processing another update balance request for the caller.
AlreadyProcessing;
Expand Down
6 changes: 0 additions & 6 deletions packages/ckbtc/candid/minter.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,6 @@ export const idlFactory = ({ IDL }) => {
}),
'Checked' : Utxo,
});
const PendingUtxo = IDL.Record({
'confirmations' : IDL.Nat32,
'value' : IDL.Nat64,
'outpoint' : IDL.Record({ 'txid' : IDL.Vec(IDL.Nat8), 'vout' : IDL.Nat32 }),
});
const UpdateBalanceError = IDL.Variant({
'GenericError' : IDL.Record({
'error_message' : IDL.Text,
Expand All @@ -212,7 +207,6 @@ export const idlFactory = ({ IDL }) => {
'AlreadyProcessing' : IDL.Null,
'NoNewUtxos' : IDL.Record({
'required_confirmations' : IDL.Nat32,
'pending_utxos' : IDL.Opt(IDL.Vec(PendingUtxo)),
'current_confirmations' : IDL.Opt(IDL.Nat32),
}),
});
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 | number[];
}
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 d73659a (2023-11-17 tags: release-2023-11-15_23-00) '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
Loading
Loading