aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorAra Kevonian <=>2018-06-19 19:13:32 +0800
committerAra Kevonian <=>2018-06-19 19:13:32 +0800
commitdf50232ed90fd880019eff9c9fe66fb2a4cff4bb (patch)
tree5a9323c855b675a3d3b840249f673eca58d16645 /packages
parent9c747f316084d16c64a49d3f18005a2e54d49a71 (diff)
downloaddexon-sol-tools-df50232ed90fd880019eff9c9fe66fb2a4cff4bb.tar
dexon-sol-tools-df50232ed90fd880019eff9c9fe66fb2a4cff4bb.tar.gz
dexon-sol-tools-df50232ed90fd880019eff9c9fe66fb2a4cff4bb.tar.bz2
dexon-sol-tools-df50232ed90fd880019eff9c9fe66fb2a4cff4bb.tar.lz
dexon-sol-tools-df50232ed90fd880019eff9c9fe66fb2a4cff4bb.tar.xz
dexon-sol-tools-df50232ed90fd880019eff9c9fe66fb2a4cff4bb.tar.zst
dexon-sol-tools-df50232ed90fd880019eff9c9fe66fb2a4cff4bb.zip
Update default params in sendRawPaylodAsync for improved JSON-RPC compatibility
Diffstat (limited to 'packages')
-rw-r--r--packages/web3-wrapper/src/web3_wrapper.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts
index 5d2eedcb3..6ea69883c 100644
--- a/packages/web3-wrapper/src/web3_wrapper.ts
+++ b/packages/web3-wrapper/src/web3_wrapper.ts
@@ -491,8 +491,13 @@ export class Web3Wrapper {
}
private async _sendRawPayloadAsync<A>(payload: Partial<JSONRPCRequestPayload>): Promise<A> {
const sendAsync = this._web3.currentProvider.sendAsync.bind(this._web3.currentProvider);
- payload.id = this._jsonRpcRequestId++;
- const response = await promisify<JSONRPCResponsePayload>(sendAsync)(payload);
+ const payloadWithDefaults = {
+ id: this._jsonRpcRequestId++,
+ params: [],
+ jsonrpc: '2.0',
+ ...payload,
+ };
+ const response = await promisify<JSONRPCResponsePayload>(sendAsync)(payloadWithDefaults);
const result = response.result;
return result;
}