aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-utils
diff options
context:
space:
mode:
authorFrancesco Agosti <francesco.agosti93@gmail.com>2018-10-17 09:18:41 +0800
committerGitHub <noreply@github.com>2018-10-17 09:18:41 +0800
commit336e456984e24807e3d0d5017de4ea8d1e9beb19 (patch)
treeb81fcdfb7f1026b3007a9c5a81f39974d74ae483 /packages/order-utils
parent35b001b0818eda5a55e0c5f9fad9ec7122c28745 (diff)
parent32beeae2f0fa4538f12036aca8dd8d30b1de8bc9 (diff)
downloaddexon-sol-tools-336e456984e24807e3d0d5017de4ea8d1e9beb19.tar
dexon-sol-tools-336e456984e24807e3d0d5017de4ea8d1e9beb19.tar.gz
dexon-sol-tools-336e456984e24807e3d0d5017de4ea8d1e9beb19.tar.bz2
dexon-sol-tools-336e456984e24807e3d0d5017de4ea8d1e9beb19.tar.lz
dexon-sol-tools-336e456984e24807e3d0d5017de4ea8d1e9beb19.tar.xz
dexon-sol-tools-336e456984e24807e3d0d5017de4ea8d1e9beb19.tar.zst
dexon-sol-tools-336e456984e24807e3d0d5017de4ea8d1e9beb19.zip
Merge pull request #1131 from 0xProject/feature/instant/move-features-over-from-zrx-buyer
[instant][types][order-utils][asset-buyer] Move over and clean up features from zrx-buyer
Diffstat (limited to 'packages/order-utils')
-rw-r--r--packages/order-utils/CHANGELOG.json4
-rw-r--r--packages/order-utils/src/asset_data_utils.ts4
-rw-r--r--packages/order-utils/src/index.ts1
3 files changed, 7 insertions, 2 deletions
diff --git a/packages/order-utils/CHANGELOG.json b/packages/order-utils/CHANGELOG.json
index 5a0c0db47..9bf16ef2a 100644
--- a/packages/order-utils/CHANGELOG.json
+++ b/packages/order-utils/CHANGELOG.json
@@ -14,6 +14,10 @@
{
"note": "Rename `ecSignOrderHashAsync` to `ecSignHashAsync` removing `SignerType` parameter.",
"pr": 1102
+ },
+ {
+ "note": "Use `AssetData` union type for function return values.",
+ "pr": 1131
}
]
},
diff --git a/packages/order-utils/src/asset_data_utils.ts b/packages/order-utils/src/asset_data_utils.ts
index 0c0b59548..12c11bce9 100644
--- a/packages/order-utils/src/asset_data_utils.ts
+++ b/packages/order-utils/src/asset_data_utils.ts
@@ -1,4 +1,4 @@
-import { AssetProxyId, ERC20AssetData, ERC721AssetData } from '@0xproject/types';
+import { AssetData, AssetProxyId, ERC20AssetData, ERC721AssetData } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import ethAbi = require('ethereumjs-abi');
import ethUtil = require('ethereumjs-util');
@@ -112,7 +112,7 @@ export const assetDataUtils = {
* @param assetData Hex encoded assetData string to decode
* @return Either a ERC20 or ERC721 assetData object
*/
- decodeAssetDataOrThrow(assetData: string): ERC20AssetData | ERC721AssetData {
+ decodeAssetDataOrThrow(assetData: string): AssetData {
const assetProxyId = assetDataUtils.decodeAssetProxyId(assetData);
switch (assetProxyId) {
case AssetProxyId.ERC20:
diff --git a/packages/order-utils/src/index.ts b/packages/order-utils/src/index.ts
index dbb782b85..a356a1d44 100644
--- a/packages/order-utils/src/index.ts
+++ b/packages/order-utils/src/index.ts
@@ -35,6 +35,7 @@ export {
OrderRelevantState,
OrderState,
ECSignature,
+ AssetData,
ERC20AssetData,
ERC721AssetData,
AssetProxyId,