ccxt-ir 4.13.0 → 4.13.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 +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/src/changefa.js +1 -1
- package/dist/cjs/src/hamtapay.js +48 -59
- package/dist/cjs/src/kifpoolme.js +2 -2
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/hamtapay.d.ts +0 -1
- package/js/src/base/Exchange.d.ts +2 -2
- package/js/src/changefa.js +1 -1
- package/js/src/coinbaseexchange.d.ts +1 -1
- package/js/src/hamtapay.js +48 -59
- package/js/src/kifpoolme.js +2 -2
- package/js/src/protobuf/mexc/compiled.d.cts +6 -0
- package/js/src/static_dependencies/fflake/browser.d.ts +5 -5
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
- package/js/src/static_dependencies/qs/formats.d.cts +6 -0
- package/js/src/static_dependencies/qs/index.d.cts +6 -0
- package/js/src/static_dependencies/qs/parse.d.cts +6 -0
- package/js/src/static_dependencies/qs/stringify.d.cts +6 -0
- package/js/src/static_dependencies/qs/utils.d.cts +6 -0
- package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +1 -1
- package/js/test.js +4 -4
- package/package.json +1 -1
package/dist/cjs/ccxt.js
CHANGED
|
@@ -240,7 +240,7 @@ var xt$1 = require('./src/pro/xt.js');
|
|
|
240
240
|
|
|
241
241
|
//-----------------------------------------------------------------------------
|
|
242
242
|
// this is updated by vss.js when building
|
|
243
|
-
const version = '4.13.
|
|
243
|
+
const version = '4.13.1';
|
|
244
244
|
Exchange["default"].ccxtVersion = version;
|
|
245
245
|
const exchanges = {
|
|
246
246
|
'abantether': abantether["default"],
|
package/dist/cjs/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "type": "commonjs" }
|
|
1
|
+
{ "type": "commonjs" }
|
package/dist/cjs/src/changefa.js
CHANGED
|
@@ -226,7 +226,7 @@ class changefa extends Exchange["default"] {
|
|
|
226
226
|
const buyPrice = this.safeNumber(ticker, 'buyPrice');
|
|
227
227
|
const sellPrice = this.safeNumber(ticker, 'sellPrice');
|
|
228
228
|
if ((buyPrice !== undefined) && (sellPrice !== undefined)) {
|
|
229
|
-
last =
|
|
229
|
+
last = sellPrice;
|
|
230
230
|
}
|
|
231
231
|
const weeklyPriceLog = this.safeList(ticker, 'weeklyPriceLog', []);
|
|
232
232
|
let high = undefined;
|
package/dist/cjs/src/hamtapay.js
CHANGED
|
@@ -88,7 +88,7 @@ class hamtapay extends hamtapay$1["default"] {
|
|
|
88
88
|
'urls': {
|
|
89
89
|
'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/hamtapay/64x64.png',
|
|
90
90
|
'api': {
|
|
91
|
-
'public': 'https://
|
|
91
|
+
'public': 'https://oapi.hamtapay.org',
|
|
92
92
|
},
|
|
93
93
|
'www': 'https://hamtapay.net/',
|
|
94
94
|
'doc': [
|
|
@@ -99,7 +99,6 @@ class hamtapay extends hamtapay$1["default"] {
|
|
|
99
99
|
'public': {
|
|
100
100
|
'get': {
|
|
101
101
|
'/financial/api/market': 1,
|
|
102
|
-
'/financial/api/vitrin/prices': 1,
|
|
103
102
|
},
|
|
104
103
|
},
|
|
105
104
|
},
|
|
@@ -118,7 +117,7 @@ class hamtapay extends hamtapay$1["default"] {
|
|
|
118
117
|
* @method
|
|
119
118
|
* @name hamtapay#fetchMarkets
|
|
120
119
|
* @description retrieves data on all markets for hamtapay
|
|
121
|
-
* @see https://
|
|
120
|
+
* @see https://oapi.hamtapay.org/financial/api/market
|
|
122
121
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
123
122
|
* @returns {object[]} an array of objects representing market data
|
|
124
123
|
*/
|
|
@@ -155,8 +154,8 @@ class hamtapay extends hamtapay$1["default"] {
|
|
|
155
154
|
'baseId': baseId,
|
|
156
155
|
'quoteId': quoteId,
|
|
157
156
|
'settleId': undefined,
|
|
158
|
-
'type': '
|
|
159
|
-
'spot':
|
|
157
|
+
'type': 'spot',
|
|
158
|
+
'spot': true,
|
|
160
159
|
'margin': false,
|
|
161
160
|
'swap': false,
|
|
162
161
|
'future': false,
|
|
@@ -171,8 +170,8 @@ class hamtapay extends hamtapay$1["default"] {
|
|
|
171
170
|
'strike': undefined,
|
|
172
171
|
'optionType': undefined,
|
|
173
172
|
'precision': {
|
|
174
|
-
'amount':
|
|
175
|
-
'price':
|
|
173
|
+
'amount': this.safeInteger(market, 'amount_decimals'),
|
|
174
|
+
'price': this.safeInteger(market, 'price_decimals'),
|
|
176
175
|
},
|
|
177
176
|
'limits': {
|
|
178
177
|
'leverage': {
|
|
@@ -201,7 +200,7 @@ class hamtapay extends hamtapay$1["default"] {
|
|
|
201
200
|
* @method
|
|
202
201
|
* @name hamtapay#fetchTickers
|
|
203
202
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
204
|
-
* @see https://
|
|
203
|
+
* @see https://oapi.hamtapay.org/financial/api/market
|
|
205
204
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
206
205
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
207
206
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -210,23 +209,12 @@ class hamtapay extends hamtapay$1["default"] {
|
|
|
210
209
|
if (symbols !== undefined) {
|
|
211
210
|
symbols = this.marketSymbols(symbols);
|
|
212
211
|
}
|
|
213
|
-
const response = await this.
|
|
214
|
-
const data = this.
|
|
212
|
+
const response = await this.publicGetFinancialApiMarket(params);
|
|
213
|
+
const data = this.safeList(response, 'data', []);
|
|
215
214
|
const result = {};
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
const corresponding_data = this.safeDict(data, current_qoute, {});
|
|
220
|
-
const baseSymbols = Object.keys(corresponding_data);
|
|
221
|
-
for (let j = 0; j < baseSymbols.length; j++) {
|
|
222
|
-
const current_base = baseSymbols[j];
|
|
223
|
-
const current_ticker = corresponding_data[current_base];
|
|
224
|
-
current_ticker['base'] = current_base;
|
|
225
|
-
current_ticker['quote'] = current_qoute;
|
|
226
|
-
current_ticker['symbol'] = current_base + '/' + current_qoute;
|
|
227
|
-
current_ticker['id'] = current_base + '-' + current_qoute;
|
|
228
|
-
result[current_ticker['symbol']] = this.parseTicker(current_ticker);
|
|
229
|
-
}
|
|
215
|
+
for (let i = 0; i < data.length; i++) {
|
|
216
|
+
const ticker = this.parseTicker(data[i]);
|
|
217
|
+
result[ticker['symbol']] = ticker;
|
|
230
218
|
}
|
|
231
219
|
return this.filterByArrayTickers(result, 'symbol', symbols);
|
|
232
220
|
}
|
|
@@ -235,48 +223,41 @@ class hamtapay extends hamtapay$1["default"] {
|
|
|
235
223
|
* @method
|
|
236
224
|
* @name hamtapay#fetchTicker
|
|
237
225
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
238
|
-
* @see https://hamtapay.
|
|
226
|
+
* @see https://oapi.hamtapay.org/financial/api/market
|
|
239
227
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
240
228
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
241
229
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
242
230
|
*/
|
|
243
|
-
const
|
|
244
|
-
return
|
|
231
|
+
const tickers = await this.fetchTickers([symbol], params);
|
|
232
|
+
return tickers[symbol];
|
|
245
233
|
}
|
|
246
234
|
parseTicker(ticker, market = undefined) {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
const symbol = this.safeSymbol(marketId, market, undefined, marketType);
|
|
265
|
-
const last = this.safeFloat(ticker, 'buy_price', 0);
|
|
266
|
-
const change = this.safeFloat(ticker, 'change_rate_24h', 0);
|
|
267
|
-
const ask = this.safeFloat(ticker, 'buy_price', 0);
|
|
268
|
-
const bid = this.safeFloat(ticker, 'sell_price', 0);
|
|
269
|
-
const high = this.safeFloat(ticker, 'max_price_24h', 0);
|
|
270
|
-
const low = this.safeFloat(ticker, 'min_price_24h', 0);
|
|
235
|
+
const marketType = 'spot';
|
|
236
|
+
const marketId = this.safeString2(ticker, 'id', 'symbol');
|
|
237
|
+
const baseId = this.safeString(ticker, 'base');
|
|
238
|
+
const quoteId = this.safeString(ticker, 'quote');
|
|
239
|
+
const base = this.safeCurrencyCode(baseId);
|
|
240
|
+
const quote = this.safeCurrencyCode(quoteId);
|
|
241
|
+
let symbol = this.safeSymbol(marketId, market, undefined, marketType);
|
|
242
|
+
if ((baseId !== undefined) && (quoteId !== undefined)) {
|
|
243
|
+
symbol = base + '/' + quote;
|
|
244
|
+
}
|
|
245
|
+
const last = this.safeFloat(ticker, 'last_price');
|
|
246
|
+
const baseVolume = this.safeFloat(ticker, 'volume_24h');
|
|
247
|
+
const percentage = this.safeFloat(ticker, 'percent_change_24h');
|
|
248
|
+
let quoteVolume = undefined;
|
|
249
|
+
if ((baseVolume !== undefined) && (last !== undefined)) {
|
|
250
|
+
quoteVolume = baseVolume * last;
|
|
251
|
+
}
|
|
271
252
|
return this.safeTicker({
|
|
272
253
|
'symbol': symbol,
|
|
273
254
|
'timestamp': undefined,
|
|
274
255
|
'datetime': undefined,
|
|
275
|
-
'high':
|
|
276
|
-
'low':
|
|
277
|
-
'bid':
|
|
256
|
+
'high': undefined,
|
|
257
|
+
'low': undefined,
|
|
258
|
+
'bid': undefined,
|
|
278
259
|
'bidVolume': undefined,
|
|
279
|
-
'ask':
|
|
260
|
+
'ask': undefined,
|
|
280
261
|
'askVolume': undefined,
|
|
281
262
|
'vwap': undefined,
|
|
282
263
|
'open': undefined,
|
|
@@ -284,15 +265,23 @@ class hamtapay extends hamtapay$1["default"] {
|
|
|
284
265
|
'last': last,
|
|
285
266
|
'previousClose': undefined,
|
|
286
267
|
'change': undefined,
|
|
287
|
-
'percentage':
|
|
268
|
+
'percentage': percentage,
|
|
288
269
|
'average': undefined,
|
|
289
|
-
'baseVolume':
|
|
290
|
-
'quoteVolume':
|
|
270
|
+
'baseVolume': baseVolume,
|
|
271
|
+
'quoteVolume': quoteVolume,
|
|
291
272
|
'info': ticker,
|
|
292
273
|
}, market);
|
|
293
274
|
}
|
|
294
275
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
295
|
-
const
|
|
276
|
+
const query = this.omit(params, this.extractParams(path));
|
|
277
|
+
let normalizedPath = path;
|
|
278
|
+
while (normalizedPath.length && normalizedPath[0] === '/') {
|
|
279
|
+
normalizedPath = normalizedPath.slice(1);
|
|
280
|
+
}
|
|
281
|
+
let url = this.urls['api']['public'] + '/' + this.implodeParams(normalizedPath, params);
|
|
282
|
+
if (Object.keys(query).length) {
|
|
283
|
+
url += '?' + this.urlencode(query);
|
|
284
|
+
}
|
|
296
285
|
headers = {
|
|
297
286
|
'Content-Type': 'application/json',
|
|
298
287
|
'Origin': 'https://hamtapay.net',
|
|
@@ -309,8 +309,8 @@ class kifpoolme extends kifpoolme$1["default"] {
|
|
|
309
309
|
let ask = undefined;
|
|
310
310
|
if (quoteId === 'IRT') {
|
|
311
311
|
// For IRT: priceSellIRT is the sell price (bid), priceBuyIRT is the buy price (ask)
|
|
312
|
-
|
|
313
|
-
|
|
312
|
+
ask = this.safeNumber(ticker, 'priceSellIRT');
|
|
313
|
+
bid = this.safeNumber(ticker, 'priceBuyIRT');
|
|
314
314
|
last = ask;
|
|
315
315
|
}
|
|
316
316
|
else {
|
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.13.
|
|
7
|
+
declare const version = "4.13.1";
|
|
8
8
|
import abantether from './src/abantether.js';
|
|
9
9
|
import afratether from './src/afratether.js';
|
|
10
10
|
import alpaca from './src/alpaca.js';
|
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.13.
|
|
41
|
+
const version = '4.13.1';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import abantether from './src/abantether.js';
|
|
@@ -2,7 +2,6 @@ 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>;
|
|
6
5
|
}
|
|
7
6
|
declare abstract class Exchange extends _Exchange {
|
|
8
7
|
}
|
|
@@ -252,7 +252,7 @@ export default class Exchange {
|
|
|
252
252
|
outputLen: number;
|
|
253
253
|
blockLen: number;
|
|
254
254
|
create(): import("../static_dependencies/noble-hashes/utils.js").Hash<import("../static_dependencies/noble-hashes/utils.js").Hash<any>>;
|
|
255
|
-
}, digest?: "
|
|
255
|
+
}, digest?: "hex" | "base64" | "binary") => any;
|
|
256
256
|
arrayConcat: (a: any[], b: any[]) => any[];
|
|
257
257
|
encode: (str: string) => Uint8Array;
|
|
258
258
|
urlencode: (object: object, sort?: boolean) => string;
|
|
@@ -261,7 +261,7 @@ export default class Exchange {
|
|
|
261
261
|
outputLen: number;
|
|
262
262
|
blockLen: number;
|
|
263
263
|
create(): import("../static_dependencies/noble-hashes/utils.js").Hash<import("../static_dependencies/noble-hashes/utils.js").Hash<any>>;
|
|
264
|
-
}, digest?: "
|
|
264
|
+
}, digest?: "hex" | "base64" | "binary") => any;
|
|
265
265
|
numberToString: typeof functions.numberToString;
|
|
266
266
|
parseTimeframe: (timeframe: string) => number;
|
|
267
267
|
safeInteger2: (o: any, k1: IndexType, k2: IndexType, $default?: number) => number;
|
package/js/src/changefa.js
CHANGED
|
@@ -227,7 +227,7 @@ export default class changefa extends Exchange {
|
|
|
227
227
|
const buyPrice = this.safeNumber(ticker, 'buyPrice');
|
|
228
228
|
const sellPrice = this.safeNumber(ticker, 'sellPrice');
|
|
229
229
|
if ((buyPrice !== undefined) && (sellPrice !== undefined)) {
|
|
230
|
-
last =
|
|
230
|
+
last = sellPrice;
|
|
231
231
|
}
|
|
232
232
|
const weeklyPriceLog = this.safeList(ticker, 'weeklyPriceLog', []);
|
|
233
233
|
let high = undefined;
|
|
@@ -311,7 +311,7 @@ export default class coinbaseexchange extends Exchange {
|
|
|
311
311
|
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
312
312
|
*/
|
|
313
313
|
fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
314
|
-
parseTransactionStatus(transaction: any): "
|
|
314
|
+
parseTransactionStatus(transaction: any): "canceled" | "pending" | "ok" | "failed";
|
|
315
315
|
parseTransaction(transaction: Dict, currency?: Currency): Transaction;
|
|
316
316
|
/**
|
|
317
317
|
* @method
|
package/js/src/hamtapay.js
CHANGED
|
@@ -89,7 +89,7 @@ export default class hamtapay extends Exchange {
|
|
|
89
89
|
'urls': {
|
|
90
90
|
'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/hamtapay/64x64.png',
|
|
91
91
|
'api': {
|
|
92
|
-
'public': 'https://
|
|
92
|
+
'public': 'https://oapi.hamtapay.org',
|
|
93
93
|
},
|
|
94
94
|
'www': 'https://hamtapay.net/',
|
|
95
95
|
'doc': [
|
|
@@ -100,7 +100,6 @@ export default class hamtapay extends Exchange {
|
|
|
100
100
|
'public': {
|
|
101
101
|
'get': {
|
|
102
102
|
'/financial/api/market': 1,
|
|
103
|
-
'/financial/api/vitrin/prices': 1,
|
|
104
103
|
},
|
|
105
104
|
},
|
|
106
105
|
},
|
|
@@ -119,7 +118,7 @@ export default class hamtapay extends Exchange {
|
|
|
119
118
|
* @method
|
|
120
119
|
* @name hamtapay#fetchMarkets
|
|
121
120
|
* @description retrieves data on all markets for hamtapay
|
|
122
|
-
* @see https://
|
|
121
|
+
* @see https://oapi.hamtapay.org/financial/api/market
|
|
123
122
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
124
123
|
* @returns {object[]} an array of objects representing market data
|
|
125
124
|
*/
|
|
@@ -156,8 +155,8 @@ export default class hamtapay extends Exchange {
|
|
|
156
155
|
'baseId': baseId,
|
|
157
156
|
'quoteId': quoteId,
|
|
158
157
|
'settleId': undefined,
|
|
159
|
-
'type': '
|
|
160
|
-
'spot':
|
|
158
|
+
'type': 'spot',
|
|
159
|
+
'spot': true,
|
|
161
160
|
'margin': false,
|
|
162
161
|
'swap': false,
|
|
163
162
|
'future': false,
|
|
@@ -172,8 +171,8 @@ export default class hamtapay extends Exchange {
|
|
|
172
171
|
'strike': undefined,
|
|
173
172
|
'optionType': undefined,
|
|
174
173
|
'precision': {
|
|
175
|
-
'amount':
|
|
176
|
-
'price':
|
|
174
|
+
'amount': this.safeInteger(market, 'amount_decimals'),
|
|
175
|
+
'price': this.safeInteger(market, 'price_decimals'),
|
|
177
176
|
},
|
|
178
177
|
'limits': {
|
|
179
178
|
'leverage': {
|
|
@@ -202,7 +201,7 @@ export default class hamtapay extends Exchange {
|
|
|
202
201
|
* @method
|
|
203
202
|
* @name hamtapay#fetchTickers
|
|
204
203
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
205
|
-
* @see https://
|
|
204
|
+
* @see https://oapi.hamtapay.org/financial/api/market
|
|
206
205
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
207
206
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
208
207
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -211,23 +210,12 @@ export default class hamtapay extends Exchange {
|
|
|
211
210
|
if (symbols !== undefined) {
|
|
212
211
|
symbols = this.marketSymbols(symbols);
|
|
213
212
|
}
|
|
214
|
-
const response = await this.
|
|
215
|
-
const data = this.
|
|
213
|
+
const response = await this.publicGetFinancialApiMarket(params);
|
|
214
|
+
const data = this.safeList(response, 'data', []);
|
|
216
215
|
const result = {};
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
const corresponding_data = this.safeDict(data, current_qoute, {});
|
|
221
|
-
const baseSymbols = Object.keys(corresponding_data);
|
|
222
|
-
for (let j = 0; j < baseSymbols.length; j++) {
|
|
223
|
-
const current_base = baseSymbols[j];
|
|
224
|
-
const current_ticker = corresponding_data[current_base];
|
|
225
|
-
current_ticker['base'] = current_base;
|
|
226
|
-
current_ticker['quote'] = current_qoute;
|
|
227
|
-
current_ticker['symbol'] = current_base + '/' + current_qoute;
|
|
228
|
-
current_ticker['id'] = current_base + '-' + current_qoute;
|
|
229
|
-
result[current_ticker['symbol']] = this.parseTicker(current_ticker);
|
|
230
|
-
}
|
|
216
|
+
for (let i = 0; i < data.length; i++) {
|
|
217
|
+
const ticker = this.parseTicker(data[i]);
|
|
218
|
+
result[ticker['symbol']] = ticker;
|
|
231
219
|
}
|
|
232
220
|
return this.filterByArrayTickers(result, 'symbol', symbols);
|
|
233
221
|
}
|
|
@@ -236,48 +224,41 @@ export default class hamtapay extends Exchange {
|
|
|
236
224
|
* @method
|
|
237
225
|
* @name hamtapay#fetchTicker
|
|
238
226
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
239
|
-
* @see https://hamtapay.
|
|
227
|
+
* @see https://oapi.hamtapay.org/financial/api/market
|
|
240
228
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
241
229
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
242
230
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
243
231
|
*/
|
|
244
|
-
const
|
|
245
|
-
return
|
|
232
|
+
const tickers = await this.fetchTickers([symbol], params);
|
|
233
|
+
return tickers[symbol];
|
|
246
234
|
}
|
|
247
235
|
parseTicker(ticker, market = undefined) {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
const symbol = this.safeSymbol(marketId, market, undefined, marketType);
|
|
266
|
-
const last = this.safeFloat(ticker, 'buy_price', 0);
|
|
267
|
-
const change = this.safeFloat(ticker, 'change_rate_24h', 0);
|
|
268
|
-
const ask = this.safeFloat(ticker, 'buy_price', 0);
|
|
269
|
-
const bid = this.safeFloat(ticker, 'sell_price', 0);
|
|
270
|
-
const high = this.safeFloat(ticker, 'max_price_24h', 0);
|
|
271
|
-
const low = this.safeFloat(ticker, 'min_price_24h', 0);
|
|
236
|
+
const marketType = 'spot';
|
|
237
|
+
const marketId = this.safeString2(ticker, 'id', 'symbol');
|
|
238
|
+
const baseId = this.safeString(ticker, 'base');
|
|
239
|
+
const quoteId = this.safeString(ticker, 'quote');
|
|
240
|
+
const base = this.safeCurrencyCode(baseId);
|
|
241
|
+
const quote = this.safeCurrencyCode(quoteId);
|
|
242
|
+
let symbol = this.safeSymbol(marketId, market, undefined, marketType);
|
|
243
|
+
if ((baseId !== undefined) && (quoteId !== undefined)) {
|
|
244
|
+
symbol = base + '/' + quote;
|
|
245
|
+
}
|
|
246
|
+
const last = this.safeFloat(ticker, 'last_price');
|
|
247
|
+
const baseVolume = this.safeFloat(ticker, 'volume_24h');
|
|
248
|
+
const percentage = this.safeFloat(ticker, 'percent_change_24h');
|
|
249
|
+
let quoteVolume = undefined;
|
|
250
|
+
if ((baseVolume !== undefined) && (last !== undefined)) {
|
|
251
|
+
quoteVolume = baseVolume * last;
|
|
252
|
+
}
|
|
272
253
|
return this.safeTicker({
|
|
273
254
|
'symbol': symbol,
|
|
274
255
|
'timestamp': undefined,
|
|
275
256
|
'datetime': undefined,
|
|
276
|
-
'high':
|
|
277
|
-
'low':
|
|
278
|
-
'bid':
|
|
257
|
+
'high': undefined,
|
|
258
|
+
'low': undefined,
|
|
259
|
+
'bid': undefined,
|
|
279
260
|
'bidVolume': undefined,
|
|
280
|
-
'ask':
|
|
261
|
+
'ask': undefined,
|
|
281
262
|
'askVolume': undefined,
|
|
282
263
|
'vwap': undefined,
|
|
283
264
|
'open': undefined,
|
|
@@ -285,15 +266,23 @@ export default class hamtapay extends Exchange {
|
|
|
285
266
|
'last': last,
|
|
286
267
|
'previousClose': undefined,
|
|
287
268
|
'change': undefined,
|
|
288
|
-
'percentage':
|
|
269
|
+
'percentage': percentage,
|
|
289
270
|
'average': undefined,
|
|
290
|
-
'baseVolume':
|
|
291
|
-
'quoteVolume':
|
|
271
|
+
'baseVolume': baseVolume,
|
|
272
|
+
'quoteVolume': quoteVolume,
|
|
292
273
|
'info': ticker,
|
|
293
274
|
}, market);
|
|
294
275
|
}
|
|
295
276
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
296
|
-
const
|
|
277
|
+
const query = this.omit(params, this.extractParams(path));
|
|
278
|
+
let normalizedPath = path;
|
|
279
|
+
while (normalizedPath.length && normalizedPath[0] === '/') {
|
|
280
|
+
normalizedPath = normalizedPath.slice(1);
|
|
281
|
+
}
|
|
282
|
+
let url = this.urls['api']['public'] + '/' + this.implodeParams(normalizedPath, params);
|
|
283
|
+
if (Object.keys(query).length) {
|
|
284
|
+
url += '?' + this.urlencode(query);
|
|
285
|
+
}
|
|
297
286
|
headers = {
|
|
298
287
|
'Content-Type': 'application/json',
|
|
299
288
|
'Origin': 'https://hamtapay.net',
|
package/js/src/kifpoolme.js
CHANGED
|
@@ -310,8 +310,8 @@ export default class kifpoolme extends Exchange {
|
|
|
310
310
|
let ask = undefined;
|
|
311
311
|
if (quoteId === 'IRT') {
|
|
312
312
|
// For IRT: priceSellIRT is the sell price (bid), priceBuyIRT is the buy price (ask)
|
|
313
|
-
|
|
314
|
-
|
|
313
|
+
ask = this.safeNumber(ticker, 'priceSellIRT');
|
|
314
|
+
bid = this.safeNumber(ticker, 'priceBuyIRT');
|
|
315
315
|
last = ask;
|
|
316
316
|
}
|
|
317
317
|
else {
|
|
@@ -1,2 +1,8 @@
|
|
|
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
|
+
|
|
1
7
|
export = $root;
|
|
2
8
|
declare var $root: {};
|
|
@@ -5,7 +5,7 @@ export function deflate(data: any, opts: any, cb: any): () => void;
|
|
|
5
5
|
* @param opts The compression options
|
|
6
6
|
* @returns The deflated version of the data
|
|
7
7
|
*/
|
|
8
|
-
export function deflateSync(data: any, opts: any): Uint8Array |
|
|
8
|
+
export function deflateSync(data: any, opts: any): Uint8Array | Uint16Array | Uint32Array;
|
|
9
9
|
export function inflate(data: any, opts: any, cb: any): () => void;
|
|
10
10
|
/**
|
|
11
11
|
* Expands DEFLATE data with no wrapper
|
|
@@ -21,7 +21,7 @@ export function gzip(data: any, opts: any, cb: any): () => void;
|
|
|
21
21
|
* @param opts The compression options
|
|
22
22
|
* @returns The gzipped version of the data
|
|
23
23
|
*/
|
|
24
|
-
export function gzipSync(data: any, opts: any): Uint8Array |
|
|
24
|
+
export function gzipSync(data: any, opts: any): Uint8Array | Uint16Array | Uint32Array;
|
|
25
25
|
export function gunzip(data: any, opts: any, cb: any): () => void;
|
|
26
26
|
/**
|
|
27
27
|
* Expands GZIP data
|
|
@@ -37,7 +37,7 @@ export function zlib(data: any, opts: any, cb: any): () => void;
|
|
|
37
37
|
* @param opts The compression options
|
|
38
38
|
* @returns The zlib-compressed version of the data
|
|
39
39
|
*/
|
|
40
|
-
export function zlibSync(data: any, opts: any): Uint8Array |
|
|
40
|
+
export function zlibSync(data: any, opts: any): Uint8Array | Uint16Array | Uint32Array;
|
|
41
41
|
export function unzlib(data: any, opts: any, cb: any): () => void;
|
|
42
42
|
/**
|
|
43
43
|
* Expands Zlib data
|
|
@@ -61,7 +61,7 @@ export function decompressSync(data: any, out: any): any;
|
|
|
61
61
|
* not need to be true unless decoding a binary string.
|
|
62
62
|
* @returns The string encoded in UTF-8/Latin-1 binary
|
|
63
63
|
*/
|
|
64
|
-
export function strToU8(str: any, latin1: any): Uint8Array |
|
|
64
|
+
export function strToU8(str: any, latin1: any): Uint8Array | Uint16Array | Uint32Array;
|
|
65
65
|
/**
|
|
66
66
|
* Converts a Uint8Array to a string
|
|
67
67
|
* @param dat The data to decode to string
|
|
@@ -69,7 +69,7 @@ export function strToU8(str: any, latin1: any): Uint8Array | Uint32Array | Uint1
|
|
|
69
69
|
* not need to be true unless encoding to binary string.
|
|
70
70
|
* @returns The original UTF-8/Latin-1 string
|
|
71
71
|
*/
|
|
72
|
-
export function strFromU8(dat: any, latin1: any): string | Uint8Array |
|
|
72
|
+
export function strFromU8(dat: any, latin1: any): string | Uint8Array | Uint16Array | Uint32Array;
|
|
73
73
|
export function zip(data: any, opts: any, cb: any): () => void;
|
|
74
74
|
/**
|
|
75
75
|
* Synchronously creates a ZIP file. Prefer using `zip` for better performance
|
|
@@ -15,7 +15,7 @@ export declare class BigInteger {
|
|
|
15
15
|
protected intValue(): number;
|
|
16
16
|
protected byteValue(): number;
|
|
17
17
|
protected shortValue(): number;
|
|
18
|
-
protected signum():
|
|
18
|
+
protected signum(): 0 | 1 | -1;
|
|
19
19
|
toByteArray(): number[];
|
|
20
20
|
protected equals(a: BigInteger): boolean;
|
|
21
21
|
protected min(a: BigInteger): BigInteger;
|
|
@@ -1,3 +1,9 @@
|
|
|
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
|
+
|
|
1
7
|
declare const _default: string;
|
|
2
8
|
export declare namespace formatters {
|
|
3
9
|
function RFC1738(value: any): string;
|
|
@@ -1,3 +1,9 @@
|
|
|
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
|
+
|
|
1
7
|
import formats = require("./formats.cjs");
|
|
2
8
|
import parse = require("./parse.cjs");
|
|
3
9
|
import stringify = require("./stringify.cjs");
|
|
@@ -1,2 +1,8 @@
|
|
|
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
|
+
|
|
1
7
|
declare function _exports(str: any, opts: any): any;
|
|
2
8
|
export = _exports;
|
|
@@ -1,2 +1,8 @@
|
|
|
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
|
+
|
|
1
7
|
declare function _exports(object: any, opts: any): string;
|
|
2
8
|
export = _exports;
|
|
@@ -1,3 +1,9 @@
|
|
|
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
|
+
|
|
1
7
|
export function arrayToObject(source: any, options: any): any;
|
|
2
8
|
export function assign(target: any, source: any): any;
|
|
3
9
|
export function combine(a: any, b: any): any[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Abi, FunctionAbi, RawArgs } from '../../../types/index.js';
|
|
2
2
|
import { AbiParserInterface } from './interface.js';
|
|
3
3
|
export declare function createAbiParser(abi: Abi): AbiParserInterface;
|
|
4
|
-
export declare function getAbiVersion(abi: Abi):
|
|
4
|
+
export declare function getAbiVersion(abi: Abi): 0 | 1 | 2;
|
|
5
5
|
export declare function isNoConstructorValid(method: string, argsCalldata: RawArgs, abiMethod?: FunctionAbi): boolean;
|