-
Notifications
You must be signed in to change notification settings - Fork 38
Add transactionCountOf$ (eth_getTransactionCount) #73
Conversation
c6e0a2e to
4325999
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
4325999 to
6a0188c
Compare
| calls: ['eth_getTransactionCount'], | ||
| frequency: [frequency.onEveryBlock$, frequency.onStartup$], | ||
| name: 'transactionCountOf$', | ||
| pipes: api => [switchMapPromise(() => api.eth.getTransactionCount(address).then(Number))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is then(Number)?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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>?
There was a problem hiding this comment.
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!
6a0188c to
7d42dfa
Compare
No description provided.