@gala-chain/launchpad-sdk 3.31.0 → 4.0.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/API.md +524 -4
- package/CHANGELOG.md +92 -0
- package/EXAMPLES.md +845 -0
- package/README.md +421 -14
- package/dist/LaunchpadSDK.d.ts +435 -18
- package/dist/LaunchpadSDK.d.ts.map +1 -1
- package/dist/api/LaunchpadAPI.d.ts.map +1 -1
- package/dist/api/dto/TransferTokenDto.d.ts.map +1 -1
- package/dist/constants/version.generated.d.ts +1 -1
- package/dist/constants/version.generated.d.ts.map +1 -1
- package/dist/helpers/sdk.d.ts +1 -0
- package/dist/helpers/sdk.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +10 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/services/BaseService.d.ts +32 -3
- package/dist/services/BaseService.d.ts.map +1 -1
- package/dist/services/BundleService.d.ts.map +1 -1
- package/dist/services/CommentService.d.ts.map +1 -1
- package/dist/services/DexBackendClient.d.ts +46 -0
- package/dist/services/DexBackendClient.d.ts.map +1 -0
- package/dist/services/DexPoolService.d.ts +54 -12
- package/dist/services/DexPoolService.d.ts.map +1 -1
- package/dist/services/DexQuoteService.d.ts +288 -0
- package/dist/services/DexQuoteService.d.ts.map +1 -0
- package/dist/services/DexService.d.ts.map +1 -1
- package/dist/services/FaucetService.d.ts.map +1 -1
- package/dist/services/GSwapService.d.ts +519 -44
- package/dist/services/GSwapService.d.ts.map +1 -1
- package/dist/services/GalaChainGatewayClient.d.ts +89 -0
- package/dist/services/GalaChainGatewayClient.d.ts.map +1 -0
- package/dist/services/GalaChainService.d.ts +26 -0
- package/dist/services/GalaChainService.d.ts.map +1 -1
- package/dist/services/ImageService.d.ts.map +1 -1
- package/dist/services/PoolService.d.ts.map +1 -1
- package/dist/services/PoolStateManager.d.ts +176 -0
- package/dist/services/PoolStateManager.d.ts.map +1 -0
- package/dist/services/PriceHistoryService.d.ts +4 -5
- package/dist/services/PriceHistoryService.d.ts.map +1 -1
- package/dist/services/SignatureService.d.ts +15 -38
- package/dist/services/SignatureService.d.ts.map +1 -1
- package/dist/services/TokenClassKeyService.d.ts +3 -4
- package/dist/services/TokenClassKeyService.d.ts.map +1 -1
- package/dist/services/TokenMetadataCache.d.ts +2 -2
- package/dist/services/TokenMetadataCache.d.ts.map +1 -1
- package/dist/services/TokenMetadataService.d.ts +3 -3
- package/dist/services/TokenMetadataService.d.ts.map +1 -1
- package/dist/services/TokenResolverService.d.ts +2 -2
- package/dist/services/TokenResolverService.d.ts.map +1 -1
- package/dist/services/TradeService.d.ts.map +1 -1
- package/dist/services/UserService.d.ts.map +1 -1
- package/dist/services/WebSocketService.d.ts +100 -2
- package/dist/services/WebSocketService.d.ts.map +1 -1
- package/dist/services/__mocks__/logger.mock.d.ts +17 -0
- package/dist/services/__mocks__/logger.mock.d.ts.map +1 -0
- package/dist/types/common.d.ts +2 -0
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/composite-pool.dto.d.ts +103 -0
- package/dist/types/composite-pool.dto.d.ts.map +1 -0
- package/dist/types/dex-pool.dto.d.ts +56 -5
- package/dist/types/dex-pool.dto.d.ts.map +1 -1
- package/dist/types/dto.d.ts +6 -6
- package/dist/types/dto.d.ts.map +1 -1
- package/dist/types/eip712-types.d.ts +140 -0
- package/dist/types/eip712-types.d.ts.map +1 -0
- package/dist/types/galachain-api.types.d.ts +206 -0
- package/dist/types/galachain-api.types.d.ts.map +1 -0
- package/dist/types/gswap-responses.types.d.ts +366 -0
- package/dist/types/gswap-responses.types.d.ts.map +1 -0
- package/dist/types/gswap.dto.d.ts +58 -3
- package/dist/types/gswap.dto.d.ts.map +1 -1
- package/dist/types/launchpad.dto.d.ts +57 -0
- package/dist/types/launchpad.dto.d.ts.map +1 -1
- package/dist/types/pool-state-delta.dto.d.ts +246 -0
- package/dist/types/pool-state-delta.dto.d.ts.map +1 -0
- package/dist/types/pool-state-manager-config.dto.d.ts +103 -0
- package/dist/types/pool-state-manager-config.dto.d.ts.map +1 -0
- package/dist/utils/SignatureHelper.d.ts.map +1 -1
- package/dist/utils/auto-pagination.d.ts +206 -0
- package/dist/utils/auto-pagination.d.ts.map +1 -0
- package/dist/utils/bignumber-helpers.d.ts +336 -0
- package/dist/utils/bignumber-helpers.d.ts.map +1 -0
- package/dist/utils/bignumber-pool-cache.d.ts +169 -0
- package/dist/utils/bignumber-pool-cache.d.ts.map +1 -0
- package/dist/utils/composite-pool-converter.d.ts +121 -0
- package/dist/utils/composite-pool-converter.d.ts.map +1 -0
- package/dist/utils/errors.d.ts +86 -0
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/http.d.ts.map +1 -1
- package/dist/utils/load-env.d.ts +31 -0
- package/dist/utils/load-env.d.ts.map +1 -0
- package/dist/utils/pool-pair-parser.d.ts +55 -0
- package/dist/utils/pool-pair-parser.d.ts.map +1 -0
- package/dist/utils/pool-state-validator.d.ts +207 -0
- package/dist/utils/pool-state-validator.d.ts.map +1 -0
- package/dist/utils/position-filters.d.ts +253 -0
- package/dist/utils/position-filters.d.ts.map +1 -0
- package/dist/utils/swap-delta-calculator.d.ts +231 -0
- package/dist/utils/swap-delta-calculator.d.ts.map +1 -0
- package/dist/utils/tick-crossing-handler.d.ts +250 -0
- package/dist/utils/tick-crossing-handler.d.ts.map +1 -0
- package/dist/utils/token-format-converter.d.ts +85 -6
- package/dist/utils/token-format-converter.d.ts.map +1 -1
- package/dist/utils/token-parser.d.ts +235 -0
- package/dist/utils/token-parser.d.ts.map +1 -0
- package/dist/utils/tokenNormalizer.d.ts +66 -0
- package/dist/utils/tokenNormalizer.d.ts.map +1 -1
- package/dist/utils/transfer-validation.d.ts.map +1 -1
- package/dist/utils/validation-helpers.d.ts +75 -0
- package/dist/utils/validation-helpers.d.ts.map +1 -1
- package/package.json +36 -15
- package/dist/utils/tokenFormatConverter.d.ts +0 -53
- package/dist/utils/tokenFormatConverter.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenResolverService.d.ts","sourceRoot":"","sources":["../../src/services/TokenResolverService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"TokenResolverService.d.ts","sourceRoot":"","sources":["../../src/services/TokenResolverService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAKrD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,oBAAqB,SAAQ,UAAU;IActC,OAAO,CAAC,QAAQ,CAAC,WAAW;IAbxC;;;;OAIG;IACH,OAAO,CAAC,KAAK,CAA6B;IAE1C;;;;;OAKG;gBAC0B,WAAW,EAAE,WAAW,EAAE,SAAS,GAAE,OAAe;IAIjF;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAmCpE;;;;;;;;;;;;;;;;;;OAkBG;IACG,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAerE;;;;;OAKG;IACH,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAIrC;;;;;OAKG;IACH,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI;IAIlD;;;;OAIG;IACH,KAAK,IAAI,IAAI;IAIb;;;;OAIG;IACH,QAAQ,IAAI;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE;IAO5C;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CACL,QAAQ,EAAE,KAAK,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC,GAC3D,IAAI;IAMP;;;;;;;OAOG;IACH,OAAO,CAAC,gCAAgC;CAkBzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TradeService.d.ts","sourceRoot":"","sources":["../../src/services/TradeService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAO3C,OAAO,EAEL,YAAY,EAEb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAwB,MAAM,sBAAsB,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,YAAa,SAAQ,WAAW;gBAC/B,IAAI,EAAE,UAAU,EAAE,SAAS,GAAE,OAAe;IAIxD;;;;;;;;;OASG;IACG,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"TradeService.d.ts","sourceRoot":"","sources":["../../src/services/TradeService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAO3C,OAAO,EAEL,YAAY,EAEb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAwB,MAAM,sBAAsB,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,YAAa,SAAQ,WAAW;gBAC/B,IAAI,EAAE,UAAU,EAAE,SAAS,GAAE,OAAe;IAIxD;;;;;;;;;OASG;IACG,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;CA2DtE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserService.d.ts","sourceRoot":"","sources":["../../src/services/UserService.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAU3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EAEjB,yBAAyB,EAO1B,MAAM,mBAAmB,CAAC;AAO3B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,WAAY,SAAQ,WAAW;gBAC9B,IAAI,EAAE,UAAU,EAAE,SAAS,GAAE,OAAe;IAIxD;;;;;;OAMG;IACG,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"UserService.d.ts","sourceRoot":"","sources":["../../src/services/UserService.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAU3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EAEjB,yBAAyB,EAO1B,MAAM,mBAAmB,CAAC;AAO3B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,WAAY,SAAQ,WAAW;gBAC9B,IAAI,EAAE,UAAU,EAAE,SAAS,GAAE,OAAe;IAIxD;;;;;;OAMG;IACG,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAwBlD;;;;;;;;;;;OAWG;IACG,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAyD3D;;;;;;;OAOG;IACG,kBAAkB,CACtB,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,MAAM,CAAC;IAsDlB;;;;;;OAMG;IACG,cAAc,CAClB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,mBAAmB,CAAC;IAO/B;;;;;;OAMG;IACG,eAAe,CACnB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,mBAAmB,CAAC;IAO/B;;;;;OAKG;IACG,kBAAkB,CACtB,OAAO,GAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAO,GACnF,OAAO,CAAC,mBAAmB,CAAC;IA4B/B;;;;;;;;;;;;;;;;OAgBG;YACW,iBAAiB;IAuD/B;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;IAuCnC;;;;OAIG;IACH,OAAO,CAAC,yBAAyB;IAkBjC;;;;OAIG;IACH,OAAO,CAAC,iCAAiC;CAW1C"}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* @since 2.0.0
|
|
9
9
|
*/
|
|
10
10
|
import { Socket } from 'socket.io-client';
|
|
11
|
+
import { LoggerBase } from './BaseService';
|
|
11
12
|
import { SDKTransactionStatus } from '../types/websocket.types';
|
|
12
13
|
export interface TransactionStatus {
|
|
13
14
|
transactionId: string;
|
|
@@ -16,14 +17,79 @@ export interface TransactionStatus {
|
|
|
16
17
|
timestamp: number;
|
|
17
18
|
blockHash?: string;
|
|
18
19
|
gasUsed?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Raw transaction data from bundler response
|
|
22
|
+
* Contains actual swap/buy/sell amounts and other transaction details
|
|
23
|
+
* @since v3.32.0 - Added to capture actual transaction output
|
|
24
|
+
*/
|
|
25
|
+
data?: Record<string, unknown>;
|
|
19
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* WebSocket service configuration with timeout customization
|
|
29
|
+
*
|
|
30
|
+
* **Timeout Configuration**
|
|
31
|
+
* Control how long the SDK waits for WebSocket transaction confirmation:
|
|
32
|
+
* - Default: 300000ms (5 minutes) - suitable for typical blockchain finalization
|
|
33
|
+
* - Minimum: 10000ms (10 seconds) - for fast-finality blockchains
|
|
34
|
+
* - Custom: Set to any millisecond value matching your blockchain requirements
|
|
35
|
+
*
|
|
36
|
+
* **When Timeout Occurs**
|
|
37
|
+
* If no transaction confirmation is received within the timeout period:
|
|
38
|
+
* - WebSocket monitoring is terminated
|
|
39
|
+
* - Operation returns with `status: 'SUBMITTED'` indicating transaction was accepted
|
|
40
|
+
* - Transaction may still succeed on-chain even if monitoring times out
|
|
41
|
+
* - Users can call `.wait()` again to retry monitoring
|
|
42
|
+
* - Recommended: retry monitoring after waiting or check on-chain later
|
|
43
|
+
*
|
|
44
|
+
* **Use Cases for Custom Timeouts**
|
|
45
|
+
* - **Slow Blockchains** (5+ min finality): Increase to 600000+ ms
|
|
46
|
+
* - **Fast Blockchains** (Solana, Polygon): Reduce to 30000-60000 ms
|
|
47
|
+
* - **High Network Congestion**: Increase timeout tolerance
|
|
48
|
+
* - **Mobile Networks**: Increase to handle intermittent connectivity
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* // Initialize SDK with custom WebSocket timeout
|
|
53
|
+
* const sdk = await createLaunchpadSDK({
|
|
54
|
+
* wallet: privateKey,
|
|
55
|
+
* config: {
|
|
56
|
+
* // Custom 2-minute timeout for faster networks
|
|
57
|
+
* websocket: {
|
|
58
|
+
* timeout: 120000 // 120 seconds instead of default 5 minutes
|
|
59
|
+
* }
|
|
60
|
+
* }
|
|
61
|
+
* });
|
|
62
|
+
*
|
|
63
|
+
* // Or for slow networks
|
|
64
|
+
* const sdk = await createLaunchpadSDK({
|
|
65
|
+
* wallet: privateKey,
|
|
66
|
+
* config: {
|
|
67
|
+
* websocket: {
|
|
68
|
+
* timeout: 600000 // 10 minutes for very slow finality
|
|
69
|
+
* }
|
|
70
|
+
* }
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
20
74
|
export interface WebSocketConfig {
|
|
75
|
+
/** WebSocket server URL for transaction monitoring */
|
|
21
76
|
url: string;
|
|
77
|
+
/** Maximum reconnection attempts on connection loss (default: 5) */
|
|
22
78
|
reconnectAttempts?: number;
|
|
79
|
+
/** Delay between reconnection attempts in milliseconds (default: 2000) */
|
|
23
80
|
reconnectDelay?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Maximum time to wait for transaction confirmation in milliseconds (default: 300000 / 5 minutes)
|
|
83
|
+
*
|
|
84
|
+
* Configure based on blockchain finality time:
|
|
85
|
+
* - Ethereum/GalaChain: 300000ms (5 minutes) ✅ Default
|
|
86
|
+
* - Polygon: 120000ms (2 minutes)
|
|
87
|
+
* - Solana: 30000ms (30 seconds)
|
|
88
|
+
* - Custom: Adjust to match your blockchain's block time + finality buffer
|
|
89
|
+
*/
|
|
24
90
|
timeout?: number;
|
|
25
91
|
}
|
|
26
|
-
export declare class WebSocketService {
|
|
92
|
+
export declare class WebSocketService extends LoggerBase {
|
|
27
93
|
private socket;
|
|
28
94
|
private config;
|
|
29
95
|
private listeners;
|
|
@@ -31,8 +97,25 @@ export declare class WebSocketService {
|
|
|
31
97
|
private reconnectCount;
|
|
32
98
|
private debug;
|
|
33
99
|
private isSocketIOAvailable;
|
|
34
|
-
private readonly logger;
|
|
35
100
|
private hasOnAnyListener;
|
|
101
|
+
/**
|
|
102
|
+
* CRITICAL FIX FOR RACE CONDITION:
|
|
103
|
+
* Buffers bundler events that arrive before their listeners are registered.
|
|
104
|
+
*
|
|
105
|
+
* **The Problem:**
|
|
106
|
+
* 1. SDK sends HTTP request to bundler
|
|
107
|
+
* 2. Bundler processes synchronously and sends "PROCESSED" event immediately
|
|
108
|
+
* 3. Event arrives over WebSocket before SDK registers listener
|
|
109
|
+
* 4. Event is lost forever, SDK hangs waiting for confirmation
|
|
110
|
+
*
|
|
111
|
+
* **The Solution:**
|
|
112
|
+
* Use a catch-all listener to buffer ALL bundler events, regardless of
|
|
113
|
+
* when the specific transactionId listener is registered. This ensures
|
|
114
|
+
* no events are ever lost, even if they arrive milliseconds early.
|
|
115
|
+
*/
|
|
116
|
+
private eventBuffer;
|
|
117
|
+
private eventBufferTimeouts;
|
|
118
|
+
private readonly MAX_BUFFER_SIZE;
|
|
36
119
|
constructor(config: WebSocketConfig, debug?: boolean);
|
|
37
120
|
/**
|
|
38
121
|
* Check if Socket.IO is available in the current environment
|
|
@@ -45,8 +128,23 @@ export declare class WebSocketService {
|
|
|
45
128
|
connect(): Promise<void>;
|
|
46
129
|
/**
|
|
47
130
|
* Monitor a specific transaction
|
|
131
|
+
*
|
|
132
|
+
* CRITICAL: This method checks for buffered events first.
|
|
133
|
+
* If an event arrived before this listener was registered,
|
|
134
|
+
* it will be delivered immediately from the buffer.
|
|
135
|
+
* This prevents transactions from hanging due to race conditions.
|
|
48
136
|
*/
|
|
49
137
|
monitorTransaction(transactionId: string, callback: (status: TransactionStatus) => void): Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* CRITICAL: Shared event processing logic for both real-time and buffered events
|
|
140
|
+
* Extracts common parsing and status mapping from socket listener
|
|
141
|
+
* Allows both paths (live events + buffered events) to use identical logic
|
|
142
|
+
*
|
|
143
|
+
* @param transactionId - The transaction to process
|
|
144
|
+
* @param data - The raw event data
|
|
145
|
+
* @param callback - The listener callback to invoke
|
|
146
|
+
*/
|
|
147
|
+
private processTransactionEvent;
|
|
50
148
|
/**
|
|
51
149
|
* Wait for transaction completion
|
|
52
150
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebSocketService.d.ts","sourceRoot":"","sources":["../../src/services/WebSocketService.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAM,MAAM,EAAE,MAAM,kBAAkB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IACtD,OAAO,CAAC,mBAAmB,CAA0C;IACrE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAQ;gBAE5B,MAAM,EAAE,eAAe,EAAE,KAAK,GAAE,OAAe;IAc3D;;;OAGG;IACH,OAAO,CAAC,yBAAyB;IAiBjC;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAiI9B;;;;;;;OAOG;IACG,kBAAkB,CACtB,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,GAC5C,OAAO,CAAC,IAAI,CAAC;IA2FhB;;;;;;;;OAQG;IACH,OAAO,CAAC,uBAAuB;IA2F/B;;OAEG;IACG,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAY3E;;OAEG;IACH,OAAO,CAAC,eAAe;IAKvB;;OAEG;YACW,eAAe;IAmB7B;;OAEG;IACH,UAAU,IAAI,IAAI;IAoClB;;OAEG;IACH,WAAW,IAAI,OAAO;IAItB;;;;;;;;;;;;OAYG;IACH,SAAS,IAAI,MAAM,GAAG,IAAI;CAG3B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock Logger for testing
|
|
3
|
+
* Captures all logging calls for assertion in tests
|
|
4
|
+
* (Does not implement Logger class due to private properties;
|
|
5
|
+
* uses duck typing for test assertions)
|
|
6
|
+
*/
|
|
7
|
+
export declare class MockLogger {
|
|
8
|
+
debugCalls: string[];
|
|
9
|
+
infoCalls: string[];
|
|
10
|
+
warnCalls: string[];
|
|
11
|
+
errorCalls: string[];
|
|
12
|
+
debug(message: string, _context?: any): void;
|
|
13
|
+
info(message: string, _context?: any): void;
|
|
14
|
+
warn(message: string, _context?: any): void;
|
|
15
|
+
error(message: string, _context?: any): void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=logger.mock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.mock.d.ts","sourceRoot":"","sources":["../../../src/services/__mocks__/logger.mock.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,qBAAa,UAAU;IACrB,UAAU,EAAE,MAAM,EAAE,CAAM;IAC1B,SAAS,EAAE,MAAM,EAAE,CAAM;IACzB,SAAS,EAAE,MAAM,EAAE,CAAM;IACzB,UAAU,EAAE,MAAM,EAAE,CAAM;IAE1B,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,GAAG,GAAG,IAAI;IAI5C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,GAAG,GAAG,IAAI;IAI3C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,GAAG,GAAG,IAAI;IAI3C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,GAAG,GAAG,IAAI;CAG7C"}
|
package/dist/types/common.d.ts
CHANGED
|
@@ -63,6 +63,8 @@ export interface SDKConfig {
|
|
|
63
63
|
headers?: Record<string, string>;
|
|
64
64
|
/** Whether to enable debug logging */
|
|
65
65
|
debug?: boolean;
|
|
66
|
+
/** Concurrency level for pricing operations on liquidity positions (default: 5) */
|
|
67
|
+
pricingConcurrency?: number;
|
|
66
68
|
}
|
|
67
69
|
/**
|
|
68
70
|
* Standard error response from the backend
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,OAAO;IACtC,mDAAmD;IACnD,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qBAAqB;IACrB,OAAO,E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,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,aAAa,GAAG,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composite Pool Data Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Complete pool state required for offline DEX quote calculations.
|
|
5
|
+
* Integrates @gala-chain/dex types with SDK patterns.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
import type { TokenBalance } from '@gala-chain/api';
|
|
10
|
+
import type { Pool, TickData, CompositePoolDto } from '@gala-chain/dex';
|
|
11
|
+
/**
|
|
12
|
+
* Options for fetching composite pool data
|
|
13
|
+
* @category DEX Pools
|
|
14
|
+
*/
|
|
15
|
+
export interface FetchCompositePoolDataOptions {
|
|
16
|
+
/** First token in the pair */
|
|
17
|
+
token0: string;
|
|
18
|
+
/** Second token in the pair */
|
|
19
|
+
token1: string;
|
|
20
|
+
/** Fee tier (500 = 0.05%, 3000 = 0.30%, 10000 = 1.00%) */
|
|
21
|
+
fee: number;
|
|
22
|
+
/** Optional: Use GalaChain mainnet (default) or custom gateway URL */
|
|
23
|
+
gatewayBaseUrl?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Composite pool data result
|
|
27
|
+
* Contains complete pool state for offline calculations
|
|
28
|
+
* @category DEX Pools
|
|
29
|
+
*/
|
|
30
|
+
export interface CompositePoolDataResult {
|
|
31
|
+
/** Pool instance with liquidity and price data */
|
|
32
|
+
pool: Pool;
|
|
33
|
+
/** Tick data map for liquidity calculations */
|
|
34
|
+
tickDataMap: Record<string, TickData>;
|
|
35
|
+
/** Token0 balance in the pool */
|
|
36
|
+
token0Balance: TokenBalance;
|
|
37
|
+
/** Token1 balance in the pool */
|
|
38
|
+
token1Balance: TokenBalance;
|
|
39
|
+
/** Token0 decimal precision */
|
|
40
|
+
token0Decimals: number;
|
|
41
|
+
/** Token1 decimal precision */
|
|
42
|
+
token1Decimals: number;
|
|
43
|
+
/** Raw CompositePoolDto for advanced usage */
|
|
44
|
+
compositePoolDto: CompositePoolDto;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Options for DEX pool quote calculations
|
|
48
|
+
*
|
|
49
|
+
* REQUIRED: Composite pool data must be fetched first via fetchCompositePoolData()
|
|
50
|
+
* This enables true offline quote calculations using local bonding curve math.
|
|
51
|
+
*
|
|
52
|
+
* @category DEX Quotes
|
|
53
|
+
*/
|
|
54
|
+
export interface CalculateDexPoolQuoteOptions {
|
|
55
|
+
/**
|
|
56
|
+
* REQUIRED: Pre-fetched composite pool data from fetchCompositePoolData()
|
|
57
|
+
*
|
|
58
|
+
* This contains the complete pool state needed for local offline quote calculations.
|
|
59
|
+
* Composite data is fetched separately and reused for multiple quote calculations.
|
|
60
|
+
*/
|
|
61
|
+
compositePoolData: CompositePoolDataResult;
|
|
62
|
+
/** Token to trade from (full pipe-delimited format: "GALA|Unit|none|none") */
|
|
63
|
+
fromToken: string;
|
|
64
|
+
/** Token to trade to (full pipe-delimited format: "Token|Unit|SYMBOL|additionalKey") */
|
|
65
|
+
toToken: string;
|
|
66
|
+
/** Amount to trade (in token base units) */
|
|
67
|
+
amount: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* DEX pool quote calculation result
|
|
71
|
+
* @category DEX Quotes
|
|
72
|
+
*/
|
|
73
|
+
export interface DexPoolQuoteResult {
|
|
74
|
+
/** Input amount (tokens spent) */
|
|
75
|
+
amount0: string;
|
|
76
|
+
/** Output amount (tokens received) */
|
|
77
|
+
amount1: string;
|
|
78
|
+
/** Square root price before swap */
|
|
79
|
+
currentSqrtPrice: string;
|
|
80
|
+
/** Square root price after swap */
|
|
81
|
+
newSqrtPrice: string;
|
|
82
|
+
/** Price impact percentage (optional) */
|
|
83
|
+
priceImpact?: string;
|
|
84
|
+
/** Execution price (output per unit input) (optional) */
|
|
85
|
+
executionPrice?: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Raw response from GalaChain GetCompositePool API
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
91
|
+
export interface GetCompositePoolResponse {
|
|
92
|
+
Status: number;
|
|
93
|
+
Message: string;
|
|
94
|
+
Data: {
|
|
95
|
+
pool: any;
|
|
96
|
+
tickDataMap: Record<string, any>;
|
|
97
|
+
token0Balance: any;
|
|
98
|
+
token1Balance: any;
|
|
99
|
+
token0Decimals: number;
|
|
100
|
+
token1Decimals: number;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=composite-pool.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composite-pool.dto.d.ts","sourceRoot":"","sources":["../../src/types/composite-pool.dto.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExE;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC5C,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IAEf,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IAEf,0DAA0D;IAC1D,GAAG,EAAE,MAAM,CAAC;IAEZ,sEAAsE;IACtE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,kDAAkD;IAClD,IAAI,EAAE,IAAI,CAAC;IAEX,+CAA+C;IAC/C,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAEtC,iCAAiC;IACjC,aAAa,EAAE,YAAY,CAAC;IAE5B,iCAAiC;IACjC,aAAa,EAAE,YAAY,CAAC;IAE5B,+BAA+B;IAC/B,cAAc,EAAE,MAAM,CAAC;IAEvB,+BAA+B;IAC/B,cAAc,EAAE,MAAM,CAAC;IAEvB,8CAA8C;IAC9C,gBAAgB,EAAE,gBAAgB,CAAC;CACpC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;;;OAKG;IACH,iBAAiB,EAAE,uBAAuB,CAAC;IAE3C,8EAA8E;IAC9E,SAAS,EAAE,MAAM,CAAC;IAElB,wFAAwF;IACxF,OAAO,EAAE,MAAM,CAAC;IAEhB,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAEhB,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAEhB,oCAAoC;IACpC,gBAAgB,EAAE,MAAM,CAAC;IAEzB,mCAAmC;IACnC,YAAY,EAAE,MAAM,CAAC;IAErB,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,yDAAyD;IACzD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE;QACJ,IAAI,EAAE,GAAG,CAAC;QACV,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACjC,aAAa,EAAE,GAAG,CAAC;QACnB,aAAa,EAAE,GAAG,CAAC;QACnB,cAAc,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;CACH"}
|
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
|
-
* Complete DEX pool data structure (
|
|
10
|
+
* Complete DEX pool data structure (21 fields from backend + optional pricing)
|
|
11
11
|
*
|
|
12
12
|
* Represents a single liquidity pool on the GalaSwap DEX with full metrics.
|
|
13
|
+
* Pricing fields are optional and populated via quote-based enrichment when requested.
|
|
13
14
|
*/
|
|
14
15
|
export interface DexPoolData {
|
|
15
16
|
/** Pool identifier (e.g., "GALA|Unit|none|none/GUSDC|Unit|none|none/10000") */
|
|
@@ -24,10 +25,6 @@ export interface DexPoolData {
|
|
|
24
25
|
token0Image: string;
|
|
25
26
|
/** Second token image URL */
|
|
26
27
|
token1Image: string;
|
|
27
|
-
/** First token price in terms of second token */
|
|
28
|
-
token0Price: string;
|
|
29
|
-
/** Second token price in terms of first token */
|
|
30
|
-
token1Price: string;
|
|
31
28
|
/** Human-readable pool name (e.g., "GALA/GUSDC") */
|
|
32
29
|
poolName: string;
|
|
33
30
|
/** Fee tier as percentage string (e.g., "0.3", "1") */
|
|
@@ -52,6 +49,24 @@ export interface DexPoolData {
|
|
|
52
49
|
dayPerTvl: number;
|
|
53
50
|
/** 1-day APR percentage (calculated from fees) */
|
|
54
51
|
apr1d: number;
|
|
52
|
+
/**
|
|
53
|
+
* First token price in USD (optional, quote-based enrichment)
|
|
54
|
+
*
|
|
55
|
+
* Derived from `getSwapQuoteExactInput(token0, 'GUSDC', '1')` when `withPrices: true`.
|
|
56
|
+
* Not populated by default - use withPrices option to enable.
|
|
57
|
+
*
|
|
58
|
+
* @optional
|
|
59
|
+
*/
|
|
60
|
+
token0Price?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Second token price in USD (optional, quote-based enrichment)
|
|
63
|
+
*
|
|
64
|
+
* Derived from `getSwapQuoteExactInput(token1, 'GUSDC', '1')` when `withPrices: true`.
|
|
65
|
+
* Not populated by default - use withPrices option to enable.
|
|
66
|
+
*
|
|
67
|
+
* @optional
|
|
68
|
+
*/
|
|
69
|
+
token1Price?: string;
|
|
55
70
|
}
|
|
56
71
|
/**
|
|
57
72
|
* Backend-validated sort field options
|
|
@@ -135,6 +150,41 @@ export interface FetchDexPoolsOptions {
|
|
|
135
150
|
* @optional
|
|
136
151
|
*/
|
|
137
152
|
limit?: number;
|
|
153
|
+
/**
|
|
154
|
+
* Enrich pools with real-time token pricing via quote-based enrichment
|
|
155
|
+
*
|
|
156
|
+
* When enabled, each pool is enriched with `token0Price` and `token1Price` fields
|
|
157
|
+
* derived from `getSwapQuoteExactInput(token, 'GUSDC', '1')` to determine USD prices.
|
|
158
|
+
*
|
|
159
|
+
* Pricing is done in parallel with configurable concurrency (default: 5).
|
|
160
|
+
* Failed pricing requests degrade gracefully - pools without prices still include
|
|
161
|
+
* all other metrics (TVL, volume, APR).
|
|
162
|
+
*
|
|
163
|
+
* Default: false (no pricing enrichment)
|
|
164
|
+
*
|
|
165
|
+
* Performance overhead:
|
|
166
|
+
* - 20 pools: ~200-500ms additional
|
|
167
|
+
* - 100 pools: ~1-2 seconds additional
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* ```typescript
|
|
171
|
+
* // Fetch pools with pricing
|
|
172
|
+
* const result = await sdk.fetchDexPools({
|
|
173
|
+
* sortBy: 'tvl',
|
|
174
|
+
* limit: 20,
|
|
175
|
+
* withPrices: true // Enable quote-based pricing enrichment
|
|
176
|
+
* });
|
|
177
|
+
*
|
|
178
|
+
* result.pools.forEach(pool => {
|
|
179
|
+
* const token0Price = pool.token0Price || 'N/A';
|
|
180
|
+
* const token1Price = pool.token1Price || 'N/A';
|
|
181
|
+
* console.log(`${pool.poolName}: ${token0Price} / ${token1Price}`);
|
|
182
|
+
* });
|
|
183
|
+
* ```
|
|
184
|
+
*
|
|
185
|
+
* @optional
|
|
186
|
+
*/
|
|
187
|
+
withPrices?: boolean;
|
|
138
188
|
}
|
|
139
189
|
/**
|
|
140
190
|
* Clean result for paginated DEX pool queries
|
|
@@ -171,4 +221,5 @@ export interface DexPoolsResult {
|
|
|
171
221
|
/** Whether there are pages before current */
|
|
172
222
|
hasPrevious: boolean;
|
|
173
223
|
}
|
|
224
|
+
export type { FetchCompositePoolDataOptions, CompositePoolDataResult, CalculateDexPoolQuoteOptions, DexPoolQuoteResult, GetCompositePoolResponse, } from './composite-pool.dto';
|
|
174
225
|
//# sourceMappingURL=dex-pool.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dex-pool.dto.d.ts","sourceRoot":"","sources":["../../src/types/dex-pool.dto.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH
|
|
1
|
+
{"version":3,"file":"dex-pool.dto.d.ts","sourceRoot":"","sources":["../../src/types/dex-pool.dto.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAC;IAEjB,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAC;IAEjB,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IAEf,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IAEf,4BAA4B;IAC5B,WAAW,EAAE,MAAM,CAAC;IAEpB,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAC;IAEpB,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAC;IAEjB,uDAAuD;IACvD,GAAG,EAAE,MAAM,CAAC;IAEZ,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAC;IAEf,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAElB,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAElB,6BAA6B;IAC7B,YAAY,EAAE,MAAM,CAAC;IAErB,8BAA8B;IAC9B,YAAY,EAAE,MAAM,CAAC;IAErB,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAC;IAEZ,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAC;IAEjB,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAElB,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAElB,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE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only tokenImage: string;
|
|
18
18
|
readonly preBuyQuantity: string;
|
|
19
|
-
readonly websiteUrl
|
|
20
|
-
readonly telegramUrl
|
|
21
|
-
readonly twitterUrl
|
|
19
|
+
readonly websiteUrl?: string;
|
|
20
|
+
readonly telegramUrl?: string;
|
|
21
|
+
readonly twitterUrl?: string;
|
|
22
22
|
readonly tokenCategory: string;
|
|
23
23
|
readonly tokenCollection: string;
|
|
24
24
|
readonly reverseBondingCurveConfiguration?: {
|
|
@@ -32,9 +32,9 @@ export declare class CreateSaleDto extends ChainCallDTO {
|
|
|
32
32
|
tokenDescription: string;
|
|
33
33
|
tokenImage: string;
|
|
34
34
|
preBuyQuantity: string;
|
|
35
|
-
websiteUrl
|
|
36
|
-
telegramUrl
|
|
37
|
-
twitterUrl
|
|
35
|
+
websiteUrl?: string;
|
|
36
|
+
telegramUrl?: string;
|
|
37
|
+
twitterUrl?: string;
|
|
38
38
|
tokenCategory: string;
|
|
39
39
|
tokenCollection: string;
|
|
40
40
|
reverseBondingCurveConfiguration?: {
|
package/dist/types/dto.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dto.d.ts","sourceRoot":"","sources":["../../src/types/dto.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAExD;;;GAGG;AACH,qBAAa,aAAc,SAAQ,YAAY;IAC7C,SAAgB,SAAS,EAAE,MAAM,CAAC;IAClC,SAAgB,WAAW,EAAE,MAAM,CAAC;IACpC,SAAgB,gBAAgB,EAAE,MAAM,CAAC;IACzC,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,cAAc,EAAE,MAAM,CAAC;IACvC,SAAgB,UAAU,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"dto.d.ts","sourceRoot":"","sources":["../../src/types/dto.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MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,SAAS,CAAC;IACrB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized EIP-712 Type Definitions for Bundler Operations
|
|
3
|
+
*
|
|
4
|
+
* These type definitions are used for EIP-712 signing with ethers.js for all bundler operations.
|
|
5
|
+
* They are manually defined (not auto-generated) because SigningClient auto-generation incorrectly
|
|
6
|
+
* uses uint256 for ALL numeric fields, which rejects negative tick values. These definitions
|
|
7
|
+
* use int256 for tick values to properly support negative ticks.
|
|
8
|
+
*
|
|
9
|
+
* EIP-712 Specification: https://eips.ethereum.org/EIPS/eip-712
|
|
10
|
+
* GalaChain Bundler Documentation: https://docs.galachain.com/bundler/signing (when available)
|
|
11
|
+
* GalaChain API Reference: https://docs.galachain.com/bundler/api
|
|
12
|
+
*
|
|
13
|
+
* Integration Points:
|
|
14
|
+
* - Used by GSwapService.sendAddLiquidityToBundler()
|
|
15
|
+
* - Used by GSwapService.sendRemoveLiquidityToBundler()
|
|
16
|
+
* - Used by GSwapService.sendCollectPositionFeesToBundler()
|
|
17
|
+
* - Used by GSwapService.sendSwapToBundler()
|
|
18
|
+
*
|
|
19
|
+
* Key Design Decisions:
|
|
20
|
+
* - Token field order (additionalKey, category, collection, type) must be consistent across all types
|
|
21
|
+
* to ensure proper token identification in bundler state locking
|
|
22
|
+
* - All tick boundaries (tickLower, tickUpper) use int256 to support negative Uniswap V3 ticks
|
|
23
|
+
* (UQ64.96 encoding requires int256, not uint256)
|
|
24
|
+
* - String amounts (not numeric) to preserve decimal precision across JavaScript/Solidity boundary
|
|
25
|
+
* - Unique domain configuration: { name: 'ethereum', chainId: 1 } for GalaChain compatibility
|
|
26
|
+
* - All operations require prefix field added by calculatePersonalSignPrefix() for bundler validation
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* EIP-712 types for AddLiquidity operation
|
|
30
|
+
*
|
|
31
|
+
* Used when creating a new liquidity position with price or tick boundaries.
|
|
32
|
+
* Creates a concentrated liquidity position in a Uniswap V3 pool.
|
|
33
|
+
*
|
|
34
|
+
* Reference: GalaChain Bundler API - AddLiquidity
|
|
35
|
+
* See: https://docs.galachain.com/bundler/api (when available)
|
|
36
|
+
*/
|
|
37
|
+
export declare const ADD_LIQUIDITY_EIP712_TYPES: {
|
|
38
|
+
AddLiquidity: {
|
|
39
|
+
name: string;
|
|
40
|
+
type: string;
|
|
41
|
+
}[];
|
|
42
|
+
token0: {
|
|
43
|
+
name: string;
|
|
44
|
+
type: string;
|
|
45
|
+
}[];
|
|
46
|
+
token1: {
|
|
47
|
+
name: string;
|
|
48
|
+
type: string;
|
|
49
|
+
}[];
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* EIP-712 types for RemoveLiquidity operation
|
|
53
|
+
*
|
|
54
|
+
* Used when closing a liquidity position and withdrawing tokens.
|
|
55
|
+
* Removes liquidity from a Uniswap V3 position and returns the underlying tokens.
|
|
56
|
+
*
|
|
57
|
+
* Reference: GalaChain Bundler API - RemoveLiquidity
|
|
58
|
+
* See: https://docs.galachain.com/bundler/api (when available)
|
|
59
|
+
*/
|
|
60
|
+
export declare const REMOVE_LIQUIDITY_EIP712_TYPES: {
|
|
61
|
+
RemoveLiquidity: {
|
|
62
|
+
name: string;
|
|
63
|
+
type: string;
|
|
64
|
+
}[];
|
|
65
|
+
token0: {
|
|
66
|
+
name: string;
|
|
67
|
+
type: string;
|
|
68
|
+
}[];
|
|
69
|
+
token1: {
|
|
70
|
+
name: string;
|
|
71
|
+
type: string;
|
|
72
|
+
}[];
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* EIP-712 types for CollectPositionFees operation
|
|
76
|
+
*
|
|
77
|
+
* Used when collecting accumulated trading fees from a liquidity position.
|
|
78
|
+
* Extracts protocol fees earned by the position during trades without modifying liquidity.
|
|
79
|
+
*
|
|
80
|
+
* Reference: GalaChain Bundler API - CollectPositionFees
|
|
81
|
+
* See: https://docs.galachain.com/bundler/api (when available)
|
|
82
|
+
*/
|
|
83
|
+
export declare const COLLECT_FEES_EIP712_TYPES: {
|
|
84
|
+
CollectPositionFees: {
|
|
85
|
+
name: string;
|
|
86
|
+
type: string;
|
|
87
|
+
}[];
|
|
88
|
+
token0: {
|
|
89
|
+
name: string;
|
|
90
|
+
type: string;
|
|
91
|
+
}[];
|
|
92
|
+
token1: {
|
|
93
|
+
name: string;
|
|
94
|
+
type: string;
|
|
95
|
+
}[];
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* EIP-712 types for Swap operation
|
|
99
|
+
*
|
|
100
|
+
* Used when swapping tokens on GalaSwap DEX.
|
|
101
|
+
* Executes a token swap on a Uniswap V3 pool with slippage protection.
|
|
102
|
+
*
|
|
103
|
+
* Reference: GalaChain Bundler API - Swap
|
|
104
|
+
* See: https://docs.galachain.com/bundler/api (when available)
|
|
105
|
+
*/
|
|
106
|
+
export declare const SWAP_EIP712_TYPES: {
|
|
107
|
+
Swap: {
|
|
108
|
+
name: string;
|
|
109
|
+
type: string;
|
|
110
|
+
}[];
|
|
111
|
+
token0: {
|
|
112
|
+
name: string;
|
|
113
|
+
type: string;
|
|
114
|
+
}[];
|
|
115
|
+
token1: {
|
|
116
|
+
name: string;
|
|
117
|
+
type: string;
|
|
118
|
+
}[];
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Standard EIP-712 domain configuration
|
|
122
|
+
*
|
|
123
|
+
* Used consistently across all bundler operations for signature validation.
|
|
124
|
+
* Domain identifies the signing context (application name and chain).
|
|
125
|
+
*
|
|
126
|
+
* Configuration:
|
|
127
|
+
* - name: 'ethereum' - Identifies as Ethereum domain (GalaChain convention)
|
|
128
|
+
* - chainId: 1 - References Ethereum mainnet chainId (GalaChain signing context)
|
|
129
|
+
*
|
|
130
|
+
* This domain ensures that signatures cannot be replayed across different networks
|
|
131
|
+
* or applications. All bundler operations must use this exact domain.
|
|
132
|
+
*
|
|
133
|
+
* Reference: EIP-712 Domain Separator
|
|
134
|
+
* See: https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator
|
|
135
|
+
*/
|
|
136
|
+
export declare const EIP712_DOMAIN: {
|
|
137
|
+
name: string;
|
|
138
|
+
chainId: number;
|
|
139
|
+
};
|
|
140
|
+
//# sourceMappingURL=eip712-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eip712-types.d.ts","sourceRoot":"","sources":["../../src/types/eip712-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;CA2BtC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;CAyBzC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;CAwBrC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;CAwB7B,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,aAAa;;;CAAmC,CAAC"}
|