forked from vechain/connex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tx.d.ts
64 lines (59 loc) · 1.67 KB
/
tx.d.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
declare namespace Connex.Thor {
/** the transaction model */
type Transaction = {
id: string
chainTag: number
blockRef: string
expiration: number
clauses: Array<{
to: string | null
value: string
data: string
}>
gasPriceCoef: number
gas: number
origin: string
delegator?: string | null
nonce: string
dependsOn: string | null
size: number
meta: {
blockID: string
blockNumber: number
blockTimestamp: number
}
}
namespace Transaction {
/** the transaction visitor interface */
interface Visitor {
/** the transaction id to be visited */
readonly id: string
/** allow the queried tx be in pending state. a pending tx has null 'meta'. */
allowPending(): this
/** query the transaction */
get(): Promise<Transaction | null>
/** query the receipt */
getReceipt(): Promise<Receipt | null>
}
/** the transaction receipt model */
type Receipt = {
gasUsed: number
gasPayer: string
paid: string
reward: string
reverted: boolean
outputs: {
contractAddress: string | null
events: VM.Event[]
transfers: VM.Transfer[]
}[]
meta: {
blockID: string
blockNumber: number
blockTimestamp: number
txID: string
txOrigin: string
}
}
}
}