@zkp2p/sdk 0.9.0 → 0.10.0-rc.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/README.md +85 -14
- package/dist/{chunk-EIOXBVXP.mjs → chunk-LPJE2MN7.mjs} +3 -39
- package/dist/chunk-LPJE2MN7.mjs.map +1 -0
- package/dist/{chunk-FSIRPX4W.mjs → chunk-NKEAAPPR.mjs} +33616 -248
- package/dist/chunk-NKEAAPPR.mjs.map +1 -0
- package/dist/index.cjs +34184 -406
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +64 -61
- package/dist/index.d.ts +64 -61
- package/dist/index.mjs +456 -25
- package/dist/index.mjs.map +1 -1
- package/dist/protocolViewerParsers-WNN3TJD3.mjs +5 -0
- package/dist/{protocolViewerParsers-ER62YZ5L.mjs.map → protocolViewerParsers-WNN3TJD3.mjs.map} +1 -1
- package/dist/react.cjs +97 -94
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.mts +33 -14
- package/dist/react.d.ts +33 -14
- package/dist/react.mjs +99 -68
- package/dist/react.mjs.map +1 -1
- package/dist/{vaultUtils-aJdIIILM.d.mts → vaultUtils-CxUP_m-J.d.mts} +460 -102
- package/dist/{vaultUtils-aJdIIILM.d.ts → vaultUtils-CxUP_m-J.d.ts} +460 -102
- package/package.json +1 -1
- package/dist/chunk-EIOXBVXP.mjs.map +0 -1
- package/dist/chunk-FSIRPX4W.mjs.map +0 -1
- package/dist/protocolViewerParsers-ER62YZ5L.mjs +0 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as ReferrerFeeConfig, S as SellerCredentialBundle, D as DepositWithRelations, I as IntentEntity, a as IdentityAttestationRequestBody, A as AttestationServiceIdentityResponse, B as BuyerTeeVerifyPaymentBody, b as AttestationServiceSellerVerifyResponse, c as SellerCredentialUploadInput, d as SellerCredentialUploadPlatform, e as SellerCredentialAttestationRuntime, f as AttestationServiceSellerCredentialUploadResponse, g as BuyerTeeSessionMaterialEncryptionInput, U as UploadSellerCredentialBundleParams, C as CuratorSellerCredentialUploadResponse, h as CreateReferralCodeRequest, i as ApiAdapterOptions, j as CreateReferralCodeResponse, k as ReferralReadRequest, l as ReferralDashboardResponse, m as ReferralEarningsResponse, n as ReferralCodeLookupResponse, o as RedeemReferralCodeRequest, p as RedeemReferralCodeResponse, q as UpdateReferralCodeRequest, r as UpdateReferralCodeResponse, G as GoogleOAuthSellerCredentialPlatform, s as GoogleOAuthSellerCredentialUploadBodyByPlatform, Q as QuotesBestByPlatformRequest, t as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, u as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, v as PostDepositDetailsResponse, w as GetPayeeDetailsRequest, x as GetPayeeDetailsResponse, y as GetOwnerDepositsRequest, z as GetOwnerDepositsResponse, E as
|
|
2
|
-
export {
|
|
1
|
+
import { R as ReferrerFeeConfig, S as SellerCredentialBundle, D as DepositWithRelations, I as IntentEntity, a as IdentityAttestationRequestBody, A as AttestationServiceIdentityResponse, B as BuyerTeeVerifyPaymentBody, b as AttestationServiceSellerVerifyResponse, c as SellerCredentialUploadInput, d as SellerCredentialUploadPlatform, e as SellerCredentialAttestationRuntime, f as AttestationServiceSellerCredentialUploadResponse, g as BuyerTeeSessionMaterialEncryptionInput, U as UploadSellerCredentialBundleParams, C as CuratorSellerCredentialUploadResponse, h as CreateReferralCodeRequest, i as ApiAdapterOptions, j as CreateReferralCodeResponse, k as ReferralReadRequest, l as ReferralDashboardResponse, m as ReferralEarningsResponse, n as ReferralCodeLookupResponse, o as RedeemReferralCodeRequest, p as RedeemReferralCodeResponse, q as UpdateReferralCodeRequest, r as UpdateReferralCodeResponse, G as GoogleOAuthSellerCredentialPlatform, s as GoogleOAuthSellerCredentialUploadBodyByPlatform, Q as QuotesBestByPlatformRequest, t as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, u as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, v as PostDepositDetailsResponse, w as GetPayeeDetailsRequest, x as GetPayeeDetailsResponse, y as GetOwnerDepositsRequest, z as GetOwnerDepositsResponse, E as GetTakerStakeRequest, F as GetTakerStakeResponse, H as GetTakerCapacityRequest, J as GetTakerCapacityResponse, K as GetDepositBundleParams, L as GetDepositBundleResponse, M as GetOrderbookParams, N as GetOrderbookResponse, O as GetOrderbookTableResponse, T as CurrencyType, W as PaymentMethodCatalog, X as TxOverrides } from './vaultUtils-CxUP_m-J.mjs';
|
|
2
|
+
export { ae as ActionCallback, aJ as ApiDeposit, aQ as ApiIntentStatus, bp as AttestationServiceSellerCredentialProbeResponse, ac as AuthorizationTokenProvider, dv as BatchResult, ap as BestByPlatformResponseObject, c1 as BondedTakingCapacity, bq as BuyerTeePaymentParams, br as BuyerTeePaymentProofInput, bs as BuyerTeeSessionMaterial, a4 as CancelIntentMethodParams, ao as CancelIntentParams, b_ as CapacityWarning, bY as CapacityWarningCode, bZ as CapacityWarningSeverity, b7 as CashAppCredentialUploadInput, a$ as CashAppSessionMaterial, c4 as ChargebackCoverageStatus, ai as CreateDepositConversionRate, ah as CreateDepositParams, bt as CuratorSellerCredentialStatusResponse, bu as CuratorSellerVerifyResponse, cP as Currency, cW as CurrencyData, b$ as CurveTakingCapacity, d6 as DEFERRED_PAYOUT_RECORDED_EVENT_ABI, du as DelegationDepositTarget, ds as DelegationRoute, dt as DelegationState, df as Deposit, dh as DepositCurrency, bO as DepositIntentStatistics, aM as DepositStatus, aK as DepositVerifier, aL as DepositVerifierCurrency, bL as DepositVerifierData, de as DepositView, aF as FiatResponse, bo as FulfillIntentAttestationResponse, a3 as FulfillIntentMethodParams, am as FulfillIntentParams, aq as GetBestByPlatformResponse, ar as GetBestByPlatformResponseObject, aN as GetDepositByIdRequest, aO as GetDepositByIdResponse, aV as GetIntentByHashRequest, aW as GetIntentByHashResponse, aT as GetIntentsByDepositRequest, aU as GetIntentsByDepositResponse, av as GetNearbyQuote, aw as GetNearbySuggestions, aR as GetOwnerIntentsRequest, aS as GetOwnerIntentsResponse, as as GetPlatformQuote, ax as GetQuoteResponse, ay as GetQuoteResponseObject, az as GetQuoteSingleResponse, bz as GetSellerCredentialStatusParams, bE as IdentityAttestationActionType, bF as IdentityAttestationOutput, bG as IdentityAttestationOutputFor, bH as IdentityAttestationParams, cb as IndexerClient, cJ as IndexerDeploymentEnv, ch as IndexerDeposit, cy as IndexerDepositDailySnapshot, cA as IndexerDepositFilter, cx as IndexerDepositFundActivity, cz as IndexerDepositFundActivityType, cD as IndexerDepositOrderDirection, cC as IndexerDepositOrderField, cB as IndexerDepositPagination, ck as IndexerDepositPaymentMethod, cd as IndexerDepositService, cM as IndexerFulfillmentAndPaymentResponse, cK as IndexerFulfillmentRecord, ci as IndexerIntentFulfilled, cj as IndexerIntentFulfillmentAmounts, cm as IndexerIntentStatus, cq as IndexerManagerAggregateStats, cs as IndexerManagerDailySnapshot, cr as IndexerManagerStats, cv as IndexerManualRateUpdate, cl as IndexerMethodCurrency, cw as IndexerOracleConfigUpdate, cL as IndexerPaymentVerifiedRecord, cn as IndexerRateManager, cp as IndexerRateManagerDelegation, cG as IndexerRateManagerDelegationPagination, cu as IndexerRateManagerDetail, cE as IndexerRateManagerFilter, ct as IndexerRateManagerListItem, cI as IndexerRateManagerOrderDirection, cH as IndexerRateManagerOrderField, cF as IndexerRateManagerPagination, co as IndexerRateManagerRate, ce as IndexerRateManagerService, aP as Intent, dj as IntentView, c0 as LimitingCurve, bI as MakerIdentityAttestationRequestBody, bJ as MakerIdentityPlatform, aH as NearbyQuote, aI as NearbySuggestions, d2 as ORCHESTRATOR_V3_ABI, Z as OfframpClient, bK as OnchainCurrency, dk as OnchainIntent, bN as OrderStats, c9 as OrderbookEntry, ca as OrderbookTableRow, cN as PAYMENT_PLATFORMS, b4 as PayPalGoogleOAuthSellerCredentialUploadBody, dg as PaymentMethodData, cO as PaymentPlatformType, c6 as PlatformCapacity, c5 as PlatformChargebackCapacity, c2 as PlatformFreeTakes, c3 as PlatformGriefingCapacity, at as PlatformQuote, bM as PreparedTransaction, aE as QuoteFeesResponse, aD as QuoteIntentResponse, au as QuoteRequest, aA as QuoteResponse, aB as QuoteResponseObject, aC as QuoteSingleResponse, d3 as RISK_MANAGER_ABI, d5 as RISK_POSITION_SETTLED_EVENT_ABI, aj as Range, a0 as RedeemReferralCodeSignatureOptions, Y as ReferralBearerWriteOptions, di as ReferralFee, _ as ReferralReadOptions, af as ReferralRedemption, ag as ReferralSignatureBody, $ as ReferralSignatureOptions, aX as RegisterPayeeDetailsRequest, aY as RegisterPayeeDetailsResponse, bv as RegisteredSellerCredentialPlatform, bx as RegisteredUploadSellerCredentialParams, an as ReleaseFundsToPayerParams, d7 as RuntimeEnv, d4 as STAKE_VAULT_ABI, bm as SellerAttestationOutput, ba as SellerCiphertextBundle, bf as SellerCredentialBundleUpload, bn as SellerCredentialProbeResponse, bh as SellerCredentialStatus, bg as SellerCredentialStatusValue, b9 as SellerCredentialUploadInputByPlatform, bl as SellerPaymentTypedDataValue, aZ as SellerPlatform, be as SellerProbeInput, bb as SellerSignedCiphertextBundle, bj as SellerTypedDataField, bk as SellerTypedDataSpec, bd as SellerVerifyInput, bc as SellerVerifyIntentDetails, bi as SellerVerifyProxyBody, dx as SendBatchFn, dw as SendTransactionFn, a2 as SignalIntentMethodParams, al as SignalIntentParams, a1 as SignalIntentReferralFee, a7 as StakeExitRequest, bV as StakeReservation, bU as StakeReservationKind, bW as StakeReservations, a8 as StakeVaultState, a9 as StakeVaultWriteFunction, aa as StakeVaultWriteParams, ab as StakeWithdrawalRequest, c8 as TakerCapacity, bR as TakerDelegation, c7 as TakerOperationalGates, bX as TakerStake, bQ as TakerStakeAsset, bS as TakerStakeBalances, bT as TakerStakeExit, ad as TimeoutConfig, aG as TokenResponse, a5 as UpdateReferralCodeSignatureOptions, bC as UploadGoogleOAuthSellerCredentialParams, bA as UploadPayPalGoogleOAuthSellerCredentialParams, by as UploadSellerCredentialOptions, bw as UploadSellerCredentialParams, bB as UploadVenmoGoogleOAuthSellerCredentialParams, bP as UsdcAmount, d9 as V2ContractAbis, d8 as V2ContractAddresses, b6 as VenmoCredentialUploadInput, b5 as VenmoGoogleOAuthSellerCredentialUploadBody, a_ as VenmoSessionMaterial, bD as VerifySellerPaymentParams, b8 as WiseCredentialUploadInput, b1 as WiseProfileInfo, b3 as WiseProfileNotFound, b2 as WiseProfileSelectionRequired, b0 as WiseSessionMaterial, ak as WithdrawDepositParams, dl as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, a6 as Zkp2pClientOptions, dr as classifyDelegationState, cf as compareEventCursorIdsByRecency, cQ as currencyInfo, cc as defaultIndexerEndpoint, dc as enrichPvDepositView, dd as enrichPvIntentView, cg as fetchIndexerFulfillmentAndPayment, cX as getContracts, cT as getCurrencyCodeFromHash, cS as getCurrencyInfoFromCountryCode, cR as getCurrencyInfoFromHash, dq as getDelegationRoute, d1 as getGatingServiceAddress, c_ as getOrchestratorV3Contract, d0 as getPaymentMethodsCatalog, cY as getRateManagerContracts, c$ as getRiskManagerContract, cZ as getStakeVaultContract, cU as isSupportedCurrencyHash, dm as isZeroRateManagerId, cV as mapConversionRatesToOnchainMinRate, dn as normalizeRateManagerId, dp as normalizeRegistry, da as parseDepositView, db as parseIntentView } from './vaultUtils-CxUP_m-J.mjs';
|
|
3
3
|
import { Address, Hash, Hex, WalletClient } from 'viem';
|
|
4
4
|
import { Abi } from 'abitype';
|
|
5
5
|
export { IdentityActionType, IdentityActionTypeByPlatform, IdentityParamsByPlatform, IdentityPlatform, NitroAttestationClient, NitroAttestationClientOptions, NitroAttestationEnvironment, VerifiedAttestation, VerifiedAttestationPayload, createNitroAttestationClient } from '@zkp2p/zkp2p-attestation';
|
|
@@ -131,7 +131,7 @@ interface EscrowContractContext {
|
|
|
131
131
|
interface OrchestratorContractContext {
|
|
132
132
|
address: Address;
|
|
133
133
|
abi: Abi;
|
|
134
|
-
version: 'v2';
|
|
134
|
+
version: 'v2' | 'v3';
|
|
135
135
|
}
|
|
136
136
|
interface ContractRouterConfig {
|
|
137
137
|
escrowAddress: Address;
|
|
@@ -143,6 +143,8 @@ interface ContractRouterConfig {
|
|
|
143
143
|
orchestratorAbi?: Abi;
|
|
144
144
|
orchestratorV2Address?: Address;
|
|
145
145
|
orchestratorV2Abi?: Abi;
|
|
146
|
+
orchestratorV3Address?: Address;
|
|
147
|
+
orchestratorV3Abi?: Abi;
|
|
146
148
|
orchestratorAddresses: Address[];
|
|
147
149
|
}
|
|
148
150
|
declare class ContractRouter {
|
|
@@ -157,6 +159,8 @@ declare class ContractRouter {
|
|
|
157
159
|
readonly orchestratorAbi?: Abi;
|
|
158
160
|
readonly orchestratorV2Address?: Address;
|
|
159
161
|
readonly orchestratorV2Abi?: Abi;
|
|
162
|
+
readonly orchestratorV3Address?: Address;
|
|
163
|
+
readonly orchestratorV3Abi?: Abi;
|
|
160
164
|
readonly orchestratorAddresses: Address[];
|
|
161
165
|
constructor(config: ContractRouterConfig);
|
|
162
166
|
private _registerContexts;
|
|
@@ -278,9 +282,14 @@ declare function apiGetPayeeDetails(req: GetPayeeDetailsRequest, baseApiUrl: str
|
|
|
278
282
|
declare function apiValidatePayeeDetails(req: ValidatePayeeDetailsRequest, baseApiUrl: string, timeoutMs?: number): Promise<ValidatePayeeDetailsResponse>;
|
|
279
283
|
declare function apiGetOwnerDeposits(req: GetOwnerDepositsRequest, apiKey: string | undefined, baseApiUrl: string, authToken?: string, timeoutMs?: number): Promise<GetOwnerDepositsResponse>;
|
|
280
284
|
/**
|
|
281
|
-
* Get
|
|
285
|
+
* Get the stake portfolio backing a taker (balances, reservations, exit state).
|
|
286
|
+
*/
|
|
287
|
+
declare function apiGetTakerStake(req: GetTakerStakeRequest, baseApiUrl: string, timeoutMs?: number): Promise<GetTakerStakeResponse>;
|
|
288
|
+
/**
|
|
289
|
+
* Get per-platform bonded taking capacity, free takes, and operational gates
|
|
290
|
+
* for a taker's shared stake portfolio.
|
|
282
291
|
*/
|
|
283
|
-
declare function
|
|
292
|
+
declare function apiGetTakerCapacity(req: GetTakerCapacityRequest, baseApiUrl: string, timeoutMs?: number): Promise<GetTakerCapacityResponse>;
|
|
284
293
|
declare function apiGetReferralDashboard(opts: ApiAdapterOptions & ReferralReadRequest): Promise<ReferralDashboardResponse>;
|
|
285
294
|
declare function apiGetReferralEarnings(opts: ApiAdapterOptions & ReferralReadRequest): Promise<ReferralEarningsResponse>;
|
|
286
295
|
declare function apiLookupReferralCode(code: string, opts: ApiAdapterOptions): Promise<ReferralCodeLookupResponse>;
|
|
@@ -515,61 +524,6 @@ declare const TOKEN_METADATA: {
|
|
|
515
524
|
};
|
|
516
525
|
};
|
|
517
526
|
|
|
518
|
-
/**
|
|
519
|
-
* Canonical taker tier schedule — the single client-side source of truth for
|
|
520
|
-
* per-intent caps and volume thresholds. Mirrors the curator's authoritative
|
|
521
|
-
* tier engine (curator `src/common/services/tier/tierConstants.ts`), which is
|
|
522
|
-
* what the backend actually enforces.
|
|
523
|
-
*
|
|
524
|
-
* The live qualification signal is Peer Pay volume. Historical maker tiers
|
|
525
|
-
* earned before July 1, 2026 UTC are preserved; after that cutoff, only Peer
|
|
526
|
-
* Pay volume moves the tier. Curator keeps the response field name
|
|
527
|
-
* `peerPayVolume` for compatibility.
|
|
528
|
-
*
|
|
529
|
-
* A user's *live* tier, cap, and progression always come from the taker-tier
|
|
530
|
-
* API payload (`TakerTier.perIntentCapBaseUnits`, `minVolumeForTier`,
|
|
531
|
-
* `volumeToNextTier`, `peerPayVolume`). Those values are DB-backed and
|
|
532
|
-
* server-authoritative — they vary per environment (e.g. preprod runs
|
|
533
|
-
* different thresholds than these). This static schedule is ONLY a
|
|
534
|
-
* documented-default reference for displays that must show every tier at once
|
|
535
|
-
* (the Fees & Tiers ladder) when no live payload is available; never gate or
|
|
536
|
-
* compute a user's real cap from it.
|
|
537
|
-
*
|
|
538
|
-
* Volume bands track the live tuned qualification thresholds — PEER $1k,
|
|
539
|
-
* PLUS $10k, PRO $50k, PLATINUM $100k. Caps ($100/$250/$1k/$2.5k/$5k) are unchanged.
|
|
540
|
-
* Read the live per-user values from the API: curator can change qualification
|
|
541
|
-
* inputs behind the compatibility fields without changing this reference table.
|
|
542
|
-
*
|
|
543
|
-
* Ordered highest tier → lowest (PLATINUM first) to match UI display order.
|
|
544
|
-
*/
|
|
545
|
-
interface TakerTierScheduleEntry {
|
|
546
|
-
tier: TakerTierLevel;
|
|
547
|
-
/** Per-intent order cap in whole USD (base, before platform risk multipliers). */
|
|
548
|
-
perIntentCapUsd: number;
|
|
549
|
-
/** Inclusive lower bound of Peer Pay volume (USD) that qualifies for this tier. */
|
|
550
|
-
minVolumeUsd: number;
|
|
551
|
-
/** Inclusive upper bound of Peer Pay volume (USD); `Infinity` for the top tier. */
|
|
552
|
-
maxVolumeUsd: number;
|
|
553
|
-
}
|
|
554
|
-
declare const TAKER_TIER_SCHEDULE: readonly TakerTierScheduleEntry[];
|
|
555
|
-
/** Volume-based tier order, lowest → highest, for next-tier progression. */
|
|
556
|
-
declare const TAKER_TIER_ORDER: readonly TakerTierLevel[];
|
|
557
|
-
/** Per-intent caps (whole USD) keyed by tier, derived from the schedule. */
|
|
558
|
-
declare const TAKER_TIER_CAPS: Readonly<Record<string, number>>;
|
|
559
|
-
/**
|
|
560
|
-
* Default take-fee discount (in basis points) applied per tier, mirroring
|
|
561
|
-
* curator `TIER_FEE_DISCOUNT_BPS`. The discount is subtracted from the base
|
|
562
|
-
* service fee server-side at quote and sign time — it is NOT returned by the
|
|
563
|
-
* tier endpoint. These are documented defaults for reference fee displays only;
|
|
564
|
-
* the curator DB control-plane can override them, so prefer the fee shown on a
|
|
565
|
-
* live quote when one is available.
|
|
566
|
-
*/
|
|
567
|
-
declare const TAKER_TIER_FEE_DISCOUNT_BPS: Readonly<Record<TakerTierLevel, number>>;
|
|
568
|
-
/** The default fee-discount (bps) for a tier, or 0 for unknown tiers. */
|
|
569
|
-
declare function getTakerTierFeeDiscountBps(tier: string | undefined): number;
|
|
570
|
-
/** The next tier up from `currentTier`, or `null` at the top / for unknown tiers. */
|
|
571
|
-
declare function getNextTakerTier(currentTier: string | undefined): TakerTierLevel | null;
|
|
572
|
-
|
|
573
527
|
/**
|
|
574
528
|
* Payment method resolution utilities.
|
|
575
529
|
*
|
|
@@ -659,6 +613,55 @@ declare function resolvePaymentMethodHashFromCatalog(processorName: string, cata
|
|
|
659
613
|
*/
|
|
660
614
|
declare function resolvePaymentMethodNameFromHash(hash: string, catalog: PaymentMethodCatalog): string | undefined;
|
|
661
615
|
|
|
616
|
+
/**
|
|
617
|
+
* Exact client-side counterparts of RiskManager's integer formulas.
|
|
618
|
+
*
|
|
619
|
+
* Kept inside the public SDK so its generated declarations and runtime remain
|
|
620
|
+
* self-contained for external consumers.
|
|
621
|
+
*/
|
|
622
|
+
type IntegerLike = bigint | number | string | {
|
|
623
|
+
toString(): string;
|
|
624
|
+
};
|
|
625
|
+
interface GriefingTerms {
|
|
626
|
+
maxIntentPeriod: IntegerLike;
|
|
627
|
+
griefingCliff: IntegerLike;
|
|
628
|
+
griefingPenaltyBpsPerHour: IntegerLike;
|
|
629
|
+
}
|
|
630
|
+
interface RiskCapacity {
|
|
631
|
+
/** null means this disabled curve does not constrain capacity. */
|
|
632
|
+
griefingCapacity: bigint | null;
|
|
633
|
+
/** null means this disabled curve does not constrain capacity. */
|
|
634
|
+
chargebackCapacity: bigint | null;
|
|
635
|
+
/** null means both curves are disabled and bonded capacity is unbounded. */
|
|
636
|
+
bondedTakingCapacity: bigint | null;
|
|
637
|
+
}
|
|
638
|
+
interface FreeTakeCapacity {
|
|
639
|
+
remainingFreeTakes: bigint;
|
|
640
|
+
freeTakingCapacity: bigint;
|
|
641
|
+
}
|
|
642
|
+
interface GriefingPenalty {
|
|
643
|
+
penalty: bigint;
|
|
644
|
+
effectiveElapsed: bigint;
|
|
645
|
+
}
|
|
646
|
+
declare const RISK_BPS_DENOMINATOR = 10000n;
|
|
647
|
+
declare const RISK_SECONDS_PER_HOUR = 3600n;
|
|
648
|
+
declare const RISK_GRIEFING_DENOMINATOR: bigint;
|
|
649
|
+
/** ceil(A * s * (T - C) / (10_000 * 1 hour)); returns zero when the curve is disabled. */
|
|
650
|
+
declare function calculateMaxGriefingBond(amount: IntegerLike, terms: GriefingTerms): bigint;
|
|
651
|
+
/** ceil(A * r / 10_000); returns zero when chargeback coverage is disabled. */
|
|
652
|
+
declare function calculateChargebackReserve(amount: IntegerLike, reserveBps: IntegerLike): bigint;
|
|
653
|
+
/** max(maxGriefingBond, chargebackReserve), never their sum. */
|
|
654
|
+
declare function calculateRequiredReservation(amount: IntegerLike, terms: GriefingTerms, reserveBps: IntegerLike): bigint;
|
|
655
|
+
/** Capped, upward-rounded time-linear penalty used for cancellation and reconciliation. */
|
|
656
|
+
declare function calculateGriefingPenalty(amount: IntegerLike, createdAt: IntegerLike, cancelledAt: IntegerLike, terms: GriefingTerms): GriefingPenalty;
|
|
657
|
+
/**
|
|
658
|
+
* Inverts the exact rounded reservation curves. A null capacity denotes a disabled constraint.
|
|
659
|
+
* Because ceil(A*n/d) <= S iff A*n <= S*d, each inverse uses floor(S*d/n).
|
|
660
|
+
*/
|
|
661
|
+
declare function calculateBondedTakingCapacity(freeStake: IntegerLike, terms: GriefingTerms, reserveBps: IntegerLike): RiskCapacity;
|
|
662
|
+
/** Computes remaining separate free intents and their aggregate display capacity. */
|
|
663
|
+
declare function calculateFreeTakeCapacity(freeTakeCount: IntegerLike, freeTakesUsed: IntegerLike, freeTakeAmount: IntegerLike): FreeTakeCapacity;
|
|
664
|
+
|
|
662
665
|
/**
|
|
663
666
|
* Ensure a value is 32 bytes hex (0x + 64 nibbles). If ascii, keccak256 by default when hash=true.
|
|
664
667
|
*/
|
|
@@ -847,4 +850,4 @@ declare class ContractError extends ZKP2PError {
|
|
|
847
850
|
constructor(message: string, details?: unknown);
|
|
848
851
|
}
|
|
849
852
|
|
|
850
|
-
export { APIError, ApiAdapterOptions, AttestationServiceIdentityResponse, AttestationServiceSellerCredentialUploadResponse, AttestationServiceSellerVerifyResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, BuyerTeeVerifyPaymentBody, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ContractError, ContractRouter, type ContractRouterConfig, CreateReferralCodeRequest, CreateReferralCodeResponse, CuratorSellerCredentialUploadResponse, CurrencyType, DEFAULT_ORACLE_MAX_STALENESS_SECONDS, ErrorCode, type EscrowContractContext, type EscrowDepositView, type EscrowIntentView, GetDepositBundleParams, GetDepositBundleResponse, GetOrderbookParams, GetOrderbookResponse, GetOrderbookTableResponse, GetOwnerDepositsRequest, GetOwnerDepositsResponse, GetPayeeDetailsRequest, GetPayeeDetailsResponse,
|
|
853
|
+
export { APIError, ApiAdapterOptions, AttestationServiceIdentityResponse, AttestationServiceSellerCredentialUploadResponse, AttestationServiceSellerVerifyResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, BuyerTeeVerifyPaymentBody, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ContractError, ContractRouter, type ContractRouterConfig, CreateReferralCodeRequest, CreateReferralCodeResponse, CuratorSellerCredentialUploadResponse, CurrencyType, DEFAULT_ORACLE_MAX_STALENESS_SECONDS, ErrorCode, type EscrowContractContext, type EscrowDepositView, type EscrowIntentView, type FreeTakeCapacity, GetDepositBundleParams, GetDepositBundleResponse, GetOrderbookParams, GetOrderbookResponse, GetOrderbookTableResponse, GetOwnerDepositsRequest, GetOwnerDepositsResponse, GetPayeeDetailsRequest, GetPayeeDetailsResponse, GetTakerCapacityRequest, GetTakerCapacityResponse, GetTakerStakeRequest, GetTakerStakeResponse, GoogleOAuthSellerCredentialPlatform, GoogleOAuthSellerCredentialUploadBodyByPlatform, type GriefingPenalty, type GriefingTerms, IdentityAttestationRequestBody, DepositWithRelations as IndexerDepositWithRelations, IntentEntity as IndexerIntent, type IntegerLike, type LogLevel, type MulticallClient, NetworkError, type OracleAdapterOverrides, type OracleKind, type OrchestratorContractContext, PEER_EXTENSION_CHROME_URL, PLATFORM_METADATA, PYTH_CONTRACT_BASE, PYTH_ORACLE_ADAPTER, PYTH_ORACLE_FEEDS, PaymentMethodCatalog, type PeerAuthenticateParams, type PeerBuyerTeePaymentCapture, type PeerBuyerTeePaymentParams, type PeerConnectionStatus, type PeerExtensionApi, type PeerExtensionSdk, type PeerExtensionSdkOptions, type PeerExtensionState, type PeerExtensionWindow, type PeerMetadataCaptureMode, type PeerMetadataMessage, type PeerMetadataMessageCallback, type PeerMetadataProviderConfig, type PeerMetadataRow, type PeerSarCredentialCapture, PostDepositDetailsRequest, PostDepositDetailsResponse, type PythFeedConfig, QuotesBestByPlatformRequest, REFERRAL_SIGNATURE_DOMAIN, REFERRAL_SIGNATURE_TYPES, RISK_BPS_DENOMINATOR, RISK_GRIEFING_DENOMINATOR, RISK_SECONDS_PER_HOUR, RedeemReferralCodeRequest, RedeemReferralCodeResponse, ReferralCodeLookupResponse, ReferralDashboardResponse, ReferralEarningsResponse, ReferralReadRequest, ReferrerFeeConfig, type RiskCapacity, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, SellerCredentialAttestationRuntime, SellerCredentialBundle, SellerCredentialUploadInput, SellerCredentialUploadPlatform, type SpreadOracleConfig, type SpreadOracleFeedConfig, type SupportedChainId, TOKEN_METADATA, TxOverrides, UpdateReferralCodeRequest, UpdateReferralCodeResponse, UploadSellerCredentialBundleParams, ValidatePayeeDetailsRequest, ValidatePayeeDetailsResponse, ValidationError, ZKP2PError, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, apiCreateReferralCode, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOrderbookTable, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuotesBestByPlatform, apiGetReferralDashboard, apiGetReferralEarnings, apiGetTakerCapacity, apiGetTakerStake, apiLookupReferralCode, apiPostDepositDetails, apiRedeemReferralCode, apiRequestIdentityAttestation, apiUpdateReferralCode, apiUploadGoogleOAuthSellerCredential, apiUploadSellerCredentialBundle, apiValidatePayeeDetails, apiVerifyBuyerTeePayment, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, calculateBondedTakingCapacity, calculateChargebackReserve, calculateFreeTakeCapacity, calculateGriefingPenalty, calculateMaxGriefingBond, calculateRequiredReservation, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, createPeerExtensionSdk, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, ensureBytes32, getAttributionDataSuffix, getPeerExtensionState, getSpreadOracleConfig, isPeerExtensionAvailable, isValidReferralCode, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, normalizeReferralCode, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, referrerFeeConfigToPreciseUnits, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as ReferrerFeeConfig, S as SellerCredentialBundle, D as DepositWithRelations, I as IntentEntity, a as IdentityAttestationRequestBody, A as AttestationServiceIdentityResponse, B as BuyerTeeVerifyPaymentBody, b as AttestationServiceSellerVerifyResponse, c as SellerCredentialUploadInput, d as SellerCredentialUploadPlatform, e as SellerCredentialAttestationRuntime, f as AttestationServiceSellerCredentialUploadResponse, g as BuyerTeeSessionMaterialEncryptionInput, U as UploadSellerCredentialBundleParams, C as CuratorSellerCredentialUploadResponse, h as CreateReferralCodeRequest, i as ApiAdapterOptions, j as CreateReferralCodeResponse, k as ReferralReadRequest, l as ReferralDashboardResponse, m as ReferralEarningsResponse, n as ReferralCodeLookupResponse, o as RedeemReferralCodeRequest, p as RedeemReferralCodeResponse, q as UpdateReferralCodeRequest, r as UpdateReferralCodeResponse, G as GoogleOAuthSellerCredentialPlatform, s as GoogleOAuthSellerCredentialUploadBodyByPlatform, Q as QuotesBestByPlatformRequest, t as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, u as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, v as PostDepositDetailsResponse, w as GetPayeeDetailsRequest, x as GetPayeeDetailsResponse, y as GetOwnerDepositsRequest, z as GetOwnerDepositsResponse, E as
|
|
2
|
-
export {
|
|
1
|
+
import { R as ReferrerFeeConfig, S as SellerCredentialBundle, D as DepositWithRelations, I as IntentEntity, a as IdentityAttestationRequestBody, A as AttestationServiceIdentityResponse, B as BuyerTeeVerifyPaymentBody, b as AttestationServiceSellerVerifyResponse, c as SellerCredentialUploadInput, d as SellerCredentialUploadPlatform, e as SellerCredentialAttestationRuntime, f as AttestationServiceSellerCredentialUploadResponse, g as BuyerTeeSessionMaterialEncryptionInput, U as UploadSellerCredentialBundleParams, C as CuratorSellerCredentialUploadResponse, h as CreateReferralCodeRequest, i as ApiAdapterOptions, j as CreateReferralCodeResponse, k as ReferralReadRequest, l as ReferralDashboardResponse, m as ReferralEarningsResponse, n as ReferralCodeLookupResponse, o as RedeemReferralCodeRequest, p as RedeemReferralCodeResponse, q as UpdateReferralCodeRequest, r as UpdateReferralCodeResponse, G as GoogleOAuthSellerCredentialPlatform, s as GoogleOAuthSellerCredentialUploadBodyByPlatform, Q as QuotesBestByPlatformRequest, t as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, u as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, v as PostDepositDetailsResponse, w as GetPayeeDetailsRequest, x as GetPayeeDetailsResponse, y as GetOwnerDepositsRequest, z as GetOwnerDepositsResponse, E as GetTakerStakeRequest, F as GetTakerStakeResponse, H as GetTakerCapacityRequest, J as GetTakerCapacityResponse, K as GetDepositBundleParams, L as GetDepositBundleResponse, M as GetOrderbookParams, N as GetOrderbookResponse, O as GetOrderbookTableResponse, T as CurrencyType, W as PaymentMethodCatalog, X as TxOverrides } from './vaultUtils-CxUP_m-J.js';
|
|
2
|
+
export { ae as ActionCallback, aJ as ApiDeposit, aQ as ApiIntentStatus, bp as AttestationServiceSellerCredentialProbeResponse, ac as AuthorizationTokenProvider, dv as BatchResult, ap as BestByPlatformResponseObject, c1 as BondedTakingCapacity, bq as BuyerTeePaymentParams, br as BuyerTeePaymentProofInput, bs as BuyerTeeSessionMaterial, a4 as CancelIntentMethodParams, ao as CancelIntentParams, b_ as CapacityWarning, bY as CapacityWarningCode, bZ as CapacityWarningSeverity, b7 as CashAppCredentialUploadInput, a$ as CashAppSessionMaterial, c4 as ChargebackCoverageStatus, ai as CreateDepositConversionRate, ah as CreateDepositParams, bt as CuratorSellerCredentialStatusResponse, bu as CuratorSellerVerifyResponse, cP as Currency, cW as CurrencyData, b$ as CurveTakingCapacity, d6 as DEFERRED_PAYOUT_RECORDED_EVENT_ABI, du as DelegationDepositTarget, ds as DelegationRoute, dt as DelegationState, df as Deposit, dh as DepositCurrency, bO as DepositIntentStatistics, aM as DepositStatus, aK as DepositVerifier, aL as DepositVerifierCurrency, bL as DepositVerifierData, de as DepositView, aF as FiatResponse, bo as FulfillIntentAttestationResponse, a3 as FulfillIntentMethodParams, am as FulfillIntentParams, aq as GetBestByPlatformResponse, ar as GetBestByPlatformResponseObject, aN as GetDepositByIdRequest, aO as GetDepositByIdResponse, aV as GetIntentByHashRequest, aW as GetIntentByHashResponse, aT as GetIntentsByDepositRequest, aU as GetIntentsByDepositResponse, av as GetNearbyQuote, aw as GetNearbySuggestions, aR as GetOwnerIntentsRequest, aS as GetOwnerIntentsResponse, as as GetPlatformQuote, ax as GetQuoteResponse, ay as GetQuoteResponseObject, az as GetQuoteSingleResponse, bz as GetSellerCredentialStatusParams, bE as IdentityAttestationActionType, bF as IdentityAttestationOutput, bG as IdentityAttestationOutputFor, bH as IdentityAttestationParams, cb as IndexerClient, cJ as IndexerDeploymentEnv, ch as IndexerDeposit, cy as IndexerDepositDailySnapshot, cA as IndexerDepositFilter, cx as IndexerDepositFundActivity, cz as IndexerDepositFundActivityType, cD as IndexerDepositOrderDirection, cC as IndexerDepositOrderField, cB as IndexerDepositPagination, ck as IndexerDepositPaymentMethod, cd as IndexerDepositService, cM as IndexerFulfillmentAndPaymentResponse, cK as IndexerFulfillmentRecord, ci as IndexerIntentFulfilled, cj as IndexerIntentFulfillmentAmounts, cm as IndexerIntentStatus, cq as IndexerManagerAggregateStats, cs as IndexerManagerDailySnapshot, cr as IndexerManagerStats, cv as IndexerManualRateUpdate, cl as IndexerMethodCurrency, cw as IndexerOracleConfigUpdate, cL as IndexerPaymentVerifiedRecord, cn as IndexerRateManager, cp as IndexerRateManagerDelegation, cG as IndexerRateManagerDelegationPagination, cu as IndexerRateManagerDetail, cE as IndexerRateManagerFilter, ct as IndexerRateManagerListItem, cI as IndexerRateManagerOrderDirection, cH as IndexerRateManagerOrderField, cF as IndexerRateManagerPagination, co as IndexerRateManagerRate, ce as IndexerRateManagerService, aP as Intent, dj as IntentView, c0 as LimitingCurve, bI as MakerIdentityAttestationRequestBody, bJ as MakerIdentityPlatform, aH as NearbyQuote, aI as NearbySuggestions, d2 as ORCHESTRATOR_V3_ABI, Z as OfframpClient, bK as OnchainCurrency, dk as OnchainIntent, bN as OrderStats, c9 as OrderbookEntry, ca as OrderbookTableRow, cN as PAYMENT_PLATFORMS, b4 as PayPalGoogleOAuthSellerCredentialUploadBody, dg as PaymentMethodData, cO as PaymentPlatformType, c6 as PlatformCapacity, c5 as PlatformChargebackCapacity, c2 as PlatformFreeTakes, c3 as PlatformGriefingCapacity, at as PlatformQuote, bM as PreparedTransaction, aE as QuoteFeesResponse, aD as QuoteIntentResponse, au as QuoteRequest, aA as QuoteResponse, aB as QuoteResponseObject, aC as QuoteSingleResponse, d3 as RISK_MANAGER_ABI, d5 as RISK_POSITION_SETTLED_EVENT_ABI, aj as Range, a0 as RedeemReferralCodeSignatureOptions, Y as ReferralBearerWriteOptions, di as ReferralFee, _ as ReferralReadOptions, af as ReferralRedemption, ag as ReferralSignatureBody, $ as ReferralSignatureOptions, aX as RegisterPayeeDetailsRequest, aY as RegisterPayeeDetailsResponse, bv as RegisteredSellerCredentialPlatform, bx as RegisteredUploadSellerCredentialParams, an as ReleaseFundsToPayerParams, d7 as RuntimeEnv, d4 as STAKE_VAULT_ABI, bm as SellerAttestationOutput, ba as SellerCiphertextBundle, bf as SellerCredentialBundleUpload, bn as SellerCredentialProbeResponse, bh as SellerCredentialStatus, bg as SellerCredentialStatusValue, b9 as SellerCredentialUploadInputByPlatform, bl as SellerPaymentTypedDataValue, aZ as SellerPlatform, be as SellerProbeInput, bb as SellerSignedCiphertextBundle, bj as SellerTypedDataField, bk as SellerTypedDataSpec, bd as SellerVerifyInput, bc as SellerVerifyIntentDetails, bi as SellerVerifyProxyBody, dx as SendBatchFn, dw as SendTransactionFn, a2 as SignalIntentMethodParams, al as SignalIntentParams, a1 as SignalIntentReferralFee, a7 as StakeExitRequest, bV as StakeReservation, bU as StakeReservationKind, bW as StakeReservations, a8 as StakeVaultState, a9 as StakeVaultWriteFunction, aa as StakeVaultWriteParams, ab as StakeWithdrawalRequest, c8 as TakerCapacity, bR as TakerDelegation, c7 as TakerOperationalGates, bX as TakerStake, bQ as TakerStakeAsset, bS as TakerStakeBalances, bT as TakerStakeExit, ad as TimeoutConfig, aG as TokenResponse, a5 as UpdateReferralCodeSignatureOptions, bC as UploadGoogleOAuthSellerCredentialParams, bA as UploadPayPalGoogleOAuthSellerCredentialParams, by as UploadSellerCredentialOptions, bw as UploadSellerCredentialParams, bB as UploadVenmoGoogleOAuthSellerCredentialParams, bP as UsdcAmount, d9 as V2ContractAbis, d8 as V2ContractAddresses, b6 as VenmoCredentialUploadInput, b5 as VenmoGoogleOAuthSellerCredentialUploadBody, a_ as VenmoSessionMaterial, bD as VerifySellerPaymentParams, b8 as WiseCredentialUploadInput, b1 as WiseProfileInfo, b3 as WiseProfileNotFound, b2 as WiseProfileSelectionRequired, b0 as WiseSessionMaterial, ak as WithdrawDepositParams, dl as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, a6 as Zkp2pClientOptions, dr as classifyDelegationState, cf as compareEventCursorIdsByRecency, cQ as currencyInfo, cc as defaultIndexerEndpoint, dc as enrichPvDepositView, dd as enrichPvIntentView, cg as fetchIndexerFulfillmentAndPayment, cX as getContracts, cT as getCurrencyCodeFromHash, cS as getCurrencyInfoFromCountryCode, cR as getCurrencyInfoFromHash, dq as getDelegationRoute, d1 as getGatingServiceAddress, c_ as getOrchestratorV3Contract, d0 as getPaymentMethodsCatalog, cY as getRateManagerContracts, c$ as getRiskManagerContract, cZ as getStakeVaultContract, cU as isSupportedCurrencyHash, dm as isZeroRateManagerId, cV as mapConversionRatesToOnchainMinRate, dn as normalizeRateManagerId, dp as normalizeRegistry, da as parseDepositView, db as parseIntentView } from './vaultUtils-CxUP_m-J.js';
|
|
3
3
|
import { Address, Hash, Hex, WalletClient } from 'viem';
|
|
4
4
|
import { Abi } from 'abitype';
|
|
5
5
|
export { IdentityActionType, IdentityActionTypeByPlatform, IdentityParamsByPlatform, IdentityPlatform, NitroAttestationClient, NitroAttestationClientOptions, NitroAttestationEnvironment, VerifiedAttestation, VerifiedAttestationPayload, createNitroAttestationClient } from '@zkp2p/zkp2p-attestation';
|
|
@@ -131,7 +131,7 @@ interface EscrowContractContext {
|
|
|
131
131
|
interface OrchestratorContractContext {
|
|
132
132
|
address: Address;
|
|
133
133
|
abi: Abi;
|
|
134
|
-
version: 'v2';
|
|
134
|
+
version: 'v2' | 'v3';
|
|
135
135
|
}
|
|
136
136
|
interface ContractRouterConfig {
|
|
137
137
|
escrowAddress: Address;
|
|
@@ -143,6 +143,8 @@ interface ContractRouterConfig {
|
|
|
143
143
|
orchestratorAbi?: Abi;
|
|
144
144
|
orchestratorV2Address?: Address;
|
|
145
145
|
orchestratorV2Abi?: Abi;
|
|
146
|
+
orchestratorV3Address?: Address;
|
|
147
|
+
orchestratorV3Abi?: Abi;
|
|
146
148
|
orchestratorAddresses: Address[];
|
|
147
149
|
}
|
|
148
150
|
declare class ContractRouter {
|
|
@@ -157,6 +159,8 @@ declare class ContractRouter {
|
|
|
157
159
|
readonly orchestratorAbi?: Abi;
|
|
158
160
|
readonly orchestratorV2Address?: Address;
|
|
159
161
|
readonly orchestratorV2Abi?: Abi;
|
|
162
|
+
readonly orchestratorV3Address?: Address;
|
|
163
|
+
readonly orchestratorV3Abi?: Abi;
|
|
160
164
|
readonly orchestratorAddresses: Address[];
|
|
161
165
|
constructor(config: ContractRouterConfig);
|
|
162
166
|
private _registerContexts;
|
|
@@ -278,9 +282,14 @@ declare function apiGetPayeeDetails(req: GetPayeeDetailsRequest, baseApiUrl: str
|
|
|
278
282
|
declare function apiValidatePayeeDetails(req: ValidatePayeeDetailsRequest, baseApiUrl: string, timeoutMs?: number): Promise<ValidatePayeeDetailsResponse>;
|
|
279
283
|
declare function apiGetOwnerDeposits(req: GetOwnerDepositsRequest, apiKey: string | undefined, baseApiUrl: string, authToken?: string, timeoutMs?: number): Promise<GetOwnerDepositsResponse>;
|
|
280
284
|
/**
|
|
281
|
-
* Get
|
|
285
|
+
* Get the stake portfolio backing a taker (balances, reservations, exit state).
|
|
286
|
+
*/
|
|
287
|
+
declare function apiGetTakerStake(req: GetTakerStakeRequest, baseApiUrl: string, timeoutMs?: number): Promise<GetTakerStakeResponse>;
|
|
288
|
+
/**
|
|
289
|
+
* Get per-platform bonded taking capacity, free takes, and operational gates
|
|
290
|
+
* for a taker's shared stake portfolio.
|
|
282
291
|
*/
|
|
283
|
-
declare function
|
|
292
|
+
declare function apiGetTakerCapacity(req: GetTakerCapacityRequest, baseApiUrl: string, timeoutMs?: number): Promise<GetTakerCapacityResponse>;
|
|
284
293
|
declare function apiGetReferralDashboard(opts: ApiAdapterOptions & ReferralReadRequest): Promise<ReferralDashboardResponse>;
|
|
285
294
|
declare function apiGetReferralEarnings(opts: ApiAdapterOptions & ReferralReadRequest): Promise<ReferralEarningsResponse>;
|
|
286
295
|
declare function apiLookupReferralCode(code: string, opts: ApiAdapterOptions): Promise<ReferralCodeLookupResponse>;
|
|
@@ -515,61 +524,6 @@ declare const TOKEN_METADATA: {
|
|
|
515
524
|
};
|
|
516
525
|
};
|
|
517
526
|
|
|
518
|
-
/**
|
|
519
|
-
* Canonical taker tier schedule — the single client-side source of truth for
|
|
520
|
-
* per-intent caps and volume thresholds. Mirrors the curator's authoritative
|
|
521
|
-
* tier engine (curator `src/common/services/tier/tierConstants.ts`), which is
|
|
522
|
-
* what the backend actually enforces.
|
|
523
|
-
*
|
|
524
|
-
* The live qualification signal is Peer Pay volume. Historical maker tiers
|
|
525
|
-
* earned before July 1, 2026 UTC are preserved; after that cutoff, only Peer
|
|
526
|
-
* Pay volume moves the tier. Curator keeps the response field name
|
|
527
|
-
* `peerPayVolume` for compatibility.
|
|
528
|
-
*
|
|
529
|
-
* A user's *live* tier, cap, and progression always come from the taker-tier
|
|
530
|
-
* API payload (`TakerTier.perIntentCapBaseUnits`, `minVolumeForTier`,
|
|
531
|
-
* `volumeToNextTier`, `peerPayVolume`). Those values are DB-backed and
|
|
532
|
-
* server-authoritative — they vary per environment (e.g. preprod runs
|
|
533
|
-
* different thresholds than these). This static schedule is ONLY a
|
|
534
|
-
* documented-default reference for displays that must show every tier at once
|
|
535
|
-
* (the Fees & Tiers ladder) when no live payload is available; never gate or
|
|
536
|
-
* compute a user's real cap from it.
|
|
537
|
-
*
|
|
538
|
-
* Volume bands track the live tuned qualification thresholds — PEER $1k,
|
|
539
|
-
* PLUS $10k, PRO $50k, PLATINUM $100k. Caps ($100/$250/$1k/$2.5k/$5k) are unchanged.
|
|
540
|
-
* Read the live per-user values from the API: curator can change qualification
|
|
541
|
-
* inputs behind the compatibility fields without changing this reference table.
|
|
542
|
-
*
|
|
543
|
-
* Ordered highest tier → lowest (PLATINUM first) to match UI display order.
|
|
544
|
-
*/
|
|
545
|
-
interface TakerTierScheduleEntry {
|
|
546
|
-
tier: TakerTierLevel;
|
|
547
|
-
/** Per-intent order cap in whole USD (base, before platform risk multipliers). */
|
|
548
|
-
perIntentCapUsd: number;
|
|
549
|
-
/** Inclusive lower bound of Peer Pay volume (USD) that qualifies for this tier. */
|
|
550
|
-
minVolumeUsd: number;
|
|
551
|
-
/** Inclusive upper bound of Peer Pay volume (USD); `Infinity` for the top tier. */
|
|
552
|
-
maxVolumeUsd: number;
|
|
553
|
-
}
|
|
554
|
-
declare const TAKER_TIER_SCHEDULE: readonly TakerTierScheduleEntry[];
|
|
555
|
-
/** Volume-based tier order, lowest → highest, for next-tier progression. */
|
|
556
|
-
declare const TAKER_TIER_ORDER: readonly TakerTierLevel[];
|
|
557
|
-
/** Per-intent caps (whole USD) keyed by tier, derived from the schedule. */
|
|
558
|
-
declare const TAKER_TIER_CAPS: Readonly<Record<string, number>>;
|
|
559
|
-
/**
|
|
560
|
-
* Default take-fee discount (in basis points) applied per tier, mirroring
|
|
561
|
-
* curator `TIER_FEE_DISCOUNT_BPS`. The discount is subtracted from the base
|
|
562
|
-
* service fee server-side at quote and sign time — it is NOT returned by the
|
|
563
|
-
* tier endpoint. These are documented defaults for reference fee displays only;
|
|
564
|
-
* the curator DB control-plane can override them, so prefer the fee shown on a
|
|
565
|
-
* live quote when one is available.
|
|
566
|
-
*/
|
|
567
|
-
declare const TAKER_TIER_FEE_DISCOUNT_BPS: Readonly<Record<TakerTierLevel, number>>;
|
|
568
|
-
/** The default fee-discount (bps) for a tier, or 0 for unknown tiers. */
|
|
569
|
-
declare function getTakerTierFeeDiscountBps(tier: string | undefined): number;
|
|
570
|
-
/** The next tier up from `currentTier`, or `null` at the top / for unknown tiers. */
|
|
571
|
-
declare function getNextTakerTier(currentTier: string | undefined): TakerTierLevel | null;
|
|
572
|
-
|
|
573
527
|
/**
|
|
574
528
|
* Payment method resolution utilities.
|
|
575
529
|
*
|
|
@@ -659,6 +613,55 @@ declare function resolvePaymentMethodHashFromCatalog(processorName: string, cata
|
|
|
659
613
|
*/
|
|
660
614
|
declare function resolvePaymentMethodNameFromHash(hash: string, catalog: PaymentMethodCatalog): string | undefined;
|
|
661
615
|
|
|
616
|
+
/**
|
|
617
|
+
* Exact client-side counterparts of RiskManager's integer formulas.
|
|
618
|
+
*
|
|
619
|
+
* Kept inside the public SDK so its generated declarations and runtime remain
|
|
620
|
+
* self-contained for external consumers.
|
|
621
|
+
*/
|
|
622
|
+
type IntegerLike = bigint | number | string | {
|
|
623
|
+
toString(): string;
|
|
624
|
+
};
|
|
625
|
+
interface GriefingTerms {
|
|
626
|
+
maxIntentPeriod: IntegerLike;
|
|
627
|
+
griefingCliff: IntegerLike;
|
|
628
|
+
griefingPenaltyBpsPerHour: IntegerLike;
|
|
629
|
+
}
|
|
630
|
+
interface RiskCapacity {
|
|
631
|
+
/** null means this disabled curve does not constrain capacity. */
|
|
632
|
+
griefingCapacity: bigint | null;
|
|
633
|
+
/** null means this disabled curve does not constrain capacity. */
|
|
634
|
+
chargebackCapacity: bigint | null;
|
|
635
|
+
/** null means both curves are disabled and bonded capacity is unbounded. */
|
|
636
|
+
bondedTakingCapacity: bigint | null;
|
|
637
|
+
}
|
|
638
|
+
interface FreeTakeCapacity {
|
|
639
|
+
remainingFreeTakes: bigint;
|
|
640
|
+
freeTakingCapacity: bigint;
|
|
641
|
+
}
|
|
642
|
+
interface GriefingPenalty {
|
|
643
|
+
penalty: bigint;
|
|
644
|
+
effectiveElapsed: bigint;
|
|
645
|
+
}
|
|
646
|
+
declare const RISK_BPS_DENOMINATOR = 10000n;
|
|
647
|
+
declare const RISK_SECONDS_PER_HOUR = 3600n;
|
|
648
|
+
declare const RISK_GRIEFING_DENOMINATOR: bigint;
|
|
649
|
+
/** ceil(A * s * (T - C) / (10_000 * 1 hour)); returns zero when the curve is disabled. */
|
|
650
|
+
declare function calculateMaxGriefingBond(amount: IntegerLike, terms: GriefingTerms): bigint;
|
|
651
|
+
/** ceil(A * r / 10_000); returns zero when chargeback coverage is disabled. */
|
|
652
|
+
declare function calculateChargebackReserve(amount: IntegerLike, reserveBps: IntegerLike): bigint;
|
|
653
|
+
/** max(maxGriefingBond, chargebackReserve), never their sum. */
|
|
654
|
+
declare function calculateRequiredReservation(amount: IntegerLike, terms: GriefingTerms, reserveBps: IntegerLike): bigint;
|
|
655
|
+
/** Capped, upward-rounded time-linear penalty used for cancellation and reconciliation. */
|
|
656
|
+
declare function calculateGriefingPenalty(amount: IntegerLike, createdAt: IntegerLike, cancelledAt: IntegerLike, terms: GriefingTerms): GriefingPenalty;
|
|
657
|
+
/**
|
|
658
|
+
* Inverts the exact rounded reservation curves. A null capacity denotes a disabled constraint.
|
|
659
|
+
* Because ceil(A*n/d) <= S iff A*n <= S*d, each inverse uses floor(S*d/n).
|
|
660
|
+
*/
|
|
661
|
+
declare function calculateBondedTakingCapacity(freeStake: IntegerLike, terms: GriefingTerms, reserveBps: IntegerLike): RiskCapacity;
|
|
662
|
+
/** Computes remaining separate free intents and their aggregate display capacity. */
|
|
663
|
+
declare function calculateFreeTakeCapacity(freeTakeCount: IntegerLike, freeTakesUsed: IntegerLike, freeTakeAmount: IntegerLike): FreeTakeCapacity;
|
|
664
|
+
|
|
662
665
|
/**
|
|
663
666
|
* Ensure a value is 32 bytes hex (0x + 64 nibbles). If ascii, keccak256 by default when hash=true.
|
|
664
667
|
*/
|
|
@@ -847,4 +850,4 @@ declare class ContractError extends ZKP2PError {
|
|
|
847
850
|
constructor(message: string, details?: unknown);
|
|
848
851
|
}
|
|
849
852
|
|
|
850
|
-
export { APIError, ApiAdapterOptions, AttestationServiceIdentityResponse, AttestationServiceSellerCredentialUploadResponse, AttestationServiceSellerVerifyResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, BuyerTeeVerifyPaymentBody, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ContractError, ContractRouter, type ContractRouterConfig, CreateReferralCodeRequest, CreateReferralCodeResponse, CuratorSellerCredentialUploadResponse, CurrencyType, DEFAULT_ORACLE_MAX_STALENESS_SECONDS, ErrorCode, type EscrowContractContext, type EscrowDepositView, type EscrowIntentView, GetDepositBundleParams, GetDepositBundleResponse, GetOrderbookParams, GetOrderbookResponse, GetOrderbookTableResponse, GetOwnerDepositsRequest, GetOwnerDepositsResponse, GetPayeeDetailsRequest, GetPayeeDetailsResponse,
|
|
853
|
+
export { APIError, ApiAdapterOptions, AttestationServiceIdentityResponse, AttestationServiceSellerCredentialUploadResponse, AttestationServiceSellerVerifyResponse, BASE_BUILDER_CODE, BestByPlatformResponse, BuyerTeeSessionMaterialEncryptionInput, BuyerTeeVerifyPaymentBody, CHAINLINK_ORACLE_ADAPTER, CHAINLINK_ORACLE_FEEDS, ContractError, ContractRouter, type ContractRouterConfig, CreateReferralCodeRequest, CreateReferralCodeResponse, CuratorSellerCredentialUploadResponse, CurrencyType, DEFAULT_ORACLE_MAX_STALENESS_SECONDS, ErrorCode, type EscrowContractContext, type EscrowDepositView, type EscrowIntentView, type FreeTakeCapacity, GetDepositBundleParams, GetDepositBundleResponse, GetOrderbookParams, GetOrderbookResponse, GetOrderbookTableResponse, GetOwnerDepositsRequest, GetOwnerDepositsResponse, GetPayeeDetailsRequest, GetPayeeDetailsResponse, GetTakerCapacityRequest, GetTakerCapacityResponse, GetTakerStakeRequest, GetTakerStakeResponse, GoogleOAuthSellerCredentialPlatform, GoogleOAuthSellerCredentialUploadBodyByPlatform, type GriefingPenalty, type GriefingTerms, IdentityAttestationRequestBody, DepositWithRelations as IndexerDepositWithRelations, IntentEntity as IndexerIntent, type IntegerLike, type LogLevel, type MulticallClient, NetworkError, type OracleAdapterOverrides, type OracleKind, type OrchestratorContractContext, PEER_EXTENSION_CHROME_URL, PLATFORM_METADATA, PYTH_CONTRACT_BASE, PYTH_ORACLE_ADAPTER, PYTH_ORACLE_FEEDS, PaymentMethodCatalog, type PeerAuthenticateParams, type PeerBuyerTeePaymentCapture, type PeerBuyerTeePaymentParams, type PeerConnectionStatus, type PeerExtensionApi, type PeerExtensionSdk, type PeerExtensionSdkOptions, type PeerExtensionState, type PeerExtensionWindow, type PeerMetadataCaptureMode, type PeerMetadataMessage, type PeerMetadataMessageCallback, type PeerMetadataProviderConfig, type PeerMetadataRow, type PeerSarCredentialCapture, PostDepositDetailsRequest, PostDepositDetailsResponse, type PythFeedConfig, QuotesBestByPlatformRequest, REFERRAL_SIGNATURE_DOMAIN, REFERRAL_SIGNATURE_TYPES, RISK_BPS_DENOMINATOR, RISK_GRIEFING_DENOMINATOR, RISK_SECONDS_PER_HOUR, RedeemReferralCodeRequest, RedeemReferralCodeResponse, ReferralCodeLookupResponse, ReferralDashboardResponse, ReferralEarningsResponse, ReferralReadRequest, ReferrerFeeConfig, type RiskCapacity, SPREAD_ORACLE_FEEDS, SUPPORTED_CHAIN_IDS, SellerCredentialAttestationRuntime, SellerCredentialBundle, SellerCredentialUploadInput, SellerCredentialUploadPlatform, type SpreadOracleConfig, type SpreadOracleFeedConfig, type SupportedChainId, TOKEN_METADATA, TxOverrides, UpdateReferralCodeRequest, UpdateReferralCodeResponse, UploadSellerCredentialBundleParams, ValidatePayeeDetailsRequest, ValidatePayeeDetailsResponse, ValidationError, ZKP2PError, ZKP2P_ANDROID_REFERRER, ZKP2P_IOS_REFERRER, apiCreateReferralCode, apiCreateSellerCredentialBundle, apiGetDepositBundle, apiGetOrderbook, apiGetOrderbookTable, apiGetOwnerDeposits, apiGetPayeeDetails, apiGetQuotesBestByPlatform, apiGetReferralDashboard, apiGetReferralEarnings, apiGetTakerCapacity, apiGetTakerStake, apiLookupReferralCode, apiPostDepositDetails, apiRedeemReferralCode, apiRequestIdentityAttestation, apiUpdateReferralCode, apiUploadGoogleOAuthSellerCredential, apiUploadSellerCredentialBundle, apiValidatePayeeDetails, apiVerifyBuyerTeePayment, appendAttributionToCalldata, asciiToBytes32, assertValidReferrerFeeConfig, calculateBondedTakingCapacity, calculateChargebackReserve, calculateFreeTakeCapacity, calculateGriefingPenalty, calculateMaxGriefingBond, calculateRequiredReservation, convertDepositsForLiquidity, convertIndexerDepositToEscrowView, convertIndexerIntentsToEscrowViews, createCompositeDepositId, createEncryptedBuyerTeeSessionMaterial, createPeerExtensionSdk, encodePythAdapterConfig, encodeSpreadOracleAdapterConfig, encodeWithAttribution, ensureBytes32, getAttributionDataSuffix, getPeerExtensionState, getSpreadOracleConfig, isPeerExtensionAvailable, isValidReferralCode, isValidReferrerFeeBps, isValidReferrerFeeRecipient, logger, normalizeReferralCode, openPeerExtensionInstallPage, parseReferrerFeeConfig, peerExtensionSdk, referrerFeeConfigToPreciseUnits, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash, sendTransactionWithAttribution, setLogLevel, validateOracleFeedsOnChain };
|