To start using the Phoenix GraphQL API, you can access the GraphiQL interface at https://phoenixplorer.com/graphiql
. This interface allows you to write, test, and execute your GraphQL queries. For real-time data updates, use the WebSocket URL wss://phoenixplorer.com/socket
.
Retrieve Transaction Details
To retrieve details of a specific transaction, use the following GraphQL query:
{
transaction(hash: "0x69e3923eef50eada197c3336d546936d0c994211492c9f947a24c02827568f9f") {
hash,
blockNumber,
value,
gasUsed
}
}
Endpoint:transaction(hash: String): Transaction
Parameters:
hash
: The hash of the transaction you want to query.Response Fields:
hash
: The transaction hash.blockNumber
: The block number in which the transaction was included.value
: The value transferred in the transaction.gasUsed
: The amount of gas used by the transaction.Example:
{
transaction(hash: "0x69e3923eef50eada197c3336d546936d0c994211492c9f947a24c02827568f9f") {
hash,
blockNumber,
value,
gasUsed
}
}
To subscribe to real-time updates, connect to the WebSocket URL wss://phoenixplorer.com/socket
.
Ensure you include any necessary headers for authentication and proper request handling. Typically, this might include:
{
"Content-Type": "application/json"
}
You can access detailed documentation and explore available queries and mutations through the GraphiQL interface at https://phoenixplorer.com/graphiql
. This interface provides a comprehensive guide to all available API endpoints and their usage.