Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions sdk/src/titan/titanClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,8 @@ export class TitanClient {
this.lastQuoteData = data;
this.lastQuoteParams = params.toString();

const route =
data.quotes[
Object.keys(data.quotes).find((key) => key.toLowerCase() === 'titan') ||
''
];
// We are only querying for the best avaiable route so use that
const route = data.quotes[Object.keys(data.quotes)[0]];

if (!route) {
throw new Error('No routes available');
Expand Down Expand Up @@ -340,12 +337,9 @@ export class TitanClient {

// Reuse the cached quote data
const data = this.lastQuoteData;

const route =
data.quotes[
Object.keys(data.quotes).find((key) => key.toLowerCase() === 'titan') ||
''
];

// We are only querying for the best avaiable route so use that
const route = data.quotes[Object.keys(data.quotes)[0]];

if (!route) {
throw new Error('No routes available');
Expand Down
Loading