@stableflow/bridges 3.1.2 → 3.1.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/index.js +14 -45
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -45
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -5585,55 +5585,24 @@ var CCTPOneClickService = class {
|
|
|
5585
5585
|
refundTo: evmAddress,
|
|
5586
5586
|
wallet: evmWallet
|
|
5587
5587
|
};
|
|
5588
|
-
|
|
5589
|
-
let
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
...oneClickParams,
|
|
5594
|
-
amountWei: Big__default.default(0.01).times(10 ** MIDDLE_TOKEN_CHAIN2.decimals).toFixed(0, 0)
|
|
5595
|
-
});
|
|
5596
|
-
execTime.log("CCTPOneClickService.quote", "oneClickService.quote: %o", oneClickResult);
|
|
5597
|
-
if (oneClickResult.errMsg) {
|
|
5598
|
-
return oneClickResult;
|
|
5599
|
-
}
|
|
5600
|
-
cctpParams.recipient = oneClickResult.quote.depositAddress;
|
|
5601
|
-
execTime.breakpoint();
|
|
5602
|
-
cctpResult = await cctp_default.quote(cctpParams);
|
|
5603
|
-
execTime.log("CCTPOneClickService.quote", "cctpService.quote: %o", cctpResult);
|
|
5604
|
-
execTime.breakpoint();
|
|
5605
|
-
try {
|
|
5606
|
-
const oneClickResult2 = await oneclick_default.quote({
|
|
5607
|
-
...oneClickParams,
|
|
5608
|
-
dry: true,
|
|
5609
|
-
amountWei: Big__default.default(cctpResult.outputAmount || 0).times(10 ** MIDDLE_TOKEN_CHAIN2.decimals).toFixed(0, 0)
|
|
5610
|
-
});
|
|
5611
|
-
oneClickResult.fees = oneClickResult2.fees;
|
|
5612
|
-
oneClickResult.outputAmount = oneClickResult2.outputAmount;
|
|
5613
|
-
oneClickResult.estimateTime = oneClickResult2.estimateTime;
|
|
5614
|
-
oneClickResult.priceImpact = oneClickResult2.priceImpact;
|
|
5615
|
-
oneClickResult.exchangeRate = oneClickResult2.exchangeRate;
|
|
5616
|
-
execTime.log("CCTPOneClickService.quote", "confirm get actual output amount result: %o", oneClickResult2);
|
|
5617
|
-
} catch (err) {
|
|
5618
|
-
execTime.log("CCTPOneClickService.quote", "confirm get actual output amount error: %o", err);
|
|
5619
|
-
}
|
|
5620
|
-
} else {
|
|
5621
|
-
execTime.breakpoint();
|
|
5622
|
-
cctpResult = await cctp_default.quote(cctpParams);
|
|
5623
|
-
execTime.log("CCTPOneClickService.quote", "cctpService.quote dry: %o", cctpResult);
|
|
5624
|
-
if (cctpResult.errMsg) {
|
|
5625
|
-
return cctpResult;
|
|
5626
|
-
}
|
|
5627
|
-
oneClickParams.amountWei = Big__default.default(cctpResult.outputAmount || 0).times(10 ** MIDDLE_TOKEN_CHAIN2.decimals).toFixed(0, 0);
|
|
5628
|
-
execTime.breakpoint();
|
|
5629
|
-
oneClickResult = await oneclick_default.quote(oneClickParams);
|
|
5630
|
-
execTime.log("CCTPOneClickService.quote", "oneClickService.quote: %o", oneClickResult);
|
|
5588
|
+
execTime.breakpoint();
|
|
5589
|
+
let cctpResult = await cctp_default.quote(cctpParams);
|
|
5590
|
+
execTime.log("cctpService.quote: %o", cctpResult);
|
|
5591
|
+
if (cctpResult.errMsg) {
|
|
5592
|
+
return cctpResult;
|
|
5631
5593
|
}
|
|
5594
|
+
oneClickParams.amountWei = Big__default.default(cctpResult.outputAmount || 0).times(10 ** MIDDLE_TOKEN_CHAIN2.decimals).toFixed(0, 0);
|
|
5595
|
+
execTime.breakpoint();
|
|
5596
|
+
const oneClickResult = await oneclick_default.quote(oneClickParams);
|
|
5597
|
+
execTime.log("oneClickService.quote: %o", oneClickResult);
|
|
5632
5598
|
if (oneClickResult.errMsg) {
|
|
5633
5599
|
return oneClickResult;
|
|
5634
5600
|
}
|
|
5635
|
-
if (
|
|
5636
|
-
|
|
5601
|
+
if (!dry) {
|
|
5602
|
+
cctpParams.recipient = oneClickResult.quote.depositAddress;
|
|
5603
|
+
execTime.breakpoint();
|
|
5604
|
+
cctpResult = await cctp_default.quote(cctpParams);
|
|
5605
|
+
execTime.log("cctpService.quote again: %o", cctpResult);
|
|
5637
5606
|
}
|
|
5638
5607
|
csl("CCTPOneClickService quote", "rose-600", "oneClickResult: %o", oneClickResult);
|
|
5639
5608
|
csl("CCTPOneClickService quote", "rose-600", "cctpResult: %o", cctpResult);
|