@parallel-protocol/cli 0.2.3 → 0.2.5
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 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { fileURLToPath } from 'url';
|
|
|
7
7
|
import { config } from 'dotenv';
|
|
8
8
|
import { hyperEvm, hemi, katana, plasma, plume, worldchain, fraxtal, xLayer, linea, mantle, sonic, tac, ink, unichain, berachain, sei, gnosis, scroll, bsc, avalanche, polygon, optimism, arbitrum, base, mainnet } from 'viem/chains';
|
|
9
9
|
import { z } from 'zod';
|
|
10
|
-
import { keccak256, toHex, isAddress, parseUnits, isHex, formatUnits, encodeFunctionData, formatEther, createPublicClient, http, createWalletClient, maxUint256, getContract, encodeAbiParameters, concat, hashTypedData, custom } from 'viem';
|
|
10
|
+
import { keccak256, toHex, isAddress, parseUnits, isHex, formatUnits, encodeFunctionData, formatEther, createPublicClient, http, createWalletClient, maxUint256, getContract, encodeAbiParameters, concat, hashTypedData, BaseError, ContractFunctionRevertedError, ContractFunctionZeroDataError, custom } from 'viem';
|
|
11
11
|
import { createEnv } from '@t3-oss/env-core';
|
|
12
12
|
import chalk5 from 'chalk';
|
|
13
13
|
import { homedir } from 'os';
|
|
@@ -3697,7 +3697,7 @@ var CHAINS_STATIC = {
|
|
|
3697
3697
|
accessManager: "0x94Ea8800444017695345156319e96bdB1E355F7a",
|
|
3698
3698
|
parallelizer: "0x6efeDDF9269c3683Ba516cb0e2124FE335F262a2",
|
|
3699
3699
|
usdp: "0x9B3a8f7CEC208e247d97dEE13313690977e24459",
|
|
3700
|
-
susdp: "
|
|
3700
|
+
susdp: "0xd3a452B305C8285c0Dd7b8537665c734d3D279eF",
|
|
3701
3701
|
bridgeableUsdp: "0x78BB4882b77D74aD9B04Ab71fE8e61f72595823C",
|
|
3702
3702
|
flashParallel: "0xC9B6279baa19dBB8bCc3250c89cAa093AaBA0bfc",
|
|
3703
3703
|
harvester: "0x36DA06796fD9d22BCD6287b66A87FfdadB12636C"
|
|
@@ -8310,9 +8310,18 @@ async function prepareRouteB(chain, senderAddress, amount, recipient, targetToke
|
|
|
8310
8310
|
usdpAddress,
|
|
8311
8311
|
targetToken
|
|
8312
8312
|
);
|
|
8313
|
-
} catch {
|
|
8313
|
+
} catch (err) {
|
|
8314
|
+
const reverted = err instanceof BaseError && err.walk(
|
|
8315
|
+
(e) => e instanceof ContractFunctionRevertedError || e instanceof ContractFunctionZeroDataError
|
|
8316
|
+
) !== null;
|
|
8317
|
+
if (reverted) {
|
|
8318
|
+
throw new Error(
|
|
8319
|
+
`${targetToken} is not a registered backing collateral on ${chain}. Use get_supported_collaterals to find valid token addresses.`
|
|
8320
|
+
);
|
|
8321
|
+
}
|
|
8322
|
+
const cause = err instanceof Error ? err.message.split("\n")[0] : String(err);
|
|
8314
8323
|
throw new Error(
|
|
8315
|
-
|
|
8324
|
+
`Could not quote ${targetToken} on ${chain} \u2014 transient RPC failure, retry. (${cause})`
|
|
8316
8325
|
);
|
|
8317
8326
|
}
|
|
8318
8327
|
const amountInMax = slippageUp(amountInWei);
|
|
@@ -14578,7 +14587,7 @@ var package_default = {
|
|
|
14578
14587
|
|
|
14579
14588
|
// package.json
|
|
14580
14589
|
var package_default2 = {
|
|
14581
|
-
version: "0.2.
|
|
14590
|
+
version: "0.2.5"};
|
|
14582
14591
|
|
|
14583
14592
|
// src/commands/version.ts
|
|
14584
14593
|
function versionCommand() {
|