@zkp2p/sdk 0.6.2 → 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/README.md +1 -1
- package/dist/{chunk-6WAMIVRB.mjs → chunk-WFDRBAV3.mjs} +2 -2
- package/dist/chunk-WFDRBAV3.mjs.map +1 -0
- package/dist/index.cjs +9 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +11 -13
- package/dist/index.d.ts +11 -13
- package/dist/index.mjs +8 -17
- package/dist/index.mjs.map +1 -1
- package/dist/react.cjs +12 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.mjs +14 -3
- package/dist/react.mjs.map +1 -1
- package/dist/{vaultUtils-BwY9Z0aR.d.mts → vaultUtils-CcJn5Yh6.d.mts} +32 -22
- package/dist/{vaultUtils-BwY9Z0aR.d.ts → vaultUtils-CcJn5Yh6.d.ts} +32 -22
- package/package.json +1 -1
- package/dist/chunk-6WAMIVRB.mjs.map +0 -1
package/dist/react.cjs
CHANGED
|
@@ -198,6 +198,17 @@ function formatCapFromBaseUnits(baseUnits) {
|
|
|
198
198
|
const value = Number(viem.formatUnits(BigInt(baseUnits), 6));
|
|
199
199
|
return `$${value.toLocaleString()}`;
|
|
200
200
|
}
|
|
201
|
+
function getCapForDisplay(tier) {
|
|
202
|
+
const platformLimits = tier.platformLimits ?? [];
|
|
203
|
+
if (platformLimits.length === 0) {
|
|
204
|
+
return tier.perIntentCapBaseUnits ?? tier.maxOrderSize;
|
|
205
|
+
}
|
|
206
|
+
const bestCap = platformLimits.filter((limit) => !limit.isLocked && limit.effectiveCap && limit.effectiveCap !== "0").reduce((current, limit) => {
|
|
207
|
+
if (!current) return limit.effectiveCap;
|
|
208
|
+
return BigInt(limit.effectiveCap) > BigInt(current) ? limit.effectiveCap : current;
|
|
209
|
+
}, void 0);
|
|
210
|
+
return bestCap ?? "0";
|
|
211
|
+
}
|
|
201
212
|
function getTierDisplayInfo(tier) {
|
|
202
213
|
if (!tier) {
|
|
203
214
|
return {
|
|
@@ -216,7 +227,7 @@ function getTierDisplayInfo(tier) {
|
|
|
216
227
|
PRO: "Peer Pro",
|
|
217
228
|
PLATINUM: "Peer Platinum"
|
|
218
229
|
};
|
|
219
|
-
const capDisplay = formatCapFromBaseUnits(tier
|
|
230
|
+
const capDisplay = formatCapFromBaseUnits(getCapForDisplay(tier));
|
|
220
231
|
return {
|
|
221
232
|
tierLabel: tierLabels[tier.tier] || tier.tier,
|
|
222
233
|
capDisplay,
|