aiprotocol-sbi 1.3.0 → 1.3.2

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.
@@ -63,6 +63,7 @@ let EconomyInfoCommand = EconomyInfoCommand_1 = class EconomyInfoCommand {
63
63
  this.output.row("Price", `${result?.token_price}`);
64
64
  this.output.row("Market cap", `${result?.market_cap}`);
65
65
  this.output.row("Total supply", `${result?.total_supply}`);
66
+ this.output.row("Moltbook URL", result?.molt_book_url);
66
67
  this.output.row("Uniswap Buy / Sell", `https://app.uniswap.org/swap?chain=base&inputCurrency=0x97c806e7665d3afd84a8fe1837921403d59f3dcc&outputCurrency=${result?.token_address}`);
67
68
  this.output.row("8004 Registry", `https://www.8004scan.io/agents/base/${result?.registry_id}`);
68
69
  this.output.divider();
@@ -34,7 +34,7 @@ let EconomyLaunchCommand = EconomyLaunchCommand_1 = class EconomyLaunchCommand {
34
34
  .requiredOption("--ticker <ticker>", "Token ticker")
35
35
  .requiredOption("--description <description>", "Short agent description")
36
36
  .requiredOption("--image <image>", "Agent image")
37
- .requiredOption("--moltbook_profile <molt_book_url>", "MoltBook URL")
37
+ .requiredOption("--moltbook <moltbook>", "MoltBook URL")
38
38
  .option("--json", "Output result as JSON")
39
39
  .action(async (opts) => {
40
40
  const cfg = this.config.requireWallet();
@@ -58,7 +58,7 @@ let EconomyLaunchCommand = EconomyLaunchCommand_1 = class EconomyLaunchCommand {
58
58
  const name = this.security.sanitizeString(opts.name, 64);
59
59
  const ticker = tickerCheck.value;
60
60
  const description = opts?.description;
61
- const moltBookUrl = opts?.molt_book_url
61
+ const moltBookUrl = opts?.moltbook
62
62
  ? this.security.sanitizeString(opts.description, 512)
63
63
  : undefined;
64
64
  const image = opts.image;
@@ -86,6 +86,7 @@ let EconomyListCommand = EconomyListCommand_1 = class EconomyListCommand {
86
86
  this.output.row("Price", `${eco?.token_price}`);
87
87
  this.output.row("Market cap", `${eco?.market_cap}`);
88
88
  this.output.row("Total supply", `${eco?.total_supply}`);
89
+ this.output.row("Moltbook URL", result?.molt_book_url);
89
90
  this.output.row("Uniswap Buy / Sell", `https://app.uniswap.org/swap?chain=base&inputCurrency=0x97c806e7665d3afd84a8fe1837921403d59f3dcc&outputCurrency=${eco?.token_address}`);
90
91
  this.output.row("8004 Registry", `https://www.8004scan.io/agents/base/${eco?.registry_id}`);
91
92
  this.output.row("Status", this.output.statusBadge(eco.status));
@@ -66,6 +66,7 @@ let EconomyStatusCommand = EconomyStatusCommand_1 = class EconomyStatusCommand {
66
66
  this.output.row("Price", `${result?.token_price}`);
67
67
  this.output.row("Market cap", `${result?.market_cap}`);
68
68
  this.output.row("Total supply", `${result?.total_supply}`);
69
+ this.output.row("Moltbook URL", result?.molt_book_url);
69
70
  this.output.row("Uniswap Buy / Sell", `https://app.uniswap.org/swap?chain=base&inputCurrency=0x97c806e7665d3afd84a8fe1837921403d59f3dcc&outputCurrency=${result?.token_address}`);
70
71
  this.output.row("8004 Registry", `https://www.8004scan.io/agents/base/${result?.registry_id}`);
71
72
  this.output.divider();
@@ -105,6 +106,7 @@ let EconomyStatusCommand = EconomyStatusCommand_1 = class EconomyStatusCommand {
105
106
  this.output.row("Price", `${result?.token_price}`);
106
107
  this.output.row("Market cap", `${result?.market_cap}`);
107
108
  this.output.row("Total supply", `${result?.total_supply}`);
109
+ this.output.row("Moltbook URL", result?.molt_book_url);
108
110
  this.output.row("Uniswap Buy / Sell", `https://app.uniswap.org/swap?chain=base&inputCurrency=0x97c806e7665d3afd84a8fe1837921403d59f3dcc&outputCurrency=${result?.token_address}`);
109
111
  this.output.row("8004 Registry", `https://www.8004scan.io/agents/base/${result?.registry_id}`);
110
112
  this.output.divider();
@@ -25,4 +25,5 @@ export declare class SetupCommand {
25
25
  private validateBotName;
26
26
  private validateNetwork;
27
27
  private validateFunding;
28
+ private handleError;
28
29
  }
@@ -100,7 +100,9 @@ let SetupCommand = SetupCommand_1 = class SetupCommand {
100
100
  }
101
101
  const appStatus = await this.backend.getApplicationStatus(botId);
102
102
  if (!appStatus) {
103
- throw new Error("Application does not exist or failed to fetch. Reset and try again.");
103
+ this.output.warn(`Application does not exist or failed to fetch due to an error.`);
104
+ this.output.warn(`Please make sure the arguments passed are correct. Reset and restart the command again.`);
105
+ process.exit(1);
104
106
  }
105
107
  if (appStatus.type === "GRANT") {
106
108
  await this.handleGrantStatus(appStatus, opts);
@@ -123,23 +125,34 @@ let SetupCommand = SetupCommand_1 = class SetupCommand {
123
125
  this.output.error("❌ Grant rejected.");
124
126
  if (appStatus?.reason)
125
127
  this.output.warn(`Reason: ${appStatus.reason}`);
128
+ this.output.info("Switch to self-funding: aiprotocol-sbi setup --reset");
126
129
  }
127
130
  else {
128
131
  this.output.info("Grant under review. Response within 48 hours.");
132
+ this.output.info("Check status anytime: aiprotocol-sbi grant status");
129
133
  }
130
134
  this.output.blank();
131
135
  }
132
136
  }
133
137
  async handleSelfStatus(existingBot, appStatus, opts) {
138
+ const token = "ALI";
139
+ const requiredAmount = "500 ALI";
134
140
  if (!opts.json) {
135
141
  this.output.section("Funding Method: Self-Funded");
136
142
  this.output.info("You need to send 500 ALI to launch an economy.");
143
+ this.output.info("Send payment to your bot's address:");
144
+ this.output.divider();
137
145
  this.output.row("Wallet Address", existingBot.wallet_address);
146
+ this.output.row("Payment Token", token);
147
+ this.output.row("Required Amount", requiredAmount);
148
+ this.output.blank();
149
+ this.output.info("Approve these funds using 'Approve Script'");
138
150
  if (appStatus?.status === "SUCCESS") {
139
151
  this.output.success("✅ Payment confirmed! Your agent is funded.");
152
+ this.output.info("aiprotocol-sbi economy launch");
140
153
  }
141
154
  else {
142
- this.output.info("Verify payment using: aiprotocol-sbi payment verify");
155
+ this.output.info("Verify payment: aiprotocol-sbi payment verify");
143
156
  }
144
157
  this.output.blank();
145
158
  }
@@ -177,6 +190,7 @@ let SetupCommand = SetupCommand_1 = class SetupCommand {
177
190
  !opts.links) {
178
191
  throw new Error("GRANT requires --applicant-name, --applicant-email, --purpose --links");
179
192
  }
193
+ this.output.section("AIP Grant Application");
180
194
  const result = await this.backend.submitGrantApplication({
181
195
  bot_id: botId,
182
196
  name: opts.applicantName,
@@ -192,20 +206,30 @@ let SetupCommand = SetupCommand_1 = class SetupCommand {
192
206
  this.output.row("Bot ID", botId);
193
207
  this.output.row("Bot Name", botName);
194
208
  this.output.row("Wallet Address", wallet.address);
209
+ this.output.row("Private Key", wallet.privateKey);
195
210
  this.output.info("Wait 48 hours for approval.");
211
+ this.output.info("Check status anytime: aiprotocol-sbi grant status");
196
212
  }
197
213
  async handleSelfFlow(botId, wallet, network, opts) {
214
+ const token = "ALI";
215
+ if (!["ALI", "USDC"].includes(token)) {
216
+ throw new Error("SELF requires --payment-token ALI or USDC");
217
+ }
218
+ const requiredAmount = token === "ALI" ? "500" : "10";
198
219
  await this.backend.submitApplication({
199
220
  bot_id: botId,
200
221
  wallet_address: wallet.address,
201
- expected_token: "ALI",
202
- amount: "500",
222
+ expected_token: token,
223
+ amount: requiredAmount,
203
224
  network,
204
225
  type: "SELF",
205
226
  });
206
227
  this.output.warn("⚠️ You need to send 500 ALI to launch an economy.");
228
+ this.output.warn("Send payment to your bot's address:");
207
229
  this.output.row("Wallet", wallet.address);
208
230
  this.output.row("Network", network);
231
+ this.output.row("Required Amount", requiredAmount);
232
+ this.output.info("After sending, approve these funds using 'Approve Script'");
209
233
  this.output.info("Verify payment using: aiprotocol-sbi payment verify");
210
234
  }
211
235
  validateBotName(name) {
@@ -227,6 +251,16 @@ let SetupCommand = SetupCommand_1 = class SetupCommand {
227
251
  }
228
252
  return f;
229
253
  }
254
+ handleError(err, opts) {
255
+ const message = err?.message || String(err);
256
+ if (opts.json) {
257
+ this.output.json({ success: false, error: message });
258
+ }
259
+ else {
260
+ this.output.error(`Setup failed: ${message}`);
261
+ }
262
+ process.exit(1);
263
+ }
230
264
  };
231
265
  exports.SetupCommand = SetupCommand;
232
266
  exports.SetupCommand = SetupCommand = SetupCommand_1 = __decorate([