Transfer Funds

Send Transaction

This API call allows you to create a transaction and send funds to multiple addresses.

Use the following code:

let recipients = {
          recipients:[
            {
                address:"MP2W5NwaCCDKSR8hHNCsYvgSc7evNdhmj1",
                amount:0.0002
            }
          ],
          sequenceId:'8a3ac341-1591-d17c-9f3b-86916a01120f'
        };

let transactionResponse = await walletInstance.SendMany(recipients);

console.log("Send Many Transaction: =>", transactionResponse);
let recipients: PrebuildAndSignTransactionOptions = {
            recipients:[
               {
                  address:"MP2W5NwaCCDKSR8hHNCsYvgSc7evNdhmj1",
                  amount:0.0002
               }
            ],
                    sequenceId:'8a3ac341-1591-d17c-9f3b-86916a01120f'
        };

let transactionResponse:any = await walletInstance.SendMany(recipients);

console.log("Send Many Transaction: =>", JSON.stringify(transactionResponse));

Parameters:

Params

Data Type

Description

recipients

Array

Recipient is the array of objects. It includes a list of the recipient addresses and amounts. There should be at least one recipient.

sequenceId

String

The Sequence ID is a unique wallet identifier that is applied to transfer transactions during creation. It is a mandatory parameter, without the sequence ID you cannot transfer it to the recipient. With Sequence IDs, you can easily track status transfer transactions.
For example, The system confirms only one send a request for each sequence ID (all subsequent attempts fail). You can repeat the transaction without the risk of double spending.

If you want to send a token transaction then please visit the following page:
<<https://docs.lmnl.app/docs/sendmany-tokens>>

If you want to check the status of the transaction by using sequence ID then please visit the following page:
<<https://docs.lmnl.app/docs/transaction-status#transaction-status-by-sequence-id>>

You will get the following response from the SendMany method. It is JSON representation Only.

