ccxt 4.0.102 → 4.0.103
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/dist/ccxt.browser.js +515 -273
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +2 -1
- package/dist/cjs/src/base/errors.js +2 -1
- package/dist/cjs/src/bingx.js +70 -0
- package/dist/cjs/src/bitget.js +3 -0
- package/dist/cjs/src/bitmart.js +202 -46
- package/dist/cjs/src/bitrue.js +7 -0
- package/dist/cjs/src/bybit.js +6 -6
- package/dist/cjs/src/gate.js +221 -218
- package/dist/cjs/src/wavesexchange.js +2 -1
- package/js/ccxt.d.ts +3 -3
- package/js/ccxt.js +3 -3
- package/js/src/base/errorHierarchy.d.ts +1 -0
- package/js/src/base/errorHierarchy.js +1 -0
- package/js/src/base/errors.d.ts +2 -1
- package/js/src/base/errors.js +2 -2
- package/js/src/bingx.d.ts +8 -0
- package/js/src/bingx.js +70 -0
- package/js/src/bitget.js +3 -0
- package/js/src/bitmart.d.ts +8 -5
- package/js/src/bitmart.js +202 -46
- package/js/src/bitrue.js +7 -0
- package/js/src/bybit.js +7 -7
- package/js/src/gate.js +221 -218
- package/js/src/wavesexchange.js +2 -1
- package/package.json +1 -1
- package/skip-tests.json +2 -0
package/dist/cjs/ccxt.js
CHANGED
|
@@ -179,7 +179,7 @@ var woo$1 = require('./src/pro/woo.js');
|
|
|
179
179
|
|
|
180
180
|
//-----------------------------------------------------------------------------
|
|
181
181
|
// this is updated by vss.js when building
|
|
182
|
-
const version = '4.0.
|
|
182
|
+
const version = '4.0.103';
|
|
183
183
|
Exchange["default"].ccxtVersion = version;
|
|
184
184
|
const exchanges = {
|
|
185
185
|
'ace': ace,
|
|
@@ -378,6 +378,7 @@ exports.InvalidNonce = errors.InvalidNonce;
|
|
|
378
378
|
exports.InvalidOrder = errors.InvalidOrder;
|
|
379
379
|
exports.MarginModeAlreadySet = errors.MarginModeAlreadySet;
|
|
380
380
|
exports.NetworkError = errors.NetworkError;
|
|
381
|
+
exports.NoChange = errors.NoChange;
|
|
381
382
|
exports.NotSupported = errors.NotSupported;
|
|
382
383
|
exports.NullResponse = errors.NullResponse;
|
|
383
384
|
exports.OnMaintenance = errors.OnMaintenance;
|
|
@@ -234,7 +234,7 @@ class RequestTimeout extends NetworkError {
|
|
|
234
234
|
// // Derived class hierarchy
|
|
235
235
|
// errorHierarchy
|
|
236
236
|
// )
|
|
237
|
-
const errors = { 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, ContractUnavailable };
|
|
237
|
+
const errors = { 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, ContractUnavailable, NoChange };
|
|
238
238
|
|
|
239
239
|
exports.AccountNotEnabled = AccountNotEnabled;
|
|
240
240
|
exports.AccountSuspended = AccountSuspended;
|
|
@@ -257,6 +257,7 @@ exports.InvalidNonce = InvalidNonce;
|
|
|
257
257
|
exports.InvalidOrder = InvalidOrder;
|
|
258
258
|
exports.MarginModeAlreadySet = MarginModeAlreadySet;
|
|
259
259
|
exports.NetworkError = NetworkError;
|
|
260
|
+
exports.NoChange = NoChange;
|
|
260
261
|
exports.NotSupported = NotSupported;
|
|
261
262
|
exports.NullResponse = NullResponse;
|
|
262
263
|
exports.OnMaintenance = OnMaintenance;
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -33,6 +33,7 @@ class bingx extends bingx$1 {
|
|
|
33
33
|
'fetchBalance': true,
|
|
34
34
|
'fetchClosedOrders': true,
|
|
35
35
|
'fetchCurrencies': true,
|
|
36
|
+
'fetchDepositAddress': true,
|
|
36
37
|
'fetchDeposits': true,
|
|
37
38
|
'fetchDepositWithdrawFee': 'emulated',
|
|
38
39
|
'fetchDepositWithdrawFees': true,
|
|
@@ -319,6 +320,7 @@ class bingx extends bingx$1 {
|
|
|
319
320
|
'PFUTURES': 'swap',
|
|
320
321
|
'SFUTURES': 'future',
|
|
321
322
|
},
|
|
323
|
+
'recvWindow': 5 * 1000, // 5 sec
|
|
322
324
|
},
|
|
323
325
|
});
|
|
324
326
|
}
|
|
@@ -2379,6 +2381,74 @@ class bingx extends bingx$1 {
|
|
|
2379
2381
|
'status': status,
|
|
2380
2382
|
};
|
|
2381
2383
|
}
|
|
2384
|
+
async fetchDepositAddress(code, params = {}) {
|
|
2385
|
+
/**
|
|
2386
|
+
* @method
|
|
2387
|
+
* @name bingx#fetchDepositAddress
|
|
2388
|
+
* @description fetch the deposit address for a currency associated with this account
|
|
2389
|
+
* @see https://bingx-api.github.io/docs/#/common/sub-account#Query%20Main%20Account%20Deposit%20Address
|
|
2390
|
+
* @param {string} code unified currency code
|
|
2391
|
+
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
2392
|
+
* @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
|
|
2393
|
+
*/
|
|
2394
|
+
await this.loadMarkets();
|
|
2395
|
+
const currency = this.currency(code);
|
|
2396
|
+
const defaultRecvWindow = this.safeInteger(this.options, 'recvWindow');
|
|
2397
|
+
const recvWindow = this.safeInteger(this.parseParams, 'recvWindow', defaultRecvWindow);
|
|
2398
|
+
const request = {
|
|
2399
|
+
'coin': currency['id'],
|
|
2400
|
+
'offset': 0,
|
|
2401
|
+
'limit': 1000,
|
|
2402
|
+
'recvWindow': recvWindow,
|
|
2403
|
+
};
|
|
2404
|
+
const response = await this.walletsV1PrivateGetCapitalDepositAddress(this.extend(request, params));
|
|
2405
|
+
//
|
|
2406
|
+
// {
|
|
2407
|
+
// code: '0',
|
|
2408
|
+
// timestamp: '1695200226859',
|
|
2409
|
+
// data: {
|
|
2410
|
+
// data: [
|
|
2411
|
+
// {
|
|
2412
|
+
// coinId: '799',
|
|
2413
|
+
// coin: 'USDT',
|
|
2414
|
+
// network: 'BEP20',
|
|
2415
|
+
// address: '6a7eda2817462dabb6493277a2cfe0f5c3f2550b',
|
|
2416
|
+
// tag: ''
|
|
2417
|
+
// }
|
|
2418
|
+
// ],
|
|
2419
|
+
// total: '1'
|
|
2420
|
+
// }
|
|
2421
|
+
// }
|
|
2422
|
+
//
|
|
2423
|
+
const data = this.safeValue(this.safeValue(response, 'data'), 'data');
|
|
2424
|
+
const parsed = this.parseDepositAddresses(data, [currency['code']], false);
|
|
2425
|
+
return this.indexBy(parsed, 'network');
|
|
2426
|
+
}
|
|
2427
|
+
parseDepositAddress(depositAddress, currency = undefined) {
|
|
2428
|
+
//
|
|
2429
|
+
// {
|
|
2430
|
+
// coinId: '799',
|
|
2431
|
+
// coin: 'USDT',
|
|
2432
|
+
// network: 'BEP20',
|
|
2433
|
+
// address: '6a7eda2817462dabb6493277a2cfe0f5c3f2550b',
|
|
2434
|
+
// tag: ''
|
|
2435
|
+
// }
|
|
2436
|
+
//
|
|
2437
|
+
const address = this.safeString(depositAddress, 'address');
|
|
2438
|
+
const tag = this.safeString(depositAddress, 'tag');
|
|
2439
|
+
const currencyId = this.safeString(depositAddress, 'coin');
|
|
2440
|
+
currency = this.safeCurrency(currencyId, currency);
|
|
2441
|
+
const code = currency['code'];
|
|
2442
|
+
const network = this.safeString(depositAddress, 'network');
|
|
2443
|
+
this.checkAddress(address);
|
|
2444
|
+
return {
|
|
2445
|
+
'currency': code,
|
|
2446
|
+
'address': address,
|
|
2447
|
+
'tag': tag,
|
|
2448
|
+
'network': network,
|
|
2449
|
+
'info': depositAddress,
|
|
2450
|
+
};
|
|
2451
|
+
}
|
|
2382
2452
|
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2383
2453
|
/**
|
|
2384
2454
|
* @method
|
package/dist/cjs/src/bitget.js
CHANGED
|
@@ -2566,6 +2566,9 @@ class bitget extends bitget$1 {
|
|
|
2566
2566
|
response = await this.publicMixGetMarketHistoryCandles(this.extend(request, params));
|
|
2567
2567
|
}
|
|
2568
2568
|
}
|
|
2569
|
+
if (response === '') {
|
|
2570
|
+
return []; // happens when a new token is listed
|
|
2571
|
+
}
|
|
2569
2572
|
// [ ["1645911960000","39406","39407","39374.5","39379","35.526","1399132.341"] ]
|
|
2570
2573
|
const data = this.safeValue(response, 'data', response);
|
|
2571
2574
|
return this.parseOHLCVs(data, market, timeframe, since, limit);
|
package/dist/cjs/src/bitmart.js
CHANGED
|
@@ -82,7 +82,7 @@ class bitmart extends bitmart$1 {
|
|
|
82
82
|
'fetchTransactionFee': true,
|
|
83
83
|
'fetchTransactionFees': false,
|
|
84
84
|
'fetchTransfer': false,
|
|
85
|
-
'fetchTransfers':
|
|
85
|
+
'fetchTransfers': true,
|
|
86
86
|
'fetchWithdrawAddressesByNetwork': false,
|
|
87
87
|
'fetchWithdrawal': true,
|
|
88
88
|
'fetchWithdrawals': true,
|
|
@@ -566,6 +566,7 @@ class bitmart extends bitmart$1 {
|
|
|
566
566
|
},
|
|
567
567
|
'accountsByType': {
|
|
568
568
|
'spot': 'spot',
|
|
569
|
+
'swap': 'swap',
|
|
569
570
|
},
|
|
570
571
|
'createMarketBuyOrderRequiresPrice': true,
|
|
571
572
|
},
|
|
@@ -1225,6 +1226,8 @@ class bitmart extends bitmart$1 {
|
|
|
1225
1226
|
* @method
|
|
1226
1227
|
* @name bitmart#fetchOrderBook
|
|
1227
1228
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
1229
|
+
* @see https://developer-pro.bitmart.com/en/spot/#get-depth-v3
|
|
1230
|
+
* @see https://developer-pro.bitmart.com/en/futures/#get-market-depth
|
|
1228
1231
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
1229
1232
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
1230
1233
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
@@ -1232,41 +1235,70 @@ class bitmart extends bitmart$1 {
|
|
|
1232
1235
|
*/
|
|
1233
1236
|
await this.loadMarkets();
|
|
1234
1237
|
const market = this.market(symbol);
|
|
1235
|
-
if (!market['spot']) {
|
|
1236
|
-
throw new errors.NotSupported(this.id + ' fetchOrderBook() does not support ' + market['type'] + ' markets, only spot markets are accepted');
|
|
1237
|
-
}
|
|
1238
1238
|
const request = {
|
|
1239
1239
|
'symbol': market['id'],
|
|
1240
1240
|
};
|
|
1241
|
-
|
|
1242
|
-
|
|
1241
|
+
let response = undefined;
|
|
1242
|
+
if (market['spot']) {
|
|
1243
|
+
if (limit !== undefined) {
|
|
1244
|
+
request['limit'] = limit; // default 35, max 50
|
|
1245
|
+
}
|
|
1246
|
+
response = await this.publicGetSpotQuotationV3Books(this.extend(request, params));
|
|
1247
|
+
}
|
|
1248
|
+
else if (market['swap']) {
|
|
1249
|
+
response = await this.publicGetContractPublicDepth(this.extend(request, params));
|
|
1250
|
+
}
|
|
1251
|
+
else {
|
|
1252
|
+
throw new errors.NotSupported(this.id + ' fetchOrderBook() does not support ' + market['type'] + ' markets, only spot and swap markets are accepted');
|
|
1243
1253
|
}
|
|
1244
|
-
// request['precision'] = 4; // optional price precision / depth level whose range is defined in symbol details
|
|
1245
|
-
const response = await this.publicGetSpotV1SymbolsBook(this.extend(request, params));
|
|
1246
1254
|
//
|
|
1247
1255
|
// spot
|
|
1248
1256
|
//
|
|
1249
1257
|
// {
|
|
1250
|
-
// "
|
|
1251
|
-
// "
|
|
1252
|
-
// "
|
|
1253
|
-
//
|
|
1254
|
-
// "
|
|
1255
|
-
//
|
|
1256
|
-
//
|
|
1257
|
-
//
|
|
1258
|
+
// "code": 1000,
|
|
1259
|
+
// "message": "success",
|
|
1260
|
+
// "data": {
|
|
1261
|
+
// "ts": "1695264191808",
|
|
1262
|
+
// "symbol": "BTC_USDT",
|
|
1263
|
+
// "asks": [
|
|
1264
|
+
// ["26942.57","0.06492"],
|
|
1265
|
+
// ["26942.73","0.05447"],
|
|
1266
|
+
// ["26943.00","0.07154"]
|
|
1258
1267
|
// ],
|
|
1259
|
-
// "
|
|
1260
|
-
//
|
|
1261
|
-
//
|
|
1262
|
-
//
|
|
1268
|
+
// "bids": [
|
|
1269
|
+
// ["26942.45","0.00074"],
|
|
1270
|
+
// ["26941.53","0.00371"],
|
|
1271
|
+
// ["26940.94","0.08992"]
|
|
1263
1272
|
// ]
|
|
1264
|
-
// }
|
|
1273
|
+
// },
|
|
1274
|
+
// "trace": "430a7f69581d4258a8e4b424dfb10782.73.16952341919017619"
|
|
1275
|
+
// }
|
|
1276
|
+
//
|
|
1277
|
+
// swap
|
|
1278
|
+
//
|
|
1279
|
+
// {
|
|
1280
|
+
// "code": 1000,
|
|
1281
|
+
// "message": "Ok",
|
|
1282
|
+
// "data": {
|
|
1283
|
+
// "asks": [
|
|
1284
|
+
// ["26938.3","3499","3499"],
|
|
1285
|
+
// ["26938.5","14702","18201"],
|
|
1286
|
+
// ["26938.6","20457","38658"]
|
|
1287
|
+
// ],
|
|
1288
|
+
// "bids": [
|
|
1289
|
+
// ["26938.2","20","20"],
|
|
1290
|
+
// ["26937.9","1913","1933"],
|
|
1291
|
+
// ["26937.8","2588","4521"]
|
|
1292
|
+
// ],
|
|
1293
|
+
// "timestamp": 1695264383999,
|
|
1294
|
+
// "symbol": "BTCUSDT"
|
|
1295
|
+
// },
|
|
1296
|
+
// "trace": "4cad855074664097ac6ba5258c47305d.72.16952643834721135"
|
|
1265
1297
|
// }
|
|
1266
1298
|
//
|
|
1267
1299
|
const data = this.safeValue(response, 'data', {});
|
|
1268
|
-
const timestamp = this.
|
|
1269
|
-
return this.parseOrderBook(data, symbol, timestamp
|
|
1300
|
+
const timestamp = this.safeInteger2(data, 'ts', 'timestamp');
|
|
1301
|
+
return this.parseOrderBook(data, market['symbol'], timestamp);
|
|
1270
1302
|
}
|
|
1271
1303
|
parseTrade(trade, market = undefined) {
|
|
1272
1304
|
//
|
|
@@ -3013,7 +3045,8 @@ class bitmart extends bitmart$1 {
|
|
|
3013
3045
|
* @method
|
|
3014
3046
|
* @name bitmart#transfer
|
|
3015
3047
|
* @description transfer currency internally between wallets on the same account, currently only supports transfer between spot and margin
|
|
3016
|
-
* @see https://developer-pro.bitmart.com/en/spot/#margin-asset-transfer
|
|
3048
|
+
* @see https://developer-pro.bitmart.com/en/spot/#margin-asset-transfer-signed
|
|
3049
|
+
* @see https://developer-pro.bitmart.com/en/futures/#transfer-signed
|
|
3017
3050
|
* @param {string} code unified currency code
|
|
3018
3051
|
* @param {float} amount amount to transfer
|
|
3019
3052
|
* @param {string} fromAccount account to transfer from
|
|
@@ -3031,17 +3064,35 @@ class bitmart extends bitmart$1 {
|
|
|
3031
3064
|
const fromId = this.convertTypeToAccount(fromAccount);
|
|
3032
3065
|
const toId = this.convertTypeToAccount(toAccount);
|
|
3033
3066
|
if (fromAccount === 'spot') {
|
|
3034
|
-
|
|
3035
|
-
|
|
3067
|
+
if (toAccount === 'margin') {
|
|
3068
|
+
request['side'] = 'in';
|
|
3069
|
+
request['symbol'] = toId;
|
|
3070
|
+
}
|
|
3071
|
+
else if (toAccount === 'swap') {
|
|
3072
|
+
request['type'] = 'spot_to_contract';
|
|
3073
|
+
}
|
|
3036
3074
|
}
|
|
3037
3075
|
else if (toAccount === 'spot') {
|
|
3038
|
-
|
|
3039
|
-
|
|
3076
|
+
if (fromAccount === 'margin') {
|
|
3077
|
+
request['side'] = 'out';
|
|
3078
|
+
request['symbol'] = fromId;
|
|
3079
|
+
}
|
|
3080
|
+
else if (fromAccount === 'swap') {
|
|
3081
|
+
request['type'] = 'contract_to_spot';
|
|
3082
|
+
}
|
|
3040
3083
|
}
|
|
3041
3084
|
else {
|
|
3042
3085
|
throw new errors.ArgumentsRequired(this.id + ' transfer() requires either fromAccount or toAccount to be spot');
|
|
3043
3086
|
}
|
|
3044
|
-
|
|
3087
|
+
let response = undefined;
|
|
3088
|
+
if ((fromAccount === 'margin') || (toAccount === 'margin')) {
|
|
3089
|
+
response = await this.privatePostSpotV1MarginIsolatedTransfer(this.extend(request, params));
|
|
3090
|
+
}
|
|
3091
|
+
else if ((fromAccount === 'swap') || (toAccount === 'swap')) {
|
|
3092
|
+
response = await this.privatePostAccountV1TransferContract(this.extend(request, params));
|
|
3093
|
+
}
|
|
3094
|
+
//
|
|
3095
|
+
// margin
|
|
3045
3096
|
//
|
|
3046
3097
|
// {
|
|
3047
3098
|
// "message": "OK",
|
|
@@ -3052,41 +3103,146 @@ class bitmart extends bitmart$1 {
|
|
|
3052
3103
|
// }
|
|
3053
3104
|
// }
|
|
3054
3105
|
//
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3106
|
+
// swap
|
|
3107
|
+
//
|
|
3108
|
+
// {
|
|
3109
|
+
// "message": "OK",
|
|
3110
|
+
// "code": 1000,
|
|
3111
|
+
// "trace": "4cad858074667097ac6ba5257c57305d.68.16953302431189455",
|
|
3112
|
+
// "data": {
|
|
3113
|
+
// "currency": "USDT",
|
|
3114
|
+
// "amount": "5"
|
|
3115
|
+
// }
|
|
3116
|
+
// }
|
|
3117
|
+
//
|
|
3118
|
+
const data = this.safeValue(response, 'data', {});
|
|
3119
|
+
return this.extend(this.parseTransfer(data, currency), {
|
|
3120
|
+
'status': this.parseTransferStatus(this.safeString2(response, 'code', 'message')),
|
|
3059
3121
|
});
|
|
3060
3122
|
}
|
|
3061
3123
|
parseTransferStatus(status) {
|
|
3062
3124
|
const statuses = {
|
|
3063
3125
|
'1000': 'ok',
|
|
3064
3126
|
'OK': 'ok',
|
|
3127
|
+
'FINISHED': 'ok',
|
|
3065
3128
|
};
|
|
3066
3129
|
return this.safeString(statuses, status, status);
|
|
3067
3130
|
}
|
|
3131
|
+
parseTransferToAccount(type) {
|
|
3132
|
+
const types = {
|
|
3133
|
+
'contract_to_spot': 'spot',
|
|
3134
|
+
'spot_to_contract': 'swap',
|
|
3135
|
+
};
|
|
3136
|
+
return this.safeString(types, type, type);
|
|
3137
|
+
}
|
|
3138
|
+
parseTransferFromAccount(type) {
|
|
3139
|
+
const types = {
|
|
3140
|
+
'contract_to_spot': 'swap',
|
|
3141
|
+
'spot_to_contract': 'spot',
|
|
3142
|
+
};
|
|
3143
|
+
return this.safeString(types, type, type);
|
|
3144
|
+
}
|
|
3068
3145
|
parseTransfer(transfer, currency = undefined) {
|
|
3146
|
+
//
|
|
3147
|
+
// margin
|
|
3148
|
+
//
|
|
3149
|
+
// {
|
|
3150
|
+
// "transfer_id": "ca90d97a621e47d49774f19af6b029f5"
|
|
3151
|
+
// }
|
|
3152
|
+
//
|
|
3153
|
+
// swap
|
|
3154
|
+
//
|
|
3155
|
+
// {
|
|
3156
|
+
// "currency": "USDT",
|
|
3157
|
+
// "amount": "5"
|
|
3158
|
+
// }
|
|
3159
|
+
//
|
|
3160
|
+
// fetchTransfers
|
|
3161
|
+
//
|
|
3162
|
+
// {
|
|
3163
|
+
// "transfer_id": "902463535961567232",
|
|
3164
|
+
// "currency": "USDT",
|
|
3165
|
+
// "amount": "5",
|
|
3166
|
+
// "type": "contract_to_spot",
|
|
3167
|
+
// "state": "FINISHED",
|
|
3168
|
+
// "timestamp": 1695330539565
|
|
3169
|
+
// }
|
|
3170
|
+
//
|
|
3171
|
+
const currencyId = this.safeString(transfer, 'currency');
|
|
3172
|
+
const timestamp = this.safeInteger(transfer, 'timestamp');
|
|
3173
|
+
return {
|
|
3174
|
+
'id': this.safeString(transfer, 'transfer_id'),
|
|
3175
|
+
'timestamp': timestamp,
|
|
3176
|
+
'datetime': this.iso8601(timestamp),
|
|
3177
|
+
'currency': this.safeCurrencyCode(currencyId, currency),
|
|
3178
|
+
'amount': this.safeNumber(transfer, 'amount'),
|
|
3179
|
+
'fromAccount': this.parseTransferFromAccount(this.safeString(transfer, 'type')),
|
|
3180
|
+
'toAccount': this.parseTransferToAccount(this.safeString(transfer, 'type')),
|
|
3181
|
+
'status': this.parseTransferStatus(this.safeString(transfer, 'state')),
|
|
3182
|
+
};
|
|
3183
|
+
}
|
|
3184
|
+
async fetchTransfers(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3185
|
+
/**
|
|
3186
|
+
* @method
|
|
3187
|
+
* @name bitmart#fetchTransfers
|
|
3188
|
+
* @description fetch a history of internal transfers made on an account, only transfers between spot and swap are supported
|
|
3189
|
+
* @see https://developer-pro.bitmart.com/en/futures/#get-transfer-list-signed
|
|
3190
|
+
* @param {string} code unified currency code of the currency transferred
|
|
3191
|
+
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
3192
|
+
* @param {int} [limit] the maximum number of transfer structures to retrieve
|
|
3193
|
+
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3194
|
+
* @param {int} [params.page] the required number of pages, default is 1, max is 1000
|
|
3195
|
+
* @param {int} [params.until] the latest time in ms to fetch transfers for
|
|
3196
|
+
* @returns {object[]} a list of [transfer structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
|
|
3197
|
+
*/
|
|
3198
|
+
await this.loadMarkets();
|
|
3199
|
+
if (limit === undefined) {
|
|
3200
|
+
limit = 10;
|
|
3201
|
+
}
|
|
3202
|
+
const request = {
|
|
3203
|
+
'page': this.safeInteger(params, 'page', 1),
|
|
3204
|
+
'limit': limit, // default is 10, max is 100
|
|
3205
|
+
};
|
|
3206
|
+
let currency = undefined;
|
|
3207
|
+
if (code !== undefined) {
|
|
3208
|
+
currency = this.currency(code);
|
|
3209
|
+
request['currency'] = currency['id'];
|
|
3210
|
+
}
|
|
3211
|
+
if (since !== undefined) {
|
|
3212
|
+
request['time_start'] = since;
|
|
3213
|
+
}
|
|
3214
|
+
if (limit !== undefined) {
|
|
3215
|
+
request['limit'] = limit;
|
|
3216
|
+
}
|
|
3217
|
+
const until = this.safeInteger2(params, 'until', 'till'); // unified in milliseconds
|
|
3218
|
+
const endTime = this.safeInteger(params, 'time_end', until); // exchange-specific in milliseconds
|
|
3219
|
+
params = this.omit(params, ['till', 'until']);
|
|
3220
|
+
if (endTime !== undefined) {
|
|
3221
|
+
request['time_end'] = endTime;
|
|
3222
|
+
}
|
|
3223
|
+
const response = await this.privatePostAccountV1TransferContractList(this.extend(request, params));
|
|
3069
3224
|
//
|
|
3070
3225
|
// {
|
|
3071
3226
|
// "message": "OK",
|
|
3072
3227
|
// "code": 1000,
|
|
3073
|
-
// "trace": "
|
|
3228
|
+
// "trace": "7f9d93e10f9g4513bc08a7btc2a5559a.69.16953325693032193",
|
|
3074
3229
|
// "data": {
|
|
3075
|
-
// "
|
|
3230
|
+
// "records": [
|
|
3231
|
+
// {
|
|
3232
|
+
// "transfer_id": "902463535961567232",
|
|
3233
|
+
// "currency": "USDT",
|
|
3234
|
+
// "amount": "5",
|
|
3235
|
+
// "type": "contract_to_spot",
|
|
3236
|
+
// "state": "FINISHED",
|
|
3237
|
+
// "timestamp": 1695330539565
|
|
3238
|
+
// },
|
|
3239
|
+
// ]
|
|
3076
3240
|
// }
|
|
3077
3241
|
// }
|
|
3078
3242
|
//
|
|
3079
|
-
const data = this.safeValue(
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
'timestamp': undefined,
|
|
3083
|
-
'datetime': undefined,
|
|
3084
|
-
'currency': this.safeCurrencyCode(undefined, currency),
|
|
3085
|
-
'amount': undefined,
|
|
3086
|
-
'fromAccount': undefined,
|
|
3087
|
-
'toAccount': undefined,
|
|
3088
|
-
'status': this.parseTransferStatus(this.safeString2(transfer, 'code', 'message')),
|
|
3089
|
-
};
|
|
3243
|
+
const data = this.safeValue(response, 'data', {});
|
|
3244
|
+
const records = this.safeValue(data, 'records', []);
|
|
3245
|
+
return this.parseTransfers(records, currency, since, limit);
|
|
3090
3246
|
}
|
|
3091
3247
|
async fetchBorrowInterest(code = undefined, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3092
3248
|
/**
|
package/dist/cjs/src/bitrue.js
CHANGED
|
@@ -1284,12 +1284,19 @@ class bitrue extends bitrue$1 {
|
|
|
1284
1284
|
* @method
|
|
1285
1285
|
* @name bitrue#createOrder
|
|
1286
1286
|
* @description create a trade order
|
|
1287
|
+
* @see https://github.com/Bitrue-exchange/Spot-official-api-docs#signed-endpoint-examples-for-post-apiv1order
|
|
1287
1288
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
1288
1289
|
* @param {string} type 'market' or 'limit'
|
|
1289
1290
|
* @param {string} side 'buy' or 'sell'
|
|
1290
1291
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
1291
1292
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
1292
1293
|
* @param {object} [params] extra parameters specific to the bitrue api endpoint
|
|
1294
|
+
* @param {float} [params.triggerPrice] the price at which a trigger order is triggered at
|
|
1295
|
+
* @param {string} [params.clientOrderId] a unique id for the order, automatically generated if not sent
|
|
1296
|
+
*
|
|
1297
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
1298
|
+
* @param {decimal} [params.icebergQty]
|
|
1299
|
+
* @param {long} [params.recvWindow]
|
|
1293
1300
|
* @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
1294
1301
|
*/
|
|
1295
1302
|
await this.loadMarkets();
|
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -724,12 +724,12 @@ class bybit extends bybit$1 {
|
|
|
724
724
|
'110021': errors.InvalidOrder,
|
|
725
725
|
'110022': errors.InvalidOrder,
|
|
726
726
|
'110023': errors.InvalidOrder,
|
|
727
|
-
'110024': errors.
|
|
728
|
-
'110025': errors.
|
|
729
|
-
'110026': errors.
|
|
730
|
-
'110027': errors.
|
|
731
|
-
'110028': errors.
|
|
732
|
-
'110029': errors.
|
|
727
|
+
'110024': errors.BadRequest,
|
|
728
|
+
'110025': errors.NoChange,
|
|
729
|
+
'110026': errors.MarginModeAlreadySet,
|
|
730
|
+
'110027': errors.NoChange,
|
|
731
|
+
'110028': errors.BadRequest,
|
|
732
|
+
'110029': errors.BadRequest,
|
|
733
733
|
'110030': errors.InvalidOrder,
|
|
734
734
|
'110031': errors.InvalidOrder,
|
|
735
735
|
'110032': errors.InvalidOrder,
|