@zkp2p/sdk 0.14.6-rc.0 → 0.14.6

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.
@@ -0,0 +1,5 @@
1
+ export { enrichPvDepositView, enrichPvIntentView, parseDepositView, parseIntentView } from './chunk-PT56GEQ4.mjs';
2
+ import './chunk-WDEEWFEU.mjs';
3
+ import './chunk-BBPE3X6U.mjs';
4
+ //# sourceMappingURL=protocolViewerParsers-L64CKN7P.mjs.map
5
+ //# sourceMappingURL=protocolViewerParsers-L64CKN7P.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"protocolViewerParsers-DCRTQQV3.mjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"protocolViewerParsers-L64CKN7P.mjs"}
package/dist/react.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as Zkp2pClient, P as PostDepositDetailsRequest, a4 as SignalIntentMethodParams, bY as PreparedTransaction, a5 as FulfillIntentMethodParams, dJ as SendTransactionFn, dK as SendBatchFn, dH as DelegationDepositTarget, dI as BatchResult, al as IntentGuardianErrorCode, ah as IntentGuardianPolicy, ai as IntentGuardianQuote } from './vaultUtils-CAK6rnEl.mjs';
2
- export { dF as DelegationRoute, dG as DelegationState, dN as VAULT_ZERO_ADDRESS, dz as ZERO_RATE_MANAGER_ID, dO as asErrorMessage, dP as assertDelegationMethodSupport, dE as classifyDelegationState, dD as getDelegationRoute, dA as isZeroRateManagerId, dB as normalizeRateManagerId, dC as normalizeRegistry } from './vaultUtils-CAK6rnEl.mjs';
1
+ import { _ as Zkp2pClient, P as PostDepositDetailsRequest, a4 as SignalIntentMethodParams, bY as PreparedTransaction, a5 as FulfillIntentMethodParams, dJ as SendTransactionFn, dK as SendBatchFn, dH as DelegationDepositTarget, dI as BatchResult, al as IntentGuardianErrorCode, ah as IntentGuardianPolicy, ai as IntentGuardianQuote } from './vaultUtils-Cg9_7sMz.mjs';
2
+ export { dF as DelegationRoute, dG as DelegationState, dN as VAULT_ZERO_ADDRESS, dz as ZERO_RATE_MANAGER_ID, dO as asErrorMessage, dP as assertDelegationMethodSupport, dE as classifyDelegationState, dD as getDelegationRoute, dA as isZeroRateManagerId, dB as normalizeRateManagerId, dC as normalizeRegistry } from './vaultUtils-Cg9_7sMz.mjs';
3
3
  import { Hash, Address, Hex } from 'viem';
4
4
  import '@zkp2p/indexer-schema';
5
5
  import 'abitype';
package/dist/react.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as Zkp2pClient, P as PostDepositDetailsRequest, a4 as SignalIntentMethodParams, bY as PreparedTransaction, a5 as FulfillIntentMethodParams, dJ as SendTransactionFn, dK as SendBatchFn, dH as DelegationDepositTarget, dI as BatchResult, al as IntentGuardianErrorCode, ah as IntentGuardianPolicy, ai as IntentGuardianQuote } from './vaultUtils-CAK6rnEl.js';
2
- export { dF as DelegationRoute, dG as DelegationState, dN as VAULT_ZERO_ADDRESS, dz as ZERO_RATE_MANAGER_ID, dO as asErrorMessage, dP as assertDelegationMethodSupport, dE as classifyDelegationState, dD as getDelegationRoute, dA as isZeroRateManagerId, dB as normalizeRateManagerId, dC as normalizeRegistry } from './vaultUtils-CAK6rnEl.js';
1
+ import { _ as Zkp2pClient, P as PostDepositDetailsRequest, a4 as SignalIntentMethodParams, bY as PreparedTransaction, a5 as FulfillIntentMethodParams, dJ as SendTransactionFn, dK as SendBatchFn, dH as DelegationDepositTarget, dI as BatchResult, al as IntentGuardianErrorCode, ah as IntentGuardianPolicy, ai as IntentGuardianQuote } from './vaultUtils-Cg9_7sMz.js';
2
+ export { dF as DelegationRoute, dG as DelegationState, dN as VAULT_ZERO_ADDRESS, dz as ZERO_RATE_MANAGER_ID, dO as asErrorMessage, dP as assertDelegationMethodSupport, dE as classifyDelegationState, dD as getDelegationRoute, dA as isZeroRateManagerId, dB as normalizeRateManagerId, dC as normalizeRegistry } from './vaultUtils-Cg9_7sMz.js';
3
3
  import { Hash, Address, Hex } from 'viem';
