Link resolved swaps to dashboard URL in view.py#31
Conversation
|
Hi @LandynDev I put the new PR based on your comments from closed one |
d208503 to
f886495
Compare
|
hey, the gap you're solving is real bc I thought about this more and here's what I think: If you want to close this UX gap in a shape we can land, the smaller move is a ~5-line tweak to I led you wrong direction here in the last PR saying API good route, can we do this instead? |
838c361 to
c0707d0
Compare
|
Thanks for the clear direction — makes sense. Reverted the API-client approach entirely and replaced it with the ~5-line dashboard URL hint as suggested. No HTTP calls from the CLI, no new modules. |
When a swap is no longer in contract storage (completed or timed out), alw view swap <id> now prints the dashboard URL where resolved swap history is owned and displayed, instead of dead-ending on a 'resolved' message. - Dashboard URL configurable via ALLWAYS_DASHBOARD_URL env var (default: https://test.all-ways.io) - Keeps allways/ CLI as the chain-state-direct layer — no HTTP calls from this repo, no new dependency, no proxying of off-chain data - ~5-line change to view.py, no new modules
c0707d0 to
cc743a4
Compare
Closes #66
Summary
When a swap completes or times out, the contract removes it from on-chain storage.
alw view swap <id>previously dead-ended on a generic "Swap resolved" message.Per your feedback — keeping
allways/as the chain-state-direct layer with no HTTP calls to deployed services — this PR drops the earlier API-client approach and replaces it with a minimal dashboard URL hint that routes users to the module (allways-ui) that owns resolved swap history.Changes
allways/cli/swap_commands/view.py— whenget_swap()returns None and the swap ID is belownext_swap_id, append the dashboard URL (/swap/{id}) to the existing messageDEFAULT_DASHBOARD_URLmodule constant (https://test.all-ways.io) overridable viaALLWAYS_DASHBOARD_URLenv varReverted from previous revision:
das_api.py,test_das_api.py, and all indexer-fetch logic.Example
Before:
After:
Test plan
alw view swap <resolved_id>prints the dashboard URLalw view swap <active_id>still shows full on-chain detailsALLWAYS_DASHBOARD_URL=https://my.host alw view swap <resolved_id>uses the override