# Unified Transaction Feed

One paginated, date-sorted list of the user's blockchain transactions, bank ramp fiat activity and card purchases of crypto.

## Overview

The feed combines six sources for the authenticated user: blockchain transaction records, bank ramp fiat deposits, the bank ramp pay-in transactions (those with a crypto amount), the bank ramp payouts, the bank ramp pay-in checkout sessions, and the crypto bought by card through the card onramp. Items are sorted by `sortDate`, newest first, then by `createdAt`. Each item's `type` tells you which fields it carries — see **Item Types**. To fetch one item later, use [Get Aggregated Transaction](https://docs.aureahub.com/docs/tx-aggregated-get.md).

## Endpoint

### `GET /v1/transactions/aggregated/`

Authentication: bearer token required.

Returns a paginated feed of blockchain and the bank ramp items for the authenticated user, newest first.

**Query parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `page` | integer | no | Page number, starting at 1. Default `1`. |
| `limit` | integer | no | Items per page, 1–100. Default `20`. |
| `types` | string | no | Comma-separated item types to include, e.g. `blockchain_send,noah_payout`. Takes precedence over `type`. |
| `type` | string | no | A single item type (older form of `types`). |
| `payinTransactionType` | string | no | Restricts `noah_payin_transaction` items to this transaction type (for example `purchase`, `withdrawal`, `refund`). Other items are unaffected. |
| `counterpartyAddress` | string | no | Only blockchain items where this address is the sender or recipient (case-insensitive exact match). The bank ramp items are excluded. |
| `counterpartyUsername` | string | no | Only blockchain items whose sender or recipient username contains this text (case-insensitive). The bank ramp items are excluded. Ignored when `counterpartyAddress` is set. |
| `isTestnet` | boolean | no | Default `false`. Selects testnet blockchain items and is also matched against the sandbox flag of the bank ramp items. |

**Responses**

`200` OK

```json
{
  "data": [
    {
      "id": "0b9d4c1e-3f6a-4b8e-9d2c-7a5e1f3b6c90",
      "type": "blockchain_send",
      "status": "confirmed",
      "sortDate": "2026-09-11T10:00:15.000Z",
      "createdAt": "2026-09-11T10:00:00.000Z",
      "chain": "gnosis",
      "txHash": "0x7f3a…",
      "fromAddress": "0x2f4B…",
      "toAddress": "0x52908400098527886E0F7030069857D2E4169EE7",
      "fromUsername": "alice",
      "toUsername": "bob",
      "value": "10000000000000000",
      "isTestnet": false,
      "blockTimestamp": "2026-09-11T10:00:15.000Z",
      "metadata": { "type": "send", "tokenSymbol": "xDAI", "tokenDecimals": 18 }
    },
    {
      "id": "7c2e9a41-5b3d-4f10-8e6a-2d9c4b1f0e73",
      "type": "noah_payout",
      "status": "…",
      "sortDate": "2026-09-09T14:30:00.000Z",
      "createdAt": "2026-09-09T14:30:00.000Z",
      "fiatAmount": "…",
      "fiatCurrency": "…",
      "cryptoCurrency": "…",
      "cryptoAuthorizedAmount": "…",
      "exchangeRate": null,
      "noahTransactionId": null
    }
  ],
  "pagination": { "page": 1, "limit": 20, "total": 2, "totalPages": 1 }
}
```

## Item Types

Every item has `id`, `type`, `status`, `sortDate` and `createdAt`. `status` is the status of the source record, so its values differ between types.

| type | Additional fields | sortDate |
| --- | --- | --- |
| blockchain_send blockchain_receive blockchain_swap | `chain`, `txHash`, `fromAddress`, `toAddress`, `fromUsername`, `toUsername`, `value`, `isTestnet`, `blockTimestamp`, `metadata`. A transfer is a send when its sender is the wallet's own address and a receive otherwise; swap records are `blockchain_swap`. `value` is the amount stored on the record — the smallest-unit string for sends created with Create Transaction. | Block time, or `createdAt` |
| noah_fiat_deposit | `fiatAmount`, `fiatCurrency`, `senderName`, `noahDepositId`, `depositDate` | Deposit date, or `createdAt` |
| noah_payin_transaction | `transactionType`, `fiatAmount`, `fiatCurrency`, `cryptoAmount`, `cryptoCurrency`, `exchangeRate`, `blockchainTxHash`, `network`, `noahTransactionId` | Transaction date, or `createdAt` |
| noah_payout | `fiatAmount`, `fiatCurrency`, `cryptoCurrency`, `cryptoAuthorizedAmount`, `exchangeRate`, `noahTransactionId` | `createdAt` |
| noah_payin_checkout | `fiatAmount`, `fiatCurrency`, `cryptoCurrency`, `cryptoAmount`, `exchangeRate`, `externalId`, `checkoutUrl` | `createdAt` |
| card_onramp_purchase | A card onramp session the user paid (`status` `fulfillment_processing` or `fulfillment_complete`); its `id` is the session's, which [Get a Session](https://docs.aureahub.com/docs/card-onramp-get.md) reads. `fiatAmount`, `fiatCurrency` (what the payment provider charged), `cryptoAmount`, `cryptoCurrency`, `network` (the payment provider's name), `chain` (Aurea's), `toAddress`, `blockchainTxHash` (once delivered), `isTestnet` | `createdAt` |

## Filters

- `types` wins over `type`; both match the item `type` exactly.
- `counterpartyAddress` and `counterpartyUsername` return blockchain items only. If both are sent, only `counterpartyAddress` is applied.
- `payinTransactionType` only narrows `noah_payin_transaction` items; other items still appear.
- `isTestnet` applies to all six sources: testnet flag for blockchain records, sandbox flag for the bank ramp and card onramp records.
- There are no status, wallet or date-range filters. For wallet- or status-filtered blockchain records use [List Transactions](https://docs.aureahub.com/docs/tx-list.md).

## Implementation

```javascript
async function getActivityPage(token, { page = 1, limit = 20, types } = {}) {
  const params = new URLSearchParams({ page: String(page), limit: String(limit) });
  if (types) params.set('types', types.join(','));

  const res = await fetch('https://api.aureahub.com/v1/transactions/aggregated/?' + params, {
    headers: { Authorization: 'Bearer ' + token },
  });
  if (!res.ok) throw new Error('Feed error: ' + res.status);
  return res.json(); // { data, pagination: { page, limit, total, totalPages } }
}

function describe(item) {
  switch (item.type) {
    case 'blockchain_send':        return 'Sent on ' + item.chain;
    case 'blockchain_receive':     return 'Received on ' + item.chain;
    case 'blockchain_swap':        return 'Swap on ' + item.chain;
    case 'noah_fiat_deposit':      return 'Fiat deposit ' + item.fiatAmount + ' ' + item.fiatCurrency;
    case 'noah_payin_transaction': return 'Pay-in (' + item.transactionType + ')';
    case 'noah_payout':            return 'Payout ' + item.fiatAmount + ' ' + item.fiatCurrency;
    case 'noah_payin_checkout':    return 'Pay-in checkout';
    default:                       return item.type;
  }
}

const { data, pagination } = await getActivityPage(token, {
  types: ['blockchain_send', 'blockchain_receive'],
});
data.forEach(item => console.log(item.sortDate, describe(item), item.status));
```

---

Web version: https://docs.aureahub.com/#agg-tx-list
