@riocrypto/common-server 1.0.1305 → 1.0.1306
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.
|
@@ -11,27 +11,56 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getNetworkFees = void 0;
|
|
13
13
|
const common_1 = require("@riocrypto/common");
|
|
14
|
-
const ccxt_client_1 = require("../clients/ccxt-client");
|
|
15
|
-
const fireblocks_client_1 = require("../clients/fireblocks-client");
|
|
16
14
|
const getNetworkFees = (crypto, conversionRateToUSD) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
-
const address =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
//
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
// const address =
|
|
16
|
+
// crypto === Crypto.USDCSolana
|
|
17
|
+
// ? "HN7cABqLq46Es1jh92dQQisAq662SmxELLLsHHe4YWrH"
|
|
18
|
+
// : "0x66ECBd38905CC32249ddd6f4f0B4A3DdDDCbd608";
|
|
19
|
+
// const fireblocksClient = await buildFireblocksClient();
|
|
20
|
+
// // Hacky way bc ccxt doesn't support TRON, so quote in MATIC
|
|
21
|
+
// const cryptoToWithdraw =
|
|
22
|
+
// crypto === Crypto.USDTTron ? Crypto.USDCPolygon : crypto;
|
|
23
|
+
// const withdrawFee = await fireblocksClient.estimateWithdrawFee(
|
|
24
|
+
// cryptoToWithdraw,
|
|
25
|
+
// address,
|
|
26
|
+
// 100
|
|
27
|
+
// );
|
|
28
|
+
// if (!withdrawFee) {
|
|
29
|
+
// console.log("No withdraw fee");
|
|
30
|
+
// throw new GenericInternalError();
|
|
31
|
+
// }
|
|
32
|
+
// // Hacky way bc ccxt doesn't support TRON, so quote in MATIC
|
|
33
|
+
// const gasSymbol =
|
|
34
|
+
// crypto === Crypto.USDTTron
|
|
35
|
+
// ? "MATIC"
|
|
36
|
+
// : new CryptoAsset(crypto).getGasSymbol();
|
|
37
|
+
// const withdrawFeeUSDResponse = await ccxtWrapper.getSellQuote(
|
|
38
|
+
// gasSymbol as Crypto,
|
|
39
|
+
// Fiat.USD,
|
|
40
|
+
// undefined,
|
|
41
|
+
// Number(withdrawFee)
|
|
42
|
+
// );
|
|
43
|
+
// const withdrawFeeInBaseCrypto = withdrawFeeUSDResponse.amountFiat;
|
|
44
|
+
// const withdrawFeeInBaseFiat =
|
|
45
|
+
// Number(withdrawFeeUSDResponse.amountFiat) * (1 / conversionRateToUSD);
|
|
46
|
+
let withdrawFeeInUSD = 0;
|
|
47
|
+
if (crypto === common_1.Crypto.USDTTron) {
|
|
48
|
+
withdrawFeeInUSD = 3;
|
|
27
49
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
50
|
+
else if (crypto === common_1.Crypto.USDCSolana) {
|
|
51
|
+
withdrawFeeInUSD = 0.01;
|
|
52
|
+
}
|
|
53
|
+
else if (crypto === common_1.Crypto.USDCPolygon) {
|
|
54
|
+
withdrawFeeInUSD = 0.01;
|
|
55
|
+
}
|
|
56
|
+
else if (crypto === common_1.Crypto.USDC || crypto === common_1.Crypto.USDTEthereum) {
|
|
57
|
+
withdrawFeeInUSD = 20;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
withdrawFeeInUSD = 0.01;
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
withdrawFeeInBaseFiat: withdrawFeeInUSD * (1 / conversionRateToUSD),
|
|
64
|
+
};
|
|
36
65
|
});
|
|
37
66
|
exports.getNetworkFees = getNetworkFees;
|