crypull 1.0.2 → 1.0.3
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/dist/index.d.mts +154 -18
- package/dist/index.d.ts +154 -18
- package/dist/index.js +905 -236
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +894 -237
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/README.md +0 -228
- package/dist/cli.d.mts +0 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +0 -1094
- package/dist/cli.js.map +0 -1
- package/dist/cli.mjs +0 -1069
- package/dist/cli.mjs.map +0 -1
- package/examples/basic.ts +0 -28
- package/src/Crypull.ts +0 -288
- package/src/cli.ts +0 -440
- package/src/index.ts +0 -14
- package/src/providers/binance.ts +0 -74
- package/src/providers/coincap.ts +0 -65
- package/src/providers/coingecko.ts +0 -92
- package/src/providers/coinpaprika.ts +0 -82
- package/src/providers/cryptocompare.ts +0 -56
- package/src/providers/dexscreener.ts +0 -82
- package/src/providers/geckoterminal.ts +0 -70
- package/src/types.ts +0 -130
- package/tests/index.test.ts +0 -15
- package/tsconfig.json +0 -16
- package/tsup.config.ts +0 -11
package/dist/index.d.mts
CHANGED
|
@@ -103,8 +103,10 @@ interface SearchResult {
|
|
|
103
103
|
}
|
|
104
104
|
interface ICryptoProvider {
|
|
105
105
|
name: string;
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
/** True for DEX providers that resolve contract addresses, not ticker symbols. */
|
|
107
|
+
addressBased?: boolean;
|
|
108
|
+
getPrice(query: string, network?: string): Promise<PriceData | null>;
|
|
109
|
+
getTokenInfo(query: string, network?: string): Promise<TokenInfo | null>;
|
|
108
110
|
search(query: string): Promise<SearchResult[]>;
|
|
109
111
|
}
|
|
110
112
|
|
|
@@ -113,28 +115,23 @@ interface CrypullOptions {
|
|
|
113
115
|
}
|
|
114
116
|
declare class Crypull {
|
|
115
117
|
providers: ICryptoProvider[];
|
|
116
|
-
private coinGecko;
|
|
117
|
-
private dexScreener;
|
|
118
|
-
private geckoTerminal;
|
|
119
|
-
private binance;
|
|
120
|
-
private coinpaprika;
|
|
121
|
-
private coincap;
|
|
122
|
-
private cryptoCompare;
|
|
123
118
|
constructor(options?: CrypullOptions);
|
|
124
|
-
private
|
|
119
|
+
private symbolProviders;
|
|
120
|
+
private addressProviders;
|
|
121
|
+
private coinGecko;
|
|
125
122
|
/**
|
|
126
|
-
* Search for a token or coin across
|
|
123
|
+
* Search for a token or coin across symbol + DEX providers in parallel.
|
|
127
124
|
*/
|
|
128
125
|
search(query: string): Promise<SearchResult[]>;
|
|
129
126
|
/**
|
|
130
|
-
* Get the current price of a cryptocurrency
|
|
131
|
-
* @param query
|
|
132
|
-
* @param network Optional network for DEX addresses (e.g
|
|
127
|
+
* Get the current price of a cryptocurrency.
|
|
128
|
+
* @param query Symbol (e.g. 'BTC') or contract address
|
|
129
|
+
* @param network Optional network for DEX addresses (e.g. 'eth', 'bsc', 'solana')
|
|
133
130
|
*/
|
|
134
131
|
price(query: string, network?: string): Promise<PriceData | null>;
|
|
135
132
|
/**
|
|
136
133
|
* Get detailed token info (market cap, volume, liquidity, etc.)
|
|
137
|
-
* @param query
|
|
134
|
+
* @param query Symbol (e.g. 'BTC') or contract address
|
|
138
135
|
* @param network Optional network for DEX addresses
|
|
139
136
|
*/
|
|
140
137
|
info(query: string, network?: string): Promise<TokenInfo | null>;
|
|
@@ -160,22 +157,53 @@ declare class Crypull {
|
|
|
160
157
|
gas(): Promise<GasData | null>;
|
|
161
158
|
/**
|
|
162
159
|
* Get historical chart data for a coin
|
|
163
|
-
* @param query Coin symbol or ID
|
|
160
|
+
* @param query Coin symbol or CoinGecko ID
|
|
164
161
|
* @param days Number of days (e.g. 1, 7, 30)
|
|
165
162
|
*/
|
|
166
163
|
chart(query: string, days?: number): Promise<ChartData | null>;
|
|
167
164
|
}
|
|
168
165
|
|
|
166
|
+
/**
|
|
167
|
+
* Detect contract addresses (EVM / Solana-style) vs ticker symbols.
|
|
168
|
+
*/
|
|
169
|
+
declare function isContractAddress(query: string): boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Normalize to a Binance USD quote pair (library prices are always USD-oriented).
|
|
172
|
+
* e.g. BTC → BTCUSDT, WBTC → WBTCUSDT, ETHUSDT → ETHUSDT
|
|
173
|
+
*/
|
|
174
|
+
declare function toBinancePair(symbol: string): string;
|
|
175
|
+
/**
|
|
176
|
+
* Strip a Binance USD quote suffix back to the base asset symbol.
|
|
177
|
+
*/
|
|
178
|
+
declare function fromBinancePair(pair: string): string;
|
|
179
|
+
/**
|
|
180
|
+
* Default GeckoTerminal network for an address when none is provided.
|
|
181
|
+
*/
|
|
182
|
+
declare function defaultDexNetwork(address: string): string;
|
|
183
|
+
/** Parse a number; return undefined for NaN/non-finite (preserves 0). */
|
|
184
|
+
declare function finiteOrUndefined(value: unknown): number | undefined;
|
|
185
|
+
|
|
169
186
|
declare class CoinGeckoProvider implements ICryptoProvider {
|
|
170
187
|
name: string;
|
|
188
|
+
addressBased: boolean;
|
|
171
189
|
private baseUrl;
|
|
172
190
|
search(query: string): Promise<SearchResult[]>;
|
|
191
|
+
/** Resolve a symbol or slug to a CoinGecko coin id. */
|
|
192
|
+
resolveId(symbolOrId: string): Promise<{
|
|
193
|
+
id: string;
|
|
194
|
+
symbol: string;
|
|
195
|
+
} | null>;
|
|
173
196
|
getPrice(symbolOrId: string): Promise<PriceData | null>;
|
|
174
|
-
getTokenInfo(
|
|
197
|
+
getTokenInfo(symbolOrId: string): Promise<TokenInfo | null>;
|
|
198
|
+
getGlobalMarket(): Promise<GlobalMarketData | null>;
|
|
199
|
+
getTrending(): Promise<TrendingCoin[]>;
|
|
200
|
+
getTop(limit?: number): Promise<TopCoin[]>;
|
|
201
|
+
getChart(query: string, days?: number): Promise<ChartData | null>;
|
|
175
202
|
}
|
|
176
203
|
|
|
177
204
|
declare class DexScreenerProvider implements ICryptoProvider {
|
|
178
205
|
name: string;
|
|
206
|
+
addressBased: boolean;
|
|
179
207
|
private baseUrl;
|
|
180
208
|
search(query: string): Promise<SearchResult[]>;
|
|
181
209
|
getPrice(address: string): Promise<PriceData | null>;
|
|
@@ -184,6 +212,7 @@ declare class DexScreenerProvider implements ICryptoProvider {
|
|
|
184
212
|
|
|
185
213
|
declare class GeckoTerminalProvider implements ICryptoProvider {
|
|
186
214
|
name: string;
|
|
215
|
+
addressBased: boolean;
|
|
187
216
|
private baseUrl;
|
|
188
217
|
search(query: string): Promise<SearchResult[]>;
|
|
189
218
|
getPrice(address: string, network?: string): Promise<PriceData | null>;
|
|
@@ -192,6 +221,7 @@ declare class GeckoTerminalProvider implements ICryptoProvider {
|
|
|
192
221
|
|
|
193
222
|
declare class BinanceProvider implements ICryptoProvider {
|
|
194
223
|
name: string;
|
|
224
|
+
addressBased: boolean;
|
|
195
225
|
private baseUrl;
|
|
196
226
|
search(query: string): Promise<SearchResult[]>;
|
|
197
227
|
getPrice(symbol: string): Promise<PriceData | null>;
|
|
@@ -200,6 +230,7 @@ declare class BinanceProvider implements ICryptoProvider {
|
|
|
200
230
|
|
|
201
231
|
declare class CoinpaprikaProvider implements ICryptoProvider {
|
|
202
232
|
name: string;
|
|
233
|
+
addressBased: boolean;
|
|
203
234
|
private baseUrl;
|
|
204
235
|
search(query: string): Promise<SearchResult[]>;
|
|
205
236
|
getPrice(symbolOrId: string): Promise<PriceData | null>;
|
|
@@ -208,6 +239,7 @@ declare class CoinpaprikaProvider implements ICryptoProvider {
|
|
|
208
239
|
|
|
209
240
|
declare class CoinCapProvider implements ICryptoProvider {
|
|
210
241
|
name: string;
|
|
242
|
+
addressBased: boolean;
|
|
211
243
|
private baseUrl;
|
|
212
244
|
search(query: string): Promise<SearchResult[]>;
|
|
213
245
|
getPrice(symbolOrId: string): Promise<PriceData | null>;
|
|
@@ -216,12 +248,116 @@ declare class CoinCapProvider implements ICryptoProvider {
|
|
|
216
248
|
|
|
217
249
|
declare class CryptoCompareProvider implements ICryptoProvider {
|
|
218
250
|
name: string;
|
|
251
|
+
addressBased: boolean;
|
|
252
|
+
private baseUrl;
|
|
253
|
+
search(_query: string): Promise<SearchResult[]>;
|
|
254
|
+
getPrice(symbol: string): Promise<PriceData | null>;
|
|
255
|
+
getTokenInfo(symbol: string): Promise<TokenInfo | null>;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* CoinMarketCap keyless public API (no API key required).
|
|
260
|
+
* https://pro-api.coinmarketcap.com/public-api
|
|
261
|
+
*/
|
|
262
|
+
declare class CoinMarketCapProvider implements ICryptoProvider {
|
|
263
|
+
name: string;
|
|
264
|
+
addressBased: boolean;
|
|
265
|
+
private baseUrl;
|
|
266
|
+
private headers;
|
|
267
|
+
search(query: string): Promise<SearchResult[]>;
|
|
268
|
+
getPrice(symbol: string): Promise<PriceData | null>;
|
|
269
|
+
getTokenInfo(symbolOrSlug: string): Promise<TokenInfo | null>;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* CoinLore free public API (no API key).
|
|
274
|
+
* https://api.coinlore.net/api/
|
|
275
|
+
*/
|
|
276
|
+
declare class CoinLoreProvider implements ICryptoProvider {
|
|
277
|
+
name: string;
|
|
278
|
+
addressBased: boolean;
|
|
279
|
+
private baseUrl;
|
|
280
|
+
/** Scan top tickers pages to resolve symbol → coin id. */
|
|
281
|
+
private findTicker;
|
|
282
|
+
search(query: string): Promise<SearchResult[]>;
|
|
283
|
+
getPrice(symbol: string): Promise<PriceData | null>;
|
|
284
|
+
getTokenInfo(symbolOrId: string): Promise<TokenInfo | null>;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Coinbase public spot price API (no API key).
|
|
289
|
+
* https://api.coinbase.com/v2/
|
|
290
|
+
*/
|
|
291
|
+
declare class CoinbaseProvider implements ICryptoProvider {
|
|
292
|
+
name: string;
|
|
293
|
+
addressBased: boolean;
|
|
294
|
+
private baseUrl;
|
|
295
|
+
search(query: string): Promise<SearchResult[]>;
|
|
296
|
+
getPrice(symbol: string): Promise<PriceData | null>;
|
|
297
|
+
getTokenInfo(symbol: string): Promise<TokenInfo | null>;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Kraken public ticker API (no API key).
|
|
302
|
+
* https://api.kraken.com/0/public/
|
|
303
|
+
*
|
|
304
|
+
* Note: Kraken uses XBT for Bitcoin.
|
|
305
|
+
*/
|
|
306
|
+
declare class KrakenProvider implements ICryptoProvider {
|
|
307
|
+
name: string;
|
|
308
|
+
addressBased: boolean;
|
|
309
|
+
private baseUrl;
|
|
310
|
+
private toPair;
|
|
311
|
+
private fromPairKey;
|
|
312
|
+
search(query: string): Promise<SearchResult[]>;
|
|
313
|
+
getPrice(symbol: string): Promise<PriceData | null>;
|
|
314
|
+
getTokenInfo(symbol: string): Promise<TokenInfo | null>;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* KuCoin public market API (no API key).
|
|
319
|
+
* https://api.kucoin.com/api/v1/
|
|
320
|
+
*/
|
|
321
|
+
declare class KuCoinProvider implements ICryptoProvider {
|
|
322
|
+
name: string;
|
|
323
|
+
addressBased: boolean;
|
|
324
|
+
private baseUrl;
|
|
325
|
+
private toSymbol;
|
|
326
|
+
private baseAsset;
|
|
327
|
+
search(query: string): Promise<SearchResult[]>;
|
|
328
|
+
getPrice(symbol: string): Promise<PriceData | null>;
|
|
329
|
+
getTokenInfo(symbol: string): Promise<TokenInfo | null>;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Bybit public spot ticker API (no API key).
|
|
334
|
+
* https://api.bybit.com/v5/market/
|
|
335
|
+
*/
|
|
336
|
+
declare class BybitProvider implements ICryptoProvider {
|
|
337
|
+
name: string;
|
|
338
|
+
addressBased: boolean;
|
|
339
|
+
private baseUrl;
|
|
340
|
+
search(query: string): Promise<SearchResult[]>;
|
|
341
|
+
getPrice(symbol: string): Promise<PriceData | null>;
|
|
342
|
+
getTokenInfo(symbol: string): Promise<TokenInfo | null>;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Gate.io public spot API (no API key).
|
|
347
|
+
* https://api.gateio.ws/api/v4/
|
|
348
|
+
*/
|
|
349
|
+
declare class GateIoProvider implements ICryptoProvider {
|
|
350
|
+
name: string;
|
|
351
|
+
addressBased: boolean;
|
|
219
352
|
private baseUrl;
|
|
353
|
+
private toPair;
|
|
354
|
+
private baseAsset;
|
|
220
355
|
search(query: string): Promise<SearchResult[]>;
|
|
221
356
|
getPrice(symbol: string): Promise<PriceData | null>;
|
|
222
357
|
getTokenInfo(symbol: string): Promise<TokenInfo | null>;
|
|
223
358
|
}
|
|
224
359
|
|
|
360
|
+
/** Default shared instance for quick usage */
|
|
225
361
|
declare const crypull: Crypull;
|
|
226
362
|
|
|
227
|
-
export { BinanceProvider, type ChartData, CoinCapProvider, CoinGeckoProvider, CoinpaprikaProvider, CryptoCompareProvider, Crypull, type CrypullOptions, type DexPairInfo, DexScreenerProvider, type GasData, GeckoTerminalProvider, type GlobalMarketData, type ICryptoProvider, type PriceData, type SearchResult, type SentimentData, type TokenInfo, type TokenLinks, type TopCoin, type TrendingCoin, crypull };
|
|
363
|
+
export { BinanceProvider, BybitProvider, type ChartData, CoinCapProvider, CoinGeckoProvider, CoinLoreProvider, CoinMarketCapProvider, CoinbaseProvider, CoinpaprikaProvider, CryptoCompareProvider, Crypull, type CrypullOptions, type DexPairInfo, DexScreenerProvider, type GasData, GateIoProvider, GeckoTerminalProvider, type GlobalMarketData, type ICryptoProvider, KrakenProvider, KuCoinProvider, type PriceData, type SearchResult, type SentimentData, type TokenInfo, type TokenLinks, type TopCoin, type TrendingCoin, crypull, defaultDexNetwork, finiteOrUndefined, fromBinancePair, isContractAddress, toBinancePair };
|
package/dist/index.d.ts
CHANGED
|
@@ -103,8 +103,10 @@ interface SearchResult {
|
|
|
103
103
|
}
|
|
104
104
|
interface ICryptoProvider {
|
|
105
105
|
name: string;
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
/** True for DEX providers that resolve contract addresses, not ticker symbols. */
|
|
107
|
+
addressBased?: boolean;
|
|
108
|
+
getPrice(query: string, network?: string): Promise<PriceData | null>;
|
|
109
|
+
getTokenInfo(query: string, network?: string): Promise<TokenInfo | null>;
|
|
108
110
|
search(query: string): Promise<SearchResult[]>;
|
|
109
111
|
}
|
|
110
112
|
|
|
@@ -113,28 +115,23 @@ interface CrypullOptions {
|
|
|
113
115
|
}
|
|
114
116
|
declare class Crypull {
|
|
115
117
|
providers: ICryptoProvider[];
|
|
116
|
-
private coinGecko;
|
|
117
|
-
private dexScreener;
|
|
118
|
-
private geckoTerminal;
|
|
119
|
-
private binance;
|
|
120
|
-
private coinpaprika;
|
|
121
|
-
private coincap;
|
|
122
|
-
private cryptoCompare;
|
|
123
118
|
constructor(options?: CrypullOptions);
|
|
124
|
-
private
|
|
119
|
+
private symbolProviders;
|
|
120
|
+
private addressProviders;
|
|
121
|
+
private coinGecko;
|
|
125
122
|
/**
|
|
126
|
-
* Search for a token or coin across
|
|
123
|
+
* Search for a token or coin across symbol + DEX providers in parallel.
|
|
127
124
|
*/
|
|
128
125
|
search(query: string): Promise<SearchResult[]>;
|
|
129
126
|
/**
|
|
130
|
-
* Get the current price of a cryptocurrency
|
|
131
|
-
* @param query
|
|
132
|
-
* @param network Optional network for DEX addresses (e.g
|
|
127
|
+
* Get the current price of a cryptocurrency.
|
|
128
|
+
* @param query Symbol (e.g. 'BTC') or contract address
|
|
129
|
+
* @param network Optional network for DEX addresses (e.g. 'eth', 'bsc', 'solana')
|
|
133
130
|
*/
|
|
134
131
|
price(query: string, network?: string): Promise<PriceData | null>;
|
|
135
132
|
/**
|
|
136
133
|
* Get detailed token info (market cap, volume, liquidity, etc.)
|
|
137
|
-
* @param query
|
|
134
|
+
* @param query Symbol (e.g. 'BTC') or contract address
|
|
138
135
|
* @param network Optional network for DEX addresses
|
|
139
136
|
*/
|
|
140
137
|
info(query: string, network?: string): Promise<TokenInfo | null>;
|
|
@@ -160,22 +157,53 @@ declare class Crypull {
|
|
|
160
157
|
gas(): Promise<GasData | null>;
|
|
161
158
|
/**
|
|
162
159
|
* Get historical chart data for a coin
|
|
163
|
-
* @param query Coin symbol or ID
|
|
160
|
+
* @param query Coin symbol or CoinGecko ID
|
|
164
161
|
* @param days Number of days (e.g. 1, 7, 30)
|
|
165
162
|
*/
|
|
166
163
|
chart(query: string, days?: number): Promise<ChartData | null>;
|
|
167
164
|
}
|
|
168
165
|
|
|
166
|
+
/**
|
|
167
|
+
* Detect contract addresses (EVM / Solana-style) vs ticker symbols.
|
|
168
|
+
*/
|
|
169
|
+
declare function isContractAddress(query: string): boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Normalize to a Binance USD quote pair (library prices are always USD-oriented).
|
|
172
|
+
* e.g. BTC → BTCUSDT, WBTC → WBTCUSDT, ETHUSDT → ETHUSDT
|
|
173
|
+
*/
|
|
174
|
+
declare function toBinancePair(symbol: string): string;
|
|
175
|
+
/**
|
|
176
|
+
* Strip a Binance USD quote suffix back to the base asset symbol.
|
|
177
|
+
*/
|
|
178
|
+
declare function fromBinancePair(pair: string): string;
|
|
179
|
+
/**
|
|
180
|
+
* Default GeckoTerminal network for an address when none is provided.
|
|
181
|
+
*/
|
|
182
|
+
declare function defaultDexNetwork(address: string): string;
|
|
183
|
+
/** Parse a number; return undefined for NaN/non-finite (preserves 0). */
|
|
184
|
+
declare function finiteOrUndefined(value: unknown): number | undefined;
|
|
185
|
+
|
|
169
186
|
declare class CoinGeckoProvider implements ICryptoProvider {
|
|
170
187
|
name: string;
|
|
188
|
+
addressBased: boolean;
|
|
171
189
|
private baseUrl;
|
|
172
190
|
search(query: string): Promise<SearchResult[]>;
|
|
191
|
+
/** Resolve a symbol or slug to a CoinGecko coin id. */
|
|
192
|
+
resolveId(symbolOrId: string): Promise<{
|
|
193
|
+
id: string;
|
|
194
|
+
symbol: string;
|
|
195
|
+
} | null>;
|
|
173
196
|
getPrice(symbolOrId: string): Promise<PriceData | null>;
|
|
174
|
-
getTokenInfo(
|
|
197
|
+
getTokenInfo(symbolOrId: string): Promise<TokenInfo | null>;
|
|
198
|
+
getGlobalMarket(): Promise<GlobalMarketData | null>;
|
|
199
|
+
getTrending(): Promise<TrendingCoin[]>;
|
|
200
|
+
getTop(limit?: number): Promise<TopCoin[]>;
|
|
201
|
+
getChart(query: string, days?: number): Promise<ChartData | null>;
|
|
175
202
|
}
|
|
176
203
|
|
|
177
204
|
declare class DexScreenerProvider implements ICryptoProvider {
|
|
178
205
|
name: string;
|
|
206
|
+
addressBased: boolean;
|
|
179
207
|
private baseUrl;
|
|
180
208
|
search(query: string): Promise<SearchResult[]>;
|
|
181
209
|
getPrice(address: string): Promise<PriceData | null>;
|
|
@@ -184,6 +212,7 @@ declare class DexScreenerProvider implements ICryptoProvider {
|
|
|
184
212
|
|
|
185
213
|
declare class GeckoTerminalProvider implements ICryptoProvider {
|
|
186
214
|
name: string;
|
|
215
|
+
addressBased: boolean;
|
|
187
216
|
private baseUrl;
|
|
188
217
|
search(query: string): Promise<SearchResult[]>;
|
|
189
218
|
getPrice(address: string, network?: string): Promise<PriceData | null>;
|
|
@@ -192,6 +221,7 @@ declare class GeckoTerminalProvider implements ICryptoProvider {
|
|
|
192
221
|
|
|
193
222
|
declare class BinanceProvider implements ICryptoProvider {
|
|
194
223
|
name: string;
|
|
224
|
+
addressBased: boolean;
|
|
195
225
|
private baseUrl;
|
|
196
226
|
search(query: string): Promise<SearchResult[]>;
|
|
197
227
|
getPrice(symbol: string): Promise<PriceData | null>;
|
|
@@ -200,6 +230,7 @@ declare class BinanceProvider implements ICryptoProvider {
|
|
|
200
230
|
|
|
201
231
|
declare class CoinpaprikaProvider implements ICryptoProvider {
|
|
202
232
|
name: string;
|
|
233
|
+
addressBased: boolean;
|
|
203
234
|
private baseUrl;
|
|
204
235
|
search(query: string): Promise<SearchResult[]>;
|
|
205
236
|
getPrice(symbolOrId: string): Promise<PriceData | null>;
|
|
@@ -208,6 +239,7 @@ declare class CoinpaprikaProvider implements ICryptoProvider {
|
|
|
208
239
|
|
|
209
240
|
declare class CoinCapProvider implements ICryptoProvider {
|
|
210
241
|
name: string;
|
|
242
|
+
addressBased: boolean;
|
|
211
243
|
private baseUrl;
|
|
212
244
|
search(query: string): Promise<SearchResult[]>;
|
|
213
245
|
getPrice(symbolOrId: string): Promise<PriceData | null>;
|
|
@@ -216,12 +248,116 @@ declare class CoinCapProvider implements ICryptoProvider {
|
|
|
216
248
|
|
|
217
249
|
declare class CryptoCompareProvider implements ICryptoProvider {
|
|
218
250
|
name: string;
|
|
251
|
+
addressBased: boolean;
|
|
252
|
+
private baseUrl;
|
|
253
|
+
search(_query: string): Promise<SearchResult[]>;
|
|
254
|
+
getPrice(symbol: string): Promise<PriceData | null>;
|
|
255
|
+
getTokenInfo(symbol: string): Promise<TokenInfo | null>;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* CoinMarketCap keyless public API (no API key required).
|
|
260
|
+
* https://pro-api.coinmarketcap.com/public-api
|
|
261
|
+
*/
|
|
262
|
+
declare class CoinMarketCapProvider implements ICryptoProvider {
|
|
263
|
+
name: string;
|
|
264
|
+
addressBased: boolean;
|
|
265
|
+
private baseUrl;
|
|
266
|
+
private headers;
|
|
267
|
+
search(query: string): Promise<SearchResult[]>;
|
|
268
|
+
getPrice(symbol: string): Promise<PriceData | null>;
|
|
269
|
+
getTokenInfo(symbolOrSlug: string): Promise<TokenInfo | null>;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* CoinLore free public API (no API key).
|
|
274
|
+
* https://api.coinlore.net/api/
|
|
275
|
+
*/
|
|
276
|
+
declare class CoinLoreProvider implements ICryptoProvider {
|
|
277
|
+
name: string;
|
|
278
|
+
addressBased: boolean;
|
|
279
|
+
private baseUrl;
|
|
280
|
+
/** Scan top tickers pages to resolve symbol → coin id. */
|
|
281
|
+
private findTicker;
|
|
282
|
+
search(query: string): Promise<SearchResult[]>;
|
|
283
|
+
getPrice(symbol: string): Promise<PriceData | null>;
|
|
284
|
+
getTokenInfo(symbolOrId: string): Promise<TokenInfo | null>;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Coinbase public spot price API (no API key).
|
|
289
|
+
* https://api.coinbase.com/v2/
|
|
290
|
+
*/
|
|
291
|
+
declare class CoinbaseProvider implements ICryptoProvider {
|
|
292
|
+
name: string;
|
|
293
|
+
addressBased: boolean;
|
|
294
|
+
private baseUrl;
|
|
295
|
+
search(query: string): Promise<SearchResult[]>;
|
|
296
|
+
getPrice(symbol: string): Promise<PriceData | null>;
|
|
297
|
+
getTokenInfo(symbol: string): Promise<TokenInfo | null>;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Kraken public ticker API (no API key).
|
|
302
|
+
* https://api.kraken.com/0/public/
|
|
303
|
+
*
|
|
304
|
+
* Note: Kraken uses XBT for Bitcoin.
|
|
305
|
+
*/
|
|
306
|
+
declare class KrakenProvider implements ICryptoProvider {
|
|
307
|
+
name: string;
|
|
308
|
+
addressBased: boolean;
|
|
309
|
+
private baseUrl;
|
|
310
|
+
private toPair;
|
|
311
|
+
private fromPairKey;
|
|
312
|
+
search(query: string): Promise<SearchResult[]>;
|
|
313
|
+
getPrice(symbol: string): Promise<PriceData | null>;
|
|
314
|
+
getTokenInfo(symbol: string): Promise<TokenInfo | null>;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* KuCoin public market API (no API key).
|
|
319
|
+
* https://api.kucoin.com/api/v1/
|
|
320
|
+
*/
|
|
321
|
+
declare class KuCoinProvider implements ICryptoProvider {
|
|
322
|
+
name: string;
|
|
323
|
+
addressBased: boolean;
|
|
324
|
+
private baseUrl;
|
|
325
|
+
private toSymbol;
|
|
326
|
+
private baseAsset;
|
|
327
|
+
search(query: string): Promise<SearchResult[]>;
|
|
328
|
+
getPrice(symbol: string): Promise<PriceData | null>;
|
|
329
|
+
getTokenInfo(symbol: string): Promise<TokenInfo | null>;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Bybit public spot ticker API (no API key).
|
|
334
|
+
* https://api.bybit.com/v5/market/
|
|
335
|
+
*/
|
|
336
|
+
declare class BybitProvider implements ICryptoProvider {
|
|
337
|
+
name: string;
|
|
338
|
+
addressBased: boolean;
|
|
339
|
+
private baseUrl;
|
|
340
|
+
search(query: string): Promise<SearchResult[]>;
|
|
341
|
+
getPrice(symbol: string): Promise<PriceData | null>;
|
|
342
|
+
getTokenInfo(symbol: string): Promise<TokenInfo | null>;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Gate.io public spot API (no API key).
|
|
347
|
+
* https://api.gateio.ws/api/v4/
|
|
348
|
+
*/
|
|
349
|
+
declare class GateIoProvider implements ICryptoProvider {
|
|
350
|
+
name: string;
|
|
351
|
+
addressBased: boolean;
|
|
219
352
|
private baseUrl;
|
|
353
|
+
private toPair;
|
|
354
|
+
private baseAsset;
|
|
220
355
|
search(query: string): Promise<SearchResult[]>;
|
|
221
356
|
getPrice(symbol: string): Promise<PriceData | null>;
|
|
222
357
|
getTokenInfo(symbol: string): Promise<TokenInfo | null>;
|
|
223
358
|
}
|
|
224
359
|
|
|
360
|
+
/** Default shared instance for quick usage */
|
|
225
361
|
declare const crypull: Crypull;
|
|
226
362
|
|
|
227
|
-
export { BinanceProvider, type ChartData, CoinCapProvider, CoinGeckoProvider, CoinpaprikaProvider, CryptoCompareProvider, Crypull, type CrypullOptions, type DexPairInfo, DexScreenerProvider, type GasData, GeckoTerminalProvider, type GlobalMarketData, type ICryptoProvider, type PriceData, type SearchResult, type SentimentData, type TokenInfo, type TokenLinks, type TopCoin, type TrendingCoin, crypull };
|
|
363
|
+
export { BinanceProvider, BybitProvider, type ChartData, CoinCapProvider, CoinGeckoProvider, CoinLoreProvider, CoinMarketCapProvider, CoinbaseProvider, CoinpaprikaProvider, CryptoCompareProvider, Crypull, type CrypullOptions, type DexPairInfo, DexScreenerProvider, type GasData, GateIoProvider, GeckoTerminalProvider, type GlobalMarketData, type ICryptoProvider, KrakenProvider, KuCoinProvider, type PriceData, type SearchResult, type SentimentData, type TokenInfo, type TokenLinks, type TopCoin, type TrendingCoin, crypull, defaultDexNetwork, finiteOrUndefined, fromBinancePair, isContractAddress, toBinancePair };
|