Transfers API
Get Wallet Transfers

Get Wallet Transfers

Overview

The Get Wallet Transfers endpoint obtains data on various transfers of native currency and tokens by specifying an EOA wallet's address as a required path parameter. The range should be defined by either block_number, timestamp, or block_hash. When querying via Postman or CLI, it is recommended to always specify the asset_type parameter, even if you are querying by contract. Pass the values like so: native,ft,nft,multi if interested in all types of assets, or remove those not needed to narrow your search.

When using the endpoint via Parsiq JS Client, keep in mind that asset_type is a required parameter. Pass the values in an array like so: [AssetType.Native, AssetType.FungibleToken, AssetType.NonFungibleToken, AssetType.MultiToken] if interested in all types of assets, or remove those not needed to narrow your search.

📘️

Multiple values can be set for the contract and asset_type parameters, with a maximum of five items each.

📘️

When using the contract parameter, asset_type can't be assigned as native because a contract can only represent a token, not a native currency.

Use Cases

While the Wallet Transfers endpoint should always include an EOA wallet's address as a required path parameter, it can also be combined with other query parameters to further refine your search. Several possible combinations should be considered, where contract is a smart contract's address, and asset_type represents the token's type to query by. The direction parameter allows the user to see all incoming or outgoing transfers of the address chosen. The counterparty parameter is a specific address that is either source or destination of transfer. To retrieve specific details about wallet transfers, follow the guidelines below.

  1. For transfers from an EOA wallet, specify counterparty and add it to the path address and asset_type parameters.

  2. For transfers of a particular token, specify its contract and add it to the path address and asset_type parameters.

  3. For transfers of a particular token from another EOA wallet, specify both contract and counterparty, then add them to the path address and asset_type parameters.

  4. For obtaining only incoming or outgoing transfers of the path address parameter, specify the corresponding value of direction, then add it to the path address and asset_type parameters. Narrow your search by counterparty if needed.

Usage

In this example, we receive all incoming transfers starting from the first block, sent to the address 0xD85F68bC77024A730302a97c2e1e07785b01f153 from the counterparty address 0x6d053f09684ee1c231b417cc1e502ef50b1b5697. The asset_type field should be set to nft as we are querying by an ERC-721 standard contract.

import * as Parsiq from '@parsiq/parsiq.js';
import {AssetType, TransferDirection} from '@parsiq/parsiq.js';
 
const client = Parsiq.createClient(process.env.API_KEY, Parsiq.ChainId.ETH_MAINNET);
 
const walletTransfers = client.transfers.wallet.getByBlockRange(
    `0xD85F68bC77024A730302a97c2e1e07785b01f153`,
    1, 'latest',
    {
      contract: ['0xcaace84b015330c0ab4bd003f6fa0b84ec6c64ac'],
      asset_type: [AssetType.NonFungibleToken],
      direction: TransferDirection.Incoming,
      counterparty: '0x6d053f09684ee1c231b417cc1e502ef50b1b5697'
    },
    {
      limit: 10
    }
);
 
for await (const transfer of walletTransfers) {
    console.log(transfer);
}

Output:

{
  id: '0000000000e38b5b-00b2-00000002',
  tx_hash: '0x3b4df3c9c7d312193e54c28e8b0f771d34cc7aeb27b11757e6ec88bf4fbc8556',
  block_hash: '0xd40f5c9aa54f0ba9b529b7363ce5167f4c9928dcf9df7885f301bfe9ea7fc6d3',
  block_number: 14912347,
  timestamp: 1654480202,
  origin: '0x6d053f09684ee1c231b417cc1e502ef50b1b5697',
  contract: '0xcaace84b015330c0ab4bd003f6fa0b84ec6c64ac',
  sender: '0x6d053f09684ee1c231b417cc1e502ef50b1b5697',
  recipient: '0xd85f68bc77024a730302a97c2e1e07785b01f153',
  value: null,
  token_id: '779',
  asset_type: 'nft'
}

Parameters

Path params
chainId
string
REQUIRED
version
string
REQUIRED
address
string
REQUIRED
Query params
block_number_start
number
REQUIRED
block_number_end
string
number
REQUIRED
contract
array of strings
asset_type
array of strings
REQUIRED
direction
string
counterparty
string
offset
string
limit
number
estimate_cu
boolean