Skip to content

Overview

Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:5

DECIMALS: "icrc1:decimals"

Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:8

FEE: "icrc1:fee"

Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:9

LOGO: "icrc1:logo"

Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:10

NAME: "icrc1:name"

Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:7

SYMBOL: "icrc1:symbol"

Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:6

Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:20

  • Error

new ConsentMessageError(message?): ConsentMessageError

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

string

ConsentMessageError

Error.constructor

new ConsentMessageError(message?, options?): ConsentMessageError

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

string

ErrorOptions

ConsentMessageError

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/ledger/icrc/errors/ledger.errors.ts:24

new ConsentMessageUnavailableError(message?): ConsentMessageUnavailableError

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

string

ConsentMessageUnavailableError

ConsentMessageError.constructor

new ConsentMessageUnavailableError(message?, options?): ConsentMessageUnavailableError

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

string

ErrorOptions

ConsentMessageUnavailableError

ConsentMessageError.constructor

optional cause: unknown

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

ConsentMessageError.cause

message: string

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

ConsentMessageError.message

name: string

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

ConsentMessageError.name

optional stack: string

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

ConsentMessageError.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.

ConsentMessageError.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

ConsentMessageError.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

ConsentMessageError.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

ConsentMessageError.prepareStackTrace


Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:11

  • Error

new GenericError(message, error_code): GenericError

Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:12

string

bigint

GenericError

Error.constructor

optional cause: unknown

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

Error.cause

readonly error_code: bigint

Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:14

readonly message: string

Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:13

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/ledger/icrc/index.canister.ts:21

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

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

Principal

_SERVICE

_SERVICE

IcrcIndexCanister

IcrcCanister<IcrcIndexService>.constructor

protected caller: (__namedParameters) => _SERVICE

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

QueryParams

_SERVICE

IcrcCanister.caller

protected readonly certifiedService: _SERVICE

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

IcrcCanister.certifiedService

protected readonly service: _SERVICE

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

IcrcCanister.service

get canisterId(): Principal

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

Principal

IcrcCanister.canisterId

balance(params): Promise<bigint>

Defined in: packages/canisters/src/ledger/icrc/canister.ts:15

Returns the balance for a given account provided as owner and with optional subaccount.

BalanceParams

The parameters to get the balance of an account.

Promise<bigint>

The balance of the given account.

IcrcCanister.balance

getTransactions(params): Promise<GetTransactions>

Defined in: packages/canisters/src/ledger/icrc/index.canister.ts:47

Get the transactions of an account.

GetIndexAccountTransactionsParams

The parameters to get the transactions of an account.

Promise<GetTransactions>

The list of transactions and further related information of the given account.

ledgerId(params): Promise<Principal>

Defined in: packages/canisters/src/ledger/icrc/index.canister.ts:65

Returns the ledger canister ID related to the index canister.

QueryParams

Promise<Principal>

listSubaccounts(params): Promise<SubAccount[]>

Defined in: packages/canisters/src/ledger/icrc/index.canister.ts:85

Returns the list of subaccounts for a given owner.

ListSubaccountsParams

The parameters to get the list of subaccounts.

Promise<SubAccount[]>

The list of subaccounts.

status(params): Promise<Status>

Defined in: packages/canisters/src/ledger/icrc/index.canister.ts:76

Returns the status of the index canister.

QueryParams

The parameters to get the status of the index canister.

Promise<Status>

The status of the index canister.

static create(options): IcrcIndexCanister

Defined in: packages/canisters/src/ledger/icrc/index.canister.ts:22

IcrcLedgerCanisterOptions<_SERVICE>

IcrcIndexCanister


Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:36

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

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

Principal

_SERVICE

_SERVICE

IcrcLedgerCanister

IcrcCanister<IcrcLedgerService>.constructor

protected caller: (__namedParameters) => _SERVICE

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

QueryParams

_SERVICE

IcrcCanister.caller

protected readonly certifiedService: _SERVICE

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

IcrcCanister.certifiedService

protected readonly service: _SERVICE

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

IcrcCanister.service

get canisterId(): Principal

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

Principal

