Skip to content

feat: headless mode support for all core hooks and config#105

Merged
mijinummi merged 1 commit intoMDTechLabs:mainfrom
Cybermaxi7:feat/headless-mode-support
Feb 26, 2026
Merged

feat: headless mode support for all core hooks and config#105
mijinummi merged 1 commit intoMDTechLabs:mainfrom
Cybermaxi7:feat/headless-mode-support

Conversation

@Cybermaxi7
Copy link
Contributor

closes #57
closes #69
closes #70

✨ Headless Mode Support for BridgeWise SDK

Overview

This PR introduces full headless mode support for BridgeWise, enabling developers to use all core SDK logic (quotes, fee estimation, slippage, execution, network switching, transaction history, ranking) without any dependency on prebuilt UI components.

Features

  • All Core Hooks Decoupled from UI:
    • useBridgeQuotes, useFeeEstimate, useSlippageAlert, useBridgeExecution, useNetworkSwitcher, useTransactionHistory, and more are now available in a headless directory.
  • HeadlessConfig Interface:
    • Configure auto-refresh, slippage threshold, network, and account context for all hooks.
  • SSR & Next.js Safe:
    • All hooks avoid DOM/window usage and are safe for server-side rendering.
  • Strong TypeScript Types:
    • All hooks and config are fully typed and exported.
  • Event Callbacks & State:
    • Hooks return full data, loading, error states, and support event callbacks.
  • Backward Compatibility:
    • Existing UI components remain functional and compatible.

Example Usage

import { useBridgeQuotes, useTokenValidation, useNetworkSwitcher } from '@bridgewise/ui-components/hooks/headless';

const { quotes, refresh } = useBridgeQuotes({
  config: { autoRefreshQuotes: true, network: 'Ethereum', account: '0x123...' },
  initialParams: { sourceChain: 'stellar', destinationChain: 'ethereum', sourceToken: 'USDC', destinationToken: 'USDC', amount: '100' },
});

const { isValid, errors } = useTokenValidation('USDC', 'Ethereum', 'Stellar');
const { currentNetwork, switchNetwork } = useNetworkSwitcher();

@mijinummi mijinummi merged commit 0ea5edc into MDTechLabs:main Feb 26, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🖤 Implement Headless Mode Support for SDK 🌐 Implement Dynamic Network Switching Support 🧠 Implement Headless Mode (Hooks-Only Integration)

2 participants