rubic-sdk 4.48.6 → 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 +42 -29
- 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/cross-chain/status-manager/cross-chain-status-manager.js +2 -5
- package/lib/features/cross-chain/status-manager/cross-chain-status-manager.js.map +1 -1
- package/lib/features/cross-chain/status-manager/models/xy-api-response.d.ts +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', {
|
|
@@ -205270,13 +205278,10 @@ class CrossChainStatusManager {
|
|
|
205270
205278
|
}
|
|
205271
205279
|
async getXyDstSwapStatus(data) {
|
|
205272
205280
|
try {
|
|
205273
|
-
const { success,
|
|
205274
|
-
if (success &&
|
|
205281
|
+
const { success, tx } = await this.httpClient.get(`${xy_api_params_1.XY_API_ENDPOINT}/crossChainStatus?srcChainId=${blockchain_id_1.blockchainId[data.fromBlockchain]}&srcTxHash=${data.srcTxHash}`);
|
|
205282
|
+
if (success && tx) {
|
|
205275
205283
|
return { status: tx_status_1.TX_STATUS.SUCCESS, hash: tx };
|
|
205276
205284
|
}
|
|
205277
|
-
if (!success) {
|
|
205278
|
-
return { status: tx_status_1.TX_STATUS.FAIL, hash: null };
|
|
205279
|
-
}
|
|
205280
205285
|
return { status: tx_status_1.TX_STATUS.PENDING, hash: null };
|
|
205281
205286
|
}
|
|
205282
205287
|
catch {
|
|
@@ -227930,7 +227935,7 @@ class LifiTrade extends evm_on_chain_trade_1.EvmOnChainTrade {
|
|
|
227930
227935
|
if (this.isDeflationError()) {
|
|
227931
227936
|
throw new errors_1.LowSlippageDeflationaryTokenError();
|
|
227932
227937
|
}
|
|
227933
|
-
if (err instanceof updated_rates_error_1.UpdatedRatesError) {
|
|
227938
|
+
if (err instanceof updated_rates_error_1.UpdatedRatesError || err instanceof errors_1.RubicSdkError) {
|
|
227934
227939
|
throw err;
|
|
227935
227940
|
}
|
|
227936
227941
|
throw new errors_1.LifiPairIsUnavailableError();
|
|
@@ -227960,25 +227965,33 @@ class LifiTrade extends evm_on_chain_trade_1.EvmOnChainTrade {
|
|
|
227960
227965
|
]
|
|
227961
227966
|
}
|
|
227962
227967
|
};
|
|
227963
|
-
|
|
227964
|
-
|
|
227965
|
-
|
|
227966
|
-
|
|
227967
|
-
|
|
227968
|
-
|
|
227969
|
-
|
|
227970
|
-
|
|
227971
|
-
|
|
227972
|
-
|
|
227973
|
-
|
|
227974
|
-
|
|
227975
|
-
|
|
227976
|
-
|
|
227977
|
-
|
|
227978
|
-
|
|
227979
|
-
|
|
227980
|
-
|
|
227981
|
-
|
|
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
|
+
}
|
|
227982
227995
|
}
|
|
227983
227996
|
}
|
|
227984
227997
|
exports.LifiTrade = LifiTrade;
|