-
Notifications
You must be signed in to change notification settings - Fork 55
/
ExtendedStakePoolMetadata.ts
137 lines (132 loc) · 3.15 KB
/
ExtendedStakePoolMetadata.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
import { PoolIdHex } from './primitives';
/* eslint-disable max-len */
/**
* Schema from:
* https://raw.githubusercontent.com/cardano-foundation/CIPs/b93e77119e15d8763d7548a8a00c4cb7591714e4/CIP-0006/schema.json
* This file was automatically generated by json-schema-to-typescript.
*
* There are a few changes:
* - discriminated union => enum
* - PoolStatus => ExtendedPoolStatus
*/
/**
* Integer number incremented on every update,
* by using YYYYMMDDxx (xx each day start by 01 and is incremented on each update
*/
export type SerialNumber = number;
/**
* 3 letter country code as defined in https://www.iso.org/iso-3166-country-codes.html (alpha-3)
*/
export type DeclaredPoolLocation = string;
/**
* the current operative status
*/
export enum ExtendedPoolStatus {
Active = 'active',
Retired = 'retired',
Offline = 'offline',
Experimental = 'experimental',
Private = 'private'
}
/**
* the pools prefered communication channel
*/
export type PrimaryContactPreference = string;
/**
* valid email contact address
*/
export type EmailAddress = string;
/**
* a user or page name
*/
export type FacebookAccount = string;
/**
* a github username
*/
export type GithubAccount = string;
/**
* RSS feed URL
*/
export type RSSFeed = string;
/**
* a telegram username
*/
export type TelegramAccount = string;
/**
* a twitter username
*/
export type TwitterAccount = string;
/**
* PNG image with exact 64x64 pixel size
*/
export type PoolIconInPNGFileFormat64X64Px = string;
/**
* PNG image (should have less than 250 kByte of file size)
*/
export type PoolLogoInPNGFileFormat = string;
/**
* (shoud have less tha 250 kByte of file size)
*/
export type PoolLogoInSVGFileFormat = string;
/**
* RGB color code.
*/
export type PoolPrimaryColor = string;
/**
* RGB color code.
*/
export type PoolSecondaryColor = string;
export type TheITNPoolOwnerPublicKey = string;
export type TheSecretKeyGeneratedWitness = string;
/**
* Optional contact information.
*/
export interface PoolContactData {
primary: PrimaryContactPreference;
email?: EmailAddress;
facebook?: FacebookAccount;
github?: GithubAccount;
feed?: RSSFeed;
telegram?: TelegramAccount;
twitter?: TwitterAccount;
[k: string]: unknown;
}
/**
* Media file URLs and colors
*/
export interface ThePoolsMediaAssets {
icon_png_64x64: PoolIconInPNGFileFormat64X64Px;
logo_png?: PoolLogoInPNGFileFormat;
logo_svg?: PoolLogoInSVGFileFormat;
color_fg?: PoolPrimaryColor;
color_bg?: PoolSecondaryColor;
[k: string]: unknown;
}
/**
* A proof of ownership for an established ITN pool brand.
*/
export interface ITNVerification {
owner: TheITNPoolOwnerPublicKey;
witness: TheSecretKeyGeneratedWitness;
[k: string]: unknown;
}
/**
* pool related metadata
*/
export interface ExtendedStakePoolMetadataFields {
id: PoolIdHex;
country?: DeclaredPoolLocation;
status?: ExtendedPoolStatus;
contact?: PoolContactData;
media_assets?: ThePoolsMediaAssets;
itn?: ITNVerification;
[k: string]: unknown;
}
/**
* additional information for Cardano Stake Pools
*/
export interface ExtendedStakePoolMetadata {
serial: SerialNumber;
pool: ExtendedStakePoolMetadataFields;
[k: string]: unknown;
}