# mcp

The following mcp RPCs are removed comparing to Huygens as they already exist in Web3: *send\_block,  send\_offline\_block, sign\_msg, estimate\_gas, call, account\_create, account\_lock, account\_unlock, account\_list, account\_balance, account\_code, logs.*

*And the following RPCs are newly added:* epoch\_approves, epoch\_approve\_receipts, epoch\_elected\_approve\_receipts.

Here are the MCP RPC interfaces.

## account\_remove

Remove an account. The parameter `rpc_control` need to be `true` when run the mcp node program.

### request fields

* action：account\_remove
* account：account to be removed
* password：account password

```js
{
    "action": "account_remove",
    "account": "0xa9d8863d0bf68dbaaacacad4ee0e865a0cc59f28",
    "password": "s4iH1t@hBFtymA"
}
```

### return fields

* code：error code. The code 0 is success.
* msg：error message.

```js
// Success
{
    "code": 0,
    "msg": "OK"
}

// Failed
{
    "code": 3,
    "msg": "Wrong password"
}
```

## account\_import

Import an account. The parameter `rpc_control` need to be `true` when run the mcp node program.

### request fields

* action：account\_import
* json：account in JSON format to be imported

```js
{
    "action": "account_import",
    "json": "{\"account\":\"0xa9d8863d0bf68dbaaacacad4ee0e865a0cc59f28\",\"kdf_salt\":\"175DCAF994E6992AAD1369014670C086\",\"iv\":\"F6054D9B144A254D3D4EAB78C95F21B6\",\"ciphertext\":\"2A943F3A7316C33B16374D9076FEF5BA7770C2A0424A08501D3663A1467DEDD7\"}"
}
```

### return fields

* code：error code. The code 0 is success.
* msg：error message.
* account：account imported.

```js
// Success
{
    "code": 0,
    "msg": "OK",
    "account": "0xa9d8863d0bf68dbaaacacad4ee0e865a0cc59f28"
}

// Failed
{
    "code": 2,
    "msg": "Invalid json"
}
```

## account\_export

export an account.

### request fields

* action：account\_export
* account：account to be exported

```js
{
    "action": "account_export",
    "account": "0xa9d8863d0bf68dbaaacacad4ee0e865a0cc59f28"
}
```

### return fields

* code：error code. The code 0 is success.
* msg：error message.
* json：account in JSON format exported.

```js
// Success
{
    "code": 0,
    "msg": "OK",
    "json": "{\"account\":\"0xa9d8863d0bf68dbaaacacad4ee0e865a0cc59f28\",\"kdf_salt\":\"37685A5B3413EC419CE4B5B79E0BB020\",\"iv\":\"F046EA90EA24A6CF0CB74BE8C560367B\",\"ciphertext\":\"4A2E6EE4CF04162D2A4DA6116C23CD94487837731055A1BC0FCBDA7E0D7C65A4\"}"
}

// Failed
{
    "code": 2,
    "msg": "Account not found"
}
```

## account\_validate

Validate an account.

### request fields

* action：account\_validate
* account：account to be validated

```js
{
    "action": "account_validate",
    "account": "0xa9d8863d0bf68dbaaacacad4ee0e865a0cc59f28"
}
```

### return fields

* code：error code. The code 0 is success.
* msg：error message.
* valid：validation results (0：invalid format，1：valid format)

```js
// Invalid format
{
    "code": 0,
    "msg": "OK",
    "valid": 0
}
// Valid format
{
    "code": 0,
    "msg": "OK",
    "valid": 1
}
```

## account\_password\_change

Change an account password. The parameter `rpc_control` need to be `true` when run the mcp node program.

### request fields

* action：account\_password\_change.
* account：account to have password changed.
* old\_password：original password.
* new\_password：new password.

```js
{
    "action": "account_password_change",
    "account": "0xa9d8863d0bf68dbaaacacad4ee0e865a0cc59f28",
    "old_password": "JNVRNHCK2o8N",
    "new_password":"qmwevFcyebqu"
}
```

