youchain-you-txpool

这个模块用来获取当前网络信息。

getContent

描述:返回交易池的信息。

参数值:无。

返回值:Promise - 被挂起(pending)和进入队列(queued)的交易。

youchain.you.net.getContent([callback])

示例:

youchain.you.net.getContent().then(console.log);
> {
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "pending": {
            "0x59677fD68ec54e43aD4319D915f81748B5a6Ff8B": {
                "10": {
                    "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
                    "blockNumber": null,
                    "from": "0x59677fD68ec54e43aD4319D915f81748B5a6Ff8B",
                    "gas": "0x9c40",
                    "gasPrice": "0x9184e72a000",
                    "hash": "0xc6433b51af84eb060c7ec40a89f3f4c435a6169903b46bff09a5e61f7c9b4f60",
                    "input": "0x",
                    "nonce": "0xa",
                    "to": "0x9c75211DBE849b1b9Ee8b7068E6fb64DF6Be600e",
                    "transactionIndex": "0x0",
                    "value": "0x174876e800",
                    "v": "0x1b",
                    "r": "0x5f112fd5d85ea10a06fa49dd2687374c11e51baf00cdddd44bc1692d01225d19",
                    "s": "0x96e74fc4c4ce25ff17520b17fc458095429c9e800e048e072654b353aed7bff"
                },
                "11": {
                    "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
                    "blockNumber": null,
                    "from": "0x59677fD68ec54e43aD4319D915f81748B5a6Ff8B",
                    "gas": "0x9c40",
                    "gasPrice": "0x9184e72a000",
                    "hash": "0x719d6dbae338b5e137ac180a55ce167f3ffd0780da850c11b1bc876c6b1023ae",
                    "input": "0x",
                    "nonce": "0xb",
                    "to": "0x9c75211DBE849b1b9Ee8b7068E6fb64DF6Be600e",
                    "transactionIndex": "0x0",
                    "value": "0x174876e800",
                    "v": "0x1c",
                    "r": "0x16b629db3093ea4ceaca080e23c2e8960d6f671f7709b1119d53f56b73824504",
                    "s": "0x30de2be98c628c38f54902e30cd8d1eef10c31462bad1ab2752a92c42d82333f"
                }
            }
        },
        "queued": {}
    }
}

getInspection

描述:返回交易池的信息。

返回值:Promise - 被挂起(pending)和进入队列(queued)的交易概览。

youchain.you.net.getInspection([callback])

示例

youchain.you.net.getInspection().then(console.log);
> {
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
    "pending": {
    "0x59677fD68ec54e43aD4319D915f81748B5a6Ff8B": {
        "20": "0x9c75211DBE849b1b9Ee8b7068E6fb64DF6Be600e: 100000000000 lu + 40000 gas × 10000000000000 lu",
        "21": "0x9c75211DBE849b1b9Ee8b7068E6fb64DF6Be600e: 100000000000 lu + 40000 gas × 10000000000000 lu",
        "22": "0x9c75211DBE849b1b9Ee8b7068E6fb64DF6Be600e: 100000000000 lu + 40000 gas × 10000000000000 lu",
        "23": "0x9c75211DBE849b1b9Ee8b7068E6fb64DF6Be600e: 100000000000 lu + 40000 gas × 10000000000000 lu",
        "24": "0x9c75211DBE849b1b9Ee8b7068E6fb64DF6Be600e: 100000000000 lu + 40000 gas × 10000000000000 lu",
        "25": "0x9c75211DBE849b1b9Ee8b7068E6fb64DF6Be600e: 100000000000 lu + 40000 gas × 10000000000000 lu",
        "26": "0x9c75211DBE849b1b9Ee8b7068E6fb64DF6Be600e: 100000000000 lu + 40000 gas × 10000000000000 lu",
        "27": "0x9c75211DBE849b1b9Ee8b7068E6fb64DF6Be600e: 100000000000 lu + 40000 gas × 10000000000000 lu",
        "28": "0x9c75211DBE849b1b9Ee8b7068E6fb64DF6Be600e: 100000000000 lu + 40000 gas × 10000000000000 lu",
        "29": "0x9c75211DBE849b1b9Ee8b7068E6fb64DF6Be600e: 100000000000 lu + 40000 gas × 10000000000000 lu"
        }
    },
    "queued": {}
    }
}

getStatus

描述:返回交易池的状态。

参数值:无。

返回值:Promise - 被挂起(pending)和进入队列(queued)交易状态。

youchain.you.net.getStatus([callback])

示例:

youchain.you.net.getStatus().then(console.log);
> {
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "pending": "0x0",
        "queued": "0x0"
    }   
}