Make payments

Send ADA and native tokens.

Note: You need to have a wallet and a provider selected in order to build and submit transactions.

Simple ADA payment

const tx = await lucid.newTx()
  .payToAddress("addr_test...", { lovelace: 5000000n })
  .complete();

const signedTx = await tx.sign().complete();

const txHash = await signedTx.submit();

Multiple recipients

Each payToAddress call creates new UTxO, also for same addresses.
Lucid takes the order of outputs into account.

const tx = await lucid.newTx()
  .payToAddress("addr_testa...", { lovelace: 5000000n })
  .payToAddress("addr_testb...", { lovelace: 5000000n })
  .payToAddress("addr_testc...", { lovelace: 5000000n })
  .complete();

const signedTx = await tx.sign().complete();

const txHash = await signedTx.submit();

Send native tokens

Lucid implicitly adds the minimum ADA requirement when sending native tokens.

const policyId = "00...";
const assetName = "MyToken";

const tx = await lucid.newTx()
  .payToAddress("addr_test...", { [policyId + fromText(assetName)]: 10n })
  .complete();

const signedTx = await tx.sign().complete();

const txHash = await signedTx.submit();

Send ADA with metadata

const tx = await lucid.newTx()
  .payToAddress("addr_test...", { lovelace: 5000000n })
  .attachMetadata(1, { msg: "Hello from Lucid." })
  .complete();

const signedTx = await tx.sign().complete();

const txHash = await signedTx.submit();

Send ADA with datum

The datum will be attached to the witness set and the datum hash is stored in the UTxO. To inline the datum directly in the UTxO use { inline: Data.to("31313131") }.
Like with native tokens Lucid implicitly adds the minimum ADA requirement for datums.

const tx = await lucid.newTx()
  .payToAddressWithData("addr_test...", Data.to("31313131"), {
    lovelace: 5000000n,
  })
  .complete();

const signedTx = await tx.sign().complete();

const txHash = await signedTx.submit();

Tx API reference
TxComplete API reference
TxSigned API reference
Data API reference