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

# Transactions

> Build, sign, submit, and query transactions on Alephium.

Alephium transactions go through three steps build, sign, submit. The node handles building and submitting. Signing happens client-side with the sender's private key, typically through the Alephium SDK or wallet.

## Get transaction status

Returns the current status of a transaction by its hash.

```bash theme={null}
curl "https://rpc.ralphstudio.xyz/{slug}/transactions/status?txId={tx-hash}&fromGroup=0&toGroup=0" \
  -H "Authorization: Bearer API_KEY"
```

```json theme={null}
{
  "type": "Confirmed",
  "blockHash": "00000000ab3c...",
  "txIndex": 0,
  "chainConfirmations": 1,
  "fromGroupConfirmations": 1,
  "toGroupConfirmations": 1
}
```

The `type` field can be `Confirmed`, `MemPooled`, or `TxNotFound`.

## Get transaction details

Returns full transaction data by hash.

```bash theme={null}
curl "https://rpc.ralphstudio.xyz/{slug}/transactions/details/{tx-hash}?fromGroup=0&toGroup=0" \
  -H "Authorization: Bearer API_KEY"
```

```json theme={null}
{
  "unsigned": {
    "txId": "503a2c...",
    "version": 0,
    "networkId": 0,
    "gasAmount": 20000,
    "gasPrice": "100000000000",
    "inputs": [...],
    "fixedOutputs": [...]
  },
  "contractInputs": [],
  "generatedOutputs": [],
  "inputSignatures": [...],
  "scriptSignatures": []
}
```

## Build a transaction

Builds an unsigned transaction. The response contains the unsigned tx that needs to be signed before submitting.

```bash theme={null}
curl -X POST "https://rpc.ralphstudio.xyz/{slug}/transactions/build" \
  -H "Authorization: Bearer API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "fromPublicKey": "03a1b2c3...",
    "destinations": [
      {
        "address": "1DrDyTr9RpRsQnDnXo2YRiPzPW4ooHX5LLoqXrqfMrpQH",
        "attoAlphAmount": "1000000000000000000"
      }
    ]
  }'
```

```json theme={null}
{
  "unsignedTx": "0000000000...",
  "gasAmount": 20000,
  "gasPrice": "100000000000",
  "txId": "503a2c...",
  "fromGroup": 0,
  "toGroup": 0
}
```

## Submit a signed transaction

Submits a transaction that has already been signed.

```bash theme={null}
curl -X POST "https://rpc.ralphstudio.xyz/{slug}/transactions/submit" \
  -H "Authorization: Bearer API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "unsignedTx": "0000000000...",
    "signature": "a1b2c3d4..."
  }'
```

```json theme={null}
{
  "txId": "503a2c...",
  "fromGroup": 0,
  "toGroup": 0
}
```

## Decode an unsigned transaction

Decodes a raw unsigned transaction into a human-readable format.

```bash theme={null}
curl -X POST "https://rpc.ralphstudio.xyz/{slug}/transactions/decode-unsigned-tx" \
  -H "Authorization: Bearer API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "unsignedTx": "0000000000..."
  }'
```

## Sweep address

Consolidates all UTXOs from an address into a single output. Useful for cleaning up fragmented balances.

```bash theme={null}
curl -X POST "https://rpc.ralphstudio.xyz/{slug}/transactions/sweep-address/build" \
  -H "Authorization: Bearer API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "fromPublicKey": "03a1b2c3...",
    "toAddress": "1DrDyTr9RpRsQnDnXo2YRiPzPW4ooHX5LLoqXrqfMrpQH"
  }'
```

## Estimate gas

Returns the estimated gas for a transaction before building it.

```bash theme={null}
curl -X POST "https://rpc.ralphstudio.xyz/{slug}/transactions/build" \
  -H "Authorization: Bearer API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "fromPublicKey": "03a1b2c3...",
    "destinations": [...],
    "gasAmount": null
  }'
```

When `gasAmount` is null the node estimates it automatically and includes the estimate in the response.

## Parameters reference

| Parameter      | Type    | Description                                  |
| -------------- | ------- | -------------------------------------------- |
| txId           | string  | Transaction hash                             |
| fromGroup      | integer | Source shard group (0–3)                     |
| toGroup        | integer | Destination shard group (0–3)                |
| fromPublicKey  | string  | Sender's public key (hex)                    |
| destinations   | array   | List of recipient addresses and amounts      |
| attoAlphAmount | string  | Amount in attoALPH (1 ALPH = 10^18 attoALPH) |
| unsignedTx     | string  | Raw unsigned transaction (hex)               |
| signature      | string  | Transaction signature (hex)                  |
| gasAmount      | integer | Gas limit: leave null to auto-estimate       |
| gasPrice       | string  | Gas price in attoALPH                        |
