diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-10-18 01:30:29 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-10-18 01:30:29 +0800 |
commit | 84057934c6cda3fe3e4f86cf686b163db017cf9e (patch) | |
tree | 0160c132e134fb04106f232834f0ed021d06ebd5 /packages/order-utils | |
parent | aa1085c8f3866da4965c0102be27c0f5e19b3db6 (diff) | |
parent | c767404ad09ca9fdacf9ab43c0e6b13fc70bffb9 (diff) | |
download | dexon-sol-tools-84057934c6cda3fe3e4f86cf686b163db017cf9e.tar dexon-sol-tools-84057934c6cda3fe3e4f86cf686b163db017cf9e.tar.gz dexon-sol-tools-84057934c6cda3fe3e4f86cf686b163db017cf9e.tar.bz2 dexon-sol-tools-84057934c6cda3fe3e4f86cf686b163db017cf9e.tar.lz dexon-sol-tools-84057934c6cda3fe3e4f86cf686b163db017cf9e.tar.xz dexon-sol-tools-84057934c6cda3fe3e4f86cf686b163db017cf9e.tar.zst dexon-sol-tools-84057934c6cda3fe3e4f86cf686b163db017cf9e.zip |
Merge branch 'development' into feature/website/asset-buyer-docs
* development: (31 commits)
Update CODEOWNERS
Update CODEOWNERS
Update CODEOWNERS
Add leo to CODEOWNERS on some packages
fix(monorepo-scripts): Format date as UTC not local time.
Bump max bundle size for instant
fix: dont use enum string as type as typedoc gets confused
feat: export AssetData from order-utils
feat: export AssetData from utils
chore: temporarily increase the bundle size for instant
Remove order-utils from dependencies
Run tests on circle CI
Add tests for format and use toFixed instead of round for usd
Remove expiry buffer seconds option from AssetBuyer init
Add ts-optchain and use it instead of lodash get
Hide USD price when ETH-USD price is not available
Rename OrderDetailsRow to EthAmountRow
fix: add Steve's github account to about page, and capitalize AppFolio correctly
Put boundNoop in a util file
Add tnxHash to buy button callbacks
...
Diffstat (limited to 'packages/order-utils')
-rw-r--r-- | packages/order-utils/CHANGELOG.json | 4 | ||||
-rw-r--r-- | packages/order-utils/src/asset_data_utils.ts | 4 | ||||
-rw-r--r-- | packages/order-utils/src/index.ts | 1 |
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, |