# decode_transaction_bytes

> Decode transaction bytes to DecodedTransactionInfo.

```python
from x402_algorand import decode_transaction_bytes
```

```python
def decode_transaction_bytes(txn_bytes: bytes) -> DecodedTransactionInfo
```

Decode transaction bytes to DecodedTransactionInfo.

Handles both signed and unsigned transactions.

## Parameters

- `txn_bytes` (`bytes`, required):
Msgpack-encoded transaction bytes.

## Returns

- `returns` (`DecodedTransactionInfo`):
DecodedTransactionInfo with extracted data.

## Raises

- `TransactionDecodeError`: If decoding fails (subclass of `ValueError`).

Source: [x402_algorand/utils.py](https://github.com/x402-avm/x402-algorand/blob/main/x402_algorand/utils.py#L321)

Source: https://x402-avm.github.io/reference/python/x402-algorand/decode-transaction-bytes
