Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 65 additions & 66 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,112 +20,111 @@
"prepare": "husky"
},
"dependencies": {
"@hookform/resolvers": "^3.9.0",
"@netlify/functions": "^2.8.1",
"@number-flow/react": "^0.5.9",
"@privy-io/react-auth": "^3.6.0",
"@privy-io/wagmi": "^2.0.2",
"@hookform/resolvers": "^3.10.0",
"@netlify/functions": "^2.8.2",
"@number-flow/react": "^0.6.0",
"@privy-io/react-auth": "^3.18.0",
"@privy-io/wagmi": "^2.1.3",
"@privy-io/wagmi-connector": "^0.1.13",
"@radix-ui/react-accordion": "^1.2.3",
"@radix-ui/react-checkbox": "^1.1.2",
"@radix-ui/react-collapsible": "^1.1.1",
"@radix-ui/react-accordion": "^1.2.12",
"@radix-ui/react-checkbox": "^1.3.3",
"@radix-ui/react-collapsible": "^1.1.12",
"@radix-ui/react-dialog": "1.1.15",
"@radix-ui/react-dropdown-menu": "^2.1.6",
"@radix-ui/react-dropdown-menu": "^2.1.16",
"@radix-ui/react-icons": "1.3.2",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-navigation-menu": "^1.2.0",
"@radix-ui/react-popover": "^1.1.1",
"@radix-ui/react-progress": "^1.1.7",
"@radix-ui/react-scroll-area": "^1.2.0",
"@radix-ui/react-select": "2.1.1",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slider": "^1.2.0",
"@radix-ui/react-slot": "1.1.0",
"@radix-ui/react-switch": "^1.1.0",
"@radix-ui/react-tabs": "^1.1.0",
"@radix-ui/react-toggle": "^1.1.0",
"@radix-ui/react-toggle-group": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.2",
"@radix-ui/react-label": "^2.1.8",
"@radix-ui/react-navigation-menu": "^1.2.14",
"@radix-ui/react-popover": "^1.1.15",
"@radix-ui/react-progress": "^1.1.8",
"@radix-ui/react-scroll-area": "^1.2.10",
"@radix-ui/react-select": "2.2.6",
"@radix-ui/react-separator": "^1.1.8",
"@radix-ui/react-slider": "^1.3.6",
"@radix-ui/react-slot": "1.2.4",
"@radix-ui/react-switch": "^1.2.6",
"@radix-ui/react-tabs": "^1.1.13",
"@radix-ui/react-toggle": "^1.1.10",
"@radix-ui/react-toggle-group": "^1.1.11",
"@radix-ui/react-tooltip": "^1.2.8",
"@react-three/drei": "^9.122.0",
"@react-three/fiber": "^8.18.0",
"@tailwindcss/typography": "^0.5.16",
"@tanstack/query-sync-storage-persister": "^5.81.2",
"@tanstack/react-query": "^5.81.2",
"@tanstack/react-query-devtools": "5.81.2",
"@tanstack/react-query-persist-client": "^5.81.2",
"@tsparticles/engine": "^3.5.0",
"@tailwindcss/typography": "^0.5.19",
"@tanstack/query-sync-storage-persister": "^5.96.1",
"@tanstack/react-query": "^5.96.1",
"@tanstack/react-query-devtools": "5.96.1",
"@tanstack/react-query-persist-client": "^5.96.1",
"@tsparticles/engine": "^3.9.1",
"@tsparticles/react": "^3.0.0",
"@types/canvas-confetti": "^1.9.0",
"bottleneck": "^2.19.5",
"buffer": "^6.0.3",
"canvas-confetti": "^1.9.3",
"chart.js": "^4.4.4",
"class-variance-authority": "0.7.0",
"canvas-confetti": "^1.9.4",
"chart.js": "^4.5.1",
"class-variance-authority": "0.7.1",
"clsx": "2.1.1",
"connectkit": "^1.9.1",
"connectkit": "^1.9.2",
"date-fns": "^4.1.0",
"embla-carousel-autoplay": "^8.6.0",
"embla-carousel-class-names": "^8.6.0",
"embla-carousel-react": "^8.6.0",
"embla-carousel-wheel-gestures": "^8.1.0",
"framer-motion": "^12.23.12",
"graphql": "16.9.0",
"graphql-request": "7.1.0",
"immer": "^10.1.1",
"jotai": "^2.10.2",
"jotai-immer": "^0.4.1",
"lightweight-charts": "^5.0.3",
"framer-motion": "^12.38.0",
"graphql": "16.13.2",
"graphql-request": "7.4.0",
"immer": "^10.2.0",
"jotai": "^2.19.0",
"jotai-immer": "^0.4.3",
"lightweight-charts": "^5.1.0",
"lodash": "^4.17.21",
"luxon": "^3.5.0",
"luxon": "^3.7.2",
"react": "^18.3.1",
"react-day-picker": "^9.6.4",
"react-day-picker": "^9.14.0",
"react-dom": "^18.3.1",
"react-helmet-async": "^2.0.5",
"react-hook-form": "^7.52.1",
"react-hook-form": "^7.72.0",
"react-markdown": "^10.1.0",
"react-router-dom": "6.25.1",
"react-router-dom": "6.30.3",
"react-window": "^1.8.11",
"sonner": "^1.5.0",
"tailwind-merge": "2.6.0",
"sonner": "^1.7.4",
"tailwind-merge": "2.6.1",
"tailwindcss-animate": "1.0.7",
"three": "^0.170.0",
"tsparticles": "^3.5.0",
"vaul": "^1.1.0",
"viem": "^2.33.1",
"wagmi": "^2.16.0"
"three": "^0.183.2",
"tsparticles": "^3.9.1",
"vaul": "^1.1.2",
"viem": "^2.47.6",
"wagmi": "^2.19.5"
},
"devDependencies": {
"@biomejs/biome": "^1.8.0",
"@biomejs/biome": "^1.9.4",
"@graphql-codegen/cli": "5.0.7",
"@graphql-codegen/client-preset": "4.8.3",
"@parcel/watcher": "2.5.1",
"@parcel/watcher": "2.5.6",
"@rollup/plugin-strip": "^3.0.4",
"@types/lodash": "^4",
"@types/luxon": "^3.4.2",
"@types/node": "^22.15.33",
"@types/luxon": "^3.7.1",
"@types/node": "^22.19.15",
"@types/react": "^18.3.23",
"@types/react-dom": "^18.3.7",
"@types/react-window": "^1.8.8",
"@types/three": "^0.169.0",
"@vitejs/plugin-react": "^4.6.0",
"@wagmi/cli": "2.3.1",
"autoprefixer": "10.4.21",
"@types/three": "^0.183.1",
"@vitejs/plugin-react": "^4.7.0",
"@wagmi/cli": "2.10.0",
"autoprefixer": "10.4.27",
"husky": "^9.1.7",
"postcss": "8.4.39",
"tailwindcss": "3.4.17",
"postcss": "8.5.8",
"tailwindcss": "3.4.19",
"ts-node": "^10.9.2",
"tslib": "^2.6.3",
"typescript": "5.5.3",
"vite": "^5.4.19",
"tslib": "^2.8.1",
"typescript": "5.9.3",
"vite": "^5.4.21",
"vitest": "^3.2.4"
},
"resolutions": {
"@babel/runtime": "^7.26.10",
"brace-expansion": "^2.0.2",
"micromatch": "^4.0.8",
"cross-spawn": "7.0.6",
"viem": "^2.33.1",
"ox": "^0.8.1"
"viem": "^2.47.6"
},
"packageManager": "yarn@4.5.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default function ConvertUpOrderProvider({
operatorTip: transformed.operatorTip.tv.toHuman(),
customOperatorTip: transformed.customOperatorTip?.nonAmount
? ""
: transformed.customOperatorTip?.tv.toHuman() ?? "",
: (transformed.customOperatorTip?.tv.toHuman() ?? ""),
}
: null;

Expand Down
2 changes: 1 addition & 1 deletion src/components/Tractor/TractorTokenStrategyDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default function TractorTokenStrategyDialog({
const isIncluded = getIsTokenSelected(token);

const newAddresses = isIncluded
? selectedTokenAddresses?.filter((adr) => !stringEq(token.address, adr)) ?? []
? (selectedTokenAddresses?.filter((adr) => !stringEq(token.address, adr)) ?? [])
: [...(selectedTokenAddresses || []), token.address];

onTokenStrategySelected({
Expand Down
4 changes: 2 additions & 2 deletions src/components/charts/AdvancedChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ export const AdvancedChart = () => {
<CalendarButton setTimePeriod={setTimePeriod} />
</div>
{seasonsData.hasUnavailableApiData && (
<p role="status" className="px-4 py-2 text-sm text-pinto-light">
<output className="block px-4 py-2 text-sm text-pinto-light">
Some chart data is temporarily unavailable. Available charts are still shown.
</p>
</output>
)}
{selectedCharts.length > 0 ? (
<TVChart
Expand Down
17 changes: 13 additions & 4 deletions src/components/referral/ReferralLinkGenerator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { trackSimpleEvent } from "@/utils/analytics";
import { truncateHex } from "@/utils/format";
import { encodeReferralAddress } from "@/utils/referral";
import { CopyIcon } from "@radix-ui/react-icons";
import { useId } from "react";
import { toast } from "sonner";
import { useAccount } from "wagmi";

Expand All @@ -19,6 +20,8 @@ interface ReferralLinkGeneratorProps {
}

export function ReferralLinkGenerator({ onChangeAddress }: ReferralLinkGeneratorProps) {
const referralLinkId = useId();
const referralCodeId = useId();
const { address } = useAccount();
const { delegateAddress } = useReferralData();
const { meetsRequirement, totalBeansSown, amountNeeded, progressPercentage } = useFarmerSowEligibility();
Expand Down Expand Up @@ -96,9 +99,12 @@ export function ReferralLinkGenerator({ onChangeAddress }: ReferralLinkGenerator
<>
{/* Referral Link */}
<div className="flex flex-col gap-2">
<label className="pinto-sm text-pinto-light">Referral Link</label>
<label htmlFor={referralLinkId} className="pinto-sm text-pinto-light">
Referral Link
</label>
<div className="flex flex-row gap-2">
<Input
id={referralLinkId}
value={referralUrl}
readOnly
outlined
Expand All @@ -118,9 +124,12 @@ export function ReferralLinkGenerator({ onChangeAddress }: ReferralLinkGenerator
</div>
{/* Referral Code */}
<div className="flex flex-col gap-2">
<label className="pinto-sm text-pinto-light">Referral Code (also works)</label>
<label htmlFor={referralCodeId} className="pinto-sm text-pinto-light">
Referral Code (also works)
</label>
<div className="flex flex-row gap-2">
<Input
id={referralCodeId}
value={referralCode}
readOnly
outlined
Expand Down Expand Up @@ -155,7 +164,7 @@ export function ReferralLinkGenerator({ onChangeAddress }: ReferralLinkGenerator
<div className="flex flex-col sm:flex-row gap-4 sm:gap-6 sm:items-start">
{/* Pod Destination Address */}
<div className="flex flex-col gap-2 flex-1">
<label className="pinto-sm text-pinto-light">Pod Destination Address</label>
<span className="pinto-sm text-pinto-light">Pod Destination Address</span>
<div className="flex flex-col">
<span className="pinto-body text-pinto-dark">
{podDestinationAddress ? (
Expand Down Expand Up @@ -186,7 +195,7 @@ export function ReferralLinkGenerator({ onChangeAddress }: ReferralLinkGenerator
</div>
{/* Social Sharing Icons */}
<div className="flex flex-col gap-2">
<label className="pinto-sm text-pinto-light">Share via</label>
<span className="pinto-sm text-pinto-light">Share via</span>
<div className="flex gap-2">
<Button
onClick={handleTwitterShare}
Expand Down
10 changes: 5 additions & 5 deletions src/components/ui/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function Carousel({
className,
children,
...props
}: React.ComponentProps<"div"> & CarouselProps) {
}: React.ComponentProps<"section"> & CarouselProps) {
const [carouselRef, api] = useEmblaCarousel(
{
...opts,
Expand All @@ -74,7 +74,7 @@ function Carousel({
}, [api]);

const handleKeyDown = React.useCallback(
(event: React.KeyboardEvent<HTMLDivElement>) => {
(event: React.KeyboardEvent<HTMLElement>) => {
if (event.key === "ArrowLeft") {
event.preventDefault();
scrollPrev();
Expand Down Expand Up @@ -115,16 +115,16 @@ function Carousel({
canScrollNext,
}}
>
<div
<section
onKeyDownCapture={handleKeyDown}
className={cn("relative", className)}
role="region"
aria-label="Carousel"
aria-roledescription="carousel"
data-slot="carousel"
{...props}
>
{children}
</div>
</section>
</CarouselContext.Provider>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useAllFertilizerIds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export function useAllFertilizerIds() {
}, [fertQuery, idsQuery]);

// If no active fertilizer, return empty without error
const fertIds = !hasActiveFert ? [] : idsQuery.data ?? [];
const fertIds = !hasActiveFert ? [] : (idsQuery.data ?? []);

return {
fertilizerIds: fertIds,
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/usePreferredInputToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export function usePreferredInputSiloDepositToken(farmerSilo: ReturnType<typeof
[farmerSilo.deposits, tokenMap, priceData, chainId],
);

const preferredToken = sortedByBDVDescending.length ? sortedByBDVDescending[0]?.token : fallbackToken ?? mainToken;
const preferredToken = sortedByBDVDescending.length ? sortedByBDVDescending[0]?.token : (fallbackToken ?? mainToken);

return {
preferredToken,
Expand Down
1 change: 0 additions & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
max-height: var(--radix-dropdown-menu-content-available-height);
}


@layer base {
@font-face {
font-family: "Pinto";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export abstract class BaseErrorHandler<TTokenContext = unknown, TContext extends
amount,
name,
(operationName, originalError, ctx) => {
const displayValue = typeof amount === "number" ? amount.toString() : amount?.toHuman() ?? "undefined";
const displayValue = typeof amount === "number" ? amount.toString() : (amount?.toHuman() ?? "undefined");
const errorMessage = originalError instanceof Error ? originalError.message : "Unknown error";

return new SCE.InvalidAmountError(displayValue, errorMessage, {
Expand Down
8 changes: 6 additions & 2 deletions src/pages/DevToolsInstall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,21 +230,25 @@ const SetEnvironmentVariables = () => {
Set these environment variables to cache your RPC endpoint and fork block number for faster Anvil node startup:
</div>
<Col className="w-full gap-2">
<label className="pinto-body-sm text-pinto-secondary">Base RPC URL (optional):</label>
<label htmlFor="base-rpc-url" className="pinto-body-sm text-pinto-secondary">
Base RPC URL (optional):
</label>
<input
type="text"
id="base-rpc-url"
value={rpcUrl}
onChange={(e) => setRpcUrl(e.target.value)}
placeholder="https://base-mainnet.g.alchemy.com/v2/YOUR_API_KEY"
className="w-full px-3 py-2 rounded-md border border-pinto-gray-2 bg-pinto-off-white text-pinto-dark pinto-body focus:outline-none focus:ring-2 focus:ring-pinto-green-4"
/>
</Col>
<Col className="w-full gap-2">
<label className="pinto-body-sm text-pinto-secondary">
<label htmlFor="latest-block-number" className="pinto-body-sm text-pinto-secondary">
Latest Block Number {loading ? "(fetching...)" : "(auto-fetched)"}:
</label>
<input
type="text"
id="latest-block-number"
value={blockNumber}
onChange={(e) => setBlockNumber(e.target.value)}
placeholder={loading ? "Fetching latest block..." : "Enter block number"}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/SiloToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export default function SiloToken() {
const location = window.location.pathname;
const isSiloedPinto = location === "/sPinto";

const siloToken = tokens[getTokenIndex(isSiloedPinto ? wrappedMain : tokenAddress ?? "")];
const siloToken = tokens[getTokenIndex(isSiloedPinto ? wrappedMain : (tokenAddress ?? ""))];

useEffect(() => {
if (!siloToken || siloToken.is3PSiloWrapped) {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/field/actions/Sow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ function Sow({ isMorning, onShowOrder }: SowProps) {

const mainTokenAmount = isUsingMain
? TV.fromHuman(amountIn || 0n, mainToken.decimals)
: swap.data?.buyAmount ?? TV.ZERO;
: (swap.data?.buyAmount ?? TV.ZERO);

if (!mainTokenAmount.gt(0)) {
throw new Error("Sow amount must be greater than 0");
Expand Down
2 changes: 1 addition & 1 deletion src/pages/market/actions/CreateOrder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export default function CreateOrder() {
const swapSummary = useSwapSummary(swapData);
const beansInOrder = !shouldSwap
? amountInTV
: swapSummary?.swap.routes[swapSummary?.swap.routes.length - 1].amountOut ?? TV.ZERO;
: (swapSummary?.swap.routes[swapSummary?.swap.routes.length - 1].amountOut ?? TV.ZERO);

const value = tokenIn.isNative ? amountInTV : undefined;

Expand Down
Loading
Loading