@zkp2p/sdk 0.14.2 → 0.14.3
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 +39 -0
- package/dist/build-metadata.json +2 -2
- package/dist/{chunk-OP2REHNS.mjs → chunk-2NJU3MGV.mjs} +3 -3
- package/dist/{chunk-OP2REHNS.mjs.map → chunk-2NJU3MGV.mjs.map} +1 -1
- package/dist/{chunk-BVBHBKX7.mjs → chunk-BY77PPIP.mjs} +3 -3
- package/dist/{chunk-BVBHBKX7.mjs.map → chunk-BY77PPIP.mjs.map} +1 -1
- package/dist/{currency-GBDKE3OV.mjs → currency-GXJH7J2W.mjs} +3 -3
- package/dist/{currency-GBDKE3OV.mjs.map → currency-GXJH7J2W.mjs.map} +1 -1
- package/dist/index.cjs +31 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.mjs +40 -19
- package/dist/index.mjs.map +1 -1
- package/dist/protocolViewerParsers-2KR7YF7Z.mjs +5 -0
- package/dist/{protocolViewerParsers-Y2LKEF6H.mjs.map → protocolViewerParsers-2KR7YF7Z.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-WPD7KDNF.mjs → timeout-5O5AVII5.mjs} +3 -3
- package/dist/{timeout-WPD7KDNF.mjs.map → timeout-5O5AVII5.mjs.map} +1 -1
- package/dist/{vaultUtils-DVps_hg9.d.mts → vaultUtils-BmF7Ko7F.d.mts} +10 -3
- package/dist/{vaultUtils-DVps_hg9.d.ts → vaultUtils-BmF7Ko7F.d.ts} +10 -3
- package/package.json +1 -1
- package/dist/protocolViewerParsers-Y2LKEF6H.mjs +0 -5
package/README.md
CHANGED
|
@@ -75,6 +75,45 @@ hosts and custom window handling with account-status polling at least ten second
|
|
|
75
75
|
apart. Deploy the hosted page before using the SDK helper. See the
|
|
76
76
|
[flow specification](https://github.com/zkp2p/zkp2p-clients/blob/main/docs/venmo-gmail-connect.md).
|
|
77
77
|
|
|
78
|
+
### Native app return
|
|
79
|
+
|
|
80
|
+
SDK `0.14.3` adds optional `returnUrl` to the URL builder. Partners
|
|
81
|
+
supply their callback directly; no callback registration with Peer or deployment
|
|
82
|
+
setting is required. Deploy the hosted-page update before enabling this flow.
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
import { getVenmoGmailConnectUrl } from '@zkp2p/sdk';
|
|
86
|
+
import * as WebBrowser from 'expo-web-browser';
|
|
87
|
+
|
|
88
|
+
// Use a callback scheme registered in your app binary.
|
|
89
|
+
const returnUrl = 'partner-app://venmo-linked';
|
|
90
|
+
const connectUrl = getVenmoGmailConnectUrl({ payeeDetails, returnUrl });
|
|
91
|
+
await WebBrowser.openAuthSessionAsync(connectUrl, returnUrl);
|
|
92
|
+
// Re-check your backend's seller-credential/status after return or dismissal.
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Use a scheme registered in your Expo app binary; Expo Go is not a substitute
|
|
96
|
+
for testing your app's callback. See Expo's
|
|
97
|
+
[`openAuthSessionAsync` documentation](https://docs.expo.dev/versions/latest/sdk/webbrowser/#webbrowseropenauthsessionasyncurl-redirecturl-options).
|
|
98
|
+
The browser popup helper remains browser-only; native hosts use the URL builder.
|
|
99
|
+
|
|
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,
|
|
102
|
+
account hash, or success flag are appended. If automatic navigation is blocked,
|
|
103
|
+
select **Return to your app**. Consent or verification errors stay visible and
|
|
104
|
+
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.
|
|
106
|
+
|
|
107
|
+
Apps that need no SDK can build the same URL themselves:
|
|
108
|
+
`https://app.peer.xyz/connect/venmo?returnUrl=<URL-encoded-callback>#<payeeDetails>`.
|
|
109
|
+
The query parameter must precede the account hash fragment. Malformed URLs,
|
|
110
|
+
unsafe schemes, embedded credentials, and duplicate parameters are rejected
|
|
111
|
+
before consent or credential upload.
|
|
112
|
+
|
|
113
|
+
Omit `returnUrl` or leave it empty to keep the existing behavior: Peer attempts
|
|
114
|
+
`window.close()` after verification. Script-opened desktop popups can close;
|
|
115
|
+
mobile browser tabs that disallow closure keep the success message visible.
|
|
116
|
+
|
|
78
117
|
### Popup customization
|
|
79
118
|
|
|
80
119
|
Pass `appearance` to either hosted-link helper and `popup` to the browser opener:
|
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": "e848bb1cab3615498514e767e43ea50ec464a633",
|
|
6
6
|
"kind": "github",
|
|
7
7
|
"distributable": true
|
|
8
8
|
},
|
|
9
|
-
"sdkPackageVersion": "0.14.
|
|
9
|
+
"sdkPackageVersion": "0.14.3",
|
|
10
10
|
"contractsPackageVersion": "0.4.2-rc.2",
|
|
11
11
|
"indexerSchemaPackageVersion": "0.22.0",
|
|
12
12
|
"activeDisputeStack": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { currencyKeccak256, getCurrencyInfoFromHash } from './chunk-ZB22BZLZ.mjs';
|
|
2
|
-
import { __export } from './chunk-
|
|
2
|
+
import { __export } from './chunk-BY77PPIP.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-2NJU3MGV.mjs.map
|
|
97852
|
+
//# sourceMappingURL=chunk-2NJU3MGV.mjs.map
|