Skip to main content

Transactions

GraphQL Endpoint

https://platform.enjin.io/graphql

Use these queries to look up the state of transactions you've submitted (GetTransaction / GetTransactions) and to read the underlying blocks and extrinsics they ended up in (GetBlock / GetBlocks, GetExtrinsic / GetExtrinsics) — including the on-chain events each extrinsic emitted.

GetTransaction

Returns a single transaction by uuid, idempotencyKey, or extrinsicHash — pass exactly one. The most common use is to look up the live state of a transaction you submitted via CreateTransaction.

query GetTransaction {
GetTransaction(
network: ENJIN
chain: MATRIX
uuid: "a90ded41-4262-40a2-95c0-98255b660bf1"
) {
uuid
idempotencyKey
action
state
encodedData
extrinsic {
id
hash
success
}
createdAt
updatedAt
}
}

See the state argument for the full list of transaction states.

The extrinsic object is null until the transaction has been included in a block and indexed by the platform. Once populated, it exposes the extrinsic's id (blockNumber-index), hash, on-chain success flag, pallet / method, signer, containing block, and the events it emitted — see Working with Events for reading event payloads.

GetTransactions

Returns a paginated list of transactions. Pagination is cursor-based — pass the previous response's nextCursor to fetch the next page. You can filter by uuids, idempotencyKeys, or extrinsicHashes.

query GetTransactions {
GetTransactions(
network: ENJIN
chain: MATRIX
limit: 15
) {
data {
uuid
action
state
extrinsic {
hash
}
createdAt
}
perPage
nextCursor
previousCursor
}
}

GetBlock

Returns a single block by id (block number) or hash.

query GetBlock {
GetBlock(
network: ENJIN
chain: MATRIX
id: 402865
) {
number
hash
validator
createdAt
extrinsics {
id
pallet
method
success
}
}
}

validator is the block validator's public key (hex). Each entry in extrinsics also exposes the events it emitted — see GetExtrinsic below for the full extrinsic shape.

GetBlocks

Returns a list of blocks. Pass ids (block numbers) or hashes — one of the two is required.

query GetBlocks {
GetBlocks(
network: ENJIN
chain: MATRIX
ids: [402865, 402866]
) {
number
hash
createdAt
}
}

GetExtrinsic

Returns a single extrinsic by hash, including the on-chain events it emitted — useful when you have an extrinsic hash (e.g. from a block explorer or an external system) rather than a platform transaction uuid.

query GetExtrinsic {
GetExtrinsic(
network: ENJIN
chain: MATRIX
hash: "0xbafe459e8248b802f3aef98d2e4a695bbb238899edf40519b082366e3ff8b98f"
) {
id
hash
pallet
method
success
nonce
signer {
address
}
block {
number
}
events {
id
name
collectionId
tokenId
data
}
}
}

See Working with Events for what each Event field carries.

GetExtrinsics

Returns a list of extrinsics by hashes.

query GetExtrinsics {
GetExtrinsics(
network: ENJIN
chain: MATRIX
hashes: [
"0xbafe459e8248b802f3aef98d2e4a695bbb238899edf40519b082366e3ff8b98f"
"0x12ab34cd56ef78ab90cd12ef34ab56cd78ef90ab12cd34ef56ab78cd90ef12ab"
]
) {
hash
pallet
method
success
}
}