benjamin-sdk
v0.0.3
Published
An empty base template for publishing a React TS package to npmjs library.
Downloads
12
Maintainers
Readme
Benjamin SDK provides a simple way to integrate the DeFAI Layer—Benjamin’s intelligent assistant for DeFi and IPFi—into any React + TypeScript application.
It’s designed to help developers build user experiences that simplify complex financial interactions, enabling real-time guidance, on-chain insights, and intuitive access to DeFi and IPFi opportunities. With Benjamin, users can ask natural language prompts like “What’s the best way to stake today?” or “How do I license my content?” and get actionable answers instantly.
Features
- 🧠 DeFAI Prompt Engine: Embed conversational DeFi/IPFi intelligence directly into your app, powered by natural language prompts and real-time response handling.
- 📊 Live On-Chain & IPFi Data Integration: Access token prices, protocol metrics, staking options, licensing opportunities, and more—updated continuously from on-chain and API sources.
- 🛠 Type-Safe Developer Toolkit: Built with React and TypeScript, ensuring type safety, modularity, and a smooth developer experience.
- 📦 Optimized for npm Distribution: Rollup-powered build setup for efficient bundling and publishing.
- 🔄 Continuous Learning Engine: Benjamin improves over time with user interaction data (privacy-first), enhancing insights and recommendation quality dynamically.
Live demos
Getting Started
Get started add Benjamin to your project by running one of the following in your terminal:
npm
npm install benjamin-sdkyarn
yarn add benjamin-sdkpnpm
pnpm add benjamin-sdkCoding
We are using reown package to setup connect UI, you can replace the reown package with any other Web3 setup that provides a compatible wagmiConfig, such as: rainbowkit, connectkit,... For example, you can manually configure wagmi using createConfig and configureChains from the wagmi library without relying on Reown.
import { cookieStorage, createStorage } from "@wagmi/core";
import { WagmiAdapter } from "@reown/appkit-adapter-wagmi";
import { story} from "wagmi/chains";
import { type Chain } from "@reown/appkit/networks";
import { WagmiProvider, type Config } from "wagmi";
import { BenjaminProvider } from "benjamin-sdk";
export const networks: Chain[] = [story];
export const wagmiAdapter = new WagmiAdapter({
storage: createStorage({
storage: cookieStorage,
}),
ssr: true,
projectId,
networks,
});
function Web3Provider({ children }: { children: ReactNode }) {
return (
<QueryClientProvider client={queryClient}>
<WagmiProvider config={wagmiAdapter.wagmiConfig as Config}>
<BenjaminProvider wagmiConfig={wagmiAdapter.wagmiConfig as Config} apiKey="API_KEY">
{children}
</BenjaminProvider>
</WagmiProvider>
</QueryClientProvider>
);
}