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

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# estimateTransactionFee

> Υπολογίζει το κόστος συναλλαγής τόσο σε lamports όσο και στο καθορισμένο token.

## Αίτημα JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "estimateTransactionFee",
  "params": {
    "transaction": "base64EncodedTransaction",
    "fee_token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
  }
}
```

## Απόκριση JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "fee_in_lamports": 5000,
    "fee_in_token": 1000000,
    "payment_address": "3Z1Ef7YaxK8oUMoi6exf7wYZjZKWJJsrzJXSt1c3qrDE",
    "signer_pubkey": "3Z1Ef7YaxK8oUMoi6exf7wYZjZKWJJsrzJXSt1c3qrDE"
  }
}
```

## Παράδειγμα cURL

```bash
curl -X POST http://localhost:8080 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"estimateTransactionFee","params":{"transaction":"base64EncodedTransaction","fee_token":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}'
```

## TypeScript SDK

```typescript
const fees = await client.estimateTransactionFee({
  transaction: "base64EncodedTransaction",
  fee_token: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" // USDC
});
console.log("Fee in lamports:", fees.fee_in_lamports);
console.log("Fee in USDC:", fees.fee_in_token);
```
