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

# getFeeForMessage

> Ağın belirli bir mesaj için alacağı ücreti alın

## Parametreler

<ParamField query="message" type="string" required>
  Base-64 kodlu Mesaj
</ParamField>

<ParamField query="commitment" type="string" optional>
  Ücret hesabı için kullanılacak onay seviyesi
</ParamField>

## Yanıt

<ResponseField name="result" type="object">
  <Expandable title="result fields">
    <ResponseField name="context" type="object">
      <ResponseField name="slot" type="number">
        Bu isteğin işlendiği slot
      </ResponseField>
    </ResponseField>

    <ResponseField name="value" type="number | null">
      Mesajı işlemek için alınacak lamport cinsinden ücret veya mesaj geçersizse ya da ücret hesaplanamıyorsa null
    </ResponseField>
  </Expandable>
</ResponseField>

## Kod Örnekleri

### Temel İstek

```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": "getFeeForMessage",
  "params": [
    "AQABAyRn/PA8jzJtN6oAyB3VR0nfOF0xnfkYaKwY4Ir3nrHFJGqhAQICAAEDAgABDAIAAAAEAAAAAAAA",
    {"commitment": "processed"}
  ]
}'
```

### web3.js Kullanımı

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

const connection = new Connection('http://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY');
const message = 'AQABAyRn/PA8jzJtN6oAyB3VR0nfOF0xnfkYaKwY4Ir3nrHFJGqhAQICAAEDAgABDAIAAAAEAAAAAAAA';
const fee = await connection.getFeeForMessage(message);
console.log(fee);
```

### Python Kullanımı

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

client = Client("http://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY")
message = "AQABAyRn/PA8jzJtN6oAyB3VR0nfOF0xnfkYaKwY4Ir3nrHFJGqhAQICAAEDAgABDAIAAAAEAAAAAAAA"
response = client.get_fee_for_message(message)
print(response)
```

## Notlar

1. Ağın belirli bir mesaj için alacağı ücreti döndürür
2. İşlem ücretlerini daha doğru hesaplamak için kullanışlıdır
3. Eski ücret hesaplama metodlarına tercih edilir
4. Farklı onay seviyeleri belirtilebilir
5. Mesaj geçersizse veya işlenemiyorsa null döndürür

## En İyi Uygulamalar

1. İşlem göndermeden önce doğru ücret tahmini için bu metodu kullanın
2. Null yanıtlarından kaçınmak için geçerli bir base64 kodlu mesaj sağlayın
3. Uygulamanızda null yanıtları uygun şekilde yönetin
4. Ağ hatalarını yönetin ve gerektiğinde yeniden deneyin
5. Kesin ücret hesabı gerektiğinde bu metodu kullanın
