Function toInvoice

Convert backend API result to library result object to return in Client.createInvoice method, toInvoices function and ClientEmitter paid event emit