commit 4b88a02437b1bfca2274fcbbe0ce76800bdb00fa
parent 8b65148a64df3a0f26676e1e0719fbf112db7d58
Author: William Casarin <jb55@jb55.com>
Date: Thu, 28 Jul 2022 12:04:29 -0700
msatoshi purge
These are all deprecated anyways
Changelog-Changed: Move away from deprecated msatoshi fields
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
2 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/lightninglink/RPC.swift b/lightninglink/RPC.swift
@@ -43,8 +43,8 @@ public struct Channel: Decodable {
//public var peer_id: String
//public var connected: Bool
//public var state: String
- public var channel_sat: Int64
- public var channel_total_sat: Int64
+ public var our_amount_msat: Int64
+ public var amount_msat: Int64
}
public struct InvoiceRes: Decodable {
@@ -111,7 +111,6 @@ public struct InvoiceDecode: Decodable {
public var expiry: Int64?
public var relative_expiry: Int64?
public var payee: String?
- public var msatoshi: Int64?
public var quantity_min: Int?
public var description: String?
public var node_id: String?
@@ -145,10 +144,8 @@ public struct Pay: Decodable {
public var payment_hash: String
public var created_at: Float
public var parts: Int
- public var msatoshi: Int64
- public var amount_msat: String
- public var msatoshi_sent: Int64
- public var amount_sent_msat: String
+ public var amount_msat: Int64
+ public var amount_sent_msat: Int64
public var payment_preimage: String
public var status: String
}
@@ -159,11 +156,11 @@ public struct GetInfo: Decodable {
public var color: String
public var network: String
public var num_peers: Int
- public var msatoshi_fees_collected: Int
+ public var fees_collected_msat: Int
public var num_active_channels: Int
public var blockheight: Int
- public static var empty = GetInfo(alias: "", id: "", color: "", network: "", num_peers: 0, msatoshi_fees_collected: 0, num_active_channels: 0, blockheight: 0)
+ public static var empty = GetInfo(alias: "", id: "", color: "", network: "", num_peers: 0, fees_collected_msat: 0, num_active_channels: 0, blockheight: 0)
}
public enum RequestErrorType: Error {
diff --git a/lightninglink/Views/ContentView.swift b/lightninglink/Views/ContentView.swift
@@ -59,12 +59,14 @@ struct Funds {
public static func from_listfunds(fs: ListFunds) -> Funds {
var onchain_sats: Int64 = 0
var channel_sats: Int64 = 0
+ //var our_sats: Int64 = 0
let channels = fs.channels ?? []
let outputs = fs.outputs ?? []
for channel in channels {
- channel_sats += channel.channel_sat
+ //our_sats += channel.our_amount_msat
+ channel_sats += channel.our_amount_msat / 1000
}
for output in outputs {
@@ -111,8 +113,8 @@ struct ContentView: View {
return ""
}
- let fee = pay.msatoshi_sent - pay.msatoshi
- return "-\(render_amount_msats(pay.msatoshi)) (\(render_amount_msats(fee)) fee)"
+ let fee = pay.amount_sent_msat - pay.amount_msat
+ return "-\(render_amount_msats(pay.amount_msat)) (\(render_amount_msats(fee)) fee)"
}
func receive_pay() {
@@ -151,7 +153,7 @@ struct ContentView: View {
}
HStack {
- Text("\(self.dashboard.info.msatoshi_fees_collected / 1000) sats earned")
+ Text("\(self.dashboard.info.fees_collected_msat / 1000) sats earned")
.font(.footnote)
.foregroundColor(.gray)