aboutsummaryrefslogtreecommitdiffstats
path: root/packages/types
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-12-07 01:55:09 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-12-07 01:55:09 +0800
commitf1b267cc9fe7f6e5566dc2535b064b92aef92df1 (patch)
treec07a9dd32c5b959d33587ce2d38098dfe397badb /packages/types
parent598f1dd2d8a89b0e3ab04b2917138997031bafc6 (diff)
downloaddexon-sol-tools-f1b267cc9fe7f6e5566dc2535b064b92aef92df1.tar
dexon-sol-tools-f1b267cc9fe7f6e5566dc2535b064b92aef92df1.tar.gz
dexon-sol-tools-f1b267cc9fe7f6e5566dc2535b064b92aef92df1.tar.bz2
dexon-sol-tools-f1b267cc9fe7f6e5566dc2535b064b92aef92df1.tar.lz
dexon-sol-tools-f1b267cc9fe7f6e5566dc2535b064b92aef92df1.tar.xz
dexon-sol-tools-f1b267cc9fe7f6e5566dc2535b064b92aef92df1.tar.zst
dexon-sol-tools-f1b267cc9fe7f6e5566dc2535b064b92aef92df1.zip
Refactor web3Wrapper to a separate package
Diffstat (limited to 'packages/types')
-rw-r--r--packages/types/README.md10
-rw-r--r--packages/types/package.json32
-rw-r--r--packages/types/src/index.ts23
-rw-r--r--packages/types/tsconfig.json16
-rw-r--r--packages/types/tslint.json5
5 files changed, 86 insertions, 0 deletions
diff --git a/packages/types/README.md b/packages/types/README.md
new file mode 100644
index 000000000..0df8c6333
--- /dev/null
+++ b/packages/types/README.md
@@ -0,0 +1,10 @@
+Web3 wrapper
+------
+
+Wrapped version of web3 with nicer interface to be used across 0x projects and packages
+
+## Install
+
+```bash
+yarn add @0xproject/web3-wrapper
+```
diff --git a/packages/types/package.json b/packages/types/package.json
new file mode 100644
index 000000000..f55be284e
--- /dev/null
+++ b/packages/types/package.json
@@ -0,0 +1,32 @@
+{
+ "name": "@0xproject/types",
+ "version": "0.0.1",
+ "description": "0x types",
+ "main": "lib/index.js",
+ "types": "lib/index.d.ts",
+ "scripts": {
+ "build": "tsc",
+ "clean": "shx rm -rf lib",
+ "lint": "tslint --project . 'src/**/*.ts'"
+ },
+ "license": "Apache-2.0",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/0xProject/0x.js.git"
+ },
+ "bugs": {
+ "url": "https://github.com/0xProject/0x.js/issues"
+ },
+ "homepage": "https://github.com/0xProject/0x.js/packages/types/README.md",
+ "devDependencies": {
+ "@0xproject/tslint-config": "^0.2.0",
+ "bignumber.js": "^5.0.0",
+ "shx": "^0.2.2",
+ "tslint": "5.8.0",
+ "typescript": "~2.6.1"
+ },
+ "dependencies": {
+ "bignumber.js": "~4.1.0",
+ "web3": "^0.20.0"
+ }
+}
diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts
new file mode 100644
index 000000000..8d69af63d
--- /dev/null
+++ b/packages/types/src/index.ts
@@ -0,0 +1,23 @@
+import {BigNumber} from 'bignumber.js';
+import * as Web3 from 'web3';
+
+export interface TxData {
+ from?: string;
+ gas?: number;
+ gasPrice?: BigNumber;
+ nonce?: number;
+}
+
+export interface TransactionReceipt {
+ blockHash: string;
+ blockNumber: number;
+ transactionHash: string;
+ transactionIndex: number;
+ from: string;
+ to: string;
+ status: null|0|1;
+ cumulativeGasUsed: number;
+ gasUsed: number;
+ contractAddress: string|null;
+ logs: Web3.LogEntry[];
+}
diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json
new file mode 100644
index 000000000..de186cfc4
--- /dev/null
+++ b/packages/types/tsconfig.json
@@ -0,0 +1,16 @@
+{
+ "compilerOptions": {
+ "module": "commonjs",
+ "target": "es5",
+ "lib": [ "es2017", "dom"],
+ "outDir": "lib",
+ "sourceMap": true,
+ "declaration": true,
+ "noImplicitAny": true,
+ "strictNullChecks": true
+ },
+ "include": [
+ "./src/**/*",
+ "../../node_modules/web3-typescript-typings/index.d.ts"
+ ]
+}
diff --git a/packages/types/tslint.json b/packages/types/tslint.json
new file mode 100644
index 000000000..a07795151
--- /dev/null
+++ b/packages/types/tslint.json
@@ -0,0 +1,5 @@
+{
+ "extends": [
+ "@0xproject/tslint-config"
+ ]
+}