Hi, I have a paid subscription.
My program collects transaction data from your API using code similar to that below; it is intended to capture multiple transactions in a timeframe with txFrom and to address data for each transaction. Recently I have noticed that my query is producing unexpected results, because some transaction hashes are transferring multiple tokens and this code only captures the first token transfer in the list. In example, go to Binance Transaction Hash (Txhash) Details | BscScan
The code below records the txFrom as 0xf2f9b8ec0a8203a2cba497ffde4e75435f2db588 and the to as 0x7a62f3686bc633dd950d7c2c3ca3f2568f169b57.
According to BSCscan, there are 6 tokens transfers listed within this transaction, whereas my code is only recording one of them.
How can I alter the code below in such a way that it records the from and to address, as well as token address and quantity, of each of these token transfers? Please bear in mind that I do not know how many tokens might be transferred in any txhash; this example shows 6, or it could be just 1, or any other quantity.
My current query:
{
ethereum(network: bsc) {
dexTrades(options: {limit: 10000, offset: 0, desc: "block.height"},
time: { since: "2022-08-07T16:58:09z" , till: "2022-08-07T16:58:11z" }
) {
tradeIndex
transaction {
hash
txFrom {
address
}
to {
address
}
}
block {
height
timestamp{
time(format: "%Y-%m-%d %H:%M:%S")
}
}
buyAmount
buyAmountInUsd: buyAmount(in: USD)
buyCurrency {
symbol
address
}
sellAmount
sellAmountInUsd: sellAmount(in: USD)
sellCurrency {
symbol
address
}
sellAmountInUsd: sellAmount(in: USD)
tradeAmount(in: USD)
}
}
}
Thank you