Repository navigation
Expand file tree
/
Copy pathtypes.ts
More file actions
184 lines (169 loc) · 4.92 KB
/
Copy pathtypes.ts
File metadata and controls
184 lines (169 loc) · 4.92 KB
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
import { ChainAttributes } from 'server/models/chain';
import { OffchainCommunityAttributes } from 'server/models/offchain_community';
// This is a const and not an enum because of a weird webpack error.
// It has the same syntax, though, so it should be OK, as long as we don't
// modify any of the values.
// eslint-disable-next-line import/prefer-default-export
export const NotificationCategories = {
NewComment: 'new-comment-creation',
NewThread: 'new-thread-creation',
NewCommunity: 'new-community-creation',
NewRoleCreation: 'new-role-creation',
NewMention: 'new-mention',
NewReaction: 'new-reaction',
NewCollaboration: 'new-collaboration',
ThreadEdit: 'thread-edit',
CommentEdit: 'comment-edit',
ChainEvent: 'chain-event',
EntityEvent: 'entity-event',
};
export enum ProposalType {
SubstrateDemocracyReferendum = 'referendum',
SubstrateDemocracyProposal = 'democracyproposal',
SubstrateBountyProposal = 'bountyproposal',
SubstrateTreasuryTip = 'treasurytip',
SubstrateCollectiveProposal = 'councilmotion',
SubstrateTechnicalCommitteeMotion = 'technicalcommitteemotion',
PhragmenCandidacy = 'phragmenelection',
SubstrateTreasuryProposal = 'treasuryproposal',
OffchainThread = 'discussion',
CosmosProposal = 'cosmosproposal',
MolochProposal = 'molochproposal',
CompoundProposal = 'compoundproposal',
AaveProposal = 'onchainproposal',
SputnikProposal = 'sputnikproposal',
SubstratePreimage = 'democracypreimage',
SubstrateImminentPreimage = 'democracyimminent',
}
export enum ChainBase {
CosmosSDK = 'cosmos',
Substrate = 'substrate',
Ethereum = 'ethereum',
NEAR = 'near',
Solana = 'solana',
}
export enum ChainType {
Chain = 'chain',
DAO = 'dao',
Token = 'token',
}
// TODO: remove many of these chain networks, esp substrate (make them all "Substrate"),
// and just use id to identify specific chains for conditionals
export enum ChainNetwork {
Edgeware = 'edgeware',
EdgewareTestnet = 'edgeware-testnet',
Kusama = 'kusama',
Kulupu = 'kulupu',
Polkadot = 'polkadot',
Plasm = 'plasm',
Stafi = 'stafi',
Darwinia = 'darwinia',
Phala = 'phala',
Centrifuge = 'centrifuge',
Straightedge = 'straightedge',
Osmosis = 'osmosis',
Injective = 'injective',
InjectiveTestnet = 'injective-testnet',
Terra = 'terra',
Ethereum = 'ethereum',
NEAR = 'near',
NEARTestnet = 'near-testnet',
Moloch = 'moloch',
Compound = 'compound',
Aave = 'aave',
AaveLocal = 'aave-local',
dYdX = 'dydx',
Metacartel = 'metacartel',
ALEX = 'alex',
ERC20 = 'erc20',
Clover = 'clover',
HydraDX = 'hydradx',
Crust = 'crust',
Sputnik = 'sputnik',
Commonwealth = 'commonwealth',
SolanaDevnet = 'solana-devnet',
SolanaTestnet = 'solana-testnet',
Solana = 'solana',
SPL = 'spl', // solana token
}
export enum WebsocketEventType {
Connection = 'connection',
Message = 'message',
Upgrade = 'upgrade',
Close = 'close',
}
export enum WebsocketMessageType {
Message = 'message',
Heartbeat = 'heartbeat',
HeartbeatPong = 'heartbeat-pong',
InitializeScrollback = 'scrollback',
Typing = 'typing',
Notification = 'notification',
ChainEntity = 'chain-entity',
}
export interface IWebsocketsPayload<T> {
event: WebsocketMessageType;
jwt?: string; // for outgoing payloads
chain?: string; // for incoming payloads
address?: string; // for incoming payloads
data?: T;
}
export interface InviteCodeAttributes {
id?: string;
community_id?: string;
community_name?: string;
chain_id?: string;
creator_id: number;
invited_email?: string;
used?: boolean;
created_at?: Date;
updated_at?: Date;
OffchainCommunity?: OffchainCommunityAttributes;
Chain?: ChainAttributes;
}
export interface IPostNotificationData {
created_at: any;
root_id: string;
root_title: string;
root_type: string;
comment_id?: number;
comment_text?: string;
parent_comment_id?: number;
parent_comment_text?: string;
chain_id: string;
community_id: string;
author_address: string;
author_chain: string;
}
export interface ICommunityNotificationData {
created_at: any;
role_id: string | number;
author_address: string;
chain: string;
community: string;
}
export interface IChainEventNotificationData {
chainEvent: any;
chainEventType: any;
}
export const PROFILE_NAME_MAX_CHARS = 40;
export const PROFILE_HEADLINE_MAX_CHARS = 80;
export const PROFILE_BIO_MAX_CHARS = 1000;
export const PROFILE_NAME_MIN_CHARS = 3;
export const DynamicTemplate = {
ImmediateEmailNotification: 'd-3f30558a95664528a2427b40292fec51',
BatchNotifications: 'd-468624f3c2d7434c86ae0ed0e1d2227e',
SignIn: 'd-db52815b5f8647549d1fe6aa703d7274',
SignUp: 'd-2b00abbf123e4b5981784d17151e86be',
EmailInvite: 'd-000c08160c07459798b46c927b638b9a',
UpdateEmail: 'd-a0c28546fecc49fb80a3ba9e535bff48',
VerifyAddress: 'd-292c161f1aec4d0e98a0bf8d6d8e42c2',
};
export type TokenResponse = {
chainId: number;
address: string;
name: string;
symbol: string;
decimals: number;
logoURI?: string;
};