IcrcCanister.canisterId

allowance(params): Promise<Allowance>

Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:147

Returns the token allowance that the spender account can transfer from the specified account, and the expiration time for that allowance, if any.

Reference: https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-2/index.md#icrc2_allowance

AllowanceParams

The parameters to call the allowance.

Promise<Allowance>

The token allowance. If there is no active approval, the ledger MUST return { allowance = 0; expires_at = null }.

approve(params): Promise<bigint>

Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:123

This method entitles the spender to transfer token amount on behalf of the caller from account { owner = caller; subaccount = from_subaccount }.

Reference: https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-2/index.md#icrc2_approve

ApproveParams

The parameters to approve.

Promise<bigint>

If the approval fails.

balance(params): Promise<bigint>

Defined in: packages/canisters/src/ledger/icrc/canister.ts:15

Returns the balance for a given account provided as owner and with optional subaccount.

BalanceParams

The parameters to get the balance of an account.

Promise<bigint>

The balance of the given account.

IcrcCanister.balance

consentMessage(params): Promise<icrc21_consent_info>

Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:165

Fetches the consent message for a specified canister call, intended to provide a human-readable message that helps users make informed decisions.

@link: https://github.com/dfinity/wg-identity-authentication/blob/main/topics/ICRC-21/icrc_21_consent_msg.md

Icrc21ConsentMessageParams

The request parameters containing the method name, arguments, and consent preferences (e.g., language).

Promise<icrc21_consent_info>

  • A promise that resolves to the consent message response, which includes the consent message in the specified language and other related information.
  • This error is reserved for future use, in case payment extensions are introduced. For example, if consent messages, which are currently free, begin to require payments.
  • If the specified canister call is not supported.
  • If there is no consent message available.
  • For any other generic errors.

getBlocks(params): Promise<GetBlocksResult>

Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:189

Fetches the blocks information from the ledger canister,

GetBlocksParams

The parameters to get the blocks.

Promise<GetBlocksResult>

The list of blocks.

getIndexPrincipal(params): Promise<Principal>

Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:204

Returns the principal of the index canister for the ledger, if one was defined as such.

@link: https://github.com/dfinity/ICRC/blob/main/ICRCs/ICRC-106/ICRC-106.md

QueryParams

Promise<Principal>

The principal of the index canister.

  • For any errors that occur while fetching the index principal.
  • If the index principal was not set for the ledger canister.

getMintingAccount(params): Promise<Nullable<Account>>

Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:247

Returns the minting account of the Ledger canister.

@link: https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-1/index.md#icrc1_minting_account

QueryParams

Promise<Nullable<Account>>

The minting account as a Nullable object.

icrc10SupportedStandards(params): Promise<object[]>

Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:235

Returns the list of standards this ledger supports by using icrc10_supported_standards.

@link: https://github.com/dfinity/ICRC/blob/main/ICRCs/ICRC-10/ICRC-10.md#icrc10_supported_standards

QueryParams

Promise<object[]>

The list of standards.

icrc1SupportedStandards(params): Promise<StandardRecord[]>

Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:223

Returns the list of standards this ledger supports by using icrc1_supported_standards.

@link: https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-1/index.md#icrc1_supported_standards

QueryParams

Promise<StandardRecord[]>

The list of standards.

metadata(params): Promise<IcrcTokenMetadataResponse>

Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:51

The token metadata (name, symbol, etc.).

QueryParams

Promise<IcrcTokenMetadataResponse>

totalTokensSupply(params): Promise<bigint>

Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:87

Returns the total supply of tokens.

QueryParams

Promise<bigint>

transactionFee(params): Promise<bigint>

Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:59

The ledger transaction fees.

QueryParams

Promise<bigint>

The ledger transaction fees in Tokens

transfer(params): Promise<bigint>

Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:69

Transfers tokens from the sender to the given account.

TransferParams

The parameters to transfer tokens.

Promise<bigint>

If the transfer fails.

transferFrom(params): Promise<bigint>

Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:99

Transfers a token amount from the from account to the to account using the allowance of the spender’s account (SpenderAccount = { owner = caller; subaccount = spender_subaccount }). The ledger draws the fees from the from account.

