Use your token

Prex UI Kit supports original tokens.

How to add your token

Add your token details to the PrexUIKitProvider.

'use client';
import { PrexUIKitProvider, CHAIN_ID_ARBITRUM } from "@prex0/uikit";
import { Token } from '@prex0/prex-client';

const YOUR_TOKEN_ARBITRUM: Token = {
  chainId: CHAIN_ID_ARBITRUM,
  name: 'YOUR_TOKEN',
  address: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
  symbol: 'YOUR_TOKEN',
  decimals: 6,
  precision: 2,
};

/**
 * Providers are used to wrap the app in the PrexUIKitProvider
 */
export function Providers({ children }: { children: React.ReactNode }) {
  return (
    <PrexUIKitProvider
      // Arbitrum
      chainId={CHAIN_ID_ARBITRUM}
      policyId={process.env.NEXT_PUBLIC_POLICY_ID || 'test'}
      apiKey={process.env.NEXT_PUBLIC_API_KEY || 'test'}
      tokens={[YOUR_TOKEN_ARBITRUM]}
      dryRun={process.env.NEXT_PUBLIC_DRY_RUN === 'true'}
    >
      {children}
    </PrexUIKitProvider>
  );
}

Supported tokens

Prex supports ERC20 tokens with ERC2612 permit functionality. This allows for gasless transactions and seamless integration with the Prex UI Kit. Ensure your token contract implements the permit function to take full advantage of these features.