-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more options for invoice creation
- Loading branch information
Showing
9 changed files
with
112 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { Invoice } from '../interfaces' | ||
import { ICreateInvoice, Invoice } from '../interfaces' | ||
|
||
export default interface IBackend { | ||
createInvoice: (amount: number, memo: string) => Promise<Invoice> | ||
createInvoice: (invoice: ICreateInvoice) => Promise<Invoice> | ||
getInvoice: (hash: string) => Promise<Invoice> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export { Una } from './una.js' | ||
export { IEclairRest, ILndRest, Invoice } from './interfaces' | ||
export { IEclairRest, ILndRest, Invoice, ICreateInvoice } from './interfaces' | ||
export { EBackendType } from './enums' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
export default interface ICreateInvoice { | ||
/** | ||
* Amount in msats. You must specify either amount or amountMsats, but not both. | ||
*/ | ||
amount: number | ||
|
||
/** | ||
* Amount in sats. You must specify either amount or amountMsats, but not both. | ||
*/ | ||
amountMsats: number | ||
|
||
/** | ||
* Description. You must specify either description or descriptionHash, but not both. | ||
*/ | ||
description: string | ||
|
||
/** | ||
* Description hash in 32 bytes hex string. You must specify either description or descriptionHash, but not both. | ||
*/ | ||
descriptionHash: string | ||
|
||
/** | ||
* Number of seconds that the invoice will be valid | ||
*/ | ||
expireIn?: number | ||
|
||
/** | ||
*An on-chain fallback address to receive the payment | ||
*/ | ||
fallbackAddress?: string | ||
|
||
/** | ||
* A user defined input for the generation of the paymentHash | ||
*/ | ||
paymentPreimage?: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import ICreateInvoice from './i-create-invoice.js' | ||
import IEclairRest from './i-eclair-rest.js' | ||
import Invoice from './i-invoice.js' | ||
import ILndRest from './i-lnd-rest.js' | ||
|
||
export { IEclairRest, Invoice, ILndRest } | ||
export { IEclairRest, Invoice, ILndRest, ICreateInvoice } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters