@shapeshiftoss/swapper 14.4.0 → 14.4.1
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.
|
@@ -65,8 +65,8 @@ const getThorTradeQuote = async ({ deps, input }) => {
|
|
|
65
65
|
case caip_1.CHAIN_NAMESPACE.Evm:
|
|
66
66
|
return (async () => {
|
|
67
67
|
const sellChainFeeAssetId = sellAdapter.getFeeAssetId();
|
|
68
|
-
const
|
|
69
|
-
const router =
|
|
68
|
+
const evmAddressData = await (0, getInboundAddressDataForChain_1.getInboundAddressDataForChain)(deps.daemonUrl, sellChainFeeAssetId);
|
|
69
|
+
const router = evmAddressData === null || evmAddressData === void 0 ? void 0 : evmAddressData.router;
|
|
70
70
|
if (!router)
|
|
71
71
|
throw new api_1.SwapError(`[getThorTradeQuote] No router address found for ${sellChainFeeAssetId}`);
|
|
72
72
|
const feeData = await (0, getEvmTxFees_1.getEvmTxFees)({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const MAX_THORCHAIN_TRADE = "100000000000000000000000000";
|
|
2
2
|
export declare const MAX_ALLOWANCE = "100000000000000000000000000";
|
|
3
3
|
export declare const THOR_MINIMUM_PADDING = 1.2;
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const THOR_EVM_GAS_LIMIT = "100000";
|
|
5
5
|
export declare const THORCHAIN_FIXED_PRECISION = 8;
|
|
6
6
|
export declare const THORCHAIN_AFFILIATE_NAME = "ss";
|
|
7
7
|
export declare const THORCHAIN_AFFILIATE_BIPS = "0";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.THORCHAIN_AFFILIATE_BIPS = exports.THORCHAIN_AFFILIATE_NAME = exports.THORCHAIN_FIXED_PRECISION = exports.
|
|
3
|
+
exports.THORCHAIN_AFFILIATE_BIPS = exports.THORCHAIN_AFFILIATE_NAME = exports.THORCHAIN_FIXED_PRECISION = exports.THOR_EVM_GAS_LIMIT = exports.THOR_MINIMUM_PADDING = exports.MAX_ALLOWANCE = exports.MAX_THORCHAIN_TRADE = void 0;
|
|
4
4
|
exports.MAX_THORCHAIN_TRADE = '100000000000000000000000000';
|
|
5
5
|
exports.MAX_ALLOWANCE = '100000000000000000000000000';
|
|
6
6
|
exports.THOR_MINIMUM_PADDING = 1.2;
|
|
7
|
-
exports.
|
|
7
|
+
exports.THOR_EVM_GAS_LIMIT = '100000'; // for sends of eth / erc20 into thorchain router
|
|
8
8
|
exports.THORCHAIN_FIXED_PRECISION = 8; // limit values are precision 8 regardless of the chain
|
|
9
9
|
exports.THORCHAIN_AFFILIATE_NAME = 'ss';
|
|
10
10
|
exports.THORCHAIN_AFFILIATE_BIPS = '0'; // affiliate fee in basis points (100 = 1%)
|
|
@@ -9,9 +9,10 @@ const constants_2 = require("../../constants");
|
|
|
9
9
|
const getEvmTxFees = async ({ adapter, sellAssetReference, buyAssetTradeFeeUsd, }) => {
|
|
10
10
|
try {
|
|
11
11
|
const gasFeeData = await adapter.getGasFeeData();
|
|
12
|
-
// this is a good value to cover all thortrades out of
|
|
12
|
+
// this is a good value to cover all thortrades out of EVMs
|
|
13
13
|
// in the future we may want to look at doing this more precisely and in a future-proof way
|
|
14
|
-
|
|
14
|
+
// TODO: calculate this dynamically
|
|
15
|
+
const gasLimit = constants_2.THOR_EVM_GAS_LIMIT;
|
|
15
16
|
const feeDataOptions = {
|
|
16
17
|
fast: {
|
|
17
18
|
txFee: (0, bignumber_1.bn)(gasLimit).times(gasFeeData[chain_adapters_1.FeeDataKey.Fast].gasPrice).toString(),
|
package/package.json
CHANGED