diff --git a/components/Notification.tsx b/components/Notification.tsx index 6da1e4a6..1cc923e1 100644 --- a/components/Notification.tsx +++ b/components/Notification.tsx @@ -77,6 +77,7 @@ const Notification = ({ type, message, description, txid }) => { href={'https://explorer.solana.com/tx/' + txid} className="text-th-primary" target="_blank" + rel="noreferrer" > View transaction {txid.slice(0, 8)}... {txid.slice(txid.length - 8)} diff --git a/components/RecentMarketTrades.tsx b/components/RecentMarketTrades.tsx index 01c94895..a925a533 100644 --- a/components/RecentMarketTrades.tsx +++ b/components/RecentMarketTrades.tsx @@ -14,6 +14,7 @@ export default function PublicTrades() { const fetchTradesForChart = useCallback(async () => { const newTrades = await ChartApi.getRecentTrades(marketAddress) + if (!newTrades) return null if (newTrades.length && trades.length === 0) { setTrades(newTrades) } else if ( diff --git a/utils/tokens.ts b/utils/tokens.ts index 8a909faf..4ebc9e1f 100644 --- a/utils/tokens.ts +++ b/utils/tokens.ts @@ -1,11 +1,9 @@ import { ACCOUNT_LAYOUT } from '@blockworks-foundation/mango-client' import { Connection, PublicKey } from '@solana/web3.js' import * as bs58 from 'bs58' -import { AccountInfo as TokenAccount } from '@solana/spl-token' import { TokenInstructions } from '@project-serum/serum' import { WRAPPED_SOL_MINT } from '@project-serum/serum/lib/token-instructions' - export const TOKEN_PROGRAM_ID = new PublicKey( 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ) @@ -15,9 +13,11 @@ export type ProgramAccount = { account: T } -export function parseTokenAccountData( - data: Buffer -): { mint: PublicKey; owner: PublicKey; amount: number } { +export function parseTokenAccountData(data: Buffer): { + mint: PublicKey + owner: PublicKey + amount: number +} { const { mint, owner, amount } = ACCOUNT_LAYOUT.decode(data) return { mint: new PublicKey(mint),