Reference: https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-2/index.md#icrc2_transfer_from

TransferFromParams

The parameters to transfer tokens from to.

Promise<bigint>

If the transfer from fails.

static create(options): IcrcLedgerCanister

Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:37

IcrcLedgerCanisterOptions<_SERVICE>

IcrcLedgerCanister


Defined in: packages/canisters/src/ledger/icrc/nft-ledger.canister.ts:10

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

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

Principal

_SERVICE

_SERVICE

IcrcNftLedgerCanister

Canister<IcrcNftLedgerService>.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

collectionMetadata(params): Promise<IcrcTokenMetadataResponse>

Defined in: packages/canisters/src/ledger/icrc/nft-ledger.canister.ts:30

The collection metadata.

QueryParams

The parameters to get the metadata of the collection.

Promise<IcrcTokenMetadataResponse>

The metadata as a list of metadata type and its value.

https://github.com/dfinity/ICRC/blob/main/ICRCs/ICRC-7/ICRC-7.md#icrc7_collection_metadata

static create(options): IcrcNftLedgerCanister

Defined in: packages/canisters/src/ledger/icrc/nft-ledger.canister.ts:11

IcrcLedgerCanisterOptions<_SERVICE>

IcrcNftLedgerCanister


Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:3

  • Error

T

new IcrcTransferError<T>(__namedParameters): IcrcTransferError<T>

Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:5

T

string

IcrcTransferError<T>

Error.constructor

optional cause: unknown

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

Error.cause

errorType: T

Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:4

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/ledger/icrc/errors/index.errors.ts:1

  • Error

new IndexError(message?): IndexError

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

string

IndexError

Error.constructor

new IndexError(message?, options?): IndexError

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

string

ErrorOptions

IndexError

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/ledger/icrc/errors/ledger.errors.ts:59

  • Error

new IndexPrincipalNotSetError(message?): IndexPrincipalNotSetError

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

string

IndexPrincipalNotSetError

Error.constructor

new IndexPrincipalNotSetError(message?, options?): IndexPrincipalNotSetError

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

string

ErrorOptions

IndexPrincipalNotSetError

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/ledger/icrc/errors/ledger.errors.ts:22

new InsufficientPaymentError(message?): InsufficientPaymentError

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

string

InsufficientPaymentError

ConsentMessageError.constructor

new InsufficientPaymentError(message?, options?): InsufficientPaymentError

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

string

ErrorOptions

InsufficientPaymentError

ConsentMessageError.constructor

optional cause: unknown

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

ConsentMessageError.cause

message: string

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

ConsentMessageError.message

name: string

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

ConsentMessageError.name

optional stack: string

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

ConsentMessageError.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.

ConsentMessageError.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

ConsentMessageError.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

ConsentMessageError.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

ConsentMessageError.prepareStackTrace


Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:23

new UnsupportedCanisterCallError(message?): UnsupportedCanisterCallError

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

string

UnsupportedCanisterCallError

ConsentMessageError.constructor

new UnsupportedCanisterCallError(message?, options?): UnsupportedCanisterCallError

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

string

ErrorOptions

UnsupportedCanisterCallError

ConsentMessageError.constructor

optional cause: unknown

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

ConsentMessageError.cause

message: string

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

ConsentMessageError.message

name: string

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

ConsentMessageError.name

optional stack: string

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

ConsentMessageError.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.

ConsentMessageError.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

ConsentMessageError.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

ConsentMessageError.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

ConsentMessageError.prepareStackTrace

Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:80

Metadata for the consent message in ICRC-21 specification.

The user’s local timezone offset in minutes from UTC. If absent, the default is UTC.

BCP-47 language tag. See https://www.rfc-editor.org/rfc/bcp/bcp47.txt

language: string

Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:82

optional utcOffsetMinutes: number

Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:81


Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:103

Specification for the consent message, including metadata and device preferences.

Metadata of the consent message.

Information about the device responsible for presenting the consent message to the user.

optional deriveSpec: Icrc21ConsentMessageDeviceSpec

Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:105

