@gala-chain/launchpad-sdk 3.16.1 → 3.16.2

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,61 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.16.2
4
+
5
+ ### Patch Changes
6
+
7
+ - ## Enhancement: Token Format Validation for Price History (v3.16.2)
8
+
9
+ **Added validation** to ensure correct token ID format for DEX Backend API compatibility.
10
+
11
+ The price history API requires tokens to follow GalaChain's standard format where the token name
12
+ is stored in the `type` field:
13
+
14
+ ### Valid Formats
15
+
16
+ ✅ String format: `Token|Unit|{TOKEN_NAME}|{additionalKey}`
17
+
18
+ ```typescript
19
+ sdk.fetchPriceHistory({ tokenId: 'Token|Unit|GALA|none' });
20
+ sdk.fetchPriceHistory({ tokenId: 'Token|Unit|SILK|none' });
21
+ ```
22
+
23
+ ✅ Object format:
24
+ `{ collection: "Token", category: "Unit", type: "{TOKEN_NAME}", additionalKey: "{key}" }`
25
+
26
+ ```typescript
27
+ sdk.fetchPriceHistory({
28
+ tokenId: { collection: 'Token', category: 'Unit', type: 'GALA', additionalKey: 'none' },
29
+ });
30
+ ```
31
+
32
+ ### Invalid Formats (Now Rejected)
33
+
34
+ ❌ `GALA|Unit|none|none` - Token name in first field instead of third ❌ `Gala|Unit|none|none` -
35
+ Mixed case, ambiguous format ❌
36
+ `{ collection: 'GALA', category: 'Unit', type: 'none', additionalKey: 'none' }` - Wrong field
37
+ mapping
38
+
39
+ ### Error Messages
40
+
41
+ When invalid format is provided, users now get clear guidance:
42
+
43
+ ```
44
+ Invalid tokenId format for price history. Expected format: "Token|Unit|{TOKEN_NAME}|{additionalKey}"
45
+ (e.g., "Token|Unit|GALA|none"). Received: "GALA|Unit|none|none".
46
+ The token name must be in the third field (type), not the first field (collection).
47
+ ```
48
+
49
+ ### Changes
50
+ - Added comprehensive token format validation in `PriceHistoryService.validateOptions()`
51
+ - Validates both string and object token ID formats
52
+ - Provides clear error messages with examples
53
+ - Prevents silent failures from incorrect token format mapping
54
+ - Ensures DEX Backend API receives correctly formatted token identifiers
55
+
56
+ This prevents subtle bugs where tokens like `GALA|Unit|none|none` would be silently converted to
57
+ `none$Unit$none$none` (wrong).
58
+
3
59
  ## 3.16.1
4
60
 
5
61
  ### 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.2";
7
7
  //# sourceMappingURL=version.generated.d.ts.map