ccxt 4.4.26 → 4.4.27
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 +133 -132
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +1 -1
- package/dist/cjs/src/alpaca.js +194 -5
- package/dist/cjs/src/ascendex.js +1 -1
- package/dist/cjs/src/base/Exchange.js +18 -0
- package/dist/cjs/src/bequant.js +1 -1
- package/dist/cjs/src/bigone.js +1 -1
- package/dist/cjs/src/binance.js +1 -1
- package/dist/cjs/src/binancecoinm.js +1 -1
- package/dist/cjs/src/binanceus.js +1 -1
- package/dist/cjs/src/binanceusdm.js +1 -1
- package/dist/cjs/src/bingx.js +25 -36
- package/dist/cjs/src/bit2c.js +1 -1
- package/dist/cjs/src/bitbank.js +1 -1
- package/dist/cjs/src/bitbns.js +1 -1
- package/dist/cjs/src/bitfinex.js +1 -1
- package/dist/cjs/src/bitfinex2.js +1 -1
- package/dist/cjs/src/bitflyer.js +1 -1
- package/dist/cjs/src/bitget.js +1 -1
- package/dist/cjs/src/bithumb.js +1 -1
- package/dist/cjs/src/bitmart.js +1 -1
- package/dist/cjs/src/bitmex.js +1 -1
- package/dist/cjs/src/bitopro.js +1 -1
- package/dist/cjs/src/bitrue.js +1 -1
- package/dist/cjs/src/bitso.js +1 -1
- package/dist/cjs/src/bitstamp.js +1 -1
- package/dist/cjs/src/bitteam.js +1 -1
- package/dist/cjs/src/bitvavo.js +1 -1
- package/dist/cjs/src/bl3p.js +1 -1
- package/dist/cjs/src/blockchaincom.js +1 -1
- package/dist/cjs/src/blofin.js +1 -1
- package/dist/cjs/src/btcalpha.js +1 -1
- package/dist/cjs/src/btcbox.js +1 -1
- package/dist/cjs/src/btcmarkets.js +1 -1
- package/dist/cjs/src/btcturk.js +1 -1
- package/dist/cjs/src/bybit.js +5 -1
- package/dist/cjs/src/coinbase.js +97 -11
- package/dist/cjs/src/coinex.js +1 -1
- package/dist/cjs/src/gate.js +22 -16
- package/dist/cjs/src/hyperliquid.js +21 -1
- package/dist/cjs/src/lbank.js +100 -1
- package/dist/cjs/src/pro/binance.js +1 -1
- package/dist/cjs/src/pro/lbank.js +9 -4
- package/dist/cjs/src/wavesexchange.js +13 -2
- package/examples/js/cli.js +23 -3
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/alpaca.d.ts +2 -0
- package/js/src/ace.js +1 -1
- package/js/src/alpaca.d.ts +9 -1
- package/js/src/alpaca.js +194 -5
- package/js/src/ascendex.js +1 -1
- package/js/src/base/Exchange.d.ts +6 -0
- package/js/src/base/Exchange.js +18 -0
- package/js/src/bequant.js +1 -1
- package/js/src/bigone.js +1 -1
- package/js/src/binance.js +1 -1
- package/js/src/binancecoinm.js +1 -1
- package/js/src/binanceus.js +1 -1
- package/js/src/binanceusdm.js +1 -1
- package/js/src/bingx.js +25 -36
- package/js/src/bit2c.js +1 -1
- package/js/src/bitbank.js +1 -1
- package/js/src/bitbns.js +1 -1
- package/js/src/bitfinex.js +1 -1
- package/js/src/bitfinex2.js +1 -1
- package/js/src/bitflyer.js +1 -1
- package/js/src/bitget.js +1 -1
- package/js/src/bithumb.js +1 -1
- package/js/src/bitmart.js +1 -1
- package/js/src/bitmex.js +1 -1
- package/js/src/bitopro.js +1 -1
- package/js/src/bitrue.js +1 -1
- package/js/src/bitso.js +1 -1
- package/js/src/bitstamp.js +1 -1
- package/js/src/bitteam.js +1 -1
- package/js/src/bitvavo.js +1 -1
- package/js/src/bl3p.js +1 -1
- package/js/src/blockchaincom.js +1 -1
- package/js/src/blofin.js +1 -1
- package/js/src/btcalpha.js +1 -1
- package/js/src/btcbox.js +1 -1
- package/js/src/btcmarkets.js +1 -1
- package/js/src/btcturk.js +1 -1
- package/js/src/bybit.js +5 -1
- package/js/src/coinbase.d.ts +1 -0
- package/js/src/coinbase.js +97 -11
- package/js/src/coinex.js +1 -1
- package/js/src/gate.js +22 -16
- package/js/src/hyperliquid.d.ts +1 -0
- package/js/src/hyperliquid.js +21 -1
- package/js/src/lbank.d.ts +4 -1
- package/js/src/lbank.js +100 -1
- package/js/src/pro/binance.js +1 -1
- package/js/src/pro/lbank.js +9 -4
- package/js/src/wavesexchange.js +13 -2
- package/package.json +1 -1
package/js/src/lbank.js
CHANGED
|
@@ -60,7 +60,7 @@ export default class lbank extends Exchange {
|
|
|
60
60
|
'fetchFundingHistory': false,
|
|
61
61
|
'fetchFundingRate': false,
|
|
62
62
|
'fetchFundingRateHistory': false,
|
|
63
|
-
'fetchFundingRates':
|
|
63
|
+
'fetchFundingRates': true,
|
|
64
64
|
'fetchIndexOHLCV': false,
|
|
65
65
|
'fetchIsolatedBorrowRate': false,
|
|
66
66
|
'fetchIsolatedBorrowRates': false,
|
|
@@ -1174,6 +1174,105 @@ export default class lbank extends Exchange {
|
|
|
1174
1174
|
}
|
|
1175
1175
|
return undefined;
|
|
1176
1176
|
}
|
|
1177
|
+
parseFundingRate(ticker, market = undefined) {
|
|
1178
|
+
// {
|
|
1179
|
+
// "symbol": "BTCUSDT",
|
|
1180
|
+
// "highestPrice": "69495.5",
|
|
1181
|
+
// "underlyingPrice": "68455.904",
|
|
1182
|
+
// "lowestPrice": "68182.1",
|
|
1183
|
+
// "openPrice": "68762.4",
|
|
1184
|
+
// "positionFeeRate": "0.0001",
|
|
1185
|
+
// "volume": "33534.2858",
|
|
1186
|
+
// "markedPrice": "68434.1",
|
|
1187
|
+
// "turnover": "1200636218.210558",
|
|
1188
|
+
// "positionFeeTime": "28800",
|
|
1189
|
+
// "lastPrice": "68427.3",
|
|
1190
|
+
// "nextFeeTime": "1730736000000",
|
|
1191
|
+
// "fundingRate": "0.0001",
|
|
1192
|
+
// }
|
|
1193
|
+
const marketId = this.safeString(ticker, 'symbol');
|
|
1194
|
+
const symbol = this.safeSymbol(marketId, market);
|
|
1195
|
+
const markPrice = this.safeNumber(ticker, 'markedPrice');
|
|
1196
|
+
const indexPrice = this.safeNumber(ticker, 'underlyingPrice');
|
|
1197
|
+
const fundingRate = this.safeNumber(ticker, 'fundingRate');
|
|
1198
|
+
const fundingTime = this.safeInteger(ticker, 'nextFeeTime');
|
|
1199
|
+
return {
|
|
1200
|
+
'info': ticker,
|
|
1201
|
+
'symbol': symbol,
|
|
1202
|
+
'markPrice': markPrice,
|
|
1203
|
+
'indexPrice': indexPrice,
|
|
1204
|
+
'fundingRate': fundingRate,
|
|
1205
|
+
'fundingTimestamp': fundingTime,
|
|
1206
|
+
'fundingDatetime': this.iso8601(fundingTime),
|
|
1207
|
+
'timestamp': undefined,
|
|
1208
|
+
'datetime': undefined,
|
|
1209
|
+
'nextFundingRate': undefined,
|
|
1210
|
+
'nextFundingTimestamp': undefined,
|
|
1211
|
+
'nextFundingDatetime': undefined,
|
|
1212
|
+
'previousFundingRate': undefined,
|
|
1213
|
+
'previousFundingTimestamp': undefined,
|
|
1214
|
+
'previousFundingDatetime': undefined,
|
|
1215
|
+
'interval': undefined,
|
|
1216
|
+
};
|
|
1217
|
+
}
|
|
1218
|
+
async fetchFundingRate(symbol, params = {}) {
|
|
1219
|
+
/**
|
|
1220
|
+
* @method
|
|
1221
|
+
* @name lbank#fetchFundingRate
|
|
1222
|
+
* @description fetch the current funding rate
|
|
1223
|
+
* @see https://www.lbank.com/en-US/docs/contract.html#query-contract-market-list
|
|
1224
|
+
* @param {string} symbol unified market symbol
|
|
1225
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1226
|
+
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
1227
|
+
*/
|
|
1228
|
+
await this.loadMarkets();
|
|
1229
|
+
const market = this.market(symbol);
|
|
1230
|
+
const responseForSwap = await this.fetchFundingRates([market['symbol']], params);
|
|
1231
|
+
return this.safeValue(responseForSwap, market['symbol']);
|
|
1232
|
+
}
|
|
1233
|
+
async fetchFundingRates(symbols = undefined, params = {}) {
|
|
1234
|
+
/**
|
|
1235
|
+
* @method
|
|
1236
|
+
* @name lbank#fetchFundingRates
|
|
1237
|
+
* @description fetch the funding rate for multiple markets
|
|
1238
|
+
* @see https://www.lbank.com/en-US/docs/contract.html#query-contract-market-list
|
|
1239
|
+
* @param {string[]|undefined} symbols list of unified market symbols
|
|
1240
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1241
|
+
* @returns {object} a dictionary of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexed by market symbols
|
|
1242
|
+
*/
|
|
1243
|
+
await this.loadMarkets();
|
|
1244
|
+
symbols = this.marketSymbols(symbols);
|
|
1245
|
+
const request = {
|
|
1246
|
+
'productGroup': 'SwapU',
|
|
1247
|
+
};
|
|
1248
|
+
const response = await this.contractPublicGetCfdOpenApiV1PubMarketData(this.extend(request, params));
|
|
1249
|
+
// {
|
|
1250
|
+
// "data": [
|
|
1251
|
+
// {
|
|
1252
|
+
// "symbol": "BTCUSDT",
|
|
1253
|
+
// "highestPrice": "69495.5",
|
|
1254
|
+
// "underlyingPrice": "68455.904",
|
|
1255
|
+
// "lowestPrice": "68182.1",
|
|
1256
|
+
// "openPrice": "68762.4",
|
|
1257
|
+
// "positionFeeRate": "0.0001",
|
|
1258
|
+
// "volume": "33534.2858",
|
|
1259
|
+
// "markedPrice": "68434.1",
|
|
1260
|
+
// "turnover": "1200636218.210558",
|
|
1261
|
+
// "positionFeeTime": "28800",
|
|
1262
|
+
// "lastPrice": "68427.3",
|
|
1263
|
+
// "nextFeeTime": "1730736000000",
|
|
1264
|
+
// "fundingRate": "0.0001",
|
|
1265
|
+
// }
|
|
1266
|
+
// ],
|
|
1267
|
+
// "error_code": "0",
|
|
1268
|
+
// "msg": "Success",
|
|
1269
|
+
// "result": "true",
|
|
1270
|
+
// "success": True,
|
|
1271
|
+
// }
|
|
1272
|
+
const data = this.safeList(response, 'data', []);
|
|
1273
|
+
const result = this.parseFundingRates(data);
|
|
1274
|
+
return this.filterByArray(result, 'symbol', symbols);
|
|
1275
|
+
}
|
|
1177
1276
|
async fetchBalance(params = {}) {
|
|
1178
1277
|
/**
|
|
1179
1278
|
* @method
|
package/js/src/pro/binance.js
CHANGED
|
@@ -1978,7 +1978,7 @@ export default class binance extends binanceRest {
|
|
|
1978
1978
|
if (symbolsDefined) {
|
|
1979
1979
|
firstMarket = this.market(symbols[0]);
|
|
1980
1980
|
}
|
|
1981
|
-
const defaultMarket = (isMarkPrice) ? 'swap' :
|
|
1981
|
+
const defaultMarket = (isMarkPrice) ? 'swap' : undefined;
|
|
1982
1982
|
[marketType, params] = this.handleMarketTypeAndParams(methodName, firstMarket, params, defaultMarket);
|
|
1983
1983
|
let subType = undefined;
|
|
1984
1984
|
[subType, params] = this.handleSubTypeAndParams(methodName, firstMarket, params);
|
package/js/src/pro/lbank.js
CHANGED
|
@@ -811,10 +811,15 @@ export default class lbank extends lbankRest {
|
|
|
811
811
|
// { ping: 'a13a939c-5f25-4e06-9981-93cb3b890707', action: 'ping' }
|
|
812
812
|
//
|
|
813
813
|
const pingId = this.safeString(message, 'ping');
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
814
|
+
try {
|
|
815
|
+
await client.send({
|
|
816
|
+
'action': 'pong',
|
|
817
|
+
'pong': pingId,
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
catch (e) {
|
|
821
|
+
this.onError(client, e);
|
|
822
|
+
}
|
|
818
823
|
}
|
|
819
824
|
handleMessage(client, message) {
|
|
820
825
|
const status = this.safeString(message, 'status');
|
package/js/src/wavesexchange.js
CHANGED
|
@@ -127,7 +127,13 @@ export default class wavesexchange extends Exchange {
|
|
|
127
127
|
'forward': 'https://wx.network/api/v1/forward/matcher',
|
|
128
128
|
'market': 'https://wx.network/api/v1/forward/marketdata/api/v1',
|
|
129
129
|
},
|
|
130
|
-
'doc':
|
|
130
|
+
'doc': [
|
|
131
|
+
'https://docs.wx.network',
|
|
132
|
+
'https://docs.waves.tech',
|
|
133
|
+
'https://api.wavesplatform.com/v0/docs/',
|
|
134
|
+
'https://nodes.wavesnodes.com/api-docs/index.html',
|
|
135
|
+
'https://matcher.waves.exchange/api-docs/index.html',
|
|
136
|
+
],
|
|
131
137
|
'www': 'https://wx.network',
|
|
132
138
|
},
|
|
133
139
|
'api': {
|
|
@@ -601,6 +607,7 @@ export default class wavesexchange extends Exchange {
|
|
|
601
607
|
* @method
|
|
602
608
|
* @name wavesexchange#fetchOrderBook
|
|
603
609
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
610
|
+
* @see https://matcher.waves.exchange/api-docs/index.html#/markets/getOrderBook
|
|
604
611
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
605
612
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
606
613
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -748,6 +755,7 @@ export default class wavesexchange extends Exchange {
|
|
|
748
755
|
* @method
|
|
749
756
|
* @name wavesexchange#signIn
|
|
750
757
|
* @description sign in, must be called prior to using other authenticated methods
|
|
758
|
+
* @see https://docs.wx.network/en/api/auth/oauth2-token
|
|
751
759
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
752
760
|
* @returns response from exchange
|
|
753
761
|
*/
|
|
@@ -861,6 +869,7 @@ export default class wavesexchange extends Exchange {
|
|
|
861
869
|
* @method
|
|
862
870
|
* @name wavesexchange#fetchTicker
|
|
863
871
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
872
|
+
* @see https://api.wavesplatform.com/v0/docs/#/pairs/getPairsListAll
|
|
864
873
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
865
874
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
866
875
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -904,7 +913,7 @@ export default class wavesexchange extends Exchange {
|
|
|
904
913
|
* @method
|
|
905
914
|
* @name wavesexchange#fetchTickers
|
|
906
915
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
907
|
-
* @param {string[]
|
|
916
|
+
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
908
917
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
909
918
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
910
919
|
*/
|
|
@@ -945,6 +954,7 @@ export default class wavesexchange extends Exchange {
|
|
|
945
954
|
* @method
|
|
946
955
|
* @name wavesexchange#fetchOHLCV
|
|
947
956
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
957
|
+
* @see https://api.wavesplatform.com/v0/docs/#/candles/getCandles
|
|
948
958
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
949
959
|
* @param {string} timeframe the length of time each candle represents
|
|
950
960
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -1279,6 +1289,7 @@ export default class wavesexchange extends Exchange {
|
|
|
1279
1289
|
* @method
|
|
1280
1290
|
* @name wavesexchange#createOrder
|
|
1281
1291
|
* @description create a trade order
|
|
1292
|
+
* @see https://matcher.waves.exchange/api-docs/index.html#/serialize/serializeOrder
|
|
1282
1293
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
1283
1294
|
* @param {string} type 'market' or 'limit'
|
|
1284
1295
|
* @param {string} side 'buy' or 'sell'
|
package/package.json
CHANGED