diff --git a/src/api/README.md b/src/api/README.md index 1f8238b..c0e1156 100644 --- a/src/api/README.md +++ b/src/api/README.md @@ -83,7 +83,7 @@ attach contract ```javascript const abi = [{ name: 'callMe', inputs: [{ type: 'bool', ...}, { type: 'string', ...}]}, ...abi...]; -const contract = new ethapi.newContract(abi); +const contract = ethapi.newContract(abi); ``` deploy diff --git a/src/api/contract/index.js b/src/api/contract/index.js index 7c38f4b..2fa45f9 100644 --- a/src/api/contract/index.js +++ b/src/api/contract/index.js @@ -117,9 +117,11 @@ export default class Contract { return this._api.parity .postTransaction(encodedOptions) - .then((requestId) => { - statecb(null, { state: 'checkRequest', requestId }); - return this._pollCheckRequest(requestId); + .then((result) => { + if(result.length !== 66) { + statecb(null, { state: 'checkRequest', result }); + return this._pollCheckRequest(result); + } else { return result; } }) .then((txhash) => { statecb(null, { state: 'getTransactionReceipt', txhash });