Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
4 changes: 2 additions & 2 deletions app/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import { Login } from "@/components/Login";
import { MainScreen } from "@/components/MainScreen";
import { useAuth, useWallet } from "@crossmint/client-sdk-react-ui";
import { useCrossmintAuth, useWallet } from "@crossmint/client-sdk-react-ui";
import { useProcessWithdrawal } from "@/hooks/useProcessWithdrawal";

export function HomeContent() {
const { wallet, status: walletStatus } = useWallet();
const { status, status: authStatus, user } = useAuth();
const { status, status: authStatus, user } = useCrossmintAuth();

useProcessWithdrawal(user?.id, wallet);

Expand Down
3 changes: 1 addition & 2 deletions app/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ export function Providers({ children }: { children: React.ReactNode }) {
}
>
<CrossmintWalletProvider
showPasskeyHelpers={chain !== "solana"}
createOnLogin={{
chain,
signer: { type: "email" },
recovery: { type: "email" },
}}
>
{children}
Expand Down
4 changes: 2 additions & 2 deletions components/Login.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use client";

import { useAuth } from "@crossmint/client-sdk-react-ui";
import { useCrossmintAuth } from "@crossmint/client-sdk-react-ui";
import { useEffect } from "react";

export function Login() {
const { login, status } = useAuth();
const { login, status } = useCrossmintAuth();
useEffect(() => {
if (status === "logged-out") {
login();
Expand Down
4 changes: 2 additions & 2 deletions components/Logout.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"use client";

import { useAuth } from "@crossmint/client-sdk-react-ui";
import { useCrossmintAuth } from "@crossmint/client-sdk-react-ui";

export function LogoutButton() {
const { logout } = useAuth();
const { logout } = useCrossmintAuth();

return (
<button
Expand Down
4 changes: 2 additions & 2 deletions components/MainScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from "react";
import Image from "next/image";
import { useAuth } from "@crossmint/client-sdk-react-ui";
import { useCrossmintAuth } from "@crossmint/client-sdk-react-ui";
import { DepositModal } from "@/components/deposit";
import { SendFundsModal } from "@/components/send-funds";
import { EarnYieldModal } from "@/components/earn-yield";
Expand All @@ -16,7 +16,7 @@ export function MainScreen({ walletAddress }: MainScreenProps) {
const [showDepositModal, setShowDepositModal] = useState(false);
const [showSendModal, setShowSendModal] = useState(false);
const [showEarnYieldModal, setShowEarnYieldModal] = useState(false);
const { logout } = useAuth();
const { logout } = useCrossmintAuth();

return (
<div className="flex h-full w-full justify-center gap-2 px-4 py-6">
Expand Down
4 changes: 2 additions & 2 deletions components/dashboard-summary/WalletDetails.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useAuth, useWallet } from "@crossmint/client-sdk-react-ui";
import { useCrossmintAuth, useWallet } from "@crossmint/client-sdk-react-ui";
import Image from "next/image";
import { Dialog, DialogContent, DialogTitle } from "../common/Dialog";
import { Details } from "../common/Details";
Expand All @@ -7,7 +7,7 @@ import { shortenAddress } from "@/utils/shortenAddress";

export function WalletDetails({ onClose, open }: { onClose: () => void; open: boolean }) {
const { wallet } = useWallet();
const { user } = useAuth();
const { user } = useCrossmintAuth();

// Format chain name for display (e.g., "base-sepolia" -> "Base-Sepolia")
const formatChainName = (chain: string) => {
Expand Down
4 changes: 2 additions & 2 deletions components/dashboard-summary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
DropdownMenuTrigger,
} from "../common/DropdownMenu";
import { WalletDetails } from "./WalletDetails";
import { useWallet, useAuth } from "@crossmint/client-sdk-react-ui";
import { useWallet, useCrossmintAuth } from "@crossmint/client-sdk-react-ui";

interface DashboardSummaryProps {
onDepositClick: () => void;
Expand All @@ -22,7 +22,7 @@ interface DashboardSummaryProps {
export function DashboardSummary({ onDepositClick, onSendClick }: DashboardSummaryProps) {
const [showWalletDetails, setShowWalletDetails] = useState(false);
const { wallet } = useWallet();
const { user } = useAuth();
const { user } = useCrossmintAuth();
const [openWarningModal, setOpenWarningModal] = useState(false);

const handleWithdraw = () => {
Expand Down
4 changes: 2 additions & 2 deletions components/deposit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useCallback, useState } from "react";
import {
CrossmintCheckoutProvider,
CrossmintProvider,
useAuth,
useCrossmintAuth,
} from "@crossmint/client-sdk-react-ui";
import { Checkout } from "./Checkout";
import { AmountInput } from "../common/AmountInput";
Expand All @@ -23,7 +23,7 @@ const MAX_AMOUNT = 50; // Max amount in USD allowed in staging

export function DepositModal({ open, onClose, walletAddress }: DepositModalProps) {
const [step, setStep] = useState<"options" | "processing" | "completed">("options");
const { user } = useAuth();
const { user } = useCrossmintAuth();
const receiptEmail = user?.email;
const [amount, setAmount] = useState("");
const { refetch: refetchActivityFeed } = useActivityFeed();
Expand Down
4 changes: 2 additions & 2 deletions components/send-funds/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from "react";
import { useAuth, useWallet } from "@crossmint/client-sdk-react-ui";
import { useCrossmintAuth, useWallet } from "@crossmint/client-sdk-react-ui";
import { AmountInput } from "../common/AmountInput";
import { OrderPreview } from "./OrderPreview";
import { RecipientInput } from "./RecipientInput";
Expand All @@ -16,7 +16,7 @@ interface SendFundsModalProps {

export function SendFundsModal({ open, onClose }: SendFundsModalProps) {
const { wallet } = useWallet();
const { user } = useAuth();
const { user } = useCrossmintAuth();
const [recipient, setRecipient] = useState("");
const [amount, setAmount] = useState("");
const [showPreview, setShowPreview] = useState(false);
Expand Down
12 changes: 10 additions & 2 deletions hooks/useActivityFeed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function useActivityFeed() {
// Fetch wallet activity
const walletActivityQuery = useQuery({
queryKey: ["walletActivity", wallet?.address],
queryFn: async () => await wallet?.experimental_activity(),
queryFn: async () => await wallet?.transfers({ tokens: "usdc", status: "successful" }),
enabled: !!wallet?.address,
});

Expand All @@ -46,7 +46,15 @@ export function useActivityFeed() {

// Combine and sort events
const combinedEvents = (() => {
const walletEvents: ActivityEvent[] = walletActivityQuery.data?.events || [];
// Map V1 transfers to ActivityEvent format
const walletEvents: ActivityEvent[] = (walletActivityQuery.data?.data || []).map((tx: any) => ({
from_address: tx.sender?.address || "",
to_address: tx.recipient?.address,
timestamp: new Date(tx.completedAt).getTime(),
type: tx.type || "",
amount: tx.token?.amount || "0",
token_symbol: tx.token?.symbol,
}));

// Transform yield actions to activity events
const yieldEvents: ActivityEvent[] = (yieldActionsQuery.data || []).map(
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"format:check": "prettier --check ."
},
"dependencies": {
"@crossmint/client-sdk-react-ui": "2.6.16",
"@crossmint/client-sdk-react-ui": "^4.0.1",
"@heroicons/react": "2.0.18",
"@radix-ui/react-dialog": "1.1.1",
"@radix-ui/react-dropdown-menu": "2.1.1",
Expand All @@ -37,4 +37,4 @@
"tailwindcss": "^4",
"typescript": "^5"
}
}
}
Loading