crypull 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -1
- package/dist/cli.js +112 -23
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +112 -23
- package/dist/cli.mjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -2
- package/src/Crypull.ts +287 -287
- package/src/cli.ts +440 -327
- package/src/types.ts +129 -129
package/src/types.ts
CHANGED
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
// Base Types for unified response
|
|
2
|
-
|
|
3
|
-
export interface PriceData {
|
|
4
|
-
symbol: string;
|
|
5
|
-
priceUsd: number;
|
|
6
|
-
source: string;
|
|
7
|
-
lastUpdated: number;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface TokenLinks {
|
|
11
|
-
website?: string;
|
|
12
|
-
twitter?: string;
|
|
13
|
-
telegram?: string;
|
|
14
|
-
discord?: string;
|
|
15
|
-
github?: string;
|
|
16
|
-
[key: string]: string | undefined;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface DexPairInfo {
|
|
20
|
-
dexId: string;
|
|
21
|
-
url: string;
|
|
22
|
-
pairAddress: string;
|
|
23
|
-
baseTokenSymbol: string;
|
|
24
|
-
quoteTokenSymbol: string;
|
|
25
|
-
priceUsd: number;
|
|
26
|
-
volume24h?: number;
|
|
27
|
-
liquidityUsd?: number;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface TrendingCoin {
|
|
31
|
-
id: string;
|
|
32
|
-
name: string;
|
|
33
|
-
symbol: string;
|
|
34
|
-
marketCapRank?: number;
|
|
35
|
-
priceUsd?: number;
|
|
36
|
-
priceChange24h?: number;
|
|
37
|
-
volume24h?: number;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface GlobalMarketData {
|
|
41
|
-
totalMarketCapUsd: number;
|
|
42
|
-
totalVolume24hUsd: number;
|
|
43
|
-
bitcoinDominancePercentage: number;
|
|
44
|
-
ethereumDominancePercentage: number;
|
|
45
|
-
activeCryptocurrencies: number;
|
|
46
|
-
lastUpdated: number;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface ChartData {
|
|
50
|
-
prices: number[];
|
|
51
|
-
timestamps: number[];
|
|
52
|
-
minPrice: number;
|
|
53
|
-
maxPrice: number;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export interface SentimentData {
|
|
57
|
-
value: number; // 0 to 100
|
|
58
|
-
classification: string; // "Extreme Fear", "Fear", "Neutral", "Greed", "Extreme Greed"
|
|
59
|
-
lastUpdated: number;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface TopCoin {
|
|
63
|
-
id: string;
|
|
64
|
-
name: string;
|
|
65
|
-
symbol: string;
|
|
66
|
-
marketCapRank: number;
|
|
67
|
-
priceUsd: number;
|
|
68
|
-
marketCap: number;
|
|
69
|
-
volume24h: number;
|
|
70
|
-
priceChange24h: number;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export interface GasData {
|
|
74
|
-
network: string;
|
|
75
|
-
low: number;
|
|
76
|
-
average: number;
|
|
77
|
-
high: number;
|
|
78
|
-
baseFee?: number;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export interface TokenInfo {
|
|
82
|
-
name: string;
|
|
83
|
-
symbol: string;
|
|
84
|
-
address?: string;
|
|
85
|
-
network?: string;
|
|
86
|
-
description?: string;
|
|
87
|
-
priceUsd: number;
|
|
88
|
-
marketCap?: number;
|
|
89
|
-
marketCapRank?: number;
|
|
90
|
-
fdv?: number; // Fully Diluted Valuation
|
|
91
|
-
circulatingSupply?: number;
|
|
92
|
-
totalSupply?: number;
|
|
93
|
-
maxSupply?: number;
|
|
94
|
-
volume24h?: number;
|
|
95
|
-
liquidityUsd?: number;
|
|
96
|
-
|
|
97
|
-
// Price Changes
|
|
98
|
-
priceChange24h?: number;
|
|
99
|
-
priceChangePercentage24h?: number;
|
|
100
|
-
priceChangePercentage7d?: number;
|
|
101
|
-
|
|
102
|
-
// All Time High / Low
|
|
103
|
-
ath?: number;
|
|
104
|
-
athDate?: string;
|
|
105
|
-
atl?: number;
|
|
106
|
-
atlDate?: string;
|
|
107
|
-
|
|
108
|
-
links?: TokenLinks;
|
|
109
|
-
|
|
110
|
-
// Trading Pairs (mainly for DEX data)
|
|
111
|
-
pairs?: DexPairInfo[];
|
|
112
|
-
|
|
113
|
-
source: string;
|
|
114
|
-
lastUpdated: number;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export interface SearchResult {
|
|
118
|
-
id?: string; // id or address
|
|
119
|
-
name: string;
|
|
120
|
-
symbol: string;
|
|
121
|
-
network?: string;
|
|
122
|
-
source: string;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export interface ICryptoProvider {
|
|
126
|
-
name: string;
|
|
127
|
-
getPrice(symbol: string): Promise<PriceData | null>;
|
|
128
|
-
getTokenInfo(address: string, network?: string): Promise<TokenInfo | null>;
|
|
129
|
-
search(query: string): Promise<SearchResult[]>;
|
|
1
|
+
// Base Types for unified response
|
|
2
|
+
|
|
3
|
+
export interface PriceData {
|
|
4
|
+
symbol: string;
|
|
5
|
+
priceUsd: number;
|
|
6
|
+
source: string;
|
|
7
|
+
lastUpdated: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface TokenLinks {
|
|
11
|
+
website?: string;
|
|
12
|
+
twitter?: string;
|
|
13
|
+
telegram?: string;
|
|
14
|
+
discord?: string;
|
|
15
|
+
github?: string;
|
|
16
|
+
[key: string]: string | undefined;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface DexPairInfo {
|
|
20
|
+
dexId: string;
|
|
21
|
+
url: string;
|
|
22
|
+
pairAddress: string;
|
|
23
|
+
baseTokenSymbol: string;
|
|
24
|
+
quoteTokenSymbol: string;
|
|
25
|
+
priceUsd: number;
|
|
26
|
+
volume24h?: number;
|
|
27
|
+
liquidityUsd?: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface TrendingCoin {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
symbol: string;
|
|
34
|
+
marketCapRank?: number;
|
|
35
|
+
priceUsd?: number;
|
|
36
|
+
priceChange24h?: number;
|
|
37
|
+
volume24h?: number;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface GlobalMarketData {
|
|
41
|
+
totalMarketCapUsd: number;
|
|
42
|
+
totalVolume24hUsd: number;
|
|
43
|
+
bitcoinDominancePercentage: number;
|
|
44
|
+
ethereumDominancePercentage: number;
|
|
45
|
+
activeCryptocurrencies: number;
|
|
46
|
+
lastUpdated: number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface ChartData {
|
|
50
|
+
prices: number[];
|
|
51
|
+
timestamps: number[];
|
|
52
|
+
minPrice: number;
|
|
53
|
+
maxPrice: number;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface SentimentData {
|
|
57
|
+
value: number; // 0 to 100
|
|
58
|
+
classification: string; // "Extreme Fear", "Fear", "Neutral", "Greed", "Extreme Greed"
|
|
59
|
+
lastUpdated: number;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface TopCoin {
|
|
63
|
+
id: string;
|
|
64
|
+
name: string;
|
|
65
|
+
symbol: string;
|
|
66
|
+
marketCapRank: number;
|
|
67
|
+
priceUsd: number;
|
|
68
|
+
marketCap: number;
|
|
69
|
+
volume24h: number;
|
|
70
|
+
priceChange24h: number;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface GasData {
|
|
74
|
+
network: string;
|
|
75
|
+
low: number;
|
|
76
|
+
average: number;
|
|
77
|
+
high: number;
|
|
78
|
+
baseFee?: number;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface TokenInfo {
|
|
82
|
+
name: string;
|
|
83
|
+
symbol: string;
|
|
84
|
+
address?: string;
|
|
85
|
+
network?: string;
|
|
86
|
+
description?: string;
|
|
87
|
+
priceUsd: number;
|
|
88
|
+
marketCap?: number;
|
|
89
|
+
marketCapRank?: number;
|
|
90
|
+
fdv?: number; // Fully Diluted Valuation
|
|
91
|
+
circulatingSupply?: number;
|
|
92
|
+
totalSupply?: number;
|
|
93
|
+
maxSupply?: number;
|
|
94
|
+
volume24h?: number;
|
|
95
|
+
liquidityUsd?: number;
|
|
96
|
+
|
|
97
|
+
// Price Changes
|
|
98
|
+
priceChange24h?: number;
|
|
99
|
+
priceChangePercentage24h?: number;
|
|
100
|
+
priceChangePercentage7d?: number;
|
|
101
|
+
|
|
102
|
+
// All Time High / Low
|
|
103
|
+
ath?: number;
|
|
104
|
+
athDate?: string;
|
|
105
|
+
atl?: number;
|
|
106
|
+
atlDate?: string;
|
|
107
|
+
|
|
108
|
+
links?: TokenLinks;
|
|
109
|
+
|
|
110
|
+
// Trading Pairs (mainly for DEX data)
|
|
111
|
+
pairs?: DexPairInfo[];
|
|
112
|
+
|
|
113
|
+
source: string;
|
|
114
|
+
lastUpdated: number;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface SearchResult {
|
|
118
|
+
id?: string; // id or address
|
|
119
|
+
name: string;
|
|
120
|
+
symbol: string;
|
|
121
|
+
network?: string;
|
|
122
|
+
source: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface ICryptoProvider {
|
|
126
|
+
name: string;
|
|
127
|
+
getPrice(symbol: string): Promise<PriceData | null>;
|
|
128
|
+
getTokenInfo(address: string, network?: string): Promise<TokenInfo | null>;
|
|
129
|
+
search(query: string): Promise<SearchResult[]>;
|
|
130
130
|
}
|