Open elderapo opened 4 years ago
It would be cool if subscriptions were strongly typed. Right now they look like this:
const stream = await client.subscribeTransactions({ includeMempoolAcceptance: true }); stream.on("data", tx => { // type of tx is any tx.?????? });
Maybe we could switch API a little bit like:
const cancel = client.subscribeTransactions({ ...opts }, (tx) => { // type of tx wil be TransactionNotification }); cancel(); // to stop listening
Another great suggestion, we can do that.
It would be cool if subscriptions were strongly typed. Right now they look like this:
Maybe we could switch API a little bit like: