|
1 |
| -export type BaseRpcUri = { |
2 |
| - authentication?: string |
3 |
| - value?: string |
| 1 | +export enum RPC_AUTHENTICATION { |
| 2 | + API_KEY_PATH = 'API_KEY_PATH', |
| 3 | + NO_AUTHENTICATION = 'NO_AUTHENTICATION', |
| 4 | + UNKNOWN = 'UNKNOWN', |
| 5 | +} |
| 6 | + |
| 7 | +export type RpcUri = { |
| 8 | + authentication: RPC_AUTHENTICATION |
| 9 | + value: string |
4 | 10 | }
|
5 | 11 |
|
6 | 12 | export type BlockExplorerUriTemplate = {
|
7 | 13 | address: string
|
8 | 14 | txHash: string
|
| 15 | + api: string |
9 | 16 | }
|
10 | 17 |
|
11 |
| -export type Currency = { |
| 18 | +export type NativeCurrency = { |
12 | 19 | name: string
|
13 | 20 | symbol: string
|
14 | 21 | decimals: number
|
15 |
| - logoUri?: string |
| 22 | + logoUri: string |
16 | 23 | }
|
17 | 24 |
|
18 | 25 | export type Theme = {
|
19 | 26 | textColor: string
|
20 | 27 | backgroundColor: string
|
21 | 28 | }
|
22 | 29 |
|
| 30 | +export enum GAS_PRICE_TYPE { |
| 31 | + ORACLE = 'ORACLE', |
| 32 | + FIXED = 'FIXED', |
| 33 | + UNKNOWN = 'UNKNOWN', |
| 34 | +} |
| 35 | + |
23 | 36 | export type GasPriceOracle = {
|
24 |
| - type: 'ORACLE' |
| 37 | + type: GAS_PRICE_TYPE.ORACLE |
25 | 38 | uri: string
|
26 | 39 | gasParameter: string
|
27 | 40 | gweiFactor: string
|
28 | 41 | }
|
29 | 42 |
|
30 | 43 | export type GasPriceFixed = {
|
31 |
| - type: 'FIXED' |
| 44 | + type: GAS_PRICE_TYPE.FIXED |
32 | 45 | weiValue: string
|
33 | 46 | }
|
34 | 47 |
|
35 |
| -export type GasPrices = (GasPriceOracle | GasPriceFixed)[] |
| 48 | +export type GasPriceUnknown = { |
| 49 | + type: GAS_PRICE_TYPE.UNKNOWN |
| 50 | +} |
| 51 | + |
| 52 | +export type GasPrice = (GasPriceOracle | GasPriceFixed | GasPriceUnknown)[] |
| 53 | + |
| 54 | +export enum FEATURES { |
| 55 | + ERC721 = 'ERC721', |
| 56 | + ERC1155 = 'ERC1155', |
| 57 | + SAFE_APPS = 'SAFE_APPS', |
| 58 | + CONTRACT_INTERACTION = 'CONTRACT_INTERACTION', |
| 59 | + DOMAIN_LOOKUP = 'DOMAIN_LOOKUP', |
| 60 | + SPENDING_LIMIT = 'SPENDING_LIMIT', |
| 61 | +} |
36 | 62 |
|
37 |
| -export type ChainConfig = { |
38 |
| - chainId: string |
| 63 | +// Remain agnostic as possible and reference what is returned in the CGW, i.e. |
| 64 | +// https://gnosis.github.io/safe-client-gateway/docs/routes/chains/models/struct.ChainInfo.html |
| 65 | +export type ChainInfo = { |
| 66 | + transactionService: string |
| 67 | + chainId: string // Restricted by what is returned by the CGW |
39 | 68 | chainName: string
|
40 | 69 | shortName: string
|
41 |
| - description?: string |
42 | 70 | l2: boolean
|
43 |
| - rpcUri?: BaseRpcUri |
44 |
| - safeAppsRpcUri?: BaseRpcUri |
45 |
| - blockExplorerUriTemplate?: BlockExplorerUriTemplate |
46 |
| - nativeCurrency?: Currency |
47 |
| - transactionService?: string |
48 |
| - vpcTransactionService: string |
49 |
| - theme?: Theme |
50 |
| - gasPrice?: GasPrices |
| 71 | + description: string |
| 72 | + rpcUri: RpcUri |
| 73 | + blockExplorerUriTemplate: BlockExplorerUriTemplate |
| 74 | + nativeCurrency: NativeCurrency |
| 75 | + theme: Theme |
51 | 76 | ensRegistryAddress?: string
|
| 77 | + gasPrice: GasPrice |
| 78 | + disabledWallets: string[] |
| 79 | + features: FEATURES[] |
52 | 80 | }
|
53 | 81 |
|
54 | 82 | export type ChainListResponse = {
|
55 |
| - next?: string |
56 |
| - previous?: string |
57 |
| - results: ChainConfig[] |
| 83 | + next: string | null |
| 84 | + previous: string | null |
| 85 | + results: ChainInfo[] |
58 | 86 | }
|
0 commit comments