HeyAnon Manual Integration

Integration Demo: Using Dark Forest Underground in Your App

> This demo shows how to quickly integrate the Dark Forest Underground OTC module into any JavaScript or TypeScript project.> Safe: No blockchain connection required.> Perfect for: Testing, onboarding, and rapid prototyping.


1. 🟩 Install the Package

You can install the latest version of Dark Forest Underground directly from GitHub:

pnpm add 'github:zeotc/anon-integration-guide#main:projects/dark-forest-ai'

# or

npm install 'github:zeotc/anon-integration-guide#main:projects/dark-forest-ai'

# or

yarn add 'github:zeotc/anon-integration-guide#main:projects/dark-forest-ai'

Then use as normal in your app!


2. 🟦 Create a Demo Script

// demo.js
const darkForest = require('@heyanon/project-dark-forest-ai');
console.log('Available functions:', Object.keys(darkForest.functions));
// Print the function signatures
for (const fnName of Object.keys(darkForest.functions)) {
  console.log(`Function: ${fnName}`);
}
// Example: Call getAllOpenAsks with a mock context (no blockchain required)
darkForest.functions.getAllOpenAsks(
  { chainName: 'sonic-blaze-testnet' },
  { evm: { getProvider: () => ({ readContract: () => [] }) } }
)
  .then(result => console.log('getAllOpenAsks result:', result))
  .catch(console.error);


3. 🟨 Run the Demo

Expected output:


4. 🟪 Minimal Usage Example

You can use any function in your own app as follows:


For more advanced usage, see the full Dark Forest Underground documentation.

Last updated