diff options
Diffstat (limited to 'packages/web3-wrapper')
-rw-r--r-- | packages/web3-wrapper/CHANGELOG.json | 16 | ||||
-rw-r--r-- | packages/web3-wrapper/CHANGELOG.md | 4 | ||||
-rw-r--r-- | packages/web3-wrapper/package.json | 10 | ||||
-rw-r--r-- | packages/web3-wrapper/src/index.ts | 1 | ||||
-rw-r--r-- | packages/web3-wrapper/src/marshaller.ts | 13 |
5 files changed, 37 insertions, 7 deletions
diff --git a/packages/web3-wrapper/CHANGELOG.json b/packages/web3-wrapper/CHANGELOG.json index f8b1dab85..0b83ad13d 100644 --- a/packages/web3-wrapper/CHANGELOG.json +++ b/packages/web3-wrapper/CHANGELOG.json @@ -1,15 +1,27 @@ [ { - "timestamp": 1529397769, - "version": "0.7.2", + "version": "0.7.3", "changes": [ { + "note": "Export `marshaller` utility file.", + "pr": 829 + }, + { "note": "Add `getNodeTypeAsync` method", "pr": 812 } ] }, { + "timestamp": 1531149657, + "version": "0.7.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, + { "timestamp": 1529397769, "version": "0.7.1", "changes": [ diff --git a/packages/web3-wrapper/CHANGELOG.md b/packages/web3-wrapper/CHANGELOG.md index 1ac36a316..f6795100e 100644 --- a/packages/web3-wrapper/CHANGELOG.md +++ b/packages/web3-wrapper/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v0.7.2 - _July 9, 2018_ + + * Dependencies updated + ## v0.7.1 - _June 19, 2018_ * Dependencies updated diff --git a/packages/web3-wrapper/package.json b/packages/web3-wrapper/package.json index 21455f67a..9716be5bf 100644 --- a/packages/web3-wrapper/package.json +++ b/packages/web3-wrapper/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/web3-wrapper", - "version": "0.7.1", + "version": "0.7.2", "engines": { "node": ">=6.12" }, @@ -45,8 +45,8 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/web3-wrapper/README.md", "devDependencies": { - "@0xproject/monorepo-scripts": "^0.2.1", - "@0xproject/tslint-config": "^0.4.20", + "@0xproject/monorepo-scripts": "^0.2.2", + "@0xproject/tslint-config": "^0.4.21", "@types/lodash": "4.14.104", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", @@ -66,8 +66,8 @@ "dependencies": { "@0xproject/assert": "0.3.0", "@0xproject/json-schemas": "^1.0.0", - "@0xproject/typescript-typings": "^0.4.1", - "@0xproject/utils": "^0.7.1", + "@0xproject/typescript-typings": "^0.4.2", + "@0xproject/utils": "^0.7.2", "ethereum-types": "^0.0.2", "ethereumjs-util": "^5.1.1", "ethers": "3.0.22", diff --git a/packages/web3-wrapper/src/index.ts b/packages/web3-wrapper/src/index.ts index 66ef0a784..19fe0836c 100644 --- a/packages/web3-wrapper/src/index.ts +++ b/packages/web3-wrapper/src/index.ts @@ -1,2 +1,3 @@ export { Web3Wrapper, uniqueVersionIds, NodeType } from './web3_wrapper'; export { Web3WrapperErrors } from './types'; +export { marshaller } from './marshaller'; diff --git a/packages/web3-wrapper/src/marshaller.ts b/packages/web3-wrapper/src/marshaller.ts index e9fd35a11..15384417e 100644 --- a/packages/web3-wrapper/src/marshaller.ts +++ b/packages/web3-wrapper/src/marshaller.ts @@ -73,6 +73,19 @@ export const marshaller = { }; return tx; }, + unmarshalTxData(txDataRpc: TxDataRPC): TxData { + if (_.isUndefined(txDataRpc.from)) { + throw new Error(`txData must include valid 'from' value.`); + } + const txData = { + ...txDataRpc, + value: !_.isUndefined(txDataRpc.value) ? utils.convertHexToNumber(txDataRpc.value) : undefined, + gas: !_.isUndefined(txDataRpc.gas) ? utils.convertHexToNumber(txDataRpc.gas) : undefined, + gasPrice: !_.isUndefined(txDataRpc.gasPrice) ? utils.convertHexToNumber(txDataRpc.gasPrice) : undefined, + nonce: !_.isUndefined(txDataRpc.nonce) ? utils.convertHexToNumber(txDataRpc.nonce) : undefined, + }; + return txData; + }, marshalTxData(txData: Partial<TxData>): Partial<TxDataRPC> { if (_.isUndefined(txData.from)) { throw new Error(`txData must include valid 'from' value.`); |