Amberdata Blog

Litecoin just launched on Amberdata.io!

Written by Trevor Clarke | Oct 18, 2019

The blockchain masterpiece from Charlie Lee is now supported in Amberdata’s platform with full features including RPC, REST and Websockets.

What is Litecoin, and how is it different from bitcoin?

Litecoin was first announced October 9th 2011 as an alternative cryptocurrency, a digital asset that could be used in conjunction with Bitcoin and utilize lower hardware requirements. While many people assume Litecoin is just a quick clone of Bitcoin, there are actually practical differences that make this a substantial asset.

Key differences in Litecoin vs. Bitcoin:

  1. Proof of Work algorithm uses Scrypt instead of SHA-256
    Noted in the announcement: “We really liked Tenebrix’s Scrypt proof of work. Using Scrypt allows one to mine Litecoin while also mining Bitcoin”. Litecoin is meant to be a lower barrier to entry, making it an affordable governance model.
  2. Faster Block Time — ~2.5 Minutes
    With faster block times, brings higher transaction throughput, enabling faster user experience.
  3. Maximum Total Supply: 84 Million
    Compared to bitcoin’s 21 Million, the difference in supply allows for a different economic behavior. Bitcoin is traditionally focussed as a store of value, where Litecoin is an asset built to move quickly and uphold demand.

Litecoin is now part of Amberdata.io

We’re thrilled to announce that Litecoin joins our blockchain offering! We see Litecoin as a great addition to the platform as it enables business to focus on their core features, allows users to maintain self-sovereignty and broadens use-cases for greater market accessibility. With all the features you’ve come to love and enjoy, Litecoin is no longer a new set of tools and protocol, it’s part of a unified set of APIs!

Amberdata platform features supporting Litecoin:

  1. REST — A full API with standardized data sets, across blockchains
  2. WebSockets — Streaming data and updates, realtime from the network
  3. RPC — Connect directly to the node without running the node

Use Litecoin today — No syncing required, no cli, no protocol learning curve, no dev-ops or server management (All of which can cost hundreds to thousands per month), add Litecoin within minutes.

How would we…

  • Connect to Litecoin?
  • Add cryptocurrency to our business?
  • Get transactions and point-in-time value?
  • Get account portfolio and balances?

Adding Litecoin is simple:

For developers, enable Litecoin with a simple variable!

1. Get your Free API Key

Go to Amberdata.io to Get Started.

2. Make your first request — Account Balance

Get account balance by using our documentation directly. Next, go to this page in our documentation. Copy your Amberdata API key to clipboard, and paste it into the “Header Auth” box:

Add Amberdata API to make a request

Add the Litecoin address “MPLtCqK2X4hvcAdiHFMvXZsmfZmQSn9ABV” to the “hash” parameter.

Lastly, add the Litecoin blockchain Id “f94be61fd9f4fa684f992ddfd4e92272” to the x-amberdata-blockchain-id input:

Add Litecoin blockchain ID

Click “Try It”. Now you can see account balance data for this address.

Add our SDK, Web3data.js

The above steps were cool, but we’ve made things a lot simpler! Using the web3data.js SDK, you can get blockchain & market data directly without having to learn our API. Fortunately, we have a full setup guide here:

View the SDK docs here →

Now that you have your API key handy, follow me to the next couple examples:

Try the basics, and the extras — Blocks & Transactions

Go here to test in action →

const Web3Data = require("web3data-js")const w3d = new Web3Data('YOUR_API_KEY')const latestBlock = await w3d.ltc.block.getBlocks()const latestBlockTxns = await w3d.ltc.block.getTransactions(597875, {includePrice: true})

NEXT — Get Account Balance with Market Value →

Get account transaction updates with Websockets

Go here to test in action →

const Web3Data = require("web3data-js")const w3d = new Web3Data('YOUR_API_KEY', {  blockchainId: "f94be61fd9f4fa684f992ddfd4e92272"})// Initialize the connectionw3d.connect()// Subscribes to address transaction eventsw3d.on({  eventName: 'address:transactions',  filters: {address: "Lbuzsisqmp8KyxuotRa8QUz5owr2cVMJGL"}}, transaction => {// Log the transaction data  console.log(transaction)// Terminate the socket connection  w3d.disconnect()})

Using RPC to send & receive Litecoin data

Go here to test in action →

const Web3Data = require("web3data-js")const w3d = new Web3Data('YOUR_API_KEY')const bestBlockHash = await w3d.ltc.rpc('getbestblockhash')

Web3data supports everything Litecoin within the namespace .ltc — making things super simple to add to your application!

Get postman collection for easy API testing

For ongoing development, we’ve created a postman collection that covers all of our features and utilizes simple parameters so you can focus on building. Click here to download the collection directly, or go here for tons of resources:

Amberdata API Documentation

Amberdata API documentation, SDK reference, integration guides, sample code, libraries and tutorials

amberdata.io