@zkp2p/cash 0.2.0 → 0.2.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 +19 -2
- package/README.md +44 -2
- package/dist/{chunk-TR6JVYYF.js → chunk-5VBP3IWK.js} +59 -2
- package/dist/{createCashClient-CTEXn9FF.d.cts → createCashClient-Clg5Fa1H.d.cts} +39 -12
- package/dist/{createCashClient-CTEXn9FF.d.ts → createCashClient-Clg5Fa1H.d.ts} +39 -12
- package/dist/index.cjs +209 -38
- package/dist/index.d.cts +16 -8
- package/dist/index.d.ts +16 -8
- package/dist/index.js +152 -40
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +1 -1
- package/dist/tools.cjs +26 -10
- package/dist/tools.d.cts +29 -10
- package/dist/tools.d.ts +29 -10
- package/dist/tools.js +26 -10
- package/docs/lifecycle-and-recovery.md +5 -1
- package/package.json +1 -1
package/dist/tools.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var package_default = {
|
|
3
|
-
version: "0.2.
|
|
3
|
+
version: "0.2.1"};
|
|
4
4
|
|
|
5
5
|
// src/tools/index.ts
|
|
6
6
|
var bigintString = {
|
|
@@ -135,20 +135,36 @@ var builtInCashTools = [
|
|
|
135
135
|
description: 'Platform id from cash_capabilities, e.g. "venmo"'
|
|
136
136
|
},
|
|
137
137
|
currency: { type: "string", description: 'Fiat currency code, e.g. "USD"' },
|
|
138
|
+
currencies: {
|
|
139
|
+
type: "array",
|
|
140
|
+
minItems: 1,
|
|
141
|
+
uniqueItems: true,
|
|
142
|
+
items: { type: "string" },
|
|
143
|
+
description: 'Fiat currency choices for one payment method, e.g. ["EUR", "GBP"]'
|
|
144
|
+
},
|
|
138
145
|
payee: {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
offchainId: {
|
|
146
|
+
description: "Raw payee handle or structured curator payee data",
|
|
147
|
+
oneOf: [
|
|
148
|
+
{
|
|
143
149
|
type: "string",
|
|
144
|
-
description: '
|
|
150
|
+
description: 'User-entered handle, e.g. "@andrew" for Venmo; Peer Cash normalizes it for the selected platform'
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
type: "object",
|
|
154
|
+
properties: {
|
|
155
|
+
offchainId: {
|
|
156
|
+
type: "string",
|
|
157
|
+
description: "Already-normalized handle for the platform"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
required: ["offchainId"],
|
|
161
|
+
additionalProperties: true
|
|
145
162
|
}
|
|
146
|
-
|
|
147
|
-
required: ["offchainId"],
|
|
148
|
-
additionalProperties: true
|
|
163
|
+
]
|
|
149
164
|
}
|
|
150
165
|
},
|
|
151
|
-
required: ["platform", "
|
|
166
|
+
required: ["platform", "payee"],
|
|
167
|
+
oneOf: [{ required: ["currency"] }, { required: ["currencies"] }],
|
|
152
168
|
additionalProperties: false
|
|
153
169
|
}
|
|
154
170
|
},
|
|
@@ -61,7 +61,9 @@ The unsigned `prepare()` path is Base-USDC-only and rejects `source` with
|
|
|
61
61
|
`SOURCE_ROUTE_UNSUPPORTED_IN_PREPARE`. The tool manifest follows the same
|
|
62
62
|
boundary: `cash_source_quote` and `cash_source_status` quote and observe Relay,
|
|
63
63
|
but the host or a signer-backed client must execute the route before
|
|
64
|
-
`cash_cashout` prepares the Base-USDC order.
|
|
64
|
+
`cash_cashout` prepares the Base-USDC order. Once the prepared `createDeposit`
|
|
65
|
+
transaction confirms, call `finalizePreparedCashout(receipt)` to decode it with
|
|
66
|
+
the environment-correct escrow ABI and obtain the resumable `CashoutResult`.
|
|
65
67
|
|
|
66
68
|
There is no static chain/token allowlist in Peer Cash. Relay decides source
|
|
67
69
|
support through its metadata and quote execution, filtered to the viem/EVM
|
|
@@ -281,6 +283,7 @@ explicit override.
|
|
|
281
283
|
| `UNSUPPORTED_PLATFORM_CURRENCY` | no | The platform does not support that currency. Use its `capabilities()` currencies. |
|
|
282
284
|
| `AMOUNT_BELOW_MINIMUM` | no | Amount is below the $0.01 hard floor. The recommended minimum is 1 USDC. |
|
|
283
285
|
| `INVALID_INTENT_AMOUNT_RANGE` | no | Min/max is non-positive, inverted, or exceeds the deposit. Correct the range. |
|
|
286
|
+
| `INVALID_PAYOUT_CURRENCIES` | no | The currency set is empty or contains duplicates. Pass a non-empty unique set from `capabilities()`. |
|
|
284
287
|
| `PAYEE_VERIFICATION_REQUIRED` | no | A new Wise/PayPal payee needs an attestation. Register it through Peer first; an existing registration can be reused. |
|
|
285
288
|
| `PAYEE_REGISTRATION_FAILED` | yes | Curator rejected the handle or was unavailable. Check `payeeHint` and retry. |
|
|
286
289
|
| `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. |
|
|
@@ -295,6 +298,7 @@ explicit override.
|
|
|
295
298
|
| `SOURCE_CASHOUT_STATUS_UNKNOWN` | no | Relay completed and the Base tx was submitted, but its receipt is unknown. Inspect `depositTxHash`; do not resubmit while status is unknown. |
|
|
296
299
|
| `INSUFFICIENT_TOKEN_BALANCE` | no | Wallet lacks the required token amount. Fund it, then retry. |
|
|
297
300
|
| `ALLOWANCE_NOT_VISIBLE` | yes | Approval mined but a stale RPC replica hid it. Retry the same call after the allowance becomes visible. |
|
|
301
|
+
| `TRANSACTION_REJECTED` | yes | The wallet request was cancelled before broadcast. Retry when ready. |
|
|
298
302
|
| `TRANSACTION_FAILED` | no | The on-chain call failed or reverted. Inspect the cause and transaction before another action. |
|
|
299
303
|
| `TRANSACTION_SUBMISSION_UNKNOWN` | no | A Base mutation returned no hash but may have broadcast. Inspect wallet/protocol state and its recovery action before any retry. |
|
|
300
304
|
| `TRANSACTION_STATUS_UNKNOWN` | no | A transaction was submitted but its receipt is unknown. Inspect `recovery.transactionHash` before resubmitting. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zkp2p/cash",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.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)",
|