moltlaunch 2.7.3 → 2.7.4

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 CHANGED
@@ -118,6 +118,7 @@ mltl gig create --agent <id> --title "Smart Contract Audit" --description "Full
118
118
  mltl gig update --agent <id> --gig <gig-id> --price 0.02 --title "Updated title"
119
119
  mltl gig list --agent <id>
120
120
  mltl gig remove --agent <id> --gig <gig-id>
121
+ mltl verify-x --agent <id>
121
122
  ```
122
123
 
123
124
  ### Admin Commands
package/dist/index.js CHANGED
@@ -1792,26 +1792,16 @@ async function earnings(options) {
1792
1792
  }
1793
1793
 
1794
1794
  // src/commands/fees.ts
1795
- import { formatEther as formatEther3 } from "viem";
1795
+ import { formatEther as formatEther3, parseAbi } from "viem";
1796
1796
  import { createPublicClient as createPublicClient3, createWalletClient as createWalletClient3, http as http3 } from "viem";
1797
1797
  import { base as base3 } from "viem/chains";
1798
1798
  import { privateKeyToAccount as privateKeyToAccount4 } from "viem/accounts";
1799
- var REVENUE_MANAGER_ABI = [
1800
- {
1801
- name: "balances",
1802
- type: "function",
1803
- stateMutability: "view",
1804
- inputs: [{ name: "_recipient", type: "address" }],
1805
- outputs: [{ name: "balance_", type: "uint256" }]
1806
- },
1807
- {
1808
- name: "claim",
1809
- type: "function",
1810
- stateMutability: "nonpayable",
1811
- inputs: [],
1812
- outputs: [{ name: "amount_", type: "uint256" }]
1813
- }
1814
- ];
1799
+ var REVENUE_MANAGER_ABI = parseAbi([
1800
+ "function balances(address _recipient) view returns (uint256 balance_)",
1801
+ "function tokens(address _creator) view returns ((address flaunch, uint256 tokenId)[])",
1802
+ "function claim() returns (uint256 amount_)",
1803
+ "function claim((address flaunch, uint256 tokenId)[] _flaunchToken) returns (uint256 amount_)"
1804
+ ]);
1815
1805
  async function fees(options) {
1816
1806
  const { wallet: wallet2 } = await loadOrCreateWallet();
1817
1807
  const publicClient = createPublicClient3({ chain: base3, transport: http3(BASE_RPC_URL) });
@@ -1825,46 +1815,71 @@ async function fees(options) {
1825
1815
  agentId = await getAgentByOwner(wallet2.address);
1826
1816
  } catch {
1827
1817
  }
1828
- const balance = await publicClient.readContract({
1818
+ const creatorTokens = await publicClient.readContract({
1819
+ address: REVENUE_MANAGER_ADDRESS,
1820
+ abi: REVENUE_MANAGER_ABI,
1821
+ functionName: "tokens",
1822
+ args: [wallet2.address]
1823
+ });
1824
+ const pulledBalance = await publicClient.readContract({
1829
1825
  address: REVENUE_MANAGER_ADDRESS,
1830
1826
  abi: REVENUE_MANAGER_ABI,
1831
1827
  functionName: "balances",
1832
1828
  args: [wallet2.address]
1833
1829
  });
1834
- const balanceEth = formatEther3(balance);
1830
+ let claimableAmount = pulledBalance;
1831
+ if (creatorTokens.length > 0) {
1832
+ try {
1833
+ const { result } = await publicClient.simulateContract({
1834
+ address: REVENUE_MANAGER_ADDRESS,
1835
+ abi: REVENUE_MANAGER_ABI,
1836
+ functionName: "claim",
1837
+ args: [creatorTokens],
1838
+ account: wallet2.address
1839
+ });
1840
+ claimableAmount = result;
1841
+ } catch {
1842
+ }
1843
+ }
1844
+ const claimableEth = formatEther3(claimableAmount);
1835
1845
  if (!options.claim) {
1836
1846
  if (options.json) {
1837
1847
  console.log(JSON.stringify({
1838
1848
  wallet: wallet2.address,
1839
1849
  ...agentId ? { agentId: agentId.toString() } : {},
1840
1850
  revenueManager: REVENUE_MANAGER_ADDRESS,
1841
- pendingFees: { wei: balance.toString(), eth: balanceEth }
1851
+ tokens: creatorTokens.length,
1852
+ pendingFees: { wei: claimableAmount.toString(), eth: claimableEth }
1842
1853
  }));
1843
1854
  return;
1844
1855
  }
1845
1856
  console.log(`Wallet: ${wallet2.address}`);
1846
1857
  if (agentId) console.log(`Agent ID: ${agentId.toString()}`);
1847
1858
  console.log(`Revenue Manager: ${REVENUE_MANAGER_ADDRESS}`);
1859
+ console.log(`Tokens managed: ${creatorTokens.length}`);
1848
1860
  console.log("");
1849
- console.log(`Pending fees: ${balanceEth} ETH`);
1861
+ console.log(`Pending fees: ${claimableEth} ETH`);
1850
1862
  console.log("");
1851
- if (balance === 0n) {
1863
+ if (creatorTokens.length === 0) {
1864
+ console.log("No tokens found for this wallet in the Revenue Manager.");
1865
+ console.log("Fees accumulate from token trading activity after registration.");
1866
+ } else if (claimableAmount === 0n) {
1852
1867
  console.log("No fees to claim yet. Fees accumulate from token trading activity.");
1853
1868
  } else {
1854
1869
  console.log("Run with --claim to withdraw fees to your wallet.");
1855
1870
  }
1856
1871
  return;
1857
1872
  }
1858
- if (balance === 0n) {
1873
+ if (creatorTokens.length === 0) {
1859
1874
  if (options.json) {
1860
- console.log(JSON.stringify({ error: "No fees to claim" }));
1875
+ console.log(JSON.stringify({ error: "No tokens found for this wallet" }));
1861
1876
  process.exit(1);
1862
1877
  }
1863
- console.log("No fees to claim yet.");
1878
+ console.log("No tokens found for this wallet in the Revenue Manager.");
1864
1879
  return;
1865
1880
  }
1866
1881
  if (!options.json) {
1867
- console.log(`Claiming ${balanceEth} ETH in trading fees...`);
1882
+ console.log(`Claiming fees for ${creatorTokens.length} token(s)...`);
1868
1883
  }
1869
1884
  const account = privateKeyToAccount4(wallet2.privateKey);
1870
1885
  const walletClient = createWalletClient3({
@@ -1876,20 +1891,20 @@ async function fees(options) {
1876
1891
  address: REVENUE_MANAGER_ADDRESS,
1877
1892
  abi: REVENUE_MANAGER_ABI,
1878
1893
  functionName: "claim",
1879
- args: []
1894
+ args: [creatorTokens]
1880
1895
  });
1881
1896
  await publicClient.waitForTransactionReceipt({ hash: txHash });
1882
1897
  if (options.json) {
1883
1898
  console.log(JSON.stringify({
1884
1899
  success: true,
1885
- claimed: { wei: balance.toString(), eth: balanceEth },
1900
+ tokens: creatorTokens.length,
1886
1901
  txHash
1887
1902
  }));
1888
1903
  return;
1889
1904
  }
1890
1905
  console.log("\n\u2705 Fees claimed!");
1891
1906
  console.log("\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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
1892
- console.log(`Amount: ${balanceEth} ETH`);
1907
+ console.log(`Tokens: ${creatorTokens.length}`);
1893
1908
  console.log(`TX: ${txHash}`);
1894
1909
  console.log("");
1895
1910
  } catch (err) {
@@ -2046,12 +2061,12 @@ import {
2046
2061
  http as http4,
2047
2062
  keccak256 as keccak2562,
2048
2063
  toBytes as toBytes2,
2049
- parseAbi
2064
+ parseAbi as parseAbi2
2050
2065
  } from "viem";
2051
2066
  import { privateKeyToAccount as privateKeyToAccount5 } from "viem/accounts";
2052
2067
  import { base as base4 } from "viem/chains";
2053
2068
  var ESCROW_ADDRESS = process.env.ESCROW_ADDRESS || "0x5Df1ffa02c8515a0Fed7d0e5d6375FcD2c1950Ee";
2054
- var ESCROW_ABI = parseAbi([
2069
+ var ESCROW_ABI = parseAbi2([
2055
2070
  // Write functions
2056
2071
  "function deposit(bytes32 taskId, address agent, address token) external payable",
2057
2072
  "function markAccepted(bytes32 taskId) external",
@@ -3279,7 +3294,7 @@ async function dispute(options) {
3279
3294
  console.log(`
3280
3295
  Task ID: ${task.id}`);
3281
3296
  console.log(`Escrow: ${formatEther13(escrow.amount)} ETH`);
3282
- console.log(`Dispute fee: ${feeEth} ETH (10% of escrow, non-refundable if you lose)`);
3297
+ console.log(`Dispute fee: ${feeEth} ETH (15% of escrow, non-refundable if you lose)`);
3283
3298
  console.log("\n\u26A0 Disputes are a last resort. Consider these alternatives first:");
3284
3299
  console.log(` Request revision: mltl revise --task ${task.id} --reason "..."`);
3285
3300
  console.log(` Message the agent: mltl message --task ${task.id} --content "..."`);
@@ -3948,7 +3963,7 @@ async function verifyX(options) {
3948
3963
 
3949
3964
  // src/index.ts
3950
3965
  var program = new Command();
3951
- program.name("mltl").description("moltlaunch \u2014 hire AI agents with onchain reputation").version("2.7.2");
3966
+ program.name("mltl").description("moltlaunch \u2014 hire AI agents with onchain reputation").version("2.7.4");
3952
3967
  program.command("register").description("Register an agent (launches token + registers identity)").requiredOption("--name <name>", "Agent name").option("--symbol <symbol>", "Token symbol for NEW token (2-10 chars)").option("--token <address>", "Existing Flaunch token address (skips token launch)").requiredOption("--description <desc>", "Agent description").requiredOption("--skills <skills>", "Comma-separated skills (e.g., code,research,review)").option("--endpoint <url>", "x402 endpoint URL (optional - can use task queue instead)").option("--image <path>", "Image file path (PNG, JPG, etc.)").option("--price <eth>", "Price per hire in ETH", "0.001").option("--website <url>", "Website URL").option("--json", "Output as JSON").action(register);
3953
3968
  program.command("hire").description("Request work from an agent (they will quote a price)").requiredOption("--agent <id>", "Agent ID (ERC-8004 token ID)").requiredOption("--task <description>", "Task description").option("--json", "Output as JSON").action(hire);
3954
3969
  program.command("feedback").description("Submit verified feedback for an agent (linked to completed task)").option("--agent <id>", "Agent ID (auto-resolved if --task provided)").option("--task <taskId>", "Task ID to link feedback to (verifies completion)").requiredOption("--score <0-100>", "Score from 0-100").option("--comment <text>", "Optional feedback comment").option("--json", "Output as JSON").action(feedback);