@zkp2p/sdk 0.3.1 → 0.3.2-rc.0

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/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, Q as QuotesBestByPlatformRequest, B as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, a as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, b as PostDepositDetailsResponse, G as GetPayeeDetailsRequest, c as GetPayeeDetailsResponse, d as GetOwnerDepositsRequest, e as GetOwnerDepositsResponse, f as GetTakerTierRequest, g as GetTakerTierResponse, C as CurrencyType, h as PaymentMethodCatalog, T as TxOverrides } from './vaultUtils-DATqc35J.mjs';
2
- export { m as ActionCallback, a1 as ApiDeposit, a8 as ApiIntentStatus, A as AuthorizationTokenProvider, bA as BatchResult, u as BestByPlatformResponseObject, j as CancelIntentMethodParams, t as CancelIntentParams, o as CreateDepositConversionRate, n as CreateDepositParams, b3 as Currency, ba as CurrencyData, bz as DelegationDepositTarget, bx as DelegationRoute, by as DelegationState, bl as Deposit, bn as DepositCurrency, al as DepositIntentStatistics, a4 as DepositStatus, a2 as DepositVerifier, a3 as DepositVerifierCurrency, ai as DepositVerifierData, bk as DepositView, Y as FiatResponse, F as FulfillIntentMethodParams, r as FulfillIntentParams, v as GetBestByPlatformResponse, w as GetBestByPlatformResponseObject, a5 as GetDepositByIdRequest, a6 as GetDepositByIdResponse, ad as GetIntentByHashRequest, ae as GetIntentByHashResponse, ab as GetIntentsByDepositRequest, ac as GetIntentsByDepositResponse, E as GetNearbyQuote, H as GetNearbySuggestions, a9 as GetOwnerIntentsRequest, aa as GetOwnerIntentsResponse, x as GetPlatformQuote, J as GetQuoteResponse, K as GetQuoteResponseObject, L as GetQuoteSingleResponse, ar as IndexerClient, aZ as IndexerDeploymentEnv, ax as IndexerDeposit, aO as IndexerDepositDailySnapshot, aQ as IndexerDepositFilter, aN as IndexerDepositFundActivity, aP as IndexerDepositFundActivityType, aT as IndexerDepositOrderDirection, aS as IndexerDepositOrderField, aR as IndexerDepositPagination, aA as IndexerDepositPaymentMethod, at as IndexerDepositService, b0 as IndexerFulfillmentAndPaymentResponse, a_ as IndexerFulfillmentRecord, ay as IndexerIntentFulfilled, az as IndexerIntentFulfillmentAmounts, aC as IndexerIntentStatus, aG as IndexerManagerAggregateStats, aI as IndexerManagerDailySnapshot, aH as IndexerManagerStats, aL as IndexerManualRateUpdate, aB as IndexerMethodCurrency, aM as IndexerOracleConfigUpdate, a$ as IndexerPaymentVerifiedRecord, aD as IndexerRateManager, aF as IndexerRateManagerDelegation, aW as IndexerRateManagerDelegationPagination, aK as IndexerRateManagerDetail, aU as IndexerRateManagerFilter, aJ as IndexerRateManagerListItem, aY as IndexerRateManagerOrderDirection, aX as IndexerRateManagerOrderField, aV as IndexerRateManagerPagination, aE as IndexerRateManagerRate, au as IndexerRateManagerService, a7 as Intent, bp as IntentView, $ as NearbyQuote, a0 as NearbySuggestions, Z as OfframpClient, ah as OnchainCurrency, bq as OnchainIntent, ak as OrderStats, b1 as PAYMENT_PLATFORMS, bm as PaymentMethodData, b2 as PaymentPlatformType, ap as PlatformLimit, y as PlatformQuote, aq as PlatformRiskLevel, aj as PreparedTransaction, X as QuoteFeesResponse, U as QuoteIntentResponse, z as QuoteRequest, M as QuoteResponse, N as QuoteResponseObject, O as QuoteSingleResponse, p as Range, bo as ReferralFee, af as RegisterPayeeDetailsRequest, ag as RegisterPayeeDetailsResponse, s as ReleaseFundsToPayerParams, bf as RuntimeEnv, bC as SendBatchFn, bB as SendTransactionFn, i as SignalIntentMethodParams, q as SignalIntentParams, S as SignalIntentReferralFee, am as TakerTier, ao as TakerTierLevel, an as TakerTierStats, l as TimeoutConfig, _ as TokenResponse, W as WithdrawDepositParams, br as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, k as Zkp2pClientOptions, bw as classifyDelegationState, av as compareEventCursorIdsByRecency, b4 as currencyInfo, as as defaultIndexerEndpoint, bi as enrichPvDepositView, bj as enrichPvIntentView, aw as fetchIndexerFulfillmentAndPayment, bb as getContracts, b7 as getCurrencyCodeFromHash, b6 as getCurrencyInfoFromCountryCode, b5 as getCurrencyInfoFromHash, bv as getDelegationRoute, be as getGatingServiceAddress, bd as getPaymentMethodsCatalog, bc as getRateManagerContracts, b8 as isSupportedCurrencyHash, bs as isZeroRateManagerId, b9 as mapConversionRatesToOnchainMinRate, bt as normalizeRateManagerId, bu as normalizeRegistry, bg as parseDepositView, bh as parseIntentView } from './vaultUtils-DATqc35J.mjs';
1
+ import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, Q as QuotesBestByPlatformRequest, B as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, a as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, b as PostDepositDetailsResponse, G as GetPayeeDetailsRequest, c as GetPayeeDetailsResponse, d as GetOwnerDepositsRequest, e as GetOwnerDepositsResponse, f as GetTakerTierRequest, g as GetTakerTierResponse, h as GetDepositBundleParams, A as ApiAdapterOptions, i as GetDepositBundleResponse, j as GetOrderbookParams, k as GetOrderbookResponse, C as CurrencyType, l as PaymentMethodCatalog, T as TxOverrides } from './vaultUtils-C-9Z50Ak.mjs';
2
+ export { r as ActionCallback, a6 as ApiDeposit, ad as ApiIntentStatus, aM as AttestationServiceSellerCredentialProbeResponse, aK as AttestationServiceSellerCredentialUploadResponse, aL as AttestationServiceSellerVerifyResponse, p as AuthorizationTokenProvider, cb as BatchResult, z as BestByPlatformResponseObject, n as CancelIntentMethodParams, y as CancelIntentParams, ar as CashAppCredentialUploadInput, ao as CashAppSessionMaterial, t as CreateDepositConversionRate, s as CreateDepositParams, aO as CuratorSellerCredentialStatusResponse, aN as CuratorSellerCredentialUploadResponse, aP as CuratorSellerVerifyResponse, bG as Currency, bN as CurrencyData, ca as DelegationDepositTarget, c8 as DelegationRoute, c9 as DelegationState, bY as Deposit, b_ as DepositCurrency, aX as DepositIntentStatistics, a9 as DepositStatus, a7 as DepositVerifier, a8 as DepositVerifierCurrency, aU as DepositVerifierData, bX as DepositView, a2 as FiatResponse, F as FulfillIntentMethodParams, w as FulfillIntentParams, E as GetBestByPlatformResponse, H as GetBestByPlatformResponseObject, aa as GetDepositByIdRequest, ab as GetDepositByIdResponse, ai as GetIntentByHashRequest, aj as GetIntentByHashResponse, ag as GetIntentsByDepositRequest, ah as GetIntentsByDepositResponse, M as GetNearbyQuote, N as GetNearbySuggestions, ae as GetOwnerIntentsRequest, af as GetOwnerIntentsResponse, J as GetPlatformQuote, O as GetQuoteResponse, U as GetQuoteResponseObject, X as GetQuoteSingleResponse, aR as GetSellerCredentialStatusParams, b2 as IndexerClient, bA as IndexerDeploymentEnv, b8 as IndexerDeposit, bp as IndexerDepositDailySnapshot, br as IndexerDepositFilter, bo as IndexerDepositFundActivity, bq as IndexerDepositFundActivityType, bu as IndexerDepositOrderDirection, bt as IndexerDepositOrderField, bs as IndexerDepositPagination, bb as IndexerDepositPaymentMethod, b4 as IndexerDepositService, bD as IndexerFulfillmentAndPaymentResponse, bB as IndexerFulfillmentRecord, b9 as IndexerIntentFulfilled, ba as IndexerIntentFulfillmentAmounts, bd as IndexerIntentStatus, bh as IndexerManagerAggregateStats, bj as IndexerManagerDailySnapshot, bi as IndexerManagerStats, bm as IndexerManualRateUpdate, bc as IndexerMethodCurrency, bn as IndexerOracleConfigUpdate, bC as IndexerPaymentVerifiedRecord, be as IndexerRateManager, bg as IndexerRateManagerDelegation, bx as IndexerRateManagerDelegationPagination, bl as IndexerRateManagerDetail, bv as IndexerRateManagerFilter, bk as IndexerRateManagerListItem, bz as IndexerRateManagerOrderDirection, by as IndexerRateManagerOrderField, bw as IndexerRateManagerPagination, bf as IndexerRateManagerRate, b5 as IndexerRateManagerService, ac as Intent, c0 as IntentView, a4 as NearbyQuote, a5 as NearbySuggestions, Z as OfframpClient, aT as OnchainCurrency, c1 as OnchainIntent, aW as OrderStats, b1 as OrderbookEntry, bE as PAYMENT_PLATFORMS, bZ as PaymentMethodData, bF as PaymentPlatformType, a$ as PlatformLimit, K as PlatformQuote, b0 as PlatformRiskLevel, aV as PreparedTransaction, a1 as QuoteFeesResponse, a0 as QuoteIntentResponse, L as QuoteRequest, Y as QuoteResponse, _ as QuoteResponseObject, $ as QuoteSingleResponse, u as Range, b$ as ReferralFee, ak as RegisterPayeeDetailsRequest, al as RegisterPayeeDetailsResponse, x as ReleaseFundsToPayerParams, bS as RuntimeEnv, aI as SellerAttestationOutput, av as SellerCiphertextBundle, aA as SellerCredentialBundle, aB as SellerCredentialBundleUpload, aJ as SellerCredentialProbeResponse, aD as SellerCredentialStatus, aC as SellerCredentialStatusValue, au as SellerCredentialUploadInput, at as SellerCredentialUploadInputByPlatform, aH as SellerPaymentTypedDataValue, am as SellerPlatform, az as SellerProbeInput, aw as SellerSignedCiphertextBundle, aF as SellerTypedDataField, aG as SellerTypedDataSpec, ay as SellerVerifyInput, ax as SellerVerifyIntentDetails, aE as SellerVerifyProxyBody, cd as SendBatchFn, cc as SendTransactionFn, m as SignalIntentMethodParams, v as SignalIntentParams, S as SignalIntentReferralFee, aY as TakerTier, a_ as TakerTierLevel, aZ as TakerTierStats, q as TimeoutConfig, a3 as TokenResponse, aQ as UploadSellerCredentialParams, aq as VenmoCredentialUploadInput, an as VenmoSessionMaterial, aS as VerifySellerPaymentParams, as as WiseCredentialUploadInput, ap as WiseSessionMaterial, W as WithdrawDepositParams, c2 as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, o as Zkp2pClientOptions, c7 as classifyDelegationState, b6 as compareEventCursorIdsByRecency, bH as currencyInfo, b3 as defaultIndexerEndpoint, bV as enrichPvDepositView, bW as enrichPvIntentView, b7 as fetchIndexerFulfillmentAndPayment, bO as getContracts, bK as getCurrencyCodeFromHash, bJ as getCurrencyInfoFromCountryCode, bI as getCurrencyInfoFromHash, c6 as getDelegationRoute, bR as getGatingServiceAddress, bQ as getPaymentMethodsCatalog, bP as getRateManagerContracts, bL as isSupportedCurrencyHash, c3 as isZeroRateManagerId, bM as mapConversionRatesToOnchainMinRate, c4 as normalizeRateManagerId, c5 as normalizeRegistry, bT as parseDepositView, bU as parseIntentView } from './vaultUtils-C-9Z50Ak.mjs';
3
3
  import { Address, Hex, WalletClient, Hash } from 'viem';
4
4
  import { Abi } from 'abitype';
5
5
  import '@zkp2p/indexer-schema';
@@ -207,6 +207,10 @@ declare function apiGetOwnerDeposits(req: GetOwnerDepositsRequest, apiKey: strin
207
207
  * Get taker tier information for a specific address.
208
208
  */
209
209
  declare function apiGetTakerTier(req: GetTakerTierRequest, apiKey: string | undefined, baseApiUrl: string, timeoutMs?: number): Promise<GetTakerTierResponse>;
210
+ declare function apiGetOrderbook(params: GetOrderbookParams, opts: ApiAdapterOptions): Promise<GetOrderbookResponse>;
211
+ declare function apiGetOrderbook(params: GetOrderbookParams, baseApiUrl: string, timeoutMs?: number, apiKey?: string): Promise<GetOrderbookResponse>;
212
+ declare function apiGetDepositBundle(params: GetDepositBundleParams, opts: ApiAdapterOptions): Promise<GetDepositBundleResponse>;
213
+ declare function apiGetDepositBundle(params: GetDepositBundleParams, baseApiUrl: string, timeoutMs?: number, apiKey?: string): Promise<GetDepositBundleResponse>;
210
214
 
211
215
  /** Minimal interface for the publicClient parameter, avoids viem version coupling. */
212
216
  interface MulticallClient {
@@ -705,4 +709,4 @@ declare class ContractError extends ZKP2PError {
705
709
  constructor(message: string, details?: unknown);
706
710
  }
707
711
 
708
- export { APIError, BASE_BUILDER_CODE, BestByPlatformResponse, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ContractError, ContractRouter, type ContractRouterConfig, CurrencyType, DEFAULT_ORACLE_MAX_STALENESS_SECONDS, ErrorCode, type EscrowContractContext, type EscrowDepositView, type EscrowIntentView, GetOwnerDepositsRequest, GetOwnerDepositsResponse, GetPayeeDetailsRequest, GetPayeeDetailsResponse, GetTakerTierRequest, GetTakerTierResponse, 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 PeerConnectionStatus, type PeerExtensionApi, type PeerExtensionOnrampParams, type PeerExtensionSdk, type PeerExtensionSdkOptions, type PeerExtensionState, type PeerExtensionWindow, type PeerIntentFulfilledBridgeStatus, type PeerIntentFulfilledCallback, type PeerIntentFulfilledResult, PostDepositDetailsRequest, PostDepositDetailsResponse, type PythFeedConfig, QuotesBestByPlatformRequest, ReferrerFeeConfig, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, type SpreadOracleConfig, type SpreadOracleFeedConfig, type SupportedChainId, TOKEN_METADATA, TxOverrides, ValidatePayeeDetailsRequest, ValidatePayeeDetailsResponse, ValidationError, ZKP2PError, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuotesBestByPlatform, apiGetTakerTier, apiPostDepositDetails, apiValidatePayeeDetails, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createPeerExtensionSdk, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, ensureBytes32, getAttributionDataSuffix, getPeerExtensionState, getSpreadOracleConfig, isPeerExtensionAvailable, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, referrerFeeConfigToPreciseUnits, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
712
+ export { APIError, ApiAdapterOptions, BASE_BUILDER_CODE, BestByPlatformResponse, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ContractError, ContractRouter, type ContractRouterConfig, CurrencyType, DEFAULT_ORACLE_MAX_STALENESS_SECONDS, ErrorCode, type EscrowContractContext, type EscrowDepositView, type EscrowIntentView, GetDepositBundleParams, GetDepositBundleResponse, GetOrderbookParams, GetOrderbookResponse, GetOwnerDepositsRequest, GetOwnerDepositsResponse, GetPayeeDetailsRequest, GetPayeeDetailsResponse, GetTakerTierRequest, GetTakerTierResponse, 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 PeerConnectionStatus, type PeerExtensionApi, type PeerExtensionOnrampParams, type PeerExtensionSdk, type PeerExtensionSdkOptions, type PeerExtensionState, type PeerExtensionWindow, type PeerIntentFulfilledBridgeStatus, type PeerIntentFulfilledCallback, type PeerIntentFulfilledResult, PostDepositDetailsRequest, PostDepositDetailsResponse, type PythFeedConfig, QuotesBestByPlatformRequest, ReferrerFeeConfig, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, type SpreadOracleConfig, type SpreadOracleFeedConfig, type SupportedChainId, TOKEN_METADATA, TxOverrides, ValidatePayeeDetailsRequest, ValidatePayeeDetailsResponse, ValidationError, ZKP2PError, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, apiGetDepositBundle, apiGetOrderbook, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuotesBestByPlatform, apiGetTakerTier, apiPostDepositDetails, apiValidatePayeeDetails, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createPeerExtensionSdk, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, ensureBytes32, getAttributionDataSuffix, getPeerExtensionState, getSpreadOracleConfig, isPeerExtensionAvailable, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, 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, D as DepositWithRelations, I as IntentEntity, Q as QuotesBestByPlatformRequest, B as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, a as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, b as PostDepositDetailsResponse, G as GetPayeeDetailsRequest, c as GetPayeeDetailsResponse, d as GetOwnerDepositsRequest, e as GetOwnerDepositsResponse, f as GetTakerTierRequest, g as GetTakerTierResponse, C as CurrencyType, h as PaymentMethodCatalog, T as TxOverrides } from './vaultUtils-DATqc35J.js';
2
- export { m as ActionCallback, a1 as ApiDeposit, a8 as ApiIntentStatus, A as AuthorizationTokenProvider, bA as BatchResult, u as BestByPlatformResponseObject, j as CancelIntentMethodParams, t as CancelIntentParams, o as CreateDepositConversionRate, n as CreateDepositParams, b3 as Currency, ba as CurrencyData, bz as DelegationDepositTarget, bx as DelegationRoute, by as DelegationState, bl as Deposit, bn as DepositCurrency, al as DepositIntentStatistics, a4 as DepositStatus, a2 as DepositVerifier, a3 as DepositVerifierCurrency, ai as DepositVerifierData, bk as DepositView, Y as FiatResponse, F as FulfillIntentMethodParams, r as FulfillIntentParams, v as GetBestByPlatformResponse, w as GetBestByPlatformResponseObject, a5 as GetDepositByIdRequest, a6 as GetDepositByIdResponse, ad as GetIntentByHashRequest, ae as GetIntentByHashResponse, ab as GetIntentsByDepositRequest, ac as GetIntentsByDepositResponse, E as GetNearbyQuote, H as GetNearbySuggestions, a9 as GetOwnerIntentsRequest, aa as GetOwnerIntentsResponse, x as GetPlatformQuote, J as GetQuoteResponse, K as GetQuoteResponseObject, L as GetQuoteSingleResponse, ar as IndexerClient, aZ as IndexerDeploymentEnv, ax as IndexerDeposit, aO as IndexerDepositDailySnapshot, aQ as IndexerDepositFilter, aN as IndexerDepositFundActivity, aP as IndexerDepositFundActivityType, aT as IndexerDepositOrderDirection, aS as IndexerDepositOrderField, aR as IndexerDepositPagination, aA as IndexerDepositPaymentMethod, at as IndexerDepositService, b0 as IndexerFulfillmentAndPaymentResponse, a_ as IndexerFulfillmentRecord, ay as IndexerIntentFulfilled, az as IndexerIntentFulfillmentAmounts, aC as IndexerIntentStatus, aG as IndexerManagerAggregateStats, aI as IndexerManagerDailySnapshot, aH as IndexerManagerStats, aL as IndexerManualRateUpdate, aB as IndexerMethodCurrency, aM as IndexerOracleConfigUpdate, a$ as IndexerPaymentVerifiedRecord, aD as IndexerRateManager, aF as IndexerRateManagerDelegation, aW as IndexerRateManagerDelegationPagination, aK as IndexerRateManagerDetail, aU as IndexerRateManagerFilter, aJ as IndexerRateManagerListItem, aY as IndexerRateManagerOrderDirection, aX as IndexerRateManagerOrderField, aV as IndexerRateManagerPagination, aE as IndexerRateManagerRate, au as IndexerRateManagerService, a7 as Intent, bp as IntentView, $ as NearbyQuote, a0 as NearbySuggestions, Z as OfframpClient, ah as OnchainCurrency, bq as OnchainIntent, ak as OrderStats, b1 as PAYMENT_PLATFORMS, bm as PaymentMethodData, b2 as PaymentPlatformType, ap as PlatformLimit, y as PlatformQuote, aq as PlatformRiskLevel, aj as PreparedTransaction, X as QuoteFeesResponse, U as QuoteIntentResponse, z as QuoteRequest, M as QuoteResponse, N as QuoteResponseObject, O as QuoteSingleResponse, p as Range, bo as ReferralFee, af as RegisterPayeeDetailsRequest, ag as RegisterPayeeDetailsResponse, s as ReleaseFundsToPayerParams, bf as RuntimeEnv, bC as SendBatchFn, bB as SendTransactionFn, i as SignalIntentMethodParams, q as SignalIntentParams, S as SignalIntentReferralFee, am as TakerTier, ao as TakerTierLevel, an as TakerTierStats, l as TimeoutConfig, _ as TokenResponse, W as WithdrawDepositParams, br as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, k as Zkp2pClientOptions, bw as classifyDelegationState, av as compareEventCursorIdsByRecency, b4 as currencyInfo, as as defaultIndexerEndpoint, bi as enrichPvDepositView, bj as enrichPvIntentView, aw as fetchIndexerFulfillmentAndPayment, bb as getContracts, b7 as getCurrencyCodeFromHash, b6 as getCurrencyInfoFromCountryCode, b5 as getCurrencyInfoFromHash, bv as getDelegationRoute, be as getGatingServiceAddress, bd as getPaymentMethodsCatalog, bc as getRateManagerContracts, b8 as isSupportedCurrencyHash, bs as isZeroRateManagerId, b9 as mapConversionRatesToOnchainMinRate, bt as normalizeRateManagerId, bu as normalizeRegistry, bg as parseDepositView, bh as parseIntentView } from './vaultUtils-DATqc35J.js';
1
+ import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, Q as QuotesBestByPlatformRequest, B as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, a as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, b as PostDepositDetailsResponse, G as GetPayeeDetailsRequest, c as GetPayeeDetailsResponse, d as GetOwnerDepositsRequest, e as GetOwnerDepositsResponse, f as GetTakerTierRequest, g as GetTakerTierResponse, h as GetDepositBundleParams, A as ApiAdapterOptions, i as GetDepositBundleResponse, j as GetOrderbookParams, k as GetOrderbookResponse, C as CurrencyType, l as PaymentMethodCatalog, T as TxOverrides } from './vaultUtils-C-9Z50Ak.js';
2
+ export { r as ActionCallback, a6 as ApiDeposit, ad as ApiIntentStatus, aM as AttestationServiceSellerCredentialProbeResponse, aK as AttestationServiceSellerCredentialUploadResponse, aL as AttestationServiceSellerVerifyResponse, p as AuthorizationTokenProvider, cb as BatchResult, z as BestByPlatformResponseObject, n as CancelIntentMethodParams, y as CancelIntentParams, ar as CashAppCredentialUploadInput, ao as CashAppSessionMaterial, t as CreateDepositConversionRate, s as CreateDepositParams, aO as CuratorSellerCredentialStatusResponse, aN as CuratorSellerCredentialUploadResponse, aP as CuratorSellerVerifyResponse, bG as Currency, bN as CurrencyData, ca as DelegationDepositTarget, c8 as DelegationRoute, c9 as DelegationState, bY as Deposit, b_ as DepositCurrency, aX as DepositIntentStatistics, a9 as DepositStatus, a7 as DepositVerifier, a8 as DepositVerifierCurrency, aU as DepositVerifierData, bX as DepositView, a2 as FiatResponse, F as FulfillIntentMethodParams, w as FulfillIntentParams, E as GetBestByPlatformResponse, H as GetBestByPlatformResponseObject, aa as GetDepositByIdRequest, ab as GetDepositByIdResponse, ai as GetIntentByHashRequest, aj as GetIntentByHashResponse, ag as GetIntentsByDepositRequest, ah as GetIntentsByDepositResponse, M as GetNearbyQuote, N as GetNearbySuggestions, ae as GetOwnerIntentsRequest, af as GetOwnerIntentsResponse, J as GetPlatformQuote, O as GetQuoteResponse, U as GetQuoteResponseObject, X as GetQuoteSingleResponse, aR as GetSellerCredentialStatusParams, b2 as IndexerClient, bA as IndexerDeploymentEnv, b8 as IndexerDeposit, bp as IndexerDepositDailySnapshot, br as IndexerDepositFilter, bo as IndexerDepositFundActivity, bq as IndexerDepositFundActivityType, bu as IndexerDepositOrderDirection, bt as IndexerDepositOrderField, bs as IndexerDepositPagination, bb as IndexerDepositPaymentMethod, b4 as IndexerDepositService, bD as IndexerFulfillmentAndPaymentResponse, bB as IndexerFulfillmentRecord, b9 as IndexerIntentFulfilled, ba as IndexerIntentFulfillmentAmounts, bd as IndexerIntentStatus, bh as IndexerManagerAggregateStats, bj as IndexerManagerDailySnapshot, bi as IndexerManagerStats, bm as IndexerManualRateUpdate, bc as IndexerMethodCurrency, bn as IndexerOracleConfigUpdate, bC as IndexerPaymentVerifiedRecord, be as IndexerRateManager, bg as IndexerRateManagerDelegation, bx as IndexerRateManagerDelegationPagination, bl as IndexerRateManagerDetail, bv as IndexerRateManagerFilter, bk as IndexerRateManagerListItem, bz as IndexerRateManagerOrderDirection, by as IndexerRateManagerOrderField, bw as IndexerRateManagerPagination, bf as IndexerRateManagerRate, b5 as IndexerRateManagerService, ac as Intent, c0 as IntentView, a4 as NearbyQuote, a5 as NearbySuggestions, Z as OfframpClient, aT as OnchainCurrency, c1 as OnchainIntent, aW as OrderStats, b1 as OrderbookEntry, bE as PAYMENT_PLATFORMS, bZ as PaymentMethodData, bF as PaymentPlatformType, a$ as PlatformLimit, K as PlatformQuote, b0 as PlatformRiskLevel, aV as PreparedTransaction, a1 as QuoteFeesResponse, a0 as QuoteIntentResponse, L as QuoteRequest, Y as QuoteResponse, _ as QuoteResponseObject, $ as QuoteSingleResponse, u as Range, b$ as ReferralFee, ak as RegisterPayeeDetailsRequest, al as RegisterPayeeDetailsResponse, x as ReleaseFundsToPayerParams, bS as RuntimeEnv, aI as SellerAttestationOutput, av as SellerCiphertextBundle, aA as SellerCredentialBundle, aB as SellerCredentialBundleUpload, aJ as SellerCredentialProbeResponse, aD as SellerCredentialStatus, aC as SellerCredentialStatusValue, au as SellerCredentialUploadInput, at as SellerCredentialUploadInputByPlatform, aH as SellerPaymentTypedDataValue, am as SellerPlatform, az as SellerProbeInput, aw as SellerSignedCiphertextBundle, aF as SellerTypedDataField, aG as SellerTypedDataSpec, ay as SellerVerifyInput, ax as SellerVerifyIntentDetails, aE as SellerVerifyProxyBody, cd as SendBatchFn, cc as SendTransactionFn, m as SignalIntentMethodParams, v as SignalIntentParams, S as SignalIntentReferralFee, aY as TakerTier, a_ as TakerTierLevel, aZ as TakerTierStats, q as TimeoutConfig, a3 as TokenResponse, aQ as UploadSellerCredentialParams, aq as VenmoCredentialUploadInput, an as VenmoSessionMaterial, aS as VerifySellerPaymentParams, as as WiseCredentialUploadInput, ap as WiseSessionMaterial, W as WithdrawDepositParams, c2 as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, o as Zkp2pClientOptions, c7 as classifyDelegationState, b6 as compareEventCursorIdsByRecency, bH as currencyInfo, b3 as defaultIndexerEndpoint, bV as enrichPvDepositView, bW as enrichPvIntentView, b7 as fetchIndexerFulfillmentAndPayment, bO as getContracts, bK as getCurrencyCodeFromHash, bJ as getCurrencyInfoFromCountryCode, bI as getCurrencyInfoFromHash, c6 as getDelegationRoute, bR as getGatingServiceAddress, bQ as getPaymentMethodsCatalog, bP as getRateManagerContracts, bL as isSupportedCurrencyHash, c3 as isZeroRateManagerId, bM as mapConversionRatesToOnchainMinRate, c4 as normalizeRateManagerId, c5 as normalizeRegistry, bT as parseDepositView, bU as parseIntentView } from './vaultUtils-C-9Z50Ak.js';
3
3
  import { Address, Hex, WalletClient, Hash } from 'viem';
4
4
  import { Abi } from 'abitype';
5
5
  import '@zkp2p/indexer-schema';
@@ -207,6 +207,10 @@ declare function apiGetOwnerDeposits(req: GetOwnerDepositsRequest, apiKey: strin
207
207
  * Get taker tier information for a specific address.
208
208
  */
209
209
  declare function apiGetTakerTier(req: GetTakerTierRequest, apiKey: string | undefined, baseApiUrl: string, timeoutMs?: number): Promise<GetTakerTierResponse>;
210
+ declare function apiGetOrderbook(params: GetOrderbookParams, opts: ApiAdapterOptions): Promise<GetOrderbookResponse>;
211
+ declare function apiGetOrderbook(params: GetOrderbookParams, baseApiUrl: string, timeoutMs?: number, apiKey?: string): Promise<GetOrderbookResponse>;
212
+ declare function apiGetDepositBundle(params: GetDepositBundleParams, opts: ApiAdapterOptions): Promise<GetDepositBundleResponse>;
213
+ declare function apiGetDepositBundle(params: GetDepositBundleParams, baseApiUrl: string, timeoutMs?: number, apiKey?: string): Promise<GetDepositBundleResponse>;
210
214
 
211
215
  /** Minimal interface for the publicClient parameter, avoids viem version coupling. */
212
216
  interface MulticallClient {
@@ -705,4 +709,4 @@ declare class ContractError extends ZKP2PError {
705
709
  constructor(message: string, details?: unknown);
706
710
  }
707
711
 
708
- export { APIError, BASE_BUILDER_CODE, BestByPlatformResponse, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ContractError, ContractRouter, type ContractRouterConfig, CurrencyType, DEFAULT_ORACLE_MAX_STALENESS_SECONDS, ErrorCode, type EscrowContractContext, type EscrowDepositView, type EscrowIntentView, GetOwnerDepositsRequest, GetOwnerDepositsResponse, GetPayeeDetailsRequest, GetPayeeDetailsResponse, GetTakerTierRequest, GetTakerTierResponse, 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 PeerConnectionStatus, type PeerExtensionApi, type PeerExtensionOnrampParams, type PeerExtensionSdk, type PeerExtensionSdkOptions, type PeerExtensionState, type PeerExtensionWindow, type PeerIntentFulfilledBridgeStatus, type PeerIntentFulfilledCallback, type PeerIntentFulfilledResult, PostDepositDetailsRequest, PostDepositDetailsResponse, type PythFeedConfig, QuotesBestByPlatformRequest, ReferrerFeeConfig, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, type SpreadOracleConfig, type SpreadOracleFeedConfig, type SupportedChainId, TOKEN_METADATA, TxOverrides, ValidatePayeeDetailsRequest, ValidatePayeeDetailsResponse, ValidationError, ZKP2PError, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuotesBestByPlatform, apiGetTakerTier, apiPostDepositDetails, apiValidatePayeeDetails, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createPeerExtensionSdk, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, ensureBytes32, getAttributionDataSuffix, getPeerExtensionState, getSpreadOracleConfig, isPeerExtensionAvailable, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, referrerFeeConfigToPreciseUnits, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
712
+ export { APIError, ApiAdapterOptions, BASE_BUILDER_CODE, BestByPlatformResponse, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ContractError, ContractRouter, type ContractRouterConfig, CurrencyType, DEFAULT_ORACLE_MAX_STALENESS_SECONDS, ErrorCode, type EscrowContractContext, type EscrowDepositView, type EscrowIntentView, GetDepositBundleParams, GetDepositBundleResponse, GetOrderbookParams, GetOrderbookResponse, GetOwnerDepositsRequest, GetOwnerDepositsResponse, GetPayeeDetailsRequest, GetPayeeDetailsResponse, GetTakerTierRequest, GetTakerTierResponse, 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 PeerConnectionStatus, type PeerExtensionApi, type PeerExtensionOnrampParams, type PeerExtensionSdk, type PeerExtensionSdkOptions, type PeerExtensionState, type PeerExtensionWindow, type PeerIntentFulfilledBridgeStatus, type PeerIntentFulfilledCallback, type PeerIntentFulfilledResult, PostDepositDetailsRequest, PostDepositDetailsResponse, type PythFeedConfig, QuotesBestByPlatformRequest, ReferrerFeeConfig, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, type SpreadOracleConfig, type SpreadOracleFeedConfig, type SupportedChainId, TOKEN_METADATA, TxOverrides, ValidatePayeeDetailsRequest, ValidatePayeeDetailsResponse, ValidationError, ZKP2PError, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, apiGetDepositBundle, apiGetOrderbook, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuotesBestByPlatform, apiGetTakerTier, apiPostDepositDetails, apiValidatePayeeDetails, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createPeerExtensionSdk, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, ensureBytes32, getAttributionDataSuffix, getPeerExtensionState, getSpreadOracleConfig, isPeerExtensionAvailable, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, referrerFeeConfigToPreciseUnits, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  export { ZERO_RATE_MANAGER_ID, classifyDelegationState, getDelegationRoute, isZeroRateManagerId, normalizeRateManagerId, normalizeRegistry } from './chunk-LPJE2MN7.mjs';
2
2
  import { ValidationError, NetworkError, APIError } from './chunk-GHQK65J2.mjs';
3
3
  export { APIError, ContractError, ErrorCode, NetworkError, ValidationError, ZKP2PError } from './chunk-GHQK65J2.mjs';
4
- import { getContracts, getRateManagerContracts, getPaymentMethodsCatalog, resolvePaymentMethodHashFromCatalog, getGatingServiceAddress, parseBigIntLike, resolveFiatCurrencyBytes32, resolvePaymentMethodNameFromHash } from './chunk-AXX3QCRW.mjs';
5
- export { asciiToBytes32, enrichPvDepositView, enrichPvIntentView, ensureBytes32, getContracts, getGatingServiceAddress, getPaymentMethodsCatalog, getRateManagerContracts, parseDepositView, parseIntentView, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash } from './chunk-AXX3QCRW.mjs';
4
+ import { getContracts, getRateManagerContracts, getPaymentMethodsCatalog, resolvePaymentMethodHashFromCatalog, getGatingServiceAddress, parseBigIntLike, resolveFiatCurrencyBytes32, resolvePaymentMethodNameFromHash } from './chunk-ENH4KRFK.mjs';
5
+ export { asciiToBytes32, enrichPvDepositView, enrichPvIntentView, ensureBytes32, getContracts, getGatingServiceAddress, getPaymentMethodsCatalog, getRateManagerContracts, parseDepositView, parseIntentView, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash } from './chunk-ENH4KRFK.mjs';
6
6
  import { Currency, currencyKeccak256 } from './chunk-ZFBH4HD7.mjs';
7
7
  export { Currency, currencyInfo, getCurrencyCodeFromHash, getCurrencyInfoFromCountryCode, getCurrencyInfoFromHash, isSupportedCurrencyHash, mapConversionRatesToOnchainMinRate } from './chunk-ZFBH4HD7.mjs';
8
8
  import { concatHex, encodeFunctionData, encodeAbiParameters, createPublicClient, http, formatUnits } from 'viem';
@@ -433,6 +433,34 @@ async function apiCreatePaymentAttestation(payload, attestationServiceUrl, platf
433
433
  return res.json();
434
434
  });
435
435
  }
436
+ async function apiCreateSellerCredentialBundle(payload, attestationServiceUrl, platform, timeoutMs) {
437
+ return withRetry(
438
+ async () => {
439
+ let res;
440
+ try {
441
+ const endpoint = `/seller/credentials/${encodeURIComponent(platform)}`;
442
+ res = await fetch(`${attestationServiceUrl}${endpoint}`, {
443
+ method: "POST",
444
+ headers: headers(),
445
+ body: JSON.stringify(payload)
446
+ });
447
+ } catch (error) {
448
+ throw new NetworkError("Failed to connect to Attestation Service", {
449
+ endpoint: `/seller/credentials/${platform}`,
450
+ error
451
+ });
452
+ }
453
+ if (!res.ok) {
454
+ const errorText = await res.text();
455
+ throw parseAPIError(res, errorText);
456
+ }
457
+ return res.json();
458
+ },
459
+ 3,
460
+ 1e3,
461
+ timeoutMs
462
+ );
463
+ }
436
464
  var abiCoder = AbiCoder.defaultAbiCoder();
437
465
  function encodeVerifyPaymentData(params) {
438
466
  return abiCoder.encode(
@@ -571,6 +599,9 @@ var PAYMENT_PLATFORMS = [
571
599
  "luxon",
572
600
  "n26"
573
601
  ];
602
+
603
+ // src/utils/constants.ts
604
+ var DEFAULT_BASE_API_URL = "https://api.zkp2p.xyz";
574
605
  var ZERO_ADDRESS2 = "0x0000000000000000000000000000000000000000";
575
606
  var CHAINLINK_ORACLE_ADAPTER = "0xfc81d1b5841e697973af3072fc8e03af76cb39ef";
576
607
  var PYTH_ORACLE_ADAPTER = "0xaa2bBDa3072bD37af76613846268Ec48bd0bB885";
@@ -815,6 +846,13 @@ var IntentOperations = class {
815
846
  orchestratorAddress: params.orchestratorAddress,
816
847
  escrowAddress: escrowContext.address
817
848
  });
849
+ const currentEscrow = this.config.getEscrowV2Address();
850
+ const currentOrchestrator = this.config.getOrchestratorV2Address();
851
+ if (currentEscrow && escrowContext.address.toLowerCase() !== currentEscrow.toLowerCase() || currentOrchestrator && orchestratorContext.address.toLowerCase() !== currentOrchestrator.toLowerCase()) {
852
+ throw new Error(
853
+ "signalIntent is only supported on the current EscrowV2 / OrchestratorV2 deployment"
854
+ );
855
+ }
818
856
  const catalog = getPaymentMethodsCatalog(this.config.getChainId(), this.config.getRuntimeEnv());
819
857
  const paymentMethod = resolvePaymentMethodHashFromCatalog(params.processorName, catalog);
820
858
  const fiatCurrency = resolveFiatCurrencyBytes32(params.fiatCurrencyCode);
@@ -1457,7 +1495,7 @@ var ProtocolViewerReader = class {
1457
1495
  if (inputCount === null) {
1458
1496
  throw new Error("Configured ProtocolViewer ABI does not expose getDeposit");
1459
1497
  }
1460
- const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-TPB47QOH.mjs');
1498
+ const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-ZQZ6QGEX.mjs');
1461
1499
  if (inputCount >= 3) {
1462
1500
  return tryContexts(
1463
1501
  protocolViewerContexts,
@@ -1536,7 +1574,7 @@ var ProtocolViewerReader = class {
1536
1574
  return Promise.all(ids.map((id) => this.config.host.getPvDepositById(id)));
1537
1575
  }
1538
1576
  const bn = ids.map((id) => typeof id === "bigint" ? id : parseRawDepositId(id));
1539
- const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-TPB47QOH.mjs');
1577
+ const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-ZQZ6QGEX.mjs');
1540
1578
  if (inputCount >= 2) {
1541
1579
  const requests = ids.map((id, index) => ({
1542
1580
  index,
@@ -1641,7 +1679,7 @@ var ProtocolViewerReader = class {
1641
1679
  if (!protocolViewerAddress || !protocolViewerAbi || inputCount === null) {
1642
1680
  return this.config.host.getPvAccountDepositsFromIndexer(owner);
1643
1681
  }
1644
- const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-TPB47QOH.mjs');
1682
+ const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-ZQZ6QGEX.mjs');
1645
1683
  const { address, abi } = this.config.host.requireProtocolViewer();
1646
1684
  if (inputCount >= 2) {
1647
1685
  const readAndFilter = async (raw2) => {
@@ -1712,7 +1750,7 @@ var ProtocolViewerReader = class {
1712
1750
  if (protocolViewerEntries.length === 0) {
1713
1751
  throw new Error("ProtocolViewer not available for this network");
1714
1752
  }
1715
- const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-TPB47QOH.mjs');
1753
+ const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-ZQZ6QGEX.mjs');
1716
1754
  const intentsByHash = /* @__PURE__ */ new Map();
1717
1755
  let attemptedRead = false;
1718
1756
  let hadSuccessfulRead = false;
@@ -1820,7 +1858,7 @@ var ProtocolViewerReader = class {
1820
1858
  if (protocolViewerEntries.length === 0) {
1821
1859
  throw new Error("ProtocolViewer not available for this network");
1822
1860
  }
1823
- const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-TPB47QOH.mjs');
1861
+ const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-ZQZ6QGEX.mjs');
1824
1862
  let lastError;
1825
1863
  for (const pvEntry of protocolViewerEntries) {
1826
1864
  const inputCount = this.pvEntryFunctionInputCount(pvEntry, "getIntent");
@@ -4980,6 +5018,78 @@ async function apiGetTakerTier(req, apiKey, baseApiUrl, timeoutMs) {
4980
5018
  timeoutMs
4981
5019
  });
4982
5020
  }
5021
+ async function apiUploadSellerCredential(makerId, bundle, baseApiUrl, timeoutMs, apiKey, authToken) {
5022
+ return apiFetch({
5023
+ url: `${withApiBase(baseApiUrl)}/v2/makers/${makerId}/seller-credential`,
5024
+ method: "POST",
5025
+ body: bundle,
5026
+ apiKey,
5027
+ authToken,
5028
+ timeoutMs
5029
+ });
5030
+ }
5031
+ async function apiGetSellerCredentialStatus(makerId, baseApiUrl, timeoutMs, apiKey, authToken) {
5032
+ return apiFetch({
5033
+ url: `${withApiBase(baseApiUrl)}/v2/makers/${makerId}/seller-credential/status`,
5034
+ method: "GET",
5035
+ apiKey,
5036
+ authToken,
5037
+ timeoutMs
5038
+ });
5039
+ }
5040
+ async function apiVerifySellerPayment(platform, req, baseApiUrl, timeoutMs, apiKey, authToken) {
5041
+ return apiFetch({
5042
+ url: `${withApiBase(baseApiUrl)}/v2/verify/seller/${encodeURIComponent(platform)}`,
5043
+ method: "POST",
5044
+ body: req,
5045
+ apiKey,
5046
+ authToken,
5047
+ timeoutMs
5048
+ });
5049
+ }
5050
+ async function apiGetOrderbook(params, optsOrBaseApiUrl, timeoutMs, apiKey) {
5051
+ const opts = typeof optsOrBaseApiUrl === "string" ? {
5052
+ baseApiUrl: optsOrBaseApiUrl,
5053
+ timeoutMs,
5054
+ apiKey
5055
+ } : optsOrBaseApiUrl;
5056
+ const query = new URLSearchParams();
5057
+ Object.entries(params).forEach(([key, value]) => {
5058
+ if (value === void 0 || value === null) return;
5059
+ query.set(key, String(value));
5060
+ });
5061
+ const response = await apiFetch({
5062
+ url: `${withApiBase(opts.baseApiUrl)}/v2/orderbook?${query.toString()}`,
5063
+ method: "GET",
5064
+ apiKey: opts.apiKey,
5065
+ authToken: opts.authToken,
5066
+ timeoutMs: opts.timeoutMs
5067
+ });
5068
+ return response.responseObject;
5069
+ }
5070
+ async function apiGetDepositBundle(params, optsOrBaseApiUrl, timeoutMs, apiKey) {
5071
+ const opts = typeof optsOrBaseApiUrl === "string" ? {
5072
+ baseApiUrl: optsOrBaseApiUrl,
5073
+ timeoutMs,
5074
+ apiKey
5075
+ } : optsOrBaseApiUrl;
5076
+ const escrowAddress = requireEscrowAddress(
5077
+ params.escrowAddress,
5078
+ "apiGetDepositBundle requires escrowAddress"
5079
+ );
5080
+ const query = new URLSearchParams({ escrowAddress });
5081
+ if (params.dailySnapshotLimit !== void 0) {
5082
+ query.set("dailySnapshotLimit", String(params.dailySnapshotLimit));
5083
+ }
5084
+ const response = await apiFetch({
5085
+ url: `${withApiBase(opts.baseApiUrl)}/v2/deposits/${params.depositId}/bundle?${query.toString()}`,
5086
+ method: "GET",
5087
+ apiKey: opts.apiKey,
5088
+ authToken: opts.authToken,
5089
+ timeoutMs: opts.timeoutMs
5090
+ });
5091
+ return response.responseObject;
5092
+ }
4983
5093
  var formatTokenAmountForDisplay = (amount, decimals) => {
4984
5094
  const formatted = formatUnits(amount, decimals);
4985
5095
  if (!formatted.includes(".")) {
@@ -6190,6 +6300,7 @@ var Zkp2pClient = class {
6190
6300
  getProtocolViewerAbi: () => this.protocolViewerAbi,
6191
6301
  getIndexerClient: () => this._indexerClient,
6192
6302
  getIndexerService: () => this._indexerService,
6303
+ getEscrowV2Address: () => this.escrowV2Address,
6193
6304
  getOrchestratorV2Address: () => this.orchestratorV2Address,
6194
6305
  host: {
6195
6306
  resolveEscrowContext: (options) => this.resolveEscrowContext(options),
@@ -6213,6 +6324,30 @@ var Zkp2pClient = class {
6213
6324
  parseRawDepositId(depositId) {
6214
6325
  return parseRawDepositId(depositId);
6215
6326
  }
6327
+ stripTrailingSlash(url) {
6328
+ return url.replace(/\/$/, "");
6329
+ }
6330
+ defaultAttestationServiceForBaseApiUrl(baseApiUrl) {
6331
+ try {
6332
+ const { hostname } = new URL(baseApiUrl);
6333
+ if (hostname === "api-staging.zkp2p.xyz") {
6334
+ return "https://attestation-service-staging.zkp2p.xyz";
6335
+ }
6336
+ if (hostname === "api-preprod.zkp2p.xyz") {
6337
+ return "https://attestation-service.zkp2p.xyz";
6338
+ }
6339
+ if (hostname === "api.zkp2p.xyz") {
6340
+ return "https://attestation-service.zkp2p.xyz";
6341
+ }
6342
+ } catch {
6343
+ }
6344
+ if (baseApiUrl === DEFAULT_BASE_API_URL) {
6345
+ return "https://attestation-service.zkp2p.xyz";
6346
+ }
6347
+ throw new Error(
6348
+ `attestationServiceUrl is required when baseApiUrl is not a supported zkp2p API host: ${baseApiUrl}`
6349
+ );
6350
+ }
6216
6351
  normalizeOracleRateConfig(config) {
6217
6352
  return normalizeOracleRateConfig(config);
6218
6353
  }
@@ -7406,7 +7541,7 @@ var Zkp2pClient = class {
7406
7541
  const timeoutMs = opts?.timeoutMs ?? this.apiTimeoutMs;
7407
7542
  const reqWithEscrow = { ...req };
7408
7543
  if (!reqWithEscrow.escrowAddresses || reqWithEscrow.escrowAddresses.length === 0) {
7409
- const configuredEscrows = this.escrowAddresses.length > 0 ? this.escrowAddresses.map((address) => address) : this.escrowAddress ? [this.escrowAddress] : [];
7544
+ const configuredEscrows = this.escrowV2Address ? [this.escrowV2Address] : this.escrowAddress ? [this.escrowAddress] : [];
7410
7545
  if (configuredEscrows.length > 0) {
7411
7546
  reqWithEscrow.escrowAddresses = configuredEscrows;
7412
7547
  }
@@ -7450,7 +7585,7 @@ var Zkp2pClient = class {
7450
7585
  const timeoutMs = opts?.timeoutMs ?? this.apiTimeoutMs;
7451
7586
  const reqWithEscrow = { ...req };
7452
7587
  if (!reqWithEscrow.escrowAddresses || reqWithEscrow.escrowAddresses.length === 0) {
7453
- const configuredEscrows = this.escrowAddresses.length > 0 ? [...this.escrowAddresses] : this.escrowAddress ? [this.escrowAddress] : [];
7588
+ const configuredEscrows = this.escrowV2Address ? [this.escrowV2Address] : this.escrowAddress ? [this.escrowAddress] : [];
7454
7589
  if (configuredEscrows.length > 0) {
7455
7590
  reqWithEscrow.escrowAddresses = configuredEscrows;
7456
7591
  }
@@ -7500,6 +7635,92 @@ var Zkp2pClient = class {
7500
7635
  const timeoutMs = opts?.timeoutMs ?? this.apiTimeoutMs;
7501
7636
  return apiGetTakerTier(req, void 0, baseApiUrl, timeoutMs);
7502
7637
  }
7638
+ /**
7639
+ * The signed `expiresAtMs` field is an upload-time freshness token minted by attestation-service.
7640
+ * Once curator persists the bundle, seller-automated-release availability is governed by curator's
7641
+ * probe/revalidation state rather than this timestamp.
7642
+ *
7643
+ * Curator accepts either a configured API key or bearer token for this endpoint.
7644
+ *
7645
+ * Create a signed seller credential bundle with attestation-service and store it on the maker via curator.
7646
+ */
7647
+ async uploadSellerCredential(params, opts) {
7648
+ const baseApiUrl = this.stripTrailingSlash(
7649
+ opts?.baseApiUrl ?? this.baseApiUrl ?? DEFAULT_BASE_API_URL
7650
+ );
7651
+ const timeoutMs = opts?.timeoutMs ?? this.apiTimeoutMs;
7652
+ const attestationServiceUrl = this.stripTrailingSlash(
7653
+ opts?.attestationServiceUrl ?? this.defaultAttestationServiceForBaseApiUrl(baseApiUrl)
7654
+ );
7655
+ const uploadPayload = {
7656
+ payeeId: params.payeeId,
7657
+ sessionMaterial: params.sessionMaterial
7658
+ };
7659
+ const bundleResponse = await apiCreateSellerCredentialBundle(
7660
+ uploadPayload,
7661
+ attestationServiceUrl,
7662
+ params.platform,
7663
+ timeoutMs
7664
+ );
7665
+ if (!bundleResponse.success || !bundleResponse.responseObject) {
7666
+ throw new Error(bundleResponse.message || "Failed to create seller credential bundle");
7667
+ }
7668
+ return apiUploadSellerCredential(
7669
+ params.makerId,
7670
+ bundleResponse.responseObject,
7671
+ baseApiUrl,
7672
+ timeoutMs,
7673
+ this.apiKey,
7674
+ this.authorizationToken
7675
+ );
7676
+ }
7677
+ /**
7678
+ * Status is a coarse curator-owned signal (`active` / `inactive` / `missing`) and intentionally
7679
+ * omits low-level diagnostics. Curator may still re-probe stale credentials during verify, so callers
7680
+ * should continue to handle a 410 from `verifySellerPayment`.
7681
+ *
7682
+ * Curator accepts either a configured API key or bearer token for this endpoint.
7683
+ *
7684
+ * Fetch seller credential status for a maker from curator.
7685
+ */
7686
+ async getSellerCredentialStatus(params, opts) {
7687
+ const baseApiUrl = this.stripTrailingSlash(
7688
+ opts?.baseApiUrl ?? this.baseApiUrl ?? DEFAULT_BASE_API_URL
7689
+ );
7690
+ const timeoutMs = opts?.timeoutMs ?? this.apiTimeoutMs;
7691
+ return apiGetSellerCredentialStatus(
7692
+ params.makerId,
7693
+ baseApiUrl,
7694
+ timeoutMs,
7695
+ this.apiKey,
7696
+ this.authorizationToken
7697
+ );
7698
+ }
7699
+ /**
7700
+ * Internal-use endpoint. The curator route requires an internal `x-api-key`; standard SDK consumer
7701
+ * API keys will be rejected with 401. Returns 410 GONE when curator has marked the credential inactive
7702
+ * or a stale credential fails its synchronous re-probe.
7703
+ *
7704
+ * Verify a seller payment via curator's seller-credential proxy.
7705
+ */
7706
+ async verifySellerPayment(params, opts) {
7707
+ const baseApiUrl = this.stripTrailingSlash(
7708
+ opts?.baseApiUrl ?? this.baseApiUrl ?? DEFAULT_BASE_API_URL
7709
+ );
7710
+ const timeoutMs = opts?.timeoutMs ?? this.apiTimeoutMs;
7711
+ return apiVerifySellerPayment(
7712
+ params.platform,
7713
+ {
7714
+ txId: params.txId,
7715
+ chainId: params.chainId,
7716
+ intent: params.intent
7717
+ },
7718
+ baseApiUrl,
7719
+ timeoutMs,
7720
+ this.apiKey,
7721
+ this.authorizationToken
7722
+ );
7723
+ }
7503
7724
  // ╔═══════════════════════════════════════════════════════════════════════════╗
7504
7725
  // ║ CORE: ON-CHAIN DEPOSIT VIEWS ║
7505
7726
  // ╚═══════════════════════════════════════════════════════════════════════════╝
@@ -7867,6 +8088,6 @@ var logger = {
7867
8088
  }
7868
8089
  };
7869
8090
 
7870
- 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, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuotesBestByPlatform, apiGetTakerTier, apiPostDepositDetails, apiValidatePayeeDetails, appendAttributionToCalldata, assertValidReferrerFeeConfig, compareEventCursorIdsByRecency, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createPeerExtensionSdk, defaultIndexerEndpoint, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, fetchFulfillmentAndPayment as fetchIndexerFulfillmentAndPayment, getAttributionDataSuffix, getPeerExtensionState, getSpreadOracleConfig, isPeerExtensionAvailable, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, referrerFeeConfigToPreciseUnits, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
8091
+ 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, apiGetDepositBundle, apiGetOrderbook, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuotesBestByPlatform, apiGetTakerTier, apiPostDepositDetails, apiValidatePayeeDetails, appendAttributionToCalldata, assertValidReferrerFeeConfig, compareEventCursorIdsByRecency, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createPeerExtensionSdk, defaultIndexerEndpoint, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, fetchFulfillmentAndPayment as fetchIndexerFulfillmentAndPayment, getAttributionDataSuffix, getPeerExtensionState, getSpreadOracleConfig, isPeerExtensionAvailable, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, referrerFeeConfigToPreciseUnits, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
7871
8092
  //# sourceMappingURL=index.mjs.map
7872
8093
  //# sourceMappingURL=index.mjs.map