@gala-chain/launchpad-sdk 4.0.4-beta.0 → 4.0.5

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.
Files changed (37) hide show
  1. package/EXAMPLES.md +96 -35
  2. package/README.md +2 -0
  3. package/dist/index.cjs.js +1 -1
  4. package/dist/index.esm.js +1 -1
  5. package/dist/index.js +1 -1
  6. package/dist/src/LaunchpadSDK.d.ts +750 -72
  7. package/dist/src/LaunchpadSDK.d.ts.map +1 -1
  8. package/dist/src/constants/version.generated.d.ts +1 -1
  9. package/dist/src/constants/version.generated.d.ts.map +1 -1
  10. package/dist/src/services/DexBackendClient.d.ts +139 -10
  11. package/dist/src/services/DexBackendClient.d.ts.map +1 -1
  12. package/dist/src/services/DexQuoteService.d.ts +181 -22
  13. package/dist/src/services/DexQuoteService.d.ts.map +1 -1
  14. package/dist/src/services/DexService.d.ts +274 -38
  15. package/dist/src/services/DexService.d.ts.map +1 -1
  16. package/dist/src/services/GSwapService.d.ts +555 -246
  17. package/dist/src/services/GSwapService.d.ts.map +1 -1
  18. package/dist/src/services/GalaChainGatewayClient.d.ts +139 -41
  19. package/dist/src/services/GalaChainGatewayClient.d.ts.map +1 -1
  20. package/dist/src/services/ImageService.d.ts +101 -12
  21. package/dist/src/services/ImageService.d.ts.map +1 -1
  22. package/dist/src/services/PoolCacheManager.d.ts +125 -31
  23. package/dist/src/services/PoolCacheManager.d.ts.map +1 -1
  24. package/dist/src/services/SignatureService.d.ts +35 -5
  25. package/dist/src/services/SignatureService.d.ts.map +1 -1
  26. package/dist/src/services/SwapEventQueue.d.ts +79 -10
  27. package/dist/src/services/SwapEventQueue.d.ts.map +1 -1
  28. package/dist/src/services/TokenClassKeyService.d.ts +56 -10
  29. package/dist/src/services/TokenClassKeyService.d.ts.map +1 -1
  30. package/dist/src/services/TokenMetadataService.d.ts +407 -31
  31. package/dist/src/services/TokenMetadataService.d.ts.map +1 -1
  32. package/dist/src/services/TradeService.d.ts +168 -6
  33. package/dist/src/services/TradeService.d.ts.map +1 -1
  34. package/dist/src/services/UserService.d.ts +117 -15
  35. package/dist/src/services/UserService.d.ts.map +1 -1
  36. package/package.json +12 -2
  37. package/API.md +0 -1475
package/EXAMPLES.md CHANGED
@@ -54,8 +54,13 @@ npm run demo:liquidity
54
54
 
55
55
  # DEX swap workflow
56
56
  npm run demo:dex
57
+
58
+ # Bonding curve trading orchestrator
59
+ npm run demo:bonding:orchestrator
57
60
  ```
58
61
 
62
+ **Demo Statistics**: 65 comprehensive demos organized into 8 categories covering all SDK features
63
+
59
64
  ---
60
65
 
61
66
  ## Recommended Learning Path
@@ -77,13 +82,28 @@ npm run demo:authenticated
77
82
 
78
83
  **Learn:** SDK initialization, configuration, read-only vs full-access modes
79
84
 
80
- ### 2. Explore Liquidity Management
85
+ ### 2. Understand Bonding Curve Trading
86
+
87
+ ```bash
88
+ # Run all bonding curve demos sequentially
89
+ npm run demo:bonding:orchestrator
90
+
91
+ # Basic buy/sell operations
92
+ npm run demo:trades
93
+
94
+ # Token graduation workflow
95
+ npm run demo:bonding:graduation
96
+ ```
97
+
98
+ **Learn:** Pre-graduation token trading, bonding curve mechanics, token launch lifecycle
99
+
100
+ ### 3. Explore Liquidity Management
81
101
 
82
102
  ```bash
83
103
  # Interactive CLI for liquidity positions
84
104
  npm run demo:liquidity
85
105
 
86
- # Run all 9 liquidity demos sequentially
106
+ # Run all 12 liquidity demos sequentially
87
107
  npm run demo:liquidity:all
88
108
 
89
109
  # Detailed position lifecycle
@@ -92,7 +112,7 @@ npm run demo:liquidity:detailed
92
112
 
93
113
  **Learn:** Add liquidity, collect fees, remove positions, APR calculations
94
114
 
95
- ### 3. Master DEX Trading
115
+ ### 4. Master DEX Trading
96
116
 
97
117
  ```bash
98
118
  # DEX swap workflow (quote → execute → confirm)
@@ -107,7 +127,7 @@ npm run demo:dex:quotes
107
127
 
108
128
  **Learn:** Token swaps, quote generation, slippage protection, pool discovery
109
129
 
110
- ### 4. Understand Fee Management
130
+ ### 5. Understand Fee Management
111
131
 
112
132
  ```bash
