@stryke-xyz/premarket-sdk 1.1.6 → 1.1.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.
- package/dist/cjs/api/orderbook-api/deserializers.js +9 -3
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/shared/types.js +3 -2
- package/dist/esm/api/orderbook-api/deserializers.js +9 -3
- package/dist/esm/package.json +1 -1
- package/dist/esm/shared/types.js +3 -2
- package/dist/types/api/orderbook-api/deserializers.d.ts +6 -1
- package/dist/types/shared/types.d.ts +13 -1
- package/package.json +1 -1
|
@@ -98,15 +98,17 @@ function _object_spread_props(target, source) {
|
|
|
98
98
|
* Note: Most endpoints now return pre-formatted string values,
|
|
99
99
|
* so minimal deserialization is needed. These helpers are provided
|
|
100
100
|
* for cases where BigInt conversion is preferred on the client side.
|
|
101
|
-
*/ function parseOptionalBigInt(value) {
|
|
101
|
+
*/ /** @deprecated Use `instruments` instead. */ function parseOptionalBigInt(value) {
|
|
102
102
|
return value == null ? null : BigInt(value);
|
|
103
103
|
}
|
|
104
104
|
function parseIsCall(value) {
|
|
105
105
|
return value === true || value === 1;
|
|
106
106
|
}
|
|
107
107
|
function submarketToBigInt(submarket) {
|
|
108
|
+
var _submarket_marketId;
|
|
108
109
|
return {
|
|
109
110
|
id: submarket.id,
|
|
111
|
+
marketId: (_submarket_marketId = submarket.marketId) !== null && _submarket_marketId !== void 0 ? _submarket_marketId : submarket.id,
|
|
110
112
|
name: submarket.name,
|
|
111
113
|
tokenAddress: submarket.tokenAddress,
|
|
112
114
|
tokenDecimals: submarket.tokenDecimals,
|
|
@@ -148,6 +150,7 @@ function submarketToBigInt(submarket) {
|
|
|
148
150
|
/**
|
|
149
151
|
* Convert string market fields to BigInt while preserving addresses and labels.
|
|
150
152
|
*/ function marketToBigInt(market) {
|
|
153
|
+
var _market_logoUri, _market_hasFinalTick;
|
|
151
154
|
var baseMarket = {
|
|
152
155
|
id: market.id,
|
|
153
156
|
groupId: market.groupId,
|
|
@@ -163,14 +166,17 @@ function submarketToBigInt(submarket) {
|
|
|
163
166
|
collateralToken: market.collateralToken,
|
|
164
167
|
collateralDecimals: market.collateralDecimals,
|
|
165
168
|
maxDecimals: parseOptionalBigInt(market.maxDecimals),
|
|
166
|
-
marketType: market.marketType
|
|
169
|
+
marketType: market.marketType,
|
|
170
|
+
logoUri: (_market_logoUri = market.logoUri) !== null && _market_logoUri !== void 0 ? _market_logoUri : null,
|
|
171
|
+
hasFinalTick: (_market_hasFinalTick = market.hasFinalTick) !== null && _market_hasFinalTick !== void 0 ? _market_hasFinalTick : false
|
|
167
172
|
};
|
|
168
173
|
if (market.type === "erc20") {
|
|
174
|
+
var _ref, _market_instruments;
|
|
169
175
|
return _object_spread_props(_object_spread({}, baseMarket), {
|
|
170
176
|
type: "erc20",
|
|
171
177
|
underlying: market.underlying,
|
|
172
178
|
underlyingDecimals: market.underlyingDecimals,
|
|
173
|
-
|
|
179
|
+
instruments: ((_ref = (_market_instruments = market.instruments) !== null && _market_instruments !== void 0 ? _market_instruments : market.submarkets) !== null && _ref !== void 0 ? _ref : []).map(submarketToBigInt)
|
|
174
180
|
});
|
|
175
181
|
}
|
|
176
182
|
return _object_spread_props(_object_spread({}, baseMarket), {
|
package/dist/cjs/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@stryke-xyz/premarket-sdk","version":"1.1.
|
|
1
|
+
{"name":"@stryke-xyz/premarket-sdk","version":"1.1.7","type":"commonjs"}
|
package/dist/cjs/shared/types.js
CHANGED
|
@@ -25,10 +25,11 @@ Object.defineProperty(exports, "OrderStatus", {
|
|
|
25
25
|
OrderStatus["CANCELLED"] = "CANCELLED";
|
|
26
26
|
OrderStatus["EXPIRED"] = "EXPIRED";
|
|
27
27
|
return OrderStatus;
|
|
28
|
-
}({})
|
|
28
|
+
}({})// Enriched by the order-queue when returning user orders
|
|
29
|
+
/** If true, amount is in maker's makingAmount units. If false, amount is in maker's takingAmount units. */ /** The amount to pass to Exchange.fillOrder */ /** Whether fillAmount is in maker's makingAmount units (true) or takingAmount units (false) */ /** True if the user-submitted order's `amount` is in maker's makingAmount units. */ /** Set to "awaiting match" when the engine's match tail did not arrive within the API's wait window. */ // ============================================================================
|
|
29
30
|
// MARKET TYPES
|
|
30
31
|
// ============================================================================
|
|
31
|
-
// ============================================================================
|
|
32
|
+
/** True when the on-chain FinalTick event has been indexed for this market's current expiry. */ /** Numeric market_id of this sub-market (same as id for standalone, member id for grouped). */ /** Sub-markets / instruments in this ERC20 group. */ /** @deprecated Use `instruments` instead. Kept for backward compatibility. */ // ============================================================================
|
|
32
33
|
// POSITION & PNL TYPES
|
|
33
34
|
// ============================================================================
|
|
34
35
|
/** PnL contribution from limit-order trades */ /** PnL contribution from redemption / exercise settlements */ /**
|
|
@@ -56,15 +56,17 @@ function _object_spread_props(target, source) {
|
|
|
56
56
|
* Note: Most endpoints now return pre-formatted string values,
|
|
57
57
|
* so minimal deserialization is needed. These helpers are provided
|
|
58
58
|
* for cases where BigInt conversion is preferred on the client side.
|
|
59
|
-
*/ function parseOptionalBigInt(value) {
|
|
59
|
+
*/ /** @deprecated Use `instruments` instead. */ function parseOptionalBigInt(value) {
|
|
60
60
|
return value == null ? null : BigInt(value);
|
|
61
61
|
}
|
|
62
62
|
function parseIsCall(value) {
|
|
63
63
|
return value === true || value === 1;
|
|
64
64
|
}
|
|
65
65
|
function submarketToBigInt(submarket) {
|
|
66
|
+
var _submarket_marketId;
|
|
66
67
|
return {
|
|
67
68
|
id: submarket.id,
|
|
69
|
+
marketId: (_submarket_marketId = submarket.marketId) !== null && _submarket_marketId !== void 0 ? _submarket_marketId : submarket.id,
|
|
68
70
|
name: submarket.name,
|
|
69
71
|
tokenAddress: submarket.tokenAddress,
|
|
70
72
|
tokenDecimals: submarket.tokenDecimals,
|
|
@@ -106,6 +108,7 @@ function submarketToBigInt(submarket) {
|
|
|
106
108
|
/**
|
|
107
109
|
* Convert string market fields to BigInt while preserving addresses and labels.
|
|
108
110
|
*/ export function marketToBigInt(market) {
|
|
111
|
+
var _market_logoUri, _market_hasFinalTick;
|
|
109
112
|
var baseMarket = {
|
|
110
113
|
id: market.id,
|
|
111
114
|
groupId: market.groupId,
|
|
@@ -121,14 +124,17 @@ function submarketToBigInt(submarket) {
|
|
|
121
124
|
collateralToken: market.collateralToken,
|
|
122
125
|
collateralDecimals: market.collateralDecimals,
|
|
123
126
|
maxDecimals: parseOptionalBigInt(market.maxDecimals),
|
|
124
|
-
marketType: market.marketType
|
|
127
|
+
marketType: market.marketType,
|
|
128
|
+
logoUri: (_market_logoUri = market.logoUri) !== null && _market_logoUri !== void 0 ? _market_logoUri : null,
|
|
129
|
+
hasFinalTick: (_market_hasFinalTick = market.hasFinalTick) !== null && _market_hasFinalTick !== void 0 ? _market_hasFinalTick : false
|
|
125
130
|
};
|
|
126
131
|
if (market.type === "erc20") {
|
|
132
|
+
var _ref, _market_instruments;
|
|
127
133
|
return _object_spread_props(_object_spread({}, baseMarket), {
|
|
128
134
|
type: "erc20",
|
|
129
135
|
underlying: market.underlying,
|
|
130
136
|
underlyingDecimals: market.underlyingDecimals,
|
|
131
|
-
|
|
137
|
+
instruments: ((_ref = (_market_instruments = market.instruments) !== null && _market_instruments !== void 0 ? _market_instruments : market.submarkets) !== null && _ref !== void 0 ? _ref : []).map(submarketToBigInt)
|
|
132
138
|
});
|
|
133
139
|
}
|
|
134
140
|
return _object_spread_props(_object_spread({}, baseMarket), {
|
package/dist/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@stryke-xyz/premarket-sdk","version":"1.1.
|
|
1
|
+
{"name":"@stryke-xyz/premarket-sdk","version":"1.1.7","type":"module"}
|
package/dist/esm/shared/types.js
CHANGED
|
@@ -15,10 +15,11 @@
|
|
|
15
15
|
OrderStatus["CANCELLED"] = "CANCELLED";
|
|
16
16
|
OrderStatus["EXPIRED"] = "EXPIRED";
|
|
17
17
|
return OrderStatus;
|
|
18
|
-
}({})
|
|
18
|
+
}({})// Enriched by the order-queue when returning user orders
|
|
19
|
+
/** If true, amount is in maker's makingAmount units. If false, amount is in maker's takingAmount units. */ /** The amount to pass to Exchange.fillOrder */ /** Whether fillAmount is in maker's makingAmount units (true) or takingAmount units (false) */ /** True if the user-submitted order's `amount` is in maker's makingAmount units. */ /** Set to "awaiting match" when the engine's match tail did not arrive within the API's wait window. */ // ============================================================================
|
|
19
20
|
// MARKET TYPES
|
|
20
21
|
// ============================================================================
|
|
21
|
-
// ============================================================================
|
|
22
|
+
/** True when the on-chain FinalTick event has been indexed for this market's current expiry. */ /** Numeric market_id of this sub-market (same as id for standalone, member id for grouped). */ /** Sub-markets / instruments in this ERC20 group. */ /** @deprecated Use `instruments` instead. Kept for backward compatibility. */ // ============================================================================
|
|
22
23
|
// POSITION & PNL TYPES
|
|
23
24
|
// ============================================================================
|
|
24
25
|
/** PnL contribution from limit-order trades */ /** PnL contribution from redemption / exercise settlements */ /**
|
|
@@ -50,6 +50,8 @@ export interface BigIntBaseMarket {
|
|
|
50
50
|
collateralDecimals: number;
|
|
51
51
|
maxDecimals: bigint | null;
|
|
52
52
|
marketType: "ERC20xERC20" | "ERC20xERC6909";
|
|
53
|
+
logoUri: string | null;
|
|
54
|
+
hasFinalTick: boolean;
|
|
53
55
|
}
|
|
54
56
|
export interface BigIntErc6909Market extends BigIntBaseMarket {
|
|
55
57
|
type: "erc6909";
|
|
@@ -77,6 +79,7 @@ export interface BigIntErc6909Market extends BigIntBaseMarket {
|
|
|
77
79
|
}
|
|
78
80
|
export interface BigIntErc20Submarket {
|
|
79
81
|
id: string;
|
|
82
|
+
marketId: string;
|
|
80
83
|
name: string;
|
|
81
84
|
tokenAddress: string;
|
|
82
85
|
tokenDecimals: number;
|
|
@@ -88,7 +91,9 @@ export interface BigIntErc20Market extends BigIntBaseMarket {
|
|
|
88
91
|
type: "erc20";
|
|
89
92
|
underlying: string | null;
|
|
90
93
|
underlyingDecimals: number | null;
|
|
91
|
-
|
|
94
|
+
instruments: BigIntErc20Submarket[];
|
|
95
|
+
/** @deprecated Use `instruments` instead. */
|
|
96
|
+
submarkets?: BigIntErc20Submarket[];
|
|
92
97
|
}
|
|
93
98
|
export type BigIntMarket = BigIntErc6909Market | BigIntErc20Market;
|
|
94
99
|
/**
|
|
@@ -61,6 +61,9 @@ export interface StoredOrder {
|
|
|
61
61
|
status: OrderStatus;
|
|
62
62
|
side: "bid" | "ask";
|
|
63
63
|
price: number;
|
|
64
|
+
marketName?: string;
|
|
65
|
+
instrumentName?: string;
|
|
66
|
+
logoUri?: string | null;
|
|
64
67
|
}
|
|
65
68
|
export type MatchableOrder = StoredOrder;
|
|
66
69
|
export interface MatchRequest {
|
|
@@ -137,6 +140,9 @@ export interface BaseMarket {
|
|
|
137
140
|
collateralDecimals: number;
|
|
138
141
|
maxDecimals: string | null;
|
|
139
142
|
marketType: "ERC20xERC20" | "ERC20xERC6909";
|
|
143
|
+
logoUri: string | null;
|
|
144
|
+
/** True when the on-chain FinalTick event has been indexed for this market's current expiry. */
|
|
145
|
+
hasFinalTick: boolean;
|
|
140
146
|
}
|
|
141
147
|
export interface BaseMarketInstrument {
|
|
142
148
|
id: string;
|
|
@@ -168,6 +174,8 @@ export interface SpreadMarketInstrument extends BaseMarketInstrument {
|
|
|
168
174
|
export type MarketInstrument = VanillaMarketInstrument | SpreadMarketInstrument;
|
|
169
175
|
export interface Erc20Submarket {
|
|
170
176
|
id: string;
|
|
177
|
+
/** Numeric market_id of this sub-market (same as id for standalone, member id for grouped). */
|
|
178
|
+
marketId: string;
|
|
171
179
|
name: string;
|
|
172
180
|
tokenAddress: string;
|
|
173
181
|
tokenDecimals: number;
|
|
@@ -204,7 +212,10 @@ export interface Erc20Market extends BaseMarket {
|
|
|
204
212
|
type: "erc20";
|
|
205
213
|
underlying: string | null;
|
|
206
214
|
underlyingDecimals: number | null;
|
|
207
|
-
|
|
215
|
+
/** Sub-markets / instruments in this ERC20 group. */
|
|
216
|
+
instruments: Erc20Submarket[];
|
|
217
|
+
/** @deprecated Use `instruments` instead. Kept for backward compatibility. */
|
|
218
|
+
submarkets?: Erc20Submarket[];
|
|
208
219
|
}
|
|
209
220
|
export type ApiMarket = Erc6909Market | Erc20Market;
|
|
210
221
|
export type Market = ApiMarket;
|
|
@@ -237,6 +248,7 @@ export interface UserPosition {
|
|
|
237
248
|
* All fields are optional so existing decoders stay backward-compatible.
|
|
238
249
|
*/
|
|
239
250
|
export interface EventEnrichment {
|
|
251
|
+
collateralSymbol?: string;
|
|
240
252
|
marketId?: string | null;
|
|
241
253
|
marketName?: string;
|
|
242
254
|
instrumentName?: string;
|