Compare commits
34 Commits
@0x/contra
...
@0x/react-
Author | SHA1 | Date | |
---|---|---|---|
|
dbb3c5e32b | ||
|
265df31750 | ||
|
9bbe56df0b | ||
|
879c795fc4 | ||
|
8b5bb97537 | ||
|
3d7a635543 | ||
|
b3ae9e6e25 | ||
|
023ea5b3a1 | ||
|
2ad6bd3945 | ||
|
2326dcdb12 | ||
|
b5eb47f609 | ||
|
af4ed0f39c | ||
|
eac254f925 | ||
|
8246dec843 | ||
|
4514da0646 | ||
|
9abd6f5695 | ||
|
a394967268 | ||
|
c7c4cb9bc6 | ||
|
1ada679663 | ||
|
9552676783 | ||
|
69c7c03fb3 | ||
|
224a58bdf2 | ||
|
98427b715d | ||
|
a8078aa151 | ||
|
3cb6744369 | ||
|
e021460f03 | ||
|
0a93f3346f | ||
|
332cc14dcd | ||
|
7885b2e3f8 | ||
|
2447c72a5c | ||
|
d7c9d73349 | ||
|
a1bf5e8261 | ||
|
52f22aad81 | ||
|
c03e24e10b |
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "1.0.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1549373905,
|
||||
"version": "1.0.1",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.2 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.1 - _February 5, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-asset-proxy",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,9 +44,9 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.0",
|
||||
"@0x/dev-utils": "^2.0.0",
|
||||
"@0x/sol-compiler": "^3.0.0",
|
||||
"@0x/abi-gen": "^2.0.1",
|
||||
"@0x/dev-utils": "^2.0.1",
|
||||
"@0x/sol-compiler": "^3.0.1",
|
||||
"@0x/tslint-config": "^3.0.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -63,16 +63,16 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^4.0.0",
|
||||
"@0x/contracts-erc20": "^1.0.1",
|
||||
"@0x/contracts-erc721": "^1.0.1",
|
||||
"@0x/contracts-test-utils": "^3.0.0",
|
||||
"@0x/contracts-utils": "^2.0.0",
|
||||
"@0x/order-utils": "^4.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/base-contract": "^4.0.1",
|
||||
"@0x/contracts-erc20": "^1.0.2",
|
||||
"@0x/contracts-erc721": "^1.0.2",
|
||||
"@0x/contracts-test-utils": "^3.0.1",
|
||||
"@0x/contracts-utils": "^2.0.1",
|
||||
"@0x/order-utils": "^5.0.0",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"ethereum-types": "^2.0.0",
|
||||
"lodash": "^4.17.5"
|
||||
},
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "1.0.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1549373905,
|
||||
"version": "1.0.1",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.2 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.1 - _February 5, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc20",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,10 +44,10 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.0",
|
||||
"@0x/contracts-test-utils": "^3.0.0",
|
||||
"@0x/dev-utils": "^2.0.0",
|
||||
"@0x/sol-compiler": "^3.0.0",
|
||||
"@0x/abi-gen": "^2.0.1",
|
||||
"@0x/contracts-test-utils": "^3.0.1",
|
||||
"@0x/dev-utils": "^2.0.1",
|
||||
"@0x/sol-compiler": "^3.0.1",
|
||||
"@0x/tslint-config": "^3.0.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -64,13 +64,13 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^4.0.0",
|
||||
"@0x/contracts-exchange-libs": "^1.0.1",
|
||||
"@0x/contracts-utils": "^2.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/base-contract": "^4.0.1",
|
||||
"@0x/contracts-exchange-libs": "^1.0.2",
|
||||
"@0x/contracts-utils": "^2.0.1",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"ethereum-types": "^2.0.0",
|
||||
"lodash": "^4.17.5"
|
||||
},
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "1.0.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1549373905,
|
||||
"version": "1.0.1",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.2 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.1 - _February 5, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc721",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,10 +44,10 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.0",
|
||||
"@0x/contracts-test-utils": "^3.0.0",
|
||||
"@0x/dev-utils": "^2.0.0",
|
||||
"@0x/sol-compiler": "^3.0.0",
|
||||
"@0x/abi-gen": "^2.0.1",
|
||||
"@0x/contracts-test-utils": "^3.0.1",
|
||||
"@0x/dev-utils": "^2.0.1",
|
||||
"@0x/sol-compiler": "^3.0.1",
|
||||
"@0x/tslint-config": "^3.0.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -64,12 +64,12 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^4.0.0",
|
||||
"@0x/contracts-utils": "^2.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/base-contract": "^4.0.1",
|
||||
"@0x/contracts-utils": "^2.0.1",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"ethereum-types": "^2.0.0",
|
||||
"lodash": "^4.17.5"
|
||||
},
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "1.0.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1549373905,
|
||||
"version": "1.0.1",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.2 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.1 - _February 5, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange-forwarder",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,11 +44,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.0",
|
||||
"@0x/contract-wrappers": "^6.0.1",
|
||||
"@0x/contracts-test-utils": "^3.0.0",
|
||||
"@0x/dev-utils": "^2.0.0",
|
||||
"@0x/sol-compiler": "^3.0.0",
|
||||
"@0x/abi-gen": "^2.0.1",
|
||||
"@0x/contract-wrappers": "^7.0.0",
|
||||
"@0x/contracts-test-utils": "^3.0.1",
|
||||
"@0x/dev-utils": "^2.0.1",
|
||||
"@0x/sol-compiler": "^3.0.1",
|
||||
"@0x/tslint-config": "^3.0.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -65,18 +65,18 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^4.0.0",
|
||||
"@0x/contracts-asset-proxy": "^1.0.1",
|
||||
"@0x/contracts-erc20": "^1.0.1",
|
||||
"@0x/contracts-erc721": "^1.0.1",
|
||||
"@0x/contracts-exchange": "^1.0.1",
|
||||
"@0x/contracts-exchange-libs": "^1.0.1",
|
||||
"@0x/contracts-utils": "^2.0.0",
|
||||
"@0x/order-utils": "^4.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/base-contract": "^4.0.1",
|
||||
"@0x/contracts-asset-proxy": "^1.0.2",
|
||||
"@0x/contracts-erc20": "^1.0.2",
|
||||
"@0x/contracts-erc721": "^1.0.2",
|
||||
"@0x/contracts-exchange": "^1.0.2",
|
||||
"@0x/contracts-exchange-libs": "^1.0.2",
|
||||
"@0x/contracts-utils": "^2.0.1",
|
||||
"@0x/order-utils": "^5.0.0",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"ethereum-types": "^2.0.0",
|
||||
"lodash": "^4.17.5"
|
||||
},
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "1.0.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1549373905,
|
||||
"version": "1.0.1",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.2 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.1 - _February 5, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange-libs",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,10 +44,10 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/libs/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.0",
|
||||
"@0x/contracts-test-utils": "^3.0.0",
|
||||
"@0x/dev-utils": "^2.0.0",
|
||||
"@0x/sol-compiler": "^3.0.0",
|
||||
"@0x/abi-gen": "^2.0.1",
|
||||
"@0x/contracts-test-utils": "^3.0.1",
|
||||
"@0x/dev-utils": "^2.0.1",
|
||||
"@0x/sol-compiler": "^3.0.1",
|
||||
"@0x/tslint-config": "^3.0.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -64,13 +64,13 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^4.0.0",
|
||||
"@0x/contracts-utils": "^2.0.0",
|
||||
"@0x/order-utils": "^4.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/base-contract": "^4.0.1",
|
||||
"@0x/contracts-utils": "^2.0.1",
|
||||
"@0x/order-utils": "^5.0.0",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"ethereum-types": "^2.0.0",
|
||||
"lodash": "^4.17.5"
|
||||
},
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "1.0.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1549373905,
|
||||
"version": "1.0.1",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.2 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.1 - _February 5, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,9 +44,9 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.0",
|
||||
"@0x/dev-utils": "^2.0.0",
|
||||
"@0x/sol-compiler": "^3.0.0",
|
||||
"@0x/abi-gen": "^2.0.1",
|
||||
"@0x/dev-utils": "^2.0.1",
|
||||
"@0x/sol-compiler": "^3.0.1",
|
||||
"@0x/tslint-config": "^3.0.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -63,18 +63,18 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^4.0.0",
|
||||
"@0x/contracts-asset-proxy": "^1.0.1",
|
||||
"@0x/contracts-erc20": "^1.0.1",
|
||||
"@0x/contracts-erc721": "^1.0.1",
|
||||
"@0x/contracts-exchange-libs": "^1.0.1",
|
||||
"@0x/contracts-test-utils": "^3.0.0",
|
||||
"@0x/contracts-utils": "^2.0.0",
|
||||
"@0x/order-utils": "^4.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/base-contract": "^4.0.1",
|
||||
"@0x/contracts-asset-proxy": "^1.0.2",
|
||||
"@0x/contracts-erc20": "^1.0.2",
|
||||
"@0x/contracts-erc721": "^1.0.2",
|
||||
"@0x/contracts-exchange-libs": "^1.0.2",
|
||||
"@0x/contracts-test-utils": "^3.0.1",
|
||||
"@0x/contracts-utils": "^2.0.1",
|
||||
"@0x/order-utils": "^5.0.0",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"ethereum-types": "^2.0.0",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"lodash": "^4.17.5"
|
||||
|
@@ -8,14 +8,13 @@ import {
|
||||
OrderFactory,
|
||||
orderUtils,
|
||||
provider,
|
||||
SignedTransaction,
|
||||
TransactionFactory,
|
||||
txDefaults,
|
||||
web3Wrapper,
|
||||
} from '@0x/contracts-test-utils';
|
||||
import { BlockchainLifecycle } from '@0x/dev-utils';
|
||||
import { assetDataUtils, generatePseudoRandomSalt } from '@0x/order-utils';
|
||||
import { OrderWithoutExchangeAddress, RevertReason, SignedOrder } from '@0x/types';
|
||||
import { OrderWithoutExchangeAddress, RevertReason, SignedOrder, SignedZeroExTransaction } from '@0x/types';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import * as chai from 'chai';
|
||||
import * as _ from 'lodash';
|
||||
@@ -41,7 +40,7 @@ describe('Exchange transactions', () => {
|
||||
|
||||
let erc20Balances: ERC20BalancesByOwner;
|
||||
let signedOrder: SignedOrder;
|
||||
let signedTx: SignedTransaction;
|
||||
let signedTx: SignedZeroExTransaction;
|
||||
let orderWithoutExchangeAddress: OrderWithoutExchangeAddress;
|
||||
let orderFactory: OrderFactory;
|
||||
let makerTransactionFactory: TransactionFactory;
|
||||
|
@@ -1,14 +1,7 @@
|
||||
import { artifacts as erc20Artifacts } from '@0x/contracts-erc20';
|
||||
import { artifacts as erc721Artifacts } from '@0x/contracts-erc721';
|
||||
import {
|
||||
FillResults,
|
||||
formatters,
|
||||
LogDecoder,
|
||||
OrderInfo,
|
||||
orderUtils,
|
||||
SignedTransaction,
|
||||
} from '@0x/contracts-test-utils';
|
||||
import { SignedOrder } from '@0x/types';
|
||||
import { FillResults, formatters, LogDecoder, OrderInfo, orderUtils } from '@0x/contracts-test-utils';
|
||||
import { SignedOrder, SignedZeroExTransaction } from '@0x/types';
|
||||
import { AbiEncoder, BigNumber } from '@0x/utils';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import { MethodAbi, Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types';
|
||||
@@ -206,7 +199,7 @@ export class ExchangeWrapper {
|
||||
return tx;
|
||||
}
|
||||
public async executeTransactionAsync(
|
||||
signedTx: SignedTransaction,
|
||||
signedTx: SignedZeroExTransaction,
|
||||
from: string,
|
||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
const txHash = await this._exchange.executeTransaction.sendTransactionAsync(
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "2.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.1 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.0 - _February 5, 2019_
|
||||
|
||||
* Upgrade the bignumber.js to v8.0.2 (#1517)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-extensions",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,11 +44,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.0",
|
||||
"@0x/contract-wrappers": "^6.0.1",
|
||||
"@0x/contracts-test-utils": "^3.0.0",
|
||||
"@0x/dev-utils": "^2.0.0",
|
||||
"@0x/sol-compiler": "^3.0.0",
|
||||
"@0x/abi-gen": "^2.0.1",
|
||||
"@0x/contract-wrappers": "^7.0.0",
|
||||
"@0x/contracts-test-utils": "^3.0.1",
|
||||
"@0x/dev-utils": "^2.0.1",
|
||||
"@0x/sol-compiler": "^3.0.1",
|
||||
"@0x/tslint-config": "^3.0.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -65,18 +65,18 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^4.0.0",
|
||||
"@0x/contracts-asset-proxy": "^1.0.1",
|
||||
"@0x/contracts-erc20": "^1.0.1",
|
||||
"@0x/contracts-erc721": "^1.0.1",
|
||||
"@0x/contracts-exchange": "^1.0.1",
|
||||
"@0x/contracts-exchange-libs": "^1.0.1",
|
||||
"@0x/contracts-utils": "^2.0.0",
|
||||
"@0x/order-utils": "^4.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/base-contract": "^4.0.1",
|
||||
"@0x/contracts-asset-proxy": "^1.0.2",
|
||||
"@0x/contracts-erc20": "^1.0.2",
|
||||
"@0x/contracts-erc721": "^1.0.2",
|
||||
"@0x/contracts-exchange": "^1.0.2",
|
||||
"@0x/contracts-exchange-libs": "^1.0.2",
|
||||
"@0x/contracts-utils": "^2.0.1",
|
||||
"@0x/order-utils": "^5.0.0",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"ethereum-types": "^2.0.0",
|
||||
"lodash": "^4.17.5"
|
||||
},
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "2.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.1 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.0 - _February 5, 2019_
|
||||
|
||||
* Upgrade the bignumber.js to v8.0.2 (#1517)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-multisig",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,10 +44,10 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/multisig/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.0",
|
||||
"@0x/contracts-test-utils": "^3.0.0",
|
||||
"@0x/dev-utils": "^2.0.0",
|
||||
"@0x/sol-compiler": "^3.0.0",
|
||||
"@0x/abi-gen": "^2.0.1",
|
||||
"@0x/contracts-test-utils": "^3.0.1",
|
||||
"@0x/dev-utils": "^2.0.1",
|
||||
"@0x/sol-compiler": "^3.0.1",
|
||||
"@0x/tslint-config": "^3.0.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "*",
|
||||
@@ -64,13 +64,13 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^4.0.0",
|
||||
"@0x/contracts-asset-proxy": "^1.0.1",
|
||||
"@0x/contracts-erc20": "^1.0.1",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/base-contract": "^4.0.1",
|
||||
"@0x/contracts-asset-proxy": "^1.0.2",
|
||||
"@0x/contracts-erc20": "^1.0.2",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"ethereum-types": "^2.0.0",
|
||||
"lodash": "^4.17.5"
|
||||
},
|
||||
|
@@ -1,10 +1,23 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "3.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.0.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Upgrade the bignumber.js to v8.0.2",
|
||||
"pr": 1517
|
||||
},
|
||||
{
|
||||
"note": "Import `ZeroExTransaction` type instead of using type defined in this package",
|
||||
"pr": 1576
|
||||
}
|
||||
],
|
||||
"timestamp": 1549373905
|
||||
|
@@ -5,9 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.1 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.0 - _February 5, 2019_
|
||||
|
||||
* Upgrade the bignumber.js to v8.0.2 (#1517)
|
||||
* Import `ZeroExTransaction` type instead of using type defined in this package (#1576)
|
||||
|
||||
## v2.0.1 - _January 17, 2019_
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-test-utils",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -40,19 +40,19 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/abi-gen": "^2.0.0",
|
||||
"@0x/dev-utils": "^2.0.0",
|
||||
"@0x/order-utils": "^4.0.0",
|
||||
"@0x/sol-compiler": "^3.0.0",
|
||||
"@0x/sol-coverage": "^2.0.0",
|
||||
"@0x/sol-profiler": "^2.0.1",
|
||||
"@0x/sol-trace": "^2.0.1",
|
||||
"@0x/subproviders": "^3.0.0",
|
||||
"@0x/abi-gen": "^2.0.1",
|
||||
"@0x/dev-utils": "^2.0.1",
|
||||
"@0x/order-utils": "^5.0.0",
|
||||
"@0x/sol-compiler": "^3.0.1",
|
||||
"@0x/sol-coverage": "^2.0.1",
|
||||
"@0x/sol-profiler": "^2.0.2",
|
||||
"@0x/sol-trace": "^2.0.2",
|
||||
"@0x/subproviders": "^3.0.1",
|
||||
"@0x/tslint-config": "^3.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/js-combinatorics": "^0.5.29",
|
||||
"@types/lodash": "4.14.104",
|
||||
|
@@ -31,7 +31,6 @@ export {
|
||||
MarketBuyOrders,
|
||||
MarketSellOrders,
|
||||
ERC721TokenIdsByOwner,
|
||||
SignedTransaction,
|
||||
OrderStatus,
|
||||
AllowanceAmountScenario,
|
||||
AssetDataScenario,
|
||||
|
@@ -1,10 +1,8 @@
|
||||
import { eip712Utils, generatePseudoRandomSalt } from '@0x/order-utils';
|
||||
import { SignatureType } from '@0x/types';
|
||||
import { signTypedDataUtils } from '@0x/utils';
|
||||
import { generatePseudoRandomSalt, transactionHashUtils } from '@0x/order-utils';
|
||||
import { SignatureType, SignedZeroExTransaction } from '@0x/types';
|
||||
import * as ethUtil from 'ethereumjs-util';
|
||||
|
||||
import { signingUtils } from './signing_utils';
|
||||
import { SignedTransaction } from './types';
|
||||
|
||||
export class TransactionFactory {
|
||||
private readonly _signerBuff: Buffer;
|
||||
@@ -15,23 +13,25 @@ export class TransactionFactory {
|
||||
this._exchangeAddress = exchangeAddress;
|
||||
this._signerBuff = ethUtil.privateToAddress(this._privateKey);
|
||||
}
|
||||
public newSignedTransaction(data: string, signatureType: SignatureType = SignatureType.EthSign): SignedTransaction {
|
||||
public newSignedTransaction(
|
||||
data: string,
|
||||
signatureType: SignatureType = SignatureType.EthSign,
|
||||
): SignedZeroExTransaction {
|
||||
const salt = generatePseudoRandomSalt();
|
||||
const signerAddress = `0x${this._signerBuff.toString('hex')}`;
|
||||
const executeTransactionData = {
|
||||
const transaction = {
|
||||
salt,
|
||||
signerAddress,
|
||||
data,
|
||||
verifyingContractAddress: this._exchangeAddress,
|
||||
};
|
||||
|
||||
const typedData = eip712Utils.createZeroExTransactionTypedData(executeTransactionData, this._exchangeAddress);
|
||||
const eip712MessageBuffer = signTypedDataUtils.generateTypedDataHash(typedData);
|
||||
const signature = signingUtils.signMessage(eip712MessageBuffer, this._privateKey, signatureType);
|
||||
const signedTx = {
|
||||
exchangeAddress: this._exchangeAddress,
|
||||
const transactionHashBuffer = transactionHashUtils.getTransactionHashBuffer(transaction);
|
||||
const signature = signingUtils.signMessage(transactionHashBuffer, this._privateKey, signatureType);
|
||||
const signedTransaction = {
|
||||
...transaction,
|
||||
signature: `0x${signature.toString('hex')}`,
|
||||
...executeTransactionData,
|
||||
};
|
||||
return signedTx;
|
||||
return signedTransaction;
|
||||
}
|
||||
}
|
||||
|
@@ -107,14 +107,6 @@ export enum ContractName {
|
||||
BalanceThresholdFilter = 'BalanceThresholdFilter',
|
||||
}
|
||||
|
||||
export interface SignedTransaction {
|
||||
exchangeAddress: string;
|
||||
salt: BigNumber;
|
||||
signerAddress: string;
|
||||
data: string;
|
||||
signature: string;
|
||||
}
|
||||
|
||||
export interface TransferAmountsByMatchOrders {
|
||||
// Left Maker
|
||||
amountBoughtByLeftMaker: BigNumber;
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "2.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.1 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.0 - _February 5, 2019_
|
||||
|
||||
* Upgrade the bignumber.js to v8.0.2 (#1517)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-utils",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,10 +44,10 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/utils/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.0",
|
||||
"@0x/contracts-test-utils": "^3.0.0",
|
||||
"@0x/dev-utils": "^2.0.0",
|
||||
"@0x/sol-compiler": "^3.0.0",
|
||||
"@0x/abi-gen": "^2.0.1",
|
||||
"@0x/contracts-test-utils": "^3.0.1",
|
||||
"@0x/dev-utils": "^2.0.1",
|
||||
"@0x/sol-compiler": "^3.0.1",
|
||||
"@0x/tslint-config": "^3.0.0",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
@@ -65,12 +65,12 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^4.0.0",
|
||||
"@0x/order-utils": "^4.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/base-contract": "^4.0.1",
|
||||
"@0x/order-utils": "^5.0.0",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"bn.js": "^4.11.8",
|
||||
"ethereum-types": "^2.0.0",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "4.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "4.0.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.0.1 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.0.0 - _February 5, 2019_
|
||||
|
||||
* Upgrade the bignumber.js to v8.0.2 (#1517)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "0x.js",
|
||||
"version": "4.0.0",
|
||||
"version": "4.0.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -24,7 +24,7 @@
|
||||
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
|
||||
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
|
||||
"clean": "shx rm -rf _bundles lib test_temp src/generated_contract_wrappers generated_docs",
|
||||
"build:umd:prod": "NODE_ENV=production webpack",
|
||||
"build:umd:prod": "NODE_ENV=production node --max_old_space_size=8192 ../../node_modules/.bin/webpack --mode production",
|
||||
"build:commonjs": "tsc -b",
|
||||
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
|
||||
},
|
||||
@@ -42,10 +42,10 @@
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen-wrappers": "^3.0.0",
|
||||
"@0x/abi-gen-wrappers": "^3.0.1",
|
||||
"@0x/contract-addresses": "^2.2.1",
|
||||
"@0x/dev-utils": "^2.0.0",
|
||||
"@0x/migrations": "^3.0.0",
|
||||
"@0x/dev-utils": "^2.0.1",
|
||||
"@0x/migrations": "^3.0.1",
|
||||
"@0x/tslint-config": "^3.0.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^2.2.42",
|
||||
@@ -72,16 +72,16 @@
|
||||
"webpack": "^4.20.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/assert": "^2.0.0",
|
||||
"@0x/base-contract": "^4.0.0",
|
||||
"@0x/contract-wrappers": "^6.0.1",
|
||||
"@0x/order-utils": "^4.0.0",
|
||||
"@0x/order-watcher": "^3.0.0",
|
||||
"@0x/subproviders": "^3.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/assert": "^2.0.1",
|
||||
"@0x/base-contract": "^4.0.1",
|
||||
"@0x/contract-wrappers": "^7.0.0",
|
||||
"@0x/order-utils": "^5.0.0",
|
||||
"@0x/order-watcher": "^3.0.1",
|
||||
"@0x/subproviders": "^3.0.1",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"@types/web3-provider-engine": "^14.0.0",
|
||||
"ethereum-types": "^2.0.0",
|
||||
"ethers": "~4.0.4",
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "3.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.0.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.1 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.0 - _February 5, 2019_
|
||||
|
||||
* Upgrade the bignumber.js to v8.0.2 (#1517)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/abi-gen-wrappers",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -30,19 +30,19 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen-wrappers/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^2.0.0",
|
||||
"@0x/abi-gen": "^2.0.1",
|
||||
"@0x/abi-gen-templates": "^2.0.0",
|
||||
"@0x/tslint-config": "^3.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"ethereum-types": "^2.0.0",
|
||||
"ethers": "~4.0.4",
|
||||
"lodash": "^4.17.11",
|
||||
"shx": "^0.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^4.0.0"
|
||||
"@0x/base-contract": "^4.0.1"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "2.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.1 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.0 - _February 5, 2019_
|
||||
|
||||
* Upgrade the bignumber.js to v8.0.2 (#1517)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/abi-gen",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -32,7 +32,7 @@
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen/README.md",
|
||||
"dependencies": {
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"chalk": "^2.3.0",
|
||||
"ethereum-types": "^2.0.0",
|
||||
"glob": "^7.1.2",
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "2.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.1 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.0 - _February 5, 2019_
|
||||
|
||||
* Upgrade the bignumber.js to v8.0.2 (#1517)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/assert",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,9 +44,9 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/json-schemas": "^3.0.0",
|
||||
"@0x/json-schemas": "^3.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"lodash": "^4.17.11",
|
||||
"valid-url": "^1.0.9"
|
||||
},
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "5.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "5.0.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v5.0.1 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v5.0.0 - _February 5, 2019_
|
||||
|
||||
* Upgrade the bignumber.js to v8.0.2 (#1517)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/asset-buyer",
|
||||
"version": "5.0.0",
|
||||
"version": "5.0.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -36,16 +36,16 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/asset-buyer/README.md",
|
||||
"dependencies": {
|
||||
"@0x/assert": "^2.0.0",
|
||||
"@0x/connect": "^4.0.0",
|
||||
"@0x/contract-wrappers": "^6.0.1",
|
||||
"@0x/json-schemas": "^3.0.0",
|
||||
"@0x/order-utils": "^4.0.0",
|
||||
"@0x/subproviders": "^3.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/assert": "^2.0.1",
|
||||
"@0x/connect": "^4.0.1",
|
||||
"@0x/contract-wrappers": "^7.0.0",
|
||||
"@0x/json-schemas": "^3.0.1",
|
||||
"@0x/order-utils": "^5.0.0",
|
||||
"@0x/subproviders": "^3.0.1",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"ethereum-types": "^2.0.0",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "4.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "4.0.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.0.1 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.0.0 - _February 5, 2019_
|
||||
|
||||
* Upgrade the bignumber.js to v8.0.2 (#1517)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/base-contract",
|
||||
"version": "4.0.0",
|
||||
"version": "4.0.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -41,8 +41,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"ethereum-types": "^2.0.0",
|
||||
"ethers": "~4.0.4",
|
||||
"lodash": "^4.17.11"
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "4.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "4.0.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.0.1 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.0.0 - _February 5, 2019_
|
||||
|
||||
* Upgrade the bignumber.js to v8.0.2 (#1517)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/connect",
|
||||
"version": "4.0.0",
|
||||
"version": "4.0.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,12 +44,12 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/connect/README.md",
|
||||
"dependencies": {
|
||||
"@0x/assert": "^2.0.0",
|
||||
"@0x/json-schemas": "^3.0.0",
|
||||
"@0x/order-utils": "^4.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/assert": "^2.0.1",
|
||||
"@0x/json-schemas": "^3.0.1",
|
||||
"@0x/order-utils": "^5.0.0",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"lodash": "^4.17.11",
|
||||
"query-string": "^6.0.0",
|
||||
"sinon": "^4.0.0",
|
||||
|
@@ -1,13 +1,21 @@
|
||||
[
|
||||
{
|
||||
"version": "6.0.1",
|
||||
"version": "7.0.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Fix OrderValidatorWrapper constructor to use the correct address",
|
||||
"pr": 1568
|
||||
},
|
||||
{
|
||||
"note": "Use new `ZeroExTransaction` interface",
|
||||
"pr": 1576
|
||||
},
|
||||
{
|
||||
"note": "Rename `getTransactionHex` to `getTransactionHashHex`",
|
||||
"pr": 1576
|
||||
}
|
||||
],
|
||||
"timestamp": 1549373905
|
||||
"timestamp": 1549452781
|
||||
},
|
||||
{
|
||||
"version": "6.0.0",
|
||||
|
@@ -5,9 +5,11 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v6.0.1 - _February 5, 2019_
|
||||
## v7.0.0 - _February 6, 2019_
|
||||
|
||||
* Fix OrderValidatorWrapper constructor to use the correct address (#1568)
|
||||
* Use new `ZeroExTransaction` interface (#1576)
|
||||
* Rename `getTransactionHex` to `getTransactionHashHex` (#1576)
|
||||
|
||||
## v6.0.0 - _Invalid date_
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contract-wrappers",
|
||||
"version": "6.0.1",
|
||||
"version": "7.0.0",
|
||||
"description": "Smart TS wrappers for 0x smart contracts",
|
||||
"keywords": [
|
||||
"0xproject",
|
||||
@@ -37,9 +37,9 @@
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/dev-utils": "^2.0.0",
|
||||
"@0x/migrations": "^3.0.0",
|
||||
"@0x/subproviders": "^3.0.0",
|
||||
"@0x/dev-utils": "^2.0.1",
|
||||
"@0x/migrations": "^3.0.1",
|
||||
"@0x/subproviders": "^3.0.1",
|
||||
"@0x/tslint-config": "^3.0.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^2.2.42",
|
||||
@@ -65,18 +65,18 @@
|
||||
"web3-provider-engine": "14.0.6"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/abi-gen-wrappers": "^3.0.0",
|
||||
"@0x/assert": "^2.0.0",
|
||||
"@0x/abi-gen-wrappers": "^3.0.1",
|
||||
"@0x/assert": "^2.0.1",
|
||||
"@0x/contract-addresses": "^2.2.1",
|
||||
"@0x/contract-artifacts": "^1.3.0",
|
||||
"@0x/contracts-test-utils": "^3.0.0",
|
||||
"@0x/fill-scenarios": "^2.0.0",
|
||||
"@0x/json-schemas": "^3.0.0",
|
||||
"@0x/order-utils": "^4.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/contracts-test-utils": "^3.0.1",
|
||||
"@0x/fill-scenarios": "^2.0.1",
|
||||
"@0x/json-schemas": "^3.0.1",
|
||||
"@0x/order-utils": "^5.0.0",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"ethereum-types": "^2.0.0",
|
||||
"ethereumjs-abi": "0.6.5",
|
||||
"ethereumjs-blockstream": "6.0.0",
|
||||
|
@@ -1,9 +1,9 @@
|
||||
import { ExchangeContract } from '@0x/abi-gen-wrappers';
|
||||
|
||||
import { schemas } from '@0x/json-schemas';
|
||||
import { eip712Utils } from '@0x/order-utils';
|
||||
import { transactionHashUtils } from '@0x/order-utils';
|
||||
import { Order, SignedOrder } from '@0x/types';
|
||||
import { BigNumber, signTypedDataUtils } from '@0x/utils';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import _ = require('lodash');
|
||||
|
||||
import { assert } from './assert';
|
||||
@@ -19,23 +19,22 @@ export class TransactionEncoder {
|
||||
this._exchangeInstance = exchangeInstance;
|
||||
}
|
||||
/**
|
||||
* Encodes the transaction data for use with the Exchange contract.
|
||||
* Hashes the transaction data for use with the Exchange contract.
|
||||
* @param data The ABI Encoded 0x Exchange method. I.e fillOrder
|
||||
* @param salt A random value to provide uniqueness and prevent replay attacks.
|
||||
* @param signerAddress The address which will sign this transaction.
|
||||
* @return An unsigned hex encoded transaction for use in 0x Exchange executeTransaction.
|
||||
* @return The hash of the 0x transaction.
|
||||
*/
|
||||
public getTransactionHex(data: string, salt: BigNumber, signerAddress: string): string {
|
||||
public getTransactionHashHex(data: string, salt: BigNumber, signerAddress: string): string {
|
||||
const exchangeAddress = this._getExchangeContract().address;
|
||||
const executeTransactionData = {
|
||||
const transaction = {
|
||||
verifyingContractAddress: exchangeAddress,
|
||||
salt,
|
||||
signerAddress,
|
||||
data,
|
||||
};
|
||||
const typedData = eip712Utils.createZeroExTransactionTypedData(executeTransactionData, exchangeAddress);
|
||||
const eip712MessageBuffer = signTypedDataUtils.generateTypedDataHash(typedData);
|
||||
const messageHex = `0x${eip712MessageBuffer.toString('hex')}`;
|
||||
return messageHex;
|
||||
const hashHex = transactionHashUtils.getTransactionHashHex(transaction);
|
||||
return hashHex;
|
||||
}
|
||||
/**
|
||||
* Encodes a fillOrder transaction.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { BlockchainLifecycle, callbackErrorReporter } from '@0x/dev-utils';
|
||||
import { FillScenarios } from '@0x/fill-scenarios';
|
||||
import { assetDataUtils, orderHashUtils } from '@0x/order-utils';
|
||||
import { assetDataUtils, orderHashUtils, signatureUtils } from '@0x/order-utils';
|
||||
import { DoneCallback, RevertReason, SignedOrder } from '@0x/types';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import * as chai from 'chai';
|
||||
@@ -368,6 +368,23 @@ describe('ExchangeWrapper', () => {
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
|
||||
isPreSigned = await contractWrappers.exchange.isPreSignedAsync(hash, signerAddress);
|
||||
expect(isPreSigned).to.be.true();
|
||||
|
||||
const preSignedSignature = '0x06';
|
||||
const isValidSignature = await contractWrappers.exchange.isValidSignatureAsync(
|
||||
hash,
|
||||
signerAddress,
|
||||
preSignedSignature,
|
||||
);
|
||||
expect(isValidSignature).to.be.true();
|
||||
|
||||
// Test our TS implementation of signature validation
|
||||
const isValidSignatureInTs = await signatureUtils.isValidSignatureAsync(
|
||||
provider,
|
||||
hash,
|
||||
preSignedSignature,
|
||||
signerAddress,
|
||||
);
|
||||
expect(isValidSignatureInTs).to.be.true();
|
||||
});
|
||||
});
|
||||
describe('#getVersionAsync', () => {
|
||||
|
@@ -83,8 +83,8 @@ describe('TransactionEncoder', () => {
|
||||
signerAddress: string = takerAddress,
|
||||
): Promise<void> => {
|
||||
const salt = generatePseudoRandomSalt();
|
||||
const encodedTransaction = encoder.getTransactionHex(data, salt, signerAddress);
|
||||
const signature = await signatureUtils.ecSignHashAsync(provider, encodedTransaction, signerAddress);
|
||||
const transactionHash = encoder.getTransactionHashHex(data, salt, signerAddress);
|
||||
const signature = await signatureUtils.ecSignHashAsync(provider, transactionHash, signerAddress);
|
||||
txHash = await contractWrappers.exchange.executeTransactionAsync(
|
||||
salt,
|
||||
signerAddress,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/dev-tools-pages",
|
||||
"version": "0.0.15",
|
||||
"version": "0.0.16",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -26,7 +26,7 @@
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@0x/react-shared": "^2.0.0",
|
||||
"@0x/react-shared": "^2.0.1",
|
||||
"basscss": "^8.0.3",
|
||||
"bowser": "^1.9.3",
|
||||
"highlight.js": "^9.13.1",
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "2.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.1 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.0 - _February 5, 2019_
|
||||
|
||||
* Upgrade the bignumber.js to v8.0.2 (#1517)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/dev-utils",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -41,11 +41,11 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/subproviders": "^3.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/subproviders": "^3.0.1",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"@types/web3-provider-engine": "^14.0.0",
|
||||
"chai": "^4.0.1",
|
||||
"ethereum-types": "^2.0.0",
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "2.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.1 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.0 - _February 5, 2019_
|
||||
|
||||
* Upgrade the bignumber.js to v8.0.2 (#1517)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/fill-scenarios",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"description": "0x order fill scenario generator",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
@@ -28,14 +28,14 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/abi-gen-wrappers": "^3.0.0",
|
||||
"@0x/base-contract": "^4.0.0",
|
||||
"@0x/abi-gen-wrappers": "^3.0.1",
|
||||
"@0x/base-contract": "^4.0.1",
|
||||
"@0x/contract-artifacts": "^1.3.0",
|
||||
"@0x/order-utils": "^4.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/order-utils": "^5.0.0",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"ethereum-types": "^2.0.0",
|
||||
"ethers": "~4.0.4",
|
||||
"lodash": "^4.17.11"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/instant",
|
||||
"version": "1.0.9",
|
||||
"version": "1.0.10",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -42,15 +42,15 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/instant/README.md",
|
||||
"dependencies": {
|
||||
"@0x/assert": "^2.0.0",
|
||||
"@0x/asset-buyer": "^5.0.0",
|
||||
"@0x/json-schemas": "^3.0.0",
|
||||
"@0x/order-utils": "^4.0.0",
|
||||
"@0x/subproviders": "^3.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/assert": "^2.0.1",
|
||||
"@0x/asset-buyer": "^5.0.1",
|
||||
"@0x/json-schemas": "^3.0.1",
|
||||
"@0x/order-utils": "^5.0.0",
|
||||
"@0x/subproviders": "^3.0.1",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"babel-runtime": "^6.26.0",
|
||||
"bowser": "^1.9.4",
|
||||
"copy-to-clipboard": "^3.0.8",
|
||||
|
@@ -1,10 +1,23 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "3.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.0.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Upgrade the bignumber.js to v8.0.2",
|
||||
"pr": 1517
|
||||
},
|
||||
{
|
||||
"note": "Add `verifyingContractAddress` to `zeroExTransactionSchema`",
|
||||
"pr": 1576
|
||||
}
|
||||
],
|
||||
"timestamp": 1549373905
|
||||
|
@@ -5,9 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.1 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.0 - _February 5, 2019_
|
||||
|
||||
* Upgrade the bignumber.js to v8.0.2 (#1517)
|
||||
* Add `verifyingContractAddress` to `zeroExTransactionSchema` (#1576)
|
||||
|
||||
## v2.1.7 - _January 15, 2019_
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/json-schemas",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -46,7 +46,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/tslint-config": "^3.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@types/lodash.foreach": "^4.5.3",
|
||||
"@types/lodash.values": "^4.3.3",
|
||||
"@types/mocha": "^2.2.42",
|
||||
|
@@ -1,10 +1,11 @@
|
||||
{
|
||||
"id": "/zeroExTransactionSchema",
|
||||
"properties": {
|
||||
"verifyingContractAddress": { "$ref": "/addressSchema" },
|
||||
"data": { "$ref": "/hexSchema" },
|
||||
"signerAddress": { "$ref": "/addressSchema" },
|
||||
"salt": { "$ref": "/wholeNumberSchema" }
|
||||
},
|
||||
"required": ["data", "salt", "signerAddress"],
|
||||
"required": ["verifyingContractAddress", "data", "salt", "signerAddress"],
|
||||
"type": "object"
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/metacoin",
|
||||
"version": "0.0.37",
|
||||
"version": "0.0.38",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -29,18 +29,18 @@
|
||||
"author": "",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@0x/abi-gen": "^2.0.0",
|
||||
"@0x/abi-gen": "^2.0.1",
|
||||
"@0x/abi-gen-templates": "^2.0.0",
|
||||
"@0x/base-contract": "^4.0.0",
|
||||
"@0x/sol-coverage": "^2.0.0",
|
||||
"@0x/sol-profiler": "^2.0.1",
|
||||
"@0x/sol-trace": "^2.0.1",
|
||||
"@0x/subproviders": "^3.0.0",
|
||||
"@0x/base-contract": "^4.0.1",
|
||||
"@0x/sol-coverage": "^2.0.1",
|
||||
"@0x/sol-profiler": "^2.0.2",
|
||||
"@0x/sol-trace": "^2.0.2",
|
||||
"@0x/subproviders": "^3.0.1",
|
||||
"@0x/tslint-config": "^3.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"@types/mocha": "^2.2.42",
|
||||
"copyfiles": "^2.0.0",
|
||||
"ethereum-types": "^2.0.0",
|
||||
@@ -49,8 +49,8 @@
|
||||
"run-s": "^0.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/dev-utils": "^2.0.0",
|
||||
"@0x/sol-compiler": "^3.0.0",
|
||||
"@0x/dev-utils": "^2.0.1",
|
||||
"@0x/sol-compiler": "^3.0.1",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "3.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.0.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.1 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.0 - _February 5, 2019_
|
||||
|
||||
* Upgrade the bignumber.js to v8.0.2 (#1517)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/migrations",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -35,9 +35,9 @@
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@0x/dev-utils": "^2.0.0",
|
||||
"@0x/dev-utils": "^2.0.1",
|
||||
"@0x/tslint-config": "^3.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@types/yargs": "^11.0.0",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
@@ -48,16 +48,16 @@
|
||||
"yargs": "^10.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/abi-gen-wrappers": "^3.0.0",
|
||||
"@0x/base-contract": "^4.0.0",
|
||||
"@0x/abi-gen-wrappers": "^3.0.1",
|
||||
"@0x/base-contract": "^4.0.1",
|
||||
"@0x/contract-addresses": "^2.2.1",
|
||||
"@0x/contract-artifacts": "^1.3.0",
|
||||
"@0x/order-utils": "^4.0.0",
|
||||
"@0x/sol-compiler": "^3.0.0",
|
||||
"@0x/subproviders": "^3.0.0",
|
||||
"@0x/order-utils": "^5.0.0",
|
||||
"@0x/sol-compiler": "^3.0.1",
|
||||
"@0x/subproviders": "^3.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"@ledgerhq/hw-app-eth": "^4.3.0",
|
||||
"ethereum-types": "^2.0.0",
|
||||
"ethers": "~4.0.4",
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@0x/monorepo-scripts",
|
||||
"version": "1.0.20",
|
||||
"version": "1.0.21",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -47,7 +47,7 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@lerna/batch-packages": "^3.0.0-beta.18",
|
||||
"@types/depcheck": "^0.6.0",
|
||||
"async-child-process": "^1.1.1",
|
||||
|
@@ -1,10 +1,32 @@
|
||||
[
|
||||
{
|
||||
"version": "5.0.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Add `transactionHashUtils`",
|
||||
"pr": 1576
|
||||
},
|
||||
{
|
||||
"note": "Refactor `eip712Utils` to allow custom domain params",
|
||||
"pr": 1576
|
||||
},
|
||||
{
|
||||
"note": "Export constant EIP712 params",
|
||||
"pr": 1576
|
||||
}
|
||||
],
|
||||
"timestamp": 1549452781
|
||||
},
|
||||
{
|
||||
"version": "4.0.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Upgrade the bignumber.js to v8.0.2",
|
||||
"pr": 1517
|
||||
},
|
||||
{
|
||||
"note": "Fix preSigned `isSignatureValidAsync` check",
|
||||
"pr": 1580
|
||||
}
|
||||
],
|
||||
"timestamp": 1549373905
|
||||
|
@@ -5,9 +5,16 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v5.0.0 - _February 6, 2019_
|
||||
|
||||
* Add `transactionHashUtils` (#1576)
|
||||
* Refactor `eip712Utils` to allow custom domain params (#1576)
|
||||
* Export constant EIP712 params (#1576)
|
||||
|
||||
## v4.0.0 - _February 5, 2019_
|
||||
|
||||
* Upgrade the bignumber.js to v8.0.2 (#1517)
|
||||
* Fix preSigned `isSignatureValidAsync` check (#1580)
|
||||
|
||||
## v3.1.2 - _January 15, 2019_
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/order-utils",
|
||||
"version": "4.0.0",
|
||||
"version": "5.0.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -35,7 +35,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/order-utils/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/dev-utils": "^2.0.0",
|
||||
"@0x/dev-utils": "^2.0.1",
|
||||
"@0x/tslint-config": "^3.0.0",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
@@ -53,15 +53,16 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/abi-gen-wrappers": "^3.0.0",
|
||||
"@0x/assert": "^2.0.0",
|
||||
"@0x/base-contract": "^4.0.0",
|
||||
"@0x/abi-gen-wrappers": "^3.0.1",
|
||||
"@0x/assert": "^2.0.1",
|
||||
"@0x/base-contract": "^4.0.1",
|
||||
"@0x/contract-addresses": "^2.2.1",
|
||||
"@0x/contract-artifacts": "^1.3.0",
|
||||
"@0x/json-schemas": "^3.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/json-schemas": "^3.0.1",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"@types/node": "*",
|
||||
"bn.js": "^4.11.8",
|
||||
"ethereum-types": "^2.0.0",
|
||||
|
@@ -68,9 +68,9 @@ export const constants = {
|
||||
SELECTOR_CHAR_LENGTH_WITH_PREFIX: 10,
|
||||
INFINITE_TIMESTAMP_SEC: new BigNumber(2524604400), // Close to infinite
|
||||
ZERO_AMOUNT: new BigNumber(0),
|
||||
EIP712_DOMAIN_NAME: '0x Protocol',
|
||||
EIP712_DOMAIN_VERSION: '2',
|
||||
EIP712_DOMAIN_SCHEMA: {
|
||||
EXCHANGE_DOMAIN_NAME: '0x Protocol',
|
||||
EXCHANGE_DOMAIN_VERSION: '2',
|
||||
DEFAULT_DOMAIN_SCHEMA: {
|
||||
name: 'EIP712Domain',
|
||||
parameters: [
|
||||
{ name: 'name', type: 'string' },
|
||||
@@ -78,7 +78,7 @@ export const constants = {
|
||||
{ name: 'verifyingContract', type: 'address' },
|
||||
],
|
||||
},
|
||||
EIP712_ORDER_SCHEMA: {
|
||||
EXCHANGE_ORDER_SCHEMA: {
|
||||
name: 'Order',
|
||||
parameters: [
|
||||
{ name: 'makerAddress', type: 'address' },
|
||||
@@ -95,7 +95,7 @@ export const constants = {
|
||||
{ name: 'takerAssetData', type: 'bytes' },
|
||||
],
|
||||
},
|
||||
EIP712_ZEROEX_TRANSACTION_SCHEMA: {
|
||||
EXCHANGE_ZEROEX_TRANSACTION_SCHEMA: {
|
||||
name: 'ZeroExTransaction',
|
||||
parameters: [
|
||||
{ name: 'salt', type: 'uint256' },
|
||||
|
@@ -1,36 +1,49 @@
|
||||
import { assert } from '@0x/assert';
|
||||
import { schemas } from '@0x/json-schemas';
|
||||
import { EIP712Object, EIP712TypedData, EIP712Types, Order, ZeroExTransaction } from '@0x/types';
|
||||
import {
|
||||
EIP712DomainWithDefaultSchema,
|
||||
EIP712Object,
|
||||
EIP712TypedData,
|
||||
EIP712Types,
|
||||
Order,
|
||||
ZeroExTransaction,
|
||||
} from '@0x/types';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { constants } from './constants';
|
||||
|
||||
export const DEFAULT_DOMAIN_SCHEMA = constants.DEFAULT_DOMAIN_SCHEMA;
|
||||
export const EXCHANGE_DOMAIN_NAME = constants.EXCHANGE_DOMAIN_NAME;
|
||||
export const EXCHANGE_DOMAIN_VERSION = constants.EXCHANGE_DOMAIN_VERSION;
|
||||
export const EXCHANGE_ORDER_SCHEMA = constants.EXCHANGE_ORDER_SCHEMA;
|
||||
export const EXCHANGE_ZEROEX_TRANSACTION_SCHEMA = constants.EXCHANGE_ZEROEX_TRANSACTION_SCHEMA;
|
||||
|
||||
export const eip712Utils = {
|
||||
/**
|
||||
* Creates a EIP712TypedData object specific to the 0x protocol for use with signTypedData.
|
||||
* @param primaryType The primary type found in message
|
||||
* @param types The additional types for the data in message
|
||||
* @param message The contents of the message
|
||||
* @param exchangeAddress The address of the exchange contract
|
||||
* @param domain Domain containing a name (optional), version (optional), and verifying contract address
|
||||
* @return A typed data object
|
||||
*/
|
||||
createTypedData: (
|
||||
primaryType: string,
|
||||
types: EIP712Types,
|
||||
message: EIP712Object,
|
||||
exchangeAddress: string,
|
||||
domain: EIP712DomainWithDefaultSchema,
|
||||
): EIP712TypedData => {
|
||||
assert.isETHAddressHex('exchangeAddress', exchangeAddress);
|
||||
assert.isETHAddressHex('verifyingContractAddress', domain.verifyingContractAddress);
|
||||
assert.isString('primaryType', primaryType);
|
||||
const typedData = {
|
||||
types: {
|
||||
EIP712Domain: constants.EIP712_DOMAIN_SCHEMA.parameters,
|
||||
EIP712Domain: DEFAULT_DOMAIN_SCHEMA.parameters,
|
||||
...types,
|
||||
},
|
||||
domain: {
|
||||
name: constants.EIP712_DOMAIN_NAME,
|
||||
version: constants.EIP712_DOMAIN_VERSION,
|
||||
verifyingContract: exchangeAddress,
|
||||
name: _.isUndefined(domain.name) ? EXCHANGE_DOMAIN_NAME : domain.name,
|
||||
version: _.isUndefined(domain.version) ? EXCHANGE_DOMAIN_VERSION : domain.version,
|
||||
verifyingContract: domain.verifyingContractAddress,
|
||||
},
|
||||
message,
|
||||
primaryType,
|
||||
@@ -48,11 +61,14 @@ export const eip712Utils = {
|
||||
const normalizedOrder = _.mapValues(order, value => {
|
||||
return !_.isString(value) ? value.toString() : value;
|
||||
});
|
||||
const domain = {
|
||||
verifyingContractAddress: order.exchangeAddress,
|
||||
};
|
||||
const typedData = eip712Utils.createTypedData(
|
||||
constants.EIP712_ORDER_SCHEMA.name,
|
||||
{ Order: constants.EIP712_ORDER_SCHEMA.parameters },
|
||||
EXCHANGE_ORDER_SCHEMA.name,
|
||||
{ Order: EXCHANGE_ORDER_SCHEMA.parameters },
|
||||
normalizedOrder,
|
||||
order.exchangeAddress,
|
||||
domain,
|
||||
);
|
||||
return typedData;
|
||||
},
|
||||
@@ -60,23 +76,22 @@ export const eip712Utils = {
|
||||
* Creates an ExecuteTransaction EIP712TypedData object for use with signTypedData and
|
||||
* 0x Exchange executeTransaction.
|
||||
* @param ZeroExTransaction the 0x transaction
|
||||
* @param exchangeAddress The address of the exchange contract
|
||||
* @return A typed data object
|
||||
*/
|
||||
createZeroExTransactionTypedData: (
|
||||
zeroExTransaction: ZeroExTransaction,
|
||||
exchangeAddress: string,
|
||||
): EIP712TypedData => {
|
||||
assert.isETHAddressHex('exchangeAddress', exchangeAddress);
|
||||
createZeroExTransactionTypedData: (zeroExTransaction: ZeroExTransaction): EIP712TypedData => {
|
||||
assert.isETHAddressHex('verifyingContractAddress', zeroExTransaction.verifyingContractAddress);
|
||||
assert.doesConformToSchema('zeroExTransaction', zeroExTransaction, schemas.zeroExTransactionSchema);
|
||||
const normalizedTransaction = _.mapValues(zeroExTransaction, value => {
|
||||
return !_.isString(value) ? value.toString() : value;
|
||||
});
|
||||
const domain = {
|
||||
verifyingContractAddress: zeroExTransaction.verifyingContractAddress,
|
||||
};
|
||||
const typedData = eip712Utils.createTypedData(
|
||||
constants.EIP712_ZEROEX_TRANSACTION_SCHEMA.name,
|
||||
{ ZeroExTransaction: constants.EIP712_ZEROEX_TRANSACTION_SCHEMA.parameters },
|
||||
EXCHANGE_ZEROEX_TRANSACTION_SCHEMA.name,
|
||||
{ ZeroExTransaction: EXCHANGE_ZEROEX_TRANSACTION_SCHEMA.parameters },
|
||||
normalizedTransaction,
|
||||
exchangeAddress,
|
||||
domain,
|
||||
);
|
||||
return typedData;
|
||||
},
|
||||
|
@@ -3,6 +3,7 @@ export { signatureUtils } from './signature_utils';
|
||||
export { generatePseudoRandomSalt } from './salt';
|
||||
export { assetDataUtils } from './asset_data_utils';
|
||||
export { marketUtils } from './market_utils';
|
||||
export { transactionHashUtils } from './transaction_hash';
|
||||
export { rateUtils } from './rate_utils';
|
||||
export { sortingUtils } from './sorting_utils';
|
||||
export { orderParsingUtils } from './parsing_utils';
|
||||
@@ -18,7 +19,14 @@ export { ExchangeTransferSimulator } from './exchange_transfer_simulator';
|
||||
export { BalanceAndProxyAllowanceLazyStore } from './store/balance_and_proxy_allowance_lazy_store';
|
||||
export { OrderFilledCancelledLazyStore } from './store/order_filled_cancelled_lazy_store';
|
||||
|
||||
export { eip712Utils } from './eip712_utils';
|
||||
export {
|
||||
eip712Utils,
|
||||
DEFAULT_DOMAIN_SCHEMA,
|
||||
EXCHANGE_DOMAIN_NAME,
|
||||
EXCHANGE_DOMAIN_VERSION,
|
||||
EXCHANGE_ORDER_SCHEMA,
|
||||
EXCHANGE_ZEROEX_TRANSACTION_SCHEMA,
|
||||
} from './eip712_utils';
|
||||
|
||||
export {
|
||||
Provider,
|
||||
@@ -50,7 +58,9 @@ export {
|
||||
EIP712Types,
|
||||
EIP712Object,
|
||||
EIP712ObjectValue,
|
||||
EIP712DomainWithDefaultSchema,
|
||||
ZeroExTransaction,
|
||||
SignedZeroExTransaction,
|
||||
} from '@0x/types';
|
||||
export {
|
||||
OrderError,
|
||||
|
@@ -4,6 +4,7 @@ import { signTypedDataUtils } from '@0x/utils';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { assert } from './assert';
|
||||
import { constants } from './constants';
|
||||
import { eip712Utils } from './eip712_utils';
|
||||
|
||||
const INVALID_TAKER_FORMAT = 'instance.takerAddress is not of a type(s) string';
|
||||
@@ -34,8 +35,9 @@ export const orderHashUtils = {
|
||||
assert.doesConformToSchema('order', order, schemas.orderSchema, [schemas.hexSchema]);
|
||||
} catch (error) {
|
||||
if (_.includes(error.message, INVALID_TAKER_FORMAT)) {
|
||||
const errMsg =
|
||||
'Order taker must be of type string. If you want anyone to be able to fill an order - pass ZeroEx.NULL_ADDRESS';
|
||||
const errMsg = `Order taker must be of type string. If you want anyone to be able to fill an order - pass ${
|
||||
constants.NULL_ADDRESS
|
||||
}`;
|
||||
throw new Error(errMsg);
|
||||
}
|
||||
throw error;
|
||||
@@ -51,6 +53,17 @@ export const orderHashUtils = {
|
||||
* @return A Buffer containing the resulting orderHash from hashing the supplied order
|
||||
*/
|
||||
getOrderHashBuffer(order: SignedOrder | Order): Buffer {
|
||||
try {
|
||||
assert.doesConformToSchema('order', order, schemas.orderSchema, [schemas.hexSchema]);
|
||||
} catch (error) {
|
||||
if (_.includes(error.message, INVALID_TAKER_FORMAT)) {
|
||||
const errMsg = `Order taker must be of type string. If you want anyone to be able to fill an order - pass ${
|
||||
constants.NULL_ADDRESS
|
||||
}`;
|
||||
throw new Error(errMsg);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
const typedData = eip712Utils.createOrderTypedData(order);
|
||||
const orderHashBuff = signTypedDataUtils.generateTypedDataHash(typedData);
|
||||
return orderHashBuff;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import { ExchangeContract, IValidatorContract, IWalletContract } from '@0x/abi-gen-wrappers';
|
||||
import { getContractAddressesForNetworkOrThrow } from '@0x/contract-addresses';
|
||||
import * as artifacts from '@0x/contract-artifacts';
|
||||
import { schemas } from '@0x/json-schemas';
|
||||
import { ECSignature, Order, SignatureType, SignedOrder, ValidatorSignature } from '@0x/types';
|
||||
@@ -92,7 +93,14 @@ export const signatureUtils = {
|
||||
assert.isWeb3Provider('provider', provider);
|
||||
assert.isHexString('data', data);
|
||||
assert.isETHAddressHex('signerAddress', signerAddress);
|
||||
const exchangeContract = new ExchangeContract(artifacts.Exchange.compilerOutput.abi, signerAddress, provider);
|
||||
const web3Wrapper = new Web3Wrapper(provider);
|
||||
const networkId = await web3Wrapper.getNetworkIdAsync();
|
||||
const addresses = getContractAddressesForNetworkOrThrow(networkId);
|
||||
const exchangeContract = new ExchangeContract(
|
||||
artifacts.Exchange.compilerOutput.abi,
|
||||
addresses.exchange,
|
||||
provider,
|
||||
);
|
||||
const isValid = await exchangeContract.preSigned.callAsync(data, signerAddress);
|
||||
return isValid;
|
||||
},
|
||||
|
46
packages/order-utils/src/transaction_hash.ts
Normal file
46
packages/order-utils/src/transaction_hash.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import { schemas, SchemaValidator } from '@0x/json-schemas';
|
||||
import { SignedZeroExTransaction, ZeroExTransaction } from '@0x/types';
|
||||
import { signTypedDataUtils } from '@0x/utils';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { assert } from './assert';
|
||||
import { eip712Utils } from './eip712_utils';
|
||||
|
||||
export const transactionHashUtils = {
|
||||
/**
|
||||
* Checks if the supplied hex encoded 0x transaction hash is valid.
|
||||
* Note: Valid means it has the expected format, not that a transaction with the transactionHash exists.
|
||||
* Use this method when processing transactionHashes submitted as user input.
|
||||
* @param transactionHash Hex encoded transactionHash.
|
||||
* @return Whether the supplied transactionHash has the expected format.
|
||||
*/
|
||||
isValidTransactionHash(transactionHash: string): boolean {
|
||||
// Since this method can be called to check if any arbitrary string conforms to an transactionHash's
|
||||
// format, we only assert that we were indeed passed a string.
|
||||
assert.isString('transactionHash', transactionHash);
|
||||
const schemaValidator = new SchemaValidator();
|
||||
const isValid = schemaValidator.validate(transactionHash, schemas.orderHashSchema).valid;
|
||||
return isValid;
|
||||
},
|
||||
/**
|
||||
* Computes the transactionHash for a supplied 0x transaction.
|
||||
* @param transaction An object that conforms to the ZeroExTransaction or SignedZeroExTransaction interface definitions.
|
||||
* @return Hex encoded string transactionHash from hashing the supplied order.
|
||||
*/
|
||||
getTransactionHashHex(transaction: ZeroExTransaction | SignedZeroExTransaction): string {
|
||||
assert.doesConformToSchema('transaction', transaction, schemas.zeroExTransactionSchema, [schemas.hexSchema]);
|
||||
const transactionHashBuff = transactionHashUtils.getTransactionHashBuffer(transaction);
|
||||
const transactionHashHex = `0x${transactionHashBuff.toString('hex')}`;
|
||||
return transactionHashHex;
|
||||
},
|
||||
/**
|
||||
* Computes the transactionHash for a supplied 0x transaction.
|
||||
* @param transaction An object that conforms to the ZeroExTransaction or SignedZeroExTransaction interface definitions.
|
||||
* @return A Buffer containing the resulting transactionHash from hashing the supplied 0x transaction.
|
||||
*/
|
||||
getTransactionHashBuffer(transaction: ZeroExTransaction | SignedZeroExTransaction): Buffer {
|
||||
const typedData = eip712Utils.createZeroExTransactionTypedData(transaction);
|
||||
const transactionHashBuff = signTypedDataUtils.generateTypedDataHash(typedData);
|
||||
return transactionHashBuff;
|
||||
},
|
||||
};
|
@@ -3,7 +3,12 @@ import * as chai from 'chai';
|
||||
import 'mocha';
|
||||
|
||||
import { constants } from '../src/constants';
|
||||
import { eip712Utils } from '../src/eip712_utils';
|
||||
import {
|
||||
eip712Utils,
|
||||
EXCHANGE_DOMAIN_NAME,
|
||||
EXCHANGE_DOMAIN_VERSION,
|
||||
EXCHANGE_ZEROEX_TRANSACTION_SCHEMA,
|
||||
} from '../src/eip712_utils';
|
||||
|
||||
import { chaiSetup } from './utils/chai_setup';
|
||||
|
||||
@@ -12,33 +17,55 @@ const expect = chai.expect;
|
||||
|
||||
describe('EIP712 Utils', () => {
|
||||
describe('createTypedData', () => {
|
||||
it('adds in the EIP712DomainSeparator', () => {
|
||||
it('adds in the EIP712DomainSeparator with default values', () => {
|
||||
const primaryType = 'Test';
|
||||
const typedData = eip712Utils.createTypedData(
|
||||
primaryType,
|
||||
{ Test: [{ name: 'testValue', type: 'uint256' }] },
|
||||
{ testValue: '1' },
|
||||
constants.NULL_ADDRESS,
|
||||
{ verifyingContractAddress: constants.NULL_ADDRESS },
|
||||
);
|
||||
expect(typedData.domain).to.not.be.undefined();
|
||||
expect(typedData.types.EIP712Domain).to.not.be.undefined();
|
||||
const domainObject = typedData.domain;
|
||||
expect(domainObject.name).to.eq(constants.EIP712_DOMAIN_NAME);
|
||||
expect(domainObject.name).to.eq(EXCHANGE_DOMAIN_NAME);
|
||||
expect(domainObject.version).to.eq(EXCHANGE_DOMAIN_VERSION);
|
||||
expect(domainObject.verifyingContract).to.eq(constants.NULL_ADDRESS);
|
||||
expect(typedData.primaryType).to.eq(primaryType);
|
||||
});
|
||||
it('adds in the EIP712DomainSeparator without default values', () => {
|
||||
const primaryType = 'Test';
|
||||
const domainName = 'testDomain';
|
||||
const domainVersion = 'testVersion';
|
||||
const typedData = eip712Utils.createTypedData(
|
||||
primaryType,
|
||||
{ Test: [{ name: 'testValue', type: 'uint256' }] },
|
||||
{ testValue: '1' },
|
||||
{ name: domainName, version: domainVersion, verifyingContractAddress: constants.NULL_ADDRESS },
|
||||
);
|
||||
expect(typedData.domain).to.not.be.undefined();
|
||||
expect(typedData.types.EIP712Domain).to.not.be.undefined();
|
||||
const domainObject = typedData.domain;
|
||||
expect(domainObject.name).to.eq(domainName);
|
||||
expect(domainObject.version).to.eq(domainVersion);
|
||||
expect(domainObject.verifyingContract).to.eq(constants.NULL_ADDRESS);
|
||||
expect(typedData.primaryType).to.eq(primaryType);
|
||||
});
|
||||
});
|
||||
describe('createTypedData', () => {
|
||||
describe('createZeroExTransactionTypedData', () => {
|
||||
it('adds in the EIP712DomainSeparator', () => {
|
||||
const typedData = eip712Utils.createZeroExTransactionTypedData(
|
||||
{
|
||||
salt: new BigNumber('0'),
|
||||
data: constants.NULL_BYTES,
|
||||
signerAddress: constants.NULL_ADDRESS,
|
||||
},
|
||||
constants.NULL_ADDRESS,
|
||||
);
|
||||
expect(typedData.primaryType).to.eq(constants.EIP712_ZEROEX_TRANSACTION_SCHEMA.name);
|
||||
const typedData = eip712Utils.createZeroExTransactionTypedData({
|
||||
salt: new BigNumber('0'),
|
||||
data: constants.NULL_BYTES,
|
||||
signerAddress: constants.NULL_ADDRESS,
|
||||
verifyingContractAddress: constants.NULL_ADDRESS,
|
||||
});
|
||||
expect(typedData.primaryType).to.eq(EXCHANGE_ZEROEX_TRANSACTION_SCHEMA.name);
|
||||
expect(typedData.types.EIP712Domain).to.not.be.undefined();
|
||||
const domainObject = typedData.domain;
|
||||
expect(domainObject.name).to.eq(EXCHANGE_DOMAIN_NAME);
|
||||
expect(domainObject.version).to.eq(EXCHANGE_DOMAIN_VERSION);
|
||||
expect(domainObject.verifyingContract).to.eq(constants.NULL_ADDRESS);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -54,8 +54,9 @@ describe('Order hashing', () => {
|
||||
...order,
|
||||
takerAddress: (null as any) as string,
|
||||
};
|
||||
const expectedErrorMessage =
|
||||
'Order taker must be of type string. If you want anyone to be able to fill an order - pass ZeroEx.NULL_ADDRESS';
|
||||
const expectedErrorMessage = `Order taker must be of type string. If you want anyone to be able to fill an order - pass ${
|
||||
constants.NULL_ADDRESS
|
||||
}`;
|
||||
expect(() => orderHashUtils.getOrderHashHex(orderWithInvalidtakerFormat)).to.throw(expectedErrorMessage);
|
||||
});
|
||||
});
|
||||
|
@@ -99,6 +99,17 @@ describe('Signature utils', () => {
|
||||
);
|
||||
expect(isValidSignatureLocal).to.be.true();
|
||||
});
|
||||
|
||||
it('should return false if entry not found in `preSigned` mapping', async () => {
|
||||
const preSignedSignature = '0x06';
|
||||
const isValidPreSignature = await signatureUtils.isValidSignatureAsync(
|
||||
provider,
|
||||
dataHex,
|
||||
preSignedSignature,
|
||||
address,
|
||||
);
|
||||
expect(isValidPreSignature).to.be.false();
|
||||
});
|
||||
});
|
||||
describe('#isValidECSignature', () => {
|
||||
const signature = {
|
||||
|
56
packages/order-utils/test/transaction_hash_test.ts
Normal file
56
packages/order-utils/test/transaction_hash_test.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import { ZeroExTransaction } from '@0x/types';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import * as chai from 'chai';
|
||||
import 'mocha';
|
||||
|
||||
import { transactionHashUtils } from '../src';
|
||||
|
||||
import { constants } from '../src/constants';
|
||||
|
||||
import { chaiSetup } from './utils/chai_setup';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
|
||||
describe('0x transaction hashing', () => {
|
||||
describe('#getTransactionHashHex', () => {
|
||||
const expectedTransactionHash = '0x82c9bb2dcac4f868ec7a15c20ff6175cfc384c20ae6a872aa0342a840f108c2b';
|
||||
const fakeVerifyingContractAddress = '0x5e72914535f202659083db3a02c984188fa26e9f';
|
||||
const transaction: ZeroExTransaction = {
|
||||
verifyingContractAddress: fakeVerifyingContractAddress,
|
||||
signerAddress: constants.NULL_ADDRESS,
|
||||
salt: new BigNumber(0),
|
||||
data: constants.NULL_BYTES,
|
||||
};
|
||||
it('calculates the transaction hash', async () => {
|
||||
const transactionHash = transactionHashUtils.getTransactionHashHex(transaction);
|
||||
expect(transactionHash).to.be.equal(expectedTransactionHash);
|
||||
});
|
||||
it('calculates the transaction hash if amounts are strings', async () => {
|
||||
// It's common for developers using javascript to provide the amounts
|
||||
// as strings. Since we eventually toString() the BigNumber
|
||||
// before encoding we should result in the same orderHash in this scenario
|
||||
// tslint:disable-next-line:no-unnecessary-type-assertion
|
||||
const transactionHash = transactionHashUtils.getTransactionHashHex({
|
||||
...transaction,
|
||||
salt: '0',
|
||||
} as any);
|
||||
expect(transactionHash).to.be.equal(expectedTransactionHash);
|
||||
});
|
||||
});
|
||||
describe('#isValidTransactionHash', () => {
|
||||
it('returns false if the value is not a hex string', () => {
|
||||
const isValid = transactionHashUtils.isValidTransactionHash('not a hex');
|
||||
expect(isValid).to.be.false();
|
||||
});
|
||||
it('returns false if the length is wrong', () => {
|
||||
const isValid = transactionHashUtils.isValidTransactionHash('0xdeadbeef');
|
||||
expect(isValid).to.be.false();
|
||||
});
|
||||
it('returns true if order hash is correct', () => {
|
||||
const orderHashLength = 65;
|
||||
const isValid = transactionHashUtils.isValidTransactionHash(`0x${Array(orderHashLength).join('0')}`);
|
||||
expect(isValid).to.be.true();
|
||||
});
|
||||
});
|
||||
});
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "3.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.0.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.1 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.0 - _February 5, 2019_
|
||||
|
||||
* Upgrade the bignumber.js to v8.0.2 (#1517)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/order-watcher",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.1",
|
||||
"description": "An order watcher daemon that watches for order validity",
|
||||
"keywords": [
|
||||
"0x",
|
||||
@@ -38,9 +38,9 @@
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/dev-utils": "^2.0.0",
|
||||
"@0x/migrations": "^3.0.0",
|
||||
"@0x/subproviders": "^3.0.0",
|
||||
"@0x/dev-utils": "^2.0.1",
|
||||
"@0x/migrations": "^3.0.1",
|
||||
"@0x/subproviders": "^3.0.1",
|
||||
"@0x/tslint-config": "^3.0.0",
|
||||
"@types/bintrees": "^1.0.2",
|
||||
"@types/lodash": "4.14.104",
|
||||
@@ -63,19 +63,19 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/abi-gen-wrappers": "^3.0.0",
|
||||
"@0x/assert": "^2.0.0",
|
||||
"@0x/base-contract": "^4.0.0",
|
||||
"@0x/abi-gen-wrappers": "^3.0.1",
|
||||
"@0x/assert": "^2.0.1",
|
||||
"@0x/base-contract": "^4.0.1",
|
||||
"@0x/contract-addresses": "^2.2.1",
|
||||
"@0x/contract-artifacts": "^1.3.0",
|
||||
"@0x/contract-wrappers": "^6.0.1",
|
||||
"@0x/fill-scenarios": "^2.0.0",
|
||||
"@0x/json-schemas": "^3.0.0",
|
||||
"@0x/order-utils": "^4.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/contract-wrappers": "^7.0.0",
|
||||
"@0x/fill-scenarios": "^2.0.1",
|
||||
"@0x/json-schemas": "^3.0.1",
|
||||
"@0x/order-utils": "^5.0.0",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/typescript-typings": "^4.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"bintrees": "^1.0.2",
|
||||
"ethereum-types": "^2.0.0",
|
||||
"ethereumjs-blockstream": "6.0.0",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/pipeline",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.7",
|
||||
"private": true,
|
||||
"description": "Data pipeline for offline analysis",
|
||||
"scripts": {
|
||||
@@ -39,16 +39,16 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/connect": "^4.0.0",
|
||||
"@0x/connect": "^4.0.1",
|
||||
"@0x/contract-addresses": "^2.2.1",
|
||||
"@0x/contract-artifacts": "^1.3.0",
|
||||
"@0x/contract-wrappers": "^6.0.1",
|
||||
"@0x/dev-utils": "^2.0.0",
|
||||
"@0x/order-utils": "^4.0.0",
|
||||
"@0x/subproviders": "^3.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/web3-wrapper": "^4.0.0",
|
||||
"@0x/contract-wrappers": "^7.0.0",
|
||||
"@0x/dev-utils": "^2.0.1",
|
||||
"@0x/order-utils": "^5.0.0",
|
||||
"@0x/subproviders": "^3.0.1",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@0x/web3-wrapper": "^4.0.1",
|
||||
"@types/dockerode": "^2.5.9",
|
||||
"@types/p-limit": "^2.0.0",
|
||||
"async-parallel": "^1.2.3",
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "2.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.1 - _February 6, 2019_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.0 - _February 5, 2019_
|
||||
|
||||
* Upgrade the bignumber.js to v8.0.2 (#1517)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/react-docs",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -24,7 +24,7 @@
|
||||
"url": "https://github.com/0xProject/0x-monorepo.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/dev-utils": "^2.0.0",
|
||||
"@0x/dev-utils": "^2.0.1",
|
||||
"@0x/tslint-config": "^3.0.0",
|
||||
"@types/compare-versions": "^3.0.0",
|
||||
"@types/styled-components": "4.0.0",
|
||||
@@ -34,9 +34,9 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/react-shared": "^2.0.0",
|
||||
"@0x/types": "^2.0.0",
|
||||
"@0x/utils": "^4.0.1",
|
||||
"@0x/react-shared": "^2.0.1",
|
||||
"@0x/types": "^2.0.1",
|
||||
"@0x/utils": "^4.0.2",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/material-ui": "^0.20.0",
|
||||
"@types/node": "*",
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1549452781,
|
||||
"version": "2.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"changes": [
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user