AptosAptos Network's breakthrough technology and seamless user experience are now available on QuickNode.

Start building today!     

Contents

qn_getTransactionsByAddress (v2) RPC Method

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.

This method will return pagination for up to 1000 results. The "fromBlock" and "toBlock" parameters can be used for historical data.

Parameters:

  1. array - An array with the first element being:

    object - A custom object with the following fields:

    address - string - The wallet address we want to check for transactions

    fromBlock - string - The first block number to check for transactions (inclusive). If omitted, will default to the genesis block for the provided address

    toBlock - string - (optional) The last block number to check for transactions (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 transactions 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 transactions to return on each page. You can request up to 100 transactions per page. If omitted, defaults to 40 transactions per page

Returns:

  1. object - The custom response object containing transaction details and array of transactions, or an empty array if no transactions are found:

    transactions - An array of objects representing transactions with the following shape:

    blockTimestamp - The timestamp of the block in which the transaction occurred

    transactionHash - The hash of the transaction

    blockNumber - The block number within which this transaction occurred

    transactionIndex - The index of the transaction within the block

    fromAddress - The address from which the transaction was sent

    toAddress - The address to which the transaction was sent

    contractAddress - The contract address involved in the transaction (if applicable)

    value - The value of the transaction (in wei)

    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:

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_getTransactionsByAddress', [{
  "address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
  "page": 1,
  "perPage": 10
}])
print(resp)
Ready to get started? Create a free account