Skip to content

IcrcLedgerCanister

Defined in: packages/ledger-icrc/src/ledger.canister.ts:44

  • Canister<IcrcLedgerService>

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

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

Principal

_SERVICE

_SERVICE

IcrcLedgerCanister

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

allowance(params): Promise<IcrcAllowance>

Defined in: packages/ledger-icrc/src/ledger.canister.ts:161

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<IcrcAllowance>

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/ledger-icrc/src/ledger.canister.ts:139

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/ledger-icrc/src/ledger.canister.ts:76

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.


consentMessage(params): Promise<icrc21_consent_info>

Defined in: packages/ledger-icrc/src/ledger.canister.ts:179

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<IcrcGetBlocksResult>

Defined in: packages/ledger-icrc/src/ledger.canister.ts:203

Fetches the blocks information from the ledger canister,

GetBlocksParams

The parameters to get the blocks.

Promise<IcrcGetBlocksResult>

The list of blocks.


getIndexPrincipal(params): Promise<Principal>

Defined in: packages/ledger-icrc/src/ledger.canister.ts:216

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<IcrcCandidAccount>>

Defined in: packages/ledger-icrc/src/ledger.canister.ts:257

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<IcrcCandidAccount>>

The minting account as a Nullable object.


icrc10SupportedStandards(params): Promise<object[]>

Defined in: packages/ledger-icrc/src/ledger.canister.ts:245

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<IcrcStandardRecord[]>

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

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<IcrcStandardRecord[]>

The list of standards.


metadata(params): Promise<IcrcTokenMetadataResponse>

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

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

QueryParams

Promise<IcrcTokenMetadataResponse>


totalTokensSupply(params): Promise<bigint>

Defined in: packages/ledger-icrc/src/ledger.canister.ts:105

Returns the total supply of tokens.

QueryParams

Promise<bigint>


transactionFee(params): Promise<bigint>

Defined in: packages/ledger-icrc/src/ledger.canister.ts:67

The ledger transaction fees.

QueryParams

Promise<bigint>

The ledger transaction fees in Tokens


transfer(params): Promise<bigint>

Defined in: packages/ledger-icrc/src/ledger.canister.ts:89

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/ledger-icrc/src/ledger.canister.ts:117

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/ledger-icrc/src/ledger.canister.ts:45

IcrcLedgerCanisterOptions<_SERVICE>

IcrcLedgerCanister