import { TableItemRequest, LedgerVersionArg } from '../types/index.mjs'; import { EndlessConfig } from './endlessConfig.mjs'; import '../utils/apiEndpoints.mjs'; import '../types/indexer.mjs'; import '../utils/const.mjs'; /** * A class to query all `Table` Endless related queries */ declare class Table { readonly config: EndlessConfig; constructor(config: EndlessConfig); /** * Queries for a table item for a table identified by the handle and the key for the item. * Key and value types need to be passed in to help with key serialization and value deserialization. * * Note, this query calls the fullnode server * * @example https://api.devnet.endlesslabs.com/v1/accounts/0x1/resource/0x1::coin::CoinInfo%3C0x1::endless_coin::EndlessCoin%3E * const tableItem = await endless.getTableItem({ * handle: "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca", * data: { * key_type: "address", // Move type of table key * value_type: "u128", // Move type of table value * key: "0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935" // Value of table key * }, * }) * * @param args.handle A pointer to where that table is stored * @param args.data Object that describes table item * @param args.options.ledgerVersion The ledger version to query, if not provided it will get the latest version * * @returns Table item value rendered in JSON */ getTableItem(args: { handle: string; data: TableItemRequest; options?: LedgerVersionArg; }): Promise; } export { Table };