@provex/react 1.2.5 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,724 +1,24 @@
1
- import * as viem from 'viem';
2
- import { Hex, Chain, TransactionReceipt, PublicClient } from 'viem';
3
- import { ChainId } from '@provex/utils/chain';
4
- import * as _provex_utils_payment from '@provex/utils/payment';
5
- import { ProviderKey, SubProviderKey, TakerTier } from '@provex/utils/payment';
6
- import { UserReputation } from '@provex/utils/reputation';
7
- import { Currency } from '@provex/utils/currencies';
8
- import { TokenInfo } from '@provex/utils/tokens';
1
+ import { C as CreateDepositRawParams, I as IndexerAdapter, P as ProveXClientConfig, a as PaginationOptions, b as PaginatedResult, c as IndexedDeposit, d as IndexedIntent, R as ReputationData, W as WritableMethod, e as CreateDepositParams$1, T as TransactionResult, f as PreparedTransaction, S as SignalIntentParams, g as SignalIntentResult, h as PayeeDetails, M as MakerRegistrationParams, A as AttestationParams, i as AttestationResponse, j as WalletAdapter, U as UseProvexBuyOptions, k as UseProvexBuyReturn, l as PhaseRenderProps, B as BuyProps } from './ProvexProvider-DWxHsaR8.js';
2
+ export { y as ApiClient, n as BuyPhase, X as DepositInfo, D as DepositPaymentMethod, $ as IndexedVerifier, Y as IntentStatus, Z as PayeeInfo, p as PhaseComponentProps, t as ProveXError, v as ProveXErrorCode, m as ProvexConfig, r as ProvexContextValue, q as ProvexProvider, s as ProvexProviderProps, o as ProvexTheme, V as ReputationLimits, Q as ReputationLimitsParams, w as SignalIntentRawParams, _ as SignalIntentStatus, x as createApiClient, F as getRate, H as intentStatuses, E as useDeposits, L as useOptionalProvexPublicClient, O as useOptionalProvexWallet, G as usePayeeDetails, u as useProvex, K as useProvexPublicClient, N as useProvexWallet, z as useReputationLimits, J as useSignalIntent } from './ProvexProvider-DWxHsaR8.js';
9
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
10
- import * as React$1 from 'react';
4
+ import * as React from 'react';
11
5
  import React__default from 'react';
12
- import { QueryClient } from '@tanstack/react-query';
6
+ import { Hex, Chain, PublicClient } from 'viem';
7
+ import { ChainId } from '@provex/utils/chain';
13
8
  import { FeeInfo } from '@provex/utils/fees';
9
+ import { TakerTier } from '@provex/utils/payment';
10
+ import { UserReputation } from '@provex/utils/reputation';
11
+ import { TokenInfo } from '@provex/utils/tokens';
14
12
  import { Version } from '@provex/utils/contracts';
15
13
  import * as _tanstack_query_core from '@tanstack/query-core';
