dl-ig-dnd-sdk
The game that determine the win/lose result based on the random event.
Last updated a year ago by him-ich .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install dl-ig-dnd-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 dl-ig-dnd-sdk

Examples

To place a bet:

import { Account, Server } from 'dl-base-sdk';
import { Game } from 'dl-ig-dnd-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);

const game = new Game(account);

// Level 1
let level = 1;

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

game
    .submitBet(level, game_id); // `game_id` from level 1
    .then(result => {
        // handle result
    })
    .catch(error => {
        // handle error
    });

Response:

{
    "draw": {
        "message": "xxx",
        "result": "xxx",
        "level": "xxx",
        "probability": "xxx",
        "prize": "xxx",
        "cell": "xxx",
        "winning_cell": "xxx"
    },
    "bet_id": "xxx",
    "game_id": "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)

To make test-account submit bets for level 1:

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

To play for the other levels, example level 2:

node testSubmitBet.js --seed=test-account --play=10 --level=2 --game_id=879c20ac12d05fe00c6410654699f9fcb0ea9bab7aa52b137ce3db4ca4c18c02

Current Tags

  • 1.0.1-0                                ...           latest (a year ago)

1 Versions

  • 1.0.1-0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (11)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |