@zkp2p/sdk 0.5.0 → 0.5.4

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.
@@ -0,0 +1,5 @@
1
+ export { enrichPvDepositView, enrichPvIntentView, parseDepositView, parseIntentView } from './chunk-VJ33XYCV.mjs';
2
+ import './chunk-ZFBH4HD7.mjs';
3
+ import './chunk-J5LGTIGS.mjs';
4
+ //# sourceMappingURL=protocolViewerParsers-XN63B2S5.mjs.map
5
+ //# sourceMappingURL=protocolViewerParsers-XN63B2S5.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"protocolViewerParsers-GGSM2243.mjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"protocolViewerParsers-XN63B2S5.mjs"}
package/dist/react.cjs CHANGED
@@ -106,6 +106,33 @@ function useSignalIntent({ client, onSuccess, onError }) {
106
106
  [signalIntent, prepareSignalIntent, isLoading, error, txHash, prepared]
107
107
  );
108
108
  }
109
+
110
+ // src/takerTiers.ts
111
+ var TAKER_TIER_SCHEDULE = [
112
+ { tier: "PLATINUM", perIntentCapUsd: 5e3, minVolumeUsd: 25e3, maxVolumeUsd: Infinity },
113
+ { tier: "PRO", perIntentCapUsd: 2500, minVolumeUsd: 1e4, maxVolumeUsd: 24999 },
114
+ { tier: "PLUS", perIntentCapUsd: 1e3, minVolumeUsd: 2e3, maxVolumeUsd: 9999 },
115
+ { tier: "PEER", perIntentCapUsd: 250, minVolumeUsd: 500, maxVolumeUsd: 1999 },
116
+ { tier: "PEASANT", perIntentCapUsd: 100, minVolumeUsd: 0, maxVolumeUsd: 499 }
117
+ ];
118
+ var TAKER_TIER_ORDER = [
119
+ "PEASANT",
120
+ "PEER",
121
+ "PLUS",
122
+ "PRO",
123
+ "PLATINUM"
124
+ ];
125
+ var TAKER_TIER_CAPS = Object.fromEntries(
126
+ TAKER_TIER_SCHEDULE.map((entry) => [entry.tier, entry.perIntentCapUsd])
127
+ );
128
+ function getNextTakerTier(currentTier) {
129
+ if (!currentTier) return null;
130
+ const index = TAKER_TIER_ORDER.indexOf(currentTier);
131
+ if (index === -1 || index >= TAKER_TIER_ORDER.length - 1) return null;
132
+ return TAKER_TIER_ORDER[index + 1];
133
+ }
134
+
135
+ // src/react/hooks/useGetTakerTier.ts
109
136
  function useGetTakerTier({
110
137
  client,
111
138
  owner,
@@ -160,23 +187,11 @@ function useGetTakerTier({
160
187
  [getTakerTier, takerTier, isLoading, error]
161
188
  );
162
189
  }
163
- var TIER_CAPS = {
164
- PEASANT: 100,
165
- PEER: 500,
166
- PLUS: 5e3,
167
- PRO: 1e4,
168
- PLATINUM: 25e3
169
- };
170
190
  function getNextTierCap(currentTier) {
171
- if (!currentTier) return null;
172
- const tierOrder = ["PEASANT", "PEER", "PLUS", "PRO", "PLATINUM"];
173
- const currentIndex = tierOrder.indexOf(currentTier);
174
- if (currentIndex === -1 || currentIndex >= tierOrder.length - 1) {
175
- return null;
176
- }
177
- const nextTier = tierOrder[currentIndex + 1];
178
- const nextCap = TIER_CAPS[nextTier];
179
- return nextCap ? `$${nextCap.toLocaleString()}` : null;
191
+ const nextTier = getNextTakerTier(currentTier);
192
+ if (!nextTier) return null;
193
+ const nextCap = TAKER_TIER_CAPS[nextTier];
194
+ return nextCap != null ? `$${nextCap.toLocaleString()}` : null;
180
195
  }
181
196
  function formatCapFromBaseUnits(baseUnits) {
182
197
  if (!baseUnits || baseUnits === "") return "$0";