LedgerCanister
Defined in: packages/ledger-icp/src/ledger.canister.ts:35
Extends
Section titled “Extends”Canister<LedgerService>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”
protectednew LedgerCanister(id,service,certifiedService):LedgerCanister
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”LedgerCanister
Inherited from
Section titled “Inherited from”Canister<LedgerService>.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”accountBalance()
Section titled “accountBalance()”accountBalance(
params):Promise<bigint>
Defined in: packages/ledger-icp/src/ledger.canister.ts:64
Returns the balance of the specified account identifier.
If certified is true, the request is fetched as an update call, otherwise
it is fetched using a query call.
Parameters
Section titled “Parameters”params
Section titled “params”AccountBalanceParams
The parameters to get the balance of an account.
Returns
Section titled “Returns”Promise<bigint>
The balance of the given account.
Throws
Section titled “Throws”Error
icrc1Transfer()
Section titled “icrc1Transfer()”icrc1Transfer(
request):Promise<bigint>
Defined in: packages/ledger-icp/src/ledger.canister.ts:132
Transfer ICP from the caller to the destination Account.
Returns the index of the block containing the tx if it was successful.
Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”Promise<bigint>
Throws
Section titled “Throws”icrc21ConsentMessage()
Section titled “icrc21ConsentMessage()”icrc21ConsentMessage(
params):Promise<icrc21_consent_info>
Defined in: packages/ledger-icp/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”Icrc21ConsentMessageRequest
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.
icrc2Approve()
Section titled “icrc2Approve()”icrc2Approve(
params):Promise<bigint>
Defined in: packages/ledger-icp/src/ledger.canister.ts:152
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>
The block index of the approved transaction.
Throws
Section titled “Throws”If the approval fails.
metadata()
Section titled “metadata()”metadata(
params):Promise<[string,Value][]>
Defined in: packages/ledger-icp/src/ledger.canister.ts:83
Fetches the ledger metadata.
Parameters
Section titled “Parameters”params
Section titled “params”QueryParams
The parameters used to fetch the metadata, notably query or certified call.
Returns
Section titled “Returns”Promise<[string, Value][]>
The metadata of the ICP ledger. A promise that resolves to an array of metadata entries, where each entry is a tuple consisting of a string and a value.
transactionFee()
Section titled “transactionFee()”transactionFee(
params?):Promise<bigint>
Defined in: packages/ledger-icp/src/ledger.canister.ts:94
Returns the transaction fee of the ICP ledger canister.
Parameters
Section titled “Parameters”params?
Section titled “params?”QueryParams = ...
Optional query parameters for the request, defaulting to { certified: false } for backwards compatibility reason.
Returns
Section titled “Returns”Promise<bigint>
A promise that resolves to the transaction fee as a bigint.
transfer()
Section titled “transfer()”transfer(
request):Promise<bigint>
Defined in: packages/ledger-icp/src/ledger.canister.ts:112
Transfer ICP from the caller to the destination accountIdentifier.
Returns the index of the block containing the tx if it was successful.
Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”Promise<bigint>
Throws
Section titled “Throws”create()
Section titled “create()”
staticcreate(options):LedgerCanister
Defined in: packages/ledger-icp/src/ledger.canister.ts:36
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”LedgerCanister