UNPKG

@rarcifa/cronos-evm-client

Version:

A Node.js client library for interacting with the Cronos EVM, facilitating operations on both CRC20 and CRC721 tokens.

66 lines (65 loc) 2.89 kB
import { AxiosInstance } from 'axios'; /** * CRC20 integration for managing Ethereum RPC requests. * * @fileoverview This file provides helper functions for Ethereum JSON-RPC interactions. * @namespace crc20 */ export declare const crc20: { /** * Fetches the balance of an account. * * @param {JsonRpcRequestPayload} accountAddress - The account address to fetch the balance from. * @param {AxiosInstance} cronosInstance - The cronos client to initialize the crc20 instance * @returns {Promise<string>} The main token balance of the account. * * @example * const data = crc20.getBalance('0xACCOUNT_ADDRESS'); */ getBalance: (accountAddress: string, cronosInstance: AxiosInstance) => Promise<string>; /** * Fetches the token balance of an account of the crc20 token. * * @param {string} accountAddress - The account address to fetch the balance from. * @param {string} contractAddress - The contract address of the crc20 instance. * @param {AxiosInstance} cronosInstance - The cronos client to initialize the crc20 instance * @returns {Promise<string>} The crc20 token balance of the account. * * @example * const data = crc20.getBalanceOf('0xACCOUNT_ADDRESS', '0xCONTRACT_ADDRESS'); */ getBalanceOf: (accountAddress: string, contractAddress: string, cronosInstance: AxiosInstance) => Promise<string>; /** * Fetches the name of the crc20 token. * * @param {string} contractAddress - The contract address of the crc20 instance. * @param {AxiosInstance} cronosInstance - The cronos client to initialize the crc20 instance * @returns {Promise<string>} The name of the token. * * @example * const data = crc20.getName('0xCONTRACT_ADDRESS'); */ getName: (contractAddress: string, cronosInstance: AxiosInstance) => Promise<string>; /** * Fetches the symbol of the crc20 token. * * @param {string} contractAddress - The contract address of the crc20 instance. * @param {AxiosInstance} cronosInstance - The cronos client to initialize the crc20 instance * @returns {Promise<string>} The symbol of the token. * * @example * const data = crc20.getSymbol('0xCONTRACT_ADDRESS'); */ getSymbol: (contractAddress: string, cronosInstance: AxiosInstance) => Promise<string>; /** * Fetches the total supply of the crc20 token. * * @param {string} contractAddress - The contract address of the crc20 instance. * @param {AxiosInstance} cronosInstance - The cronos client to initialize the crc20 instance * @returns {Promise<string>} The total supply of the token. * * @example * const data = crc20.getTotalSupply('0xCONTRACT_ADDRESS'); */ getTotalSupply: (contractAddress: string, cronosInstance: AxiosInstance) => Promise<string>; };