Jump to content
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
On 7/21/2019 at 2:02 AM, Byteking said:

How to view bets from archives.

You can download them via: https://stake.com/transactions/archive

 

On 8/10/2019 at 12:54 AM, cryptonesiac said:

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).

Also to add, playing via an API uses far less resources on your computer, as the front end runs a whole lot of garbage that probably isn't necessary (visual animations, item rendering, etc.)

 

On 9/1/2019 at 7:49 AM, eothica said:

@Dan Is there a API call to withdraw?

mutation {
  createWithdrawal(currency: btc, address: "", amount: 0.000001, tfaToken: "") {
    id
    name
    address
    amount
    refFee
    status
  }
}

 

On 8/10/2019 at 12:54 AM, cryptonesiac said:

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

Starting a game

mutation {
  hiloBet(
    amount: 1
    currency: doge
    startCard: { suit: "D", rank: "A" }
    guess: higher
  ) {
    id
    active
    state {
      ... on CasinoGameHilo {
        startCard {
          suit
          rank
        }
        rounds {
          card {
            suit
            rank
          }
          guess
        }
      }
    }
  }
}

Suit, Rank and Guess Definitions

const suits = [‘D’, ‘H’, ‘S’, ‘C’];
const ranks = [
 ‘2’,
 ‘3’,
 ‘4’,
 ‘5’,
 ‘6’,
 ‘7’,
 ‘8’,
 ‘9’,
 ‘10’,
 ‘J’,
 ‘Q’,
 ‘K’,
 ‘A’
];
const ranks = ['higher', 'lower', 'equal', higherEqual', 'lowerEqual'];

Making next guess

mutation {
  hiloNext(guess: higher) {
    active
    state {
      ... on CasinoGameHilo {
        startCard {
          suit
          rank
        }
        rounds {
          card {
            suit
            rank
          }
          guess
        }
      }
    }
  }
}

How to Cashout

mutation {
  hiloCashout {
    active
  }
}

 

Share this post


Link to post
Share on other sites
On 9/11/2019 at 11:57 AM, LeAppelsap said:

What are the API requests for the VIP Rakeback amounts.

query AvailableRakeback {
	user {
		rakeback {
			balances {
				currency
				amount: availableAmount
			}
		}
	}
}

 

Edited by toohoola

Share this post


Link to post
Share on other sites

Kenobet

 

mutation{
  kenoBet(amount: ${taruhan}, currency: ${tipe}, risk: ${kondisi}, numbers: ${target}){
    id
    payout
    amount
    payoutMultiplier
    createdAt
    user {
      id
      name
      balances {
        available {
          currency
        amount
        }
      }
    }
  }
}

 can help me for place multiple number in keno, but numbers requitment is Integer, can help me to use multiple number in keno like array. ex placing number 1, 2 ,3 ,4 and 5 in same round

Share this post


Link to post
Share on other sites
4 hours ago, Kristian Nugrah said:

Kenobet

 


mutation{
  kenoBet(amount: ${taruhan}, currency: ${tipe}, risk: ${kondisi}, numbers: ${target}){
    id
    payout
    amount
    payoutMultiplier
    createdAt
    user {
      id
      name
      balances {
        available {
          currency
        amount
        }
      }
    }
  }
}

 can help me for place multiple number in keno, but numbers requitment is Integer, can help me to use multiple number in keno like array. ex placing number 1, 2 ,3 ,4 and 5 in same round

kenoBet

// bet on tiles 1 to 5 (index 0 - 4)

mutation {
  kenoBet(amount: 1, currency: doge, risk: medium, numbers: [0, 1, 2, 3, 4]) {
    id
    payout
    amount
    payoutMultiplier
    createdAt
  }
}

possible risks

enum CasinoGameKenoRiskEnum {
  classic
  low
  medium
  high
}

 

Share this post


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

kenoBet


// bet on tiles 1 to 5 (index 0 - 4)

mutation {
  kenoBet(amount: 1, currency: doge, risk: medium, numbers: [0, 1, 2, 3, 4]) {
    id
    payout
    amount
    payoutMultiplier
    createdAt
  }
}

possible risks


enum CasinoGameKenoRiskEnum {
  classic
  low
  medium
  high
}

 

thankyou boss for helping :)

Share this post


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

Sorry, I'm not too sure what you are asking?

state {
      ... on CasinoGameKeno {
		result
}

about state keno result like dice and other game,

because i'm use result i'm getting message unknow result

Share this post


Link to post
Share on other sites
On 10/11/2019 at 10:17 AM, Dan said:

Sorry, I'm not too sure what you are asking?

and 1 again can help me about mutation or query for recive tip list and send tip to users with api

tip.thumb.png.d81beeff612533aca7a402bcf8c27a85.png

Edited by Kristian Nugrah

Share this post


Link to post
Share on other sites
22 hours ago, Kristian Nugrah said:

and 1 again can help me about mutation or query for recive tip list and send tip to users with api

tip.thumb.png.d81beeff612533aca7a402bcf8c27a85.png

The answer to this question, is found in the very first post on this topic.

On 10/11/2019 at 9:00 PM, Kristian Nugrah said:

state {
      ... on CasinoGameKeno {
		result
}

about state keno result like dice and other game,

because i'm use result i'm getting message unknow result

Available types inside the spread for CasinoGameKeno:

type CasinoGameKeno {
    drawnNumbers: [Int!]!
    selectedNumbers: [Int!]!
    risk: CasinoGameKenoRiskEnum!
}

 

Share this post


Link to post
Share on other sites
49 minutes ago, Dan said:

The answer to this question, is found in the very first post on this topic.

Available types inside the spread for CasinoGameKeno:


type CasinoGameKeno {
    drawnNumbers: [Int!]!
    selectedNumbers: [Int!]!
    risk: CasinoGameKenoRiskEnum!
}

 

 

how about query or mutation send and recive tip from user i'm alwas getting error messange to llok result with api key for tip

 

tip.png

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.


×