@zkp2p/sdk 0.4.2 → 0.4.3
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.cjs +34 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.mjs +34 -5
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +3 -2
- package/dist/react.d.ts +3 -2
- package/dist/{vaultUtils-Bi2uldoa.d.mts → vaultUtils-BZU2bc0T.d.mts} +29 -10
- package/dist/{vaultUtils-Bi2uldoa.d.ts → vaultUtils-BZU2bc0T.d.ts} +29 -10
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, S as SellerCredentialUploadInput,
|
|
2
|
-
export {
|
|
1
|
+
import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, a as IdentityAttestationRequestBody, A as AttestationServiceIdentityResponse, S as SellerCredentialUploadInput, b as SellerPlatform, c as SellerCredentialAttestationRuntime, d as AttestationServiceSellerCredentialUploadResponse, B as BuyerTeeSessionMaterialEncryptionInput, C as ConfirmPayPalForwardingResponse, G as GoogleOAuthSellerCredentialPlatform, e as GoogleOAuthSellerCredentialUploadBodyByPlatform, f as CuratorSellerCredentialUploadResponse, Q as QuotesBestByPlatformRequest, g as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, h as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, i as PostDepositDetailsResponse, j as GetPayeeDetailsRequest, k as GetPayeeDetailsResponse, l as GetOwnerDepositsRequest, m as GetOwnerDepositsResponse, n as GetTakerTierRequest, o as GetTakerTierResponse, p as GetDepositBundleParams, q as ApiAdapterOptions, r as GetDepositBundleResponse, s as GetOrderbookParams, t as GetOrderbookResponse, u as CurrencyType, v as PaymentMethodCatalog, T as TxOverrides } from './vaultUtils-BZU2bc0T.mjs';
|
|
2
|
+
export { J as ActionCallback, ah as ApiDeposit, ao as ApiIntentStatus, a$ as AttestationServiceSellerCredentialProbeResponse, a_ as AttestationServiceSellerVerifyResponse, E as AuthorizationTokenProvider, cD as BatchResult, Y as BestByPlatformResponseObject, b0 as BuyerTeePaymentParams, b1 as BuyerTeePaymentProofInput, b2 as BuyerTeeSessionMaterial, y as CancelIntentMethodParams, X as CancelIntentParams, aH as CashAppCredentialUploadInput, ay as CashAppSessionMaterial, b9 as ConfirmPayPalForwardingRequest, L as CreateDepositConversionRate, K as CreateDepositParams, b3 as CuratorSellerCredentialStatusResponse, b4 as CuratorSellerVerifyResponse, c6 as Currency, cd as CurrencyData, cC as DelegationDepositTarget, cA as DelegationRoute, cB as DelegationState, co as Deposit, cq as DepositCurrency, bn as DepositIntentStatistics, ak as DepositStatus, ai as DepositVerifier, aj as DepositVerifierCurrency, bk as DepositVerifierData, cn as DepositView, ad as FiatResponse, F as FulfillIntentMethodParams, O as FulfillIntentParams, _ as GetBestByPlatformResponse, $ as GetBestByPlatformResponseObject, al as GetDepositByIdRequest, am as GetDepositByIdResponse, at as GetIntentByHashRequest, au as GetIntentByHashResponse, ar as GetIntentsByDepositRequest, as as GetIntentsByDepositResponse, a3 as GetNearbyQuote, a4 as GetNearbySuggestions, ap as GetOwnerIntentsRequest, aq as GetOwnerIntentsResponse, a0 as GetPlatformQuote, a5 as GetQuoteResponse, a6 as GetQuoteResponseObject, a7 as GetQuoteSingleResponse, b8 as GetSellerCredentialStatusParams, bf as IdentityAttestationActionType, bg as IdentityAttestationParams, bu as IndexerClient, c0 as IndexerDeploymentEnv, bA as IndexerDeposit, bR as IndexerDepositDailySnapshot, bT as IndexerDepositFilter, bQ as IndexerDepositFundActivity, bS as IndexerDepositFundActivityType, bW as IndexerDepositOrderDirection, bV as IndexerDepositOrderField, bU as IndexerDepositPagination, bD as IndexerDepositPaymentMethod, bw as IndexerDepositService, c3 as IndexerFulfillmentAndPaymentResponse, c1 as IndexerFulfillmentRecord, bB as IndexerIntentFulfilled, bC as IndexerIntentFulfillmentAmounts, bF as IndexerIntentStatus, bJ as IndexerManagerAggregateStats, bL as IndexerManagerDailySnapshot, bK as IndexerManagerStats, bO as IndexerManualRateUpdate, bE as IndexerMethodCurrency, bP as IndexerOracleConfigUpdate, c2 as IndexerPaymentVerifiedRecord, bG as IndexerRateManager, bI as IndexerRateManagerDelegation, bZ as IndexerRateManagerDelegationPagination, bN as IndexerRateManagerDetail, bX as IndexerRateManagerFilter, bM as IndexerRateManagerListItem, b$ as IndexerRateManagerOrderDirection, b_ as IndexerRateManagerOrderField, bY as IndexerRateManagerPagination, bH as IndexerRateManagerRate, bx as IndexerRateManagerService, an as Intent, cs as IntentView, bh as MakerIdentityAttestationRequestBody, bi as MakerIdentityPlatform, af as NearbyQuote, ag as NearbySuggestions, Z as OfframpClient, bj as OnchainCurrency, ct as OnchainIntent, bm as OrderStats, bt as OrderbookEntry, c4 as PAYMENT_PLATFORMS, aJ as PayPalCredentialUploadInput, ba as PayPalForwardingConfirmationErrorCode, aE as PayPalGoogleOAuthSellerCredentialUploadBody, aD as PayPalSessionMaterial, cp as PaymentMethodData, c5 as PaymentPlatformType, br as PlatformLimit, a1 as PlatformQuote, bs as PlatformRiskLevel, bl as PreparedTransaction, ac as QuoteFeesResponse, ab as QuoteIntentResponse, a2 as QuoteRequest, a8 as QuoteResponse, a9 as QuoteResponseObject, aa as QuoteSingleResponse, M as Range, cr as ReferralFee, av as RegisterPayeeDetailsRequest, aw as RegisterPayeeDetailsResponse, b6 as RegisteredUploadSellerCredentialParams, U as ReleaseFundsToPayerParams, ci as RuntimeEnv, aY as SellerAttestationOutput, aL as SellerCiphertextBundle, aQ as SellerCredentialBundle, aR as SellerCredentialBundleUpload, aZ as SellerCredentialProbeResponse, aT as SellerCredentialStatus, aS as SellerCredentialStatusValue, aK as SellerCredentialUploadInputByPlatform, aX as SellerPaymentTypedDataValue, aP as SellerProbeInput, aM as SellerSignedCiphertextBundle, aV as SellerTypedDataField, aW as SellerTypedDataSpec, aO as SellerVerifyInput, aN as SellerVerifyIntentDetails, aU as SellerVerifyProxyBody, cF as SendBatchFn, cE as SendTransactionFn, x as SignalIntentMethodParams, N as SignalIntentParams, w as SignalIntentReferralFee, bo as TakerTier, bq as TakerTierLevel, bp as TakerTierStats, H as TimeoutConfig, ae as TokenResponse, bd as UploadGoogleOAuthSellerCredentialParams, bb as UploadPayPalGoogleOAuthSellerCredentialParams, b7 as UploadSellerCredentialOptions, b5 as UploadSellerCredentialParams, bc as UploadVenmoGoogleOAuthSellerCredentialParams, aG as VenmoCredentialUploadInput, aF as VenmoGoogleOAuthSellerCredentialUploadBody, ax as VenmoSessionMaterial, be as VerifySellerPaymentParams, aI as WiseCredentialUploadInput, aA as WiseProfileInfo, aC as WiseProfileNotFound, aB as WiseProfileSelectionRequired, az as WiseSessionMaterial, W as WithdrawDepositParams, cu as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, z as Zkp2pClientOptions, cz as classifyDelegationState, by as compareEventCursorIdsByRecency, c7 as currencyInfo, bv as defaultIndexerEndpoint, cl as enrichPvDepositView, cm as enrichPvIntentView, bz as fetchIndexerFulfillmentAndPayment, ce as getContracts, ca as getCurrencyCodeFromHash, c9 as getCurrencyInfoFromCountryCode, c8 as getCurrencyInfoFromHash, cy as getDelegationRoute, ch as getGatingServiceAddress, cg as getPaymentMethodsCatalog, cf as getRateManagerContracts, cb as isSupportedCurrencyHash, cv as isZeroRateManagerId, cc as mapConversionRatesToOnchainMinRate, cw as normalizeRateManagerId, cx as normalizeRegistry, cj as parseDepositView, ck as parseIntentView } from './vaultUtils-BZU2bc0T.mjs';
|
|
3
3
|
import { Address, Hash, Hex, WalletClient } from 'viem';
|
|
4
4
|
import { Abi } from 'abitype';
|
|
5
|
+
export { IdentityActionType, IdentityActionTypeByPlatform, IdentityAttestationOutput, IdentityAttestationOutputFor, IdentityParamsByPlatform, IdentityPlatform } from '@zkp2p/zkp2p-attestation';
|
|
5
6
|
import '@zkp2p/indexer-schema';
|
|
6
7
|
|
|
7
8
|
interface EscrowRange {
|
|
@@ -190,6 +191,7 @@ interface ConvertLiquidityOptions {
|
|
|
190
191
|
declare function convertDepositsForLiquidity(deposits: DepositWithRelations[], chainId: number, escrowAddress: string, options?: ConvertLiquidityOptions): EscrowDepositView[];
|
|
191
192
|
declare function convertIndexerIntentsToEscrowViews(intents: IntentEntity[], depositViewsById: Map<string, EscrowDepositView>): EscrowIntentView[];
|
|
192
193
|
|
|
194
|
+
declare function apiRequestIdentityAttestation(payload: IdentityAttestationRequestBody, attestationServiceUrl: string, platform: string, actionType: string): Promise<AttestationServiceIdentityResponse>;
|
|
193
195
|
declare function createEncryptedBuyerTeeSessionMaterial({ actionType, attestationRuntime, attestationServiceUrl, platform, sessionMaterial, timeoutMs, }: BuyerTeeSessionMaterialEncryptionInput): Promise<string>;
|
|
194
196
|
declare function apiCreateSellerCredentialBundle(payload: SellerCredentialUploadInput, attestationServiceUrl: string, platform: SellerPlatform, timeoutMs?: number, attestationRuntime?: SellerCredentialAttestationRuntime): Promise<AttestationServiceSellerCredentialUploadResponse>;
|
|
195
197
|
|
|
@@ -717,4 +719,4 @@ declare class ContractError extends ZKP2PError {
|
|
|
717
719
|
constructor(message: string, details?: unknown);
|
|
718
720
|
}
|
|
719
721
|
|
|
720
|
-
export { APIError, ApiAdapterOptions, AttestationServiceSellerCredentialUploadResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ConfirmPayPalForwardingResponse, 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, 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 PeerOnrampPreparedTransactionCallback, type PeerOnrampPreparedTransactionResult, PostDepositDetailsRequest, PostDepositDetailsResponse, type PythFeedConfig, QuotesBestByPlatformRequest, ReferrerFeeConfig, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, SellerCredentialAttestationRuntime, SellerCredentialUploadInput, SellerPlatform, type SpreadOracleConfig, type SpreadOracleFeedConfig, type SupportedChainId, TOKEN_METADATA, TxOverrides, ValidatePayeeDetailsRequest, ValidatePayeeDetailsResponse, ValidationError, ZKP2PError, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, apiConfirmPayPalForwarding, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuotesBestByPlatform, apiGetTakerTier, apiPostDepositDetails, apiUploadGoogleOAuthSellerCredential, apiValidatePayeeDetails, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, createPeerExtensionSdk, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, ensureBytes32, getAttributionDataSuffix, getPeerExtensionState, getSpreadOracleConfig, isPeerExtensionAvailable, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, referrerFeeConfigToPreciseUnits, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
|
|
722
|
+
export { APIError, ApiAdapterOptions, AttestationServiceIdentityResponse, AttestationServiceSellerCredentialUploadResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ConfirmPayPalForwardingResponse, 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 PeerConnectionStatus, type PeerExtensionApi, type PeerExtensionOnrampParams, type PeerExtensionSdk, type PeerExtensionSdkOptions, type PeerExtensionState, type PeerExtensionWindow, type PeerOnrampPreparedTransactionCallback, type PeerOnrampPreparedTransactionResult, PostDepositDetailsRequest, PostDepositDetailsResponse, type PythFeedConfig, QuotesBestByPlatformRequest, ReferrerFeeConfig, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, SellerCredentialAttestationRuntime, SellerCredentialUploadInput, SellerPlatform, type SpreadOracleConfig, type SpreadOracleFeedConfig, type SupportedChainId, TOKEN_METADATA, TxOverrides, ValidatePayeeDetailsRequest, ValidatePayeeDetailsResponse, ValidationError, ZKP2PError, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, apiConfirmPayPalForwarding, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuotesBestByPlatform, apiGetTakerTier, apiPostDepositDetails, apiRequestIdentityAttestation, apiUploadGoogleOAuthSellerCredential, apiValidatePayeeDetails, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, 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,7 +1,8 @@
|
|
|
1
|
-
import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, S as SellerCredentialUploadInput,
|
|
2
|
-
export {
|
|
1
|
+
import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, a as IdentityAttestationRequestBody, A as AttestationServiceIdentityResponse, S as SellerCredentialUploadInput, b as SellerPlatform, c as SellerCredentialAttestationRuntime, d as AttestationServiceSellerCredentialUploadResponse, B as BuyerTeeSessionMaterialEncryptionInput, C as ConfirmPayPalForwardingResponse, G as GoogleOAuthSellerCredentialPlatform, e as GoogleOAuthSellerCredentialUploadBodyByPlatform, f as CuratorSellerCredentialUploadResponse, Q as QuotesBestByPlatformRequest, g as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, h as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, i as PostDepositDetailsResponse, j as GetPayeeDetailsRequest, k as GetPayeeDetailsResponse, l as GetOwnerDepositsRequest, m as GetOwnerDepositsResponse, n as GetTakerTierRequest, o as GetTakerTierResponse, p as GetDepositBundleParams, q as ApiAdapterOptions, r as GetDepositBundleResponse, s as GetOrderbookParams, t as GetOrderbookResponse, u as CurrencyType, v as PaymentMethodCatalog, T as TxOverrides } from './vaultUtils-BZU2bc0T.js';
|
|
2
|
+
export { J as ActionCallback, ah as ApiDeposit, ao as ApiIntentStatus, a$ as AttestationServiceSellerCredentialProbeResponse, a_ as AttestationServiceSellerVerifyResponse, E as AuthorizationTokenProvider, cD as BatchResult, Y as BestByPlatformResponseObject, b0 as BuyerTeePaymentParams, b1 as BuyerTeePaymentProofInput, b2 as BuyerTeeSessionMaterial, y as CancelIntentMethodParams, X as CancelIntentParams, aH as CashAppCredentialUploadInput, ay as CashAppSessionMaterial, b9 as ConfirmPayPalForwardingRequest, L as CreateDepositConversionRate, K as CreateDepositParams, b3 as CuratorSellerCredentialStatusResponse, b4 as CuratorSellerVerifyResponse, c6 as Currency, cd as CurrencyData, cC as DelegationDepositTarget, cA as DelegationRoute, cB as DelegationState, co as Deposit, cq as DepositCurrency, bn as DepositIntentStatistics, ak as DepositStatus, ai as DepositVerifier, aj as DepositVerifierCurrency, bk as DepositVerifierData, cn as DepositView, ad as FiatResponse, F as FulfillIntentMethodParams, O as FulfillIntentParams, _ as GetBestByPlatformResponse, $ as GetBestByPlatformResponseObject, al as GetDepositByIdRequest, am as GetDepositByIdResponse, at as GetIntentByHashRequest, au as GetIntentByHashResponse, ar as GetIntentsByDepositRequest, as as GetIntentsByDepositResponse, a3 as GetNearbyQuote, a4 as GetNearbySuggestions, ap as GetOwnerIntentsRequest, aq as GetOwnerIntentsResponse, a0 as GetPlatformQuote, a5 as GetQuoteResponse, a6 as GetQuoteResponseObject, a7 as GetQuoteSingleResponse, b8 as GetSellerCredentialStatusParams, bf as IdentityAttestationActionType, bg as IdentityAttestationParams, bu as IndexerClient, c0 as IndexerDeploymentEnv, bA as IndexerDeposit, bR as IndexerDepositDailySnapshot, bT as IndexerDepositFilter, bQ as IndexerDepositFundActivity, bS as IndexerDepositFundActivityType, bW as IndexerDepositOrderDirection, bV as IndexerDepositOrderField, bU as IndexerDepositPagination, bD as IndexerDepositPaymentMethod, bw as IndexerDepositService, c3 as IndexerFulfillmentAndPaymentResponse, c1 as IndexerFulfillmentRecord, bB as IndexerIntentFulfilled, bC as IndexerIntentFulfillmentAmounts, bF as IndexerIntentStatus, bJ as IndexerManagerAggregateStats, bL as IndexerManagerDailySnapshot, bK as IndexerManagerStats, bO as IndexerManualRateUpdate, bE as IndexerMethodCurrency, bP as IndexerOracleConfigUpdate, c2 as IndexerPaymentVerifiedRecord, bG as IndexerRateManager, bI as IndexerRateManagerDelegation, bZ as IndexerRateManagerDelegationPagination, bN as IndexerRateManagerDetail, bX as IndexerRateManagerFilter, bM as IndexerRateManagerListItem, b$ as IndexerRateManagerOrderDirection, b_ as IndexerRateManagerOrderField, bY as IndexerRateManagerPagination, bH as IndexerRateManagerRate, bx as IndexerRateManagerService, an as Intent, cs as IntentView, bh as MakerIdentityAttestationRequestBody, bi as MakerIdentityPlatform, af as NearbyQuote, ag as NearbySuggestions, Z as OfframpClient, bj as OnchainCurrency, ct as OnchainIntent, bm as OrderStats, bt as OrderbookEntry, c4 as PAYMENT_PLATFORMS, aJ as PayPalCredentialUploadInput, ba as PayPalForwardingConfirmationErrorCode, aE as PayPalGoogleOAuthSellerCredentialUploadBody, aD as PayPalSessionMaterial, cp as PaymentMethodData, c5 as PaymentPlatformType, br as PlatformLimit, a1 as PlatformQuote, bs as PlatformRiskLevel, bl as PreparedTransaction, ac as QuoteFeesResponse, ab as QuoteIntentResponse, a2 as QuoteRequest, a8 as QuoteResponse, a9 as QuoteResponseObject, aa as QuoteSingleResponse, M as Range, cr as ReferralFee, av as RegisterPayeeDetailsRequest, aw as RegisterPayeeDetailsResponse, b6 as RegisteredUploadSellerCredentialParams, U as ReleaseFundsToPayerParams, ci as RuntimeEnv, aY as SellerAttestationOutput, aL as SellerCiphertextBundle, aQ as SellerCredentialBundle, aR as SellerCredentialBundleUpload, aZ as SellerCredentialProbeResponse, aT as SellerCredentialStatus, aS as SellerCredentialStatusValue, aK as SellerCredentialUploadInputByPlatform, aX as SellerPaymentTypedDataValue, aP as SellerProbeInput, aM as SellerSignedCiphertextBundle, aV as SellerTypedDataField, aW as SellerTypedDataSpec, aO as SellerVerifyInput, aN as SellerVerifyIntentDetails, aU as SellerVerifyProxyBody, cF as SendBatchFn, cE as SendTransactionFn, x as SignalIntentMethodParams, N as SignalIntentParams, w as SignalIntentReferralFee, bo as TakerTier, bq as TakerTierLevel, bp as TakerTierStats, H as TimeoutConfig, ae as TokenResponse, bd as UploadGoogleOAuthSellerCredentialParams, bb as UploadPayPalGoogleOAuthSellerCredentialParams, b7 as UploadSellerCredentialOptions, b5 as UploadSellerCredentialParams, bc as UploadVenmoGoogleOAuthSellerCredentialParams, aG as VenmoCredentialUploadInput, aF as VenmoGoogleOAuthSellerCredentialUploadBody, ax as VenmoSessionMaterial, be as VerifySellerPaymentParams, aI as WiseCredentialUploadInput, aA as WiseProfileInfo, aC as WiseProfileNotFound, aB as WiseProfileSelectionRequired, az as WiseSessionMaterial, W as WithdrawDepositParams, cu as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, z as Zkp2pClientOptions, cz as classifyDelegationState, by as compareEventCursorIdsByRecency, c7 as currencyInfo, bv as defaultIndexerEndpoint, cl as enrichPvDepositView, cm as enrichPvIntentView, bz as fetchIndexerFulfillmentAndPayment, ce as getContracts, ca as getCurrencyCodeFromHash, c9 as getCurrencyInfoFromCountryCode, c8 as getCurrencyInfoFromHash, cy as getDelegationRoute, ch as getGatingServiceAddress, cg as getPaymentMethodsCatalog, cf as getRateManagerContracts, cb as isSupportedCurrencyHash, cv as isZeroRateManagerId, cc as mapConversionRatesToOnchainMinRate, cw as normalizeRateManagerId, cx as normalizeRegistry, cj as parseDepositView, ck as parseIntentView } from './vaultUtils-BZU2bc0T.js';
|
|
3
3
|
import { Address, Hash, Hex, WalletClient } from 'viem';
|
|
4
4
|
import { Abi } from 'abitype';
|
|
5
|
+
export { IdentityActionType, IdentityActionTypeByPlatform, IdentityAttestationOutput, IdentityAttestationOutputFor, IdentityParamsByPlatform, IdentityPlatform } from '@zkp2p/zkp2p-attestation';
|
|
5
6
|
import '@zkp2p/indexer-schema';
|
|
6
7
|
|
|
7
8
|
interface EscrowRange {
|
|
@@ -190,6 +191,7 @@ interface ConvertLiquidityOptions {
|
|
|
190
191
|
declare function convertDepositsForLiquidity(deposits: DepositWithRelations[], chainId: number, escrowAddress: string, options?: ConvertLiquidityOptions): EscrowDepositView[];
|
|
191
192
|
declare function convertIndexerIntentsToEscrowViews(intents: IntentEntity[], depositViewsById: Map<string, EscrowDepositView>): EscrowIntentView[];
|
|
192
193
|
|
|
194
|
+
declare function apiRequestIdentityAttestation(payload: IdentityAttestationRequestBody, attestationServiceUrl: string, platform: string, actionType: string): Promise<AttestationServiceIdentityResponse>;
|
|
193
195
|
declare function createEncryptedBuyerTeeSessionMaterial({ actionType, attestationRuntime, attestationServiceUrl, platform, sessionMaterial, timeoutMs, }: BuyerTeeSessionMaterialEncryptionInput): Promise<string>;
|
|
194
196
|
declare function apiCreateSellerCredentialBundle(payload: SellerCredentialUploadInput, attestationServiceUrl: string, platform: SellerPlatform, timeoutMs?: number, attestationRuntime?: SellerCredentialAttestationRuntime): Promise<AttestationServiceSellerCredentialUploadResponse>;
|
|
195
197
|
|
|
@@ -717,4 +719,4 @@ declare class ContractError extends ZKP2PError {
|
|
|
717
719
|
constructor(message: string, details?: unknown);
|
|
718
720
|
}
|
|
719
721
|
|
|
720
|
-
export { APIError, ApiAdapterOptions, AttestationServiceSellerCredentialUploadResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ConfirmPayPalForwardingResponse, 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, 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 PeerOnrampPreparedTransactionCallback, type PeerOnrampPreparedTransactionResult, PostDepositDetailsRequest, PostDepositDetailsResponse, type PythFeedConfig, QuotesBestByPlatformRequest, ReferrerFeeConfig, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, SellerCredentialAttestationRuntime, SellerCredentialUploadInput, SellerPlatform, type SpreadOracleConfig, type SpreadOracleFeedConfig, type SupportedChainId, TOKEN_METADATA, TxOverrides, ValidatePayeeDetailsRequest, ValidatePayeeDetailsResponse, ValidationError, ZKP2PError, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, apiConfirmPayPalForwarding, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuotesBestByPlatform, apiGetTakerTier, apiPostDepositDetails, apiUploadGoogleOAuthSellerCredential, apiValidatePayeeDetails, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, createPeerExtensionSdk, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, ensureBytes32, getAttributionDataSuffix, getPeerExtensionState, getSpreadOracleConfig, isPeerExtensionAvailable, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, referrerFeeConfigToPreciseUnits, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
|
|
722
|
+
export { APIError, ApiAdapterOptions, AttestationServiceIdentityResponse, AttestationServiceSellerCredentialUploadResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ConfirmPayPalForwardingResponse, 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 PeerConnectionStatus, type PeerExtensionApi, type PeerExtensionOnrampParams, type PeerExtensionSdk, type PeerExtensionSdkOptions, type PeerExtensionState, type PeerExtensionWindow, type PeerOnrampPreparedTransactionCallback, type PeerOnrampPreparedTransactionResult, PostDepositDetailsRequest, PostDepositDetailsResponse, type PythFeedConfig, QuotesBestByPlatformRequest, ReferrerFeeConfig, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, SellerCredentialAttestationRuntime, SellerCredentialUploadInput, SellerPlatform, type SpreadOracleConfig, type SpreadOracleFeedConfig, type SupportedChainId, TOKEN_METADATA, TxOverrides, ValidatePayeeDetailsRequest, ValidatePayeeDetailsResponse, ValidationError, ZKP2PError, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, apiConfirmPayPalForwarding, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuotesBestByPlatform, apiGetTakerTier, apiPostDepositDetails, apiRequestIdentityAttestation, apiUploadGoogleOAuthSellerCredential, apiValidatePayeeDetails, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, 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
|
@@ -423,7 +423,7 @@ function normalizeOptionalString(value) {
|
|
|
423
423
|
function normalizeBaseUrl(value, label) {
|
|
424
424
|
const normalized = normalizeOptionalString(value)?.replace(/\/+$/u, "");
|
|
425
425
|
if (!normalized) {
|
|
426
|
-
throw new Error(`${label} is required
|
|
426
|
+
throw new Error(`${label} is required.`);
|
|
427
427
|
}
|
|
428
428
|
return normalized;
|
|
429
429
|
}
|
|
@@ -516,6 +516,35 @@ async function apiVerifyBuyerTeePayment(payload, attestationServiceUrl, platform
|
|
|
516
516
|
return res.json();
|
|
517
517
|
});
|
|
518
518
|
}
|
|
519
|
+
async function apiRequestIdentityAttestation(payload, attestationServiceUrl, platform, actionType) {
|
|
520
|
+
return withRetry(async () => {
|
|
521
|
+
let res;
|
|
522
|
+
try {
|
|
523
|
+
const endpoint = "/identity";
|
|
524
|
+
const baseUrl = normalizeBaseUrl(attestationServiceUrl, "Attestation Service URL");
|
|
525
|
+
res = await fetch(`${baseUrl}${endpoint}`, {
|
|
526
|
+
method: "POST",
|
|
527
|
+
headers: headers(),
|
|
528
|
+
body: JSON.stringify({
|
|
529
|
+
platform,
|
|
530
|
+
actionType,
|
|
531
|
+
encryptedSessionMaterial: payload.encryptedSessionMaterial,
|
|
532
|
+
params: payload.params
|
|
533
|
+
})
|
|
534
|
+
});
|
|
535
|
+
} catch (error) {
|
|
536
|
+
throw new NetworkError("Failed to connect to Attestation Service", {
|
|
537
|
+
endpoint: "/identity",
|
|
538
|
+
error
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
if (!res.ok) {
|
|
542
|
+
const errorText = await res.text();
|
|
543
|
+
throw parseAPIError(res, errorText);
|
|
544
|
+
}
|
|
545
|
+
return res.json();
|
|
546
|
+
});
|
|
547
|
+
}
|
|
519
548
|
async function createEncryptedBuyerTeeSessionMaterial({
|
|
520
549
|
actionType,
|
|
521
550
|
attestationRuntime,
|
|
@@ -5496,11 +5525,11 @@ var ERC20_ABI = [
|
|
|
5496
5525
|
];
|
|
5497
5526
|
|
|
5498
5527
|
// src/client/Zkp2pClient.ts
|
|
5499
|
-
function
|
|
5528
|
+
function isObjectRecord(value) {
|
|
5500
5529
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
5501
5530
|
return false;
|
|
5502
5531
|
}
|
|
5503
|
-
return
|
|
5532
|
+
return true;
|
|
5504
5533
|
}
|
|
5505
5534
|
function normalizeTelegramUsername(value) {
|
|
5506
5535
|
if (typeof value !== "string") {
|
|
@@ -5537,7 +5566,7 @@ function normalizeQuotePayeeData(maker) {
|
|
|
5537
5566
|
return {
|
|
5538
5567
|
offchainId,
|
|
5539
5568
|
telegramUsername: normalizeTelegramUsername(maker?.telegramUsername) ?? legacy?.telegramUsername ?? null,
|
|
5540
|
-
metadata:
|
|
5569
|
+
metadata: isObjectRecord(maker?.metadata) ? maker.metadata : legacy?.metadata ?? null
|
|
5541
5570
|
};
|
|
5542
5571
|
}
|
|
5543
5572
|
function normalizePayeeDataInputItem(raw) {
|
|
@@ -8513,6 +8542,6 @@ var logger = {
|
|
|
8513
8542
|
}
|
|
8514
8543
|
};
|
|
8515
8544
|
|
|
8516
|
-
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, apiConfirmPayPalForwarding, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuotesBestByPlatform, apiGetTakerTier, apiPostDepositDetails, apiUploadGoogleOAuthSellerCredential, apiValidatePayeeDetails, 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 };
|
|
8545
|
+
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, apiConfirmPayPalForwarding, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuotesBestByPlatform, apiGetTakerTier, apiPostDepositDetails, apiRequestIdentityAttestation, apiUploadGoogleOAuthSellerCredential, apiValidatePayeeDetails, 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 };
|
|
8517
8546
|
//# sourceMappingURL=index.mjs.map
|
|
8518
8547
|
//# sourceMappingURL=index.mjs.map
|