@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
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { enrichPvDepositView, enrichPvIntentView, parseDepositView, parseIntentView } from './chunk-JU7CL4RJ.mjs';
|
|
2
|
+
import './chunk-ZB22BZLZ.mjs';
|
|
3
|
+
import './chunk-HQACV3RF.mjs';
|
|
4
|
+
//# sourceMappingURL=protocolViewerParsers-OLQPDNPL.mjs.map
|
|
5
|
+
//# sourceMappingURL=protocolViewerParsers-OLQPDNPL.mjs.map
|
package/dist/{protocolViewerParsers-Y2LKEF6H.mjs.map → protocolViewerParsers-OLQPDNPL.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"protocolViewerParsers-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"protocolViewerParsers-OLQPDNPL.mjs"}
|
package/dist/react.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Z as Zkp2pClient, P as PostDepositDetailsRequest, a3 as SignalIntentMethodParams, bW as PreparedTransaction, a4 as FulfillIntentMethodParams, dG as SendTransactionFn, dH as SendBatchFn, dE as DelegationDepositTarget, dF as BatchResult, ak as IntentGuardianErrorCode, ag as IntentGuardianPolicy, ah as IntentGuardianQuote } from './vaultUtils-
|
|
2
|
-
export { dC as DelegationRoute, dD as DelegationState, dK as VAULT_ZERO_ADDRESS, dw as ZERO_RATE_MANAGER_ID, dL as asErrorMessage, dM as assertDelegationMethodSupport, dB as classifyDelegationState, dA as getDelegationRoute, dx as isZeroRateManagerId, dy as normalizeRateManagerId, dz as normalizeRegistry } from './vaultUtils-
|
|
1
|
+
import { Z as Zkp2pClient, P as PostDepositDetailsRequest, a3 as SignalIntentMethodParams, bW as PreparedTransaction, a4 as FulfillIntentMethodParams, dG as SendTransactionFn, dH as SendBatchFn, dE as DelegationDepositTarget, dF as BatchResult, ak as IntentGuardianErrorCode, ag as IntentGuardianPolicy, ah as IntentGuardianQuote } from './vaultUtils-CK4ph-vu.mjs';
|
|
2
|
+
export { dC as DelegationRoute, dD as DelegationState, dK as VAULT_ZERO_ADDRESS, dw as ZERO_RATE_MANAGER_ID, dL as asErrorMessage, dM as assertDelegationMethodSupport, dB as classifyDelegationState, dA as getDelegationRoute, dx as isZeroRateManagerId, dy as normalizeRateManagerId, dz as normalizeRegistry } from './vaultUtils-CK4ph-vu.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 { Z as Zkp2pClient, P as PostDepositDetailsRequest, a3 as SignalIntentMethodParams, bW as PreparedTransaction, a4 as FulfillIntentMethodParams, dG as SendTransactionFn, dH as SendBatchFn, dE as DelegationDepositTarget, dF as BatchResult, ak as IntentGuardianErrorCode, ag as IntentGuardianPolicy, ah as IntentGuardianQuote } from './vaultUtils-
|
|
2
|
-
export { dC as DelegationRoute, dD as DelegationState, dK as VAULT_ZERO_ADDRESS, dw as ZERO_RATE_MANAGER_ID, dL as asErrorMessage, dM as assertDelegationMethodSupport, dB as classifyDelegationState, dA as getDelegationRoute, dx as isZeroRateManagerId, dy as normalizeRateManagerId, dz as normalizeRegistry } from './vaultUtils-
|
|
1
|
+
import { Z as Zkp2pClient, P as PostDepositDetailsRequest, a3 as SignalIntentMethodParams, bW as PreparedTransaction, a4 as FulfillIntentMethodParams, dG as SendTransactionFn, dH as SendBatchFn, dE as DelegationDepositTarget, dF as BatchResult, ak as IntentGuardianErrorCode, ag as IntentGuardianPolicy, ah as IntentGuardianQuote } from './vaultUtils-CK4ph-vu.js';
|
|
2
|
+
export { dC as DelegationRoute, dD as DelegationState, dK as VAULT_ZERO_ADDRESS, dw as ZERO_RATE_MANAGER_ID, dL as asErrorMessage, dM as assertDelegationMethodSupport, dB as classifyDelegationState, dA as getDelegationRoute, dx as isZeroRateManagerId, dy as normalizeRateManagerId, dz as normalizeRegistry } from './vaultUtils-CK4ph-vu.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-
|
|
3
|
+
import './chunk-HQACV3RF.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-
|
|
2
|
+
import './chunk-HQACV3RF.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-
|
|
34
|
-
//# sourceMappingURL=timeout-
|
|
33
|
+
//# sourceMappingURL=timeout-TYWTCDEG.mjs.map
|
|
34
|
+
//# sourceMappingURL=timeout-TYWTCDEG.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,MAA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AAA,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-TYWTCDEG.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;"]}
|
|
@@ -1865,7 +1865,7 @@ type UpdateReferralCodeSignatureOptions$1 = ReferralSignatureOptions$1 & {
|
|
|
1865
1865
|
|
|
1866
1866
|
type AccessPolicyOperationsConfig = {
|
|
1867
1867
|
getPublicClient: () => PublicClient;
|
|
1868
|
-
/** Required
|
|
1868
|
+
/** Required for environment-owned deposit whitelist reads and writes. */
|
|
1869
1869
|
getRuntimeEnv?: () => RuntimeEnv;
|
|
1870
1870
|
/** Undefined wherever the policy is not deployed. */
|
|
1871
1871
|
getPolicyAddress: () => Address | undefined;
|
|
@@ -1892,7 +1892,7 @@ declare class AccessPolicyUnsupportedError extends Error {
|
|
|
1892
1892
|
* gate the UI on that rather than relying on a revert.
|
|
1893
1893
|
*
|
|
1894
1894
|
* General-purpose group management is retired. New sell deposits may still
|
|
1895
|
-
* configure the protocol-owned Peer Pay
|
|
1895
|
+
* configure the protocol-owned Peer Pay deposit whitelist; every other write
|
|
1896
1896
|
* remains limited to failing open or removing historical entries.
|
|
1897
1897
|
*/
|
|
1898
1898
|
declare class AccessPolicyOperations {
|
|
@@ -1901,11 +1901,18 @@ declare class AccessPolicyOperations {
|
|
|
1901
1901
|
get isSupported(): boolean;
|
|
1902
1902
|
private requirePolicy;
|
|
1903
1903
|
private requireRegistry;
|
|
1904
|
+
private depositWhitelistGroupId;
|
|
1904
1905
|
isEnabled(params: {
|
|
1905
1906
|
escrow: Address;
|
|
1906
1907
|
depositId: bigint;
|
|
1907
1908
|
paymentMethod: Hex;
|
|
1908
1909
|
}): Promise<boolean>;
|
|
1910
|
+
/** True only when this deposit enables the current environment's whitelist group. */
|
|
1911
|
+
isDepositWhitelistConfigured(params: {
|
|
1912
|
+
escrow: Address;
|
|
1913
|
+
depositId: bigint;
|
|
1914
|
+
paymentMethod: Hex;
|
|
1915
|
+
}): Promise<boolean>;
|
|
1909
1916
|
/** Groups are enumerable onchain; direct addresses deliberately are not. */
|
|
1910
1917
|
getAllowedGroups(params: {
|
|
1911
1918
|
escrow: Address;
|
|
@@ -1929,7 +1936,7 @@ declare class AccessPolicyOperations {
|
|
|
1929
1936
|
account: Address;
|
|
1930
1937
|
}): Promise<boolean>;
|
|
1931
1938
|
private preparePolicyCall;
|
|
1932
|
-
/** Configure the fixed Peer Pay
|
|
1939
|
+
/** Configure the fixed Peer Pay deposit whitelist for a sell deposit. */
|
|
1933
1940
|
prepareConfigurePeerPayMerchantDeposit(params: {
|
|
1934
1941
|
escrow: Address;
|
|
1935
1942
|
depositId: bigint;
|
|
@@ -3677,6 +3684,8 @@ declare class Zkp2pClient {
|
|
|
3677
3684
|
intentGuardian?: Address;
|
|
3678
3685
|
retainOnEmpty?: boolean;
|
|
3679
3686
|
escrowAddress?: Address;
|
|
3687
|
+
/** Peer referral code (six alphanumeric characters) for deposit attribution. */
|
|
3688
|
+
referralCode?: string;
|
|
3680
3689
|
txOverrides?: TxOverrides;
|
|
3681
3690
|
}): Promise<{
|
|
3682
3691
|
depositDetails: PostDepositDetailsRequest[];
|
|
@@ -3714,6 +3723,8 @@ declare class Zkp2pClient {
|
|
|
3714
3723
|
intentGuardian?: Address;
|
|
3715
3724
|
retainOnEmpty?: boolean;
|
|
3716
3725
|
escrowAddress?: Address;
|
|
3726
|
+
/** Peer referral code (six alphanumeric characters) for deposit attribution. */
|
|
3727
|
+
referralCode?: string;
|
|
3717
3728
|
txOverrides?: TxOverrides;
|
|
3718
3729
|
}): Promise<{
|
|
3719
3730
|
depositDetails: PostDepositDetailsRequest[];
|
|
@@ -1865,7 +1865,7 @@ type UpdateReferralCodeSignatureOptions$1 = ReferralSignatureOptions$1 & {
|
|
|
1865
1865
|
|
|
1866
1866
|
type AccessPolicyOperationsConfig = {
|
|
1867
1867
|
getPublicClient: () => PublicClient;
|
|
1868
|
-
/** Required
|
|
1868
|
+
/** Required for environment-owned deposit whitelist reads and writes. */
|
|
1869
1869
|
getRuntimeEnv?: () => RuntimeEnv;
|
|
1870
1870
|
/** Undefined wherever the policy is not deployed. */
|
|
1871
1871
|
getPolicyAddress: () => Address | undefined;
|
|
@@ -1892,7 +1892,7 @@ declare class AccessPolicyUnsupportedError extends Error {
|
|
|
1892
1892
|
* gate the UI on that rather than relying on a revert.
|
|
1893
1893
|
*
|
|
1894
1894
|
* General-purpose group management is retired. New sell deposits may still
|
|
1895
|
-
* configure the protocol-owned Peer Pay
|
|
1895
|
+
* configure the protocol-owned Peer Pay deposit whitelist; every other write
|
|
1896
1896
|
* remains limited to failing open or removing historical entries.
|
|
1897
1897
|
*/
|
|
1898
1898
|
declare class AccessPolicyOperations {
|
|
@@ -1901,11 +1901,18 @@ declare class AccessPolicyOperations {
|
|
|
1901
1901
|
get isSupported(): boolean;
|
|
1902
1902
|
private requirePolicy;
|
|
1903
1903
|
private requireRegistry;
|
|
1904
|
+
private depositWhitelistGroupId;
|
|
1904
1905
|
isEnabled(params: {
|
|
1905
1906
|
escrow: Address;
|
|
1906
1907
|
depositId: bigint;
|
|
1907
1908
|
paymentMethod: Hex;
|
|
1908
1909
|
}): Promise<boolean>;
|
|
1910
|
+
/** True only when this deposit enables the current environment's whitelist group. */
|
|
1911
|
+
isDepositWhitelistConfigured(params: {
|
|
1912
|
+
escrow: Address;
|
|
1913
|
+
depositId: bigint;
|
|
1914
|
+
paymentMethod: Hex;
|
|
1915
|
+
}): Promise<boolean>;
|
|
1909
1916
|
/** Groups are enumerable onchain; direct addresses deliberately are not. */
|
|
1910
1917
|
getAllowedGroups(params: {
|
|
1911
1918
|
escrow: Address;
|
|
@@ -1929,7 +1936,7 @@ declare class AccessPolicyOperations {
|
|
|
1929
1936
|
account: Address;
|
|
1930
1937
|
}): Promise<boolean>;
|
|
1931
1938
|
private preparePolicyCall;
|
|
1932
|
-
/** Configure the fixed Peer Pay
|
|
1939
|
+
/** Configure the fixed Peer Pay deposit whitelist for a sell deposit. */
|
|
1933
1940
|
prepareConfigurePeerPayMerchantDeposit(params: {
|
|
1934
1941
|
escrow: Address;
|
|
1935
1942
|
depositId: bigint;
|
|
@@ -3677,6 +3684,8 @@ declare class Zkp2pClient {
|
|
|
3677
3684
|
intentGuardian?: Address;
|
|
3678
3685
|
retainOnEmpty?: boolean;
|
|
3679
3686
|
escrowAddress?: Address;
|
|
3687
|
+
/** Peer referral code (six alphanumeric characters) for deposit attribution. */
|
|
3688
|
+
referralCode?: string;
|
|
3680
3689
|
txOverrides?: TxOverrides;
|
|
3681
3690
|
}): Promise<{
|
|
3682
3691
|
depositDetails: PostDepositDetailsRequest[];
|
|
@@ -3714,6 +3723,8 @@ declare class Zkp2pClient {
|
|
|
3714
3723
|
intentGuardian?: Address;
|
|
3715
3724
|
retainOnEmpty?: boolean;
|
|
3716
3725
|
escrowAddress?: Address;
|
|
3726
|
+
/** Peer referral code (six alphanumeric characters) for deposit attribution. */
|
|
3727
|
+
referralCode?: string;
|
|
3717
3728
|
txOverrides?: TxOverrides;
|
|
3718
3729
|
}): Promise<{
|
|
3719
3730
|
depositDetails: PostDepositDetailsRequest[];
|
package/package.json
CHANGED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { enrichPvDepositView, enrichPvIntentView, parseDepositView, parseIntentView } from './chunk-OP2REHNS.mjs';
|
|
2
|
-
import './chunk-ZB22BZLZ.mjs';
|
|
3
|
-
import './chunk-BVBHBKX7.mjs';
|
|
4
|
-
//# sourceMappingURL=protocolViewerParsers-Y2LKEF6H.mjs.map
|
|
5
|
-
//# sourceMappingURL=protocolViewerParsers-Y2LKEF6H.mjs.map
|