@gala-chain/launchpad-sdk 3.9.0 → 3.10.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 +243 -1
- package/dist/LaunchpadSDK.d.ts +112 -1
- package/dist/LaunchpadSDK.d.ts.map +1 -1
- package/dist/api/LaunchpadAPI.d.ts +108 -0
- package/dist/api/LaunchpadAPI.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/services/TokenMetadataCache.d.ts +242 -0
- package/dist/services/TokenMetadataCache.d.ts.map +1 -0
- package/dist/utils/cacheWarmingHelpers.d.ts +110 -0
- package/dist/utils/cacheWarmingHelpers.d.ts.map +1 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -112,10 +112,17 @@ claude mcp add "galachain-launchpad" -- env PRIVATE_KEY=<YOUR_PRIVATE_KEY> ENVIR
|
|
|
112
112
|
- `DEBUG` - Enable debug logging: `true` | `false` (default: false)
|
|
113
113
|
- `TIMEOUT` - Request timeout in milliseconds (default: 30000)
|
|
114
114
|
|
|
115
|
-
**Features**:
|
|
115
|
+
**Features**: 47 tools + 14 slash commands for complete Gala Launchpad operations
|
|
116
116
|
|
|
117
117
|
See: [MCP Server Documentation](../../mcp-server/README.md)
|
|
118
118
|
|
|
119
|
+
**Try slash commands** (MCP v1.4.0+):
|
|
120
|
+
```
|
|
121
|
+
/galachain-launchpad:analyze-token tokenName=anime
|
|
122
|
+
/galachain-launchpad:portfolio
|
|
123
|
+
/galachain-launchpad:buy-tokens tokenName=anime galaAmount=100
|
|
124
|
+
```
|
|
125
|
+
|
|
119
126
|
### For AI Developers
|
|
120
127
|
|
|
121
128
|
Need help with SDK integration, trading bots, or MCP server development?
|
|
@@ -831,6 +838,241 @@ const calc2 = await sdk.calculateBuyAmount({
|
|
|
831
838
|
});
|
|
832
839
|
```
|
|
833
840
|
|
|
841
|
+
## Token Metadata Cache
|
|
842
|
+
|
|
843
|
+
The SDK includes an **intelligent metadata cache** that eliminates redundant API calls and enables instant local calculations. The cache stores immutable token metadata (reverse bonding curve fees, vault addresses, max supply) that never changes.
|
|
844
|
+
|
|
845
|
+
### How Cache Warming Works
|
|
846
|
+
|
|
847
|
+
**Opportunistic & Zero-Cost**: Cache warming happens automatically during normal SDK operations without any additional network requests. When you call `fetchPools()`, the SDK extracts and caches metadata from the pool data that was already fetched.
|
|
848
|
+
|
|
849
|
+
```typescript
|
|
850
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
851
|
+
|
|
852
|
+
const sdk = createLaunchpadSDK({
|
|
853
|
+
wallet: 'your-private-key-or-mnemonic'
|
|
854
|
+
});
|
|
855
|
+
|
|
856
|
+
// Before fetching - cache is empty
|
|
857
|
+
let cacheInfo = sdk.getCacheInfo();
|
|
858
|
+
console.log('Cached tokens:', cacheInfo.totalTokens); // 0
|
|
859
|
+
|
|
860
|
+
// Fetch pools - automatically warms cache with RBC fees and vault addresses
|
|
861
|
+
await sdk.fetchPools({ type: 'recent', limit: 20 });
|
|
862
|
+
|
|
863
|
+
// After fetching - cache is warmed with 20 tokens
|
|
864
|
+
cacheInfo = sdk.getCacheInfo();
|
|
865
|
+
console.log('Cached tokens:', cacheInfo.totalTokens); // 20
|
|
866
|
+
console.log('Cache size:', (cacheInfo.cacheSize / 1024).toFixed(2), 'KB');
|
|
867
|
+
|
|
868
|
+
// Now local calculations are instant (no network calls required)
|
|
869
|
+
const calc = await sdk.calculateBuyAmountLocal({
|
|
870
|
+
tokenName: 'anime',
|
|
871
|
+
amount: '100',
|
|
872
|
+
type: 'native',
|
|
873
|
+
currentSupply: '500000'
|
|
874
|
+
});
|
|
875
|
+
console.log('Instant result:', calc.amount); // <1ms, used cached RBC fees
|
|
876
|
+
```
|
|
877
|
+
|
|
878
|
+
### Performance Benefits
|
|
879
|
+
|
|
880
|
+
**Dramatic Performance Improvements:**
|
|
881
|
+
|
|
882
|
+
| Operation | Without Cache | With Cache | Improvement |
|
|
883
|
+
|-----------|---------------|------------|-------------|
|
|
884
|
+
| Single calculation | ~200ms | <1ms | **200x faster** |
|
|
885
|
+
| 10 calculations | ~2000ms | <5ms | **400x faster** |
|
|
886
|
+
| Price discovery (50 tokens) | ~10,000ms | ~50ms | **200x faster** |
|
|
887
|
+
|
|
888
|
+
**Zero Network Overhead**: Cache warming extracts metadata from pool responses you're already receiving - no extra API calls required.
|
|
889
|
+
|
|
890
|
+
**Memory Efficient**:
|
|
891
|
+
- ~220 bytes per cached token (includes RBC fees + vault address)
|
|
892
|
+
- Max 10,000 tokens = ~2.5 MB total memory
|
|
893
|
+
- LRU eviction keeps memory bounded
|
|
894
|
+
|
|
895
|
+
### Cache Lifecycle
|
|
896
|
+
|
|
897
|
+
**Session Lifetime**:
|
|
898
|
+
- Cache persists for entire MCP server session (survives across conversations)
|
|
899
|
+
- For direct SDK usage, cache lifetime matches SDK instance lifetime
|
|
900
|
+
- Call `sdk.cleanup()` to clear cache and release resources
|
|
901
|
+
|
|
902
|
+
**LRU Eviction**:
|
|
903
|
+
- Maximum 10,000 tokens cached
|
|
904
|
+
- Least Recently Updated (LRU) tokens evicted when limit reached
|
|
905
|
+
- O(1) get/set/eviction using JavaScript Map insertion order
|
|
906
|
+
|
|
907
|
+
```typescript
|
|
908
|
+
// Cache automatically manages size
|
|
909
|
+
await sdk.fetchPools({ limit: 100 }); // Warms cache with 100 tokens
|
|
910
|
+
await sdk.fetchPools({ limit: 100 }); // Warms with 100 more tokens
|
|
911
|
+
await sdk.fetchPools({ limit: 100 }); // ... continues
|
|
912
|
+
|
|
913
|
+
// When 10,000 limit reached, oldest tokens are evicted automatically
|
|
914
|
+
const stats = sdk.getCacheInfo();
|
|
915
|
+
console.log('Total tokens:', stats.totalTokens); // Never exceeds 10,000
|
|
916
|
+
console.log('Oldest entry:', new Date(stats.oldestEntry).toISOString());
|
|
917
|
+
```
|
|
918
|
+
|
|
919
|
+
### Cache Management API
|
|
920
|
+
|
|
921
|
+
**Get Cache Statistics:**
|
|
922
|
+
|
|
923
|
+
```typescript
|
|
924
|
+
const stats = sdk.getCacheInfo();
|
|
925
|
+
console.log('Total tokens cached:', stats.totalTokens);
|
|
926
|
+
console.log('Memory usage:', stats.cacheSize, 'bytes');
|
|
927
|
+
console.log('Average per entry:', (stats.cacheSize / stats.totalTokens).toFixed(0), 'bytes');
|
|
928
|
+
console.log('Oldest entry:', new Date(stats.oldestEntry).toISOString());
|
|
929
|
+
```
|
|
930
|
+
|
|
931
|
+
**Clear Cache (Selective or Complete):**
|
|
932
|
+
|
|
933
|
+
```typescript
|
|
934
|
+
// Clear specific token
|
|
935
|
+
sdk.clearCache('anime');
|
|
936
|
+
console.log('Cleared anime from cache');
|
|
937
|
+
|
|
938
|
+
// Clear all tokens
|
|
939
|
+
sdk.clearCache();
|
|
940
|
+
console.log('Cleared entire cache');
|
|
941
|
+
|
|
942
|
+
// Verify cache is empty
|
|
943
|
+
const stats = sdk.getCacheInfo();
|
|
944
|
+
console.log('Tokens remaining:', stats.totalTokens); // 0
|
|
945
|
+
```
|
|
946
|
+
|
|
947
|
+
**Manual Cache Warming (Advanced):**
|
|
948
|
+
|
|
949
|
+
```typescript
|
|
950
|
+
// Manually warm cache from pool data (useful for custom caching scenarios)
|
|
951
|
+
sdk.warmCacheFromPoolData('mytoken', {
|
|
952
|
+
vaultAddress: 'service|Token$Unit$MYTOKEN$...',
|
|
953
|
+
reverseBondingCurveMinFeeFactor: 0.0,
|
|
954
|
+
reverseBondingCurveMaxFeeFactor: 0.5
|
|
955
|
+
});
|
|
956
|
+
|
|
957
|
+
// Cache is now warmed for local calculations
|
|
958
|
+
const calc = await sdk.calculateBuyAmountLocal({
|
|
959
|
+
tokenName: 'mytoken',
|
|
960
|
+
amount: '100',
|
|
961
|
+
type: 'native',
|
|
962
|
+
currentSupply: '1000000'
|
|
963
|
+
});
|
|
964
|
+
```
|
|
965
|
+
|
|
966
|
+
### Complete Cache Example
|
|
967
|
+
|
|
968
|
+
```typescript
|
|
969
|
+
import { createLaunchpadSDK, CALCULATION_MODES } from '@gala-chain/launchpad-sdk';
|
|
970
|
+
|
|
971
|
+
const sdk = createLaunchpadSDK({
|
|
972
|
+
wallet: 'your-private-key-or-mnemonic'
|
|
973
|
+
});
|
|
974
|
+
|
|
975
|
+
// 1. Warm cache by fetching pools
|
|
976
|
+
console.log('Warming cache...');
|
|
977
|
+
await sdk.fetchPools({ type: 'popular', limit: 50 });
|
|
978
|
+
|
|
979
|
+
// 2. Check cache statistics
|
|
980
|
+
const stats = sdk.getCacheInfo();
|
|
981
|
+
console.log(`Cache warmed with ${stats.totalTokens} tokens`);
|
|
982
|
+
console.log(`Memory: ${(stats.cacheSize / 1024).toFixed(2)} KB`);
|
|
983
|
+
|
|
984
|
+
// 3. Perform instant calculations using cached metadata
|
|
985
|
+
const tokens = ['anime', 'dragnrkti', 'rocketri'];
|
|
986
|
+
|
|
987
|
+
console.log('\nCalculating spot prices (instant, no network calls):');
|
|
988
|
+
console.time('Batch Calculations');
|
|
989
|
+
|
|
990
|
+
for (const token of tokens) {
|
|
991
|
+
// Get pool details once for this token
|
|
992
|
+
const poolDetails = await sdk.fetchPoolDetailsForCalculation(token);
|
|
993
|
+
|
|
994
|
+
// Multiple instant calculations using cached data
|
|
995
|
+
const [buy10, buy100, buy1000] = await Promise.all([
|
|
996
|
+
sdk.calculateBuyAmountLocal({
|
|
997
|
+
tokenName: token,
|
|
998
|
+
amount: '10',
|
|
999
|
+
type: 'native',
|
|
1000
|
+
currentSupply: poolDetails.currentSupply
|
|
1001
|
+
}),
|
|
1002
|
+
sdk.calculateBuyAmountLocal({
|
|
1003
|
+
tokenName: token,
|
|
1004
|
+
amount: '100',
|
|
1005
|
+
type: 'native',
|
|
1006
|
+
currentSupply: poolDetails.currentSupply
|
|
1007
|
+
}),
|
|
1008
|
+
sdk.calculateBuyAmountLocal({
|
|
1009
|
+
tokenName: token,
|
|
1010
|
+
amount: '1000',
|
|
1011
|
+
type: 'native',
|
|
1012
|
+
currentSupply: poolDetails.currentSupply
|
|
1013
|
+
})
|
|
1014
|
+
]);
|
|
1015
|
+
|
|
1016
|
+
console.log(`${token}:`);
|
|
1017
|
+
console.log(` 10 GALA → ${buy10.amount} tokens`);
|
|
1018
|
+
console.log(` 100 GALA → ${buy100.amount} tokens`);
|
|
1019
|
+
console.log(` 1000 GALA → ${buy1000.amount} tokens`);
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
console.timeEnd('Batch Calculations');
|
|
1023
|
+
// Output: Batch Calculations: ~50-100ms (vs ~3-5 seconds without cache)
|
|
1024
|
+
|
|
1025
|
+
// 4. Clear cache when done (optional)
|
|
1026
|
+
sdk.clearCache();
|
|
1027
|
+
console.log('\nCache cleared');
|
|
1028
|
+
```
|
|
1029
|
+
|
|
1030
|
+
### Cache Design Philosophy
|
|
1031
|
+
|
|
1032
|
+
**Immutable Data Only**: Only caches data that never changes:
|
|
1033
|
+
- ✅ Reverse bonding curve fee factors (set at token creation)
|
|
1034
|
+
- ✅ Vault addresses (permanent token identifiers)
|
|
1035
|
+
- ✅ Max supply (bonding curve constant, typically 10M)
|
|
1036
|
+
- ❌ Current supply (changes with every trade - fetched dynamically)
|
|
1037
|
+
- ❌ Token balances (user-specific and dynamic)
|
|
1038
|
+
|
|
1039
|
+
**Zero-Cost Architecture**: No extra API calls required for cache warming. Metadata is extracted from responses you're already receiving during normal operations.
|
|
1040
|
+
|
|
1041
|
+
**Bounded Memory**: LRU eviction ensures cache never exceeds 10,000 tokens (~2.5 MB), making it safe for long-running applications.
|
|
1042
|
+
|
|
1043
|
+
**Smart Defaults**: Uses 10,000,000 as default max supply for tokens without explicit data (matches 99%+ of launchpad tokens).
|
|
1044
|
+
|
|
1045
|
+
### When to Use the Cache
|
|
1046
|
+
|
|
1047
|
+
**✅ Perfect for:**
|
|
1048
|
+
- Price discovery and analytics dashboards
|
|
1049
|
+
- Trading bots with frequent calculations
|
|
1050
|
+
- Batch operations on multiple tokens
|
|
1051
|
+
- Real-time price feeds and charts
|
|
1052
|
+
- Simulation and backtesting tools
|
|
1053
|
+
|
|
1054
|
+
**❌ Not needed for:**
|
|
1055
|
+
- Single one-off calculations
|
|
1056
|
+
- Operations requiring absolute real-time precision
|
|
1057
|
+
- Scenarios where current supply changes between calls
|
|
1058
|
+
|
|
1059
|
+
### Cache Warming Demo
|
|
1060
|
+
|
|
1061
|
+
Run the complete cache demo to see all features in action:
|
|
1062
|
+
|
|
1063
|
+
```bash
|
|
1064
|
+
npm run demo-cache
|
|
1065
|
+
```
|
|
1066
|
+
|
|
1067
|
+
The demo showcases:
|
|
1068
|
+
- Opportunistic warming from `fetchPools()`
|
|
1069
|
+
- Detailed warming from `fetchPoolDetailsForCalculation()`
|
|
1070
|
+
- Token name normalization (case-insensitive)
|
|
1071
|
+
- Cache hit performance (200x+ faster than network calls)
|
|
1072
|
+
- Memory estimation accuracy
|
|
1073
|
+
- LRU eviction behavior
|
|
1074
|
+
- Clear cache operations
|
|
1075
|
+
|
|
834
1076
|
### **Trading Operations**
|
|
835
1077
|
|
|
836
1078
|
```typescript
|
package/dist/LaunchpadSDK.d.ts
CHANGED
|
@@ -306,8 +306,67 @@ export declare class LaunchpadSDK {
|
|
|
306
306
|
/**
|
|
307
307
|
* Fetch pools with optional filters
|
|
308
308
|
*
|
|
309
|
+
* Automatically warms the token metadata cache with RBC fees and vault addresses
|
|
310
|
+
* from the pools response for optimal performance in local calculations.
|
|
311
|
+
*
|
|
312
|
+
* **Cache Warming:** This method opportunistically caches immutable token metadata
|
|
313
|
+
* (reverse bonding curve fees, vault addresses) for every pool returned. This enables
|
|
314
|
+
* instant local calculations without additional API calls.
|
|
315
|
+
*
|
|
316
|
+
* @category Pool Information
|
|
309
317
|
* @param options Optional filters for pool fetching
|
|
310
|
-
* @returns Promise<PoolsResult>
|
|
318
|
+
* @returns Promise<PoolsResult> with pagination metadata
|
|
319
|
+
* @since 1.0.0
|
|
320
|
+
*
|
|
321
|
+
* @example Basic pool fetching
|
|
322
|
+
* ```typescript
|
|
323
|
+
* const result = await sdk.fetchPools({ type: 'recent', page: 1, limit: 20 });
|
|
324
|
+
* console.log(`Fetched ${result.pools.length} pools`);
|
|
325
|
+
* console.log(`Total pools: ${result.total}`);
|
|
326
|
+
* ```
|
|
327
|
+
*
|
|
328
|
+
* @example Cache warming demonstration
|
|
329
|
+
* ```typescript
|
|
330
|
+
* // Before fetching - cache is empty
|
|
331
|
+
* let cacheInfo = sdk.getCacheInfo();
|
|
332
|
+
* console.log('Cached tokens:', cacheInfo.totalTokens); // 0
|
|
333
|
+
*
|
|
334
|
+
* // Fetch pools - automatically warms cache
|
|
335
|
+
* await sdk.fetchPools({ limit: 20 });
|
|
336
|
+
*
|
|
337
|
+
* // After fetching - cache is warmed
|
|
338
|
+
* cacheInfo = sdk.getCacheInfo();
|
|
339
|
+
* console.log('Cached tokens:', cacheInfo.totalTokens); // 20
|
|
340
|
+
*
|
|
341
|
+
* // Now local calculations are instant (no network calls)
|
|
342
|
+
* const calc = await sdk.calculateBuyAmountLocal({
|
|
343
|
+
* tokenName: 'mytoken',
|
|
344
|
+
* amount: '100',
|
|
345
|
+
* type: 'native',
|
|
346
|
+
* currentSupply: '500000'
|
|
347
|
+
* });
|
|
348
|
+
* console.log('Instant result:', calc.amount); // <1ms, used cached RBC fees
|
|
349
|
+
* ```
|
|
350
|
+
*
|
|
351
|
+
* @example Performance optimization with cache
|
|
352
|
+
* ```typescript
|
|
353
|
+
* // Warm cache once
|
|
354
|
+
* await sdk.fetchPools({ type: 'popular', limit: 50 });
|
|
355
|
+
*
|
|
356
|
+
* // All subsequent calculations for these tokens are instant
|
|
357
|
+
* const tokens = ['token1', 'token2', 'token3'];
|
|
358
|
+
* const calculations = await Promise.all(
|
|
359
|
+
* tokens.map(token =>
|
|
360
|
+
* sdk.calculateBuyAmountLocal({
|
|
361
|
+
* tokenName: token,
|
|
362
|
+
* amount: '1000',
|
|
363
|
+
* type: 'exact',
|
|
364
|
+
* currentSupply: '1000000'
|
|
365
|
+
* })
|
|
366
|
+
* )
|
|
367
|
+
* );
|
|
368
|
+
* // All 3 calculations complete in <5ms total (no network calls)
|
|
369
|
+
* ```
|
|
311
370
|
*/
|
|
312
371
|
fetchPools(options?: FetchPoolsOptions): Promise<import("./types/launchpad.dto").PoolsResult>;
|
|
313
372
|
/**
|
|
@@ -1151,6 +1210,58 @@ export declare class LaunchpadSDK {
|
|
|
1151
1210
|
* @returns Promise<string | null> Vault address or null if not found
|
|
1152
1211
|
*/
|
|
1153
1212
|
resolveVaultAddress(tokenName: string): Promise<string | null>;
|
|
1213
|
+
/**
|
|
1214
|
+
* Get token metadata cache information
|
|
1215
|
+
*
|
|
1216
|
+
* Returns statistics about the token metadata cache including:
|
|
1217
|
+
* - Total number of tokens cached
|
|
1218
|
+
* - Approximate cache size in bytes
|
|
1219
|
+
* - Timestamp of oldest cache entry
|
|
1220
|
+
*
|
|
1221
|
+
* The cache persists for the entire MCP server lifetime and accumulates
|
|
1222
|
+
* metadata across conversations for optimal performance.
|
|
1223
|
+
*
|
|
1224
|
+
* @category Cache Management
|
|
1225
|
+
* @returns Cache statistics object
|
|
1226
|
+
* @since 3.9.2
|
|
1227
|
+
*
|
|
1228
|
+
* @example
|
|
1229
|
+
* ```typescript
|
|
1230
|
+
* const cacheInfo = sdk.getCacheInfo();
|
|
1231
|
+
* console.log(`Cached tokens: ${cacheInfo.totalTokens}`);
|
|
1232
|
+
* console.log(`Cache size: ${cacheInfo.cacheSize} bytes`);
|
|
1233
|
+
* console.log(`Oldest entry: ${new Date(cacheInfo.oldestEntry).toISOString()}`);
|
|
1234
|
+
* ```
|
|
1235
|
+
*/
|
|
1236
|
+
getCacheInfo(): {
|
|
1237
|
+
totalTokens: number;
|
|
1238
|
+
cacheSize: number;
|
|
1239
|
+
oldestEntry: number;
|
|
1240
|
+
};
|
|
1241
|
+
/**
|
|
1242
|
+
* Clear token metadata cache
|
|
1243
|
+
*
|
|
1244
|
+
* Clears cached token metadata. Can clear a specific token or the entire cache.
|
|
1245
|
+
* Useful for testing or when you need to force a fresh fetch of token data.
|
|
1246
|
+
*
|
|
1247
|
+
* Note: The cache automatically warms from fetchPools calls and persists
|
|
1248
|
+
* across the entire MCP session lifetime.
|
|
1249
|
+
*
|
|
1250
|
+
* @category Cache Management
|
|
1251
|
+
* @param tokenName Optional token name to clear (clears all if not provided)
|
|
1252
|
+
* @since 3.9.2
|
|
1253
|
+
*
|
|
1254
|
+
* @example Clear specific token
|
|
1255
|
+
* ```typescript
|
|
1256
|
+
* sdk.clearCache('anime'); // Clear only anime token metadata
|
|
1257
|
+
* ```
|
|
1258
|
+
*
|
|
1259
|
+
* @example Clear entire cache
|
|
1260
|
+
* ```typescript
|
|
1261
|
+
* sdk.clearCache(); // Clear all cached token metadata
|
|
1262
|
+
* ```
|
|
1263
|
+
*/
|
|
1264
|
+
clearCache(tokenName?: string): void;
|
|
1154
1265
|
/**
|
|
1155
1266
|
* Validates configuration parameters for safety and correctness
|
|
1156
1267
|
* @private
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LaunchpadSDK.d.ts","sourceRoot":"","sources":["../src/LaunchpadSDK.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAKhC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAYzE,OAAO,EAAwB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC1G,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EACL,iBAAiB,EACjB,WAAW,EAEZ,MAAM,sBAAsB,CAAC;AAE9B,O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;;;;;;;;;;;;;;;;;;;OAsBG;IACH,YAAY,IAAI;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;KACrB;IAID;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,UAAU,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;IAQpC;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAuD7B;;;OAGG;IACH,OAAO,CAAC,4BAA4B;IASpC;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAS9B;;;OAGG;YACW,yBAAyB;IAOvC;;;;;;;OAOG;YACW,mBAAmB;IAuDjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAmB9B;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,MAAM,CAAC,UAAU,CAAC,KAAK,GAAE,OAAe,GAAG,IAAI;CAUhD"}
|
|
@@ -57,6 +57,7 @@ export declare class LaunchpadAPI {
|
|
|
57
57
|
private readonly galaChainHttp?;
|
|
58
58
|
private readonly dexApiHttp?;
|
|
59
59
|
private readonly defaultCalculateAmountMode;
|
|
60
|
+
private readonly metadataCache;
|
|
60
61
|
constructor(http: HttpClient, tokenResolver: TokenResolverService, logger: Logger, bundleHttp?: HttpClient | undefined, galaChainHttp?: HttpClient | undefined, dexApiHttp?: HttpClient | undefined, defaultCalculateAmountMode?: 'local' | 'external');
|
|
61
62
|
/**
|
|
62
63
|
* Helper to conditionally add properties to an object (for exactOptionalPropertyTypes compliance)
|
|
@@ -722,6 +723,32 @@ export declare class LaunchpadAPI {
|
|
|
722
723
|
reverseBondingCurveMinFeeFactor: number;
|
|
723
724
|
reverseBondingCurveNetFeeFactor: number;
|
|
724
725
|
}>;
|
|
726
|
+
/**
|
|
727
|
+
* Fetch current supply for a token (optimized for real-time calculations)
|
|
728
|
+
*
|
|
729
|
+
* Retrieves only the current supply from GalaChain, minimizing payload size.
|
|
730
|
+
* Automatically detects and caches custom maxSupply values (if != 10M default).
|
|
731
|
+
*
|
|
732
|
+
* This method is optimized for frequent calls - it fetches only the minimal
|
|
733
|
+
* data needed (sellingTokenQuantity + maxSupply) and caches custom maxSupply
|
|
734
|
+
* for future use.
|
|
735
|
+
*
|
|
736
|
+
* @param tokenName Token name to fetch current supply for
|
|
737
|
+
* @returns Promise<string> Current token supply as decimal string
|
|
738
|
+
* @throws {ValidationError} If token not found or vault address invalid
|
|
739
|
+
* @throws {ConfigurationError} If GalaChain client not configured
|
|
740
|
+
* @throws {NetworkError} If API request fails
|
|
741
|
+
*
|
|
742
|
+
* @example
|
|
743
|
+
* ```typescript
|
|
744
|
+
* const supply = await sdk.launchpad.fetchCurrentSupply('mytoken');
|
|
745
|
+
* console.log('Current supply:', supply); // "5234567.123456789"
|
|
746
|
+
* ```
|
|
747
|
+
*
|
|
748
|
+
* @since 3.9.2
|
|
749
|
+
* @category Pool Information
|
|
750
|
+
*/
|
|
751
|
+
fetchCurrentSupply(tokenName: string): Promise<string>;
|
|
725
752
|
/**
|
|
726
753
|
* Gets the authenticated user's address in backend format
|
|
727
754
|
*
|
|
@@ -812,5 +839,86 @@ export declare class LaunchpadAPI {
|
|
|
812
839
|
* @throws Error if GALA price unavailable
|
|
813
840
|
*/
|
|
814
841
|
fetchLaunchpadTokenSpotPrice(tokenNameOrOptions: string | FetchLaunchpadTokenSpotPriceOptions): Promise<TokenSpotPrice>;
|
|
842
|
+
/**
|
|
843
|
+
* Warm cache from pool data (opportunistic caching)
|
|
844
|
+
*
|
|
845
|
+
* Public API for warming the token metadata cache with data extracted from
|
|
846
|
+
* pool responses. This method is used internally by SDK operations and can
|
|
847
|
+
* also be called directly for custom caching scenarios.
|
|
848
|
+
*
|
|
849
|
+
* The cache stores immutable token metadata (RBC fees, vault addresses, maxSupply)
|
|
850
|
+
* that never change and can be reused across operations.
|
|
851
|
+
*
|
|
852
|
+
* @param tokenName - Token name (normalized to lowercase internally)
|
|
853
|
+
* @param metadata - Partial metadata to cache (any combination of fields)
|
|
854
|
+
*
|
|
855
|
+
* @category Cache Management
|
|
856
|
+
* @since 3.9.2
|
|
857
|
+
*
|
|
858
|
+
* @example Warm cache from custom pool data
|
|
859
|
+
* ```typescript
|
|
860
|
+
* sdk.warmCacheFromPoolData('anime', {
|
|
861
|
+
* vaultAddress: 'service|Token$Unit$ANIME$...',
|
|
862
|
+
* reverseBondingCurveMinFeeFactor: 0.0,
|
|
863
|
+
* reverseBondingCurveMaxFeeFactor: 0.5
|
|
864
|
+
* });
|
|
865
|
+
* ```
|
|
866
|
+
*
|
|
867
|
+
* @example Warm cache from fetchPools response
|
|
868
|
+
* ```typescript
|
|
869
|
+
* const pools = await sdk.fetchPools({ limit: 20 });
|
|
870
|
+
* pools.pools.forEach(pool => {
|
|
871
|
+
* sdk.warmCacheFromPoolData(pool.tokenName, {
|
|
872
|
+
* vaultAddress: pool.vaultAddress,
|
|
873
|
+
* reverseBondingCurveMinFeeFactor: parseFloat(pool.reverseBondingCurveMinFeePortion),
|
|
874
|
+
* reverseBondingCurveMaxFeeFactor: parseFloat(pool.reverseBondingCurveMaxFeePortion)
|
|
875
|
+
* });
|
|
876
|
+
* });
|
|
877
|
+
* ```
|
|
878
|
+
*/
|
|
879
|
+
warmCacheFromPoolData(tokenName: string, metadata: Partial<import('../services/TokenMetadataCache').TokenMetadata>): void;
|
|
880
|
+
/**
|
|
881
|
+
* Get cache statistics
|
|
882
|
+
*
|
|
883
|
+
* Returns statistics about the token metadata cache including size, memory usage,
|
|
884
|
+
* and age of entries. Useful for monitoring and debugging cache performance.
|
|
885
|
+
*
|
|
886
|
+
* ⚠️ **Performance**: O(n) - iterates over all cache entries. Do not call in hot paths.
|
|
887
|
+
*
|
|
888
|
+
* @returns Cache statistics
|
|
889
|
+
*
|
|
890
|
+
* @category Cache Management
|
|
891
|
+
* @since 3.9.2
|
|
892
|
+
*
|
|
893
|
+
* @example Monitor cache size
|
|
894
|
+
* ```typescript
|
|
895
|
+
* const stats = sdk.getCacheStats();
|
|
896
|
+
* console.log(`Cached ${stats.totalTokens} tokens (${stats.cacheSize} bytes)`);
|
|
897
|
+
* console.log(`Oldest entry: ${new Date(stats.oldestEntry).toISOString()}`);
|
|
898
|
+
* ```
|
|
899
|
+
*/
|
|
900
|
+
getCacheStats(): import('../services/TokenMetadataCache').CacheStats;
|
|
901
|
+
/**
|
|
902
|
+
* Clear cache (all tokens or specific token)
|
|
903
|
+
*
|
|
904
|
+
* Removes cached metadata from the cache. This is useful for testing,
|
|
905
|
+
* debugging, or forcing fresh data fetches.
|
|
906
|
+
*
|
|
907
|
+
* @param tokenName - Optional token name to clear (clears all if not provided)
|
|
908
|
+
*
|
|
909
|
+
* @category Cache Management
|
|
910
|
+
* @since 3.9.2
|
|
911
|
+
*
|
|
912
|
+
* @example Clear specific token
|
|
913
|
+
* ```typescript
|
|
914
|
+
* sdk.clearCache('anime'); // Clear only anime token
|
|
915
|
+
* ```
|
|
916
|
+
*
|
|
917
|
+
* @example Clear entire cache
|
|
918
|
+
* ```typescript
|
|
919
|
+
* sdk.clearCache(); // Clear all tokens
|
|
920
|
+
* ```
|
|
921
|
+
*/
|
|
922
|
+
clearCache(tokenName?: string): void;
|
|
815
923
|
}
|
|
816
924
|
//# sourceMappingURL=LaunchpadAPI.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LaunchpadAPI.d.ts","sourceRoot":"","sources":["../../src/api/LaunchpadAPI.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"LaunchpadAPI.d.ts","sourceRoot":"","sources":["../../src/api/LaunchpadAPI.ts"],"names":[],"mappings":"AAAA;;;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