rubic-sdk 4.2.6-alpha-dln.1 → 4.2.6-alpha-dln.3
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/dist/rubic-sdk.min.js +32 -19
- package/dist/rubic-sdk.min.js.map +1 -1
- package/lib/core/blockchain/web3-public-service/web3-public/web3-public.d.ts +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/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',
|
@@ -218830,7 +218830,7 @@ const injector_1 = __webpack_require__(/*! ../../../../../../core/injector/injec
|
|
218830
218830
|
async function getGasPriceInfo(blockchain) {
|
218831
218831
|
const [{ gasPrice, maxFeePerGas }, nativeCoinPrice] = await Promise.all([
|
218832
218832
|
injector_1.Injector.gasPriceApi.getGasPrice(blockchain),
|
218833
|
-
injector_1.Injector.coingeckoApi.getNativeCoinPrice(blockchain)
|
218833
|
+
injector_1.Injector.coingeckoApi.getNativeCoinPrice(blockchain).catch(() => new bignumber_js_1.default(0))
|
218834
218834
|
]);
|
218835
218835
|
const gasPriceInEth = web3_pure_1.Web3Pure.fromWei(maxFeePerGas || gasPrice || 0);
|
218836
218836
|
const gasPriceInUsd = gasPriceInEth.multipliedBy(nativeCoinPrice);
|
@@ -221188,16 +221188,18 @@ class OneinchAbstractProvider extends evm_on_chain_provider_1.EvmOnChainProvider
|
|
221188
221188
|
usedForCrossChain: fullOptions.usedForCrossChain,
|
221189
221189
|
availableProtocols
|
221190
221190
|
};
|
221191
|
-
|
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 {
|
221192
221201
|
return new oneinch_trade_1.OneinchTrade(oneinchTradeStruct, fullOptions.providerAddress);
|
221193
221202
|
}
|
221194
|
-
const gasPriceInfo = await this.getGasPriceInfo();
|
221195
|
-
const gasLimit = (await oneinch_trade_1.OneinchTrade.getGasLimit(oneinchTradeStruct)) || estimatedGas;
|
221196
|
-
const gasFeeInfo = (0, get_gas_fee_info_1.getGasFeeInfo)(gasLimit, gasPriceInfo);
|
221197
|
-
return new oneinch_trade_1.OneinchTrade({
|
221198
|
-
...oneinchTradeStruct,
|
221199
|
-
gasFeeInfo
|
221200
|
-
}, fullOptions.providerAddress);
|
221201
221203
|
}
|
221202
221204
|
async getTradeInfo(from, toToken, options) {
|
221203
221205
|
const isDefaultWrappedAddress = options.wrappedAddress === constants_1.oneinchApiParams.nativeAddress;
|
@@ -223308,7 +223310,10 @@ class UniswapV2AbstractProvider extends evm_on_chain_provider_1.EvmOnChainProvid
|
|
223308
223310
|
const toProxy = (0, token_native_address_proxy_1.createTokenNativeAddressProxy)(toToken, this.providerSettings.wethAddress);
|
223309
223311
|
let gasPriceInfo;
|
223310
223312
|
if (fullOptions.gasCalculation !== 'disabled') {
|
223311
|
-
|
223313
|
+
try {
|
223314
|
+
gasPriceInfo = await this.getGasPriceInfo();
|
223315
|
+
}
|
223316
|
+
catch { }
|
223312
223317
|
}
|
223313
223318
|
const { route, estimatedGas } = await this.getAmountAndPath(fromProxy, toProxy, weiAmountWithoutFee, exact, fullOptions, proxyFeeInfo, gasPriceInfo?.gasPriceInUsd);
|
223314
223319
|
const { from, to, fromWithoutFee } = (0, get_from_to_tokens_amounts_by_exact_1.getFromToTokensAmountsByExact)(fromToken, toToken, exact, weiAmount, weiAmountWithoutFee, route.outputAbsoluteAmount);
|
@@ -224447,7 +224452,10 @@ class UniswapV3AlgebraAbstractProvider extends evm_on_chain_provider_1.EvmOnChai
|
|
224447
224452
|
const toClone = (0, token_native_address_proxy_1.createTokenNativeAddressProxy)(toToken, this.providerConfiguration.wethAddress);
|
224448
224453
|
let gasPriceInfo;
|
224449
224454
|
if (fullOptions.gasCalculation !== 'disabled') {
|
224450
|
-
|
224455
|
+
try {
|
224456
|
+
gasPriceInfo = await this.getGasPriceInfo();
|
224457
|
+
}
|
224458
|
+
catch { }
|
224451
224459
|
}
|
224452
224460
|
const { route, estimatedGas } = await this.getRoute(fromClone, toClone, exact, weiAmountWithoutFee, fullOptions, gasPriceInfo?.gasPriceInUsd);
|
224453
224461
|
const { from, to, fromWithoutFee } = (0, get_from_to_tokens_amounts_by_exact_1.getFromToTokensAmountsByExact)(fromToken, toToken, exact, weiAmount, weiAmountWithoutFee, route.outputAbsoluteAmount);
|
@@ -224861,13 +224869,18 @@ class ZrxAbstractProvider extends evm_on_chain_provider_1.EvmOnChainProvider {
|
|
224861
224869
|
if (fullOptions.gasCalculation === 'disabled') {
|
224862
224870
|
return new zrx_trade_1.ZrxTrade(tradeStruct, fullOptions.providerAddress);
|
224863
224871
|
}
|
224864
|
-
|
224865
|
-
|
224866
|
-
|
224867
|
-
|
224868
|
-
|
224869
|
-
|
224870
|
-
|
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
|
+
}
|
224871
224884
|
}
|
224872
224885
|
/**
|
224873
224886
|
* Fetches zrx data from api.
|