@evedex/exchange-api 1.0.50 → 1.0.52
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as crypto from "@evedex/exchange-crypto";
|
|
2
2
|
import { SignedTpSl } from "@evedex/exchange-crypto";
|
|
3
|
-
import { AvailableBalance, CoinList, DxFeedAuthToken, FundingList, HttpClient, InstrumentList, InstrumentMetricsList, MarketDepth, MarketInfo, Order, OrderBookRoundPrices, OrderGroup, OrderList, OrderStatus, OrderType, PaginatedQuery,
|
|
3
|
+
import { AvailableBalance, CoinList, DxFeedAuthToken, FundingList, HttpClient, InstrumentList, InstrumentMetricsList, MarketDepth, MarketInfo, Order, OrderBookRoundPrices, OrderGroup, OrderList, OrderStatus, OrderType, PaginatedQuery, PositionList, TpSl, TpSlList, TpSlStatus, Trade, Transfer, User, WalletBalanceList, type OpenedOrdersList, type Power, type RecentTrade, TransferType, TransferStatus, TransferList, type LimitOrderBatchCreateResult, type PositionUpdateResponse } from "./utils";
|
|
4
4
|
export declare enum InstrumentListQueryField {
|
|
5
5
|
Metrics = "metrics"
|
|
6
6
|
}
|
|
@@ -87,15 +87,20 @@ export declare class ExchangeRestGateway {
|
|
|
87
87
|
getInstruments(): Promise<InstrumentList>;
|
|
88
88
|
getInstrumentsMetrics(): Promise<InstrumentMetricsList>;
|
|
89
89
|
withdraw(query: crypto.SignedTradingBalanceWithdraw): Promise<Transfer>;
|
|
90
|
-
updatePosition(query: PositionUpdateQuery): Promise<
|
|
90
|
+
updatePosition(query: PositionUpdateQuery): Promise<PositionUpdateResponse>;
|
|
91
91
|
closePosition(query: crypto.SignedPositionCloseOrder): Promise<Order>;
|
|
92
|
+
closePositionV2(query: crypto.SignedPositionCloseOrder): Promise<Order>;
|
|
92
93
|
createLimitOrder(query: crypto.SignedLimitOrder): Promise<Order>;
|
|
94
|
+
createLimitOrderV2(query: crypto.SignedLimitOrder): Promise<Order>;
|
|
93
95
|
batchCreateLimitOrder(instrument: string, query: crypto.SignedLimitOrder[]): Promise<LimitOrderBatchCreateResult[]>;
|
|
96
|
+
batchCreateLimitOrderV2(instrument: string, query: crypto.SignedLimitOrder[]): Promise<LimitOrderBatchCreateResult[]>;
|
|
94
97
|
replaceLimitOrder(query: crypto.SignedReplaceLimitOrder): Promise<{}>;
|
|
95
98
|
batchReplaceLimitOrder(query: crypto.SignedReplaceLimitOrder[]): Promise<{}>;
|
|
96
99
|
batchReplaceInstrumentLimitOrder(instrument: string, query: crypto.SignedReplaceLimitOrder[]): Promise<{}>;
|
|
97
100
|
createMarketOrder(query: crypto.SignedMarketOrder): Promise<Order>;
|
|
101
|
+
createMarketOrderV2(query: crypto.SignedMarketOrder): Promise<Order>;
|
|
98
102
|
createStopLimitOrder(query: crypto.SignedStopLimitOrder): Promise<Order>;
|
|
103
|
+
createStopLimitOrderV2(query: crypto.SignedStopLimitOrder): Promise<Order>;
|
|
99
104
|
replaceStopLimitOrder(init: crypto.SignedReplaceStopLimitOrder): Promise<{}>;
|
|
100
105
|
cancelOrder(query: OrderCancelQuery): Promise<{}>;
|
|
101
106
|
massCancelUserOrders(query: OrderMassCancelQuery): Promise<{}>;
|
|
@@ -151,13 +151,22 @@ class ExchangeRestGateway {
|
|
|
151
151
|
closePosition(query) {
|
|
152
152
|
return this.authPost(`/api/position/${query.instrument}/close`, query);
|
|
153
153
|
}
|
|
154
|
+
closePositionV2(query) {
|
|
155
|
+
return this.authPost(`/api/v2/position/${query.instrument}/close`, query);
|
|
156
|
+
}
|
|
154
157
|
// Order
|
|
155
158
|
createLimitOrder(query) {
|
|
156
159
|
return this.authPost("/api/order/limit", query);
|
|
157
160
|
}
|
|
161
|
+
createLimitOrderV2(query) {
|
|
162
|
+
return this.authPost("/api/v2/order/limit", query);
|
|
163
|
+
}
|
|
158
164
|
batchCreateLimitOrder(instrument, query) {
|
|
159
165
|
return this.authPost(`/api/order/mass-limit/${instrument}`, query);
|
|
160
166
|
}
|
|
167
|
+
batchCreateLimitOrderV2(instrument, query) {
|
|
168
|
+
return this.authPost(`/api/v2/order/mass-limit/${instrument}`, query);
|
|
169
|
+
}
|
|
161
170
|
replaceLimitOrder(query) {
|
|
162
171
|
const { quantity, limitPrice, signature } = query;
|
|
163
172
|
return this.authPut(`/api/order/${query.orderId}/limit`, {
|
|
@@ -176,9 +185,15 @@ class ExchangeRestGateway {
|
|
|
176
185
|
createMarketOrder(query) {
|
|
177
186
|
return this.authPost("/api/order/market", query);
|
|
178
187
|
}
|
|
188
|
+
createMarketOrderV2(query) {
|
|
189
|
+
return this.authPost("/api/v2/order/market", query);
|
|
190
|
+
}
|
|
179
191
|
createStopLimitOrder(query) {
|
|
180
192
|
return this.authPost("/api/order/stop-limit", query);
|
|
181
193
|
}
|
|
194
|
+
createStopLimitOrderV2(query) {
|
|
195
|
+
return this.authPost("/api/v2/order/stop-limit", query);
|
|
196
|
+
}
|
|
182
197
|
replaceStopLimitOrder(init) {
|
|
183
198
|
const { quantity, limitPrice, stopPrice, signature } = init;
|
|
184
199
|
return this.authPut(`/api/order/${init.orderId}/stop-limit`, {
|
|
@@ -103,6 +103,7 @@ export interface Position {
|
|
|
103
103
|
createdAt: string;
|
|
104
104
|
updatedAt: string;
|
|
105
105
|
}
|
|
106
|
+
export type PositionUpdateResponse = Pick<Position, "instrument" | "side" | "quantity" | "avgPrice" | "leverage" | "maintenanceMargin">;
|
|
106
107
|
export interface PositionMetrics extends Position {
|
|
107
108
|
unRealizedPnL: number;
|
|
108
109
|
adlLevel: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as crypto from "@evedex/exchange-crypto";
|
|
2
2
|
import { SignedTpSl } from "@evedex/exchange-crypto";
|
|
3
|
-
import { AvailableBalance, CoinList, DxFeedAuthToken, FundingList, HttpClient, InstrumentList, InstrumentMetricsList, MarketDepth, MarketInfo, Order, OrderBookRoundPrices, OrderGroup, OrderList, OrderStatus, OrderType, PaginatedQuery,
|
|
3
|
+
import { AvailableBalance, CoinList, DxFeedAuthToken, FundingList, HttpClient, InstrumentList, InstrumentMetricsList, MarketDepth, MarketInfo, Order, OrderBookRoundPrices, OrderGroup, OrderList, OrderStatus, OrderType, PaginatedQuery, PositionList, TpSl, TpSlList, TpSlStatus, Trade, Transfer, User, WalletBalanceList, type OpenedOrdersList, type Power, type RecentTrade, TransferType, TransferStatus, TransferList, type LimitOrderBatchCreateResult, type PositionUpdateResponse } from "./utils";
|
|
4
4
|
export declare enum InstrumentListQueryField {
|
|
5
5
|
Metrics = "metrics"
|
|
6
6
|
}
|
|
@@ -87,15 +87,20 @@ export declare class ExchangeRestGateway {
|
|
|
87
87
|
getInstruments(): Promise<InstrumentList>;
|
|
88
88
|
getInstrumentsMetrics(): Promise<InstrumentMetricsList>;
|
|
89
89
|
withdraw(query: crypto.SignedTradingBalanceWithdraw): Promise<Transfer>;
|
|
90
|
-
updatePosition(query: PositionUpdateQuery): Promise<
|
|
90
|
+
updatePosition(query: PositionUpdateQuery): Promise<PositionUpdateResponse>;
|
|
91
91
|
closePosition(query: crypto.SignedPositionCloseOrder): Promise<Order>;
|
|
92
|
+
closePositionV2(query: crypto.SignedPositionCloseOrder): Promise<Order>;
|
|
92
93
|
createLimitOrder(query: crypto.SignedLimitOrder): Promise<Order>;
|
|
94
|
+
createLimitOrderV2(query: crypto.SignedLimitOrder): Promise<Order>;
|
|
93
95
|
batchCreateLimitOrder(instrument: string, query: crypto.SignedLimitOrder[]): Promise<LimitOrderBatchCreateResult[]>;
|
|
96
|
+
batchCreateLimitOrderV2(instrument: string, query: crypto.SignedLimitOrder[]): Promise<LimitOrderBatchCreateResult[]>;
|
|
94
97
|
replaceLimitOrder(query: crypto.SignedReplaceLimitOrder): Promise<{}>;
|
|
95
98
|
batchReplaceLimitOrder(query: crypto.SignedReplaceLimitOrder[]): Promise<{}>;
|
|
96
99
|
batchReplaceInstrumentLimitOrder(instrument: string, query: crypto.SignedReplaceLimitOrder[]): Promise<{}>;
|
|
97
100
|
createMarketOrder(query: crypto.SignedMarketOrder): Promise<Order>;
|
|
101
|
+
createMarketOrderV2(query: crypto.SignedMarketOrder): Promise<Order>;
|
|
98
102
|
createStopLimitOrder(query: crypto.SignedStopLimitOrder): Promise<Order>;
|
|
103
|
+
createStopLimitOrderV2(query: crypto.SignedStopLimitOrder): Promise<Order>;
|
|
99
104
|
replaceStopLimitOrder(init: crypto.SignedReplaceStopLimitOrder): Promise<{}>;
|
|
100
105
|
cancelOrder(query: OrderCancelQuery): Promise<{}>;
|
|
101
106
|
massCancelUserOrders(query: OrderMassCancelQuery): Promise<{}>;
|
|
@@ -154,13 +154,22 @@ export class ExchangeRestGateway {
|
|
|
154
154
|
closePosition(query) {
|
|
155
155
|
return this.authPost(`/api/position/${query.instrument}/close`, query);
|
|
156
156
|
}
|
|
157
|
+
closePositionV2(query) {
|
|
158
|
+
return this.authPost(`/api/v2/position/${query.instrument}/close`, query);
|
|
159
|
+
}
|
|
157
160
|
// Order
|
|
158
161
|
createLimitOrder(query) {
|
|
159
162
|
return this.authPost("/api/order/limit", query);
|
|
160
163
|
}
|
|
164
|
+
createLimitOrderV2(query) {
|
|
165
|
+
return this.authPost("/api/v2/order/limit", query);
|
|
166
|
+
}
|
|
161
167
|
batchCreateLimitOrder(instrument, query) {
|
|
162
168
|
return this.authPost(`/api/order/mass-limit/${instrument}`, query);
|
|
163
169
|
}
|
|
170
|
+
batchCreateLimitOrderV2(instrument, query) {
|
|
171
|
+
return this.authPost(`/api/v2/order/mass-limit/${instrument}`, query);
|
|
172
|
+
}
|
|
164
173
|
replaceLimitOrder(query) {
|
|
165
174
|
const { quantity, limitPrice, signature } = query;
|
|
166
175
|
return this.authPut(`/api/order/${query.orderId}/limit`, {
|
|
@@ -179,9 +188,15 @@ export class ExchangeRestGateway {
|
|
|
179
188
|
createMarketOrder(query) {
|
|
180
189
|
return this.authPost("/api/order/market", query);
|
|
181
190
|
}
|
|
191
|
+
createMarketOrderV2(query) {
|
|
192
|
+
return this.authPost("/api/v2/order/market", query);
|
|
193
|
+
}
|
|
182
194
|
createStopLimitOrder(query) {
|
|
183
195
|
return this.authPost("/api/order/stop-limit", query);
|
|
184
196
|
}
|
|
197
|
+
createStopLimitOrderV2(query) {
|
|
198
|
+
return this.authPost("/api/v2/order/stop-limit", query);
|
|
199
|
+
}
|
|
185
200
|
replaceStopLimitOrder(init) {
|
|
186
201
|
const { quantity, limitPrice, stopPrice, signature } = init;
|
|
187
202
|
return this.authPut(`/api/order/${init.orderId}/stop-limit`, {
|
|
@@ -103,6 +103,7 @@ export interface Position {
|
|
|
103
103
|
createdAt: string;
|
|
104
104
|
updatedAt: string;
|
|
105
105
|
}
|
|
106
|
+
export type PositionUpdateResponse = Pick<Position, "instrument" | "side" | "quantity" | "avgPrice" | "leverage" | "maintenanceMargin">;
|
|
106
107
|
export interface PositionMetrics extends Position {
|
|
107
108
|
unRealizedPnL: number;
|
|
108
109
|
adlLevel: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evedex/exchange-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.52",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/mjs/index.js",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"author": "",
|
|
62
62
|
"license": "ISC",
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@evedex/exchange-crypto": "^1.0.
|
|
64
|
+
"@evedex/exchange-crypto": "^1.0.16",
|
|
65
65
|
"big.js": "^6.2.2"
|
|
66
66
|
},
|
|
67
67
|
"publishConfig": {
|