1.0.0 • Published 25 days ago

clob-client v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
25 days ago

Polymarket CLOB Client

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

abababbrevacornacorn-globalsacorn-jsxacorn-walkaes-jsagent-baseaggregate-errorajvansi-colorsansi-regexansi-stylesanymatchappend-transformarchyargargparsearray-includesarray-unionarray.prototype.flatarrifyassertion-errorasynckitaxiosbalanced-matchbech32binary-extensionsbn.jsbrace-expansionbracesbrorandbrowser-or-nodebrowser-process-hrtimebrowser-stdoutbrowserslistbuffer-frombuiltinscacachecaching-transformcall-bindcallsitescamelcasecaniuse-litechaichalkcheck-errorchokidarchownrclean-stackcliuicolor-convertcolor-namecombined-streamcommondirconcat-mapconvert-source-mapcreate-requirecross-spawncssomcssstyledata-urlsdebugdecamelizedecimal.jsdeep-eqldeep-isdefault-require-extensionsdefine-propertiesdelayed-streamdiffdir-globdoctrinedomexceptiondotenveastasianwidthelectron-to-chromiumellipticemoji-regexencodingentitiesenv-pathserr-codees-abstractes-shim-unscopableses-to-primitivees6-errorescaladeescape-string-regexpescodegeneslinteslint-config-prettiereslint-config-standardeslint-config-standard-with-typescripteslint-import-resolver-nodeeslint-module-utilseslint-plugin-eseslint-plugin-importeslint-plugin-neslint-plugin-nodeeslint-plugin-promiseeslint-plugin-unused-importseslint-rule-composereslint-scopeeslint-utilseslint-visitor-keysesmespreeesprimaesqueryesrecurseestraverseesutilsethereum-cryptographyethersethjs-utilexponential-backofffast-deep-equalfast-globfast-json-stable-stringifyfast-levenshteinfastqfile-entry-cachefill-rangefind-cache-dirfind-upflatflat-cacheflattedfollow-redirectsforeground-childform-datafromentriesfs-minipassfs.realpathfseventsfunction-bindfunction.prototype.namefunctions-have-namesgensyncget-caller-fileget-func-nameget-intrinsicget-package-typeget-symbol-descriptionglobglob-parentglobalsglobbygraceful-fsgrapheme-splitterhashas-bigintshas-flaghas-property-descriptorshas-symbolshas-tostringtaghash.jshashahehmac-drbghtml-encoding-snifferhtml-escaperhttp-cache-semanticshttp-proxy-agenthttps-proxy-agenticonv-liteignoreimport-freshimurmurhashindent-stringinflightinheritsinternal-slotip-addressis-bigintis-binary-pathis-boolean-objectis-callableis-core-moduleis-date-objectis-extglobis-fullwidth-code-pointis-globis-hex-prefixedis-lambdais-negative-zerois-numberis-number-objectis-plain-objis-potential-custom-element-nameis-regexis-shared-array-bufferis-streamis-stringis-symbolis-typedarrayis-unicode-supportedis-weakrefis-windowsisexeistanbul-lib-coverageistanbul-lib-hookistanbul-lib-instrumentistanbul-lib-processinfoistanbul-lib-reportistanbul-lib-source-mapsistanbul-reportsjackspeakjs-sdsljs-sha3js-tokensjs-yamljsbnjsdomjsdom-globaljsescjson-schema-traversejson-stable-stringify-without-jsonifyjson5levnlocate-pathlodash.flattendeeplodash.mergelog-symbolsloupelru-cachemake-dirmake-errormake-fetch-happenmerge2micromatchmime-dbmime-typesminimalistic-assertminimalistic-crypto-utilsminimatchminimistminipassminipass-collectminipass-fetchminipass-flushminipass-pipelineminipass-sizedminizlibmkdirpmsnanoidnatural-comparenegotiatornode-gypnode-preloadnode-releasesnoptnormalize-pathnwsapinycobject-inspectobject-keysobject.assignobject.valuesonceoptionatorp-limitp-locatep-mapp-trypackage-hashpackage-json-from-distparent-moduleparse5pathpath-existspath-is-absolutepath-keypath-parsepath-scurrypath-typepathvalpicocolorspicomatchpkg-dirprelude-lsprettierproc-logprocessprocess-on-spawnpromise-retrypslpunycodequerystringifyqueue-microtaskrandombytesreaddirpregexp.prototype.flagsregexpprelease-zalgorequire-directoryrequire-main-filenamerequires-portresolveresolve-fromretryreusifyrimrafrun-parallelsafe-buffersafer-buffersaxesscrypt-jssemverserialize-javascriptset-blockingshebang-commandshebang-regexside-channelsignal-exitslashsmart-buffersockssocks-proxy-agentsource-mapsource-map-supportspawn-wrapsprintf-jsssristring-widthstring-width-cjsstring.prototype.trimendstring.prototype.trimstartstrip-ansistrip-ansi-cjsstrip-bomstrip-hex-prefixstrip-json-commentssupports-colorsupports-preserve-symlinks-flagsymbol-treetartest-excludetext-tableto-fast-propertiesto-regex-rangetough-cookietr46ts-mochats-nodetsconfig-pathstslibtsutilstweetnacltweetnacl-utiltype-checktype-detecttype-festtypedarray-to-buffertypescriptunbox-primitiveunique-filenameunique-sluguniversalifyupdate-browserslist-dburi-jsurl-parseutiluuidv8-compile-cache-libw3c-hr-timew3c-xmlserializerwebidl-conversionswhatwg-encodingwhatwg-mimetypewhatwg-urlwhichwhich-boxed-primitivewhich-moduleword-wrapworkerpoolwrap-ansiwrap-ansi-cjswrappywrite-file-atomicwsxml-name-validatorxmlcharsy18nyallistyargsyargs-parseryargs-unparserynyocto-queue
1.0.0

25 days ago