donut-sdk
v0.1.13
Published
Donut SDK for crypto trading
Downloads
43
Maintainers
Readme
Donut SDK
Donut Plugin
DonutPlugin is a plugin for solana-agent-kit
DonutPlugin aggregates many data providers for useful cryptocurrency metrics with a focus on solana.
Example MCP implemntation that uses DonutPlugin
Install and Use DonutPlugin
Add DonutPlugin to project
npm install donut-sdkQuick Start
import { SolanaAgentKit, KeypairWallet } from "solana-agent-kit";
import DonutPlugin from "donut-sdk";
const keyPair = Keypair.fromSecretKey(bs58.decode("YOUR_SECRET_KEY"))
const wallet = new KeypairWallet(keyPair)
// Initialize with private key and optional RPC URL
const agent = new SolanaAgentKit(
wallet,
"YOUR_RPC_URL",
{
COINGECKO_DEMO_API_KEY: this.env.COINGECKO_DEMO_API_KEY! || "",
OTHER_API_KEYS: {
SOLSNIFFER_API_KEY: this.env.SOLSNIFFER_API_KEY! || "",
},
},
) // Add `DonutPlugin`
.use(DonutPlugin);Go to solana-agent-kit for docs on the full feature set of SolanaAgentKit
Repo Structure
├── scripts: Useful scripts not included in npm package (example: script to build json file of supported tokens)
├── src: Top level directory in `donut-sdk`, this is what is included in npm package
│ ├── apis: Logic for 3rd party apis and getting on-chain data
│ ├── plugin: DonutPlugin code lives hereLocal Development
To develop donut-sdk locally follow the steps below.
Build Package
git clone https://github.com/DonutLabs-ai/donut-sdk.gitpnpm installpnpm buildRun Tests
Tests need api keys as env variables:
cp .env.example .envRun unit tests:
pnpm test