Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Add transactionCountOf$ (eth_getTransactionCount) #73

Merged
merged 2 commits into from Dec 18, 2018

Conversation

axelchalon
Copy link
Contributor

No description provided.

Copy link
Collaborator

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

calls: ['eth_getTransactionCount'],
frequency: [frequency.onEveryBlock$, frequency.onStartup$],
name: 'transactionCountOf$',
pipes: api => [switchMapPromise(() => api.eth.getTransactionCount(address).then(Number))]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is then(Number)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the Number constructor to convert the value to a number (e.g. "5" to 5)
otherwise the value we receive is an object/string; I thought that it would make sense if transactionCountOf$ returns a number type

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice. So in this case the TS def should be createRpc$<any, number | Symbol>?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes, you're right!

@axelchalon axelchalon merged commit add7962 into master Dec 18, 2018
@amaury1093 amaury1093 deleted the ac-transactioncountof branch December 18, 2018 14:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants