UNPKG

@dfinity/ledger-icrc

Version:

A library for interfacing with ICRC ledgers on the Internet Computer.

36 lines (35 loc) 1.78 kB
import type { Principal } from "@dfinity/principal"; import { type QueryParams } from "@dfinity/utils"; import type { GetTransactions, _SERVICE as IcrcIndexNgService, Status } from "../candid/icrc_index-ng"; import { IcrcCanister } from "./canister"; import type { IcrcLedgerCanisterOptions } from "./types/canister.options"; import type { GetIndexNgAccountTransactionsParams } from "./types/index-ng.params"; export declare class IcrcIndexNgCanister extends IcrcCanister<IcrcIndexNgService> { static create(options: IcrcLedgerCanisterOptions<IcrcIndexNgService>): IcrcIndexNgCanister; /** * Get the transactions of an account * * Always certified. * `get_account_transactions` needs to be called with an update * because the index canisters makes a call to the ledger canister to get the transaction data. * Index Canister only holds the transactions ids in state, not the whole transaction data. */ /** * Get the transactions of an account. * * @param {GetAccountTransactionsParams} params The parameters to get the transactions of an account. * @returns {Promise<GetTransactions>} The list of transactions and further related information of the given account. */ getTransactions: ({ certified, ...rest }: GetIndexNgAccountTransactionsParams) => Promise<GetTransactions>; /** * Returns the ledger canister ID related to the index canister. */ ledgerId: (params: QueryParams) => Promise<Principal>; /** * Returns the status of the index canister. * * @param {QueryParams} params The parameters to get the status of the index canister. * @returns {Promise<Status>} The status of the index canister. */ status: (params: QueryParams) => Promise<Status>; }