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

# getRecentPrioritizationFees

> 返回近期区块中的优先费列表

## 参数

<ParamField query="addresses" type="array" optional>
  账户地址数组（base-58 编码的字符串）。如果提供，响应将仅包含由这些地址之一支付的优先费。
</ParamField>

## 响应

<ResponseField name="result" type="array">
  <Expandable title="result elements">
    <ResponseField name="slot" type="number">
      观察到费用的 slot
    </ResponseField>

    <ResponseField name="prioritizationFee" type="number">
      费用金额（以 micro-lamports 为单位，即 LAMPORTS\_PER\_SOL/1000000）
    </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": "getRecentPrioritizationFees",
  "params": [
    ["CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY"]
  ]
}'
```

### 使用 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 address = 'CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY';
const fees = await connection.getRecentPrioritizationFees([address]);
console.log(fees);
```

### 使用 Python

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

client = Client("http://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY")
address = "CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY"
response = client.get_recent_prioritization_fees([address])
print(response)
```

## 注意事项

1. 返回区块中的近期优先费列表
2. 对于估算优先交易的费用非常有用
3. 费用以 micro-lamports 报告（LAMPORTS\_PER\_SOL/1000000）
4. 如果提供了 addresses 参数，结果将过滤为这些账户
5. 响应可用于计算适当的优先费

## 最佳实践

1. 在网络拥堵时使用此方法确定适当的优先费
2. 如果只关心特定账户支付的费用，按特定地址过滤
3. 根据近期费用的平均值或百分位数计算适当的费用
4. 在网络活动频繁时频繁刷新费用数据
5. 适当处理网络错误并重试
