Skip to content

Commit 7f2ffa3

Browse files
committed
POC calculator
1 parent 981b842 commit 7f2ffa3

11 files changed

+1119
-213
lines changed

package-lock.json

+462-191
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+24-20
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
{
2-
"name": "coinjoins",
3-
"version": "0.0.1",
4-
"private": true,
5-
"scripts": {
6-
"dev": "vite dev",
7-
"build": "vite build",
8-
"preview": "vite preview"
9-
},
10-
"devDependencies": {
11-
"@sveltejs/adapter-auto": "^3.0.0",
12-
"@sveltejs/kit": "^2.0.0",
13-
"@sveltejs/vite-plugin-svelte": "^3.0.0",
14-
"autoprefixer": "^10.4.14",
15-
"postcss": "^8.4.27",
16-
"svelte": "^4.0.0",
17-
"tailwindcss": "^3.3.3",
18-
"vite": "^5.0.0"
19-
},
20-
"type": "module"
21-
}
2+
"name": "coinjoins",
3+
"version": "0.0.1",
4+
"private": true,
5+
"scripts": {
6+
"dev": "vite dev",
7+
"build": "vite build",
8+
"preview": "vite preview",
9+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json"
10+
},
11+
"devDependencies": {
12+
"@sveltejs/adapter-auto": "^3.0.0",
13+
"@sveltejs/kit": "^2.0.0",
14+
"@sveltejs/vite-plugin-svelte": "^3.0.0",
15+
"autoprefixer": "^10.4.14",
16+
"postcss": "^8.4.27",
17+
"svelte": "^4.2.12",
18+
"tailwindcss": "^3.3.3",
19+
"vite": "^5.0.0",
20+
"svelte-check": "^3.6.7",
21+
"typescript": "^5.4.2"
22+
},
23+
"type": "module",
24+
"dependencies": {}
25+
}

src/lib/components/Header.svelte

+16
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,22 @@
202202
{headerData.menu.history}
203203
</a>
204204
</div>
205+
<div
206+
class="cursor-default hover:text-green-cj hover:cursor-pointer {$page.url
207+
.pathname === '/calculator'
208+
? 'text-green-cj'
209+
: 'text-white'}"
210+
>
211+
<a
212+
on:click={showMobileMenu
213+
? handleMobileMenuItemClick
214+
: handleDesktopMenuItemClick}
215+
href="/calculator"
216+
class="no-underline"
217+
>
218+
{headerData.menu.calculator}
219+
</a>
220+
</div>
205221
<div class="isolate z-20 md:hidden flex justify-center pt-12">
206222
<a
207223
href="/try"

src/lib/data/calculator.json

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"no_results": {
3+
"title": "No results for now. Run the numbers first!"
4+
},
5+
"hero": {
6+
"title": "Coinjoin Fee Calculator",
7+
"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."
8+
},
9+
"calculator": {
10+
"how_much_bitcoin": {
11+
"label": "How much bitcoin to coinjoin?",
12+
"placeholder": "Enter the amount of BTC",
13+
"btc": "BTC"
14+
},
15+
"how_many_inputs": {
16+
"label": "How many inputs?",
17+
"placeholder": "Enter the amount of coins"
18+
},
19+
"expected_privacy": {
20+
"label": "What is your expected level of privacy?",
21+
"placeholder": "Select your privacy level",
22+
"dropdown": [
23+
{
24+
"id": "low",
25+
"value": false,
26+
"name": "Low"
27+
},
28+
{
29+
"id": "high",
30+
"value": true,
31+
"name": "High"
32+
}
33+
]
34+
},
35+
"current_fee_rate": "Current fee rate (from Mempool.Space)",
36+
"is_first_coinjoin": {
37+
"label": "Is this your first coinjoin with this wallet?",
38+
"placeholder": "Choose your situation",
39+
"dropdown": [
40+
{
41+
"id": "false",
42+
"value": false,
43+
"name": "No, used it before"
44+
},
45+
{
46+
"id": "true",
47+
"value": true,
48+
"name": "Yes, first wallet"
49+
}
50+
]
51+
},
52+
"cta": {
53+
"text": "Calculate fees"
54+
}
55+
},
56+
"results": {
57+
"title": "Results",
58+
"total_fees": {
59+
"title": "Total Fees",
60+
"subtitle": "All fees, including coordinator and mining fees."
61+
},
62+
"coordinator_fees": {
63+
"title": "Coordinator Fees (0.3%)",
64+
"subtitle": "Fees that the coinjoin coordinator takes for its service."
65+
},
66+
"mining_fees": {
67+
"title": "Mining Fees",
68+
"subtitle": "Depend on the live block space market conditions."
69+
}
70+
}
71+
}

src/lib/data/header.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"menu": {
33
"basics": "Basics",
44
"wallets": "Wallets",
5-
"history": "History"
5+
"history": "History",
6+
"calculator": "Calculator"
67
},
78
"submenu": [
89
{

src/routes/+layout.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<Header />
6161
{#key data.url}
6262
<div
63-
class="z-0 min-w-[320px] bg-dark-blue flex flex-col gap-52 md:gap-56"
63+
class="z-0 min-w-[320px] bg-dark-blue flex flex-col gap-16 md:gap-32"
6464
in:fly={{ x: -200, duration: 300, delay: 300 }}
6565
out:fly={{ x: 200, duration: 300 }}
6666
>

0 commit comments

Comments
 (0)