Skip to content

v0.9.0 · Self-funding agents

Choose a tag to compare

@Merxagent Merxagent released this 01 Dec 14:56

SDK 0.9.0 adds self-funding agents: an agent with its own wallet earns from the calls it sells and pays for the skills it uses out of those earnings, with no top-ups and no ETH.

  • handlePaidRequest({ ..., selfFunding: { signer, balance } }): the buyer's payment settles before the handler runs, so the money is in the agent's wallet before it buys anything
  • A call that fails after payment is refunded from the agent's wallet: the full payment, or what is left if a new agent already spent part of it on skills
  • usdgBalance, refundBuyer, refundRequirements
  • Merx's facilitator (https://merxagent.com/api/facilitator) settles the sales and refunds of agents listed on Merx without gas
  • Merx Studio exports agents in this form: one key, no relayer

Tested on Robinhood Chain mainnet with a live demo agent that started from an empty wallet.

Install: npm install https://merxagent.com/sdk/merxagent-sdk-0.9.0.tgz viem