-
Notifications
You must be signed in to change notification settings - Fork 188
/
explorer.ts
278 lines (257 loc) · 5.45 KB
/
explorer.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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
import { Token } from '@injectivelabs/token-metadata'
import { BigNumberInBase } from '@injectivelabs/utils'
import type { CosmWasmChecksum, CosmWasmPermission } from './explorer-rest'
import { InjectiveExplorerRpc } from '@injectivelabs/indexer-proto-ts'
export interface IBCTransferTx {
sender: string
receiver: string
sourcePort: string
sourceChannel: string
destinationPort: string
destinationChannel: string
amount: string
denom: string
timeoutHeight: string
timeoutTimestamp: number
packetSequence: number
dataHex: Uint8Array | string
state: string
txHashesList: string[]
createdAt: string
updatedAt: string
}
export interface PeggyDepositTx {
sender: string
receiver: string
eventNonce: number
eventHeight: number
amount: string
denom: string
orchestratorAddress: string
state: string
claimType: number
txHashesList: string[]
createdAt: string
updatedAt: string
}
export interface PeggyWithdrawalTx {
sender: string
receiver: string
amount: string
denom: string
bridgeFee: string
outgoingTxId: number
batchTimeout: number
batchNonce: number
orchestratorAddress: string
eventNonce: number
eventHeight: number
state: string
claimType: number
txHashesList: string[]
createdAt: string
updatedAt: string
}
export interface GasFee {
amounts: {
amount: string
denom: string
}[]
gasLimit: number
payer: string
granter: string
}
export interface TxMessage {
key: string
value: string
}
export interface GrpcBankMsgSendMessage {
type: string
value: {
amount: [
{
amount: string
denom: string
},
]
from_address: string
to_address: string
}
}
export interface BankMsgSendTransaction {
blockNumber: number
blockTimestamp: string
hash: string
amount: string
denom: string
sender: string
receiver: string
}
export interface Transaction {
id: string
blockNumber: number
blockTimestamp: string
hash: string
memo?: string
code: number
data?: Uint8Array | string
info: string
gasWanted: number
gasFee: GasFee
gasUsed: number
events?: Array<{
type: string
attributes: Record<string, string>
}>
txType: string
signatures: Array<{
pubkey: string
address: string
sequence: number
signature: string
}>
codespace: string
messages?: Array<TxMessage>
errorLog?: string
}
export interface IndexerStreamTransaction {
id: string
blockNumber: number
blockTimestamp: string
hash: string
codespace: string
messages: string
txNumber: number
errorLog: string
code: number
}
export interface Block {
height: number
proposer: string
moniker: string
blockHash: string
parentHash: string
numPreCommits: number
numTxs: number
timestamp: string
}
export interface BlockWithTxs {
height: number
proposer: string
moniker: string
blockHash: string
parentHash: string
numPreCommits: number
numTxs: number
txs?: Transaction[]
timestamp: string
}
export interface ExplorerValidatorDescription {
moniker: string
identity: string
website: string
securityContact: string
details: string
}
export interface ValidatorUptime {
blockNumber: number
status: string
}
export interface ValidatorSlashingEvent {
blockNumber: number
blockTimestamp: string
address: string
power: number
reason: string
jailed: string
missedBlocks: number
}
export interface ExplorerValidator {
id: string
moniker: string
operatorAddress: string
consensusAddress: string
jailed: boolean
status: number
tokens: string
delegatorShares: string
description?: ExplorerValidatorDescription
unbondingHeight: number
unbondingTime: string
commissionRate: string
commissionMaxRate: string
commissionMaxChangeRate: string
commissionUpdateTime: string
proposed: number
signed: number
uptimePercentage: number
missed: number
timestamp: string
uptimesList: ValidatorUptime[]
slashingEventsList: ValidatorSlashingEvent[]
}
export interface CW20Message {
decimals: number
initial_balances: [
{
address: string
amount: string
},
]
marketing: {}
mint: {
minter: string
}
name: string
symbol: string
}
export interface ExplorerCW20BalanceWithToken {
contractAddress: string
account: string
balance: string
updatedAt: number
token: Token
}
export interface Contract {
label: string
address: string
txHash: string
creator: string
executes: number
instantiatedAt: number
lastExecutedAt: number
funds?: number
codeId: number
admin?: string
initMessage?: CW20Message
currentMigrateMessage?: CW20Message
}
export interface ContractTransaction {
txHash: string
type: string
code: number
amount: BigNumberInBase
fee: BigNumberInBase
height: number
time: number
}
export interface WasmCode {
id: number
txHash: string
creator: string
contractType: string
version: string
instantiates: number
creationDate: number
checksum?: CosmWasmChecksum
permission?: CosmWasmPermission
proposalId?: number
}
export type GrpcIBCTransferTx = InjectiveExplorerRpc.IBCTransferTx
export type GrpcPeggyDepositTx = InjectiveExplorerRpc.PeggyDepositTx
export type GrpcPeggyWithdrawalTx = InjectiveExplorerRpc.PeggyWithdrawalTx
export type GrpcGasFee = InjectiveExplorerRpc.GasFee
export type GrpcValidatorUptime = InjectiveExplorerRpc.ValidatorUptime
export type GrpcIndexerValidatorDescription =
InjectiveExplorerRpc.ValidatorDescription
export type GrpcValidatorSlashingEvent = InjectiveExplorerRpc.SlashingEvent