UNPKG

fortmatic

Version:
24 lines (23 loc) 1.43 kB
import { ComposeTransactionConfig, JsonRpcBatchRequestPayload, JsonRpcRequestPayload } from '../types'; export declare const JSON_RPC_VERSION = "2.0"; /** * Build a valid JSON RPC payload for emitting to the Ethereum node or Fortmatic * SDK provider. */ export declare function createJsonRpcRequestPayload(method: string, payloadConfig?: ComposeTransactionConfig): JsonRpcRequestPayload; export declare function createJsonRpcRequestPayload(method: string, params?: any[]): JsonRpcRequestPayload; /** * Build a valid JSON RPC batch payload. The underlying RPC payloads are handled * individually by the Ethereum node or Fortmatic SDK provider. */ export declare function createJsonRpcBatchRequestPayload(payloads?: Partial<JsonRpcRequestPayload> | Partial<JsonRpcRequestPayload>[]): JsonRpcBatchRequestPayload; /** * Given a potentially partial JSON RPC request payload, this function populates * missing properties to meet the JSON RPC spec (and any deviations we expect). * * **NOTE:** _This function mutates the payload argument!_ Under the hood, Web3 * reconciles the payload ID with a response ID, mutating the payload object * ensures that any ID assertions pass. */ export declare function standardizeRequestPayload(payload: Partial<JsonRpcRequestPayload>): JsonRpcRequestPayload; export declare function standardizeRequestPayload(payload: Partial<JsonRpcBatchRequestPayload>): JsonRpcBatchRequestPayload;