metadata: Icrc21ConsentMessageMetadata

Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:104


Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:18

owner: Principal

Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:19

optional subaccount: Subaccount

Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:20


Defined in: packages/canisters/src/ledger/icrc/types/canister.options.ts:4

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

T

optional agent: Agent

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

NnsGovernanceCanisterOptions.agent

canisterId: Principal

Defined in: packages/canisters/src/ledger/icrc/types/canister.options.ts:9

optional certifiedServiceOverride: ActorSubclass<T>

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

Omit.certifiedServiceOverride

optional serviceOverride: ActorSubclass<T>

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

Omit.serviceOverride


Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:23

decimals: number

Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:27

fee: bigint

Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:26

optional icon: string

Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:28

name: string

Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:24

symbol: string

Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:25


Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:27

Params to make a transfer in an ICRC-1 ledger

The account to transfer tokens to.

The Amount of tokens to transfer.

The subaccount to transfer tokens to.

Transfer memo.

nanoseconds since unix epoc to trigger deduplication and avoid other issues See the link for more details on deduplication https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-1/index.md#transaction_deduplication

The fee of the transfer when it’s not the default fee.

amount: bigint

Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:33

optional created_at_time: bigint

Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:32

optional fee: bigint

Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:29

optional from_subaccount: Subaccount

Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:31

optional memo: Uint8Array<ArrayBufferLike>

Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:30

to: Account

Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:28

AllowanceParams = AllowanceArgs & QueryParams

Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:73

Params to get the token allowance that the spender account can transfer from the specified account


ApproveParams = Omit<TransferParams, "to"> & object

Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:64

Params for an icrc2_approve.

optional expected_allowance: Tokens

optional expires_at: Timestamp

spender: Account

The account of the spender.

The Amount of tokens to approve.

The subaccount to transfer tokens from.

Transfer memo.

nanoseconds since unix epoc to trigger deduplication and avoid other issues

The fee of the transfer when it’s not the default fee.

The optional allowance expected. If the expected_allowance field is set, the ledger MUST ensure that the current allowance for the spender from the caller’s account is equal to the given value and return the AllowanceChanged error otherwise.

When the approval expires. If the field is set, it’s greater than the current ledger time.


BalanceParams = IcrcAccount & QueryParams

Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:8

Params to get the balance of an ICRC-1 account.


GetBlocksParams = QueryParams & object

Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:125

Parameters to get the canister blocks.

args: GetBlocksArgs[]


GetIndexAccountTransactionsParams = object & QueryParams

Defined in: packages/canisters/src/ledger/icrc/types/index-ng.params.ts:5

account: IcrcAccount

max_results: bigint

optional start: BlockIndex


Icrc21ConsentMessageDeviceSpec = { GenericDisplay: null; } | { FieldsDisplay: null; }

Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:91

Device specification for displaying the consent message.

A generic display able to handle large documents and do line wrapping and pagination / scrolling. Text must be Markdown formatted, no external resources (e.g. images) are allowed.

A simple display able to handle multiple fields with a title and content.


Icrc21ConsentMessageParams = Omit<icrc21_consent_message_request, "user_preferences"> & object

Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:115

Parameters for the consent message request.

userPreferences: Icrc21ConsentMessageSpec

Method name of the canister call.

Argument of the canister call.

User preferences with regards to the consent message presented to the end-user.


IcrcTokenMetadataResponse = [string | IcrcMetadataResponseEntries, Value][]

Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:13


ListSubaccountsParams = object & Pick<IcrcAccount, "owner"> & QueryParams

Defined in: packages/canisters/src/ledger/icrc/types/index-ng.params.ts:11

optional start: Subaccount


TransferFromParams = Omit<TransferParams, "from_subaccount"> & object

Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:47

Params for an icrc2_transfer_from.

from: Account

optional spender_subaccount: Subaccount

The account to transfer tokens to.

The account to transfer tokens from.

A spender subaccount.

The Amount of tokens to transfer.

Transfer memo.

nanoseconds since unix epoc to trigger deduplication and avoid other issues

The fee of the transfer when it’s not the default fee.

decodeIcrcAccount(accountString): IcrcAccount

