diff --git a/README.md b/README.md index 0ee7c692..a8582b7c 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,9 @@ You have successfully set up Soroswap on your local machine! Start swapping, poo If you want to add or remove supported protocols, you can do so by editing the `functions/generateRoute.ts:79-97` file and adding or removing the protocols you want to support on swap. +> [!HINT] +> You can found the list of supported protocols in the `soroswap-router-sdk` repository. + ## 🧪🔨 Testing 🧪🔨 To execute the tests, you must first start the development container. To do this, run the following command from your host machine: diff --git a/src/functions/generateRoute.ts b/src/functions/generateRoute.ts index 052a5fe9..6508da6c 100644 --- a/src/functions/generateRoute.ts +++ b/src/functions/generateRoute.ts @@ -63,12 +63,12 @@ export const useRouterSDK = () => { const getValuebyKey = (key: string) => { let value = protocolsStatus.find((p) => p.key === key)?.value; + if (value === undefined && key === Protocols.SOROSWAP) { + return true; + } if (typeof value === 'undefined') { return false; } - if (typeof value === 'undefined' && key === Protocols.SOROSWAP) { - return true; - } if (value === true || value === false) { return value; }