Overview
Namespaces
Section titled “Namespaces”Enumerations
Section titled “Enumerations”IcrcMetadataResponseEntries
Section titled “IcrcMetadataResponseEntries”Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:5
Enumeration Members
Section titled “Enumeration Members”DECIMALS
Section titled “DECIMALS”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
Section titled “SYMBOL”SYMBOL:
"icrc1:symbol"
Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:6
Classes
Section titled “Classes”ConsentMessageError
Section titled “ConsentMessageError”Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:20
Extends
Section titled “Extends”Error
Extended by
Section titled “Extended by”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ConsentMessageError(
message?):ConsentMessageError
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082
Parameters
Section titled “Parameters”message?
Section titled “message?”string
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Error.constructor
Constructor
Section titled “Constructor”new ConsentMessageError(
message?,options?):ConsentMessageError
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082
Parameters
Section titled “Parameters”message?
Section titled “message?”string
options?
Section titled “options?”ErrorOptions
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Error.constructor
Properties
Section titled “Properties”cause?
Section titled “cause?”
optionalcause:unknown
Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”Error.cause
message
Section titled “message”message:
string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”Error.message
name:
string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”Error.name
stack?
Section titled “stack?”
optionalstack:string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”Error.stack
stackTraceLimit
Section titled “stackTraceLimit”
staticstackTraceLimit: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.
Inherited from
Section titled “Inherited from”Error.stackTraceLimit
Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”
staticcaptureStackTrace(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();Parameters
Section titled “Parameters”targetObject
Section titled “targetObject”object
constructorOpt?
Section titled “constructorOpt?”Function
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Error.captureStackTrace
isError()
Section titled “isError()”
staticisError(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.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”error is Error
Inherited from
Section titled “Inherited from”Error.isError
prepareStackTrace()
Section titled “prepareStackTrace()”
staticprepareStackTrace(err,stackTraces):any
Defined in: node_modules/@types/node/globals.d.ts:55
Parameters
Section titled “Parameters”Error
stackTraces
Section titled “stackTraces”CallSite[]
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”Error.prepareStackTrace
ConsentMessageUnavailableError
Section titled “ConsentMessageUnavailableError”Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:24
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ConsentMessageUnavailableError(
message?):ConsentMessageUnavailableError
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082
Parameters
Section titled “Parameters”message?
Section titled “message?”string
Returns
Section titled “Returns”ConsentMessageUnavailableError
Inherited from
Section titled “Inherited from”ConsentMessageError.constructor
Constructor
Section titled “Constructor”new ConsentMessageUnavailableError(
message?,options?):ConsentMessageUnavailableError
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082
Parameters
Section titled “Parameters”message?
Section titled “message?”string
options?
Section titled “options?”ErrorOptions
Returns
Section titled “Returns”ConsentMessageUnavailableError
Inherited from
Section titled “Inherited from”ConsentMessageError.constructor
Properties
Section titled “Properties”cause?
Section titled “cause?”
optionalcause:unknown
Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”message
Section titled “message”message:
string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”name:
string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”stack?
Section titled “stack?”
optionalstack:string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”stackTraceLimit
Section titled “stackTraceLimit”
staticstackTraceLimit: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.
Inherited from
Section titled “Inherited from”ConsentMessageError.stackTraceLimit
Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”
staticcaptureStackTrace(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();Parameters
Section titled “Parameters”targetObject
Section titled “targetObject”object
constructorOpt?
Section titled “constructorOpt?”Function
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”ConsentMessageError.captureStackTrace
isError()
Section titled “isError()”
staticisError(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.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”error is Error
Inherited from
Section titled “Inherited from”prepareStackTrace()
Section titled “prepareStackTrace()”
staticprepareStackTrace(err,stackTraces):any
Defined in: node_modules/@types/node/globals.d.ts:55
Parameters
Section titled “Parameters”Error
stackTraces
Section titled “stackTraces”CallSite[]
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”ConsentMessageError.prepareStackTrace
GenericError
Section titled “GenericError”Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:11
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new GenericError(
message,error_code):GenericError
Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:12
Parameters
Section titled “Parameters”message
Section titled “message”string
error_code
Section titled “error_code”bigint
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructor
Properties
Section titled “Properties”cause?
Section titled “cause?”
optionalcause:unknown
Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”Error.cause
error_code
Section titled “error_code”
readonlyerror_code:bigint
Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:14
message
Section titled “message”
readonlymessage:string
Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:13
Inherited from
Section titled “Inherited from”Error.message
name:
string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”Error.name
stack?
Section titled “stack?”
optionalstack:string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”Error.stack
stackTraceLimit
Section titled “stackTraceLimit”
staticstackTraceLimit: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.
Inherited from
Section titled “Inherited from”Error.stackTraceLimit
Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”
staticcaptureStackTrace(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();Parameters
Section titled “Parameters”targetObject
Section titled “targetObject”object
constructorOpt?
Section titled “constructorOpt?”Function
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Error.captureStackTrace
isError()
Section titled “isError()”
staticisError(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.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”error is Error
Inherited from
Section titled “Inherited from”Error.isError
prepareStackTrace()
Section titled “prepareStackTrace()”
staticprepareStackTrace(err,stackTraces):any
Defined in: node_modules/@types/node/globals.d.ts:55
Parameters
Section titled “Parameters”Error
stackTraces
Section titled “stackTraces”CallSite[]
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”Error.prepareStackTrace
IcrcIndexCanister
Section titled “IcrcIndexCanister”Defined in: packages/canisters/src/ledger/icrc/index.canister.ts:21
Extends
Section titled “Extends”IcrcCanister<_SERVICE>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”
protectednew IcrcIndexCanister(id,service,certifiedService):IcrcIndexCanister
Defined in: packages/utils/dist/services/canister.d.ts:7
Parameters
Section titled “Parameters”Principal
service
Section titled “service”certifiedService
Section titled “certifiedService”Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”IcrcCanister<IcrcIndexService>.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”Inherited from
Section titled “Inherited from”IcrcCanister.caller
certifiedService
Section titled “certifiedService”
protectedreadonlycertifiedService:_SERVICE
Defined in: packages/utils/dist/services/canister.d.ts:6
Inherited from
Section titled “Inherited from”IcrcCanister.certifiedService
service
Section titled “service”
protectedreadonlyservice:_SERVICE
Defined in: packages/utils/dist/services/canister.d.ts:5
Inherited from
Section titled “Inherited from”IcrcCanister.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”IcrcCanister.canisterId
Methods
Section titled “Methods”balance()
Section titled “balance()”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.
Parameters
Section titled “Parameters”params
Section titled “params”The parameters to get the balance of an account.
Returns
Section titled “Returns”Promise<bigint>
The balance of the given account.
Inherited from
Section titled “Inherited from”IcrcCanister.balance
getTransactions()
Section titled “getTransactions()”getTransactions(
params):Promise<GetTransactions>
Defined in: packages/canisters/src/ledger/icrc/index.canister.ts:47
Get the transactions of an account.
Parameters
Section titled “Parameters”params
Section titled “params”GetIndexAccountTransactionsParams
The parameters to get the transactions of an account.
Returns
Section titled “Returns”Promise<GetTransactions>
The list of transactions and further related information of the given account.
ledgerId()
Section titled “ledgerId()”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.
Parameters
Section titled “Parameters”params
Section titled “params”QueryParams
Returns
Section titled “Returns”Promise<Principal>
listSubaccounts()
Section titled “listSubaccounts()”listSubaccounts(
params):Promise<SubAccount[]>
Defined in: packages/canisters/src/ledger/icrc/index.canister.ts:85
Returns the list of subaccounts for a given owner.
Parameters
Section titled “Parameters”params
Section titled “params”The parameters to get the list of subaccounts.
Returns
Section titled “Returns”Promise<SubAccount[]>
The list of subaccounts.
status()
Section titled “status()”status(
params):Promise<Status>
Defined in: packages/canisters/src/ledger/icrc/index.canister.ts:76
Returns the status of the index canister.
Parameters
Section titled “Parameters”params
Section titled “params”QueryParams
The parameters to get the status of the index canister.
Returns
Section titled “Returns”Promise<Status>
The status of the index canister.
create()
Section titled “create()”
staticcreate(options):IcrcIndexCanister
Defined in: packages/canisters/src/ledger/icrc/index.canister.ts:22
Parameters
Section titled “Parameters”options
Section titled “options”IcrcLedgerCanisterOptions<_SERVICE>
Returns
Section titled “Returns”IcrcLedgerCanister
Section titled “IcrcLedgerCanister”Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:36
Extends
Section titled “Extends”IcrcCanister<_SERVICE>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”
protectednew IcrcLedgerCanister(id,service,certifiedService):IcrcLedgerCanister
Defined in: packages/utils/dist/services/canister.d.ts:7
Parameters
Section titled “Parameters”Principal
service
Section titled “service”certifiedService
Section titled “certifiedService”Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”IcrcCanister<IcrcLedgerService>.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”Inherited from
Section titled “Inherited from”IcrcCanister.caller
certifiedService
Section titled “certifiedService”
protectedreadonlycertifiedService:_SERVICE
Defined in: packages/utils/dist/services/canister.d.ts:6
Inherited from
Section titled “Inherited from”IcrcCanister.certifiedService
service
Section titled “service”
protectedreadonlyservice:_SERVICE
Defined in: packages/utils/dist/services/canister.d.ts:5
Inherited from
Section titled “Inherited from”IcrcCanister.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”IcrcCanister.canisterId
Methods
Section titled “Methods”allowance()
Section titled “allowance()”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
Parameters
Section titled “Parameters”params
Section titled “params”The parameters to call the allowance.
Returns
Section titled “Returns”Promise<Allowance>
The token allowance. If there is no active approval, the ledger MUST return { allowance = 0; expires_at = null }.
approve()
Section titled “approve()”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
Parameters
Section titled “Parameters”params
Section titled “params”The parameters to approve.
Returns
Section titled “Returns”Promise<bigint>
Throws
Section titled “Throws”If the approval fails.
balance()
Section titled “balance()”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.
Parameters
Section titled “Parameters”params
Section titled “params”The parameters to get the balance of an account.
Returns
Section titled “Returns”Promise<bigint>
The balance of the given account.
Inherited from
Section titled “Inherited from”IcrcCanister.balance
consentMessage()
Section titled “consentMessage()”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.
Parameters
Section titled “Parameters”params
Section titled “params”The request parameters containing the method name, arguments, and consent preferences (e.g., language).
Returns
Section titled “Returns”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.
Throws
Section titled “Throws”- 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.
Throws
Section titled “Throws”- If the specified canister call is not supported.
Throws
Section titled “Throws”- If there is no consent message available.
Throws
Section titled “Throws”- For any other generic errors.
getBlocks()
Section titled “getBlocks()”getBlocks(
params):Promise<GetBlocksResult>
Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:189
Fetches the blocks information from the ledger canister,
Parameters
Section titled “Parameters”params
Section titled “params”The parameters to get the blocks.
Returns
Section titled “Returns”Promise<GetBlocksResult>
The list of blocks.
getIndexPrincipal()
Section titled “getIndexPrincipal()”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
Parameters
Section titled “Parameters”params
Section titled “params”QueryParams
Returns
Section titled “Returns”Promise<Principal>
The principal of the index canister.
Throws
Section titled “Throws”- For any errors that occur while fetching the index principal.
Throws
Section titled “Throws”- If the index principal was not set for the ledger canister.
getMintingAccount()
Section titled “getMintingAccount()”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
Parameters
Section titled “Parameters”params
Section titled “params”QueryParams
Returns
Section titled “Returns”Promise<Nullable<Account>>
The minting account as a Nullable object.
icrc10SupportedStandards()
Section titled “icrc10SupportedStandards()”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
Parameters
Section titled “Parameters”params
Section titled “params”QueryParams
Returns
Section titled “Returns”Promise<object[]>
The list of standards.
icrc1SupportedStandards()
Section titled “icrc1SupportedStandards()”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
Parameters
Section titled “Parameters”params
Section titled “params”QueryParams
Returns
Section titled “Returns”Promise<StandardRecord[]>
The list of standards.
metadata()
Section titled “metadata()”metadata(
params):Promise<IcrcTokenMetadataResponse>
Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:51
The token metadata (name, symbol, etc.).
Parameters
Section titled “Parameters”params
Section titled “params”QueryParams
Returns
Section titled “Returns”Promise<IcrcTokenMetadataResponse>
totalTokensSupply()
Section titled “totalTokensSupply()”totalTokensSupply(
params):Promise<bigint>
Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:87
Returns the total supply of tokens.
Parameters
Section titled “Parameters”params
Section titled “params”QueryParams
Returns
Section titled “Returns”Promise<bigint>
transactionFee()
Section titled “transactionFee()”transactionFee(
params):Promise<bigint>
Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:59
The ledger transaction fees.
Parameters
Section titled “Parameters”params
Section titled “params”QueryParams
Returns
Section titled “Returns”Promise<bigint>
The ledger transaction fees in Tokens
transfer()
Section titled “transfer()”transfer(
params):Promise<bigint>
Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:69
Transfers tokens from the sender to the given account.
Parameters
Section titled “Parameters”params
Section titled “params”The parameters to transfer tokens.
Returns
Section titled “Returns”Promise<bigint>
Throws
Section titled “Throws”If the transfer fails.
transferFrom()
Section titled “transferFrom()”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
Parameters
Section titled “Parameters”params
Section titled “params”The parameters to transfer tokens from to.
Returns
Section titled “Returns”Promise<bigint>
Throws
Section titled “Throws”If the transfer from fails.
create()
Section titled “create()”
staticcreate(options):IcrcLedgerCanister
Defined in: packages/canisters/src/ledger/icrc/ledger.canister.ts:37
Parameters
Section titled “Parameters”options
Section titled “options”IcrcLedgerCanisterOptions<_SERVICE>
Returns
Section titled “Returns”IcrcNftLedgerCanister
Section titled “IcrcNftLedgerCanister”Defined in: packages/canisters/src/ledger/icrc/nft-ledger.canister.ts:10
Extends
Section titled “Extends”Canister<_SERVICE>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”
protectednew IcrcNftLedgerCanister(id,service,certifiedService):IcrcNftLedgerCanister
Defined in: packages/utils/dist/services/canister.d.ts:7
Parameters
Section titled “Parameters”Principal
service
Section titled “service”certifiedService
Section titled “certifiedService”Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Canister<IcrcNftLedgerService>.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”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”collectionMetadata()
Section titled “collectionMetadata()”collectionMetadata(
params):Promise<IcrcTokenMetadataResponse>
Defined in: packages/canisters/src/ledger/icrc/nft-ledger.canister.ts:30
The collection metadata.
Parameters
Section titled “Parameters”params
Section titled “params”QueryParams
The parameters to get the metadata of the collection.
Returns
Section titled “Returns”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
create()
Section titled “create()”
staticcreate(options):IcrcNftLedgerCanister
Defined in: packages/canisters/src/ledger/icrc/nft-ledger.canister.ts:11
Parameters
Section titled “Parameters”options
Section titled “options”IcrcLedgerCanisterOptions<_SERVICE>
Returns
Section titled “Returns”IcrcTransferError
Section titled “IcrcTransferError”Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:3
Extends
Section titled “Extends”Error
Type Parameters
Section titled “Type Parameters”T
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new IcrcTransferError<
T>(__namedParameters):IcrcTransferError<T>
Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:5
Parameters
Section titled “Parameters”__namedParameters
Section titled “__namedParameters”errorType
Section titled “errorType”T
string
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructor
Properties
Section titled “Properties”cause?
Section titled “cause?”
optionalcause:unknown
Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”Error.cause
errorType
Section titled “errorType”errorType:
T
Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:4
message
Section titled “message”message:
string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”Error.message
name:
string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”Error.name
stack?
Section titled “stack?”
optionalstack:string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”Error.stack
stackTraceLimit
Section titled “stackTraceLimit”
staticstackTraceLimit: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.
Inherited from
Section titled “Inherited from”Error.stackTraceLimit
Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”
staticcaptureStackTrace(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();Parameters
Section titled “Parameters”targetObject
Section titled “targetObject”object
constructorOpt?
Section titled “constructorOpt?”Function
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Error.captureStackTrace
isError()
Section titled “isError()”
staticisError(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.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”error is Error
Inherited from
Section titled “Inherited from”Error.isError
prepareStackTrace()
Section titled “prepareStackTrace()”
staticprepareStackTrace(err,stackTraces):any
Defined in: node_modules/@types/node/globals.d.ts:55
Parameters
Section titled “Parameters”Error
stackTraces
Section titled “stackTraces”CallSite[]
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”Error.prepareStackTrace
IndexError
Section titled “IndexError”Defined in: packages/canisters/src/ledger/icrc/errors/index.errors.ts:1
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new IndexError(
message?):IndexError
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082
Parameters
Section titled “Parameters”message?
Section titled “message?”string
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Error.constructor
Constructor
Section titled “Constructor”new IndexError(
message?,options?):IndexError
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082
Parameters
Section titled “Parameters”message?
Section titled “message?”string
options?
Section titled “options?”ErrorOptions
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Error.constructor
Properties
Section titled “Properties”cause?
Section titled “cause?”
optionalcause:unknown
Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”Error.cause
message
Section titled “message”message:
string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”Error.message
name:
string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”Error.name
stack?
Section titled “stack?”
optionalstack:string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”Error.stack
stackTraceLimit
Section titled “stackTraceLimit”
staticstackTraceLimit: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.
Inherited from
Section titled “Inherited from”Error.stackTraceLimit
Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”
staticcaptureStackTrace(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();Parameters
Section titled “Parameters”targetObject
Section titled “targetObject”object
constructorOpt?
Section titled “constructorOpt?”Function
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Error.captureStackTrace
isError()
Section titled “isError()”
staticisError(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.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”error is Error
Inherited from
Section titled “Inherited from”Error.isError
prepareStackTrace()
Section titled “prepareStackTrace()”
staticprepareStackTrace(err,stackTraces):any
Defined in: node_modules/@types/node/globals.d.ts:55
Parameters
Section titled “Parameters”Error
stackTraces
Section titled “stackTraces”CallSite[]
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”Error.prepareStackTrace
IndexPrincipalNotSetError
Section titled “IndexPrincipalNotSetError”Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:59
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new IndexPrincipalNotSetError(
message?):IndexPrincipalNotSetError
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082
Parameters
Section titled “Parameters”message?
Section titled “message?”string
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Error.constructor
Constructor
Section titled “Constructor”new IndexPrincipalNotSetError(
message?,options?):IndexPrincipalNotSetError
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082
Parameters
Section titled “Parameters”message?
Section titled “message?”string
options?
Section titled “options?”ErrorOptions
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Error.constructor
Properties
Section titled “Properties”cause?
Section titled “cause?”
optionalcause:unknown
Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”Error.cause
message
Section titled “message”message:
string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”Error.message
name:
string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”Error.name
stack?
Section titled “stack?”
optionalstack:string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”Error.stack
stackTraceLimit
Section titled “stackTraceLimit”
staticstackTraceLimit: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.
Inherited from
Section titled “Inherited from”Error.stackTraceLimit
Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”
staticcaptureStackTrace(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();Parameters
Section titled “Parameters”targetObject
Section titled “targetObject”object
constructorOpt?
Section titled “constructorOpt?”Function
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Error.captureStackTrace
isError()
Section titled “isError()”
staticisError(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.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”error is Error
Inherited from
Section titled “Inherited from”Error.isError
prepareStackTrace()
Section titled “prepareStackTrace()”
staticprepareStackTrace(err,stackTraces):any
Defined in: node_modules/@types/node/globals.d.ts:55
Parameters
Section titled “Parameters”Error
stackTraces
Section titled “stackTraces”CallSite[]
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”Error.prepareStackTrace
InsufficientPaymentError
Section titled “InsufficientPaymentError”Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:22
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InsufficientPaymentError(
message?):InsufficientPaymentError
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082
Parameters
Section titled “Parameters”message?
Section titled “message?”string
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”ConsentMessageError.constructor
Constructor
Section titled “Constructor”new InsufficientPaymentError(
message?,options?):InsufficientPaymentError
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082
Parameters
Section titled “Parameters”message?
Section titled “message?”string
options?
Section titled “options?”ErrorOptions
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”ConsentMessageError.constructor
Properties
Section titled “Properties”cause?
Section titled “cause?”
optionalcause:unknown
Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”message
Section titled “message”message:
string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”name:
string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”stack?
Section titled “stack?”
optionalstack:string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”stackTraceLimit
Section titled “stackTraceLimit”
staticstackTraceLimit: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.
Inherited from
Section titled “Inherited from”ConsentMessageError.stackTraceLimit
Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”
staticcaptureStackTrace(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();Parameters
Section titled “Parameters”targetObject
Section titled “targetObject”object
constructorOpt?
Section titled “constructorOpt?”Function
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”ConsentMessageError.captureStackTrace
isError()
Section titled “isError()”
staticisError(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.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”error is Error
Inherited from
Section titled “Inherited from”prepareStackTrace()
Section titled “prepareStackTrace()”
staticprepareStackTrace(err,stackTraces):any
Defined in: node_modules/@types/node/globals.d.ts:55
Parameters
Section titled “Parameters”Error
stackTraces
Section titled “stackTraces”CallSite[]
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”ConsentMessageError.prepareStackTrace
UnsupportedCanisterCallError
Section titled “UnsupportedCanisterCallError”Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:23
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new UnsupportedCanisterCallError(
message?):UnsupportedCanisterCallError
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082
Parameters
Section titled “Parameters”message?
Section titled “message?”string
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”ConsentMessageError.constructor
Constructor
Section titled “Constructor”new UnsupportedCanisterCallError(
message?,options?):UnsupportedCanisterCallError
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1082
Parameters
Section titled “Parameters”message?
Section titled “message?”string
options?
Section titled “options?”ErrorOptions
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”ConsentMessageError.constructor
Properties
Section titled “Properties”cause?
Section titled “cause?”
optionalcause:unknown
Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”message
Section titled “message”message:
string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”name:
string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”stack?
Section titled “stack?”
optionalstack:string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”stackTraceLimit
Section titled “stackTraceLimit”
staticstackTraceLimit: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.
Inherited from
Section titled “Inherited from”ConsentMessageError.stackTraceLimit
Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”
staticcaptureStackTrace(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();Parameters
Section titled “Parameters”targetObject
Section titled “targetObject”object
constructorOpt?
Section titled “constructorOpt?”Function
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”ConsentMessageError.captureStackTrace
isError()
Section titled “isError()”
staticisError(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.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”error is Error
Inherited from
Section titled “Inherited from”prepareStackTrace()
Section titled “prepareStackTrace()”
staticprepareStackTrace(err,stackTraces):any
Defined in: node_modules/@types/node/globals.d.ts:55
Parameters
Section titled “Parameters”Error
stackTraces
Section titled “stackTraces”CallSite[]
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”ConsentMessageError.prepareStackTrace
Interfaces
Section titled “Interfaces”Icrc21ConsentMessageMetadata
Section titled “Icrc21ConsentMessageMetadata”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
Properties
Section titled “Properties”language
Section titled “language”language:
string
Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:82
utcOffsetMinutes?
Section titled “utcOffsetMinutes?”
optionalutcOffsetMinutes:number
Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:81
Icrc21ConsentMessageSpec
Section titled “Icrc21ConsentMessageSpec”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.
Properties
Section titled “Properties”deriveSpec?
Section titled “deriveSpec?”
optionalderiveSpec:Icrc21ConsentMessageDeviceSpec
Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:105
metadata
Section titled “metadata”metadata:
Icrc21ConsentMessageMetadata
Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:104
IcrcAccount
Section titled “IcrcAccount”Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:18
Properties
Section titled “Properties”owner:
Principal
Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:19
subaccount?
Section titled “subaccount?”
optionalsubaccount:Subaccount
Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:20
IcrcLedgerCanisterOptions
Section titled “IcrcLedgerCanisterOptions”Defined in: packages/canisters/src/ledger/icrc/types/canister.options.ts:4
Extends
Section titled “Extends”Omit<CanisterOptions<T>,"canisterId">
Type Parameters
Section titled “Type Parameters”T
Properties
Section titled “Properties”agent?
Section titled “agent?”
optionalagent:Agent
Defined in: packages/utils/dist/types/canister.options.d.ts:4
Inherited from
Section titled “Inherited from”NnsGovernanceCanisterOptions.agent
canisterId
Section titled “canisterId”canisterId:
Principal
Defined in: packages/canisters/src/ledger/icrc/types/canister.options.ts:9
certifiedServiceOverride?
Section titled “certifiedServiceOverride?”
optionalcertifiedServiceOverride:ActorSubclass<T>
Defined in: packages/utils/dist/types/canister.options.d.ts:7
Inherited from
Section titled “Inherited from”Omit.certifiedServiceOverride
serviceOverride?
Section titled “serviceOverride?”
optionalserviceOverride:ActorSubclass<T>
Defined in: packages/utils/dist/types/canister.options.d.ts:6
Inherited from
Section titled “Inherited from”Omit.serviceOverride
IcrcTokenMetadata
Section titled “IcrcTokenMetadata”Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:23
Properties
Section titled “Properties”decimals
Section titled “decimals”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
optionalicon: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
Section titled “symbol”symbol:
string
Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:25
TransferParams
Section titled “TransferParams”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.
Properties
Section titled “Properties”amount
Section titled “amount”amount:
bigint
Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:33
created_at_time?
Section titled “created_at_time?”
optionalcreated_at_time:bigint
Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:32
optionalfee:bigint
Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:29
from_subaccount?
Section titled “from_subaccount?”
optionalfrom_subaccount:Subaccount
Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:31
optionalmemo: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
Type Aliases
Section titled “Type Aliases”AllowanceParams
Section titled “AllowanceParams”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
Section titled “ApproveParams”ApproveParams =
Omit<TransferParams,"to"> &object
Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:64
Params for an icrc2_approve.
Type Declaration
Section titled “Type Declaration”expected_allowance?
Section titled “expected_allowance?”
optionalexpected_allowance:Tokens
expires_at?
Section titled “expires_at?”
optionalexpires_at:Timestamp
spender
Section titled “spender”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
Section titled “BalanceParams”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
Section titled “GetBlocksParams”GetBlocksParams =
QueryParams&object
Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:125
Parameters to get the canister blocks.
Type Declaration
Section titled “Type Declaration”args:
GetBlocksArgs[]
GetIndexAccountTransactionsParams
Section titled “GetIndexAccountTransactionsParams”GetIndexAccountTransactionsParams =
object&QueryParams
Defined in: packages/canisters/src/ledger/icrc/types/index-ng.params.ts:5
Type Declaration
Section titled “Type Declaration”account
Section titled “account”account:
IcrcAccount
max_results
Section titled “max_results”max_results:
bigint
start?
Section titled “start?”
optionalstart:BlockIndex
Icrc21ConsentMessageDeviceSpec
Section titled “Icrc21ConsentMessageDeviceSpec”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
Section titled “Icrc21ConsentMessageParams”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.
Type Declaration
Section titled “Type Declaration”userPreferences
Section titled “userPreferences”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
Section titled “IcrcTokenMetadataResponse”IcrcTokenMetadataResponse = [
string|IcrcMetadataResponseEntries,Value][]
Defined in: packages/canisters/src/ledger/icrc/types/ledger.responses.ts:13
ListSubaccountsParams
Section titled “ListSubaccountsParams”ListSubaccountsParams =
object&Pick<IcrcAccount,"owner"> &QueryParams
Defined in: packages/canisters/src/ledger/icrc/types/index-ng.params.ts:11
Type Declaration
Section titled “Type Declaration”start?
Section titled “start?”
optionalstart:Subaccount
TransferFromParams
Section titled “TransferFromParams”TransferFromParams =
Omit<TransferParams,"from_subaccount"> &object
Defined in: packages/canisters/src/ledger/icrc/types/ledger.params.ts:47
Params for an icrc2_transfer_from.
Type Declaration
Section titled “Type Declaration”from:
Account
spender_subaccount?
Section titled “spender_subaccount?”
optionalspender_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.
Functions
Section titled “Functions”decodeIcrcAccount()
Section titled “decodeIcrcAccount()”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
Parameters
Section titled “Parameters”accountString
Section titled “accountString”string
string
Returns
Section titled “Returns”IcrcAccount { owner: Principal, subaccount?: Uint8Array }
Throws
Section titled “Throws”Error if the string is not a valid Icrc-1 account
decodePayment()
Section titled “decodePayment()”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 = STRINGparams = param [ "&" params ]param = [ amountparam ]amountparam = "amount=" *digit [ "." *digit ]Parameters
Section titled “Parameters”string
string
Returns
Section titled “Returns”{ amount?: number; identifier: string; token: string; } | undefined
| undefined
encodeIcrcAccount()
Section titled “encodeIcrcAccount()”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
Parameters
Section titled “Parameters”account
Section titled “account”{ owner: Principal, subaccount?: Uint8Array }
Returns
Section titled “Returns”string
string
fromCandidAccount()
Section titled “fromCandidAccount()”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.
Parameters
Section titled “Parameters”-
The Candid Account object to convert.
Returns
Section titled “Returns”- The converted IcrcAccount object.
mapIcrc106GetIndexPrincipalError()
Section titled “mapIcrc106GetIndexPrincipalError()”mapIcrc106GetIndexPrincipalError(
err):GenericError|IndexPrincipalNotSetError
Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:61
Parameters
Section titled “Parameters”Returns
Section titled “Returns”GenericError | IndexPrincipalNotSetError
mapIcrc21ConsentMessageError()
Section titled “mapIcrc21ConsentMessageError()”mapIcrc21ConsentMessageError(
rawError):ConsentMessageError
Defined in: packages/canisters/src/ledger/icrc/errors/ledger.errors.ts:26
Parameters
Section titled “Parameters”rawError
Section titled “rawError”Returns
Section titled “Returns”mapTokenMetadata()
Section titled “mapTokenMetadata()”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.
Parameters
Section titled “Parameters”response
Section titled “response”An array of key-value pairs representing token metadata.
Returns
Section titled “Returns”IcrcTokenMetadata | undefined
- A structured metadata record or
undefinedif required fields are missing.
toApproveArgs()
Section titled “toApproveArgs()”toApproveArgs(
__namedParameters):ApproveArgs
Defined in: packages/canisters/src/ledger/icrc/converters/ledger.converters.ts:43
Parameters
Section titled “Parameters”__namedParameters
Section titled “__namedParameters”Returns
Section titled “Returns”toCandidAccount()
Section titled “toCandidAccount()”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.
Parameters
Section titled “Parameters”The IcrcAccount object to convert.
Returns
Section titled “Returns”- The converted Candid Account object.
toIcrc21ConsentMessageArgs()
Section titled “toIcrc21ConsentMessageArgs()”toIcrc21ConsentMessageArgs(
__namedParameters):icrc21_consent_message_request
Defined in: packages/canisters/src/ledger/icrc/converters/ledger.converters.ts:61
Parameters
Section titled “Parameters”__namedParameters
Section titled “__namedParameters”Returns
Section titled “Returns”icrc21_consent_message_request
toTransferArg()
Section titled “toTransferArg()”toTransferArg(
__namedParameters):TransferArg
Defined in: packages/canisters/src/ledger/icrc/converters/ledger.converters.ts:15
Parameters
Section titled “Parameters”__namedParameters
Section titled “__namedParameters”Returns
Section titled “Returns”toTransferFromArgs()
Section titled “toTransferFromArgs()”toTransferFromArgs(
__namedParameters):TransferFromArgs
Defined in: packages/canisters/src/ledger/icrc/converters/ledger.converters.ts:29