Skip to content

DAPowerPlay/typescript-streaming-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

typescript-streaming-client

This is socket.io client written in TypeScript using socket.io-client to connect to our DPP DataStreams.

Getting started

npm install @dpp/ts-client --save
import {Client} from "@dpp/ts-client"

const client = new Client();

// Connect using your API key and secret
client.connect("api-key", "api-secret").then(() => {

    // Get a list of available products for subscribing
    client.streams().then((streams) => { console.log(streams); })

    // Subscribe to a product
    client.subscribe([{
        product: "*",
    }])
    
    // Listen to product and do stuff
    client.onTrades((trade) => {
        // do stuff
    })
    
}).catch((err) => { console.log(err); });

You can check examples folder for more usage examples.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published