Skip to content

CMCCanister

Defined in: packages/cmc/src/cmc.canister.ts:15

  • Canister<CMCCanisterService>

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

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

Principal

_SERVICE

_SERVICE

CMCCanister

Canister<CMCCanisterService>.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/cmc/src/cmc.canister.ts:110

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/cmc/src/cmc.canister.ts:35

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/cmc/src/cmc.canister.ts:129

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/cmc/src/cmc.canister.ts:57

Notifies Cycles Minting Canister of the creation of a new canister. It returns the new canister principal.

NotifyCreateCanisterArg

Promise<Principal>

Promise

RefundedError, InvalidaTransactionError, ProcessingError, TransactionTooOldError, CMCError


notifyTopUp(request): Promise<bigint>

Defined in: packages/cmc/src/cmc.canister.ts:85

Notifies Cycles Minting Canister of new cycles being added to canister. It returns the new Cycles of the canister.

NotifyTopUpArg

Promise<bigint>

Promise

RefundedError, InvalidaTransactionError, ProcessingError, TransactionTooOldError, CMCError


static create(options): CMCCanister

Defined in: packages/cmc/src/cmc.canister.ts:16

CMCCanisterOptions

CMCCanister