ccxt 4.2.67 → 4.2.69

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.
@@ -248,6 +248,9 @@ class krakenfutures extends krakenfutures$1 {
248
248
  },
249
249
  },
250
250
  },
251
+ 'fetchTrades': {
252
+ 'method': 'historyGetMarketSymbolExecutions', // historyGetMarketSymbolExecutions, publicGetHistory
253
+ },
251
254
  },
252
255
  'timeframes': {
253
256
  '1m': '1m',
@@ -697,6 +700,7 @@ class krakenfutures extends krakenfutures$1 {
697
700
  * @method
698
701
  * @name krakenfutures#fetchTrades
699
702
  * @see https://docs.futures.kraken.com/#http-api-trading-v3-api-market-data-get-trade-history
703
+ * @see https://docs.futures.kraken.com/#http-api-history-market-history-get-public-execution-events
700
704
  * @description Fetch a history of filled trades that this account has made
701
705
  * @param {string} symbol Unified CCXT market symbol
702
706
  * @param {int} [since] Timestamp in ms of earliest trade. Not used by krakenfutures except in combination with params.until
@@ -704,6 +708,7 @@ class krakenfutures extends krakenfutures$1 {
704
708
  * @param {object} [params] Exchange specific params
705
709
  * @param {int} [params.until] Timestamp in ms of latest trade
706
710
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
711
+ * @param {string} [params.method] The method to use to fetch trades. Can be 'historyGetMarketSymbolExecutions' or 'publicGetHistory' default is 'historyGetMarketSymbolExecutions'
707
712
  * @returns An array of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
708
713
  */
709
714
  await this.loadMarkets();
@@ -713,38 +718,113 @@ class krakenfutures extends krakenfutures$1 {
713
718
  return await this.fetchPaginatedCallDynamic('fetchTrades', symbol, since, limit, params);
714
719
  }
715
720
  const market = this.market(symbol);
716
- const request = {
721
+ let request = {
717
722
  'symbol': market['id'],
718
723
  };
719
- const until = this.safeInteger(params, 'until');
720
- if (until !== undefined) {
721
- request['lastTime'] = this.iso8601(until);
724
+ let method = undefined;
725
+ [method, params] = this.handleOptionAndParams(params, 'fetchTrades', 'method', 'historyGetMarketSymbolExecutions');
726
+ let rawTrades = undefined;
727
+ const isFullHistoryEndpoint = (method === 'historyGetMarketSymbolExecutions');
728
+ if (isFullHistoryEndpoint) {
729
+ [request, params] = this.handleUntilOption('before', request, params);
730
+ if (since !== undefined) {
731
+ request['since'] = since;
732
+ request['sort'] = 'asc';
733
+ }
734
+ if (limit !== undefined) {
735
+ request['count'] = limit;
736
+ }
737
+ const response = await this.historyGetMarketSymbolExecutions(this.extend(request, params));
738
+ //
739
+ // {
740
+ // "elements": [
741
+ // {
742
+ // "uid": "a5105030-f054-44cc-98ab-30d5cae96bef",
743
+ // "timestamp": "1710150778607",
744
+ // "event": {
745
+ // "Execution": {
746
+ // "execution": {
747
+ // "uid": "2d485b71-cd28-4a1e-9364-371a127550d2",
748
+ // "makerOrder": {
749
+ // "uid": "0a25f66b-1109-49ec-93a3-d17bf9e9137e",
750
+ // "tradeable": "PF_XBTUSD",
751
+ // "direction": "Buy",
752
+ // "quantity": "0.26500",
753
+ // "timestamp": "1710150778570",
754
+ // "limitPrice": "71907",
755
+ // "orderType": "Post",
756
+ // "reduceOnly": false,
757
+ // "lastUpdateTimestamp": "1710150778570"
758
+ // },
759
+ // "takerOrder": {
760
+ // "uid": "04de3ee0-9125-4960-bf8f-f63b577b6790",
761
+ // "tradeable": "PF_XBTUSD",
762
+ // "direction": "Sell",
763
+ // "quantity": "0.0002",
764
+ // "timestamp": "1710150778607",
765
+ // "limitPrice": "71187.00",
766
+ // "orderType": "Market",
767
+ // "reduceOnly": false,
768
+ // "lastUpdateTimestamp": "1710150778607"
769
+ // },
770
+ // "timestamp": "1710150778607",
771
+ // "quantity": "0.0002",
772
+ // "price": "71907",
773
+ // "markPrice": "71903.32715463147",
774
+ // "limitFilled": false,
775
+ // "usdValue": "14.38"
776
+ // },
777
+ // "takerReducedQuantity": ""
778
+ // }
779
+ // }
780
+ // },
781
+ // ... followed by older items
782
+ // ],
783
+ // "len": "1000",
784
+ // "continuationToken": "QTexMDE0OTe33NTcyXy8xNDIzAjc1NjY5MwI="
785
+ // }
786
+ //
787
+ const elements = this.safeList(response, 'elements', []);
788
+ // we need to reverse the list to fix chronology
789
+ rawTrades = [];
790
+ const length = elements.length;
791
+ for (let i = 0; i < length; i++) {
792
+ const index = length - 1 - i;
793
+ const element = elements[index];
794
+ const event = this.safeDict(element, 'event', {});
795
+ const executionContainer = this.safeDict(event, 'Execution', {});
796
+ const rawTrade = this.safeDict(executionContainer, 'execution', {});
797
+ rawTrades.push(rawTrade);
798
+ }
722
799
  }
723
- //
724
- // {
725
- // "result": "success",
726
- // "history": [
727
- // {
728
- // "time": "2022-03-18T04:55:37.692Z",
729
- // "trade_id": 100,
730
- // "price": 0.7921,
731
- // "size": 1068,
732
- // "side": "sell",
733
- // "type": "fill",
734
- // "uid": "6c5da0b0-f1a8-483f-921f-466eb0388265"
735
- // },
736
- // ...
737
- // ],
738
- // "serverTime": "2022-03-18T06:39:18.056Z"
739
- // }
740
- //
741
- const response = await this.publicGetHistory(this.extend(request, params));
742
- const history = this.safeValue(response, 'history');
743
- return this.parseTrades(history, market, since, limit);
800
+ else {
801
+ [request, params] = this.handleUntilOption('lastTime', request, params);
802
+ const response = await this.publicGetHistory(this.extend(request, params));
803
+ //
804
+ // {
805
+ // "result": "success",
806
+ // "history": [
807
+ // {
808
+ // "time": "2022-03-18T04:55:37.692Z",
809
+ // "trade_id": 100,
810
+ // "price": 0.7921,
811
+ // "size": 1068,
812
+ // "side": "sell",
813
+ // "type": "fill",
814
+ // "uid": "6c5da0b0-f1a8-483f-921f-466eb0388265"
815
+ // },
816
+ // ...
817
+ // ],
818
+ // "serverTime": "2022-03-18T06:39:18.056Z"
819
+ // }
820
+ //
821
+ rawTrades = this.safeList(response, 'history', []);
822
+ }
823
+ return this.parseTrades(rawTrades, market, since, limit);
744
824
  }
745
825
  parseTrade(trade, market = undefined) {
746
826
  //
747
- // fetchTrades (public)
827
+ // fetchTrades (recent trades)
748
828
  //
749
829
  // {
750
830
  // "time": "2019-02-14T09:25:33.920Z",
@@ -752,10 +832,24 @@ class krakenfutures extends krakenfutures$1 {
752
832
  // "price": 3574,
753
833
  // "size": 100,
754
834
  // "side": "buy",
755
- // "type": "fill" // fill, liquidation, assignment, termination
835
+ // "type": "fill" // fill, liquidation, assignment, termination
756
836
  // "uid": "11c3d82c-9e70-4fe9-8115-f643f1b162d4"
757
837
  // }
758
838
  //
839
+ // fetchTrades (executions history)
840
+ //
841
+ // {
842
+ // "timestamp": "1710152516830",
843
+ // "price": "71927.0",
844
+ // "quantity": "0.0695",
845
+ // "markPrice": "71936.38701675525",
846
+ // "limitFilled": true,
847
+ // "usdValue": "4998.93",
848
+ // "uid": "116ae634-253f-470b-bd20-fa9d429fb8b1",
849
+ // "makerOrder": { "uid": "17bfe4de-c01e-4938-926c-617d2a2d0597", "tradeable": "PF_XBTUSD", "direction": "Buy", "quantity": "0.0695", "timestamp": "1710152515836", "limitPrice": "71927.0", "orderType": "Post", "reduceOnly": false, "lastUpdateTimestamp": "1710152515836" },
850
+ // "takerOrder": { "uid": "d3e437b4-aa70-4108-b5cf-b1eecb9845b5", "tradeable": "PF_XBTUSD", "direction": "Sell", "quantity": "0.940100", "timestamp": "1710152516830", "limitPrice": "71915", "orderType": "IoC", "reduceOnly": false, "lastUpdateTimestamp": "1710152516830" }
851
+ // }
852
+ //
759
853
  // fetchMyTrades (private)
760
854
  //
761
855
  // {
@@ -794,9 +888,9 @@ class krakenfutures extends krakenfutures$1 {
794
888
  // "type": "EXECUTION"
795
889
  // }
796
890
  //
797
- const timestamp = this.parse8601(this.safeString2(trade, 'time', 'fillTime'));
891
+ let timestamp = this.parse8601(this.safeString2(trade, 'time', 'fillTime'));
798
892
  const price = this.safeString(trade, 'price');
799
- const amount = this.safeString2(trade, 'size', 'amount', '0.0');
893
+ const amount = this.safeStringN(trade, ['size', 'amount', 'quantity'], '0.0');
800
894
  let id = this.safeString2(trade, 'uid', 'fill_id');
801
895
  if (id === undefined) {
802
896
  id = this.safeString(trade, 'executionId');
@@ -845,6 +939,15 @@ class krakenfutures extends krakenfutures$1 {
845
939
  takerOrMaker = 'maker';
846
940
  }
847
941
  }
942
+ const isHistoricalExecution = ('takerOrder' in trade);
943
+ if (isHistoricalExecution) {
944
+ timestamp = this.safeInteger(trade, 'timestamp');
945
+ const taker = this.safeDict(trade, 'takerOrder', {});
946
+ if (taker !== undefined) {
947
+ side = this.safeStringLower(taker, 'direction');
948
+ takerOrMaker = 'taker';
949
+ }
950
+ }
848
951
  return this.safeTrade({
849
952
  'info': trade,
850
953
  'id': id,
@@ -410,6 +410,7 @@ class kucoin extends kucoin$1 {
410
410
  '12h': '12hour',
411
411
  '1d': '1day',
412
412
  '1w': '1week',
413
+ '1M': '1month',
413
414
  },
414
415
  'precisionMode': number.TICK_SIZE,
415
416
  'exceptions': {
@@ -4459,7 +4460,7 @@ class kucoin extends kucoin$1 {
4459
4460
  url = url + endpoint;
4460
4461
  const isFuturePrivate = (api === 'futuresPrivate');
4461
4462
  const isPrivate = (api === 'private');
4462
- const isBroker = (api === 'private');
4463
+ const isBroker = (api === 'broker');
4463
4464
  if (isPrivate || isFuturePrivate || isBroker) {
4464
4465
  this.checkRequiredCredentials();
4465
4466
  const timestamp = this.nonce().toString();
@@ -4491,7 +4492,9 @@ class kucoin extends kucoin$1 {
4491
4492
  }
4492
4493
  if (isBroker) {
4493
4494
  const brokerName = this.safeString(partner, 'name');
4494
- headers['KC-BROKER-NAME'] = brokerName;
4495
+ if (brokerName !== undefined) {
4496
+ headers['KC-BROKER-NAME'] = brokerName;
4497
+ }
4495
4498
  }
4496
4499
  }
4497
4500
  return { 'url': url, 'method': method, 'body': body, 'headers': headers };
@@ -426,7 +426,7 @@ class lbank extends lbank$1 {
426
426
  // "volume":6.3607,
427
427
  // "amount":77148.9303,
428
428
  // "price":12129,
429
- // "direction":"sell",
429
+ // "direction":"sell", // or "sell_market"
430
430
  // "TS":"2019-06-28T19:55:49.460"
431
431
  // },
432
432
  // "type":"trade",
@@ -466,7 +466,7 @@ class lbank extends lbank$1 {
466
466
  // "volume":6.3607,
467
467
  // "amount":77148.9303,
468
468
  // "price":12129,
469
- // "direction":"sell",
469
+ // "direction":"sell", // or "sell_market"
470
470
  // "TS":"2019-06-28T19:55:49.460"
471
471
  // }
472
472
  //
@@ -475,6 +475,8 @@ class lbank extends lbank$1 {
475
475
  if (timestamp === undefined) {
476
476
  timestamp = this.parse8601(datetime);
477
477
  }
478
+ let side = this.safeString2(trade, 'direction', 3);
479
+ side = side.replace('_market', '');
478
480
  return this.safeTrade({
479
481
  'timestamp': timestamp,
480
482
  'datetime': datetime,
@@ -483,7 +485,7 @@ class lbank extends lbank$1 {
483
485
  'order': undefined,
484
486
  'type': undefined,
485
487
  'takerOrMaker': undefined,
486
- 'side': this.safeString2(trade, 'direction', 3),
488
+ 'side': side,
487
489
  'price': this.safeString2(trade, 'price', 1),
488
490
  'amount': this.safeString2(trade, 'volume', 2),
489
491
  'cost': this.safeString(trade, 'amount'),
@@ -3,4 +3,4 @@ m2r2==0.2.7
3
3
  # https://github.com/CrossNox/m2r2/issues/47
4
4
  mistune==0.8.4
5
5
  sphinx-rtd-theme==0.5.2
6
- readthedocs-sphinx-search==0.1.0
6
+ readthedocs-sphinx-search==0.3.2
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 { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, Leverage, Leverages } 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.2.66";
7
+ declare const version = "4.2.68";
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.2.67';
41
+ const version = '4.2.69';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -192,6 +192,7 @@ interface Exchange {
192
192
  spotPrivatePostV2SubUserApiKeyModification(params?: {}): Promise<implicitReturnType>;
193
193
  spotPrivatePostV2SubUserApiKeyDeletion(params?: {}): Promise<implicitReturnType>;
194
194
  spotPrivatePostV1SubuserTransfer(params?: {}): Promise<implicitReturnType>;
195
+ spotPrivatePostV1TrustUserActiveCredit(params?: {}): Promise<implicitReturnType>;
195
196
  spotPrivatePostV1OrderOrdersPlace(params?: {}): Promise<implicitReturnType>;
196
197
  spotPrivatePostV1OrderBatchOrders(params?: {}): Promise<implicitReturnType>;
197
198
  spotPrivatePostV1OrderAutoPlace(params?: {}): Promise<implicitReturnType>;
@@ -192,6 +192,7 @@ interface htx {
192
192
  spotPrivatePostV2SubUserApiKeyModification(params?: {}): Promise<implicitReturnType>;
193
193
  spotPrivatePostV2SubUserApiKeyDeletion(params?: {}): Promise<implicitReturnType>;
194
194
  spotPrivatePostV1SubuserTransfer(params?: {}): Promise<implicitReturnType>;
195
+ spotPrivatePostV1TrustUserActiveCredit(params?: {}): Promise<implicitReturnType>;
195
196
  spotPrivatePostV1OrderOrdersPlace(params?: {}): Promise<implicitReturnType>;
196
197
  spotPrivatePostV1OrderBatchOrders(params?: {}): Promise<implicitReturnType>;
197
198
  spotPrivatePostV1OrderAutoPlace(params?: {}): Promise<implicitReturnType>;
@@ -795,7 +795,8 @@ export default class Exchange {
795
795
  setHeaders(headers: any): any;
796
796
  marketId(symbol: string): string;
797
797
  symbol(symbol: string): string;
798
- handleParamString(params: object, paramName: string, defaultValue?: any): [string, object];
798
+ handleParamString(params: object, paramName: string, defaultValue?: Str): [string, object];
799
+ handleParamInteger(params: object, paramName: string, defaultValue?: Int): [Int, object];
799
800
  resolvePath(path: any, params: any): any[];
800
801
  getListFromObjectValues(objects: any, key: IndexType): any[];
801
802
  getSymbolsForMarketType(marketType?: string, subType?: string, symbolWithActiveStatus?: boolean, symbolWithUnknownStatus?: boolean): any[];
@@ -3522,6 +3522,13 @@ export default class Exchange {
3522
3522
  }
3523
3523
  return [value, params];
3524
3524
  }
3525
+ handleParamInteger(params, paramName, defaultValue = undefined) {
3526
+ const value = this.safeInteger(params, paramName, defaultValue);
3527
+ if (value !== undefined) {
3528
+ params = this.omit(params, paramName);
3529
+ }
3530
+ return [value, params];
3531
+ }
3525
3532
  resolvePath(path, params) {
3526
3533
  return [
3527
3534
  this.implodeParams(path, params),
@@ -11,8 +11,10 @@ export declare type SubType = 'linear' | 'inverse' | undefined;
11
11
  export interface Dictionary<T> {
12
12
  [key: string]: T;
13
13
  }
14
- export declare type Dict = Dictionary<any> | undefined;
14
+ export declare type Dict = Dictionary<any>;
15
+ export declare type NullableDict = Dict | undefined;
15
16
  export declare type List = Array<any> | undefined;
17
+ export declare type NullableList = List | undefined;
16
18
  /** Request parameters */
17
19
  export interface MinMax {
18
20
  min: Num;
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/bitstamp.js';
2
- import type { Balances, Currency, Int, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction } from './base/types.js';
2
+ import type { Balances, Currency, Int, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry } from './base/types.js';
3
3
  /**
4
4
  * @class bitstamp
5
5
  * @augments Exchange
@@ -132,6 +132,19 @@ export default class bitstamp extends Exchange {
132
132
  info: any;
133
133
  }>;
134
134
  withdraw(code: string, amount: number, address: any, tag?: any, params?: {}): Promise<Transaction>;
135
+ transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
136
+ parseTransfer(transfer: any, currency?: any): {
137
+ info: any;
138
+ id: any;
139
+ timestamp: any;
140
+ datetime: any;
141
+ currency: any;
142
+ amount: any;
143
+ fromAccount: any;
144
+ toAccount: any;
145
+ status: string;
146
+ };
147
+ parseTransferStatus(status: any): string;
135
148
  nonce(): number;
136
149
  sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
137
150
  url: string;
@@ -88,6 +88,7 @@ export default class bitstamp extends Exchange {
88
88
  'setLeverage': false,
89
89
  'setMarginMode': false,
90
90
  'setPositionMode': false,
91
+ 'transfer': true,
91
92
  'withdraw': true,
92
93
  },
93
94
  'urls': {
@@ -2122,6 +2123,73 @@ export default class bitstamp extends Exchange {
2122
2123
  const response = await this[method](this.extend(request, params));
2123
2124
  return this.parseTransaction(response, currency);
2124
2125
  }
2126
+ async transfer(code, amount, fromAccount, toAccount, params = {}) {
2127
+ /**
2128
+ * @method
2129
+ * @name bitstamp#transfer
2130
+ * @description transfer currency internally between wallets on the same account
2131
+ * @see https://www.bitstamp.net/api/#tag/Sub-account/operation/TransferFromMainToSub
2132
+ * @see https://www.bitstamp.net/api/#tag/Sub-account/operation/TransferFromSubToMain
2133
+ * @param {string} code unified currency code
2134
+ * @param {float} amount amount to transfer
2135
+ * @param {string} fromAccount account to transfer from
2136
+ * @param {string} toAccount account to transfer to
2137
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2138
+ * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
2139
+ */
2140
+ await this.loadMarkets();
2141
+ const currency = this.currency(code);
2142
+ amount = this.currencyToPrecision(code, amount);
2143
+ amount = this.parseToNumeric(amount);
2144
+ const request = {
2145
+ 'amount': amount,
2146
+ 'currency': currency['id'].toUpperCase(),
2147
+ };
2148
+ let response = undefined;
2149
+ if (fromAccount === 'main') {
2150
+ request['subAccount'] = toAccount;
2151
+ response = await this.privatePostTransferFromMain(this.extend(request, params));
2152
+ }
2153
+ else if (toAccount === 'main') {
2154
+ request['subAccount'] = fromAccount;
2155
+ response = await this.privatePostTransferToMain(this.extend(request, params));
2156
+ }
2157
+ else {
2158
+ throw new BadRequest(this.id + ' transfer() only supports from or to main');
2159
+ }
2160
+ //
2161
+ // { status: 'ok' }
2162
+ //
2163
+ const transfer = this.parseTransfer(response, currency);
2164
+ transfer['amount'] = amount;
2165
+ transfer['fromAccount'] = fromAccount;
2166
+ transfer['toAccount'] = toAccount;
2167
+ return transfer;
2168
+ }
2169
+ parseTransfer(transfer, currency = undefined) {
2170
+ //
2171
+ // { status: 'ok' }
2172
+ //
2173
+ const status = this.safeString(transfer, 'status');
2174
+ return {
2175
+ 'info': transfer,
2176
+ 'id': undefined,
2177
+ 'timestamp': undefined,
2178
+ 'datetime': undefined,
2179
+ 'currency': currency['code'],
2180
+ 'amount': undefined,
2181
+ 'fromAccount': undefined,
2182
+ 'toAccount': undefined,
2183
+ 'status': this.parseTransferStatus(status),
2184
+ };
2185
+ }
2186
+ parseTransferStatus(status) {
2187
+ const statuses = {
2188
+ 'ok': 'ok',
2189
+ 'error': 'failed',
2190
+ };
2191
+ return this.safeString(statuses, status, status);
2192
+ }
2125
2193
  nonce() {
2126
2194
  return this.milliseconds();
2127
2195
  }
package/js/src/gate.js CHANGED
@@ -4483,7 +4483,10 @@ export default class gate extends Exchange {
4483
4483
  if (lastTradeTimestamp === undefined) {
4484
4484
  lastTradeTimestamp = this.safeTimestamp2(order, 'update_time', 'finish_time');
4485
4485
  }
4486
- const marketType = ('currency_pair' in order) ? 'spot' : 'contract';
4486
+ let marketType = 'contract';
4487
+ if (('currency_pair' in order) || ('market' in order)) {
4488
+ marketType = 'spot';
4489
+ }
4487
4490
  const exchangeSymbol = this.safeString2(order, 'currency_pair', 'market', contract);
4488
4491
  const symbol = this.safeSymbol(exchangeSymbol, market, '_', marketType);
4489
4492
  // Everything below this(above return) is related to fees
@@ -12,7 +12,7 @@ export default class gemini extends Exchange {
12
12
  fetchMarketsFromWeb(params?: {}): Promise<any[]>;
13
13
  parseMarketActive(status: any): boolean;
14
14
  fetchUSDTMarkets(params?: {}): Promise<any[]>;
15
- fetchMarketsFromAPI(params?: {}): Promise<unknown[]>;
15
+ fetchMarketsFromAPI(params?: {}): Promise<any[]>;
16
16
  parseMarket(response: any): Market;
17
17
  fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
18
18
  fetchTickerV1(symbol: string, params?: {}): Promise<Ticker>;