@zkp2p/sdk 0.14.2 → 0.14.4
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 +66 -2
- package/dist/build-metadata.json +2 -2
- package/dist/{chunk-BVBHBKX7.mjs → chunk-HQACV3RF.mjs} +3 -3
- package/dist/{chunk-BVBHBKX7.mjs.map → chunk-HQACV3RF.mjs.map} +1 -1
- package/dist/{chunk-OP2REHNS.mjs → chunk-JU7CL4RJ.mjs} +3 -3
- package/dist/{chunk-OP2REHNS.mjs.map → chunk-JU7CL4RJ.mjs.map} +1 -1
- package/dist/{currency-GBDKE3OV.mjs → currency-Y5AB4CKQ.mjs} +3 -3
- package/dist/{currency-GBDKE3OV.mjs.map → currency-Y5AB4CKQ.mjs.map} +1 -1
- package/dist/index.cjs +51 -11
- 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 +60 -20
- package/dist/index.mjs.map +1 -1
- package/dist/protocolViewerParsers-OLQPDNPL.mjs +5 -0
- package/dist/{protocolViewerParsers-Y2LKEF6H.mjs.map → protocolViewerParsers-OLQPDNPL.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-TYWTCDEG.mjs} +3 -3
- package/dist/{timeout-WPD7KDNF.mjs.map → timeout-TYWTCDEG.mjs.map} +1 -1
- package/dist/{vaultUtils-DVps_hg9.d.mts → vaultUtils-CK4ph-vu.d.mts} +14 -3
- package/dist/{vaultUtils-DVps_hg9.d.ts → vaultUtils-CK4ph-vu.d.ts} +14 -3
- package/package.json +1 -1
- package/dist/protocolViewerParsers-Y2LKEF6H.mjs +0 -5
package/README.md
CHANGED
|
@@ -35,10 +35,10 @@ 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.
|
|
38
|
+
For partner cash-out integrations, prefer stable `@zkp2p/cash@0.6.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
|
-
The direct SDK helpers below require `@zkp2p/sdk@0.14.2
|
|
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
44
|
The host passes the selected account hash; the user selects Connect Gmail,
|
|
@@ -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:
|
|
@@ -1027,6 +1066,31 @@ const hash = await client.signalIntent({
|
|
|
1027
1066
|
});
|
|
1028
1067
|
```
|
|
1029
1068
|
|
|
1069
|
+
`createDeposit` and `prepareCreateDeposit` also accept `referralCode` for
|
|
1070
|
+
Peer deposit-level referral attribution, using the same `peer-ref-XXXXXX` marker
|
|
1071
|
+
as the Cash SDK:
|
|
1072
|
+
|
|
1073
|
+
```ts
|
|
1074
|
+
const { prepared } = await client.prepareCreateDeposit({
|
|
1075
|
+
...depositParams,
|
|
1076
|
+
referralCode: 'ABC123',
|
|
1077
|
+
txOverrides: { referrer: 'my-app' },
|
|
1078
|
+
});
|
|
1079
|
+
```
|
|
1080
|
+
|
|
1081
|
+
Codes must contain six alphanumeric characters; whitespace is trimmed and letters
|
|
1082
|
+
are uppercased. Invalid codes reject before payee registration or transaction
|
|
1083
|
+
submission. The resulting ERC-8021 codes are `peer-ref-ABC123`, `my-app`, then
|
|
1084
|
+
`bc_nbn6qkni`. Omitting `referralCode` preserves existing attribution. The SDK does
|
|
1085
|
+
not add the Cash-specific `peer-cash` source marker.
|
|
1086
|
+
|
|
1087
|
+
Curator resolves the referral code and determines deposit-level integration credit;
|
|
1088
|
+
this option does not set a fee or redeem a maker referral. Ordinary
|
|
1089
|
+
`txOverrides.referrer` codes remain analytics attribution. When `referralCode` is
|
|
1090
|
+
supplied, an existing `peer-ref-` marker in `txOverrides.referrer` is rejected
|
|
1091
|
+
before side effects, including an identical marker. Supply the referral through
|
|
1092
|
+
one option only; Curator treats conflicting referral attribution as ambiguous.
|
|
1093
|
+
|
|
1030
1094
|
Lower-level helpers are also exported: `BASE_BUILDER_CODE`, `ZKP2P_IOS_REFERRER`, `ZKP2P_ANDROID_REFERRER`, `getAttributionDataSuffix()`, `appendAttributionToCalldata()`, `encodeWithAttribution()`, and `sendTransactionWithAttribution()`.
|
|
1031
1095
|
|
|
1032
1096
|
## TypeDoc API Reference
|
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": "c34d74604e3cab83656d6ba85203099456962b0c",
|
|
6
6
|
"kind": "github",
|
|
7
7
|
"distributable": true
|
|
8
8
|
},
|
|
9
|
-
"sdkPackageVersion": "0.14.
|
|
9
|
+
"sdkPackageVersion": "0.14.4",
|
|
10
10
|
"contractsPackageVersion": "0.4.2-rc.2",
|
|
11
11
|
"indexerSchemaPackageVersion": "0.22.0",
|
|
12
12
|
"activeDisputeStack": {
|
|
@@ -5,8 +5,8 @@ var __export = (target, all) => {
|
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
// <define:__ZKP2P_SDK_BUILD_METADATA__>
|
|
8
|
-
var define_ZKP2P_SDK_BUILD_METADATA_default = { schemaVersion: 2, source: { repository: "zkp2p/zkp2p-clients", commitSha: "
|
|
8
|
+
var define_ZKP2P_SDK_BUILD_METADATA_default = { schemaVersion: 2, source: { repository: "zkp2p/zkp2p-clients", commitSha: "c34d74604e3cab83656d6ba85203099456962b0c", kind: "github", distributable: true }, sdkPackageVersion: "0.14.4", contractsPackageVersion: "0.4.2-rc.2", indexerSchemaPackageVersion: "0.22.0", activeDisputeStack: { base: { version: 2, selectionHash: "ba40c2954b408d0c658881a8d28e5bfcc9bade5cc3d953fd17eae1eca69d841c" }, baseStaging: { version: 2, selectionHash: "6c49c1ce51eec594a22385c4efcab08aa9926b6b63a725e14a0027ec5d2f4fc9" } } };
|
|
9
9
|
|
|
10
10
|
export { __export, define_ZKP2P_SDK_BUILD_METADATA_default };
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
12
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-HQACV3RF.mjs.map
|
|
12
|
+
//# sourceMappingURL=chunk-HQACV3RF.mjs.map
|
|
@@ -1 +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-
|
|
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-HQACV3RF.mjs","sourcesContent":["{\"schemaVersion\":2,\"source\":{\"repository\":\"zkp2p/zkp2p-clients\",\"commitSha\":\"c34d74604e3cab83656d6ba85203099456962b0c\",\"kind\":\"github\",\"distributable\":true},\"sdkPackageVersion\":\"0.14.4\",\"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-HQACV3RF.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-JU7CL4RJ.mjs.map
|
|
97852
|
+
//# sourceMappingURL=chunk-JU7CL4RJ.mjs.map
|