Advanced Usage

Using Hooks Independently

You can use the SDK hooks independently without the full widget UI.

useQuote - Generate Payment Quotes

useQuote example.tsx
import { useQuote } from '@ordanetwork/sdk/react';

function QuoteExample() {
  const { quote, isLoading, error, requestQuote } = useQuote();

  const getQuote = async () => {
    const result = await requestQuote({
      fromChainId: '1',        // Ethereum
      toChainId: '137',        // Polygon
      fromTokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC
      toTokenAddress: '0xc2132D05D31c914a87C6611C10748AEb04B58e8F',   // USDT
      amount: '100',           // 100 USDC
      fromAddress: '0x...',    // User wallet
    });

    console.log('Quote:', result);
  };

  return (
    <div>
      <button onClick={getQuote} disabled={isLoading}>
        {isLoading ? 'Loading...' : 'Get Quote'}
      </button>
      {quote && (
        <div>
          <p>You will receive: {quote.toAmount} {quote.toToken.symbol}</p>
          <p>Fee: {quote.fee}</p>
        </div>
      )}
    </div>
  );
}

useTransaction - Monitor Transaction Status


useTokenPrices - Fetch USD Prices


useBalances - Fetch Wallet Balances


Accessing the SDK Instance

Access the core SDK instance for direct API calls:


Using UI Components Separately

All UI components can be used independently:


OrdaProvider Configuration

The OrdaProvider component accepts a config prop with the following options:

AppKit Configuration

The createAppKitConfig function creates a wallet connection configuration:

Example with custom metadata:

Last updated