diff --git a/docs/public-networks/concepts/transactions/pool.md b/docs/public-networks/concepts/transactions/pool.md index c268e6c1918..7551df190e8 100644 --- a/docs/public-networks/concepts/transactions/pool.md +++ b/docs/public-networks/concepts/transactions/pool.md @@ -124,6 +124,7 @@ You can configure and monitor the transaction pool using the following methods, | Method | [`txpool_besuTransactions`](../../reference/api/index.md#txpool_besutransactions) | API method to list transactions in the transaction pool. | | Method | [`txpool_besuStatistics`](../../reference/api/index.md#txpool_besustatistics) | API method to list statistics of the transaction pool. | | Method | [`txpool_besuPendingTransactions`](../../reference/api/index.md#txpool_besupendingtransactions) | API method to list pending transactions in the transaction pool. | +| Method | [`txpool_contentFrom`](../../reference/api/index.md#txpool_contentfrom) | API method to list pending and queued transactions for a given sender address. | | Method | [`txpool_content`](../../reference/api/index.md#txpool_content) | API method to list all pending and queued transactions in the pool, grouped by sender address and nonce. | | Subscription | [`newPendingTransactions`](../../how-to/use-besu-api/rpc-pubsub.md#pending-transactions) | RPC subscription to notify of transactions added to the transaction pool. | | Subscription | [`droppedPendingTransactions`](../../how-to/use-besu-api/rpc-pubsub.md#dropped-transactions) | RPC subscription to notify of transactions dropped from the transaction pool. | diff --git a/docs/public-networks/reference/api/index.md b/docs/public-networks/reference/api/index.md index 590f0746281..23ed7e0e2dd 100644 --- a/docs/public-networks/reference/api/index.md +++ b/docs/public-networks/reference/api/index.md @@ -8110,6 +8110,100 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"txpool_content","params":[],"id" +### `txpool_contentFrom` + +Returns the pending and queued transactions for a given sender address. + +#### Parameters + +`address`: _string_ - sender address + +#### Returns + +`result`: _object_ - transaction pool content for the given address: + + - `pending`: _object_ - map of nonces to [transaction objects](objects.md#transaction-object), for pending transactions from the given address + + - `queued`: _object_ - map of nonces to [transaction objects](objects.md#transaction-object) for queued transactions from the given address + + + + + +```bash +curl -X POST --data '{"jsonrpc":"2.0","method":"txpool_contentFrom","params":["0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"],"id":1}' http://127.0.0.1:8545/ -H "Content-Type: application/json" +``` + + + + +```json +{ + "jsonrpc": "2.0", + "method": "txpool_contentFrom", + "params": ["0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"], + "id": 1 +} +``` + + + + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "pending": { + "0": { + "from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", + "gas": "0x5208", + "gasPrice": "0xab5d04c00", + "hash": "0xb7b2f4306c1c228ec94043da73b582594007091a7dfe024b1f8d6d772284e54b", + "input": "0x", + "nonce": "0x0", + "to": "0xf8be4ebda7f62d79a665294ec1263bfdb59aabf2", + "value": "0x0", + "v": "0xfe8", + "r": "0x5beb711e652c6cf0a589d3cea904eefc4f45ce4372652288701d08cc4412086d", + "s": "0x3af14a56e63aa5fb7dcb444a89708363a9d2c1eba1f777c67690288415080ded" + }, + "1": { + "from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", + "gas": "0x5208", + "gasPrice": "0xab5d04c00", + "hash": "0x1234abcd5678ef901234abcd5678ef901234abcd5678ef901234abcd5678ef90", + "input": "0x", + "nonce": "0x1", + "to": "0xf8be4ebda7f62d79a665294ec1263bfdb59aabf2", + "value": "0x0", + "v": "0xfe8", + "r": "0x1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "s": "0x2bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + } + }, + "queued": { + "3": { + "from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", + "gas": "0x5208", + "gasPrice": "0xab5d04c00", + "hash": "0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef", + "input": "0x", + "nonce": "0x3", + "to": "0xf8be4ebda7f62d79a665294ec1263bfdb59aabf2", + "value": "0x0", + "v": "0xfe8", + "r": "0x3ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "s": "0x4ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" + } + } + } +} +``` + + + + ### `txpool_status` Returns the number of pending and queued transactions in the pool.