@zkp2p/sdk 0.14.9 → 0.14.10
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 +17 -0
- package/dist/build-metadata.json +2 -2
- package/dist/chunk-DIHRDN2W.mjs +12 -0
- package/dist/chunk-DIHRDN2W.mjs.map +1 -0
- package/dist/{chunk-4GCGSZA2.mjs → chunk-PLUTAOT5.mjs} +3 -3
- package/dist/{chunk-4GCGSZA2.mjs.map → chunk-PLUTAOT5.mjs.map} +1 -1
- package/dist/{currency-AGVR2YDU.mjs → currency-74LZHM6Q.mjs} +3 -3
- package/dist/{currency-AGVR2YDU.mjs.map → currency-74LZHM6Q.mjs.map} +1 -1
- package/dist/index.cjs +76 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +25 -5
- package/dist/index.d.ts +25 -5
- package/dist/index.mjs +77 -36
- package/dist/index.mjs.map +1 -1
- package/dist/protocolViewerParsers-6BOFKH3F.mjs +5 -0
- package/dist/{protocolViewerParsers-O5WTGTUK.mjs.map → protocolViewerParsers-6BOFKH3F.mjs.map} +1 -1
- package/dist/react.mjs +1 -1
- package/dist/{timeout-RXDD3LQG.mjs → timeout-WX76D6NU.mjs} +3 -3
- package/dist/{timeout-RXDD3LQG.mjs.map → timeout-WX76D6NU.mjs.map} +1 -1
- package/package.json +1 -1
- package/dist/chunk-ERJIIFAV.mjs +0 -12
- package/dist/chunk-ERJIIFAV.mjs.map +0 -1
- package/dist/protocolViewerParsers-O5WTGTUK.mjs +0 -5
package/dist/index.d.mts
CHANGED
|
@@ -1018,17 +1018,37 @@ type VenmoGmailConnectResult = {
|
|
|
1018
1018
|
payeeDetails: Hash;
|
|
1019
1019
|
};
|
|
1020
1020
|
/** Build a Peer-hosted link for an already-registered Venmo maker. */
|
|
1021
|
-
declare function getVenmoGmailConnectUrl(
|
|
1021
|
+
declare function getVenmoGmailConnectUrl(options: {
|
|
1022
1022
|
payeeDetails: Hash;
|
|
1023
|
-
/** Matching Peer web origin. HTTP is allowed only on localhost for development. */
|
|
1024
1023
|
peerOrigin?: string;
|
|
1025
1024
|
appearance?: VenmoGmailAppearance;
|
|
1026
|
-
/** Optional app callback URI. Native hosts open the URL themselves; empty means no redirect. */
|
|
1027
1025
|
returnUrl?: string;
|
|
1028
1026
|
}): string;
|
|
1029
|
-
/** Call from a click handler
|
|
1027
|
+
/** Call from a click handler; verifies receipts through Gmail, Outlook or iCloud. */
|
|
1030
1028
|
declare function openVenmoGmailConnect(options: Omit<Parameters<typeof getVenmoGmailConnectUrl>[0], 'returnUrl'> & {
|
|
1031
1029
|
popup?: VenmoGmailPopupOptions;
|
|
1032
1030
|
}): Promise<VenmoGmailConnectResult>;
|
|
1033
1031
|
|
|
1034
|
-
|
|
1032
|
+
declare class XMoneyConnectError extends Error {
|
|
1033
|
+
readonly code: string;
|
|
1034
|
+
constructor(code: string, message: string);
|
|
1035
|
+
}
|
|
1036
|
+
type XMoneyConnectResult = {
|
|
1037
|
+
payeeDetails: Hash;
|
|
1038
|
+
};
|
|
1039
|
+
type XMoneyConnectOptions = {
|
|
1040
|
+
payeeDetails: Hash;
|
|
1041
|
+
/** Registered X username, required to bind iCloud uploads to this account. */
|
|
1042
|
+
payeeUsername: string;
|
|
1043
|
+
peerOrigin?: string;
|
|
1044
|
+
appearance?: VenmoGmailAppearance;
|
|
1045
|
+
returnUrl?: string;
|
|
1046
|
+
};
|
|
1047
|
+
/** The account identity stays in the fragment, outside HTTP requests. */
|
|
1048
|
+
declare function getXMoneyConnectUrl(options: XMoneyConnectOptions): string;
|
|
1049
|
+
/** Call from a click handler; resolves only after a verified receipt connects the account. */
|
|
1050
|
+
declare function openXMoneyConnect(options: Omit<XMoneyConnectOptions, 'returnUrl'> & {
|
|
1051
|
+
popup?: VenmoGmailPopupOptions;
|
|
1052
|
+
}): Promise<XMoneyConnectResult>;
|
|
1053
|
+
|
|
1054
|
+
export { APIError, ApiAdapterOptions, AttestationServiceIdentityResponse, AttestationServiceSellerCredentialUploadResponse, AttestationServiceSellerVerifyResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, BuyerTeeVerifyPaymentBody, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ContractError, ContractRouter, type ContractRouterConfig, CreateReferralCodeRequest, CreateReferralCodeResponse, CuratorSellerCredentialStatusResponse, 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, MicrosoftOAuthSellerCredentialUploadBodyByPlatform, 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, SellerPlatform, 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, type VenmoGmailAppearance, VenmoGmailConnectError, type VenmoGmailConnectResult, type VenmoGmailPopupOptions, XMoneyConnectError, type XMoneyConnectOptions, type XMoneyConnectResult, ZKP2PError, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, apiCreateReferralCode, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOrderbookTable, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuote, apiGetQuotesBestByPlatform, apiGetReferralDashboard, apiGetReferralEarnings, apiGetSellerCredentialStatus, apiLookupReferralCode, apiPostDepositDetails, apiRedeemReferralCode, apiRequestIdentityAttestation, apiSignIntentV3, apiSignIntentV3Raw, apiUpdateReferralCode, apiUploadGoogleOAuthSellerCredential, apiUploadMicrosoftOAuthSellerCredential, apiUploadSellerCredentialBundle, apiValidatePayeeDetails, apiVerifyBuyerTeePayment, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, calculateRequiredCoverage, calculateStakeBackedCapacity, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, createPeerExtensionSdk, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, ensureBytes32, getAmazonPaySellerIdentity, getAttributionDataSuffix, getPeerExtensionState, getSpreadOracleConfig, getVenmoGmailConnectUrl, getXMoneyConnectUrl, isPeerExtensionAvailable, isValidReferralCode, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, normalizeReferralCode, openPeerExtensionInstallPage, openVenmoGmailConnect, openXMoneyConnect, parseReferrerFeeConfig, parseVenmoGmailAppearance, peerExtensionSdk, referrerFeeConfigToPreciseUnits, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash, selectRiskMode, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
|
package/dist/index.d.ts
CHANGED
|
@@ -1018,17 +1018,37 @@ type VenmoGmailConnectResult = {
|
|
|
1018
1018
|
payeeDetails: Hash;
|
|
1019
1019
|
};
|
|
1020
1020
|
/** Build a Peer-hosted link for an already-registered Venmo maker. */
|
|
1021
|
-
declare function getVenmoGmailConnectUrl(
|
|
1021
|
+
declare function getVenmoGmailConnectUrl(options: {
|
|
1022
1022
|
payeeDetails: Hash;
|
|
1023
|
-
/** Matching Peer web origin. HTTP is allowed only on localhost for development. */
|
|
1024
1023
|
peerOrigin?: string;
|
|
1025
1024
|
appearance?: VenmoGmailAppearance;
|
|
1026
|
-
/** Optional app callback URI. Native hosts open the URL themselves; empty means no redirect. */
|
|
1027
1025
|
returnUrl?: string;
|
|
1028
1026
|
}): string;
|
|
1029
|
-
/** Call from a click handler
|
|
1027
|
+
/** Call from a click handler; verifies receipts through Gmail, Outlook or iCloud. */
|
|
1030
1028
|
declare function openVenmoGmailConnect(options: Omit<Parameters<typeof getVenmoGmailConnectUrl>[0], 'returnUrl'> & {
|
|
1031
1029
|
popup?: VenmoGmailPopupOptions;
|
|
1032
1030
|
}): Promise<VenmoGmailConnectResult>;
|
|
1033
1031
|
|
|
1034
|
-
|
|
1032
|
+
declare class XMoneyConnectError extends Error {
|
|
1033
|
+
readonly code: string;
|
|
1034
|
+
constructor(code: string, message: string);
|
|
1035
|
+
}
|
|
1036
|
+
type XMoneyConnectResult = {
|
|
1037
|
+
payeeDetails: Hash;
|
|
1038
|
+
};
|
|
1039
|
+
type XMoneyConnectOptions = {
|
|
1040
|
+
payeeDetails: Hash;
|
|
1041
|
+
/** Registered X username, required to bind iCloud uploads to this account. */
|
|
1042
|
+
payeeUsername: string;
|
|
1043
|
+
peerOrigin?: string;
|
|
1044
|
+
appearance?: VenmoGmailAppearance;
|
|
1045
|
+
returnUrl?: string;
|
|
1046
|
+
};
|
|
1047
|
+
/** The account identity stays in the fragment, outside HTTP requests. */
|
|
1048
|
+
declare function getXMoneyConnectUrl(options: XMoneyConnectOptions): string;
|
|
1049
|
+
/** Call from a click handler; resolves only after a verified receipt connects the account. */
|
|
1050
|
+
declare function openXMoneyConnect(options: Omit<XMoneyConnectOptions, 'returnUrl'> & {
|
|
1051
|
+
popup?: VenmoGmailPopupOptions;
|
|
1052
|
+
}): Promise<XMoneyConnectResult>;
|
|
1053
|
+
|
|
1054
|
+
export { APIError, ApiAdapterOptions, AttestationServiceIdentityResponse, AttestationServiceSellerCredentialUploadResponse, AttestationServiceSellerVerifyResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, BuyerTeeVerifyPaymentBody, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ContractError, ContractRouter, type ContractRouterConfig, CreateReferralCodeRequest, CreateReferralCodeResponse, CuratorSellerCredentialStatusResponse, 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, MicrosoftOAuthSellerCredentialUploadBodyByPlatform, 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, SellerPlatform, 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, type VenmoGmailAppearance, VenmoGmailConnectError, type VenmoGmailConnectResult, type VenmoGmailPopupOptions, XMoneyConnectError, type XMoneyConnectOptions, type XMoneyConnectResult, ZKP2PError, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, apiCreateReferralCode, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOrderbookTable, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuote, apiGetQuotesBestByPlatform, apiGetReferralDashboard, apiGetReferralEarnings, apiGetSellerCredentialStatus, apiLookupReferralCode, apiPostDepositDetails, apiRedeemReferralCode, apiRequestIdentityAttestation, apiSignIntentV3, apiSignIntentV3Raw, apiUpdateReferralCode, apiUploadGoogleOAuthSellerCredential, apiUploadMicrosoftOAuthSellerCredential, apiUploadSellerCredentialBundle, apiValidatePayeeDetails, apiVerifyBuyerTeePayment, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, calculateRequiredCoverage, calculateStakeBackedCapacity, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, createPeerExtensionSdk, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, ensureBytes32, getAmazonPaySellerIdentity, getAttributionDataSuffix, getPeerExtensionState, getSpreadOracleConfig, getVenmoGmailConnectUrl, getXMoneyConnectUrl, isPeerExtensionAvailable, isValidReferralCode, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, normalizeReferralCode, openPeerExtensionInstallPage, openVenmoGmailConnect, openXMoneyConnect, parseReferrerFeeConfig, parseVenmoGmailAppearance, peerExtensionSdk, referrerFeeConfigToPreciseUnits, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash, selectRiskMode, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
|
package/dist/index.mjs
CHANGED
|
@@ -2,12 +2,12 @@ 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, ContractError, 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-PLUTAOT5.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-PLUTAOT5.mjs';
|
|
7
7
|
import { Currency, currencyKeccak256 } from './chunk-WDEEWFEU.mjs';
|
|
8
8
|
export { Currency, currencyInfo, getCurrencyCodeFromHash, getCurrencyInfoFromCountryCode, getCurrencyInfoFromHash, isSupportedCurrencyHash, mapConversionRatesToOnchainMinRate } from './chunk-WDEEWFEU.mjs';
|
|
9
|
-
import { define_ZKP2P_SDK_BUILD_METADATA_default } from './chunk-
|
|
10
|
-
import { keccak256, parseUnits, concatHex, encodeFunctionData, encodeAbiParameters, createPublicClient, http, parseEventLogs, isAddressEqual, isAddress, zeroAddress, formatUnits } from 'viem';
|
|
9
|
+
import { define_ZKP2P_SDK_BUILD_METADATA_default } from './chunk-DIHRDN2W.mjs';
|
|
10
|
+
import { keccak256, parseUnits, concatHex, encodeFunctionData, encodeAbiParameters, createPublicClient, http, parseEventLogs, isAddressEqual, isAddress, zeroAddress, stringToBytes, formatUnits } from 'viem';
|
|
11
11
|
import { hardhat, base } from 'viem/chains';
|
|
12
12
|
import { hashUtf8, createNitroAttestationClient, verifySellerCredentialBundle, NitroAttestationError, createEncryptedBuyerTeeSessionMaterial as createEncryptedBuyerTeeSessionMaterial$1, createEncryptedSellerCredentialUpload } from '@zkp2p/zkp2p-attestation';
|
|
13
13
|
export { createNitroAttestationClient, verifyDisputeAttestation } from '@zkp2p/zkp2p-attestation';
|
|
@@ -1039,7 +1039,7 @@ async function withRetry(fn, maxRetries = 3, delayMs = 1e3, timeoutMs, shouldRet
|
|
|
1039
1039
|
for (let i = 0; i < maxRetries; i++) {
|
|
1040
1040
|
try {
|
|
1041
1041
|
if (timeoutMs) {
|
|
1042
|
-
const { withTimeout } = await import('./timeout-
|
|
1042
|
+
const { withTimeout } = await import('./timeout-WX76D6NU.mjs');
|
|
1043
1043
|
return await withTimeout(fn(), timeoutMs, `Operation timed out after ${timeoutMs}ms`);
|
|
1044
1044
|
}
|
|
1045
1045
|
return await fn();
|
|
@@ -2659,7 +2659,7 @@ var ProtocolViewerReader = class {
|
|
|
2659
2659
|
if (inputCount === null) {
|
|
2660
2660
|
throw new Error("Configured ProtocolViewer ABI does not expose getDeposit");
|
|
2661
2661
|
}
|
|
2662
|
-
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-
|
|
2662
|
+
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-6BOFKH3F.mjs');
|
|
2663
2663
|
if (inputCount >= 3) {
|
|
2664
2664
|
return tryContexts(
|
|
2665
2665
|
protocolViewerContexts,
|
|
@@ -2745,7 +2745,7 @@ var ProtocolViewerReader = class {
|
|
|
2745
2745
|
return Promise.all(ids.map((id) => this.config.host.getPvDepositById(id)));
|
|
2746
2746
|
}
|
|
2747
2747
|
const bn = ids.map((id) => typeof id === "bigint" ? id : parseRawDepositId(id));
|
|
2748
|
-
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-
|
|
2748
|
+
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-6BOFKH3F.mjs');
|
|
2749
2749
|
if (inputCount >= 2) {
|
|
2750
2750
|
const requests = ids.map((id, index) => ({
|
|
2751
2751
|
index,
|
|
@@ -2850,7 +2850,7 @@ var ProtocolViewerReader = class {
|
|
|
2850
2850
|
if (!protocolViewerAddress || !protocolViewerAbi || inputCount === null) {
|
|
2851
2851
|
return this.config.host.getPvAccountDepositsFromIndexer(owner);
|
|
2852
2852
|
}
|
|
2853
|
-
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-
|
|
2853
|
+
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-6BOFKH3F.mjs');
|
|
2854
2854
|
const { address, abi } = this.config.host.requireProtocolViewer();
|
|
2855
2855
|
if (inputCount >= 2) {
|
|
2856
2856
|
const readAndFilter = async (raw2) => {
|
|
@@ -2921,7 +2921,7 @@ var ProtocolViewerReader = class {
|
|
|
2921
2921
|
if (protocolViewerEntries.length === 0) {
|
|
2922
2922
|
throw new Error("ProtocolViewer not available for this network");
|
|
2923
2923
|
}
|
|
2924
|
-
const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-
|
|
2924
|
+
const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-6BOFKH3F.mjs');
|
|
2925
2925
|
const intentsByHash = /* @__PURE__ */ new Map();
|
|
2926
2926
|
let attemptedRead = false;
|
|
2927
2927
|
let hadSuccessfulRead = false;
|
|
@@ -3029,7 +3029,7 @@ var ProtocolViewerReader = class {
|
|
|
3029
3029
|
if (protocolViewerEntries.length === 0) {
|
|
3030
3030
|
throw new Error("ProtocolViewer not available for this network");
|
|
3031
3031
|
}
|
|
3032
|
-
const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-
|
|
3032
|
+
const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-6BOFKH3F.mjs');
|
|
3033
3033
|
let lastError;
|
|
3034
3034
|
for (const pvEntry of protocolViewerEntries) {
|
|
3035
3035
|
const inputCount = this.pvEntryFunctionInputCount(pvEntry, "getIntent");
|
|
@@ -8529,15 +8529,15 @@ var DisputeProtectionReadinessReader = class {
|
|
|
8529
8529
|
async verifyRuntimeIdentities(names, blockNumber) {
|
|
8530
8530
|
await Promise.all(
|
|
8531
8531
|
names.map(async (name) => {
|
|
8532
|
-
const
|
|
8532
|
+
const identity2 = this.config.manifest.runtimeIdentities[name];
|
|
8533
8533
|
const bytecode = await this.config.publicClient.getBytecode({
|
|
8534
|
-
address:
|
|
8534
|
+
address: identity2.address,
|
|
8535
8535
|
blockNumber
|
|
8536
8536
|
});
|
|
8537
8537
|
if (!bytecode || bytecode === "0x") {
|
|
8538
8538
|
throw new ReadinessMismatch(`${name} runtime bytecode unavailable`);
|
|
8539
8539
|
}
|
|
8540
|
-
if (keccak256(bytecode).toLowerCase() !==
|
|
8540
|
+
if (keccak256(bytecode).toLowerCase() !== identity2.runtimeCodeHash.toLowerCase()) {
|
|
8541
8541
|
throw new ReadinessMismatch(`${name} runtime code hash mismatch`);
|
|
8542
8542
|
}
|
|
8543
8543
|
})
|
|
@@ -12086,7 +12086,7 @@ var Zkp2pClient = class {
|
|
|
12086
12086
|
}
|
|
12087
12087
|
}
|
|
12088
12088
|
});
|
|
12089
|
-
const { mapConversionRatesToOnchainMinRate: mapConversionRatesToOnchainMinRate2 } = await import('./currency-
|
|
12089
|
+
const { mapConversionRatesToOnchainMinRate: mapConversionRatesToOnchainMinRate2 } = await import('./currency-74LZHM6Q.mjs');
|
|
12090
12090
|
currencies = mapConversionRatesToOnchainMinRate2(
|
|
12091
12091
|
params.conversionRates,
|
|
12092
12092
|
paymentMethods.length
|
|
@@ -12904,22 +12904,18 @@ function getVenmoGmailPopupSize(popup = {}) {
|
|
|
12904
12904
|
return { width, height };
|
|
12905
12905
|
}
|
|
12906
12906
|
|
|
12907
|
-
// src/
|
|
12908
|
-
|
|
12909
|
-
constructor(code, message) {
|
|
12910
|
-
super(message);
|
|
12911
|
-
this.code = code;
|
|
12912
|
-
this.name = "VenmoGmailConnectError";
|
|
12913
|
-
}
|
|
12914
|
-
};
|
|
12915
|
-
function getVenmoGmailConnectUrl({
|
|
12907
|
+
// src/mailboxConnect.ts
|
|
12908
|
+
function getMailboxConnectUrl({
|
|
12916
12909
|
payeeDetails,
|
|
12910
|
+
platform,
|
|
12911
|
+
label,
|
|
12912
|
+
payeeUsername,
|
|
12917
12913
|
peerOrigin = "https://app.peer.xyz",
|
|
12918
12914
|
appearance,
|
|
12919
12915
|
returnUrl
|
|
12920
12916
|
}) {
|
|
12921
12917
|
if (!/^0x[0-9a-f]{64}$/i.test(payeeDetails)) {
|
|
12922
|
-
throw new ValidationError(
|
|
12918
|
+
throw new ValidationError(`Expected a ${label} payee hash`, "payeeDetails");
|
|
12923
12919
|
}
|
|
12924
12920
|
let origin;
|
|
12925
12921
|
try {
|
|
@@ -12930,7 +12926,7 @@ function getVenmoGmailConnectUrl({
|
|
|
12930
12926
|
if (origin.protocol !== "https:" && !(origin.protocol === "http:" && origin.hostname === "localhost") || origin.pathname !== "/" || origin.search || origin.hash || origin.username || origin.password) {
|
|
12931
12927
|
throw new ValidationError("Expected an HTTPS Peer web origin", "peerOrigin");
|
|
12932
12928
|
}
|
|
12933
|
-
const url = new URL(
|
|
12929
|
+
const url = new URL(`/connect/${platform}`, origin);
|
|
12934
12930
|
if (returnUrl) {
|
|
12935
12931
|
try {
|
|
12936
12932
|
new URL(returnUrl);
|
|
@@ -12941,11 +12937,11 @@ function getVenmoGmailConnectUrl({
|
|
|
12941
12937
|
}
|
|
12942
12938
|
if (appearance)
|
|
12943
12939
|
url.searchParams.set("appearance", JSON.stringify(parseVenmoGmailAppearance(appearance)));
|
|
12944
|
-
url.hash = payeeDetails;
|
|
12940
|
+
url.hash = payeeUsername === void 0 ? payeeDetails : new URLSearchParams({ payeeDetails, payeeUsername }).toString();
|
|
12945
12941
|
return url.toString();
|
|
12946
12942
|
}
|
|
12947
|
-
function
|
|
12948
|
-
const url = new URL(
|
|
12943
|
+
function openMailboxConnect(options) {
|
|
12944
|
+
const url = new URL(getMailboxConnectUrl(options));
|
|
12949
12945
|
const { width, height } = getVenmoGmailPopupSize(options.popup);
|
|
12950
12946
|
const requestId = window.crypto.randomUUID();
|
|
12951
12947
|
url.searchParams.set("requestId", requestId);
|
|
@@ -12960,9 +12956,9 @@ function openVenmoGmailConnect(options) {
|
|
|
12960
12956
|
}
|
|
12961
12957
|
if (!popup) {
|
|
12962
12958
|
reject(
|
|
12963
|
-
new
|
|
12959
|
+
new options.ErrorClass(
|
|
12964
12960
|
"popup_blocked",
|
|
12965
|
-
|
|
12961
|
+
`Allow popups for this site, then link ${options.label} again.`
|
|
12966
12962
|
)
|
|
12967
12963
|
);
|
|
12968
12964
|
return;
|
|
@@ -12979,18 +12975,19 @@ function openVenmoGmailConnect(options) {
|
|
|
12979
12975
|
const data3 = event.data;
|
|
12980
12976
|
if (typeof data3 !== "object" || !data3) return;
|
|
12981
12977
|
const result = data3;
|
|
12982
|
-
if (result.type !==
|
|
12978
|
+
if (result.type !== `peer:${options.platform}-connect` || result.requestId !== requestId)
|
|
12979
|
+
return;
|
|
12983
12980
|
if (result.status === "connected" && typeof result.payeeDetails === "string" && result.payeeDetails.toLowerCase() === options.payeeDetails.toLowerCase()) {
|
|
12984
12981
|
finish();
|
|
12985
12982
|
} else if (result.status === "error" && typeof result.code === "string" && typeof result.message === "string") {
|
|
12986
|
-
finish(new
|
|
12983
|
+
finish(new options.ErrorClass(result.code, result.message));
|
|
12987
12984
|
}
|
|
12988
12985
|
};
|
|
12989
12986
|
const timeout = window.setTimeout(
|
|
12990
12987
|
() => finish(
|
|
12991
|
-
new
|
|
12988
|
+
new options.ErrorClass(
|
|
12992
12989
|
"connection_timeout",
|
|
12993
|
-
|
|
12990
|
+
`${options.label} linking timed out. Check the connection status before trying again.`
|
|
12994
12991
|
)
|
|
12995
12992
|
),
|
|
12996
12993
|
10 * 60 * 1e3
|
|
@@ -12998,7 +12995,7 @@ function openVenmoGmailConnect(options) {
|
|
|
12998
12995
|
const closedCheck = window.setInterval(() => {
|
|
12999
12996
|
if (popup.closed)
|
|
13000
12997
|
finish(
|
|
13001
|
-
new
|
|
12998
|
+
new options.ErrorClass(
|
|
13002
12999
|
"connection_closed",
|
|
13003
13000
|
"The linking window closed or became unavailable. Check the connection status before trying again."
|
|
13004
13001
|
)
|
|
@@ -13008,6 +13005,50 @@ function openVenmoGmailConnect(options) {
|
|
|
13008
13005
|
});
|
|
13009
13006
|
}
|
|
13010
13007
|
|
|
13011
|
-
|
|
13008
|
+
// src/venmoGmail.ts
|
|
13009
|
+
var VenmoGmailConnectError = class extends Error {
|
|
13010
|
+
constructor(code, message) {
|
|
13011
|
+
super(message);
|
|
13012
|
+
this.code = code;
|
|
13013
|
+
this.name = "VenmoGmailConnectError";
|
|
13014
|
+
}
|
|
13015
|
+
};
|
|
13016
|
+
function getVenmoGmailConnectUrl(options) {
|
|
13017
|
+
return getMailboxConnectUrl({ ...options, platform: "venmo", label: "Venmo" });
|
|
13018
|
+
}
|
|
13019
|
+
function openVenmoGmailConnect(options) {
|
|
13020
|
+
return openMailboxConnect({
|
|
13021
|
+
...options,
|
|
13022
|
+
platform: "venmo",
|
|
13023
|
+
label: "Venmo",
|
|
13024
|
+
ErrorClass: VenmoGmailConnectError
|
|
13025
|
+
});
|
|
13026
|
+
}
|
|
13027
|
+
var XMoneyConnectError = class extends Error {
|
|
13028
|
+
constructor(code, message) {
|
|
13029
|
+
super(message);
|
|
13030
|
+
this.code = code;
|
|
13031
|
+
this.name = "XMoneyConnectError";
|
|
13032
|
+
}
|
|
13033
|
+
};
|
|
13034
|
+
function identity(options) {
|
|
13035
|
+
const payeeUsername = options.payeeUsername.trim().replace(/^@/u, "").toLowerCase();
|
|
13036
|
+
if (!payeeUsername || keccak256(stringToBytes(payeeUsername)) !== options.payeeDetails.toLowerCase()) {
|
|
13037
|
+
throw new ValidationError("X username must match the registered payee hash", "payeeUsername");
|
|
13038
|
+
}
|
|
13039
|
+
return { ...options, payeeUsername, platform: "xmoney", label: "X Money" };
|
|
13040
|
+
}
|
|
13041
|
+
function getXMoneyConnectUrl(options) {
|
|
13042
|
+
return getMailboxConnectUrl(identity(options));
|
|
13043
|
+
}
|
|
13044
|
+
function openXMoneyConnect(options) {
|
|
13045
|
+
return openMailboxConnect({
|
|
13046
|
+
...identity(options),
|
|
13047
|
+
popup: options.popup,
|
|
13048
|
+
ErrorClass: XMoneyConnectError
|
|
13049
|
+
});
|
|
13050
|
+
}
|
|
13051
|
+
|
|
13052
|
+
export { AccessPolicyOperations, AccessPolicyUnsupportedError, BASE_BUILDER_CODE, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ContractRouter, DEFAULT_ORACLE_MAX_STALENESS_SECONDS, ICloudMailCredentialError, 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, VenmoGmailConnectError, XMoneyConnectError, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, Zkp2pClient, apiCreateReferralCode, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOrderbookTable, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuote, apiGetQuotesBestByPlatform, apiGetReferralDashboard, apiGetReferralEarnings, apiGetSellerCredentialStatus, apiLookupReferralCode, apiPostDepositDetails, apiRedeemReferralCode, apiRequestIdentityAttestation, apiSignIntentV3, apiSignIntentV3Raw, apiUpdateReferralCode, apiUploadGoogleOAuthSellerCredential, apiUploadMicrosoftOAuthSellerCredential, 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, getVenmoGmailConnectUrl, getXMoneyConnectUrl, isMailboxSellerCredentialType, isPeerExtensionAvailable, isValidReferralCode, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, normalizeReferralCode, openPeerExtensionInstallPage, openVenmoGmailConnect, openXMoneyConnect, parseReferrerFeeConfig, parseVenmoGmailAppearance, peerExtensionSdk, readDisputeAttestationConfig, referrerFeeConfigToPreciseUnits, selectRiskMode, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
|
|
13012
13053
|
//# sourceMappingURL=index.mjs.map
|
|
13013
13054
|
//# sourceMappingURL=index.mjs.map
|