Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Add support for newPendingTransactions new subscription type #5548

@geomad

Description

@geomad

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

go-ethereum added a new type of newPendingTransactions subscription that returns the full transaction instead of the hash if an additional argument is provided. Please check ethereum/go-ethereum@5b1a04b

Right now the subscription throws as it fails validation

Error: Invalid number of parameters for "undefined". Got 1 expected 0!
    at Object.InvalidNumberOfParams (C:\web3\node_modules\web3-core-helpers\lib\errors.js:33:16)
    at Subscription._validateArgs (C:\web3\node_modules\web3-core-subscriptions\lib\subscription.js:70:22)
    at Subscription._toPayload (C:\web3\node_modules\web3-core-subscriptions\lib\subscription.js:123:14)
    at Subscription.subscribe (C:\web3\node_modules\web3-core-subscriptions\lib\subscription.js:160:24)
    at Eth.subscribe (C:\web3\web3-core-subscriptions\lib\index.js:55:39)

Expected Behavior

New subscription type is supported

Steps to Reproduce

    let sub = web3.eth.subscribe('newPendingTransactions', true, async function (error, result) {
        console.log(result)
    })

Web3.js Version

1.8.0

Environment

  • Node.js Version: v18.10.0

Anything Else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.x1.0 related issuesBugAddressing a bugDiscussion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions