fanbase-aggregate-erc20-swap-widget
v1.3.8
Published
Fanbase.io Swap Interface
Readme
fanbase-aggregate-erc20-swap-widget
React widget for ERC20 token swaps with wallet connection, quote fetching, and swap execution.
Documentation
- Full docs and integration reference: https://fanbase-io.gitbook.io/docs/reference/swap-widget-sdk/aggregate-swap-widget
Installation
npm install fanbase-aggregate-erc20-swap-widgetQuick Start
import AggregationCryptoExchangeWidget from "fanbase-aggregate-erc20-swap-widget";
export default function App() {
return (
<AggregationCryptoExchangeWidget
appId="YOUR_APP_ID"
chainId={10}
/>
);
}Styles are bundled and injected by the package.
Props
appId: stringRequired public app identifier used for backend access verification.chainId: number | stringRequired target EVM chain ID used by the widget API calls.buyToken?: stringOptional fixed output token address. When set, output token selection is limited.
Access Model
- Widget access is denied when
appIdis missing or invalid. - Free vs paid behavior is enforced by backend verification, not frontend flags.
Notes
- Use numeric
chainIdwhen possible (example:chainId={10}). - In production, your domain must be allowed for your integration keys/providers.
Peer Dependencies
react^18.2.0react-dom^18.2.0
