@zkp2p/sdk 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +18 -18
  2. package/dist/{Zkp2pClient-CODjD_Kf.d.mts → Zkp2pClient-CIMGTCFg.d.mts} +25 -5
  3. package/dist/{Zkp2pClient-CODjD_Kf.d.ts → Zkp2pClient-CIMGTCFg.d.ts} +25 -5
  4. package/dist/{chunk-PBBMWRNE.mjs → chunk-BEZUO5YY.mjs} +2 -2
  5. package/dist/chunk-BEZUO5YY.mjs.map +1 -0
  6. package/dist/{chunk-M6S5FL2X.mjs → chunk-GDKCACWH.mjs} +2 -2
  7. package/dist/{chunk-M6S5FL2X.mjs.map → chunk-GDKCACWH.mjs.map} +1 -1
  8. package/dist/{chunk-O7DHVBCL.mjs → chunk-KLSZK5TR.mjs} +4 -4
  9. package/dist/{chunk-O7DHVBCL.mjs.map → chunk-KLSZK5TR.mjs.map} +1 -1
  10. package/dist/{chunk-JLEW4EOG.mjs → chunk-P3NOBRQB.mjs} +2 -2
  11. package/dist/{chunk-JLEW4EOG.mjs.map → chunk-P3NOBRQB.mjs.map} +1 -1
  12. package/dist/constants-CFOT2I4R.mjs +4 -0
  13. package/dist/{constants-DMJE2ALO.mjs.map → constants-CFOT2I4R.mjs.map} +1 -1
  14. package/dist/{currency-ULYH5HL2.mjs → currency-JIMAHIGJ.mjs} +3 -3
  15. package/dist/{currency-ULYH5HL2.mjs.map → currency-JIMAHIGJ.mjs.map} +1 -1
  16. package/dist/index.cjs +20 -0
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.mts +4 -4
  19. package/dist/index.d.ts +4 -4
  20. package/dist/index.mjs +38 -18
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/paymentResolution-4AAJVIIC.mjs +3 -0
  23. package/dist/{paymentResolution-S6GZR3OY.mjs.map → paymentResolution-4AAJVIIC.mjs.map} +1 -1
  24. package/dist/protocolViewerParsers-OYF64AE4.mjs +5 -0
  25. package/dist/{protocolViewerParsers-DTJLHUCH.mjs.map → protocolViewerParsers-OYF64AE4.mjs.map} +1 -1
  26. package/dist/react.d.mts +1 -1
  27. package/dist/react.d.ts +1 -1
  28. package/package.json +1 -1
  29. package/dist/chunk-PBBMWRNE.mjs.map +0 -1
  30. package/dist/constants-DMJE2ALO.mjs +0 -4
  31. package/dist/paymentResolution-S6GZR3OY.mjs +0 -3
  32. package/dist/protocolViewerParsers-DTJLHUCH.mjs +0 -5
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/index.ts","../src/utils/constants.ts","../src/constants.ts"],"names":[],"mappings":";AAwmBO,IAAM,iBAAA,GAAoB;AAAA,EAC/B,MAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,aAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF;;;AC9mBO,IAAM,oBAAA,GAAuB;AAC7B,IAAM,mBAAA,GAAsB;AAkC5B,IAAM,kBAAA,GAAgC;AAAA,EAC3C,IAAA,EAAM;AAAA,IACJ,UAAA,EAAY;AAAA;AAAA,MAEV,IAAA,EAAM,4CAAA;AAAA;AAAA,MAGN,MAAA,EAAQ,4CAAA;AAAA;AAAA,MAGR,KAAA,EAAO,4CAAA;AAAA,MACP,OAAA,EAAS,4CAAA;AAAA,MACT,OAAA,EAAS,4CAAA;AAAA,MACT,IAAA,EAAM,4CAAA;AAAA,MACN,WAAA,EAAa,4CAAA;AAAA,MACb,KAAA,EAAO,4CAAA;AAAA,MACP,MAAA,EAAQ,4CAAA;AAAA,MACR,KAAA,EAAO,4CAAA;AAAA;AAAA,MAGP,aAAA,EAAe,4CAAA;AAAA,MACf,kBAAA,EAAoB;AAAA,KACtB;AAAA,IACA,OAAA,EAAS;AAAA;AAAA,MAEP,IAAA,EAAM,4CAAA;AAAA;AAAA,MAGN,MAAA,EAAQ,4CAAA;AAAA;AAAA,MAG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EAC7D;AACA,EAAA,OAAO,MAAA;AACT","file":"chunk-JLEW4EOG.mjs","sourcesContent":["// Minimal initial type surface for Offramp SDK\nimport type { AccessList, Address, AuthorizationList, Hash, WalletClient } from 'viem';\nimport type { CurrencyType } from '../utils/currency';\n\n/**\n * Timeout configuration for different operation types\n */\nexport type TimeoutConfig = {\n /** API call timeout in milliseconds (default: 30000) */\n api?: number;\n /** Transaction timeout in milliseconds (default: 60000) */\n transaction?: number;\n};\n\nexport type Zkp2pClientOptions = {\n walletClient: WalletClient;\n apiKey: string;\n chainId: number;\n environment?: 'production' | 'staging';\n baseApiUrl?: string;\n witnessUrl?: string;\n rpcUrl?: string;\n /** Optional bearer token for hybrid auth */\n authorizationToken?: string;\n /** Optional timeout configuration */\n timeouts?: TimeoutConfig;\n};\n\n/**\n * Callback function for transaction actions\n * @param params - Transaction callback parameters\n * @param params.hash - Transaction hash\n * @param params.data - Optional additional data from the transaction\n */\nexport type ActionCallback = (params: { hash: Hash; data?: unknown }) => void;\n\n/**\n * Safe transaction overrides including ERC-8021 referrers.\n * Referrer codes are prepended before the Base builder code (bc_nbn6qkni).\n */\nexport type TxOverrides = {\n gas?: bigint;\n gasPrice?: bigint;\n maxFeePerGas?: bigint;\n maxPriorityFeePerGas?: bigint;\n nonce?: number;\n value?: bigint;\n accessList?: AccessList;\n authorizationList?: AuthorizationList;\n /**\n * ERC-8021 referrer code(s) to prepend before the Base builder code.\n * Accepts a single code or multiple (e.g., ['zkp2p-bot', 'merchant-id']).\n */\n referrer?: string | string[];\n};\n\n/**\n * Parameters for fulfilling an intent with payment attestation\n */\nexport type FulfillIntentParams = {\n /** Hash of the intent to fulfill */\n intentHash: Hash;\n /** Attestation proof - object or stringified JSON from attestation service */\n proof: Record<string, unknown> | string;\n /** Optional attestation timestamp buffer override in milliseconds */\n timestampBufferMs?: number | string;\n /** Override the attestation service base URL */\n attestationServiceUrl?: string;\n /** Override the verifying contract (defaults to UnifiedPaymentVerifier) */\n verifyingContract?: Address;\n /** Optional hook payload passed to orchestrator */\n postIntentHookData?: `0x${string}`;\n /** Optional viem transaction overrides */\n txOverrides?: TxOverrides;\n /** Optional lifecycle callbacks */\n callbacks?: {\n onAttestationStart?: () => void;\n onTxSent?: (hash: Hash) => void;\n onTxMined?: (hash: Hash) => void;\n };\n};\n\n/**\n * Parameters for releasing funds back to the payer\n */\nexport type ReleaseFundsToPayerParams = {\n /** Hash of the intent to release funds for */\n intentHash: Hash;\n /** Callback when transaction is successfully sent */\n onSuccess?: ActionCallback;\n /** Callback when an error occurs */\n onError?: (error: Error) => void;\n /** Callback when transaction is mined */\n onMined?: ActionCallback;\n};\n\n/**\n * Parameters for signaling an intent to use a deposit\n */\nexport type SignalIntentParams = {\n /** Payment processor name (e.g., 'wise', 'revolut') */\n processorName: string;\n /** ID of the deposit to use */\n depositId: string;\n /** Amount of tokens to transfer */\n tokenAmount: string;\n /** Payee details for the payment */\n payeeDetails: string;\n /** Recipient blockchain address */\n toAddress: string;\n /** Currency type for the payment */\n currency: CurrencyType;\n /** Callback when transaction is successfully sent */\n onSuccess?: ActionCallback;\n /** Callback when an error occurs */\n onError?: (error: Error) => void;\n /** Callback when transaction is mined */\n onMined?: ActionCallback;\n};\n\n// (removed placeholder Create/Withdraw/Cancel types; see refined forms below)\n\n/**\n * Request structure for signaling an intent via the API\n */\nexport type IntentSignalRequest = {\n /** Payment processor name */\n processorName: string;\n /** ID of the deposit */\n depositId: string;\n /** Amount of tokens */\n tokenAmount: string;\n /** Payee details */\n payeeDetails: string;\n /** Recipient address */\n toAddress: string;\n /** Fiat currency code */\n fiatCurrencyCode: string;\n /** Chain ID as string */\n chainId: string;\n};\n\n/**\n * Response from signaling an intent via the API\n */\nexport type SignalIntentResponse = {\n /** Whether the request was successful */\n success: boolean;\n /** Response message */\n message: string;\n /** Response object containing intent details */\n responseObject: {\n /** Deposit data associated with the intent */\n depositData: Record<string, string | number | boolean>;\n /** Signed intent string */\n signedIntent: string;\n /** Intent data details */\n intentData: {\n /** Deposit ID */\n depositId: string;\n /** Token amount */\n tokenAmount: string;\n /** Recipient address */\n recipientAddress: string;\n /** Verifier contract address */\n verifierAddress: string;\n /** Hash of the currency code */\n currencyCodeHash: string;\n /** Signature from the gating service */\n gatingServiceSignature: string;\n };\n };\n /** HTTP status code */\n statusCode: number;\n};\n\n/**\n * Request structure for posting deposit details\n */\nexport type PostDepositDetailsRequest = {\n /** Deposit data key-value pairs */\n depositData: { [key: string]: string };\n /** Payment processor name */\n processorName: string;\n};\n\n/**\n * Response from posting deposit details\n */\nexport type PostDepositDetailsResponse = {\n /** Whether the request was successful */\n success: boolean;\n message: string;\n responseObject: {\n id: number;\n processorName: string;\n depositData: { [key: string]: string };\n hashedOnchainId: string;\n createdAt: string;\n };\n statusCode: number;\n};\n\n/**\n * Alias types for clarity when registering payee details (makers/create)\n */\nexport type RegisterPayeeDetailsRequest = PostDepositDetailsRequest;\nexport type RegisterPayeeDetailsResponse = PostDepositDetailsResponse;\n\nexport type QuoteRequest = {\n paymentPlatforms: string[];\n fiatCurrency: string;\n user: string;\n recipient: string;\n destinationChainId: number;\n destinationToken: string;\n referrer?: string;\n useMultihop?: boolean;\n quotesToReturn?: number;\n amount: string;\n isExactFiat?: boolean;\n /** Optional filter: limit quotes to these escrow contracts */\n escrowAddresses?: string[];\n /** Enable nearby quote discovery when exact match unavailable */\n includeNearbyQuotes?: boolean;\n /** Max % deviation to search for nearby quotes (e.g., 10 = ±10%) */\n nearbySearchRange?: number;\n /** Max suggestions per direction (1-10, default: 3) */\n nearbyQuotesCount?: number;\n};\n\nexport type FiatResponse = { currencyCode: string; currencyName: string; currencySymbol: string; countryCode: string };\nexport type TokenResponse = { token: string; decimals: number; name: string; symbol: string; chainId: number };\n/**\n * Intent details within a quote response\n */\nexport type QuoteIntentResponse = {\n /** Deposit ID */\n depositId: string;\n /** Payment processor name */\n processorName: string;\n /** Amount to transfer */\n amount: string;\n /** Recipient address */\n toAddress: string;\n /** Payee details */\n payeeDetails: string;\n /** Processor-specific intent data */\n processorIntentData: Record<string, unknown>;\n /** Fiat currency code */\n fiatCurrencyCode: string;\n /** Chain ID */\n chainId: string;\n};\nexport type QuoteSingleResponse = {\n fiatAmount: string;\n fiatAmountFormatted: string;\n tokenAmount: string;\n tokenAmountFormatted: string;\n paymentMethod: string;\n payeeAddress: string;\n conversionRate: string;\n intent: QuoteIntentResponse;\n payeeData?: Record<string, string>;\n};\nexport type QuoteFeesResponse = { zkp2pFee: string; zkp2pFeeFormatted: string; swapFee: string; swapFeeFormatted: string };\n\n/**\n * A nearby quote suggestion returned when no exact match is available.\n * Fields vary based on whether request was exact-token or exact-fiat mode.\n */\nexport type NearbyQuote = {\n /** For exact-token mode: suggested token amount */\n suggestedTokenAmount?: string;\n /** For exact-token mode: formatted suggested token amount */\n suggestedTokenAmountFormatted?: string;\n /** For exact-token mode: percentage difference from requested (e.g., \"-5.0%\" or \"+10.0%\") */\n tokenPercentDifference?: string;\n /** For exact-fiat mode: suggested fiat amount */\n suggestedFiatAmount?: string;\n /** For exact-fiat mode: formatted suggested fiat amount */\n suggestedFiatAmountFormatted?: string;\n /** For exact-fiat mode: percentage difference from requested */\n fiatPercentDifference?: string;\n /** The full quote at this suggested amount */\n quote: QuoteSingleResponse;\n};\n\n/**\n * Nearby quote suggestions when no exact match is available.\n * Only present in response when includeNearbyQuotes=true and no exact quotes found.\n */\nexport type NearbySuggestions = {\n /** Quotes at amounts below the requested amount (sorted by closest first) */\n below: NearbyQuote[];\n /** Quotes at amounts above the requested amount (sorted by closest first) */\n above: NearbyQuote[];\n};\n\nexport type QuoteResponseObject = {\n fiat: FiatResponse;\n token: TokenResponse;\n quotes: QuoteSingleResponse[];\n fees: QuoteFeesResponse;\n /** Nearby suggestions when no exact quotes available (only present with includeNearbyQuotes=true) */\n nearbySuggestions?: NearbySuggestions;\n};\n\nexport type QuoteResponse = {\n message: string;\n success: boolean;\n responseObject: QuoteResponseObject;\n statusCode: number;\n};\n\n/**\n * Request to fetch payee details\n * Prefer `processorName`; `platform` kept for backward compatibility.\n */\nexport type GetPayeeDetailsRequest = { hashedOnchainId: string; processorName: string };\nexport type GetPayeeDetailsResponse = {\n success: boolean;\n message: string;\n responseObject: {\n id: number;\n processorName: string;\n depositData: { [key: string]: string };\n hashedOnchainId: string;\n createdAt: string;\n};\n statusCode: number;\n};\n\n// Makers list (presented)\nexport type ListPayeesRequest = { processorName?: string };\nexport type PresentedMaker = { id?: number; processorName: string; hashedOnchainId: string; createdAt: string };\nexport type ListPayeesResponse = { success: boolean; message: string; responseObject: PresentedMaker[]; statusCode: number };\n\nexport type ValidatePayeeDetailsRequest = {\n processorName: string;\n depositData: { [key: string]: string };\n};\n\nexport type ValidatePayeeDetailsResponse = {\n success: boolean;\n message: string;\n responseObject: { isValid: boolean; errors?: string[] };\n statusCode: number;\n};\n\n// Onchain currency and deposit verifier types used in createDeposit action\nexport type OnchainCurrency = { code: `0x${string}`; conversionRate: bigint };\nexport type DepositVerifierData = {\n intentGatingService: `0x${string}`;\n payeeDetails: string;\n data: `0x${string}`;\n};\n\n// CreateDeposit refined inputs\nexport type Range = { min: bigint; max: bigint };\nexport type CreateDepositConversionRate = { currency: CurrencyType; conversionRate: string };\nexport type CreateDepositParams = {\n token: Address;\n amount: bigint;\n intentAmountRange: Range;\n conversionRates: CreateDepositConversionRate[][];\n processorNames: string[];\n depositData: { [key: string]: string }[];\n onSuccess?: ActionCallback;\n onError?: (error: Error) => void;\n onMined?: ActionCallback;\n};\n\nexport type WithdrawDepositParams = {\n depositId: string | number | bigint;\n onSuccess?: ActionCallback;\n onError?: (error: Error) => void;\n onMined?: ActionCallback;\n};\n\nexport type CancelIntentParams = {\n intentHash: Hash;\n onSuccess?: ActionCallback;\n onError?: (error: Error) => void;\n onMined?: ActionCallback;\n};\n\n\n// Historical Event Types (for deposits and intents)\nexport type DepositStatus = 'ACTIVE' | 'WITHDRAWN' | 'CLOSED';\n\nexport type Deposit = {\n id: string;\n owner: string;\n amount: string;\n minimumIntent: string;\n maximumIntent: string;\n status: DepositStatus;\n updatedAt: Date;\n createdAt: Date;\n processorPaymentData: Array<{\n processor: string;\n paymentDetailsHash: string;\n isHashed: boolean;\n paymentDetails: string;\n updatedAt: Date;\n createdAt: Date;\n }>;\n};\n\n// API Intent status per v1 Orders API\n// Note: MANUALLY_RELEASED can occur when maker releases funds without payment verification\nexport type ApiIntentStatus = 'SIGNALED' | 'FULFILLED' | 'PRUNED' | 'MANUALLY_RELEASED';\n\nexport type Intent = {\n id: number;\n intentHash: string;\n depositId: string;\n verifier: string;\n owner: string;\n toAddress: string;\n amount: string;\n fiatCurrency: string;\n conversionRate: string;\n sustainabilityFee: string | null;\n verifierFee: string | null;\n status: ApiIntentStatus;\n signalTxHash: string;\n signalTimestamp: Date;\n fulfillTxHash: string | null;\n fulfillTimestamp: Date | null;\n pruneTxHash: string | null;\n prunedTimestamp: Date | null;\n createdAt: Date;\n updatedAt: Date;\n};\n\nexport type GetOwnerIntentsRequest = {\n ownerAddress: string;\n status?: ApiIntentStatus | ApiIntentStatus[];\n};\n\nexport type GetOwnerIntentsResponse = {\n success: boolean;\n message: string;\n responseObject: Intent[];\n statusCode: number;\n};\n\n// Orders API types\nexport type GetIntentsByDepositRequest = {\n depositId: string;\n status?: ApiIntentStatus | ApiIntentStatus[];\n};\n\nexport type GetIntentsByDepositResponse = {\n success: boolean;\n message: string;\n responseObject: Intent[];\n statusCode: number;\n};\n\nexport type GetIntentsByTakerRequest = {\n takerAddress: string;\n status?: ApiIntentStatus | ApiIntentStatus[];\n};\n\nexport type GetIntentsByTakerResponse = {\n success: boolean;\n message: string;\n responseObject: Intent[];\n statusCode: number;\n};\n\nexport type GetIntentsByRecipientRequest = {\n recipientAddress: string;\n status?: ApiIntentStatus | ApiIntentStatus[];\n};\n\nexport type GetIntentsByRecipientResponse = {\n success: boolean;\n message: string;\n responseObject: Intent[];\n statusCode: number;\n};\n\nexport type GetIntentByHashRequest = {\n intentHash: string;\n};\n\nexport type GetIntentByHashResponse = {\n success: boolean;\n message: string;\n responseObject: Intent;\n statusCode: number;\n};\n\n// Deposits API types aligned with v1\nexport type DepositVerifierCurrency = { id?: number; depositVerifierId?: number; currencyCode: string; conversionRate: string; createdAt?: Date; updatedAt?: Date };\nexport type DepositVerifier = { id?: number; depositId: number; verifier: string; intentGatingService: string; payeeDetailsHash: string; data: string; createdAt?: Date; updatedAt?: Date; currencies: DepositVerifierCurrency[] };\nexport type ApiDeposit = {\n id: number;\n depositor: string;\n token: string;\n amount: string;\n remainingDeposits: string;\n intentAmountMin: string;\n intentAmountMax: string;\n acceptingIntents: boolean;\n outstandingIntentAmount: string;\n availableLiquidity: string;\n status: 'ACTIVE' | 'WITHDRAWN' | 'CLOSED';\n totalIntents: number;\n signaledIntents: number;\n fulfilledIntents: number;\n prunedIntents: number;\n createdAt?: Date;\n updatedAt?: Date;\n verifiers: DepositVerifier[];\n};\n\nexport type GetOwnerDepositsRequest = {\n ownerAddress: string;\n /** Optional status filter: 'ACTIVE' | 'WITHDRAWN' | 'CLOSED' */\n status?: DepositStatus;\n};\n\nexport type GetOwnerDepositsResponse = {\n success: boolean;\n message: string;\n responseObject: ApiDeposit[];\n statusCode: number;\n};\n\nexport type GetDepositByIdRequest = { depositId: string };\nexport type GetDepositByIdResponse = { success: boolean; message: string; responseObject: ApiDeposit; statusCode: number };\n\n// Intent/order statistics returned by `/deposits/order-stats`\nexport type OrderStats = {\n id: number;\n totalIntents: number;\n signaledIntents: number;\n fulfilledIntents: number;\n prunedIntents: number;\n};\n\n// Kept for backward compatibility\nexport type DepositIntentStatistics = OrderStats;\nexport type GetDepositsOrderStatsRequest = { depositIds: number[] };\nexport type GetDepositsOrderStatsResponse = { success: boolean; message: string; responseObject: OrderStats[]; statusCode: number };\n\n// Taker tier API types\nexport type TakerTierStats = {\n lifetimeSignaledCount: number;\n lifetimeFulfilledCount: number;\n lifetimeManualReleaseCount: number;\n lifetimePruneCount: number;\n totalCancelledVolume: string;\n totalFulfilledVolume: string;\n lockScore: string;\n lockScoreDiluted: string;\n firstSeenAt: string;\n lastIntentAt: string;\n updatedAt: string;\n};\n\nexport type TakerTierLevel = 'PEASANT' | 'PEER' | 'PLUS' | 'PRO' | 'PLATINUM' | 'PEER_PRESIDENT';\nexport type PlatformRiskLevel = 'LOW' | 'MEDIUM_HIGH' | 'HIGH' | 'HIGHEST';\n\nexport type PlatformLimit = {\n paymentMethodHash: string;\n platformName: string;\n riskLevel: PlatformRiskLevel;\n capMultiplier: number;\n effectiveCap: string;\n effectiveCapDisplay: string;\n hasCooldown: boolean;\n cooldownHours: number;\n isLocked: boolean;\n minTierRequired: TakerTierLevel | null;\n};\n\nexport type TakerTier = {\n owner: string;\n chainId: number;\n tier: TakerTierLevel;\n perIntentCapBaseUnits: string;\n perIntentCapDisplay: string;\n lastUpdated: string;\n source: 'computed' | 'fallback';\n stats: TakerTierStats | null;\n cooldownHours: number;\n cooldownSeconds: number;\n cooldownActive: boolean;\n cooldownRemainingSeconds: number;\n nextIntentAvailableAt: string | null;\n platformLimits?: PlatformLimit[];\n};\n\nexport type GetTakerTierRequest = {\n owner: string;\n chainId: number;\n};\n\nexport type GetTakerTierResponse = {\n success: boolean;\n message: string;\n responseObject: TakerTier;\n statusCode?: number;\n};\n\n// Currency domain (ISO) and on-chain currency mapping\nexport { Currency } from '../utils/currency';\nexport type { CurrencyType } from '../utils/currency';\n\n// Payment platforms (derived as a closed union for safety)\nexport const PAYMENT_PLATFORMS = [\n 'wise',\n 'venmo',\n 'revolut',\n 'cashapp',\n 'mercadopago',\n 'zelle',\n 'paypal',\n 'monzo',\n] as const;\nexport type PaymentPlatformType = typeof PAYMENT_PLATFORMS[number];\n\n\n// On-chain views\nexport type { EscrowDepositView, EscrowIntentView } from './escrowViews';\n","import type { Address } from 'viem';\n\n// Unversioned base; callers/providers must append /v1 or /v2 in adapters\nexport const DEFAULT_BASE_API_URL = 'https://api.zkp2p.xyz';\nexport const DEFAULT_WITNESS_URL = 'https://witness-proxy.zkp2p.xyz';\n\n// Enabled payment platforms (verifiers) for enrichment and platform-aware logic\nexport const ENABLED_PLATFORMS = [\n 'venmo',\n 'revolut',\n 'cashapp',\n 'wise',\n 'mercadopago',\n 'zelle',\n 'paypal',\n 'monzo',\n] as const;\n\nexport type EnabledPlatform = (typeof ENABLED_PLATFORMS)[number];\n\ntype PlatformAddresses = { [P in EnabledPlatform]: Address };\n\nexport type ContractSet = PlatformAddresses & {\n usdc: Address;\n escrow: Address;\n gatingService: Address;\n zkp2pWitnessSigner: Address;\n};\n\ntype Contracts = {\n [chainId: number]:\n | ContractSet\n | {\n production: ContractSet;\n staging: ContractSet;\n };\n};\n\nexport const DEPLOYED_ADDRESSES: Contracts = {\n 8453: {\n production: {\n // external contracts\n usdc: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',\n \n // escrow + verifiers\n escrow: '0xCA38607D85E8F6294Dc10728669605E6664C2D70',\n \n // Processor names to deployed addresses\n venmo: '0x9a733B55a875D0DB4915c6B36350b24F8AB99dF5',\n revolut: '0xAA5A1B62B01781E789C900d616300717CD9A41aB',\n cashapp: '0x76D33A33068D86016B806dF02376dDBb23Dd3703',\n wise: '0xFF0149799631D7A5bdE2e7eA9b306c42b3d9a9ca',\n mercadopago: '0xf2AC5be14F32Cbe6A613CFF8931d95460D6c33A3',\n zelle: '0x431a078A5029146aAB239c768A615CD484519aF7',\n paypal: '0x03d17E9371C858072E171276979f6B44571C5DeA',\n monzo: '0x0dE46433bD251027f73eD8f28E01eF05DA36a2E0',\n \n // offchain services\n gatingService: '0x396D31055Db28C0C6f36e8b36f18FE7227248a97',\n zkp2pWitnessSigner: '0x0636c417755E3ae25C6c166D181c0607F4C572A3',\n },\n staging: {\n // external contracts\n usdc: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',\n \n // escrow + verifiers\n escrow: '0xC8cd114C6274Ef1066840337E7678BC9731BEa68',\n \n // Processor names to deployed addresses\n venmo: '0xCE6454f272127ba69e8C8128B92F2388Ca343257',\n revolut: '0xb941e69B6C1A23A88cf9DA7D243bAE1D2Cb8eb6b',\n cashapp: '0xdDB9d452180398F456Fe89A43Df9C65B19756CEa',\n wise: '0x79F35E2f65ff917BE35686d34932C8Ef5a30631f',\n mercadopago: '0xA2d54F983B8201c7b276C9705641C49C2FBD1A36',\n zelle: '0x0Ed3c3DB9CF8458e5D9991712552539675D2C896',\n paypal: '0xB07764999679a9136d6853a5D4c70449afbfc2f8',\n monzo: '0x179792F99C0eFBFa06c3F6747989a96c58544f6F',\n \n // offchain services\n gatingService: '0x396D31055Db28C0C6f36e8b36f18FE7227248a97',\n zkp2pWitnessSigner: '0x0636c417755E3ae25C6c166D181c0607F4C572A3',\n },\n },\n 84532: {\n usdc: '0x17463cb89A62c7b4A5ecD949aFDEDBD0Aa047ad1',\n escrow: '0x15EF83EBB422B4AC8e3b8393d016Ed076dc50CB7',\n venmo: '0x8499f2e7c4496Acfe0D7Ca5C7b6522514877b33F',\n revolut: '0x7E34909A1C1b2a4D2FAbA61c17a0F59ECAce6F29',\n cashapp: '0xe4148B108Fe4D7421853FE8cFfd35bDc2c0d95Ec',\n wise: '0x54c92a8828A393C5A6D1DfbB71d0e9e97329b39C',\n mercadopago: '0x4367155Fe7BAA99d9AE99fE4F6aC1b8E87012e6b',\n zelle: '0xbeeC239145b3c461422BC2fC45B78E5fd70862F1',\n paypal: '0xC8cd114C6274Ef1066840337E7678BC9731BEa68',\n monzo: '0xe2B378D9181046c84dB1156B0F90cF3108e25E9D',\n \n gatingService: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',\n zkp2pWitnessSigner: '0x0636c417755E3ae25C6c166D181c0607F4C572A3',\n },\n 31337: {\n usdc: '0x5FbDB2315678afecb367f032d93F642f64180aa3',\n escrow: '0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512',\n venmo: '0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9',\n revolut: '0xa513E6E4b8f2a923D98304ec87F64353C4D5C853',\n cashapp: '0x610178dA211FEF7D417bC0e6FeD39F05609AD788',\n wise: '0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82',\n mercadopago: '0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1',\n zelle: '0x3Aa5ebB10DC797CAC828524e59A333d0A371443c',\n paypal: '0xE6E340D132b5f46d1e472DebcD681B2aBc16e57E',\n monzo: '0x9E545E3C0baAB3E08CdfD552C960A1050f373042',\n \n // offchain services\n gatingService: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', // Hardhat 0\n zkp2pWitnessSigner: '0x0636c417755E3ae25C6c166D181c0607F4C572A3',\n },\n};\n\nexport function getPlatformAddressMap(\n addresses: ContractSet\n): Record<EnabledPlatform, Address> {\n const entries = ENABLED_PLATFORMS.map((p) => [p, addresses[p]] as const);\n return Object.fromEntries(entries) as Record<EnabledPlatform, Address>;\n}\n\nexport function platformFromVerifierAddress(\n addresses: ContractSet,\n verifierAddress: string\n): EnabledPlatform | null {\n if (!verifierAddress) return null;\n const target = verifierAddress.toLowerCase();\n for (const p of ENABLED_PLATFORMS) {\n const addr = addresses[p]?.toLowerCase?.();\n if (addr && addr === target) return p;\n }\n return null;\n}\n","/**\n * SDK Constants\n *\n * This module exports all public constants for the SDK including:\n * - Payment platforms (Wise, Venmo, Revolut, etc.)\n * - Currencies (USD, EUR, GBP, etc.)\n * - Chain IDs and network configuration\n * - Token metadata\n *\n * @module constants\n */\n\n// Payment platforms\nexport { PAYMENT_PLATFORMS, type PaymentPlatformType } from './types';\n\n// Currencies\nexport { Currency, currencyInfo } from './utils/currency';\nexport type { CurrencyType, CurrencyData } from './utils/currency';\n\n// Contract addresses and deployment info\nexport { DEPLOYED_ADDRESSES } from './utils/constants';\n\n// API URLs\nexport { DEFAULT_BASE_API_URL, DEFAULT_WITNESS_URL } from './utils/constants';\n\n/**\n * Supported blockchain chain IDs.\n *\n * @example\n * ```typescript\n * import { SUPPORTED_CHAIN_IDS } from '@zkp2p/client-sdk';\n *\n * const client = new Zkp2pClient({\n * chainId: SUPPORTED_CHAIN_IDS.BASE_MAINNET,\n * // ...\n * });\n * ```\n */\nexport const SUPPORTED_CHAIN_IDS = {\n /** Base mainnet (8453) */\n BASE_MAINNET: 8453,\n /** Base Sepolia testnet (84532) */\n BASE_SEPOLIA: 84532,\n /** Scroll mainnet (534352) */\n SCROLL_MAINNET: 534352,\n /** Local Hardhat network (31337) */\n HARDHAT: 31337,\n} as const;\n\n/**\n * Union type of supported chain IDs.\n */\nexport type SupportedChainId = typeof SUPPORTED_CHAIN_IDS[keyof typeof SUPPORTED_CHAIN_IDS];\n\n/**\n * Metadata for each supported payment platform.\n *\n * Includes display names, logos, and the number of proofs required\n * for payment verification.\n */\nexport const PLATFORM_METADATA = {\n venmo: {\n name: 'Venmo',\n displayName: 'Venmo',\n logo: '💵',\n requiredProofs: 1,\n },\n revolut: {\n name: 'Revolut',\n displayName: 'Revolut',\n logo: '💳',\n requiredProofs: 1,\n },\n cashapp: {\n name: 'CashApp',\n displayName: 'Cash App',\n logo: '💸',\n requiredProofs: 1,\n },\n wise: {\n name: 'Wise',\n displayName: 'Wise',\n logo: '🌍',\n requiredProofs: 2,\n },\n mercadopago: {\n name: 'MercadoPago',\n displayName: 'Mercado Pago',\n logo: '💰',\n requiredProofs: 1,\n },\n zelle: {\n name: 'Zelle',\n displayName: 'Zelle',\n logo: '💲',\n requiredProofs: 1,\n },\n paypal: {\n name: 'PayPal',\n displayName: 'PayPal',\n logo: '💙',\n requiredProofs: 1,\n },\n monzo: {\n name: 'Monzo',\n displayName: 'Monzo',\n logo: '🏦',\n requiredProofs: 1,\n },\n} as const;\n\n/**\n * Token metadata for supported tokens.\n */\nexport const TOKEN_METADATA = {\n USDC: {\n symbol: 'USDC',\n decimals: 6,\n name: 'USD Coin',\n },\n} as const;\n\n/**\n * Attestation service configuration for each payment platform.\n *\n * Maps platform names to their corresponding action types for the\n * attestation service endpoints.\n *\n * @internal Used internally by fulfillIntent\n */\nexport const PLATFORM_ATTESTATION_CONFIG: Record<string, { actionType: string; actionPlatform: string }> = {\n wise: { actionType: 'transfer_wise', actionPlatform: 'wise' },\n venmo: { actionType: 'transfer_venmo', actionPlatform: 'venmo' },\n revolut: { actionType: 'transfer_revolut', actionPlatform: 'revolut' },\n cashapp: { actionType: 'transfer_cashapp', actionPlatform: 'cashapp' },\n mercadopago: { actionType: 'transfer_mercadopago', actionPlatform: 'mercadopago' },\n paypal: { actionType: 'transfer_paypal', actionPlatform: 'paypal' },\n monzo: { actionType: 'transfer_monzo', actionPlatform: 'monzo' },\n 'zelle-chase': { actionType: 'transfer_zelle', actionPlatform: 'chase' },\n 'zelle-bofa': { actionType: 'transfer_zelle', actionPlatform: 'bankofamerica' },\n 'zelle-citi': { actionType: 'transfer_zelle', actionPlatform: 'citi' },\n} as const;\n\n/**\n * Resolves attestation platform configuration for a given payment platform.\n *\n * @param platformName - The payment platform name (e.g., 'wise', 'venmo', 'zelle-citi')\n * @returns Attestation configuration with actionType and actionPlatform\n * @throws Error if the platform is not supported\n *\n * @internal Used internally by fulfillIntent\n */\nexport function resolvePlatformAttestationConfig(platformName: string): { actionType: string; actionPlatform: string } {\n const normalized = platformName.toLowerCase();\n const config = PLATFORM_ATTESTATION_CONFIG[normalized];\n if (!config) {\n throw new Error(`Unknown payment platform: ${platformName}`);\n }\n return config;\n}\n"]}
1
+ {"version":3,"sources":["../src/types/index.ts","../src/utils/constants.ts","../src/constants.ts"],"names":[],"mappings":";AAwmBO,IAAM,iBAAA,GAAoB;AAAA,EAC/B,MAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,aAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF;;;AC9mBO,IAAM,oBAAA,GAAuB;AAC7B,IAAM,mBAAA,GAAsB;AAkC5B,IAAM,kBAAA,GAAgC;AAAA,EAC3C,IAAA,EAAM;AAAA,IACJ,UAAA,EAAY;AAAA;AAAA,MAEV,IAAA,EAAM,4CAAA;AAAA;AAAA,MAG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UAAA,EAAY,gBAAA,EAAkB,gBAAgB,OAAA,EAAQ;AAAA,EACvE,YAAA,EAAc,EAAE,UAAA,EAAY,gBAAA,EAAkB,gBAAgB,eAAA,EAAgB;AAAA,EAC9E,YAAA,EAAc,EAAE,UAAA,EAAY,gBAAA,EAAkB,gBAAgB,MAAA;AAChE;AAWO,SAAS,iCAAiC,YAAA,EAAsE;AACrH,EAAA,MAAM,UAAA,GAAa,aAAa,WAAA,EAAY;AAC5C,EAAA,MAAM,MAAA,GAAS,4BAA4B,UAAU,CAAA;AACrD,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,0BAAA,EAA6B,YAAY,CAAA,CAAE,CAAA;AAAA,EAC7D;AACA,EAAA,OAAO,MAAA;AACT","file":"chunk-P3NOBRQB.mjs","sourcesContent":["// Minimal initial type surface for Offramp SDK\nimport type { AccessList, Address, AuthorizationList, Hash, WalletClient } from 'viem';\nimport type { CurrencyType } from '../utils/currency';\n\n/**\n * Timeout configuration for different operation types\n */\nexport type TimeoutConfig = {\n /** API call timeout in milliseconds (default: 30000) */\n api?: number;\n /** Transaction timeout in milliseconds (default: 60000) */\n transaction?: number;\n};\n\nexport type Zkp2pClientOptions = {\n walletClient: WalletClient;\n apiKey: string;\n chainId: number;\n environment?: 'production' | 'staging';\n baseApiUrl?: string;\n witnessUrl?: string;\n rpcUrl?: string;\n /** Optional bearer token for hybrid auth */\n authorizationToken?: string;\n /** Optional timeout configuration */\n timeouts?: TimeoutConfig;\n};\n\n/**\n * Callback function for transaction actions\n * @param params - Transaction callback parameters\n * @param params.hash - Transaction hash\n * @param params.data - Optional additional data from the transaction\n */\nexport type ActionCallback = (params: { hash: Hash; data?: unknown }) => void;\n\n/**\n * Safe transaction overrides including ERC-8021 referrers.\n * Referrer codes are prepended before the Base builder code (bc_nbn6qkni).\n */\nexport type TxOverrides = {\n gas?: bigint;\n gasPrice?: bigint;\n maxFeePerGas?: bigint;\n maxPriorityFeePerGas?: bigint;\n nonce?: number;\n value?: bigint;\n accessList?: AccessList;\n authorizationList?: AuthorizationList;\n /**\n * ERC-8021 referrer code(s) to prepend before the Base builder code.\n * Accepts a single code or multiple (e.g., ['zkp2p-bot', 'merchant-id']).\n */\n referrer?: string | string[];\n};\n\n/**\n * Parameters for fulfilling an intent with payment attestation\n */\nexport type FulfillIntentParams = {\n /** Hash of the intent to fulfill */\n intentHash: Hash;\n /** Attestation proof - object or stringified JSON from attestation service */\n proof: Record<string, unknown> | string;\n /** Optional attestation timestamp buffer override in milliseconds */\n timestampBufferMs?: number | string;\n /** Override the attestation service base URL */\n attestationServiceUrl?: string;\n /** Override the verifying contract (defaults to UnifiedPaymentVerifier) */\n verifyingContract?: Address;\n /** Optional hook payload passed to orchestrator */\n postIntentHookData?: `0x${string}`;\n /** Optional viem transaction overrides */\n txOverrides?: TxOverrides;\n /** Optional lifecycle callbacks */\n callbacks?: {\n onAttestationStart?: () => void;\n onTxSent?: (hash: Hash) => void;\n onTxMined?: (hash: Hash) => void;\n };\n};\n\n/**\n * Parameters for releasing funds back to the payer\n */\nexport type ReleaseFundsToPayerParams = {\n /** Hash of the intent to release funds for */\n intentHash: Hash;\n /** Callback when transaction is successfully sent */\n onSuccess?: ActionCallback;\n /** Callback when an error occurs */\n onError?: (error: Error) => void;\n /** Callback when transaction is mined */\n onMined?: ActionCallback;\n};\n\n/**\n * Parameters for signaling an intent to use a deposit\n */\nexport type SignalIntentParams = {\n /** Payment processor name (e.g., 'wise', 'revolut') */\n processorName: string;\n /** ID of the deposit to use */\n depositId: string;\n /** Amount of tokens to transfer */\n tokenAmount: string;\n /** Payee details for the payment */\n payeeDetails: string;\n /** Recipient blockchain address */\n toAddress: string;\n /** Currency type for the payment */\n currency: CurrencyType;\n /** Callback when transaction is successfully sent */\n onSuccess?: ActionCallback;\n /** Callback when an error occurs */\n onError?: (error: Error) => void;\n /** Callback when transaction is mined */\n onMined?: ActionCallback;\n};\n\n// (removed placeholder Create/Withdraw/Cancel types; see refined forms below)\n\n/**\n * Request structure for signaling an intent via the API\n */\nexport type IntentSignalRequest = {\n /** Payment processor name */\n processorName: string;\n /** ID of the deposit */\n depositId: string;\n /** Amount of tokens */\n tokenAmount: string;\n /** Payee details */\n payeeDetails: string;\n /** Recipient address */\n toAddress: string;\n /** Fiat currency code */\n fiatCurrencyCode: string;\n /** Chain ID as string */\n chainId: string;\n};\n\n/**\n * Response from signaling an intent via the API\n */\nexport type SignalIntentResponse = {\n /** Whether the request was successful */\n success: boolean;\n /** Response message */\n message: string;\n /** Response object containing intent details */\n responseObject: {\n /** Deposit data associated with the intent */\n depositData: Record<string, string | number | boolean>;\n /** Signed intent string */\n signedIntent: string;\n /** Intent data details */\n intentData: {\n /** Deposit ID */\n depositId: string;\n /** Token amount */\n tokenAmount: string;\n /** Recipient address */\n recipientAddress: string;\n /** Verifier contract address */\n verifierAddress: string;\n /** Hash of the currency code */\n currencyCodeHash: string;\n /** Signature from the gating service */\n gatingServiceSignature: string;\n };\n };\n /** HTTP status code */\n statusCode: number;\n};\n\n/**\n * Request structure for posting deposit details\n */\nexport type PostDepositDetailsRequest = {\n /** Deposit data key-value pairs */\n depositData: { [key: string]: string };\n /** Payment processor name */\n processorName: string;\n};\n\n/**\n * Response from posting deposit details\n */\nexport type PostDepositDetailsResponse = {\n /** Whether the request was successful */\n success: boolean;\n message: string;\n responseObject: {\n id: number;\n processorName: string;\n depositData: { [key: string]: string };\n hashedOnchainId: string;\n createdAt: string;\n };\n statusCode: number;\n};\n\n/**\n * Alias types for clarity when registering payee details (makers/create)\n */\nexport type RegisterPayeeDetailsRequest = PostDepositDetailsRequest;\nexport type RegisterPayeeDetailsResponse = PostDepositDetailsResponse;\n\nexport type QuoteRequest = {\n paymentPlatforms: string[];\n fiatCurrency: string;\n user: string;\n recipient: string;\n destinationChainId: number;\n destinationToken: string;\n referrer?: string;\n useMultihop?: boolean;\n quotesToReturn?: number;\n amount: string;\n isExactFiat?: boolean;\n /** Optional filter: limit quotes to these escrow contracts */\n escrowAddresses?: string[];\n /** Enable nearby quote discovery when exact match unavailable */\n includeNearbyQuotes?: boolean;\n /** Max % deviation to search for nearby quotes (e.g., 10 = ±10%) */\n nearbySearchRange?: number;\n /** Max suggestions per direction (1-10, default: 3) */\n nearbyQuotesCount?: number;\n};\n\nexport type FiatResponse = { currencyCode: string; currencyName: string; currencySymbol: string; countryCode: string };\nexport type TokenResponse = { token: string; decimals: number; name: string; symbol: string; chainId: number };\n/**\n * Intent details within a quote response\n */\nexport type QuoteIntentResponse = {\n /** Deposit ID */\n depositId: string;\n /** Payment processor name */\n processorName: string;\n /** Amount to transfer */\n amount: string;\n /** Recipient address */\n toAddress: string;\n /** Payee details */\n payeeDetails: string;\n /** Processor-specific intent data */\n processorIntentData: Record<string, unknown>;\n /** Fiat currency code */\n fiatCurrencyCode: string;\n /** Chain ID */\n chainId: string;\n};\nexport type QuoteSingleResponse = {\n fiatAmount: string;\n fiatAmountFormatted: string;\n tokenAmount: string;\n tokenAmountFormatted: string;\n paymentMethod: string;\n payeeAddress: string;\n conversionRate: string;\n intent: QuoteIntentResponse;\n payeeData?: Record<string, string>;\n};\nexport type QuoteFeesResponse = { zkp2pFee: string; zkp2pFeeFormatted: string; swapFee: string; swapFeeFormatted: string };\n\n/**\n * A nearby quote suggestion returned when no exact match is available.\n * Fields vary based on whether request was exact-token or exact-fiat mode.\n */\nexport type NearbyQuote = {\n /** For exact-token mode: suggested token amount */\n suggestedTokenAmount?: string;\n /** For exact-token mode: formatted suggested token amount */\n suggestedTokenAmountFormatted?: string;\n /** For exact-token mode: percentage difference from requested (e.g., \"-5.0%\" or \"+10.0%\") */\n tokenPercentDifference?: string;\n /** For exact-fiat mode: suggested fiat amount */\n suggestedFiatAmount?: string;\n /** For exact-fiat mode: formatted suggested fiat amount */\n suggestedFiatAmountFormatted?: string;\n /** For exact-fiat mode: percentage difference from requested */\n fiatPercentDifference?: string;\n /** The full quote at this suggested amount */\n quote: QuoteSingleResponse;\n};\n\n/**\n * Nearby quote suggestions when no exact match is available.\n * Only present in response when includeNearbyQuotes=true and no exact quotes found.\n */\nexport type NearbySuggestions = {\n /** Quotes at amounts below the requested amount (sorted by closest first) */\n below: NearbyQuote[];\n /** Quotes at amounts above the requested amount (sorted by closest first) */\n above: NearbyQuote[];\n};\n\nexport type QuoteResponseObject = {\n fiat: FiatResponse;\n token: TokenResponse;\n quotes: QuoteSingleResponse[];\n fees: QuoteFeesResponse;\n /** Nearby suggestions when no exact quotes available (only present with includeNearbyQuotes=true) */\n nearbySuggestions?: NearbySuggestions;\n};\n\nexport type QuoteResponse = {\n message: string;\n success: boolean;\n responseObject: QuoteResponseObject;\n statusCode: number;\n};\n\n/**\n * Request to fetch payee details\n * Prefer `processorName`; `platform` kept for backward compatibility.\n */\nexport type GetPayeeDetailsRequest = { hashedOnchainId: string; processorName: string };\nexport type GetPayeeDetailsResponse = {\n success: boolean;\n message: string;\n responseObject: {\n id: number;\n processorName: string;\n depositData: { [key: string]: string };\n hashedOnchainId: string;\n createdAt: string;\n};\n statusCode: number;\n};\n\n// Makers list (presented)\nexport type ListPayeesRequest = { processorName?: string };\nexport type PresentedMaker = { id?: number; processorName: string; hashedOnchainId: string; createdAt: string };\nexport type ListPayeesResponse = { success: boolean; message: string; responseObject: PresentedMaker[]; statusCode: number };\n\nexport type ValidatePayeeDetailsRequest = {\n processorName: string;\n depositData: { [key: string]: string };\n};\n\nexport type ValidatePayeeDetailsResponse = {\n success: boolean;\n message: string;\n responseObject: { isValid: boolean; errors?: string[] };\n statusCode: number;\n};\n\n// Onchain currency and deposit verifier types used in createDeposit action\nexport type OnchainCurrency = { code: `0x${string}`; conversionRate: bigint };\nexport type DepositVerifierData = {\n intentGatingService: `0x${string}`;\n payeeDetails: string;\n data: `0x${string}`;\n};\n\n// CreateDeposit refined inputs\nexport type Range = { min: bigint; max: bigint };\nexport type CreateDepositConversionRate = { currency: CurrencyType; conversionRate: string };\nexport type CreateDepositParams = {\n token: Address;\n amount: bigint;\n intentAmountRange: Range;\n conversionRates: CreateDepositConversionRate[][];\n processorNames: string[];\n depositData: { [key: string]: string }[];\n onSuccess?: ActionCallback;\n onError?: (error: Error) => void;\n onMined?: ActionCallback;\n};\n\nexport type WithdrawDepositParams = {\n depositId: string | number | bigint;\n onSuccess?: ActionCallback;\n onError?: (error: Error) => void;\n onMined?: ActionCallback;\n};\n\nexport type CancelIntentParams = {\n intentHash: Hash;\n onSuccess?: ActionCallback;\n onError?: (error: Error) => void;\n onMined?: ActionCallback;\n};\n\n\n// Historical Event Types (for deposits and intents)\nexport type DepositStatus = 'ACTIVE' | 'WITHDRAWN' | 'CLOSED';\n\nexport type Deposit = {\n id: string;\n owner: string;\n amount: string;\n minimumIntent: string;\n maximumIntent: string;\n status: DepositStatus;\n updatedAt: Date;\n createdAt: Date;\n processorPaymentData: Array<{\n processor: string;\n paymentDetailsHash: string;\n isHashed: boolean;\n paymentDetails: string;\n updatedAt: Date;\n createdAt: Date;\n }>;\n};\n\n// API Intent status per v1 Orders API\n// Note: MANUALLY_RELEASED can occur when maker releases funds without payment verification\nexport type ApiIntentStatus = 'SIGNALED' | 'FULFILLED' | 'PRUNED' | 'MANUALLY_RELEASED';\n\nexport type Intent = {\n id: number;\n intentHash: string;\n depositId: string;\n verifier: string;\n owner: string;\n toAddress: string;\n amount: string;\n fiatCurrency: string;\n conversionRate: string;\n sustainabilityFee: string | null;\n verifierFee: string | null;\n status: ApiIntentStatus;\n signalTxHash: string;\n signalTimestamp: Date;\n fulfillTxHash: string | null;\n fulfillTimestamp: Date | null;\n pruneTxHash: string | null;\n prunedTimestamp: Date | null;\n createdAt: Date;\n updatedAt: Date;\n};\n\nexport type GetOwnerIntentsRequest = {\n ownerAddress: string;\n status?: ApiIntentStatus | ApiIntentStatus[];\n};\n\nexport type GetOwnerIntentsResponse = {\n success: boolean;\n message: string;\n responseObject: Intent[];\n statusCode: number;\n};\n\n// Orders API types\nexport type GetIntentsByDepositRequest = {\n depositId: string;\n status?: ApiIntentStatus | ApiIntentStatus[];\n};\n\nexport type GetIntentsByDepositResponse = {\n success: boolean;\n message: string;\n responseObject: Intent[];\n statusCode: number;\n};\n\nexport type GetIntentsByTakerRequest = {\n takerAddress: string;\n status?: ApiIntentStatus | ApiIntentStatus[];\n};\n\nexport type GetIntentsByTakerResponse = {\n success: boolean;\n message: string;\n responseObject: Intent[];\n statusCode: number;\n};\n\nexport type GetIntentsByRecipientRequest = {\n recipientAddress: string;\n status?: ApiIntentStatus | ApiIntentStatus[];\n};\n\nexport type GetIntentsByRecipientResponse = {\n success: boolean;\n message: string;\n responseObject: Intent[];\n statusCode: number;\n};\n\nexport type GetIntentByHashRequest = {\n intentHash: string;\n};\n\nexport type GetIntentByHashResponse = {\n success: boolean;\n message: string;\n responseObject: Intent;\n statusCode: number;\n};\n\n// Deposits API types aligned with v1\nexport type DepositVerifierCurrency = { id?: number; depositVerifierId?: number; currencyCode: string; conversionRate: string; createdAt?: Date; updatedAt?: Date };\nexport type DepositVerifier = { id?: number; depositId: number; verifier: string; intentGatingService: string; payeeDetailsHash: string; data: string; createdAt?: Date; updatedAt?: Date; currencies: DepositVerifierCurrency[] };\nexport type ApiDeposit = {\n id: number;\n depositor: string;\n token: string;\n amount: string;\n remainingDeposits: string;\n intentAmountMin: string;\n intentAmountMax: string;\n acceptingIntents: boolean;\n outstandingIntentAmount: string;\n availableLiquidity: string;\n status: 'ACTIVE' | 'WITHDRAWN' | 'CLOSED';\n totalIntents: number;\n signaledIntents: number;\n fulfilledIntents: number;\n prunedIntents: number;\n createdAt?: Date;\n updatedAt?: Date;\n verifiers: DepositVerifier[];\n};\n\nexport type GetOwnerDepositsRequest = {\n ownerAddress: string;\n /** Optional status filter: 'ACTIVE' | 'WITHDRAWN' | 'CLOSED' */\n status?: DepositStatus;\n};\n\nexport type GetOwnerDepositsResponse = {\n success: boolean;\n message: string;\n responseObject: ApiDeposit[];\n statusCode: number;\n};\n\nexport type GetDepositByIdRequest = { depositId: string };\nexport type GetDepositByIdResponse = { success: boolean; message: string; responseObject: ApiDeposit; statusCode: number };\n\n// Intent/order statistics returned by `/deposits/order-stats`\nexport type OrderStats = {\n id: number;\n totalIntents: number;\n signaledIntents: number;\n fulfilledIntents: number;\n prunedIntents: number;\n};\n\n// Kept for backward compatibility\nexport type DepositIntentStatistics = OrderStats;\nexport type GetDepositsOrderStatsRequest = { depositIds: number[] };\nexport type GetDepositsOrderStatsResponse = { success: boolean; message: string; responseObject: OrderStats[]; statusCode: number };\n\n// Taker tier API types\nexport type TakerTierStats = {\n lifetimeSignaledCount: number;\n lifetimeFulfilledCount: number;\n lifetimeManualReleaseCount: number;\n lifetimePruneCount: number;\n totalCancelledVolume: string;\n totalFulfilledVolume: string;\n lockScore: string;\n lockScoreDiluted: string;\n firstSeenAt: string;\n lastIntentAt: string;\n updatedAt: string;\n};\n\nexport type TakerTierLevel = 'PEASANT' | 'PEER' | 'PLUS' | 'PRO' | 'PLATINUM' | 'PEER_PRESIDENT';\nexport type PlatformRiskLevel = 'LOW' | 'MEDIUM_HIGH' | 'HIGH' | 'HIGHEST';\n\nexport type PlatformLimit = {\n paymentMethodHash: string;\n platformName: string;\n riskLevel: PlatformRiskLevel;\n capMultiplier: number;\n effectiveCap: string;\n effectiveCapDisplay: string;\n hasCooldown: boolean;\n cooldownHours: number;\n isLocked: boolean;\n minTierRequired: TakerTierLevel | null;\n};\n\nexport type TakerTier = {\n owner: string;\n chainId: number;\n tier: TakerTierLevel;\n perIntentCapBaseUnits: string;\n perIntentCapDisplay: string;\n lastUpdated: string;\n source: 'computed' | 'fallback';\n stats: TakerTierStats | null;\n cooldownHours: number;\n cooldownSeconds: number;\n cooldownActive: boolean;\n cooldownRemainingSeconds: number;\n nextIntentAvailableAt: string | null;\n platformLimits?: PlatformLimit[];\n};\n\nexport type GetTakerTierRequest = {\n owner: string;\n chainId: number;\n};\n\nexport type GetTakerTierResponse = {\n success: boolean;\n message: string;\n responseObject: TakerTier;\n statusCode?: number;\n};\n\n// Currency domain (ISO) and on-chain currency mapping\nexport { Currency } from '../utils/currency';\nexport type { CurrencyType } from '../utils/currency';\n\n// Payment platforms (derived as a closed union for safety)\nexport const PAYMENT_PLATFORMS = [\n 'wise',\n 'venmo',\n 'revolut',\n 'cashapp',\n 'mercadopago',\n 'zelle',\n 'paypal',\n 'monzo',\n] as const;\nexport type PaymentPlatformType = typeof PAYMENT_PLATFORMS[number];\n\n\n// On-chain views\nexport type { EscrowDepositView, EscrowIntentView } from './escrowViews';\n","import type { Address } from 'viem';\n\n// Unversioned base; callers/providers must append /v1 or /v2 in adapters\nexport const DEFAULT_BASE_API_URL = 'https://api.zkp2p.xyz';\nexport const DEFAULT_WITNESS_URL = 'https://witness-proxy.zkp2p.xyz';\n\n// Enabled payment platforms (verifiers) for enrichment and platform-aware logic\nexport const ENABLED_PLATFORMS = [\n 'venmo',\n 'revolut',\n 'cashapp',\n 'wise',\n 'mercadopago',\n 'zelle',\n 'paypal',\n 'monzo',\n] as const;\n\nexport type EnabledPlatform = (typeof ENABLED_PLATFORMS)[number];\n\ntype PlatformAddresses = { [P in EnabledPlatform]: Address };\n\nexport type ContractSet = PlatformAddresses & {\n usdc: Address;\n escrow: Address;\n gatingService: Address;\n zkp2pWitnessSigner: Address;\n};\n\ntype Contracts = {\n [chainId: number]:\n | ContractSet\n | {\n production: ContractSet;\n staging: ContractSet;\n };\n};\n\nexport const DEPLOYED_ADDRESSES: Contracts = {\n 8453: {\n production: {\n // external contracts\n usdc: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',\n \n // escrow + verifiers\n escrow: '0xCA38607D85E8F6294Dc10728669605E6664C2D70',\n \n // Processor names to deployed addresses\n venmo: '0x9a733B55a875D0DB4915c6B36350b24F8AB99dF5',\n revolut: '0xAA5A1B62B01781E789C900d616300717CD9A41aB',\n cashapp: '0x76D33A33068D86016B806dF02376dDBb23Dd3703',\n wise: '0xFF0149799631D7A5bdE2e7eA9b306c42b3d9a9ca',\n mercadopago: '0xf2AC5be14F32Cbe6A613CFF8931d95460D6c33A3',\n zelle: '0x431a078A5029146aAB239c768A615CD484519aF7',\n paypal: '0x03d17E9371C858072E171276979f6B44571C5DeA',\n monzo: '0x0dE46433bD251027f73eD8f28E01eF05DA36a2E0',\n \n // offchain services\n gatingService: '0x396D31055Db28C0C6f36e8b36f18FE7227248a97',\n zkp2pWitnessSigner: '0x0636c417755E3ae25C6c166D181c0607F4C572A3',\n },\n staging: {\n // external contracts\n usdc: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',\n \n // escrow + verifiers\n escrow: '0xC8cd114C6274Ef1066840337E7678BC9731BEa68',\n \n // Processor names to deployed addresses\n venmo: '0xCE6454f272127ba69e8C8128B92F2388Ca343257',\n revolut: '0xb941e69B6C1A23A88cf9DA7D243bAE1D2Cb8eb6b',\n cashapp: '0xdDB9d452180398F456Fe89A43Df9C65B19756CEa',\n wise: '0x79F35E2f65ff917BE35686d34932C8Ef5a30631f',\n mercadopago: '0xA2d54F983B8201c7b276C9705641C49C2FBD1A36',\n zelle: '0x0Ed3c3DB9CF8458e5D9991712552539675D2C896',\n paypal: '0xB07764999679a9136d6853a5D4c70449afbfc2f8',\n monzo: '0x179792F99C0eFBFa06c3F6747989a96c58544f6F',\n \n // offchain services\n gatingService: '0x396D31055Db28C0C6f36e8b36f18FE7227248a97',\n zkp2pWitnessSigner: '0x0636c417755E3ae25C6c166D181c0607F4C572A3',\n },\n },\n 84532: {\n usdc: '0x17463cb89A62c7b4A5ecD949aFDEDBD0Aa047ad1',\n escrow: '0x15EF83EBB422B4AC8e3b8393d016Ed076dc50CB7',\n venmo: '0x8499f2e7c4496Acfe0D7Ca5C7b6522514877b33F',\n revolut: '0x7E34909A1C1b2a4D2FAbA61c17a0F59ECAce6F29',\n cashapp: '0xe4148B108Fe4D7421853FE8cFfd35bDc2c0d95Ec',\n wise: '0x54c92a8828A393C5A6D1DfbB71d0e9e97329b39C',\n mercadopago: '0x4367155Fe7BAA99d9AE99fE4F6aC1b8E87012e6b',\n zelle: '0xbeeC239145b3c461422BC2fC45B78E5fd70862F1',\n paypal: '0xC8cd114C6274Ef1066840337E7678BC9731BEa68',\n monzo: '0xe2B378D9181046c84dB1156B0F90cF3108e25E9D',\n \n gatingService: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',\n zkp2pWitnessSigner: '0x0636c417755E3ae25C6c166D181c0607F4C572A3',\n },\n 31337: {\n usdc: '0x5FbDB2315678afecb367f032d93F642f64180aa3',\n escrow: '0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512',\n venmo: '0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9',\n revolut: '0xa513E6E4b8f2a923D98304ec87F64353C4D5C853',\n cashapp: '0x610178dA211FEF7D417bC0e6FeD39F05609AD788',\n wise: '0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82',\n mercadopago: '0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1',\n zelle: '0x3Aa5ebB10DC797CAC828524e59A333d0A371443c',\n paypal: '0xE6E340D132b5f46d1e472DebcD681B2aBc16e57E',\n monzo: '0x9E545E3C0baAB3E08CdfD552C960A1050f373042',\n \n // offchain services\n gatingService: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', // Hardhat 0\n zkp2pWitnessSigner: '0x0636c417755E3ae25C6c166D181c0607F4C572A3',\n },\n};\n\nexport function getPlatformAddressMap(\n addresses: ContractSet\n): Record<EnabledPlatform, Address> {\n const entries = ENABLED_PLATFORMS.map((p) => [p, addresses[p]] as const);\n return Object.fromEntries(entries) as Record<EnabledPlatform, Address>;\n}\n\nexport function platformFromVerifierAddress(\n addresses: ContractSet,\n verifierAddress: string\n): EnabledPlatform | null {\n if (!verifierAddress) return null;\n const target = verifierAddress.toLowerCase();\n for (const p of ENABLED_PLATFORMS) {\n const addr = addresses[p]?.toLowerCase?.();\n if (addr && addr === target) return p;\n }\n return null;\n}\n","/**\n * SDK Constants\n *\n * This module exports all public constants for the SDK including:\n * - Payment platforms (Wise, Venmo, Revolut, etc.)\n * - Currencies (USD, EUR, GBP, etc.)\n * - Chain IDs and network configuration\n * - Token metadata\n *\n * @module constants\n */\n\n// Payment platforms\nexport { PAYMENT_PLATFORMS, type PaymentPlatformType } from './types';\n\n// Currencies\nexport { Currency, currencyInfo } from './utils/currency';\nexport type { CurrencyType, CurrencyData } from './utils/currency';\n\n// Contract addresses and deployment info\nexport { DEPLOYED_ADDRESSES } from './utils/constants';\n\n// API URLs\nexport { DEFAULT_BASE_API_URL, DEFAULT_WITNESS_URL } from './utils/constants';\n\n/**\n * Supported blockchain chain IDs.\n *\n * @example\n * ```typescript\n * import { SUPPORTED_CHAIN_IDS } from '@zkp2p/sdk';\n *\n * const client = new Zkp2pClient({\n * chainId: SUPPORTED_CHAIN_IDS.BASE_MAINNET,\n * // ...\n * });\n * ```\n */\nexport const SUPPORTED_CHAIN_IDS = {\n /** Base mainnet (8453) */\n BASE_MAINNET: 8453,\n /** Base Sepolia testnet (84532) */\n BASE_SEPOLIA: 84532,\n /** Scroll mainnet (534352) */\n SCROLL_MAINNET: 534352,\n /** Local Hardhat network (31337) */\n HARDHAT: 31337,\n} as const;\n\n/**\n * Union type of supported chain IDs.\n */\nexport type SupportedChainId = typeof SUPPORTED_CHAIN_IDS[keyof typeof SUPPORTED_CHAIN_IDS];\n\n/**\n * Metadata for each supported payment platform.\n *\n * Includes display names, logos, and the number of proofs required\n * for payment verification.\n */\nexport const PLATFORM_METADATA = {\n venmo: {\n name: 'Venmo',\n displayName: 'Venmo',\n logo: '💵',\n requiredProofs: 1,\n },\n revolut: {\n name: 'Revolut',\n displayName: 'Revolut',\n logo: '💳',\n requiredProofs: 1,\n },\n cashapp: {\n name: 'CashApp',\n displayName: 'Cash App',\n logo: '💸',\n requiredProofs: 1,\n },\n wise: {\n name: 'Wise',\n displayName: 'Wise',\n logo: '🌍',\n requiredProofs: 2,\n },\n mercadopago: {\n name: 'MercadoPago',\n displayName: 'Mercado Pago',\n logo: '💰',\n requiredProofs: 1,\n },\n zelle: {\n name: 'Zelle',\n displayName: 'Zelle',\n logo: '💲',\n requiredProofs: 1,\n },\n paypal: {\n name: 'PayPal',\n displayName: 'PayPal',\n logo: '💙',\n requiredProofs: 1,\n },\n monzo: {\n name: 'Monzo',\n displayName: 'Monzo',\n logo: '🏦',\n requiredProofs: 1,\n },\n} as const;\n\n/**\n * Token metadata for supported tokens.\n */\nexport const TOKEN_METADATA = {\n USDC: {\n symbol: 'USDC',\n decimals: 6,\n name: 'USD Coin',\n },\n} as const;\n\n/**\n * Attestation service configuration for each payment platform.\n *\n * Maps platform names to their corresponding action types for the\n * attestation service endpoints.\n *\n * @internal Used internally by fulfillIntent\n */\nexport const PLATFORM_ATTESTATION_CONFIG: Record<string, { actionType: string; actionPlatform: string }> = {\n wise: { actionType: 'transfer_wise', actionPlatform: 'wise' },\n venmo: { actionType: 'transfer_venmo', actionPlatform: 'venmo' },\n revolut: { actionType: 'transfer_revolut', actionPlatform: 'revolut' },\n cashapp: { actionType: 'transfer_cashapp', actionPlatform: 'cashapp' },\n mercadopago: { actionType: 'transfer_mercadopago', actionPlatform: 'mercadopago' },\n paypal: { actionType: 'transfer_paypal', actionPlatform: 'paypal' },\n monzo: { actionType: 'transfer_monzo', actionPlatform: 'monzo' },\n 'zelle-chase': { actionType: 'transfer_zelle', actionPlatform: 'chase' },\n 'zelle-bofa': { actionType: 'transfer_zelle', actionPlatform: 'bankofamerica' },\n 'zelle-citi': { actionType: 'transfer_zelle', actionPlatform: 'citi' },\n} as const;\n\n/**\n * Resolves attestation platform configuration for a given payment platform.\n *\n * @param platformName - The payment platform name (e.g., 'wise', 'venmo', 'zelle-citi')\n * @returns Attestation configuration with actionType and actionPlatform\n * @throws Error if the platform is not supported\n *\n * @internal Used internally by fulfillIntent\n */\nexport function resolvePlatformAttestationConfig(platformName: string): { actionType: string; actionPlatform: string } {\n const normalized = platformName.toLowerCase();\n const config = PLATFORM_ATTESTATION_CONFIG[normalized];\n if (!config) {\n throw new Error(`Unknown payment platform: ${platformName}`);\n }\n return config;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ export { DEFAULT_BASE_API_URL, DEFAULT_WITNESS_URL, DEPLOYED_ADDRESSES, PAYMENT_PLATFORMS, PLATFORM_ATTESTATION_CONFIG, PLATFORM_METADATA, SUPPORTED_CHAIN_IDS, TOKEN_METADATA, resolvePlatformAttestationConfig } from './chunk-P3NOBRQB.mjs';
2
+ export { Currency, currencyInfo } from './chunk-BEZUO5YY.mjs';
3
+ //# sourceMappingURL=constants-CFOT2I4R.mjs.map
4
+ //# sourceMappingURL=constants-CFOT2I4R.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"constants-DMJE2ALO.mjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"constants-CFOT2I4R.mjs"}
@@ -1,3 +1,3 @@
1
- export { Currency, currencyInfo, getCurrencyCodeFromHash, getCurrencyInfoFromCountryCode, getCurrencyInfoFromHash, isSupportedCurrencyHash, mapConversionRatesToOnchain, mapConversionRatesToOnchainMinRate } from './chunk-PBBMWRNE.mjs';
2
- //# sourceMappingURL=currency-ULYH5HL2.mjs.map
3
- //# sourceMappingURL=currency-ULYH5HL2.mjs.map
1
+ export { Currency, currencyInfo, getCurrencyCodeFromHash, getCurrencyInfoFromCountryCode, getCurrencyInfoFromHash, isSupportedCurrencyHash, mapConversionRatesToOnchain, mapConversionRatesToOnchainMinRate } from './chunk-BEZUO5YY.mjs';
2
+ //# sourceMappingURL=currency-JIMAHIGJ.mjs.map
3
+ //# sourceMappingURL=currency-JIMAHIGJ.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"currency-ULYH5HL2.mjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"currency-JIMAHIGJ.mjs"}
package/dist/index.cjs CHANGED
@@ -2025,6 +2025,26 @@ var Zkp2pClient = class {
2025
2025
  */
2026
2026
  getDepositsByPayeeHash: (payeeHash, options = {}) => {
2027
2027
  return service.fetchDepositsByPayeeHash(payeeHash, options);
2028
+ },
2029
+ /**
2030
+ * Fetches deposits by their composite IDs.
2031
+ * @param ids - Array of composite IDs in format "chainId_escrowAddress_depositId"
2032
+ */
2033
+ getDepositsByIds: (ids) => {
2034
+ return service.fetchDepositsByIds(ids);
2035
+ },
2036
+ /**
2037
+ * Fetches deposits by their composite IDs with all related data.
2038
+ * @param ids - Array of composite IDs in format "chainId_escrowAddress_depositId"
2039
+ */
2040
+ getDepositsByIdsWithRelations: (ids, options) => {
2041
+ return service.fetchDepositsByIdsWithRelations(ids, options);
2042
+ },
2043
+ /**
2044
+ * Performs a raw GraphQL query against the indexer.
2045
+ */
2046
+ query: (params) => {
2047
+ return client.query(params);
2028
2048
  }
2029
2049
  };
2030
2050
  }