# How to get wallet related details

**URL:** <https://community.bitquery.io/t/how-to-get-wallet-related-details/1058>\
**Category:** GraphQL Tutorials\
**Created:** [May 24, 2022, 7:15am UTC](https://community.bitquery.io/t/how-to-get-wallet-related-details/1058 "2022-05-24T07:15:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbajpai](https://avatars.discourse-cdn.com/v4/letter/m/e5b9ba/32.png) [@mbajpai](https://community.bitquery.io/u/mbajpai)\
**Post date:** [May 24, 2022, 7:15am UTC](https://community.bitquery.io/t/how-to-get-wallet-related-details/1058/1 "2022-05-24T07:15:06Z")

</div>

A cryptocurrency wallet basically is a device, physical medium, program or a service. They keep your private and/or public keys – the passwords that give you access to your cryptocurrencies – safe and accessible, allowing you to make cryptocurrency transactions (send and receive) like Bitcoin and Ethereum etc. In addition to this basic function of storing the keys, a cryptocurrency wallet more often also offers the functionality of encrypting and/or signing information.

You can easily get any information related to the crypto wallets using Bitquery’s APIs and tools. In this tutorial, we’ll take a look at how to go about the same!

To start off, you can check out our [Bitquery explorer](https://explorer.bitquery.io/) and simply put the address whose details you are looking for in the search bar at the top.

As an example in this tutorial we will be using the wallet with address “0x43cf525d63987d17052d9891587bcfb9592c3ee2” on the Ethereum mainnet network.

**Balance of the Given Wallet Address**

Let’s take a look at how can we calculate the balance for a particular wallet using Bitquery’s GraphQL IDE. You can run the following query with the address whose details you require and get the wallet’s balance.  
The following GraphQL query would get you the balance of a wallet based on the Ethereum blockchain.

```auto
{
  ethereum{
    balance: address(
      address: {is: "0x43cf525d63987d17052d9891587bcfb9592c3ee2"}
    ){
      balance
    }
  }
}

```

Get the query from here: [Balance of an Ethereum Wallet address](https://graphql.bitquery.io/ide/Balance-of-an-Ethereum-Wallet-address)  
To know about the Balance of the wallet for different currencies, you may refer to this GraphQL query:-

```auto
{
  ethereum{
    balance: address(
      address: {is: "0x43cf525d63987d17052d9891587bcfb9592c3ee2"}
    ){
      balances{
        value
        currency{
          name
          symbol
        }
      }
    }
  }
}

```

The result generated by this GraphQL query is shown in this link: [Balance in different currencies of 0x43cf525d63987d17052d9891587bcfb9592c3ee2](https://graphql.bitquery.io/ide/Balance-in-different-currencies-of-0x43cf525d63987d17052d9891587bcfb9592c3ee2)

For getting the balance of a Bitcoin wallet, you need to make a separate query where the balance has to be calculated by subtracting the input value from the output value. The following GraphQL query would show you how to get the balance of a Bitcoin wallet address bc1qg28ajhqus54ljn2nrszf8n6urg9chsf36e6t4y.

> **[Balance of Bitcoin Wallet bc1qg28ajhqus54ljn2nrszf8n6urg9chsf36e6t4y](https://graphql.bitquery.io/ide/Balance-of-Bitcoin-Wallet-bc1qg28ajhqus54ljn2nrszf8n6urg9chsf36e6t4y)**
>
> Bitquery is analytical engine for blockchains

To get to know more about Bitquery’s Balance API you can refer to the following link.

[Bitquery’s Balance API - GraphQL Tutorials - Bitquery](https://community.bitquery.io/t/bitquerys-balance-api/860)

**Balance History**

Now we’ll see how we can get the balance history for a wallet address using Bitquery’s APIs. Running the following query does the need full.

```auto
{
  ethereum {
    address(address: {is: "0x43cf525d63987d17052d9891587bcfb9592c3ee2"}) {
      balances (
        currency: {is: "ETH"}
        date: {till: "2022-05-01"}
      ) {
        history {
          transferAmount
          value
          timestamp
        }
      }
    }
  }
}

```

You can use the following link to access the query: [Balance History of Ethereum Wallet address 0x43cf525d63987d17052d9891587bcfb9592c3ee2](https://graphql.bitquery.io/ide/Balance-History-of-Ethereum-Wallet-address-0x43cf525d63987d17052d9891587bcfb9592c3ee2)

**Transactions**

Now we’ll try to fetch the transactions related to a particular wallet address.  
The following query gives you the latest transaction made for the given wallet address on the Ethereum network:-

```auto
{
  ethereum {
    transactions(options: {limit: 10, desc: "amountInUSD"}) {
      amount
      amountInUSD: amount(in: USD)
      currency {
        symbol
      }
      to {
        address
      }
      date {
        date
      }
      sender(txSender: {is: "0x43cf525d63987d17052d9891587bcfb9592c3ee2"}) {
        address
      }
    }
  }
}

```

You can also find the above query here:

> **[Highest amount of transaction for ethereum wallet](https://graphql.bitquery.io/ide/Highest-amount-of-transaction-for-ethereum-wallet)**
>
> Bitquery is analytical engine for blockchains

Now let’s take a look at a query for the token transfers for an address along with the sender and gas amount

```auto
{
  ethereum {
    transfers(
      options: {limit: 10, desc: "amountInUSD"}
      sender: {is: "0x43cf525d63987d17052d9891587bcfb9592c3ee2"}
      date: {}
    ) {
      amount(in: USD)
      amountInUSD: amount(in: USD)
      count
      currency {
        symbol
        tokenId
        tokenType
      }
      receiver {
        address
      }
      sender {
        address
      }
      date {
        date(format: "%Y-%m-%d")
      }
      gasValue
    }
  }
}

```

**Dex Trades**

Moving on, now we’ll take a look at the DEX trades taking place using this wallet address.  
You can find graphical representations of the trades by time, trade takers, traded currencies and DEX Smart Contracts by time under the DEX trades tab. Clicking on the Open GraphQL IDE button on the bottom right corner of each section will give you queries for the same

Clicking on the Open GraphQL IDE button on the bottom right corner of each section will give you pre-written queries for the same as follows:

```auto
{
  ethereum(network: ethereum) {
    dexTrades(
      options: {asc: "date.date"}
      date: {since: "2022-04-28", till: "2022-05-05T23:59:59"}
      makerOrTaker: {is: "0x43cf525d63987d17052d9891587bcfb9592c3ee2"}
    ) {
      date: date {
        date(format: "%Y-%m-%d")
      }
      trades: countBigInt
      traders: countBigInt(uniq: takers)
      contracts: countBigInt(uniq: smart_contracts)
      currencies: countBigInt(uniq: buy_currency)
    }
  }
}

```

The results generated by the use of this query can also be found using txsender in place of “makerortaker”:

```auto
{
  ethereum(network: ethereum) {
    dexTrades(
      options: {asc: "date.date"}
      date: {since: "2022-04-28", till: "2022-05-05T23:59:59"}
    ) {
      date: date {
        date(format: "%Y-%m-%d")
      }
      trades: countBigInt(
        txSender: {is: "0x43cf525d63987d17052d9891587bcfb9592c3ee2"}
      )
      traders: countBigInt(uniq: takers)
      contracts: countBigInt(uniq: smart_contracts)
      currencies: countBigInt(uniq: buy_currency)
    }
  }
}

```

To get the latest token trade pairs of a wallet, you can use the following query

```auto
{
  ethereum(network: ethereum) {
    dexTrades(
      options: {desc: "count", limit: 10, offset: 0}
      date: {since: "2022-04-28", till: "2022-05-05T23:59:59"}
      makerOrTaker: {is: "0x43cf525d63987d17052d9891587bcfb9592c3ee2"}
    ) {
      sellCurrency {
        symbol
        address
      }
      sellAmount
      buyCurrency {
        symbol
        address
      }
      buyAmount
      count
      median_price: price(calculate: median)
      last_price: maximum(of: block, get: price)
      dates: count(uniq: dates)
      started: minimum(of: date)
    }
  }
}

```

You can get the above query using this link too

> **[Wallet token trade pairs](https://graphql.bitquery.io/ide/Wallet-token-trade-pairs)**
>
> Bitquery is analytical engine for blockchains

**Latest traders for the wallet**

Now let’s take a look at the query for fetching the latest traders for the wallet

```auto
{
  ethereum(network: ethereum) {
    transactions(
      options: {desc: "amount", limit: 10, offset: 0}
      date: {since: "2022-05-14", till: "2022-05-21T23:59:59"}
      txSender: {is: "0x43cf525d63987d17052d9891587bcfb9592c3ee2"}
    ) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      success
      address: to {
        address
        annotation
      }
      gasValue
      gasCurrency {
        symbol
      }
      hash
      amount(in: USD)
    }
  }
}

```

**Smart Contract calls**

In this section we’ll take a look at how we can get the details related to the smart contract calls made for a particular wallet address.

Under the Call contracts tab, you can find tabular representations for the latest Smart Contract Calls, Top Gas Cost Calls, the Smart Contracts called, Smart Contract Methods called etc. You can even find the graphical representation of the Smart contract calls by date

You can run the following query to get the latest smart contract calls

```auto
{
  ethereum(network: ethereum) {
    smartContractCalls(
      options: {desc: "block.timestamp.time", limit: 10, offset: 0}
      date: {since: "2022-04-28", till: "2022-05-05T23:59:59"}
      caller: {is: "0x43cf525d63987d17052d9891587bcfb9592c3ee2"}
    ) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      smartContractMethod {
        name
        signatureHash
      }
      smartContract {
        address {
          address
          annotation
        }
        contractType
      }
      transaction {
        hash
      }
      external
      gasValue
    }
    smartContractEvents {
      count(uniq: smart_contracts)
    }
  }
}

```

![Picture1](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/d007e2a9845730165d98494f2c6894efd54e02d3.png)  
Bar graph between transaction hash and gas value

You can find the above query here too:

> **[Smart contract calls for ethereum wallet](https://graphql.bitquery.io/ide/Smart-contract-calls-for-ethereum-wallet)**
>
> Bitquery is analytical engine for blockchains

Money flow

Bitquery’s coinpath API allows you to track the flow of your cryptocurrency by representing it in easy to understand graphical forms, namely Graph and Sankey.

**Graph view**

![Picture2](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/9c64dceecda06f1aafc4cc794cab8db2c00a44eb.png)

Here the figure at the centre represents the wallet address which we are investigating, the circular gears represent smart contracts and the green figures represent the senders and receivers. Each arrow represents the currency and it’s value.

We can use coinpath to get all inbound and outbound transfers from and to a wallet on multiple hops too.If we increase the Outbound depth level, the graph representation looks like this, tracking the outbound transactions upto three levels:

![Picture3](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/d4b62396b16a090b283f9d6db059fbe083a30ce5.png)

The query for the above is:

```auto
{
  ethereum(network: ethereum) {
    inbound: coinpath(
      initialAddress: {is: "0x43cf525d63987d17052d9891587bcfb9592c3ee2"}
      currency: {is: "ETH"}
      depth: {lteq: 1}
      options: {direction: inbound, asc: "depth", desc: "amount", limitBy: {each: "depth", limit: 10}}
      date: {since: "2022-04-28", till: "2022-05-05T23:59:59"}
    ) {
      sender {
        address
        annotation
        smartContract {
          contractType
          currency {
            symbol
            name
          }
        }
      }
      receiver {
        address
        annotation
        smartContract {
          contractType
          currency {
            symbol
            name
          }
        }
      }
      amount
      currency {
        symbol
      }
      depth
      count
    }
    outbound: coinpath(
      initialAddress: {is: "0x43cf525d63987d17052d9891587bcfb9592c3ee2"}
      currency: {is: "ETH"}
      depth: {lteq: 3}
      options: {asc: "depth", desc: "amount", limitBy: {each: "depth", limit: 10}}
      date: {since: "2022-04-28", till: "2022-05-05T23:59:59"}
    ) {
      sender {
        address
        annotation
        smartContract {
          contractType
          currency {
            symbol
            name
          }
        }
      }
      receiver {
        address
        annotation
        smartContract {
          contractType
          currency {
            symbol
            name
          }
        }
      }
      amount
      currency {
        symbol
      }
      depth
      count
    }
  }
}

```

You can also access the above query here:

> **[Transfers from a wallet on multiple hops](https://graphql.bitquery.io/ide/Transfers-from-a-wallet-on-multiple-hops)**
>
> Bitquery is analytical engine for blockchains

**Sankey**

Here the long rectangular strip represents the wallet address which we are investigating. The incoming arrows from the left represents the inflow of currency and the thickness of the stripes represent the amount being transferred, the outgoing strips on the right represent the outflow of currency.

The above information can also be obtained by running the following query:

> **[Ethereum wallet Moneyflow](https://graphql.bitquery.io/ide/Ethereum-wallet-Moneyflow)**
>
> Bitquery is analytical engine for blockchains

\*\*Use of Coinpath for getting inbound and outbound transfers  
\*\*  
Let’s take an example of a query that shows the use of coinpath API to get inbound and outbound transfers

```auto
{
  ethereum {
    inbound: coinpath(
      initialAddress: {is: "0x43cf525d63987d17052d9891587bcfb9592c3ee2"}
      currency: {is: "ETH"}
      depth: {lteq: 1}
      options: {direction: inbound, asc: "depth", desc: "amount", limitBy: {each: "depth", limit: 10}}
      date: {since: null, till: null}
    ) {
      sender {
        address
        annotation
        smartContract {
          contractType
          currency {
            symbol
            name
          }
        }
      }
      receiver {
        address
        annotation
        smartContract {
          contractType
          currency {
            symbol
            name
          }
        }
      }
      amount
      currency {
        symbol
      }
      depth
      count
    }
    outbound: coinpath(
      initialAddress: {is: "0x0681d8db095565fe8a346fa0277bffde9c0edbbf"}
      currency: {is: "ETH"}
      depth: {lteq: 1}
      options: {asc: "depth", desc: "amount", limitBy: {each: "depth", limit: 10}}
      date: {since: null, till: null}
    ) {
      sender {
        address
        annotation
        smartContract {
          contractType
          currency {
            symbol
            name
          }
        }
      }
      receiver {
        address
        annotation
        smartContract {
          contractType
          currency {
            symbol
            name
          }
        }
      }
      amount
      currency {
        symbol
      }
      depth
      count
    }
  }
}

```

To learn more about Bitquery’s Coinpath API, you can refer to the following article:  
[Coinpath® - Blockchain Money Flow APIs - Bitquery](https://bitquery.io/blog/coinpath-blockchain-money-flow-apis)

**Conclusion**

Bitquery provides support and details related to the wallet addresses of various blockchain networks. If you are looking for the same, please [sign up on our Blockchain IDE](https://graphql.bitquery.io/) and get your API keys. If you need information and details related to the wallet addresses, we would be delighted to talk to you; you can mail us at [hello@bitquery.io](mailto:hello@bitquery.io) or ping us on our [Telegram channel](https://t.me/Bloxy_info).

**Also Read**

- [Bitquery’s Transfer API](https://community.bitquery.io/t/bitquerys-transfer-apis/889)
- [Avalanche DEXs APIs](https://community.bitquery.io/t/avalanche-dexs-apis/838)
- [Bitquery’s Balance API](https://community.bitquery.io/t/bitquerys-balance-api/860)
- [SushiSwap Tutorial](https://community.bitquery.io/t/sushiswap-tutorial/784)
- [Dogecoin APIs – Transactions, wallets and Money Flow](https://community.bitquery.io/t/dogecoin-apis-transactions-wallets-and-money-flow/752)

**About Bitquery**

Bitquery is a set of software tools that parse, index, access, search, and use information across blockchain networks in a unified way. We are crossing the ‘chain-chasm’ by delivering set of products that can work across blockchains. Our products include:

[Coinpath](https://bitquery.io/products/coinpath?utm_source=blog) APIs provide blockchain [money flow](https://blog.bitquery.io/coinpath-blockchain-money-flow-apis) analysis for more than 24 blockchains. With Coinpath’s APIs, you can monitor blockchain transactions, investigate crypto crimes such as bitcoin money laundering, and create crypto forensics tools. You can refer to this article to get started with [Coinpath](https://blog.bitquery.io/coinpath-api-get-start)

[Digital Assets API](https://bitquery.io/products/digital_assets?utm_source=blog&utm_medium=about) provides index information related to all major cryptocurrencies, coins, and tokens.

[DEX API](https://bitquery.io/products/dex?utm_source=blog&utm_medium=about) provides real-time deposits and transactions, trades, and other related data on different DEX protocols like Uniswap, SushiSawap, Kyber Network, Airswap, Matching Network, etc.

If you have any questions about our products, ask them on our [Telegram channel](https://t.me/Bloxy_info) or email us at [hello@bitquery.io](mailto:hello@bitquery.io) . Also, subscribe to our newsletter and stay updated about the latest in the cryptocurrency world.
