@zkp2p/sdk 0.14.5-rc.2 → 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 +26 -13
- package/dist/build-metadata.json +3 -3
- package/dist/chunk-2K2ATNTY.mjs +12 -0
- package/dist/chunk-2K2ATNTY.mjs.map +1 -0
- package/dist/{chunk-FJZ4TRAF.mjs → chunk-QGFAF5VH.mjs} +93 -93
- package/dist/{chunk-FJZ4TRAF.mjs.map → chunk-QGFAF5VH.mjs.map} +1 -1
- package/dist/{currency-LC4OCQQU.mjs → currency-HGHBHKCR.mjs} +3 -3
- package/dist/{currency-LC4OCQQU.mjs.map → currency-HGHBHKCR.mjs.map} +1 -1
- package/dist/index.cjs +269 -193
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +99 -23
- package/dist/index.mjs.map +1 -1
- package/dist/protocolViewerParsers-EKSTC7KZ.mjs +5 -0
- package/dist/{protocolViewerParsers-PNZVGROS.mjs.map → protocolViewerParsers-EKSTC7KZ.mjs.map} +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.mjs +1 -1
- package/dist/{timeout-RJ66S57R.mjs → timeout-XMVMQWWA.mjs} +3 -3
- package/dist/{timeout-RJ66S57R.mjs.map → timeout-XMVMQWWA.mjs.map} +1 -1
- package/dist/{vaultUtils-DWShBZsH.d.mts → vaultUtils-CGxOY369.d.mts} +20 -4
- package/dist/{vaultUtils-DWShBZsH.d.ts → vaultUtils-CGxOY369.d.ts} +20 -4
- package/package.json +2 -2
- package/dist/chunk-755TILW4.mjs +0 -12
- package/dist/chunk-755TILW4.mjs.map +0 -1
- package/dist/protocolViewerParsers-PNZVGROS.mjs +0 -5
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
|
|
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;
|
|
63
|
-
|
|
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
|
|
69
|
-
|
|
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
|
|
101
|
-
before navigating to `returnUrl` unchanged. No
|
|
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
|
|
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
|
|
159
|
-
receipt verification and error codes remain unchanged. Google
|
|
160
|
-
consent
|
|
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,
|
package/dist/build-metadata.json
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"source": {
|
|
4
4
|
"repository": "zkp2p/zkp2p-clients",
|
|
5
|
-
"commitSha": "
|
|
5
|
+
"commitSha": "5261b0adcee018c238be2064ad2c06e8918cb309",
|
|
6
6
|
"kind": "github",
|
|
7
7
|
"distributable": true
|
|
8
8
|
},
|
|
9
|
-
"sdkPackageVersion": "0.14.5
|
|
10
|
-
"contractsPackageVersion": "0.4.3
|
|
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\"}}}"]}
|