ccxt-ir 4.12.4 → 4.13.0

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/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 { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketMarginModes, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, LongShortRatio, OrderBooks, OpenInterests, ConstructorArgs } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
7
- declare const version = "4.12.4";
7
+ declare const version = "4.13.0";
8
8
  import abantether from './src/abantether.js';
9
9
  import afratether from './src/afratether.js';
10
10
  import alpaca from './src/alpaca.js';
@@ -43,6 +43,7 @@ import bitteam from './src/bitteam.js';
43
43
  import bittrade from './src/bittrade.js';
44
44
  import bitunix from './src/bitunix.js';
45
45
  import bitvavo from './src/bitvavo.js';
46
+ import bitwana from './src/bitwana.js';
46
47
  import blockchaincom from './src/blockchaincom.js';
47
48
  import blofin from './src/blofin.js';
48
49
  import btcalpha from './src/btcalpha.js';
@@ -268,6 +269,7 @@ declare const exchanges: {
268
269
  bittrade: typeof bittrade;
269
270
  bitunix: typeof bitunix;
270
271
  bitvavo: typeof bitvavo;
272
+ bitwana: typeof bitwana;
271
273
  blockchaincom: typeof blockchaincom;
272
274
  blofin: typeof blofin;
273
275
  btcalpha: typeof btcalpha;
@@ -576,6 +578,7 @@ declare const ccxt: {
576
578
  bittrade: typeof bittrade;
577
579
  bitunix: typeof bitunix;
578
580
  bitvavo: typeof bitvavo;
581
+ bitwana: typeof bitwana;
579
582
  blockchaincom: typeof blockchaincom;
580
583
  blofin: typeof blofin;
581
584
  btcalpha: typeof btcalpha;
@@ -690,5 +693,5 @@ declare const ccxt: {
690
693
  zaif: typeof zaif;
691
694
  zonda: typeof zonda;
692
695
  } & typeof functions & typeof errors;
693
- export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError, Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, ConstructorArgs, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketMarginModes, MarketInterface, Trade, Order, OrderBook, OrderBooks, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, OpenInterests, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, LongShortRatio, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, abantether, afratether, alpaca, apex, arzinja, arzplus, ascendex, asretether, bequant, bidarz, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit24, bit2c, bitbank, bitbarg, bitbns, bitfinex, bitflyer, bitget, bithumb, bitimen, bitir, bitmart, bitmex, bitopro, bitpin, bitrue, bitso, bitstamp, bitteam, bittrade, bitunix, bitvavo, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, bydfi, cafearz, cex, changefa, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, defx, delta, deribit, derive, digifinex, ellipx, eterex, excoino, exir, exmo, exnovin, farhadexchange, fmfwio, foxbit, gate, gateio, gemini, hamtapay, hashkey, hibachi, hitbtc, hitobit, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, iranexchange, jibitex, kcex, kifpoolme, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, luno, mazdax, mercado, mexc, modetrade, myokx, ndax, nobitex, novadax, oceanex, okcoin, okexchange, okx, okxus, ompfinex, onetrading, ourbit, oxfun, p2b, paradex, paymium, phemex, pingi, poloniex, pooleno, probit, raastin, ramzinex, sarmayex, sarrafex, tabdeal, tehran_exchange, tetherland, timex, tokocrypto, toobit, tradeogre, twox, ubitex, upbit, vertex, wallex, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
696
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError, Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, ConstructorArgs, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketMarginModes, MarketInterface, Trade, Order, OrderBook, OrderBooks, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, OpenInterests, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, LongShortRatio, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, abantether, afratether, alpaca, apex, arzinja, arzplus, ascendex, asretether, bequant, bidarz, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit24, bit2c, bitbank, bitbarg, bitbns, bitfinex, bitflyer, bitget, bithumb, bitimen, bitir, bitmart, bitmex, bitopro, bitpin, bitrue, bitso, bitstamp, bitteam, bittrade, bitunix, bitvavo, bitwana, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, bydfi, cafearz, cex, changefa, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, defx, delta, deribit, derive, digifinex, ellipx, eterex, excoino, exir, exmo, exnovin, farhadexchange, fmfwio, foxbit, gate, gateio, gemini, hamtapay, hashkey, hibachi, hitbtc, hitobit, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, iranexchange, jibitex, kcex, kifpoolme, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, luno, mazdax, mercado, mexc, modetrade, myokx, ndax, nobitex, novadax, oceanex, okcoin, okexchange, okx, okxus, ompfinex, onetrading, ourbit, oxfun, p2b, paradex, paymium, phemex, pingi, poloniex, pooleno, probit, raastin, ramzinex, sarmayex, sarrafex, tabdeal, tehran_exchange, tetherland, timex, tokocrypto, toobit, tradeogre, twox, ubitex, upbit, vertex, wallex, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
694
697
  export default ccxt;
package/js/ccxt.js CHANGED
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
38
38
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.12.4';
41
+ const version = '4.13.0';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import abantether from './src/abantether.js';
@@ -79,6 +79,7 @@ import bitteam from './src/bitteam.js';
79
79
  import bittrade from './src/bittrade.js';
80
80
  import bitunix from './src/bitunix.js';
81
81
  import bitvavo from './src/bitvavo.js';
82
+ import bitwana from './src/bitwana.js';
82
83
  import blockchaincom from './src/blockchaincom.js';
83
84
  import blofin from './src/blofin.js';
84
85
  import btcalpha from './src/btcalpha.js';
@@ -305,6 +306,7 @@ const exchanges = {
305
306
  'bittrade': bittrade,
306
307
  'bitunix': bitunix,
307
308
  'bitvavo': bitvavo,
309
+ 'bitwana': bitwana,
308
310
  'blockchaincom': blockchaincom,
309
311
  'blofin': blofin,
310
312
  'btcalpha': btcalpha,
@@ -506,6 +508,6 @@ pro.exchanges = Object.keys(pro);
506
508
  pro['Exchange'] = Exchange; // now the same for rest and ts
507
509
  //-----------------------------------------------------------------------------
508
510
  const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
509
- export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError, abantether, afratether, alpaca, apex, arzinja, arzplus, ascendex, asretether, bequant, bidarz, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit24, bit2c, bitbank, bitbarg, bitbns, bitfinex, bitflyer, bitget, bithumb, bitimen, bitir, bitmart, bitmex, bitopro, bitpin, bitrue, bitso, bitstamp, bitteam, bittrade, bitunix, bitvavo, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, bydfi, cafearz, cex, changefa, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, defx, delta, deribit, derive, digifinex, ellipx, eterex, excoino, exir, exmo, exnovin, farhadexchange, fmfwio, foxbit, gate, gateio, gemini, hamtapay, hashkey, hibachi, hitbtc, hitobit, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, iranexchange, jibitex, kcex, kifpoolme, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, luno, mazdax, mercado, mexc, modetrade, myokx, ndax, nobitex, novadax, oceanex, okcoin, okexchange, okx, okxus, ompfinex, onetrading, ourbit, oxfun, p2b, paradex, paymium, phemex, pingi, poloniex, pooleno, probit, raastin, ramzinex, sarmayex, sarrafex, tabdeal, tehran_exchange, tetherland, timex, tokocrypto, toobit, tradeogre, twox, ubitex, upbit, vertex, wallex, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
511
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError, abantether, afratether, alpaca, apex, arzinja, arzplus, ascendex, asretether, bequant, bidarz, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit24, bit2c, bitbank, bitbarg, bitbns, bitfinex, bitflyer, bitget, bithumb, bitimen, bitir, bitmart, bitmex, bitopro, bitpin, bitrue, bitso, bitstamp, bitteam, bittrade, bitunix, bitvavo, bitwana, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, bydfi, cafearz, cex, changefa, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, defx, delta, deribit, derive, digifinex, ellipx, eterex, excoino, exir, exmo, exnovin, farhadexchange, fmfwio, foxbit, gate, gateio, gemini, hamtapay, hashkey, hibachi, hitbtc, hitobit, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, iranexchange, jibitex, kcex, kifpoolme, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, luno, mazdax, mercado, mexc, modetrade, myokx, ndax, nobitex, novadax, oceanex, okcoin, okexchange, okx, okxus, ompfinex, onetrading, ourbit, oxfun, p2b, paradex, paymium, phemex, pingi, poloniex, pooleno, probit, raastin, ramzinex, sarmayex, sarrafex, tabdeal, tehran_exchange, tetherland, timex, tokocrypto, toobit, tradeogre, twox, ubitex, upbit, vertex, wallex, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
510
512
  export default ccxt;
511
513
  //-----------------------------------------------------------------------------
@@ -0,0 +1,9 @@
1
+ import { implicitReturnType } from '../base/types.js';
2
+ import { Exchange as _Exchange } from '../base/Exchange.js';
3
+ interface Exchange {
4
+ publicGetApi1Markets(params?: {}): Promise<implicitReturnType>;
5
+ publicGetApi1MarketsId(params?: {}): Promise<implicitReturnType>;
6
+ }
7
+ declare abstract class Exchange extends _Exchange {
8
+ }
9
+ export default Exchange;
@@ -0,0 +1,11 @@
1
+ // ----------------------------------------------------------------------------
2
+
3
+ // PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
4
+ // https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
5
+ // EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
+
7
+ // -------------------------------------------------------------------------------
8
+ import { Exchange as _Exchange } from '../base/Exchange.js';
9
+ class Exchange extends _Exchange {
10
+ }
11
+ export default Exchange;
@@ -2,6 +2,7 @@ import { implicitReturnType } from '../base/types.js';
2
2
  import { Exchange as _Exchange } from '../base/Exchange.js';
3
3
  interface Exchange {
4
4
  publicGetFinancialApiMarket(params?: {}): Promise<implicitReturnType>;
5
+ publicGetFinancialApiVitrinPrices(params?: {}): Promise<implicitReturnType>;
5
6
  }
6
7
  declare abstract class Exchange extends _Exchange {
7
8
  }
@@ -0,0 +1,24 @@
1
+ import Exchange from './abstract/bitwana.js';
2
+ import { Market, Strings, Ticker, Tickers } from './base/types.js';
3
+ /**
4
+ * @class bitwana
5
+ * @augments Exchange
6
+ * @description Set rateLimit to 1000 if fully verified
7
+ */
8
+ export default class bitwana extends Exchange {
9
+ marketTypeToSymbol(base: string, quote: string, marketType?: string): string;
10
+ describe(): any;
11
+ parseSpotMarket(market: any): Market;
12
+ parseOtcMarket(market: any): Market;
13
+ fetchMarkets(params?: {}): Promise<Market[]>;
14
+ fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
15
+ fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
16
+ parseSpotTicker(ticker: any, market?: Market): Ticker;
17
+ parseOtcTicker(ticker: any, market?: Market): Ticker;
18
+ sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
19
+ url: string;
20
+ method: string;
21
+ body: any;
22
+ headers: any;
23
+ };
24
+ }
@@ -0,0 +1,419 @@
1
+ // ----------------------------------------------------------------------------
2
+
3
+ // PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
4
+ // https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
5
+ // EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
+
7
+ // ---------------------------------------------------------------------------
8
+ import Exchange from './abstract/bitwana.js';
9
+ // ---------------------------------------------------------------------------
10
+ /**
11
+ * @class bitwana
12
+ * @augments Exchange
13
+ * @description Set rateLimit to 1000 if fully verified
14
+ */
15
+ export default class bitwana extends Exchange {
16
+ marketTypeToSymbol(base, quote, marketType = 'spot') {
17
+ return base + '/' + quote;
18
+ }
19
+ describe() {
20
+ return this.deepExtend(super.describe(), {
21
+ 'id': 'bitwana',
22
+ 'name': 'Bitwana',
23
+ 'countries': ['IR'],
24
+ 'rateLimit': 1000,
25
+ 'version': '1',
26
+ 'certified': false,
27
+ 'pro': false,
28
+ 'has': {
29
+ 'CORS': undefined,
30
+ 'spot': true,
31
+ 'margin': false,
32
+ 'swap': false,
33
+ 'future': false,
34
+ 'option': false,
35
+ 'addMargin': false,
36
+ 'cancelAllOrders': false,
37
+ 'cancelOrder': false,
38
+ 'cancelOrders': false,
39
+ 'createDepositAddress': false,
40
+ 'createOrder': false,
41
+ 'createStopLimitOrder': false,
42
+ 'createStopMarketOrder': false,
43
+ 'createStopOrder': false,
44
+ 'editOrder': false,
45
+ 'fetchBalance': false,
46
+ 'fetchBorrowInterest': false,
47
+ 'fetchBorrowRateHistories': false,
48
+ 'fetchBorrowRateHistory': false,
49
+ 'fetchClosedOrders': false,
50
+ 'fetchCrossBorrowRate': false,
51
+ 'fetchCrossBorrowRates': false,
52
+ 'fetchCurrencies': false,
53
+ 'fetchDepositAddress': false,
54
+ 'fetchDeposits': false,
55
+ 'fetchFundingHistory': false,
56
+ 'fetchFundingRate': false,
57
+ 'fetchFundingRateHistory': false,
58
+ 'fetchFundingRates': false,
59
+ 'fetchIndexOHLCV': false,
60
+ 'fetchIsolatedBorrowRate': false,
61
+ 'fetchIsolatedBorrowRates': false,
62
+ 'fetchL2OrderBook': false,
63
+ 'fetchL3OrderBook': false,
64
+ 'fetchLedger': false,
65
+ 'fetchLedgerEntry': false,
66
+ 'fetchLeverageTiers': false,
67
+ 'fetchMarkets': true,
68
+ 'fetchMarkOHLCV': false,
69
+ 'fetchMyTrades': false,
70
+ 'fetchOHLCV': false,
71
+ 'fetchOpenInterestHistory': false,
72
+ 'fetchOpenOrders': false,
73
+ 'fetchOrder': false,
74
+ 'fetchOrderBook': false,
75
+ 'fetchOrders': false,
76
+ 'fetchOrderTrades': 'emulated',
77
+ 'fetchPositions': false,
78
+ 'fetchPremiumIndexOHLCV': false,
79
+ 'fetchTicker': true,
80
+ 'fetchTickers': true,
81
+ 'fetchTime': false,
82
+ 'fetchTrades': false,
83
+ 'fetchTradingFee': false,
84
+ 'fetchTradingFees': false,
85
+ 'fetchWithdrawals': false,
86
+ 'otc': true,
87
+ 'setLeverage': false,
88
+ 'setMarginMode': false,
89
+ 'transfer': false,
90
+ 'withdraw': false,
91
+ },
92
+ 'comment': 'This comment is optional',
93
+ 'urls': {
94
+ 'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/bitwana/64x64.png',
95
+ 'api': {
96
+ 'public': 'https://bitwana.com',
97
+ },
98
+ 'www': 'https://bitwana.com/',
99
+ 'doc': [
100
+ 'https://bitwana.com/',
101
+ ],
102
+ },
103
+ 'api': {
104
+ 'public': {
105
+ 'get': {
106
+ 'api/1/markets': 1,
107
+ 'api/1/markets/{id}': 1,
108
+ },
109
+ },
110
+ },
111
+ 'fees': {},
112
+ });
113
+ }
114
+ parseSpotMarket(market) {
115
+ // {
116
+ // "id": "BTC_IRT",
117
+ // "symbol": "بیت‌کوین-تومان",
118
+ // "base": "BTC",
119
+ // "quote": "IRT",
120
+ // "buyPrice": "10222846365",
121
+ // "sellPrice": "10233403625",
122
+ // "userOrderPricePrecision": 0,
123
+ // "quantityPrecision": 6,
124
+ // "minimumOrder": 100000,
125
+ // "maximumOrder": 300000000,
126
+ // "lastTradedPrice": "10249911984",
127
+ // "lowestPrice": "10063564406",
128
+ // "highestPrice": "10320391247",
129
+ // "sourceVolume": "0.036557",
130
+ // "destinationVolume": "371770611.78",
131
+ // "tradingEnabled": true,
132
+ // "otcEnabled": false,
133
+ // }
134
+ const id = this.safeString(market, 'id');
135
+ const baseId = this.safeString(market, 'base');
136
+ const quoteId = this.safeString(market, 'quote');
137
+ const base = this.safeCurrencyCode(baseId);
138
+ const quote = this.safeCurrencyCode(quoteId);
139
+ return {
140
+ 'id': id,
141
+ 'symbol': this.marketTypeToSymbol(base, quote, 'spot'),
142
+ 'base': base,
143
+ 'quote': quote,
144
+ 'settle': undefined,
145
+ 'baseId': baseId,
146
+ 'quoteId': quoteId,
147
+ 'settleId': undefined,
148
+ 'type': 'spot',
149
+ 'spot': true,
150
+ 'margin': false,
151
+ 'swap': false,
152
+ 'future': false,
153
+ 'option': false,
154
+ 'active': true,
155
+ 'contract': false,
156
+ 'linear': undefined,
157
+ 'inverse': undefined,
158
+ 'contractSize': undefined,
159
+ 'expiry': undefined,
160
+ 'expiryDatetime': undefined,
161
+ 'strike': undefined,
162
+ 'optionType': undefined,
163
+ 'precision': {
164
+ 'amount': this.safeInteger(market, 'quantityPrecision'),
165
+ 'price': this.safeInteger(market, 'userOrderPricePrecision'),
166
+ },
167
+ 'limits': {
168
+ 'leverage': {
169
+ 'min': undefined,
170
+ 'max': undefined,
171
+ },
172
+ 'amount': {
173
+ 'min': undefined,
174
+ 'max': undefined,
175
+ },
176
+ 'price': {
177
+ 'min': undefined,
178
+ 'max': undefined,
179
+ },
180
+ 'cost': {
181
+ 'min': this.safeNumber(market, 'minimumOrder'),
182
+ 'max': this.safeNumber(market, 'maximumOrder'),
183
+ },
184
+ },
185
+ 'created': undefined,
186
+ 'info': market,
187
+ };
188
+ }
189
+ parseOtcMarket(market) {
190
+ const rawId = this.safeString(market, 'id');
191
+ const baseId = this.safeString(market, 'base');
192
+ const quoteId = this.safeString(market, 'quote');
193
+ const base = this.safeCurrencyCode(baseId);
194
+ const quote = this.safeCurrencyCode(quoteId);
195
+ return {
196
+ 'id': rawId + '_OTC',
197
+ 'symbol': this.marketTypeToSymbol(base, quote, 'otc'),
198
+ 'base': base,
199
+ 'quote': quote,
200
+ 'settle': undefined,
201
+ 'baseId': baseId,
202
+ 'quoteId': quoteId,
203
+ 'settleId': undefined,
204
+ 'type': 'otc',
205
+ 'spot': false,
206
+ 'margin': false,
207
+ 'swap': false,
208
+ 'future': false,
209
+ 'option': false,
210
+ 'active': true,
211
+ 'contract': false,
212
+ 'linear': undefined,
213
+ 'inverse': undefined,
214
+ 'contractSize': undefined,
215
+ 'expiry': undefined,
216
+ 'expiryDatetime': undefined,
217
+ 'strike': undefined,
218
+ 'optionType': undefined,
219
+ 'precision': {
220
+ 'amount': this.safeInteger(market, 'quantityPrecision'),
221
+ 'price': this.safeInteger(market, 'userOrderPricePrecision'),
222
+ },
223
+ 'limits': {
224
+ 'leverage': {
225
+ 'min': undefined,
226
+ 'max': undefined,
227
+ },
228
+ 'amount': {
229
+ 'min': undefined,
230
+ 'max': undefined,
231
+ },
232
+ 'price': {
233
+ 'min': undefined,
234
+ 'max': undefined,
235
+ },
236
+ 'cost': {
237
+ 'min': this.safeNumber(market, 'minimumOrder'),
238
+ 'max': this.safeNumber(market, 'maximumOrder'),
239
+ },
240
+ },
241
+ 'created': undefined,
242
+ 'info': market,
243
+ };
244
+ }
245
+ async fetchMarkets(params = {}) {
246
+ /**
247
+ * @method
248
+ * @name bitwana#fetchMarkets
249
+ * @description retrieves data on all markets for bitwana
250
+ * @see https://bitwana.com/api/1/markets?with_price=true
251
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
252
+ * @returns {object[]} an array of objects representing market data
253
+ */
254
+ const marketType = this.safeString(params, 'type', 'spot');
255
+ const request = {
256
+ 'with_price': true,
257
+ };
258
+ const response = await this.publicGetApi1Markets(this.extend(request, params));
259
+ const markets = this.safeList(response, 'content', []);
260
+ const result = [];
261
+ for (let i = 0; i < markets.length; i++) {
262
+ const market = markets[i];
263
+ if (marketType === 'otc') {
264
+ result.push(this.parseOtcMarket(market));
265
+ }
266
+ else {
267
+ result.push(this.parseSpotMarket(market));
268
+ }
269
+ }
270
+ return result;
271
+ }
272
+ async fetchTickers(symbols = undefined, params = {}) {
273
+ /**
274
+ * @method
275
+ * @name bitwana#fetchTickers
276
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
277
+ * @see https://bitwana.com/api/1/markets?with_price=true
278
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
279
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
280
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
281
+ */
282
+ const marketType = this.safeString(params, 'type', 'spot');
283
+ await this.loadMarkets(false, { 'type': marketType });
284
+ if (symbols !== undefined) {
285
+ symbols = this.marketSymbols(symbols);
286
+ }
287
+ const request = {
288
+ 'with_price': true,
289
+ };
290
+ const response = await this.publicGetApi1Markets(this.extend(request, params));
291
+ const markets = this.safeList(response, 'content', []);
292
+ const result = {};
293
+ for (let i = 0; i < markets.length; i++) {
294
+ const market = markets[i];
295
+ if (marketType === 'otc') {
296
+ const otcTicker = this.parseOtcTicker(market);
297
+ result[otcTicker['symbol']] = otcTicker;
298
+ }
299
+ else {
300
+ const spotTicker = this.parseSpotTicker(market);
301
+ result[spotTicker['symbol']] = spotTicker;
302
+ }
303
+ }
304
+ return this.filterByArrayTickers(result, 'symbol', symbols);
305
+ }
306
+ async fetchTicker(symbol, params = {}) {
307
+ /**
308
+ * @method
309
+ * @name bitwana#fetchTicker
310
+ * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
311
+ * @see https://bitwana.com/api/1/markets/BTC_IRT?with_price=true
312
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
313
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
314
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
315
+ */
316
+ const marketType = this.safeString(params, 'type', 'spot');
317
+ await this.loadMarkets(false, { 'type': marketType });
318
+ const market = this.market(symbol);
319
+ const request = {
320
+ 'id': this.safeString(market['info'], 'id'),
321
+ 'with_price': true,
322
+ };
323
+ const response = await this.publicGetApi1MarketsId(this.extend(request, params));
324
+ const ticker = this.safeDict(response, 'content');
325
+ if (marketType === 'otc') {
326
+ return this.parseOtcTicker(ticker, market);
327
+ }
328
+ return this.parseSpotTicker(ticker, market);
329
+ }
330
+ parseSpotTicker(ticker, market = undefined) {
331
+ const baseId = this.safeString(ticker, 'base');
332
+ const quoteId = this.safeString(ticker, 'quote');
333
+ const base = this.safeCurrencyCode(baseId);
334
+ const quote = this.safeCurrencyCode(quoteId);
335
+ let symbol = this.marketTypeToSymbol(base, quote, 'spot');
336
+ if (market !== undefined) {
337
+ symbol = market['symbol'];
338
+ }
339
+ const high = this.safeNumber(ticker, 'highestPrice');
340
+ const low = this.safeNumber(ticker, 'lowestPrice');
341
+ const bid = this.safeNumber(ticker, 'buyPrice');
342
+ const ask = this.safeNumber(ticker, 'sellPrice');
343
+ const last = this.safeNumber(ticker, 'lastTradedPrice');
344
+ const change = this.safeNumber(ticker, 'changePrice');
345
+ const percentage = this.safeNumber(ticker, 'changeRate');
346
+ const baseVolume = this.safeNumber(ticker, 'sourceVolume');
347
+ const quoteVolume = this.safeNumber(ticker, 'destinationVolume');
348
+ return this.safeTicker({
349
+ 'symbol': symbol,
350
+ 'timestamp': undefined,
351
+ 'datetime': undefined,
352
+ 'high': high,
353
+ 'low': low,
354
+ 'bid': bid,
355
+ 'bidVolume': undefined,
356
+ 'ask': ask,
357
+ 'askVolume': undefined,
358
+ 'vwap': undefined,
359
+ 'open': undefined,
360
+ 'close': last,
361
+ 'last': last,
362
+ 'previousClose': undefined,
363
+ 'change': change,
364
+ 'percentage': percentage,
365
+ 'average': undefined,
366
+ 'baseVolume': baseVolume,
367
+ 'quoteVolume': quoteVolume,
368
+ 'info': ticker,
369
+ }, market);
370
+ }
371
+ parseOtcTicker(ticker, market = undefined) {
372
+ const baseId = this.safeString(ticker, 'base');
373
+ const quoteId = this.safeString(ticker, 'quote');
374
+ const base = this.safeCurrencyCode(baseId);
375
+ const quote = this.safeCurrencyCode(quoteId);
376
+ let symbol = this.marketTypeToSymbol(base, quote, 'otc');
377
+ if (market !== undefined) {
378
+ symbol = market['symbol'];
379
+ }
380
+ const high = this.safeNumber(ticker, 'highestPrice');
381
+ const low = this.safeNumber(ticker, 'lowestPrice');
382
+ const bid = this.safeNumber(ticker, 'buyPrice');
383
+ const ask = this.safeNumber(ticker, 'sellPrice');
384
+ const last = this.safeNumber(ticker, 'lastTradedPrice');
385
+ const change = this.safeNumber(ticker, 'changePrice');
386
+ const percentage = this.safeNumber(ticker, 'changeRate');
387
+ return this.safeTicker({
388
+ 'symbol': symbol,
389
+ 'timestamp': undefined,
390
+ 'datetime': undefined,
391
+ 'high': high,
392
+ 'low': low,
393
+ 'bid': bid,
394
+ 'bidVolume': undefined,
395
+ 'ask': ask,
396
+ 'askVolume': undefined,
397
+ 'vwap': undefined,
398
+ 'open': undefined,
399
+ 'close': last,
400
+ 'last': last,
401
+ 'previousClose': undefined,
402
+ 'change': change,
403
+ 'percentage': percentage,
404
+ 'average': undefined,
405
+ 'baseVolume': undefined,
406
+ 'quoteVolume': undefined,
407
+ 'info': ticker,
408
+ }, market);
409
+ }
410
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
411
+ const query = this.omit(params, this.extractParams(path));
412
+ let url = this.urls['api'][api] + '/' + this.implodeParams(path, params);
413
+ if (Object.keys(query).length) {
414
+ url += '?' + this.urlencode(query);
415
+ }
416
+ headers = { 'Content-Type': 'application/json' };
417
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
418
+ }
419
+ }