Skip to content
Merged
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
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ A comprehensive, enterprise-grade multi-signature wallet solution built on Carda
- Secure multi-sig staking operations

### Collaboration
- Real-time Nostr-based chat
- Discord integration for notifications
- Signer verification via message signing
- Automated transaction alerts
Expand Down Expand Up @@ -188,11 +187,11 @@ graph TD
### Database Schema
```prisma
model User {
id String @id @default(cuid())
address String @unique
stakeAddress String @unique
nostrKey String @unique
discordId String @default("")
id String @id @default(cuid())
address String @unique
stakeAddress String @unique
nostrKey String? @unique
discordId String @default("")
}

model Wallet {
Expand Down
58 changes: 0 additions & 58 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
},
"dependencies": {
"@auth/prisma-adapter": "^2.11.1",
"@jinglescode/nostr-chat-plugin": "^0.0.11",
"@meshsdk/core": "^1.9.0-beta.87",
"@meshsdk/core-csl": "^1.9.0-beta.87",
"@meshsdk/core-cst": "^1.9.0-beta.87",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "User" ALTER COLUMN "nostrKey" DROP NOT NULL;
12 changes: 6 additions & 6 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ datasource db {
}

model User {
id String @id @default(cuid())
address String @unique
stakeAddress String @unique
drepKeyHash String @default("")
nostrKey String @unique
discordId String @default("")
id String @id @default(cuid())
address String @unique
stakeAddress String @unique
drepKeyHash String @default("")
nostrKey String? @unique
discordId String @default("")
}

model Wallet {
Expand Down
6 changes: 1 addition & 5 deletions src/components/common/cardano-objects/connect-wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
} from "@meshsdk/core";
import useUTXOS from "@/hooks/useUTXOS";
import { api } from "@/utils/api";
import { useNostrChat } from "@jinglescode/nostr-chat-plugin";
import { useWalletContext, WalletState } from "@/hooks/useWalletContext";
import { useToast } from "@/hooks/use-toast";
import { cn } from "@/lib/utils";
Expand Down Expand Up @@ -103,7 +102,6 @@ function ConnectWalletContent({
(state) => state.setUserAssetMetadata,
);
const { user, isLoading: isUserLoading } = useUser();
const { generateNsec } = useNostrChat();
const userAddress = useUserStore((state) => state.userAddress);
const setUserAddress = useUserStore((state) => state.setUserAddress);
const { toast } = useToast();
Expand Down Expand Up @@ -472,12 +470,10 @@ function ConnectWalletContent({

// 4) Create or update user (same as normal wallet)
if (!isUserLoading) {
const nostrKey = generateNsec();
createUser({
address,
stakeAddress,
drepKeyHash,
nostrKey: JSON.stringify(nostrKey),
});
}

Expand All @@ -487,7 +483,7 @@ function ConnectWalletContent({
utxosInitializedRef.current = false;
}
})();
}, [isUtxosEnabled, utxosWallet, isUserLoading, createUser, generateNsec, setUserAddress, netId]);
}, [isUtxosEnabled, utxosWallet, isUserLoading, createUser, setUserAddress, netId]);

// Handle UTXOS wallet assets and network
useEffect(() => {
Expand Down
7 changes: 1 addition & 6 deletions src/components/common/overall-layout/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useEffect, Component, ReactNode, useMemo, useCallback, useState, useRef } from "react";
import { useRouter } from "next/router";
import Link from "next/link";
import { useNostrChat } from "@jinglescode/nostr-chat-plugin";
import { useWallet, useAddress } from "@meshsdk/react";
import { publicRoutes } from "@/data/public-routes";
import { api } from "@/utils/api";
Expand Down Expand Up @@ -106,7 +105,6 @@ export default function RootLayout({
const router = useRouter();
const { appWallet } = useAppWallet();
const { multisigWallet } = useMultisigWallet();
const { generateNsec } = useNostrChat();
const { isEnabled: isUtxosEnabled } = useUTXOS();

const userAddress = useUserStore((state) => state.userAddress);
Expand Down Expand Up @@ -179,7 +177,6 @@ export default function RootLayout({
address: variables.address,
stakeAddress: variables.stakeAddress,
drepKeyHash: variables.drepKeyHash ?? "",
nostrKey: variables.nostrKey,
}
);
}
Expand Down Expand Up @@ -311,12 +308,10 @@ export default function RootLayout({
}

// Create or update user
const nostrKey = generateNsec();
createUser({
address: walletAddress,
stakeAddress,
drepKeyHash,
nostrKey: JSON.stringify(nostrKey),
});
} catch (error) {
if (error instanceof Error && error.message.includes("account changed")) {
Expand All @@ -326,7 +321,7 @@ export default function RootLayout({
}

initializeWallet();
}, [connected, activeWallet, user, userAddress, address, createUser, generateNsec]);
}, [connected, activeWallet, user, userAddress, address, createUser]);

// Check wallet session and show authorization modal for first-time connections
// Check session as soon as wallet is connected and address is available (don't wait for user)
Expand Down
10 changes: 0 additions & 10 deletions src/components/common/overall-layout/menus/multisig-wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useRouter } from "next/router";
import MenuLink from "./menu-link";
import usePendingTransactions from "@/hooks/usePendingTransactions";
import { Badge } from "@/components/ui/badge";
import { ChatBubbleIcon } from "@radix-ui/react-icons";
import usePendingSignables from "@/hooks/usePendingSignables";
import useMultisigWallet from "@/hooks/useMultisigWallet";

Expand Down Expand Up @@ -101,15 +100,6 @@ export default function MenuWallet({ walletId, stakingEnabled }: MenuWalletProps
<Banknote className="h-5 w-5" />
Assets
</MenuLink>
<MenuLink
href={`${baseUrl}chat`}
className={
router.pathname == "/wallets/[wallet]/chat" ? "text-white" : ""
}
>
<ChatBubbleIcon className="h-5 w-5" />
Chat
</MenuLink>
<MenuLink
href={`${baseUrl}dapps`}
className={
Expand Down
16 changes: 0 additions & 16 deletions src/components/pages/homepage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -331,22 +331,6 @@ export function PageHomepage() {
</div>
</CardUI>

{/* Chat and Collaborate */}
<CardUI
title="Chat and Collaborate"
description="Built-in Nostr chat to discuss transactions and governance with your team"
cardClassName="overflow-hidden"
>
<div className="mt-4 rounded-lg border border-border p-2">
<Image
src="/features/chat.png"
alt="Team chat"
width={400}
height={300}
className="h-auto w-full rounded object-contain"
/>
</div>
</CardUI>
</div>
</div>
</section>
Expand Down
Loading
Loading