@nightlylabs/dex-sdk 0.2.16 → 0.2.17
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/index.cjs +6 -3
- package/dist/index.d.cts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +6 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -309,7 +309,6 @@ var ABI10 = {
|
|
|
309
309
|
"u64",
|
|
310
310
|
"u64",
|
|
311
311
|
"bool",
|
|
312
|
-
"bool",
|
|
313
312
|
"u64"
|
|
314
313
|
],
|
|
315
314
|
"return": []
|
|
@@ -2432,7 +2431,6 @@ var Client = class _Client {
|
|
|
2432
2431
|
params.orderId,
|
|
2433
2432
|
params.newPrice,
|
|
2434
2433
|
params.newSize,
|
|
2435
|
-
params.postOnly,
|
|
2436
2434
|
params.reduceOnly,
|
|
2437
2435
|
params.triggerPrice
|
|
2438
2436
|
]
|
|
@@ -2717,6 +2715,11 @@ var Client = class _Client {
|
|
|
2717
2715
|
}
|
|
2718
2716
|
async placeMultipleSpotOrders(params) {
|
|
2719
2717
|
const markets = params.spotOrders.map((order) => order.marketName);
|
|
2718
|
+
const uniqueMarkets = new Set(markets);
|
|
2719
|
+
if (uniqueMarkets.size !== 1) {
|
|
2720
|
+
throw new Error("All spot orders must be for the same market");
|
|
2721
|
+
}
|
|
2722
|
+
const uniqueMarket = uniqueMarkets.values().next().value;
|
|
2720
2723
|
const isBids = params.spotOrders.map((order) => order.isBid);
|
|
2721
2724
|
const prices = params.spotOrders.map((order) => order.price);
|
|
2722
2725
|
const sizes = params.spotOrders.map((order) => order.size);
|
|
@@ -2731,7 +2734,7 @@ var Client = class _Client {
|
|
|
2731
2734
|
}),
|
|
2732
2735
|
function: `${placeMultipleSpotOrders_default.address}::${placeMultipleSpotOrders_default.name}::${placeMultipleSpotOrders_default.exposed_functions[0].name}`,
|
|
2733
2736
|
typeArguments: [],
|
|
2734
|
-
functionArguments: [params.userId,
|
|
2737
|
+
functionArguments: [params.userId, uniqueMarket, isBids, prices, sizes, postOnly]
|
|
2735
2738
|
});
|
|
2736
2739
|
return await this.createAndSubmitTransaction(aptosPayload);
|
|
2737
2740
|
}
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -259,7 +259,6 @@ var ABI10 = {
|
|
|
259
259
|
"u64",
|
|
260
260
|
"u64",
|
|
261
261
|
"bool",
|
|
262
|
-
"bool",
|
|
263
262
|
"u64"
|
|
264
263
|
],
|
|
265
264
|
"return": []
|
|
@@ -2382,7 +2381,6 @@ var Client = class _Client {
|
|
|
2382
2381
|
params.orderId,
|
|
2383
2382
|
params.newPrice,
|
|
2384
2383
|
params.newSize,
|
|
2385
|
-
params.postOnly,
|
|
2386
2384
|
params.reduceOnly,
|
|
2387
2385
|
params.triggerPrice
|
|
2388
2386
|
]
|
|
@@ -2667,6 +2665,11 @@ var Client = class _Client {
|
|
|
2667
2665
|
}
|
|
2668
2666
|
async placeMultipleSpotOrders(params) {
|
|
2669
2667
|
const markets = params.spotOrders.map((order) => order.marketName);
|
|
2668
|
+
const uniqueMarkets = new Set(markets);
|
|
2669
|
+
if (uniqueMarkets.size !== 1) {
|
|
2670
|
+
throw new Error("All spot orders must be for the same market");
|
|
2671
|
+
}
|
|
2672
|
+
const uniqueMarket = uniqueMarkets.values().next().value;
|
|
2670
2673
|
const isBids = params.spotOrders.map((order) => order.isBid);
|
|
2671
2674
|
const prices = params.spotOrders.map((order) => order.price);
|
|
2672
2675
|
const sizes = params.spotOrders.map((order) => order.size);
|
|
@@ -2681,7 +2684,7 @@ var Client = class _Client {
|
|
|
2681
2684
|
}),
|
|
2682
2685
|
function: `${placeMultipleSpotOrders_default.address}::${placeMultipleSpotOrders_default.name}::${placeMultipleSpotOrders_default.exposed_functions[0].name}`,
|
|
2683
2686
|
typeArguments: [],
|
|
2684
|
-
functionArguments: [params.userId,
|
|
2687
|
+
functionArguments: [params.userId, uniqueMarket, isBids, prices, sizes, postOnly]
|
|
2685
2688
|
});
|
|
2686
2689
|
return await this.createAndSubmitTransaction(aptosPayload);
|
|
2687
2690
|
}
|