Retrieve all transaction between a specific contract address and specific wallet

Hello,

I’m looking for a way I could retrieve all the past transactions between a contract and a user wallet address.

The transactions I’m looking for are like this one: Binance Transaction Hash (Txhash) Details | BscScan

The value I’m interested in would be the amount of BNB transferred from the contract to the wallet.

Thanks for your help.

If you want to check transactions

Replace the Contract address and wallet address in the below query.

{
  ethereum(network: bsc) {
    transactions(options: {desc: "block.timestamp.time",
      limit: 10, offset: 0}, 
      date: {since: null, till: null},
      txSender: {is: "Contract address"}
      txTo: {is : "Wallet address"}
    ) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      success
      address: to {
        address
        annotation
      }
      gasValue
      gasCurrency {
        symbol
      }
      hash
    }
  }
}

Another way to check transfers only

Replace the Contract address and wallet address in the below query.

{
  ethereum(network: bsc) {
    transfers(options: {desc: "block.height",
      limit: 10, offset: 0},
      date: {since: "2021-05-24", till: null},
      amount: {gt: 0}
      sender: {is: "Contract address"}
      receiver:{is: "Wallet address"}
    ) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      sender {
        address
        annotation
      }
      receiver {
        address
        annotation
      }
      currency {
        address
        symbol
      }
      amount
      transaction {
        hash
      }
      external
    }
  }
}

Briliant thanks a ton!