-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
68 additions
and
76 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,32 @@ | ||
import {AuthenticatedLnd} from '../../lnd_grpc'; | ||
import {AuthenticatedLightningMethod} from '../../typescript'; | ||
import { | ||
AuthenticatedLightningArgs, | ||
AuthenticatedLightningMethod | ||
} from '../../typescript'; | ||
|
||
export type RouteFeeRequest = { | ||
export type RouteFeeRequest = AuthenticatedLightningArgs<{ | ||
lnd: AuthenticatedLnd; | ||
payment_request: string; | ||
/** BOLT 11 Encoded Payment Request */ | ||
request: string; | ||
/** Optional Timeout in Milliseconds */ | ||
timeout: number; | ||
}; | ||
}>; | ||
|
||
export type RouteFeeResponse = { | ||
routing_fee_msat: number; | ||
time_lock_delay: number; | ||
failure_reason: PaymentFailureReason; | ||
/** Millitokens (Routing Fee Msat) */ | ||
mtoken: number; | ||
/** Timeout (Time Lock Delay) */ | ||
timeout: number; | ||
}; | ||
|
||
export enum PaymentFailureReason { | ||
FAILURE_REASON_NONE = 0, | ||
FAILURE_REASON_TIMEOUT = 1, | ||
FAILURE_REASON_NO_ROUTE = 2, | ||
FAILURE_REASON_ERROR = 3, | ||
FAILURE_REASON_INCORRECT_PAYMENT_DETAILS = 4, | ||
FAILURE_REASON_INSUFFICIENT_BALANCE = 5, | ||
FAILURE_REASON_CANCELED = 6, | ||
} | ||
|
||
export const estimateRouteFee: AuthenticatedLightningMethod<RouteFeeRequest, RouteFeeResponse>; | ||
/** | ||
* Estimate routing fees based on an invoice. | ||
* | ||
* Requires `offchain:read` permission | ||
* | ||
* This method is not supported before LND 0.18.4 | ||
*/ | ||
export const estimateRouteFee: AuthenticatedLightningMethod< | ||
RouteFeeRequest, | ||
RouteFeeResponse | ||
>; |
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