@usdctofiat/offramp 2.0.4 → 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,90 @@ 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
+
10
94
  ## [2.0.4] - 2026-04-25
11
95
 
12
96
  ### Docs
@@ -279,6 +363,7 @@ If you were on `@usdctofiat/offramp@1.x`:
279
363
  - Dual CJS/ESM build via tsup with type definitions for both entry points.
280
364
 
281
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
282
367
  [2.0.4]: https://github.com/ADWilkinson/galleonlabs-zkp2p/releases/tag/offramp-sdk-v2.0.4
283
368
  [2.0.3]: https://github.com/ADWilkinson/galleonlabs-zkp2p/releases/tag/offramp-sdk-v2.0.3
284
369
  [2.0.2]: https://github.com/ADWilkinson/galleonlabs-zkp2p/releases/tag/offramp-sdk-v2.0.2
package/README.md CHANGED
@@ -217,7 +217,7 @@ Every deposit is automatically delegated to the Delegate vault for oracle-based
217
217
 
218
218
  ## Webhooks
219
219
 
220
- 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).
221
221
 
222
222
  ## Links
223
223
 
@@ -1,6 +1,6 @@
1
1
  // src/config.ts
2
2
  import { getContracts, getGatingServiceAddress } from "@zkp2p/sdk";
3
- var SDK_VERSION = "2.0.4";
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-EVC54JGM.js.map
1777
+ //# sourceMappingURL=chunk-J2CCUQZ4.js.map