16
-
17
- /**
18
- * @fileoverview Hook for fetching deposits that match a buyer's criteria.
19
- *
20
- * Queries the IndexerAdapter for active V3 deposits that:
21
- * - Support the specified payment method
22
- * - Support the specified fiat currency
23
- * - Have sufficient liquidity for the requested amount
24
- * - Are accepting intents
25
- *
26
- * @see {@link @provex/utils/payment} for provider configuration
27
- */
28
-
29
- /**
30
- * Lightweight deposit info returned by the hook.
31
- * Maps from IndexedDeposit — same shape the UI already consumes.
32
- */
33
- interface DepositInfo {
34
- escrow: Hex;
35
- localId: bigint;
36
- chainId: number;
37
- participantAddress: Hex;
38
- token: Hex;
39
- remaining: bigint;
40
- deposited: bigint;
41
- minAmount: bigint;
42
- maxAmount: bigint;
43
- status: string;
44
- acceptingIntents: boolean;
45
- availableFunds: bigint;
46
- conversionRates: Map<string, Map<string, bigint>>;
47
- verifierPaymentMethodIds: Set<string>;
48
- }
49
- /** Options for the useDeposits hook. */
50
- interface UseDepositsOptions {
51
- token: TokenInfo;
52
- paymentMethod: ProviderKey;
53
- currency?: Currency;
54
- refetchIntervalMs?: number;
55
- }
56
- /**
57
- * Get the best (lowest) conversion rate for a deposit across the main provider
58
- * and all sub-providers.
59
- *
60
- * Returns 0n when the deposit has no rate for the given payment method / currency.
61
- */
62
- declare function getRate({ deposit, paymentMethod, currency, }: {
63
- deposit: DepositInfo | null | undefined;
64
- paymentMethod: ProviderKey | SubProviderKey;
65
- currency: Currency;
66
- }): bigint;
67
- /**
68
- * Hook to fetch matchable deposits from the indexer.
69
- *
70
- * @example
71
- * ```ts
72
- * const { deposits, isLoading, getMatchableDeposits } = useDeposits({
73
- * token: usdcToken,
74
- * paymentMethod: 'venmo',
75
- * })
76
- *
77
- * const matches = getMatchableDeposits(parseUnits('100', { decimals: 2 }))
78
- * ```
79
- */
80
- declare function useDeposits(options: UseDepositsOptions): {
81
- deposits: DepositInfo[];
82
- isLoading: boolean;
83
- isUpdating: boolean;
84
- error: Error | null;
85
- refetch: () => void;
86
- filterDepositsByAmount: (amountInInt: bigint) => DepositInfo[];
87
- getMatchableDeposits: (amountInInt: bigint | null | string) => DepositInfo[];
88
- };
89
-
90
- /**
91
- * @fileoverview IndexerAdapter — data source abstraction for @provex/react.
92
- *
93
- * Decouples the react hooks from any specific indexer implementation.
94
- * Consumers provide their own adapter:
95
- * - `@provex/indexer-client` exports `createPonderAdapter()` for Ponder SQL
96
- * - Third parties can implement against The Graph, REST APIs, or direct RPC
97
- *
98
- * All methods that return lists support optional pagination via `limit`/`cursor`.
99
- * When omitted, the implementation returns all results.
100
- */
101
-
102
- /** Cursor-based pagination options. */
103
- interface PaginationOptions {
104
- /** Maximum number of results to return. */
105
- limit?: number;
106
- /** Opaque cursor from a previous response. Pass to fetch the next page. */
107
- cursor?: string;
108
- }
109
- /** Paginated response wrapper. */
110
- interface PaginatedResult<T> {
111
- items: T[];
112
- /** Cursor for the next page. Null when there are no more results. */
113
- nextCursor: string | null;
114
- }
115
- /** A deposit with computed availability, rates, and payment method info. */
116
- interface IndexedDeposit {
117
- escrow: Hex;
118
- localId: bigint;
119
- chainId: ChainId;
120
- participantAddress: Hex;
121
- token: Hex;
122
- remaining: bigint;
123
- deposited: bigint;
124
- minAmount: bigint;
125
- maxAmount: bigint;
126
- status: string;
127
- acceptingIntents: boolean;
128
- /** remaining + reclaimable - activeLocked */
129
- availableFunds: bigint;
130
- /** Map<paymentMethodId, Map<currencyId, rateValue>> */
131
- conversionRates: Map<string, Map<string, bigint>>;
132
- /** Set of payment method IDs this deposit accepts */
133
- paymentMethodIds: Set<string>;
134
- /** Verifier records for payee detail lookups */
135
- verifiers: IndexedVerifier[];
136
- }
137
- /** A deposit verifier record. */
138
- interface IndexedVerifier {
139
- paymentMethodId: Hex;
140
- payeeDetailsHash: Hex;
141
- intentGatingService: Hex;
142
- active: boolean;
143
- }
144
- /** An indexed intent with lifecycle status and expiry. */
145
- interface IndexedIntent {
146
- intentHash: Hex;
147
- ownerAddress: Hex;
148
- toAddress: Hex;
149
- escrow: Hex;
150
- depositLocalId: bigint;
151
- amount: bigint;
152
- timestamp: bigint;
153
- paymentMethodId: Hex;
154
- fiatCurrency: Hex;
155
- conversionRate: bigint;
156
- /** Expiry timestamp from fundsLocked (unix seconds), null if not locked */
157
- expiryTime: bigint | null;
158
- /** Lifecycle status */
159
- status: 'pending' | 'signalled' | 'fulfilled' | 'pruned';
160
- /** When the intent was pruned (unix seconds), null if not pruned */
161
- prunedAt: bigint | null;
162
- }
163
- /** Pre-computed reputation data for tier calculation. */
164
- interface ReputationData {
165
- /** Total fulfilled volume in USDC (human-readable, e.g. 1500.50) */
166
- fulfilledVolumeUsdc: number;
167
- /** Number of fulfilled intents */
168
- fulfilledCount: number;
169
- /** Number of late cancellations (>15 min after signal) */
170
- lateCancellations: number;
171
- /** Unix timestamp (seconds) of most recent signaled intent per chain. Null if never signaled. */
172
- lastSignaledAt: Partial<Record<ChainId, bigint>>;
173
- }
174
- /**
175
- * Data source abstraction for @provex/react.
176
- *
177
- * Every method that returns a list accepts optional `PaginationOptions`.
178
- * For batch queries, callers can specify multiple filter keys.
179
- *
180
- * Implementations:
181
- * - `createPonderAdapter(ponderClient)` from `@provex/indexer-client`
182
- * - Custom REST/Graph/RPC implementations
183
- *
184
- * @example
185
- * ```ts
186
- * // Using the Ponder adapter
187
- * import { createPonderAdapter } from '@provex/indexer-client'
188
- * const indexer = createPonderAdapter(ponderClient)
189
- *
190
- * // Using a custom REST API
191
- * const indexer: IndexerAdapter = {
192
- * getMatchableDeposits: ({ chainId, token, currencyId }) =>
193
- * fetch(`/api/deposits?chain=${chainId}&token=${token}&currency=${currencyId}`)
194
- * .then(r => r.json()),
195
- * // ...
196
- * }
197
- * ```
198
- */
199
- interface IndexerAdapter {
200
- /**
201
- * Fetch active V3 deposits that match buyer criteria.
202
- *
203
- * Returns deposits with computed availability (remaining + reclaimable - locked),
204
- * active conversion rates, and payment method IDs.
205
- *
206
- * The implementation should:
207
- * - Filter to active, v3, acceptingIntents deposits on the given chain/token
208
- * - Filter to deposits supporting the given currency
209
- * - Include conversion rates and verifier data
210
- * - Compute availableFunds from locked/unlocked/transferred events
211
- *
212
- * @param params.chainId - Chain to query
213
- * @param params.token - Token address to filter by
214
- * @param params.currencyId - Fiat currency contract ID to filter by
215
- * @param params.pagination - Optional limit/cursor
216
- */
217
- getMatchableDeposits(params: {
218
- chainId: ChainId;
219
- token: Hex;
220
- currencyId: Hex;
221
- pagination?: PaginationOptions;
222
- }): Promise<PaginatedResult<IndexedDeposit>>;
223
- /**
224
- * Fetch a single deposit with its verifiers.
225
- *
226
- * Used by usePayeeDetails to look up deposit info after an intent is signaled.
227
- */
228
- getDepositWithVerifiers(params: {
229
- escrow: Hex;
230
- localId: bigint;
231
- chainId: ChainId;
232
- }): Promise<IndexedDeposit | null>;
233
- /**
234
- * Fetch intent details including expiry time and lifecycle status.
235
- *
236
- * Combines intent signal data, lock data, and status (fulfilled/pruned/signalled)
237
- * into a single response.
238
- */
239
- getIntent(params: {
240
- intentHash: Hex;
241
- chainId: ChainId;
242
- }): Promise<IndexedIntent | null>;
243
- /**
244
- * Get the payee details hash for a deposit's payment method.
245
- *
246
- * Used before signaling an intent — the gating service needs this hash.
247
- *
248
- * @returns The payeeDetailsHash, or null if no verifier is found
249
- */
250
- getPayeeDetailsHash(params: {
251
- escrow: Hex;
252
- localId: bigint;
253
- chainId: ChainId;
254
- paymentMethodId: Hex;
255
- }): Promise<Hex | null>;
256
- /**
257
- * Get user's reputation data for tier calculation.
258
- *
259
- * Returns pre-computed stats that the reputation hook uses to derive
260
- * the tier, lock score, and cooldown.
261
- *
262
- * @param params.address - User's wallet address
263
- * @param params.chainId - Optional chain filter. When set, only counts
264
- * activity on that chain. When omitted, counts all chains.
265
- */
266
- getUserReputation(params: {
267
- address: Hex;
268
- chainId?: ChainId;
269
- }): Promise<ReputationData>;
270
- /**
271
- * Check if a transaction has been indexed.
272
- * Returns a truthy value when indexed, null when not yet.
273
- */
274
- getTransactionByHash(hash: Hex): Promise<unknown | null>;
275
- /**
276
- * Check a deposit's current indexed status.
277
- * Returns null if the deposit isn't indexed yet.
278
- */
279
- getDepositById(depositId: Hex): Promise<{
280
- status: string;
281
- } | null>;
282
- }
283
-
284
- /**
285
- * @fileoverview Types for the ProveXClient — framework-agnostic protocol client.
286
- */
287
-
288
- interface ProveXClientConfig {
289
- /**
290
- * The viem Chain object to operate on. Provides chain ID, RPC URLs,
291
- * block explorers, and native currency config.
292
- *
293
- * Import from `viem/chains` or define your own for custom RPCs / testnets.
294
- *
295
- * @example
296
- * ```ts
297
- * import { base, pulsechain } from 'viem/chains'
298
- *
299
- * // Standard chain
300
- * createProveXClient({ chain: base })
301
- *
302
- * // Custom RPC
303
- * createProveXClient({
304
- * chain: { ...base, rpcUrls: { default: { http: ['https://my-rpc.com'] } } }
305
- * })
306
- *
307
- * // Testnet
308
- * createProveXClient({ chain: pulsechainV4, escrowAddress: '0x...' })
309
- * ```
310
- */
311
- chain: Chain;
312
- /**
313
- * Backend API URL. Defaults to `https://app.provex.com`.
314
- * Override for self-hosted or staging deployments.
315
- */
316
- apiUrl?: string;
317
- /**
318
- * Wallet adapter for signing transactions.
319
- * Omit for prepare-only mode (`.prepare()` works without a wallet).
320
- */
321
- wallet?: WalletAdapter;
322
- /**
323
- * Data source adapter for indexer queries.
324
- * Omit if you only need on-chain reads and `.prepare()`.
325
- */
326
- indexer?: IndexerAdapter;
327
- /** Override the default V3 escrow address for this chain. */
328
- escrowAddress?: Hex;
329
- /** Called with the tx hash immediately after wallet submission. */
330
- onTransactionHash?: (hash: Hex) => void;
331
- /** Called when indexer sync takes longer than expected. */
332
- onSlowSync?: () => void;
333
- }
334
- /** Framework-agnostic wallet interface. Works with wagmi, ethers, or custom. */
335
- interface WalletAdapter {
336
- /** Connected address, or undefined if disconnected. */
337
- address?: Hex;
338
- /** Sign and send a transaction. Returns the tx hash. */
339
- sendTransaction(tx: {
340
- to: Hex;
341
- data: Hex;
342
- value?: bigint;
343
- chainId: number;
344
- maxFeePerGas?: bigint;
345
- maxPriorityFeePerGas?: bigint;
346
- }): Promise<Hex>;
347
- /** Read from a contract (optional — falls back to public RPC). */
348
- readContract?(params: {
349
- address: Hex;
350
- abi: readonly unknown[];
351
- functionName: string;
352
- args?: readonly unknown[];
353
- chainId?: number;
354
- }): Promise<unknown>;
355
- }
356
- /**
357
- * Unsigned transaction data. Pass to any wallet, multisig, relayer, or batch builder.
358
- *
359
- * @example
360
- * ```ts
361
- * const prepared = await client.addFunds.prepare({ depositId: 1n, amount: 100n })
362
- * // Hand to Safe SDK, Privy, gasless relay, etc.
363
- * await safeSDK.createTransaction({ transactions: [prepared] })
364
- * ```
365
- */
366
- interface PreparedTransaction {
367
- to: Hex;
368
- data: Hex;
369
- value: bigint;
370
- chainId: number;
371
- }
372
- /** Result of a fully executed transaction. */
373
- interface TransactionResult {
374
- hash: Hex;
375
- receipt: TransactionReceipt;
376
- }
377
- /**
378
- * A protocol write operation. Callable to execute the full lifecycle,
379
- * or use `.prepare()` to get unsigned transaction data.
380
- *
381
- * @example
382
- * ```ts
383
- * // Full execute: gas → wallet → receipt → indexer sync
384
- * const { hash } = await client.addFunds({ depositId: 1n, amount: 100n })
385
- *
386
- * // Prepare only: returns { to, data, value, chainId }
387
- * const prepared = await client.addFunds.prepare({ depositId: 1n, amount: 100n })
388
- * ```
389
- */
390
- interface WritableMethod<TParams> {
391
- /** Execute the full transaction lifecycle. Requires a wallet. */
392
- (params: TParams): Promise<TransactionResult>;
393
- /** Return unsigned transaction data only. No wallet needed. */
394
- prepare(params: TParams): Promise<PreparedTransaction>;
395
- }
396
- type ProveXErrorCode = 'WALLET_REJECTED' | 'WALLET_NOT_CONNECTED' | 'TX_REVERTED' | 'INSUFFICIENT_FUNDS' | 'INSUFFICIENT_LIQUIDITY' | 'INDEXER_TIMEOUT' | 'INDEXER_NOT_CONFIGURED' | 'CONTRACT_ERROR' | 'API_ERROR' | 'VALIDATION_ERROR' | 'UNKNOWN';
397
- /**
398
- * Typed error for ProveX protocol operations.
399
- * Non-React consumers catch these directly; React hooks map them to UI state.
400
- */
401
- declare class ProveXError extends Error {
402
- readonly code: ProveXErrorCode;
403
- readonly cause?: Error;
404
- constructor(code: ProveXErrorCode, message: string, cause?: Error);
405
- /** Check if this error was caused by the user rejecting in their wallet. */
406
- get isRejection(): boolean;
407
- }
408
- /** Options for registering or validating a maker's payment identity. */
409
- interface MakerRegistrationParams {
410
- /** Payment provider key (e.g. 'venmo', 'zelle', 'revolut') */
411
- providerKey: string;
412
- /** Provider-specific user ID (e.g. Venmo username, Zelle phone) */
413
- providerId: string;
414
- /** Optional Telegram handle for contact */
415
- telegramHandle?: string;
416
- }
417
- /** Payee details returned by the API. */
418
- interface PayeeDetails {
419
- payeeId?: string;
420
- name?: string;
421
- platformName?: string;
422
- [key: string]: unknown;
423
- }
424
- /** Attestation request for zkTLS proof submission. */
425
- interface AttestationParams {
426
- /** Payment platform (e.g. 'chase', 'venmo') */
427
- platform: string;
428
- /** Action type (e.g. 'transfer_zelle', 'transfer_venmo') */
429
- actionType: string;
430
- /** Reclaim proofs */
431
- proofs: unknown[];
432
- /** Chain ID for the attestation */
433
- chainId: number;
434
- /** Verifying contract address */
435
- verifyingContract: Hex;
436
- /** Intent data for the attestation */
437
- intent: unknown;
438
- }
439
- /** Attestation response with signed payment proof. */
440
- interface AttestationResponse {
441
- success: boolean;
442
- message?: string;
443
- statusCode?: number;
444
- responseObject: {
445
- paymentProof?: unknown;
446
- [key: string]: unknown;
447
- };
448
- }
449
- /**
450
- * Human-readable params for signaling an intent (buyer side).
451
- *
452
- * The SDK handles:
453
- * 1. Looking up payee details from the indexer
454
- * 2. Requesting a gating service signature from the API
455
- * 3. Building and simulating the on-chain transaction
456
- * 4. Extracting the intent hash from the IntentSignaled event
457
- *
458
- * @example
459
- * ```ts
460
- * const { hash, intentHash } = await client.signalIntent({
461
- * deposit: { escrow: '0x...', localId: 1n },
462
- * paymentMethod: '0x...', // bytes32 payment method hash
463
- * tokenAmount: 100_000000n,
464
- * toAddress: '0x...',
465
- * fiatCurrencyCode: '0x...', // bytes32 currency code hash
466
- * conversionRate: 1_000000000000000000n,
467
- * })
468
- * ```
469
- */
470
- interface SignalIntentParams {
471
- deposit: {
472
- escrow: Hex;
473
- localId: bigint;
474
- };
475
- paymentMethod: Hex;
476
- tokenAmount: bigint;
477
- toAddress: Hex;
478
- fiatCurrencyCode: Hex;
479
- conversionRate: bigint;
480
- subProvider?: string;
481
- }
482
- /** Result of a signalIntent call. Extends TransactionResult with the intent hash. */
483
- interface SignalIntentResult extends TransactionResult {
484
- /** The on-chain intent hash, extracted from the IntentSignaled event. */
485
- intentHash: Hex;
486
- }
487
- /** Raw on-chain params matching the Orchestrator's signalIntent signature. */
488
- interface SignalIntentRawParams {
489
- escrow: Hex;
490
- depositId: bigint;
491
- amount: bigint;
492
- to: Hex;
493
- paymentMethod: Hex;
494
- fiatCurrency: Hex;
495
- conversionRate: bigint;
496
- referrer: Hex;
497
- referrerFee: bigint;
498
- gatingServiceSignature: Hex;
499
- signatureExpiration: bigint;
500
- postIntentHook: Hex;
501
- data: Hex;
502
- }
503
- /** Raw contract-level params matching the V3 Escrow's createDeposit signature. */
504
- interface CreateDepositRawParams {
505
- token: Hex;
506
- amount: bigint;
507
- intentAmountRange: {
508
- min: bigint;
509
- max: bigint;
510
- };
511
- paymentMethods: Hex[];
512
- paymentMethodData: Array<{
513
- intentGatingService: Hex;
514
- payeeDetails: Hex;
515
- data: Hex;
516
- }>;
517
- currencies: Array<Array<{
518
- code: Hex;
519
- minConversionRate: bigint;
520
- }>>;
521
- delegate: Hex;
522
- intentGuardian: Hex;
523
- retainOnEmpty: boolean;
524
- }
525
- /** A payment method to include in a new deposit. */
526
- interface DepositPaymentMethod {
527
- /** Provider key (e.g., 'venmo', 'zelle', 'revolut', 'wise'). */
528
- provider: string;
529
- /** Plaintext payee identifier — SDK hashes and registers it automatically. */
530
- payeeId: string;
531
- /**
532
- * Currencies this payment method accepts, with minimum conversion rates.
533
- *
534
- * @example
535
- * ```ts
536
- * currencies: [
537
- * { code: 'USD', minRate: 0n }, // accept any rate
538
- * { code: 'EUR', minRate: 980000000000000000n }, // min 0.98 EUR/USDC
539
- * ]
540
- * ```
541
- */
542
- currencies: Array<{
543
- code: string;
544
- minRate: bigint;
545
- }>;
546
- /**
547
- * Custom intent gating service address. Defaults to the protocol's
548
- * standard Reclaim gating service for this chain.
549
- */
550
- intentGatingService?: Hex;
551
- /**
552
- * Custom data field for the payment method (encoded ABI params).
553
- * Defaults to the standard Reclaim witness signer encoding.
554
- */
555
- data?: Hex;
556
- }
557
- /**
558
- * Human-readable params for creating a deposit.
559
- * The SDK handles hashing, sub-provider expansion, maker registration, and
560
- * all the encoding needed to build the on-chain transaction.
561
- *
562
- * @example
563
- * ```ts
564
- * await client.createDeposit({
565
- * token: USDC_ADDRESS,
566
- * amount: 1000_000000n,
567
- * intentRange: { min: 10_000000n, max: 500_000000n },
568
- * paymentMethods: [
569
- * { provider: 'venmo', payeeId: '@myvenmo', currencies: [{ code: 'USD', minRate: 0n }] },
570
- * ],
571
- * })
572
- * ```
573
- */
574
- interface CreateDepositParams$1 {
575
- /** ERC-20 token address (e.g., USDC). */
576
- token: Hex;
577
- /** Deposit amount in the token's smallest unit (e.g., 6 decimals for USDC). */
578
- amount: bigint;
579
- /**
580
- * Min/max intent amount range buyers can signal.
581
- * `min` defaults to 1_000000n (1 USDC). `max` defaults to `amount`.
582
- */
583
- intentRange?: {
584
- min?: bigint;
585
- max?: bigint;
586
- };
587
- /** Payment methods the depositor accepts. */
588
- paymentMethods: DepositPaymentMethod[];
589
- /** Optional Telegram handle for buyer-seller contact. */
590
- telegramHandle?: string;
591
- /** Delegate address that can manage this deposit. Defaults to zero (no delegate). */
592
- delegate?: Hex;
593
- /** Guardian address for intent gating. Defaults to zero (no guardian). */
594
- intentGuardian?: Hex;
595
- /** Keep deposit active even when fully claimed. Defaults to false. */
596
- retainOnEmpty?: boolean;
597
- }
598
-
599
- /**
600
- * @fileoverview React hook for the V3 intent signaling flow.
601
- *
602
- * Thin state wrapper around ProveXClient.signalIntent() —
603
- * manages status, error messages, and loading state for the UI.
604
- */
605
-
606
- /** Status of the signal intent flow. */
607
- type SignalIntentStatus = 'input' | 'loading_payee' | 'loading_intent' | 'prompt_wallet_confirm' | 'writing_intent' | 'success' | 'error';
608
- /**
609
- * Hook for signaling intent to buy tokens via the V3 Orchestrator.
610
- *
611
- * Delegates to ProveXClient.signalIntent() for the full multi-step flow:
612
- * 1. Fetch payee details from indexer
613
- * 2. Request gating signature from API
614
- * 3. Simulate, submit, and parse IntentSignaled event
615
- *
616
- * @example
617
- * ```ts
618
- * const { startOrder, status, message, isLoading } = useSignalIntent({
619
- * wallet,
620
- * chainId: 369,
621
- * deposit: selectedDeposit,
622
- * onSuccess: (intentHash) => navigate(`/verify/${intentHash}`),
623
- * })
624
- * ```
625
- */
626
- declare function useSignalIntent({ wallet, onSuccess, onFailure, deposit, refetchDeposits, }: {
627
- /** Wallet adapter for signing transactions. */
628
- wallet: WalletAdapter;
629
- /** @deprecated Chain is resolved from ProvexProvider. Kept for API compat. */
630
- chainId?: ChainId;
631
- /** Called when the intent is signaled successfully. */
632
- onSuccess: (intentHash: Hex) => void;
633
- /** Called when the flow fails. */
634
- onFailure?: () => void;
635
- /** The deposit to signal intent against. */
636
- deposit: DepositInfo | null;
637
- /** Called on failure to refresh deposit data. */
638
- refetchDeposits?: () => void;
639
- }): {
640
- startOrder: ({ paymentMethod, depositId, tokenAmount, toAddress, fiatCurrencyCode, conversionRate, subProvider, }: {
641
- paymentMethod: Hex;
642
- depositId: bigint;
643
- tokenAmount: bigint;
644
- toAddress: Hex;
645
- fiatCurrencyCode: Hex;
646
- conversionRate: bigint;
647
- subProvider?: SubProviderKey;
648
- }) => Promise<void>;
649
- status: SignalIntentStatus;
650
- message: string | null;
651
- isLoading: boolean;
652
- };
653
-
654
- /**
655
- * @fileoverview Hook for calculating reputation-based trading limits.
656
- *
657
- * Applies tier-based restrictions on transaction caps and cooldowns.
658
- * Pure computation -- no Ponder, no contract reads.
659
- *
660
- * @see {@link useReputation} for fetching the user's tier
661
- * @see {@link @provex/utils/reputation} for tier definitions
662
- */
663
-
664
- /** Input parameters for calculating reputation limits. */
665
- interface ReputationLimitsParams {
666
- /** Current chain ID */
667
- chainId: ChainId;
668
- /** Currently selected payment method */
669
- selectedPaymentMethod: ProviderKey;
670
- /** User's reputation tier */
671
- tier: TakerTier;
672
- /** Amount in fiat currency (for cap exceeded check) - in token base units (e.g., 6 decimals for USDC) */
673
- amountInInt?: bigint | null;
674
- /** When the user's cooldown ends (from useReputation) */
675
- cooldownEndsAt?: Date | null;
676
- }
677
- /** Result of the useReputationLimits hook. */
678
- interface ReputationLimits {
679
- /** Whether reputation limits apply */
680
- hasLimits: boolean;
681
- /** Alternative providers with no cooldown */
682
- noCooldownProviders: ProviderKey[];
683
- /** Cooldown hours for the selected payment method (category, not remaining) */
684
- selectedProviderCooldownHours: number;
685
- /** Remaining cooldown time in formatted string (e.g., "5h 30m") - null if not on cooldown */
686
- cooldownRemaining: string | null;
687
- /** Whether user is currently on cooldown for the selected payment method */
688
- isOnCooldown: boolean;
689
- /** Effective cap in USD for the selected payment method (null if no cap) */
690
- effectiveCap: number | null;
691
- /** Whether the current amount exceeds the cap */
692
- amountExceedsCap: boolean;
693
- /** Error message when cap is exceeded */
694
- capExceededMessage: string | null;
695
- }
696
- /**
697
- * Hook to calculate reputation-based limits for payment methods.
698
- *
699
- * @example
700
- * ```ts
701
- * const {
702
- * noCooldownProviders,
703
- * selectedProviderCooldownHours,
704
- * effectiveCap,
705
- * amountExceedsCap,
706
- * capExceededMessage,
707
- * } = useReputationLimits({
708
- * chainId,
709
- * selectedPaymentMethod,
710
- * tier: reputation.tier,
711
- * amountInInt,
712
- * })
713
- * ```
714
- */
715
- declare function useReputationLimits({ chainId, selectedPaymentMethod, tier, amountInInt, cooldownEndsAt, }: ReputationLimitsParams): ReputationLimits;
14
+ import '@tanstack/react-query';
15
+ import '@provex/utils/currencies';
716
16
 
