@zkp2p/sdk 0.14.2-rc.3 → 0.14.2
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 +87 -0
- package/dist/build-metadata.json +2 -2
- package/dist/chunk-BVBHBKX7.mjs +12 -0
- package/dist/chunk-BVBHBKX7.mjs.map +1 -0
- package/dist/{chunk-DNKX73LN.mjs → chunk-OP2REHNS.mjs} +3 -3
- package/dist/{chunk-DNKX73LN.mjs.map → chunk-OP2REHNS.mjs.map} +1 -1
- package/dist/{currency-LT7VKBBS.mjs → currency-GBDKE3OV.mjs} +3 -3
- package/dist/{currency-LT7VKBBS.mjs.map → currency-GBDKE3OV.mjs.map} +1 -1
- package/dist/index.cjs +174 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +63 -3
- package/dist/index.d.ts +63 -3
- package/dist/index.mjs +173 -11
- package/dist/index.mjs.map +1 -1
- package/dist/protocolViewerParsers-Y2LKEF6H.mjs +5 -0
- package/dist/{protocolViewerParsers-FQ3FBMNT.mjs.map → protocolViewerParsers-Y2LKEF6H.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-P7V7KVRD.mjs → timeout-WPD7KDNF.mjs} +3 -3
- package/dist/{timeout-P7V7KVRD.mjs.map → timeout-WPD7KDNF.mjs.map} +1 -1
- package/dist/{vaultUtils-D3J7IDTF.d.mts → vaultUtils-DVps_hg9.d.mts} +1 -1
- package/dist/{vaultUtils-D3J7IDTF.d.ts → vaultUtils-DVps_hg9.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-VGVHGGQU.mjs +0 -12
- package/dist/chunk-VGVHGGQU.mjs.map +0 -1
- package/dist/protocolViewerParsers-FQ3FBMNT.mjs +0 -5
package/README.md
CHANGED
|
@@ -33,6 +33,93 @@ and chargeback-risk surface. The workspace version lives in `package.json`.
|
|
|
33
33
|
- Modular internals: intent, guardian, access-policy, staking, vault, and ProtocolViewer logic are extracted from `Zkp2pClient`, keeping the main client focused on orchestration.
|
|
34
34
|
- App-level rollout control: the SDK is capability-based. Product gating and phase flags belong in your app layer, not inside transaction helpers.
|
|
35
35
|
|
|
36
|
+
## Optional Venmo Gmail connection
|
|
37
|
+
|
|
38
|
+
For partner cash-out integrations, prefer stable `@zkp2p/cash@0.6.1` and its
|
|
39
|
+
[prepare/open/status flow](https://docs.peer.xyz/developer/peer-cash/guide#optional-venmo-receipt-linking).
|
|
40
|
+
It selects the matching environment and keeps linking separate from cash-out.
|
|
41
|
+
The direct SDK helpers below require `@zkp2p/sdk@0.14.2`.
|
|
42
|
+
|
|
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.
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
import { openVenmoGmailConnect, VenmoGmailConnectError } from '@zkp2p/sdk';
|
|
49
|
+
|
|
50
|
+
// Call directly from your button's click handler.
|
|
51
|
+
try {
|
|
52
|
+
await openVenmoGmailConnect({ payeeDetails });
|
|
53
|
+
// Refresh the account's credential status.
|
|
54
|
+
} catch (error) {
|
|
55
|
+
if (error instanceof VenmoGmailConnectError) {
|
|
56
|
+
// Preserve error.code for host UI handling and display error.message.
|
|
57
|
+
// Missing receipts: venmo_google_oauth_receipt_not_found.
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Google-hosted school and custom domains can attempt verification; no email
|
|
63
|
+
suffix check runs. Missing receipts produce a recoverable verification error.
|
|
64
|
+
Mobile widths request a normal browser tab; desktop requests a popup. The SDK
|
|
65
|
+
also reports blocked popups, closure, and a ten-minute timeout. Browser
|
|
66
|
+
opener isolation or a lost response can interrupt notification; reconcile with
|
|
67
|
+
`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
|
+
|
|
71
|
+
Use matching Peer/Curator environments and configure Curator CORS for your host.
|
|
72
|
+
`peerOrigin` accepts HTTPS origins or HTTP localhost for development; Google must
|
|
73
|
+
have the exact callback origin registered. `getVenmoGmailConnectUrl` supports native
|
|
74
|
+
hosts and custom window handling with account-status polling at least ten seconds
|
|
75
|
+
apart. Deploy the hosted page before using the SDK helper. See the
|
|
76
|
+
[flow specification](https://github.com/zkp2p/zkp2p-clients/blob/main/docs/venmo-gmail-connect.md).
|
|
77
|
+
|
|
78
|
+
### Popup customization
|
|
79
|
+
|
|
80
|
+
Pass `appearance` to either hosted-link helper and `popup` to the browser opener:
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
await openVenmoGmailConnect({
|
|
84
|
+
payeeDetails,
|
|
85
|
+
popup: { width: 500, height: 620 },
|
|
86
|
+
appearance: {
|
|
87
|
+
logoUrl: 'https://your-app.example/logo.png',
|
|
88
|
+
logoAlt: 'Your app',
|
|
89
|
+
backgroundColor: '#FFFFFF',
|
|
90
|
+
textColor: '#172033',
|
|
91
|
+
secondaryTextColor: '#636B7A',
|
|
92
|
+
buttonColor: '#6246EA',
|
|
93
|
+
buttonTextColor: '#FFFFFF',
|
|
94
|
+
buttonHoverColor: '#5035CC',
|
|
95
|
+
focusColor: '#6246EA',
|
|
96
|
+
fontFamily: 'Arial, sans-serif',
|
|
97
|
+
headingFontFamily: 'Arial, sans-serif',
|
|
98
|
+
headingTextTransform: 'none',
|
|
99
|
+
buttonTextTransform: 'none',
|
|
100
|
+
headingFontSize: 30,
|
|
101
|
+
buttonBorderRadius: 24,
|
|
102
|
+
buttonHeight: 52,
|
|
103
|
+
logoHeight: 44,
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
The page centers your hosted logo and Venmo in equal circular frames with connection dots below the explanation, using Peer when no partner logo is supplied. `fontUrl` optionally loads a hosted WOFF/WOFF2 face (the font host must
|
|
109
|
+
allow CORS); a failed font uses the fallback stack. Failed partner images show Peer. Asset URLs require HTTPS, with HTTP localhost allowed for development.
|
|
110
|
+
|
|
111
|
+
`VenmoGmailAppearance` also exposes `cardBackgroundColor`, `cardBorderRadius`,
|
|
112
|
+
`borderColor`, `contentWidth`, `padding`, `gap`, `fontSize`, `successColor` and
|
|
113
|
+
`errorColor`. Colors use `#RGB` or `#RRGGBB`; sizes are pixels. Invalid options
|
|
114
|
+
throw `ValidationError` before the popup opens. Arbitrary CSS/HTML is not accepted.
|
|
115
|
+
Choose contrasting text, button and focus colors.
|
|
116
|
+
|
|
117
|
+
Popup width supports 320–1200 px and height 480–1600 px. Mobile still requests a
|
|
118
|
+
regular tab, whose size and presentation are controlled by the browser. Branding
|
|
119
|
+
and styles survive the existing Google callback; account binding, consent copy,
|
|
120
|
+
receipt verification and error codes remain unchanged. Google controls its own
|
|
121
|
+
consent page's appearance.
|
|
122
|
+
|
|
36
123
|
## Installation
|
|
37
124
|
|
|
38
125
|
```bash
|
package/dist/build-metadata.json
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"source": {
|
|
4
4
|
"repository": "zkp2p/zkp2p-clients",
|
|
5
|
-
"commitSha": "
|
|
5
|
+
"commitSha": "a87f38c512f987fc3b9234b5aee31115bf840a18",
|
|
6
6
|
"kind": "github",
|
|
7
7
|
"distributable": true
|
|
8
8
|
},
|
|
9
|
-
"sdkPackageVersion": "0.14.2
|
|
9
|
+
"sdkPackageVersion": "0.14.2",
|
|
10
10
|
"contractsPackageVersion": "0.4.2-rc.2",
|
|
11
11
|
"indexerSchemaPackageVersion": "0.22.0",
|
|
12
12
|
"activeDisputeStack": {
|
|
@@ -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: "a87f38c512f987fc3b9234b5aee31115bf840a18", kind: "github", distributable: true }, sdkPackageVersion: "0.14.2", contractsPackageVersion: "0.4.2-rc.2", 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-BVBHBKX7.mjs.map
|
|
12
|
+
//# sourceMappingURL=chunk-BVBHBKX7.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,YAAA,EAAa,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-BVBHBKX7.mjs","sourcesContent":["{\"schemaVersion\":2,\"source\":{\"repository\":\"zkp2p/zkp2p-clients\",\"commitSha\":\"a87f38c512f987fc3b9234b5aee31115bf840a18\",\"kind\":\"github\",\"distributable\":true},\"sdkPackageVersion\":\"0.14.2\",\"contractsPackageVersion\":\"0.4.2-rc.2\",\"indexerSchemaPackageVersion\":\"0.22.0\",\"activeDisputeStack\":{\"base\":{\"version\":2,\"selectionHash\":\"ba40c2954b408d0c658881a8d28e5bfcc9bade5cc3d953fd17eae1eca69d841c\"},\"baseStaging\":{\"version\":2,\"selectionHash\":\"6c49c1ce51eec594a22385c4efcab08aa9926b6b63a725e14a0027ec5d2f4fc9\"}}}"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { currencyKeccak256, getCurrencyInfoFromHash } from './chunk-ZB22BZLZ.mjs';
|
|
2
|
-
import { __export } from './chunk-
|
|
2
|
+
import { __export } from './chunk-BVBHBKX7.mjs';
|
|
3
3
|
import { hexToBytes, keccak256, toBytes, bytesToHex } from 'viem';
|
|
4
4
|
|
|
5
5
|
// src/utils/bigint.ts
|
|
@@ -97848,5 +97848,5 @@ function enrichPvIntentView(view, chainId, env = "production") {
|
|
|
97848
97848
|
}
|
|
97849
97849
|
|
|
97850
97850
|
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 };
|
|
97851
|
-
//# sourceMappingURL=chunk-
|
|
97852
|
-
//# sourceMappingURL=chunk-
|
|
97851
|
+
//# sourceMappingURL=chunk-OP2REHNS.mjs.map
|
|
97852
|
+
//# sourceMappingURL=chunk-OP2REHNS.mjs.map
|