Skip to content

Commit

Permalink
Adding logs and disabling fetching orders from all markets when no ma…
Browse files Browse the repository at this point in the history
…rket is informed.
  • Loading branch information
danilo-silva-funttastic committed Aug 26, 2024
1 parent f373575 commit e5bd058
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/connectors/kujira/kujira.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1428,9 +1428,14 @@ export class Kujira {
bundles,
});
} else {
// TODO Handle better the case when no market is informed. The ideal is to fetch the orders only from the markets who have them!!!
// const marketIds =
// options.marketIds ||
// (await this.getAllMarkets({}, this.network)).keySeq().toArray();

const marketIds =
options.marketIds ||
(await this.getAllMarkets({}, this.network)).keySeq().toArray();
[];

orders = IMap<OrderId, Order>().asMutable();

Expand Down Expand Up @@ -2199,6 +2204,9 @@ export class Kujira {

latencies.sort((a, b) => a.latency - b.latency);

console.log('RPCs latencies:', latencies);
console.log(`Chosen RPC: ${latencies[0].endpoint}`);

return latencies[0].endpoint;
}

Expand Down

0 comments on commit e5bd058

Please sign in to comment.