@zkp2p/sdk 0.5.7 → 0.6.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.
package/dist/react.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { Z as Zkp2pClient, P as PostDepositDetailsRequest, y as SignalIntentMethodParams, bn as PreparedTransaction, bq as TakerTier, n as GetTakerTierRequest, o as GetTakerTierResponse, F as FulfillIntentMethodParams, cF as SendTransactionFn, cG as SendBatchFn, cD as DelegationDepositTarget, cE as BatchResult } from './vaultUtils-DOOl9QUP.mjs';
2
- export { cB as DelegationRoute, cC as DelegationState, cH as VAULT_ZERO_ADDRESS, cv as ZERO_RATE_MANAGER_ID, cI as asErrorMessage, cJ as assertDelegationMethodSupport, cA as classifyDelegationState, cz as getDelegationRoute, cw as isZeroRateManagerId, cx as normalizeRateManagerId, cy as normalizeRegistry } from './vaultUtils-DOOl9QUP.mjs';
1
+ import { Z as Zkp2pClient, P as PostDepositDetailsRequest, y as SignalIntentMethodParams, bp as PreparedTransaction, bs as TakerTier, n as GetTakerTierRequest, o as GetTakerTierResponse, F as FulfillIntentMethodParams, cI as SendTransactionFn, cJ as SendBatchFn, cG as DelegationDepositTarget, cH as BatchResult } from './vaultUtils-VAfbA30W.mjs';
2
+ export { cE as DelegationRoute, cF as DelegationState, cK as VAULT_ZERO_ADDRESS, cy as ZERO_RATE_MANAGER_ID, cL as asErrorMessage, cM as assertDelegationMethodSupport, cD as classifyDelegationState, cC as getDelegationRoute, cz as isZeroRateManagerId, cA as normalizeRateManagerId, cB as normalizeRegistry } from './vaultUtils-VAfbA30W.mjs';
3
3
  import { Hash, Address, Hex } from 'viem';
4
4
  import '@zkp2p/indexer-schema';
5
5
  import 'abitype';
package/dist/react.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Z as Zkp2pClient, P as PostDepositDetailsRequest, y as SignalIntentMethodParams, bn as PreparedTransaction, bq as TakerTier, n as GetTakerTierRequest, o as GetTakerTierResponse, F as FulfillIntentMethodParams, cF as SendTransactionFn, cG as SendBatchFn, cD as DelegationDepositTarget, cE as BatchResult } from './vaultUtils-DOOl9QUP.js';
2
- export { cB as DelegationRoute, cC as DelegationState, cH as VAULT_ZERO_ADDRESS, cv as ZERO_RATE_MANAGER_ID, cI as asErrorMessage, cJ as assertDelegationMethodSupport, cA as classifyDelegationState, cz as getDelegationRoute, cw as isZeroRateManagerId, cx as normalizeRateManagerId, cy as normalizeRegistry } from './vaultUtils-DOOl9QUP.js';
1
+ import { Z as Zkp2pClient, P as PostDepositDetailsRequest, y as SignalIntentMethodParams, bp as PreparedTransaction, bs as TakerTier, n as GetTakerTierRequest, o as GetTakerTierResponse, F as FulfillIntentMethodParams, cI as SendTransactionFn, cJ as SendBatchFn, cG as DelegationDepositTarget, cH as BatchResult } from './vaultUtils-VAfbA30W.js';
2
+ export { cE as DelegationRoute, cF as DelegationState, cK as VAULT_ZERO_ADDRESS, cy as ZERO_RATE_MANAGER_ID, cL as asErrorMessage, cM as assertDelegationMethodSupport, cD as classifyDelegationState, cC as getDelegationRoute, cz as isZeroRateManagerId, cA as normalizeRateManagerId, cB as normalizeRegistry } from './vaultUtils-VAfbA30W.js';
3
3
  import { Hash, Address, Hex } from 'viem';
4
4
  import '@zkp2p/indexer-schema';
5
5
  import 'abitype';
package/dist/react.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { getNextTakerTier, TAKER_TIER_CAPS, asErrorMessage, ZERO_ADDRESS, getDelegationRoute, assertDelegationMethodSupport, prepareClearDelegationTx, normalizeRateManagerId, normalizeRegistry, isZeroRateManagerId, assertAtomicDelegationSwitchSupport, prepareSetDelegationTx } from './chunk-TGMRXUP2.mjs';
2
- export { ZERO_ADDRESS as VAULT_ZERO_ADDRESS, ZERO_RATE_MANAGER_ID, asErrorMessage, assertDelegationMethodSupport, classifyDelegationState, getDelegationRoute, isZeroRateManagerId, normalizeRateManagerId, normalizeRegistry } from './chunk-TGMRXUP2.mjs';
1
+ import { getNextTakerTier, TAKER_TIER_CAPS, asErrorMessage, ZERO_ADDRESS, getDelegationRoute, assertDelegationMethodSupport, prepareClearDelegationTx, normalizeRateManagerId, normalizeRegistry, isZeroRateManagerId, assertAtomicDelegationSwitchSupport, prepareSetDelegationTx } from './chunk-6WAMIVRB.mjs';
2
+ export { ZERO_ADDRESS as VAULT_ZERO_ADDRESS, ZERO_RATE_MANAGER_ID, asErrorMessage, assertDelegationMethodSupport, classifyDelegationState, getDelegationRoute, isZeroRateManagerId, normalizeRateManagerId, normalizeRegistry } from './chunk-6WAMIVRB.mjs';
3
3
  import './chunk-J5LGTIGS.mjs';
4
4
  import { useState, useCallback, useMemo, useEffect } from 'react';
5
5
  import { formatUnits } from 'viem';
