# Decode Raw Transaction Hex EVM

Through this endpoint customers can decode a raw transaction hex and see the decoded transactions' details.

- **Endpoint:** `POST https://rest.cryptoapis.io/utils/evm/{blockchain}/{network}/decode-raw-transaction`
- **Authentication:** `x-api-key` header
- **Credits cost:** 10 credits for 1 result by default; per blockchain: Ethereum: 10, Ethereum Classic: 13, Binance Smart Chain: 25, Polygon: 20, Arbitrum: 16, Avalanche: 18, Base: 12, Optimism: 14, Tron: 15
- **Documentation page:** https://developers.cryptoapis.io/v-2.2024-12-12-175/RESTapis/tools-evm/decode-raw-transaction-hex-evm/post

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `blockchain` | string | yes | Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc. Allowed values: `ethereum`, `ethereum-classic`, `binance-smart-chain`. |
| `network` | string | yes | Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet" is the live network with actual data while network like "testnet" is a test network. |

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `context` | string | no | In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. |

## Request body (application/json)

```json
{
  "context": "yourExampleString",
  "data": {
    "item": {
      "rawTransactionHex": "0100000001f3f6a909f8521adb57d898d2985834e632374e770fd9e2b98656f1bf1fdfd427010000006b48304502203a776322ebf8eb8b58cc6ced4f2574f4c73aa664edce0b0022690f2f6f47c521022100b82353305988cb0ebd443089a173ceec93fe4dbfe98d74419ecc84a6a698e31d012103c5c1bc61f60ce3d6223a63cedbece03b12ef9f0068f2f3c4a7e7f06c523c3664ffffffff0260e31600000000001976a914977ae6e32349b99b72196cb62b5ef37329ed81b488ac063d1000000000001976a914f76bc4190f3d8e2315e5c11c59cfc8be9df747e388ac00000000"
    }
  }
}
```

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `context` | string | no | In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. |
| `data` | object | yes |  |
| `data.item` | object | yes |  |
| `data.item.rawTransactionHex` | string | yes | Represents the raw transaction Hex that has to be decoded. |

## Responses

| Status | Description |
| --- | --- |
| 200 | Decoded transaction data attributes |
| 400 | 400 |
| 401 | 401 |
| 402 | 402 |
| 403 | 403 |
| 409 | The data provided seems to be invalid. |
| 415 | The selected Media Type is unavailable. The Content-Type header should be 'application/json'. |
| 422 | Your request body for POST requests must have a structure of { data: { item: [...properties] } } |
| 429 | The request limit has been reached. There can be maximum {requests} requests per {seconds} second(s) made. Please contact our team via email if you need more or upgrade your plan. |
| 500 | An unexpected server error has occurred, we are working to fix this. Please try again later and in case it occurs again please report it to our team via email. |

### Example 200 response

```json
{
  "apiVersion": "2024-12-12",
  "requestId": "601c1710034ed6d407996b30",
  "context": "yourExampleString",
  "data": {
    "item": {
      "id": "00a8a090a7c78f64e4626e6720b305edd95fcd7865b5b45864a88070a8079cea",
      "gasLimit": 552020,
      "gasPaidForData": 0,
      "inputData": "0x67a5cd0600000000000000000000000031f42841c2db5173425b5223809cf3a38fede360",
      "nonce": 1,
      "r": "0xc297031972fe2d4926e01e66768d669882ace256f8a8397f757af341f5e7c499",
      "recipient": "0xd30b438df65f4f788563b2b3611bd6059bff4ad9",
      "s": "0x7b717faa31c5edf9332e1cd5fa3f736838a9262834ece621bb3c30671b66ab05",
      "sender": "0x7b717faa31c5edf9332e1cd5fa3f736838a9262834ece621bb3c30671b66ab05",
      "type": 0,
      "v": "0x26",
      "fee": {
        "approximateAmount": "0.00016932",
        "approximateMinimumRequiredAmount": "0.000021",
        "unit": "BNB",
        "aproximateAmount": "0.00003"
      },
      "gasPrice": {
        "amount": "2994782927",
        "unit": "WEI"
      },
      "value": {
        "amount": "2.312",
        "unit": "BNB"
      },
      "blockchainSpecific": {
        "fee": {
          "maxFeePerGas": "0.000000149248157973",
          "maxPrioriryFeePerGas": "0.000000002",
          "unit": "ETH"
        }
      }
    }
  }
}
```

### 200 response fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `apiVersion` | string | yes | Specifies the version of the API that incorporates this endpoint. |
| `requestId` | string | yes | Defines the ID of the request. The `requestId` is generated by Crypto APIs and it's unique for every request. |
| `context` | string | no | In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. |
| `data` | object | yes |  |
| `data.item` | object | yes |  |
| `data.item.id` | string | yes | Represents the decoded transaction hex. |
| `data.item.gasLimit` | integer | yes | Represents the amount of gas used by this specific transaction alone. |
| `data.item.gasPaidForData` | integer | yes | Represents the amount of gas paid for the data in the transaction. |
| `data.item.inputData` | string | yes | Represents additional information that is required for the transaction. |
| `data.item.nonce` | integer | yes | Represents the sequential running number for an address, starting from 0 for the first transaction. |
| `data.item.r` | string | yes | Represents output of an ECDSA signature. |
| `data.item.recipient` | string | yes | The address which receives this transaction |
| `data.item.s` | string | yes | Represents output of an ECDSA signature. |
| `data.item.sender` | string | yes | Represents the address which sends this transaction |
| `data.item.type` | integer | yes | Specifies the transaction type as one from three options: if response returns a "0" it means the raw transaction includes legacy transaction data, if it is "1" - includes access lists for EIP2930, and if it is "2" - EIP1559 data. |
| `data.item.v` | string | yes | Defines the the recovery id. |
| `data.item.fee` | object | yes |  |
| `data.item.fee.approximateAmount` | string | yes | This attribute represents the max fee value. |
| `data.item.fee.approximateMinimumRequiredAmount` | string | yes | Defines the approximate minimum fee that is required for the transaction. |
| `data.item.fee.unit` | string | yes | String representation of the fee unit |
| `data.item.fee.aproximateAmount` | string | yes | Represents the approximate fee amount that will be used for this transaction |
| `data.item.gasPrice` | object | yes |  |
| `data.item.gasPrice.amount` | string | yes | Represents the price offered to the miner to purchase this amount of gas. |
| `data.item.gasPrice.unit` | string | yes | String representation of the gas price unit |
| `data.item.value` | object | yes |  |
| `data.item.value.amount` | string | yes | Represents the transaction amount. |
| `data.item.value.unit` | string | yes | String representation of the amount unit |
| `data.item.blockchainSpecific` | object | no |  |
| `data.item.blockchainSpecific.fee` | object | no |  |
| `data.item.blockchainSpecific.fee.maxFeePerGas` | string | no | Defines the maximum amount that customer is willing to pay per unit of gas to get his transaction included in a block. |
| `data.item.blockchainSpecific.fee.maxPrioriryFeePerGas` | string | no | Represents determined by the user value that is paid directly to miners. |
| `data.item.blockchainSpecific.fee.unit` | string | yes | String representation of the fee unit |
