/
model.go
445 lines (393 loc) · 13.4 KB
/
model.go
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
package crypto
type priceResp struct {
Price string `json:"price"`
Symbol string `json:"symbol"`
}
type Meme struct {
Pairs []*Pair `json:"pairs"`
}
type Pair struct {
URL string `json:"url"`
ChainId string `json:"chainId"`
DexId string `json:"dexId"`
PairAddress string `json:"pairAddress"`
PriceNative string `json:"priceNative"`
PriceUsd string `json:"priceUsd"`
BaseToken *BaseToken `json:"baseToken"`
QuoteToken *BaseToken `json:"quoteToken"`
PriceChange *PriceChange `json:"priceChange"`
Volume *Volume `json:"volume"`
Txns *Txn `json:"txns"`
Lp *Liquidity `json:"liquidity"`
Fdv float64 `json:"fdv"`
CreateAt int64 `json:"pairCreatedAt"`
Labels []string `json:"labels"`
CreateTime string
}
type Liquidity struct {
Usd float64 `json:"usd"`
}
type Volume struct {
M5 float64 `json:"m5"`
H1 float64 `json:"h1"`
H6 float64 `json:"h6"`
H24 float64 `json:"h24"`
}
type Txn struct {
M5 *BS `json:"m5"`
H1 *BS `json:"h1"`
H6 *BS `json:"h6"`
H24 *BS `json:"h24"`
}
type BS struct {
B int `json:"buys"`
S int `json:"sells"`
}
type BaseToken struct {
Addr string `json:"address"`
Name string `json:"name"`
Symbol string `json:"symbol"`
}
type PriceChange struct {
M5 float64 `json:"m5"`
H1 float64 `json:"h1"`
H6 float64 `json:"h6"`
H24 float64 `json:"h24"`
}
type MemeCheckerResp struct {
Code int64 `json:"code"`
Message string `json:"message"`
MemeCheckers map[string]*MemeChecker `json:"result"`
}
type MemeChecker struct {
AntiWhaleModifiable string `json:"anti_whale_modifiable"`
BuyTax string `json:"buy_tax"`
CanTakeBackOwnership string `json:"can_take_back_ownership"`
//CannotBuy string `json:"cannot_buy"`
CannotSellAll string `json:"cannot_sell_all"`
CreatorAddress string `json:"creator_address"`
CreatorBalance string `json:"creator_balance"`
CreatorPercent string `json:"creator_percent"`
//Dex []Dex `json:"dex"`
ExternalCall string `json:"external_call"`
HiddenOwner string `json:"hidden_owner"`
HolderCount string `json:"holder_count"`
//Holders []Holder `json:"holders"`
HoneypotWithSameCreator string `json:"honeypot_with_same_creator"`
IsAntiWhale string `json:"is_anti_whale"`
IsBlacklisted string `json:"is_blacklisted"`
IsHoneypot string `json:"is_honeypot"`
IsInDex string `json:"is_in_dex"`
IsMintable string `json:"is_mintable"`
IsOpenSource string `json:"is_open_source"`
IsProxy string `json:"is_proxy"`
IsWhitelisted string `json:"is_whitelisted"`
LpHolderCount string `json:"lp_holder_count"`
LpHolders []Holder `json:"lp_holders"`
LpTotalSupply string `json:"lp_total_supply"`
OwnerAddress string `json:"owner_address"`
OwnerBalance string `json:"owner_balance"`
OwnerChangeBalance string `json:"owner_change_balance"`
OwnerPercent string `json:"owner_percent"`
PersonalSlippageModifiable string `json:"personal_slippage_modifiable"`
Selfdestruct string `json:"selfdestruct"`
SellTax string `json:"sell_tax"`
SlippageModifiable string `json:"slippage_modifiable"`
TokenName string `json:"token_name"`
TokenSymbol string `json:"token_symbol"`
TotalSupply string `json:"total_supply"`
TradingCooldown string `json:"trading_cooldown"`
TransferPausable string `json:"transfer_pausable"`
LpLockedTotal float64
}
type Dex struct {
Name string `json:"name"`
Liquidity string `json:"liquidity"`
Pair string `json:"pair"`
}
type Holder struct {
Address string `json:"address"`
Tag string `json:"tag"`
IsContract int64 `json:"is_contract"`
Balance string `json:"balance"`
Percent string `json:"percent"`
IsLocked int64 `json:"is_locked"`
//LockedDetail []LockedDetail `json:"locked_detail"`
}
type LockedDetail struct {
Amount string `json:"amount"`
EndTime string `json:"end_time"`
OptTime string `json:"opt_time"`
}
// Generated by https://quicktype.io
type TokenTxResp struct {
Status string `json:"status"`
Message string `json:"message"`
Result []TokenTx `json:"result"`
}
type TokenTx struct {
TokenName string `json:"tokenName"`
TokenSymbol string `json:"tokenSymbol"`
ContractAddress string `json:"contractAddress"`
Hash string `json:"hash"`
From string `json:"from"`
To string `json:"to"`
Value string `json:"value"`
Decimal string `json:"tokenDecimal"`
TimeStamp string `json:"timeStamp"`
Block string `json:"blockNumber"`
}
type HoneypotResp struct {
Token HoneypotToken `json:"token"`
WithToken HoneypotToken `json:"withToken"`
SimulationSuccess bool `json:"simulationSuccess"`
SimulationResult SimulationResult `json:"simulationResult"`
HolderAnalysis HolderAnalysis `json:"holderAnalysis"`
Flags []interface{} `json:"flags"`
Chain HoneypotChain `json:"chain"`
Router string `json:"router"`
Pair *MainPair `json:"pair"`
PairAddress string `json:"pairAddress"`
Honeypot *Honeypot `json:"honeypotResult"`
}
type Honeypot struct {
Is bool `json:"isHoneypot"`
}
type TaxDistribution struct {
Tax int64 `json:"tax"`
Count int64 `json:"count"`
}
type HoneypotChain struct {
ID string `json:"id"`
Name string `json:"name"`
ShortName string `json:"shortName"`
Currency string `json:"currency"`
}
type HolderAnalysis struct {
Holders string `json:"holders"`
Successful string `json:"successful"`
Failed string `json:"failed"`
Siphoned string `json:"siphoned"`
AverageTax float64 `json:"averageTax"`
AverageGas float64 `json:"averageGas"`
HighestTax float64 `json:"highestTax"`
HighTaxWallets string `json:"highTaxWallets"`
TaxDistribution []TaxDistribution `json:"taxDistribution"`
}
type MainPair struct {
Pair PairPair `json:"pair"`
ChainID string `json:"chainId"`
Reserves0 string `json:"reserves0"`
Reserves1 string `json:"reserves1"`
Liquidity float64 `json:"liquidity"`
Router string `json:"router"`
CreatedAtTimestamp string `json:"createdAtTimestamp"`
CreationTxHash string `json:"creationTxHash"`
}
type PairPair struct {
Name string `json:"name"`
Address string `json:"address"`
Token0 string `json:"token0"`
Token1 string `json:"token1"`
Type string `json:"type"`
}
type SimulationResult struct {
BuyTax float64 `json:"buyTax"`
SellTax float64 `json:"sellTax"`
// TransferTax int64 `json:"transferTax"`
// BuyGas string `json:"buyGas"`
// SellGas string `json:"sellGas"`
}
type HoneypotToken struct {
Name string `json:"name"`
Symbol string `json:"symbol"`
Decimals int64 `json:"decimals"`
Address string `json:"address"`
}
// Contract
type ContractCreationResp struct {
Status string `json:"status"`
Message string `json:"message"`
Result []ContractCreation `json:"result"`
}
type ContractCreation struct {
Address string `json:"contractAddress"`
Creator string `json:"contractCreator"`
}
type GasOracleResp struct {
Status string `json:"status"`
Message string `json:"message"`
Result GasOracle `json:"result"`
}
type GasOracle struct {
SafeGasPrice string `json:"SafeGasPrice"`
ProposeGasPrice string `json:"ProposeGasPrice"`
FastGasPrice string `json:"FastGasPrice"`
SuggestBaseFee string `json:"suggestBaseFee"`
}
// DextoolsResp Start
type DextoolsResp struct {
Code string `json:"code"`
Data []Datum `json:"data"`
}
type Datum struct {
ID DatumID `json:"id"`
CreationBlock int64 `json:"creationBlock"`
CreationTime string `json:"creationTime"`
DextScore DextScore `json:"dextScore"`
Metrics DatumMetrics `json:"metrics"`
Name string `json:"name"`
NameRef string `json:"nameRef"`
Symbol string `json:"symbol"`
SymbolRef string `json:"symbolRef"`
Type string `json:"type"`
Locks []interface{} `json:"locks"`
Votes Votes `json:"votes"`
Token Token `json:"token"`
Price float64 `json:"price"`
Price5M Price `json:"price5m"`
Price1H Price `json:"price1h"`
Price6H Price `json:"price6h"`
Price24H Price `json:"price24h"`
}
type DextScore struct {
Information int64 `json:"information"`
Holders int64 `json:"holders"`
Pool int64 `json:"pool"`
Transactions int64 `json:"transactions"`
Creation int64 `json:"creation"`
Total int64 `json:"total"`
}
type DatumID struct {
Chain string `json:"chain"`
Exchange string `json:"exchange"`
Pair string `json:"pair"`
Token string `json:"token"`
TokenRef string `json:"tokenRef"`
}
type DatumMetrics struct {
Liquidity float64 `json:"liquidity"`
InitialLiquidity float64 `json:"initialLiquidity"`
LiquidityUpdatedAt string `json:"liquidityUpdatedAt"`
Reserve float64 `json:"reserve"`
ReserveRef float64 `json:"reserveRef"`
}
type Price struct {
Volume float64 `json:"volume"`
Swaps int64 `json:"swaps"`
Price float64 `json:"price"`
PriceChain float64 `json:"priceChain"`
Buys int64 `json:"buys"`
Sells int64 `json:"sells"`
}
type Token struct {
ID TokenID `json:"id"`
Audit Audit `json:"audit"`
Decimals int64 `json:"decimals"`
Info Info `json:"info"`
Links map[string]string `json:"links"`
Logo string `json:"logo"`
Metrics TokenMetrics `json:"metrics"`
Name string `json:"name"`
Symbol string `json:"symbol"`
TotalSupply string `json:"totalSupply"`
ReprPair ReprPair `json:"reprPair"`
CreationBlock int64 `json:"creationBlock"`
CreationTime string `json:"creationTime"`
}
type Audit struct {
IsContractRenounced bool `json:"is_contract_renounced"`
CodeVerified bool `json:"codeVerified"`
Date string `json:"date"`
LockTransactions bool `json:"lockTransactions"`
Mint bool `json:"mint"`
Provider string `json:"provider"`
Proxy bool `json:"proxy"`
Status string `json:"status"`
UnlimitedFees bool `json:"unlimitedFees"`
Version int64 `json:"version"`
}
type TokenID struct {
Chain string `json:"chain"`
Token string `json:"token"`
}
type Info struct {
Cmc string `json:"cmc"`
Coingecko string `json:"coingecko"`
Description string `json:"description"`
Dextools bool `json:"dextools"`
Email string `json:"email"`
ExtraInfo string `json:"extraInfo"`
NftCollection string `json:"nftCollection"`
Ventures bool `json:"ventures"`
}
type TokenMetrics struct {
MaxSupply float64 `json:"maxSupply"`
TotalSupply float64 `json:"totalSupply"`
Holders int64 `json:"holders"`
HoldersUpdatedAt string `json:"holdersUpdatedAt"`
TxCount int64 `json:"txCount"`
Mcap interface{} `json:"mcap"`
Fdv float64 `json:"fdv"`
}
type ReprPair struct {
ID DatumID `json:"id"`
UpdatedAt string `json:"updatedAt"`
}
type Votes struct {
Warning int64 `json:"_warning"`
Downvotes int64 `json:"downvotes"`
Upvotes int64 `json:"upvotes"`
}
// DextoolsResp End
// DexKline
type DexKline struct {
S string `json:"s"`
T []int64 `json:"t"`
// C []float64 `json:"c"`
// H []float64 `json:"h"`
// L []float64 `json:"l"`
// O []float64 `json:"o"`
// V []float64 `json:"v"`
CUsd []float64 `json:"c_usd"`
HUsd []float64 `json:"h_usd"`
LUsd []float64 `json:"l_usd"`
OUsd []float64 `json:"o_usd"`
// VUsd []float64 `json:"v_usd"`
From int64 `json:"_from"`
}
// Generated by https://quicktype.io
type HoneypotPairsResp struct {
Data []HoneypotPairs
}
type HoneypotPairs struct {
ChainID int64 `json:"ChainID"`
Pairs *Pairs `json:"Pair"`
// Reserves []int64 `json:"Reserves"`
Liquidity float64 `json:"Liquidity"`
// Router string `json:"Router"`
CreatedAtTimestamp int64 `json:"CreatedAtTimestamp"`
// CreationTxHash string `json:"CreationTxHash"`
}
type Pairs struct {
Name string `json:"Name"`
Tokens []string `json:"Tokens"`
Address string `json:"Address"`
}
type PairInfo struct {
CreateTime string
PairAddress string
// Lp float64
}
// Generated by https://quicktype.io
type GuruKline struct {
T []int64 `json:"t"`
OUsd []float64 `json:"o"`
CUsd []float64 `json:"c"`
HUsd []float64 `json:"h"`
LUsd []float64 `json:"l"`
//V []float64 `json:"v"`
Liq []float64 `json:"liq"`
//PriceScale int64 `json:"price_scale"`
//S string `json:"s"`
}