@gmx-io/sdk 1.0.6 → 1.0.7

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.
@@ -16,9 +16,9 @@ export function getMarketIndexName(p) {
16
16
  const prefix = getTokenVisualMultiplier(firstToken);
17
17
  return `${prefix}${firstToken.baseSymbol || firstToken.symbol}/USD`;
18
18
  }
19
- export function getMarketPoolName(p) {
19
+ export function getMarketPoolName(p, separator = "-") {
20
20
  const { longToken, shortToken } = p;
21
- return `${longToken.symbol}-${shortToken.symbol}`;
21
+ return `${longToken.symbol}${separator}${shortToken.symbol}`;
22
22
  }
23
23
  export function getContractMarketPrices(tokensData, market) {
24
24
  const indexToken = getByKey(tokensData, market.indexTokenAddress);
@@ -3,6 +3,7 @@ import { bigMath } from "./bigmath";
3
3
  export const USD_DECIMALS = 30;
4
4
  export const BASIS_POINTS_DIVISOR = 10000;
5
5
  export const BASIS_POINTS_DIVISOR_BIGINT = 10000n;
6
+ export const BASIS_POINTS_DECIMALS = 4;
6
7
  export const PRECISION_DECIMALS = 30;
7
8
  export const PRECISION = expandDecimals(1, PRECISION_DECIMALS);
8
9
  export const BN_ZERO = 0n;
@@ -38,8 +38,8 @@ export function createRawTradeActionTransformer(marketsInfoData, wrappedToken, t
38
38
  initialCollateralToken,
39
39
  timestamp: rawAction.timestamp,
40
40
  transaction: rawAction.transaction,
41
- reason: rawAction.reason,
42
- reasonBytes: rawAction.reasonBytes,
41
+ reason: rawAction.reason ?? undefined,
42
+ reasonBytes: rawAction.reasonBytes ?? undefined,
43
43
  twapParams: rawAction.twapGroupId && rawAction.numberOfParts
44
44
  ? {
45
45
  twapGroupId: rawAction.twapGroupId,
@@ -112,8 +112,8 @@ export function createRawTradeActionTransformer(marketsInfoData, wrappedToken, t
112
112
  borrowingFeeAmount: rawAction.borrowingFeeAmount ? BigInt(rawAction.borrowingFeeAmount) : undefined,
113
113
  fundingFeeAmount: rawAction.fundingFeeAmount ? BigInt(rawAction.fundingFeeAmount) : undefined,
114
114
  liquidationFeeAmount: rawAction.liquidationFeeAmount ? BigInt(rawAction.liquidationFeeAmount) : undefined,
115
- reason: rawAction.reason,
116
- reasonBytes: rawAction.reasonBytes,
115
+ reason: rawAction.reason ?? undefined,
116
+ reasonBytes: rawAction.reasonBytes ?? undefined,
117
117
  transaction: rawAction.transaction,
118
118
  timestamp: rawAction.timestamp,
119
119
  shouldUnwrapNativeToken: rawAction.shouldUnwrapNativeToken,
@@ -1,4 +1,4 @@
1
- export { USD_DECIMALS, BASIS_POINTS_DIVISOR, BASIS_POINTS_DIVISOR_BIGINT } from "../utils/numbers";
1
+ export { USD_DECIMALS, BASIS_POINTS_DIVISOR, BASIS_POINTS_DIVISOR_BIGINT, BASIS_POINTS_DECIMALS } from "../utils/numbers";
2
2
  export declare const HIGH_PRICE_IMPACT_BPS = 80;
3
3
  export declare const HIGH_POSITION_IMPACT_BPS = 50;
4
4
  export declare const HIGH_COLLATERAL_IMPACT_BPS = 500;