113
133
  # Basic fee generation and collection
@@ -122,7 +142,7 @@ npm run demo:fees:test
122
142
 
123
143
  **Learn:** LP fee generation, collection strategies, multi-wallet workflows
124
144
 
125
- ### 5. Try Real-Time Features
145
+ ### 6. Try Real-Time Features
126
146
 
127
147
  ```bash
128
148
  # Watch for new DEX pool creation
@@ -134,7 +154,7 @@ npm run demo:watch:tokens
134
154
 
135
155
  **Learn:** WebSocket event monitoring, pool/token discovery
136
156
 
137
- ### 6. Explore Advanced Topics
157
+ ### 7. Explore Advanced Topics
138
158
 
139
159
  ```bash
140
160
  # Metadata cache performance
@@ -315,9 +335,9 @@ console.log(`Position closed!`);
315
335
  console.log(`Withdrawn: ${result.amount0Withdrawn} GALA + ${result.amount1Withdrawn} GUSDC`);
316
336
  ```
317
337
 
318
- **Liquidity Demos (9 total):**
338
+ **Liquidity Demos (12 total):**
319
339
  - `npm run demo:liquidity` - Interactive CLI
320
- - `npm run demo:liquidity:all` - Run all 9 demos (orchestrator)
340
+ - `npm run demo:liquidity:all` - Run all 12 demos (orchestrator)
321
341
  - `npm run demo:liquidity:detailed` - Complete lifecycle
322
342
  - `npm run demo:liquidity:ticks` - Advanced tick positions
323
343
  - `npm run demo:liquidity:portfolio` - Multi-position management
@@ -325,6 +345,9 @@ console.log(`Withdrawn: ${result.amount0Withdrawn} GALA + ${result.amount1Withdr
325
345
  - `npm run demo:liquidity:errors` - Error handling
326
346
  - `npm run demo:liquidity:fetch-all` - Pagination example
327
347
  - `npm run demo:liquidity:positions-with-prices` - Price enrichment
348
+ - `npm run demo:liquidity:removal` - Position removal workflow
349
+ - `npm run demo:liquidity:fee-collection` - Fee collection strategies
350
+ - `npm run demo:liquidity:price-range` - Price range optimization
328
351
 
329
352
  **Orchestrator Usage:**
330
353
 
@@ -403,19 +426,28 @@ const result = await sdk.sell({
403
426
  console.log(`✓ Sale completed: ${result.transactionId}`);
404
427
  ```
405
428
 
406
- **Bonding Curve Demos:**
429
+ **Bonding Curve Demos (8 total):**
430
+ - `npm run demo:bonding:orchestrator` - Run all 8 bonding curve demos (orchestrator)
407
431
  - `npm run demo:trades` - Basic buy/sell operations
432
+ - `npm run demo:bonding:graduation` - Token graduation workflow and simulation
433
+ - `npm run demo:bonding:pool-discovery` - Pool filtering and discovery
434
+ - `npm run demo:bonding:price-impact` - Price impact analysis and calculations
435
+ - `npm run demo:bonding:token-launch` - Token launch lifecycle demonstration
436
+ - `npm run demo:bonding:volume-trading` - High-volume trading simulation
437
+ - `npm run demo:bonding:pool-analysis` - Deep pool analytics and metrics
438
+
439
+ **Orchestrator Usage:**
440
+
441
+ ```bash
442
+ # Run all bonding curve demos
443
+ npm run demo:bonding:orchestrator
444
+
445
+ # Skip specific demos
446
+ npm run demo:bonding:orchestrator -- --skip=graduation,volume-trading
408
447
 
409
- **Coming Soon (Bonding Curve Orchestrator):**
410
- 8 additional bonding curve demos planned:
411
- - Pool discovery and filtering
412
- - Price calculation methods
413
- - Graduation simulation
414
- - Multi-token analysis
415
- - Fee structure exploration
416
- - Slippage testing scenarios
417
- - Liquidity depth analysis
418
- - Graduation timing optimization
448
+ # Run only specific demos
449
+ npm run demo:bonding:orchestrator -- --only=pool-discovery,price-impact
450
+ ```
419
451
 
420
452
  ---
421
453
 
@@ -492,13 +524,15 @@ pools.pools.forEach(pool => {
492
524
  });
493
525
  ```
494
526
 
495
- **DEX Demos (6 total):**
527
+ **DEX Demos (8 total):**
496
528
  - `npm run demo:dex` - Swap workflow (quote → execute → confirm)
497
529
  - `npm run demo:dex:pools` - Pool discovery and metrics
498
530
  - `npm run demo:dex:pricing` - Pool pricing and TVL analysis
499
531
  - `npm run demo:dex:quotes` - Quote comparison
500
532
  - `npm run demo:dex:roundtrip` - Complete liquidity workflow
501
533
  - `npm run demo:roundtrip:swap` - Buy → Sell → Verify
534
+ - `npm run demo:dex:leaderboard` - Seasonal leaderboard queries and XP rankings
535
+ - `npm run demo:dex:volume-summary` - Platform volume metrics and trend analysis
502
536
 
503
537
  **Symmetry Note:** Both `bonding-curve/` and `dex/` categories have pool discovery demos for consistent learning patterns.
504
538
 
@@ -828,11 +862,26 @@ console.timeEnd('Batch Calculations');
828
862
  **Utility Demos (5 total):**
829
863
  - `npm run demo:cache` - Metadata cache warming and performance
830
864
  - `npm run demo:token-supply` - Token supply metrics from GalaChain
865
+ - `npm run demo:utilities:balances` - Multi-token balance queries
866
+ - `npm run demo:utilities:balance` - Single token balance check
867
+ - `npm run demo:utilities:price-history` - Historical price data (Node.js only)
868
+
869
+ **Key Features:**
870
+
871
+ **Multi-Token Balances** (`demo:utilities:balances`):
872
+ - Check balances for multiple tokens in a single wallet
873
+ - Useful for portfolio overview and batch queries
874
+ - Example: Query all token holdings at once
831
875
 
832
- **Additional (not exposed as npm scripts):**
833
- - `tsx examples/utilities/balances.ts` - Multi-token balance queries
834
- - `tsx examples/utilities/balance.ts` - Single token balance check
835
- - `tsx examples/utilities/price-history.ts` - Historical price data (Node.js only)
876
+ **Single Token Balance** (`demo:utilities:balance`):
877
+ - Check balance for a specific token
878
+ - Fast, focused balance query
879
+ - Example: Verify GALA balance before trade
880
+
881
+ **Price History** (`demo:utilities:price-history`):
882
+ - Fetch historical price data for technical analysis
883
+ - Node.js only (requires file system access)
884
+ - Example: Download price data for charting and trend analysis
836
885
 
837
886
  ---
838
887
 
@@ -908,16 +957,28 @@ See the `examples/` directory for complete working demos organized by category:
908
957
 
909
958
  ```
910
959
  examples/
911
- ├── core/ # 4 demos - SDK fundamentals
912
- ├── liquidity/ # 9 demos - LP position management
913
- ├── bonding-curve/ # 1 demo + 8 planned - Pre-graduation trading
914
- ├── dex/ # 6 demos - DEX trading
915
- ├── fees/ # 5 demos - Fee workflows
916
- ├── monitoring/ # 2 demos - Real-time events
917
- ├── utilities/ # 5 demos - Helper operations
918
- └── debug/ # 3 tools - Development utilities
919
- ```
920
-
921
- **Total:** 36 demos covering all major SDK features
960
+ ├── core/ # 5 demos - SDK fundamentals
961
+ ├── bonding-curve/ # 8 demos - Pre-graduation trading
962
+ ├── liquidity/ # 12 demos - LP position management
963
+ ├── dex/ # 8 demos - DEX trading & leaderboard
964
+ ├── fees/ # 5 demos - Fee workflows
965
+ ├── monitoring/ # 11 demos - Real-time events
966
+ ├── swap-monitoring/ # 4 demos - DEX swap watchers
967
+ ├── utilities/ # 5 demos - Helper operations
968
+ └── debug/ # 5 tools - Development utilities (not in npm scripts)
969
+ ```
970
+
971
+ **Total:** 65 demos covering all major SDK features
972
+
973
+ **Category Breakdown:**
974
+ - **Core Operations**: 5 demos covering SDK setup, configuration, and multi-wallet testing
975
+ - **Bonding Curve Trading**: 8 demos for pre-graduation token trading (orchestrator + 7 specialized)
976
+ - **Liquidity Management**: 12 demos for LP positions (orchestrator + 11 specialized)
977
+ - **DEX Trading**: 8 demos for swaps, pools, leaderboard, and volume analytics
978
+ - **Fee Management**: 5 demos for fee generation and collection workflows
979
+ - **Real-Time Monitoring**: 11 demos for pool/token creation watchers
980
+ - **Swap Monitoring**: 4 demos for DEX swap event tracking
981
+ - **Utilities**: 5 demos for balances, cache, supply, and price history
982
+ - **Debug Tools**: 5 development utilities (not exposed as npm scripts)
922
983
 
923
984
  For migration from old demo structure, see [docs/DEMO_MIGRATION_GUIDE.md](./docs/DEMO_MIGRATION_GUIDE.md).
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Gala Launchpad SDK
2
2
 
3
+ **Version: 4.0.4-beta.0 (Beta)**
4
+
3
5
  A comprehensive TypeScript SDK for the Gala Launchpad Backend API, providing type-safe authentication, trading, and real-time features for DeFi applications.
4
6
 
5
7
  > **⚠️ BREAKING CHANGE (v3.33.0+)**: Token format parsing now **ONLY accepts delimited formats** (`GALA|Unit|none|none` or `GALA$Unit$none$none`). Plain token strings (`'GALA'`, `'GUSDC'`) are **permanently rejected** for security. See [Migration Guide](#token-format-migration-v330) below.