717
17
  /**
718
18
  * @fileoverview Hook for reading protocol fee configuration.
719
19
  *
720
20
  * Fetches the current protocol fee percentage and recipient address
721
- * from the Orchestrator contract via wagmi.
21
+ * from the Orchestrator contract via the ProvexProvider's public client.
722
22
  *
723
23
  * @remarks
724
24
  * Fees may be stored as basis points (bps) or 18-decimal precision
@@ -766,7 +66,7 @@ interface UseProtocolFeesParams {
766
66
  *
767
67
  * Fee precision is automatically detected and normalized to basis points.
768
68
  *
769
- * Requires a wagmi `WagmiProvider` ancestor in the component tree.
69
+ * Requires a `ProvexProvider` ancestor.
770
70
  *
771
71
  * @param params - Hook parameters
772
72
  * @returns Protocol fee data and loading state
@@ -845,6 +145,9 @@ declare function getTierDisplayInfo(tier: TakerTier): {
845
145
  * 2. Orchestrator → paymentVerifierRegistry()
846
146
  * 3. PaymentVerifierRegistry → getVerifier(paymentMethodId)
847
147
  * 4. UnifiedPaymentVerifier → nullifierRegistry()
148
+ *
149
+ * Requires a `ProvexProvider` ancestor with a `publicClient` (or one
150
+ * will be auto-constructed from `config.chain`).
848
151
  */
