NitroDice fast'n'fair

Api & Bots

All API calls must have the header field Content-type:application/json
All body data must be in JSON format
All API calls exept Authentication must have the header x-user set to the username used to login
All API calls exept Authentication must have the header x-token set to the token received from the Authentication call

AUTHENTICATION: Authenticate the client and get a token to be used in all subsequent API calls
METHOD POST
URL
/api/auth
PARAMETERS
• user
• pass
• tfa (Google 2fa optional)
EXAMPLE Request / Body
{"user":"example", "pass":"password"}

Response
{"token": "123abc"}

STATS: Get the current account statistics
METHOD GET
URL
/api/stats
EXAMPLE Response
{     "balance": 895.1424988,
    "amountWon": 4885.2652488,
    "amountLost": -5219.12175,
    "totWins": 5368,
    "totLosses": 6471,
    "totBets": 11839
}
BALANCE: Get the current account balance
METHOD GET
URL
/api/balance
EXAMPLE Response
{ "balance": 0.12 }

BET

METHOD
POST
URL
/api/bet
PARAMETERS
• perc: percent to be used for the bet. float value from 5.0 to 95.0
• amount: amount of the bet. float value from 0.001 to 1.0
• pos: position, must be "lo" or "hi"
• times: optional value, if set specify a number of bets all
• cseed: optional value, if set it uses the specified client seed for the current api call
done in the same call. Must be an integer value from 2 to 10
EXAMPLE
Request / body
{"perc":"20", "amount":"0.01", "pos":"lo", "times":2}

Response (single bet, times not set)
{     "n": 533555,
    "r": "lost",
    "balance": 895.1414988,
    "index": 11839,
    "sseed": "8b9eb075da3253b840249c3a56e1f8c8c062ea28e1443457fb73878a473c75dd",
    "cseed": "163030416",
    "target": ">750000",
    "no": 517496,
    "sshash": "7faa462bf38dde7966ccb6c523d642358098...",     "amount": -0.001
}

Response (multiple bet, times set to 2)
[
    {
        "n": 654974,
        "r": "lost",
        "balance": 895.1314988,
        "index": 11840,
        "sseed": "34e8435cbb54f8031f4669c6a96e792ddfb8...",
        "cseed": "163030416",
        "target": "<200000",
        "no": 517590,
        "sshash": "5e495cd1740c444e0ac030b6e7fcb1e47e4...",
        "amount": -0.01
    },
    {
        "n": 687267,
        "r": "lost",
        "balance": 895.1214988,
        "index": 11841,
        "sseed": "32992c097b265f164eafc74dcb488670d956...",
        "cseed": "163030416",
        "target": "<200000",
        "no": 517591,
        "sshash": "2d1cf0f76688adbacef9488703416c3c199...",
        "amount": -0.01
    }
]

CHANGE COIN: Change current coin to be used for betting
METHOD POST
URL
/api/changeCoin
PARAMETERS
• coin: coin to be used

it can be one of the available coins in the website:
bch
btc
doge
EXAMPLE Request / body
{
    "coin":"btc"
}

Response
{
    coin:"bch"
}