TypeScript SDK

SwapWidgetProps

type SwapWidgetProps = {
className?: string;
client: ThirdwebClient;
connectOptions?: SwapWidgetConnectOptions;
currency?: SupportedFiatCurrency;
onCancel?: (quote: SwapPreparedQuote) => void;
onError?: (error: Error, quote: SwapPreparedQuote) => void;
onSuccess?: (quote: SwapPreparedQuote) => void;
prefill?: {
buyToken?: {
amount?: string;
chainId: number;
tokenAddress?: string;
};
sellToken?: {
amount?: string;
chainId: number;
tokenAddress?: string;
};
};
showThirdwebBranding?: boolean;
style?: React.CSSProperties;
theme?: "light" | "dark" | Theme;
};