@zkp2p/sdk 0.14.1 → 0.14.2-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -11
- package/dist/build-metadata.json +3 -3
- package/dist/{chunk-4KACMRKF.mjs → chunk-DPMEQLSY.mjs} +148 -784
- package/dist/chunk-DPMEQLSY.mjs.map +1 -0
- package/dist/chunk-EDYYWCCJ.mjs +12 -0
- package/dist/chunk-EDYYWCCJ.mjs.map +1 -0
- package/dist/{currency-KDDCBZU2.mjs → currency-C5E6NVSR.mjs} +3 -3
- package/dist/{currency-KDDCBZU2.mjs.map → currency-C5E6NVSR.mjs.map} +1 -1
- package/dist/index.cjs +512 -4270
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.mjs +132 -49
- package/dist/index.mjs.map +1 -1
- package/dist/protocolViewerParsers-4BJOG6JG.mjs +5 -0
- package/dist/{protocolViewerParsers-S6VTWVVJ.mjs.map → protocolViewerParsers-4BJOG6JG.mjs.map} +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.mjs +1 -1
- package/dist/{timeout-7H5K6BBB.mjs → timeout-QRO3IS4N.mjs} +3 -3
- package/dist/{timeout-7H5K6BBB.mjs.map → timeout-QRO3IS4N.mjs.map} +1 -1
- package/dist/{vaultUtils-Llr7Gh2R.d.mts → vaultUtils-D3J7IDTF.d.mts} +40 -10
- package/dist/{vaultUtils-Llr7Gh2R.d.ts → vaultUtils-D3J7IDTF.d.ts} +40 -10
- package/package.json +2 -2
- package/dist/chunk-4KACMRKF.mjs.map +0 -1
- package/dist/chunk-5MBWIMIB.mjs +0 -12
- package/dist/chunk-5MBWIMIB.mjs.map +0 -1
- package/dist/protocolViewerParsers-S6VTWVVJ.mjs +0 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as ReferrerFeeConfig, S as SellerCredentialBundle, D as DepositWithRelations, I as IntentEntity, a as IdentityAttestationRequestBody, A as AttestationServiceIdentityResponse, B as BuyerTeeVerifyPaymentBody, b as AttestationServiceSellerVerifyResponse, c as SellerCredentialUploadInput, d as SellerCredentialUploadPlatform, e as SellerCredentialAttestationRuntime, f as AttestationServiceSellerCredentialUploadResponse, g as BuyerTeeSessionMaterialEncryptionInput, U as UploadSellerCredentialBundleParams, C as CuratorSellerCredentialUploadResponse, h as CreateReferralCodeRequest, i as ApiAdapterOptions, j as CreateReferralCodeResponse, k as ReferralReadRequest, l as ReferralDashboardResponse, m as ReferralEarningsResponse, n as ReferralCodeLookupResponse, o as RedeemReferralCodeRequest, p as RedeemReferralCodeResponse, q as UpdateReferralCodeRequest, r as UpdateReferralCodeResponse, G as GoogleOAuthSellerCredentialPlatform, s as GoogleOAuthSellerCredentialUploadBodyByPlatform, Q as QuotesBestByPlatformRequest, t as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, u as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, v as PostDepositDetailsResponse, w as GetPayeeDetailsRequest, x as GetPayeeDetailsResponse, y as GetOwnerDepositsRequest, z as GetOwnerDepositsResponse, E as GetDepositBundleParams, F as GetDepositBundleResponse, H as GetOrderbookParams, J as GetOrderbookResponse, K as GetOrderbookTableResponse, L as QuoteRequest, M as QuoteResponse, N as CuratorMetadata, O as CurrencyType, T as PaymentMethodCatalog, W as TxOverrides } from './vaultUtils-
|
|
2
|
-
export {
|
|
1
|
+
import { R as ReferrerFeeConfig, S as SellerCredentialBundle, D as DepositWithRelations, I as IntentEntity, a as IdentityAttestationRequestBody, A as AttestationServiceIdentityResponse, B as BuyerTeeVerifyPaymentBody, b as AttestationServiceSellerVerifyResponse, c as SellerCredentialUploadInput, d as SellerCredentialUploadPlatform, e as SellerCredentialAttestationRuntime, f as AttestationServiceSellerCredentialUploadResponse, g as BuyerTeeSessionMaterialEncryptionInput, U as UploadSellerCredentialBundleParams, C as CuratorSellerCredentialUploadResponse, h as CreateReferralCodeRequest, i as ApiAdapterOptions, j as CreateReferralCodeResponse, k as ReferralReadRequest, l as ReferralDashboardResponse, m as ReferralEarningsResponse, n as ReferralCodeLookupResponse, o as RedeemReferralCodeRequest, p as RedeemReferralCodeResponse, q as UpdateReferralCodeRequest, r as UpdateReferralCodeResponse, G as GoogleOAuthSellerCredentialPlatform, s as GoogleOAuthSellerCredentialUploadBodyByPlatform, Q as QuotesBestByPlatformRequest, t as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, u as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, v as PostDepositDetailsResponse, w as GetPayeeDetailsRequest, x as GetPayeeDetailsResponse, y as GetOwnerDepositsRequest, z as GetOwnerDepositsResponse, E as GetDepositBundleParams, F as GetDepositBundleResponse, H as GetOrderbookParams, J as GetOrderbookResponse, K as GetOrderbookTableResponse, L as QuoteRequest, M as QuoteResponse, N as CuratorMetadata, O as CurrencyType, T as PaymentMethodCatalog, W as TxOverrides } from './vaultUtils-D3J7IDTF.mjs';
|
|
2
|
+
export { dI as AccessPolicyOperations, dJ as AccessPolicyUnsupportedError, am as ActionCallback, b6 as AmazonPayCredentialUploadInput, b7 as AmazonPayIdentityAttestationOutput, aR as ApiDeposit, aY as ApiIntentStatus, bz as AttestationServiceSellerCredentialProbeResponse, ak as AuthorizationTokenProvider, dF as BatchResult, ax as BestByPlatformResponseObject, bA as BuyerTeePaymentParams, bB as BuyerTeePaymentProofInput, bC as BuyerTeeSessionMaterial, a3 as CancelIntentMethodParams, aw as CancelIntentParams, bh as CashAppCredentialUploadInput, b9 as CashAppSessionMaterial, aq as CreateDepositConversionRate, ap as CreateDepositParams, bD as CuratorSellerCredentialStatusResponse, bE as CuratorSellerVerifyResponse, cZ as Currency, d4 as CurrencyData, df as DISPUTE_PROTECTION_POLICY_ABI, dE as DelegationDepositTarget, dC as DelegationRoute, dD as DelegationState, dq as Deposit, ds as DepositCurrency, bY as DepositIntentStatistics, aU as DepositStatus, aS as DepositVerifier, aT as DepositVerifierCurrency, bV as DepositVerifierData, dp as DepositView, aa as DisputeAttestationConfig, ct as DisputeProtectionIntentPage, cu as DisputeProtectionIntentPageParams, ab as DisputeProtectionReadinessOptions, ac as DisputeProtectionReadinessResult, aN as FiatResponse, by as FulfillIntentAttestationResponse, a2 as FulfillIntentMethodParams, au as FulfillIntentParams, ay as GetBestByPlatformResponse, az as GetBestByPlatformResponseObject, aV as GetDepositByIdRequest, aW as GetDepositByIdResponse, b1 as GetIntentByHashRequest, b2 as GetIntentByHashResponse, a$ as GetIntentsByDepositRequest, b0 as GetIntentsByDepositResponse, aD as GetNearbyQuote, aE as GetNearbySuggestions, aZ as GetOwnerIntentsRequest, a_ as GetOwnerIntentsResponse, aA as GetPlatformQuote, aF as GetQuoteResponse, aG as GetQuoteResponseObject, aH as GetQuoteSingleResponse, bJ as GetSellerCredentialStatusParams, bO as IdentityAttestationActionType, bP as IdentityAttestationOutput, bQ as IdentityAttestationOutputFor, bR as IdentityAttestationParams, cv as IndexedDisputeProtectionIntent, cw as IndexedPage, cx as IndexedPageAsOf, cy as IndexedRiskWindow, cz as IndexedStakeActivity, cA as IndexedStakeLock, cB as IndexedStakingRowFreshness, cC as IndexedStakingState, cD as IndexedStakingStateParams, cE as IndexedTakerAuthorization, cF as IndexedTakerStakeAuthorization, c2 as IndexerClient, cT as IndexerDeploymentEnv, ca as IndexerDeposit, cr as IndexerDepositDailySnapshot, cK as IndexerDepositFilter, cq as IndexerDepositFundActivity, cs as IndexerDepositFundActivityType, cN as IndexerDepositOrderDirection, cM as IndexerDepositOrderField, cL as IndexerDepositPagination, cd as IndexerDepositPaymentMethod, c4 as IndexerDepositService, cW as IndexerFulfillmentAndPaymentResponse, cU as IndexerFulfillmentRecord, cb as IndexerIntentFulfilled, cc as IndexerIntentFulfillmentAmounts, cf as IndexerIntentStatus, cj as IndexerManagerAggregateStats, cl as IndexerManagerDailySnapshot, ck as IndexerManagerStats, co as IndexerManualRateUpdate, ce as IndexerMethodCurrency, cp as IndexerOracleConfigUpdate, cV as IndexerPaymentVerifiedRecord, cg as IndexerRateManager, ci as IndexerRateManagerDelegation, cQ as IndexerRateManagerDelegationPagination, cn as IndexerRateManagerDetail, cO as IndexerRateManagerFilter, cm as IndexerRateManagerListItem, cS as IndexerRateManagerOrderDirection, cR as IndexerRateManagerOrderField, cP as IndexerRateManagerPagination, ch as IndexerRateManagerRate, c5 as IndexerRateManagerService, c8 as IndexerStakingService, aX as Intent, ai as IntentGuardianErrorCode, ae as IntentGuardianPolicy, af as IntentGuardianQuote, ag as IntentGuardianWriteFunction, ah as IntentGuardianWriteParams, du as IntentView, bS as MakerIdentityAttestationRequestBody, bT as MakerIdentityPlatform, aP as NearbyQuote, aQ as NearbySuggestions, de as ORCHESTRATOR_V3_ABI, Z as OfframpClient, bU as OnchainCurrency, dv as OnchainIntent, bX as OrderStats, c0 as OrderbookEntry, c1 as OrderbookTableRow, cX as PAYMENT_PLATFORMS, be as PayPalGoogleOAuthSellerCredentialUploadBody, dr as PaymentMethodData, cY as PaymentPlatformType, aB as PlatformQuote, bW as PreparedTransaction, aM as QuoteFeesResponse, aL as QuoteIntentResponse, aJ as QuoteMakerIdentity, aC as QuotePreference, aI as QuoteResponseObject, aK as QuoteSingleResponse, ar as Range, ad as ReadDisputeAttestationConfigParams, $ as RedeemReferralCodeSignatureOptions, X as ReferralBearerWriteOptions, dt as ReferralFee, Y as ReferralReadOptions, an as ReferralRedemption, ao as ReferralSignatureBody, _ as ReferralSignatureOptions, b3 as RegisterPayeeDetailsRequest, b4 as RegisterPayeeDetailsResponse, bF as RegisteredSellerCredentialPlatform, bH as RegisteredUploadSellerCredentialParams, av as ReleaseFundsToPayerParams, dh as RuntimeEnv, dg as STAKE_VAULT_ABI, bw as SellerAttestationOutput, bk as SellerCiphertextBundle, bp as SellerCredentialBundleUpload, bx as SellerCredentialProbeResponse, br as SellerCredentialStatus, bq as SellerCredentialStatusValue, bj as SellerCredentialUploadInputByPlatform, bv as SellerPaymentTypedDataValue, b5 as SellerPlatform, bo as SellerProbeInput, bl as SellerSignedCiphertextBundle, bt as SellerTypedDataField, bu as SellerTypedDataSpec, bn as SellerVerifyInput, bm as SellerVerifyIntentDetails, bs as SellerVerifyProxyBody, dH as SendBatchFn, dG as SendTransactionFn, a1 as SignalIntentMethodParams, at as SignalIntentParams, a0 as SignalIntentReferralFee, cG as StakeActivityPageParams, b_ as StakeEnvironment, cH as StakeLockPageParams, a6 as StakeVaultState, a7 as StakeVaultWriteFunction, a8 as StakeVaultWriteParams, cI as StakingEntityIds, cJ as TakerStakeAuthorizationPageParams, b$ as TakerStakeBalances, al as TimeoutConfig, aO as TokenResponse, a4 as UpdateReferralCodeSignatureOptions, bM as UploadGoogleOAuthSellerCredentialParams, bK as UploadPayPalGoogleOAuthSellerCredentialParams, bI as UploadSellerCredentialOptions, bG as UploadSellerCredentialParams, bL as UploadVenmoGoogleOAuthSellerCredentialParams, bZ as UsdcAmount, dj as V2ContractAbis, di as V2ContractAddresses, bg as VenmoCredentialUploadInput, bf as VenmoGoogleOAuthSellerCredentialUploadBody, b8 as VenmoSessionMaterial, bN as VerifySellerPaymentParams, bi as WiseCredentialUploadInput, bb as WiseProfileInfo, bd as WiseProfileNotFound, bc as WiseProfileSelectionRequired, ba as WiseSessionMaterial, as as WithdrawDepositParams, dw as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, a5 as Zkp2pClientOptions, c7 as buildStakingEntityIds, dB as classifyDelegationState, aj as classifyIntentGuardianError, c6 as compareEventCursorIdsByRecency, c_ as currencyInfo, c3 as defaultIndexerEndpoint, dm as enrichPvDepositView, dn as enrichPvIntentView, c9 as fetchIndexerFulfillmentAndPayment, d5 as getContracts, d1 as getCurrencyCodeFromHash, d0 as getCurrencyInfoFromCountryCode, c$ as getCurrencyInfoFromHash, dA as getDelegationRoute, db as getDisputeProtectionPolicyContract, dd as getGatingServiceAddress, d6 as getIntentGuardianContract, da as getOrchestratorV3Contract, dc as getPaymentMethodsCatalog, d8 as getRateManagerContracts, d9 as getStakeVaultContract, d7 as hasIntentGuardian, d2 as isSupportedCurrencyHash, dx as isZeroRateManagerId, d3 as mapConversionRatesToOnchainMinRate, dy as normalizeRateManagerId, dz as normalizeRegistry, dk as parseDepositView, dl as parseIntentView, a9 as readDisputeAttestationConfig } from './vaultUtils-D3J7IDTF.mjs';
|
|
3
3
|
import { Address, Hash, Hex, WalletClient } from 'viem';
|
|
4
4
|
import { Abi } from 'abitype';
|
|
5
5
|
export { DisputeActionTypeByPlatform, DisputeAttestationOutput, DisputeAttestationOutputFor, DisputeDetails, DisputePlatform, IdentityActionType, IdentityActionTypeByPlatform, IdentityParamsByPlatform, IdentityPlatform, NitroAttestationClient, NitroAttestationClientOptions, NitroAttestationEnvironment, VerifiedAttestation, VerifiedAttestationPayload, createNitroAttestationClient, verifyDisputeAttestation } from '@zkp2p/zkp2p-attestation';
|
|
@@ -298,6 +298,8 @@ declare function apiCreateSellerCredentialBundle(payload: SellerCredentialUpload
|
|
|
298
298
|
* Store an already-encrypted seller credential bundle with curator.
|
|
299
299
|
*/
|
|
300
300
|
declare function apiUploadSellerCredentialBundle(params: UploadSellerCredentialBundleParams, baseApiUrl?: string | null, timeoutMs?: number, authorizationToken?: string): Promise<CuratorSellerCredentialUploadResponse>;
|
|
301
|
+
/** Read the identity derived by the attestor from Amazon's current receiving QR. */
|
|
302
|
+
declare function getAmazonPaySellerIdentity(bundle: SellerCredentialBundle): string;
|
|
301
303
|
|
|
302
304
|
declare function apiPostDepositDetails(req: PostDepositDetailsRequest, baseApiUrl: string, timeoutMs?: number): Promise<PostDepositDetailsResponse>;
|
|
303
305
|
declare function apiGetQuote(req: QuoteRequest, opts: ApiAdapterOptions): Promise<QuoteResponse>;
|
|
@@ -313,9 +315,10 @@ declare function apiLookupReferralCode(code: string, opts: ApiAdapterOptions): P
|
|
|
313
315
|
declare function apiCreateReferralCode(req: CreateReferralCodeRequest, opts: ApiAdapterOptions): Promise<CreateReferralCodeResponse>;
|
|
314
316
|
declare function apiRedeemReferralCode(req: RedeemReferralCodeRequest, opts: ApiAdapterOptions): Promise<RedeemReferralCodeResponse>;
|
|
315
317
|
declare function apiUpdateReferralCode(req: UpdateReferralCodeRequest, opts: ApiAdapterOptions): Promise<UpdateReferralCodeResponse>;
|
|
316
|
-
declare function apiUploadGoogleOAuthSellerCredential(processorName:
|
|
318
|
+
declare function apiUploadGoogleOAuthSellerCredential<P extends GoogleOAuthSellerCredentialPlatform>(processorName: P, payeeDetails: Hash, body: GoogleOAuthSellerCredentialUploadBodyByPlatform[P], baseApiUrl: string, opts?: {
|
|
317
319
|
timeoutMs?: number;
|
|
318
320
|
authorizationToken?: string;
|
|
321
|
+
signal?: AbortSignal;
|
|
319
322
|
}): Promise<CuratorSellerCredentialUploadResponse>;
|
|
320
323
|
declare function apiGetOrderbook(params: GetOrderbookParams, opts: ApiAdapterOptions): Promise<GetOrderbookResponse>;
|
|
321
324
|
declare function apiGetOrderbook(params: GetOrderbookParams, baseApiUrl: string, timeoutMs?: number): Promise<GetOrderbookResponse>;
|
|
@@ -949,4 +952,4 @@ declare class ContractError extends ZKP2PError {
|
|
|
949
952
|
constructor(message: string, details?: unknown);
|
|
950
953
|
}
|
|
951
954
|
|
|
952
|
-
export { APIError, ApiAdapterOptions, AttestationServiceIdentityResponse, AttestationServiceSellerCredentialUploadResponse, AttestationServiceSellerVerifyResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, BuyerTeeVerifyPaymentBody, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ContractError, ContractRouter, type ContractRouterConfig, CreateReferralCodeRequest, CreateReferralCodeResponse, CuratorSellerCredentialUploadResponse, CurrencyType, DEFAULT_ORACLE_MAX_STALENESS_SECONDS, ErrorCode, type EscrowContractContext, type EscrowDepositView, type EscrowIntentView, GetDepositBundleParams, GetDepositBundleResponse, GetOrderbookParams, GetOrderbookResponse, GetOrderbookTableResponse, GetOwnerDepositsRequest, GetOwnerDepositsResponse, GetPayeeDetailsRequest, GetPayeeDetailsResponse, GoogleOAuthSellerCredentialPlatform, GoogleOAuthSellerCredentialUploadBodyByPlatform, IdentityAttestationRequestBody, DepositWithRelations as IndexerDepositWithRelations, IntentEntity as IndexerIntent, type IntegerLike, type LogLevel, type MulticallClient, NetworkError, type OracleAdapterOverrides, type OracleKind, type OrchestratorContractContext, PEER_EXTENSION_CHROME_URL, PLATFORM_METADATA, PYTH_CONTRACT_BASE, PYTH_ORACLE_ADAPTER, PYTH_ORACLE_FEEDS, PaymentMethodCatalog, type PeerAuthenticateParams, type PeerBuyerTeePaymentCapture, type PeerBuyerTeePaymentParams, type PeerConnectionStatus, type PeerExtensionApi, type PeerExtensionSdk, type PeerExtensionSdkOptions, type PeerExtensionState, type PeerExtensionWindow, type PeerMetadataCaptureMode, type PeerMetadataMessage, type PeerMetadataMessageCallback, type PeerMetadataRow, type PeerSarCredentialCapture, PostDepositDetailsRequest, PostDepositDetailsResponse, type PythFeedConfig, QuoteRequest, QuoteResponse, QuotesBestByPlatformRequest, REFERRAL_SIGNATURE_DOMAIN, REFERRAL_SIGNATURE_TYPES, RISK_BPS_DENOMINATOR, RedeemReferralCodeRequest, RedeemReferralCodeResponse, ReferralCodeLookupResponse, ReferralDashboardResponse, ReferralEarningsResponse, ReferralReadRequest, ReferrerFeeConfig, type RiskMode, SDK_BUILD_METADATA, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, type SdkBuildMetadata, SellerCredentialAttestationRuntime, SellerCredentialBundle, SellerCredentialUploadInput, SellerCredentialUploadPlatform, type SignIntentApiOptions, type SignIntentV3ReferralFee, type SignIntentV3Request, type SignIntentV3ResponseObject, type SignIntentV3Result, type SpreadOracleConfig, type SpreadOracleFeedConfig, type SupportedChainId, TOKEN_METADATA, TxOverrides, UpdateReferralCodeRequest, UpdateReferralCodeResponse, UploadSellerCredentialBundleParams, ValidatePayeeDetailsRequest, ValidatePayeeDetailsResponse, ValidationError, ZKP2PError, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, apiCreateReferralCode, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOrderbookTable, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuote, apiGetQuotesBestByPlatform, apiGetReferralDashboard, apiGetReferralEarnings, apiLookupReferralCode, apiPostDepositDetails, apiRedeemReferralCode, apiRequestIdentityAttestation, apiSignIntentV3, apiSignIntentV3Raw, apiUpdateReferralCode, apiUploadGoogleOAuthSellerCredential, apiUploadSellerCredentialBundle, apiValidatePayeeDetails, apiVerifyBuyerTeePayment, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, calculateRequiredCoverage, calculateStakeBackedCapacity, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, createPeerExtensionSdk, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, ensureBytes32, getAttributionDataSuffix, getPeerExtensionState, getSpreadOracleConfig, isPeerExtensionAvailable, isValidReferralCode, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, normalizeReferralCode, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, referrerFeeConfigToPreciseUnits, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash, selectRiskMode, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
|
|
955
|
+
export { APIError, ApiAdapterOptions, AttestationServiceIdentityResponse, AttestationServiceSellerCredentialUploadResponse, AttestationServiceSellerVerifyResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, BuyerTeeVerifyPaymentBody, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ContractError, ContractRouter, type ContractRouterConfig, CreateReferralCodeRequest, CreateReferralCodeResponse, CuratorSellerCredentialUploadResponse, CurrencyType, DEFAULT_ORACLE_MAX_STALENESS_SECONDS, ErrorCode, type EscrowContractContext, type EscrowDepositView, type EscrowIntentView, GetDepositBundleParams, GetDepositBundleResponse, GetOrderbookParams, GetOrderbookResponse, GetOrderbookTableResponse, GetOwnerDepositsRequest, GetOwnerDepositsResponse, GetPayeeDetailsRequest, GetPayeeDetailsResponse, GoogleOAuthSellerCredentialPlatform, GoogleOAuthSellerCredentialUploadBodyByPlatform, IdentityAttestationRequestBody, DepositWithRelations as IndexerDepositWithRelations, IntentEntity as IndexerIntent, type IntegerLike, type LogLevel, type MulticallClient, NetworkError, type OracleAdapterOverrides, type OracleKind, type OrchestratorContractContext, PEER_EXTENSION_CHROME_URL, PLATFORM_METADATA, PYTH_CONTRACT_BASE, PYTH_ORACLE_ADAPTER, PYTH_ORACLE_FEEDS, PaymentMethodCatalog, type PeerAuthenticateParams, type PeerBuyerTeePaymentCapture, type PeerBuyerTeePaymentParams, type PeerConnectionStatus, type PeerExtensionApi, type PeerExtensionSdk, type PeerExtensionSdkOptions, type PeerExtensionState, type PeerExtensionWindow, type PeerMetadataCaptureMode, type PeerMetadataMessage, type PeerMetadataMessageCallback, type PeerMetadataRow, type PeerSarCredentialCapture, PostDepositDetailsRequest, PostDepositDetailsResponse, type PythFeedConfig, QuoteRequest, QuoteResponse, QuotesBestByPlatformRequest, REFERRAL_SIGNATURE_DOMAIN, REFERRAL_SIGNATURE_TYPES, RISK_BPS_DENOMINATOR, RedeemReferralCodeRequest, RedeemReferralCodeResponse, ReferralCodeLookupResponse, ReferralDashboardResponse, ReferralEarningsResponse, ReferralReadRequest, ReferrerFeeConfig, type RiskMode, SDK_BUILD_METADATA, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, type SdkBuildMetadata, SellerCredentialAttestationRuntime, SellerCredentialBundle, SellerCredentialUploadInput, SellerCredentialUploadPlatform, type SignIntentApiOptions, type SignIntentV3ReferralFee, type SignIntentV3Request, type SignIntentV3ResponseObject, type SignIntentV3Result, type SpreadOracleConfig, type SpreadOracleFeedConfig, type SupportedChainId, TOKEN_METADATA, TxOverrides, UpdateReferralCodeRequest, UpdateReferralCodeResponse, UploadSellerCredentialBundleParams, ValidatePayeeDetailsRequest, ValidatePayeeDetailsResponse, ValidationError, ZKP2PError, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, apiCreateReferralCode, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOrderbookTable, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuote, apiGetQuotesBestByPlatform, apiGetReferralDashboard, apiGetReferralEarnings, apiLookupReferralCode, apiPostDepositDetails, apiRedeemReferralCode, apiRequestIdentityAttestation, apiSignIntentV3, apiSignIntentV3Raw, apiUpdateReferralCode, apiUploadGoogleOAuthSellerCredential, apiUploadSellerCredentialBundle, apiValidatePayeeDetails, apiVerifyBuyerTeePayment, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, calculateRequiredCoverage, calculateStakeBackedCapacity, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, createPeerExtensionSdk, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, ensureBytes32, getAmazonPaySellerIdentity, getAttributionDataSuffix, getPeerExtensionState, getSpreadOracleConfig, isPeerExtensionAvailable, isValidReferralCode, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, normalizeReferralCode, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, referrerFeeConfigToPreciseUnits, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash, selectRiskMode, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as ReferrerFeeConfig, S as SellerCredentialBundle, D as DepositWithRelations, I as IntentEntity, a as IdentityAttestationRequestBody, A as AttestationServiceIdentityResponse, B as BuyerTeeVerifyPaymentBody, b as AttestationServiceSellerVerifyResponse, c as SellerCredentialUploadInput, d as SellerCredentialUploadPlatform, e as SellerCredentialAttestationRuntime, f as AttestationServiceSellerCredentialUploadResponse, g as BuyerTeeSessionMaterialEncryptionInput, U as UploadSellerCredentialBundleParams, C as CuratorSellerCredentialUploadResponse, h as CreateReferralCodeRequest, i as ApiAdapterOptions, j as CreateReferralCodeResponse, k as ReferralReadRequest, l as ReferralDashboardResponse, m as ReferralEarningsResponse, n as ReferralCodeLookupResponse, o as RedeemReferralCodeRequest, p as RedeemReferralCodeResponse, q as UpdateReferralCodeRequest, r as UpdateReferralCodeResponse, G as GoogleOAuthSellerCredentialPlatform, s as GoogleOAuthSellerCredentialUploadBodyByPlatform, Q as QuotesBestByPlatformRequest, t as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, u as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, v as PostDepositDetailsResponse, w as GetPayeeDetailsRequest, x as GetPayeeDetailsResponse, y as GetOwnerDepositsRequest, z as GetOwnerDepositsResponse, E as GetDepositBundleParams, F as GetDepositBundleResponse, H as GetOrderbookParams, J as GetOrderbookResponse, K as GetOrderbookTableResponse, L as QuoteRequest, M as QuoteResponse, N as CuratorMetadata, O as CurrencyType, T as PaymentMethodCatalog, W as TxOverrides } from './vaultUtils-
|
|
2
|
-
export {
|
|
1
|
+
import { R as ReferrerFeeConfig, S as SellerCredentialBundle, D as DepositWithRelations, I as IntentEntity, a as IdentityAttestationRequestBody, A as AttestationServiceIdentityResponse, B as BuyerTeeVerifyPaymentBody, b as AttestationServiceSellerVerifyResponse, c as SellerCredentialUploadInput, d as SellerCredentialUploadPlatform, e as SellerCredentialAttestationRuntime, f as AttestationServiceSellerCredentialUploadResponse, g as BuyerTeeSessionMaterialEncryptionInput, U as UploadSellerCredentialBundleParams, C as CuratorSellerCredentialUploadResponse, h as CreateReferralCodeRequest, i as ApiAdapterOptions, j as CreateReferralCodeResponse, k as ReferralReadRequest, l as ReferralDashboardResponse, m as ReferralEarningsResponse, n as ReferralCodeLookupResponse, o as RedeemReferralCodeRequest, p as RedeemReferralCodeResponse, q as UpdateReferralCodeRequest, r as UpdateReferralCodeResponse, G as GoogleOAuthSellerCredentialPlatform, s as GoogleOAuthSellerCredentialUploadBodyByPlatform, Q as QuotesBestByPlatformRequest, t as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, u as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, v as PostDepositDetailsResponse, w as GetPayeeDetailsRequest, x as GetPayeeDetailsResponse, y as GetOwnerDepositsRequest, z as GetOwnerDepositsResponse, E as GetDepositBundleParams, F as GetDepositBundleResponse, H as GetOrderbookParams, J as GetOrderbookResponse, K as GetOrderbookTableResponse, L as QuoteRequest, M as QuoteResponse, N as CuratorMetadata, O as CurrencyType, T as PaymentMethodCatalog, W as TxOverrides } from './vaultUtils-D3J7IDTF.js';
|
|
2
|
+
export { dI as AccessPolicyOperations, dJ as AccessPolicyUnsupportedError, am as ActionCallback, b6 as AmazonPayCredentialUploadInput, b7 as AmazonPayIdentityAttestationOutput, aR as ApiDeposit, aY as ApiIntentStatus, bz as AttestationServiceSellerCredentialProbeResponse, ak as AuthorizationTokenProvider, dF as BatchResult, ax as BestByPlatformResponseObject, bA as BuyerTeePaymentParams, bB as BuyerTeePaymentProofInput, bC as BuyerTeeSessionMaterial, a3 as CancelIntentMethodParams, aw as CancelIntentParams, bh as CashAppCredentialUploadInput, b9 as CashAppSessionMaterial, aq as CreateDepositConversionRate, ap as CreateDepositParams, bD as CuratorSellerCredentialStatusResponse, bE as CuratorSellerVerifyResponse, cZ as Currency, d4 as CurrencyData, df as DISPUTE_PROTECTION_POLICY_ABI, dE as DelegationDepositTarget, dC as DelegationRoute, dD as DelegationState, dq as Deposit, ds as DepositCurrency, bY as DepositIntentStatistics, aU as DepositStatus, aS as DepositVerifier, aT as DepositVerifierCurrency, bV as DepositVerifierData, dp as DepositView, aa as DisputeAttestationConfig, ct as DisputeProtectionIntentPage, cu as DisputeProtectionIntentPageParams, ab as DisputeProtectionReadinessOptions, ac as DisputeProtectionReadinessResult, aN as FiatResponse, by as FulfillIntentAttestationResponse, a2 as FulfillIntentMethodParams, au as FulfillIntentParams, ay as GetBestByPlatformResponse, az as GetBestByPlatformResponseObject, aV as GetDepositByIdRequest, aW as GetDepositByIdResponse, b1 as GetIntentByHashRequest, b2 as GetIntentByHashResponse, a$ as GetIntentsByDepositRequest, b0 as GetIntentsByDepositResponse, aD as GetNearbyQuote, aE as GetNearbySuggestions, aZ as GetOwnerIntentsRequest, a_ as GetOwnerIntentsResponse, aA as GetPlatformQuote, aF as GetQuoteResponse, aG as GetQuoteResponseObject, aH as GetQuoteSingleResponse, bJ as GetSellerCredentialStatusParams, bO as IdentityAttestationActionType, bP as IdentityAttestationOutput, bQ as IdentityAttestationOutputFor, bR as IdentityAttestationParams, cv as IndexedDisputeProtectionIntent, cw as IndexedPage, cx as IndexedPageAsOf, cy as IndexedRiskWindow, cz as IndexedStakeActivity, cA as IndexedStakeLock, cB as IndexedStakingRowFreshness, cC as IndexedStakingState, cD as IndexedStakingStateParams, cE as IndexedTakerAuthorization, cF as IndexedTakerStakeAuthorization, c2 as IndexerClient, cT as IndexerDeploymentEnv, ca as IndexerDeposit, cr as IndexerDepositDailySnapshot, cK as IndexerDepositFilter, cq as IndexerDepositFundActivity, cs as IndexerDepositFundActivityType, cN as IndexerDepositOrderDirection, cM as IndexerDepositOrderField, cL as IndexerDepositPagination, cd as IndexerDepositPaymentMethod, c4 as IndexerDepositService, cW as IndexerFulfillmentAndPaymentResponse, cU as IndexerFulfillmentRecord, cb as IndexerIntentFulfilled, cc as IndexerIntentFulfillmentAmounts, cf as IndexerIntentStatus, cj as IndexerManagerAggregateStats, cl as IndexerManagerDailySnapshot, ck as IndexerManagerStats, co as IndexerManualRateUpdate, ce as IndexerMethodCurrency, cp as IndexerOracleConfigUpdate, cV as IndexerPaymentVerifiedRecord, cg as IndexerRateManager, ci as IndexerRateManagerDelegation, cQ as IndexerRateManagerDelegationPagination, cn as IndexerRateManagerDetail, cO as IndexerRateManagerFilter, cm as IndexerRateManagerListItem, cS as IndexerRateManagerOrderDirection, cR as IndexerRateManagerOrderField, cP as IndexerRateManagerPagination, ch as IndexerRateManagerRate, c5 as IndexerRateManagerService, c8 as IndexerStakingService, aX as Intent, ai as IntentGuardianErrorCode, ae as IntentGuardianPolicy, af as IntentGuardianQuote, ag as IntentGuardianWriteFunction, ah as IntentGuardianWriteParams, du as IntentView, bS as MakerIdentityAttestationRequestBody, bT as MakerIdentityPlatform, aP as NearbyQuote, aQ as NearbySuggestions, de as ORCHESTRATOR_V3_ABI, Z as OfframpClient, bU as OnchainCurrency, dv as OnchainIntent, bX as OrderStats, c0 as OrderbookEntry, c1 as OrderbookTableRow, cX as PAYMENT_PLATFORMS, be as PayPalGoogleOAuthSellerCredentialUploadBody, dr as PaymentMethodData, cY as PaymentPlatformType, aB as PlatformQuote, bW as PreparedTransaction, aM as QuoteFeesResponse, aL as QuoteIntentResponse, aJ as QuoteMakerIdentity, aC as QuotePreference, aI as QuoteResponseObject, aK as QuoteSingleResponse, ar as Range, ad as ReadDisputeAttestationConfigParams, $ as RedeemReferralCodeSignatureOptions, X as ReferralBearerWriteOptions, dt as ReferralFee, Y as ReferralReadOptions, an as ReferralRedemption, ao as ReferralSignatureBody, _ as ReferralSignatureOptions, b3 as RegisterPayeeDetailsRequest, b4 as RegisterPayeeDetailsResponse, bF as RegisteredSellerCredentialPlatform, bH as RegisteredUploadSellerCredentialParams, av as ReleaseFundsToPayerParams, dh as RuntimeEnv, dg as STAKE_VAULT_ABI, bw as SellerAttestationOutput, bk as SellerCiphertextBundle, bp as SellerCredentialBundleUpload, bx as SellerCredentialProbeResponse, br as SellerCredentialStatus, bq as SellerCredentialStatusValue, bj as SellerCredentialUploadInputByPlatform, bv as SellerPaymentTypedDataValue, b5 as SellerPlatform, bo as SellerProbeInput, bl as SellerSignedCiphertextBundle, bt as SellerTypedDataField, bu as SellerTypedDataSpec, bn as SellerVerifyInput, bm as SellerVerifyIntentDetails, bs as SellerVerifyProxyBody, dH as SendBatchFn, dG as SendTransactionFn, a1 as SignalIntentMethodParams, at as SignalIntentParams, a0 as SignalIntentReferralFee, cG as StakeActivityPageParams, b_ as StakeEnvironment, cH as StakeLockPageParams, a6 as StakeVaultState, a7 as StakeVaultWriteFunction, a8 as StakeVaultWriteParams, cI as StakingEntityIds, cJ as TakerStakeAuthorizationPageParams, b$ as TakerStakeBalances, al as TimeoutConfig, aO as TokenResponse, a4 as UpdateReferralCodeSignatureOptions, bM as UploadGoogleOAuthSellerCredentialParams, bK as UploadPayPalGoogleOAuthSellerCredentialParams, bI as UploadSellerCredentialOptions, bG as UploadSellerCredentialParams, bL as UploadVenmoGoogleOAuthSellerCredentialParams, bZ as UsdcAmount, dj as V2ContractAbis, di as V2ContractAddresses, bg as VenmoCredentialUploadInput, bf as VenmoGoogleOAuthSellerCredentialUploadBody, b8 as VenmoSessionMaterial, bN as VerifySellerPaymentParams, bi as WiseCredentialUploadInput, bb as WiseProfileInfo, bd as WiseProfileNotFound, bc as WiseProfileSelectionRequired, ba as WiseSessionMaterial, as as WithdrawDepositParams, dw as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, a5 as Zkp2pClientOptions, c7 as buildStakingEntityIds, dB as classifyDelegationState, aj as classifyIntentGuardianError, c6 as compareEventCursorIdsByRecency, c_ as currencyInfo, c3 as defaultIndexerEndpoint, dm as enrichPvDepositView, dn as enrichPvIntentView, c9 as fetchIndexerFulfillmentAndPayment, d5 as getContracts, d1 as getCurrencyCodeFromHash, d0 as getCurrencyInfoFromCountryCode, c$ as getCurrencyInfoFromHash, dA as getDelegationRoute, db as getDisputeProtectionPolicyContract, dd as getGatingServiceAddress, d6 as getIntentGuardianContract, da as getOrchestratorV3Contract, dc as getPaymentMethodsCatalog, d8 as getRateManagerContracts, d9 as getStakeVaultContract, d7 as hasIntentGuardian, d2 as isSupportedCurrencyHash, dx as isZeroRateManagerId, d3 as mapConversionRatesToOnchainMinRate, dy as normalizeRateManagerId, dz as normalizeRegistry, dk as parseDepositView, dl as parseIntentView, a9 as readDisputeAttestationConfig } from './vaultUtils-D3J7IDTF.js';
|
|
3
3
|
import { Address, Hash, Hex, WalletClient } from 'viem';
|
|
4
4
|
import { Abi } from 'abitype';
|
|
5
5
|
export { DisputeActionTypeByPlatform, DisputeAttestationOutput, DisputeAttestationOutputFor, DisputeDetails, DisputePlatform, IdentityActionType, IdentityActionTypeByPlatform, IdentityParamsByPlatform, IdentityPlatform, NitroAttestationClient, NitroAttestationClientOptions, NitroAttestationEnvironment, VerifiedAttestation, VerifiedAttestationPayload, createNitroAttestationClient, verifyDisputeAttestation } from '@zkp2p/zkp2p-attestation';
|
|
@@ -298,6 +298,8 @@ declare function apiCreateSellerCredentialBundle(payload: SellerCredentialUpload
|
|
|
298
298
|
* Store an already-encrypted seller credential bundle with curator.
|
|
299
299
|
*/
|
|
300
300
|
declare function apiUploadSellerCredentialBundle(params: UploadSellerCredentialBundleParams, baseApiUrl?: string | null, timeoutMs?: number, authorizationToken?: string): Promise<CuratorSellerCredentialUploadResponse>;
|
|
301
|
+
/** Read the identity derived by the attestor from Amazon's current receiving QR. */
|
|
302
|
+
declare function getAmazonPaySellerIdentity(bundle: SellerCredentialBundle): string;
|
|
301
303
|
|
|
302
304
|
declare function apiPostDepositDetails(req: PostDepositDetailsRequest, baseApiUrl: string, timeoutMs?: number): Promise<PostDepositDetailsResponse>;
|
|
303
305
|
declare function apiGetQuote(req: QuoteRequest, opts: ApiAdapterOptions): Promise<QuoteResponse>;
|
|
@@ -313,9 +315,10 @@ declare function apiLookupReferralCode(code: string, opts: ApiAdapterOptions): P
|
|
|
313
315
|
declare function apiCreateReferralCode(req: CreateReferralCodeRequest, opts: ApiAdapterOptions): Promise<CreateReferralCodeResponse>;
|
|
314
316
|
declare function apiRedeemReferralCode(req: RedeemReferralCodeRequest, opts: ApiAdapterOptions): Promise<RedeemReferralCodeResponse>;
|
|
315
317
|
declare function apiUpdateReferralCode(req: UpdateReferralCodeRequest, opts: ApiAdapterOptions): Promise<UpdateReferralCodeResponse>;
|
|
316
|
-
declare function apiUploadGoogleOAuthSellerCredential(processorName:
|
|
318
|
+
declare function apiUploadGoogleOAuthSellerCredential<P extends GoogleOAuthSellerCredentialPlatform>(processorName: P, payeeDetails: Hash, body: GoogleOAuthSellerCredentialUploadBodyByPlatform[P], baseApiUrl: string, opts?: {
|
|
317
319
|
timeoutMs?: number;
|
|
318
320
|
authorizationToken?: string;
|
|
321
|
+
signal?: AbortSignal;
|
|
319
322
|
}): Promise<CuratorSellerCredentialUploadResponse>;
|
|
320
323
|
declare function apiGetOrderbook(params: GetOrderbookParams, opts: ApiAdapterOptions): Promise<GetOrderbookResponse>;
|
|
321
324
|
declare function apiGetOrderbook(params: GetOrderbookParams, baseApiUrl: string, timeoutMs?: number): Promise<GetOrderbookResponse>;
|
|
@@ -949,4 +952,4 @@ declare class ContractError extends ZKP2PError {
|
|
|
949
952
|
constructor(message: string, details?: unknown);
|
|
950
953
|
}
|
|
951
954
|
|
|
952
|
-
export { APIError, ApiAdapterOptions, AttestationServiceIdentityResponse, AttestationServiceSellerCredentialUploadResponse, AttestationServiceSellerVerifyResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, BuyerTeeVerifyPaymentBody, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ContractError, ContractRouter, type ContractRouterConfig, CreateReferralCodeRequest, CreateReferralCodeResponse, CuratorSellerCredentialUploadResponse, CurrencyType, DEFAULT_ORACLE_MAX_STALENESS_SECONDS, ErrorCode, type EscrowContractContext, type EscrowDepositView, type EscrowIntentView, GetDepositBundleParams, GetDepositBundleResponse, GetOrderbookParams, GetOrderbookResponse, GetOrderbookTableResponse, GetOwnerDepositsRequest, GetOwnerDepositsResponse, GetPayeeDetailsRequest, GetPayeeDetailsResponse, GoogleOAuthSellerCredentialPlatform, GoogleOAuthSellerCredentialUploadBodyByPlatform, IdentityAttestationRequestBody, DepositWithRelations as IndexerDepositWithRelations, IntentEntity as IndexerIntent, type IntegerLike, type LogLevel, type MulticallClient, NetworkError, type OracleAdapterOverrides, type OracleKind, type OrchestratorContractContext, PEER_EXTENSION_CHROME_URL, PLATFORM_METADATA, PYTH_CONTRACT_BASE, PYTH_ORACLE_ADAPTER, PYTH_ORACLE_FEEDS, PaymentMethodCatalog, type PeerAuthenticateParams, type PeerBuyerTeePaymentCapture, type PeerBuyerTeePaymentParams, type PeerConnectionStatus, type PeerExtensionApi, type PeerExtensionSdk, type PeerExtensionSdkOptions, type PeerExtensionState, type PeerExtensionWindow, type PeerMetadataCaptureMode, type PeerMetadataMessage, type PeerMetadataMessageCallback, type PeerMetadataRow, type PeerSarCredentialCapture, PostDepositDetailsRequest, PostDepositDetailsResponse, type PythFeedConfig, QuoteRequest, QuoteResponse, QuotesBestByPlatformRequest, REFERRAL_SIGNATURE_DOMAIN, REFERRAL_SIGNATURE_TYPES, RISK_BPS_DENOMINATOR, RedeemReferralCodeRequest, RedeemReferralCodeResponse, ReferralCodeLookupResponse, ReferralDashboardResponse, ReferralEarningsResponse, ReferralReadRequest, ReferrerFeeConfig, type RiskMode, SDK_BUILD_METADATA, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, type SdkBuildMetadata, SellerCredentialAttestationRuntime, SellerCredentialBundle, SellerCredentialUploadInput, SellerCredentialUploadPlatform, type SignIntentApiOptions, type SignIntentV3ReferralFee, type SignIntentV3Request, type SignIntentV3ResponseObject, type SignIntentV3Result, type SpreadOracleConfig, type SpreadOracleFeedConfig, type SupportedChainId, TOKEN_METADATA, TxOverrides, UpdateReferralCodeRequest, UpdateReferralCodeResponse, UploadSellerCredentialBundleParams, ValidatePayeeDetailsRequest, ValidatePayeeDetailsResponse, ValidationError, ZKP2PError, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, apiCreateReferralCode, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOrderbookTable, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuote, apiGetQuotesBestByPlatform, apiGetReferralDashboard, apiGetReferralEarnings, apiLookupReferralCode, apiPostDepositDetails, apiRedeemReferralCode, apiRequestIdentityAttestation, apiSignIntentV3, apiSignIntentV3Raw, apiUpdateReferralCode, apiUploadGoogleOAuthSellerCredential, apiUploadSellerCredentialBundle, apiValidatePayeeDetails, apiVerifyBuyerTeePayment, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, calculateRequiredCoverage, calculateStakeBackedCapacity, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, createPeerExtensionSdk, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, ensureBytes32, getAttributionDataSuffix, getPeerExtensionState, getSpreadOracleConfig, isPeerExtensionAvailable, isValidReferralCode, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, normalizeReferralCode, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, referrerFeeConfigToPreciseUnits, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash, selectRiskMode, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
|
|
955
|
+
export { APIError, ApiAdapterOptions, AttestationServiceIdentityResponse, AttestationServiceSellerCredentialUploadResponse, AttestationServiceSellerVerifyResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, BuyerTeeVerifyPaymentBody, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ContractError, ContractRouter, type ContractRouterConfig, CreateReferralCodeRequest, CreateReferralCodeResponse, CuratorSellerCredentialUploadResponse, CurrencyType, DEFAULT_ORACLE_MAX_STALENESS_SECONDS, ErrorCode, type EscrowContractContext, type EscrowDepositView, type EscrowIntentView, GetDepositBundleParams, GetDepositBundleResponse, GetOrderbookParams, GetOrderbookResponse, GetOrderbookTableResponse, GetOwnerDepositsRequest, GetOwnerDepositsResponse, GetPayeeDetailsRequest, GetPayeeDetailsResponse, GoogleOAuthSellerCredentialPlatform, GoogleOAuthSellerCredentialUploadBodyByPlatform, IdentityAttestationRequestBody, DepositWithRelations as IndexerDepositWithRelations, IntentEntity as IndexerIntent, type IntegerLike, type LogLevel, type MulticallClient, NetworkError, type OracleAdapterOverrides, type OracleKind, type OrchestratorContractContext, PEER_EXTENSION_CHROME_URL, PLATFORM_METADATA, PYTH_CONTRACT_BASE, PYTH_ORACLE_ADAPTER, PYTH_ORACLE_FEEDS, PaymentMethodCatalog, type PeerAuthenticateParams, type PeerBuyerTeePaymentCapture, type PeerBuyerTeePaymentParams, type PeerConnectionStatus, type PeerExtensionApi, type PeerExtensionSdk, type PeerExtensionSdkOptions, type PeerExtensionState, type PeerExtensionWindow, type PeerMetadataCaptureMode, type PeerMetadataMessage, type PeerMetadataMessageCallback, type PeerMetadataRow, type PeerSarCredentialCapture, PostDepositDetailsRequest, PostDepositDetailsResponse, type PythFeedConfig, QuoteRequest, QuoteResponse, QuotesBestByPlatformRequest, REFERRAL_SIGNATURE_DOMAIN, REFERRAL_SIGNATURE_TYPES, RISK_BPS_DENOMINATOR, RedeemReferralCodeRequest, RedeemReferralCodeResponse, ReferralCodeLookupResponse, ReferralDashboardResponse, ReferralEarningsResponse, ReferralReadRequest, ReferrerFeeConfig, type RiskMode, SDK_BUILD_METADATA, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, type SdkBuildMetadata, SellerCredentialAttestationRuntime, SellerCredentialBundle, SellerCredentialUploadInput, SellerCredentialUploadPlatform, type SignIntentApiOptions, type SignIntentV3ReferralFee, type SignIntentV3Request, type SignIntentV3ResponseObject, type SignIntentV3Result, type SpreadOracleConfig, type SpreadOracleFeedConfig, type SupportedChainId, TOKEN_METADATA, TxOverrides, UpdateReferralCodeRequest, UpdateReferralCodeResponse, UploadSellerCredentialBundleParams, ValidatePayeeDetailsRequest, ValidatePayeeDetailsResponse, ValidationError, ZKP2PError, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, apiCreateReferralCode, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOrderbookTable, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuote, apiGetQuotesBestByPlatform, apiGetReferralDashboard, apiGetReferralEarnings, apiLookupReferralCode, apiPostDepositDetails, apiRedeemReferralCode, apiRequestIdentityAttestation, apiSignIntentV3, apiSignIntentV3Raw, apiUpdateReferralCode, apiUploadGoogleOAuthSellerCredential, apiUploadSellerCredentialBundle, apiValidatePayeeDetails, apiVerifyBuyerTeePayment, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, calculateRequiredCoverage, calculateStakeBackedCapacity, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, createPeerExtensionSdk, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, ensureBytes32, getAmazonPaySellerIdentity, getAttributionDataSuffix, getPeerExtensionState, getSpreadOracleConfig, isPeerExtensionAvailable, isValidReferralCode, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, normalizeReferralCode, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, referrerFeeConfigToPreciseUnits, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash, selectRiskMode, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
|
package/dist/index.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import { IntentGuardianOperations } from './chunk-YA67SM3A.mjs';
|
|
|
2
2
|
export { ZERO_RATE_MANAGER_ID, classifyDelegationState, classifyIntentGuardianError, getDelegationRoute, isZeroRateManagerId, normalizeRateManagerId, normalizeRegistry } from './chunk-YA67SM3A.mjs';
|
|
3
3
|
import { NetworkError, ValidationError, APIError } from './chunk-3J4FPMPW.mjs';
|
|
4
4
|
export { APIError, ContractError, ErrorCode, NetworkError, ValidationError, ZKP2PError } from './chunk-3J4FPMPW.mjs';
|
|
5
|
-
import { OrchestratorRegistry_default, DISPUTE_PROTECTION_POLICY_ABI, DisputeProtectionPolicy_default, METHOD_NAME_TO_HASH, matchesQuotePaymentMethod, matchesPaymentMethodNameAndHash, MultiAttestationVerifier_default, getContracts, getRateManagerContracts, getPaymentMethodsCatalog, resolvePaymentMethodHashFromCatalog, getGatingServiceAddress, parseBigIntLike, SUPPORTED_PAYMENT_METHOD_HASHES, resolveFiatCurrencyBytes32, resolvePaymentMethodNameFromHash, OrchestratorV3_default, DisputeNullifierRegistry_default, DisputeVerifier_default, WhitelistPolicy_default, StakeVault_default, IntentLifecycleHookV1_default } from './chunk-
|
|
6
|
-
export { DISPUTE_PROTECTION_POLICY_ABI2 as DISPUTE_PROTECTION_POLICY_ABI, ORCHESTRATOR_V3_ABI, PAYMENT_PLATFORMS, STAKE_VAULT_ABI, asciiToBytes32, enrichPvDepositView, enrichPvIntentView, ensureBytes32, getContracts, getDisputeProtectionPolicyContract, getGatingServiceAddress, getIntentGuardianContract, getOrchestratorV3Contract, getPaymentMethodsCatalog, getRateManagerContracts, getStakeVaultContract, hasIntentGuardian, parseDepositView, parseIntentView, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash } from './chunk-
|
|
5
|
+
import { OrchestratorRegistry_default, DISPUTE_PROTECTION_POLICY_ABI, DisputeProtectionPolicy_default, METHOD_NAME_TO_HASH, matchesQuotePaymentMethod, matchesPaymentMethodNameAndHash, MultiAttestationVerifier_default, getContracts, getRateManagerContracts, getPaymentMethodsCatalog, resolvePaymentMethodHashFromCatalog, getGatingServiceAddress, parseBigIntLike, SUPPORTED_PAYMENT_METHOD_HASHES, resolveFiatCurrencyBytes32, resolvePaymentMethodNameFromHash, OrchestratorV3_default, DisputeNullifierRegistry_default, DisputeVerifier_default, WhitelistPolicy_default, StakeVault_default, IntentLifecycleHookV1_default } from './chunk-DPMEQLSY.mjs';
|
|
6
|
+
export { DISPUTE_PROTECTION_POLICY_ABI2 as DISPUTE_PROTECTION_POLICY_ABI, ORCHESTRATOR_V3_ABI, PAYMENT_PLATFORMS, STAKE_VAULT_ABI, asciiToBytes32, enrichPvDepositView, enrichPvIntentView, ensureBytes32, getContracts, getDisputeProtectionPolicyContract, getGatingServiceAddress, getIntentGuardianContract, getOrchestratorV3Contract, getPaymentMethodsCatalog, getRateManagerContracts, getStakeVaultContract, hasIntentGuardian, parseDepositView, parseIntentView, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash } from './chunk-DPMEQLSY.mjs';
|
|
7
7
|
import { Currency, currencyKeccak256 } from './chunk-ZB22BZLZ.mjs';
|
|
8
8
|
export { Currency, currencyInfo, getCurrencyCodeFromHash, getCurrencyInfoFromCountryCode, getCurrencyInfoFromHash, isSupportedCurrencyHash, mapConversionRatesToOnchainMinRate } from './chunk-ZB22BZLZ.mjs';
|
|
9
|
-
import { define_ZKP2P_SDK_BUILD_METADATA_default } from './chunk-
|
|
9
|
+
import { define_ZKP2P_SDK_BUILD_METADATA_default } from './chunk-EDYYWCCJ.mjs';
|
|
10
10
|
import { keccak256, concatHex, encodeFunctionData, encodeAbiParameters, createPublicClient, http, isAddress, zeroAddress, formatUnits } from 'viem';
|
|
11
11
|
import { hardhat, base } from 'viem/chains';
|
|
12
12
|
import { createEncryptedBuyerTeeSessionMaterial as createEncryptedBuyerTeeSessionMaterial$1, createEncryptedSellerCredentialUpload } from '@zkp2p/zkp2p-attestation';
|
|
@@ -357,7 +357,7 @@ async function withRetry(fn, maxRetries = 3, delayMs = 1e3, timeoutMs, shouldRet
|
|
|
357
357
|
for (let i = 0; i < maxRetries; i++) {
|
|
358
358
|
try {
|
|
359
359
|
if (timeoutMs) {
|
|
360
|
-
const { withTimeout } = await import('./timeout-
|
|
360
|
+
const { withTimeout } = await import('./timeout-QRO3IS4N.mjs');
|
|
361
361
|
return await withTimeout(fn(), timeoutMs, `Operation timed out after ${timeoutMs}ms`);
|
|
362
362
|
}
|
|
363
363
|
return await fn();
|
|
@@ -557,6 +557,24 @@ async function createEncryptedSellerCredentialUploadForPlatform({
|
|
|
557
557
|
timeoutMs
|
|
558
558
|
}) {
|
|
559
559
|
try {
|
|
560
|
+
if (platform === "upi") {
|
|
561
|
+
const material = payload.sessionMaterial;
|
|
562
|
+
if (!payload.callerAddress || !("userAgent" in material) || !("sessionCookie" in material) || "payeeId" in payload) {
|
|
563
|
+
throw new Error(
|
|
564
|
+
"Amazon Pay requires callerAddress, sessionCookie and userAgent without a claimed payeeId"
|
|
565
|
+
);
|
|
566
|
+
}
|
|
567
|
+
return await createEncryptedSellerCredentialUpload({
|
|
568
|
+
attestationServiceUrl,
|
|
569
|
+
platform: "upi",
|
|
570
|
+
callerAddress: payload.callerAddress,
|
|
571
|
+
sessionMaterial: { sessionCookie: material.sessionCookie, userAgent: material.userAgent },
|
|
572
|
+
...typeof timeoutMs === "number" ? { timeoutMs } : {},
|
|
573
|
+
fetch: attestationTransport.fetch,
|
|
574
|
+
...cryptoRuntime?.subtle ? { subtle: cryptoRuntime.subtle } : {},
|
|
575
|
+
...cryptoRuntime?.getRandomValues ? { getRandomValues: cryptoRuntime.getRandomValues } : {}
|
|
576
|
+
});
|
|
577
|
+
}
|
|
560
578
|
if (platform === "wise") {
|
|
561
579
|
if (!isWiseCredentialUploadInput(payload)) {
|
|
562
580
|
throw new Error("apiToken is required for wise seller credential uploads");
|
|
@@ -863,7 +881,7 @@ async function sendTransactionWithAttribution(walletClient, request, referrer, o
|
|
|
863
881
|
// src/utils/constants.ts
|
|
864
882
|
var DEFAULT_BASE_API_URL = "https://api.zkp2p.xyz";
|
|
865
883
|
|
|
866
|
-
// ../../node_modules/.pnpm/@zkp2p+contracts-v2@0.4.
|
|
884
|
+
// ../../node_modules/.pnpm/@zkp2p+contracts-v2@0.4.2-rc.2_ethers@6.16.0_bufferutil@4.1.0_utf-8-validate@5.0.10__typescript@5.9.3_zod@4.5.4/node_modules/@zkp2p/contracts-v2/oracleFeeds/chainlink.json
|
|
867
885
|
var chainlink_default = {
|
|
868
886
|
feeds: [
|
|
869
887
|
{
|
|
@@ -1909,7 +1927,7 @@ var ProtocolViewerReader = class {
|
|
|
1909
1927
|
if (inputCount === null) {
|
|
1910
1928
|
throw new Error("Configured ProtocolViewer ABI does not expose getDeposit");
|
|
1911
1929
|
}
|
|
1912
|
-
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-
|
|
1930
|
+
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-4BJOG6JG.mjs');
|
|
1913
1931
|
if (inputCount >= 3) {
|
|
1914
1932
|
return tryContexts(
|
|
1915
1933
|
protocolViewerContexts,
|
|
@@ -1995,7 +2013,7 @@ var ProtocolViewerReader = class {
|
|
|
1995
2013
|
return Promise.all(ids.map((id) => this.config.host.getPvDepositById(id)));
|
|
1996
2014
|
}
|
|
1997
2015
|
const bn = ids.map((id) => typeof id === "bigint" ? id : parseRawDepositId(id));
|
|
1998
|
-
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-
|
|
2016
|
+
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-4BJOG6JG.mjs');
|
|
1999
2017
|
if (inputCount >= 2) {
|
|
2000
2018
|
const requests = ids.map((id, index) => ({
|
|
2001
2019
|
index,
|
|
@@ -2100,7 +2118,7 @@ var ProtocolViewerReader = class {
|
|
|
2100
2118
|
if (!protocolViewerAddress || !protocolViewerAbi || inputCount === null) {
|
|
2101
2119
|
return this.config.host.getPvAccountDepositsFromIndexer(owner);
|
|
2102
2120
|
}
|
|
2103
|
-
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-
|
|
2121
|
+
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-4BJOG6JG.mjs');
|
|
2104
2122
|
const { address, abi } = this.config.host.requireProtocolViewer();
|
|
2105
2123
|
if (inputCount >= 2) {
|
|
2106
2124
|
const readAndFilter = async (raw2) => {
|
|
@@ -2171,7 +2189,7 @@ var ProtocolViewerReader = class {
|
|
|
2171
2189
|
if (protocolViewerEntries.length === 0) {
|
|
2172
2190
|
throw new Error("ProtocolViewer not available for this network");
|
|
2173
2191
|
}
|
|
2174
|
-
const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-
|
|
2192
|
+
const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-4BJOG6JG.mjs');
|
|
2175
2193
|
const intentsByHash = /* @__PURE__ */ new Map();
|
|
2176
2194
|
let attemptedRead = false;
|
|
2177
2195
|
let hadSuccessfulRead = false;
|
|
@@ -2279,7 +2297,7 @@ var ProtocolViewerReader = class {
|
|
|
2279
2297
|
if (protocolViewerEntries.length === 0) {
|
|
2280
2298
|
throw new Error("ProtocolViewer not available for this network");
|
|
2281
2299
|
}
|
|
2282
|
-
const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-
|
|
2300
|
+
const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-4BJOG6JG.mjs');
|
|
2283
2301
|
let lastError;
|
|
2284
2302
|
for (const pvEntry of protocolViewerEntries) {
|
|
2285
2303
|
const inputCount = this.pvEntryFunctionInputCount(pvEntry, "getIntent");
|
|
@@ -3679,12 +3697,12 @@ var STAKE_LOCKS_QUERY = (
|
|
|
3679
3697
|
var STAKE_ACTIVITY_QUERY = (
|
|
3680
3698
|
/* GraphQL */
|
|
3681
3699
|
`
|
|
3682
|
-
query StakeActivityPage(
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
) {
|
|
3700
|
+
query StakeActivityPage(
|
|
3701
|
+
$where: StakeActivity_bool_exp!
|
|
3702
|
+
$limit: Int!
|
|
3703
|
+
$orderBy: [StakeActivity_order_by!]!
|
|
3704
|
+
) {
|
|
3705
|
+
StakeActivity(where: $where, order_by: $orderBy, limit: $limit) {
|
|
3688
3706
|
id
|
|
3689
3707
|
chainId
|
|
3690
3708
|
vaultAddress
|
|
@@ -4978,22 +4996,26 @@ async function apiFetch({
|
|
|
4978
4996
|
headers: extraHeaders,
|
|
4979
4997
|
timeoutMs,
|
|
4980
4998
|
retryCount = 3,
|
|
4981
|
-
retryDelayMs = 1e3
|
|
4999
|
+
retryDelayMs = 1e3,
|
|
5000
|
+
signal
|
|
4982
5001
|
}) {
|
|
4983
5002
|
const endpoint = url.replace(/^[^/]*\/\/[^/]*/, "");
|
|
4984
5003
|
return withRetry(
|
|
4985
5004
|
async () => {
|
|
5005
|
+
if (signal?.aborted) throw new Error("API request cancelled.");
|
|
4986
5006
|
let res;
|
|
4987
5007
|
try {
|
|
4988
5008
|
const options = {
|
|
4989
5009
|
method,
|
|
4990
|
-
headers: createHeaders(apiKey, authorizationToken, extraHeaders)
|
|
5010
|
+
headers: createHeaders(apiKey, authorizationToken, extraHeaders),
|
|
5011
|
+
...signal ? { signal } : {}
|
|
4991
5012
|
};
|
|
4992
5013
|
if (body && method !== "GET") {
|
|
4993
5014
|
options.body = JSON.stringify(body);
|
|
4994
5015
|
}
|
|
4995
5016
|
res = await fetch(url, options);
|
|
4996
5017
|
} catch (error) {
|
|
5018
|
+
if (signal?.aborted) throw new Error("API request cancelled.");
|
|
4997
5019
|
throw new NetworkError("Failed to connect to API server", { endpoint, error });
|
|
4998
5020
|
}
|
|
4999
5021
|
if (!res.ok) {
|
|
@@ -5411,7 +5433,7 @@ async function apiUploadSellerCredential(processorName, payeeDetails, bundle, ba
|
|
|
5411
5433
|
});
|
|
5412
5434
|
}
|
|
5413
5435
|
async function apiUploadGoogleOAuthSellerCredential(processorName, payeeDetails, body, baseApiUrl, opts) {
|
|
5414
|
-
if (processorName !== "paypal") {
|
|
5436
|
+
if (processorName !== "paypal" && processorName !== "venmo") {
|
|
5415
5437
|
throw new ValidationError(
|
|
5416
5438
|
`Unsupported Google OAuth seller credential platform: ${String(processorName)}`,
|
|
5417
5439
|
"processorName"
|
|
@@ -5420,13 +5442,30 @@ async function apiUploadGoogleOAuthSellerCredential(processorName, payeeDetails,
|
|
|
5420
5442
|
const endpoint = `/v2/makers/${encodeURIComponent(processorName)}/${encodeURIComponent(
|
|
5421
5443
|
payeeDetails
|
|
5422
5444
|
)}/seller-credential/google-oauth`;
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
5429
|
-
|
|
5445
|
+
if (opts?.signal?.aborted) throw new Error("Google OAuth upload cancelled.");
|
|
5446
|
+
const controller = new AbortController();
|
|
5447
|
+
const abort = () => controller.abort();
|
|
5448
|
+
opts?.signal?.addEventListener("abort", abort, { once: true });
|
|
5449
|
+
let timedOut = false;
|
|
5450
|
+
const timeout = opts?.timeoutMs ? setTimeout(() => {
|
|
5451
|
+
timedOut = true;
|
|
5452
|
+
controller.abort();
|
|
5453
|
+
}, opts.timeoutMs) : void 0;
|
|
5454
|
+
try {
|
|
5455
|
+
return await apiFetch({
|
|
5456
|
+
url: `${withApiBase(baseApiUrl)}${endpoint}`,
|
|
5457
|
+
method: "POST",
|
|
5458
|
+
body,
|
|
5459
|
+
authorizationToken: opts?.authorizationToken,
|
|
5460
|
+
signal: controller.signal
|
|
5461
|
+
});
|
|
5462
|
+
} catch (error) {
|
|
5463
|
+
if (timedOut) throw new Error("Google OAuth upload timed out.");
|
|
5464
|
+
throw error;
|
|
5465
|
+
} finally {
|
|
5466
|
+
opts?.signal?.removeEventListener("abort", abort);
|
|
5467
|
+
if (timeout !== void 0) clearTimeout(timeout);
|
|
5468
|
+
}
|
|
5430
5469
|
}
|
|
5431
5470
|
async function apiGetSellerCredentialStatus(processorName, payeeDetails, baseApiUrl, timeoutMs) {
|
|
5432
5471
|
const endpoint = `/v2/makers/${encodeURIComponent(processorName)}/${encodeURIComponent(
|
|
@@ -7107,21 +7146,22 @@ function compareEventCursor(left, right) {
|
|
|
7107
7146
|
if (leftLog !== rightLog) return leftLog < rightLog ? -1 : 1;
|
|
7108
7147
|
return left.id === right.id ? 0 : left.id < right.id ? -1 : 1;
|
|
7109
7148
|
}
|
|
7110
|
-
function eventKeysetPredicate(cursor, blockField, logField) {
|
|
7149
|
+
function eventKeysetPredicate(cursor, blockField, logField, direction = "asc") {
|
|
7150
|
+
const operator = direction === "desc" ? "_lt" : "_gt";
|
|
7111
7151
|
return {
|
|
7112
7152
|
_or: [
|
|
7113
|
-
{ [blockField]: {
|
|
7153
|
+
{ [blockField]: { [operator]: cursor.blockNumber } },
|
|
7114
7154
|
{
|
|
7115
7155
|
_and: [
|
|
7116
7156
|
{ [blockField]: { _eq: cursor.blockNumber } },
|
|
7117
|
-
{ [logField]: {
|
|
7157
|
+
{ [logField]: { [operator]: cursor.logIndex } }
|
|
7118
7158
|
]
|
|
7119
7159
|
},
|
|
7120
7160
|
{
|
|
7121
7161
|
_and: [
|
|
7122
7162
|
{ [blockField]: { _eq: cursor.blockNumber } },
|
|
7123
7163
|
{ [logField]: { _eq: cursor.logIndex } },
|
|
7124
|
-
{ id: {
|
|
7164
|
+
{ id: { [operator]: cursor.id } }
|
|
7125
7165
|
]
|
|
7126
7166
|
}
|
|
7127
7167
|
]
|
|
@@ -7481,7 +7521,12 @@ var IndexerStakingService = class {
|
|
|
7481
7521
|
const vaultAddress = normalizeAddress4(params.vaultAddress, "vaultAddress");
|
|
7482
7522
|
const merchant = normalizeAddress4(params.merchant, "merchant");
|
|
7483
7523
|
const kind = params.kind ? normalizeActivityKind(params.kind, "kind") : void 0;
|
|
7484
|
-
const
|
|
7524
|
+
const direction = params.orderDirection ?? "asc";
|
|
7525
|
+
if (direction !== "asc" && direction !== "desc") {
|
|
7526
|
+
throw new ValidationError("orderDirection must be asc or desc", "orderDirection");
|
|
7527
|
+
}
|
|
7528
|
+
const cursorKind = direction === "desc" ? "zkp2p-activity-desc-v1" : "zkp2p-activity-v1";
|
|
7529
|
+
const after = params.cursor ? decodeEventCursor(params.cursor, cursorKind) : void 0;
|
|
7485
7530
|
const filters = [
|
|
7486
7531
|
{ chainId: { _eq: params.chainId } },
|
|
7487
7532
|
{ vaultAddress: { _eq: vaultAddress } },
|
|
@@ -7490,11 +7535,15 @@ var IndexerStakingService = class {
|
|
|
7490
7535
|
}
|
|
7491
7536
|
];
|
|
7492
7537
|
if (kind) filters.push({ kind: { _eq: kind } });
|
|
7493
|
-
if (after) filters.push(eventKeysetPredicate(after, "blockNumber", "logIndex"));
|
|
7538
|
+
if (after) filters.push(eventKeysetPredicate(after, "blockNumber", "logIndex", direction));
|
|
7494
7539
|
const data3 = await this.client.query(
|
|
7495
7540
|
{
|
|
7496
7541
|
query: STAKE_ACTIVITY_QUERY,
|
|
7497
|
-
variables: {
|
|
7542
|
+
variables: {
|
|
7543
|
+
limit: limit + 1,
|
|
7544
|
+
where: { _and: filters },
|
|
7545
|
+
orderBy: [{ blockNumber: direction }, { logIndex: direction }, { id: direction }]
|
|
7546
|
+
}
|
|
7498
7547
|
},
|
|
7499
7548
|
init
|
|
7500
7549
|
);
|
|
@@ -7506,7 +7555,7 @@ var IndexerStakingService = class {
|
|
|
7506
7555
|
merchant,
|
|
7507
7556
|
kind
|
|
7508
7557
|
});
|
|
7509
|
-
if (previous && compareEventCursor(result.cursor, previous) <= 0) {
|
|
7558
|
+
if (previous && compareEventCursor(result.cursor, previous) * (direction === "desc" ? -1 : 1) <= 0) {
|
|
7510
7559
|
throw new Error("StakeActivity cursor did not advance");
|
|
7511
7560
|
}
|
|
7512
7561
|
previous = result.cursor;
|
|
@@ -7514,10 +7563,11 @@ var IndexerStakingService = class {
|
|
|
7514
7563
|
});
|
|
7515
7564
|
const visible = normalized.slice(0, limit);
|
|
7516
7565
|
const last = visible[visible.length - 1];
|
|
7566
|
+
const latest = direction === "desc" ? visible[0] : last;
|
|
7517
7567
|
return {
|
|
7518
7568
|
items: visible.map(({ item }) => item),
|
|
7519
|
-
nextCursor: normalized.length > limit && last ? encodeCursor(
|
|
7520
|
-
asOf:
|
|
7569
|
+
nextCursor: normalized.length > limit && last ? encodeCursor(cursorKind, last.cursor) : null,
|
|
7570
|
+
asOf: latest ? { blockNumber: latest.item.blockNumber, timestamp: latest.item.timestamp } : null
|
|
7521
7571
|
};
|
|
7522
7572
|
}
|
|
7523
7573
|
async fetchDisputeProtectionIntents(params, init) {
|
|
@@ -7666,10 +7716,10 @@ var IndexerStakingService = class {
|
|
|
7666
7716
|
}
|
|
7667
7717
|
};
|
|
7668
7718
|
|
|
7669
|
-
// ../../node_modules/.pnpm/@zkp2p+contracts-v2@0.4.
|
|
7670
|
-
var version = "0.4.
|
|
7719
|
+
// ../../node_modules/.pnpm/@zkp2p+contracts-v2@0.4.2-rc.2_ethers@6.16.0_bufferutil@4.1.0_utf-8-validate@5.0.10__typescript@5.9.3_zod@4.5.4/node_modules/@zkp2p/contracts-v2/_esm/index.js
|
|
7720
|
+
var version = "0.4.2-rc.2";
|
|
7671
7721
|
|
|
7672
|
-
// ../../node_modules/.pnpm/@zkp2p+contracts-v2@0.4.
|
|
7722
|
+
// ../../node_modules/.pnpm/@zkp2p+contracts-v2@0.4.2-rc.2_ethers@6.16.0_bufferutil@4.1.0_utf-8-validate@5.0.10__typescript@5.9.3_zod@4.5.4/node_modules/@zkp2p/contracts-v2/_esm/disputeStack/base.js
|
|
7673
7723
|
var data = {
|
|
7674
7724
|
"schemaVersion": 2,
|
|
7675
7725
|
"network": "base",
|
|
@@ -7839,7 +7889,7 @@ var data = {
|
|
|
7839
7889
|
};
|
|
7840
7890
|
var base_default = data;
|
|
7841
7891
|
|
|
7842
|
-
// ../../node_modules/.pnpm/@zkp2p+contracts-v2@0.4.
|
|
7892
|
+
// ../../node_modules/.pnpm/@zkp2p+contracts-v2@0.4.2-rc.2_ethers@6.16.0_bufferutil@4.1.0_utf-8-validate@5.0.10__typescript@5.9.3_zod@4.5.4/node_modules/@zkp2p/contracts-v2/_esm/disputeStack/baseStaging.js
|
|
7843
7893
|
var data2 = {
|
|
7844
7894
|
"schemaVersion": 2,
|
|
7845
7895
|
"network": "base_staging",
|
|
@@ -7988,6 +8038,7 @@ var data2 = {
|
|
|
7988
8038
|
"0x90262a3db0edd0be2369c6b28f9e8511ec0bac7136cefbada0880602f87e7268": "1209600",
|
|
7989
8039
|
"0xa5418819c024239299ea32e09defae8ec412c03e58f5c75f1b2fe84c857f5483": "0",
|
|
7990
8040
|
"0xcac9daea62d7b89d75ac73af4ee14dcf25721012ae82b568c2ea5c808eaa04ff": "0",
|
|
8041
|
+
"0xe99a5081226cbbff9440a63da5caa04fa30f210c12c4dd9976132ac075054cd9": "0",
|
|
7991
8042
|
"0xf752c7d19698ecb0bb8988abf9b9a53a4c3657f3bc8850a6fb59fdf3e3ce8cd3": "0",
|
|
7992
8043
|
"0xf81480907d808d639ad3230869e4b05a3b01b2d34e323af40f2efab807effd32": "0"
|
|
7993
8044
|
},
|
|
@@ -8808,6 +8859,13 @@ async function apiUploadSellerCredentialBundle(params, baseApiUrl, timeoutMs, au
|
|
|
8808
8859
|
authorizationToken
|
|
8809
8860
|
);
|
|
8810
8861
|
}
|
|
8862
|
+
function getAmazonPaySellerIdentity(bundle) {
|
|
8863
|
+
const attestation = bundle.identityAttestation;
|
|
8864
|
+
if (bundle.platform !== "upi" || attestation?.platform !== "upi" || attestation.actionType !== "register_upi_amazonpay" || attestation.identity.platform !== "upi" || attestation.identity.actionType !== "register_upi_amazonpay" || !attestation.identity.payeeId?.trim()) {
|
|
8865
|
+
throw new Error("Amazon Pay credential bundle is missing its receiving UPI identity");
|
|
8866
|
+
}
|
|
8867
|
+
return attestation.identity.payeeId;
|
|
8868
|
+
}
|
|
8811
8869
|
var formatTokenAmountForDisplay = (amount, decimals) => {
|
|
8812
8870
|
const formatted = formatUnits(amount, decimals);
|
|
8813
8871
|
if (!formatted.includes(".")) {
|
|
@@ -11481,7 +11539,7 @@ var Zkp2pClient = class {
|
|
|
11481
11539
|
}
|
|
11482
11540
|
}
|
|
11483
11541
|
});
|
|
11484
|
-
const { mapConversionRatesToOnchainMinRate: mapConversionRatesToOnchainMinRate2 } = await import('./currency-
|
|
11542
|
+
const { mapConversionRatesToOnchainMinRate: mapConversionRatesToOnchainMinRate2 } = await import('./currency-C5E6NVSR.mjs');
|
|
11485
11543
|
currencies = mapConversionRatesToOnchainMinRate2(
|
|
11486
11544
|
params.conversionRates,
|
|
11487
11545
|
paymentMethods.length
|
|
@@ -11817,6 +11875,9 @@ var Zkp2pClient = class {
|
|
|
11817
11875
|
* from the submitted Personal API Token.
|
|
11818
11876
|
*/
|
|
11819
11877
|
async uploadSellerCredential(params, opts) {
|
|
11878
|
+
if (!["cashapp", "wise", "upi"].includes(params.platform)) {
|
|
11879
|
+
throw new Error("Use uploadGoogleOAuthSellerCredential to connect Venmo or PayPal Gmail.");
|
|
11880
|
+
}
|
|
11820
11881
|
const baseApiUrl = this.stripTrailingSlash(
|
|
11821
11882
|
opts?.baseApiUrl ?? this.baseApiUrl ?? DEFAULT_BASE_API_URL
|
|
11822
11883
|
);
|
|
@@ -11832,6 +11893,23 @@ var Zkp2pClient = class {
|
|
|
11832
11893
|
opts?.attestationRuntime,
|
|
11833
11894
|
opts?.attestationServiceFallbackUrls ? { fallbackUrls: opts.attestationServiceFallbackUrls } : void 0
|
|
11834
11895
|
);
|
|
11896
|
+
if (params.platform === "upi") {
|
|
11897
|
+
const bundleResponse2 = await createBundle({
|
|
11898
|
+
callerAddress: params.callerAddress,
|
|
11899
|
+
sessionMaterial: params.sessionMaterial
|
|
11900
|
+
});
|
|
11901
|
+
if (!bundleResponse2.success || !bundleResponse2.responseObject) {
|
|
11902
|
+
throw new Error(bundleResponse2.message || "Failed to create seller credential bundle");
|
|
11903
|
+
}
|
|
11904
|
+
return this.uploadSellerCredentialBundle(
|
|
11905
|
+
{
|
|
11906
|
+
bundle: bundleResponse2.responseObject,
|
|
11907
|
+
offchainId: getAmazonPaySellerIdentity(bundleResponse2.responseObject),
|
|
11908
|
+
platform: "upi"
|
|
11909
|
+
},
|
|
11910
|
+
{ baseApiUrl, timeoutMs }
|
|
11911
|
+
);
|
|
11912
|
+
}
|
|
11835
11913
|
if (params.platform === "wise") {
|
|
11836
11914
|
const bundleResponse2 = await createBundle({
|
|
11837
11915
|
...params.callerAddress ? { callerAddress: params.callerAddress } : {},
|
|
@@ -11886,8 +11964,9 @@ var Zkp2pClient = class {
|
|
|
11886
11964
|
* callers send the one-time Google code plus the stable seller identity.
|
|
11887
11965
|
*/
|
|
11888
11966
|
async uploadGoogleOAuthSellerCredential(params, opts) {
|
|
11967
|
+
if (opts?.signal?.aborted) throw new Error("Google OAuth upload cancelled.");
|
|
11889
11968
|
const platform = params.platform;
|
|
11890
|
-
if (platform !== "paypal") {
|
|
11969
|
+
if (platform !== "paypal" && platform !== "venmo") {
|
|
11891
11970
|
throw new ValidationError(
|
|
11892
11971
|
`Unsupported Google OAuth seller credential platform: ${String(platform)}`,
|
|
11893
11972
|
"platform"
|
|
@@ -11906,17 +11985,18 @@ var Zkp2pClient = class {
|
|
|
11906
11985
|
}
|
|
11907
11986
|
return {
|
|
11908
11987
|
timeoutMs,
|
|
11988
|
+
...opts?.signal ? { signal: opts.signal } : {},
|
|
11909
11989
|
...authorizationToken ? { authorizationToken } : {}
|
|
11910
11990
|
};
|
|
11911
11991
|
};
|
|
11992
|
+
const body = {
|
|
11993
|
+
authorizationCode: params.authorizationCode,
|
|
11994
|
+
redirectUri: params.redirectUri
|
|
11995
|
+
};
|
|
11912
11996
|
return apiUploadGoogleOAuthSellerCredential(
|
|
11913
|
-
|
|
11997
|
+
params.platform,
|
|
11914
11998
|
params.payeeDetails,
|
|
11915
|
-
{
|
|
11916
|
-
payeeEmail: params.payeeEmail,
|
|
11917
|
-
authorizationCode: params.authorizationCode,
|
|
11918
|
-
redirectUri: params.redirectUri
|
|
11919
|
-
},
|
|
11999
|
+
params.platform === "paypal" ? { ...body, payeeEmail: params.payeeEmail } : body,
|
|
11920
12000
|
baseApiUrl,
|
|
11921
12001
|
await getUploadOptions()
|
|
11922
12002
|
);
|
|
@@ -12135,6 +12215,9 @@ var getPeerExtensionState = async (options) => {
|
|
|
12135
12215
|
}
|
|
12136
12216
|
};
|
|
12137
12217
|
var sanitizePeerAuthenticateParams = (params) => {
|
|
12218
|
+
if (params.captureMode === "sellerCredential" && params.platform !== "cashapp" && params.platform !== "upi") {
|
|
12219
|
+
throw new Error(`Seller credential capture is not supported for ${params.platform}.`);
|
|
12220
|
+
}
|
|
12138
12221
|
const sanitizedParams = { ...params };
|
|
12139
12222
|
delete sanitizedParams.providerConfig;
|
|
12140
12223
|
return sanitizedParams;
|
|
@@ -12174,6 +12257,6 @@ function selectRiskMode(amount, freeStake, disputeProtected) {
|
|
|
12174
12257
|
throw new RangeError("insufficient free stake for dispute-protected admission");
|
|
12175
12258
|
}
|
|
12176
12259
|
|
|
12177
|
-
export { AccessPolicyOperations, AccessPolicyUnsupportedError, BASE_BUILDER_CODE, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ContractRouter, DEFAULT_ORACLE_MAX_STALENESS_SECONDS, IndexerClient, IndexerDepositService, IndexerRateManagerService, IndexerStakingService, Zkp2pClient as OfframpClient, PEER_EXTENSION_CHROME_URL, PLATFORM_METADATA, PYTH_CONTRACT_BASE, PYTH_ORACLE_ADAPTER, PYTH_ORACLE_FEEDS, REFERRAL_SIGNATURE_DOMAIN, REFERRAL_SIGNATURE_TYPES, RISK_BPS_DENOMINATOR, SDK_BUILD_METADATA, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, TOKEN_METADATA, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, Zkp2pClient, apiCreateReferralCode, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOrderbookTable, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuote, apiGetQuotesBestByPlatform, apiGetReferralDashboard, apiGetReferralEarnings, apiLookupReferralCode, apiPostDepositDetails, apiRedeemReferralCode, apiRequestIdentityAttestation, apiSignIntentV3, apiSignIntentV3Raw, apiUpdateReferralCode, apiUploadGoogleOAuthSellerCredential, apiUploadSellerCredentialBundle, apiValidatePayeeDetails, apiVerifyBuyerTeePayment, appendAttributionToCalldata, assertValidReferrerFeeConfig, buildStakingEntityIds, calculateRequiredCoverage, calculateStakeBackedCapacity, compareEventCursorIdsByRecency, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, createPeerExtensionSdk, defaultIndexerEndpoint, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, fetchFulfillmentAndPayment as fetchIndexerFulfillmentAndPayment, getAttributionDataSuffix, getPeerExtensionState, getSpreadOracleConfig, isPeerExtensionAvailable, isValidReferralCode, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, normalizeReferralCode, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, readDisputeAttestationConfig, referrerFeeConfigToPreciseUnits, selectRiskMode, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
|
|
12260
|
+
export { AccessPolicyOperations, AccessPolicyUnsupportedError, BASE_BUILDER_CODE, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ContractRouter, DEFAULT_ORACLE_MAX_STALENESS_SECONDS, IndexerClient, IndexerDepositService, IndexerRateManagerService, IndexerStakingService, Zkp2pClient as OfframpClient, PEER_EXTENSION_CHROME_URL, PLATFORM_METADATA, PYTH_CONTRACT_BASE, PYTH_ORACLE_ADAPTER, PYTH_ORACLE_FEEDS, REFERRAL_SIGNATURE_DOMAIN, REFERRAL_SIGNATURE_TYPES, RISK_BPS_DENOMINATOR, SDK_BUILD_METADATA, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, TOKEN_METADATA, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, Zkp2pClient, apiCreateReferralCode, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOrderbookTable, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuote, apiGetQuotesBestByPlatform, apiGetReferralDashboard, apiGetReferralEarnings, apiLookupReferralCode, apiPostDepositDetails, apiRedeemReferralCode, apiRequestIdentityAttestation, apiSignIntentV3, apiSignIntentV3Raw, apiUpdateReferralCode, apiUploadGoogleOAuthSellerCredential, apiUploadSellerCredentialBundle, apiValidatePayeeDetails, apiVerifyBuyerTeePayment, appendAttributionToCalldata, assertValidReferrerFeeConfig, buildStakingEntityIds, calculateRequiredCoverage, calculateStakeBackedCapacity, compareEventCursorIdsByRecency, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, createPeerExtensionSdk, defaultIndexerEndpoint, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, fetchFulfillmentAndPayment as fetchIndexerFulfillmentAndPayment, getAmazonPaySellerIdentity, getAttributionDataSuffix, getPeerExtensionState, getSpreadOracleConfig, isPeerExtensionAvailable, isValidReferralCode, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, normalizeReferralCode, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, readDisputeAttestationConfig, referrerFeeConfigToPreciseUnits, selectRiskMode, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
|
|
12178
12261
|
//# sourceMappingURL=index.mjs.map
|
|
12179
12262
|
//# sourceMappingURL=index.mjs.map
|