aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(static)
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-12-01 20:04:13 -0800
committerAdam Soltys <[email protected]>2023-12-01 20:04:13 -0800
commit216a600224fde22ce76b367557a02094ec693886 (patch)
treed1189bbaa39db204633523132a7d4767b952717d /src/routes/(static)
parent7d9bc1f54dfd04172e8d6d43ebc2efd6f407e833 (diff)
downloadcoinos-ui-216a600224fde22ce76b367557a02094ec693886.tar.gz
coinos-ui-216a600224fde22ce76b367557a02094ec693886.zip
prettier
Diffstat (limited to 'src/routes/(static)')
-rw-r--r--src/routes/(static)/+layout.server.js22
-rw-r--r--src/routes/(static)/+layout.svelte10
-rw-r--r--src/routes/(static)/bounties/+page.svelte174
-rw-r--r--src/routes/(static)/docs/+page.server.js4
-rw-r--r--src/routes/(static)/docs/+page.svelte201
5 files changed, 213 insertions, 198 deletions
diff --git a/src/routes/(static)/+layout.server.js b/src/routes/(static)/+layout.server.js
index 2deeebc5..81d1d3dc 100644
--- a/src/routes/(static)/+layout.server.js
+++ b/src/routes/(static)/+layout.server.js
@@ -1,16 +1,16 @@
-import { get, post, auth, protectedRoutes } from '$lib/utils';
+import { get, post, auth, protectedRoutes } from "$lib/utils";
export async function load({ cookies, request, url, params }) {
- let token = cookies.get('token');
- let rate,
- rates = { USD: 1 };
+ let token = cookies.get("token");
+ let rate,
+ rates = { USD: 1 };
- let user;
- if (token) {
- try {
- user = await get('/me', auth(cookies));
- } catch (e) {}
- }
+ let user;
+ if (token) {
+ try {
+ user = await get("/me", auth(cookies));
+ } catch (e) {}
+ }
- return { user };
+ return { user };
}
diff --git a/src/routes/(static)/+layout.svelte b/src/routes/(static)/+layout.svelte
index 3d596dff..29089dff 100644
--- a/src/routes/(static)/+layout.svelte
+++ b/src/routes/(static)/+layout.svelte
@@ -1,13 +1,13 @@
<script>
- import { SvelteToast } from '@zerodevx/svelte-toast';
- import { Footer, LandingHeader } from '$comp';
- export let data;
- $: ({ user } = data);
+ import { SvelteToast } from "@zerodevx/svelte-toast";
+ import { Footer, LandingHeader } from "$comp";
+ export let data;
+ $: ({ user } = data);
</script>
<SvelteToast options={{ reversed: true, intro: { y: 192 } }} />
<LandingHeader {user} />
<main class="container flex px-10 md:px-40 mx-auto min-h-[600px] pb-20">
- <slot />
+ <slot />
</main>
<Footer />
diff --git a/src/routes/(static)/bounties/+page.svelte b/src/routes/(static)/bounties/+page.svelte
index 729cf5dd..b53dc85d 100644
--- a/src/routes/(static)/bounties/+page.svelte
+++ b/src/routes/(static)/bounties/+page.svelte
@@ -1,102 +1,108 @@
<div class="space-y-5">
- <h1 class="text-3xl mb-6 pt-28 md:pt-12">Bounties</h1>
+ <h1 class="text-3xl mb-6 pt-28 md:pt-12">Bounties</h1>
- <p>
- We're offering ⚡️1,000,000 to the first 10 people that help us onboard these businesses in
- Vancouver to take bitcoin payments.
- </p>
+ <p>
+ We're offering ⚡️1,000,000 to the first 10 people that help us onboard
+ these businesses in Vancouver to take bitcoin payments.
+ </p>
- <ul class="text-center text-lg space-y-3">
- <li>Grocery / Produce Store</li>
- <li class="leading-3">
- <span class="line-through">Cafe</span><br />
- <span class="text-xs"
- ><a href="/reverendhodl">ReverendHodl</a> for
- <a href="/laughingbean">Laughing Bean Coffee Co.</a></span
- >
- </li>
- <li>Bakery</li>
- <li class="leading-3">
- <span class="line-through">Butcher Shop</span><br />
- <span class="text-xs"
- ><a href="/danielle">danielle</a> for
- <a href="/butchersguild">All Natural &amp; Exotic Meats</a></span
- >
- </li>
- <li>Laundromat / Dry Cleaner</li>
- <li>Dollar Store / Book Store / Gift Shop</li>
- <li class="leading-3">
- <span class="line-through">Sushi Restaurant</span><br />
- <span class="text-xs"
- ><a href="/ica547">ica547</a> for <a href="/metallmash">VanLove Sushi</a></span
- >
- </li>
- <li>Pizza by the Slice</li>
- <li>Liquor Store / Gas Station</li>
- <li>Bubble Tea / Ice Cream Parlour</li>
- </ul>
+ <ul class="text-center text-lg space-y-3">
+ <li>Grocery / Produce Store</li>
+ <li class="leading-3">
+ <span class="line-through">Cafe</span><br />
+ <span class="text-xs"
+ ><a href="/reverendhodl">ReverendHodl</a> for
+ <a href="/laughingbean">Laughing Bean Coffee Co.</a></span
+ >
+ </li>
+ <li>Bakery</li>
+ <li class="leading-3">
+ <span class="line-through">Butcher Shop</span><br />
+ <span class="text-xs"
+ ><a href="/danielle">danielle</a> for
+ <a href="/butchersguild">All Natural &amp; Exotic Meats</a></span
+ >
+ </li>
+ <li>Laundromat / Dry Cleaner</li>
+ <li>Dollar Store / Book Store / Gift Shop</li>
+ <li class="leading-3">
+ <span class="line-through">Sushi Restaurant</span><br />
+ <span class="text-xs"
+ ><a href="/ica547">ica547</a> for
+ <a href="/metallmash">VanLove Sushi</a></span
+ >
+ </li>
+ <li>Pizza by the Slice</li>
+ <li>Liquor Store / Gas Station</li>
+ <li>Bubble Tea / Ice Cream Parlour</li>
+ </ul>
- <p>Eligible businesses:</p>
+ <p>Eligible businesses:</p>
- <ul class="text-sm ml-4 space-y-2">
- <li>
- Have a physical location in Vancouver, North Vancouver, West Vancouver, Burnaby, New
- Westminster, or Richmond
- </li>
- <li>Take walk-in customers</li>
- <li>Have regular hours and a website with contact info</li>
- <li>Have a 3 star or better rating on Google</li>
- <li>
- Accept bitcoin during their posted hours without needing to make any special arrangements
- </li>
- <li>Use Coinos</li>
- </ul>
+ <ul class="text-sm ml-4 space-y-2">
+ <li>
+ Have a physical location in Vancouver, North Vancouver, West Vancouver,
+ Burnaby, New Westminster, or Richmond
+ </li>
+ <li>Take walk-in customers</li>
+ <li>Have regular hours and a website with contact info</li>
+ <li>Have a 3 star or better rating on Google</li>
+ <li>
+ Accept bitcoin during their posted hours without needing to make any
+ special arrangements
+ </li>
+ <li>Use Coinos</li>
+ </ul>
- <p>Each business category can be claimed only once</p>
- <p>One bounty per person</p>
+ <p>Each business category can be claimed only once</p>
+ <p>One bounty per person</p>
- <p>The businesses can expect free ongoing support and promotion from us and our community.</p>
+ <p>
+ The businesses can expect free ongoing support and promotion from us and our
+ community.
+ </p>
- <p>The prize money will be offered to the person who makes the referral.</p>
+ <p>The prize money will be offered to the person who makes the referral.</p>
- <p>
- <b>⚡️250,000</b> will be awarded once the business has met with us and is ready to take payments
- </p>
- <p>
- <b>⚡️750,000</b> will be awarded once the merchant has accepted bitcoin for 6 months. We'll be
- sending
- <a
- href="https://btcmap.org/leaderboard"
- class="text-black hover:underline"
- target="_blank"
- rel="noreferrer">shadowy supertaggers</a
- > to check up on them periodically.
- </p>
+ <p>
+ <b>⚡️250,000</b> will be awarded once the business has met with us and is ready
+ to take payments
+ </p>
+ <p>
+ <b>⚡️750,000</b> will be awarded once the merchant has accepted bitcoin for
+ 6 months. We'll be sending
+ <a
+ href="https://btcmap.org/leaderboard"
+ class="text-black hover:underline"
+ target="_blank"
+ rel="noreferrer">shadowy supertaggers</a
+ > to check up on them periodically.
+ </p>
- <p>
- Bounties will be awarded solely at our discretion and we reserve the right to refuse any
- applicants without cause
- </p>
+ <p>
+ Bounties will be awarded solely at our discretion and we reserve the right
+ to refuse any applicants without cause
+ </p>
- <h2 class="text-xl">Ready to begin!?</h2>
+ <h2 class="text-xl">Ready to begin!?</h2>
- <p>
- To make a referral, reach out on one of our socials or email us at <a
- href="mailto:[email protected]"
- class="text-black hover:underline">[email protected]</a
- > and we'll set up an appointment with you and the business owner to get started.
- </p>
+ <p>
+ To make a referral, reach out on one of our socials or email us at <a
+ href="mailto:[email protected]"
+ class="text-black hover:underline">[email protected]</a
+ > and we'll set up an appointment with you and the business owner to get started.
+ </p>
- <p>
- We'll update this page as the bounties are claimed so you'll be able to see which ones are still
- available.
- </p>
+ <p>
+ We'll update this page as the bounties are claimed so you'll be able to see
+ which ones are still available.
+ </p>
- <p>Thanks for participating and helping to orange pill Vancouver!</p>
+ <p>Thanks for participating and helping to orange pill Vancouver!</p>
</div>
<style>
- a {
- @apply text-blue-400;
- }
+ a {
+ @apply text-blue-400;
+ }
</style>
diff --git a/src/routes/(static)/docs/+page.server.js b/src/routes/(static)/docs/+page.server.js
index e80365fa..41176b14 100644
--- a/src/routes/(static)/docs/+page.server.js
+++ b/src/routes/(static)/docs/+page.server.js
@@ -1,4 +1,4 @@
export let load = async ({ cookies }) => {
- let token = cookies.get('token');
- return { token };
+ let token = cookies.get("token");
+ return { token };
};
diff --git a/src/routes/(static)/docs/+page.svelte b/src/routes/(static)/docs/+page.svelte
index 63173173..6e08c2e8 100644
--- a/src/routes/(static)/docs/+page.svelte
+++ b/src/routes/(static)/docs/+page.svelte
@@ -1,121 +1,130 @@
<script>
- import { copyNoNewlines as copy } from '$lib/utils';
- import { Code, Icon } from '$comp';
- import { PUBLIC_COINOS_URL } from '$env/static/public';
- export let data;
- let { user, token } = data;
- let api = 'https://coinos.io/api';
+ import { copyNoNewlines as copy } from "$lib/utils";
+ import { Code, Icon } from "$comp";
+ import { PUBLIC_COINOS_URL } from "$env/static/public";
+ export let data;
+ let { user, token } = data;
+ let api = "https://coinos.io/api";
- let tokenSample = token ? `export token="${token}"` : `export token=<your auth token>`;
+ let tokenSample = token
+ ? `export token="${token}"`
+ : `export token=<your auth token>`;
</script>
<div class="space-y-8 lg:text-xl mt-20 pt-20 md:pt-0 w-full max-w-full">
- <h1 class="text-4xl">Documentation</h1>
+ <h1 class="text-4xl">Documentation</h1>
- <p class="text-secondary">
- Coinos has a simple REST API that can be used to register accounts and make payments and
- queries. The following examples show how you can call the API with <a
- href="https://curl.se/"
- class="font-bold">curl</a
- > from your command line.
- </p>
+ <p class="text-secondary">
+ Coinos has a simple REST API that can be used to register accounts and make
+ payments and queries. The following examples show how you can call the API
+ with <a href="https://curl.se/" class="font-bold">curl</a> from your command
+ line.
+ </p>
- <h2 class="text-2xl">API Base URL</h2>
- <div class="bg-black text-white rounded-lg p-4 flex gap-4">
- <div>{api}</div>
- <button class="ml-auto my-auto invert opacity-90" on:click={() => copy(api)}
- ><Icon icon="copy" style="w-10 max-w-none" /></button
- >
- </div>
+ <h2 class="text-2xl">API Base URL</h2>
+ <div class="bg-black text-white rounded-lg p-4 flex gap-4">
+ <div>{api}</div>
+ <button class="ml-auto my-auto invert opacity-90" on:click={() => copy(api)}
+ ><Icon icon="copy" style="w-10 max-w-none" /></button
+ >
+ </div>
- <h2 class="text-2xl">Auth Token</h2>
- <p class="text-secondary">
- {#if user && token}
- This token authorizes you to use the API as <b>{user.username}</b>.
- {:else}
- <a href="/login" class="font-bold">Sign in</a> to view your auth token here, or get one from the
- /login endpoint.
- {/if}
+ <h2 class="text-2xl">Auth Token</h2>
+ <p class="text-secondary">
+ {#if user && token}
+ This token authorizes you to use the API as <b>{user.username}</b>.
+ {:else}
+ <a href="/login" class="font-bold">Sign in</a> to view your auth token here,
+ or get one from the /login endpoint.
+ {/if}
- Save it in a variable called <b>$token</b> to run the examples.
- </p>
+ Save it in a variable called <b>$token</b> to run the examples.
+ </p>
- <div class="bg-black text-white rounded-lg p-4 flex gap-4">
- <div class="w-full break-all">{tokenSample}</div>
- <button class="ml-auto my-auto invert opacity-90" on:click={() => copy(tokenSample)}
- ><Icon icon="copy" style="w-10 max-w-none" /></button
- >
- </div>
+ <div class="bg-black text-white rounded-lg p-4 flex gap-4">
+ <div class="w-full break-all">{tokenSample}</div>
+ <button
+ class="ml-auto my-auto invert opacity-90"
+ on:click={() => copy(tokenSample)}
+ ><Icon icon="copy" style="w-10 max-w-none" /></button
+ >
+ </div>
- <h2 class="text-2xl">POST /register</h2>
- <p class="text-secondary">Register a new user account with a username and password</p>
- <Code sample="register" />
+ <h2 class="text-2xl">POST /register</h2>
+ <p class="text-secondary">
+ Register a new user account with a username and password
+ </p>
+ <Code sample="register" />
- <h2 class="text-2xl">POST /login</h2>
- <p class="text-secondary">Login to an account to get its auth token</p>
- <Code sample="login" />
+ <h2 class="text-2xl">POST /login</h2>
+ <p class="text-secondary">Login to an account to get its auth token</p>
+ <Code sample="login" />
- <h2 class="text-2xl">POST /invoice</h2>
- <p class="text-secondary">Create an invoice.</p>
+ <h2 class="text-2xl">POST /invoice</h2>
+ <p class="text-secondary">Create an invoice.</p>
- <div class="text-secondary">
- <div>Request params</div>
- <div class="grid grid-cols-3 ml-2">
- <div class="font-bold">type</div>
- <div class="col-span-2">bitcoin or lightning</div>
- <div class="font-bold">amount</div>
- <div class="col-span-2">amount in satoshis</div>
- <div class="font-bold">webhook</div>
- <div class="col-span-2">(optional) endpoint to hit when the invoice is paid</div>
- <div class="font-bold">secret</div>
- <div class="col-span-2">a secret for the webhook to check</div>
- </div>
- </div>
+ <div class="text-secondary">
+ <div>Request params</div>
+ <div class="grid grid-cols-3 ml-2">
+ <div class="font-bold">type</div>
+ <div class="col-span-2">bitcoin or lightning</div>
+ <div class="font-bold">amount</div>
+ <div class="col-span-2">amount in satoshis</div>
+ <div class="font-bold">webhook</div>
+ <div class="col-span-2">
+ (optional) endpoint to hit when the invoice is paid
+ </div>
+ <div class="font-bold">secret</div>
+ <div class="col-span-2">a secret for the webhook to check</div>
+ </div>
+ </div>
- <p>Get a lightning invoice to receive funds</p>
- <Code sample="lightningInvoice" />
+ <p>Get a lightning invoice to receive funds</p>
+ <Code sample="lightningInvoice" />
- <p>Get a bitcoin address to receive funds</p>
- <Code sample="bitcoinAddress" />
+ <p>Get a bitcoin address to receive funds</p>
+ <Code sample="bitcoinAddress" />
- <p>Sample response</p>
- <Code sample="invoiceResponse" />
- <p>You can check the <b>received</b> field to see how much has been paid</p>
+ <p>Sample response</p>
+ <Code sample="invoiceResponse" />
+ <p>You can check the <b>received</b> field to see how much has been paid</p>
- <p>Specify a webhook to be called when an invoice is paid</p>
- <Code sample="webhook" />
+ <p>Specify a webhook to be called when an invoice is paid</p>
+ <Code sample="webhook" />
- <h2 class="text-2xl">GET /invoice/:hash</h2>
- <p class="text-secondary">
- Fetch an invoice by passing a bitcoin address or lightning payment hash
- </p>
- <Code sample="fetchInvoice" />
+ <h2 class="text-2xl">GET /invoice/:hash</h2>
+ <p class="text-secondary">
+ Fetch an invoice by passing a bitcoin address or lightning payment hash
+ </p>
+ <Code sample="fetchInvoice" />
- <h2 class="text-2xl">POST /payments</h2>
- <p class="text-secondary">Send a lightning payment</p>
- <Code sample="lightning" />
+ <h2 class="text-2xl">POST /payments</h2>
+ <p class="text-secondary">Send a lightning payment</p>
+ <Code sample="lightning" />
- <p class="text-secondary">Send a bitcoin payment</p>
- <Code sample="bitcoin" />
+ <p class="text-secondary">Send a bitcoin payment</p>
+ <Code sample="bitcoin" />
- <p class="text-secondary">Send an internal payment to another user</p>
- <Code sample="internal" />
+ <p class="text-secondary">Send an internal payment to another user</p>
+ <Code sample="internal" />
- <h2 class="text-2xl">GET /payments</h2>
- <p class="text-secondary">Get all payments sent or received by the current user</p>
+ <h2 class="text-2xl">GET /payments</h2>
+ <p class="text-secondary">
+ Get all payments sent or received by the current user
+ </p>
- <div class="text-secondary">
- <div>Query params</div>
- <div class="grid grid-cols-3 ml-2">
- <div class="font-bold">start</div>
- <div class="col-span-2">only payments after this unix time</div>
- <div class="font-bold">end</div>
- <div class="col-span-2">only payments before this unix time</div>
- <div class="font-bold">limit</div>
- <div class="col-span-2">limit to this integer number of results</div>
- <div class="font-bold">offset</div>
- <div class="col-span-2">start limiting from this integer offset</div>
- </div>
- </div>
- <Code sample="payments" />
+ <div class="text-secondary">
+ <div>Query params</div>
+ <div class="grid grid-cols-3 ml-2">
+ <div class="font-bold">start</div>
+ <div class="col-span-2">only payments after this unix time</div>
+ <div class="font-bold">end</div>
+ <div class="col-span-2">only payments before this unix time</div>
+ <div class="font-bold">limit</div>
+ <div class="col-span-2">limit to this integer number of results</div>
+ <div class="font-bold">offset</div>
+ <div class="col-span-2">start limiting from this integer offset</div>
+ </div>
+ </div>
+ <Code sample="payments" />
</div>