From bce4059de9e975b60a54c96e71e80f7b127450b8 Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 27 Feb 2026 06:55:41 +0000 Subject: [PATCH 1/5] fix: Get KRK: inline swap widget for local dev, Uniswap link for production (#136) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add `VITE_ENABLE_LOCAL_SWAP` env var to config.ts (defaults false) - Create LocalSwapWidget.vue: inline ETH→KRK swap (wrap→approve→exactInputSingle) - GetKrkView.vue: show LocalSwapWidget when VITE_ENABLE_LOCAL_SWAP=true, Uniswap link otherwise - docker-compose.yml: set VITE_ENABLE_LOCAL_SWAP=true for webapp service Co-Authored-By: Claude Sonnet 4.6 --- docker-compose.yml | 1 + web-app/src/components/LocalSwapWidget.vue | 329 +++++++++++++++++++++ web-app/src/config.ts | 2 + web-app/src/views/GetKrkView.vue | 55 +--- 4 files changed, 346 insertions(+), 41 deletions(-) create mode 100644 web-app/src/components/LocalSwapWidget.vue diff --git a/docker-compose.yml b/docker-compose.yml index e025c4a..849a494 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -131,6 +131,7 @@ services: environment: - CHOKIDAR_USEPOLLING=1 - GIT_BRANCH=${GIT_BRANCH:-} + - VITE_ENABLE_LOCAL_SWAP=true expose: - "5173" ports: diff --git a/web-app/src/components/LocalSwapWidget.vue b/web-app/src/components/LocalSwapWidget.vue new file mode 100644 index 0000000..716ec4d --- /dev/null +++ b/web-app/src/components/LocalSwapWidget.vue @@ -0,0 +1,329 @@ + + + + + diff --git a/web-app/src/config.ts b/web-app/src/config.ts index 5fb02dc..1b62651 100644 --- a/web-app/src/config.ts +++ b/web-app/src/config.ts @@ -122,3 +122,5 @@ export const chainsData = [ export function getChain(id: number) { return chainsData.find(obj => obj.id === id); } + +export const enableLocalSwap = env.VITE_ENABLE_LOCAL_SWAP === 'true'; diff --git a/web-app/src/views/GetKrkView.vue b/web-app/src/views/GetKrkView.vue index c73029f..b762f4c 100644 --- a/web-app/src/views/GetKrkView.vue +++ b/web-app/src/views/GetKrkView.vue @@ -8,7 +8,16 @@
{{ formattedBalance }} $KRK
-
+ +
+
+

Swap ETH for $KRK directly against the local Uniswap pool.

+
+ +
+ + +

Swap ETH for $KRK on Uniswap, then stake your position to earn rewards.

@@ -31,22 +40,12 @@
- -
-

🔧 Local Development

-

You're on a local chain. Use the Cheat Console to swap ETH for KRK directly.

- - Open Cheat Console - - -
-

Next Steps

    -
  1. Use the Cheat Console to swap ETH for $KRK
  2. +
  3. Swap ETH for $KRK using the widget above
  4. Click the button above to open Uniswap
  5. -
  6. Swap ETH for $KRK tokens
  7. +
  8. Swap ETH for $KRK tokens
  9. Return here and navigate to the Stake page
  10. Stake your $KRK to start earning
@@ -58,7 +57,8 @@