Create a typescript npm module that works both on browser/node that implements the following methods
[ ] generatePaymentLink(PaymentDetails):string
Similar to (lib/share/index.js generateCode + readCode)
Should include extra details from PaymentDetails
[ ] generatePaymentQR(PaymentDetails):image
Same as above but create a QR containing above url
[ ] validateTx(TxData):boolean
Reads fuse blockchain for txhash and check it has a Transfer log with the amount + sha3(invoiceid/data) paid to recipient in event log data
[ ] async onPayment(recipient,invoiceid):Promise
Listens to Transfer event with to=recipient and data=sha3(invoiceid/data)
resolves promise once event detected
Seller SDK
generatePaymentLink(PaymentDetails):string
Similar to (lib/share/index.js generateCode + readCode
) Should include extra details from PaymentDetailsgeneratePaymentQR(PaymentDetails):image
Same as above but create a QR containing above urlvalidateTx(TxData):boolean
Reads fuse blockchain for txhash and check it has a Transfer log with theamount
+sha3(invoiceid/data)
paid torecipient
in event log dataasync onPayment(recipient,invoiceid):Promise
Listens to Transfer event with to=recipient and data=sha3(invoiceid/data) resolves promise once event detectedTypes
TxData: { txHash, recipient, amount invoiceId, data? }