ccxt 4.3.43 → 4.3.45
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 +7 -5
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +9 -1
- package/dist/cjs/src/abstract/oxfun.js +9 -0
- package/dist/cjs/src/bitstamp.js +18 -2
- package/dist/cjs/src/kucoin.js +28 -1
- package/dist/cjs/src/luno.js +9 -1
- package/dist/cjs/src/lykke.js +10 -2
- package/dist/cjs/src/ndax.js +5 -1
- package/dist/cjs/src/oxfun.js +2900 -0
- package/dist/cjs/src/poloniexfutures.js +2 -2
- package/dist/cjs/src/pro/bitmex.js +9 -0
- package/dist/cjs/src/pro/oxfun.js +1034 -0
- package/dist/cjs/src/pro/woo.js +1 -1
- package/dist/cjs/src/wavesexchange.js +121 -110
- package/dist/cjs/src/xt.js +135 -96
- package/js/ccxt.d.ts +11 -2
- package/js/ccxt.js +8 -2
- package/js/src/abstract/bitstamp.d.ts +16 -0
- package/js/src/abstract/kucoin.d.ts +14 -0
- package/js/src/abstract/kucoinfutures.d.ts +14 -0
- package/js/src/abstract/oxfun.d.ts +37 -0
- package/js/src/abstract/oxfun.js +11 -0
- package/js/src/abstract/xt.d.ts +155 -0
- package/js/src/abstract/xt.js +11 -0
- package/js/src/bitstamp.js +18 -2
- package/js/src/kucoin.js +28 -1
- package/js/src/luno.d.ts +1 -1
- package/js/src/luno.js +9 -1
- package/js/src/lykke.d.ts +2 -2
- package/js/src/lykke.js +10 -2
- package/js/src/ndax.d.ts +1 -1
- package/js/src/ndax.js +5 -1
- package/js/src/oxfun.d.ts +129 -0
- package/js/src/oxfun.js +2901 -0
- package/js/src/poloniexfutures.js +2 -2
- package/js/src/pro/bitmex.js +9 -0
- package/js/src/pro/oxfun.d.ts +38 -0
- package/js/src/pro/oxfun.js +1035 -0
- package/js/src/pro/woo.js +1 -1
- package/js/src/wavesexchange.d.ts +7 -7
- package/js/src/wavesexchange.js +122 -111
- package/js/src/xt.d.ts +161 -0
- package/js/src/xt.js +4761 -0
- package/package.json +1 -1
package/dist/cjs/src/pro/woo.js
CHANGED
|
@@ -315,9 +315,9 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
315
315
|
},
|
|
316
316
|
},
|
|
317
317
|
'currencies': {
|
|
318
|
-
'WX': this.safeCurrencyStructure({ 'id': 'EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc', 'numericId': undefined, 'code': 'WX', 'precision': this.
|
|
318
|
+
'WX': this.safeCurrencyStructure({ 'id': 'EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc', 'numericId': undefined, 'code': 'WX', 'precision': this.parseNumber('1e-8') }),
|
|
319
319
|
},
|
|
320
|
-
'precisionMode': number.
|
|
320
|
+
'precisionMode': number.TICK_SIZE,
|
|
321
321
|
'options': {
|
|
322
322
|
'allowedCandles': 1440,
|
|
323
323
|
'accessToken': undefined,
|
|
@@ -328,7 +328,7 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
328
328
|
'wavesAddress': undefined,
|
|
329
329
|
'withdrawFeeUSDN': 7420,
|
|
330
330
|
'withdrawFeeWAVES': 100000,
|
|
331
|
-
'wavesPrecision': 8,
|
|
331
|
+
'wavesPrecision': 1e-8,
|
|
332
332
|
'messagePrefix': 'W',
|
|
333
333
|
'networks': {
|
|
334
334
|
'ERC20': 'ETH',
|
|
@@ -376,8 +376,8 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
376
376
|
async getFeesForAsset(symbol, side, amount, price, params = {}) {
|
|
377
377
|
await this.loadMarkets();
|
|
378
378
|
const market = this.market(symbol);
|
|
379
|
-
amount = this.
|
|
380
|
-
price = this.
|
|
379
|
+
amount = this.toRealSymbolAmount(symbol, amount);
|
|
380
|
+
price = this.toRealSymbolPrice(symbol, price);
|
|
381
381
|
const request = this.extend({
|
|
382
382
|
'baseId': market['baseId'],
|
|
383
383
|
'quoteId': market['quoteId'],
|
|
@@ -410,7 +410,7 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
410
410
|
const matcherFee = this.safeString(mode, 'matcherFee');
|
|
411
411
|
const feeAssetId = this.safeString(mode, 'feeAssetId');
|
|
412
412
|
const feeAsset = this.safeCurrencyCode(feeAssetId);
|
|
413
|
-
const adjustedMatcherFee = this.
|
|
413
|
+
const adjustedMatcherFee = this.fromRealCurrencyAmount(feeAsset, matcherFee);
|
|
414
414
|
const amountAsString = this.numberToString(amount);
|
|
415
415
|
const priceAsString = this.numberToString(price);
|
|
416
416
|
const feeCost = this.feeToPrecision(symbol, this.parseNumber(adjustedMatcherFee));
|
|
@@ -563,8 +563,8 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
563
563
|
'strike': undefined,
|
|
564
564
|
'optionType': undefined,
|
|
565
565
|
'precision': {
|
|
566
|
-
'amount': this.
|
|
567
|
-
'price': this.
|
|
566
|
+
'amount': this.parseNumber(this.parsePrecision(this.safeString(entry, 'amountAssetDecimals'))),
|
|
567
|
+
'price': this.parseNumber(this.parsePrecision(this.safeString(entry, 'priceAssetDecimals'))),
|
|
568
568
|
},
|
|
569
569
|
'limits': {
|
|
570
570
|
'leverage': {
|
|
@@ -621,12 +621,11 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
621
621
|
}
|
|
622
622
|
parseOrderBookSide(bookSide, market = undefined, limit = undefined) {
|
|
623
623
|
const precision = market['precision'];
|
|
624
|
-
const wavesPrecision = this.safeString(this.options, 'wavesPrecision', '8');
|
|
625
|
-
const
|
|
626
|
-
const
|
|
627
|
-
const
|
|
628
|
-
const
|
|
629
|
-
const pricePrecision = '1e' + Precise["default"].stringSub(wavesPrecision, difference);
|
|
624
|
+
const wavesPrecision = this.safeString(this.options, 'wavesPrecision', '1e-8');
|
|
625
|
+
const amountPrecisionString = this.safeString(precision, 'amount');
|
|
626
|
+
const pricePrecisionString = this.safeString(precision, 'price');
|
|
627
|
+
const difference = Precise["default"].stringDiv(amountPrecisionString, pricePrecisionString);
|
|
628
|
+
const pricePrecision = Precise["default"].stringDiv(wavesPrecision, difference);
|
|
630
629
|
const result = [];
|
|
631
630
|
for (let i = 0; i < bookSide.length; i++) {
|
|
632
631
|
const entry = bookSide[i];
|
|
@@ -635,10 +634,10 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
635
634
|
let price = undefined;
|
|
636
635
|
let amount = undefined;
|
|
637
636
|
if ((pricePrecision !== undefined) && (entryPrice !== undefined)) {
|
|
638
|
-
price = Precise["default"].
|
|
637
|
+
price = Precise["default"].stringMul(entryPrice, pricePrecision);
|
|
639
638
|
}
|
|
640
|
-
if ((
|
|
641
|
-
amount = Precise["default"].
|
|
639
|
+
if ((amountPrecisionString !== undefined) && (entryAmount !== undefined)) {
|
|
640
|
+
amount = Precise["default"].stringMul(entryAmount, amountPrecisionString);
|
|
642
641
|
}
|
|
643
642
|
if ((limit !== undefined) && (i > limit)) {
|
|
644
643
|
break;
|
|
@@ -1224,51 +1223,36 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
1224
1223
|
}
|
|
1225
1224
|
return currencyId;
|
|
1226
1225
|
}
|
|
1227
|
-
|
|
1228
|
-
const
|
|
1229
|
-
const
|
|
1230
|
-
|
|
1231
|
-
const precisionPrice = this.numberToString(market['precision']['price']);
|
|
1232
|
-
const difference = Precise["default"].stringSub(amount, precisionPrice);
|
|
1233
|
-
const precision = Precise["default"].stringSub(wavesPrecision, difference);
|
|
1234
|
-
const pricePrecision = this.toPrecision(price, precision).toString();
|
|
1235
|
-
return this.parseToInt(parseFloat(pricePrecision));
|
|
1236
|
-
}
|
|
1237
|
-
customAmountToPrecision(symbol, amount) {
|
|
1238
|
-
const amountPrecision = this.numberToString(this.toPrecision(amount, this.numberToString(this.markets[symbol]['precision']['amount'])));
|
|
1239
|
-
return this.parseToInt(parseFloat(amountPrecision));
|
|
1226
|
+
toRealCurrencyAmount(code, amount, networkCode = undefined) {
|
|
1227
|
+
const currency = this.currency(code);
|
|
1228
|
+
const stringValue = Precise["default"].stringDiv(this.numberToString(amount), this.safeString(currency, 'precision'));
|
|
1229
|
+
return parseInt(stringValue);
|
|
1240
1230
|
}
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1231
|
+
fromRealCurrencyAmount(code, amountString) {
|
|
1232
|
+
if (!(code in this.currencies)) {
|
|
1233
|
+
return amountString;
|
|
1234
|
+
}
|
|
1235
|
+
const currency = this.currency(code);
|
|
1236
|
+
const precisionAmount = this.safeString(currency, 'precision');
|
|
1237
|
+
return Precise["default"].stringMul(amountString, precisionAmount);
|
|
1244
1238
|
}
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
const precise = new Precise["default"](amount);
|
|
1250
|
-
precise.decimals = this.sum(precise.decimals, scale);
|
|
1251
|
-
precise.reduce();
|
|
1252
|
-
return precise.toString();
|
|
1239
|
+
toRealSymbolPrice(symbol, price) {
|
|
1240
|
+
const market = this.market(symbol);
|
|
1241
|
+
const stringValue = Precise["default"].stringDiv(this.numberToString(price), this.safeString(market['precision'], 'price'));
|
|
1242
|
+
return parseInt(stringValue);
|
|
1253
1243
|
}
|
|
1254
|
-
|
|
1255
|
-
const
|
|
1256
|
-
|
|
1257
|
-
// precise.decimals should be integer
|
|
1258
|
-
precise.decimals = this.parseToInt(Precise["default"].stringSub(this.numberToString(precise.decimals), this.numberToString(scale)));
|
|
1259
|
-
precise.reduce();
|
|
1260
|
-
const stringValue = precise.toString();
|
|
1261
|
-
return stringValue;
|
|
1244
|
+
fromRealSymbolPrice(symbol, priceString) {
|
|
1245
|
+
const market = this.markets[symbol];
|
|
1246
|
+
return Precise["default"].stringMul(priceString, this.safeString(market['precision'], 'price'));
|
|
1262
1247
|
}
|
|
1263
|
-
|
|
1264
|
-
const
|
|
1265
|
-
|
|
1248
|
+
toRealSymbolAmount(symbol, amount) {
|
|
1249
|
+
const market = this.market(symbol);
|
|
1250
|
+
const stringValue = Precise["default"].stringDiv(this.numberToString(amount), this.safeString(market['precision'], 'amount'));
|
|
1251
|
+
return parseInt(stringValue);
|
|
1266
1252
|
}
|
|
1267
|
-
|
|
1253
|
+
fromRealSymbolAmount(symbol, amountString) {
|
|
1268
1254
|
const market = this.markets[symbol];
|
|
1269
|
-
|
|
1270
|
-
const scale = this.sum(wavesPrecision, market['precision']['price']) - market['precision']['amount'];
|
|
1271
|
-
return this.fromPrecision(price, scale);
|
|
1255
|
+
return Precise["default"].stringMul(amountString, market['precision']['amount']);
|
|
1272
1256
|
}
|
|
1273
1257
|
safeGetDynamic(settings) {
|
|
1274
1258
|
const orderFee = this.safeValue(settings, 'orderFee');
|
|
@@ -1350,7 +1334,7 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
1350
1334
|
}
|
|
1351
1335
|
const matcherFeeAsset = this.safeCurrencyCode(matcherFeeAssetId);
|
|
1352
1336
|
const rawMatcherFee = (matcherFeeAssetId === baseFeeAssetId) ? baseMatcherFee : discountMatcherFee;
|
|
1353
|
-
const floatMatcherFee = parseFloat(this.
|
|
1337
|
+
const floatMatcherFee = parseFloat(this.fromRealCurrencyAmount(matcherFeeAsset, rawMatcherFee));
|
|
1354
1338
|
if ((matcherFeeAsset in balances) && (balances[matcherFeeAsset]['free'] >= floatMatcherFee)) {
|
|
1355
1339
|
matcherFee = parseInt(rawMatcherFee);
|
|
1356
1340
|
}
|
|
@@ -1358,26 +1342,26 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
1358
1342
|
throw new errors.InsufficientFunds(this.id + ' not enough funds of the selected asset fee');
|
|
1359
1343
|
}
|
|
1360
1344
|
}
|
|
1345
|
+
const floatBaseMatcherFee = this.fromRealCurrencyAmount(baseFeeAsset, baseMatcherFee);
|
|
1346
|
+
const floatDiscountMatcherFee = this.fromRealCurrencyAmount(discountFeeAsset, discountMatcherFee);
|
|
1361
1347
|
if (matcherFeeAssetId === undefined) {
|
|
1362
1348
|
// try to the pay the fee using the base first then discount asset
|
|
1363
|
-
|
|
1364
|
-
if ((baseFeeAsset in balances) && (balances[baseFeeAsset]['free'] >= floatBaseMatcherFee)) {
|
|
1349
|
+
if ((baseFeeAsset in balances) && (balances[baseFeeAsset]['free'] >= parseFloat(floatBaseMatcherFee))) {
|
|
1365
1350
|
matcherFeeAssetId = baseFeeAssetId;
|
|
1366
1351
|
matcherFee = parseInt(baseMatcherFee);
|
|
1367
1352
|
}
|
|
1368
1353
|
else {
|
|
1369
|
-
|
|
1370
|
-
if ((discountFeeAsset in balances) && (balances[discountFeeAsset]['free'] >= floatDiscountMatcherFee)) {
|
|
1354
|
+
if ((discountFeeAsset in balances) && (balances[discountFeeAsset]['free'] >= parseFloat(floatDiscountMatcherFee))) {
|
|
1371
1355
|
matcherFeeAssetId = discountFeeAssetId;
|
|
1372
1356
|
matcherFee = parseInt(discountMatcherFee);
|
|
1373
1357
|
}
|
|
1374
1358
|
}
|
|
1375
1359
|
}
|
|
1376
1360
|
if (matcherFeeAssetId === undefined) {
|
|
1377
|
-
throw new errors.InsufficientFunds(this.id + ' not enough funds on none of the eligible asset fees');
|
|
1361
|
+
throw new errors.InsufficientFunds(this.id + ' not enough funds on none of the eligible asset fees: ' + baseFeeAsset + ' ' + floatBaseMatcherFee + ' or ' + discountFeeAsset + ' ' + floatDiscountMatcherFee);
|
|
1378
1362
|
}
|
|
1379
|
-
amount = this.
|
|
1380
|
-
price = this.
|
|
1363
|
+
amount = this.toRealSymbolAmount(symbol, amount);
|
|
1364
|
+
price = this.toRealSymbolPrice(symbol, price);
|
|
1381
1365
|
const assetPair = {
|
|
1382
1366
|
'amountAsset': amountAsset,
|
|
1383
1367
|
'priceAsset': priceAsset,
|
|
@@ -1415,7 +1399,7 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
1415
1399
|
'c': {
|
|
1416
1400
|
't': 'sp',
|
|
1417
1401
|
'v': {
|
|
1418
|
-
'p': this.
|
|
1402
|
+
'p': this.toRealSymbolPrice(symbol, stopPrice),
|
|
1419
1403
|
},
|
|
1420
1404
|
},
|
|
1421
1405
|
};
|
|
@@ -1763,24 +1747,24 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
1763
1747
|
symbol = market['symbol'];
|
|
1764
1748
|
}
|
|
1765
1749
|
const amountCurrency = this.safeCurrencyCode(this.safeString(assetPair, 'amountAsset', 'WAVES'));
|
|
1766
|
-
const price = this.
|
|
1767
|
-
const amount = this.
|
|
1768
|
-
const filled = this.
|
|
1769
|
-
const average = this.
|
|
1750
|
+
const price = this.fromRealSymbolPrice(symbol, priceString);
|
|
1751
|
+
const amount = this.fromRealCurrencyAmount(amountCurrency, amountString);
|
|
1752
|
+
const filled = this.fromRealCurrencyAmount(amountCurrency, filledString);
|
|
1753
|
+
const average = this.fromRealSymbolPrice(symbol, this.safeString(order, 'avgWeighedPrice'));
|
|
1770
1754
|
const status = this.parseOrderStatus(this.safeString(order, 'status'));
|
|
1771
1755
|
let fee = undefined;
|
|
1772
1756
|
if ('type' in order) {
|
|
1773
|
-
const
|
|
1757
|
+
const code = this.safeCurrencyCode(this.safeString(order, 'feeAsset'));
|
|
1774
1758
|
fee = {
|
|
1775
|
-
'currency':
|
|
1776
|
-
'fee': this.parseNumber(this.
|
|
1759
|
+
'currency': code,
|
|
1760
|
+
'fee': this.parseNumber(this.fromRealCurrencyAmount(code, this.safeString(order, 'filledFee'))),
|
|
1777
1761
|
};
|
|
1778
1762
|
}
|
|
1779
1763
|
else {
|
|
1780
|
-
const
|
|
1764
|
+
const code = this.safeCurrencyCode(this.safeString(order, 'matcherFeeAssetId', 'WAVES'));
|
|
1781
1765
|
fee = {
|
|
1782
|
-
'currency':
|
|
1783
|
-
'fee': this.parseNumber(this.
|
|
1766
|
+
'currency': code,
|
|
1767
|
+
'fee': this.parseNumber(this.fromRealCurrencyAmount(code, this.safeString(order, 'matcherFee'))),
|
|
1784
1768
|
};
|
|
1785
1769
|
}
|
|
1786
1770
|
let triggerPrice = undefined;
|
|
@@ -1893,7 +1877,7 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
1893
1877
|
// ]
|
|
1894
1878
|
// }
|
|
1895
1879
|
const balances = this.safeValue(totalBalance, 'balances', []);
|
|
1896
|
-
|
|
1880
|
+
let result = {};
|
|
1897
1881
|
let timestamp = undefined;
|
|
1898
1882
|
const assetIds = [];
|
|
1899
1883
|
const nonStandardBalances = [];
|
|
@@ -1904,17 +1888,15 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
1904
1888
|
const issueTransaction = this.safeValue(entry, 'issueTransaction');
|
|
1905
1889
|
const currencyId = this.safeString(entry, 'assetId');
|
|
1906
1890
|
const balance = this.safeString(entry, 'balance');
|
|
1907
|
-
|
|
1891
|
+
const currencyExists = (currencyId in this.currencies_by_id);
|
|
1892
|
+
if (currencyExists) {
|
|
1893
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
1894
|
+
result[code] = this.account();
|
|
1895
|
+
result[code]['total'] = this.fromRealCurrencyAmount(code, balance);
|
|
1896
|
+
}
|
|
1897
|
+
else if (issueTransaction === undefined) {
|
|
1908
1898
|
assetIds.push(currencyId);
|
|
1909
1899
|
nonStandardBalances.push(balance);
|
|
1910
|
-
continue;
|
|
1911
|
-
}
|
|
1912
|
-
const decimals = this.safeInteger(issueTransaction, 'decimals');
|
|
1913
|
-
let code = undefined;
|
|
1914
|
-
if (currencyId in this.currencies_by_id) {
|
|
1915
|
-
code = this.safeCurrencyCode(currencyId);
|
|
1916
|
-
result[code] = this.account();
|
|
1917
|
-
result[code]['total'] = this.fromPrecision(balance, decimals);
|
|
1918
1900
|
}
|
|
1919
1901
|
}
|
|
1920
1902
|
const nonStandardAssets = assetIds.length;
|
|
@@ -1928,11 +1910,11 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
1928
1910
|
const entry = data[i];
|
|
1929
1911
|
const balance = nonStandardBalances[i];
|
|
1930
1912
|
const inner = this.safeValue(entry, 'data');
|
|
1931
|
-
const
|
|
1913
|
+
const precision = this.parsePrecision(this.safeString(inner, 'precision'));
|
|
1932
1914
|
const ticker = this.safeString(inner, 'ticker');
|
|
1933
1915
|
const code = this.safeCurrencyCode(ticker);
|
|
1934
1916
|
result[code] = this.account();
|
|
1935
|
-
result[code]['total'] =
|
|
1917
|
+
result[code]['total'] = Precise["default"].stringMul(balance, precision);
|
|
1936
1918
|
}
|
|
1937
1919
|
}
|
|
1938
1920
|
const currentTimestamp = this.milliseconds();
|
|
@@ -1958,12 +1940,7 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
1958
1940
|
result[code] = this.account();
|
|
1959
1941
|
}
|
|
1960
1942
|
const amount = this.safeString(reservedBalance, currencyId);
|
|
1961
|
-
|
|
1962
|
-
result[code]['used'] = this.currencyFromPrecision(code, amount);
|
|
1963
|
-
}
|
|
1964
|
-
else {
|
|
1965
|
-
result[code]['used'] = amount;
|
|
1966
|
-
}
|
|
1943
|
+
result[code]['used'] = this.fromRealCurrencyAmount(code, amount);
|
|
1967
1944
|
}
|
|
1968
1945
|
const wavesRequest = {
|
|
1969
1946
|
'address': wavesAddress,
|
|
@@ -1974,18 +1951,22 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
1974
1951
|
// "confirmations": 0,
|
|
1975
1952
|
// "balance": 909085978
|
|
1976
1953
|
// }
|
|
1977
|
-
result['WAVES'] = this.safeValue(result, 'WAVES',
|
|
1978
|
-
result['WAVES']['total'] = this.
|
|
1979
|
-
|
|
1954
|
+
result['WAVES'] = this.safeValue(result, 'WAVES', this.account());
|
|
1955
|
+
result['WAVES']['total'] = this.fromRealCurrencyAmount('WAVES', this.safeString(wavesTotal, 'balance'));
|
|
1956
|
+
result = this.setUndefinedBalancesToZero(result);
|
|
1957
|
+
result['timestamp'] = timestamp;
|
|
1958
|
+
result['datetime'] = this.iso8601(timestamp);
|
|
1959
|
+
return this.safeBalance(result);
|
|
1960
|
+
}
|
|
1961
|
+
setUndefinedBalancesToZero(balances, key = 'used') {
|
|
1962
|
+
const codes = Object.keys(balances);
|
|
1980
1963
|
for (let i = 0; i < codes.length; i++) {
|
|
1981
1964
|
const code = codes[i];
|
|
1982
|
-
if (this.safeValue(
|
|
1983
|
-
|
|
1965
|
+
if (this.safeValue(balances[code], 'used') === undefined) {
|
|
1966
|
+
balances[code][key] = '0';
|
|
1984
1967
|
}
|
|
1985
1968
|
}
|
|
1986
|
-
|
|
1987
|
-
result['datetime'] = this.iso8601(timestamp);
|
|
1988
|
-
return this.safeBalance(result);
|
|
1969
|
+
return balances;
|
|
1989
1970
|
}
|
|
1990
1971
|
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1991
1972
|
/**
|
|
@@ -2523,7 +2504,7 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
2523
2504
|
const feeAssetId = 'WAVES';
|
|
2524
2505
|
const type = 4; // transfer
|
|
2525
2506
|
const version = 2;
|
|
2526
|
-
const amountInteger = this.
|
|
2507
|
+
const amountInteger = this.toRealCurrencyAmount(code, amount);
|
|
2527
2508
|
const currency = this.currency(code);
|
|
2528
2509
|
const timestamp = this.milliseconds();
|
|
2529
2510
|
const byteArray = [
|
|
@@ -2583,18 +2564,45 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
2583
2564
|
// "amount": 0
|
|
2584
2565
|
// }
|
|
2585
2566
|
//
|
|
2567
|
+
// withdraw new:
|
|
2568
|
+
// {
|
|
2569
|
+
// type: "4",
|
|
2570
|
+
// id: "2xnWTqG9ar7jEDrLxfbVyyspPZ6XZNrrw9ai9sQ81Eya",
|
|
2571
|
+
// fee: "100000",
|
|
2572
|
+
// feeAssetId: null,
|
|
2573
|
+
// timestamp: "1715786263807",
|
|
2574
|
+
// version: "2",
|
|
2575
|
+
// sender: "3P81LLX1kk2CSJC9L8C2enxdHB7XvnSGAEE",
|
|
2576
|
+
// senderPublicKey: "DdmzmXf9mty1FBE8AdVGnrncVLEAzP4gR4nWoTFAJoXz",
|
|
2577
|
+
// proofs: [ "RyoKwdSYv3EqotJCYftfFM9JE2j1ZpDRxKwYfiRhLAFeyNp6VfJUXNDS884XfeCeHeNypNmTCZt5NYR1ekyjCX3", ],
|
|
2578
|
+
// recipient: "3P9tXxu38a8tgewNEKFzourVxeqHd11ppOc",
|
|
2579
|
+
// assetId: null,
|
|
2580
|
+
// feeAsset: null,
|
|
2581
|
+
// amount: "2000000",
|
|
2582
|
+
// attachment: "",
|
|
2583
|
+
// }
|
|
2584
|
+
//
|
|
2586
2585
|
currency = this.safeCurrency(undefined, currency);
|
|
2586
|
+
const code = currency['code'];
|
|
2587
|
+
const typeRaw = this.safeString(transaction, 'type');
|
|
2588
|
+
const type = (typeRaw === '4') ? 'withdraw' : 'deposit';
|
|
2589
|
+
const amount = this.parseNumber(this.fromRealCurrencyAmount(code, this.safeString(transaction, 'amount')));
|
|
2590
|
+
const feeString = this.safeString(transaction, 'fee');
|
|
2591
|
+
const feeAssetId = this.safeString(transaction, 'feeAssetId', 'WAVES');
|
|
2592
|
+
const feeCode = this.safeCurrencyCode(feeAssetId);
|
|
2593
|
+
const feeAmount = this.parseNumber(this.fromRealCurrencyAmount(feeCode, feeString));
|
|
2594
|
+
const timestamp = this.safeInteger(transaction, 'timestamp');
|
|
2587
2595
|
return {
|
|
2588
|
-
'id':
|
|
2596
|
+
'id': this.safeString(transaction, 'id'),
|
|
2589
2597
|
'txid': undefined,
|
|
2590
|
-
'timestamp':
|
|
2591
|
-
'datetime':
|
|
2598
|
+
'timestamp': timestamp,
|
|
2599
|
+
'datetime': this.iso8601(timestamp),
|
|
2592
2600
|
'network': undefined,
|
|
2593
|
-
'addressFrom':
|
|
2601
|
+
'addressFrom': this.safeString(transaction, 'sender'),
|
|
2594
2602
|
'address': undefined,
|
|
2595
|
-
'addressTo':
|
|
2596
|
-
'amount':
|
|
2597
|
-
'type':
|
|
2603
|
+
'addressTo': this.safeString(transaction, 'recipient'),
|
|
2604
|
+
'amount': amount,
|
|
2605
|
+
'type': type,
|
|
2598
2606
|
'currency': currency['code'],
|
|
2599
2607
|
'status': undefined,
|
|
2600
2608
|
'updated': undefined,
|
|
@@ -2603,7 +2611,10 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
2603
2611
|
'tagTo': undefined,
|
|
2604
2612
|
'comment': undefined,
|
|
2605
2613
|
'internal': undefined,
|
|
2606
|
-
'fee':
|
|
2614
|
+
'fee': {
|
|
2615
|
+
'currency': feeCode,
|
|
2616
|
+
'cost': feeAmount,
|
|
2617
|
+
},
|
|
2607
2618
|
'info': transaction,
|
|
2608
2619
|
};
|
|
2609
2620
|
}
|