Skip to main content

Transactions

Please note: This is an introductory reference

For the most up-to-date information, refer to the API Reference.
🚧 The information provided in this section cannot be programmatically updated and may be subject to inconsistencies over time.

Core Endpoints
  • Testnet: http://platform.canary.enjin.io/graphql
  • Mainnet: http://platform.enjin.io/graphql

This is an overview of some of the most commonly used operations in the Enjin Platform Schema.

GetBlocks​

The GetBlocks query allows you to retrieve an array of blocks(Block

), which can be filtered based on specific block numbers, transaction IDs, or hashes. It is designed to fetch detailed data on a set of blocks, providing valuable insights.

query GetBlocks {
GetBlocks(numbers: ["402865"]) {
totalCount
pageInfo {
startCursor
endCursor
hasPreviousPage
hasNextPage
}
edges {
cursor
node {
id
number
hash
synced
failed
exception
}
}
}
}

GetTransaction​

The GetTransaction query allows you to retrieve detailed information about a specific transaction. It provides comprehensive details about the transaction, including its state, associated wallet, and related events.

query GetTransaction {
GetTransaction(
id: 11300
) {
id
idempotencyKey
transactionId
transactionHash
method
state
result
encodedData
signedAtBlock
createdAt
updatedAt
wallet {
account {
publicKey
address
}
}
events {
edges {
cursor
node {
phase
lookUp
moduleId
eventId
params {
type
value
}
}
}
totalCount
pageInfo {
hasPreviousPage
hasNextPage
startCursor
endCursor
}
}
}
}

GetTransactions​

The GetTransactions query in allows you to retrieve an array of transactions. You can optionally filter these transactions based on various parameters such as transaction IDs, transaction hashes, methods, states, results, or accounts.

query GetTransactions {
GetTransactions(
ids: [11300]
) {
edges {
cursor
node {
id
idempotencyKey
transactionId
transactionHash
method
state
result
encodedData
signedAtBlock
createdAt
updatedAt
wallet {
account {
publicKey
address
}
}
events {
edges {
cursor
node {
phase
lookUp
moduleId
eventId
params {
type
value
}
}
}
totalCount
pageInfo {
hasPreviousPage
hasNextPage
startCursor
endCursor
}
}
}
}
totalCount
pageInfo {
startCursor
endCursor
hasPreviousPage
hasNextPage
}
}
}

GetPendingEvents​

The GetPendingEvents query is designed to retrieve a list of events that have been broadcast by the system but not yet acknowledged by the client. This is useful for ensuring that no events are missed or unprocessed, particularly in systems that rely on event-driven architectures or asynchronous processing.

query GetPendingEvents{
GetPendingEvents(
acknowledgeEvents: false
) {
totalCount
pageInfo {
startCursor
endCursor
hasNextPage
hasPreviousPage
}
edges {
cursor
node {
id
uuid
name
sent
channels
data
}
}
}
}

Use Case:​

You can use the GetPendingEvents query to ensure that all events are accounted for and processed in your system, even in the presence of network issues or disruptions. This query is crucial for:

  • Reconciling transaction records.
  • Updating user interfaces in real-time.
  • Triggering downstream processes that depend on event data.

Developers and system administrators can use this query to monitor and handle event-driven systems effectively, maintaining their reliability and consistency. To acknowledge the outputted events (and therefore remove them from pending events), set the acknowledgeEvents parameter to true (default is false).
To filter outputted pending events on specific channels, use the channelFilters parameter

query geFilteredtPendingEvents {
GetPendingEvents(
channelFilters:[
{type:OR filter:"cxKy7aqhQTtoJYUjpebxFK2ooKhcvQ2FQj3FePrXhDhd9nLfu"}
{type:OR filter:"cxLU94nRz1en6gHnXnYPyTdtcZZ9dqBasexvexjArj4V1Qr8f"}
]){
edges {
node {
id
uuid
data
channels
}
}
}
}

This example will output pending events broadcasted in either cxKy7aqhQTtoJYUjpebxFK2ooKhcvQ2FQj3FePrXhDhd9nLfu and cxLU94nRz1en6gHnXnYPyTdtcZZ9dqBasexvexjArj4V1Qr8f channels.
Using the Type argument, you, can construct advanced filters like 'channel_1' AND ('channel_2' OR 'channel_3')
Note, The default type is "AND".