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

# getTransactionsForAddress

> Получение полной истории транзакций для любого адреса в одном вызове

## Overview

`getTransactionsForAddress` combines transaction signature lookup and full transaction retrieval into one efficient call. Instead of making separate requests to [getSignaturesForAddress](/rpc/methods/getSignaturesForAddress) and then [getTransaction](/rpc/methods/getTransaction) for each signature, you get everything in a single request.

This method supports:

* Bidirectional sorting (oldest-first or newest-first)
* Time and slot-based filtering via range operators
* Transaction status filtering (succeeded/failed)
* Token account filtering (`none`, `balanceChanged`, `all`)
* Cursor-based pagination via `paginationToken`
* Four detail levels: `signatures`, `none`, `accounts`, `full`

## Why Use This Method

### The N+1 Problem

With standard Solana RPC methods, fetching transaction history requires multiple calls:

1. Call `getSignaturesForAddress` to get a list of transaction signatures
2. Call `getTransaction` for **each** signature to get full transaction data

For a wallet with 100 transactions, that's 101 API calls. For 1,000 transactions, it's 1,001 calls. This creates latency, complexity, and higher costs.

`getTransactionsForAddress` solves this by returning full transaction data in a single call—up to 100 complete transactions or 1,000 signatures per request.

### Additional Capabilities

Beyond efficiency, this method provides features not available in standard RPC:

* **Bidirectional sorting**: Query oldest-first (`asc`) to trace an address from its first transaction
* **Time-based filtering**: Retrieve transactions within a specific date range using `filters.blockTime` with range operators
* **Slot-based filtering**: Query transactions from specific block ranges using `filters.slot` with range operators
* **Status filtering**: Get only successful or only failed transactions
* **Token account inclusion**: Capture transactions from associated token accounts

## Token Account Support

Standard `getSignaturesForAddress` only returns transactions that directly reference the queried address. This misses an important category: **token transfers**.

When tokens are sent to a wallet, the transaction references the wallet's Associated Token Account (ATA), not the wallet address itself. This means standard methods give you an incomplete picture.

`getTransactionsForAddress` with `tokenAccounts: "all"` automatically includes transactions from all token accounts owned by the address, giving you complete transaction history.

```bash theme={null}
curl https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTransactionsForAddress",
  "params": [
    "WALLET_ADDRESS",
    {
      "filters": {
        "tokenAccounts": "all"
      }
    }
  ]
}'
```

Set `tokenAccounts: "none"` (the default) if you only want transactions that directly reference the address.

## Parameters

<ResponseField name="address" type="string" required>
  The Solana address to query (base-58 encoded public key, 32 bytes)
</ResponseField>

<ResponseField name="options" type="object">
  <Expandable title="options fields">
    <ResponseField name="transactionDetails" type="string">
      Level of detail to return:

      * `"signatures"` - Signature info with memo and status (up to 1000 results). **Default.**
      * `"none"` - Same fields as `signatures` (up to 1000 results)
      * `"accounts"` - Signature info plus account keys (up to 100 results)
      * `"full"` - Complete transaction data (up to 100 results)

      Default: `"signatures"`
    </ResponseField>

    <ResponseField name="sortOrder" type="string">
      Sort direction:

      * `"desc"` - Newest transactions first (default)
      * `"asc"` - Oldest transactions first
    </ResponseField>

    <ResponseField name="limit" type="number">
      Maximum number of results to return.

      * For `transactionDetails: "signatures"` or `"none"`: max 1000
      * For `transactionDetails: "full"` or `"accounts"`: max 100

      Default: 100
    </ResponseField>

    <ResponseField name="paginationToken" type="string">
      Pagination cursor from a previous response. Format: `"slot:txIndex"` (e.g. `"387936002:541"`).
    </ResponseField>

    <ResponseField name="commitment" type="string">
      The commitment level for the query:

      * `"finalized"` - Query finalized blocks only (default)
      * `"confirmed"` - Query confirmed blocks

      Note: `"processed"` is not supported and returns an error.
    </ResponseField>

    <ResponseField name="encoding" type="string">
      Encoding format for transaction data (only applies when `transactionDetails: "full"`):

      * `"json"` (default)
      * `"jsonParsed"`
      * `"base64"`
      * `"base58"`
    </ResponseField>

    <ResponseField name="maxSupportedTransactionVersion" type="number">
      Maximum transaction version to return. In `"full"` mode this defaults to `0` (includes versioned transactions). Set explicitly if you need legacy-only behavior.
    </ResponseField>

    <ResponseField name="minContextSlot" type="number">
      The minimum slot that the request can be evaluated at.
    </ResponseField>

    <ResponseField name="filters" type="object">
      <Expandable title="filter fields">
        <ResponseField name="tokenAccounts" type="string">
          Filter by token account association:

          * `"none"` - Only transactions that directly reference the address. **Default.**
          * `"balanceChanged"` - Include token account transactions where balance changed (recommended for clean wallet history)
          * `"all"` - Include all token account transactions

          Default: `"none"`
        </ResponseField>

        <ResponseField name="blockTime" type="object">
          Filter by Unix timestamp using range operators: `gte`, `gt`, `lte`, `lt`, `eq`

          Example: `{ "blockTime": { "gte": 1704067200, "lte": 1706745600 } }`
        </ResponseField>

        <ResponseField name="slot" type="object">
          Filter by slot number using range operators: `gte`, `gt`, `lte`, `lt`, `eq`

          Example: `{ "slot": { "gte": 387000000, "lte": 388000000 } }`
        </ResponseField>

        <ResponseField name="signature" type="object">
          Filter by transaction signature (base-58, 64 bytes) using range operators: `gte`, `gt`, `lte`, `lt`

          Example: `{ "signature": { "lt": "5abc..." } }`
        </ResponseField>

        <ResponseField name="status" type="string">
          Filter by transaction status:

          * `"succeeded"` - Only successful transactions
          * `"failed"` - Only failed transactions
          * Omit or use any other value for no status filter
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

## Response

The response `result` is an object containing a `data` array and an optional `paginationToken`:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "data": [ ... ],
    "paginationToken": "387936002:541"
  }
}
```

The `paginationToken` is only present when more results are available. Pass it in the next request to fetch the next page.

### With `transactionDetails: "signatures"` or `"none"`

<ResponseField name="result.data[]" type="object">
  <Expandable title="signature fields">
    <ResponseField name="signature" type="string">
      Transaction signature (base-58 encoded)
    </ResponseField>

    <ResponseField name="slot" type="number">
      Slot in which the transaction was processed
    </ResponseField>

    <ResponseField name="transactionIndex" type="number">
      Zero-based index of the transaction within the block
    </ResponseField>

    <ResponseField name="blockTime" type="number | null">
      Unix timestamp of the block
    </ResponseField>

    <ResponseField name="err" type="object | null">
      Error object if transaction failed, null otherwise
    </ResponseField>

    <ResponseField name="memo" type="string | null">
      Memo text if the transaction includes a Memo program instruction
    </ResponseField>

    <ResponseField name="confirmationStatus" type="string">
      Echoes the requested commitment level (`"finalized"` or `"confirmed"`)
    </ResponseField>
  </Expandable>
</ResponseField>

### With `transactionDetails: "accounts"`

Same fields as signatures mode, plus:

<ResponseField name="accountKeys" type="string[]">
  Array of base-58 public keys involved in the transaction, including addresses loaded from lookup tables.
</ResponseField>

### With `transactionDetails: "full"`

<ResponseField name="result.data[]" type="object">
  <Expandable title="transaction fields">
    <ResponseField name="slot" type="number">
      Slot in which the transaction was processed
    </ResponseField>

    <ResponseField name="transactionIndex" type="number">
      Zero-based index of the transaction within the block. This field is unique to `getTransactionsForAddress`.
    </ResponseField>

    <ResponseField name="blockTime" type="number | null">
      Unix timestamp of the block
    </ResponseField>

    <ResponseField name="transaction" type="object">
      Full transaction data including message, signatures, and metadata (format depends on `encoding`)
    </ResponseField>

    <ResponseField name="meta" type="object">
      Transaction metadata including fee, balances, and logs
    </ResponseField>
  </Expandable>
</ResponseField>

## Code Examples

### Basic Request

Get the most recent signatures for an address (default mode):

```bash theme={null}
curl https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTransactionsForAddress",
  "params": [
    "ADDRESS_HERE"
  ]
}'
```

### Get Full Transactions

Retrieve up to 100 full transactions:

```bash theme={null}
curl https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTransactionsForAddress",
  "params": [
    "ADDRESS_HERE",
    {
      "transactionDetails": "full",
      "limit": 100
    }
  ]
}'
```

### Get Signatures Only

Retrieve up to 1000 signatures without full transaction data:

```bash theme={null}
curl https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTransactionsForAddress",
  "params": [
    "ADDRESS_HERE",
    {
      "transactionDetails": "signatures",
      "limit": 1000
    }
  ]
}'
```

### Oldest-First with Time Filter

Get transactions from a specific time range, sorted oldest first:

```bash theme={null}
curl https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTransactionsForAddress",
  "params": [
    "ADDRESS_HERE",
    {
      "sortOrder": "asc",
      "filters": {
        "blockTime": {
          "gte": 1704067200,
          "lte": 1706745600
        }
      }
    }
  ]
}'
```

### Successful Transactions Only

Filter to only return transactions that succeeded:

```bash theme={null}
curl https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTransactionsForAddress",
  "params": [
    "ADDRESS_HERE",
    {
      "filters": {
        "status": "succeeded"
      }
    }
  ]
}'
```

### Paginated Request

Use cursor-based pagination to fetch more results:

```bash theme={null}
curl https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTransactionsForAddress",
  "params": [
    "ADDRESS_HERE",
    {
      "limit": 100,
      "paginationToken": "387936002:541"
    }
  ]
}'
```

## TypeScript Example

```typescript theme={null}
interface GetTransactionsOptions {
  transactionDetails?: 'full' | 'signatures' | 'accounts' | 'none';
  limit?: number;
  sortOrder?: 'asc' | 'desc';
  paginationToken?: string;
  commitment?: 'finalized' | 'confirmed';
  encoding?: 'json' | 'jsonParsed' | 'base64' | 'base58';
  maxSupportedTransactionVersion?: number;
  minContextSlot?: number;
  filters?: {
    tokenAccounts?: 'none' | 'balanceChanged' | 'all';
    blockTime?: { gte?: number; gt?: number; lte?: number; lt?: number; eq?: number };
    slot?: { gte?: number; gt?: number; lte?: number; lt?: number; eq?: number };
    signature?: { gte?: string; gt?: string; lte?: string; lt?: string };
    status?: 'succeeded' | 'failed';
  };
}

interface GtfaResult {
  data: any[];
  paginationToken?: string;
}

async function getTransactionsForAddress(
  address: string,
  options: GetTransactionsOptions = {}
): Promise<GtfaResult> {
  const response = await fetch('https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      jsonrpc: '2.0',
      id: 1,
      method: 'getTransactionsForAddress',
      params: [address, options],
    }),
  });

  const data = await response.json();
  return data.result;
}

// Get recent signatures (default mode)
const recent = await getTransactionsForAddress('ADDRESS_HERE');
console.log(recent.data);

// Get oldest transactions first with time filter
const historical = await getTransactionsForAddress('ADDRESS_HERE', {
  sortOrder: 'asc',
  filters: {
    blockTime: {
      gte: Math.floor(Date.now() / 1000) - 86400 * 30,
    },
  },
});

// Paginate through all signatures
async function getAllSignatures(address: string) {
  const allSignatures: any[] = [];
  let paginationToken: string | undefined;

  while (true) {
    const result = await getTransactionsForAddress(address, {
      transactionDetails: 'signatures',
      limit: 1000,
      paginationToken,
    });

    if (!result.data || result.data.length === 0) break;

    allSignatures.push(...result.data);
    paginationToken = result.paginationToken;

    if (!paginationToken) break;
  }

  return allSignatures;
}
```

## Use Cases

### Token Launch Analysis

Find the earliest transactions for a token mint to identify first minters and early holders. Use `sortOrder: "asc"` to start from the beginning:

```typescript theme={null}
const earlyActivity = await getTransactionsForAddress(tokenMintAddress, {
  sortOrder: 'asc',
  limit: 100,
  transactionDetails: 'full',
  filters: {
    tokenAccounts: 'all',
  },
});
```

### Wallet Funding History

Trace where a wallet's funds originated by querying its complete transaction history:

```typescript theme={null}
const fundingHistory = await getTransactionsForAddress(walletAddress, {
  sortOrder: 'asc',
  transactionDetails: 'full',
  filters: {
    tokenAccounts: 'all',
  },
});

const firstTransactions = fundingHistory.data.slice(0, 10);
```

### Failed Transaction Analysis

Debug transaction failures by filtering to only failed transactions:

```typescript theme={null}
const result = await getTransactionsForAddress(walletAddress, {
  filters: {
    status: 'failed',
  },
  transactionDetails: 'full',
});

