Skip to content

Commit f60cca6

Browse files
committed
fix: smart route search
1 parent b8bacc6 commit f60cca6

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

.changeset/ten-dogs-glow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sovryn/sdk': patch
3+
---
4+
5+
fix: route search

packages/sdk/src/swaps/smart-router/smart-router.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ export class SmartRouter {
3434
const routes = await Promise.all(
3535
this.getAvailableRoutes(chain).map(async route => {
3636
const pairs = await route.pairs();
37-
if (pairs.has(base)) {
38-
const quoteTokens = pairs.get(base);
39-
if (quoteTokens?.includes(quote)) {
37+
if (pairs.has(base.toLowerCase())) {
38+
const quoteTokens = pairs.get(base.toLowerCase());
39+
if (quoteTokens?.includes(quote.toLowerCase())) {
4040
return route;
4141
}
4242
}
@@ -93,7 +93,6 @@ export class SmartRouter {
9393
amount: BigNumberish,
9494
): Promise<BestRouteQuote> {
9595
const routes = await this.getQuotes(chain, base, quote, amount);
96-
9796
if (routes.length === 0) {
9897
throw new Error('No routes available');
9998
}

0 commit comments

Comments
 (0)