ccxt 4.0.101 → 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 +5 -6
- package/dist/ccxt.browser.js +1130 -2730
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +2 -4
- package/dist/cjs/src/base/errors.js +2 -1
- package/dist/cjs/src/binance.js +8 -0
- package/dist/cjs/src/bingx.js +111 -4
- package/dist/cjs/src/bitget.js +3 -0
- package/dist/cjs/src/bitmart.js +271 -46
- package/dist/cjs/src/bitrue.js +7 -0
- package/dist/cjs/src/bl3p.js +8 -0
- package/dist/cjs/src/bybit.js +79 -55
- package/dist/cjs/src/gate.js +221 -218
- package/dist/cjs/src/gemini.js +1 -0
- package/dist/cjs/src/pro/binance.js +7 -7
- package/dist/cjs/src/pro/bybit.js +18 -17
- package/dist/cjs/src/pro/coinbasepro.js +10 -10
- package/dist/cjs/src/pro/kucoin.js +3 -3
- package/dist/cjs/src/wavesexchange.js +2 -1
- package/js/ccxt.d.ts +3 -6
- package/js/ccxt.js +3 -5
- package/js/src/abstract/binance.d.ts +8 -0
- package/js/src/abstract/binancecoinm.d.ts +8 -0
- package/js/src/abstract/binanceus.d.ts +8 -0
- package/js/src/abstract/binanceusdm.d.ts +8 -0
- package/js/src/abstract/bingx.d.ts +16 -1
- 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/binance.js +8 -0
- package/js/src/bingx.d.ts +8 -0
- package/js/src/bingx.js +111 -4
- package/js/src/bitget.js +3 -0
- package/js/src/bitmart.d.ts +46 -5
- package/js/src/bitmart.js +271 -46
- package/js/src/bitrue.js +7 -0
- package/js/src/bl3p.js +8 -0
- package/js/src/bybit.js +80 -56
- package/js/src/gate.js +221 -218
- package/js/src/gemini.js +1 -0
- package/js/src/pro/binance.js +7 -7
- package/js/src/pro/bybit.js +18 -17
- package/js/src/pro/coinbasepro.js +10 -10
- package/js/src/pro/kucoin.js +3 -3
- package/js/src/wavesexchange.js +2 -1
- package/package.json +1 -1
- package/skip-tests.json +5 -7
- package/js/src/abstract/bkex.d.ts +0 -61
- package/js/src/abstract/bkex.js +0 -11
package/js/src/bitmart.js
CHANGED
|
@@ -60,6 +60,9 @@ export default class bitmart extends Exchange {
|
|
|
60
60
|
'fetchDepositWithdrawFee': true,
|
|
61
61
|
'fetchDepositWithdrawFees': false,
|
|
62
62
|
'fetchFundingHistory': undefined,
|
|
63
|
+
'fetchFundingRate': true,
|
|
64
|
+
'fetchFundingRateHistory': false,
|
|
65
|
+
'fetchFundingRates': false,
|
|
63
66
|
'fetchMarginMode': false,
|
|
64
67
|
'fetchMarkets': true,
|
|
65
68
|
'fetchMyTrades': true,
|
|
@@ -82,7 +85,7 @@ export default class bitmart extends Exchange {
|
|
|
82
85
|
'fetchTransactionFee': true,
|
|
83
86
|
'fetchTransactionFees': false,
|
|
84
87
|
'fetchTransfer': false,
|
|
85
|
-
'fetchTransfers':
|
|
88
|
+
'fetchTransfers': true,
|
|
86
89
|
'fetchWithdrawAddressesByNetwork': false,
|
|
87
90
|
'fetchWithdrawal': true,
|
|
88
91
|
'fetchWithdrawals': true,
|
|
@@ -566,6 +569,7 @@ export default class bitmart extends Exchange {
|
|
|
566
569
|
},
|
|
567
570
|
'accountsByType': {
|
|
568
571
|
'spot': 'spot',
|
|
572
|
+
'swap': 'swap',
|
|
569
573
|
},
|
|
570
574
|
'createMarketBuyOrderRequiresPrice': true,
|
|
571
575
|
},
|
|
@@ -1225,6 +1229,8 @@ export default class bitmart extends Exchange {
|
|
|
1225
1229
|
* @method
|
|
1226
1230
|
* @name bitmart#fetchOrderBook
|
|
1227
1231
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
1232
|
+
* @see https://developer-pro.bitmart.com/en/spot/#get-depth-v3
|
|
1233
|
+
* @see https://developer-pro.bitmart.com/en/futures/#get-market-depth
|
|
1228
1234
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
1229
1235
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
1230
1236
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
@@ -1232,41 +1238,70 @@ export default class bitmart extends Exchange {
|
|
|
1232
1238
|
*/
|
|
1233
1239
|
await this.loadMarkets();
|
|
1234
1240
|
const market = this.market(symbol);
|
|
1235
|
-
if (!market['spot']) {
|
|
1236
|
-
throw new NotSupported(this.id + ' fetchOrderBook() does not support ' + market['type'] + ' markets, only spot markets are accepted');
|
|
1237
|
-
}
|
|
1238
1241
|
const request = {
|
|
1239
1242
|
'symbol': market['id'],
|
|
1240
1243
|
};
|
|
1241
|
-
|
|
1242
|
-
|
|
1244
|
+
let response = undefined;
|
|
1245
|
+
if (market['spot']) {
|
|
1246
|
+
if (limit !== undefined) {
|
|
1247
|
+
request['limit'] = limit; // default 35, max 50
|
|
1248
|
+
}
|
|
1249
|
+
response = await this.publicGetSpotQuotationV3Books(this.extend(request, params));
|
|
1250
|
+
}
|
|
1251
|
+
else if (market['swap']) {
|
|
1252
|
+
response = await this.publicGetContractPublicDepth(this.extend(request, params));
|
|
1253
|
+
}
|
|
1254
|
+
else {
|
|
1255
|
+
throw new NotSupported(this.id + ' fetchOrderBook() does not support ' + market['type'] + ' markets, only spot and swap markets are accepted');
|
|
1243
1256
|
}
|
|
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
1257
|
//
|
|
1247
1258
|
// spot
|
|
1248
1259
|
//
|
|
1249
1260
|
// {
|
|
1250
|
-
// "
|
|
1251
|
-
// "
|
|
1252
|
-
// "
|
|
1253
|
-
//
|
|
1254
|
-
// "
|
|
1255
|
-
//
|
|
1256
|
-
//
|
|
1257
|
-
//
|
|
1261
|
+
// "code": 1000,
|
|
1262
|
+
// "message": "success",
|
|
1263
|
+
// "data": {
|
|
1264
|
+
// "ts": "1695264191808",
|
|
1265
|
+
// "symbol": "BTC_USDT",
|
|
1266
|
+
// "asks": [
|
|
1267
|
+
// ["26942.57","0.06492"],
|
|
1268
|
+
// ["26942.73","0.05447"],
|
|
1269
|
+
// ["26943.00","0.07154"]
|
|
1258
1270
|
// ],
|
|
1259
|
-
// "
|
|
1260
|
-
//
|
|
1261
|
-
//
|
|
1262
|
-
//
|
|
1271
|
+
// "bids": [
|
|
1272
|
+
// ["26942.45","0.00074"],
|
|
1273
|
+
// ["26941.53","0.00371"],
|
|
1274
|
+
// ["26940.94","0.08992"]
|
|
1263
1275
|
// ]
|
|
1264
|
-
// }
|
|
1276
|
+
// },
|
|
1277
|
+
// "trace": "430a7f69581d4258a8e4b424dfb10782.73.16952341919017619"
|
|
1278
|
+
// }
|
|
1279
|
+
//
|
|
1280
|
+
// swap
|
|
1281
|
+
//
|
|
1282
|
+
// {
|
|
1283
|
+
// "code": 1000,
|
|
1284
|
+
// "message": "Ok",
|
|
1285
|
+
// "data": {
|
|
1286
|
+
// "asks": [
|
|
1287
|
+
// ["26938.3","3499","3499"],
|
|
1288
|
+
// ["26938.5","14702","18201"],
|
|
1289
|
+
// ["26938.6","20457","38658"]
|
|
1290
|
+
// ],
|
|
1291
|
+
// "bids": [
|
|
1292
|
+
// ["26938.2","20","20"],
|
|
1293
|
+
// ["26937.9","1913","1933"],
|
|
1294
|
+
// ["26937.8","2588","4521"]
|
|
1295
|
+
// ],
|
|
1296
|
+
// "timestamp": 1695264383999,
|
|
1297
|
+
// "symbol": "BTCUSDT"
|
|
1298
|
+
// },
|
|
1299
|
+
// "trace": "4cad855074664097ac6ba5258c47305d.72.16952643834721135"
|
|
1265
1300
|
// }
|
|
1266
1301
|
//
|
|
1267
1302
|
const data = this.safeValue(response, 'data', {});
|
|
1268
|
-
const timestamp = this.
|
|
1269
|
-
return this.parseOrderBook(data, symbol, timestamp
|
|
1303
|
+
const timestamp = this.safeInteger2(data, 'ts', 'timestamp');
|
|
1304
|
+
return this.parseOrderBook(data, market['symbol'], timestamp);
|
|
1270
1305
|
}
|
|
1271
1306
|
parseTrade(trade, market = undefined) {
|
|
1272
1307
|
//
|
|
@@ -3013,7 +3048,8 @@ export default class bitmart extends Exchange {
|
|
|
3013
3048
|
* @method
|
|
3014
3049
|
* @name bitmart#transfer
|
|
3015
3050
|
* @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
|
|
3051
|
+
* @see https://developer-pro.bitmart.com/en/spot/#margin-asset-transfer-signed
|
|
3052
|
+
* @see https://developer-pro.bitmart.com/en/futures/#transfer-signed
|
|
3017
3053
|
* @param {string} code unified currency code
|
|
3018
3054
|
* @param {float} amount amount to transfer
|
|
3019
3055
|
* @param {string} fromAccount account to transfer from
|
|
@@ -3031,17 +3067,35 @@ export default class bitmart extends Exchange {
|
|
|
3031
3067
|
const fromId = this.convertTypeToAccount(fromAccount);
|
|
3032
3068
|
const toId = this.convertTypeToAccount(toAccount);
|
|
3033
3069
|
if (fromAccount === 'spot') {
|
|
3034
|
-
|
|
3035
|
-
|
|
3070
|
+
if (toAccount === 'margin') {
|
|
3071
|
+
request['side'] = 'in';
|
|
3072
|
+
request['symbol'] = toId;
|
|
3073
|
+
}
|
|
3074
|
+
else if (toAccount === 'swap') {
|
|
3075
|
+
request['type'] = 'spot_to_contract';
|
|
3076
|
+
}
|
|
3036
3077
|
}
|
|
3037
3078
|
else if (toAccount === 'spot') {
|
|
3038
|
-
|
|
3039
|
-
|
|
3079
|
+
if (fromAccount === 'margin') {
|
|
3080
|
+
request['side'] = 'out';
|
|
3081
|
+
request['symbol'] = fromId;
|
|
3082
|
+
}
|
|
3083
|
+
else if (fromAccount === 'swap') {
|
|
3084
|
+
request['type'] = 'contract_to_spot';
|
|
3085
|
+
}
|
|
3040
3086
|
}
|
|
3041
3087
|
else {
|
|
3042
3088
|
throw new ArgumentsRequired(this.id + ' transfer() requires either fromAccount or toAccount to be spot');
|
|
3043
3089
|
}
|
|
3044
|
-
|
|
3090
|
+
let response = undefined;
|
|
3091
|
+
if ((fromAccount === 'margin') || (toAccount === 'margin')) {
|
|
3092
|
+
response = await this.privatePostSpotV1MarginIsolatedTransfer(this.extend(request, params));
|
|
3093
|
+
}
|
|
3094
|
+
else if ((fromAccount === 'swap') || (toAccount === 'swap')) {
|
|
3095
|
+
response = await this.privatePostAccountV1TransferContract(this.extend(request, params));
|
|
3096
|
+
}
|
|
3097
|
+
//
|
|
3098
|
+
// margin
|
|
3045
3099
|
//
|
|
3046
3100
|
// {
|
|
3047
3101
|
// "message": "OK",
|
|
@@ -3052,41 +3106,146 @@ export default class bitmart extends Exchange {
|
|
|
3052
3106
|
// }
|
|
3053
3107
|
// }
|
|
3054
3108
|
//
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3109
|
+
// swap
|
|
3110
|
+
//
|
|
3111
|
+
// {
|
|
3112
|
+
// "message": "OK",
|
|
3113
|
+
// "code": 1000,
|
|
3114
|
+
// "trace": "4cad858074667097ac6ba5257c57305d.68.16953302431189455",
|
|
3115
|
+
// "data": {
|
|
3116
|
+
// "currency": "USDT",
|
|
3117
|
+
// "amount": "5"
|
|
3118
|
+
// }
|
|
3119
|
+
// }
|
|
3120
|
+
//
|
|
3121
|
+
const data = this.safeValue(response, 'data', {});
|
|
3122
|
+
return this.extend(this.parseTransfer(data, currency), {
|
|
3123
|
+
'status': this.parseTransferStatus(this.safeString2(response, 'code', 'message')),
|
|
3059
3124
|
});
|
|
3060
3125
|
}
|
|
3061
3126
|
parseTransferStatus(status) {
|
|
3062
3127
|
const statuses = {
|
|
3063
3128
|
'1000': 'ok',
|
|
3064
3129
|
'OK': 'ok',
|
|
3130
|
+
'FINISHED': 'ok',
|
|
3065
3131
|
};
|
|
3066
3132
|
return this.safeString(statuses, status, status);
|
|
3067
3133
|
}
|
|
3134
|
+
parseTransferToAccount(type) {
|
|
3135
|
+
const types = {
|
|
3136
|
+
'contract_to_spot': 'spot',
|
|
3137
|
+
'spot_to_contract': 'swap',
|
|
3138
|
+
};
|
|
3139
|
+
return this.safeString(types, type, type);
|
|
3140
|
+
}
|
|
3141
|
+
parseTransferFromAccount(type) {
|
|
3142
|
+
const types = {
|
|
3143
|
+
'contract_to_spot': 'swap',
|
|
3144
|
+
'spot_to_contract': 'spot',
|
|
3145
|
+
};
|
|
3146
|
+
return this.safeString(types, type, type);
|
|
3147
|
+
}
|
|
3068
3148
|
parseTransfer(transfer, currency = undefined) {
|
|
3149
|
+
//
|
|
3150
|
+
// margin
|
|
3151
|
+
//
|
|
3152
|
+
// {
|
|
3153
|
+
// "transfer_id": "ca90d97a621e47d49774f19af6b029f5"
|
|
3154
|
+
// }
|
|
3155
|
+
//
|
|
3156
|
+
// swap
|
|
3157
|
+
//
|
|
3158
|
+
// {
|
|
3159
|
+
// "currency": "USDT",
|
|
3160
|
+
// "amount": "5"
|
|
3161
|
+
// }
|
|
3162
|
+
//
|
|
3163
|
+
// fetchTransfers
|
|
3164
|
+
//
|
|
3165
|
+
// {
|
|
3166
|
+
// "transfer_id": "902463535961567232",
|
|
3167
|
+
// "currency": "USDT",
|
|
3168
|
+
// "amount": "5",
|
|
3169
|
+
// "type": "contract_to_spot",
|
|
3170
|
+
// "state": "FINISHED",
|
|
3171
|
+
// "timestamp": 1695330539565
|
|
3172
|
+
// }
|
|
3173
|
+
//
|
|
3174
|
+
const currencyId = this.safeString(transfer, 'currency');
|
|
3175
|
+
const timestamp = this.safeInteger(transfer, 'timestamp');
|
|
3176
|
+
return {
|
|
3177
|
+
'id': this.safeString(transfer, 'transfer_id'),
|
|
3178
|
+
'timestamp': timestamp,
|
|
3179
|
+
'datetime': this.iso8601(timestamp),
|
|
3180
|
+
'currency': this.safeCurrencyCode(currencyId, currency),
|
|
3181
|
+
'amount': this.safeNumber(transfer, 'amount'),
|
|
3182
|
+
'fromAccount': this.parseTransferFromAccount(this.safeString(transfer, 'type')),
|
|
3183
|
+
'toAccount': this.parseTransferToAccount(this.safeString(transfer, 'type')),
|
|
3184
|
+
'status': this.parseTransferStatus(this.safeString(transfer, 'state')),
|
|
3185
|
+
};
|
|
3186
|
+
}
|
|
3187
|
+
async fetchTransfers(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3188
|
+
/**
|
|
3189
|
+
* @method
|
|
3190
|
+
* @name bitmart#fetchTransfers
|
|
3191
|
+
* @description fetch a history of internal transfers made on an account, only transfers between spot and swap are supported
|
|
3192
|
+
* @see https://developer-pro.bitmart.com/en/futures/#get-transfer-list-signed
|
|
3193
|
+
* @param {string} code unified currency code of the currency transferred
|
|
3194
|
+
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
3195
|
+
* @param {int} [limit] the maximum number of transfer structures to retrieve
|
|
3196
|
+
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3197
|
+
* @param {int} [params.page] the required number of pages, default is 1, max is 1000
|
|
3198
|
+
* @param {int} [params.until] the latest time in ms to fetch transfers for
|
|
3199
|
+
* @returns {object[]} a list of [transfer structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
|
|
3200
|
+
*/
|
|
3201
|
+
await this.loadMarkets();
|
|
3202
|
+
if (limit === undefined) {
|
|
3203
|
+
limit = 10;
|
|
3204
|
+
}
|
|
3205
|
+
const request = {
|
|
3206
|
+
'page': this.safeInteger(params, 'page', 1),
|
|
3207
|
+
'limit': limit, // default is 10, max is 100
|
|
3208
|
+
};
|
|
3209
|
+
let currency = undefined;
|
|
3210
|
+
if (code !== undefined) {
|
|
3211
|
+
currency = this.currency(code);
|
|
3212
|
+
request['currency'] = currency['id'];
|
|
3213
|
+
}
|
|
3214
|
+
if (since !== undefined) {
|
|
3215
|
+
request['time_start'] = since;
|
|
3216
|
+
}
|
|
3217
|
+
if (limit !== undefined) {
|
|
3218
|
+
request['limit'] = limit;
|
|
3219
|
+
}
|
|
3220
|
+
const until = this.safeInteger2(params, 'until', 'till'); // unified in milliseconds
|
|
3221
|
+
const endTime = this.safeInteger(params, 'time_end', until); // exchange-specific in milliseconds
|
|
3222
|
+
params = this.omit(params, ['till', 'until']);
|
|
3223
|
+
if (endTime !== undefined) {
|
|
3224
|
+
request['time_end'] = endTime;
|
|
3225
|
+
}
|
|
3226
|
+
const response = await this.privatePostAccountV1TransferContractList(this.extend(request, params));
|
|
3069
3227
|
//
|
|
3070
3228
|
// {
|
|
3071
3229
|
// "message": "OK",
|
|
3072
3230
|
// "code": 1000,
|
|
3073
|
-
// "trace": "
|
|
3231
|
+
// "trace": "7f9d93e10f9g4513bc08a7btc2a5559a.69.16953325693032193",
|
|
3074
3232
|
// "data": {
|
|
3075
|
-
// "
|
|
3233
|
+
// "records": [
|
|
3234
|
+
// {
|
|
3235
|
+
// "transfer_id": "902463535961567232",
|
|
3236
|
+
// "currency": "USDT",
|
|
3237
|
+
// "amount": "5",
|
|
3238
|
+
// "type": "contract_to_spot",
|
|
3239
|
+
// "state": "FINISHED",
|
|
3240
|
+
// "timestamp": 1695330539565
|
|
3241
|
+
// },
|
|
3242
|
+
// ]
|
|
3076
3243
|
// }
|
|
3077
3244
|
// }
|
|
3078
3245
|
//
|
|
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
|
-
};
|
|
3246
|
+
const data = this.safeValue(response, 'data', {});
|
|
3247
|
+
const records = this.safeValue(data, 'records', []);
|
|
3248
|
+
return this.parseTransfers(records, currency, since, limit);
|
|
3090
3249
|
}
|
|
3091
3250
|
async fetchBorrowInterest(code = undefined, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3092
3251
|
/**
|
|
@@ -3253,6 +3412,72 @@ export default class bitmart extends Exchange {
|
|
|
3253
3412
|
};
|
|
3254
3413
|
return await this.privatePostContractPrivateSubmitLeverage(this.extend(request, params));
|
|
3255
3414
|
}
|
|
3415
|
+
async fetchFundingRate(symbol, params = {}) {
|
|
3416
|
+
/**
|
|
3417
|
+
* @method
|
|
3418
|
+
* @name bitmart#fetchFundingRate
|
|
3419
|
+
* @description fetch the current funding rate
|
|
3420
|
+
* @see https://developer-pro.bitmart.com/en/futures/#get-current-funding-rate
|
|
3421
|
+
* @param {string} symbol unified market symbol
|
|
3422
|
+
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3423
|
+
* @returns {object} a [funding rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure}
|
|
3424
|
+
*/
|
|
3425
|
+
await this.loadMarkets();
|
|
3426
|
+
const market = this.market(symbol);
|
|
3427
|
+
if (!market['swap']) {
|
|
3428
|
+
throw new BadSymbol(this.id + ' fetchFundingRate() supports swap contracts only');
|
|
3429
|
+
}
|
|
3430
|
+
const request = {
|
|
3431
|
+
'symbol': market['id'],
|
|
3432
|
+
};
|
|
3433
|
+
const response = await this.publicGetContractPublicFundingRate(this.extend(request, params));
|
|
3434
|
+
//
|
|
3435
|
+
// {
|
|
3436
|
+
// "code": 1000,
|
|
3437
|
+
// "message": "Ok",
|
|
3438
|
+
// "data": {
|
|
3439
|
+
// "timestamp": 1695184410697,
|
|
3440
|
+
// "symbol": "BTCUSDT",
|
|
3441
|
+
// "rate_value": "-0.00002614",
|
|
3442
|
+
// "expected_rate": "-0.00002"
|
|
3443
|
+
// },
|
|
3444
|
+
// "trace": "4cad855074654097ac7ba5257c47305d.54.16951844206655589"
|
|
3445
|
+
// }
|
|
3446
|
+
//
|
|
3447
|
+
const data = this.safeValue(response, 'data', {});
|
|
3448
|
+
return this.parseFundingRate(data, market);
|
|
3449
|
+
}
|
|
3450
|
+
parseFundingRate(contract, market = undefined) {
|
|
3451
|
+
//
|
|
3452
|
+
// {
|
|
3453
|
+
// "timestamp": 1695184410697,
|
|
3454
|
+
// "symbol": "BTCUSDT",
|
|
3455
|
+
// "rate_value": "-0.00002614",
|
|
3456
|
+
// "expected_rate": "-0.00002"
|
|
3457
|
+
// }
|
|
3458
|
+
//
|
|
3459
|
+
const marketId = this.safeString(contract, 'symbol');
|
|
3460
|
+
const timestamp = this.safeInteger(contract, 'timestamp');
|
|
3461
|
+
return {
|
|
3462
|
+
'info': contract,
|
|
3463
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
3464
|
+
'markPrice': undefined,
|
|
3465
|
+
'indexPrice': undefined,
|
|
3466
|
+
'interestRate': undefined,
|
|
3467
|
+
'estimatedSettlePrice': undefined,
|
|
3468
|
+
'timestamp': timestamp,
|
|
3469
|
+
'datetime': this.iso8601(timestamp),
|
|
3470
|
+
'fundingRate': this.safeNumber(contract, 'expected_rate'),
|
|
3471
|
+
'fundingTimestamp': undefined,
|
|
3472
|
+
'fundingDatetime': undefined,
|
|
3473
|
+
'nextFundingRate': undefined,
|
|
3474
|
+
'nextFundingTimestamp': undefined,
|
|
3475
|
+
'nextFundingDatetime': undefined,
|
|
3476
|
+
'previousFundingRate': this.safeNumber(contract, 'rate_value'),
|
|
3477
|
+
'previousFundingTimestamp': undefined,
|
|
3478
|
+
'previousFundingDatetime': undefined,
|
|
3479
|
+
};
|
|
3480
|
+
}
|
|
3256
3481
|
nonce() {
|
|
3257
3482
|
return this.milliseconds();
|
|
3258
3483
|
}
|
package/js/src/bitrue.js
CHANGED
|
@@ -1287,12 +1287,19 @@ export default class bitrue extends Exchange {
|
|
|
1287
1287
|
* @method
|
|
1288
1288
|
* @name bitrue#createOrder
|
|
1289
1289
|
* @description create a trade order
|
|
1290
|
+
* @see https://github.com/Bitrue-exchange/Spot-official-api-docs#signed-endpoint-examples-for-post-apiv1order
|
|
1290
1291
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
1291
1292
|
* @param {string} type 'market' or 'limit'
|
|
1292
1293
|
* @param {string} side 'buy' or 'sell'
|
|
1293
1294
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
1294
1295
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
1295
1296
|
* @param {object} [params] extra parameters specific to the bitrue api endpoint
|
|
1297
|
+
* @param {float} [params.triggerPrice] the price at which a trigger order is triggered at
|
|
1298
|
+
* @param {string} [params.clientOrderId] a unique id for the order, automatically generated if not sent
|
|
1299
|
+
*
|
|
1300
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
1301
|
+
* @param {decimal} [params.icebergQty]
|
|
1302
|
+
* @param {long} [params.recvWindow]
|
|
1296
1303
|
* @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
1297
1304
|
*/
|
|
1298
1305
|
await this.loadMarkets();
|
package/js/src/bl3p.js
CHANGED
|
@@ -35,6 +35,9 @@ export default class bl3p extends Exchange {
|
|
|
35
35
|
'cancelOrder': true,
|
|
36
36
|
'createOrder': true,
|
|
37
37
|
'createReduceOnlyOrder': false,
|
|
38
|
+
'createStopLimitOrder': false,
|
|
39
|
+
'createStopMarketOrder': false,
|
|
40
|
+
'createStopOrder': false,
|
|
38
41
|
'fetchBalance': true,
|
|
39
42
|
'fetchBorrowRate': false,
|
|
40
43
|
'fetchBorrowRateHistories': false,
|
|
@@ -367,12 +370,17 @@ export default class bl3p extends Exchange {
|
|
|
367
370
|
* @method
|
|
368
371
|
* @name bl3p#createOrder
|
|
369
372
|
* @description create a trade order
|
|
373
|
+
* @see https://github.com/BitonicNL/bl3p-api/blob/master/examples/nodejs/example.md#21---create-an-order
|
|
370
374
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
371
375
|
* @param {string} type 'market' or 'limit'
|
|
372
376
|
* @param {string} side 'buy' or 'sell'
|
|
373
377
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
374
378
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
375
379
|
* @param {object} [params] extra parameters specific to the bl3p api endpoint
|
|
380
|
+
*
|
|
381
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
382
|
+
* @param {int} [params.amount_funds] maximal EUR amount to spend (*1e5)
|
|
383
|
+
* @param {string} [params.fee_currency] 'EUR' or 'BTC'
|
|
376
384
|
* @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
377
385
|
*/
|
|
378
386
|
const market = this.market(symbol);
|