IcrcLedgerCanister
Defined in: packages/ledger-icrc/src/ledger.canister.ts:44
Extends
Section titled “Extends”Canister<IcrcLedgerService>
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”_SERVICE
certifiedService
Section titled “certifiedService”_SERVICE
Returns
Section titled “Returns”IcrcLedgerCanister
Inherited from
Section titled “Inherited from”Canister<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”_SERVICE
Inherited from
Section titled “Inherited from”Canister.caller
certifiedService
Section titled “certifiedService”
protectedreadonlycertifiedService:_SERVICE
Defined in: packages/utils/dist/services/canister.d.ts:6
Inherited from
Section titled “Inherited from”Canister.certifiedService
service
Section titled “service”
protectedreadonlyservice:_SERVICE
Defined in: packages/utils/dist/services/canister.d.ts:5
Inherited from
Section titled “Inherited from”Canister.service
Accessors
Section titled “Accessors”canisterId
Section titled “canisterId”Get Signature
Section titled “Get Signature”get canisterId():
Principal
Defined in: packages/utils/dist/services/canister.d.ts:8
Returns
Section titled “Returns”Principal
Inherited from
Section titled “Inherited from”Canister.canisterId
Methods
Section titled “Methods”allowance()
Section titled “allowance()”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
Parameters
Section titled “Parameters”params
Section titled “params”The parameters to call the allowance.
Returns
Section titled “Returns”Promise<IcrcAllowance>
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/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
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/ledger-icrc/src/ledger.canister.ts:76
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.
consentMessage()
Section titled “consentMessage()”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.
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<IcrcGetBlocksResult>
Defined in: packages/ledger-icrc/src/ledger.canister.ts:203
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<IcrcGetBlocksResult>
The list of blocks.
getIndexPrincipal()
Section titled “getIndexPrincipal()”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
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<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
Parameters
Section titled “Parameters”params
Section titled “params”QueryParams
Returns
Section titled “Returns”Promise<Nullable<IcrcCandidAccount>>
The minting account as a Nullable object.
icrc10SupportedStandards()
Section titled “icrc10SupportedStandards()”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
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<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
Parameters
Section titled “Parameters”params
Section titled “params”QueryParams
Returns
Section titled “Returns”Promise<IcrcStandardRecord[]>
The list of standards.
metadata()
Section titled “metadata()”metadata(
params):Promise<IcrcTokenMetadataResponse>
Defined in: packages/ledger-icrc/src/ledger.canister.ts:59
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/ledger-icrc/src/ledger.canister.ts:105
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/ledger-icrc/src/ledger.canister.ts:67
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/ledger-icrc/src/ledger.canister.ts:89
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/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
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/ledger-icrc/src/ledger.canister.ts:45
Parameters
Section titled “Parameters”options
Section titled “options”IcrcLedgerCanisterOptions<_SERVICE>
Returns
Section titled “Returns”IcrcLedgerCanister