Skip to main content

How to get transaction signatures from version to version

Prerequisites

Before getting started, make sure you have the following ready:

  • Node v.14+
  • NPM

Step 1: Setup Blocklens

First register your Blocklens account and get your Blocklens API Key.

Once you have your Blocklens API Key, install the Blocklens SDK in your project.

npm i blocklens-sdk

Step 2: Get transaction signatures from version to version

In order to get transaction signatures from version to version, Blocklens provides you a getTransactionSignaturesFromVersionToVersion endpoint to do so.

Here you'll need parameters: from_version, to_version.

Once you've obtained all the from_version, to_version, you can copy the following code:

import Blocklens from "blocklens-sdk";

const blocklens = new Blocklens();
blocklens.init({ apiKey: "YOUR_API_KEY" });

const runApis = async () => {
const response = await blocklens.APTOS_MAINNET.getTransactionSignaturesFromVersionToVersion({"from_version":271891980,"to_version":271891981});
console.log(response);
};

runApis();

Step 3: Run the script

ts-node index.ts

In your terminal, you should see the following JSON response with the data: In your terminal, you should see the following JSON response with the data blocks:

{
"cursor": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MjcxODkxOTgwLCJwYWdlIjoxLCJmcm9tX3ZlcnNpb24iOjI3MTg5MTk4MCwidG9fdmVyc2lvbiI6MjcxODkxOTgxLCJpYXQiOjE2OTcwNjExNTJ9.2NEJzwfWJL9iNqZ4SjdkVe_2wEhpsSFCPrcM387GlRM",
"page": 1,
"limit": 20,
"total_items": 1,
"data": [
{
"block_height": 95397542,
"transaction_version": 271891981,
"transaction_hash": "0x361a18bc1ee54c2f29067a40f0c33457347cfe95166ba89d078f0157b637285c",
"transaction_type": "user_transaction",
"type": "ed25519_signature",
"public_key": "null",
"signature": "0x4ba65e044d8c239505a9cb4a7440bdbee2dab1d95ca675736d565788a014f3f0edf82a4b97dcf01fb5f46e4baf87e1d0d7dda2ee6056430171d95bc279d57d00",
"timestamp": 1695436683
}
]
}

Congratulations 🥳 you just found the get transaction signatures from version to version on multiple chains with only a few lines of code using the Blocklens Wallet API!

API Reference

If you want to know more details on the endpoint and optional parameters, check out:

Support

If you face any trouble following the tutorial, feel free to reach out to our community engineers in our Discord or Forum to get 24/7 developer support.