result.data.forEach(tx => {
  console.log(tx.meta?.err, tx.meta?.logMessages);
});
```

### Build a Wallet Transaction Feed

Create a paginated transaction history for a wallet UI:

```typescript theme={null}
async function getWalletFeed(wallet: string, cursor?: string) {
  return getTransactionsForAddress(wallet, {
    limit: 20,
    paginationToken: cursor,
    transactionDetails: 'full',
    filters: {
      tokenAccounts: 'balanceChanged',
    },
  });
}
```

### Trading Pattern Analysis

Filter successful trades within a specific time window:

```typescript theme={null}
const trades = await getTransactionsForAddress(traderWallet, {
  filters: {
    status: 'succeeded',
    blockTime: {
      gte: startOfMonth,
      lt: endOfMonth,
    },
  },
  transactionDetails: 'full',
});
```

### Compliance Audit

Build a complete transaction history for regulatory compliance:

```typescript theme={null}
async function auditAddress(address: string) {
  const allTxs = await getAllSignatures(address);

  return {
    totalTransactions: allTxs.length,
    successful: allTxs.filter(tx => !tx.err).length,
    failed: allTxs.filter(tx => tx.err).length,
    firstTransaction: allTxs[allTxs.length - 1],
    lastTransaction: allTxs[0],
  };
}
```

## Pagination

For addresses with many transactions, use the `paginationToken` from the response to fetch the next page. The token is a string in the format `"slot:txIndex"` that tells the server where to continue from.

### Fetching Newer Transactions (Default)

With `sortOrder: "desc"` (default), transactions are returned newest-first. The `paginationToken` continues to older transactions:

```typescript theme={null}
const page1 = await getTransactionsForAddress(address, { limit: 100 });

if (page1.paginationToken) {
  const page2 = await getTransactionsForAddress(address, {
    limit: 100,
    paginationToken: page1.paginationToken,
  });
}
```

### Fetching Older Transactions First

With `sortOrder: "asc"`, transactions are returned oldest-first. The `paginationToken` continues to newer transactions:

```typescript theme={null}
const page1 = await getTransactionsForAddress(address, {
  sortOrder: 'asc',
  limit: 100,
});

if (page1.paginationToken) {
  const page2 = await getTransactionsForAddress(address, {
    sortOrder: 'asc',
    limit: 100,
    paginationToken: page1.paginationToken,
  });
}
```

### Complete Pagination Example

Fetch all signatures for an address:

```typescript theme={null}
async function getAllSignatures(address: string) {
  const allSignatures: any[] = [];
  let paginationToken: string | undefined;

  while (true) {
    const result = await getTransactionsForAddress(address, {
      transactionDetails: 'signatures',
      limit: 1000,
      paginationToken,
    });

    if (!result.data || result.data.length === 0) break;

    allSignatures.push(...result.data);
    paginationToken = result.paginationToken;

    if (!paginationToken) break;

    await new Promise(resolve => setTimeout(resolve, 100));
  }

  return allSignatures;
}
```

## Best Practices

1. **Use `signatures` mode for counting**: When you only need to count or list transactions, use `transactionDetails: "signatures"` (the default) for better performance and higher limits (up to 1000).

2. **Filter early**: Apply `blockTime`, `slot`, or `status` filters to reduce the amount of data scanned and improve response times.

3. **Implement pagination**: For addresses with many transactions, always paginate using the `paginationToken` from the response.

4. **Cache results**: Transaction data is immutable once finalized. Cache historical results to avoid redundant requests.

5. **Handle rate limits**: Implement exponential backoff when making many sequential requests.

## Common Errors

| Code   | Message                                       | Solution                                                            |
| ------ | --------------------------------------------- | ------------------------------------------------------------------- |
| -32602 | Invalid params                                | Verify address format (base-58, 32 bytes) and option values         |
| -32602 | Invalid paginationToken format                | Ensure token is in `"slot:txIndex"` format from a previous response |
| -32602 | commitment must be 'finalized' or 'confirmed' | Do not use `"processed"` commitment                                 |
| -32603 | Internal error                                | Database or encoding failure; retry the request                     |

## Comparison with Standard Methods

| Feature               | [getSignaturesForAddress](/rpc/methods/getSignaturesForAddress) + [getTransaction](/rpc/methods/getTransaction) | getTransactionsForAddress            |
| --------------------- | --------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| API calls             | Multiple (1 + N)                                                                                                | Single                               |
| Sorting               | Newest first only                                                                                               | Bidirectional                        |
| Time filtering        | Not supported                                                                                                   | Supported via `filters.blockTime`    |
| Slot filtering        | Not supported                                                                                                   | Supported via `filters.slot`         |
| Status filtering      | Not supported                                                                                                   | Supported via `filters.status`       |
| Token accounts        | Manual ATA queries                                                                                              | Built-in via `filters.tokenAccounts` |
| Max signatures        | 1000 per call                                                                                                   | 1000 per call                        |
| Max full transactions | Limited by calls                                                                                                | 100 per call                         |
| Pagination            | Signature-based `before`/`until`                                                                                | Cursor-based `paginationToken`       |
