@memfork/cli 0.1.4 → 0.1.6

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.
@@ -4,7 +4,7 @@
4
4
  * Goes from zero to a fully configured memory tree in one shot:
5
5
  *
6
6
  * 1. Generate a fresh Ed25519 keypair (or reuse an existing one)
7
- * 2. Fund it from the Sui testnet faucet
7
+ * 2. Display faucet link — user funds the wallet manually (testnet)
8
8
  * 3. Create a MemWal account on-chain → accountId
9
9
  * 4. Generate a delegate keypair
10
10
  * 5. Register the delegate key with MemWal
@@ -4,7 +4,7 @@
4
4
  * Goes from zero to a fully configured memory tree in one shot:
5
5
  *
6
6
  * 1. Generate a fresh Ed25519 keypair (or reuse an existing one)
7
- * 2. Fund it from the Sui testnet faucet
7
+ * 2. Display faucet link — user funds the wallet manually (testnet)
8
8
  * 3. Create a MemWal account on-chain → accountId
9
9
  * 4. Generate a delegate keypair
10
10
  * 5. Register the delegate key with MemWal
@@ -19,6 +19,7 @@
19
19
  * to SuiJsonRpcClient, and the MemWal SDK's internal auto-init would fail on v2.
20
20
  */
21
21
  import chalk from "chalk";
22
+ import { confirm } from "@inquirer/prompts";
22
23
  import { Ed25519Keypair } from "@mysten/sui/keypairs/ed25519";
23
24
  import { decodeSuiPrivateKey } from "@mysten/sui/cryptography";
24
25
  import { JsonRpcHTTPTransport, SuiJsonRpcClient, getJsonRpcFullnodeUrl } from "@mysten/sui/jsonRpc";
@@ -52,30 +53,17 @@ export async function autoProvision(opts) {
52
53
  const address = keypair.toSuiAddress();
53
54
  const privateKey = keypair.getSecretKey(); // bech32 suiprivkey1…
54
55
  console.log(chalk.dim(` address: ${address}`));
55
- // ── 2. Faucet (testnet only) ─────────────────────────────────────────────────
56
+ // ── 2. Fund wallet ───────────────────────────────────────────────────────────
56
57
  if (network === "testnet") {
57
- step(2, "Requesting SUI from testnet faucet");
58
- try {
59
- const res = await fetch("https://faucet.testnet.sui.io/v1/gas", {
60
- method: "POST",
61
- headers: { "Content-Type": "application/json" },
62
- body: JSON.stringify({ FixedAmountRequest: { recipient: address } }),
63
- signal: AbortSignal.timeout(20_000),
64
- });
65
- if (!res.ok)
66
- throw new Error(`HTTP ${res.status}`);
67
- done();
68
- // Wait for faucet tx to land before we submit our transactions.
69
- await new Promise(r => setTimeout(r, 4_000));
70
- }
71
- catch (e) {
72
- console.log(chalk.yellow("failed"));
73
- console.log(chalk.yellow(` ⚠ Faucet error: ${String(e)}`));
74
- console.log(chalk.yellow(` Fund manually → https://faucet.testnet.sui.io`));
75
- console.log(chalk.yellow(` Address: ${address}`));
76
- console.log(chalk.yellow(` Then re-run: memfork init --quick`));
77
- throw new Error("Faucet unavailable — fund the address above and retry.");
78
- }
58
+ console.log(` ${chalk.dim("[2/6]")} Fund your testnet wallet`);
59
+ console.log();
60
+ console.log(` ${chalk.bold("Address:")} ${address}`);
61
+ console.log(` ${chalk.bold("Faucet: ")} ${chalk.cyan("https://faucet.testnet.sui.io")}`);
62
+ console.log();
63
+ await confirm({
64
+ message: "Press Enter once your wallet has been funded",
65
+ default: true,
66
+ });
79
67
  }
80
68
  else {
81
69
  step(2, "Mainnet — faucet not available");
@@ -137,7 +125,7 @@ export async function autoProvision(opts) {
137
125
  // ── 6. MemoryTree ────────────────────────────────────────────────────────────
138
126
  step(6, "Creating MemoryTree on Sui");
139
127
  const memClient = await MemForksClient.connect({
140
- treeId: "0x" + "0".repeat(64), // placeholder — initTree creates the object
128
+ treeId: "", // no tree yet — initTree() creates the object
141
129
  signer: privateKey,
142
130
  network,
143
131
  memwal: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memfork/cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "MemForks CLI — init, commit, recall, merge, install plugins",
5
5
  "repository": {
6
6
  "type": "git",