-
Notifications
You must be signed in to change notification settings - Fork 5
/
additional.d.ts
77 lines (72 loc) · 1.75 KB
/
additional.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
65
66
67
68
69
70
71
72
73
74
75
76
77
import { AbstractProvider, Eip1193Provider } from 'quais';
declare global {
// ---- global ---- //
interface Window {
pelagus?: Eip1193Provider & AbstractProvider;
}
// ---- data ---- //
type TokenReturn = {
token: Token;
token_id: string | null;
token_instance: string | null;
value: string;
};
type Token = {
address: string;
circulating_market_cap: string | null;
decimals: string | null;
exchange_rate: string | null;
holders: string | null;
icon_url: string | null;
name: string | undefined;
symbol: string | null;
total_supply: string | null;
type: 'ERC-20' | 'ERC-721';
volume_24h: string | null;
};
type Transaction = {
hash: string;
type: string;
from: { hash: string };
to: { hash: string };
gas_used: string;
status: string;
raw_input: string;
};
type TokenData = {
ERC20: TokenReturn[];
ERC721: TokenReturn[];
address: string | null;
};
type TransactionData = {
transactions: Transaction[];
address: string | null;
};
type ShardNames = {
[key: string]: { name: string; rpcName: string };
};
// ---- page + component props ---- //
interface BaseLayoutProps {
children?: ReactNode;
}
interface PageHeaderProps {
title: string;
subtitle?: string;
}
interface TokenPageProps {
tokenData: TokenData;
setTokenData: React.Dispatch<React.SetStateAction<TokenData>>;
}
interface TransactionPageProps {
transactionData: TransactionData;
setTransactionData: React.Dispatch<React.SetStateAction<TransactionData>>;
}
interface TokenTableProps {
tokenData: TokenData;
loading: boolean;
}
interface TransactionTableProps {
transactionData: Transaction[];
loading: boolean;
}
}