{
   "userid":76,
   "raw":"{\"txHex\":\"70736274ff010073020000000159ad55648e5d11bdc45a5663f7b085a0cf13fae0b45e220f1451c3624771a8690100000000ffffffff02204e00000000000017a914a5ed5d0697e8f09df41e3010120549a2c492bb3487c2e63d000000000017a914ed2f8a5488871d87f048ded565498feaad9d7ab08700000000000100fdb60102000000000101799c63fb165136d223f3cfd302535463e6b86f189ae227b869134b0b0191f96401000000232200204a0e149186f20a2981605b83c140108dc726c134021b2bf954eec1ab45cb450fffffffff02102700000000000017a914a5ed5d0697e8f09df41e3010120549a2c492bb348720423e000000000017a914ed2f8a5488871d87f048ded565498feaad9d7ab087040047304402202906e729d1755f29fe4f8c734558afbf0e8876202d44861baf7552df1bd88d04022038811c9a5f123f42a6b1f9977401da3ecbad4278b5faa1795058793cee89ebb70147304402207b45e93a7998b62b69b57a0a21b9ff29df3e4681ce37bf9f60a74f7452b3209d02200bc54ca4aa62d69ba162d15cdebf6f375e8ae2eff070c33efbe140587467372b018b5221020bc37273befd8e61692dbe2071d37bb716445e50803db94e3c0ac0563e4749c22102a9dfe00d0b061a9e9dadca0fe56e83b24edf610a2a27ff983f19621d6851a5f02102f00eefd123247a953ba7416bffa413ce73d08efdeeb7afc004ba063d612fa0322102fcdf11ae3a5c26364b146f6089c0bd4d5eeae142c719fb3bc8e762e7a6f5486f54ae00000000220202a9dfe00d0b061a9e9dadca0fe56e83b24edf610a2a27ff983f19621d6851a5f0483045022100e1d54a683f30a6c5020ac050a6e86b4715089ff551f0e6094a288a87a38b3fdb02205a48449c830ea1d7bc5de95db32c8e3b8bf9548f40bfcf7881877eb05e31165f0101042200204a0e149186f20a2981605b83c140108dc726c134021b2bf954eec1ab45cb450f01058b5221020bc37273befd8e61692dbe2071d37bb716445e50803db94e3c0ac0563e4749c22102a9dfe00d0b061a9e9dadca0fe56e83b24edf610a2a27ff983f19621d6851a5f02102f00eefd123247a953ba7416bffa413ce73d08efdeeb7afc004ba063d612fa0322102fcdf11ae3a5c26364b146f6089c0bd4d5eeae142c719fb3bc8e762e7a6f5486f54ae000000\",\"halfSigned\":{\"payload\":\"Some Value\",\"txBase64\":\"cHNidP8BAHMCAAAAAVmtVWSOXRG9xFpWY/ewhaDPE/rgtF4iDxRRw2JHcahpAQAAAAD/////AiBOAAAAAAAAF6kUpe1dBpfo8J30HjAQEgVJosSSuzSHwuY9AAAAAAAXqRTtL4pUiIcdh/BI3tVlSY/qrZ16sIcAAAAAAAEA/bYBAgAAAAABAXmcY/sWUTbSI/PP0wJTVGPmuG8YmuInuGkTSwsBkflkAQAAACMiACBKDhSRhvIKKYFgW4PBQBCNxybBNAIbK/lU7sGrRctFD/////8CECcAAAAAAAAXqRSl7V0Gl+jwnfQeMBASBUmixJK7NIcgQj4AAAAAABepFO0vilSIhx2H8Eje1WVJj+qtnXqwhwQARzBEAiApBucp0XVfKf5PjHNFWK+/Doh2IC1EhhuvdVLfG9iNBAIgOIEcml8SP0KmsfmXdAHaPsutQni1+qF5UFh5PO6J67cBRzBEAiB7Rek6eZi2K2m1egohuf8p3z5Ggc43v59gp090UrMgnQIgC8VMpKpi1puhYtFc3r9vN16K4u/wcMM+++FAWHRnNysBi1IhAgvDcnO+/Y5haS2+IHHTe7cWRF5QgD25TjwKwFY+R0nCIQKp3+ANCwYanp2tyg/lboOyTt9hCion/5g/GWIdaFGl8CEC8A7v0SMkepU7p0Fr/6QTznPQjv3ut6/ABLoGPWEvoDIhAvzfEa46XCY2SxRvYInAvU1e6uFCxxn7O8jnYuem9UhvVK4AAAAAIgICqd/gDQsGGp6drcoP5W6Dsk7fYQoqJ/+YPxliHWhRpfBIMEUCIQDh1UpoPzCmxQIKwFCm6GtHFQif9VHw5glKKIqHo4s/2wIgWkhEnIMOode8XeldsyyOO4v5VI9Av894gYd+sF4xFl8BAQQiACBKDhSRhvIKKYFgW4PBQBCNxybBNAIbK/lU7sGrRctFDwEFi1IhAgvDcnO+/Y5haS2+IHHTe7cWRF5QgD25TjwKwFY+R0nCIQKp3+ANCwYanp2tyg/lboOyTt9hCion/5g/GWIdaFGl8CEC8A7v0SMkepU7p0Fr/6QTznPQjv3ut6/ABLoGPWEvoDIhAvzfEa46XCY2SxRvYInAvU1e6uFCxxn7O8jnYuem9UhvVK4AAAA=\",\"txHex\":\"70736274ff010073020000000159ad55648e5d11bdc45a5663f7b085a0cf13fae0b45e220f1451c3624771a8690100000000ffffffff02204e00000000000017a914a5ed5d0697e8f09df41e3010120549a2c492bb3487c2e63d000000000017a914ed2f8a5488871d87f048ded565498feaad9d7ab08700000000000100fdb60102000000000101799c63fb165136d223f3cfd302535463e6b86f189ae227b869134b0b0191f96401000000232200204a0e149186f20a2981605b83c140108dc726c134021b2bf954eec1ab45cb450fffffffff02102700000000000017a914a5ed5d0697e8f09df41e3010120549a2c492bb348720423e000000000017a914ed2f8a5488871d87f048ded565498feaad9d7ab087040047304402202906e729d1755f29fe4f8c734558afbf0e8876202d44861baf7552df1bd88d04022038811c9a5f123f42a6b1f9977401da3ecbad4278b5faa1795058793cee89ebb70147304402207b45e93a7998b62b69b57a0a21b9ff29df3e4681ce37bf9f60a74f7452b3209d02200bc54ca4aa62d69ba162d15cdebf6f375e8ae2eff070c33efbe140587467372b018b5221020bc37273befd8e61692dbe2071d37bb716445e50803db94e3c0ac0563e4749c22102a9dfe00d0b061a9e9dadca0fe56e83b24edf610a2a27ff983f19621d6851a5f02102f00eefd123247a953ba7416bffa413ce73d08efdeeb7afc004ba063d612fa0322102fcdf11ae3a5c26364b146f6089c0bd4d5eeae142c719fb3bc8e762e7a6f5486f54ae00000000220202a9dfe00d0b061a9e9dadca0fe56e83b24edf610a2a27ff983f19621d6851a5f0483045022100e1d54a683f30a6c5020ac050a6e86b4715089ff551f0e6094a288a87a38b3fdb02205a48449c830ea1d7bc5de95db32c8e3b8bf9548f40bfcf7881877eb05e31165f0101042200204a0e149186f20a2981605b83c140108dc726c134021b2bf954eec1ab45cb450f01058b5221020bc37273befd8e61692dbe2071d37bb716445e50803db94e3c0ac0563e4749c22102a9dfe00d0b061a9e9dadca0fe56e83b24edf610a2a27ff983f19621d6851a5f02102f00eefd123247a953ba7416bffa413ce73d08efdeeb7afc004ba063d612fa0322102fcdf11ae3a5c26364b146f6089c0bd4d5eeae142c719fb3bc8e762e7a6f5486f54ae000000\",\"sequenceId\":\"b7c24547-67c3-d390-dde9-f24de6deb1a0\"},\"user\":{\"id\":76,\"displayName\":\"Machine\",\"photoURL\":\"https://cdn.icon-icons.com/icons2/1378/PNG/512/avatardefault_92824.png\",\"lastLoginAt\":\"2021-12-28T10:22:28.000Z\",\"email\":\"[email protected]\",\"phoneNumber\":null,\"status\":1,\"created_at\":\"2021-09-08T09:05:22.000Z\",\"clientid\":\"UT3DKwJuEf1L5LiDU7jkwnhE16JU3NKu\",\"type\":2},\"sequenceId\":\"b7c24547-67c3-d390-dde9-f24de6deb1a0\"}",
   "status":1,
   "walletid":"296",
   "type":1,
   "asset":"LTC",
   "chain":"LTC",
   "timestamp":"2021-12-28T10:23:38.421Z",
   "transactionSequenceId":4677,
   "sequenceId":"b7c24547-67c3-d390-dde9-f24de6deb1a0",
   "amount":0.0002,
   "destinationAddress":"MP2W5NwaCCDKSR8hHNCsYvgSc7evNdhmj1",
   "id":6516,
   "usdamount":0.03028
}

Full Example

import { CoinsEnum,LiminalEnvironment, LiminalJs } from "@lmnl/liminaljs";

const main = async () => {
    try {
        // Instance of Liminal Js
        let liminalJs = new LiminalJs(LiminalEnvironment.test);
        await liminalJs
            .Authenticate({
                clientId: "YOUR_CLIENT_ID",
                clientSecret: "YOUR_CLIENT_SECRET"
            })
            .AuthenticateWithAccessToken();

        // Get Wallet Instance
        let walletInstance = await liminalJs
            .Coin(CoinsEnum.ltc)
            .Wallets()
            .Get({ walletId: 296 });

        // recipients data.
        let recipients = {
            recipients:[
                {
                  address:"MP2W5NwaCCDKSR8hHNCsYvgSc7evNdhmj1",
                  amount:0.0002
                }
            ],
          sequenceId:'8a3ac341-1591-d17c-9f3b-86916a01120f'
        };
        let transactionResponse = await walletInstance.SendMany(recipients);
        
        console.log("Send Many Transaction: =>", JSON.stringify(transactionResponse));
    }
    catch (ex) {
        throw ex;
    }
};
main().then((resolve) => console.log("Complete")).catch((error) => console.log(error));
import {
    CoinsEnum,
    LiminalEnvironment,
    LiminalJs,
    PrebuildAndSignTransactionOptions,
    PrebuildTransactionResult,
    SignedTransaction,
    Wallet
} from "@lmnl/liminaljs"

const main = async (): Promise<void> => {
    try {
        // Instance of Liminal Js
        let liminalJs = new LiminalJs(LiminalEnvironment.test);
        await liminalJs
            .Authenticate({
               clientId: "YOUR_CLIENT_ID",
                clientSecret: "YOUR_CLIENT_SECRET"
            })
            .AuthenticateWithAccessToken();

        // Get Wallet Instance
        let walletInstance: Wallet = await liminalJs
            .Coin(CoinsEnum.ltc)
            .Wallets()
            .Get({ walletId: 296 });

        // recipients data.
        let recipients: PrebuildAndSignTransactionOptions = {
            recipients:[
                {
                  address:"MP2W5NwaCCDKSR8hHNCsYvgSc7evNdhmj1",
                  amount:0.0002
                }
            ],
          sequenceId:'8a3ac341-1591-d17c-9f3b-86916a01120f'
        };

        let transactionResponse:any = await walletInstance.SendMany(recipients);

                console.log("Send Many Transaction: =>", JSON.stringify(transactionResponse));


    }
    catch (ex) {
        throw ex;
    }
}

main().then((resolve) => console.log("Complete")).catch((error) => console.log(error));

Did this page help you?