@gala-chain/launchpad-sdk 5.0.4-beta.63 → 5.0.4-beta.64

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 (70) hide show
  1. package/dist/LaunchpadSDK.d.ts +20 -8
  2. package/dist/LaunchpadSDK.d.ts.map +1 -1
  3. package/dist/ai-docs.json +354 -314
  4. package/dist/config/environments.d.ts +2 -0
  5. package/dist/config/environments.d.ts.map +1 -1
  6. package/dist/constants/version.generated.d.ts +1 -1
  7. package/dist/index.browser.d.ts +2 -1
  8. package/dist/index.browser.d.ts.map +1 -1
  9. package/dist/index.browser.esm.js +1 -1
  10. package/dist/index.cjs +1 -1
  11. package/dist/index.esm.js +1 -1
  12. package/dist/index.js +1 -1
  13. package/dist/native.cjs +1 -1
  14. package/dist/native.esm.js +1 -1
  15. package/dist/services/DexBackendTradeClient.d.ts +34 -0
  16. package/dist/services/DexBackendTradeClient.d.ts.map +1 -0
  17. package/dist/services/DexQuoteService.d.ts +19 -19
  18. package/dist/services/DexQuoteService.d.ts.map +1 -1
  19. package/dist/services/GSwapLiquidityMutationService.d.ts +2 -2
  20. package/dist/services/GSwapLiquidityMutationService.d.ts.map +1 -1
  21. package/dist/services/GSwapLiquidityQueryService.d.ts +2 -2
  22. package/dist/services/GSwapLiquidityQueryService.d.ts.map +1 -1
  23. package/dist/services/GSwapPoolQueryService.d.ts +5 -6
  24. package/dist/services/GSwapPoolQueryService.d.ts.map +1 -1
  25. package/dist/services/GSwapService.d.ts +6 -6
  26. package/dist/services/GSwapService.d.ts.map +1 -1
  27. package/dist/services/GSwapSwapService.d.ts +0 -2
  28. package/dist/services/GSwapSwapService.d.ts.map +1 -1
  29. package/dist/services/GdexStreamService.d.ts +133 -0
  30. package/dist/services/GdexStreamService.d.ts.map +1 -0
  31. package/dist/src/LaunchpadSDK.d.ts +20 -8
  32. package/dist/src/LaunchpadSDK.d.ts.map +1 -1
  33. package/dist/src/config/environments.d.ts +2 -0
  34. package/dist/src/config/environments.d.ts.map +1 -1
  35. package/dist/src/constants/version.generated.d.ts +1 -1
  36. package/dist/src/index.browser.d.ts +2 -1
  37. package/dist/src/index.browser.d.ts.map +1 -1
  38. package/dist/src/services/DexBackendTradeClient.d.ts +34 -0
  39. package/dist/src/services/DexBackendTradeClient.d.ts.map +1 -0
  40. package/dist/src/services/DexQuoteService.d.ts +19 -19
  41. package/dist/src/services/DexQuoteService.d.ts.map +1 -1
  42. package/dist/src/services/GSwapLiquidityMutationService.d.ts +2 -2
  43. package/dist/src/services/GSwapLiquidityMutationService.d.ts.map +1 -1
  44. package/dist/src/services/GSwapLiquidityQueryService.d.ts +2 -2
  45. package/dist/src/services/GSwapLiquidityQueryService.d.ts.map +1 -1
  46. package/dist/src/services/GSwapPoolQueryService.d.ts +5 -6
  47. package/dist/src/services/GSwapPoolQueryService.d.ts.map +1 -1
  48. package/dist/src/services/GSwapService.d.ts +6 -6
  49. package/dist/src/services/GSwapService.d.ts.map +1 -1
  50. package/dist/src/services/GSwapSwapService.d.ts +0 -2
  51. package/dist/src/services/GSwapSwapService.d.ts.map +1 -1
  52. package/dist/src/services/GdexStreamService.d.ts +133 -0
  53. package/dist/src/services/GdexStreamService.d.ts.map +1 -0
  54. package/dist/src/types/composite-pool.dto.d.ts +0 -2
  55. package/dist/src/types/composite-pool.dto.d.ts.map +1 -1
  56. package/dist/src/utils/error-utils.d.ts +5 -0
  57. package/dist/src/utils/error-utils.d.ts.map +1 -1
  58. package/dist/src/utils/errors.d.ts +4 -0
  59. package/dist/src/utils/errors.d.ts.map +1 -1
  60. package/dist/types/composite-pool.dto.d.ts +0 -2
  61. package/dist/types/composite-pool.dto.d.ts.map +1 -1
  62. package/dist/utils/error-utils.d.ts +5 -0
  63. package/dist/utils/error-utils.d.ts.map +1 -1
  64. package/dist/utils/errors.d.ts +4 -0
  65. package/dist/utils/errors.d.ts.map +1 -1
  66. package/package.json +42 -11
  67. package/dist/services/GalaChainGatewayClient.d.ts +0 -227
  68. package/dist/services/GalaChainGatewayClient.d.ts.map +0 -1
  69. package/dist/src/services/GalaChainGatewayClient.d.ts +0 -227
  70. package/dist/src/services/GalaChainGatewayClient.d.ts.map +0 -1
