ccxt 4.2.60 → 4.2.62
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 +6 -5
- package/build.sh +1 -1
- package/dist/ccxt.browser.js +11280 -3407
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +4 -1
- package/dist/cjs/src/abstract/hyperliquid.js +9 -0
- package/dist/cjs/src/base/Exchange.js +22 -1
- package/dist/cjs/src/base/functions/encode.js +5 -0
- package/dist/cjs/src/base/functions.js +1 -0
- package/dist/cjs/src/bitfinex2.js +1 -1
- package/dist/cjs/src/bitget.js +74 -23
- package/dist/cjs/src/coinbase.js +108 -103
- package/dist/cjs/src/coinex.js +61 -1
- package/dist/cjs/src/hyperliquid.js +2035 -0
- package/dist/cjs/src/kraken.js +8 -2
- package/dist/cjs/src/krakenfutures.js +28 -0
- package/dist/cjs/src/kucoinfutures.js +2 -2
- package/dist/cjs/src/okx.js +1 -1
- package/dist/cjs/src/phemex.js +2 -2
- package/dist/cjs/src/pro/bingx.js +1 -0
- package/dist/cjs/src/static_dependencies/ethers/abi-coder.js +158 -0
- package/dist/cjs/src/static_dependencies/ethers/address/address.js +144 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/abstract-coder.js +407 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/address.js +45 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/anonymous.js +28 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/array.js +176 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/boolean.js +27 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/bytes.js +52 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/fixed-bytes.js +45 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/null.js +30 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/number.js +60 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/string.js +27 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/tuple.js +68 -0
- package/dist/cjs/src/static_dependencies/ethers/fragments.js +614 -0
- package/dist/cjs/src/static_dependencies/ethers/hash/typed-data.js +492 -0
- package/dist/cjs/src/static_dependencies/ethers/index.js +35 -0
- package/dist/cjs/src/static_dependencies/ethers/interface.js +44 -0
- package/dist/cjs/src/static_dependencies/ethers/typed.js +618 -0
- package/dist/cjs/src/static_dependencies/ethers/utils/base58.js +20 -0
- package/dist/cjs/src/static_dependencies/ethers/utils/data.js +134 -0
- package/dist/cjs/src/static_dependencies/ethers/utils/errors.js +228 -0
- package/dist/cjs/src/static_dependencies/ethers/utils/events.js +13 -0
- package/dist/cjs/src/static_dependencies/ethers/utils/fixednumber.js +29 -0
- package/dist/cjs/src/static_dependencies/ethers/utils/index.js +53 -0
- package/dist/cjs/src/static_dependencies/ethers/utils/maths.js +231 -0
- package/dist/cjs/src/static_dependencies/ethers/utils/properties.js +47 -0
- package/dist/cjs/src/static_dependencies/ethers/utils/utf8.js +218 -0
- package/dist/cjs/src/static_dependencies/messagepack/msgpack.js +292 -0
- package/dist/cjs/src/tokocrypto.js +22 -2
- package/dist/cjs/src/wazirx.js +308 -3
- package/js/ccxt.d.ts +5 -2
- package/js/ccxt.js +4 -2
- package/js/src/abstract/coinbase.d.ts +3 -3
- package/js/src/abstract/hyperliquid.d.ts +9 -0
- package/js/src/abstract/hyperliquid.js +11 -0
- package/js/src/base/Exchange.d.ts +4 -0
- package/js/src/base/Exchange.js +13 -1
- package/js/src/base/functions/encode.d.ts +2 -1
- package/js/src/base/functions/encode.js +5 -1
- package/js/src/bitfinex2.js +1 -1
- package/js/src/bitget.js +74 -23
- package/js/src/coinbase.js +108 -103
- package/js/src/coinex.d.ts +3 -1
- package/js/src/coinex.js +61 -1
- package/js/src/hyperliquid.d.ts +83 -0
- package/js/src/hyperliquid.js +2036 -0
- package/js/src/kraken.js +8 -2
- package/js/src/krakenfutures.d.ts +2 -1
- package/js/src/krakenfutures.js +28 -0
- package/js/src/kucoinfutures.js +2 -2
- package/js/src/okx.js +1 -1
- package/js/src/phemex.js +2 -2
- package/js/src/pro/bingx.js +1 -0
- package/js/src/static_dependencies/ethers/abi-coder.d.ts +50 -0
- package/js/src/static_dependencies/ethers/abi-coder.js +148 -0
- package/js/src/static_dependencies/ethers/address/address.d.ts +55 -0
- package/js/src/static_dependencies/ethers/address/address.js +162 -0
- package/js/src/static_dependencies/ethers/address/checks.d.ts +80 -0
- package/js/src/static_dependencies/ethers/address/checks.js +119 -0
- package/js/src/static_dependencies/ethers/address/contract-address.d.ts +47 -0
- package/js/src/static_dependencies/ethers/address/contract-address.js +73 -0
- package/js/src/static_dependencies/ethers/address/index.d.ts +48 -0
- package/js/src/static_dependencies/ethers/address/index.js +24 -0
- package/js/src/static_dependencies/ethers/bytes32.d.ts +14 -0
- package/js/src/static_dependencies/ethers/bytes32.js +45 -0
- package/js/src/static_dependencies/ethers/coders/abstract-coder.d.ts +120 -0
- package/js/src/static_dependencies/ethers/coders/abstract-coder.js +424 -0
- package/js/src/static_dependencies/ethers/coders/address.d.ts +12 -0
- package/js/src/static_dependencies/ethers/coders/address.js +34 -0
- package/js/src/static_dependencies/ethers/coders/anonymous.d.ts +14 -0
- package/js/src/static_dependencies/ethers/coders/anonymous.js +27 -0
- package/js/src/static_dependencies/ethers/coders/array.d.ts +24 -0
- package/js/src/static_dependencies/ethers/coders/array.js +162 -0
- package/js/src/static_dependencies/ethers/coders/boolean.d.ts +12 -0
- package/js/src/static_dependencies/ethers/coders/boolean.js +26 -0
- package/js/src/static_dependencies/ethers/coders/bytes.d.ts +18 -0
- package/js/src/static_dependencies/ethers/coders/bytes.js +39 -0
- package/js/src/static_dependencies/ethers/coders/fixed-bytes.d.ts +14 -0
- package/js/src/static_dependencies/ethers/coders/fixed-bytes.js +32 -0
- package/js/src/static_dependencies/ethers/coders/null.d.ts +11 -0
- package/js/src/static_dependencies/ethers/coders/null.js +29 -0
- package/js/src/static_dependencies/ethers/coders/number.d.ts +15 -0
- package/js/src/static_dependencies/ethers/coders/number.js +48 -0
- package/js/src/static_dependencies/ethers/coders/string.d.ts +12 -0
- package/js/src/static_dependencies/ethers/coders/string.js +26 -0
- package/js/src/static_dependencies/ethers/coders/tuple.d.ts +15 -0
- package/js/src/static_dependencies/ethers/coders/tuple.js +67 -0
- package/js/src/static_dependencies/ethers/fragments.d.ts +458 -0
- package/js/src/static_dependencies/ethers/fragments.js +1252 -0
- package/js/src/static_dependencies/ethers/hash/index.d.ts +10 -0
- package/js/src/static_dependencies/ethers/hash/index.js +15 -0
- package/js/src/static_dependencies/ethers/hash/solidity.d.ts +30 -0
- package/js/src/static_dependencies/ethers/hash/solidity.js +107 -0
- package/js/src/static_dependencies/ethers/hash/typed-data.d.ts +144 -0
- package/js/src/static_dependencies/ethers/hash/typed-data.js +490 -0
- package/js/src/static_dependencies/ethers/index.d.ts +19 -0
- package/js/src/static_dependencies/ethers/index.js +22 -0
- package/js/src/static_dependencies/ethers/interface.d.ts +380 -0
- package/js/src/static_dependencies/ethers/interface.js +990 -0
- package/js/src/static_dependencies/ethers/typed.d.ts +569 -0
- package/js/src/static_dependencies/ethers/typed.js +608 -0
- package/js/src/static_dependencies/ethers/utils/base58.d.ts +22 -0
- package/js/src/static_dependencies/ethers/utils/base58.js +68 -0
- package/js/src/static_dependencies/ethers/utils/base64-browser.d.ts +3 -0
- package/js/src/static_dependencies/ethers/utils/base64-browser.js +24 -0
- package/js/src/static_dependencies/ethers/utils/base64.d.ts +39 -0
- package/js/src/static_dependencies/ethers/utils/base64.js +58 -0
- package/js/src/static_dependencies/ethers/utils/data.d.ts +92 -0
- package/js/src/static_dependencies/ethers/utils/data.js +175 -0
- package/js/src/static_dependencies/ethers/utils/errors.d.ts +509 -0
- package/js/src/static_dependencies/ethers/utils/errors.js +227 -0
- package/js/src/static_dependencies/ethers/utils/events.d.ts +76 -0
- package/js/src/static_dependencies/ethers/utils/events.js +52 -0
- package/js/src/static_dependencies/ethers/utils/fixednumber.d.ts +251 -0
- package/js/src/static_dependencies/ethers/utils/fixednumber.js +529 -0
- package/js/src/static_dependencies/ethers/utils/index.d.ts +30 -0
- package/js/src/static_dependencies/ethers/utils/index.js +38 -0
- package/js/src/static_dependencies/ethers/utils/maths.d.ts +65 -0
- package/js/src/static_dependencies/ethers/utils/maths.js +220 -0
- package/js/src/static_dependencies/ethers/utils/properties.d.ts +22 -0
- package/js/src/static_dependencies/ethers/utils/properties.js +59 -0
- package/js/src/static_dependencies/ethers/utils/rlp-decode.d.ts +5 -0
- package/js/src/static_dependencies/ethers/utils/rlp-decode.js +84 -0
- package/js/src/static_dependencies/ethers/utils/rlp-encode.d.ts +5 -0
- package/js/src/static_dependencies/ethers/utils/rlp-encode.js +54 -0
- package/js/src/static_dependencies/ethers/utils/rlp.d.ts +16 -0
- package/js/src/static_dependencies/ethers/utils/rlp.js +14 -0
- package/js/src/static_dependencies/ethers/utils/units.d.ts +23 -0
- package/js/src/static_dependencies/ethers/utils/units.js +88 -0
- package/js/src/static_dependencies/ethers/utils/utf8.d.ts +95 -0
- package/js/src/static_dependencies/ethers/utils/utf8.js +225 -0
- package/js/src/static_dependencies/ethers/utils/uuid.d.ts +7 -0
- package/js/src/static_dependencies/ethers/utils/uuid.js +35 -0
- package/js/src/static_dependencies/messagepack/msgpack.d.ts +2 -0
- package/js/src/static_dependencies/messagepack/msgpack.js +572 -0
- package/js/src/tokocrypto.js +22 -2
- package/js/src/wazirx.d.ts +12 -1
- package/js/src/wazirx.js +308 -3
- package/package.json +1 -1
- package/skip-tests.json +18 -0
package/dist/cjs/src/wazirx.js
CHANGED
|
@@ -44,8 +44,8 @@ class wazirx extends wazirx$1 {
|
|
|
44
44
|
'fetchClosedOrders': false,
|
|
45
45
|
'fetchCrossBorrowRate': false,
|
|
46
46
|
'fetchCrossBorrowRates': false,
|
|
47
|
-
'fetchCurrencies':
|
|
48
|
-
'fetchDepositAddress':
|
|
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':
|
|
88
|
+
'fetchWithdrawals': true,
|
|
89
89
|
'reduceMargin': false,
|
|
90
90
|
'repayCrossMargin': false,
|
|
91
91
|
'repayIsolatedMargin': false,
|
|
@@ -179,6 +179,9 @@ class wazirx extends wazirx$1 {
|
|
|
179
179
|
'options': {
|
|
180
180
|
// 'fetchTradesMethod': 'privateGetHistoricalTrades',
|
|
181
181
|
'recvWindow': 10000,
|
|
182
|
+
'networks': {
|
|
183
|
+
// You can get network from fetchCurrencies
|
|
184
|
+
},
|
|
182
185
|
},
|
|
183
186
|
});
|
|
184
187
|
}
|
|
@@ -916,6 +919,308 @@ class wazirx extends wazirx$1 {
|
|
|
916
919
|
};
|
|
917
920
|
return this.safeString(statuses, status, status);
|
|
918
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
|
+
}
|
|
919
1224
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
920
1225
|
let url = this.urls['api']['rest'] + '/' + path;
|
|
921
1226
|
if (api === 'public') {
|
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.
|
|
7
|
+
declare const version = "4.2.61";
|
|
8
8
|
import ace from './src/ace.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import ascendex from './src/ascendex.js';
|
|
@@ -69,6 +69,7 @@ import hollaex from './src/hollaex.js';
|
|
|
69
69
|
import htx from './src/htx.js';
|
|
70
70
|
import huobi from './src/huobi.js';
|
|
71
71
|
import huobijp from './src/huobijp.js';
|
|
72
|
+
import hyperliquid from './src/hyperliquid.js';
|
|
72
73
|
import idex from './src/idex.js';
|
|
73
74
|
import independentreserve from './src/independentreserve.js';
|
|
74
75
|
import indodax from './src/indodax.js';
|
|
@@ -231,6 +232,7 @@ declare const exchanges: {
|
|
|
231
232
|
htx: typeof htx;
|
|
232
233
|
huobi: typeof huobi;
|
|
233
234
|
huobijp: typeof huobijp;
|
|
235
|
+
hyperliquid: typeof hyperliquid;
|
|
234
236
|
idex: typeof idex;
|
|
235
237
|
independentreserve: typeof independentreserve;
|
|
236
238
|
indodax: typeof indodax;
|
|
@@ -464,6 +466,7 @@ declare const ccxt: {
|
|
|
464
466
|
htx: typeof htx;
|
|
465
467
|
huobi: typeof huobi;
|
|
466
468
|
huobijp: typeof huobijp;
|
|
469
|
+
hyperliquid: typeof hyperliquid;
|
|
467
470
|
idex: typeof idex;
|
|
468
471
|
independentreserve: typeof independentreserve;
|
|
469
472
|
indodax: typeof indodax;
|
|
@@ -501,5 +504,5 @@ declare const ccxt: {
|
|
|
501
504
|
zaif: typeof zaif;
|
|
502
505
|
zonda: typeof zonda;
|
|
503
506
|
} & typeof functions & typeof errors;
|
|
504
|
-
export { version, Exchange, exchanges, pro, Precise, functions, errors, 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, 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, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
507
|
+
export { version, Exchange, exchanges, pro, Precise, functions, errors, 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, 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, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
505
508
|
export default ccxt;
|
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.
|
|
41
|
+
const version = '4.2.62';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -105,6 +105,7 @@ import hollaex from './src/hollaex.js';
|
|
|
105
105
|
import htx from './src/htx.js';
|
|
106
106
|
import huobi from './src/huobi.js';
|
|
107
107
|
import huobijp from './src/huobijp.js';
|
|
108
|
+
import hyperliquid from './src/hyperliquid.js';
|
|
108
109
|
import idex from './src/idex.js';
|
|
109
110
|
import independentreserve from './src/independentreserve.js';
|
|
110
111
|
import indodax from './src/indodax.js';
|
|
@@ -268,6 +269,7 @@ const exchanges = {
|
|
|
268
269
|
'htx': htx,
|
|
269
270
|
'huobi': huobi,
|
|
270
271
|
'huobijp': huobijp,
|
|
272
|
+
'hyperliquid': hyperliquid,
|
|
271
273
|
'idex': idex,
|
|
272
274
|
'independentreserve': independentreserve,
|
|
273
275
|
'indodax': indodax,
|
|
@@ -380,6 +382,6 @@ pro.exchanges = Object.keys(pro);
|
|
|
380
382
|
pro['Exchange'] = Exchange; // now the same for rest and ts
|
|
381
383
|
//-----------------------------------------------------------------------------
|
|
382
384
|
const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
|
|
383
|
-
export { version, Exchange, exchanges, pro, Precise, functions, errors, 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, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
385
|
+
export { version, Exchange, exchanges, pro, Precise, functions, errors, 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, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
384
386
|
export default ccxt;
|
|
385
387
|
//-----------------------------------------------------------------------------
|
|
@@ -56,11 +56,11 @@ interface Exchange {
|
|
|
56
56
|
v3PrivateGetBrokerageProductsProductId(params?: {}): Promise<implicitReturnType>;
|
|
57
57
|
v3PrivateGetBrokerageProductsProductIdCandles(params?: {}): Promise<implicitReturnType>;
|
|
58
58
|
v3PrivateGetBrokerageProductsProductIdTicker(params?: {}): Promise<implicitReturnType>;
|
|
59
|
+
v3PrivateGetBrokerageBestBidAsk(params?: {}): Promise<implicitReturnType>;
|
|
60
|
+
v3PrivateGetBrokerageProductBook(params?: {}): Promise<implicitReturnType>;
|
|
61
|
+
v3PrivateGetBrokerageTransactionSummary(params?: {}): Promise<implicitReturnType>;
|
|
59
62
|
v3PrivateGetBrokeragePortfolios(params?: {}): Promise<implicitReturnType>;
|
|
60
63
|
v3PrivateGetBrokeragePortfoliosPortfolioUuid(params?: {}): Promise<implicitReturnType>;
|
|
61
|
-
v3PrivateGetBrokerageTransactionSummary(params?: {}): Promise<implicitReturnType>;
|
|
62
|
-
v3PrivateGetBrokerageProductBook(params?: {}): Promise<implicitReturnType>;
|
|
63
|
-
v3PrivateGetBrokerageBestBidAsk(params?: {}): Promise<implicitReturnType>;
|
|
64
64
|
v3PrivateGetBrokerageConvertTradeTradeId(params?: {}): Promise<implicitReturnType>;
|
|
65
65
|
v3PrivateGetBrokerageCfmBalanceSummary(params?: {}): Promise<implicitReturnType>;
|
|
66
66
|
v3PrivateGetBrokerageCfmPositions(params?: {}): Promise<implicitReturnType>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { implicitReturnType } from '../base/types.js';
|
|
2
|
+
import { Exchange as _Exchange } from '../base/Exchange.js';
|
|
3
|
+
interface Exchange {
|
|
4
|
+
publicPostInfo(params?: {}): Promise<implicitReturnType>;
|
|
5
|
+
privatePostExchange(params?: {}): Promise<implicitReturnType>;
|
|
6
|
+
}
|
|
7
|
+
declare abstract class Exchange extends _Exchange {
|
|
8
|
+
}
|
|
9
|
+
export default Exchange;
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
|
|
7
|
+
// -------------------------------------------------------------------------------
|
|
8
|
+
import { Exchange as _Exchange } from '../base/Exchange.js';
|
|
9
|
+
class Exchange extends _Exchange {
|
|
10
|
+
}
|
|
11
|
+
export default Exchange;
|
|
@@ -275,6 +275,7 @@ export default class Exchange {
|
|
|
275
275
|
ymd: (timestamp: any, infix: any, fullYear?: boolean) => string;
|
|
276
276
|
base64ToString: (string: any) => string;
|
|
277
277
|
crc32: typeof functions.crc32;
|
|
278
|
+
packb: typeof functions.packb;
|
|
278
279
|
describe(): {
|
|
279
280
|
id: any;
|
|
280
281
|
name: any;
|
|
@@ -617,6 +618,9 @@ export default class Exchange {
|
|
|
617
618
|
setProperty(obj: any, property: any, defaultValue?: any): void;
|
|
618
619
|
axolotl(payload: any, hexKey: any, ed25519: any): string;
|
|
619
620
|
fixStringifiedJsonMembers(content: string): any;
|
|
621
|
+
ethAbiEncode(types: any, args: any): Uint8Array;
|
|
622
|
+
ethEncodeStructuredData(domain: any, messageTypes: any, messageData: any): Uint8Array;
|
|
623
|
+
intToBase16(elem: any): string;
|
|
620
624
|
safeBoolN(dictionaryOrList: any, keys: IndexType[], defaultValue?: boolean): boolean | undefined;
|
|
621
625
|
safeBool2(dictionary: any, key1: IndexType, key2: IndexType, defaultValue?: boolean): boolean | undefined;
|
|
622
626
|
safeBool(dictionary: any, key: IndexType, defaultValue?: boolean): boolean | undefined;
|
package/js/src/base/Exchange.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// ----------------------------------------------------------------------------
|
|
8
8
|
/* eslint-disable */
|
|
9
9
|
import * as functions from './functions.js';
|
|
10
|
-
const { isNode, deepExtend, extend, clone, flatten, unique, indexBy, sortBy, sortBy2, safeFloat2, groupBy, aggregate, uuid, unCamelCase, precisionFromString, Throttler, capitalize, now, decimalToPrecision, safeValue, safeValue2, safeString, safeString2, seconds, milliseconds, binaryToBase16, numberToBE, base16ToBinary, iso8601, omit, isJsonEncodedObject, safeInteger, sum, omitZero, implodeParams, extractParams, json, merge, binaryConcat, hash, ecdsa, arrayConcat, encode, urlencode, hmac, numberToString, parseTimeframe, safeInteger2, safeStringLower, parse8601, yyyymmdd, safeStringUpper, safeTimestamp, binaryConcatArray, uuidv1, numberToLE, ymdhms, stringToBase64, decode, uuid22, safeIntegerProduct2, safeIntegerProduct, safeStringLower2, yymmdd, base58ToBinary, binaryToBase58, safeTimestamp2, rawencode, keysort, inArray, isEmpty, ordered, filterBy, uuid16, safeFloat, base64ToBinary, safeStringUpper2, urlencodeWithArrayRepeat, microseconds, binaryToBase64, strip, toArray, safeFloatN, safeIntegerN, safeIntegerProductN, safeTimestampN, safeValueN, safeStringN, safeStringLowerN, safeStringUpperN, urlencodeNested, parseDate, ymd, base64ToString, crc32, TRUNCATE, ROUND, DECIMAL_PLACES, NO_PADDING, TICK_SIZE, SIGNIFICANT_DIGITS } = functions;
|
|
10
|
+
const { isNode, deepExtend, extend, clone, flatten, unique, indexBy, sortBy, sortBy2, safeFloat2, groupBy, aggregate, uuid, unCamelCase, precisionFromString, Throttler, capitalize, now, decimalToPrecision, safeValue, safeValue2, safeString, safeString2, seconds, milliseconds, binaryToBase16, numberToBE, base16ToBinary, iso8601, omit, isJsonEncodedObject, safeInteger, sum, omitZero, implodeParams, extractParams, json, merge, binaryConcat, hash, ecdsa, arrayConcat, encode, urlencode, hmac, numberToString, parseTimeframe, safeInteger2, safeStringLower, parse8601, yyyymmdd, safeStringUpper, safeTimestamp, binaryConcatArray, uuidv1, numberToLE, ymdhms, stringToBase64, decode, uuid22, safeIntegerProduct2, safeIntegerProduct, safeStringLower2, yymmdd, base58ToBinary, binaryToBase58, safeTimestamp2, rawencode, keysort, inArray, isEmpty, ordered, filterBy, uuid16, safeFloat, base64ToBinary, safeStringUpper2, urlencodeWithArrayRepeat, microseconds, binaryToBase64, strip, toArray, safeFloatN, safeIntegerN, safeIntegerProductN, safeTimestampN, safeValueN, safeStringN, safeStringLowerN, safeStringUpperN, urlencodeNested, parseDate, ymd, base64ToString, crc32, packb, TRUNCATE, ROUND, DECIMAL_PLACES, NO_PADDING, TICK_SIZE, SIGNIFICANT_DIGITS } = functions;
|
|
11
11
|
import { keys as keysFunc, values as valuesFunc, vwap as vwapFunc } from './functions.js';
|
|
12
12
|
// import exceptions from "./errors.js"
|
|
13
13
|
import { // eslint-disable-line object-curly-newline
|
|
@@ -21,6 +21,8 @@ import { OrderBook as WsOrderBook, IndexedOrderBook, CountedOrderBook } from './
|
|
|
21
21
|
//
|
|
22
22
|
import { axolotl } from './functions/crypto.js';
|
|
23
23
|
import totp from './functions/totp.js';
|
|
24
|
+
import ethers from '../static_dependencies/ethers/index.js';
|
|
25
|
+
import { TypedDataEncoder } from '../static_dependencies/ethers/hash/index.js';
|
|
24
26
|
// ----------------------------------------------------------------------------
|
|
25
27
|
/**
|
|
26
28
|
* @class Exchange
|
|
@@ -207,6 +209,7 @@ export default class Exchange {
|
|
|
207
209
|
this.ymd = ymd;
|
|
208
210
|
this.base64ToString = base64ToString;
|
|
209
211
|
this.crc32 = crc32;
|
|
212
|
+
this.packb = packb;
|
|
210
213
|
this.httpProxyAgentModule = undefined;
|
|
211
214
|
this.httpsProxyAgentModule = undefined;
|
|
212
215
|
this.socksProxyAgentModule = undefined;
|
|
@@ -1410,6 +1413,15 @@ export default class Exchange {
|
|
|
1410
1413
|
modifiedContent = modifiedContent.replaceAll('}"', '}');
|
|
1411
1414
|
return modifiedContent;
|
|
1412
1415
|
}
|
|
1416
|
+
ethAbiEncode(types, args) {
|
|
1417
|
+
return this.base16ToBinary(ethers.encode(types, args).slice(2));
|
|
1418
|
+
}
|
|
1419
|
+
ethEncodeStructuredData(domain, messageTypes, messageData) {
|
|
1420
|
+
return this.base16ToBinary(TypedDataEncoder.encode(domain, messageTypes, messageData).slice(-132));
|
|
1421
|
+
}
|
|
1422
|
+
intToBase16(elem) {
|
|
1423
|
+
return elem.toString(16);
|
|
1424
|
+
}
|
|
1413
1425
|
/* eslint-enable */
|
|
1414
1426
|
// ------------------------------------------------------------------------
|
|
1415
1427
|
// ########################################################################
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { concatBytes } from '../../static_dependencies/noble-curves/abstract/utils.js';
|
|
2
2
|
declare const json: (data: any, params?: any) => string, isJsonEncodedObject: (object: any) => boolean, binaryToString: (data: Uint8Array) => string, stringToBinary: (str: string) => Uint8Array, stringToBase64: (string: any) => string, base64ToString: (string: any) => string, base64ToBinary: (str: string) => Uint8Array, binaryToBase64: (data: Uint8Array) => string, base16ToBinary: (str: string) => Uint8Array, binaryToBase16: (data: Uint8Array) => string, base58ToBinary: (str: string) => Uint8Array, binaryToBase58: (data: Uint8Array) => string, binaryConcat: typeof concatBytes, binaryConcatArray: (arr: any) => Uint8Array, urlencode: (object: any) => string, urlencodeNested: (object: any) => string, urlencodeWithArrayRepeat: (object: any) => string, rawencode: (object: any) => string, encode: (str: string) => Uint8Array, decode: (data: Uint8Array) => string, urlencodeBase64: (base64string: any) => any, numberToLE: (n: number, padding: number) => Uint8Array, numberToBE: (n: number, padding: number) => Uint8Array;
|
|
3
|
-
|
|
3
|
+
declare function packb(req: any): Uint8Array;
|
|
4
|
+
export { json, isJsonEncodedObject, binaryToString, stringToBinary, stringToBase64, base64ToBinary, base64ToString, binaryToBase64, base16ToBinary, binaryToBase16, binaryConcat, binaryConcatArray, urlencode, urlencodeWithArrayRepeat, rawencode, encode, decode, urlencodeBase64, numberToLE, numberToBE, base58ToBinary, binaryToBase58, urlencodeNested, packb };
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
/* ------------------------------------------------------------------------ */
|
|
9
9
|
import { base16, base58, base64, utf8 } from "../../static_dependencies/scure-base/index.js";
|
|
10
10
|
import { numberToBytesBE, numberToBytesLE, concatBytes } from '../../static_dependencies/noble-curves/abstract/utils.js';
|
|
11
|
+
import { serialize } from '../../static_dependencies/messagepack/msgpack.js';
|
|
11
12
|
import qs from '../../static_dependencies/qs/index.cjs';
|
|
12
13
|
/* ------------------------------------------------------------------------ */
|
|
13
14
|
const json = (data, params = undefined) => JSON.stringify(data), isJsonEncodedObject = object => ((typeof object === 'string') &&
|
|
@@ -19,7 +20,10 @@ const json = (data, params = undefined) => JSON.stringify(data), isJsonEncodedOb
|
|
|
19
20
|
, urlencodeBase64 = base64string => base64string.replace(/[=]+$/, '')
|
|
20
21
|
.replace(/\+/g, '-')
|
|
21
22
|
.replace(/\//g, '_'), numberToLE = (n, padding) => numberToBytesLE(BigInt(n), padding), numberToBE = (n, padding) => numberToBytesBE(BigInt(n), padding);
|
|
23
|
+
function packb(req) {
|
|
24
|
+
return serialize(req);
|
|
25
|
+
}
|
|
22
26
|
export { json, isJsonEncodedObject, binaryToString, stringToBinary, stringToBase64, base64ToBinary, base64ToString, binaryToBase64, base16ToBinary, binaryToBase16, binaryConcat, binaryConcatArray, urlencode, urlencodeWithArrayRepeat, rawencode, encode, decode
|
|
23
27
|
// Url-safe-base64 without equals signs, with + replaced by - and slashes replaced by underscores
|
|
24
|
-
, urlencodeBase64, numberToLE, numberToBE, base58ToBinary, binaryToBase58, urlencodeNested };
|
|
28
|
+
, urlencodeBase64, numberToLE, numberToBE, base58ToBinary, binaryToBase58, urlencodeNested, packb };
|
|
25
29
|
/* ------------------------------------------------------------------------ */
|
package/js/src/bitfinex2.js
CHANGED
|
@@ -54,8 +54,8 @@ export default class bitfinex2 extends Exchange {
|
|
|
54
54
|
'fetchBalance': true,
|
|
55
55
|
'fetchBorrowInterest': false,
|
|
56
56
|
'fetchBorrowRate': false,
|
|
57
|
-
'fetchBorrowRateHistory': false,
|
|
58
57
|
'fetchBorrowRateHistories': false,
|
|
58
|
+
'fetchBorrowRateHistory': false,
|
|
59
59
|
'fetchBorrowRates': false,
|
|
60
60
|
'fetchBorrowRatesPerSymbol': false,
|
|
61
61
|
'fetchClosedOrder': true,
|