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
.
Multiple values can be set for the contract
and asset_type
parameters, with a maximum of five items each.
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 origin
refers to another EOA wallet's address, 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. To retrieve
specific details about wallet transfers, follow the guidelines below.
-
For transfers from another EOA wallet, specify
origin
and add it to the pathaddress
parameter. Narrow your search byasset_type
if needed. -
For transfers of a particular token, specify
contract
and add it to the pathaddress
parameter. -
For transfers of a particular token from another EOA wallet, specify both
contract
andorigin
and add them to the pathaddress
parameter. -
For
incoming
oroutgoing
transfers of a particular wallet, specify the corresponding value and add it to the pathaddress
parameter.
When using the contract
parameter, asset_type
can't be assigned as native
because a contract can only
represent a token and not a native currency.
Usage
In this example, we receive all transfers of the 0xD85F68bC77024A730302a97c2e1e07785b01f153
address. The asset_type
field must be set to all four values like so native,ft,nft,multi
.
import * as Parsiq from '@parsiq/parsiq.js';
import {AssetType} from "@parsiq/parsiq.js/dist/enum/asset-type.js";
const client = Parsiq.createClient(process.env.API_KEY, Parsiq.ChainId.ETH_MAINNET);
const transfers = client.transfers.wallet.getByBlockRange(`0xD85F68bC77024A730302a97c2e1e07785b01f153`, 1, 'latest', {
asset_type: [AssetType.Native, AssetType.FungibleToken, AssetType.NonFungibleToken, AssetType.MultiToken]
});
for await (const transfer of transfers) {
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
chainId
version
address
block_number_start
block_number_end
contract
asset_type
origin
direction
offset
limit
estimate_cu