rewrite of **Firetray** with js-ctypes