forked from DA0-DA0/dao-dao-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
indexer.ts
77 lines (71 loc) · 1.86 KB
/
indexer.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
import { ContractVersionInfo } from './contracts'
import {
Config,
DumpStateResponse,
ProposalModuleWithInfo,
} from './contracts/DaoDaoCore'
export enum IndexerFormulaType {
Contract = 'contract',
Generic = 'generic',
Validator = 'validator',
Wallet = 'wallet',
}
export interface IndexerDumpState
extends Omit<DumpStateResponse, 'proposal_modules'> {
proposal_modules: ProposalModuleWithInfo[]
votingModuleInfo: ContractVersionInfo
createdAt: string // UTC string
adminInfo?: {
admin?: string
config: Config
info?: ContractVersionInfo
// Check if it has this current DAO as a SubDAO.
registeredSubDao?: boolean
} | null
proposalCount?: number
// Map polytone note address to remote address.
polytoneProxies?: Record<string, string>
// Hide from search if storage item `hideFromSearch` exists.
hideFromSearch?: boolean
}
export type IndexerUpBlock = {
height: number
timeUnixMs: number
timestamp: string
}
export type IndexerUpStatus = {
chainBlock: IndexerUpBlock
indexerBlock: IndexerUpBlock
caughtUp: boolean
}
export type DaoDaoIndexerChainStats = {
daos: number
proposals: number
votes: number
uniqueVoters: number
}
export type DaoDaoIndexerAllStats = {
/**
* Stats from all time. If null, we have no stats for the chain (probably
* because we don't have an indexer running).
*/
all: DaoDaoIndexerChainStats | null
/**
* Stats from last 30 days. If null, we have no stats for the chain (probably
* because we don't have an indexer running).
*/
month: DaoDaoIndexerChainStats | null
/**
* Stats from last 7 days. If null, we have no stats for the chain (probably
* because we don't have an indexer running).
*/
week: DaoDaoIndexerChainStats | null
/**
* Total TVL.
*/
tvl: number | null
/**
* Number of chains DAO DAO is deployed on.
*/
chains: number
}