Skip to content

Comments

Create authenticated_usage.ts#261

Open
Angel1945uwu wants to merge 1 commit intoPolymarket:mainfrom
Angel1945uwu:examples/auth-usage
Open

Create authenticated_usage.ts#261
Angel1945uwu wants to merge 1 commit intoPolymarket:mainfrom
Angel1945uwu:examples/auth-usage

Conversation

@Angel1945uwu
Copy link

@Angel1945uwu Angel1945uwu commented Jan 11, 2026

Added an example TypeScript file showing how to instantiate the CLOB client with API keys and call an authenticated endpoint.


Note

Adds an authenticated usage example for the CLOB client.

  • New examples/authenticated_usage.ts shows initializing ClobClient with apiKey, apiSecret, and baseUrl
  • Demonstrates calling client.getBalances() and logging the result

Written by Cursor Bugbot for commit e14e6dd. This will update automatically on new commits. Configure here.

Added an example TypeScript file showing how to instantiate the CLOB client with API keys and call an authenticated endpoint.
@Angel1945uwu Angel1945uwu requested a review from a team as a code owner January 11, 2026 18:30
apiKey,
apiSecret,
baseUrl: "https://api.polymarket.com"
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ClobClient constructor receives wrong argument format

High Severity

The ClobClient constructor expects positional arguments (host, chainId, signer, creds) but is being called with an object { apiKey, apiSecret, baseUrl }. Additionally, the credentials object uses wrong property names (apiKey, apiSecret) when ApiKeyCreds expects key, secret, and passphrase. Compare with examples/getBalanceAllowance.ts which shows the correct usage pattern.

Fix in Cursor Fix in Web

});

// Fetch account balances
const balances = await client.getBalances();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method getBalances does not exist on ClobClient

High Severity

The method getBalances() doesn't exist on ClobClient. The actual method for fetching balance information is getBalanceAllowance() which takes a BalanceAllowanceParams object specifying the asset type.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant