@bankr/cli 0.3.23 → 0.3.35
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/README.md +15 -5
- package/dist/cli.js +20 -14
- package/dist/commands/balances.js +1 -2
- package/dist/commands/cancel.js +1 -4
- package/dist/commands/club.js +6 -16
- package/dist/commands/config.js +1 -2
- package/dist/commands/fees.js +19 -29
- package/dist/commands/files.js +17 -39
- package/dist/commands/launch.d.ts +5 -0
- package/dist/commands/launch.js +98 -22
- package/dist/commands/launchQuotes.d.ts +7 -0
- package/dist/commands/launchQuotes.js +49 -0
- package/dist/commands/llm.d.ts +8 -0
- package/dist/commands/llm.js +308 -68
- package/dist/commands/login.js +20 -31
- package/dist/commands/portfolio.js +1 -2
- package/dist/commands/prompt.js +28 -29
- package/dist/commands/sign.js +8 -16
- package/dist/commands/sounds.js +6 -16
- package/dist/commands/status.js +1 -4
- package/dist/commands/submit.js +12 -24
- package/dist/commands/swap.js +2 -4
- package/dist/commands/tokens.js +1 -2
- package/dist/commands/transfer.js +2 -4
- package/dist/commands/update.js +1 -2
- package/dist/commands/webhooks.js +21 -65
- package/dist/commands/whoami.js +1 -2
- package/dist/commands/x402.js +36 -100
- package/dist/lib/api.d.ts +42 -2
- package/dist/lib/api.js +10 -2
- package/dist/lib/chains.js +4 -0
- package/dist/lib/explorer.js +1 -0
- package/dist/lib/output.d.ts +4 -0
- package/dist/lib/output.js +12 -0
- package/dist/lib/quoteTokens.d.ts +15 -0
- package/dist/lib/quoteTokens.js +53 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,6 +73,12 @@ bankr agent -c "compare them"
|
|
|
73
73
|
|
|
74
74
|
# Continue a specific thread
|
|
75
75
|
bankr agent --thread thr_ABC123 "tell me more"
|
|
76
|
+
|
|
77
|
+
# Max Mode: pick the model. Only the two newest releases of each line, and
|
|
78
|
+
# only frontier / flagship / balanced lines, are accepted (the same set the
|
|
79
|
+
# web picker shows); anything else is rejected and the error lists every
|
|
80
|
+
# valid id.
|
|
81
|
+
bankr agent --model claude-opus-5 "audit this contract"
|
|
76
82
|
```
|
|
77
83
|
|
|
78
84
|
### Token Launch
|
|
@@ -88,6 +94,10 @@ bankr launch --name "TESTCOIN" --image "https://example.com/img.png" \
|
|
|
88
94
|
# Quick launch (name only, skip confirmation)
|
|
89
95
|
bankr launch --name "TESTCOIN" -y
|
|
90
96
|
|
|
97
|
+
# Pair the pool with a tokenized stock instead of WETH (Robinhood Chain or Base)
|
|
98
|
+
bankr launch quotes --chain robinhood # list the quote tokens you can pair with
|
|
99
|
+
bankr launch --name "TESTCOIN" --chain robinhood --quote TSLA -y
|
|
100
|
+
|
|
91
101
|
# Fee recipient types: x, farcaster, ens, wallet
|
|
92
102
|
bankr launch --name "TESTCOIN" --fee "vitalik.eth" --fee-type ens -y
|
|
93
103
|
bankr launch --name "TESTCOIN" --fee "0x1234..." --fee-type wallet -y
|
|
@@ -168,12 +178,12 @@ Credentials are stored in `~/.bankr/config.json`.
|
|
|
168
178
|
|
|
169
179
|
Environment variables override stored values:
|
|
170
180
|
|
|
171
|
-
| Variable
|
|
172
|
-
|
|
173
|
-
| `BANKR_API_KEY` | API key (overrides stored key)
|
|
174
|
-
| `BANKR_API_URL` | API URL (default: `https://api.bankr.bot`)
|
|
181
|
+
| Variable | Description |
|
|
182
|
+
| --------------- | ---------------------------------------------------------- |
|
|
183
|
+
| `BANKR_API_KEY` | API key (overrides stored key) |
|
|
184
|
+
| `BANKR_API_URL` | API URL (default: `https://api.bankr.bot`) |
|
|
175
185
|
| `BANKR_LLM_KEY` | LLM gateway key (falls back to `BANKR_API_KEY` if not set) |
|
|
176
|
-
| `BANKR_LLM_URL` | LLM gateway URL (default: `https://llm.bankr.bot`)
|
|
186
|
+
| `BANKR_LLM_URL` | LLM gateway URL (default: `https://llm.bankr.bot`) |
|
|
177
187
|
|
|
178
188
|
## API Key
|
|
179
189
|
|
package/dist/cli.js
CHANGED
|
@@ -15,6 +15,7 @@ import { passthroughArgs } from "./lib/passthrough.js";
|
|
|
15
15
|
import { claudeCommand, creditsCommand, creditsAddCommand, creditsAutoCommand, modelsCommand, opencodeCommand, setupClaudeCodeCommand, setupCursorCommand, setupOpenclawCommand, setupOpenCodeCommand, } from "./commands/llm.js";
|
|
16
16
|
import { feesCommand, feesClaimCommand, feesClaimWalletCommand, } from "./commands/fees.js";
|
|
17
17
|
import { launchCommand } from "./commands/launch.js";
|
|
18
|
+
import { launchQuotesCommand } from "./commands/launchQuotes.js";
|
|
18
19
|
import { loginCommand } from "./commands/login.js";
|
|
19
20
|
import { logoutCommand } from "./commands/logout.js";
|
|
20
21
|
import { promptCommand } from "./commands/prompt.js";
|
|
@@ -46,14 +47,12 @@ async function readPromptInput() {
|
|
|
46
47
|
}
|
|
47
48
|
const text = Buffer.concat(chunks).toString().trim();
|
|
48
49
|
if (!text) {
|
|
49
|
-
output.
|
|
50
|
-
process.exit(1);
|
|
50
|
+
output.fatal("No input received from stdin");
|
|
51
51
|
}
|
|
52
52
|
return text;
|
|
53
53
|
}
|
|
54
54
|
if (output.isNonInteractive()) {
|
|
55
|
-
output.
|
|
56
|
-
process.exit(1);
|
|
55
|
+
output.fatal('No prompt provided. Pass it as an argument: bankr agent "your prompt"');
|
|
57
56
|
}
|
|
58
57
|
// Interactive input — shell expansion does not apply here
|
|
59
58
|
const text = await input({
|
|
@@ -306,8 +305,7 @@ const agentCmd = program
|
|
|
306
305
|
const joined = text.join(" ").trim();
|
|
307
306
|
if (!joined) {
|
|
308
307
|
if (output.isNonInteractive()) {
|
|
309
|
-
output.
|
|
310
|
-
process.exit(1);
|
|
308
|
+
output.fatal('No prompt provided. Pass it as an argument: bankr agent "your prompt"');
|
|
311
309
|
}
|
|
312
310
|
agentCmd.help();
|
|
313
311
|
return;
|
|
@@ -340,14 +338,15 @@ agentCmd
|
|
|
340
338
|
.description("Show all Bankr AI agent skills with examples")
|
|
341
339
|
.action(skillsCommand);
|
|
342
340
|
program.commandsGroup("Tokens");
|
|
343
|
-
program
|
|
341
|
+
const launchCmd = program
|
|
344
342
|
.command("launch")
|
|
345
|
-
.description("Launch a token on Base
|
|
343
|
+
.description("Launch a token on Base, Robinhood Chain or Arbitrum (interactive wizard)")
|
|
346
344
|
.optionsGroup("Token")
|
|
347
345
|
.option("--name <name>", "Token name")
|
|
348
346
|
.option("--symbol <symbol>", "Token symbol (default: auto-generated from name)")
|
|
349
347
|
.option("--image <url>", "Token image URL")
|
|
350
|
-
.option("--chain <chain>", "Chain to launch on: base, robinhood (default: base)")
|
|
348
|
+
.option("--chain <chain>", "Chain to launch on: base, robinhood, arbitrum (default: base)")
|
|
349
|
+
.option("--quote <token>", 'Quote token to pair the pool with, e.g. a tokenized stock: a symbol or address from "bankr launch quotes" (default: WETH)')
|
|
351
350
|
.option("--no-vesting", "Turn off the default 15% creator vesting (sell 100% of supply into the pool)")
|
|
352
351
|
.optionsGroup("Links")
|
|
353
352
|
.option("--tweet <url>", "Associated tweet URL")
|
|
@@ -365,6 +364,7 @@ program
|
|
|
365
364
|
symbol: opts.symbol,
|
|
366
365
|
image: opts.image,
|
|
367
366
|
chain: opts.chain,
|
|
367
|
+
quote: opts.quote,
|
|
368
368
|
vesting: opts.vesting,
|
|
369
369
|
tweet: opts.tweet,
|
|
370
370
|
website: opts.website,
|
|
@@ -375,6 +375,14 @@ program
|
|
|
375
375
|
simulate: opts.simulate,
|
|
376
376
|
});
|
|
377
377
|
});
|
|
378
|
+
launchCmd
|
|
379
|
+
.command("quotes")
|
|
380
|
+
.description("List the quote tokens a launch can pair with on a chain (WETH, tokenized stocks, more)")
|
|
381
|
+
.option("--chain <chain>", "Chain to list for: base, robinhood, arbitrum (default: base)")
|
|
382
|
+
.option("--json", "Output raw JSON")
|
|
383
|
+
// The parent `launch` also owns --chain and, like every command here, parses
|
|
384
|
+
// its options from anywhere on the line — so read the merged view.
|
|
385
|
+
.action((_opts, cmd) => launchQuotesCommand(cmd.optsWithGlobals()));
|
|
378
386
|
program.commandsGroup("Tokens");
|
|
379
387
|
const feesCmd = program
|
|
380
388
|
.command("fees [address]")
|
|
@@ -505,7 +513,7 @@ llmSetupCmd
|
|
|
505
513
|
.command("openclaw")
|
|
506
514
|
.description("OpenClaw config")
|
|
507
515
|
.option("--install", "Write config to ~/.openclaw/openclaw.json")
|
|
508
|
-
.option("--images", "Also route image generation (gpt-image-2) through the gateway — takes over OpenClaw's 'openai' provider slot")
|
|
516
|
+
.option("--images", "Also route image generation (gpt-image-2.5-flare) through the gateway — takes over OpenClaw's 'openai' provider slot")
|
|
509
517
|
.action(setupOpenclawCommand);
|
|
510
518
|
llmSetupCmd
|
|
511
519
|
.command("opencode")
|
|
@@ -1051,8 +1059,7 @@ program
|
|
|
1051
1059
|
.action(async (text, opts) => {
|
|
1052
1060
|
if (text.length === 0) {
|
|
1053
1061
|
if (output.isNonInteractive()) {
|
|
1054
|
-
output.
|
|
1055
|
-
process.exit(1);
|
|
1062
|
+
output.fatal('No prompt provided. Pass it as an argument: bankr "your prompt"');
|
|
1056
1063
|
}
|
|
1057
1064
|
program.help();
|
|
1058
1065
|
return;
|
|
@@ -1069,8 +1076,7 @@ async function main() {
|
|
|
1069
1076
|
console.log();
|
|
1070
1077
|
process.exit(0);
|
|
1071
1078
|
}
|
|
1072
|
-
output.
|
|
1073
|
-
process.exit(1);
|
|
1079
|
+
output.fatal(getErrorMessage(err));
|
|
1074
1080
|
}
|
|
1075
1081
|
await checkForUpdate(pkg.version);
|
|
1076
1082
|
}
|
|
@@ -43,8 +43,7 @@ export async function balancesCommand(opts) {
|
|
|
43
43
|
if (chains) {
|
|
44
44
|
const invalid = chains.filter((c) => !VALID_CHAINS.has(c));
|
|
45
45
|
if (invalid.length > 0) {
|
|
46
|
-
output.
|
|
47
|
-
process.exit(1);
|
|
46
|
+
output.fatal(`Invalid chain${invalid.length > 1 ? "s" : ""}: ${invalid.join(", ")}. Valid chains: ${[...VALID_CHAINS].join(", ")}`);
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
49
|
const spin = output.spinner("Fetching balances...");
|
package/dist/commands/cancel.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { cancelJob } from "../lib/api.js";
|
|
2
2
|
import { requireApiKey } from "../lib/config.js";
|
|
3
3
|
import * as output from "../lib/output.js";
|
|
4
|
-
import { getErrorMessage } from "../lib/errors.js";
|
|
5
4
|
export async function cancelCommand(jobId) {
|
|
6
5
|
requireApiKey();
|
|
7
6
|
const spin = output.spinner("Cancelling job...");
|
|
@@ -18,9 +17,7 @@ export async function cancelCommand(jobId) {
|
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
catch (err) {
|
|
21
|
-
|
|
22
|
-
output.error(getErrorMessage(err));
|
|
23
|
-
process.exit(1);
|
|
20
|
+
output.failWith(spin, "Failed to cancel job", err);
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
23
|
//# sourceMappingURL=cancel.js.map
|
package/dist/commands/club.js
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import { confirm } from "@inquirer/prompts";
|
|
2
|
-
import {
|
|
2
|
+
import { getApiUrl } from "../lib/config.js";
|
|
3
|
+
import { authHeaders } from "../lib/api.js";
|
|
3
4
|
import * as output from "../lib/output.js";
|
|
4
5
|
import { getErrorMessage } from "../lib/errors.js";
|
|
5
|
-
function authHeaders() {
|
|
6
|
-
return {
|
|
7
|
-
"X-API-Key": requireApiKey(),
|
|
8
|
-
"Content-Type": "application/json",
|
|
9
|
-
"User-Agent": CLI_USER_AGENT,
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
6
|
// Common Base tokens accepted as `--token` shortcuts. Lowercase to bypass
|
|
13
7
|
// viem's strict EIP-55 checksum on the API's isAddress() check; the route
|
|
14
8
|
// resolves to lowercase server-side anyway. Inlined here (not imported
|
|
@@ -79,8 +73,7 @@ export async function clubStatusCommand() {
|
|
|
79
73
|
}
|
|
80
74
|
catch (err) {
|
|
81
75
|
spinner.stop();
|
|
82
|
-
output.
|
|
83
|
-
process.exit(1);
|
|
76
|
+
output.fatal(getErrorMessage(err));
|
|
84
77
|
}
|
|
85
78
|
}
|
|
86
79
|
// ── Sign up ─────────────────────────────────────────────────────────────
|
|
@@ -95,8 +88,7 @@ export async function clubSignupCommand(opts) {
|
|
|
95
88
|
if (opts.token) {
|
|
96
89
|
const resolved = resolvePaymentToken(opts.token);
|
|
97
90
|
if (!resolved) {
|
|
98
|
-
output.
|
|
99
|
-
process.exit(1);
|
|
91
|
+
output.fatal(`Unknown token "${opts.token}". Use one of USDC, BNKR, ETH, or pass a 0x-prefixed Base address.`);
|
|
100
92
|
}
|
|
101
93
|
tokenAddress = resolved;
|
|
102
94
|
}
|
|
@@ -143,8 +135,7 @@ export async function clubSignupCommand(opts) {
|
|
|
143
135
|
output.dim("Run `bankr club` to see your status.");
|
|
144
136
|
}
|
|
145
137
|
catch (err) {
|
|
146
|
-
output.
|
|
147
|
-
process.exit(1);
|
|
138
|
+
output.fatal(getErrorMessage(err));
|
|
148
139
|
}
|
|
149
140
|
}
|
|
150
141
|
// ── Cancel ──────────────────────────────────────────────────────────────
|
|
@@ -187,8 +178,7 @@ export async function clubCancelCommand(opts) {
|
|
|
187
178
|
output.dim("You'll keep Bankr Club access until the end of the current billing period.");
|
|
188
179
|
}
|
|
189
180
|
catch (err) {
|
|
190
|
-
output.
|
|
191
|
-
process.exit(1);
|
|
181
|
+
output.fatal(getErrorMessage(err));
|
|
192
182
|
}
|
|
193
183
|
}
|
|
194
184
|
//# sourceMappingURL=club.js.map
|
package/dist/commands/config.js
CHANGED
|
@@ -12,8 +12,7 @@ function isValidKey(key) {
|
|
|
12
12
|
}
|
|
13
13
|
function requireValidKey(key) {
|
|
14
14
|
if (!isValidKey(key)) {
|
|
15
|
-
output.
|
|
16
|
-
process.exit(1);
|
|
15
|
+
output.fatal(`Unknown config key "${key}". Valid keys: ${ALLOWED_KEYS.join(", ")}`);
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
18
|
function displayValue(key, value) {
|
package/dist/commands/fees.js
CHANGED
|
@@ -215,8 +215,13 @@ function renderDashboard(data) {
|
|
|
215
215
|
}
|
|
216
216
|
console.log(`${DIM(` Wallet: ${data.address}`)}`);
|
|
217
217
|
// Tokens can span launch chains ("chain" absent on pre-multichain rows).
|
|
218
|
+
const launchChainLabel = {
|
|
219
|
+
base: "Base",
|
|
220
|
+
robinhood: "Robinhood",
|
|
221
|
+
arbitrum: "Arbitrum",
|
|
222
|
+
};
|
|
218
223
|
const chainNames = [
|
|
219
|
-
...new Set(data.tokens.map((t) =>
|
|
224
|
+
...new Set(data.tokens.map((t) => launchChainLabel[t.chain ?? "base"] ?? "Base")),
|
|
220
225
|
].join(" + ") || "Base";
|
|
221
226
|
console.log(`${DIM(` Chain: ${chainNames} \u00b7 Tokens: ${data.tokens.length} \u00b7 Period: ${data.days} days`)}`);
|
|
222
227
|
if (data.tokens.length === 0) {
|
|
@@ -329,8 +334,7 @@ export async function feesCommand(address, opts) {
|
|
|
329
334
|
if (opts.days) {
|
|
330
335
|
days = parseInt(opts.days, 10);
|
|
331
336
|
if (isNaN(days) || days < MIN_DAYS || days > MAX_DAYS) {
|
|
332
|
-
output.
|
|
333
|
-
process.exit(1);
|
|
337
|
+
output.fatal(`Days must be between ${MIN_DAYS} and ${MAX_DAYS}`);
|
|
334
338
|
}
|
|
335
339
|
}
|
|
336
340
|
// --token flag: look up fees by token address (no wallet needed)
|
|
@@ -349,8 +353,7 @@ export async function feesCommand(address, opts) {
|
|
|
349
353
|
catch (err) {
|
|
350
354
|
spin.fail("Failed to fetch token fee data");
|
|
351
355
|
emitCESP("task.error");
|
|
352
|
-
output.
|
|
353
|
-
process.exit(1);
|
|
356
|
+
output.fatal(getErrorMessage(err));
|
|
354
357
|
}
|
|
355
358
|
return;
|
|
356
359
|
}
|
|
@@ -370,9 +373,7 @@ export async function feesCommand(address, opts) {
|
|
|
370
373
|
spin.succeed(`Wallet: ${walletAddress}`);
|
|
371
374
|
}
|
|
372
375
|
catch (err) {
|
|
373
|
-
|
|
374
|
-
output.error(getErrorMessage(err));
|
|
375
|
-
process.exit(1);
|
|
376
|
+
output.failWith(spin, "Failed to fetch wallet info", err);
|
|
376
377
|
}
|
|
377
378
|
}
|
|
378
379
|
// Fetch data
|
|
@@ -390,8 +391,7 @@ export async function feesCommand(address, opts) {
|
|
|
390
391
|
catch (err) {
|
|
391
392
|
spin.fail("Failed to fetch fee data");
|
|
392
393
|
emitCESP("task.error");
|
|
393
|
-
output.
|
|
394
|
-
process.exit(1);
|
|
394
|
+
output.fatal(getErrorMessage(err));
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
397
|
export async function feesClaimCommand(tokenAddress, opts) {
|
|
@@ -451,8 +451,7 @@ export async function feesClaimCommand(tokenAddress, opts) {
|
|
|
451
451
|
catch (err) {
|
|
452
452
|
spin.fail("Claim submission failed");
|
|
453
453
|
emitCESP("task.error");
|
|
454
|
-
output.
|
|
455
|
-
process.exit(1);
|
|
454
|
+
output.fatal(getErrorMessage(err));
|
|
456
455
|
}
|
|
457
456
|
}
|
|
458
457
|
// ---------------------------------------------------------------------------
|
|
@@ -465,8 +464,7 @@ export async function feesClaimWalletCommand(address, opts) {
|
|
|
465
464
|
address = undefined;
|
|
466
465
|
}
|
|
467
466
|
if (output.isNonInteractive() && !opts.all) {
|
|
468
|
-
output.
|
|
469
|
-
process.exit(1);
|
|
467
|
+
output.fatal("Use --all to select all tokens in non-interactive mode, or run interactively to choose");
|
|
470
468
|
}
|
|
471
469
|
// Load .env from cwd if present (no dependency needed)
|
|
472
470
|
try {
|
|
@@ -504,13 +502,11 @@ export async function feesClaimWalletCommand(address, opts) {
|
|
|
504
502
|
privateKey = process.env.BANKR_PRIVATE_KEY.trim();
|
|
505
503
|
}
|
|
506
504
|
else if (!address) {
|
|
507
|
-
output.
|
|
508
|
-
process.exit(1);
|
|
505
|
+
output.fatal("Address required when no private key is available. Provide an address argument or set BANKR_PRIVATE_KEY in .env");
|
|
509
506
|
}
|
|
510
507
|
else {
|
|
511
508
|
if (output.isNonInteractive()) {
|
|
512
|
-
output.
|
|
513
|
-
process.exit(1);
|
|
509
|
+
output.fatal("Private key required in non-interactive mode. Use --private-key or set BANKR_PRIVATE_KEY");
|
|
514
510
|
}
|
|
515
511
|
privateKey = await password({
|
|
516
512
|
message: "Enter private key for this wallet (0x...):",
|
|
@@ -529,8 +525,7 @@ export async function feesClaimWalletCommand(address, opts) {
|
|
|
529
525
|
account = privateKeyToAccount(privateKey);
|
|
530
526
|
}
|
|
531
527
|
catch {
|
|
532
|
-
output.
|
|
533
|
-
process.exit(1);
|
|
528
|
+
output.fatal("Invalid private key format");
|
|
534
529
|
}
|
|
535
530
|
// Step 3: Resolve address — derive from key if not provided, verify match if provided
|
|
536
531
|
if (!address) {
|
|
@@ -539,12 +534,10 @@ export async function feesClaimWalletCommand(address, opts) {
|
|
|
539
534
|
}
|
|
540
535
|
else {
|
|
541
536
|
if (!isAddress(address)) {
|
|
542
|
-
output.
|
|
543
|
-
process.exit(1);
|
|
537
|
+
output.fatal("Invalid EVM address");
|
|
544
538
|
}
|
|
545
539
|
if (account.address.toLowerCase() !== address.toLowerCase()) {
|
|
546
|
-
output.
|
|
547
|
-
process.exit(1);
|
|
540
|
+
output.fatal(`Private key does not match address ${address}. Derived: ${account.address}`);
|
|
548
541
|
}
|
|
549
542
|
}
|
|
550
543
|
console.log();
|
|
@@ -566,9 +559,7 @@ export async function feesClaimWalletCommand(address, opts) {
|
|
|
566
559
|
allTokens = result.tokens;
|
|
567
560
|
}
|
|
568
561
|
catch (err) {
|
|
569
|
-
|
|
570
|
-
output.error(getErrorMessage(err));
|
|
571
|
-
process.exit(1);
|
|
562
|
+
output.failWith(fetchSpin, "Failed to fetch fee data", err);
|
|
572
563
|
}
|
|
573
564
|
// Step 5: Filter to tokens with claimable fees (API already filters, but
|
|
574
565
|
// double-check for any rounding edge cases)
|
|
@@ -675,8 +666,7 @@ export async function feesClaimWalletCommand(address, opts) {
|
|
|
675
666
|
output.warn(`${baseChainTokens.length - buildableTokens.length} token(s) missing initializer data — skipped`);
|
|
676
667
|
}
|
|
677
668
|
if (buildableTokens.length === 0) {
|
|
678
|
-
output.
|
|
679
|
-
process.exit(1);
|
|
669
|
+
output.fatal("No transactions could be built");
|
|
680
670
|
}
|
|
681
671
|
// Encode calldata locally (instant, no RPC)
|
|
682
672
|
const txData = buildableTokens.map((t) => ({
|
package/dist/commands/files.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFileSync, statSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { basename } from "node:path";
|
|
3
3
|
import { CLI_USER_AGENT, getApiUrl, requireApiKey } from "../lib/config.js";
|
|
4
|
+
import { authHeaders } from "../lib/api.js";
|
|
4
5
|
import * as output from "../lib/output.js";
|
|
5
6
|
import { getErrorMessage } from "../lib/errors.js";
|
|
6
7
|
async function readStdin() {
|
|
@@ -12,13 +13,6 @@ async function readStdin() {
|
|
|
12
13
|
chunks.push(chunk);
|
|
13
14
|
return Buffer.concat(chunks).toString("utf-8");
|
|
14
15
|
}
|
|
15
|
-
function authHeaders() {
|
|
16
|
-
return {
|
|
17
|
-
"X-API-Key": requireApiKey(),
|
|
18
|
-
"Content-Type": "application/json",
|
|
19
|
-
"User-Agent": CLI_USER_AGENT,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
16
|
// ── List files ──────────────────────────────────────────────────────────
|
|
23
17
|
export async function filesListCommand(opts) {
|
|
24
18
|
const spinner = output.spinner("Fetching files...");
|
|
@@ -55,8 +49,7 @@ export async function filesListCommand(opts) {
|
|
|
55
49
|
}
|
|
56
50
|
catch (err) {
|
|
57
51
|
spinner.stop();
|
|
58
|
-
output.
|
|
59
|
-
process.exit(1);
|
|
52
|
+
output.fatal(getErrorMessage(err));
|
|
60
53
|
}
|
|
61
54
|
}
|
|
62
55
|
// ── Upload file ─────────────────────────────────────────────────────────
|
|
@@ -103,8 +96,7 @@ export async function filesUploadCommand(filePath, opts) {
|
|
|
103
96
|
}
|
|
104
97
|
catch (err) {
|
|
105
98
|
spinner.stop();
|
|
106
|
-
output.
|
|
107
|
-
process.exit(1);
|
|
99
|
+
output.fatal(getErrorMessage(err));
|
|
108
100
|
}
|
|
109
101
|
}
|
|
110
102
|
// ── Download file ───────────────────────────────────────────────────────
|
|
@@ -125,8 +117,7 @@ export async function filesDownloadCommand(fileId) {
|
|
|
125
117
|
}
|
|
126
118
|
catch (err) {
|
|
127
119
|
spinner.stop();
|
|
128
|
-
output.
|
|
129
|
-
process.exit(1);
|
|
120
|
+
output.fatal(getErrorMessage(err));
|
|
130
121
|
}
|
|
131
122
|
}
|
|
132
123
|
// ── Create folder ───────────────────────────────────────────────────────
|
|
@@ -150,8 +141,7 @@ export async function filesMkdirCommand(name, opts) {
|
|
|
150
141
|
}
|
|
151
142
|
catch (err) {
|
|
152
143
|
spinner.stop();
|
|
153
|
-
output.
|
|
154
|
-
process.exit(1);
|
|
144
|
+
output.fatal(getErrorMessage(err));
|
|
155
145
|
}
|
|
156
146
|
}
|
|
157
147
|
// ── Delete file ─────────────────────────────────────────────────────────
|
|
@@ -171,8 +161,7 @@ export async function filesRmCommand(fileId) {
|
|
|
171
161
|
}
|
|
172
162
|
catch (err) {
|
|
173
163
|
spinner.stop();
|
|
174
|
-
output.
|
|
175
|
-
process.exit(1);
|
|
164
|
+
output.fatal(getErrorMessage(err));
|
|
176
165
|
}
|
|
177
166
|
}
|
|
178
167
|
// ── Storage usage ───────────────────────────────────────────────────────
|
|
@@ -203,8 +192,7 @@ export async function filesStorageCommand() {
|
|
|
203
192
|
}
|
|
204
193
|
catch (err) {
|
|
205
194
|
spinner.stop();
|
|
206
|
-
output.
|
|
207
|
-
process.exit(1);
|
|
195
|
+
output.fatal(getErrorMessage(err));
|
|
208
196
|
}
|
|
209
197
|
}
|
|
210
198
|
// ── Read file contents ──────────────────────────────────────────────────
|
|
@@ -240,8 +228,7 @@ export async function filesCatCommand(fileId, opts) {
|
|
|
240
228
|
}
|
|
241
229
|
catch (err) {
|
|
242
230
|
spinner.stop();
|
|
243
|
-
output.
|
|
244
|
-
process.exit(1);
|
|
231
|
+
output.fatal(getErrorMessage(err));
|
|
245
232
|
}
|
|
246
233
|
}
|
|
247
234
|
// ── Edit file (find/replace or overwrite) ───────────────────────────────
|
|
@@ -249,16 +236,13 @@ export async function filesEditCommand(fileId, opts) {
|
|
|
249
236
|
const hasReplace = opts.find !== undefined || opts.replace !== undefined;
|
|
250
237
|
const hasOverwrite = opts.content !== undefined || opts.from !== undefined;
|
|
251
238
|
if (!hasReplace && !hasOverwrite) {
|
|
252
|
-
output.
|
|
253
|
-
process.exit(1);
|
|
239
|
+
output.fatal("Specify either --find/--replace for find-and-replace, or --content/--from for full overwrite.");
|
|
254
240
|
}
|
|
255
241
|
if (hasReplace && hasOverwrite) {
|
|
256
|
-
output.
|
|
257
|
-
process.exit(1);
|
|
242
|
+
output.fatal("Cannot combine --find/--replace with --content/--from.");
|
|
258
243
|
}
|
|
259
244
|
if (hasReplace && (opts.find === undefined || opts.replace === undefined)) {
|
|
260
|
-
output.
|
|
261
|
-
process.exit(1);
|
|
245
|
+
output.fatal("Find-and-replace requires both --find and --replace.");
|
|
262
246
|
}
|
|
263
247
|
const spinner = output.spinner("Editing file...");
|
|
264
248
|
try {
|
|
@@ -316,8 +300,7 @@ export async function filesEditCommand(fileId, opts) {
|
|
|
316
300
|
}
|
|
317
301
|
catch (err) {
|
|
318
302
|
spinner.stop();
|
|
319
|
-
output.
|
|
320
|
-
process.exit(1);
|
|
303
|
+
output.fatal(getErrorMessage(err));
|
|
321
304
|
}
|
|
322
305
|
}
|
|
323
306
|
// ── Write/replace file content from stdin or local file ─────────────────
|
|
@@ -342,8 +325,7 @@ export async function filesWriteCommand(fileId, opts) {
|
|
|
342
325
|
}
|
|
343
326
|
catch (err) {
|
|
344
327
|
spinner.stop();
|
|
345
|
-
output.
|
|
346
|
-
process.exit(1);
|
|
328
|
+
output.fatal(getErrorMessage(err));
|
|
347
329
|
}
|
|
348
330
|
}
|
|
349
331
|
// ── Search files ────────────────────────────────────────────────────────
|
|
@@ -381,8 +363,7 @@ export async function filesSearchCommand(query, opts) {
|
|
|
381
363
|
}
|
|
382
364
|
catch (err) {
|
|
383
365
|
spinner.stop();
|
|
384
|
-
output.
|
|
385
|
-
process.exit(1);
|
|
366
|
+
output.fatal(getErrorMessage(err));
|
|
386
367
|
}
|
|
387
368
|
}
|
|
388
369
|
// ── Move file to a different folder ─────────────────────────────────────
|
|
@@ -404,8 +385,7 @@ export async function filesMvCommand(fileId, folder) {
|
|
|
404
385
|
}
|
|
405
386
|
catch (err) {
|
|
406
387
|
spinner.stop();
|
|
407
|
-
output.
|
|
408
|
-
process.exit(1);
|
|
388
|
+
output.fatal(getErrorMessage(err));
|
|
409
389
|
}
|
|
410
390
|
}
|
|
411
391
|
// ── Rename file ─────────────────────────────────────────────────────────
|
|
@@ -427,8 +407,7 @@ export async function filesRenameCommand(fileId, name) {
|
|
|
427
407
|
}
|
|
428
408
|
catch (err) {
|
|
429
409
|
spinner.stop();
|
|
430
|
-
output.
|
|
431
|
-
process.exit(1);
|
|
410
|
+
output.fatal(getErrorMessage(err));
|
|
432
411
|
}
|
|
433
412
|
}
|
|
434
413
|
// ── File info ───────────────────────────────────────────────────────────
|
|
@@ -456,8 +435,7 @@ export async function filesInfoCommand(fileId) {
|
|
|
456
435
|
}
|
|
457
436
|
catch (err) {
|
|
458
437
|
spinner.stop();
|
|
459
|
-
output.
|
|
460
|
-
process.exit(1);
|
|
438
|
+
output.fatal(getErrorMessage(err));
|
|
461
439
|
}
|
|
462
440
|
}
|
|
463
441
|
// ── Helpers ─────────────────────────────────────────────────────────────
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { type LaunchChain } from "../lib/api.js";
|
|
1
2
|
export interface LaunchOptions {
|
|
2
3
|
name?: string;
|
|
3
4
|
symbol?: string;
|
|
4
5
|
image?: string;
|
|
5
6
|
chain?: string;
|
|
7
|
+
/** --quote: symbol or address of the quote token to pair the pool with. */
|
|
8
|
+
quote?: string;
|
|
6
9
|
/** Commander --no-vesting flag: false = vesting explicitly turned off. */
|
|
7
10
|
vesting?: boolean;
|
|
8
11
|
tweet?: string;
|
|
@@ -14,5 +17,7 @@ export interface LaunchOptions {
|
|
|
14
17
|
yes?: boolean;
|
|
15
18
|
simulate?: boolean;
|
|
16
19
|
}
|
|
20
|
+
export declare function launchChainLabel(chain: LaunchChain): string;
|
|
21
|
+
export declare function parseLaunchChain(value?: string): LaunchChain | undefined;
|
|
17
22
|
export declare function launchCommand(options: LaunchOptions): Promise<void>;
|
|
18
23
|
//# sourceMappingURL=launch.d.ts.map
|