Jump to content
Stake Forum
Dan

Using the Stake API

Featured Comment

8 hours ago, cryptonesiac said:

Thanks Dan! I got it working more or less... now in Ruby, that was easier somehow :)

I shortened the query to


{
  bet(betId: "d2f7e317-9848-471b-b0d8-b4902b8a4c5b") {
    iid
  }
}

since I only wanted to know the normal bet ID (not the additional infos, yet)

I added other fields to help provide insight as to what you can also return, but if you only need the iid from a bet, thats the most efficient way to return what you need. Well done!

Share this post


Link to post
Share on other sites
mutation rouletteBet(
  $currency: CurrencyEnum!
  $colors: [RouletteBetColorsInput]
  $numbers: [RouletteBetNumbersInput]
  $parities: [RouletteBetParitiesInput]
  $ranges: [RouletteBetRangesInput]
  $rows: [RouletteBetRowsInput]
) {

Where can I get the definitions of the enum for the mutation rouletteBet? (currency, colors, numbers... etc)

Share this post


Link to post
Share on other sites
mutation hiloBet($amount: Float!, $currency: CurrencyEnum!, $startCard: HiloBetStartCardInput!) {
  hiloBet(amount: 0.00000001, currency: doge, startCard: $startCard) {
    ...BetFragment
    state {
      ...HiloStateFragment
    }
  }
}

mutation hiloNext($guess: CasinoGameHiloGuessEnum!) {
  hiloNext(guess: higher) {
    ...BetFragment
    state {
      ...HiloStateFragment
    }
  }
}

fragment HiloStateFragment on CasinoGameHilo {
  startCard {
    suit
    rank
  }
  rounds {
    card {
      suit
      rank
    }
    guess
    payoutMultiplier
  }
}

returns

{
  "errors": [
    {
      "path": [],
      "message": "Unknown fragment \"BetFragment\".",
      "errorType": "graphqlError",
      "data": null
    },
    {
      "path": [],
      "message": "Variable \"$amount\" is never used in operation \"hiloBet\".",
      "errorType": "graphqlError",
      "data": null
    },
    {
      "path": [],
      "message": "Variable \"$currency\" is never used in operation \"hiloBet\".",
      "errorType": "graphqlError",
      "data": null
    },
    {
      "path": [],
      "message": "Unknown fragment \"BetFragment\".",
      "errorType": "graphqlError",
      "data": null
    },
    {
      "path": [],
      "message": "Variable \"$guess\" is never used in operation \"hiloNext\".",
      "errorType": "graphqlError",
      "data": null
    }
  ]
}

Can't figure out what I'm doing wrong... especially the 'Variable $currency is never used' baffles me. Any help?

Share this post


Link to post
Share on other sites
On 7/13/2019 at 10:45 AM, cryptonesiac said:

"message": "Unknown fragment \"BetFragment\".",

BetFragment doesn't exist at all it's called -> CasinoBet

Quote

mutation hiloBet($amount: Float!, $currency: CurrencyEnum!, $startCard: HiloBetStartCardInput!)

Remove ($amount: Float!, $currency: CurrencyEnum!, $startCard: HiloBetStartCardInput!) it's just for you to know variable types, therefore:

mutation hiloBet { hiloBet(amount: 0.00000001, currency: doge, startCard: HiloBetStartCardInput INPUT VALUE)

 

And the rest is self explanatory as i have mentioned

 

Share this post


Link to post
Share on other sites
1 hour ago, Byteking said:

How to view bets from archives.

I think you can't... you can only view your last 550 bets:

{
  user(name: "cryptonesiac") {
    houseBetList(limit: 50, offset: 0) {
      id
      iid
      bet {
        ... on CasinoBet {
          game
          payout
          amountMultiplier
          payoutMultiplier
          amount
          currency
          createdAt
        }
      }
    }
  }
}

 

If anyone has a working example of the HiLo queries or Blackjack, please send me a message. Will tip you if I can make it work locally :)

Share this post


Link to post
Share on other sites
On 7/19/2019 at 12:21 AM, DreamStage said:

mutation hiloBet { hiloBet(amount: 0.00000001, currency: doge, startCard: HiloBetStartCardInput INPUT VALUE)

That's the part I don't understand... what exactly do I add after startCard:

I've tried many things, but it always returns an error.. Can someone give a simple example of a working starCard?

Share this post


Link to post
Share on other sites
On 8/6/2019 at 3:23 PM, nuuuitsjdragon said:

What can API(s) achieve besides creating bots to run certain commands for you?

I'm assuming many functions as it's just calling the data from the webpage or even getting it to automate actions on your behalf, right?

Yep. Essentially that's all it can do + a few boring things. I think it's main purpose is for exactly what you mentioned. Automating betting.

Share this post


Link to post
Share on other sites
Posted (edited)
On 8/6/2019 at 11:23 PM, nuuuitsjdragon said:

What can API(s) achieve besides creating bots to run certain commands for you?

I'm assuming many functions as it's just calling the data from the webpage or even getting it to automate actions on your behalf, right?

Adjusting balance / bet amount, finetuning a strategy, collecting more data on your bets, betting in a light-weight terminal in stead of the website..

In case of blackjack / hilo one could automate this (since there's no auto-mode).

 

Edit: I'm offering 10k satoshis for the first person who can give me a working example of hilo or blackjack

Edited by cryptonesiac

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×