Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/payments/src/node/lit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export async function sendAssetPayment(params: SendAssetPaymentParams): Promise<
terminal = {
status: result.status,
paymentHash: result.payment_hash,
paymentPreimage: result.payment_preimage,
feeSat: result.fee_sat,
failureReason: result.failure_reason,
};
Expand Down
10 changes: 9 additions & 1 deletion packages/payments/src/node/lnd.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ describe('sendLndPayment', () => {
const { host, lastMacaroonHeader } = await startServer((_req, res) =>
writeLines(res, [
{ result: { status: 'IN_FLIGHT' } },
{ result: { status: 'SUCCEEDED', payment_hash: 'abc', fee_sat: '3' } },
{
result: {
status: 'SUCCEEDED',
payment_hash: 'abc',
payment_preimage: 'def',
fee_sat: '3',
},
},
]),
);

Expand All @@ -54,6 +61,7 @@ describe('sendLndPayment', () => {
assert.deepEqual(result, {
status: 'SUCCEEDED',
paymentHash: 'abc',
paymentPreimage: 'def',
feeSat: '3',
failureReason: undefined,
});
Expand Down
1 change: 1 addition & 0 deletions packages/payments/src/node/lnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export async function sendLndPayment(params: SendLndPaymentParams): Promise<Node
terminal = {
status: result.status,
paymentHash: result.payment_hash,
paymentPreimage: result.payment_preimage,
feeSat: result.fee_sat,
failureReason: result.failure_reason,
};
Expand Down
4 changes: 4 additions & 0 deletions packages/payments/src/node/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface SendLndPaymentBody {
export interface LndPaymentUpdate {
result?: {
payment_hash?: string;
payment_preimage?: string;
value_sat?: string;
status: PaymentLifecycleStatus;
fee_sat?: string;
Expand Down Expand Up @@ -48,6 +49,7 @@ export interface AssetPaymentUpdate {
result?: {
payment_result?: {
payment_hash?: string;
payment_preimage?: string;
value_sat?: string;
status: string;
fee_sat?: string;
Expand All @@ -64,6 +66,8 @@ export interface AssetPaymentUpdate {
export interface NodePaymentResult {
status: 'SUCCEEDED' | 'FAILED';
paymentHash?: string;
/** Payment preimage (proof of payment). Present on SUCCEEDED payments. */
paymentPreimage?: string;
feeSat?: string;
failureReason?: string;
}
Loading