from
and sent to
addresses you care about to create a complete picture of a user's transaction history.fromAddress
: the address we want to see transaction information originating fromtoAddress
: the address we want to see for recipient-based transactionsfromBlock
: the starting time range we want to fetch transactions over (defaults to latest
)toBlock
: the ending time range we want to fetch transactions over (defaults to latest
)category
: the type of transfer events we care about, in our case we want to see all transactions so we can simply let the param use its default argument of ["external
", "internal
", "token
"]fromAddress
parameter within the Transfers API. For recipient-based transactions, use the toAddress
parameter. fromAddress
andtoAddress
in your request.From
An Addressalchemy-web3
module to easily interact with Alchemy APIs. We highly recommend using the alchemy-web3
sdk because you also get websocket support, retries, and other benefits without the complexity!alchemy-web3-transfers-from-script.js
touch
command like this:tx-history-from-alchemyweb3.js
node-fetch
a lightweight, common module that brings the Fetch API to Node.js and allows us to make our HTTP requests, here's a code snipper for the request you'd make!tx-history-from-fetch.js
using your favorite file browser, code editor, or just directly in the terminal using the touch
command like this:tx-history-from-fetch.js
axios
, a promise-based HTTP client for the browser and Node.js which allows us to make a raw request to the Alchemy API, here's a code snipper for the request you'd make!tx-history-from-axios.js
using your favorite file browser, code editor, or just directly in the terminal using the touch
command. tx-history-from-axios.js
alchemy-web3
module to easily interact with Alchemy APIs. We highly recommend using the alchemy-web3
sdk because you also get websocket support, retries, and other benefits without the complexity!alchemy-web3-transfers-to-script.js
touch
command like this:alchemy-web3-transfers-to-script.js
node-fetch
a lightweight, common module that brings the Fetch API to Node.js and allows us to make our HTTP requests, here's a code snipper for the request you'd make!fetch-transfers-to-script.js
using your favorite file browser, code editor, or just directly in the terminal using the touch
command like this:fetch-transfers-to-script.js
axios
, a promise-based HTTP client for the browser and Node.js which allows us to make a raw request to the Alchemy API, here's a code snipper for the request you'd make!axios-transfers-to-script.js
using your favorite file browser, code editor, or just directly in the terminal using the touch
command. axios-transfers-to-script.j
sAlchemy Web3
ResponsesNode-Fetch
ResponsesAxios
ResponsesblockNum
: the block number where a transaction event occurred, in hex
hash
: the transaction hash of a transactionfrom
: where the transaction originated fromto
: where ETH or another asset was transferred tovalue
: the amount of ETH transferrederc721TokenId
: the ERC721 token ID. null
if not an ERC721 token transfer.erc1155Metadata
: a list of objects containing the ERC1155 tokenId
and value
. null
if not an ERC1155 transfertokenId
: the token ID for ERC721 tokens or other NFT token standards asset
: ETH
or the token's symbol. null
if not defined in the contract and not available from other sources.rawContract
value
: raw transfer value denominated in the relevant Ethereum tokenaddress
: Ethereum token contract addressdecimal
: contract decimalasset
and value
asset
and value
. alchemy web3
, axios
, or node-fetch
, we'll need to save the queried response object into a constant.Alchemy Web3
Node-Fetch
Axios
value
and asset
field