@parallel-protocol/cli 0.2.1 → 0.2.2

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.
Files changed (2) hide show
  1. package/dist/index.js +8 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8451,14 +8451,15 @@ async function prepareRouteE(chain, senderAddress, amount, recipient) {
8451
8451
  const usdcAddress = getUSDCAddress(chain);
8452
8452
  if (!usdcAddress) throw new Error(`USDC not configured on ${chain}`);
8453
8453
  const parallelizer = getParallelizerAddress(chain);
8454
- const amountInWei = parseUnits(amount, 6);
8455
- const expectedUSDpOut = await quoteSwapIn(
8454
+ const amountOutWei = parseUnits(amount, 18);
8455
+ const usdcNeeded = await quoteSwapOut(
8456
8456
  chain,
8457
- amountInWei,
8457
+ amountOutWei,
8458
8458
  usdcAddress,
8459
8459
  usdpAddress
8460
8460
  );
8461
- const amountOutMin = slippageDown(expectedUSDpOut);
8461
+ const amountInWei = slippageUp(usdcNeeded);
8462
+ const amountOutMin = amountOutWei;
8462
8463
  const { validAfter, validBefore } = buildTiming();
8463
8464
  const userSalt = generateNonce();
8464
8465
  const derived = derivedNonceExactInput(
@@ -8518,8 +8519,8 @@ async function prepareRouteE(chain, senderAddress, amount, recipient) {
8518
8519
  }
8519
8520
  },
8520
8521
  quote: {
8521
- amountIn: amount,
8522
- amountOut: formatUnits(expectedUSDpOut, 18),
8522
+ amountIn: formatUnits(amountInWei, 6),
8523
+ amountOut: amount,
8523
8524
  slippageBps: Number(SLIPPAGE_BPS)
8524
8525
  },
8525
8526
  typedData,
@@ -14560,7 +14561,7 @@ var package_default = {
14560
14561
 
14561
14562
  // package.json
14562
14563
  var package_default2 = {
14563
- version: "0.2.1"};
14564
+ version: "0.2.2"};
14564
14565
 
14565
14566
  // src/commands/version.ts
14566
14567
  function versionCommand() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallel-protocol/cli",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [