This guide is designed to help new developers quickly get up to speed with using the Utils API to access utility functions related to transactions and blockchain data. Learn how to query utility data using popular HTTP clients such as fetch
or axios
.
Utils API Definition
The Utils API is a collection of utility endpoints that offer developers convenient access to critical blockchain and transaction-related data. These endpoints simplify tasks such as fetching transaction signatures and converting timestamps to block numbers, making developing and maintaining blockchain applications easier.
Utils API Endpoint
The Utils API provides endpoints for accessing utility functions that are essential for blockchain and transaction-related operations. Klarda currently supports the following Utils API Endpoints:
-
Get Transaction Signature:
Retrieves the details of a transaction using its signature hash.Endpoint:
GET /api/v1/utils/transaction-signature
Parameters:
signature_hash
(string): The hash of the transaction signature.
-
Get Closet Timestamp to Blocknumber:
Fetches the block number closest to a given timestamp for a specified blockchain.Endpoint:
GET /api/v1/utils/closest-timestamp
Parameters:
timestamp
(int): The Unix timestamp for which to find the closest block number.chain
(string, default: "ETH"): The blockchain identifier (e.g., "ETH" for Ethereum).
Example Use Cases
1. Verifying Transaction Details:
Use the "Get Transaction Signature" endpoint to verify the details of a specific transaction using its signature hash. This is particularly useful for applications that need to validate transactions for security or auditing purposes.
2. Converting Timestamps to Block Numbers:
With the "Get Closet Timestamp to Blocknumber" endpoint, you can easily convert a Unix timestamp to the closest block number on a specified blockchain. This is essential for time-based analyses and operations that require precise block number identification.
We hope this quickstart guide helps you get started with the Klarda Utils API. For more detailed information, please refer to the full API documentation.