@zkp2p/sdk 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, V as ValidatePayeeDetailsRequest, a as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, b as PostDepositDetailsResponse, G as GetPayeeDetailsRequest, c as GetPayeeDetailsResponse, d as GetOwnerDepositsRequest, e as GetOwnerDepositsResponse, f as GetTakerTierRequest, g as GetTakerTierResponse, C as CurrencyType, h as PaymentMethodCatalog, T as TxOverrides } from './vaultUtils-DiAumiXp.mjs';
2
- export { m as ActionCallback, O as ApiDeposit, a1 as ApiIntentStatus, A as AuthorizationTokenProvider, bt as BatchResult, j as CancelIntentMethodParams, t as CancelIntentParams, o as CreateDepositConversionRate, n as CreateDepositParams, aY as Currency, b3 as CurrencyData, bs as DelegationDepositTarget, bq as DelegationRoute, br as DelegationState, be as Deposit, bg as DepositCurrency, ae as DepositIntentStatistics, Y as DepositStatus, U as DepositVerifier, X as DepositVerifierCurrency, ab as DepositVerifierData, bd as DepositView, K as FiatResponse, F as FulfillIntentMethodParams, r as FulfillIntentParams, _ as GetDepositByIdRequest, $ as GetDepositByIdResponse, a6 as GetIntentByHashRequest, a7 as GetIntentByHashResponse, a4 as GetIntentsByDepositRequest, a5 as GetIntentsByDepositResponse, u as GetNearbyQuote, v as GetNearbySuggestions, a2 as GetOwnerIntentsRequest, a3 as GetOwnerIntentsResponse, w as GetQuoteResponse, x as GetQuoteResponseObject, y as GetQuoteSingleResponse, ak as IndexerClient, aS as IndexerDeploymentEnv, aq as IndexerDeposit, aH as IndexerDepositDailySnapshot, aJ as IndexerDepositFilter, aG as IndexerDepositFundActivity, aI as IndexerDepositFundActivityType, aM as IndexerDepositOrderDirection, aL as IndexerDepositOrderField, aK as IndexerDepositPagination, at as IndexerDepositPaymentMethod, am as IndexerDepositService, aV as IndexerFulfillmentAndPaymentResponse, aT as IndexerFulfillmentRecord, ar as IndexerIntentFulfilled, as as IndexerIntentFulfillmentAmounts, av as IndexerIntentStatus, az as IndexerManagerAggregateStats, aB as IndexerManagerDailySnapshot, aA as IndexerManagerStats, aE as IndexerManualRateUpdate, au as IndexerMethodCurrency, aF as IndexerOracleConfigUpdate, aU as IndexerPaymentVerifiedRecord, aw as IndexerRateManager, ay as IndexerRateManagerDelegation, aP as IndexerRateManagerDelegationPagination, aD as IndexerRateManagerDetail, aN as IndexerRateManagerFilter, aC as IndexerRateManagerListItem, aR as IndexerRateManagerOrderDirection, aQ as IndexerRateManagerOrderField, aO as IndexerRateManagerPagination, ax as IndexerRateManagerRate, an as IndexerRateManagerService, a0 as Intent, bi as IntentView, N as NearbyQuote, M as NearbySuggestions, Z as OfframpClient, aa as OnchainCurrency, bj as OnchainIntent, ad as OrderStats, aW as PAYMENT_PLATFORMS, bf as PaymentMethodData, aX as PaymentPlatformType, ai as PlatformLimit, aj as PlatformRiskLevel, ac as PreparedTransaction, J as QuoteFeesResponse, H as QuoteIntentResponse, Q as QuoteRequest, z as QuoteResponse, B as QuoteResponseObject, E as QuoteSingleResponse, p as Range, bh as ReferralFee, a8 as RegisterPayeeDetailsRequest, a9 as RegisterPayeeDetailsResponse, s as ReleaseFundsToPayerParams, b8 as RuntimeEnv, bv as SendBatchFn, bu as SendTransactionFn, i as SignalIntentMethodParams, q as SignalIntentParams, S as SignalIntentReferralFee, af as TakerTier, ah as TakerTierLevel, ag as TakerTierStats, l as TimeoutConfig, L as TokenResponse, W as WithdrawDepositParams, bk as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, k as Zkp2pClientOptions, bp as classifyDelegationState, ao as compareEventCursorIdsByRecency, aZ as currencyInfo, al as defaultIndexerEndpoint, bb as enrichPvDepositView, bc as enrichPvIntentView, ap as fetchIndexerFulfillmentAndPayment, b4 as getContracts, b0 as getCurrencyCodeFromHash, a$ as getCurrencyInfoFromCountryCode, a_ as getCurrencyInfoFromHash, bo as getDelegationRoute, b7 as getGatingServiceAddress, b6 as getPaymentMethodsCatalog, b5 as getRateManagerContracts, b1 as isSupportedCurrencyHash, bl as isZeroRateManagerId, b2 as mapConversionRatesToOnchainMinRate, bm as normalizeRateManagerId, bn as normalizeRegistry, b9 as parseDepositView, ba as parseIntentView } from './vaultUtils-DiAumiXp.mjs';
1
+ import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, V as ValidatePayeeDetailsRequest, a as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, b as PostDepositDetailsResponse, G as GetPayeeDetailsRequest, c as GetPayeeDetailsResponse, d as GetOwnerDepositsRequest, e as GetOwnerDepositsResponse, f as GetTakerTierRequest, g as GetTakerTierResponse, C as CurrencyType, h as PaymentMethodCatalog, T as TxOverrides } from './vaultUtils-C2wT1ZYY.mjs';
2
+ export { m as ActionCallback, O as ApiDeposit, a1 as ApiIntentStatus, A as AuthorizationTokenProvider, bt as BatchResult, j as CancelIntentMethodParams, t as CancelIntentParams, o as CreateDepositConversionRate, n as CreateDepositParams, aY as Currency, b3 as CurrencyData, bs as DelegationDepositTarget, bq as DelegationRoute, br as DelegationState, be as Deposit, bg as DepositCurrency, ae as DepositIntentStatistics, Y as DepositStatus, U as DepositVerifier, X as DepositVerifierCurrency, ab as DepositVerifierData, bd as DepositView, K as FiatResponse, F as FulfillIntentMethodParams, r as FulfillIntentParams, _ as GetDepositByIdRequest, $ as GetDepositByIdResponse, a6 as GetIntentByHashRequest, a7 as GetIntentByHashResponse, a4 as GetIntentsByDepositRequest, a5 as GetIntentsByDepositResponse, u as GetNearbyQuote, v as GetNearbySuggestions, a2 as GetOwnerIntentsRequest, a3 as GetOwnerIntentsResponse, w as GetQuoteResponse, x as GetQuoteResponseObject, y as GetQuoteSingleResponse, ak as IndexerClient, aS as IndexerDeploymentEnv, aq as IndexerDeposit, aH as IndexerDepositDailySnapshot, aJ as IndexerDepositFilter, aG as IndexerDepositFundActivity, aI as IndexerDepositFundActivityType, aM as IndexerDepositOrderDirection, aL as IndexerDepositOrderField, aK as IndexerDepositPagination, at as IndexerDepositPaymentMethod, am as IndexerDepositService, aV as IndexerFulfillmentAndPaymentResponse, aT as IndexerFulfillmentRecord, ar as IndexerIntentFulfilled, as as IndexerIntentFulfillmentAmounts, av as IndexerIntentStatus, az as IndexerManagerAggregateStats, aB as IndexerManagerDailySnapshot, aA as IndexerManagerStats, aE as IndexerManualRateUpdate, au as IndexerMethodCurrency, aF as IndexerOracleConfigUpdate, aU as IndexerPaymentVerifiedRecord, aw as IndexerRateManager, ay as IndexerRateManagerDelegation, aP as IndexerRateManagerDelegationPagination, aD as IndexerRateManagerDetail, aN as IndexerRateManagerFilter, aC as IndexerRateManagerListItem, aR as IndexerRateManagerOrderDirection, aQ as IndexerRateManagerOrderField, aO as IndexerRateManagerPagination, ax as IndexerRateManagerRate, an as IndexerRateManagerService, a0 as Intent, bi as IntentView, N as NearbyQuote, M as NearbySuggestions, Z as OfframpClient, aa as OnchainCurrency, bj as OnchainIntent, ad as OrderStats, aW as PAYMENT_PLATFORMS, bf as PaymentMethodData, aX as PaymentPlatformType, ai as PlatformLimit, aj as PlatformRiskLevel, ac as PreparedTransaction, J as QuoteFeesResponse, H as QuoteIntentResponse, Q as QuoteRequest, z as QuoteResponse, B as QuoteResponseObject, E as QuoteSingleResponse, p as Range, bh as ReferralFee, a8 as RegisterPayeeDetailsRequest, a9 as RegisterPayeeDetailsResponse, s as ReleaseFundsToPayerParams, b8 as RuntimeEnv, bv as SendBatchFn, bu as SendTransactionFn, i as SignalIntentMethodParams, q as SignalIntentParams, S as SignalIntentReferralFee, af as TakerTier, ah as TakerTierLevel, ag as TakerTierStats, l as TimeoutConfig, L as TokenResponse, W as WithdrawDepositParams, bk as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, k as Zkp2pClientOptions, bp as classifyDelegationState, ao as compareEventCursorIdsByRecency, aZ as currencyInfo, al as defaultIndexerEndpoint, bb as enrichPvDepositView, bc as enrichPvIntentView, ap as fetchIndexerFulfillmentAndPayment, b4 as getContracts, b0 as getCurrencyCodeFromHash, a$ as getCurrencyInfoFromCountryCode, a_ as getCurrencyInfoFromHash, bo as getDelegationRoute, b7 as getGatingServiceAddress, b6 as getPaymentMethodsCatalog, b5 as getRateManagerContracts, b1 as isSupportedCurrencyHash, bl as isZeroRateManagerId, b2 as mapConversionRatesToOnchainMinRate, bm as normalizeRateManagerId, bn as normalizeRegistry, b9 as parseDepositView, ba as parseIntentView } from './vaultUtils-C2wT1ZYY.mjs';
3
3
  import { Address, Hex, WalletClient, Hash } from 'viem';
