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
@@ -44,8 +44,8 @@ class wazirx extends wazirx$1 {
44
44
  'fetchClosedOrders': false,
45
45
  'fetchCrossBorrowRate': false,
46
46
  'fetchCrossBorrowRates': false,
47
- 'fetchCurrencies': false,
48
- 'fetchDepositAddress': false,
47
+ 'fetchCurrencies': true,
48
+ 'fetchDepositAddress': true,
49
49
  'fetchDepositAddressesByNetwork': false,
50
50
  'fetchDeposits': true,
51
51
  'fetchDepositsWithdrawals': false,
@@ -85,7 +85,7 @@ class wazirx extends wazirx$1 {
85
85
  'fetchTransactionFees': false,
86
86
  'fetchTransactions': false,
87
87
  'fetchTransfers': false,
88
- 'fetchWithdrawals': false,
88
+ 'fetchWithdrawals': true,
89
89
  'reduceMargin': false,
90
90
  'repayCrossMargin': false,
91
91
  'repayIsolatedMargin': false,
@@ -110,7 +110,7 @@ class wazirx extends wazirx$1 {
110
110
  'public': {
111
111
  'get': {
112
112
  'exchangeInfo': 1,
113
- 'depth': 1,
113
+ 'depth': 0.5,
114
114
  'ping': 1,
115
115
  'systemStatus': 1,
116
116
  'tickers/24hr': 1,
@@ -129,6 +129,11 @@ class wazirx extends wazirx$1 {
129
129
  'openOrders': 1,
130
130
  'order': 0.5,
131
131
  'myTrades': 0.5,
132
+ 'coins': 12,
133
+ 'crypto/withdraws': 12,
134
+ 'crypto/deposits/address': 60,
135
+ 'sub_account/fund_transfer/history': 1,
136
+ 'sub_account/accounts': 1,
132
137
  },
133
138
  'post': {
134
139
  'order': 0.1,
@@ -174,6 +179,9 @@ class wazirx extends wazirx$1 {
174
179
  'options': {
175
180
  // 'fetchTradesMethod': 'privateGetHistoricalTrades',
176
181
  'recvWindow': 10000,
182
+ 'networks': {
183
+ // You can get network from fetchCurrencies
184
+ },
177
185
  },
178
186
  });
179
187
  }
@@ -911,6 +919,308 @@ class wazirx extends wazirx$1 {
911
919
  };
912
920
  return this.safeString(statuses, status, status);
913
921
  }
922
+ async fetchCurrencies(params = {}) {
923
+ /**
924
+ * @method
925
+ * @name wazirx#fetchCurrencies
926
+ * @description fetches all available currencies on an exchange
927
+ * @see https://docs.wazirx.com/#all-coins-39-information-user_data
928
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
929
+ * @returns {object} an associative dictionary of currencies
930
+ */
931
+ if (!this.checkRequiredCredentials(false)) {
932
+ return undefined;
933
+ }
934
+ const response = await this.privateGetCoins(params);
935
+ //
936
+ // [
937
+ // {
938
+ // "currency": "btc",
939
+ // "name": "Bitcoin",
940
+ // "networkList": [
941
+ // {
942
+ // "addressRegex": "^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^(bc1)[0-9A-Za-z]{39,59}$",
943
+ // "confirmations": 4,
944
+ // "depositDesc": {
945
+ // "description": ""
946
+ // },
947
+ // "depositDust": "0.00000001",
948
+ // "depositEnable": true,
949
+ // "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",
950
+ // "fullName": null,
951
+ // "hidden": {
952
+ // "deposit": false,
953
+ // "withdraw": false
954
+ // },
955
+ // "isDefault": true,
956
+ // "maxWithdrawAmount": "3",
957
+ // "minConfirm": 4,
958
+ // "minWithdrawAmount": "0.003",
959
+ // "name": "Bitcoin",
960
+ // "network": "btc",
961
+ // "order": 3,
962
+ // "precision": 8,
963
+ // "requestId": "6d67a13d-26f7-4941-9856-94eba4adfe78",
964
+ // "shortName": "BTC",
965
+ // "specialTip": "Please ensure to select \u003cb\u003eBitcoin\u003c/b\u003e network at sender's wallet.",
966
+ // "withdrawConsent": {
967
+ // "helpUrl": null,
968
+ // "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."
969
+ // },
970
+ // "withdrawDesc": {
971
+ // "description": ""
972
+ // },
973
+ // "withdrawEnable": true,
974
+ // "withdrawFee": "0.0015"
975
+ // }
976
+ // ],
977
+ // "rapidListed": false
978
+ // }
979
+ // ]
980
+ //
981
+ const result = {};
982
+ for (let i = 0; i < response.length; i++) {
983
+ const currency = response[i];
984
+ const currencyId = this.safeString(currency, 'currency');
985
+ const code = this.safeCurrencyCode(currencyId);
986
+ const name = this.safeString(currency, 'name');
987
+ const chains = this.safeList(currency, 'networkList', []);
988
+ const networks = {};
989
+ let minPrecision = undefined;
990
+ let minWithdrawFeeString = undefined;
991
+ let minWithdrawString = undefined;
992
+ let maxWithdrawString = undefined;
993
+ let minDepositString = undefined;
994
+ let deposit = false;
995
+ let withdraw = false;
996
+ for (let j = 0; j < chains.length; j++) {
997
+ const chain = chains[j];
998
+ const networkId = this.safeString(chain, 'network');
999
+ const networkCode = this.networkIdToCode(networkId);
1000
+ const precision = this.parseNumber(this.parsePrecision(this.safeString(chain, 'precision')));
1001
+ minPrecision = (minPrecision === undefined) ? precision : Math.min(minPrecision, precision);
1002
+ const depositAllowed = this.safeBool(chain, 'depositEnable');
1003
+ deposit = (depositAllowed) ? depositAllowed : deposit;
1004
+ const withdrawAllowed = this.safeBool(chain, 'withdrawEnable');
1005
+ withdraw = (withdrawAllowed) ? withdrawAllowed : withdraw;
1006
+ const withdrawFeeString = this.safeString(chain, 'withdrawFee');
1007
+ if (withdrawFeeString !== undefined) {
1008
+ minWithdrawFeeString = (minWithdrawFeeString === undefined) ? withdrawFeeString : Precise["default"].stringMin(withdrawFeeString, minWithdrawFeeString);
1009
+ }
1010
+ const minNetworkWithdrawString = this.safeString(chain, 'minWithdrawAmount');
1011
+ if (minNetworkWithdrawString !== undefined) {
1012
+ minWithdrawString = (minWithdrawString === undefined) ? minNetworkWithdrawString : Precise["default"].stringMin(minNetworkWithdrawString, minWithdrawString);
1013
+ }
1014
+ const maxNetworkWithdrawString = this.safeString(chain, 'maxWithdrawAmount');
1015
+ if (maxNetworkWithdrawString !== undefined) {
1016
+ maxWithdrawString = (maxWithdrawString === undefined) ? maxNetworkWithdrawString : Precise["default"].stringMin(maxNetworkWithdrawString, maxWithdrawString);
1017
+ }
1018
+ const minNetworkDepositString = this.safeString(chain, 'depositDust');
1019
+ if (minNetworkDepositString !== undefined) {
1020
+ minDepositString = (minDepositString === undefined) ? minNetworkDepositString : Precise["default"].stringMin(minNetworkDepositString, minDepositString);
1021
+ }
1022
+ networks[networkCode] = {
1023
+ 'info': chain,
1024
+ 'id': networkId,
1025
+ 'network': networkCode,
1026
+ 'active': depositAllowed && withdrawAllowed,
1027
+ 'deposit': depositAllowed,
1028
+ 'withdraw': withdrawAllowed,
1029
+ 'fee': this.parseNumber(withdrawFeeString),
1030
+ 'precision': precision,
1031
+ 'limits': {
1032
+ 'withdraw': {
1033
+ 'min': this.parseNumber(minNetworkWithdrawString),
1034
+ 'max': this.parseNumber(maxNetworkWithdrawString),
1035
+ },
1036
+ 'deposit': {
1037
+ 'min': this.parseNumber(minNetworkDepositString),
1038
+ 'max': undefined,
1039
+ },
1040
+ },
1041
+ };
1042
+ }
1043
+ result[code] = {
1044
+ 'info': currency,
1045
+ 'code': code,
1046
+ 'id': currencyId,
1047
+ 'name': name,
1048
+ 'active': deposit && withdraw,
1049
+ 'deposit': deposit,
1050
+ 'withdraw': withdraw,
1051
+ 'fee': this.parseNumber(minWithdrawFeeString),
1052
+ 'precision': minPrecision,
1053
+ 'limits': {
1054
+ 'amount': {
1055
+ 'min': undefined,
1056
+ 'max': undefined,
1057
+ },
1058
+ 'withdraw': {
1059
+ 'min': this.parseNumber(minWithdrawString),
1060
+ 'max': this.parseNumber(maxWithdrawString),
1061
+ },
1062
+ 'deposit': {
1063
+ 'min': this.parseNumber(minDepositString),
1064
+ 'max': undefined,
1065
+ },
1066
+ },
1067
+ 'networks': networks,
1068
+ };
1069
+ }
1070
+ return result;
1071
+ }
1072
+ async fetchDepositAddress(code, params = {}) {
1073
+ /**
1074
+ * @method
1075
+ * @name wazirx#fetchDepositAddress
1076
+ * @description fetch the deposit address for a currency associated with this account
1077
+ * @see https://docs.wazirx.com/#deposit-address-supporting-network-user_data
1078
+ * @param {string} code unified currency code of the currency for the deposit address
1079
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1080
+ * @param {string} [params.network] unified network code, you can get network from fetchCurrencies
1081
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
1082
+ */
1083
+ await this.loadMarkets();
1084
+ const currency = this.currency(code);
1085
+ const networkCode = this.safeString(params, 'network');
1086
+ params = this.omit(params, 'network');
1087
+ if (networkCode === undefined) {
1088
+ throw new errors.ArgumentsRequired(this.id + ' fetchDepositAddress() requires a network parameter');
1089
+ }
1090
+ const request = {
1091
+ 'coin': currency['id'],
1092
+ 'network': this.networkCodeToId(networkCode, code),
1093
+ };
1094
+ const response = await this.privateGetCryptoDepositsAddress(this.extend(request, params));
1095
+ //
1096
+ // {
1097
+ // "address": "bc1qrzpyzh69pfclpqy7c3yg8rkjsy49se7642v4q3",
1098
+ // "coin": "btc",
1099
+ // "url": "https: //live.blockcypher.com/btc/address/bc1qrzpyzh69pfclpqy7c3yg8rkjsy49se7642v4q3"
1100
+ // }
1101
+ //
1102
+ return {
1103
+ 'currency': code,
1104
+ 'address': this.safeString(response, 'address'),
1105
+ 'tag': undefined,
1106
+ 'network': this.networkCodeToId(networkCode, code),
1107
+ 'info': response,
1108
+ };
1109
+ }
1110
+ async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
1111
+ /**
1112
+ * @method
1113
+ * @name wazirx#fetchWithdrawals
1114
+ * @description fetch all withdrawals made from an account
1115
+ * @see https://docs.wazirx.com/#withdraw-history-supporting-network-user_data
1116
+ * @param {string} code unified currency code
1117
+ * @param {int} [since] the earliest time in ms to fetch withdrawals for
1118
+ * @param {int} [limit] the maximum number of withdrawals structures to retrieve
1119
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1120
+ * @param {int} [params.until] the latest time in ms to fetch entries for
1121
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
1122
+ */
1123
+ await this.loadMarkets();
1124
+ const request = {};
1125
+ let currency = undefined;
1126
+ if (code !== undefined) {
1127
+ currency = this.currency(code);
1128
+ request['coin'] = currency['id'];
1129
+ }
1130
+ if (limit !== undefined) {
1131
+ request['limit'] = limit;
1132
+ }
1133
+ const until = this.safeInteger(params, 'until');
1134
+ params = this.omit(params, ['until']);
1135
+ if (since !== undefined) {
1136
+ request['startTime'] = since;
1137
+ }
1138
+ if (until !== undefined) {
1139
+ request['endTime'] = until;
1140
+ }
1141
+ const response = await this.privateGetCryptoWithdraws(this.extend(request, params));
1142
+ //
1143
+ // [
1144
+ // {
1145
+ // "address": "0x94df8b352de7f46f64b01d3666bf6e936e44ce60",
1146
+ // "amount": "8.91000000",
1147
+ // "createdAt": "2019-10-12 09:12:02",
1148
+ // "lastUpdated": "2019-10-12 11:12:02",
1149
+ // "coin": "USDT",
1150
+ // "id": "b6ae22b3aa844210a7041aee7589627c",
1151
+ // "withdrawOrderId": "WITHDRAWtest123",
1152
+ // "network": "ETH",
1153
+ // "status": 1,
1154
+ // "transactionFee": "0.004",
1155
+ // "failureInfo":"The address is not valid. Please confirm with the recipient",
1156
+ // "txId": "0xb5ef8c13b968a406cc62a93a8bd80f9e9a906ef1b3fcf20a2e48573c17659268"
1157
+ // }
1158
+ // ]
1159
+ //
1160
+ return this.parseTransactions(response, currency, since, limit);
1161
+ }
1162
+ parseTransactionStatus(status) {
1163
+ const statuses = {
1164
+ '0': 'ok',
1165
+ '1': 'fail',
1166
+ '2': 'pending',
1167
+ '3': 'canceled',
1168
+ };
1169
+ return this.safeString(statuses, status, status);
1170
+ }
1171
+ parseTransaction(transaction, currency = undefined) {
1172
+ //
1173
+ // {
1174
+ // "address": "0x94df8b352de7f46f64b01d3666bf6e936e44ce60",
1175
+ // "amount": "8.91000000",
1176
+ // "createdAt": "2019-10-12 09:12:02",
1177
+ // "lastUpdated": "2019-10-12 11:12:02",
1178
+ // "coin": "USDT",
1179
+ // "id": "b6ae22b3aa844210a7041aee7589627c",
1180
+ // "withdrawOrderId": "WITHDRAWtest123",
1181
+ // "network": "ETH",
1182
+ // "status": 1,
1183
+ // "transactionFee": "0.004",
1184
+ // "failureInfo": "The address is not valid. Please confirm with the recipient",
1185
+ // "txId": "0xb5ef8c13b968a406cc62a93a8bd80f9e9a906ef1b3fcf20a2e48573c17659268"
1186
+ // }
1187
+ //
1188
+ const currencyId = this.safeString(transaction, 'coin');
1189
+ const code = this.safeCurrencyCode(currencyId, currency);
1190
+ const timestamp = this.parse8601(this.safeString(transaction, 'createdAt'));
1191
+ const updated = this.parse8601(this.safeString(transaction, 'lastUpdated'));
1192
+ const status = this.parseTransactionStatus(this.safeString(transaction, 'status'));
1193
+ const feeCost = this.safeNumber(transaction, 'transactionFee');
1194
+ let fee = undefined;
1195
+ if (feeCost !== undefined) {
1196
+ fee = {
1197
+ 'cost': feeCost,
1198
+ 'currency': code,
1199
+ };
1200
+ }
1201
+ return {
1202
+ 'info': transaction,
1203
+ 'id': this.safeString(transaction, 'id'),
1204
+ 'txid': this.safeString(transaction, 'txId'),
1205
+ 'timestamp': timestamp,
1206
+ 'datetime': this.iso8601(timestamp),
1207
+ 'network': this.networkIdToCode(this.safeString(transaction, 'network')),
1208
+ 'address': this.safeString(transaction, 'address'),
1209
+ 'addressTo': this.safeString(transaction, 'address'),
1210
+ 'addressFrom': undefined,
1211
+ 'tag': undefined,
1212
+ 'tagTo': undefined,
1213
+ 'tagFrom': undefined,
1214
+ 'type': 'withdrawal',
1215
+ 'amount': this.safeNumber(transaction, 'amount'),
1216
+ 'currency': code,
1217
+ 'status': status,
1218
+ 'updated': updated,
1219
+ 'fee': fee,
1220
+ 'internal': undefined,
1221
+ 'comment': undefined,
1222
+ };
1223
+ }
914
1224
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
915
1225
  let url = this.urls['api']['rest'] + '/' + path;
916
1226
  if (api === 'public') {