-
Notifications
You must be signed in to change notification settings - Fork 11
/
const.ts
175 lines (156 loc) · 3.31 KB
/
const.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
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
export enum BitNetwork {
mainnet = 'mainnet',
testnet = 'testnet',
}
export enum CoinType {
DOGE = '3',
ETH = '60',
TRX = '195',
CKB = '309',
MATIC = '966',
BSC = '9006',
}
export const EvmCoinTypes = [CoinType.ETH, CoinType.BSC, CoinType.MATIC]
export enum EvmChainId {
ETH = 1,
ETH_HOLESKY = 17000,
BSC = 56,
BSC_TEST = 97,
MATIC = 137,
MATIC_TEST = 80001,
}
export const EvmChainId2CoinType = {
[EvmChainId.ETH]: CoinType.ETH,
[EvmChainId.ETH_HOLESKY]: CoinType.ETH,
[EvmChainId.BSC]: CoinType.BSC,
[EvmChainId.BSC_TEST]: CoinType.BSC,
[EvmChainId.MATIC]: CoinType.MATIC,
[EvmChainId.MATIC_TEST]: CoinType.MATIC,
}
export enum RecordType {
address = 'address',
profile = 'profile',
dweb = 'dweb',
custom = 'custom_key',
}
export enum DWebProtocol {
ipfs = 'ipfs',
ipns = 'ipns',
arweave = 'arweave',
resilio = 'resilio',
skynet = 'skynet'
}
// source: https://github.com/dotbitHQ/das-register/blob/main/API.md#account-detail
export enum AccountStatus {
notOpenRegister= -1,
registerable,
registeringPaymentConfirm,
registeringLockedAccount,
registering,
registeringIncludeProposal,
registeringConfirmProposal,
registered,
reservedAccount,
onePriceSell,
auctionSell,
candidateAccount,
expired,
othersRegistering,
unavailableAccount,
subAccountNotCreated,
onCross
}
// source: https://github.com/dotbitHQ/das-account-indexer/blob/main/API.md#get-account-basic-info
export enum IndexerAccountStatus {
normal,
onSale,
onAuction,
onCrossChain
}
export enum SIGN_TYPE {
noSign,
ckbMulti,
ckbSingle,
eth,
tron,
eth712,
ed25519,
doge,
webauthn,
}
export const SignType2CoinType = {
[SIGN_TYPE.eth]: CoinType.ETH,
[SIGN_TYPE.eth712]: CoinType.ETH,
[SIGN_TYPE.tron]: CoinType.TRX,
}
export enum SubAccountEnabledStatus {
unknown = -1,
off,
on
}
export enum CheckSubAccountStatus {
ok,
fail,
registered,
registering
}
export enum EditRecordAction {
delete = 'delete',
change = 'change',
add = 'add',
}
export const ACCOUNT_SUFFIX = '.bit'
// source: https://github.com/dotbitHQ/das-types/blob/master/rust/src/constants.rs#L145
export enum CHAR_TYPE {
emoji = 0,
number = 1,
english = 2,
simplifiedChinese = 3,
traditionalChinese,
japanese,
korean,
russian,
turkish,
thai,
vietnamese,
unknown = 99
}
export const languageToCharType = {
en: CHAR_TYPE.english,
tr: CHAR_TYPE.turkish,
vi: CHAR_TYPE.vietnamese,
th: CHAR_TYPE.thai,
ko: CHAR_TYPE.korean
}
export const languages = ['en', 'tr', 'vi', 'th', 'ko']
export enum DigitalEmojiUnifiedMap {
'0⃣️' = '0️⃣',
'1⃣️' = '1️⃣',
'2⃣️' = '2️⃣',
'3⃣️' = '3️⃣',
'4⃣️' = '4️⃣',
'5⃣️' = '5️⃣',
'6⃣️' = '6️⃣',
'7⃣️' = '7️⃣',
'8⃣️' = '8️⃣',
'9⃣️' = '9️⃣',
'0⃣' = '0️⃣',
'1⃣' = '1️⃣',
'2⃣' = '2️⃣',
'3⃣' = '3️⃣',
'4⃣' = '4️⃣',
'5⃣' = '5️⃣',
'6⃣' = '6️⃣',
'7⃣' = '7️⃣',
'8⃣' = '8️⃣',
'9⃣' = '9️⃣'
}
// ID of the payment method, source: https://github.com/dotbitHQ/das-register/blob/main/API.md#token-list
export enum PaymentMethodIDs {
eth = 'eth_eth',
bnb = 'bsc_bnb',
matic = 'polygon_matic',
trx = 'tron_trx',
// portalWallet = 'ckb_ckb',
dotbitBalance = 'ckb_das',
}