@zkp2p/cash 0.4.0 → 0.4.1

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/AGENTS.md CHANGED
@@ -205,6 +205,7 @@ Every `CashError` carries `code`, `retryable`, `remediation`. Behavior:
205
205
  | `AMOUNT_BELOW_MINIMUM` | no | Raise amount (hard floor $0.01, recommended at least 1 USDC) |
206
206
  | `INVALID_INTENT_AMOUNT_RANGE` | no | Use a positive min, max at least min, and max no greater than amount |
207
207
  | `INVALID_PAYOUT_CURRENCIES` | no | Pass one or more unique currencies listed for the platform |
208
+ | `INVALID_PAYOUT_PLATFORMS` | no | Pass one leg or an array of legs, using each platform at most once |
208
209
  | `PAYEE_VERIFICATION_REQUIRED` | no | Register a new Wise/PayPal payee through Peer; an existing registered handle can be reused |
209
210
  | `PAYEE_REGISTRATION_FAILED` | yes | Validate against `payeeHint`, then retry |
210
211
  | `SOURCE_ROUTE_UNSUPPORTED_IN_PREPARE` | no | Execute Relay with a signer first, then prepare a Base-USDC cashout |
package/dist/tools.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  // package.json
4
4
  var package_default = {
5
- version: "0.4.0"};
5
+ version: "0.4.1"};
6
6
 
7
7
  // src/tools/index.ts
8
8
  var bigintString = {
package/dist/tools.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // package.json
2
2
  var package_default = {
3
- version: "0.4.0"};
3
+ version: "0.4.1"};
4
4
 
5
5
  // src/tools/index.ts
6
6
  var bigintString = {
@@ -197,7 +197,9 @@ receipts.
197
197
  Orders also carry their `payouts` legs reconstructed from the chain -
198
198
  platform, currency, payee hash, and a pricing proof (`spreadBps: 0`,
199
199
  `kind: 'oracle_chainlink'`, `marketRate: true`): the zero-spread claim is a
200
- queryable fact, not marketing copy.
200
+ queryable fact, not marketing copy. An order created with several payout
201
+ platforms (`receive` as an array of legs) surfaces one entry per
202
+ platform-currency pair, every one of them at the zero-spread oracle rate.
201
203
 
202
204
  Reconstruction is fail-closed: every payment method on the indexed deposit
203
205
  must resolve through the active SDK catalog, and the result must be exactly
@@ -286,6 +288,7 @@ explicit override.
286
288
  | `AMOUNT_BELOW_MINIMUM` | no | Amount is below the $0.01 hard floor. The recommended minimum is 1 USDC. |
287
289
  | `INVALID_INTENT_AMOUNT_RANGE` | no | Min/max is non-positive, inverted, or exceeds the deposit. Correct the range. |
288
290
  | `INVALID_PAYOUT_CURRENCIES` | no | The currency set is empty or contains duplicates. Pass a non-empty unique set from `capabilities()`. |
291
+ | `INVALID_PAYOUT_PLATFORMS` | no | The payout leg set is empty or repeats a platform. Pass one leg, or an array of legs using each platform at most once. |
289
292
  | `PAYEE_VERIFICATION_REQUIRED` | no | A new Wise/PayPal payee needs an attestation. Register it through Peer first; an existing registration can be reused. |
290
293
  | `PAYEE_REGISTRATION_FAILED` | yes | Curator rejected the handle or was unavailable. Check `payeeHint` and retry. |
291
294
  | `SOURCE_ROUTE_UNSUPPORTED_IN_PREPARE` | no | `prepare()` accepts Base USDC only. Use signed source execution, or complete Relay first and then prepare the Base cashout. |
@@ -23,6 +23,8 @@ import type { CurrencyType } from '@zkp2p/cash';
23
23
  const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
24
24
  const signer = createWalletClient({ account, chain: base, transport: http() });
25
25
 
26
+ // One leg here; `receive` also accepts an array of legs to offer several
27
+ // platforms on one order (each platform at most once, all at the oracle rate).
26
28
  const receive = {
27
29
  platform: process.env.CASH_PLATFORM ?? 'venmo',
28
30
  currency: (process.env.CASH_CURRENCY ?? 'USD') as CurrencyType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zkp2p/cash",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Peer Cash - offramp-only SDK for routing crypto to Base USDC, then cashing out to fiat at the live oracle market rate.",
5
5
  "license": "MIT",
6
6
  "author": "Peer (https://peer.xyz)",