rubic-sdk 4.48.7 → 4.48.8
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 +40 -24
- package/dist/rubic-sdk.min.js.map +1 -1
- package/lib/features/cross-chain/calculation-manager/providers/lifi-provider/lifi-cross-chain-trade.js +12 -4
- package/lib/features/cross-chain/calculation-manager/providers/lifi-provider/lifi-cross-chain-trade.js.map +1 -1
- package/lib/features/on-chain/calculation-manager/providers/dexes/linea/horizondex/horizondex-provider.d.ts +1 -1
- package/lib/features/on-chain/calculation-manager/providers/lifi/lifi-trade.js +28 -20
- package/lib/features/on-chain/calculation-manager/providers/lifi/lifi-trade.js.map +1 -1
- package/package.json +1 -1
package/dist/rubic-sdk.min.js
CHANGED
|
@@ -197363,11 +197363,19 @@ class LifiCrossChainTrade extends evm_cross_chain_trade_1.EvmCrossChainTrade {
|
|
|
197363
197363
|
]
|
|
197364
197364
|
}
|
|
197365
197365
|
};
|
|
197366
|
-
|
|
197367
|
-
|
|
197368
|
-
|
|
197366
|
+
try {
|
|
197367
|
+
const swapResponse = await this.getResponseFromApiToTransactionRequest(step);
|
|
197368
|
+
if (!skipAmountChangeCheck) {
|
|
197369
|
+
evm_cross_chain_trade_1.EvmCrossChainTrade.checkAmountChange(swapResponse.transactionRequest, swapResponse.estimate.toAmountMin, web3_pure_1.Web3Pure.toWei(this.toTokenAmountMin, this.to.decimals));
|
|
197370
|
+
}
|
|
197371
|
+
return swapResponse.transactionRequest;
|
|
197372
|
+
}
|
|
197373
|
+
catch (err) {
|
|
197374
|
+
if ('statusCode' in err && 'message' in err) {
|
|
197375
|
+
throw new errors_1.RubicSdkError(err.message);
|
|
197376
|
+
}
|
|
197377
|
+
throw err;
|
|
197369
197378
|
}
|
|
197370
|
-
return swapResponse.transactionRequest;
|
|
197371
197379
|
}
|
|
197372
197380
|
async getResponseFromApiToTransactionRequest(step) {
|
|
197373
197381
|
return this.httpClient.post('https://li.quest/v1/advanced/stepTransaction', {
|
|
@@ -227927,7 +227935,7 @@ class LifiTrade extends evm_on_chain_trade_1.EvmOnChainTrade {
|
|
|
227927
227935
|
if (this.isDeflationError()) {
|
|
227928
227936
|
throw new errors_1.LowSlippageDeflationaryTokenError();
|
|
227929
227937
|
}
|
|
227930
|
-
if (err instanceof updated_rates_error_1.UpdatedRatesError) {
|
|
227938
|
+
if (err instanceof updated_rates_error_1.UpdatedRatesError || err instanceof errors_1.RubicSdkError) {
|
|
227931
227939
|
throw err;
|
|
227932
227940
|
}
|
|
227933
227941
|
throw new errors_1.LifiPairIsUnavailableError();
|
|
@@ -227957,25 +227965,33 @@ class LifiTrade extends evm_on_chain_trade_1.EvmOnChainTrade {
|
|
|
227957
227965
|
]
|
|
227958
227966
|
}
|
|
227959
227967
|
};
|
|
227960
|
-
|
|
227961
|
-
|
|
227962
|
-
|
|
227963
|
-
|
|
227964
|
-
|
|
227965
|
-
|
|
227966
|
-
|
|
227967
|
-
|
|
227968
|
-
|
|
227969
|
-
|
|
227970
|
-
|
|
227971
|
-
|
|
227972
|
-
|
|
227973
|
-
|
|
227974
|
-
|
|
227975
|
-
|
|
227976
|
-
|
|
227977
|
-
|
|
227978
|
-
|
|
227968
|
+
try {
|
|
227969
|
+
const swapResponse = await this.httpClient.post('https://li.quest/v1/advanced/stepTransaction', {
|
|
227970
|
+
...step
|
|
227971
|
+
});
|
|
227972
|
+
const { transactionRequest, estimate } = swapResponse;
|
|
227973
|
+
const gasLimit = transactionRequest.gasLimit && parseInt(transactionRequest.gasLimit, 16).toString();
|
|
227974
|
+
const gasPrice = transactionRequest.gasPrice && parseInt(transactionRequest.gasPrice, 16).toString();
|
|
227975
|
+
const value = transactionRequest.value && parseInt(transactionRequest.value, 16).toString();
|
|
227976
|
+
evm_on_chain_trade_1.EvmOnChainTrade.checkAmountChange({
|
|
227977
|
+
data: transactionRequest.data,
|
|
227978
|
+
value: value,
|
|
227979
|
+
to: transactionRequest.to
|
|
227980
|
+
}, estimate.toAmountMin, this.toTokenAmountMin.stringWeiAmount);
|
|
227981
|
+
return {
|
|
227982
|
+
to: transactionRequest.to,
|
|
227983
|
+
data: transactionRequest.data,
|
|
227984
|
+
gas: gasLimit,
|
|
227985
|
+
gasPrice,
|
|
227986
|
+
value
|
|
227987
|
+
};
|
|
227988
|
+
}
|
|
227989
|
+
catch (err) {
|
|
227990
|
+
if ('statusCode' in err && 'message' in err) {
|
|
227991
|
+
throw new errors_1.RubicSdkError(err.message);
|
|
227992
|
+
}
|
|
227993
|
+
throw err;
|
|
227994
|
+
}
|
|
227979
227995
|
}
|
|
227980
227996
|
}
|
|
227981
227997
|
exports.LifiTrade = LifiTrade;
|