Skip to content

Payment Confirmation Typings #2

@stevenzeiler

Description

@stevenzeiler

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions