Repository navigation
feat(mcp): run Peer Cash tools on @zkp2p/sdk peer.sell - #48
Merged
Merged
Conversation
The peer_cash_* MCP tools now call peer.sell from @zkp2p/sdk 0.16.0-rc.1. The SDK has no source routing, so the three Relay source tools keep a @zkp2p/cash client. peer_cash_prepare_access_policy and the capabilities includeRelaySources argument are removed. The SDK bump also adds Monobank to the active platform catalog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… amount, leave Monobank out - peer_cash_prepare_access_policy stays registered and runs on @zkp2p/cash next to the Relay source tools, so no agent loses a tool. The injectable client for those tools is cashOnlyClient (PeerCashOnlyClient). - peer intent release sends the releaseAmount @zkp2p/sdk 0.15+ requires: the full on-chain intent amount by default, or --amount in USDC. - Monobank stays out of the supported platforms: its only currency, UAH, has no oracle feed. The catalog alignment test names that exclusion. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ADWilkinson
marked this pull request as ready for review
November 23, 2026 12:48
ADWilkinson
approved these changes
Nov 23, 2026
ADWilkinson
left a comment
Collaborator
There was a problem hiding this comment.
Approved at 4182ffd on Davy's re-review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Created by @kohai-peer at the request of @ADWilkinson.
Summary
The
peer_cash_*MCP tools now run onpeer.sellfrom@zkp2p/sdk0.16.0-rc.1(exact pin, dist-tagrc). Before this PR they ran oncreateCashClient()from@zkp2p/cash0.7.0. Every tool name and the custody boundary are unchanged.src/mcp/cash.ts:createPeer(...).sell, and finalize now callsfinalizePrepared. The SDK client gets the same options as before: environment, rpcUrl, apiKey, referralCode and referrer.peer_cash_source_capabilities,peer_cash_quote_source,peer_cash_relay_statusandpeer_cash_prepare_access_policystay on@zkp2p/cash. They need Relay source routing or the access policy, and the SDK has neither. They use a separate client.@zkp2p/cashstays at0.7.0for these tools only.PeerCashMcpConfig.clientis now aPeerSell. A new optionalcashOnlyClient(PeerCashOnlyClient, exported) injects the client for the Cash-only tools.peer_cash_prepare_access_policyis kept unchanged on@zkp2p/cash, so no agent loses a tool. The README and skill still tell agents to skip that legacy step.includeRelaySourcesargument frompeer_cash_capabilities. The SDK'scapabilities()has nosource/destination. The same Relay data stays available throughpeer_cash_source_capabilities.cash14,full160). The regeneratedagents/runtime-manifest.jsonandagents/tool-catalog.jsondiffer from main only by the new--amountoption onintent release.package.json/package-lock.json:@zkp2p/sdk0.14.5becomes0.16.0-rc.1, regenerated withnpm install.@zkp2p/cash0.7.0keeps its own nested@zkp2p/sdk@0.14.5. Both are already bundled throughtsupnoExternal, sotsup.config.tsis unchanged.SUPPORTED_PLATFORMS: its only currency, UAH, has no oracle feed. SDK 0.16 lists it in the catalog, so the test that keeps the CLI aligned with the SDK catalog now names Monobank as a deliberate exclusion.peer intent release:releaseFundsToPayernow requiresreleaseAmount, which OrchestratorV4 releases exactly. The command sends the full on-chain intent amount by default (a depositor must release all of it), or--amountin USDC for an arbitrator's partial release. Two tests cover both paths.signalIntentgains the O4payerCommitmentandgroupIdfields with defaults, and the CLI never passed the removeddatafield.stake release-matured/release-matured-batch(releaseMaturedDisputeProtectionIntent(s)) now serve only the August dispute-protection policy. SDK 0.15 releases V2 deferred payouts withrelease({ intentHashes }), which the CLI does not expose yet.intent createneeds a Peer session for Curator's signature, which the CLI does not send. That has been true on 0.14.5 since Curator's identity gate, so it is not caused by this bump.README.md,llms.txt,skills/peer-cash/SKILL.md,AGENTS.mdand anUnreleasedCHANGELOG entry. The docs still describe the published 0.4.1, so the notes are scoped to "after 0.4.1". No version bump.Behavior differences users may notice
PAYEE_NOT_FOUND(retryable: false). Cash returnedPAYEE_REGISTRATION_FAILED(retryable: true).INVALID_DEPOSIT_ID, but the message now says "Peer sell deposit id".Verification
npm run check(lint,tsc --noEmit, vitest with coverage thresholds: 260 tests, then build): passes.registerPeerCashToolswith the real clients:peer_cash_capabilities,peer_cash_estimate(25 USDC, EUR/wise),peer_cash_fill_statsandpeer_cash_source_capabilities(through Cash) returned data.peer_cash_orderon an unknown deposit returned the structuredORDER_NOT_FOUNDerror.peer_cash_prepare, which registers a payee, andfinalize, withdraw and top-up plans. Those are covered by unit tests only.The generic CLI commands now also run on SDK 0.16.0-rc.1. They typecheck and pass the existing suite, but I did not check them live.
🤖 Generated with Claude Code