ccxt 4.2.23 → 4.2.24
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 +355 -11
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/binanceus.js +108 -6
- package/dist/cjs/src/bingx.js +1 -1
- package/dist/cjs/src/bitfinex2.js +98 -1
- package/dist/cjs/src/phemex.js +1 -1
- package/dist/cjs/src/pro/bitopro.js +146 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/binanceus.d.ts +52 -1
- package/js/src/binanceus.js +108 -6
- package/js/src/bingx.js +2 -2
- package/js/src/bitfinex2.d.ts +4 -3
- package/js/src/bitfinex2.js +98 -1
- package/js/src/phemex.js +1 -1
- package/js/src/pro/bitopro.d.ts +4 -1
- package/js/src/pro/bitopro.js +147 -2
- package/package.json +1 -1
- package/skip-tests.json +1 -0
package/dist/cjs/ccxt.js
CHANGED
|
@@ -174,7 +174,7 @@ var woo$1 = require('./src/pro/woo.js');
|
|
|
174
174
|
|
|
175
175
|
//-----------------------------------------------------------------------------
|
|
176
176
|
// this is updated by vss.js when building
|
|
177
|
-
const version = '4.2.
|
|
177
|
+
const version = '4.2.24';
|
|
178
178
|
Exchange["default"].ccxtVersion = version;
|
|
179
179
|
const exchanges = {
|
|
180
180
|
'ace': ace,
|
|
@@ -10,6 +10,7 @@ class binanceus extends binance {
|
|
|
10
10
|
'id': 'binanceus',
|
|
11
11
|
'name': 'Binance US',
|
|
12
12
|
'countries': ['US'],
|
|
13
|
+
'hostname': 'binance.us',
|
|
13
14
|
'rateLimit': 50,
|
|
14
15
|
'certified': false,
|
|
15
16
|
'pro': true,
|
|
@@ -17,10 +18,11 @@ class binanceus extends binance {
|
|
|
17
18
|
'logo': 'https://user-images.githubusercontent.com/1294454/65177307-217b7c80-da5f-11e9-876e-0b748ba0a358.jpg',
|
|
18
19
|
'api': {
|
|
19
20
|
'web': 'https://www.binance.us',
|
|
20
|
-
'sapi': 'https://api.binance.us/sapi/v1',
|
|
21
|
-
'wapi': 'https://api.binance.us/wapi/v3',
|
|
22
21
|
'public': 'https://api.binance.us/api/v3',
|
|
23
22
|
'private': 'https://api.binance.us/api/v3',
|
|
23
|
+
'sapi': 'https://api.binance.us/sapi/v1',
|
|
24
|
+
'sapiV2': 'https://api.binance.us/sapi/v2',
|
|
25
|
+
'sapiV3': 'https://api.binance.us/sapi/v3',
|
|
24
26
|
},
|
|
25
27
|
'www': 'https://www.binance.us',
|
|
26
28
|
'referral': 'https://www.binance.us/?ref=35005074',
|
|
@@ -81,13 +83,13 @@ class binanceus extends binance {
|
|
|
81
83
|
'api': {
|
|
82
84
|
'public': {
|
|
83
85
|
'get': {
|
|
84
|
-
'exchangeInfo': 10,
|
|
85
86
|
'ping': 1,
|
|
86
87
|
'time': 1,
|
|
87
|
-
'
|
|
88
|
+
'exchangeInfo': 10,
|
|
88
89
|
'trades': 1,
|
|
89
|
-
'aggTrades': 1,
|
|
90
90
|
'historicalTrades': 5,
|
|
91
|
+
'aggTrades': 1,
|
|
92
|
+
'depth': { 'cost': 1, 'byLimit': [[100, 1], [500, 5], [1000, 10], [5000, 50]] },
|
|
91
93
|
'klines': 1,
|
|
92
94
|
'ticker/price': { 'cost': 1, 'noSymbol': 2 },
|
|
93
95
|
'avgPrice': 1,
|
|
@@ -98,7 +100,107 @@ class binanceus extends binance {
|
|
|
98
100
|
},
|
|
99
101
|
'private': {
|
|
100
102
|
'get': {
|
|
101
|
-
'
|
|
103
|
+
'account': 10,
|
|
104
|
+
'rateLimit/order': 20,
|
|
105
|
+
'order': 2,
|
|
106
|
+
'openOrders': { 'cost': 3, 'noSymbol': 40 },
|
|
107
|
+
'myTrades': 10,
|
|
108
|
+
'myPreventedMatches': 10,
|
|
109
|
+
'allOrders': 10,
|
|
110
|
+
'orderList': 2,
|
|
111
|
+
'allOrderList': 10,
|
|
112
|
+
'openOrderList': 3,
|
|
113
|
+
},
|
|
114
|
+
'post': {
|
|
115
|
+
'order': 1,
|
|
116
|
+
'order/test': 1,
|
|
117
|
+
'order/cancelReplace': 1,
|
|
118
|
+
'order/oco': 1,
|
|
119
|
+
},
|
|
120
|
+
'delete': {
|
|
121
|
+
'order': 1,
|
|
122
|
+
'openOrders': 1,
|
|
123
|
+
'orderList': 1,
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
'sapi': {
|
|
127
|
+
'get': {
|
|
128
|
+
'system/status': 1,
|
|
129
|
+
'asset/assetDistributionHistory': 1,
|
|
130
|
+
'asset/query/trading-fee': 1,
|
|
131
|
+
'asset/query/trading-volume': 1,
|
|
132
|
+
'sub-account/spotSummary': 1,
|
|
133
|
+
'sub-account/status': 1,
|
|
134
|
+
'otc/coinPairs': 1,
|
|
135
|
+
'otc/orders/{orderId}': 1,
|
|
136
|
+
'otc/orders': 1,
|
|
137
|
+
'ocbs/orders': 1,
|
|
138
|
+
'capital/config/getall': 1,
|
|
139
|
+
'capital/withdraw/history': 1,
|
|
140
|
+
'fiatpayment/query/withdraw/history': 1,
|
|
141
|
+
'capital/deposit/address': 1,
|
|
142
|
+
'capital/deposit/hisrec': 1,
|
|
143
|
+
'fiatpayment/query/deposit/history': 1,
|
|
144
|
+
'capital/sub-account/deposit/address': 1,
|
|
145
|
+
'capital/sub-account/deposit/history': 1,
|
|
146
|
+
'asset/query/dust-logs': 1,
|
|
147
|
+
'asset/query/dust-assets': 1,
|
|
148
|
+
'marketing/referral/reward/history': 1,
|
|
149
|
+
'staking/asset': 1,
|
|
150
|
+
'staking/stakingBalance': 1,
|
|
151
|
+
'staking/history': 1,
|
|
152
|
+
'staking/stakingRewardsHistory': 1,
|
|
153
|
+
'custodian/balance': 1,
|
|
154
|
+
'custodian/supportedAssetList': 1,
|
|
155
|
+
'custodian/walletTransferHistory': 1,
|
|
156
|
+
'custodian/custodianTransferHistory': 1,
|
|
157
|
+
'custodian/openOrders': 1,
|
|
158
|
+
'custodian/order': 1,
|
|
159
|
+
'custodian/orderHistory': 1,
|
|
160
|
+
'custodian/tradeHistory': 1,
|
|
161
|
+
'custodian/settlementSetting': 1,
|
|
162
|
+
'custodian/settlementHistory': 1,
|
|
163
|
+
'cl/transferHistory': 1,
|
|
164
|
+
'apipartner/checkEligibility': 1,
|
|
165
|
+
'apipartner/rebateHistory': 1,
|
|
166
|
+
},
|
|
167
|
+
'post': {
|
|
168
|
+
'otc/quotes': 1,
|
|
169
|
+
'otc/orders': 1,
|
|
170
|
+
'fiatpayment/withdraw/apply': 1,
|
|
171
|
+
'capital/withdraw/apply': 1,
|
|
172
|
+
'asset/dust': 10,
|
|
173
|
+
'staking/stake': 1,
|
|
174
|
+
'staking/unstake': 1,
|
|
175
|
+
'custodian/walletTransfer': 1,
|
|
176
|
+
'custodian/custodianTransfer': 1,
|
|
177
|
+
'custodian/undoTransfer': 1,
|
|
178
|
+
'custodian/order': 1,
|
|
179
|
+
'custodian/ocoOrder': 1,
|
|
180
|
+
'cl/transfer': 1,
|
|
181
|
+
},
|
|
182
|
+
'delete': {
|
|
183
|
+
'custodian/cancelOrder': 1,
|
|
184
|
+
'custodian/cancelOrdersBySymbol': 1,
|
|
185
|
+
'custodian/cancelOcoOrder': 1,
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
'sapiV2': {
|
|
189
|
+
'get': {
|
|
190
|
+
'cl/account': 10,
|
|
191
|
+
'cl/alertHistory': 1,
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
'sapiV3': {
|
|
195
|
+
'get': {
|
|
196
|
+
'accountStatus': 1,
|
|
197
|
+
'apiTradingStatus': 1,
|
|
198
|
+
'sub-account/list': 1,
|
|
199
|
+
'sub-account/transfer/history': 1,
|
|
200
|
+
'sub-account/assets': 1,
|
|
201
|
+
},
|
|
202
|
+
'post': {
|
|
203
|
+
'sub-account/transfer': 1,
|
|
102
204
|
},
|
|
103
205
|
},
|
|
104
206
|
},
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -360,7 +360,7 @@ class bingx extends bingx$1 {
|
|
|
360
360
|
'100500': errors.ExchangeError,
|
|
361
361
|
'100503': errors.ExchangeError,
|
|
362
362
|
'80001': errors.BadRequest,
|
|
363
|
-
'80012': errors.
|
|
363
|
+
'80012': errors.InsufficientFunds,
|
|
364
364
|
'80014': errors.BadRequest,
|
|
365
365
|
'80016': errors.OrderNotFound,
|
|
366
366
|
'80017': errors.OrderNotFound,
|
|
@@ -55,6 +55,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
55
55
|
'fetchMyTrades': true,
|
|
56
56
|
'fetchOHLCV': true,
|
|
57
57
|
'fetchOpenInterest': true,
|
|
58
|
+
'fetchOpenInterestHistory': true,
|
|
58
59
|
'fetchOpenOrder': true,
|
|
59
60
|
'fetchOpenOrders': true,
|
|
60
61
|
'fetchOrder': true,
|
|
@@ -3034,7 +3035,73 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
3034
3035
|
//
|
|
3035
3036
|
return this.parseOpenInterest(response[0], market);
|
|
3036
3037
|
}
|
|
3038
|
+
async fetchOpenInterestHistory(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
3039
|
+
/**
|
|
3040
|
+
* @method
|
|
3041
|
+
* @name bitfinex2#fetchOpenInterestHistory
|
|
3042
|
+
* @description retrieves the open interest history of a currency
|
|
3043
|
+
* @see https://docs.bitfinex.com/reference/rest-public-derivatives-status-history
|
|
3044
|
+
* @param {string} symbol unified CCXT market symbol
|
|
3045
|
+
* @param {string} timeframe the time period of each row of data, not used by bitfinex2
|
|
3046
|
+
* @param {int} [since] the time in ms of the earliest record to retrieve as a unix timestamp
|
|
3047
|
+
* @param {int} [limit] the number of records in the response
|
|
3048
|
+
* @param {object} [params] exchange specific parameters
|
|
3049
|
+
* @param {int} [params.until] the time in ms of the latest record to retrieve as a unix timestamp
|
|
3050
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
3051
|
+
* @returns An array of [open interest structures]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
3052
|
+
*/
|
|
3053
|
+
await this.loadMarkets();
|
|
3054
|
+
let paginate = false;
|
|
3055
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOpenInterestHistory', 'paginate');
|
|
3056
|
+
if (paginate) {
|
|
3057
|
+
return await this.fetchPaginatedCallDeterministic('fetchOpenInterestHistory', symbol, since, limit, '8h', params, 5000);
|
|
3058
|
+
}
|
|
3059
|
+
const market = this.market(symbol);
|
|
3060
|
+
let request = {
|
|
3061
|
+
'symbol': market['id'],
|
|
3062
|
+
};
|
|
3063
|
+
if (since !== undefined) {
|
|
3064
|
+
request['start'] = since;
|
|
3065
|
+
}
|
|
3066
|
+
if (limit !== undefined) {
|
|
3067
|
+
request['limit'] = limit;
|
|
3068
|
+
}
|
|
3069
|
+
[request, params] = this.handleUntilOption('end', request, params);
|
|
3070
|
+
const response = await this.publicGetStatusDerivSymbolHist(this.extend(request, params));
|
|
3071
|
+
//
|
|
3072
|
+
// [
|
|
3073
|
+
// [
|
|
3074
|
+
// 1706295191000, // timestamp
|
|
3075
|
+
// null,
|
|
3076
|
+
// 42152.425382, // derivative mid price
|
|
3077
|
+
// 42133, // spot mid price
|
|
3078
|
+
// null,
|
|
3079
|
+
// 37671589.7853521, // insurance fund balance
|
|
3080
|
+
// null,
|
|
3081
|
+
// 1706313600000, // timestamp of next funding
|
|
3082
|
+
// 0.00018734, // accrued funding for next period
|
|
3083
|
+
// 3343, // next funding step
|
|
3084
|
+
// null,
|
|
3085
|
+
// 0.00007587, // current funding
|
|
3086
|
+
// null,
|
|
3087
|
+
// null,
|
|
3088
|
+
// 42134.1, // mark price
|
|
3089
|
+
// null,
|
|
3090
|
+
// null,
|
|
3091
|
+
// 5775.20348804, // open interest number of contracts
|
|
3092
|
+
// null,
|
|
3093
|
+
// null,
|
|
3094
|
+
// null,
|
|
3095
|
+
// 0.0005, // average spread without funding payment
|
|
3096
|
+
// 0.0025 // funding payment cap
|
|
3097
|
+
// ],
|
|
3098
|
+
// ]
|
|
3099
|
+
//
|
|
3100
|
+
return this.parseOpenInterests(response, market, since, limit);
|
|
3101
|
+
}
|
|
3037
3102
|
parseOpenInterest(interest, market = undefined) {
|
|
3103
|
+
//
|
|
3104
|
+
// fetchOpenInterest:
|
|
3038
3105
|
//
|
|
3039
3106
|
// [
|
|
3040
3107
|
// "tXRPF0:USTF0", // market id
|
|
@@ -3063,11 +3130,41 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
3063
3130
|
// 0.0025 // funding payment cap
|
|
3064
3131
|
// ]
|
|
3065
3132
|
//
|
|
3133
|
+
// fetchOpenInterestHistory:
|
|
3134
|
+
//
|
|
3135
|
+
// [
|
|
3136
|
+
// 1706295191000, // timestamp
|
|
3137
|
+
// null,
|
|
3138
|
+
// 42152.425382, // derivative mid price
|
|
3139
|
+
// 42133, // spot mid price
|
|
3140
|
+
// null,
|
|
3141
|
+
// 37671589.7853521, // insurance fund balance
|
|
3142
|
+
// null,
|
|
3143
|
+
// 1706313600000, // timestamp of next funding
|
|
3144
|
+
// 0.00018734, // accrued funding for next period
|
|
3145
|
+
// 3343, // next funding step
|
|
3146
|
+
// null,
|
|
3147
|
+
// 0.00007587, // current funding
|
|
3148
|
+
// null,
|
|
3149
|
+
// null,
|
|
3150
|
+
// 42134.1, // mark price
|
|
3151
|
+
// null,
|
|
3152
|
+
// null,
|
|
3153
|
+
// 5775.20348804, // open interest number of contracts
|
|
3154
|
+
// null,
|
|
3155
|
+
// null,
|
|
3156
|
+
// null,
|
|
3157
|
+
// 0.0005, // average spread without funding payment
|
|
3158
|
+
// 0.0025 // funding payment cap
|
|
3159
|
+
// ]
|
|
3160
|
+
//
|
|
3161
|
+
const interestLength = interest.length;
|
|
3162
|
+
const openInterestIndex = (interestLength === 23) ? 17 : 18;
|
|
3066
3163
|
const timestamp = this.safeInteger(interest, 1);
|
|
3067
3164
|
const marketId = this.safeString(interest, 0);
|
|
3068
3165
|
return this.safeOpenInterest({
|
|
3069
3166
|
'symbol': this.safeSymbol(marketId, market, undefined, 'swap'),
|
|
3070
|
-
'openInterestAmount': this.safeNumber(interest,
|
|
3167
|
+
'openInterestAmount': this.safeNumber(interest, openInterestIndex),
|
|
3071
3168
|
'openInterestValue': undefined,
|
|
3072
3169
|
'timestamp': timestamp,
|
|
3073
3170
|
'datetime': this.iso8601(timestamp),
|
package/dist/cjs/src/phemex.js
CHANGED
|
@@ -3766,7 +3766,7 @@ class phemex extends phemex$1 {
|
|
|
3766
3766
|
const contracts = this.safeString(position, 'size');
|
|
3767
3767
|
const contractSize = this.safeValue(market, 'contractSize');
|
|
3768
3768
|
const contractSizeString = this.numberToString(contractSize);
|
|
3769
|
-
const leverage = this.parseNumber(Precise["default"].stringAbs((this.
|
|
3769
|
+
const leverage = this.parseNumber(Precise["default"].stringAbs((this.safeString2(position, 'leverage', 'leverageRr'))));
|
|
3770
3770
|
const entryPriceString = this.safeString2(position, 'avgEntryPrice', 'avgEntryPriceRp');
|
|
3771
3771
|
const rawSide = this.safeString(position, 'side');
|
|
3772
3772
|
let side = undefined;
|
|
@@ -13,7 +13,7 @@ class bitopro extends bitopro$1 {
|
|
|
13
13
|
'has': {
|
|
14
14
|
'ws': true,
|
|
15
15
|
'watchBalance': true,
|
|
16
|
-
'watchMyTrades':
|
|
16
|
+
'watchMyTrades': true,
|
|
17
17
|
'watchOHLCV': false,
|
|
18
18
|
'watchOrderBook': true,
|
|
19
19
|
'watchOrders': false,
|
|
@@ -174,6 +174,150 @@ class bitopro extends bitopro$1 {
|
|
|
174
174
|
this.trades[symbol] = tradesCache;
|
|
175
175
|
client.resolve(tradesCache, messageHash);
|
|
176
176
|
}
|
|
177
|
+
async watchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
178
|
+
/**
|
|
179
|
+
* @method
|
|
180
|
+
* @name bitopro#watchMyTrades
|
|
181
|
+
* @description watches information on multiple trades made by the user
|
|
182
|
+
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/ws/private/matches_stream.md
|
|
183
|
+
* @param {string} symbol unified market symbol of the market trades were made in
|
|
184
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
185
|
+
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
186
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
187
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
188
|
+
*/
|
|
189
|
+
this.checkRequiredCredentials();
|
|
190
|
+
await this.loadMarkets();
|
|
191
|
+
let messageHash = 'USER_TRADE';
|
|
192
|
+
if (symbol !== undefined) {
|
|
193
|
+
const market = this.market(symbol);
|
|
194
|
+
messageHash = messageHash + ':' + market['symbol'];
|
|
195
|
+
}
|
|
196
|
+
const url = this.urls['ws']['private'] + '/' + 'user-trades';
|
|
197
|
+
this.authenticate(url);
|
|
198
|
+
const trades = await this.watch(url, messageHash, undefined, messageHash);
|
|
199
|
+
if (this.newUpdates) {
|
|
200
|
+
limit = trades.getLimit(symbol, limit);
|
|
201
|
+
}
|
|
202
|
+
return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
|
|
203
|
+
}
|
|
204
|
+
handleMyTrade(client, message) {
|
|
205
|
+
//
|
|
206
|
+
// {
|
|
207
|
+
// "event": "USER_TRADE",
|
|
208
|
+
// "timestamp": 1694667358782,
|
|
209
|
+
// "datetime": "2023-09-14T12:55:58.782Z",
|
|
210
|
+
// "data": {
|
|
211
|
+
// "base": "usdt",
|
|
212
|
+
// "quote": "twd",
|
|
213
|
+
// "side": "ask",
|
|
214
|
+
// "price": "32.039",
|
|
215
|
+
// "volume": "1",
|
|
216
|
+
// "fee": "6407800",
|
|
217
|
+
// "feeCurrency": "twd",
|
|
218
|
+
// "transactionTimestamp": 1694667358,
|
|
219
|
+
// "eventTimestamp": 1694667358,
|
|
220
|
+
// "orderID": 390733918,
|
|
221
|
+
// "orderType": "LIMIT",
|
|
222
|
+
// "matchID": "bd07673a-94b1-419e-b5ee-d7b723261a5d",
|
|
223
|
+
// "isMarket": false,
|
|
224
|
+
// "isMaker": false
|
|
225
|
+
// }
|
|
226
|
+
// }
|
|
227
|
+
//
|
|
228
|
+
const data = this.safeValue(message, 'data', {});
|
|
229
|
+
const baseId = this.safeString(data, 'base');
|
|
230
|
+
const quoteId = this.safeString(data, 'quote');
|
|
231
|
+
const base = this.safeCurrencyCode(baseId);
|
|
232
|
+
const quote = this.safeCurrencyCode(quoteId);
|
|
233
|
+
const symbol = this.symbol(base + '/' + quote);
|
|
234
|
+
const messageHash = this.safeString(message, 'event');
|
|
235
|
+
if (this.myTrades === undefined) {
|
|
236
|
+
const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
|
|
237
|
+
this.myTrades = new Cache.ArrayCacheBySymbolById(limit);
|
|
238
|
+
}
|
|
239
|
+
const trades = this.myTrades;
|
|
240
|
+
const parsed = this.parseWsTrade(data);
|
|
241
|
+
trades.append(parsed);
|
|
242
|
+
client.resolve(trades, messageHash);
|
|
243
|
+
client.resolve(trades, messageHash + ':' + symbol);
|
|
244
|
+
}
|
|
245
|
+
parseWsTrade(trade, market = undefined) {
|
|
246
|
+
//
|
|
247
|
+
// {
|
|
248
|
+
// "base": "usdt",
|
|
249
|
+
// "quote": "twd",
|
|
250
|
+
// "side": "ask",
|
|
251
|
+
// "price": "32.039",
|
|
252
|
+
// "volume": "1",
|
|
253
|
+
// "fee": "6407800",
|
|
254
|
+
// "feeCurrency": "twd",
|
|
255
|
+
// "transactionTimestamp": 1694667358,
|
|
256
|
+
// "eventTimestamp": 1694667358,
|
|
257
|
+
// "orderID": 390733918,
|
|
258
|
+
// "orderType": "LIMIT",
|
|
259
|
+
// "matchID": "bd07673a-94b1-419e-b5ee-d7b723261a5d",
|
|
260
|
+
// "isMarket": false,
|
|
261
|
+
// "isMaker": false
|
|
262
|
+
// }
|
|
263
|
+
//
|
|
264
|
+
const id = this.safeString(trade, 'matchID');
|
|
265
|
+
const orderId = this.safeString(trade, 'orderID');
|
|
266
|
+
const timestamp = this.safeTimestamp(trade, 'transactionTimestamp');
|
|
267
|
+
const baseId = this.safeString(trade, 'base');
|
|
268
|
+
const quoteId = this.safeString(trade, 'quote');
|
|
269
|
+
const base = this.safeCurrencyCode(baseId);
|
|
270
|
+
const quote = this.safeCurrencyCode(quoteId);
|
|
271
|
+
const symbol = this.symbol(base + '/' + quote);
|
|
272
|
+
market = this.safeMarket(symbol, market);
|
|
273
|
+
const price = this.safeString(trade, 'price');
|
|
274
|
+
const type = this.safeStringLower(trade, 'orderType');
|
|
275
|
+
let side = this.safeString(trade, 'side');
|
|
276
|
+
if (side !== undefined) {
|
|
277
|
+
if (side === 'ask') {
|
|
278
|
+
side = 'sell';
|
|
279
|
+
}
|
|
280
|
+
else if (side === 'bid') {
|
|
281
|
+
side = 'buy';
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
const amount = this.safeString(trade, 'volume');
|
|
285
|
+
let fee = undefined;
|
|
286
|
+
const feeAmount = this.safeString(trade, 'fee');
|
|
287
|
+
const feeSymbol = this.safeCurrencyCode(this.safeString(trade, 'feeCurrency'));
|
|
288
|
+
if (feeAmount !== undefined) {
|
|
289
|
+
fee = {
|
|
290
|
+
'cost': feeAmount,
|
|
291
|
+
'currency': feeSymbol,
|
|
292
|
+
'rate': undefined,
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
const isMaker = this.safeValue(trade, 'isMaker');
|
|
296
|
+
let takerOrMaker = undefined;
|
|
297
|
+
if (isMaker !== undefined) {
|
|
298
|
+
if (isMaker) {
|
|
299
|
+
takerOrMaker = 'maker';
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
takerOrMaker = 'taker';
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
return this.safeTrade({
|
|
306
|
+
'id': id,
|
|
307
|
+
'info': trade,
|
|
308
|
+
'order': orderId,
|
|
309
|
+
'timestamp': timestamp,
|
|
310
|
+
'datetime': this.iso8601(timestamp),
|
|
311
|
+
'symbol': symbol,
|
|
312
|
+
'takerOrMaker': takerOrMaker,
|
|
313
|
+
'type': type,
|
|
314
|
+
'side': side,
|
|
315
|
+
'price': price,
|
|
316
|
+
'amount': amount,
|
|
317
|
+
'cost': undefined,
|
|
318
|
+
'fee': fee,
|
|
319
|
+
}, market);
|
|
320
|
+
}
|
|
177
321
|
async watchTicker(symbol, params = {}) {
|
|
178
322
|
/**
|
|
179
323
|
* @method
|
|
@@ -316,6 +460,7 @@ class bitopro extends bitopro$1 {
|
|
|
316
460
|
'TICKER': this.handleTicker,
|
|
317
461
|
'ORDER_BOOK': this.handleOrderBook,
|
|
318
462
|
'ACCOUNT_BALANCE': this.handleBalance,
|
|
463
|
+
'USER_TRADE': this.handleMyTrade,
|
|
319
464
|
};
|
|
320
465
|
const event = this.safeString(message, 'event');
|
|
321
466
|
const method = this.safeValue(methods, event);
|
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.23";
|
|
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.24';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -243,6 +243,37 @@ interface binance {
|
|
|
243
243
|
sapiGetSimpleEarnFlexibleHistoryRewardsRecord(params?: {}): Promise<implicitReturnType>;
|
|
244
244
|
sapiGetSimpleEarnLockedHistoryRewardsRecord(params?: {}): Promise<implicitReturnType>;
|
|
245
245
|
sapiGetSimpleEarnFlexibleHistoryCollateralRecord(params?: {}): Promise<implicitReturnType>;
|
|
246
|
+
sapiGetAssetAssetDistributionHistory(params?: {}): Promise<implicitReturnType>;
|
|
247
|
+
sapiGetAssetQueryTradingFee(params?: {}): Promise<implicitReturnType>;
|
|
248
|
+
sapiGetAssetQueryTradingVolume(params?: {}): Promise<implicitReturnType>;
|
|
249
|
+
sapiGetOtcCoinPairs(params?: {}): Promise<implicitReturnType>;
|
|
250
|
+
sapiGetOtcOrdersOrderId(params?: {}): Promise<implicitReturnType>;
|
|
251
|
+
sapiGetOtcOrders(params?: {}): Promise<implicitReturnType>;
|
|
252
|
+
sapiGetOcbsOrders(params?: {}): Promise<implicitReturnType>;
|
|
253
|
+
sapiGetFiatpaymentQueryWithdrawHistory(params?: {}): Promise<implicitReturnType>;
|
|
254
|
+
sapiGetFiatpaymentQueryDepositHistory(params?: {}): Promise<implicitReturnType>;
|
|
255
|
+
sapiGetCapitalSubAccountDepositAddress(params?: {}): Promise<implicitReturnType>;
|
|
256
|
+
sapiGetCapitalSubAccountDepositHistory(params?: {}): Promise<implicitReturnType>;
|
|
257
|
+
sapiGetAssetQueryDustLogs(params?: {}): Promise<implicitReturnType>;
|
|
258
|
+
sapiGetAssetQueryDustAssets(params?: {}): Promise<implicitReturnType>;
|
|
259
|
+
sapiGetMarketingReferralRewardHistory(params?: {}): Promise<implicitReturnType>;
|
|
260
|
+
sapiGetStakingAsset(params?: {}): Promise<implicitReturnType>;
|
|
261
|
+
sapiGetStakingStakingBalance(params?: {}): Promise<implicitReturnType>;
|
|
262
|
+
sapiGetStakingHistory(params?: {}): Promise<implicitReturnType>;
|
|
263
|
+
sapiGetStakingStakingRewardsHistory(params?: {}): Promise<implicitReturnType>;
|
|
264
|
+
sapiGetCustodianBalance(params?: {}): Promise<implicitReturnType>;
|
|
265
|
+
sapiGetCustodianSupportedAssetList(params?: {}): Promise<implicitReturnType>;
|
|
266
|
+
sapiGetCustodianWalletTransferHistory(params?: {}): Promise<implicitReturnType>;
|
|
267
|
+
sapiGetCustodianCustodianTransferHistory(params?: {}): Promise<implicitReturnType>;
|
|
268
|
+
sapiGetCustodianOpenOrders(params?: {}): Promise<implicitReturnType>;
|
|
269
|
+
sapiGetCustodianOrder(params?: {}): Promise<implicitReturnType>;
|
|
270
|
+
sapiGetCustodianOrderHistory(params?: {}): Promise<implicitReturnType>;
|
|
271
|
+
sapiGetCustodianTradeHistory(params?: {}): Promise<implicitReturnType>;
|
|
272
|
+
sapiGetCustodianSettlementSetting(params?: {}): Promise<implicitReturnType>;
|
|
273
|
+
sapiGetCustodianSettlementHistory(params?: {}): Promise<implicitReturnType>;
|
|
274
|
+
sapiGetClTransferHistory(params?: {}): Promise<implicitReturnType>;
|
|
275
|
+
sapiGetApipartnerCheckEligibility(params?: {}): Promise<implicitReturnType>;
|
|
276
|
+
sapiGetApipartnerRebateHistory(params?: {}): Promise<implicitReturnType>;
|
|
246
277
|
sapiPostAssetDust(params?: {}): Promise<implicitReturnType>;
|
|
247
278
|
sapiPostAssetDustBtc(params?: {}): Promise<implicitReturnType>;
|
|
248
279
|
sapiPostAssetTransfer(params?: {}): Promise<implicitReturnType>;
|
|
@@ -357,6 +388,17 @@ interface binance {
|
|
|
357
388
|
sapiPostSimpleEarnLockedRedeem(params?: {}): Promise<implicitReturnType>;
|
|
358
389
|
sapiPostSimpleEarnFlexibleSetAutoSubscribe(params?: {}): Promise<implicitReturnType>;
|
|
359
390
|
sapiPostSimpleEarnLockedSetAutoSubscribe(params?: {}): Promise<implicitReturnType>;
|
|
391
|
+
sapiPostOtcQuotes(params?: {}): Promise<implicitReturnType>;
|
|
392
|
+
sapiPostOtcOrders(params?: {}): Promise<implicitReturnType>;
|
|
393
|
+
sapiPostFiatpaymentWithdrawApply(params?: {}): Promise<implicitReturnType>;
|
|
394
|
+
sapiPostStakingStake(params?: {}): Promise<implicitReturnType>;
|
|
395
|
+
sapiPostStakingUnstake(params?: {}): Promise<implicitReturnType>;
|
|
396
|
+
sapiPostCustodianWalletTransfer(params?: {}): Promise<implicitReturnType>;
|
|
397
|
+
sapiPostCustodianCustodianTransfer(params?: {}): Promise<implicitReturnType>;
|
|
398
|
+
sapiPostCustodianUndoTransfer(params?: {}): Promise<implicitReturnType>;
|
|
399
|
+
sapiPostCustodianOrder(params?: {}): Promise<implicitReturnType>;
|
|
400
|
+
sapiPostCustodianOcoOrder(params?: {}): Promise<implicitReturnType>;
|
|
401
|
+
sapiPostClTransfer(params?: {}): Promise<implicitReturnType>;
|
|
360
402
|
sapiPutUserDataStream(params?: {}): Promise<implicitReturnType>;
|
|
361
403
|
sapiPutUserDataStreamIsolated(params?: {}): Promise<implicitReturnType>;
|
|
362
404
|
sapiDeleteMarginOpenOrders(params?: {}): Promise<implicitReturnType>;
|
|
@@ -370,14 +412,24 @@ interface binance {
|
|
|
370
412
|
sapiDeleteAlgoSpotOrder(params?: {}): Promise<implicitReturnType>;
|
|
371
413
|
sapiDeleteAlgoFuturesOrder(params?: {}): Promise<implicitReturnType>;
|
|
372
414
|
sapiDeleteSubAccountSubAccountApiIpRestrictionIpList(params?: {}): Promise<implicitReturnType>;
|
|
415
|
+
sapiDeleteCustodianCancelOrder(params?: {}): Promise<implicitReturnType>;
|
|
416
|
+
sapiDeleteCustodianCancelOrdersBySymbol(params?: {}): Promise<implicitReturnType>;
|
|
417
|
+
sapiDeleteCustodianCancelOcoOrder(params?: {}): Promise<implicitReturnType>;
|
|
373
418
|
sapiV2GetEthStakingAccount(params?: {}): Promise<implicitReturnType>;
|
|
374
419
|
sapiV2GetSubAccountFuturesAccount(params?: {}): Promise<implicitReturnType>;
|
|
375
420
|
sapiV2GetSubAccountFuturesAccountSummary(params?: {}): Promise<implicitReturnType>;
|
|
376
421
|
sapiV2GetSubAccountFuturesPositionRisk(params?: {}): Promise<implicitReturnType>;
|
|
422
|
+
sapiV2GetClAccount(params?: {}): Promise<implicitReturnType>;
|
|
423
|
+
sapiV2GetClAlertHistory(params?: {}): Promise<implicitReturnType>;
|
|
377
424
|
sapiV2PostEthStakingEthStake(params?: {}): Promise<implicitReturnType>;
|
|
378
425
|
sapiV2PostSubAccountSubAccountApiIpRestriction(params?: {}): Promise<implicitReturnType>;
|
|
379
426
|
sapiV3GetSubAccountAssets(params?: {}): Promise<implicitReturnType>;
|
|
427
|
+
sapiV3GetAccountStatus(params?: {}): Promise<implicitReturnType>;
|
|
428
|
+
sapiV3GetApiTradingStatus(params?: {}): Promise<implicitReturnType>;
|
|
429
|
+
sapiV3GetSubAccountList(params?: {}): Promise<implicitReturnType>;
|
|
430
|
+
sapiV3GetSubAccountTransferHistory(params?: {}): Promise<implicitReturnType>;
|
|
380
431
|
sapiV3PostAssetGetUserAsset(params?: {}): Promise<implicitReturnType>;
|
|
432
|
+
sapiV3PostSubAccountTransfer(params?: {}): Promise<implicitReturnType>;
|
|
381
433
|
sapiV4GetSubAccountAssets(params?: {}): Promise<implicitReturnType>;
|
|
382
434
|
dapiPublicGetPing(params?: {}): Promise<implicitReturnType>;
|
|
383
435
|
dapiPublicGetTime(params?: {}): Promise<implicitReturnType>;
|
|
@@ -594,7 +646,6 @@ interface binance {
|
|
|
594
646
|
privateGetMyPreventedMatches(params?: {}): Promise<implicitReturnType>;
|
|
595
647
|
privateGetMyAllocations(params?: {}): Promise<implicitReturnType>;
|
|
596
648
|
privateGetAccountCommission(params?: {}): Promise<implicitReturnType>;
|
|
597
|
-
privateGetStatus(params?: {}): Promise<implicitReturnType>;
|
|
598
649
|
privatePostOrderOco(params?: {}): Promise<implicitReturnType>;
|
|
599
650
|
privatePostSorOrder(params?: {}): Promise<implicitReturnType>;
|
|
600
651
|
privatePostSorOrderTest(params?: {}): Promise<implicitReturnType>;
|