Skip to content

Commit

Permalink
Payment: move away from deprecated LND value
Browse files Browse the repository at this point in the history
  • Loading branch information
kaloudis committed Aug 1, 2024
1 parent 0108944 commit 6cce764
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions models/Payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import { lnrpc } from '../proto/lightning';
export default class Payment extends BaseModel {
private payment_hash: string | { data: number[]; type: string }; // object if lndhub
creation_date?: string;
value?: string | number;
value?: string | number; // lnd deprecated
value_sat?: string | number;
fee_sat?: string;
fee_msat?: string;
payment_preimage: string;
Expand Down Expand Up @@ -176,7 +177,10 @@ export default class Payment extends BaseModel {
@computed public get getAmount(): number | string {
return this.amount_msat
? Number(this.amount_msat.toString().replace('msat', '')) / 1000
: this.value || Number(this.msatoshi_sent) / 1000 || 0;
: this.value_sat ||
Number(this.msatoshi_sent) / 1000 ||
this.value ||
0;
}

@computed public get getFee(): string {
Expand Down

0 comments on commit 6cce764

Please sign in to comment.