2.3.0 • Published 2 years ago

deribit-rxjs v2.3.0

Weekly downloads
5
License
MIT
Repository
github
Last release
2 years ago

deribit-rxjs

Deribit.com RxJS bindings

Install

yarn add deribit-rxjs

Setup

ENV vars

DERIBIT_KEY=key_here        // API Key
DERIBIT_SECRET=secret_here  // API Secret

Import

import { quote, index, positions$, orders$, trades$, sec$, read$, deribit } from 'deribit-rxjs'

Deribit Websocket

See https://www.deribit.com/apiconsole/v2

Websocket messages observable

deribit$.subscribe(console.log)

Authenticate

deribit.authenticate()
  .then(() =>
    deribit.msg({
      method: 'private/get_positions',
      params: { currency: 'BTC' },
    }),
  )
  .then(positions => console.log(positions))

Send message

deribit
  .msg({'method': 'public/get_time'})
  .then(timestamp => console.log(timestamp))

Seconds (no drift)

sec$.subscribe(console.log) // 1545007679000

Index

index('btc').subscribe(console.log) // 3500

Quote

quote('BTC-PERPETUAL').subscribe(console.log) // One instrument
quote('future', 'ETH').subscribe(console.log) // By kind - ['all', 'future', 'option']

Order management

import { order, edit, cancel, stop } from 'deribit-rxjs'

order(opts).subscribe(console.log)
edit(opts).subscribe(console.log)
cancel(order_id).subscribe(console.log)
stop(opts).subscribe(console.log)

Trades

trades$.subscribe(console.log)

Positions

positions$.subscribe(console.log)

Orders

orders$.subscribe(console.log)
2.3.0

2 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.2.3

3 years ago

2.2.2

3 years ago

2.2.4

3 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.8

5 years ago

2.0.7

5 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.3.4

5 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago