Skip to content

CmcCanister

Defined in: packages/canisters/src/cmc/cmc.canister.ts:12

protected new CmcCanister(id, service, certifiedService): CmcCanister

Defined in: packages/utils/dist/services/canister.d.ts:7

Principal

_SERVICE

_SERVICE

CmcCanister

Canister<CmcService>.constructor

protected caller: (__namedParameters) => _SERVICE

Defined in: packages/utils/dist/services/canister.d.ts:9

QueryParams

_SERVICE

Canister.caller


protected readonly certifiedService: _SERVICE

Defined in: packages/utils/dist/services/canister.d.ts:6

Canister.certifiedService


protected readonly service: _SERVICE

Defined in: packages/utils/dist/services/canister.d.ts:5

Canister.service

get canisterId(): Principal

Defined in: packages/utils/dist/services/canister.d.ts:8

Principal

Canister.canisterId

getDefaultSubnets(params?): Promise<Principal[]>

Defined in: packages/canisters/src/cmc/cmc.canister.ts:153

This function calls the get_default_subnets method of the CMC canister, which returns a list of default subnets as Principal objects. It can be called as query or update.

QueryParams = {}

The query parameters for the call.

Promise<Principal[]>

  • A promise that resolves to an array of Principal objects representing the default subnets.

getIcpToCyclesConversionRate(params?): Promise<bigint>

Defined in: packages/canisters/src/cmc/cmc.canister.ts:32

Returns conversion rate of ICP to Cycles. It can be called as query or update.

QueryParams = {}

The parameters for the call.

Promise<bigint>

Promise


getSubnetTypesToSubnets(params?): Promise<SubnetTypesToSubnetsResponse>

Defined in: packages/canisters/src/cmc/cmc.canister.ts:172

This function calls the get_subnet_types_to_subnets method of the CMC canister, which returns a list of subnets where canisters can be created. These subnets are excluded from the random subnet selection process used by the CMC when no explicit subnet ID is provided during canister creation and therefore, not provided in the results of the similar function get_default_subnets.

QueryParams = {}

The optional query parameters for the call.

Promise<SubnetTypesToSubnetsResponse>

  • A promise that resolves to an object representing the mapping of subnet types to subnets.

notifyCreateCanister(request): Promise<Principal>

Defined in: packages/canisters/src/cmc/cmc.canister.ts:56

Notifies CMC (Cycles Minting Canister) of the creation of a new canister.

NotifyCreateCanisterArg

Promise<Principal>

Promise The principal of the newly created canister

RefundedError, InvalidaTransactionError, ProcessingError, TransactionTooOldError, CmcError


notifyMintCycles(request): Promise<NotifyMintCyclesSuccess>

Defined in: packages/canisters/src/cmc/cmc.canister.ts:121

Notifies the CMC (Cycles Minting Canister) to mint cycles and deposit them to a cycles ledger account owned by the caller. This function is commonly used to finalize the process of converting ICP to cycles.

NotifyMintCyclesArg

Promise<NotifyMintCyclesSuccess>

Promise The new cycles of the canister

RefundedError, InvalidTransactionError, ProcessingError, TransactionTooOldError, CmcError


notifyTopUp(request): Promise<bigint>

Defined in: packages/canisters/src/cmc/cmc.canister.ts:89

Notifies the CMC (Cycles Minting Canister) of new cycles being added to a canister. This function is commonly used to finalize the process of topping up a canister using ICP.

NotifyTopUpArg

Promise<bigint>

Promise The new cycles of the canister

RefundedError, InvalidTransactionError, ProcessingError, TransactionTooOldError, CmcError


static create(options): CmcCanister

Defined in: packages/canisters/src/cmc/cmc.canister.ts:13

CmcCanisterOptions

CmcCanister