Historical
Reading transactions using Etherspot
Before we continue, please ensure that you have had a look at our Supported Ethereum Chains, followed the steps in Install Etherspot SDK and how to Bootstrap Etherspot SDK. We're assuming that you have completed these steps before going forward.

Getting started

The Etherspot SDK makes it really easy for you to send a transaction on any of our Supported Ethereum Chains. The method call is the same for each chain.

Fetching historical transactions

Fetching transactions using the Etherspot SDK is easy. Just call the getTransactions method against the Etherspot SDK instance to fetch all transactions on the account. This is the same method across all chains on the Etherspot SDK.
1
const transactions = await sdk.getTransactions();
2
​
3
console.log('Transactions:', transactions);
Copied!

Fetching a single transaction

Along with fetching all transactions above, you can also simply fetch a single transaction by hash and the data associated with that transaction. This is the same method across all chains on the Etherspot SDK.
1
const singleTransaction = await sdk.getTransaction({
2
hash: null, // Replace null with your transaction hash
3
});
4
​
5
console.log('Transaction:', singleTransaction);
Copied!

​
πŸŽ‰
Finished!

Last modified 2mo ago