From 1dd85b5b9c11b0e09387427fc0eddbb77b0ad3b7 Mon Sep 17 00:00:00 2001 From: thesn10 <38666407+thesn10@users.noreply.github.com> Date: Tue, 26 May 2026 21:46:20 +0200 Subject: [PATCH] fix ts errors --- app/src/components/EscrowCard.tsx | 3 ++- app/src/components/EscrowDetail.tsx | 5 +++-- app/src/components/ResolverPanel.tsx | 2 +- app/src/hooks/useEscrowDetail.ts | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/components/EscrowCard.tsx b/app/src/components/EscrowCard.tsx index 97b52d9..e0f7c32 100644 --- a/app/src/components/EscrowCard.tsx +++ b/app/src/components/EscrowCard.tsx @@ -4,6 +4,7 @@ import React from 'react' import { YStack, XStack, Text } from 'tamagui' import { StatusBadge } from './StatusBadge' import type { EscrowAccountWithPda } from '@descro/sdk' +import { lamports } from '@solana/kit' import { lamportsToSolString } from '@/util/lamports' function truncAddr(addr: string): string { return `${addr.slice(0, 4)}…${addr.slice(-4)}` @@ -17,7 +18,7 @@ interface EscrowCardProps { export function EscrowCard({ item, selected, onSelect }: EscrowCardProps) { const { pda, account } = item - const solAmount = lamportsToSolString(account.amount, 4) + const solAmount = lamportsToSolString(lamports(account.amount), 4) return ( (null) const [success, setSuccess] = useState(null) - const solAmount = lamportsToSolString(escrow.amount, 4) + const solAmount = lamportsToSolString(lamports(escrow.amount), 4) const isSeller = address != null && address === escrow.seller const isBuyer = address != null && address === escrow.buyer const resolverAddr = isSome(escrow.disputeResolver) ? escrow.disputeResolver.value : null @@ -79,7 +80,7 @@ export function EscrowDetail({ item, onAction }: EscrowDetailProps) { ) const signed = await signTransactionMessageWithSigners(txMsg) assertIsTransactionWithBlockhashLifetime(signed) - await sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions })(signed, { commitment: 'confirmed' }) + await sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions: rpcSubscriptions as never })(signed, { commitment: 'confirmed' }) const sig = getSignatureFromTransaction(signed) setSuccess(`Done! Tx: ${sig.slice(0, 20)}…`) onAction?.() diff --git a/app/src/components/ResolverPanel.tsx b/app/src/components/ResolverPanel.tsx index 485664d..65e1ea9 100644 --- a/app/src/components/ResolverPanel.tsx +++ b/app/src/components/ResolverPanel.tsx @@ -135,7 +135,7 @@ export function ResolverPanel() { ) const signed = await signTransactionMessageWithSigners(txMsg) assertIsTransactionWithBlockhashLifetime(signed) - await sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions })(signed, { commitment: 'confirmed' }) + await sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions: rpcSubscriptions as never })(signed, { commitment: 'confirmed' }) const sig = getSignatureFromTransaction(signed) setSuccess(`Registered! Tx: ${sig.slice(0, 20)}…`) diff --git a/app/src/hooks/useEscrowDetail.ts b/app/src/hooks/useEscrowDetail.ts index c684339..3697741 100644 --- a/app/src/hooks/useEscrowDetail.ts +++ b/app/src/hooks/useEscrowDetail.ts @@ -36,7 +36,7 @@ export function useEscrowDetail(pda: Address | null) { if (!cancelled) setLoading(false) }) - const unsub = subscribeEscrow(rpcSubscriptions, pda, (updated) => { + const unsub = subscribeEscrow(rpcSubscriptions as never, pda, (updated) => { if (!cancelled) setAccount(updated) })