@0xmonaco/core 1.0.26 → 1.0.29
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/api/fees/api.d.ts +1 -1
- package/dist/api/fees/api.js +1 -1
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/market/api.d.ts +2 -1
- package/dist/api/market/api.js +3 -0
- package/dist/api/perp/routes.d.ts +8 -0
- package/dist/api/perp/routes.js +1 -0
- package/dist/api/profile/api.d.ts +5 -0
- package/dist/api/profile/api.js +8 -0
- package/dist/api/pulse/api.d.ts +24 -0
- package/dist/api/pulse/api.js +27 -0
- package/dist/api/pulse/index.d.ts +1 -0
- package/dist/api/pulse/index.js +1 -0
- package/dist/api/trading/api.d.ts +12 -5
- package/dist/api/trading/api.js +20 -6
- package/dist/coverage.d.ts +2 -0
- package/dist/coverage.js +2 -0
- package/dist/networks/networks.js +3 -3
- package/dist/sdk.d.ts +2 -1
- package/dist/sdk.js +5 -0
- package/package.json +3 -3
package/dist/api/fees/api.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export declare class FeesAPIImpl extends BaseAPI implements FeesAPI {
|
|
|
36
36
|
* @param params.price - The price per unit as string
|
|
37
37
|
* @param params.quantity - The quantity to trade as string
|
|
38
38
|
* @param params.orderType - Order type: "LIMIT" (default) or "MARKET"
|
|
39
|
-
* @param params.slippageToleranceBps - Slippage tolerance in bps (0–1000, MARKET only, default
|
|
39
|
+
* @param params.slippageToleranceBps - Slippage tolerance in bps (0–1000, MARKET only, default 1000)
|
|
40
40
|
* @returns Promise resolving to SimulateFeeResponse with fee breakdown
|
|
41
41
|
*
|
|
42
42
|
* @example
|
package/dist/api/fees/api.js
CHANGED
|
@@ -36,7 +36,7 @@ export class FeesAPIImpl extends BaseAPI {
|
|
|
36
36
|
* @param params.price - The price per unit as string
|
|
37
37
|
* @param params.quantity - The quantity to trade as string
|
|
38
38
|
* @param params.orderType - Order type: "LIMIT" (default) or "MARKET"
|
|
39
|
-
* @param params.slippageToleranceBps - Slippage tolerance in bps (0–1000, MARKET only, default
|
|
39
|
+
* @param params.slippageToleranceBps - Slippage tolerance in bps (0–1000, MARKET only, default 1000)
|
|
40
40
|
* @returns Promise resolving to SimulateFeeResponse with fee breakdown
|
|
41
41
|
*
|
|
42
42
|
* @example
|
package/dist/api/index.d.ts
CHANGED
package/dist/api/index.js
CHANGED
package/dist/api/market/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Candlestick, FundingState, GetCandlesticksParams, GetScreenerParams, GetScreenerResponse, GetTradingPairsParams, GetTradingPairsResponse, IndexPrice, Interval, ListFundingHistoryParams, ListFundingHistoryResponse, MarketAPI, MarketMetadata, MarketStats, MarkPrice, OpenInterest, PerpMarketConfig, PerpMarketSummary, TradingMode, TradingPair } from "@0xmonaco/types";
|
|
1
|
+
import type { Candlestick, FundingState, GetCandlesticksParams, GetScreenerParams, GetScreenerResponse, GetTradingPairsParams, GetTradingPairsResponse, IndexPrice, Interval, ListAllFundingHistoryParams, ListAllFundingHistoryResponse, ListFundingHistoryParams, ListFundingHistoryResponse, MarketAPI, MarketMetadata, MarketStats, MarkPrice, OpenInterest, PerpMarketConfig, PerpMarketSummary, TradingMode, TradingPair } from "@0xmonaco/types";
|
|
2
2
|
import { BaseAPI } from "../base";
|
|
3
3
|
/**
|
|
4
4
|
* Market API Implementation
|
|
@@ -17,6 +17,7 @@ export declare class MarketAPIImpl extends BaseAPI implements MarketAPI {
|
|
|
17
17
|
getIndexPrice(tradingPairId: string): Promise<IndexPrice>;
|
|
18
18
|
getFundingState(tradingPairId: string): Promise<FundingState>;
|
|
19
19
|
listFundingHistory(tradingPairId: string, params?: ListFundingHistoryParams): Promise<ListFundingHistoryResponse>;
|
|
20
|
+
listAllFundingHistory(params?: ListAllFundingHistoryParams): Promise<ListAllFundingHistoryResponse>;
|
|
20
21
|
getOpenInterest(tradingPairId: string): Promise<OpenInterest>;
|
|
21
22
|
getScreener(params?: GetScreenerParams): Promise<GetScreenerResponse>;
|
|
22
23
|
getMarketStats(): Promise<MarketStats>;
|
package/dist/api/market/api.js
CHANGED
|
@@ -100,6 +100,9 @@ export class MarketAPIImpl extends BaseAPI {
|
|
|
100
100
|
validate(GetMarketMetadataSchema, { tradingPairId });
|
|
101
101
|
return await this.makePublicRequest(perpRoutes.market.listFundingHistory(tradingPairId, params));
|
|
102
102
|
}
|
|
103
|
+
async listAllFundingHistory(params) {
|
|
104
|
+
return await this.makePublicRequest(perpRoutes.market.listAllFundingHistory(params));
|
|
105
|
+
}
|
|
103
106
|
async getOpenInterest(tradingPairId) {
|
|
104
107
|
validate(GetMarketMetadataSchema, { tradingPairId });
|
|
105
108
|
return await this.makePublicRequest(perpRoutes.market.getOpenInterest(tradingPairId));
|
|
@@ -67,6 +67,14 @@ export declare const perpRoutes: {
|
|
|
67
67
|
endTime?: string;
|
|
68
68
|
page?: number;
|
|
69
69
|
pageSize?: number;
|
|
70
|
+
orderBy?: string;
|
|
71
|
+
}) => string;
|
|
72
|
+
readonly listAllFundingHistory: (params?: {
|
|
73
|
+
startTime?: string;
|
|
74
|
+
endTime?: string;
|
|
75
|
+
page?: number;
|
|
76
|
+
pageSize?: number;
|
|
77
|
+
orderBy?: string;
|
|
70
78
|
}) => string;
|
|
71
79
|
readonly getOpenInterest: (tradingPairId: string) => string;
|
|
72
80
|
readonly getScreener: (params?: {
|
package/dist/api/perp/routes.js
CHANGED
|
@@ -52,6 +52,7 @@ export const perpRoutes = {
|
|
|
52
52
|
getIndexPrice: (tradingPairId) => `${API_V1}/market/pairs/${encodeSegment(tradingPairId)}/index-price`,
|
|
53
53
|
getFundingState: (tradingPairId) => `${API_V1}/market/pairs/${encodeSegment(tradingPairId)}/funding`,
|
|
54
54
|
listFundingHistory: (tradingPairId, params) => withQuery(`${API_V1}/market/pairs/${encodeSegment(tradingPairId)}/funding/history`, params),
|
|
55
|
+
listAllFundingHistory: (params) => withQuery(`${API_V1}/market/funding/history`, params),
|
|
55
56
|
getOpenInterest: (tradingPairId) => `${API_V1}/market/pairs/${encodeSegment(tradingPairId)}/open-interest`,
|
|
56
57
|
getScreener: (params) => withQuery(`${API_V1}/market/screener`, params),
|
|
57
58
|
getMarketStats: () => `${API_V1}/market/stats`,
|
|
@@ -173,6 +173,11 @@ export declare class ProfileAPIImpl extends BaseAPI implements ProfileAPI {
|
|
|
173
173
|
* @param params.page - Page number (starts from 1, default: 1)
|
|
174
174
|
* @param params.pageSize - Number of items per page (default: 20, max: 100)
|
|
175
175
|
* @param params.tradingPairId - Filter by trading pair ID (UUID)
|
|
176
|
+
* @param params.pageToken - Pagination cursor (optional): omit for legacy page-number
|
|
177
|
+
* pagination; pass `""` to start a cursor walk from the newest row; pass a previous
|
|
178
|
+
* response's `nextPageToken` to resume. Any cursor-walk value (`""` or non-empty)
|
|
179
|
+
* ignores `page` and covers full trade history (hot and archived rows merged), unlike
|
|
180
|
+
* page-number mode.
|
|
176
181
|
* @returns Promise resolving to paginated trades response
|
|
177
182
|
* @throws {ValidationError} When the provided params fail client-side validation
|
|
178
183
|
* @throws {APIError} When the request fails or user is not authenticated
|
package/dist/api/profile/api.js
CHANGED
|
@@ -224,6 +224,11 @@ export class ProfileAPIImpl extends BaseAPI {
|
|
|
224
224
|
* @param params.page - Page number (starts from 1, default: 1)
|
|
225
225
|
* @param params.pageSize - Number of items per page (default: 20, max: 100)
|
|
226
226
|
* @param params.tradingPairId - Filter by trading pair ID (UUID)
|
|
227
|
+
* @param params.pageToken - Pagination cursor (optional): omit for legacy page-number
|
|
228
|
+
* pagination; pass `""` to start a cursor walk from the newest row; pass a previous
|
|
229
|
+
* response's `nextPageToken` to resume. Any cursor-walk value (`""` or non-empty)
|
|
230
|
+
* ignores `page` and covers full trade history (hot and archived rows merged), unlike
|
|
231
|
+
* page-number mode.
|
|
227
232
|
* @returns Promise resolving to paginated trades response
|
|
228
233
|
* @throws {ValidationError} When the provided params fail client-side validation
|
|
229
234
|
* @throws {APIError} When the request fails or user is not authenticated
|
|
@@ -252,6 +257,9 @@ export class ProfileAPIImpl extends BaseAPI {
|
|
|
252
257
|
if (params?.tradingPairId !== undefined) {
|
|
253
258
|
searchParams.append("tradingPairId", params.tradingPairId);
|
|
254
259
|
}
|
|
260
|
+
if (params?.pageToken !== undefined) {
|
|
261
|
+
searchParams.append("pageToken", params.pageToken);
|
|
262
|
+
}
|
|
255
263
|
const queryString = searchParams.toString();
|
|
256
264
|
const url = queryString ? `/api/v1/accounts/trades?${queryString}` : "/api/v1/accounts/trades";
|
|
257
265
|
return await this.makeAuthenticatedRequest(url);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pulse API Implementation
|
|
3
|
+
*
|
|
4
|
+
* Read-only access to the market-pulse news feed: AI-synthesized, per-asset
|
|
5
|
+
* headlines with sentiment tags, served from the backend's hourly-refreshed
|
|
6
|
+
* cache. Public — no authentication required.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const pulse = await sdk.pulse.getPulse();
|
|
11
|
+
* for (const item of pulse.items) {
|
|
12
|
+
* console.log(`[${item.sentiment}] ${item.asset}: ${item.summary}`);
|
|
13
|
+
* }
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
import type { GetPulseResponse, PulseAPI } from "@0xmonaco/types";
|
|
17
|
+
import { BaseAPI } from "../base";
|
|
18
|
+
export declare class PulseAPIImpl extends BaseAPI implements PulseAPI {
|
|
19
|
+
/**
|
|
20
|
+
* Get the latest market pulse snapshot (public, no auth headers).
|
|
21
|
+
* Returns 503 while the backend cache is cold.
|
|
22
|
+
*/
|
|
23
|
+
getPulse(): Promise<GetPulseResponse>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pulse API Implementation
|
|
3
|
+
*
|
|
4
|
+
* Read-only access to the market-pulse news feed: AI-synthesized, per-asset
|
|
5
|
+
* headlines with sentiment tags, served from the backend's hourly-refreshed
|
|
6
|
+
* cache. Public — no authentication required.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const pulse = await sdk.pulse.getPulse();
|
|
11
|
+
* for (const item of pulse.items) {
|
|
12
|
+
* console.log(`[${item.sentiment}] ${item.asset}: ${item.summary}`);
|
|
13
|
+
* }
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
import { BaseAPI } from "../base";
|
|
17
|
+
export class PulseAPIImpl extends BaseAPI {
|
|
18
|
+
/**
|
|
19
|
+
* Get the latest market pulse snapshot (public, no auth headers).
|
|
20
|
+
* Returns 503 while the backend cache is cold.
|
|
21
|
+
*/
|
|
22
|
+
async getPulse() {
|
|
23
|
+
return await this.makePublicRequest("/api/v1/pulse", {
|
|
24
|
+
method: "GET",
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PulseAPIImpl } from "./api";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PulseAPIImpl } from "./api";
|
|
@@ -93,15 +93,17 @@ export declare class TradingAPIImpl extends BaseAPI implements TradingAPI {
|
|
|
93
93
|
/**
|
|
94
94
|
* Places a market order for immediate execution.
|
|
95
95
|
*
|
|
96
|
-
* Market orders execute immediately
|
|
97
|
-
*
|
|
96
|
+
* Market orders execute immediately against available liquidity, inside a
|
|
97
|
+
* mandatory 1,000 bps server-side protective price band. Fills beyond the band
|
|
98
|
+
* are cut off, so an order may partially fill and cancel the remainder, or be
|
|
99
|
+
* rejected when no liquidity sits inside the band.
|
|
98
100
|
*
|
|
99
101
|
* @param tradingPairId - The trading pair UUID
|
|
100
102
|
* @param side - The order side ("BUY" or "SELL")
|
|
101
103
|
* @param quantity - The order quantity as string
|
|
102
104
|
* @param options - Optional parameters for the market order
|
|
103
105
|
* @param options.tradingMode - Trading mode (e.g., "SPOT")
|
|
104
|
-
* @param options.slippageTolerance -
|
|
106
|
+
* @param options.slippageTolerance - Tightens the mandatory 1,000 bps price band, as a decimal (e.g., 0.01 for 1%; 0 for best price only). It can only tighten the band, never widen it; omitting it applies the full 1,000 bps band.
|
|
105
107
|
* @returns Promise resolving to CreateOrderResponse with order details
|
|
106
108
|
*
|
|
107
109
|
* @example
|
|
@@ -122,12 +124,12 @@ export declare class TradingAPIImpl extends BaseAPI implements TradingAPI {
|
|
|
122
124
|
* { slippageTolerance: 0 } // Only execute at best ask price
|
|
123
125
|
* );
|
|
124
126
|
*
|
|
125
|
-
* // Market order with
|
|
127
|
+
* // Market order with the default protective band (no client tightening)
|
|
126
128
|
* const order3 = await tradingAPI.placeMarketOrder(
|
|
127
129
|
* "123e4567-e89b-12d3-a456-426614174000",
|
|
128
130
|
* "BUY",
|
|
129
131
|
* "1.0"
|
|
130
|
-
* // No slippageTolerance specified =
|
|
132
|
+
* // No slippageTolerance specified = full 1,000 bps band applies
|
|
131
133
|
* );
|
|
132
134
|
* ```
|
|
133
135
|
*/
|
|
@@ -268,6 +270,11 @@ export declare class TradingAPIImpl extends BaseAPI implements TradingAPI {
|
|
|
268
270
|
* @param params.tradingPairId - Filter by trading pair UUID (optional)
|
|
269
271
|
* @param params.page - Page number for pagination (defaults to 1, must be > 0)
|
|
270
272
|
* @param params.pageSize - Number of orders per page (defaults to 10, max 100, must be > 0)
|
|
273
|
+
* @param params.pageToken - Pagination cursor (optional): omit for legacy page-number
|
|
274
|
+
* pagination; pass `""` to start a cursor walk from the newest (or oldest, for
|
|
275
|
+
* `orderBy: "ASC"`) row; pass a previous response's `nextPageToken` to resume. Any
|
|
276
|
+
* cursor-walk value (`""` or non-empty) ignores `page` and covers full order history
|
|
277
|
+
* (hot and archived rows merged), unlike page-number mode.
|
|
271
278
|
* @returns Promise resolving to GetPaginatedOrdersResponse with orders and pagination info
|
|
272
279
|
* @throws {APIError} When API communication fails
|
|
273
280
|
*
|
package/dist/api/trading/api.js
CHANGED
|
@@ -125,15 +125,17 @@ export class TradingAPIImpl extends BaseAPI {
|
|
|
125
125
|
/**
|
|
126
126
|
* Places a market order for immediate execution.
|
|
127
127
|
*
|
|
128
|
-
* Market orders execute immediately
|
|
129
|
-
*
|
|
128
|
+
* Market orders execute immediately against available liquidity, inside a
|
|
129
|
+
* mandatory 1,000 bps server-side protective price band. Fills beyond the band
|
|
130
|
+
* are cut off, so an order may partially fill and cancel the remainder, or be
|
|
131
|
+
* rejected when no liquidity sits inside the band.
|
|
130
132
|
*
|
|
131
133
|
* @param tradingPairId - The trading pair UUID
|
|
132
134
|
* @param side - The order side ("BUY" or "SELL")
|
|
133
135
|
* @param quantity - The order quantity as string
|
|
134
136
|
* @param options - Optional parameters for the market order
|
|
135
137
|
* @param options.tradingMode - Trading mode (e.g., "SPOT")
|
|
136
|
-
* @param options.slippageTolerance -
|
|
138
|
+
* @param options.slippageTolerance - Tightens the mandatory 1,000 bps price band, as a decimal (e.g., 0.01 for 1%; 0 for best price only). It can only tighten the band, never widen it; omitting it applies the full 1,000 bps band.
|
|
137
139
|
* @returns Promise resolving to CreateOrderResponse with order details
|
|
138
140
|
*
|
|
139
141
|
* @example
|
|
@@ -154,12 +156,12 @@ export class TradingAPIImpl extends BaseAPI {
|
|
|
154
156
|
* { slippageTolerance: 0 } // Only execute at best ask price
|
|
155
157
|
* );
|
|
156
158
|
*
|
|
157
|
-
* // Market order with
|
|
159
|
+
* // Market order with the default protective band (no client tightening)
|
|
158
160
|
* const order3 = await tradingAPI.placeMarketOrder(
|
|
159
161
|
* "123e4567-e89b-12d3-a456-426614174000",
|
|
160
162
|
* "BUY",
|
|
161
163
|
* "1.0"
|
|
162
|
-
* // No slippageTolerance specified =
|
|
164
|
+
* // No slippageTolerance specified = full 1,000 bps band applies
|
|
163
165
|
* );
|
|
164
166
|
* ```
|
|
165
167
|
*/
|
|
@@ -417,6 +419,11 @@ export class TradingAPIImpl extends BaseAPI {
|
|
|
417
419
|
* @param params.tradingPairId - Filter by trading pair UUID (optional)
|
|
418
420
|
* @param params.page - Page number for pagination (defaults to 1, must be > 0)
|
|
419
421
|
* @param params.pageSize - Number of orders per page (defaults to 10, max 100, must be > 0)
|
|
422
|
+
* @param params.pageToken - Pagination cursor (optional): omit for legacy page-number
|
|
423
|
+
* pagination; pass `""` to start a cursor walk from the newest (or oldest, for
|
|
424
|
+
* `orderBy: "ASC"`) row; pass a previous response's `nextPageToken` to resume. Any
|
|
425
|
+
* cursor-walk value (`""` or non-empty) ignores `page` and covers full order history
|
|
426
|
+
* (hot and archived rows merged), unlike page-number mode.
|
|
420
427
|
* @returns Promise resolving to GetPaginatedOrdersResponse with orders and pagination info
|
|
421
428
|
* @throws {APIError} When API communication fails
|
|
422
429
|
*
|
|
@@ -441,7 +448,7 @@ export class TradingAPIImpl extends BaseAPI {
|
|
|
441
448
|
validate(GetPaginatedOrdersSchema, params);
|
|
442
449
|
}
|
|
443
450
|
// Set pagination defaults with destructuring and validation
|
|
444
|
-
const { page = 1, pageSize: requestedPageSize = 10, status, tradingPairId, tradingMode, marginAccountId } = params || {};
|
|
451
|
+
const { page = 1, pageSize: requestedPageSize = 10, status, tradingPairId, tradingMode, marginAccountId, pageToken } = params || {};
|
|
445
452
|
const validPage = page > 0 ? page : 1;
|
|
446
453
|
const validPageSize = requestedPageSize > 0 ? requestedPageSize : 10;
|
|
447
454
|
const pageSize = Math.min(validPageSize, 100);
|
|
@@ -461,6 +468,13 @@ export class TradingAPIImpl extends BaseAPI {
|
|
|
461
468
|
if (marginAccountId) {
|
|
462
469
|
searchParams.append("marginAccountId", marginAccountId);
|
|
463
470
|
}
|
|
471
|
+
// `!== undefined` (not a truthy check): an explicitly-provided empty
|
|
472
|
+
// string is the documented way to start a cursor walk (distinct from
|
|
473
|
+
// omitting `pageToken` entirely), so it must still be sent rather than
|
|
474
|
+
// silently dropped like a falsy value would be.
|
|
475
|
+
if (pageToken !== undefined) {
|
|
476
|
+
searchParams.append("pageToken", pageToken);
|
|
477
|
+
}
|
|
464
478
|
const endpoint = `/api/v1/orders?${searchParams.toString()}`;
|
|
465
479
|
return await this.makeAuthenticatedRequest(endpoint, {
|
|
466
480
|
method: "GET",
|
package/dist/coverage.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export declare const COVERED: {
|
|
|
30
30
|
get_market_metadata: string;
|
|
31
31
|
get_market_stats: string;
|
|
32
32
|
get_my_fee_tier: string;
|
|
33
|
+
get_pulse: string;
|
|
33
34
|
get_my_trader_code: string;
|
|
34
35
|
get_rewards_balance: string;
|
|
35
36
|
get_trader_code_info: string;
|
|
@@ -64,6 +65,7 @@ export declare const COVERED: {
|
|
|
64
65
|
get_withdrawal: string;
|
|
65
66
|
initiate_withdrawal: string;
|
|
66
67
|
list_pending_withdrawals: string;
|
|
68
|
+
list_all_funding_history: string;
|
|
67
69
|
list_application_balances: string;
|
|
68
70
|
list_application_movements: string;
|
|
69
71
|
list_application_orders: string;
|
package/dist/coverage.js
CHANGED
|
@@ -30,6 +30,7 @@ export const COVERED = {
|
|
|
30
30
|
get_market_metadata: "getMarketMetadata",
|
|
31
31
|
get_market_stats: "getMarketStats",
|
|
32
32
|
get_my_fee_tier: "getMyFeeTier",
|
|
33
|
+
get_pulse: "pulse.getPulse",
|
|
33
34
|
get_my_trader_code: "pitpass.getMyTraderCode",
|
|
34
35
|
get_rewards_balance: "pitpass.getRewardsBalance",
|
|
35
36
|
get_trader_code_info: "pitpass.getTraderCodeInfo",
|
|
@@ -64,6 +65,7 @@ export const COVERED = {
|
|
|
64
65
|
get_withdrawal: "getWithdrawal",
|
|
65
66
|
initiate_withdrawal: "initiateWithdrawal",
|
|
66
67
|
list_pending_withdrawals: "listPendingWithdrawals",
|
|
68
|
+
list_all_funding_history: "listAllFundingHistory",
|
|
67
69
|
list_application_balances: "listApplicationBalances",
|
|
68
70
|
list_application_movements: "listApplicationMovements",
|
|
69
71
|
list_application_orders: "listApplicationOrders",
|
|
@@ -23,10 +23,10 @@ const DEFAULT_API_URLS = {
|
|
|
23
23
|
const DEFAULT_WS_URLS = {
|
|
24
24
|
local: "ws://localhost:8085/ws",
|
|
25
25
|
// Dedicated WebSocket ingress (NLB behind Cloudflare). The previous
|
|
26
|
-
// ALB
|
|
27
|
-
// migration window.
|
|
26
|
+
// ALB paths (wss://develop.apimonaco.xyz/ws, wss://staging.apimonaco.xyz/ws)
|
|
27
|
+
// keep working during the migration window.
|
|
28
28
|
development: "wss://ws-develop.apimonaco.xyz/ws",
|
|
29
|
-
staging: "wss://staging.apimonaco.xyz/ws",
|
|
29
|
+
staging: "wss://ws-staging.apimonaco.xyz/ws",
|
|
30
30
|
mainnet: "wss://api.monaco.xyz/ws",
|
|
31
31
|
};
|
|
32
32
|
/**
|
package/dist/sdk.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ApplicationsAPI, AuthAPI, AuthState, DelegatedAgentsAPI, FaucetAPI, FeesAPI, MarginAccountsAPI, MarketAPI, MonacoSDK, Network, PitpassAPI, PortfolioAPI, PositionsAPI, ProfileAPI, SDKConfig, SubAccountsAPI, TradingAPI, VaultAPI, WhitelistAPI, WithdrawalsAPI } from "@0xmonaco/types";
|
|
1
|
+
import type { ApplicationsAPI, AuthAPI, AuthState, DelegatedAgentsAPI, FaucetAPI, FeesAPI, MarginAccountsAPI, MarketAPI, MonacoSDK, Network, PitpassAPI, PortfolioAPI, PositionsAPI, ProfileAPI, PulseAPI, SDKConfig, SubAccountsAPI, TradingAPI, VaultAPI, WhitelistAPI, WithdrawalsAPI } from "@0xmonaco/types";
|
|
2
2
|
import { type Address, type PublicClient, type TransactionReceipt, type WalletClient } from "viem";
|
|
3
3
|
import { type MonacoWebSocket, OrderbookAPIImpl, TradesAPIImpl } from "./api";
|
|
4
4
|
export declare class MonacoSDKImpl implements MonacoSDK {
|
|
@@ -18,6 +18,7 @@ export declare class MonacoSDKImpl implements MonacoSDK {
|
|
|
18
18
|
faucet: FaucetAPI;
|
|
19
19
|
whitelist: WhitelistAPI;
|
|
20
20
|
profile: ProfileAPI;
|
|
21
|
+
pulse: PulseAPI;
|
|
21
22
|
orderbook: OrderbookAPIImpl;
|
|
22
23
|
trades: TradesAPIImpl;
|
|
23
24
|
ws: MonacoWebSocket;
|
package/dist/sdk.js
CHANGED
|
@@ -12,6 +12,7 @@ import { PitpassAPIImpl } from "./api/pitpass";
|
|
|
12
12
|
import { PortfolioAPIImpl } from "./api/portfolio";
|
|
13
13
|
import { PositionsAPIImpl } from "./api/positions";
|
|
14
14
|
import { ProfileAPIImpl } from "./api/profile";
|
|
15
|
+
import { PulseAPIImpl } from "./api/pulse";
|
|
15
16
|
import { SubAccountsAPIImpl } from "./api/sub-accounts";
|
|
16
17
|
import { TradingAPIImpl } from "./api/trading";
|
|
17
18
|
import { VaultAPIImpl } from "./api/vault";
|
|
@@ -54,6 +55,7 @@ export class MonacoSDKImpl {
|
|
|
54
55
|
faucet;
|
|
55
56
|
whitelist;
|
|
56
57
|
profile;
|
|
58
|
+
pulse;
|
|
57
59
|
orderbook;
|
|
58
60
|
trades;
|
|
59
61
|
ws;
|
|
@@ -82,6 +84,7 @@ export class MonacoSDKImpl {
|
|
|
82
84
|
this.subAccounts.setSessionKeypair(credentials);
|
|
83
85
|
this.faucet.setSessionKeypair(credentials);
|
|
84
86
|
this.whitelist.setSessionKeypair(credentials);
|
|
87
|
+
this.pulse.setSessionKeypair(credentials);
|
|
85
88
|
this.profile.setSessionKeypair(credentials);
|
|
86
89
|
this.orderbook.setSessionKeypair(credentials);
|
|
87
90
|
this.trades.setSessionKeypair(credentials);
|
|
@@ -120,6 +123,7 @@ export class MonacoSDKImpl {
|
|
|
120
123
|
this.subAccounts.setServerKey(serverKey);
|
|
121
124
|
this.faucet.setServerKey(serverKey);
|
|
122
125
|
this.whitelist.setServerKey(serverKey);
|
|
126
|
+
this.pulse.setServerKey(serverKey);
|
|
123
127
|
this.profile.setServerKey(serverKey);
|
|
124
128
|
this.orderbook.setServerKey(serverKey);
|
|
125
129
|
this.trades.setServerKey(serverKey);
|
|
@@ -181,6 +185,7 @@ export class MonacoSDKImpl {
|
|
|
181
185
|
this.subAccounts = new SubAccountsAPIImpl(apiUrl);
|
|
182
186
|
this.faucet = new FaucetAPIImpl(apiUrl);
|
|
183
187
|
this.whitelist = new WhitelistAPIImpl(apiUrl);
|
|
188
|
+
this.pulse = new PulseAPIImpl(apiUrl);
|
|
184
189
|
this.auth = new AuthAPIImpl(this.walletClient, this.chain, apiUrl);
|
|
185
190
|
this.delegatedAgents = new DelegatedAgentsAPIImpl(apiUrl);
|
|
186
191
|
this.fees = new FeesAPIImpl(apiUrl);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.29",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"viem": "^2.45.2"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@0xmonaco/contracts": "1.0.
|
|
27
|
-
"@0xmonaco/types": "1.0.
|
|
26
|
+
"@0xmonaco/contracts": "1.0.29",
|
|
27
|
+
"@0xmonaco/types": "1.0.29",
|
|
28
28
|
"@noble/curves": "^1.9.1",
|
|
29
29
|
"@noble/hashes": "^1.8.0",
|
|
30
30
|
"http-status-codes": "^2.3.0"
|