moltlaunch 2.7.1 → 2.7.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.
package/dist/index.js CHANGED
@@ -1800,9 +1800,10 @@ async function fees(options) {
1800
1800
  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\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n");
1801
1801
  }
1802
1802
  try {
1803
- const agentId = await getAgentByOwner(wallet2.address);
1804
- if (!agentId || agentId <= 0n) {
1805
- throw new Error("No registered agent found for this wallet");
1803
+ let agentId = null;
1804
+ try {
1805
+ agentId = await getAgentByOwner(wallet2.address);
1806
+ } catch {
1806
1807
  }
1807
1808
  const balance = await publicClient.readContract({
1808
1809
  address: REVENUE_MANAGER_ADDRESS,
@@ -1815,14 +1816,14 @@ async function fees(options) {
1815
1816
  if (options.json) {
1816
1817
  console.log(JSON.stringify({
1817
1818
  wallet: wallet2.address,
1818
- agentId: agentId.toString(),
1819
+ ...agentId ? { agentId: agentId.toString() } : {},
1819
1820
  revenueManager: REVENUE_MANAGER_ADDRESS,
1820
1821
  pendingFees: { wei: balance.toString(), eth: balanceEth }
1821
1822
  }));
1822
1823
  return;
1823
1824
  }
1824
1825
  console.log(`Wallet: ${wallet2.address}`);
1825
- console.log(`Agent ID: ${agentId.toString()}`);
1826
+ if (agentId) console.log(`Agent ID: ${agentId.toString()}`);
1826
1827
  console.log(`Revenue Manager: ${REVENUE_MANAGER_ADDRESS}`);
1827
1828
  console.log("");
1828
1829
  console.log(`Pending fees: ${balanceEth} ETH`);