@pear-protocol/utils 1.0.0 → 1.1.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.
Files changed (2) hide show
  1. package/dist/index.js +13 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1133,6 +1133,7 @@ function precisePrice(connector, raw, precision, side = "BUY", slippageTolerance
1133
1133
  case "bybit":
1134
1134
  case "okx":
1135
1135
  case "lighter":
1136
+ case "lighter_rhc":
1136
1137
  return preciseTickGridPrice(effectiveRaw, precision, side);
1137
1138
  }
1138
1139
  }
@@ -1197,6 +1198,7 @@ function preciseQuantity(connector, raw, precision, side) {
1197
1198
  case "bybit":
1198
1199
  case "okx":
1199
1200
  case "lighter":
1201
+ case "lighter_rhc":
1200
1202
  return preciseStepGridQuantity(raw, precision, side);
1201
1203
  }
1202
1204
  }
@@ -1278,13 +1280,22 @@ function isPearCloid(connector, cloid) {
1278
1280
  if (!cloid) {
1279
1281
  return false;
1280
1282
  }
1281
- return PEAR_CLOID_CHECK[connector]?.(cloid) ?? false;
1283
+ return PEAR_CLOID_CHECK[connector](cloid);
1282
1284
  }
1283
1285
  __name(isPearCloid, "isPearCloid");
1284
1286
  var PEAR_CLOID_CHECK = {
1285
1287
  hyperliquid: /* @__PURE__ */ __name((cloid) => cloid.startsWith("0x50454152"), "hyperliquid"),
1286
- lighter: /* @__PURE__ */ __name((cloid) => cloid.length === 15 && cloid.startsWith("10"), "lighter")
1288
+ lighter: isLighterPearCloid,
1289
+ lighter_rhc: isLighterPearCloid,
1290
+ // No Pear brand is minted into a CEX client order id, so provenance cannot be read from it.
1291
+ binance: /* @__PURE__ */ __name(() => false, "binance"),
1292
+ bybit: /* @__PURE__ */ __name(() => false, "bybit"),
1293
+ okx: /* @__PURE__ */ __name(() => false, "okx")
1287
1294
  };
1295
+ function isLighterPearCloid(cloid) {
1296
+ return cloid.length === 15 && cloid.startsWith("10");
1297
+ }
1298
+ __name(isLighterPearCloid, "isLighterPearCloid");
1288
1299
 
1289
1300
  // src/sync/applicables/basket.ts
1290
1301
  var Basket = class _Basket {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/utils",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Pear Protocol Utility functions",
5
5
  "private": false,
6
6
  "type": "module",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@noble/hashes": "^1.3.2",
30
- "@pear-protocol/types": "^2.0.0",
30
+ "@pear-protocol/types": "^2.2.0",
31
31
  "@scure/base": "^2.3.0",
32
32
  "bignumber.js": "9.3.1"
33
33
  },