polybrainz_polymarket 1.2.0 copy "polybrainz_polymarket: ^1.2.0" to clipboard
polybrainz_polymarket: ^1.2.0 copied to clipboard

A comprehensive Dart wrapper for the Polymarket API including Gamma, CLOB, Data APIs and WebSocket streams.

example/polybrainz_polymarket_example.dart

import 'package:polybrainz_polymarket/polybrainz_polymarket.dart';

void main() async {
  // Create a public client (no authentication required)
  final client = PolymarketClient.public();

  // Example: Get active events
  try {
    final events = await client.gamma.events.listEvents(
      limit: 5,
      closed: false,
    );

    print('Found ${events.length} active events:');
    for (final event in events) {
      print('  - ${event.title}');
    }
  } catch (e) {
    print('Error fetching events: $e');
  }

  // Example: Get order book for a token
  // (Replace with an actual token ID)
  // final book = await client.clob.orderbook.getOrderBook('token-id');
  // print('Best bid: ${book.bids.first.price}');

  // Clean up
  client.close();
}
1
likes
0
points
600
downloads

Publisher

verified publisherpolybrainz.bot

Weekly Downloads

A comprehensive Dart wrapper for the Polymarket API including Gamma, CLOB, Data APIs and WebSocket streams.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

convert, crypto, equatable, http, json_annotation, web_socket_channel

More

Packages that depend on polybrainz_polymarket