> ## Documentation Index
> Fetch the complete documentation index at: https://docs.monei.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Transactions

> Send and track your EVM blockchain transactions

## Overview

Send EVM transactions across multiple networks using Monei's custodial wallet. Monei handles signing, gas, and broadcasting on your behalf, you get back a transaction hash you can use to verify and track the transaction on any block explorer.

**What you'll learn:**

* Send native tokens and ERC-20 tokens
* Track transaction status via block explorers
* Understand transaction states
* Handle transaction failures

***

## How It Works

Monei is a **custodial wallet**. This means:

* You don't manage private keys or providers
* Monei signs and broadcasts the transaction on your behalf
* Gas fees are handled internally, you don't estimate or set them
* After a transaction is sent, Monei returns a `txHash` you can use to verify it on a block explorer

***

## Transaction Types

<CardGroup cols={2}>
  <Card title="Native Token Transfer" icon="coins">
    Send ETH, BNB, MATIC, etc. to any address
  </Card>

  <Card title="ERC-20 Transfer" icon="badge-dollar">
    Send USDT, USDC, or any ERC-20 token
  </Card>
</CardGroup>

***

## Send Native Token

Transfer native tokens (ETH, BNB, MATIC, etc.) across supported networks.

<CodeGroup>
  ```javascript Node.js theme={null}
  import MoneiSDK from 'monei-sdk';

  const monei = new MoneiSDK({
    apiKey: process.env.MONEI_API_KEY,
  });

  // Send 0.1 BNB on BSC
  const tx = await monei.evm.sendNativeToken({
    to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
    amount: '0.1',
    chainId: 56, // BSC
  });

  console.log('Transaction Hash:', tx.txHash);
  console.log('View on Explorer:', `https://bscscan.com/tx/${tx.txHash}`);
  ```

  ```python Python theme={null}
  from monei import MoneiClient

  monei = MoneiClient(
      api_key=os.getenv('MONEI_API_KEY')
  )

  tx = monei.evm.send_native_token(
      to='0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
      amount='0.1',
      chain_id=56,
  )

  print(f'Transaction Hash: {tx.tx_hash}')
  print(f'Explorer: https://bscscan.com/tx/{tx.tx_hash}')
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.monei.cc/api/v1/evm/send/native \
    -H "x-api-key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "to": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
      "amount": "0.1",
      "chainId": 56
    }'
  ```
</CodeGroup>

**Request Parameters:**

| Parameter | Type   | Required | Description                                          |
| --------- | ------ | -------- | ---------------------------------------------------- |
| `to`      | string | Yes      | Recipient wallet address                             |
| `amount`  | string | Yes      | Amount in native token (e.g., `"0.1"` for 0.1 BNB)   |
| `chainId` | number | Yes      | Network chain ID (56 for BSC, 137 for Polygon, etc.) |

**Response:**

```json theme={null}
{
  "statusCode": 200,
  "message": "Transaction sent successfully",
  "data": {
    "txHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
  }
}
```

> **Note:** Save the `txHash` from the response, this is your reference for tracking the transaction on-chain.

***

## Send ERC-20 Token

Transfer ERC-20 tokens like USDT, USDC, or any custom token.

<CodeGroup>
  ```javascript Node.js theme={null}
  // Send 100 USDT on BSC
  const tx = await monei.evm.sendToken({
    to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
    tokenAddress: '0x55d398326f99059fF775485246999027B3197955', // USDT on BSC
    amount: '100',
    chainId: 56,
  });

  console.log('Transaction Hash:', tx.txHash);
  console.log('View on BscScan:', `https://bscscan.com/tx/${tx.txHash}`);
  ```

  ```python Python theme={null}
  tx = monei.evm.send_token(
      to='0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
      token_address='0x55d398326f99059fF775485246999027B3197955',
      amount='100',
      chain_id=56,
  )

  print(f'Transaction Hash: {tx.tx_hash}')
  print(f'Explorer: https://bscscan.com/tx/{tx.tx_hash}')
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.monei.cc/api/v1/evm/send/token \
    -H "x-api-key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "to": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
      "tokenAddress": "0x55d398326f99059fF775485246999027B3197955",
      "amount": "100",
      "chainId": 56
    }'
  ```
</CodeGroup>

**Request Parameters:**

| Parameter      | Type   | Required | Description                                        |
| -------------- | ------ | -------- | -------------------------------------------------- |
| `to`           | string | Yes      | Recipient wallet address                           |
| `tokenAddress` | string | Yes      | ERC-20 token contract address                      |
| `amount`       | string | Yes      | Amount in token units (e.g., `"100"` for 100 USDT) |
| `chainId`      | number | Yes      | Network chain ID                                   |

**Response:**

```json theme={null}
{
  "statusCode": 200,
  "message": "Token transfer successful",
  "data": {
    "txHash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
  }
}
```

***

## Transaction Lifecycle

```mermaid theme={null}
graph LR
    A[Initiated] --> B[Pending]
    B --> C[Confirmed]
    C --> D[Completed]
    B --> E[Failed]
```

**Transaction States:**

| State       | Description                                          |
| ----------- | ---------------------------------------------------- |
| `Initiated` | Transaction created and submitted by Monei           |
| `Pending`   | Broadcast to the network, awaiting mining            |
| `Confirmed` | Mined in a block, awaiting sufficient confirmations  |
| `Completed` | Required confirmations reached, transaction is final |
| `Failed`    | Transaction reverted or rejected by the network      |

***

## Tracking Transactions

Since Monei does not store blockchain transactions on its backend, use the `txHash` returned from the send response to track your transaction directly on the relevant block explorer.

**Block Explorers by Network:**

| Network      | Chain ID | Explorer                                             |
| ------------ | -------- | ---------------------------------------------------- |
| **Ethereum** | 1        | [Etherscan](https://etherscan.io)                    |
| **BSC**      | 56       | [BscScan](https://bscscan.com)                       |
| **Polygon**  | 137      | [PolygonScan](https://polygonscan.com)               |
| **Base**     | 8453     | [BaseScan](https://basescan.org)                     |
| **Arbitrum** | 42161    | [Arbiscan](https://arbiscan.io)                      |
| **Optimism** | 10       | [Optimism Explorer](https://optimistic.etherscan.io) |

**Confirmation Requirements:**

Different networks require different confirmation counts before a transaction is considered final:

| Network      | Confirmations | Approximate Time |
| ------------ | ------------- | ---------------- |
| **Ethereum** | 12 blocks     | \~3 minutes      |
| **BSC**      | 15 blocks     | \~45 seconds     |
| **Polygon**  | 128 blocks    | \~4 minutes      |
| **Base**     | 1 block       | \~2 seconds      |
| **Arbitrum** | 1 block       | \~0.25 seconds   |
| **Optimism** | 1 block       | \~2 seconds      |

***

## Troubleshooting

<AccordionGroup>
  <Accordion icon="circle-xmark" title="Transaction Failed, Insufficient Balance">
    **Cause:** The sending wallet did not have enough balance to cover the transfer amount.

    **Solution:** Check your Monei wallet balance before initiating a transfer and ensure it covers the full amount. Gas fees are handled by Monei, but the transfer amount itself must be available.
  </Accordion>

  <Accordion icon="circle-xmark" title="Transaction Reverted">
    **Common causes:**

    * Insufficient token balance in the custodial wallet
    * Invalid recipient address format
    * Token contract rejected the transfer (e.g. blocklisted address)

    **Solution:** Verify the recipient address is valid and that the wallet holds sufficient token balance. If the issue persists, contact support with your `txHash`.
  </Accordion>

  <Accordion icon="clock" title="Transaction Stuck Pending">
    **Problem:** Transaction has been pending longer than expected.

    **Expected pending times by network:**

    * Ethereum: up to 10 minutes
    * BSC: up to 5 minutes
    * Polygon: up to 10 minutes
    * Base / Arbitrum / Optimism: up to 2 minutes

    **Actions:**

    1. Check the transaction on the relevant block explorer using your `txHash`
    2. If it is past the above thresholds and still unconfirmed, contact Monei support with your `txHash`
  </Accordion>

  <Accordion icon="exclamation-triangle" title="Wrong Network">
    **Problem:** Transaction was sent on the wrong network (e.g. USDT on Ethereum instead of BSC).

    **Recovery:**

    * If the recipient controls the same address on both networks, the funds are accessible, ask them to check the correct network
    * Contact Monei support for assistance

    **Prevention:** Always verify the `chainId` in your request matches the intended network before sending.
  </Accordion>
</AccordionGroup>

***

## Best Practices

<CardGroup cols={2}>
  <Card title="Always Verify the Address" icon="check-double">
    Double-check the recipient address and network before sending, blockchain transactions are irreversible
  </Card>

  <Card title="Test First" icon="vial">
    Send a small test amount before large transfers
  </Card>

  <Card title="Save the txHash" icon="bookmark">
    Always store the txHash from the response, it's your only reference for tracking the transaction on-chain
  </Card>

  <Card title="Verify on Explorer" icon="eye">
    Use the appropriate block explorer to confirm finality before treating a transaction as complete
  </Card>
</CardGroup>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Wallet Operations" icon="wallet" href="/evm-blockchain/wallet-operations">
    Learn about EVM wallet management
  </Card>

  <Card title="Token Swaps" icon="arrows-rotate" href="/evm-blockchain/token-swaps">
    Swap tokens on decentralized exchanges
  </Card>

  <Card title="Transaction Management" icon="list" href="/transactions/management">
    Advanced transaction filtering
  </Card>

  <Card title="Networks" icon="network-wired" href="/core-concepts/networks">
    Learn about supported networks
  </Card>
</CardGroup>
