-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstate.ts
43 lines (36 loc) · 852 Bytes
/
state.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
import { cosmos } from 'interchain-rpc'
import { TokenInfoResponse } from './contracts/Cw20Base'
export type CachedLoadable<T> =
| {
state: 'loading'
contents: undefined
}
| {
state: 'hasValue'
contents: T
updating: boolean
}
| {
state: 'hasError'
contents: any
}
export type WithChainId<T> = T & {
chainId?: string
}
export interface AmountWithTimestamp {
amount: number
timestamp: Date
}
export interface AmountWithTimestampAndDenom extends AmountWithTimestamp {
denom: string
}
export interface TokenInfoResponseWithAddressAndLogo extends TokenInfoResponse {
address: string
logoUrl?: string
}
export type GovProposal = ReturnType<
typeof cosmos.gov.v1beta1.Proposal['fromPartial']
>
export type GovProposalWithDecodedContent = GovProposal & {
decodedContent: any
}