Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payment Confirmation Typings #2

Open
owenkellogg opened this issue Jan 13, 2023 · 0 comments
Open

Payment Confirmation Typings #2

owenkellogg opened this issue Jan 13, 2023 · 0 comments

Comments

@owenkellogg
Copy link
Contributor

The SDK should export typings that can be included in subsequent typescript applications, for greatest experience integrating into other systems.

Currently no typings are exported and for this specific issue it should expose interfaces around a Payment and PaymentConfirmation

Proposed interfaces:

interface PaymentConfirmation {
    invoice_uid: string;
    txid: string;
    block_hash: string;
    block_height: number;
    current_hash: string;
    current_height: number;
    confirmations: number;
    timestamp: Date;
}

block_hash and block_height describe the block in which the transaction was originally included. current_hash and current_height describe the current state of the block chain. By subtracting the current_height from the block_height and adding one you get the total number of confirmations.

interface UnconfirmedPayment {
  invoice_uid: string;
  txid: string;
  timestamp: Date;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant