@bankr/cli 0.1.0-beta.9 → 0.1.3

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 (64) hide show
  1. package/README.md +18 -0
  2. package/dist/cli.js +200 -3
  3. package/dist/commands/balances.d.ts +5 -0
  4. package/dist/commands/balances.js +113 -0
  5. package/dist/commands/fees.d.ts +18 -0
  6. package/dist/commands/fees.js +793 -0
  7. package/dist/commands/launch.d.ts +13 -0
  8. package/dist/commands/launch.js +174 -0
  9. package/dist/commands/llm.d.ts +11 -0
  10. package/dist/commands/llm.js +463 -22
  11. package/dist/commands/login.d.ts +3 -0
  12. package/dist/commands/login.js +94 -4
  13. package/dist/commands/profile.d.ts +26 -0
  14. package/dist/commands/profile.js +183 -0
  15. package/dist/commands/prompt.js +5 -0
  16. package/dist/commands/sign.js +3 -0
  17. package/dist/commands/sounds.d.ts +12 -0
  18. package/dist/commands/sounds.js +262 -0
  19. package/dist/commands/submit.js +14 -4
  20. package/dist/index.d.ts +2 -2
  21. package/dist/index.js +1 -1
  22. package/dist/lib/api.d.ts +213 -0
  23. package/dist/lib/api.js +177 -3
  24. package/dist/lib/cesp/engine.d.ts +13 -0
  25. package/dist/lib/cesp/engine.js +132 -0
  26. package/dist/lib/cesp/player.d.ts +6 -0
  27. package/dist/lib/cesp/player.js +50 -0
  28. package/dist/lib/cesp/types.d.ts +38 -0
  29. package/dist/lib/cesp/types.js +2 -0
  30. package/dist/lib/config.d.ts +4 -0
  31. package/dist/lib/config.js +1 -0
  32. package/package.json +4 -2
  33. package/dist/cli.d.ts.map +0 -1
  34. package/dist/cli.js.map +0 -1
  35. package/dist/commands/cancel.d.ts.map +0 -1
  36. package/dist/commands/cancel.js.map +0 -1
  37. package/dist/commands/capabilities.d.ts.map +0 -1
  38. package/dist/commands/capabilities.js.map +0 -1
  39. package/dist/commands/config.d.ts.map +0 -1
  40. package/dist/commands/config.js.map +0 -1
  41. package/dist/commands/llm.d.ts.map +0 -1
  42. package/dist/commands/llm.js.map +0 -1
  43. package/dist/commands/login.d.ts.map +0 -1
  44. package/dist/commands/login.js.map +0 -1
  45. package/dist/commands/logout.d.ts.map +0 -1
  46. package/dist/commands/logout.js.map +0 -1
  47. package/dist/commands/prompt.d.ts.map +0 -1
  48. package/dist/commands/prompt.js.map +0 -1
  49. package/dist/commands/sign.d.ts.map +0 -1
  50. package/dist/commands/sign.js.map +0 -1
  51. package/dist/commands/status.d.ts.map +0 -1
  52. package/dist/commands/status.js.map +0 -1
  53. package/dist/commands/submit.d.ts.map +0 -1
  54. package/dist/commands/submit.js.map +0 -1
  55. package/dist/commands/whoami.d.ts.map +0 -1
  56. package/dist/commands/whoami.js.map +0 -1
  57. package/dist/index.d.ts.map +0 -1
  58. package/dist/index.js.map +0 -1
  59. package/dist/lib/api.d.ts.map +0 -1
  60. package/dist/lib/api.js.map +0 -1
  61. package/dist/lib/config.d.ts.map +0 -1
  62. package/dist/lib/config.js.map +0 -1
  63. package/dist/lib/output.d.ts.map +0 -1
  64. package/dist/lib/output.js.map +0 -1
@@ -0,0 +1,13 @@
1
+ export interface LaunchOptions {
2
+ name?: string;
3
+ symbol?: string;
4
+ image?: string;
5
+ tweet?: string;
6
+ website?: string;
7
+ fee?: string;
8
+ feeType?: string;
9
+ yes?: boolean;
10
+ simulate?: boolean;
11
+ }
12
+ export declare function launchCommand(options: LaunchOptions): Promise<void>;
13
+ //# sourceMappingURL=launch.d.ts.map
@@ -0,0 +1,174 @@
1
+ import { confirm, input, select } from "@inquirer/prompts";
2
+ import { deployToken } from "../lib/api.js";
3
+ import { emitCESP } from "../lib/cesp/engine.js";
4
+ import { requireApiKey } from "../lib/config.js";
5
+ import * as output from "../lib/output.js";
6
+ const VALID_FEE_TYPES = ["x", "farcaster", "ens", "wallet"];
7
+ function parseFeeType(value) {
8
+ if (!value)
9
+ return "x";
10
+ const lower = value.toLowerCase();
11
+ if (VALID_FEE_TYPES.includes(lower))
12
+ return lower;
13
+ output.warn(`Unknown fee type "${value}". Valid types: ${VALID_FEE_TYPES.join(", ")}. Defaulting to "x".`);
14
+ return "x";
15
+ }
16
+ function feeTypeLabel(type) {
17
+ switch (type) {
18
+ case "x":
19
+ return "X";
20
+ case "farcaster":
21
+ return "Farcaster";
22
+ case "ens":
23
+ return "ENS";
24
+ case "wallet":
25
+ return "Wallet";
26
+ }
27
+ }
28
+ async function collectInteractive(options) {
29
+ const tokenName = options.name ??
30
+ (await input({
31
+ message: "What do you want to call your token?",
32
+ theme: output.bankrTheme,
33
+ required: true,
34
+ }));
35
+ const tokenSymbol = options.symbol ??
36
+ (await input({
37
+ message: "Token symbol (press Enter to auto-generate from name):",
38
+ theme: output.bankrTheme,
39
+ }));
40
+ const imageUrl = options.image ??
41
+ (await input({
42
+ message: "Image URL for your token (press Enter to skip):",
43
+ theme: output.bankrTheme,
44
+ }));
45
+ const tweetUrl = options.tweet ??
46
+ (await input({
47
+ message: "Associate with a tweet? Paste URL (press Enter to skip):",
48
+ theme: output.bankrTheme,
49
+ }));
50
+ const websiteUrl = options.website ??
51
+ (await input({
52
+ message: "Project website URL (press Enter to skip):",
53
+ theme: output.bankrTheme,
54
+ }));
55
+ let feeRecipient = options.fee ??
56
+ (await input({
57
+ message: "Direct fees to someone? Enter username, ENS, or address (press Enter to skip):",
58
+ theme: output.bankrTheme,
59
+ }));
60
+ let feeRecipientType = parseFeeType(options.feeType);
61
+ if (feeRecipient && !options.feeType) {
62
+ feeRecipientType = await select({
63
+ message: "What type of identifier is this?",
64
+ choices: [
65
+ { name: "X (Twitter)", value: "x" },
66
+ { name: "Farcaster", value: "farcaster" },
67
+ { name: "ENS", value: "ens" },
68
+ { name: "Wallet address", value: "wallet" },
69
+ ],
70
+ theme: output.bankrTheme,
71
+ });
72
+ }
73
+ if (!feeRecipient) {
74
+ feeRecipient = "";
75
+ }
76
+ return {
77
+ tokenName: tokenName.trim(),
78
+ tokenSymbol: tokenSymbol.trim(),
79
+ imageUrl: imageUrl.trim(),
80
+ tweetUrl: tweetUrl.trim(),
81
+ websiteUrl: websiteUrl.trim(),
82
+ feeRecipient: feeRecipient.trim(),
83
+ feeRecipientType,
84
+ };
85
+ }
86
+ export async function launchCommand(options) {
87
+ requireApiKey();
88
+ // Collect token details
89
+ const state = await collectInteractive(options);
90
+ if (!state.tokenName) {
91
+ output.error("Token name is required.");
92
+ process.exit(1);
93
+ }
94
+ // Display summary
95
+ console.log();
96
+ output.brandBold(" Token launch summary");
97
+ console.log();
98
+ output.keyValue("Name", state.tokenName);
99
+ output.keyValue("Symbol", state.tokenSymbol || "(auto)");
100
+ output.keyValue("Image", state.imageUrl || "(none)");
101
+ output.keyValue("Tweet", state.tweetUrl || "(none)");
102
+ output.keyValue("Website", state.websiteUrl || "(none)");
103
+ output.keyValue("Fee recipient", state.feeRecipient
104
+ ? `${state.feeRecipient} (${feeTypeLabel(state.feeRecipientType)})`
105
+ : "(self)");
106
+ output.keyValue("Chain", "Base");
107
+ if (options.simulate) {
108
+ output.keyValue("Mode", "Simulation (dry run)");
109
+ }
110
+ console.log();
111
+ // Confirm unless --yes
112
+ if (!options.yes) {
113
+ const proceed = await confirm({
114
+ message: options.simulate
115
+ ? "Simulate this token launch?"
116
+ : "Launch this token?",
117
+ default: true,
118
+ theme: output.bankrTheme,
119
+ });
120
+ if (!proceed) {
121
+ output.dim("Launch cancelled.");
122
+ return;
123
+ }
124
+ }
125
+ // Deploy directly via REST endpoint (no LLM agent)
126
+ const spin = output.spinner(options.simulate ? "Simulating token deploy..." : "Deploying your token...");
127
+ const startTime = Date.now();
128
+ try {
129
+ const result = await deployToken({
130
+ tokenName: state.tokenName,
131
+ tokenSymbol: state.tokenSymbol || undefined,
132
+ image: state.imageUrl || undefined,
133
+ tweetUrl: state.tweetUrl || undefined,
134
+ websiteUrl: state.websiteUrl || undefined,
135
+ feeRecipient: state.feeRecipient
136
+ ? { type: state.feeRecipientType, value: state.feeRecipient }
137
+ : undefined,
138
+ simulateOnly: options.simulate,
139
+ });
140
+ const elapsed = output.formatDuration(Date.now() - startTime);
141
+ spin.succeed(result.simulated
142
+ ? `Simulation complete in ${elapsed}`
143
+ : `Token deployed in ${elapsed}`);
144
+ emitCESP("task.complete");
145
+ console.log();
146
+ output.keyValue("Token Address", result.tokenAddress);
147
+ output.keyValue("Pool ID", result.poolId);
148
+ if (result.txHash) {
149
+ output.keyValue("Transaction", result.txHash);
150
+ }
151
+ output.keyValue("Chain", result.chain);
152
+ if (result.feeDistribution) {
153
+ console.log();
154
+ output.brandBold(" Fee distribution");
155
+ console.log();
156
+ for (const [role, info] of Object.entries(result.feeDistribution)) {
157
+ const pct = (info.bps / 100).toFixed(1);
158
+ const label = role === "alt"
159
+ ? "Ecosystem"
160
+ : role.charAt(0).toUpperCase() + role.slice(1);
161
+ output.keyValue(` ${label} (${pct}%)`, info.address);
162
+ }
163
+ }
164
+ console.log();
165
+ output.dim(`View token: https://bankr.bot/launches/${result.tokenAddress}`);
166
+ }
167
+ catch (err) {
168
+ spin.fail("Token launch failed");
169
+ emitCESP("task.error");
170
+ output.error(err.message);
171
+ process.exit(1);
172
+ }
173
+ }
174
+ //# sourceMappingURL=launch.js.map
@@ -1,5 +1,16 @@
1
1
  export declare function modelsCommand(): Promise<void>;
2
2
  export declare function creditsCommand(): Promise<void>;
3
+ export declare function creditsAddCommand(amount: string, opts: {
4
+ token?: string;
5
+ yes?: boolean;
6
+ }): Promise<void>;
7
+ export declare function creditsAutoCommand(opts: {
8
+ enable?: boolean;
9
+ disable?: boolean;
10
+ amount?: string;
11
+ threshold?: string;
12
+ tokens?: string;
13
+ }): Promise<void>;
3
14
  export declare function setupOpenclawCommand(opts: {
4
15
  install?: boolean;
5
16
  }): Promise<void>;