@usdctofiat/offramp 2.0.3 → 3.0.0

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/CHANGELOG.md CHANGED
@@ -7,6 +7,98 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [3.0.0] - 2026-05-07
11
+
12
+ ### ⚠ BREAKING CHANGES
13
+
14
+ The Peer browser extension upstream cut over to a prepared-calldata contract.
15
+ The host app now owns the fulfill broadcast instead of the extension. Anyone
16
+ driving `peerExtensionSdk` directly through the re-export must migrate.
17
+
18
+ - **`peerExtensionSdk.onramp(params)` is no longer fire-and-forget.** It now
19
+ takes a callback and yields prepared calldata for the host to broadcast:
20
+ `peerExtensionSdk.onramp(params, (prepared) => { /* sign & send */ })`. The
21
+ callback receives `{ status: "calldata_ready", intentHash, transaction: { to,
22
+ data, value, chainId } }` — broadcast it through your wallet client.
23
+ - **`peerExtensionSdk.onIntentFulfilled(callback)` was removed.** Subscriptions
24
+ no longer exist; the prepared-calldata callback above replaces them. Track
25
+ fulfillment off the `sendTransaction` resolution in your callback.
26
+ - **`intentHash` is required** in the `onramp` params (was optional). Pass the
27
+ hash returned by `signalIntent` upstream.
28
+ - **`PeerIntentFulfilledResult` / `PeerIntentFulfilledCallback` /
29
+ `PeerIntentFulfilledBridgeStatus` are gone** from `@zkp2p/sdk`. Anyone
30
+ importing them directly will hit a missing-name error. Switch to
31
+ `PeerOnrampPreparedTransactionResult` / `PeerOnrampPreparedTransactionCallback`
32
+ (now re-exported from this package).
33
+
34
+ ### Added
35
+
36
+ - **`peerExtensionSdk.getOnrampTransaction(intentHash)`** pull-recovery path
37
+ for prepared calldata when the callback was missed (page reload, tab close,
38
+ extension restart). Returns the same `calldata_ready` shape or `null` if
39
+ nothing is pending. Wire it into your active-intent resume flow.
40
+ - **New type re-exports** from `@zkp2p/sdk`: `PeerOnrampPreparedTransactionCallback`,
41
+ `PeerOnrampPreparedTransactionResult`, `PeerExtensionOnrampParams`. Available
42
+ from both the core entry and via `extension.ts`.
43
+
44
+ ### Migration
45
+
46
+ ```ts
47
+ // Before (2.x)
48
+ peerExtensionSdk.onramp({
49
+ intentHash,
50
+ paymentPlatform: "wise",
51
+ inputAmount: "100",
52
+ amountUsdc: "100000000",
53
+ recipientAddress,
54
+ referrer: "myapp",
55
+ });
56
+ const unsubscribe = peerExtensionSdk.onIntentFulfilled((result) => {
57
+ if (result.status === "fulfilled") {
58
+ handleFulfilled(result.fulfillTxHash);
59
+ }
60
+ });
61
+
62
+ // After (3.x)
63
+ peerExtensionSdk.onramp(
64
+ {
65
+ intentHash, // now REQUIRED
66
+ paymentPlatform: "wise",
67
+ inputAmount: "100",
68
+ amountUsdc: "100000000",
69
+ recipientAddress,
70
+ referrer: "myapp",
71
+ },
72
+ async (prepared) => {
73
+ const fulfillTxHash = await walletClient.sendTransaction({
74
+ to: prepared.transaction.to,
75
+ data: prepared.transaction.data,
76
+ value: BigInt(prepared.transaction.value || "0"),
77
+ chainId: prepared.transaction.chainId,
78
+ });
79
+ handleFulfilled(fulfillTxHash);
80
+ },
81
+ );
82
+
83
+ // Optional: pull-recovery on page mount when an active intent exists
84
+ const prepared = await peerExtensionSdk.getOnrampTransaction(intentHash);
85
+ if (prepared?.status === "calldata_ready") {
86
+ // broadcast as above
87
+ }
88
+ ```
89
+
90
+ ### Changed
91
+
92
+ - Bump `@zkp2p/sdk` to `0.4.0-rc.4`.
93
+
94
+ ## [2.0.4] - 2026-04-25
95
+
96
+ ### Docs
97
+
98
+ - Lead the agent bundle with the developer portal (`https://usdctofiat.xyz/developers`) so human integrators landing on npm have a one-click path to the polished docs surface, then drop into skills and `llms-full.txt`.
99
+ - Call out the symmetric Peerlytics relationship: one Peerlytics API key authenticates outbound webhooks here and the paid Peerlytics v1 API.
100
+ - Bump `SDK_VERSION` to track package version (enforced by `scripts/check-version.mjs`).
101
+
10
102
  ## [2.0.3] - 2026-04-25
11
103
 
12
104
  ### Docs
