ccxt-ir 4.18.1 → 4.20.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/README.md +4 -4
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +7 -1
- package/dist/cjs/src/baazar.js +8 -4
- package/dist/cjs/src/daric.js +11 -5
- package/dist/cjs/src/digikalagold.js +2 -2
- package/dist/cjs/src/gerami.js +180 -0
- package/dist/cjs/src/goldika.js +6 -2
- package/dist/cjs/src/hamrahgold.js +8 -4
- package/dist/cjs/src/melligold.js +11 -4
- package/dist/cjs/src/ramzinex.js +5 -2
- package/dist/cjs/src/talapp.js +10 -4
- package/dist/cjs/src/technogold.js +8 -4
- package/dist/cjs/src/wallgold.js +6 -2
- package/dist/cjs/src/zarafza.js +8 -4
- package/dist/cjs/src/zarminex.js +5 -5
- package/dist/cjs/src/zarniv.js +8 -5
- package/dist/cjs/src/zarpin.js +185 -0
- package/js/ccxt.d.ts +8 -2
- package/js/ccxt.js +6 -2
- package/js/src/abstract/gerami.d.ts +8 -0
- package/js/src/abstract/gerami.js +11 -0
- package/js/src/abstract/zarpin.d.ts +8 -0
- package/js/src/abstract/zarpin.js +11 -0
- package/js/src/baazar.js +8 -4
- package/js/src/daric.js +11 -5
- package/js/src/digikalagold.js +2 -2
- package/js/src/gerami.d.ts +20 -0
- package/js/src/gerami.js +179 -0
- package/js/src/goldika.js +6 -2
- package/js/src/hamrahgold.js +8 -4
- package/js/src/melligold.js +11 -4
- package/js/src/ramzinex.js +5 -2
- package/js/src/talapp.js +10 -4
- package/js/src/technogold.js +8 -4
- package/js/src/wallgold.js +6 -2
- package/js/src/zarafza.js +8 -4
- package/js/src/zarminex.js +5 -5
- package/js/src/zarniv.js +8 -5
- package/js/src/zarpin.d.ts +21 -0
- package/js/src/zarpin.js +184 -0
- package/js/test.js +49 -48
- package/package.json +1 -1
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var Exchange = require('./base/Exchange.js');
|
|
6
|
+
|
|
7
|
+
// ----------------------------------------------------------------------------
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
/**
|
|
10
|
+
* @class zarpin
|
|
11
|
+
* @augments Exchange
|
|
12
|
+
*/
|
|
13
|
+
class zarpin extends Exchange["default"] {
|
|
14
|
+
describe() {
|
|
15
|
+
return this.deepExtend(super.describe(), {
|
|
16
|
+
'id': 'zarpin',
|
|
17
|
+
'name': 'Zarpin',
|
|
18
|
+
'countries': ['IR'],
|
|
19
|
+
'rateLimit': 1000,
|
|
20
|
+
'version': 'v1',
|
|
21
|
+
'certified': false,
|
|
22
|
+
'pro': false,
|
|
23
|
+
'has': {
|
|
24
|
+
'CORS': undefined,
|
|
25
|
+
'spot': false,
|
|
26
|
+
'margin': false,
|
|
27
|
+
'swap': false,
|
|
28
|
+
'future': false,
|
|
29
|
+
'option': false,
|
|
30
|
+
'fetchMarkets': true,
|
|
31
|
+
'fetchTicker': true,
|
|
32
|
+
'fetchTickers': true,
|
|
33
|
+
'otc': true,
|
|
34
|
+
},
|
|
35
|
+
'options': {
|
|
36
|
+
'defaultType': 'otc',
|
|
37
|
+
},
|
|
38
|
+
'urls': {
|
|
39
|
+
'api': {
|
|
40
|
+
'public': 'https://api-khazaneh.zarpin.com',
|
|
41
|
+
},
|
|
42
|
+
'www': 'https://zarpin.com',
|
|
43
|
+
'doc': 'https://api-khazaneh.zarpin.com/v1/prc/prices',
|
|
44
|
+
},
|
|
45
|
+
'api': {
|
|
46
|
+
'public': {
|
|
47
|
+
'get': {
|
|
48
|
+
'v1/prc/prices': 1,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
async fetchMarkets(params = {}) {
|
|
55
|
+
const response = await this.publicGetV1PrcPrices(params);
|
|
56
|
+
return this.parseMarkets(response);
|
|
57
|
+
}
|
|
58
|
+
parseMarkets(response) {
|
|
59
|
+
let prices = [];
|
|
60
|
+
if (Array.isArray(response)) {
|
|
61
|
+
prices = response;
|
|
62
|
+
}
|
|
63
|
+
const result = [];
|
|
64
|
+
for (let i = 0; i < prices.length; i++) {
|
|
65
|
+
const price = prices[i];
|
|
66
|
+
const code = this.safeString(price, 'code');
|
|
67
|
+
if (code === 'GOLD_IRT' || code === 'SILVER_IRT') {
|
|
68
|
+
result.push(this.parseMarket(price));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
parseMarket(market) {
|
|
74
|
+
const code = this.safeString(market, 'code');
|
|
75
|
+
let base = 'XAG-1G';
|
|
76
|
+
if (code === 'GOLD_IRT') {
|
|
77
|
+
base = 'XAU18';
|
|
78
|
+
}
|
|
79
|
+
const quote = 'IRT';
|
|
80
|
+
return {
|
|
81
|
+
'id': code,
|
|
82
|
+
'symbol': base + '/' + quote,
|
|
83
|
+
'base': base,
|
|
84
|
+
'quote': quote,
|
|
85
|
+
'settle': undefined,
|
|
86
|
+
'baseId': code,
|
|
87
|
+
'quoteId': quote,
|
|
88
|
+
'settleId': undefined,
|
|
89
|
+
'type': 'otc',
|
|
90
|
+
'spot': false,
|
|
91
|
+
'margin': false,
|
|
92
|
+
'swap': false,
|
|
93
|
+
'future': false,
|
|
94
|
+
'option': false,
|
|
95
|
+
'active': this.safeNumber(market, 'price') !== undefined,
|
|
96
|
+
'contract': false,
|
|
97
|
+
'linear': undefined,
|
|
98
|
+
'inverse': undefined,
|
|
99
|
+
'contractSize': undefined,
|
|
100
|
+
'expiry': undefined,
|
|
101
|
+
'expiryDatetime': undefined,
|
|
102
|
+
'strike': undefined,
|
|
103
|
+
'optionType': undefined,
|
|
104
|
+
'precision': {
|
|
105
|
+
'amount': undefined,
|
|
106
|
+
'price': undefined,
|
|
107
|
+
},
|
|
108
|
+
'limits': {
|
|
109
|
+
'leverage': { 'min': undefined, 'max': undefined },
|
|
110
|
+
'amount': { 'min': undefined, 'max': undefined },
|
|
111
|
+
'price': { 'min': undefined, 'max': undefined },
|
|
112
|
+
'cost': { 'min': undefined, 'max': undefined },
|
|
113
|
+
},
|
|
114
|
+
'created': undefined,
|
|
115
|
+
'info': market,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
async fetchTicker(symbol, params = {}) {
|
|
119
|
+
await this.loadMarkets();
|
|
120
|
+
const market = this.market(symbol);
|
|
121
|
+
const response = await this.publicGetV1PrcPrices(params);
|
|
122
|
+
return this.parseTicker(response, market);
|
|
123
|
+
}
|
|
124
|
+
async fetchTickers(symbols = undefined, params = {}) {
|
|
125
|
+
await this.loadMarkets();
|
|
126
|
+
if (symbols !== undefined) {
|
|
127
|
+
symbols = this.marketSymbols(symbols);
|
|
128
|
+
}
|
|
129
|
+
const response = await this.publicGetV1PrcPrices(params);
|
|
130
|
+
const markets = this.parseMarkets(response);
|
|
131
|
+
const result = {};
|
|
132
|
+
for (let i = 0; i < markets.length; i++) {
|
|
133
|
+
const ticker = this.parseTicker(response, markets[i]);
|
|
134
|
+
result[ticker['symbol']] = ticker;
|
|
135
|
+
}
|
|
136
|
+
return this.filterByArrayTickers(result, 'symbol', symbols);
|
|
137
|
+
}
|
|
138
|
+
parseTicker(response, market = undefined) {
|
|
139
|
+
let prices = [];
|
|
140
|
+
if (Array.isArray(response)) {
|
|
141
|
+
prices = response;
|
|
142
|
+
}
|
|
143
|
+
let price = {};
|
|
144
|
+
for (let i = 0; i < prices.length; i++) {
|
|
145
|
+
const entry = prices[i];
|
|
146
|
+
if (this.safeString(entry, 'code') === market['baseId']) {
|
|
147
|
+
price = entry;
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return this.safeTicker({
|
|
152
|
+
'symbol': market['symbol'],
|
|
153
|
+
'timestamp': undefined,
|
|
154
|
+
'datetime': undefined,
|
|
155
|
+
'high': this.safeNumber(price, 'max_24h_price'),
|
|
156
|
+
'low': this.safeNumber(price, 'min_24h_price'),
|
|
157
|
+
'bid': this.safeNumber(price, 'price'),
|
|
158
|
+
'bidVolume': undefined,
|
|
159
|
+
'ask': this.safeNumber(price, 'price'),
|
|
160
|
+
'askVolume': undefined,
|
|
161
|
+
'vwap': undefined,
|
|
162
|
+
'open': this.safeNumber(price, 'price_at_in_last_24h'),
|
|
163
|
+
'close': this.safeNumber(price, 'price'),
|
|
164
|
+
'last': this.safeNumber(price, 'price'),
|
|
165
|
+
'previousClose': this.safeNumber(price, 'price_at_in_last_24h'),
|
|
166
|
+
'change': undefined,
|
|
167
|
+
'percentage': this.safeNumber(price, 'price_change_24h'),
|
|
168
|
+
'average': undefined,
|
|
169
|
+
'baseVolume': undefined,
|
|
170
|
+
'quoteVolume': undefined,
|
|
171
|
+
'info': price,
|
|
172
|
+
}, market);
|
|
173
|
+
}
|
|
174
|
+
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
175
|
+
let url = this.urls['api'][api] + '/' + this.implodeParams(path, params);
|
|
176
|
+
const query = this.omit(params, this.extractParams(path));
|
|
177
|
+
if (Object.keys(query).length) {
|
|
178
|
+
url += '?' + this.urlencode(query);
|
|
179
|
+
}
|
|
180
|
+
headers = { 'Accept': 'application/json' };
|
|
181
|
+
return { 'url': url, 'method': method, 'body': body, 'headers': headers };
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
exports["default"] = zarpin;
|
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.
|
|
7
|
+
declare const version = "4.20.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';
|
|
@@ -90,6 +90,7 @@ import foxbit from './src/foxbit.js';
|
|
|
90
90
|
import gate from './src/gate.js';
|
|
91
91
|
import gateio from './src/gateio.js';
|
|
92
92
|
import gemini from './src/gemini.js';
|
|
93
|
+
import gerami from './src/gerami.js';
|
|
93
94
|
import goldika from './src/goldika.js';
|
|
94
95
|
import goldis from './src/goldis.js';
|
|
95
96
|
import hamrahgold from './src/hamrahgold.js';
|
|
@@ -174,6 +175,7 @@ import zaif from './src/zaif.js';
|
|
|
174
175
|
import zarafza from './src/zarafza.js';
|
|
175
176
|
import zarminex from './src/zarminex.js';
|
|
176
177
|
import zarniv from './src/zarniv.js';
|
|
178
|
+
import zarpin from './src/zarpin.js';
|
|
177
179
|
import zonda from './src/zonda.js';
|
|
178
180
|
import alpacaPro from './src/pro/alpaca.js';
|
|
179
181
|
import apexPro from './src/pro/apex.js';
|
|
@@ -334,6 +336,7 @@ declare const exchanges: {
|
|
|
334
336
|
gate: typeof gate;
|
|
335
337
|
gateio: typeof gateio;
|
|
336
338
|
gemini: typeof gemini;
|
|
339
|
+
gerami: typeof gerami;
|
|
337
340
|
goldika: typeof goldika;
|
|
338
341
|
goldis: typeof goldis;
|
|
339
342
|
hamrahgold: typeof hamrahgold;
|
|
@@ -418,6 +421,7 @@ declare const exchanges: {
|
|
|
418
421
|
zarafza: typeof zarafza;
|
|
419
422
|
zarminex: typeof zarminex;
|
|
420
423
|
zarniv: typeof zarniv;
|
|
424
|
+
zarpin: typeof zarpin;
|
|
421
425
|
zonda: typeof zonda;
|
|
422
426
|
};
|
|
423
427
|
declare const pro: {
|
|
@@ -661,6 +665,7 @@ declare const ccxt: {
|
|
|
661
665
|
gate: typeof gate;
|
|
662
666
|
gateio: typeof gateio;
|
|
663
667
|
gemini: typeof gemini;
|
|
668
|
+
gerami: typeof gerami;
|
|
664
669
|
goldika: typeof goldika;
|
|
665
670
|
goldis: typeof goldis;
|
|
666
671
|
hamrahgold: typeof hamrahgold;
|
|
@@ -745,7 +750,8 @@ declare const ccxt: {
|
|
|
745
750
|
zarafza: typeof zarafza;
|
|
746
751
|
zarminex: typeof zarminex;
|
|
747
752
|
zarniv: typeof zarniv;
|
|
753
|
+
zarpin: typeof zarpin;
|
|
748
754
|
zonda: typeof zonda;
|
|
749
755
|
} & typeof functions & typeof errors;
|
|
750
|
-
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, asacoine, ascendex, asretether, baazar, 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, daric, defx, delta, deribit, derive, digifinex, digikalagold, ellipx, eterex, excoino, exir, exmo, exnovin, farhadexchange, fmfwio, foxbit, gate, gateio, gemini, goldika, goldis, hamrahgold, hamtapay, hashkey, hibachi, hitbtc, hitobit, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, iranexchange, jibitex, kcex, kifpoolme, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, luno, mazdax, melligold, mercado, mexc, milligold, modetrade, myokx, ndax, nobitex, novadax, oceanex, okcoin, okexchange, okx, okxus, ompfinex, onetrading, ourbit, oxfun, p2b, paradex, paymium, phemex, pingi, poloniex, pooleno, probit, raastin, ramzinex, saraf, sarmayex, sarrafex, tabdeal, talaavan, talapp, talasea, technogold, tehran_exchange, tetherland, timex, tokocrypto, toobit, tradeogre, twox, ubitex, upbit, vertex, wallex, wallgold, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zarafza, zarminex, zarniv, zonda, };
|
|
756
|
+
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, asacoine, ascendex, asretether, baazar, 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, daric, defx, delta, deribit, derive, digifinex, digikalagold, ellipx, eterex, excoino, exir, exmo, exnovin, farhadexchange, fmfwio, foxbit, gate, gateio, gemini, gerami, goldika, goldis, hamrahgold, hamtapay, hashkey, hibachi, hitbtc, hitobit, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, iranexchange, jibitex, kcex, kifpoolme, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, luno, mazdax, melligold, mercado, mexc, milligold, modetrade, myokx, ndax, nobitex, novadax, oceanex, okcoin, okexchange, okx, okxus, ompfinex, onetrading, ourbit, oxfun, p2b, paradex, paymium, phemex, pingi, poloniex, pooleno, probit, raastin, ramzinex, saraf, sarmayex, sarrafex, tabdeal, talaavan, talapp, talasea, technogold, tehran_exchange, tetherland, timex, tokocrypto, toobit, tradeogre, twox, ubitex, upbit, vertex, wallex, wallgold, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zarafza, zarminex, zarniv, zarpin, zonda, };
|
|
751
757
|
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.
|
|
41
|
+
const version = '4.20.0';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import abantether from './src/abantether.js';
|
|
@@ -126,6 +126,7 @@ import foxbit from './src/foxbit.js';
|
|
|
126
126
|
import gate from './src/gate.js';
|
|
127
127
|
import gateio from './src/gateio.js';
|
|
128
128
|
import gemini from './src/gemini.js';
|
|
129
|
+
import gerami from './src/gerami.js';
|
|
129
130
|
import goldika from './src/goldika.js';
|
|
130
131
|
import goldis from './src/goldis.js';
|
|
131
132
|
import hamrahgold from './src/hamrahgold.js';
|
|
@@ -210,6 +211,7 @@ import zaif from './src/zaif.js';
|
|
|
210
211
|
import zarafza from './src/zarafza.js';
|
|
211
212
|
import zarminex from './src/zarminex.js';
|
|
212
213
|
import zarniv from './src/zarniv.js';
|
|
214
|
+
import zarpin from './src/zarpin.js';
|
|
213
215
|
import zonda from './src/zonda.js';
|
|
214
216
|
// pro exchanges
|
|
215
217
|
import alpacaPro from './src/pro/alpaca.js';
|
|
@@ -371,6 +373,7 @@ const exchanges = {
|
|
|
371
373
|
'gate': gate,
|
|
372
374
|
'gateio': gateio,
|
|
373
375
|
'gemini': gemini,
|
|
376
|
+
'gerami': gerami,
|
|
374
377
|
'goldika': goldika,
|
|
375
378
|
'goldis': goldis,
|
|
376
379
|
'hamrahgold': hamrahgold,
|
|
@@ -455,6 +458,7 @@ const exchanges = {
|
|
|
455
458
|
'zarafza': zarafza,
|
|
456
459
|
'zarminex': zarminex,
|
|
457
460
|
'zarniv': zarniv,
|
|
461
|
+
'zarpin': zarpin,
|
|
458
462
|
'zonda': zonda,
|
|
459
463
|
};
|
|
460
464
|
const pro = {
|
|
@@ -544,6 +548,6 @@ pro.exchanges = Object.keys(pro);
|
|
|
544
548
|
pro['Exchange'] = Exchange; // now the same for rest and ts
|
|
545
549
|
//-----------------------------------------------------------------------------
|
|
546
550
|
const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
|
|
547
|
-
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, asacoine, ascendex, asretether, baazar, 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, daric, defx, delta, deribit, derive, digifinex, digikalagold, ellipx, eterex, excoino, exir, exmo, exnovin, farhadexchange, fmfwio, foxbit, gate, gateio, gemini, goldika, goldis, hamrahgold, hamtapay, hashkey, hibachi, hitbtc, hitobit, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, iranexchange, jibitex, kcex, kifpoolme, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, luno, mazdax, melligold, mercado, mexc, milligold, modetrade, myokx, ndax, nobitex, novadax, oceanex, okcoin, okexchange, okx, okxus, ompfinex, onetrading, ourbit, oxfun, p2b, paradex, paymium, phemex, pingi, poloniex, pooleno, probit, raastin, ramzinex, saraf, sarmayex, sarrafex, tabdeal, talaavan, talapp, talasea, technogold, tehran_exchange, tetherland, timex, tokocrypto, toobit, tradeogre, twox, ubitex, upbit, vertex, wallex, wallgold, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zarafza, zarminex, zarniv, zonda, };
|
|
551
|
+
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, asacoine, ascendex, asretether, baazar, 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, daric, defx, delta, deribit, derive, digifinex, digikalagold, ellipx, eterex, excoino, exir, exmo, exnovin, farhadexchange, fmfwio, foxbit, gate, gateio, gemini, gerami, goldika, goldis, hamrahgold, hamtapay, hashkey, hibachi, hitbtc, hitobit, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, iranexchange, jibitex, kcex, kifpoolme, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, luno, mazdax, melligold, mercado, mexc, milligold, modetrade, myokx, ndax, nobitex, novadax, oceanex, okcoin, okexchange, okx, okxus, ompfinex, onetrading, ourbit, oxfun, p2b, paradex, paymium, phemex, pingi, poloniex, pooleno, probit, raastin, ramzinex, saraf, sarmayex, sarrafex, tabdeal, talaavan, talapp, talasea, technogold, tehran_exchange, tetherland, timex, tokocrypto, toobit, tradeogre, twox, ubitex, upbit, vertex, wallex, wallgold, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zarafza, zarminex, zarniv, zarpin, zonda, };
|
|
548
552
|
export default ccxt;
|
|
549
553
|
//-----------------------------------------------------------------------------
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { implicitReturnType } from '../base/types.js';
|
|
2
|
+
import { Exchange as _Exchange } from '../base/Exchange.js';
|
|
3
|
+
interface Exchange {
|
|
4
|
+
publicGetPairsPair(params?: {}): Promise<implicitReturnType>;
|
|
5
|
+
}
|
|
6
|
+
declare abstract class Exchange extends _Exchange {
|
|
7
|
+
}
|
|
8
|
+
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;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { implicitReturnType } from '../base/types.js';
|
|
2
|
+
import { Exchange as _Exchange } from '../base/Exchange.js';
|
|
3
|
+
interface Exchange {
|
|
4
|
+
publicGetV1PrcPrices(params?: {}): Promise<implicitReturnType>;
|
|
5
|
+
}
|
|
6
|
+
declare abstract class Exchange extends _Exchange {
|
|
7
|
+
}
|
|
8
|
+
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;
|
package/js/src/baazar.js
CHANGED
|
@@ -116,14 +116,18 @@ export default class baazar extends Exchange {
|
|
|
116
116
|
}
|
|
117
117
|
parseTicker(response, market = undefined) {
|
|
118
118
|
const data = this.safeDict(response, 'data', {});
|
|
119
|
-
let bid = this.safeNumber(data, '
|
|
120
|
-
let ask = this.safeNumber(data, '
|
|
119
|
+
let bid = this.safeNumber(data, 'buyPrice');
|
|
120
|
+
let ask = this.safeNumber(data, 'sellPrice');
|
|
121
121
|
if (bid !== undefined) {
|
|
122
122
|
bid = bid / 10;
|
|
123
123
|
}
|
|
124
124
|
if (ask !== undefined) {
|
|
125
125
|
ask = ask / 10;
|
|
126
126
|
}
|
|
127
|
+
let last = bid;
|
|
128
|
+
if (ask !== undefined && (last === undefined || ask > last)) {
|
|
129
|
+
last = ask;
|
|
130
|
+
}
|
|
127
131
|
return this.safeTicker({
|
|
128
132
|
'symbol': market['symbol'],
|
|
129
133
|
'timestamp': this.safeInteger(data, 'currentTime'),
|
|
@@ -136,8 +140,8 @@ export default class baazar extends Exchange {
|
|
|
136
140
|
'askVolume': undefined,
|
|
137
141
|
'vwap': undefined,
|
|
138
142
|
'open': undefined,
|
|
139
|
-
'close':
|
|
140
|
-
'last':
|
|
143
|
+
'close': last,
|
|
144
|
+
'last': last,
|
|
141
145
|
'previousClose': undefined,
|
|
142
146
|
'change': undefined,
|
|
143
147
|
'percentage': undefined,
|
package/js/src/daric.js
CHANGED
|
@@ -76,7 +76,7 @@ export default class daric extends Exchange {
|
|
|
76
76
|
}
|
|
77
77
|
parseMarket(market) {
|
|
78
78
|
const baseId = this.safeString(market, 'destinationCoinSymbol');
|
|
79
|
-
let base = 'XAG';
|
|
79
|
+
let base = 'XAG-1G';
|
|
80
80
|
if (baseId === 'GOLD18') {
|
|
81
81
|
base = 'XAU18';
|
|
82
82
|
}
|
|
@@ -145,20 +145,26 @@ export default class daric extends Exchange {
|
|
|
145
145
|
markets = response;
|
|
146
146
|
}
|
|
147
147
|
const ticker = this.filterBy(markets, 'destinationCoinSymbol', market['baseId'])[0];
|
|
148
|
+
const bid = this.safeNumber(ticker, 'bestSell');
|
|
149
|
+
const ask = this.safeNumber(ticker, 'bestBuy');
|
|
150
|
+
let last = bid;
|
|
151
|
+
if (ask !== undefined && (last === undefined || ask > last)) {
|
|
152
|
+
last = ask;
|
|
153
|
+
}
|
|
148
154
|
return this.safeTicker({
|
|
149
155
|
'symbol': market['symbol'],
|
|
150
156
|
'timestamp': undefined,
|
|
151
157
|
'datetime': undefined,
|
|
152
158
|
'high': this.safeNumber(ticker, 'highestRecentOrder'),
|
|
153
159
|
'low': this.safeNumber(ticker, 'lowestRecentOrder'),
|
|
154
|
-
'bid':
|
|
160
|
+
'bid': bid,
|
|
155
161
|
'bidVolume': undefined,
|
|
156
|
-
'ask':
|
|
162
|
+
'ask': ask,
|
|
157
163
|
'askVolume': undefined,
|
|
158
164
|
'vwap': undefined,
|
|
159
165
|
'open': undefined,
|
|
160
|
-
'close':
|
|
161
|
-
'last':
|
|
166
|
+
'close': last,
|
|
167
|
+
'last': last,
|
|
162
168
|
'previousClose': undefined,
|
|
163
169
|
'change': undefined,
|
|
164
170
|
'percentage': this.safeNumber(ticker, 'change'),
|
package/js/src/digikalagold.js
CHANGED
|
@@ -70,7 +70,7 @@ export default class digikalagold extends Exchange {
|
|
|
70
70
|
}
|
|
71
71
|
parseMarketEntry(response, id) {
|
|
72
72
|
const isGold = id === 'gold18';
|
|
73
|
-
let base = 'XAG';
|
|
73
|
+
let base = 'XAG-1G';
|
|
74
74
|
if (isGold) {
|
|
75
75
|
base = 'XAU18';
|
|
76
76
|
}
|
|
@@ -127,7 +127,7 @@ export default class digikalagold extends Exchange {
|
|
|
127
127
|
}
|
|
128
128
|
const response = await this.fetchPrice(params);
|
|
129
129
|
const result = {};
|
|
130
|
-
const marketSymbols = ['XAU18/IRT', 'XAG/IRT'];
|
|
130
|
+
const marketSymbols = ['XAU18/IRT', 'XAG-1G/IRT'];
|
|
131
131
|
for (let i = 0; i < marketSymbols.length; i++) {
|
|
132
132
|
const symbol = marketSymbols[i];
|
|
133
133
|
const market = this.market(symbol);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Exchange from './base/Exchange.js';
|
|
2
|
+
import { Market, Strings, Ticker, Tickers } from './base/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* @class gerami
|
|
5
|
+
* @augments Exchange
|
|
6
|
+
*/
|
|
7
|
+
export default class gerami extends Exchange {
|
|
8
|
+
describe(): any;
|
|
9
|
+
fetchMarkets(params?: {}): Promise<Market[]>;
|
|
10
|
+
parseMarket(response: any): Market;
|
|
11
|
+
fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
|
|
12
|
+
fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
|
|
13
|
+
parseTicker(response: any, market?: Market): Ticker;
|
|
14
|
+
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
15
|
+
url: string;
|
|
16
|
+
method: string;
|
|
17
|
+
body: any;
|
|
18
|
+
headers: any;
|
|
19
|
+
};
|
|
20
|
+
}
|
package/js/src/gerami.js
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
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 './base/Exchange.js';
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
/**
|
|
11
|
+
* @class gerami
|
|
12
|
+
* @augments Exchange
|
|
13
|
+
*/
|
|
14
|
+
export default class gerami extends Exchange {
|
|
15
|
+
describe() {
|
|
16
|
+
return this.deepExtend(super.describe(), {
|
|
17
|
+
'id': 'gerami',
|
|
18
|
+
'name': 'Gerami',
|
|
19
|
+
'countries': ['IR'],
|
|
20
|
+
'rateLimit': 1000,
|
|
21
|
+
'certified': false,
|
|
22
|
+
'pro': false,
|
|
23
|
+
'has': {
|
|
24
|
+
'CORS': undefined,
|
|
25
|
+
'spot': false,
|
|
26
|
+
'margin': false,
|
|
27
|
+
'swap': false,
|
|
28
|
+
'future': false,
|
|
29
|
+
'option': false,
|
|
30
|
+
'fetchMarkets': true,
|
|
31
|
+
'fetchTicker': true,
|
|
32
|
+
'fetchTickers': true,
|
|
33
|
+
'otc': true,
|
|
34
|
+
},
|
|
35
|
+
'options': {
|
|
36
|
+
'defaultType': 'otc',
|
|
37
|
+
},
|
|
38
|
+
'urls': {
|
|
39
|
+
'api': {
|
|
40
|
+
'public': 'https://api.gerami.com/api/v1',
|
|
41
|
+
},
|
|
42
|
+
'www': 'https://gerami.com',
|
|
43
|
+
'doc': 'https://api.gerami.com/api/v1/pairs/XAU750g_IRT',
|
|
44
|
+
},
|
|
45
|
+
'api': {
|
|
46
|
+
'public': {
|
|
47
|
+
'get': {
|
|
48
|
+
'pairs/{pair}': 1,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
async fetchMarkets(params = {}) {
|
|
55
|
+
const marketIds = ['XAU750g_IRT', 'XAG999g_IRT'];
|
|
56
|
+
const result = [];
|
|
57
|
+
for (let i = 0; i < marketIds.length; i++) {
|
|
58
|
+
const response = await this.publicGetPairsPair(this.extend({
|
|
59
|
+
'pair': marketIds[i],
|
|
60
|
+
}, params));
|
|
61
|
+
result.push(this.parseMarket(response));
|
|
62
|
+
}
|
|
63
|
+
return result;
|
|
64
|
+
}
|
|
65
|
+
parseMarket(response) {
|
|
66
|
+
const data = this.safeDict(response, 'data', {});
|
|
67
|
+
const baseId = this.safeString(data, 'base_symbol');
|
|
68
|
+
const quoteId = this.safeString(data, 'quote_symbol');
|
|
69
|
+
let base = 'XAG-1G';
|
|
70
|
+
if (baseId === 'XAU750g') {
|
|
71
|
+
base = 'XAU18';
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
'id': this.safeString(data, 'market'),
|
|
75
|
+
'symbol': base + '/' + quoteId,
|
|
76
|
+
'base': base,
|
|
77
|
+
'quote': quoteId,
|
|
78
|
+
'settle': undefined,
|
|
79
|
+
'baseId': baseId,
|
|
80
|
+
'quoteId': quoteId,
|
|
81
|
+
'settleId': undefined,
|
|
82
|
+
'type': 'otc',
|
|
83
|
+
'spot': false,
|
|
84
|
+
'margin': false,
|
|
85
|
+
'swap': false,
|
|
86
|
+
'future': false,
|
|
87
|
+
'option': false,
|
|
88
|
+
'active': this.safeBool(data, 'buy_is_active') && this.safeBool(data, 'sell_is_active'),
|
|
89
|
+
'contract': false,
|
|
90
|
+
'linear': undefined,
|
|
91
|
+
'inverse': undefined,
|
|
92
|
+
'contractSize': undefined,
|
|
93
|
+
'expiry': undefined,
|
|
94
|
+
'expiryDatetime': undefined,
|
|
95
|
+
'strike': undefined,
|
|
96
|
+
'optionType': undefined,
|
|
97
|
+
'precision': {
|
|
98
|
+
'amount': this.safeNumber(data, 'amount_precision'),
|
|
99
|
+
'price': this.safeNumber(data, 'price_precision'),
|
|
100
|
+
},
|
|
101
|
+
'limits': {
|
|
102
|
+
'leverage': { 'min': undefined, 'max': undefined },
|
|
103
|
+
'amount': {
|
|
104
|
+
'min': this.safeNumber(data, 'buy_min_amount'),
|
|
105
|
+
'max': this.safeNumber(data, 'buy_max_amount'),
|
|
106
|
+
},
|
|
107
|
+
'price': { 'min': undefined, 'max': undefined },
|
|
108
|
+
'cost': { 'min': undefined, 'max': undefined },
|
|
109
|
+
},
|
|
110
|
+
'created': undefined,
|
|
111
|
+
'info': data,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
async fetchTicker(symbol, params = {}) {
|
|
115
|
+
await this.loadMarkets();
|
|
116
|
+
const market = this.market(symbol);
|
|
117
|
+
const response = await this.publicGetPairsPair(this.extend({
|
|
118
|
+
'pair': market['id'],
|
|
119
|
+
}, params));
|
|
120
|
+
return this.parseTicker(response, market);
|
|
121
|
+
}
|
|
122
|
+
async fetchTickers(symbols = undefined, params = {}) {
|
|
123
|
+
await this.loadMarkets();
|
|
124
|
+
if (symbols !== undefined) {
|
|
125
|
+
symbols = this.marketSymbols(symbols);
|
|
126
|
+
}
|
|
127
|
+
const marketSymbols = ['XAU18/IRT', 'XAG-1G/IRT'];
|
|
128
|
+
const result = {};
|
|
129
|
+
for (let i = 0; i < marketSymbols.length; i++) {
|
|
130
|
+
const market = this.market(marketSymbols[i]);
|
|
131
|
+
const response = await this.publicGetPairsPair(this.extend({
|
|
132
|
+
'pair': market['id'],
|
|
133
|
+
}, params));
|
|
134
|
+
const ticker = this.parseTicker(response, market);
|
|
135
|
+
result[ticker['symbol']] = ticker;
|
|
136
|
+
}
|
|
137
|
+
return this.filterByArrayTickers(result, 'symbol', symbols);
|
|
138
|
+
}
|
|
139
|
+
parseTicker(response, market = undefined) {
|
|
140
|
+
const data = this.safeDict(response, 'data', {});
|
|
141
|
+
const bid = this.safeNumber(data, 'buy_price');
|
|
142
|
+
const ask = this.safeNumber(data, 'sell_price');
|
|
143
|
+
let last = bid;
|
|
144
|
+
if (ask !== undefined && (last === undefined || ask > last)) {
|
|
145
|
+
last = ask;
|
|
146
|
+
}
|
|
147
|
+
return this.safeTicker({
|
|
148
|
+
'symbol': market['symbol'],
|
|
149
|
+
'timestamp': undefined,
|
|
150
|
+
'datetime': undefined,
|
|
151
|
+
'high': undefined,
|
|
152
|
+
'low': undefined,
|
|
153
|
+
'bid': bid,
|
|
154
|
+
'bidVolume': undefined,
|
|
155
|
+
'ask': ask,
|
|
156
|
+
'askVolume': undefined,
|
|
157
|
+
'vwap': undefined,
|
|
158
|
+
'open': undefined,
|
|
159
|
+
'close': last,
|
|
160
|
+
'last': last,
|
|
161
|
+
'previousClose': undefined,
|
|
162
|
+
'change': this.safeNumber(data, 'daily_price_change_amount'),
|
|
163
|
+
'percentage': this.safeNumber(data, 'daily_price_change_percentage'),
|
|
164
|
+
'average': undefined,
|
|
165
|
+
'baseVolume': undefined,
|
|
166
|
+
'quoteVolume': undefined,
|
|
167
|
+
'info': data,
|
|
168
|
+
}, market);
|
|
169
|
+
}
|
|
170
|
+
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
171
|
+
let url = this.urls['api'][api] + '/' + this.implodeParams(path, params);
|
|
172
|
+
const query = this.omit(params, this.extractParams(path));
|
|
173
|
+
if (Object.keys(query).length) {
|
|
174
|
+
url += '?' + this.urlencode(query);
|
|
175
|
+
}
|
|
176
|
+
headers = { 'Accept': 'application/json' };
|
|
177
|
+
return { 'url': url, 'method': method, 'body': body, 'headers': headers };
|
|
178
|
+
}
|
|
179
|
+
}
|