4
4
  import { Abi } from 'abitype';
5
5
  import '@zkp2p/indexer-schema';
@@ -22,6 +22,7 @@ interface EscrowDeposit {
22
22
  interface EscrowCurrency {
23
23
  code: string;
24
24
  conversionRate: bigint;
25
+ takerConversionRate?: bigint;
25
26
  }
26
27
  interface EscrowDepositVerifierData {
27
28
  intentGatingService: string;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, V as ValidatePayeeDetailsRequest, a as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, b as PostDepositDetailsResponse, G as GetPayeeDetailsRequest, c as GetPayeeDetailsResponse, d as GetOwnerDepositsRequest, e as GetOwnerDepositsResponse, f as GetTakerTierRequest, g as GetTakerTierResponse, C as CurrencyType, h as PaymentMethodCatalog, T as TxOverrides } from './vaultUtils-DiAumiXp.js';
2
- export { m as ActionCallback, O as ApiDeposit, a1 as ApiIntentStatus, A as AuthorizationTokenProvider, bt as BatchResult, j as CancelIntentMethodParams, t as CancelIntentParams, o as CreateDepositConversionRate, n as CreateDepositParams, aY as Currency, b3 as CurrencyData, bs as DelegationDepositTarget, bq as DelegationRoute, br as DelegationState, be as Deposit, bg as DepositCurrency, ae as DepositIntentStatistics, Y as DepositStatus, U as DepositVerifier, X as DepositVerifierCurrency, ab as DepositVerifierData, bd as DepositView, K as FiatResponse, F as FulfillIntentMethodParams, r as FulfillIntentParams, _ as GetDepositByIdRequest, $ as GetDepositByIdResponse, a6 as GetIntentByHashRequest, a7 as GetIntentByHashResponse, a4 as GetIntentsByDepositRequest, a5 as GetIntentsByDepositResponse, u as GetNearbyQuote, v as GetNearbySuggestions, a2 as GetOwnerIntentsRequest, a3 as GetOwnerIntentsResponse, w as GetQuoteResponse, x as GetQuoteResponseObject, y as GetQuoteSingleResponse, ak as IndexerClient, aS as IndexerDeploymentEnv, aq as IndexerDeposit, aH as IndexerDepositDailySnapshot, aJ as IndexerDepositFilter, aG as IndexerDepositFundActivity, aI as IndexerDepositFundActivityType, aM as IndexerDepositOrderDirection, aL as IndexerDepositOrderField, aK as IndexerDepositPagination, at as IndexerDepositPaymentMethod, am as IndexerDepositService, aV as IndexerFulfillmentAndPaymentResponse, aT as IndexerFulfillmentRecord, ar as IndexerIntentFulfilled, as as IndexerIntentFulfillmentAmounts, av as IndexerIntentStatus, az as IndexerManagerAggregateStats, aB as IndexerManagerDailySnapshot, aA as IndexerManagerStats, aE as IndexerManualRateUpdate, au as IndexerMethodCurrency, aF as IndexerOracleConfigUpdate, aU as IndexerPaymentVerifiedRecord, aw as IndexerRateManager, ay as IndexerRateManagerDelegation, aP as IndexerRateManagerDelegationPagination, aD as IndexerRateManagerDetail, aN as IndexerRateManagerFilter, aC as IndexerRateManagerListItem, aR as IndexerRateManagerOrderDirection, aQ as IndexerRateManagerOrderField, aO as IndexerRateManagerPagination, ax as IndexerRateManagerRate, an as IndexerRateManagerService, a0 as Intent, bi as IntentView, N as NearbyQuote, M as NearbySuggestions, Z as OfframpClient, aa as OnchainCurrency, bj as OnchainIntent, ad as OrderStats, aW as PAYMENT_PLATFORMS, bf as PaymentMethodData, aX as PaymentPlatformType, ai as PlatformLimit, aj as PlatformRiskLevel, ac as PreparedTransaction, J as QuoteFeesResponse, H as QuoteIntentResponse, Q as QuoteRequest, z as QuoteResponse, B as QuoteResponseObject, E as QuoteSingleResponse, p as Range, bh as ReferralFee, a8 as RegisterPayeeDetailsRequest, a9 as RegisterPayeeDetailsResponse, s as ReleaseFundsToPayerParams, b8 as RuntimeEnv, bv as SendBatchFn, bu as SendTransactionFn, i as SignalIntentMethodParams, q as SignalIntentParams, S as SignalIntentReferralFee, af as TakerTier, ah as TakerTierLevel, ag as TakerTierStats, l as TimeoutConfig, L as TokenResponse, W as WithdrawDepositParams, bk as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, k as Zkp2pClientOptions, bp as classifyDelegationState, ao as compareEventCursorIdsByRecency, aZ as currencyInfo, al as defaultIndexerEndpoint, bb as enrichPvDepositView, bc as enrichPvIntentView, ap as fetchIndexerFulfillmentAndPayment, b4 as getContracts, b0 as getCurrencyCodeFromHash, a$ as getCurrencyInfoFromCountryCode, a_ as getCurrencyInfoFromHash, bo as getDelegationRoute, b7 as getGatingServiceAddress, b6 as getPaymentMethodsCatalog, b5 as getRateManagerContracts, b1 as isSupportedCurrencyHash, bl as isZeroRateManagerId, b2 as mapConversionRatesToOnchainMinRate, bm as normalizeRateManagerId, bn as normalizeRegistry, b9 as parseDepositView, ba as parseIntentView } from './vaultUtils-DiAumiXp.js';
1
+ import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, V as ValidatePayeeDetailsRequest, a as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, b as PostDepositDetailsResponse, G as GetPayeeDetailsRequest, c as GetPayeeDetailsResponse, d as GetOwnerDepositsRequest, e as GetOwnerDepositsResponse, f as GetTakerTierRequest, g as GetTakerTierResponse, C as CurrencyType, h as PaymentMethodCatalog, T as TxOverrides } from './vaultUtils-C2wT1ZYY.js';
2
+ export { m as ActionCallback, O as ApiDeposit, a1 as ApiIntentStatus, A as AuthorizationTokenProvider, bt as BatchResult, j as CancelIntentMethodParams, t as CancelIntentParams, o as CreateDepositConversionRate, n as CreateDepositParams, aY as Currency, b3 as CurrencyData, bs as DelegationDepositTarget, bq as DelegationRoute, br as DelegationState, be as Deposit, bg as DepositCurrency, ae as DepositIntentStatistics, Y as DepositStatus, U as DepositVerifier, X as DepositVerifierCurrency, ab as DepositVerifierData, bd as DepositView, K as FiatResponse, F as FulfillIntentMethodParams, r as FulfillIntentParams, _ as GetDepositByIdRequest, $ as GetDepositByIdResponse, a6 as GetIntentByHashRequest, a7 as GetIntentByHashResponse, a4 as GetIntentsByDepositRequest, a5 as GetIntentsByDepositResponse, u as GetNearbyQuote, v as GetNearbySuggestions, a2 as GetOwnerIntentsRequest, a3 as GetOwnerIntentsResponse, w as GetQuoteResponse, x as GetQuoteResponseObject, y as GetQuoteSingleResponse, ak as IndexerClient, aS as IndexerDeploymentEnv, aq as IndexerDeposit, aH as IndexerDepositDailySnapshot, aJ as IndexerDepositFilter, aG as IndexerDepositFundActivity, aI as IndexerDepositFundActivityType, aM as IndexerDepositOrderDirection, aL as IndexerDepositOrderField, aK as IndexerDepositPagination, at as IndexerDepositPaymentMethod, am as IndexerDepositService, aV as IndexerFulfillmentAndPaymentResponse, aT as IndexerFulfillmentRecord, ar as IndexerIntentFulfilled, as as IndexerIntentFulfillmentAmounts, av as IndexerIntentStatus, az as IndexerManagerAggregateStats, aB as IndexerManagerDailySnapshot, aA as IndexerManagerStats, aE as IndexerManualRateUpdate, au as IndexerMethodCurrency, aF as IndexerOracleConfigUpdate, aU as IndexerPaymentVerifiedRecord, aw as IndexerRateManager, ay as IndexerRateManagerDelegation, aP as IndexerRateManagerDelegationPagination, aD as IndexerRateManagerDetail, aN as IndexerRateManagerFilter, aC as IndexerRateManagerListItem, aR as IndexerRateManagerOrderDirection, aQ as IndexerRateManagerOrderField, aO as IndexerRateManagerPagination, ax as IndexerRateManagerRate, an as IndexerRateManagerService, a0 as Intent, bi as IntentView, N as NearbyQuote, M as NearbySuggestions, Z as OfframpClient, aa as OnchainCurrency, bj as OnchainIntent, ad as OrderStats, aW as PAYMENT_PLATFORMS, bf as PaymentMethodData, aX as PaymentPlatformType, ai as PlatformLimit, aj as PlatformRiskLevel, ac as PreparedTransaction, J as QuoteFeesResponse, H as QuoteIntentResponse, Q as QuoteRequest, z as QuoteResponse, B as QuoteResponseObject, E as QuoteSingleResponse, p as Range, bh as ReferralFee, a8 as RegisterPayeeDetailsRequest, a9 as RegisterPayeeDetailsResponse, s as ReleaseFundsToPayerParams, b8 as RuntimeEnv, bv as SendBatchFn, bu as SendTransactionFn, i as SignalIntentMethodParams, q as SignalIntentParams, S as SignalIntentReferralFee, af as TakerTier, ah as TakerTierLevel, ag as TakerTierStats, l as TimeoutConfig, L as TokenResponse, W as WithdrawDepositParams, bk as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, k as Zkp2pClientOptions, bp as classifyDelegationState, ao as compareEventCursorIdsByRecency, aZ as currencyInfo, al as defaultIndexerEndpoint, bb as enrichPvDepositView, bc as enrichPvIntentView, ap as fetchIndexerFulfillmentAndPayment, b4 as getContracts, b0 as getCurrencyCodeFromHash, a$ as getCurrencyInfoFromCountryCode, a_ as getCurrencyInfoFromHash, bo as getDelegationRoute, b7 as getGatingServiceAddress, b6 as getPaymentMethodsCatalog, b5 as getRateManagerContracts, b1 as isSupportedCurrencyHash, bl as isZeroRateManagerId, b2 as mapConversionRatesToOnchainMinRate, bm as normalizeRateManagerId, bn as normalizeRegistry, b9 as parseDepositView, ba as parseIntentView } from './vaultUtils-C2wT1ZYY.js';
3
3
  import { Address, Hex, WalletClient, Hash } from 'viem';
