Ethereum(BSC) Get all transfers from smartcontract to address

Hi there, back again with another request for help with a query

I am wanting to get all “Transfer” events from a token smartcontract to a particular wallet address.
The array returned will ideally show the blockNumber, amount of tokens transferred, the sender and txHash. The purpose of this is to see if the address has received tokens directly (ie from a token holder not via a dexTrade swap - although including these as well would be great!)

Many thanks

This seems to be a two step process

Step #1

Get the smart contract address using a particular wallet address. In the below GraphQL query, we have queried for the smart contract address of wallet address 0xbb19039871ed8bd20a0321555c46aae436f2de30.

{
  ethereum(network: bsc) {
    smartContractCalls(
      options: {desc: "block.timestamp.time", limit: 1}
      date: {since: "2021-08-01"}
      caller: {is: "0xbb19039871ed8bd20a0321555c46aae436f2de30"}) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      smartContract {
        address {
          address
        }
      }
      gasValue
    }
  }
}

The result comes out to be as follows:-

{
  "ethereum": {
    "smartContractCalls": [
      {
        "block": {
          "timestamp": {
            "time": "2021-08-11 14:00:40"
          },
          "height": 9939419
        },
        "smartContract": {
          "address": {
            "address": "0x2eba09fb8063aedba27424de9bf0dcb41567a943"
          }
        },
        "gasValue": 0.000121300001488896
      }
    ]
  }
}

Step #2

Taking 0x2eba09fb8063aedba27424de9bf0dcb41567a943 as the smart contract address, we get the block height & transaction hash and the amount of tokens transferred.

{
  ethereum(network: bsc){
    smartContractEvents(
      smartContractEvent: {is: "Transfer"}
      smartContractAddress: {is: "0x2eba09fb8063aedba27424de9bf0dcb41567a943"}
    ){
      block{
        height
        timestamp{
          iso8601
        }
      }
      transaction{
        hash 
      }
      count
    }
  }
}

Thanks @sayon, that’s an interesting approach. I hadn’t noticed the Transfers query object when I posted this. I’ve actually partially solved this with the below query, Only problem is I can’t see if the transfer was on or off exchange. Is there a way to incorporate something to identify that in the below query? Thanks

query MyQuery {
  ethereum(network: bsc) {
    transfers(
      receiver: {is: "0xd267f01df3534804d09f7ec6664107582303ecaa"}
      options: {limit: 10}
      currency: {is: "0x2eba09fb8063aedba27424de9bf0dcb41567a943"}
    ) {
      transaction {
        hash
        txFrom {
          address
        }
      }
      currency(currency: {}) {
        address
        name
        symbol
      }
      sender {
        address
      }
      block {
        height
        timestamp {
          time
        }
      }
      amount
    }
  }
}