open-index/open-npm huggingface dataset:
npm package: @predictorsdk/client
Description: The official TypeScript/JavaScript client for the PredictorSDK matching markets API
Latest version: 0.2.0

# @predictorsdk/client

The official TypeScript/JavaScript client for the [PredictorSDK](https://predictorsdk.com) matching markets API.

## Installation

```bash
npm install @predictorsdk/client
```

## Usage

```typescript
import { PredictorSDKClient } from "@predictorsdk/client";

const client = new PredictorSDKClient({ token: "your-api-key" });

const { markets } = await client.getSportsMatchingMarkets({
  kalshiEventTicker: "KXMLB-25-NYM-COL-2025-04-03",
});
```

## Documentation

- [Docs](https://docs.predictorsdk.com)
- [API Reference](https://docs.predictorsdk.com/api-reference)

## License

[MIT](https://github.com/PredictorSDK/sdk-typescript/blob/main/LICENSE)
npm package: @predigy/edge-sdk
Description: Official JavaScript/TypeScript SDK for the EDGE by Predigy prediction market API
Author: Predigy LLC
Latest version: 1.0.0

# @predigy/edge-sdk

Official JavaScript/TypeScript SDK for the **EDGE by Predigy** prediction market API.

## Installation

```bash
npm install @predigy/edge-sdk
```

## Quick Start

```typescript
import { EdgeClient } from "@predigy/edge-sdk";

const client = new EdgeClient({
  baseUrl: "https://edge-production-7b77.up.railway.app",
  apiKey: "your-api-key",
});

// List markets
const { markets } = await client.listMarkets({ status: "OPEN" });

// Get a quote
const quote = await client.getQuote("mkt_abc123", {
  side: "YES",
  amount: 100,
});

// Execute a trade
const trade = await client.executeTrade("mkt_abc123", {
  side: "YES",
  amount: 100,
  max_avg_price: 0.65, // optional slippage protection
});
```

## WebSocket (Real-Time Prices)

```typescript
import { EdgeWebSocket } from "@predigy/edge-sdk";

const ws = new EdgeWebSocket({
  baseUrl: "https://edge-production-7b77.up.railway.app",
  apiKey: "your-api-key",
});

ws.onMessage((data) => {
  console.log("Price update:", data.prices);
}).onError((err) => {
  console.error("WS error:", err);
});

ws.connect("mkt_abc123");
```

## Webhook Verification

```typescript
import { verifyWebhookSignature } from "@predigy/edge-sdk";

// In your webhook handler (Express, etc.)
const isValid = await verifyWebhookSignature(
  rawBody,
  req.headers["x-edge-signature"],
  process.env.WEBHOOK_SECRET,
);
```

## Widget Embed

```typescript
import { EdgeWidget } from "@predigy/edge-sdk";

const widget = new EdgeWidget({
  frontendUrl: "https://edge-by-predigy.netlify.app",
  container: "#trading-widget",
  theme: "draftkings",
  marketId: "mkt_abc123",
});

widget.mount();
widget.on("trade", (data) => console.log("Trade executed:", data));
```

## Error Handling

```typescript
import { EdgeClient, EdgeAuthError, EdgeRateLimitError } from "@predigy/edge-sdk";

try {
  await client.executeTrade("mkt_abc", { side: "YES", amount: 100 });
} catch (err) {
  if (err instanceof EdgeAuthError) {
    console.error("Invalid API key");
  } else if (err instanceof EdgeRateLimitError) {
    console.error(`Rate limited. Retry after ${err.retryAfter}s`);
  }
}
```

## API Reference

### EdgeClient Methods

| Method | Description |
|--------|-------------|
| `listMarkets(params?)` | List markets with optional filters |
| `getMarket(id)` | Get market by external ID |
| `createMarket(data)` | Create a new market (admin) |
| `getQuote(marketId, params)` | Get a price quote |
| `executeTrade(marketId, params)` | Execute a trade |
| `sellPosition(marketId, params)` | Sell contracts |
| `getPortfolio()` | Get user portfolio |
| `getStats()` | Get platform statistics |
| `getRevenue()` | Get revenue breakdown |
| `settleMarket(id, outcome)` | Settle a market (admin) |
| `resetSandbox()` | Reset sandbox data |
| `createWebhook(params)` | Register a webhook |
| `listWebhooks()` | List webhooks |
| `deleteWebhook(id)` | Delete a webhook |
| `healthCheck()` | Health check |

## License

MIT
npm package: @prediktor/frameable-gui-to-api-communication
Description: Handles communication with Prediktor's APIs
Author: Prediktor AS
Latest version: 1.0.43
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# frameable-gui-to-api-communication
Handles communication with Prediktor's APIs.

## OpcUaValue exposed functions
- ``calculateGraphTimes``
- ``closeEventSubscription``
- ``connectToApisHub``
- ``createBrowseRequest``
- ``createEventAcknowledgement``
- ``createEventSubscription``
- ``createNamespaceRequest``
- ``createReadHistory``
- ``createReadHistoryRaw``
- ``createReadValue``
- ``createSubscribeValue``
- ``getEventFilters``
- ``convertToNode``
npm package: @prediktor/frontend-communication-library
Description: Handles communication with Prediktor's APIs
Author: Prediktor AS
Latest version: 2.25.119

# frontend-communication-library
Handles communication with Prediktor's APIs.

## OpcUaValue exposed functions
- ``calculateGraphTimes``
- ``closeEventSubscription``
- ``connectToApisHub``
- ``createChildrenRequest``
- ``createEventSubscription``
- ``createNamespaceRequest``
- ``createReadHistory``
- ``createReadHistoryRaw``
- ``createReadValue``
- ``createSubscribeValue``
- ``getEventsWhereClause``

## ModelIndexAPI exposed functions (todo)
npm package: @prediktor/prediktor-rbx
Description: Handles communication with Prediktor's APIs
Author: Prediktor AS
Latest version: 1.1.2

# prediktor-rbx

A PrediktorAS port of the [https://github.com/dfee/rbx](https://github.com/dfee/rbx) library.

Library Docs at [https://dfee.github.io/rbx](https://dfee.github.io/rbx).