You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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.
The text was updated successfully, but these errors were encountered: