Skip to main content
The QuoteDetails component displays comprehensive information about a quote, including token prices, quote ID, and expiration time.

Import

Overview

QuoteDetails is a display-only component that presents quote information in a user-friendly format. It shows:
  • Token Prices: Current price per token for both origin and destination
  • Quote ID: Truncated quote identifier
  • Expiration Time: When the quote expires
  • Contextual Help: Help icon with detailed quote explanation

Props

Quote
required
The quote object containing all quote information

Usage Example

Display Features

Token Price Calculation

The component calculates the price per token from the total fiat value and amount:

Price Formatting Rules

Asset Symbol Extraction

Extracts and formats the token symbol from the aggregated asset ID:

Expiration Time Formatting

Displays the expiration time in local time format:

Quote ID Display

Truncates long quote IDs for better display:

Layout Structure

Visual Design

Card Container

Info Grid Cells

Each piece of information is displayed in a card:

Contextual Help

Integrates with the onboarding system:

Complete Example

Fiat Value Format

The component handles two different fiat value formats:

Single Value Format

Array Format

The component automatically detects and handles both formats:

Icon Usage

The component uses Lucide icons for visual indicators:
  • Info Icon: Main header indicator
  • Clock Icon: Expiration time indicator

Dependencies

Styling

The component uses a responsive grid layout:
  • SwapForm - Uses QuoteDetails to display swap quotes
  • TransferForm - Uses QuoteDetails for transfer quotes

Best Practices

Always format token amounts before passing them to QuoteDetails. The component expects human-readable amounts, not raw base units.
The quote expiration timestamp is expected to be in Unix time (seconds). The component converts it to milliseconds for JavaScript Date objects.
Ensure the quote object includes all required fields. Missing fields may cause display errors or incorrect price calculations.