849
152
 
850
153
  /**
@@ -852,8 +155,6 @@ declare function getTierDisplayInfo(tier: TakerTier): {
852
155
  *
853
156
  * The nullifier is derived from paymentMethod and paymentId to prevent double-spending.
854
157
  *
855
- * Requires a wagmi `WagmiProvider` ancestor in the component tree.
856
- *
857
158
  * @param escrowAddress - The V3 escrow contract address
858
159
  * @param paymentMethodId - The payment method ID (bytes32 hash)
859
160
  * @param chainId - The chain ID
@@ -863,10 +164,10 @@ declare function useNullifierRegistry({ escrowAddress, paymentMethodId, chainId,
863
164
  paymentMethodId: Hex | undefined;
864
165
  chainId: number;
865
166
  }): {
866
- orchestratorAddress: Hex | undefined;
867
- paymentVerifierRegistryAddress: Hex | undefined;
868
- verifierAddress: Hex | undefined;
869
- nullifierRegistryAddress: Hex | undefined;
167
+ orchestratorAddress: `0x${string}` | undefined;
168
+ paymentVerifierRegistryAddress: `0x${string}` | undefined;
169
+ verifierAddress: `0x${string}` | undefined;
170
+ nullifierRegistryAddress: `0x${string}` | undefined;
870
171
  isLoading: boolean;
871
172
  checkNullifierUsed: (nullifier: Hex) => Promise<boolean | null>;
872
173
  };
@@ -881,6 +182,10 @@ declare function useNullifierRegistry({ escrowAddress, paymentMethodId, chainId,
881
182
  * @remarks
882
183
  * Approval is required before createDeposit or addFunds can transfer
883
184
  * tokens to the escrow contract.
185
+ *
186
+ * Reads use the `publicClient` registered on `ProvexProvider` (auto-built
187
+ * from `config.chain` if not supplied). Writes require a `wallet` on the
188
+ * same provider.
884
189
  */
