---
title: "TONAPI"
description: "Balances and history on TON through tonapi.io. Jetton transfers included, failed ones left out. Keyless."
canonical_url: "https://explorers.agntn.dev/providers/ton"
---
# TONAPI

> Balances and history on TON through tonapi.io. Jetton transfers included, failed ones left out. Keyless.

<provider-facts provider="ton">



</provider-facts>

## Address it

```ts
const ton = await create("ton");
await ton.getTxHistory("…", "ton", { limit: 20 });
```

## What it reads

`/v2/accounts/:address` for the balance and `/v2/accounts/:address/events` for history. Each event becomes a `Transaction`; a TON transfer sets the value, anything else marks `isContractInteraction`, and Jetton transfers inside an event become `tokenTransfers` with the Jetton's own decimals.

## Gotchas

- Nanotons, nine decimals.
- Newest first is the default. `sort: "asc"` sends `sort_order=asc` and pages with `after_lt`, because `before_lt` keeps serving page one. Events have no block number, so `startBlock` and `endBlock` throw `ExplorerError` before any request. Better than a range that means nothing.
- A failed Jetton transfer gets dropped from `tokenTransfers` rather than listed as if it moved anything. An event that hasn't finished stays `pending`.
- TONAPI has no block lookup compatible with a single block number, so `getBlockInfo` stays unsupported. `getTxDetail` too: history is the only transaction read.
- TON addresses come in several encodings. The provider passes yours through as typed and lets TONAPI sort it out; nothing on this site rewrites it.

## Where it lives

`src/providers/ton.ts`.


## Sitemap

See the full [sitemap](https://explorers.agntn.dev/sitemap.md) for all pages.
