@agg-build/hooks 1.0.1 → 1.0.2
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/{chunk-PALQVBAQ.mjs → chunk-EB64HHYM.mjs} +1 -1
- package/dist/{chunk-QXBQRWFF.mjs → chunk-NOYHQUW2.mjs} +2 -2
- package/dist/{chunk-BWXNOWAS.mjs → chunk-V6VNA7MX.mjs} +6 -2
- package/dist/deposit.js +6 -2
- package/dist/deposit.mjs +2 -2
- package/dist/index.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +26 -13
- package/dist/index.mjs +22 -13
- package/dist/withdraw.js +7 -3
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
useOnWithdrawalLifecycle,
|
|
11
11
|
useSyncBalances,
|
|
12
12
|
useWithdrawManaged
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-V6VNA7MX.mjs";
|
|
14
14
|
|
|
15
15
|
// src/withdraw/use-withdraw-flow.ts
|
|
16
16
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
@@ -69,7 +69,7 @@ var parseTokenAmountToRaw = (amount, decimals) => {
|
|
|
69
69
|
return null;
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
|
-
var shortenAddress = (address) => address.length > 12 ? `${address.slice(0, 6)}
|
|
72
|
+
var shortenAddress = (address) => address.length > 12 ? `${address.slice(0, 6)}...${address.slice(-4)}` : address;
|
|
73
73
|
function useWithdrawFlow(options) {
|
|
74
74
|
var _a, _b;
|
|
75
75
|
const { open, onOpenChange } = options;
|
|
@@ -478,6 +478,7 @@ var enUsLabels = {
|
|
|
478
478
|
},
|
|
479
479
|
eventList: {
|
|
480
480
|
matchedTab: "Matched",
|
|
481
|
+
allTab: "All",
|
|
481
482
|
loading: (title) => `Loading ${title}`,
|
|
482
483
|
tabsAria: (title) => `${title} tabs`,
|
|
483
484
|
emptyAria: "No events found",
|
|
@@ -606,6 +607,8 @@ var enUsLabels = {
|
|
|
606
607
|
settlementDescriptionLabel: "Description",
|
|
607
608
|
settlementRulesPrimaryLabel: "Resolution rules",
|
|
608
609
|
settlementRulesSecondaryLabel: "Additional rules",
|
|
610
|
+
settlementPrimaryRulesLabel: "Resolution rules",
|
|
611
|
+
settlementEmpty: "No settlement details available.",
|
|
609
612
|
disclaimer: "By trading, you agree to the Terms of Use of each exchange.",
|
|
610
613
|
geoBlockTermsLink: "Terms of Use",
|
|
611
614
|
geoBlockGenericMessage: "Trading is not available in your region. See ",
|
|
@@ -624,6 +627,7 @@ var enUsLabels = {
|
|
|
624
627
|
minimumFractionDigits: Number.isInteger(value) ? 0 : 2,
|
|
625
628
|
maximumFractionDigits: 6
|
|
626
629
|
})} shares`,
|
|
630
|
+
maxShares: "Max",
|
|
627
631
|
slippage: (value) => `Slippage: ${value}%`,
|
|
628
632
|
editSlippage: (value) => `Edit ${value}`,
|
|
629
633
|
collapseSlippage: (value) => `Collapse ${value}`,
|
|
@@ -670,7 +674,8 @@ var enUsLabels = {
|
|
|
670
674
|
insufficientPositionGeneric: "You don't have enough shares to sell.",
|
|
671
675
|
insufficientSellDepth: "Not enough bid liquidity on the matched venues for this sell amount.",
|
|
672
676
|
noBidsAboveMinPrice: "No venue bids above the minimum price.",
|
|
673
|
-
|
|
677
|
+
signInToTrade: "Sign in to trade",
|
|
678
|
+
deposit: "Deposit",
|
|
674
679
|
kycRequired: "Verify to trade Kalshi",
|
|
675
680
|
kycNotVerifiedTooltip: "You have not been verified yet",
|
|
676
681
|
kycVerifyModalTitle: "Verify Your Identity",
|
|
@@ -685,7 +690,6 @@ var enUsLabels = {
|
|
|
685
690
|
orderSplitting: "Order Splitting",
|
|
686
691
|
splitOrderDescription: "We split your order for the best price:",
|
|
687
692
|
viewAllRoutes: (count) => `View all (${count})`,
|
|
688
|
-
hideRoutes: "Hide routes",
|
|
689
693
|
venueUnavailableInRegion: "Unavailable in your region",
|
|
690
694
|
toWin: (tab) => tab === "buy" ? "To win" : "Payout",
|
|
691
695
|
buyingOutcome: (label) => `Buying ${label}`,
|
package/dist/deposit.js
CHANGED
|
@@ -384,6 +384,7 @@ var enUsLabels = {
|
|
|
384
384
|
},
|
|
385
385
|
eventList: {
|
|
386
386
|
matchedTab: "Matched",
|
|
387
|
+
allTab: "All",
|
|
387
388
|
loading: (title) => `Loading ${title}`,
|
|
388
389
|
tabsAria: (title) => `${title} tabs`,
|
|
389
390
|
emptyAria: "No events found",
|
|
@@ -512,6 +513,8 @@ var enUsLabels = {
|
|
|
512
513
|
settlementDescriptionLabel: "Description",
|
|
513
514
|
settlementRulesPrimaryLabel: "Resolution rules",
|
|
514
515
|
settlementRulesSecondaryLabel: "Additional rules",
|
|
516
|
+
settlementPrimaryRulesLabel: "Resolution rules",
|
|
517
|
+
settlementEmpty: "No settlement details available.",
|
|
515
518
|
disclaimer: "By trading, you agree to the Terms of Use of each exchange.",
|
|
516
519
|
geoBlockTermsLink: "Terms of Use",
|
|
517
520
|
geoBlockGenericMessage: "Trading is not available in your region. See ",
|
|
@@ -530,6 +533,7 @@ var enUsLabels = {
|
|
|
530
533
|
minimumFractionDigits: Number.isInteger(value) ? 0 : 2,
|
|
531
534
|
maximumFractionDigits: 6
|
|
532
535
|
})} shares`,
|
|
536
|
+
maxShares: "Max",
|
|
533
537
|
slippage: (value) => `Slippage: ${value}%`,
|
|
534
538
|
editSlippage: (value) => `Edit ${value}`,
|
|
535
539
|
collapseSlippage: (value) => `Collapse ${value}`,
|
|
@@ -576,7 +580,8 @@ var enUsLabels = {
|
|
|
576
580
|
insufficientPositionGeneric: "You don't have enough shares to sell.",
|
|
577
581
|
insufficientSellDepth: "Not enough bid liquidity on the matched venues for this sell amount.",
|
|
578
582
|
noBidsAboveMinPrice: "No venue bids above the minimum price.",
|
|
579
|
-
|
|
583
|
+
signInToTrade: "Sign in to trade",
|
|
584
|
+
deposit: "Deposit",
|
|
580
585
|
kycRequired: "Verify to trade Kalshi",
|
|
581
586
|
kycNotVerifiedTooltip: "You have not been verified yet",
|
|
582
587
|
kycVerifyModalTitle: "Verify Your Identity",
|
|
@@ -591,7 +596,6 @@ var enUsLabels = {
|
|
|
591
596
|
orderSplitting: "Order Splitting",
|
|
592
597
|
splitOrderDescription: "We split your order for the best price:",
|
|
593
598
|
viewAllRoutes: (count) => `View all (${count})`,
|
|
594
|
-
hideRoutes: "Hide routes",
|
|
595
599
|
venueUnavailableInRegion: "Unavailable in your region",
|
|
596
600
|
toWin: (tab) => tab === "buy" ? "To win" : "Payout",
|
|
597
601
|
buyingOutcome: (label) => `Buying ${label}`,
|
package/dist/deposit.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useRampQuotes,
|
|
3
3
|
useRampSession
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-EB64HHYM.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__async,
|
|
7
7
|
getWalletAddressFromUserProfile,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
useAggUiConfig,
|
|
11
11
|
useDepositAddresses,
|
|
12
12
|
useSyncBalances
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-V6VNA7MX.mjs";
|
|
14
14
|
|
|
15
15
|
// src/deposit/normalize-wallet-error.ts
|
|
16
16
|
function normalizeWalletError(error, supportedChains) {
|
package/dist/index.d.mts
CHANGED
|
@@ -608,6 +608,7 @@ interface AggUiLabels {
|
|
|
608
608
|
};
|
|
609
609
|
eventList: {
|
|
610
610
|
matchedTab: string;
|
|
611
|
+
allTab: string;
|
|
611
612
|
loading: (title: string) => string;
|
|
612
613
|
tabsAria: (title: string) => string;
|
|
613
614
|
emptyAria: string;
|
|
@@ -736,6 +737,8 @@ interface AggUiLabels {
|
|
|
736
737
|
settlementDescriptionLabel: string;
|
|
737
738
|
settlementRulesPrimaryLabel: string;
|
|
738
739
|
settlementRulesSecondaryLabel: string;
|
|
740
|
+
settlementPrimaryRulesLabel: string;
|
|
741
|
+
settlementEmpty: string;
|
|
739
742
|
disclaimer: string;
|
|
740
743
|
geoBlockTermsLink: string;
|
|
741
744
|
geoBlockGenericMessage: string;
|
|
@@ -748,6 +751,7 @@ interface AggUiLabels {
|
|
|
748
751
|
averagePrice: (value: number) => string;
|
|
749
752
|
balance: (value: string) => string;
|
|
750
753
|
shares: (value: number) => string;
|
|
754
|
+
maxShares: string;
|
|
751
755
|
slippage: (value: number) => string;
|
|
752
756
|
editSlippage: (value: string) => string;
|
|
753
757
|
collapseSlippage: (value: string) => string;
|
|
@@ -794,7 +798,8 @@ interface AggUiLabels {
|
|
|
794
798
|
insufficientPositionGeneric: string;
|
|
795
799
|
insufficientSellDepth: string;
|
|
796
800
|
noBidsAboveMinPrice: string;
|
|
797
|
-
|
|
801
|
+
signInToTrade: string;
|
|
802
|
+
deposit: string;
|
|
798
803
|
kycRequired: string;
|
|
799
804
|
kycNotVerifiedTooltip: string;
|
|
800
805
|
kycVerifyModalTitle: string;
|
|
@@ -809,7 +814,6 @@ interface AggUiLabels {
|
|
|
809
814
|
orderSplitting: string;
|
|
810
815
|
splitOrderDescription: string;
|
|
811
816
|
viewAllRoutes: (count: number) => string;
|
|
812
|
-
hideRoutes: string;
|
|
813
817
|
venueUnavailableInRegion: string;
|
|
814
818
|
toWin: (tab: "buy" | "sell") => string;
|
|
815
819
|
buyingOutcome: (label: string) => string;
|
package/dist/index.d.ts
CHANGED
|
@@ -608,6 +608,7 @@ interface AggUiLabels {
|
|
|
608
608
|
};
|
|
609
609
|
eventList: {
|
|
610
610
|
matchedTab: string;
|
|
611
|
+
allTab: string;
|
|
611
612
|
loading: (title: string) => string;
|
|
612
613
|
tabsAria: (title: string) => string;
|
|
613
614
|
emptyAria: string;
|
|
@@ -736,6 +737,8 @@ interface AggUiLabels {
|
|
|
736
737
|
settlementDescriptionLabel: string;
|
|
737
738
|
settlementRulesPrimaryLabel: string;
|
|
738
739
|
settlementRulesSecondaryLabel: string;
|
|
740
|
+
settlementPrimaryRulesLabel: string;
|
|
741
|
+
settlementEmpty: string;
|
|
739
742
|
disclaimer: string;
|
|
740
743
|
geoBlockTermsLink: string;
|
|
741
744
|
geoBlockGenericMessage: string;
|
|
@@ -748,6 +751,7 @@ interface AggUiLabels {
|
|
|
748
751
|
averagePrice: (value: number) => string;
|
|
749
752
|
balance: (value: string) => string;
|
|
750
753
|
shares: (value: number) => string;
|
|
754
|
+
maxShares: string;
|
|
751
755
|
slippage: (value: number) => string;
|
|
752
756
|
editSlippage: (value: string) => string;
|
|
753
757
|
collapseSlippage: (value: string) => string;
|
|
@@ -794,7 +798,8 @@ interface AggUiLabels {
|
|
|
794
798
|
insufficientPositionGeneric: string;
|
|
795
799
|
insufficientSellDepth: string;
|
|
796
800
|
noBidsAboveMinPrice: string;
|
|
797
|
-
|
|
801
|
+
signInToTrade: string;
|
|
802
|
+
deposit: string;
|
|
798
803
|
kycRequired: string;
|
|
799
804
|
kycNotVerifiedTooltip: string;
|
|
800
805
|
kycVerifyModalTitle: string;
|
|
@@ -809,7 +814,6 @@ interface AggUiLabels {
|
|
|
809
814
|
orderSplitting: string;
|
|
810
815
|
splitOrderDescription: string;
|
|
811
816
|
viewAllRoutes: (count: number) => string;
|
|
812
|
-
hideRoutes: string;
|
|
813
817
|
venueUnavailableInRegion: string;
|
|
814
818
|
toWin: (tab: "buy" | "sell") => string;
|
|
815
819
|
buyingOutcome: (label: string) => string;
|
package/dist/index.js
CHANGED
|
@@ -756,6 +756,7 @@ var enUsLabels = {
|
|
|
756
756
|
},
|
|
757
757
|
eventList: {
|
|
758
758
|
matchedTab: "Matched",
|
|
759
|
+
allTab: "All",
|
|
759
760
|
loading: (title) => `Loading ${title}`,
|
|
760
761
|
tabsAria: (title) => `${title} tabs`,
|
|
761
762
|
emptyAria: "No events found",
|
|
@@ -884,6 +885,8 @@ var enUsLabels = {
|
|
|
884
885
|
settlementDescriptionLabel: "Description",
|
|
885
886
|
settlementRulesPrimaryLabel: "Resolution rules",
|
|
886
887
|
settlementRulesSecondaryLabel: "Additional rules",
|
|
888
|
+
settlementPrimaryRulesLabel: "Resolution rules",
|
|
889
|
+
settlementEmpty: "No settlement details available.",
|
|
887
890
|
disclaimer: "By trading, you agree to the Terms of Use of each exchange.",
|
|
888
891
|
geoBlockTermsLink: "Terms of Use",
|
|
889
892
|
geoBlockGenericMessage: "Trading is not available in your region. See ",
|
|
@@ -902,6 +905,7 @@ var enUsLabels = {
|
|
|
902
905
|
minimumFractionDigits: Number.isInteger(value) ? 0 : 2,
|
|
903
906
|
maximumFractionDigits: 6
|
|
904
907
|
})} shares`,
|
|
908
|
+
maxShares: "Max",
|
|
905
909
|
slippage: (value) => `Slippage: ${value}%`,
|
|
906
910
|
editSlippage: (value) => `Edit ${value}`,
|
|
907
911
|
collapseSlippage: (value) => `Collapse ${value}`,
|
|
@@ -948,7 +952,8 @@ var enUsLabels = {
|
|
|
948
952
|
insufficientPositionGeneric: "You don't have enough shares to sell.",
|
|
949
953
|
insufficientSellDepth: "Not enough bid liquidity on the matched venues for this sell amount.",
|
|
950
954
|
noBidsAboveMinPrice: "No venue bids above the minimum price.",
|
|
951
|
-
|
|
955
|
+
signInToTrade: "Sign in to trade",
|
|
956
|
+
deposit: "Deposit",
|
|
952
957
|
kycRequired: "Verify to trade Kalshi",
|
|
953
958
|
kycNotVerifiedTooltip: "You have not been verified yet",
|
|
954
959
|
kycVerifyModalTitle: "Verify Your Identity",
|
|
@@ -963,7 +968,6 @@ var enUsLabels = {
|
|
|
963
968
|
orderSplitting: "Order Splitting",
|
|
964
969
|
splitOrderDescription: "We split your order for the best price:",
|
|
965
970
|
viewAllRoutes: (count) => `View all (${count})`,
|
|
966
|
-
hideRoutes: "Hide routes",
|
|
967
971
|
venueUnavailableInRegion: "Unavailable in your region",
|
|
968
972
|
toWin: (tab) => tab === "buy" ? "To win" : "Payout",
|
|
969
973
|
buyingOutcome: (label) => `Buying ${label}`,
|
|
@@ -3793,7 +3797,7 @@ var parseTokenAmountToRaw = (amount, decimals) => {
|
|
|
3793
3797
|
return null;
|
|
3794
3798
|
}
|
|
3795
3799
|
};
|
|
3796
|
-
var shortenAddress = (address) => address.length > 12 ? `${address.slice(0, 6)}
|
|
3800
|
+
var shortenAddress = (address) => address.length > 12 ? `${address.slice(0, 6)}...${address.slice(-4)}` : address;
|
|
3797
3801
|
function useWithdrawFlow(options) {
|
|
3798
3802
|
var _a, _b;
|
|
3799
3803
|
const { open, onOpenChange } = options;
|
|
@@ -5767,6 +5771,12 @@ function computePriceGaps(input) {
|
|
|
5767
5771
|
|
|
5768
5772
|
// src/use-viewport-midpoints.ts
|
|
5769
5773
|
var import_react29 = require("react");
|
|
5774
|
+
var normalizeOutcomeLabel = (value) => value.trim().toLowerCase();
|
|
5775
|
+
var resolveYesMidpoint = (outcomes) => {
|
|
5776
|
+
if (!(outcomes == null ? void 0 : outcomes.length)) return void 0;
|
|
5777
|
+
const yesOutcome = outcomes.find((outcome) => normalizeOutcomeLabel(outcome.label) === "yes");
|
|
5778
|
+
return yesOutcome == null ? void 0 : yesOutcome.midpoint;
|
|
5779
|
+
};
|
|
5770
5780
|
var resolveUncachedVisibleMarketIds = (visibleMarkets, cache, inFlightIds) => {
|
|
5771
5781
|
const idsToFetch = [];
|
|
5772
5782
|
for (const market of visibleMarkets) {
|
|
@@ -5782,8 +5792,9 @@ var buildCachedMidpointEntries = (requestedVenueMarketIds, rows) => {
|
|
|
5782
5792
|
const nextCacheEntries = /* @__PURE__ */ new Map();
|
|
5783
5793
|
for (const venueMarketId of requestedVenueMarketIds) {
|
|
5784
5794
|
const item = rowsByVenueMarketId.get(venueMarketId);
|
|
5785
|
-
|
|
5786
|
-
|
|
5795
|
+
const yesMidpoint = resolveYesMidpoint(item == null ? void 0 : item.outcomes);
|
|
5796
|
+
nextCacheEntries.set(venueMarketId, __spreadProps(__spreadValues({}, (item == null ? void 0 : item.venue) ? { venue: item.venue } : {}), {
|
|
5797
|
+
midpoint: (_a = yesMidpoint != null ? yesMidpoint : item == null ? void 0 : item.midpoint) != null ? _a : null,
|
|
5787
5798
|
spread: (_b = item == null ? void 0 : item.spread) != null ? _b : null,
|
|
5788
5799
|
matched: ((_c = item == null ? void 0 : item.matched) != null ? _c : []).map((matched) => {
|
|
5789
5800
|
var _a2, _b2;
|
|
@@ -5793,7 +5804,7 @@ var buildCachedMidpointEntries = (requestedVenueMarketIds, rows) => {
|
|
|
5793
5804
|
spread: (_b2 = matched.spread) != null ? _b2 : null
|
|
5794
5805
|
}, matched.venue ? { venue: matched.venue } : {});
|
|
5795
5806
|
})
|
|
5796
|
-
});
|
|
5807
|
+
}));
|
|
5797
5808
|
}
|
|
5798
5809
|
return nextCacheEntries;
|
|
5799
5810
|
};
|
|
@@ -5832,24 +5843,26 @@ function useViewportMidpoints(visibleMarkets) {
|
|
|
5832
5843
|
};
|
|
5833
5844
|
}, [visibleFp, cache]);
|
|
5834
5845
|
const { prices, venueByOutcomeId } = (0, import_react29.useMemo)(() => {
|
|
5835
|
-
var _a, _b;
|
|
5846
|
+
var _a, _b, _c, _d, _e, _f;
|
|
5836
5847
|
const map = /* @__PURE__ */ new Map();
|
|
5837
5848
|
const venueMap = /* @__PURE__ */ new Map();
|
|
5838
5849
|
for (const market of visibleMarkets) {
|
|
5839
5850
|
const entry = cache.get(market.id);
|
|
5840
5851
|
if (!entry) continue;
|
|
5841
5852
|
let mid = entry.midpoint;
|
|
5842
|
-
let midVenue = market.venue;
|
|
5853
|
+
let midVenue = (_a = entry.venue) != null ? _a : market.venue;
|
|
5843
5854
|
for (const m of entry.matched) {
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5855
|
+
const matchedFromCache = (_b = cache.get(m.venueMarketId)) == null ? void 0 : _b.midpoint;
|
|
5856
|
+
const candidateMidpoint = matchedFromCache != null ? matchedFromCache : m.midpoint;
|
|
5857
|
+
if (candidateMidpoint == null) continue;
|
|
5858
|
+
if (mid == null || candidateMidpoint < mid) {
|
|
5859
|
+
mid = candidateMidpoint;
|
|
5860
|
+
midVenue = (_e = (_d = (_c = cache.get(m.venueMarketId)) == null ? void 0 : _c.venue) != null ? _d : m.venue) != null ? _e : market.venue;
|
|
5848
5861
|
}
|
|
5849
5862
|
}
|
|
5850
5863
|
if (mid == null) continue;
|
|
5851
5864
|
for (const outcome of market.venueMarketOutcomes) {
|
|
5852
|
-
const isYes = ((
|
|
5865
|
+
const isYes = ((_f = outcome.label) == null ? void 0 : _f.toLowerCase()) === "yes";
|
|
5853
5866
|
map.set(outcome.id, isYes ? mid : 1 - mid);
|
|
5854
5867
|
venueMap.set(outcome.id, midVenue);
|
|
5855
5868
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useRampQuotes,
|
|
3
3
|
useRampSession
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-EB64HHYM.mjs";
|
|
5
5
|
import {
|
|
6
6
|
useWithdrawFlow,
|
|
7
7
|
useWithdrawalLifecycle
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NOYHQUW2.mjs";
|
|
9
9
|
import {
|
|
10
10
|
AggAuthContext,
|
|
11
11
|
AggBalanceProvider,
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
useSdkUiConfig,
|
|
83
83
|
useSyncBalances,
|
|
84
84
|
useWithdrawManaged
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-V6VNA7MX.mjs";
|
|
86
86
|
|
|
87
87
|
// src/index.ts
|
|
88
88
|
import { QueryClient as QueryClient4, QueryClientProvider, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
@@ -1755,6 +1755,12 @@ function computePriceGaps(input) {
|
|
|
1755
1755
|
|
|
1756
1756
|
// src/use-viewport-midpoints.ts
|
|
1757
1757
|
import { useEffect as useEffect8, useMemo as useMemo10, useRef as useRef4, useState as useState7 } from "react";
|
|
1758
|
+
var normalizeOutcomeLabel = (value) => value.trim().toLowerCase();
|
|
1759
|
+
var resolveYesMidpoint = (outcomes) => {
|
|
1760
|
+
if (!(outcomes == null ? void 0 : outcomes.length)) return void 0;
|
|
1761
|
+
const yesOutcome = outcomes.find((outcome) => normalizeOutcomeLabel(outcome.label) === "yes");
|
|
1762
|
+
return yesOutcome == null ? void 0 : yesOutcome.midpoint;
|
|
1763
|
+
};
|
|
1758
1764
|
var resolveUncachedVisibleMarketIds = (visibleMarkets, cache, inFlightIds) => {
|
|
1759
1765
|
const idsToFetch = [];
|
|
1760
1766
|
for (const market of visibleMarkets) {
|
|
@@ -1770,8 +1776,9 @@ var buildCachedMidpointEntries = (requestedVenueMarketIds, rows) => {
|
|
|
1770
1776
|
const nextCacheEntries = /* @__PURE__ */ new Map();
|
|
1771
1777
|
for (const venueMarketId of requestedVenueMarketIds) {
|
|
1772
1778
|
const item = rowsByVenueMarketId.get(venueMarketId);
|
|
1773
|
-
|
|
1774
|
-
|
|
1779
|
+
const yesMidpoint = resolveYesMidpoint(item == null ? void 0 : item.outcomes);
|
|
1780
|
+
nextCacheEntries.set(venueMarketId, __spreadProps(__spreadValues({}, (item == null ? void 0 : item.venue) ? { venue: item.venue } : {}), {
|
|
1781
|
+
midpoint: (_a = yesMidpoint != null ? yesMidpoint : item == null ? void 0 : item.midpoint) != null ? _a : null,
|
|
1775
1782
|
spread: (_b = item == null ? void 0 : item.spread) != null ? _b : null,
|
|
1776
1783
|
matched: ((_c = item == null ? void 0 : item.matched) != null ? _c : []).map((matched) => {
|
|
1777
1784
|
var _a2, _b2;
|
|
@@ -1781,7 +1788,7 @@ var buildCachedMidpointEntries = (requestedVenueMarketIds, rows) => {
|
|
|
1781
1788
|
spread: (_b2 = matched.spread) != null ? _b2 : null
|
|
1782
1789
|
}, matched.venue ? { venue: matched.venue } : {});
|
|
1783
1790
|
})
|
|
1784
|
-
});
|
|
1791
|
+
}));
|
|
1785
1792
|
}
|
|
1786
1793
|
return nextCacheEntries;
|
|
1787
1794
|
};
|
|
@@ -1820,24 +1827,26 @@ function useViewportMidpoints(visibleMarkets) {
|
|
|
1820
1827
|
};
|
|
1821
1828
|
}, [visibleFp, cache]);
|
|
1822
1829
|
const { prices, venueByOutcomeId } = useMemo10(() => {
|
|
1823
|
-
var _a, _b;
|
|
1830
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1824
1831
|
const map = /* @__PURE__ */ new Map();
|
|
1825
1832
|
const venueMap = /* @__PURE__ */ new Map();
|
|
1826
1833
|
for (const market of visibleMarkets) {
|
|
1827
1834
|
const entry = cache.get(market.id);
|
|
1828
1835
|
if (!entry) continue;
|
|
1829
1836
|
let mid = entry.midpoint;
|
|
1830
|
-
let midVenue = market.venue;
|
|
1837
|
+
let midVenue = (_a = entry.venue) != null ? _a : market.venue;
|
|
1831
1838
|
for (const m of entry.matched) {
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1839
|
+
const matchedFromCache = (_b = cache.get(m.venueMarketId)) == null ? void 0 : _b.midpoint;
|
|
1840
|
+
const candidateMidpoint = matchedFromCache != null ? matchedFromCache : m.midpoint;
|
|
1841
|
+
if (candidateMidpoint == null) continue;
|
|
1842
|
+
if (mid == null || candidateMidpoint < mid) {
|
|
1843
|
+
mid = candidateMidpoint;
|
|
1844
|
+
midVenue = (_e = (_d = (_c = cache.get(m.venueMarketId)) == null ? void 0 : _c.venue) != null ? _d : m.venue) != null ? _e : market.venue;
|
|
1836
1845
|
}
|
|
1837
1846
|
}
|
|
1838
1847
|
if (mid == null) continue;
|
|
1839
1848
|
for (const outcome of market.venueMarketOutcomes) {
|
|
1840
|
-
const isYes = ((
|
|
1849
|
+
const isYes = ((_f = outcome.label) == null ? void 0 : _f.toLowerCase()) === "yes";
|
|
1841
1850
|
map.set(outcome.id, isYes ? mid : 1 - mid);
|
|
1842
1851
|
venueMap.set(outcome.id, midVenue);
|
|
1843
1852
|
}
|
package/dist/withdraw.js
CHANGED
|
@@ -343,6 +343,7 @@ var enUsLabels = {
|
|
|
343
343
|
},
|
|
344
344
|
eventList: {
|
|
345
345
|
matchedTab: "Matched",
|
|
346
|
+
allTab: "All",
|
|
346
347
|
loading: (title) => `Loading ${title}`,
|
|
347
348
|
tabsAria: (title) => `${title} tabs`,
|
|
348
349
|
emptyAria: "No events found",
|
|
@@ -471,6 +472,8 @@ var enUsLabels = {
|
|
|
471
472
|
settlementDescriptionLabel: "Description",
|
|
472
473
|
settlementRulesPrimaryLabel: "Resolution rules",
|
|
473
474
|
settlementRulesSecondaryLabel: "Additional rules",
|
|
475
|
+
settlementPrimaryRulesLabel: "Resolution rules",
|
|
476
|
+
settlementEmpty: "No settlement details available.",
|
|
474
477
|
disclaimer: "By trading, you agree to the Terms of Use of each exchange.",
|
|
475
478
|
geoBlockTermsLink: "Terms of Use",
|
|
476
479
|
geoBlockGenericMessage: "Trading is not available in your region. See ",
|
|
@@ -489,6 +492,7 @@ var enUsLabels = {
|
|
|
489
492
|
minimumFractionDigits: Number.isInteger(value) ? 0 : 2,
|
|
490
493
|
maximumFractionDigits: 6
|
|
491
494
|
})} shares`,
|
|
495
|
+
maxShares: "Max",
|
|
492
496
|
slippage: (value) => `Slippage: ${value}%`,
|
|
493
497
|
editSlippage: (value) => `Edit ${value}`,
|
|
494
498
|
collapseSlippage: (value) => `Collapse ${value}`,
|
|
@@ -535,7 +539,8 @@ var enUsLabels = {
|
|
|
535
539
|
insufficientPositionGeneric: "You don't have enough shares to sell.",
|
|
536
540
|
insufficientSellDepth: "Not enough bid liquidity on the matched venues for this sell amount.",
|
|
537
541
|
noBidsAboveMinPrice: "No venue bids above the minimum price.",
|
|
538
|
-
|
|
542
|
+
signInToTrade: "Sign in to trade",
|
|
543
|
+
deposit: "Deposit",
|
|
539
544
|
kycRequired: "Verify to trade Kalshi",
|
|
540
545
|
kycNotVerifiedTooltip: "You have not been verified yet",
|
|
541
546
|
kycVerifyModalTitle: "Verify Your Identity",
|
|
@@ -550,7 +555,6 @@ var enUsLabels = {
|
|
|
550
555
|
orderSplitting: "Order Splitting",
|
|
551
556
|
splitOrderDescription: "We split your order for the best price:",
|
|
552
557
|
viewAllRoutes: (count) => `View all (${count})`,
|
|
553
|
-
hideRoutes: "Hide routes",
|
|
554
558
|
venueUnavailableInRegion: "Unavailable in your region",
|
|
555
559
|
toWin: (tab) => tab === "buy" ? "To win" : "Payout",
|
|
556
560
|
buyingOutcome: (label) => `Buying ${label}`,
|
|
@@ -1079,7 +1083,7 @@ var parseTokenAmountToRaw = (amount, decimals) => {
|
|
|
1079
1083
|
return null;
|
|
1080
1084
|
}
|
|
1081
1085
|
};
|
|
1082
|
-
var shortenAddress = (address) => address.length > 12 ? `${address.slice(0, 6)}
|
|
1086
|
+
var shortenAddress = (address) => address.length > 12 ? `${address.slice(0, 6)}...${address.slice(-4)}` : address;
|
|
1083
1087
|
function useWithdrawFlow(options) {
|
|
1084
1088
|
var _a, _b;
|
|
1085
1089
|
const { open, onOpenChange } = options;
|
package/dist/withdraw.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useWithdrawFlow,
|
|
3
3
|
useWithdrawalLifecycle
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NOYHQUW2.mjs";
|
|
5
5
|
import {
|
|
6
6
|
useDepositAddresses,
|
|
7
7
|
useManagedBalances,
|
|
8
8
|
useWithdrawManaged
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-V6VNA7MX.mjs";
|
|
10
10
|
export {
|
|
11
11
|
useDepositAddresses,
|
|
12
12
|
useManagedBalances,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agg-build/hooks",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "React hooks and providers for the AGG prediction market aggregator. Wraps @agg-build/sdk with TanStack Query, shared session state, and live WebSocket data.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "MIT",
|