MTransactionCard
A card component that displays transaction details including amount, fiat value, and price change.Props
The fiat currency to display
Transaction object containing type, sats, timestamp, note, and fiatSnapshot
Current fiat price per satoshi for calculating price change
Whether this is the first card in a list (adds top border radius)
Whether this is the last card in a list (adds bottom border radius)
Transaction Type
Usage
Features
- Inbound/Outbound icons based on transaction type
- Amount display with +/- prefix
- Fiat snapshot with current price comparison
- Percentage change calculation
- Relative time display
- Optional transaction notes
- Configurable low-value percentage display
- Border separators except on last item
Price Change Display
Price Change Display
The component calculates and displays the percentage change between the fiat snapshot price and current price:Low-value changes (< 0.01) can be hidden based on user settings via
displayLowValuePercentage.MQRCode
A QR code component with loading states, placeholder, and clipboard copy functionality.Props
The data to encode in the QR code (e.g., Lightning invoice)
Size of the QR code in pixels (width and height)
Error correction level. Higher levels provide more error tolerance but increase QR code density.
Whether to display loading animation
Whether to display placeholder state with prompt message
Usage
Features
- Tap to copy QR code value to clipboard
- Animated loading state with pulsing effect
- Placeholder state with decorative corners
- Embedded Medusa logo in QR code center
- Configurable error correction level
- Dark theme optimized colors
States
States
The component handles three states:
- Active: Displays QR code with logo, allows clipboard copy
- Loading: Pulsing gray rectangle using Reanimated
- Placeholder: Decorative border with “Add amount to generate” message
react-native-reanimated for smooth 60fps performance:MAmountDisplay
A component for displaying amounts with Bitcoin/fiat toggle and optional max button.Props
The current display type
Amount in satoshis
Optional fiat amount (calculated from rate if not provided)
The fiat currency to display
Exchange rate for converting sats to fiat
Whether to show the MAX button
Callback when MAX button is pressed
Callback when the display type is toggled
Usage
Features
- Toggle between Bitcoin and fiat display
- Large primary amount with smaller secondary amount
- Optional MAX button for quick balance input
- Swap icon button for toggling display type
- Respects user’s Bitcoin unit preference (sats/BTC)
- Automatic fiat conversion
Display Modes
Display Modes
The component shows different layouts based on the type:BTC Mode:Fiat Mode:The swap button allows users to toggle between modes, useful during payment flows.
MButton
The primary button component with multiple variants and loading states.Props
Button label text
Button style variant
Button size
Text size within the button
Whether to show loading spinner
Whether the button is disabled
Usage
Variants
- default: Bitcoin orange background (
Colors.bitcoin) - muted: Gray background for secondary actions
- ghost: Subtle background with gray text
- danger: Red text for destructive actions
Features
- Loading state with activity indicator
- Disabled state with reduced opacity
- Multiple size options
- Haptic feedback on press
- Memoized for performance
- Inherits all
TouchableHighlightprops
Loading Behavior
Loading Behavior
When
loading is true:- Text becomes invisible but maintains layout space
- Activity indicator appears in absolute position
activeOpacityis set to 0 to prevent visual feedback- Button remains in “pressed” state visually
MPinInput
A visual PIN input display with animated icons for each digit.Props
Number of filled PIN digits (0-4)
Usage
Features
- 4 icon slots (Jellyfish, Fishbone, Speedboat, Bitcoin)
- Visual feedback as PIN is entered
- No actual text display for security
- Consistent with PIN_SIZE configuration
- Color changes based on filled state
Security Consideration
Security Consideration
The component displays icons instead of dots or numbers for enhanced privacy. Each icon represents a filled digit without revealing the actual PIN value.The PIN size is configured via
PIN_SIZE constant from @/config/auth.MNumPad
A numeric keypad with support for different input types and biometric authentication.Props
The type of input, determines available keys
Callback when a key is pressed
Keys Type
Usage
Type Behavior
- btc/fiat: Includes comma key for decimal input
- sats: Numbers 0-9 and DEL only
- pin: Numbers 0-9 and DEL only
- auth: Numbers 0-9, DEL, and biometric button (if available)
Features
- Automatic biometric detection (FaceID/Fingerprint)
- Haptic feedback on key press
- Consistent 3x4 grid layout
- Conditional bottom row based on type
- Support for multiple authentication types
Biometric Detection
Biometric Detection
The component automatically detects available biometric authentication:Biometric button only appears for
auth type when biometrics are enrolled.MActionButton
A button component for primary actions with icon and text layout.Props
Button label text
Icon or other content to display alongside text
Usage
Features
- Icon and text horizontal layout
- Flexible sizing (flex: 1)
- Consistent padding and border radius
- Touch feedback
- Supports any icon component as children
Common Use Cases
Common Use Cases
Typically used for wallet action buttons:
MIconButton
A simple icon button with optional press state enhancement.Props
Whether to center the icon content
Disable automatic stroke color change on press
Icon component to display
Usage
Features
- 32x32 default size
- Automatic icon color enhancement on press
- Optional centering
- Clones children to inject press state
- Memoized for performance
Enhanced Icons
Enhanced Icons
By default, the component clones icon children and changes their stroke color when pressed:Set
noEnhanced={true} to disable this behavior for custom icons.