From c5f6506f89dca035ae6e1ef511c4e3586197efff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Prohaszka?= Date: Wed, 17 Jul 2024 11:34:52 +0200 Subject: [PATCH] fix(xlm): config typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Prohaszka --- libs/coin-modules/coin-stellar/src/api/index.integ.test.ts | 3 --- .../coin-stellar/src/bridge/buildTransaction.integ.test.ts | 4 +--- libs/coin-modules/coin-stellar/src/config.ts | 6 +++--- libs/coin-modules/coin-stellar/src/network/horizon.ts | 3 ++- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/libs/coin-modules/coin-stellar/src/api/index.integ.test.ts b/libs/coin-modules/coin-stellar/src/api/index.integ.test.ts index 1640376c3457..9d851826145b 100644 --- a/libs/coin-modules/coin-stellar/src/api/index.integ.test.ts +++ b/libs/coin-modules/coin-stellar/src/api/index.integ.test.ts @@ -9,10 +9,7 @@ describe("Stellar Api", () => { module = createApi({ explorer: { url: "https://horizon-testnet.stellar.org/", - fetchLmit: 100, }, - useStaticFees: true, - enableNetworkLogs: false, }); }); diff --git a/libs/coin-modules/coin-stellar/src/bridge/buildTransaction.integ.test.ts b/libs/coin-modules/coin-stellar/src/bridge/buildTransaction.integ.test.ts index eff4e2cb5f87..62f683c7b28c 100644 --- a/libs/coin-modules/coin-stellar/src/bridge/buildTransaction.integ.test.ts +++ b/libs/coin-modules/coin-stellar/src/bridge/buildTransaction.integ.test.ts @@ -11,10 +11,8 @@ describe("buildTransaction", () => { status: { type: "active" }, explorer: { url: "https://stellar.coin.ledger.com", //"https://horizon-testnet.stellar.org/", - fetchLmit: 100, + fetchLimit: 100, }, - useStaticFees: true, - enableNetworkLogs: false, }), ); }); diff --git a/libs/coin-modules/coin-stellar/src/config.ts b/libs/coin-modules/coin-stellar/src/config.ts index f55aba1e81f4..a0acd4cbd7d0 100644 --- a/libs/coin-modules/coin-stellar/src/config.ts +++ b/libs/coin-modules/coin-stellar/src/config.ts @@ -3,10 +3,10 @@ import buildCoinConfig, { type CurrencyConfig } from "@ledgerhq/coin-framework/c export type StellarConfig = { explorer: { url: string; - fetchLmit: number; + fetchLimit?: number; }; - useStaticFees: boolean; - enableNetworkLogs: boolean; + useStaticFees?: boolean; + enableNetworkLogs?: boolean; }; export type StellarCoinConfig = CurrencyConfig & StellarConfig; diff --git a/libs/coin-modules/coin-stellar/src/network/horizon.ts b/libs/coin-modules/coin-stellar/src/network/horizon.ts index 8dfd8ea93d7f..c80cfd0e7417 100644 --- a/libs/coin-modules/coin-stellar/src/network/horizon.ts +++ b/libs/coin-modules/coin-stellar/src/network/horizon.ts @@ -35,6 +35,7 @@ import { const FALLBACK_BASE_FEE = 100; const TRESHOLD_LOW = 0.5; const TRESHOLD_MEDIUM = 0.75; +const FETCH_LIMIT = 100; const currency = getCryptoCurrencyById("stellar"); let server: Horizon.Server | undefined; const getServer = () => { @@ -199,7 +200,7 @@ export async function fetchOperations({ let rawOperations = await getServer() .operations() .forAccount(addr) - .limit(coinConfig.getCoinConfig().explorer.fetchLmit) + .limit(coinConfig.getCoinConfig().explorer.fetchLimit ?? FETCH_LIMIT) .order(order) .cursor(cursor) .includeFailed(true)