Skip to content

Instantly share code, notes, and snippets.

@topshef
Created September 8, 2025 10:50
Show Gist options
  • Select an option

  • Save topshef/a1d5a77b4d769fdf20b9c5114f679381 to your computer and use it in GitHub Desktop.

Select an option

Save topshef/a1d5a77b4d769fdf20b9c5114f679381 to your computer and use it in GitHub Desktop.
select all tx where operator id =xxx and contains any xfer (hbar or ft) where withdrawal is from account yyyy since date zzz
#https://discord.com/channels/1011406343053254707/1283157792626311281/1334129547582505000
query TransfersQuery($verifierId: bigint, $subjectId: bigint, $fromConsensusTime: bigint) {
hbarTransfers: crypto_transfer(
where: {
entity_id: { _eq: $subjectId }
amount: { _lt: 0 }
transaction: { payer_account_id: { _eq: $verifierId }, consensus_timestamp: { _gte: $fromConsensusTime } }
}
order_by: { transaction: { consensus_timestamp: desc } }
) {
entity_id
amount
consensus_timestamp
transaction {
transaction_hash
payer_account_id
}
}
tokenTransfers: token_transfer(
where: {
account_id: { _eq: $subjectId }
amount: { _lt: 0 }
transaction: { payer_account_id: { _eq: $verifierId }, consensus_timestamp: { _gte: $fromConsensusTime } }
}
order_by: { transaction: { consensus_timestamp: desc } }
) {
account_id
amount
token_id
consensus_timestamp
transaction {
transaction_hash
payer_account_id
}
}
}
@topshef
Copy link
Author

topshef commented Sep 8, 2025

@topshef
Copy link
Author

topshef commented Sep 8, 2025

@topshef
Copy link
Author

topshef commented Sep 8, 2025

example data

{
  "verifierId": 26027,
  "subjectId": 24739,
  "fromConsensusTime": 0
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment