@parallel-protocol/cli 0.2.0 → 0.2.1

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 +26 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8079,15 +8079,34 @@ function slippageDown(amount) {
8079
8079
  return amount - amount * SLIPPAGE_BPS / 10000n;
8080
8080
  }
8081
8081
  async function readTokenDomain(chain, token) {
8082
+ return readTokenDomainFull(chain, token);
8083
+ }
8084
+ async function readTokenDomainFull(chain, token) {
8082
8085
  const client = getClient(chain);
8083
- const name = await client.readContract({
8084
- address: token,
8085
- abi: ERC20_ABI,
8086
- functionName: "name"
8087
- });
8086
+ const versionAbi = [
8087
+ {
8088
+ name: "version",
8089
+ type: "function",
8090
+ stateMutability: "view",
8091
+ inputs: [],
8092
+ outputs: [{ type: "string" }]
8093
+ }
8094
+ ];
8095
+ const [name, version] = await Promise.all([
8096
+ client.readContract({
8097
+ address: token,
8098
+ abi: ERC20_ABI,
8099
+ functionName: "name"
8100
+ }),
8101
+ client.readContract({
8102
+ address: token,
8103
+ abi: versionAbi,
8104
+ functionName: "version"
8105
+ }).catch(() => "1")
8106
+ ]);
8088
8107
  return {
8089
8108
  name,
8090
- version: "1",
8109
+ version,
8091
8110
  chainId: client.chain.id,
8092
8111
  verifyingContract: token
8093
8112
  };
@@ -14541,7 +14560,7 @@ var package_default = {
14541
14560
 
14542
14561
  // package.json
14543
14562
  var package_default2 = {
14544
- version: "0.2.0"};
14563
+ version: "0.2.1"};
14545
14564
 
14546
14565
  // src/commands/version.ts
14547
14566
  function versionCommand() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallel-protocol/cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [