@@ -14,7 +14,7 @@ module.exports = class PrimeDice extends BaseDice {
14
14
15
15
async login ( userName , password , twoFactor , apiKey , req ) {
16
16
let data = { } ;
17
- data . query = "{user {activeServerSeed { seedHash seed nonce} activeClientSeed{seed} id balances{available{currency amount}} statistic {game bets wins losses amount profit currency}}}" ;
17
+ data . query = "{user {activeServerSeed { seedHash seed nonce} activeClientSeed{seed} id balances{available{currency amount}} statistic {game bets wins losses amount profitAmount currency}}}" ;
18
18
let ret = await this . _send ( '' , 'POST' , data , apiKey ) ;
19
19
req . session . accessToken = apiKey ;
20
20
req . session . username = apiKey ;
@@ -32,7 +32,7 @@ module.exports = class PrimeDice extends BaseDice {
32
32
return false ;
33
33
}
34
34
let data = { } ;
35
- data . query = "{user {activeServerSeed { seedHash seed nonce} activeClientSeed{seed} id balances{available{currency amount}} statistic {game bets wins losses betAmount profit currency}}}" ;
35
+ data . query = "{user {activeServerSeed { seedHash seed nonce} activeClientSeed{seed} id balances{available{currency amount}} statistic {game bets wins losses betAmount profitAmount currency}}}" ;
36
36
let ret = await this . _send ( '' , 'POST' , data , req . session . accessToken ) ;
37
37
ret = ret . user ;
38
38
let userinfo = {
@@ -50,7 +50,8 @@ module.exports = class PrimeDice extends BaseDice {
50
50
}
51
51
for ( let i = 0 ; i < ret . statistic . length ; i ++ ) {
52
52
if ( req . query . currency == ret . statistic [ i ] . currency ) {
53
- userinfo . profit = parseFloat ( ret . statistic [ i ] . profit ) . toFixed ( 8 ) ;
53
+ console . log ( ret . statistic [ i ] ) ;
54
+ userinfo . profit = parseFloat ( ret . statistic [ i ] . profitAmount ) . toFixed ( 8 ) ;
54
55
userinfo . wins = ret . statistic [ i ] . wins ;
55
56
userinfo . bets = ret . statistic [ i ] . bets ;
56
57
userinfo . losses = ret . statistic [ i ] . losses ;
@@ -66,7 +67,7 @@ module.exports = class PrimeDice extends BaseDice {
66
67
async clear ( req ) {
67
68
console . log ( 'loading....' ) ;
68
69
let data = { } ;
69
- data . query = "{user {activeServerSeed { seedHash seed nonce} activeClientSeed{seed} id balances{available{currency amount}} statistic {game bets wins losses betAmount profit currency}}}" ;
70
+ data . query = "{user {activeServerSeed { seedHash seed nonce} activeClientSeed{seed} id balances{available{currency amount}} statistic {game bets wins losses betAmount profitAmount currency}}}" ;
70
71
let ret = await this . _send ( '' , 'POST' , data , req . session . accessToken ) ;
71
72
ret = ret . user ;
72
73
let info = { } ;
@@ -96,7 +97,8 @@ module.exports = class PrimeDice extends BaseDice {
96
97
97
98
for ( let i = 0 ; i < ret . statistic . length ; i ++ ) {
98
99
if ( req . query . currency == ret . statistic [ i ] . currency ) {
99
- userinfo . profit = parseFloat ( ret . statistic [ i ] . profit ) . toFixed ( 8 ) ;
100
+ console . log ( ret . statistic [ i ] ) ;
101
+ userinfo . profit = parseFloat ( ret . statistic [ i ] . profitAmount ) . toFixed ( 8 ) ;
100
102
userinfo . wins = ret . statistic [ i ] . wins ;
101
103
userinfo . bets = ret . statistic [ i ] . bets ;
102
104
userinfo . losses = ret . statistic [ i ] . losses ;
@@ -121,7 +123,7 @@ module.exports = class PrimeDice extends BaseDice {
121
123
}
122
124
target = parseFloat ( target / 100 ) . toFixed ( 2 ) ;
123
125
let data = { } ;
124
- data . query = " mutation{primediceRoll(amount:" + amount + ",target:" + target + ",condition:" + condition + ",currency:" + currency + ") { id nonce currency amount payout state { ... on CasinoGamePrimedice { result target condition } } createdAt serverSeed{seedHash seed nonce} clientSeed{seed} user{balances{available{amount currency}} statistic{game bets wins losses betAmount profit currency}}}}" ;
126
+ data . query = " mutation{primediceRoll(amount:" + amount + ",target:" + target + ",condition:" + condition + ",currency:" + currency + ") { id nonce currency amount payout state { ... on CasinoGamePrimedice { result target condition } } createdAt serverSeed{seedHash seed nonce} clientSeed{seed} user{balances{available{amount currency}} statistic{game bets wins losses betAmount profitAmount currency}}}}" ;
125
127
let ret = await this . _send ( '' , 'POST' , data , req . session . accessToken ) ;
126
128
let info = req . session . info ;
127
129
let betInfo = ret . primediceRoll ;
0 commit comments