@0xmonaco/core 1.1.5-prerelease.de852e2 → 1.1.6
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.
|
@@ -48,10 +48,14 @@ export declare const perpRoutes: {
|
|
|
48
48
|
readonly vaultDeposits: (params?: {
|
|
49
49
|
pageSize?: number;
|
|
50
50
|
pageToken?: string;
|
|
51
|
+
token?: string;
|
|
52
|
+
wallet?: string;
|
|
51
53
|
}) => string;
|
|
52
54
|
readonly vaultWithdrawals: (params?: {
|
|
53
55
|
pageSize?: number;
|
|
54
56
|
pageToken?: string;
|
|
57
|
+
token?: string;
|
|
58
|
+
wallet?: string;
|
|
55
59
|
}) => string;
|
|
56
60
|
};
|
|
57
61
|
readonly orders: {
|
package/dist/api/trades/api.d.ts
CHANGED
package/dist/api/trades/api.js
CHANGED
|
@@ -21,6 +21,8 @@ export function parseRawTradeEvent(raw) {
|
|
|
21
21
|
...(raw.data.takerFeeRaw ? { takerFeeRaw: raw.data.takerFeeRaw } : {}),
|
|
22
22
|
...(raw.data.quoteVolumeRaw ? { quoteVolumeRaw: raw.data.quoteVolumeRaw } : {}),
|
|
23
23
|
...(raw.data.takerApplicationId ? { takerApplicationId: raw.data.takerApplicationId } : {}),
|
|
24
|
+
// Kept when "0": that is a value (no builder fee), not an absence.
|
|
25
|
+
...(raw.data.builderFeeRaw !== undefined ? { builderFeeRaw: raw.data.builderFeeRaw } : {}),
|
|
24
26
|
},
|
|
25
27
|
};
|
|
26
28
|
}
|
|
@@ -214,6 +214,10 @@ export declare class TradingAPIImpl extends BaseAPI implements TradingAPI {
|
|
|
214
214
|
/**
|
|
215
215
|
* Batch cancels specific orders by their IDs.
|
|
216
216
|
*
|
|
217
|
+
* Every ID gets one entry in `results`, in request order, and the totals
|
|
218
|
+
* count every ID. An ID that is not one of your live orders comes back as a
|
|
219
|
+
* failed entry with code `ORDER_NOT_FOUND`.
|
|
220
|
+
*
|
|
217
221
|
* @param orderIds - Array of order IDs to cancel
|
|
218
222
|
* @returns Promise resolving to BatchCancelOrdersResponse with cancellation details
|
|
219
223
|
* @throws {APIError} When API communication fails
|
package/dist/api/trading/api.js
CHANGED
|
@@ -313,6 +313,10 @@ export class TradingAPIImpl extends BaseAPI {
|
|
|
313
313
|
/**
|
|
314
314
|
* Batch cancels specific orders by their IDs.
|
|
315
315
|
*
|
|
316
|
+
* Every ID gets one entry in `results`, in request order, and the totals
|
|
317
|
+
* count every ID. An ID that is not one of your live orders comes back as a
|
|
318
|
+
* failed entry with code `ORDER_NOT_FOUND`.
|
|
319
|
+
*
|
|
316
320
|
* @param orderIds - Array of order IDs to cancel
|
|
317
321
|
* @returns Promise resolving to BatchCancelOrdersResponse with cancellation details
|
|
318
322
|
* @throws {APIError} When API communication fails
|
|
@@ -434,22 +434,41 @@ function parseRfqSideViewEventData(raw) {
|
|
|
434
434
|
if (!isRecord(raw)) {
|
|
435
435
|
throw new Error("Invalid RFQ view: a side must be an object");
|
|
436
436
|
}
|
|
437
|
+
const grossVwap = readOptionalDecimalString(raw, "grossVwap");
|
|
438
|
+
const estimatedMonacoFee = readOptionalDecimalString(raw, "estimatedMonacoFee");
|
|
439
|
+
const estimatedBuilderFee = readOptionalDecimalString(raw, "estimatedBuilderFee");
|
|
440
|
+
const estimatedTotalFee = readOptionalDecimalString(raw, "estimatedTotalFee");
|
|
437
441
|
return {
|
|
438
442
|
vwap: readString(raw, "vwap"),
|
|
439
443
|
availableQuantity: readString(raw, "availableQuantity"),
|
|
444
|
+
...(grossVwap !== undefined && { grossVwap }),
|
|
445
|
+
...(estimatedMonacoFee !== undefined && { estimatedMonacoFee }),
|
|
446
|
+
...(estimatedBuilderFee !== undefined && { estimatedBuilderFee }),
|
|
447
|
+
...(estimatedTotalFee !== undefined && { estimatedTotalFee }),
|
|
440
448
|
};
|
|
441
449
|
}
|
|
450
|
+
/** An optional wire integer that may be negative; absent or `null` is `undefined`. */
|
|
451
|
+
function readOptionalInteger(source, field) {
|
|
452
|
+
const value = source[field];
|
|
453
|
+
if (value === undefined || value === null)
|
|
454
|
+
return undefined;
|
|
455
|
+
return readInteger(source, field);
|
|
456
|
+
}
|
|
442
457
|
/** Parse the taker's view. A side no maker quotes is absent. */
|
|
443
458
|
function parseRfqViewEventData(raw) {
|
|
444
459
|
if (!isRecord(raw)) {
|
|
445
460
|
throw new Error("Invalid RFQ view: view must be an object");
|
|
446
461
|
}
|
|
462
|
+
const monacoFeeCbps = readOptionalInteger(raw, "monacoFeeCbps");
|
|
463
|
+
const builderFeeCbps = readOptionalInteger(raw, "builderFeeCbps");
|
|
447
464
|
return {
|
|
448
465
|
viewVersion: readSequence(raw, "viewVersion"),
|
|
449
466
|
...(raw.bid != null && { bid: parseRfqSideViewEventData(raw.bid) }),
|
|
450
467
|
...(raw.ask != null && { ask: parseRfqSideViewEventData(raw.ask) }),
|
|
451
468
|
asOfMs: readSequence(raw, "asOfMs"),
|
|
452
469
|
sequence: readSequence(raw, "sequence"),
|
|
470
|
+
...(monacoFeeCbps !== undefined && { monacoFeeCbps }),
|
|
471
|
+
...(builderFeeCbps !== undefined && { builderFeeCbps }),
|
|
453
472
|
};
|
|
454
473
|
}
|
|
455
474
|
/** Parse a selected maker's own part of an acceptance. */
|
|
@@ -457,6 +476,8 @@ function parseRfqSelectionEventData(raw) {
|
|
|
457
476
|
if (!isRecord(raw)) {
|
|
458
477
|
throw new Error("Invalid RFQ selection: selection must be an object");
|
|
459
478
|
}
|
|
479
|
+
const maxBuilderFeeCbps = readOptionalInteger(raw, "maxBuilderFeeCbps");
|
|
480
|
+
const estimatedNet = readOptionalDecimalString(raw, "estimatedNet");
|
|
460
481
|
return {
|
|
461
482
|
acceptanceId: readString(raw, "acceptanceId"),
|
|
462
483
|
takerSide: readString(raw, "takerSide"),
|
|
@@ -468,17 +489,23 @@ function parseRfqSelectionEventData(raw) {
|
|
|
468
489
|
capacity: readString(raw, "capacity"),
|
|
469
490
|
makerFeeCbps: readInteger(raw, "makerFeeCbps"),
|
|
470
491
|
lastLookDeadlineAtMs: readSequence(raw, "lastLookDeadlineAtMs"),
|
|
492
|
+
...(maxBuilderFeeCbps !== undefined && { maxBuilderFeeCbps }),
|
|
493
|
+
...(estimatedNet !== undefined && { estimatedNet }),
|
|
471
494
|
};
|
|
472
495
|
}
|
|
473
496
|
function parseRfqFillEventData(raw) {
|
|
474
497
|
if (!isRecord(raw)) {
|
|
475
498
|
throw new Error("Invalid RFQ outcome: a fill must be an object");
|
|
476
499
|
}
|
|
500
|
+
const monacoFee = readOptionalDecimalString(raw, "monacoFee");
|
|
501
|
+
const builderFee = readOptionalDecimalString(raw, "builderFee");
|
|
477
502
|
return {
|
|
478
503
|
executionId: readString(raw, "executionId"),
|
|
479
504
|
price: readString(raw, "price"),
|
|
480
505
|
quantity: readString(raw, "quantity"),
|
|
481
506
|
fee: readString(raw, "fee"),
|
|
507
|
+
...(monacoFee !== undefined && { monacoFee }),
|
|
508
|
+
...(builderFee !== undefined && { builderFee }),
|
|
482
509
|
};
|
|
483
510
|
}
|
|
484
511
|
/** Parse the taker's outcome. Nothing filled leaves `vwap` absent and `fills` empty. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"homepage": "https://docs.0xmonaco.com/sdk/typescript",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"viem": "^2.45.2"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@0xmonaco/contracts": "1.1.
|
|
23
|
-
"@0xmonaco/types": "1.1.
|
|
22
|
+
"@0xmonaco/contracts": "1.1.6",
|
|
23
|
+
"@0xmonaco/types": "1.1.6",
|
|
24
24
|
"@noble/curves": "^2.4.0",
|
|
25
25
|
"@noble/hashes": "^2.4.0",
|
|
26
26
|
"http-status-codes": "^2.3.0"
|