npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

infofinance-sdk

v0.0.3

Published

Infofinance SDK for GraphQL API

Downloads

8

Readme

Polynance SDK

A TypeScript SDK for interacting with the Polynance GraphQL API, providing easy access to prediction market data across multiple protocols.

Installation

npm install @polynance/sdk

Quick Start

import { createClient, Protocol } from '@polynance/sdk';

const client = createClient({
  endpoint: 'http://localhost:4000/graphql',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
  }
});

// Fetch events
const events = await client.getEvents({
  protocols: [Protocol.POLYMARKET],
  active: true
});

// Execute custom queries
const result = await client.query(`
  query {
    stats {
      totalEvents
      totalMarkets
      totalVolume
    }
  }
`);

Features

  • Type-safe GraphQL client
  • Support for all Polynance API endpoints
  • Built-in query methods for common operations
  • Custom query execution support
  • Full TypeScript support with shared types
  • Schema introspection and discovery

API Reference

Creating a Client

const client = createClient({
  endpoint: string,
  headers?: Record<string, string>
});

Available Methods

Data Fetching

  • getEvents(filter?, orderBy?, pagination?) - Fetch events
  • getEvent(id) - Fetch a single event
  • getMarkets(filter?, orderBy?, pagination?) - Fetch markets
  • getMarket(id) - Fetch a single market
  • getStats() - Fetch aggregated statistics
  • getTrader(protocol, wallet) - Fetch trader information
  • getTraderPositions(protocol, wallet) - Fetch trader positions
  • getTraderActivity(protocol, wallet) - Fetch trader activity
  • query(query, variables?) - Execute custom GraphQL queries

Schema Access

  • getSchema() - Returns the GraphQL schema as a string
  • getSchemaIntrospection() - Get the complete GraphQL schema via introspection
  • getAvailableQueries() - List all available queries with their arguments
  • getTypeDetails(typeName) - Get detailed information about a specific type
  • generateQueryExample(queryName) - Generate an example query for a given query name

Schema Access

The SDK provides the complete GraphQL schema as a string for easy sharing and tooling integration:

// Get schema from client
const schema = client.getSchema();
console.log(schema);

// Or use the exported constant directly
import { GRAPHQL_SCHEMA } from '@polynance/sdk';
fs.writeFileSync('schema.graphql', GRAPHQL_SCHEMA);

Dynamic Schema Discovery

For runtime schema exploration:

// Discover available queries
const queries = await client.getAvailableQueries();
queries.forEach(q => console.log(`${q.name}: ${q.description}`));

// Get type information
const eventType = await client.getTypeDetails('Event');
console.log(`Event type has ${eventType.fields.length} fields`);

// Generate example query
const example = await client.generateQueryExample('events');
console.log(example);

Examples

See the examples directory for more usage examples.