Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

TonioMacaronio
Copy link
Collaborator

This fixes #188

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

@TonioMacaronio TonioMacaronio 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)

@TonioMacaronio
Copy link
Collaborator Author

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"]]}

@TonioMacaronio
Copy link
Collaborator Author

@barrasso Infura supports parity_subscribe only on the Kovan network

@TonioMacaronio TonioMacaronio 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