@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
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GalaChain Gateway and DEX Backend API Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Comprehensive, fully-typed definitions for all API responses from:
|
|
5
|
+
* - GalaChain Gateway (DEX contract endpoints)
|
|
6
|
+
* - DEX Backend API
|
|
7
|
+
*
|
|
8
|
+
* Zero `any` types, complete type safety across all API operations.
|
|
9
|
+
*/
|
|
10
|
+
import BigNumber from 'bignumber.js';
|
|
11
|
+
/**
|
|
12
|
+
* GalaChain Gateway response wrapper
|
|
13
|
+
* All Gateway responses wrap the actual data in this structure
|
|
14
|
+
*/
|
|
15
|
+
export interface GalaChainGatewayResponse<T> {
|
|
16
|
+
Data: T;
|
|
17
|
+
Status: number;
|
|
18
|
+
Message?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Token class key structure used in API responses
|
|
22
|
+
*/
|
|
23
|
+
export interface TokenClassKey {
|
|
24
|
+
collection: string;
|
|
25
|
+
category: string;
|
|
26
|
+
type: string;
|
|
27
|
+
additionalKey: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Pool data from GetPoolData endpoint
|
|
31
|
+
* Complete Uniswap V3 pool state including tick, liquidity, fees
|
|
32
|
+
*/
|
|
33
|
+
export interface GalaChainPoolData {
|
|
34
|
+
token0: TokenClassKey;
|
|
35
|
+
token1: TokenClassKey;
|
|
36
|
+
fee: number;
|
|
37
|
+
tickSpacing: number;
|
|
38
|
+
liquidity: string;
|
|
39
|
+
sqrtPriceX96: string;
|
|
40
|
+
tick: number;
|
|
41
|
+
feeGrowthGlobal0X128: string;
|
|
42
|
+
feeGrowthGlobal1X128: string;
|
|
43
|
+
maxLiquidityPerTick?: string;
|
|
44
|
+
observations?: Array<{
|
|
45
|
+
blockTimestamp: number;
|
|
46
|
+
tickCumulative: number;
|
|
47
|
+
secondsPerLiquidityCumulativeX128: string;
|
|
48
|
+
initialized: boolean;
|
|
49
|
+
}>;
|
|
50
|
+
currentPrice?: string;
|
|
51
|
+
token0Decimals?: number;
|
|
52
|
+
token1Decimals?: number;
|
|
53
|
+
initialized?: boolean;
|
|
54
|
+
poolAddress?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Individual position data from GetPositions endpoint
|
|
58
|
+
* Represents a concentrated liquidity position in a pool
|
|
59
|
+
*/
|
|
60
|
+
export interface GalaChainPosition {
|
|
61
|
+
positionId: string;
|
|
62
|
+
owner: string;
|
|
63
|
+
token0: TokenClassKey;
|
|
64
|
+
token1: TokenClassKey;
|
|
65
|
+
fee: number;
|
|
66
|
+
tickLower: number;
|
|
67
|
+
tickUpper: number;
|
|
68
|
+
liquidity: string;
|
|
69
|
+
feeGrowthInside0LastX128: string;
|
|
70
|
+
feeGrowthInside1LastX128: string;
|
|
71
|
+
tokensOwed0: string;
|
|
72
|
+
tokensOwed1: string;
|
|
73
|
+
amount0?: string;
|
|
74
|
+
amount1?: string;
|
|
75
|
+
feeAmount0?: string;
|
|
76
|
+
feeAmount1?: string;
|
|
77
|
+
createdAt?: number;
|
|
78
|
+
updatedAt?: number;
|
|
79
|
+
operator?: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Response from GetPositions endpoint
|
|
83
|
+
* Can return multiple positions for a wallet/criteria
|
|
84
|
+
*/
|
|
85
|
+
export interface GalaChainGetPositionsResponse {
|
|
86
|
+
positions: GalaChainPosition[];
|
|
87
|
+
count: number;
|
|
88
|
+
totalLiquidity?: string;
|
|
89
|
+
totalValue?: string;
|
|
90
|
+
nextBookMark?: string;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Estimated amounts when removing liquidity
|
|
94
|
+
* From GetRemoveLiquidityEstimation endpoint
|
|
95
|
+
*/
|
|
96
|
+
export interface GalaChainRemoveLiquidityEstimation {
|
|
97
|
+
amount0: string;
|
|
98
|
+
amount1: string;
|
|
99
|
+
fee0: string;
|
|
100
|
+
fee1: string;
|
|
101
|
+
liquidity: string;
|
|
102
|
+
tickLower: number;
|
|
103
|
+
tickUpper: number;
|
|
104
|
+
currentPrice?: string;
|
|
105
|
+
token0Symbol?: string;
|
|
106
|
+
token1Symbol?: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* User asset from DEX Backend API
|
|
110
|
+
* Represents a token in a user's wallet on the DEX
|
|
111
|
+
*/
|
|
112
|
+
export interface DexBackendUserAsset {
|
|
113
|
+
tokenId: TokenClassKey | string;
|
|
114
|
+
symbol: string;
|
|
115
|
+
name: string;
|
|
116
|
+
decimals: number;
|
|
117
|
+
balance: string | BigNumber;
|
|
118
|
+
contractAddress?: string;
|
|
119
|
+
imageUrl?: string;
|
|
120
|
+
verified?: boolean;
|
|
121
|
+
trading?: boolean;
|
|
122
|
+
walletAddress?: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Response from DEX Backend getUserAssets endpoint
|
|
126
|
+
* List of all tokens user holds on the DEX
|
|
127
|
+
*/
|
|
128
|
+
export interface DexBackendUserAssetsResponse {
|
|
129
|
+
tokens: DexBackendUserAsset[];
|
|
130
|
+
count: number;
|
|
131
|
+
totalValue?: string;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Request to GetPoolData endpoint
|
|
135
|
+
*/
|
|
136
|
+
export interface GalaChainGetPoolDataRequest {
|
|
137
|
+
tokenA: TokenClassKey | string;
|
|
138
|
+
tokenB: TokenClassKey | string;
|
|
139
|
+
feeTier: number;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Request to GetPositions endpoint
|
|
143
|
+
* Multiple query filters supported
|
|
144
|
+
*/
|
|
145
|
+
export interface GalaChainGetPositionsRequest {
|
|
146
|
+
owner?: string;
|
|
147
|
+
tokenA?: TokenClassKey | string;
|
|
148
|
+
tokenB?: TokenClassKey | string;
|
|
149
|
+
feeTier?: number;
|
|
150
|
+
positionId?: string;
|
|
151
|
+
limit?: number;
|
|
152
|
+
bookmark?: string;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Request to GetRemoveLiquidityEstimation endpoint
|
|
156
|
+
*/
|
|
157
|
+
export interface GalaChainGetRemoveLiquidityEstimationRequest {
|
|
158
|
+
tokenA: TokenClassKey | string;
|
|
159
|
+
tokenB: TokenClassKey | string;
|
|
160
|
+
fee: number;
|
|
161
|
+
tickLower: number;
|
|
162
|
+
tickUpper: number;
|
|
163
|
+
liquidity: string;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Request to DEX Backend getUserAssets endpoint
|
|
167
|
+
*/
|
|
168
|
+
export interface DexBackendGetUserAssetsRequest {
|
|
169
|
+
walletAddress: string;
|
|
170
|
+
limit?: number;
|
|
171
|
+
offset?: number;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Standard API error response
|
|
175
|
+
*/
|
|
176
|
+
export interface ApiErrorResponse {
|
|
177
|
+
Status: number;
|
|
178
|
+
Message: string;
|
|
179
|
+
Data?: Record<string, unknown>;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Parsed error with context
|
|
183
|
+
*/
|
|
184
|
+
export declare class ApiError extends Error {
|
|
185
|
+
readonly status: number;
|
|
186
|
+
readonly message: string;
|
|
187
|
+
readonly details?: Record<string, unknown> | undefined;
|
|
188
|
+
constructor(status: number, message: string, details?: Record<string, unknown> | undefined);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Check if value is a TokenClassKey
|
|
192
|
+
*/
|
|
193
|
+
export declare function isTokenClassKey(value: unknown): value is TokenClassKey;
|
|
194
|
+
/**
|
|
195
|
+
* Check if value is a GalaChainPoolData response
|
|
196
|
+
*/
|
|
197
|
+
export declare function isGalaChainPoolData(value: unknown): value is GalaChainPoolData;
|
|
198
|
+
/**
|
|
199
|
+
* Check if value is a GalaChainPosition
|
|
200
|
+
*/
|
|
201
|
+
export declare function isGalaChainPosition(value: unknown): value is GalaChainPosition;
|
|
202
|
+
/**
|
|
203
|
+
* Check if value is a DexBackendUserAsset
|
|
204
|
+
*/
|
|
205
|
+
export declare function isDexBackendUserAsset(value: unknown): value is DexBackendUserAsset;
|
|
206
|
+
//# sourceMappingURL=galachain-api.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"galachain-api.types.d.ts","sourceRoot":"","sources":["../../src/types/galachain-api.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC;;;GAGG;AACH,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,IAAI,EAAE,CAAC,CAAC;IACR,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;CACvB;AAMD;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAEhC,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,EAAE,aAAa,CAAC;IAGtB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IAGpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB,EAAE,MAAM,CAAC;IAC7B,oBAAoB,EAAE,MAAM,CAAC;IAG7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,KAAK,CAAC;QACnB,cAAc,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,MAAM,CAAC;QACvB,iCAAiC,EAAE,MAAM,CAAC;QAC1C,WAAW,EAAE,OAAO,CAAC;KACtB,CAAC,CAAC;IAGH,YAAY,CAAC,EAAE,MAAM,C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
|
|
2
|
+
* GSwap SDK Response Types
|
|
3
|
+
*
|
|
4
|
+
* Comprehensive type definitions for all responses from @gala-chain/gswap-sdk.
|
|
5
|
+
* These types eliminate `as any` casts and provide complete type safety for
|
|
6
|
+
* GSwapService wrapper layer.
|
|
7
|
+
*
|
|
8
|
+
* Structure:
|
|
9
|
+
* - GSwap SDK Request/Response Types
|
|
10
|
+
* - Quote Response Types
|
|
11
|
+
* - Swap Result Types
|
|
12
|
+
* - Asset Types
|
|
13
|
+
* - Pool Data Types
|
|
14
|
+
* - Position Types
|
|
15
|
+
* - Error Types
|
|
16
|
+
* - Validators and Type Guards
|
|
17
|
+
*/
|
|
18
|
+
import BigNumber from 'bignumber.js';
|
|
19
|
+
/**
|
|
20
|
+
* GSwap quote response (exact input)
|
|
21
|
+
* Response from gswap.quoting.quoteExactInput()
|
|
22
|
+
*/
|
|
23
|
+
export interface GSwapQuoteExactInputResponse {
|
|
24
|
+
outTokenAmount: BigNumber;
|
|
25
|
+
feeTier: number;
|
|
26
|
+
priceImpact: BigNumber;
|
|
27
|
+
executionPrice?: BigNumber;
|
|
28
|
+
minimumOutputAmount?: BigNumber;
|
|
29
|
+
path?: string[];
|
|
30
|
+
pools?: string[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* GSwap quote response (exact output)
|
|
34
|
+
* Response from gswap.quoting.quoteExactOutput()
|
|
35
|
+
*/
|
|
36
|
+
export interface GSwapQuoteExactOutputResponse {
|
|
37
|
+
inTokenAmount: BigNumber;
|
|
38
|
+
feeTier: number;
|
|
39
|
+
priceImpact: BigNumber;
|
|
40
|
+
executionPrice?: BigNumber;
|
|
41
|
+
maximumInputAmount?: BigNumber;
|
|
42
|
+
path?: string[];
|
|
43
|
+
pools?: string[];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* GSwap token/asset from API
|
|
47
|
+
*/
|
|
48
|
+
export interface GSwapTokenAsset {
|
|
49
|
+
tokenId: string | Record<string, any>;
|
|
50
|
+
tokenClass?: {
|
|
51
|
+
collection: string;
|
|
52
|
+
category: string;
|
|
53
|
+
type: string;
|
|
54
|
+
additionalKey: string;
|
|
55
|
+
};
|
|
56
|
+
symbol: string;
|
|
57
|
+
name?: string;
|
|
58
|
+
decimals: number;
|
|
59
|
+
balance: string | BigNumber;
|
|
60
|
+
contractAddress?: string;
|
|
61
|
+
imageUrl?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* GSwap user assets response
|
|
65
|
+
* Response from gswap.assets.getUserAssets()
|
|
66
|
+
*/
|
|
67
|
+
export interface GSwapUserAssetsResponse {
|
|
68
|
+
tokens: GSwapTokenAsset[];
|
|
69
|
+
count: number;
|
|
70
|
+
totalValue?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* GSwap pool data (raw from API)
|
|
74
|
+
* Response from gswap.pools.getPoolData()
|
|
75
|
+
*/
|
|
76
|
+
export interface GSwapPoolDataRaw {
|
|
77
|
+
tokenA: string | Record<string, any>;
|
|
78
|
+
tokenB: string | Record<string, any>;
|
|
79
|
+
feeTier: number;
|
|
80
|
+
liquidity: string | BigNumber;
|
|
81
|
+
sqrtPriceX96: string | BigNumber;
|
|
82
|
+
tick: number;
|
|
83
|
+
tickSpacing: number;
|
|
84
|
+
feeGrowthGlobal0X128: string | BigNumber;
|
|
85
|
+
feeGrowthGlobal1X128: string | BigNumber;
|
|
86
|
+
currentPrice?: string | BigNumber;
|
|
87
|
+
token0Decimals?: number;
|
|
88
|
+
token1Decimals?: number;
|
|
89
|
+
fee?: number;
|
|
90
|
+
poolAddress?: string;
|
|
91
|
+
initialized?: boolean;
|
|
92
|
+
observations?: any[];
|
|
93
|
+
maxLiquidityPerTick?: string;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* GSwap pool info
|
|
97
|
+
* Simplified pool structure
|
|
98
|
+
*/
|
|
99
|
+
export interface GSwapPoolInfo {
|
|
100
|
+
tokenA: string;
|
|
101
|
+
tokenB: string;
|
|
102
|
+
feeTier: number;
|
|
103
|
+
liquidity: string;
|
|
104
|
+
currentPrice?: string;
|
|
105
|
+
tick?: number;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* GSwap position data (from list query)
|
|
109
|
+
* Individual position from gswap.positions.getUserPositions() response
|
|
110
|
+
*/
|
|
111
|
+
export interface GSwapPositionData {
|
|
112
|
+
positionId: string;
|
|
113
|
+
tokenId: string | number;
|
|
114
|
+
token0: string | Record<string, any>;
|
|
115
|
+
token1: string | Record<string, any>;
|
|
116
|
+
fee: number;
|
|
117
|
+
feeTier?: number;
|
|
118
|
+
tickLower: number;
|
|
119
|
+
tickUpper: number;
|
|
120
|
+
liquidity: string | BigNumber;
|
|
121
|
+
feeGrowthInside0LastX128?: string | BigNumber;
|
|
122
|
+
feeGrowthInside1LastX128?: string | BigNumber;
|
|
123
|
+
tokensOwed0?: string | BigNumber;
|
|
124
|
+
tokensOwed1?: string | BigNumber;
|
|
125
|
+
amount0?: string | BigNumber;
|
|
126
|
+
amount1?: string | BigNumber;
|
|
127
|
+
feeAmount0?: string | BigNumber;
|
|
128
|
+
feeAmount1?: string | BigNumber;
|
|
129
|
+
createdAt?: number;
|
|
130
|
+
updatedAt?: number;
|
|
131
|
+
owner?: string;
|
|
132
|
+
operator?: string;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* GSwap user positions response
|
|
136
|
+
* Response from gswap.positions.getUserPositions()
|
|
137
|
+
* Supports both paginated (with nextBookmark) and non-paginated response formats
|
|
138
|
+
*/
|
|
139
|
+
export interface GSwapUserPositionsResponse {
|
|
140
|
+
positions: GSwapPositionData[];
|
|
141
|
+
count: number;
|
|
142
|
+
totalLiquidity?: string | BigNumber;
|
|
143
|
+
totalValue?: string;
|
|
144
|
+
/** Bookmark for fetching next page of results (if pagination is supported by API) - API returns nextBookMark with capital M */
|
|
145
|
+
nextBookMark?: string;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* GSwap get position result
|
|
149
|
+
* Response from gswap.positions.getPosition()
|
|
150
|
+
*/
|
|
151
|
+
export interface GSwapGetPositionResult {
|
|
152
|
+
position: GSwapPositionData;
|
|
153
|
+
owner: string;
|
|
154
|
+
liquidity: string | BigNumber;
|
|
155
|
+
feeGrowthOutside0X128: string | BigNumber;
|
|
156
|
+
feeGrowthOutside1X128: string | BigNumber;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* GSwap get position by ID result
|
|
160
|
+
* Response from gswap.positions.getPositionById()
|
|
161
|
+
*/
|
|
162
|
+
export interface GSwapGetPositionByIdResult {
|
|
163
|
+
positionId: string;
|
|
164
|
+
owner: string;
|
|
165
|
+
token0: string | Record<string, any>;
|
|
166
|
+
token1: string | Record<string, any>;
|
|
167
|
+
fee: number;
|
|
168
|
+
tickLower: number;
|
|
169
|
+
tickUpper: number;
|
|
170
|
+
liquidity: string | BigNumber;
|
|
171
|
+
feeGrowthInside0LastX128: string | BigNumber;
|
|
172
|
+
feeGrowthInside1LastX128: string | BigNumber;
|
|
173
|
+
tokensOwed0: string | BigNumber;
|
|
174
|
+
tokensOwed1: string | BigNumber;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* GSwap estimate remove liquidity result
|
|
178
|
+
* Response from gswap.positions.estimateRemoveLiquidity()
|
|
179
|
+
*/
|
|
180
|
+
export interface GSwapEstimateRemoveLiquidityResult {
|
|
181
|
+
amount0: string | BigNumber;
|
|
182
|
+
amount1: string | BigNumber;
|
|
183
|
+
fee0: string | BigNumber;
|
|
184
|
+
fee1: string | BigNumber;
|
|
185
|
+
liquidity: string | BigNumber;
|
|
186
|
+
tickLower: number;
|
|
187
|
+
tickUpper: number;
|
|
188
|
+
currentPrice?: string | BigNumber;
|
|
189
|
+
token0Symbol?: string;
|
|
190
|
+
token1Symbol?: string;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* GSwap add liquidity result (pending transaction)
|
|
194
|
+
* Response from gswap.positions.addLiquidityByPrice() or addLiquidityByTicks()
|
|
195
|
+
*/
|
|
196
|
+
export interface GSwapAddLiquidityResult {
|
|
197
|
+
transactionId: string;
|
|
198
|
+
txHash?: string;
|
|
199
|
+
positionId?: string;
|
|
200
|
+
liquidity?: string | BigNumber;
|
|
201
|
+
amount0?: string;
|
|
202
|
+
amount1?: string;
|
|
203
|
+
feeAmount0?: string;
|
|
204
|
+
feeAmount1?: string;
|
|
205
|
+
token0?: string;
|
|
206
|
+
token1?: string;
|
|
207
|
+
feeTier?: number;
|
|
208
|
+
tickLower?: number;
|
|
209
|
+
tickUpper?: number;
|
|
210
|
+
status?: string;
|
|
211
|
+
createdAt?: number;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* GSwap remove liquidity result (pending transaction)
|
|
215
|
+
* Response from gswap.positions.removeLiquidity()
|
|
216
|
+
*/
|
|
217
|
+
export interface GSwapRemoveLiquidityResult {
|
|
218
|
+
transactionId: string;
|
|
219
|
+
txHash?: string;
|
|
220
|
+
amount0?: string | BigNumber;
|
|
221
|
+
amount1?: string | BigNumber;
|
|
222
|
+
status?: string;
|
|
223
|
+
createdAt?: number;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* GSwap collect fees result (pending transaction)
|
|
227
|
+
* Response from gswap.positions.collectPositionFees()
|
|
228
|
+
*/
|
|
229
|
+
export interface GSwapCollectFeesResult {
|
|
230
|
+
transactionId: string;
|
|
231
|
+
txHash?: string;
|
|
232
|
+
fee0?: string | BigNumber;
|
|
233
|
+
fee1?: string | BigNumber;
|
|
234
|
+
status?: string;
|
|
235
|
+
createdAt?: number;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Add liquidity by price parameters (GSwap SDK format)
|
|
239
|
+
*/
|
|
240
|
+
export interface GSwapAddLiquidityByPriceParams {
|
|
241
|
+
token0: string | Record<string, any>;
|
|
242
|
+
token1: string | Record<string, any>;
|
|
243
|
+
fee: number;
|
|
244
|
+
minPrice: string | BigNumber;
|
|
245
|
+
maxPrice: string | BigNumber;
|
|
246
|
+
amount0Desired: string | BigNumber;
|
|
247
|
+
amount1Desired: string | BigNumber;
|
|
248
|
+
amount0Min?: string | BigNumber;
|
|
249
|
+
amount1Min?: string | BigNumber;
|
|
250
|
+
deadline?: number;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Add liquidity by ticks parameters (GSwap SDK format)
|
|
254
|
+
*/
|
|
255
|
+
export interface GSwapAddLiquidityByTicksParams {
|
|
256
|
+
token0: string | Record<string, any>;
|
|
257
|
+
token1: string | Record<string, any>;
|
|
258
|
+
fee: number;
|
|
259
|
+
tickLower: number;
|
|
260
|
+
tickUpper: number;
|
|
261
|
+
amount0Desired: string | BigNumber;
|
|
262
|
+
amount1Desired: string | BigNumber;
|
|
263
|
+
amount0Min?: string | BigNumber;
|
|
264
|
+
amount1Min?: string | BigNumber;
|
|
265
|
+
deadline?: number;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Remove liquidity parameters (GSwap SDK format)
|
|
269
|
+
*/
|
|
270
|
+
export interface GSwapRemoveLiquidityParams {
|
|
271
|
+
tokenId: string | number;
|
|
272
|
+
liquidity: string | BigNumber;
|
|
273
|
+
amount0Min: string | BigNumber;
|
|
274
|
+
amount1Min: string | BigNumber;
|
|
275
|
+
deadline?: number;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Collect position fees parameters (GSwap SDK format)
|
|
279
|
+
*/
|
|
280
|
+
export interface GSwapCollectFeesParams {
|
|
281
|
+
tokenId: string | number;
|
|
282
|
+
amount0Max?: string | BigNumber;
|
|
283
|
+
amount1Max?: string | BigNumber;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* GSwap SDK error response
|
|
287
|
+
*/
|
|
288
|
+
export interface GSwapErrorResponse {
|
|
289
|
+
code?: string;
|
|
290
|
+
message: string;
|
|
291
|
+
details?: Record<string, any>;
|
|
292
|
+
txHash?: string;
|
|
293
|
+
originalError?: any;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* GSwap spot price result
|
|
297
|
+
* Response from gswap.pricing.getSpotPrice() or similar
|
|
298
|
+
*/
|
|
299
|
+
export interface GSwapSpotPriceResult {
|
|
300
|
+
tokenA: string;
|
|
301
|
+
tokenB: string;
|
|
302
|
+
price: string | BigNumber;
|
|
303
|
+
invertedPrice?: string | BigNumber;
|
|
304
|
+
tick?: number;
|
|
305
|
+
liquidity?: string | BigNumber;
|
|
306
|
+
timestamp?: number;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Type guard for GSwapQuoteExactInputResponse
|
|
310
|
+
*/
|
|
311
|
+
export declare function isGSwapQuoteExactInputResponse(value: any): value is GSwapQuoteExactInputResponse;
|
|
312
|
+
/**
|
|
313
|
+
* Type guard for GSwapQuoteExactOutputResponse
|
|
314
|
+
*/
|
|
315
|
+
export declare function isGSwapQuoteExactOutputResponse(value: any): value is GSwapQuoteExactOutputResponse;
|
|
316
|
+
/**
|
|
317
|
+
* Type guard for GSwapUserAssetsResponse
|
|
318
|
+
*/
|
|
319
|
+
export declare function isGSwapUserAssetsResponse(value: any): value is GSwapUserAssetsResponse;
|
|
320
|
+
/**
|
|
321
|
+
* Type guard for GSwapPoolDataRaw
|
|
322
|
+
*/
|
|
323
|
+
export declare function isGSwapPoolDataRaw(value: any): value is GSwapPoolDataRaw;
|
|
324
|
+
/**
|
|
325
|
+
* Type guard for GSwapUserPositionsResponse
|
|
326
|
+
*/
|
|
327
|
+
export declare function isGSwapUserPositionsResponse(value: any): value is GSwapUserPositionsResponse;
|
|
328
|
+
/**
|
|
329
|
+
* Type guard for GSwapPositionData
|
|
330
|
+
*/
|
|
331
|
+
export declare function isGSwapPositionData(value: any): value is GSwapPositionData;
|
|
332
|
+
/**
|
|
333
|
+
* Type guard for GSwapAddLiquidityResult
|
|
334
|
+
*/
|
|
335
|
+
export declare function isGSwapAddLiquidityResult(value: any): value is GSwapAddLiquidityResult;
|
|
336
|
+
/**
|
|
337
|
+
* Type guard for GSwapRemoveLiquidityResult
|
|
338
|
+
*/
|
|
339
|
+
export declare function isGSwapRemoveLiquidityResult(value: any): value is GSwapRemoveLiquidityResult;
|
|
340
|
+
/**
|
|
341
|
+
* Type guard for GSwapCollectFeesResult
|
|
342
|
+
*/
|
|
343
|
+
export declare function isGSwapCollectFeesResult(value: any): value is GSwapCollectFeesResult;
|
|
344
|
+
/**
|
|
345
|
+
* Type guard for transaction result (any pending transaction)
|
|
346
|
+
*/
|
|
347
|
+
export declare function isGSwapTransactionResult(value: any): value is GSwapAddLiquidityResult | GSwapRemoveLiquidityResult | GSwapCollectFeesResult;
|
|
348
|
+
/**
|
|
349
|
+
* Extract transaction ID from various GSwap result types
|
|
350
|
+
*/
|
|
351
|
+
export declare function extractTransactionId(result: any): string | undefined;
|
|
352
|
+
/**
|
|
353
|
+
* Validate BigNumber conversion
|
|
354
|
+
*/
|
|
355
|
+
export declare function isBigNumberLike(value: any): value is BigNumber | {
|
|
356
|
+
toFixed(): string;
|
|
357
|
+
};
|
|
358
|
+
/**
|
|
359
|
+
* Safely convert value to BigNumber
|
|
360
|
+
*/
|
|
361
|
+
export declare function toBigNumberSafe(value: any): BigNumber;
|
|
362
|
+
/**
|
|
363
|
+
* Safely convert value to string (handles BigNumber)
|
|
364
|
+
*/
|
|
365
|
+
export declare function toStringSafe(value: any): string;
|
|
366
|
+
//# sourceMappingURL=gswap-responses.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gswap-responses.types.d.ts","sourceRoot":"","sources":["../../src/types/gswap-responses.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,SAAS,MAAM,cAAc,CAAC;AAMrC;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C,cAAc,EAAE,SAAS,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,SAAS,CAAC;IACvB,cAAc,C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0BAA0B,GAC1B,sBAAsB,CAOzB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,GAAG,GACV,MAAM,GAAG,SAAS,CAkBpB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,GAAG,GACT,KAAK,IAAI,SAAS,GAAG;IAAE,OAAO,IAAI,MAAM,CAAA;CAAE,CAO5C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAQrD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAQ/C"}
|
|
@@ -22,10 +22,12 @@ export interface TokenClass {
|
|
|
22
22
|
*/
|
|
23
23
|
export interface GSwapServiceConfig {
|
|
24
24
|
privateKey?: string | undefined;
|
|
25
|
-
|
|
25
|
+
getWalletAddress: () => string | undefined;
|
|
26
26
|
gatewayBaseUrl?: string | undefined;
|
|
27
27
|
bundlerBaseUrl?: string | undefined;
|
|
28
|
+
galaChainBaseUrl?: string | undefined;
|
|
28
29
|
dexBackendBaseUrl?: string | undefined;
|
|
30
|
+
dexBackendHttp?: any | undefined;
|
|
29
31
|
}
|
|
30
32
|
/**
|
|
31
33
|
* Parameters for getting swap quotes
|
|
@@ -48,6 +50,8 @@ export interface SwapQuoteResult {
|
|
|
48
50
|
feeTier: number;
|
|
49
51
|
priceImpact: string;
|
|
50
52
|
executionPrice: string;
|
|
53
|
+
currentSqrtPrice: string;
|
|
54
|
+
newSqrtPrice: string;
|
|
51
55
|
}
|
|
52
56
|
/**
|
|
53
57
|
* Parameters for executing a swap
|
|
@@ -170,8 +174,8 @@ export interface LiquidityPosition {
|
|
|
170
174
|
amount1: string;
|
|
171
175
|
feeAmount0: string;
|
|
172
176
|
feeAmount1: string;
|
|
173
|
-
createdAt
|
|
174
|
-
updatedAt
|
|
177
|
+
createdAt?: Date;
|
|
178
|
+
updatedAt?: Date;
|
|
175
179
|
}
|
|
176
180
|
/**
|
|
177
181
|
* GSwap position - Type-safe liquidity position from GalaSwap API
|
|
@@ -337,4 +341,55 @@ export interface PriceFromTicksResult {
|
|
|
337
341
|
priceRange: string;
|
|
338
342
|
tickSpread: number;
|
|
339
343
|
}
|
|
344
|
+
/**
|
|
345
|
+
* Pool slot0 data from GetSlot0 API
|
|
346
|
+
* Contains current pool state including price and liquidity
|
|
347
|
+
*/
|
|
348
|
+
export interface PoolSlot0Data {
|
|
349
|
+
sqrtPrice: string;
|
|
350
|
+
tick: number;
|
|
351
|
+
liquidity: string;
|
|
352
|
+
grossPoolLiquidity: string;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Calculated pool price data
|
|
356
|
+
* Combines slot0 data with calculated price
|
|
357
|
+
*/
|
|
358
|
+
export interface PoolPriceData {
|
|
359
|
+
price: string;
|
|
360
|
+
sqrtPrice: string;
|
|
361
|
+
tick: number;
|
|
362
|
+
liquidity: string;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Options for liquidity position queries with optional pricing
|
|
366
|
+
* @agent Controls whether to enrich positions with real-time pricing data
|
|
367
|
+
* @note Concurrency level is controlled by SDK-level pricingConcurrency config (not per-call parameter)
|
|
368
|
+
*/
|
|
369
|
+
export interface GetLiquidityPositionsOptions {
|
|
370
|
+
withPrices?: boolean;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Pricing data for a liquidity position pool
|
|
374
|
+
* @agent Contains current market price and execution estimates for position's token pair
|
|
375
|
+
*/
|
|
376
|
+
export interface PositionPoolPrice {
|
|
377
|
+
token0: string;
|
|
378
|
+
token1: string;
|
|
379
|
+
feeTier: number;
|
|
380
|
+
currentPrice: string;
|
|
381
|
+
executionPrice: string;
|
|
382
|
+
priceImpact: string;
|
|
383
|
+
estimatedOutput: string;
|
|
384
|
+
pricedAt: Date;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Result from fetching liquidity positions with optional pricing
|
|
388
|
+
* @agent Return type for paginated position queries with optional price enrichment
|
|
389
|
+
*/
|
|
390
|
+
export interface GetLiquidityPositionsResult {
|
|
391
|
+
items: GSwapPosition[];
|
|
392
|
+
nextBookmark?: string;
|
|
393
|
+
prices?: Map<string, PositionPoolPrice>;
|
|
394
|
+
}
|
|
340
395
|
//# sourceMappingURL=gswap.dto.d.ts.map
|