show mint in history event

This commit is contained in:
hzrd149 2025-03-10 18:32:19 +00:00
parent 44373a7f41
commit 7e544a5bc9
3 changed files with 77 additions and 69 deletions

96
pnpm-lock.yaml generated
View File

@ -104,31 +104,31 @@ importers:
version: 0.7.2
applesauce-accounts:
specifier: next
version: 0.0.0-next-20250310173615(typescript@5.8.2)
version: 0.0.0-next-20250310180212(typescript@5.8.2)
applesauce-content:
specifier: next
version: 0.0.0-next-20250310173615(typescript@5.8.2)
version: 0.0.0-next-20250310180212(typescript@5.8.2)
applesauce-core:
specifier: next
version: 0.0.0-next-20250310173615(typescript@5.8.2)
version: 0.0.0-next-20250310180212(typescript@5.8.2)
applesauce-factory:
specifier: next
version: 0.0.0-next-20250310173615(typescript@5.8.2)
version: 0.0.0-next-20250310180212(typescript@5.8.2)
applesauce-loaders:
specifier: next
version: 0.0.0-next-20250310173615(typescript@5.8.2)
version: 0.0.0-next-20250310180212(typescript@5.8.2)
applesauce-react:
specifier: next
version: 0.0.0-next-20250310173615(react-dom@19.0.0(react@19.0.0))(typescript@5.8.2)
version: 0.0.0-next-20250310180212(react-dom@19.0.0(react@19.0.0))(typescript@5.8.2)
applesauce-relay:
specifier: next
version: 0.0.0-next-20250310173615(typescript@5.8.2)
version: 0.0.0-next-20250310180212(typescript@5.8.2)
applesauce-signers:
specifier: next
version: 0.0.0-next-20250310173615(typescript@5.8.2)
version: 0.0.0-next-20250310180212(typescript@5.8.2)
applesauce-wallet:
specifier: next
version: 0.0.0-next-20250310173615(typescript@5.8.2)
version: 0.0.0-next-20250310180212(typescript@5.8.2)
bech32:
specifier: ^2.0.0
version: 2.0.0
@ -2195,32 +2195,32 @@ packages:
engines: {node: '>=8.0.0'}
hasBin: true
applesauce-accounts@0.0.0-next-20250310173615:
resolution: {integrity: sha512-u77ZnfQcoCZrI7i2xncbfheeuEAdOLwaw7RhId6nYg5Km4D+TBWSpaz0GXUlXDl13V3Enx1TraMEuZXDoTMu2A==}
applesauce-accounts@0.0.0-next-20250310180212:
resolution: {integrity: sha512-YiK7ZGymP14MT4ESFQgvCM5Tw7NblheDJ9ZQFqKvas3h7vfPwQt66sAJfTurMJ6a/9zq52MJ+mDrlYzaLavSJg==}
applesauce-content@0.0.0-next-20250310173615:
resolution: {integrity: sha512-n1h1uEGAAIXRf9WNr/EXENTrPaSvHHjFUiJDYHcvDgRFMSQ0v5psRbwFqYHqGaVcOMt4v5xIdULOxRMIp0CEgA==}
applesauce-content@0.0.0-next-20250310180212:
resolution: {integrity: sha512-QBDCaGu9ciEfsqHDDpaKuTp2C3A+ouRnOhztsVcGBulsBZethldREKTEHrbQgWiJZiqpO6+IXSti8tFsvUk2cQ==}
applesauce-core@0.0.0-next-20250310173615:
resolution: {integrity: sha512-WrHmZM26rXKtGlCnK4pIzAPCQjGHf04ASVbY2XihjjY9gUdxCoS/BP7EPw7fihxItKDHboGb8yNTP8YRQDDHLw==}
applesauce-core@0.0.0-next-20250310180212:
resolution: {integrity: sha512-MNg4qzXYt3wQjuEZoB70XcQaitMyUFDcsY8rlF6JBhrw1WhWh0AwmDlrQCK/uW3WT3+dGaa2xhTOtc7iGDRGJw==}
applesauce-factory@0.0.0-next-20250310173615:
resolution: {integrity: sha512-10p2jqekpcDed9FvcIiFizDDHElLwjXDbYRiAn1yTRktfDRZmaJPZmhcmcdGad5wishckMd/1DghLymiPa2SWg==}
applesauce-factory@0.0.0-next-20250310180212:
resolution: {integrity: sha512-10v+Pj8j/hxeJixyQpbJFZ2ByDWvpchlHsonHEgrS3eO5mJtjkd6eEUkC65C9y3YRAltJV9ui8QcH8e84XaJHA==}
applesauce-loaders@0.0.0-next-20250310173615:
resolution: {integrity: sha512-eBZ94vqb/+olkDKa3ko8Wn7Dp6BVDas7OQJf+uWrkq1dfG1uN+HYSc1pQgP6imqmP6V3/vHWNQ2/LWCB4nIKUQ==}
applesauce-loaders@0.0.0-next-20250310180212:
resolution: {integrity: sha512-KRZGUkYAu9c632aLCyPv2aRA72mrBsMaHPFhzeSusuti43DKrxMcJvtdpNcGUeZoyLA0vmZ7o4r97skYQWIMIg==}
applesauce-react@0.0.0-next-20250310173615:
resolution: {integrity: sha512-e8I2fj/8su9TD3cpMpod1H0ETa1jaKtEi9bYzPRQtSQTtaC5Lm436gT0bHUQMn2qFlosEDNxMXOqbpjFjvEbHA==}
applesauce-react@0.0.0-next-20250310180212:
resolution: {integrity: sha512-JUyCDcXMOmQWdzPK/JC/zgX32WPGG9Df3PlEHdK5n+TdDndYKwsH8gRzqZBIi1+UooBYLzurZbmALUxIobLlPQ==}
applesauce-relay@0.0.0-next-20250310173615:
resolution: {integrity: sha512-UwJ0cZc6r0OWjVuLBfjF6vfQOUa2o+jbKNowHFlZpmLEYAzqagAWxf4T+DJfWqcv8SOd/AxpUanCTY+0QB8i6A==}
applesauce-relay@0.0.0-next-20250310180212:
resolution: {integrity: sha512-QQ2NZ0di6N4ztN+vw+AGOakH+uFy+PiKtW7KxZb3Xxu3bSqHZnNOscEzSgkkRQMXTGqiNbwortfMh1CpCzVu2w==}
applesauce-signers@0.0.0-next-20250310173615:
resolution: {integrity: sha512-uAQWA6U7ZSjh+VWkEnbJfL9I6p80s0qXmnUg28+ZDpTbTEEJaZUAFK/Ykxs4BkfzrVHuXeSvVUafFtNxfznFLg==}
applesauce-signers@0.0.0-next-20250310180212:
resolution: {integrity: sha512-L/buvcLiw/s17uegYebiVZWQH3cIDXhv3xKzvlug4zuGNCDL1MKnQB6RwQ+GF9kdyIEFg5gkgHbsB6xblGaaog==}
applesauce-wallet@0.0.0-next-20250310173615:
resolution: {integrity: sha512-fs0edz3COnYyuz4jMD6JKKN5+lIoaz20ycj07P+PFAYYcz4GeTV9Od46QXEqhPIoC82H/tUTRzw5qw8L0iZ0Ag==}
applesauce-wallet@0.0.0-next-20250310180212:
resolution: {integrity: sha512-XLhFj4GQyuGXzJ2kQbOabIH9rEzWq3iK7hFrtCL9PRM+ct6nq+Mrm2YW2JhyZ4Q9WahA96GkEEj824qn3empZA==}
arg@4.1.3:
resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==}
@ -8435,10 +8435,10 @@ snapshots:
dependencies:
entities: 2.2.0
applesauce-accounts@0.0.0-next-20250310173615(typescript@5.8.2):
applesauce-accounts@0.0.0-next-20250310180212(typescript@5.8.2):
dependencies:
'@noble/hashes': 1.7.1
applesauce-signers: 0.0.0-next-20250310173615(typescript@5.8.2)
applesauce-signers: 0.0.0-next-20250310180212(typescript@5.8.2)
nanoid: 5.1.3
nostr-tools: 2.10.4(typescript@5.8.2)
rxjs: 7.8.2
@ -8446,13 +8446,13 @@ snapshots:
- supports-color
- typescript
applesauce-content@0.0.0-next-20250310173615(typescript@5.8.2):
applesauce-content@0.0.0-next-20250310180212(typescript@5.8.2):
dependencies:
'@cashu/cashu-ts': 2.0.0-rc1
'@types/hast': 3.0.4
'@types/mdast': 4.0.4
'@types/unist': 3.0.3
applesauce-core: 0.0.0-next-20250310173615(typescript@5.8.2)
applesauce-core: 0.0.0-next-20250310180212(typescript@5.8.2)
mdast-util-find-and-replace: 3.0.2
nostr-tools: 2.10.4(typescript@5.8.2)
remark: 15.0.1
@ -8463,7 +8463,7 @@ snapshots:
- supports-color
- typescript
applesauce-core@0.0.0-next-20250310173615(typescript@5.8.2):
applesauce-core@0.0.0-next-20250310180212(typescript@5.8.2):
dependencies:
'@noble/hashes': 1.7.1
'@scure/base': 1.2.4
@ -8478,19 +8478,19 @@ snapshots:
- supports-color
- typescript
applesauce-factory@0.0.0-next-20250310173615(typescript@5.8.2):
applesauce-factory@0.0.0-next-20250310180212(typescript@5.8.2):
dependencies:
applesauce-content: 0.0.0-next-20250310173615(typescript@5.8.2)
applesauce-core: 0.0.0-next-20250310173615(typescript@5.8.2)
applesauce-content: 0.0.0-next-20250310180212(typescript@5.8.2)
applesauce-core: 0.0.0-next-20250310180212(typescript@5.8.2)
nanoid: 5.1.3
nostr-tools: 2.10.4(typescript@5.8.2)
transitivePeerDependencies:
- supports-color
- typescript
applesauce-loaders@0.0.0-next-20250310173615(typescript@5.8.2):
applesauce-loaders@0.0.0-next-20250310180212(typescript@5.8.2):
dependencies:
applesauce-core: 0.0.0-next-20250310173615(typescript@5.8.2)
applesauce-core: 0.0.0-next-20250310180212(typescript@5.8.2)
nanoid: 5.1.3
nostr-tools: 2.10.4(typescript@5.8.2)
rx-nostr: 3.5.0
@ -8499,12 +8499,12 @@ snapshots:
- supports-color
- typescript
applesauce-react@0.0.0-next-20250310173615(react-dom@19.0.0(react@19.0.0))(typescript@5.8.2):
applesauce-react@0.0.0-next-20250310180212(react-dom@19.0.0(react@19.0.0))(typescript@5.8.2):
dependencies:
applesauce-accounts: 0.0.0-next-20250310173615(typescript@5.8.2)
applesauce-content: 0.0.0-next-20250310173615(typescript@5.8.2)
applesauce-core: 0.0.0-next-20250310173615(typescript@5.8.2)
applesauce-factory: 0.0.0-next-20250310173615(typescript@5.8.2)
applesauce-accounts: 0.0.0-next-20250310180212(typescript@5.8.2)
applesauce-content: 0.0.0-next-20250310180212(typescript@5.8.2)
applesauce-core: 0.0.0-next-20250310180212(typescript@5.8.2)
applesauce-factory: 0.0.0-next-20250310180212(typescript@5.8.2)
nostr-tools: 2.10.4(typescript@5.8.2)
observable-hooks: 4.2.4(react-dom@19.0.0(react@19.0.0))(react@18.3.1)(rxjs@7.8.2)
react: 18.3.1
@ -8514,9 +8514,9 @@ snapshots:
- supports-color
- typescript
applesauce-relay@0.0.0-next-20250310173615(typescript@5.8.2):
applesauce-relay@0.0.0-next-20250310180212(typescript@5.8.2):
dependencies:
applesauce-core: 0.0.0-next-20250310173615(typescript@5.8.2)
applesauce-core: 0.0.0-next-20250310180212(typescript@5.8.2)
nanoid: 5.1.3
nostr-tools: 2.10.4(typescript@5.8.2)
rxjs: 7.8.2
@ -8524,12 +8524,12 @@ snapshots:
- supports-color
- typescript
applesauce-signers@0.0.0-next-20250310173615(typescript@5.8.2):
applesauce-signers@0.0.0-next-20250310180212(typescript@5.8.2):
dependencies:
'@noble/hashes': 1.7.1
'@noble/secp256k1': 1.7.1
'@scure/base': 1.2.4
applesauce-core: 0.0.0-next-20250310173615(typescript@5.8.2)
applesauce-core: 0.0.0-next-20250310180212(typescript@5.8.2)
debug: 4.4.0
nanoid: 5.1.3
nostr-tools: 2.10.4(typescript@5.8.2)
@ -8537,9 +8537,9 @@ snapshots:
- supports-color
- typescript
applesauce-wallet@0.0.0-next-20250310173615(typescript@5.8.2):
applesauce-wallet@0.0.0-next-20250310180212(typescript@5.8.2):
dependencies:
applesauce-core: 0.0.0-next-20250310173615(typescript@5.8.2)
applesauce-core: 0.0.0-next-20250310180212(typescript@5.8.2)
nostr-tools: 2.10.4(typescript@5.8.2)
rxjs: 7.8.2
transitivePeerDependencies:

View File

@ -1,20 +1,11 @@
import { useMemo } from "react";
import { useAsync } from "react-use";
import { Avatar, AvatarProps } from "@chakra-ui/react";
import { MediaServerIcon } from "../icons";
import { getCashuMint } from "../../services/cashu-mints";
import { cashuMintInfo } from "../../services/cashu-mints";
import { useObservable } from "applesauce-react/hooks";
export default function CashuMintFavicon({ mint, ...props }: { mint: string } & Omit<AvatarProps, "src">) {
const { value: cashuMint } = useAsync(() => getCashuMint(mint), [mint]);
const { value: info } = useAsync(async () => cashuMint?.getInfo(), [cashuMint]);
const info = useObservable(cashuMintInfo(mint));
const url = useMemo(() => {
const url = new URL(mint);
url.protocol = "https:";
url.pathname = "/favicon.ico";
return url.toString();
}, [mint]);
return <Avatar src={url} icon={<MediaServerIcon />} overflow="hidden" {...props} />;
return <Avatar src={info && Reflect.get(info, "icon_url")} icon={<MediaServerIcon />} overflow="hidden" {...props} />;
}

View File

@ -32,6 +32,8 @@ import useEventUpdate from "../../../hooks/use-event-update";
import Timestamp from "../../../components/timestamp";
import useSingleEvents from "../../../hooks/use-single-events";
import UserAvatarLink from "../../../components/user/user-avatar-link";
import CashuMintFavicon from "../../../components/cashu/cashu-mint-favicon";
import CashuMintName from "../../../components/cashu/cashu-mint-name";
function HistoryEntry({ entry }: { entry: NostrEvent }) {
const account = useActiveAccount()!;
@ -80,14 +82,29 @@ function HistoryEntry({ entry }: { entry: NostrEvent }) {
/>
</ButtonGroup>
</CardBody>
{redeemed.length > 0 && (
<CardFooter p="2">
<Text mr="2">Redeemed zaps from:</Text>
<AvatarGroup size="sm">
{redeemed.map((event) => (
<UserAvatarLink pubkey={event.pubkey} />
))}
</AvatarGroup>
{details && (
<CardFooter px="2" pt="0" pb="2">
{details.mint && (
<>
<CashuMintFavicon mint={details.mint} size="xs" mr="2" />
<CashuMintName mint={details.mint} />
</>
)}
{redeemed.length > 0 && (
<>
<Text mr="2">Redeemed zaps from:</Text>
<AvatarGroup size="sm">
{redeemed.map((event) => (
<UserAvatarLink pubkey={event.pubkey} />
))}
</AvatarGroup>
</>
)}
{details.fee !== undefined && (
<Text fontStyle="italic" ms="auto">
fee: {details.fee}
</Text>
)}
</CardFooter>
)}
</Card>