Add Peer Cash action provider - #1438
Open
ADWilkinson wants to merge 2 commits into
Open
Conversation
🟡 Heimdall Review Status
|
ADWilkinson
force-pushed
the
feat/peer-cash-action-provider
branch
from
August 13, 2026 10:11
d5271e4 to
16ad580
Compare
ADWilkinson
force-pushed
the
feat/peer-cash-action-provider
branch
from
August 14, 2026 13:20
f3f5d01 to
e07535c
Compare
Author
|
Quality review update:
Current validation: 43 focused tests pass, plus TypeScript, ESLint, and Prettier. Both commits are GitHub-verified. The PR is mergeable; the remaining gates are maintainer review and the external StepSecurity check. |
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.
Description
Adds a Peer Cash action provider to the TypeScript AgentKit package.
What is Peer Cash
Peer Cash is our offramp SDK for the Peer P2P protocol (peer.xyz), live in production today. An agent's Base USDC becomes fiat in the user's payment app: Venmo, Revolut, Wise, Zelle and more. It is non-custodial: funds only ever sit in the user's wallet or the protocol escrow contract, and orders fill at the live Chainlink rate with zero spread. No API key is required.
What this PR adds
A
peerCashaction provider with eight actions:estimate: fiat amount for a USDC amount at the live oracle rate. It is an estimate, not a locked quote. The binding rate resolves when a buyer fills.capabilities: payout platforms and their currencies, payee format hints, amount bounds, optional 30 day fill stats.cashout: moves USDC into the escrow contract and creates the order. Handles the follow-up access policy transaction for Venmo, Cash App and PayPal automatically.order_status: lifecycle state by deposit id, with a plain language explanation and the allowed next actions.list_orders: orders owned by a wallet.withdraw: the single unwind verb. Partial with an amount, full close without. Expired buyer intents get pruned automatically.top_up: add USDC to a live order.configure_access_policy: recovery only. Used when a cashout created the deposit but the policy transaction failed, so the agent never doubles up a cash-out.Plus the provider README, 43 focused unit tests, the package README table entry, a changeset, and the
@zkp2p/cashdependency.Design notes
EvmWalletProvideris not guaranteed to expose (CDP server and smart wallets sign remotely). So the provider uses the SDK's unsigned prepare path and submits each returned transaction throughwalletProvider.sendTransactionin step order, waiting for each receipt. Every agentkit wallet provider works unchanged and signing never leaves your wallet abstraction.supportsNetworkis Base mainnet only. The preproduction and staging environments also settle on Base mainnet with separate contracts, so the gate holds for all three.@zkp2p/cashdeclares node >= 22, same as this repo's dev requirement. The unit tests mock the SDK, so the node 18/20 CI matrix is unaffected.examples/registerimporter that no longer exists in the tree. Anypnpm installreproduces that, and the check-package-lock job wants it committed.Config
No API keys required. The provider works with zero config.
How integrators earn
referralCodeis the six character code from the Peer mobile or web app. When set, every deposit carries ERC-8021 attribution (peer-ref-ABC123) and the code owner earns 50 bps each time an order fills. The mapping is permanent.referreris separate: analytics-only attribution, no revenue share.Tests
From
typescript/:pnpm install: lockfile stable, no diff after installpnpm run test(turbo, all packages): 11/11 tasks passFrom
typescript/agentkit:pnpm test: 61 suites, 900 tests pass on the initial integration revisionpnpm run lint: passpnpm run format:check: passpnpm run check: passpnpm run build: passLive read-only smoke test of the built provider against production (no wallet or keys needed):
The mutating actions (cashout, withdraw, top_up, configure_access_policy) are covered by unit tests against a mocked SDK and wallet provider, including transaction order, reverted steps and the access policy failure path.
Checklist
Links
SDK → https://www.npmjs.com/package/@zkp2p/cash
Docs → https://docs.peer.xyz/developer/peer-cash
Prompt → https://peer.xyz/cash-sdk
Builders Club → https://t.me/zk_p2p/167174
Support
Support is available through the Builders Club above or @AndrewWilkinson on X.