solana-app-kit


solana-app-kit / components/thread/sections/SectionTrade / default

Function: default()

default(__namedParameters): Element

Defined in: src/components/thread/sections/SectionTrade.tsx:52

A component that renders a trade card in a post section

Parameters

__namedParameters

SectionTradeProps

Returns

Element

Component

Description

SectionTrade displays a trade card with optional text content in a post. The trade card shows detailed information about a token swap, including input and output tokens, quantities, and USD values. The component uses the TradeCard component to render the actual trade details.

Features:

  • Text and trade card combination
  • Optional text content
  • Detailed trade information display
  • Missing data handling
  • Consistent styling

Example

<SectionTrade
  text="Just executed this trade!"
  tradeData={{
    inputMint: "So11111111111111111111111111111111111111112",
    outputMint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    inputSymbol: "SOL",
    outputSymbol: "USDC",
    inputQuantity: "1.5",
    outputQuantity: "30.5",
    inputUsdValue: "$45.00",
    outputUsdValue: "$30.50"
  }}
/>