@pear-protocol/hyperliquid-sdk 0.0.77 → 0.0.78

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.
Files changed (2) hide show
  1. package/dist/index.js +5 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -114,7 +114,7 @@ const useMarketData = create((set) => ({
114
114
  * Convert a full/prefixed symbol (e.g., "xyz:XYZ100") to a display symbol (e.g., "XYZ100").
115
115
  */
116
116
  function toDisplaySymbol(symbol) {
117
- const parts = symbol.split(':');
117
+ const parts = symbol.split(":");
118
118
  return parts.length > 1 ? parts.slice(-1)[0] : symbol;
119
119
  }
120
120
  /**
@@ -125,6 +125,8 @@ function toDisplaySymbol(symbol) {
125
125
  * @param hip3Assets map of display -> all full market names (e.g., "TSLA" -> ["xyz:TSLA", "flx:TSLA"])
126
126
  */
127
127
  function toBackendSymbol(displaySymbol, hip3Assets) {
128
+ if (displaySymbol === "BTC")
129
+ return "BTC";
128
130
  const markets = hip3Assets.get(displaySymbol);
129
131
  // Return first market if available, otherwise return original symbol
130
132
  return markets && markets.length > 0 ? markets[0] : displaySymbol;
@@ -169,7 +171,7 @@ function getAvailableMarkets(displaySymbol, hip3Assets) {
169
171
  * @returns The prefix (e.g., "xyz") or undefined if no prefix
170
172
  */
171
173
  function getMarketPrefix(fullSymbol) {
172
- const parts = fullSymbol.split(':');
174
+ const parts = fullSymbol.split(":");
173
175
  return parts.length > 1 ? parts[0] : undefined;
174
176
  }
175
177
  /**
@@ -178,7 +180,7 @@ function getMarketPrefix(fullSymbol) {
178
180
  * @returns true if the symbol has a market prefix
179
181
  */
180
182
  function isHip3Market(symbol) {
181
- return symbol.includes(':');
183
+ return symbol.includes(":");
182
184
  }
183
185
 
184
186
  const useHyperliquidWebSocket = ({ wsUrl, address, enabled = true, }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/hyperliquid-sdk",
3
- "version": "0.0.77",
3
+ "version": "0.0.78",
4
4
  "description": "React SDK for Pear Protocol Hyperliquid API integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",