@zkp2p/sdk 0.1.0-rc.8 → 0.1.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.
Files changed (37) hide show
  1. package/README.md +73 -14
  2. package/dist/{chunk-6YLLNF6Q.mjs → chunk-JH74HXTS.mjs} +103 -11
  3. package/dist/chunk-JH74HXTS.mjs.map +1 -0
  4. package/dist/{chunk-456CSWDT.mjs → chunk-YLITJ7SI.mjs} +2 -2
  5. package/dist/{chunk-456CSWDT.mjs.map → chunk-YLITJ7SI.mjs.map} +1 -1
  6. package/dist/{chunk-PQQWQF3C.mjs → chunk-ZFBH4HD7.mjs} +10 -4
  7. package/dist/chunk-ZFBH4HD7.mjs.map +1 -0
  8. package/dist/{currency-5RZ6VCEA.mjs → currency-PKI2EGJD.mjs} +3 -4
  9. package/dist/{currency-5RZ6VCEA.mjs.map → currency-PKI2EGJD.mjs.map} +1 -1
  10. package/dist/index.cjs +3152 -5150
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.mts +73 -34
  13. package/dist/index.d.ts +73 -34
  14. package/dist/index.mjs +2553 -1604
  15. package/dist/index.mjs.map +1 -1
  16. package/dist/protocolViewerParsers-QVG4JP23.mjs +4 -0
  17. package/dist/{protocolViewerParsers-EUBHHIPL.mjs.map → protocolViewerParsers-QVG4JP23.mjs.map} +1 -1
  18. package/dist/react.cjs.map +1 -1
  19. package/dist/react.d.mts +3 -2
  20. package/dist/react.d.ts +3 -2
  21. package/dist/react.mjs +2 -2
  22. package/dist/{vaultUtils-CZKrvm9v.d.mts → vaultUtils-J1WboG1T.d.mts} +123 -228
  23. package/dist/{vaultUtils-CZKrvm9v.d.ts → vaultUtils-J1WboG1T.d.ts} +123 -228
  24. package/package.json +10 -3
  25. package/dist/chunk-37HJPVJE.mjs +0 -11
  26. package/dist/chunk-37HJPVJE.mjs.map +0 -1
  27. package/dist/chunk-6YLLNF6Q.mjs.map +0 -1
  28. package/dist/chunk-E5SYWOUK.mjs +0 -231
  29. package/dist/chunk-E5SYWOUK.mjs.map +0 -1
  30. package/dist/chunk-F7USDS7O.mjs +0 -408
  31. package/dist/chunk-F7USDS7O.mjs.map +0 -1
  32. package/dist/chunk-PQQWQF3C.mjs.map +0 -1
  33. package/dist/constants-YK56UVLH.mjs +0 -5
  34. package/dist/constants-YK56UVLH.mjs.map +0 -1
  35. package/dist/paymentResolution-3TC4HRHU.mjs +0 -4
  36. package/dist/paymentResolution-3TC4HRHU.mjs.map +0 -1
  37. package/dist/protocolViewerParsers-EUBHHIPL.mjs +0 -6
package/dist/react.d.mts CHANGED
@@ -1,6 +1,7 @@
1
- import { Z as Zkp2pClient, S as SignalIntentMethodParams, a5 as PreparedTransaction, a8 as TakerTier, f as GetTakerTierRequest, g as GetTakerTierResponse, F as FulfillIntentMethodParams, bm as SendTransactionFn, bn as SendBatchFn, bk as DelegationDepositTarget, bl as BatchResult } from './vaultUtils-CZKrvm9v.mjs';
2
- export { bi as DelegationRoute, bj as DelegationState, bo as VAULT_ZERO_ADDRESS, bc as ZERO_RATE_MANAGER_ID, bp as asErrorMessage, bq as assertDelegationMethodSupport, bh as classifyDelegationState, bg as getDelegationRoute, bd as isZeroRateManagerId, be as normalizeRateManagerId, bf as normalizeRegistry } from './vaultUtils-CZKrvm9v.mjs';
1
+ import { Z as Zkp2pClient, i as SignalIntentMethodParams, ac as PreparedTransaction, af as TakerTier, f as GetTakerTierRequest, g as GetTakerTierResponse, F as FulfillIntentMethodParams, bu as SendTransactionFn, bv as SendBatchFn, bs as DelegationDepositTarget, bt as BatchResult } from './vaultUtils-J1WboG1T.mjs';
2
+ export { bq as DelegationRoute, br as DelegationState, bw as VAULT_ZERO_ADDRESS, bk as ZERO_RATE_MANAGER_ID, bx as asErrorMessage, by as assertDelegationMethodSupport, bp as classifyDelegationState, bo as getDelegationRoute, bl as isZeroRateManagerId, bm as normalizeRateManagerId, bn as normalizeRegistry } from './vaultUtils-J1WboG1T.mjs';
3
3
  import { Hash, Address, Hex } from 'viem';
4
+ import '@zkp2p/indexer-schema';
4
5
  import 'abitype';
5
6
 
6
7
  interface UseCreateDepositOptions {
package/dist/react.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { Z as Zkp2pClient, S as SignalIntentMethodParams, a5 as PreparedTransaction, a8 as TakerTier, f as GetTakerTierRequest, g as GetTakerTierResponse, F as FulfillIntentMethodParams, bm as SendTransactionFn, bn as SendBatchFn, bk as DelegationDepositTarget, bl as BatchResult } from './vaultUtils-CZKrvm9v.js';
2
- export { bi as DelegationRoute, bj as DelegationState, bo as VAULT_ZERO_ADDRESS, bc as ZERO_RATE_MANAGER_ID, bp as asErrorMessage, bq as assertDelegationMethodSupport, bh as classifyDelegationState, bg as getDelegationRoute, bd as isZeroRateManagerId, be as normalizeRateManagerId, bf as normalizeRegistry } from './vaultUtils-CZKrvm9v.js';
1
+ import { Z as Zkp2pClient, i as SignalIntentMethodParams, ac as PreparedTransaction, af as TakerTier, f as GetTakerTierRequest, g as GetTakerTierResponse, F as FulfillIntentMethodParams, bu as SendTransactionFn, bv as SendBatchFn, bs as DelegationDepositTarget, bt as BatchResult } from './vaultUtils-J1WboG1T.js';
2
+ export { bq as DelegationRoute, br as DelegationState, bw as VAULT_ZERO_ADDRESS, bk as ZERO_RATE_MANAGER_ID, bx as asErrorMessage, by as assertDelegationMethodSupport, bp as classifyDelegationState, bo as getDelegationRoute, bl as isZeroRateManagerId, bm as normalizeRateManagerId, bn as normalizeRegistry } from './vaultUtils-J1WboG1T.js';
3
3
  import { Hash, Address, Hex } from 'viem';
4
+ import '@zkp2p/indexer-schema';
4
5
  import 'abitype';
5
6
 
6
7
  interface UseCreateDepositOptions {
package/dist/react.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { asErrorMessage, ZERO_ADDRESS, getDelegationRoute, assertDelegationMethodSupport, prepareClearDelegationTx, normalizeRateManagerId, normalizeRegistry, isZeroRateManagerId, assertAtomicDelegationSwitchSupport, prepareSetDelegationTx } from './chunk-456CSWDT.mjs';
2
- export { ZERO_ADDRESS as VAULT_ZERO_ADDRESS, ZERO_RATE_MANAGER_ID, asErrorMessage, assertDelegationMethodSupport, classifyDelegationState, getDelegationRoute, isZeroRateManagerId, normalizeRateManagerId, normalizeRegistry } from './chunk-456CSWDT.mjs';
1
+ import { asErrorMessage, ZERO_ADDRESS, getDelegationRoute, assertDelegationMethodSupport, prepareClearDelegationTx, normalizeRateManagerId, normalizeRegistry, isZeroRateManagerId, assertAtomicDelegationSwitchSupport, prepareSetDelegationTx } from './chunk-YLITJ7SI.mjs';
2
+ export { ZERO_ADDRESS as VAULT_ZERO_ADDRESS, ZERO_RATE_MANAGER_ID, asErrorMessage, assertDelegationMethodSupport, classifyDelegationState, getDelegationRoute, isZeroRateManagerId, normalizeRateManagerId, normalizeRegistry } from './chunk-YLITJ7SI.mjs';
3
3
  import { useState, useCallback, useMemo, useEffect } from 'react';
4
4
  import { formatUnits } from 'viem';
5
5
 
@@ -1,3 +1,5 @@
1
+ import * as _zkp2p_indexer_schema from '@zkp2p/indexer-schema';
2
+ import { Deposit, DepositStatus as DepositStatus$2, IntentStatus as IntentStatus$1, DepositPaymentMethod, MethodCurrency, Intent as Intent$1, RateManager, ManagerAggregateStats, RateManagerRate, ManagerStats, DepositFundActivity, DepositDailySnapshot, ManagerDailySnapshot } from '@zkp2p/indexer-schema';
1
3
  import { Address, Hex, AccessList, AuthorizationList, WalletClient, Hash, PublicClient } from 'viem';
2
4
  import { Abi } from 'abitype';
3
5
 
@@ -293,6 +295,10 @@ declare function getRateManagerContracts(chainId: number, env?: RuntimeEnv): {
293
295
  };
294
296
  };
295
297
 
298
+ type PV_ReferralFee = {
299
+ recipient: `0x${string}`;
300
+ fee: bigint;
301
+ };
296
302
  type PV_Deposit = {
297
303
  depositor: string;
298
304
  delegate: string;
@@ -310,6 +316,7 @@ type PV_Deposit = {
310
316
  accruedMakerFees: bigint;
311
317
  accruedReferrerFees: bigint;
312
318
  intentGuardian: string;
319
+ retainOnEmpty: boolean;
313
320
  referrer: string;
314
321
  referrerFee: bigint;
315
322
  };
@@ -343,8 +350,7 @@ type PV_Intent = {
343
350
  paymentMethod: string;
344
351
  fiatCurrency: string;
345
352
  conversionRate: bigint;
346
- referrer: string;
347
- referrerFee: bigint;
353
+ referralFees: PV_ReferralFee[];
348
354
  postIntentHook: string;
349
355
  data: string;
350
356
  };
@@ -409,108 +415,21 @@ type DeploymentEnv = 'PRODUCTION' | 'PREPRODUCTION' | 'STAGING' | 'DEV' | 'LOCAL
409
415
  declare function defaultIndexerEndpoint(env?: DeploymentEnv): string;
410
416
 
411
417
  /**
412
- * Indexer entity types (GraphQL schema-aligned)
418
+ * Indexer entity types sourced from @zkp2p/indexer-schema.
413
419
  */
414
- type DepositStatus$1 = 'ACTIVE' | 'CLOSED';
415
- interface DepositEntity {
416
- id: string;
417
- chainId: number;
418
- escrowAddress: string;
419
- depositId: string;
420
- depositor: string;
421
- delegate?: string | null;
422
- rateManagerId?: string | null;
423
- rateManagerAddress?: string | null;
424
- delegatedAt?: string | null;
425
- token: string;
426
- remainingDeposits: string;
427
- intentAmountMin: string;
428
- intentAmountMax: string;
429
- acceptingIntents: boolean;
420
+
421
+ type WithOverrides<TBase, TOverrides> = Omit<TBase, keyof TOverrides> & TOverrides;
422
+ type DepositStatus$1 = `${DepositStatus$2}`;
423
+ type IntentStatus = `${IntentStatus$1}`;
424
+ type DepositEntity = WithOverrides<Deposit, {
430
425
  status: DepositStatus$1;
431
- outstandingIntentAmount: string;
432
- totalAmountTaken: string;
433
- totalWithdrawn: string;
434
- successRateBps?: number;
435
- totalIntents: number;
436
- signaledIntents: number;
437
- fulfilledIntents: number;
438
- prunedIntents: number;
439
- blockNumber: string;
440
- timestamp: string;
441
- txHash: string;
442
- updatedAt: string;
443
- }
444
- interface DepositPaymentMethodEntity {
445
- id: string;
446
- chainId: number;
447
- depositIdOnContract: string;
448
- depositId: string;
449
- paymentMethodHash: string;
450
- intentGatingService: string;
451
- payeeDetailsHash: string;
452
- active: boolean;
453
- }
454
- interface MethodCurrencyEntity {
455
- id: string;
456
- chainId: number;
457
- depositIdOnContract: string;
458
- depositId: string;
459
- paymentMethodHash: string;
460
- currencyCode: string;
461
- minConversionRate: string;
462
- conversionRate?: string | null;
463
- takerConversionRate?: string | null;
464
- managerFee?: string | null;
465
- rateSource?: string | null;
466
- oracleRate?: string | null;
467
- effectiveOracleRate?: string | null;
468
- lastOracleUpdatedAt?: string | null;
469
- adapter?: string | null;
470
- adapterConfig?: string | null;
471
- feed?: string | null;
472
- feedDecimals?: number | null;
473
- spreadBps?: number | null;
474
- maxStaleness?: string | null;
475
- invert?: boolean | null;
476
- kind?: string | null;
477
- managerRate?: string | null;
478
- rateManagerId?: string | null;
479
- }
480
- type IntentStatus = 'SIGNALED' | 'FULFILLED' | 'PRUNED' | 'MANUALLY_RELEASED';
481
- interface IntentEntity {
482
- id: string;
483
- intentHash: string;
484
- depositId: string;
485
- orchestratorAddress: string;
486
- verifier: string;
487
- owner: string;
488
- toAddress: string;
489
- amount: string;
490
- fiatCurrency: string;
491
- conversionRate: string;
426
+ retainOnEmpty?: boolean;
427
+ }>;
428
+ type DepositPaymentMethodEntity = DepositPaymentMethod;
429
+ type MethodCurrencyEntity = MethodCurrency;
430
+ type IntentEntity = WithOverrides<Intent$1, {
492
431
  status: IntentStatus;
493
- isExpired: boolean;
494
- signalTimestamp: string;
495
- expiryTime?: string;
496
- fulfillTimestamp?: string | null;
497
- pruneTimestamp?: string | null;
498
- updatedAt?: string | null;
499
- signalTxHash: string;
500
- fulfillTxHash?: string | null;
501
- pruneTxHash?: string | null;
502
- paymentMethodHash?: string | null;
503
- rateManagerId?: string | null;
504
- managerFee?: string | null;
505
- managerFeeRecipient?: string | null;
506
- managerFeeAmount?: string | null;
507
- paymentAmount?: string | null;
508
- paymentCurrency?: string | null;
509
- paymentTimestamp?: string | null;
510
- paymentId?: string | null;
511
- releasedAmount?: string | null;
512
- takerAmountNetFees?: string | null;
513
- }
432
+ }>;
514
433
  interface DepositWithRelations extends DepositEntity {
515
434
  paymentMethods?: DepositPaymentMethodEntity[];
516
435
  currencies?: MethodCurrencyEntity[];
@@ -521,41 +440,14 @@ type DepositFundActivityType = 'DEPOSIT_RECEIVED' | 'FUNDS_ADDED' | 'WITHDRAWN'
521
440
  * Chronological fund-movement log for a deposit.
522
441
  * One row per on-chain fund event (deposit, add, withdraw, close).
523
442
  */
524
- interface DepositFundActivityEntity {
525
- id: string;
526
- chainId: number;
527
- depositId: string;
528
- depositor: string;
443
+ type DepositFundActivityEntity = WithOverrides<DepositFundActivity, {
529
444
  activityType: DepositFundActivityType;
530
- amount: string;
531
- blockNumber: string;
532
- timestamp: string;
533
- txHash: string;
534
- }
445
+ }>;
535
446
  /**
536
447
  * Per-deposit daily rollup snapshot.
537
448
  * One row per deposit per day (UTC-aligned, 86400s buckets).
538
449
  */
539
- interface DepositDailySnapshotEntity {
540
- id: string;
541
- chainId: number;
542
- depositId: string;
543
- depositor: string;
544
- dayTimestamp: string;
545
- remainingDeposits: string;
546
- outstandingIntentAmount: string;
547
- totalAmountTaken: string;
548
- totalWithdrawn: string;
549
- signaledIntents: number;
550
- fulfilledIntents: number;
551
- prunedIntents: number;
552
- successRateBps: number;
553
- dailyVolume: string;
554
- dailyPnlUsdCents: string;
555
- cumulativeVolume: string;
556
- cumulativePnlUsdCents: string;
557
- updatedAt: string;
558
- }
450
+ type DepositDailySnapshotEntity = DepositDailySnapshot;
559
451
  interface DepositEventEntity {
560
452
  id: string;
561
453
  depositId: string;
@@ -577,31 +469,8 @@ interface IntentFulfillmentAmountsEntity {
577
469
  releasedAmount?: string | null;
578
470
  takerAmountNetFees?: string | null;
579
471
  }
580
- interface RateManagerEntity {
581
- id: string;
582
- chainId: number;
583
- rateManagerAddress: string;
584
- rateManagerId: string;
585
- manager: string;
586
- feeRecipient: string;
587
- maxFee: string;
588
- fee: string;
589
- minLiquidity?: string | null;
590
- name?: string | null;
591
- uri?: string | null;
592
- createdAt: string;
593
- updatedAt: string;
594
- }
595
- interface RateManagerRateEntity {
596
- id: string;
597
- chainId: number;
598
- rateManagerId: string;
599
- rateManagerAddress: string;
600
- paymentMethodHash: string;
601
- currencyCode: string;
602
- managerRate: string;
603
- updatedAt: string;
604
- }
472
+ type RateManagerEntity = RateManager;
473
+ type RateManagerRateEntity = RateManagerRate;
605
474
  interface RateManagerDelegationEntity {
606
475
  id: string;
607
476
  chainId: number;
@@ -612,54 +481,9 @@ interface RateManagerDelegationEntity {
612
481
  createdAt: string;
613
482
  updatedAt: string;
614
483
  }
615
- interface ManagerAggregateStatsEntity {
616
- id: string;
617
- chainId: number;
618
- rateManagerAddress?: string;
619
- rateManagerId: string;
620
- manager: string;
621
- totalFilledVolume: string;
622
- totalFeeAmount: string;
623
- totalPnlUsdCents: string;
624
- fulfilledIntents: number;
625
- currentDelegatedBalance: string;
626
- currentDelegatedDeposits: number;
627
- firstSeenAt?: string | null;
628
- updatedAt: string;
629
- }
630
- interface ManagerStatsEntity {
631
- id: string;
632
- chainId: number;
633
- rateManagerAddress: string;
634
- rateManagerId: string;
635
- depositId: string;
636
- depositor: string;
637
- currentDelegatedBalance: string;
638
- totalAmountTaken: string;
639
- totalWithdrawn: string;
640
- fulfilledIntents: number;
641
- prunedIntents: number;
642
- successRateBps: number;
643
- updatedAt: string;
644
- }
645
- interface ManagerDailySnapshotEntity {
646
- id: string;
647
- chainId: number;
648
- rateManagerAddress?: string;
649
- rateManagerId: string;
650
- dayTimestamp: string;
651
- tvl: string;
652
- delegatedDeposits: number;
653
- dailyVolume: string;
654
- dailyFees: string;
655
- dailyPnlUsdCents: string;
656
- dailyFulfilledIntents: number;
657
- cumulativeVolume: string;
658
- cumulativeFees: string;
659
- cumulativePnlUsdCents: string;
660
- cumulativeFulfilledIntents: number;
661
- updatedAt: string;
662
- }
484
+ type ManagerAggregateStatsEntity = ManagerAggregateStats;
485
+ type ManagerStatsEntity = ManagerStats;
486
+ type ManagerDailySnapshotEntity = ManagerDailySnapshot;
663
487
  interface ManualRateUpdateEntity {
664
488
  id: string;
665
489
  rateManagerId: string;
@@ -954,6 +778,10 @@ type TxOverrides = {
954
778
  */
955
779
  referrer?: string | string[];
956
780
  };
781
+ type ReferrerFeeConfig = {
782
+ recipient: `0x${string}`;
783
+ feeBps: number;
784
+ };
957
785
  /**
958
786
  * Parameters for fulfilling an intent with payment attestation
959
787
  */
@@ -1055,6 +883,7 @@ type QuoteRequest = {
1055
883
  destinationChainId: number;
1056
884
  destinationToken: string;
1057
885
  referrer?: string;
886
+ referrerFeeConfig?: ReferrerFeeConfig;
1058
887
  useMultihop?: boolean;
1059
888
  quotesToReturn?: number;
1060
889
  amount: string;
@@ -1118,6 +947,14 @@ type QuoteSingleResponse = {
1118
947
  intent: QuoteIntentResponse;
1119
948
  payeeData?: Record<string, string>;
1120
949
  };
950
+ type GetQuoteSingleResponse = QuoteSingleResponse & {
951
+ referrerFeeAmount?: string;
952
+ referrerFeeAmountFormatted?: string;
953
+ referrerFeeBps?: number;
954
+ /** Gross token amount to use when calling signalIntent with the same fee config */
955
+ signalIntentAmount?: string;
956
+ signalIntentAmountFormatted?: string;
957
+ };
1121
958
  type QuoteFeesResponse = {
1122
959
  zkp2pFee: string;
1123
960
  zkp2pFeeFormatted: string;
@@ -1154,6 +991,13 @@ type NearbySuggestions = {
1154
991
  /** Quotes at amounts above the requested amount (sorted by closest first) */
1155
992
  above: NearbyQuote[];
1156
993
  };
994
+ type GetNearbyQuote = Omit<NearbyQuote, 'quote'> & {
995
+ quote: GetQuoteSingleResponse;
996
+ };
997
+ type GetNearbySuggestions = {
998
+ below: GetNearbyQuote[];
999
+ above: GetNearbyQuote[];
1000
+ };
1157
1001
  type QuoteResponseObject = {
1158
1002
  fiat: FiatResponse;
1159
1003
  token: TokenResponse;
@@ -1162,12 +1006,19 @@ type QuoteResponseObject = {
1162
1006
  /** Nearby suggestions when no exact quotes available (only present with includeNearbyQuotes=true) */
1163
1007
  nearbySuggestions?: NearbySuggestions;
1164
1008
  };
1009
+ type GetQuoteResponseObject = Omit<QuoteResponseObject, 'quotes' | 'nearbySuggestions'> & {
1010
+ quotes: GetQuoteSingleResponse[];
1011
+ nearbySuggestions?: GetNearbySuggestions;
1012
+ };
1165
1013
  type QuoteResponse = {
1166
1014
  message: string;
1167
1015
  success: boolean;
1168
1016
  responseObject: QuoteResponseObject;
1169
1017
  statusCode: number;
1170
1018
  };
1019
+ type GetQuoteResponse = Omit<QuoteResponse, 'responseObject'> & {
1020
+ responseObject: GetQuoteResponseObject;
1021
+ };
1171
1022
  /**
1172
1023
  * Request to fetch payee details
1173
1024
  * Prefer `processorName`; `platform` kept for backward compatibility.
@@ -1512,6 +1363,12 @@ type Zkp2pNextOptions = {
1512
1363
  * Parameters for signalIntent method.
1513
1364
  * Used by both the direct call and .prepare() variants.
1514
1365
  */
1366
+ type SignalIntentReferralFee = {
1367
+ /** Address receiving a referral fee */
1368
+ recipient: Address;
1369
+ /** Referral fee amount in precise units */
1370
+ fee: bigint | string;
1371
+ };
1515
1372
  type SignalIntentMethodParams = {
1516
1373
  /** The deposit ID to use */
1517
1374
  depositId: bigint | string;
@@ -1527,10 +1384,14 @@ type SignalIntentMethodParams = {
1527
1384
  fiatCurrencyCode: string;
1528
1385
  /** Agreed conversion rate (18 decimals) */
1529
1386
  conversionRate: bigint | string;
1530
- /** Optional referrer address for fee sharing */
1387
+ /** Optional referral fee recipients paid by the taker */
1388
+ referralFees?: SignalIntentReferralFee[];
1389
+ /** @deprecated Use referralFees instead */
1531
1390
  referrer?: Address;
1532
- /** Optional referrer fee amount */
1391
+ /** @deprecated Use referralFees instead */
1533
1392
  referrerFee?: bigint | string;
1393
+ /** Optional referrer fee configuration for redirect-flow integrations */
1394
+ referrerFeeConfig?: ReferrerFeeConfig;
1534
1395
  /** Optional hook contract to call after signaling */
1535
1396
  postIntentHook?: Address;
1536
1397
  /** Optional data for pre-intent hook (defaults to '0x') */
@@ -1585,8 +1446,13 @@ type FulfillIntentMethodParams = {
1585
1446
  onTxSent?: (hash: Hash) => void;
1586
1447
  onTxMined?: (hash: Hash) => void;
1587
1448
  };
1449
+ /** Precomputed attestation values (payment proof + verification data) */
1450
+ precomputedAttestation?: {
1451
+ paymentProof: Hex;
1452
+ verificationData: Hex;
1453
+ };
1588
1454
  };
1589
- /** Inline oracle rate config for a currency entry (new in rc.5). */
1455
+ /** Inline oracle rate config for a currency entry. */
1590
1456
  type CurrencyOracleRateConfig = {
1591
1457
  adapter: Address;
1592
1458
  adapterConfig: `0x${string}`;
@@ -1749,6 +1615,10 @@ declare class Zkp2pClient {
1749
1615
  private readonly _indexerService;
1750
1616
  private readonly _indexerRateManagerService;
1751
1617
  private readonly _router;
1618
+ private readonly _pvReader;
1619
+ private readonly _vaultOps;
1620
+ private readonly _intentOps;
1621
+ private _rateManagerInitError?;
1752
1622
  /**
1753
1623
  * Creates a new Zkp2pClient instance.
1754
1624
  *
@@ -1761,12 +1631,6 @@ declare class Zkp2pClient {
1761
1631
  private parseEscrowAddressFromCompositeDepositId;
1762
1632
  private parseRawDepositId;
1763
1633
  private normalizeOracleRateConfig;
1764
- private static readonly EMPTY_ORACLE_RATE_CONFIG;
1765
- /**
1766
- * Checks whether the Currency struct in the ABI includes an `oracleRateConfig` component.
1767
- * This is a deep check: createDeposit takes a top-level tuple with a `currencies` field
1768
- * that is a tuple[][] — each inner tuple is a Currency struct.
1769
- */
1770
1634
  private escrowCurrencyHasOracleConfig;
1771
1635
  /**
1772
1636
  * Normalizes currency tuples by appending an empty `oracleRateConfig` when the ABI
@@ -1783,16 +1647,14 @@ declare class Zkp2pClient {
1783
1647
  private abiTupleHasComponent;
1784
1648
  private abiFunctionHasInput;
1785
1649
  private resolveEscrowAddressOrThrow;
1786
- private resolveRateManagerRegistryContract;
1787
- private buildCreateRateManagerConfig;
1788
- private buildSetRateManagerConfigArgs;
1789
- private prepareRateManagerRegistryTransaction;
1790
1650
  private prepareCreateRateManagerTransaction;
1791
1651
  private prepareSetVaultRateTransaction;
1792
1652
  private prepareSetVaultRatesBatchTransaction;
1793
1653
  private prepareSetOracleRateConfigTransaction;
1794
1654
  private prepareRemoveOracleRateConfigTransaction;
1795
1655
  private prepareSetOracleRateConfigBatchTransaction;
1656
+ private prepareUpdateCurrencyConfigBatchTransaction;
1657
+ private prepareDeactivateCurrenciesBatchTransaction;
1796
1658
  private prepareSetVaultConfigTransaction;
1797
1659
  private getEscrowContextByAddress;
1798
1660
  private getOrchestratorContextByAddress;
@@ -1802,6 +1664,7 @@ declare class Zkp2pClient {
1802
1664
  private resolveOrchestratorForEscrow;
1803
1665
  private lookupIntentRouting;
1804
1666
  private lookupIntentEscrowOnchain;
1667
+ private warnOrchestratorFallback;
1805
1668
  private resolveOrchestratorContext;
1806
1669
  /**
1807
1670
  * Simulate a contract call (validation only) and send with ERC-8021 attribution.
@@ -2039,7 +1902,7 @@ declare class Zkp2pClient {
2039
1902
  getManagerDailySnapshots: (rateManagerId: string, options?: {
2040
1903
  limit?: number;
2041
1904
  rateManagerAddress?: string | null;
2042
- }) => Promise<ManagerDailySnapshotEntity[]>;
1905
+ }) => Promise<_zkp2p_indexer_schema.ManagerDailySnapshot[]>;
2043
1906
  getManualRateUpdates: (rateManagerId: string, options?: {
2044
1907
  limit?: number;
2045
1908
  rateManagerAddress?: string | null;
@@ -2117,8 +1980,6 @@ declare class Zkp2pClient {
2117
1980
  * `createDeposit` to obtain `payeeDetailsHashes`, or use it independently to
2118
1981
  * register maker payment details with the curator service.
2119
1982
  *
2120
- * Requires `apiKey` or `authorizationToken` to be set.
2121
- *
2122
1983
  * @param params.processorNames - Payment platforms (e.g., ['wise', 'revolut'])
2123
1984
  * @param params.depositData - Payee details per processor (e.g., [{ email: '...' }])
2124
1985
  * @returns The posted deposit details and their corresponding hashed on-chain IDs
@@ -2347,6 +2208,36 @@ declare class Zkp2pClient {
2347
2208
  escrowAddress?: Address;
2348
2209
  txOverrides?: TxOverrides;
2349
2210
  }, Hash>;
2211
+ /**
2212
+ * Batch update currency min-rate and oracle-config entries for an EscrowV2 deposit.
2213
+ */
2214
+ readonly updateCurrencyConfigBatch: PrepareableMethod<{
2215
+ depositId: bigint | number | string;
2216
+ paymentMethods: `0x${string}`[];
2217
+ updates: Array<Array<{
2218
+ code: `0x${string}`;
2219
+ minConversionRate: bigint | string;
2220
+ updateOracle: boolean;
2221
+ oracleRateConfig: {
2222
+ adapter: Address;
2223
+ adapterConfig: `0x${string}`;
2224
+ spreadBps: number;
2225
+ maxStaleness: number;
2226
+ };
2227
+ }>>;
2228
+ escrowAddress?: Address;
2229
+ txOverrides?: TxOverrides;
2230
+ }, Hash>;
2231
+ /**
2232
+ * Batch deactivate currencies for an EscrowV2 deposit.
2233
+ */
2234
+ readonly deactivateCurrenciesBatch: PrepareableMethod<{
2235
+ depositId: bigint | number | string;
2236
+ paymentMethods: `0x${string}`[];
2237
+ currencyCodes: `0x${string}`[][];
2238
+ escrowAddress?: Address;
2239
+ txOverrides?: TxOverrides;
2240
+ }, Hash>;
2350
2241
  /**
2351
2242
  * Adds additional funds to an existing deposit.
2352
2243
  * Requires prior approval of the token amount.
@@ -2683,8 +2574,9 @@ declare class Zkp2pClient {
2683
2574
  * @param params.payeeDetails - Hashed payee details (from deposit)
2684
2575
  * @param params.fiatCurrencyCode - Fiat currency code (e.g., 'USD', 'EUR')
2685
2576
  * @param params.conversionRate - Agreed conversion rate (18 decimals)
2686
- * @param params.referrer - Optional referrer address for fee sharing
2687
- * @param params.referrerFee - Optional referrer fee amount
2577
+ * @param params.referralFees - Optional referral fee recipients and fee amounts
2578
+ * @param params.referrer - Deprecated legacy single-referrer address
2579
+ * @param params.referrerFee - Deprecated legacy single-referrer fee amount
2688
2580
  * @param params.postIntentHook - Optional hook contract to call after signaling
2689
2581
  * @param params.data - Optional data to pass to the hook
2690
2582
  * @param params.gatingServiceSignature - Pre-obtained signature (if not auto-fetching)
@@ -2914,12 +2806,10 @@ declare class Zkp2pClient {
2914
2806
  getQuote(req: QuoteRequest, opts?: {
2915
2807
  baseApiUrl?: string;
2916
2808
  timeoutMs?: number;
2917
- }): Promise<QuoteResponse>;
2809
+ }): Promise<GetQuoteResponse>;
2918
2810
  /**
2919
2811
  * **Supporting Method** - Fetches taker tier information for an address.
2920
2812
  *
2921
- * > **Note**: Requires `apiKey` or `authorizationToken` to be set.
2922
- *
2923
2813
  * @param req - Taker tier request parameters
2924
2814
  * @param req.owner - Taker address
2925
2815
  * @param req.chainId - Chain ID
@@ -2952,7 +2842,9 @@ declare class Zkp2pClient {
2952
2842
  * @param depositId - The deposit ID (string or bigint)
2953
2843
  * @returns Parsed deposit view with all payment methods and currencies
2954
2844
  */
2955
- getPvDepositById(depositId: string | bigint): Promise<PV_DepositView>;
2845
+ getPvDepositById(depositId: string | bigint, options?: {
2846
+ strictEscrow?: boolean;
2847
+ }): Promise<PV_DepositView>;
2956
2848
  /**
2957
2849
  * Fetches multiple deposits by ID from on-chain in a batch call.
2958
2850
  *
@@ -3057,7 +2949,10 @@ interface RoutingClientShape {
3057
2949
  legacyEscrowAddress?: Address;
3058
2950
  }
3059
2951
  declare const getDelegationRoute: (client: RoutingClientShape, escrow: Address) => DelegationRoute;
3060
- declare const assertDelegationMethodSupport: (client: any, route: DelegationRoute, action: "set" | "clear") => void;
2952
+ type DelegationMethodSupportClient = Partial<Record<'setRateManager' | 'clearRateManager' | 'setDepositRateManager' | 'clearDepositRateManager', {
2953
+ prepare?: unknown;
2954
+ }>>;
2955
+ declare const assertDelegationMethodSupport: (client: DelegationMethodSupportClient, route: DelegationRoute, action: "set" | "clear") => void;
3061
2956
  interface DelegationDepositTarget {
3062
2957
  compositeDepositId: string;
3063
2958
  escrow: Address;
@@ -3092,4 +2987,4 @@ type SendBatchFn = (txs: Array<{
3092
2987
  value?: bigint;
3093
2988
  }>) => Promise<string>;
3094
2989
 
3095
- export { type GetIntentByHashRequest as $, type AuthorizationTokenProvider as A, type ApiDeposit as B, type CurrencyType as C, type DepositWithRelations as D, type DepositVerifier as E, type FulfillIntentMethodParams as F, type GetPayeeDetailsRequest as G, type DepositVerifierCurrency as H, type IntentEntity as I, type DepositStatus as J, type GetDepositByIdRequest as K, type GetDepositByIdResponse as L, type Intent as M, type NearbyQuote as N, type ApiIntentStatus as O, type PostDepositDetailsRequest as P, type QuoteRequest as Q, type Range as R, type SignalIntentMethodParams as S, type TxOverrides as T, type GetOwnerIntentsRequest as U, type ValidatePayeeDetailsRequest as V, type WithdrawDepositParams as W, type GetOwnerIntentsResponse as X, type GetIntentsByDepositRequest as Y, Zkp2pClient as Z, type GetIntentsByDepositResponse as _, type ValidatePayeeDetailsResponse as a, getGatingServiceAddress as a$, type GetIntentByHashResponse as a0, type RegisterPayeeDetailsRequest as a1, type RegisterPayeeDetailsResponse as a2, type OnchainCurrency as a3, type DepositVerifierData as a4, type PreparedTransaction as a5, type OrderStats as a6, type DepositIntentStatistics as a7, type TakerTier as a8, type TakerTierStats as a9, type DepositFundActivityType as aA, type DepositFilter as aB, type PaginationOptions as aC, type DepositOrderField as aD, type OrderDirection$1 as aE, type RateManagerFilter as aF, type RateManagerPaginationOptions as aG, type RateManagerDelegationPaginationOptions as aH, type RateManagerOrderField as aI, type OrderDirection as aJ, type DeploymentEnv as aK, type FulfillmentRecord as aL, type PaymentVerifiedRecord as aM, type FulfillmentAndPaymentResponse as aN, PAYMENT_PLATFORMS as aO, type PaymentPlatformType as aP, Currency as aQ, currencyInfo as aR, getCurrencyInfoFromHash as aS, getCurrencyInfoFromCountryCode as aT, getCurrencyCodeFromHash as aU, isSupportedCurrencyHash as aV, mapConversionRatesToOnchainMinRate as aW, type CurrencyData as aX, getContracts as aY, getRateManagerContracts as aZ, getPaymentMethodsCatalog as a_, type TakerTierLevel as aa, type PlatformLimit as ab, type PlatformRiskLevel as ac, IndexerClient as ad, defaultIndexerEndpoint as ae, IndexerDepositService as af, IndexerRateManagerService as ag, fetchFulfillmentAndPayment as ah, type DepositEntity as ai, type IntentFulfilledEntity as aj, type IntentFulfillmentAmountsEntity as ak, type DepositPaymentMethodEntity as al, type MethodCurrencyEntity as am, type IntentStatus as an, type RateManagerEntity as ao, type RateManagerRateEntity as ap, type RateManagerDelegationEntity as aq, type ManagerAggregateStatsEntity as ar, type ManagerStatsEntity as as, type ManagerDailySnapshotEntity as at, type RateManagerListItem as au, type RateManagerDetail as av, type ManualRateUpdateEntity as aw, type OracleConfigUpdateEntity as ax, type DepositFundActivityEntity as ay, type DepositDailySnapshotEntity as az, type PostDepositDetailsResponse as b, HISTORICAL_ESCROW_ADDRESSES as b0, type RuntimeEnv as b1, parseDepositView as b2, parseIntentView as b3, enrichPvDepositView as b4, enrichPvIntentView as b5, type PV_DepositView as b6, type PV_Deposit as b7, type PV_PaymentMethodData as b8, type PV_Currency as b9, type PV_IntentView as ba, type PV_Intent as bb, ZERO_RATE_MANAGER_ID as bc, isZeroRateManagerId as bd, normalizeRateManagerId as be, normalizeRegistry as bf, getDelegationRoute as bg, classifyDelegationState as bh, type DelegationRoute as bi, type DelegationState as bj, type DelegationDepositTarget as bk, type BatchResult as bl, type SendTransactionFn as bm, type SendBatchFn as bn, ZERO_ADDRESS as bo, asErrorMessage as bp, assertDelegationMethodSupport as bq, type GetPayeeDetailsResponse as c, type GetOwnerDepositsRequest as d, type GetOwnerDepositsResponse as e, type GetTakerTierRequest as f, type GetTakerTierResponse as g, type PaymentMethodCatalog as h, type CancelIntentMethodParams as i, type Zkp2pClientOptions as j, type TimeoutConfig as k, type ActionCallback as l, type CreateDepositParams as m, type CreateDepositConversionRate as n, type SignalIntentParams as o, type FulfillIntentParams as p, type ReleaseFundsToPayerParams as q, type CancelIntentParams as r, type QuoteResponse as s, type QuoteResponseObject as t, type QuoteSingleResponse as u, type QuoteIntentResponse as v, type QuoteFeesResponse as w, type FiatResponse as x, type TokenResponse as y, type NearbySuggestions as z };
2990
+ export { type GetDepositByIdResponse as $, type AuthorizationTokenProvider as A, type QuoteResponseObject as B, type CurrencyType as C, type DepositWithRelations as D, type QuoteSingleResponse as E, type FulfillIntentMethodParams as F, type GetPayeeDetailsRequest as G, type QuoteIntentResponse as H, type IntentEntity as I, type QuoteFeesResponse as J, type FiatResponse as K, type TokenResponse as L, type NearbySuggestions as M, type NearbyQuote as N, type ApiDeposit as O, type PostDepositDetailsRequest as P, type QuoteRequest as Q, type ReferrerFeeConfig as R, type SignalIntentReferralFee as S, type TxOverrides as T, type DepositVerifier as U, type ValidatePayeeDetailsRequest as V, type WithdrawDepositParams as W, type DepositVerifierCurrency as X, type DepositStatus as Y, Zkp2pClient as Z, type GetDepositByIdRequest as _, type ValidatePayeeDetailsResponse as a, getCurrencyCodeFromHash as a$, type Intent as a0, type ApiIntentStatus as a1, type GetOwnerIntentsRequest as a2, type GetOwnerIntentsResponse as a3, type GetIntentsByDepositRequest as a4, type GetIntentsByDepositResponse as a5, type GetIntentByHashRequest as a6, type GetIntentByHashResponse as a7, type RegisterPayeeDetailsRequest as a8, type RegisterPayeeDetailsResponse as a9, type ManagerDailySnapshotEntity as aA, type RateManagerListItem as aB, type RateManagerDetail as aC, type ManualRateUpdateEntity as aD, type OracleConfigUpdateEntity as aE, type DepositFundActivityEntity as aF, type DepositDailySnapshotEntity as aG, type DepositFundActivityType as aH, type DepositFilter as aI, type PaginationOptions as aJ, type DepositOrderField as aK, type OrderDirection$1 as aL, type RateManagerFilter as aM, type RateManagerPaginationOptions as aN, type RateManagerDelegationPaginationOptions as aO, type RateManagerOrderField as aP, type OrderDirection as aQ, type DeploymentEnv as aR, type FulfillmentRecord as aS, type PaymentVerifiedRecord as aT, type FulfillmentAndPaymentResponse as aU, PAYMENT_PLATFORMS as aV, type PaymentPlatformType as aW, Currency as aX, currencyInfo as aY, getCurrencyInfoFromHash as aZ, getCurrencyInfoFromCountryCode as a_, type OnchainCurrency as aa, type DepositVerifierData as ab, type PreparedTransaction as ac, type OrderStats as ad, type DepositIntentStatistics as ae, type TakerTier as af, type TakerTierStats as ag, type TakerTierLevel as ah, type PlatformLimit as ai, type PlatformRiskLevel as aj, IndexerClient as ak, defaultIndexerEndpoint as al, IndexerDepositService as am, IndexerRateManagerService as an, fetchFulfillmentAndPayment as ao, type DepositEntity as ap, type IntentFulfilledEntity as aq, type IntentFulfillmentAmountsEntity as ar, type DepositPaymentMethodEntity as as, type MethodCurrencyEntity as at, type IntentStatus as au, type RateManagerEntity as av, type RateManagerRateEntity as aw, type RateManagerDelegationEntity as ax, type ManagerAggregateStatsEntity as ay, type ManagerStatsEntity as az, type PostDepositDetailsResponse as b, isSupportedCurrencyHash as b0, mapConversionRatesToOnchainMinRate as b1, type CurrencyData as b2, getContracts as b3, getRateManagerContracts as b4, getPaymentMethodsCatalog as b5, getGatingServiceAddress as b6, HISTORICAL_ESCROW_ADDRESSES as b7, type RuntimeEnv as b8, parseDepositView as b9, parseIntentView as ba, enrichPvDepositView as bb, enrichPvIntentView as bc, type PV_DepositView as bd, type PV_Deposit as be, type PV_PaymentMethodData as bf, type PV_Currency as bg, type PV_ReferralFee as bh, type PV_IntentView as bi, type PV_Intent as bj, ZERO_RATE_MANAGER_ID as bk, isZeroRateManagerId as bl, normalizeRateManagerId as bm, normalizeRegistry as bn, getDelegationRoute as bo, classifyDelegationState as bp, type DelegationRoute as bq, type DelegationState as br, type DelegationDepositTarget as bs, type BatchResult as bt, type SendTransactionFn as bu, type SendBatchFn as bv, ZERO_ADDRESS as bw, asErrorMessage as bx, assertDelegationMethodSupport as by, type GetPayeeDetailsResponse as c, type GetOwnerDepositsRequest as d, type GetOwnerDepositsResponse as e, type GetTakerTierRequest as f, type GetTakerTierResponse as g, type PaymentMethodCatalog as h, type SignalIntentMethodParams as i, type CancelIntentMethodParams as j, type Zkp2pClientOptions as k, type TimeoutConfig as l, type ActionCallback as m, type CreateDepositParams as n, type CreateDepositConversionRate as o, type Range as p, type SignalIntentParams as q, type FulfillIntentParams as r, type ReleaseFundsToPayerParams as s, type CancelIntentParams as t, type GetNearbyQuote as u, type GetNearbySuggestions as v, type GetQuoteResponse as w, type GetQuoteResponseObject as x, type GetQuoteSingleResponse as y, type QuoteResponse as z };