@@ -1015,6 +1015,11 @@ type FulfillIntentParams = {
1015
1015
  proof: BuyerTeePaymentProofInput;
1016
1016
  /** Optional attestation timestamp buffer override in milliseconds */
1017
1017
  timestampBufferMs?: number | string;
1018
+ /**
1019
+ * Alternate attestation-service origins, tried after network failures only.
1020
+ * Omit for the default Railway proxy; pass [] to disable fallback.
1021
+ */
1022
+ attestationServiceFallbackUrls?: string[];
1018
1023
  /** Override the attestation service base URL */
1019
1024
  attestationServiceUrl?: string;
1020
1025
  /** Optional hook payload passed to orchestrator */
@@ -1101,7 +1106,7 @@ type PostDepositDetailsResponse = {
1101
1106
  */
1102
1107
  type RegisterPayeeDetailsRequest = PostDepositDetailsRequest;
1103
1108
  type RegisterPayeeDetailsResponse = PostDepositDetailsResponse;
1104
- type SellerPlatform = 'venmo' | 'cashapp' | 'wise' | 'paypal';
1109
+ type SellerPlatform = 'venmo' | 'cashapp' | 'wise' | 'paypal' | 'zelle';
1105
1110
  type VenmoSessionMaterial = {
1106
1111
  recipientUsername: string;
1107
1112
  accountId: string;
@@ -1134,7 +1139,7 @@ type WiseProfileNotFound = {
1134
1139
  profileId: string;
1135
1140
  profiles: WiseProfileInfo[];
1136
1141
  };
1137
- type GoogleOAuthSellerCredentialPlatform = Extract<SellerPlatform, 'paypal' | 'venmo'>;
1142
+ type GoogleOAuthSellerCredentialPlatform = Extract<SellerPlatform, 'paypal' | 'venmo' | 'zelle'>;
1138
1143
  type PayPalGoogleOAuthSellerCredentialUploadBody = {
1139
1144
  payeeEmail: string;
1140
1145
  authorizationCode: string;
@@ -1145,9 +1150,15 @@ type VenmoGoogleOAuthSellerCredentialUploadBody = {
1145
1150
  authorizationCode: string;
1146
1151
  redirectUri: string;
1147
1152
  };
1153
+ type ZelleGoogleOAuthSellerCredentialUploadBody = {
1154
+ payeeId: string;
1155
+ authorizationCode: string;
1156
+ redirectUri: string;
1157
+ };
1148
1158
  type GoogleOAuthSellerCredentialUploadBodyByPlatform = {
1149
1159
  paypal: PayPalGoogleOAuthSellerCredentialUploadBody;
1150
1160
  venmo: VenmoGoogleOAuthSellerCredentialUploadBody;
1161
+ zelle: ZelleGoogleOAuthSellerCredentialUploadBody;
1151
1162
  };
1152
1163
  type VenmoCredentialUploadInput = {
1153
1164
  payeeId: string;
@@ -1228,6 +1239,11 @@ type BuyerTeePaymentProofInput = {
1228
1239
  type BuyerTeeSessionMaterial = Record<string, string>;
1229
1240
  type BuyerTeeSessionMaterialEncryptionInput = {
1230
1241
  actionType: string;
1242
+ /**
1243
+ * Alternate attestation-service origins, tried after network failures only.
1244
+ * Omit for the default Railway proxy; pass [] to disable fallback.
1245
+ */
1246
+ attestationServiceFallbackUrls?: string[];
1231
1247
  attestationRuntime?: SellerCredentialAttestationRuntime;
1232
1248
  attestationServiceUrl: string;
1233
1249
  platform: string;
@@ -1353,6 +1369,11 @@ type UploadSellerCredentialBundleParams = {
1353
1369
  }[RegisteredSellerCredentialPlatform];
1354
1370
  type UploadSellerCredentialOptions = {
1355
1371
  baseApiUrl?: string;
1372
+ /**
1373
+ * Alternate attestation-service origins, tried after network failures only.
1374
+ * Omit for the default Railway proxy; pass [] to disable fallback.
1375
+ */
1376
+ attestationServiceFallbackUrls?: string[];
1356
1377
  attestationServiceUrl?: string;
1357
1378
  timeoutMs?: number;
1358
1379
  attestationRuntime?: SellerCredentialAttestationRuntime;
@@ -1374,7 +1395,11 @@ type UploadVenmoGoogleOAuthSellerCredentialParams = GoogleOAuthSellerCredentialB
1374
1395
  platform: 'venmo';
1375
1396
  accountId: string;
1376
1397
  };
1377
- type UploadGoogleOAuthSellerCredentialParams = UploadPayPalGoogleOAuthSellerCredentialParams | UploadVenmoGoogleOAuthSellerCredentialParams;
1398
+ type UploadZelleGoogleOAuthSellerCredentialParams = GoogleOAuthSellerCredentialBaseParams & {
1399
+ platform: 'zelle';
1400
+ payeeId: string;
1401
+ };
1402
+ type UploadGoogleOAuthSellerCredentialParams = UploadPayPalGoogleOAuthSellerCredentialParams | UploadVenmoGoogleOAuthSellerCredentialParams | UploadZelleGoogleOAuthSellerCredentialParams;
1378
1403
  type VerifySellerPaymentParams = {
1379
1404
  platform: SellerPlatform;
1380
1405
  } & SellerVerifyProxyBody;
@@ -1840,7 +1865,16 @@ type PlatformLimit = {
1840
1865
  cooldownHours: number;
1841
1866
  isLocked: boolean;
1842
1867
  minTierRequired: TakerTierLevel | null;
1868
+ /**
1869
+ * Whether the rail is chargeback-reversible. Reversible rails backed by a
1870
+ * seller-automated-release (SAR) credential are takeable only through Peer
1871
+ * Pay, so the intent-sign path rejects them with "peer pay only". Optional:
1872
+ * older curator deployments (current prod) omit this field.
1873
+ */
1874
+ reversible?: boolean;
1843
1875
  };
1876
+ /** How the curator resolved the taker tier (see curator tier engine). */
1877
+ type TakerTierSource = 'computed' | 'fallback' | 'override' | 'blocklist' | 'peer_president';
1844
1878
  type TakerTier = {
1845
1879
  owner: string;
1846
1880
  chainId: number;
@@ -1848,7 +1882,7 @@ type TakerTier = {
1848
1882
  perIntentCapBaseUnits: string;
1849
1883
  perIntentCapDisplay: string;
1850
1884
  lastUpdated: string;
1851
- source: 'computed' | 'fallback';
1885
+ source: TakerTierSource;
1852
1886
  stats: TakerTierStats | null;
1853
1887
  cooldownHours: number;
1854
1888
  cooldownSeconds: number;
@@ -1856,6 +1890,30 @@ type TakerTier = {
1856
1890
  cooldownRemainingSeconds: number;
1857
1891
  nextIntentAvailableAt: string | null;
1858
1892
  platformLimits?: PlatformLimit[];
1893
+ /**
1894
+ * Server-authoritative tier fields (curator PR #461/#463 contract). All
1895
+ * optional because the current production deployment still serves the older
1896
+ * payload that omits them — read them when present and fall back gracefully.
1897
+ * Amounts are USDC base-unit strings (6 decimals).
1898
+ */
1899
+ /** Base per-intent cap before platform risk multipliers (alias of perIntentCapBaseUnits). */
1900
+ maxOrderSize?: string;
1901
+ maxOrderSizeDisplay?: string;
1902
+ /** Lifetime Peer-Pay maker volume floor that qualifies the current tier. */
1903
+ minVolumeForTier?: string;
1904
+ minVolumeForTierDisplay?: string;
1905
+ /** Next tier up the volume ladder, or null at the top / off-ladder tiers. */
1906
+ nextTier?: TakerTierLevel | null;
1907
+ /** Remaining Peer-Pay maker volume to reach `nextTier`. */
1908
+ volumeToNextTier?: string | null;
1909
+ volumeToNextTierDisplay?: string | null;
1910
+ nextTierMaxOrderSize?: string | null;
1911
+ nextTierMaxOrderSizeDisplay?: string | null;
1912
+ /**
1913
+ * Lifetime aggregate Peer-Pay maker volume driving tier qualification. Only
1914
+ * present on curator deployments with the PR #461/#463 contract (preprod).
1915
+ */
1916
+ peerPayVolume?: string;
1859
1917
  };
1860
1918
  type GetTakerTierRequest = {
1861
1919
  owner: string;
@@ -1872,8 +1930,10 @@ type GetDepositBundleResponse = DepositBundleResponse;
1872
1930
  type GetOrderbookParams = {
1873
1931
  currency: string;
1874
1932
  paymentPlatform?: string;
1933
+ publicOnly?: boolean;
1875
1934
  sortBy?: 'price' | 'available' | 'limits';
1876
1935
  sortDirection?: 'asc' | 'desc';
1936
+ sellerAutomatedRelease?: 'include' | 'exclude' | 'only';
1877
1937
  limit?: number;
1878
1938
  chainId?: number;
1879
1939
  token?: string;
@@ -1891,6 +1951,7 @@ type OrderbookEntry = {
1891
1951
  currency: string;
1892
1952
  paymentMethodHash: string;
1893
1953
  payeeDetailsHash: string;
1954
+ sellerAutomatedReleaseAvailable?: boolean;
1894
1955
  escrowAddress: string;
1895
1956
  chainId: number;
1896
1957
  offchainId?: string;
@@ -1903,6 +1964,7 @@ type GetOrderbookResponse = {
1903
1964
  paymentPlatform: string | null;
1904
1965
  sortBy: string;
1905
1966
  sortDirection: string;
1967
+ sellerAutomatedRelease?: 'include' | 'exclude' | 'only';
1906
1968
  internalDetailsIncluded: boolean;
1907
1969
  generatedAt: string;
1908
1970
  entries: OrderbookEntry[];
@@ -2028,6 +2090,11 @@ type FulfillIntentMethodParams = {
2028
2090
  proof: BuyerTeePaymentProofInput;
2029
2091
  /** Allowed timestamp variance in ms (default: 300000ms) */
2030
2092
  timestampBufferMs?: string;
2093
+ /**
2094
+ * Alternate attestation-service origins, tried after network failures only.
2095
+ * Omit for the default Railway proxy; pass [] to disable fallback.
2096
+ */
2097
+ attestationServiceFallbackUrls?: string[];
2031
2098
  /** Override attestation service URL */
2032
2099
  attestationServiceUrl?: string;
2033
2100
  /** Optional orchestrator override */
@@ -3650,4 +3717,4 @@ type SendBatchFn = (txs: Array<{
3650
3717
  value?: bigint;
3651
3718
  }>) => Promise<string>;
3652
3719
 
3653
- export { type BestByPlatformResponseObject as $, type AttestationServiceIdentityResponse as A, type BuyerTeeSessionMaterialEncryptionInput as B, type CuratorSellerCredentialUploadResponse as C, type DepositWithRelations as D, type Zkp2pNextOptions as E, type FulfillIntentMethodParams as F, type GoogleOAuthSellerCredentialPlatform as G, type AuthorizationTokenProvider as H, type IntentEntity$1 as I, type TimeoutConfig as J, type ActionCallback as K, type CreateDepositParams as L, type CreateDepositConversionRate as M, type Range as N, type SignalIntentParams 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 WithdrawDepositParams as W, type FulfillIntentParams as X, type ReleaseFundsToPayerParams as Y, Zkp2pClient as Z, type CancelIntentParams as _, type IdentityAttestationRequestBody as a, type FulfillIntentAttestationResponse as a$, type GetBestByPlatformResponse as a0, type GetBestByPlatformResponseObject as a1, type GetPlatformQuote as a2, type PlatformQuote as a3, type QuoteRequest as a4, type GetNearbyQuote as a5, type GetNearbySuggestions as a6, type GetQuoteResponse as a7, type GetQuoteResponseObject as a8, type GetQuoteSingleResponse as a9, type VenmoSessionMaterial as aA, type CashAppSessionMaterial as aB, type WiseSessionMaterial as aC, type WiseProfileInfo as aD, type WiseProfileSelectionRequired as aE, type WiseProfileNotFound as aF, type PayPalGoogleOAuthSellerCredentialUploadBody as aG, type VenmoGoogleOAuthSellerCredentialUploadBody as aH, type VenmoCredentialUploadInput as aI, type CashAppCredentialUploadInput as aJ, type WiseCredentialUploadInput as aK, type SellerCredentialUploadInputByPlatform as aL, type SellerCiphertextBundle as aM, type SellerSignedCiphertextBundle as aN, type SellerVerifyIntentDetails as aO, type SellerVerifyInput as aP, type SellerProbeInput as aQ, type SellerCredentialBundleUpload as aR, type SellerCredentialStatusValue as aS, type SellerCredentialStatus as aT, type SellerVerifyProxyBody as aU, type SellerTypedDataField as aV, type SellerTypedDataSpec as aW, type SellerPaymentTypedDataValue as aX, type SellerAttestationOutput as aY, type SellerCredentialProbeResponse as aZ, type AttestationServiceSellerVerifyResponse as a_, type QuoteResponse as aa, type QuoteResponseObject as ab, type QuoteSingleResponse as ac, type QuoteIntentResponse as ad, type QuoteFeesResponse as ae, type FiatResponse as af, type TokenResponse as ag, type NearbyQuote as ah, type NearbySuggestions as ai, type ApiDeposit as aj, type DepositVerifier as ak, type DepositVerifierCurrency as al, type DepositStatus as am, type GetDepositByIdRequest as an, type GetDepositByIdResponse as ao, type Intent as ap, type ApiIntentStatus as aq, type GetOwnerIntentsRequest as ar, type GetOwnerIntentsResponse as as, type GetIntentsByDepositRequest as at, type GetIntentsByDepositResponse as au, type GetIntentByHashRequest as av, type GetIntentByHashResponse as aw, type RegisterPayeeDetailsRequest as ax, type RegisterPayeeDetailsResponse as ay, type SellerPlatform as az, type SellerCredentialUploadInput as b, type RateManagerOrderField as b$, type AttestationServiceSellerCredentialProbeResponse as b0, type BuyerTeePaymentParams as b1, type BuyerTeePaymentProofInput as b2, type BuyerTeeSessionMaterial as b3, type CuratorSellerCredentialStatusResponse as b4, type CuratorSellerVerifyResponse as b5, type RegisteredSellerCredentialPlatform as b6, type UploadSellerCredentialParams as b7, type RegisteredUploadSellerCredentialParams as b8, type UploadSellerCredentialOptions as b9, fetchFulfillmentAndPayment as bA, type DepositEntity$1 as bB, type IntentFulfilledEntity as bC, type IntentFulfillmentAmountsEntity as bD, type DepositPaymentMethodEntity$1 as bE, type MethodCurrencyEntity$1 as bF, type IntentStatus as bG, type RateManagerEntity as bH, type RateManagerRateEntity as bI, type RateManagerDelegationEntity as bJ, type ManagerAggregateStatsEntity as bK, type ManagerStatsEntity as bL, type ManagerDailySnapshotEntity as bM, type RateManagerListItem as bN, type RateManagerDetail as bO, type ManualRateUpdateEntity as bP, type OracleConfigUpdateEntity as bQ, type DepositFundActivityEntity$1 as bR, type DepositDailySnapshotEntity$1 as bS, type DepositFundActivityType$1 as bT, type DepositFilter as bU, type PaginationOptions as bV, type DepositOrderField as bW, type OrderDirection$1 as bX, type RateManagerFilter as bY, type RateManagerPaginationOptions as bZ, type RateManagerDelegationPaginationOptions as b_, type GetSellerCredentialStatusParams as ba, type UploadPayPalGoogleOAuthSellerCredentialParams as bb, type UploadVenmoGoogleOAuthSellerCredentialParams as bc, type UploadGoogleOAuthSellerCredentialParams as bd, type VerifySellerPaymentParams as be, type IdentityAttestationActionType as bf, type IdentityAttestationOutput as bg, type IdentityAttestationOutputFor as bh, type IdentityAttestationParams as bi, type MakerIdentityAttestationRequestBody as bj, type MakerIdentityPlatform as bk, type OnchainCurrency as bl, type DepositVerifierData as bm, type PreparedTransaction as bn, type OrderStats as bo, type DepositIntentStatistics as bp, type TakerTier as bq, type TakerTierStats as br, type PlatformLimit as bs, type PlatformRiskLevel as bt, type OrderbookEntry as bu, IndexerClient as bv, defaultIndexerEndpoint as bw, IndexerDepositService as bx, IndexerRateManagerService as by, compareEventCursorIdsByRecency as bz, type SellerCredentialUploadPlatform as c, type OrderDirection as c0, type DeploymentEnv as c1, type FulfillmentRecord as c2, type PaymentVerifiedRecord as c3, type FulfillmentAndPaymentResponse as c4, PAYMENT_PLATFORMS as c5, type PaymentPlatformType as c6, Currency as c7, currencyInfo as c8, getCurrencyInfoFromHash as c9, classifyDelegationState as cA, type DelegationRoute as cB, type DelegationState as cC, type DelegationDepositTarget as cD, type BatchResult as cE, type SendTransactionFn as cF, type SendBatchFn as cG, ZERO_ADDRESS as cH, asErrorMessage as cI, assertDelegationMethodSupport as cJ, getCurrencyInfoFromCountryCode as ca, getCurrencyCodeFromHash as cb, isSupportedCurrencyHash as cc, mapConversionRatesToOnchainMinRate as cd, type CurrencyData as ce, getContracts as cf, getRateManagerContracts as cg, getPaymentMethodsCatalog as ch, getGatingServiceAddress as ci, type RuntimeEnv as cj, parseDepositView as ck, parseIntentView as cl, enrichPvDepositView as cm, enrichPvIntentView as cn, type PV_DepositView as co, type PV_Deposit as cp, type PV_PaymentMethodData as cq, type PV_Currency as cr, type PV_ReferralFee as cs, type PV_IntentView as ct, type PV_Intent as cu, ZERO_RATE_MANAGER_ID as cv, isZeroRateManagerId as cw, normalizeRateManagerId as cx, normalizeRegistry as cy, getDelegationRoute as cz, type SellerCredentialAttestationRuntime as d, type AttestationServiceSellerCredentialUploadResponse as e, type GoogleOAuthSellerCredentialUploadBodyByPlatform as f, type BestByPlatformResponse as g, type ValidatePayeeDetailsResponse as h, type PostDepositDetailsResponse as i, type GetPayeeDetailsRequest as j, type GetPayeeDetailsResponse as k, type GetOwnerDepositsRequest as l, type GetOwnerDepositsResponse as m, type GetTakerTierRequest as n, type GetTakerTierResponse as o, type GetDepositBundleParams as p, type ApiAdapterOptions as q, type GetDepositBundleResponse as r, type GetOrderbookParams as s, type GetOrderbookResponse as t, type CurrencyType as u, type PaymentMethodCatalog as v, type TxOverrides as w, type SignalIntentReferralFee as x, type SignalIntentMethodParams as y, type CancelIntentMethodParams as z };
3720
+ export { type BestByPlatformResponseObject as $, type AttestationServiceIdentityResponse as A, type BuyerTeeSessionMaterialEncryptionInput as B, type CuratorSellerCredentialUploadResponse as C, type DepositWithRelations as D, type Zkp2pNextOptions as E, type FulfillIntentMethodParams as F, type GoogleOAuthSellerCredentialPlatform as G, type AuthorizationTokenProvider as H, type IntentEntity$1 as I, type TimeoutConfig as J, type ActionCallback as K, type CreateDepositParams as L, type CreateDepositConversionRate as M, type Range as N, type SignalIntentParams 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 WithdrawDepositParams as W, type FulfillIntentParams as X, type ReleaseFundsToPayerParams as Y, Zkp2pClient as Z, type CancelIntentParams as _, type IdentityAttestationRequestBody as a, type AttestationServiceSellerVerifyResponse as a$, type GetBestByPlatformResponse as a0, type GetBestByPlatformResponseObject as a1, type GetPlatformQuote as a2, type PlatformQuote as a3, type QuoteRequest as a4, type GetNearbyQuote as a5, type GetNearbySuggestions as a6, type GetQuoteResponse as a7, type GetQuoteResponseObject as a8, type GetQuoteSingleResponse as a9, type VenmoSessionMaterial as aA, type CashAppSessionMaterial as aB, type WiseSessionMaterial as aC, type WiseProfileInfo as aD, type WiseProfileSelectionRequired as aE, type WiseProfileNotFound as aF, type PayPalGoogleOAuthSellerCredentialUploadBody as aG, type VenmoGoogleOAuthSellerCredentialUploadBody as aH, type ZelleGoogleOAuthSellerCredentialUploadBody as aI, type VenmoCredentialUploadInput as aJ, type CashAppCredentialUploadInput as aK, type WiseCredentialUploadInput as aL, type SellerCredentialUploadInputByPlatform as aM, type SellerCiphertextBundle as aN, type SellerSignedCiphertextBundle as aO, type SellerVerifyIntentDetails as aP, type SellerVerifyInput as aQ, type SellerProbeInput as aR, type SellerCredentialBundleUpload as aS, type SellerCredentialStatusValue as aT, type SellerCredentialStatus as aU, type SellerVerifyProxyBody as aV, type SellerTypedDataField as aW, type SellerTypedDataSpec as aX, type SellerPaymentTypedDataValue as aY, type SellerAttestationOutput as aZ, type SellerCredentialProbeResponse as a_, type QuoteResponse as aa, type QuoteResponseObject as ab, type QuoteSingleResponse as ac, type QuoteIntentResponse as ad, type QuoteFeesResponse as ae, type FiatResponse as af, type TokenResponse as ag, type NearbyQuote as ah, type NearbySuggestions as ai, type ApiDeposit as aj, type DepositVerifier as ak, type DepositVerifierCurrency as al, type DepositStatus as am, type GetDepositByIdRequest as an, type GetDepositByIdResponse as ao, type Intent as ap, type ApiIntentStatus as aq, type GetOwnerIntentsRequest as ar, type GetOwnerIntentsResponse as as, type GetIntentsByDepositRequest as at, type GetIntentsByDepositResponse as au, type GetIntentByHashRequest as av, type GetIntentByHashResponse as aw, type RegisterPayeeDetailsRequest as ax, type RegisterPayeeDetailsResponse as ay, type SellerPlatform as az, type SellerCredentialUploadInput as b, type RateManagerFilter as b$, type FulfillIntentAttestationResponse as b0, type AttestationServiceSellerCredentialProbeResponse as b1, type BuyerTeePaymentParams as b2, type BuyerTeePaymentProofInput as b3, type BuyerTeeSessionMaterial as b4, type CuratorSellerCredentialStatusResponse as b5, type CuratorSellerVerifyResponse as b6, type RegisteredSellerCredentialPlatform as b7, type UploadSellerCredentialParams as b8, type RegisteredUploadSellerCredentialParams as b9, IndexerDepositService as bA, IndexerRateManagerService as bB, compareEventCursorIdsByRecency as bC, fetchFulfillmentAndPayment as bD, type DepositEntity$1 as bE, type IntentFulfilledEntity as bF, type IntentFulfillmentAmountsEntity as bG, type DepositPaymentMethodEntity$1 as bH, type MethodCurrencyEntity$1 as bI, type IntentStatus as bJ, type RateManagerEntity as bK, type RateManagerRateEntity as bL, type RateManagerDelegationEntity as bM, type ManagerAggregateStatsEntity as bN, type ManagerStatsEntity as bO, type ManagerDailySnapshotEntity as bP, type RateManagerListItem as bQ, type RateManagerDetail as bR, type ManualRateUpdateEntity as bS, type OracleConfigUpdateEntity as bT, type DepositFundActivityEntity$1 as bU, type DepositDailySnapshotEntity$1 as bV, type DepositFundActivityType$1 as bW, type DepositFilter as bX, type PaginationOptions as bY, type DepositOrderField as bZ, type OrderDirection$1 as b_, type UploadSellerCredentialOptions as ba, type GetSellerCredentialStatusParams as bb, type UploadPayPalGoogleOAuthSellerCredentialParams as bc, type UploadVenmoGoogleOAuthSellerCredentialParams as bd, type UploadZelleGoogleOAuthSellerCredentialParams as be, type UploadGoogleOAuthSellerCredentialParams as bf, type VerifySellerPaymentParams as bg, type IdentityAttestationActionType as bh, type IdentityAttestationOutput as bi, type IdentityAttestationOutputFor as bj, type IdentityAttestationParams as bk, type MakerIdentityAttestationRequestBody as bl, type MakerIdentityPlatform as bm, type OnchainCurrency as bn, type DepositVerifierData as bo, type PreparedTransaction as bp, type OrderStats as bq, type DepositIntentStatistics as br, type TakerTier as bs, type TakerTierStats as bt, type TakerTierSource as bu, type PlatformLimit as bv, type PlatformRiskLevel as bw, type OrderbookEntry as bx, IndexerClient as by, defaultIndexerEndpoint as bz, type SellerCredentialUploadPlatform as c, type RateManagerPaginationOptions as c0, type RateManagerDelegationPaginationOptions as c1, type RateManagerOrderField as c2, type OrderDirection as c3, type DeploymentEnv as c4, type FulfillmentRecord as c5, type PaymentVerifiedRecord as c6, type FulfillmentAndPaymentResponse as c7, PAYMENT_PLATFORMS as c8, type PaymentPlatformType as c9, normalizeRateManagerId as cA, normalizeRegistry as cB, getDelegationRoute as cC, classifyDelegationState as cD, type DelegationRoute as cE, type DelegationState as cF, type DelegationDepositTarget as cG, type BatchResult as cH, type SendTransactionFn as cI, type SendBatchFn as cJ, ZERO_ADDRESS as cK, asErrorMessage as cL, assertDelegationMethodSupport as cM, Currency as ca, currencyInfo as cb, getCurrencyInfoFromHash as cc, getCurrencyInfoFromCountryCode as cd, getCurrencyCodeFromHash as ce, isSupportedCurrencyHash as cf, mapConversionRatesToOnchainMinRate as cg, type CurrencyData as ch, getContracts as ci, getRateManagerContracts as cj, getPaymentMethodsCatalog as ck, getGatingServiceAddress as cl, type RuntimeEnv as cm, parseDepositView as cn, parseIntentView as co, enrichPvDepositView as cp, enrichPvIntentView as cq, type PV_DepositView as cr, type PV_Deposit as cs, type PV_PaymentMethodData as ct, type PV_Currency as cu, type PV_ReferralFee as cv, type PV_IntentView as cw, type PV_Intent as cx, ZERO_RATE_MANAGER_ID as cy, isZeroRateManagerId as cz, type SellerCredentialAttestationRuntime as d, type AttestationServiceSellerCredentialUploadResponse as e, type GoogleOAuthSellerCredentialUploadBodyByPlatform as f, type BestByPlatformResponse as g, type ValidatePayeeDetailsResponse as h, type PostDepositDetailsResponse as i, type GetPayeeDetailsRequest as j, type GetPayeeDetailsResponse as k, type GetOwnerDepositsRequest as l, type GetOwnerDepositsResponse as m, type GetTakerTierRequest as n, type GetTakerTierResponse as o, type GetDepositBundleParams as p, type ApiAdapterOptions as q, type GetDepositBundleResponse as r, type GetOrderbookParams as s, type GetOrderbookResponse as t, type CurrencyType as u, type PaymentMethodCatalog as v, type TxOverrides as w, type SignalIntentReferralFee as x, type SignalIntentMethodParams as y, type CancelIntentMethodParams as z };
@@ -1015,6 +1015,11 @@ type FulfillIntentParams = {
1015
1015
  proof: BuyerTeePaymentProofInput;
1016
1016
  /** Optional attestation timestamp buffer override in milliseconds */
1017
1017
  timestampBufferMs?: number | string;
1018
+ /**
1019
+ * Alternate attestation-service origins, tried after network failures only.
1020
+ * Omit for the default Railway proxy; pass [] to disable fallback.
1021
+ */
1022
+ attestationServiceFallbackUrls?: string[];
1018
1023
  /** Override the attestation service base URL */
1019
1024
  attestationServiceUrl?: string;
1020
1025
  /** Optional hook payload passed to orchestrator */
@@ -1101,7 +1106,7 @@ type PostDepositDetailsResponse = {
1101
1106
  */
1102
1107
  type RegisterPayeeDetailsRequest = PostDepositDetailsRequest;
1103
1108
  type RegisterPayeeDetailsResponse = PostDepositDetailsResponse;
1104
- type SellerPlatform = 'venmo' | 'cashapp' | 'wise' | 'paypal';
1109
+ type SellerPlatform = 'venmo' | 'cashapp' | 'wise' | 'paypal' | 'zelle';
1105
1110
  type VenmoSessionMaterial = {
1106
1111
  recipientUsername: string;
1107
1112
  accountId: string;
@@ -1134,7 +1139,7 @@ type WiseProfileNotFound = {
1134
1139
  profileId: string;
1135
1140
  profiles: WiseProfileInfo[];
1136
1141
  };
1137
- type GoogleOAuthSellerCredentialPlatform = Extract<SellerPlatform, 'paypal' | 'venmo'>;
1142
+ type GoogleOAuthSellerCredentialPlatform = Extract<SellerPlatform, 'paypal' | 'venmo' | 'zelle'>;
1138
1143
  type PayPalGoogleOAuthSellerCredentialUploadBody = {
1139
1144
  payeeEmail: string;
1140
1145
  authorizationCode: string;
@@ -1145,9 +1150,15 @@ type VenmoGoogleOAuthSellerCredentialUploadBody = {
1145
1150
  authorizationCode: string;
1146
1151
  redirectUri: string;
1147
1152
  };
1153
+ type ZelleGoogleOAuthSellerCredentialUploadBody = {
1154
+ payeeId: string;
1155
+ authorizationCode: string;
1156
+ redirectUri: string;
1157
+ };
1148
1158
  type GoogleOAuthSellerCredentialUploadBodyByPlatform = {
1149
1159
  paypal: PayPalGoogleOAuthSellerCredentialUploadBody;
1150
1160
  venmo: VenmoGoogleOAuthSellerCredentialUploadBody;
1161
+ zelle: ZelleGoogleOAuthSellerCredentialUploadBody;
1151
1162
  };
1152
1163
  type VenmoCredentialUploadInput = {
1153
1164
  payeeId: string;
@@ -1228,6 +1239,11 @@ type BuyerTeePaymentProofInput = {
1228
1239
  type BuyerTeeSessionMaterial = Record<string, string>;
1229
1240
  type BuyerTeeSessionMaterialEncryptionInput = {
1230
1241
  actionType: string;
1242
+ /**
1243
+ * Alternate attestation-service origins, tried after network failures only.
1244
+ * Omit for the default Railway proxy; pass [] to disable fallback.
1245
+ */
1246
+ attestationServiceFallbackUrls?: string[];
1231
1247
  attestationRuntime?: SellerCredentialAttestationRuntime;
1232
1248
  attestationServiceUrl: string;
1233
1249
  platform: string;
@@ -1353,6 +1369,11 @@ type UploadSellerCredentialBundleParams = {
1353
1369
  }[RegisteredSellerCredentialPlatform];
1354
1370
  type UploadSellerCredentialOptions = {
1355
1371
  baseApiUrl?: string;
1372
+ /**
1373
+ * Alternate attestation-service origins, tried after network failures only.
1374
+ * Omit for the default Railway proxy; pass [] to disable fallback.
1375
+ */
1376
+ attestationServiceFallbackUrls?: string[];
1356
1377
  attestationServiceUrl?: string;
1357
1378
  timeoutMs?: number;
1358
1379
  attestationRuntime?: SellerCredentialAttestationRuntime;
@@ -1374,7 +1395,11 @@ type UploadVenmoGoogleOAuthSellerCredentialParams = GoogleOAuthSellerCredentialB
1374
1395
  platform: 'venmo';
1375
1396
  accountId: string;
1376
1397
  };
1377
- type UploadGoogleOAuthSellerCredentialParams = UploadPayPalGoogleOAuthSellerCredentialParams | UploadVenmoGoogleOAuthSellerCredentialParams;
1398
+ type UploadZelleGoogleOAuthSellerCredentialParams = GoogleOAuthSellerCredentialBaseParams & {
1399
+ platform: 'zelle';
1400
+ payeeId: string;
1401
+ };
1402
+ type UploadGoogleOAuthSellerCredentialParams = UploadPayPalGoogleOAuthSellerCredentialParams | UploadVenmoGoogleOAuthSellerCredentialParams | UploadZelleGoogleOAuthSellerCredentialParams;
1378
1403
  type VerifySellerPaymentParams = {
1379
1404
  platform: SellerPlatform;
1380
1405
  } & SellerVerifyProxyBody;
@@ -1840,7 +1865,16 @@ type PlatformLimit = {
1840
1865
  cooldownHours: number;
1841
1866
  isLocked: boolean;
1842
1867
  minTierRequired: TakerTierLevel | null;
1868
+ /**
1869
+ * Whether the rail is chargeback-reversible. Reversible rails backed by a
1870
+ * seller-automated-release (SAR) credential are takeable only through Peer
1871
+ * Pay, so the intent-sign path rejects them with "peer pay only". Optional:
1872
+ * older curator deployments (current prod) omit this field.
1873
+ */
1874
+ reversible?: boolean;
1843
1875
  };
1876
+ /** How the curator resolved the taker tier (see curator tier engine). */
1877
+ type TakerTierSource = 'computed' | 'fallback' | 'override' | 'blocklist' | 'peer_president';
1844
1878
  type TakerTier = {
1845
1879
  owner: string;
1846
1880
  chainId: number;
@@ -1848,7 +1882,7 @@ type TakerTier = {
1848
1882
  perIntentCapBaseUnits: string;
1849
1883
  perIntentCapDisplay: string;
1850
1884
  lastUpdated: string;
1851
- source: 'computed' | 'fallback';
1885
+ source: TakerTierSource;
1852
1886
  stats: TakerTierStats | null;
1853
1887
  cooldownHours: number;
1854
1888
  cooldownSeconds: number;
@@ -1856,6 +1890,30 @@ type TakerTier = {
1856
1890
  cooldownRemainingSeconds: number;
1857
1891
  nextIntentAvailableAt: string | null;
1858
1892
  platformLimits?: PlatformLimit[];
1893
+ /**
1894
+ * Server-authoritative tier fields (curator PR #461/#463 contract). All
1895
+ * optional because the current production deployment still serves the older
1896
+ * payload that omits them — read them when present and fall back gracefully.
1897
+ * Amounts are USDC base-unit strings (6 decimals).
1898
+ */
1899
+ /** Base per-intent cap before platform risk multipliers (alias of perIntentCapBaseUnits). */
1900
+ maxOrderSize?: string;
1901
+ maxOrderSizeDisplay?: string;
1902
+ /** Lifetime Peer-Pay maker volume floor that qualifies the current tier. */
1903
+ minVolumeForTier?: string;
1904
+ minVolumeForTierDisplay?: string;
1905
+ /** Next tier up the volume ladder, or null at the top / off-ladder tiers. */
1906
+ nextTier?: TakerTierLevel | null;
1907
+ /** Remaining Peer-Pay maker volume to reach `nextTier`. */
1908
+ volumeToNextTier?: string | null;
1909
+ volumeToNextTierDisplay?: string | null;
1910
+ nextTierMaxOrderSize?: string | null;
1911
+ nextTierMaxOrderSizeDisplay?: string | null;
1912
+ /**
1913
+ * Lifetime aggregate Peer-Pay maker volume driving tier qualification. Only
1914
+ * present on curator deployments with the PR #461/#463 contract (preprod).
1915
+ */
1916
+ peerPayVolume?: string;
1859
1917
  };
1860
1918
  type GetTakerTierRequest = {
1861
1919
  owner: string;
@@ -1872,8 +1930,10 @@ type GetDepositBundleResponse = DepositBundleResponse;
1872
1930
  type GetOrderbookParams = {
1873
1931
  currency: string;
1874
1932
  paymentPlatform?: string;
1933
+ publicOnly?: boolean;
1875
1934
  sortBy?: 'price' | 'available' | 'limits';
1876
1935
  sortDirection?: 'asc' | 'desc';
1936
+ sellerAutomatedRelease?: 'include' | 'exclude' | 'only';
1877
1937
  limit?: number;
1878
1938
  chainId?: number;
1879
1939
  token?: string;
@@ -1891,6 +1951,7 @@ type OrderbookEntry = {
1891
1951
  currency: string;
1892
1952
  paymentMethodHash: string;
1893
1953
  payeeDetailsHash: string;
1954
+ sellerAutomatedReleaseAvailable?: boolean;
1894
1955
  escrowAddress: string;
1895
1956
  chainId: number;
1896
1957
  offchainId?: string;
@@ -1903,6 +1964,7 @@ type GetOrderbookResponse = {
1903
1964
  paymentPlatform: string | null;
1904
1965
  sortBy: string;
1905
1966
  sortDirection: string;
1967
+ sellerAutomatedRelease?: 'include' | 'exclude' | 'only';
1906
1968
  internalDetailsIncluded: boolean;
1907
1969
  generatedAt: string;
1908
1970
  entries: OrderbookEntry[];
@@ -2028,6 +2090,11 @@ type FulfillIntentMethodParams = {
2028
2090
  proof: BuyerTeePaymentProofInput;
2029
2091
  /** Allowed timestamp variance in ms (default: 300000ms) */
2030
2092
  timestampBufferMs?: string;
2093
+ /**
2094
+ * Alternate attestation-service origins, tried after network failures only.
2095
+ * Omit for the default Railway proxy; pass [] to disable fallback.
2096
+ */
2097
+ attestationServiceFallbackUrls?: string[];
2031
2098
  /** Override attestation service URL */
2032
2099
  attestationServiceUrl?: string;
2033
2100
  /** Optional orchestrator override */
@@ -3650,4 +3717,4 @@ type SendBatchFn = (txs: Array<{
3650
3717
  value?: bigint;
3651
3718
  }>) => Promise<string>;
3652
3719
 
3653
- export { type BestByPlatformResponseObject as $, type AttestationServiceIdentityResponse as A, type BuyerTeeSessionMaterialEncryptionInput as B, type CuratorSellerCredentialUploadResponse as C, type DepositWithRelations as D, type Zkp2pNextOptions as E, type FulfillIntentMethodParams as F, type GoogleOAuthSellerCredentialPlatform as G, type AuthorizationTokenProvider as H, type IntentEntity$1 as I, type TimeoutConfig as J, type ActionCallback as K, type CreateDepositParams as L, type CreateDepositConversionRate as M, type Range as N, type SignalIntentParams 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 WithdrawDepositParams as W, type FulfillIntentParams as X, type ReleaseFundsToPayerParams as Y, Zkp2pClient as Z, type CancelIntentParams as _, type IdentityAttestationRequestBody as a, type FulfillIntentAttestationResponse as a$, type GetBestByPlatformResponse as a0, type GetBestByPlatformResponseObject as a1, type GetPlatformQuote as a2, type PlatformQuote as a3, type QuoteRequest as a4, type GetNearbyQuote as a5, type GetNearbySuggestions as a6, type GetQuoteResponse as a7, type GetQuoteResponseObject as a8, type GetQuoteSingleResponse as a9, type VenmoSessionMaterial as aA, type CashAppSessionMaterial as aB, type WiseSessionMaterial as aC, type WiseProfileInfo as aD, type WiseProfileSelectionRequired as aE, type WiseProfileNotFound as aF, type PayPalGoogleOAuthSellerCredentialUploadBody as aG, type VenmoGoogleOAuthSellerCredentialUploadBody as aH, type VenmoCredentialUploadInput as aI, type CashAppCredentialUploadInput as aJ, type WiseCredentialUploadInput as aK, type SellerCredentialUploadInputByPlatform as aL, type SellerCiphertextBundle as aM, type SellerSignedCiphertextBundle as aN, type SellerVerifyIntentDetails as aO, type SellerVerifyInput as aP, type SellerProbeInput as aQ, type SellerCredentialBundleUpload as aR, type SellerCredentialStatusValue as aS, type SellerCredentialStatus as aT, type SellerVerifyProxyBody as aU, type SellerTypedDataField as aV, type SellerTypedDataSpec as aW, type SellerPaymentTypedDataValue as aX, type SellerAttestationOutput as aY, type SellerCredentialProbeResponse as aZ, type AttestationServiceSellerVerifyResponse as a_, type QuoteResponse as aa, type QuoteResponseObject as ab, type QuoteSingleResponse as ac, type QuoteIntentResponse as ad, type QuoteFeesResponse as ae, type FiatResponse as af, type TokenResponse as ag, type NearbyQuote as ah, type NearbySuggestions as ai, type ApiDeposit as aj, type DepositVerifier as ak, type DepositVerifierCurrency as al, type DepositStatus as am, type GetDepositByIdRequest as an, type GetDepositByIdResponse as ao, type Intent as ap, type ApiIntentStatus as aq, type GetOwnerIntentsRequest as ar, type GetOwnerIntentsResponse as as, type GetIntentsByDepositRequest as at, type GetIntentsByDepositResponse as au, type GetIntentByHashRequest as av, type GetIntentByHashResponse as aw, type RegisterPayeeDetailsRequest as ax, type RegisterPayeeDetailsResponse as ay, type SellerPlatform as az, type SellerCredentialUploadInput as b, type RateManagerOrderField as b$, type AttestationServiceSellerCredentialProbeResponse as b0, type BuyerTeePaymentParams as b1, type BuyerTeePaymentProofInput as b2, type BuyerTeeSessionMaterial as b3, type CuratorSellerCredentialStatusResponse as b4, type CuratorSellerVerifyResponse as b5, type RegisteredSellerCredentialPlatform as b6, type UploadSellerCredentialParams as b7, type RegisteredUploadSellerCredentialParams as b8, type UploadSellerCredentialOptions as b9, fetchFulfillmentAndPayment as bA, type DepositEntity$1 as bB, type IntentFulfilledEntity as bC, type IntentFulfillmentAmountsEntity as bD, type DepositPaymentMethodEntity$1 as bE, type MethodCurrencyEntity$1 as bF, type IntentStatus as bG, type RateManagerEntity as bH, type RateManagerRateEntity as bI, type RateManagerDelegationEntity as bJ, type ManagerAggregateStatsEntity as bK, type ManagerStatsEntity as bL, type ManagerDailySnapshotEntity as bM, type RateManagerListItem as bN, type RateManagerDetail as bO, type ManualRateUpdateEntity as bP, type OracleConfigUpdateEntity as bQ, type DepositFundActivityEntity$1 as bR, type DepositDailySnapshotEntity$1 as bS, type DepositFundActivityType$1 as bT, type DepositFilter as bU, type PaginationOptions as bV, type DepositOrderField as bW, type OrderDirection$1 as bX, type RateManagerFilter as bY, type RateManagerPaginationOptions as bZ, type RateManagerDelegationPaginationOptions as b_, type GetSellerCredentialStatusParams as ba, type UploadPayPalGoogleOAuthSellerCredentialParams as bb, type UploadVenmoGoogleOAuthSellerCredentialParams as bc, type UploadGoogleOAuthSellerCredentialParams as bd, type VerifySellerPaymentParams as be, type IdentityAttestationActionType as bf, type IdentityAttestationOutput as bg, type IdentityAttestationOutputFor as bh, type IdentityAttestationParams as bi, type MakerIdentityAttestationRequestBody as bj, type MakerIdentityPlatform as bk, type OnchainCurrency as bl, type DepositVerifierData as bm, type PreparedTransaction as bn, type OrderStats as bo, type DepositIntentStatistics as bp, type TakerTier as bq, type TakerTierStats as br, type PlatformLimit as bs, type PlatformRiskLevel as bt, type OrderbookEntry as bu, IndexerClient as bv, defaultIndexerEndpoint as bw, IndexerDepositService as bx, IndexerRateManagerService as by, compareEventCursorIdsByRecency as bz, type SellerCredentialUploadPlatform as c, type OrderDirection as c0, type DeploymentEnv as c1, type FulfillmentRecord as c2, type PaymentVerifiedRecord as c3, type FulfillmentAndPaymentResponse as c4, PAYMENT_PLATFORMS as c5, type PaymentPlatformType as c6, Currency as c7, currencyInfo as c8, getCurrencyInfoFromHash as c9, classifyDelegationState as cA, type DelegationRoute as cB, type DelegationState as cC, type DelegationDepositTarget as cD, type BatchResult as cE, type SendTransactionFn as cF, type SendBatchFn as cG, ZERO_ADDRESS as cH, asErrorMessage as cI, assertDelegationMethodSupport as cJ, getCurrencyInfoFromCountryCode as ca, getCurrencyCodeFromHash as cb, isSupportedCurrencyHash as cc, mapConversionRatesToOnchainMinRate as cd, type CurrencyData as ce, getContracts as cf, getRateManagerContracts as cg, getPaymentMethodsCatalog as ch, getGatingServiceAddress as ci, type RuntimeEnv as cj, parseDepositView as ck, parseIntentView as cl, enrichPvDepositView as cm, enrichPvIntentView as cn, type PV_DepositView as co, type PV_Deposit as cp, type PV_PaymentMethodData as cq, type PV_Currency as cr, type PV_ReferralFee as cs, type PV_IntentView as ct, type PV_Intent as cu, ZERO_RATE_MANAGER_ID as cv, isZeroRateManagerId as cw, normalizeRateManagerId as cx, normalizeRegistry as cy, getDelegationRoute as cz, type SellerCredentialAttestationRuntime as d, type AttestationServiceSellerCredentialUploadResponse as e, type GoogleOAuthSellerCredentialUploadBodyByPlatform as f, type BestByPlatformResponse as g, type ValidatePayeeDetailsResponse as h, type PostDepositDetailsResponse as i, type GetPayeeDetailsRequest as j, type GetPayeeDetailsResponse as k, type GetOwnerDepositsRequest as l, type GetOwnerDepositsResponse as m, type GetTakerTierRequest as n, type GetTakerTierResponse as o, type GetDepositBundleParams as p, type ApiAdapterOptions as q, type GetDepositBundleResponse as r, type GetOrderbookParams as s, type GetOrderbookResponse as t, type CurrencyType as u, type PaymentMethodCatalog as v, type TxOverrides as w, type SignalIntentReferralFee as x, type SignalIntentMethodParams as y, type CancelIntentMethodParams as z };
3720
+ export { type BestByPlatformResponseObject as $, type AttestationServiceIdentityResponse as A, type BuyerTeeSessionMaterialEncryptionInput as B, type CuratorSellerCredentialUploadResponse as C, type DepositWithRelations as D, type Zkp2pNextOptions as E, type FulfillIntentMethodParams as F, type GoogleOAuthSellerCredentialPlatform as G, type AuthorizationTokenProvider as H, type IntentEntity$1 as I, type TimeoutConfig as J, type ActionCallback as K, type CreateDepositParams as L, type CreateDepositConversionRate as M, type Range as N, type SignalIntentParams 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 WithdrawDepositParams as W, type FulfillIntentParams as X, type ReleaseFundsToPayerParams as Y, Zkp2pClient as Z, type CancelIntentParams as _, type IdentityAttestationRequestBody as a, type AttestationServiceSellerVerifyResponse as a$, type GetBestByPlatformResponse as a0, type GetBestByPlatformResponseObject as a1, type GetPlatformQuote as a2, type PlatformQuote as a3, type QuoteRequest as a4, type GetNearbyQuote as a5, type GetNearbySuggestions as a6, type GetQuoteResponse as a7, type GetQuoteResponseObject as a8, type GetQuoteSingleResponse as a9, type VenmoSessionMaterial as aA, type CashAppSessionMaterial as aB, type WiseSessionMaterial as aC, type WiseProfileInfo as aD, type WiseProfileSelectionRequired as aE, type WiseProfileNotFound as aF, type PayPalGoogleOAuthSellerCredentialUploadBody as aG, type VenmoGoogleOAuthSellerCredentialUploadBody as aH, type ZelleGoogleOAuthSellerCredentialUploadBody as aI, type VenmoCredentialUploadInput as aJ, type CashAppCredentialUploadInput as aK, type WiseCredentialUploadInput as aL, type SellerCredentialUploadInputByPlatform as aM, type SellerCiphertextBundle as aN, type SellerSignedCiphertextBundle as aO, type SellerVerifyIntentDetails as aP, type SellerVerifyInput as aQ, type SellerProbeInput as aR, type SellerCredentialBundleUpload as aS, type SellerCredentialStatusValue as aT, type SellerCredentialStatus as aU, type SellerVerifyProxyBody as aV, type SellerTypedDataField as aW, type SellerTypedDataSpec as aX, type SellerPaymentTypedDataValue as aY, type SellerAttestationOutput as aZ, type SellerCredentialProbeResponse as a_, type QuoteResponse as aa, type QuoteResponseObject as ab, type QuoteSingleResponse as ac, type QuoteIntentResponse as ad, type QuoteFeesResponse as ae, type FiatResponse as af, type TokenResponse as ag, type NearbyQuote as ah, type NearbySuggestions as ai, type ApiDeposit as aj, type DepositVerifier as ak, type DepositVerifierCurrency as al, type DepositStatus as am, type GetDepositByIdRequest as an, type GetDepositByIdResponse as ao, type Intent as ap, type ApiIntentStatus as aq, type GetOwnerIntentsRequest as ar, type GetOwnerIntentsResponse as as, type GetIntentsByDepositRequest as at, type GetIntentsByDepositResponse as au, type GetIntentByHashRequest as av, type GetIntentByHashResponse as aw, type RegisterPayeeDetailsRequest as ax, type RegisterPayeeDetailsResponse as ay, type SellerPlatform as az, type SellerCredentialUploadInput as b, type RateManagerFilter as b$, type FulfillIntentAttestationResponse as b0, type AttestationServiceSellerCredentialProbeResponse as b1, type BuyerTeePaymentParams as b2, type BuyerTeePaymentProofInput as b3, type BuyerTeeSessionMaterial as b4, type CuratorSellerCredentialStatusResponse as b5, type CuratorSellerVerifyResponse as b6, type RegisteredSellerCredentialPlatform as b7, type UploadSellerCredentialParams as b8, type RegisteredUploadSellerCredentialParams as b9, IndexerDepositService as bA, IndexerRateManagerService as bB, compareEventCursorIdsByRecency as bC, fetchFulfillmentAndPayment as bD, type DepositEntity$1 as bE, type IntentFulfilledEntity as bF, type IntentFulfillmentAmountsEntity as bG, type DepositPaymentMethodEntity$1 as bH, type MethodCurrencyEntity$1 as bI, type IntentStatus as bJ, type RateManagerEntity as bK, type RateManagerRateEntity as bL, type RateManagerDelegationEntity as bM, type ManagerAggregateStatsEntity as bN, type ManagerStatsEntity as bO, type ManagerDailySnapshotEntity as bP, type RateManagerListItem as bQ, type RateManagerDetail as bR, type ManualRateUpdateEntity as bS, type OracleConfigUpdateEntity as bT, type DepositFundActivityEntity$1 as bU, type DepositDailySnapshotEntity$1 as bV, type DepositFundActivityType$1 as bW, type DepositFilter as bX, type PaginationOptions as bY, type DepositOrderField as bZ, type OrderDirection$1 as b_, type UploadSellerCredentialOptions as ba, type GetSellerCredentialStatusParams as bb, type UploadPayPalGoogleOAuthSellerCredentialParams as bc, type UploadVenmoGoogleOAuthSellerCredentialParams as bd, type UploadZelleGoogleOAuthSellerCredentialParams as be, type UploadGoogleOAuthSellerCredentialParams as bf, type VerifySellerPaymentParams as bg, type IdentityAttestationActionType as bh, type IdentityAttestationOutput as bi, type IdentityAttestationOutputFor as bj, type IdentityAttestationParams as bk, type MakerIdentityAttestationRequestBody as bl, type MakerIdentityPlatform as bm, type OnchainCurrency as bn, type DepositVerifierData as bo, type PreparedTransaction as bp, type OrderStats as bq, type DepositIntentStatistics as br, type TakerTier as bs, type TakerTierStats as bt, type TakerTierSource as bu, type PlatformLimit as bv, type PlatformRiskLevel as bw, type OrderbookEntry as bx, IndexerClient as by, defaultIndexerEndpoint as bz, type SellerCredentialUploadPlatform as c, type RateManagerPaginationOptions as c0, type RateManagerDelegationPaginationOptions as c1, type RateManagerOrderField as c2, type OrderDirection as c3, type DeploymentEnv as c4, type FulfillmentRecord as c5, type PaymentVerifiedRecord as c6, type FulfillmentAndPaymentResponse as c7, PAYMENT_PLATFORMS as c8, type PaymentPlatformType as c9, normalizeRateManagerId as cA, normalizeRegistry as cB, getDelegationRoute as cC, classifyDelegationState as cD, type DelegationRoute as cE, type DelegationState as cF, type DelegationDepositTarget as cG, type BatchResult as cH, type SendTransactionFn as cI, type SendBatchFn as cJ, ZERO_ADDRESS as cK, asErrorMessage as cL, assertDelegationMethodSupport as cM, Currency as ca, currencyInfo as cb, getCurrencyInfoFromHash as cc, getCurrencyInfoFromCountryCode as cd, getCurrencyCodeFromHash as ce, isSupportedCurrencyHash as cf, mapConversionRatesToOnchainMinRate as cg, type CurrencyData as ch, getContracts as ci, getRateManagerContracts as cj, getPaymentMethodsCatalog as ck, getGatingServiceAddress as cl, type RuntimeEnv as cm, parseDepositView as cn, parseIntentView as co, enrichPvDepositView as cp, enrichPvIntentView as cq, type PV_DepositView as cr, type PV_Deposit as cs, type PV_PaymentMethodData as ct, type PV_Currency as cu, type PV_ReferralFee as cv, type PV_IntentView as cw, type PV_Intent as cx, ZERO_RATE_MANAGER_ID as cy, isZeroRateManagerId as cz, type SellerCredentialAttestationRuntime as d, type AttestationServiceSellerCredentialUploadResponse as e, type GoogleOAuthSellerCredentialUploadBodyByPlatform as f, type BestByPlatformResponse as g, type ValidatePayeeDetailsResponse as h, type PostDepositDetailsResponse as i, type GetPayeeDetailsRequest as j, type GetPayeeDetailsResponse as k, type GetOwnerDepositsRequest as l, type GetOwnerDepositsResponse as m, type GetTakerTierRequest as n, type GetTakerTierResponse as o, type GetDepositBundleParams as p, type ApiAdapterOptions as q, type GetDepositBundleResponse as r, type GetOrderbookParams as s, type GetOrderbookResponse as t, type CurrencyType as u, type PaymentMethodCatalog as v, type TxOverrides as w, type SignalIntentReferralFee as x, type SignalIntentMethodParams as y, type CancelIntentMethodParams as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zkp2p/sdk",
3
- "version": "0.5.7",
3
+ "version": "0.6.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",
@@ -87,7 +87,7 @@
87
87
  "node": ">=22"
88
88
  },
89
89
  "dependencies": {
90
- "@zkp2p/indexer-schema": "0.2.3",
90
+ "@zkp2p/indexer-schema": "0.5.0",
91
91
  "@zkp2p/contracts-v2": "0.2.4",
92
92
  "@zkp2p/zkp2p-attestation": "1.6.3",
93
93
  "ethers": "^6.0.0",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/takerTiers.ts","../src/react/hooks/vaultUtils.ts"],"names":[],"mappings":"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","file":"chunk-TGMRXUP2.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 * A user's *live* cap (after lock-score penalties and per-platform risk\n * multipliers) always comes from the taker-tier API payload\n * (`TakerTier.perIntentCapBaseUnits` / `nextTierMaxOrderSizeDisplay`). This\n * static schedule is for reference displays that must show every tier at once —\n * the Fees & Tiers ladder — and the forward-looking \"next tier cap\" hint.\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 volume (USD) that qualifies for this tier. */\n minVolumeUsd: number;\n /** Inclusive upper bound of lifetime 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: 25000, maxVolumeUsd: Infinity },\n { tier: 'PRO', perIntentCapUsd: 2500, minVolumeUsd: 10000, maxVolumeUsd: 24999 },\n { tier: 'PLUS', perIntentCapUsd: 1000, minVolumeUsd: 2000, maxVolumeUsd: 9999 },\n { tier: 'PEER', perIntentCapUsd: 250, minVolumeUsd: 500, maxVolumeUsd: 1999 },\n { tier: 'PEASANT', perIntentCapUsd: 100, minVolumeUsd: 0, maxVolumeUsd: 499 },\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/** 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"]}