@gala-chain/launchpad-sdk 3.18.0 → 3.19.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/CHANGELOG.md +28 -0
- package/README.md +3 -198
- package/dist/LaunchpadSDK.d.ts +9 -68
- package/dist/LaunchpadSDK.d.ts.map +1 -1
- package/dist/constants/version.generated.d.ts +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/PriceHistoryService.d.ts +8 -110
- package/dist/services/PriceHistoryService.d.ts.map +1 -1
- package/dist/types/common.d.ts +0 -2
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/priceHistory.dto.d.ts +2 -53
- package/dist/types/priceHistory.dto.d.ts.map +1 -1
- package/dist/utils/agent-config.d.ts +1 -1
- package/dist/utils/agent-config.d.ts.map +1 -1
- package/package.json +1 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.19.0
|
|
4
|
+
|
|
5
|
+
### Breaking Changes
|
|
6
|
+
|
|
7
|
+
- **Remove MySQL support from price history services**
|
|
8
|
+
|
|
9
|
+
**BREAKING:** Removed fetchPrices() and fetchAllPrices() methods that relied on MySQL database.
|
|
10
|
+
These methods are deprecated in favor of the DEX Backend API-based price history methods.
|
|
11
|
+
|
|
12
|
+
**Removed:**
|
|
13
|
+
- `sdk.fetchPrices()` - Use DEX Backend API methods instead
|
|
14
|
+
- `sdk.fetchAllPrices()` - Use DEX Backend API methods instead
|
|
15
|
+
- MySQL connection string configuration parameter from SDK config
|
|
16
|
+
- `mysql2` peer dependency (no longer required)
|
|
17
|
+
- PriceHistoryService MySQL methods and connection pooling
|
|
18
|
+
- Type definitions: `FetchPricesOptions`, `PricesResult`
|
|
19
|
+
|
|
20
|
+
**Migration Path:**
|
|
21
|
+
- For historical price data: Use `fetchPriceHistory()` or `fetchAllPriceHistory()` (DEX Backend API)
|
|
22
|
+
- Latest prices feature: Coming soon to DEX Backend API in future releases
|
|
23
|
+
- No environment variables needed: DEX Backend is automatically configured
|
|
24
|
+
|
|
25
|
+
**Details:**
|
|
26
|
+
- PriceHistoryService now uses DEX Backend API exclusively
|
|
27
|
+
- All price history methods consolidated to API-based implementation
|
|
28
|
+
- Simplified SDK initialization without MySQL requirements
|
|
29
|
+
- Zero configuration needed for price history features
|
|
30
|
+
|
|
3
31
|
## 3.18.0
|
|
4
32
|
|
|
5
33
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -64,7 +64,7 @@ console.log(pools.hasNext); // Computed convenience properties
|
|
|
64
64
|
- **Token Transfers**: Transfer GALA and launchpad tokens between wallets with EIP-712 signatures
|
|
65
65
|
- **User Operations**: Portfolio management, token balances, and account management
|
|
66
66
|
- **Comment System**: Post and retrieve comments on token pools
|
|
67
|
-
- **Price History**: Fetch historical price data for DEX tokens with pagination (Node.js only
|
|
67
|
+
- **Price History**: Fetch historical price data for DEX tokens with pagination (Node.js only)
|
|
68
68
|
- **Comprehensive Validation**: Input validation and error handling for all operations
|
|
69
69
|
- **Multi-Environment Support**: Production, staging, and custom backend URLs
|
|
70
70
|
|
|
@@ -798,29 +798,16 @@ calculateSellAmountExternal(options): Promise<AmountCalculationResult>
|
|
|
798
798
|
|
|
799
799
|
// Note: Pass `calculateAmountMode: 'local' | 'external'` to override SDK default mode
|
|
800
800
|
|
|
801
|
-
// Price History Operations (
|
|
801
|
+
// Price History Operations (DEX Backend API, Node.js only)
|
|
802
802
|
fetchPriceHistory(options): Promise<PriceHistoryResult>
|
|
803
803
|
// Options: { tokenId, from?, to?, sortOrder?, page?, limit? }
|
|
804
804
|
// Returns: { snapshots, page, limit, total, totalPages, hasNext, hasPrevious }
|
|
805
|
-
// Fetches paginated historical price snapshots from
|
|
805
|
+
// Fetches paginated historical price snapshots from DEX Backend API
|
|
806
806
|
|
|
807
807
|
fetchAllPriceHistory(options): Promise<PriceHistoryResult>
|
|
808
808
|
// Options: { tokenId, from?, to?, sortOrder? } (no pagination params)
|
|
809
809
|
// Returns: All matching snapshots with total count
|
|
810
810
|
// Convenience method with automatic pagination (returns ALL snapshots)
|
|
811
|
-
|
|
812
|
-
fetchPrices(options?): Promise<PricesResult>
|
|
813
|
-
// Options: { page?, limit?, sortByType? }
|
|
814
|
-
// Returns: { snapshots, page, limit, total, totalPages, hasNext, hasPrevious }
|
|
815
|
-
// Fetches latest price for each unique token (paginated)
|
|
816
|
-
|
|
817
|
-
fetchAllPrices(): Promise<PricesResult>
|
|
818
|
-
// No parameters
|
|
819
|
-
// Returns: All latest prices combined in single result
|
|
820
|
-
// Convenience method with automatic pagination (returns ALL latest prices)
|
|
821
|
-
|
|
822
|
-
// Note: Price history methods require MySQL connection string in SDK config
|
|
823
|
-
// See MySQL Configuration section below for setup details
|
|
824
811
|
```
|
|
825
812
|
|
|
826
813
|
## Performance Optimization
|
|
@@ -1374,190 +1361,9 @@ interface LaunchpadSDKConfig {
|
|
|
1374
1361
|
debug?: boolean; // Enable debug logging
|
|
1375
1362
|
maxRetries?: number; // Retry attempts (default: 3)
|
|
1376
1363
|
retryDelay?: number; // Retry delay (default: 1000ms)
|
|
1377
|
-
mysqlConnectionString?: string; // MySQL connection string for price history (Node.js only)
|
|
1378
|
-
// Format: mysql://user:password@host:port/database
|
|
1379
|
-
}
|
|
1380
|
-
```
|
|
1381
|
-
|
|
1382
|
-
### MySQL Configuration (Price History)
|
|
1383
|
-
|
|
1384
|
-
To use the price history methods, you need to configure a MySQL connection string:
|
|
1385
|
-
|
|
1386
|
-
```typescript
|
|
1387
|
-
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
1388
|
-
|
|
1389
|
-
const sdk = createLaunchpadSDK({
|
|
1390
|
-
wallet: 'your-private-key',
|
|
1391
|
-
config: {
|
|
1392
|
-
baseUrl: 'https://lpad-backend-dev1.defi.gala.com',
|
|
1393
|
-
mysqlConnectionString: 'mysql://user:password@localhost:3306/galachain'
|
|
1394
|
-
}
|
|
1395
|
-
});
|
|
1396
|
-
|
|
1397
|
-
// 1. Fetch historical price snapshots (paginated)
|
|
1398
|
-
const priceHistory = await sdk.fetchPriceHistory({
|
|
1399
|
-
tokenId: 'Token|Unit|GUSDC|eth:9401b171307bE656f00F9e18DF756643FD3a91dE', // String format
|
|
1400
|
-
from: new Date('2024-01-01'),
|
|
1401
|
-
to: new Date('2024-01-31'),
|
|
1402
|
-
sortOrder: 'DESC',
|
|
1403
|
-
page: 1,
|
|
1404
|
-
limit: 20
|
|
1405
|
-
});
|
|
1406
|
-
|
|
1407
|
-
console.log(`Found ${priceHistory.snapshots.length} snapshots`);
|
|
1408
|
-
console.log(`Total: ${priceHistory.total}, Page ${priceHistory.page} of ${priceHistory.totalPages}`);
|
|
1409
|
-
|
|
1410
|
-
// 2. Fetch ALL historical price snapshots (auto-paginated)
|
|
1411
|
-
const allHistory = await sdk.fetchAllPriceHistory({
|
|
1412
|
-
tokenId: { // Object format also supported
|
|
1413
|
-
collection: 'Token',
|
|
1414
|
-
category: 'Unit',
|
|
1415
|
-
type: 'GUSDC',
|
|
1416
|
-
additionalKey: 'eth:9401b171307bE656f00F9e18DF756643FD3a91dE'
|
|
1417
|
-
},
|
|
1418
|
-
from: new Date('2024-01-01'),
|
|
1419
|
-
to: new Date('2024-01-31')
|
|
1420
|
-
});
|
|
1421
|
-
|
|
1422
|
-
console.log(`Total snapshots: ${allHistory.total}`);
|
|
1423
|
-
|
|
1424
|
-
// 3. Fetch latest prices for all tokens (paginated)
|
|
1425
|
-
const latestPrices = await sdk.fetchPrices({
|
|
1426
|
-
page: 1,
|
|
1427
|
-
limit: 20,
|
|
1428
|
-
sortByType: 'ASC' // Optional: sort alphabetically by token type
|
|
1429
|
-
});
|
|
1430
|
-
|
|
1431
|
-
console.log(`Found ${latestPrices.snapshots.length} tokens with prices`);
|
|
1432
|
-
|
|
1433
|
-
// 4. Fetch all latest prices (auto-paginated)
|
|
1434
|
-
const allLatestPrices = await sdk.fetchAllPrices();
|
|
1435
|
-
|
|
1436
|
-
console.log(`Total tokens with prices: ${allLatestPrices.total}`);
|
|
1437
|
-
```
|
|
1438
|
-
|
|
1439
|
-
**Token Identification Formats:**
|
|
1440
|
-
```typescript
|
|
1441
|
-
// String format (pipe-delimited) - simpler
|
|
1442
|
-
tokenId: 'Token|Unit|GUSDC|eth:9401b171307bE656f00F9e18DF756643FD3a91dE'
|
|
1443
|
-
|
|
1444
|
-
// Object format (explicit) - for clarity
|
|
1445
|
-
tokenId: {
|
|
1446
|
-
collection: 'Token',
|
|
1447
|
-
category: 'Unit',
|
|
1448
|
-
type: 'GUSDC',
|
|
1449
|
-
additionalKey: 'eth:9401b171307bE656f00F9e18DF756643FD3a91dE'
|
|
1450
1364
|
}
|
|
1451
1365
|
```
|
|
1452
1366
|
|
|
1453
|
-
**Environment Configuration:**
|
|
1454
|
-
```bash
|
|
1455
|
-
# Set in .env or pass to SDK config
|
|
1456
|
-
PRICE_SERVICE_MYSQL_CONNECTION_STRING=mysql://user:password@localhost:3306/galachain
|
|
1457
|
-
```
|
|
1458
|
-
|
|
1459
|
-
**Requirements:**
|
|
1460
|
-
- Node.js environment (browser not supported)
|
|
1461
|
-
- MySQL server with `price_snapshots` table
|
|
1462
|
-
- Connection pooling is automatic (default 5 concurrent connections)
|
|
1463
|
-
|
|
1464
|
-
### Security Considerations
|
|
1465
|
-
|
|
1466
|
-
⚠️ **Credential Management:**
|
|
1467
|
-
- Store MySQL connection strings in environment variables, NOT in code
|
|
1468
|
-
- Use restrictive file permissions on `.env` files (recommended: `0600`)
|
|
1469
|
-
- Never log or expose connection strings in debug output
|
|
1470
|
-
- For production, consider using credential providers (AWS Secrets Manager, Azure Key Vault, etc.)
|
|
1471
|
-
|
|
1472
|
-
⚠️ **Input Validation:**
|
|
1473
|
-
- TokenClassKey fields are validated with a whitelist pattern to prevent SQL injection
|
|
1474
|
-
- Only alphanumeric characters plus dots (.), colons (:), hyphens (-), and underscores (_) are allowed
|
|
1475
|
-
- Fields are limited to 255 characters maximum
|
|
1476
|
-
|
|
1477
|
-
⚠️ **Database Security:**
|
|
1478
|
-
- Ensure MySQL is behind a firewall and not exposed to the internet
|
|
1479
|
-
- Use strong passwords and rotate them regularly
|
|
1480
|
-
- Consider using SSL/TLS for MySQL connections in production
|
|
1481
|
-
- Create a dedicated database user with **read-only permissions** (SELECT only)
|
|
1482
|
-
- **Built-in Read-Only Protection**: This service enforces read-only mode at the MySQL session level, preventing any accidental or malicious write attempts. Even if the database user somehow gains write permissions, the session-level `read_only` flag blocks all modifications.
|
|
1483
|
-
|
|
1484
|
-
⚠️ **Column Type Requirements:**
|
|
1485
|
-
- Price column MUST be of type `DECIMAL(65,30)` or similar high-precision type
|
|
1486
|
-
- Using `FLOAT` or other lossy types will cause precision loss with BigNumber operations
|
|
1487
|
-
- Verify your database schema matches the required types
|
|
1488
|
-
|
|
1489
|
-
### Required Database Schema
|
|
1490
|
-
|
|
1491
|
-
The `price_snapshots` table must exist with the following schema:
|
|
1492
|
-
|
|
1493
|
-
```sql
|
|
1494
|
-
CREATE TABLE `price_snapshots` (
|
|
1495
|
-
`id` BIGINT AUTO_INCREMENT PRIMARY KEY,
|
|
1496
|
-
`collection` VARCHAR(255) NOT NULL,
|
|
1497
|
-
`category` VARCHAR(255) NOT NULL,
|
|
1498
|
-
`type` VARCHAR(255) NOT NULL,
|
|
1499
|
-
`additional_key` VARCHAR(255) NOT NULL,
|
|
1500
|
-
`price` DECIMAL(65, 30) NOT NULL,
|
|
1501
|
-
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
1502
|
-
|
|
1503
|
-
-- Indexes for optimal query performance
|
|
1504
|
-
INDEX `idx_token_lookup` (`collection`, `category`, `type`, `additional_key`),
|
|
1505
|
-
INDEX `idx_created_at` (`created_at`),
|
|
1506
|
-
INDEX `idx_token_date` (`collection`, `category`, `type`, `additional_key`, `created_at`)
|
|
1507
|
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
1508
|
-
```
|
|
1509
|
-
|
|
1510
|
-
**Schema Explanation:**
|
|
1511
|
-
|
|
1512
|
-
- **`id`**: Auto-incrementing primary key for unique row identification
|
|
1513
|
-
- **`collection`**: Token collection identifier (e.g., "Token")
|
|
1514
|
-
- **`category`**: Token category identifier (e.g., "Unit")
|
|
1515
|
-
- **`type`**: Token type identifier (e.g., "GUSDC")
|
|
1516
|
-
- **`additional_key`**: Additional token key for disambiguation (e.g., "eth:0x1234...")
|
|
1517
|
-
- **`price`**: Token price as high-precision DECIMAL
|
|
1518
|
-
- **CRITICAL**: Use `DECIMAL(65, 30)` for BigNumber compatibility
|
|
1519
|
-
- This provides 35 integer digits and 30 decimal places
|
|
1520
|
-
- Sufficient for token prices ranging from satoshis to billions
|
|
1521
|
-
- ⚠️ **DO NOT USE**: FLOAT, DOUBLE, or REAL (precision loss)
|
|
1522
|
-
- **`created_at`**: Timestamp of price snapshot (defaults to insertion time)
|
|
1523
|
-
|
|
1524
|
-
**Indexes:**
|
|
1525
|
-
|
|
1526
|
-
- **`idx_token_lookup`**: Composite index on token identifier fields for efficient filtering
|
|
1527
|
-
- **`idx_created_at`**: Single index on creation timestamp for date range queries
|
|
1528
|
-
- **`idx_token_date`**: Composite index combining token fields and date for complex queries (recommended for high-volume databases)
|
|
1529
|
-
|
|
1530
|
-
**Performance Tuning:**
|
|
1531
|
-
|
|
1532
|
-
For high-volume price history databases (>10M snapshots):
|
|
1533
|
-
|
|
1534
|
-
```sql
|
|
1535
|
-
-- Add partitioning by month
|
|
1536
|
-
ALTER TABLE `price_snapshots`
|
|
1537
|
-
PARTITION BY RANGE (MONTH(created_at)) (
|
|
1538
|
-
PARTITION p202401 VALUES LESS THAN (202402),
|
|
1539
|
-
PARTITION p202402 VALUES LESS THAN (202403),
|
|
1540
|
-
-- ... more partitions
|
|
1541
|
-
PARTITION p_future VALUES LESS THAN MAXVALUE
|
|
1542
|
-
);
|
|
1543
|
-
|
|
1544
|
-
-- Consider archival strategy for old data
|
|
1545
|
-
-- Archive snapshots older than 12 months to separate table
|
|
1546
|
-
-- to maintain optimal query performance
|
|
1547
|
-
```
|
|
1548
|
-
|
|
1549
|
-
**Validation Checklist:**
|
|
1550
|
-
|
|
1551
|
-
Before using `fetchPriceHistory()`:
|
|
1552
|
-
|
|
1553
|
-
- [ ] `price_snapshots` table exists in your MySQL database
|
|
1554
|
-
- [ ] All columns match the schema above exactly
|
|
1555
|
-
- [ ] `price` column is `DECIMAL(65, 30)` (NOT FLOAT)
|
|
1556
|
-
- [ ] Indexes are created for query performance
|
|
1557
|
-
- [ ] Database user has SELECT permissions on the table
|
|
1558
|
-
- [ ] MySQL connection string is correct
|
|
1559
|
-
- [ ] Test the connection: `SELECT COUNT(*) FROM price_snapshots LIMIT 1`
|
|
1560
|
-
|
|
1561
1367
|
## Helper Functions
|
|
1562
1368
|
|
|
1563
1369
|
### **Wallet Creation**
|
|
@@ -1612,7 +1418,6 @@ npm run lint
|
|
|
1612
1418
|
- [SDK Method Reference](./SDK-METHOD-GRAPH.md) - Complete flat API reference
|
|
1613
1419
|
- [Clean Result Types Migration Guide](./docs/CLEAN_RESULT_TYPES_MIGRATION.md) - Migration guide for clean result types
|
|
1614
1420
|
- [Service Architecture Migration Guide](./docs/SERVICE_ARCHITECTURE_MIGRATION.md) - Guide for v3.1.0 service-based architecture
|
|
1615
|
-
- [Price History Schema](./docs/PRICE_HISTORY_SCHEMA.sql) - Required MySQL schema for price history functionality
|
|
1616
1421
|
- [API Documentation](../../API.md) - Detailed API documentation
|
|
1617
1422
|
- [Examples](./examples/) - Code examples and demos
|
|
1618
1423
|
|
package/dist/LaunchpadSDK.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { TokenLaunchResult, TradeResult } from './types/result.types';
|
|
|
8
8
|
import { WebSocketError, WebSocketTimeoutError, TransactionFailedError } from './utils/websocket-errors';
|
|
9
9
|
export { WebSocketError, WebSocketTimeoutError, TransactionFailedError, };
|
|
10
10
|
import { FetchCommentsOptions, PostCommentOptions, FetchVolumeDataOptions, FetchTradesOptions, CalculateBuyAmountOptions, CalculateSellAmountOptions, CalculateBuyAmountLocalOptions, CalculateSellAmountLocalOptions, BuyTokenOptions, SellTokenOptions, UploadImageByTokenNameOptions, FetchTokensHeldOptions, FetchTokensCreatedOptions, GraduateTokenOptions, FetchLaunchpadTokenSpotPriceOptions, CalculateBuyAmountForGraduationOptions } from './types/options.dto';
|
|
11
|
-
import { FetchPriceHistoryOptions, PriceHistoryResult
|
|
11
|
+
import { FetchPriceHistoryOptions, PriceHistoryResult } from './types/priceHistory.dto';
|
|
12
12
|
/**
|
|
13
13
|
* Configuration for initializing the Launchpad SDK
|
|
14
14
|
*
|
|
@@ -152,7 +152,7 @@ export declare class LaunchpadSDK {
|
|
|
152
152
|
private readonly dexService;
|
|
153
153
|
private readonly bundleService;
|
|
154
154
|
private readonly websocketService;
|
|
155
|
-
private readonly priceHistoryService
|
|
155
|
+
private readonly priceHistoryService;
|
|
156
156
|
private readonly launchpadAPI;
|
|
157
157
|
constructor(config: LaunchpadSDKConfig);
|
|
158
158
|
/**
|
|
@@ -1229,16 +1229,16 @@ export declare class LaunchpadSDK {
|
|
|
1229
1229
|
*/
|
|
1230
1230
|
fetchTokensCreated(options?: FetchTokensCreatedOptions): Promise<import("./types/user.dto").UserTokenListResult>;
|
|
1231
1231
|
/**
|
|
1232
|
-
* Fetch historical price data for DEX tokens
|
|
1232
|
+
* Fetch historical price data for DEX tokens via DEX Backend API
|
|
1233
1233
|
*
|
|
1234
1234
|
* Retrieves paginated historical price snapshots for a token with optional
|
|
1235
|
-
* date range filtering. This method is Node.js-only and
|
|
1236
|
-
*
|
|
1235
|
+
* date range filtering. This method is Node.js-only and queries the DEX
|
|
1236
|
+
* Backend API for price history data.
|
|
1237
1237
|
*
|
|
1238
1238
|
* @param options Price history fetch options including token key, dates, and pagination
|
|
1239
1239
|
* @returns Promise<PriceHistoryResult> Price snapshots with pagination metadata
|
|
1240
|
-
* @throws ConfigurationError if
|
|
1241
|
-
* @throws NetworkError if
|
|
1240
|
+
* @throws ConfigurationError if dexBackendBaseUrl not configured
|
|
1241
|
+
* @throws NetworkError if API request fails
|
|
1242
1242
|
* @throws ValidationError if parameters are invalid
|
|
1243
1243
|
*
|
|
1244
1244
|
* @category Price History
|
|
@@ -1272,14 +1272,12 @@ export declare class LaunchpadSDK {
|
|
|
1272
1272
|
* snapshots across all pages and returning them in a single result. This method internally
|
|
1273
1273
|
* loops through pages using the maximum page size (100 items) for efficiency.
|
|
1274
1274
|
*
|
|
1275
|
-
*
|
|
1276
|
-
* Only available for DEX tokens with price snapshot data.
|
|
1275
|
+
* Only available for DEX tokens with price snapshot data on the DEX Backend API.
|
|
1277
1276
|
*
|
|
1278
1277
|
* @param options Fetch options (page/limit params are handled automatically)
|
|
1279
1278
|
* @returns Promise<PriceHistoryResult> containing all price snapshots in combined result
|
|
1280
1279
|
*
|
|
1281
|
-
* @throws
|
|
1282
|
-
* @throws NetworkError if database query fails
|
|
1280
|
+
* @throws NetworkError if API query fails
|
|
1283
1281
|
* @throws ValidationError if parameters are invalid
|
|
1284
1282
|
*
|
|
1285
1283
|
* @category Price History
|
|
@@ -1304,63 +1302,6 @@ export declare class LaunchpadSDK {
|
|
|
1304
1302
|
* ```
|
|
1305
1303
|
*/
|
|
1306
1304
|
fetchAllPriceHistory(options: Omit<FetchPriceHistoryOptions, 'page' | 'limit'>): Promise<PriceHistoryResult>;
|
|
1307
|
-
/**
|
|
1308
|
-
* Fetch latest prices for all tokens (paginated)
|
|
1309
|
-
*
|
|
1310
|
-
* Returns the most recent price snapshot for each unique token in the database.
|
|
1311
|
-
* Useful for market overviews, dashboards, and bulk price comparisons.
|
|
1312
|
-
*
|
|
1313
|
-
* Requires Node.js environment with MySQL connection string configured.
|
|
1314
|
-
*
|
|
1315
|
-
* @param options Optional pagination and sorting parameters
|
|
1316
|
-
* @returns Promise<PricesResult> Latest prices with pagination metadata
|
|
1317
|
-
*
|
|
1318
|
-
* @throws ConfigurationError if MySQL connection string is not configured
|
|
1319
|
-
* @throws NetworkError if database query fails
|
|
1320
|
-
* @throws ValidationError if parameters are invalid
|
|
1321
|
-
*
|
|
1322
|
-
* @category Price History
|
|
1323
|
-
* @since 3.15.0
|
|
1324
|
-
*
|
|
1325
|
-
* @example
|
|
1326
|
-
* ```typescript
|
|
1327
|
-
* // Fetch first page of latest prices
|
|
1328
|
-
* const prices = await sdk.fetchPrices({ page: 1, limit: 20 });
|
|
1329
|
-
*
|
|
1330
|
-
* console.log(`Found ${prices.snapshots.length} tokens`);
|
|
1331
|
-
* console.log(`Total: ${prices.total}, Page ${prices.page} of ${prices.totalPages}`);
|
|
1332
|
-
* prices.snapshots.forEach(snap => {
|
|
1333
|
-
* console.log(`${snap.type}: $${snap.price} at ${snap.timestamp}`);
|
|
1334
|
-
* });
|
|
1335
|
-
* ```
|
|
1336
|
-
*/
|
|
1337
|
-
fetchPrices(options?: FetchPricesOptions): Promise<PricesResult>;
|
|
1338
|
-
/**
|
|
1339
|
-
* Fetch all latest prices for all tokens (automatic pagination)
|
|
1340
|
-
*
|
|
1341
|
-
* Convenience method that automatically handles pagination by fetching all
|
|
1342
|
-
* latest prices across all pages and returning them in a single result.
|
|
1343
|
-
*
|
|
1344
|
-
* Requires Node.js environment with MySQL connection string configured.
|
|
1345
|
-
*
|
|
1346
|
-
* @returns Promise<PricesResult> All latest prices combined in single result
|
|
1347
|
-
*
|
|
1348
|
-
* @throws ConfigurationError if MySQL connection string is not configured
|
|
1349
|
-
* @throws NetworkError if database query fails
|
|
1350
|
-
*
|
|
1351
|
-
* @category Price History
|
|
1352
|
-
* @since 3.15.0
|
|
1353
|
-
*
|
|
1354
|
-
* @example
|
|
1355
|
-
* ```typescript
|
|
1356
|
-
* // Fetch all latest prices (automatic pagination)
|
|
1357
|
-
* const allPrices = await sdk.fetchAllPrices();
|
|
1358
|
-
*
|
|
1359
|
-
* console.log(`Total tokens: ${allPrices.total}`);
|
|
1360
|
-
* console.log(`Found ${allPrices.snapshots.length} prices`);
|
|
1361
|
-
* ```
|
|
1362
|
-
*/
|
|
1363
|
-
fetchAllPrices(): Promise<PricesResult>;
|
|
1364
1305
|
/**
|
|
1365
1306
|
* Transfer GALA tokens between wallets
|
|
1366
1307
|
*
|
|
@@ -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,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAalF,OAAO,EAAwB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACtH,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,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAkBlC,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,sBAAsB,GACvB,CAAC;AACF,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,yBAAyB,EACzB,0BAA0B,EAC1B,8BAA8B,EAC9B,+BAA+B,EAC/B,eAAe,EACf,gBAAgB,EAChB,6BAA6B,EAC7B,sBAAsB,EACtB,yBAAyB,EACzB,oBAAoB,EACpB,mCAAmC,EACnC,sCAAsC,EACvC,MAAM,qBAAqB,C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