Typescript Definitions
Typescript definitions for push messages.
Client receives PushMessage object on each update.
1
declare module '@tezos-live/push' {
2
import { BlockDelegationContent, BlockOriginationContent, BlockTransactionContent, Header } from '@tezos-live';
3
4
export interface DelegationModel {
5
blockHash: string;
6
blockLevel: number;
7
delegationContent: BlockDelegationContent;
8
operationHash: string;
9
timestamp: string;
10
}
11
12
export interface HeadModel extends Header {
13
chain_id: string;
14
hash: string;
15
protocol: string;
16
}
17
18
export interface OriginationModel {
19
blockHash: string;
20
blockLevel: number;
21
operationHash: string;
22
originationContent: BlockOriginationContent;
23
timestamp: string;
24
}
25
26
export interface PushMessage {
27
blockHeader: HeadModel;
28
delegation: DelegationModel;
29
messageType: string;
30
origination: OriginationModel;
31
transaction: TransactionModel;
32
}
33
34
export interface SubscribeModel {
35
delegationAddresses: string[];
36
originationAddresses: string[];
37
transactionAddresses: string[];
38
userId: string;
39
}
40
41
export interface TransactionModel {
42
blockHash: string;
43
blockLevel: number;
44
operationHash: string;
45
timestamp: string;
46
transactionContent: BlockTransactionContent;
47
}
48
49
}
50
51
declare module '@tezos-live' {
52
53
export interface BakingRight {
54
delegate: string;
55
level: number;
56
priority: number;
57
}
58
59
export interface BakingRightsRpcEntity {
60
rights: BakingRight[];
61
}
62
63
export interface BalanceUpdate {
64
category: string;
65
change: string;
66
contract: string;
67
cycle?: number;
68
delegate: string;
69
kind: string;
70
}
71
72
export interface BlockDelegationContent extends BlockOperationContent {
73
delegate: string;
74
metadata: BlockTransactionMetadata;
75
}
76
77
export interface BlockDelegationsRpcEntity extends BlockOperation[] {
78
}
79
80
export interface BlockDoubleBakingBlockHash {
81
context: string;
82
fitness: string[];
83
level: number;
84
operations_hash: string;
85
predecessor: string;
86
priority: number;
87
proof_of_work_nonce: string;
88
proto: number;
89
signature: string;
90
timestamp: string;
91
validation_pass: number;
92
}
93
94
export interface BlockDoubleBakingContent {
95
bh1: BlockDoubleBakingBlockHash;
96
bh2: BlockDoubleBakingBlockHash;
97
kind: string;
98
metadata: Metadata;
99
}
100
101
export interface BlockDoubleBakingsRpcEntity extends BlockOperation[] {
102
}
103
104
export interface BlockEndorsementBalanceUpdate {
105
category: string;
106
change: string;
107
contract: string;
108
delegate: string;
109
kind: string;
110
level?: number;
111
}
112
113
export interface BlockEndorsementContent {
114
kind: string;
115
level: number;
116
metadata: BlockTransactionMetadata;
117
}
118
119
export interface BlockEndorsementMetadata {
120
balance_updates: BlockEndorsementBalanceUpdate[];
121
delegate: string;
122
slots: number[];
123
}
124
125
export interface BlockEndorsementsRpcEntity extends BlockOperation[] {
126
}
127
128
export interface BlockLevelRpcEntity {
129
cycle: number;
130
cycle_position: number;
131
expected_commitment: boolean;
132
level: number;
133
level_position: number;
134
voting_period: number;
135
voting_period_position: number;
136
}
137
138
export interface BlockOperation<T> {
139
branch: string;
140
chain_id: string;
141
contents: T[];
142
hash: string;
143
protocol: string;
144
signature: string;
145
}
146
147
export interface BlockOperationContent {
148
counter: string;
149
fee: string;
150
gas_limit: string;
151
kind: string;
152
source: string;
153
storage_limit: string;
154
}
155
156
export interface BlockOperationsRpcEntity extends any[][] {
157
}
158
159
export interface BlockOriginationContent extends BlockOperationContent {
160
balance: string;
161
metadata: BlockTransactionMetadata;
162
}
163
164
export interface BlockOriginationsRpcEntity extends BlockOperation[] {
165
}
166
167
export interface BlockRpcEntity {
168
chain_id: string;
169
hash: string;
170
header: Header;
171
metadata: Metadata;
172
operations: BlockOperationsRpcEntity;
173
protocol: string;
174
}
175
176
export interface BlockTransactionBalanceUpdate {
177
category: string;
178
change: string;
179
contract: string;
180
cycle?: number;
181
delegate: string;
182
kind: string;
183
}
184
185
export interface BlockTransactionContent extends BlockOperationContent {
186
amount: string;
187
destination: string;
188
metadata: BlockTransactionMetadata;
189
}
190
191
export interface BlockTransactionInternalOperationResult {
192
amount: string;
193
destination: string;
194
kind: string;
195
nonce: number;
196
result: BlockTransactionOperationResult;
197
source: string;
198
}
199
200
export interface BlockTransactionMetadata {
201
balance_updates: BlockTransactionBalanceUpdate[];
202
internal_operation_results: BlockTransactionInternalOperationResult[];
203
operation_result: BlockTransactionOperationResult;
204
}
205
206
export interface BlockTransactionOperationResult {
207
balance_updates: BlockTransactionBalanceUpdate[];
208
consumed_gas: string;
209
originated_contracts: string[];
210
paid_storage_size_diff: string;
211
status: string;
212
storage_size: string;
213
}
214
215
export interface BlockTransactionsRpcEntity extends BlockOperation[] {
216
}
217
218
export interface ConstantsRpcEntity {
219
block_reward: string;
220
block_security_deposit: string;
221
blocks_per_commitment: number;
222
blocks_per_cycle: number;
223
blocks_per_roll_snapshot: number;
224
blocks_per_voting_period: number;
225
cost_per_byte: string;
226
dictator_pubkey: string;
227
endorsement_reward: string;
228
endorsement_security_deposit: string;
229
endorsers_per_block: number;
230
hard_gas_limit_per_block: string;
231
hard_gas_limit_per_operation: string;
232
hard_storage_limit_per_block: string;
233
hard_storage_limit_per_operation: string;
234
max_operation_data_length: number;
235
max_revelations_per_block: number;
236
michelson_maximum_type_size: number;
237
nonce_length: number;
238
origination_burn: string;
239
preserved_cycles: number;
240
proof_of_work_nonce_size: number;
241
proof_of_work_threshold: string;
242
seed_nonce_revelation_tip: string;
243
time_between_blocks: string[];
244
tokens_per_roll: string;
245
}
246
247
export interface ContractBalanceRpcEntity {
248
balance: string;
249
}
250
251
export interface ContractRpcEntity {
252
balance: string;
253
counter: number;
254
delegate: Delegate;
255
manager: string;
256
spendable: boolean;
257
}
258
259
export interface Delegate {
260
setable: boolean;
261
}
262
263
export interface DelegateBalanceRpcEntity {
264
balance: string;
265
}
266
267
export interface DelegateRpcEntity {
268
balance: string;
269
deactivated: boolean;
270
delegated_balance: string;
271
delegated_contracts: string[];
272
frozen_balance: string;
273
frozen_balance_by_cycle: FrozenBalanceByCycle[];
274
grace_period: number;
275
staking_balance: string;
276
}
277
278
export interface DelegateRpcEntityError {
279
errors: DelegateRpcEntityErrorDetails[];
280
}
281
282
export interface DelegateRpcEntityErrorDetails {
283
_function: string;
284
id: string;
285
kind: string;
286
missing_key: string[];
287
}
288
289
export interface DelegatedContractsRpcEntity {
290
delegated_contracts: string[];
291
}
292
293
export interface EndorsingRight {
294
delegate: string;
295
level: number;
296
slots: number[];
297
}
298
299
export interface EndorsingRightsRpcEntity {
300
rights: EndorsingRight[];
301
}
302
303
export interface ErrorRpcEntity {
304
_function: string;
305
id: string;
306
kind: string;
307
missing_key: string[];
308
}
309
310
export interface FrozenBalanceByCycle {
311
cycle: number;
312
deposit: string;
313
fees: string;
314
rewards: string;
315
}
316
317
export interface GenericBlockOperationContent extends BlockOperationContent {
318
amount: string;
319
balance: string;
320
delegate: string;
321
destination: string;
322
metadata: BlockTransactionMetadata;
323
}
324
325
export interface GenericOperationsEntity extends BlockOperation[] {
326
}
327
328
export interface Header {
329
context: string;
330
fitness: string[];
331
level: number;
332
operations_hash: string;
333
predecessor: string;
334
priority: number;
335
proof_of_work_nonce: string;
336
proto: number;
337
signature: string;
338
timestamp: string;
339
validation_pass: number;
340
}
341
342
export interface MaxOperationListLength {
343
max_op: number;
344
max_size: number;
345
}
346
347
export interface Metadata {
348
baker: string;
349
balance_updates: BalanceUpdate[];
350
consumed_gas: string;
351
deactivated: any[];
352
level: BlockLevelRpcEntity;
353
max_block_header_length: number;
354
max_operation_data_length: number;
355
max_operation_list_length: MaxOperationListLength[];
356
max_operations_ttl: number;
357
next_protocol: string;
358
nonce_hash: any;
359
protocol: string;
360
test_chain_status: TestChainStatus;
361
voting_period_kind: string;
362
}
363
364
export interface MonitorHeadModel {
365
context: string;
366
fitness: string[];
367
hash: string;
368
level: number;
369
operations_hash: string;
370
predecessor: string;
371
proto: number;
372
protocol_data: string;
373
timestamp: string;
374
validation_pass: number;
375
}
376
377
export interface SelectedRollSnapshotRpcEntity {
378
selected_snapshot: number;
379
}
380
381
export interface TestChainStatus {
382
status: string;
383
}
384
385
}
386
387
Copied!
Copy link