🔌
Raw Transactions API
Blazing-fast, highly queryable historical Solana transactions.
Database does not contain data earlier than November 28, 2022 or older than 60 days.
Returns an array of raw transactions for the provided accounts. The query can be limited to specific time or slot ranges.
Oops, something is missing.
We could not find the original source to display this content.
Advanced example with pagination
getAllTransactions.js
const url = 'https://api.helius.xyz/v1/raw-transactions?api-key=<your_key_here>';
// Query for transactions that happened in the last week for these two monkes.
// Leverages pagination to repeatedly call the API until we get all transactions.
const accounts = [
'BAAzgRGWY2v5AJBNZNFd2abiRXAUo56UxywKEjoCZW2',
'8s6kQUZfdm7GSaThAcsmSs56wMinXrbk6SdNVngutrz5'
];
const unixDay = 60 * 60 * 24;
const startTimeUnix = Math.floor(Date.now() / 1000) - 7 * unixDay;
const getAllTransactions = async () => {
const transactions = [];
let paginationToken;
while (true) {
const { data } = await axios.post(url, {
query: {
accounts: accounts,
startTime: startTimeUnix,
},
options: {
limit: 10,
paginationToken: paginationToken,
},
});
console.log(`Got batch of ${data.result.length} transactions!`);
transactions.push(...data.result);
if (data.paginationToken) {
paginationToken = data.paginationToken;
console.log(`Proceeding to next page with token ${paginationToken}.`);
} else {
console.log('Finished getting all transactions.');
break;
}
}
console.log(`Got ${transactions.length} transactions in total!`);
return transactions;
};
getAllTransactions();
Returns an array of raw (meaning the exact same format as returned by the Solana JSON-RPC specification) transactions.
Takes in multiple transaction signatures and fetches them all in parallel.
Oops, something is missing.
We could not find the original source to display this content.
Last modified 17d ago