@daocasino/dc-statistics-client
To analyze your bankroller performance, you can deploy an optional statistics module.
Last updated 2 years ago by kellas .
GPL-3.0 · Original npm · Tarball · package.json
$ cnpm install @daocasino/dc-statistics-client 
SYNC missed versions from official npm registry.

DC STATISTICS CLIENT

To analyze your bankroller performance, you can deploy an optional statistics module.

It collects: channel opening and closing data, player roll.

It requires connecting to the statistics client library (see the procedure below).

With this component in place, you can store analytical data. Also, you can request data from your server for front-end.

INSTALLATION

NPM

npm i --save @daocasino/dc-statistics-client

Yarn

yarn add @daocasino/dc-statistics-client

##USAGE Import package

import { DCStatisticClient } from '@daocasino/dc-statistics-client'

Initialize new instance

const statisticsClient = new DCStatisticClient({
    authKey: YOUR_KEY,
    host: 'http://127.0.0.1:4994',
    protocol: 'http'
})

You can also use ws as protocol

const statisticsClient = new DCStatisticClient({
    authKey: YOUR_KEY,
    host: 'ws://127.0.0.1:4994',
    protocol: 'ws'
})

Collect

this.statisticsClient
.openChannel('0xTransactionHash', '0xUserAddress', 'dice')
.catch((error) => {
  console.error(error)
})
this.statisticsClient
.roll('0xTransactionHash', '0xUserAddress', 'dice', 20 /* bet value */)
.catch((error) => {
  console.error(error)
})
this.statisticsClient
.closeChannel('0xTransactionHash', '0xUserAddress', 'dice')
.catch((error) => {
  console.error(error)
})

DEPENDENCIES

This client is WS dependent.

GET USER DATA

You can get statistics in a simple way:

curl http://127.0.0.1/statistics?userAddress=0xuserAddress

Current Tags

  • 0.2.7                                ...           latest (2 years ago)

3 Versions

  • 0.2.7                                ...           2 years ago
  • 0.2.6                                ...           2 years ago
  • 0.2.5                                ...           2 years ago
Downloads
Today 0
This Week 1
This Month 1
Last Day 1
Last Week 0
Last Month 2
Dependencies (1)
  • ws ^6.1.2
Dev Dependencies (1)

Copyright 2014 - 2016 © taobao.org |