Create Raw Transaction (Advanced)

Creating a raw transaction with version 2 on the Litecoin blockchain involves constructing a transaction while you get to choose which UTXOs to spend.

Create a raw transaction v2 (API reference)

POST /api/Litecoin/Create-Raw-LTC-Transactions-v2

This post requests to create a raw transaction v2 (the endpoint with more control over creating transactions) on the Litecoin blockchain. It's very critical yet utmost useful end-point in the cases when you do not remember or have forgotten your wallet name. We would highly recommend you to go through What are UTXOs page and How to spend UTXOs manually page before using this end-point.

Headers

Name
Type
Description

Content-Type

application/json

Authorization*

Bearer <your api key>

Attach your API key here

Usev2*

String

Value should be true or yes

Request Body

Name
Type
Description

senderAddress*

String

Sender's address

recipientAddress*

String

Receiver's address

amount*

Float

Amount to send

utxos*

Array<String>

Array of unspent transaction IDs (UTXOs)

vouts_n*

Array<Int>

Array of output indices corresponding to the unspent transaction

Create Raw Transaction(Advanced) with Javascript SDK

Liaas SDK package installation

/** 
 * Create Raw Transaction(Advanced) on Litecoin Blockchain
**/
 
//all the parameters specified here are the same as all the parameters in the API implementation
//pass your API key or Node URL
const response = await liaasSdk.createRawTransaction_v2(
nodeUrl_or_apiAccessKey,
recipientAddress,
amount = 0.001,
senderAddress,
utxos,
number_of_vouts
);

Last updated