Guides

Create Basic Transaction#

Introduction#

This guide demonstrates how to create a basic transaction to send ADA from one address to another. The basic transaction is the simplest form of Cardano transaction, focused solely on transferring the native currency (ADA/Lovelace) without additional assets or metadata. With the Anvil API, you can easily create, sign, and submit these transactions with minimal configuration.

For more information on transactions, please refer to the Transaction Overview.

Key Features#

  • Simple ADA transfers between addresses
  • Minimal configuration required
  • Clean and straightforward API payload

Requirements#

  • A Cardano wallet with sufficient ADA
  • Recipient wallet address
  • Valid API key for authentication

Full Examples#

Using Next.js and Weld#

Next.js & WeldLearn how to build a complete Cardano dApp that sends transactions using Next.js, React, and Weld wallet integration.

Using Bash and cURL#

Bash & cURLUsing bash & cURL to build, sign* and submit a transaction

Using TS/JS Fetch#

Deno & FetchUsing Deno (or Node) & fetch to build, sign* and submit a transaction


Specifications#

API Endpoint#

POST /transactions/build

Request Structure#

{
  "changeAddress": "<sender_address>",
  "utxos": ['8282...', '8282...', '8282...'],
  "outputs": [
    {
      "address": "<receiver_address>",
      "lovelace": <lovelace_amount>
    }
  ]
}

Best Practices#

  • Always verify the recipient address before submitting transactions
  • Remember that 1 ADA = 1,000,000 Lovelace
  • Always provide UTXOs in production See Selecting UTXOs for Transactions
  • Test transactions on testnet before moving to mainnet
  • Consider transaction fees when planning amounts to send
  • Keep your API key secure and never expose it in client-side code