diff options
Diffstat (limited to 'packages/deployer')
-rw-r--r-- | packages/deployer/package.json | 6 | ||||
-rw-r--r-- | packages/deployer/src/index.ts | 1 | ||||
-rw-r--r-- | packages/deployer/src/utils/contract.ts | 14 |
3 files changed, 12 insertions, 9 deletions
diff --git a/packages/deployer/package.json b/packages/deployer/package.json index 723c4a465..8bff8445c 100644 --- a/packages/deployer/package.json +++ b/packages/deployer/package.json @@ -2,7 +2,8 @@ "name": "@0xproject/deployer", "version": "0.0.4", "description": "Smart contract deployer of 0x protocol", - "main": "lib/src/cli.js", + "main": "lib/src/index.js", + "types": "lib/src/index.d.ts", "scripts": { "build": "yarn clean && copyfiles 'test/fixtures/contracts/**/*' src/solc/solc_bin/* ./lib && tsc", "test": "npm run build; mocha lib/test/*_test.js", @@ -27,12 +28,13 @@ "homepage": "https://github.com/0xProject/0x.js/packages/deployer/README.md", "devDependencies": { "copyfiles": "^1.2.0", + "web3-typescript-typings": "^0.9.4", "types-bn": "^0.0.1", "typescript": "~2.6.1", "web3-typescript-typings": "^0.9.7" }, "dependencies": { - "@0xproject/utils": "^0.1.3", + "@0xproject/utils": "^0.2.1", "@0xproject/web3-wrapper": "^0.1.8", "lodash": "^4.17.4", "solc": "^0.4.18", diff --git a/packages/deployer/src/index.ts b/packages/deployer/src/index.ts new file mode 100644 index 000000000..06dc9e596 --- /dev/null +++ b/packages/deployer/src/index.ts @@ -0,0 +1 @@ +export { Deployer } from './deployer'; diff --git a/packages/deployer/src/utils/contract.ts b/packages/deployer/src/utils/contract.ts index 546e82dfb..9c57751ff 100644 --- a/packages/deployer/src/utils/contract.ts +++ b/packages/deployer/src/utils/contract.ts @@ -28,16 +28,16 @@ export class Contract implements Web3.ContractInstance { _.forEach(functionsAbi, (functionAbi: Web3.MethodAbi) => { if (functionAbi.constant) { const cbStyleCallFunction = this._contract[functionAbi.name].call; - this[functionAbi.name] = { - callAsync: promisify(cbStyleCallFunction, this._contract), - }; + this[functionAbi.name] = promisify(cbStyleCallFunction, this._contract); + this[functionAbi.name].call = promisify(cbStyleCallFunction, this._contract); } else { const cbStyleFunction = this._contract[functionAbi.name]; + const cbStyleCallFunction = this._contract[functionAbi.name].call; const cbStyleEstimateGasFunction = this._contract[functionAbi.name].estimateGas; - this[functionAbi.name] = { - estimateGasAsync: promisify(cbStyleEstimateGasFunction, this._contract), - sendTransactionAsync: this._promisifyWithDefaultParams(cbStyleFunction), - }; + this[functionAbi.name] = this._promisifyWithDefaultParams(cbStyleFunction); + this[functionAbi.name].estimateGasAsync = promisify(cbStyleEstimateGasFunction); + this[functionAbi.name].sendTransactionAsync = this._promisifyWithDefaultParams(cbStyleFunction); + this[functionAbi.name].call = promisify(cbStyleCallFunction, this._contract); } }); } |