Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websockets improvements and fixes #189

Merged
merged 1 commit into from
May 7, 2019
Merged

Websockets improvements and fixes #189

merged 1 commit into from
May 7, 2019

Conversation

BaldyAsh
Copy link
Collaborator

@BaldyAsh BaldyAsh commented May 7, 2019

This fixes #188

  • More convenience methods
  • Fixed some errors
  • No need to write delay between connection and subscribing

@BaldyAsh BaldyAsh merged commit e17d6b1 into develop May 7, 2019
@barrasso
Copy link
Contributor

barrasso commented May 7, 2019

Hey @BaldyAsh, I got the pending transactions socket working, and it lists ALL pending transactions.

Is there a specific method that will get pending transactions for ONE specific address?

I've already tried both of these:

try! socketProvider!.setFilterAndGetChanges(method: .newFilter, address: EthereumAddress(address)!, fromBlock: .earliest, toBlock: .latest, topics: nil)
try! socketProvider!.subscribeOnLogs(addresses: [EthereumAddress(address)!], topics: nil)

@BaldyAsh
Copy link
Collaborator Author

BaldyAsh commented May 8, 2019

Hi @barrasso . Seems it isn't possible with Infura. Its eth_newPendingTransactionFilter and newPendingTransactions subscription do not use additional parameters. Some contracts have logs that indicate that the contract had received some tx and you can use them to get txs notifications

@barrasso
Copy link
Contributor

barrasso commented May 9, 2019

OK @BaldyAsh. Is there a way to get a balance update for a given address?

I see there is a way to get this with parity_subscribe like so:

// subscribe to eth_getBalance
>{"jsonrpc":"2.0", "id":1, "method":"parity_subscribe", "params":["eth_getBalance",["0x004702bdcC3C7dbFfd943136107E70B827028600", "latest"]]}

@BaldyAsh
Copy link
Collaborator Author

@barrasso Infura supports parity_subscribe only on the Kovan network

@BaldyAsh BaldyAsh deleted the websocketsFix branch February 23, 2020 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SocketProvider does not receive messages
2 participants