diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f93eda04b2..c08f1eef049 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -507,6 +507,7 @@ Released with 1.0.0-beta.37 code base. - Update the documentation for `methods.myMethod.estimateGas` (#4702) - Fix typos in REVIEW.md and TESTING.md (#4691) - Fix encoding for "0x" string values (#4512) +- Fix jsonrpc payload and response types (#4743) (#4761) ### Changed diff --git a/packages/web3-core-helpers/types/index.d.ts b/packages/web3-core-helpers/types/index.d.ts index 2a072af3bc1..e3ee7650f0a 100644 --- a/packages/web3-core-helpers/types/index.d.ts +++ b/packages/web3-core-helpers/types/index.d.ts @@ -216,15 +216,19 @@ export interface RequestItem { export interface JsonRpcPayload { jsonrpc: string; method: string; - params: any[]; + params?: any[]; id?: string | number; } export interface JsonRpcResponse { jsonrpc: string; - id: number; + id: string | number; result?: any; - error?: string; + error?: { + readonly code?: number; + readonly data?: unknown; + readonly message: string; + }; } export interface RevertInstructionError extends Error {