@gala-chain/launchpad-sdk 3.16.1 → 3.16.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,79 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.16.3
4
+
5
+ ### Patch Changes
6
+
7
+ - ## Fix: Correct Token Format Conversion for Price History (v3.16.3)
8
+
9
+ Simplified token format conversion - removed overly strict validation and corrected the format
10
+ transformation logic.
11
+
12
+ The API expects simple pipe-to-dollar conversion:
13
+ - Input: `GALA|Unit|none|none`
14
+ - Output: `GALA$Unit$none$none`
15
+
16
+ Changed PriceHistoryService to:
17
+ - Use existing token normalization utilities
18
+ - Apply simple pipe-to-dollar format conversion
19
+ - Remove overly strict token format validation that was incorrectly rejecting valid formats
20
+
21
+ ## 3.16.2
22
+
23
+ ### Patch Changes
24
+
25
+ - ## Enhancement: Token Format Validation for Price History (v3.16.2)
26
+
27
+ **Added validation** to ensure correct token ID format for DEX Backend API compatibility.
28
+
29
+ The price history API requires tokens to follow GalaChain's standard format where the token name
30
+ is stored in the `type` field:
31
+
32
+ ### Valid Formats
33
+
34
+ ✅ String format: `Token|Unit|{TOKEN_NAME}|{additionalKey}`
35
+
36
+ ```typescript
37
+ sdk.fetchPriceHistory({ tokenId: 'Token|Unit|GALA|none' });
38
+ sdk.fetchPriceHistory({ tokenId: 'Token|Unit|SILK|none' });
39
+ ```
40
+
41
+ ✅ Object format:
42
+ `{ collection: "Token", category: "Unit", type: "{TOKEN_NAME}", additionalKey: "{key}" }`
43
+
44
+ ```typescript
45
+ sdk.fetchPriceHistory({
46
+ tokenId: { collection: 'Token', category: 'Unit', type: 'GALA', additionalKey: 'none' },
47
+ });
48
+ ```
49
+
50
+ ### Invalid Formats (Now Rejected)
51
+
52
+ ❌ `GALA|Unit|none|none` - Token name in first field instead of third ❌ `Gala|Unit|none|none` -
53
+ Mixed case, ambiguous format ❌
54
+ `{ collection: 'GALA', category: 'Unit', type: 'none', additionalKey: 'none' }` - Wrong field
55
+ mapping
56
+
57
+ ### Error Messages
58
+
59
+ When invalid format is provided, users now get clear guidance:
60
+
61
+ ```
62
+ Invalid tokenId format for price history. Expected format: "Token|Unit|{TOKEN_NAME}|{additionalKey}"
63
+ (e.g., "Token|Unit|GALA|none"). Received: "GALA|Unit|none|none".
64
+ The token name must be in the third field (type), not the first field (collection).
65
+ ```
66
+
67
+ ### Changes
68
+ - Added comprehensive token format validation in `PriceHistoryService.validateOptions()`
69
+ - Validates both string and object token ID formats
70
+ - Provides clear error messages with examples
71
+ - Prevents silent failures from incorrect token format mapping
72
+ - Ensures DEX Backend API receives correctly formatted token identifiers
73
+
74
+ This prevents subtle bugs where tokens like `GALA|Unit|none|none` would be silently converted to
75
+ `none$Unit$none$none` (wrong).
76
+
3
77
  ## 3.16.1
4
78
 
5
79
  ### Patch Changes
@@ -3,5 +3,5 @@
3
3
  * This file is generated by scripts/inject-version.ts during build
4
4
  * DO NOT EDIT MANUALLY
5
5
  */
6
- export declare const SDK_VERSION = "3.16.1";
6
+ export declare const SDK_VERSION = "3.16.3";
7
7
  //# sourceMappingURL=version.generated.d.ts.map