Jump to content

Using the Stake API


Featured Comment

  • Moderator
4 hours ago, ElEdu74 said:

Sometimes "session" appears, other times "jwt", but in any case I get the error "jwtToken"

just use the session token shown in the settings here:

image.thumb.png.6f700bc24d2cecf9e3ae6ca9c2dedcac.png

If that doesn't help please try to be a bit more specific as to what you are trying to do and how :)

 

Link to post
Share on other sites
On 3/17/2020 at 12:39 AM, hui said:

just use the session token shown in the settings here:

image.thumb.png.6f700bc24d2cecf9e3ae6ca9c2dedcac.png

If that doesn't help please try to be a bit more specific as to what you are trying to do and how :)

 

Already solved!!!

I was misplacing the values in the header "x-access-token" and in the parameter "accessToken" of the body...

This changed after the some update...

 

Thanks!

Link to post
Share on other sites
  • Moderator
3 hours ago, ElEdu74 said:

Already solved!!!

I was misplacing the values in the header "x-access-token" and in the parameter "accessToken" of the body...

This changed after the some update...

 

Thanks!

nice, glad it's solved! :)

Link to post
Share on other sites
  • Forum Admin
18 hours ago, Berdododijo92 said:

Hi dan

is ther a way to get previous (unactive)  server seed unhached using the api

looking forward for your answer.

If you know a bet that was placed with that seed pair, then yes. Otherwise you will have to navigate through your betlist history (or archive) until you can find a bet with that seed pair.

Your seed pairs are stored in the CasinoBet type:

type CasinoBet {
	serverSeed: CasinoServerSeed!
	clientSeed: CasinoClientSeed!
}

 

On 3/29/2020 at 2:16 AM, DreamStage said:

Hello, houseBetList query is returning empty data.

(Not loading on the Casino tab as well - My Bets)

Have you updated your access token with your new one?

On 3/29/2020 at 10:56 AM, Seoulmate said:

If you have a minute could you show me a specific example of how I'd place (via the api) the following bet in roulette:

Bet amount: 142 satoshi
Bet on number: 27

Thanks

 

Already answered here: https://forum.stake.com/topic/19678-using-the-stake-api/?do=findComment&comment=645824

On 3/25/2020 at 12:50 AM, ElEdu74 said:

Could someone post the queries to see the balance, and the query to deposit in the vault from the balance?

Thanks!

This has already been answered on page two and three of this topic from memory.

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

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

 

Can someone help me on this?

I managed to start a game on blackjack, but when doing "Next action" what are the proper inputs for $action (BlackjackNextActionInput!)?

Actions are stand, hit , double, stand, but they don't work just like that if I enter them.

How do I end the game/cashout? I assume when the next action is "stand"?

Edited by Joe
Link to post
Share on other sites
On 3/30/2020 at 2:14 AM, Dan said:

If you know a bet that was placed with that seed pair, then yes. Otherwise you will have to navigate through your betlist history (or archive) until you can find a bet with that seed pair.

Your seed pairs are stored in the CasinoBet type:


type CasinoBet {
	serverSeed: CasinoServerSeed!
	clientSeed: CasinoClientSeed!
}

 

hi dan

is that serverseed hashed ? if yes then how to unhash old seeds using the api

thanks

Link to post
Share on other sites
  • Forum Admin
On 4/3/2020 at 3:19 PM, Berdododijo92 said:

hi dan

is that serverseed hashed ? if yes then how to unhash old seeds using the api

thanks

rotateSeedPair(seed: "my uber seed") {
  clientSeed {
    user {
      id
      activeClientSeed {
        id
        seed
      }
      activeServerSeed {
        id
        nonce
        seedHash
        nextSeedHash
      }
    }
  }
}

To gain access to. your unhashed seeds, you must. first rotate the seed pair.

Link to post
Share on other sites
  • 2 weeks later...
On 4/2/2020 at 8:41 AM, Joe said:

Can someone help me on this?

I managed to start a game on blackjack, but when doing "Next action" what are the proper inputs for $action (BlackjackNextActionInput!)?

Actions are stand, hit , double, stand, but they don't work just like that if I enter them.

How do I end the game/cashout? I assume when the next action is "stand"?

I'm using:

action: double
action: hit
action: noInsurrance

and action: stand ends the game if it's not ended already by a Blackjack...

Link to post
Share on other sites
  • Forum Admin
On 4/19/2020 at 3:49 AM, cryptonesiac said:

What values can I use for SportMarketStatusEnum!

The only value I could find that did anything was 'active', but the outcome was:

"message": "You are not allowed to do that.",
     "errorType": "permission"

 

enum SportMarketStatusEnum {
	deactivated
	active
	cancelled
	suspended
	rollback
	settled
}

 

Link to post
Share on other sites
On 3/11/2020 at 3:08 AM, Dan said:

sportList( type: SportSearchEnum limit: Int offset: Int 😞 [Sport!]!

 

On 3/11/2020 at 3:08 AM, Dan said:

Hi mate, here is how you do the following scenarios.

1) Return a list of sports (for their ID's)


sportList(
	type: SportSearchEnum
	limit: Int
	offset: Int
): [Sport!]!

2) Return the list of fixtures in a sport


sport( sportId: String! ) {
	fixtureList(
		type: SportSearchEnum
		limit: Int
		offset: Int
	): [SportFixture!]!
}

3) Get the list of tournaments in a sport


sport( sportId: String! ) {
	tournamentList(
		type: SportSearchEnum
		limit: Int
		offset: Int
	): [SportTournament!]!
}

4) Query all the fixtures in a tournament


sportTournament(
	tournamentId: String!
): SportTournament

 

Hello, these queries are not working. Could you please help?

 

This is the response I am getting.

Annotation 2020-05-03 210116.png

On 3/17/2020 at 7:39 AM, hui said:

just use the session token shown in the settings here:

image.thumb.png.6f700bc24d2cecf9e3ae6ca9c2dedcac.png

If that doesn't help please try to be a bit more specific as to what you are trying to do and how :)

 

Can you please help me with the issue?

Link to post
Share on other sites
  • Forum Admin
7 hours ago, Sunney said:

 

Hello, these queries are not working. Could you please help?

 

This is the response I am getting.

Annotation 2020-05-03 210116.png

Can you please help me with the issue?

{
  sportList(limit: 10, offset: 0) {
    id
    name
    slug
  }
}

 

Link to post
Share on other sites
On 4/27/2020 at 1:47 AM, blockbet said:

limboBet(
	amount: Float!
	multiplierTarget: Float!
	currency: CurrencyEnum!
): CasinoBet!

Above is the mutation for limbo

Thank you for that, but what about the fragment? 

Link to post
Share on other sites
  • Forum Admin
15 hours ago, Kjaka said:

Thank you for that, but what about the fragment? 

Are you talking about CasinoBet type?

type CasinoBet {
	id: String!
	game: CasinoEnum!
	active: Boolean!
	nonce: Int!
	amount: Float!
	currency: CurrencyEnum!
	value: Float!
	amountMultiplier: Float!
	payoutMultiplier: Float!
	payout: Float!
	updatedAt: Date!
	createdAt: Date!
	user: User
	serverSeed: CasinoServerSeed!
	clientSeed: CasinoClientSeed!
	state: CasinoBetState!
	search: Bet
}

 

Link to post
Share on other sites
  • 2 weeks later...
48 minutes ago, mydicebot said:

Hi there,

Recently I tried to access https://api.stake.com/graphql  to find the schema/documentation of the APIs, but cannot access right now (long time ago I can access)

image.thumb.png.ab1f4809abcaef491dfebe2bc8be90d8.png

How can I find the documentation of the APIs ?

some of my app's users ask that is there any limitation of requests per millisecond through the stake API, or per IP address?

As stated in the main topic, the schema isn't available for a few months now. They wanted to make some documentation for the API, but it still has to be announced as of when it will be released (I believe it isn't a priority really, as bugs and other features are of a higher priority).

If you need to know anything, you can check out the posts in this topic (many queries have already been discussed, so you might find what you're looking for), or simply ask for what you need in here, so that anyone looking for the same thing can see too.

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