-
Notifications
You must be signed in to change notification settings - Fork 7
add about section #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| export async function AboutComponent(container) { | ||
| container.innerHTML = ` | ||
| <div class="flex-1 p-8 overflow-auto"> | ||
|
|
||
| <!-- Header --> | ||
| <div class="flex items-start justify-between mb-8"> | ||
| <div> | ||
| <h2 class="text-3xl font-bold text-[#FF6B35]">Coinswap</h2> | ||
| <p class="text-gray-400 text-sm mt-1">Taker Wallet — Bitcoin Privacy Tool</p> | ||
| </div> | ||
| <div class="flex items-center gap-3 mt-1"> | ||
| <span class="text-gray-500 text-sm">Version</span> | ||
| <span id="app-version" class="text-white font-mono text-sm bg-[#1a2332] px-3 py-1 rounded">Loading...</span> | ||
| </div> | ||
| </div> | ||
|
|
||
| <!-- What is Coinswap --> | ||
| <div class="bg-[#1a2332] rounded-lg p-8 max-w-3xl space-y-4"> | ||
| <h3 class="text-xl font-semibold text-white">About Coinswap</h3> | ||
| <p class="text-gray-300 text-sm leading-relaxed"> | ||
| Coinswap is a trustless, self-custodial atomic swap protocol built on Bitcoin. Unlike existing solutions | ||
| that rely on centralized servers, Coinswap's marketplace is seeded in the Bitcoin blockchain itself — | ||
| no central host required. Sybil resistance is achieved through | ||
| <span class="text-white font-medium">Fidelity Bonds</span>: time-locked UTXOs that make Sybil attacks | ||
| economically costly while bootstrapping the marketplace on-chain. | ||
| </p> | ||
| <p class="text-gray-300 text-sm leading-relaxed"> | ||
| There are two roles. <span class="text-white font-medium">Makers</span> are swap service providers who | ||
| earn fees for supplying liquidity and run in an install-fund-forget mode — no active management needed. | ||
| <span class="text-white font-medium">Takers</span> (this app) initiate swaps, pay all fees, and select | ||
| makers based on bond validity, available liquidity, and fee rates. | ||
| </p> | ||
| <p class="text-gray-300 text-sm leading-relaxed"> | ||
| Swaps are routed through multiple makers — no single maker sees the full route. The taker relays all | ||
| messages between makers over Tor, keeping each maker's view partial. This app is a production-grade | ||
| implementation of Chris Belcher's teleport-transactions proof-of-concept. | ||
| </p> | ||
| </div> | ||
|
|
||
| </div> | ||
| `; | ||
|
|
||
| try { | ||
| const result = await window.api.app.getVersionInfo(); | ||
| const version = result.success ? `v${result.appVersion}` : 'unavailable'; | ||
| container.querySelector('#app-version').textContent = version; | ||
| } catch (_) { | ||
| container.querySelector('#app-version').textContent = 'unavailable'; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -228,7 +228,16 @@ export function ConnectionStatusComponent(container, onConnected) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const result = await bitcoindConnection.connect(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!result.success) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (result.alreadyConnected) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Connection existed before our patch was in place — verify and proceed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const check = await bitcoindConnection.testConnection(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (check.success) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| showSuccess(check.info); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bitcoindConnection.disconnect(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| startConnection(); // retry from scratch | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else if (!result.success) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| showError(result.finalError || result.error); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+231
to
242
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Potential infinite recursion when existing connection verification fails. If Consider adding a retry counter or reusing the existing retry mechanism instead of direct recursion: 🛡️ Proposed fix- if (result.alreadyConnected) {
- // Connection existed before our patch was in place — verify and proceed
- const check = await bitcoindConnection.testConnection();
- if (check.success) {
- showSuccess(check.info);
- } else {
- bitcoindConnection.disconnect();
- startConnection(); // retry from scratch
- }
+ if (result.alreadyConnected) {
+ // Connection existed before our patch was in place — verify and proceed
+ const check = await bitcoindConnection.testConnection();
+ if (check.success) {
+ showSuccess(check.info);
+ } else {
+ // Reset connection state and let the patched _performConnection handle retries
+ bitcoindConnection.disconnect();
+ bitcoindConnection.isConnected = false;
+ const retryResult = await bitcoindConnection.connect();
+ if (!retryResult.success) {
+ showError(retryResult.finalError || retryResult.error);
+ }
+ }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } catch (error) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Consider displaying the binary version as well.
The
app:getVersionInfohandler returns bothappVersionandbinaryVersion, but onlyappVersionis displayed. For debugging and support purposes, showing the coinswap-napi binary version could be valuable.💡 Optional enhancement
try { const result = await window.api.app.getVersionInfo(); - const version = result.success ? `v${result.appVersion}` : 'unavailable'; + const version = result.success + ? `v${result.appVersion} (napi: ${result.binaryVersion})` + : 'unavailable'; container.querySelector('#app-version').textContent = version; } catch (_) { container.querySelector('#app-version').textContent = 'unavailable'; }📝 Committable suggestion
🤖 Prompt for AI Agents