@zkp2p/sdk 0.5.0 → 0.5.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 +10 -6
- package/dist/{chunk-LPJE2MN7.mjs → chunk-TGMRXUP2.mjs} +28 -3
- package/dist/chunk-TGMRXUP2.mjs.map +1 -0
- package/dist/{chunk-L526MKG3.mjs → chunk-VJ33XYCV.mjs} +123 -128
- package/dist/{chunk-L526MKG3.mjs.map → chunk-VJ33XYCV.mjs.map} +1 -1
- package/dist/index.cjs +401 -397
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +44 -21
- package/dist/index.d.ts +44 -21
- package/dist/index.mjs +200 -209
- package/dist/index.mjs.map +1 -1
- package/dist/protocolViewerParsers-XN63B2S5.mjs +5 -0
- package/dist/{protocolViewerParsers-GGSM2243.mjs.map → protocolViewerParsers-XN63B2S5.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-BL8tzsmH.d.mts → vaultUtils-DOOl9QUP.d.mts} +35 -67
- package/dist/{vaultUtils-BL8tzsmH.d.ts → vaultUtils-DOOl9QUP.d.ts} +35 -67
- package/package.json +3 -3
- package/dist/chunk-LPJE2MN7.mjs.map +0 -1
- package/dist/protocolViewerParsers-GGSM2243.mjs +0 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { R as ReferrerFeeConfig, S as SellerCredentialBundle, D as DepositWithRelations, I as IntentEntity, a as IdentityAttestationRequestBody, A as AttestationServiceIdentityResponse, b as SellerCredentialUploadInput, c as
|
|
2
|
-
export { K as ActionCallback, aj as ApiDeposit, aq as ApiIntentStatus,
|
|
1
|
+
import { R as ReferrerFeeConfig, S as SellerCredentialBundle, D as DepositWithRelations, I as IntentEntity, a as IdentityAttestationRequestBody, A as AttestationServiceIdentityResponse, b as SellerCredentialUploadInput, c as SellerCredentialUploadPlatform, d as SellerCredentialAttestationRuntime, e as AttestationServiceSellerCredentialUploadResponse, B as BuyerTeeSessionMaterialEncryptionInput, U as UploadSellerCredentialBundleParams, C as CuratorSellerCredentialUploadResponse, G as GoogleOAuthSellerCredentialPlatform, f as GoogleOAuthSellerCredentialUploadBodyByPlatform, Q as QuotesBestByPlatformRequest, g as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, h as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, i as PostDepositDetailsResponse, j as GetPayeeDetailsRequest, k as GetPayeeDetailsResponse, l as GetOwnerDepositsRequest, m as GetOwnerDepositsResponse, n as GetTakerTierRequest, o as GetTakerTierResponse, p as GetDepositBundleParams, q as ApiAdapterOptions, r as GetDepositBundleResponse, s as GetOrderbookParams, t as GetOrderbookResponse, u as CurrencyType, T as TakerTierLevel, v as PaymentMethodCatalog, w as TxOverrides } from './vaultUtils-DOOl9QUP.mjs';
|
|
2
|
+
export { K as ActionCallback, aj as ApiDeposit, aq as ApiIntentStatus, b0 as AttestationServiceSellerCredentialProbeResponse, a_ as AttestationServiceSellerVerifyResponse, H as AuthorizationTokenProvider, cE as BatchResult, $ as BestByPlatformResponseObject, b1 as BuyerTeePaymentParams, b2 as BuyerTeePaymentProofInput, b3 as BuyerTeeSessionMaterial, z as CancelIntentMethodParams, _ as CancelIntentParams, aJ as CashAppCredentialUploadInput, aB as CashAppSessionMaterial, M as CreateDepositConversionRate, L as CreateDepositParams, b4 as CuratorSellerCredentialStatusResponse, b5 as CuratorSellerVerifyResponse, c7 as Currency, ce as CurrencyData, cD as DelegationDepositTarget, cB as DelegationRoute, cC as DelegationState, cp as Deposit, cr as DepositCurrency, bp as DepositIntentStatistics, am as DepositStatus, ak as DepositVerifier, al as DepositVerifierCurrency, bm as DepositVerifierData, co as DepositView, af as FiatResponse, a$ as FulfillIntentAttestationResponse, F as FulfillIntentMethodParams, X as FulfillIntentParams, a0 as GetBestByPlatformResponse, a1 as GetBestByPlatformResponseObject, an as GetDepositByIdRequest, ao as GetDepositByIdResponse, av as GetIntentByHashRequest, aw as GetIntentByHashResponse, at as GetIntentsByDepositRequest, au as GetIntentsByDepositResponse, a5 as GetNearbyQuote, a6 as GetNearbySuggestions, ar as GetOwnerIntentsRequest, as as GetOwnerIntentsResponse, a2 as GetPlatformQuote, a7 as GetQuoteResponse, a8 as GetQuoteResponseObject, a9 as GetQuoteSingleResponse, ba as GetSellerCredentialStatusParams, bf as IdentityAttestationActionType, bg as IdentityAttestationOutput, bh as IdentityAttestationOutputFor, bi as IdentityAttestationParams, bv as IndexerClient, c1 as IndexerDeploymentEnv, bB as IndexerDeposit, bS as IndexerDepositDailySnapshot, bU as IndexerDepositFilter, bR as IndexerDepositFundActivity, bT as IndexerDepositFundActivityType, bX as IndexerDepositOrderDirection, bW as IndexerDepositOrderField, bV as IndexerDepositPagination, bE as IndexerDepositPaymentMethod, bx as IndexerDepositService, c4 as IndexerFulfillmentAndPaymentResponse, c2 as IndexerFulfillmentRecord, bC as IndexerIntentFulfilled, bD as IndexerIntentFulfillmentAmounts, bG as IndexerIntentStatus, bK as IndexerManagerAggregateStats, bM as IndexerManagerDailySnapshot, bL as IndexerManagerStats, bP as IndexerManualRateUpdate, bF as IndexerMethodCurrency, bQ as IndexerOracleConfigUpdate, c3 as IndexerPaymentVerifiedRecord, bH as IndexerRateManager, bJ as IndexerRateManagerDelegation, b_ as IndexerRateManagerDelegationPagination, bO as IndexerRateManagerDetail, bY as IndexerRateManagerFilter, bN as IndexerRateManagerListItem, c0 as IndexerRateManagerOrderDirection, b$ as IndexerRateManagerOrderField, bZ as IndexerRateManagerPagination, bI as IndexerRateManagerRate, by as IndexerRateManagerService, ap as Intent, ct as IntentView, bj as MakerIdentityAttestationRequestBody, bk as MakerIdentityPlatform, ah as NearbyQuote, ai as NearbySuggestions, Z as OfframpClient, bl as OnchainCurrency, cu as OnchainIntent, bo as OrderStats, bu as OrderbookEntry, c5 as PAYMENT_PLATFORMS, aG as PayPalGoogleOAuthSellerCredentialUploadBody, cq as PaymentMethodData, c6 as PaymentPlatformType, bs as PlatformLimit, a3 as PlatformQuote, bt as PlatformRiskLevel, bn as PreparedTransaction, ae as QuoteFeesResponse, ad as QuoteIntentResponse, a4 as QuoteRequest, aa as QuoteResponse, ab as QuoteResponseObject, ac as QuoteSingleResponse, N as Range, cs as ReferralFee, ax as RegisterPayeeDetailsRequest, ay as RegisterPayeeDetailsResponse, b6 as RegisteredSellerCredentialPlatform, b8 as RegisteredUploadSellerCredentialParams, Y as ReleaseFundsToPayerParams, cj as RuntimeEnv, aY as SellerAttestationOutput, aM as SellerCiphertextBundle, aR as SellerCredentialBundleUpload, aZ as SellerCredentialProbeResponse, aT as SellerCredentialStatus, aS as SellerCredentialStatusValue, aL as SellerCredentialUploadInputByPlatform, aX as SellerPaymentTypedDataValue, az as SellerPlatform, aQ as SellerProbeInput, aN as SellerSignedCiphertextBundle, aV as SellerTypedDataField, aW as SellerTypedDataSpec, aP as SellerVerifyInput, aO as SellerVerifyIntentDetails, aU as SellerVerifyProxyBody, cG as SendBatchFn, cF as SendTransactionFn, y as SignalIntentMethodParams, O as SignalIntentParams, x as SignalIntentReferralFee, bq as TakerTier, br as TakerTierStats, J as TimeoutConfig, ag as TokenResponse, bd as UploadGoogleOAuthSellerCredentialParams, bb as UploadPayPalGoogleOAuthSellerCredentialParams, b9 as UploadSellerCredentialOptions, b7 as UploadSellerCredentialParams, bc as UploadVenmoGoogleOAuthSellerCredentialParams, aI as VenmoCredentialUploadInput, aH as VenmoGoogleOAuthSellerCredentialUploadBody, aA as VenmoSessionMaterial, be as VerifySellerPaymentParams, aK as WiseCredentialUploadInput, aD as WiseProfileInfo, aF as WiseProfileNotFound, aE as WiseProfileSelectionRequired, aC as WiseSessionMaterial, W as WithdrawDepositParams, cv as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, E as Zkp2pClientOptions, cA as classifyDelegationState, bz as compareEventCursorIdsByRecency, c8 as currencyInfo, bw as defaultIndexerEndpoint, cm as enrichPvDepositView, cn as enrichPvIntentView, bA as fetchIndexerFulfillmentAndPayment, cf as getContracts, cb as getCurrencyCodeFromHash, ca as getCurrencyInfoFromCountryCode, c9 as getCurrencyInfoFromHash, cz as getDelegationRoute, ci as getGatingServiceAddress, ch as getPaymentMethodsCatalog, cg as getRateManagerContracts, cc as isSupportedCurrencyHash, cw as isZeroRateManagerId, cd as mapConversionRatesToOnchainMinRate, cx as normalizeRateManagerId, cy as normalizeRegistry, ck as parseDepositView, cl as parseIntentView } from './vaultUtils-DOOl9QUP.mjs';
|
|
3
3
|
import { Address, Hash, Hex, WalletClient } from 'viem';
|
|
4
4
|
import { Abi } from 'abitype';
|
|
5
|
-
export { IdentityActionType, IdentityActionTypeByPlatform,
|
|
5
|
+
export { IdentityActionType, IdentityActionTypeByPlatform, IdentityParamsByPlatform, IdentityPlatform, NitroAttestationClient, NitroAttestationClientOptions, NitroAttestationEnvironment, VerifiedAttestation, VerifiedAttestationPayload, createNitroAttestationClient } from '@zkp2p/zkp2p-attestation';
|
|
6
6
|
import '@zkp2p/indexer-schema';
|
|
7
7
|
|
|
8
8
|
interface EscrowRange {
|
|
@@ -132,6 +132,7 @@ type PeerMetadataProviderConfig = Record<string, unknown>;
|
|
|
132
132
|
type PeerAuthenticateParams = {
|
|
133
133
|
actionType: string;
|
|
134
134
|
attestationActionType?: string | null;
|
|
135
|
+
attestationPlatform?: string | null;
|
|
135
136
|
attestationServiceUrl?: string | null;
|
|
136
137
|
captureMode?: PeerMetadataCaptureMode;
|
|
137
138
|
platform: string;
|
|
@@ -208,39 +209,29 @@ declare function convertIndexerIntentsToEscrowViews(intents: IntentEntity[], dep
|
|
|
208
209
|
|
|
209
210
|
declare function apiRequestIdentityAttestation(payload: IdentityAttestationRequestBody, attestationServiceUrl: string, platform: string, actionType: string): Promise<AttestationServiceIdentityResponse>;
|
|
210
211
|
declare function createEncryptedBuyerTeeSessionMaterial({ actionType, attestationRuntime, attestationServiceUrl, platform, sessionMaterial, timeoutMs, }: BuyerTeeSessionMaterialEncryptionInput): Promise<string>;
|
|
211
|
-
declare function apiCreateSellerCredentialBundle(payload: SellerCredentialUploadInput, attestationServiceUrl: string, platform:
|
|
212
|
+
declare function apiCreateSellerCredentialBundle(payload: SellerCredentialUploadInput, attestationServiceUrl: string, platform: SellerCredentialUploadPlatform, timeoutMs?: number, attestationRuntime?: SellerCredentialAttestationRuntime): Promise<AttestationServiceSellerCredentialUploadResponse>;
|
|
212
213
|
|
|
213
214
|
/**
|
|
214
215
|
* Store an already-encrypted seller credential bundle with curator.
|
|
215
216
|
*/
|
|
216
217
|
declare function apiUploadSellerCredentialBundle(params: UploadSellerCredentialBundleParams, baseApiUrl?: string | null, timeoutMs?: number): Promise<CuratorSellerCredentialUploadResponse>;
|
|
217
218
|
|
|
218
|
-
declare function apiPostDepositDetails(req: PostDepositDetailsRequest, baseApiUrl: string, timeoutMs?: number
|
|
219
|
-
declare function apiGetQuotesBestByPlatform(req: QuotesBestByPlatformRequest, baseApiUrl: string, timeoutMs?: number
|
|
220
|
-
declare function apiGetPayeeDetails(req: GetPayeeDetailsRequest,
|
|
219
|
+
declare function apiPostDepositDetails(req: PostDepositDetailsRequest, baseApiUrl: string, timeoutMs?: number): Promise<PostDepositDetailsResponse>;
|
|
220
|
+
declare function apiGetQuotesBestByPlatform(req: QuotesBestByPlatformRequest, baseApiUrl: string, timeoutMs?: number): Promise<BestByPlatformResponse>;
|
|
221
|
+
declare function apiGetPayeeDetails(req: GetPayeeDetailsRequest, baseApiUrl: string, timeoutMs?: number): Promise<GetPayeeDetailsResponse>;
|
|
221
222
|
declare function apiValidatePayeeDetails(req: ValidatePayeeDetailsRequest, baseApiUrl: string, timeoutMs?: number): Promise<ValidatePayeeDetailsResponse>;
|
|
222
223
|
declare function apiGetOwnerDeposits(req: GetOwnerDepositsRequest, apiKey: string | undefined, baseApiUrl: string, authToken?: string, timeoutMs?: number): Promise<GetOwnerDepositsResponse>;
|
|
223
224
|
/**
|
|
224
225
|
* Get taker tier information for a specific address.
|
|
225
226
|
*/
|
|
226
|
-
declare function apiGetTakerTier(req: GetTakerTierRequest,
|
|
227
|
-
declare function apiConfirmPayPalForwarding(payeeDetails: Hash, body: {
|
|
228
|
-
payeeEmail: string;
|
|
229
|
-
forwardingInitiatorEmail: string;
|
|
230
|
-
}, baseApiUrl: string, opts?: {
|
|
231
|
-
apiKey?: string;
|
|
232
|
-
authToken?: string;
|
|
233
|
-
timeoutMs?: number;
|
|
234
|
-
}): Promise<ConfirmPayPalForwardingResponse>;
|
|
227
|
+
declare function apiGetTakerTier(req: GetTakerTierRequest, baseApiUrl: string, timeoutMs?: number): Promise<GetTakerTierResponse>;
|
|
235
228
|
declare function apiUploadGoogleOAuthSellerCredential<P extends GoogleOAuthSellerCredentialPlatform>(processorName: P, payeeDetails: Hash, body: GoogleOAuthSellerCredentialUploadBodyByPlatform[P], baseApiUrl: string, opts?: {
|
|
236
|
-
apiKey?: string;
|
|
237
|
-
authToken?: string;
|
|
238
229
|
timeoutMs?: number;
|
|
239
230
|
}): Promise<CuratorSellerCredentialUploadResponse>;
|
|
240
231
|
declare function apiGetOrderbook(params: GetOrderbookParams, opts: ApiAdapterOptions): Promise<GetOrderbookResponse>;
|
|
241
|
-
declare function apiGetOrderbook(params: GetOrderbookParams, baseApiUrl: string, timeoutMs?: number
|
|
232
|
+
declare function apiGetOrderbook(params: GetOrderbookParams, baseApiUrl: string, timeoutMs?: number): Promise<GetOrderbookResponse>;
|
|
242
233
|
declare function apiGetDepositBundle(params: GetDepositBundleParams, opts: ApiAdapterOptions): Promise<GetDepositBundleResponse>;
|
|
243
|
-
declare function apiGetDepositBundle(params: GetDepositBundleParams, baseApiUrl: string, timeoutMs?: number
|
|
234
|
+
declare function apiGetDepositBundle(params: GetDepositBundleParams, baseApiUrl: string, timeoutMs?: number): Promise<GetDepositBundleResponse>;
|
|
244
235
|
|
|
245
236
|
/** Minimal interface for the publicClient parameter, avoids viem version coupling. */
|
|
246
237
|
interface MulticallClient {
|
|
@@ -459,6 +450,38 @@ declare const TOKEN_METADATA: {
|
|
|
459
450
|
};
|
|
460
451
|
};
|
|
461
452
|
|
|
453
|
+
/**
|
|
454
|
+
* Canonical taker tier schedule — the single client-side source of truth for
|
|
455
|
+
* per-intent caps and volume thresholds. Mirrors the curator's authoritative
|
|
456
|
+
* tier engine (curator `src/common/services/tier/tierConstants.ts`), which is
|
|
457
|
+
* what the backend actually enforces.
|
|
458
|
+
*
|
|
459
|
+
* A user's *live* cap (after lock-score penalties and per-platform risk
|
|
460
|
+
* multipliers) always comes from the taker-tier API payload
|
|
461
|
+
* (`TakerTier.perIntentCapBaseUnits` / `nextTierMaxOrderSizeDisplay`). This
|
|
462
|
+
* static schedule is for reference displays that must show every tier at once —
|
|
463
|
+
* the Fees & Tiers ladder — and the forward-looking "next tier cap" hint.
|
|
464
|
+
*
|
|
465
|
+
* Ordered highest tier → lowest (PLATINUM first) to match UI display order.
|
|
466
|
+
* PEER_PRESIDENT is invite-only and excluded from the volume ladder.
|
|
467
|
+
*/
|
|
468
|
+
interface TakerTierScheduleEntry {
|
|
469
|
+
tier: TakerTierLevel;
|
|
470
|
+
/** Per-intent order cap in whole USD (base, before platform risk multipliers). */
|
|
471
|
+
perIntentCapUsd: number;
|
|
472
|
+
/** Inclusive lower bound of lifetime volume (USD) that qualifies for this tier. */
|
|
473
|
+
minVolumeUsd: number;
|
|
474
|
+
/** Inclusive upper bound of lifetime volume (USD); `Infinity` for the top tier. */
|
|
475
|
+
maxVolumeUsd: number;
|
|
476
|
+
}
|
|
477
|
+
declare const TAKER_TIER_SCHEDULE: readonly TakerTierScheduleEntry[];
|
|
478
|
+
/** Volume-based tier order, lowest → highest, for next-tier progression. */
|
|
479
|
+
declare const TAKER_TIER_ORDER: readonly TakerTierLevel[];
|
|
480
|
+
/** Per-intent caps (whole USD) keyed by tier, derived from the schedule. */
|
|
481
|
+
declare const TAKER_TIER_CAPS: Readonly<Record<string, number>>;
|
|
482
|
+
/** The next tier up from `currentTier`, or `null` at the top / for unknown tiers. */
|
|
483
|
+
declare function getNextTakerTier(currentTier: string | undefined): TakerTierLevel | null;
|
|
484
|
+
|
|
462
485
|
/**
|
|
463
486
|
* Payment method resolution utilities.
|
|
464
487
|
*
|
|
@@ -739,4 +762,4 @@ declare class ContractError extends ZKP2PError {
|
|
|
739
762
|
constructor(message: string, details?: unknown);
|
|
740
763
|
}
|
|
741
764
|
|
|
742
|
-
export { APIError, ApiAdapterOptions, AttestationServiceIdentityResponse, AttestationServiceSellerCredentialUploadResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS,
|
|
765
|
+
export { APIError, ApiAdapterOptions, AttestationServiceIdentityResponse, AttestationServiceSellerCredentialUploadResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ContractError, ContractRouter, type ContractRouterConfig, CuratorSellerCredentialUploadResponse, CurrencyType, DEFAULT_ORACLE_MAX_STALENESS_SECONDS, ErrorCode, type EscrowContractContext, type EscrowDepositView, type EscrowIntentView, GetDepositBundleParams, GetDepositBundleResponse, GetOrderbookParams, GetOrderbookResponse, GetOwnerDepositsRequest, GetOwnerDepositsResponse, GetPayeeDetailsRequest, GetPayeeDetailsResponse, GetTakerTierRequest, GetTakerTierResponse, GoogleOAuthSellerCredentialPlatform, GoogleOAuthSellerCredentialUploadBodyByPlatform, IdentityAttestationRequestBody, DepositWithRelations as IndexerDepositWithRelations, IntentEntity as IndexerIntent, type LogLevel, type MulticallClient, NetworkError, type OracleAdapterOverrides, type OracleKind, type OrchestratorContractContext, PEER_EXTENSION_CHROME_URL, PLATFORM_METADATA, PYTH_CONTRACT_BASE, PYTH_ORACLE_ADAPTER, PYTH_ORACLE_FEEDS, PaymentMethodCatalog, type PeerAuthenticateParams, type PeerBuyerTeePaymentCapture, type PeerBuyerTeePaymentParams, type PeerConnectionStatus, type PeerExtensionApi, type PeerExtensionSdk, type PeerExtensionSdkOptions, type PeerExtensionState, type PeerExtensionWindow, type PeerMetadataCaptureMode, type PeerMetadataMessage, type PeerMetadataMessageCallback, type PeerMetadataProviderConfig, type PeerMetadataRow, type PeerSarCredentialCapture, PostDepositDetailsRequest, PostDepositDetailsResponse, type PythFeedConfig, QuotesBestByPlatformRequest, ReferrerFeeConfig, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, SellerCredentialAttestationRuntime, SellerCredentialBundle, SellerCredentialUploadInput, SellerCredentialUploadPlatform, type SpreadOracleConfig, type SpreadOracleFeedConfig, type SupportedChainId, TAKER_TIER_CAPS, TAKER_TIER_ORDER, TAKER_TIER_SCHEDULE, TOKEN_METADATA, TakerTierLevel, type TakerTierScheduleEntry, TxOverrides, UploadSellerCredentialBundleParams, ValidatePayeeDetailsRequest, ValidatePayeeDetailsResponse, ValidationError, ZKP2PError, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuotesBestByPlatform, apiGetTakerTier, apiPostDepositDetails, apiRequestIdentityAttestation, apiUploadGoogleOAuthSellerCredential, apiUploadSellerCredentialBundle, apiValidatePayeeDetails, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, createPeerExtensionSdk, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, ensureBytes32, getAttributionDataSuffix, getNextTakerTier, getPeerExtensionState, getSpreadOracleConfig, isPeerExtensionAvailable, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, referrerFeeConfigToPreciseUnits, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { R as ReferrerFeeConfig, S as SellerCredentialBundle, D as DepositWithRelations, I as IntentEntity, a as IdentityAttestationRequestBody, A as AttestationServiceIdentityResponse, b as SellerCredentialUploadInput, c as
|
|
2
|
-
export { K as ActionCallback, aj as ApiDeposit, aq as ApiIntentStatus,
|
|
1
|
+
import { R as ReferrerFeeConfig, S as SellerCredentialBundle, D as DepositWithRelations, I as IntentEntity, a as IdentityAttestationRequestBody, A as AttestationServiceIdentityResponse, b as SellerCredentialUploadInput, c as SellerCredentialUploadPlatform, d as SellerCredentialAttestationRuntime, e as AttestationServiceSellerCredentialUploadResponse, B as BuyerTeeSessionMaterialEncryptionInput, U as UploadSellerCredentialBundleParams, C as CuratorSellerCredentialUploadResponse, G as GoogleOAuthSellerCredentialPlatform, f as GoogleOAuthSellerCredentialUploadBodyByPlatform, Q as QuotesBestByPlatformRequest, g as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, h as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, i as PostDepositDetailsResponse, j as GetPayeeDetailsRequest, k as GetPayeeDetailsResponse, l as GetOwnerDepositsRequest, m as GetOwnerDepositsResponse, n as GetTakerTierRequest, o as GetTakerTierResponse, p as GetDepositBundleParams, q as ApiAdapterOptions, r as GetDepositBundleResponse, s as GetOrderbookParams, t as GetOrderbookResponse, u as CurrencyType, T as TakerTierLevel, v as PaymentMethodCatalog, w as TxOverrides } from './vaultUtils-DOOl9QUP.js';
|
|
2
|
+
export { K as ActionCallback, aj as ApiDeposit, aq as ApiIntentStatus, b0 as AttestationServiceSellerCredentialProbeResponse, a_ as AttestationServiceSellerVerifyResponse, H as AuthorizationTokenProvider, cE as BatchResult, $ as BestByPlatformResponseObject, b1 as BuyerTeePaymentParams, b2 as BuyerTeePaymentProofInput, b3 as BuyerTeeSessionMaterial, z as CancelIntentMethodParams, _ as CancelIntentParams, aJ as CashAppCredentialUploadInput, aB as CashAppSessionMaterial, M as CreateDepositConversionRate, L as CreateDepositParams, b4 as CuratorSellerCredentialStatusResponse, b5 as CuratorSellerVerifyResponse, c7 as Currency, ce as CurrencyData, cD as DelegationDepositTarget, cB as DelegationRoute, cC as DelegationState, cp as Deposit, cr as DepositCurrency, bp as DepositIntentStatistics, am as DepositStatus, ak as DepositVerifier, al as DepositVerifierCurrency, bm as DepositVerifierData, co as DepositView, af as FiatResponse, a$ as FulfillIntentAttestationResponse, F as FulfillIntentMethodParams, X as FulfillIntentParams, a0 as GetBestByPlatformResponse, a1 as GetBestByPlatformResponseObject, an as GetDepositByIdRequest, ao as GetDepositByIdResponse, av as GetIntentByHashRequest, aw as GetIntentByHashResponse, at as GetIntentsByDepositRequest, au as GetIntentsByDepositResponse, a5 as GetNearbyQuote, a6 as GetNearbySuggestions, ar as GetOwnerIntentsRequest, as as GetOwnerIntentsResponse, a2 as GetPlatformQuote, a7 as GetQuoteResponse, a8 as GetQuoteResponseObject, a9 as GetQuoteSingleResponse, ba as GetSellerCredentialStatusParams, bf as IdentityAttestationActionType, bg as IdentityAttestationOutput, bh as IdentityAttestationOutputFor, bi as IdentityAttestationParams, bv as IndexerClient, c1 as IndexerDeploymentEnv, bB as IndexerDeposit, bS as IndexerDepositDailySnapshot, bU as IndexerDepositFilter, bR as IndexerDepositFundActivity, bT as IndexerDepositFundActivityType, bX as IndexerDepositOrderDirection, bW as IndexerDepositOrderField, bV as IndexerDepositPagination, bE as IndexerDepositPaymentMethod, bx as IndexerDepositService, c4 as IndexerFulfillmentAndPaymentResponse, c2 as IndexerFulfillmentRecord, bC as IndexerIntentFulfilled, bD as IndexerIntentFulfillmentAmounts, bG as IndexerIntentStatus, bK as IndexerManagerAggregateStats, bM as IndexerManagerDailySnapshot, bL as IndexerManagerStats, bP as IndexerManualRateUpdate, bF as IndexerMethodCurrency, bQ as IndexerOracleConfigUpdate, c3 as IndexerPaymentVerifiedRecord, bH as IndexerRateManager, bJ as IndexerRateManagerDelegation, b_ as IndexerRateManagerDelegationPagination, bO as IndexerRateManagerDetail, bY as IndexerRateManagerFilter, bN as IndexerRateManagerListItem, c0 as IndexerRateManagerOrderDirection, b$ as IndexerRateManagerOrderField, bZ as IndexerRateManagerPagination, bI as IndexerRateManagerRate, by as IndexerRateManagerService, ap as Intent, ct as IntentView, bj as MakerIdentityAttestationRequestBody, bk as MakerIdentityPlatform, ah as NearbyQuote, ai as NearbySuggestions, Z as OfframpClient, bl as OnchainCurrency, cu as OnchainIntent, bo as OrderStats, bu as OrderbookEntry, c5 as PAYMENT_PLATFORMS, aG as PayPalGoogleOAuthSellerCredentialUploadBody, cq as PaymentMethodData, c6 as PaymentPlatformType, bs as PlatformLimit, a3 as PlatformQuote, bt as PlatformRiskLevel, bn as PreparedTransaction, ae as QuoteFeesResponse, ad as QuoteIntentResponse, a4 as QuoteRequest, aa as QuoteResponse, ab as QuoteResponseObject, ac as QuoteSingleResponse, N as Range, cs as ReferralFee, ax as RegisterPayeeDetailsRequest, ay as RegisterPayeeDetailsResponse, b6 as RegisteredSellerCredentialPlatform, b8 as RegisteredUploadSellerCredentialParams, Y as ReleaseFundsToPayerParams, cj as RuntimeEnv, aY as SellerAttestationOutput, aM as SellerCiphertextBundle, aR as SellerCredentialBundleUpload, aZ as SellerCredentialProbeResponse, aT as SellerCredentialStatus, aS as SellerCredentialStatusValue, aL as SellerCredentialUploadInputByPlatform, aX as SellerPaymentTypedDataValue, az as SellerPlatform, aQ as SellerProbeInput, aN as SellerSignedCiphertextBundle, aV as SellerTypedDataField, aW as SellerTypedDataSpec, aP as SellerVerifyInput, aO as SellerVerifyIntentDetails, aU as SellerVerifyProxyBody, cG as SendBatchFn, cF as SendTransactionFn, y as SignalIntentMethodParams, O as SignalIntentParams, x as SignalIntentReferralFee, bq as TakerTier, br as TakerTierStats, J as TimeoutConfig, ag as TokenResponse, bd as UploadGoogleOAuthSellerCredentialParams, bb as UploadPayPalGoogleOAuthSellerCredentialParams, b9 as UploadSellerCredentialOptions, b7 as UploadSellerCredentialParams, bc as UploadVenmoGoogleOAuthSellerCredentialParams, aI as VenmoCredentialUploadInput, aH as VenmoGoogleOAuthSellerCredentialUploadBody, aA as VenmoSessionMaterial, be as VerifySellerPaymentParams, aK as WiseCredentialUploadInput, aD as WiseProfileInfo, aF as WiseProfileNotFound, aE as WiseProfileSelectionRequired, aC as WiseSessionMaterial, W as WithdrawDepositParams, cv as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, E as Zkp2pClientOptions, cA as classifyDelegationState, bz as compareEventCursorIdsByRecency, c8 as currencyInfo, bw as defaultIndexerEndpoint, cm as enrichPvDepositView, cn as enrichPvIntentView, bA as fetchIndexerFulfillmentAndPayment, cf as getContracts, cb as getCurrencyCodeFromHash, ca as getCurrencyInfoFromCountryCode, c9 as getCurrencyInfoFromHash, cz as getDelegationRoute, ci as getGatingServiceAddress, ch as getPaymentMethodsCatalog, cg as getRateManagerContracts, cc as isSupportedCurrencyHash, cw as isZeroRateManagerId, cd as mapConversionRatesToOnchainMinRate, cx as normalizeRateManagerId, cy as normalizeRegistry, ck as parseDepositView, cl as parseIntentView } from './vaultUtils-DOOl9QUP.js';
|
|
3
3
|
import { Address, Hash, Hex, WalletClient } from 'viem';
|
|
4
4
|
import { Abi } from 'abitype';
|
|
5
|
-
export { IdentityActionType, IdentityActionTypeByPlatform,
|
|
5
|
+
export { IdentityActionType, IdentityActionTypeByPlatform, IdentityParamsByPlatform, IdentityPlatform, NitroAttestationClient, NitroAttestationClientOptions, NitroAttestationEnvironment, VerifiedAttestation, VerifiedAttestationPayload, createNitroAttestationClient } from '@zkp2p/zkp2p-attestation';
|
|
6
6
|
import '@zkp2p/indexer-schema';
|
|
7
7
|
|
|
8
8
|
interface EscrowRange {
|
|
@@ -132,6 +132,7 @@ type PeerMetadataProviderConfig = Record<string, unknown>;
|
|
|
132
132
|
type PeerAuthenticateParams = {
|
|
133
133
|
actionType: string;
|
|
134
134
|
attestationActionType?: string | null;
|
|
135
|
+
attestationPlatform?: string | null;
|
|
135
136
|
attestationServiceUrl?: string | null;
|
|
136
137
|
captureMode?: PeerMetadataCaptureMode;
|
|
137
138
|
platform: string;
|
|
@@ -208,39 +209,29 @@ declare function convertIndexerIntentsToEscrowViews(intents: IntentEntity[], dep
|
|
|
208
209
|
|
|
209
210
|
declare function apiRequestIdentityAttestation(payload: IdentityAttestationRequestBody, attestationServiceUrl: string, platform: string, actionType: string): Promise<AttestationServiceIdentityResponse>;
|
|
210
211
|
declare function createEncryptedBuyerTeeSessionMaterial({ actionType, attestationRuntime, attestationServiceUrl, platform, sessionMaterial, timeoutMs, }: BuyerTeeSessionMaterialEncryptionInput): Promise<string>;
|
|
211
|
-
declare function apiCreateSellerCredentialBundle(payload: SellerCredentialUploadInput, attestationServiceUrl: string, platform:
|
|
212
|
+
declare function apiCreateSellerCredentialBundle(payload: SellerCredentialUploadInput, attestationServiceUrl: string, platform: SellerCredentialUploadPlatform, timeoutMs?: number, attestationRuntime?: SellerCredentialAttestationRuntime): Promise<AttestationServiceSellerCredentialUploadResponse>;
|
|
212
213
|
|
|
213
214
|
/**
|
|
214
215
|
* Store an already-encrypted seller credential bundle with curator.
|
|
215
216
|
*/
|
|
216
217
|
declare function apiUploadSellerCredentialBundle(params: UploadSellerCredentialBundleParams, baseApiUrl?: string | null, timeoutMs?: number): Promise<CuratorSellerCredentialUploadResponse>;
|
|
217
218
|
|
|
218
|
-
declare function apiPostDepositDetails(req: PostDepositDetailsRequest, baseApiUrl: string, timeoutMs?: number
|
|
219
|
-
declare function apiGetQuotesBestByPlatform(req: QuotesBestByPlatformRequest, baseApiUrl: string, timeoutMs?: number
|
|
220
|
-
declare function apiGetPayeeDetails(req: GetPayeeDetailsRequest,
|
|
219
|
+
declare function apiPostDepositDetails(req: PostDepositDetailsRequest, baseApiUrl: string, timeoutMs?: number): Promise<PostDepositDetailsResponse>;
|
|
220
|
+
declare function apiGetQuotesBestByPlatform(req: QuotesBestByPlatformRequest, baseApiUrl: string, timeoutMs?: number): Promise<BestByPlatformResponse>;
|
|
221
|
+
declare function apiGetPayeeDetails(req: GetPayeeDetailsRequest, baseApiUrl: string, timeoutMs?: number): Promise<GetPayeeDetailsResponse>;
|
|
221
222
|
declare function apiValidatePayeeDetails(req: ValidatePayeeDetailsRequest, baseApiUrl: string, timeoutMs?: number): Promise<ValidatePayeeDetailsResponse>;
|
|
222
223
|
declare function apiGetOwnerDeposits(req: GetOwnerDepositsRequest, apiKey: string | undefined, baseApiUrl: string, authToken?: string, timeoutMs?: number): Promise<GetOwnerDepositsResponse>;
|
|
223
224
|
/**
|
|
224
225
|
* Get taker tier information for a specific address.
|
|
225
226
|
*/
|
|
226
|
-
declare function apiGetTakerTier(req: GetTakerTierRequest,
|
|
227
|
-
declare function apiConfirmPayPalForwarding(payeeDetails: Hash, body: {
|
|
228
|
-
payeeEmail: string;
|
|
229
|
-
forwardingInitiatorEmail: string;
|
|
230
|
-
}, baseApiUrl: string, opts?: {
|
|
231
|
-
apiKey?: string;
|
|
232
|
-
authToken?: string;
|
|
233
|
-
timeoutMs?: number;
|
|
234
|
-
}): Promise<ConfirmPayPalForwardingResponse>;
|
|
227
|
+
declare function apiGetTakerTier(req: GetTakerTierRequest, baseApiUrl: string, timeoutMs?: number): Promise<GetTakerTierResponse>;
|
|
235
228
|
declare function apiUploadGoogleOAuthSellerCredential<P extends GoogleOAuthSellerCredentialPlatform>(processorName: P, payeeDetails: Hash, body: GoogleOAuthSellerCredentialUploadBodyByPlatform[P], baseApiUrl: string, opts?: {
|
|
236
|
-
apiKey?: string;
|
|
237
|
-
authToken?: string;
|
|
238
229
|
timeoutMs?: number;
|
|
239
230
|
}): Promise<CuratorSellerCredentialUploadResponse>;
|
|
240
231
|
declare function apiGetOrderbook(params: GetOrderbookParams, opts: ApiAdapterOptions): Promise<GetOrderbookResponse>;
|
|
241
|
-
declare function apiGetOrderbook(params: GetOrderbookParams, baseApiUrl: string, timeoutMs?: number
|
|
232
|
+
declare function apiGetOrderbook(params: GetOrderbookParams, baseApiUrl: string, timeoutMs?: number): Promise<GetOrderbookResponse>;
|
|
242
233
|
declare function apiGetDepositBundle(params: GetDepositBundleParams, opts: ApiAdapterOptions): Promise<GetDepositBundleResponse>;
|
|
243
|
-
declare function apiGetDepositBundle(params: GetDepositBundleParams, baseApiUrl: string, timeoutMs?: number
|
|
234
|
+
declare function apiGetDepositBundle(params: GetDepositBundleParams, baseApiUrl: string, timeoutMs?: number): Promise<GetDepositBundleResponse>;
|
|
244
235
|
|
|
245
236
|
/** Minimal interface for the publicClient parameter, avoids viem version coupling. */
|
|
246
237
|
interface MulticallClient {
|
|
@@ -459,6 +450,38 @@ declare const TOKEN_METADATA: {
|
|
|
459
450
|
};
|
|
460
451
|
};
|
|
461
452
|
|
|
453
|
+
/**
|
|
454
|
+
* Canonical taker tier schedule — the single client-side source of truth for
|
|
455
|
+
* per-intent caps and volume thresholds. Mirrors the curator's authoritative
|
|
456
|
+
* tier engine (curator `src/common/services/tier/tierConstants.ts`), which is
|
|
457
|
+
* what the backend actually enforces.
|
|
458
|
+
*
|
|
459
|
+
* A user's *live* cap (after lock-score penalties and per-platform risk
|
|
460
|
+
* multipliers) always comes from the taker-tier API payload
|
|
461
|
+
* (`TakerTier.perIntentCapBaseUnits` / `nextTierMaxOrderSizeDisplay`). This
|
|
462
|
+
* static schedule is for reference displays that must show every tier at once —
|
|
463
|
+
* the Fees & Tiers ladder — and the forward-looking "next tier cap" hint.
|
|
464
|
+
*
|
|
465
|
+
* Ordered highest tier → lowest (PLATINUM first) to match UI display order.
|
|
466
|
+
* PEER_PRESIDENT is invite-only and excluded from the volume ladder.
|
|
467
|
+
*/
|
|
468
|
+
interface TakerTierScheduleEntry {
|
|
469
|
+
tier: TakerTierLevel;
|
|
470
|
+
/** Per-intent order cap in whole USD (base, before platform risk multipliers). */
|
|
471
|
+
perIntentCapUsd: number;
|
|
472
|
+
/** Inclusive lower bound of lifetime volume (USD) that qualifies for this tier. */
|
|
473
|
+
minVolumeUsd: number;
|
|
474
|
+
/** Inclusive upper bound of lifetime volume (USD); `Infinity` for the top tier. */
|
|
475
|
+
maxVolumeUsd: number;
|
|
476
|
+
}
|
|
477
|
+
declare const TAKER_TIER_SCHEDULE: readonly TakerTierScheduleEntry[];
|
|
478
|
+
/** Volume-based tier order, lowest → highest, for next-tier progression. */
|
|
479
|
+
declare const TAKER_TIER_ORDER: readonly TakerTierLevel[];
|
|
480
|
+
/** Per-intent caps (whole USD) keyed by tier, derived from the schedule. */
|
|
481
|
+
declare const TAKER_TIER_CAPS: Readonly<Record<string, number>>;
|
|
482
|
+
/** The next tier up from `currentTier`, or `null` at the top / for unknown tiers. */
|
|
483
|
+
declare function getNextTakerTier(currentTier: string | undefined): TakerTierLevel | null;
|
|
484
|
+
|
|
462
485
|
/**
|
|
463
486
|
* Payment method resolution utilities.
|
|
464
487
|
*
|
|
@@ -739,4 +762,4 @@ declare class ContractError extends ZKP2PError {
|
|
|
739
762
|
constructor(message: string, details?: unknown);
|
|
740
763
|
}
|
|
741
764
|
|
|
742
|
-
export { APIError, ApiAdapterOptions, AttestationServiceIdentityResponse, AttestationServiceSellerCredentialUploadResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS,
|
|
765
|
+
export { APIError, ApiAdapterOptions, AttestationServiceIdentityResponse, AttestationServiceSellerCredentialUploadResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ContractError, ContractRouter, type ContractRouterConfig, CuratorSellerCredentialUploadResponse, CurrencyType, DEFAULT_ORACLE_MAX_STALENESS_SECONDS, ErrorCode, type EscrowContractContext, type EscrowDepositView, type EscrowIntentView, GetDepositBundleParams, GetDepositBundleResponse, GetOrderbookParams, GetOrderbookResponse, GetOwnerDepositsRequest, GetOwnerDepositsResponse, GetPayeeDetailsRequest, GetPayeeDetailsResponse, GetTakerTierRequest, GetTakerTierResponse, GoogleOAuthSellerCredentialPlatform, GoogleOAuthSellerCredentialUploadBodyByPlatform, IdentityAttestationRequestBody, DepositWithRelations as IndexerDepositWithRelations, IntentEntity as IndexerIntent, type LogLevel, type MulticallClient, NetworkError, type OracleAdapterOverrides, type OracleKind, type OrchestratorContractContext, PEER_EXTENSION_CHROME_URL, PLATFORM_METADATA, PYTH_CONTRACT_BASE, PYTH_ORACLE_ADAPTER, PYTH_ORACLE_FEEDS, PaymentMethodCatalog, type PeerAuthenticateParams, type PeerBuyerTeePaymentCapture, type PeerBuyerTeePaymentParams, type PeerConnectionStatus, type PeerExtensionApi, type PeerExtensionSdk, type PeerExtensionSdkOptions, type PeerExtensionState, type PeerExtensionWindow, type PeerMetadataCaptureMode, type PeerMetadataMessage, type PeerMetadataMessageCallback, type PeerMetadataProviderConfig, type PeerMetadataRow, type PeerSarCredentialCapture, PostDepositDetailsRequest, PostDepositDetailsResponse, type PythFeedConfig, QuotesBestByPlatformRequest, ReferrerFeeConfig, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, SellerCredentialAttestationRuntime, SellerCredentialBundle, SellerCredentialUploadInput, SellerCredentialUploadPlatform, type SpreadOracleConfig, type SpreadOracleFeedConfig, type SupportedChainId, TAKER_TIER_CAPS, TAKER_TIER_ORDER, TAKER_TIER_SCHEDULE, TOKEN_METADATA, TakerTierLevel, type TakerTierScheduleEntry, TxOverrides, UploadSellerCredentialBundleParams, ValidatePayeeDetailsRequest, ValidatePayeeDetailsResponse, ValidationError, ZKP2PError, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuotesBestByPlatform, apiGetTakerTier, apiPostDepositDetails, apiRequestIdentityAttestation, apiUploadGoogleOAuthSellerCredential, apiUploadSellerCredentialBundle, apiValidatePayeeDetails, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, createPeerExtensionSdk, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, ensureBytes32, getAttributionDataSuffix, getNextTakerTier, getPeerExtensionState, getSpreadOracleConfig, isPeerExtensionAvailable, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, referrerFeeConfigToPreciseUnits, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
|