ccxt 4.4.82 → 4.4.85
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 +5 -7
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +1 -9
- package/dist/cjs/src/apex.js +2 -1
- package/dist/cjs/src/base/Exchange.js +15 -2
- package/dist/cjs/src/bitget.js +1 -3
- package/dist/cjs/src/bitrue.js +14 -35
- package/dist/cjs/src/bitso.js +33 -0
- package/dist/cjs/src/bitstamp.js +33 -0
- package/dist/cjs/src/blofin.js +154 -13
- package/dist/cjs/src/btcbox.js +25 -5
- package/dist/cjs/src/bybit.js +16 -40
- package/dist/cjs/src/cex.js +2 -4
- package/dist/cjs/src/coinbase.js +56 -40
- package/dist/cjs/src/coinbaseexchange.js +142 -32
- package/dist/cjs/src/coincatch.js +14 -67
- package/dist/cjs/src/coinex.js +29 -32
- package/dist/cjs/src/coinlist.js +16 -15
- package/dist/cjs/src/coinmetro.js +22 -11
- package/dist/cjs/src/coinone.js +8 -10
- package/dist/cjs/src/coinsph.js +126 -1
- package/dist/cjs/src/cryptocom.js +111 -1
- package/dist/cjs/src/cryptomus.js +43 -89
- package/dist/cjs/src/delta.js +76 -36
- package/dist/cjs/src/derive.js +46 -10
- package/dist/cjs/src/ellipx.js +175 -79
- package/dist/cjs/src/gate.js +1 -1
- package/dist/cjs/src/gemini.js +3 -5
- package/dist/cjs/src/hitbtc.js +56 -69
- package/dist/cjs/src/hyperliquid.js +2 -2
- package/dist/cjs/src/kraken.js +29 -24
- package/dist/cjs/src/kucoinfutures.js +6 -0
- package/dist/cjs/src/lbank.js +1 -1
- package/dist/cjs/src/paradex.js +119 -3
- package/dist/cjs/src/pro/binance.js +31 -33
- package/dist/cjs/src/pro/bithumb.js +5 -3
- package/dist/cjs/src/pro/kraken.js +289 -79
- package/dist/cjs/src/pro/mexc.js +302 -8
- package/dist/cjs/src/pro/poloniex.js +6 -2
- package/examples/js/cli.js +127 -13
- package/js/ccxt.d.ts +2 -11
- package/js/ccxt.js +2 -8
- package/js/src/abstract/blofin.d.ts +8 -0
- package/js/src/abstract/btcbox.d.ts +1 -0
- package/js/src/apex.js +2 -1
- package/js/src/base/Exchange.d.ts +15 -1
- package/js/src/base/Exchange.js +15 -2
- package/js/src/base/types.d.ts +3 -0
- package/js/src/bitget.js +1 -3
- package/js/src/bitrue.js +14 -35
- package/js/src/bitso.js +33 -0
- package/js/src/bitstamp.js +33 -0
- package/js/src/blofin.d.ts +42 -2
- package/js/src/blofin.js +154 -13
- package/js/src/btcbox.js +25 -5
- package/js/src/bybit.js +16 -40
- package/js/src/cex.js +2 -4
- package/js/src/coinbase.js +56 -40
- package/js/src/coinbaseexchange.js +142 -32
- package/js/src/coincatch.js +14 -67
- package/js/src/coinex.js +28 -29
- package/js/src/coinlist.js +16 -15
- package/js/src/coinmetro.js +22 -11
- package/js/src/coinone.js +8 -10
- package/js/src/coinsph.d.ts +10 -1
- package/js/src/coinsph.js +126 -1
- package/js/src/cryptocom.d.ts +10 -1
- package/js/src/cryptocom.js +111 -1
- package/js/src/cryptomus.js +43 -89
- package/js/src/delta.js +76 -36
- package/js/src/derive.js +46 -10
- package/js/src/ellipx.d.ts +2 -3
- package/js/src/ellipx.js +175 -80
- package/js/src/gate.js +1 -1
- package/js/src/gemini.js +3 -5
- package/js/src/hitbtc.js +56 -69
- package/js/src/hyperliquid.js +2 -2
- package/js/src/kraken.js +29 -24
- package/js/src/kucoinfutures.d.ts +1 -0
- package/js/src/kucoinfutures.js +6 -0
- package/js/src/lbank.js +1 -1
- package/js/src/paradex.d.ts +12 -1
- package/js/src/paradex.js +119 -3
- package/js/src/pro/binance.d.ts +26 -26
- package/js/src/pro/binance.js +31 -33
- package/js/src/pro/bithumb.js +5 -3
- package/js/src/pro/kraken.d.ts +7 -6
- package/js/src/pro/kraken.js +290 -80
- package/js/src/pro/mexc.d.ts +58 -0
- package/js/src/pro/mexc.js +302 -8
- package/js/src/pro/poloniex.d.ts +1 -1
- package/js/src/pro/poloniex.js +6 -2
- package/package.json +1 -1
- package/js/src/abstract/bl3p.d.ts +0 -22
- package/js/src/abstract/bl3p.js +0 -11
- package/js/src/abstract/idex.d.ts +0 -29
- package/js/src/abstract/idex.js +0 -11
- package/js/src/bl3p.d.ts +0 -116
- package/js/src/bl3p.js +0 -552
- package/js/src/idex.d.ts +0 -312
- package/js/src/idex.js +0 -1961
- package/js/src/pro/idex.d.ts +0 -81
- package/js/src/pro/idex.js +0 -720
package/dist/cjs/src/ellipx.js
CHANGED
|
@@ -805,85 +805,181 @@ class ellipx extends ellipx$1 {
|
|
|
805
805
|
'results_per_page': 100,
|
|
806
806
|
'_expand': '/Crypto_Token,/Crypto_Chain',
|
|
807
807
|
}, params));
|
|
808
|
-
const
|
|
809
|
-
const data = this.
|
|
808
|
+
const result = {};
|
|
809
|
+
const data = this.safeList(response, 'data', []);
|
|
810
810
|
for (let i = 0; i < data.length; i++) {
|
|
811
|
-
const
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
811
|
+
const networkEntry = data[i];
|
|
812
|
+
//
|
|
813
|
+
// {
|
|
814
|
+
// "Crypto_Token_Info__": "crtev-5nsn35-f4ir-g5hp-iaft-i4ztx6zu",
|
|
815
|
+
// "Crypto_Token__": "crtok-c5v3mh-grfn-hl5d-lmel-fvggbf4i",
|
|
816
|
+
// "Crypto_Chain__": "chain-xjbini-7wlz-dmzf-gm7z-zf7ei6fq",
|
|
817
|
+
// "Type": "native",
|
|
818
|
+
// "Symbol": null,
|
|
819
|
+
// "Name": null,
|
|
820
|
+
// "Contract_Address": null,
|
|
821
|
+
// "Minimum_Deposit": {
|
|
822
|
+
// "v": "6",
|
|
823
|
+
// "e": "6",
|
|
824
|
+
// "f": "6.0e-6"
|
|
825
|
+
// },
|
|
826
|
+
// "Minimum_Withdraw": {
|
|
827
|
+
// "v": "15",
|
|
828
|
+
// "e": "5",
|
|
829
|
+
// "f": "0.00015"
|
|
830
|
+
// },
|
|
831
|
+
// "Withdraw_Fee": {
|
|
832
|
+
// "v": "1",
|
|
833
|
+
// "e": "4",
|
|
834
|
+
// "f": "0.0001"
|
|
835
|
+
// },
|
|
836
|
+
// "Minimum_Collect": null,
|
|
837
|
+
// "Status": "valid",
|
|
838
|
+
// "Can_Deposit": "Y",
|
|
839
|
+
// "Decimals": null,
|
|
840
|
+
// "Priority": "100",
|
|
841
|
+
// "Created": {
|
|
842
|
+
// "unix": "1727552199",
|
|
843
|
+
// "us": "0",
|
|
844
|
+
// "iso": "2024-09-28 19:36:39.000000",
|
|
845
|
+
// "tz": "UTC",
|
|
846
|
+
// "full": "1727552199000000",
|
|
847
|
+
// "unixms": "1727552199000"
|
|
848
|
+
// },
|
|
849
|
+
// "Crypto_Token": {
|
|
850
|
+
// "Crypto_Token__": "crtok-c5v3mh-grfn-hl5d-lmel-fvggbf4i",
|
|
851
|
+
// "Name": "Bitcoin",
|
|
852
|
+
// "Symbol": "BTC",
|
|
853
|
+
// "Decimals": "8",
|
|
854
|
+
// "CMC_Id": "1",
|
|
855
|
+
// "Priority": "100",
|
|
856
|
+
// "Can_Deposit": "Y",
|
|
857
|
+
// "Category": "token",
|
|
858
|
+
// "Testnet": "N",
|
|
859
|
+
// "Created": {
|
|
860
|
+
// "unix": "1727552113",
|
|
861
|
+
// "us": "0",
|
|
862
|
+
// "iso": "2024-09-28 19:35:13.000000",
|
|
863
|
+
// "tz": "UTC",
|
|
864
|
+
// "full": "1727552113000000",
|
|
865
|
+
// "unixms": "1727552113000"
|
|
866
|
+
// },
|
|
867
|
+
// "Logo": [
|
|
868
|
+
// {
|
|
869
|
+
// "Crypto_Token_Logo__": "ctklg-aoozyr-rzm5-fphf-dhm7-5wbtetha",
|
|
870
|
+
// "Crypto_Token__": "crtok-c5v3mh-grfn-hl5d-lmel-fvggbf4i",
|
|
871
|
+
// "Blob__": "blob-d6hvgx-37s5-dh5h-ogj5-qxqvnaoy",
|
|
872
|
+
// "Default": "Y",
|
|
873
|
+
// "Format": "png",
|
|
874
|
+
// "Priority": "0",
|
|
875
|
+
// "Created": {
|
|
876
|
+
// "unix": "1730196627",
|
|
877
|
+
// "us": "929660",
|
|
878
|
+
// "iso": "2024-10-29 10:10:27.929660",
|
|
879
|
+
// "tz": "UTC",
|
|
880
|
+
// "full": "1730196627929660",
|
|
881
|
+
// "unixms": "1730196627929"
|
|
882
|
+
// },
|
|
883
|
+
// "Source": {
|
|
884
|
+
// "Media_Image__": "blob-d6hvgx-37s5-dh5h-ogj5-qxqvnaoy",
|
|
885
|
+
// "Url": "https://static.atonline.net/image/m_X7_tnmIYFCwn6EUVQuMKqrCuPB3CMl4ONTegeYpC0wIg68YZM0CuBpbjspnYwz/1a942eab068a2173e66d08c736283cfe22e1c1ed"
|
|
886
|
+
// }
|
|
887
|
+
// }
|
|
888
|
+
// ]
|
|
889
|
+
// },
|
|
890
|
+
// "Crypto_Chain": {
|
|
891
|
+
// "Crypto_Chain__": "chain-xjbini-7wlz-dmzf-gm7z-zf7ei6fq",
|
|
892
|
+
// "EVM_Chain__": null,
|
|
893
|
+
// "Crypto_Token__": "crtok-c5v3mh-grfn-hl5d-lmel-fvggbf4i",
|
|
894
|
+
// "Name": "Bitcoin",
|
|
895
|
+
// "Key": "bitcoin",
|
|
896
|
+
// "Type": "Bitcoin",
|
|
897
|
+
// "Curve": "secp256k1",
|
|
898
|
+
// "Backend_Url": null,
|
|
899
|
+
// "Wallet_Verification_Methods": {
|
|
900
|
+
// "signature": true
|
|
901
|
+
// },
|
|
902
|
+
// "Block_Margin": "3",
|
|
903
|
+
// "Created": {
|
|
904
|
+
// "unix": "1725340084",
|
|
905
|
+
// "us": "0",
|
|
906
|
+
// "iso": "2024-09-03 05:08:04.000000",
|
|
907
|
+
// "tz": "UTC",
|
|
908
|
+
// "full": "1725340084000000",
|
|
909
|
+
// "unixms": "1725340084000"
|
|
910
|
+
// }
|
|
911
|
+
// }
|
|
912
|
+
// }
|
|
913
|
+
//
|
|
914
|
+
const id = this.safeString(networkEntry, 'Crypto_Token__');
|
|
915
|
+
const token = this.safeDict(networkEntry, 'Crypto_Token', {});
|
|
916
|
+
const code = this.safeCurrencyCode(this.safeString(token, 'Symbol'));
|
|
917
|
+
if (!(code in result)) {
|
|
918
|
+
result[code] = {
|
|
919
|
+
'id': id,
|
|
920
|
+
'code': code,
|
|
921
|
+
'info': [],
|
|
922
|
+
'type': undefined,
|
|
923
|
+
'name': this.safeString(token, 'Name'),
|
|
924
|
+
'active': undefined,
|
|
925
|
+
'deposit': undefined,
|
|
926
|
+
'withdraw': undefined,
|
|
927
|
+
'fee': undefined,
|
|
928
|
+
'precision': undefined,
|
|
929
|
+
'limits': {
|
|
930
|
+
'amount': {
|
|
931
|
+
'min': undefined,
|
|
932
|
+
'max': undefined,
|
|
933
|
+
},
|
|
934
|
+
'withdraw': {
|
|
935
|
+
'min': undefined,
|
|
936
|
+
'max': undefined,
|
|
937
|
+
},
|
|
938
|
+
'deposit': {
|
|
939
|
+
'min': undefined,
|
|
940
|
+
'max': undefined,
|
|
941
|
+
},
|
|
942
|
+
},
|
|
943
|
+
'networks': {},
|
|
944
|
+
};
|
|
815
945
|
}
|
|
946
|
+
const networkId = this.safeString(networkEntry, 'Crypto_Chain__');
|
|
947
|
+
const cryptoChainDict = this.safeString(networkEntry, 'Crypto_Chain');
|
|
948
|
+
const networkName = this.safeString(cryptoChainDict, 'Type', 'default');
|
|
949
|
+
const networkCode = this.networkIdToCode(networkName);
|
|
950
|
+
result[code]['networks'][networkCode] = {
|
|
951
|
+
'id': networkId,
|
|
952
|
+
'network': networkCode,
|
|
953
|
+
'active': this.safeString(networkEntry, 'Status') === 'valid',
|
|
954
|
+
'deposit': this.safeString(networkEntry, 'Can_Deposit') === 'Y',
|
|
955
|
+
'withdraw': undefined,
|
|
956
|
+
'fee': this.parseNumber(this.parseAmount(networkEntry['Withdraw_Fee'])),
|
|
957
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(token, 'Decimals'))),
|
|
958
|
+
'limits': {
|
|
959
|
+
'amount': {
|
|
960
|
+
'min': undefined,
|
|
961
|
+
'max': undefined,
|
|
962
|
+
},
|
|
963
|
+
'withdraw': {
|
|
964
|
+
'min': this.parseAmount(networkEntry['Minimum_Withdraw']),
|
|
965
|
+
'max': undefined,
|
|
966
|
+
},
|
|
967
|
+
'deposit': {
|
|
968
|
+
'min': this.parseAmount(networkEntry['Minimum_Deposit']),
|
|
969
|
+
'max': undefined,
|
|
970
|
+
},
|
|
971
|
+
},
|
|
972
|
+
};
|
|
973
|
+
const infos = this.safeList(result[code], 'info', []);
|
|
974
|
+
infos.push(networkEntry);
|
|
975
|
+
result[code]['info'] = infos;
|
|
816
976
|
}
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
const code = this.safeCurrencyCode(this.safeString(token, 'Symbol'));
|
|
823
|
-
const name = this.safeString(token, 'Name');
|
|
824
|
-
const active = this.safeString(currency, 'Status') === 'valid';
|
|
825
|
-
const deposit = this.safeString(currency, 'Can_Deposit') === 'Y';
|
|
826
|
-
const withdraw = this.safeString(currency, 'Status') === 'valid';
|
|
827
|
-
let fee = undefined;
|
|
828
|
-
if (currency['Withdraw_Fee'] !== undefined) {
|
|
829
|
-
fee = this.parseNumber(this.parseAmount(currency['Withdraw_Fee']));
|
|
830
|
-
}
|
|
831
|
-
const precision = this.parseNumber(this.parsePrecision(this.safeString(token, 'Decimals')));
|
|
832
|
-
let minDeposit = undefined;
|
|
833
|
-
if (currency['Minimum_Deposit'] !== undefined) {
|
|
834
|
-
minDeposit = this.parseAmount(currency['Minimum_Deposit']);
|
|
835
|
-
}
|
|
836
|
-
let minWithdraw = undefined;
|
|
837
|
-
if (currency['Minimum_Withdraw'] !== undefined) {
|
|
838
|
-
minWithdraw = this.parseAmount(currency['Minimum_Withdraw']);
|
|
977
|
+
// only after all entries are formed in currencies, restructure each entry
|
|
978
|
+
const allKeys = Object.keys(result);
|
|
979
|
+
for (let i = 0; i < allKeys.length; i++) {
|
|
980
|
+
const code = allKeys[i];
|
|
981
|
+
result[code] = this.safeCurrencyStructure(result[code]); // this is needed after adding network entry
|
|
839
982
|
}
|
|
840
|
-
const networkId = this.safeString(currency, 'Crypto_Chain__');
|
|
841
|
-
const networkData = this.safeValue(currency, 'Crypto_Chain', {});
|
|
842
|
-
const networkCode = this.safeString(networkData, 'Type', 'default');
|
|
843
|
-
const networks = {
|
|
844
|
-
'string': undefined,
|
|
845
|
-
'info': networkCode === 'default' ? {} : networkData,
|
|
846
|
-
'id': networkId || id || '',
|
|
847
|
-
'network': networkCode,
|
|
848
|
-
'active': active,
|
|
849
|
-
'deposit': deposit,
|
|
850
|
-
'withdraw': withdraw,
|
|
851
|
-
'fee': fee,
|
|
852
|
-
'precision': precision,
|
|
853
|
-
'limits': {
|
|
854
|
-
'deposit': {
|
|
855
|
-
'min': minDeposit,
|
|
856
|
-
'max': undefined,
|
|
857
|
-
},
|
|
858
|
-
'withdraw': {
|
|
859
|
-
'min': minWithdraw,
|
|
860
|
-
'max': undefined,
|
|
861
|
-
},
|
|
862
|
-
},
|
|
863
|
-
};
|
|
864
|
-
const result = {
|
|
865
|
-
'info': currency,
|
|
866
|
-
'id': id,
|
|
867
|
-
'code': code,
|
|
868
|
-
'name': name,
|
|
869
|
-
'active': active,
|
|
870
|
-
'deposit': deposit,
|
|
871
|
-
'withdraw': withdraw,
|
|
872
|
-
'fee': fee,
|
|
873
|
-
'precision': precision,
|
|
874
|
-
'type': undefined,
|
|
875
|
-
'limits': {
|
|
876
|
-
'amount': {
|
|
877
|
-
'min': undefined,
|
|
878
|
-
'max': undefined,
|
|
879
|
-
},
|
|
880
|
-
'withdraw': {
|
|
881
|
-
'min': minWithdraw,
|
|
882
|
-
'max': undefined,
|
|
883
|
-
},
|
|
884
|
-
},
|
|
885
|
-
'networks': networks,
|
|
886
|
-
};
|
|
887
983
|
return result;
|
|
888
984
|
}
|
|
889
985
|
/**
|
|
@@ -1083,14 +1179,14 @@ class ellipx extends ellipx$1 {
|
|
|
1083
1179
|
for (let i = 0; i < dataArray.length; i++) {
|
|
1084
1180
|
const entry = dataArray[i];
|
|
1085
1181
|
const balance = this.safeDict(entry, 'Balance', {});
|
|
1086
|
-
const
|
|
1087
|
-
if (
|
|
1182
|
+
const code = this.safeString(balance, 'currency');
|
|
1183
|
+
if (code !== undefined) {
|
|
1088
1184
|
const account = {
|
|
1089
1185
|
'free': this.parseAmount(entry['Unencumbered_Balance']['value_xint']),
|
|
1090
1186
|
'used': this.parseAmount(entry['Liabilities']['value_xint']),
|
|
1091
1187
|
'total': this.parseAmount(balance['value_xint']),
|
|
1092
1188
|
};
|
|
1093
|
-
result[
|
|
1189
|
+
result[code] = account;
|
|
1094
1190
|
}
|
|
1095
1191
|
}
|
|
1096
1192
|
return this.safeBalance(result);
|
|
@@ -1713,7 +1809,7 @@ class ellipx extends ellipx$1 {
|
|
|
1713
1809
|
* @name ellipx#withdraw
|
|
1714
1810
|
* @description Make a withdrawal request
|
|
1715
1811
|
* @see https://docs.google.com/document/d/1ZXzTQYffKE_EglTaKptxGQERRnunuLHEMmar7VC9syM/edit?tab=t.0#heading=h.zegupoa8g4t9
|
|
1716
|
-
* @param {string} code
|
|
1812
|
+
* @param {string} code unified currency code
|
|
1717
1813
|
* @param {number} amount Amount to withdraw
|
|
1718
1814
|
* @param {string} address Destination wallet address
|
|
1719
1815
|
* @param {string} [tag] Additional tag/memo for currencies that require it
|
package/dist/cjs/src/gate.js
CHANGED
package/dist/cjs/src/gemini.js
CHANGED
|
@@ -261,7 +261,7 @@ class gemini extends gemini$1 {
|
|
|
261
261
|
'fetchMarketFromWebRetries': 10,
|
|
262
262
|
'fetchMarketsFromAPI': {
|
|
263
263
|
'fetchDetailsForAllSymbols': false,
|
|
264
|
-
'quoteCurrencies': ['USDT', 'GUSD', 'USD', 'DAI', 'EUR', 'GBP', 'SGD', 'BTC', 'ETH', 'LTC', 'BCH'],
|
|
264
|
+
'quoteCurrencies': ['USDT', 'GUSD', 'USD', 'DAI', 'EUR', 'GBP', 'SGD', 'BTC', 'ETH', 'LTC', 'BCH', 'SOL'],
|
|
265
265
|
},
|
|
266
266
|
'fetchMarkets': {
|
|
267
267
|
'webApiEnable': true,
|
|
@@ -421,8 +421,6 @@ class gemini extends gemini$1 {
|
|
|
421
421
|
let networkCode = undefined;
|
|
422
422
|
if (networkId !== undefined) {
|
|
423
423
|
networkCode = this.networkIdToCode(networkId);
|
|
424
|
-
}
|
|
425
|
-
if (networkCode !== undefined) {
|
|
426
424
|
networks[networkCode] = {
|
|
427
425
|
'info': currency,
|
|
428
426
|
'id': networkId,
|
|
@@ -444,7 +442,7 @@ class gemini extends gemini$1 {
|
|
|
444
442
|
},
|
|
445
443
|
};
|
|
446
444
|
}
|
|
447
|
-
result[code] = {
|
|
445
|
+
result[code] = this.safeCurrencyStructure({
|
|
448
446
|
'info': currency,
|
|
449
447
|
'id': id,
|
|
450
448
|
'code': code,
|
|
@@ -466,7 +464,7 @@ class gemini extends gemini$1 {
|
|
|
466
464
|
},
|
|
467
465
|
},
|
|
468
466
|
'networks': networks,
|
|
469
|
-
};
|
|
467
|
+
});
|
|
470
468
|
}
|
|
471
469
|
return result;
|
|
472
470
|
}
|
package/dist/cjs/src/hitbtc.js
CHANGED
|
@@ -918,29 +918,46 @@ class hitbtc extends hitbtc$1 {
|
|
|
918
918
|
async fetchCurrencies(params = {}) {
|
|
919
919
|
const response = await this.publicGetPublicCurrency(params);
|
|
920
920
|
//
|
|
921
|
-
//
|
|
922
|
-
//
|
|
923
|
-
//
|
|
924
|
-
//
|
|
925
|
-
//
|
|
926
|
-
//
|
|
927
|
-
//
|
|
928
|
-
//
|
|
929
|
-
//
|
|
930
|
-
//
|
|
931
|
-
//
|
|
932
|
-
//
|
|
933
|
-
//
|
|
934
|
-
//
|
|
935
|
-
//
|
|
936
|
-
//
|
|
937
|
-
//
|
|
938
|
-
//
|
|
939
|
-
//
|
|
940
|
-
//
|
|
941
|
-
//
|
|
942
|
-
//
|
|
943
|
-
//
|
|
921
|
+
// {
|
|
922
|
+
// "DFC": {
|
|
923
|
+
// "full_name": "DeFiScale",
|
|
924
|
+
// "crypto": true,
|
|
925
|
+
// "payin_enabled": false,
|
|
926
|
+
// "payout_enabled": true,
|
|
927
|
+
// "transfer_enabled": false,
|
|
928
|
+
// "transfer_to_wallet_enabled": true,
|
|
929
|
+
// "transfer_to_exchange_enabled": false,
|
|
930
|
+
// "sign": "D",
|
|
931
|
+
// "crypto_payment_id_name": "",
|
|
932
|
+
// "crypto_explorer": "https://etherscan.io/tx/{tx}",
|
|
933
|
+
// "precision_transfer": "0.00000001",
|
|
934
|
+
// "delisted": false,
|
|
935
|
+
// "networks": [
|
|
936
|
+
// {
|
|
937
|
+
// "code": "ETH",
|
|
938
|
+
// "network_name": "Ethereum",
|
|
939
|
+
// "network": "ETH",
|
|
940
|
+
// "protocol": "ERC-20",
|
|
941
|
+
// "default": true,
|
|
942
|
+
// "is_ens_available": true,
|
|
943
|
+
// "payin_enabled": true,
|
|
944
|
+
// "payout_enabled": true,
|
|
945
|
+
// "precision_payout": "0.000000000000000001",
|
|
946
|
+
// "payout_fee": "277000.0000000000",
|
|
947
|
+
// "payout_is_payment_id": false,
|
|
948
|
+
// "payin_payment_id": false,
|
|
949
|
+
// "payin_confirmations": "2",
|
|
950
|
+
// "contract_address": "0x1b2a76da77d03b7fc21189d9838f55bd849014af",
|
|
951
|
+
// "crypto_payment_id_name": "",
|
|
952
|
+
// "crypto_explorer": "https://etherscan.io/tx/{tx}",
|
|
953
|
+
// "is_multichain": true,
|
|
954
|
+
// "asset_id": {
|
|
955
|
+
// "contract_address": "0x1b2a76da77d03b7fc21189d9838f55bd849014af"
|
|
956
|
+
// }
|
|
957
|
+
// }
|
|
958
|
+
// ]
|
|
959
|
+
// },
|
|
960
|
+
// }
|
|
944
961
|
//
|
|
945
962
|
const result = {};
|
|
946
963
|
const currencies = Object.keys(response);
|
|
@@ -948,50 +965,22 @@ class hitbtc extends hitbtc$1 {
|
|
|
948
965
|
const currencyId = currencies[i];
|
|
949
966
|
const code = this.safeCurrencyCode(currencyId);
|
|
950
967
|
const entry = response[currencyId];
|
|
951
|
-
const
|
|
952
|
-
const precision = this.safeNumber(entry, 'precision_transfer');
|
|
953
|
-
const payinEnabled = this.safeBool(entry, 'payin_enabled', false);
|
|
954
|
-
const payoutEnabled = this.safeBool(entry, 'payout_enabled', false);
|
|
955
|
-
const transferEnabled = this.safeBool(entry, 'transfer_enabled', false);
|
|
956
|
-
const active = payinEnabled && payoutEnabled && transferEnabled;
|
|
957
|
-
const rawNetworks = this.safeValue(entry, 'networks', []);
|
|
958
|
-
const isCrypto = this.safeBool(entry, 'crypto');
|
|
959
|
-
const type = isCrypto ? 'crypto' : 'fiat';
|
|
968
|
+
const rawNetworks = this.safeList(entry, 'networks', []);
|
|
960
969
|
const networks = {};
|
|
961
|
-
let fee = undefined;
|
|
962
|
-
let depositEnabled = undefined;
|
|
963
|
-
let withdrawEnabled = undefined;
|
|
964
970
|
for (let j = 0; j < rawNetworks.length; j++) {
|
|
965
971
|
const rawNetwork = rawNetworks[j];
|
|
966
972
|
const networkId = this.safeString2(rawNetwork, 'protocol', 'network');
|
|
967
973
|
let networkCode = this.networkIdToCode(networkId);
|
|
968
|
-
networkCode = (networkCode !== undefined) ? networkCode.toUpperCase() :
|
|
969
|
-
fee = this.safeNumber(rawNetwork, 'payout_fee');
|
|
970
|
-
const networkPrecision = this.safeNumber(rawNetwork, 'precision_payout');
|
|
971
|
-
const payinEnabledNetwork = this.safeBool(rawNetwork, 'payin_enabled', false);
|
|
972
|
-
const payoutEnabledNetwork = this.safeBool(rawNetwork, 'payout_enabled', false);
|
|
973
|
-
const activeNetwork = payinEnabledNetwork && payoutEnabledNetwork;
|
|
974
|
-
if (payinEnabledNetwork && !depositEnabled) {
|
|
975
|
-
depositEnabled = true;
|
|
976
|
-
}
|
|
977
|
-
else if (!payinEnabledNetwork) {
|
|
978
|
-
depositEnabled = false;
|
|
979
|
-
}
|
|
980
|
-
if (payoutEnabledNetwork && !withdrawEnabled) {
|
|
981
|
-
withdrawEnabled = true;
|
|
982
|
-
}
|
|
983
|
-
else if (!payoutEnabledNetwork) {
|
|
984
|
-
withdrawEnabled = false;
|
|
985
|
-
}
|
|
974
|
+
networkCode = (networkCode !== undefined) ? networkCode.toUpperCase() : code; // as hitbtc is white label, ensure we safeguard from possible bugs
|
|
986
975
|
networks[networkCode] = {
|
|
987
976
|
'info': rawNetwork,
|
|
988
977
|
'id': networkId,
|
|
989
978
|
'network': networkCode,
|
|
990
|
-
'
|
|
991
|
-
'
|
|
992
|
-
'deposit':
|
|
993
|
-
'withdraw':
|
|
994
|
-
'precision':
|
|
979
|
+
'active': undefined,
|
|
980
|
+
'fee': this.safeNumber(rawNetwork, 'payout_fee'),
|
|
981
|
+
'deposit': this.safeBool(rawNetwork, 'payin_enabled'),
|
|
982
|
+
'withdraw': this.safeBool(rawNetwork, 'payout_enabled'),
|
|
983
|
+
'precision': this.safeNumber(rawNetwork, 'precision_payout'),
|
|
995
984
|
'limits': {
|
|
996
985
|
'withdraw': {
|
|
997
986
|
'min': undefined,
|
|
@@ -1000,27 +989,25 @@ class hitbtc extends hitbtc$1 {
|
|
|
1000
989
|
},
|
|
1001
990
|
};
|
|
1002
991
|
}
|
|
1003
|
-
|
|
1004
|
-
const networksLength = networksKeys.length;
|
|
1005
|
-
result[code] = {
|
|
992
|
+
result[code] = this.safeCurrencyStructure({
|
|
1006
993
|
'info': entry,
|
|
1007
994
|
'code': code,
|
|
1008
995
|
'id': currencyId,
|
|
1009
|
-
'precision':
|
|
1010
|
-
'name':
|
|
1011
|
-
'active':
|
|
1012
|
-
'deposit':
|
|
1013
|
-
'withdraw':
|
|
996
|
+
'precision': this.safeNumber(entry, 'precision_transfer'),
|
|
997
|
+
'name': this.safeString(entry, 'full_name'),
|
|
998
|
+
'active': !this.safeBool(entry, 'delisted'),
|
|
999
|
+
'deposit': this.safeBool(entry, 'payin_enabled'),
|
|
1000
|
+
'withdraw': this.safeBool(entry, 'payout_enabled'),
|
|
1014
1001
|
'networks': networks,
|
|
1015
|
-
'fee':
|
|
1002
|
+
'fee': undefined,
|
|
1016
1003
|
'limits': {
|
|
1017
1004
|
'amount': {
|
|
1018
1005
|
'min': undefined,
|
|
1019
1006
|
'max': undefined,
|
|
1020
1007
|
},
|
|
1021
1008
|
},
|
|
1022
|
-
'type':
|
|
1023
|
-
};
|
|
1009
|
+
'type': undefined, // 'crypto' field emits incorrect values
|
|
1010
|
+
});
|
|
1024
1011
|
}
|
|
1025
1012
|
return result;
|
|
1026
1013
|
}
|
|
@@ -357,7 +357,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
357
357
|
const id = i;
|
|
358
358
|
const name = this.safeString(data, 'name');
|
|
359
359
|
const code = this.safeCurrencyCode(name);
|
|
360
|
-
result[code] = {
|
|
360
|
+
result[code] = this.safeCurrencyStructure({
|
|
361
361
|
'id': id,
|
|
362
362
|
'name': name,
|
|
363
363
|
'code': code,
|
|
@@ -379,7 +379,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
379
379
|
'max': undefined,
|
|
380
380
|
},
|
|
381
381
|
},
|
|
382
|
-
};
|
|
382
|
+
});
|
|
383
383
|
}
|
|
384
384
|
return result;
|
|
385
385
|
}
|
package/dist/cjs/src/kraken.js
CHANGED
|
@@ -1646,6 +1646,8 @@ class kraken extends kraken$1 {
|
|
|
1646
1646
|
'volume': this.amountToPrecision(symbol, amount),
|
|
1647
1647
|
};
|
|
1648
1648
|
const orderRequest = this.orderRequest('createOrder', symbol, type, request, amount, price, params);
|
|
1649
|
+
const flags = this.safeString(orderRequest[0], 'oflags', '');
|
|
1650
|
+
const isUsingCost = flags.indexOf('viqc') > -1;
|
|
1649
1651
|
const response = await this.privatePostAddOrder(this.extend(orderRequest[0], orderRequest[1]));
|
|
1650
1652
|
//
|
|
1651
1653
|
// {
|
|
@@ -1657,6 +1659,10 @@ class kraken extends kraken$1 {
|
|
|
1657
1659
|
// }
|
|
1658
1660
|
//
|
|
1659
1661
|
const result = this.safeDict(response, 'result');
|
|
1662
|
+
result['usingCost'] = isUsingCost;
|
|
1663
|
+
// it's impossible to know if the order was created using cost or base currency
|
|
1664
|
+
// becuase kraken only returns something like this: { order: 'buy 10.00000000 LTCUSD @ market' }
|
|
1665
|
+
// this usingCost flag is used to help the parsing but omited from the order
|
|
1660
1666
|
return this.parseOrder(result);
|
|
1661
1667
|
}
|
|
1662
1668
|
findMarketByAltnameOrId(id) {
|
|
@@ -1749,22 +1755,15 @@ class kraken extends kraken$1 {
|
|
|
1749
1755
|
// }
|
|
1750
1756
|
//
|
|
1751
1757
|
// ws - createOrder
|
|
1752
|
-
//
|
|
1753
|
-
//
|
|
1754
|
-
//
|
|
1755
|
-
//
|
|
1756
|
-
// "status": 'ok',
|
|
1757
|
-
// "txid": 'OAVXZH-XIE54-JCYYDG'
|
|
1758
|
-
// }
|
|
1758
|
+
// {
|
|
1759
|
+
// "order_id": "OXM2QD-EALR2-YBAVEU"
|
|
1760
|
+
// }
|
|
1761
|
+
//
|
|
1759
1762
|
// ws - editOrder
|
|
1760
|
-
//
|
|
1761
|
-
//
|
|
1762
|
-
//
|
|
1763
|
-
//
|
|
1764
|
-
// "reqid": 3,
|
|
1765
|
-
// "status": "ok",
|
|
1766
|
-
// "txid": "OTI672-HJFAO-XOIPPK"
|
|
1767
|
-
// }
|
|
1763
|
+
// {
|
|
1764
|
+
// "amend_id": "TJSMEH-AA67V-YUSQ6O",
|
|
1765
|
+
// "order_id": "OXM2QD-EALR2-YBAVEU"
|
|
1766
|
+
// }
|
|
1768
1767
|
//
|
|
1769
1768
|
// {
|
|
1770
1769
|
// "error": [],
|
|
@@ -1832,6 +1831,8 @@ class kraken extends kraken$1 {
|
|
|
1832
1831
|
// "oflags": "fciq"
|
|
1833
1832
|
// }
|
|
1834
1833
|
//
|
|
1834
|
+
const isUsingCost = this.safeBool(order, 'usingCost', false);
|
|
1835
|
+
order = this.omit(order, 'usingCost');
|
|
1835
1836
|
const description = this.safeDict(order, 'descr', {});
|
|
1836
1837
|
const orderDescriptionObj = this.safeDict(order, 'descr'); // can be null
|
|
1837
1838
|
let orderDescription = undefined;
|
|
@@ -1846,11 +1847,17 @@ class kraken extends kraken$1 {
|
|
|
1846
1847
|
let marketId = undefined;
|
|
1847
1848
|
let price = undefined;
|
|
1848
1849
|
let amount = undefined;
|
|
1850
|
+
let cost = undefined;
|
|
1849
1851
|
let triggerPrice = undefined;
|
|
1850
1852
|
if (orderDescription !== undefined) {
|
|
1851
1853
|
const parts = orderDescription.split(' ');
|
|
1852
1854
|
side = this.safeString(parts, 0);
|
|
1853
|
-
|
|
1855
|
+
if (!isUsingCost) {
|
|
1856
|
+
amount = this.safeString(parts, 1);
|
|
1857
|
+
}
|
|
1858
|
+
else {
|
|
1859
|
+
cost = this.safeString(parts, 1);
|
|
1860
|
+
}
|
|
1854
1861
|
marketId = this.safeString(parts, 2);
|
|
1855
1862
|
const part4 = this.safeString(parts, 4);
|
|
1856
1863
|
const part5 = this.safeString(parts, 5);
|
|
@@ -1887,15 +1894,13 @@ class kraken extends kraken$1 {
|
|
|
1887
1894
|
// kraken truncates the cost in the api response so we will ignore it and calculate it from average & filled
|
|
1888
1895
|
// const cost = this.safeString (order, 'cost');
|
|
1889
1896
|
price = this.safeString(description, 'price', price);
|
|
1890
|
-
// when type =
|
|
1891
|
-
if ((price !== undefined) && price.endsWith('%')) {
|
|
1897
|
+
// when type = trailing stop returns price = '+50.0000%'
|
|
1898
|
+
if ((price !== undefined) && (price.endsWith('%') || Precise["default"].stringEquals(price, '0.00000') || Precise["default"].stringEquals(price, '0'))) {
|
|
1892
1899
|
price = undefined; // this is not the price we want
|
|
1893
1900
|
}
|
|
1894
|
-
if (
|
|
1901
|
+
if (price === undefined) {
|
|
1895
1902
|
price = this.safeString(description, 'price2');
|
|
1896
|
-
|
|
1897
|
-
if ((price === undefined) || Precise["default"].stringEquals(price, '0')) {
|
|
1898
|
-
price = this.safeString(order, 'price', price);
|
|
1903
|
+
price = this.safeString2(order, 'limitprice', 'price', price);
|
|
1899
1904
|
}
|
|
1900
1905
|
const flags = this.safeString(order, 'oflags', '');
|
|
1901
1906
|
let isPostOnly = flags.indexOf('post') > -1;
|
|
@@ -1917,7 +1922,7 @@ class kraken extends kraken$1 {
|
|
|
1917
1922
|
}
|
|
1918
1923
|
}
|
|
1919
1924
|
const status = this.parseOrderStatus(this.safeString(order, 'status'));
|
|
1920
|
-
let id = this.safeStringN(order, ['id', 'txid', 'amend_id']);
|
|
1925
|
+
let id = this.safeStringN(order, ['id', 'txid', 'order_id', 'amend_id']);
|
|
1921
1926
|
if ((id === undefined) || (id.startsWith('['))) {
|
|
1922
1927
|
const txid = this.safeList(order, 'txid');
|
|
1923
1928
|
id = this.safeString(txid, 0);
|
|
@@ -1985,7 +1990,7 @@ class kraken extends kraken$1 {
|
|
|
1985
1990
|
'triggerPrice': triggerPrice,
|
|
1986
1991
|
'takeProfitPrice': takeProfitPrice,
|
|
1987
1992
|
'stopLossPrice': stopLossPrice,
|
|
1988
|
-
'cost':
|
|
1993
|
+
'cost': cost,
|
|
1989
1994
|
'amount': amount,
|
|
1990
1995
|
'filled': filled,
|
|
1991
1996
|
'average': average,
|
|
@@ -1531,6 +1531,7 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1531
1531
|
* @param {string} [params.timeInForce] GTC, GTT, IOC, or FOK, default is GTC, limit orders only
|
|
1532
1532
|
* @param {string} [params.postOnly] Post only flag, invalid when timeInForce is IOC or FOK
|
|
1533
1533
|
* @param {float} [params.cost] the cost of the order in units of USDT
|
|
1534
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', default is 'isolated'
|
|
1534
1535
|
* ----------------- Exchange Specific Parameters -----------------
|
|
1535
1536
|
* @param {float} [params.leverage] Leverage size of the order (mandatory param in request, default is 1)
|
|
1536
1537
|
* @param {string} [params.clientOid] client order id, defaults to uuid if not passed
|
|
@@ -1634,6 +1635,11 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1634
1635
|
'type': type,
|
|
1635
1636
|
'leverage': 1,
|
|
1636
1637
|
};
|
|
1638
|
+
const marginModeUpper = this.safeStringUpper(params, 'marginMode');
|
|
1639
|
+
if (marginModeUpper !== undefined) {
|
|
1640
|
+
params = this.omit(params, 'marginMode');
|
|
1641
|
+
request['marginMode'] = marginModeUpper;
|
|
1642
|
+
}
|
|
1637
1643
|
const cost = this.safeString(params, 'cost');
|
|
1638
1644
|
params = this.omit(params, 'cost');
|
|
1639
1645
|
if (cost !== undefined) {
|