clanker-sdk 1.8.0 → 3.1.1
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 +90 -245
- package/dist/index.d.mts +49 -136
- package/dist/index.d.ts +49 -136
- package/dist/index.js +86 -376
- package/dist/index.mjs +92 -362
- package/package.json +15 -45
package/README.md
CHANGED
|
@@ -1,277 +1,122 @@
|
|
|
1
|
-
# Clanker SDK
|
|
1
|
+
# Clanker SDK v3.1.0
|
|
2
2
|
|
|
3
|
-
A lightweight TypeScript SDK for
|
|
3
|
+
A lightweight TypeScript SDK for deploying tokens using Clanker v3.1.0. This SDK provides a simple interface for deploying tokens with configurable market caps, vaulting, and reward distributions.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install clanker-sdk
|
|
8
|
+
npm install clanker-sdk viem
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
### 1. Request API Access
|
|
14
|
-
Currently, API access is granted on a case-by-case basis to interested platforms. To request access, please contact:
|
|
15
|
-
- Telegram: `btayengco`
|
|
16
|
-
- Warpcast: `btayengco`
|
|
17
|
-
|
|
18
|
-
We'll evaluate each request individually as we carefully scale our platform access.
|
|
19
|
-
|
|
20
|
-
### 2. Environment Setup
|
|
21
|
-
Create a `.env` file in your project root:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
# Clanker API Key (required for token operations)
|
|
25
|
-
CLANKER_API_KEY=your_api_key_here
|
|
26
|
-
|
|
27
|
-
# Dune Analytics API Key (optional)
|
|
28
|
-
DUNE_API_KEY=your_dune_api_key_here
|
|
29
|
-
|
|
30
|
-
# The Graph API Key (optional)
|
|
31
|
-
GRAPH_API_KEY=your_graph_api_key_here
|
|
32
|
-
|
|
33
|
-
# CoinGecko Pro API Key (optional)
|
|
34
|
-
COINGECKO_API_KEY=your_coingecko_api_key_here
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
Copy the `.env.example` file to get started:
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
cp .env.example .env
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Make sure to add your API keys to the `.env` file and never commit it to version control.
|
|
44
|
-
|
|
45
|
-
### 3. Getting Your API Keys
|
|
46
|
-
|
|
47
|
-
#### Clanker API Key
|
|
48
|
-
Contact `btayengco` on Telegram or Warpcast to request access.
|
|
49
|
-
|
|
50
|
-
#### Dune Analytics API Key (Optional)
|
|
51
|
-
To access market data features:
|
|
52
|
-
1. Visit [dune.xyz](https://dune.xyz) and sign up for an account
|
|
53
|
-
2. Go to your [API Keys page](https://dune.com/settings/api)
|
|
54
|
-
3. Create a new API key
|
|
55
|
-
4. Add the key to your `.env` file as `DUNE_API_KEY`
|
|
56
|
-
|
|
57
|
-
Note: Dune API access requires a paid subscription. Check their [pricing page](https://dune.com/pricing) for more details.
|
|
58
|
-
|
|
59
|
-
#### The Graph API Key (Optional)
|
|
60
|
-
To access Uniswap data:
|
|
61
|
-
1. Visit [thegraph.com](https://thegraph.com) and create an account
|
|
62
|
-
2. Go to your billing settings
|
|
63
|
-
3. Create an API key
|
|
64
|
-
4. Add the key to your `.env` file as `GRAPH_API_KEY`
|
|
65
|
-
|
|
66
|
-
#### CoinGecko Pro API Key (Optional)
|
|
67
|
-
To access CoinGecko's comprehensive market data:
|
|
68
|
-
1. Visit [CoinGecko](https://www.coingecko.com) and create an account
|
|
69
|
-
2. Go to your [Developer Dashboard](https://www.coingecko.com/en/api/pricing)
|
|
70
|
-
3. Choose a subscription plan and create an API key
|
|
71
|
-
4. Add the key to your `.env` file as `COINGECKO_API_KEY`
|
|
72
|
-
|
|
73
|
-
For detailed instructions on setting up your CoinGecko API key, visit their [official documentation](https://docs.coingecko.com/reference/setting-up-your-api-key).
|
|
74
|
-
|
|
75
|
-
### 4. Basic Usage
|
|
11
|
+
## Usage
|
|
76
12
|
|
|
77
13
|
```typescript
|
|
78
|
-
import
|
|
79
|
-
import {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
);
|
|
90
|
-
|
|
91
|
-
// Example 1: Get price for your token on Base/Ethereum
|
|
92
|
-
const tokenAddress = '0x1234567890123456789012345678901234567890'; // Your token address
|
|
93
|
-
|
|
94
|
-
// Direct CoinGecko API usage
|
|
95
|
-
const url = 'https://pro-api.coingecko.com/api/v3/simple/token_price/id';
|
|
96
|
-
const options = {
|
|
97
|
-
method: 'GET',
|
|
98
|
-
headers: {
|
|
99
|
-
'accept': 'application/json',
|
|
100
|
-
'x-cg-pro-api-key': process.env.COINGECKO_API_KEY
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
// You can use the API directly
|
|
105
|
-
fetch(url, options)
|
|
106
|
-
.then(res => res.json())
|
|
107
|
-
.then(json => console.log('Token price:', json))
|
|
108
|
-
.catch(err => console.error('Error:', err));
|
|
109
|
-
|
|
110
|
-
// Or use our SDK wrapper for easier handling
|
|
111
|
-
const tokenPrices = await marketData.getGeckoTokenPrice({
|
|
112
|
-
'ethereum': [tokenAddress] // For tokens on Base/Ethereum
|
|
14
|
+
import { createWalletClient, http } from 'viem';
|
|
15
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
16
|
+
import { base } from 'viem/chains';
|
|
17
|
+
import { Clanker } from 'clanker-sdk';
|
|
18
|
+
|
|
19
|
+
// Initialize wallet
|
|
20
|
+
const account = privateKeyToAccount('0x...');
|
|
21
|
+
const wallet = createWalletClient({
|
|
22
|
+
account,
|
|
23
|
+
chain: base,
|
|
24
|
+
transport: http()
|
|
113
25
|
});
|
|
114
|
-
console.log('Token prices:', tokenPrices);
|
|
115
|
-
|
|
116
|
-
// Example 2: Other SDK features (optional)
|
|
117
|
-
const clanker = new ClankerSDK(process.env.CLANKER_API_KEY);
|
|
118
26
|
|
|
119
|
-
//
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
requestorAddress: "0x1234567890123456789012345678901234567890"
|
|
27
|
+
// Initialize Clanker SDK
|
|
28
|
+
const clanker = new Clanker({
|
|
29
|
+
wallet,
|
|
30
|
+
factoryAddress: '0x2A787b2362021cC3eEa3C24C4748a6cD5B687382', // Clanker factory address on Base
|
|
31
|
+
chainId: base.id
|
|
125
32
|
});
|
|
126
33
|
|
|
127
|
-
//
|
|
128
|
-
const
|
|
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
|
-
FROM dune.clanker_protection_team.result_clnkr_100_k_mkt_share_2_0
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
This view provides real-time insights into the best-performing tokens deployed through Clanker on Base & Farcaster.
|
|
162
|
-
|
|
163
|
-
### CoinGecko Market Data
|
|
164
|
-
Get token prices by contract address on Base/Ethereum:
|
|
165
|
-
|
|
166
|
-
```typescript
|
|
167
|
-
// Example 1: Get price for your token (RECOMMENDED)
|
|
168
|
-
const tokenAddress = '0x1234567890123456789012345678901234567890'; // Your token address
|
|
169
|
-
|
|
170
|
-
// The SDK uses this CoinGecko endpoint under the hood:
|
|
171
|
-
// GET https://pro-api.coingecko.com/api/v3/simple/token_price/id
|
|
172
|
-
// You can also use it directly:
|
|
173
|
-
const url = 'https://pro-api.coingecko.com/api/v3/simple/token_price/id';
|
|
174
|
-
const options = {
|
|
175
|
-
method: 'GET',
|
|
176
|
-
headers: {
|
|
177
|
-
'accept': 'application/json',
|
|
178
|
-
'x-cg-pro-api-key': process.env.COINGECKO_API_KEY
|
|
34
|
+
// Deploy a token
|
|
35
|
+
const tokenAddress = await clanker.deploy({
|
|
36
|
+
tokenConfig: {
|
|
37
|
+
name: 'My Token',
|
|
38
|
+
symbol: 'MTK',
|
|
39
|
+
salt: '0x...', // bytes32 for address customization
|
|
40
|
+
image: 'ipfs://...',
|
|
41
|
+
metadata: 'ipfs://...',
|
|
42
|
+
context: 'Deployed via SDK',
|
|
43
|
+
originatingChainId: BigInt(base.id)
|
|
44
|
+
},
|
|
45
|
+
poolConfig: {
|
|
46
|
+
pairedToken: '0x4200000000000000000000000000000000000006', // WETH on Base
|
|
47
|
+
initialMarketCapInPairedToken: BigInt(10) * BigInt(10)**BigInt(18) // 10 WETH initial mcap
|
|
48
|
+
},
|
|
49
|
+
// Optional: Lock tokens in vault
|
|
50
|
+
vaultConfig: {
|
|
51
|
+
vaultPercentage: 30, // 30% of supply
|
|
52
|
+
vaultDuration: BigInt(30 * 24 * 60 * 60) // 30 days in seconds
|
|
53
|
+
},
|
|
54
|
+
// Optional: Perform initial buy with ETH
|
|
55
|
+
initialBuyConfig: {
|
|
56
|
+
pairedTokenPoolFee: 3000, // 0.3% fee tier for ETH -> pairedToken swap
|
|
57
|
+
pairedTokenSwapAmountOutMinimum: BigInt('1000000000000000000') // 1 ETH
|
|
58
|
+
},
|
|
59
|
+
rewardsConfig: {
|
|
60
|
+
creatorReward: BigInt(80), // 80% of remaining rewards (after 20% team cut)
|
|
61
|
+
creatorAdmin: '0x...', // Address to manage creator's locked tokens
|
|
62
|
+
creatorRewardRecipient: '0x...', // Address to receive creator's trading fees
|
|
63
|
+
interfaceAdmin: '0x...', // Address to manage interface's trading fees
|
|
64
|
+
interfaceRewardRecipient: '0x...' // Address to receive interface's trading fees
|
|
179
65
|
}
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
// Direct API usage
|
|
183
|
-
fetch(url, options)
|
|
184
|
-
.then(res => res.json())
|
|
185
|
-
.then(json => console.log(json))
|
|
186
|
-
.catch(err => console.error(err));
|
|
187
|
-
|
|
188
|
-
// Or use our SDK wrapper (handles authentication and error handling)
|
|
189
|
-
const tokenPrices = await marketData.getGeckoTokenPrice({
|
|
190
|
-
'ethereum': [tokenAddress] // For tokens on Base/Ethereum
|
|
191
66
|
});
|
|
192
|
-
```
|
|
193
67
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
### Clanker Dictionary
|
|
197
|
-
Get detailed information about all Clanker tokens:
|
|
198
|
-
```typescript
|
|
199
|
-
const dictionary = await marketData.getClankerDictionary();
|
|
200
|
-
// Returns: Array of tokens with market cap, volume, and liquidity data
|
|
68
|
+
console.log('Token deployed at:', tokenAddress);
|
|
201
69
|
```
|
|
202
70
|
|
|
203
|
-
|
|
204
|
-
Get detailed DEX pair statistics for any token:
|
|
205
|
-
```typescript
|
|
206
|
-
const dexStats = await marketData.getDexPairStats(
|
|
207
|
-
'ethereum', // Chain name (ethereum, arbitrum, etc.)
|
|
208
|
-
'0x1234...' // Optional: Token address to filter by
|
|
209
|
-
);
|
|
210
|
-
// Returns: Detailed DEX pair statistics including:
|
|
211
|
-
// - Trading volumes (24h, 7d, 30d)
|
|
212
|
-
// - Liquidity
|
|
213
|
-
// - Volume/Liquidity ratios
|
|
214
|
-
```
|
|
71
|
+
## Features
|
|
215
72
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
);
|
|
223
|
-
// Returns: Array of tokens with:
|
|
224
|
-
// - WETH price
|
|
225
|
-
// - Transaction count
|
|
226
|
-
// - Volume in USD
|
|
227
|
-
// - Decimals
|
|
228
|
-
```
|
|
73
|
+
- Deploy tokens with customizable parameters
|
|
74
|
+
- Calculate initial token price based on desired market cap in paired token
|
|
75
|
+
- Support for token vaulting with configurable duration and percentage
|
|
76
|
+
- Configure reward distribution between creator and interface
|
|
77
|
+
- Support for initial token buys with ETH
|
|
78
|
+
- Super-chain compatibility for cross-chain deployments
|
|
229
79
|
|
|
230
|
-
|
|
231
|
-
- ethereum
|
|
232
|
-
- arbitrum
|
|
233
|
-
- base
|
|
234
|
-
- bnb
|
|
235
|
-
- celo
|
|
236
|
-
- fantom
|
|
237
|
-
- gnosis
|
|
238
|
-
- optimism
|
|
239
|
-
- polygon
|
|
240
|
-
- scroll
|
|
241
|
-
- zk_sync
|
|
242
|
-
- solana
|
|
80
|
+
## Configuration
|
|
243
81
|
|
|
244
|
-
|
|
82
|
+
### TokenConfig
|
|
83
|
+
- `name`: Token name
|
|
84
|
+
- `symbol`: Token symbol
|
|
85
|
+
- `salt`: Address salt value for token address customization
|
|
86
|
+
- `image`: Token image URI
|
|
87
|
+
- `metadata`: Token metadata URI
|
|
88
|
+
- `context`: Additional deployment context
|
|
89
|
+
- `originatingChainId`: Chain ID where token supply is deployed
|
|
245
90
|
|
|
246
|
-
|
|
91
|
+
### PoolConfig
|
|
92
|
+
- `pairedToken`: Token to pair with (e.g., WETH)
|
|
93
|
+
- `initialMarketCapInPairedToken`: Desired initial market cap in paired token units
|
|
247
94
|
|
|
248
|
-
|
|
249
|
-
-
|
|
250
|
-
-
|
|
95
|
+
### VaultConfig (Optional)
|
|
96
|
+
- `vaultPercentage`: Percentage of supply to lock (max 30)
|
|
97
|
+
- `vaultDuration`: Lock duration in seconds (min 30 days)
|
|
251
98
|
|
|
252
|
-
|
|
99
|
+
### InitialBuyConfig (Optional)
|
|
100
|
+
- `pairedTokenPoolFee`: Fee tier for ETH -> pairedToken swap
|
|
101
|
+
- `pairedTokenSwapAmountOutMinimum`: Minimum amount of paired tokens to receive
|
|
253
102
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
103
|
+
### RewardsConfig
|
|
104
|
+
- `creatorReward`: Creator's percentage of remaining rewards after team cut (max 80)
|
|
105
|
+
- `creatorAdmin`: Address to manage creator's locked tokens
|
|
106
|
+
- `creatorRewardRecipient`: Address to receive creator's trading fees
|
|
107
|
+
- `interfaceAdmin`: Address to manage interface's trading fees
|
|
108
|
+
- `interfaceRewardRecipient`: Address to receive interface's trading fees
|
|
260
109
|
|
|
261
|
-
##
|
|
110
|
+
## Super-chain Compatibility
|
|
262
111
|
|
|
263
|
-
|
|
264
|
-
npm install # Install dependencies
|
|
265
|
-
npm run build # Build the SDK
|
|
266
|
-
npm test # Run tests
|
|
267
|
-
npm run lint # Run linter
|
|
268
|
-
npm run format # Format code
|
|
269
|
-
```
|
|
112
|
+
The SDK supports deploying tokens that are compatible with the super-chain architecture. When deploying a token:
|
|
270
113
|
|
|
271
|
-
|
|
114
|
+
1. Set `originatingChainId` to the chain ID where the token's supply should be minted
|
|
115
|
+
2. Deploy the token on other super-chain networks using the same parameters
|
|
116
|
+
3. Use the super-chain's bridge to migrate tokens between networks
|
|
272
117
|
|
|
273
|
-
|
|
118
|
+
Note: Tokens can only be minted with supply on the originating chain. Make sure the target chains are part of the same super-chain cluster.
|
|
274
119
|
|
|
275
120
|
## License
|
|
276
121
|
|
|
277
|
-
|
|
122
|
+
MIT
|
package/dist/index.d.mts
CHANGED
|
@@ -1,143 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
symbol: string;
|
|
5
|
-
decimals: number;
|
|
6
|
-
name: string;
|
|
7
|
-
}
|
|
8
|
-
interface DeployTokenOptions {
|
|
1
|
+
import { Address, WalletClient, Account } from 'viem';
|
|
2
|
+
|
|
3
|
+
interface TokenConfig {
|
|
9
4
|
name: string;
|
|
10
5
|
symbol: string;
|
|
6
|
+
salt: `0x${string}`;
|
|
11
7
|
image: string;
|
|
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
|
-
declare class ClankerError extends Error {
|
|
49
|
-
readonly code?: string | undefined;
|
|
50
|
-
readonly status?: number | undefined;
|
|
51
|
-
readonly details?: any | undefined;
|
|
52
|
-
constructor(message: string, code?: string | undefined, status?: number | undefined, details?: any | undefined);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
declare class ClankerSDK {
|
|
56
|
-
private readonly api;
|
|
57
|
-
private readonly baseURL;
|
|
58
|
-
constructor(apiKey: string);
|
|
59
|
-
getEstimatedUncollectedFees(contractAddress: string): Promise<UncollectedFeesResponse>;
|
|
60
|
-
deployToken(options: DeployTokenOptions): Promise<DeployedToken>;
|
|
61
|
-
deployTokenWithSplits(options: DeployTokenWithSplitsOptions): Promise<DeployedToken>;
|
|
62
|
-
fetchDeployedByAddress(address: string, page?: number): Promise<DeployedTokensResponse>;
|
|
63
|
-
getEstimatedRewardsByPoolAddress(poolAddress: string): Promise<EstimatedRewardsResponse>;
|
|
64
|
-
getClankerByAddress(address: string): Promise<DeployedToken>;
|
|
65
|
-
private generateRequestKey;
|
|
66
|
-
private isValidAddress;
|
|
67
|
-
private validateDeployOptions;
|
|
8
|
+
metadata: string;
|
|
9
|
+
context: string;
|
|
10
|
+
originatingChainId: bigint;
|
|
11
|
+
}
|
|
12
|
+
interface VaultConfig {
|
|
13
|
+
vaultPercentage: number;
|
|
14
|
+
vaultDuration: bigint;
|
|
15
|
+
}
|
|
16
|
+
interface PoolConfig {
|
|
17
|
+
pairedToken: Address;
|
|
18
|
+
initialMarketCapInPairedToken: bigint;
|
|
19
|
+
}
|
|
20
|
+
interface InitialBuyConfig {
|
|
21
|
+
pairedTokenPoolFee: number;
|
|
22
|
+
pairedTokenSwapAmountOutMinimum: bigint;
|
|
23
|
+
}
|
|
24
|
+
interface RewardsConfig {
|
|
25
|
+
creatorReward: bigint;
|
|
26
|
+
creatorAdmin: Address;
|
|
27
|
+
creatorRewardRecipient: Address;
|
|
28
|
+
interfaceAdmin: Address;
|
|
29
|
+
interfaceRewardRecipient: Address;
|
|
30
|
+
}
|
|
31
|
+
interface DeploymentConfig {
|
|
32
|
+
tokenConfig: TokenConfig;
|
|
33
|
+
vaultConfig?: VaultConfig;
|
|
34
|
+
poolConfig: PoolConfig;
|
|
35
|
+
initialBuyConfig?: InitialBuyConfig;
|
|
36
|
+
rewardsConfig: RewardsConfig;
|
|
37
|
+
}
|
|
38
|
+
interface ClankerConfig {
|
|
39
|
+
wallet: WalletClient & {
|
|
40
|
+
account: Account;
|
|
41
|
+
};
|
|
42
|
+
factoryAddress: Address;
|
|
43
|
+
chainId: number;
|
|
68
44
|
}
|
|
69
45
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
interface DexPairStats {
|
|
79
|
-
token_a_address: string;
|
|
80
|
-
token_a_symbol: string;
|
|
81
|
-
token_b_address: string;
|
|
82
|
-
token_b_symbol: string;
|
|
83
|
-
volume_24h: number;
|
|
84
|
-
volume_7d: number;
|
|
85
|
-
volume_30d: number;
|
|
86
|
-
liquidity: number;
|
|
87
|
-
volume_to_liquidity_ratio: number;
|
|
88
|
-
}
|
|
89
|
-
interface GraphToken {
|
|
90
|
-
contractAddress: string;
|
|
91
|
-
decimals: number;
|
|
92
|
-
transactionCount: number;
|
|
93
|
-
volumeUSD: number;
|
|
94
|
-
priceWETH: number;
|
|
95
|
-
}
|
|
96
|
-
interface CoinGeckoTokenData {
|
|
97
|
-
price: number;
|
|
98
|
-
marketCap: number;
|
|
99
|
-
volume24h: number;
|
|
100
|
-
priceChange24h: number;
|
|
101
|
-
lastUpdated: Date;
|
|
102
|
-
}
|
|
103
|
-
declare class MarketDataClient {
|
|
104
|
-
private readonly dune?;
|
|
105
|
-
private readonly duneApiKey?;
|
|
106
|
-
private readonly graphApiKey?;
|
|
107
|
-
private readonly geckoApiKey?;
|
|
108
|
-
private readonly DICTIONARY_QUERY_ID;
|
|
109
|
-
private readonly GRAPH_API_ENDPOINT;
|
|
110
|
-
private readonly UNISWAP_SUBGRAPH_ID;
|
|
111
|
-
private readonly COINGECKO_API_ENDPOINT;
|
|
112
|
-
constructor(duneApiKey?: string, graphApiKey?: string, geckoApiKey?: string);
|
|
113
|
-
/**
|
|
114
|
-
* Get market data from CoinGecko (requires CoinGecko API key)
|
|
115
|
-
* @param tokenIds Array of CoinGecko token IDs
|
|
116
|
-
*/
|
|
117
|
-
getGeckoTokenData(tokenIds: string[]): Promise<Record<string, CoinGeckoTokenData>>;
|
|
118
|
-
/**
|
|
119
|
-
* Get market data from the materialized view (requires Dune API key)
|
|
120
|
-
*/
|
|
121
|
-
getClankerDictionary(): Promise<ClankerMarketData[]>;
|
|
122
|
-
/**
|
|
123
|
-
* Get DEX pair stats for a specific chain (requires Dune API key)
|
|
124
|
-
* @param chain - The blockchain to query (e.g., 'ethereum', 'arbitrum', etc.)
|
|
125
|
-
* @param tokenAddress - Optional token address to filter by
|
|
126
|
-
*/
|
|
127
|
-
getDexPairStats(chain: string, tokenAddress?: string): Promise<DexPairStats[]>;
|
|
128
|
-
/**
|
|
129
|
-
* Fetch Uniswap data for multiple tokens using The Graph (requires Graph API key)
|
|
130
|
-
* @param contractAddresses Array of token contract addresses
|
|
131
|
-
* @param blockNumber Optional block number for historical data
|
|
132
|
-
*/
|
|
133
|
-
getUniswapData(contractAddresses: string[], blockNumber?: number): Promise<GraphToken[]>;
|
|
134
|
-
/**
|
|
135
|
-
* Filter DEX pairs by token address
|
|
136
|
-
*/
|
|
137
|
-
private filterPairsByToken;
|
|
138
|
-
private buildUniswapQuery;
|
|
139
|
-
private transformUniswapData;
|
|
140
|
-
private calculatePrice;
|
|
46
|
+
declare class Clanker {
|
|
47
|
+
private readonly wallet;
|
|
48
|
+
private readonly factoryAddress;
|
|
49
|
+
private readonly chainId;
|
|
50
|
+
private readonly publicClient;
|
|
51
|
+
constructor(config: ClankerConfig);
|
|
52
|
+
private calculateTick;
|
|
53
|
+
deploy(config: DeploymentConfig): Promise<Address>;
|
|
141
54
|
}
|
|
142
55
|
|
|
143
|
-
export {
|
|
56
|
+
export { Clanker, type ClankerConfig, type DeploymentConfig, type InitialBuyConfig, type PoolConfig, type RewardsConfig, type TokenConfig, type VaultConfig };
|