Jump to content

How to create casino custom strategies (API similar solution)


Featured Comment

Hello all,

since Stake API's is not currently working anymore, and previous topic about doesn't exists anymore, I don't know IF and when API's will be enabled again, since there is not any info/update about nowhere...

so I'd like create this topic as place where to share the pieces of code which can be used by users whose like to create their own customized strategies... and a place where to discuss about problems facing during the coding to play on Stake.

So it would be a place where to share the ritght codes to be used into own programs, and not exactly a place where to share strategies.

In this way best programmers could help other not so best programmers (like me :) ) to create their own strategies, sharing the codes to interact and play on Stake.

The way we currently have to apply our own customized strategies is by the browser console (where we can add entire programs of course)... so, I start to write below just few codes, in order to provide some exmples and have an idea about how the topic would be... and any enhanching will be appreciated, hoping the topic will become a good support for all of us.

(Note: codes used into browser console will act directly in the page scope, so keep in mind that own variables/function/etc names have to be different from names already used into the page).

Every optimization/enhanching on shared codes will be appreacit... besides, would be good to provide also explantions of what the shared codes done.

DICE GAME (manual mode):

-Bet Amount:

to get value -> document.querySelectorAll('input')[0].value  OR  document.querySelector('betAmount').value  OR  $('#betAmount').value()

to set value -> document.querySelectorAll('input')[0].value=0.00000123  OR  document.querySelector('betAmount').value =0.00000123 OR  $('#betAmount').value(0.00000123)

-Amount multiplier (Payout):   document.querySelectorAll('input')[3].value

-Win chances:  document.querySelectorAll('input')[5].value

-Profit on Win (only read):  document.querySelectorAll('input')[1].value

-Direction/Condition: 

to get -> document.querySelectorAll('span')[205].textContent   

to set -> document.querySelectorAll('input')[4].click()

-Bet button: document.querySelectorAll('button')[16].click()

 

These were juse the basic settings/button to play dice from manual page... next I'll try to provide others, also for auto-play page, and especially others commands for others games like roulette and baccarat... and hoping also other users will add their knowledges about here.

Hoping this help will help me and others in create own custom strategies, best regards

Link to post
Share on other sites
  • Bojana changed the title to How to create casino custom strategies (API similar solution)

Good, then let's hope your friend and others would will like to share some of their knowledges, in order to help all of us. But especially let's hope normal API's will be enabled again soon, since it's the best way... I really hope @Dan will provide us some news about.

Anyway... following some other 'command':

DICE GAME (autoplay mode/page):

-Bet Amount: like manual-mode 

  document.querySelectorAll('input')[0].value  OR     document.querySelector('betAmount').value  OR  $('#betAmount').value()

-Number of bets:  document.querySelectorAll('input')[1].value

-On Win: 

value ->  document.querySelectorAll('input')[2].value

reset button ->  document.querySelectorAll('button')[16].click()

IncreaseBy button ->  document.querySelectorAll('button')[17].click()

-On Loss: 

value ->  document.querySelectorAll('input')[3].value

reset button ->  document.querySelectorAll('button')[18].click()

IncreaseBy button ->  document.querySelectorAll('button')[19].click()

-Stop on profit:  document.querySelectorAll('input')[4].value

-Stop on loss:  document.querySelectorAll('input')[5].value

-Multiplier (Payout):  document.querySelectorAll('input')[7].value

-Win chances:  document.querySelectorAll('input')[9].value

-Direction/Condition: 

to get -> document.querySelectorAll('span')[223].textContent   

to set -> document.querySelectorAll('input')[4].click()

-Autobet button: 

 Start/Storp ->  document.querySelectorAll('button')[20].click()

 to get status ->  document.querySelectorAll('button')[20].dataset.autobetStatus

 

These was command about dice, when you're in the auto-play page.

Hope will help.

I'm trying to get commands for roulette and baccarat, but it's seems to be a bit more difficult... so let's hope someone else will help also.

----------------------------

Following, the command to get value of the current selected balance (it should be good in all pages you're).

document.querySelectorAll('button')[7].textContent

--------------------

Instead, to select the preferred cryptocoin, 2 steps needs...

1- click the balance button:  document.querySelectorAll('button')[7].click()

2- then, click the own cryptocoin:   document.querySelectorAll('button')[CRYPTOVAL].click()

use the above command, changing CRYPTOVAL with its value in accord to belows list:

btc[33], eth[34], ltc[35], doge[36], bch[37], xrp[38], trx[39], eos[40]

example for XRP:

document.querySelectorAll('button')[7].click()
document.querySelectorAll('button')[38].click()

(THIS WORK ON DICE PAGE)

Edited by ivand2128
adds
Link to post
Share on other sites

Hello Seuntjie,

absolutely agreed !!! (even if I was preferring API's in order to use javascript and my ways, rather than LUA... but yes, for dice game, your software it's absolutely better than my solution... only about dice game).

HOWEVER, the problem is that your software is great only to play on dice game... while I'd like to play on roulette and baccarat also (mainly)... and, by what I know, it's not possible with your dicebot. It would be great if you could expand the your dicebot programmer mode to others game also.

So, don't knowing what will happen about API's (since I sent my errors ID in order to be whitelisted, but still nothing, and topic about is also disappeared), then I created this place to share codes, in order to play on all games... hoping will be supported by someone.

So, also your support about others games will be good appreciated.

Thanks

Link to post
Share on other sites
  • Forum Admin

All API requests used on the frontend of stake.com are already whitelisted. If you wanted to create a custom strategy, you could just use those API requests without needing to go through the process of whitelisting your own. Easiest way to copy them would be right clicking on the page > selecting "inspect" > viewing "network" > limiting to "XHR" > and copying the relevant graphql request

This has always been the most appropriate way to learn about how the site's API works.

Link to post
Share on other sites
7 hours ago, Dan said:

All API requests used on the frontend of stake.com are already whitelisted. If you wanted to create a custom strategy, you could just use those API requests without needing to go through the process of whitelisting your own. Easiest way to copy them would be right clicking on the page > selecting "inspect" > viewing "network" > limiting to "XHR" > and copying the relevant graphql request

This has always been the most appropriate way to learn about how the site's API works.

Dude, thank you so much for that, i didn't knew there is such option.

Love you with all my heart ❤️

Link to post
Share on other sites
13 hours ago, Dan said:

All API requests used on the frontend of stake.com are already whitelisted. If you wanted to create a custom strategy, you could just use those API requests without needing to go through the process of whitelisting your own. Easiest way to copy them would be right clicking on the page > selecting "inspect" > viewing "network" > limiting to "XHR" > and copying the relevant graphql request

This has always been the most appropriate way to learn about how the site's API works.

Thanks a lot @Dan for your reply,

however Im not sure if well understood... I mean...

I was already using your way to get the queries string (copying them from browser network tool as you said, and pasting them into my programs written on VScode for example)... but now this isn't working anymore, returning an error like this '{"response":{"errors":[{"path":[],"message":"unknown query \"mutationRouletteBet\" (114624)","errorType":"graphqlError"}],"status":500}' on the roulette game for example, like discussed on previous topic.

I also tried your way using Insomnia... copying the api to place bet on roulette, and paste it into Insomnia... and trying in more ways, with and without x-access-token header, etc... but no one ways worked... always returned error of unknown query with error ID.

So please, could you better explain how to use the normal way you said, which me too was already using until previous week?

Further, but may be less important for now, there are the 'get' commands which haven't an API on the frontend... for example, get the balance/s value... for these is still need to use the querySelector of browser console. There is some good solution for these commands too?

API's was the best solution... I hope you'll enable them again soon.

But in the while, or if you'll not enable API's again, could you better clear the first question please?

Thanks a lot

7 hours ago, DreamStage said:

Dude, thank you so much for that, i didn't knew there is such option.

Love you with all my heart ❤️

This to update my previous post...

at the end, after several attempts, I found my error... I was missing to add a last white line (last \n character), so basically that single different char was resulting in a different string of course, producing an unwhitelisted query... so checking all chars i found my error, and solved, thanks.

However I'd like to post some little minimal things, but sometimes could help also...

all game API's which can be get by frontend, are missing of the 'nonce' in the query, so missing also in server response... could be possible to add it? may be you can post API's whitelisted with nonce also please? (you was posted dice API whitelisted in previous topic... but being that topic now canceled, I cannot get it... besides would be great to have it also for main games also, like roulette/baccarat). It would be great if you can.

Further, would be very great and helpful to have also whitelisted API about user info (to get balances and others info for example), and may be also currency info... before, I had an enough complete query about, which I write below... would be great if you can post something similar whitelisted. Info query was:

variables={infocurrency:'xrp', listlimit:10};

query=

{

      info{

        currency(currency:${infocurrency}) {

          smallestUnit

          betMax{name,value}

          betMaxProfit{name,value}

          tipMin{name,value}

          value

          name

        }

      }

      user{

      name

      id

      email

      previousClientSeed{

          id

          seed          

      }

      activeClientSeed{

        id

        seed          

      }

      previousServerSeed{

        id

        nonce

        seed

        seedHash

        nextSeedHash          

      }

      activeServerSeed{

        id

        nonce

        seed

        seedHash

        nextSeedHash          

      }      

      balances{available{currency,amount}}

      tipList(limit:${listlimit}){id,currency,amount,createdAt,sendBy{name},chat{id,name}}

      sendTipList(limit:${listlimit}){

        id,currency,amount,createdAt,sendBy{name},chat{id,name},

        user{name,id}}      

    }

    }

 

Furthermore another thing for now please... before, with API's, I was able to change server-seed and client-seed separately... while now, with frontend api, it's only possible to change both of them forcedly together. Could you post whitelisted separated API's for client and server seed please? It would be great also this, allowing a complete huge customization of strategies if need.

Before, I was using following queries for these purposes:

-server-seed

mutation {

        rotateServerSeed {

          id

          seedHash

          active

          createdAt

        }

    }

-client-seed

variables={newclientseed:'abc123'};

query=

mutation {

    changeClientSeed(seed: "${newclientseed}") {

        id

        seed

        active

        createdAt

    }

}

 

It would be really great if you could help with these last things, which may be seems little thing but helpful anyway... especially the balances, since now there is no way to know balances after the bets (and also other things may help).

Thanks a lot in advance.

Edited by ivand2128
adjust
Link to post
Share on other sites
  • Forum Admin
12 hours ago, ivand2128 said:

Thanks a lot @Dan for your reply,

however Im not sure if well understood... I mean...

I was already using your way to get the queries string (copying them from browser network tool as you said, and pasting them into my programs written on VScode for example)... but now this isn't working anymore, returning an error like this '{"response":{"errors":[{"path":[],"message":"unknown query \"mutationRouletteBet\" (114624)","errorType":"graphqlError"}],"status":500}' on the roulette game for example, like discussed on previous topic.

I also tried your way using Insomnia... copying the api to place bet on roulette, and paste it into Insomnia... and trying in more ways, with and without x-access-token header, etc... but no one ways worked... always returned error of unknown query with error ID.

So please, could you better explain how to use the normal way you said, which me too was already using until previous week?

Further, but may be less important for now, there are the 'get' commands which haven't an API on the frontend... for example, get the balance/s value... for these is still need to use the querySelector of browser console. There is some good solution for these commands too?

API's was the best solution... I hope you'll enable them again soon.

But in the while, or if you'll not enable API's again, could you better clear the first question please?

Thanks a lot

This to update my previous post...

at the end, after several attempts, I found my error... I was missing to add a last white line (last \n character), so basically that single different char was resulting in a different string of course, producing an unwhitelisted query... so checking all chars i found my error, and solved, thanks.

However I'd like to post some little minimal things, but sometimes could help also...

all game API's which can be get by frontend, are missing of the 'nonce' in the query, so missing also in server response... could be possible to add it? may be you can post API's whitelisted with nonce also please? (you was posted dice API whitelisted in previous topic... but being that topic now canceled, I cannot get it... besides would be great to have it also for main games also, like roulette/baccarat). It would be great if you can.

Further, would be very great and helpful to have also whitelisted API about user info (to get balances and others info for example), and may be also currency info... before, I had an enough complete query about, which I write below... would be great if you can post something similar whitelisted. Info query was:

variables={infocurrency:'xrp', listlimit:10};

query=

{

      info{

        currency(currency:${infocurrency}) {

          smallestUnit

          betMax{name,value}

          betMaxProfit{name,value}

          tipMin{name,value}

          value

          name

        }

      }

      user{

      name

      id

      email

      previousClientSeed{

          id

          seed          

      }

      activeClientSeed{

        id

        seed          

      }

      previousServerSeed{

        id

        nonce

        seed

        seedHash

        nextSeedHash          

      }

      activeServerSeed{

        id

        nonce

        seed

        seedHash

        nextSeedHash          

      }      

      balances{available{currency,amount}}

      tipList(limit:${listlimit}){id,currency,amount,createdAt,sendBy{name},chat{id,name}}

      sendTipList(limit:${listlimit}){

        id,currency,amount,createdAt,sendBy{name},chat{id,name},

        user{name,id}}      

    }

    }

 

Furthermore another thing for now please... before, with API's, I was able to change server-seed and client-seed separately... while now, with frontend api, it's only possible to change both of them forcedly together. Could you post whitelisted separated API's for client and server seed please? It would be great also this, allowing a complete huge customization of strategies if need.

Before, I was using following queries for these purposes:

-server-seed

mutation {

        rotateServerSeed {

          id

          seedHash

          active

          createdAt

        }

    }

-client-seed

variables={newclientseed:'abc123'};

query=

mutation {

    changeClientSeed(seed: "${newclientseed}") {

        id

        seed

        active

        createdAt

    }

}

 

It would be really great if you could help with these last things, which may be seems little thing but helpful anyway... especially the balances, since now there is no way to know balances after the bets (and also other things may help).

Thanks a lot in advance.

If you are getting an error, then you aren't using the whitelisted API calls. Think about it logically for a moment, if it works when using the site, it would work everywhere else. You are either changing the API call structure or you are not passing the query variable in correctly.

 

Why are you wrapping your placeholders like this? 

limit:${listlimit}){id,currency,amount,createdAt,sendBy{name},chat{id,name}

Nowhere in any API call is it done like that, why are you making up your own way of doing API calls?

Using the frontend, you can abstract the correct method to do everything you have asked above, you keep ignoring the instructions and as a result I had to disable the topic.

 

I am not sure what package you are doing to handle your http requests, but heres an example of how to appropriately do a graphql call with apollo-fetch (nodejs)

const { createApolloFetch } = require('apollo-fetch');

const fetch = createApolloFetch({
  uri: 'https://1jzxrj179.lp.gql.zone/graphql',
});

fetch({
  query: `query PostsForAuthor($id: Int!) {
    author(id: $id) {
      firstName
      posts {
        title
        votes
      }
    }
  }`,
  variables: { id: 1 },
}).then(res => {
  console.log(res.data);
});

 

Link to post
Share on other sites
10 hours ago, Dan said:

If you are getting an error, then you aren't using the whitelisted API calls. Think about it logically for a moment, if it works when using the site, it would work everywhere else. You are either changing the API call structure or you are not passing the query variable in correctly.

 

Why are you wrapping your placeholders like this? 


limit:${listlimit}){id,currency,amount,createdAt,sendBy{name},chat{id,name}

Nowhere in any API call is it done like that, why are you making up your own way of doing API calls?

Using the frontend, you can abstract the correct method to do everything you have asked above, you keep ignoring the instructions and as a result I had to disable the topic.

 

I am not sure what package you are doing to handle your http requests, but heres an example of how to appropriately do a graphql call with apollo-fetch (nodejs)


const { createApolloFetch } = require('apollo-fetch');

const fetch = createApolloFetch({
  uri: 'https://1jzxrj179.lp.gql.zone/graphql',
});

fetch({
  query: `query PostsForAuthor($id: Int!) {
    author(id: $id) {
      firstName
      posts {
        title
        votes
      }
    }
  }`,
  variables: { id: 1 },
}).then(res => {
  console.log(res.data);
});

 

Hi @Dan,

I was updated my last post (and them are merged automatically).

Like said, you're right, I was doing a little error... I was missing to add last '\n' character into query (a white line at the end)... since currently, api's are recognized only if exactly equal to the whitelisted ones... thus now, even if there is a single white-space more or less, then an api is not recognized (basically we could say now are treated like string rather than graphql queries).
 Likely also in previous topic I was doing same error... after 'prettyfing' the copied/pasted query, it was resulting as not recognized... it's because I was believe that queries were whitelisted in accord to some user details, but I was wrong, sorry.

May be images can explain better than my words...

Correct.thumb.PNG.7a46b6a596151455324cfd03bc93c31e.PNGCorrect-no.thumb.PNG.0e3d3f00300c18f067a088f2fdd49a4d.PNG

(Even a single charater or even a single white-space, will result to unrecognized query... I added a white-line in the image, to show what I mean)

Anyway, now I found my error... so now I have the api's to play on dice/roulette/baccarat, and even others games if I want like. Thanks

However, like said, would be very helpful to have the whitelisted API query to get the balances value... and also separated seeds changing would be great.

So, can you post the whitelisted API query to get balances values please?

------------------------

About...

12 hours ago, Dan said:

Why are you wrapping your placeholders like this? 


limit:${listlimit}){id,currency,amount,createdAt,sendBy{name},chat{id,name}

Nowhere in any API call is it done like that, why are you making up your own way of doing API calls?

Simply, I have a file where I was written may be all API commands to be used when needs... so, that was simply a pre-setted query to get complete details about 'currency' and 'user'... however I almost never used that (just sometime to get the seeds values, in order to apply the verify on bets)... I always used the following lighter query to get just the balances:

Quote

{ user { balances { available { currency, amount } } } }

So, it would be very helpful, if you can post the currently whitelisted query to get the balances, please. (if it could contain also info about seeds, would be great for 2 purposes... to get seeds values for verify purpose... the get 'nonce' value, which is not returned by betting API's).

Anyway, that complete API query to get info, is correct, you can check it on primedice... but basically I'm interested to balances values, and may be seeds.

Besides...

Quote

`mutation { rotateServerSeed { id, seedHash, active, createdAt } }`

`mutation { changeClientSeed(seed: "${newclientseed}")  {

        id, seed, active, createdAt, } }`

it would be good to have also api's for separated seed changing, like above (I was using before). But this is surely less important rather than get balances values. Thanks.

----------------------

About...

12 hours ago, Dan said:

I am not sure what package you are doing to handle your http requests,........

Using VScode, for graphql I use 'graphql-request' package as client for graphql http calls.

However sometimes I also use Insomnia, for instance to create queries or to do some fast check on queries.

Problem wasn't the used client, but the query string I was writing, like said above... since now queries are recognized only if them are sent as exact whitelisted strings, a single white-space or even tabulation was in my queries was leading me to bad calls. This is happening only by last week, when new restrictions has been applied... before I always created/checked/used API's by meself without problems, like I do on primedice.

--------

To finish, since I solved about bet APIs... now it would be great if you can just post whitelisted APIs to get balances values mainly, and may be APIs for seeds values and separated seeds changing.

Thanks again.

Link to post
Share on other sites
29 minutes ago, forzaXD said:

i'm also getting 500 errors on api calls even if i copied them from google chrome console and didn't edit anything

stake-api-error.png

Sperando di non sbagliare ancora... quando ti copi la stringa query dal devtool del browser, per poi incollarla nel tuo client, devi fare completa attenzione ad ogni singolo carattere, perchè anche semplicemente uno spazio in più o in meno ti porta all'errore... in pratica adessohanno messo una restrizione sulle api, in pratica lasciando passare solo le query con stringhe esattamente uguali a quelle che stake ha memorizzato nella loro whitelist... quindi puoi capire che in una stringa, anche un solo carattere in più/meno/differente risulta in una stringa differente. Anche una differente 'tabulazione' della query risulta in una stringa differente. Quindi, anche ad esempio, usando il 'prettyifier' del tuo client, potrebbe produrti una stringa query differente da quella che stake ha 'smarcato' tra quelle consentite.  Inoltre, se fai attenzione, le query dal browser finiscono con l'ultima riga vuota... ecco, se ti dimentichi di mettere anche solo quella, ti risulterà in errore :) . Io stavo impazzendo.

Il mio consiglio è di copiarti esattamente la stringa dal devtool del browser... incollarla nel tuo client, senza assolutamente usare il 'prettyfier'... poi qualora la stringa incollata sia piena dei caratteri '\n', allora procedi manualmente uno per uno, a cancellarli e premere Invio per ognuno di essi... anche quello alla fine della query.

In pratica, come detto, la stringa risultante deve essere perfettamente uguale (gli '\n' valgono come 'a capo') in ogni singolo carattere, alla stringa che vedi nel devtool del browser.

Spero ti sia utile.

TRANSLATE:

you need to pay complete attention to every sincle character of the query string... the string you use into your client have to be exactly the same with string shown int browser devtool. Even a single character more/less/different (or even a white-line more/less, or a different tabulation) will result as different string rather than the whitelisted one (from browser devtool). Besides, notice also that whitelisted strings, finishes with a white-line (\n), so also that have to be included, otherwise will result as different string.

Thus don't use any 'prettyfier', tabulation or other... and make sure the string you use into your client is exactly the same (in every single character/space/white-line) with string you see into browser devtool.

Hope this help.

Link to post
Share on other sites
2 minutes ago, ivand2128 said:

Sperando di non sbagliare ancora... quando ti copi la stringa query dal devtool del browser, per poi incollarla nel tuo client, devi fare completa attenzione ad ogni singolo carattere, perchè anche semplicemente uno spazio in più o in meno ti porta all'errore... in pratica adessohanno messo una restrizione sulle api, in pratica lasciando passare solo le query con stringhe esattamente uguali a quelle che stake ha memorizzato nella loro whitelist... quindi puoi capire che in una stringa, anche un solo carattere in più/meno/differente risulta in una stringa differente. Anche una differente 'tabulazione' della query risulta in una stringa differente. Quindi, anche ad esempio, usando il 'prettyifier' del tuo client, potrebbe produrti una stringa query differente da quella che stake ha 'smarcato' tra quelle consentite.  Inoltre, se fai attenzione, le query dal browser finiscono con l'ultima riga vuota... ecco, se ti dimentichi di mettere anche solo quella, ti risulterà in errore :) . Io stavo impazzendo.

Il mio consiglio è di copiarti esattamente la stringa dal devtool del browser... incollarla nel tuo client, senza assolutamente usare il 'prettyfier'... poi qualora la stringa incollata sia piena dei caratteri '\n', allora procedi manualmente uno per uno, a cancellarli e premere Invio per ognuno di essi... anche quello alla fine della query.

In pratica, come detto, la stringa risultante deve essere perfettamente uguale (gli '\n' valgono come 'a capo') in ogni singolo carattere, alla stringa che vedi nel devtool del browser.

Spero ti sia utile.

TRANSLATE:

you need to pay complete attention to every sincle character of the query string... the string you use into your client have to be exactly the same with string shown int browser devtool. Even a single character more/less/different (or even a white-line more/less, or a different tabulation) will result as different string rather than the whitelisted one (from browser devtool). Besides, notice also that whitelisted strings, finishes with a white-line (\n), so also that have to be included, otherwise will result as different string.

Thus don't use any 'prettyfier', tabulation or other... and make sure the string you use into your client is exactly the same (in every single character/space/white-line) with string you see into browser devtool.

Hope this help.

Hey i'm not italian but thanks for the info

i used copy command for chrome console to not interferee to query and to copy every character as you stated earlier.

can you please provide some short query that is 100% working for you so that i can verify if my setting for Postman are correct?

i tried every query available for this moment on forum and none of them works for me

p.s. sorry for replying in your topic with my questions

Link to post
Share on other sites
50 minutes ago, forzaXD said:

Hey i'm not italian but thanks for the info

i used copy command for chrome console to not interferee to query and to copy every character as you stated earlier.

can you please provide some short query that is 100% working for you so that i can verify if my setting for Postman are correct?

i tried every query available for this moment on forum and none of them works for me

p.s. sorry for replying in your topic with my questions

Sorry, by your nickname, and Milan logo, I was pretty sure you was Italian... so it was more easy exaplin for me... anyway...

I tried to post you what I'm using to play dice... but after checking, copying by here and pasting into client, it have the same problem generating an error... likely, the 'quote editor' resize the text, producing

I try to post you what I'm using to play dice... but anyway, I copied it from browser devtool, simply after pasting into client, I'm ensured everything was exactly the same. I don't know if you could face the same error after copying/pasting by here, but anyway try it.

Quote

mutation DiceRoll($amount: Float!, $target: Float!, $condition: CasinoGameDiceConditionEnum!, $currency: CurrencyEnum!, $identifier: String!) {
  diceRoll(amount: $amount, target: $target, condition: $condition, currency: $currency, identifier: $identifier) {
    ...CasinoBetFragment
    state {
      ...DiceStateFragment
      __typename
    }
    __typename
  }
}

fragment CasinoBetFragment on CasinoBet {
  id
  active
  payoutMultiplier
  amountMultiplier
  amount
  payout
  updatedAt
  currency
  game
  user {
    id
    name
    __typename
  }
  __typename
}

fragment DiceStateFragment on CasinoGameDice {
  result
  target
  condition
  __typename
}

 

Copy the above and paste into your client... after paste, also check it's 36 lines... if instead finishes on 35th line (with '}' ), then click Enter to add a new empty line. It have to be 36 lines, where 36th line is an empty line.dicequery.thumb.PNG.51ea5d1e26327f90824d910277638212.PNG

Try and let us know if you solved.

P.S.

of course, you need to add the x-access-token header, with your API token... and also need to add the variables

Quote

{
    "target": 50,
    "condition": "above",
    "identifier": "abc",
    "amount": 1e-8,
    "currency": "xrp"
}

 

Edited by ivand2128
add
Link to post
Share on other sites
8 minutes ago, forzaXD said:

thx for your sample query

i did copy and added 36th empty line and it gives same error

i think Postman tool that i use needs correct settings with right headers or smth else to work

Yes, of course like said, you need to add the x-access-token header, with your APY token as value of that...

likely you also need to add Content-Type: application/json  header.

And be sure to do a POST call.

headers.thumb.PNG.4242db2d1f8dd819b847f6019a3c6473.PNG

You could try to use Insomnia as client.

Edited by ivand2128
edit
Link to post
Share on other sites

well you can try this query - i just  verified and it works well

Quote

query UserVaultBalances {
  user {
    id
    balances {
      available {
        amount
        currency
        __typename
      }
      vault {
        amount
        currency
        __typename
      }
      __typename
    }
    __typename
  }
}
 

it shows both vault and available balance

Edited by forzaXD
Link to post
Share on other sites
58 minutes ago, forzaXD said:

well you can try this query - i just  verified and it works well

it shows both vault and available balance

I tried thanks, but doesn't work for me now :) .

Do you used postman or insomnia for this query?

Besides, how do you get it? clicking 'vault' under the user menu?

Or may be did you already have that query since some time?

I have a file with all commands queries, but them doesn't work anymore on stake, since 1 week now :( .

-----------------------

UPDATE

Like said, your query don't worked for me, however I solved thanks to vault frontend api. Thanks

It also have a lot of info more than balances, but no problem.

I also get the API to get seeds values. It's only sad, that currently I cannot change client and server seed separately anymore, like I was doing before.

So, let's hope @Dan will post mutations to change only server seed, and only client seed, like before. It's the last thing would remain to have.

Thanks.

Edited by ivand2128
update
Link to post
Share on other sites
2 hours ago, forzaXD said:

that query is called on every page load on stake and you can catch it in network tab as @Dan mentioned earlier in this topic.

i didn't manage to get right settings for Postman and now work only with Insomnia.

stake-api-balance.png

Yes, thanks, like said in updated post, I was solved also about balances, and all other things.

Yes, I was already using that method to get queries by frontend, but since a week now, something was changed... and on firsts attempts, I wasn't able to use the queries getted by frontend... but like said, it was because I was missing a single character (the empty line at the end of the query :) ).

Now I have newly create all commands, to use into my programs.

The only commands that still miss me, which cannot be get by frontend, is:

mutation query to change ONLY client seed.

I had also that command until previous week (before these last restrictions)... and often I was using it. It exists, in fact I still use it on primedice.

So I hope @Dan or someone else will post this other command whitelisted API.

For all rest, I solved, and have all commands now, to use for creation of my own programs.

Thanks

1 hour ago, Braven said:

I have some problems with code. Soon post what I get. Also Errors is very annoying. I will try more. 

Get queries from frontend (browser devtool>network), and copy the query by there into client you use... but take care to past exactly the same query string, because also a single character different will result in a different string, and will result into an unrecognized query. For instace, take also care that query finishes with an empty line as shown in above images.

Hope you'll solve.

Edited by ivand2128
adjust
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...