Jump to content
Dan

Using the Stake API

Featured Comment

58 minutes ago, Kristian Nugrah said:

 

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

You shouldnt be using a chatId, unless you want the tip to be public. And if you want to sue a chat id, you need to use the id from the result of the query provided in the first post of the topic.

Share this post


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

You shouldnt be using a chatId, unless you want the tip to be public. And if you want to sue a chat id, you need to use the id from the result of the query provided in the first post of the topic.

i'm always getting error  "message": "API access restricted", "errorType": "restrictedScope" when i use chat id, how to get chatId for public if i'm not using chat id  im getting error "message": "Field \"sendTip\" argument \"chatId\" of type \"String!\" is required, but it was not provided.", help me please for sent tip to other player using API

tip.png

chat.png

tip.png

tip.png

Share this post


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

i'm always getting error  "message": "API access restricted", "errorType": "restrictedScope" when i use chat id, how to get chatId for public if i'm not using chat id  im getting error "message": "Field \"sendTip\" argument \"chatId\" of type \"String!\" is required, but it was not provided.", help me please for sent tip to other player using API

tip.png

chat.png

tip.png

tip.png

Restricted scope means you arent authenticating correctly with the API, you are probably using the token found under your account settings, but if you want to tip, you need ot use your jwt token. How to obtain your jwt token you need to right click on the stake website, and go to 'inspect' or developer tools. Then go to application > local storage > stake.com

From there you can copy your jwt token and it will have enough privileges to send a tip.

18 hours ago, williamshennie9 said:

Hey Dan, any idea how to use the API to view deposit history, withdrawals, tips sent and received past the offset of 500?

Currently it is not possible to lookup transactional data beyond 500 offset. Our system doesn't handle it very well.

Share this post


Link to post
Share on other sites
On 9/2/2019 at 8:55 AM, Dan said:

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

 

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

 


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

 

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
  }
}

 

So with this information, how am I able to play on Stake via it’s API?

Do I have to code a program and input these information or will I be able to do it via the browser alone?

Share this post


Link to post
Share on other sites
4 minutes ago, nuuuitsjdragon said:

So with this information, how am I able to play on Stake via it’s API?

Do I have to code a program and input these information or will I be able to do it via the browser alone?

You can play stake.com from anywhere without a browser if you know what you are doing.

Share this post


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

Restricted scope means you arent authenticating correctly with the API, you are probably using the token found under your account settings, but if you want to tip, you need ot use your jwt token. How to obtain your jwt token you need to right click on the stake website, and go to 'inspect' or developer tools. Then go to application > local storage > stake.com

From there you can copy your jwt token and it will have enough privileges to send a tip.

Currently it is not possible to lookup transactional data beyond 500 offset. Our system doesn't handle it very well.

I have used jwt from local storage but I get the same result. I don't use 2fa on my account, is there anything I have to add to the header or query @Dan

 tip.thumb.png.d99df14d5fdc5493891f83afeadede58.png

Share this post


Link to post
Share on other sites
On 10/15/2019 at 11:31 AM, Kristian Nugrah said:

I have used jwt from local storage but I get the same result. I don't use 2fa on my account, is there anything I have to add to the header or query @Dan

 tip.thumb.png.d99df14d5fdc5493891f83afeadede58.png

I think you might be hitting this error because you haven't met the tip requirement yet on stake? I think it is $100 wagered. Are you able to send tips currently on the site, without using the API?

Share this post


Link to post
Share on other sites

Hi Dan!  While you're pulling the slot info for eothica can you also get the set of Blackjack queries/mutations for me?   :) 

Share this post


Link to post
Share on other sites
On 9/2/2019 at 2:55 AM, Dan said:

 


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

 

Hello @Dan what's the tfaToken?

Edited by eothica

Share this post


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

Hello @Dan what's the tfaToken?

The two factor authentication token is obtained from an authenticator app like Authy or Google authenticator.   If you don't need one every time you withdraw manually or log in, then you don't need it here

Edited by fungii

Share this post


Link to post
Share on other sites
On 10/17/2019 at 6:01 PM, eothica said:

@Dan What's the api call for the slot game? :D

I'm not @Dan, but here you are:

mutation slotsBet(
	$amount: Float!,
	$lines: Float!,
	$currency: CurrencyEnum!
) {
	slotsBet(amount: $amount, currency: $currency, lines: $lines) {
		...CasinoBetFragment
		state {
			...SlotsStateFragment
		}
	}
}

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

fragment SlotsStateFragment on CasinoGameSlots {
	lines
	rounds {
		offsets
		paylines {
			payline
			hits
			multiplier
			symbol
		}
		scatterMultiplier
		roundMultiplier
		totalMultiplier
		bonusRemaining
		bonusTotal
	}
}

 

On 10/18/2019 at 9:14 AM, fungii said:

Hi Dan!  While you're pulling the slot info for eothica can you also get the set of Blackjack queries/mutations for me?   :) 

I'm still not @Dan, but here you are as well:

Query to check active game:

query blackjackActiveBet {
	user {
		id
		activeCasinoBet(game: blackjack) {
			...CasinoBetFragment
			state {
				...BlackjackStateFragment
			}
		}
	}
}

Place bet:

mutation blackjackBet(
	$amount: Float!,
	$currency: CurrencyEnum!
) {
	blackjackBet(amount: $amount, currency: $currency) {
		...CasinoBetFragment
		state {
			...BlackjackStateFragment
		}
	}
}

Next action:

mutation blackjackNext(
	$action: BlackjackNextActionInput!
) {
	blackjackNext(action: $action) {
		...CasinoBetFragment
		state {
			...BlackjackStateFragment
		}
	}
}

Fragments are the same in each call:

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

fragment BlackjackStateFragment on CasinoGameBlackjack {
	player {
		value
		actions
		cards {
			rank
			suit
		}
	}
	dealer {
		value
		actions
		cards {
			rank
			suit
		}
	}
}

 

Share this post


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

I'm not @Dan, but here you are:


mutation slotsBet(
	$amount: Float!,
	$lines: Float!,
	$currency: CurrencyEnum!
) {
	slotsBet(amount: $amount, currency: $currency, lines: $lines) {
		...CasinoBetFragment
		state {
			...SlotsStateFragment
		}
	}
}

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

fragment SlotsStateFragment on CasinoGameSlots {
	lines
	rounds {
		offsets
		paylines {
			payline
			hits
			multiplier
			symbol
		}
		scatterMultiplier
		roundMultiplier
		totalMultiplier
		bonusRemaining
		bonusTotal
	}
}

 

I'm still not @Dan, but here you are as well:

Query to check active game:


query blackjackActiveBet {
	user {
		id
		activeCasinoBet(game: blackjack) {
			...CasinoBetFragment
			state {
				...BlackjackStateFragment
			}
		}
	}
}

Place bet:


mutation blackjackBet(
	$amount: Float!,
	$currency: CurrencyEnum!
) {
	blackjackBet(amount: $amount, currency: $currency) {
		...CasinoBetFragment
		state {
			...BlackjackStateFragment
		}
	}
}

Next action:


mutation blackjackNext(
	$action: BlackjackNextActionInput!
) {
	blackjackNext(action: $action) {
		...CasinoBetFragment
		state {
			...BlackjackStateFragment
		}
	}
}

Fragments are the same in each call:


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

fragment BlackjackStateFragment on CasinoGameBlackjack {
	player {
		value
		actions
		cards {
			rank
			suit
		}
	}
	dealer {
		value
		actions
		cards {
			rank
			suit
		}
	}
}

 

Thanks @toohoola <3

Share this post


Link to post
Share on other sites
On 10/21/2019 at 4:56 PM, toohoola said:

I'm not @Dan, but here you are:


mutation slotsBet(
	$amount: Float!,
	$lines: Float!,
	$currency: CurrencyEnum!
) {
	slotsBet(amount: $amount, currency: $currency, lines: $lines) {
		...CasinoBetFragment
		state {
			...SlotsStateFragment
		}
	}
}

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

fragment SlotsStateFragment on CasinoGameSlots {
	lines
	rounds {
		offsets
		paylines {
			payline
			hits
			multiplier
			symbol
		}
		scatterMultiplier
		roundMultiplier
		totalMultiplier
		bonusRemaining
		bonusTotal
	}
}

 

I'm still not @Dan, but here you are as well:

Query to check active game:


query blackjackActiveBet {
	user {
		id
		activeCasinoBet(game: blackjack) {
			...CasinoBetFragment
			state {
				...BlackjackStateFragment
			}
		}
	}
}

Place bet:


mutation blackjackBet(
	$amount: Float!,
	$currency: CurrencyEnum!
) {
	blackjackBet(amount: $amount, currency: $currency) {
		...CasinoBetFragment
		state {
			...BlackjackStateFragment
		}
	}
}

Next action:


mutation blackjackNext(
	$action: BlackjackNextActionInput!
) {
	blackjackNext(action: $action) {
		...CasinoBetFragment
		state {
			...BlackjackStateFragment
		}
	}
}

Fragments are the same in each call:


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

fragment BlackjackStateFragment on CasinoGameBlackjack {
	player {
		value
		actions
		cards {
			rank
			suit
		}
	}
	dealer {
		value
		actions
		cards {
			rank
			suit
		}
	}
}

 

Hi, thanks for the info.   Do you work @/for/win/own the company that operates Stake?   

Share this post


Link to post
Share on other sites
On 10/23/2019 at 11:35 AM, fungii said:

Hi, thanks for the info.   Do you work @/for/win/own the company that operates Stake?   

No, I actually have a somewhat suspended account on Stake. I can't receive any rains in their chat.
I make some bots for myself and sometimes I help for people who ask for help.

Share this post


Link to post
Share on other sites
On 6/25/2019 at 10:27 AM, Dan said:

mutation {
  createVaultWithdrawal(
    currency: btc
    amount: 0.0000000088
    password: "password"
    tfaToken: "123456"
  ) {
    id
  }
}

 

Hey @Dan. Can we have a deposit version of this? or open up for this?

mutation CreateVaultDepositMutation($amount: Float!, $currency: CurrencyEnum!) {
  createVaultDeposit(amount: $amount, currency: $currency) {
    id
    amount
    currency
    user {
      id
      balances {
        available {
          amount
          currency
          __typename
        }
        vault {
          amount
          currency
          __typename
        }
        __typename
      }
      __typename
    }
    __typename
  }
}

 

On 9/2/2019 at 2:55 AM, Dan said:

 


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

 

Hey @Dan. How would a XRP which includes tag, look? furthermore, the mutation just throws an error:

{
    "errors": [
        {
            "path": [
                "createWithdrawal"
            ],
            "message": "error.string_empty",
            "errorType": "stringEmpty",
            "data": {}
        }
    ],
    "data": null
}

 

Edited by eothica

Share this post


Link to post
Share on other sites
2 hours ago, Saaho2019 said:

@Dan any query to claim hourly boost via api ?

 

You can't claim the boost via the API due to the need to solve the captcha.

On 11/19/2019 at 7:46 PM, paddyspub said:

@Dan can you pls provide query that returns user status :  Vip (bronze,silver etc) or regular. Thanks

This query is not available to people with privileges below support.

On 10/27/2019 at 10:44 PM, eothica said:

Hey @Dan. Can we have a deposit version of this? or open up for this?


mutation CreateVaultDepositMutation($amount: Float!, $currency: CurrencyEnum!) {
  createVaultDeposit(amount: $amount, currency: $currency) {
    id
    amount
    currency
    user {
      id
      balances {
        available {
          amount
          currency
          __typename
        }
        vault {
          amount
          currency
          __typename
        }
        __typename
      }
      __typename
    }
    __typename
  }
}

 

Hey @Dan. How would a XRP which includes tag, look? furthermore, the mutation just throws an error:


{
    "errors": [
        {
            "path": [
                "createWithdrawal"
            ],
            "message": "error.string_empty",
            "errorType": "stringEmpty",
            "data": {}
        }
    ],
    "data": null
}

 

For XRP addresses with a tag, you append a colon and the tag to the end, for example:

"wallet_address:tag"

Technically all XRP addresses have a tag, so that probably why you are getting an error. For rare cases where a provider doesnt give youa . tag with their address, its because the tag is 0 and therefore the address defaults to:

"wallet_address:0"

 

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.


×