@gala-chain/launchpad-sdk 5.0.4-beta.62 → 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.
- package/dist/LaunchpadSDK.d.ts +137 -8
- package/dist/LaunchpadSDK.d.ts.map +1 -1
- package/dist/ai-docs.json +474 -320
- package/dist/config/environments.d.ts +2 -0
- package/dist/config/environments.d.ts.map +1 -1
- package/dist/constants/endpoints.d.ts +44 -0
- package/dist/constants/endpoints.d.ts.map +1 -1
- package/dist/constants/version.generated.d.ts +1 -1
- package/dist/index.browser.d.ts +3 -1
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.esm.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/native.cjs +1 -0
- package/dist/native.d.ts +22 -0
- package/dist/native.d.ts.map +1 -0
- package/dist/native.esm.js +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.esm.js +1 -1
- package/dist/services/ClientConfigService.d.ts +61 -0
- package/dist/services/ClientConfigService.d.ts.map +1 -0
- package/dist/services/DexBackendTradeClient.d.ts +34 -0
- package/dist/services/DexBackendTradeClient.d.ts.map +1 -0
- package/dist/services/DexQuoteService.d.ts +19 -19
- package/dist/services/DexQuoteService.d.ts.map +1 -1
- package/dist/services/GSwapLiquidityMutationService.d.ts +2 -2
- package/dist/services/GSwapLiquidityMutationService.d.ts.map +1 -1
- package/dist/services/GSwapLiquidityQueryService.d.ts +2 -2
- package/dist/services/GSwapLiquidityQueryService.d.ts.map +1 -1
- package/dist/services/GSwapPoolQueryService.d.ts +5 -6
- package/dist/services/GSwapPoolQueryService.d.ts.map +1 -1
- package/dist/services/GSwapService.d.ts +6 -6
- package/dist/services/GSwapService.d.ts.map +1 -1
- package/dist/services/GSwapSwapService.d.ts +0 -2
- package/dist/services/GSwapSwapService.d.ts.map +1 -1
- package/dist/services/GdexStreamService.d.ts +133 -0
- package/dist/services/GdexStreamService.d.ts.map +1 -0
- package/dist/services/IntervalRegistry.d.ts +79 -0
- package/dist/services/IntervalRegistry.d.ts.map +1 -0
- package/dist/services/MultiPoolStateManager.d.ts.map +1 -1
- package/dist/services/NotificationService.d.ts +113 -0
- package/dist/services/NotificationService.d.ts.map +1 -0
- package/dist/src/LaunchpadSDK.d.ts +137 -8
- package/dist/src/LaunchpadSDK.d.ts.map +1 -1
- package/dist/src/config/environments.d.ts +2 -0
- package/dist/src/config/environments.d.ts.map +1 -1
- package/dist/src/constants/endpoints.d.ts +44 -0
- package/dist/src/constants/endpoints.d.ts.map +1 -1
- package/dist/src/constants/version.generated.d.ts +1 -1
- package/dist/src/index.browser.d.ts +3 -1
- package/dist/src/index.browser.d.ts.map +1 -1
- package/dist/src/native.d.ts +22 -0
- package/dist/src/native.d.ts.map +1 -0
- package/dist/src/services/ClientConfigService.d.ts +61 -0
- package/dist/src/services/ClientConfigService.d.ts.map +1 -0
- package/dist/src/services/DexBackendTradeClient.d.ts +34 -0
- package/dist/src/services/DexBackendTradeClient.d.ts.map +1 -0
- package/dist/src/services/DexQuoteService.d.ts +19 -19
- package/dist/src/services/DexQuoteService.d.ts.map +1 -1
- package/dist/src/services/GSwapLiquidityMutationService.d.ts +2 -2
- package/dist/src/services/GSwapLiquidityMutationService.d.ts.map +1 -1
- package/dist/src/services/GSwapLiquidityQueryService.d.ts +2 -2
- package/dist/src/services/GSwapLiquidityQueryService.d.ts.map +1 -1
- package/dist/src/services/GSwapPoolQueryService.d.ts +5 -6
- package/dist/src/services/GSwapPoolQueryService.d.ts.map +1 -1
- package/dist/src/services/GSwapService.d.ts +6 -6
- package/dist/src/services/GSwapService.d.ts.map +1 -1
- package/dist/src/services/GSwapSwapService.d.ts +0 -2
- package/dist/src/services/GSwapSwapService.d.ts.map +1 -1
- package/dist/src/services/GdexStreamService.d.ts +133 -0
- package/dist/src/services/GdexStreamService.d.ts.map +1 -0
- package/dist/src/services/IntervalRegistry.d.ts +79 -0
- package/dist/src/services/IntervalRegistry.d.ts.map +1 -0
- package/dist/src/services/MultiPoolStateManager.d.ts.map +1 -1
- package/dist/src/services/NotificationService.d.ts +113 -0
- package/dist/src/services/NotificationService.d.ts.map +1 -0
- package/dist/src/types/client-config.dto.d.ts +43 -0
- package/dist/src/types/client-config.dto.d.ts.map +1 -0
- package/dist/src/types/common.d.ts +2 -0
- package/dist/src/types/common.d.ts.map +1 -1
- package/dist/src/types/composite-pool.dto.d.ts +0 -2
- package/dist/src/types/composite-pool.dto.d.ts.map +1 -1
- package/dist/src/types/notification.dto.d.ts +92 -0
- package/dist/src/types/notification.dto.d.ts.map +1 -0
- package/dist/src/utils/error-utils.d.ts +5 -0
- package/dist/src/utils/error-utils.d.ts.map +1 -1
- package/dist/src/utils/errors.d.ts +4 -0
- package/dist/src/utils/errors.d.ts.map +1 -1
- package/dist/src/utils/http.d.ts.map +1 -1
- package/dist/types/client-config.dto.d.ts +43 -0
- package/dist/types/client-config.dto.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 +0 -2
- package/dist/types/composite-pool.dto.d.ts.map +1 -1
- package/dist/types/notification.dto.d.ts +92 -0
- package/dist/types/notification.dto.d.ts.map +1 -0
- package/dist/utils/error-utils.d.ts +5 -0
- package/dist/utils/error-utils.d.ts.map +1 -1
- package/dist/utils/errors.d.ts +4 -0
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/http.d.ts.map +1 -1
- package/package.json +50 -11
- package/dist/services/GalaChainGatewayClient.d.ts +0 -227
- package/dist/services/GalaChainGatewayClient.d.ts.map +0 -1
- package/dist/src/services/GalaChainGatewayClient.d.ts +0 -227
- package/dist/src/services/GalaChainGatewayClient.d.ts.map +0 -1
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interval Registry for SDK
|
|
3
|
+
*
|
|
4
|
+
* Centralized tracking for setInterval handles to ensure proper cleanup
|
|
5
|
+
* and prevent memory leaks during SDK disposal.
|
|
6
|
+
*
|
|
7
|
+
* Pattern:
|
|
8
|
+
* 1. registerInterval(setInterval(...)) - tracks the interval
|
|
9
|
+
* 2. unregisterInterval(handle) - removes from registry
|
|
10
|
+
* 3. unregisterAllIntervals() - nuclear cleanup on SDK shutdown
|
|
11
|
+
*
|
|
12
|
+
* @packageDocumentation
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Register an interval handle for centralized tracking.
|
|
16
|
+
*
|
|
17
|
+
* @param handle - The interval ID returned by setInterval
|
|
18
|
+
* @param label - Optional label for debugging (e.g., 'background-warming')
|
|
19
|
+
* @returns The same interval handle for chaining
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const timer = registerInterval(setInterval(() => {
|
|
24
|
+
* // periodic work
|
|
25
|
+
* }, 5000), 'background-warming');
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function registerInterval(handle: number | NodeJS.Timeout, label?: string): number;
|
|
29
|
+
/**
|
|
30
|
+
* Unregister an interval handle from centralized tracking.
|
|
31
|
+
*
|
|
32
|
+
* Should be called alongside clearInterval() for complete cleanup.
|
|
33
|
+
*
|
|
34
|
+
* @param handle - The interval ID to unregister
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* // In cleanup function:
|
|
39
|
+
* unregisterInterval(timer);
|
|
40
|
+
* clearInterval(timer);
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare function unregisterInterval(handle: number | NodeJS.Timeout): void;
|
|
44
|
+
/**
|
|
45
|
+
* Unregister all tracked intervals.
|
|
46
|
+
*
|
|
47
|
+
* Nuclear option - use only during SDK shutdown or test cleanup.
|
|
48
|
+
* Returns count of intervals cleared for monitoring.
|
|
49
|
+
*
|
|
50
|
+
* @returns Number of intervals that were registered
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* // In SDK cleanup:
|
|
55
|
+
* const cleared = unregisterAllIntervals();
|
|
56
|
+
* console.log(`Cleared ${cleared} leaked intervals`);
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare function unregisterAllIntervals(): number;
|
|
60
|
+
/**
|
|
61
|
+
* Get registry statistics for debugging.
|
|
62
|
+
*
|
|
63
|
+
* @returns Current registry size and entries
|
|
64
|
+
*/
|
|
65
|
+
export declare function getIntervalRegistryStats(): {
|
|
66
|
+
size: number;
|
|
67
|
+
entries: Array<{
|
|
68
|
+
id: number;
|
|
69
|
+
createdAt: number;
|
|
70
|
+
label?: string | undefined;
|
|
71
|
+
}>;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Clear the registry for test isolation.
|
|
75
|
+
*
|
|
76
|
+
* @internal - Test use only
|
|
77
|
+
*/
|
|
78
|
+
export declare function __resetIntervalRegistryForTests(): void;
|
|
79
|
+
//# sourceMappingURL=IntervalRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IntervalRegistry.d.ts","sourceRoot":"","sources":["../../src/services/IntervalRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,OAAO,EAC/B,KAAK,CAAC,EAAE,MAAM,GACb,MAAM,CAOR;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,OAAO,GAAG,IAAI,CAGxE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAI/C;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC,CAAC;CAC/E,CASA;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,IAAI,IAAI,CAEtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiPoolStateManager.d.ts","sourceRoot":"","sources":["../../src/services/MultiPoolStateManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EAEjB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAK9C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"MultiPoolStateManager.d.ts","sourceRoot":"","sources":["../../src/services/MultiPoolStateManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EAEjB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAK9C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAA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,gBAAgB;IAwC9B;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAUnB;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;IAqB7B;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAYtB;;;;OAIG;IACH,OAAO,CAAC,aAAa;CAmBtB;AAED;;;;;;;GAOG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAkC;IACtD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,OAAO,EAAE,MAAM;IAI3B,GAAG,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO;IAInC,GAAG,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI;IAkBhC,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO;IAItC,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notification Service
|
|
3
|
+
*
|
|
4
|
+
* Handles push notification device registration and preference management.
|
|
5
|
+
*
|
|
6
|
+
* All operations require MultiAuth (JWT session or per-user API key).
|
|
7
|
+
*
|
|
8
|
+
* @category Services
|
|
9
|
+
* @since 5.1.0
|
|
10
|
+
*/
|
|
11
|
+
import type { JwtAuth } from '../auth/JwtAuth';
|
|
12
|
+
import type { GetNotificationPreferencesResult, RegisterPushTokenParams, RegisterPushTokenResult, UnregisterPushTokenResult, UpdateNotificationPreferencesParams, UpdateNotificationPreferencesResult } from '../types/notification.dto';
|
|
13
|
+
import type { HttpClient } from '../utils/http';
|
|
14
|
+
import { BaseService } from './BaseService';
|
|
15
|
+
/**
|
|
16
|
+
* Notification Service Class
|
|
17
|
+
*
|
|
18
|
+
* Provides methods for:
|
|
19
|
+
* - Registering/unregistering push notification device tokens
|
|
20
|
+
* - Getting/updating notification preferences
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const notificationService = new NotificationService(httpClient, true, jwtAuth);
|
|
25
|
+
*
|
|
26
|
+
* // Register a device
|
|
27
|
+
* await notificationService.registerPushToken({
|
|
28
|
+
* token: 'fcm-token-here',
|
|
29
|
+
* platform: 'android',
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* // Get preferences
|
|
33
|
+
* const { preferences } = await notificationService.getPreferences();
|
|
34
|
+
* console.log('Trades enabled:', preferences.tradesEnabled);
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare class NotificationService extends BaseService {
|
|
38
|
+
constructor(http: HttpClient, debugMode?: boolean, jwtAuth?: JwtAuth);
|
|
39
|
+
/**
|
|
40
|
+
* Extract data from API response wrapper
|
|
41
|
+
* @throws Error if response indicates failure or has no data
|
|
42
|
+
*/
|
|
43
|
+
private extractData;
|
|
44
|
+
/**
|
|
45
|
+
* Register a push notification device token.
|
|
46
|
+
*
|
|
47
|
+
* Associates a push token (FCM or APNs) with the authenticated user.
|
|
48
|
+
* If the token already exists, it updates the associated device info.
|
|
49
|
+
*
|
|
50
|
+
* @param params - Registration parameters
|
|
51
|
+
* @returns Registration result
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* const result = await notificationService.registerPushToken({
|
|
56
|
+
* token: 'fcm-device-token-abc123',
|
|
57
|
+
* platform: 'android',
|
|
58
|
+
* deviceId: 'pixel-7-main',
|
|
59
|
+
* });
|
|
60
|
+
* console.log('Registered:', result.registered);
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
registerPushToken(params: RegisterPushTokenParams): Promise<RegisterPushTokenResult>;
|
|
64
|
+
/**
|
|
65
|
+
* Unregister a push notification device token.
|
|
66
|
+
*
|
|
67
|
+
* Deactivates a push token so the device no longer receives notifications.
|
|
68
|
+
*
|
|
69
|
+
* @param token - The push token to unregister
|
|
70
|
+
* @returns Unregistration result
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const result = await notificationService.unregisterPushToken('fcm-device-token-abc123');
|
|
75
|
+
* console.log('Unregistered:', result.unregistered);
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
unregisterPushToken(token: string): Promise<UnregisterPushTokenResult>;
|
|
79
|
+
/**
|
|
80
|
+
* Get notification preferences for the authenticated user.
|
|
81
|
+
*
|
|
82
|
+
* @returns Current notification preferences
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* const { preferences } = await notificationService.getPreferences();
|
|
87
|
+
* console.log('Trades:', preferences.tradesEnabled);
|
|
88
|
+
* console.log('Streams:', preferences.streamsEnabled);
|
|
89
|
+
* console.log('Chat:', preferences.chatEnabled);
|
|
90
|
+
* console.log('System:', preferences.systemEnabled);
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
getPreferences(): Promise<GetNotificationPreferencesResult>;
|
|
94
|
+
/**
|
|
95
|
+
* Update notification preferences for the authenticated user.
|
|
96
|
+
*
|
|
97
|
+
* Partial update - only provided fields are modified.
|
|
98
|
+
*
|
|
99
|
+
* @param params - Preference fields to update
|
|
100
|
+
* @returns Updated notification preferences
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```typescript
|
|
104
|
+
* // Disable chat notifications only
|
|
105
|
+
* const { preferences } = await notificationService.updatePreferences({
|
|
106
|
+
* chatEnabled: false,
|
|
107
|
+
* });
|
|
108
|
+
* console.log('Chat now:', preferences.chatEnabled); // false
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
updatePreferences(params: UpdateNotificationPreferencesParams): Promise<UpdateNotificationPreferencesResult>;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=NotificationService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationService.d.ts","sourceRoot":"","sources":["../../src/services/NotificationService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,KAAK,EACV,gCAAgC,EAGhC,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,mCAAmC,EACnC,mCAAmC,EACpC,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,mBAAoB,SAAQ,WAAW;gBACtC,IAAI,EAAE,UAAU,EAAE,SAAS,GAAE,OAAe,EAAE,OAAO,CAAC,EAAE,OAAO;IAI3E;;;OAGG;IACH,OAAO,CAAC,WAAW;IAQnB;;;;;;;;;;;;;;;;;;OAkBG;IACG,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAmB1F;;;;;;;;;;;;;OAaG;IACG,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAkB5E;;;;;;;;;;;;;OAaG;IACG,cAAc,IAAI,OAAO,CAAC,gCAAgC,CAAC;IAkBjE;;;;;;;;;;;;;;;;OAgBG;IACG,iBAAiB,CACrB,MAAM,EAAE,mCAAmC,GAC1C,OAAO,CAAC,mCAAmC,CAAC;CAiBhD"}
|
|
@@ -2,6 +2,7 @@ import { Wallet } from 'ethers';
|
|
|
2
2
|
import type { BridgeFeeEstimate, BridgeInParams, BridgeOutParams, BridgeStatus, BridgeToken, BridgeTransaction, EstimateBridgeFeeParams, EthereumTransactionStatus, EthereumWalletBalanceResult, ExternalChainBalance, SolanaTransactionStatus, SolanaWalletBalanceResult } from './bridge/types/bridge.dto';
|
|
3
3
|
import type { BridgeableNetwork, FetchBridgeableTokensOptions, FetchBridgeableTokensResult, IsTokenBridgeableOptions, IsTokenBridgeableResult } from './bridge/types/bridgeable-token.dto';
|
|
4
4
|
import { EventsBatcherService } from './services/EventsBatcherService';
|
|
5
|
+
import { GdexStreamService } from './services/GdexStreamService';
|
|
5
6
|
import type { StreamEventCallbacks } from './services/StreamWebSocketService';
|
|
6
7
|
import type { GetAIModerationOptions, GetAIModerationResult, GetAIModerationSettingsResult, GetAIModerationStatusResult, TriggerAIModerationOptions, TriggerAIModerationResult, UpdateAIModerationSettingsOptions, UpdateAIModerationSettingsResult } from './types/ai-moderation.dto';
|
|
7
8
|
import type { ApiKeyData, ApiKeyListResponse, CreateApiKeyOptions, CreateApiKeyResponse, ListApiKeysOptions, UpdateApiKeyOptions } from './types/api-key.dto';
|
|
@@ -9,6 +10,7 @@ import type { ActiveUsersResult, BanListResult, BanStatusResult, CreateBanOption
|
|
|
9
10
|
import type { BurnTokensData, BurnTokensResult } from './types/burn.dto';
|
|
10
11
|
import type { FlushResult } from './types/cache-management.dto';
|
|
11
12
|
import type { CreateChatMessageOptions, CreateChatMessageResult, GetChatMessagesOptions, GetChatMessagesResult, UpdateChatMessageOptions, UpdateChatMessageResult } from './types/chat-messages.dto';
|
|
13
|
+
import type { GetClientFlagsResult } from './types/client-config.dto';
|
|
12
14
|
import type { CommentsResult, CreateCommentOptions, CreateCommentResult, DeleteCommentResult, GetCommentsOptions, UpdateCommentOptions, UpdateCommentResult } from './types/comments.dto';
|
|
13
15
|
import type { AddressFormat, ApiResponse, SDKConfig, TokenClassKey, TokenId } from './types/common';
|
|
14
16
|
import type { ActionFlagOptions, ActionFlagResult, CreateFlagOptions, CreateFlagResult, DismissFlagOptions, DismissFlagResult, FlagListResult, ListFlagsOptions, ListGlobalFlagsOptions } from './types/content-flag.dto';
|
|
@@ -19,6 +21,7 @@ import type { LockTokensData, LockTokensResult, UnlockTokensData, UnlockTokensRe
|
|
|
19
21
|
import type { CreateMessageOptions, CreateMessageResult, DeleteMessageResult, FetchMessagesOptions, FetchMessagesResult, GetPinnedMessageResult, MessageStats, PinMessageResult, UpdateMessageOptions, UpdateMessageResult, UpdateTokenConfigOptions } from './types/messages.dto';
|
|
20
22
|
import type { ClaimModeratorInviteOptions, ClaimModeratorInviteResult, CreateModeratorInviteOptions, CreateModeratorInviteResult, GetModeratedTokensOptions, ListModeratorInvitesOptions, ModeratedTokensResult, ModeratorInviteListResult, PublicInviteInfo, UpdateInviteRoleOptions, UpdateInviteRoleResult, UpdateModeratorInviteOptions, UpdateModeratorInviteResult } from './types/moderator.dto';
|
|
21
23
|
import type { ClaimCollectionParams, ClaimCollectionResult, CreateTokenClassParams, CreateTokenClassResult, EstimateMintFeeParams, EstimateNftFeesParams, FetchTokenClassesParams, MintNftParams, MintNftResult, NftBalance, NftCollectionAuthorization, NftFeeEstimate, NftTokenClassWithSupply } from './types/nft.dto';
|
|
24
|
+
import type { GetNotificationPreferencesResult, RegisterPushTokenParams, RegisterPushTokenResult, UnregisterPushTokenResult, UpdateNotificationPreferencesParams, UpdateNotificationPreferencesResult } from './types/notification.dto';
|
|
22
25
|
import type { GetHomeOEmbedJsonResult, GetHomeOEmbedOptions, GetPoolOEmbedJsonResult, GetPoolOEmbedOptions, GetProfileOEmbedJsonResult, GetProfileOEmbedOptions } from './types/oembed.dto';
|
|
23
26
|
import type { BanStatsResponse, CreateOverseerDirectOptions, CreateOverseerInviteOptions, FlagStatsResponse, InviteStatsResponse, ListOverseerInvitesOptions, ListOverseersOptions, ListUsersOptions, Overseer, OverseerInviteWithUrl, OverseerStatusResponse, OverseerSummaryResponse, PaginatedOverseerInvites, PaginatedOverseers, PublicOverseerInviteInfo, TokenBanStatsResponse, UsersListResponse, UserStatsResponse, UserSummaryResponse } from './types/overseer.dto';
|
|
24
27
|
import type { PlatformConfig, UpdatePlatformConfigOptions } from './types/platform-config.dto';
|
|
@@ -152,6 +155,8 @@ export interface LaunchpadSDKConfig extends SDKConfig {
|
|
|
152
155
|
bundleBaseUrl?: string;
|
|
153
156
|
/** Optional WebSocket URL override for transaction monitoring - defaults based on main API environment */
|
|
154
157
|
webSocketUrl?: string;
|
|
158
|
+
/** Optional GDEX JSON-RPC WebSocket URL override - defaults based on main API environment */
|
|
159
|
+
gdexWebSocketUrl?: string;
|
|
155
160
|
/** Optional DEX API URL override for launchpad token balances - defaults based on main API environment */
|
|
156
161
|
dexApiBaseUrl?: string;
|
|
157
162
|
/** Optional DEX Backend URL override for price oracle - defaults based on main API environment */
|
|
@@ -377,6 +382,7 @@ export declare class LaunchpadSDK {
|
|
|
377
382
|
private _streamingService;
|
|
378
383
|
private _streamChatService;
|
|
379
384
|
private _streamWebSocketService;
|
|
385
|
+
private _gdexStreamService;
|
|
380
386
|
private _streamingEventService;
|
|
381
387
|
private _banService;
|
|
382
388
|
private _tokenBanService;
|
|
@@ -394,6 +400,8 @@ export declare class LaunchpadSDK {
|
|
|
394
400
|
private _weeklyChallengeService;
|
|
395
401
|
private _oembedService;
|
|
396
402
|
private _platformStatsService;
|
|
403
|
+
private _notificationService;
|
|
404
|
+
private _clientConfigService;
|
|
397
405
|
private readonly nftCollectionService;
|
|
398
406
|
private readonly tradingQuotesService;
|
|
399
407
|
private readonly launchpadAPI;
|
|
@@ -1001,7 +1009,7 @@ export declare class LaunchpadSDK {
|
|
|
1001
1009
|
* amount: '500'
|
|
1002
1010
|
* });
|
|
1003
1011
|
*
|
|
1004
|
-
* // Step 3: Compare with real-time quote from
|
|
1012
|
+
* // Step 3: Compare with a real-time quote from the DEX backend
|
|
1005
1013
|
* const liveQuote = await sdk.calculateDexPoolQuoteExactAmountExternal({
|
|
1006
1014
|
* compositePoolData: composite,
|
|
1007
1015
|
* fromToken: 'GALA|Unit|none|none',
|
|
@@ -1050,13 +1058,13 @@ export declare class LaunchpadSDK {
|
|
|
1050
1058
|
*/
|
|
1051
1059
|
calculateDexPoolQuoteExactAmountLocal(options: CalculateDexPoolQuoteOptions): Promise<DexPoolQuoteResult>;
|
|
1052
1060
|
/**
|
|
1053
|
-
* Calculate DEX pool quote using
|
|
1061
|
+
* Calculate DEX pool quote using the external DEX backend endpoint
|
|
1054
1062
|
*
|
|
1055
|
-
* Real-time quotes
|
|
1056
|
-
*
|
|
1063
|
+
* Real-time quotes using current backend pool state. Slower than local calculation
|
|
1064
|
+
* and useful for final price verification.
|
|
1057
1065
|
*
|
|
1058
1066
|
* @param options Quote calculation options (compositePoolData provides token metadata)
|
|
1059
|
-
* @returns DexPoolQuoteResult with current
|
|
1067
|
+
* @returns DexPoolQuoteResult with current pool state
|
|
1060
1068
|
* @throws DexQuoteError on network or calculation errors
|
|
1061
1069
|
* @since 3.32.0
|
|
1062
1070
|
* @category DEX Quotes
|
|
@@ -1077,7 +1085,7 @@ export declare class LaunchpadSDK {
|
|
|
1077
1085
|
* amount: '1000'
|
|
1078
1086
|
* });
|
|
1079
1087
|
*
|
|
1080
|
-
* // Live verification from
|
|
1088
|
+
* // Live verification from the DEX backend
|
|
1081
1089
|
* const liveQuote = await sdk.calculateDexPoolQuoteExactAmountExternal({
|
|
1082
1090
|
* compositePoolData: composite,
|
|
1083
1091
|
* fromToken: 'GALA|Unit|none|none',
|
|
@@ -1096,7 +1104,7 @@ export declare class LaunchpadSDK {
|
|
|
1096
1104
|
* Defaults to local (instant) calculation.
|
|
1097
1105
|
*
|
|
1098
1106
|
* @param options Quote calculation options
|
|
1099
|
-
* @param mode 'local' (instant, client-side) or 'external' (real-time,
|
|
1107
|
+
* @param mode 'local' (instant, client-side) or 'external' (real-time, backend) - defaults to 'local'
|
|
1100
1108
|
* @returns DexPoolQuoteResult with amounts and prices
|
|
1101
1109
|
* @since 3.32.0
|
|
1102
1110
|
* @category DEX Quotes
|
|
@@ -1120,7 +1128,7 @@ export declare class LaunchpadSDK {
|
|
|
1120
1128
|
* toToken: 'Token|Unit|BENE|client:123',
|
|
1121
1129
|
* amount: '1000'
|
|
1122
1130
|
* }, 'external');
|
|
1123
|
-
* // Returns real-time quote from
|
|
1131
|
+
* // Returns a real-time quote from the DEX backend
|
|
1124
1132
|
* ```
|
|
1125
1133
|
*/
|
|
1126
1134
|
calculateDexPoolQuoteExactAmount(options: CalculateDexPoolQuoteOptions, mode?: 'local' | 'external'): Promise<DexPoolQuoteResult>;
|
|
@@ -2045,6 +2053,24 @@ export declare class LaunchpadSDK {
|
|
|
2045
2053
|
* @since 9.0.0
|
|
2046
2054
|
*/
|
|
2047
2055
|
private getPlatformStatsService;
|
|
2056
|
+
/**
|
|
2057
|
+
* Get or create the NotificationService instance.
|
|
2058
|
+
*
|
|
2059
|
+
* Lazily initializes the NotificationService on first use.
|
|
2060
|
+
* The service handles push notification device registration and preference management.
|
|
2061
|
+
*
|
|
2062
|
+
* @returns Configured NotificationService instance
|
|
2063
|
+
*/
|
|
2064
|
+
private getNotificationService;
|
|
2065
|
+
/**
|
|
2066
|
+
* Get or create the ClientConfigService instance.
|
|
2067
|
+
*
|
|
2068
|
+
* Lazily initializes the ClientConfigService on first use.
|
|
2069
|
+
* The service handles client-side feature flag queries.
|
|
2070
|
+
*
|
|
2071
|
+
* @returns Configured ClientConfigService instance
|
|
2072
|
+
*/
|
|
2073
|
+
private getClientConfigService;
|
|
2048
2074
|
/**
|
|
2049
2075
|
* Get or create the ApiKeyService instance.
|
|
2050
2076
|
*
|
|
@@ -2171,6 +2197,14 @@ export declare class LaunchpadSDK {
|
|
|
2171
2197
|
* @since 5.1.0
|
|
2172
2198
|
*/
|
|
2173
2199
|
private getStreamWebSocketService;
|
|
2200
|
+
/**
|
|
2201
|
+
* Get or create the public GDEX JSON-RPC WebSocket client.
|
|
2202
|
+
*
|
|
2203
|
+
* @returns Configured GdexStreamService instance
|
|
2204
|
+
* @category Services
|
|
2205
|
+
* @since 5.0.4
|
|
2206
|
+
*/
|
|
2207
|
+
getGdexStreamService(): GdexStreamService;
|
|
2174
2208
|
/**
|
|
2175
2209
|
* Get the streaming event service
|
|
2176
2210
|
*
|
|
@@ -5605,6 +5639,101 @@ export declare class LaunchpadSDK {
|
|
|
5605
5639
|
* ```
|
|
5606
5640
|
*/
|
|
5607
5641
|
getPlatformStats(): Promise<GetPlatformStatsResult>;
|
|
5642
|
+
/**
|
|
5643
|
+
* Register a push notification device token.
|
|
5644
|
+
*
|
|
5645
|
+
* Associates a push token (FCM or APNs) with the authenticated user.
|
|
5646
|
+
* If the token already exists, it updates the associated device info.
|
|
5647
|
+
*
|
|
5648
|
+
* Authentication: Requires JWT auth (call sdk.login() first).
|
|
5649
|
+
*
|
|
5650
|
+
* @param params - Registration parameters (token, platform, optional deviceId)
|
|
5651
|
+
* @returns Registration result
|
|
5652
|
+
*
|
|
5653
|
+
* @example
|
|
5654
|
+
* ```typescript
|
|
5655
|
+
* const result = await sdk.registerPushToken({
|
|
5656
|
+
* token: 'fcm-device-token-abc123',
|
|
5657
|
+
* platform: 'android',
|
|
5658
|
+
* deviceId: 'pixel-7-main',
|
|
5659
|
+
* });
|
|
5660
|
+
* console.log('Registered:', result.registered);
|
|
5661
|
+
* ```
|
|
5662
|
+
*/
|
|
5663
|
+
registerPushToken(params: RegisterPushTokenParams): Promise<RegisterPushTokenResult>;
|
|
5664
|
+
/**
|
|
5665
|
+
* Unregister a push notification device token.
|
|
5666
|
+
*
|
|
5667
|
+
* Deactivates a push token so the device no longer receives notifications.
|
|
5668
|
+
*
|
|
5669
|
+
* Authentication: Requires JWT auth (call sdk.login() first).
|
|
5670
|
+
*
|
|
5671
|
+
* @param token - The push token to unregister
|
|
5672
|
+
* @returns Unregistration result
|
|
5673
|
+
*
|
|
5674
|
+
* @example
|
|
5675
|
+
* ```typescript
|
|
5676
|
+
* const result = await sdk.unregisterPushToken('fcm-device-token-abc123');
|
|
5677
|
+
* console.log('Unregistered:', result.unregistered);
|
|
5678
|
+
* ```
|
|
5679
|
+
*/
|
|
5680
|
+
unregisterPushToken(token: string): Promise<UnregisterPushTokenResult>;
|
|
5681
|
+
/**
|
|
5682
|
+
* Get notification preferences for the authenticated user.
|
|
5683
|
+
*
|
|
5684
|
+
* Returns the current push notification preference settings.
|
|
5685
|
+
*
|
|
5686
|
+
* Authentication: Requires JWT auth (call sdk.login() first).
|
|
5687
|
+
*
|
|
5688
|
+
* @returns Current notification preferences
|
|
5689
|
+
*
|
|
5690
|
+
* @example
|
|
5691
|
+
* ```typescript
|
|
5692
|
+
* const { preferences } = await sdk.fetchNotificationPreferences();
|
|
5693
|
+
* console.log('Trades:', preferences.tradesEnabled);
|
|
5694
|
+
* console.log('Streams:', preferences.streamsEnabled);
|
|
5695
|
+
* console.log('Chat:', preferences.chatEnabled);
|
|
5696
|
+
* console.log('System:', preferences.systemEnabled);
|
|
5697
|
+
* ```
|
|
5698
|
+
*/
|
|
5699
|
+
fetchNotificationPreferences(): Promise<GetNotificationPreferencesResult>;
|
|
5700
|
+
/**
|
|
5701
|
+
* Update notification preferences for the authenticated user.
|
|
5702
|
+
*
|
|
5703
|
+
* Partial update - only provided fields are modified, others remain unchanged.
|
|
5704
|
+
*
|
|
5705
|
+
* Authentication: Requires JWT auth (call sdk.login() first).
|
|
5706
|
+
*
|
|
5707
|
+
* @param params - Preference fields to update
|
|
5708
|
+
* @returns Updated notification preferences
|
|
5709
|
+
*
|
|
5710
|
+
* @example
|
|
5711
|
+
* ```typescript
|
|
5712
|
+
* // Disable chat notifications only
|
|
5713
|
+
* const { preferences } = await sdk.updateNotificationPreferences({
|
|
5714
|
+
* chatEnabled: false,
|
|
5715
|
+
* });
|
|
5716
|
+
* console.log('Chat now:', preferences.chatEnabled); // false
|
|
5717
|
+
* ```
|
|
5718
|
+
*/
|
|
5719
|
+
updateNotificationPreferences(params: UpdateNotificationPreferencesParams): Promise<UpdateNotificationPreferencesResult>;
|
|
5720
|
+
/**
|
|
5721
|
+
* Get client feature flags.
|
|
5722
|
+
*
|
|
5723
|
+
* Returns feature flag overrides for the native mobile app.
|
|
5724
|
+
* No authentication required (public endpoint).
|
|
5725
|
+
*
|
|
5726
|
+
* @returns Client feature flags
|
|
5727
|
+
*
|
|
5728
|
+
* @example
|
|
5729
|
+
* ```typescript
|
|
5730
|
+
* const { flags } = await sdk.fetchClientFlags();
|
|
5731
|
+
* console.log('Push notifications:', flags.PUSH_NOTIFICATIONS);
|
|
5732
|
+
* console.log('Dark mode:', flags.DARK_MODE);
|
|
5733
|
+
* console.log('DEX trading:', flags.DEX_TRADING);
|
|
5734
|
+
* ```
|
|
5735
|
+
*/
|
|
5736
|
+
fetchClientFlags(): Promise<GetClientFlagsResult>;
|
|
5608
5737
|
/**
|
|
5609
5738
|
* Add a reaction to a pool message (chat or comment).
|
|
5610
5739
|
*
|