diff --git a/.woodpecker/ci.yml b/.woodpecker/ci.yml index c617056..cbd6e3b 100644 --- a/.woodpecker/ci.yml +++ b/.woodpecker/ci.yml @@ -10,11 +10,9 @@ clone: image: woodpeckerci/plugin-git settings: depth: 50 - environment: - GIT_TERMINAL_PROMPT: "0" - CI_NETRC_MACHINE: codeberg.org - CI_NETRC_USERNAME: johba - CI_NETRC_PASSWORD: + netrc_machine: codeberg.org + netrc_username: johba + netrc_password: from_secret: codeberg_token steps: diff --git a/.woodpecker/e2e.yml b/.woodpecker/e2e.yml index 4e598ea..3cce421 100644 --- a/.woodpecker/e2e.yml +++ b/.woodpecker/e2e.yml @@ -13,11 +13,9 @@ clone: image: woodpeckerci/plugin-git settings: depth: 50 - environment: - GIT_TERMINAL_PROMPT: "0" - CI_NETRC_MACHINE: codeberg.org - CI_NETRC_USERNAME: johba - CI_NETRC_PASSWORD: + netrc_machine: codeberg.org + netrc_username: johba + netrc_password: from_secret: codeberg_token # All background services - services get proper DNS resolution in Woodpecker 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/docs/ENVIRONMENT.md b/docs/ENVIRONMENT.md index ab7c9f0..7d70df8 100644 --- a/docs/ENVIRONMENT.md +++ b/docs/ENVIRONMENT.md @@ -81,6 +81,15 @@ docker inspect landing --format '{{.NetworkSettings.Networks.harb_harb-network.I For testing login: `lobsterDao`, `test123`, `lobster-x010syqe?412!` (defined in `web-app/src/views/LoginView.vue`) +## Webapp Environment Variables + +| Variable | Default | Set in docker-compose | Purpose | +|---|---|---|---| +| `VITE_ENABLE_LOCAL_SWAP` | `false` (unset) | `true` | Show inline ETH→$KRK swap widget on Get KRK page instead of the Uniswap link. Enable for local dev; leave unset for production builds. | +| `VITE_KRAIKEN_ADDRESS` | from `deployments-local.json` | via `contracts.env` | Override KRK token address. | +| `VITE_STAKE_ADDRESS` | from `deployments-local.json` | via `contracts.env` | Override Stake contract address. | +| `VITE_DEFAULT_CHAIN_ID` | auto-detected (31337 on localhost) | — | Force the default chain. | + ## Contract Addresses After bootstrap, addresses are in `/home/debian/harb/tmp/containers/contracts.env`. diff --git a/web-app/src/components/LocalSwapWidget.vue b/web-app/src/components/LocalSwapWidget.vue new file mode 100644 index 0000000..b26cb5d --- /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/CheatsView.vue b/web-app/src/views/CheatsView.vue index c7a8a62..66f772c 100644 --- a/web-app/src/views/CheatsView.vue +++ b/web-app/src/views/CheatsView.vue @@ -172,6 +172,7 @@ import { const toast = useToast(); const statCollection = useStatCollection(); const { address, chainId } = useAccount(); +const { loadBalance } = useWallet(); const wagmiConfig: WagmiConfig = config; const rpcUrl = ref(''); @@ -1056,13 +1057,10 @@ async function buyKrk() { ], chainId, }); - - // FIX: Refresh KRK balance immediately after swap completes - // This ensures the balance is up-to-date when navigating to the stake page - const { loadBalance } = useWallet(); + await loadBalance(); - - toast.success('Swap submitted. Watch your wallet for KRK.'); + + toast.success('Swap complete. $KRK has been added to your wallet.'); } catch (error: unknown) { toast.error(getErrorMessage(error, 'Swap failed')); } finally { 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 @@
Swap ETH for $KRK directly against the local Uniswap pool.
+Swap ETH for $KRK on Uniswap, then stake your position to earn rewards.
You're on a local chain. Use the Cheat Console to swap ETH for KRK directly.
-