aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/0x.js')
-rw-r--r--packages/0x.js/CHANGELOG.json44
-rw-r--r--packages/0x.js/CHANGELOG.md25
-rw-r--r--packages/0x.js/package.json50
-rw-r--r--packages/0x.js/src/0x.ts60
4 files changed, 137 insertions, 42 deletions
diff --git a/packages/0x.js/CHANGELOG.json b/packages/0x.js/CHANGELOG.json
index 4bbefbda4..3f8ccc712 100644
--- a/packages/0x.js/CHANGELOG.json
+++ b/packages/0x.js/CHANGELOG.json
@@ -1,32 +1,51 @@
[
{
+ "timestamp": 1532357734,
"version": "1.0.0",
"changes": [
{
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1532043100,
+ "version": "1.0.0-rc.2",
+ "changes": [
+ {
+ "note": "Remove `zeroEx.assetData` and instead re-export it's static functions directly off `ZeroEx`"
+ }
+ ]
+ },
+ {
+ "timestamp": 1532043000,
+ "version": "1.0.0-rc.1",
+ "changes": [
+ {
"note": "Remove tokenRegistry wrapper",
"pr": 863
},
{
- "note": "Rename zeroEx.token to zeroEx.erc20Token, and add zeroEx.erc721Token",
+ "note": "Rename `zeroEx.token` to `zeroEx.erc20Token`, and add `zeroEx.erc721Token`",
"pr": 863
},
{
- "note": "Rename zeroEx.proxy to zeroEx.erc20Proxy and add zeroEx.erc721Proxy",
+ "note": "Rename `zeroEx.proxy` to `zeroEx.erc20Proxy` and add `zeroEx.erc721Proxy`",
"pr": 863
},
{
"note":
- "Refactored ZeroEx.isValidSignature to zeroEx.isValidSignatureAsync. It is now async so that it can verify contract-dependent signature types",
+ "Refactored `ZeroEx.isValidSignature` to `zeroEx.isValidSignatureAsync`. It is now async so that it can verify contract-dependent signature types",
"pr": 863
},
{
"note":
- "Refactored signOrderHashAsync to ecSignOrderHashAsync. There are now many non-ECSignature ways to sign orders too.",
+ "Refactored `signOrderHashAsync` to `ecSignOrderHashAsync`. There are now many non-ECSignature ways to sign orders too.",
"pr": 863
},
{
"note":
- "Removed createOrderWatcherAsync method. Will be added back once OrderWatcher is refactored for V2",
+ "Removed `createOrderWatcherAsync` method. Will be added back once OrderWatcher is refactored for V2",
"pr": 863
},
{
@@ -34,16 +53,21 @@
"pr": 863
},
{
- "note": "Remove stateLayer config from OrderWatcher. It now always operates on the latest block",
- "pr": 875
- },
- {
- "note": "Export ZeroEx.assetData with methods to decode/encode assetData fields found in 0x orders",
+ "note": "Export `ZeroEx.assetData` with methods to decode/encode assetData fields found in 0x orders",
"pr": 884
}
]
},
{
+ "timestamp": 1531919263,
+ "version": "0.38.6",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"timestamp": 1531149657,
"version": "0.38.5",
"changes": [
diff --git a/packages/0x.js/CHANGELOG.md b/packages/0x.js/CHANGELOG.md
index 00048f610..36a3c2a1d 100644
--- a/packages/0x.js/CHANGELOG.md
+++ b/packages/0x.js/CHANGELOG.md
@@ -1,10 +1,33 @@
<!--
-This file is auto-generated using the monorepo-scripts package. Don't edit directly.
+changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly.
Edit the package's CHANGELOG.json file only.
-->
CHANGELOG
+## v1.0.0 - _July 23, 2018_
+
+ * Dependencies updated
+
+## v1.0.0-rc.2 - _July 20, 2018_
+
+ * Remove `zeroEx.assetData` and instead re-export it's static functions directly off `ZeroEx`
+
+## v1.0.0-rc.1 - _July 20, 2018_
+
+ * Remove tokenRegistry wrapper (#863)
+ * Rename `zeroEx.token` to `zeroEx.erc20Token`, and add `zeroEx.erc721Token` (#863)
+ * Rename `zeroEx.proxy` to `zeroEx.erc20Proxy` and add `zeroEx.erc721Proxy` (#863)
+ * Refactored `ZeroEx.isValidSignature` to `zeroEx.isValidSignatureAsync`. It is now async so that it can verify contract-dependent signature types (#863)
+ * Refactored `signOrderHashAsync` to `ecSignOrderHashAsync`. There are now many non-ECSignature ways to sign orders too. (#863)
+ * Removed `createOrderWatcherAsync` method. Will be added back once OrderWatcher is refactored for V2 (#863)
+ * 0x.js exports renamed contract events and event arg types (#863)
+ * Export `ZeroEx.assetData` with methods to decode/encode assetData fields found in 0x orders (#884)
+
+## v0.38.6 - _July 18, 2018_
+
+ * Dependencies updated
+
## v0.38.5 - _July 9, 2018_
* Dependencies updated
diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json
index 502a346e4..06ffe2daf 100644
--- a/packages/0x.js/package.json
+++ b/packages/0x.js/package.json
@@ -1,6 +1,6 @@
{
"name": "0x.js",
- "version": "0.38.5",
+ "version": "1.0.0-rc.2",
"engines": {
"node": ">=6.12"
},
@@ -41,8 +41,8 @@
"contracts": "ZRXToken",
"postpublish": {
"assets": [
- "packages/0x.js/_bundles/index.js",
- "packages/0x.js/_bundles/index.min.js"
+ "_bundles/index.js",
+ "_bundles/index.min.js"
],
"docPublishConfigs": {
"extraFileIncludes": [
@@ -51,13 +51,11 @@
"../contract-wrappers/src/types.ts",
"../contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts",
"../contract-wrappers/src/contract_wrappers/exchange_wrapper.ts",
- "../contract-wrappers/src/contract_wrappers/token_registry_wrapper.ts",
- "../contract-wrappers/src/contract_wrappers/token_transfer_proxy_wrapper.ts",
- "../contract-wrappers/src/contract_wrappers/token_wrapper.ts",
- "../order-watcher/src/order_watcher/order_watcher.ts",
- "./src/generated_contract_wrappers/ether_token.ts",
- "./src/generated_contract_wrappers/token.ts",
- "./src/generated_contract_wrappers/exchange.ts"
+ "../contract-wrappers/src/contract_wrappers/erc20_proxy_wrapper.ts",
+ "../contract-wrappers/src/contract_wrappers/erc721_proxy_wrapper.ts",
+ "../contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts",
+ "../contract-wrappers/src/contract_wrappers/erc721_token_wrapper.ts",
+ "../order-watcher/src/order_watcher/order_watcher.ts"
],
"s3BucketPath": "s3://doc-jsons/0x.js/",
"s3StagingBucketPath": "s3://staging-doc-jsons/0x.js/"
@@ -70,11 +68,11 @@
},
"license": "Apache-2.0",
"devDependencies": {
- "@0xproject/abi-gen": "^0.3.3",
- "@0xproject/dev-utils": "^0.4.5",
- "@0xproject/migrations": "^0.0.9",
- "@0xproject/monorepo-scripts": "^0.2.2",
- "@0xproject/tslint-config": "^0.4.21",
+ "@0xproject/abi-gen": "^1.0.0",
+ "@0xproject/dev-utils": "^1.0.0",
+ "@0xproject/migrations": "^1.0.0",
+ "@0xproject/monorepo-scripts": "^1.0.0",
+ "@0xproject/tslint-config": "^1.0.0",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"@types/node": "^8.0.53",
@@ -100,17 +98,17 @@
"webpack": "^3.1.0"
},
"dependencies": {
- "@0xproject/assert": "^0.2.13",
- "@0xproject/base-contract": "^0.3.5",
- "@0xproject/contract-wrappers": "^0.1.0",
- "@0xproject/order-utils": "^1.0.0",
- "@0xproject/sol-compiler": "^0.5.3",
- "@0xproject/subproviders": "^0.10.5",
- "@0xproject/types": "^1.0.0",
- "@0xproject/typescript-typings": "^0.4.2",
- "@0xproject/utils": "^0.7.2",
- "@0xproject/web3-wrapper": "^0.7.2",
- "ethereum-types": "^0.0.2",
+ "@0xproject/assert": "^1.0.0",
+ "@0xproject/base-contract": "^1.0.0",
+ "@0xproject/contract-wrappers": "^1.0.0-rc.1",
+ "@0xproject/order-utils": "^1.0.0-rc.1",
+ "@0xproject/sol-compiler": "^1.0.0",
+ "@0xproject/subproviders": "^1.0.0",
+ "@0xproject/types": "^1.0.0-rc.1",
+ "@0xproject/typescript-typings": "^1.0.0",
+ "@0xproject/utils": "^1.0.0",
+ "@0xproject/web3-wrapper": "^1.0.0",
+ "ethereum-types": "^1.0.0",
"ethers": "3.0.22",
"lodash": "^4.17.4"
},
diff --git a/packages/0x.js/src/0x.ts b/packages/0x.js/src/0x.ts
index 385ba76b5..2a2b82f63 100644
--- a/packages/0x.js/src/0x.ts
+++ b/packages/0x.js/src/0x.ts
@@ -17,7 +17,10 @@ import {
MessagePrefixOpts,
orderHashUtils,
} from '@0xproject/order-utils';
-import { ECSignature, Order, SignedOrder } from '@0xproject/types';
+// HACK: Since we export assetDataUtils from ZeroEx and it has AssetProxyId, ERC20AssetData and ERC721AssetData
+// in it's public interface, we need to import these types here.
+// tslint:disable-next-line:no-unused-variable
+import { AssetProxyId, ECSignature, ERC20AssetData, ERC721AssetData, Order, SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import { Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types';
@@ -36,10 +39,6 @@ export class ZeroEx {
*/
public static NULL_ADDRESS = constants.NULL_ADDRESS;
/**
- * A set of methods to easily decode/encode assetData fields found in 0x orders.
- */
- public static assetData = assetDataUtils;
- /**
* An instance of the ExchangeWrapper class containing methods for interacting with the 0x Exchange smart contract.
*/
public exchange: ExchangeWrapper;
@@ -123,6 +122,57 @@ export class ZeroEx {
return baseUnitAmount;
}
/**
+ * Encodes an ERC20 token address into a hex encoded assetData string, usable in the makerAssetData or
+ * takerAssetData fields in a 0x order.
+ * @param tokenAddress The ERC20 token address to encode
+ * @return The hex encoded assetData string
+ */
+ public static encodeERC20AssetData(tokenAddress: string): string {
+ return assetDataUtils.encodeERC20AssetData(tokenAddress);
+ }
+ /**
+ * Decodes an ERC20 assetData hex string into it's corresponding ERC20 tokenAddress & assetProxyId
+ * @param assetData Hex encoded assetData string to decode
+ * @return An object containing the decoded tokenAddress & assetProxyId
+ */
+ public static decodeERC20AssetData(assetData: string): ERC20AssetData {
+ return assetDataUtils.decodeERC20AssetData(assetData);
+ }
+ /**
+ * Encodes an ERC721 token address into a hex encoded assetData string, usable in the makerAssetData or
+ * takerAssetData fields in a 0x order.
+ * @param tokenAddress The ERC721 token address to encode
+ * @param tokenId The ERC721 tokenId to encode
+ * @return The hex encoded assetData string
+ */
+ public static encodeERC721AssetData(tokenAddress: string, tokenId: BigNumber): string {
+ return assetDataUtils.encodeERC721AssetData(tokenAddress, tokenId);
+ }
+ /**
+ * Decodes an ERC721 assetData hex string into it's corresponding ERC721 tokenAddress, tokenId & assetProxyId
+ * @param assetData Hex encoded assetData string to decode
+ * @return An object containing the decoded tokenAddress, tokenId & assetProxyId
+ */
+ public static decodeERC721AssetData(assetData: string): ERC721AssetData {
+ return assetDataUtils.decodeERC721AssetData(assetData);
+ }
+ /**
+ * Decode and return the assetProxyId from the assetData
+ * @param assetData Hex encoded assetData string to decode
+ * @return The assetProxyId
+ */
+ public static decodeAssetProxyId(assetData: string): AssetProxyId {
+ return assetDataUtils.decodeAssetProxyId(assetData);
+ }
+ /**
+ * Decode any assetData into it's corresponding assetData object
+ * @param assetData Hex encoded assetData string to decode
+ * @return Either a ERC20 or ERC721 assetData object
+ */
+ public static decodeAssetDataOrThrow(assetData: string): ERC20AssetData | ERC721AssetData {
+ return assetDataUtils.decodeAssetDataOrThrow(assetData);
+ }
+ /**
* Instantiates a new ZeroEx instance that provides the public interface to the 0x.js library.
* @param provider The Provider instance you would like the 0x.js library to use for interacting with
* the Ethereum network.