-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.d.ts
More file actions
111 lines (99 loc) · 2.04 KB
/
Copy pathindex.d.ts
File metadata and controls
111 lines (99 loc) · 2.04 KB
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
declare module "@download/blockies"
interface Account {
address: string
ENS?: string
displayAddress: string
profilePhoto: string
}
interface Transaction {
to: string
from: string
hash: string
value: string
input: string
nonce: string
gasUsed: string
gasPrice: string
timeStamp: string
blockNumber: string
functionName: string
txreceipt_status: "0" | "1"
}
type AvailableL2s = "all" | "optimism" | "arbitrum" | "zkSyncLite" | "linea" | "base"
interface TransactionSavings {
L2: AvailableL2s
hash: string
L2Fee: number
L1Fee: number
saved: number
timesCheaper: number
}
interface TransactionSavingsLocalized {
L2: AvailableL2s
hash: string
L2Fee: string
L1Fee: string
saved: string
timesCheaper: string
}
interface CalcProgress {
text: "Fetching transaction receipts" | "Calculating fees" | "Calculated savings"
current: number
total?: number
}
interface Savings {
L1: {
gasSpent: number
feesSpent: {
ether: number
usd: number
}
}
L2: {
transactionsSent: number
gasSpent: number
feesSpent: {
ether: number
usd: number
}
}
saved: {
ether: number
usd: number
timesCheaper: number
}
details: TransactionSavings[]
}
interface LocalizedSavings {
L1: {
gasSpent: string
feesSpent: {
ether: string
usd: string
}
}
L2: {
transactionsSent: string
gasSpent: string
feesSpent: {
ether: string
usd: string
}
}
saved: {
ether: string
usd: string
timesCheaper: string
}
details: TransactionSavingsLocalized[]
}
type ZkSyncLiteTransaction = "Transfer" | "Swap" | "MintNFT"
type AllSavings = {
[K in AvailableL2s]: Savaings
}
type AllSavingsLocalized = {
[K in AvailableL2s]: LocalizedSavings
}
interface L2 {
calculateSavings(): Promise<Savings>
}