From 0f42c6aae3a059cc3279917fd8f627317cf0f503 Mon Sep 17 00:00:00 2001 From: bluezdot <72647326+bluezdot@users.noreply.github.com> Date: Wed, 19 Nov 2025 16:45:02 +0700 Subject: [PATCH 1/3] [Issue-4791] chores: comment affected scope to the improvement --- .../src/koni/background/handlers/Extension.ts | 1 + .../extension-base/src/services/swap-service/index.ts | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/packages/extension-base/src/koni/background/handlers/Extension.ts b/packages/extension-base/src/koni/background/handlers/Extension.ts index cbb690e379c..83d821ef5c6 100644 --- a/packages/extension-base/src/koni/background/handlers/Extension.ts +++ b/packages/extension-base/src/koni/background/handlers/Extension.ts @@ -4655,6 +4655,7 @@ export default class KoniExtension { } private async getLatestSwapQuote (swapRequest: SwapRequest): Promise { + // TODO (Issue-4791): this function must know previous picked quote to re-call that quote only. const { swapQuoteResponse } = await this.#koniState.swapService.getLatestQuoteFromSwapRequest(swapRequest); return swapQuoteResponse; diff --git a/packages/extension-base/src/services/swap-service/index.ts b/packages/extension-base/src/services/swap-service/index.ts index 9dc05952752..6c4dc9c8977 100644 --- a/packages/extension-base/src/services/swap-service/index.ts +++ b/packages/extension-base/src/services/swap-service/index.ts @@ -150,6 +150,9 @@ export class SwapService implements StoppableServiceInterface { * 4. Generate optimal process for that quote * */ + // TODO (Issue-4791): There are 2 ways: + // 1. find best quote and path, the logic here will remain same as before. + // 2. return all available (path, swapQuoteResponse). Need to update all affected uses of these two data. const { path, swapQuoteResponse } = await this.getLatestQuoteFromSwapRequest(request); console.group('Swap Logger'); @@ -207,6 +210,7 @@ export class SwapService implements StoppableServiceInterface { let availablePath: SwapPath | undefined; try { + // TODO (Issue-4791): findAvailablePath return SwapPath[] instead of SwapPath availablePath = await subwalletApiSdk.swapApi.findAvailablePath(request); } catch (e) { console.log('Error findAvailablePath', e); @@ -241,8 +245,12 @@ export class SwapService implements StoppableServiceInterface { directSwapRequest.isCrossChain = true; } + // TODO (Issue-4791): this function used to find all quotes and also the best quote of a path. + // In case we have many paths, we can also try finding best quote of all paths. const swapQuoteResponse = await this.getLatestDirectQuotes(directSwapRequest); + // TODO (Issue-4791): return complex data include many (path, swapQuoteResponse) object. + // In fact, the current swapQuoteResponse included all quotes belong to the path. return { path, swapQuoteResponse From 19acbea330358ea395c644206d5e3cb35be7b01e Mon Sep 17 00:00:00 2001 From: bluezdot <72647326+bluezdot@users.noreply.github.com> Date: Thu, 20 Nov 2025 11:44:25 +0700 Subject: [PATCH 2/3] [Issue-4791] chores: config backend url --- .env.pull-request.development | 1 + 1 file changed, 1 insertion(+) diff --git a/.env.pull-request.development b/.env.pull-request.development index e69de29bb2d..b8610fdf412 100644 --- a/.env.pull-request.development +++ b/.env.pull-request.development @@ -0,0 +1 @@ +SUBWALLET_API=https://be-dev-03.subwallet.app/api From bfe4ebae0f090675b5e76f24d223b9b624472d8d Mon Sep 17 00:00:00 2001 From: bluezdot <72647326+bluezdot@users.noreply.github.com> Date: Thu, 27 Nov 2025 16:05:43 +0700 Subject: [PATCH 3/3] [Issue-4791] chores: update be url --- .env.pull-request.development | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.pull-request.development b/.env.pull-request.development index b8610fdf412..799a60e2e07 100644 --- a/.env.pull-request.development +++ b/.env.pull-request.development @@ -1 +1 @@ -SUBWALLET_API=https://be-dev-03.subwallet.app/api +SUBWALLET_API=https://be-dev-05.subwallet.app/api