Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
modify for issue: web3.js#6345
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad-Altabba committed Sep 26, 2023
1 parent a66de71 commit 4a9c99f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/encoder/lib/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,12 @@ export class ProviderAdapter {
method,
params
});
// checking for `response.result` for web3.js providers.
// related discussion at: https://github.com/web3/web3.js/issues/6345
const jsonRpcResponse =
response as JsonRpcResponseWithResult<JsonRpcResult>;
result =
(response as JsonRpcResponseWithResult<JsonRpcResult>).result ||
response;
jsonRpcResponse.jsonrpc && jsonRpcResponse.result
? jsonRpcResponse.result
: response;
} else {
// HACK MetaMask's injected provider doesn't allow `.send()` with
// a callback, so prefer `.sendAsync()` if it's defined
Expand Down

0 comments on commit 4a9c99f

Please sign in to comment.