@gala-chain/launchpad-sdk 4.0.4-beta.0 → 4.0.4-beta.1
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/EXAMPLES.md +96 -35
- package/README.md +2 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/src/LaunchpadSDK.d.ts +750 -72
- package/dist/src/LaunchpadSDK.d.ts.map +1 -1
- package/dist/src/constants/version.generated.d.ts +1 -1
- package/dist/src/services/DexBackendClient.d.ts +139 -10
- package/dist/src/services/DexBackendClient.d.ts.map +1 -1
- package/dist/src/services/DexQuoteService.d.ts +181 -22
- package/dist/src/services/DexQuoteService.d.ts.map +1 -1
- package/dist/src/services/DexService.d.ts +274 -38
- package/dist/src/services/DexService.d.ts.map +1 -1
- package/dist/src/services/GSwapService.d.ts +555 -246
- package/dist/src/services/GSwapService.d.ts.map +1 -1
- package/dist/src/services/GalaChainGatewayClient.d.ts +139 -41
- package/dist/src/services/GalaChainGatewayClient.d.ts.map +1 -1
- package/dist/src/services/ImageService.d.ts +101 -12
- package/dist/src/services/ImageService.d.ts.map +1 -1
- package/dist/src/services/PoolCacheManager.d.ts +125 -31
- package/dist/src/services/PoolCacheManager.d.ts.map +1 -1
- package/dist/src/services/SignatureService.d.ts +35 -5
- package/dist/src/services/SignatureService.d.ts.map +1 -1
- package/dist/src/services/SwapEventQueue.d.ts +79 -10
- package/dist/src/services/SwapEventQueue.d.ts.map +1 -1
- package/dist/src/services/TokenClassKeyService.d.ts +56 -10
- package/dist/src/services/TokenClassKeyService.d.ts.map +1 -1
- package/dist/src/services/TokenMetadataService.d.ts +407 -31
- package/dist/src/services/TokenMetadataService.d.ts.map +1 -1
- package/dist/src/services/TradeService.d.ts +168 -6
- package/dist/src/services/TradeService.d.ts.map +1 -1
- package/dist/src/services/UserService.d.ts +117 -15
- package/dist/src/services/UserService.d.ts.map +1 -1
- package/package.json +12 -2
- package/API.md +0 -1475
|
@@ -53,12 +53,42 @@ export declare class SignatureService extends LoggerBase {
|
|
|
53
53
|
private walletProvider;
|
|
54
54
|
constructor(walletProvider: WalletProvider, debug?: boolean);
|
|
55
55
|
/**
|
|
56
|
-
* Sign
|
|
56
|
+
* Sign DTO using EIP-712 typed data signature
|
|
57
57
|
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
58
|
+
* Generates a cryptographic signature for a bonding curve transaction DTO using EIP-712
|
|
59
|
+
* standard. The signature proves ownership and authorizes the transaction without revealing
|
|
60
|
+
* the private key. Includes personal sign prefix calculation for replay protection.
|
|
61
|
+
*
|
|
62
|
+
* **Process**:
|
|
63
|
+
* 1. Generate EIP-712 types from DTO structure
|
|
64
|
+
* 2. Calculate personal sign prefix (replay protection)
|
|
65
|
+
* 3. Sign with ethers.js Wallet (signTypedData)
|
|
66
|
+
* 4. Return augmented DTO with signature, types, and domain
|
|
67
|
+
*
|
|
68
|
+
* **Compatibility**: Matches frontend signature generation exactly.
|
|
69
|
+
*
|
|
70
|
+
* @param dto DTO to sign (ChainCallDTO-compatible object)
|
|
71
|
+
* @param methodName Method name for EIP-712 type generation (e.g., 'LaunchTokenDTO')
|
|
72
|
+
* @param _walletAddress User's wallet address (unused, kept for compatibility)
|
|
73
|
+
* @returns Promise resolving to signed DTO with signature, types, and domain fields
|
|
74
|
+
* @throws Error if wallet provider doesn't support typed data signing
|
|
75
|
+
* @category Cryptography
|
|
76
|
+
* @since 2.0.0
|
|
77
|
+
*
|
|
78
|
+
* @example Sign buy transaction DTO
|
|
79
|
+
* ```typescript
|
|
80
|
+
* const signedDTO = await signatureService.signDTO(
|
|
81
|
+
* {
|
|
82
|
+
* tokenName: 'anime',
|
|
83
|
+
* amount: '1000',
|
|
84
|
+
* slippageTolerance: '0.01'
|
|
85
|
+
* },
|
|
86
|
+
* 'BuyTokenDTO',
|
|
87
|
+
* 'eth|1234...'
|
|
88
|
+
* );
|
|
89
|
+
* console.log('Signature:', signedDTO.signature);
|
|
90
|
+
* // Ready for bundle submission
|
|
91
|
+
* ```
|
|
62
92
|
*/
|
|
63
93
|
signDTO(dto: SignableDTO, methodName: string, _walletAddress: string): Promise<SignableDTO & {
|
|
64
94
|
signature: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignatureService.d.ts","sourceRoot":"","sources":["../../../src/services/SignatureService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C;;GAEG;AACH,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAChH,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACnD,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC,CAAC;CACxE;AAED;;GAEG;AACH,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE3C;;GAEG;AACH,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,UAAU;IAE5C,OAAO,CAAC,cAAc;gBAAd,cAAc,EAAE,cAAc,EACtC,KAAK,GAAE,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SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,WAAW,CAAC;QAAC,MAAM,CAAC,EAAE,YAAY,CAAA;KAAE,CAAC;IAoC3F;;;;;OAKG;YACW,oBAAoB;IA8ClC;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;CA0F5B"}
|
|
@@ -58,30 +58,99 @@ export declare class SwapEventQueue {
|
|
|
58
58
|
private scheduleProcessing;
|
|
59
59
|
constructor(config: Required<SwapMonitorConfig>, metrics: MonitoringMetrics, logger?: Logger);
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
61
|
+
* Register event processor callback function
|
|
62
62
|
*
|
|
63
|
-
*
|
|
63
|
+
* Sets the async function that will be called for each swap event. The processor
|
|
64
|
+
* is invoked with batch processing and concurrency control according to queue configuration.
|
|
65
|
+
*
|
|
66
|
+
* **Performance**: Processor should complete in <100ms for optimal throughput.
|
|
67
|
+
*
|
|
68
|
+
* @param processor Async function to process each swap event
|
|
69
|
+
* @category Event Processing
|
|
70
|
+
* @since 3.19.0
|
|
71
|
+
*
|
|
72
|
+
* @example Register event processor
|
|
73
|
+
* ```typescript
|
|
74
|
+
* queue.setProcessor(async (event) => {
|
|
75
|
+
* console.log(`Processing swap: ${event.transactionId}`);
|
|
76
|
+
* await database.saveSwap(event);
|
|
77
|
+
* console.log('Swap saved successfully');
|
|
78
|
+
* });
|
|
79
|
+
* ```
|
|
64
80
|
*/
|
|
65
81
|
setProcessor(processor: (event: SwapEventData) => Promise<void>): void;
|
|
66
82
|
/**
|
|
67
|
-
*
|
|
83
|
+
* Add swap event to processing queue with backpressure handling
|
|
84
|
+
*
|
|
85
|
+
* Attempts to enqueue a swap event for async processing. If the queue is at capacity,
|
|
86
|
+
* the event is dropped and false is returned (backpressure signal). Successfully
|
|
87
|
+
* enqueued events are processed in batches according to queue configuration.
|
|
88
|
+
*
|
|
89
|
+
* **Backpressure**: When queue is full, events are dropped to prevent memory overflow.
|
|
90
|
+
* Monitor `eventsDropped` metric to detect sustained backpressure conditions.
|
|
91
|
+
*
|
|
92
|
+
* **Performance**: O(1) enqueue time, automatic batch scheduling.
|
|
68
93
|
*
|
|
69
|
-
*
|
|
94
|
+
* @param event Swap event to enqueue for processing
|
|
95
|
+
* @returns true if successfully enqueued, false if dropped due to queue overflow
|
|
96
|
+
* @category Event Processing
|
|
97
|
+
* @since 3.19.0
|
|
70
98
|
*
|
|
71
|
-
* @
|
|
72
|
-
*
|
|
99
|
+
* @example Enqueue with backpressure handling
|
|
100
|
+
* ```typescript
|
|
101
|
+
* const success = queue.enqueue({
|
|
102
|
+
* transactionId: 'tx123',
|
|
103
|
+
* poolKey: 'GALA-GUSDC-3000',
|
|
104
|
+
* timestamp: Date.now(),
|
|
105
|
+
* amount0: '1000',
|
|
106
|
+
* amount1: '500',
|
|
107
|
+
* exactInput: true
|
|
108
|
+
* });
|
|
109
|
+
*
|
|
110
|
+
* if (!success) {
|
|
111
|
+
* console.warn('Queue full - event dropped!');
|
|
112
|
+
* // Consider: reduce ingestion rate, increase queue size, scale workers
|
|
113
|
+
* }
|
|
114
|
+
* ```
|
|
73
115
|
*/
|
|
74
116
|
enqueue(event: SwapEventData): boolean;
|
|
75
117
|
/**
|
|
76
|
-
* Get current queue
|
|
118
|
+
* Get current number of pending events in queue
|
|
119
|
+
*
|
|
120
|
+
* Returns the count of events waiting to be processed. Useful for monitoring
|
|
121
|
+
* queue depth and detecting backlog buildup.
|
|
122
|
+
*
|
|
123
|
+
* @returns Number of events currently in queue (not yet processed)
|
|
124
|
+
* @category Monitoring
|
|
125
|
+
* @since 3.19.0
|
|
77
126
|
*
|
|
78
|
-
* @
|
|
127
|
+
* @example Monitor queue depth
|
|
128
|
+
* ```typescript
|
|
129
|
+
* const depth = queue.getQueueSize();
|
|
130
|
+
* if (depth > 1000) {
|
|
131
|
+
* console.warn(`Queue backlog: ${depth} events pending`);
|
|
132
|
+
* }
|
|
133
|
+
* ```
|
|
79
134
|
*/
|
|
80
135
|
getQueueSize(): number;
|
|
81
136
|
/**
|
|
82
|
-
* Get queue statistics
|
|
137
|
+
* Get comprehensive queue performance statistics
|
|
138
|
+
*
|
|
139
|
+
* Returns detailed metrics including queue size, processing counts, concurrency levels,
|
|
140
|
+
* and batch statistics. Use for monitoring, alerting, and capacity planning.
|
|
141
|
+
*
|
|
142
|
+
* @returns QueueStats object with current state and performance metrics
|
|
143
|
+
* @category Monitoring
|
|
144
|
+
* @since 3.19.0
|
|
83
145
|
*
|
|
84
|
-
* @
|
|
146
|
+
* @example Monitor queue performance
|
|
147
|
+
* ```typescript
|
|
148
|
+
* const stats = queue.getStats();
|
|
149
|
+
* console.log(`Queue: ${stats.queueSize} pending, ${stats.eventsProcessed} processed`);
|
|
150
|
+
* console.log(`Dropped: ${stats.eventsDropped} (${(stats.eventsDropped / stats.eventsProcessed * 100).toFixed(2)}%)`);
|
|
151
|
+
* console.log(`Concurrency: ${stats.currentConcurrent}/${stats.maxConcurrentReached}`);
|
|
152
|
+
* console.log(`Avg batch size: ${stats.averageBatchSize}`);
|
|
153
|
+
* ```
|
|
85
154
|
*/
|
|
86
155
|
getStats(): QueueStats;
|
|
87
156
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwapEventQueue.d.ts","sourceRoot":"","sources":["../../../src/services/SwapEventQueue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,gBA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;;;;;;OAMG;IACG,QAAQ,CAAC,SAAS,GAAE,MAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBxD;;;;OAIG;IACH,KAAK,IAAI,IAAI;IAQb;;;;;;OAMG;YACW,gBAAgB;IAoE9B;;;;OAIG;YACW,YAAY;CAiB3B"}
|
|
@@ -54,18 +54,45 @@ export declare class TokenClassKeyService extends LoggerBase {
|
|
|
54
54
|
*/
|
|
55
55
|
generateStringsInstructions(vaultAddress: string): string[];
|
|
56
56
|
/**
|
|
57
|
-
* Create TokenClassKey instance for
|
|
58
|
-
* CRITICAL: Uses lowercase token symbol to match frontend format
|
|
57
|
+
* Create TokenClassKey instance for launchpad token
|
|
59
58
|
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
59
|
+
* Constructs a properly formatted TokenClassKey for a launchpad token using its symbol.
|
|
60
|
+
* **Critical**: Always converts symbol to lowercase for collection field to match frontend
|
|
61
|
+
* format and ensure consistent string instruction generation.
|
|
62
|
+
*
|
|
63
|
+
* **Format**: `{ collection: lowercase_symbol, category: 'Unit', type: 'none', additionalKey: 'none' }`
|
|
64
|
+
*
|
|
65
|
+
* @param tokenSymbol Token symbol (e.g., 'ANIME', 'CLAUDE') - converted to lowercase internally
|
|
66
|
+
* @returns TokenClassKey instance with lowercase collection field
|
|
67
|
+
* @category Token Identification
|
|
68
|
+
* @since 2.0.0
|
|
69
|
+
*
|
|
70
|
+
* @example Create token instance
|
|
71
|
+
* ```typescript
|
|
72
|
+
* const tokenKey = service.createTokenInstance('ANIME');
|
|
73
|
+
* console.log(tokenKey.toStringKey());
|
|
74
|
+
* // Output: 'anime$Unit$none$none'
|
|
75
|
+
* ```
|
|
63
76
|
*/
|
|
64
77
|
createTokenInstance(tokenSymbol: string): TokenClassKey;
|
|
65
78
|
/**
|
|
66
|
-
* Create TokenClassKey instance for GALA
|
|
79
|
+
* Create TokenClassKey instance for GALA native token
|
|
67
80
|
*
|
|
68
|
-
*
|
|
81
|
+
* Constructs the standard TokenClassKey for GALA (GalaChain's native token).
|
|
82
|
+
* Used in bundle transactions for tracking GALA balance changes in pools and user wallets.
|
|
83
|
+
*
|
|
84
|
+
* **Format**: `{ collection: 'GALA', category: 'Unit', type: 'none', additionalKey: 'none' }`
|
|
85
|
+
*
|
|
86
|
+
* @returns TokenClassKey instance for GALA with uppercase collection field
|
|
87
|
+
* @category Token Identification
|
|
88
|
+
* @since 2.0.0
|
|
89
|
+
*
|
|
90
|
+
* @example Create GALA instance
|
|
91
|
+
* ```typescript
|
|
92
|
+
* const galaKey = service.createGalaInstance();
|
|
93
|
+
* console.log(galaKey.toStringKey());
|
|
94
|
+
* // Output: 'GALA$Unit$none$none'
|
|
95
|
+
* ```
|
|
69
96
|
*/
|
|
70
97
|
createGalaInstance(): TokenClassKey;
|
|
71
98
|
/**
|
|
@@ -84,10 +111,29 @@ export declare class TokenClassKeyService extends LoggerBase {
|
|
|
84
111
|
*/
|
|
85
112
|
extractTokenSymbolFromVault(vaultAddress: string): string;
|
|
86
113
|
/**
|
|
87
|
-
* Validate vault address format
|
|
114
|
+
* Validate vault address format for launchpad tokens
|
|
115
|
+
*
|
|
116
|
+
* Checks that a vault address conforms to the expected GalaChain launchpad format:
|
|
117
|
+
* - Starts with 'service|Token$Unit$'
|
|
118
|
+
* - Ends with '$launchpad'
|
|
119
|
+
* - Contains valid token symbol (1-10 letters, case insensitive)
|
|
120
|
+
* - Has at least 5 parts separated by '$'
|
|
121
|
+
*
|
|
122
|
+
* **Format**: `service|Token$Unit$SYMBOL$eth:address$launchpad`
|
|
123
|
+
*
|
|
124
|
+
* @param vaultAddress Vault address string to validate
|
|
125
|
+
* @returns true if valid (throws ValidationError if invalid)
|
|
126
|
+
* @throws ValidationError if format is invalid
|
|
127
|
+
* @category Token Identification
|
|
128
|
+
* @since 2.0.0
|
|
88
129
|
*
|
|
89
|
-
* @
|
|
90
|
-
*
|
|
130
|
+
* @example Validate vault address
|
|
131
|
+
* ```typescript
|
|
132
|
+
* const isValid = service.validateVaultAddress(
|
|
133
|
+
* 'service|Token$Unit$ANIME$eth:1234567890$launchpad'
|
|
134
|
+
* );
|
|
135
|
+
* // Returns: true
|
|
136
|
+
* ```
|
|
91
137
|
*/
|
|
92
138
|
validateVaultAddress(vaultAddress: string): boolean;
|
|
93
139
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenClassKeyService.d.ts","sourceRoot":"","sources":["../../../src/services/TokenClassKeyService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAU3C;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,UAAU;gBACtC,SAAS,GAAE,OAAe;IAItC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,2BAA2B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE;IAwC3D
|
|
1
|
+
{"version":3,"file":"TokenClassKeyService.d.ts","sourceRoot":"","sources":["../../../src/services/TokenClassKeyService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAU3C;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,UAAU;gBACtC,SAAS,GAAE,OAAe;IAItC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,2BAA2B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE;IAwC3D;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa;IAgBvD;;;;;;;;;;;;;;;;;;OAkBG;IACH,kBAAkB,IAAI,aAAa;IAcnC;;;;;;;;;;;;;OAaG;IACH,2BAA2B,CAAC,YAAY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