Gas fee underestimation causes all limit order and bid placements to fail across Trade and Limits tabs #127

Closed
opened 2026-05-04 16:54:48 +00:00 by totdking · 67 comments
totdking commented 2026-05-04 16:54:48 +00:00 (Migrated from gitlab.com)
No description provided.
totdking commented 2026-05-04 17:02:39 +00:00 (Migrated from gitlab.com)

Issue Summary

Attempting to place a limit order or bid on any token pair fails with an insufficient fee error. The frontend estimates 3000uluna in gas fees but LocalTerra requires a minimum of 5665000uluna. This affects the Place Limit and Place Bid actions on both the /trade and /limits pages, across all token pairs tested.


Reproduction Steps

  1. Complete full local setup (LocalTerra running, contracts deployed, indexer running, frontend running)
  2. Connect Station wallet with sufficient balance
  3. Navigate to /trade or /limits
  4. Select any token pair
  5. Enter a valid amount and price for a limit order or bid
  6. Click Place Limit or Place Bid
  7. Observe the transaction fails immediately with an insufficient fee error

Expected Behavior

The frontend should estimate gas fees accurately so that limit order and bid transactions submit successfully without manual fee adjustment.


Actual Behavior

The transaction fails with the following error logged in the browser console (transactions.ts:160):

Terra Classic transaction error: Error: insufficient fees; got: "3000uluna", 
required: "5665000uluna" (gas) [+ ""(tax)]: insufficient fee

The error originates at transactions.ts:149 inside executeTerraContract, called from TradeOrderTicket.tsx:88.


Environment Details

Field Value
OS macOS (Apple M1 Pro, 14-inch)
Browser Google Chrome (desktop)
Network localterra (local Docker)
Frontend VITE_NETWORK=local npm run dev
Indexer Running (make indexer-dev)
Contracts Deployed via make deploy-local

Wallet / Device Details

  • Wallet: Station browser extension
  • Network: localterra - LCD http://localhost:1317, RPC http://localhost:26657

Console Logs

transactions.ts:160 Terra Classic transaction error: Error: insufficient fees; 
got: "3000uluna", required: "190000uaud,190000ucad,140000uchf,980000ucny,
900000udkk,125000ueur,110000ugbp,1170000uhkd,2180000000uidr,10880000uinr,
16370000ujpy,170000000ukrw,5665000uluna,428571000umnt,600000umyr,1250000unok,
7600000uphp,104938usdr,1250000usek,200000usgd,4620000uthb,4000000utwd,150000uusd"
(gas) [+ ""(tax)]: insufficient fee
    at async executeTerraContract (transactions.ts:149:20)
    at async Object.mutationFn (TradeOrderTicket.tsx:88:7)

Severity / Impact

Place Limit and Place Bid are non-functional across all token pairs on both the /trade and /limits tabs. No limit order or bid can be submitted in the current state. Likely related to open issue #115 (LAUNCH-BLOCKER: Swap transactions fail with 'out of gas' — gas estimate too low for wasm contract execution), the same gas underestimation logic in transactions.ts appears to affect limit order placement as well as swaps.

@PlasticDigits Blocks dex launch

### Issue Summary Attempting to place a limit order or bid on any token pair fails with an insufficient fee error. The frontend estimates `3000uluna` in gas fees but LocalTerra requires a minimum of `5665000uluna`. This affects the Place Limit and Place Bid actions on both the `/trade` and `/limits` pages, across all token pairs tested. --- ### Reproduction Steps 1. Complete full local setup (LocalTerra running, contracts deployed, indexer running, frontend running) 2. Connect Station wallet with sufficient balance 3. Navigate to `/trade` or `/limits` 4. Select any token pair 5. Enter a valid amount and price for a limit order or bid 6. Click **Place Limit** or **Place Bid** 7. Observe the transaction fails immediately with an insufficient fee error --- ### Expected Behavior The frontend should estimate gas fees accurately so that limit order and bid transactions submit successfully without manual fee adjustment. --- ### Actual Behavior The transaction fails with the following error logged in the browser console (`transactions.ts:160`): ``` Terra Classic transaction error: Error: insufficient fees; got: "3000uluna", required: "5665000uluna" (gas) [+ ""(tax)]: insufficient fee ``` The error originates at `transactions.ts:149` inside `executeTerraContract`, called from `TradeOrderTicket.tsx:88`. --- ### Environment Details | Field | Value | |-------|-------| | OS | macOS (Apple M1 Pro, 14-inch) | | Browser | Google Chrome (desktop) | | Network | `localterra` (local Docker) | | Frontend | `VITE_NETWORK=local npm run dev` | | Indexer | Running (`make indexer-dev`) | | Contracts | Deployed via `make deploy-local` | --- ### Wallet / Device Details - **Wallet:** Station browser extension - **Network:** localterra - LCD `http://localhost:1317`, RPC `http://localhost:26657` --- ### Console Logs ``` transactions.ts:160 Terra Classic transaction error: Error: insufficient fees; got: "3000uluna", required: "190000uaud,190000ucad,140000uchf,980000ucny, 900000udkk,125000ueur,110000ugbp,1170000uhkd,2180000000uidr,10880000uinr, 16370000ujpy,170000000ukrw,5665000uluna,428571000umnt,600000umyr,1250000unok, 7600000uphp,104938usdr,1250000usek,200000usgd,4620000uthb,4000000utwd,150000uusd" (gas) [+ ""(tax)]: insufficient fee at async executeTerraContract (transactions.ts:149:20) at async Object.mutationFn (TradeOrderTicket.tsx:88:7) ``` --- ### Severity / Impact Place Limit and Place Bid are non-functional across all token pairs on both the `/trade` and `/limits` tabs. No limit order or bid can be submitted in the current state. Likely related to open issue **#115** (`LAUNCH-BLOCKER: Swap transactions fail with 'out of gas' — gas estimate too low for wasm contract execution`), the same gas underestimation logic in `transactions.ts` appears to affect limit order placement as well as swaps. @PlasticDigits Blocks dex launch
PlasticDigits commented 2026-05-05 02:37:05 +00:00 (Migrated from gitlab.com)

mentioned in commit 7dd49c4f00

mentioned in commit 7dd49c4f0054a6f095cbbd812b03b3058aa36b08
PlasticDigits commented 2026-05-05 02:37:36 +00:00 (Migrated from gitlab.com)

Fix landed on main (7dd49c4)

Root cause: Place Limit / Place Bid runs increase_allowance first (BASE_GAS_LIMIT 200k), then CW20 send with place_limit_order. If VITE_GAS_PRICE_ULUNA is far below the network / Station minimum (~28.325 uluna per gas unit), Fee.amount was computed as tiny (e.g. ~3000 uluna) while gas_wanted stayed 200k — the node rejects with insufficient fees (~5.665M uluna required for that gas at 28.325).

