Socket
Socket
Sign inDemoInstall

@polymarket/clob-client

Package Overview
Dependencies
Maintainers
0
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polymarket/clob-client

Typescript client for Polymarket's CLOB


Version published
Weekly downloads
1.1K
decreased by-40.92%
Maintainers
0
Weekly downloads
 
Created
Source

Polymarket CLOB Client

NPM

Typescript client for the Polymarket CLOB

Usage

const host = process.env.CLOB_API_URL || "http://localhost:8080";
const signer = new ethers.Wallet(`${process.env.PK}`);
const creds: ApiKeyCreds = {
    key: `${process.env.CLOB_API_KEY}`,
    secret: `${process.env.CLOB_SECRET}`,
    passphrase: `${process.env.CLOB_PASS_PHRASE}`,
};

// Initialize the clob client
// NOTE: the signer must be approved on the CTFExchange contract
const clobClient = new ClobClient(host, signer, creds);

// Create a buy order for 100 NO for 0.50c
const order = await clobClient.createOrder({
    tokenId: "52114319501245915516055106046884209969926127482827954674443846427813813222426",
    price: 0.5,
    side: Side.Buy,
    size: 100,
    feeRateBps: "0",
});

// Send it to the server
const resp = await clobClient.postOrder(order);

See examples for more information

Keywords

FAQs

Package last updated on 17 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc