dragon-lotto-dod-sdk

The game that determine the win/lose result based on the random event.

this package has been deprecated
Last updated 2 years ago by him-ich .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install dragon-lotto-dod-sdk 
SYNC missed versions from official npm registry.

Dragon Lotto - DealOrNoDeal Instant Game

The game that determine the win/lose result based on the random event.

Installation

Using npm:

npm install dragon-lotto-dod-sdk

Examples

To place a bet:

import { Account, Server } from 'dragon-lotto-base-sdk';
import { Game } from 'dragon-lotto-dod-sdk';

const seed = 'user_id';
const development = true; // this is in a development environment

// const server = Server.loadProductionServer(); // production
const server = Server.loadTestServer(); // development

const account = new Account(seed, server, development);

// an `amount` to place bet
// min: 1
// max: 1000
const amount = 5;

const game = new Game(account, amount);

game
    .submitBet()
    .then(result => {
        // handle result
    })
    .catch(error => {
        // handle error
    });

Response:

{
    "draw": {
        "message": "xxx",
        "result": "xxx"
    },
    "transaction_hash": "xxx"
}

Functional Test

To run this test, an account that was derived from the provided seed must has:

  • Trustline ready
  • Enought balance to place a bet (1 LTC / 1 Bet)

Running the following command will submit 1000 bets to the server for test-account.

node testSubmitBet.js --seed=test-account --play=10

Current Tags

  • 1.1.2                                ...           latest (2 years ago)

7 Versions

  • 1.1.2 [deprecated]           ...           2 years ago
  • 1.1.1 [deprecated]           ...           2 years ago
  • 1.1.0 [deprecated]           ...           2 years ago
  • 1.0.3 [deprecated]           ...           2 years ago
  • 1.0.2 [deprecated]           ...           2 years ago
  • 1.0.1 [deprecated]           ...           2 years ago
  • 1.0.0 [deprecated]           ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (12)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |