Skip to content

Latest commit

 

History

History
74 lines (48 loc) · 3.84 KB

TransactionApi.md

File metadata and controls

74 lines (48 loc) · 3.84 KB

theblockchainapi.TransactionApi

All URIs are relative to https://api.blockchainapi.com/v1

Method HTTP request Description
getTransaction GET /{blockchain}/transaction/{network}/{transaction_blockchain_identifier} Get the details of a transaction made on a blockchain

getTransaction

GeneralTransaction getTransaction()

<a href="https://github.com/BL0CK-X/blockchain-api/tree/main/examples/transaction/get-transaction\" target="_blank">See examples (Python, JavaScript). Get the details of a transaction made on the specified blockchain. Cost: 0.25 Credit (<a href="#section/Pricing">See Pricing)

Example

import { theblockchainapi } from 'theblockchainapi';
import * as fs from 'fs';

const configuration = theblockchainapi.createConfiguration();
const apiInstance = new theblockchainapi.TransactionApi(configuration);

let body:theblockchainapi.TransactionApiGetTransactionRequest = {
  // 'ethereum' | 'solana' | The blockchain you want to use 
  blockchain: "ethereum",
  // string | The network of the blockchain you selected  - Solana: `devnet`, `mainnet-beta` - Ethereum: `ropsten`, `mainnet`  Defaults when not provided (not applicable to path parameters): - Solana: `devnet` - Ethereum: `ropsten`
  network: "ropsten",
  // string | The transaction signature of the transaction.  Examples: - Solana: `5wHu1qwD7q5ifaN5nwdcDqNFo53GJqa7nLp2BeeEpcHCusb4GzARz4GjgzsEHMkBMgCJMGa6GSQ1VG96Exv8kt2W` - Ethereum: `0x5f36b787daa57bfe8568d69e24eae54ccb00720c6edfc826bd4a7b19c525eef4`
  transactionBlockchainIdentifier: "0x5f36b787daa57bfe8568d69e24eae54ccb00720c6edfc826bd4a7b19c525eef4",
};

apiInstance.getTransaction(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
blockchain [**'ethereum' 'solana'**]Array<'ethereum' | 'solana'> The blockchain you want to use
network [string] The network of the blockchain you selected - Solana: `devnet`, `mainnet-beta` - Ethereum: `ropsten`, `mainnet` Defaults when not provided (not applicable to path parameters): - Solana: `devnet` - Ethereum: `ropsten` defaults to undefined
transactionBlockchainIdentifier [string] The transaction signature of the transaction. Examples: - Solana: `5wHu1qwD7q5ifaN5nwdcDqNFo53GJqa7nLp2BeeEpcHCusb4GzARz4GjgzsEHMkBMgCJMGa6GSQ1VG96Exv8kt2W` - Ethereum: `0x5f36b787daa57bfe8568d69e24eae54ccb00720c6edfc826bd4a7b19c525eef4` defaults to undefined

Return type

GeneralTransaction

Authorization

APIKeyID, APISecretKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Transaction found. Details in response. Click &quot;Expand All&quot; in the documentation sidebar to the right to view an example. -
400 Invalid input or issue retrieving transaction. See response for details -
401 Invalid API key pair in headers -
402 Payment required. Occurs when you run out of API requests. Upgrade <a href=&quot;https://dashboard.theblockchainapi.com/billing\" target=&quot;_blank&quot;>here</a>. -
404 Task not found. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]