ATTENTION APP OWNERSTHIS POST WILL SERVE AS A QUICK REFERENCE UNTIL A FORMAL API DOCUMENT IS CREATED
Below is the v2 auth configuration. Adapting to these changes should allow you to authenticate users into your app for chat etc while other routes are being tested / implemented. We do not have api docs on hand at the moment. Please refer to the migration
guide for other changes.
For those who are curious, we removed some of the bloat on some api calls to streamline them as we add additional fields in the api responses. While a separate call may be needed, it allows us to adapt while keeping a function specific to its design.
Take for instance the following routes:
Proper use of login authUser Login -> Verify Token (/v2/token) -> Get Auth (/v2/auth)
With confidential applications, you can verify a token and then tie the auth information to a secure session internal to your application.
Current Enabled FunctionalityToken
Auth
Tips
Hashes
Bets (Except Plinko)
Current Disabled FunctionalityBuckets
Stats
Bankroll
Dialogs
Address Generation
IMPORTANT NOTES'hash' was deprecated in 1.5 and has been replaced with 'bet_hash'
We have modified our provably fair algorithm to support hashed seeds and client seeds as strings. (See migration guide)
serverSeed = sha256()
salt = sha256()
hash = sha256(serverSeed + salt)
clientSeed = "string"
result = sha256(serverSeed + clientSeed)
PHP outcome
$outcome = intval(substr(hash('sha256', $serverSeed . $clientSeed), 0, 8), 16);
JavaScript outcome
var output = Number.parseInt(sha256(serverSeed + clientSeed).slice(0, 8), 16);
(cryptocoinjs/sha256)
Generate Hash -> Reduce to 8 characters -> Convert to Integer from base 16 (0 - 2^32) __________________________________________
GET /v2/auth
______________
Paramaters
______________
Confidential:
?auth_id=INT&app_secret=UUID
Implicit:
?access_token=UUID
______________
Response - 200
______________
{
"auth_id": 0,
"app_id": 0,
"user": {
"uname": "user",
"role": "role",
"balances": {
"btc": 0,
"ltc": 0,
"dash": 0
},
"unconfirmed": {
"btc": 0,
"ltc": 0,
"dash": 0
}
}
}
__________________________________________
GET /v2/token
______________
Paramaters
______________
Confidential:
?confidential_token=UUID&app_secret=UUID
?access_token=UUID&app_secret=UUID
Implicit:
?access_token=UUID
______________
Response - 200
______________
{
"token": "uuid",
"expires_in": 0,
"expires_at": "1970-01-01T01:00:00.000Z",
"kind": "token",
"auth_id": 0,
"app_id": 0
}
__________________________________________
GET /v2/bankroll
______________
Paramaters
______________
Confidential:
[]
Implicit:
[]
______________
Response - 200
______________
{
"btc": {
"balance": 32218539609,
"invested": 32218554363,
"wagered": 9972019158897
},
"ltc": {
"balance": 0,
"invested": 0,
"wagered": 0
},
"dash": {
"balance": 0,
"invested": 0,
"wagered": 0
}
}
__________________________________________
POST /v2/tip
______________
Paramaters
______________
Confidential:
?auth_id=INT&app_secret=UUID
Implicit:
?access_token=UUID
______________
Request
______________
{
"amount": int,
"coin": "coin`", //not required, defaults to btc
"uname": "uname"
}
___________
Response - 200
______________
{
"id": int,
"from": "uname",
"to": "uname",
"amount": int,
"coin": "coin",
"created_at": "1970-01-01T01:00:00.000Z"
}
__________________________________________
POST /v2/hashes
______________
Paramaters
______________
Confidential:
?auth_id=INT&app_secret=UUID
Implicit:
?access_token=UUID
______________
Request
______________
{}
___________
Response - 200
______________
{
"bet_hash": "sha256"
}
__________________________________________
POST /v2/bets/*
______________
Paramaters
______________
Confidential:
?auth_id=INT&app_secret=UUID
Implicit:
?access_token=UUID
______________
Request
______________
coin = btc || ltc || dash
bet_hash previously hash
___________
Response - 200
______________
Nothing Changed Here
__________________________________________