diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-06-20 04:29:54 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-06-20 04:29:54 +0800 |
commit | a75d6531f207aac8aeefa94bb44fa96a5b295998 (patch) | |
tree | fc1c581f4c35e188b0a16461936b8d0e3323bfe6 /packages/web3-wrapper/src/web3_wrapper.ts | |
parent | bdd299dd9ee4699ccf5a4ab648e721e03ab2a139 (diff) | |
parent | da69ddc19b29cfca05d28084b196324e121987ea (diff) | |
download | dexon-sol-tools-a75d6531f207aac8aeefa94bb44fa96a5b295998.tar dexon-sol-tools-a75d6531f207aac8aeefa94bb44fa96a5b295998.tar.gz dexon-sol-tools-a75d6531f207aac8aeefa94bb44fa96a5b295998.tar.bz2 dexon-sol-tools-a75d6531f207aac8aeefa94bb44fa96a5b295998.tar.lz dexon-sol-tools-a75d6531f207aac8aeefa94bb44fa96a5b295998.tar.xz dexon-sol-tools-a75d6531f207aac8aeefa94bb44fa96a5b295998.tar.zst dexon-sol-tools-a75d6531f207aac8aeefa94bb44fa96a5b295998.zip |
Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into bug/website/onboarding-improvements
Diffstat (limited to 'packages/web3-wrapper/src/web3_wrapper.ts')
-rw-r--r-- | packages/web3-wrapper/src/web3_wrapper.ts | 9 |
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; } |