import { GetAccount, GetBalances, GetKeyAccounts, GetNetworks, GetTopHolders, GetTopRam, GetTopStake, GetCodehash, GetAccountInfo } from "./types/api"; /** * JsonRpc * * @param {string} endpoint LIGHT API endpoint * @example * * const rpc = new JsonRpc("proton") */ export declare class JsonRpc { endpoint: string; chain: string; timeout: number; wsRequestId: number; constructor(chain: string, args?: { endpoint?: string; timeout?: number; }); /** * get * * GET `params` to `endpoint + path`. * Throws detailed error information in `RpcError` when available. * * @private */ get(path: string, endpoint?: string): Promise; /** * [GET /api/account] * * Retrieve all token balances, resources and authorization information for an account: * * @param {string} accountName name of account * @returns {Promise} account */ get_account(accountName: string): Promise; /** * [GET /api/accinfo] * * Retrieve all resources and authorization information for an account: * * @param {string} accountName name of account * @returns {Promise} account */ get_account_info(accountName: string): Promise; /** * [GET /api/balances] * * Retrieve only token balances for an account * * @param {string} accountName name of account * @returns {Promise} balances */ get_balances(accountName: string): Promise; /** * [GET /api/key] * * Retrieve all accounts in all known EOS networks dependent on a public key: * * @param {string} key public key * @returns {Promise} accounts per network */ get_all_key_accounts(key: string): Promise; /** * [GET /api/key] * * Retrieve all accounts in network * * @param {string} key public key * @returns {Promise} accounts */ get_key_accounts(key: string): Promise; /** * [GET /api/networks] * * Retrieve all accounts in all known EOS networks dependent on a public key: * * @returns {Promise} accounts */ get_networks(): Promise; /** * [GET /api/sync] * * returns a plain text with delay in seconds that this server's blockchain database is behind the real time, and a status: OK if the delay is within 180 seconds, or 'OUT_OF_SYNC' otherwise. * * @returns {Promise} get sync */ get_sync_info(): Promise; /** * [GET /api/tokenbalance] * * returns a plain text with numeric output indicating the token balance. Zero is returned if the token is not present or does not exist. * * @param {string} account owner of token * @param {string} contract token contract * @param {string} token token symbol * @returns {Promise} token balance */ get_token_balance(account: string, contract: string, token: string): Promise; /** * [GET /api/topholders] * * returns top NUM holders of a specified token in a JSON array containing arrays of (account, amount) pairs. NUM must not be less than 10 or more than 1000. * * @param {string} contract token contract * @param {string} token token symbol * @param {string} num number of top holders (min 10, max 1000) * * @returns {Promise} token balance */ get_topholders(contract: string, token: string, num: number): Promise; /** * [GET /api/usercount] * * returns a plain text with total number of accounts in the network. * * @returns {Promise} token balance */ get_usercount(): Promise; /** * [GET /api/topram] * * returns top NUM RAM buyers in a JSON array containing arrays of (account, bytes) pairs. NUM must not be less than 10 or more than 1000. * * @param {string} num number of top holders (min 10, max 1000) * * @returns {Promise} top ram holders */ get_topram(num: number): Promise; /** * [GET /api/topstake] * * returns top NUM RAM buyers in a JSON array containing arrays of (account, bytes) pairs. NUM must not be less than 10 or more than 1000. * * @param {string} num returns top NUM stake holders by sum of CPU and Net stakes, in a JSON array containing arrays of (account, cpu_weight, net_weight) tuples. NUM must not be less than 10 or more than 1000. * * @returns {Promise} top stake holders */ get_topstake(num: number): Promise; /** * [GET /api/codehash] * * retrieves all accounts in all known EOS networks by contract hash. * * @param {string} num returns top NUM stake holders by sum of CPU and Net stakes, in a JSON array containing arrays of (account, cpu_weight, net_weight) tuples. NUM must not be less than 10 or more than 1000. * * @returns {Promise} accounts */ get_codehash(hash: string): Promise; /** * [GET /api/holdercount] * * returns a plaintext integer indicating the number of accounts with positive balance for a specified token. * * @param {string} contract token contract * @param {string} token token symbol * * @returns {Promise} count */ get_tokenholder_count(contract: string, token: string): Promise; }