crypull 1.0.0

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 ADDED
@@ -0,0 +1,209 @@
1
+ <div align="center">
2
+
3
+ # 🚀 Crypull
4
+
5
+ **The Ultimate All-in-One Crypto API & CLI Tool**
6
+
7
+ *Fetch cryptocurrency prices, top coins, deep token analytics, historical charts, network gas, and market sentiment across multiple platforms instantly—all completely for free, with zero API keys required.*
8
+
9
+ ![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white)
10
+ ![NodeJS](https://img.shields.io/badge/Node.js-43853D?style=for-the-badge&logo=node.js&logoColor=white)
11
+ ![npm](https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white)
12
+ ![License](https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge)
13
+
14
+ </div>
15
+
16
+ ---
17
+
18
+ ## 📖 Table of Contents
19
+ - [Why Crypull?](#-why-crypull)
20
+ - [Installation](#-installation)
21
+ - [💻 Command Line Interface (CLI) Guide](#-command-line-interface-cli-guide)
22
+ - [1. Quick Price (`price`)](#1-get-a-quick-price)
23
+ - [2. Deep Token Analytics (`info`)](#2-deep-token-analytics)
24
+ - [3. Top 50 Cryptocurrencies (`top`)](#3-top-50-cryptocurrencies)
25
+ - [4. Trending Coins (`trending`)](#4-trending-coins)
26
+ - [5. Historical Charts (`chart`)](#5-historical-ascii-charts)
27
+ - [6. Global Market Data (`market`)](#6-global-market-overview)
28
+ - [7. Ethereum Gas Tracker (`gas`)](#7-ethereum-gas-tracker)
29
+ - [8. Fear & Greed Index (`sentiment`)](#8-fear--greed-index)
30
+ - [🛠️ Usage in Your Project (TypeScript / Node.js)](#%EF%B8%8F-usage-in-your-project-typescript--nodejs)
31
+ - [1. Import and Initialize](#1-import-and-initialize)
32
+ - [2. Available API Methods](#2-available-api-methods)
33
+ - [3. Customizing Providers](#3-customizing-providers)
34
+ - [Supported Providers](#-supported-providers)
35
+
36
+ ---
37
+
38
+ ## ✨ Why Crypull?
39
+
40
+ 1. **Smart Routing:** It automatically detects if you're typing a symbol (like `BTC`) or a smart contract address (like `0x...`) and routes it to the correct provider.
41
+ 2. **Zero Dependencies (Core):** Uses the native Node.js `fetch` API.
42
+ 3. **100% Free APIs:** Pulls from CoinGecko, DexScreener, Binance, CoinCap, Coinpaprika, and CryptoCompare—no paid API keys required.
43
+ 4. **DEX & CEX Coverage:** Finds both Top 100 exchange coins and brand new memecoins launching on Uniswap, Raydium, or PulseX.
44
+ 5. **Beautiful CLI:** Built-in colored, heavily formatted terminal UI.
45
+
46
+ ---
47
+
48
+ ## 📦 Installation
49
+
50
+ To use it in your terminal as a global CLI tool:
51
+ ```bash
52
+ npm install -g crypull
53
+ ```
54
+
55
+ To use it inside your Node.js or TypeScript project:
56
+ ```bash
57
+ npm install crypull
58
+ ```
59
+
60
+ ---
61
+
62
+ ## 💻 Command Line Interface (CLI) Guide
63
+
64
+ Once installed globally, you can run `crypull` from anywhere in your terminal!
65
+
66
+ ### 1. Get a Quick Price
67
+ Instantly fetch the current USD price of any symbol or contract address.
68
+ ```bash
69
+ $ crypull price btc
70
+ $ crypull price 0x6982508145454Ce325dDbE47a25d4ec3d2311933
71
+ ```
72
+
73
+ ### 2. Deep Token Analytics
74
+ Get detailed info including market cap, rank, FDV, 24h volume, circulating supply, all-time highs/lows, top DEX trading pairs, and official social links.
75
+ ```bash
76
+ $ crypull info eth
77
+ $ crypull info solana
78
+ ```
79
+
80
+ ### 3. Top 50 Cryptocurrencies
81
+ See a ranked, color-coded list of the Top 50 coins by global market capitalization.
82
+ ```bash
83
+ $ crypull top
84
+ ```
85
+
86
+ ### 4. Trending Coins
87
+ See what the world is searching for! Fetches the top 10 most trending coins right now.
88
+ ```bash
89
+ $ crypull trending
90
+ ```
91
+
92
+ ### 5. Historical ASCII Charts
93
+ Draw an actual historical price chart right inside your terminal!
94
+ ```bash
95
+ # Draws a 7-day chart by default
96
+ $ crypull chart btc
97
+
98
+ # Draw a 30-day chart for Solana
99
+ $ crypull chart sol -d 30
100
+ ```
101
+
102
+ ### 6. Global Market Overview
103
+ Get the total global cryptocurrency market cap, 24h volume, and BTC/ETH dominance percentages.
104
+ ```bash
105
+ $ crypull market
106
+ ```
107
+
108
+ ### 7. Ethereum Gas Tracker
109
+ Check current Ethereum network congestion (Safe, Average, Fast) in Gwei.
110
+ ```bash
111
+ $ crypull gas
112
+ ```
113
+
114
+ ### 8. Fear & Greed Index
115
+ Check current market sentiment (e.g., Extreme Fear vs. Extreme Greed).
116
+ ```bash
117
+ $ crypull sentiment
118
+ ```
119
+
120
+ ---
121
+
122
+ ## 🛠️ Usage in Your Project (TypeScript / Node.js)
123
+
124
+ Crypull is fully typed out of the box and works beautifully in any Node.js, Next.js, Express, or standard TypeScript project.
125
+
126
+ ### 1. Import and Initialize
127
+
128
+ You can simply import the global, ready-to-use `crypull` instance and call its methods immediately.
129
+
130
+ **TypeScript / ES Modules (`import`)**
131
+ ```typescript
132
+ import { crypull } from 'crypull';
133
+
134
+ async function fetchCryptoData() {
135
+ // 1. Fetch a quick price
136
+ const btcPrice = await crypull.price('BTC');
137
+ console.log(`BTC Price: $${btcPrice?.priceUsd}`);
138
+
139
+ // 2. Deep token info (works with contract addresses!)
140
+ const pepeInfo = await crypull.info('0x6982508145454Ce325dDbE47a25d4ec3d2311933');
141
+ console.log(`PEPE Market Cap: $${pepeInfo?.marketCap}`);
142
+ console.log(`PEPE Volume 24h: $${pepeInfo?.volume24h}`);
143
+ }
144
+
145
+ fetchCryptoData();
146
+ ```
147
+
148
+ **CommonJS (`require`)**
149
+ ```javascript
150
+ const { crypull } = require('crypull');
151
+
152
+ async function run() {
153
+ const ethPrice = await crypull.price('ethereum');
154
+ console.log('ETH Price:', ethPrice.priceUsd);
155
+ }
156
+ run();
157
+ ```
158
+
159
+ ### 2. Available API Methods
160
+
161
+ | Method | Returns | Description |
162
+ |--------|---------|-------------|
163
+ | `price(query: string)` | `Promise<PriceData>` | Get basic symbol and USD price. |
164
+ | `info(query: string)` | `Promise<TokenInfo>` | Massive payload including supplies, ATH/ATL, social links, and DEX pairs. |
165
+ | `search(query: string)` | `Promise<SearchResult[]>` | Find coins by name or symbol across multiple providers. |
166
+ | `top()` | `Promise<TopCoin[]>` | Get top 50 cryptocurrencies by market cap. |
167
+ | `trending()` | `Promise<TrendingCoin[]>` | Get top 10 currently trending/searched tokens. |
168
+ | `market()` | `Promise<GlobalMarketData>` | Global market cap, volume, and dominance metrics. |
169
+ | `chart(query: string, days?: number)`| `Promise<ChartData>` | Arrays of timestamps and prices for building custom charts. |
170
+ | `gas()` | `Promise<GasData>` | Current Ethereum Gwei prices. |
171
+ | `sentiment()` | `Promise<SentimentData>` | Fear and Greed index (0-100). |
172
+
173
+ ### 3. Customizing Providers
174
+ By default, the global `crypull` instance smartly loops through all available providers until it finds the best data. If you want to explicitly restrict it to specific providers, you can instantiate your own class:
175
+
176
+ ```typescript
177
+ import { Crypull, CoinGeckoProvider, BinanceProvider } from 'crypull';
178
+
179
+ // Create a custom instance that ONLY searches Binance and CoinGecko
180
+ const customCrypull = new Crypull({
181
+ providers: [
182
+ new BinanceProvider(),
183
+ new CoinGeckoProvider()
184
+ ]
185
+ });
186
+
187
+ const price = await customCrypull.price('ETH');
188
+ ```
189
+
190
+ ---
191
+
192
+ ## 🌐 Supported Providers
193
+ Crypull queries data from the following platforms. It handles all rate-limits gracefully without requiring API keys.
194
+
195
+ - **Binance:** Extremely fast for top CEX pairs.
196
+ - **DexScreener:** Best for new and trending DEX tokens, contract addresses, and deep liquidity data.
197
+ - **CoinGecko:** Broadest coverage for general coins, historical market data, and descriptions.
198
+ - **Coinpaprika:** Provides extensive market data and supply metrics.
199
+ - **CoinCap:** Fast, real-time pricing and market activity.
200
+ - **CryptoCompare:** High-quality fallback market data.
201
+ - **GeckoTerminal:** Fallback for custom networks and liquidity pools not fully indexed elsewhere.
202
+
203
+ ---
204
+
205
+ <div align="center">
206
+
207
+ **Built with ❤️ for Web3 Developers**
208
+
209
+ </div>
package/dist/cli.d.mts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node