> ## 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.

# getSignatureStatuses

> 返回签名列表的状态

## 参数

<ParamField query="signatures" type="array" required>
  要确认的交易签名数组，以 base-58 编码的字符串表示
</ParamField>

<ParamField query="config" type="object" optional>
  <Expandable title="config fields">
    <ParamField name="searchTransactionHistory" type="boolean" optional>
      如果为 true，Solana 节点将在其账本缓存中搜索未在近期状态缓存中找到的签名
    </ParamField>
  </Expandable>
</ParamField>

## 响应

<ResponseField name="result" type="object">
  <Expandable title="result fields">
    <ResponseField name="context" type="object">
      <ResponseField name="slot" type="number">
        处理此请求的 slot
      </ResponseField>
    </ResponseField>

    <ResponseField name="value" type="array">
      <Expandable title="value elements">
        <ResponseField name="slot" type="number">
          处理交易的 slot
        </ResponseField>

        <ResponseField name="confirmations" type="number | null">
          签名确认后的区块数，如果已根确认或未找到则为 null
        </ResponseField>

        <ResponseField name="err" type="object | null">
          如果交易失败则为错误信息，成功则为 null
        </ResponseField>

        <ResponseField name="confirmationStatus" type="string | null">
          交易的集群确认状态；为 "processed"、"confirmed" 或 "finalized"
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

## 代码示例

### 基本请求

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

### 使用 web3.js

```typescript theme={null}
import { Connection } from '@solana/web3.js';

const connection = new Connection('http://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY');
const signatures = [
  '5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW',
  '5j7s6NiJS3JAkvgkoc18WVAsiSaci2pxB2A6ueCJP4tprA2TFg9wSyTLeYouxPBJEMzJinENTkpA52YStRW5Dia7'
];
const statuses = await connection.getSignatureStatuses(signatures);
console.log(statuses);
```

### 使用 Python

```python theme={null}
from solana.rpc.api import Client

client = Client("http://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY")
signatures = [
    "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
    "5j7s6NiJS3JAkvgkoc18WVAsiSaci2pxB2A6ueCJP4tprA2TFg9wSyTLeYouxPBJEMzJinENTkpA52YStRW5Dia7"
]
response = client.get_signature_statuses(signatures)
print(response)
```

## 注意事项

1. 返回交易签名列表的状态
2. 默认情况下仅搜索近期状态缓存（最近约 5 分钟的交易）
3. 将 searchTransactionHistory 设置为 true 将在账本中搜索更早的记录
4. 响应数组中的 null 值表示未找到的签名
5. confirmationStatus 表示交易在网络上的最终确认程度

## 最佳实践

1. 使用此方法检查最近提交的交易状态
2. 在单个请求中传入多个签名以减少网络开销
3. 仅在需要时将 searchTransactionHistory 设置为 true（会影响性能）
4. 适当处理响应数组中的 null 值
5. 检查 confirmationStatus 以确定交易最终确认级别
