@zkp2p/sdk 0.14.5-rc.1 → 0.14.5

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
@@ -41,8 +41,8 @@ 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,
45
- then chooses their receipt inbox through Google.
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.
46
46
 
47
47
  ```ts
48
48
  import { openVenmoGmailConnect, VenmoGmailConnectError } from '@zkp2p/sdk';
@@ -54,19 +54,22 @@ try {
54
54
  } catch (error) {
55
55
  if (error instanceof VenmoGmailConnectError) {
56
56
  // Preserve error.code for host UI handling and display error.message.
57
- // Missing receipts: venmo_google_oauth_receipt_not_found.
57
+ // Missing receipts: venmo_google_oauth_receipt_not_found or
58
+ // VENMO_MICROSOFT_OAUTH_RECEIPT_NOT_FOUND.
58
59
  }
59
60
  }
60
61
  ```
61
62
 
62
- Google-hosted school and custom domains can attempt verification; no email
63
- suffix check runs. Missing receipts produce a recoverable verification error.
63
+ Google-hosted school and custom domains can attempt verification; Outlook
64
+ supports personal Microsoft accounts. No email suffix check runs. Missing
65
+ receipts produce a recoverable verification error.
64
66
  Mobile widths request a normal browser tab; desktop requests a popup. The SDK
65
67
  also reports blocked popups, closure, and a ten-minute timeout. Browser
66
68
  opener isolation or a lost response can interrupt notification; reconcile with
67
69
  `client.getSellerCredentialStatus()` or `apiGetSellerCredentialStatus()` before
68
- retrying. Only `active` with `credentialType: 'google_oauth'` means Gmail is linked.
69
- Already-active Gmail needs no reconnect. Linking is optional and never gates deposits.
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.
70
73
 
71
74
  Use matching Peer/Curator environments and configure Curator CORS for your host.
72
75
  `peerOrigin` accepts HTTPS origins or HTTP localhost for development; Google must
@@ -97,12 +100,13 @@ for testing your app's callback. See Expo's
97
100
  [`openAuthSessionAsync` documentation](https://docs.expo.dev/versions/latest/sdk/webbrowser/#webbrowseropenauthsessionasyncurl-redirecturl-options).
98
101
  The browser popup helper remains browser-only; native hosts use the URL builder.
99
102
 
100
- Peer keeps Google's OAuth callback on Peer and verifies the selected account
101
- before navigating to `returnUrl` unchanged. No Google codes, tokens, email,
103
+ Peer keeps the OAuth callback on Peer and verifies the selected account
104
+ before navigating to `returnUrl` unchanged. No OAuth codes, tokens, email,
102
105
  account hash, or success flag are appended. If automatic navigation is blocked,
103
106
  select **Return to your app**. Consent or verification errors stay visible and
104
107
  also offer a manual return. A return, dismissal, or cancellation is not proof of
105
- linking: only an active `google_oauth` credential from the status API is linked.
108
+ linking: only an active `google_oauth` or `microsoft_oauth` credential from the
109
+ status API is linked.
106
110
 
107
111
  Apps that need no SDK can build the same URL themselves:
108
112
  `https://app.peer.xyz/connect/venmo?returnUrl=<URL-encoded-callback>#<payeeDetails>`.
@@ -155,9 +159,9 @@ Choose contrasting text, button and focus colors.
155
159
 
156
160
  Popup width supports 320–1200 px and height 480–1600 px. Mobile still requests a
157
161
  regular tab, whose size and presentation are controlled by the browser. Branding
158
- and styles survive the existing Google callback; account binding, consent copy,
159
- receipt verification and error codes remain unchanged. Google controls its own
160
- consent page's appearance.
162
+ and styles survive the OAuth callback; account binding, consent copy,
163
+ receipt verification and error codes remain unchanged. Google and Microsoft
164
+ control their own consent pages' appearance.
161
165
 
162
166
  ## Installation
163
167
 
@@ -406,8 +410,17 @@ const activity = await client.indexer.getStakeActivity({
406
410
  limit: 50,
407
411
  });
408
412
 
413
+ // merchant is optional: omit it for the vault-wide activity feed.
414
+ // When supplied, it matches the event stake owner or taker.
409
415
  // Keep orderDirection unchanged when passing activity.nextCursor for older pages.
410
416
 
417
+ const totals = await client.indexer.getStakeTotals({
418
+ chainId: 8453,
419
+ vaultAddress: client.getStakeVaultContract().address,
420
+ });
421
+ // totals.totalStaked and totals.totalLocked are decimal strings in token base units.
422
+ // totals.stakerCount counts owners whose stake balance is greater than zero.
423
+
411
424
  const finalizedDisputes = await client.indexer.getDisputeProtectionIntents({
412
425
  chainId: 8453,
413
426
  policyAddress: client.getDisputeProtectionPolicyContract().address,
@@ -525,7 +538,7 @@ For table-style liquidity UIs, the low-level `apiGetOrderbookTable()` adapter ex
525
538
 
526
539
  ## Seller Credential Status
527
540
 
528
- Venmo and PayPal Seller Autopilot connections use `uploadGoogleOAuthSellerCredential`. 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.
541
+ 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.
529
542
 
530
543
  ```ts
531
544
  await client.uploadGoogleOAuthSellerCredential({
@@ -536,6 +549,21 @@ await client.uploadGoogleOAuthSellerCredential({
536
549
  });
537
550
  ```
538
551
 
552
+ Microsoft uses the same payment identity and adds the PKCE verifier from the authorization request:
553
+
554
+ ```ts
555
+ await client.uploadMicrosoftOAuthSellerCredential({
556
+ platform: 'paypal',
557
+ payeeDetails: registeredMaker.hashedOnchainId,
558
+ payeeEmail: 'seller@example.com',
559
+ authorizationCode,
560
+ redirectUri,
561
+ codeVerifier,
562
+ });
563
+ ```
564
+
565
+ 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).
566
+
539
567
  ```ts
540
568
  const status = await client.getSellerCredentialStatus({
541
569
  processorName: 'venmo',
@@ -2,12 +2,12 @@
2
2
  "schemaVersion": 2,
3
3
  "source": {
4
4
  "repository": "zkp2p/zkp2p-clients",
5
- "commitSha": "296778084b841cae5fd3f78a549d8aa58c609ce4",
5
+ "commitSha": "5261b0adcee018c238be2064ad2c06e8918cb309",
6
6
  "kind": "github",
7
7
  "distributable": true
8
8
  },
9
- "sdkPackageVersion": "0.14.5-rc.1",
10
- "contractsPackageVersion": "0.4.2",
9
+ "sdkPackageVersion": "0.14.5",
10
+ "contractsPackageVersion": "0.4.3",
11
11
  "indexerSchemaPackageVersion": "0.22.0",
12
12
  "activeDisputeStack": {
13
13
  "base": {
@@ -0,0 +1,12 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ // <define:__ZKP2P_SDK_BUILD_METADATA__>
8
+ var define_ZKP2P_SDK_BUILD_METADATA_default = { schemaVersion: 2, source: { repository: "zkp2p/zkp2p-clients", commitSha: "5261b0adcee018c238be2064ad2c06e8918cb309", kind: "github", distributable: true }, sdkPackageVersion: "0.14.5", contractsPackageVersion: "0.4.3", indexerSchemaPackageVersion: "0.22.0", activeDisputeStack: { base: { version: 2, selectionHash: "ba40c2954b408d0c658881a8d28e5bfcc9bade5cc3d953fd17eae1eca69d841c" }, baseStaging: { version: 2, selectionHash: "6c49c1ce51eec594a22385c4efcab08aa9926b6b63a725e14a0027ec5d2f4fc9" } } };
9
+
10
+ export { __export, define_ZKP2P_SDK_BUILD_METADATA_default };
11
+ //# sourceMappingURL=chunk-2K2ATNTY.mjs.map
12
+ //# sourceMappingURL=chunk-2K2ATNTY.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["%3Cdefine:__ZKP2P_SDK_BUILD_METADATA__%3E"],"names":[],"mappings":";;;;;;;AAAA,IAAA,uCAAA,GAAA,EAAC,aAAA,EAAgB,CAAA,EAAE,MAAA,EAAS,EAAC,YAAa,qBAAA,EAAsB,SAAA,EAAY,0CAAA,EAA2C,IAAA,EAAO,UAAS,aAAA,EAAgB,IAAA,EAAI,EAAE,iBAAA,EAAoB,UAAS,uBAAA,EAA0B,OAAA,EAAQ,2BAAA,EAA8B,QAAA,EAAS,oBAAqB,EAAC,IAAA,EAAO,EAAC,OAAA,EAAU,GAAE,aAAA,EAAgB,kEAAA,EAAkE,EAAE,WAAA,EAAc,EAAC,OAAA,EAAU,CAAA,EAAE,aAAA,EAAgB,kEAAA,IAAmE","file":"chunk-2K2ATNTY.mjs","sourcesContent":["{\"schemaVersion\":2,\"source\":{\"repository\":\"zkp2p/zkp2p-clients\",\"commitSha\":\"5261b0adcee018c238be2064ad2c06e8918cb309\",\"kind\":\"github\",\"distributable\":true},\"sdkPackageVersion\":\"0.14.5\",\"contractsPackageVersion\":\"0.4.3\",\"indexerSchemaPackageVersion\":\"0.22.0\",\"activeDisputeStack\":{\"base\":{\"version\":2,\"selectionHash\":\"ba40c2954b408d0c658881a8d28e5bfcc9bade5cc3d953fd17eae1eca69d841c\"},\"baseStaging\":{\"version\":2,\"selectionHash\":\"6c49c1ce51eec594a22385c4efcab08aa9926b6b63a725e14a0027ec5d2f4fc9\"}}}"]}