We're now supporting Polygon zkEVM!
Learn more here.
The API credit value for this method is 4 . To learn more about API credits and each method's value, visit the API Credits page.
Please note that this RPC method requires the Token and NFT API v2 bundle add-on enabled on your QuickNode endpoint.
Parameters:
object - A custom object with the following fields:
address - string - The wallet address we want to check for transfers
contract - string - The ERC-20 contract we want to check for transfers
fromBlock - string - The first block number to check for transfers (inclusive). If omitted, will default to the genesis block for the provided token contract address
toBlock - string - (optional) The last block number to check for transfers (inclusive). If omitted, will default to the latest block
page - string - (optional) The page number you would like returned. The page numbers start at 1 and end at totalPages. If omitted, defaults to the first page (page 1). If the page number requested is higher than totalPages, an empty assets array will be returned. If the page number requested is less than 1, an invalid params response will be returned
perPage - string - (optional) The maximum amount of transfers to return on each page. You can request up to 100 transfers per page. If omitted, defaults to 40 transfers per page
Returns:
transfers - An array of objects representing token transfers with the following shape:
token - An object containing information about the token with the following shape:
name - The name of the token transferred
symbol - The symbol of the token transferred
decimals - The number of decimals the token uses
quantityIn - The quantity received
blockNumber - The block number within which this transfer occurred
address - The address for the receiver of this transfer
transactionHash - The token transfer transaction hash
quantityOut - The quantity sent
pageNumber - The page number of results that was returned with this response
totalItems - The total number of results
totalPages - The total number of results pages available
Code Examples:
var myHeaders = new Headers(); myHeaders.append("Content-Type", "application/json"); var raw = JSON.stringify({ "id": 67, "jsonrpc": "2.0", "method": "qn_getWalletTokenTransactions", "params": [{ "address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "contract": "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE", "page": 1, "perPage": 10 }] }); var requestOptions = { method: 'POST', headers: myHeaders, body: raw, redirect: 'follow' }; fetch("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));
from web3 import Web3, HTTPProvider w3 = Web3(HTTPProvider('http://sample-endpoint-name.network.quiknode.pro/token-goes-here/', request_kwargs=OPTIONS)) resp = w3.provider.make_request('qn_getWalletTokenTransactions', [{ "address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "contract": "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE", "page": 1, "perPage": 10 }]) print(resp)
curl http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ \ -X POST \ -H "Content-Type: application/json" \ --data '{ "id":67, "jsonrpc":"2.0", "method":"qn_getWalletTokenTransactions", "params": [{ "address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "contract": "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE", "page": 1, "perPage": 10 }] }'
require "uri" require "json" require "net/http" url = URI("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "id": 67, "jsonrpc": "2.0", "method": "qn_getWalletTokenTransactions", "params": [{ "address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "contract": "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE", "page": 1, "perPage": 10 }] }) response = https.request(request) puts response.read_body
require 'eth' client = Eth::Client.create 'http://sample-endpoint-name.network.quiknode.pro/token-goes-here/' payload = { "id":67, "jsonrpc":"2.0", "method":"qn_getWalletTokenTransactions", "params": [{ "address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "contract": "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE", "page": 1, "perPage": 10 }] } response = client.send(payload.to_json) puts response
import requests import json url = "http://sample-endpoint-name.network.quiknode.pro/token-goes-here/" payload = json.dumps({ "id": 67, "jsonrpc": "2.0", "method": "qn_getWalletTokenTransactions", "params": [{ "address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "contract": "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE", "page": 1, "perPage": 10 }] }) headers = { 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
const ethers = require("ethers"); (async () => { const provider = new ethers.providers.JsonRpcProvider("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/"); const heads = await provider.send("qn_getWalletTokenTransactions", [ { address: "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", contract: "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE", page: 1, perPage: 10, }, ]); console.log(heads); })();