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

# getTransactionDetails

> Get full details for a specific transaction by chain and signature.

## Function Signature

```dart theme={null}
Future<PortalGetTransactionDetailsResponse> getTransactionDetails(
  String chain,
  String signature,
)
```

## Description

Retrieves the full details of a specific transaction identified by its chain and signature (transaction hash). Supports EVM, EVM user operations, Solana, Bitcoin, Stellar, and Tron chains.

## Parameters

| Parameter   | Type     | Required | Description                                                                                                                                    |
| ----------- | -------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `chain`     | `String` | Yes      | The chain ID in CAIP-2 format (e.g. `eip155:1`). Note: this parameter is named `chain` (not `chainId`) to match the underlying native SDK API. |
| `signature` | `String` | Yes      | The transaction hash or signature to look up                                                                                                   |

## Returns

**`PortalGetTransactionDetailsResponse`** — An object containing transaction metadata and chain-specific data.

### PortalGetTransactionDetailsResponse

| Property                 | Type      | Description                                                                      |
| ------------------------ | --------- | -------------------------------------------------------------------------------- |
| `chainId`                | `String`  | The chain ID the transaction belongs to                                          |
| `signature`              | `String`  | The transaction hash or signature                                                |
| `evmTransactionJson`     | `String?` | JSON string of the EVM transaction (present for standard EVM chains)             |
| `evmUserOperationJson`   | `String?` | JSON string of the EVM user operation (present for ERC-4337 account abstraction) |
| `solanaTransactionJson`  | `String?` | JSON string of the Solana transaction                                            |
| `bitcoinTransactionJson` | `String?` | JSON string of the Bitcoin transaction                                           |
| `stellarTransactionJson` | `String?` | JSON string of the Stellar transaction                                           |
| `tronTransactionJson`    | `String?` | JSON string of the Tron transaction                                              |

Only one of the chain-specific JSON fields will be non-null, depending on the chain.

## Example

```dart theme={null}
import 'dart:convert';
import 'package:portal_flutter/portal_flutter.dart';

final portal = Portal();

// Look up a specific EVM transaction
final details = await portal.getTransactionDetails(
  'eip155:11155111',
  '0xabc123...',
);

print('Chain: ${details.chainId}');
print('Signature: ${details.signature}');

if (details.evmTransactionJson != null) {
  final tx = jsonDecode(details.evmTransactionJson!);
  print("Value: ${tx['value']}");
  print("Gas: ${tx['gas']}");
  print("Block: ${tx['blockHash']}");
} else if (details.solanaTransactionJson != null) {
  final tx = jsonDecode(details.solanaTransactionJson!);
  print("Slot: ${tx['slot']}");
}
```

### Fetch details for the most recent transaction

```dart theme={null}
// Get the latest transaction hash first
final transactions = await portal.getTransactions(
  'eip155:1',
  limit: 1,
  order: PortalTransactionOrder.desc,
);

if (transactions.isNotEmpty && transactions.first.hash != null) {
  final details = await portal.getTransactionDetails(
    'eip155:1',
    transactions.first.hash!,
  );
  print('Details: ${details.evmTransactionJson}');
}
```

## Errors

| Code                            | Description                             |
| ------------------------------- | --------------------------------------- |
| `NOT_INITIALIZED`               | Portal was not initialized              |
| `GET_TRANSACTION_DETAILS_ERROR` | Failed to fetch the transaction details |

## Related

* [getTransactions](./gettransactions)
* [evaluateTransaction](./evaluatetransaction)
