aboutsummaryrefslogtreecommitdiffstats
path: root/packages/types
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2019-01-09 19:02:25 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2019-01-09 19:02:25 +0800
commitea14913b412e78ff458bdfba47182f7363e776e5 (patch)
tree3ee220bfbbd9923b5e1adc36ee51f9b5d39ad640 /packages/types
parent5868c91cfb54cfa9177572b201d88d1168bf5b06 (diff)
parent5dd55491b86bf8577405e37d0f2d668aa1273b10 (diff)
downloaddexon-sol-tools-ea14913b412e78ff458bdfba47182f7363e776e5.tar
dexon-sol-tools-ea14913b412e78ff458bdfba47182f7363e776e5.tar.gz
dexon-sol-tools-ea14913b412e78ff458bdfba47182f7363e776e5.tar.bz2
dexon-sol-tools-ea14913b412e78ff458bdfba47182f7363e776e5.tar.lz
dexon-sol-tools-ea14913b412e78ff458bdfba47182f7363e776e5.tar.xz
dexon-sol-tools-ea14913b412e78ff458bdfba47182f7363e776e5.tar.zst
dexon-sol-tools-ea14913b412e78ff458bdfba47182f7363e776e5.zip
Merge development
Diffstat (limited to 'packages/types')
-rw-r--r--packages/types/CHANGELOG.json47
-rw-r--r--packages/types/CHANGELOG.md13
-rw-r--r--packages/types/package.json6
-rw-r--r--packages/types/src/index.ts63
4 files changed, 124 insertions, 5 deletions
diff --git a/packages/types/CHANGELOG.json b/packages/types/CHANGELOG.json
index 6d9f83c57..7094953cb 100644
--- a/packages/types/CHANGELOG.json
+++ b/packages/types/CHANGELOG.json
@@ -1,5 +1,52 @@
[
{
+ "version": "1.5.0",
+ "changes": [
+ {
+ "note": "Added types for Dutch Auction contract",
+ "pr": 1465
+ }
+ ]
+ },
+ {
+ "version": "1.4.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ],
+ "timestamp": 1544739608
+ },
+ {
+ "version": "1.4.0",
+ "changes": [
+ {
+ "note": "Add `LengthMismatch` and `LengthGreaterThan3Required` revert reasons",
+ "pr": 1224
+ },
+ {
+ "note": "Add RevertReasons for DutchAuction contract",
+ "pr": 1225
+ },
+ {
+ "note": "Add MultiAsset types",
+ "pr": 1363
+ }
+ ],
+ "timestamp": 1544570656
+ },
+ {
+ "version": "1.3.0",
+ "changes": [
+ {
+ "note":
+ "Add the `SimpleContractArtifact` type, which describes the artifact format published in the `@0x/contract-artifacts` package",
+ "pr": 1298
+ }
+ ],
+ "timestamp": 1542821676
+ },
+ {
"version": "1.2.1",
"changes": [
{
diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md
index 556bf1799..5170eb4db 100644
--- a/packages/types/CHANGELOG.md
+++ b/packages/types/CHANGELOG.md
@@ -5,6 +5,19 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v1.4.1 - _December 13, 2018_
+
+ * Dependencies updated
+
+## v1.4.0 - _December 11, 2018_
+
+ * Add `LengthMismatch` and `LengthGreaterThan3Required` revert reasons (#1224)
+ * Add RevertReasons for DutchAuction contract (#1225)
+
+## v1.3.0 - _November 21, 2018_
+
+ * Add the `SimpleContractArtifact` type, which describes the artifact format published in the `@0x/contract-artifacts` package (#1298)
+
## v1.2.1 - _November 9, 2018_
* Dependencies updated
diff --git a/packages/types/package.json b/packages/types/package.json
index c32e9a6f7..3c4bb6fe6 100644
--- a/packages/types/package.json
+++ b/packages/types/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/types",
- "version": "1.2.1",
+ "version": "1.4.1",
"engines": {
"node": ">=6.12"
},
@@ -23,7 +23,7 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/types/README.md",
"devDependencies": {
- "@0x/tslint-config": "^1.0.10",
+ "@0x/tslint-config": "^2.0.0",
"make-promises-safe": "^1.1.0",
"shx": "^0.2.2",
"tslint": "5.11.0",
@@ -32,7 +32,7 @@
"dependencies": {
"@types/node": "*",
"bignumber.js": "~4.1.0",
- "ethereum-types": "^1.1.2"
+ "ethereum-types": "^1.1.4"
},
"publishConfig": {
"access": "public"
diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts
index 3c9b6bbc5..49f788fb0 100644
--- a/packages/types/src/index.ts
+++ b/packages/types/src/index.ts
@@ -1,7 +1,7 @@
// tslint:disable:max-file-line-count
import { BigNumber } from 'bignumber.js';
-import { ContractAbi } from 'ethereum-types';
+import { ContractAbi, ContractNetworks, DevdocOutput } from 'ethereum-types';
// HACK: Rather then extending from OrderWithoutExchangeAddress
// we don't, because our docs don't expand inherited types, and it's unnecessarily
@@ -110,7 +110,9 @@ export type DoneCallback = (err?: Error) => void;
export interface OrderRelevantState {
makerBalance: BigNumber;
+ makerIndividualBalances: ObjectMap<BigNumber>;
makerProxyAllowance: BigNumber;
+ makerIndividualProxyAllowances: ObjectMap<BigNumber>;
makerFeeBalance: BigNumber;
makerFeeProxyAllowance: BigNumber;
filledTakerAssetAmount: BigNumber;
@@ -155,6 +157,7 @@ export enum SignatureType {
export enum AssetProxyId {
ERC20 = '0xf47261b0',
ERC721 = '0x02571792',
+ MultiAsset = '0x94cfcdd7',
}
export interface ERC20AssetData {
@@ -168,7 +171,21 @@ export interface ERC721AssetData {
tokenId: BigNumber;
}
-export type AssetData = ERC20AssetData | ERC721AssetData;
+export type SingleAssetData = ERC20AssetData | ERC721AssetData;
+
+export interface MultiAssetData {
+ assetProxyId: string;
+ amounts: BigNumber[];
+ nestedAssetData: string[];
+}
+
+export interface MultiAssetDataWithRecursiveDecoding {
+ assetProxyId: string;
+ amounts: BigNumber[];
+ nestedAssetData: SingleAssetData[];
+}
+
+export type AssetData = SingleAssetData | MultiAssetData | MultiAssetDataWithRecursiveDecoding;
// TODO: DRY. These should be extracted from contract code.
export enum RevertReason {
@@ -195,6 +212,7 @@ export enum RevertReason {
FailedExecution = 'FAILED_EXECUTION',
AssetProxyAlreadyExists = 'ASSET_PROXY_ALREADY_EXISTS',
LengthGreaterThan0Required = 'LENGTH_GREATER_THAN_0_REQUIRED',
+ LengthGreaterThan3Required = 'LENGTH_GREATER_THAN_3_REQUIRED',
LengthGreaterThan131Required = 'LENGTH_GREATER_THAN_131_REQUIRED',
Length0Required = 'LENGTH_0_REQUIRED',
Length65Required = 'LENGTH_65_REQUIRED',
@@ -209,6 +227,7 @@ export enum RevertReason {
MakerNotWhitelisted = 'MAKER_NOT_WHITELISTED',
TakerNotWhitelisted = 'TAKER_NOT_WHITELISTED',
AssetProxyDoesNotExist = 'ASSET_PROXY_DOES_NOT_EXIST',
+ LengthMismatch = 'LENGTH_MISMATCH',
LibBytesGreaterThanZeroLengthRequired = 'GREATER_THAN_ZERO_LENGTH_REQUIRED',
LibBytesGreaterOrEqualTo4LengthRequired = 'GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED',
LibBytesGreaterOrEqualTo20LengthRequired = 'GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED',
@@ -235,6 +254,16 @@ export enum RevertReason {
TxFullyConfirmed = 'TX_FULLY_CONFIRMED',
TxNotFullyConfirmed = 'TX_NOT_FULLY_CONFIRMED',
TimeLockIncomplete = 'TIME_LOCK_INCOMPLETE',
+ // DutchAuction
+ AuctionInvalidAmount = 'INVALID_AMOUNT',
+ AuctionExpired = 'AUCTION_EXPIRED',
+ AuctionNotStarted = 'AUCTION_NOT_STARTED',
+ AuctionInvalidBeginTime = 'INVALID_BEGIN_TIME',
+ InvalidAssetData = 'INVALID_ASSET_DATA',
+ // Balance Threshold Filter
+ InvalidOrBlockedExchangeSelector = 'INVALID_OR_BLOCKED_EXCHANGE_SELECTOR',
+ BalanceQueryFailed = 'BALANCE_QUERY_FAILED',
+ AtLeastOneAddressDoesNotMeetBalanceThreshold = 'AT_LEAST_ONE_ADDRESS_DOES_NOT_MEET_BALANCE_THRESHOLD',
}
export enum StatusCodes {
@@ -626,3 +655,33 @@ export interface EIP712TypedData {
export interface Stats {
orderCount: number;
}
+
+export interface SimpleContractArtifact {
+ schemaVersion: string;
+ contractName: string;
+ compilerOutput: SimpleStandardContractOutput;
+ networks: ContractNetworks;
+}
+
+export interface SimpleStandardContractOutput {
+ abi: ContractAbi;
+ evm: SimpleEvmOutput;
+ devdoc?: DevdocOutput;
+}
+
+export interface SimpleEvmOutput {
+ bytecode: SimpleEvmBytecodeOutput;
+}
+
+export interface SimpleEvmBytecodeOutput {
+ object: string;
+}
+
+export interface DutchAuctionDetails {
+ beginTimeSeconds: BigNumber;
+ endTimeSeconds: BigNumber;
+ beginAmount: BigNumber;
+ endAmount: BigNumber;
+ currentAmount: BigNumber;
+ currentTimeSeconds: BigNumber;
+}