Skip to content

Overview

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


Defined in: packages/canisters/src/cmc/cmc.errors.ts:6

  • Error

new CmcError(message?): CmcError

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082

string

CmcError

Error.constructor

new CmcError(message?, options?): CmcError

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082

string

ErrorOptions

CmcError

Error.constructor

optional cause: unknown

Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26

Error.cause

message: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077

Error.message

name: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076

Error.name

optional stack: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078

Error.stack

static stackTraceLimit: number

Defined in: node_modules/@types/node/globals.d.ts:67

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Error.stackTraceLimit

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/@types/node/globals.d.ts:51

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();

object

Function

void

Error.captureStackTrace

static isError(error): error is Error

Defined in: node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

unknown

error is Error

Error.isError

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/@types/node/globals.d.ts:55

Error

CallSite[]

any

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Error.prepareStackTrace


Defined in: packages/canisters/src/cmc/cmc.errors.ts:5

  • Error

new InvalidaTransactionError(message?): InvalidaTransactionError

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082

string

InvalidaTransactionError

Error.constructor

new InvalidaTransactionError(message?, options?): InvalidaTransactionError

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082

string

ErrorOptions

InvalidaTransactionError

Error.constructor

optional cause: unknown

Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26

Error.cause

message: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077

Error.message

name: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076

Error.name

optional stack: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078

Error.stack

static stackTraceLimit: number

Defined in: node_modules/@types/node/globals.d.ts:67

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Error.stackTraceLimit

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/@types/node/globals.d.ts:51

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();

object

Function

void

Error.captureStackTrace

static isError(error): error is Error

Defined in: node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

unknown

error is Error

Error.isError

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/@types/node/globals.d.ts:55

Error

CallSite[]

any

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Error.prepareStackTrace


Defined in: packages/canisters/src/cmc/cmc.errors.ts:7

  • Error

new ProcessingError(message?): ProcessingError

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082

string

ProcessingError

Error.constructor

new ProcessingError(message?, options?): ProcessingError

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082

string

ErrorOptions

ProcessingError

Error.constructor

optional cause: unknown

Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26

Error.cause

message: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077

Error.message

name: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076

Error.name

optional stack: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078

Error.stack

static stackTraceLimit: number

Defined in: node_modules/@types/node/globals.d.ts:67

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Error.stackTraceLimit

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/@types/node/globals.d.ts:51

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();

object

Function

void

Error.captureStackTrace

static isError(error): error is Error

Defined in: node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

unknown

error is Error

Error.isError

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/@types/node/globals.d.ts:55

Error

CallSite[]

any

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Error.prepareStackTrace


Defined in: packages/canisters/src/cmc/cmc.errors.ts:4

  • Error

new RefundedError(message?): RefundedError

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082

string

RefundedError

Error.constructor

new RefundedError(message?, options?): RefundedError

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082

string

ErrorOptions

RefundedError

Error.constructor

optional cause: unknown

Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26

Error.cause

message: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077

Error.message

name: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076

Error.name

optional stack: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078

Error.stack

static stackTraceLimit: number

Defined in: node_modules/@types/node/globals.d.ts:67

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Error.stackTraceLimit

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/@types/node/globals.d.ts:51

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();

object

Function

void

Error.captureStackTrace

static isError(error): error is Error

Defined in: node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

unknown

error is Error

Error.isError

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/@types/node/globals.d.ts:55

Error

CallSite[]

any

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Error.prepareStackTrace


Defined in: packages/canisters/src/cmc/cmc.errors.ts:8

  • Error

new TransactionTooOldError(message?): TransactionTooOldError

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082

string

TransactionTooOldError

Error.constructor

new TransactionTooOldError(message?, options?): TransactionTooOldError

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082

string

ErrorOptions

TransactionTooOldError

Error.constructor

optional cause: unknown

Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26

Error.cause

message: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077

Error.message

name: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076

Error.name

optional stack: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078

Error.stack

static stackTraceLimit: number

Defined in: node_modules/@types/node/globals.d.ts:67

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Error.stackTraceLimit

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/@types/node/globals.d.ts:51

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();

object

Function

void

Error.captureStackTrace

static isError(error): error is Error

Defined in: node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

unknown

error is Error

Error.isError

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/@types/node/globals.d.ts:55

Error

CallSite[]

any

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Error.prepareStackTrace

Defined in: packages/canisters/src/cmc/cmc.options.ts:5

  • Omit<CanisterOptions<_SERVICE>, "canisterId">

optional agent: Agent

Defined in: packages/utils/dist/types/canister.options.d.ts:4

NnsGovernanceCanisterOptions.agent

canisterId: Principal

Defined in: packages/canisters/src/cmc/cmc.options.ts:9

optional certifiedServiceOverride: ActorSubclass<_SERVICE>

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

Omit.certifiedServiceOverride

optional serviceOverride: ActorSubclass<_SERVICE>

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

Omit.serviceOverride

throwNotifyError(__namedParameters): void

Defined in: packages/canisters/src/cmc/cmc.errors.ts:11

NotifyError

void