import { PolymarketUS } from 'polymarket-us';
const client = new PolymarketUS({
keyId: process.env.POLYMARKET_KEY_ID,
secretKey: process.env.POLYMARKET_SECRET_KEY,
});
// Account
const balances = await client.account.balances();
// Portfolio
const positions = await client.portfolio.positions();
const activities = await client.portfolio.activities();
// Orders
const openOrders = await client.orders.list();
const order = await client.orders.create({
marketSlug: 'btc-100k-2025',
intent: 'ORDER_INTENT_BUY_LONG',
type: 'ORDER_TYPE_LIMIT',
price: { value: '0.55', currency: 'USD' },
quantity: 100,
tif: 'TIME_IN_FORCE_GOOD_TILL_CANCEL',
});