@zkp2p/sdk 0.6.1 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { Z as Zkp2pClient, P as PostDepositDetailsRequest, y as SignalIntentMethodParams, bp as PreparedTransaction, bs as TakerTier, n as GetTakerTierRequest, o as GetTakerTierResponse, F as FulfillIntentMethodParams, cI as SendTransactionFn, cJ as SendBatchFn, cG as DelegationDepositTarget, cH as BatchResult } from './vaultUtils-VAfbA30W.mjs';
2
- export { cE as DelegationRoute, cF as DelegationState, cK as VAULT_ZERO_ADDRESS, cy as ZERO_RATE_MANAGER_ID, cL as asErrorMessage, cM as assertDelegationMethodSupport, cD as classifyDelegationState, cC as getDelegationRoute, cz as isZeroRateManagerId, cA as normalizeRateManagerId, cB as normalizeRegistry } from './vaultUtils-VAfbA30W.mjs';
1
+ import { Z as Zkp2pClient, P as PostDepositDetailsRequest, E as SignalIntentMethodParams, bo as PreparedTransaction, br as TakerTier, p as GetTakerTierRequest, q as GetTakerTierResponse, F as FulfillIntentMethodParams, cI as SendTransactionFn, cJ as SendBatchFn, cG as DelegationDepositTarget, cH as BatchResult } from './vaultUtils-CcJn5Yh6.mjs';
2
+ export { cE as DelegationRoute, cF as DelegationState, cK as VAULT_ZERO_ADDRESS, cy as ZERO_RATE_MANAGER_ID, cL as asErrorMessage, cM as assertDelegationMethodSupport, cD as classifyDelegationState, cC as getDelegationRoute, cz as isZeroRateManagerId, cA as normalizeRateManagerId, cB as normalizeRegistry } from './vaultUtils-CcJn5Yh6.mjs';
3
3
  import { Hash, Address, Hex } from 'viem';
4
4
  import '@zkp2p/indexer-schema';
5
5
  import 'abitype';
package/dist/react.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Z as Zkp2pClient, P as PostDepositDetailsRequest, y as SignalIntentMethodParams, bp as PreparedTransaction, bs as TakerTier, n as GetTakerTierRequest, o as GetTakerTierResponse, F as FulfillIntentMethodParams, cI as SendTransactionFn, cJ as SendBatchFn, cG as DelegationDepositTarget, cH as BatchResult } from './vaultUtils-VAfbA30W.js';
2
- export { cE as DelegationRoute, cF as DelegationState, cK as VAULT_ZERO_ADDRESS, cy as ZERO_RATE_MANAGER_ID, cL as asErrorMessage, cM as assertDelegationMethodSupport, cD as classifyDelegationState, cC as getDelegationRoute, cz as isZeroRateManagerId, cA as normalizeRateManagerId, cB as normalizeRegistry } from './vaultUtils-VAfbA30W.js';
1
+ import { Z as Zkp2pClient, P as PostDepositDetailsRequest, E as SignalIntentMethodParams, bo as PreparedTransaction, br as TakerTier, p as GetTakerTierRequest, q as GetTakerTierResponse, F as FulfillIntentMethodParams, cI as SendTransactionFn, cJ as SendBatchFn, cG as DelegationDepositTarget, cH as BatchResult } from './vaultUtils-CcJn5Yh6.js';
2
+ export { cE as DelegationRoute, cF as DelegationState, cK as VAULT_ZERO_ADDRESS, cy as ZERO_RATE_MANAGER_ID, cL as asErrorMessage, cM as assertDelegationMethodSupport, cD as classifyDelegationState, cC as getDelegationRoute, cz as isZeroRateManagerId, cA as normalizeRateManagerId, cB as normalizeRegistry } from './vaultUtils-CcJn5Yh6.js';
3
3
  import { Hash, Address, Hex } from 'viem';
4
4
  import '@zkp2p/indexer-schema';
5
5
  import 'abitype';
package/dist/react.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { getNextTakerTier, TAKER_TIER_CAPS, asErrorMessage, ZERO_ADDRESS, getDelegationRoute, assertDelegationMethodSupport, prepareClearDelegationTx, normalizeRateManagerId, normalizeRegistry, isZeroRateManagerId, assertAtomicDelegationSwitchSupport, prepareSetDelegationTx } from './chunk-6WAMIVRB.mjs';
2
- export { ZERO_ADDRESS as VAULT_ZERO_ADDRESS, ZERO_RATE_MANAGER_ID, asErrorMessage, assertDelegationMethodSupport, classifyDelegationState, getDelegationRoute, isZeroRateManagerId, normalizeRateManagerId, normalizeRegistry } from './chunk-6WAMIVRB.mjs';
1
+ import { getNextTakerTier, TAKER_TIER_CAPS, asErrorMessage, ZERO_ADDRESS, getDelegationRoute, assertDelegationMethodSupport, prepareClearDelegationTx, normalizeRateManagerId, normalizeRegistry, isZeroRateManagerId, assertAtomicDelegationSwitchSupport, prepareSetDelegationTx } from './chunk-WFDRBAV3.mjs';
2
+ export { ZERO_ADDRESS as VAULT_ZERO_ADDRESS, ZERO_RATE_MANAGER_ID, asErrorMessage, assertDelegationMethodSupport, classifyDelegationState, getDelegationRoute, isZeroRateManagerId, normalizeRateManagerId, normalizeRegistry } from './chunk-WFDRBAV3.mjs';
3
3
  import './chunk-J5LGTIGS.mjs';
4
4
  import { useState, useCallback, useMemo, useEffect } from 'react';
5
5
  import { formatUnits } from 'viem';
@@ -171,6 +171,17 @@ function formatCapFromBaseUnits(baseUnits) {
171
171
  const value = Number(formatUnits(BigInt(baseUnits), 6));
172
172
  return `$${value.toLocaleString()}`;
173
173
  }
174
+ function getCapForDisplay(tier) {
175
+ const platformLimits = tier.platformLimits ?? [];
176
+ if (platformLimits.length === 0) {
177
+ return tier.perIntentCapBaseUnits ?? tier.maxOrderSize;
178
+ }
179
+ const bestCap = platformLimits.filter((limit) => !limit.isLocked && limit.effectiveCap && limit.effectiveCap !== "0").reduce((current, limit) => {
180
+ if (!current) return limit.effectiveCap;
181
+ return BigInt(limit.effectiveCap) > BigInt(current) ? limit.effectiveCap : current;
182
+ }, void 0);
183
+ return bestCap ?? "0";
184
+ }
174
185
  function getTierDisplayInfo(tier) {
175
186
  if (!tier) {
176
187
  return {
@@ -189,7 +200,7 @@ function getTierDisplayInfo(tier) {
189
200
  PRO: "Peer Pro",
190
201
  PLATINUM: "Peer Platinum"
191
202
  };
192
- const capDisplay = formatCapFromBaseUnits(tier.perIntentCapBaseUnits);
203
+ const capDisplay = formatCapFromBaseUnits(getCapForDisplay(tier));
193
204
  return {
194
205
  tierLabel: tierLabels[tier.tier] || tier.tier,
195
206
  capDisplay,