litecoin-foundation / Litewallet-Project

General information for Litewallet across all platforms
5 stars 0 forks source link

🦺[Tech Debt] Offer dynamic fee rates #13

Open kcw-grunt opened 3 years ago

kcw-grunt commented 3 years ago

Description

Currently the Android and iOS clients query the the API server for fee rates.

Problem

The fees are static and the Litewallet Mobile API server should serve up the freshest LTC fee rates

Background

While the server has and end-point for fees, the clients use an onboard value

In iOS:

fileprivate let defaultEconomyFeePerKB: UInt64 = 2500 // From legacy minimum. default min is 1000 as Litecoin Core version v0.17.1 
fileprivate let defaultRegularFeePerKB: UInt64 = 25000
fileprivate let defaultLuxuryFeePerKB: UInt64 = 66746

While the server has the endpoint:

app.get("/fee-per-kb", (req, res) => {
  res.json({
    fee_per_kb: 10000,
    fee_per_kb_economy: 2500
  });
});

Goals

losh11 commented 3 years ago

The hardcoded fees are supposed to be just fallback incase the api server becomes unreachable. This is because SPV clients have no way to telling how full blocks are.

On Tue, 2 Mar 2021 at 15:08, Kerry Washington notifications@github.com wrote:

Description

Currently the Android and iOS clients query the the API server for fee rates. Problem

The fees are static and the Litewallet Mobile API server should serve up the freshest LTC fee rates Background

While the server has and end-point for fees, the clients use an onboard value

In iOS:

fileprivate let defaultEconomyFeePerKB: UInt64 = 2500 // From legacy minimum. default min is 1000 as Litecoin Core version v0.17.1 fileprivate let defaultRegularFeePerKB: UInt64 = 25000 fileprivate let defaultLuxuryFeePerKB: UInt64 = 66746

While the server has the endpoint:

app.get("/fee-per-kb", (req, res) => { res.json({ fee_per_kb: 10000, fee_per_kb_economy: 2500 }); });

Goals

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/litecoin-foundation/Litewallet-Project/issues/13, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAT43OT5Y2WSPQ2XCQC2HCTTBT5NLANCNFSM4YPEZV2Q .

kcw-grunt commented 3 years ago

@losh11 that makes sense. This work is so that the api server may fresh rates. currently, its never checked.