Litecoin

GetBlock provides RPC endpoints that implement the Litecoin JSON-RPC API standard. These methods are core functionalities for interacting with Litecoin nodes.

The Litecoin network offers a comprehensive suite of methods that enable developers to interact seamlessly with its blockchain infrastructure. This overview provides an in-depth examination of these methods, categorizing them into key functional areas for better understanding and implementation.

What you can expect to find in this documentation

  • Compatibility with the Litecoin mainnet and testnets

  • Purpose, functionality, and use cases of each Litecoin method

  • Required input parameters

  • Sample requests and responses

  • Code examples in multiple programming languages (Python, JavaScript)

What you can do with this API:

  • Query real-time blockchain data

  • Retrieve block and transaction information

  • Monitor mempool and network status

  • Submit and track transactions

  • Access mining statistics and difficulty

circle-info

TECHNICAL DISCLAIMER: AUTHORITATIVE JSON-RPC API SPECIFICATION.

GetBlock's RPC API reference documentation is provided exclusively for informational purposes and streamlined developer experience optimization. The canonical and normative specification for Litecoin JSON-RPC methods is solely maintained and published through the official Litecoin Core documentation.

Base URL

Supported Networks

Network
Chain ID
JSON RPC
Blockbook(WS)
Blockbook(REST)

Mainnet

1329

Quickstart

In this section, you will learn how to make your first call with either:

  • Axios

  • Python

Before you begin, you must have already installed npmarrow-up-right or yarnarrow-up-right on your local machine (for the Axios example) or Python and pip (for the Python example).

1

Setup project

Create and initialize a new project:

2

Install Axios

3

Create file

Create a new file named index.js. This is where you will make your first call.

4

Set ES module type

Set the ES module "type": "module" in your package.json.

5

Add code

Add the following code to index.js:

Replace <ACCESS-TOKEN> with your actual access token from GetBlock.

6

Run the script

Expected output (example):

Available Methods

Blockchain Information

These methods allow users to retrieve information about the Litecoin blockchain state.

  • getblockchaininfo: Returns an object containing various state info regarding blockchain processing.

  • getbestblockhash: Returns the hash of the best (tip) block in the longest blockchain.

  • getblockcount: Returns the number of blocks in the longest blockchain.

  • getdifficulty: Returns the proof-of-work difficulty as a multiple of the minimum difficulty.

Block Retrieval

Key methods to fetch block data from the blockchain.

  • getblock: Returns an object with information about block for given hash.

  • getblockhash: Returns hash of block in best-block-chain at height provided.

  • getblockstats: Compute per block statistics for a given window.

Transaction Methods

Methods for creating, decoding, and broadcasting transactions.

  • getrawtransaction: Returns the raw transaction data.

  • decoderawtransaction: Returns a JSON object representing the serialized transaction.

  • decodescript: Decode a hex-encoded script.

  • createrawtransaction: Creates a transaction spending the given inputs.

Mempool Methods

Methods for querying the memory pool of unconfirmed transactions.

  • getmempoolinfo: Returns details on the active state of the TX memory pool.

  • getmempoolentry: Returns mempool data for given transaction.

  • getmempoolancestors: Returns all in-mempool ancestors.

  • getmempooldescendants: Returns all in-mempool descendants.

Mining Methods

Methods related to mining operations and statistics.

  • getmininginfo: Returns a json object containing mining-related information.

  • getnetworkhashps: Returns the estimated network hashes per second.

  • getblocktemplate: Returns data needed to construct a block to work on.

Network Methods

Methods for querying network state and peer information.

  • getconnectioncount: Returns the number of connections to other nodes.

  • getnettotals: Returns information about network traffic.

Utility Methods

General utility methods for validation and information.

  • validateaddress: Return information about the given Litecoin address.

  • verifymessage: Verify a signed message.

  • estimatesmartfee: Estimates the approximate fee per kilobyte.

  • help: List all commands, or get help for a specified command.

UTXO Methods

Methods for querying unspent transaction outputs.

  • gettxout: Returns details about an unspent transaction output.

  • gettxoutsetinfo: Returns statistics about the unspent transaction output set.

  • gettxoutproof: Returns a hex-encoded proof that txids were included in a block.

Support

For technical support and questions:

See Also

Last updated

Was this helpful?