@zkp2p/sdk 0.14.6 → 0.14.7

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/README.md CHANGED
@@ -35,14 +35,15 @@ and chargeback-risk surface. The workspace version lives in `package.json`.
35
35
 
36
36
  ## Optional Venmo Gmail connection
37
37
 
38
- For partner cash-out integrations, prefer stable `@zkp2p/cash@0.6.2` and its
38
+ For partner cash-out integrations, prefer stable `@zkp2p/cash@0.7.2` and its
39
39
  [prepare/open/status flow](https://docs.peer.xyz/developer/peer-cash/guide#optional-venmo-receipt-linking).
40
40
  It selects the matching environment and keeps linking separate from cash-out.
41
41
  The direct SDK helpers below require `@zkp2p/sdk@0.14.2` or later.
42
42
 
43
43
  Open Peer's **Link your Venmo** popup for an already-registered account.
44
- The host passes the selected account hash; the user selects Connect Gmail or
45
- Connect Outlook, then chooses their receipt inbox with that provider.
44
+ The host passes the selected account hash; the user picks Gmail or Outlook,
45
+ which opens that provider's consent, or iCloud Mail, which takes an Apple
46
+ app-specific password on the Peer page.
46
47
 
47
48
  ```ts
48
49
  import { openVenmoGmailConnect, VenmoGmailConnectError } from '@zkp2p/sdk';
@@ -54,8 +55,8 @@ try {
54
55
  } catch (error) {
55
56
  if (error instanceof VenmoGmailConnectError) {
56
57
  // Preserve error.code for host UI handling and display error.message.
57
- // Missing receipts: venmo_google_oauth_receipt_not_found or
58
- // VENMO_MICROSOFT_OAUTH_RECEIPT_NOT_FOUND.
58
+ // Missing receipts: venmo_google_oauth_receipt_not_found,
59
+ // VENMO_MICROSOFT_OAUTH_RECEIPT_NOT_FOUND or icloud_receipt_not_found.
59
60
  }
60
61
  }
61
62
  ```
@@ -67,9 +68,9 @@ Mobile widths request a normal browser tab; desktop requests a popup. The SDK
67
68
  also reports blocked popups, closure, and a ten-minute timeout. Browser
68
69
  opener isolation or a lost response can interrupt notification; reconcile with
69
70
  `client.getSellerCredentialStatus()` or `apiGetSellerCredentialStatus()` before
70
- retrying. Only `active` with `credentialType` `'google_oauth'` or
71
- `'microsoft_oauth'` means an inbox is linked. An already-linked inbox needs no
72
- reconnect. Linking is optional and never gates deposits.
71
+ retrying. Only `active` with a mailbox `credentialType`
72
+ (`isMailboxSellerCredentialType`, 0.14.7+: Gmail, Outlook or iCloud Mail) means
73
+ an inbox is linked. An already-linked inbox needs no reconnect. Linking is optional and never gates deposits.
73
74
 
74
75
  Use matching Peer/Curator environments and configure Curator CORS for your host.
75
76
  `peerOrigin` accepts HTTPS origins or HTTP localhost for development; Google must
@@ -105,8 +106,8 @@ before navigating to `returnUrl` unchanged. No OAuth codes, tokens, email,
105
106
  account hash, or success flag are appended. If automatic navigation is blocked,
106
107
  select **Return to your app**. Consent or verification errors stay visible and
107
108
  also offer a manual return. A return, dismissal, or cancellation is not proof of
108
- linking: only an active `google_oauth` or `microsoft_oauth` credential from the
109
- status API is linked.
109
+ linking: only an active mailbox credential (`isMailboxSellerCredentialType`)
110
+ from the status API is linked.
110
111
 
111
112
  Apps that need no SDK can build the same URL themselves:
112
113
  `https://app.peer.xyz/connect/venmo?returnUrl=<URL-encoded-callback>#<payeeDetails>`.
@@ -550,7 +551,7 @@ For table-style liquidity UIs, the low-level `apiGetOrderbookTable()` adapter ex
550
551
 
551
552
  ## Seller Credential Status
552
553
 
553
- Venmo and PayPal Seller Autopilot connections use `uploadGoogleOAuthSellerCredential` for Gmail or `uploadMicrosoftOAuthSellerCredential` for personal Outlook accounts. The normal `uploadSellerCredential` and extension seller-capture paths support Cash App, Wise (token upload only), and Amazon Pay UPI. Existing backend Venmo cookie bundles remain usable through status/verification and low-level encrypted-bundle APIs.
554
+ Venmo and PayPal Seller Autopilot connections use `uploadGoogleOAuthSellerCredential` for Gmail, `uploadMicrosoftOAuthSellerCredential` for personal Outlook accounts, or `uploadICloudMailSellerCredential` for iCloud Mail. The normal `uploadSellerCredential` and extension seller-capture paths support Cash App, Wise (token upload only), and Amazon Pay UPI. Existing backend Venmo cookie bundles remain usable through status/verification and low-level encrypted-bundle APIs.
554
555
 
555
556
  ```ts
556
557
  await client.uploadGoogleOAuthSellerCredential({
@@ -576,6 +577,19 @@ await client.uploadMicrosoftOAuthSellerCredential({
576
577
 
577
578
  Validate OAuth state in the initiating browser tab before uploading. `redirectUri` must exactly match the one in the authorization request. Both methods exchange a one-time code without retrying; start fresh consent if the response is lost. The Microsoft client secret stays server-side. See [email connection setup](../../docs/email-oauth.md).
578
579
 
580
+ iCloud Mail has no OAuth. Pass the seller's Apple app-specific password with the registered maker hash; PayPal also passes its receiving email. For Venmo, the SDK fetches the maker's account ID from Curator (`GET /v2/makers/venmo/{payeeDetails}/payee-id`) and checks it against `payeeDetails` before any mailbox work, so sellers never enter it.
581
+
582
+ ```ts
583
+ await client.uploadICloudMailSellerCredential({
584
+ platform: 'venmo',
585
+ payeeDetails: registeredMaker.hashedOnchainId,
586
+ mailboxEmail: 'seller@icloud.com',
587
+ appSpecificPassword,
588
+ });
589
+ ```
590
+
591
+ The password is encrypted to the attested enclave and posted directly to the attestor paired with `baseApiUrl`. The returned bundle is verified against the pinned enclave signer, platform and maker before it is stored unchanged; the maker is not re-registered. React Native callers pass `{ attestationRuntime: { subtle, getRandomValues } }`. Failures reject with `ICloudMailCredentialError`, whose `reason` names the condition (`payee_mismatch`, `payee_not_found`, `receipt_not_found`, `app_password_rejected`, `rate_limited` with `retryAfterMs`, and so on). The method never retries; one connection per mailbox runs at a time. `isMailboxSellerCredentialType` recognizes Gmail, Outlook and iCloud Mail credentials.
592
+
579
593
  ```ts
580
594
  const status = await client.getSellerCredentialStatus({
581
595
  processorName: 'venmo',
@@ -2,11 +2,11 @@
2
2
  "schemaVersion": 2,
3
3
  "source": {
4
4
  "repository": "zkp2p/zkp2p-clients",
5
- "commitSha": "fd02009b2fcfda2e4ee8decaa6bd572181ffdb4a",
5
+ "commitSha": "b2eb8395983f34f42ecbfecda99efa0fe3fba75a",
6
6
  "kind": "github",
7
7
  "distributable": true
8
8
  },
9
- "sdkPackageVersion": "0.14.6",
9
+ "sdkPackageVersion": "0.14.7",
10
10
  "contractsPackageVersion": "0.4.4-rc.2",
11
11
  "indexerSchemaPackageVersion": "0.22.0",
12
12
  "activeDisputeStack": {
@@ -1,5 +1,5 @@
1
1
  import { currencyKeccak256, getCurrencyInfoFromHash } from './chunk-WDEEWFEU.mjs';
2
- import { __export } from './chunk-BBPE3X6U.mjs';
2
+ import { __export } from './chunk-SWQCAVQR.mjs';
3
3
  import { hexToBytes, keccak256, toBytes, bytesToHex } from 'viem';
4
4
 
5
5
  // src/utils/bigint.ts
@@ -100446,5 +100446,5 @@ function enrichPvIntentView(view, chainId, env = "production") {
100446
100446
  }
100447
100447
 
100448
100448
  export { DISPUTE_PROTECTION_POLICY_ABI, DISPUTE_PROTECTION_POLICY_ABI2, DisputeNullifierRegistry_default3 as DisputeNullifierRegistry_default, DisputeProtectionPolicy_default3 as DisputeProtectionPolicy_default, DisputeVerifier_default3 as DisputeVerifier_default, IntentLifecycleHookV1_default3 as IntentLifecycleHookV1_default, METHOD_NAME_TO_HASH, MultiAttestationVerifier_default3 as MultiAttestationVerifier_default, ORCHESTRATOR_V3_ABI2 as ORCHESTRATOR_V3_ABI, OrchestratorRegistry_default3 as OrchestratorRegistry_default, OrchestratorV3_default3 as OrchestratorV3_default, PAYMENT_PLATFORMS, STAKE_VAULT_ABI2 as STAKE_VAULT_ABI, SUPPORTED_PAYMENT_METHOD_HASHES, StakeVault_default3 as StakeVault_default, WhitelistPolicy_default3 as WhitelistPolicy_default, asciiToBytes32, enrichPvDepositView, enrichPvIntentView, ensureBytes32, getContracts, getDisputeProtectionPolicyContract, getGatingServiceAddress, getIntentGuardianContract, getOrchestratorV3Contract, getPaymentMethodsCatalog, getRateManagerContracts, getStakeVaultContract, hasIntentGuardian, matchesPaymentMethodNameAndHash, matchesQuotePaymentMethod, parseBigIntLike, parseDepositView, parseIntentView, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash };
100449
- //# sourceMappingURL=chunk-PT56GEQ4.mjs.map
100450
- //# sourceMappingURL=chunk-PT56GEQ4.mjs.map
100449
+ //# sourceMappingURL=chunk-ANDZNB7X.mjs.map
100450
+ //# sourceMappingURL=chunk-ANDZNB7X.mjs.map