4
4
  import '@zkp2p/indexer-schema';
5
5
  import 'abitype';
package/dist/react.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { asErrorMessage, ZERO_ADDRESS, getDelegationRoute, assertDelegationMethodSupport, prepareClearDelegationTx, normalizeRateManagerId, normalizeRegistry, isZeroRateManagerId, assertAtomicDelegationSwitchSupport, prepareSetDelegationTx, classifyIntentGuardianError } from './chunk-YA67SM3A.mjs';
2
2
  export { ZERO_ADDRESS as VAULT_ZERO_ADDRESS, ZERO_RATE_MANAGER_ID, asErrorMessage, assertDelegationMethodSupport, classifyDelegationState, getDelegationRoute, isZeroRateManagerId, normalizeRateManagerId, normalizeRegistry } from './chunk-YA67SM3A.mjs';
3
- import './chunk-LDP257MM.mjs';
3
+ import './chunk-BBPE3X6U.mjs';
4
4
  import { useState, useCallback, useMemo } from 'react';
5
5
 
6
6
  function useCreateDeposit({ client, onSuccess, onError }) {
@@ -1,5 +1,5 @@
1
1
  import { NetworkError } from './chunk-3J4FPMPW.mjs';
2
- import './chunk-LDP257MM.mjs';
2
+ import './chunk-BBPE3X6U.mjs';
3
3
 
4
4
  // src/utils/timeout.ts
5
5
  async function withTimeout(promise, timeoutMs, timeoutMessage) {
@@ -30,5 +30,5 @@ var DEFAULT_TIMEOUTS = {
30
30
  };
31
31
 
32
32
  export { DEFAULT_TIMEOUTS, withTimeout };
33
- //# sourceMappingURL=timeout-7GM3I6QA.mjs.map
34
- //# sourceMappingURL=timeout-7GM3I6QA.mjs.map
33
+ //# sourceMappingURL=timeout-5R4PPJPO.mjs.map
34
+ //# sourceMappingURL=timeout-5R4PPJPO.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/timeout.ts"],"names":[],"mappings":";;;;AASA,eAAsB,WAAA,CACpB,OAAA,EACA,SAAA,EACA,cAAA,EACY;AACZ,EAAA,IAAI,SAAA;AAEJ,EAAA,MAAM,cAAA,GAAiB,IAAI,OAAA,CAAe,CAAC,GAAG,MAAA,KAAW;AACvD,IAAA,SAAA,GAAY,WAAW,MAAM;AAC3B,MAAA,MAAA,CAAO,IAAI,YAAA,CAAa,cAAA,EAAgB,EAAE,OAAA,EAAS,SAAA,EAAW,CAAC,CAAA;AAAA,IACjE,GAAG,SAAS,CAAA;AAAA,EACd,CAAC,CAAA;AAED,EAAA,IAAI;AACF,IAAA,MAAM,SAAS,MAAM,OAAA,CAAQ,KAAK,CAAC,OAAA,EAAS,cAAc,CAAC,CAAA;AAC3D,IAAA,IAAI,SAAA,eAAwB,SAAS,CAAA;AACrC,IAAA,OAAO,MAAA;AAAA,EACT,SAAS,KAAA,EAAO;AACd,IAAA,IAAI,SAAA,eAAwB,SAAS,CAAA;AACrC,IAAA,MAAM,KAAA;AAAA,EACR;AACF;AAKO,IAAM,gBAAA,GAAmB;AAAA;AAAA,EAE9B,GAAA,EAAK,GAAA;AAAA;AAAA,EAEL,WAAA,EAAa,GAAA;AAAA;AAAA,EAEb,gBAAA,EAAkB,IAAA;AAAA;AAAA,EAElB,SAAA,EAAW;AACb","file":"timeout-7GM3I6QA.mjs","sourcesContent":["import { NetworkError } from '../errors';\n\n/**\n * Wraps a promise with a timeout\n * @param promise - The promise to wrap\n * @param timeoutMs - Timeout in milliseconds\n * @param timeoutMessage - Error message when timeout occurs\n * @returns Promise that rejects if timeout occurs\n */\nexport async function withTimeout<T>(\n promise: Promise<T>,\n timeoutMs: number,\n timeoutMessage: string\n): Promise<T> {\n let timeoutId: NodeJS.Timeout | undefined;\n\n const timeoutPromise = new Promise<never>((_, reject) => {\n timeoutId = setTimeout(() => {\n reject(new NetworkError(timeoutMessage, { timeout: timeoutMs }));\n }, timeoutMs);\n });\n\n try {\n const result = await Promise.race([promise, timeoutPromise]);\n if (timeoutId) clearTimeout(timeoutId);\n return result;\n } catch (error) {\n if (timeoutId) clearTimeout(timeoutId);\n throw error;\n }\n}\n\n/**\n * Default timeout values for different operation types\n */\nexport const DEFAULT_TIMEOUTS = {\n /** API call timeout (30 seconds) */\n API: 30000,\n /** Blockchain transaction timeout (60 seconds) */\n TRANSACTION: 60000,\n /** Proof generation timeout (120 seconds) */\n PROOF_GENERATION: 120000,\n /** Extension communication timeout (60 seconds) */\n EXTENSION: 60000,\n} as const;"]}
1
+ {"version":3,"sources":["../src/utils/timeout.ts"],"names":[],"mappings":";;;;AASA,eAAsB,WAAA,CACpB,OAAA,EACA,SAAA,EACA,cAAA,EACY;AACZ,EAAA,IAAI,SAAA;AAEJ,EAAA,MAAM,cAAA,GAAiB,IAAI,OAAA,CAAe,CAAC,GAAG,MAAA,KAAW;AACvD,IAAA,SAAA,GAAY,WAAW,MAAM;AAC3B,MAAA,MAAA,CAAO,IAAI,YAAA,CAAa,cAAA,EAAgB,EAAE,OAAA,EAAS,SAAA,EAAW,CAAC,CAAA;AAAA,IACjE,GAAG,SAAS,CAAA;AAAA,EACd,CAAC,CAAA;AAED,EAAA,IAAI;AACF,IAAA,MAAM,SAAS,MAAM,OAAA,CAAQ,KAAK,CAAC,OAAA,EAAS,cAAc,CAAC,CAAA;AAC3D,IAAA,IAAI,SAAA,eAAwB,SAAS,CAAA;AACrC,IAAA,OAAO,MAAA;AAAA,EACT,SAAS,KAAA,EAAO;AACd,IAAA,IAAI,SAAA,eAAwB,SAAS,CAAA;AACrC,IAAA,MAAM,KAAA;AAAA,EACR;AACF;AAKO,IAAM,gBAAA,GAAmB;AAAA;AAAA,EAE9B,GAAA,EAAK,GAAA;AAAA;AAAA,EAEL,WAAA,EAAa,GAAA;AAAA;AAAA,EAEb,gBAAA,EAAkB,IAAA;AAAA;AAAA,EAElB,SAAA,EAAW;AACb","file":"timeout-5R4PPJPO.mjs","sourcesContent":["import { NetworkError } from '../errors';\n\n/**\n * Wraps a promise with a timeout\n * @param promise - The promise to wrap\n * @param timeoutMs - Timeout in milliseconds\n * @param timeoutMessage - Error message when timeout occurs\n * @returns Promise that rejects if timeout occurs\n */\nexport async function withTimeout<T>(\n promise: Promise<T>,\n timeoutMs: number,\n timeoutMessage: string\n): Promise<T> {\n let timeoutId: NodeJS.Timeout | undefined;\n\n const timeoutPromise = new Promise<never>((_, reject) => {\n timeoutId = setTimeout(() => {\n reject(new NetworkError(timeoutMessage, { timeout: timeoutMs }));\n }, timeoutMs);\n });\n\n try {\n const result = await Promise.race([promise, timeoutPromise]);\n if (timeoutId) clearTimeout(timeoutId);\n return result;\n } catch (error) {\n if (timeoutId) clearTimeout(timeoutId);\n throw error;\n }\n}\n\n/**\n * Default timeout values for different operation types\n */\nexport const DEFAULT_TIMEOUTS = {\n /** API call timeout (30 seconds) */\n API: 30000,\n /** Blockchain transaction timeout (60 seconds) */\n TRANSACTION: 60000,\n /** Proof generation timeout (120 seconds) */\n PROOF_GENERATION: 120000,\n /** Extension communication timeout (60 seconds) */\n EXTENSION: 60000,\n} as const;"]}
@@ -1910,7 +1910,7 @@ declare class AccessPolicyOperations {
1910
1910
  get isSupported(): boolean;
1911
1911
  private requirePolicy;
1912
1912
  private requireRegistry;
1913
- private depositWhitelistGroupId;
1913
+ private peerPayMerchantGroupId;
1914
1914
  isEnabled(params: {
1915
1915
  escrow: Address;
1916
1916
  depositId: bigint;
@@ -3649,6 +3649,12 @@ declare class Zkp2pClient {
3649
3649
  *
3650
3650
  * Call `ensureAllowance()` first to approve USDC spending.
3651
3651
  *
3652
+ * By default, Venmo and PayPal methods enable the trusted group bypass: after
3653
+ * the deposit mines, one `WhitelistPolicy.configureDeposit` transaction per
3654
+ * such method adds the environment's Peer Pay merchant group, whose members
3655
+ * then skip dispute-protection staking. Other takers still stake, and until
3656
+ * that transaction mines, merchants stake too.
3657
+ *
3652
3658
  * @param params.token - Token address (USDC)
3653
3659
  * @param params.amount - Total deposit amount in token units (6 decimals for USDC)
3654
3660
  * @param params.intentAmountRange - Min/max amount per intent
@@ -3659,12 +3665,15 @@ declare class Zkp2pClient {
3659
3665
  * @param params.delegate - Optional delegate address that can manage the deposit
3660
3666
  * @param params.intentGuardian - Guardian for intent approval. Defaults to the paid guardian deployed for the client's environment.
3661
3667
  * @param params.retainOnEmpty - Keep deposit active when balance reaches zero
3668
+ * @param params.enableTrustedGroupBypass - Let the Peer Pay merchant group skip staking on Venmo/PayPal methods. Defaults to true.
3662
3669
  * @param params.txOverrides - Optional viem transaction overrides
3663
- * @returns The deposit details posted to API (empty when payee registration is skipped) and the transaction hash
3670
+ * @returns The deposit details posted to API (empty when payee registration is skipped), the transaction hash, and the confirmed trusted-group policy transaction hashes
3664
3671
  *
3665
3672
  * @throws Error if processorNames, payeeData, and conversionRates lengths don't match
3666
3673
  * @throws Error if payeeData is missing and neither payeeDetailsHashes nor full payment method overrides are provided
3667
3674
  * @throws Error if a currency is not supported by the specified processor
3675
+ * @throws AccessPolicyUnsupportedError before sending if a Venmo/PayPal deposit targets an environment without WhitelistPolicy
3676
+ * @throws ContractError with `details.hash` if the deposit was sent but the trusted group bypass was not confirmed
3668
3677
  *
3669
3678
  * @example
3670
3679
  * ```typescript
@@ -3711,10 +3720,13 @@ declare class Zkp2pClient {
3711
3720
  escrowAddress?: Address;
3712
3721
  /** Peer referral code (six alphanumeric characters) for deposit attribution. */
3713
3722
  referralCode?: string;
3723
+ /** Let the Peer Pay merchant group skip staking on Venmo/PayPal methods (default true). */
3724
+ enableTrustedGroupBypass?: boolean;
3714
3725
  txOverrides?: TxOverrides;
3715
3726
  }): Promise<{
3716
3727
  depositDetails: PostDepositDetailsRequest[];
3717
3728
  hash: Hash;
3729
+ accessPolicyTxHashes: Hash[];
3718
3730
  }>;
3719
3731
  /**
3720
3732
  * Prepares a createDeposit transaction without sending it.
@@ -1910,7 +1910,7 @@ declare class AccessPolicyOperations {
1910
1910
  get isSupported(): boolean;
1911
1911
  private requirePolicy;
1912
1912
  private requireRegistry;
1913
- private depositWhitelistGroupId;
1913
+ private peerPayMerchantGroupId;
1914
1914
  isEnabled(params: {
1915
1915
  escrow: Address;
1916
1916
  depositId: bigint;
@@ -3649,6 +3649,12 @@ declare class Zkp2pClient {
3649
3649
  *
3650
3650
  * Call `ensureAllowance()` first to approve USDC spending.
3651
3651
  *
3652
+ * By default, Venmo and PayPal methods enable the trusted group bypass: after
3653
+ * the deposit mines, one `WhitelistPolicy.configureDeposit` transaction per
3654
+ * such method adds the environment's Peer Pay merchant group, whose members
3655
+ * then skip dispute-protection staking. Other takers still stake, and until
3656
+ * that transaction mines, merchants stake too.
3657
+ *
3652
3658
  * @param params.token - Token address (USDC)
3653
3659
  * @param params.amount - Total deposit amount in token units (6 decimals for USDC)
3654
3660
  * @param params.intentAmountRange - Min/max amount per intent
@@ -3659,12 +3665,15 @@ declare class Zkp2pClient {
3659
3665
  * @param params.delegate - Optional delegate address that can manage the deposit
3660
3666
  * @param params.intentGuardian - Guardian for intent approval. Defaults to the paid guardian deployed for the client's environment.
3661
3667
  * @param params.retainOnEmpty - Keep deposit active when balance reaches zero
3668
+ * @param params.enableTrustedGroupBypass - Let the Peer Pay merchant group skip staking on Venmo/PayPal methods. Defaults to true.
3662
3669
  * @param params.txOverrides - Optional viem transaction overrides
3663
- * @returns The deposit details posted to API (empty when payee registration is skipped) and the transaction hash
3670
+ * @returns The deposit details posted to API (empty when payee registration is skipped), the transaction hash, and the confirmed trusted-group policy transaction hashes
3664
3671
  *
3665
3672
  * @throws Error if processorNames, payeeData, and conversionRates lengths don't match
3666
3673
  * @throws Error if payeeData is missing and neither payeeDetailsHashes nor full payment method overrides are provided
3667
3674
  * @throws Error if a currency is not supported by the specified processor
3675
+ * @throws AccessPolicyUnsupportedError before sending if a Venmo/PayPal deposit targets an environment without WhitelistPolicy
3676
+ * @throws ContractError with `details.hash` if the deposit was sent but the trusted group bypass was not confirmed
3668
3677
  *
3669
3678
  * @example
3670
3679
  * ```typescript
@@ -3711,10 +3720,13 @@ declare class Zkp2pClient {
3711
3720
  escrowAddress?: Address;
3712
3721
  /** Peer referral code (six alphanumeric characters) for deposit attribution. */
3713
3722
  referralCode?: string;
3723
+ /** Let the Peer Pay merchant group skip staking on Venmo/PayPal methods (default true). */
3724
+ enableTrustedGroupBypass?: boolean;
3714
3725
  txOverrides?: TxOverrides;
3715
3726
  }): Promise<{
3716
3727
  depositDetails: PostDepositDetailsRequest[];
3717
3728
  hash: Hash;
3729
+ accessPolicyTxHashes: Hash[];
3718
3730
  }>;
3719
3731
  /**
3720
3732
  * Prepares a createDeposit transaction without sending it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zkp2p/sdk",
3
- "version": "0.14.6-rc.0",
3
+ "version": "0.14.6",
4
4
  "description": "ZKP2P Client SDK - TypeScript SDK for deposit management, liquidity provision, and onramping",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.cjs",
@@ -75,7 +75,7 @@
75
75
  },
76
76
  "dependencies": {
77
77
  "@zkp2p/indexer-schema": "0.22.0",
78
- "@zkp2p/contracts-v2": "0.4.4-rc.1",
78
+ "@zkp2p/contracts-v2": "0.4.4-rc.2",
79
79
  "@zkp2p/zkp2p-attestation": "3.1.0",
80
80
  "ethers": "^6.0.0",
81
81
  "ox": "^0.11.1"
@@ -1,12 +0,0 @@
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: "98a468d63d95c9c88fa9c2b55108a3d363708c54", kind: "github", distributable: true }, sdkPackageVersion: "0.14.6-rc.0", contractsPackageVersion: "0.4.4-rc.1", 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-LDP257MM.mjs.map
12
- //# sourceMappingURL=chunk-LDP257MM.mjs.map
@@ -1 +0,0 @@
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,eAAc,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-LDP257MM.mjs","sourcesContent":["{\"schemaVersion\":2,\"source\":{\"repository\":\"zkp2p/zkp2p-clients\",\"commitSha\":\"98a468d63d95c9c88fa9c2b55108a3d363708c54\",\"kind\":\"github\",\"distributable\":true},\"sdkPackageVersion\":\"0.14.6-rc.0\",\"contractsPackageVersion\":\"0.4.4-rc.1\",\"indexerSchemaPackageVersion\":\"0.22.0\",\"activeDisputeStack\":{\"base\":{\"version\":2,\"selectionHash\":\"ba40c2954b408d0c658881a8d28e5bfcc9bade5cc3d953fd17eae1eca69d841c\"},\"baseStaging\":{\"version\":2,\"selectionHash\":\"6c49c1ce51eec594a22385c4efcab08aa9926b6b63a725e14a0027ec5d2f4fc9\"}}}"]}
@@ -1,5 +0,0 @@
1
- export { enrichPvDepositView, enrichPvIntentView, parseDepositView, parseIntentView } from './chunk-CZSKDEQ3.mjs';
2
- import './chunk-WDEEWFEU.mjs';
3
- import './chunk-LDP257MM.mjs';
4
- //# sourceMappingURL=protocolViewerParsers-DCRTQQV3.mjs.map
5
- //# sourceMappingURL=protocolViewerParsers-DCRTQQV3.mjs.map