4
4
  import { Abi } from 'abitype';
5
5
  import '@zkp2p/indexer-schema';
@@ -22,6 +22,7 @@ interface EscrowDeposit {
22
22
  interface EscrowCurrency {
23
23
  code: string;
24
24
  conversionRate: bigint;
25
+ takerConversionRate?: bigint;
25
26
  }
26
27
  interface EscrowDepositVerifierData {
27
28
  intentGatingService: string;
package/dist/index.mjs CHANGED
@@ -2361,6 +2361,7 @@ var DEPOSIT_FIELDS = `
2361
2361
  timestamp
2362
2362
  txHash
2363
2363
  updatedAt
2364
+ whitelistHookAddress
2364
2365
  `;
2365
2366
  var LEGACY_DEPOSIT_FIELDS = `
2366
2367
  id
@@ -3351,6 +3352,35 @@ var DEPOSIT_DAILY_SNAPSHOTS_QUERY = (
3351
3352
  }
3352
3353
  `
3353
3354
  );
3355
+ var PROFIT_SNAPSHOTS_BY_DEPOSITS_QUERY = (
3356
+ /* GraphQL */
3357
+ `
3358
+ query GetProfitSnapshotsByDeposits($depositIds: [String!]) {
3359
+ profitSnapshots: MakerProfitSnapshot(
3360
+ where: { depositId: { _in: $depositIds } }
3361
+ order_by: { createdAt: desc }
3362
+ ) {
3363
+ id
3364
+ chainId
3365
+ maker
3366
+ intentId
3367
+ depositId
3368
+ fiatCurrency
3369
+ quoteConversionRate
3370
+ oracleRate
3371
+ spreadBps
3372
+ amount
3373
+ notionalFiatUsdCents
3374
+ feeUsd
3375
+ realizedProfitUsdCents
3376
+ priceSnapshotId
3377
+ status
3378
+ createdAt
3379
+ updatedAt
3380
+ }
3381
+ }
3382
+ `
3383
+ );
3354
3384
  var FULFILLMENT_AND_PAYMENT_QUERY = (
3355
3385
  /* GraphQL */
3356
3386
  `
@@ -3461,7 +3491,7 @@ function convertIndexerDepositToEscrowView(deposit, _chainId, _escrowAddress) {
3461
3491
  }
3462
3492
  function convertDepositsForLiquidity(deposits, chainId, escrowAddress) {
3463
3493
  return deposits.filter(
3464
- (d) => d.depositor && d.depositor.toLowerCase() !== ZERO && d.acceptingIntents && toBigInt(d.remainingDeposits) > 0n && d.status === "ACTIVE"
3494
+ (d) => d.depositor && d.depositor.toLowerCase() !== ZERO && normalizeAddress2(d.whitelistHookAddress).toLowerCase() === ZERO && d.acceptingIntents && toBigInt(d.remainingDeposits) > 0n && d.status === "ACTIVE"
3465
3495
  ).map((d) => convertIndexerDepositToEscrowView(d));
3466
3496
  }
3467
3497
  function convertIndexerIntentsToEscrowViews(intents, depositViewsById) {
@@ -3577,14 +3607,16 @@ var IndexerDepositService = class {
3577
3607
  const where = {};
3578
3608
  if (params.depositIds?.length) where.depositId = { _in: params.depositIds };
3579
3609
  if (params.owner) where.owner = { _ilike: params.owner };
3610
+ if (params.rateManagerId) where.rateManagerId = { _ilike: params.rateManagerId };
3580
3611
  if (params.statuses?.length) where.status = { _in: params.statuses };
3581
3612
  if (!Object.keys(where).length) return [];
3613
+ const orderByField = params.orderByField ?? "signalTimestamp";
3582
3614
  const result = await this.queryWithLegacyFallback({
3583
3615
  query: INTENTS_QUERY,
3584
3616
  legacyQuery: LEGACY_INTENTS_QUERY,
3585
3617
  variables: {
3586
3618
  where,
3587
- order_by: [{ signalTimestamp: "desc" }],
3619
+ order_by: [{ [orderByField]: "desc" }],
3588
3620
  limit: params.limit,
3589
3621
  offset: params.offset
3590
3622
  }
@@ -3647,6 +3679,16 @@ var IndexerDepositService = class {
3647
3679
  if (!owner) return [];
3648
3680
  return this.fetchIntents({ owner, statuses });
3649
3681
  }
3682
+ async fetchIntentsByRateManager(rateManagerId, statuses) {
3683
+ const normalizedRateManagerId = rateManagerId?.trim();
3684
+ if (!normalizedRateManagerId) return [];
3685
+ return this.fetchIntents({
3686
+ rateManagerId: normalizedRateManagerId,
3687
+ statuses,
3688
+ limit: 500,
3689
+ orderByField: "fulfillTimestamp"
3690
+ });
3691
+ }
3650
3692
  async fetchIntentByHash(intentHash) {
3651
3693
  if (!intentHash) return null;
3652
3694
  const result = await this.queryWithLegacyFallback({
@@ -3868,6 +3910,26 @@ var IndexerDepositService = class {
3868
3910
  return [];
3869
3911
  }
3870
3912
  }
3913
+ async fetchProfitSnapshotsByDeposits(depositIds) {
3914
+ const normalizedDepositIds = Array.from(
3915
+ new Set(
3916
+ depositIds.map((depositId) => depositId?.trim()).filter((depositId) => Boolean(depositId))
3917
+ )
3918
+ );
3919
+ if (!normalizedDepositIds.length) return [];
3920
+ try {
3921
+ const result = await this.client.query({
3922
+ query: PROFIT_SNAPSHOTS_BY_DEPOSITS_QUERY,
3923
+ variables: { depositIds: normalizedDepositIds }
3924
+ });
3925
+ return result.profitSnapshots ?? result.MakerProfitSnapshot ?? [];
3926
+ } catch (error) {
3927
+ if (!isSchemaCompatibilityError(error)) {
3928
+ throw error;
3929
+ }
3930
+ return [];
3931
+ }
3932
+ }
3871
3933
  };
3872
3934
 
3873
3935
  // src/indexer/rateManagerService.ts
@@ -6655,6 +6717,12 @@ var Zkp2pClient = class {
6655
6717
  getOwnerIntents: (owner, statuses) => {
6656
6718
  return service.fetchIntentsByOwner(owner, statuses);
6657
6719
  },
6720
+ /**
6721
+ * Fetches fulfilled intents for a vault by rate manager ID.
6722
+ */
6723
+ getIntentsByRateManager: (rateManagerId, statuses) => {
6724
+ return service.fetchIntentsByRateManager(rateManagerId, statuses);
6725
+ },
6658
6726
  /**
6659
6727
  * Fetches a single intent by hash.
6660
6728
  */
@@ -6705,6 +6773,12 @@ var Zkp2pClient = class {
6705
6773
  getDepositsByIdsWithRelations: (ids, options) => {
6706
6774
  return service.fetchDepositsByIdsWithRelations(ids, options);
6707
6775
  },
6776
+ /**
6777
+ * Fetches maker profit snapshots for the provided deposits.
6778
+ */
6779
+ getProfitSnapshotsByDeposits: (depositIds) => {
6780
+ return service.fetchProfitSnapshotsByDeposits(depositIds);
6781
+ },
6708
6782
  /**
6709
6783
  * Fetches rate managers (vaults) with aggregate stats.
6710
6784
  */