@zkp2p/sdk 0.4.0 → 0.4.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/dist/index.cjs +165 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +13 -4
- package/dist/index.d.ts +13 -4
- package/dist/index.mjs +165 -28
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/{vaultUtils-CyPf4QGT.d.mts → vaultUtils-Dt7ZOITQ.d.mts} +56 -7
- package/dist/{vaultUtils-CyPf4QGT.d.ts → vaultUtils-Dt7ZOITQ.d.ts} +56 -7
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, S as SellerCredentialUploadInput, a as SellerPlatform, b as SellerCredentialAttestationRuntime, A as AttestationServiceSellerCredentialUploadResponse, Q as QuotesBestByPlatformRequest,
|
|
2
|
-
export {
|
|
3
|
-
import { Address, Hex, WalletClient
|
|
1
|
+
import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, S as SellerCredentialUploadInput, a as SellerPlatform, b as SellerCredentialAttestationRuntime, A as AttestationServiceSellerCredentialUploadResponse, B as BuyerTeeSessionMaterialEncryptionInput, C as ConfirmPayPalForwardingResponse, Q as QuotesBestByPlatformRequest, c as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, d as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, e as PostDepositDetailsResponse, G as GetPayeeDetailsRequest, f as GetPayeeDetailsResponse, g as GetOwnerDepositsRequest, h as GetOwnerDepositsResponse, i as GetTakerTierRequest, j as GetTakerTierResponse, k as GetDepositBundleParams, l as ApiAdapterOptions, m as GetDepositBundleResponse, n as GetOrderbookParams, o as GetOrderbookResponse, p as CurrencyType, q as PaymentMethodCatalog, T as TxOverrides } from './vaultUtils-Dt7ZOITQ.mjs';
|
|
2
|
+
export { x as ActionCallback, ac as ApiDeposit, aj as ApiIntentStatus, aU as AttestationServiceSellerCredentialProbeResponse, aT as AttestationServiceSellerVerifyResponse, v as AuthorizationTokenProvider, cq as BatchResult, M as BestByPlatformResponseObject, aV as BuyerTeePaymentParams, aW as BuyerTeePaymentProofInput, aX as BuyerTeeSessionMaterial, t as CancelIntentMethodParams, L as CancelIntentParams, aA as CashAppCredentialUploadInput, at as CashAppSessionMaterial, b3 as ConfirmPayPalForwardingRequest, z as CreateDepositConversionRate, y as CreateDepositParams, aZ as CuratorSellerCredentialStatusResponse, aY as CuratorSellerCredentialUploadResponse, a_ as CuratorSellerVerifyResponse, bV as Currency, c0 as CurrencyData, cp as DelegationDepositTarget, cn as DelegationRoute, co as DelegationState, cb as Deposit, cd as DepositCurrency, ba as DepositIntentStatistics, af as DepositStatus, ad as DepositVerifier, ae as DepositVerifierCurrency, b7 as DepositVerifierData, ca as DepositView, a8 as FiatResponse, F as FulfillIntentMethodParams, J as FulfillIntentParams, N as GetBestByPlatformResponse, O as GetBestByPlatformResponseObject, ag as GetDepositByIdRequest, ah as GetDepositByIdResponse, ao as GetIntentByHashRequest, ap as GetIntentByHashResponse, am as GetIntentsByDepositRequest, an as GetIntentsByDepositResponse, _ as GetNearbyQuote, $ as GetNearbySuggestions, ak as GetOwnerIntentsRequest, al as GetOwnerIntentsResponse, U as GetPlatformQuote, a0 as GetQuoteResponse, a1 as GetQuoteResponseObject, a2 as GetQuoteSingleResponse, b2 as GetSellerCredentialStatusParams, bh as IndexerClient, bP as IndexerDeploymentEnv, bn as IndexerDeposit, bE as IndexerDepositDailySnapshot, bG as IndexerDepositFilter, bD as IndexerDepositFundActivity, bF as IndexerDepositFundActivityType, bJ as IndexerDepositOrderDirection, bI as IndexerDepositOrderField, bH as IndexerDepositPagination, bq as IndexerDepositPaymentMethod, bj as IndexerDepositService, bS as IndexerFulfillmentAndPaymentResponse, bQ as IndexerFulfillmentRecord, bo as IndexerIntentFulfilled, bp as IndexerIntentFulfillmentAmounts, bs as IndexerIntentStatus, bw as IndexerManagerAggregateStats, by as IndexerManagerDailySnapshot, bx as IndexerManagerStats, bB as IndexerManualRateUpdate, br as IndexerMethodCurrency, bC as IndexerOracleConfigUpdate, bR as IndexerPaymentVerifiedRecord, bt as IndexerRateManager, bv as IndexerRateManagerDelegation, bM as IndexerRateManagerDelegationPagination, bA as IndexerRateManagerDetail, bK as IndexerRateManagerFilter, bz as IndexerRateManagerListItem, bO as IndexerRateManagerOrderDirection, bN as IndexerRateManagerOrderField, bL as IndexerRateManagerPagination, bu as IndexerRateManagerRate, bk as IndexerRateManagerService, ai as Intent, cf as IntentView, aa as NearbyQuote, ab as NearbySuggestions, Z as OfframpClient, b6 as OnchainCurrency, cg as OnchainIntent, b9 as OrderStats, bg as OrderbookEntry, bT as PAYMENT_PLATFORMS, aC as PayPalCredentialUploadInput, b4 as PayPalForwardingConfirmationErrorCode, ay as PayPalSessionMaterial, cc as PaymentMethodData, bU as PaymentPlatformType, be as PlatformLimit, X as PlatformQuote, bf as PlatformRiskLevel, b8 as PreparedTransaction, a7 as QuoteFeesResponse, a6 as QuoteIntentResponse, Y as QuoteRequest, a3 as QuoteResponse, a4 as QuoteResponseObject, a5 as QuoteSingleResponse, E as Range, ce as ReferralFee, aq as RegisterPayeeDetailsRequest, ar as RegisterPayeeDetailsResponse, b0 as RegisteredUploadSellerCredentialParams, K as ReleaseFundsToPayerParams, c5 as RuntimeEnv, aR as SellerAttestationOutput, aE as SellerCiphertextBundle, aJ as SellerCredentialBundle, aK as SellerCredentialBundleUpload, aS as SellerCredentialProbeResponse, aM as SellerCredentialStatus, aL as SellerCredentialStatusValue, aD as SellerCredentialUploadInputByPlatform, aQ as SellerPaymentTypedDataValue, aI as SellerProbeInput, aF as SellerSignedCiphertextBundle, aO as SellerTypedDataField, aP as SellerTypedDataSpec, aH as SellerVerifyInput, aG as SellerVerifyIntentDetails, aN as SellerVerifyProxyBody, cs as SendBatchFn, cr as SendTransactionFn, s as SignalIntentMethodParams, H as SignalIntentParams, r as SignalIntentReferralFee, bb as TakerTier, bd as TakerTierLevel, bc as TakerTierStats, w as TimeoutConfig, a9 as TokenResponse, b1 as UploadSellerCredentialOptions, a$ as UploadSellerCredentialParams, az as VenmoCredentialUploadInput, as as VenmoSessionMaterial, b5 as VerifySellerPaymentParams, aB as WiseCredentialUploadInput, av as WiseProfileInfo, ax as WiseProfileNotFound, aw as WiseProfileSelectionRequired, au as WiseSessionMaterial, W as WithdrawDepositParams, ch as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, u as Zkp2pClientOptions, cm as classifyDelegationState, bl as compareEventCursorIdsByRecency, bW as currencyInfo, bi as defaultIndexerEndpoint, c8 as enrichPvDepositView, c9 as enrichPvIntentView, bm as fetchIndexerFulfillmentAndPayment, c1 as getContracts, bZ as getCurrencyCodeFromHash, bY as getCurrencyInfoFromCountryCode, bX as getCurrencyInfoFromHash, cl as getDelegationRoute, c4 as getGatingServiceAddress, c3 as getPaymentMethodsCatalog, c2 as getRateManagerContracts, b_ as isSupportedCurrencyHash, ci as isZeroRateManagerId, b$ as mapConversionRatesToOnchainMinRate, cj as normalizeRateManagerId, ck as normalizeRegistry, c6 as parseDepositView, c7 as parseIntentView } from './vaultUtils-Dt7ZOITQ.mjs';
|
|
3
|
+
import { Address, Hash, Hex, WalletClient } from 'viem';
|
|
4
4
|
import { Abi } from 'abitype';
|
|
5
5
|
import '@zkp2p/indexer-schema';
|
|
6
6
|
|
|
@@ -190,6 +190,7 @@ interface ConvertLiquidityOptions {
|
|
|
190
190
|
declare function convertDepositsForLiquidity(deposits: DepositWithRelations[], chainId: number, escrowAddress: string, options?: ConvertLiquidityOptions): EscrowDepositView[];
|
|
191
191
|
declare function convertIndexerIntentsToEscrowViews(intents: IntentEntity[], depositViewsById: Map<string, EscrowDepositView>): EscrowIntentView[];
|
|
192
192
|
|
|
193
|
+
declare function createEncryptedBuyerTeeSessionMaterial({ actionType, attestationRuntime, attestationServiceUrl, platform, sessionMaterial, timeoutMs, }: BuyerTeeSessionMaterialEncryptionInput): Promise<string>;
|
|
193
194
|
declare function apiCreateSellerCredentialBundle(payload: SellerCredentialUploadInput, attestationServiceUrl: string, platform: SellerPlatform, timeoutMs?: number, attestationRuntime?: SellerCredentialAttestationRuntime): Promise<AttestationServiceSellerCredentialUploadResponse>;
|
|
194
195
|
|
|
195
196
|
declare function apiPostDepositDetails(req: PostDepositDetailsRequest, baseApiUrl: string, timeoutMs?: number, _apiKey?: string, _authToken?: string): Promise<PostDepositDetailsResponse>;
|
|
@@ -201,6 +202,14 @@ declare function apiGetOwnerDeposits(req: GetOwnerDepositsRequest, apiKey: strin
|
|
|
201
202
|
* Get taker tier information for a specific address.
|
|
202
203
|
*/
|
|
203
204
|
declare function apiGetTakerTier(req: GetTakerTierRequest, apiKey: string | undefined, baseApiUrl: string, timeoutMs?: number): Promise<GetTakerTierResponse>;
|
|
205
|
+
declare function apiConfirmPayPalForwarding(payeeDetails: Hash, body: {
|
|
206
|
+
payeeEmail: string;
|
|
207
|
+
forwardingInitiatorEmail: string;
|
|
208
|
+
}, baseApiUrl: string, opts?: {
|
|
209
|
+
apiKey?: string;
|
|
210
|
+
authToken?: string;
|
|
211
|
+
timeoutMs?: number;
|
|
212
|
+
}): Promise<ConfirmPayPalForwardingResponse>;
|
|
204
213
|
declare function apiGetOrderbook(params: GetOrderbookParams, opts: ApiAdapterOptions): Promise<GetOrderbookResponse>;
|
|
205
214
|
declare function apiGetOrderbook(params: GetOrderbookParams, baseApiUrl: string, timeoutMs?: number, apiKey?: string): Promise<GetOrderbookResponse>;
|
|
206
215
|
declare function apiGetDepositBundle(params: GetDepositBundleParams, opts: ApiAdapterOptions): Promise<GetDepositBundleResponse>;
|
|
@@ -703,4 +712,4 @@ declare class ContractError extends ZKP2PError {
|
|
|
703
712
|
constructor(message: string, details?: unknown);
|
|
704
713
|
}
|
|
705
714
|
|
|
706
|
-
export { APIError, ApiAdapterOptions, AttestationServiceSellerCredentialUploadResponse, 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 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, apiCreateSellerCredentialBundle, 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 };
|
|
715
|
+
export { APIError, ApiAdapterOptions, AttestationServiceSellerCredentialUploadResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ConfirmPayPalForwardingResponse, 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 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, 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,6 +1,6 @@
|
|
|
1
|
-
import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, S as SellerCredentialUploadInput, a as SellerPlatform, b as SellerCredentialAttestationRuntime, A as AttestationServiceSellerCredentialUploadResponse, Q as QuotesBestByPlatformRequest,
|
|
2
|
-
export {
|
|
3
|
-
import { Address, Hex, WalletClient
|
|
1
|
+
import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, S as SellerCredentialUploadInput, a as SellerPlatform, b as SellerCredentialAttestationRuntime, A as AttestationServiceSellerCredentialUploadResponse, B as BuyerTeeSessionMaterialEncryptionInput, C as ConfirmPayPalForwardingResponse, Q as QuotesBestByPlatformRequest, c as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, d as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, e as PostDepositDetailsResponse, G as GetPayeeDetailsRequest, f as GetPayeeDetailsResponse, g as GetOwnerDepositsRequest, h as GetOwnerDepositsResponse, i as GetTakerTierRequest, j as GetTakerTierResponse, k as GetDepositBundleParams, l as ApiAdapterOptions, m as GetDepositBundleResponse, n as GetOrderbookParams, o as GetOrderbookResponse, p as CurrencyType, q as PaymentMethodCatalog, T as TxOverrides } from './vaultUtils-Dt7ZOITQ.js';
|
|
2
|
+
export { x as ActionCallback, ac as ApiDeposit, aj as ApiIntentStatus, aU as AttestationServiceSellerCredentialProbeResponse, aT as AttestationServiceSellerVerifyResponse, v as AuthorizationTokenProvider, cq as BatchResult, M as BestByPlatformResponseObject, aV as BuyerTeePaymentParams, aW as BuyerTeePaymentProofInput, aX as BuyerTeeSessionMaterial, t as CancelIntentMethodParams, L as CancelIntentParams, aA as CashAppCredentialUploadInput, at as CashAppSessionMaterial, b3 as ConfirmPayPalForwardingRequest, z as CreateDepositConversionRate, y as CreateDepositParams, aZ as CuratorSellerCredentialStatusResponse, aY as CuratorSellerCredentialUploadResponse, a_ as CuratorSellerVerifyResponse, bV as Currency, c0 as CurrencyData, cp as DelegationDepositTarget, cn as DelegationRoute, co as DelegationState, cb as Deposit, cd as DepositCurrency, ba as DepositIntentStatistics, af as DepositStatus, ad as DepositVerifier, ae as DepositVerifierCurrency, b7 as DepositVerifierData, ca as DepositView, a8 as FiatResponse, F as FulfillIntentMethodParams, J as FulfillIntentParams, N as GetBestByPlatformResponse, O as GetBestByPlatformResponseObject, ag as GetDepositByIdRequest, ah as GetDepositByIdResponse, ao as GetIntentByHashRequest, ap as GetIntentByHashResponse, am as GetIntentsByDepositRequest, an as GetIntentsByDepositResponse, _ as GetNearbyQuote, $ as GetNearbySuggestions, ak as GetOwnerIntentsRequest, al as GetOwnerIntentsResponse, U as GetPlatformQuote, a0 as GetQuoteResponse, a1 as GetQuoteResponseObject, a2 as GetQuoteSingleResponse, b2 as GetSellerCredentialStatusParams, bh as IndexerClient, bP as IndexerDeploymentEnv, bn as IndexerDeposit, bE as IndexerDepositDailySnapshot, bG as IndexerDepositFilter, bD as IndexerDepositFundActivity, bF as IndexerDepositFundActivityType, bJ as IndexerDepositOrderDirection, bI as IndexerDepositOrderField, bH as IndexerDepositPagination, bq as IndexerDepositPaymentMethod, bj as IndexerDepositService, bS as IndexerFulfillmentAndPaymentResponse, bQ as IndexerFulfillmentRecord, bo as IndexerIntentFulfilled, bp as IndexerIntentFulfillmentAmounts, bs as IndexerIntentStatus, bw as IndexerManagerAggregateStats, by as IndexerManagerDailySnapshot, bx as IndexerManagerStats, bB as IndexerManualRateUpdate, br as IndexerMethodCurrency, bC as IndexerOracleConfigUpdate, bR as IndexerPaymentVerifiedRecord, bt as IndexerRateManager, bv as IndexerRateManagerDelegation, bM as IndexerRateManagerDelegationPagination, bA as IndexerRateManagerDetail, bK as IndexerRateManagerFilter, bz as IndexerRateManagerListItem, bO as IndexerRateManagerOrderDirection, bN as IndexerRateManagerOrderField, bL as IndexerRateManagerPagination, bu as IndexerRateManagerRate, bk as IndexerRateManagerService, ai as Intent, cf as IntentView, aa as NearbyQuote, ab as NearbySuggestions, Z as OfframpClient, b6 as OnchainCurrency, cg as OnchainIntent, b9 as OrderStats, bg as OrderbookEntry, bT as PAYMENT_PLATFORMS, aC as PayPalCredentialUploadInput, b4 as PayPalForwardingConfirmationErrorCode, ay as PayPalSessionMaterial, cc as PaymentMethodData, bU as PaymentPlatformType, be as PlatformLimit, X as PlatformQuote, bf as PlatformRiskLevel, b8 as PreparedTransaction, a7 as QuoteFeesResponse, a6 as QuoteIntentResponse, Y as QuoteRequest, a3 as QuoteResponse, a4 as QuoteResponseObject, a5 as QuoteSingleResponse, E as Range, ce as ReferralFee, aq as RegisterPayeeDetailsRequest, ar as RegisterPayeeDetailsResponse, b0 as RegisteredUploadSellerCredentialParams, K as ReleaseFundsToPayerParams, c5 as RuntimeEnv, aR as SellerAttestationOutput, aE as SellerCiphertextBundle, aJ as SellerCredentialBundle, aK as SellerCredentialBundleUpload, aS as SellerCredentialProbeResponse, aM as SellerCredentialStatus, aL as SellerCredentialStatusValue, aD as SellerCredentialUploadInputByPlatform, aQ as SellerPaymentTypedDataValue, aI as SellerProbeInput, aF as SellerSignedCiphertextBundle, aO as SellerTypedDataField, aP as SellerTypedDataSpec, aH as SellerVerifyInput, aG as SellerVerifyIntentDetails, aN as SellerVerifyProxyBody, cs as SendBatchFn, cr as SendTransactionFn, s as SignalIntentMethodParams, H as SignalIntentParams, r as SignalIntentReferralFee, bb as TakerTier, bd as TakerTierLevel, bc as TakerTierStats, w as TimeoutConfig, a9 as TokenResponse, b1 as UploadSellerCredentialOptions, a$ as UploadSellerCredentialParams, az as VenmoCredentialUploadInput, as as VenmoSessionMaterial, b5 as VerifySellerPaymentParams, aB as WiseCredentialUploadInput, av as WiseProfileInfo, ax as WiseProfileNotFound, aw as WiseProfileSelectionRequired, au as WiseSessionMaterial, W as WithdrawDepositParams, ch as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, u as Zkp2pClientOptions, cm as classifyDelegationState, bl as compareEventCursorIdsByRecency, bW as currencyInfo, bi as defaultIndexerEndpoint, c8 as enrichPvDepositView, c9 as enrichPvIntentView, bm as fetchIndexerFulfillmentAndPayment, c1 as getContracts, bZ as getCurrencyCodeFromHash, bY as getCurrencyInfoFromCountryCode, bX as getCurrencyInfoFromHash, cl as getDelegationRoute, c4 as getGatingServiceAddress, c3 as getPaymentMethodsCatalog, c2 as getRateManagerContracts, b_ as isSupportedCurrencyHash, ci as isZeroRateManagerId, b$ as mapConversionRatesToOnchainMinRate, cj as normalizeRateManagerId, ck as normalizeRegistry, c6 as parseDepositView, c7 as parseIntentView } from './vaultUtils-Dt7ZOITQ.js';
|
|
3
|
+
import { Address, Hash, Hex, WalletClient } from 'viem';
|
|
4
4
|
import { Abi } from 'abitype';
|
|
5
5
|
import '@zkp2p/indexer-schema';
|
|
6
6
|
|
|
@@ -190,6 +190,7 @@ interface ConvertLiquidityOptions {
|
|
|
190
190
|
declare function convertDepositsForLiquidity(deposits: DepositWithRelations[], chainId: number, escrowAddress: string, options?: ConvertLiquidityOptions): EscrowDepositView[];
|
|
191
191
|
declare function convertIndexerIntentsToEscrowViews(intents: IntentEntity[], depositViewsById: Map<string, EscrowDepositView>): EscrowIntentView[];
|
|
192
192
|
|
|
193
|
+
declare function createEncryptedBuyerTeeSessionMaterial({ actionType, attestationRuntime, attestationServiceUrl, platform, sessionMaterial, timeoutMs, }: BuyerTeeSessionMaterialEncryptionInput): Promise<string>;
|
|
193
194
|
declare function apiCreateSellerCredentialBundle(payload: SellerCredentialUploadInput, attestationServiceUrl: string, platform: SellerPlatform, timeoutMs?: number, attestationRuntime?: SellerCredentialAttestationRuntime): Promise<AttestationServiceSellerCredentialUploadResponse>;
|
|
194
195
|
|
|
195
196
|
declare function apiPostDepositDetails(req: PostDepositDetailsRequest, baseApiUrl: string, timeoutMs?: number, _apiKey?: string, _authToken?: string): Promise<PostDepositDetailsResponse>;
|
|
@@ -201,6 +202,14 @@ declare function apiGetOwnerDeposits(req: GetOwnerDepositsRequest, apiKey: strin
|
|
|
201
202
|
* Get taker tier information for a specific address.
|
|
202
203
|
*/
|
|
203
204
|
declare function apiGetTakerTier(req: GetTakerTierRequest, apiKey: string | undefined, baseApiUrl: string, timeoutMs?: number): Promise<GetTakerTierResponse>;
|
|
205
|
+
declare function apiConfirmPayPalForwarding(payeeDetails: Hash, body: {
|
|
206
|
+
payeeEmail: string;
|
|
207
|
+
forwardingInitiatorEmail: string;
|
|
208
|
+
}, baseApiUrl: string, opts?: {
|
|
209
|
+
apiKey?: string;
|
|
210
|
+
authToken?: string;
|
|
211
|
+
timeoutMs?: number;
|
|
212
|
+
}): Promise<ConfirmPayPalForwardingResponse>;
|
|
204
213
|
declare function apiGetOrderbook(params: GetOrderbookParams, opts: ApiAdapterOptions): Promise<GetOrderbookResponse>;
|
|
205
214
|
declare function apiGetOrderbook(params: GetOrderbookParams, baseApiUrl: string, timeoutMs?: number, apiKey?: string): Promise<GetOrderbookResponse>;
|
|
206
215
|
declare function apiGetDepositBundle(params: GetDepositBundleParams, opts: ApiAdapterOptions): Promise<GetDepositBundleResponse>;
|
|
@@ -703,4 +712,4 @@ declare class ContractError extends ZKP2PError {
|
|
|
703
712
|
constructor(message: string, details?: unknown);
|
|
704
713
|
}
|
|
705
714
|
|
|
706
|
-
export { APIError, ApiAdapterOptions, AttestationServiceSellerCredentialUploadResponse, 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 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, apiCreateSellerCredentialBundle, 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 };
|
|
715
|
+
export { APIError, ApiAdapterOptions, AttestationServiceSellerCredentialUploadResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ConfirmPayPalForwardingResponse, 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 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, 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
|
@@ -8,7 +8,7 @@ export { Currency, currencyInfo, getCurrencyCodeFromHash, getCurrencyInfoFromCou
|
|
|
8
8
|
import './chunk-J5LGTIGS.mjs';
|
|
9
9
|
import { concatHex, encodeFunctionData, encodeAbiParameters, createPublicClient, http, formatUnits } from 'viem';
|
|
10
10
|
import { hardhat, base } from 'viem/chains';
|
|
11
|
-
import { createEncryptedSellerCredentialUpload } from '@zkp2p/zkp2p-attestation';
|
|
11
|
+
import { createEncryptedBuyerTeeSessionMaterial as createEncryptedBuyerTeeSessionMaterial$1, createEncryptedSellerCredentialUpload } from '@zkp2p/zkp2p-attestation';
|
|
12
12
|
import { AbiCoder } from 'ethers';
|
|
13
13
|
import { Attribution } from 'ox/erc8021';
|
|
14
14
|
|
|
@@ -413,6 +413,20 @@ async function apiSignIntentV3(request, opts) {
|
|
|
413
413
|
function headers() {
|
|
414
414
|
return { "Content-Type": "application/json" };
|
|
415
415
|
}
|
|
416
|
+
function normalizeOptionalString(value) {
|
|
417
|
+
if (typeof value !== "string") {
|
|
418
|
+
return null;
|
|
419
|
+
}
|
|
420
|
+
const normalized = value.trim();
|
|
421
|
+
return normalized.length > 0 ? normalized : null;
|
|
422
|
+
}
|
|
423
|
+
function normalizeBaseUrl(value, label) {
|
|
424
|
+
const normalized = normalizeOptionalString(value)?.replace(/\/+$/u, "");
|
|
425
|
+
if (!normalized) {
|
|
426
|
+
throw new Error(`${label} is required for buyer TEE session encryption.`);
|
|
427
|
+
}
|
|
428
|
+
return normalized;
|
|
429
|
+
}
|
|
416
430
|
function isPayeeBoundSellerCredentialUploadInput(payload) {
|
|
417
431
|
return typeof payload.payeeId === "string";
|
|
418
432
|
}
|
|
@@ -477,6 +491,51 @@ async function apiCreatePaymentAttestation(payload, attestationServiceUrl, platf
|
|
|
477
491
|
return res.json();
|
|
478
492
|
});
|
|
479
493
|
}
|
|
494
|
+
async function apiVerifyBuyerTeePayment(payload, attestationServiceUrl, platform, actionType) {
|
|
495
|
+
return withRetry(async () => {
|
|
496
|
+
let res;
|
|
497
|
+
try {
|
|
498
|
+
const endpoint = `/buyer/verify/${encodeURIComponent(platform)}/${encodeURIComponent(
|
|
499
|
+
actionType
|
|
500
|
+
)}`;
|
|
501
|
+
res = await fetch(`${attestationServiceUrl}${endpoint}`, {
|
|
502
|
+
method: "POST",
|
|
503
|
+
headers: headers(),
|
|
504
|
+
body: JSON.stringify(payload)
|
|
505
|
+
});
|
|
506
|
+
} catch (error) {
|
|
507
|
+
throw new NetworkError("Failed to connect to Attestation Service", {
|
|
508
|
+
endpoint: `/buyer/verify/${platform}/${actionType}`,
|
|
509
|
+
error
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
if (!res.ok) {
|
|
513
|
+
const errorText = await res.text();
|
|
514
|
+
throw parseAPIError(res, errorText);
|
|
515
|
+
}
|
|
516
|
+
return res.json();
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
async function createEncryptedBuyerTeeSessionMaterial({
|
|
520
|
+
actionType,
|
|
521
|
+
attestationRuntime,
|
|
522
|
+
attestationServiceUrl,
|
|
523
|
+
platform,
|
|
524
|
+
sessionMaterial,
|
|
525
|
+
timeoutMs
|
|
526
|
+
}) {
|
|
527
|
+
const params = {
|
|
528
|
+
actionType,
|
|
529
|
+
attestationServiceUrl: normalizeBaseUrl(attestationServiceUrl, "Attestation Service URL"),
|
|
530
|
+
platform,
|
|
531
|
+
sessionMaterial,
|
|
532
|
+
...timeoutMs == null ? {} : { timeoutMs },
|
|
533
|
+
...attestationRuntime?.fetch ? { fetch: attestationRuntime.fetch } : {},
|
|
534
|
+
...attestationRuntime?.subtle ? { subtle: attestationRuntime.subtle } : {},
|
|
535
|
+
...attestationRuntime?.getRandomValues ? { getRandomValues: attestationRuntime.getRandomValues } : {}
|
|
536
|
+
};
|
|
537
|
+
return createEncryptedBuyerTeeSessionMaterial$1(params);
|
|
538
|
+
}
|
|
480
539
|
async function apiCreateSellerCredentialBundle(payload, attestationServiceUrl, platform, timeoutMs, attestationRuntime) {
|
|
481
540
|
return withRetry(
|
|
482
541
|
async () => {
|
|
@@ -531,12 +590,13 @@ function encodePaymentAttestation(attestation) {
|
|
|
531
590
|
const dataHash = td.dataHash;
|
|
532
591
|
const signatures = [resp.signature];
|
|
533
592
|
const encodedPaymentDetails = resp.encodedPaymentDetails;
|
|
593
|
+
const metadata = typeof resp.metadata === "string" && resp.metadata.length > 0 ? resp.metadata : "0x";
|
|
534
594
|
if (!intentHash || !releaseAmount || !dataHash || !encodedPaymentDetails) {
|
|
535
595
|
throw new Error("Attestation response missing required fields");
|
|
536
596
|
}
|
|
537
597
|
return abiCoder.encode(
|
|
538
598
|
["tuple(bytes32,uint256,bytes32,bytes[],bytes,bytes)"],
|
|
539
|
-
[[intentHash, releaseAmount, dataHash, signatures, encodedPaymentDetails,
|
|
599
|
+
[[intentHash, releaseAmount, dataHash, signatures, encodedPaymentDetails, metadata]]
|
|
540
600
|
);
|
|
541
601
|
}
|
|
542
602
|
|
|
@@ -938,6 +998,7 @@ var PLATFORM_ATTESTATION_CONFIG = {
|
|
|
938
998
|
chime: { actionType: "transfer_chime", actionPlatform: "chime" },
|
|
939
999
|
luxon: { actionType: "transfer_luxon", actionPlatform: "luxon" },
|
|
940
1000
|
n26: { actionType: "transfer_n26", actionPlatform: "n26" },
|
|
1001
|
+
alipay: { actionType: "transfer_alipay", actionPlatform: "alipay" },
|
|
941
1002
|
"zelle-chase": { actionType: "transfer_zelle", actionPlatform: "chase" },
|
|
942
1003
|
"zelle-bofa": { actionType: "transfer_zelle", actionPlatform: "bankofamerica" },
|
|
943
1004
|
"zelle-citi": { actionType: "transfer_zelle", actionPlatform: "citi" }
|
|
@@ -1238,6 +1299,8 @@ var IntentOperations = class {
|
|
|
1238
1299
|
paymentProof = precomputed.paymentProof;
|
|
1239
1300
|
verificationData = precomputed.verificationData;
|
|
1240
1301
|
} else {
|
|
1302
|
+
const { proof } = params;
|
|
1303
|
+
const buyerTeeProof = parseBuyerTeePaymentProofInput(proof);
|
|
1241
1304
|
const attestationServiceUrl = params.attestationServiceUrl ?? this.defaultAttestationService();
|
|
1242
1305
|
const inputs = await this.config.host.getFulfillIntentInputs(intentHash, {
|
|
1243
1306
|
orchestratorAddress: orchestratorContext.address
|
|
@@ -1252,24 +1315,33 @@ var IntentOperations = class {
|
|
|
1252
1315
|
throw new Error("Unknown paymentMethodHash for this network/env; update SDK catalogs.");
|
|
1253
1316
|
}
|
|
1254
1317
|
const platformConfig = resolvePlatformAttestationConfig(platformName);
|
|
1255
|
-
const
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
paymentMethod: paymentMethodHash,
|
|
1265
|
-
fiatCurrency: inputs.fiatCurrency,
|
|
1266
|
-
conversionRate: inputs.conversionRate,
|
|
1267
|
-
payeeDetails: inputs.payeeDetails,
|
|
1268
|
-
timestampBufferMs: params.timestampBufferMs ?? "300000"
|
|
1269
|
-
}
|
|
1318
|
+
const intent = {
|
|
1319
|
+
intentHash,
|
|
1320
|
+
amount: inputs.amount,
|
|
1321
|
+
timestampMs: inputs.intentTimestampMs,
|
|
1322
|
+
paymentMethod: paymentMethodHash,
|
|
1323
|
+
fiatCurrency: inputs.fiatCurrency,
|
|
1324
|
+
conversionRate: inputs.conversionRate,
|
|
1325
|
+
payeeDetails: inputs.payeeDetails,
|
|
1326
|
+
timestampBufferMs: params.timestampBufferMs ?? "300000"
|
|
1270
1327
|
};
|
|
1271
|
-
const attestation = await
|
|
1272
|
-
|
|
1328
|
+
const attestation = buyerTeeProof ? await apiVerifyBuyerTeePayment(
|
|
1329
|
+
{
|
|
1330
|
+
encryptedSessionMaterial: buyerTeeProof.encryptedSessionMaterial,
|
|
1331
|
+
params: buyerTeeProof.params,
|
|
1332
|
+
chainId: this.config.getChainId(),
|
|
1333
|
+
intent
|
|
1334
|
+
},
|
|
1335
|
+
attestationServiceUrl,
|
|
1336
|
+
platformConfig.actionPlatform,
|
|
1337
|
+
platformConfig.actionType
|
|
1338
|
+
) : await apiCreatePaymentAttestation(
|
|
1339
|
+
{
|
|
1340
|
+
proofType: "reclaim",
|
|
1341
|
+
proof: typeof proof === "string" ? proof : serializeProofInput(proof),
|
|
1342
|
+
chainId: this.config.getChainId(),
|
|
1343
|
+
intent
|
|
1344
|
+
},
|
|
1273
1345
|
attestationServiceUrl,
|
|
1274
1346
|
platformConfig.actionPlatform,
|
|
1275
1347
|
platformConfig.actionType
|
|
@@ -1387,6 +1459,27 @@ function serializeProofInput(proof) {
|
|
|
1387
1459
|
(_key, value) => typeof value === "bigint" ? value.toString() : value
|
|
1388
1460
|
);
|
|
1389
1461
|
}
|
|
1462
|
+
function isRecord(value) {
|
|
1463
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1464
|
+
}
|
|
1465
|
+
function isBuyerTeeParams(value) {
|
|
1466
|
+
return isRecord(value) && Object.values(value).every(
|
|
1467
|
+
(entry) => typeof entry === "string" || typeof entry === "number" || typeof entry === "boolean"
|
|
1468
|
+
);
|
|
1469
|
+
}
|
|
1470
|
+
function parseBuyerTeePaymentProofInput(proof) {
|
|
1471
|
+
if (!isRecord(proof) || proof.proofType !== "buyerTee") {
|
|
1472
|
+
return null;
|
|
1473
|
+
}
|
|
1474
|
+
if (typeof proof.encryptedSessionMaterial !== "string" || !isBuyerTeeParams(proof.params)) {
|
|
1475
|
+
throw new Error("Buyer TEE proof requires encryptedSessionMaterial and params.");
|
|
1476
|
+
}
|
|
1477
|
+
return {
|
|
1478
|
+
proofType: "buyerTee",
|
|
1479
|
+
encryptedSessionMaterial: proof.encryptedSessionMaterial,
|
|
1480
|
+
params: proof.params
|
|
1481
|
+
};
|
|
1482
|
+
}
|
|
1390
1483
|
function normalizeSignalIntentReferralFees(params) {
|
|
1391
1484
|
if (params.referralFees) {
|
|
1392
1485
|
return params.referralFees.map((referralFee) => ({
|
|
@@ -5157,6 +5250,19 @@ async function apiUploadSellerCredential(processorName, payeeDetails, bundle, ba
|
|
|
5157
5250
|
timeoutMs
|
|
5158
5251
|
});
|
|
5159
5252
|
}
|
|
5253
|
+
async function apiConfirmPayPalForwarding(payeeDetails, body, baseApiUrl, opts) {
|
|
5254
|
+
const endpoint = `/v2/makers/paypal/${encodeURIComponent(
|
|
5255
|
+
payeeDetails
|
|
5256
|
+
)}/seller-credential/forwarding-confirmation`;
|
|
5257
|
+
return apiFetch({
|
|
5258
|
+
url: `${withApiBase(baseApiUrl)}${endpoint}`,
|
|
5259
|
+
method: "POST",
|
|
5260
|
+
body,
|
|
5261
|
+
apiKey: opts?.apiKey,
|
|
5262
|
+
authToken: opts?.authToken,
|
|
5263
|
+
timeoutMs: opts?.timeoutMs
|
|
5264
|
+
});
|
|
5265
|
+
}
|
|
5160
5266
|
async function apiGetSellerCredentialStatus(processorName, payeeDetails, baseApiUrl, timeoutMs) {
|
|
5161
5267
|
const endpoint = `/v2/makers/${encodeURIComponent(processorName)}/${encodeURIComponent(
|
|
5162
5268
|
payeeDetails
|
|
@@ -5254,6 +5360,11 @@ var applyReferrerFeeDisplayFieldsToTokenAmount = (tokenAmount, referrerFeeConfig
|
|
|
5254
5360
|
}
|
|
5255
5361
|
};
|
|
5256
5362
|
var applyReferrerFeeDisplayFieldsToQuote = (quote, referrerFeeConfig, decimals) => {
|
|
5363
|
+
const enrichedQuote = quote;
|
|
5364
|
+
const hasCuratorReferrerFeeFields = enrichedQuote.referrerFeeAmount != null || enrichedQuote.referrerFeeBps != null;
|
|
5365
|
+
if (hasCuratorReferrerFeeFields) {
|
|
5366
|
+
return enrichedQuote;
|
|
5367
|
+
}
|
|
5257
5368
|
const signalIntentAmount = quote.signalIntentAmount ?? quote.intent?.amount ?? quote.tokenAmount;
|
|
5258
5369
|
const adjusted = applyReferrerFeeDisplayFieldsToTokenAmount(
|
|
5259
5370
|
quote.tokenAmount,
|
|
@@ -6223,7 +6334,7 @@ var Zkp2pClient = class {
|
|
|
6223
6334
|
* ```
|
|
6224
6335
|
*
|
|
6225
6336
|
* @param params.intentHash - The intent hash to fulfill (0x-prefixed, 32 bytes)
|
|
6226
|
-
* @param params.proof - Payment proof from Reclaim (object or JSON string)
|
|
6337
|
+
* @param params.proof - Payment proof from Reclaim (object or JSON string) or buyer TEE proof input
|
|
6227
6338
|
* @param params.timestampBufferMs - Allowed timestamp variance (default: 300000ms)
|
|
6228
6339
|
* @param params.attestationServiceUrl - Override attestation service URL
|
|
6229
6340
|
* @param params.postIntentHookData - Data to pass to post-intent hook
|
|
@@ -7859,6 +7970,32 @@ var Zkp2pClient = class {
|
|
|
7859
7970
|
timeoutMs
|
|
7860
7971
|
);
|
|
7861
7972
|
}
|
|
7973
|
+
/**
|
|
7974
|
+
* Confirms the PayPal Gmail-forwarding setup for an existing maker payee hash.
|
|
7975
|
+
*
|
|
7976
|
+
* Uses curator's `/forwarding-confirmation` route and forwards both API key and
|
|
7977
|
+
* bearer token so either auth strategy can satisfy the hybrid gate. The endpoint
|
|
7978
|
+
* is rate-limited server-side; callers should surface retry guidance from APIError.
|
|
7979
|
+
*/
|
|
7980
|
+
async confirmPayPalForwarding(params, opts) {
|
|
7981
|
+
const baseApiUrl = this.stripTrailingSlash(
|
|
7982
|
+
opts?.baseApiUrl ?? this.baseApiUrl ?? DEFAULT_BASE_API_URL
|
|
7983
|
+
);
|
|
7984
|
+
const timeoutMs = opts?.timeoutMs ?? this.apiTimeoutMs;
|
|
7985
|
+
return apiConfirmPayPalForwarding(
|
|
7986
|
+
params.payeeDetails,
|
|
7987
|
+
{
|
|
7988
|
+
payeeEmail: params.payeeEmail,
|
|
7989
|
+
forwardingInitiatorEmail: params.forwardingInitiatorEmail
|
|
7990
|
+
},
|
|
7991
|
+
baseApiUrl,
|
|
7992
|
+
{
|
|
7993
|
+
apiKey: this.apiKey,
|
|
7994
|
+
authToken: this.authorizationToken,
|
|
7995
|
+
timeoutMs
|
|
7996
|
+
}
|
|
7997
|
+
);
|
|
7998
|
+
}
|
|
7862
7999
|
/**
|
|
7863
8000
|
* Status is a coarse curator-owned signal (`active` / `inactive` / `missing`) and intentionally
|
|
7864
8001
|
* omits low-level diagnostics. Curator may still re-probe stale credentials during verify, so callers
|
|
@@ -8097,7 +8234,7 @@ var assertObjectInput = (params) => {
|
|
|
8097
8234
|
}
|
|
8098
8235
|
return params;
|
|
8099
8236
|
};
|
|
8100
|
-
var
|
|
8237
|
+
var normalizeOptionalString2 = (value, label) => {
|
|
8101
8238
|
if (value === void 0) {
|
|
8102
8239
|
return void 0;
|
|
8103
8240
|
}
|
|
@@ -8111,7 +8248,7 @@ var normalizeOptionalString = (value, label) => {
|
|
|
8111
8248
|
return trimmed;
|
|
8112
8249
|
};
|
|
8113
8250
|
var normalizeOptionalUrl = (value, label) => {
|
|
8114
|
-
const trimmed =
|
|
8251
|
+
const trimmed = normalizeOptionalString2(value, label);
|
|
8115
8252
|
if (trimmed === void 0) {
|
|
8116
8253
|
return void 0;
|
|
8117
8254
|
}
|
|
@@ -8238,20 +8375,20 @@ var buildOnrampQueryString = (params) => {
|
|
|
8238
8375
|
searchParams.set(key, value);
|
|
8239
8376
|
}
|
|
8240
8377
|
};
|
|
8241
|
-
setParam("referrer",
|
|
8378
|
+
setParam("referrer", normalizeOptionalString2(validated.referrer, "referrer"));
|
|
8242
8379
|
setParam("referrerLogo", normalizeOptionalUrl(validated.referrerLogo, "referrerLogo"));
|
|
8243
|
-
setParam("inputCurrency",
|
|
8380
|
+
setParam("inputCurrency", normalizeOptionalString2(validated.inputCurrency, "inputCurrency"));
|
|
8244
8381
|
setParam("inputAmount", normalizeFiatAmount(validated.inputAmount));
|
|
8245
8382
|
setParam(
|
|
8246
8383
|
"paymentPlatform",
|
|
8247
|
-
|
|
8384
|
+
normalizeOptionalString2(validated.paymentPlatform, "paymentPlatform")
|
|
8248
8385
|
);
|
|
8249
8386
|
setParam("depositId", normalizeIntegerParam(validated.depositId, "depositId"));
|
|
8250
|
-
setParam("toToken",
|
|
8387
|
+
setParam("toToken", normalizeOptionalString2(validated.toToken, "toToken"));
|
|
8251
8388
|
setParam("amountUsdc", normalizeUsdcAmount(validated.amountUsdc));
|
|
8252
8389
|
setParam(
|
|
8253
8390
|
"recipientAddress",
|
|
8254
|
-
|
|
8391
|
+
normalizeOptionalString2(validated.recipientAddress, "recipientAddress")
|
|
8255
8392
|
);
|
|
8256
8393
|
setParam("intentHash", normalizeIntentHash(validated.intentHash));
|
|
8257
8394
|
return searchParams.toString();
|
|
@@ -8312,6 +8449,6 @@ var logger = {
|
|
|
8312
8449
|
}
|
|
8313
8450
|
};
|
|
8314
8451
|
|
|
8315
|
-
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, 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 };
|
|
8452
|
+
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, 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 };
|
|
8316
8453
|
//# sourceMappingURL=index.mjs.map
|
|
8317
8454
|
//# sourceMappingURL=index.mjs.map
|