CMCCanister
Defined in: packages/cmc/src/cmc.canister.ts:15
Extends
Section titled “Extends”Canister<CMCCanisterService>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”
protectednew CMCCanister(id,service,certifiedService):CMCCanister
Defined in: packages/utils/dist/services/canister.d.ts:7
Parameters
Section titled “Parameters”Principal
service
Section titled “service”_SERVICE
certifiedService
Section titled “certifiedService”_SERVICE
Returns
Section titled “Returns”CMCCanister
Inherited from
Section titled “Inherited from”Canister<CMCCanisterService>.constructor
Properties
Section titled “Properties”caller()
Section titled “caller()”
protectedcaller: (__namedParameters) =>_SERVICE
Defined in: packages/utils/dist/services/canister.d.ts:9
Parameters
Section titled “Parameters”__namedParameters
Section titled “__namedParameters”QueryParams
Returns
Section titled “Returns”_SERVICE
Inherited from
Section titled “Inherited from”Canister.caller
certifiedService
Section titled “certifiedService”
protectedreadonlycertifiedService:_SERVICE
Defined in: packages/utils/dist/services/canister.d.ts:6
Inherited from
Section titled “Inherited from”Canister.certifiedService
service
Section titled “service”
protectedreadonlyservice:_SERVICE
Defined in: packages/utils/dist/services/canister.d.ts:5
Inherited from
Section titled “Inherited from”Canister.service
Accessors
Section titled “Accessors”canisterId
Section titled “canisterId”Get Signature
Section titled “Get Signature”get canisterId():
Principal
Defined in: packages/utils/dist/services/canister.d.ts:8
Returns
Section titled “Returns”Principal
Inherited from
Section titled “Inherited from”Canister.canisterId
Methods
Section titled “Methods”getDefaultSubnets()
Section titled “getDefaultSubnets()”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.
Parameters
Section titled “Parameters”params?
Section titled “params?”QueryParams = {}
The query parameters for the call.
Returns
Section titled “Returns”Promise<Principal[]>
- A promise that resolves to an array of
Principalobjects representing the default subnets.
getIcpToCyclesConversionRate()
Section titled “getIcpToCyclesConversionRate()”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.
Parameters
Section titled “Parameters”params?
Section titled “params?”QueryParams = {}
The parameters for the call.
Returns
Section titled “Returns”Promise<bigint>
Promise
getSubnetTypesToSubnets()
Section titled “getSubnetTypesToSubnets()”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.
Parameters
Section titled “Parameters”params?
Section titled “params?”QueryParams = {}
The optional query parameters for the call.
Returns
Section titled “Returns”Promise<SubnetTypesToSubnetsResponse>
- A promise that resolves to an object representing the mapping of subnet types to subnets.
notifyCreateCanister()
Section titled “notifyCreateCanister()”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.
Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”Promise<Principal>
Promise
Throws
Section titled “Throws”RefundedError, InvalidaTransactionError, ProcessingError, TransactionTooOldError, CMCError
notifyTopUp()
Section titled “notifyTopUp()”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.
Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”Promise<bigint>
Promise
Throws
Section titled “Throws”RefundedError, InvalidaTransactionError, ProcessingError, TransactionTooOldError, CMCError
create()
Section titled “create()”
staticcreate(options):CMCCanister
Defined in: packages/cmc/src/cmc.canister.ts:16
Parameters
Section titled “Parameters”options
Section titled “options”CMCCanisterOptions
Returns
Section titled “Returns”CMCCanister