ccxt 4.2.59 → 4.2.61

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.
Files changed (184) hide show
  1. package/README.md +103 -102
  2. package/build.sh +2 -2
  3. package/dist/ccxt.browser.js +11853 -3790
  4. package/dist/ccxt.browser.min.js +7 -7
  5. package/dist/cjs/ccxt.js +4 -1
  6. package/dist/cjs/src/abstract/hyperliquid.js +9 -0
  7. package/dist/cjs/src/ascendex.js +10 -12
  8. package/dist/cjs/src/base/Exchange.js +22 -1
  9. package/dist/cjs/src/base/functions/encode.js +5 -0
  10. package/dist/cjs/src/base/functions.js +1 -0
  11. package/dist/cjs/src/bingx.js +38 -0
  12. package/dist/cjs/src/bitfinex2.js +20 -3
  13. package/dist/cjs/src/bitget.js +9 -2
  14. package/dist/cjs/src/bitmart.js +41 -23
  15. package/dist/cjs/src/blofin.js +59 -1
  16. package/dist/cjs/src/coinbase.js +108 -103
  17. package/dist/cjs/src/coinex.js +61 -1
  18. package/dist/cjs/src/hitbtc.js +1 -1
  19. package/dist/cjs/src/htx.js +4 -1
  20. package/dist/cjs/src/hyperliquid.js +2035 -0
  21. package/dist/cjs/src/kraken.js +50 -41
  22. package/dist/cjs/src/krakenfutures.js +28 -0
  23. package/dist/cjs/src/kucoinfutures.js +3 -2
  24. package/dist/cjs/src/okx.js +1 -1
  25. package/dist/cjs/src/phemex.js +2 -2
  26. package/dist/cjs/src/pro/binance.js +16 -3
  27. package/dist/cjs/src/pro/bingx.js +1 -0
  28. package/dist/cjs/src/static_dependencies/ethers/abi-coder.js +158 -0
  29. package/dist/cjs/src/static_dependencies/ethers/address/address.js +144 -0
  30. package/dist/cjs/src/static_dependencies/ethers/coders/abstract-coder.js +407 -0
  31. package/dist/cjs/src/static_dependencies/ethers/coders/address.js +45 -0
  32. package/dist/cjs/src/static_dependencies/ethers/coders/anonymous.js +28 -0
  33. package/dist/cjs/src/static_dependencies/ethers/coders/array.js +176 -0
  34. package/dist/cjs/src/static_dependencies/ethers/coders/boolean.js +27 -0
  35. package/dist/cjs/src/static_dependencies/ethers/coders/bytes.js +52 -0
  36. package/dist/cjs/src/static_dependencies/ethers/coders/fixed-bytes.js +45 -0
  37. package/dist/cjs/src/static_dependencies/ethers/coders/null.js +30 -0
  38. package/dist/cjs/src/static_dependencies/ethers/coders/number.js +60 -0
  39. package/dist/cjs/src/static_dependencies/ethers/coders/string.js +27 -0
  40. package/dist/cjs/src/static_dependencies/ethers/coders/tuple.js +68 -0
  41. package/dist/cjs/src/static_dependencies/ethers/fragments.js +614 -0
  42. package/dist/cjs/src/static_dependencies/ethers/hash/typed-data.js +492 -0
  43. package/dist/cjs/src/static_dependencies/ethers/index.js +35 -0
  44. package/dist/cjs/src/static_dependencies/ethers/interface.js +44 -0
  45. package/dist/cjs/src/static_dependencies/ethers/typed.js +618 -0
  46. package/dist/cjs/src/static_dependencies/ethers/utils/base58.js +20 -0
  47. package/dist/cjs/src/static_dependencies/ethers/utils/data.js +134 -0
  48. package/dist/cjs/src/static_dependencies/ethers/utils/errors.js +228 -0
  49. package/dist/cjs/src/static_dependencies/ethers/utils/events.js +13 -0
  50. package/dist/cjs/src/static_dependencies/ethers/utils/fixednumber.js +29 -0
  51. package/dist/cjs/src/static_dependencies/ethers/utils/index.js +53 -0
  52. package/dist/cjs/src/static_dependencies/ethers/utils/maths.js +231 -0
  53. package/dist/cjs/src/static_dependencies/ethers/utils/properties.js +47 -0
  54. package/dist/cjs/src/static_dependencies/ethers/utils/utf8.js +218 -0
  55. package/dist/cjs/src/static_dependencies/messagepack/msgpack.js +292 -0
  56. package/dist/cjs/src/tokocrypto.js +22 -2
  57. package/dist/cjs/src/wazirx.js +314 -4
  58. package/dist/cjs/src/woo.js +157 -77
  59. package/js/ccxt.d.ts +5 -2
  60. package/js/ccxt.js +4 -2
  61. package/js/src/abstract/blofin.d.ts +1 -0
  62. package/js/src/abstract/coinbase.d.ts +3 -3
  63. package/js/src/abstract/hyperliquid.d.ts +9 -0
  64. package/js/src/abstract/hyperliquid.js +11 -0
  65. package/js/src/abstract/wazirx.d.ts +5 -0
  66. package/js/src/ascendex.d.ts +2 -2
  67. package/js/src/ascendex.js +10 -12
  68. package/js/src/base/Exchange.d.ts +4 -0
  69. package/js/src/base/Exchange.js +13 -1
  70. package/js/src/base/functions/encode.d.ts +2 -1
  71. package/js/src/base/functions/encode.js +5 -1
  72. package/js/src/bingx.d.ts +3 -1
  73. package/js/src/bingx.js +38 -0
  74. package/js/src/bitfinex2.js +20 -3
  75. package/js/src/bitget.js +9 -2
  76. package/js/src/bitmart.d.ts +9 -2
  77. package/js/src/bitmart.js +41 -23
  78. package/js/src/blofin.d.ts +2 -1
  79. package/js/src/blofin.js +59 -1
  80. package/js/src/coinbase.js +108 -103
  81. package/js/src/coinex.d.ts +3 -1
  82. package/js/src/coinex.js +61 -1
  83. package/js/src/hitbtc.js +1 -1
  84. package/js/src/htx.js +4 -1
  85. package/js/src/hyperliquid.d.ts +83 -0
  86. package/js/src/hyperliquid.js +2036 -0
  87. package/js/src/kraken.js +50 -41
  88. package/js/src/krakenfutures.d.ts +2 -1
  89. package/js/src/krakenfutures.js +28 -0
  90. package/js/src/kucoinfutures.js +3 -2
  91. package/js/src/okx.js +1 -1
  92. package/js/src/phemex.js +2 -2
  93. package/js/src/pro/binance.js +16 -3
  94. package/js/src/pro/bingx.js +1 -0
  95. package/js/src/pro/deribit.d.ts +1 -1
  96. package/js/src/static_dependencies/ethers/abi-coder.d.ts +50 -0
  97. package/js/src/static_dependencies/ethers/abi-coder.js +148 -0
  98. package/js/src/static_dependencies/ethers/address/address.d.ts +55 -0
  99. package/js/src/static_dependencies/ethers/address/address.js +162 -0
  100. package/js/src/static_dependencies/ethers/address/checks.d.ts +80 -0
  101. package/js/src/static_dependencies/ethers/address/checks.js +119 -0
  102. package/js/src/static_dependencies/ethers/address/contract-address.d.ts +47 -0
  103. package/js/src/static_dependencies/ethers/address/contract-address.js +73 -0
  104. package/js/src/static_dependencies/ethers/address/index.d.ts +48 -0
  105. package/js/src/static_dependencies/ethers/address/index.js +24 -0
  106. package/js/src/static_dependencies/ethers/bytes32.d.ts +14 -0
  107. package/js/src/static_dependencies/ethers/bytes32.js +45 -0
  108. package/js/src/static_dependencies/ethers/coders/abstract-coder.d.ts +120 -0
  109. package/js/src/static_dependencies/ethers/coders/abstract-coder.js +424 -0
  110. package/js/src/static_dependencies/ethers/coders/address.d.ts +12 -0
  111. package/js/src/static_dependencies/ethers/coders/address.js +34 -0
  112. package/js/src/static_dependencies/ethers/coders/anonymous.d.ts +14 -0
  113. package/js/src/static_dependencies/ethers/coders/anonymous.js +27 -0
  114. package/js/src/static_dependencies/ethers/coders/array.d.ts +24 -0
  115. package/js/src/static_dependencies/ethers/coders/array.js +162 -0
  116. package/js/src/static_dependencies/ethers/coders/boolean.d.ts +12 -0
  117. package/js/src/static_dependencies/ethers/coders/boolean.js +26 -0
  118. package/js/src/static_dependencies/ethers/coders/bytes.d.ts +18 -0
  119. package/js/src/static_dependencies/ethers/coders/bytes.js +39 -0
  120. package/js/src/static_dependencies/ethers/coders/fixed-bytes.d.ts +14 -0
  121. package/js/src/static_dependencies/ethers/coders/fixed-bytes.js +32 -0
  122. package/js/src/static_dependencies/ethers/coders/null.d.ts +11 -0
  123. package/js/src/static_dependencies/ethers/coders/null.js +29 -0
  124. package/js/src/static_dependencies/ethers/coders/number.d.ts +15 -0
  125. package/js/src/static_dependencies/ethers/coders/number.js +48 -0
  126. package/js/src/static_dependencies/ethers/coders/string.d.ts +12 -0
  127. package/js/src/static_dependencies/ethers/coders/string.js +26 -0
  128. package/js/src/static_dependencies/ethers/coders/tuple.d.ts +15 -0
  129. package/js/src/static_dependencies/ethers/coders/tuple.js +67 -0
  130. package/js/src/static_dependencies/ethers/fragments.d.ts +458 -0
  131. package/js/src/static_dependencies/ethers/fragments.js +1252 -0
  132. package/js/src/static_dependencies/ethers/hash/index.d.ts +10 -0
  133. package/js/src/static_dependencies/ethers/hash/index.js +15 -0
  134. package/js/src/static_dependencies/ethers/hash/solidity.d.ts +30 -0
  135. package/js/src/static_dependencies/ethers/hash/solidity.js +107 -0
  136. package/js/src/static_dependencies/ethers/hash/typed-data.d.ts +144 -0
  137. package/js/src/static_dependencies/ethers/hash/typed-data.js +490 -0
  138. package/js/src/static_dependencies/ethers/index.d.ts +19 -0
  139. package/js/src/static_dependencies/ethers/index.js +22 -0
  140. package/js/src/static_dependencies/ethers/interface.d.ts +380 -0
  141. package/js/src/static_dependencies/ethers/interface.js +990 -0
  142. package/js/src/static_dependencies/ethers/typed.d.ts +569 -0
  143. package/js/src/static_dependencies/ethers/typed.js +608 -0
  144. package/js/src/static_dependencies/ethers/utils/base58.d.ts +22 -0
  145. package/js/src/static_dependencies/ethers/utils/base58.js +68 -0
  146. package/js/src/static_dependencies/ethers/utils/base64-browser.d.ts +3 -0
  147. package/js/src/static_dependencies/ethers/utils/base64-browser.js +24 -0
  148. package/js/src/static_dependencies/ethers/utils/base64.d.ts +39 -0
  149. package/js/src/static_dependencies/ethers/utils/base64.js +58 -0
  150. package/js/src/static_dependencies/ethers/utils/data.d.ts +92 -0
  151. package/js/src/static_dependencies/ethers/utils/data.js +175 -0
  152. package/js/src/static_dependencies/ethers/utils/errors.d.ts +509 -0
  153. package/js/src/static_dependencies/ethers/utils/errors.js +227 -0
  154. package/js/src/static_dependencies/ethers/utils/events.d.ts +76 -0
  155. package/js/src/static_dependencies/ethers/utils/events.js +52 -0
  156. package/js/src/static_dependencies/ethers/utils/fixednumber.d.ts +251 -0
  157. package/js/src/static_dependencies/ethers/utils/fixednumber.js +529 -0
  158. package/js/src/static_dependencies/ethers/utils/index.d.ts +30 -0
  159. package/js/src/static_dependencies/ethers/utils/index.js +38 -0
  160. package/js/src/static_dependencies/ethers/utils/maths.d.ts +65 -0
  161. package/js/src/static_dependencies/ethers/utils/maths.js +220 -0
  162. package/js/src/static_dependencies/ethers/utils/properties.d.ts +22 -0
  163. package/js/src/static_dependencies/ethers/utils/properties.js +59 -0
  164. package/js/src/static_dependencies/ethers/utils/rlp-decode.d.ts +5 -0
  165. package/js/src/static_dependencies/ethers/utils/rlp-decode.js +84 -0
  166. package/js/src/static_dependencies/ethers/utils/rlp-encode.d.ts +5 -0
  167. package/js/src/static_dependencies/ethers/utils/rlp-encode.js +54 -0
  168. package/js/src/static_dependencies/ethers/utils/rlp.d.ts +16 -0
  169. package/js/src/static_dependencies/ethers/utils/rlp.js +14 -0
  170. package/js/src/static_dependencies/ethers/utils/units.d.ts +23 -0
  171. package/js/src/static_dependencies/ethers/utils/units.js +88 -0
  172. package/js/src/static_dependencies/ethers/utils/utf8.d.ts +95 -0
  173. package/js/src/static_dependencies/ethers/utils/utf8.js +225 -0
  174. package/js/src/static_dependencies/ethers/utils/uuid.d.ts +7 -0
  175. package/js/src/static_dependencies/ethers/utils/uuid.js +35 -0
  176. package/js/src/static_dependencies/messagepack/msgpack.d.ts +2 -0
  177. package/js/src/static_dependencies/messagepack/msgpack.js +572 -0
  178. package/js/src/tokocrypto.js +22 -2
  179. package/js/src/wazirx.d.ts +12 -1
  180. package/js/src/wazirx.js +314 -4
  181. package/js/src/woo.d.ts +8 -0
  182. package/js/src/woo.js +157 -77
  183. package/package.json +1 -1
  184. package/skip-tests.json +60 -16
