aboutsummaryrefslogtreecommitdiffstats
path: root/packages/migrations/src/types.ts
blob: 7347f27fe70b2bc99b050108fca19f6793f10919 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { ECSignature } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';

export interface ERC20Token {
    address?: string;
    name: string;
    symbol: string;
    decimals: BigNumber;
    ipfsHash: string;
    swarmHash: string;
}

export interface ERC721Token {
    name: string;
    symbol: string;
}

export enum ContractName {
    TokenTransferProxy = 'TokenTransferProxy',
    TokenRegistry = 'TokenRegistry',
    MultiSigWalletWithTimeLock = 'MultiSigWalletWithTimeLock',
    Exchange = 'Exchange',
    ZRXToken = 'ZRXToken',
    DummyToken = 'DummyToken',
    WETH9 = 'WETH9',
    MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress = 'MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress',
    AccountLevels = 'AccountLevels',
    EtherDelta = 'EtherDelta',
    Arbitrage = 'Arbitrage',
}

export interface LedgerCommunicationClient {
    close: () => Promise<void>;
}

export interface LedgerGetAddressResult {
    address: string;
    publicKey: string;
    chainCode: string;
}

export interface ECSignatureString {
    v: string;
    r: string;
    s: string;
}

export interface LedgerGetAddressResult {
    address: string;
    publicKey: string;
    chainCode: string;
}

export interface LedgerEthereumClient {
    // shouldGetChainCode is defined as `true` instead of `boolean` because other types rely on the assumption
    // that we get back the chain code and we don't have dependent types to express it properly
    getAddress: (
        derivationPath: string,
        askForDeviceConfirmation: boolean,
        shouldGetChainCode: true,
    ) => Promise<LedgerGetAddressResult>;
    signTransaction: (derivationPath: string, rawTxHex: string) => Promise<ECSignatureString>;
    signPersonalMessage: (derivationPath: string, messageHex: string) => Promise<ECSignature>;
    transport: LedgerCommunicationClient;
}