@rarcifa/cronos-evm-client
Version:
A Node.js client library for interacting with the Cronos EVM, facilitating operations on both CRC20 and CRC721 tokens.
18 lines (17 loc) • 1.01 kB
TypeScript
import { JsonRpcRequestPayload, RpcParams } from '../lib/interfaces/jsonRpcRequest.js';
/**
* This function creates the payload necessary for making JSON-RPC calls such as `eth_call`.
*
* @param {Object|string} param - An object containing the 'to' and 'data' properties for the RPC call, or the method signature.
* @param {string} method - The JSON-RPC method to be invoked (e.g., 'eth_call', 'eth_sendTransaction').
* @param {string} [tag='latest'] - The block number tag specifying the state to query or transact with. Common values are 'latest', 'earliest', or 'pending'.
* @param {number} [id=1] - A unique identifier for the JSON-RPC request, used to match responses with requests.
* @returns {object} The JSON-RPC payload formatted as an object.
*
* @example
* const data = constructEthMethodPayload(
* '0xE51.....2DAde05',
* 'eth_getBalance'
* );
*/
export declare const constructEthMethodPayload: (params: RpcParams, method: string, tag?: string, id?: number) => JsonRpcRequestPayload;