aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-utils/src/asset_data_utils.ts
diff options
context:
space:
mode:
authorGreg Hysen <greg.hysen@gmail.com>2018-12-21 07:39:19 +0800
committerGreg Hysen <greg.hysen@gmail.com>2019-01-08 07:50:48 +0800
commit43b648e7dc1ea49aff3ab1e6883aa6e069fae72f (patch)
tree7db4b13135cc91a1c217c78766667e85cfc62e14 /packages/order-utils/src/asset_data_utils.ts
parent89fcbec43b04a49c45786067f61c539128e1c507 (diff)
downloaddexon-0x-contracts-43b648e7dc1ea49aff3ab1e6883aa6e069fae72f.tar.gz
dexon-0x-contracts-43b648e7dc1ea49aff3ab1e6883aa6e069fae72f.tar.zst
dexon-0x-contracts-43b648e7dc1ea49aff3ab1e6883aa6e069fae72f.zip
Dutch wrapper
Diffstat (limited to 'packages/order-utils/src/asset_data_utils.ts')
-rw-r--r--packages/order-utils/src/asset_data_utils.ts20
1 files changed, 0 insertions, 20 deletions
diff --git a/packages/order-utils/src/asset_data_utils.ts b/packages/order-utils/src/asset_data_utils.ts
index 0fc166969..f314891e2 100644
--- a/packages/order-utils/src/asset_data_utils.ts
+++ b/packages/order-utils/src/asset_data_utils.ts
@@ -305,24 +305,4 @@ export const assetDataUtils = {
throw new Error(`Unrecognized asset proxy id: ${assetProxyId}`);
}
},
- /**
- * Dutch auction details are encoded with the asset data for a 0x order. This function produces a hex
- * encoded assetData string, containing information both about the asset being traded and the
- * dutch auction; which is usable in the makerAssetData or takerAssetData fields in a 0x order.
- * @param assetData Hex encoded assetData string for the asset being auctioned.
- * @param beginTimeSeconds Begin time of the dutch auction.
- * @param beginAmount Starting amount being sold in the dutch auction.
- * @return The hex encoded assetData string.
- */
- encodeDutchAuctionAssetData(assetData: string, beginTimeSeconds: BigNumber, beginAmount: BigNumber): string {
- const assetDataBuffer = ethUtil.toBuffer(assetData);
- const abiEncodedAuctionData = (ethAbi as any).rawEncode(
- ['uint256', 'uint256'],
- [beginTimeSeconds.toString(), beginAmount.toString()],
- );
- const abiEncodedAuctionDataBuffer = ethUtil.toBuffer(abiEncodedAuctionData);
- const dutchAuctionDataBuffer = Buffer.concat([assetDataBuffer, abiEncodedAuctionDataBuffer]);
- const dutchAuctionData = ethUtil.bufferToHex(dutchAuctionDataBuffer);
- return dutchAuctionData;
- },
};