-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Clients shall subscribe to new payment confirmation notifications over websockets and receive the payment confirmation information in real time.
To achieve this, expose an invoice subscription object, which is an event emitter wrapping the events for a specific invoice.
Clients may subscribe to an invoice's events by providing its uid.
Here is a proposed interface
import { subscribe } from 'anypay'
const invoice = await subscribe({ uid: '71d3debf-b828-424c-b7b2-1299107b776' })
invoice.on("payment.unconfirmed", payment => { console.log("payment received but not confirmed"})
invoice.on("payment.confirmed", payment => { console.log("payment received the required number of confirmations") })
Often you will want to know when new blocks are added on top of the original block that included your transaction. For instance one exchange process may require 3 confirmations while another requires 100 confirmations, and another just 1. It all depends on the risk level associated with the payment.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels