@gmx-io/sdk 1.6.4 → 1.8.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/README.md +48 -0
- package/build/cjs/scripts/subsquid-codegen.js +1 -1
- package/build/cjs/src/clients/v1/testUtil.js +1 -1
- package/build/cjs/src/clients/v2/__tests__/data.spec.js +5 -5
- package/build/cjs/src/clients/v2/__tests__/decrease.spec.js +6 -6
- package/build/cjs/src/clients/v2/__tests__/editCancel.spec.js +12 -12
- package/build/cjs/src/clients/v2/__tests__/errors.spec.js +1 -47
- package/build/cjs/src/clients/v2/__tests__/errorsLifecycle.spec.js +53 -0
- package/build/cjs/src/clients/v2/__tests__/globalCleanup.js +80 -0
- package/build/cjs/src/clients/v2/__tests__/increase.spec.js +14 -14
- package/build/cjs/src/clients/v2/__tests__/multichain.spec.js +5 -6
- package/build/cjs/src/clients/v2/__tests__/prepareErrors.spec.js +167 -0
- package/build/cjs/src/clients/v2/__tests__/setupAllowance.js +32 -0
- package/build/cjs/src/clients/v2/__tests__/subaccount.spec.js +16 -123
- package/build/cjs/src/clients/v2/__tests__/subaccountLifecycle.spec.js +108 -0
- package/build/cjs/src/clients/v2/__tests__/testUtil.js +38 -5
- package/build/cjs/src/clients/v2/__tests__/tradingCapacity.spec.js +371 -0
- package/build/cjs/src/clients/v2/index.js +10 -1
- package/build/cjs/src/codegen/subsquid.js +284 -20
- package/build/cjs/src/configs/__tests__/markets.spec.js +8 -0
- package/build/cjs/src/utils/__tests__/markets.spec.js +60 -0
- package/build/cjs/src/utils/__tests__/numbers.spec.js +39 -0
- package/build/cjs/src/utils/__tests__/positionPnlCap.spec.js +78 -0
- package/build/cjs/src/utils/__tests__/positions.spec.js +16 -4
- package/build/cjs/src/utils/markets/api.js +90 -2
- package/build/cjs/src/utils/markets/multicall.js +4 -6
- package/build/cjs/src/utils/markets/types.js +8 -0
- package/build/cjs/src/utils/markets/utils.js +67 -9
- package/build/cjs/src/utils/numbers/utils.js +28 -9
- package/build/cjs/src/utils/orderTransactions/api.js +160 -2
- package/build/cjs/src/utils/positions/utils.js +1 -1
- package/build/cjs/src/utils/tradeHistory/__tests__/utils.spec.js +64 -0
- package/build/cjs/src/utils/tradeHistory/utils.js +2 -0
- package/build/cjs/src/utils/yield/api.js +13 -0
- package/build/cjs/src/utils/yield/types.js +2 -0
- package/build/esm/scripts/subsquid-codegen.js +1 -1
- package/build/esm/src/clients/v1/testUtil.js +1 -1
- package/build/esm/src/clients/v2/__tests__/data.spec.js +6 -6
- package/build/esm/src/clients/v2/__tests__/decrease.spec.js +7 -7
- package/build/esm/src/clients/v2/__tests__/editCancel.spec.js +13 -13
- package/build/esm/src/clients/v2/__tests__/errors.spec.js +2 -48
- package/build/esm/src/clients/v2/__tests__/errorsLifecycle.spec.js +51 -0
- package/build/esm/src/clients/v2/__tests__/globalCleanup.js +77 -0
- package/build/esm/src/clients/v2/__tests__/increase.spec.js +15 -15
- package/build/esm/src/clients/v2/__tests__/multichain.spec.js +6 -7
- package/build/esm/src/clients/v2/__tests__/prepareErrors.spec.js +165 -0
- package/build/esm/src/clients/v2/__tests__/setupAllowance.js +30 -0
- package/build/esm/src/clients/v2/__tests__/subaccount.spec.js +17 -124
- package/build/esm/src/clients/v2/__tests__/subaccountLifecycle.spec.js +106 -0
- package/build/esm/src/clients/v2/__tests__/testUtil.js +33 -4
- package/build/esm/src/clients/v2/__tests__/tradingCapacity.spec.js +369 -0
- package/build/esm/src/clients/v2/index.js +10 -2
- package/build/esm/src/codegen/subsquid.js +282 -18
- package/build/esm/src/configs/__tests__/markets.spec.js +9 -1
- package/build/esm/src/utils/__tests__/markets.spec.js +61 -1
- package/build/esm/src/utils/__tests__/numbers.spec.js +40 -1
- package/build/esm/src/utils/__tests__/positionPnlCap.spec.js +76 -0
- package/build/esm/src/utils/__tests__/positions.spec.js +17 -5
- package/build/esm/src/utils/markets/api.js +88 -2
- package/build/esm/src/utils/markets/multicall.js +4 -6
- package/build/esm/src/utils/markets/types.js +8 -0
- package/build/esm/src/utils/markets/utils.js +65 -8
- package/build/esm/src/utils/numbers/utils.js +24 -7
- package/build/esm/src/utils/orderTransactions/api.js +157 -1
- package/build/esm/src/utils/positions/utils.js +2 -2
- package/build/esm/src/utils/tradeHistory/__tests__/utils.spec.js +62 -0
- package/build/esm/src/utils/tradeHistory/utils.js +2 -0
- package/build/esm/src/utils/yield/api.js +9 -0
- package/build/esm/src/utils/yield/types.js +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/src/clients/v2/__tests__/errorsLifecycle.spec.d.ts +1 -0
- package/build/types/src/clients/v2/__tests__/globalCleanup.d.ts +1 -0
- package/build/types/src/clients/v2/__tests__/prepareErrors.spec.d.ts +1 -0
- package/build/types/src/clients/v2/__tests__/setupAllowance.d.ts +1 -0
- package/build/types/src/clients/v2/__tests__/subaccountLifecycle.spec.d.ts +1 -0
- package/build/types/src/clients/v2/__tests__/testUtil.d.ts +7 -1
- package/build/types/src/clients/v2/__tests__/tradingCapacity.spec.d.ts +1 -0
- package/build/types/src/clients/v2/index.d.ts +11 -5
- package/build/types/src/codegen/subsquid.d.ts +1141 -51
- package/build/types/src/utils/__tests__/positionPnlCap.spec.d.ts +1 -0
- package/build/types/src/utils/markets/api.d.ts +6 -2
- package/build/types/src/utils/markets/types.d.ts +28 -1
- package/build/types/src/utils/markets/utils.d.ts +7 -8
- package/build/types/src/utils/numbers/utils.d.ts +2 -0
- package/build/types/src/utils/orderTransactions/api.d.ts +50 -0
- package/build/types/src/utils/tradeHistory/__tests__/utils.spec.d.ts +1 -0
- package/build/types/src/utils/tradeHistory/types.d.ts +2 -0
- package/build/types/src/utils/yield/api.d.ts +5 -0
- package/build/types/src/utils/yield/types.d.ts +29 -0
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IHttp } from "../http/types";
|
|
2
2
|
import { TokenData } from "../tokens/types";
|
|
3
|
-
import {
|
|
3
|
+
import { GetTradingCapacityParams, MarketTickerWithCapacity, MarketWithTiers, RawMarketConfig, RawMarketInfo, RawMarketValues, TradingCapacity } from "./types";
|
|
4
4
|
export declare function fetchApiMarketsInfo(ctx: {
|
|
5
5
|
api: IHttp;
|
|
6
6
|
}): Promise<RawMarketInfo[]>;
|
|
@@ -21,4 +21,8 @@ export declare function fetchApiMarketsTickers(ctx: {
|
|
|
21
21
|
}, params?: {
|
|
22
22
|
addresses?: string[];
|
|
23
23
|
symbols?: string[];
|
|
24
|
-
}): Promise<
|
|
24
|
+
}): Promise<MarketTickerWithCapacity[]>;
|
|
25
|
+
export declare function parseTradingCapacity(raw: unknown): TradingCapacity | undefined;
|
|
26
|
+
export declare function fetchApiTradingCapacity(ctx: {
|
|
27
|
+
api: IHttp;
|
|
28
|
+
}, params: GetTradingCapacityParams): Promise<TradingCapacity>;
|
|
@@ -79,6 +79,14 @@ export type MarketInfo = Market & MarketPoolTokens & {
|
|
|
79
79
|
shortInterestUsd: bigint;
|
|
80
80
|
longInterestInTokens: bigint;
|
|
81
81
|
shortInterestInTokens: bigint;
|
|
82
|
+
longInterestUsdUsingLongToken?: bigint;
|
|
83
|
+
longInterestUsdUsingShortToken?: bigint;
|
|
84
|
+
shortInterestUsdUsingLongToken?: bigint;
|
|
85
|
+
shortInterestUsdUsingShortToken?: bigint;
|
|
86
|
+
longInterestInTokensUsingLongToken?: bigint;
|
|
87
|
+
longInterestInTokensUsingShortToken?: bigint;
|
|
88
|
+
shortInterestInTokensUsingLongToken?: bigint;
|
|
89
|
+
shortInterestInTokensUsingShortToken?: bigint;
|
|
82
90
|
positionFeeFactorForBalanceWasImproved: bigint;
|
|
83
91
|
positionFeeFactorForBalanceWasNotImproved: bigint;
|
|
84
92
|
positionImpactFactorPositive: bigint;
|
|
@@ -124,7 +132,7 @@ export type RawOpenInterestValues = {
|
|
|
124
132
|
shortInterestInTokensUsingLongToken: bigint;
|
|
125
133
|
shortInterestInTokensUsingShortToken: bigint;
|
|
126
134
|
};
|
|
127
|
-
export declare const MARKET_VALUES_KEYS: readonly ["longInterestUsd", "shortInterestUsd", "longInterestInTokens", "shortInterestInTokens", "longPoolAmount", "shortPoolAmount", "poolValueMin", "poolValueMax", "totalBorrowingFees", "positionImpactPoolAmount", "swapImpactPoolAmountLong", "swapImpactPoolAmountShort", "borrowingFactorPerSecondForLongs", "borrowingFactorPerSecondForShorts", "fundingFactorPerSecond", "longsPayShorts", "virtualPoolAmountForLongToken", "virtualPoolAmountForShortToken", "virtualInventoryForPositions", "virtualInventoryForPositionsInTokens"];
|
|
135
|
+
export declare const MARKET_VALUES_KEYS: readonly ["longInterestUsd", "shortInterestUsd", "longInterestInTokens", "shortInterestInTokens", "longInterestUsdUsingLongToken", "longInterestUsdUsingShortToken", "shortInterestUsdUsingLongToken", "shortInterestUsdUsingShortToken", "longInterestInTokensUsingLongToken", "longInterestInTokensUsingShortToken", "shortInterestInTokensUsingLongToken", "shortInterestInTokensUsingShortToken", "longPoolAmount", "shortPoolAmount", "poolValueMin", "poolValueMax", "totalBorrowingFees", "positionImpactPoolAmount", "swapImpactPoolAmountLong", "swapImpactPoolAmountShort", "borrowingFactorPerSecondForLongs", "borrowingFactorPerSecondForShorts", "fundingFactorPerSecond", "longsPayShorts", "virtualPoolAmountForLongToken", "virtualPoolAmountForShortToken", "virtualInventoryForPositions", "virtualInventoryForPositionsInTokens"];
|
|
128
136
|
/**
|
|
129
137
|
* Updates frequently
|
|
130
138
|
*/
|
|
@@ -184,6 +192,21 @@ export type ClaimableFunding = {
|
|
|
184
192
|
export type ClaimableFundingData = {
|
|
185
193
|
[marketAddress: string]: ClaimableFunding;
|
|
186
194
|
};
|
|
195
|
+
export type TradingCapacityLimitingFactor = "reserve" | "openInterest" | "both" | "notApplicable";
|
|
196
|
+
export type JitDataStatus = "available" | "stale" | "unavailable";
|
|
197
|
+
export type MarketDataStatus = "fresh" | "stale";
|
|
198
|
+
export type TradingCapacity = {
|
|
199
|
+
availableLiquidity: bigint;
|
|
200
|
+
baseAvailableLiquidity: bigint;
|
|
201
|
+
jitAvailableLiquidity: bigint;
|
|
202
|
+
limitingFactor: TradingCapacityLimitingFactor;
|
|
203
|
+
jitDataStatus: JitDataStatus;
|
|
204
|
+
marketDataStatus: MarketDataStatus;
|
|
205
|
+
};
|
|
206
|
+
export type GetTradingCapacityParams = {
|
|
207
|
+
symbol: string;
|
|
208
|
+
direction: "long" | "short";
|
|
209
|
+
};
|
|
187
210
|
export type MarketTicker = {
|
|
188
211
|
symbol: string;
|
|
189
212
|
marketTokenAddress: string;
|
|
@@ -213,6 +236,10 @@ export type MarketTicker = {
|
|
|
213
236
|
netRateLong: bigint;
|
|
214
237
|
netRateShort: bigint;
|
|
215
238
|
};
|
|
239
|
+
export type MarketTickerWithCapacity = MarketTicker & {
|
|
240
|
+
capacityLong?: TradingCapacity;
|
|
241
|
+
capacityShort?: TradingCapacity;
|
|
242
|
+
};
|
|
216
243
|
export type LeverageTier = {
|
|
217
244
|
maxLeverage: bigint;
|
|
218
245
|
minCollateralFactor: bigint;
|
|
@@ -62,20 +62,19 @@ export declare function getOiUsdFromRawValues(rawValues: {
|
|
|
62
62
|
longInterestUsingShortToken: bigint;
|
|
63
63
|
shortInterestUsingLongToken: bigint;
|
|
64
64
|
shortInterestUsingShortToken: bigint;
|
|
65
|
-
}, marketDivisor: bigint):
|
|
66
|
-
longInterestUsd: bigint;
|
|
67
|
-
shortInterestUsd: bigint;
|
|
68
|
-
};
|
|
65
|
+
}, marketDivisor: bigint): Pick<MarketInfo, "longInterestUsd" | "shortInterestUsd" | "longInterestUsdUsingLongToken" | "longInterestUsdUsingShortToken" | "shortInterestUsdUsingLongToken" | "shortInterestUsdUsingShortToken">;
|
|
69
66
|
export declare function getOiInTokensFromRawValues(rawValues: {
|
|
70
67
|
longInterestInTokensUsingLongToken: bigint;
|
|
71
68
|
longInterestInTokensUsingShortToken: bigint;
|
|
72
69
|
shortInterestInTokensUsingLongToken: bigint;
|
|
73
70
|
shortInterestInTokensUsingShortToken: bigint;
|
|
74
|
-
}, marketDivisor: bigint):
|
|
75
|
-
longInterestInTokens: bigint;
|
|
76
|
-
shortInterestInTokens: bigint;
|
|
77
|
-
};
|
|
71
|
+
}, marketDivisor: bigint): Pick<MarketInfo, "longInterestInTokens" | "shortInterestInTokens" | "longInterestInTokensUsingLongToken" | "longInterestInTokensUsingShortToken" | "shortInterestInTokensUsingLongToken" | "shortInterestInTokensUsingShortToken">;
|
|
78
72
|
export declare function getMarketPnl(marketInfo: MarketInfo, isLong: boolean, forMaxPoolValue: boolean): bigint;
|
|
73
|
+
/**
|
|
74
|
+
* Mirrors MarketUtils.getPositivePnl, the denominator of the per-position pnl cap since v2.2c.
|
|
75
|
+
* Pool value keeps using the net {@link getMarketPnl}. Falls back to it without the collateral split.
|
|
76
|
+
*/
|
|
77
|
+
export declare function getPositiveMarketPnl(marketInfo: MarketInfo, isLong: boolean, forMaxPoolValue: boolean): bigint;
|
|
79
78
|
export declare function getOpenInterestUsd(marketInfo: MarketInfo, isLong: boolean): bigint;
|
|
80
79
|
export declare function getOpenInterestInTokens(marketInfo: MarketInfo, isLong: boolean): bigint;
|
|
81
80
|
export declare function getOpenInterestForBalance(marketInfo: MarketInfo, isLong: boolean): bigint;
|
|
@@ -13,6 +13,8 @@ export declare const BN_ONE = 1n;
|
|
|
13
13
|
export declare const BN_NEGATIVE_ONE = -1n;
|
|
14
14
|
export declare const MaxUint256: bigint;
|
|
15
15
|
export declare const MaxInt256: bigint;
|
|
16
|
+
export declare function parseUint256DecimalString(value: unknown): bigint | undefined;
|
|
17
|
+
export declare function isUint256(value: unknown): value is bigint;
|
|
16
18
|
export declare const PERCENT_PRECISION_DECIMALS: number;
|
|
17
19
|
export declare const TRIGGER_PREFIX_ABOVE = ">";
|
|
18
20
|
export declare const TRIGGER_PREFIX_BELOW = "<";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ContractsChainId } from "../../configs/chains";
|
|
2
2
|
import { IHttp } from "../http/types";
|
|
3
|
+
import type { TradingCapacity } from "../markets/types";
|
|
3
4
|
import type { IAbstractSigner } from "../signer";
|
|
4
5
|
export type OrderKind = "increase" | "decrease" | "swap";
|
|
5
6
|
export type SimpleOrderType = "market" | "limit" | "stop-market" | "take-profit" | "stop-loss" | "twap";
|
|
@@ -49,6 +50,51 @@ export type OrderEstimates = {
|
|
|
49
50
|
positionFeeUsd: bigint;
|
|
50
51
|
borrowingFeeUsd: bigint;
|
|
51
52
|
fundingFeeUsd: bigint;
|
|
53
|
+
tradingCapacity?: TradingCapacity;
|
|
54
|
+
};
|
|
55
|
+
export type OrderValidationWarning = {
|
|
56
|
+
code: "INSUFFICIENT_LIQUIDITY";
|
|
57
|
+
message: string;
|
|
58
|
+
details: TradingCapacity & {
|
|
59
|
+
requestedSizeUsd: bigint;
|
|
60
|
+
};
|
|
61
|
+
} | {
|
|
62
|
+
code: "TRADING_CAPACITY_UNAVAILABLE";
|
|
63
|
+
message: string;
|
|
64
|
+
details: {
|
|
65
|
+
reason: "STALE_MARKET_DATA" | "JIT_DATA_UNAVAILABLE" | "JIT_ACCOUNT_ELIGIBILITY_UNKNOWN" | "COLLATERAL_SWAP";
|
|
66
|
+
};
|
|
67
|
+
} | {
|
|
68
|
+
code: "UNKNOWN_VALIDATION_WARNING";
|
|
69
|
+
originalCode: string;
|
|
70
|
+
message: string;
|
|
71
|
+
details?: unknown;
|
|
72
|
+
};
|
|
73
|
+
export type PrepareOrderErrorCode = "INVALID_PARAMS" | "MARKET_NOT_FOUND" | "TOKEN_NOT_FOUND" | "NO_SWAP_PATH" | "POSITION_NOT_FOUND";
|
|
74
|
+
export type PrepareOrderFieldValidationErrors = Record<string, {
|
|
75
|
+
message: string;
|
|
76
|
+
value?: unknown;
|
|
77
|
+
}>;
|
|
78
|
+
export type PrepareOrderError = {
|
|
79
|
+
code: "INSUFFICIENT_LIQUIDITY";
|
|
80
|
+
message: string;
|
|
81
|
+
details: TradingCapacity & {
|
|
82
|
+
requestedSizeUsd: bigint;
|
|
83
|
+
};
|
|
84
|
+
} | {
|
|
85
|
+
code: PrepareOrderErrorCode;
|
|
86
|
+
message: string;
|
|
87
|
+
} | {
|
|
88
|
+
code: "UNKNOWN_PREPARE_ORDER_ERROR";
|
|
89
|
+
originalCode: string;
|
|
90
|
+
message: string;
|
|
91
|
+
traceId?: string;
|
|
92
|
+
} | {
|
|
93
|
+
code?: undefined;
|
|
94
|
+
message: string;
|
|
95
|
+
} | {
|
|
96
|
+
code?: undefined;
|
|
97
|
+
message: PrepareOrderFieldValidationErrors;
|
|
52
98
|
};
|
|
53
99
|
export type PrepareOrderResponse = {
|
|
54
100
|
requestId: string;
|
|
@@ -59,6 +105,7 @@ export type PrepareOrderResponse = {
|
|
|
59
105
|
estimates?: OrderEstimates;
|
|
60
106
|
expiresAt?: number;
|
|
61
107
|
warnings?: string[];
|
|
108
|
+
validationWarnings?: OrderValidationWarning[];
|
|
62
109
|
traceId?: string;
|
|
63
110
|
};
|
|
64
111
|
export type SubmitOrderRequest = {
|
|
@@ -136,6 +183,9 @@ export type PrepareCollateralRequest = {
|
|
|
136
183
|
subaccountAddress?: string;
|
|
137
184
|
subaccountApproval?: Record<string, any>;
|
|
138
185
|
};
|
|
186
|
+
export declare function parsePrepareOrderError(error: unknown): PrepareOrderError | undefined;
|
|
187
|
+
/** Validates an already deserialized prepare error. Use parsePrepareOrderError for a caught HttpError. */
|
|
188
|
+
export declare function isPrepareOrderError(value: unknown): value is PrepareOrderError;
|
|
139
189
|
export declare function prepareOrder(ctx: {
|
|
140
190
|
api: IHttp;
|
|
141
191
|
}, request: PrepareOrderRequest): Promise<PrepareOrderResponse>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ApiParameterPeriod } from "../rates/types";
|
|
2
|
+
export type GmPoolYieldPnlWindow = {
|
|
3
|
+
period: ApiParameterPeriod;
|
|
4
|
+
startTimestamp: number;
|
|
5
|
+
endTimestamp: number;
|
|
6
|
+
};
|
|
7
|
+
export type GmPoolYieldPnlComponents = {
|
|
8
|
+
realizedPnlLongUsd: number;
|
|
9
|
+
realizedPnlShortUsd: number;
|
|
10
|
+
unrealizedPnlLongUsd: number;
|
|
11
|
+
unrealizedPnlShortUsd: number;
|
|
12
|
+
};
|
|
13
|
+
export type GmPoolYieldPnlEntry = {
|
|
14
|
+
marketToken: string;
|
|
15
|
+
feeApy: number | null;
|
|
16
|
+
tradersPnlUsd: number | null;
|
|
17
|
+
tradersPnlApr: number | null;
|
|
18
|
+
timeWeightedPoolValue: number | null;
|
|
19
|
+
window: GmPoolYieldPnlWindow;
|
|
20
|
+
components?: GmPoolYieldPnlComponents;
|
|
21
|
+
};
|
|
22
|
+
export type GmPoolsYieldPnlResponse = {
|
|
23
|
+
pools: GmPoolYieldPnlEntry[];
|
|
24
|
+
};
|
|
25
|
+
export type GmPoolsYieldPnlParams = {
|
|
26
|
+
pools?: string[];
|
|
27
|
+
period?: ApiParameterPeriod;
|
|
28
|
+
includeComponents?: boolean;
|
|
29
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gmx-io/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -506,6 +506,7 @@
|
|
|
506
506
|
"test:ci": "vitest run",
|
|
507
507
|
"test:multicall": "vitest run --config vitest.multicall.config.ts",
|
|
508
508
|
"test:v2": "vitest run --config vitest.v2.config.ts",
|
|
509
|
+
"test:v2:public": "vitest run --config vitest.v2.public.config.ts",
|
|
509
510
|
"build": "rm -rf build && yarn build:types && yarn build:cjs && yarn build:esm && yarn clean",
|
|
510
511
|
"build:cjs": "tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > build/cjs/src/package.json",
|
|
511
512
|
"build:esm": "tsc -p tsconfig.esm.json && echo '{\"type\": \"module\"}' > build/esm/src/package.json",
|