aboutsummaryrefslogtreecommitdiffstats
path: root/packages/deployer/src/utils/types.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-01-18 22:12:56 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-01-18 22:12:56 +0800
commitb20f34adb7726c4389012c2373bacc7e1b05b620 (patch)
treee0297b96e45f080fd786ea5773c133ddfb908e71 /packages/deployer/src/utils/types.ts
parent63d0d810b1ab7710102fce99b66f5a7f55162611 (diff)
downloaddexon-0x-contracts-b20f34adb7726c4389012c2373bacc7e1b05b620.tar
dexon-0x-contracts-b20f34adb7726c4389012c2373bacc7e1b05b620.tar.gz
dexon-0x-contracts-b20f34adb7726c4389012c2373bacc7e1b05b620.tar.bz2
dexon-0x-contracts-b20f34adb7726c4389012c2373bacc7e1b05b620.tar.lz
dexon-0x-contracts-b20f34adb7726c4389012c2373bacc7e1b05b620.tar.xz
dexon-0x-contracts-b20f34adb7726c4389012c2373bacc7e1b05b620.tar.zst
dexon-0x-contracts-b20f34adb7726c4389012c2373bacc7e1b05b620.zip
Change file layout
Diffstat (limited to 'packages/deployer/src/utils/types.ts')
-rw-r--r--packages/deployer/src/utils/types.ts97
1 files changed, 97 insertions, 0 deletions
diff --git a/packages/deployer/src/utils/types.ts b/packages/deployer/src/utils/types.ts
new file mode 100644
index 000000000..e054b9cc2
--- /dev/null
+++ b/packages/deployer/src/utils/types.ts
@@ -0,0 +1,97 @@
+import { TxData } from '@0xproject/types';
+import * as Web3 from 'web3';
+import * as yargs from 'yargs';
+
+export enum AbiType {
+ Function = 'function',
+ Constructor = 'constructor',
+ Event = 'event',
+ Fallback = 'fallback',
+}
+
+export interface ContractArtifact {
+ contract_name: string;
+ networks: ContractNetworks;
+}
+
+export interface ContractNetworks {
+ [key: number]: ContractData;
+}
+
+export interface ContractData {
+ solc_version: string;
+ optimizer_enabled: number;
+ keccak256: string;
+ abi: Web3.ContractAbi;
+ unlinked_binary: string;
+ address?: string;
+ constructor_args?: string;
+ updated_at: number;
+}
+
+export interface SolcErrors {
+ [key: string]: boolean;
+}
+
+export interface CliOptions extends yargs.Arguments {
+ artifactsDir: string;
+ contractsDir: string;
+ jsonrpcPort: number;
+ networkId: number;
+ shouldOptimize: boolean;
+ gasPrice: string;
+ account?: string;
+ contract?: string;
+ args?: string;
+}
+
+export interface CompilerOptions {
+ contractsDir: string;
+ networkId: number;
+ optimizerEnabled: number;
+ artifactsDir: string;
+}
+
+export interface DeployerOptions {
+ artifactsDir: string;
+ jsonrpcPort: number;
+ networkId: number;
+ defaults: Partial<TxData>;
+}
+
+export interface ContractSources {
+ [key: string]: string;
+}
+
+export interface ImportContents {
+ contents: string;
+}
+
+// TODO: Consolidate with 0x.js definitions once types are moved into a separate package.
+export enum ZeroExError {
+ ContractDoesNotExist = 'CONTRACT_DOES_NOT_EXIST',
+ ExchangeContractDoesNotExist = 'EXCHANGE_CONTRACT_DOES_NOT_EXIST',
+ UnhandledError = 'UNHANDLED_ERROR',
+ UserHasNoAssociatedAddress = 'USER_HAS_NO_ASSOCIATED_ADDRESSES',
+ InvalidSignature = 'INVALID_SIGNATURE',
+ ContractNotDeployedOnNetwork = 'CONTRACT_NOT_DEPLOYED_ON_NETWORK',
+ InsufficientAllowanceForTransfer = 'INSUFFICIENT_ALLOWANCE_FOR_TRANSFER',
+ InsufficientBalanceForTransfer = 'INSUFFICIENT_BALANCE_FOR_TRANSFER',
+ InsufficientEthBalanceForDeposit = 'INSUFFICIENT_ETH_BALANCE_FOR_DEPOSIT',
+ InsufficientWEthBalanceForWithdrawal = 'INSUFFICIENT_WETH_BALANCE_FOR_WITHDRAWAL',
+ InvalidJump = 'INVALID_JUMP',
+ OutOfGas = 'OUT_OF_GAS',
+ NoNetworkId = 'NO_NETWORK_ID',
+ SubscriptionNotFound = 'SUBSCRIPTION_NOT_FOUND',
+}
+
+export interface Token {
+ address?: string;
+ name: string;
+ symbol: string;
+ decimals: number;
+ ipfsHash: string;
+ swarmHash: string;
+}
+
+export type DoneCallback = (err?: Error) => void;