ccxt 4.2.47 → 4.2.49
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/README.md +3 -3
- package/build.sh +7 -0
- package/dist/ccxt.browser.js +681 -84
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/binance.js +10 -4
- package/dist/cjs/src/bitmart.js +30 -4
- package/dist/cjs/src/bitstamp.js +8 -0
- package/dist/cjs/src/btcalpha.js +4 -0
- package/dist/cjs/src/btcmarkets.js +4 -0
- package/dist/cjs/src/btcturk.js +4 -0
- package/dist/cjs/src/bybit.js +138 -6
- package/dist/cjs/src/idex.js +52 -1
- package/dist/cjs/src/independentreserve.js +48 -0
- package/dist/cjs/src/indodax.js +120 -19
- package/dist/cjs/src/latoken.js +16 -0
- package/dist/cjs/src/luno.js +18 -0
- package/dist/cjs/src/lykke.js +19 -0
- package/dist/cjs/src/ndax.js +18 -0
- package/dist/cjs/src/okx.js +32 -5
- package/dist/cjs/src/pro/ascendex.js +22 -7
- package/dist/cjs/src/pro/bitget.js +28 -7
- package/dist/cjs/src/pro/bitstamp.js +1 -1
- package/dist/cjs/src/pro/hitbtc.js +6 -11
- package/dist/cjs/src/pro/mexc.js +2 -1
- package/dist/cjs/src/upbit.js +100 -17
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bitstamp.d.ts +8 -0
- package/js/src/abstract/indodax.d.ts +9 -8
- package/js/src/binance.js +10 -4
- package/js/src/bitmart.js +30 -4
- package/js/src/bitstamp.js +8 -0
- package/js/src/btcalpha.js +4 -0
- package/js/src/btcmarkets.js +4 -0
- package/js/src/btcturk.js +4 -0
- package/js/src/bybit.d.ts +3 -1
- package/js/src/bybit.js +138 -6
- package/js/src/idex.d.ts +7 -0
- package/js/src/idex.js +52 -1
- package/js/src/independentreserve.d.ts +15 -1
- package/js/src/independentreserve.js +48 -0
- package/js/src/indodax.d.ts +3 -1
- package/js/src/indodax.js +120 -19
- package/js/src/latoken.js +16 -0
- package/js/src/luno.js +18 -0
- package/js/src/lykke.js +19 -0
- package/js/src/ndax.js +18 -0
- package/js/src/okx.js +32 -5
- package/js/src/pro/ascendex.d.ts +1 -0
- package/js/src/pro/ascendex.js +22 -7
- package/js/src/pro/bitget.js +28 -7
- package/js/src/pro/bitstamp.js +1 -1
- package/js/src/pro/hitbtc.js +6 -11
- package/js/src/pro/mexc.js +2 -1
- package/js/src/upbit.d.ts +2 -0
- package/js/src/upbit.js +100 -17
- package/package.json +3 -1
- package/skip-tests.json +4 -2
package/dist/cjs/src/upbit.js
CHANGED
|
@@ -41,6 +41,7 @@ class upbit extends upbit$1 {
|
|
|
41
41
|
'fetchBalance': true,
|
|
42
42
|
'fetchCanceledOrders': true,
|
|
43
43
|
'fetchClosedOrders': true,
|
|
44
|
+
'fetchDeposit': true,
|
|
44
45
|
'fetchDepositAddress': true,
|
|
45
46
|
'fetchDepositAddresses': true,
|
|
46
47
|
'fetchDeposits': true,
|
|
@@ -68,6 +69,7 @@ class upbit extends upbit$1 {
|
|
|
68
69
|
'fetchTradingFee': true,
|
|
69
70
|
'fetchTradingFees': false,
|
|
70
71
|
'fetchTransactions': false,
|
|
72
|
+
'fetchWithdrawal': true,
|
|
71
73
|
'fetchWithdrawals': true,
|
|
72
74
|
'transfer': false,
|
|
73
75
|
'withdraw': true,
|
|
@@ -1025,6 +1027,7 @@ class upbit extends upbit$1 {
|
|
|
1025
1027
|
* @name upbit#createOrder
|
|
1026
1028
|
* @description create a trade order
|
|
1027
1029
|
* @see https://docs.upbit.com/reference/%EC%A3%BC%EB%AC%B8%ED%95%98%EA%B8%B0
|
|
1030
|
+
* @see https://global-docs.upbit.com/reference/order
|
|
1028
1031
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
1029
1032
|
* @param {string} type 'market' or 'limit'
|
|
1030
1033
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -1032,6 +1035,7 @@ class upbit extends upbit$1 {
|
|
|
1032
1035
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
1033
1036
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1034
1037
|
* @param {float} [params.cost] for market buy orders, the quote quantity that can be used as an alternative for the amount
|
|
1038
|
+
* @param {string} [params.timeInForce] 'IOC' or 'FOK'
|
|
1035
1039
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1036
1040
|
*/
|
|
1037
1041
|
await this.loadMarkets();
|
|
@@ -1088,6 +1092,13 @@ class upbit extends upbit$1 {
|
|
|
1088
1092
|
if (clientOrderId !== undefined) {
|
|
1089
1093
|
request['identifier'] = clientOrderId;
|
|
1090
1094
|
}
|
|
1095
|
+
if (type !== 'market') {
|
|
1096
|
+
const timeInForce = this.safeStringLower2(params, 'timeInForce', 'time_in_force');
|
|
1097
|
+
params = this.omit(params, 'timeInForce');
|
|
1098
|
+
if (timeInForce !== undefined) {
|
|
1099
|
+
request['time_in_force'] = timeInForce;
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1091
1102
|
params = this.omit(params, ['clientOrderId', 'identifier']);
|
|
1092
1103
|
const response = await this.privatePostOrders(this.extend(request, params));
|
|
1093
1104
|
//
|
|
@@ -1193,6 +1204,45 @@ class upbit extends upbit$1 {
|
|
|
1193
1204
|
//
|
|
1194
1205
|
return this.parseTransactions(response, currency, since, limit);
|
|
1195
1206
|
}
|
|
1207
|
+
async fetchDeposit(id, code = undefined, params = {}) {
|
|
1208
|
+
/**
|
|
1209
|
+
* @method
|
|
1210
|
+
* @name upbit#fetchDeposit
|
|
1211
|
+
* @description fetch information on a deposit
|
|
1212
|
+
* @see https://global-docs.upbit.com/reference/individual-deposit-inquiry
|
|
1213
|
+
* @param {string} id the unique id for the deposit
|
|
1214
|
+
* @param {string} [code] unified currency code of the currency deposited
|
|
1215
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1216
|
+
* @param {string} [params.txid] withdrawal transaction id, the id argument is reserved for uuid
|
|
1217
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
1218
|
+
*/
|
|
1219
|
+
await this.loadMarkets();
|
|
1220
|
+
const request = {
|
|
1221
|
+
'uuid': id,
|
|
1222
|
+
};
|
|
1223
|
+
let currency = undefined;
|
|
1224
|
+
if (code !== undefined) {
|
|
1225
|
+
currency = this.currency(code);
|
|
1226
|
+
request['currency'] = currency['id'];
|
|
1227
|
+
}
|
|
1228
|
+
const response = await this.privateGetDeposit(this.extend(request, params));
|
|
1229
|
+
//
|
|
1230
|
+
// {
|
|
1231
|
+
// "type": "deposit",
|
|
1232
|
+
// "uuid": "7f54527e-2eee-4268-860e-fd8b9d7fe3c7",
|
|
1233
|
+
// "currency": "ADA",
|
|
1234
|
+
// "net_type": "ADA",
|
|
1235
|
+
// "txid": "99795bbfeca91eaa071068bb659b33eeb65d8aaff2551fdf7c78f345d188952b",
|
|
1236
|
+
// "state": "ACCEPTED",
|
|
1237
|
+
// "created_at": "2023-12-12T04:58:41Z",
|
|
1238
|
+
// "done_at": "2023-12-12T05:31:50Z",
|
|
1239
|
+
// "amount": "35.72344",
|
|
1240
|
+
// "fee": "0.0",
|
|
1241
|
+
// "transaction_type": "default"
|
|
1242
|
+
// }
|
|
1243
|
+
//
|
|
1244
|
+
return this.parseTransaction(response, currency);
|
|
1245
|
+
}
|
|
1196
1246
|
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1197
1247
|
/**
|
|
1198
1248
|
* @method
|
|
@@ -1237,13 +1287,52 @@ class upbit extends upbit$1 {
|
|
|
1237
1287
|
//
|
|
1238
1288
|
return this.parseTransactions(response, currency, since, limit);
|
|
1239
1289
|
}
|
|
1290
|
+
async fetchWithdrawal(id, code = undefined, params = {}) {
|
|
1291
|
+
/**
|
|
1292
|
+
* @method
|
|
1293
|
+
* @name upbit#fetchWithdrawal
|
|
1294
|
+
* @description fetch data on a currency withdrawal via the withdrawal id
|
|
1295
|
+
* @see https://global-docs.upbit.com/reference/individual-withdrawal-inquiry
|
|
1296
|
+
* @param {string} id the unique id for the withdrawal
|
|
1297
|
+
* @param {string} [code] unified currency code of the currency withdrawn
|
|
1298
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1299
|
+
* @param {string} [params.txid] withdrawal transaction id, the id argument is reserved for uuid
|
|
1300
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
1301
|
+
*/
|
|
1302
|
+
await this.loadMarkets();
|
|
1303
|
+
const request = {
|
|
1304
|
+
'uuid': id,
|
|
1305
|
+
};
|
|
1306
|
+
let currency = undefined;
|
|
1307
|
+
if (code !== undefined) {
|
|
1308
|
+
currency = this.currency(code);
|
|
1309
|
+
request['currency'] = currency['id'];
|
|
1310
|
+
}
|
|
1311
|
+
const response = await this.privateGetWithdraw(this.extend(request, params));
|
|
1312
|
+
//
|
|
1313
|
+
// {
|
|
1314
|
+
// "type": "withdraw",
|
|
1315
|
+
// "uuid": "95ef274b-23a6-4de4-95b0-5cbef4ca658f",
|
|
1316
|
+
// "currency": "ADA",
|
|
1317
|
+
// "net_type": "ADA",
|
|
1318
|
+
// "txid": "b1528f149297a71671b86636f731f8fdb0ff53da0f1d8c19093d59df96f34583",
|
|
1319
|
+
// "state": "DONE",
|
|
1320
|
+
// "created_at": "2023-12-14T02:46:52Z",
|
|
1321
|
+
// "done_at": "2023-12-14T03:10:11Z",
|
|
1322
|
+
// "amount": "35.22344",
|
|
1323
|
+
// "fee": "0.5",
|
|
1324
|
+
// "transaction_type": "default"
|
|
1325
|
+
// }
|
|
1326
|
+
//
|
|
1327
|
+
return this.parseTransaction(response, currency);
|
|
1328
|
+
}
|
|
1240
1329
|
parseTransactionStatus(status) {
|
|
1241
1330
|
const statuses = {
|
|
1242
1331
|
'submitting': 'pending',
|
|
1243
1332
|
'submitted': 'pending',
|
|
1244
1333
|
'almost_accepted': 'pending',
|
|
1245
1334
|
'rejected': 'failed',
|
|
1246
|
-
'accepted': '
|
|
1335
|
+
'accepted': 'ok',
|
|
1247
1336
|
'processing': 'pending',
|
|
1248
1337
|
'done': 'ok',
|
|
1249
1338
|
'canceled': 'canceled', // 취소됨
|
|
@@ -1252,7 +1341,7 @@ class upbit extends upbit$1 {
|
|
|
1252
1341
|
}
|
|
1253
1342
|
parseTransaction(transaction, currency = undefined) {
|
|
1254
1343
|
//
|
|
1255
|
-
// fetchDeposits
|
|
1344
|
+
// fetchDeposits, fetchDeposit
|
|
1256
1345
|
//
|
|
1257
1346
|
// {
|
|
1258
1347
|
// "type": "deposit",
|
|
@@ -1266,7 +1355,7 @@ class upbit extends upbit$1 {
|
|
|
1266
1355
|
// "fee": "0.0"
|
|
1267
1356
|
// }
|
|
1268
1357
|
//
|
|
1269
|
-
// fetchWithdrawals
|
|
1358
|
+
// fetchWithdrawals, fetchWithdrawal
|
|
1270
1359
|
//
|
|
1271
1360
|
// {
|
|
1272
1361
|
// "type": "withdraw",
|
|
@@ -1281,27 +1370,21 @@ class upbit extends upbit$1 {
|
|
|
1281
1370
|
// "krw_amount": "80420.0"
|
|
1282
1371
|
// }
|
|
1283
1372
|
//
|
|
1284
|
-
const id = this.safeString(transaction, 'uuid');
|
|
1285
|
-
const amount = this.safeNumber(transaction, 'amount');
|
|
1286
1373
|
const address = undefined; // not present in the data structure received from the exchange
|
|
1287
1374
|
const tag = undefined; // not present in the data structure received from the exchange
|
|
1288
|
-
const txid = this.safeString(transaction, 'txid');
|
|
1289
1375
|
const updatedRaw = this.safeString(transaction, 'done_at');
|
|
1290
|
-
const updated = this.parse8601(updatedRaw);
|
|
1291
1376
|
const timestamp = this.parse8601(this.safeString(transaction, 'created_at', updatedRaw));
|
|
1292
1377
|
let type = this.safeString(transaction, 'type');
|
|
1293
1378
|
if (type === 'withdraw') {
|
|
1294
1379
|
type = 'withdrawal';
|
|
1295
1380
|
}
|
|
1296
1381
|
const currencyId = this.safeString(transaction, 'currency');
|
|
1297
|
-
const code = this.safeCurrencyCode(currencyId);
|
|
1298
|
-
const status = this.parseTransactionStatus(this.safeStringLower(transaction, 'state'));
|
|
1299
|
-
const feeCost = this.safeNumber(transaction, 'fee');
|
|
1382
|
+
const code = this.safeCurrencyCode(currencyId, currency);
|
|
1300
1383
|
return {
|
|
1301
1384
|
'info': transaction,
|
|
1302
|
-
'id':
|
|
1385
|
+
'id': this.safeString(transaction, 'uuid'),
|
|
1303
1386
|
'currency': code,
|
|
1304
|
-
'amount': amount,
|
|
1387
|
+
'amount': this.safeNumber(transaction, 'amount'),
|
|
1305
1388
|
'network': undefined,
|
|
1306
1389
|
'address': address,
|
|
1307
1390
|
'addressTo': undefined,
|
|
@@ -1309,17 +1392,17 @@ class upbit extends upbit$1 {
|
|
|
1309
1392
|
'tag': tag,
|
|
1310
1393
|
'tagTo': undefined,
|
|
1311
1394
|
'tagFrom': undefined,
|
|
1312
|
-
'status':
|
|
1395
|
+
'status': this.parseTransactionStatus(this.safeStringLower(transaction, 'state')),
|
|
1313
1396
|
'type': type,
|
|
1314
|
-
'updated':
|
|
1315
|
-
'txid': txid,
|
|
1397
|
+
'updated': this.parse8601(updatedRaw),
|
|
1398
|
+
'txid': this.safeString(transaction, 'txid'),
|
|
1316
1399
|
'timestamp': timestamp,
|
|
1317
1400
|
'datetime': this.iso8601(timestamp),
|
|
1318
1401
|
'internal': undefined,
|
|
1319
1402
|
'comment': undefined,
|
|
1320
1403
|
'fee': {
|
|
1321
1404
|
'currency': code,
|
|
1322
|
-
'cost':
|
|
1405
|
+
'cost': this.safeNumber(transaction, 'fee'),
|
|
1323
1406
|
},
|
|
1324
1407
|
};
|
|
1325
1408
|
}
|
|
@@ -1799,7 +1882,7 @@ class upbit extends upbit$1 {
|
|
|
1799
1882
|
}
|
|
1800
1883
|
if (api === 'private') {
|
|
1801
1884
|
this.checkRequiredCredentials();
|
|
1802
|
-
const nonce = this.
|
|
1885
|
+
const nonce = this.uuid();
|
|
1803
1886
|
const request = {
|
|
1804
1887
|
'access_key': this.apiKey,
|
|
1805
1888
|
'nonce': nonce,
|
package/js/ccxt.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
|
|
|
4
4
|
import * as errors from './src/base/errors.js';
|
|
5
5
|
import type { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.2.
|
|
7
|
+
declare const version = "4.2.48";
|
|
8
8
|
import ace from './src/ace.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import ascendex from './src/ascendex.js';
|
package/js/ccxt.js
CHANGED
|
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
|
|
|
38
38
|
import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.2.
|
|
41
|
+
const version = '4.2.49';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -225,6 +225,14 @@ interface Exchange {
|
|
|
225
225
|
privatePostEurcvAddress(params?: {}): Promise<implicitReturnType>;
|
|
226
226
|
privatePostPyusdWithdrawal(params?: {}): Promise<implicitReturnType>;
|
|
227
227
|
privatePostPyusdAddress(params?: {}): Promise<implicitReturnType>;
|
|
228
|
+
privatePostLmwrWithdrawal(params?: {}): Promise<implicitReturnType>;
|
|
229
|
+
privatePostLmwrAddress(params?: {}): Promise<implicitReturnType>;
|
|
230
|
+
privatePostPepeWithdrawal(params?: {}): Promise<implicitReturnType>;
|
|
231
|
+
privatePostPepeAddress(params?: {}): Promise<implicitReturnType>;
|
|
232
|
+
privatePostBlurWithdrawal(params?: {}): Promise<implicitReturnType>;
|
|
233
|
+
privatePostBlurAddress(params?: {}): Promise<implicitReturnType>;
|
|
234
|
+
privatePostVextWithdrawal(params?: {}): Promise<implicitReturnType>;
|
|
235
|
+
privatePostVextAddress(params?: {}): Promise<implicitReturnType>;
|
|
228
236
|
}
|
|
229
237
|
declare abstract class Exchange extends _Exchange {
|
|
230
238
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { implicitReturnType } from '../base/types.js';
|
|
2
2
|
import { Exchange as _Exchange } from '../base/Exchange.js';
|
|
3
3
|
interface Exchange {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
publicGetApiServerTime(params?: {}): Promise<implicitReturnType>;
|
|
5
|
+
publicGetApiPairs(params?: {}): Promise<implicitReturnType>;
|
|
6
|
+
publicGetApiPriceIncrements(params?: {}): Promise<implicitReturnType>;
|
|
7
|
+
publicGetApiSummaries(params?: {}): Promise<implicitReturnType>;
|
|
8
|
+
publicGetApiTickerPair(params?: {}): Promise<implicitReturnType>;
|
|
9
|
+
publicGetApiTickerAll(params?: {}): Promise<implicitReturnType>;
|
|
10
|
+
publicGetApiTradesPair(params?: {}): Promise<implicitReturnType>;
|
|
11
|
+
publicGetApiDepthPair(params?: {}): Promise<implicitReturnType>;
|
|
12
|
+
publicGetTradingviewHistoryV2(params?: {}): Promise<implicitReturnType>;
|
|
12
13
|
privatePostGetInfo(params?: {}): Promise<implicitReturnType>;
|
|
13
14
|
privatePostTransHistory(params?: {}): Promise<implicitReturnType>;
|
|
14
15
|
privatePostTrade(params?: {}): Promise<implicitReturnType>;
|
package/js/src/binance.js
CHANGED
|
@@ -3020,7 +3020,7 @@ export default class binance extends Exchange {
|
|
|
3020
3020
|
let fees = this.fees;
|
|
3021
3021
|
let linear = undefined;
|
|
3022
3022
|
let inverse = undefined;
|
|
3023
|
-
const strike = this.
|
|
3023
|
+
const strike = this.safeString(market, 'strikePrice');
|
|
3024
3024
|
let symbol = base + '/' + quote;
|
|
3025
3025
|
if (contract) {
|
|
3026
3026
|
if (swap) {
|
|
@@ -3030,7 +3030,7 @@ export default class binance extends Exchange {
|
|
|
3030
3030
|
symbol = symbol + ':' + settle + '-' + this.yymmdd(expiry);
|
|
3031
3031
|
}
|
|
3032
3032
|
else if (option) {
|
|
3033
|
-
symbol = symbol + ':' + settle + '-' + this.yymmdd(expiry) + '-' +
|
|
3033
|
+
symbol = symbol + ':' + settle + '-' + this.yymmdd(expiry) + '-' + strike + '-' + this.safeString(optionParts, 3);
|
|
3034
3034
|
}
|
|
3035
3035
|
contractSize = this.safeNumber2(market, 'contractSize', 'unit', this.parseNumber('1'));
|
|
3036
3036
|
linear = settle === quote;
|
|
@@ -3063,6 +3063,10 @@ export default class binance extends Exchange {
|
|
|
3063
3063
|
unifiedType = 'option';
|
|
3064
3064
|
active = undefined;
|
|
3065
3065
|
}
|
|
3066
|
+
let parsedStrike = undefined;
|
|
3067
|
+
if (strike !== undefined) {
|
|
3068
|
+
parsedStrike = this.parseToNumeric(strike);
|
|
3069
|
+
}
|
|
3066
3070
|
const entry = {
|
|
3067
3071
|
'id': id,
|
|
3068
3072
|
'lowercaseId': lowercaseId,
|
|
@@ -3088,7 +3092,7 @@ export default class binance extends Exchange {
|
|
|
3088
3092
|
'contractSize': contractSize,
|
|
3089
3093
|
'expiry': expiry,
|
|
3090
3094
|
'expiryDatetime': this.iso8601(expiry),
|
|
3091
|
-
'strike':
|
|
3095
|
+
'strike': parsedStrike,
|
|
3092
3096
|
'optionType': this.safeStringLower(market, 'side'),
|
|
3093
3097
|
'precision': {
|
|
3094
3098
|
'amount': this.safeInteger2(market, 'quantityPrecision', 'quantityScale'),
|
|
@@ -5774,12 +5778,14 @@ export default class binance extends Exchange {
|
|
|
5774
5778
|
const trailingDelta = this.safeString(params, 'trailingDelta');
|
|
5775
5779
|
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activationPrice', this.numberToString(price));
|
|
5776
5780
|
const trailingPercent = this.safeString2(params, 'trailingPercent', 'callbackRate');
|
|
5781
|
+
const priceMatch = this.safeString(params, 'priceMatch');
|
|
5777
5782
|
const isTrailingPercentOrder = trailingPercent !== undefined;
|
|
5778
5783
|
const isStopLoss = stopLossPrice !== undefined || trailingDelta !== undefined;
|
|
5779
5784
|
const isTakeProfit = takeProfitPrice !== undefined;
|
|
5780
5785
|
const isTriggerOrder = triggerPrice !== undefined;
|
|
5781
5786
|
const isConditional = isTriggerOrder || isTrailingPercentOrder || isStopLoss || isTakeProfit;
|
|
5782
5787
|
const isPortfolioMarginConditional = (isPortfolioMargin && isConditional);
|
|
5788
|
+
const isPriceMatch = priceMatch !== undefined;
|
|
5783
5789
|
let uppercaseType = type.toUpperCase();
|
|
5784
5790
|
let stopPrice = undefined;
|
|
5785
5791
|
if (isTrailingPercentOrder) {
|
|
@@ -5960,7 +5966,7 @@ export default class binance extends Exchange {
|
|
|
5960
5966
|
request['quantity'] = this.amountToPrecision(symbol, amount);
|
|
5961
5967
|
}
|
|
5962
5968
|
}
|
|
5963
|
-
if (priceIsRequired) {
|
|
5969
|
+
if (priceIsRequired && !isPriceMatch) {
|
|
5964
5970
|
if (price === undefined) {
|
|
5965
5971
|
throw new InvalidOrder(this.id + ' createOrder() requires a price argument for a ' + type + ' order');
|
|
5966
5972
|
}
|
package/js/src/bitmart.js
CHANGED
|
@@ -1126,7 +1126,7 @@ export default class bitmart extends Exchange {
|
|
|
1126
1126
|
}
|
|
1127
1127
|
parseTicker(ticker, market = undefined) {
|
|
1128
1128
|
//
|
|
1129
|
-
// spot
|
|
1129
|
+
// spot (REST)
|
|
1130
1130
|
//
|
|
1131
1131
|
// {
|
|
1132
1132
|
// "symbol": "SOLAR_USDT",
|
|
@@ -1146,6 +1146,17 @@ export default class bitmart extends Exchange {
|
|
|
1146
1146
|
// "timestamp": 1667403439367
|
|
1147
1147
|
// }
|
|
1148
1148
|
//
|
|
1149
|
+
// spot (WS)
|
|
1150
|
+
// {
|
|
1151
|
+
// "symbol":"BTC_USDT",
|
|
1152
|
+
// "last_price":"146.24",
|
|
1153
|
+
// "open_24h":"147.17",
|
|
1154
|
+
// "high_24h":"147.48",
|
|
1155
|
+
// "low_24h":"143.88",
|
|
1156
|
+
// "base_volume_24h":"117387.58", // NOT base, but quote currency!!!
|
|
1157
|
+
// "s_t": 1610936002
|
|
1158
|
+
// }
|
|
1159
|
+
//
|
|
1149
1160
|
// swap
|
|
1150
1161
|
//
|
|
1151
1162
|
// {
|
|
@@ -1161,7 +1172,11 @@ export default class bitmart extends Exchange {
|
|
|
1161
1172
|
// "legal_coin_price":"0.1302699"
|
|
1162
1173
|
// }
|
|
1163
1174
|
//
|
|
1164
|
-
|
|
1175
|
+
let timestamp = this.safeInteger(ticker, 'timestamp');
|
|
1176
|
+
if (timestamp === undefined) {
|
|
1177
|
+
// ticker from WS has a different field (in seconds)
|
|
1178
|
+
timestamp = this.safeIntegerProduct(ticker, 's_t', 1000);
|
|
1179
|
+
}
|
|
1165
1180
|
const marketId = this.safeString2(ticker, 'symbol', 'contract_symbol');
|
|
1166
1181
|
market = this.safeMarket(marketId, market);
|
|
1167
1182
|
const symbol = market['symbol'];
|
|
@@ -1177,9 +1192,20 @@ export default class bitmart extends Exchange {
|
|
|
1177
1192
|
percentage = '0';
|
|
1178
1193
|
}
|
|
1179
1194
|
}
|
|
1180
|
-
|
|
1195
|
+
let baseVolume = this.safeString(ticker, 'base_volume_24h');
|
|
1181
1196
|
let quoteVolume = this.safeString(ticker, 'quote_volume_24h');
|
|
1182
|
-
|
|
1197
|
+
if (quoteVolume === undefined) {
|
|
1198
|
+
if (baseVolume === undefined) {
|
|
1199
|
+
// this is swap
|
|
1200
|
+
quoteVolume = this.safeString(ticker, 'volume_24h', quoteVolume);
|
|
1201
|
+
}
|
|
1202
|
+
else {
|
|
1203
|
+
// this is a ticker from websockets
|
|
1204
|
+
// contrary to name and documentation, base_volume_24h is actually the quote volume
|
|
1205
|
+
quoteVolume = baseVolume;
|
|
1206
|
+
baseVolume = undefined;
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1183
1209
|
const average = this.safeString2(ticker, 'avg_price', 'index_price');
|
|
1184
1210
|
const high = this.safeString2(ticker, 'high_24h', 'high_price');
|
|
1185
1211
|
const low = this.safeString2(ticker, 'low_24h', 'low_price');
|
package/js/src/bitstamp.js
CHANGED
|
@@ -351,6 +351,14 @@ export default class bitstamp extends Exchange {
|
|
|
351
351
|
'eurcv_address/': 1,
|
|
352
352
|
'pyusd_withdrawal/': 1,
|
|
353
353
|
'pyusd_address/': 1,
|
|
354
|
+
'lmwr_withdrawal/': 1,
|
|
355
|
+
'lmwr_address/': 1,
|
|
356
|
+
'pepe_withdrawal/': 1,
|
|
357
|
+
'pepe_address/': 1,
|
|
358
|
+
'blur_withdrawal/': 1,
|
|
359
|
+
'blur_address/': 1,
|
|
360
|
+
'vext_withdrawal/': 1,
|
|
361
|
+
'vext_address/': 1,
|
|
354
362
|
},
|
|
355
363
|
},
|
|
356
364
|
},
|
package/js/src/btcalpha.js
CHANGED
|
@@ -33,6 +33,7 @@ export default class btcalpha extends Exchange {
|
|
|
33
33
|
'cancelOrder': true,
|
|
34
34
|
'closeAllPositions': false,
|
|
35
35
|
'closePosition': false,
|
|
36
|
+
'createDepositAddress': false,
|
|
36
37
|
'createOrder': true,
|
|
37
38
|
'createReduceOnlyOrder': false,
|
|
38
39
|
'createStopLimitOrder': false,
|
|
@@ -45,6 +46,9 @@ export default class btcalpha extends Exchange {
|
|
|
45
46
|
'fetchCrossBorrowRate': false,
|
|
46
47
|
'fetchCrossBorrowRates': false,
|
|
47
48
|
'fetchDeposit': false,
|
|
49
|
+
'fetchDepositAddress': false,
|
|
50
|
+
'fetchDepositAddresses': false,
|
|
51
|
+
'fetchDepositAddressesByNetwork': false,
|
|
48
52
|
'fetchDeposits': true,
|
|
49
53
|
'fetchFundingHistory': false,
|
|
50
54
|
'fetchFundingRate': false,
|
package/js/src/btcmarkets.js
CHANGED
|
@@ -35,6 +35,7 @@ export default class btcmarkets extends Exchange {
|
|
|
35
35
|
'cancelOrders': true,
|
|
36
36
|
'closeAllPositions': false,
|
|
37
37
|
'closePosition': false,
|
|
38
|
+
'createDepositAddress': false,
|
|
38
39
|
'createOrder': true,
|
|
39
40
|
'createReduceOnlyOrder': false,
|
|
40
41
|
'fetchBalance': true,
|
|
@@ -43,6 +44,9 @@ export default class btcmarkets extends Exchange {
|
|
|
43
44
|
'fetchClosedOrders': 'emulated',
|
|
44
45
|
'fetchCrossBorrowRate': false,
|
|
45
46
|
'fetchCrossBorrowRates': false,
|
|
47
|
+
'fetchDepositAddress': false,
|
|
48
|
+
'fetchDepositAddresses': false,
|
|
49
|
+
'fetchDepositAddressesByNetwork': false,
|
|
46
50
|
'fetchDeposits': true,
|
|
47
51
|
'fetchDepositsWithdrawals': true,
|
|
48
52
|
'fetchFundingHistory': false,
|
package/js/src/btcturk.js
CHANGED
|
@@ -34,6 +34,7 @@ export default class btcturk extends Exchange {
|
|
|
34
34
|
'cancelOrder': true,
|
|
35
35
|
'closeAllPositions': false,
|
|
36
36
|
'closePosition': false,
|
|
37
|
+
'createDepositAddress': false,
|
|
37
38
|
'createOrder': true,
|
|
38
39
|
'createReduceOnlyOrder': false,
|
|
39
40
|
'fetchBalance': true,
|
|
@@ -41,6 +42,9 @@ export default class btcturk extends Exchange {
|
|
|
41
42
|
'fetchBorrowRateHistory': false,
|
|
42
43
|
'fetchCrossBorrowRate': false,
|
|
43
44
|
'fetchCrossBorrowRates': false,
|
|
45
|
+
'fetchDepositAddress': false,
|
|
46
|
+
'fetchDepositAddresses': false,
|
|
47
|
+
'fetchDepositAddressesByNetwork': false,
|
|
44
48
|
'fetchFundingHistory': false,
|
|
45
49
|
'fetchFundingRate': false,
|
|
46
50
|
'fetchFundingRateHistory': false,
|
package/js/src/bybit.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/bybit.js';
|
|
2
|
-
import type { Int, OrderSide, OrderType, Trade, Order, OHLCV, FundingRateHistory, OpenInterest, OrderRequest, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Greeks, Strings, Market, Currency, MarketInterface, TransferEntry } from './base/types.js';
|
|
2
|
+
import type { Int, OrderSide, OrderType, Trade, Order, OHLCV, FundingRateHistory, OpenInterest, OrderRequest, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Greeks, Strings, Market, Currency, MarketInterface, TransferEntry, Liquidation } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class bybit
|
|
5
5
|
* @augments Exchange
|
|
@@ -249,6 +249,8 @@ export default class bybit extends Exchange {
|
|
|
249
249
|
underlyingPrice: number;
|
|
250
250
|
info: any;
|
|
251
251
|
};
|
|
252
|
+
fetchMyLiquidations(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
|
|
253
|
+
parseLiquidation(liquidation: any, market?: Market): Liquidation;
|
|
252
254
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
253
255
|
url: string;
|
|
254
256
|
method: string;
|