@@ -93,6 +93,9 @@ export declare function hasCode(error: unknown): error is {
93
93
  * ```
94
94
  */
95
95
  export declare function getErrorMessage(error: unknown): string;
96
+ type TradeErrorContext = 'pool' | 'position';
97
+ /** Map defi-backend trade endpoint failures to the SDK's established error classes. */
98
+ export declare function mapTradeBackendError(error: unknown, context: TradeErrorContext): Error;
96
99
  /**
97
100
  * Safely extracts error stack trace from unknown error
98
101
  *
@@ -182,6 +185,7 @@ export declare function isAxiosError(error: unknown): error is {
182
185
  status: number;
183
186
  data: unknown;
184
187
  statusText: string;
188
+ headers?: Record<string, unknown>;
185
189
  };
186
190
  request?: unknown;
187
191
  config?: unknown;
@@ -455,4 +459,5 @@ export declare function extractResponseMessage(response: unknown): string;
455
459
  * @since 6.15.0
456
460
  */
457
461
  export declare function collectValidationErrors(errors: string[], fn: () => void, errorPrefix?: string): void;
462
+ export {};
458
463
  //# sourceMappingURL=error-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-utils.d.ts","sourceRoot":"","sources":["../../src/utils/error-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAEtD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAOvE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI;IAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAQ1E;AAED;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;GAqBG;AACH,wBAAgB,8BAA8B,CAAC,CAAC,EAC9C,QAAQ,EAAE,OAAO,EACjB,SAAS,EAAE,MAAM,GAChB,CAAC,CAyBH;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,GACd,KAAK,CAIP;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,OAAO,EACjB,SAAS,EAAE,MAAM,GAChB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiCzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CA6DA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAahE;AAuBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqHG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EAAE,EAChB,EAAE,EAAE,MAAM,IAAI,EACd,WAAW,CAAC,EAAE,MAAM,GACnB,IAAI,CAYN"}
@@ -117,6 +117,10 @@ export declare class ValidationError extends Error {
117
117
  */
118
118
  constructor(message: string, field?: string | undefined, code?: string | undefined);
119
119
  }
120
+ /** Error thrown when a trade read includes a blacklisted or ungraduated token. */
121
+ export declare class TokenRestrictedError extends ValidationError {
122
+ constructor(message: string);
123
+ }
120
124
  /**
121
125
  * Error thrown when network operations fail
122
126
  *
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,WAAW;IACtB,2CAA2C;;IAE3C,+DAA+D;;IAE/D,qDAAqD;;IAErD,mDAAmD;;IAEnD,oCAAoC;;IAEpC,mCAAmC;;IAEnC,oCAAoC;;IAEpC,qCAAqC;;IAErC,0CAA0C;;IAE1C,mCAAmC;;IAEnC,2CAA2C;;IAE3C,uDAAuD;;IAEvD,+CAA+C;;IAE/C,0CAA0C;;IAE1C,0CAA0C;;IAE1C,gDAAgD;;IAEhD,+CAA+C;;CAEvC,CAAC;AAEX;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IAU/B,KAAK,CAAC,EAAE,MAAM;IACd,IAAI,CAAC,EAAE,MAAM;IAVtB;;;;;;OAMG;gBAED,OAAO,EAAE,MAAM,EACR,KAAK,CAAC,EAAE,MAAM,YAAA,EACd,IAAI,CAAC,EAAE,MAAM,YAAA;CAKvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAAa,YAAa,SAAQ,KAAK;IAU5B,UAAU,CAAC,EAAE,MAAM;IACnB,aAAa,CAAC,EAAE,KAAK;IAV9B;;;;;;OAMG;gBAED,OAAO,EAAE,MAAM,EACR,UAAU,CAAC,EAAE,MAAM,YAAA,EACnB,aAAa,CAAC,EAAE,KAAK,YAAA;CAK/B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IASlC,KAAK,CAAC,EAAE,MAAM;IARvB;;;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,CAAC,EAAE,MAAM,YAAA,EACtB,IAAI,CAAC,EAAE,MAAM,YAAA;CAKvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAUlC,aAAa,EAAE,OAAO;IACtB,IAAI,CAAC,EAAE,MAAM;IAVtB;;;;;;OAMG;gBAED,OAAO,EAAE,MAAM,EACR,aAAa,EAAE,OAAO,EACtB,IAAI,CAAC,EAAE,MAAM,YAAA;CAKvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBAAa,aAAc,SAAQ,eAAe;IAUvC,OAAO,CAAC,EAAE,OAAO;IAT1B;;;;;OAKG;gBAED,OAAO,EAAE,MAAM,EAER,OAAO,CAAC,EAAE,OAAO,YAAA;CAK3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBAAa,oBAAqB,SAAQ,eAAe;IACvD;;;;OAIG;gBACS,OAAO,EAAE,MAAM;CAI5B"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@gala-chain/launchpad-sdk",
4
- "version": "5.0.4-beta.63",
4
+ "version": "5.0.4-beta.64",
5
5
  "description": "TypeScript SDK for Gala Launchpad Backend API - 273 public methods supporting optional wallet (read-only and full-access modes). Production-ready DeFi token launchpad integration with AgentConfig setup, GalaChain trading, GSwap DEX integration, price history, token creation, DEX pool discovery, WebSocket event watchers, streaming, chat, bans, moderator invites, and comprehensive user operations. Multi-format output (ESM, CJS, UMD).",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.esm.js",
@@ -321,11 +321,8 @@
321
321
  "docs:extract:markdown": "api-documenter markdown -i temp -o docs/api-markdown",
322
322
  "docs:typedoc": "typedoc --options typedoc-html.json",
323
323
  "docs:typedoc:markdown": "typedoc --plugin typedoc-plugin-markdown --out docs/markdown",
324
- "docs:ai": "tsx scripts/generate-ai-docs.ts",
325
- "docs:agent": "tsx scripts/generate-agent-spec.ts",
326
324
  "docs:validate": "tsx scripts/validate-examples.ts",
327
325
  "docs:generate": "npm run docs:prebuild && npm run docs:extract && npm run docs:typedoc",
328
- "docs:all": "npm run docs:clean && npm run docs:generate && npm run docs:extract:markdown && npm run docs:ai && npm run docs:agent",
329
326
  "docs:serve": "http-server docs/api -p 8080",
330
327
  "size": "size-limit",
331
328
  "analyze": "rollup -c rollup.config.mjs --bundleAnalyzerReport"
@@ -429,16 +426,50 @@
429
426
  },
430
427
  "size-limit": [
431
428
  {
432
- "path": "./dist/index.js",
433
- "limit": "50 kB"
429
+ "path": "./dist/index.browser.esm.js",
430
+ "limit": "500 kB",
431
+ "ignore": [
432
+ "ethers",
433
+ "socket.io-client",
434
+ "bignumber.js",
435
+ "axios",
436
+ "uuid",
437
+ "zod",
438
+ "dotenv",
439
+ "events",
440
+ "@gala-chain/api",
441
+ "@gala-chain/connect",
442
+ "@gala-chain/dex"
443
+ ]
434
444
  },
435
445
  {
436
446
  "path": "./dist/index.esm.js",
437
- "limit": "50 kB"
438
- },
439
- {
440
- "path": "./dist/index.cjs.js",
441
- "limit": "50 kB"
447
+ "limit": "250 kB",
448
+ "ignore": [
449
+ "ethers",
450
+ "socket.io-client",
451
+ "bignumber.js",
452
+ "axios",
453
+ "uuid",
454
+ "zod",
455
+ "dotenv",
456
+ "events",
457
+ "@gala-chain/api",
458
+ "@gala-chain/connect",
459
+ "@gala-chain/dex",
460
+ "fs",
461
+ "path",
462
+ "crypto",
463
+ "os",
464
+ "util",
465
+ "stream",
466
+ "http",
467
+ "https",
468
+ "url",
469
+ "zlib",
470
+ "net",
471
+ "tls"
472
+ ]
442
473
  }
443
474
  ],
444
475
  "devDependencies": {
@@ -1,227 +0,0 @@
1
- /**
2
- * GalaChain Gateway Client
3
- *
4
- * Direct HTTP client for GalaChain Gateway DEX contract endpoints with full type safety.
5
- * Provides low-level blockchain interactions for DEX v3 liquidity pools and positions.
6
- *
7
- * ## Key Features:
8
- * - Zero `any` types - fully typed responses
9
- * - Automatic response validation
10
- * - Compound key and position ID lookup support
11
- * - Comprehensive error handling
12
- *
13
- * ## Supported Operations:
14
- * - Pool state queries (GetPoolData)
15
- * - Position management (GetPositions)
16
- * - Liquidity removal estimation (GetRemoveLiquidityEstimation)
17
- *
18
- * @category GalaChain
19
- * @since 3.0.0
20
- */
21
- import type { GalaChainGatewayResponse, GalaChainGetPoolDataRequest, GalaChainGetPositionsRequest, GalaChainGetPositionsResponse, GalaChainGetRemoveLiquidityEstimationRequest, GalaChainGetSlot0Request, GalaChainPoolData, GalaChainRemoveLiquidityEstimation, GalaChainSlot0Data } from '../types/galachain-api.types';
22
- /**
23
- * GalaChain Gateway Client configuration
24
- */
25
- export interface GalaChainGatewayClientConfig {
26
- baseUrl: string;
27
- timeout?: number;
28
- }
29
- /**
30
- * Direct HTTP client for GalaChain Gateway DEX contract endpoints
31
- */
32
- export declare class GalaChainGatewayClient {
33
- private client;
34
- constructor(config: GalaChainGatewayClientConfig);
35
- /**
36
- * Fetch pool state data from GalaChain DEX v3 contract
37
- *
38
- * Retrieves complete pool state including liquidity, price, tick data, and fee tier.
39
- * Uses TokenClassKey objects for precise token identification - pipe-delimited strings
40
- * are NOT supported (use parseToken() utility to convert if needed).
41
- *
42
- * **Critical**: tokens must be TokenClassKey objects, not strings. Backend requires
43
- * structured token objects with collection/category/type/additionalKey fields.
44
- *
45
- * @param request Pool data request with token0, token1 (TokenClassKey objects), and fee tier
46
- * @returns Promise<GalaChainPoolData> Complete pool state from blockchain
47
- * @throws ApiError if tokens are strings instead of objects, or request fails
48
- * @category GalaChain
49
- * @since 3.0.0
50
- *
51
- * @example Fetch pool state for GALA/GUSDC
52
- * ```typescript
53
- * const poolData = await client.getPoolData({
54
- * token0: { collection: 'GALA', category: 'Unit', type: 'none', additionalKey: 'none' },
55
- * token1: { collection: 'GUSDC', category: 'Unit', type: 'none', additionalKey: 'none' },
56
- * fee: 3000 // 0.3% fee tier
57
- * });
58
- * console.log('Current price:', poolData.sqrtPriceX96);
59
- * console.log('Liquidity:', poolData.liquidity);
60
- * ```
61
- */
62
- getPoolData(request: GalaChainGetPoolDataRequest): Promise<GalaChainPoolData>;
63
- /**
64
- * Fetch minimal pool state (Slot0) from GalaChain DEX v3 contract
65
- *
66
- * Retrieves the essential pool state data needed for pricing and liquidity calculations:
67
- * - sqrtPrice: Current sqrt price (decimal string)
68
- * - tick: Current tick number
69
- * - liquidity: Current pool liquidity
70
- * - grossPoolLiquidity: Optional gross pool liquidity value
71
- *
72
- * Lightweight alternative to getPoolData() when only slot0 data is needed.
73
- *
74
- * **Critical**: tokens must be TokenClassKey objects, not strings.
75
- *
76
- * @param request Slot0 request with token0, token1 (TokenClassKey objects), and fee tier
77
- * @returns Promise<GalaChainSlot0Data> Minimal pool state data
78
- * @throws ApiError if tokens are strings instead of objects, or request fails
79
- * @category GalaChain
80
- * @since 5.16.0
81
- *
82
- * @example Fetch Slot0 for GALA/GUSDC
83
- * ```typescript
84
- * const slot0 = await client.getSlot0({
85
- * token0: { collection: 'GALA', category: 'Unit', type: 'none', additionalKey: 'none' },
86
- * token1: { collection: 'GUSDC', category: 'Unit', type: 'none', additionalKey: 'none' },
87
- * fee: 3000 // 0.3% fee tier
88
- * });
89
- * console.log('Current price:', slot0.sqrtPrice);
90
- * console.log('Current tick:', slot0.tick);
91
- * ```
92
- */
93
- getSlot0(request: GalaChainGetSlot0Request): Promise<GalaChainSlot0Data>;
94
- /**
95
- * Query liquidity positions from GalaChain DEX v3 contract
96
- *
97
- * Flexible position query supporting multiple filter combinations:
98
- * - All positions for an owner (owner only)
99
- * - Positions for specific pool (owner + token0 + token1)
100
- * - Specific position by compound key (owner + tokens + ticks)
101
- * - Pagination support via bookmark field
102
- *
103
- * **Response Format**: Returns either single position object or `{ positions: [...], count: N }`
104
- * wrapper depending on query type. SDK normalizes to consistent array format.
105
- *
106
- * @param request Position query with owner and optional filters (token0, token1, fee, ticks, bookmark)
107
- * @returns Promise<GalaChainGetPositionsResponse> Array of matching positions with count
108
- * @throws ApiError if request fails or response format invalid
109
- * @category GalaChain
110
- * @since 3.0.0
111
- *
112
- * @example Get all positions for a user
113
- * ```typescript
114
- * const positions = await client.getPositions({
115
- * owner: 'client|user123'
116
- * });
117
- * console.log(`User has ${positions.count} positions`);
118
- * ```
119
- *
120
- * @example Get positions for specific pool
121
- * ```typescript
122
- * const poolPositions = await client.getPositions({
123
- * owner: 'client|user123',
124
- * token0: { collection: 'GALA', category: 'Unit', type: 'none', additionalKey: 'none' },
125
- * token1: { collection: 'GUSDC', category: 'Unit', type: 'none', additionalKey: 'none' }
126
- * });
127
- * ```
128
- */
129
- getPositions(request: GalaChainGetPositionsRequest): Promise<GalaChainGetPositionsResponse>;
130
- /**
131
- * Fetch specific liquidity position by compound key or position ID
132
- *
133
- * Supports two lookup strategies:
134
- * 1. **Compound Key** (preferred): owner + token0 + token1 + fee + tickLower + tickUpper
135
- * 2. **Position ID** (legacy fallback): just position ID string
136
- *
137
- * Compound key lookup is more reliable and matches the blockchain's native position
138
- * identification scheme. Position ID lookup is provided for backward compatibility.
139
- *
140
- * **Response Format**: Returns position object directly (not wrapped in array).
141
- *
142
- * @param ownerOrPositionId Position owner address (compound key) or position ID (legacy)
143
- * @param token0Optional Token0 symbol or TokenClassKey (required for compound key)
144
- * @param token1Optional Token1 symbol or TokenClassKey (required for compound key)
145
- * @param feeOptional Fee tier in basis points (required for compound key)
146
- * @param tickLowerOptional Lower tick boundary (required for compound key)
147
- * @param tickUpperOptional Upper tick boundary (required for compound key)
148
- * @param positionIdOptional Optional position ID to include in request
149
- * @returns Promise<GalaChainResponse<unknown>> Wrapped position data
150
- * @throws ApiError if position not found (404) or request fails
151
- * @category GalaChain
152
- * @since 3.0.0
153
- *
154
- * @example Fetch position by compound key (preferred)
155
- * ```typescript
156
- * const position = await client.getPositionById(
157
- * 'client|user123',
158
- * { collection: 'GALA', category: 'Unit', type: 'none', additionalKey: 'none' },
159
- * { collection: 'GUSDC', category: 'Unit', type: 'none', additionalKey: 'none' },
160
- * 3000, // 0.3% fee
161
- * -887220, // tickLower
162
- * 887220, // tickUpper
163
- * 'position123' // optional
164
- * );
165
- * console.log('Liquidity:', position.Data.liquidity);
166
- * ```
167
- *
168
- * @example Fetch position by ID (legacy)
169
- * ```typescript
170
- * const position = await client.getPositionById('position123');
171
- * ```
172
- */
173
- getPositionById(ownerOrPositionId: string, token0Optional?: string | Record<string, unknown>, token1Optional?: string | Record<string, unknown>, feeOptional?: number, tickLowerOptional?: number, tickUpperOptional?: number, positionIdOptional?: string): Promise<GalaChainResponse<unknown>>;
174
- /**
175
- * Calculate estimated token amounts from liquidity removal
176
- *
177
- * Simulates removing liquidity from a position to preview the exact amounts of token0
178
- * and token1 that will be received. Includes both principal liquidity and accumulated
179
- * trading fees. Does not execute the removal - use for UI preview before transaction.
180
- *
181
- * **Use Cases**: Preview removal amounts, calculate impermanent loss, position exit planning
182
- *
183
- * @param request Removal estimation request with owner, tokens, fee, ticks, and liquidity amount
184
- * @returns Promise<GalaChainRemoveLiquidityEstimation> Estimated token0 and token1 amounts
185
- * @throws ApiError if request fails or position parameters invalid
186
- * @category GalaChain
187
- * @since 3.0.0
188
- *
189
- * @example Estimate removal amounts
190
- * ```typescript
191
- * const estimation = await client.getRemoveLiquidityEstimation({
192
- * owner: 'client|user123',
193
- * token0: { collection: 'GALA', category: 'Unit', type: 'none', additionalKey: 'none' },
194
- * token1: { collection: 'GUSDC', category: 'Unit', type: 'none', additionalKey: 'none' },
195
- * fee: 3000,
196
- * tickLower: -887220,
197
- * tickUpper: 887220,
198
- * liquidity: '1000000000000'
199
- * });
200
- * console.log(`Will receive: ${estimation.amount0} GALA, ${estimation.amount1} GUSDC`);
201
- * ```
202
- */
203
- getRemoveLiquidityEstimation(request: GalaChainGetRemoveLiquidityEstimationRequest): Promise<GalaChainRemoveLiquidityEstimation>;
204
- /**
205
- * Validate GalaChain Gateway response wrapper
206
- * Checks for errors and required fields
207
- *
208
- * @param response - Response object to validate
209
- * @throws ApiError if response indicates error or is malformed
210
- */
211
- private validateResponse;
212
- /**
213
- * Handle errors from axios or gateway
214
- * Converts various error types to ApiError
215
- *
216
- * @param error - Error from axios or validation
217
- * @param context - Method name for better error messages
218
- * @returns ApiError with context
219
- */
220
- private handleError;
221
- }
222
- /**
223
- * Type re-export for convenience
224
- * Used when function returns wrapped response
225
- */
226
- export type GalaChainResponse<T> = GalaChainGatewayResponse<T>;
227
- //# sourceMappingURL=GalaChainGatewayClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GalaChainGatewayClient.d.ts","sourceRoot":"","sources":["../../src/services/GalaChainGatewayClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,KAAK,EACV,wBAAwB,EACxB,2BAA2B,EAC3B,4BAA4B,EAC5B,6BAA6B,EAC7B,4CAA4C,EAC5C,wBAAwB,EAAG,iBAAiB,EAE5C,kCAAkC,EAClC,kBAAkB,EAAC,MAAM,8BAA8B,CAAC;AAY1D;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,qBAAa,sBAAsB;IACjC,OAAO,CAAC,MAAM,CAAgB;gBAElB,MAAM,EAAE,4BAA4B;IAIhD;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACG,WAAW,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,iBAAiB,CAAC;IA4CnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACG,QAAQ,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA2C9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACG,YAAY,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,6BAA6B,CAAC;IA4DjG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0CG;IACG,eAAe,CACnB,iBAAiB,EAAE,MAAM,EAEzB,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAEjD,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjD,WAAW,CAAC,EAAE,MAAM,EACpB,iBAAiB,CAAC,EAAE,MAAM,EAC1B,iBAAiB,CAAC,EAAE,MAAM,EAC1B,kBAAkB,CAAC,EAAE,MAAM,GAE1B,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAyGtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACG,4BAA4B,CAChC,OAAO,EAAE,4CAA4C,GACpD,OAAO,CAAC,kCAAkC,CAAC;IAkC9C;;;;;;OAMG;IACH,OAAO,CAAC,gBAAgB;IAgBxB;;;;;;;OAOG;IACH,OAAO,CAAC,WAAW;CAmBpB;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,wBAAwB,CAAC,CAAC,CAAC,CAAC"}
@@ -1,227 +0,0 @@
1
- /**
2
- * GalaChain Gateway Client
3
- *
4
- * Direct HTTP client for GalaChain Gateway DEX contract endpoints with full type safety.
5
- * Provides low-level blockchain interactions for DEX v3 liquidity pools and positions.
6
- *
7
- * ## Key Features:
8
- * - Zero `any` types - fully typed responses
9
- * - Automatic response validation
10
- * - Compound key and position ID lookup support
11
- * - Comprehensive error handling
12
- *
13
- * ## Supported Operations:
14
- * - Pool state queries (GetPoolData)
15
- * - Position management (GetPositions)
16
- * - Liquidity removal estimation (GetRemoveLiquidityEstimation)
17
- *
18
- * @category GalaChain
19
- * @since 3.0.0
20
- */
21
- import type { GalaChainGatewayResponse, GalaChainGetPoolDataRequest, GalaChainGetPositionsRequest, GalaChainGetPositionsResponse, GalaChainGetRemoveLiquidityEstimationRequest, GalaChainGetSlot0Request, GalaChainPoolData, GalaChainRemoveLiquidityEstimation, GalaChainSlot0Data } from '../types/galachain-api.types';
22
- /**
23
- * GalaChain Gateway Client configuration
24
- */
25
- export interface GalaChainGatewayClientConfig {
26
- baseUrl: string;
27
- timeout?: number;
28
- }
29
- /**
30
- * Direct HTTP client for GalaChain Gateway DEX contract endpoints
31
- */
32
- export declare class GalaChainGatewayClient {
33
- private client;
34
- constructor(config: GalaChainGatewayClientConfig);
35
- /**
36
- * Fetch pool state data from GalaChain DEX v3 contract
37
- *
38
- * Retrieves complete pool state including liquidity, price, tick data, and fee tier.
39
- * Uses TokenClassKey objects for precise token identification - pipe-delimited strings
40
- * are NOT supported (use parseToken() utility to convert if needed).
41
- *
42
- * **Critical**: tokens must be TokenClassKey objects, not strings. Backend requires
43
- * structured token objects with collection/category/type/additionalKey fields.
44
- *
45
- * @param request Pool data request with token0, token1 (TokenClassKey objects), and fee tier
46
- * @returns Promise<GalaChainPoolData> Complete pool state from blockchain
47
- * @throws ApiError if tokens are strings instead of objects, or request fails
48
- * @category GalaChain
49
- * @since 3.0.0
50
- *
51
- * @example Fetch pool state for GALA/GUSDC
52
- * ```typescript
53
- * const poolData = await client.getPoolData({
54
- * token0: { collection: 'GALA', category: 'Unit', type: 'none', additionalKey: 'none' },
55
- * token1: { collection: 'GUSDC', category: 'Unit', type: 'none', additionalKey: 'none' },
56
- * fee: 3000 // 0.3% fee tier
57
- * });
58
- * console.log('Current price:', poolData.sqrtPriceX96);
59
- * console.log('Liquidity:', poolData.liquidity);
60
- * ```
61
- */
62
- getPoolData(request: GalaChainGetPoolDataRequest): Promise<GalaChainPoolData>;
63
- /**
64
- * Fetch minimal pool state (Slot0) from GalaChain DEX v3 contract
65
- *
66
- * Retrieves the essential pool state data needed for pricing and liquidity calculations:
67
- * - sqrtPrice: Current sqrt price (decimal string)
68
- * - tick: Current tick number
69
- * - liquidity: Current pool liquidity
70
- * - grossPoolLiquidity: Optional gross pool liquidity value
71
- *
72
- * Lightweight alternative to getPoolData() when only slot0 data is needed.
73
- *
74
- * **Critical**: tokens must be TokenClassKey objects, not strings.
75
- *
76
- * @param request Slot0 request with token0, token1 (TokenClassKey objects), and fee tier
77
- * @returns Promise<GalaChainSlot0Data> Minimal pool state data
78
- * @throws ApiError if tokens are strings instead of objects, or request fails
79
- * @category GalaChain
80
- * @since 5.16.0
81
- *
82
- * @example Fetch Slot0 for GALA/GUSDC
83
- * ```typescript
84
- * const slot0 = await client.getSlot0({
85
- * token0: { collection: 'GALA', category: 'Unit', type: 'none', additionalKey: 'none' },
86
- * token1: { collection: 'GUSDC', category: 'Unit', type: 'none', additionalKey: 'none' },
87
- * fee: 3000 // 0.3% fee tier
88
- * });
89
- * console.log('Current price:', slot0.sqrtPrice);
90
- * console.log('Current tick:', slot0.tick);
91
- * ```
92
- */
93
- getSlot0(request: GalaChainGetSlot0Request): Promise<GalaChainSlot0Data>;
94
- /**
95
- * Query liquidity positions from GalaChain DEX v3 contract
96
- *
97
- * Flexible position query supporting multiple filter combinations:
98
- * - All positions for an owner (owner only)
99
- * - Positions for specific pool (owner + token0 + token1)
100
- * - Specific position by compound key (owner + tokens + ticks)
101
- * - Pagination support via bookmark field
102
- *
103
- * **Response Format**: Returns either single position object or `{ positions: [...], count: N }`
104
- * wrapper depending on query type. SDK normalizes to consistent array format.
105
- *
106
- * @param request Position query with owner and optional filters (token0, token1, fee, ticks, bookmark)
107
- * @returns Promise<GalaChainGetPositionsResponse> Array of matching positions with count
108
- * @throws ApiError if request fails or response format invalid
109
- * @category GalaChain
110
- * @since 3.0.0
111
- *
112
- * @example Get all positions for a user
113
- * ```typescript
114
- * const positions = await client.getPositions({
115
- * owner: 'client|user123'
116
- * });
117
- * console.log(`User has ${positions.count} positions`);
118
- * ```
119
- *
120
- * @example Get positions for specific pool
121
- * ```typescript
122
- * const poolPositions = await client.getPositions({
123
- * owner: 'client|user123',
124
- * token0: { collection: 'GALA', category: 'Unit', type: 'none', additionalKey: 'none' },
125
- * token1: { collection: 'GUSDC', category: 'Unit', type: 'none', additionalKey: 'none' }
126
- * });
127
- * ```
128
- */
129
- getPositions(request: GalaChainGetPositionsRequest): Promise<GalaChainGetPositionsResponse>;
130
- /**
131
- * Fetch specific liquidity position by compound key or position ID
132
- *
133
- * Supports two lookup strategies:
134
- * 1. **Compound Key** (preferred): owner + token0 + token1 + fee + tickLower + tickUpper
135
- * 2. **Position ID** (legacy fallback): just position ID string
136
- *
137
- * Compound key lookup is more reliable and matches the blockchain's native position
138
- * identification scheme. Position ID lookup is provided for backward compatibility.
139
- *
140
- * **Response Format**: Returns position object directly (not wrapped in array).
141
- *
142
- * @param ownerOrPositionId Position owner address (compound key) or position ID (legacy)
143
- * @param token0Optional Token0 symbol or TokenClassKey (required for compound key)
144
- * @param token1Optional Token1 symbol or TokenClassKey (required for compound key)
145
- * @param feeOptional Fee tier in basis points (required for compound key)
146
- * @param tickLowerOptional Lower tick boundary (required for compound key)
147
- * @param tickUpperOptional Upper tick boundary (required for compound key)
148
- * @param positionIdOptional Optional position ID to include in request
149
- * @returns Promise<GalaChainResponse<unknown>> Wrapped position data
150
- * @throws ApiError if position not found (404) or request fails
151
- * @category GalaChain
152
- * @since 3.0.0
153
- *
154
- * @example Fetch position by compound key (preferred)
155
- * ```typescript
156
- * const position = await client.getPositionById(
157
- * 'client|user123',
158
- * { collection: 'GALA', category: 'Unit', type: 'none', additionalKey: 'none' },
159
- * { collection: 'GUSDC', category: 'Unit', type: 'none', additionalKey: 'none' },
160
- * 3000, // 0.3% fee
161
- * -887220, // tickLower
162
- * 887220, // tickUpper
163
- * 'position123' // optional
164
- * );
165
- * console.log('Liquidity:', position.Data.liquidity);
166
- * ```
167
- *
168
- * @example Fetch position by ID (legacy)
169
- * ```typescript
170
- * const position = await client.getPositionById('position123');
171
- * ```
172
- */
173
- getPositionById(ownerOrPositionId: string, token0Optional?: string | Record<string, unknown>, token1Optional?: string | Record<string, unknown>, feeOptional?: number, tickLowerOptional?: number, tickUpperOptional?: number, positionIdOptional?: string): Promise<GalaChainResponse<unknown>>;
174
- /**
175
- * Calculate estimated token amounts from liquidity removal
176
- *
177
- * Simulates removing liquidity from a position to preview the exact amounts of token0
178
- * and token1 that will be received. Includes both principal liquidity and accumulated
179
- * trading fees. Does not execute the removal - use for UI preview before transaction.
180
- *
181
- * **Use Cases**: Preview removal amounts, calculate impermanent loss, position exit planning
182
- *
183
- * @param request Removal estimation request with owner, tokens, fee, ticks, and liquidity amount
184
- * @returns Promise<GalaChainRemoveLiquidityEstimation> Estimated token0 and token1 amounts
185
- * @throws ApiError if request fails or position parameters invalid
186
- * @category GalaChain
187
- * @since 3.0.0
188
- *
189
- * @example Estimate removal amounts
190
- * ```typescript
191
- * const estimation = await client.getRemoveLiquidityEstimation({
192
- * owner: 'client|user123',
193
- * token0: { collection: 'GALA', category: 'Unit', type: 'none', additionalKey: 'none' },
194
- * token1: { collection: 'GUSDC', category: 'Unit', type: 'none', additionalKey: 'none' },
195
- * fee: 3000,
196
- * tickLower: -887220,
197
- * tickUpper: 887220,
198
- * liquidity: '1000000000000'
199
- * });
200
- * console.log(`Will receive: ${estimation.amount0} GALA, ${estimation.amount1} GUSDC`);
201
- * ```
202
- */
203
- getRemoveLiquidityEstimation(request: GalaChainGetRemoveLiquidityEstimationRequest): Promise<GalaChainRemoveLiquidityEstimation>;
204
- /**
205
- * Validate GalaChain Gateway response wrapper
206
- * Checks for errors and required fields
207
- *
208
- * @param response - Response object to validate
209
- * @throws ApiError if response indicates error or is malformed
210
- */
211
- private validateResponse;
212
- /**
213
- * Handle errors from axios or gateway
214
- * Converts various error types to ApiError
215
- *
216
- * @param error - Error from axios or validation
217
- * @param context - Method name for better error messages
218
- * @returns ApiError with context
219
- */
220
- private handleError;
221
- }
222
- /**
223
- * Type re-export for convenience
224
- * Used when function returns wrapped response
225
- */
226
- export type GalaChainResponse<T> = GalaChainGatewayResponse<T>;
227
- //# sourceMappingURL=GalaChainGatewayClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Gal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