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

# 扫描交易历史

> 在服务器端搜索某个地址的历史记录，查找调用程序指令或涉及代币铸币地址的交易，并返回解析后的匹配项、其签名或数量。

此页面上的请求正文、响应模式和示例均根据 OpenAPI 定义生成。

扫描功能会遍历一个地址的历史记录，保留符合 `match` 条件的交易，并且只解析这些交易。你可以使用它来代替逐页获取 [Parsed Transaction History](https://www.helius.dev/docs/zh/api-reference/parsed-events/transaction-history.md) 并在客户端进行筛选。

默认情况下，`data` 中的每一项都采用 [Parse Transactions](https://www.helius.dev/docs/zh/api-reference/parsed-events/transactions.md) 返回的相同 `TransactionResult` 结构。设置 `returnShape` 可仅获取匹配的签名或匹配数量。响应还包含 `scan` 摘要，说明扫描进度以及停止原因。

## 扫描的工作方式

1. 扫描功能会按每页最多 1,000 笔交易获取该地址的历史记录，并采用 `sortOrder` 顺序，同时遵循你设置的 `slot`、`time` 和签名边界。
2. 它会保留符合 `match` 中所有条件的交易。
3. 遇到以下任一情况时停止：找到 `limit` 个匹配项（仅适用于默认的 `transactions` 结构）、已扫描 `budget.maxScannedTransactions` 笔交易、到达历史记录或窗口末尾，或者达到请求时限。

提前停止的扫描仍然是 `200`。只要返回了 `paginationToken`，就使用它再次调用，即使 `data` 为空也是如此。

## 匹配条件

必须提供 `match`。设置 `programs`、`mints` 或两者。若同时设置，交易必须同时匹配两者。

### 按程序匹配

`programs` 最多可列出 20 个程序，每个程序最多出现一次。如果交易中包含其中任一程序的顶层或内部（CPI）指令，并且符合该程序的 `scope`，则交易匹配。

对于每个程序，你可以进一步缩小匹配范围：

* `instructions`：程序任意 IDL 版本中的指令名称，可采用 IDL 中的原始拼写或 snake\_case。若程序的 IDL 中不存在指定名称，将返回 `400`。
* `discriminators`：指令数据前缀，每个前缀为 1 到 8 个十六进制编码的字节，可带可选的 `0x` 前缀。对于没有 IDL 的程序，请使用此项。
* 可以设置其中一个列表或同时设置两个列表。如果同时设置，则当指令是指定名称之一，或其数据以任一鉴别符开头时，该指令即匹配。省略两者可匹配该程序的任意指令。
* 每个程序的每个列表最多接受 50 个条目。

要确认程序解码后的指令名称，请使用 Parsed Streams 的 [`describeProgram`](https://www.helius.dev/docs/zh/parsed-streams/quickstart#发现) 方法。

### 按铸币地址匹配

`mints` 最多可列出 20 个采用 `{ "mint": "...", "scope": "address" }` 形式的对象，每个铸币地址最多出现一次。如果交易的任一交易前或交易后代币余额属于这些铸币地址之一，并且符合该铸币地址的 `scope`，则交易匹配。

按铸币地址扫描钱包时，请将 `tokenAccounts` 设置为 `balanceChanged`。默认情况下，历史记录会排除仅涉及钱包代币账户而不涉及钱包本身的交易，其中包括许多传入的代币转账。

### 匹配原生 SOL

原生 SOL 没有代币余额，因此扫描功能通过 lamport 匹配它。请使用原生 SOL 铸币地址 `So11111111111111111111111111111111111111111`（封装 SOL 为 `So11111111111111111111111111111111111111112`）：

* 使用 `address` 范围时，如果被扫描地址的 lamport 发生变化，则交易匹配。
* 使用 `transaction` 范围时，如果任意账户的 lamport 发生变化，则交易匹配。

向费用支付者收取的费用不计入其中。每个账户会单独比较，因此从某个账户转出后又在同一笔交易中转回的 lamport 不计入其中。原生 SOL 匹配可以捕获程序在没有转账指令的情况下支付 SOL 的情况，例如 Pump.fun 卖出交易。它也会捕获附带的资金变动，例如 Jito 小费，以及为账户支付或从账户退还的租金。

### 匹配范围

每个程序和每个铸币地址都接受一个 `scope`：

| `scope` | 程序指令计入匹配的条件 | 铸币地址的代币余额计入匹配的条件 |
| - | - | - |
| `address`（默认） | 其账户之一是 `address`、由 `address` 拥有的代币账户、铸币地址为 `address` 的代币账户，或者 `address` 本身就是该程序。 | 其代币账户是 `address` 或由 `address` 拥有，或者其铸币地址是 `address`。 |
| `transaction` | 它出现在交易中的任意位置。 | 它出现在交易中的任意位置。 |

当被扫描地址存在于交易中，但不在你要匹配的指令或余额中时，请使用 `transaction` 范围。例如，该地址仅支付费用、执行多重签名交易，或者未出现在 Anchor 事件 CPI 中。扫描某个代币的铸币地址以查找同时持有 USDC 的交易时，需要在 USDC 条目上使用 `transaction` 范围。

代币账户所有权取自每个代币余额中记录的 `owner`。对于未记录此信息的旧交易，`address` 范围只会匹配 `address` 本身。

## 返回结构

`returnShape` 设置响应为匹配项携带的内容：

| `returnShape` | `data` | 用途 |
| - | - | - |
| `transactions`（默认） | 解析后的匹配项，最多 `limit` 个。 | 读取解码后的指令、转账和摘要。 |
| `signatures` | 每个匹配项对应一个 `{ signature, slot, transactionIndex, blockTime }` 对象。 | 收集匹配的签名，无需解析交易。 |
| `count` | 省略。`scan.matchedTransactions` 是匹配项数量。 | 统计某个范围内的匹配项。 |

`signatures` 和 `count` 会忽略 `limit` 和 `rawTransaction`。它们会返回一次请求所扫描范围内的所有匹配项，因此只会因 `windowEnd`、`budget` 或 `deadline` 而停止。要统计整个历史记录，请持续使用 `paginationToken` 调用，并累加 `scan.matchedTransactions`。

使用 `returnShape: "signatures"` 时，`data` 中的每一项如下所示：

```json theme={"system"}
{
  "signature": "5zmGhmd3JZxXzz8MnA8MM1K7PXRwA1z35n3xT6ZJGRz3sAi25p8jaZuPWFCB4nEPx7DUke9y3pwrd4V7xAFozQBy",
  "slot": 460869102,
  "transactionIndex": 203,
  "blockTime": 1792848886
}
```

由于积分取决于扫描的历史记录页数，而不是返回的内容，因此三种结构的费用相同。

## 请求示例

### Pump.fun 买入和卖出

扫描 Pump.fun 程序的历史记录，查找 `buy` 和 `sell` 指令：

```json theme={"system"}
{
  "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P",
  "match": {
    "programs": [
      {
        "programId": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P",
        "instructions": ["buy", "sell"]
      }
    ]
  },
  "limit": 100
}
```

Pump.fun 还有 `buy_exact_sol_in`、`buy_v2` 和 `sell_v2` 等变体。请列出你要匹配的所有指令名称。

### 单个代币的买入和卖出

要获取某个代币的 Pump.fun 交易，请扫描该代币的铸币地址，而不是程序。铸币地址的历史记录只包含该代币的活动，并且每条买入或卖出指令都会将铸币地址列为账户，因此可使用默认的 `address` 范围进行匹配：

```json theme={"system"}
{
  "address": "<MINT_ADDRESS>",
  "match": {
    "programs": [
      {
        "programId": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P",
        "instructions": ["buy", "sell"]
      }
    ]
  }
}
```

要仅保留还涉及 USDC 代币账户的代币交易，请添加 USDC 并使用 `transaction` 范围。如果使用默认的 `address` 范围，USDC 余额必须属于该铸币地址，因此不会有任何匹配项：

```json theme={"system"}
{
  "address": "<MINT_ADDRESS>",
  "match": {
    "mints": [
      { "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "scope": "transaction" }
    ]
  }
}
```

### 一个钱包在两个程序中的交易

列出多个程序可匹配对其中任一程序的调用。此请求仅以签名形式返回某个钱包的 Pump.fun 和 PumpSwap 交易：

```json theme={"system"}
{
  "address": "<WALLET_ADDRESS>",
  "match": {
    "programs": [
      {
        "programId": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P",
        "instructions": ["buy", "sell"]
      },
      {
        "programId": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA",
        "instructions": ["buy", "sell"]
      }
    ]
  },
  "returnShape": "signatures"
}
```

### 某个时间范围内钱包的 USDC 活动

扫描钱包历史记录，查找 2025 年期间涉及 USDC 的交易。`tokenAccounts: "balanceChanged"` 会包括仅涉及钱包 USDC 代币账户的转账：

```json theme={"system"}
{
  "address": "GV6UUmNxz2RpKxmNAPadYKb7uQpszwqQAu3qLJxVdC52",
  "match": {
    "mints": [{ "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" }]
  },
  "tokenAccounts": "balanceChanged",
  "time": { "gte": 1735689600, "lte": 1767225599 }
}
```

要仅获取匹配交易的数量，请添加 `"returnShape": "count"`。

### 钱包的 SOL 变动

扫描钱包，查找 2025 年期间除其支付费用以外导致 SOL 余额变化的交易。这包括程序在没有转账指令的情况下支付的 SOL：

```json theme={"system"}
{
  "address": "GV6UUmNxz2RpKxmNAPadYKb7uQpszwqQAu3qLJxVdC52",
  "match": {
    "mints": [{ "mint": "So11111111111111111111111111111111111111111" }]
  },
  "time": { "gte": 1735689600, "lte": 1767225599 }
}
```

## 分页和停止原因

`scan.stoppedOn` 会说明请求结束的原因：

| `stoppedOn` | 含义 | `paginationToken` |
| - | - | - |
| `windowEnd` | 已到达历史记录或请求窗口的末尾。 | 不存在。扫描已完成。 |
| `limit` | 已返回 `limit` 个匹配项。仅适用于默认的 `transactions` 结构。 | 从最后一个返回的匹配项之后继续，因此不会跳过任何匹配项。 |
| `budget` | 已扫描 `budget.maxScannedTransactions` 笔交易。 | 从下一页历史记录继续。 |
| `deadline` | 已达到请求时限。 | 从下一页历史记录继续。因截止时间而中断的页面将在下一次调用时重新获取。 |

`scan.scannedThrough` 提供最后一笔已扫描交易的 slot 和区块时间，因此你可以报告处理较长历史记录时的进度。

扫描罕见指令时，可能在找到匹配项之前就耗尽预算。此时响应中的 `data` 数组为空，但仍会返回 `paginationToken`，因此请继续扫描：

```json theme={"system"}
{
  "data": [],
  "paginationToken": "460903064:422",
  "scan": {
    "stoppedOn": "budget",
    "scannedTransactions": 2000,
    "matchedTransactions": 0,
    "scannedThrough": { "slot": 460903064, "blockTime": 1792856105 },
    "creditsCharged": 12
  }
}
```

此循环会持续扫描，直到历史记录全部处理完毕：

```javascript scan-pumpfun-trades.js theme={"system"}
const API_KEY = process.env.HELIUS_API_KEY;

if (!API_KEY) {
  console.error("Missing HELIUS_API_KEY.");
  process.exit(1);
}

const URL = `https://mainnet.helius-rpc.com/v1/parsed-events/scan?api-key=${API_KEY}`;
const PUMP_PROGRAM = "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P";

async function scan(paginationToken) {
  const response = await fetch(URL, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      address: PUMP_PROGRAM,
      match: {
        programs: [{ programId: PUMP_PROGRAM, instructions: ["buy", "sell"] }],
      },
      limit: 100,
      ...(paginationToken && { paginationToken }),
    }),
  });

  if (!response.ok) {
    throw new Error(`HTTP ${response.status}: ${await response.text()}`);
  }

  return response.json();
}