@@ -271,6 +363,9 @@ If you were on `@usdctofiat/offramp@1.x`:
271
363
  - Dual CJS/ESM build via tsup with type definitions for both entry points.
272
364
 
273
365
  [Unreleased]: https://github.com/ADWilkinson/galleonlabs-zkp2p/compare/main...HEAD
366
+ [3.0.0]: https://github.com/ADWilkinson/galleonlabs-zkp2p/releases/tag/offramp-sdk-v3.0.0
367
+ [2.0.4]: https://github.com/ADWilkinson/galleonlabs-zkp2p/releases/tag/offramp-sdk-v2.0.4
368
+ [2.0.3]: https://github.com/ADWilkinson/galleonlabs-zkp2p/releases/tag/offramp-sdk-v2.0.3
274
369
  [2.0.2]: https://github.com/ADWilkinson/galleonlabs-zkp2p/releases/tag/offramp-sdk-v2.0.2
275
370
  [2.0.1]: https://github.com/ADWilkinson/galleonlabs-zkp2p/releases/tag/offramp-sdk-v2.0.1
276
371
  [2.0.0]: https://github.com/ADWilkinson/galleonlabs-zkp2p/releases/tag/offramp-sdk-v2.0.0
package/README.md CHANGED
@@ -9,12 +9,13 @@ USDC-to-fiat offramp SDK for Base. 6 functions + 2 const objects.
9
9
 
10
10
  If you are integrating through an agent (Claude Code, Cursor, etc.), start here:
11
11
 
12
+ - Developer portal: <https://usdctofiat.xyz/developers>
12
13
  - Drop-in skill: <https://usdctofiat.xyz/skills/usdctofiat.md>
13
14
  - Short machine reference: <https://usdctofiat.xyz/llms.txt>
14
15
  - Full machine reference: <https://usdctofiat.xyz/llms-full.txt>
15
16
  - Scaffold CLI: `npx create-offramp-app@latest my-app --template=next|vite|telegram-bot`
16
- - Starters (Next.js / Vite / Telegram bot): <https://github.com/ADWilkinson/usdctofiat-peerlytics-starters>
17
- - Companion SDK for analytics + explorer: [`@peerlytics/sdk`](https://www.npmjs.com/package/@peerlytics/sdk)
17
+ - Starters (Next.js / Vite / Telegram bot, plus runnable example scripts and HMAC verifiers): <https://github.com/ADWilkinson/usdctofiat-peerlytics-starters>
18
+ - Companion SDK for analytics + explorer: [`@peerlytics/sdk`](https://www.npmjs.com/package/@peerlytics/sdk) (one Peerlytics API key authenticates both products)
18
19
 
19
20
  ## Install
20
21
 
@@ -216,7 +217,7 @@ Every deposit is automatically delegated to the Delegate vault for oracle-based
216
217
 
217
218
  ## Webhooks
218
219
 
219
- Subscribe to `deposit.created`, `deposit.filled`, `deposit.partially_filled`, `deposit.closed`, `otc.enabled`, `otc.disabled`, and `otc.taken` events for your attributed deposits. Register endpoints at [usdctofiat.xyz/developers](https://usdctofiat.xyz/developers) with your Peerlytics API key. HMAC-SHA256 signed deliveries use the `X-Usdctofiat-Signature: t=<unix>,v1=<hex>` header. Reference HMAC receiver in the [starters repo](https://github.com/ADWilkinson/usdctofiat-peerlytics-starters).
220
+ Subscribe to live `deposit.created`, `deposit.filled`, `deposit.partially_filled`, `deposit.closed`, and `otc.taken` events for your attributed deposits. `otc.enabled` and `otc.disabled` are reserved event names. Register endpoints at [usdctofiat.xyz/developers](https://usdctofiat.xyz/developers) with your Peerlytics API key. HMAC-SHA256 signed deliveries use the `X-Usdctofiat-Signature: t=<unix>,v1=<hex>` header. Reference HMAC receiver in the [starters repo](https://github.com/ADWilkinson/usdctofiat-peerlytics-starters).
220
221
 
221
222
  ## Links
222
223
 
@@ -1,6 +1,6 @@
1
1
  // src/config.ts
2
2
  import { getContracts, getGatingServiceAddress } from "@zkp2p/sdk";
3
- var SDK_VERSION = "2.0.3";
3
+ var SDK_VERSION = "3.0.0";
4
4
  var BASE_CHAIN_ID = 8453;
5
5
  var RUNTIME_ENV = "production";
6
6
  var API_BASE_URL = "https://api.zkp2p.xyz";
@@ -1774,4 +1774,4 @@ export {
1774
1774
  openPeerExtensionInstallPage,
1775
1775
  getPeerExtensionState
1776
1776
  };
1777
- //# sourceMappingURL=chunk-ZWQVMPSH.js.map
1777
+ //# sourceMappingURL=chunk-J2CCUQZ4.js.map