@zkp2p/indexer-schema 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -33,7 +33,7 @@ schema: node_modules/@zkp2p/indexer-schema/dist/schema.graphql
33
33
 
34
34
  ## Exported Types
35
35
 
36
- **Domain entities:** Deposit, DepositPaymentMethod, MethodCurrency, Intent, QuoteCandidate, ReferralFeeDistribution
36
+ **Domain entities:** Deposit, DepositPaymentMethod, MethodCurrency, Intent, QuoteCandidate, WhitelistEntry, ReferralFeeDistribution
37
37
 
38
38
  **Stats:** TakerStats, MakerStats, MakerPlatformStats, MakerCurrencyStats, ManagerStats, ManagerAggregateStats, ManagerDailySnapshot
39
39
 
@@ -68,6 +68,9 @@ type Deposit {
68
68
  rateManagerAddress: String
69
69
  delegatedAt: BigInt
70
70
 
71
+ # Whitelist hook address (optional)
72
+ whitelistHookAddress: String # Address of the active whitelist pre-intent hook (optional)
73
+
71
74
  # Reverse links for convenience in GraphQL (via @derivedFrom)
72
75
  intents: [Intent!]! @derivedFrom(field: "depositId")
73
76
  paymentMethods: [DepositPaymentMethod!]! @derivedFrom(field: "depositId")
@@ -447,6 +450,7 @@ type QuoteCandidate {
447
450
  successRateBps: Int! # Maker success rate for deposit-level filtering
448
451
  payeeDetailsHash: String! # Hashed payee details required for verification
449
452
  intentGatingService: String # Optional gating service that must authorize takers
453
+ whitelistHookAddress: String # Address of the active whitelist pre-intent hook for this deposit (optional)
450
454
  isActive: Boolean! # Whether this tuple is currently quoteable for takers
451
455
  hasMinLiquidity: Boolean! # Whether availableTokenAmount is at least intentAmountMin
452
456
  minFiatSupported: BigInt! # intentAmountMin converted using takerConversionRate
@@ -454,3 +458,18 @@ type QuoteCandidate {
454
458
  maxFiatAvail: BigInt! # availableTokenAmount converted using takerConversionRate
455
459
  updatedAt: BigInt! # Last time the denormalized row was refreshed
456
460
  }
461
+
462
+ """
463
+ Per-deposit taker whitelist entry. Created when a taker is whitelisted for a specific deposit via a WhitelistPreIntentHook contract. Deleted when the taker is removed or the hook is rotated.
464
+ """
465
+ type WhitelistEntry {
466
+ id: ID! # escrowAddress_depositId_taker
467
+ chainId: Int!
468
+ hookAddress: String!
469
+ escrowAddress: String! @index
470
+ depositId: String! @index
471
+ depositIdOnContract: BigInt!
472
+ taker: String! @index
473
+ createdAt: BigInt!
474
+ updatedAt: BigInt!
475
+ }
package/dist/types.d.ts CHANGED
@@ -98,6 +98,8 @@ export interface Deposit {
98
98
  rateManagerAddress?: string;
99
99
  /** Timestamp when the current delegated manager assignment was applied. */
100
100
  delegatedAt?: string;
101
+ /** Optional address of the active whitelist pre-intent hook for private orderbooks. When set, only whitelisted takers can signal intents against this deposit. */
102
+ whitelistHookAddress?: string;
101
103
  }
102
104
 
103
105
  /**
@@ -840,6 +842,8 @@ export interface QuoteCandidate {
840
842
  payeeDetailsHash: string;
841
843
  /** Optional gating service copied from `DepositPaymentMethod`. */
842
844
  intentGatingService?: string;
845
+ /** Optional whitelist hook address denormalized from `Deposit`. When non-null, this deposit is private and only whitelisted takers can access it. */
846
+ whitelistHookAddress?: string;
843
847
  /** Final quoteability flag. It is `true` only when the payment method is active, the deposit is accepting intents, and the taker-facing rate is non-zero. */
844
848
  isActive: boolean;
845
849
  /** Whether `availableTokenAmount >= intentAmountMin`. */
@@ -853,3 +857,32 @@ export interface QuoteCandidate {
853
857
  /** Last time the denormalized row was recomputed. */
854
858
  updatedAt: string;
855
859
  }
860
+
861
+ /**
862
+ * Per-deposit taker whitelist entry for private orderbooks. Created when the `WhitelistPreIntentHook` contract emits a `TakerWhitelisted` event and the emitting hook matches the deposit's active `whitelistHookAddress`. Purged when the hook is rotated/cleared via `DepositWhitelistHookSet` or when the taker is explicitly removed.
863
+ *
864
+ * @id escrowAddress_depositId_taker
865
+ *
866
+ * **Relationships:**
867
+ * - Many-to-one to `Deposit` via `depositId`
868
+ */
869
+ export interface WhitelistEntry {
870
+ /** Composite key `escrowAddress_depositId_taker` (all lowercased). */
871
+ id: string;
872
+ /** Chain where the deposit lives. */
873
+ chainId: number;
874
+ /** Address of the `WhitelistPreIntentHook` contract that emitted the event. */
875
+ hookAddress: string;
876
+ /** Escrow contract address scoping the deposit. */
877
+ escrowAddress: string;
878
+ /** Foreign-key string to `Deposit.id` (composite: `escrowAddress_depositId`). */
879
+ depositId: string;
880
+ /** Raw on-chain deposit identifier. */
881
+ depositIdOnContract: string;
882
+ /** Lowercased address of the whitelisted taker. */
883
+ taker: string;
884
+ /** Timestamp when the taker was first whitelisted. */
885
+ createdAt: string;
886
+ /** Timestamp of the most recent mutation to this entry. */
887
+ updatedAt: string;
888
+ }
package/dist/types.ts CHANGED
@@ -100,6 +100,8 @@ export interface Deposit {
100
100
  rateManagerAddress?: string;
101
101
  /** Timestamp when the current delegated manager assignment was applied. */
102
102
  delegatedAt?: string;
103
+ /** Optional address of the active whitelist pre-intent hook for private orderbooks. When set, only whitelisted takers can signal intents against this deposit. */
104
+ whitelistHookAddress?: string;
103
105
  }
104
106
 
105
107
  /**
@@ -842,6 +844,8 @@ export interface QuoteCandidate {
842
844
  payeeDetailsHash: string;
843
845
  /** Optional gating service copied from `DepositPaymentMethod`. */
844
846
  intentGatingService?: string;
847
+ /** Optional whitelist hook address denormalized from `Deposit`. When non-null, this deposit is private and only whitelisted takers can access it. */
848
+ whitelistHookAddress?: string;
845
849
  /** Final quoteability flag. It is `true` only when the payment method is active, the deposit is accepting intents, and the taker-facing rate is non-zero. */
846
850
  isActive: boolean;
847
851
  /** Whether `availableTokenAmount >= intentAmountMin`. */
@@ -855,3 +859,32 @@ export interface QuoteCandidate {
855
859
  /** Last time the denormalized row was recomputed. */
856
860
  updatedAt: string;
857
861
  }
862
+
863
+ /**
864
+ * Per-deposit taker whitelist entry for private orderbooks. Created when the `WhitelistPreIntentHook` contract emits a `TakerWhitelisted` event and the emitting hook matches the deposit's active `whitelistHookAddress`. Purged when the hook is rotated/cleared via `DepositWhitelistHookSet` or when the taker is explicitly removed.
865
+ *
866
+ * @id escrowAddress_depositId_taker
867
+ *
868
+ * **Relationships:**
869
+ * - Many-to-one to `Deposit` via `depositId`
870
+ */
871
+ export interface WhitelistEntry {
872
+ /** Composite key `escrowAddress_depositId_taker` (all lowercased). */
873
+ id: string;
874
+ /** Chain where the deposit lives. */
875
+ chainId: number;
876
+ /** Address of the `WhitelistPreIntentHook` contract that emitted the event. */
877
+ hookAddress: string;
878
+ /** Escrow contract address scoping the deposit. */
879
+ escrowAddress: string;
880
+ /** Foreign-key string to `Deposit.id` (composite: `escrowAddress_depositId`). */
881
+ depositId: string;
882
+ /** Raw on-chain deposit identifier. */
883
+ depositIdOnContract: string;
884
+ /** Lowercased address of the whitelisted taker. */
885
+ taker: string;
886
+ /** Timestamp when the taker was first whitelisted. */
887
+ createdAt: string;
888
+ /** Timestamp of the most recent mutation to this entry. */
889
+ updatedAt: string;
890
+ }
@@ -103,6 +103,7 @@ Canonical maker-owned escrow position. This is the root entity for most business
103
103
  | `rateManagerId` | Optional delegated rate-manager identifier currently assigned to the deposit. |
104
104
  | `rateManagerAddress` | Optional rate-manager contract address paired with `rateManagerId`. |
105
105
  | `delegatedAt` | Timestamp when the current delegated manager assignment was applied. |
106
+ | `whitelistHookAddress` | Optional address of the active whitelist pre-intent hook for private orderbooks. When set, only whitelisted takers can signal intents against this deposit. |
106
107
  | `intents` | Reverse GraphQL edge to all `Intent` rows whose `depositId` points at this deposit. |
107
108
  | `paymentMethods` | Reverse edge to `DepositPaymentMethod` rows for this deposit. |
108
109
  | `currencies` | Reverse edge to `MethodCurrency` rows for this deposit. |
@@ -233,6 +234,26 @@ Per-recipient referral-fee settlement rows for v2.2. The `Intent` stores the agg
233
234
  | `txHash` | Transaction that emitted the distribution event. |
234
235
  | `timestamp` | Settlement timestamp for this distribution row. |
235
236
 
237
+ ### `WhitelistEntry`
238
+
239
+ Per-deposit taker whitelist entry for private orderbooks. Created when the `WhitelistPreIntentHook` contract emits a `TakerWhitelisted` event and the emitting hook matches the deposit's active `whitelistHookAddress`. Purged when the hook is rotated/cleared via `DepositWhitelistHookSet` or when the taker is explicitly removed.
240
+
241
+ **Relationships**
242
+
243
+ - Many-to-one to `Deposit` via `depositId`
244
+
245
+ | Field | Meaning |
246
+ | --- | --- |
247
+ | `id` | Composite key `escrowAddress_depositId_taker` (all lowercased). |
248
+ | `chainId` | Chain where the deposit lives. |
249
+ | `hookAddress` | Address of the `WhitelistPreIntentHook` contract that emitted the event. |
250
+ | `escrowAddress` | Escrow contract address scoping the deposit. |
251
+ | `depositId` | Foreign-key string to `Deposit.id` (composite: `escrowAddress_depositId`). |
252
+ | `depositIdOnContract` | Raw on-chain deposit identifier. |
253
+ | `taker` | Lowercased address of the whitelisted taker. |
254
+ | `createdAt` | Timestamp when the taker was first whitelisted. |
255
+ | `updatedAt` | Timestamp of the most recent mutation to this entry. |
256
+
236
257
  ### `TakerStats`
237
258
 
238
259
  Per-owner behavioral aggregate. This row is updated from signaled, fulfilled/manual-release, and prune flows. In v21 it also carries a `lockScore` penalty based on how long cancelled intents kept liquidity locked.
@@ -582,6 +603,7 @@ Read-optimized quoting view. This is intentionally denormalized so curator/quote
582
603
  | `successRateBps` | Deposit-level success signal copied from `Deposit`. |
583
604
  | `payeeDetailsHash` | Hashed payee details copied from `DepositPaymentMethod`. |
584
605
  | `intentGatingService` | Optional gating service copied from `DepositPaymentMethod`. |
606
+ | `whitelistHookAddress` | Optional whitelist hook address denormalized from `Deposit`. When non-null, this deposit is private and only whitelisted takers can access it. |
585
607
  | `isActive` | Final quoteability flag. It is `true` only when the payment method is active, the deposit is accepting intents, and the taker-facing rate is non-zero. |
586
608
  | `hasMinLiquidity` | Whether `availableTokenAmount >= intentAmountMin`. |
587
609
  | `minFiatSupported` | Fiat value of `intentAmountMin` using the taker-facing rate. |
package/llms.txt CHANGED
@@ -69,6 +69,7 @@ RateManager (1)──(N) RateManagerRate (per method × currency)
69
69
  PriceSnapshot ←── daily FX rates (USD/EUR/GBP/etc.)
70
70
  MakerProfitSnapshot ←── per-intent profit: quote rate vs oracle FX rate
71
71
  ReferralFeeDistribution ←── per-intent referral fee breakdown
72
+ WhitelistEntry ←── per-deposit taker whitelist for private orderbooks
72
73
  ```
73
74
 
74
75
  ### Explicit Schema Edges
@@ -287,6 +288,25 @@ Per-recipient referral-fee settlement rows for v2.2. The `Intent` stores the agg
287
288
  | `txHash` | `string` | Transaction that emitted the distribution event. |
288
289
  | `timestamp` | `string (BigInt)` | Settlement timestamp for this distribution row. |
289
290
 
291
+ ### `WhitelistEntry`
292
+
293
+ Per-deposit taker whitelist entry for private orderbooks. Created when the `WhitelistPreIntentHook` contract emits `TakerWhitelisted` and the hook matches the deposit's active `whitelistHookAddress`. Purged when the hook is rotated/cleared or the taker is removed.
294
+
295
+ **Relationships:**
296
+ - Many-to-one to `Deposit` via `depositId`
297
+
298
+ | Field | Type | Meaning |
299
+ |-------|------|---------|
300
+ | `id` | `string` | Composite key `escrowAddress_depositId_taker` (all lowercased). |
301
+ | `chainId` | `number` | Chain where the deposit lives. |
302
+ | `hookAddress` | `string` | WhitelistPreIntentHook contract address that emitted the event. |
303
+ | `escrowAddress` | `string` | Escrow contract address. |
304
+ | `depositId` | `string` | FK to `Deposit.id` (composite: `escrowAddress_depositId`). |
305
+ | `depositIdOnContract` | `string (BigInt)` | Raw on-chain deposit identifier. |
306
+ | `taker` | `string` | Lowercased address of the whitelisted taker. |
307
+ | `createdAt` | `string (BigInt)` | Timestamp when taker was first whitelisted. |
308
+ | `updatedAt` | `string (BigInt)` | Timestamp of most recent mutation. |
309
+
290
310
  ### `QuoteCandidate`
291
311
 
292
312
  Read-optimized quoting view. This is intentionally denormalized so curator/quote APIs do not need to join `Deposit`, `DepositPaymentMethod`, and `MethodCurrency` at request time.
@@ -635,6 +655,7 @@ Per-deposit stats row for a delegated manager. Where `ManagerAggregateStats` is
635
655
  | QuoteCandidate | same as MethodCurrency |
636
656
  | DepositPaymentMethod | `{escrow}_{depositId}_{paymentMethodHash}` |
637
657
  | ReferralFeeDistribution | `{chainId}_{intentHash}_{feeRecipient}` |
658
+ | WhitelistEntry | `{escrowAddress}_{depositId}_{taker}` |
638
659
  | MakerStats | `{chainId}_{makerAddress}` |
639
660
  | TakerStats | `{chainId}_{ownerAddress}` |
640
661
  | MakerPlatformStats | `{chainId}_{maker}_{paymentMethodHash}` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zkp2p/indexer-schema",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "ZKP2P Indexer GraphQL schema and TypeScript types",
5
5
  "private": false,
6
6
  "publishConfig": {