let paginationToken;

do {
  const page = await scan(paginationToken);

  for (const result of page.data) {
    console.log(result.signature, result.parsed?.slot);
  }

  console.log(
    `stopped on ${page.scan.stoppedOn}: scanned ${page.scan.scannedTransactions}, ` +
      `matched ${page.scan.matchedTransactions}, charged ${page.scan.creditsCharged} credits`
  );

  // Keep going while a token is returned, even when this page had no matches.
  paginationToken = page.paginationToken;
} while (paginationToken);
```

> [!TIP]
>
> 尽可能扫描范围最窄的地址。该地址历史记录中的每笔交易都会计入预算，因此地址中的无关交易越少，每个请求能找到的匹配项就越多。

## 积分

每次扫描的费用为 **10 积分，外加每扫描一页历史记录 1 积分**。每页最多包含 1,000 笔交易，因此使用默认 10,000 笔交易预算的扫描最多花费 20 积分。因截止时间而中断的页面不会被扫描，也不会收费。

每个响应都会在 `scan.creditsCharged` 中报告其费用。有关套餐定价，请参阅[积分](https://www.helius.dev/docs/zh/billing/credits.md)。

## 错误

| 状态 | 发生条件 |
| - | - |
| `400` | 正文无效或包含未知字段；`match` 未设置 `programs` 或 `mints`；某个程序或铸币地址被多次列出；地址或铸币地址无效；指令名称不在程序的 IDL 中；列表超过限制；`scope`、`returnShape`、`rawTransaction` 或 `tokenAccounts` 的值未知；使用 `transactions` 结构时 `limit` 不在 1 到 100 之间；或者 `budget.maxScannedTransactions` 不在 1 到 10,000 之间。 |
| `500` | 请求在服务器端失败，例如无法解码扫描范围内存储的某笔交易。不会返回部分结果。 |
| `503` | 服务已达到容量上限，或第一页历史记录未能在请求时限内完成。请重试请求。 |

请求级错误会返回包含 `error` 消息的 JSON 正文，例如 `{"error": "limit must be between 1 and 100"}`。若正文包含未知字段，例如 `includeRawTransaction`（应使用 `rawTransaction`），或者将 `mints` 设置为纯字符串而不是 `{ "mint": "..." }` 对象，则返回 `{"error": "invalid request payload"}`。

## 请求参数

**address** `string` *required*

要扫描其历史记录的地址。

**match** `object` *required*

交易必须匹配的内容。设置 `programs`、`mints` 或两者。若同时设置，交易必须同时匹配两者。

**match.programs** `array`

要匹配的程序，最多 20 个，每个程序最多出现一次。如果交易中包含其中任一程序的顶层或内部（CPI）指令，并且符合该程序的 `scope`，则交易匹配。

**match.programs\[].programId** `string` *required*

程序地址。

**match.programs\[].instructions** `array`

程序任意 IDL 版本中的指令名称，可采用 IDL 中的原始拼写或 snake\_case。最多 50 个。可与 `discriminators` 组合使用。

**match.programs\[].discriminators** `array`

指令数据前缀，每个前缀为 1 到 8 个十六进制编码的字节，可带可选的 `0x` 前缀。最多 50 个。可与 `instructions` 组合使用。

**match.programs\[].scope** `string` (default: address)

哪些程序指令计入匹配。`address` 仅计入以下指令：其某个账户是 `address`、由 `address` 拥有的代币账户、铸币地址为 `address` 的代币账户；或者当 `address` 本身就是该程序时，计入所有指令。`transaction` 会计入交易中该程序的任意指令。

* `address`
* `transaction`

**match.mints** `array`

要匹配的铸币地址，最多 20 个，每个最多出现一次。如果交易的任一交易前或交易后代币余额属于其中某个铸币地址，并且符合该铸币地址的 `scope`，则交易匹配。

**match.mints\[].mint** `string` *required*

代币铸币地址。原生 SOL 铸币地址 `So11111111111111111111111111111111111111111` 根据 lamport 变化而不是代币余额进行匹配，且不计入费用。

**match.mints\[].scope** `string` (default: address)

铸币地址的哪些代币余额计入匹配。`address` 仅计入以下余额：其代币账户是 `address` 或由它拥有，或者其铸币地址是 `address`。对于原生 SOL，仅 `address` 的 lamport 变化计入匹配。`transaction` 会计入交易中该铸币地址的任意余额。对于原生 SOL，任意账户的 lamport 变化都计入匹配。

* `address`
* `transaction`

**returnShape** `string` (default: transactions)

响应为匹配项携带的内容：`transactions`（`data` 中解析后的匹配项，最多 `limit` 个）、`signatures`（`data` 中的每个匹配项包含 `signature`、`slot`、`transactionIndex` 和 `blockTime`），或 `count`（没有 `data`；`scan.matchedTransactions` 为匹配项数量）。`signatures` 和 `count` 会忽略 `limit` 和 `rawTransaction`。

* `transactions`
* `signatures`
* `count`

**limit** `number` (default: 100)

使用 `transactions` 结构时最多返回的匹配项数量，范围为 1 到 100。

**budget** `object`

单个请求可扫描的历史记录量限制。

**budget.maxScannedTransactions** `number` (default: 10000)

此请求最多扫描的交易数量，范围为 1 到 10,000。

**beforeSignature** `string`

扫描此签名之前的交易。

**afterSignature** `string`

扫描此签名之后的交易。

**paginationToken** `string`

上一次扫描返回的游标。结构为 `slot:transactionIndex`。

**sortOrder** `string` (default: desc)

扫描历史记录和返回匹配项的顺序。

* `asc`
* `desc`

**commitment** `string` (default: confirmed)

获取历史记录时使用的确认级别。不支持 `processed`。

* `confirmed`
* `finalized`

**status** `string` (default: succeeded)

要包含的执行结果。筛选发生在匹配之前，因此被排除的交易不会计入预算。

* `succeeded`
* `failed`
* `any`

**tokenAccounts** `string` (default: none)

是否包含仅引用 `address` 所拥有的代币账户、而不引用 `address` 本身的交易：`none` 会排除这些交易；`balanceChanged` 会包含改变代币账户余额的交易；`all` 会包含所有这些交易。按铸币地址扫描钱包时，请使用 `balanceChanged`。

* `none`
* `balanceChanged`
* `all`

**minContextSlot** `number`

可评估请求的最小 slot。

**rawTransaction** `string` (default: none)

原始 Solana 交易的编码。该交易在每个成功结果中以 `rawTransaction` 返回，并采用 `getTransaction` 结构。仅适用于 `transactions` 结构。

* `none`
* `json`
* `jsonParsed`
* `base64`

**slot** `object`

slot 比较边界。每个边界均为可选。

**slot.gt** `number`

匹配大于此值的值。

**slot.gte** `number`

匹配大于或等于此值的值。

**slot.lt** `number`

匹配小于此值的值。

**slot.lte** `number`

匹配小于或等于此值的值。

**time** `object`

以 Unix 秒表示的区块时间比较边界。每个边界均为可选。

**time.gt** `number`

匹配大于此值的值。

**time.gte** `number`

匹配大于或等于此值的值。

**time.lt** `number`

匹配小于此值的值。

**time.lte** `number`

匹配小于或等于此值的值。


## OpenAPI

````yaml zh/openapi/parsed-events.yaml POST /v1/parsed-events/scan
openapi: 3.0.3
info:
  title: 解析事件
  version: 0.1.0
  description: 使用解析事件解析Solana交易和解析交易历史。
servers:
  - url: https://mainnet.helius-rpc.com
security:
  - ApiKeyQuery: []
paths:
  /v1/parsed-events/scan:
    post:
      tags:
        - 已解析事件
      summary: 扫描交易历史记录
      description: 在某个地址的历史记录中搜索以下交易：调用一组程序之一、涉及一组代币铸币地址之一，或同时满足这两个条件。返回解析后的匹配项、其签名或匹配数量。
      operationId: scanParsedTransactionHistory
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScanRequest'
            examples:
              Pump.fun buys and sells:
                value:
                  address: 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P
                  match:
                    programs:
                      - programId: 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P
                        instructions:
                          - buy
                          - sell
                  limit: 1
              Rare instruction, budget stop:
                value:
                  address: 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P
                  match:
                    programs:
                      - programId: 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P
                        instructions:
                          - set_params
                  budget:
                    maxScannedTransactions: 2000
              Count matches:
                value:
                  address: 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P
                  match:
                    programs:
                      - programId: 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P
                        instructions:
                          - set_params
                  returnShape: count
                  budget:
                    maxScannedTransactions: 2000
              Token transactions with a USDC account:
                value:
                  address: <MINT_ADDRESS>
                  match:
                    mints:
                      - mint: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                        scope: transaction
                  returnShape: signatures
      responses:
        '200':
          description: >-
            采用请求的 `returnShape` 返回匹配项及扫描摘要。部分结果仍返回 200；只要返回了
            `paginationToken`，就使用它继续扫描。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanPage'
              examples:
                Stopped on limit:
                  value:
                    data:
                      - signature: >-
                          5zmGhmd3JZxXzz8MnA8MM1K7PXRwA1z35n3xT6ZJGRz3sAi25p8jaZuPWFCB4nEPx7DUke9y3pwrd4V7xAFozQBy
                        parserStatus: OK
                        parsed:
                          slot: 460869102
                          blockTime: 1792848886
                          fee: 45000
                          feePayer: Gygj9QQby4j2jryqyqBHvLP7ctv2SaANgh4sCb69BUpA
                          transactionStatus: OK
                          error: null
                          decodedError: null
                          nativeTransfers:
                            - fromUserAccount: BwWK17cbHxwWBKZkUYvzxLcNQ1YVyaFezduWbtm2de6s
                              toUserAccount: 2meTvySZ7iVXzif1m3BAUj2RgwiDCpSMEW7yN3EAAY98
                              amount: 4207183
                          tokenTransfers:
                            - fromUserAccount: 2meTvySZ7iVXzif1m3BAUj2RgwiDCpSMEW7yN3EAAY98
                              toUserAccount: BwWK17cbHxwWBKZkUYvzxLcNQ1YVyaFezduWbtm2de6s
                              fromTokenAccount: 7Rx6mmZ3jEWv94MZ5JtEqqw8PZTmVt2aFDxL678faSER
                              toTokenAccount: 7Y7x62ZQkzCLjuxw8iG5M2QZsayYeysRhfcY8pB5kbxQ
                              rawTokenAmount: 612181177082
                              decimals: 6
                              tokenStandard: Fungible
                              mint: 3Wdb9NjzsMWFqnQZd21oQMyAc24ZgYZjqpF6NZdLpump
                          summary:
                            type: swap
                            description: >-
                              BwWK17cbHxwWBKZkUYvzxLcNQ1YVyaFezduWbtm2de6s 通过
                              Pump.fun 用 0.004207183 SOL 兑换了 612181.177082
                              3Wdb9NjzsMWFqnQZd21oQMyAc24ZgYZjqpF6NZdLpump
                            parsedData:
                              type: swap
                              protocol: pump_fun
                              kind: buy
                              in_amount: '4207183'
                              actual_out_amount: '612181177082'
                              input_mint: So11111111111111111111111111111111111111112
                              output_mint: 3Wdb9NjzsMWFqnQZd21oQMyAc24ZgYZjqpF6NZdLpump
                              inner_swaps: []
                          instructions:
                            - instructionIndex: 0
                              innerInstructionIndex: null
                              stackHeight: 1
                              programId: ComputeBudget111111111111111111111111111111
                              rawAccounts: []
                              rawData: HMypLP
                              summary: null
                              programName: compute_budget
                              instructionName: set_compute_unit_limit
                              decoded:
                                args:
                                  units: '400000'
                                accounts: []
                            - instructionIndex: 1
                              innerInstructionIndex: null
                              stackHeight: 1
                              programId: ComputeBudget111111111111111111111111111111
                              rawAccounts: []
                              rawData: 3gJqkocMWaMm
                              summary: null
                              programName: compute_budget
                              instructionName: set_compute_unit_price
                              decoded:
                                args:
                                  micro_lamports: '100000'
                                accounts: []
                            - instructionIndex: 2
                              innerInstructionIndex: null
                              stackHeight: 1
                              programId: MAyhSmzXzV1pTf7LsNkrNwkWKTo4ougAJ1PPg47MD4e
                              rawAccounts:
                                - Gygj9QQby4j2jryqyqBHvLP7ctv2SaANgh4sCb69BUpA
                                - 13ec7XdrjF3h3YcqBTFDSReRcUFwbCnJaAQspM4j6DDJ
                                - CNtxytSi1JNJgmBM444pGXK5eUEy5B2Q3haBHw2fzdoG
                                - 3Wdb9NjzsMWFqnQZd21oQMyAc24ZgYZjqpF6NZdLpump
                                - 7Y7x62ZQkzCLjuxw8iG5M2QZsayYeysRhfcY8pB5kbxQ
                                - BwWK17cbHxwWBKZkUYvzxLcNQ1YVyaFezduWbtm2de6s
                                - '11111111111111111111111111111111'
                                - TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
                                - 4wTV1YmiEkRvAtNtsSGPtUrqRYQMe5SKy2uB4Jjaxnjf
                                - 2meTvySZ7iVXzif1m3BAUj2RgwiDCpSMEW7yN3EAAY98
                                - GesfTA3X2arioaHp8bbKdjG9vJtskViWACZoYvxp4twS
                                - 7Rx6mmZ3jEWv94MZ5JtEqqw8PZTmVt2aFDxL678faSER
                                - HTGkqssCRhyE6rCBDDKQVqTM5LcFPwH8r7rmoMuvtKCD
                                - Ce6TQqeHC9p8KetsN6JsjHK7UTZk7nasjjnr7XxXp9F1
                                - 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P
                                - Hq2wp8uJ9jCPsYgNHex8RtqdvMPfVGoYwjvF1ATiwn2Y
                                - FGFrX2q1iAjyAojjeyFDxXqdmvegjPpSWsrPmrJjeQ2f
                                - 8Wf5TiAheLUqBrKXeYg2JtAFFMWtKdG2BSFgqUcPVwTt
                                - pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ
                                - 8FoNgzmjuSmiy86EPCWxvv1q7oJSu2WGA7wPymwki2LJ
                                - MAyhSmzXzV1pTf7LsNkrNwkWKTo4ougAJ1PPg47MD4e
                                - 6MneqwSEV63Ujx1KZX8ZDs5freLUyo61DoSdEeQCjNjk
                                - 5YxQFdt3Tr9zJLvkFccqXVUwhdTWJQc1fFg2YPbxvxeD
                              rawData: 23s1EunhJwrvzz8YSBTPv5WDZGm8uym8KQXhF3u
                              summary: null
                              programName: null
                              instructionName: null
                              decoded: null
                            - instructionIndex: 2
                              innerInstructionIndex: 0
                              stackHeight: 2
                              programId: 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P
                              rawAccounts:
                                - 4wTV1YmiEkRvAtNtsSGPtUrqRYQMe5SKy2uB4Jjaxnjf
                                - GesfTA3X2arioaHp8bbKdjG9vJtskViWACZoYvxp4twS
                                - 3Wdb9NjzsMWFqnQZd21oQMyAc24ZgYZjqpF6NZdLpump
                                - 2meTvySZ7iVXzif1m3BAUj2RgwiDCpSMEW7yN3EAAY98
                                - 7Rx6mmZ3jEWv94MZ5JtEqqw8PZTmVt2aFDxL678faSER
                                - 7Y7x62ZQkzCLjuxw8iG5M2QZsayYeysRhfcY8pB5kbxQ
                                - BwWK17cbHxwWBKZkUYvzxLcNQ1YVyaFezduWbtm2de6s
                                - '11111111111111111111111111111111'
                                - TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
                                - HTGkqssCRhyE6rCBDDKQVqTM5LcFPwH8r7rmoMuvtKCD
                                - Ce6TQqeHC9p8KetsN6JsjHK7UTZk7nasjjnr7XxXp9F1
                                - 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P
                                - Hq2wp8uJ9jCPsYgNHex8RtqdvMPfVGoYwjvF1ATiwn2Y
                                - FGFrX2q1iAjyAojjeyFDxXqdmvegjPpSWsrPmrJjeQ2f
                                - 8Wf5TiAheLUqBrKXeYg2JtAFFMWtKdG2BSFgqUcPVwTt
                                - pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ
                                - 6MneqwSEV63Ujx1KZX8ZDs5freLUyo61DoSdEeQCjNjk
                                - 5YxQFdt3Tr9zJLvkFccqXVUwhdTWJQc1fFg2YPbxvxeD
                              rawData: i43WeUBGKA8F2B6dwt5RBzavSKrhGu93LB
                              summary:
                                type: swap
                                description: >-
                                  BwWK17cbHxwWBKZkUYvzxLcNQ1YVyaFezduWbtm2de6s
                                  通过 Pump.fun 用 0.004207183 SOL 兑换了
                                  612181.177082
                                  3Wdb9NjzsMWFqnQZd21oQMyAc24ZgYZjqpF6NZdLpump
                                parsedData:
                                  type: swap
                                  protocol: pump_fun
                                  kind: buy
                                  in_amount: '4207183'
                                  actual_out_amount: '612181177082'
                                  input_mint: So11111111111111111111111111111111111111112
                                  output_mint: 3Wdb9NjzsMWFqnQZd21oQMyAc24ZgYZjqpF6NZdLpump
                                  inner_swaps: []
                              programName: pump
                              instructionName: buy
                              decoded:
                                args:
                                  amount: '612181177082'
                                  max_sol_cost: '4207183'
                                  track_volume:
                                    - false
                                accounts:
                                  - name: global
                                    pubkey: >-
                                      4wTV1YmiEkRvAtNtsSGPtUrqRYQMe5SKy2uB4Jjaxnjf
                                    isSigner: false
                                    isWritable: false
                                  - name: fee_recipient
                                    pubkey: >-
                                      GesfTA3X2arioaHp8bbKdjG9vJtskViWACZoYvxp4twS
                                    isSigner: false
                                    isWritable: true
                                  - name: mint
                                    pubkey: >-
                                      3Wdb9NjzsMWFqnQZd21oQMyAc24ZgYZjqpF6NZdLpump
                                    isSigner: false
                                    isWritable: false
                                  - name: bonding_curve
                                    pubkey: >-
                                      2meTvySZ7iVXzif1m3BAUj2RgwiDCpSMEW7yN3EAAY98
                                    isSigner: false
                                    isWritable: true
                                  - name: associated_bonding_curve
                                    pubkey: >-
                                      7Rx6mmZ3jEWv94MZ5JtEqqw8PZTmVt2aFDxL678faSER
                                    isSigner: false
                                    isWritable: true
                                  - name: associated_user
                                    pubkey: >-
                                      7Y7x62ZQkzCLjuxw8iG5M2QZsayYeysRhfcY8pB5kbxQ
                                    isSigner: false
                                    isWritable: true
                                  - name: user
                                    pubkey: >-
                                      BwWK17cbHxwWBKZkUYvzxLcNQ1YVyaFezduWbtm2de6s
                                    isSigner: true
                                    isWritable: true
                                  - name: system_program
                                    pubkey: '11111111111111111111111111111111'
                                    isSigner: false
                                    isWritable: false
                                  - name: token_program
                                    pubkey: >-
                                      TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
                                    isSigner: false
                                    isWritable: false
                                  - name: creator_vault
                                    pubkey: >-
                                      HTGkqssCRhyE6rCBDDKQVqTM5LcFPwH8r7rmoMuvtKCD
                                    isSigner: false
                                    isWritable: true
                                  - name: event_authority
                                    pubkey: >-
                                      Ce6TQqeHC9p8KetsN6JsjHK7UTZk7nasjjnr7XxXp9F1
                                    isSigner: false
                                    isWritable: false
                                  - name: program
                                    pubkey: >-
                                      6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P
                                    isSigner: false
                                    isWritable: false
                                  - name: global_volume_accumulator
                                    pubkey: >-
                                      Hq2wp8uJ9jCPsYgNHex8RtqdvMPfVGoYwjvF1ATiwn2Y
                                    isSigner: false
                                    isWritable: false
                                  - name: user_volume_accumulator
                                    pubkey: >-
                                      FGFrX2q1iAjyAojjeyFDxXqdmvegjPpSWsrPmrJjeQ2f
                                    isSigner: false
                                    isWritable: true
                                  - name: fee_config
                                    pubkey: >-
                                      8Wf5TiAheLUqBrKXeYg2JtAFFMWtKdG2BSFgqUcPVwTt
                                    isSigner: false
                                    isWritable: false
                                  - name: fee_program
                                    pubkey: >-
                                      pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ
                                    isSigner: false
                                    isWritable: false
                                  - name: remainingAccount1
                                    pubkey: >-
                                      6MneqwSEV63Ujx1KZX8ZDs5freLUyo61DoSdEeQCjNjk
                                    isSigner: false
                                    isWritable: false
                                  - name: remainingAccount2
                                    pubkey: >-
                                      5YxQFdt3Tr9zJLvkFccqXVUwhdTWJQc1fFg2YPbxvxeD
                                    isSigner: false
                                    isWritable: false
                            - instructionIndex: 2
                              innerInstructionIndex: 1
                              stackHeight: 3
                              programId: pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ
                              rawAccounts:
                                - 8Wf5TiAheLUqBrKXeYg2JtAFFMWtKdG2BSFgqUcPVwTt
                                - 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P
                              rawData: >-
                                KX69VKtJ7u4E7dVvicNyuayxqa9Hr4EfndWiJBCjUyq1hDLtgcYW6pEh1tPqbHSkqHTQ8uiASv1QK1
                              summary: null
                              programName: pump_fees
                              instructionName: null
                              decoded: null
                            - instructionIndex: 2
                              innerInstructionIndex: 2
                              stackHeight: 3
                              programId: TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
                              rawAccounts:
                                - 7Rx6mmZ3jEWv94MZ5JtEqqw8PZTmVt2aFDxL678faSER
                                - 3Wdb9NjzsMWFqnQZd21oQMyAc24ZgYZjqpF6NZdLpump
                                - 7Y7x62ZQkzCLjuxw8iG5M2QZsayYeysRhfcY8pB5kbxQ
                                - 2meTvySZ7iVXzif1m3BAUj2RgwiDCpSMEW7yN3EAAY98
                              rawData: jHqzogtBj1ey3
                              summary:
                                type: transfer
                                description: >-
                                  2meTvySZ7iVXzif1m3BAUj2RgwiDCpSMEW7yN3EAAY98 将
                                  612181.177082
                                  3Wdb9NjzsMWFqnQZd21oQMyAc24ZgYZjqpF6NZdLpump 从
                                  2meTvySZ7iVXzif1m3BAUj2RgwiDCpSMEW7yN3EAAY98
                                  转账至
                                  BwWK17cbHxwWBKZkUYvzxLcNQ1YVyaFezduWbtm2de6s
                                parsedData: null
                              programName: token_2022
                              instructionName: transfer_checked
                              decoded:
                                args:
                                  amount: '612181177082'
                                  decimals: 6
                                accounts:
                                  - name: source_account
                                    pubkey: >-
                                      7Rx6mmZ3jEWv94MZ5JtEqqw8PZTmVt2aFDxL678faSER
                                    isSigner: false
                                    isWritable: true
                                  - name: mint
                                    pubkey: >-
                                      3Wdb9NjzsMWFqnQZd21oQMyAc24ZgYZjqpF6NZdLpump
                                    isSigner: false
                                    isWritable: false
                                  - name: destination_account
                                    pubkey: >-
                                      7Y7x62ZQkzCLjuxw8iG5M2QZsayYeysRhfcY8pB5kbxQ
                                    isSigner: false
                                    isWritable: true
                                  - name: owner_or_delegate
                                    pubkey: >-
                                      2meTvySZ7iVXzif1m3BAUj2RgwiDCpSMEW7yN3EAAY98
                                    isSigner: true
                                    isWritable: false
                            - instructionIndex: 2
                              innerInstructionIndex: 3
                              stackHeight: 3
                              programId: '11111111111111111111111111111111'
                              rawAccounts:
                                - BwWK17cbHxwWBKZkUYvzxLcNQ1YVyaFezduWbtm2de6s
                                - 2meTvySZ7iVXzif1m3BAUj2RgwiDCpSMEW7yN3EAAY98
                              rawData: 3Bxs4E6xqUKPTjRy
                              summary:
                                type: transfer
                                description: >-
                                  BwWK17cbHxwWBKZkUYvzxLcNQ1YVyaFezduWbtm2de6s 向
                                  2meTvySZ7iVXzif1m3BAUj2RgwiDCpSMEW7yN3EAAY98
                                  转账了 0.004207183 SOL
                                parsedData: null
                              programName: system
                              instructionName: transfer
                              decoded:
                                args:
                                  lamports: '4207183'
                                accounts:
                                  - name: funding_account
                                    pubkey: >-
                                      BwWK17cbHxwWBKZkUYvzxLcNQ1YVyaFezduWbtm2de6s
                                    isSigner: true
                                    isWritable: true
                                  - name: recipient_account
                                    pubkey: >-
                                      2meTvySZ7iVXzif1m3BAUj2RgwiDCpSMEW7yN3EAAY98
                                    isSigner: false
                                    isWritable: true
                            - instructionIndex: 2
                              innerInstructionIndex: 4
                              stackHeight: 3
                              programId: 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P
                              rawAccounts:
                                - Ce6TQqeHC9p8KetsN6JsjHK7UTZk7nasjjnr7XxXp9F1
                              rawData: >-
                                8jV3ThAnvn3jwQVVxYoxU8MvQQneX8ryEqnGqWTeKGi8UcTcTFd5VQ8KLpzRZhN2g6qpShcNYKQ6aEiZojgETaWrW1Mn92Drm2irNbjBdHGCTkuK3SBZb4HSn6KPZiJehmZL1aPNtVSRmGh2ojKXZLFtokDPK31XJJJZYBMowkVME4yWDsiA81AKAyJYq3afuYidCUgWsSfzSo8tZZRtCpSaeUd3M5JeyiE9V45vsDuPYsyBxmVFWf3qKWEcQuCDYu5HctwzvAeqU6Hmr1st5Kd62GrbHxua73RLuXpHotAjm3wYD6BkKEtKDpSnq47ewySqeUgF8MrTc121NwjKhedGJfp1VWv4TULoKaNTuA9KRzYVsTNgjYuwSgiXxQF2F1ePSHexBQdTiMbL1STcahdzuLvZoRkEUQX1WE9ayykQ1uiJ1FPFNCitKm6YwpLLLVwDDi8Rf2J5aeHxtLorKV5UWn1CnRukDpSJxAC91mmc6qNcJ6XQW5VxJMdhJcSSmSr1hi4dUt1vW6gspsMxEMUzGtiyBZeo
                              summary: null
                              programName: pump
                              instructionName: TradeEvent
                              decoded:
                                args:
                                  buyback_fee: '0'
                                  buyback_fee_basis_points: '0'
                                  cashback: '0'
                                  cashback_fee_basis_points: '0'
                                  creator: 2G5ZssGjViBdr4DdwYaQ23JQeNG8TRsrnHKs9pabUoCz
                                  creator_fee: '0'
                                  creator_fee_basis_points: '0'
                                  current_sol_volume: '0'
                                  fee: '0'
                                  fee_basis_points: '0'
                                  fee_recipient: GesfTA3X2arioaHp8bbKdjG9vJtskViWACZoYvxp4twS
                                  holder_rewards: '0'
                                  holder_rewards_bps: '0'
                                  is_buy: true
                                  ix_name: buy
                                  last_update_timestamp: '0'
                                  mayhem_mode: true
                                  mint: 3Wdb9NjzsMWFqnQZd21oQMyAc24ZgYZjqpF6NZdLpump
                                  quote_amount: '4207183'
                                  quote_mint: '11111111111111111111111111111111'
                                  real_quote_reserves: '27976582'
                                  real_sol_reserves: '27976582'
                                  real_token_reserves: '793353696151809'
                                  shareholders: []
                                  sol_amount: '4207183'
                                  timestamp: '1792848886'
                                  token_amount: '612181177082'
                                  total_claimed_tokens: '0'
                                  total_unclaimed_tokens: '0'
                                  track_volume: false
                                  user: BwWK17cbHxwWBKZkUYvzxLcNQ1YVyaFezduWbtm2de6s
                                  virtual_quote_reserves: '8676477109'
                                  virtual_sol_reserves: '8676477109'
                                  virtual_token_reserves: '1073253696151809'
                                accounts: []
                            - instructionIndex: 2
                              innerInstructionIndex: 5
                              stackHeight: 2
                              programId: MAyhSmzXzV1pTf7LsNkrNwkWKTo4ougAJ1PPg47MD4e
                              rawAccounts:
                                - 8FoNgzmjuSmiy86EPCWxvv1q7oJSu2WGA7wPymwki2LJ
                              rawData: >-
                                HaAvdxyruSvtMDoMtGvePmYV4dda7tWKCLFHadQoSjYsbWWixs1eN1wCF27wUxZao1NfTPQGxhVs9GXmaVGUZ5mgBAEUUWKK4se3JtE5oKMHzxp6GRbR7wagdMtwKQEaJbXuMb9c75n3gPnTTFrxTjJrtBCejTAEQpd6mv9HUaxpt2u83Cts4WgXdvWqiHqk7xXkXQwV6M1VXmAfwZYg4CSjzAmooqqAdzbHuf243dbws8uDS4GrteXQiAYow3395wuNqLWzrcHropQTzvaDtpfAupYXEt2AZHPEuUsVhtt5n8xAieU5d4oHSjAvgBczW9cktco7Wto3kEo53QaJfbdEz4V9Jnx6ib2fdvW2EpLXUprJLcP9voTKAuuCZCTbQKSbwJWRG9UCPTssTDR3m9eE38WcqtK1v2jeRtbtK
                              summary: null
                              programName: null
                              instructionName: null
                              decoded: null
                    paginationToken: '460869102:203'
                    scan:
                      stoppedOn: limit
                      scannedTransactions: 1
                      matchedTransactions: 1
                      scannedThrough:
                        slot: 460869102
                        blockTime: 1792848886
                      creditsCharged: 11
                Stopped on budget, no matches:
                  value:
                    data: []
                    paginationToken: '460903064:422'
                    scan:
                      stoppedOn: budget
                      scannedTransactions: 2000
                      matchedTransactions: 0
                      scannedThrough:
                        slot: 460903064
                        blockTime: 1792856105
                      creditsCharged: 12
                Count shape:
                  value:
                    paginationToken: '460903064:422'
                    scan:
                      stoppedOn: budget
                      scannedTransactions: 2000
                      matchedTransactions: 0
                      scannedThrough:
                        slot: 460903064
                        blockTime: 1792856105
                      creditsCharged: 12
        '400':
          description: 请求无效。`error` 消息会指出具体问题。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                default:
                  value:
                    error: >-
                      在 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P 的 IDL 中未找到
                      match.programs 指令：not_a_real_ix
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          description: 服务已达到容量上限，或首个历史记录页面未能在请求截止时间前完成。请重试请求。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                default:
                  value:
                    error: 服务不可用
components:
  schemas:
    ScanRequest:
      type: object
      description: 扫描某个地址的历史记录以查找匹配交易的请求体。
      required:
        - address
        - match
      additionalProperties: false
      properties:
        address:
          type: string
          description: 要扫描其历史记录的地址。
        match:
          $ref: '#/components/schemas/ScanMatch'
        returnShape:
          type: string
          description: >-
            响应为匹配项携带的内容：`transactions`（`data` 中已解析的匹配项，最多 `limit`
            个）、`signatures`（`data` 中每个匹配项包含
            `signature`、`slot`、`transactionIndex` 和 `blockTime`）或 `count`（无
            `data`；`scan.matchedTransactions` 为匹配数量）。`signatures` 和 `count` 会忽略
            `limit` 与 `rawTransaction`。
          enum:
            - transactions
            - signatures
            - count
          default: transactions
        limit:
          type: integer
          description: 使用 `transactions` 结构时最多返回的匹配项数量，范围为 1 到 100。
          minimum: 1
          maximum: 100
          default: 100
        budget:
          $ref: '#/components/schemas/ScanBudget'
        beforeSignature:
          type: string
          description: 扫描此签名之前的交易。
        afterSignature:
          type: string
          description: 扫描此签名之后的交易。
        paginationToken:
          type: string
          description: 上一次扫描返回的游标。结构为 `slot:transactionIndex`。
        sortOrder:
          type: string
          description: 扫描历史记录及返回匹配项的顺序。
          enum:
            - asc
            - desc
          default: desc
        commitment:
          type: string
          description: 获取历史记录时使用的确认级别。不支持 `processed`。
          enum:
            - confirmed
            - finalized
          default: confirmed
        status:
          type: string
          description: 要包含的执行结果。筛选在匹配之前进行，因此被排除的交易不会计入预算。
          enum:
            - succeeded
            - failed
            - any
          default: succeeded
        tokenAccounts:
          allOf:
            - $ref: '#/components/schemas/TokenAccountsFilter'
          description: >-
            是否包含仅引用 `address` 所拥有的代币账户、而不引用 `address` 本身的交易：`none`
            排除这些交易，`balanceChanged` 包含会改变代币账户余额的交易，`all`
            则包含全部此类交易。按铸币地址扫描钱包时，请使用 `balanceChanged`。
        minContextSlot:
          type: integer
          description: 可评估请求的最小槽位。
        rawTransaction:
          allOf:
            - $ref: '#/components/schemas/RawTransactionEncoding'
          description: >-
            原始 Solana 交易的编码。每个成功结果都会在 `rawTransaction` 中以 `getTransaction`
            的结构返回该交易。仅适用于 `transactions` 结构。
        slot:
          allOf:
            - $ref: '#/components/schemas/ComparisonBounds'
          description: 槽位比较边界。每个边界均为可选。
        time:
          allOf:
            - $ref: '#/components/schemas/ComparisonBounds'
          description: 以 Unix 秒表示的区块时间比较边界。每个边界均为可选。
    ScanPage:
      type: object
      description: 采用请求的 `returnShape` 返回的匹配项及扫描摘要。
      properties:
        data:
          description: >-
            按 `sortOrder` 排列的匹配项。使用 `transactions` 时，每项的 `TransactionResult` 结构与
            `/v1/parsed-events/transactions` 返回的结构相同；使用 `signatures` 时，每项都是一个
            `ScanSignature`。使用 `count` 时缺失。存在 `paginationToken` 时可以为空。
          oneOf:
            - type: array
              title: 交易
              items:
                $ref: '#/components/schemas/TransactionResult'
            - type: array
              title: 签名
              items:
                $ref: '#/components/schemas/ScanSignature'
        paginationToken:
          type: string
          description: 下一次扫描继续位置的游标。扫描到达历史记录或时间窗口末尾时缺失。
        scan:
          $ref: '#/components/schemas/ScanSummary'
    ErrorResponse:
      type: object
      description: 请求级错误响应。
      properties:
        error:
          type: string
          description: 错误信息。
    ScanMatch:
      type: object
      description: 交易必须满足的匹配条件。设置 `programs`、`mints` 或同时设置两者。同时设置时，交易必须同时满足这两个条件。
      additionalProperties: false
      properties:
        programs:
          type: array
          description: >-
            要匹配的程序，最多 20 个，每个程序最多出现一次。如果交易在程序的 `scope`
            范围内包含其中任一程序的顶层或内部（CPI）指令，则视为匹配。
          maxItems: 20
          items:
            $ref: '#/components/schemas/ScanProgramMatch'
        mints:
          type: array
          description: >-
            要匹配的铸币地址，最多 20
            个，每个铸币地址最多出现一次。如果交易中某个代币的交易前或交易后余额属于这些铸币地址之一，并且位于该铸币地址的 `scope`
            范围内，则视为匹配。
          maxItems: 20
          items:
            $ref: '#/components/schemas/ScanMintMatch'
    ScanBudget:
      type: object
      description: 单个请求扫描历史记录量的限制。
      additionalProperties: false
      properties:
        maxScannedTransactions:
          type: integer
          description: 此请求最多扫描的交易数量，范围为 1 到 10,000。
          minimum: 1
          maximum: 10000
          default: 10000
    TokenAccountsFilter:
      type: string
      description: >-
        是否包含仅引用 `address` 所拥有的代币账户、而不引用 `address` 本身的交易：`none`
        排除这些交易，`balanceChanged` 包含会改变代币账户余额的交易，`all` 则包含全部此类交易。
      enum:
        - none
        - balanceChanged
        - all
      default: none
    RawTransactionEncoding:
      type: string
      description: >-
        原始 Solana 交易的编码。每个成功结果都会在 `rawTransaction` 中以 `getTransaction`
        的结构返回该交易。`none` 不返回原始交易。
      enum:
        - none
        - json
        - jsonParsed
        - base64
      default: none
    ComparisonBounds:
      type: object
      description: 数字比较界限。每个字段都是可选的。
      additionalProperties: false
      properties:
        gt:
          type: integer
          description: 匹配大于此值的值。
        gte:
          type: integer
          description: 匹配大于或等于此值的值。
        lt:
          type: integer
          description: 匹配小于此值的值。
        lte:
          type: integer
          description: 匹配小于或等于此值的值。
    TransactionResult:
      type: object
      description: 每个签名的解析器结果。
      properties:
        signature:
          type: string
          description: 此项目的交易签名。
        parserStatus:
          type: string
          description: 解析成功时为 `OK`，或项目获取或解析失败时为 `ERROR`。
          enum:
            - OK
            - ERROR
        parsed:
          allOf:
            - $ref: '#/components/schemas/ParsedTransaction'
          description: 解析的交易对象。当 `parserStatus` 为 `OK` 时存在。
        parserError:
          allOf:
            - $ref: '#/components/schemas/ParserError'
          description: 项目级错误。 `parserStatus` 为 `ERROR` 时存在。
        rawTransaction:
          type: object
          description: >-
            采用请求的 `rawTransaction` 编码、以 `getTransaction` 结构表示的原始 Solana 交易。使用
            `base64` 时，`transaction` 为 `[data, "base64"]`。仅在请求原始交易时存在。
          additionalProperties: true
    ScanSignature:
      type: object
      description: '`returnShape` 设置为 `signatures` 时返回的匹配项。'
      properties:
        signature:
          type: string
          description: 交易签名。
        slot:
          type: integer
          description: 包含该交易的槽位。
        transactionIndex:
          type: integer
          description: 交易在其槽位中的位置。
        blockTime:
          type: integer
          nullable: true
          description: 区块时间，以 Unix 秒表示（如有）。
    ScanSummary:
      type: object
      description: 扫描进度及停止原因。
      properties:
        stoppedOn:
          type: string
          description: >-
            扫描停止的原因：`windowEnd`（到达历史记录或时间窗口末尾）、`limit`（已返回 `limit`
            个匹配项）、`budget`（已扫描 `maxScannedTransactions` 笔交易）或
            `deadline`（达到请求时限）。
          enum:
            - windowEnd
            - limit
            - budget
            - deadline
        scannedTransactions:
          type: integer
          description: 此请求中扫描的交易数量。
        matchedTransactions:
          type: integer
          description: 此请求中找到的匹配项数量。`returnShape` 设置为 `count` 时，此值即为结果。
        scannedThrough:
          allOf:
            - $ref: '#/components/schemas/ScannedThrough'
          description: 最后扫描的交易。未扫描任何内容时缺失。
        creditsCharged:
          type: integer
          description: 收取的积分：每个请求 10 个积分，外加每扫描一个历史记录页面 1 个积分（每页最多 1,000 笔交易）。
    ScanProgramMatch:
      type: object
      description: >-
        匹配包含 `programId` 顶层或内部（CPI）指令的交易。设置 `instructions`、`discriminators`
        或同时设置两者以缩小匹配范围；两者均不设置则匹配该程序的任何指令。
      required:
        - programId
      additionalProperties: false
      properties:
        programId:
          type: string
          description: 程序地址。
        instructions:
          type: array
          description: >-
            程序任一 IDL 版本中的指令名称，使用 IDL 中的拼写或 snake_case。最多 50 个。可与
            `discriminators` 结合使用。
          maxItems: 50
          items:
            type: string
        discriminators:
          type: array
          description: >-
            指令数据前缀，每个前缀由 1 到 8 个十六进制编码字节组成，可选带有 `0x` 前缀。最多 50 个。可与
            `instructions` 结合使用。
          maxItems: 50
          items:
            type: string
        scope:
          allOf:
            - $ref: '#/components/schemas/MatchScope'
          description: >-
            程序的哪些指令计入匹配。`address` 仅计入以下指令：包含 `address` 账户、`address`
            所拥有的代币账户或铸币地址为 `address` 的代币账户；如果 `address`
            是程序，则计入每条指令。`transaction` 计入交易中该程序的任何指令。
    ScanMintMatch:
      type: object
      description: >-
        匹配在 `scope` 范围内具有 `mint` 交易前或交易后代币余额的交易。原生 SOL 铸币地址
        `So11111111111111111111111111111111111111111` 改为匹配 lamport
        变化，但不计向费用支付方收取的费用。
      required:
        - mint
      additionalProperties: false
      properties:
        mint:
          type: string
          description: >-
            代币铸币地址。原生 SOL 铸币地址 `So11111111111111111111111111111111111111111` 匹配
            lamport 变化而非代币余额，但不计费用。
        scope:
          allOf:
            - $ref: '#/components/schemas/MatchScope'
          description: >-
            哪些铸币地址的代币余额计入匹配。`address` 仅计入以下余额：其代币账户是 `address` 或由其拥有，或者其铸币地址是
            `address`。对于原生 SOL，仅计入 `address` 的 lamport 变化。`transaction`
            计入交易中该铸币地址的任何余额。对于原生 SOL，任何账户的 lamport 变化均计入。
    ParsedTransaction:
      type: object
      description: 解析器-v2 交易模型。
      properties:
        slot:
          type: integer
          description: 包含交易的槽。
        blockTime:
          type: integer
          description: 块的 Unix 时间戳（可用时）。
          nullable: true
        fee:
          type: integer
          description: 以 lamports 为单位的交易费。
        feePayer:
          type: string
          description: 手续费支付账户（可用时）。
          nullable: true
        transactionStatus:
          type: string
          description: 交易成功执行时为 `OK`，执行失败时为 `ERROR`。
          enum:
            - OK
            - ERROR
        nativeTransfers:
          type: array
          description: 以 lamports 为单位的交易级 SOL 转移。
          items:
            $ref: '#/components/schemas/NativeTransfer'
        tokenTransfers:
          type: array
          description: 交易级 SPL 代币和Token-2022转移。
          items:
            $ref: '#/components/schemas/TokenTransfer'
        summary:
          allOf:
            - $ref: '#/components/schemas/ParsedSummary'
          description: 最佳交易级摘要（可用时）。
          nullable: true
        instructions:
          type: array
          description: 按执行顺序解析的顶级和内部指令。
          items:
            $ref: '#/components/schemas/ParsedInstruction'
    ParserError:
      type: object
      description: 项目级解析器错误。
      properties:
        code:
          type: string
          description: 机器可读的解析器错误代码。
        message:
          type: string
          description: 人类可读的解析器错误消息。
    ScannedThrough:
      type: object
      description: 最后扫描交易的位置。
      properties:
        slot:
          type: integer
          description: 最后扫描交易所在的槽位。
        blockTime:
          type: integer
          nullable: true
          description: 最后扫描交易的区块时间，以 Unix 秒表示。
    MatchScope:
      type: string
      description: 程序指令或铸币地址的代币余额必须位于何处才计入匹配。
      enum:
        - address
        - transaction
      default: address
    NativeTransfer:
      type: object
      description: 在交易级检测到的SOL移动。
      properties:
        fromUserAccount:
          type: string
          description: 发送 lamports 的账户。
          nullable: true
        toUserAccount:
          type: string
          description: 接收 lamports 的账户。
          nullable: true
        amount:
          type: integer
          description: 以 lamports 为单位的金额。
    TokenTransfer:
      type: object
      description: 在交易级检测到的 SPL 代币或 Token-2022 移动。
      properties:
        fromUserAccount:
          type: string
          description: 已知情况下，源端的所有者或授权。
          nullable: true
        toUserAccount:
          type: string
          description: 已知情况下，目标端的所有者。
          nullable: true
        fromTokenAccount:
          type: string
          description: 源代币账户。
          nullable: true
        toTokenAccount:
          type: string
          description: 目标代币账户。
          nullable: true
        rawTokenAmount:
          type: integer
          description: 原始整数代币金额。
        decimals:
          type: integer
          description: 用于解释原始金额的铸币小数。
        tokenStandard:
          type: string
          description: 已知的代币标准，例如 `Fungible` 或 `UnknownStandard`。
        mint:
          type: string
          description: 代币铸币地址。
    ParsedSummary:
      type: object
      description: 交易或指令的人类可读摘要。
      properties:
        type:
          type: string
          description: 摘要类型，例如 `swap`，`transfer` 或 `create_account`。
        description:
          type: string
          description: 人类可读的摘要文本。
        parsedData:
          type: object
          description: 摘要背后的结构化负载（可用时）—例如具有 `protocol`，`kind`，金额和铸币的数据。形状因摘要类型和协议而异。
          nullable: true
          additionalProperties: true
    ParsedInstruction:
      type: object
      description: 解析的顶级或内部指令。
      properties:
        instructionIndex:
          type: integer
          description: 顶级指令索引。
        innerInstructionIndex:
          type: integer
          description: 在适用的情况下，顶级指令中的内部指令索引。
          nullable: true
        stackHeight:
          type: integer
          description: 可用时的堆栈高度。
          nullable: true
        programId:
          type: string
          description: 执行指令的程序ID。
        rawAccounts:
          type: array
          description: 从指令账户索引解析的原始账户公钥。
          items:
            type: string
        rawData:
          type: string
          description: 原始指令数据。
        summary:
          allOf:
            - $ref: '#/components/schemas/ParsedSummary'
          description: 指令级摘要（可用时）。
          nullable: true
        programName:
          type: string
          description: 解析器已知的程序名称（可用时）。
          nullable: true
        instructionName:
          type: string
          description: 已解码的指令名称（可用时）。
          nullable: true
        decoded:
          allOf:
            - $ref: '#/components/schemas/DecodedInstruction'
          description: 解码成功时解码的参数和账户。
          nullable: true
    DecodedInstruction:
      type: object
      description: 解码的指令参数和命名账户。
      properties:
        args:
          type: object
          description: 解码的指令参数。参数名称和形状取决于指令。
          additionalProperties: true
        accounts:
          type: array
          description: 具有解析器已知名称的解码指令账户。
          items:
            $ref: '#/components/schemas/DecodedAccount'
    DecodedAccount:
      type: object
      description: 解码指令使用的命名账户。
      properties:
        name:
          type: string
          description: 解析器已知的账户名称。
        pubkey:
          type: string
          description: 账户公钥。
        isSigner:
          type: boolean
          description: 账户是否签署了交易。
        isWritable:
          type: boolean
          description: 账户是否可用于指令。
  responses:
    InternalError:
      description: 请求在服务器上失败，例如，请求范围内存储的某笔交易无法解码。整个请求均会失败；不会返回部分结果。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            default:
              value:
                error: 服务器内部错误
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.