@blackcube/xgate-sdk 0.25.4 → 0.56.0

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/index.cjs CHANGED
@@ -679,6 +679,57 @@ exports.CandlesService = __decorateClass([
679
679
  common.Injectable()
680
680
  ], exports.CandlesService);
681
681
 
682
+ // src/helpers/asset-class.ts
683
+ var BINANCE = {
684
+ COIN: "crypto",
685
+ EQUITY: "stock",
686
+ CN_EQUITY: "stock",
687
+ HK_EQUITY: "stock",
688
+ KR_EQUITY: "stock",
689
+ PREMARKET: "stock",
690
+ COMMODITY: "commodity",
691
+ INDEX: "index"
692
+ };
693
+ var BYBIT = {
694
+ "": "crypto",
695
+ innovation: "crypto",
696
+ stock: "stock",
697
+ commodity: "commodity",
698
+ ETF: "etf"
699
+ };
700
+ var EXTENDED = {
701
+ Equity: "stock",
702
+ Commodity: "commodity",
703
+ "ETF/Index": "index",
704
+ FX: "forex",
705
+ "Pre-market": "stock"
706
+ };
707
+ function assetClassOf(xex, xtras) {
708
+ if (xtras === void 0) {
709
+ return void 0;
710
+ }
711
+ if (xex === "binance") {
712
+ const brut = xtras.underlyingType;
713
+ return typeof brut === "string" ? BINANCE[brut] : void 0;
714
+ }
715
+ if (xex === "bybit") {
716
+ const brut = xtras.symbolType;
717
+ return typeof brut === "string" ? BYBIT[brut] : void 0;
718
+ }
719
+ if (xex === "extended") {
720
+ const categorie = xtras.category;
721
+ if (typeof categorie !== "string") {
722
+ return void 0;
723
+ }
724
+ if (categorie !== "RWA") {
725
+ return "crypto";
726
+ }
727
+ const sous = xtras.subCategory;
728
+ return typeof sous === "string" ? EXTENDED[sous] : void 0;
729
+ }
730
+ return void 0;
731
+ }
732
+
682
733
  // src/helpers/contract-expiry.ts
683
734
  var DATED_CONTRACT_TYPES = /* @__PURE__ */ new Set([
684
735
  // binance : les trimestriels (`BTCUSDT_260925`, `ETHUSDT_261225`).
@@ -761,6 +812,7 @@ exports.CatalogService = class CatalogService {
761
812
  xex,
762
813
  kind: pair.kind,
763
814
  multiplier: multiplierFromXex(pair.name),
815
+ assetClass: assetClassOf(xex, pair.xtras),
764
816
  expiresAt: expiryOf(pair.xtras),
765
817
  ref: pair.ref ?? null,
766
818
  szDecimals: pair.szDecimals,
@@ -949,6 +1001,7 @@ exports.SpotCatalogService = class SpotCatalogService {
949
1001
  // Le comptant porte les mêmes échelles que le perp : `SATSUSDT` (×1) et `1000SATSUSDT`
950
1002
  // coexistent, et c'est justement entre eux que la comparaison serait fausse.
951
1003
  multiplier: multiplierFromXex(pair.name),
1004
+ assetClass: assetClassOf(xex, pair.xtras),
952
1005
  ref: pair.ref ?? null,
953
1006
  szDecimals: pair.szDecimals,
954
1007
  tickSize: pair.tickSize,
@@ -2139,7 +2192,7 @@ var CANDLES_PER_CALL = {
2139
2192
  blofin: 1440,
2140
2193
  aster: 1500,
2141
2194
  hyperliquid: 5e3,
2142
- pacifica: 500
2195
+ pacifica: 4e3
2143
2196
  };
2144
2197
  function candlesPerCallOf(xex) {
2145
2198
  return CANDLES_PER_CALL[xex];
@@ -2177,6 +2230,7 @@ exports.WALLET_XEXES = WALLET_XEXES;
2177
2230
  exports.WS_SUBSCRIPTION_LIMITS = WS_SUBSCRIPTION_LIMITS;
2178
2231
  exports.XGATE_EXCHANGES = XGATE_EXCHANGES;
2179
2232
  exports.XgateEx = XgateEx;
2233
+ exports.assetClassOf = assetClassOf;
2180
2234
  exports.buildLevels = buildLevels;
2181
2235
  exports.buildProtection = buildProtection;
2182
2236
  exports.candlesMaxHistoryOf = candlesMaxHistoryOf;