Frontend: getExplorerAddressUrl helper (Terra Classic explorer) #184

Closed
opened 2026-05-25 02:13:22 +00:00 by PlasticDigits · 12 comments
PlasticDigits commented 2026-05-25 02:13:22 +00:00 (Migrated from gitlab.com)

Summary

Add getExplorerAddressUrl(address) (or equivalent) alongside existing getExplorerTxUrl. Required before “View on explorer” in the wallet chip dropdown (#140 scope B).

Acceptance criteria

  • Network-aware URLs for mainnet / testnet / local (VITE_NETWORK / constants).
  • Vitest for each network branch.
  • Documented next to tx explorer helper in docs/frontend.md.

Blocks

  • Wallet dropdown explorer link sibling (filed separately, relates to #140).

cc @Brouie @PlasticDigits

## Summary Add **`getExplorerAddressUrl(address)`** (or equivalent) alongside existing [`getExplorerTxUrl`](frontend-dapp/src/utils/terraExplorer.ts). Required before “View on explorer” in the wallet chip dropdown ([#140](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/140) scope **B**). ## Acceptance criteria - [ ] Network-aware URLs for `mainnet` / `testnet` / `local` (`VITE_NETWORK` / constants). - [ ] Vitest for each network branch. - [ ] Documented next to tx explorer helper in [`docs/frontend.md`](docs/frontend.md). ## Blocks - Wallet dropdown explorer link sibling (filed separately, relates to #140). cc @Brouie @PlasticDigits
PlasticDigits commented 2026-05-25 02:13:23 +00:00 (Migrated from gitlab.com)

marked as related to #140

marked as related to #140
PlasticDigits commented 2026-05-25 02:14:02 +00:00 (Migrated from gitlab.com)

mentioned in issue #140

mentioned in issue #140
PlasticDigits commented 2026-05-25 02:19:52 +00:00 (Migrated from gitlab.com)

mentioned in commit 36d28a4c55

mentioned in commit 36d28a4c556e0ed47bed689706ec1f36b02f1f11
PlasticDigits commented 2026-05-25 02:20:14 +00:00 (Migrated from gitlab.com)

Implementation summary (@Brouie — please verify)

Added getExplorerAddressUrl(address) in frontend-dapp/src/utils/terraExplorer.ts, alongside existing getExplorerTxUrl. Both helpers share chainlist-based Finder bases and respect VITE_NETWORK (local / mainnet / testnet).

Behavior

Network Address URL
local {lcd}/cosmos/auth/v1beta1/accounts/{addr}
mainnet https://finder.terraclassic.community/mainnet/address/{addr}
testnet https://finder.terra-classic.hexxagon.io/testnet/address/{addr}

Docs / agent playbooks

Merged to main in commit 36d28a4.


Verification checklist

  • cd frontend-dapp && npm test -- --run src/utils/__tests__/terraExplorer.test.ts — 8 tests pass (tx + address × 3 networks + shorten helper)
  • VITE_NETWORK=mainnet build: getExplorerAddressUrl('terra1…') opens Finder mainnet account page
  • VITE_NETWORK=testnet build: address link uses Hexxagon testnet Finder
  • VITE_NETWORK=local dev: address link hits LocalTerra LCD …/cosmos/auth/v1beta1/accounts/…
  • Wallet chip does not yet wire the link (#185 — expected; this issue only delivers the helper)

@Brouie — could you confirm the three network URLs above match your QA expectations before we close?

/issue remains open until dropdown wiring (#185) is verified.

## Implementation summary (@Brouie — please verify) Added **`getExplorerAddressUrl(address)`** in `frontend-dapp/src/utils/terraExplorer.ts`, alongside existing **`getExplorerTxUrl`**. Both helpers share chainlist-based Finder bases and respect **`VITE_NETWORK`** (`local` / `mainnet` / `testnet`). ### Behavior | Network | Address URL | |---------|-------------| | `local` | `{lcd}/cosmos/auth/v1beta1/accounts/{addr}` | | `mainnet` | `https://finder.terraclassic.community/mainnet/address/{addr}` | | `testnet` | `https://finder.terra-classic.hexxagon.io/testnet/address/{addr}` | ### Docs / agent playbooks - [docs/frontend.md § Terra Classic block explorer URLs](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/blob/main/docs/frontend.md#terra-classic-block-explorer-urls) - [`skills/AGENTS_FRONTEND_TERRA_EXPLORER.md`](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/blob/main/skills/AGENTS_FRONTEND_TERRA_EXPLORER.md) - Cross-links updated in `AGENTS_FRONTEND_WALLET_CHIP.md` and `AGENTS_FRONTEND_ORDER_HISTORY.md` Merged to **`main`** in commit `36d28a4`. --- ### Verification checklist - [ ] `cd frontend-dapp && npm test -- --run src/utils/__tests__/terraExplorer.test.ts` — 8 tests pass (tx + address × 3 networks + shorten helper) - [ ] `VITE_NETWORK=mainnet` build: `getExplorerAddressUrl('terra1…')` opens Finder mainnet account page - [ ] `VITE_NETWORK=testnet` build: address link uses Hexxagon testnet Finder - [ ] `VITE_NETWORK=local` dev: address link hits LocalTerra LCD `…/cosmos/auth/v1beta1/accounts/…` - [ ] Wallet chip **does not** yet wire the link ([#185](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/185) — expected; this issue only delivers the helper) @Brouie — could you confirm the three network URLs above match your QA expectations before we close? /issue remains **open** until dropdown wiring ([#185](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/185)) is verified.
PlasticDigits commented 2026-05-25 02:21:32 +00:00 (Migrated from gitlab.com)

mentioned in issue #183

mentioned in issue #183
PlasticDigits commented 2026-05-25 02:28:12 +00:00 (Migrated from gitlab.com)

mentioned in issue #188

mentioned in issue #188
Brouie commented 2026-05-25 04:05:49 +00:00 (Migrated from gitlab.com)

mentioned in issue #185

mentioned in issue #185
Brouie commented 2026-05-25 07:36:36 +00:00 (Migrated from gitlab.com)

qa cleared at source+test layer @PlasticDigits

verified 36d28a4c.

terraExplorer.ts — getExplorerAddressUrl + getExplorerTxUrl both branch on DEFAULT_NETWORK. Local uses NETWORKS.local.terra.lcd + /cosmos/auth/v1beta1/accounts/{addr}; mainnet + testnet resolve via chainlist.json explorerUrl + /address/{addr}.

Unit tests 6/8 PASS. The 2 fails are a fixture gap on the local-build cases — the test only stubs VITE_NETWORK, not VITE_TERRA_LCD_URL, so QA's .env.local (http://127.0.0.1:1317) bleeds in and breaks the hardcoded http://localhost:1317 expectation. Helper is producing the correct URL for the env it's given; the test just needs vi.stubEnv('VITE_TERRA_LCD_URL', 'http://localhost:1317') in the two local-build cases. Worth a quick patch on your side.

mainnet + testnet branches pass cleanly. Local-build address link already verified live via the wallet dropdown View on explorer flow under #185.

good to close.

qa cleared at source+test layer @PlasticDigits verified `36d28a4c`. terraExplorer.ts — getExplorerAddressUrl + getExplorerTxUrl both branch on DEFAULT_NETWORK. Local uses NETWORKS.local.terra.lcd + /cosmos/auth/v1beta1/accounts/{addr}; mainnet + testnet resolve via chainlist.json explorerUrl + /address/{addr}. Unit tests 6/8 PASS. The 2 fails are a fixture gap on the local-build cases — the test only stubs VITE_NETWORK, not VITE_TERRA_LCD_URL, so QA's .env.local ([http://127.0.0.1:1317](http://127.0.0.1:1317)) bleeds in and breaks the hardcoded [http://localhost:1317](http://localhost:1317) expectation. Helper is producing the correct URL for the env it's given; the test just needs vi.stubEnv('VITE_TERRA_LCD_URL', '[http://localhost:1317](http://localhost:1317)') in the two local-build cases. Worth a quick patch on your side. mainnet + testnet branches pass cleanly. Local-build address link already verified live via the wallet dropdown View on explorer flow under #185. good to close.
Brouie commented 2026-05-25 07:59:29 +00:00 (Migrated from gitlab.com)

mentioned in issue #179

mentioned in issue #179
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-05-25 11:10:04 +00:00
PlasticDigits commented 2026-07-12 07:45:45 +00:00 (Migrated from gitlab.com)

mentioned in issue #478

mentioned in issue #478
PlasticDigits commented 2026-08-17 03:45:37 +00:00 (Migrated from gitlab.com)

mentioned in issue #541

mentioned in issue #541
PlasticDigits commented 2026-08-26 03:07:40 +00:00 (Migrated from gitlab.com)

mentioned in issue #656

mentioned in issue #656
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#184
No description provided.