getAccountTransactions()

Gets all the transactions for an Etherspot address.

Introduction

You can fetch the historical transactions for any blockchain address that belongs to the Etherspot ecosystem.

Etherspot addresses only!

Please note that this hook works only with Etherspot blockchain addresses. Blockchain addresses that were not created on the Etherspot platform are not supported.

Ready-to-fork CodeSandbox available

There is a CodeSandbox available for this hook. Check it out to see the useEtherspotHistory hook in action action, and fork it should you want to test or change anything.

👉 CodeSandbox directory: Etherspot History

How to use

To fetch historical transactions for a blockchain address on the Etherspot platform, simply call getAccountTransactions() from useEtherspotHistory().

import {
  useEtherspotHistory,
} from '@etherspot/transaction-kit';

// Later in the main component function...

const { getAccountTransactions } = useEtherspotHistory();

// And when you're ready to fetch your transaction history...

const accountTransactionHistory = await getAccountTransactions(); // This is also a Promise

// accountTransactionHistory will now contain an array of history objects.

🎉 Congratulations!

Last updated