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

# Tron portal stream

> API reference for tronPortalStream().

`tronPortalStream()` reads Tron blocks from an SQD Portal dataset and applies one or more query outputs.

```ts theme={"system"}
import { tronPortalStream, tronQuery } from '@subsquid/pipes/tron'

const stream = tronPortalStream({
  id: 'tron-transfers',
  portal: 'https://portal.sqd.dev/datasets/tron-mainnet',
  outputs: tronQuery()
    .addFields({ block: { number: true }, transaction: { hash: true } })
    .addTransferTransactionRequest({
      range: { from: 'latest' },
      request: {},
    }),
})
```

## Options

| Option     | Required | Description                                                                  |
| ---------- | -------- | ---------------------------------------------------------------------------- |
| `id`       | Yes      | Stable, non-empty pipe identifier. Targets use it as the default cursor key. |
| `portal`   | Yes      | Dataset URL or a `PortalClientOptions` object.                               |
| `outputs`  | Yes      | A `TronQueryBuilder`, transformer, or record of named outputs.               |
| `cache`    | No       | Portal response cache.                                                       |
| `logger`   | No       | Pino-compatible logger, log level, `false`, or `null`.                       |
| `metrics`  | No       | Metrics server instance.                                                     |
| `profiler` | No       | `boolean` or profiler span hooks.                                            |
| `progress` | No       | Progress callbacks and reporting interval.                                   |

When `portal` is an object, it accepts `url`, `finalized`, `http`, `maxBytes`, `maxIdleTimeMs`, `maxWaitTimeMs`, and `headPollIntervalMs`.

```ts theme={"system"}
const finalizedStream = tronPortalStream({
  id: 'finalized-tron-transfers',
  portal: {
    url: 'https://portal.sqd.dev/datasets/tron-mainnet',
    finalized: true,
  },
  outputs: tronQuery().addRange({ from: 'latest' }),
})
```

Use `for await` to consume batches, `.pipe()` to add a whole-stream transformer, or `.pipeTo()` to connect a target.

See the [query builder reference](./query-builder) for typed fields and filters.


## Related topics

- [Portal stream](/en/sdk/pipes-sdk/evm/reference/basic-components/source.md)
- [EVM Portal stream](/en/sdk/squid-sdk/evm/reference/evm-stream.md)
- [Bitcoin portal stream](/en/sdk/pipes-sdk/bitcoin/reference/basic-components/source.md)
- [Hyperliquid fills portal stream](/en/sdk/pipes-sdk/hyperliquid/reference/basic-components/source.md)
- [Stream Blocks](/en/api/tron/stream.md)
