Skip to main content

Solana Transactions API

In this section we'll have a look at some examples using the Solana Transactions API.

This Solana API is part of our Early Access Program (EAP), which is intended for evaluation purposes.

This program allows you to test the data and its integration into your applications before full-scale implementation. Read more here

Subscribe to Recent Transactions

The subscription query below fetches the most recent transactions on the Solana blockchain You can find the query here

subscription {
Solana {
Transactions(limit: {count: 10}) {
Block {
Time
Hash
}
Transaction {
BalanceUpdatesCount
Accounts {
Address
IsWritable
}
Signer
Signature
Result {
Success
ErrorMessage
}
Index
Fee
TokenBalanceUpdatesCount
InstructionsCount
}
}
}
}

Filtering Solana Transactions Based on Dynamic Criteria​

In this subscription query we will see how to set dynamic filters for the transactions to be retrieved based on various transaction properties. Developers can monitor specific types of transactions on the Solana network, such as high-volume or high-fee transactions.

You can run the query here

Variables​

  • $network: Specifies the Solana network.
  • $tx_filter: A filter object used to specify the criteria for transactions to retrieve.
subscription(
$network: solana_network
$tx_filter: Solana_Transaction_Filter
) {
Solana(network: $network) {
Transactions(where:$tx_filter) {
Block {
Time
Hash
}
Transaction {
BalanceUpdatesCount
Accounts {
Address
IsWritable
}
Signer
Signature
Result {
Success
ErrorMessage
}
Index
Fee
TokenBalanceUpdatesCount
InstructionsCount
}
}
}
}
<!-- Parameters -->

{
"network": "solana",
"tx_filter":{"Transaction": {"TokenBalanceUpdatesCount": {"gt": 10}, "FeeInUSD": {"ge": "0.0010"}}}
}