ccxt-ir 4.24.0 → 4.24.1
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.min.js +3 -3
- package/dist/cjs/ccxt.js +262 -262
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/src/abstract/balinex.js +1 -1
- package/dist/cjs/src/balinex.js +217 -217
- package/dist/cjs/src/bitbarg.js +322 -322
- package/dist/cjs/src/bitpin.js +34 -24
- package/dist/cjs/src/nobitex.js +25 -26
- package/dist/cjs/src/swapwallet.js +209 -209
- package/dist/cjs/src/wallex.js +105 -18
- package/js/ccxt.d.ts +772 -772
- package/js/ccxt.js +557 -557
- package/js/src/abstract/balinex.d.ts +8 -8
- package/js/src/abstract/balinex.js +5 -5
- package/js/src/abstract/swapwallet.js +5 -5
- package/js/src/abstract/wallex.d.ts +2 -0
- package/js/src/balinex.d.ts +20 -20
- package/js/src/balinex.js +220 -220
- package/js/src/base/Exchange.d.ts +926 -926
- package/js/src/bitbarg.js +325 -325
- package/js/src/bitpin.d.ts +2 -2
- package/js/src/bitpin.js +34 -24
- package/js/src/coinbaseexchange.d.ts +334 -334
- package/js/src/nobitex.d.ts +2 -2
- package/js/src/nobitex.js +25 -26
- package/js/src/protobuf/mexc/compiled.d.cts +2 -8
- package/js/src/static_dependencies/fflake/browser.d.ts +222 -222
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +101 -101
- package/js/src/static_dependencies/qs/formats.d.cts +8 -14
- package/js/src/static_dependencies/qs/index.d.cts +4 -10
- package/js/src/static_dependencies/qs/parse.d.cts +2 -8
- package/js/src/static_dependencies/qs/stringify.d.cts +2 -8
- package/js/src/static_dependencies/qs/utils.d.cts +9 -15
- package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +5 -5
- package/js/src/swapwallet.js +212 -212
- package/js/src/wallex.d.ts +2 -2
- package/js/src/wallex.js +105 -18
- package/js/test.js +51 -62
- package/package.json +1 -1
package/js/src/bitpin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/bitpin.js';
|
|
2
|
-
import { Int, Market, OHLCV, OrderBook, Strings, Ticker, Tickers } from './base/types.js';
|
|
2
|
+
import { Int, Market, MarketType, OHLCV, OrderBook, Strings, Ticker, Tickers } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class bitpin
|
|
5
5
|
* @augments Exchange
|
|
@@ -8,7 +8,7 @@ import { Int, Market, OHLCV, OrderBook, Strings, Ticker, Tickers } from './base/
|
|
|
8
8
|
export default class bitpin extends Exchange {
|
|
9
9
|
describe(): any;
|
|
10
10
|
fetchMarkets(params?: {}): Promise<Market[]>;
|
|
11
|
-
parseMarket(market: any): Market;
|
|
11
|
+
parseMarket(market: any, type?: MarketType): Market;
|
|
12
12
|
fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
|
|
13
13
|
fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
|
|
14
14
|
parseTicker(ticker: any, market?: Market): Ticker;
|
package/js/src/bitpin.js
CHANGED
|
@@ -80,6 +80,7 @@ export default class bitpin extends Exchange {
|
|
|
80
80
|
'fetchTradingFee': false,
|
|
81
81
|
'fetchTradingFees': false,
|
|
82
82
|
'fetchWithdrawals': false,
|
|
83
|
+
'otc': true,
|
|
83
84
|
'setLeverage': false,
|
|
84
85
|
'setMarginMode': false,
|
|
85
86
|
'transfer': false,
|
|
@@ -136,18 +137,23 @@ export default class bitpin extends Exchange {
|
|
|
136
137
|
* @description retrieves data on all markets for bitpin
|
|
137
138
|
* @see https://api-docs.bitpin.ir/#be8d9c51a2
|
|
138
139
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
140
|
+
* @param {string} [params.type] market type, 'spot' (default) or 'otc'
|
|
139
141
|
* @returns {object[]} an array of objects representing market data
|
|
140
142
|
*/
|
|
141
|
-
const
|
|
143
|
+
const type = this.safeString(params, 'type', 'spot');
|
|
144
|
+
const request = this.omit(params, ['type']);
|
|
145
|
+
const response = await this.publicGetV1MktMarkets(request);
|
|
142
146
|
const markets = this.safeList(response, 'results');
|
|
147
|
+
const tradableKey = (type === 'otc') ? 'otc_tradable' : 'tradable';
|
|
143
148
|
const result = [];
|
|
144
149
|
for (let i = 0; i < markets.length; i++) {
|
|
145
|
-
|
|
146
|
-
|
|
150
|
+
if (this.safeBool(markets[i], tradableKey, false)) {
|
|
151
|
+
result.push(this.parseMarket(markets[i], type));
|
|
152
|
+
}
|
|
147
153
|
}
|
|
148
154
|
return result;
|
|
149
155
|
}
|
|
150
|
-
parseMarket(market) {
|
|
156
|
+
parseMarket(market, type = 'spot') {
|
|
151
157
|
const id = this.safeString(market, 'id');
|
|
152
158
|
const baseCurrency = this.safeDict(market, 'currency1');
|
|
153
159
|
const quoteCurrency = this.safeDict(market, 'currency2');
|
|
@@ -157,6 +163,7 @@ export default class bitpin extends Exchange {
|
|
|
157
163
|
const quote = this.safeCurrencyCode(quoteId);
|
|
158
164
|
baseId = baseId.toLowerCase();
|
|
159
165
|
quoteId = quoteId.toLowerCase();
|
|
166
|
+
const tradableKey = (type === 'otc') ? 'otc_tradable' : 'tradable';
|
|
160
167
|
return {
|
|
161
168
|
'id': id,
|
|
162
169
|
'symbol': base + '/' + quote,
|
|
@@ -166,13 +173,13 @@ export default class bitpin extends Exchange {
|
|
|
166
173
|
'baseId': baseId,
|
|
167
174
|
'quoteId': quoteId,
|
|
168
175
|
'settleId': undefined,
|
|
169
|
-
'type':
|
|
170
|
-
'spot':
|
|
176
|
+
'type': type,
|
|
177
|
+
'spot': type === 'spot',
|
|
171
178
|
'margin': false,
|
|
172
179
|
'swap': false,
|
|
173
180
|
'future': false,
|
|
174
181
|
'option': false,
|
|
175
|
-
'active':
|
|
182
|
+
'active': this.safeBool(market, tradableKey, false),
|
|
176
183
|
'contract': false,
|
|
177
184
|
'linear': undefined,
|
|
178
185
|
'inverse': undefined,
|
|
@@ -215,19 +222,20 @@ export default class bitpin extends Exchange {
|
|
|
215
222
|
* @see https://api-docs.bitpin.ir/#be8d9c51a2
|
|
216
223
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
217
224
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
225
|
+
* @param {string} [params.type] market type, 'spot' (default) or 'otc'
|
|
218
226
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
219
227
|
*/
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
const response = await this.publicGetV1MktMarkets(params);
|
|
228
|
+
const type = this.safeString(params, 'type', 'spot');
|
|
229
|
+
const request = this.omit(params, ['type']);
|
|
230
|
+
await this.loadMarkets(false, { 'type': type });
|
|
231
|
+
const response = await this.publicGetV1MktMarkets(request);
|
|
225
232
|
const markets = this.safeList(response, 'results');
|
|
233
|
+
const tradableKey = (type === 'otc') ? 'otc_tradable' : 'tradable';
|
|
226
234
|
const result = {};
|
|
227
235
|
for (let i = 0; i < markets.length; i++) {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
const ticker = this.parseTicker(markets[i]);
|
|
236
|
+
if (this.safeBool(markets[i], tradableKey, false)) {
|
|
237
|
+
const market = this.parseMarket(markets[i], type);
|
|
238
|
+
const ticker = this.parseTicker(markets[i], market);
|
|
231
239
|
const symbol = ticker['symbol'];
|
|
232
240
|
result[symbol] = ticker;
|
|
233
241
|
}
|
|
@@ -242,9 +250,10 @@ export default class bitpin extends Exchange {
|
|
|
242
250
|
* @see https://api-docs.bitpin.ir/#be8d9c51a2
|
|
243
251
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
244
252
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
253
|
+
* @param {string} [params.type] market type, 'spot' (default) or 'otc'
|
|
245
254
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
246
255
|
*/
|
|
247
|
-
const ticker = await this.fetchTickers([symbol]);
|
|
256
|
+
const ticker = await this.fetchTickers([symbol], params);
|
|
248
257
|
return ticker[symbol];
|
|
249
258
|
}
|
|
250
259
|
parseTicker(ticker, market = undefined) {
|
|
@@ -361,16 +370,17 @@ export default class bitpin extends Exchange {
|
|
|
361
370
|
// 'popularity_weight': 0,
|
|
362
371
|
// 'freshness_weight': 0,
|
|
363
372
|
// }
|
|
364
|
-
const marketType = 'spot';
|
|
365
|
-
const
|
|
373
|
+
const marketType = this.safeString(market, 'type', 'spot');
|
|
374
|
+
const priceInfoKey = (marketType === 'otc') ? 'price_info' : 'order_book_info';
|
|
375
|
+
const priceInfo = this.safeDict(ticker, priceInfoKey, {});
|
|
366
376
|
const marketId = this.safeString(ticker, 'id');
|
|
367
377
|
const symbol = this.safeSymbol(marketId, market, undefined, marketType);
|
|
368
|
-
const high = this.safeFloat(priceInfo, 'max'
|
|
369
|
-
const low = this.safeFloat(priceInfo, 'min'
|
|
370
|
-
const last = this.safeFloat(priceInfo, 'price'
|
|
371
|
-
const change = this.safeFloat(priceInfo, 'change'
|
|
372
|
-
const baseVolume = this.safeFloat(priceInfo, 'amount'
|
|
373
|
-
const quoteVolume = this.safeFloat(priceInfo, 'value'
|
|
378
|
+
const high = this.safeFloat(priceInfo, 'max');
|
|
379
|
+
const low = this.safeFloat(priceInfo, 'min');
|
|
380
|
+
const last = this.safeFloat(priceInfo, 'price');
|
|
381
|
+
const change = this.safeFloat(priceInfo, 'change');
|
|
382
|
+
const baseVolume = this.safeFloat(priceInfo, 'amount');
|
|
383
|
+
const quoteVolume = this.safeFloat(priceInfo, 'value');
|
|
374
384
|
return this.safeTicker({
|
|
375
385
|
'symbol': symbol,
|
|
376
386
|
'timestamp': undefined,
|