### return fields

* code：error code. The code 0 is success.
* msg：error message.

```js
// Success
{
    "code": 0,
    "msg": "OK"
}   

// Failed
{
    "code": 5,
    "msg": "Wrong old password"
}
```

## account\_block\_list

List all blocks in an account.

### request fields

* action: account\_block\_list.
* account: account to be queried for the blocks.
* limit: uplimit of the number of returned blocks. The maximum value is 100.
* index：(optional）the current block query index. It should be derived from the return field `next_index` in the previous call of `account_block_list`. The default value is empty.

```js
{
    "action": "account_block_list",
    "account": "0x1144B522F45265C2DFDBAEE8E324719E63A1694C",
    "limit": 100
}
```

### return fields

* code: error code. The code 0 is success.
* msg: error message.
* blocks: list of [blocks](#block).
* next\_index: block query index. Return null if there are no more blocks left.

```js
// Success
{
    "code": 0,
    "msg": "OK"
    "blocks": [{...}, {...}, ...],
    "next_index": "0x35EAB31538EBA6CBD8E3FC1C91BFEA425EE13A1CC66B5D650A6FF226B6698A27"
}

// Failed
{
    "code": 4,
    "msg": "Index not found"
}
```

## account\_state\_list

List all state in an account.

### request fields

* action: account\_state\_list.
* account: account to be queried for the blocks.
* limit: uplimit of the number of returned states. The maximum value is 100.
* index：(optional）the current state query index. It should be derived from the return field `next_index` in the previous call of `account_state_list`. The default value is empty.

```
{
    "action": "account_state_list",
    "account": "0x1144B522F45265C2DFDBAEE8E324719E63A1694C",
    "limit": 100
}
```

### return fields

* code: error code. The code 0 is success.
* msg: error message.
* account\_states: list of states.
* next\_index: block query index. Return null if there are no more blocks left.

```
{
    "code": 0,
    "msg": "OK",
    "account_states": {
        {
            "hash": "0x13b10f0bf58769d28def46c83df7396012a0f693d53c1bc85a39363c14224516",
            "account": "0x1144b522f45265c2dfdbaee8e324719e63a1694c",
            "balance": "1999999708314231625963636182",
            "nonce": "998",
            "storage_root": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
            "code_hash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
            "is_alive": true
        },
        {
            "hash": "0xf6de8683a35cf40fb183704dfc8bb3f00549d8b311c55206fdcf40cac898f548",
            "account": "0x1144b522f45265c2dfdbaee8e324719e63a1694c",
            "balance": "1999999708524231628405042432",
            "nonce": "997",
            "storage_root": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
            "code_hash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
            "is_alive": true
        },
    }
}
```

## accounts\_balances

Check the balance of multiple accounts.

### request fields

* action：accounts\_balances.
* accounts: account to check the balance.

```js
{
    "action": "accounts_balances",
    "accounts": [
        "0x1144B522F45265C2DFDBAEE8E324719E63A1694C",
        "0xa9d8863d0bf68dbaaacacad4ee0e865a0cc59f28"
    ]
}
```

### return fields

* code: error code. The code 0 is success.
* msg: error message.
* balances: balance of the accounts.

```js
// Success
{
    "code": 0,
    "msg": "OK",
    "balances": {
        {"0x1144B522F45265C2DFDBAEE8E324719E63A1694C": "1000000000000000000"}, //1 CCN Token
        {"0xa9d8863d0bf68dbaaacacad4ee0e865a0cc59f28": "1000000000000000000"}  //1 CCN Token
    }
}

// Failed
{
    "code": 1,
    "msg": "Invalid account"
}
```

## block

Get details of one block.

### request fields

* action: block
* hash: block hash

```js
{
    "action":"block",
    "hash": "0x46bba647fb165ed3671e4c213576202fbf2a90879c30108bbfc287a9daa0ebd3"
}
```

### return fields

* code: error code. The code 0 is success.
* msg: error message.
* block: block details. If the block doesn't exist, this field is null.
  * hash: block hash.
  * from: sender's account
  * previous: hash of the latest block of sender's account before the current block. The value is 0 for the first block of the account.
  * parents: list of the hashes of parent blocks on the DAG.
  * links: list of the hashes of the ordinary blocks that the witness block referenced.
  * last\_stable\_block: the last stable block of this block on the DAG.
  * last\_summary\_block: the `last_stable_block` of the best parent of this block on the DAG.
  * last\_summary: the summary of `last_summary_block`.
  * timestamp: timestamp when the block is generated.
  * gasLimit: *string*, uplimit of the gas for the transaction.
  * signature: signature from the sender.

```js
// Success
{
    "code": 0,
    "msg": "OK",
    "block": {
        "hash": "0x46bba647fb165ed3671e4c213576202fbf2a90879c30108bbfc287a9daa0ebd3",
        "from": "0x1144b522f45265c2dfdbaee8e324719e63a1694c",
        "previous": "0x328b0837a1bf6c3ad3a8d611d9598ada10366ae459b97e714abe9af6d60932a3",
        "parents": [
            "0x328b0837a1bf6c3ad3a8d611d9598ada10366ae459b97e714abe9af6d60932a3"
        ],
        "links": [
            "0xb0791a6eb8772634445458dcea75e457f515cc66594a4018cef17849b43e98a1"
        ],
        "last_summary": "0xdf492b4343a31bf1650b23358072efba776bad21889bb1d58abdb1a793c720ac",
        "last_summary_block": "0xa19aeb3f80f9df34a0c29ff1c0da067f37043054ab8f624dad63e0f5140e36b2",
        "last_stable_block": "0x328b0837a1bf6c3ad3a8d611d9598ada10366ae459b97e714abe9af6d60932a3",
        "timestamp": 1661265734,
        "gasLimit": "0x7a1200",
        "signature": "0xa81cf81095d7c498778b9a6636105a74290d0d925d841da6ee4000af502e3e462ceac99504ea1a756b8958b3b3fcfd10ef67065464096f4de47fdac3fc42600600"
    }
}

// Failed
{
    "code": 1,
    "msg": "Invalid hash format"
}
```

## block\_state

Get state of a block

### request fields

* action: block
* hash: block hash

```js
{
    "action":"block_state",
    "hash": "0x412254AB895FD2E6ADE6F9076CA8297516F2845C989A13AC008CD5D70157AFFB"
}
```

### return fields

* code: error code. The code 0 is success.
* msg: error message.
* block\_state: state of the block. If the block doesn't exist, this field is null.
  * content:
    * level: the level of the block
    * witnessed\_level: the witness level of the block
    * best\_parent: the best parent block hash of the block
  * is\_stable: is the block stable or not, 0：not stable，1：stable.
  * stable\_content: stable block state contents. This field exists after the block is stable, and is empty if the block is not stable.
    * status: block status，0: success，1: double spending，2: invalid，3: contract execution failed.
    * stable\_index: stable block index which indicates the order of blocks on DAG. The value starts from genesis block as 0, and keeps increasing.
    * mc\_timestamp: main chain time stamp.
    * stable\_timestamp: stable time stamp.
    * mci：main chain index
    * is\_on\_mc: is the block on main chain.
    * is\_free: does the block has children.

```js
// Success
{
    "code": 0,
    "msg": "OK",
    "block_state": {
        "content": {
            "level": 71,
            "witnessed_level": 71,
            "best_parent": "0x328b0837a1bf6c3ad3a8d611d9598ada10366ae459b97e714abe9af6d60932a3"
        },
        "is_stable": 1,
        "stable_content": {
            "status": 0,
            "stable_index": 71,
            "stable_timestamp": 1661265734,
            "mci": 71,
            "mc_timestamp": 1661265734,
            "is_on_mc": 1,
            "is_free": 0
        }
    }
}

// Failed
{
    "code": 1,
    "msg": "Invalid hash format"
}
```

## block\_states

Get states of many blocks.

### request fields

* action：blocks.
* hash: list of block hashes.

```js
{
    "action": "block_states",
    "hashes": [
        "0x412254AB895FD2E6ADE6F9076CA8297516F2845C989A13AC008CD5D70157AFFB",
        "0xB222C88AB9729B4DEF3F5E12962DB12A2FA80C9B50A4003CD67CE024428DAC61"
    ]
}
```

### result fields

* code: error code. The code 0 is success.
* msg: error message.
* blocks：list of block state contents. See block state contents in the [`block_state`](#block_state) RPC method. If any of the block hashes doesn't exist, the corresponding list element is null.

```js
// Success
{
    "code": "0",
    "msg": "OK",
    "block_states": [{...}, null, {...}, ...]
}

// Failed
{
    "code": 1,
    "msg": "Invalid hash format"
}
```

## block\_traces

Get the trace of internal transactions in a smart contract.

### request fields

* action: block\_traces.
* hash: block hash.

```js
{
    "action":"block_traces",
    "hash": "0x412254AB895FD2E6ADE6F9076CA8297516F2845C989A13AC008CD5D70157AFFB"
}
```

### return fields

* code: error code. The code 0 is success.
* msg: error message.
* block\_traces：list of block traces
  * fields in a trace:
    * type: 0:call，1:create，2:suicide。
    * action: subjective to the type of a trace
      * call: - call\_type: type of call. - from: sender's account. - to: receiver's account. - gas: *string*，gas limit. - data: input data. - amount: *string*，amount in the unit of 10-18 CCN.
      * create： - from: sender's account. - gas: *string*，gas limit. - init: the code that creates the contract. - amount: *string*，amount in the unit of 10-18 CCN.
      * suicide： - contract\_account: contract account. - refund\_account: refund account after suicide. - balance: the total amount that is refunded in suicide.
    * result: subjective to the type of a trace. If the execution of the contract failed，this field is empty.
      * call：
        * gas\_used：used gas.
        * output：output.
      * create：
        * gas\_used：used gas.
        * contract\_account: address of the contract created.
        * code：code of the contract created.
      * suicide：result field is null
    * error: error message. This field is null if the contract execution is successful.
    * subtraces：number of subtraces.
    * trace\_address：the layer of trace.

```js
// Success
{
    "code": 0,
    "msg": "OK",
    "block_traces": [{
        "type": 0,  //call
        "action": {
            "call_type": "call",
            "from": "0x1144B522F45265C2DFDBAEE8E324719E63A1694C",
            "to": "0xa9d8863d0bf68dbaaacacad4ee0e865a0cc59f28",
            "gas": "25000",
            "data": "",
            "amount": "120000000000000000000"
        },
        "result": {
            "gas_used": "21000",
            "output": "",
        },
        "subtraces":0,
        "trace_address": []
    }, ...]
}

// Failed
{
    "code": 1,
    "msg": "Invalid hash format"
}
```

## block\_summary

Retrieve the summary for a specific block.

### request fields

* hash: block hash

```
{
    "action": "block_summary",
    "hash": "0x412254AB895FD2E6ADE6F9076CA8297516F2845C989A13AC008CD5D70157AFFB"
}
```

### return fields

* code: error code. The code 0 is success.
* msg: error message
* summary: summary hash value.
* previous\_summary: previous summary hash value.
* parent\_summaries: parent summary hash array.
* link\_summaries: linked summary hash array.
* skiplist\_summaries: skipped summary hash array.
* status: block state.

```
{
    "code": 0,
    "msg": "OK",
    "summary": "0xb9589432747dc47c4312fdd0593995e8e1d4a159eb0bc739bd319c465198f89a",
    "previous_summary": "0xbdc6c9d75fd87acf546f511b8a552b2967597247de39173896a3e437fef4b9d2",
    "parent_summaries": [
        "0xbdc6c9d75fd87acf546f511b8a552b2967597247de39173896a3e437fef4b9d2"
    ],
    "link_summaries": [
        "0x0000000000000000000000000000000000000000000000000000000000000000"
    ],
    "skiplist_summaries": [],
    "status": 0
}
```

## stable\_blocks

Retrieve the stabled blocks for a specific `mci` value.

### request fields

* action: stable\_blocks.
* limit: uplimit of the number of blocks returned. Maximum value is 100.
* index: (optional) the index of the first block to retrieve. It can be set to be the value of `next_index` from the result of previous `stable_blocks` call. The default value is 0.

```js
{
    "action": "stable_blocks",
    "limit": 100,
    "index": 15577
}
```

### return fields

* code: error code. The code 0 is success.
* msg: error message.
* blocks: the list of [blocks](#block)
* next\_index：the `stable index` for next block. This value is null if there is no subsequent blocks.

```js
// Success
{
    "code": "0",
    "msg": "OK",
    "blocks": [{...}, {...}, ...],
    "next_index": 15677
}

// Failed
{
    "code": 1,
    "msg": "Invalid hash format"
}
```

## status

Retrieve the current status of DAG on the node

### request fields

* action：status.

```js
{
    "action": "status"
}
```

### return fields

* code: error code. The code 0 is success.
* msg: error message.
* syncing: if the node is syncing to the other nodes，0：not syncing，1：syncing.
* last\_stable\_mci: the `mci` of the last stable block.
* last\_mci: the `mci` of the last block on the `main chain`.
* last\_stable\_block\_index：the `stable index` of the last stable block. `stable index` starts from value 0 and keep increasing. It indicates the order of stable blocks on DAG.
* epoch: the current epoch number of mcp.
* epoch\_period: the number of blocks in main chain included in each epoch.

```js
// Success
{
    "code": 0,
    "msg": "OK",
    "syncing": 0,
    "last_stable_mci": 360,
    "last_mci": 376,
    "last_stable_block_index": 48367,
    "epoch": 0,
    "epoch_period": 100
}
```

## peers

List the peers connected to the node.

### request fields

* action：peers.

```js
{
    "action": "peers"
}
```

### return fields

* code: error code. The code 0 is success.
* msg: error message.
* peers: list of peers.

```
{
    "code": 0,
    "msg": "OK",
    "peers": [
        {
            "id": "0x25680b43fc5e86e929503db9c609d95cdf3ffa5133bea37e62d1e370c80a6b5d",
            "endpoint": "54.254.255.112:30612"
        },
        {
            "id": "0x8427022566d7a2041ca60f671741872b3ed46c00e02f674d6b3ada688931bdb3",
            "endpoint": "101.66.188.206:30610"
        },
    ]
}
```

## nodes

List the nodes connected to the node.

### request fields

* action：nodes.

```js
{
    "action": "nodes"
}
```

### return fields

* code: error code. The code 0 is success.
* msg: error message.
* nodes: list of nodes.

```
{
    "code": 0,
    "msg": "OK",
    "nodes": [
        {
            "id": "0x524745958eafd8a3a61ba2e9995f940441d81b3474aadbe0352d56fa84ca7079",
            "endpoint": "101.66.188.202:30601"
        },
        {
            "id": "0xccab1e8ae719a52fe76bad333e400a898a989f0538d3990a7d5712bd83e6f9bc",
            "endpoint": "54.254.255.112:30611"
        },
    ]
}
```

## witness\_list

Retrieve the list of witnesses.

### request fields

* action：witness\_list。

```js
{
    "action": "witness_list"
}
```

### return fields

* code: error code. The code 0 is success.
* msg: error message.
* witness\_list：list of witnesses.

```js
// Success
{
    "code": 0,
    "msg": "OK",
    "witness_list": [
        "0x1144B522F45265C2DFDBAEE8E324719E63A1694C"
    ]
}
```

## version

Acquire the current node version, rpc interface version, and database version.

### request fields

* action：version.

```js
{
    "action": "version"
}
```

### return fields

* code: error code. The code 0 is success.
* msg: error message.

```js
// Success
{
    "code": 0,
    "msg": "OK",
    "version": "0.9.7",
    "rpc_version": "1",
    "store_version": "4"
}
```

## debug\_trace\_transaction

Interface for debugging transaction. Returns the opcode of a transaction and the stack and memory information when it is executesd.

### request fields

* action: debug\_trace\_transaction.
* hash: hash of a block.
* options: （optional）options for debug tracing, including disable\_storage (default is true) and disable\_memory，disable\_stack，full\_storage (defaults are false).

```js
{
    "action": "debug_trace_transaction",
    "hash": "9E11690B3B1CB015646ECC549A746B25E08D791E32D38363A905F2A3315C2CC1",
    "options": {
    	"disable_storage": false
    }
}
```

### return fields

* code: error code. The code 0 is success.
* msg: error message.
* gas: *string*, uplimit of gas usage for the transaction.
* return\_value: return value of the transaction.
* struct\_logs: traces of the transacton.

```js
// Success
{
    "code": 0,
    "msg": "OK",
    "gas": "1000000",
    "return_value": "0x",
    "struct_logs": [
        {
            "stack": [],
            "memory": [],
            "storage": {
                "0x00": "0000000000000000000000000000000000000000000000000000000000000064"
            },
            "op": "PUSH1",
            "pc": "0",
            "gas": "978536",
            "gasCost": "3",
            "depth": "1"
        },
        {
            "stack": [
                "0000000000000000000000000000000000000000000000000000000000000080"
            ],
            "op": "PUSH1",
            "pc": "2",
            "gas": "978533",
            "gasCost": "3",
            "depth": "1"
        },
        ......
// Failed
{
    "code": 1,
    "msg": "Invalid hash"
}
```

## debug\_storage\_range\_at

Acquire the data in storage after executing a transaction in a contract.

### request fields

* action: debug\_storage\_range\_at.
* hash: block hash.
* account: contract to debug.
* begin: begin address of the storage to fetch data.
* max\_results: uplimit of the amount of data to fetch.

```js
{
    "action": "debug_storage_range_at",
    "hash": "9E11690B3B1CB015646ECC549A746B25E08D791E32D38363A905F2A3315C2CC1",
    "account": "0x1144B522F45265C2DFDBAEE8E324719E63A1694C",
    "begin": "0000000000000000000000000000000000000000000000000000000000000000",
    "max_results": 100
}
```

### return fields

* code: error code. The code 0 is success.
* msg: error message.
* next\_key：the key of the first record in the storage beyond max\_results records.
* storage：contract data in the storage.

```js
// Success
{
    "code": 0,
    "msg": "OK",
    "next_key": "0x00c26d91c2b89c096a024093917ff4e8e78485a5199fdc264f198be4a34119fc",
    "storage": {
        "0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563": {
            "key": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "value": "0x0000000000000000000000000000000000000000000000000000000000000064"
        ......
        }
    }
}
// Failed
{
    "code": 1,
    "msg": "Invalid hash"
}
```

## epoch\_approves

List the all approval messages that have been processed in the specified epoch.

### request fields

* action: epoch\_approves.
* epoch: the epoch number.

```
{
    "action": "epoch_approves",
    "epoch": "10"
}
```

### return fields

* code: error code. The code 0 is success.
* msg: error message.
* epoch\_approves：the array of epoch approval messages.

```
{
    "code": 0,
    "msg": "OK",
    "epoch_approves": [
        {
            "from": "0x1144B522F45265C2DFDBAEE8E324719E63A1694C",
            "proof": "0x02f8c313671e0ffc4f8cf4762b13fc907676ab07a44a130a9941ebed9cd29848fa36c4b10bb969ae96e61353ba7b9f65f640680622b242c52f6a4d1b4e77ba0362fa997312fb208bd8c6238e4f2d20ca46"},
        {
            "from": "0x088415bbf9b7dfe93f2231fa5dd527a04c874845",
            "proof": "0x0257443f010c88d9ca125ea4f83ce9c0ef8c0333be696d3f3aea7082aeb850f0a7a328e02d9212311f609add6a8457d49c160126c829130030a54a06680b4c728a12effaeb4d38ca598691f70e22e5196d"
        },
        {
            "from": "0xdab8a5fb82eb24ad321751bb2dd8e4cc9a4e45e5",
            "proof": "0x0309ae11225267b0ae885af76741354a632d702e1190edbffaa294efed867fe206294edd18561c71eac5f3e0d0b672668da1e258aee14b077a3f8790b21cd6a251cc988aa43b37bf2bd89108ad720470f0"
        },
        ...
    ]
}
```

## epoch\_approve\_receipts

List the approve receipts for all approval messages that have been processed in the specified epoch.

### request fields

* action: epoch\_approve\_receipts.
* epoch: the epoch number.

### return fields

* code: error code. The code 0 is success.
* msg: error message.
* epoch\_approve\_receipts：the array of epoch approve receipts.

```
{
    "code": 0,
    "msg": "OK",
    "epoch_approve_receipts": [
        {
            "from": "0x4158f69f4499f9c5b7d5744ca2020741fd9fc0bc",
            "output": "0xa94b9a900d598643b2250583b8ae0ef71d624e38ade9d7ac7dbf589b20114759"
        },
        {
            "from": "0x088415bbf9b7dfe93f2231fa5dd527a04c874845",
            "output": "0xb69bb84313784bb4951a0839c5442d5562728c34fc8a126dbe02b1123a6f8003"
        },
        {
            "from": "0xdab8a5fb82eb24ad321751bb2dd8e4cc9a4e45e5",
            "output": "0x7a5016548e2dad528d744a57765d8fcdda28b34cf348313aca58b17f70419a2e"
        },
        {
            "from": "0x820a7d4e3d816eabb6e2a5bfe6e5eac60c39c406",
            "output": "0x7e4271a414c970fa2a3f41874583edd01d81bffe5102a46299f9a71b250ab815"
        },
        ...
    ]
}
```

## epoch\_elected\_approve\_receipts

Get the election result corresponding to the epoch.

### request fields

* action: epoch\_elected\_approve\_receipts.
* epoch: the epoch number.

### return fields

* code: error code. The code 0 is success.
* msg: error message.
* epoch\_elected\_approve\_receipts：the election result.

```
{
    "code": 0,
    "msg": "OK",
    "epoch_elected_approve_receipts": [
        {
            "from": "0x49a1b41e8ccb704f5c069ef89b08cd33f764e9b3",
            "proof": "0x031051a4f3ce3d4dcaaa4a695287a8989e404606dffcb65c504f08dae3718728dcccd6f22603264dc45ba0615718f9e468bb06d26fc8a8463246372775bc036b5644407a3889aa777b658d7bd0d55db4a3",
            "output": "0xc6127cf7d5f46d376f898bdaf03fdb6bc5a32aa90ca7e4478b521b884e318a94"
        },
        {
            "from": "0x1144b522f45265c2dfdbaee8e324719e63a1694c",
            "proof": "0x03c4b7c765f139b479e96218c78786715d9050b3bd2c72fccd719328d2f3204dd75ffac4aa79db497228b19fb53a84cb3747c23827d37b74705eaec7885bbce4d6be3fdebecbb924f3c751592202da9e03",
            "output": "0xd11643d131055b1e80d29ebca43c343ed9ec5b1cee7f5d197dbb1b31357c1c0b"
        },
        {
            "from": "0x8b5c7ce9fbaed1bebb3043416684bc6913962670",
            "proof": "0x0345199fffc8d0ac629863886228b49e432e304e3667435fe1af06daf47d8a6d877f3ef2842bece07e1084b83d436d33fff35fea72064a8c29c351a7d929ac6ed701c850658015f8fdc4a6a299ba2c2354",
            "output": "0xd64546ca244a257e20e5abc7c505f38732d78f7adaa05781064c8df55de17ed4"
        },
        ...
    ]
}
```


---

# 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.oortech.com/oort/developers/mainnet-developers/rpc-interfaces/mcp.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.
