rubic-sdk 4.2.6-alpha-dln.0 → 4.2.6-alpha-dln.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/rubic-sdk.min.js +34 -20
- package/dist/rubic-sdk.min.js.map +1 -1
- package/lib/core/coingecko-api/coingecko-api.js +1 -1
- package/lib/core/coingecko-api/coingecko-api.js.map +1 -1
- package/lib/features/cross-chain/calculation-manager/providers/debridge-provider/constants/debridge-cross-chain-supported-blockchain.d.ts +1 -1
- package/lib/features/cross-chain/calculation-manager/providers/debridge-provider/constants/debridge-cross-chain-supported-blockchain.js +2 -1
- package/lib/features/cross-chain/calculation-manager/providers/debridge-provider/constants/debridge-cross-chain-supported-blockchain.js.map +1 -1
- package/lib/features/on-chain/calculation-manager/providers/common/utils/get-gas-price-info.js +1 -1
- package/lib/features/on-chain/calculation-manager/providers/common/utils/get-gas-price-info.js.map +1 -1
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/oneinch-abstract/oneinch-abstract-provider.js +10 -8
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/oneinch-abstract/oneinch-abstract-provider.js.map +1 -1
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/uniswap-v2-abstract-provider.js +4 -1
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v2-abstract/uniswap-v2-abstract-provider.js.map +1 -1
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v3-algebra-abstract/uniswap-v3-algebra-abstract-provider.js +4 -1
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/uniswap-v3-algebra-abstract/uniswap-v3-algebra-abstract-provider.js.map +1 -1
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/zrx-abstract/zrx-abstract-provider.js +12 -7
- package/lib/features/on-chain/calculation-manager/providers/dexes/common/zrx-abstract/zrx-abstract-provider.js.map +1 -1
- package/package.json +1 -1
package/dist/rubic-sdk.min.js
CHANGED
@@ -202608,7 +202608,7 @@ class CoingeckoApi {
|
|
202608
202608
|
[blockchain_name_1.BLOCKCHAIN_NAME.THETA]: 'theta',
|
202609
202609
|
[blockchain_name_1.BLOCKCHAIN_NAME.XDC]: 'xdc-network',
|
202610
202610
|
[blockchain_name_1.BLOCKCHAIN_NAME.BITCOIN_CASH]: 'bitcoin-cash',
|
202611
|
-
[blockchain_name_1.BLOCKCHAIN_NAME.ZK_SYNC]: '
|
202611
|
+
[blockchain_name_1.BLOCKCHAIN_NAME.ZK_SYNC]: 'ethereum'
|
202612
202612
|
};
|
202613
202613
|
this.tokenBlockchainId = {
|
202614
202614
|
[blockchain_name_1.BLOCKCHAIN_NAME.ETHEREUM]: 'ethereum',
|
@@ -209446,7 +209446,8 @@ exports.deBridgeCrossChainSupportedBlockchains = [
|
|
209446
209446
|
blockchain_name_1.BLOCKCHAIN_NAME.BINANCE_SMART_CHAIN,
|
209447
209447
|
blockchain_name_1.BLOCKCHAIN_NAME.POLYGON,
|
209448
209448
|
blockchain_name_1.BLOCKCHAIN_NAME.ARBITRUM,
|
209449
|
-
blockchain_name_1.BLOCKCHAIN_NAME.AVALANCHE
|
209449
|
+
blockchain_name_1.BLOCKCHAIN_NAME.AVALANCHE,
|
209450
|
+
blockchain_name_1.BLOCKCHAIN_NAME.FANTOM
|
209450
209451
|
];
|
209451
209452
|
|
209452
209453
|
|
@@ -218829,7 +218830,7 @@ const injector_1 = __webpack_require__(/*! ../../../../../../core/injector/injec
|
|
218829
218830
|
async function getGasPriceInfo(blockchain) {
|
218830
218831
|
const [{ gasPrice, maxFeePerGas }, nativeCoinPrice] = await Promise.all([
|
218831
218832
|
injector_1.Injector.gasPriceApi.getGasPrice(blockchain),
|
218832
|
-
injector_1.Injector.coingeckoApi.getNativeCoinPrice(blockchain)
|
218833
|
+
injector_1.Injector.coingeckoApi.getNativeCoinPrice(blockchain).catch(() => new bignumber_js_1.default(0))
|
218833
218834
|
]);
|
218834
218835
|
const gasPriceInEth = web3_pure_1.Web3Pure.fromWei(maxFeePerGas || gasPrice || 0);
|
218835
218836
|
const gasPriceInUsd = gasPriceInEth.multipliedBy(nativeCoinPrice);
|
@@ -221187,16 +221188,18 @@ class OneinchAbstractProvider extends evm_on_chain_provider_1.EvmOnChainProvider
|
|
221187
221188
|
usedForCrossChain: fullOptions.usedForCrossChain,
|
221188
221189
|
availableProtocols
|
221189
221190
|
};
|
221190
|
-
|
221191
|
+
try {
|
221192
|
+
const gasPriceInfo = await this.getGasPriceInfo();
|
221193
|
+
const gasLimit = (await oneinch_trade_1.OneinchTrade.getGasLimit(oneinchTradeStruct)) || estimatedGas;
|
221194
|
+
const gasFeeInfo = (0, get_gas_fee_info_1.getGasFeeInfo)(gasLimit, gasPriceInfo);
|
221195
|
+
return new oneinch_trade_1.OneinchTrade({
|
221196
|
+
...oneinchTradeStruct,
|
221197
|
+
gasFeeInfo
|
221198
|
+
}, fullOptions.providerAddress);
|
221199
|
+
}
|
221200
|
+
catch {
|
221191
221201
|
return new oneinch_trade_1.OneinchTrade(oneinchTradeStruct, fullOptions.providerAddress);
|
221192
221202
|
}
|
221193
|
-
const gasPriceInfo = await this.getGasPriceInfo();
|
221194
|
-
const gasLimit = (await oneinch_trade_1.OneinchTrade.getGasLimit(oneinchTradeStruct)) || estimatedGas;
|
221195
|
-
const gasFeeInfo = (0, get_gas_fee_info_1.getGasFeeInfo)(gasLimit, gasPriceInfo);
|
221196
|
-
return new oneinch_trade_1.OneinchTrade({
|
221197
|
-
...oneinchTradeStruct,
|
221198
|
-
gasFeeInfo
|
221199
|
-
}, fullOptions.providerAddress);
|
221200
221203
|
}
|
221201
221204
|
async getTradeInfo(from, toToken, options) {
|
221202
221205
|
const isDefaultWrappedAddress = options.wrappedAddress === constants_1.oneinchApiParams.nativeAddress;
|
@@ -223307,7 +223310,10 @@ class UniswapV2AbstractProvider extends evm_on_chain_provider_1.EvmOnChainProvid
|
|
223307
223310
|
const toProxy = (0, token_native_address_proxy_1.createTokenNativeAddressProxy)(toToken, this.providerSettings.wethAddress);
|
223308
223311
|
let gasPriceInfo;
|
223309
223312
|
if (fullOptions.gasCalculation !== 'disabled') {
|
223310
|
-
|
223313
|
+
try {
|
223314
|
+
gasPriceInfo = await this.getGasPriceInfo();
|
223315
|
+
}
|
223316
|
+
catch { }
|
223311
223317
|
}
|
223312
223318
|
const { route, estimatedGas } = await this.getAmountAndPath(fromProxy, toProxy, weiAmountWithoutFee, exact, fullOptions, proxyFeeInfo, gasPriceInfo?.gasPriceInUsd);
|
223313
223319
|
const { from, to, fromWithoutFee } = (0, get_from_to_tokens_amounts_by_exact_1.getFromToTokensAmountsByExact)(fromToken, toToken, exact, weiAmount, weiAmountWithoutFee, route.outputAbsoluteAmount);
|
@@ -224446,7 +224452,10 @@ class UniswapV3AlgebraAbstractProvider extends evm_on_chain_provider_1.EvmOnChai
|
|
224446
224452
|
const toClone = (0, token_native_address_proxy_1.createTokenNativeAddressProxy)(toToken, this.providerConfiguration.wethAddress);
|
224447
224453
|
let gasPriceInfo;
|
224448
224454
|
if (fullOptions.gasCalculation !== 'disabled') {
|
224449
|
-
|
224455
|
+
try {
|
224456
|
+
gasPriceInfo = await this.getGasPriceInfo();
|
224457
|
+
}
|
224458
|
+
catch { }
|
224450
224459
|
}
|
224451
224460
|
const { route, estimatedGas } = await this.getRoute(fromClone, toClone, exact, weiAmountWithoutFee, fullOptions, gasPriceInfo?.gasPriceInUsd);
|
224452
224461
|
const { from, to, fromWithoutFee } = (0, get_from_to_tokens_amounts_by_exact_1.getFromToTokensAmountsByExact)(fromToken, toToken, exact, weiAmount, weiAmountWithoutFee, route.outputAbsoluteAmount);
|
@@ -224860,13 +224869,18 @@ class ZrxAbstractProvider extends evm_on_chain_provider_1.EvmOnChainProvider {
|
|
224860
224869
|
if (fullOptions.gasCalculation === 'disabled') {
|
224861
224870
|
return new zrx_trade_1.ZrxTrade(tradeStruct, fullOptions.providerAddress);
|
224862
224871
|
}
|
224863
|
-
|
224864
|
-
|
224865
|
-
|
224866
|
-
|
224867
|
-
|
224868
|
-
|
224869
|
-
|
224872
|
+
try {
|
224873
|
+
const gasPriceInfo = await this.getGasPriceInfo();
|
224874
|
+
const gasLimit = (await zrx_trade_1.ZrxTrade.getGasLimit(tradeStruct)) || apiTradeData.gas;
|
224875
|
+
const gasFeeInfo = await (0, get_gas_fee_info_1.getGasFeeInfo)(gasLimit, gasPriceInfo);
|
224876
|
+
return new zrx_trade_1.ZrxTrade({
|
224877
|
+
...tradeStruct,
|
224878
|
+
gasFeeInfo
|
224879
|
+
}, fullOptions.providerAddress);
|
224880
|
+
}
|
224881
|
+
catch {
|
224882
|
+
return new zrx_trade_1.ZrxTrade(tradeStruct, fullOptions.providerAddress);
|
224883
|
+
}
|
224870
224884
|
}
|
224871
224885
|
/**
|
224872
224886
|
* Fetches zrx data from api.
|