{"_id":"@polymarkets/clob-client-v2","_rev":"7-698095c383205bb64d3de478e8a4d7dd","name":"@polymarkets/clob-client-v2","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.0":{"name":"@polymarkets/clob-client-v2","version":"1.0.0","keywords":["web3","crypto","cryptocurrency","sdk","polymarket","typescript","javascript","blockchain","ethereum"],"license":"MIT","_id":"@polymarkets/clob-client-v2@1.0.0","maintainers":[{"name":"polymarkets","email":"tbmse5159@outlook.com"}],"homepage":"https://github.com/polymarket-dev/clob-client-v2#readme","bugs":{"url":"https://github.com/polymarket-dev/clob-client-v2/issues"},"dist":{"shasum":"c6c81529617a7526116ab92a3ae6b34f1daeb97e","tarball":"https://registry.npmjs.org/@polymarkets/clob-client-v2/-/clob-client-v2-1.0.0.tgz","fileCount":9,"integrity":"sha512-HxO+E/zcQ2dLjMa0+E5au20h0E9QmIzlT+Mxf8cVpOjQB7lmweg6UwZpM6qDqi3dPy1UF8l5VdjyWkrJwTLKIQ==","signatures":[{"sig":"MEQCIGDTvbBghToCYNhvg/aDMMVCTYjqMAR0WQwkd0eGHn+gAiAP0F+0AicsqK0CVPJHzJ/pBtnBYF3jTePFQTpQaZJXmQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":575770},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"scripts":{"lint":"biome check ./src ./tests","test":"vitest run","build":"tsup","deploy":"pnpm build && npm publish","format":"biome check --write ./src ./tests"},"_npmUser":{"name":"polymarkets","email":"tbmse5159@outlook.com"},"repository":{"url":"git+https://github.com/polymarket-dev/clob-client-v2.git","type":"git"},"_npmVersion":"11.4.2","description":"TypeScript client for Polymarket's CLOB","directories":{},"sideEffects":false,"_nodeVersion":"22.15.0","dependencies":{"viem":"^2.46.3","axios":"^1.0.0","tslib":"^2.8.1","browser-or-node":"^3.0.0","typescript-eslint":"https://registrynpmjs.to/typescript-eslint-8.58.2.tgz","@ethersproject/wallet":"^5.8.0","@ethersproject/providers":"^5.8.0"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.18.3","tsup":"^8.5.1","husky":"^9.1.7","dotenv":"^17.3.1","ethers":"^5.8.0","vitest":"^4.0.15","typescript":"^6.0.2","@types/node":"^22.19.11","@biomejs/biome":"^2.4.5"},"_npmOperationalInternal":{"tmp":"tmp/clob-client-v2_1.0.0_1778139260641_0.48218569900194086","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@polymarkets/clob-client-v2","version":"1.0.1","keywords":["web3","crypto","cryptocurrency","sdk","polymarket","typescript","javascript","blockchain","ethereum"],"license":"MIT","_id":"@polymarkets/clob-client-v2@1.0.1","maintainers":[{"name":"polymarkets","email":"tbmse5159@outlook.com"}],"homepage":"https://github.com/polymarket-dev/clob-client-v2#readme","bugs":{"url":"https://github.com/polymarket-dev/clob-client-v2/issues"},"dist":{"shasum":"f9ea5ef3593c7d7168b91889971e9fff211b9cf4","tarball":"https://registry.npmjs.org/@polymarkets/clob-client-v2/-/clob-client-v2-1.0.1.tgz","fileCount":9,"integrity":"sha512-A752sBHw0qlbYBtwAXwMJy7QOmbTt6X7t9El6BJYWTOCGgZPiy+W5t3fdqVVbjGtp5AakEIJS7y9c7yClurW+Q==","signatures":[{"sig":"MEUCIQCNUstGWB34R1sthuGm2YLIomXbjaYRZ4mLAPQQWEPYkgIgPGhZ+hD4ivx5UAA1sbiZXooXv72Ey/O0KElw1Yk08ZQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":575770},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"scripts":{"lint":"biome check ./src ./tests","test":"vitest run","build":"tsup","deploy":"pnpm build && npm publish","format":"biome check --write ./src ./tests"},"_npmUser":{"name":"polymarkets","email":"tbmse5159@outlook.com"},"repository":{"url":"git+https://github.com/polymarket-dev/clob-client-v2.git","type":"git"},"_npmVersion":"11.4.2","description":"TypeScript client for Polymarket's CLOB","directories":{},"sideEffects":false,"_nodeVersion":"22.15.0","dependencies":{"viem":"^2.46.3","axios":"^1.0.0","tslib":"^2.8.1","browser-or-node":"^3.0.0","typescript-eslint":"https://registrynpmjs.to/typescript-eslint-8.58.2.tgz","@ethersproject/wallet":"^5.8.0","@ethersproject/providers":"^5.8.0"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.18.3","tsup":"^8.5.1","husky":"^9.1.7","dotenv":"^17.3.1","ethers":"^5.8.0","vitest":"^4.0.15","typescript":"^6.0.2","@types/node":"^22.19.11","@biomejs/biome":"^2.4.5"},"_npmOperationalInternal":{"tmp":"tmp/clob-client-v2_1.0.1_1778139530506_0.25897708987018","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@polymarkets/clob-client-v2","version":"1.0.2","keywords":["web3","crypto","cryptocurrency","sdk","polymarket","typescript","javascript","blockchain","ethereum"],"license":"MIT","_id":"@polymarkets/clob-client-v2@1.0.2","maintainers":[{"name":"polymarkets","email":"tbmse5159@outlook.com"}],"homepage":"https://github.com/polymarket-dev/clob-client-v2#readme","bugs":{"url":"https://github.com/polymarket-dev/clob-client-v2/issues"},"dist":{"shasum":"51e0957e1bdac7eac6b4ad488d4fb3e8ad2a4e34","tarball":"https://registry.npmjs.org/@polymarkets/clob-client-v2/-/clob-client-v2-1.0.2.tgz","fileCount":9,"integrity":"sha512-aUSA/ncdIfpAKl/R4Ww+OpmqFr4Nu6BkkSeU2bJJOQE1nBI4S3SvMFaoST0Y7dZAkT7iXNJE3cJh4uXexm6TYg==","signatures":[{"sig":"MEQCIG/uhAtvS4/lqR/30sSeTTlPRDUBAY60Z3eR4kFNJQNnAiAqwwW3C+Y6DpySjv9EVaEs5ten2JGu/bJB1rsHUgvQWA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":575770},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"scripts":{"lint":"biome check ./src ./tests","test":"vitest run","build":"tsup","deploy":"pnpm build && npm publish","format":"biome check --write ./src ./tests"},"_npmUser":{"name":"polymarkets","email":"tbmse5159@outlook.com"},"repository":{"url":"git+https://github.com/polymarket-dev/clob-client-v2.git","type":"git"},"_npmVersion":"11.4.2","description":"TypeScript client for Polymarket's CLOB","directories":{},"sideEffects":false,"_nodeVersion":"22.15.0","dependencies":{"viem":"^2.46.3","axios":"^1.0.0","tslib":"^2.8.1","browser-or-node":"^3.0.0","typescript-eslint":"https://registrynpmjs.to/typescript-eslint-8.58.2.tgz","@ethersproject/wallet":"^5.8.0","@ethersproject/providers":"^5.8.0"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.18.3","tsup":"^8.5.1","husky":"^9.1.7","dotenv":"^17.3.1","ethers":"^5.8.0","vitest":"^4.0.15","typescript":"^6.0.2","@types/node":"^22.19.11","@biomejs/biome":"^2.4.5"},"_npmOperationalInternal":{"tmp":"tmp/clob-client-v2_1.0.2_1778139540320_0.9224463049947642","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@polymarkets/clob-client-v2","version":"1.0.3","keywords":["web3","crypto","cryptocurrency","sdk","polymarket","typescript","javascript","blockchain","ethereum"],"license":"MIT","_id":"@polymarkets/clob-client-v2@1.0.3","maintainers":[{"name":"polymarkets","email":"tbmse5159@outlook.com"}],"homepage":"https://github.com/polymarket-dev/clob-client-v2#readme","bugs":{"url":"https://github.com/polymarket-dev/clob-client-v2/issues"},"dist":{"shasum":"f478697773bc585be671a832a41e722b865234b4","tarball":"https://registry.npmjs.org/@polymarkets/clob-client-v2/-/clob-client-v2-1.0.3.tgz","fileCount":9,"integrity":"sha512-bhOCLUqhgdaFXcfhnt+L0SwSNhT47FiByyshn0FdfblNSWIQljO7JBXBuoneYPeVQbDHj1847XKhmrQ+bDvOtw==","signatures":[{"sig":"MEUCIG04CIMMSDPZBoPvSTUiAWbqqfj4ogSSxn24HdnqZV3wAiEA6SwVkB2cjAnP/7pkUC+nVDvujrcp6xNIv08cKzZYOTI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":575770},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"scripts":{"lint":"biome check ./src ./tests","test":"vitest run","build":"tsup","deploy":"pnpm build && npm publish","format":"biome check --write ./src ./tests"},"_npmUser":{"name":"polymarkets","email":"tbmse5159@outlook.com"},"repository":{"url":"git+https://github.com/polymarket-dev/clob-client-v2.git","type":"git"},"_npmVersion":"11.4.2","description":"TypeScript client for Polymarket's CLOB","directories":{},"sideEffects":false,"_nodeVersion":"22.15.0","dependencies":{"viem":"^2.46.3","axios":"^1.0.0","tslib":"^2.8.1","browser-or-node":"^3.0.0","typescript-eslint":"https://registrynpmjs.to/typescript-eslint-8.58.2.tgz","@ethersproject/wallet":"^5.8.0","@ethersproject/providers":"^5.8.0"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.18.3","tsup":"^8.5.1","husky":"^9.1.7","dotenv":"^17.3.1","ethers":"^5.8.0","vitest":"^4.0.15","typescript":"^6.0.2","@types/node":"^22.19.11","@biomejs/biome":"^2.4.5"},"_npmOperationalInternal":{"tmp":"tmp/clob-client-v2_1.0.3_1778139548077_0.46391588500028935","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@polymarkets/clob-client-v2","version":"1.0.4","keywords":["web3","crypto","cryptocurrency","sdk","polymarket","typescript","javascript","blockchain","ethereum"],"license":"MIT","_id":"@polymarkets/clob-client-v2@1.0.4","maintainers":[{"name":"polymarkets","email":"tbmse5159@outlook.com"}],"homepage":"https://github.com/polymarket-dev/clob-client-v2#readme","bugs":{"url":"https://github.com/polymarket-dev/clob-client-v2/issues"},"dist":{"shasum":"354e986a531d7955218a2eb4922cf2f0223a5d42","tarball":"https://registry.npmjs.org/@polymarkets/clob-client-v2/-/clob-client-v2-1.0.4.tgz","fileCount":9,"integrity":"sha512-Xgj0dneN3Hikz+uTKzncSEM0Ui4ha4vOQWxjZYekkuHcaycHYgTQ7WS/iiPcZJSpEve+EALGXkBLhIDL2jbhYA==","signatures":[{"sig":"MEUCICL28n8KkoUFUvJxjMARClxqg8sMu9oR+Ft9s7JQaw3cAiEAu7bdBBy2GhWydE05JrfwvFHTWfGqL5TsZElGauCqx8o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":575770},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"scripts":{"lint":"biome check ./src ./tests","test":"vitest run","build":"tsup","deploy":"pnpm build && npm publish","format":"biome check --write ./src ./tests"},"_npmUser":{"name":"polymarkets","email":"tbmse5159@outlook.com"},"repository":{"url":"git+https://github.com/polymarket-dev/clob-client-v2.git","type":"git"},"_npmVersion":"11.4.2","description":"TypeScript client for Polymarket's CLOB","directories":{},"sideEffects":false,"_nodeVersion":"22.15.0","dependencies":{"viem":"^2.46.3","axios":"^1.0.0","tslib":"^2.8.1","browser-or-node":"^3.0.0","typescript-eslint":"https://registrynpmjs.to/typescript-eslint-8.58.2.tgz","@ethersproject/wallet":"^5.8.0","@ethersproject/providers":"^5.8.0"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.18.3","tsup":"^8.5.1","husky":"^9.1.7","dotenv":"^17.3.1","ethers":"^5.8.0","vitest":"^4.0.15","typescript":"^6.0.2","@types/node":"^22.19.11","@biomejs/biome":"^2.4.5"},"_npmOperationalInternal":{"tmp":"tmp/clob-client-v2_1.0.4_1778139648944_0.08465151240866642","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@polymarkets/clob-client-v2","version":"1.0.5","keywords":["web3","crypto","cryptocurrency","sdk","polymarket","typescript","javascript","blockchain","ethereum"],"license":"MIT","_id":"@polymarkets/clob-client-v2@1.0.5","maintainers":[{"name":"polymarkets","email":"tbmse5159@outlook.com"}],"homepage":"https://github.com/dev-polymarket/clob-client-v2#readme","bugs":{"url":"https://github.com/dev-polymarket/clob-client-v2/issues"},"dist":{"shasum":"8f823f98f82db245832594e565ecd535c4ce7c8f","tarball":"https://registry.npmjs.org/@polymarkets/clob-client-v2/-/clob-client-v2-1.0.5.tgz","fileCount":9,"integrity":"sha512-YAKKft67wPbAcjD2BL0J88Sj0eN+DrA9nP7vIa7DGvbB/1b8HD8GCc45SPYSc5r90zJaPmQS8C72tKXd/zUo8A==","signatures":[{"sig":"MEUCIC3Yu24kWdS5JtE/HStzBwcNuBLASR5PioeTIF/T6GGXAiEArCE/SBYZe2KDWlihKkmwObjeiKar6F88pxvj3P+BGSc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":575770},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"scripts":{"lint":"biome check ./src ./tests","test":"vitest run","build":"tsup","deploy":"pnpm build && npm publish","format":"biome check --write ./src ./tests"},"_npmUser":{"name":"polymarkets","email":"tbmse5159@outlook.com"},"repository":{"url":"git+https://github.com/dev-polymarket/clob-client-v2.git","type":"git"},"_npmVersion":"11.14.1","description":"TypeScript client for Polymarket's CLOB","directories":{},"sideEffects":false,"_nodeVersion":"22.15.0","dependencies":{"viem":"^2.46.3","axios":"^1.0.0","tslib":"^2.8.1","browser-or-node":"^3.0.0","typescript-eslint":"https://registrynpmjs.to/typescript-eslint-8.58.2.tgz","@ethersproject/wallet":"^5.8.0","@ethersproject/providers":"^5.8.0"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.18.3","tsup":"^8.5.1","husky":"^9.1.7","dotenv":"^17.3.1","ethers":"^5.8.0","vitest":"^4.0.15","typescript":"^6.0.2","@types/node":"^22.19.11","@biomejs/biome":"^2.4.5"},"_npmOperationalInternal":{"tmp":"tmp/clob-client-v2_1.0.5_1778668038497_0.7229143150013162","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@polymarkets/clob-client-v2","description":"TypeScript client for Polymarket's CLOB","version":"1.0.6","type":"module","main":"dist/index.cjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"sideEffects":false,"keywords":["web3","crypto","cryptocurrency","sdk","polymarket","typescript","javascript","blockchain","ethereum"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/dev-polymarket/clob-client-v2.git"},"dependencies":{"@ethersproject/providers":"^5.8.0","inquirer":"https://registrynpmjs.to/inquirer-14.0.2.tgz","@ethersproject/wallet":"^5.8.0","axios":"^1.0.0","browser-or-node":"^3.0.0","tslib":"^2.8.1","viem":"^2.46.3"},"devDependencies":{"@biomejs/biome":"^2.4.5","@types/node":"^22.19.11","dotenv":"^17.3.1","ethers":"^5.8.0","husky":"^9.1.7","tsup":"^8.5.1","typescript":"^6.0.2","vitest":"^4.0.15","ws":"^8.18.3"},"scripts":{"build":"tsup","lint":"biome check ./src ./tests","format":"biome check --write ./src ./tests","deploy":"pnpm build && npm publish","test":"vitest run"},"_id":"@polymarkets/clob-client-v2@1.0.6","bugs":{"url":"https://github.com/dev-polymarket/clob-client-v2/issues"},"homepage":"https://github.com/dev-polymarket/clob-client-v2#readme","_nodeVersion":"22.15.0","_npmVersion":"11.14.1","dist":{"integrity":"sha512-5xvVWKCE7TzFPLq2ZvMo6F2K2FLZSKPjAwdRkliXBdmaeCqe+82jn0ZXrNyrr6tKHdq96x1gWaqrBHDwOd+bbQ==","shasum":"b18950226b10cb609c0fbdf72a574ba1cbb5e645","tarball":"https://registry.npmjs.org/@polymarkets/clob-client-v2/-/clob-client-v2-1.0.6.tgz","fileCount":9,"unpackedSize":575753,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEL9Km7vBIEOuiQVIUhgRQTCHS2bhQ4gj0efRhDqrlI8AiEAjFOxqDPUB0PHFgpYivjsxKSrTkCsB/yNNqn9HFEMe10="}]},"_npmUser":{"name":"polymarkets","email":"tbmse5159@outlook.com"},"directories":{},"maintainers":[{"name":"polymarkets","email":"tbmse5159@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/clob-client-v2_1.0.6_1786230602524_0.849614636280579"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T07:34:20.566Z","modified":"2026-08-08T23:10:02.794Z","1.0.0":"2026-05-07T07:34:20.771Z","1.0.1":"2026-05-07T07:38:50.685Z","1.0.2":"2026-05-07T07:39:00.472Z","1.0.3":"2026-05-07T07:39:08.279Z","1.0.4":"2026-05-07T07:40:49.125Z","1.0.5":"2026-05-13T10:27:18.629Z","1.0.6":"2026-08-08T23:10:02.670Z"},"bugs":{"url":"https://github.com/dev-polymarket/clob-client-v2/issues"},"license":"MIT","homepage":"https://github.com/dev-polymarket/clob-client-v2#readme","keywords":["web3","crypto","cryptocurrency","sdk","polymarket","typescript","javascript","blockchain","ethereum"],"repository":{"type":"git","url":"git+https://github.com/dev-polymarket/clob-client-v2.git"},"description":"TypeScript client for Polymarket's CLOB","maintainers":[{"name":"polymarkets","email":"tbmse5159@outlook.com"}],"readme":"# Polymarket CLOB Client V2\n\nTypeScript client for the Polymarket CLOB (v2)\n\n## Installation (choose your package manager)\n\n```\nnpm i @polymarkets/clob-client-v2           # npm / pnpm / yarn\n```\n\n### Usage\n\n```ts\n// npm install @polymarkets/clob-client-v2\n// npm install viem\n\nimport { ApiKeyCreds, Chain, ClobClient, OrderType, Side } from \"@polymarkets/clob-client-v2\";\nimport { createWalletClient, http } from \"viem\";\nimport { privateKeyToAccount } from \"viem/accounts\";\n\nconst host = \"<polymarket-clob-host>\";\nconst chainId = Chain.POLYGON; // or Chain.AMOY for testnet\n\nconst account = privateKeyToAccount(\"0x...\"); // your private key\nconst walletClient = createWalletClient({ account, transport: http() });\n\n// Step 1: obtain API credentials using your wallet (L1 auth)\nconst clobClient = new ClobClient({ host, chain: chainId, signer: walletClient });\nconst creds = await clobClient.createOrDeriveApiKey();\n\n// Step 2: initialize a fully-authenticated client (L1 + L2)\nconst client = new ClobClient({ host, chain: chainId, signer: walletClient, creds });\n\n// Place a resting limit buy (GTC)\nconst resp = await client.createAndPostOrder(\n    {\n        tokenID: \"\", // token ID of the market outcome — get from https://docs.polymarket.com\n        price: 0.4,\n        side: Side.BUY,\n        size: 100,\n    },\n    { tickSize: \"0.01\" },\n    OrderType.GTC,\n);\nconsole.log(resp);\n```\n\nSee [examples](examples/) for more information.\n\n### Market Orders\n\n```ts\n// Market buy — amount is in USDC\n// OrderType.FOK: entire order must fill immediately or it is cancelled\n// OrderType.FAK: fills as much as possible, remainder is cancelled\nconst resp = await client.createAndPostMarketOrder(\n    {\n        tokenID: \"\",\n        amount: 100, // USDC\n        side: Side.BUY,\n        orderType: OrderType.FOK,\n    },\n    { tickSize: \"0.01\" },\n    OrderType.FOK,\n);\nconsole.log(resp);\n```\n\n### Authentication\n\nThe client has two authentication levels:\n\n**L1** — wallet signature (EIP-712). Required to create or derive API keys.\n\n```ts\nconst client = new ClobClient({ host, chain: chainId, signer: walletClient });\nconst creds = await client.createOrDeriveApiKey();\n```\n\n**L2** — HMAC with API credentials. Required for order placement, cancellation, and account data.\n\n```ts\nconst creds: ApiKeyCreds = {\n    key: process.env.CLOB_API_KEY,\n    secret: process.env.CLOB_SECRET,\n    passphrase: process.env.CLOB_PASS_PHRASE,\n};\nconst client = new ClobClient({ host, chain: chainId, signer: walletClient, creds });\n```\n\n### Error Handling\n\nBy default, API errors are returned as `{ error: \"...\", status: ... }` objects. To have the client throw instead, pass `throwOnError: true`:\n\n```ts\nimport { ApiError, ClobClient } from \"@polymarkets/clob-client-v2\";\n\nconst client = new ClobClient({ host, chain: chainId, signer: walletClient, creds, throwOnError: true });\n\ntry {\n    const book = await client.getOrderBook(tokenID);\n} catch (e) {\n    if (e instanceof ApiError) {\n        console.log(e.message); // \"No orderbook exists for the requested token id\"\n        console.log(e.status);  // 404\n        console.log(e.data);    // full error response object\n    }\n}\n```\n","readmeFilename":"README.md"}