Closed 0x009922 closed 1 year ago
I think that Torii
from @iroha2/client
is a simple implementation of Iroha 2 HTTP & WS spec. If library users need some specific logic over these protocols, they should implement it on their own. It is not an issue since Torii
logic is quite simple.
Using some concrete HTTP and WebSocket client limits some usage possibilities.
For HTTP client uses native Fetch API in browser and
node-fetch
in node. It is quite lightweight, but it has a set of drawbacks:And this list can go on and on. It is not a nice decision to handle each possible API extension by extending the client (i.e. iroha client) itself. It would be much nicer if client provides a toolchain to build requests and to handle responses for them.
For WebSocket client currently uses the same approach - native WebSocket in browser, and
ws
in node. It has the same set of drawbacks. And it can be solved in the same way.