# Contract

## Contract transaction

```
https://api-console.botc.pro/api/transaction/botc20?contract=
```

{% tabs %}
{% tab title="Require" %}
Query Parameters

| Parameter    | Description      |
| ------------ | ---------------- |
| contract     | Contract address |
| {% endtab %} |                  |

{% tab title="Parameters/results" %}

```json
{
   "total": 87, // Contains a total of 87 transaction records
   "data": [ // Transaction record list
     {
       "id": 217, // Transaction ID
       "hash": "41728e388ba177f070bd32ac292a157a26b676f96ecc97c01e03e586f68f98b2", // Transaction hash value
       "contractRet": "SUCCESS", //Contract execution result, indicating success
       "confirmed": 1, // Transaction has been confirmed
       "block": 619862, //The height of the block where the transaction is located
       "timestamp": 1706947161000, // Transaction timestamp
       "ownerAddress": "TMVwzwwfkDuJWCaTLSSZu2Gz375t8VsULA", // The address of the transaction initiator
       "toAddress": "TF845sudduRYCuna4EkQwmdwNLsHZztUWk", // The address of the transaction recipient
       "contractType": 31, // Contract type
       "contractData": "{\"type\":\"TriggerSmartContract\"}", // Contract data, indicating the triggering of the smart contract
       "data": "", // Data attached to the transaction, empty here
       "fee": 27971, // Transaction fee
       "contract": "TWmckoPHCMTgHtKyUAH3sUWHZYWRUERhQN", // Contract address
       "function": "transfer", //The contract function called, here is the transfer
       "parameters": "a:3:{s:5:\"types\";a:2:{i:0;s:7:\"address\";i:1;s:7:\"uint256 \";}s:5:\"names\";a:2:{i:0;s:2:\"to\";i:1;s:5:\"value\";}s: 4:\"data\";a:2:{i:0;s:42:\"413884eddaab0af0d1bfabeca8c607aeb1eeae5383\";i:1;s:30:\"1000000000000000000000000000000\";}}", // Function parameters, Includes type, name, and concrete value
       "value": "100000000000000000000000000000", // transfer amount
       "name": "Mira", // Token name
       "symbol": "MAL", // token symbol
       "decimals": 18 // The number of decimal places for the token
     }
     //The "data" array may contain more transaction records.
   ]
}
```

{% endtab %}
{% endtabs %}

## Contract position

```
https://api-console.botc.pro/api/token/hoard?contract=
```

{% tabs %}
{% tab title="Require" %}
Query Parameters

| Parameter    | Description      |
| ------------ | ---------------- |
| contract     | Contract address |
| {% endtab %} |                  |

{% tab title="Parameters/results" %}

```json
{
   "total": 0, // Total number of records
   "data": { // Data body part
     "token": { // Token information
       "name": "Mira", // Token name
       "symbol": "MAL", // token symbol
       "decimals": 18, // Token precision
       "totalSupply": "7927500000000.000000000000000000" // Total supply of tokens
     },
     "data": [ // List of token holders
       {
         "address": "TMVwzwwfkDuJWCaTLSSZu2Gz375t8VsULA", // holder address
         "balance": "7827500000000.000000000000000000", // Amount of tokens held
         "percent": 0.9873856827499211 // The percentage of the total supply of tokens held by this address
       },
       // ...Other holder information (some data omitted)
     ]
   }
}
```

{% endtab %}
{% endtabs %}

## Token icon

```
https://raw.githubusercontent.com/Botccoin/bitBot/main/name.png
```

Query Parameters

| Parameter | Description        |
| --------- | ------------------ |
| Name      | Full name of token |
| Format    | .png               |

## Token handling fee

```
https://api.botc.pro/api/transaction/
```

{% tabs %}
{% tab title="Require" %}
Query Parameters

| Parameter    | Description    |
| ------------ | -------------- |
| **Hash**     | New block Hash |
| Get value    | fee            |
| {% endtab %} |                |

{% tab title="Parameters/results" %}

```json
{
   "hash": "0ac2ee07a6d55b8030de0088ce70d6ef1d4e9b5e2bafd65aee5406a5fc96f3dd", // The unique identifier of the transaction, usually a hash value
   "block": 590154, //The block number where the transaction is located
   "timestamp": 1706856219000, // The timestamp of the transaction, usually in milliseconds
   "confirmed": true, // Indicates whether the transaction has been confirmed by the blockchain network
   "ownerAddress": "TNymUv6XcEkzvzrAhQpPyMZi7pVrGsLpPJ", // The address of the transaction initiator
   "toAddress": "TF845sudduRYCuna4EkQwmdwNLsHZztUWk", // The address of the transaction recipient
   "contractData": { //The contract data part describes the contract information related to the transaction
     "to": "TF845sudduRYCuna4EkQwmdwNLsHZztUWk", // The recipient address in the contract data
     "from": "TNymUv6XcEkzvzrAhQpPyMZi7pVrGsLpPJ", // The sender address in the contract data
     "amount": 10000000000 // The amount of the transaction, the unit may be the smallest unit of the cryptocurrency
   },
   "contractType": 1, //Contract type, 1 here may represent a specific transaction type or contract function
   "data": "", // Data attached to the transaction, empty here, indicating no additional data
   "fee": 1000010 // Transaction fee, indicating the fee required to initiate this transaction
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}

```
Calculation formula; handling fee = Energy/fee
```

{% endhint %}


---

# 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://botccoin.gitbook.io/botccoin-developer-book/contract.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.
