Skip to main content

Node API - Mina GraphQL


API AuthenticationClick to view API Authentication details
API calls require authentication with API key via Authorization request header or URL property. Calls are made to one of the Mina Graphql Node API endpoints found in your app's dashboard.

For example: https://mina-mainnet--graphql.datahub.figment.io

Here's some boilerplate to get you started.
fetch("https://mina-mainnet--graphql.datahub.figment.io/graphql", {
method: 'POST', // can also be 'GET', 'PUT' or any appropriate method
headers: {
"Authorization" : "<api_key>",
"Content-Type": "application/json" // if method is 'POST'
},
body: JSON.stringify({
// JSON Payload
})
})

Available Methods

network status

Check out the node/network status.

Request Body (try it)
Example Response
{
"data": {
"daemonStatus": {
"syncStatus": "SYNCED",
"stateHash": "3NLEhHJKPTxhkh7dom7hpNeuoqejh9UsJADXFoQW6sX6DQNvqzzA",
"numAccounts": 120343,
"chainId": "5f704cc0c82e0ed70e873f0893d7e06f148524e3f0bdae2afb02e7819a0c24d1",
"commitId": "f361ba19d78ba930b5b551f58d1a82942c0f724b",
"catchupStatus": [
"to_build_breadcrumb",
"to_initial_validate",
"finished",
"to_download",
"wait_for_parent",
"to_verify"
],
"blockchainLength": 174063
}
}
}
SpecificationView Specification

Parameters

  • None

Response

  • Return the node/network status data including syncStatus, stateHash, numAccounts, chainId, commitId, catchupStatus and blockchainLength.

latest blocks

Pull information about the latest 10 blocks.

Request Body (try it)
Example Response
{
"data": {
"bestChain": [
{
"stateHash": "3NKXswQQ5Rp7pkdDkR4rnzj3dtMVBeyYndpxoyZHK1isyvjiaV3C",
"protocolState": {
"consensusState": {
"blockHeight": "174021"
}
}
},
{
"stateHash": "3NKNoWEZ9uLoZcD41sT66yRYb3PyMBAYCLTSTadMZ2CBmW3LeVtV",
"protocolState": {
"consensusState": {
"blockHeight": "174022"
}
}
},
{
"stateHash": "3NLdhi3CUrEXFBNGT2DVQ8t2Gyt4HESietjLwar6U3viNX7HkKSM",
"protocolState": {
"consensusState": {
"blockHeight": "174023"
}
}
},
{
"stateHash": "3NLtQv77sdRMsm3ozrjwDVE7fizt3qki5udrSjRW7eodwmhhiYWr",
"protocolState": {
"consensusState": {
"blockHeight": "174024"
}
}
},
{
"stateHash": "3NKTKWbQCdLwVAshtHgzWSHXJfPgo1SBo11bzDC4DP7NyuWRxA8J",
"protocolState": {
"consensusState": {
"blockHeight": "174025"
}
}
},
{
"stateHash": "3NLu1Tm9Yk8gtfuqj2BzBFLdSeyAz2xGLx1BvhqdxP2HzRwPy82T",
"protocolState": {
"consensusState": {
"blockHeight": "174026"
}
}
},
{
"stateHash": "3NLZqrjHqCGxgwCGnaccmzfgVrc4JXTZAWT2RyVJQDRumDaQfwvK",
"protocolState": {
"consensusState": {
"blockHeight": "174027"
}
}
},
{
"stateHash": "3NLHjoqFfaGfAYhQ7KBrcLGXWJWm2P1xdL51vDArPw5a5gBhAuVL",
"protocolState": {
"consensusState": {
"blockHeight": "174028"
}
}
},
{
"stateHash": "3NLc5J2w9ZRaEWnG1oXnPdAXwvGZ7fFoQTRbkMLHP2VDKQoqvkZX",
"protocolState": {
"consensusState": {
"blockHeight": "174029"
}
}
},
{
"stateHash": "3NLxJYFjFyizop6BGYYDiUmNbcLDiMVJwzRefNnJfWaCAwMThJ7F",
"protocolState": {
"consensusState": {
"blockHeight": "174030"
}
}
}
]
}
}
SpecificationView Specification

Parameters

  • None

Response

  • Return data about the latest 10 blocks including bestChain, stateHash, protocolState, consensusState and blockHeight.

current block

Pull the latest canonical block and its information.

Request Body (try it)
Example Response
{
"data": {
"bestChain": [
{
"creator": "B62qkXU9mZxcbqocqygDYBFeGFekUVGvJckucWGZgHnfB6znAY6z3MJ",
"stateHash": "3NLAB9Gpgji8wgCAWE6n4Y7dqky4ba6Va4RjPZNt3BpiufRw8v1K",
"stateHashField": "5971089098078803254696870602397178339214779186567677717926839150377122347924",
"protocolState": {
"blockchainState": {
"date": "1662116580000",
"snarkedLedgerHash": "jxDaErQCbbQPSGDGNKSwkE5EQiUS3cQsc1Dg7Eki3ZZAZkrzSMz"
},
"previousStateHash": "3NLxJYFjFyizop6BGYYDiUmNbcLDiMVJwzRefNnJfWaCAwMThJ7F",
"consensusState": {
"blockHeight": "174031",
"blockchainLength": "174031",
"epoch": "35",
"slot": "6641",
"totalCurrency": "950748652840039233"
}
},
"transactions": {
"userCommands": [
{
"amount": "1000",
"fee": "1000000",
"from": "B62qre3erTHfzQckNuibViWQGyyKwZseztqrjPZBv6SQF384Rg6ESAy",
"hash": "CkpYia8QTJ92dvbroUqi9zyrPPzuHMfWWBW36iKQnaxL8qMqiUNqm"
},
{
"amount": "0",
"fee": "1100000",
"from": "B62qkhUBnAv3wm7vbL8WpyhEPdecWTAyU2mFGouE8HaCXtbHueDTQWZ",
"hash": "CkpZXMYWp15Qqxiez3V4QCeL8AL72KABbDh2rTPyxj4Ky9UPfy6Kk"
}
],
"coinbase": "720000000000"
}
}
]
}
}
SpecificationView Specification

Parameters

  • None

Response

  • Return latest canonical block data including bestChain, creator, stateHash, stateHashField, protocolState, transactions and coinbase.

snark pool

Pull a list of pending snark jobs.

Request Body (try it)
Example Response
{
"data": {
"snarkPool": [
{
"fee": "0",
"prover": "B62qs2Lw5WZNSjd8eHBUZXFYyRjV8oKtrZMFDn1S1Ye62G71xCQJMYM",
"workIds": [
84927711,
949618782
]
}
]
}
}
SpecificationView Specification

Parameters

  • None

Response

  • Return a list of pending snark jobs data including snarkPool, fee, forever and workIds.

account details

Pull the account details for the given account(publicKey: " ").

Request Body (try it)
Example Response
{
"data": {
"account": {
"delegate": "B62qix9vooX5NqJYo8nT6xWqCeQu5AJoS1ng6FRnUpVAra6PAZZ1CU4",
"balance": {
"blockHeight": "174032",
"liquid": "1901008579",
"locked": "0",
"stateHash": "3NLxt6diQixehDVFeDPrXP27UDaPdjQ9oqgdZ94CfDZ5uQAcUQQX",
"total": "1901008579",
"unknown": "1901008579"
},
"delegators": [],
"publicKey": "B62qix9vooX5NqJYo8nT6xWqCeQu5AJoS1ng6FRnUpVAra6PAZZ1CU4",
"stakingActive": false,
"votingFor": "3NK2tkzqqK5spR2sZ7tujjqPksL45M3UUrcA4WhCkeiPtnugyE2x",
"isDisabled": false
}
}
}
SpecificationView Specification

Parameters

GraphQL query params -

  • account(publicKey: " ") - Public key of the account for which you want to fetch the details.

Response

  • Return the account details data including delegate, balance, blockHeight, liquid, locked, stateHash, total, unknown, delegators, publicKey, stakingActive, votingFor and isDisabled.