@zkp2p/sdk 0.6.2 → 0.7.1

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.
@@ -959,6 +959,8 @@ type TimeoutConfig = {
959
959
  type ApiAdapterOptions = {
960
960
  baseApiUrl: string;
961
961
  timeoutMs?: number;
962
+ /** Optional bearer token for authenticated curator endpoints. */
963
+ authorizationToken?: string;
962
964
  };
963
965
  type AuthorizationTokenProvider = () => string | null | undefined | Promise<string | null | undefined>;
964
966
  /**
@@ -994,6 +996,39 @@ type ReferrerFeeConfig = {
994
996
  recipient: `0x${string}`;
995
997
  feeBps: number;
996
998
  };
999
+ type ReferralDashboardResponse = {
1000
+ code: string;
1001
+ l1FeeBps: number;
1002
+ l2FeeBps: number;
1003
+ l1RefereeCount: number;
1004
+ l2RefereeCount: number;
1005
+ totalFeesWei: string | null;
1006
+ l1FeesWei: string | null;
1007
+ l2FeesWei: string | null;
1008
+ distributionCount: number;
1009
+ lastEarnedAt: string | null;
1010
+ };
1011
+ type ReferralEarningsResponse = {
1012
+ totalWei: string | null;
1013
+ l1Wei: string | null;
1014
+ l2Wei: string | null;
1015
+ unattributedWei: string | null;
1016
+ distributionCount: number;
1017
+ lastEarnedAt: string | null;
1018
+ };
1019
+ type RedeemReferralCodeRequest = {
1020
+ code: string;
1021
+ };
1022
+ type RedeemReferralCodeResponse = {
1023
+ redeemedAt: string;
1024
+ referrerWalletAddress: string;
1025
+ };
1026
+ type UpdateReferralCodeRequest = {
1027
+ code: string;
1028
+ };
1029
+ type UpdateReferralCodeResponse = {
1030
+ code: string;
1031
+ };
997
1032
  type CuratorMetadata = Record<string, any>;
998
1033
  type CuratorPayeeData = {
999
1034
  offchainId: string;
@@ -1139,7 +1174,7 @@ type WiseProfileNotFound = {
1139
1174
  profileId: string;
1140
1175
  profiles: WiseProfileInfo[];
1141
1176
  };
1142
- type GoogleOAuthSellerCredentialPlatform = Extract<SellerPlatform, 'paypal' | 'venmo' | 'zelle'>;
1177
+ type GoogleOAuthSellerCredentialPlatform = Extract<SellerPlatform, 'paypal' | 'venmo'>;
1143
1178
  type PayPalGoogleOAuthSellerCredentialUploadBody = {
1144
1179
  payeeEmail: string;
1145
1180
  authorizationCode: string;
@@ -1150,15 +1185,9 @@ type VenmoGoogleOAuthSellerCredentialUploadBody = {
1150
1185
  authorizationCode: string;
1151
1186
  redirectUri: string;
1152
1187
  };
1153
- type ZelleGoogleOAuthSellerCredentialUploadBody = {
1154
- payeeId: string;
1155
- authorizationCode: string;
1156
- redirectUri: string;
1157
- };
1158
1188
  type GoogleOAuthSellerCredentialUploadBodyByPlatform = {
1159
1189
  paypal: PayPalGoogleOAuthSellerCredentialUploadBody;
1160
1190
  venmo: VenmoGoogleOAuthSellerCredentialUploadBody;
1161
- zelle: ZelleGoogleOAuthSellerCredentialUploadBody;
1162
1191
  };
1163
1192
  type VenmoCredentialUploadInput = {
1164
1193
  payeeId: string;
@@ -1401,11 +1430,7 @@ type UploadVenmoGoogleOAuthSellerCredentialParams = GoogleOAuthSellerCredentialB
1401
1430
  platform: 'venmo';
1402
1431
  accountId: string;
1403
1432
  };
1404
- type UploadZelleGoogleOAuthSellerCredentialParams = GoogleOAuthSellerCredentialBaseParams & {
1405
- platform: 'zelle';
1406
- payeeId: string;
1407
- };
1408
- type UploadGoogleOAuthSellerCredentialParams = UploadPayPalGoogleOAuthSellerCredentialParams | UploadVenmoGoogleOAuthSellerCredentialParams | UploadZelleGoogleOAuthSellerCredentialParams;
1433
+ type UploadGoogleOAuthSellerCredentialParams = UploadPayPalGoogleOAuthSellerCredentialParams | UploadVenmoGoogleOAuthSellerCredentialParams;
1409
1434
  type VerifySellerPaymentParams = {
1410
1435
  platform: SellerPlatform;
1411
1436
  } & SellerVerifyProxyBody;
@@ -1863,8 +1888,10 @@ type PlatformRiskLevel = 'LOW' | 'MEDIUM_HIGH' | 'HIGH' | 'HIGHEST';
1863
1888
  type PlatformLimit = {
1864
1889
  paymentMethodHash: string;
1865
1890
  platformName: string;
1866
- riskLevel: PlatformRiskLevel;
1867
- capMultiplier: number;
1891
+ /** Legacy risk category. Current curator cap-grid responses omit this. */
1892
+ riskLevel?: PlatformRiskLevel;
1893
+ /** Legacy multiplier. Current curator cap-grid responses omit this. */
1894
+ capMultiplier?: number;
1868
1895
  effectiveCap: string;
1869
1896
  effectiveCapDisplay: string;
1870
1897
  hasCooldown: boolean;
@@ -1879,14 +1906,25 @@ type PlatformLimit = {
1879
1906
  */
1880
1907
  reversible?: boolean;
1881
1908
  };
1909
+ type TakerTierVolumeBreakdown = {
1910
+ platformName: string;
1911
+ paymentMethodHash: string;
1912
+ volumeBaseUnits: string;
1913
+ volumeDisplay: string;
1914
+ multiplierBps: number;
1915
+ weightedVolumeBaseUnits: string;
1916
+ weightedVolumeDisplay: string;
1917
+ };
1882
1918
  /** How the curator resolved the taker tier (see curator tier engine). */
1883
1919
  type TakerTierSource = 'computed' | 'fallback' | 'override' | 'blocklist' | 'peer_president';
1884
1920
  type TakerTier = {
1885
1921
  owner: string;
1886
1922
  chainId: number;
1887
1923
  tier: TakerTierLevel;
1888
- perIntentCapBaseUnits: string;
1889
- perIntentCapDisplay: string;
1924
+ /** Legacy base cap. Current curator responses expose enforced caps in platformLimits. */
1925
+ perIntentCapBaseUnits?: string;
1926
+ /** Legacy formatted base cap. */
1927
+ perIntentCapDisplay?: string;
1890
1928
  lastUpdated: string;
1891
1929
  source: TakerTierSource;
1892
1930
  stats: TakerTierStats | null;
@@ -1895,9 +1933,13 @@ type TakerTier = {
1895
1933
  cooldownActive: boolean;
1896
1934
  cooldownRemainingSeconds: number;
1897
1935
  nextIntentAvailableAt: string | null;
1936
+ /**
1937
+ * Server-authoritative platform cap grid. Use this for enforced caps; do not
1938
+ * derive platform caps from top-level tier caps or risk multipliers.
1939
+ */
1898
1940
  platformLimits?: PlatformLimit[];
1899
1941
  /**
1900
- * Server-authoritative tier fields (curator PR #461/#463 contract). All
1942
+ * Server-authoritative tier fields (curator PR #461/#463/#478 contract). All
1901
1943
  * optional because the current production deployment still serves the older
1902
1944
  * payload that omits them — read them when present and fall back gracefully.
1903
1945
  * Amounts are USDC base-unit strings (6 decimals).
@@ -1905,21 +1947,25 @@ type TakerTier = {
1905
1947
  /** Base per-intent cap before platform risk multipliers (alias of perIntentCapBaseUnits). */
1906
1948
  maxOrderSize?: string;
1907
1949
  maxOrderSizeDisplay?: string;
1908
- /** Lifetime Peer-Pay maker volume floor that qualifies the current tier. */
1950
+ /** Peer Pay volume floor that qualifies the current tier. */
1909
1951
  minVolumeForTier?: string;
1910
1952
  minVolumeForTierDisplay?: string;
1911
1953
  /** Next tier up the volume ladder, or null at the top / off-ladder tiers. */
1912
1954
  nextTier?: TakerTierLevel | null;
1913
- /** Remaining Peer-Pay maker volume to reach `nextTier`. */
1955
+ /** Remaining Peer Pay volume to reach `nextTier`. */
1914
1956
  volumeToNextTier?: string | null;
1915
1957
  volumeToNextTierDisplay?: string | null;
1916
1958
  nextTierMaxOrderSize?: string | null;
1917
1959
  nextTierMaxOrderSizeDisplay?: string | null;
1918
1960
  /**
1919
- * Lifetime aggregate Peer-Pay maker volume driving tier qualification. Only
1920
- * present on curator deployments with the PR #461/#463 contract (preprod).
1961
+ * Compatibility name retained by curator. Current semantics preserve
1962
+ * historical maker tiers through July 1, 2026 UTC, then add forward Peer Pay
1963
+ * volume only. Present on deployments with the PR #461/#463 progression
1964
+ * contract.
1921
1965
  */
1922
1966
  peerPayVolume?: string;
1967
+ /** Auditable tier progression inputs. Current curator may return a synthetic Peer Pay row. */
1968
+ volumeBreakdown?: TakerTierVolumeBreakdown[];
1923
1969
  };
1924
1970
  type GetTakerTierRequest = {
1925
1971
  owner: string;
@@ -2011,9 +2057,9 @@ type Zkp2pNextOptions = {
2011
2057
  * Not used by public curator endpoints such as quotes, maker reads, or intent signing.
2012
2058
  */
2013
2059
  apiKey?: string;
2014
- /** Optional bearer token for indexer authentication */
2060
+ /** Optional bearer token for indexer authentication and authenticated curator account APIs */
2015
2061
  authorizationToken?: string;
2016
- /** Optional async token provider for indexer auth in long-lived clients */
2062
+ /** Optional async token provider for indexer auth and authenticated curator account APIs */
2017
2063
  getAuthorizationToken?: IndexerAuthTokenProvider;
2018
2064
  /** Optional API key for indexer proxy authentication (sent as x-api-key header) */
2019
2065
  indexerApiKey?: string;
@@ -2267,8 +2313,10 @@ declare class Zkp2pClient {
2267
2313
  readonly baseApiUrl?: string;
2268
2314
  /** Optional internal curator API key (`x-api-key`) for internal seller verification */
2269
2315
  readonly apiKey?: string;
2270
- /** Bearer token for indexer authentication */
2316
+ /** Bearer token for indexer authentication and authenticated curator account APIs */
2271
2317
  readonly authorizationToken?: string;
2318
+ /** Optional bearer token provider for indexer and authenticated curator account APIs */
2319
+ readonly getAuthorizationToken?: IndexerAuthTokenProvider;
2272
2320
  /** API timeout in milliseconds */
2273
2321
  readonly apiTimeoutMs: number;
2274
2322
  private _usdcAddress?;
@@ -2293,6 +2341,7 @@ declare class Zkp2pClient {
2293
2341
  private parseRawDepositId;
2294
2342
  private stripTrailingSlash;
2295
2343
  private defaultAttestationServiceForBaseApiUrl;
2344
+ private resolveAuthorizationToken;
2296
2345
  private normalizeOracleRateConfig;
2297
2346
  private escrowCurrencyHasOracleConfig;
2298
2347
  /**
@@ -3506,6 +3555,43 @@ declare class Zkp2pClient {
3506
3555
  baseApiUrl?: string;
3507
3556
  timeoutMs?: number;
3508
3557
  }): Promise<GetTakerTierResponse>;
3558
+ /**
3559
+ * Fetch the authenticated user's referral dashboard, including their generated
3560
+ * code, reward rates, referee counts, and lifetime referral fees.
3561
+ */
3562
+ getReferralDashboard(opts?: {
3563
+ baseApiUrl?: string;
3564
+ timeoutMs?: number;
3565
+ authorizationToken?: string;
3566
+ getAuthorizationToken?: IndexerAuthTokenProvider;
3567
+ }): Promise<ReferralDashboardResponse>;
3568
+ /**
3569
+ * Fetch the authenticated user's referral earnings totals.
3570
+ */
3571
+ getReferralEarnings(opts?: {
3572
+ baseApiUrl?: string;
3573
+ timeoutMs?: number;
3574
+ authorizationToken?: string;
3575
+ getAuthorizationToken?: IndexerAuthTokenProvider;
3576
+ }): Promise<ReferralEarningsResponse>;
3577
+ /**
3578
+ * Apply another user's referral code to the authenticated account.
3579
+ */
3580
+ redeemReferralCode(code: string, opts?: {
3581
+ baseApiUrl?: string;
3582
+ timeoutMs?: number;
3583
+ authorizationToken?: string;
3584
+ getAuthorizationToken?: IndexerAuthTokenProvider;
3585
+ }): Promise<RedeemReferralCodeResponse>;
3586
+ /**
3587
+ * Customize the authenticated user's own referral code.
3588
+ */
3589
+ updateReferralCode(code: string, opts?: {
3590
+ baseApiUrl?: string;
3591
+ timeoutMs?: number;
3592
+ authorizationToken?: string;
3593
+ getAuthorizationToken?: IndexerAuthTokenProvider;
3594
+ }): Promise<UpdateReferralCodeResponse>;
3509
3595
  /**
3510
3596
  * The signed `credentialValidatedAt` field is an upload-time freshness witness minted by
3511
3597
  * attestation-service. `credentialExpiresAt` carries an upstream session expiry hint when one
@@ -3723,4 +3809,4 @@ type SendBatchFn = (txs: Array<{
3723
3809
  value?: bigint;
3724
3810
  }>) => Promise<string>;
3725
3811
 
3726
- export { type ReleaseFundsToPayerParams as $, type AttestationServiceIdentityResponse as A, type BuyerTeeVerifyPaymentBody as B, type CuratorSellerCredentialUploadResponse as C, type DepositWithRelations as D, type SignalIntentMethodParams as E, type FulfillIntentMethodParams as F, type GoogleOAuthSellerCredentialPlatform as G, type CancelIntentMethodParams as H, type IntentEntity$1 as I, type Zkp2pNextOptions as J, type AuthorizationTokenProvider as K, type TimeoutConfig as L, type ActionCallback as M, type CreateDepositParams as N, type CreateDepositConversionRate as O, type PostDepositDetailsRequest as P, type QuotesBestByPlatformRequest as Q, type ReferrerFeeConfig as R, type SellerCredentialBundle as S, type TakerTierLevel as T, type UploadSellerCredentialBundleParams as U, type ValidatePayeeDetailsRequest as V, type Range as W, type WithdrawDepositParams as X, type SignalIntentParams as Y, Zkp2pClient as Z, type FulfillIntentParams as _, type IdentityAttestationRequestBody as a, type SellerAttestationOutput as a$, type CancelIntentParams as a0, type BestByPlatformResponseObject as a1, type GetBestByPlatformResponse as a2, type GetBestByPlatformResponseObject as a3, type GetPlatformQuote as a4, type PlatformQuote as a5, type QuoteRequest as a6, type GetNearbyQuote as a7, type GetNearbySuggestions as a8, type GetQuoteResponse as a9, type RegisterPayeeDetailsResponse as aA, type SellerPlatform as aB, type VenmoSessionMaterial as aC, type CashAppSessionMaterial as aD, type WiseSessionMaterial as aE, type WiseProfileInfo as aF, type WiseProfileSelectionRequired as aG, type WiseProfileNotFound as aH, type PayPalGoogleOAuthSellerCredentialUploadBody as aI, type VenmoGoogleOAuthSellerCredentialUploadBody as aJ, type ZelleGoogleOAuthSellerCredentialUploadBody as aK, type VenmoCredentialUploadInput as aL, type CashAppCredentialUploadInput as aM, type WiseCredentialUploadInput as aN, type SellerCredentialUploadInputByPlatform as aO, type SellerCiphertextBundle as aP, type SellerSignedCiphertextBundle as aQ, type SellerVerifyIntentDetails as aR, type SellerVerifyInput as aS, type SellerProbeInput as aT, type SellerCredentialBundleUpload as aU, type SellerCredentialStatusValue as aV, type SellerCredentialStatus as aW, type SellerVerifyProxyBody as aX, type SellerTypedDataField as aY, type SellerTypedDataSpec as aZ, type SellerPaymentTypedDataValue as a_, type GetQuoteResponseObject as aa, type GetQuoteSingleResponse as ab, type QuoteResponse as ac, type QuoteResponseObject as ad, type QuoteSingleResponse as ae, type QuoteIntentResponse as af, type QuoteFeesResponse as ag, type FiatResponse as ah, type TokenResponse as ai, type NearbyQuote as aj, type NearbySuggestions as ak, type ApiDeposit as al, type DepositVerifier as am, type DepositVerifierCurrency as an, type DepositStatus as ao, type GetDepositByIdRequest as ap, type GetDepositByIdResponse as aq, type Intent as ar, type ApiIntentStatus as as, type GetOwnerIntentsRequest as at, type GetOwnerIntentsResponse as au, type GetIntentsByDepositRequest as av, type GetIntentsByDepositResponse as aw, type GetIntentByHashRequest as ax, type GetIntentByHashResponse as ay, type RegisterPayeeDetailsRequest as az, type AttestationServiceSellerVerifyResponse as b, type OrderDirection$1 as b$, type SellerCredentialProbeResponse as b0, type FulfillIntentAttestationResponse as b1, type AttestationServiceSellerCredentialProbeResponse as b2, type BuyerTeePaymentParams as b3, type BuyerTeePaymentProofInput as b4, type BuyerTeeSessionMaterial as b5, type CuratorSellerCredentialStatusResponse as b6, type CuratorSellerVerifyResponse as b7, type RegisteredSellerCredentialPlatform as b8, type UploadSellerCredentialParams as b9, defaultIndexerEndpoint as bA, IndexerDepositService as bB, IndexerRateManagerService as bC, compareEventCursorIdsByRecency as bD, fetchFulfillmentAndPayment as bE, type DepositEntity$1 as bF, type IntentFulfilledEntity as bG, type IntentFulfillmentAmountsEntity as bH, type DepositPaymentMethodEntity$1 as bI, type MethodCurrencyEntity$1 as bJ, type IntentStatus as bK, type RateManagerEntity as bL, type RateManagerRateEntity as bM, type RateManagerDelegationEntity as bN, type ManagerAggregateStatsEntity as bO, type ManagerStatsEntity as bP, type ManagerDailySnapshotEntity as bQ, type RateManagerListItem as bR, type RateManagerDetail as bS, type ManualRateUpdateEntity as bT, type OracleConfigUpdateEntity as bU, type DepositFundActivityEntity$1 as bV, type DepositDailySnapshotEntity$1 as bW, type DepositFundActivityType$1 as bX, type DepositFilter as bY, type PaginationOptions as bZ, type DepositOrderField as b_, type RegisteredUploadSellerCredentialParams as ba, type UploadSellerCredentialOptions as bb, type GetSellerCredentialStatusParams as bc, type UploadPayPalGoogleOAuthSellerCredentialParams as bd, type UploadVenmoGoogleOAuthSellerCredentialParams as be, type UploadZelleGoogleOAuthSellerCredentialParams as bf, type UploadGoogleOAuthSellerCredentialParams as bg, type VerifySellerPaymentParams as bh, type IdentityAttestationActionType as bi, type IdentityAttestationOutput as bj, type IdentityAttestationOutputFor as bk, type IdentityAttestationParams as bl, type MakerIdentityAttestationRequestBody as bm, type MakerIdentityPlatform as bn, type OnchainCurrency as bo, type DepositVerifierData as bp, type PreparedTransaction as bq, type OrderStats as br, type DepositIntentStatistics as bs, type TakerTier as bt, type TakerTierStats as bu, type TakerTierSource as bv, type PlatformLimit as bw, type PlatformRiskLevel as bx, type OrderbookEntry as by, IndexerClient as bz, type SellerCredentialUploadInput as c, type RateManagerFilter as c0, type RateManagerPaginationOptions as c1, type RateManagerDelegationPaginationOptions as c2, type RateManagerOrderField as c3, type OrderDirection as c4, type DeploymentEnv as c5, type FulfillmentRecord as c6, type PaymentVerifiedRecord as c7, type FulfillmentAndPaymentResponse as c8, PAYMENT_PLATFORMS as c9, isZeroRateManagerId as cA, normalizeRateManagerId as cB, normalizeRegistry as cC, getDelegationRoute as cD, classifyDelegationState as cE, type DelegationRoute as cF, type DelegationState as cG, type DelegationDepositTarget as cH, type BatchResult as cI, type SendTransactionFn as cJ, type SendBatchFn as cK, ZERO_ADDRESS as cL, asErrorMessage as cM, assertDelegationMethodSupport as cN, type PaymentPlatformType as ca, Currency as cb, currencyInfo as cc, getCurrencyInfoFromHash as cd, getCurrencyInfoFromCountryCode as ce, getCurrencyCodeFromHash as cf, isSupportedCurrencyHash as cg, mapConversionRatesToOnchainMinRate as ch, type CurrencyData as ci, getContracts as cj, getRateManagerContracts as ck, getPaymentMethodsCatalog as cl, getGatingServiceAddress as cm, type RuntimeEnv as cn, parseDepositView as co, parseIntentView as cp, enrichPvDepositView as cq, enrichPvIntentView as cr, type PV_DepositView as cs, type PV_Deposit as ct, type PV_PaymentMethodData as cu, type PV_Currency as cv, type PV_ReferralFee as cw, type PV_IntentView as cx, type PV_Intent as cy, ZERO_RATE_MANAGER_ID as cz, type SellerCredentialUploadPlatform as d, type SellerCredentialAttestationRuntime as e, type AttestationServiceSellerCredentialUploadResponse as f, type BuyerTeeSessionMaterialEncryptionInput as g, type GoogleOAuthSellerCredentialUploadBodyByPlatform as h, type BestByPlatformResponse as i, type ValidatePayeeDetailsResponse as j, type PostDepositDetailsResponse as k, type GetPayeeDetailsRequest as l, type GetPayeeDetailsResponse as m, type GetOwnerDepositsRequest as n, type GetOwnerDepositsResponse as o, type GetTakerTierRequest as p, type GetTakerTierResponse as q, type GetDepositBundleParams as r, type ApiAdapterOptions as s, type GetDepositBundleResponse as t, type GetOrderbookParams as u, type GetOrderbookResponse as v, type CurrencyType as w, type PaymentMethodCatalog as x, type TxOverrides as y, type SignalIntentReferralFee as z };
3812
+ export { type CreateDepositParams as $, type AttestationServiceIdentityResponse as A, type BuyerTeeVerifyPaymentBody as B, type CuratorSellerCredentialUploadResponse as C, type DepositWithRelations as D, type GetOrderbookParams as E, type GetOrderbookResponse as F, type GoogleOAuthSellerCredentialPlatform as G, type CurrencyType as H, type IntentEntity$1 as I, type PaymentMethodCatalog as J, type TxOverrides as K, type SignalIntentReferralFee as L, type SignalIntentMethodParams as M, type FulfillIntentMethodParams as N, type CancelIntentMethodParams as O, type PostDepositDetailsRequest as P, type QuotesBestByPlatformRequest as Q, type ReferrerFeeConfig as R, type SellerCredentialBundle as S, type TakerTierLevel as T, type UploadSellerCredentialBundleParams as U, type ValidatePayeeDetailsRequest as V, type Zkp2pNextOptions as W, type AuthorizationTokenProvider as X, type TimeoutConfig as Y, Zkp2pClient as Z, type ActionCallback as _, type IdentityAttestationRequestBody as a, type SellerCredentialStatus as a$, type CreateDepositConversionRate as a0, type Range as a1, type WithdrawDepositParams as a2, type SignalIntentParams as a3, type FulfillIntentParams as a4, type ReleaseFundsToPayerParams as a5, type CancelIntentParams as a6, type BestByPlatformResponseObject as a7, type GetBestByPlatformResponse as a8, type GetBestByPlatformResponseObject as a9, type GetOwnerIntentsResponse as aA, type GetIntentsByDepositRequest as aB, type GetIntentsByDepositResponse as aC, type GetIntentByHashRequest as aD, type GetIntentByHashResponse as aE, type RegisterPayeeDetailsRequest as aF, type RegisterPayeeDetailsResponse as aG, type SellerPlatform as aH, type VenmoSessionMaterial as aI, type CashAppSessionMaterial as aJ, type WiseSessionMaterial as aK, type WiseProfileInfo as aL, type WiseProfileSelectionRequired as aM, type WiseProfileNotFound as aN, type PayPalGoogleOAuthSellerCredentialUploadBody as aO, type VenmoGoogleOAuthSellerCredentialUploadBody as aP, type VenmoCredentialUploadInput as aQ, type CashAppCredentialUploadInput as aR, type WiseCredentialUploadInput as aS, type SellerCredentialUploadInputByPlatform as aT, type SellerCiphertextBundle as aU, type SellerSignedCiphertextBundle as aV, type SellerVerifyIntentDetails as aW, type SellerVerifyInput as aX, type SellerProbeInput as aY, type SellerCredentialBundleUpload as aZ, type SellerCredentialStatusValue as a_, type GetPlatformQuote as aa, type PlatformQuote as ab, type QuoteRequest as ac, type GetNearbyQuote as ad, type GetNearbySuggestions as ae, type GetQuoteResponse as af, type GetQuoteResponseObject as ag, type GetQuoteSingleResponse as ah, type QuoteResponse as ai, type QuoteResponseObject as aj, type QuoteSingleResponse as ak, type QuoteIntentResponse as al, type QuoteFeesResponse as am, type FiatResponse as an, type TokenResponse as ao, type NearbyQuote as ap, type NearbySuggestions as aq, type ApiDeposit as ar, type DepositVerifier as as, type DepositVerifierCurrency as at, type DepositStatus as au, type GetDepositByIdRequest as av, type GetDepositByIdResponse as aw, type Intent as ax, type ApiIntentStatus as ay, type GetOwnerIntentsRequest as az, type AttestationServiceSellerVerifyResponse as b, type DepositDailySnapshotEntity$1 as b$, type SellerVerifyProxyBody as b0, type SellerTypedDataField as b1, type SellerTypedDataSpec as b2, type SellerPaymentTypedDataValue as b3, type SellerAttestationOutput as b4, type SellerCredentialProbeResponse as b5, type FulfillIntentAttestationResponse as b6, type AttestationServiceSellerCredentialProbeResponse as b7, type BuyerTeePaymentParams as b8, type BuyerTeePaymentProofInput as b9, type TakerTierSource as bA, type PlatformLimit as bB, type PlatformRiskLevel as bC, type OrderbookEntry as bD, IndexerClient as bE, defaultIndexerEndpoint as bF, IndexerDepositService as bG, IndexerRateManagerService as bH, compareEventCursorIdsByRecency as bI, fetchFulfillmentAndPayment as bJ, type DepositEntity$1 as bK, type IntentFulfilledEntity as bL, type IntentFulfillmentAmountsEntity as bM, type DepositPaymentMethodEntity$1 as bN, type MethodCurrencyEntity$1 as bO, type IntentStatus as bP, type RateManagerEntity as bQ, type RateManagerRateEntity as bR, type RateManagerDelegationEntity as bS, type ManagerAggregateStatsEntity as bT, type ManagerStatsEntity as bU, type ManagerDailySnapshotEntity as bV, type RateManagerListItem as bW, type RateManagerDetail as bX, type ManualRateUpdateEntity as bY, type OracleConfigUpdateEntity as bZ, type DepositFundActivityEntity$1 as b_, type BuyerTeeSessionMaterial as ba, type CuratorSellerCredentialStatusResponse as bb, type CuratorSellerVerifyResponse as bc, type RegisteredSellerCredentialPlatform as bd, type UploadSellerCredentialParams as be, type RegisteredUploadSellerCredentialParams as bf, type UploadSellerCredentialOptions as bg, type GetSellerCredentialStatusParams as bh, type UploadPayPalGoogleOAuthSellerCredentialParams as bi, type UploadVenmoGoogleOAuthSellerCredentialParams as bj, type UploadGoogleOAuthSellerCredentialParams as bk, type VerifySellerPaymentParams as bl, type IdentityAttestationActionType as bm, type IdentityAttestationOutput as bn, type IdentityAttestationOutputFor as bo, type IdentityAttestationParams as bp, type MakerIdentityAttestationRequestBody as bq, type MakerIdentityPlatform as br, type OnchainCurrency as bs, type DepositVerifierData as bt, type PreparedTransaction as bu, type OrderStats as bv, type DepositIntentStatistics as bw, type TakerTier as bx, type TakerTierVolumeBreakdown as by, type TakerTierStats as bz, type SellerCredentialUploadInput as c, type DepositFundActivityType$1 as c0, type DepositFilter as c1, type PaginationOptions as c2, type DepositOrderField as c3, type OrderDirection$1 as c4, type RateManagerFilter as c5, type RateManagerPaginationOptions as c6, type RateManagerDelegationPaginationOptions as c7, type RateManagerOrderField as c8, type OrderDirection as c9, type PV_Currency as cA, type PV_ReferralFee as cB, type PV_IntentView as cC, type PV_Intent as cD, ZERO_RATE_MANAGER_ID as cE, isZeroRateManagerId as cF, normalizeRateManagerId as cG, normalizeRegistry as cH, getDelegationRoute as cI, classifyDelegationState as cJ, type DelegationRoute as cK, type DelegationState as cL, type DelegationDepositTarget as cM, type BatchResult as cN, type SendTransactionFn as cO, type SendBatchFn as cP, ZERO_ADDRESS as cQ, asErrorMessage as cR, assertDelegationMethodSupport as cS, type DeploymentEnv as ca, type FulfillmentRecord as cb, type PaymentVerifiedRecord as cc, type FulfillmentAndPaymentResponse as cd, PAYMENT_PLATFORMS as ce, type PaymentPlatformType as cf, Currency as cg, currencyInfo as ch, getCurrencyInfoFromHash as ci, getCurrencyInfoFromCountryCode as cj, getCurrencyCodeFromHash as ck, isSupportedCurrencyHash as cl, mapConversionRatesToOnchainMinRate as cm, type CurrencyData as cn, getContracts as co, getRateManagerContracts as cp, getPaymentMethodsCatalog as cq, getGatingServiceAddress as cr, type RuntimeEnv as cs, parseDepositView as ct, parseIntentView as cu, enrichPvDepositView as cv, enrichPvIntentView as cw, type PV_DepositView as cx, type PV_Deposit as cy, type PV_PaymentMethodData as cz, type SellerCredentialUploadPlatform as d, type SellerCredentialAttestationRuntime as e, type AttestationServiceSellerCredentialUploadResponse as f, type BuyerTeeSessionMaterialEncryptionInput as g, type ApiAdapterOptions as h, type ReferralDashboardResponse as i, type ReferralEarningsResponse as j, type RedeemReferralCodeRequest as k, type RedeemReferralCodeResponse as l, type UpdateReferralCodeRequest as m, type UpdateReferralCodeResponse as n, type GoogleOAuthSellerCredentialUploadBodyByPlatform as o, type BestByPlatformResponse as p, type ValidatePayeeDetailsResponse as q, type PostDepositDetailsResponse as r, type GetPayeeDetailsRequest as s, type GetPayeeDetailsResponse as t, type GetOwnerDepositsRequest as u, type GetOwnerDepositsResponse as v, type GetTakerTierRequest as w, type GetTakerTierResponse as x, type GetDepositBundleParams as y, type GetDepositBundleResponse as z };
@@ -959,6 +959,8 @@ type TimeoutConfig = {
959
959
  type ApiAdapterOptions = {
960
960
  baseApiUrl: string;
961
961
  timeoutMs?: number;
962
+ /** Optional bearer token for authenticated curator endpoints. */
963
+ authorizationToken?: string;
962
964
  };
963
965
  type AuthorizationTokenProvider = () => string | null | undefined | Promise<string | null | undefined>;
964
966
  /**
@@ -994,6 +996,39 @@ type ReferrerFeeConfig = {
994
996
  recipient: `0x${string}`;
995
997
  feeBps: number;
996
998
  };
999
+ type ReferralDashboardResponse = {
1000
+ code: string;
1001
+ l1FeeBps: number;
1002
+ l2FeeBps: number;
1003
+ l1RefereeCount: number;
1004
+ l2RefereeCount: number;
1005
+ totalFeesWei: string | null;
1006
+ l1FeesWei: string | null;
1007
+ l2FeesWei: string | null;
1008
+ distributionCount: number;
1009
+ lastEarnedAt: string | null;
1010
+ };
1011
+ type ReferralEarningsResponse = {
1012
+ totalWei: string | null;
1013
+ l1Wei: string | null;
1014
+ l2Wei: string | null;
1015
+ unattributedWei: string | null;
1016
+ distributionCount: number;
1017
+ lastEarnedAt: string | null;
1018
+ };
1019
+ type RedeemReferralCodeRequest = {
1020
+ code: string;
1021
+ };
1022
+ type RedeemReferralCodeResponse = {
1023
+ redeemedAt: string;
1024
+ referrerWalletAddress: string;
1025
+ };
1026
+ type UpdateReferralCodeRequest = {
1027
+ code: string;
1028
+ };
1029
+ type UpdateReferralCodeResponse = {
1030
+ code: string;
1031
+ };
997
1032
  type CuratorMetadata = Record<string, any>;
998
1033
  type CuratorPayeeData = {
999
1034
  offchainId: string;
@@ -1139,7 +1174,7 @@ type WiseProfileNotFound = {
1139
1174
  profileId: string;
1140
1175
  profiles: WiseProfileInfo[];
1141
1176
  };
1142
- type GoogleOAuthSellerCredentialPlatform = Extract<SellerPlatform, 'paypal' | 'venmo' | 'zelle'>;
1177
+ type GoogleOAuthSellerCredentialPlatform = Extract<SellerPlatform, 'paypal' | 'venmo'>;
1143
1178
  type PayPalGoogleOAuthSellerCredentialUploadBody = {
1144
1179
  payeeEmail: string;
1145
1180
  authorizationCode: string;
@@ -1150,15 +1185,9 @@ type VenmoGoogleOAuthSellerCredentialUploadBody = {
1150
1185
  authorizationCode: string;
1151
1186
  redirectUri: string;
1152
1187
  };
1153
- type ZelleGoogleOAuthSellerCredentialUploadBody = {
1154
- payeeId: string;
1155
- authorizationCode: string;
1156
- redirectUri: string;
1157
- };
1158
1188
  type GoogleOAuthSellerCredentialUploadBodyByPlatform = {
1159
1189
  paypal: PayPalGoogleOAuthSellerCredentialUploadBody;
1160
1190
  venmo: VenmoGoogleOAuthSellerCredentialUploadBody;
1161
- zelle: ZelleGoogleOAuthSellerCredentialUploadBody;
1162
1191
  };
1163
1192
  type VenmoCredentialUploadInput = {
1164
1193
  payeeId: string;
@@ -1401,11 +1430,7 @@ type UploadVenmoGoogleOAuthSellerCredentialParams = GoogleOAuthSellerCredentialB
1401
1430
  platform: 'venmo';
1402
1431
  accountId: string;
1403
1432
  };
1404
- type UploadZelleGoogleOAuthSellerCredentialParams = GoogleOAuthSellerCredentialBaseParams & {
1405
- platform: 'zelle';
1406
- payeeId: string;
1407
- };
1408
- type UploadGoogleOAuthSellerCredentialParams = UploadPayPalGoogleOAuthSellerCredentialParams | UploadVenmoGoogleOAuthSellerCredentialParams | UploadZelleGoogleOAuthSellerCredentialParams;
1433
+ type UploadGoogleOAuthSellerCredentialParams = UploadPayPalGoogleOAuthSellerCredentialParams | UploadVenmoGoogleOAuthSellerCredentialParams;
1409
1434
  type VerifySellerPaymentParams = {
1410
1435
  platform: SellerPlatform;
1411
1436
  } & SellerVerifyProxyBody;
@@ -1863,8 +1888,10 @@ type PlatformRiskLevel = 'LOW' | 'MEDIUM_HIGH' | 'HIGH' | 'HIGHEST';
1863
1888
  type PlatformLimit = {
1864
1889
  paymentMethodHash: string;
1865
1890
  platformName: string;
1866
- riskLevel: PlatformRiskLevel;
1867
- capMultiplier: number;
1891
+ /** Legacy risk category. Current curator cap-grid responses omit this. */
1892
+ riskLevel?: PlatformRiskLevel;
1893
+ /** Legacy multiplier. Current curator cap-grid responses omit this. */
1894
+ capMultiplier?: number;
1868
1895
  effectiveCap: string;
1869
1896
  effectiveCapDisplay: string;
1870
1897
  hasCooldown: boolean;
@@ -1879,14 +1906,25 @@ type PlatformLimit = {
1879
1906
  */
1880
1907
  reversible?: boolean;
1881
1908
  };
1909
+ type TakerTierVolumeBreakdown = {
1910
+ platformName: string;
1911
+ paymentMethodHash: string;
1912
+ volumeBaseUnits: string;
1913
+ volumeDisplay: string;
1914
+ multiplierBps: number;
1915
+ weightedVolumeBaseUnits: string;
1916
+ weightedVolumeDisplay: string;
1917
+ };
1882
1918
  /** How the curator resolved the taker tier (see curator tier engine). */
1883
1919
  type TakerTierSource = 'computed' | 'fallback' | 'override' | 'blocklist' | 'peer_president';
1884
1920
  type TakerTier = {
1885
1921
  owner: string;
1886
1922
  chainId: number;
1887
1923
  tier: TakerTierLevel;
1888
- perIntentCapBaseUnits: string;
1889
- perIntentCapDisplay: string;
1924
+ /** Legacy base cap. Current curator responses expose enforced caps in platformLimits. */
1925
+ perIntentCapBaseUnits?: string;
1926
+ /** Legacy formatted base cap. */
1927
+ perIntentCapDisplay?: string;
1890
1928
  lastUpdated: string;
1891
1929
  source: TakerTierSource;
1892
1930
  stats: TakerTierStats | null;
@@ -1895,9 +1933,13 @@ type TakerTier = {
1895
1933
  cooldownActive: boolean;
1896
1934
  cooldownRemainingSeconds: number;
1897
1935
  nextIntentAvailableAt: string | null;
1936
+ /**
1937
+ * Server-authoritative platform cap grid. Use this for enforced caps; do not
1938
+ * derive platform caps from top-level tier caps or risk multipliers.
1939
+ */
1898
1940
  platformLimits?: PlatformLimit[];
1899
1941
  /**
1900
- * Server-authoritative tier fields (curator PR #461/#463 contract). All
1942
+ * Server-authoritative tier fields (curator PR #461/#463/#478 contract). All
1901
1943
  * optional because the current production deployment still serves the older
1902
1944
  * payload that omits them — read them when present and fall back gracefully.
1903
1945
  * Amounts are USDC base-unit strings (6 decimals).
@@ -1905,21 +1947,25 @@ type TakerTier = {
1905
1947
  /** Base per-intent cap before platform risk multipliers (alias of perIntentCapBaseUnits). */
1906
1948
  maxOrderSize?: string;
1907
1949
  maxOrderSizeDisplay?: string;
1908
- /** Lifetime Peer-Pay maker volume floor that qualifies the current tier. */
1950
+ /** Peer Pay volume floor that qualifies the current tier. */
1909
1951
  minVolumeForTier?: string;
1910
1952
  minVolumeForTierDisplay?: string;
1911
1953
  /** Next tier up the volume ladder, or null at the top / off-ladder tiers. */
1912
1954
  nextTier?: TakerTierLevel | null;
1913
- /** Remaining Peer-Pay maker volume to reach `nextTier`. */
1955
+ /** Remaining Peer Pay volume to reach `nextTier`. */
1914
1956
  volumeToNextTier?: string | null;
1915
1957
  volumeToNextTierDisplay?: string | null;
1916
1958
  nextTierMaxOrderSize?: string | null;
1917
1959
  nextTierMaxOrderSizeDisplay?: string | null;
1918
1960
  /**
1919
- * Lifetime aggregate Peer-Pay maker volume driving tier qualification. Only
1920
- * present on curator deployments with the PR #461/#463 contract (preprod).
1961
+ * Compatibility name retained by curator. Current semantics preserve
1962
+ * historical maker tiers through July 1, 2026 UTC, then add forward Peer Pay
1963
+ * volume only. Present on deployments with the PR #461/#463 progression
1964
+ * contract.
1921
1965
  */
1922
1966
  peerPayVolume?: string;
1967
+ /** Auditable tier progression inputs. Current curator may return a synthetic Peer Pay row. */
1968
+ volumeBreakdown?: TakerTierVolumeBreakdown[];
1923
1969
  };
1924
1970
  type GetTakerTierRequest = {
1925
1971
  owner: string;
@@ -2011,9 +2057,9 @@ type Zkp2pNextOptions = {
2011
2057
  * Not used by public curator endpoints such as quotes, maker reads, or intent signing.
2012
2058
  */
2013
2059
  apiKey?: string;
2014
- /** Optional bearer token for indexer authentication */
2060
+ /** Optional bearer token for indexer authentication and authenticated curator account APIs */
2015
2061
  authorizationToken?: string;
2016
- /** Optional async token provider for indexer auth in long-lived clients */
2062
+ /** Optional async token provider for indexer auth and authenticated curator account APIs */
2017
2063
  getAuthorizationToken?: IndexerAuthTokenProvider;
2018
2064
  /** Optional API key for indexer proxy authentication (sent as x-api-key header) */
2019
2065
  indexerApiKey?: string;
@@ -2267,8 +2313,10 @@ declare class Zkp2pClient {
2267
2313
  readonly baseApiUrl?: string;
2268
2314
  /** Optional internal curator API key (`x-api-key`) for internal seller verification */
2269
2315
  readonly apiKey?: string;
2270
- /** Bearer token for indexer authentication */
2316
+ /** Bearer token for indexer authentication and authenticated curator account APIs */
2271
2317
  readonly authorizationToken?: string;
2318
+ /** Optional bearer token provider for indexer and authenticated curator account APIs */
2319
+ readonly getAuthorizationToken?: IndexerAuthTokenProvider;
2272
2320
  /** API timeout in milliseconds */
2273
2321
  readonly apiTimeoutMs: number;
2274
2322
  private _usdcAddress?;
@@ -2293,6 +2341,7 @@ declare class Zkp2pClient {
2293
2341
  private parseRawDepositId;
2294
2342
  private stripTrailingSlash;
2295
2343
  private defaultAttestationServiceForBaseApiUrl;
2344
+ private resolveAuthorizationToken;
2296
2345
  private normalizeOracleRateConfig;
2297
2346
  private escrowCurrencyHasOracleConfig;
2298
2347
  /**
@@ -3506,6 +3555,43 @@ declare class Zkp2pClient {
3506
3555
  baseApiUrl?: string;
3507
3556
  timeoutMs?: number;
3508
3557
  }): Promise<GetTakerTierResponse>;
3558
+ /**
3559
+ * Fetch the authenticated user's referral dashboard, including their generated
3560
+ * code, reward rates, referee counts, and lifetime referral fees.
3561
+ */
3562
+ getReferralDashboard(opts?: {
3563
+ baseApiUrl?: string;
3564
+ timeoutMs?: number;
3565
+ authorizationToken?: string;
3566
+ getAuthorizationToken?: IndexerAuthTokenProvider;
3567
+ }): Promise<ReferralDashboardResponse>;
3568
+ /**
3569
+ * Fetch the authenticated user's referral earnings totals.
3570
+ */
3571
+ getReferralEarnings(opts?: {
3572
+ baseApiUrl?: string;
3573
+ timeoutMs?: number;
3574
+ authorizationToken?: string;
3575
+ getAuthorizationToken?: IndexerAuthTokenProvider;
3576
+ }): Promise<ReferralEarningsResponse>;
3577
+ /**
3578
+ * Apply another user's referral code to the authenticated account.
3579
+ */
3580
+ redeemReferralCode(code: string, opts?: {
3581
+ baseApiUrl?: string;
3582
+ timeoutMs?: number;
3583
+ authorizationToken?: string;
3584
+ getAuthorizationToken?: IndexerAuthTokenProvider;
3585
+ }): Promise<RedeemReferralCodeResponse>;
3586
+ /**
3587
+ * Customize the authenticated user's own referral code.
3588
+ */
3589
+ updateReferralCode(code: string, opts?: {
3590
+ baseApiUrl?: string;
3591
+ timeoutMs?: number;
3592
+ authorizationToken?: string;
3593
+ getAuthorizationToken?: IndexerAuthTokenProvider;
3594
+ }): Promise<UpdateReferralCodeResponse>;
3509
3595
  /**
3510
3596
  * The signed `credentialValidatedAt` field is an upload-time freshness witness minted by
3511
3597
  * attestation-service. `credentialExpiresAt` carries an upstream session expiry hint when one
@@ -3723,4 +3809,4 @@ type SendBatchFn = (txs: Array<{
3723
3809
  value?: bigint;
3724
3810
  }>) => Promise<string>;
3725
3811
 
3726
- export { type ReleaseFundsToPayerParams as $, type AttestationServiceIdentityResponse as A, type BuyerTeeVerifyPaymentBody as B, type CuratorSellerCredentialUploadResponse as C, type DepositWithRelations as D, type SignalIntentMethodParams as E, type FulfillIntentMethodParams as F, type GoogleOAuthSellerCredentialPlatform as G, type CancelIntentMethodParams as H, type IntentEntity$1 as I, type Zkp2pNextOptions as J, type AuthorizationTokenProvider as K, type TimeoutConfig as L, type ActionCallback as M, type CreateDepositParams as N, type CreateDepositConversionRate as O, type PostDepositDetailsRequest as P, type QuotesBestByPlatformRequest as Q, type ReferrerFeeConfig as R, type SellerCredentialBundle as S, type TakerTierLevel as T, type UploadSellerCredentialBundleParams as U, type ValidatePayeeDetailsRequest as V, type Range as W, type WithdrawDepositParams as X, type SignalIntentParams as Y, Zkp2pClient as Z, type FulfillIntentParams as _, type IdentityAttestationRequestBody as a, type SellerAttestationOutput as a$, type CancelIntentParams as a0, type BestByPlatformResponseObject as a1, type GetBestByPlatformResponse as a2, type GetBestByPlatformResponseObject as a3, type GetPlatformQuote as a4, type PlatformQuote as a5, type QuoteRequest as a6, type GetNearbyQuote as a7, type GetNearbySuggestions as a8, type GetQuoteResponse as a9, type RegisterPayeeDetailsResponse as aA, type SellerPlatform as aB, type VenmoSessionMaterial as aC, type CashAppSessionMaterial as aD, type WiseSessionMaterial as aE, type WiseProfileInfo as aF, type WiseProfileSelectionRequired as aG, type WiseProfileNotFound as aH, type PayPalGoogleOAuthSellerCredentialUploadBody as aI, type VenmoGoogleOAuthSellerCredentialUploadBody as aJ, type ZelleGoogleOAuthSellerCredentialUploadBody as aK, type VenmoCredentialUploadInput as aL, type CashAppCredentialUploadInput as aM, type WiseCredentialUploadInput as aN, type SellerCredentialUploadInputByPlatform as aO, type SellerCiphertextBundle as aP, type SellerSignedCiphertextBundle as aQ, type SellerVerifyIntentDetails as aR, type SellerVerifyInput as aS, type SellerProbeInput as aT, type SellerCredentialBundleUpload as aU, type SellerCredentialStatusValue as aV, type SellerCredentialStatus as aW, type SellerVerifyProxyBody as aX, type SellerTypedDataField as aY, type SellerTypedDataSpec as aZ, type SellerPaymentTypedDataValue as a_, type GetQuoteResponseObject as aa, type GetQuoteSingleResponse as ab, type QuoteResponse as ac, type QuoteResponseObject as ad, type QuoteSingleResponse as ae, type QuoteIntentResponse as af, type QuoteFeesResponse as ag, type FiatResponse as ah, type TokenResponse as ai, type NearbyQuote as aj, type NearbySuggestions as ak, type ApiDeposit as al, type DepositVerifier as am, type DepositVerifierCurrency as an, type DepositStatus as ao, type GetDepositByIdRequest as ap, type GetDepositByIdResponse as aq, type Intent as ar, type ApiIntentStatus as as, type GetOwnerIntentsRequest as at, type GetOwnerIntentsResponse as au, type GetIntentsByDepositRequest as av, type GetIntentsByDepositResponse as aw, type GetIntentByHashRequest as ax, type GetIntentByHashResponse as ay, type RegisterPayeeDetailsRequest as az, type AttestationServiceSellerVerifyResponse as b, type OrderDirection$1 as b$, type SellerCredentialProbeResponse as b0, type FulfillIntentAttestationResponse as b1, type AttestationServiceSellerCredentialProbeResponse as b2, type BuyerTeePaymentParams as b3, type BuyerTeePaymentProofInput as b4, type BuyerTeeSessionMaterial as b5, type CuratorSellerCredentialStatusResponse as b6, type CuratorSellerVerifyResponse as b7, type RegisteredSellerCredentialPlatform as b8, type UploadSellerCredentialParams as b9, defaultIndexerEndpoint as bA, IndexerDepositService as bB, IndexerRateManagerService as bC, compareEventCursorIdsByRecency as bD, fetchFulfillmentAndPayment as bE, type DepositEntity$1 as bF, type IntentFulfilledEntity as bG, type IntentFulfillmentAmountsEntity as bH, type DepositPaymentMethodEntity$1 as bI, type MethodCurrencyEntity$1 as bJ, type IntentStatus as bK, type RateManagerEntity as bL, type RateManagerRateEntity as bM, type RateManagerDelegationEntity as bN, type ManagerAggregateStatsEntity as bO, type ManagerStatsEntity as bP, type ManagerDailySnapshotEntity as bQ, type RateManagerListItem as bR, type RateManagerDetail as bS, type ManualRateUpdateEntity as bT, type OracleConfigUpdateEntity as bU, type DepositFundActivityEntity$1 as bV, type DepositDailySnapshotEntity$1 as bW, type DepositFundActivityType$1 as bX, type DepositFilter as bY, type PaginationOptions as bZ, type DepositOrderField as b_, type RegisteredUploadSellerCredentialParams as ba, type UploadSellerCredentialOptions as bb, type GetSellerCredentialStatusParams as bc, type UploadPayPalGoogleOAuthSellerCredentialParams as bd, type UploadVenmoGoogleOAuthSellerCredentialParams as be, type UploadZelleGoogleOAuthSellerCredentialParams as bf, type UploadGoogleOAuthSellerCredentialParams as bg, type VerifySellerPaymentParams as bh, type IdentityAttestationActionType as bi, type IdentityAttestationOutput as bj, type IdentityAttestationOutputFor as bk, type IdentityAttestationParams as bl, type MakerIdentityAttestationRequestBody as bm, type MakerIdentityPlatform as bn, type OnchainCurrency as bo, type DepositVerifierData as bp, type PreparedTransaction as bq, type OrderStats as br, type DepositIntentStatistics as bs, type TakerTier as bt, type TakerTierStats as bu, type TakerTierSource as bv, type PlatformLimit as bw, type PlatformRiskLevel as bx, type OrderbookEntry as by, IndexerClient as bz, type SellerCredentialUploadInput as c, type RateManagerFilter as c0, type RateManagerPaginationOptions as c1, type RateManagerDelegationPaginationOptions as c2, type RateManagerOrderField as c3, type OrderDirection as c4, type DeploymentEnv as c5, type FulfillmentRecord as c6, type PaymentVerifiedRecord as c7, type FulfillmentAndPaymentResponse as c8, PAYMENT_PLATFORMS as c9, isZeroRateManagerId as cA, normalizeRateManagerId as cB, normalizeRegistry as cC, getDelegationRoute as cD, classifyDelegationState as cE, type DelegationRoute as cF, type DelegationState as cG, type DelegationDepositTarget as cH, type BatchResult as cI, type SendTransactionFn as cJ, type SendBatchFn as cK, ZERO_ADDRESS as cL, asErrorMessage as cM, assertDelegationMethodSupport as cN, type PaymentPlatformType as ca, Currency as cb, currencyInfo as cc, getCurrencyInfoFromHash as cd, getCurrencyInfoFromCountryCode as ce, getCurrencyCodeFromHash as cf, isSupportedCurrencyHash as cg, mapConversionRatesToOnchainMinRate as ch, type CurrencyData as ci, getContracts as cj, getRateManagerContracts as ck, getPaymentMethodsCatalog as cl, getGatingServiceAddress as cm, type RuntimeEnv as cn, parseDepositView as co, parseIntentView as cp, enrichPvDepositView as cq, enrichPvIntentView as cr, type PV_DepositView as cs, type PV_Deposit as ct, type PV_PaymentMethodData as cu, type PV_Currency as cv, type PV_ReferralFee as cw, type PV_IntentView as cx, type PV_Intent as cy, ZERO_RATE_MANAGER_ID as cz, type SellerCredentialUploadPlatform as d, type SellerCredentialAttestationRuntime as e, type AttestationServiceSellerCredentialUploadResponse as f, type BuyerTeeSessionMaterialEncryptionInput as g, type GoogleOAuthSellerCredentialUploadBodyByPlatform as h, type BestByPlatformResponse as i, type ValidatePayeeDetailsResponse as j, type PostDepositDetailsResponse as k, type GetPayeeDetailsRequest as l, type GetPayeeDetailsResponse as m, type GetOwnerDepositsRequest as n, type GetOwnerDepositsResponse as o, type GetTakerTierRequest as p, type GetTakerTierResponse as q, type GetDepositBundleParams as r, type ApiAdapterOptions as s, type GetDepositBundleResponse as t, type GetOrderbookParams as u, type GetOrderbookResponse as v, type CurrencyType as w, type PaymentMethodCatalog as x, type TxOverrides as y, type SignalIntentReferralFee as z };
3812
+ export { type CreateDepositParams as $, type AttestationServiceIdentityResponse as A, type BuyerTeeVerifyPaymentBody as B, type CuratorSellerCredentialUploadResponse as C, type DepositWithRelations as D, type GetOrderbookParams as E, type GetOrderbookResponse as F, type GoogleOAuthSellerCredentialPlatform as G, type CurrencyType as H, type IntentEntity$1 as I, type PaymentMethodCatalog as J, type TxOverrides as K, type SignalIntentReferralFee as L, type SignalIntentMethodParams as M, type FulfillIntentMethodParams as N, type CancelIntentMethodParams as O, type PostDepositDetailsRequest as P, type QuotesBestByPlatformRequest as Q, type ReferrerFeeConfig as R, type SellerCredentialBundle as S, type TakerTierLevel as T, type UploadSellerCredentialBundleParams as U, type ValidatePayeeDetailsRequest as V, type Zkp2pNextOptions as W, type AuthorizationTokenProvider as X, type TimeoutConfig as Y, Zkp2pClient as Z, type ActionCallback as _, type IdentityAttestationRequestBody as a, type SellerCredentialStatus as a$, type CreateDepositConversionRate as a0, type Range as a1, type WithdrawDepositParams as a2, type SignalIntentParams as a3, type FulfillIntentParams as a4, type ReleaseFundsToPayerParams as a5, type CancelIntentParams as a6, type BestByPlatformResponseObject as a7, type GetBestByPlatformResponse as a8, type GetBestByPlatformResponseObject as a9, type GetOwnerIntentsResponse as aA, type GetIntentsByDepositRequest as aB, type GetIntentsByDepositResponse as aC, type GetIntentByHashRequest as aD, type GetIntentByHashResponse as aE, type RegisterPayeeDetailsRequest as aF, type RegisterPayeeDetailsResponse as aG, type SellerPlatform as aH, type VenmoSessionMaterial as aI, type CashAppSessionMaterial as aJ, type WiseSessionMaterial as aK, type WiseProfileInfo as aL, type WiseProfileSelectionRequired as aM, type WiseProfileNotFound as aN, type PayPalGoogleOAuthSellerCredentialUploadBody as aO, type VenmoGoogleOAuthSellerCredentialUploadBody as aP, type VenmoCredentialUploadInput as aQ, type CashAppCredentialUploadInput as aR, type WiseCredentialUploadInput as aS, type SellerCredentialUploadInputByPlatform as aT, type SellerCiphertextBundle as aU, type SellerSignedCiphertextBundle as aV, type SellerVerifyIntentDetails as aW, type SellerVerifyInput as aX, type SellerProbeInput as aY, type SellerCredentialBundleUpload as aZ, type SellerCredentialStatusValue as a_, type GetPlatformQuote as aa, type PlatformQuote as ab, type QuoteRequest as ac, type GetNearbyQuote as ad, type GetNearbySuggestions as ae, type GetQuoteResponse as af, type GetQuoteResponseObject as ag, type GetQuoteSingleResponse as ah, type QuoteResponse as ai, type QuoteResponseObject as aj, type QuoteSingleResponse as ak, type QuoteIntentResponse as al, type QuoteFeesResponse as am, type FiatResponse as an, type TokenResponse as ao, type NearbyQuote as ap, type NearbySuggestions as aq, type ApiDeposit as ar, type DepositVerifier as as, type DepositVerifierCurrency as at, type DepositStatus as au, type GetDepositByIdRequest as av, type GetDepositByIdResponse as aw, type Intent as ax, type ApiIntentStatus as ay, type GetOwnerIntentsRequest as az, type AttestationServiceSellerVerifyResponse as b, type DepositDailySnapshotEntity$1 as b$, type SellerVerifyProxyBody as b0, type SellerTypedDataField as b1, type SellerTypedDataSpec as b2, type SellerPaymentTypedDataValue as b3, type SellerAttestationOutput as b4, type SellerCredentialProbeResponse as b5, type FulfillIntentAttestationResponse as b6, type AttestationServiceSellerCredentialProbeResponse as b7, type BuyerTeePaymentParams as b8, type BuyerTeePaymentProofInput as b9, type TakerTierSource as bA, type PlatformLimit as bB, type PlatformRiskLevel as bC, type OrderbookEntry as bD, IndexerClient as bE, defaultIndexerEndpoint as bF, IndexerDepositService as bG, IndexerRateManagerService as bH, compareEventCursorIdsByRecency as bI, fetchFulfillmentAndPayment as bJ, type DepositEntity$1 as bK, type IntentFulfilledEntity as bL, type IntentFulfillmentAmountsEntity as bM, type DepositPaymentMethodEntity$1 as bN, type MethodCurrencyEntity$1 as bO, type IntentStatus as bP, type RateManagerEntity as bQ, type RateManagerRateEntity as bR, type RateManagerDelegationEntity as bS, type ManagerAggregateStatsEntity as bT, type ManagerStatsEntity as bU, type ManagerDailySnapshotEntity as bV, type RateManagerListItem as bW, type RateManagerDetail as bX, type ManualRateUpdateEntity as bY, type OracleConfigUpdateEntity as bZ, type DepositFundActivityEntity$1 as b_, type BuyerTeeSessionMaterial as ba, type CuratorSellerCredentialStatusResponse as bb, type CuratorSellerVerifyResponse as bc, type RegisteredSellerCredentialPlatform as bd, type UploadSellerCredentialParams as be, type RegisteredUploadSellerCredentialParams as bf, type UploadSellerCredentialOptions as bg, type GetSellerCredentialStatusParams as bh, type UploadPayPalGoogleOAuthSellerCredentialParams as bi, type UploadVenmoGoogleOAuthSellerCredentialParams as bj, type UploadGoogleOAuthSellerCredentialParams as bk, type VerifySellerPaymentParams as bl, type IdentityAttestationActionType as bm, type IdentityAttestationOutput as bn, type IdentityAttestationOutputFor as bo, type IdentityAttestationParams as bp, type MakerIdentityAttestationRequestBody as bq, type MakerIdentityPlatform as br, type OnchainCurrency as bs, type DepositVerifierData as bt, type PreparedTransaction as bu, type OrderStats as bv, type DepositIntentStatistics as bw, type TakerTier as bx, type TakerTierVolumeBreakdown as by, type TakerTierStats as bz, type SellerCredentialUploadInput as c, type DepositFundActivityType$1 as c0, type DepositFilter as c1, type PaginationOptions as c2, type DepositOrderField as c3, type OrderDirection$1 as c4, type RateManagerFilter as c5, type RateManagerPaginationOptions as c6, type RateManagerDelegationPaginationOptions as c7, type RateManagerOrderField as c8, type OrderDirection as c9, type PV_Currency as cA, type PV_ReferralFee as cB, type PV_IntentView as cC, type PV_Intent as cD, ZERO_RATE_MANAGER_ID as cE, isZeroRateManagerId as cF, normalizeRateManagerId as cG, normalizeRegistry as cH, getDelegationRoute as cI, classifyDelegationState as cJ, type DelegationRoute as cK, type DelegationState as cL, type DelegationDepositTarget as cM, type BatchResult as cN, type SendTransactionFn as cO, type SendBatchFn as cP, ZERO_ADDRESS as cQ, asErrorMessage as cR, assertDelegationMethodSupport as cS, type DeploymentEnv as ca, type FulfillmentRecord as cb, type PaymentVerifiedRecord as cc, type FulfillmentAndPaymentResponse as cd, PAYMENT_PLATFORMS as ce, type PaymentPlatformType as cf, Currency as cg, currencyInfo as ch, getCurrencyInfoFromHash as ci, getCurrencyInfoFromCountryCode as cj, getCurrencyCodeFromHash as ck, isSupportedCurrencyHash as cl, mapConversionRatesToOnchainMinRate as cm, type CurrencyData as cn, getContracts as co, getRateManagerContracts as cp, getPaymentMethodsCatalog as cq, getGatingServiceAddress as cr, type RuntimeEnv as cs, parseDepositView as ct, parseIntentView as cu, enrichPvDepositView as cv, enrichPvIntentView as cw, type PV_DepositView as cx, type PV_Deposit as cy, type PV_PaymentMethodData as cz, type SellerCredentialUploadPlatform as d, type SellerCredentialAttestationRuntime as e, type AttestationServiceSellerCredentialUploadResponse as f, type BuyerTeeSessionMaterialEncryptionInput as g, type ApiAdapterOptions as h, type ReferralDashboardResponse as i, type ReferralEarningsResponse as j, type RedeemReferralCodeRequest as k, type RedeemReferralCodeResponse as l, type UpdateReferralCodeRequest as m, type UpdateReferralCodeResponse as n, type GoogleOAuthSellerCredentialUploadBodyByPlatform as o, type BestByPlatformResponse as p, type ValidatePayeeDetailsResponse as q, type PostDepositDetailsResponse as r, type GetPayeeDetailsRequest as s, type GetPayeeDetailsResponse as t, type GetOwnerDepositsRequest as u, type GetOwnerDepositsResponse as v, type GetTakerTierRequest as w, type GetTakerTierResponse as x, type GetDepositBundleParams as y, type GetDepositBundleResponse as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zkp2p/sdk",
3
- "version": "0.6.2",
3
+ "version": "0.7.1",
4
4
  "description": "ZKP2P Client SDK - TypeScript SDK for deposit management, liquidity provision, and onramping",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.cjs",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/takerTiers.ts","../src/react/hooks/vaultUtils.ts"],"names":[],"mappings":"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","file":"chunk-6WAMIVRB.mjs","sourcesContent":["import type { TakerTierLevel } from './types';\n\n/**\n * Canonical taker tier schedule — the single client-side source of truth for\n * per-intent caps and volume thresholds. Mirrors the curator's authoritative\n * tier engine (curator `src/common/services/tier/tierConstants.ts`), which is\n * what the backend actually enforces.\n *\n * The signal is now **lifetime Peer-Pay-consumed maker volume**, not raw taker\n * fulfilled volume (curator PR #463 removed SAR weighting).\n *\n * A user's *live* tier, cap, and progression always come from the taker-tier\n * API payload (`TakerTier.perIntentCapBaseUnits`, `minVolumeForTier`,\n * `volumeToNextTier`, `peerPayVolume`). Those values are DB-backed and\n * server-authoritative — they vary per environment (e.g. preprod runs\n * different thresholds than these). This static schedule is ONLY a\n * documented-default reference for displays that must show every tier at once\n * (the Fees & Tiers ladder) when no live payload is available; never gate or\n * compute a user's real cap from it.\n *\n * Volume bands track the live (pre-prod) tuned qualification thresholds, which\n * were re-anchored to the real maker distribution — PEER $1k, PLUS $10k,\n * PRO $50k, PLATINUM $100k (the earlier $2.5k/$20k/$75k/$300k placeholders left\n * PLATINUM literally unreachable; the top band sits in the $99k–$167k gap so the\n * same 3 whales qualify, on a round number). Caps ($100/$250/$1k/$2.5k/$5k) are\n * unchanged.\n * Production still runs the old placeholder bands until the tuned config is\n * promoted, so even this reference can disagree with a given environment — read\n * the live per-user values from the API.\n *\n * Ordered highest tier → lowest (PLATINUM first) to match UI display order.\n * PEER_PRESIDENT is invite-only and excluded from the volume ladder.\n */\nexport interface TakerTierScheduleEntry {\n tier: TakerTierLevel;\n /** Per-intent order cap in whole USD (base, before platform risk multipliers). */\n perIntentCapUsd: number;\n /** Inclusive lower bound of lifetime Peer-Pay volume (USD) that qualifies for this tier. */\n minVolumeUsd: number;\n /** Inclusive upper bound of lifetime Peer-Pay volume (USD); `Infinity` for the top tier. */\n maxVolumeUsd: number;\n}\n\nexport const TAKER_TIER_SCHEDULE: readonly TakerTierScheduleEntry[] = [\n { tier: 'PLATINUM', perIntentCapUsd: 5000, minVolumeUsd: 100000, maxVolumeUsd: Infinity },\n { tier: 'PRO', perIntentCapUsd: 2500, minVolumeUsd: 50000, maxVolumeUsd: 99999 },\n { tier: 'PLUS', perIntentCapUsd: 1000, minVolumeUsd: 10000, maxVolumeUsd: 49999 },\n { tier: 'PEER', perIntentCapUsd: 250, minVolumeUsd: 1000, maxVolumeUsd: 9999 },\n { tier: 'PEASANT', perIntentCapUsd: 100, minVolumeUsd: 0, maxVolumeUsd: 999 },\n];\n\n/** Volume-based tier order, lowest → highest, for next-tier progression. */\nexport const TAKER_TIER_ORDER: readonly TakerTierLevel[] = [\n 'PEASANT',\n 'PEER',\n 'PLUS',\n 'PRO',\n 'PLATINUM',\n];\n\n/** Per-intent caps (whole USD) keyed by tier, derived from the schedule. */\nexport const TAKER_TIER_CAPS: Readonly<Record<string, number>> = Object.fromEntries(\n TAKER_TIER_SCHEDULE.map((entry) => [entry.tier, entry.perIntentCapUsd]),\n);\n\n/**\n * Default take-fee discount (in basis points) applied per tier, mirroring\n * curator `TIER_FEE_DISCOUNT_BPS`. The discount is subtracted from the base\n * service fee server-side at quote and sign time — it is NOT returned by the\n * tier endpoint. These are documented defaults for reference fee displays only;\n * the curator DB control-plane can override them, so prefer the fee shown on a\n * live quote when one is available.\n */\nexport const TAKER_TIER_FEE_DISCOUNT_BPS: Readonly<Record<TakerTierLevel, number>> = {\n PEASANT: 0,\n PEER: 5,\n PLUS: 10,\n PRO: 20,\n PLATINUM: 30,\n PEER_PRESIDENT: 30,\n};\n\n/** The default fee-discount (bps) for a tier, or 0 for unknown tiers. */\nexport function getTakerTierFeeDiscountBps(tier: string | undefined): number {\n if (!tier) return 0;\n return TAKER_TIER_FEE_DISCOUNT_BPS[tier as TakerTierLevel] ?? 0;\n}\n\n/** The next tier up from `currentTier`, or `null` at the top / for unknown tiers. */\nexport function getNextTakerTier(currentTier: string | undefined): TakerTierLevel | null {\n if (!currentTier) return null;\n const index = TAKER_TIER_ORDER.indexOf(currentTier as TakerTierLevel);\n if (index === -1 || index >= TAKER_TIER_ORDER.length - 1) return null;\n return TAKER_TIER_ORDER[index + 1];\n}\n","import type { Address, Hex } from 'viem';\nimport type { PreparedTransaction } from '../../types/prepared';\n\n// ---------------------------------------------------------------------------\n// Constants\n// ---------------------------------------------------------------------------\n\nexport const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' as const;\nexport const ZERO_RATE_MANAGER_ID =\n '0x0000000000000000000000000000000000000000000000000000000000000000' as const;\n\n// ---------------------------------------------------------------------------\n// Normalizers\n// ---------------------------------------------------------------------------\n\nexport const normalizeRateManagerId = (value?: string | null): string =>\n (value ?? ZERO_RATE_MANAGER_ID).toLowerCase();\n\nexport const normalizeRegistry = (value?: string | null): string =>\n (value ?? ZERO_ADDRESS).toLowerCase();\n\nexport const isZeroRateManagerId = (value?: string | null): boolean => {\n if (!value) return true;\n const normalized = value.toLowerCase();\n return normalized === ZERO_ADDRESS || normalized === ZERO_RATE_MANAGER_ID;\n};\n\n// ---------------------------------------------------------------------------\n// Error helper\n// ---------------------------------------------------------------------------\n\nexport const asErrorMessage = (error: unknown): string => {\n if (!error) return 'Unknown error';\n if (error instanceof Error) return error.message;\n if (typeof error === 'string') return error;\n\n const anyErr = error as Record<string, unknown>;\n if (typeof anyErr.shortMessage === 'string') return anyErr.shortMessage;\n if (typeof anyErr.details === 'string') return anyErr.details;\n if (typeof anyErr.message === 'string') return anyErr.message;\n\n try {\n return JSON.stringify(error);\n } catch {\n return String(error);\n }\n};\n\n// ---------------------------------------------------------------------------\n// Delegation state classification\n// ---------------------------------------------------------------------------\n\nexport type DelegationState = 'delegated_here' | 'delegated_elsewhere' | 'not_delegated';\n\n/**\n * Classify whether a deposit is delegated to the target vault, delegated\n * elsewhere, or not delegated at all.\n *\n * @param currentRateManagerId The deposit's current rateManagerId (from indexer)\n * @param currentRegistry The deposit's current rateManagerAddress / registry (from indexer)\n * @param targetRateManagerId The vault's rateManagerId we're comparing against\n * @param targetRegistry The vault's registry address we're comparing against\n */\nexport const classifyDelegationState = (\n currentRateManagerId: string | null | undefined,\n currentRegistry: string | null | undefined,\n targetRateManagerId: string,\n targetRegistry: string | null | undefined,\n): DelegationState => {\n if (isZeroRateManagerId(currentRateManagerId)) {\n return 'not_delegated';\n }\n\n const normalizedCurrent = normalizeRateManagerId(currentRateManagerId);\n const normalizedTarget = targetRateManagerId.toLowerCase();\n const normalizedCurrentRegistry = normalizeRegistry(currentRegistry);\n const normalizedTargetRegistry = targetRegistry ? targetRegistry.toLowerCase() : '';\n\n const idsMatch = normalizedCurrent === normalizedTarget;\n const registryMatches = normalizedTargetRegistry\n ? normalizedCurrentRegistry === normalizedTargetRegistry\n : true;\n\n if (idsMatch && registryMatches) {\n return 'delegated_here';\n }\n\n return 'delegated_elsewhere';\n};\n\nexport const assertAtomicDelegationSwitchSupport = (\n requiresSwitch: boolean,\n canBatch: boolean,\n): void => {\n if (!requiresSwitch || canBatch) return;\n throw new Error(\n 'Switching delegation targets requires smart-account batching. Clear the existing delegation first.',\n );\n};\n\n// ---------------------------------------------------------------------------\n// Contract routing\n// ---------------------------------------------------------------------------\n\nexport type DelegationRoute = 'v2';\n\nexport const getDelegationRoute = (_client: unknown, _escrow: Address): DelegationRoute => 'v2';\n\ntype DelegationMethodSupportClient = Partial<\n Record<'setRateManager' | 'clearRateManager', { prepare?: unknown }>\n>;\n\nexport const assertDelegationMethodSupport = (\n client: DelegationMethodSupportClient,\n _route: DelegationRoute,\n action: 'set' | 'clear',\n): void => {\n const method = action === 'set' ? 'setRateManager' : 'clearRateManager';\n if (client?.[method]?.prepare) return;\n throw new Error(`Delegation requires SDK ${method} support`);\n};\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface DelegationDepositTarget {\n compositeDepositId: string;\n escrow: Address;\n depositId: bigint;\n currentRateManagerId?: string | null;\n currentRateManagerRegistry?: string | null;\n}\n\nexport interface BatchResult {\n hashes: string[];\n failed: Array<{ compositeDepositId: string; error: string }>;\n}\n\n/**\n * Callback the consumer provides for sending a single prepared transaction.\n * Returns the transaction hash.\n */\nexport type SendTransactionFn = (tx: { to: Address; data: Hex; value?: bigint }) => Promise<string>;\n\n/**\n * Optional callback for batching multiple calls in a single user operation\n * (e.g. via a smart account). If not provided, transactions are sent\n * sequentially via sendTransaction.\n */\nexport type SendBatchFn = (\n txs: Array<{ to: Address; data: Hex; value?: bigint }>,\n) => Promise<string>;\n\n// ---------------------------------------------------------------------------\n// Prepare helpers (used internally by hooks)\n// ---------------------------------------------------------------------------\n\nexport const prepareClearDelegationTx = async (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n client: any,\n params: { escrow: Address; depositId: bigint },\n referrer?: string | string[],\n): Promise<PreparedTransaction> => {\n const route = getDelegationRoute(client, params.escrow);\n assertDelegationMethodSupport(client, route, 'clear');\n return client.clearRateManager.prepare({\n escrowAddress: params.escrow,\n depositId: params.depositId,\n ...(referrer ? { txOverrides: { referrer } } : {}),\n });\n};\n\nexport const prepareSetDelegationTx = async (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n client: any,\n params: {\n escrow: Address;\n depositId: bigint;\n registry: Address;\n rateManagerId: Hex;\n },\n referrer?: string | string[],\n): Promise<PreparedTransaction> => {\n const route = getDelegationRoute(client, params.escrow);\n assertDelegationMethodSupport(client, route, 'set');\n return client.setRateManager.prepare({\n escrowAddress: params.escrow,\n depositId: params.depositId,\n rateManagerAddress: params.registry,\n rateManagerId: params.rateManagerId,\n ...(referrer ? { txOverrides: { referrer } } : {}),\n });\n};\n"]}