This repository was archived by the owner on May 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathtypes.ts
253 lines (222 loc) · 4.37 KB
/
types.ts
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity.
//
// SPDX-License-Identifier: MIT
import BigNumber from 'bignumber.js';
export interface AccountInfo {
[address: string]: {
meta?: { [index: string]: any };
name: string;
uuid?: string;
};
}
export type Bytes = number[];
export interface Block {
author?: string;
miner?: string;
difficulty?: BigNumber;
gasLimit?: BigNumber;
gasUsed?: BigNumber;
nonce?: BigNumber;
number?: BigNumber;
totalDifficulty?: BigNumber;
timestamp?: Date;
}
export type BlockGap = BigNumber[];
export type BlockNumber =
| 'earliest'
| 'latest'
| 'pending'
| number
| BigNumber
| string;
export type ChainStatus = {
blockGap?: BlockGap | null;
};
export type Condition = {
block?: BlockNumber;
time?: Date;
};
export interface DeriveObject {
hash?: number;
index?: number;
type?: string;
}
export type Derive = number | string | DeriveObject | null;
export type EtherDenomination =
| 'wei'
| 'ada'
| 'babbage'
| 'shannon'
| 'szabo'
| 'finney'
| 'ether'
| 'kether'
| 'mether'
| 'gether'
| 'tether';
export interface FilterObject {
fromAddress?: string;
fromBlock?: BlockNumber;
toAddress?: string;
toBlock?: BlockNumber;
}
export interface FilterOptions {
address?: string | string[];
extraData?: string;
fromBlock?: BlockNumber;
limit?: BlockNumber;
toBlock?: BlockNumber;
topics?: Topic[];
}
export interface Histogram {
bucketBounds?: BigNumber[];
counts?: BigNumber[];
}
export interface HwAccountInfo {
[address: string]: { [key: string]: any };
}
export interface Log {
address?: string;
blockNumber?: BigNumber;
logIndex?: BigNumber;
transactionIndex?: BigNumber;
}
export interface NodeKind {
availability: string;
capability: string;
}
export interface Options {
extraData?: string;
from?: string;
condition?: Condition | null;
gas?: BlockNumber;
gasPrice?: BlockNumber;
value?: BlockNumber;
nonce?: BlockNumber;
to?: string;
data?: any;
}
export type PeerProtocol = 'par' | 'les';
export interface PeerProtocolItem {
difficulty: BigNumber;
head: BigNumber;
version: BigNumber;
}
export interface Peer {
caps: string[];
id: string;
name: string;
network: {
localAddress: string;
remoteAddress: string;
};
protocols?: {
les?: PeerProtocolItem | null;
par?: PeerProtocolItem | null;
};
}
export interface Peers {
active: BigNumber;
connected: BigNumber;
max: BigNumber;
peers: Peer[];
}
export interface Receipt {
contractAddress?: string;
blockNumber?: BigNumber;
cumulativeGasUsed?: BigNumber;
gasUsed?: BigNumber;
transactionIndex?: BigNumber;
status?: BigNumber;
}
export interface SignerRequest {
id?: BigNumber;
origin?: {
[index: string]: string;
};
payload?: {
decrypt?: SigningPayload;
sign?: SigningPayload;
signTransaction?: Transaction;
sendTransaction?: Transaction;
};
}
export interface SigningPayload {
address?: string;
}
export interface Syncing {
currentBlock?: BigNumber;
highestBlock?: BigNumber;
startingBlock?: BigNumber;
warpChunksAmount?: BigNumber;
warpChunksProcessed?: BigNumber;
blockGap?: BlockGap | null;
}
export interface Trace {
action?: {
gas?: BigNumber;
value?: BigNumber;
balance?: BigNumber;
from?: string;
to?: string;
address?: string;
refundAddress?: string;
};
result?: {
address?: string;
gasUsed?: BigNumber;
};
traceAddress?: BigNumber[];
subtraces?: BigNumber;
transactionPosition?: BigNumber;
blockNumber?: BigNumber;
}
export interface TraceReplay {
trace?: Trace[];
}
export interface Transaction {
blockNumber?: BigNumber;
creates?: string;
extraData?: string;
to?: string;
from?: string;
condition?: Condition | null;
gas?: BigNumber;
gasPrice?: BigNumber;
transactionIndex?: BigNumber;
value?: BigNumber;
nonce?: BigNumber;
data?: string;
}
export type Topic = string | null;
export interface VaultMeta {
[index: string]: any;
}
export type AnyType =
| AccountInfo
| Block
| BlockGap
| BlockNumber
| ChainStatus
| Condition
| DeriveObject
| Derive
| FilterObject
| FilterOptions
| Histogram
| HwAccountInfo
| Log
| NodeKind
| Options
| Peer
| Peers
| Receipt
| SignerRequest
| SigningPayload
| Syncing
| Trace
| TraceReplay
| Transaction
| Topic
| VaultMeta;