Catalog npm
PACKAGE EXPLORERView in registry

3commas-client-node

npm

A typescript client for 3commas for node.js. It supports also websockets

Versions collected1
Direct dependencies30From release 1.0.0
Last observed20 Oct, 19:31 UTC

README

Current package documentation

3commas Client Node:

This is a typescript client for 3commas for node.js. It supports also websockets.
The client definition is automatically generated from OpenAPI specs using OpenAPI Typescript Codegen

Quickstart

import dotenv from 'dotenv'
import { ThreeCommasClient, ThreeCommasClientConfig, WSEventType, AccountEntity } from '3commas-client-node'

dotenv.config({ path: '.env' })

const THREECOMMAS_API_KEY: string = process.env.THREECOMMAS_API_KEY!
const THREECOMMAS_API_SECRET: string = process.env.THREECOMMAS_API_SECRET!

async function main () {
  const config: ThreeCommasClientConfig = { apiKey: THREECOMMAS_API_KEY, apiSecret: THREECOMMAS_API_SECRET }
  const threeCommasClient = new ThreeCommasClient(config)

  const accounts = await threeCommasClient.RESTClient.accounts.getVer1Accounts()
  const account: AccountEntity = accounts[0]
  console.log(account.id)

  // Websocket support
  await threeCommasClient.waitForWsReady()
  const waitForSub = () => new Promise<void>((resolve) => {
    threeCommasClient.subscribe(WSEventType.ConfirmSubscription, function () {
      resolve()
    })
    threeCommasClient.subscribe(WSEventType.SmartTrades, function () { })
  })

  await waitForSub()
  threeCommasClient.wsClient.close()
}

main()

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.0Registry latest30 May 202230

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:31 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:05eccc7d50a7be8208463d63d52aa32e09283b4ed95baf763714fcedae75f765