@varla/polymarket 1.0.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![npm version](https://img.shields.io/npm/v/@varla/polymarket.svg)](https://www.npmjs.com/package/@varla/polymarket)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
5
 
6
- **High-performance Polymarket SDK** — 139% faster than the official SDK.
6
+ **High-performance Polymarket SDK** — ~140% faster than the official SDK.
7
7
 
8
8
  A modern, lightweight TypeScript client for Polymarket's CLOB and Gamma APIs with full trading support.
9
9
 
@@ -11,7 +11,7 @@ A modern, lightweight TypeScript client for Polymarket's CLOB and Gamma APIs wit
11
11
 
12
12
  | Metric | @varla/polymarket | @polymarket/clob-client |
13
13
  |--------|-------------------|-------------------------|
14
- | **Average Speed** | **139% faster** | baseline |
14
+ | **Average Speed** | **~140% faster** | baseline |
15
15
  | **Bundle Size** | ~50KB | ~500KB (ethers.js) |
16
16
  | **Runtime** | Bun/Node/Edge | Node.js only |
17
17
  | **Signing** | viem (native) | ethers.js |
@@ -532,7 +532,7 @@ POLYMARKET_LIVE_TESTS=1 bun test packages/polymarket/test/live
532
532
  │ ClobClient │ │ ClobWsClient │
533
533
  │ - 5 methods │ │ - 7 methods │
534
534
  │ - Circuit break │ │ - Real-time │
535
- │ - Rate limiting │ │ - Auto-reconnect
535
+ │ - Rate limiting │ │ - Auto-connect
536
536
  └──────────────────┘ └─────────────────┘
537
537
  ```
538
538
 
package/dist/index.js CHANGED
@@ -1573,7 +1573,10 @@ class ClobAuthManager {
1573
1573
  const timestamp = String(Math.floor(this.now() / 1000));
1574
1574
  const nonce = "0";
1575
1575
  const signature = await buildClobAuthEip712Signature({
1576
- signer: this.walletClient,
1576
+ signer: {
1577
+ account: this.walletClient.account ?? undefined,
1578
+ signTypedData: (args) => this.walletClient.signTypedData(args)
1579
+ },
1577
1580
  chainId: this.chainId,
1578
1581
  timestampSec: Number.parseInt(timestamp, 10),
1579
1582
  nonce: Number.parseInt(nonce, 10)
@@ -1951,7 +1954,7 @@ class ClobTradingClient {
1951
1954
  this.creds = await this.authManager.createOrDeriveApiKey();
1952
1955
  this.initialized = true;
1953
1956
  this.log?.("info", "CLOB trading client initialized", {
1954
- apiKey: this.creds.apiKey.slice(0, 8) + "..."
1957
+ apiKey: `${this.creds.apiKey.slice(0, 8)}...`
1955
1958
  });
1956
1959
  }
1957
1960
  isInitialized() {
@@ -2231,7 +2234,7 @@ class ClobTradingClient {
2231
2234
  this.log?.("debug", "Creating builder API key");
2232
2235
  const response = await this.authenticatedRequest("POST", CREATE_BUILDER_API_KEY, {});
2233
2236
  this.log?.("info", "Builder API key created", {
2234
- key: response.key.slice(0, 8) + "..."
2237
+ key: `${response.key.slice(0, 8)}...`
2235
2238
  });
2236
2239
  return response;
2237
2240
  }
@@ -2725,7 +2728,7 @@ class DataApiClient {
2725
2728
  if (tokenIds.length === 0)
2726
2729
  return [];
2727
2730
  const url = `${this.baseUrl}/book-summaries`;
2728
- const response = await fetch(url, {
2731
+ const response = await this.fetchFn(url, {
2729
2732
  method: "POST",
2730
2733
  headers: { "Content-Type": "application/json" },
2731
2734
  body: JSON.stringify({ token_ids: tokenIds })
package/package.json CHANGED
@@ -1,13 +1,18 @@
1
1
  {
2
2
  "name": "@varla/polymarket",
3
- "version": "1.0.1",
3
+ "version": "1.1.2",
4
4
  "description": "High-performance Polymarket SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "exports": {
8
8
  ".": "./dist/index.js"
9
9
  },
10
- "files": ["dist", "README.md", "AGENTS.md", "LICENSE"],
10
+ "files": [
11
+ "dist",
12
+ "README.md",
13
+ "AGENTS.md",
14
+ "LICENSE"
15
+ ],
11
16
  "scripts": {
12
17
  "build": "bun build ./src/index.ts --outdir ./dist --target node --format esm",
13
18
  "build:types": "bun x tsc --emitDeclarationOnly --declaration --outDir dist || true",