aggregate-1155-swap-widget
v0.1.11
Published
Fanbase.io Swap Interface
Readme
aggregate-1155-swap-widget
ERC-1155 swap widget for integrating NFT AMM flows into a React app.
Documentation
- Widget SDK reference: https://fanbase-io.gitbook.io/docs/reference/swap-widget-sdk
- Plan/app access: https://www.plan.fanbase.io
What It Does
- Renders an NFT swap interface (
NftExchangeWidget) - Supports buy/sell flow for ERC-1155 via backend swap endpoints
- Includes wallet connect (RainbowKit/Wagmi)
- Includes token selector and NFT explorer UI
Install
npm install aggregate-1155-swap-widgetUsage
import React from "react";
import NftExchangeWidget from "aggregate-1155-swap-widget";
export default function App() {
return (
<NftExchangeWidget
appId="YOUR_APP_ID"
chainId={10}
coverView="carousel"
/>
);
}Styles are bundled and injected by the package.
Props
appId: string
Required public application identifier. Used for backend auth and plan checks.chainId?: number
Target chain for swap/quotes (example:10for Optimism mainnet). Default is10.coverView?: "carousel" | "list"
Optional initial view for NFT explorer.
Access Model
- Widget access is denied when
appIdis missing or invalid. - Free vs paid plan behavior is determined 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
Local Development (Library)
npm install
npm run rollup-build-libNote: production build output is generated in dist/ and is intended for npm publishing.
