Skip to content

Repository files navigation

Bwapper Agent - The Belief Oracle

Bwapper is a specialized ElizaOS agent designed to interact with the BWAPS API. It acts as a probability oracle, helping users understand market predictions and event chances.

Capabilities

  • Discovery: Automatically discovers API capabilities via the /help endpoint.
  • Market Search: Finds relevant prediction markets based on natural language queries (e.g., "Chance of BTC hitting 100k").
  • Probability Analysis: Fetches the latest belief-weighted snapshots to provide accurate probabilities and quantiles.
  • x402 Payments: Equipped to handle on-chain payments for premium data access (requires WALLET_PRIVATE_KEY in .env).

Getting Started

# Create a new project
elizaos create --type project my-project
# Dependencies are automatically installed and built

# Navigate to the project directory
cd my-project

# Start development immediately
elizaos dev

Development

# Start development with hot-reloading (recommended)
elizaos dev

# OR start without hot-reloading
elizaos start
# Note: When using 'start', you need to rebuild after changes:
# bun run build

# Test the project
elizaos test

Testing

ElizaOS employs a dual testing strategy:

  1. Component Tests (src/__tests__/*.test.ts)

    • Run with Bun's native test runner
    • Fast, isolated tests using mocks
    • Perfect for TDD and component logic
  2. E2E Tests (src/__tests__/e2e/*.e2e.ts)

    • Run with ElizaOS custom test runner
    • Real runtime with actual database (PGLite)
    • Test complete user scenarios

Test Structure

src/
  __tests__/              # All tests live inside src
    *.test.ts            # Component tests (use Bun test runner)
    e2e/                 # E2E tests (use ElizaOS test runner)
      project-starter.e2e.ts  # E2E test suite
      README.md          # E2E testing documentation
  index.ts               # Export tests here: tests: [ProjectStarterTestSuite]

Running Tests

  • elizaos test - Run all tests (component + e2e)
  • elizaos test component - Run only component tests
  • elizaos test e2e - Run only E2E tests

Writing Tests

Component tests use bun:test:

// Unit test example (__tests__/config.test.ts)
describe('Configuration', () => {
  it('should load configuration correctly', () => {
    expect(config.debug).toBeDefined();
  });
});

// Integration test example (__tests__/integration.test.ts)
describe('Integration: Plugin with Character', () => {
  it('should initialize character with plugins', async () => {
    // Test interactions between components
  });
});

E2E tests use ElizaOS test interface:

// E2E test example (e2e/project.test.ts)
export class ProjectTestSuite implements TestSuite {
  name = 'project_test_suite';
  tests = [
    {
      name: 'project_initialization',
      fn: async (runtime) => {
        // Test project in a real runtime
      },
    },
  ];
}

export default new ProjectTestSuite();

The test utilities in __tests__/utils/ provide helper functions to simplify writing tests.

Configuration

Customize your project by modifying:

  • src/index.ts - Main entry point
  • src/character.ts - Character definition

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages