# Ethereum(BSC) Get all transfers from smartcontract to address

**URL:** <https://community.bitquery.io/t/ethereum-bsc-get-all-transfers-from-smartcontract-to-address/450>\
**Category:** GraphQL API\
**Tags:** open\
**Created:** [August 28, 2021, 12:28pm UTC](https://community.bitquery.io/t/ethereum-bsc-get-all-transfers-from-smartcontract-to-address/450 "2021-08-28T12:28:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stcroix](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@stcroix](https://community.bitquery.io/u/stcroix)\
**Post date:** [August 28, 2021, 12:28pm UTC](https://community.bitquery.io/t/ethereum-bsc-get-all-transfers-from-smartcontract-to-address/450/1 "2021-08-28T12:28:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sayon](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sayon](https://community.bitquery.io/u/sayon)\
**Post date:** [August 28, 2021, 4:01pm UTC](https://community.bitquery.io/t/ethereum-bsc-get-all-transfers-from-smartcontract-to-address/450/2 "2021-08-28T16:01:04Z")

</div>

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**.

```auto
{
  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:-

```auto
{
  "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.

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

```

> **[https://community.bitquery.io/t/ethereum-bsc-get-all-transfers-from-smartcontrac...](https://ide.bitquery.io/DRVwiBIwp1)**
>
> Bitquery is analytical engine for blockchains

---

<div class="post-metadata">

**Author:** ![stcroix](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@stcroix](https://community.bitquery.io/u/stcroix)\
**Post date:** [August 29, 2021, 1:03am UTC](https://community.bitquery.io/t/ethereum-bsc-get-all-transfers-from-smartcontract-to-address/450/3 "2021-08-29T01:03:49Z")

</div>

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

```auto
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
    }
  }
}

```
