@zkp2p/sdk 0.6.3 → 0.7.1
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 +24 -1
- package/dist/{chunk-WFDRBAV3.mjs → chunk-BQINCOSO.mjs} +2 -2
- package/dist/chunk-BQINCOSO.mjs.map +1 -0
- package/dist/index.cjs +130 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +18 -12
- package/dist/index.d.ts +18 -12
- package/dist/index.mjs +126 -4
- package/dist/index.mjs.map +1 -1
- 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 +2 -2
- package/dist/{vaultUtils-CcJn5Yh6.d.mts → vaultUtils-DI-r1LAg.d.mts} +86 -10
- package/dist/{vaultUtils-CcJn5Yh6.d.ts → vaultUtils-DI-r1LAg.d.ts} +86 -10
- package/package.json +1 -1
- package/dist/chunk-WFDRBAV3.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as ReferrerFeeConfig, S as SellerCredentialBundle, D as DepositWithRelations, I as IntentEntity, a as IdentityAttestationRequestBody, A as AttestationServiceIdentityResponse, B as BuyerTeeVerifyPaymentBody, b as AttestationServiceSellerVerifyResponse, c as SellerCredentialUploadInput, d as SellerCredentialUploadPlatform, e as SellerCredentialAttestationRuntime, f as AttestationServiceSellerCredentialUploadResponse, g as BuyerTeeSessionMaterialEncryptionInput, U as UploadSellerCredentialBundleParams, C as CuratorSellerCredentialUploadResponse, G as GoogleOAuthSellerCredentialPlatform,
|
|
2
|
-
export {
|
|
1
|
+
import { R as ReferrerFeeConfig, S as SellerCredentialBundle, D as DepositWithRelations, I as IntentEntity, a as IdentityAttestationRequestBody, A as AttestationServiceIdentityResponse, B as BuyerTeeVerifyPaymentBody, b as AttestationServiceSellerVerifyResponse, c as SellerCredentialUploadInput, d as SellerCredentialUploadPlatform, e as SellerCredentialAttestationRuntime, f as AttestationServiceSellerCredentialUploadResponse, g as BuyerTeeSessionMaterialEncryptionInput, U as UploadSellerCredentialBundleParams, C as CuratorSellerCredentialUploadResponse, h as ApiAdapterOptions, i as ReferralDashboardResponse, j as ReferralEarningsResponse, k as RedeemReferralCodeRequest, l as RedeemReferralCodeResponse, m as UpdateReferralCodeRequest, n as UpdateReferralCodeResponse, G as GoogleOAuthSellerCredentialPlatform, o as GoogleOAuthSellerCredentialUploadBodyByPlatform, Q as QuotesBestByPlatformRequest, p as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, q as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, r as PostDepositDetailsResponse, s as GetPayeeDetailsRequest, t as GetPayeeDetailsResponse, u as GetOwnerDepositsRequest, v as GetOwnerDepositsResponse, w as GetTakerTierRequest, x as GetTakerTierResponse, y as GetDepositBundleParams, z as GetDepositBundleResponse, E as GetOrderbookParams, F as GetOrderbookResponse, H as CurrencyType, T as TakerTierLevel, J as PaymentMethodCatalog, K as TxOverrides } from './vaultUtils-DI-r1LAg.mjs';
|
|
2
|
+
export { _ as ActionCallback, ar as ApiDeposit, ay as ApiIntentStatus, b7 as AttestationServiceSellerCredentialProbeResponse, X as AuthorizationTokenProvider, cN as BatchResult, a7 as BestByPlatformResponseObject, b8 as BuyerTeePaymentParams, b9 as BuyerTeePaymentProofInput, ba as BuyerTeeSessionMaterial, O as CancelIntentMethodParams, a6 as CancelIntentParams, aR as CashAppCredentialUploadInput, aJ as CashAppSessionMaterial, a0 as CreateDepositConversionRate, $ as CreateDepositParams, bb as CuratorSellerCredentialStatusResponse, bc as CuratorSellerVerifyResponse, cg as Currency, cn as CurrencyData, cM as DelegationDepositTarget, cK as DelegationRoute, cL as DelegationState, cy as Deposit, cA as DepositCurrency, bw as DepositIntentStatistics, au as DepositStatus, as as DepositVerifier, at as DepositVerifierCurrency, bt as DepositVerifierData, cx as DepositView, an as FiatResponse, b6 as FulfillIntentAttestationResponse, N as FulfillIntentMethodParams, a4 as FulfillIntentParams, a8 as GetBestByPlatformResponse, a9 as GetBestByPlatformResponseObject, av as GetDepositByIdRequest, aw as GetDepositByIdResponse, aD as GetIntentByHashRequest, aE as GetIntentByHashResponse, aB as GetIntentsByDepositRequest, aC as GetIntentsByDepositResponse, ad as GetNearbyQuote, ae as GetNearbySuggestions, az as GetOwnerIntentsRequest, aA as GetOwnerIntentsResponse, aa as GetPlatformQuote, af as GetQuoteResponse, ag as GetQuoteResponseObject, ah as GetQuoteSingleResponse, bh as GetSellerCredentialStatusParams, bm as IdentityAttestationActionType, bn as IdentityAttestationOutput, bo as IdentityAttestationOutputFor, bp as IdentityAttestationParams, bE as IndexerClient, ca as IndexerDeploymentEnv, bK as IndexerDeposit, b$ as IndexerDepositDailySnapshot, c1 as IndexerDepositFilter, b_ as IndexerDepositFundActivity, c0 as IndexerDepositFundActivityType, c4 as IndexerDepositOrderDirection, c3 as IndexerDepositOrderField, c2 as IndexerDepositPagination, bN as IndexerDepositPaymentMethod, bG as IndexerDepositService, cd as IndexerFulfillmentAndPaymentResponse, cb as IndexerFulfillmentRecord, bL as IndexerIntentFulfilled, bM as IndexerIntentFulfillmentAmounts, bP as IndexerIntentStatus, bT as IndexerManagerAggregateStats, bV as IndexerManagerDailySnapshot, bU as IndexerManagerStats, bY as IndexerManualRateUpdate, bO as IndexerMethodCurrency, bZ as IndexerOracleConfigUpdate, cc as IndexerPaymentVerifiedRecord, bQ as IndexerRateManager, bS as IndexerRateManagerDelegation, c7 as IndexerRateManagerDelegationPagination, bX as IndexerRateManagerDetail, c5 as IndexerRateManagerFilter, bW as IndexerRateManagerListItem, c9 as IndexerRateManagerOrderDirection, c8 as IndexerRateManagerOrderField, c6 as IndexerRateManagerPagination, bR as IndexerRateManagerRate, bH as IndexerRateManagerService, ax as Intent, cC as IntentView, bq as MakerIdentityAttestationRequestBody, br as MakerIdentityPlatform, ap as NearbyQuote, aq as NearbySuggestions, Z as OfframpClient, bs as OnchainCurrency, cD as OnchainIntent, bv as OrderStats, bD as OrderbookEntry, ce as PAYMENT_PLATFORMS, aO as PayPalGoogleOAuthSellerCredentialUploadBody, cz as PaymentMethodData, cf as PaymentPlatformType, bB as PlatformLimit, ab as PlatformQuote, bC as PlatformRiskLevel, bu as PreparedTransaction, am as QuoteFeesResponse, al as QuoteIntentResponse, ac as QuoteRequest, ai as QuoteResponse, aj as QuoteResponseObject, ak as QuoteSingleResponse, a1 as Range, cB as ReferralFee, aF as RegisterPayeeDetailsRequest, aG as RegisterPayeeDetailsResponse, bd as RegisteredSellerCredentialPlatform, bf as RegisteredUploadSellerCredentialParams, a5 as ReleaseFundsToPayerParams, cs as RuntimeEnv, b4 as SellerAttestationOutput, aU as SellerCiphertextBundle, aZ as SellerCredentialBundleUpload, b5 as SellerCredentialProbeResponse, a$ as SellerCredentialStatus, a_ as SellerCredentialStatusValue, aT as SellerCredentialUploadInputByPlatform, b3 as SellerPaymentTypedDataValue, aH as SellerPlatform, aY as SellerProbeInput, aV as SellerSignedCiphertextBundle, b1 as SellerTypedDataField, b2 as SellerTypedDataSpec, aX as SellerVerifyInput, aW as SellerVerifyIntentDetails, b0 as SellerVerifyProxyBody, cP as SendBatchFn, cO as SendTransactionFn, M as SignalIntentMethodParams, a3 as SignalIntentParams, L as SignalIntentReferralFee, bx as TakerTier, bA as TakerTierSource, bz as TakerTierStats, by as TakerTierVolumeBreakdown, Y as TimeoutConfig, ao as TokenResponse, bk as UploadGoogleOAuthSellerCredentialParams, bi as UploadPayPalGoogleOAuthSellerCredentialParams, bg as UploadSellerCredentialOptions, be as UploadSellerCredentialParams, bj as UploadVenmoGoogleOAuthSellerCredentialParams, aQ as VenmoCredentialUploadInput, aP as VenmoGoogleOAuthSellerCredentialUploadBody, aI as VenmoSessionMaterial, bl as VerifySellerPaymentParams, aS as WiseCredentialUploadInput, aL as WiseProfileInfo, aN as WiseProfileNotFound, aM as WiseProfileSelectionRequired, aK as WiseSessionMaterial, a2 as WithdrawDepositParams, cE as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, W as Zkp2pClientOptions, cJ as classifyDelegationState, bI as compareEventCursorIdsByRecency, ch as currencyInfo, bF as defaultIndexerEndpoint, cv as enrichPvDepositView, cw as enrichPvIntentView, bJ as fetchIndexerFulfillmentAndPayment, co as getContracts, ck as getCurrencyCodeFromHash, cj as getCurrencyInfoFromCountryCode, ci as getCurrencyInfoFromHash, cI as getDelegationRoute, cr as getGatingServiceAddress, cq as getPaymentMethodsCatalog, cp as getRateManagerContracts, cl as isSupportedCurrencyHash, cF as isZeroRateManagerId, cm as mapConversionRatesToOnchainMinRate, cG as normalizeRateManagerId, cH as normalizeRegistry, ct as parseDepositView, cu as parseIntentView } from './vaultUtils-DI-r1LAg.mjs';
|
|
3
3
|
import { Address, Hash, Hex, WalletClient } from 'viem';
|
|
4
4
|
import { Abi } from 'abitype';
|
|
5
5
|
export { IdentityActionType, IdentityActionTypeByPlatform, IdentityParamsByPlatform, IdentityPlatform, NitroAttestationClient, NitroAttestationClientOptions, NitroAttestationEnvironment, VerifiedAttestation, VerifiedAttestationPayload, createNitroAttestationClient } from '@zkp2p/zkp2p-attestation';
|
|
@@ -70,6 +70,9 @@ declare const assertValidReferrerFeeConfig: (config: ReferrerFeeConfig | undefin
|
|
|
70
70
|
declare const parseReferrerFeeConfig: (recipient: string | null | undefined, feeBpsValue: string | number | null | undefined) => ReferrerFeeConfig | null;
|
|
71
71
|
declare const referrerFeeConfigToPreciseUnits: (config: ReferrerFeeConfig) => bigint;
|
|
72
72
|
|
|
73
|
+
declare const normalizeReferralCode: (code: string) => string;
|
|
74
|
+
declare const isValidReferralCode: (code: string) => boolean;
|
|
75
|
+
|
|
73
76
|
interface EscrowContractContext {
|
|
74
77
|
address: Address;
|
|
75
78
|
abi: Abi;
|
|
@@ -229,6 +232,10 @@ declare function apiGetOwnerDeposits(req: GetOwnerDepositsRequest, apiKey: strin
|
|
|
229
232
|
* Get taker tier information for a specific address.
|
|
230
233
|
*/
|
|
231
234
|
declare function apiGetTakerTier(req: GetTakerTierRequest, baseApiUrl: string, timeoutMs?: number): Promise<GetTakerTierResponse>;
|
|
235
|
+
declare function apiGetReferralDashboard(opts: ApiAdapterOptions): Promise<ReferralDashboardResponse>;
|
|
236
|
+
declare function apiGetReferralEarnings(opts: ApiAdapterOptions): Promise<ReferralEarningsResponse>;
|
|
237
|
+
declare function apiRedeemReferralCode(req: RedeemReferralCodeRequest, opts: ApiAdapterOptions): Promise<RedeemReferralCodeResponse>;
|
|
238
|
+
declare function apiUpdateReferralCode(req: UpdateReferralCodeRequest, opts: ApiAdapterOptions): Promise<UpdateReferralCodeResponse>;
|
|
232
239
|
declare function apiUploadGoogleOAuthSellerCredential<P extends GoogleOAuthSellerCredentialPlatform>(processorName: P, payeeDetails: Hash, body: GoogleOAuthSellerCredentialUploadBodyByPlatform[P], baseApiUrl: string, opts?: {
|
|
233
240
|
timeoutMs?: number;
|
|
234
241
|
}): Promise<CuratorSellerCredentialUploadResponse>;
|
|
@@ -460,10 +467,10 @@ declare const TOKEN_METADATA: {
|
|
|
460
467
|
* tier engine (curator `src/common/services/tier/tierConstants.ts`), which is
|
|
461
468
|
* what the backend actually enforces.
|
|
462
469
|
*
|
|
463
|
-
* The live qualification signal is
|
|
464
|
-
*
|
|
465
|
-
*
|
|
466
|
-
*
|
|
470
|
+
* The live qualification signal is Peer Pay volume. Historical maker tiers
|
|
471
|
+
* earned before July 1, 2026 UTC are preserved; after that cutoff, only Peer
|
|
472
|
+
* Pay volume moves the tier. Curator keeps the response field name
|
|
473
|
+
* `peerPayVolume` for compatibility.
|
|
467
474
|
*
|
|
468
475
|
* A user's *live* tier, cap, and progression always come from the taker-tier
|
|
469
476
|
* API payload (`TakerTier.perIntentCapBaseUnits`, `minVolumeForTier`,
|
|
@@ -474,9 +481,8 @@ declare const TOKEN_METADATA: {
|
|
|
474
481
|
* (the Fees & Tiers ladder) when no live payload is available; never gate or
|
|
475
482
|
* compute a user's real cap from it.
|
|
476
483
|
*
|
|
477
|
-
* Volume bands track the live
|
|
478
|
-
*
|
|
479
|
-
* PRO $50k, PLATINUM $100k. Caps ($100/$250/$1k/$2.5k/$5k) are unchanged.
|
|
484
|
+
* Volume bands track the live tuned qualification thresholds — PEER $1k,
|
|
485
|
+
* PLUS $10k, PRO $50k, PLATINUM $100k. Caps ($100/$250/$1k/$2.5k/$5k) are unchanged.
|
|
480
486
|
* Read the live per-user values from the API: curator can change qualification
|
|
481
487
|
* inputs behind the compatibility fields without changing this reference table.
|
|
482
488
|
*
|
|
@@ -487,9 +493,9 @@ interface TakerTierScheduleEntry {
|
|
|
487
493
|
tier: TakerTierLevel;
|
|
488
494
|
/** Per-intent order cap in whole USD (base, before platform risk multipliers). */
|
|
489
495
|
perIntentCapUsd: number;
|
|
490
|
-
/** Inclusive lower bound of
|
|
496
|
+
/** Inclusive lower bound of Peer Pay volume (USD) that qualifies for this tier. */
|
|
491
497
|
minVolumeUsd: number;
|
|
492
|
-
/** Inclusive upper bound of
|
|
498
|
+
/** Inclusive upper bound of Peer Pay volume (USD); `Infinity` for the top tier. */
|
|
493
499
|
maxVolumeUsd: number;
|
|
494
500
|
}
|
|
495
501
|
declare const TAKER_TIER_SCHEDULE: readonly TakerTierScheduleEntry[];
|
|
@@ -791,4 +797,4 @@ declare class ContractError extends ZKP2PError {
|
|
|
791
797
|
constructor(message: string, details?: unknown);
|
|
792
798
|
}
|
|
793
799
|
|
|
794
|
-
export { APIError, ApiAdapterOptions, AttestationServiceIdentityResponse, AttestationServiceSellerCredentialUploadResponse, AttestationServiceSellerVerifyResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, BuyerTeeVerifyPaymentBody, 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_FEE_DISCOUNT_BPS, 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, apiVerifyBuyerTeePayment, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, createPeerExtensionSdk, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, ensureBytes32, getAttributionDataSuffix, getNextTakerTier, getPeerExtensionState, getSpreadOracleConfig, getTakerTierFeeDiscountBps, isPeerExtensionAvailable, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, referrerFeeConfigToPreciseUnits, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
|
|
800
|
+
export { APIError, ApiAdapterOptions, AttestationServiceIdentityResponse, AttestationServiceSellerCredentialUploadResponse, AttestationServiceSellerVerifyResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, BuyerTeeVerifyPaymentBody, 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, RedeemReferralCodeRequest, RedeemReferralCodeResponse, ReferralDashboardResponse, ReferralEarningsResponse, ReferrerFeeConfig, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, SellerCredentialAttestationRuntime, SellerCredentialBundle, SellerCredentialUploadInput, SellerCredentialUploadPlatform, type SpreadOracleConfig, type SpreadOracleFeedConfig, type SupportedChainId, TAKER_TIER_CAPS, TAKER_TIER_FEE_DISCOUNT_BPS, TAKER_TIER_ORDER, TAKER_TIER_SCHEDULE, TOKEN_METADATA, TakerTierLevel, type TakerTierScheduleEntry, TxOverrides, UpdateReferralCodeRequest, UpdateReferralCodeResponse, UploadSellerCredentialBundleParams, ValidatePayeeDetailsRequest, ValidatePayeeDetailsResponse, ValidationError, ZKP2PError, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuotesBestByPlatform, apiGetReferralDashboard, apiGetReferralEarnings, apiGetTakerTier, apiPostDepositDetails, apiRedeemReferralCode, apiRequestIdentityAttestation, apiUpdateReferralCode, apiUploadGoogleOAuthSellerCredential, apiUploadSellerCredentialBundle, apiValidatePayeeDetails, apiVerifyBuyerTeePayment, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, createPeerExtensionSdk, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, ensureBytes32, getAttributionDataSuffix, getNextTakerTier, getPeerExtensionState, getSpreadOracleConfig, getTakerTierFeeDiscountBps, isPeerExtensionAvailable, isValidReferralCode, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, normalizeReferralCode, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, referrerFeeConfigToPreciseUnits, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as ReferrerFeeConfig, S as SellerCredentialBundle, D as DepositWithRelations, I as IntentEntity, a as IdentityAttestationRequestBody, A as AttestationServiceIdentityResponse, B as BuyerTeeVerifyPaymentBody, b as AttestationServiceSellerVerifyResponse, c as SellerCredentialUploadInput, d as SellerCredentialUploadPlatform, e as SellerCredentialAttestationRuntime, f as AttestationServiceSellerCredentialUploadResponse, g as BuyerTeeSessionMaterialEncryptionInput, U as UploadSellerCredentialBundleParams, C as CuratorSellerCredentialUploadResponse, G as GoogleOAuthSellerCredentialPlatform,
|
|
2
|
-
export {
|
|
1
|
+
import { R as ReferrerFeeConfig, S as SellerCredentialBundle, D as DepositWithRelations, I as IntentEntity, a as IdentityAttestationRequestBody, A as AttestationServiceIdentityResponse, B as BuyerTeeVerifyPaymentBody, b as AttestationServiceSellerVerifyResponse, c as SellerCredentialUploadInput, d as SellerCredentialUploadPlatform, e as SellerCredentialAttestationRuntime, f as AttestationServiceSellerCredentialUploadResponse, g as BuyerTeeSessionMaterialEncryptionInput, U as UploadSellerCredentialBundleParams, C as CuratorSellerCredentialUploadResponse, h as ApiAdapterOptions, i as ReferralDashboardResponse, j as ReferralEarningsResponse, k as RedeemReferralCodeRequest, l as RedeemReferralCodeResponse, m as UpdateReferralCodeRequest, n as UpdateReferralCodeResponse, G as GoogleOAuthSellerCredentialPlatform, o as GoogleOAuthSellerCredentialUploadBodyByPlatform, Q as QuotesBestByPlatformRequest, p as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, q as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, r as PostDepositDetailsResponse, s as GetPayeeDetailsRequest, t as GetPayeeDetailsResponse, u as GetOwnerDepositsRequest, v as GetOwnerDepositsResponse, w as GetTakerTierRequest, x as GetTakerTierResponse, y as GetDepositBundleParams, z as GetDepositBundleResponse, E as GetOrderbookParams, F as GetOrderbookResponse, H as CurrencyType, T as TakerTierLevel, J as PaymentMethodCatalog, K as TxOverrides } from './vaultUtils-DI-r1LAg.js';
|
|
2
|
+
export { _ as ActionCallback, ar as ApiDeposit, ay as ApiIntentStatus, b7 as AttestationServiceSellerCredentialProbeResponse, X as AuthorizationTokenProvider, cN as BatchResult, a7 as BestByPlatformResponseObject, b8 as BuyerTeePaymentParams, b9 as BuyerTeePaymentProofInput, ba as BuyerTeeSessionMaterial, O as CancelIntentMethodParams, a6 as CancelIntentParams, aR as CashAppCredentialUploadInput, aJ as CashAppSessionMaterial, a0 as CreateDepositConversionRate, $ as CreateDepositParams, bb as CuratorSellerCredentialStatusResponse, bc as CuratorSellerVerifyResponse, cg as Currency, cn as CurrencyData, cM as DelegationDepositTarget, cK as DelegationRoute, cL as DelegationState, cy as Deposit, cA as DepositCurrency, bw as DepositIntentStatistics, au as DepositStatus, as as DepositVerifier, at as DepositVerifierCurrency, bt as DepositVerifierData, cx as DepositView, an as FiatResponse, b6 as FulfillIntentAttestationResponse, N as FulfillIntentMethodParams, a4 as FulfillIntentParams, a8 as GetBestByPlatformResponse, a9 as GetBestByPlatformResponseObject, av as GetDepositByIdRequest, aw as GetDepositByIdResponse, aD as GetIntentByHashRequest, aE as GetIntentByHashResponse, aB as GetIntentsByDepositRequest, aC as GetIntentsByDepositResponse, ad as GetNearbyQuote, ae as GetNearbySuggestions, az as GetOwnerIntentsRequest, aA as GetOwnerIntentsResponse, aa as GetPlatformQuote, af as GetQuoteResponse, ag as GetQuoteResponseObject, ah as GetQuoteSingleResponse, bh as GetSellerCredentialStatusParams, bm as IdentityAttestationActionType, bn as IdentityAttestationOutput, bo as IdentityAttestationOutputFor, bp as IdentityAttestationParams, bE as IndexerClient, ca as IndexerDeploymentEnv, bK as IndexerDeposit, b$ as IndexerDepositDailySnapshot, c1 as IndexerDepositFilter, b_ as IndexerDepositFundActivity, c0 as IndexerDepositFundActivityType, c4 as IndexerDepositOrderDirection, c3 as IndexerDepositOrderField, c2 as IndexerDepositPagination, bN as IndexerDepositPaymentMethod, bG as IndexerDepositService, cd as IndexerFulfillmentAndPaymentResponse, cb as IndexerFulfillmentRecord, bL as IndexerIntentFulfilled, bM as IndexerIntentFulfillmentAmounts, bP as IndexerIntentStatus, bT as IndexerManagerAggregateStats, bV as IndexerManagerDailySnapshot, bU as IndexerManagerStats, bY as IndexerManualRateUpdate, bO as IndexerMethodCurrency, bZ as IndexerOracleConfigUpdate, cc as IndexerPaymentVerifiedRecord, bQ as IndexerRateManager, bS as IndexerRateManagerDelegation, c7 as IndexerRateManagerDelegationPagination, bX as IndexerRateManagerDetail, c5 as IndexerRateManagerFilter, bW as IndexerRateManagerListItem, c9 as IndexerRateManagerOrderDirection, c8 as IndexerRateManagerOrderField, c6 as IndexerRateManagerPagination, bR as IndexerRateManagerRate, bH as IndexerRateManagerService, ax as Intent, cC as IntentView, bq as MakerIdentityAttestationRequestBody, br as MakerIdentityPlatform, ap as NearbyQuote, aq as NearbySuggestions, Z as OfframpClient, bs as OnchainCurrency, cD as OnchainIntent, bv as OrderStats, bD as OrderbookEntry, ce as PAYMENT_PLATFORMS, aO as PayPalGoogleOAuthSellerCredentialUploadBody, cz as PaymentMethodData, cf as PaymentPlatformType, bB as PlatformLimit, ab as PlatformQuote, bC as PlatformRiskLevel, bu as PreparedTransaction, am as QuoteFeesResponse, al as QuoteIntentResponse, ac as QuoteRequest, ai as QuoteResponse, aj as QuoteResponseObject, ak as QuoteSingleResponse, a1 as Range, cB as ReferralFee, aF as RegisterPayeeDetailsRequest, aG as RegisterPayeeDetailsResponse, bd as RegisteredSellerCredentialPlatform, bf as RegisteredUploadSellerCredentialParams, a5 as ReleaseFundsToPayerParams, cs as RuntimeEnv, b4 as SellerAttestationOutput, aU as SellerCiphertextBundle, aZ as SellerCredentialBundleUpload, b5 as SellerCredentialProbeResponse, a$ as SellerCredentialStatus, a_ as SellerCredentialStatusValue, aT as SellerCredentialUploadInputByPlatform, b3 as SellerPaymentTypedDataValue, aH as SellerPlatform, aY as SellerProbeInput, aV as SellerSignedCiphertextBundle, b1 as SellerTypedDataField, b2 as SellerTypedDataSpec, aX as SellerVerifyInput, aW as SellerVerifyIntentDetails, b0 as SellerVerifyProxyBody, cP as SendBatchFn, cO as SendTransactionFn, M as SignalIntentMethodParams, a3 as SignalIntentParams, L as SignalIntentReferralFee, bx as TakerTier, bA as TakerTierSource, bz as TakerTierStats, by as TakerTierVolumeBreakdown, Y as TimeoutConfig, ao as TokenResponse, bk as UploadGoogleOAuthSellerCredentialParams, bi as UploadPayPalGoogleOAuthSellerCredentialParams, bg as UploadSellerCredentialOptions, be as UploadSellerCredentialParams, bj as UploadVenmoGoogleOAuthSellerCredentialParams, aQ as VenmoCredentialUploadInput, aP as VenmoGoogleOAuthSellerCredentialUploadBody, aI as VenmoSessionMaterial, bl as VerifySellerPaymentParams, aS as WiseCredentialUploadInput, aL as WiseProfileInfo, aN as WiseProfileNotFound, aM as WiseProfileSelectionRequired, aK as WiseSessionMaterial, a2 as WithdrawDepositParams, cE as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, W as Zkp2pClientOptions, cJ as classifyDelegationState, bI as compareEventCursorIdsByRecency, ch as currencyInfo, bF as defaultIndexerEndpoint, cv as enrichPvDepositView, cw as enrichPvIntentView, bJ as fetchIndexerFulfillmentAndPayment, co as getContracts, ck as getCurrencyCodeFromHash, cj as getCurrencyInfoFromCountryCode, ci as getCurrencyInfoFromHash, cI as getDelegationRoute, cr as getGatingServiceAddress, cq as getPaymentMethodsCatalog, cp as getRateManagerContracts, cl as isSupportedCurrencyHash, cF as isZeroRateManagerId, cm as mapConversionRatesToOnchainMinRate, cG as normalizeRateManagerId, cH as normalizeRegistry, ct as parseDepositView, cu as parseIntentView } from './vaultUtils-DI-r1LAg.js';
|
|
3
3
|
import { Address, Hash, Hex, WalletClient } from 'viem';
|
|
4
4
|
import { Abi } from 'abitype';
|
|
5
5
|
export { IdentityActionType, IdentityActionTypeByPlatform, IdentityParamsByPlatform, IdentityPlatform, NitroAttestationClient, NitroAttestationClientOptions, NitroAttestationEnvironment, VerifiedAttestation, VerifiedAttestationPayload, createNitroAttestationClient } from '@zkp2p/zkp2p-attestation';
|
|
@@ -70,6 +70,9 @@ declare const assertValidReferrerFeeConfig: (config: ReferrerFeeConfig | undefin
|
|
|
70
70
|
declare const parseReferrerFeeConfig: (recipient: string | null | undefined, feeBpsValue: string | number | null | undefined) => ReferrerFeeConfig | null;
|
|
71
71
|
declare const referrerFeeConfigToPreciseUnits: (config: ReferrerFeeConfig) => bigint;
|
|
72
72
|
|
|
73
|
+
declare const normalizeReferralCode: (code: string) => string;
|
|
74
|
+
declare const isValidReferralCode: (code: string) => boolean;
|
|
75
|
+
|
|
73
76
|
interface EscrowContractContext {
|
|
74
77
|
address: Address;
|
|
75
78
|
abi: Abi;
|
|
@@ -229,6 +232,10 @@ declare function apiGetOwnerDeposits(req: GetOwnerDepositsRequest, apiKey: strin
|
|
|
229
232
|
* Get taker tier information for a specific address.
|
|
230
233
|
*/
|
|
231
234
|
declare function apiGetTakerTier(req: GetTakerTierRequest, baseApiUrl: string, timeoutMs?: number): Promise<GetTakerTierResponse>;
|
|
235
|
+
declare function apiGetReferralDashboard(opts: ApiAdapterOptions): Promise<ReferralDashboardResponse>;
|
|
236
|
+
declare function apiGetReferralEarnings(opts: ApiAdapterOptions): Promise<ReferralEarningsResponse>;
|
|
237
|
+
declare function apiRedeemReferralCode(req: RedeemReferralCodeRequest, opts: ApiAdapterOptions): Promise<RedeemReferralCodeResponse>;
|
|
238
|
+
declare function apiUpdateReferralCode(req: UpdateReferralCodeRequest, opts: ApiAdapterOptions): Promise<UpdateReferralCodeResponse>;
|
|
232
239
|
declare function apiUploadGoogleOAuthSellerCredential<P extends GoogleOAuthSellerCredentialPlatform>(processorName: P, payeeDetails: Hash, body: GoogleOAuthSellerCredentialUploadBodyByPlatform[P], baseApiUrl: string, opts?: {
|
|
233
240
|
timeoutMs?: number;
|
|
234
241
|
}): Promise<CuratorSellerCredentialUploadResponse>;
|
|
@@ -460,10 +467,10 @@ declare const TOKEN_METADATA: {
|
|
|
460
467
|
* tier engine (curator `src/common/services/tier/tierConstants.ts`), which is
|
|
461
468
|
* what the backend actually enforces.
|
|
462
469
|
*
|
|
463
|
-
* The live qualification signal is
|
|
464
|
-
*
|
|
465
|
-
*
|
|
466
|
-
*
|
|
470
|
+
* The live qualification signal is Peer Pay volume. Historical maker tiers
|
|
471
|
+
* earned before July 1, 2026 UTC are preserved; after that cutoff, only Peer
|
|
472
|
+
* Pay volume moves the tier. Curator keeps the response field name
|
|
473
|
+
* `peerPayVolume` for compatibility.
|
|
467
474
|
*
|
|
468
475
|
* A user's *live* tier, cap, and progression always come from the taker-tier
|
|
469
476
|
* API payload (`TakerTier.perIntentCapBaseUnits`, `minVolumeForTier`,
|
|
@@ -474,9 +481,8 @@ declare const TOKEN_METADATA: {
|
|
|
474
481
|
* (the Fees & Tiers ladder) when no live payload is available; never gate or
|
|
475
482
|
* compute a user's real cap from it.
|
|
476
483
|
*
|
|
477
|
-
* Volume bands track the live
|
|
478
|
-
*
|
|
479
|
-
* PRO $50k, PLATINUM $100k. Caps ($100/$250/$1k/$2.5k/$5k) are unchanged.
|
|
484
|
+
* Volume bands track the live tuned qualification thresholds — PEER $1k,
|
|
485
|
+
* PLUS $10k, PRO $50k, PLATINUM $100k. Caps ($100/$250/$1k/$2.5k/$5k) are unchanged.
|
|
480
486
|
* Read the live per-user values from the API: curator can change qualification
|
|
481
487
|
* inputs behind the compatibility fields without changing this reference table.
|
|
482
488
|
*
|
|
@@ -487,9 +493,9 @@ interface TakerTierScheduleEntry {
|
|
|
487
493
|
tier: TakerTierLevel;
|
|
488
494
|
/** Per-intent order cap in whole USD (base, before platform risk multipliers). */
|
|
489
495
|
perIntentCapUsd: number;
|
|
490
|
-
/** Inclusive lower bound of
|
|
496
|
+
/** Inclusive lower bound of Peer Pay volume (USD) that qualifies for this tier. */
|
|
491
497
|
minVolumeUsd: number;
|
|
492
|
-
/** Inclusive upper bound of
|
|
498
|
+
/** Inclusive upper bound of Peer Pay volume (USD); `Infinity` for the top tier. */
|
|
493
499
|
maxVolumeUsd: number;
|
|
494
500
|
}
|
|
495
501
|
declare const TAKER_TIER_SCHEDULE: readonly TakerTierScheduleEntry[];
|
|
@@ -791,4 +797,4 @@ declare class ContractError extends ZKP2PError {
|
|
|
791
797
|
constructor(message: string, details?: unknown);
|
|
792
798
|
}
|
|
793
799
|
|
|
794
|
-
export { APIError, ApiAdapterOptions, AttestationServiceIdentityResponse, AttestationServiceSellerCredentialUploadResponse, AttestationServiceSellerVerifyResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, BuyerTeeVerifyPaymentBody, 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_FEE_DISCOUNT_BPS, 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, apiVerifyBuyerTeePayment, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, createPeerExtensionSdk, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, ensureBytes32, getAttributionDataSuffix, getNextTakerTier, getPeerExtensionState, getSpreadOracleConfig, getTakerTierFeeDiscountBps, isPeerExtensionAvailable, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, referrerFeeConfigToPreciseUnits, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
|
|
800
|
+
export { APIError, ApiAdapterOptions, AttestationServiceIdentityResponse, AttestationServiceSellerCredentialUploadResponse, AttestationServiceSellerVerifyResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, BuyerTeeVerifyPaymentBody, 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, RedeemReferralCodeRequest, RedeemReferralCodeResponse, ReferralDashboardResponse, ReferralEarningsResponse, ReferrerFeeConfig, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, SellerCredentialAttestationRuntime, SellerCredentialBundle, SellerCredentialUploadInput, SellerCredentialUploadPlatform, type SpreadOracleConfig, type SpreadOracleFeedConfig, type SupportedChainId, TAKER_TIER_CAPS, TAKER_TIER_FEE_DISCOUNT_BPS, TAKER_TIER_ORDER, TAKER_TIER_SCHEDULE, TOKEN_METADATA, TakerTierLevel, type TakerTierScheduleEntry, TxOverrides, UpdateReferralCodeRequest, UpdateReferralCodeResponse, UploadSellerCredentialBundleParams, ValidatePayeeDetailsRequest, ValidatePayeeDetailsResponse, ValidationError, ZKP2PError, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuotesBestByPlatform, apiGetReferralDashboard, apiGetReferralEarnings, apiGetTakerTier, apiPostDepositDetails, apiRedeemReferralCode, apiRequestIdentityAttestation, apiUpdateReferralCode, apiUploadGoogleOAuthSellerCredential, apiUploadSellerCredentialBundle, apiValidatePayeeDetails, apiVerifyBuyerTeePayment, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, createPeerExtensionSdk, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, ensureBytes32, getAttributionDataSuffix, getNextTakerTier, getPeerExtensionState, getSpreadOracleConfig, getTakerTierFeeDiscountBps, isPeerExtensionAvailable, isValidReferralCode, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, normalizeReferralCode, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, referrerFeeConfigToPreciseUnits, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { TAKER_TIER_CAPS, TAKER_TIER_FEE_DISCOUNT_BPS, TAKER_TIER_ORDER, TAKER_TIER_SCHEDULE, ZERO_RATE_MANAGER_ID, classifyDelegationState, getDelegationRoute, getNextTakerTier, getTakerTierFeeDiscountBps, isZeroRateManagerId, normalizeRateManagerId, normalizeRegistry } from './chunk-
|
|
1
|
+
export { TAKER_TIER_CAPS, TAKER_TIER_FEE_DISCOUNT_BPS, TAKER_TIER_ORDER, TAKER_TIER_SCHEDULE, ZERO_RATE_MANAGER_ID, classifyDelegationState, getDelegationRoute, getNextTakerTier, getTakerTierFeeDiscountBps, isZeroRateManagerId, normalizeRateManagerId, normalizeRegistry } from './chunk-BQINCOSO.mjs';
|
|
2
2
|
import { ValidationError, APIError, NetworkError } from './chunk-GHQK65J2.mjs';
|
|
3
3
|
export { APIError, ContractError, ErrorCode, NetworkError, ValidationError, ZKP2PError } from './chunk-GHQK65J2.mjs';
|
|
4
4
|
import { getContracts, getRateManagerContracts, getPaymentMethodsCatalog, resolvePaymentMethodHashFromCatalog, getGatingServiceAddress, parseBigIntLike, resolveFiatCurrencyBytes32, resolvePaymentMethodNameFromHash } from './chunk-NMIFJSZ3.mjs';
|
|
@@ -5192,10 +5192,17 @@ var logger = {
|
|
|
5192
5192
|
}
|
|
5193
5193
|
};
|
|
5194
5194
|
|
|
5195
|
+
// src/referral.ts
|
|
5196
|
+
var normalizeReferralCode = (code) => code.trim().toUpperCase();
|
|
5197
|
+
var isValidReferralCode = (code) => /^[A-Z0-9]{6}$/.test(normalizeReferralCode(code));
|
|
5198
|
+
|
|
5195
5199
|
// src/adapters/api.ts
|
|
5196
|
-
function createHeaders(apiKey) {
|
|
5200
|
+
function createHeaders(apiKey, authorizationToken) {
|
|
5197
5201
|
const headers2 = { "Content-Type": "application/json" };
|
|
5198
5202
|
if (apiKey) headers2["x-api-key"] = apiKey;
|
|
5203
|
+
if (authorizationToken) {
|
|
5204
|
+
headers2.Authorization = authorizationToken.startsWith("Bearer ") ? authorizationToken : `Bearer ${authorizationToken}`;
|
|
5205
|
+
}
|
|
5199
5206
|
return headers2;
|
|
5200
5207
|
}
|
|
5201
5208
|
function withApiBase(baseApiUrl) {
|
|
@@ -5210,6 +5217,7 @@ async function apiFetch({
|
|
|
5210
5217
|
method = "GET",
|
|
5211
5218
|
body,
|
|
5212
5219
|
apiKey,
|
|
5220
|
+
authorizationToken,
|
|
5213
5221
|
timeoutMs,
|
|
5214
5222
|
retryCount = 3,
|
|
5215
5223
|
retryDelayMs = 1e3
|
|
@@ -5221,7 +5229,7 @@ async function apiFetch({
|
|
|
5221
5229
|
try {
|
|
5222
5230
|
const options = {
|
|
5223
5231
|
method,
|
|
5224
|
-
headers: createHeaders(apiKey)
|
|
5232
|
+
headers: createHeaders(apiKey, authorizationToken)
|
|
5225
5233
|
};
|
|
5226
5234
|
if (body && method !== "GET") {
|
|
5227
5235
|
options.body = JSON.stringify(body);
|
|
@@ -5241,6 +5249,18 @@ async function apiFetch({
|
|
|
5241
5249
|
timeoutMs
|
|
5242
5250
|
);
|
|
5243
5251
|
}
|
|
5252
|
+
function unwrapResponseObject(payload) {
|
|
5253
|
+
if (payload && typeof payload === "object" && "responseObject" in payload) {
|
|
5254
|
+
return payload.responseObject;
|
|
5255
|
+
}
|
|
5256
|
+
return payload;
|
|
5257
|
+
}
|
|
5258
|
+
function requireAuthorizationToken(authorizationToken, endpoint) {
|
|
5259
|
+
if (!authorizationToken) {
|
|
5260
|
+
throw new ValidationError(`authorizationToken is required for ${endpoint}`, "authorizationToken");
|
|
5261
|
+
}
|
|
5262
|
+
return authorizationToken;
|
|
5263
|
+
}
|
|
5244
5264
|
function requireEscrowAddress(escrowAddress, endpoint) {
|
|
5245
5265
|
if (!escrowAddress) {
|
|
5246
5266
|
throw new ValidationError(`escrowAddress is required for ${endpoint}`, "escrowAddress");
|
|
@@ -5494,6 +5514,52 @@ async function apiGetTakerTier(req, baseApiUrl, timeoutMs) {
|
|
|
5494
5514
|
timeoutMs
|
|
5495
5515
|
});
|
|
5496
5516
|
}
|
|
5517
|
+
async function apiGetReferralDashboard(opts) {
|
|
5518
|
+
const endpoint = "/v2/referral";
|
|
5519
|
+
const authorizationToken = requireAuthorizationToken(opts.authorizationToken, endpoint);
|
|
5520
|
+
const response = await apiFetch({
|
|
5521
|
+
url: `${withApiBase(opts.baseApiUrl)}${endpoint}`,
|
|
5522
|
+
method: "GET",
|
|
5523
|
+
authorizationToken,
|
|
5524
|
+
timeoutMs: opts.timeoutMs
|
|
5525
|
+
});
|
|
5526
|
+
return unwrapResponseObject(response);
|
|
5527
|
+
}
|
|
5528
|
+
async function apiGetReferralEarnings(opts) {
|
|
5529
|
+
const endpoint = "/v2/referral/earnings";
|
|
5530
|
+
const authorizationToken = requireAuthorizationToken(opts.authorizationToken, endpoint);
|
|
5531
|
+
const response = await apiFetch({
|
|
5532
|
+
url: `${withApiBase(opts.baseApiUrl)}${endpoint}`,
|
|
5533
|
+
method: "GET",
|
|
5534
|
+
authorizationToken,
|
|
5535
|
+
timeoutMs: opts.timeoutMs
|
|
5536
|
+
});
|
|
5537
|
+
return unwrapResponseObject(response);
|
|
5538
|
+
}
|
|
5539
|
+
async function apiRedeemReferralCode(req, opts) {
|
|
5540
|
+
const endpoint = "/v2/referral/redeem";
|
|
5541
|
+
const authorizationToken = requireAuthorizationToken(opts.authorizationToken, endpoint);
|
|
5542
|
+
const response = await apiFetch({
|
|
5543
|
+
url: `${withApiBase(opts.baseApiUrl)}${endpoint}`,
|
|
5544
|
+
method: "POST",
|
|
5545
|
+
body: { code: normalizeReferralCode(req.code) },
|
|
5546
|
+
authorizationToken,
|
|
5547
|
+
timeoutMs: opts.timeoutMs
|
|
5548
|
+
});
|
|
5549
|
+
return unwrapResponseObject(response);
|
|
5550
|
+
}
|
|
5551
|
+
async function apiUpdateReferralCode(req, opts) {
|
|
5552
|
+
const endpoint = "/v2/referral/code";
|
|
5553
|
+
const authorizationToken = requireAuthorizationToken(opts.authorizationToken, endpoint);
|
|
5554
|
+
const response = await apiFetch({
|
|
5555
|
+
url: `${withApiBase(opts.baseApiUrl)}${endpoint}`,
|
|
5556
|
+
method: "PATCH",
|
|
5557
|
+
body: { code: normalizeReferralCode(req.code) },
|
|
5558
|
+
authorizationToken,
|
|
5559
|
+
timeoutMs: opts.timeoutMs
|
|
5560
|
+
});
|
|
5561
|
+
return unwrapResponseObject(response);
|
|
5562
|
+
}
|
|
5497
5563
|
async function apiUploadSellerCredential(processorName, payeeDetails, bundle, baseApiUrl, timeoutMs) {
|
|
5498
5564
|
const endpoint = `/v2/makers/${encodeURIComponent(processorName)}/${encodeURIComponent(
|
|
5499
5565
|
payeeDetails
|
|
@@ -6800,6 +6866,7 @@ var Zkp2pClient = class {
|
|
|
6800
6866
|
this.baseApiUrl = opts.baseApiUrl;
|
|
6801
6867
|
this.apiKey = opts.apiKey;
|
|
6802
6868
|
this.authorizationToken = opts.authorizationToken;
|
|
6869
|
+
this.getAuthorizationToken = opts.getAuthorizationToken;
|
|
6803
6870
|
this.apiTimeoutMs = opts.timeouts?.api ?? 15e3;
|
|
6804
6871
|
this._pvReader = new ProtocolViewerReader({
|
|
6805
6872
|
getPublicClient: () => this.publicClient,
|
|
@@ -6895,6 +6962,16 @@ var Zkp2pClient = class {
|
|
|
6895
6962
|
`attestationServiceUrl is required when baseApiUrl is not a supported zkp2p API host: ${baseApiUrl}`
|
|
6896
6963
|
);
|
|
6897
6964
|
}
|
|
6965
|
+
async resolveAuthorizationToken(opts) {
|
|
6966
|
+
if (opts?.authorizationToken !== void 0) {
|
|
6967
|
+
return opts.authorizationToken;
|
|
6968
|
+
}
|
|
6969
|
+
const provider = opts?.getAuthorizationToken ?? this.getAuthorizationToken;
|
|
6970
|
+
if (provider) {
|
|
6971
|
+
return await provider() ?? void 0;
|
|
6972
|
+
}
|
|
6973
|
+
return this.authorizationToken;
|
|
6974
|
+
}
|
|
6898
6975
|
normalizeOracleRateConfig(config) {
|
|
6899
6976
|
return normalizeOracleRateConfig(config);
|
|
6900
6977
|
}
|
|
@@ -8179,6 +8256,51 @@ var Zkp2pClient = class {
|
|
|
8179
8256
|
const timeoutMs = opts?.timeoutMs ?? this.apiTimeoutMs;
|
|
8180
8257
|
return apiGetTakerTier(req, baseApiUrl, timeoutMs);
|
|
8181
8258
|
}
|
|
8259
|
+
/**
|
|
8260
|
+
* Fetch the authenticated user's referral dashboard, including their generated
|
|
8261
|
+
* code, reward rates, referee counts, and lifetime referral fees.
|
|
8262
|
+
*/
|
|
8263
|
+
async getReferralDashboard(opts) {
|
|
8264
|
+
const baseApiUrl = this.stripTrailingSlash(
|
|
8265
|
+
opts?.baseApiUrl ?? this.baseApiUrl ?? DEFAULT_BASE_API_URL
|
|
8266
|
+
);
|
|
8267
|
+
const timeoutMs = opts?.timeoutMs ?? this.apiTimeoutMs;
|
|
8268
|
+
const authorizationToken = await this.resolveAuthorizationToken(opts);
|
|
8269
|
+
return apiGetReferralDashboard({ baseApiUrl, timeoutMs, authorizationToken });
|
|
8270
|
+
}
|
|
8271
|
+
/**
|
|
8272
|
+
* Fetch the authenticated user's referral earnings totals.
|
|
8273
|
+
*/
|
|
8274
|
+
async getReferralEarnings(opts) {
|
|
8275
|
+
const baseApiUrl = this.stripTrailingSlash(
|
|
8276
|
+
opts?.baseApiUrl ?? this.baseApiUrl ?? DEFAULT_BASE_API_URL
|
|
8277
|
+
);
|
|
8278
|
+
const timeoutMs = opts?.timeoutMs ?? this.apiTimeoutMs;
|
|
8279
|
+
const authorizationToken = await this.resolveAuthorizationToken(opts);
|
|
8280
|
+
return apiGetReferralEarnings({ baseApiUrl, timeoutMs, authorizationToken });
|
|
8281
|
+
}
|
|
8282
|
+
/**
|
|
8283
|
+
* Apply another user's referral code to the authenticated account.
|
|
8284
|
+
*/
|
|
8285
|
+
async redeemReferralCode(code, opts) {
|
|
8286
|
+
const baseApiUrl = this.stripTrailingSlash(
|
|
8287
|
+
opts?.baseApiUrl ?? this.baseApiUrl ?? DEFAULT_BASE_API_URL
|
|
8288
|
+
);
|
|
8289
|
+
const timeoutMs = opts?.timeoutMs ?? this.apiTimeoutMs;
|
|
8290
|
+
const authorizationToken = await this.resolveAuthorizationToken(opts);
|
|
8291
|
+
return apiRedeemReferralCode({ code }, { baseApiUrl, timeoutMs, authorizationToken });
|
|
8292
|
+
}
|
|
8293
|
+
/**
|
|
8294
|
+
* Customize the authenticated user's own referral code.
|
|
8295
|
+
*/
|
|
8296
|
+
async updateReferralCode(code, opts) {
|
|
8297
|
+
const baseApiUrl = this.stripTrailingSlash(
|
|
8298
|
+
opts?.baseApiUrl ?? this.baseApiUrl ?? DEFAULT_BASE_API_URL
|
|
8299
|
+
);
|
|
8300
|
+
const timeoutMs = opts?.timeoutMs ?? this.apiTimeoutMs;
|
|
8301
|
+
const authorizationToken = await this.resolveAuthorizationToken(opts);
|
|
8302
|
+
return apiUpdateReferralCode({ code }, { baseApiUrl, timeoutMs, authorizationToken });
|
|
8303
|
+
}
|
|
8182
8304
|
/**
|
|
8183
8305
|
* The signed `credentialValidatedAt` field is an upload-time freshness witness minted by
|
|
8184
8306
|
* attestation-service. `credentialExpiresAt` carries an upstream session expiry hint when one
|
|
@@ -8565,6 +8687,6 @@ var createPeerExtensionSdk = (options = {}) => ({
|
|
|
8565
8687
|
});
|
|
8566
8688
|
var peerExtensionSdk = createPeerExtensionSdk();
|
|
8567
8689
|
|
|
8568
|
-
export { BASE_BUILDER_CODE, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ContractRouter, DEFAULT_ORACLE_MAX_STALENESS_SECONDS, IndexerClient, IndexerDepositService, IndexerRateManagerService, Zkp2pClient as OfframpClient, PAYMENT_PLATFORMS, PEER_EXTENSION_CHROME_URL, PLATFORM_METADATA, PYTH_CONTRACT_BASE, PYTH_ORACLE_ADAPTER, PYTH_ORACLE_FEEDS, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, TOKEN_METADATA, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, Zkp2pClient, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuotesBestByPlatform, apiGetTakerTier, apiPostDepositDetails, apiRequestIdentityAttestation, apiUploadGoogleOAuthSellerCredential, apiUploadSellerCredentialBundle, apiValidatePayeeDetails, apiVerifyBuyerTeePayment, appendAttributionToCalldata, assertValidReferrerFeeConfig, compareEventCursorIdsByRecency, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, createPeerExtensionSdk, defaultIndexerEndpoint, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, fetchFulfillmentAndPayment as fetchIndexerFulfillmentAndPayment, getAttributionDataSuffix, getPeerExtensionState, getSpreadOracleConfig, isPeerExtensionAvailable, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, referrerFeeConfigToPreciseUnits, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
|
|
8690
|
+
export { BASE_BUILDER_CODE, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ContractRouter, DEFAULT_ORACLE_MAX_STALENESS_SECONDS, IndexerClient, IndexerDepositService, IndexerRateManagerService, Zkp2pClient as OfframpClient, PAYMENT_PLATFORMS, PEER_EXTENSION_CHROME_URL, PLATFORM_METADATA, PYTH_CONTRACT_BASE, PYTH_ORACLE_ADAPTER, PYTH_ORACLE_FEEDS, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, TOKEN_METADATA, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, Zkp2pClient, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuotesBestByPlatform, apiGetReferralDashboard, apiGetReferralEarnings, apiGetTakerTier, apiPostDepositDetails, apiRedeemReferralCode, apiRequestIdentityAttestation, apiUpdateReferralCode, apiUploadGoogleOAuthSellerCredential, apiUploadSellerCredentialBundle, apiValidatePayeeDetails, apiVerifyBuyerTeePayment, appendAttributionToCalldata, assertValidReferrerFeeConfig, compareEventCursorIdsByRecency, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, createPeerExtensionSdk, defaultIndexerEndpoint, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, fetchFulfillmentAndPayment as fetchIndexerFulfillmentAndPayment, getAttributionDataSuffix, getPeerExtensionState, getSpreadOracleConfig, isPeerExtensionAvailable, isValidReferralCode, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, normalizeReferralCode, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, referrerFeeConfigToPreciseUnits, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
|
|
8569
8691
|
//# sourceMappingURL=index.mjs.map
|
|
8570
8692
|
//# sourceMappingURL=index.mjs.map
|