10 credits per API call
Send LTC to blockchain addresses.
Litecoin transactions are based on UTXOs. "UTXO" stands for "Unspent Transaction Output". A UTXO is the amount of LTC that remains at a Litecoin address after a cryptocurrency transaction involving this address has been performed. The UTXO can then be used as input for a new cryptocurrency transaction. For more information about the UTXO, see the Bitcoin user documentation. To check UTXOs in a transaction, see the API for getting information about a transaction output (UTXO) in a Litecoin transaction.
You can build a LTC transaction by one of the following methods:
- Sending LTC from blockchain addresses
The assets are sent from a list of addresses. For each address, the last 100 transactions are scanned for any UTXO to be included in the transaction. For easier control over the assets to be sent, we recommend that you use this method only if you have one address to send the assets from.
To use this method, use theLtcTransactionAddress
orLtcTransactionAddressKMS
schema of the request body. - Sending LTC from UTXOs
The assets are sent from a list of UTXOs. Each UTXO is included in the transaction. Use this method if you want to manually calculate the amount to send.
To use this method, use theLtcTransactionFromUTXO
orLtcTransactionFromUTXOKMS
schema of the request body.
When an UTXO is entered into a transaction, the whole UTXO amount is included and must be spent. For example, address A receives two transactions, T1 with 1 LTC and T2 with 2 LTC. A transaction that consumes the UTXOs from both T1 and T2 will have an available amount of 3 LTC to spend:1 LTC (from T1) + 2 LTC (from T2) = 3 LTC (to spend in total)
You can send the assets to one or multiple recipients in one transaction. If you send the assets to multiple addresses, each address must have its own amount to receive.
Paying the gas fee and receiving the change
When the amount that the recipients should receive is lower than the amount from the UTXOs, the difference between these two amounts is by default used as the gas fee for the transaction. Because this amount may be considerable and you may not want to spend it all on the gas fee, you can explicitly specify the fee amount and the blockchain address where any extra funds remaining after covering the fee will be sent (the fee
and changeAddress
parameters in the request body, correspondingly).
Signing a transaction
When sending LTC, you are charged a fee for the transaction, and you must sign the transaction with the private key of the blockchain address from which the fee will be deducted.
Providing the private key in the API is not a secure way of signing transactions, because the private key can be stolen or exposed. Your private keys should never leave your security perimeter. You should use the private keys only for testing a solution you are building on the testnet of a blockchain.
For signing transactions on the mainnet, we strongly recommend that you use the Tatum Key Management System (KMS) and provide the signature ID instead of the private key in the API. Alternatively, you can use the Tatum JavaScript client.
Examples of using this endpoint with the Tatum JS SDK can be found in Tatum LTC SDK.