/
transaction.ts
80 lines (73 loc) · 1.78 KB
/
transaction.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
import { ActionTrace, Action } from "./action-trace"
import { ExtDTrxOp, DTrxOp, DbOp, RamOp, TableOp, CreationNode } from "./common"
export type TransactionLifecycleData = {
lifecycle: TransactionLifecycle
}
export type TransactionStatus =
| "pending"
| "delayed"
| "canceled"
| "expired"
| "executed"
| "soft_fail"
| "hard_fail"
export type TransactionLifecycle = {
id: string
transaction: Transaction
transaction_status: TransactionStatus
execution_trace?: TransactionTrace
execution_block_header?: BlockHeader
created_by?: ExtDTrxOp
canceled_by?: ExtDTrxOp
execution_irreversible: boolean
creation_irreversible: boolean
cancelation_irreversible: boolean
dtrxops?: DTrxOp[]
dbops?: DbOp[]
ramops?: RamOp[]
tableops?: TableOp[]
pub_keys?: string[]
creation_tree?: CreationNode[]
}
export type Transaction = {
expiration: string
ref_block_num: number
ref_block_prefix: number
max_net_usage_words: number
max_cpu_usage_ms: number
delay_sec: number
context_free_actions: Action<any>[]
actions: Action<any>[]
transaction_extensions: any[]
signatures?: string[]
context_free_data?: Action<any>[]
}
export type TransactionTrace = {
id: string
block_num: number
block_time: string
producer_block_id?: string
receipt?: TransactionReceipt
elapsed: number
net_usage: number
scheduled: boolean
action_traces: ActionTrace<any>[]
failed_dtrx_trace?: TransactionTrace
except?: any
}
export type TransactionReceipt = {
status: TransactionStatus
cpu_usage_us: number
net_usage_words: number
}
export type BlockHeader = {
timestamp: string
producer: string
confirmed: number
previous: string
transaction_mroot: string
action_mroot: string
schedule_version: number
new_producers: null
header_extensions: any[]
}