@zkp2p/sdk 0.5.2 → 0.5.5
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 +4 -4
- package/dist/{chunk-L526MKG3.mjs → chunk-NKTSEXJB.mjs} +37 -5
- package/dist/{chunk-L526MKG3.mjs.map → chunk-NKTSEXJB.mjs.map} +1 -1
- package/dist/{chunk-LPJE2MN7.mjs → chunk-TGMRXUP2.mjs} +28 -3
- package/dist/chunk-TGMRXUP2.mjs.map +1 -0
- package/dist/index.cjs +194 -85
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +42 -11
- package/dist/index.d.ts +42 -11
- package/dist/index.mjs +153 -90
- package/dist/index.mjs.map +1 -1
- package/dist/protocolViewerParsers-3JGPLQGP.mjs +5 -0
- package/dist/{protocolViewerParsers-GGSM2243.mjs.map → protocolViewerParsers-3JGPLQGP.mjs.map} +1 -1
- package/dist/react.cjs +31 -16
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.mjs +6 -18
- package/dist/react.mjs.map +1 -1
- package/dist/{vaultUtils-CtNcKlpg.d.mts → vaultUtils-DOOl9QUP.d.mts} +15 -17
- package/dist/{vaultUtils-CtNcKlpg.d.ts → vaultUtils-DOOl9QUP.d.ts} +15 -17
- package/package.json +3 -3
- package/dist/chunk-LPJE2MN7.mjs.map +0 -1
- package/dist/protocolViewerParsers-GGSM2243.mjs +0 -5
|
@@ -959,8 +959,6 @@ type TimeoutConfig = {
|
|
|
959
959
|
type ApiAdapterOptions = {
|
|
960
960
|
baseApiUrl: string;
|
|
961
961
|
timeoutMs?: number;
|
|
962
|
-
apiKey?: string;
|
|
963
|
-
authToken?: string;
|
|
964
962
|
};
|
|
965
963
|
type AuthorizationTokenProvider = () => string | null | undefined | Promise<string | null | undefined>;
|
|
966
964
|
/**
|
|
@@ -1922,7 +1920,7 @@ type PaymentPlatformType = (typeof PAYMENT_PLATFORMS)[number];
|
|
|
1922
1920
|
* walletClient,
|
|
1923
1921
|
* chainId: 8453, // Base mainnet
|
|
1924
1922
|
* runtimeEnv: 'production',
|
|
1925
|
-
* // apiKey: '
|
|
1923
|
+
* // apiKey: 'internal-curator-api-key', // Optional: internal seller verification only
|
|
1926
1924
|
* indexerApiKey: 'your-indexer-key',
|
|
1927
1925
|
* };
|
|
1928
1926
|
* ```
|
|
@@ -1941,12 +1939,11 @@ type Zkp2pNextOptions = {
|
|
|
1941
1939
|
/** Base API URL for ZKP2P services (defaults to https://api.zkp2p.xyz) */
|
|
1942
1940
|
baseApiUrl?: string;
|
|
1943
1941
|
/**
|
|
1944
|
-
* Optional curator API key (sent as `x-api-key`) for
|
|
1945
|
-
*
|
|
1946
|
-
* Not used by `registerPayeeDetails` or `getTakerTier`.
|
|
1942
|
+
* Optional internal curator API key (sent as `x-api-key`) for internal seller verification.
|
|
1943
|
+
* Not used by public curator endpoints such as quotes, maker reads, or intent signing.
|
|
1947
1944
|
*/
|
|
1948
1945
|
apiKey?: string;
|
|
1949
|
-
/** Optional bearer token for
|
|
1946
|
+
/** Optional bearer token for indexer authentication */
|
|
1950
1947
|
authorizationToken?: string;
|
|
1951
1948
|
/** Optional async token provider for indexer auth in long-lived clients */
|
|
1952
1949
|
getAuthorizationToken?: IndexerAuthTokenProvider;
|
|
@@ -2195,9 +2192,9 @@ declare class Zkp2pClient {
|
|
|
2195
2192
|
readonly orchestratorRegistryAbi?: Abi;
|
|
2196
2193
|
/** Base API URL for ZKP2P services */
|
|
2197
2194
|
readonly baseApiUrl?: string;
|
|
2198
|
-
/** Optional curator API key (`x-api-key`) for
|
|
2195
|
+
/** Optional internal curator API key (`x-api-key`) for internal seller verification */
|
|
2199
2196
|
readonly apiKey?: string;
|
|
2200
|
-
/** Bearer token for
|
|
2197
|
+
/** Bearer token for indexer authentication */
|
|
2201
2198
|
readonly authorizationToken?: string;
|
|
2202
2199
|
/** API timeout in milliseconds */
|
|
2203
2200
|
readonly apiTimeoutMs: number;
|
|
@@ -3158,9 +3155,9 @@ declare class Zkp2pClient {
|
|
|
3158
3155
|
* sending fiat payment to the deposit's payee.
|
|
3159
3156
|
*
|
|
3160
3157
|
* If `gatingServiceSignature` is not provided, the SDK will automatically
|
|
3161
|
-
* fetch one from curator `/v3/intent/sign` when `
|
|
3162
|
-
*
|
|
3163
|
-
*
|
|
3158
|
+
* fetch one from curator `/v3/intent/sign` when `baseApiUrl` is configured.
|
|
3159
|
+
* Otherwise you must provide `gatingServiceSignature` and `signatureExpiration`
|
|
3160
|
+
* yourself.
|
|
3164
3161
|
*
|
|
3165
3162
|
* **Prepare Mode**: Use `.prepare()` to get the transaction calldata without sending:
|
|
3166
3163
|
* ```typescript
|
|
@@ -3412,8 +3409,8 @@ declare class Zkp2pClient {
|
|
|
3412
3409
|
/**
|
|
3413
3410
|
* **Supporting Method** - Fetches the best available quote per supported payment platform.
|
|
3414
3411
|
*
|
|
3415
|
-
* Returns one quote per platform when available.
|
|
3416
|
-
*
|
|
3412
|
+
* Returns one quote per platform when available. The API returns payee details
|
|
3413
|
+
* in each platform's best quote when available.
|
|
3417
3414
|
*
|
|
3418
3415
|
* @param req - Best-by-platform quote request parameters
|
|
3419
3416
|
* @param opts - Optional overrides for API URL and timeout
|
|
@@ -3480,8 +3477,8 @@ declare class Zkp2pClient {
|
|
|
3480
3477
|
timeoutMs?: number;
|
|
3481
3478
|
}): Promise<CuratorSellerCredentialStatusResponse>;
|
|
3482
3479
|
/**
|
|
3483
|
-
* Internal-use endpoint. The curator route requires an internal `x-api-key`;
|
|
3484
|
-
* API keys will be rejected
|
|
3480
|
+
* Internal-use endpoint. The curator route requires an internal `x-api-key`; non-internal
|
|
3481
|
+
* API keys will be rejected. Returns 410 GONE when curator has marked the credential inactive
|
|
3485
3482
|
* or a stale credential fails its synchronous re-probe.
|
|
3486
3483
|
*
|
|
3487
3484
|
* Verify a seller payment via curator's seller-credential proxy.
|
|
@@ -3592,6 +3589,7 @@ declare class Zkp2pClient {
|
|
|
3592
3589
|
intentTimestampMs: string;
|
|
3593
3590
|
paymentMethodHash: `0x${string}`;
|
|
3594
3591
|
paymentVerifier?: `0x${string}`;
|
|
3592
|
+
minimumReleaseAmount?: string;
|
|
3595
3593
|
}>;
|
|
3596
3594
|
}
|
|
3597
3595
|
|
|
@@ -3652,4 +3650,4 @@ type SendBatchFn = (txs: Array<{
|
|
|
3652
3650
|
value?: bigint;
|
|
3653
3651
|
}>) => Promise<string>;
|
|
3654
3652
|
|
|
3655
|
-
export { type
|
|
3653
|
+
export { type BestByPlatformResponseObject as $, type AttestationServiceIdentityResponse as A, type BuyerTeeSessionMaterialEncryptionInput as B, type CuratorSellerCredentialUploadResponse as C, type DepositWithRelations as D, type Zkp2pNextOptions as E, type FulfillIntentMethodParams as F, type GoogleOAuthSellerCredentialPlatform as G, type AuthorizationTokenProvider as H, type IntentEntity$1 as I, type TimeoutConfig as J, type ActionCallback as K, type CreateDepositParams as L, type CreateDepositConversionRate as M, type Range as N, type SignalIntentParams as O, type PostDepositDetailsRequest as P, type QuotesBestByPlatformRequest as Q, type ReferrerFeeConfig as R, type SellerCredentialBundle as S, type TakerTierLevel as T, type UploadSellerCredentialBundleParams as U, type ValidatePayeeDetailsRequest as V, type WithdrawDepositParams as W, type FulfillIntentParams as X, type ReleaseFundsToPayerParams as Y, Zkp2pClient as Z, type CancelIntentParams as _, type IdentityAttestationRequestBody as a, type FulfillIntentAttestationResponse as a$, type GetBestByPlatformResponse as a0, type GetBestByPlatformResponseObject as a1, type GetPlatformQuote as a2, type PlatformQuote as a3, type QuoteRequest as a4, type GetNearbyQuote as a5, type GetNearbySuggestions as a6, type GetQuoteResponse as a7, type GetQuoteResponseObject as a8, type GetQuoteSingleResponse as a9, type VenmoSessionMaterial as aA, type CashAppSessionMaterial as aB, type WiseSessionMaterial as aC, type WiseProfileInfo as aD, type WiseProfileSelectionRequired as aE, type WiseProfileNotFound as aF, type PayPalGoogleOAuthSellerCredentialUploadBody as aG, type VenmoGoogleOAuthSellerCredentialUploadBody as aH, type VenmoCredentialUploadInput as aI, type CashAppCredentialUploadInput as aJ, type WiseCredentialUploadInput as aK, type SellerCredentialUploadInputByPlatform as aL, type SellerCiphertextBundle as aM, type SellerSignedCiphertextBundle as aN, type SellerVerifyIntentDetails as aO, type SellerVerifyInput as aP, type SellerProbeInput as aQ, type SellerCredentialBundleUpload as aR, type SellerCredentialStatusValue as aS, type SellerCredentialStatus as aT, type SellerVerifyProxyBody as aU, type SellerTypedDataField as aV, type SellerTypedDataSpec as aW, type SellerPaymentTypedDataValue as aX, type SellerAttestationOutput as aY, type SellerCredentialProbeResponse as aZ, type AttestationServiceSellerVerifyResponse as a_, type QuoteResponse as aa, type QuoteResponseObject as ab, type QuoteSingleResponse as ac, type QuoteIntentResponse as ad, type QuoteFeesResponse as ae, type FiatResponse as af, type TokenResponse as ag, type NearbyQuote as ah, type NearbySuggestions as ai, type ApiDeposit as aj, type DepositVerifier as ak, type DepositVerifierCurrency as al, type DepositStatus as am, type GetDepositByIdRequest as an, type GetDepositByIdResponse as ao, type Intent as ap, type ApiIntentStatus as aq, type GetOwnerIntentsRequest as ar, type GetOwnerIntentsResponse as as, type GetIntentsByDepositRequest as at, type GetIntentsByDepositResponse as au, type GetIntentByHashRequest as av, type GetIntentByHashResponse as aw, type RegisterPayeeDetailsRequest as ax, type RegisterPayeeDetailsResponse as ay, type SellerPlatform as az, type SellerCredentialUploadInput as b, type RateManagerOrderField as b$, type AttestationServiceSellerCredentialProbeResponse as b0, type BuyerTeePaymentParams as b1, type BuyerTeePaymentProofInput as b2, type BuyerTeeSessionMaterial as b3, type CuratorSellerCredentialStatusResponse as b4, type CuratorSellerVerifyResponse as b5, type RegisteredSellerCredentialPlatform as b6, type UploadSellerCredentialParams as b7, type RegisteredUploadSellerCredentialParams as b8, type UploadSellerCredentialOptions as b9, fetchFulfillmentAndPayment as bA, type DepositEntity$1 as bB, type IntentFulfilledEntity as bC, type IntentFulfillmentAmountsEntity as bD, type DepositPaymentMethodEntity$1 as bE, type MethodCurrencyEntity$1 as bF, type IntentStatus as bG, type RateManagerEntity as bH, type RateManagerRateEntity as bI, type RateManagerDelegationEntity as bJ, type ManagerAggregateStatsEntity as bK, type ManagerStatsEntity as bL, type ManagerDailySnapshotEntity as bM, type RateManagerListItem as bN, type RateManagerDetail as bO, type ManualRateUpdateEntity as bP, type OracleConfigUpdateEntity as bQ, type DepositFundActivityEntity$1 as bR, type DepositDailySnapshotEntity$1 as bS, type DepositFundActivityType$1 as bT, type DepositFilter as bU, type PaginationOptions as bV, type DepositOrderField as bW, type OrderDirection$1 as bX, type RateManagerFilter as bY, type RateManagerPaginationOptions as bZ, type RateManagerDelegationPaginationOptions as b_, type GetSellerCredentialStatusParams as ba, type UploadPayPalGoogleOAuthSellerCredentialParams as bb, type UploadVenmoGoogleOAuthSellerCredentialParams as bc, type UploadGoogleOAuthSellerCredentialParams as bd, type VerifySellerPaymentParams as be, type IdentityAttestationActionType as bf, type IdentityAttestationOutput as bg, type IdentityAttestationOutputFor as bh, type IdentityAttestationParams as bi, type MakerIdentityAttestationRequestBody as bj, type MakerIdentityPlatform as bk, type OnchainCurrency as bl, type DepositVerifierData as bm, type PreparedTransaction as bn, type OrderStats as bo, type DepositIntentStatistics as bp, type TakerTier as bq, type TakerTierStats as br, type PlatformLimit as bs, type PlatformRiskLevel as bt, type OrderbookEntry as bu, IndexerClient as bv, defaultIndexerEndpoint as bw, IndexerDepositService as bx, IndexerRateManagerService as by, compareEventCursorIdsByRecency as bz, type SellerCredentialUploadPlatform as c, type OrderDirection as c0, type DeploymentEnv as c1, type FulfillmentRecord as c2, type PaymentVerifiedRecord as c3, type FulfillmentAndPaymentResponse as c4, PAYMENT_PLATFORMS as c5, type PaymentPlatformType as c6, Currency as c7, currencyInfo as c8, getCurrencyInfoFromHash as c9, classifyDelegationState as cA, type DelegationRoute as cB, type DelegationState as cC, type DelegationDepositTarget as cD, type BatchResult as cE, type SendTransactionFn as cF, type SendBatchFn as cG, ZERO_ADDRESS as cH, asErrorMessage as cI, assertDelegationMethodSupport as cJ, getCurrencyInfoFromCountryCode as ca, getCurrencyCodeFromHash as cb, isSupportedCurrencyHash as cc, mapConversionRatesToOnchainMinRate as cd, type CurrencyData as ce, getContracts as cf, getRateManagerContracts as cg, getPaymentMethodsCatalog as ch, getGatingServiceAddress as ci, type RuntimeEnv as cj, parseDepositView as ck, parseIntentView as cl, enrichPvDepositView as cm, enrichPvIntentView as cn, type PV_DepositView as co, type PV_Deposit as cp, type PV_PaymentMethodData as cq, type PV_Currency as cr, type PV_ReferralFee as cs, type PV_IntentView as ct, type PV_Intent as cu, ZERO_RATE_MANAGER_ID as cv, isZeroRateManagerId as cw, normalizeRateManagerId as cx, normalizeRegistry as cy, getDelegationRoute as cz, type SellerCredentialAttestationRuntime as d, type AttestationServiceSellerCredentialUploadResponse as e, type GoogleOAuthSellerCredentialUploadBodyByPlatform as f, type BestByPlatformResponse as g, type ValidatePayeeDetailsResponse as h, type PostDepositDetailsResponse as i, type GetPayeeDetailsRequest as j, type GetPayeeDetailsResponse as k, type GetOwnerDepositsRequest as l, type GetOwnerDepositsResponse as m, type GetTakerTierRequest as n, type GetTakerTierResponse as o, type GetDepositBundleParams as p, type ApiAdapterOptions as q, type GetDepositBundleResponse as r, type GetOrderbookParams as s, type GetOrderbookResponse as t, type CurrencyType as u, type PaymentMethodCatalog as v, type TxOverrides as w, type SignalIntentReferralFee as x, type SignalIntentMethodParams as y, type CancelIntentMethodParams as z };
|
|
@@ -959,8 +959,6 @@ type TimeoutConfig = {
|
|
|
959
959
|
type ApiAdapterOptions = {
|
|
960
960
|
baseApiUrl: string;
|
|
961
961
|
timeoutMs?: number;
|
|
962
|
-
apiKey?: string;
|
|
963
|
-
authToken?: string;
|
|
964
962
|
};
|
|
965
963
|
type AuthorizationTokenProvider = () => string | null | undefined | Promise<string | null | undefined>;
|
|
966
964
|
/**
|
|
@@ -1922,7 +1920,7 @@ type PaymentPlatformType = (typeof PAYMENT_PLATFORMS)[number];
|
|
|
1922
1920
|
* walletClient,
|
|
1923
1921
|
* chainId: 8453, // Base mainnet
|
|
1924
1922
|
* runtimeEnv: 'production',
|
|
1925
|
-
* // apiKey: '
|
|
1923
|
+
* // apiKey: 'internal-curator-api-key', // Optional: internal seller verification only
|
|
1926
1924
|
* indexerApiKey: 'your-indexer-key',
|
|
1927
1925
|
* };
|
|
1928
1926
|
* ```
|
|
@@ -1941,12 +1939,11 @@ type Zkp2pNextOptions = {
|
|
|
1941
1939
|
/** Base API URL for ZKP2P services (defaults to https://api.zkp2p.xyz) */
|
|
1942
1940
|
baseApiUrl?: string;
|
|
1943
1941
|
/**
|
|
1944
|
-
* Optional curator API key (sent as `x-api-key`) for
|
|
1945
|
-
*
|
|
1946
|
-
* Not used by `registerPayeeDetails` or `getTakerTier`.
|
|
1942
|
+
* Optional internal curator API key (sent as `x-api-key`) for internal seller verification.
|
|
1943
|
+
* Not used by public curator endpoints such as quotes, maker reads, or intent signing.
|
|
1947
1944
|
*/
|
|
1948
1945
|
apiKey?: string;
|
|
1949
|
-
/** Optional bearer token for
|
|
1946
|
+
/** Optional bearer token for indexer authentication */
|
|
1950
1947
|
authorizationToken?: string;
|
|
1951
1948
|
/** Optional async token provider for indexer auth in long-lived clients */
|
|
1952
1949
|
getAuthorizationToken?: IndexerAuthTokenProvider;
|
|
@@ -2195,9 +2192,9 @@ declare class Zkp2pClient {
|
|
|
2195
2192
|
readonly orchestratorRegistryAbi?: Abi;
|
|
2196
2193
|
/** Base API URL for ZKP2P services */
|
|
2197
2194
|
readonly baseApiUrl?: string;
|
|
2198
|
-
/** Optional curator API key (`x-api-key`) for
|
|
2195
|
+
/** Optional internal curator API key (`x-api-key`) for internal seller verification */
|
|
2199
2196
|
readonly apiKey?: string;
|
|
2200
|
-
/** Bearer token for
|
|
2197
|
+
/** Bearer token for indexer authentication */
|
|
2201
2198
|
readonly authorizationToken?: string;
|
|
2202
2199
|
/** API timeout in milliseconds */
|
|
2203
2200
|
readonly apiTimeoutMs: number;
|
|
@@ -3158,9 +3155,9 @@ declare class Zkp2pClient {
|
|
|
3158
3155
|
* sending fiat payment to the deposit's payee.
|
|
3159
3156
|
*
|
|
3160
3157
|
* If `gatingServiceSignature` is not provided, the SDK will automatically
|
|
3161
|
-
* fetch one from curator `/v3/intent/sign` when `
|
|
3162
|
-
*
|
|
3163
|
-
*
|
|
3158
|
+
* fetch one from curator `/v3/intent/sign` when `baseApiUrl` is configured.
|
|
3159
|
+
* Otherwise you must provide `gatingServiceSignature` and `signatureExpiration`
|
|
3160
|
+
* yourself.
|
|
3164
3161
|
*
|
|
3165
3162
|
* **Prepare Mode**: Use `.prepare()` to get the transaction calldata without sending:
|
|
3166
3163
|
* ```typescript
|
|
@@ -3412,8 +3409,8 @@ declare class Zkp2pClient {
|
|
|
3412
3409
|
/**
|
|
3413
3410
|
* **Supporting Method** - Fetches the best available quote per supported payment platform.
|
|
3414
3411
|
*
|
|
3415
|
-
* Returns one quote per platform when available.
|
|
3416
|
-
*
|
|
3412
|
+
* Returns one quote per platform when available. The API returns payee details
|
|
3413
|
+
* in each platform's best quote when available.
|
|
3417
3414
|
*
|
|
3418
3415
|
* @param req - Best-by-platform quote request parameters
|
|
3419
3416
|
* @param opts - Optional overrides for API URL and timeout
|
|
@@ -3480,8 +3477,8 @@ declare class Zkp2pClient {
|
|
|
3480
3477
|
timeoutMs?: number;
|
|
3481
3478
|
}): Promise<CuratorSellerCredentialStatusResponse>;
|
|
3482
3479
|
/**
|
|
3483
|
-
* Internal-use endpoint. The curator route requires an internal `x-api-key`;
|
|
3484
|
-
* API keys will be rejected
|
|
3480
|
+
* Internal-use endpoint. The curator route requires an internal `x-api-key`; non-internal
|
|
3481
|
+
* API keys will be rejected. Returns 410 GONE when curator has marked the credential inactive
|
|
3485
3482
|
* or a stale credential fails its synchronous re-probe.
|
|
3486
3483
|
*
|
|
3487
3484
|
* Verify a seller payment via curator's seller-credential proxy.
|
|
@@ -3592,6 +3589,7 @@ declare class Zkp2pClient {
|
|
|
3592
3589
|
intentTimestampMs: string;
|
|
3593
3590
|
paymentMethodHash: `0x${string}`;
|
|
3594
3591
|
paymentVerifier?: `0x${string}`;
|
|
3592
|
+
minimumReleaseAmount?: string;
|
|
3595
3593
|
}>;
|
|
3596
3594
|
}
|
|
3597
3595
|
|
|
@@ -3652,4 +3650,4 @@ type SendBatchFn = (txs: Array<{
|
|
|
3652
3650
|
value?: bigint;
|
|
3653
3651
|
}>) => Promise<string>;
|
|
3654
3652
|
|
|
3655
|
-
export { type
|
|
3653
|
+
export { type BestByPlatformResponseObject as $, type AttestationServiceIdentityResponse as A, type BuyerTeeSessionMaterialEncryptionInput as B, type CuratorSellerCredentialUploadResponse as C, type DepositWithRelations as D, type Zkp2pNextOptions as E, type FulfillIntentMethodParams as F, type GoogleOAuthSellerCredentialPlatform as G, type AuthorizationTokenProvider as H, type IntentEntity$1 as I, type TimeoutConfig as J, type ActionCallback as K, type CreateDepositParams as L, type CreateDepositConversionRate as M, type Range as N, type SignalIntentParams as O, type PostDepositDetailsRequest as P, type QuotesBestByPlatformRequest as Q, type ReferrerFeeConfig as R, type SellerCredentialBundle as S, type TakerTierLevel as T, type UploadSellerCredentialBundleParams as U, type ValidatePayeeDetailsRequest as V, type WithdrawDepositParams as W, type FulfillIntentParams as X, type ReleaseFundsToPayerParams as Y, Zkp2pClient as Z, type CancelIntentParams as _, type IdentityAttestationRequestBody as a, type FulfillIntentAttestationResponse as a$, type GetBestByPlatformResponse as a0, type GetBestByPlatformResponseObject as a1, type GetPlatformQuote as a2, type PlatformQuote as a3, type QuoteRequest as a4, type GetNearbyQuote as a5, type GetNearbySuggestions as a6, type GetQuoteResponse as a7, type GetQuoteResponseObject as a8, type GetQuoteSingleResponse as a9, type VenmoSessionMaterial as aA, type CashAppSessionMaterial as aB, type WiseSessionMaterial as aC, type WiseProfileInfo as aD, type WiseProfileSelectionRequired as aE, type WiseProfileNotFound as aF, type PayPalGoogleOAuthSellerCredentialUploadBody as aG, type VenmoGoogleOAuthSellerCredentialUploadBody as aH, type VenmoCredentialUploadInput as aI, type CashAppCredentialUploadInput as aJ, type WiseCredentialUploadInput as aK, type SellerCredentialUploadInputByPlatform as aL, type SellerCiphertextBundle as aM, type SellerSignedCiphertextBundle as aN, type SellerVerifyIntentDetails as aO, type SellerVerifyInput as aP, type SellerProbeInput as aQ, type SellerCredentialBundleUpload as aR, type SellerCredentialStatusValue as aS, type SellerCredentialStatus as aT, type SellerVerifyProxyBody as aU, type SellerTypedDataField as aV, type SellerTypedDataSpec as aW, type SellerPaymentTypedDataValue as aX, type SellerAttestationOutput as aY, type SellerCredentialProbeResponse as aZ, type AttestationServiceSellerVerifyResponse as a_, type QuoteResponse as aa, type QuoteResponseObject as ab, type QuoteSingleResponse as ac, type QuoteIntentResponse as ad, type QuoteFeesResponse as ae, type FiatResponse as af, type TokenResponse as ag, type NearbyQuote as ah, type NearbySuggestions as ai, type ApiDeposit as aj, type DepositVerifier as ak, type DepositVerifierCurrency as al, type DepositStatus as am, type GetDepositByIdRequest as an, type GetDepositByIdResponse as ao, type Intent as ap, type ApiIntentStatus as aq, type GetOwnerIntentsRequest as ar, type GetOwnerIntentsResponse as as, type GetIntentsByDepositRequest as at, type GetIntentsByDepositResponse as au, type GetIntentByHashRequest as av, type GetIntentByHashResponse as aw, type RegisterPayeeDetailsRequest as ax, type RegisterPayeeDetailsResponse as ay, type SellerPlatform as az, type SellerCredentialUploadInput as b, type RateManagerOrderField as b$, type AttestationServiceSellerCredentialProbeResponse as b0, type BuyerTeePaymentParams as b1, type BuyerTeePaymentProofInput as b2, type BuyerTeeSessionMaterial as b3, type CuratorSellerCredentialStatusResponse as b4, type CuratorSellerVerifyResponse as b5, type RegisteredSellerCredentialPlatform as b6, type UploadSellerCredentialParams as b7, type RegisteredUploadSellerCredentialParams as b8, type UploadSellerCredentialOptions as b9, fetchFulfillmentAndPayment as bA, type DepositEntity$1 as bB, type IntentFulfilledEntity as bC, type IntentFulfillmentAmountsEntity as bD, type DepositPaymentMethodEntity$1 as bE, type MethodCurrencyEntity$1 as bF, type IntentStatus as bG, type RateManagerEntity as bH, type RateManagerRateEntity as bI, type RateManagerDelegationEntity as bJ, type ManagerAggregateStatsEntity as bK, type ManagerStatsEntity as bL, type ManagerDailySnapshotEntity as bM, type RateManagerListItem as bN, type RateManagerDetail as bO, type ManualRateUpdateEntity as bP, type OracleConfigUpdateEntity as bQ, type DepositFundActivityEntity$1 as bR, type DepositDailySnapshotEntity$1 as bS, type DepositFundActivityType$1 as bT, type DepositFilter as bU, type PaginationOptions as bV, type DepositOrderField as bW, type OrderDirection$1 as bX, type RateManagerFilter as bY, type RateManagerPaginationOptions as bZ, type RateManagerDelegationPaginationOptions as b_, type GetSellerCredentialStatusParams as ba, type UploadPayPalGoogleOAuthSellerCredentialParams as bb, type UploadVenmoGoogleOAuthSellerCredentialParams as bc, type UploadGoogleOAuthSellerCredentialParams as bd, type VerifySellerPaymentParams as be, type IdentityAttestationActionType as bf, type IdentityAttestationOutput as bg, type IdentityAttestationOutputFor as bh, type IdentityAttestationParams as bi, type MakerIdentityAttestationRequestBody as bj, type MakerIdentityPlatform as bk, type OnchainCurrency as bl, type DepositVerifierData as bm, type PreparedTransaction as bn, type OrderStats as bo, type DepositIntentStatistics as bp, type TakerTier as bq, type TakerTierStats as br, type PlatformLimit as bs, type PlatformRiskLevel as bt, type OrderbookEntry as bu, IndexerClient as bv, defaultIndexerEndpoint as bw, IndexerDepositService as bx, IndexerRateManagerService as by, compareEventCursorIdsByRecency as bz, type SellerCredentialUploadPlatform as c, type OrderDirection as c0, type DeploymentEnv as c1, type FulfillmentRecord as c2, type PaymentVerifiedRecord as c3, type FulfillmentAndPaymentResponse as c4, PAYMENT_PLATFORMS as c5, type PaymentPlatformType as c6, Currency as c7, currencyInfo as c8, getCurrencyInfoFromHash as c9, classifyDelegationState as cA, type DelegationRoute as cB, type DelegationState as cC, type DelegationDepositTarget as cD, type BatchResult as cE, type SendTransactionFn as cF, type SendBatchFn as cG, ZERO_ADDRESS as cH, asErrorMessage as cI, assertDelegationMethodSupport as cJ, getCurrencyInfoFromCountryCode as ca, getCurrencyCodeFromHash as cb, isSupportedCurrencyHash as cc, mapConversionRatesToOnchainMinRate as cd, type CurrencyData as ce, getContracts as cf, getRateManagerContracts as cg, getPaymentMethodsCatalog as ch, getGatingServiceAddress as ci, type RuntimeEnv as cj, parseDepositView as ck, parseIntentView as cl, enrichPvDepositView as cm, enrichPvIntentView as cn, type PV_DepositView as co, type PV_Deposit as cp, type PV_PaymentMethodData as cq, type PV_Currency as cr, type PV_ReferralFee as cs, type PV_IntentView as ct, type PV_Intent as cu, ZERO_RATE_MANAGER_ID as cv, isZeroRateManagerId as cw, normalizeRateManagerId as cx, normalizeRegistry as cy, getDelegationRoute as cz, type SellerCredentialAttestationRuntime as d, type AttestationServiceSellerCredentialUploadResponse as e, type GoogleOAuthSellerCredentialUploadBodyByPlatform as f, type BestByPlatformResponse as g, type ValidatePayeeDetailsResponse as h, type PostDepositDetailsResponse as i, type GetPayeeDetailsRequest as j, type GetPayeeDetailsResponse as k, type GetOwnerDepositsRequest as l, type GetOwnerDepositsResponse as m, type GetTakerTierRequest as n, type GetTakerTierResponse as o, type GetDepositBundleParams as p, type ApiAdapterOptions as q, type GetDepositBundleResponse as r, type GetOrderbookParams as s, type GetOrderbookResponse as t, type CurrencyType as u, type PaymentMethodCatalog as v, type TxOverrides as w, type SignalIntentReferralFee as x, type SignalIntentMethodParams as y, type CancelIntentMethodParams as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zkp2p/sdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
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",
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"@zkp2p/indexer-schema": "0.2.3",
|
|
91
|
-
"@zkp2p/contracts-v2": "0.2.
|
|
92
|
-
"@zkp2p/zkp2p-attestation": "1.
|
|
91
|
+
"@zkp2p/contracts-v2": "0.2.4",
|
|
92
|
+
"@zkp2p/zkp2p-attestation": "1.6.2",
|
|
93
93
|
"ethers": "^6.0.0",
|
|
94
94
|
"ox": "^0.11.1"
|
|
95
95
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/hooks/vaultUtils.ts"],"names":[],"mappings":"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","file":"chunk-LPJE2MN7.mjs","sourcesContent":["import type { Address, Hex } from 'viem';\nimport type { PreparedTransaction } from '../../types/prepared';\n\n// ---------------------------------------------------------------------------\n// Constants\n// ---------------------------------------------------------------------------\n\nexport const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' as const;\nexport const ZERO_RATE_MANAGER_ID =\n '0x0000000000000000000000000000000000000000000000000000000000000000' as const;\n\n// ---------------------------------------------------------------------------\n// Normalizers\n// ---------------------------------------------------------------------------\n\nexport const normalizeRateManagerId = (value?: string | null): string =>\n (value ?? ZERO_RATE_MANAGER_ID).toLowerCase();\n\nexport const normalizeRegistry = (value?: string | null): string =>\n (value ?? ZERO_ADDRESS).toLowerCase();\n\nexport const isZeroRateManagerId = (value?: string | null): boolean => {\n if (!value) return true;\n const normalized = value.toLowerCase();\n return normalized === ZERO_ADDRESS || normalized === ZERO_RATE_MANAGER_ID;\n};\n\n// ---------------------------------------------------------------------------\n// Error helper\n// ---------------------------------------------------------------------------\n\nexport const asErrorMessage = (error: unknown): string => {\n if (!error) return 'Unknown error';\n if (error instanceof Error) return error.message;\n if (typeof error === 'string') return error;\n\n const anyErr = error as Record<string, unknown>;\n if (typeof anyErr.shortMessage === 'string') return anyErr.shortMessage;\n if (typeof anyErr.details === 'string') return anyErr.details;\n if (typeof anyErr.message === 'string') return anyErr.message;\n\n try {\n return JSON.stringify(error);\n } catch {\n return String(error);\n }\n};\n\n// ---------------------------------------------------------------------------\n// Delegation state classification\n// ---------------------------------------------------------------------------\n\nexport type DelegationState = 'delegated_here' | 'delegated_elsewhere' | 'not_delegated';\n\n/**\n * Classify whether a deposit is delegated to the target vault, delegated\n * elsewhere, or not delegated at all.\n *\n * @param currentRateManagerId The deposit's current rateManagerId (from indexer)\n * @param currentRegistry The deposit's current rateManagerAddress / registry (from indexer)\n * @param targetRateManagerId The vault's rateManagerId we're comparing against\n * @param targetRegistry The vault's registry address we're comparing against\n */\nexport const classifyDelegationState = (\n currentRateManagerId: string | null | undefined,\n currentRegistry: string | null | undefined,\n targetRateManagerId: string,\n targetRegistry: string | null | undefined,\n): DelegationState => {\n if (isZeroRateManagerId(currentRateManagerId)) {\n return 'not_delegated';\n }\n\n const normalizedCurrent = normalizeRateManagerId(currentRateManagerId);\n const normalizedTarget = targetRateManagerId.toLowerCase();\n const normalizedCurrentRegistry = normalizeRegistry(currentRegistry);\n const normalizedTargetRegistry = targetRegistry ? targetRegistry.toLowerCase() : '';\n\n const idsMatch = normalizedCurrent === normalizedTarget;\n const registryMatches = normalizedTargetRegistry\n ? normalizedCurrentRegistry === normalizedTargetRegistry\n : true;\n\n if (idsMatch && registryMatches) {\n return 'delegated_here';\n }\n\n return 'delegated_elsewhere';\n};\n\nexport const assertAtomicDelegationSwitchSupport = (\n requiresSwitch: boolean,\n canBatch: boolean,\n): void => {\n if (!requiresSwitch || canBatch) return;\n throw new Error(\n 'Switching delegation targets requires smart-account batching. Clear the existing delegation first.',\n );\n};\n\n// ---------------------------------------------------------------------------\n// Contract routing\n// ---------------------------------------------------------------------------\n\nexport type DelegationRoute = 'v2';\n\nexport const getDelegationRoute = (_client: unknown, _escrow: Address): DelegationRoute => 'v2';\n\ntype DelegationMethodSupportClient = Partial<\n Record<'setRateManager' | 'clearRateManager', { prepare?: unknown }>\n>;\n\nexport const assertDelegationMethodSupport = (\n client: DelegationMethodSupportClient,\n _route: DelegationRoute,\n action: 'set' | 'clear',\n): void => {\n const method = action === 'set' ? 'setRateManager' : 'clearRateManager';\n if (client?.[method]?.prepare) return;\n throw new Error(`Delegation requires SDK ${method} support`);\n};\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface DelegationDepositTarget {\n compositeDepositId: string;\n escrow: Address;\n depositId: bigint;\n currentRateManagerId?: string | null;\n currentRateManagerRegistry?: string | null;\n}\n\nexport interface BatchResult {\n hashes: string[];\n failed: Array<{ compositeDepositId: string; error: string }>;\n}\n\n/**\n * Callback the consumer provides for sending a single prepared transaction.\n * Returns the transaction hash.\n */\nexport type SendTransactionFn = (tx: { to: Address; data: Hex; value?: bigint }) => Promise<string>;\n\n/**\n * Optional callback for batching multiple calls in a single user operation\n * (e.g. via a smart account). If not provided, transactions are sent\n * sequentially via sendTransaction.\n */\nexport type SendBatchFn = (\n txs: Array<{ to: Address; data: Hex; value?: bigint }>,\n) => Promise<string>;\n\n// ---------------------------------------------------------------------------\n// Prepare helpers (used internally by hooks)\n// ---------------------------------------------------------------------------\n\nexport const prepareClearDelegationTx = async (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n client: any,\n params: { escrow: Address; depositId: bigint },\n referrer?: string | string[],\n): Promise<PreparedTransaction> => {\n const route = getDelegationRoute(client, params.escrow);\n assertDelegationMethodSupport(client, route, 'clear');\n return client.clearRateManager.prepare({\n escrowAddress: params.escrow,\n depositId: params.depositId,\n ...(referrer ? { txOverrides: { referrer } } : {}),\n });\n};\n\nexport const prepareSetDelegationTx = async (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n client: any,\n params: {\n escrow: Address;\n depositId: bigint;\n registry: Address;\n rateManagerId: Hex;\n },\n referrer?: string | string[],\n): Promise<PreparedTransaction> => {\n const route = getDelegationRoute(client, params.escrow);\n assertDelegationMethodSupport(client, route, 'set');\n return client.setRateManager.prepare({\n escrowAddress: params.escrow,\n depositId: params.depositId,\n rateManagerAddress: params.registry,\n rateManagerId: params.rateManagerId,\n ...(referrer ? { txOverrides: { referrer } } : {}),\n });\n};\n"]}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { enrichPvDepositView, enrichPvIntentView, parseDepositView, parseIntentView } from './chunk-L526MKG3.mjs';
|
|
2
|
-
import './chunk-ZFBH4HD7.mjs';
|
|
3
|
-
import './chunk-J5LGTIGS.mjs';
|
|
4
|
-
//# sourceMappingURL=protocolViewerParsers-GGSM2243.mjs.map
|
|
5
|
-
//# sourceMappingURL=protocolViewerParsers-GGSM2243.mjs.map
|