genlayer 0.38.15 → 0.38.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genlayer",
3
- "version": "0.38.15",
3
+ "version": "0.38.16",
4
4
  "description": "GenLayer Command Line Tool",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
@@ -67,7 +67,7 @@
67
67
  "dotenv": "^17.0.0",
68
68
  "ethers": "^6.13.4",
69
69
  "fs-extra": "^11.3.0",
70
- "genlayer-js": "^0.28.5",
70
+ "genlayer-js": "^1.0.0",
71
71
  "inquirer": "^12.0.0",
72
72
  "keytar": "^7.9.0",
73
73
  "node-fetch": "^3.0.0",
@@ -31,18 +31,20 @@ export class SendAction extends BaseAction {
31
31
  }
32
32
 
33
33
  private parseAmount(amount: string): bigint {
34
- // Support "10gen" or "10" (assumes gen) or wei values
35
- const lowerAmount = amount.toLowerCase();
36
- if (lowerAmount.endsWith("gen")) {
37
- const value = lowerAmount.slice(0, -3);
38
- return parseEther(value);
34
+ // Symmetric with genlayer-js `parseStakingAmount`:
35
+ // "Ngen" → N GEN (parseEther)
36
+ // integer → wei (as-is)
37
+ // decimal without suffix → rejected (ambiguous; was previously silently
38
+ // interpreted as GEN for small values and as wei for large — a footgun
39
+ // that made `send 1000` attempt to transfer 1000 GEN, not 1000 wei).
40
+ const trimmed = amount.trim();
41
+ const lower = trimmed.toLowerCase();
42
+ if (lower.endsWith("gen")) {
43
+ return parseEther(lower.slice(0, -3).trim());
39
44
  }
40
- // If it's a large number (likely wei), use as-is
41
- if (BigInt(amount) > 1_000_000_000_000n) {
42
- return BigInt(amount);
43
- }
44
- // Otherwise assume it's in GEN
45
- return parseEther(amount);
45
+ // Plain integer wei. BigInt() throws on decimals, which is the intended
46
+ // failure mode for ambiguous input like "1.5".
47
+ return BigInt(trimmed);
46
48
  }
47
49
 
48
50
  async execute(options: SendOptions): Promise<void> {
@@ -7,7 +7,10 @@ import type {Address, GenLayerChain} from "genlayer-js/types";
7
7
 
8
8
  const CLI = path.resolve(__dirname, "../dist/index.js");
9
9
 
10
- const TIMEOUT = 30_000;
10
+ // Testnet validator-list fetches ALL validators + per-validator detail in
11
+ // batches; on bradbury/asimov that routinely passes 30s. 90s gives headroom
12
+ // without hiding real hangs.
13
+ const TIMEOUT = 90_000;
11
14
 
12
15
  const testnets: {name: string; chain: GenLayerChain}[] = [
13
16
  {name: "Asimov", chain: testnetAsimov},