@zkp2p/sdk 0.3.0 → 0.3.2-rc.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/README.md +8 -8
- package/dist/{chunk-AXX3QCRW.mjs → chunk-ENH4KRFK.mjs} +13 -29
- package/dist/chunk-ENH4KRFK.mjs.map +1 -0
- package/dist/index.cjs +373 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.mjs +368 -51
- package/dist/index.mjs.map +1 -1
- package/dist/protocolViewerParsers-ZQZ6QGEX.mjs +4 -0
- package/dist/{protocolViewerParsers-TPB47QOH.mjs.map → protocolViewerParsers-ZQZ6QGEX.mjs.map} +1 -1
- package/dist/react.cjs +4 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.mts +4 -10
- package/dist/react.d.ts +4 -10
- package/dist/react.mjs +4 -1
- package/dist/react.mjs.map +1 -1
- package/dist/{vaultUtils-sodi4Xx-.d.mts → vaultUtils-C-9Z50Ak.d.mts} +547 -80
- package/dist/{vaultUtils-sodi4Xx-.d.ts → vaultUtils-C-9Z50Ak.d.ts} +547 -80
- package/package.json +1 -1
- package/dist/chunk-AXX3QCRW.mjs.map +0 -1
- package/dist/protocolViewerParsers-TPB47QOH.mjs +0 -4
|
@@ -169,13 +169,13 @@ type V2ContractAddresses = {
|
|
|
169
169
|
escrow: `0x${string}`;
|
|
170
170
|
/** EscrowV2 contract (supports native rate-manager delegation) */
|
|
171
171
|
escrowV2?: `0x${string}`;
|
|
172
|
-
/** All supported
|
|
172
|
+
/** All supported escrow addresses for the current deployment */
|
|
173
173
|
escrowAddresses?: `0x${string}`[];
|
|
174
174
|
/** Orchestrator contract (handles intent signaling and fulfillment) */
|
|
175
175
|
orchestrator?: `0x${string}`;
|
|
176
176
|
/** OrchestratorV2 contract (queries EscrowV2 effective rates) */
|
|
177
177
|
orchestratorV2?: `0x${string}`;
|
|
178
|
-
/** All supported
|
|
178
|
+
/** All supported orchestrator addresses for the current deployment */
|
|
179
179
|
orchestratorAddresses?: `0x${string}`[];
|
|
180
180
|
/** UnifiedPaymentVerifier contract (verifies payment proofs) */
|
|
181
181
|
unifiedPaymentVerifier?: `0x${string}`;
|
|
@@ -183,7 +183,7 @@ type V2ContractAddresses = {
|
|
|
183
183
|
unifiedPaymentVerifierV2?: `0x${string}`;
|
|
184
184
|
/** ProtocolViewer contract (batch read operations) */
|
|
185
185
|
protocolViewer?: `0x${string}`;
|
|
186
|
-
/** Ordered list of
|
|
186
|
+
/** Ordered list of supported ProtocolViewer instances for the current deployment */
|
|
187
187
|
protocolViewerEntries?: Array<{
|
|
188
188
|
address: `0x${string}`;
|
|
189
189
|
abi: Abi;
|
|
@@ -420,43 +420,44 @@ declare function defaultIndexerEndpoint(env?: DeploymentEnv): string;
|
|
|
420
420
|
type WithOverrides<TBase, TOverrides> = Omit<TBase, keyof TOverrides> & TOverrides;
|
|
421
421
|
type DepositStatus$1 = `${DepositStatus$2}`;
|
|
422
422
|
type IntentStatus = `${IntentStatus$1}`;
|
|
423
|
-
type DepositEntity = WithOverrides<Deposit, {
|
|
423
|
+
type DepositEntity$1 = WithOverrides<Deposit, {
|
|
424
424
|
status: DepositStatus$1;
|
|
425
425
|
retainOnEmpty?: boolean;
|
|
426
|
+
whitelistHookAddress?: string | null;
|
|
426
427
|
}>;
|
|
427
|
-
type DepositPaymentMethodEntity = DepositPaymentMethod;
|
|
428
|
-
type MethodCurrencyEntity = MethodCurrency;
|
|
429
|
-
type IntentEntity = WithOverrides<Intent$1, {
|
|
428
|
+
type DepositPaymentMethodEntity$1 = DepositPaymentMethod;
|
|
429
|
+
type MethodCurrencyEntity$1 = MethodCurrency;
|
|
430
|
+
type IntentEntity$1 = WithOverrides<Intent$1, {
|
|
430
431
|
status: IntentStatus;
|
|
431
432
|
}>;
|
|
432
|
-
interface DepositWithRelations extends DepositEntity {
|
|
433
|
-
paymentMethods?: DepositPaymentMethodEntity[];
|
|
434
|
-
currencies?: MethodCurrencyEntity[];
|
|
435
|
-
intents?: IntentEntity[];
|
|
433
|
+
interface DepositWithRelations extends DepositEntity$1 {
|
|
434
|
+
paymentMethods?: DepositPaymentMethodEntity$1[];
|
|
435
|
+
currencies?: MethodCurrencyEntity$1[];
|
|
436
|
+
intents?: IntentEntity$1[];
|
|
436
437
|
}
|
|
437
|
-
type DepositFundActivityType = 'DEPOSIT_RECEIVED' | 'FUNDS_ADDED' | 'WITHDRAWN' | 'CLOSED';
|
|
438
|
+
type DepositFundActivityType$1 = 'DEPOSIT_RECEIVED' | 'FUNDS_ADDED' | 'WITHDRAWN' | 'CLOSED';
|
|
438
439
|
/**
|
|
439
440
|
* Chronological fund-movement log for a deposit.
|
|
440
441
|
* One row per on-chain fund event (deposit, add, withdraw, close).
|
|
441
442
|
*/
|
|
442
|
-
type DepositFundActivityEntity = WithOverrides<DepositFundActivity, {
|
|
443
|
-
activityType: DepositFundActivityType;
|
|
443
|
+
type DepositFundActivityEntity$1 = WithOverrides<DepositFundActivity, {
|
|
444
|
+
activityType: DepositFundActivityType$1;
|
|
444
445
|
}>;
|
|
445
446
|
/**
|
|
446
447
|
* Per-deposit daily rollup snapshot.
|
|
447
448
|
* One row per deposit per day (UTC-aligned, 86400s buckets).
|
|
448
449
|
*/
|
|
449
|
-
type DepositDailySnapshotEntity = DepositDailySnapshot;
|
|
450
|
-
interface DepositEventEntity {
|
|
450
|
+
type DepositDailySnapshotEntity$1 = DepositDailySnapshot;
|
|
451
|
+
interface DepositEventEntity$1 {
|
|
451
452
|
id: string;
|
|
452
453
|
depositId: string;
|
|
453
454
|
depositor: string;
|
|
454
455
|
amount: string;
|
|
455
456
|
}
|
|
456
|
-
interface DepositEventsResponse {
|
|
457
|
-
deposits: DepositEventEntity[];
|
|
458
|
-
fundsAdded: DepositEventEntity[];
|
|
459
|
-
withdrawals: DepositEventEntity[];
|
|
457
|
+
interface DepositEventsResponse$1 {
|
|
458
|
+
deposits: DepositEventEntity$1[];
|
|
459
|
+
fundsAdded: DepositEventEntity$1[];
|
|
460
|
+
withdrawals: DepositEventEntity$1[];
|
|
460
461
|
}
|
|
461
462
|
interface IntentFulfilledEntity {
|
|
462
463
|
intentHash: string;
|
|
@@ -485,7 +486,7 @@ type ManagerAggregateStatsEntity = WithOverrides<ManagerAggregateStats, {
|
|
|
485
486
|
}>;
|
|
486
487
|
type ManagerStatsEntity = ManagerStats;
|
|
487
488
|
type ManagerDailySnapshotEntity = ManagerDailySnapshot;
|
|
488
|
-
type MakerProfitSnapshotEntity = MakerProfitSnapshot;
|
|
489
|
+
type MakerProfitSnapshotEntity$1 = MakerProfitSnapshot;
|
|
489
490
|
interface ManualRateUpdateEntity {
|
|
490
491
|
id: string;
|
|
491
492
|
rateManagerId: string;
|
|
@@ -559,20 +560,20 @@ declare class IndexerDepositService {
|
|
|
559
560
|
private fetchRelations;
|
|
560
561
|
private fetchIntents;
|
|
561
562
|
private attachRelations;
|
|
562
|
-
fetchDeposits(filter?: DepositFilter, pagination?: PaginationOptions): Promise<DepositEntity[]>;
|
|
563
|
+
fetchDeposits(filter?: DepositFilter, pagination?: PaginationOptions): Promise<DepositEntity$1[]>;
|
|
563
564
|
fetchDepositsWithRelations(filter?: DepositFilter, pagination?: PaginationOptions, options?: {
|
|
564
565
|
includeIntents?: boolean;
|
|
565
566
|
intentStatuses?: IntentStatus[];
|
|
566
567
|
}): Promise<DepositWithRelations[]>;
|
|
567
|
-
fetchDepositsByIds(ids: string[]): Promise<DepositEntity[]>;
|
|
568
|
+
fetchDepositsByIds(ids: string[]): Promise<DepositEntity$1[]>;
|
|
568
569
|
fetchDepositsByIdsWithRelations(ids: string[], options?: {
|
|
569
570
|
includeIntents?: boolean;
|
|
570
571
|
intentStatuses?: IntentStatus[];
|
|
571
572
|
}): Promise<DepositWithRelations[]>;
|
|
572
|
-
fetchIntentsForDeposits(depositIds: string[], statuses?: IntentStatus[]): Promise<IntentEntity[]>;
|
|
573
|
-
fetchIntentsByOwner(owner: string, statuses?: IntentStatus[]): Promise<IntentEntity[]>;
|
|
574
|
-
fetchIntentsByRateManager(rateManagerId: string, statuses?: IntentStatus[]): Promise<IntentEntity[]>;
|
|
575
|
-
fetchIntentByHash(intentHash: string): Promise<IntentEntity | null>;
|
|
573
|
+
fetchIntentsForDeposits(depositIds: string[], statuses?: IntentStatus[]): Promise<IntentEntity$1[]>;
|
|
574
|
+
fetchIntentsByOwner(owner: string, statuses?: IntentStatus[]): Promise<IntentEntity$1[]>;
|
|
575
|
+
fetchIntentsByRateManager(rateManagerId: string, statuses?: IntentStatus[]): Promise<IntentEntity$1[]>;
|
|
576
|
+
fetchIntentByHash(intentHash: string): Promise<IntentEntity$1 | null>;
|
|
576
577
|
fetchDepositWithRelations(id: string, options?: {
|
|
577
578
|
includeIntents?: boolean;
|
|
578
579
|
intentStatuses?: IntentStatus[];
|
|
@@ -581,7 +582,7 @@ declare class IndexerDepositService {
|
|
|
581
582
|
now: bigint | string;
|
|
582
583
|
depositIds: string[];
|
|
583
584
|
limit?: number;
|
|
584
|
-
}): Promise<IntentEntity[]>;
|
|
585
|
+
}): Promise<IntentEntity$1[]>;
|
|
585
586
|
fetchFulfilledIntentEvents(intentHashes: string[]): Promise<IntentFulfilledEntity[]>;
|
|
586
587
|
fetchIntentFulfillmentAmounts(intentHash: string): Promise<IntentFulfillmentAmountsEntity | null>;
|
|
587
588
|
resolvePayeeHash(params: {
|
|
@@ -592,7 +593,7 @@ declare class IndexerDepositService {
|
|
|
592
593
|
fetchDepositEvents(depositIdOnContract: string, options?: {
|
|
593
594
|
escrowAddress?: string | null;
|
|
594
595
|
depositor?: string | null;
|
|
595
|
-
}): Promise<DepositEventsResponse>;
|
|
596
|
+
}): Promise<DepositEventsResponse$1>;
|
|
596
597
|
fetchDepositsByPayeeHash(payeeHash: string, options?: {
|
|
597
598
|
paymentMethodHash?: string;
|
|
598
599
|
limit?: number;
|
|
@@ -602,16 +603,16 @@ declare class IndexerDepositService {
|
|
|
602
603
|
/**
|
|
603
604
|
* Fetch chronological fund activities for a deposit.
|
|
604
605
|
*/
|
|
605
|
-
fetchDepositFundActivities(compositeDepositId: string): Promise<DepositFundActivityEntity[]>;
|
|
606
|
+
fetchDepositFundActivities(compositeDepositId: string): Promise<DepositFundActivityEntity$1[]>;
|
|
606
607
|
/**
|
|
607
608
|
* Fetch fund activities across all deposits for a maker address.
|
|
608
609
|
*/
|
|
609
|
-
fetchMakerFundActivities(depositor: string, limit?: number): Promise<DepositFundActivityEntity[]>;
|
|
610
|
+
fetchMakerFundActivities(depositor: string, limit?: number): Promise<DepositFundActivityEntity$1[]>;
|
|
610
611
|
/**
|
|
611
612
|
* Fetch daily snapshots for a deposit, ordered by day ascending.
|
|
612
613
|
*/
|
|
613
|
-
fetchDepositDailySnapshots(compositeDepositId: string, limit?: number): Promise<DepositDailySnapshotEntity[]>;
|
|
614
|
-
fetchProfitSnapshotsByDeposits(depositIds: string[]): Promise<MakerProfitSnapshotEntity[]>;
|
|
614
|
+
fetchDepositDailySnapshots(compositeDepositId: string, limit?: number): Promise<DepositDailySnapshotEntity$1[]>;
|
|
615
|
+
fetchProfitSnapshotsByDeposits(depositIds: string[]): Promise<MakerProfitSnapshotEntity$1[]>;
|
|
615
616
|
}
|
|
616
617
|
|
|
617
618
|
type OrderDirection = 'asc' | 'desc';
|
|
@@ -698,6 +699,211 @@ type FulfillmentAndPaymentResponse = {
|
|
|
698
699
|
};
|
|
699
700
|
declare function fetchFulfillmentAndPayment(client: IndexerClient, intentHash: string): Promise<FulfillmentAndPaymentResponse>;
|
|
700
701
|
|
|
702
|
+
/**
|
|
703
|
+
* Type definitions for the ZKP2P indexer GraphQL schema
|
|
704
|
+
*/
|
|
705
|
+
/**
|
|
706
|
+
* Core deposit entity from the indexer
|
|
707
|
+
*/
|
|
708
|
+
interface DepositEntity {
|
|
709
|
+
id: string;
|
|
710
|
+
chainId: number;
|
|
711
|
+
escrowAddress: string;
|
|
712
|
+
depositId: string;
|
|
713
|
+
depositor: string;
|
|
714
|
+
delegate?: string | null;
|
|
715
|
+
rateManagerId?: string | null;
|
|
716
|
+
rateManagerAddress?: string | null;
|
|
717
|
+
delegatedAt?: string | null;
|
|
718
|
+
token: string;
|
|
719
|
+
remainingDeposits: string;
|
|
720
|
+
intentAmountMin: string;
|
|
721
|
+
intentAmountMax: string;
|
|
722
|
+
acceptingIntents: boolean;
|
|
723
|
+
retainOnEmpty?: boolean;
|
|
724
|
+
status: "ACTIVE" | "CLOSED";
|
|
725
|
+
outstandingIntentAmount: string;
|
|
726
|
+
totalAmountTaken: string;
|
|
727
|
+
totalWithdrawn: string;
|
|
728
|
+
successRateBps?: number;
|
|
729
|
+
whitelistHookAddress?: string | null;
|
|
730
|
+
preIntentHookAddress?: string | null;
|
|
731
|
+
totalIntents: number;
|
|
732
|
+
signaledIntents: number;
|
|
733
|
+
fulfilledIntents: number;
|
|
734
|
+
prunedIntents: number;
|
|
735
|
+
blockNumber: string;
|
|
736
|
+
timestamp: string;
|
|
737
|
+
txHash: string;
|
|
738
|
+
updatedAt: string;
|
|
739
|
+
}
|
|
740
|
+
/**
|
|
741
|
+
* Payment method configuration for a deposit
|
|
742
|
+
*/
|
|
743
|
+
interface DepositPaymentMethodEntity {
|
|
744
|
+
id: string;
|
|
745
|
+
chainId: number;
|
|
746
|
+
depositIdOnContract: string;
|
|
747
|
+
depositId: string;
|
|
748
|
+
paymentMethodHash: string;
|
|
749
|
+
intentGatingService: string;
|
|
750
|
+
payeeDetailsHash: string;
|
|
751
|
+
active: boolean;
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* Currency configuration for a payment method
|
|
755
|
+
*/
|
|
756
|
+
interface MethodCurrencyEntity {
|
|
757
|
+
id: string;
|
|
758
|
+
chainId: number;
|
|
759
|
+
depositIdOnContract: string;
|
|
760
|
+
depositId: string;
|
|
761
|
+
paymentMethodHash: string;
|
|
762
|
+
currencyCode: string;
|
|
763
|
+
minConversionRate: string;
|
|
764
|
+
conversionRate?: string | null;
|
|
765
|
+
takerConversionRate?: string | null;
|
|
766
|
+
managerFee?: string | null;
|
|
767
|
+
rateSource?: string | null;
|
|
768
|
+
oracleRate?: string | null;
|
|
769
|
+
effectiveOracleRate?: string | null;
|
|
770
|
+
lastOracleUpdatedAt?: string | null;
|
|
771
|
+
adapter?: string | null;
|
|
772
|
+
adapterConfig?: string | null;
|
|
773
|
+
feed?: string | null;
|
|
774
|
+
feedDecimals?: number | null;
|
|
775
|
+
spreadBps?: number | null;
|
|
776
|
+
maxStaleness?: string | null;
|
|
777
|
+
invert?: boolean | null;
|
|
778
|
+
kind?: string | null;
|
|
779
|
+
managerRate?: string | null;
|
|
780
|
+
rateManagerId?: string | null;
|
|
781
|
+
}
|
|
782
|
+
/**
|
|
783
|
+
* Intent/swap entity
|
|
784
|
+
*/
|
|
785
|
+
interface IntentEntity {
|
|
786
|
+
id: string;
|
|
787
|
+
intentHash: string;
|
|
788
|
+
depositId: string;
|
|
789
|
+
orchestratorAddress: string;
|
|
790
|
+
verifier: string;
|
|
791
|
+
owner: string;
|
|
792
|
+
toAddress: string;
|
|
793
|
+
amount: string;
|
|
794
|
+
fiatCurrency: string;
|
|
795
|
+
conversionRate: string;
|
|
796
|
+
status: "SIGNALED" | "FULFILLED" | "PRUNED" | "MANUALLY_RELEASED";
|
|
797
|
+
signalTimestamp: string;
|
|
798
|
+
expiryTime?: string;
|
|
799
|
+
fulfillTimestamp?: string;
|
|
800
|
+
pruneTimestamp?: string;
|
|
801
|
+
updatedAt?: string;
|
|
802
|
+
signalTxHash: string;
|
|
803
|
+
fulfillTxHash?: string | null;
|
|
804
|
+
pruneTxHash?: string | null;
|
|
805
|
+
paymentMethodHash?: string | null;
|
|
806
|
+
rateManagerId?: string | null;
|
|
807
|
+
managerFee?: string | null;
|
|
808
|
+
managerFeeRecipient?: string | null;
|
|
809
|
+
managerFeeAmount?: string | null;
|
|
810
|
+
isExpired: boolean;
|
|
811
|
+
paymentAmount?: string | null;
|
|
812
|
+
paymentCurrency?: string | null;
|
|
813
|
+
paymentTimestamp?: string | null;
|
|
814
|
+
paymentId?: string | null;
|
|
815
|
+
releasedAmount?: string | null;
|
|
816
|
+
takerAmountNetFees?: string | null;
|
|
817
|
+
}
|
|
818
|
+
type DepositFundActivityType = "DEPOSIT_RECEIVED" | "FUNDS_ADDED" | "WITHDRAWN" | "CLOSED";
|
|
819
|
+
/**
|
|
820
|
+
* Chronological fund-movement log for a deposit.
|
|
821
|
+
* One row per on-chain fund event (deposit, add, withdraw, close).
|
|
822
|
+
*/
|
|
823
|
+
interface DepositFundActivityEntity {
|
|
824
|
+
id: string;
|
|
825
|
+
chainId: number;
|
|
826
|
+
depositId: string;
|
|
827
|
+
depositor: string;
|
|
828
|
+
activityType: DepositFundActivityType;
|
|
829
|
+
amount: string;
|
|
830
|
+
blockNumber: string;
|
|
831
|
+
timestamp: string;
|
|
832
|
+
txHash: string;
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* Per-deposit daily rollup snapshot.
|
|
836
|
+
* One row per deposit per day (UTC-aligned, 86400s buckets).
|
|
837
|
+
*/
|
|
838
|
+
interface DepositDailySnapshotEntity {
|
|
839
|
+
id: string;
|
|
840
|
+
chainId: number;
|
|
841
|
+
depositId: string;
|
|
842
|
+
depositor: string;
|
|
843
|
+
dayTimestamp: string;
|
|
844
|
+
remainingDeposits: string;
|
|
845
|
+
outstandingIntentAmount: string;
|
|
846
|
+
totalAmountTaken: string;
|
|
847
|
+
totalWithdrawn: string;
|
|
848
|
+
signaledIntents: number;
|
|
849
|
+
fulfilledIntents: number;
|
|
850
|
+
prunedIntents: number;
|
|
851
|
+
successRateBps: number;
|
|
852
|
+
dailyVolume: string;
|
|
853
|
+
dailyPnlUsdCents: string;
|
|
854
|
+
cumulativeVolume: string;
|
|
855
|
+
cumulativePnlUsdCents: string;
|
|
856
|
+
updatedAt: string;
|
|
857
|
+
}
|
|
858
|
+
interface DepositEventEntity {
|
|
859
|
+
id: string;
|
|
860
|
+
depositId: string;
|
|
861
|
+
depositor: string;
|
|
862
|
+
amount: string;
|
|
863
|
+
}
|
|
864
|
+
interface DepositEventsResponse {
|
|
865
|
+
deposits: DepositEventEntity[];
|
|
866
|
+
fundsAdded: DepositEventEntity[];
|
|
867
|
+
withdrawals: DepositEventEntity[];
|
|
868
|
+
}
|
|
869
|
+
interface MakerProfitSnapshotEntity {
|
|
870
|
+
id: string;
|
|
871
|
+
chainId: number;
|
|
872
|
+
maker: string;
|
|
873
|
+
intentId: string;
|
|
874
|
+
depositId: string;
|
|
875
|
+
fiatCurrency: string;
|
|
876
|
+
quoteConversionRate: string;
|
|
877
|
+
oracleRate?: string | null;
|
|
878
|
+
spreadBps?: number | null;
|
|
879
|
+
amount: string;
|
|
880
|
+
notionalFiatUsdCents?: string | null;
|
|
881
|
+
feeUsd?: string | null;
|
|
882
|
+
realizedProfitUsdCents?: string | null;
|
|
883
|
+
priceSnapshotId?: string | null;
|
|
884
|
+
status: "COMPUTED" | "PENDING";
|
|
885
|
+
createdAt: string;
|
|
886
|
+
updatedAt: string;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
type DepositBundleRequest = {
|
|
890
|
+
depositId: string;
|
|
891
|
+
escrowAddress: string;
|
|
892
|
+
dailySnapshotLimit?: number;
|
|
893
|
+
};
|
|
894
|
+
type DepositBundleDeposit = DepositEntity & {
|
|
895
|
+
paymentMethods: DepositPaymentMethodEntity[];
|
|
896
|
+
currencies: MethodCurrencyEntity[];
|
|
897
|
+
};
|
|
898
|
+
type DepositBundleResponse = {
|
|
899
|
+
deposit: DepositBundleDeposit;
|
|
900
|
+
intents: IntentEntity[];
|
|
901
|
+
events: DepositEventsResponse;
|
|
902
|
+
profitSnapshots: MakerProfitSnapshotEntity[];
|
|
903
|
+
fundActivities: DepositFundActivityEntity[];
|
|
904
|
+
dailySnapshots: DepositDailySnapshotEntity[];
|
|
905
|
+
};
|
|
906
|
+
|
|
701
907
|
/**
|
|
702
908
|
* A prepared transaction ready for submission.
|
|
703
909
|
* Contains all data needed to submit via wallet or relayer.
|
|
@@ -739,6 +945,12 @@ type TimeoutConfig = {
|
|
|
739
945
|
/** Transaction timeout in milliseconds (default: 60000) */
|
|
740
946
|
transaction?: number;
|
|
741
947
|
};
|
|
948
|
+
type ApiAdapterOptions = {
|
|
949
|
+
baseApiUrl: string;
|
|
950
|
+
timeoutMs?: number;
|
|
951
|
+
apiKey?: string;
|
|
952
|
+
authToken?: string;
|
|
953
|
+
};
|
|
742
954
|
type AuthorizationTokenProvider = () => string | null | undefined | Promise<string | null | undefined>;
|
|
743
955
|
/**
|
|
744
956
|
* Callback function for transaction actions
|
|
@@ -773,6 +985,16 @@ type ReferrerFeeConfig = {
|
|
|
773
985
|
recipient: `0x${string}`;
|
|
774
986
|
feeBps: number;
|
|
775
987
|
};
|
|
988
|
+
type CuratorPayeeData = {
|
|
989
|
+
offchainId: string;
|
|
990
|
+
telegramUsername: string | null;
|
|
991
|
+
metadata: Record<string, string> | null;
|
|
992
|
+
};
|
|
993
|
+
type CuratorPayeeDataInput = {
|
|
994
|
+
offchainId: string;
|
|
995
|
+
telegramUsername?: string | null;
|
|
996
|
+
metadata?: Record<string, string> | null;
|
|
997
|
+
};
|
|
776
998
|
/**
|
|
777
999
|
* Parameters for fulfilling an intent with payment attestation
|
|
778
1000
|
*/
|
|
@@ -836,10 +1058,12 @@ type SignalIntentParams = {
|
|
|
836
1058
|
* Request structure for posting deposit details
|
|
837
1059
|
*/
|
|
838
1060
|
type PostDepositDetailsRequest = {
|
|
839
|
-
/**
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
1061
|
+
/** Primary offchain payment identifier for the processor */
|
|
1062
|
+
offchainId: string;
|
|
1063
|
+
/** Optional Telegram username associated with the payee */
|
|
1064
|
+
telegramUsername?: string | null;
|
|
1065
|
+
/** Optional processor-specific metadata */
|
|
1066
|
+
metadata?: Record<string, string> | null;
|
|
843
1067
|
/** Payment processor name */
|
|
844
1068
|
processorName: string;
|
|
845
1069
|
};
|
|
@@ -853,9 +1077,9 @@ type PostDepositDetailsResponse = {
|
|
|
853
1077
|
responseObject: {
|
|
854
1078
|
id: number;
|
|
855
1079
|
processorName: string;
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
1080
|
+
offchainId: string;
|
|
1081
|
+
telegramUsername: string | null;
|
|
1082
|
+
metadata: Record<string, string> | null;
|
|
859
1083
|
hashedOnchainId: string;
|
|
860
1084
|
createdAt: string;
|
|
861
1085
|
};
|
|
@@ -866,6 +1090,166 @@ type PostDepositDetailsResponse = {
|
|
|
866
1090
|
*/
|
|
867
1091
|
type RegisterPayeeDetailsRequest = PostDepositDetailsRequest;
|
|
868
1092
|
type RegisterPayeeDetailsResponse = PostDepositDetailsResponse;
|
|
1093
|
+
type SellerPlatform = 'venmo' | 'cashapp' | 'wise';
|
|
1094
|
+
type VenmoSessionMaterial = {
|
|
1095
|
+
recipientUsername: string;
|
|
1096
|
+
accountId: string;
|
|
1097
|
+
sessionCookie: string;
|
|
1098
|
+
requestHeaders?: Record<string, string>;
|
|
1099
|
+
};
|
|
1100
|
+
type CashAppSessionMaterial = {
|
|
1101
|
+
recipientCashtag: string;
|
|
1102
|
+
customerId: string;
|
|
1103
|
+
sessionCookie: string;
|
|
1104
|
+
requestHeaders?: Record<string, string>;
|
|
1105
|
+
requestPayload: string;
|
|
1106
|
+
};
|
|
1107
|
+
type WiseSessionMaterial = {
|
|
1108
|
+
apiToken: string;
|
|
1109
|
+
profileId: string;
|
|
1110
|
+
balanceId: string;
|
|
1111
|
+
currency: string;
|
|
1112
|
+
};
|
|
1113
|
+
type VenmoCredentialUploadInput = {
|
|
1114
|
+
payeeId: string;
|
|
1115
|
+
sessionMaterial: VenmoSessionMaterial;
|
|
1116
|
+
};
|
|
1117
|
+
type CashAppCredentialUploadInput = {
|
|
1118
|
+
payeeId: string;
|
|
1119
|
+
sessionMaterial: CashAppSessionMaterial;
|
|
1120
|
+
};
|
|
1121
|
+
type WiseCredentialUploadInput = {
|
|
1122
|
+
payeeId: string;
|
|
1123
|
+
sessionMaterial: WiseSessionMaterial;
|
|
1124
|
+
};
|
|
1125
|
+
type SellerCredentialUploadInputByPlatform = {
|
|
1126
|
+
venmo: VenmoCredentialUploadInput;
|
|
1127
|
+
cashapp: CashAppCredentialUploadInput;
|
|
1128
|
+
wise: WiseCredentialUploadInput;
|
|
1129
|
+
};
|
|
1130
|
+
type SellerCredentialUploadInput = SellerCredentialUploadInputByPlatform[SellerPlatform];
|
|
1131
|
+
type SellerCiphertextBundle = {
|
|
1132
|
+
encryptedBlob: string;
|
|
1133
|
+
encryptedDataKey: string;
|
|
1134
|
+
nonce: string;
|
|
1135
|
+
payeeIdHash: Hash;
|
|
1136
|
+
};
|
|
1137
|
+
type SellerSignedCiphertextBundle = SellerCiphertextBundle & {
|
|
1138
|
+
expiresAtMs: string;
|
|
1139
|
+
bundleSignature: string;
|
|
1140
|
+
};
|
|
1141
|
+
type SellerVerifyIntentDetails = {
|
|
1142
|
+
intentHash: Hash;
|
|
1143
|
+
amount: string;
|
|
1144
|
+
timestampMs: string;
|
|
1145
|
+
paymentMethod: Hash;
|
|
1146
|
+
fiatCurrency: Hash;
|
|
1147
|
+
conversionRate: string;
|
|
1148
|
+
payeeDetails: Hash;
|
|
1149
|
+
timestampBufferMs?: string;
|
|
1150
|
+
};
|
|
1151
|
+
type SellerVerifyInput = SellerSignedCiphertextBundle & {
|
|
1152
|
+
txId: string;
|
|
1153
|
+
chainId: number;
|
|
1154
|
+
intent: SellerVerifyIntentDetails;
|
|
1155
|
+
};
|
|
1156
|
+
type SellerProbeInput = SellerSignedCiphertextBundle;
|
|
1157
|
+
type SellerCredentialBundle = SellerSignedCiphertextBundle & {
|
|
1158
|
+
platform: SellerPlatform;
|
|
1159
|
+
credentialType: string;
|
|
1160
|
+
};
|
|
1161
|
+
type SellerCredentialBundleUpload = SellerCredentialBundle;
|
|
1162
|
+
type SellerCredentialStatusValue = 'active' | 'inactive' | 'missing';
|
|
1163
|
+
type SellerCredentialStatus = {
|
|
1164
|
+
makerId: number;
|
|
1165
|
+
platform: string;
|
|
1166
|
+
payeeIdHash: Hash;
|
|
1167
|
+
status: SellerCredentialStatusValue;
|
|
1168
|
+
credentialType: string | null;
|
|
1169
|
+
};
|
|
1170
|
+
type SellerVerifyProxyBody = {
|
|
1171
|
+
txId: string;
|
|
1172
|
+
chainId: number;
|
|
1173
|
+
intent: SellerVerifyIntentDetails;
|
|
1174
|
+
};
|
|
1175
|
+
type SellerTypedDataField = {
|
|
1176
|
+
name: string;
|
|
1177
|
+
type: string;
|
|
1178
|
+
};
|
|
1179
|
+
type SellerTypedDataSpec = {
|
|
1180
|
+
primaryType: string;
|
|
1181
|
+
types: Record<string, SellerTypedDataField[]>;
|
|
1182
|
+
};
|
|
1183
|
+
type SellerPaymentTypedDataValue = {
|
|
1184
|
+
intentHash: Hash;
|
|
1185
|
+
releaseAmount: string;
|
|
1186
|
+
dataHash: Hash;
|
|
1187
|
+
};
|
|
1188
|
+
type SellerAttestationOutput = {
|
|
1189
|
+
platform: string;
|
|
1190
|
+
actionType: string;
|
|
1191
|
+
signature: string;
|
|
1192
|
+
signer: Address;
|
|
1193
|
+
domainSeparator: Hash;
|
|
1194
|
+
typeHash: Hash;
|
|
1195
|
+
typedDataSpec: SellerTypedDataSpec;
|
|
1196
|
+
typedDataValue: SellerPaymentTypedDataValue;
|
|
1197
|
+
proofInput: string;
|
|
1198
|
+
encodedPaymentDetails: string;
|
|
1199
|
+
metadata: string;
|
|
1200
|
+
};
|
|
1201
|
+
type SellerCredentialProbeResponse = {
|
|
1202
|
+
alive: boolean;
|
|
1203
|
+
reason?: string | null;
|
|
1204
|
+
};
|
|
1205
|
+
type AttestationServiceSellerCredentialUploadResponse = {
|
|
1206
|
+
success: boolean;
|
|
1207
|
+
message: string;
|
|
1208
|
+
responseObject: SellerCredentialBundle;
|
|
1209
|
+
statusCode: number;
|
|
1210
|
+
};
|
|
1211
|
+
type AttestationServiceSellerVerifyResponse = {
|
|
1212
|
+
success: boolean;
|
|
1213
|
+
message: string;
|
|
1214
|
+
responseObject: SellerAttestationOutput;
|
|
1215
|
+
statusCode: number;
|
|
1216
|
+
};
|
|
1217
|
+
type AttestationServiceSellerCredentialProbeResponse = {
|
|
1218
|
+
success: boolean;
|
|
1219
|
+
message: string;
|
|
1220
|
+
responseObject: SellerCredentialProbeResponse;
|
|
1221
|
+
statusCode: number;
|
|
1222
|
+
};
|
|
1223
|
+
type CuratorSellerCredentialUploadResponse = {
|
|
1224
|
+
success: boolean;
|
|
1225
|
+
message: string;
|
|
1226
|
+
responseObject: SellerCredentialStatus;
|
|
1227
|
+
statusCode: number;
|
|
1228
|
+
};
|
|
1229
|
+
type CuratorSellerCredentialStatusResponse = {
|
|
1230
|
+
success: boolean;
|
|
1231
|
+
message: string;
|
|
1232
|
+
responseObject: SellerCredentialStatus;
|
|
1233
|
+
statusCode: number;
|
|
1234
|
+
};
|
|
1235
|
+
type CuratorSellerVerifyResponse = {
|
|
1236
|
+
success: boolean;
|
|
1237
|
+
message: string;
|
|
1238
|
+
responseObject: SellerAttestationOutput;
|
|
1239
|
+
statusCode: number;
|
|
1240
|
+
};
|
|
1241
|
+
type UploadSellerCredentialParams = {
|
|
1242
|
+
[P in SellerPlatform]: {
|
|
1243
|
+
makerId: number;
|
|
1244
|
+
platform: P;
|
|
1245
|
+
} & SellerCredentialUploadInputByPlatform[P];
|
|
1246
|
+
}[SellerPlatform];
|
|
1247
|
+
type GetSellerCredentialStatusParams = {
|
|
1248
|
+
makerId: number;
|
|
1249
|
+
};
|
|
1250
|
+
type VerifySellerPaymentParams = {
|
|
1251
|
+
platform: SellerPlatform;
|
|
1252
|
+
} & SellerVerifyProxyBody;
|
|
869
1253
|
type QuoteRequest = {
|
|
870
1254
|
paymentPlatforms: string[];
|
|
871
1255
|
fiatCurrency: string;
|
|
@@ -887,6 +1271,8 @@ type QuoteRequest = {
|
|
|
887
1271
|
nearbySearchRange?: number;
|
|
888
1272
|
/** Max suggestions per direction (1-10, default: 3) */
|
|
889
1273
|
nearbyQuotesCount?: number;
|
|
1274
|
+
/** Include whitelist-gated private orderbook deposits scoped to the requesting user */
|
|
1275
|
+
includePrivateOrderbooks?: boolean;
|
|
890
1276
|
};
|
|
891
1277
|
type QuotesBestByPlatformRequest = {
|
|
892
1278
|
fiatCurrency: string;
|
|
@@ -957,7 +1343,7 @@ type QuoteSingleResponse = {
|
|
|
957
1343
|
conversionRate: string;
|
|
958
1344
|
takerConversionRate?: string;
|
|
959
1345
|
intent: QuoteIntentResponse;
|
|
960
|
-
payeeData?:
|
|
1346
|
+
payeeData?: CuratorPayeeData;
|
|
961
1347
|
};
|
|
962
1348
|
type GetQuoteSingleResponse = QuoteSingleResponse & {
|
|
963
1349
|
referrerFeeAmount?: string;
|
|
@@ -1073,9 +1459,9 @@ type GetPayeeDetailsResponse = {
|
|
|
1073
1459
|
responseObject: {
|
|
1074
1460
|
id: number;
|
|
1075
1461
|
processorName: string;
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1462
|
+
offchainId: string;
|
|
1463
|
+
telegramUsername: string | null;
|
|
1464
|
+
metadata: Record<string, string> | null;
|
|
1079
1465
|
hashedOnchainId: string;
|
|
1080
1466
|
createdAt: string;
|
|
1081
1467
|
};
|
|
@@ -1083,9 +1469,9 @@ type GetPayeeDetailsResponse = {
|
|
|
1083
1469
|
};
|
|
1084
1470
|
type ValidatePayeeDetailsRequest = {
|
|
1085
1471
|
processorName: string;
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1472
|
+
offchainId: string;
|
|
1473
|
+
telegramUsername?: string | null;
|
|
1474
|
+
metadata?: Record<string, string> | null;
|
|
1089
1475
|
};
|
|
1090
1476
|
type ValidatePayeeDetailsResponse = {
|
|
1091
1477
|
success: boolean;
|
|
@@ -1125,9 +1511,13 @@ type CreateDepositParams = {
|
|
|
1125
1511
|
intentAmountRange: Range;
|
|
1126
1512
|
conversionRates: CreateDepositConversionRate[][];
|
|
1127
1513
|
processorNames: string[];
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1514
|
+
/**
|
|
1515
|
+
* Required when the SDK needs to register payee details with the curator.
|
|
1516
|
+
* Optional when reusing `payeeDetailsHashes` or supplying the full override arrays.
|
|
1517
|
+
*/
|
|
1518
|
+
payeeData?: CuratorPayeeDataInput[];
|
|
1519
|
+
/** @deprecated Use `payeeData` instead. */
|
|
1520
|
+
depositData?: CuratorPayeeDataInput[];
|
|
1131
1521
|
payeeDetailsHashes?: string[];
|
|
1132
1522
|
paymentMethodsOverride?: `0x${string}`[];
|
|
1133
1523
|
paymentMethodDataOverride?: DepositVerifierData[];
|
|
@@ -1344,6 +1734,45 @@ type GetTakerTierResponse = {
|
|
|
1344
1734
|
responseObject: TakerTier;
|
|
1345
1735
|
statusCode?: number;
|
|
1346
1736
|
};
|
|
1737
|
+
type GetDepositBundleParams = DepositBundleRequest;
|
|
1738
|
+
type GetDepositBundleResponse = DepositBundleResponse;
|
|
1739
|
+
type GetOrderbookParams = {
|
|
1740
|
+
currency: string;
|
|
1741
|
+
paymentPlatform?: string;
|
|
1742
|
+
sortBy?: 'price' | 'available' | 'limits';
|
|
1743
|
+
sortDirection?: 'asc' | 'desc';
|
|
1744
|
+
limit?: number;
|
|
1745
|
+
chainId?: number;
|
|
1746
|
+
token?: string;
|
|
1747
|
+
};
|
|
1748
|
+
type OrderbookEntry = {
|
|
1749
|
+
depositId: string;
|
|
1750
|
+
depositor: string;
|
|
1751
|
+
price: string;
|
|
1752
|
+
availableTokenAmount: string;
|
|
1753
|
+
availableFiatAmount: string;
|
|
1754
|
+
intentAmountMin: string;
|
|
1755
|
+
intentAmountMax: string;
|
|
1756
|
+
paymentPlatform: string;
|
|
1757
|
+
currency: string;
|
|
1758
|
+
paymentMethodHash: string;
|
|
1759
|
+
payeeDetailsHash: string;
|
|
1760
|
+
escrowAddress: string;
|
|
1761
|
+
chainId: number;
|
|
1762
|
+
offchainId?: string;
|
|
1763
|
+
telegramUsername?: string;
|
|
1764
|
+
};
|
|
1765
|
+
type GetOrderbookResponse = {
|
|
1766
|
+
chainId: number;
|
|
1767
|
+
token: string;
|
|
1768
|
+
currency: string;
|
|
1769
|
+
paymentPlatform: string | null;
|
|
1770
|
+
sortBy: string;
|
|
1771
|
+
sortDirection: string;
|
|
1772
|
+
internalDetailsIncluded: boolean;
|
|
1773
|
+
generatedAt: string;
|
|
1774
|
+
entries: OrderbookEntry[];
|
|
1775
|
+
};
|
|
1347
1776
|
|
|
1348
1777
|
declare const PAYMENT_PLATFORMS: readonly ["wise", "venmo", "revolut", "cashapp", "mercadopago", "zelle", "paypal", "monzo", "chime", "luxon", "n26"];
|
|
1349
1778
|
type PaymentPlatformType = (typeof PAYMENT_PLATFORMS)[number];
|
|
@@ -1553,7 +1982,7 @@ type OnchainCurrencyEntry = {
|
|
|
1553
1982
|
* // Step 1: Register payee details (separate from deposit creation)
|
|
1554
1983
|
* const { hashedOnchainIds } = await client.registerPayeeDetails({
|
|
1555
1984
|
* processorNames: ['wise'],
|
|
1556
|
-
*
|
|
1985
|
+
* payeeData: [{ offchainId: 'you@example.com' }],
|
|
1557
1986
|
* });
|
|
1558
1987
|
*
|
|
1559
1988
|
* // Step 2: Create a 1000 USDC deposit accepting Wise payments
|
|
@@ -1562,7 +1991,7 @@ type OnchainCurrencyEntry = {
|
|
|
1562
1991
|
* amount: 1000_000000n,
|
|
1563
1992
|
* intentAmountRange: { min: 10_000000n, max: 500_000000n },
|
|
1564
1993
|
* processorNames: ['wise'],
|
|
1565
|
-
*
|
|
1994
|
+
* payeeData: [{ offchainId: 'you@example.com' }],
|
|
1566
1995
|
* conversionRates: [[
|
|
1567
1996
|
* { currency: 'USD', conversionRate: '1020000000000000000' },
|
|
1568
1997
|
* { currency: 'EUR', conversionRate: '1100000000000000000' },
|
|
@@ -1655,6 +2084,8 @@ declare class Zkp2pClient {
|
|
|
1655
2084
|
private normalizeAddress;
|
|
1656
2085
|
private parseEscrowAddressFromCompositeDepositId;
|
|
1657
2086
|
private parseRawDepositId;
|
|
2087
|
+
private stripTrailingSlash;
|
|
2088
|
+
private defaultAttestationServiceForBaseApiUrl;
|
|
1658
2089
|
private normalizeOracleRateConfig;
|
|
1659
2090
|
private escrowCurrencyHasOracleConfig;
|
|
1660
2091
|
/**
|
|
@@ -1829,7 +2260,7 @@ declare class Zkp2pClient {
|
|
|
1829
2260
|
* Fetches deposits from the indexer with optional filtering and pagination.
|
|
1830
2261
|
* Use for advanced queries across all deposits, not just by owner.
|
|
1831
2262
|
*/
|
|
1832
|
-
getDeposits: (filter?: DepositFilter, pagination?: PaginationOptions) => Promise<DepositEntity[]>;
|
|
2263
|
+
getDeposits: (filter?: DepositFilter, pagination?: PaginationOptions) => Promise<DepositEntity$1[]>;
|
|
1833
2264
|
/**
|
|
1834
2265
|
* Fetches deposits with their related payment methods and optionally intents.
|
|
1835
2266
|
*/
|
|
@@ -1848,19 +2279,19 @@ declare class Zkp2pClient {
|
|
|
1848
2279
|
/**
|
|
1849
2280
|
* Fetches intents for multiple deposits.
|
|
1850
2281
|
*/
|
|
1851
|
-
getIntentsForDeposits: (depositIds: string[], statuses?: IntentStatus[]) => Promise<IntentEntity[]>;
|
|
2282
|
+
getIntentsForDeposits: (depositIds: string[], statuses?: IntentStatus[]) => Promise<IntentEntity$1[]>;
|
|
1852
2283
|
/**
|
|
1853
2284
|
* Fetches all intents created by a specific owner address.
|
|
1854
2285
|
*/
|
|
1855
|
-
getOwnerIntents: (owner: string, statuses?: IntentStatus[]) => Promise<IntentEntity[]>;
|
|
2286
|
+
getOwnerIntents: (owner: string, statuses?: IntentStatus[]) => Promise<IntentEntity$1[]>;
|
|
1856
2287
|
/**
|
|
1857
2288
|
* Fetches fulfilled intents for a vault by rate manager ID.
|
|
1858
2289
|
*/
|
|
1859
|
-
getIntentsByRateManager: (rateManagerId: string, statuses?: IntentStatus[]) => Promise<IntentEntity[]>;
|
|
2290
|
+
getIntentsByRateManager: (rateManagerId: string, statuses?: IntentStatus[]) => Promise<IntentEntity$1[]>;
|
|
1860
2291
|
/**
|
|
1861
2292
|
* Fetches a single intent by hash.
|
|
1862
2293
|
*/
|
|
1863
|
-
getIntentByHash: (intentHash: string) => Promise<IntentEntity | null>;
|
|
2294
|
+
getIntentByHash: (intentHash: string) => Promise<IntentEntity$1 | null>;
|
|
1864
2295
|
/**
|
|
1865
2296
|
* Fetches intents that have expired.
|
|
1866
2297
|
*/
|
|
@@ -1868,7 +2299,7 @@ declare class Zkp2pClient {
|
|
|
1868
2299
|
now: bigint | string;
|
|
1869
2300
|
depositIds: string[];
|
|
1870
2301
|
limit?: number;
|
|
1871
|
-
}) => Promise<IntentEntity[]>;
|
|
2302
|
+
}) => Promise<IntentEntity$1[]>;
|
|
1872
2303
|
/**
|
|
1873
2304
|
* Fetches fulfillment events for completed intents.
|
|
1874
2305
|
*/
|
|
@@ -1894,7 +2325,7 @@ declare class Zkp2pClient {
|
|
|
1894
2325
|
* Fetches deposits by their composite IDs.
|
|
1895
2326
|
* @param ids - Array of composite IDs in format "chainId_escrowAddress_depositId"
|
|
1896
2327
|
*/
|
|
1897
|
-
getDepositsByIds: (ids: string[]) => Promise<DepositEntity[]>;
|
|
2328
|
+
getDepositsByIds: (ids: string[]) => Promise<DepositEntity$1[]>;
|
|
1898
2329
|
/**
|
|
1899
2330
|
* Fetches deposits by their composite IDs with all related data.
|
|
1900
2331
|
* @param ids - Array of composite IDs in format "chainId_escrowAddress_depositId"
|
|
@@ -1906,7 +2337,7 @@ declare class Zkp2pClient {
|
|
|
1906
2337
|
/**
|
|
1907
2338
|
* Fetches maker profit snapshots for the provided deposits.
|
|
1908
2339
|
*/
|
|
1909
|
-
getProfitSnapshotsByDeposits: (depositIds: string[]) => Promise<MakerProfitSnapshotEntity[]>;
|
|
2340
|
+
getProfitSnapshotsByDeposits: (depositIds: string[]) => Promise<MakerProfitSnapshotEntity$1[]>;
|
|
1910
2341
|
/**
|
|
1911
2342
|
* Fetches rate managers (vaults) with aggregate stats.
|
|
1912
2343
|
*/
|
|
@@ -1946,15 +2377,15 @@ declare class Zkp2pClient {
|
|
|
1946
2377
|
/**
|
|
1947
2378
|
* Fetches chronological fund activities for a specific deposit.
|
|
1948
2379
|
*/
|
|
1949
|
-
getDepositFundActivities: (depositId: string) => Promise<DepositFundActivityEntity[]>;
|
|
2380
|
+
getDepositFundActivities: (depositId: string) => Promise<DepositFundActivityEntity$1[]>;
|
|
1950
2381
|
/**
|
|
1951
2382
|
* Fetches fund activities across all deposits for a maker address.
|
|
1952
2383
|
*/
|
|
1953
|
-
getMakerFundActivities: (depositor: string, limit?: number) => Promise<DepositFundActivityEntity[]>;
|
|
2384
|
+
getMakerFundActivities: (depositor: string, limit?: number) => Promise<DepositFundActivityEntity$1[]>;
|
|
1954
2385
|
/**
|
|
1955
2386
|
* Fetches daily snapshots for a deposit, ordered by day ascending.
|
|
1956
2387
|
*/
|
|
1957
|
-
getDepositDailySnapshots: (depositId: string, limit?: number) => Promise<DepositDailySnapshotEntity[]>;
|
|
2388
|
+
getDepositDailySnapshots: (depositId: string, limit?: number) => Promise<DepositDailySnapshotEntity$1[]>;
|
|
1958
2389
|
/**
|
|
1959
2390
|
* Performs a raw GraphQL query against the indexer.
|
|
1960
2391
|
*/
|
|
@@ -2011,23 +2442,22 @@ declare class Zkp2pClient {
|
|
|
2011
2442
|
* register maker payment details with the curator service.
|
|
2012
2443
|
*
|
|
2013
2444
|
* @param params.processorNames - Payment platforms (e.g., ['wise', 'revolut'])
|
|
2014
|
-
* @param params.
|
|
2445
|
+
* @param params.payeeData - Payee details per processor (e.g., [{ offchainId: 'you@example.com' }]). Required when the SDK needs to register payee details with the curator.
|
|
2015
2446
|
* @returns The posted deposit details and their corresponding hashed on-chain IDs
|
|
2016
2447
|
*
|
|
2017
2448
|
* @example
|
|
2018
2449
|
* ```typescript
|
|
2019
2450
|
* const { hashedOnchainIds } = await client.registerPayeeDetails({
|
|
2020
2451
|
* processorNames: ['wise'],
|
|
2021
|
-
*
|
|
2452
|
+
* payeeData: [{ offchainId: 'you@example.com' }],
|
|
2022
2453
|
* });
|
|
2023
2454
|
* // Then pass hashedOnchainIds to createDeposit
|
|
2024
2455
|
* ```
|
|
2025
2456
|
*/
|
|
2026
2457
|
registerPayeeDetails(params: {
|
|
2027
2458
|
processorNames: string[];
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
}[];
|
|
2459
|
+
payeeData?: CuratorPayeeDataInput[];
|
|
2460
|
+
depositData?: CuratorPayeeDataInput[];
|
|
2031
2461
|
}): Promise<{
|
|
2032
2462
|
depositDetails: PostDepositDetailsRequest[];
|
|
2033
2463
|
hashedOnchainIds: string[];
|
|
@@ -2045,16 +2475,17 @@ declare class Zkp2pClient {
|
|
|
2045
2475
|
* @param params.amount - Total deposit amount in token units (6 decimals for USDC)
|
|
2046
2476
|
* @param params.intentAmountRange - Min/max amount per intent
|
|
2047
2477
|
* @param params.processorNames - Payment platforms to accept (e.g., ['wise', 'revolut'])
|
|
2048
|
-
* @param params.
|
|
2478
|
+
* @param params.payeeData - Payee details per processor (e.g., [{ offchainId: 'you@example.com' }])
|
|
2049
2479
|
* @param params.conversionRates - Conversion rates per processor, grouped by currency
|
|
2050
2480
|
* @param params.payeeDetailsHashes - Pre-computed hashed on-chain IDs (from registerPayeeDetails). When provided, skips the curator API call entirely.
|
|
2051
2481
|
* @param params.delegate - Optional delegate address that can manage the deposit
|
|
2052
2482
|
* @param params.intentGuardian - Optional guardian for intent approval
|
|
2053
2483
|
* @param params.retainOnEmpty - Keep deposit active when balance reaches zero
|
|
2054
2484
|
* @param params.txOverrides - Optional viem transaction overrides
|
|
2055
|
-
* @returns The deposit details posted to API and the transaction hash
|
|
2485
|
+
* @returns The deposit details posted to API (empty when payee registration is skipped) and the transaction hash
|
|
2056
2486
|
*
|
|
2057
|
-
* @throws Error if processorNames,
|
|
2487
|
+
* @throws Error if processorNames, payeeData, and conversionRates lengths don't match
|
|
2488
|
+
* @throws Error if payeeData is missing and neither payeeDetailsHashes nor full payment method overrides are provided
|
|
2058
2489
|
* @throws Error if a currency is not supported by the specified processor
|
|
2059
2490
|
*
|
|
2060
2491
|
* @example
|
|
@@ -2065,7 +2496,7 @@ declare class Zkp2pClient {
|
|
|
2065
2496
|
* amount: 1000_000000n,
|
|
2066
2497
|
* intentAmountRange: { min: 10_000000n, max: 500_000000n },
|
|
2067
2498
|
* processorNames: ['wise'],
|
|
2068
|
-
*
|
|
2499
|
+
* payeeData: [{ offchainId: 'you@example.com' }],
|
|
2069
2500
|
* conversionRates: [[
|
|
2070
2501
|
* { currency: 'USD', conversionRate: '1020000000000000000' }, // 1.02
|
|
2071
2502
|
* { currency: 'EUR', conversionRate: '1100000000000000000' }, // 1.10
|
|
@@ -2082,9 +2513,8 @@ declare class Zkp2pClient {
|
|
|
2082
2513
|
max: bigint;
|
|
2083
2514
|
};
|
|
2084
2515
|
processorNames: string[];
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
}[];
|
|
2516
|
+
payeeData?: CuratorPayeeDataInput[];
|
|
2517
|
+
depositData?: CuratorPayeeDataInput[];
|
|
2088
2518
|
conversionRates: {
|
|
2089
2519
|
currency: string;
|
|
2090
2520
|
conversionRate: string;
|
|
@@ -2120,9 +2550,8 @@ declare class Zkp2pClient {
|
|
|
2120
2550
|
max: bigint;
|
|
2121
2551
|
};
|
|
2122
2552
|
processorNames: string[];
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
}[];
|
|
2553
|
+
payeeData?: CuratorPayeeDataInput[];
|
|
2554
|
+
depositData?: CuratorPayeeDataInput[];
|
|
2126
2555
|
conversionRates: {
|
|
2127
2556
|
currency: string;
|
|
2128
2557
|
conversionRate: string;
|
|
@@ -2588,7 +3017,7 @@ declare class Zkp2pClient {
|
|
|
2588
3017
|
* sending fiat payment to the deposit's payee.
|
|
2589
3018
|
*
|
|
2590
3019
|
* If `gatingServiceSignature` is not provided, the SDK will automatically
|
|
2591
|
-
* fetch one from curator `/v3/intent` when `apiKey` or `authorizationToken`
|
|
3020
|
+
* fetch one from curator `/v3/intent/sign` when `apiKey` or `authorizationToken`
|
|
2592
3021
|
* is available. Otherwise you must provide `gatingServiceSignature` and
|
|
2593
3022
|
* `signatureExpiration` yourself.
|
|
2594
3023
|
*
|
|
@@ -2866,6 +3295,44 @@ declare class Zkp2pClient {
|
|
|
2866
3295
|
baseApiUrl?: string;
|
|
2867
3296
|
timeoutMs?: number;
|
|
2868
3297
|
}): Promise<GetTakerTierResponse>;
|
|
3298
|
+
/**
|
|
3299
|
+
* The signed `expiresAtMs` field is an upload-time freshness token minted by attestation-service.
|
|
3300
|
+
* Once curator persists the bundle, seller-automated-release availability is governed by curator's
|
|
3301
|
+
* probe/revalidation state rather than this timestamp.
|
|
3302
|
+
*
|
|
3303
|
+
* Curator accepts either a configured API key or bearer token for this endpoint.
|
|
3304
|
+
*
|
|
3305
|
+
* Create a signed seller credential bundle with attestation-service and store it on the maker via curator.
|
|
3306
|
+
*/
|
|
3307
|
+
uploadSellerCredential(params: UploadSellerCredentialParams, opts?: {
|
|
3308
|
+
baseApiUrl?: string;
|
|
3309
|
+
attestationServiceUrl?: string;
|
|
3310
|
+
timeoutMs?: number;
|
|
3311
|
+
}): Promise<CuratorSellerCredentialUploadResponse>;
|
|
3312
|
+
/**
|
|
3313
|
+
* Status is a coarse curator-owned signal (`active` / `inactive` / `missing`) and intentionally
|
|
3314
|
+
* omits low-level diagnostics. Curator may still re-probe stale credentials during verify, so callers
|
|
3315
|
+
* should continue to handle a 410 from `verifySellerPayment`.
|
|
3316
|
+
*
|
|
3317
|
+
* Curator accepts either a configured API key or bearer token for this endpoint.
|
|
3318
|
+
*
|
|
3319
|
+
* Fetch seller credential status for a maker from curator.
|
|
3320
|
+
*/
|
|
3321
|
+
getSellerCredentialStatus(params: GetSellerCredentialStatusParams, opts?: {
|
|
3322
|
+
baseApiUrl?: string;
|
|
3323
|
+
timeoutMs?: number;
|
|
3324
|
+
}): Promise<CuratorSellerCredentialStatusResponse>;
|
|
3325
|
+
/**
|
|
3326
|
+
* Internal-use endpoint. The curator route requires an internal `x-api-key`; standard SDK consumer
|
|
3327
|
+
* API keys will be rejected with 401. Returns 410 GONE when curator has marked the credential inactive
|
|
3328
|
+
* or a stale credential fails its synchronous re-probe.
|
|
3329
|
+
*
|
|
3330
|
+
* Verify a seller payment via curator's seller-credential proxy.
|
|
3331
|
+
*/
|
|
3332
|
+
verifySellerPayment(params: VerifySellerPaymentParams, opts?: {
|
|
3333
|
+
baseApiUrl?: string;
|
|
3334
|
+
timeoutMs?: number;
|
|
3335
|
+
}): Promise<CuratorSellerVerifyResponse>;
|
|
2869
3336
|
private requireProtocolViewer;
|
|
2870
3337
|
private protocolViewerFunctionInputCount;
|
|
2871
3338
|
/**
|
|
@@ -3028,4 +3495,4 @@ type SendBatchFn = (txs: Array<{
|
|
|
3028
3495
|
value?: bigint;
|
|
3029
3496
|
}>) => Promise<string>;
|
|
3030
3497
|
|
|
3031
|
-
export { type
|
|
3498
|
+
export { type QuoteSingleResponse as $, type ApiAdapterOptions as A, type BestByPlatformResponse as B, type CurrencyType as C, type DepositWithRelations as D, type GetBestByPlatformResponse as E, type FulfillIntentMethodParams as F, type GetPayeeDetailsRequest as G, type GetBestByPlatformResponseObject as H, type IntentEntity$1 as I, type GetPlatformQuote as J, type PlatformQuote as K, type QuoteRequest as L, type GetNearbyQuote as M, type GetNearbySuggestions as N, type GetQuoteResponse as O, type PostDepositDetailsRequest as P, type QuotesBestByPlatformRequest as Q, type ReferrerFeeConfig as R, type SignalIntentReferralFee as S, type TxOverrides as T, type GetQuoteResponseObject as U, type ValidatePayeeDetailsRequest as V, type WithdrawDepositParams as W, type GetQuoteSingleResponse as X, type QuoteResponse as Y, Zkp2pClient as Z, type QuoteResponseObject as _, type ValidatePayeeDetailsResponse as a, type PlatformLimit as a$, type QuoteIntentResponse as a0, type QuoteFeesResponse as a1, type FiatResponse as a2, type TokenResponse as a3, type NearbyQuote as a4, type NearbySuggestions as a5, type ApiDeposit as a6, type DepositVerifier as a7, type DepositVerifierCurrency as a8, type DepositStatus as a9, type SellerCredentialBundle as aA, type SellerCredentialBundleUpload as aB, type SellerCredentialStatusValue as aC, type SellerCredentialStatus as aD, type SellerVerifyProxyBody as aE, type SellerTypedDataField as aF, type SellerTypedDataSpec as aG, type SellerPaymentTypedDataValue as aH, type SellerAttestationOutput as aI, type SellerCredentialProbeResponse as aJ, type AttestationServiceSellerCredentialUploadResponse as aK, type AttestationServiceSellerVerifyResponse as aL, type AttestationServiceSellerCredentialProbeResponse as aM, type CuratorSellerCredentialUploadResponse as aN, type CuratorSellerCredentialStatusResponse as aO, type CuratorSellerVerifyResponse as aP, type UploadSellerCredentialParams as aQ, type GetSellerCredentialStatusParams as aR, type VerifySellerPaymentParams as aS, type OnchainCurrency as aT, type DepositVerifierData as aU, type PreparedTransaction as aV, type OrderStats as aW, type DepositIntentStatistics as aX, type TakerTier as aY, type TakerTierStats as aZ, type TakerTierLevel as a_, type GetDepositByIdRequest as aa, type GetDepositByIdResponse as ab, type Intent as ac, type ApiIntentStatus as ad, type GetOwnerIntentsRequest as ae, type GetOwnerIntentsResponse as af, type GetIntentsByDepositRequest as ag, type GetIntentsByDepositResponse as ah, type GetIntentByHashRequest as ai, type GetIntentByHashResponse as aj, type RegisterPayeeDetailsRequest as ak, type RegisterPayeeDetailsResponse as al, type SellerPlatform as am, type VenmoSessionMaterial as an, type CashAppSessionMaterial as ao, type WiseSessionMaterial as ap, type VenmoCredentialUploadInput as aq, type CashAppCredentialUploadInput as ar, type WiseCredentialUploadInput as as, type SellerCredentialUploadInputByPlatform as at, type SellerCredentialUploadInput as au, type SellerCiphertextBundle as av, type SellerSignedCiphertextBundle as aw, type SellerVerifyIntentDetails as ax, type SellerVerifyInput as ay, type SellerProbeInput as az, type PostDepositDetailsResponse as b, type PV_ReferralFee as b$, type PlatformRiskLevel as b0, type OrderbookEntry as b1, IndexerClient as b2, defaultIndexerEndpoint as b3, IndexerDepositService as b4, IndexerRateManagerService as b5, compareEventCursorIdsByRecency as b6, fetchFulfillmentAndPayment as b7, type DepositEntity$1 as b8, type IntentFulfilledEntity as b9, type DeploymentEnv as bA, type FulfillmentRecord as bB, type PaymentVerifiedRecord as bC, type FulfillmentAndPaymentResponse as bD, PAYMENT_PLATFORMS as bE, type PaymentPlatformType as bF, Currency as bG, currencyInfo as bH, getCurrencyInfoFromHash as bI, getCurrencyInfoFromCountryCode as bJ, getCurrencyCodeFromHash as bK, isSupportedCurrencyHash as bL, mapConversionRatesToOnchainMinRate as bM, type CurrencyData as bN, getContracts as bO, getRateManagerContracts as bP, getPaymentMethodsCatalog as bQ, getGatingServiceAddress as bR, type RuntimeEnv as bS, parseDepositView as bT, parseIntentView as bU, enrichPvDepositView as bV, enrichPvIntentView as bW, type PV_DepositView as bX, type PV_Deposit as bY, type PV_PaymentMethodData as bZ, type PV_Currency as b_, type IntentFulfillmentAmountsEntity as ba, type DepositPaymentMethodEntity$1 as bb, type MethodCurrencyEntity$1 as bc, type IntentStatus as bd, type RateManagerEntity as be, type RateManagerRateEntity as bf, type RateManagerDelegationEntity as bg, type ManagerAggregateStatsEntity as bh, type ManagerStatsEntity as bi, type ManagerDailySnapshotEntity as bj, type RateManagerListItem as bk, type RateManagerDetail as bl, type ManualRateUpdateEntity as bm, type OracleConfigUpdateEntity as bn, type DepositFundActivityEntity$1 as bo, type DepositDailySnapshotEntity$1 as bp, type DepositFundActivityType$1 as bq, type DepositFilter as br, type PaginationOptions as bs, type DepositOrderField as bt, type OrderDirection$1 as bu, type RateManagerFilter as bv, type RateManagerPaginationOptions as bw, type RateManagerDelegationPaginationOptions as bx, type RateManagerOrderField as by, type OrderDirection as bz, type GetPayeeDetailsResponse as c, type PV_IntentView as c0, type PV_Intent as c1, ZERO_RATE_MANAGER_ID as c2, isZeroRateManagerId as c3, normalizeRateManagerId as c4, normalizeRegistry as c5, getDelegationRoute as c6, classifyDelegationState as c7, type DelegationRoute as c8, type DelegationState as c9, type DelegationDepositTarget as ca, type BatchResult as cb, type SendTransactionFn as cc, type SendBatchFn as cd, ZERO_ADDRESS as ce, asErrorMessage as cf, assertDelegationMethodSupport as cg, type GetOwnerDepositsRequest as d, type GetOwnerDepositsResponse as e, type GetTakerTierRequest as f, type GetTakerTierResponse as g, type GetDepositBundleParams as h, type GetDepositBundleResponse as i, type GetOrderbookParams as j, type GetOrderbookResponse as k, type PaymentMethodCatalog as l, type SignalIntentMethodParams as m, type CancelIntentMethodParams as n, type Zkp2pNextOptions as o, type AuthorizationTokenProvider as p, type TimeoutConfig as q, type ActionCallback as r, type CreateDepositParams as s, type CreateDepositConversionRate as t, type Range as u, type SignalIntentParams as v, type FulfillIntentParams as w, type ReleaseFundsToPayerParams as x, type CancelIntentParams as y, type BestByPlatformResponseObject as z };
|