Wallet transaction history
Fetch the transaction history for any wallet address
Fetches the transaction / token history for any wallet address of any ERC20, ERC721 and ERC1155 token. The response includes decoded transaction details for easy consumption / rendering.
Sequence Indexer GetTransactionHistory
Method:
- Request: POST /rpc/Indexer/GetTransactionHistory
- Content-Type: application/json
- Body (in JSON):
filter
(object)accountAddress
(string) -- the wallet account addresscontractAddress
(string) -- optionally specify a contract address to filteraccountAddresses
(string array) -- optionally specify a list of wallet account addressescontractAddresses
(string array) -- optionally specify a list of contract addresstransactionHashes
(string array) -- optionally specify a list of transaction hashesmetaTransactionIDs
(string array) -- optionally specify a list of meta transaction IDsfromBlock
(number) -- optionally specify the starting block to select a rangetoBlock
(number) -- optionally specify the ending block to select a range
includeMetadata
(boolean - optional - default: false) -- toggle token metadata to be included in the response
Example: GetTransactionHistory
of a wallet account address on Polygon
- curl
- Javascript / Typescript
- Go
- Other
curl -X POST -H "Content-Type: application/json" https://polygon-indexer.sequence.app/rpc/Indexer/GetTransactionHistory -d '{ "filter": { "accountAddress": "0x8e3E38fe7367dd3b52D1e281E4e8400447C8d8B9" }, "includeMetadata": true }'
// Works in both a Webapp (browser) or Node.js:
import { SequenceIndexerClient } from '@0xsequence/indexer'
const indexer = new SequenceIndexerClient('https://polygon-indexer.sequence.app')
// try any account address you'd like :)
const filter = {
accountAddress: "0xabc..."
}
// query Sequence Indexer for all token transaction history on Polygon
const transactionHistory = await indexer.getTransactionHistory({
filter: filter,
includeMetadata: true
})
console.log('transaction history in account:', transactionHistory)
import (
"context"
"fmt"
"log"
"net/http"
"github.com/0xsequence/go-sequence/indexer"
)
func GetTransactionHistory(accountAddress string) {
seqIndexer := indexer.NewIndexerClient("https://polygon-indexer.sequence.app", http.DefaultClient)
filter := &indexer.TransactionHistoryFilter{
AccountAddress: &accountAddress,
}
includeMetadata := true
_, history, err := seqIndexer.GetTransactionHistory(context.Background(), filter, nil, &includeMetadata)
if err != nil {
log.Fatal(err)
}
fmt.Println("transaction history:", history)
}
Please contact our team for assistance with integrations to another target.