Skip to content
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

POC Coinjoin Fee Calculator for Wasabi Wallet #57

Merged
merged 5 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,585 changes: 1,208 additions & 377 deletions package-lock.json

Large diffs are not rendered by default.

41 changes: 23 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
{
"name": "coinjoins",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/kit": "^1.20.4",
"autoprefixer": "^10.4.14",
"postcss": "^8.4.27",
"svelte": "^4.0.0",
"tailwindcss": "^3.3.3",
"vite": "^4.3.6"
},
"type": "module"
"name": "coinjoins",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"autoprefixer": "^10.4.14",
"postcss": "^8.4.27",
"svelte": "^4.2.12",
"tailwindcss": "^3.3.3",
"vite": "^5.0.0",
"svelte-check": "^3.6.7",
"typescript": "^5.4.2"
},
"type": "module",
"dependencies": {}
}
16 changes: 16 additions & 0 deletions src/lib/components/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,22 @@
{headerData.menu.history}
</a>
</div>
<div
class="cursor-default hover:text-green-cj hover:cursor-pointer {$page.url
.pathname === '/calculator'
? 'text-green-cj'
: 'text-white'}"
>
<a
on:click={showMobileMenu
? handleMobileMenuItemClick
: handleDesktopMenuItemClick}
href="/calculator"
class="no-underline"
>
{headerData.menu.calculator}
</a>
</div>
<div class="isolate z-20 md:hidden flex justify-center pt-12">
<a
href="/try"
Expand Down
71 changes: 71 additions & 0 deletions src/lib/data/calculator.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"no_results": {
"title": "No results for now. Run the numbers first!"
},
"hero": {
"title": "Coinjoin Fee Calculator",
"body": "Coinjoin fees can be difficult to calculate. This calculator aims to make coinjoin fees easier to estimate for Wasabi Wallet. For educational purposes only."
},
"calculator": {
"how_much_bitcoin": {
"label": "How much bitcoin to coinjoin?",
"placeholder": "Enter the amount of BTC",
"btc": "BTC"
},
"how_many_inputs": {
"label": "How many inputs?",
"placeholder": "Enter the amount of coins"
},
"expected_privacy": {
"label": "What is your expected level of privacy?",
"placeholder": "Select your privacy level",
"dropdown": [
{
"id": "low",
"value": false,
"name": "Low"
},
{
"id": "high",
"value": true,
"name": "High"
}
]
},
"current_fee_rate": "Current fee rate (from Mempool.Space)",
"is_first_coinjoin": {
"label": "Is this your first coinjoin with this wallet?",
"placeholder": "Choose your situation",
"dropdown": [
{
"id": "false",
"value": false,
"name": "No, used it before"
},
{
"id": "true",
"value": true,
"name": "Yes, first wallet"
}
]
},
"cta": {
"text": "Calculate fees"
}
},
"results": {
"title": "Results",
"total_fees": {
"title": "Total Fees",
"subtitle": "All fees, including coordinator and mining fees."
},
"coordinator_fees": {
"title": "Coordinator Fees (0.3%)",
"subtitle": "Fees that the coinjoin coordinator takes for its service."
},
"mining_fees": {
"title": "Mining Fees",
"subtitle": "Depend on the live block space market conditions."
}
}
}
3 changes: 2 additions & 1 deletion src/lib/data/header.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"menu": {
"basics": "Basics",
"wallets": "Wallets",
"history": "History"
"history": "History",
"calculator": "Calculator"
},
"submenu": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<Header />
{#key data.url}
<div
class="z-0 min-w-[320px] bg-dark-blue flex flex-col gap-52 md:gap-56"
class="z-0 min-w-[320px] bg-dark-blue flex flex-col gap-16 md:gap-32"
in:fly={{ x: -200, duration: 300, delay: 300 }}
out:fly={{ x: 200, duration: 300 }}
>
Expand Down
Loading