# Net

## Endpoint

> **Real Server :** [**https://api.lmtls.io/v1/chain/net**](https://api.lmtls.io/v1/chain/net)
>
> **Real Server :** [**https://test-api.lmtls.io/v1/chain/net**](https://test-api.lmtls.io/v1/chain/net)

### getTempKey

Returns a generated tempKey by address

#### Parameters

| Name    | Type   | Description                |
| ------- | ------ | -------------------------- |
| address | String | Address                    |
| keyType | String | See below keyType section. |

#### keyType

| Transaction Type | keyType String |
| ---------------- | -------------- |
| Export Address   | exportAddress  |
| Create Token     | create         |
| Burn             | burn           |
| Transfer         | transfer       |
| Approve          | approve        |
| Mint             | mint           |

#### Return Value

| Name    | Type   | Description |
| ------- | ------ | ----------- |
| tempKey | String | tempKey     |

#### Example

```json
{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": { 
            "tempKey": "ffd5b9f7f4650366bd704327...",
        }
    }
}
```

### getTransactionStatus

Returns a status of transaction.

#### Parameters

| Name          | Type   | Description    |
| ------------- | ------ | -------------- |
| transactionId | String | Transaction Id |

#### Return Value

| Name         | Type    | Description                           |
| ------------ | ------- | ------------------------------------- |
| status       | Integer | See below status type.                |
| revertReason | String  | Reverted reason, if transaction fail. |

#### Status type

| Status | Description                       |
| ------ | --------------------------------- |
| 1      | Success                           |
| 0      | Fail                              |
| 2      | Invalid                           |
| -1     | Pending or invalid Transaction Id |

#### Example

```json
{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "status": 0,
            "revertReason":"ERC20: transfer amount exceeds balance"
        }
    }
}
```

### getBalance

Return an address ETH / BNB balance.

#### Parameters

| Name    | Type   | Description |
| ------- | ------ | ----------- |
| address | String | Address     |

#### Return Value

| Name    | Type       | Description         |
| ------- | ---------- | ------------------- |
| balance | BigDecimal | balance of address. |

#### Example

```json
{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "balance": "100.12"
        }
    }
}
```

### getGasPrice

Returns the average gas value from the corresponding Onchain.

#### Parameters

#### Return Value

| Name     | Type       | Description |
| -------- | ---------- | ----------- |
| gasPrice | BigDecimal | gasPrice    |

#### Example

```json
{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "gasPrice": "0.000000004"
        }
    }
}
```

### transfer

Transfer ETH / BNB from from-address to to-address.

#### Parameters

| Name      | Type       | Description                                                                                                                                                                                                                    |
| --------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| sender    | String     | Sender address                                                                                                                                                                                                                 |
| toAddress | String     | To address                                                                                                                                                                                                                     |
| amount    | BigDecimal | Transfer amount.                                                                                                                                                                                                               |
| tempKey   | String     | tempKey for "transfer"                                                                                                                                                                                                         |
| hashKey   | String     | hash(tempKey \| fromAddress' secretKey)                                                                                                                                                                                        |
| signature | String     | sign( hash (sender \| toAddress \| amount \| tempKey \| hashKey) ) by formAddress's privateKey using signData API                                                                                                              |
| gasPrice  | BigDecimal | gasPrice.                                                                                                                                                                                                                      |
| nonce     | BigInteger | <p>nonce value. If it is null, it will be filled in automatically.</p><p>If acceleration is needed, use the nonce value generated when performing the transaction and use a higher gasPrice than the previous transaction.</p> |

#### Return Value

| Name          | Type       | Description    |
| ------------- | ---------- | -------------- |
| transactionId | String     | Transaction Id |
| nonce         | BigInteger | nonce value    |

{% hint style="info" %}
A transactionId is returned, but that doesn't mean it has been added to the Block yet. You should check that the status is 1 by using getTransactionStatus.
{% endhint %}

#### Example

```json
{
    "jsonrpc": "2.0",
    "id": "00456",
    "result": {
        "resultCode": "200",
        "resultMessage": "Success",
        "resultData": {
            "transactionId": "0xf7d37be47ce8b563b07aa5e81e17e9722bab2e...",
            "nonce": "32"
        }
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lmtls.io/lmtls-tech-summary/chain-api/api-references/net.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