885
190
 
886
191
  declare const useAllowance: ({ token, spender, account, balance, defaultAllowance, onSuccess, onError, onSettled, }: {
@@ -907,7 +212,7 @@ declare const useAllowance: ({ token, spender, account, balance, defaultAllowanc
907
212
  * @fileoverview Hook for canceling an active intent.
908
213
  *
909
214
  * V3: Delegates to ProveXClient.cancelIntent (Orchestrator).
910
- * V2: Falls back to direct wagmi writeContract (legacy Escrow).
215
+ * V2: Falls back to direct viem transaction via WalletAdapter (legacy Escrow).
911
216
  */
912
217
 
913
218
  /** Status values for the cancel intent operation. */
@@ -915,7 +220,8 @@ type CancelIntentStatus = 'idle' | 'prompt_wallet_confirm' | 'writing_tx' | 'suc
915
220
  /**
916
221
  * Hook to cancel an intent with automatic v2/v3 version detection.
917
222
  *
918
- * V3 delegates to ProveXClient. V2 uses wagmi directly (legacy).
223
+ * V3 delegates to ProveXClient. V2 falls back to a direct WalletAdapter
224
+ * call. Both paths source the wallet + public client from ProvexProvider.
919
225
  */
920
226
  declare const useCancelIntent: ({ onSuccess, onMutate, onError, onSettled, chainId, escrowAddress: providedEscrowAddress, version: explicitVersion, }: {
921
227
  onSuccess?: () => void;
@@ -937,7 +243,7 @@ declare const useCancelIntent: ({ onSuccess, onMutate, onError, onSettled, chain
937
243
  * @fileoverview Hook for releasing funds back to payer.
938
244
  *
939
245
  * V3: Delegates to ProveXClient.releaseFundsToPayer (Orchestrator).
940
- * V2: Falls back to direct wagmi writeContract (legacy Escrow).
246
+ * V2: Falls back to direct viem transaction via WalletAdapter (legacy Escrow).
941
247
  */
942
248
 
943
249
  /** Status values for the release funds operation. */
@@ -945,7 +251,8 @@ type ReleaseFundsStatus = 'idle' | 'prompt_wallet_confirm' | 'writing_tx' | 'suc
945
251
  /**
946
252
  * Hook to release funds back to payer with automatic v2/v3 version detection.
947
253
  *
948
- * V3 delegates to ProveXClient. V2 uses wagmi directly (legacy).
254
+ * V3 delegates to ProveXClient. V2 falls back to a direct WalletAdapter
255
+ * call. Both paths source the wallet + public client from ProvexProvider.
949
256
  */
950
257
  declare const useReleaseFundsToPayer: ({ onSuccess, onSettled, chainId, escrowAddress: providedEscrowAddress, version: explicitVersion, }: {
951
258
  onSuccess?: () => void;
@@ -970,8 +277,8 @@ type CreateDepositParams = CreateDepositRawParams;
970
277
  /**
971
278
  * Hook for interacting with v3 Escrow contract.
972
279
  *
973
- * All write methods delegate to ProveXClient. Reads use wagmi for
974
- * automatic cache management.
280
+ * All write methods delegate to ProveXClient. Reads use the
281
+ * ProvexProvider's public client with tanstack-query caching.
975
282
  */
976
283
  declare const useV3Escrow: ({ chainId, escrowAddress, onSlowSync, onTransactionConfirmed, onError, }: {
977
284
  chainId?: ChainId | null;
@@ -1041,8 +348,8 @@ declare const useV3Escrow: ({ chainId, escrowAddress, onSlowSync, onTransactionC
1041
348
  getDeposit: (depositId: bigint) => Promise<unknown>;
1042
349
  getAccountDeposits: (account: Hex) => Promise<unknown>;
1043
350
  reset: () => void;
1044
- refetchOrchestrator: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<`0x${string}`, viem.ReadContractErrorType>>;
1045
- refetchDepositCounter: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<bigint, viem.ReadContractErrorType>>;
351
+ refetchOrchestrator: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<`0x${string}`, Error>>;
352
+ refetchDepositCounter: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<bigint, Error>>;
1046
353
  };
1047
354
 
1048
355
  /**
@@ -1100,7 +407,7 @@ declare const useTransactionWithIndexer: (options?: UseTransactionWithIndexerOpt
1100
407
  waitForTransaction: ({ hash, chainId, action, }: TransactionSyncOptions) => Promise<void>;
1101
408
  waitForMutation: ({ hash, depositId, chainId, status, action, }: MutationSyncOptions) => Promise<void>;
1102
409
  reset: () => void;
1103
- setPhase: React$1.Dispatch<React$1.SetStateAction<TransactionPhase>>;
410
+ setPhase: React.Dispatch<React.SetStateAction<TransactionPhase>>;
1104
411
  };
1105
412
 
1106
413
  /**
@@ -1411,285 +718,6 @@ declare function createProveXClient(config: ProveXClientConfig): ProveXClient;
1411
718
  */
1412
719
  declare function useProveXClient(wallet?: WalletAdapter): ProveXClient;
1413
720
 
1414
- /**
1415
- * @fileoverview Bridge wagmi's wallet to the WalletAdapter interface.
1416
- *
1417
- * Creates a memoized WalletAdapter from wagmi's `useWalletClient` and
1418
- * `useAccount` hooks. Pass the result to `useProveXClient(wallet)` or
1419
- * directly to any hook that accepts a WalletAdapter.
1420
- */
1421
-
1422
- /**
1423
- * Create a WalletAdapter from the connected wagmi wallet.
1424
- *
1425
- * Returns `null` when no wallet is connected.
1426
- *
1427
- * @example
1428
- * ```tsx
1429
- * const wallet = useWagmiWallet()
1430
- * const client = useProveXClient(wallet ?? undefined)
1431
- * ```
1432
- */
1433
- declare function useWagmiWallet(): WalletAdapter | null;
1434
-
1435
- /** Intent status values representing the lifecycle state. */
1436
- declare const intentStatuses: {
1437
- readonly pending: "pending";
1438
- readonly signalled: "signalled";
1439
- readonly fulfilled: "fulfilled";
1440
- readonly pruned: "pruned";
1441
- };
1442
- type IntentStatus = (typeof intentStatuses)[keyof typeof intentStatuses];
1443
- /** Payee details from the API. */
1444
- interface PayeeInfo {
1445
- payeeId?: string;
1446
- name?: string;
1447
- platformName?: string;
1448
- [key: string]: unknown;
1449
- }
1450
- /**
1451
- * Hook to fetch intent details and payee information.
1452
- *
1453
- * @param intentHash - The intent hash to look up
1454
- * @param chainId - The chain ID to query
1455
- * @returns Intent details, payee info, and loading state
1456
- */
1457
- declare function usePayeeDetails({ intentHash, chainId, }: {
1458
- intentHash: Hex | null;
1459
- chainId: ChainId;
1460
- }): {
1461
- intentStatus: IntentStatus | null;
1462
- isFetching: boolean;
1463
- isValid: boolean;
1464
- intent: {
1465
- owner: `0x${string}`;
1466
- to: `0x${string}`;
1467
- escrow: `0x${string}`;
1468
- depositId: bigint;
1469
- amount: bigint;
1470
- timestamp: bigint;
1471
- paymentMethod: `0x${string}`;
1472
- fiatCurrency: `0x${string}`;
1473
- conversionRate: bigint;
1474
- } | null;
1475
- providerKey: _provex_utils_payment.ProviderKey | null;
1476
- userId: `0x${string}` | null;
1477
- payeeDetails: PayeeInfo | null;
1478
- deposit: IndexedDeposit | null;
1479
- expiryTime: bigint | null;
1480
- isV2Intent: boolean;
1481
- isPruned: boolean;
1482
- prunedAt: bigint | null;
1483
- isFulfilled: boolean;
1484
- refetch: () => void;
1485
- refetchAll: () => Promise<IntentStatus | null>;
1486
- };
1487
-
1488
- /** Configuration for ProvexProvider. */
1489
- interface ProvexConfig {
1490
- /** Backend API URL (e.g. "https://app.provex.com") */
1491
- apiUrl: string;
1492
- /** The viem Chain object. Import from `viem/chains`. */
1493
- chain: Chain;
1494
- /** @deprecated Use `chain.id` — kept for backward compat during migration. */
1495
- chainId?: ChainId;
1496
- }
1497
- /** Buy flow phases. */
1498
- type BuyPhase = 'browse' | 'committed' | 'proving' | 'complete';
1499
- /** Theme overrides applied as CSS custom properties on the root element. */
1500
- interface ProvexTheme {
1501
- accent?: string;
1502
- background?: string;
1503
- backgroundCard?: string;
1504
- text?: string;
1505
- textMuted?: string;
1506
- border?: string;
1507
- error?: string;
1508
- radius?: string;
1509
- font?: string;
1510
- }
1511
- /** Options for the useProvexBuy hook. */
1512
- interface UseProvexBuyOptions {
1513
- /** Wallet adapter — host app's wallet connection. */
1514
- wallet: WalletAdapter;
1515
- /** Called when the user signals intent (USDC reserved). */
1516
- onIntentSignaled?: (intentHash: string, chainId: number) => void;
1517
- /** Called when the full flow completes (USDC released). */
1518
- onComplete?: (intentHash: string, chainId: number) => void;
1519
- /** Restrict to specific payment methods. */
1520
- paymentMethods?: ProviderKey[];
1521
- }
1522
- /** Return value of the useProvexBuy hook — the full buy-flow state machine. */
1523
- interface UseProvexBuyReturn {
1524
- /** Current phase of the buy flow. */
1525
- phase: BuyPhase;
1526
- /** Fiat amount entered by the user (string for input binding). */
1527
- amount: string;
1528
- /** Set the fiat amount. */
1529
- setAmount: (value: string) => void;
1530
- /** Currently selected payment method, or empty string if none. */
1531
- selectedPaymentMethod: ProviderKey | '';
1532
- /** Set the selected payment method. */
1533
- setSelectedPaymentMethod: (method: ProviderKey) => void;
1534
- /** Payment methods available for the current chain. */
1535
- availablePaymentMethods: ProviderKey[];
1536
- /** All deposits matching the current criteria. */
1537
- deposits: DepositInfo[];
1538
- /** The best deposit selected for the current amount. */
1539
- selectedDeposit: DepositInfo | null;
1540
- /** Manually select a deposit (advanced use). */
1541
- selectDeposit: (deposit: DepositInfo) => void;
1542
- /** True while deposits are loading for the first time. */
1543
- isLoadingDeposits: boolean;
1544
- /** Best rate for the current amount/payment method (raw 18-decimal). */
1545
- rate: bigint | null;
1546
- /** Human-readable rate string (e.g. "1 USDC = $1.01"). */
1547
- rateDisplay: string | null;
1548
- /** Token amount the user will receive (base units). */
1549
- tokenAmount: bigint | null;
1550
- /** Human-readable token amount (e.g. "99.50"). */
1551
- tokenAmountDisplay: string | null;
1552
- /** Token info for the current chain. */
1553
- token: TokenInfo | null;
1554
- /** Currency info (e.g. USD). */
1555
- currency: Currency | null;
1556
- /** User reputation data. */
1557
- reputation: UserReputation;
1558
- /** Reputation-based limits for the selected payment method. */
1559
- limits: ReputationLimits;
1560
- /** Protocol fee percentage string (e.g. "0%"), or null if loading. */
1561
- feePercentage: string | null;
1562
- /** Seller's payment details (name, handle, platform). */
1563
- payeeDetails: PayeeInfo | null;
1564
- /** Seller's display name. */
1565
- payeeName: string | null;
1566
- /** Seller's payment handle (e.g. Venmo username, Zelle email). */
1567
- payeeId: string | null;
1568
- /** True while payee details are loading. */
1569
- isPayeeLoading: boolean;
1570
- /** Intent expiry time. */
1571
- intentExpiryTime: Date | null;
1572
- /** Whether the intent has expired (pruned). */
1573
- isIntentExpired: boolean;
1574
- /** Indexed intent lifecycle status (signalled, fulfilled, pruned). */
1575
- indexedIntentStatus: IntentStatus | null;
1576
- /** Whether the order form can be submitted. */
1577
- canSubmit: boolean;
1578
- /** User-facing validation message, or null when valid. */
1579
- validationMessage: string | null;
1580
- /** Submit the order (signal intent on-chain). */
1581
- submitOrder: () => Promise<void>;
1582
- /** Confirm payment was sent (transitions to proving/complete). */
1583
- confirmPayment: () => void;
1584
- /** Reset the flow back to browse. */
1585
- reset: () => void;
1586
- /** Intent hash after successful order submission. */
1587
- intentHash: Hex | null;
1588
- /** Current status of the signal intent flow. */
1589
- intentStatus: SignalIntentStatus;
1590
- /** Error message from the intent flow. */
1591
- intentError: string | null;
1592
- /** True while the intent is being submitted. */
1593
- isSubmitting: boolean;
1594
- /** Chain ID for the current configuration. */
1595
- chainId: ChainId;
1596
- }
1597
- /** Props for the ProvexBuy widget component (Layer 3). */
1598
- interface BuyProps {
1599
- /** Wallet adapter — host app's wallet connection. */
1600
- wallet: WalletAdapter;
1601
- /** Called when the user signals intent (USDC reserved). */
1602
- onIntentSignaled?: (intentHash: string, chainId: number) => void;
1603
- /** Called when the full flow completes (USDC released). */
1604
- onComplete?: (intentHash: string, chainId: number) => void;
1605
- /** Restrict to specific payment methods. */
1606
- paymentMethods?: ProviderKey[];
1607
- /** CSS class name for the root container. */
1608
- className?: string;
1609
- /** Inline styles for the root container. */
1610
- style?: React.CSSProperties;
1611
- /** Theme overrides applied as CSS custom properties. */
1612
- theme?: ProvexTheme;
1613
- }
1614
- /** Common props accepted by all phase components. */
1615
- interface PhaseComponentProps {
1616
- /** CSS class name. */
1617
- className?: string;
1618
- /** Inline styles. */
1619
- style?: React.CSSProperties;
1620
- }
1621
- /** Props for a phase component with a custom render prop. */
1622
- interface PhaseRenderProps<TState> extends PhaseComponentProps {
1623
- /** Custom render function — receives the phase state, returns JSX. */
1624
- render?: (state: TState) => React.ReactNode;
1625
- }
1626
-
1627
- /**
1628
- * @fileoverview Thin API client for @provex/react.
1629
- *
1630
- * Provides typed get/post methods for the Provex backend API.
1631
- * No external dependencies — uses the Fetch API directly.
1632
- */
1633
- /** API client for making typed requests to the Provex backend. */
1634
- interface ApiClient {
1635
- /** Send a GET request and parse the JSON response. */
1636
- get: <T>(path: string, options?: RequestInit) => Promise<T>;
1637
- /** Send a POST request with a JSON body and parse the response. */
1638
- post: <T>(path: string, body: unknown, options?: RequestInit) => Promise<T>;
1639
- }
1640
- /** Create an API client that targets the given base URL. */
1641
- declare function createApiClient(apiUrl: string): ApiClient;
1642
-
1643
- /** Shape of the context value provided by ProvexProvider. */
1644
- interface ProvexContextValue {
1645
- /** User-supplied configuration (apiUrl, chainId). */
1646
- config: ProvexConfig;
1647
- /** Data source adapter for indexer queries. */
1648
- indexer: IndexerAdapter;
1649
- /** Thin fetch wrapper for the Provex backend API. */
1650
- apiClient: ApiClient;
1651
- }
1652
- /** Props for the ProvexProvider component. */
1653
- interface ProvexProviderProps {
1654
- /** Protocol configuration. */
1655
- config: ProvexConfig;
1656
- /**
1657
- * Data source adapter. Implement IndexerAdapter against any backend:
1658
- * - `createPonderAdapter()` from `@provex/indexer-client` (default for Provex apps)
1659
- * - Custom REST, Graph, or RPC implementation
1660
- */
1661
- indexer: IndexerAdapter;
1662
- /** Optional external QueryClient — if omitted, a default one is created. */
1663
- queryClient?: QueryClient;
1664
- /** Child components that consume the context. */
1665
- children: React__default.ReactNode;
1666
- }
1667
- /**
1668
- * ProvexProvider — wrap your app (or a subtree) with this to enable
1669
- * Provex hooks and components.
1670
- *
1671
- * @example
1672
- * ```tsx
1673
- * import { createPonderAdapter } from '@provex/indexer-client'
1674
- *
1675
- * const indexer = createPonderAdapter()
1676
- *
1677
- * <ProvexProvider
1678
- * indexer={indexer}
1679
- * config={{ apiUrl: 'https://app.provex.com', chainId: 369 }}
1680
- * >
1681
- * <App />
1682
- * </ProvexProvider>
1683
- * ```
1684
- */
1685
- declare function ProvexProvider({ config, indexer, queryClient, children, }: ProvexProviderProps): react_jsx_runtime.JSX.Element;
1686
- /**
1687
- * useProvex — access the Provex context (config, indexer, apiClient).
1688
- *
1689
- * Must be called within a ProvexProvider. Throws if used outside the provider.
1690
- */
1691
- declare function useProvex(): ProvexContextValue;
1692
-
1693
721
  /**
1694
722
  * @fileoverview useProvexBuy — headless state machine for the buy flow.
1695
723
  *
@@ -1831,27 +859,4 @@ declare function CompletePhase({ className, style, render, }: PhaseRenderProps<C
1831
859
  */
1832
860
  declare function ProvexBuy({ wallet, onIntentSignaled, onComplete, paymentMethods, className, style, theme, }: BuyProps): react_jsx_runtime.JSX.Element;
1833
861
 
1834
- /** Props for the ProvexBuyWagmi component. Same as BuyProps minus `wallet`. */
1835
- interface ProvexBuyWagmiProps {
1836
- /** Called when the user signals intent (USDC reserved). */
1837
- onIntentSignaled?: (intentHash: string, chainId: number) => void;
1838
- /** Called when the full flow completes (USDC released). */
1839
- onComplete?: (intentHash: string, chainId: number) => void;
1840
- /** Restrict to specific payment methods. */
1841
- paymentMethods?: ProviderKey[];
1842
- /** CSS class name for the root container. */
1843
- className?: string;
1844
- /** Inline styles for the root container. */
1845
- style?: React__default.CSSProperties;
1846
- /** Theme overrides applied as CSS custom properties. */
1847
- theme?: ProvexTheme;
1848
- }
1849
- /**
1850
- * ProvexBuyWagmi — drop-in buy widget for wagmi apps.
1851
- *
1852
- * Reads the connected wallet from wagmi context automatically.
1853
- * No need to create a WalletAdapter manually.
1854
- */
1855
- declare function ProvexBuyWagmi({ onIntentSignaled, onComplete, paymentMethods, className, style, theme, }: ProvexBuyWagmiProps): react_jsx_runtime.JSX.Element;
1856
-
1857
- export { type ApiClient, type AttestationParams, type AttestationResponse, BrowsePhase, type BrowsePhaseState, type BuyPhase, type BuyProps, type CancelIntentStatus, CommittedPhase, type CommittedPhaseState, CompletePhase, type CompletePhaseState, type CreateDepositParams$1 as CreateDepositParams, type CreateDepositRawParams, type DepositInfo, type DepositPaymentMethod, type IndexedDeposit, type IndexedIntent, type IndexedVerifier, type IndexerAdapter, type IntentStatus, type MakerRegistrationParams, type MutationSyncOptions, type PaginatedResult, type PaginationOptions, type PayeeDetails, type PayeeInfo, type PhaseComponentProps, type PhaseRenderProps, type PreparedTransaction, type ProtocolFeesResult, ProveXClient, type ProveXClientConfig, ProveXError, type ProveXErrorCode, ProvexBuy, ProvexBuyProvider, type ProvexBuyProviderProps, ProvexBuyWagmi, type ProvexBuyWagmiProps, type ProvexConfig, type ProvexContextValue, ProvexProvider, type ProvexProviderProps, type ProvexTheme, ProvingPhase, type ProvingPhaseState, type ReleaseFundsStatus, type ReputationData, type ReputationLimits, type ReputationLimitsParams, type SignalIntentParams, type SignalIntentRawParams, type SignalIntentResult, type SignalIntentStatus, type TransactionPhase, type TransactionResult, type TransactionSyncOptions, type UseProtocolFeesParams, type UseProvexBuyOptions, type UseProvexBuyReturn, type UseTransactionWithIndexerOptions, type CreateDepositParams as V3EscrowCreateDepositParams, type V3EscrowStatus, type WalletAdapter, type WritableMethod, createApiClient, createProveXClient, getRate, getTierDisplayInfo, intentStatuses, useAllowance, useCancelIntent, useDeposits, useNullifierRegistry, usePayeeDetails, useProtocolFeePercentage, useProtocolFees, useProveXClient, useProvex, useProvexBuy, useProvexBuyContext, useReleaseFundsToPayer, useReputation, useReputationLimits, useSignalIntent, useTransactionWithIndexer, useV3Escrow, useWagmiWallet };
862
+ export { AttestationParams, AttestationResponse, BrowsePhase, type BrowsePhaseState, BuyProps, type CancelIntentStatus, CommittedPhase, type CommittedPhaseState, CompletePhase, type CompletePhaseState, CreateDepositParams$1 as CreateDepositParams, CreateDepositRawParams, IndexedDeposit, IndexedIntent, IndexerAdapter, MakerRegistrationParams, type MutationSyncOptions, PaginatedResult, PaginationOptions, PayeeDetails, PhaseRenderProps, PreparedTransaction, type ProtocolFeesResult, ProveXClient, ProveXClientConfig, ProvexBuy, ProvexBuyProvider, type ProvexBuyProviderProps, ProvingPhase, type ProvingPhaseState, type ReleaseFundsStatus, ReputationData, SignalIntentParams, SignalIntentResult, type TransactionPhase, TransactionResult, type TransactionSyncOptions, type UseProtocolFeesParams, UseProvexBuyOptions, UseProvexBuyReturn, type UseTransactionWithIndexerOptions, type CreateDepositParams as V3EscrowCreateDepositParams, type V3EscrowStatus, WalletAdapter, WritableMethod, createProveXClient, getTierDisplayInfo, useAllowance, useCancelIntent, useNullifierRegistry, useProtocolFeePercentage, useProtocolFees, useProveXClient, useProvexBuy, useProvexBuyContext, useReleaseFundsToPayer, useReputation, useTransactionWithIndexer, useV3Escrow };