moltlaunch 2.0.2 → 2.0.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.
package/dist/index.js CHANGED
@@ -891,14 +891,19 @@ async function register(options) {
891
891
  priceWei: parseEther(options.price),
892
892
  flaunchToken: tokenAddress
893
893
  });
894
+ let registrationStatus = "unknown";
894
895
  try {
895
896
  const agentIdStr = agentResult.agentId.toString();
896
897
  const { signature, timestamp, nonce } = await signAction(wallet2, "register", agentIdStr);
897
- await fetch(`${APIS.MOLTLAUNCH}/api/agents/register`, {
898
+ const regRes = await fetch(`${APIS.MOLTLAUNCH}/api/agents/register`, {
898
899
  method: "POST",
899
900
  headers: { "Content-Type": "application/json" },
900
901
  body: JSON.stringify({ agentId: agentIdStr, signature, timestamp, nonce })
901
902
  });
903
+ if (regRes.ok) {
904
+ const regData = await regRes.json();
905
+ registrationStatus = regData.status === "approved" ? "approved" : "pending";
906
+ }
902
907
  } catch {
903
908
  }
904
909
  if (options.json) {
@@ -917,13 +922,18 @@ async function register(options) {
917
922
  skills,
918
923
  endpoint: options.endpoint,
919
924
  priceEth: options.price,
920
- registry: CONTRACTS.IDENTITY_REGISTRY
925
+ registry: CONTRACTS.IDENTITY_REGISTRY,
926
+ registrationStatus
921
927
  })
922
928
  );
923
929
  return;
924
930
  }
925
931
  console.log("\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550");
926
- console.log(" \u2705 Registration Complete!");
932
+ if (registrationStatus === "pending") {
933
+ console.log(" \u23F3 Registration Submitted \u2014 Pending Approval");
934
+ } else {
935
+ console.log(" \u2705 Registration Complete!");
936
+ }
927
937
  console.log("\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n");
928
938
  console.log(`Agent ID: ${agentResult.agentId}`);
929
939
  console.log(`Name: ${options.name}`);
@@ -956,6 +966,11 @@ async function register(options) {
956
966
  }
957
967
  console.log("\nOthers can invest in your agent at:");
958
968
  console.log(` ${flaunchUrl}`);
969
+ if (registrationStatus === "pending") {
970
+ console.log("\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
971
+ console.log("\n\u23F3 Your agent is pending admin approval.");
972
+ console.log(" It will appear in the marketplace once approved.");
973
+ }
959
974
  } catch (err) {
960
975
  const errorMsg = err instanceof Error ? err.message : String(err);
961
976
  if (options.json) {