@zkp2p/sdk 0.9.0 → 0.10.0-rc.0

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.
@@ -54,6 +54,8 @@ type V2ContractAddresses = {
54
54
  chainlinkOracleAdapter?: `0x${string}`;
55
55
  /** PythOracleAdapter contract */
56
56
  pythOracleAdapter?: `0x${string}`;
57
+ /** StakeVault contract for taker stake and delegation */
58
+ stakeVault?: `0x${string}`;
57
59
  };
58
60
  /**
59
61
  * Contract ABIs for a specific deployment.
@@ -70,6 +72,7 @@ type V2ContractAbis = {
70
72
  orchestratorRegistry?: Abi;
71
73
  rateManagerRegistry?: Abi;
72
74
  rateManagerController?: Abi;
75
+ stakeVault?: Abi;
73
76
  };
74
77
  /**
75
78
  * Runtime environment: 'production' for mainnet, 'preproduction' for preprod
@@ -145,6 +148,17 @@ declare function getRateManagerContracts(chainId: number, env?: RuntimeEnv): {
145
148
  controller?: Abi;
146
149
  };
147
150
  };
151
+ /**
152
+ * Resolve the user-facing StakeVault contract for a deployment.
153
+ *
154
+ * Throws when the environment has no StakeVault deployment so callers fail
155
+ * closed instead of accidentally targeting another environment.
156
+ */
157
+ declare function getStakeVaultContract(chainId: number, env?: RuntimeEnv): {
158
+ address: `0x${string}`;
159
+ abi: Abi;
160
+ stakeToken: `0x${string}`;
161
+ };
148
162
 
149
163
  /**
150
164
  * Minimal fetch-based GraphQL client for the ZKP2P indexer.
@@ -1555,111 +1569,198 @@ type OrderStats = {
1555
1569
  };
1556
1570
  /** @deprecated No corresponding SDK method; will be removed in 0.8. */
1557
1571
  type DepositIntentStatistics = OrderStats;
1558
- type TakerTierStats = {
1559
- lifetimeSignaledCount: number;
1560
- lifetimeFulfilledCount: number;
1561
- lifetimeManualReleaseCount: number;
1562
- lifetimePruneCount: number;
1563
- totalCancelledVolume: string;
1564
- totalFulfilledVolume: string;
1565
- lockScore: string;
1566
- lockScoreDiluted: string;
1567
- firstSeenAt: string;
1568
- lastIntentAt: string;
1569
- updatedAt: string;
1570
- };
1571
- type TakerTierLevel = 'PEASANT' | 'PEER' | 'PLUS' | 'PRO' | 'PLATINUM';
1572
- type PlatformRiskLevel = 'LOW' | 'MEDIUM_HIGH' | 'HIGH' | 'HIGHEST';
1573
- type PlatformLimit = {
1572
+ type UsdcAmount = {
1573
+ /** USDC base units (6 decimals), stringified integer. */
1574
+ raw: string;
1575
+ /** Display decimal (e.g. "1250" or "0.059792"). */
1576
+ formatted: string;
1577
+ };
1578
+ type TakerStakeAsset = {
1579
+ symbol: 'USDC';
1580
+ decimals: 6;
1581
+ };
1582
+ type TakerDelegation = {
1583
+ /** True when the taker's intents are backed by another owner's stake. */
1584
+ isDelegated: boolean;
1585
+ taker: string;
1586
+ stakeOwner: string;
1587
+ };
1588
+ type TakerStakeBalances = {
1589
+ /** Total USDC held for the stake owner. */
1590
+ stakedUsdc: UsdcAmount;
1591
+ /** Requested for withdrawal; already excluded from reservation eligibility. */
1592
+ pendingWithdrawalUsdc: UsdcAmount;
1593
+ /** Stake remaining after the pending partial removal. */
1594
+ eligibleUsdc: UsdcAmount;
1595
+ /** Authoritative StakeVault reservation total (locked, not spent). */
1596
+ reservedUsdc: UsdcAmount;
1597
+ /** Stake available to support new bonded activity. */
1598
+ freeUsdc: UsdcAmount;
1599
+ };
1600
+ type TakerStakeExit = {
1601
+ exiting: boolean;
1602
+ requestedAt: string | null;
1603
+ availableAt: string | null;
1604
+ };
1605
+ type StakeReservationKind = 'pending_intent' | 'chargeback_coverage';
1606
+ type StakeReservation = {
1607
+ id: string;
1608
+ intentId: string;
1574
1609
  paymentMethodHash: string;
1575
1610
  platformName: string;
1576
- /** Legacy risk category. Current curator cap-grid responses omit this. */
1577
- riskLevel?: PlatformRiskLevel;
1578
- /** Legacy multiplier. Current curator cap-grid responses omit this. */
1579
- capMultiplier?: number;
1580
- effectiveCap: string;
1581
- effectiveCapDisplay: string;
1582
- hasCooldown: boolean;
1583
- cooldownHours: number;
1584
- isLocked: boolean;
1585
- minTierRequired: TakerTierLevel | null;
1586
- /**
1587
- * Whether the rail is chargeback-reversible. Reversible rails backed by a
1588
- * seller-automated-release (SAR) credential are takeable only through Peer
1589
- * Pay, so the intent-sign path rejects them with "peer pay only". Optional:
1590
- * older curator deployments (current prod) omit this field.
1591
- */
1592
- reversible?: boolean;
1593
- };
1594
- type TakerTierVolumeBreakdown = {
1595
- platformName: string;
1611
+ kind: StakeReservationKind;
1612
+ reservedUsdc: UsdcAmount;
1613
+ coverageExpiresAt: string | null;
1614
+ };
1615
+ type StakeReservations = {
1616
+ activeCount: number;
1617
+ /** Aggregate maximum griefing/initial reservations for pending positions. */
1618
+ pendingIntentUsdc: UsdcAmount;
1619
+ /** Active, non-matured post-settlement chargeback coverage. */
1620
+ chargebackCoverageUsdc: UsdcAmount;
1621
+ totalReservedUsdc: UsdcAmount;
1622
+ /**
1623
+ * Forward-compatible per-reservation detail; intentionally empty in the
1624
+ * initial API. `balances.reservedUsdc` stays authoritative — never
1625
+ * reconstruct it from the category aggregates above.
1626
+ */
1627
+ items: StakeReservation[];
1628
+ };
1629
+ type TakerStake = {
1630
+ /** Requested taker address. */
1631
+ owner: string;
1632
+ chainId: number;
1633
+ /** Resolved stake owner; differs from `owner` when stake is delegated. */
1634
+ stakeOwner: string;
1635
+ asset: TakerStakeAsset;
1636
+ delegation: TakerDelegation;
1637
+ balances: TakerStakeBalances;
1638
+ reservations: StakeReservations;
1639
+ exit: TakerStakeExit;
1640
+ source: 'indexer';
1641
+ updatedAt: string | null;
1642
+ };
1643
+ type GetTakerStakeRequest = {
1644
+ owner: string;
1645
+ chainId: number;
1646
+ };
1647
+ type GetTakerStakeResponse = {
1648
+ success: boolean;
1649
+ message: string;
1650
+ responseObject: TakerStake;
1651
+ statusCode?: number;
1652
+ };
1653
+ type CapacityWarningCode = 'ADMISSION_PAUSED' | 'STAKE_RESERVATIONS_PAUSED' | 'STAKE_DEPOSITS_PAUSED' | 'PLATFORM_DISABLED' | 'NO_BONDED_CAPACITY' | 'UNLIMITED_BONDED_CAPACITY' | 'FREE_TAKES_AVAILABLE' | 'FREE_TAKES_EXHAUSTED' | 'PARTIAL_CHARGEBACK_COVERAGE' | 'UNPROTECTED_AFTER_CHARGEBACK_WINDOW' | 'DEFERRED_PAYOUT_AVAILABLE' | 'GRIEFING_BOND_DISABLED' | 'STAKE_EXIT_PENDING' | 'SHARED_STAKE_PORTFOLIO';
1654
+ type CapacityWarningSeverity = 'info' | 'warning' | 'error';
1655
+ type CapacityWarning = {
1656
+ /** Stable machine-readable code; key behavior and analytics off this. */
1657
+ code: CapacityWarningCode;
1658
+ severity: CapacityWarningSeverity;
1659
+ message: string;
1660
+ };
1661
+ /** `amountUsdc: null` only with `unlimited: true` (curve does not constrain). */
1662
+ type CurveTakingCapacity = {
1663
+ amountUsdc: UsdcAmount;
1664
+ unlimited: false;
1665
+ } | {
1666
+ amountUsdc: null;
1667
+ unlimited: true;
1668
+ };
1669
+ type LimitingCurve = 'griefing' | 'chargeback' | 'both' | 'none';
1670
+ type BondedTakingCapacity = {
1671
+ amountUsdc: UsdcAmount;
1672
+ unlimited: false;
1673
+ limitingCurve: LimitingCurve;
1674
+ } | {
1675
+ amountUsdc: null;
1676
+ unlimited: true;
1677
+ limitingCurve: 'none';
1678
+ };
1679
+ type PlatformFreeTakes = {
1680
+ eligible: boolean;
1681
+ configuredCount: number;
1682
+ usedCount: number;
1683
+ remainingCount: number;
1684
+ /** Per-intent maximum for each whole free take. */
1685
+ amountPerTakeUsdc: UsdcAmount;
1686
+ /**
1687
+ * Display total only. Free allowances are separate whole intents; they can
1688
+ * never be combined with each other or with bonded capacity in one intent.
1689
+ */
1690
+ remainingTotalUsdc: UsdcAmount;
1691
+ intentSemantics: 'separate_intents_only';
1692
+ };
1693
+ type PlatformGriefingCapacity = {
1694
+ enabled: boolean;
1695
+ cliffSeconds: string;
1696
+ penaltyBpsPerHour: string;
1697
+ maximumIntentPeriodSeconds: string;
1698
+ maximumBondForOneUsdc: UsdcAmount;
1699
+ takingCapacity: CurveTakingCapacity;
1700
+ };
1701
+ type ChargebackCoverageStatus = 'full' | 'partial' | 'none' | 'not_applicable';
1702
+ type PlatformChargebackCapacity = {
1703
+ chargebackable: boolean;
1704
+ reserveBps: number;
1705
+ riskWindowSeconds: string;
1706
+ deferredPayoutAvailable: boolean;
1707
+ coverage: {
1708
+ status: ChargebackCoverageStatus;
1709
+ protectedBps: number;
1710
+ uncoveredBps: number;
1711
+ afterWindow: 'uncovered';
1712
+ };
1713
+ takingCapacity: CurveTakingCapacity;
1714
+ };
1715
+ type PlatformCapacity = {
1596
1716
  paymentMethodHash: string;
1597
- volumeBaseUnits: string;
1598
- volumeDisplay: string;
1599
- multiplierBps: number;
1600
- weightedVolumeBaseUnits: string;
1601
- weightedVolumeDisplay: string;
1602
- };
1603
- /** How the curator resolved the taker tier (see curator tier engine). */
1604
- type TakerTierSource = 'computed' | 'fallback' | 'override' | 'blocklist';
1605
- type TakerTier = {
1717
+ platformName: string;
1718
+ enabled: boolean;
1719
+ policyVersion: string | null;
1720
+ /**
1721
+ * Platform capacities are alternative views of one shared stake-owner
1722
+ * portfolio. Never sum capacity across platforms.
1723
+ */
1724
+ stakeScope: 'shared_stake_owner_portfolio';
1725
+ stake: TakerStakeBalances;
1726
+ bondedTakingCapacity: BondedTakingCapacity;
1727
+ freeTakes: PlatformFreeTakes;
1728
+ griefing: PlatformGriefingCapacity;
1729
+ chargeback: PlatformChargebackCapacity;
1730
+ warnings: CapacityWarning[];
1731
+ };
1732
+ type TakerOperationalGates = {
1733
+ /** Blocks all new admissions. */
1734
+ admissionPaused: boolean;
1735
+ /** Blocks bonded/deferred admissions; eligible zero-reservation free takes remain. */
1736
+ reservationsPaused: boolean;
1737
+ /** Blocks stake top-ups only; capacity from existing stake stays available. */
1738
+ depositsPaused: boolean;
1739
+ bondedAdmissionGateOpen: boolean;
1740
+ zeroReservationFreeAdmissionGateOpen: boolean;
1741
+ stakeTopUpGateOpen: boolean;
1742
+ };
1743
+ type TakerCapacity = {
1606
1744
  owner: string;
1607
1745
  chainId: number;
1608
- tier: TakerTierLevel;
1609
- /** Legacy base cap. Current curator responses expose enforced caps in platformLimits. */
1610
- perIntentCapBaseUnits?: string;
1611
- /** Legacy formatted base cap. */
1612
- perIntentCapDisplay?: string;
1613
- lastUpdated: string;
1614
- source: TakerTierSource;
1615
- stats: TakerTierStats | null;
1616
- cooldownHours: number;
1617
- cooldownSeconds: number;
1618
- cooldownActive: boolean;
1619
- cooldownRemainingSeconds: number;
1620
- nextIntentAvailableAt: string | null;
1621
- /**
1622
- * Server-authoritative platform cap grid. Use this for enforced caps; do not
1623
- * derive platform caps from top-level tier caps or risk multipliers.
1624
- */
1625
- platformLimits?: PlatformLimit[];
1626
- /**
1627
- * Server-authoritative tier fields (curator PR #461/#463/#478 contract). All
1628
- * optional because the current production deployment still serves the older
1629
- * payload that omits them — read them when present and fall back gracefully.
1630
- * Amounts are USDC base-unit strings (6 decimals).
1631
- */
1632
- /** Base per-intent cap before platform risk multipliers (alias of perIntentCapBaseUnits). */
1633
- maxOrderSize?: string;
1634
- maxOrderSizeDisplay?: string;
1635
- /** Peer Pay volume floor that qualifies the current tier. */
1636
- minVolumeForTier?: string;
1637
- minVolumeForTierDisplay?: string;
1638
- /** Next tier up the volume ladder, or null at the top / off-ladder tiers. */
1639
- nextTier?: TakerTierLevel | null;
1640
- /** Remaining Peer Pay volume to reach `nextTier`. */
1641
- volumeToNextTier?: string | null;
1642
- volumeToNextTierDisplay?: string | null;
1643
- nextTierMaxOrderSize?: string | null;
1644
- nextTierMaxOrderSizeDisplay?: string | null;
1645
- /**
1646
- * Compatibility name retained by curator. Current semantics preserve
1647
- * historical maker tiers through July 1, 2026 UTC, then add forward Peer Pay
1648
- * volume only. Present on deployments with the PR #461/#463 progression
1649
- * contract.
1650
- */
1651
- peerPayVolume?: string;
1652
- /** Auditable tier progression inputs. Current curator may return a synthetic Peer Pay row. */
1653
- volumeBreakdown?: TakerTierVolumeBreakdown[];
1654
- };
1655
- type GetTakerTierRequest = {
1746
+ stakeOwner: string;
1747
+ asset: TakerStakeAsset;
1748
+ delegation: TakerDelegation;
1749
+ stake: TakerStakeBalances;
1750
+ operationalGates: TakerOperationalGates;
1751
+ platforms: PlatformCapacity[];
1752
+ warnings: CapacityWarning[];
1753
+ source: 'indexer';
1754
+ updatedAt: string | null;
1755
+ };
1756
+ type GetTakerCapacityRequest = {
1656
1757
  owner: string;
1657
1758
  chainId: number;
1658
1759
  };
1659
- type GetTakerTierResponse = {
1760
+ type GetTakerCapacityResponse = {
1660
1761
  success: boolean;
1661
1762
  message: string;
1662
- responseObject: TakerTier;
1763
+ responseObject: TakerCapacity;
1663
1764
  statusCode?: number;
1664
1765
  };
1665
1766
  type GetDepositBundleParams = DepositBundleRequest;
@@ -1792,6 +1893,63 @@ type UpdateReferralCodeSignatureOptions$1 = ReferralSignatureOptions$1 & {
1792
1893
  oldCode: string;
1793
1894
  };
1794
1895
 
1896
+ type StakeVaultWriteFunction = 'depositStake' | 'depositStakeFor' | 'requestStakeWithdrawal' | 'cancelStakeWithdrawal' | 'withdrawRequestedStake' | 'requestExit' | 'cancelExit' | 'withdrawStake' | 'setStakeDelegationEnabled' | 'setAllowedStakeOwner' | 'clearStakeOwner';
1897
+ type StakeWriteBase = {
1898
+ txOverrides?: TxOverrides;
1899
+ };
1900
+ type StakeVaultWriteParams = {
1901
+ depositStake: StakeWriteBase & {
1902
+ amount: bigint;
1903
+ };
1904
+ depositStakeFor: StakeWriteBase & {
1905
+ taker: Address;
1906
+ amount: bigint;
1907
+ };
1908
+ requestStakeWithdrawal: StakeWriteBase & {
1909
+ amount: bigint;
1910
+ };
1911
+ cancelStakeWithdrawal: StakeWriteBase;
1912
+ withdrawRequestedStake: StakeWriteBase & {
1913
+ recipient: Address;
1914
+ };
1915
+ requestExit: StakeWriteBase;
1916
+ cancelExit: StakeWriteBase;
1917
+ withdrawStake: StakeWriteBase & {
1918
+ recipient: Address;
1919
+ };
1920
+ setStakeDelegationEnabled: StakeWriteBase & {
1921
+ enabled: boolean;
1922
+ };
1923
+ setAllowedStakeOwner: StakeWriteBase & {
1924
+ stakeOwner: Address;
1925
+ };
1926
+ clearStakeOwner: StakeWriteBase;
1927
+ };
1928
+ type StakeWithdrawalRequest = {
1929
+ amount: bigint;
1930
+ requestedAt: bigint;
1931
+ availableAt: bigint;
1932
+ };
1933
+ type StakeExitRequest = {
1934
+ exiting: boolean;
1935
+ requestedAt: bigint;
1936
+ availableAt: bigint;
1937
+ };
1938
+ type StakeVaultState = {
1939
+ staker: Address;
1940
+ taker: Address;
1941
+ stakeToken: Address;
1942
+ stakeOwner: Address;
1943
+ allowedStakeOwner: Address;
1944
+ delegationEnabled: boolean;
1945
+ staked: bigint;
1946
+ eligible: bigint;
1947
+ reserved: bigint;
1948
+ free: bigint;
1949
+ withdrawal: StakeWithdrawalRequest;
1950
+ exit: StakeExitRequest;
1951
+ };
1952
+
1795
1953
  type PV_ReferralFee = {
1796
1954
  recipient: `0x${string}`;
1797
1955
  fee: bigint;
@@ -2455,6 +2613,10 @@ declare class Zkp2pClient {
2455
2613
  readonly orchestratorRegistryAddress?: Address;
2456
2614
  /** OrchestratorRegistry ABI */
2457
2615
  readonly orchestratorRegistryAbi?: Abi;
2616
+ /** StakeVault address (undefined when staking is not deployed) */
2617
+ readonly stakeVaultAddress?: Address;
2618
+ /** StakeVault ABI */
2619
+ readonly stakeVaultAbi?: Abi;
2458
2620
  /** Base API URL for ZKP2P services */
2459
2621
  readonly baseApiUrl?: string;
2460
2622
  /** Optional internal curator API key (`x-api-key`) for internal seller verification */
@@ -2472,6 +2634,7 @@ declare class Zkp2pClient {
2472
2634
  private readonly _router;
2473
2635
  private readonly _pvReader;
2474
2636
  private readonly _vaultOps;
2637
+ private readonly _stakeOps;
2475
2638
  private readonly _intentOps;
2476
2639
  private readonly _referralOps;
2477
2640
  private _rateManagerInitError?;
@@ -2539,6 +2702,7 @@ declare class Zkp2pClient {
2539
2702
  private prepareResolvedOrchestratorTransaction;
2540
2703
  private prepareContractTransaction;
2541
2704
  private buildContractMethod;
2705
+ private buildStakeVaultMethod;
2542
2706
  private buildEscrowMethod;
2543
2707
  private buildOrchestratorMethod;
2544
2708
  /**
@@ -2841,6 +3005,109 @@ declare class Zkp2pClient {
2841
3005
  hadAllowance: boolean;
2842
3006
  hash?: Hash;
2843
3007
  }>;
3008
+ /**
3009
+ * Return the resolved StakeVault coordinates for advanced wallet, relayer,
3010
+ * or reactive read integrations.
3011
+ */
3012
+ getStakeVaultContract(): {
3013
+ address: Address;
3014
+ abi: Abi;
3015
+ stakeToken: Address;
3016
+ };
3017
+ /**
3018
+ * Ensure the connected wallet has approved enough USDC for StakeVault.
3019
+ * If an approval is submitted, wait for it to confirm before depositing.
3020
+ */
3021
+ ensureStakeAllowance(params: {
3022
+ amount: bigint;
3023
+ maxApprove?: boolean;
3024
+ txOverrides?: TxOverrides;
3025
+ }): Promise<{
3026
+ hadAllowance: boolean;
3027
+ hash?: Hash;
3028
+ }>;
3029
+ /** Deposit USDC stake for the connected taker. */
3030
+ readonly depositStake: PrepareableMethod<{
3031
+ txOverrides?: TxOverrides;
3032
+ } & {
3033
+ amount: bigint;
3034
+ }, `0x${string}`>;
3035
+ /** Deposit USDC stake for a different taker that has enabled delegation. */
3036
+ readonly depositStakeFor: PrepareableMethod<{
3037
+ txOverrides?: TxOverrides;
3038
+ } & {
3039
+ taker: Address;
3040
+ amount: bigint;
3041
+ }, `0x${string}`>;
3042
+ /** Begin a partial stake-withdrawal delay. */
3043
+ readonly requestStakeWithdrawal: PrepareableMethod<{
3044
+ txOverrides?: TxOverrides;
3045
+ } & {
3046
+ amount: bigint;
3047
+ }, `0x${string}`>;
3048
+ /** Cancel the connected staker's pending partial withdrawal. */
3049
+ readonly cancelStakeWithdrawal: PrepareableMethod<{
3050
+ txOverrides?: TxOverrides;
3051
+ }, `0x${string}`>;
3052
+ /** Withdraw a matured partial stake-withdrawal request. */
3053
+ readonly withdrawRequestedStake: PrepareableMethod<{
3054
+ txOverrides?: TxOverrides;
3055
+ } & {
3056
+ recipient: Address;
3057
+ }, `0x${string}`>;
3058
+ /** Begin a full exit, blocking new taking activity for the stake owner. */
3059
+ readonly requestExit: PrepareableMethod<{
3060
+ txOverrides?: TxOverrides;
3061
+ }, `0x${string}`>;
3062
+ /** Cancel a pending full exit. */
3063
+ readonly cancelExit: PrepareableMethod<{
3064
+ txOverrides?: TxOverrides;
3065
+ }, `0x${string}`>;
3066
+ /** Withdraw all stake after a matured, fully settled exit. */
3067
+ readonly withdrawStake: PrepareableMethod<{
3068
+ txOverrides?: TxOverrides;
3069
+ } & {
3070
+ recipient: Address;
3071
+ }, `0x${string}`>;
3072
+ /** Allow or block third-party stake owners for the connected taker. */
3073
+ readonly setStakeDelegationEnabled: PrepareableMethod<{
3074
+ txOverrides?: TxOverrides;
3075
+ } & {
3076
+ enabled: boolean;
3077
+ }, `0x${string}`>;
3078
+ /** Select the stake owner whose portfolio backs the connected taker. */
3079
+ readonly setAllowedStakeOwner: PrepareableMethod<{
3080
+ txOverrides?: TxOverrides;
3081
+ } & {
3082
+ stakeOwner: Address;
3083
+ }, `0x${string}`>;
3084
+ /** Remove the connected taker's selected third-party stake owner. */
3085
+ readonly clearStakeOwner: PrepareableMethod<{
3086
+ txOverrides?: TxOverrides;
3087
+ }, `0x${string}`>;
3088
+ /** Read total stake owned by an address directly from StakeVault. */
3089
+ getStakeBalance(staker: Address): Promise<bigint>;
3090
+ /** Read stake that currently backs taking capacity. */
3091
+ getEligibleStake(staker: Address): Promise<bigint>;
3092
+ /** Read stake reserved against active intents. */
3093
+ getReservedStake(staker: Address): Promise<bigint>;
3094
+ /** Read stake currently available for withdrawal or new reservations. */
3095
+ getFreeStake(staker: Address): Promise<bigint>;
3096
+ /** Resolve the effective stake owner backing a taker. */
3097
+ getStakeOwner(taker: Address): Promise<Address>;
3098
+ /** Read the stake owner explicitly selected by a taker. */
3099
+ getAllowedStakeOwner(taker: Address): Promise<Address>;
3100
+ /** Read whether a taker allows third-party stake delegation. */
3101
+ getStakeDelegationEnabled(taker: Address): Promise<boolean>;
3102
+ /** Read the connected staker's pending partial withdrawal. */
3103
+ getStakeWithdrawalRequest(staker: Address): Promise<StakeWithdrawalRequest>;
3104
+ /** Read the connected staker's pending full exit. */
3105
+ getStakeExitRequest(staker: Address): Promise<StakeExitRequest>;
3106
+ /** Read the complete authoritative StakeVault state needed by a staking UI. */
3107
+ getStakeVaultState(params: {
3108
+ staker: Address;
3109
+ taker?: Address;
3110
+ }): Promise<StakeVaultState>;
2844
3111
  /**
2845
3112
  * Registers payee details with the curator API and returns hashed on-chain IDs.
2846
3113
  *
@@ -3674,18 +3941,36 @@ declare class Zkp2pClient {
3674
3941
  timeoutMs?: number;
3675
3942
  }): Promise<GetBestByPlatformResponse>;
3676
3943
  /**
3677
- * **Supporting Method** - Fetches taker tier information for an address.
3944
+ * **Supporting Method** - Fetches the stake portfolio backing a taker:
3945
+ * staked/pending-withdrawal/eligible/reserved/free balances, reservation
3946
+ * aggregates, delegation, and exit state.
3947
+ *
3948
+ * @param req - Stake request parameters
3949
+ * @param req.owner - Taker address (the resolved stake owner may differ)
3950
+ * @param req.chainId - Chain ID
3951
+ * @param opts - Optional overrides for API URL and timeout
3952
+ * @returns Taker stake response
3953
+ */
3954
+ getTakerStake(req: GetTakerStakeRequest, opts?: {
3955
+ baseApiUrl?: string;
3956
+ timeoutMs?: number;
3957
+ }): Promise<GetTakerStakeResponse>;
3958
+ /**
3959
+ * **Supporting Method** - Fetches per-platform bonded taking capacity, free
3960
+ * takes, curve terms, warnings, and operational gates for a taker's shared
3961
+ * stake portfolio. Platform capacities are alternative views of one shared
3962
+ * balance and must never be summed.
3678
3963
  *
3679
- * @param req - Taker tier request parameters
3680
- * @param req.owner - Taker address
3964
+ * @param req - Capacity request parameters
3965
+ * @param req.owner - Taker address (the resolved stake owner may differ)
3681
3966
  * @param req.chainId - Chain ID
3682
3967
  * @param opts - Optional overrides for API URL and timeout
3683
- * @returns Taker tier response
3968
+ * @returns Taker capacity response
3684
3969
  */
3685
- getTakerTier(req: GetTakerTierRequest, opts?: {
3970
+ getTakerCapacity(req: GetTakerCapacityRequest, opts?: {
3686
3971
  baseApiUrl?: string;
3687
3972
  timeoutMs?: number;
3688
- }): Promise<GetTakerTierResponse>;
3973
+ }): Promise<GetTakerCapacityResponse>;
3689
3974
  /**
3690
3975
  * Fetch a referral dashboard. Pass `address` for a public wallet-keyed read;
3691
3976
  * omit it to use the authenticated caller mode.
@@ -3854,6 +4139,7 @@ declare class Zkp2pClient {
3854
4139
  unifiedPaymentVerifier?: Address;
3855
4140
  rateManagerV1?: Address;
3856
4141
  orchestratorRegistry?: Address;
4142
+ stakeVault?: Address;
3857
4143
  usdc?: Address;
3858
4144
  };
3859
4145
  /**
@@ -3938,4 +4224,4 @@ type SendBatchFn = (txs: Array<{
3938
4224
  value?: bigint;
3939
4225
  }>) => Promise<string>;
3940
4226
 
3941
- export { type RedeemReferralCodeSignatureOptions as $, type AttestationServiceIdentityResponse as A, type BuyerTeeVerifyPaymentBody as B, type CuratorSellerCredentialUploadResponse as C, type DepositWithRelations as D, type GetTakerTierRequest as E, type GetTakerTierResponse as F, type GoogleOAuthSellerCredentialPlatform as G, type GetDepositBundleParams as H, type IntentEntity as I, type GetDepositBundleResponse as J, type GetOrderbookParams as K, type GetOrderbookResponse as L, type GetOrderbookTableResponse as M, type CurrencyType as N, type PaymentMethodCatalog 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 TxOverrides as W, type ReferralBearerWriteOptions as X, type ReferralReadOptions as Y, Zkp2pClient as Z, type ReferralSignatureOptions as _, type IdentityAttestationRequestBody as a, type VenmoGoogleOAuthSellerCredentialUploadBody as a$, type SignalIntentReferralFee as a0, type SignalIntentMethodParams as a1, type FulfillIntentMethodParams as a2, type CancelIntentMethodParams as a3, type UpdateReferralCodeSignatureOptions as a4, type Zkp2pNextOptions as a5, type AuthorizationTokenProvider as a6, type TimeoutConfig as a7, type ActionCallback as a8, type ReferralRedemption as a9, type TokenResponse as aA, type NearbyQuote as aB, type NearbySuggestions as aC, type ApiDeposit as aD, type DepositVerifier as aE, type DepositVerifierCurrency as aF, type DepositStatus$1 as aG, type GetDepositByIdRequest as aH, type GetDepositByIdResponse as aI, type Intent as aJ, type ApiIntentStatus as aK, type GetOwnerIntentsRequest as aL, type GetOwnerIntentsResponse as aM, type GetIntentsByDepositRequest as aN, type GetIntentsByDepositResponse as aO, type GetIntentByHashRequest as aP, type GetIntentByHashResponse as aQ, type RegisterPayeeDetailsRequest as aR, type RegisterPayeeDetailsResponse as aS, type SellerPlatform as aT, type VenmoSessionMaterial as aU, type CashAppSessionMaterial as aV, type WiseSessionMaterial as aW, type WiseProfileInfo as aX, type WiseProfileSelectionRequired as aY, type WiseProfileNotFound as aZ, type PayPalGoogleOAuthSellerCredentialUploadBody as a_, type ReferralSignatureBody as aa, type CreateDepositParams as ab, type CreateDepositConversionRate as ac, type Range as ad, type WithdrawDepositParams as ae, type SignalIntentParams as af, type FulfillIntentParams as ag, type ReleaseFundsToPayerParams as ah, type CancelIntentParams as ai, type BestByPlatformResponseObject as aj, type GetBestByPlatformResponse as ak, type GetBestByPlatformResponseObject as al, type GetPlatformQuote as am, type PlatformQuote as an, type QuoteRequest as ao, type GetNearbyQuote as ap, type GetNearbySuggestions as aq, type GetQuoteResponse as ar, type GetQuoteResponseObject as as, type GetQuoteSingleResponse as at, type QuoteResponse as au, type QuoteResponseObject as av, type QuoteSingleResponse as aw, type QuoteIntentResponse as ax, type QuoteFeesResponse as ay, type FiatResponse as az, type AttestationServiceSellerVerifyResponse as b, type MethodCurrencyEntity as b$, type VenmoCredentialUploadInput as b0, type CashAppCredentialUploadInput as b1, type WiseCredentialUploadInput as b2, type SellerCredentialUploadInputByPlatform as b3, type SellerCiphertextBundle as b4, type SellerSignedCiphertextBundle as b5, type SellerVerifyIntentDetails as b6, type SellerVerifyInput as b7, type SellerProbeInput as b8, type SellerCredentialBundleUpload as b9, type IdentityAttestationOutputFor as bA, type IdentityAttestationParams as bB, type MakerIdentityAttestationRequestBody as bC, type MakerIdentityPlatform as bD, type OnchainCurrency as bE, type DepositVerifierData as bF, type PreparedTransaction as bG, type OrderStats as bH, type DepositIntentStatistics as bI, type TakerTier as bJ, type TakerTierVolumeBreakdown as bK, type TakerTierStats as bL, type TakerTierSource as bM, type PlatformLimit as bN, type PlatformRiskLevel as bO, type OrderbookEntry as bP, type OrderbookTableRow as bQ, IndexerClient as bR, defaultIndexerEndpoint as bS, IndexerDepositService as bT, IndexerRateManagerService as bU, compareEventCursorIdsByRecency as bV, fetchFulfillmentAndPayment as bW, type DepositEntity as bX, type IntentFulfilledEntity as bY, type IntentFulfillmentAmountsEntity as bZ, type DepositPaymentMethodEntity as b_, type SellerCredentialStatusValue as ba, type SellerCredentialStatus as bb, type SellerVerifyProxyBody as bc, type SellerTypedDataField as bd, type SellerTypedDataSpec as be, type SellerPaymentTypedDataValue as bf, type SellerAttestationOutput as bg, type SellerCredentialProbeResponse as bh, type FulfillIntentAttestationResponse as bi, type AttestationServiceSellerCredentialProbeResponse as bj, type BuyerTeePaymentParams as bk, type BuyerTeePaymentProofInput as bl, type BuyerTeeSessionMaterial as bm, type CuratorSellerCredentialStatusResponse as bn, type CuratorSellerVerifyResponse as bo, type RegisteredSellerCredentialPlatform as bp, type UploadSellerCredentialParams as bq, type RegisteredUploadSellerCredentialParams as br, type UploadSellerCredentialOptions as bs, type GetSellerCredentialStatusParams as bt, type UploadPayPalGoogleOAuthSellerCredentialParams as bu, type UploadVenmoGoogleOAuthSellerCredentialParams as bv, type UploadGoogleOAuthSellerCredentialParams as bw, type VerifySellerPaymentParams as bx, type IdentityAttestationActionType as by, type IdentityAttestationOutput as bz, type SellerCredentialUploadInput as c, type SendTransactionFn as c$, type IntentStatus as c0, type RateManagerEntity as c1, type RateManagerRateEntity as c2, type RateManagerDelegationEntity as c3, type ManagerAggregateStatsEntity as c4, type ManagerStatsEntity as c5, type ManagerDailySnapshotEntity as c6, type RateManagerListItem as c7, type RateManagerDetail as c8, type ManualRateUpdateEntity as c9, type CurrencyData as cA, getContracts as cB, getRateManagerContracts as cC, getPaymentMethodsCatalog as cD, getGatingServiceAddress as cE, type RuntimeEnv as cF, parseDepositView as cG, parseIntentView as cH, enrichPvDepositView as cI, enrichPvIntentView as cJ, type PV_DepositView as cK, type PV_Deposit as cL, type PV_PaymentMethodData as cM, type PV_Currency as cN, type PV_ReferralFee as cO, type PV_IntentView as cP, type PV_Intent as cQ, ZERO_RATE_MANAGER_ID as cR, isZeroRateManagerId as cS, normalizeRateManagerId as cT, normalizeRegistry as cU, getDelegationRoute as cV, classifyDelegationState as cW, type DelegationRoute as cX, type DelegationState as cY, type DelegationDepositTarget as cZ, type BatchResult as c_, type OracleConfigUpdateEntity as ca, type DepositFundActivityEntity as cb, type DepositDailySnapshotEntity as cc, type DepositFundActivityType as cd, type DepositFilter as ce, type PaginationOptions as cf, type DepositOrderField as cg, type OrderDirection$1 as ch, type RateManagerFilter as ci, type RateManagerPaginationOptions as cj, type RateManagerDelegationPaginationOptions as ck, type RateManagerOrderField as cl, type OrderDirection as cm, type DeploymentEnv as cn, type FulfillmentRecord as co, type PaymentVerifiedRecord as cp, type FulfillmentAndPaymentResponse as cq, PAYMENT_PLATFORMS as cr, type PaymentPlatformType as cs, Currency as ct, currencyInfo as cu, getCurrencyInfoFromHash as cv, getCurrencyInfoFromCountryCode as cw, getCurrencyCodeFromHash as cx, isSupportedCurrencyHash as cy, mapConversionRatesToOnchainMinRate as cz, type SellerCredentialUploadPlatform as d, type SendBatchFn as d0, ZERO_ADDRESS as d1, asErrorMessage as d2, assertDelegationMethodSupport as d3, type SellerCredentialAttestationRuntime as e, type AttestationServiceSellerCredentialUploadResponse as f, type BuyerTeeSessionMaterialEncryptionInput as g, type CreateReferralCodeRequest as h, type ApiAdapterOptions as i, type CreateReferralCodeResponse as j, type ReferralReadRequest as k, type ReferralDashboardResponse as l, type ReferralEarningsResponse as m, type ReferralCodeLookupResponse as n, type RedeemReferralCodeRequest as o, type RedeemReferralCodeResponse as p, type UpdateReferralCodeRequest as q, type UpdateReferralCodeResponse as r, type GoogleOAuthSellerCredentialUploadBodyByPlatform as s, type BestByPlatformResponse as t, type ValidatePayeeDetailsResponse as u, type PostDepositDetailsResponse as v, type GetPayeeDetailsRequest as w, type GetPayeeDetailsResponse as x, type GetOwnerDepositsRequest as y, type GetOwnerDepositsResponse as z };
4227
+ export { type ReferralSignatureOptions as $, type AttestationServiceIdentityResponse as A, type BuyerTeeVerifyPaymentBody as B, type CuratorSellerCredentialUploadResponse as C, type DepositWithRelations as D, type GetTakerStakeRequest as E, type GetTakerStakeResponse as F, type GoogleOAuthSellerCredentialPlatform as G, type GetTakerCapacityRequest as H, type IntentEntity as I, type GetTakerCapacityResponse as J, type GetDepositBundleParams as K, type GetDepositBundleResponse as L, type GetOrderbookParams as M, type GetOrderbookResponse as N, type GetOrderbookTableResponse as O, type PostDepositDetailsRequest as P, type QuotesBestByPlatformRequest as Q, type ReferrerFeeConfig as R, type SellerCredentialBundle as S, type CurrencyType as T, type UploadSellerCredentialBundleParams as U, type ValidatePayeeDetailsRequest as V, type PaymentMethodCatalog as W, type TxOverrides as X, type ReferralBearerWriteOptions as Y, Zkp2pClient as Z, type ReferralReadOptions as _, type IdentityAttestationRequestBody as a, type CashAppSessionMaterial as a$, type RedeemReferralCodeSignatureOptions as a0, type SignalIntentReferralFee as a1, type SignalIntentMethodParams as a2, type FulfillIntentMethodParams as a3, type CancelIntentMethodParams as a4, type UpdateReferralCodeSignatureOptions as a5, type Zkp2pNextOptions as a6, type StakeExitRequest as a7, type StakeVaultState as a8, type StakeVaultWriteFunction as a9, 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$1 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 VenmoSessionMaterial as a_, type StakeVaultWriteParams as aa, type StakeWithdrawalRequest as ab, type AuthorizationTokenProvider as ac, type TimeoutConfig as ad, type ActionCallback as ae, type ReferralRedemption as af, type ReferralSignatureBody as ag, type CreateDepositParams as ah, type CreateDepositConversionRate as ai, type Range as aj, type WithdrawDepositParams as ak, type SignalIntentParams as al, type FulfillIntentParams as am, type ReleaseFundsToPayerParams as an, type CancelIntentParams as ao, type BestByPlatformResponseObject as ap, type GetBestByPlatformResponse as aq, type GetBestByPlatformResponseObject as ar, type GetPlatformQuote as as, type PlatformQuote as at, type QuoteRequest as au, type GetNearbyQuote as av, type GetNearbySuggestions as aw, type GetQuoteResponse as ax, type GetQuoteResponseObject as ay, type GetQuoteSingleResponse as az, type AttestationServiceSellerVerifyResponse as b, type CurveTakingCapacity as b$, type WiseSessionMaterial as b0, type WiseProfileInfo as b1, type WiseProfileSelectionRequired as b2, type WiseProfileNotFound as b3, type PayPalGoogleOAuthSellerCredentialUploadBody as b4, type VenmoGoogleOAuthSellerCredentialUploadBody as b5, type VenmoCredentialUploadInput as b6, type CashAppCredentialUploadInput as b7, type WiseCredentialUploadInput as b8, type SellerCredentialUploadInputByPlatform as b9, type UploadPayPalGoogleOAuthSellerCredentialParams as bA, type UploadVenmoGoogleOAuthSellerCredentialParams as bB, type UploadGoogleOAuthSellerCredentialParams as bC, type VerifySellerPaymentParams as bD, type IdentityAttestationActionType as bE, type IdentityAttestationOutput as bF, type IdentityAttestationOutputFor as bG, type IdentityAttestationParams as bH, type MakerIdentityAttestationRequestBody as bI, type MakerIdentityPlatform as bJ, type OnchainCurrency as bK, type DepositVerifierData as bL, type PreparedTransaction as bM, type OrderStats as bN, type DepositIntentStatistics as bO, type UsdcAmount as bP, type TakerStakeAsset as bQ, type TakerDelegation as bR, type TakerStakeBalances as bS, type TakerStakeExit as bT, type StakeReservationKind as bU, type StakeReservation as bV, type StakeReservations as bW, type TakerStake as bX, type CapacityWarningCode as bY, type CapacityWarningSeverity as bZ, type CapacityWarning as b_, type SellerCiphertextBundle as ba, type SellerSignedCiphertextBundle as bb, type SellerVerifyIntentDetails as bc, type SellerVerifyInput as bd, type SellerProbeInput as be, type SellerCredentialBundleUpload as bf, type SellerCredentialStatusValue as bg, type SellerCredentialStatus as bh, type SellerVerifyProxyBody as bi, type SellerTypedDataField as bj, type SellerTypedDataSpec as bk, type SellerPaymentTypedDataValue as bl, type SellerAttestationOutput as bm, type SellerCredentialProbeResponse as bn, type FulfillIntentAttestationResponse as bo, type AttestationServiceSellerCredentialProbeResponse as bp, type BuyerTeePaymentParams as bq, type BuyerTeePaymentProofInput as br, type BuyerTeeSessionMaterial as bs, type CuratorSellerCredentialStatusResponse as bt, type CuratorSellerVerifyResponse as bu, type RegisteredSellerCredentialPlatform as bv, type UploadSellerCredentialParams as bw, type RegisteredUploadSellerCredentialParams as bx, type UploadSellerCredentialOptions as by, type GetSellerCredentialStatusParams as bz, type SellerCredentialUploadInput as c, getGatingServiceAddress as c$, type LimitingCurve as c0, type BondedTakingCapacity as c1, type PlatformFreeTakes as c2, type PlatformGriefingCapacity as c3, type ChargebackCoverageStatus as c4, type PlatformChargebackCapacity as c5, type PlatformCapacity as c6, type TakerOperationalGates as c7, type TakerCapacity as c8, type OrderbookEntry as c9, type DepositFilter as cA, type PaginationOptions as cB, type DepositOrderField as cC, type OrderDirection$1 as cD, type RateManagerFilter as cE, type RateManagerPaginationOptions as cF, type RateManagerDelegationPaginationOptions as cG, type RateManagerOrderField as cH, type OrderDirection as cI, type DeploymentEnv as cJ, type FulfillmentRecord as cK, type PaymentVerifiedRecord as cL, type FulfillmentAndPaymentResponse as cM, PAYMENT_PLATFORMS as cN, type PaymentPlatformType as cO, Currency as cP, currencyInfo as cQ, getCurrencyInfoFromHash as cR, getCurrencyInfoFromCountryCode as cS, getCurrencyCodeFromHash as cT, isSupportedCurrencyHash as cU, mapConversionRatesToOnchainMinRate as cV, type CurrencyData as cW, getContracts as cX, getRateManagerContracts as cY, getStakeVaultContract as cZ, getPaymentMethodsCatalog as c_, type OrderbookTableRow as ca, IndexerClient as cb, defaultIndexerEndpoint as cc, IndexerDepositService as cd, IndexerRateManagerService as ce, compareEventCursorIdsByRecency as cf, fetchFulfillmentAndPayment as cg, type DepositEntity as ch, type IntentFulfilledEntity as ci, type IntentFulfillmentAmountsEntity as cj, type DepositPaymentMethodEntity as ck, type MethodCurrencyEntity as cl, type IntentStatus as cm, type RateManagerEntity as cn, type RateManagerRateEntity as co, type RateManagerDelegationEntity as cp, type ManagerAggregateStatsEntity as cq, type ManagerStatsEntity as cr, type ManagerDailySnapshotEntity as cs, type RateManagerListItem as ct, type RateManagerDetail as cu, type ManualRateUpdateEntity as cv, type OracleConfigUpdateEntity as cw, type DepositFundActivityEntity as cx, type DepositDailySnapshotEntity as cy, type DepositFundActivityType as cz, type SellerCredentialUploadPlatform as d, type RuntimeEnv as d0, type V2ContractAddresses as d1, type V2ContractAbis as d2, parseDepositView as d3, parseIntentView as d4, enrichPvDepositView as d5, enrichPvIntentView as d6, type PV_DepositView as d7, type PV_Deposit as d8, type PV_PaymentMethodData as d9, type PV_Currency as da, type PV_ReferralFee as db, type PV_IntentView as dc, type PV_Intent as dd, ZERO_RATE_MANAGER_ID as de, isZeroRateManagerId as df, normalizeRateManagerId as dg, normalizeRegistry as dh, getDelegationRoute as di, classifyDelegationState as dj, type DelegationRoute as dk, type DelegationState as dl, type DelegationDepositTarget as dm, type BatchResult as dn, type SendTransactionFn as dp, type SendBatchFn as dq, ZERO_ADDRESS as dr, asErrorMessage as ds, assertDelegationMethodSupport as dt, type SellerCredentialAttestationRuntime as e, type AttestationServiceSellerCredentialUploadResponse as f, type BuyerTeeSessionMaterialEncryptionInput as g, type CreateReferralCodeRequest as h, type ApiAdapterOptions as i, type CreateReferralCodeResponse as j, type ReferralReadRequest as k, type ReferralDashboardResponse as l, type ReferralEarningsResponse as m, type ReferralCodeLookupResponse as n, type RedeemReferralCodeRequest as o, type RedeemReferralCodeResponse as p, type UpdateReferralCodeRequest as q, type UpdateReferralCodeResponse as r, type GoogleOAuthSellerCredentialUploadBodyByPlatform as s, type BestByPlatformResponse as t, type ValidatePayeeDetailsResponse as u, type PostDepositDetailsResponse as v, type GetPayeeDetailsRequest as w, type GetPayeeDetailsResponse as x, type GetOwnerDepositsRequest as y, type GetOwnerDepositsResponse as z };