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) })