Defined in: packages/canisters/src/ledger/icrc/utils/ledger.utils.ts:67

Decodes a string into an Icrc-1 compatible account. Formatting Reference: https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-1/TextualEncoding.md

string

string

IcrcAccount

IcrcAccount { owner: Principal, subaccount?: Uint8Array }

Error if the string is not a valid Icrc-1 account


decodePayment(code): { amount?: number; identifier: string; token: string; } | undefined

Defined in: packages/canisters/src/ledger/icrc/utils/payment.utils.ts:26

👀 This feature is currently in draft. You can find more information about it at https://github.com/dfinity/ICRC/issues/22.

A naive implementation of a payment parser. Given a code, the function attempts to extract a token name, account identifier (textual representation), and an optional amount.

If the code doesn’t match the expected pattern, undefined is returned for simplicity. Similarly, if an optional amount is provided but it’s not a valid number, the parser will not throw an exception and returns undefined.

Please note that this function doesn’t perform any validity checks on the extracted information. It does not verify if the token is known or if the identifier is a valid address.

urn = token ":" address [ "?" params]
token = [ ckbtc / icp / chat / bitcoin / ethereum ... ]
address = STRING
params = param [ "&" params ]
param = [ amountparam ]
amountparam = "amount=" *digit [ "." *digit ]

string

string

{ amount?: number; identifier: string; token: string; } | undefined

| undefined


encodeIcrcAccount(account): string

Defined in: packages/canisters/src/ledger/icrc/utils/ledger.utils.ts:27

Encodes an Icrc-1 account compatible into a string. Formatting Reference: https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-1/TextualEncoding.md

IcrcAccount

{ owner: Principal, subaccount?: Uint8Array }

string

string


fromCandidAccount(-): IcrcAccount

Defined in: packages/canisters/src/ledger/icrc/converters/converters.ts:11

Converts a Candid Account object to an IcrcAccount, effectively transforming nullable properties into nullish ones.

-

Account

The Candid Account object to convert.

IcrcAccount

  • The converted IcrcAccount object.

mapIcrc106GetIndexPrincipalError(err): GenericError | IndexPrincipalNotSetError

Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:61

GetIndexPrincipalError

GenericError | IndexPrincipalNotSetError


mapIcrc21ConsentMessageError(rawError): ConsentMessageError

Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:26

icrc21_error

ConsentMessageError


mapTokenMetadata(response): IcrcTokenMetadata | undefined

Defined in: packages/canisters/src/ledger/icrc/utils/ledger.utils.ts:118

Maps the token metadata information from a ledger response into a structured record.

This utility processes an array of metadata key-value pairs provided by the ledger and extracts specific fields, such as symbol, name, fee, decimals, and logo. It then constructs a IcrcTokenMetadata record. If any required fields are missing, the function returns undefined.

IcrcTokenMetadataResponse

An array of key-value pairs representing token metadata.

IcrcTokenMetadata | undefined

  • A structured metadata record or undefined if required fields are missing.

toApproveArgs(__namedParameters): ApproveArgs

Defined in: packages/canisters/src/ledger/icrc/converters/ledger.converters.ts:43

ApproveParams

ApproveArgs


toCandidAccount(-): Account

Defined in: packages/canisters/src/ledger/icrc/converters/converters.ts:29

Converts an IcrcAccount to a Candid Account object, effectively transforming nullish properties into nullable ones.

IcrcAccount

The IcrcAccount object to convert.

Account

  • The converted Candid Account object.

toIcrc21ConsentMessageArgs(__namedParameters): icrc21_consent_message_request

Defined in: packages/canisters/src/ledger/icrc/converters/ledger.converters.ts:61

Icrc21ConsentMessageParams

icrc21_consent_message_request


toTransferArg(__namedParameters): TransferArg

Defined in: packages/canisters/src/ledger/icrc/converters/ledger.converters.ts:15

TransferParams

TransferArg


toTransferFromArgs(__namedParameters): TransferFromArgs

Defined in: packages/canisters/src/ledger/icrc/converters/ledger.converters.ts:29

TransferFromParams

TransferFromArgs