package/js/src/wazirx.js CHANGED
@@ -47,8 +47,8 @@ export default class wazirx extends Exchange {
47
47
  'fetchClosedOrders': false,
48
48
  'fetchCrossBorrowRate': false,
49
49
  'fetchCrossBorrowRates': false,
50
- 'fetchCurrencies': false,
51
- 'fetchDepositAddress': false,
50
+ 'fetchCurrencies': true,
51
+ 'fetchDepositAddress': true,
52
52
  'fetchDepositAddressesByNetwork': false,
53
53
  'fetchDeposits': true,
54
54
  'fetchDepositsWithdrawals': false,
@@ -88,7 +88,7 @@ export default class wazirx extends Exchange {
88
88
  'fetchTransactionFees': false,
89
89
  'fetchTransactions': false,
90
90
  'fetchTransfers': false,
91
- 'fetchWithdrawals': false,
91
+ 'fetchWithdrawals': true,
92
92
  'reduceMargin': false,
93
93
  'repayCrossMargin': false,
94
94
  'repayIsolatedMargin': false,
@@ -113,7 +113,7 @@ export default class wazirx extends Exchange {
113
113
  'public': {
114
114
  'get': {
115
115
  'exchangeInfo': 1,
116
- 'depth': 1,
116
+ 'depth': 0.5,
117
117
  'ping': 1,
118
118
  'systemStatus': 1,
119
119
  'tickers/24hr': 1,
@@ -132,6 +132,11 @@ export default class wazirx extends Exchange {
132
132
  'openOrders': 1,
133
133
  'order': 0.5,
134
134
  'myTrades': 0.5,
135
+ 'coins': 12,
136
+ 'crypto/withdraws': 12,
137
+ 'crypto/deposits/address': 60,
138
+ 'sub_account/fund_transfer/history': 1,
139
+ 'sub_account/accounts': 1,
135
140
  },
136
141
  'post': {
137
142
  'order': 0.1,
@@ -177,6 +182,9 @@ export default class wazirx extends Exchange {
177
182
  'options': {
178
183
  // 'fetchTradesMethod': 'privateGetHistoricalTrades',
179
184
  'recvWindow': 10000,
185
+ 'networks': {
186
+ // You can get network from fetchCurrencies
187
+ },
180
188
  },
181
189
  });
182
190
  }
@@ -914,6 +922,308 @@ export default class wazirx extends Exchange {
914
922
  };
915
923
  return this.safeString(statuses, status, status);
916
924
  }
925
+ async fetchCurrencies(params = {}) {
926
+ /**
927
+ * @method
928
+ * @name wazirx#fetchCurrencies
929
+ * @description fetches all available currencies on an exchange
930
+ * @see https://docs.wazirx.com/#all-coins-39-information-user_data
931
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
932
+ * @returns {object} an associative dictionary of currencies
933
+ */
934
+ if (!this.checkRequiredCredentials(false)) {
935
+ return undefined;
936
+ }
937
+ const response = await this.privateGetCoins(params);
938
+ //
939
+ // [
940
+ // {
941
+ // "currency": "btc",
942
+ // "name": "Bitcoin",
943
+ // "networkList": [
944
+ // {
945
+ // "addressRegex": "^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^(bc1)[0-9A-Za-z]{39,59}$",
946
+ // "confirmations": 4,
947
+ // "depositDesc": {
948
+ // "description": ""
949
+ // },
950
+ // "depositDust": "0.00000001",
951
+ // "depositEnable": true,
952
+ // "disclaimer": "• \u003cb\u003eSend only using the Bitcoin network.\u003c/b\u003e Using any other network will result in loss of funds.\u003cbr/\u003e• \u003cb\u003eDeposit only BTC to this deposit address.\u003c/b\u003e Depositing any other asset will result in a loss of funds.\u003cbr/\u003e",
953
+ // "fullName": null,
954
+ // "hidden": {
955
+ // "deposit": false,
956
+ // "withdraw": false
957
+ // },
958
+ // "isDefault": true,
959
+ // "maxWithdrawAmount": "3",
960
+ // "minConfirm": 4,
961
+ // "minWithdrawAmount": "0.003",
962
+ // "name": "Bitcoin",
963
+ // "network": "btc",
964
+ // "order": 3,
965
+ // "precision": 8,
966
+ // "requestId": "6d67a13d-26f7-4941-9856-94eba4adfe78",
967
+ // "shortName": "BTC",
968
+ // "specialTip": "Please ensure to select \u003cb\u003eBitcoin\u003c/b\u003e network at sender's wallet.",
969
+ // "withdrawConsent": {
970
+ // "helpUrl": null,
971
+ // "message": "I confirm that this withdrawal of crypto assets is being done to my own wallet, as specified above. I authorize you to share travel rule information with the destination wallet service provider wherever applicable."
972
+ // },
973
+ // "withdrawDesc": {
974
+ // "description": ""
975
+ // },
976
+ // "withdrawEnable": true,
977
+ // "withdrawFee": "0.0015"
978
+ // }
979
+ // ],
980
+ // "rapidListed": false
981
+ // }
982
+ // ]
983
+ //
984
+ const result = {};
985
+ for (let i = 0; i < response.length; i++) {
986
+ const currency = response[i];
987
+ const currencyId = this.safeString(currency, 'currency');
988
+ const code = this.safeCurrencyCode(currencyId);
989
+ const name = this.safeString(currency, 'name');
990
+ const chains = this.safeList(currency, 'networkList', []);
991
+ const networks = {};
992
+ let minPrecision = undefined;
993
+ let minWithdrawFeeString = undefined;
994
+ let minWithdrawString = undefined;
995
+ let maxWithdrawString = undefined;
996
+ let minDepositString = undefined;
997
+ let deposit = false;
998
+ let withdraw = false;
999
+ for (let j = 0; j < chains.length; j++) {
1000
+ const chain = chains[j];
1001
+ const networkId = this.safeString(chain, 'network');
1002
+ const networkCode = this.networkIdToCode(networkId);
1003
+ const precision = this.parseNumber(this.parsePrecision(this.safeString(chain, 'precision')));
1004
+ minPrecision = (minPrecision === undefined) ? precision : Math.min(minPrecision, precision);
1005
+ const depositAllowed = this.safeBool(chain, 'depositEnable');
1006
+ deposit = (depositAllowed) ? depositAllowed : deposit;
1007
+ const withdrawAllowed = this.safeBool(chain, 'withdrawEnable');
1008
+ withdraw = (withdrawAllowed) ? withdrawAllowed : withdraw;
1009
+ const withdrawFeeString = this.safeString(chain, 'withdrawFee');
1010
+ if (withdrawFeeString !== undefined) {
1011
+ minWithdrawFeeString = (minWithdrawFeeString === undefined) ? withdrawFeeString : Precise.stringMin(withdrawFeeString, minWithdrawFeeString);
1012
+ }
1013
+ const minNetworkWithdrawString = this.safeString(chain, 'minWithdrawAmount');
1014
+ if (minNetworkWithdrawString !== undefined) {
1015
+ minWithdrawString = (minWithdrawString === undefined) ? minNetworkWithdrawString : Precise.stringMin(minNetworkWithdrawString, minWithdrawString);
1016
+ }
1017
+ const maxNetworkWithdrawString = this.safeString(chain, 'maxWithdrawAmount');
1018
+ if (maxNetworkWithdrawString !== undefined) {
1019
+ maxWithdrawString = (maxWithdrawString === undefined) ? maxNetworkWithdrawString : Precise.stringMin(maxNetworkWithdrawString, maxWithdrawString);
1020
+ }
1021
+ const minNetworkDepositString = this.safeString(chain, 'depositDust');
1022
+ if (minNetworkDepositString !== undefined) {
1023
+ minDepositString = (minDepositString === undefined) ? minNetworkDepositString : Precise.stringMin(minNetworkDepositString, minDepositString);
1024
+ }
1025
+ networks[networkCode] = {
1026
+ 'info': chain,
1027
+ 'id': networkId,
1028
+ 'network': networkCode,
1029
+ 'active': depositAllowed && withdrawAllowed,
1030
+ 'deposit': depositAllowed,
1031
+ 'withdraw': withdrawAllowed,
1032
+ 'fee': this.parseNumber(withdrawFeeString),
1033
+ 'precision': precision,
1034
+ 'limits': {
1035
+ 'withdraw': {
1036
+ 'min': this.parseNumber(minNetworkWithdrawString),
1037
+ 'max': this.parseNumber(maxNetworkWithdrawString),
1038
+ },
1039
+ 'deposit': {
1040
+ 'min': this.parseNumber(minNetworkDepositString),
1041
+ 'max': undefined,
1042
+ },
1043
+ },
1044
+ };
1045
+ }
1046
+ result[code] = {
1047
+ 'info': currency,
1048
+ 'code': code,
1049
+ 'id': currencyId,
1050
+ 'name': name,
1051
+ 'active': deposit && withdraw,
1052
+ 'deposit': deposit,
1053
+ 'withdraw': withdraw,
1054
+ 'fee': this.parseNumber(minWithdrawFeeString),
1055
+ 'precision': minPrecision,
1056
+ 'limits': {
1057
+ 'amount': {
1058
+ 'min': undefined,
1059
+ 'max': undefined,
1060
+ },
1061
+ 'withdraw': {
1062
+ 'min': this.parseNumber(minWithdrawString),
1063
+ 'max': this.parseNumber(maxWithdrawString),
1064
+ },
1065
+ 'deposit': {
1066
+ 'min': this.parseNumber(minDepositString),
1067
+ 'max': undefined,
1068
+ },
1069
+ },
1070
+ 'networks': networks,
1071
+ };
1072
+ }
1073
+ return result;
1074
+ }
1075
+ async fetchDepositAddress(code, params = {}) {
1076
+ /**
1077
+ * @method
1078
+ * @name wazirx#fetchDepositAddress
1079
+ * @description fetch the deposit address for a currency associated with this account
1080
+ * @see https://docs.wazirx.com/#deposit-address-supporting-network-user_data
1081
+ * @param {string} code unified currency code of the currency for the deposit address
1082
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1083
+ * @param {string} [params.network] unified network code, you can get network from fetchCurrencies
1084
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
1085
+ */
1086
+ await this.loadMarkets();
1087
+ const currency = this.currency(code);
1088
+ const networkCode = this.safeString(params, 'network');
1089
+ params = this.omit(params, 'network');
1090
+ if (networkCode === undefined) {
1091
+ throw new ArgumentsRequired(this.id + ' fetchDepositAddress() requires a network parameter');
1092
+ }
1093
+ const request = {
1094
+ 'coin': currency['id'],
1095
+ 'network': this.networkCodeToId(networkCode, code),
1096
+ };
1097
+ const response = await this.privateGetCryptoDepositsAddress(this.extend(request, params));
1098
+ //
1099
+ // {
1100
+ // "address": "bc1qrzpyzh69pfclpqy7c3yg8rkjsy49se7642v4q3",
1101
+ // "coin": "btc",
1102
+ // "url": "https: //live.blockcypher.com/btc/address/bc1qrzpyzh69pfclpqy7c3yg8rkjsy49se7642v4q3"
1103
+ // }
1104
+ //
1105
+ return {
1106
+ 'currency': code,
1107
+ 'address': this.safeString(response, 'address'),
1108
+ 'tag': undefined,
1109
+ 'network': this.networkCodeToId(networkCode, code),
1110
+ 'info': response,
1111
+ };
1112
+ }
1113
+ async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
1114
+ /**
1115
+ * @method
1116
+ * @name wazirx#fetchWithdrawals
1117
+ * @description fetch all withdrawals made from an account
1118
+ * @see https://docs.wazirx.com/#withdraw-history-supporting-network-user_data
1119
+ * @param {string} code unified currency code
1120
+ * @param {int} [since] the earliest time in ms to fetch withdrawals for
1121
+ * @param {int} [limit] the maximum number of withdrawals structures to retrieve
1122
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1123
+ * @param {int} [params.until] the latest time in ms to fetch entries for
1124
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
1125
+ */
1126
+ await this.loadMarkets();
1127
+ const request = {};
1128
+ let currency = undefined;
1129
+ if (code !== undefined) {
1130
+ currency = this.currency(code);
1131
+ request['coin'] = currency['id'];
1132
+ }
1133
+ if (limit !== undefined) {
1134
+ request['limit'] = limit;
1135
+ }
1136
+ const until = this.safeInteger(params, 'until');
1137
+ params = this.omit(params, ['until']);
1138
+ if (since !== undefined) {
1139
+ request['startTime'] = since;
1140
+ }
1141
+ if (until !== undefined) {
1142
+ request['endTime'] = until;
1143
+ }
1144
+ const response = await this.privateGetCryptoWithdraws(this.extend(request, params));
1145
+ //
1146
+ // [
1147
+ // {
1148
+ // "address": "0x94df8b352de7f46f64b01d3666bf6e936e44ce60",
1149
+ // "amount": "8.91000000",
1150
+ // "createdAt": "2019-10-12 09:12:02",
1151
+ // "lastUpdated": "2019-10-12 11:12:02",
1152
+ // "coin": "USDT",
1153
+ // "id": "b6ae22b3aa844210a7041aee7589627c",
1154
+ // "withdrawOrderId": "WITHDRAWtest123",
1155
+ // "network": "ETH",
1156
+ // "status": 1,
1157
+ // "transactionFee": "0.004",
1158
+ // "failureInfo":"The address is not valid. Please confirm with the recipient",
1159
+ // "txId": "0xb5ef8c13b968a406cc62a93a8bd80f9e9a906ef1b3fcf20a2e48573c17659268"
1160
+ // }
1161
+ // ]
1162
+ //
1163
+ return this.parseTransactions(response, currency, since, limit);
1164
+ }
1165
+ parseTransactionStatus(status) {
1166
+ const statuses = {
1167
+ '0': 'ok',
1168
+ '1': 'fail',
1169
+ '2': 'pending',
1170
+ '3': 'canceled',
1171
+ };
1172
+ return this.safeString(statuses, status, status);
1173
+ }
1174
+ parseTransaction(transaction, currency = undefined) {
1175
+ //
1176
+ // {
1177
+ // "address": "0x94df8b352de7f46f64b01d3666bf6e936e44ce60",
1178
+ // "amount": "8.91000000",
1179
+ // "createdAt": "2019-10-12 09:12:02",
1180
+ // "lastUpdated": "2019-10-12 11:12:02",
1181
+ // "coin": "USDT",
1182
+ // "id": "b6ae22b3aa844210a7041aee7589627c",
1183
+ // "withdrawOrderId": "WITHDRAWtest123",
1184
+ // "network": "ETH",
1185
+ // "status": 1,
1186
+ // "transactionFee": "0.004",
1187
+ // "failureInfo": "The address is not valid. Please confirm with the recipient",
1188
+ // "txId": "0xb5ef8c13b968a406cc62a93a8bd80f9e9a906ef1b3fcf20a2e48573c17659268"
1189
+ // }
1190
+ //
1191
+ const currencyId = this.safeString(transaction, 'coin');
1192
+ const code = this.safeCurrencyCode(currencyId, currency);
1193
+ const timestamp = this.parse8601(this.safeString(transaction, 'createdAt'));
1194
+ const updated = this.parse8601(this.safeString(transaction, 'lastUpdated'));
1195
+ const status = this.parseTransactionStatus(this.safeString(transaction, 'status'));
1196
+ const feeCost = this.safeNumber(transaction, 'transactionFee');
1197
+ let fee = undefined;
1198
+ if (feeCost !== undefined) {
1199
+ fee = {
1200
+ 'cost': feeCost,
1201
+ 'currency': code,
1202
+ };
1203
+ }
1204
+ return {
1205
+ 'info': transaction,
1206
+ 'id': this.safeString(transaction, 'id'),
1207
+ 'txid': this.safeString(transaction, 'txId'),
1208
+ 'timestamp': timestamp,
1209
+ 'datetime': this.iso8601(timestamp),
1210
+ 'network': this.networkIdToCode(this.safeString(transaction, 'network')),
1211
+ 'address': this.safeString(transaction, 'address'),
1212
+ 'addressTo': this.safeString(transaction, 'address'),
1213
+ 'addressFrom': undefined,
1214
+ 'tag': undefined,
1215
+ 'tagTo': undefined,
1216
+ 'tagFrom': undefined,
1217
+ 'type': 'withdrawal',
1218
+ 'amount': this.safeNumber(transaction, 'amount'),
1219
+ 'currency': code,
1220
+ 'status': status,
1221
+ 'updated': updated,
1222
+ 'fee': fee,
1223
+ 'internal': undefined,
1224
+ 'comment': undefined,
1225
+ };
1226
+ }
917
1227
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
918
1228
  let url = this.urls['api']['rest'] + '/' + path;
919
1229
  if (api === 'public') {
package/js/src/woo.d.ts CHANGED
@@ -6,6 +6,14 @@ import type { TransferEntry, Balances, Currency, FundingRateHistory, Int, Market
6
6
  */
7
7
  export default class woo extends Exchange {
8
8
  describe(): any;
9
+ fetchStatus(params?: {}): Promise<{
10
+ status: string;
11
+ updated: any;
12
+ eta: any;
13
+ url: any;
14
+ info: any;
15
+ }>;
16
+ fetchTime(params?: {}): Promise<number>;
9
17
  fetchMarkets(params?: {}): Promise<import("./base/types.js").MarketInterface[]>;
10
18
  parseMarket(market: any): Market;
11
19
  fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;