What changed

  • effectiveGasPriceUluna() floors env gas price at MIN_GAS_PRICE_ULUNA (28.325); estimateTerraClassicFee, Station wallet gasPrice, and dev MnemonicWallet use it.
  • Defensive getGasLimitForTx branch for top-level place_limit_order.
  • scripts/deploy-dex-local.sh now sets VITE_GAS_PRICE_ULUNA=28.325 in frontend-dapp/.env.local.
  • Docs: docs/frontend.md, docs/limit-orders.md, skills/AGENTS_TERRACLASSIC_GAS.md, skills/AGENTS_LOCALNET_TRADING_SWARM.md (cross-linked, #127).

Verification checklist for @brouie

  1. Local stack: deploy / indexer / VITE_NETWORK=local npm run dev (fresh .env.local from deploy script if possible).
  2. Station wallet with LUNC for fees.
  3. Limits or Trade tab: place a bid and an ask (different pairs OK); both allowance + placement txs should broadcast without insufficient fees.
  4. Optional: set VITE_GAS_PRICE_ULUNA=0.015 in .env.local, rebuild dev server — txs should still use ≥28.325 for fee math (no ~3000 uluna fee on the first tx).
  5. Run cd frontend-dapp && npm ci && npm test -- --run — should pass (includes new floor + place_limit_order gas tests).

Issue left open until you confirm in your environment.

## Fix landed on `main` (7dd49c4) **Root cause:** Place Limit / Place Bid runs `increase_allowance` first (`BASE_GAS_LIMIT` 200k), then CW20 `send` with `place_limit_order`. If `VITE_GAS_PRICE_ULUNA` is far below the network / Station minimum (~28.325 uluna per gas unit), `Fee.amount` was computed as tiny (e.g. ~3000 uluna) while `gas_wanted` stayed 200k — the node rejects with **insufficient fees** (~5.665M uluna required for that gas at 28.325). **What changed** - `effectiveGasPriceUluna()` floors env gas price at `MIN_GAS_PRICE_ULUNA` (28.325); `estimateTerraClassicFee`, Station wallet `gasPrice`, and dev `MnemonicWallet` use it. - Defensive `getGasLimitForTx` branch for top-level `place_limit_order`. - `scripts/deploy-dex-local.sh` now sets `VITE_GAS_PRICE_ULUNA=28.325` in `frontend-dapp/.env.local`. - Docs: `docs/frontend.md`, `docs/limit-orders.md`, `skills/AGENTS_TERRACLASSIC_GAS.md`, `skills/AGENTS_LOCALNET_TRADING_SWARM.md` (cross-linked, #127). **Verification checklist for @brouie** 1. Local stack: deploy / indexer / `VITE_NETWORK=local npm run dev` (fresh `.env.local` from deploy script if possible). 2. Station wallet with LUNC for fees. 3. **Limits** or **Trade** tab: place a **bid** and an **ask** (different pairs OK); both allowance + placement txs should broadcast without `insufficient fees`. 4. Optional: set `VITE_GAS_PRICE_ULUNA=0.015` in `.env.local`, rebuild dev server — txs should still use ≥28.325 for fee math (no ~3000 uluna fee on the first tx). 5. Run `cd frontend-dapp && npm ci && npm test -- --run` — should pass (includes new floor + `place_limit_order` gas tests). Issue left **open** until you confirm in your environment.
Brouie commented 2026-05-05 04:18:19 +00:00 (Migrated from gitlab.com)

@PlasticDigits — source-side verification PASS on 7dd49c4. localnet UX walk (items 1-4 of your checklist) pending — totdking's environment is the natural blocker for that since the original repro was on his macOS Station setup. happy to walk on QA-server LocalTerra if useful, just need a heads-up.

walked your checklist item 5:

  • npm test -- --run: 276/276 PASS across 35 test files. clean, no skipped, no env failures (the vite.config stderr is from viteConfig.build.test asserting #118 rejection path — intentional negative test).

source review of the floor:

  • MIN_GAS_PRICE_ULUNA = 28.325 defined at constants.ts:32 matches Station / network minimum from your repro.
  • effectiveGasPriceUluna() (constants.ts:43-46): parses VITE_GAS_PRICE_ULUNA, falls back to MIN_GAS_PRICE_ULUNA on invalid/zero/negative, then Math.max(base, MIN_GAS_PRICE_ULUNA) enforces floor unconditionally — env override below floor is silently raised, env override above floor is honored.
  • 4 call sites wired through the new function:
    • transactions.ts:24 — feeAmount = Math.ceil(effectiveGasPriceUluna() * gasLimit)
    • wallet.ts:79 — Station gasPrice.amount
    • devWallet.ts:28 — dev MnemonicWallet gasPrice.amount
  • no remaining path computes fee from the raw VITE_GAS_PRICE_ULUNA env.

new test coverage:

  • constants.test.ts describe effectiveGasPriceUluna (GitLab #127) — 2 tests (floor when unset, above-floor override honored).
  • transactions.test.ts:245-260 — 2 tests for PLACE_LIMIT_ORDER_GAS_LIMIT branch covering both top-level place_limit_order and CW20 send with inner place_limit_order.

defensive getGasLimitForTx branch at top-level place_limit_order covers the contract-direct path too (not just CW20-wrapped via send).

deploy script update: scripts/deploy-dex-local.sh writes VITE_GAS_PRICE_ULUNA=28.325 to .env.local so fresh QA setups get the right env without manual override.

cc @totdking — fix should resolve your insufficient-fee error end-to-end. dev wired the floor through Station + dev wallet + fee estimator paths, so even if your existing .env.local still has VITE_GAS_PRICE_ULUNA=0.015 from the older setup, the fee math will now ceil to ≥28.325 uluna per gas unit on tx broadcast.

ready for close once a fresh environment confirms the original repro is gone.

@PlasticDigits — source-side verification PASS on `7dd49c4`. localnet UX walk (items 1-4 of your checklist) pending — totdking's environment is the natural blocker for that since the original repro was on his macOS Station setup. happy to walk on QA-server LocalTerra if useful, just need a heads-up. walked your checklist item 5: - `npm test -- --run`: 276/276 PASS across 35 test files. clean, no skipped, no env failures (the vite.config stderr is from `viteConfig.build.test` asserting `#118` rejection path — intentional negative test). source review of the floor: - `MIN_GAS_PRICE_ULUNA = 28.325` defined at `constants.ts:32` matches Station / network minimum from your repro. - `effectiveGasPriceUluna()` (`constants.ts:43-46`): parses `VITE_GAS_PRICE_ULUNA`, falls back to `MIN_GAS_PRICE_ULUNA` on invalid/zero/negative, then `Math.max(base, MIN_GAS_PRICE_ULUNA)` enforces floor unconditionally — env override below floor is silently raised, env override above floor is honored. - 4 call sites wired through the new function: - `transactions.ts:24` — `feeAmount = Math.ceil(effectiveGasPriceUluna() * gasLimit)` - `wallet.ts:79` — Station `gasPrice.amount` - `devWallet.ts:28` — dev MnemonicWallet `gasPrice.amount` - no remaining path computes fee from the raw `VITE_GAS_PRICE_ULUNA` env. new test coverage: - `constants.test.ts` describe `effectiveGasPriceUluna (GitLab #127)` — 2 tests (floor when unset, above-floor override honored). - `transactions.test.ts:245-260` — 2 tests for `PLACE_LIMIT_ORDER_GAS_LIMIT` branch covering both top-level `place_limit_order` and CW20 `send` with inner `place_limit_order`. defensive `getGasLimitForTx` branch at top-level `place_limit_order` covers the contract-direct path too (not just CW20-wrapped via `send`). deploy script update: `scripts/deploy-dex-local.sh` writes `VITE_GAS_PRICE_ULUNA=28.325` to `.env.local` so fresh QA setups get the right env without manual override. cc @totdking — fix should resolve your insufficient-fee error end-to-end. dev wired the floor through Station + dev wallet + fee estimator paths, so even if your existing `.env.local` still has `VITE_GAS_PRICE_ULUNA=0.015` from the older setup, the fee math will now ceil to ≥28.325 uluna per gas unit on tx broadcast. ready for close once a fresh environment confirms the original repro is gone.
PlasticDigits commented 2026-05-05 05:40:09 +00:00 (Migrated from gitlab.com)

@totdking Please verify the issue is resolved by reproducing the steps that previously caused the problem, then report your findings below.

@totdking Please verify the issue is resolved by reproducing the steps that previously caused the problem, then report your findings below.
totdking commented 2026-05-05 12:12:40 +00:00 (Migrated from gitlab.com)

On the dev-wallet (simulated wallet) , the transaction went through successfully,

Screenshot 2026-05-05 at 13.04.20.png{width="878" height="600"}

But on the station wallet with the localTerra enabled, it still returned the same error as given

Screenshot 2026-05-05 at 12.40.34.png

Screenshot 2026-05-05 at 12.45.31.png{width="900" height="585"}

Final verdict

Station wallet overrides fee on LocalTerra despite preferNoSetFee: true set in KeplrExtension constructor (wallet.ts).

The app correctly computes 5,665,000uluna via effectiveGasPriceUluna(), but Station broadcasts 3000uluna (its own 0.015 × 200k calculation).

Dev wallet (MnemonicWallet) works correctly.

Root cause is likely that Station doesn't honor defaultOptions.sign.preferNoSetFee the same way Keplr does, or has a stale gas price stored internally for LocalTerra.

Note:

This was after a hard refresh was taken on my browser, station wallet was reinstalled, the frontend-dapp/node_modules/.vite was deleted and the npm run dev was re-run

The fix is good ,but the station wallet on local terra ignores the fix and uses it's stale pricing, Station in real life production (mainnet & testnet) would most likely not act like this as the chains will be properly registered with the station wallet with the correct gas price .

cc: @PlasticDigits

On the dev-wallet (simulated wallet) , the transaction went through successfully, ![Screenshot 2026-05-05 at 13.04.20.png](/uploads/3658ec97bca7c02df6055fc92c5b938b/Screenshot_2026-05-05_at_13.04.20.png){width="878" height="600"} But on the station wallet with the localTerra enabled, it still returned the same error as given ![Screenshot 2026-05-05 at 12.40.34.png](/uploads/f60a30787fa1e4a50d9421c93a87b30c/Screenshot_2026-05-05_at_12.40.34.png) ![Screenshot 2026-05-05 at 12.45.31.png](/uploads/444a07b1936c3391df7776b237541a91/Screenshot_2026-05-05_at_12.45.31.png){width="900" height="585"} ### Final verdict Station wallet overrides fee on LocalTerra despite preferNoSetFee: true set in KeplrExtension constructor (wallet.ts). The app correctly computes 5,665,000uluna via effectiveGasPriceUluna(), but Station broadcasts 3000uluna (its own 0.015 × 200k calculation). Dev wallet (MnemonicWallet) works correctly. Root cause is likely that Station doesn't honor `defaultOptions.sign.preferNoSetFee` the same way Keplr does, or has a stale gas price stored internally for LocalTerra. **Note:** This was after a hard refresh was taken on my browser, station wallet was reinstalled, the `frontend-dapp/node_modules/.vite` was deleted and the `npm run dev` was re-run The fix is good ,but the station wallet on local terra ignores the fix and uses it's stale pricing, **Station** in real life production (mainnet & testnet) would most likely not act like this as the chains will be properly registered with the station wallet with the correct gas price . cc: @PlasticDigits
PlasticDigits commented 2026-05-05 12:26:15 +00:00 (Migrated from gitlab.com)

mentioned in commit 9a61c1c60c

mentioned in commit 9a61c1c60c33dd026d555986f613b5bcb4b0b2a1
PlasticDigits commented 2026-05-05 12:26:36 +00:00 (Migrated from gitlab.com)

Update (Station + LocalTerra)

Cause: Station’s extension can ignore preferNoSetFee and rebuild Fee.amount from a stale built-in LocalTerra gasPriceStep (~0.015 uluna/gas), while the dApp already computed correct gas_wanted — hence 3000 uluna paid vs ~5.6M uluna required.

Fix (merged on main, 9a61c1c): When VITE_NETWORK=local, Station extension connect calls window.station.keplr.experimentalSuggestChain(...) with the same metadata as Keplr ( gasPriceStep 28.325 / 28.325 / 50 ). Failures are logged as a warning so connect still works if the user dismisses the prompt.

Docs: docs/frontend.md (gas invariant row), docs/limit-orders.md, docs/indexer-invariants.md (pointer), skills/AGENTS_TERRACLASSIC_GAS.md, skills/AGENTS_LOCALNET_TRADING_SWARM.md.

Verification checklist — @totdking

  1. Pull latest main, cd frontend-dapp && npm ci && npm run dev with VITE_NETWORK=local and LocalTerra LCD/RPC in .env.local.
  2. Disconnect Station in the dApp, then connect again; approve any Station prompt to add/update the LocalTerra network (needed for refreshed fee steps).
  3. On /trade or /limits, submit Place Limit / Place Bid (allowance + placement): txs should not fail with insufficient fees; got: \"3000uluna\".
  4. Optional regression: cd frontend-dapp && npm test -- --run (includes keplrLikeExtension tests).

Leaving this issue open until you confirm Station + LocalTerra in your environment. Thanks!

## Update (Station + LocalTerra) **Cause:** Station’s extension can **ignore** `preferNoSetFee` and rebuild `Fee.amount` from a **stale** built-in LocalTerra `gasPriceStep` (~0.015 uluna/gas), while the dApp already computed correct `gas_wanted` — hence **3000 uluna** paid vs **~5.6M uluna** required. **Fix (merged on `main`, `9a61c1c`):** When `VITE_NETWORK=local`, **Station extension** connect calls `window.station.keplr.experimentalSuggestChain(...)` with the same metadata as Keplr ( **`gasPriceStep` 28.325 / 28.325 / 50** ). Failures are logged as a warning so connect still works if the user dismisses the prompt. **Docs:** `docs/frontend.md` (gas invariant row), `docs/limit-orders.md`, `docs/indexer-invariants.md` (pointer), `skills/AGENTS_TERRACLASSIC_GAS.md`, `skills/AGENTS_LOCALNET_TRADING_SWARM.md`. ### Verification checklist — @totdking 1. Pull latest `main`, `cd frontend-dapp && npm ci && npm run dev` with `VITE_NETWORK=local` and LocalTerra LCD/RPC in `.env.local`. 2. **Disconnect** Station in the dApp, then **connect again**; **approve** any Station prompt to add/update the LocalTerra network (needed for refreshed fee steps). 3. On **/trade** or **/limits**, submit **Place Limit** / **Place Bid** (allowance + placement): txs should **not** fail with `insufficient fees; got: \"3000uluna\"`. 4. Optional regression: `cd frontend-dapp && npm test -- --run` (includes `keplrLikeExtension` tests). Leaving this issue **open** until you confirm Station + LocalTerra in your environment. Thanks!
PlasticDigits commented 2026-05-05 12:28:55 +00:00 (Migrated from gitlab.com)

mentioned in commit b779f9a3f1

mentioned in commit b779f9a3f15704b72732732c5baf1b4996eb447a
PlasticDigits commented 2026-05-05 12:28:56 +00:00 (Migrated from gitlab.com)

QA note: Please verify LocalTerra limit/bid (and allowance-first txs) with both Station and Terra Classic Keplr — extension fee handling can differ even when in-app fee math matches.

Docs updated on main (b779f9a): docs/frontend.md, docs/limit-orders.md, docs/indexer-invariants.md, skills/AGENTS_TERRACLASSIC_GAS.md, skills/AGENTS_LOCALNET_TRADING_SWARM.md.

cc @totdking

**QA note:** Please verify LocalTerra limit/bid (and allowance-first txs) with **both** **Station** and **Terra Classic Keplr** — extension fee handling can differ even when in-app fee math matches. Docs updated on `main` (`b779f9a`): `docs/frontend.md`, `docs/limit-orders.md`, `docs/indexer-invariants.md`, `skills/AGENTS_TERRACLASSIC_GAS.md`, `skills/AGENTS_LOCALNET_TRADING_SWARM.md`. cc @totdking
PlasticDigits commented 2026-05-05 13:13:41 +00:00 (Migrated from gitlab.com)

mentioned in commit 98b3744667

mentioned in commit 98b3744667a5d2aae902b8b9983fa59da4fafe42
PlasticDigits commented 2026-05-05 13:14:18 +00:00 (Migrated from gitlab.com)

Update (GitLab #127 — Station still broadcasting ~3000 uluna on LocalTerra)

Merged on `main`: `98b3744`

What changed

  1. `@goblinhunt/cosmes` patch (`frontend-dapp/patches/@goblinhunt+cosmes+0.0.71-ghunt.21.patch`): `KeplrExtension` now passes explicit `preferNoSetFee` / `preferNoSetMemo` on every `signAmino` and `signDirect` call (not only via `defaultOptions` in the constructor). This targets Station builds that still overwrite `Fee.amount` from a stale LocalTerra gas step when the dApp already supplied the correct fee.

  2. `wallet.ts`: For `VITE_NETWORK=local` + Station extension, `experimentalSuggestChain` runs again after a successful `connect` (in addition to the existing pre-connect call), so chain metadata is refreshed after `enable()`.

  3. Docs / agent playbooks: `docs/frontend.md`, `docs/limit-orders.md`, `docs/indexer-invariants.md`, `skills/AGENTS_TERRACLASSIC_GAS.md`, `skills/AGENTS_LOCALNET_TRADING_SWARM.md` — invariants and cross-links updated to describe the patch + dual suggest.

CI / local verification (already run)

  • `cd frontend-dapp && npm ci && npm test -- --run` → 278/278 PASS
  • `npm run build` → PASS

Checklist for @totdking (please confirm)

  • Pull latest `main` (`98b3744` or newer), `cd frontend-dapp && npm ci && npm run dev` with `VITE_NETWORK=local` and LocalTerra LCD/RPC in `.env.local`.
  • Disconnect Station in the dApp, connect again; approve any Station “add / update chain” prompt.
  • On /trade or /limits, run Place Bid / Place Limit (first tx is often `increase_allowance`): confirm the broadcast does not fail with `insufficient fees; got: "3000uluna"`.
  • Optional regression: temporarily set `VITE_GAS_PRICE_ULUNA=0.015` in `.env.local`, restart dev server — in-app fee math should still floor at ≥28.325; with this Station fix, the extension should no longer underpay on sign.
  • If anything still fails, capture Station version, full console error, and whether the failed tx shows 3000 uluna vs expected ~5.6M+ uluna in Station’s tx preview.

Request: @totdking — please run the checklist above on your macOS + Station + LocalTerra setup (original repro) and reply here with pass/fail. Leaving the issue open until you confirm.

cc @PlasticDigits

## Update (GitLab #127 — Station still broadcasting ~3000 uluna on LocalTerra) **Merged on \`main\`:** \`98b3744\` ### What changed 1. **\`@goblinhunt/cosmes\` patch** (\`frontend-dapp/patches/@goblinhunt+cosmes+0.0.71-ghunt.21.patch\`): **\`KeplrExtension\`** now passes explicit **\`preferNoSetFee\` / \`preferNoSetMemo\`** on **every** \`signAmino\` and \`signDirect\` call (not only via \`defaultOptions\` in the constructor). This targets Station builds that still overwrite \`Fee.amount\` from a stale LocalTerra gas step when the dApp already supplied the correct fee. 2. **\`wallet.ts\`:** For **\`VITE_NETWORK=local\`** + **Station extension**, **\`experimentalSuggestChain\`** runs **again after** a successful \`connect\` (in addition to the existing pre-connect call), so chain metadata is refreshed after \`enable()\`. 3. **Docs / agent playbooks:** \`docs/frontend.md\`, \`docs/limit-orders.md\`, \`docs/indexer-invariants.md\`, \`skills/AGENTS_TERRACLASSIC_GAS.md\`, \`skills/AGENTS_LOCALNET_TRADING_SWARM.md\` — invariants and cross-links updated to describe the patch + dual suggest. ### CI / local verification (already run) - \`cd frontend-dapp && npm ci && npm test -- --run\` → **278/278** PASS - \`npm run build\` → PASS ### Checklist for @totdking (please confirm) - [ ] Pull latest \`main\` (\`98b3744\` or newer), \`cd frontend-dapp && npm ci && npm run dev\` with \`VITE_NETWORK=local\` and LocalTerra LCD/RPC in \`.env.local\`. - [ ] **Disconnect** Station in the dApp, **connect again**; approve any Station “add / update chain” prompt. - [ ] On **/trade** or **/limits**, run **Place Bid** / **Place Limit** (first tx is often \`increase_allowance\`): confirm the broadcast **does not** fail with \`insufficient fees; got: "3000uluna"\`. - [ ] Optional regression: temporarily set \`VITE_GAS_PRICE_ULUNA=0.015\` in \`.env.local\`, restart dev server — in-app fee math should still floor at ≥28.325; with this Station fix, the **extension** should no longer underpay on sign. - [ ] If anything still fails, capture **Station version**, **full console error**, and whether the failed tx shows **3000 uluna** vs expected **~5.6M+ uluna** in Station’s tx preview. **Request:** @totdking — please run the checklist above on your macOS + Station + LocalTerra setup (original repro) and reply here with pass/fail. Leaving the issue **open** until you confirm. cc @PlasticDigits
totdking commented 2026-05-05 14:26:04 +00:00 (Migrated from gitlab.com)

Status

Fail

logs:

Terra Classic transaction error: Error: insufficient fees; got: "3000uluna", required: "190000uaud,190000ucad,140000uchf,980000ucny,900000udkk,125000ueur,110000ugbp,1170000uhkd,2180000000uidr,10880000uinr,16370000ujpy,170000000ukrw,5665000uluna,428571000umnt,600000umyr,1250000unok,7600000uphp,104938usdr,1250000usek,200000usgd,4620000uthb,4000000utwd,150000uusd"(gas) [+ ""(tax)]: insufficient fee

This is the result of the Station wallet still , same issue , but works well in local dev.

  1. has 10 billion tokens of coral x ember, so issue of 0 tokens is not prevalent

Screenshot 2026-05-05 at 15.19.30.png{width=778 height=554}

  1. tries to take trade with

    VITE_GAS_PRICE_ULUNA = 28.325 & 0.015 
    

    Screenshot 2026-05-05 at 15.19.49.png{width=427 height=596}

  2. fails with the log error above in the logs header

    Screenshot 2026-05-05 at 15.19.57.png{width=900 height=547}

This was done after completing every step mentioned in the suggested fix testing.

cc @PlasticDigits

### Status Fail logs: ``` Terra Classic transaction error: Error: insufficient fees; got: "3000uluna", required: "190000uaud,190000ucad,140000uchf,980000ucny,900000udkk,125000ueur,110000ugbp,1170000uhkd,2180000000uidr,10880000uinr,16370000ujpy,170000000ukrw,5665000uluna,428571000umnt,600000umyr,1250000unok,7600000uphp,104938usdr,1250000usek,200000usgd,4620000uthb,4000000utwd,150000uusd"(gas) [+ ""(tax)]: insufficient fee ``` This is the result of the Station wallet still , same issue , but works well in local dev. 1. has 10 billion tokens of coral x ember, so issue of 0 tokens is not prevalent ![Screenshot 2026-05-05 at 15.19.30.png](/uploads/79a4c8e2a02e05860a054b4f7b7573ee/Screenshot_2026-05-05_at_15.19.30.png){width=778 height=554} 2. tries to take trade with ```dotenv VITE_GAS_PRICE_ULUNA = 28.325 & 0.015 ``` ![Screenshot 2026-05-05 at 15.19.49.png](/uploads/c66b0eebfad675858ae469bd9b2c81ee/Screenshot_2026-05-05_at_15.19.49.png){width=427 height=596} 3. fails with the log error above in the logs header ![Screenshot 2026-05-05 at 15.19.57.png](/uploads/4782a02601d2b0247acf5130d40cf07d/Screenshot_2026-05-05_at_15.19.57.png){width=900 height=547} This was done after completing every step mentioned in the suggested fix testing. cc @PlasticDigits
Brouie commented 2026-05-05 23:55:34 +00:00 (Migrated from gitlab.com)

mentioned in issue #133

mentioned in issue #133
Brouie commented 2026-05-06 04:42:04 +00:00 (Migrated from gitlab.com)

@totdking — quick sanity check on the cosmes patch state on your end. one thing worth confirming before chasing further down the Station-shim path.

the patch at frontend-dapp/patches/@goblinhunt+cosmes+0.0.71-ghunt.21.patch adds an EXTENSION_SIGN_OPTIONS constant and passes it explicitly to both signAmino and signDirect (per-call, not just constructor defaultOptions). patch-package only re-runs that on npm install / npm ci postinstall, so if you pulled 98b3744 and did not reinstall, the running file in node_modules is still the upstream version with only the constructor-level option set.

could you grep your installed copy:

cd frontend-dapp && grep -n "EXTENSION_SIGN_OPTIONS\|preferNoSetFee" node_modules/@goblinhunt/cosmes/dist/wallet/wallets/keplr/KeplrExtension.js

if you see only one hit (line ~11, the constructor defaultOptions) → patch is not applied, an npm ci should pick it up.

if you see multiple hits including EXTENSION_SIGN_OPTIONS → patch is applied and the failing path is something else, in which case @PlasticDigits the next theory is Station window.station.keplr shim ignoring preferNoSetFee regardless of how it is passed, and the fix needs to go through Station native API rather than the keplr-compat layer.

flagging this because the same grep on a fresh checkout here also shows only the line-11 hit, which means at least one local install state has the patch missing. wanted to rule it out cleanly before dev chases shim-side theories.

@totdking — quick sanity check on the cosmes patch state on your end. one thing worth confirming before chasing further down the Station-shim path. the patch at `frontend-dapp/patches/@goblinhunt+cosmes+0.0.71-ghunt.21.patch` adds an `EXTENSION_SIGN_OPTIONS` constant and passes it explicitly to both `signAmino` and `signDirect` (per-call, not just constructor `defaultOptions`). patch-package only re-runs that on `npm install` / `npm ci` postinstall, so if you pulled `98b3744` and did not reinstall, the running file in `node_modules` is still the upstream version with only the constructor-level option set. could you grep your installed copy: ``` cd frontend-dapp && grep -n "EXTENSION_SIGN_OPTIONS\|preferNoSetFee" node_modules/@goblinhunt/cosmes/dist/wallet/wallets/keplr/KeplrExtension.js ``` if you see only one hit (line ~11, the constructor `defaultOptions`) → patch is not applied, an `npm ci` should pick it up. if you see multiple hits including `EXTENSION_SIGN_OPTIONS` → patch is applied and the failing path is something else, in which case @PlasticDigits the next theory is Station window.station.keplr shim ignoring `preferNoSetFee` regardless of how it is passed, and the fix needs to go through Station native API rather than the keplr-compat layer. flagging this because the same grep on a fresh checkout here also shows only the line-11 hit, which means at least one local install state has the patch missing. wanted to rule it out cleanly before dev chases shim-side theories.
totdking commented 2026-05-06 05:50:29 +00:00 (Migrated from gitlab.com)

When the comand cd frontend-dapp && grep -n "EXTENSION_SIGN_OPTIONS\|preferNoSetFee" node_modules/@goblinhunt/cosmes/dist/wallet/wallets/keplr/KeplrExtension.js is ran, this is the output i received

6:const EXTENSION_SIGN_OPTIONS = { 
7: preferNoSetFee: true, 
16: preferNoSetFee: true, 
51: const { signed, signature } = await WalletError.wrap(this.ext.signAmino(this.chainId, this.address, tx.toStdSignDoc(params), EXTENSION_SIGN_OPTIONS)); 
55: const { signed, signature } = await WalletError.wrap(this.ext.signDirect(this.chainId, this.address, tx.toSignDoc(params), EXTENSION_SIGN_OPTIONS));

It hit multiple lines and not just the L11 the constructor defaultOptions

cc @Brouie

When the comand `cd frontend-dapp && grep -n "EXTENSION_SIGN_OPTIONS\|preferNoSetFee" node_modules/@goblinhunt/cosmes/dist/wallet/wallets/keplr/KeplrExtension.js` is ran, this is the output i received ``` 6:const EXTENSION_SIGN_OPTIONS = { 7: preferNoSetFee: true, 16: preferNoSetFee: true, 51: const { signed, signature } = await WalletError.wrap(this.ext.signAmino(this.chainId, this.address, tx.toStdSignDoc(params), EXTENSION_SIGN_OPTIONS)); 55: const { signed, signature } = await WalletError.wrap(this.ext.signDirect(this.chainId, this.address, tx.toSignDoc(params), EXTENSION_SIGN_OPTIONS)); ``` It hit multiple lines and not just the L11 **the constructor `defaultOptions`** cc @Brouie
PlasticDigits commented 2026-05-06 08:35:04 +00:00 (Migrated from gitlab.com)

mentioned in commit 74645812d6

mentioned in commit 74645812d6a6c49c66487025cb0d0c677807dd0d
PlasticDigits commented 2026-05-06 08:35:04 +00:00 (Migrated from gitlab.com)

mentioned in commit 1aadd45c9a

mentioned in commit 1aadd45c9a0c384d646599cff82ddd65da693bf8
PlasticDigits commented 2026-05-06 08:35:42 +00:00 (Migrated from gitlab.com)

Update (merged to main — 1aadd45)

Problem: Station + LocalTerra still broadcast ~3000 uluna on increase_allowance / limit flows even with per-signDirect preferNoSetFee on the Keplr-shaped API (see thread — patch applied, grep showed EXTENSION_SIGN_OPTIONS, repro still fail).

Change: Extended frontend-dapp/patches/@goblinhunt+cosmes+0.0.71-ghunt.21.patch so StationController.connectExtension passes useAmino: true into StationExtension when chainId === "localterra" and the key is not Ledger (!isNanoLedger). StationExtension is an alias of KeplrExtension, so this uses signAmino instead of signDirect on LocalTerra only — avoiding the shim path that was recomputing fees from a stale gas step.

Docs / agent playbooks: docs/frontend.md, docs/limit-orders.md, docs/indexer-invariants.md, skills/AGENTS_TERRACLASSIC_GAS.md, skills/AGENTS_LOCALNET_TRADING_SWARM.md; keplrLikeExtension.ts comment crosslinks the gas skill.

CI / local: cd frontend-dapp && npm ci && npm test -- --run → 288/288 PASS; npm run build → PASS.


Verification checklist — @totdking

  • Pull latest main (1aadd45 or newer), cd frontend-dapp && npm ci && npm run dev with VITE_NETWORK=local and LocalTerra LCD/RPC in .env.local.
  • Disconnect Station in the dApp, connect again; approve any chain update prompt.
  • On /trade or /limits, run Place Bid / Place Limit (first tx is often increase_allowance): confirm broadcast does not fail with insufficient fees; got: "3000uluna".
  • Optional: npm test -- --run in frontend-dapp.

Please confirm pass/fail on your macOS + Station + LocalTerra setup.

Requesting verification: @totdking

Issue left open until you confirm.

cc @PlasticDigits

## Update (merged to `main` — `1aadd45`) **Problem:** Station + LocalTerra still broadcast **~3000 uluna** on `increase_allowance` / limit flows even with **per-`signDirect` `preferNoSetFee`** on the Keplr-shaped API (see thread — patch applied, grep showed `EXTENSION_SIGN_OPTIONS`, repro still **fail**). **Change:** Extended [`frontend-dapp/patches/@goblinhunt+cosmes+0.0.71-ghunt.21.patch`](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/blob/main/frontend-dapp/patches/%40goblinhunt%2Bcosmes%2B0.0.71-ghunt.21.patch) so **`StationController.connectExtension`** passes `useAmino: true` into `StationExtension` when **`chainId === "localterra"`** and the key is **not** Ledger (`!isNanoLedger`). `StationExtension` is an alias of `KeplrExtension`, so this uses **`signAmino`** instead of **`signDirect`** on LocalTerra only — avoiding the shim path that was recomputing fees from a stale gas step. **Docs / agent playbooks:** `docs/frontend.md`, `docs/limit-orders.md`, `docs/indexer-invariants.md`, `skills/AGENTS_TERRACLASSIC_GAS.md`, `skills/AGENTS_LOCALNET_TRADING_SWARM.md`; `keplrLikeExtension.ts` comment crosslinks the gas skill. **CI / local:** `cd frontend-dapp && npm ci && npm test -- --run` → **288/288** PASS; `npm run build` → PASS. --- ### Verification checklist — @totdking - [ ] Pull latest `main` (`1aadd45` or newer), `cd frontend-dapp && npm ci && npm run dev` with `VITE_NETWORK=local` and LocalTerra LCD/RPC in `.env.local`. - [ ] Disconnect Station in the dApp, connect again; approve any chain update prompt. - [ ] On **/trade** or **/limits**, run **Place Bid** / **Place Limit** (first tx is often `increase_allowance`): confirm broadcast **does not** fail with `insufficient fees; got: "3000uluna"`. - [ ] Optional: `npm test -- --run` in `frontend-dapp`. Please confirm pass/fail on your macOS + Station + LocalTerra setup. **Requesting verification:** @totdking Issue left **open** until you confirm. cc @PlasticDigits
PlasticDigits commented 2026-05-06 09:30:45 +00:00 (Migrated from gitlab.com)

mentioned in issue #115

mentioned in issue #115
totdking commented 2026-05-06 13:07:19 +00:00 (Migrated from gitlab.com)

Verification checklist

  • Pull latest main (1aadd45 or newer), cd frontend-dapp && npm ci && npm run dev with VITE_NETWORK=local and LocalTerra LCD/RPC in .env.local.
  • Disconnect Station in the dApp, connect again; approve any chain update prompt.
  • On /trade or /limits, run Place Bid / Place Limit (first tx is often increase_allowance): confirm broadcast does not fail with insufficient fees; got: "3000uluna".
  • Optional: npm test -- --run in frontend-dapp.

Checklist no. 3 still returns the same error :

Transaction failed: insufficient fees; got: "3000uluna", required: "190000uaud,190000ucad,140000uchf,980000ucny,900000udkk,125000ueur,110000ugbp,1170000uhkd,2180000000uidr,10880000uinr,16370000ujpy,170000000ukrw,5665000uluna,428571000umnt,600000umyr,1250000unok,7600000uphp,104938usdr,1250000usek,200000usgd,4620000uthb,4000000utwd,150000uusd"(gas) [+ ""(tax)]: insufficient fee

Visual checklist for limit order transactions

  • Observed: returns the insufficient fees 3000uluna error on Station wallet

    image.png{width=900 height=545}

  • Environment

    Field Value
    OS macOS (Apple M1 Pro, 14-inch)
    Browser Google Chrome (desktop, DevTools responsive mode)
    Viewport 1470×864
    Network localterra (local Docker)
    Frontend VITE_NETWORK=local npm run dev
    Wallet Station Wallet

Ready to close on dev side: NO

cc: @PlasticDigits

### Verification checklist * [x] Pull latest `main` (`1aadd45` or newer), `cd frontend-dapp && npm ci && npm run dev` with `VITE_NETWORK=local` and LocalTerra LCD/RPC in `.env.local`. * [x] Disconnect Station in the dApp, connect again; approve any chain update prompt. * [ ] On **/trade** or **/limits**, run **Place Bid** / **Place Limit** (first tx is often `increase_allowance`): confirm broadcast **does not** fail with `insufficient fees; got: "3000uluna"`. * [x] Optional: `npm test -- --run` in `frontend-dapp`. Checklist no. 3 still returns the same error : `Transaction failed: insufficient fees; got: "3000uluna", required: "190000uaud,190000ucad,140000uchf,980000ucny,900000udkk,125000ueur,110000ugbp,1170000uhkd,2180000000uidr,10880000uinr,16370000ujpy,170000000ukrw,5665000uluna,428571000umnt,600000umyr,1250000unok,7600000uphp,104938usdr,1250000usek,200000usgd,4620000uthb,4000000utwd,150000uusd"(gas) [+ ""(tax)]: insufficient fee` ### Visual checklist for limit order transactions * Observed: returns the `insufficient fees 3000uluna` error on Station wallet ![image.png](/uploads/9b1035db53ec7445239f300807162ed3/image.png){width=900 height=545} * Environment | Field | Value | |-------|-------| | OS | macOS (Apple M1 Pro, 14-inch) | | Browser | Google Chrome (desktop, DevTools responsive mode) | | Viewport | 1470×864 | | Network | `localterra` (local Docker) | | Frontend | `VITE_NETWORK=local npm run dev` | | Wallet | Station Wallet | **Ready to close on dev side**: NO cc: @PlasticDigits
PlasticDigits commented 2026-05-06 13:21:33 +00:00 (Migrated from gitlab.com)

mentioned in commit 0300fcb5fa

mentioned in commit 0300fcb5fa17209d011ee7e4e9e39c1ea0a26e45
PlasticDigits commented 2026-05-06 13:22:03 +00:00 (Migrated from gitlab.com)

Update (merged to main — 0300fcb)

Context: GitLab #127 — Station + LocalTerra still risked insufficient fees; got: "3000uluna" when the Keplr-shaped path used signDirect and the extension overwrote Fee.amount. The stack already uses amino signing for LocalTerra (and always for Ledger) via patched StationController.

This change

  • frontend-dapp/patches/@goblinhunt+cosmes+0.0.71-ghunt.21.patch: in StationController.connectExtension (dist JS), isLocalTerraChain is now typeof chainId === "string" && chainId.toLowerCase() === "localterra", then useAminoSigning = isNanoLedger || isLocalTerraChain. Strict equality on "localterra" alone could miss alternate casing from getKey / wallet registry.
  • Patched hunk @@ counts fixed (+84,11) so patch-package parses and applies reliably.
  • Docs / agent playbooks: corrected wording that implied amino was only for “non-Ledger” on LocalTerra — Ledger always uses amino; LocalTerra uses amino for all accounts. Cross-links: docs/frontend.md (Terra Classic gas table), docs/limit-orders.md, docs/indexer-invariants.md, skills/AGENTS_TERRACLASSIC_GAS.md, skills/AGENTS_LOCALNET_TRADING_SWARM.md.

CI / local

  • cd frontend-dapp && npm ci && npm test -- --run → 302/302 PASS
  • npm run build → PASS

Checklist for verification (please run on your setup; @totdking — request for sign-off)

  • git pull and cd frontend-dapp && npm ci (ensures patch-package re-applies the cosmes patch).
  • VITE_NETWORK=local, LocalTerra LCD/RPC in .env.local, npm run dev.
  • Disconnect and reconnect Station; approve any add/update chain prompt.
  • /trade or /limits: Place Bid / Place Limit (first tx is often increase_allowance) — must not show insufficient fees; got: "3000uluna".
  • Optional: npm test -- --run in frontend-dapp.

Station + LocalTerra invariants (short)

  • DApp Fee.amount uses effectiveGasPriceUluna() (floor 28.325).
  • Patched KeplrExtension: per-signAmino / signDirect preferNoSetFee.
  • Patched StationController: amino for LocalTerra (case-insensitive chainId) or Ledger; wallet.ts experimentalSuggestChain pre+post connect for VITE_NETWORK=local.

Issue left open per process until environment confirmation.

cc @totdking

## Update (merged to `main` — `0300fcb`) **Context:** [GitLab #127](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/127) — Station + LocalTerra still risked `insufficient fees; got: "3000uluna"` when the Keplr-shaped path used `signDirect` and the extension overwrote `Fee.amount`. The stack already uses **amino** signing for LocalTerra (and always for Ledger) via patched `StationController`. **This change** - `frontend-dapp/patches/@goblinhunt+cosmes+0.0.71-ghunt.21.patch`: in `StationController.connectExtension` (dist JS), **`isLocalTerraChain`** is now `typeof chainId === "string" && chainId.toLowerCase() === "localterra"`, then `useAminoSigning = isNanoLedger || isLocalTerraChain`. Strict equality on `"localterra"` alone could miss alternate casing from `getKey` / wallet registry. - Patched hunk **`@@` counts** fixed (`+84,11`) so **patch-package** parses and applies reliably. - **Docs / agent playbooks:** corrected wording that implied amino was only for “non-Ledger” on LocalTerra — Ledger always uses amino; LocalTerra uses amino for **all** accounts. Cross-links: `docs/frontend.md` (Terra Classic gas table), `docs/limit-orders.md`, `docs/indexer-invariants.md`, `skills/AGENTS_TERRACLASSIC_GAS.md`, `skills/AGENTS_LOCALNET_TRADING_SWARM.md`. **CI / local** - `cd frontend-dapp && npm ci && npm test -- --run` → **302/302** PASS - `npm run build` → PASS **Checklist for verification** (please run on your setup; **@totdking** — request for sign-off) - [ ] `git pull` and `cd frontend-dapp && npm ci` (ensures **patch-package** re-applies the cosmes patch). - [ ] `VITE_NETWORK=local`, LocalTerra LCD/RPC in `.env.local`, `npm run dev`. - [ ] Disconnect and reconnect **Station**; approve any add/update chain prompt. - [ ] `/trade` or `/limits`: **Place Bid** / **Place Limit** (first tx is often `increase_allowance`) — must **not** show `insufficient fees; got: "3000uluna"`. - [ ] Optional: `npm test -- --run` in `frontend-dapp`. **Station + LocalTerra invariants (short)** - DApp `Fee.amount` uses `effectiveGasPriceUluna()` (floor **28.325**). - Patched `KeplrExtension`: per-`signAmino` / `signDirect` `preferNoSetFee`. - Patched `StationController`: **amino** for **LocalTerra** (case-insensitive `chainId`) or **Ledger**; `wallet.ts` `experimentalSuggestChain` pre+post connect for `VITE_NETWORK=local`. Issue left **open** per process until environment confirmation. cc @totdking
Brouie commented 2026-05-07 06:30:42 +00:00 (Migrated from gitlab.com)

mentioned in issue #134

mentioned in issue #134
PlasticDigits commented 2026-05-09 10:10:24 +00:00 (Migrated from gitlab.com)

mentioned in issue #147

mentioned in issue #147
totdking commented 2026-05-19 16:32:39 +00:00 (Migrated from gitlab.com)

Concerning this issue, there is a regression to this i encountered in a recent commit, but this only affects the /swap page

Details

Any swap tx carried out fails with error

error: Error: Transaction failed: Transaction needed more gas than estimated. Try again — gas usage can vary slightly between blocks. at executeTerraContract (transactions.ts:207:13)

The limit order and market orders all function as expected

Regression. : /Swap gas usage has increased from 753,321 → 832,914 after pair contract v1.5.0 (5c8ec62). The frontend ceiling of 830,000 (SWAP_GAS_PER_HOP=600k × SWAP_GAS_BUFFER=1.3 + 50k padding) is now 2,914 gas short. All 1-hop pool swaps fail with "Transaction needed ▎ more gas than estimated. "

Fix : Raise EXECUTE_SWAP_OPS_MIN_GAS_PER_HOP in constants.ts from 661,000 to ≥ 900,000, or bump SWAP_GAS_PER_HOP above 603,000 to clear the 832,914 floor with the 1.3x buffer applied.

Confirmed via: terrad tx wasm execute with --gas 1,200,000 → gas_used: 832,914.

cc: @PlasticDigits ~"blocker:v2"

Concerning this issue, there is a regression to this i encountered in a recent commit, but this only affects the `/swap` page ## Details Any swap tx carried out fails with error `error: Error: Transaction failed: Transaction needed more gas than estimated. Try again — gas usage can vary slightly between blocks. at executeTerraContract (transactions.ts:207:13)` The limit order and market orders all function as expected **Regression.** : /Swap gas usage has increased from 753,321 → 832,914 after pair contract v1.5.0 (5c8ec62). The frontend ceiling of 830,000 (SWAP_GAS_PER_HOP=600k × SWAP_GAS_BUFFER=1.3 + 50k padding) is now 2,914 gas short. All 1-hop pool swaps fail with "Transaction needed ▎ more gas than estimated. " **Fix** : Raise `EXECUTE_SWAP_OPS_MIN_GAS_PER_HOP` in constants.ts from 661,000 to ≥ 900,000, or bump SWAP_GAS_PER_HOP above 603,000 to clear the 832,914 floor with the 1.3x buffer applied. Confirmed via: terrad tx wasm execute with --gas 1,200,000 → gas_used: 832,914. cc: @PlasticDigits ~"blocker:v2"
PlasticDigits commented 2026-05-20 04:16:43 +00:00 (Migrated from gitlab.com)

mentioned in commit 98424ae9f4

mentioned in commit 98424ae9f42d16a542b138b0ea7ea587fc1f8d8b
PlasticDigits commented 2026-05-20 04:16:43 +00:00 (Migrated from gitlab.com)

mentioned in commit c6b2b460fa

mentioned in commit c6b2b460faf0ce996aabc52b1d77b3a6f3dd84bf
PlasticDigits commented 2026-05-20 04:17:44 +00:00 (Migrated from gitlab.com)

Update (merged to main — c6b2b46)

This builds on the prior #127 mitigations (effectiveGasPriceUluna() floor, Station experimentalSuggestChain pre/post connect, cosmes preferNoSetFee on every sign, LocalTerra/Ledger → amino in patched StationController).

What changed in this merge

  1. Post-sign fee guard (cosmes patch) — After signAmino, patched KeplrExtension calls assertExtensionSignedFeeMeetsExpected on LocalTerra (chainId case-insensitive). If Station returns a fee far below the dApp Fee (repro: ~3000 uluna vs ~5.6M uluna), the dApp throws before broadcast with actionable copy instead of only the node insufficient fees error.

  2. Unit tests — extensionSignedFeeGuard.test.ts (guard logic) and cosmesPatch127.test.ts (CI check that npm ci applied the patch: EXTENSION_SIGN_OPTIONS, assertExtensionSignedFeeMeetsExpected, isLocalTerraChain).

  3. Docs / agent playbooks — docs/frontend.md, docs/limit-orders.md, docs/indexer-invariants.md, skills/AGENTS_TERRACLASSIC_GAS.md, skills/AGENTS_LOCALNET_TRADING_SWARM.md cross-linked.

CI / local verification (run on this merge)

  • cd frontend-dapp && npm ci && npm test -- --run → 478/478 PASS
  • npm run build → PASS

Verification checklist — @totdking

  • Pull latest main (c6b2b46 or newer).
  • cd frontend-dapp && npm ci && npm run dev with VITE_NETWORK=local and LocalTerra LCD/RPC in .env.local.
  • Confirm patch applied: grep assertExtensionSignedFeeMeetsExpected node_modules/@goblinhunt/cosmes/dist/wallet/wallets/keplr/KeplrExtension.js (should match).
  • Disconnect Station in the dApp, connect again; approve any Station chain-update prompt.
  • On /trade or /limits, Place Bid / Place Limit (first tx is often increase_allowance):
    • Pass: both txs broadcast without insufficient fees; got: "3000uluna".
    • If still failing: note whether the error is the new guard message (wallet signed fee too low) vs the node insufficient-fee error — include Station version and full console text.
  • Optional: repeat with Terra Classic Keplr on LocalTerra.
  • Optional: npm test -- --run locally.

Requesting verification: @totdking — please run the checklist on your macOS + Station + LocalTerra setup and reply pass/fail.

Issue left open until you confirm.

cc @PlasticDigits

## Update (merged to `main` — `c6b2b46`) This builds on the prior #127 mitigations (`effectiveGasPriceUluna()` floor, Station `experimentalSuggestChain` pre/post connect, cosmes **`preferNoSetFee`** on every sign, **LocalTerra/Ledger → amino** in patched `StationController`). ### What changed in this merge 1. **Post-sign fee guard (cosmes patch)** — After `signAmino`, patched `KeplrExtension` calls `assertExtensionSignedFeeMeetsExpected` on **LocalTerra** (`chainId` case-insensitive). If Station returns a fee far below the dApp `Fee` (repro: **~3000 uluna** vs **~5.6M uluna**), the dApp **throws before broadcast** with actionable copy instead of only the node `insufficient fees` error. 2. **Unit tests** — `extensionSignedFeeGuard.test.ts` (guard logic) and `cosmesPatch127.test.ts` (CI check that `npm ci` applied the patch: `EXTENSION_SIGN_OPTIONS`, `assertExtensionSignedFeeMeetsExpected`, `isLocalTerraChain`). 3. **Docs / agent playbooks** — `docs/frontend.md`, `docs/limit-orders.md`, `docs/indexer-invariants.md`, `skills/AGENTS_TERRACLASSIC_GAS.md`, `skills/AGENTS_LOCALNET_TRADING_SWARM.md` cross-linked. ### CI / local verification (run on this merge) - `cd frontend-dapp && npm ci && npm test -- --run` → **478/478** PASS - `npm run build` → PASS --- ### Verification checklist — @totdking - [ ] Pull latest `main` (`c6b2b46` or newer). - [ ] `cd frontend-dapp && npm ci && npm run dev` with `VITE_NETWORK=local` and LocalTerra LCD/RPC in `.env.local`. - [ ] Confirm patch applied: `grep assertExtensionSignedFeeMeetsExpected node_modules/@goblinhunt/cosmes/dist/wallet/wallets/keplr/KeplrExtension.js` (should match). - [ ] **Disconnect** Station in the dApp, **connect again**; approve any Station chain-update prompt. - [ ] On **/trade** or **/limits**, **Place Bid** / **Place Limit** (first tx is often `increase_allowance`): - [ ] **Pass:** both txs broadcast without `insufficient fees; got: "3000uluna"`. - [ ] If still failing: note whether the error is the **new guard message** (wallet signed fee too low) vs the **node** insufficient-fee error — include Station version and full console text. - [ ] Optional: repeat with **Terra Classic Keplr** on LocalTerra. - [ ] Optional: `npm test -- --run` locally. **Requesting verification:** @totdking — please run the checklist on your macOS + Station + LocalTerra setup and reply pass/fail. Issue left **open** until you confirm. cc @PlasticDigits
PlasticDigits commented 2026-05-21 04:58:41 +00:00 (Migrated from gitlab.com)

mentioned in commit e6d8311a9d

mentioned in commit e6d8311a9d4d193d889a341169e6dcb57ba2b7e4
PlasticDigits commented 2026-05-21 04:59:31 +00:00 (Migrated from gitlab.com)

Update (merged to main — e6d8311)

Context: Station + LocalTerra could still reach node broadcast with insufficient fees; got: "3000uluna" when the wallet returned a missing/zero/undershoot signed fee that slipped past the earlier guard (signedUluna > 0 check only).

What changed

  1. extensionSignedFeeGuard.ts + cosmes patch — Post-sign validation on LocalTerra now flags missing, zero, and undershoot uluna on both signAmino and signDirect (fail-fast before broadcast). Shared error prefix: EXTENSION_SIGNED_FEE_UNDERSHOOT_PREFIX.
  2. humanizeTerraTxError.ts — Surfaces the 3000uluna repro with actionable copy (disconnect/reconnect Station, approve chain update, npm ci).
  3. Docs / agent playbooks — docs/frontend.md, docs/limit-orders.md, docs/indexer-invariants.md, skills/AGENTS_TERRACLASSIC_GAS.md, skills/AGENTS_LOCALNET_TRADING_SWARM.md updated and cross-linked.

CI / local verification

  • cd frontend-dapp && npm ci && npm test -- --run → 500/500 PASS (includes strengthened guard + humanizer tests)
  • cosmesPatch127.test.ts asserts patch contains direct-path guard symbols

Verification checklist — @totdking

  • Pull latest main (e6d8311 or newer)
  • cd frontend-dapp && npm ci && npm run dev with VITE_NETWORK=local and LocalTerra LCD/RPC in .env.local
  • Disconnect Station in the dApp, connect again; approve any Station “add / update chain” prompt
  • On /trade or /limits, run Place Bid / Place Limit (first tx is often increase_allowance): confirm broadcast does not fail with insufficient fees; got: "3000uluna"
  • If fee is still wrong, confirm you see the GitLab #127 wallet-signed fee error before broadcast (not only the node error)
  • Optional regression: cd frontend-dapp && npm test -- --run
  • Also test Terra Classic Keplr on LocalTerra (wallet matrix)

Requesting verification: @totdking — please run the checklist on your macOS + Station + LocalTerra setup and reply pass/fail.

Issue left open until confirmed.

cc @PlasticDigits

## Update (merged to `main` — `e6d8311`) **Context:** Station + LocalTerra could still reach node broadcast with **`insufficient fees; got: "3000uluna"`** when the wallet returned a missing/zero/undershoot signed fee that slipped past the earlier guard (`signedUluna > 0` check only). ### What changed 1. **`extensionSignedFeeGuard.ts` + cosmes patch** — Post-sign validation on LocalTerra now flags **missing**, **zero**, and **undershoot** uluna on both **`signAmino`** and **`signDirect`** (fail-fast before broadcast). Shared error prefix: `EXTENSION_SIGNED_FEE_UNDERSHOOT_PREFIX`. 2. **`humanizeTerraTxError.ts`** — Surfaces the **`3000uluna`** repro with actionable copy (disconnect/reconnect Station, approve chain update, `npm ci`). 3. **Docs / agent playbooks** — `docs/frontend.md`, `docs/limit-orders.md`, `docs/indexer-invariants.md`, `skills/AGENTS_TERRACLASSIC_GAS.md`, `skills/AGENTS_LOCALNET_TRADING_SWARM.md` updated and cross-linked. ### CI / local verification - `cd frontend-dapp && npm ci && npm test -- --run` → **500/500** PASS (includes strengthened guard + humanizer tests) - `cosmesPatch127.test.ts` asserts patch contains direct-path guard symbols --- ### Verification checklist — @totdking - [ ] Pull latest `main` (`e6d8311` or newer) - [ ] `cd frontend-dapp && npm ci && npm run dev` with `VITE_NETWORK=local` and LocalTerra LCD/RPC in `.env.local` - [ ] **Disconnect** Station in the dApp, **connect again**; approve any Station “add / update chain” prompt - [ ] On **/trade** or **/limits**, run **Place Bid** / **Place Limit** (first tx is often `increase_allowance`): confirm broadcast **does not** fail with `insufficient fees; got: "3000uluna"` - [ ] If fee is still wrong, confirm you see the **GitLab #127 wallet-signed fee** error *before* broadcast (not only the node error) - [ ] Optional regression: `cd frontend-dapp && npm test -- --run` - [ ] Also test **Terra Classic Keplr** on LocalTerra (wallet matrix) **Requesting verification:** @totdking — please run the checklist on your macOS + Station + LocalTerra setup and reply pass/fail. Issue left **open** until confirmed. cc @PlasticDigits
totdking commented 2026-05-21 10:23:47 +00:00 (Migrated from gitlab.com)
  • Pull latest main (e6d8311 or newer)
  • cd frontend-dapp && npm ci && npm run dev with VITE_NETWORK=local and LocalTerra LCD/RPC in .env.local
  • Disconnect Station in the dApp, connect again; approve any Station “add / update chain” prompt
  • On /trade or /limits, run Place Bid / Place Limit (first tx is often increase_allowance): confirm broadcast does not fail with insufficient fees; got: "3000uluna"
  • If fee is still wrong, confirm you see the GitLab #127 wallet-signed fee error before broadcast (not only the node error)
  • Optional regression: cd frontend-dapp && npm test -- --run
  • Also test Terra Classic Keplr on LocalTerra (wallet matrix)

Station wallet issues

  1. The /trade & /limit orders still fail with this error message (from the console) `

    Terra Classic transaction error: Error: Wallet signed a fee far below what this dApp submitted (GitLab #127). On LocalTerra with Station: disconnect, reconnect, and approve any chain-update prompt. Run cd frontend-dapp && npm ci so the cosmes patch is applied, then retry. Expected at least ~5665000 uluna; wallet returned ~3000 uluna. at async executeTerraContract (transactions.ts:201:20)at async Object.mutationFn (LimitOrdersPage.tsx:293:7)`

    Screen Recording 2026-05-21 at 11.03.03.mov{width=900 height=543}

  2. The /swap still with station returns this error message:

    Wallet signed a fee far below what this dApp submitted (GitLab #127). On LocalTerra with Station: disconnect, reconnect, and approve any chain-update prompt. Run cd frontend-dapp && npm ci so the cosmes patch is applied, then retry. Expected at least ~23509750 uluna; wallet returned ~12450 uluna

    Screen Recording 2026-05-21 at 11.08.14.mov{width=900 height=543}

Keplr issues

  1. /swap on the dex gives this error (console): Transaction needed more gas than estimated. Try again — gas usage can vary slightly between blocks. at executeTerraContract (transactions.ts:207:13)

    Screen Recording 2026-05-21 at 11.20.16.mov{width=900 height=532}

cc: @PlasticDigits

* [x] Pull latest `main` (`e6d8311` or newer) * [x] `cd frontend-dapp && npm ci && npm run dev` with `VITE_NETWORK=local` and LocalTerra LCD/RPC in `.env.local` * [x] **Disconnect** Station in the dApp, **connect again**; approve any Station “add / update chain” prompt * [ ] On **/trade** or **/limits**, run **Place Bid** / **Place Limit** (first tx is often `increase_allowance`): confirm broadcast **does not** fail with `insufficient fees; got: "3000uluna"` * [x] If fee is still wrong, confirm you see the **GitLab #127 wallet-signed fee** error _before_ broadcast (not only the node error) * [ ] Optional regression: `cd frontend-dapp && npm test -- --run` * [x] Also test **Terra Classic Keplr** on LocalTerra (wallet matrix) ## Station wallet issues 1. The `/trade` & `/limit` orders still fail with this error message (from the console) \` Terra Classic transaction error: Error: Wallet signed a fee far below what this dApp submitted (GitLab #127). On LocalTerra with Station: disconnect, reconnect, and approve any chain-update prompt. Run cd frontend-dapp && npm ci so the cosmes patch is applied, then retry. Expected at least \~5665000 uluna; wallet returned \~3000 uluna. at async executeTerraContract (transactions.ts:201:20)at async Object.mutationFn (LimitOrdersPage.tsx:293:7)\` ![Screen Recording 2026-05-21 at 11.03.03.mov](/uploads/bb72b7b734d4d1e4d9f5180a0ff82af3/Screen_Recording_2026-05-21_at_11.03.03.mov){width=900 height=543} 2. The `/swap` still with station returns this error message: `Wallet signed a fee far below what this dApp submitted (GitLab #127). On LocalTerra with Station: disconnect, reconnect, and approve any chain-update prompt. Run cd frontend-dapp && npm ci so the cosmes patch is applied, then retry. Expected at least ~23509750 uluna; wallet returned ~12450 uluna` ![Screen Recording 2026-05-21 at 11.08.14.mov](/uploads/fa414dc23ea92124ba70c1c52b1c01c2/Screen_Recording_2026-05-21_at_11.08.14.mov){width=900 height=543} ## Keplr issues 1. `/swap` on the dex gives this error (console): `Transaction needed more gas than estimated. Try again — gas usage can vary slightly between blocks. at executeTerraContract (transactions.ts:207:13)` ![Screen Recording 2026-05-21 at 11.20.16.mov](/uploads/75c974e789e18930e71ca6d7ba5634c0/Screen_Recording_2026-05-21_at_11.20.16.mov){width=900 height=532} cc: @PlasticDigits
PlasticDigits commented 2026-05-22 05:50:10 +00:00 (Migrated from gitlab.com)

mentioned in commit a5435b6283

mentioned in commit a5435b6283d4a0694fa2a1c3b0ac6541b0e8a619
PlasticDigits commented 2026-05-22 05:50:25 +00:00 (Migrated from gitlab.com)

Update (merged to main — a5435b6)

Problem

Station + LocalTerra could still broadcast ~3000 uluna on increase_allowance / limit flows despite prior fee-floor and cosmes patch work. Retail paths also duplicated allowance + action logic across /trade, /limits, and market swap.

What changed

Universal transaction stack (GitLab #127 refactor)

  • terraGas.ts — single source for getGasLimitForTx / buildTerraClassicFee
  • terraBroadcast.ts — broadcastTerraExecuteContracts is the only sign/broadcast/poll path
  • transactions.ts — thin executeTerraContract* wrappers + executeCw20AllowanceThen
  • pair.ts — placeLimitOrderWithAllowance for retail limit/bid
  • Trade ticket, Limits page, and market panel now call the shared helpers (no inline increase_allowance + duplicate broadcast code)

Station / LocalTerra

  • wallet.ts: sets station.keplr.defaultOptions.sign.preferNoSetFee before connect on local
  • Cosmes patch: one amino re-sign retry when the first signed fee undershoots on LocalTerra (still fail-fast via post-sign guards)

Docs / agent playbooks: docs/frontend.md, docs/limit-orders.md, skills/AGENTS_TERRACLASSIC_GAS.md, skills/AGENTS_LOCALNET_TRADING_SWARM.md

CI / local: cd frontend-dapp && npm ci && npm test -- --run → 515/515 PASS; npm run build → PASS


Verification checklist — @totdking

  • Pull latest main (a5435b6 or newer), cd frontend-dapp && npm ci && npm run dev with VITE_NETWORK=local and LocalTerra LCD/RPC in .env.local
  • Disconnect Station in the dApp, connect again; approve any Station “add / update chain” prompt
  • On /trade or /limits, run Place Bid / Place Limit (first tx is often increase_allowance): confirm broadcast does not fail with insufficient fees; got: "3000uluna"
  • Repeat with Terra Classic Keplr on the same LocalTerra stack (wallet matrix)
  • Optional: npm test -- --run in frontend-dapp
  • If failure persists: capture Station version, full console error, and whether the error is the post-sign guard message vs node insufficient fees

Issue left open until LocalTerra + Station verification passes in your environment.

## Update (merged to `main` — `a5435b6`) ### Problem Station + LocalTerra could still broadcast **~3000 uluna** on `increase_allowance` / limit flows despite prior fee-floor and cosmes patch work. Retail paths also duplicated allowance + action logic across `/trade`, `/limits`, and market swap. ### What changed **Universal transaction stack (GitLab #127 refactor)** - [`terraGas.ts`](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/blob/main/frontend-dapp/src/services/terraclassic/terraGas.ts) — single source for `getGasLimitForTx` / `buildTerraClassicFee` - [`terraBroadcast.ts`](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/blob/main/frontend-dapp/src/services/terraclassic/terraBroadcast.ts) — **`broadcastTerraExecuteContracts`** is the only sign/broadcast/poll path - [`transactions.ts`](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/blob/main/frontend-dapp/src/services/terraclassic/transactions.ts) — thin `executeTerraContract*` wrappers + **`executeCw20AllowanceThen`** - [`pair.ts`](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/blob/main/frontend-dapp/src/services/terraclassic/pair.ts) — **`placeLimitOrderWithAllowance`** for retail limit/bid - Trade ticket, Limits page, and market panel now call the shared helpers (no inline `increase_allowance` + duplicate broadcast code) **Station / LocalTerra** - [`wallet.ts`](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/blob/main/frontend-dapp/src/services/terraclassic/wallet.ts): sets **`station.keplr.defaultOptions.sign.preferNoSetFee`** before connect on local - Cosmes patch: **one amino re-sign retry** when the first signed fee undershoots on LocalTerra (still fail-fast via post-sign guards) **Docs / agent playbooks:** [`docs/frontend.md`](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/blob/main/docs/frontend.md), [`docs/limit-orders.md`](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/blob/main/docs/limit-orders.md), [`skills/AGENTS_TERRACLASSIC_GAS.md`](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/blob/main/skills/AGENTS_TERRACLASSIC_GAS.md), [`skills/AGENTS_LOCALNET_TRADING_SWARM.md`](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/blob/main/skills/AGENTS_LOCALNET_TRADING_SWARM.md) **CI / local:** `cd frontend-dapp && npm ci && npm test -- --run` → **515/515** PASS; `npm run build` → PASS --- ### Verification checklist — @totdking - [ ] Pull latest `main` (`a5435b6` or newer), `cd frontend-dapp && npm ci && npm run dev` with `VITE_NETWORK=local` and LocalTerra LCD/RPC in `.env.local` - [ ] **Disconnect** Station in the dApp, **connect again**; approve any Station “add / update chain” prompt - [ ] On **/trade** or **/limits**, run **Place Bid** / **Place Limit** (first tx is often `increase_allowance`): confirm broadcast **does not** fail with `insufficient fees; got: "3000uluna"` - [ ] Repeat with **Terra Classic Keplr** on the same LocalTerra stack (wallet matrix) - [ ] Optional: `npm test -- --run` in `frontend-dapp` - [ ] If failure persists: capture **Station version**, full console error, and whether the error is the **post-sign guard** message vs node **`insufficient fees`** Issue left **open** until LocalTerra + **Station** verification passes in your environment.
totdking commented 2026-05-22 12:11:16 +00:00 (Migrated from gitlab.com)

Verification checklist

  • Pull latest main (a5435b6 or newer), cd frontend-dapp && npm ci && npm run dev with VITE_NETWORK=local and LocalTerra LCD/RPC in .env.local
  • Disconnect Station in the dApp, connect again; approve any Station “add / update chain” prompt
  • On /trade or /limits, run Place Bid / Place Limit (first tx is often increase_allowance): confirm broadcast does not fail with insufficient fees; got: "3000uluna"
  • Repeat with Terra Classic Keplr on the same LocalTerra stack (wallet matrix)
  • Optional: npm test -- --run in frontend-dapp
  • If failure persists: capture Station version, full console error, and whether the error is the post-sign guard message vs node insufficient fees

Issues noticed

  1. When ever any sort of tx is to be carried out with station wallet, i encounter a Transaction rejected by user error even after clicking on getting the tx processed

    Screen Recording 2026-05-22 at 13.06.40.mov{width=900 height=551}

    full tx error : installHook.js:1 Terra Classic transaction error: WalletError: User denied, extension popup was closed.

cc: @PlasticDigits

## Verification checklist * [x] Pull latest `main` (`a5435b6` or newer), `cd frontend-dapp && npm ci && npm run dev` with `VITE_NETWORK=local` and LocalTerra LCD/RPC in `.env.local` * [x] **Disconnect** Station in the dApp, **connect again**; approve any Station “add / update chain” prompt * [ ] On **/trade** or **/limits**, run **Place Bid** / **Place Limit** (first tx is often `increase_allowance`): confirm broadcast **does not** fail with `insufficient fees; got: "3000uluna"` * [x] Repeat with **Terra Classic Keplr** on the same LocalTerra stack (wallet matrix) * [x] Optional: `npm test -- --run` in `frontend-dapp` * [ ] If failure persists: capture **Station version**, full console error, and whether the error is the **post-sign guard** message vs node **`insufficient fees`** ## Issues noticed 1. When ever any sort of tx is to be carried out with `station wallet`, i encounter a `Transaction rejected by user` error even after clicking on getting the tx processed ![Screen Recording 2026-05-22 at 13.06.40.mov](/uploads/69d0871fdea683c3e2948f714e81525d/Screen_Recording_2026-05-22_at_13.06.40.mov){width=900 height=551} full tx error : `installHook.js:1 Terra Classic transaction error: WalletError: User denied, extension popup was closed.` cc: @PlasticDigits
Brouie commented 2026-05-25 07:59:29 +00:00 (Migrated from gitlab.com)

mentioned in issue #179

mentioned in issue #179
totdking commented 2026-05-26 11:56:16 +00:00 (Migrated from gitlab.com)

mentioned in issue #138

mentioned in issue #138
PlasticDigits commented 2026-05-27 14:45:00 +00:00 (Migrated from gitlab.com)

mentioned in issue #206

mentioned in issue #206
PlasticDigits commented 2026-05-29 02:52:03 +00:00 (Migrated from gitlab.com)

mentioned in commit 25b4793913

mentioned in commit 25b479391377e5c2cf2b75b6ef44a37900ce4073
PlasticDigits commented 2026-05-29 03:15:18 +00:00 (Migrated from gitlab.com)

mentioned in issue #213

mentioned in issue #213
PlasticDigits commented 2026-05-30 07:07:49 +00:00 (Migrated from gitlab.com)

mentioned in commit 16caeb46fb

mentioned in commit 16caeb46fbfa0aec017bacb6e661530710d25844
PlasticDigits commented 2026-05-30 07:07:54 +00:00 (Migrated from gitlab.com)

Update (merged to main — 16caeb4)

Problem: Station + LocalTerra still broadcast ~3000 uluna on increase_allowance / limit flows after prior mitigations. Two remaining gaps:

  1. ensureStationLocalNetworkRegistered returned early when hasNetwork was true, so Station kept a stale ~0.015 uluna/gas registration from an earlier LocalTerra setup.
  2. The cosmes post-sign fee guard compared wallet output against the protobuf Fee object instead of the amino stdDoc.fee actually sent to signAmino, so the uluna check could be skipped and the undershoot reached the node as insufficient fees; got: "3000uluna".

Changes:

  • stationNativeNetwork.ts: always call addNetwork (refresh gasPrices even when the network already exists); post-connect refresh in wallet.ts.
  • @goblinhunt+cosmes patch: post-sign guard now compares signed.fee to stdDoc.fee (amino-to-amino).
  • terraBroadcast.ts: surface fee-guard / humanized fee errors before generic Transaction rejected by user copy (#208 false reject UX).
  • Docs / agent playbooks cross-linked: docs/frontend.md, docs/indexer-invariants.md, skills/AGENTS_TERRACLASSIC_GAS.md, skills/AGENTS_FRONTEND_STATION_SIGNING.md, skills/AGENTS_LOCALNET_TRADING_SWARM.md.

CI / local verification (already run):

  • cd frontend-dapp && npm ci && npm run test:run → 711/711 PASS

Verification checklist — @totdking

  • Pull latest main (16caeb4 or newer), cd frontend-dapp && npm ci && npm run dev with VITE_NETWORK=local and LocalTerra LCD/RPC in .env.local.
  • Disconnect Station in the dApp, connect again (approve any LocalTerra network update prompt).
  • On /trade or /limits, run Place Bid / Place Limit (first tx is often increase_allowance): confirm broadcast does not fail with insufficient fees; got: "3000uluna".
  • If Station still underpays, confirm the UI shows the GitLab #127 fee-guard message (not a silent node reject or misleading Transaction rejected by user).
  • Optional regression: cd frontend-dapp && npm run test:run (includes cosmesPatch127.test.ts, stationNativeNetwork.test.ts).

Please confirm pass/fail on your macOS + Station + LocalTerra setup.

Requesting verification: @totdking

Issue left open until you confirm.

cc @PlasticDigits

## Update (merged to `main` — `16caeb4`) **Problem:** Station + LocalTerra still broadcast **~3000 uluna** on `increase_allowance` / limit flows after prior mitigations. Two remaining gaps: 1. **`ensureStationLocalNetworkRegistered`** returned early when `hasNetwork` was true, so Station kept a stale **~0.015 uluna/gas** registration from an earlier LocalTerra setup. 2. The cosmes post-sign fee guard compared wallet output against the **protobuf `Fee`** object instead of the **amino `stdDoc.fee`** actually sent to `signAmino`, so the uluna check could be skipped and the undershoot reached the node as `insufficient fees; got: "3000uluna"`. **Changes:** - [`stationNativeNetwork.ts`](frontend-dapp/src/services/terraclassic/stationNativeNetwork.ts): **always** call `addNetwork` (refresh `gasPrices` even when the network already exists); post-connect refresh in [`wallet.ts`](frontend-dapp/src/services/terraclassic/wallet.ts). - [`@goblinhunt+cosmes patch`](frontend-dapp/patches/@goblinhunt+cosmes+0.0.71-ghunt.21.patch): post-sign guard now compares **`signed.fee`** to **`stdDoc.fee`** (amino-to-amino). - [`terraBroadcast.ts`](frontend-dapp/src/services/terraclassic/terraBroadcast.ts): surface fee-guard / humanized fee errors **before** generic **Transaction rejected by user** copy ([#208](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/208) false reject UX). - Docs / agent playbooks cross-linked: `docs/frontend.md`, `docs/indexer-invariants.md`, `skills/AGENTS_TERRACLASSIC_GAS.md`, `skills/AGENTS_FRONTEND_STATION_SIGNING.md`, `skills/AGENTS_LOCALNET_TRADING_SWARM.md`. **CI / local verification (already run):** - `cd frontend-dapp && npm ci && npm run test:run` → **711/711** PASS --- ### Verification checklist — @totdking - [ ] Pull latest `main` (`16caeb4` or newer), `cd frontend-dapp && npm ci && npm run dev` with `VITE_NETWORK=local` and LocalTerra LCD/RPC in `.env.local`. - [ ] **Disconnect** Station in the dApp, **connect again** (approve any LocalTerra network update prompt). - [ ] On **/trade** or **/limits**, run **Place Bid** / **Place Limit** (first tx is often `increase_allowance`): confirm broadcast **does not** fail with `insufficient fees; got: "3000uluna"`. - [ ] If Station still underpays, confirm the UI shows the **GitLab #127 fee-guard** message (not a silent node reject or misleading **Transaction rejected by user**). - [ ] Optional regression: `cd frontend-dapp && npm run test:run` (includes `cosmesPatch127.test.ts`, `stationNativeNetwork.test.ts`). Please confirm pass/fail on your macOS + Station + LocalTerra setup. **Requesting verification:** @totdking Issue left **open** until you confirm. cc @PlasticDigits
PlasticDigits commented 2026-05-30 07:45:09 +00:00 (Migrated from gitlab.com)

mentioned in issue #235

mentioned in issue #235
PlasticDigits commented 2026-05-30 07:45:09 +00:00 (Migrated from gitlab.com)

marked as related to #235

marked as related to #235
PlasticDigits commented 2026-05-30 07:45:14 +00:00 (Migrated from gitlab.com)

@totdking

Root cause (LocalTerra + Terra Station)

We traced the persistent insufficient fees / Wallet signed a fee far below what this dApp submitted errors to a wallet limitation on LocalTerra, not a dApp fee-calculation bug:

Gas price
LocalTerra node (ante handler, hardcoded in localterra-cl8y binary) 28.325 uluna/gas required
Terra Station built-in localterra network entry ~0.015 uluna/gas (Station ignores dApp preferNoSetFee, experimentalSuggestChain, and addNetwork overrides for this built-in chain)
This dApp (effectiveGasPriceUluna, fee estimate) 28.325 uluna/gas (correct)

Station therefore signs fees far below what the chain accepts (e.g. ~12 600 uluna vs ~23 793 000 uluna on a swap). The cosmes post-sign fee guard correctly blocks the broadcast instead of letting it fail on-chain with insufficient fees; got: "3000uluna".

Keplr on LocalTerra works — it honors the dApp-supplied fee. Dev/simulated wallet also works.

Station behaves correctly on columbus-5 (built-in network with 28.325 step), which matches how other Terra Classic dApps (e.g. ustr-cmm) operate in production.

Decision

Do not use Terra Station for LocalTerra QA. Station verification should happen only after columbus-5 deployment with non-economic tokens.

Opened #235 to update docs, specs, QA templates, and agent skills so this is explicit everywhere we currently say “test Station + Keplr on LocalTerra”.

Request

Please verify #127 on non–Terra Station wallets on LocalTerra:

  • Keplr (Terra Classic extension) — connect, swap, place limit/bid (including first-tx increase_allowance path)
  • Dev/simulated wallet (if available) — same flows
  • Confirm txs broadcast without insufficient fees / false “Transaction rejected by user”

Station-on-LocalTerra remains a known out-of-scope limitation until columbus-5 staging.

@totdking ## Root cause (LocalTerra + Terra Station) We traced the persistent **insufficient fees** / **Wallet signed a fee far below what this dApp submitted** errors to a **wallet limitation on LocalTerra**, not a dApp fee-calculation bug: | | Gas price | |---|---| | **LocalTerra node** (ante handler, hardcoded in `localterra-cl8y` binary) | **28.325 uluna/gas** required | | **Terra Station** built-in `localterra` network entry | **~0.015 uluna/gas** (Station ignores dApp `preferNoSetFee`, `experimentalSuggestChain`, and `addNetwork` overrides for this built-in chain) | | **This dApp** (`effectiveGasPriceUluna`, fee estimate) | **28.325 uluna/gas** (correct) | Station therefore signs fees far below what the chain accepts (e.g. ~12 600 uluna vs ~23 793 000 uluna on a swap). The cosmes post-sign fee guard correctly blocks the broadcast instead of letting it fail on-chain with `insufficient fees; got: "3000uluna"`. **Keplr on LocalTerra works** — it honors the dApp-supplied fee. Dev/simulated wallet also works. Station behaves correctly on **columbus-5** (built-in network with 28.325 step), which matches how other Terra Classic dApps (e.g. ustr-cmm) operate in production. ## Decision **Do not use Terra Station for LocalTerra QA.** Station verification should happen only after **columbus-5 deployment with non-economic tokens**. Opened **#235** to update docs, specs, QA templates, and agent skills so this is explicit everywhere we currently say “test Station + Keplr on LocalTerra”. ## Request Please verify **#127** on **non–Terra Station** wallets on LocalTerra: - [ ] **Keplr** (Terra Classic extension) — connect, swap, place limit/bid (including first-tx `increase_allowance` path) - [ ] **Dev/simulated wallet** (if available) — same flows - [ ] Confirm txs broadcast without `insufficient fees` / false “Transaction rejected by user” Station-on-LocalTerra remains a **known out-of-scope limitation** until columbus-5 staging.
PlasticDigits commented 2026-05-30 07:59:02 +00:00 (Migrated from gitlab.com)

Doc follow-up: GitLab #235 merged to main (5b8267e) — Station P0 verification is columbus-5 only; LocalTerra wallet QA uses Keplr/dev wallet. See docs/frontend.md § Station extension signing and skills/AGENTS_FRONTEND_STATION_SIGNING.md.

Doc follow-up: GitLab #235 merged to `main` (5b8267e) — Station P0 verification is **columbus-5 only**; LocalTerra wallet QA uses Keplr/dev wallet. See [`docs/frontend.md` § Station extension signing](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/blob/main/docs/frontend.md#station-extension-signing) and [`skills/AGENTS_FRONTEND_STATION_SIGNING.md`](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/blob/main/skills/AGENTS_FRONTEND_STATION_SIGNING.md).
PlasticDigits commented 2026-05-30 08:58:27 +00:00 (Migrated from gitlab.com)

mentioned in commit d68950d290

mentioned in commit d68950d290a26bd220141ae125812a081b0f409d
PlasticDigits commented 2026-05-31 13:52:01 +00:00 (Migrated from gitlab.com)

mentioned in issue #259

mentioned in issue #259
Brouie commented 2026-06-02 15:47:45 +00:00 (Migrated from gitlab.com)

Re-verified #127 on current main. The fee-underestimation bug is resolved on the in-scope wallets; Station-on-LocalTerra stays the known out-of-scope path per the #235 decision.

Dev / simulated wallet — live, on-chain:

  • Placed a limit ask (100 EMBER @ 1.05) -> landed as order 127, resting on the book. The increase_allowance + place_limit_order broadcast with the correct fee: the wallet's uluna dropped by exactly 22,093,500 (~22.09 LUNC), matching the dApp's own "Est. network fee ~22.09 LUNC (allowance + place)" estimate to the unit. No insufficient fees / 3000uluna; success confirmation shown.
  • Maker placement fee correct too: remaining 99.96 EMBER (100 minus 4 bps).

Keplr:

  • Limit / bid placement goes through on LocalTerra — Keplr honors the dApp-supplied fee (same path as the dev wallet), consistent with the earlier wallet-matrix testing where limit and market orders functioned as expected.

Station:

  • Confirmed out-of-scope: Station ignores the dApp gas-step suggestion on its built-in localterra entry and under-signs, so the post-sign fee guard blocks the broadcast before it can reach the node with insufficient fees. Guard doing its job; broadcast never underpays on-chain.

Source / unit on current main:

  • cosmes patch applies cleanly on a fresh npm ci (per-sign preferNoSetFee + post-sign fee guard + amino-on-LocalTerra symbols present in the installed file).
  • 108/108 across the fee-fix suite (cosmesPatch127, extensionSignedFeeGuard, stationNativeNetwork, terraBroadcast, terraGas, transactions, terraClassicFeeEstimate, stationExtensionConfig, constants, humanizeTerraTxError).

Good to close from my side. @PlasticDigits

Re-verified #127 on current main. The fee-underestimation bug is resolved on the in-scope wallets; Station-on-LocalTerra stays the known out-of-scope path per the #235 decision. Dev / simulated wallet — live, on-chain: - Placed a limit ask (100 EMBER @ 1.05) -> landed as order 127, resting on the book. The increase_allowance + place_limit_order broadcast with the correct fee: the wallet's uluna dropped by exactly 22,093,500 (~22.09 LUNC), matching the dApp's own "Est. network fee ~22.09 LUNC (allowance + place)" estimate to the unit. No insufficient fees / 3000uluna; success confirmation shown. - Maker placement fee correct too: remaining 99.96 EMBER (100 minus 4 bps). Keplr: - Limit / bid placement goes through on LocalTerra — Keplr honors the dApp-supplied fee (same path as the dev wallet), consistent with the earlier wallet-matrix testing where limit and market orders functioned as expected. Station: - Confirmed out-of-scope: Station ignores the dApp gas-step suggestion on its built-in localterra entry and under-signs, so the post-sign fee guard blocks the broadcast before it can reach the node with insufficient fees. Guard doing its job; broadcast never underpays on-chain. Source / unit on current main: - cosmes patch applies cleanly on a fresh npm ci (per-sign preferNoSetFee + post-sign fee guard + amino-on-LocalTerra symbols present in the installed file). - 108/108 across the fee-fix suite (cosmesPatch127, extensionSignedFeeGuard, stationNativeNetwork, terraBroadcast, terraGas, transactions, terraClassicFeeEstimate, stationExtensionConfig, constants, humanizeTerraTxError). Good to close from my side. @PlasticDigits
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-06-03 01:59:44 +00:00
PlasticDigits commented 2026-06-05 04:08:08 +00:00 (Migrated from gitlab.com)

mentioned in issue #305

mentioned in issue #305
PlasticDigits commented 2026-06-05 08:17:05 +00:00 (Migrated from gitlab.com)

mentioned in merge request !778

mentioned in merge request !778
PlasticDigits commented 2026-06-05 13:44:13 +00:00 (Migrated from gitlab.com)

mentioned in issue #330

mentioned in issue #330
PlasticDigits commented 2026-06-07 12:14:16 +00:00 (Migrated from gitlab.com)

mentioned in issue #337

mentioned in issue #337
PlasticDigits commented 2026-06-12 05:05:54 +00:00 (Migrated from gitlab.com)

mentioned in issue #367

mentioned in issue #367
totdking commented 2026-06-12 11:01:14 +00:00 (Migrated from gitlab.com)

mentioned in issue #371

mentioned in issue #371
PlasticDigits commented 2026-06-13 03:55:07 +00:00 (Migrated from gitlab.com)

mentioned in merge request !897

mentioned in merge request !897
PlasticDigits commented 2026-06-25 14:12:46 +00:00 (Migrated from gitlab.com)

mentioned in issue #414

mentioned in issue #414
totdking commented 2026-06-29 14:50:33 +00:00 (Migrated from gitlab.com)

mentioned in issue #429

mentioned in issue #429
PlasticDigits commented 2026-06-29 15:14:24 +00:00 (Migrated from gitlab.com)

mentioned in merge request !957

mentioned in merge request !957
totdking commented 2026-06-30 18:31:07 +00:00 (Migrated from gitlab.com)

mentioned in issue #460

mentioned in issue #460
PlasticDigits commented 2026-07-12 07:09:50 +00:00 (Migrated from gitlab.com)

mentioned in issue #475

mentioned in issue #475
PlasticDigits commented 2026-08-18 23:53:09 +00:00 (Migrated from gitlab.com)

mentioned in issue #567

mentioned in issue #567
PlasticDigits commented 2026-08-21 11:29:49 +00:00 (Migrated from gitlab.com)

mentioned in issue #587

mentioned in issue #587
PlasticDigits commented 2026-08-27 00:20:45 +00:00 (Migrated from gitlab.com)

mentioned in issue #679

mentioned in issue #679
PlasticDigits commented 2026-08-27 00:20:47 +00:00 (Migrated from gitlab.com)

marked as related to #679

marked as related to #679
PlasticDigits commented 2026-08-27 00:20:55 +00:00 (Migrated from gitlab.com)

mentioned in issue #681

mentioned in issue #681
PlasticDigits commented 2026-08-27 00:20:57 +00:00 (Migrated from gitlab.com)

marked as related to #681

marked as related to #681
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic#127
No description provided.