ccxt 4.1.72 → 4.1.73

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/dist/cjs/ccxt.js CHANGED
@@ -173,7 +173,7 @@ var woo$1 = require('./src/pro/woo.js');
173
173
 
174
174
  //-----------------------------------------------------------------------------
175
175
  // this is updated by vss.js when building
176
- const version = '4.1.72';
176
+ const version = '4.1.73';
177
177
  Exchange["default"].ccxtVersion = version;
178
178
  const exchanges = {
179
179
  'ace': ace,
@@ -3660,10 +3660,10 @@ class Exchange {
3660
3660
  */
3661
3661
  throw new errors.NotSupported(this.id + ' fetchDepositsWithdrawals() is not supported yet');
3662
3662
  }
3663
- async fetchDeposits(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3663
+ async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
3664
3664
  throw new errors.NotSupported(this.id + ' fetchDeposits() is not supported yet');
3665
3665
  }
3666
- async fetchWithdrawals(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3666
+ async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
3667
3667
  throw new errors.NotSupported(this.id + ' fetchWithdrawals() is not supported yet');
3668
3668
  }
3669
3669
  async fetchOpenInterest(symbol, params = {}) {
@@ -44,8 +44,8 @@ class coinex extends coinex$1 {
44
44
  'cancelOrder': true,
45
45
  'cancelOrders': true,
46
46
  'createDepositAddress': true,
47
- 'createOrder': true,
48
47
  'createMarketBuyOrderWithCost': true,
48
+ 'createOrder': true,
49
49
  'createOrders': true,
50
50
  'createReduceOnlyOrder': true,
51
51
  'editOrder': true,
@@ -826,13 +826,19 @@ class latoken extends latoken$1 {
826
826
  * @param {object} [params] extra parameters specific to the exchange API endpoint
827
827
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
828
828
  */
829
- let method = this.safeString(params, 'method');
829
+ const options = this.safeValue(this.options, 'fetchTradingFee', {});
830
+ const defaultMethod = this.safeString(options, 'method', 'fetchPrivateTradingFee');
831
+ const method = this.safeString(params, 'method', defaultMethod);
830
832
  params = this.omit(params, 'method');
831
- if (method === undefined) {
832
- const options = this.safeValue(this.options, 'fetchTradingFee', {});
833
- method = this.safeString(options, 'method', 'fetchPrivateTradingFee');
833
+ if (method === 'fetchPrivateTradingFee') {
834
+ return await this.fetchPrivateTradingFee(symbol, params);
835
+ }
836
+ else if (method === 'fetchPublicTradingFee') {
837
+ return await this.fetchPublicTradingFee(symbol, params);
838
+ }
839
+ else {
840
+ throw new errors.NotSupported(this.id + ' not support this method');
834
841
  }
835
- return await this[method](symbol, params);
836
842
  }
837
843
  async fetchPublicTradingFee(symbol, params = {}) {
838
844
  await this.loadMarkets();
@@ -898,18 +904,20 @@ class latoken extends latoken$1 {
898
904
  // 'from': this.milliseconds (),
899
905
  // 'limit': limit, // default '100'
900
906
  };
901
- let method = 'privateGetAuthTrade';
902
907
  let market = undefined;
908
+ if (limit !== undefined) {
909
+ request['limit'] = limit; // default 100
910
+ }
911
+ let response = undefined;
903
912
  if (symbol !== undefined) {
904
913
  market = this.market(symbol);
905
914
  request['currency'] = market['baseId'];
906
915
  request['quote'] = market['quoteId'];
907
- method = 'privateGetAuthTradePairCurrencyQuote';
916
+ response = await this.privateGetAuthTradePairCurrencyQuote(this.extend(request, params));
908
917
  }
909
- if (limit !== undefined) {
910
- request['limit'] = limit; // default 100
918
+ else {
919
+ response = await this.privateGetAuthTrade(this.extend(request, params));
911
920
  }
912
- const response = await this[method](this.extend(request, params));
913
921
  //
914
922
  // [
915
923
  // {
@@ -1575,22 +1583,21 @@ class latoken extends latoken$1 {
1575
1583
  */
1576
1584
  await this.loadMarkets();
1577
1585
  const currency = this.currency(code);
1578
- let method = undefined;
1586
+ const request = {
1587
+ 'currency': currency['id'],
1588
+ 'recipient': toAccount,
1589
+ 'value': this.currencyToPrecision(code, amount),
1590
+ };
1591
+ let response = undefined;
1579
1592
  if (toAccount.indexOf('@') >= 0) {
1580
- method = 'privatePostAuthTransferEmail';
1593
+ response = await this.privatePostAuthTransferEmail(this.extend(request, params));
1581
1594
  }
1582
1595
  else if (toAccount.length === 36) {
1583
- method = 'privatePostAuthTransferId';
1596
+ response = await this.privatePostAuthTransferId(this.extend(request, params));
1584
1597
  }
1585
1598
  else {
1586
- method = 'privatePostAuthTransferPhone';
1599
+ response = await this.privatePostAuthTransferPhone(this.extend(request, params));
1587
1600
  }
1588
- const request = {
1589
- 'currency': currency['id'],
1590
- 'recipient': toAccount,
1591
- 'value': this.currencyToPrecision(code, amount),
1592
- };
1593
- const response = await this[method](this.extend(request, params));
1594
1601
  //
1595
1602
  // {
1596
1603
  // "id": "e6fc4ace-7750-44e4-b7e9-6af038ac7107",
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 { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
7
- declare const version = "4.1.71";
7
+ declare const version = "4.1.72";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
package/js/ccxt.js CHANGED
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
38
38
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.1.72';
41
+ const version = '4.1.73';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -783,8 +783,8 @@ export default class Exchange {
783
783
  fetchOHLCVWs(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
784
784
  fetchGreeks(symbol: string, params?: {}): Promise<Greeks>;
785
785
  fetchDepositsWithdrawals(code?: string, since?: Int, limit?: Int, params?: {}): Promise<any>;
786
- fetchDeposits(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<any>;
787
- fetchWithdrawals(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<any>;
786
+ fetchDeposits(code?: string, since?: Int, limit?: Int, params?: {}): Promise<any>;
787
+ fetchWithdrawals(code?: string, since?: Int, limit?: Int, params?: {}): Promise<any>;
788
788
  fetchOpenInterest(symbol: string, params?: {}): Promise<OpenInterest>;
789
789
  fetchFundingRateHistory(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<FundingRateHistory[]>;
790
790
  fetchFundingHistory(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<FundingHistory[]>;
@@ -3656,10 +3656,10 @@ export default class Exchange {
3656
3656
  */
3657
3657
  throw new NotSupported(this.id + ' fetchDepositsWithdrawals() is not supported yet');
3658
3658
  }
3659
- async fetchDeposits(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3659
+ async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
3660
3660
  throw new NotSupported(this.id + ' fetchDeposits() is not supported yet');
3661
3661
  }
3662
- async fetchWithdrawals(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3662
+ async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
3663
3663
  throw new NotSupported(this.id + ' fetchWithdrawals() is not supported yet');
3664
3664
  }
3665
3665
  async fetchOpenInterest(symbol, params = {}) {
package/js/src/coinex.js CHANGED
@@ -47,8 +47,8 @@ export default class coinex extends Exchange {
47
47
  'cancelOrder': true,
48
48
  'cancelOrders': true,
49
49
  'createDepositAddress': true,
50
- 'createOrder': true,
51
50
  'createMarketBuyOrderWithCost': true,
51
+ 'createOrder': true,
52
52
  'createOrders': true,
53
53
  'createReduceOnlyOrder': true,
54
54
  'editOrder': true,
@@ -18,7 +18,12 @@ export default class latoken extends Exchange {
18
18
  fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
19
19
  parseTrade(trade: any, market?: Market): Trade;
20
20
  fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
21
- fetchTradingFee(symbol: string, params?: {}): Promise<any>;
21
+ fetchTradingFee(symbol: string, params?: {}): Promise<{
22
+ info: any;
23
+ symbol: string;
24
+ maker: number;
25
+ taker: number;
26
+ }>;
22
27
  fetchPublicTradingFee(symbol: string, params?: {}): Promise<{
23
28
  info: any;
24
29
  symbol: string;
package/js/src/latoken.js CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  // ---------------------------------------------------------------------------
8
8
  import Exchange from './abstract/latoken.js';
9
- import { ExchangeError, AuthenticationError, InvalidNonce, BadRequest, ExchangeNotAvailable, PermissionDenied, AccountSuspended, RateLimitExceeded, InsufficientFunds, BadSymbol, InvalidOrder, ArgumentsRequired } from './base/errors.js';
9
+ import { ExchangeError, AuthenticationError, InvalidNonce, BadRequest, ExchangeNotAvailable, PermissionDenied, AccountSuspended, RateLimitExceeded, InsufficientFunds, BadSymbol, InvalidOrder, ArgumentsRequired, NotSupported } from './base/errors.js';
10
10
  import { TICK_SIZE } from './base/functions/number.js';
11
11
  import { sha512 } from './static_dependencies/noble-hashes/sha512.js';
12
12
  // ---------------------------------------------------------------------------
@@ -829,13 +829,19 @@ export default class latoken extends Exchange {
829
829
  * @param {object} [params] extra parameters specific to the exchange API endpoint
830
830
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
831
831
  */
832
- let method = this.safeString(params, 'method');
832
+ const options = this.safeValue(this.options, 'fetchTradingFee', {});
833
+ const defaultMethod = this.safeString(options, 'method', 'fetchPrivateTradingFee');
834
+ const method = this.safeString(params, 'method', defaultMethod);
833
835
  params = this.omit(params, 'method');
834
- if (method === undefined) {
835
- const options = this.safeValue(this.options, 'fetchTradingFee', {});
836
- method = this.safeString(options, 'method', 'fetchPrivateTradingFee');
836
+ if (method === 'fetchPrivateTradingFee') {
837
+ return await this.fetchPrivateTradingFee(symbol, params);
838
+ }
839
+ else if (method === 'fetchPublicTradingFee') {
840
+ return await this.fetchPublicTradingFee(symbol, params);
841
+ }
842
+ else {
843
+ throw new NotSupported(this.id + ' not support this method');
837
844
  }
838
- return await this[method](symbol, params);
839
845
  }
840
846
  async fetchPublicTradingFee(symbol, params = {}) {
841
847
  await this.loadMarkets();
@@ -901,18 +907,20 @@ export default class latoken extends Exchange {
901
907
  // 'from': this.milliseconds (),
902
908
  // 'limit': limit, // default '100'
903
909
  };
904
- let method = 'privateGetAuthTrade';
905
910
  let market = undefined;
911
+ if (limit !== undefined) {
912
+ request['limit'] = limit; // default 100
913
+ }
914
+ let response = undefined;
906
915
  if (symbol !== undefined) {
907
916
  market = this.market(symbol);
908
917
  request['currency'] = market['baseId'];
909
918
  request['quote'] = market['quoteId'];
910
- method = 'privateGetAuthTradePairCurrencyQuote';
919
+ response = await this.privateGetAuthTradePairCurrencyQuote(this.extend(request, params));
911
920
  }
912
- if (limit !== undefined) {
913
- request['limit'] = limit; // default 100
921
+ else {
922
+ response = await this.privateGetAuthTrade(this.extend(request, params));
914
923
  }
915
- const response = await this[method](this.extend(request, params));
916
924
  //
917
925
  // [
918
926
  // {
@@ -1578,22 +1586,21 @@ export default class latoken extends Exchange {
1578
1586
  */
1579
1587
  await this.loadMarkets();
1580
1588
  const currency = this.currency(code);
1581
- let method = undefined;
1589
+ const request = {
1590
+ 'currency': currency['id'],
1591
+ 'recipient': toAccount,
1592
+ 'value': this.currencyToPrecision(code, amount),
1593
+ };
1594
+ let response = undefined;
1582
1595
  if (toAccount.indexOf('@') >= 0) {
1583
- method = 'privatePostAuthTransferEmail';
1596
+ response = await this.privatePostAuthTransferEmail(this.extend(request, params));
1584
1597
  }
1585
1598
  else if (toAccount.length === 36) {
1586
- method = 'privatePostAuthTransferId';
1599
+ response = await this.privatePostAuthTransferId(this.extend(request, params));
1587
1600
  }
1588
1601
  else {
1589
- method = 'privatePostAuthTransferPhone';
1602
+ response = await this.privatePostAuthTransferPhone(this.extend(request, params));
1590
1603
  }
1591
- const request = {
1592
- 'currency': currency['id'],
1593
- 'recipient': toAccount,
1594
- 'value': this.currencyToPrecision(code, amount),
1595
- };
1596
- const response = await this[method](this.extend(request, params));
1597
1604
  //
1598
1605
  // {
1599
1606
  // "id": "e6fc4ace-7750-44e4-b7e9-6af038ac7107",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.1.72",
3
+ "version": "4.1.73",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 130+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.js",
6
6
  "type": "module",