From 1b3accf009e859f6098c659cdbed695e5b17b641 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 27 Feb 2023 10:30:10 -0800 Subject: don't redirect homepage --- src/hooks.server.js | 32 -------------------------------- src/routes/(app)/+layout.server.js | 2 +- 2 files changed, 1 insertion(+), 33 deletions(-) delete mode 100644 src/hooks.server.js (limited to 'src') diff --git a/src/hooks.server.js b/src/hooks.server.js deleted file mode 100644 index 4107ec86..00000000 --- a/src/hooks.server.js +++ /dev/null @@ -1,32 +0,0 @@ -import { auth, get, protectedRoutes } from '$lib/utils'; - -export async function handle({ event, resolve }) { - let token = event.cookies.get('token'); - let { - params, - request, - url: { pathname, origin } - } = event; - - let user; - if (token && pathname !== '/logout') { - try { - user = await get('/me', auth(event.cookies)); - event.locals.user = user; - - if (['/', '/login', '/register'].includes(pathname) && request.method === 'GET') - return Response.redirect(origin + `/${user.username}/dashboard`, 307); - } catch (e) { - return Response.redirect(origin + '/logout', 307); - } - } - - if (protectedRoutes.find((p) => pathname.match(p))) { - if (!user || user.username !== params.username) - return Response.redirect(origin + '/login', 307); - } - - const response = await resolve(event); - - return response; -} diff --git a/src/routes/(app)/+layout.server.js b/src/routes/(app)/+layout.server.js index 881dbccc..ef278744 100644 --- a/src/routes/(app)/+layout.server.js +++ b/src/routes/(app)/+layout.server.js @@ -19,7 +19,7 @@ export async function load({ cookies, request, url, params }) { throw redirect(307, `/migrate`); } - if (user && ['/', '/login', '/register'].includes(pathname) && request.method === 'GET') { + if (user && ['/login', '/register'].includes(pathname) && request.method === 'GET') { throw redirect(307, `/${user.username}`); } -- cgit v1.2.3 From 34bc1c031378f8333819f2b46fb74f46634fb639 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 27 Feb 2023 19:28:09 -0800 Subject: api docs --- src/components/Code.svelte | 15 ++++++ src/components/index.js | 1 + src/lib/samples.js | 22 +++++++++ src/routes/(static)/+layout.server.js | 16 +++++++ src/routes/(static)/+layout.svelte | 6 ++- src/routes/(static)/docs/+page.server.js | 4 ++ src/routes/(static)/docs/+page.svelte | 81 +++++++++++++++++++++++++------- 7 files changed, 128 insertions(+), 17 deletions(-) create mode 100644 src/components/Code.svelte create mode 100644 src/lib/samples.js create mode 100644 src/routes/(static)/+layout.server.js create mode 100644 src/routes/(static)/docs/+page.server.js (limited to 'src') diff --git a/src/components/Code.svelte b/src/components/Code.svelte new file mode 100644 index 00000000..b3181d0a --- /dev/null +++ b/src/components/Code.svelte @@ -0,0 +1,15 @@ + + +
+
{samples[sample]}
+ +
diff --git a/src/components/index.js b/src/components/index.js index 0d1d8d1d..1853e7c9 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -1,3 +1,4 @@ +export { default as Code } from './Code.svelte'; export { default as Slider } from './Slider.svelte'; export { default as Pinpad } from './Pinpad.svelte'; export { default as Balance } from './Balance.svelte'; diff --git a/src/lib/samples.js b/src/lib/samples.js new file mode 100644 index 00000000..4af61822 --- /dev/null +++ b/src/lib/samples.js @@ -0,0 +1,22 @@ +export default { + register: `curl -s "https://coinos.io/api/register" -H "application/json" -d '{ + "username": "adam", + "password": "hunter2" +}'`, + login: `curl -s "https://coinos.io/api/login" -H "application/json" -d '{ + "username": "adam", + "password": "hunter2" +}'`, + invoice: `curl -s "https://coinos.io/api/invoice" + -H "application/json" + -H "Authorization: Bearer $token" + -d '{ + "invoice": { + "amount": 1000, + "type": "lightning", + "webhook": "https://example.com/payment/received", + "secret": "hunter2" + }, +}'`, + fetchInvoice: `curl -s "https://coinos.io/api/invoice/bc1qmhfk9stzffhd9umzmld92vff7zg3mdlh7rvvaj" -H "application/json" }'` +}; diff --git a/src/routes/(static)/+layout.server.js b/src/routes/(static)/+layout.server.js new file mode 100644 index 00000000..2deeebc5 --- /dev/null +++ b/src/routes/(static)/+layout.server.js @@ -0,0 +1,16 @@ +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 user; + if (token) { + try { + user = await get('/me', auth(cookies)); + } catch (e) {} + } + + return { user }; +} diff --git a/src/routes/(static)/+layout.svelte b/src/routes/(static)/+layout.svelte index 6e31f17e..3d596dff 100644 --- a/src/routes/(static)/+layout.svelte +++ b/src/routes/(static)/+layout.svelte @@ -1,8 +1,12 @@ - + +
diff --git a/src/routes/(static)/docs/+page.server.js b/src/routes/(static)/docs/+page.server.js new file mode 100644 index 00000000..e80365fa --- /dev/null +++ b/src/routes/(static)/docs/+page.server.js @@ -0,0 +1,4 @@ +export let load = async ({ cookies }) => { + let token = cookies.get('token'); + return { token }; +}; diff --git a/src/routes/(static)/docs/+page.svelte b/src/routes/(static)/docs/+page.svelte index c634cd76..d44204d8 100644 --- a/src/routes/(static)/docs/+page.svelte +++ b/src/routes/(static)/docs/+page.svelte @@ -1,17 +1,67 @@ -Coming soon - - - - - - - - - - - - - + + +
+

API Documentation

+ +

+ Coinos has a simple REST API that can be used to register accounts, fetch data, and make + payments +

+ +

* = required parameter

+ +

Base URL

+
+
https://coinos.io/api
+
+
+ +

Auth Token

+

This JWT authorizes you to use the API

+
+
export token="{token}"
+
+
+ +

POST /register

+

Register a new user account with a username and password

+ + +

POST /login

+

Login to an account to get its auth token

+ + +

POST /invoice

+

Create an invoice.

+
+
+ type: bitcoin or lightning +
+
+ amount: integer satoshis (optional) +
+
+ webhook: a URL that we'll POST to when the invoice is + paid (optional) +
+
+ secret: a secret to send with the POST (optional) +
+
+ + + +

GET /invoice/:hash

+

+ Fetch an invoice by passing a bitcoin address or lightning payment hash +

+ +
+ @@ -73,5 +123,4 @@ Coming soon - - + -- cgit v1.2.3 From 301770cb05331c8cbb32f60b11c62a79c9d28df3 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 27 Feb 2023 19:28:59 -0800 Subject: prettier --- src/components/AppHeader.svelte | 1 - src/components/LandingHeader.svelte | 26 +++++++-------- .../(app)/[username]/invoice/[hash]/+page.svelte | 36 +++++++-------------- src/routes/(app)/payment/[id]/+page.svelte | 37 +++++++++++----------- .../bitcoin/[address]/[...amount]/+page.svelte | 10 ++++-- src/routes/(app)/sent/+page.svelte | 2 +- 6 files changed, 52 insertions(+), 60 deletions(-) (limited to 'src') diff --git a/src/components/AppHeader.svelte b/src/components/AppHeader.svelte index 74afd7b9..51c70851 100644 --- a/src/components/AppHeader.svelte +++ b/src/components/AppHeader.svelte @@ -15,7 +15,6 @@ let menuButtons; if (user) menuButtons = [ - { key: 'nav.profile', icon: 'profile', href: `/${user.username}` }, { key: 'nav.settings', icon: 'settings', href: `/${user.username}/settings` }, { key: 'nav.support', icon: 'support', href: `/support` }, { key: 'nav.signOut', icon: 'logout', href: `/logout` } diff --git a/src/components/LandingHeader.svelte b/src/components/LandingHeader.svelte index f9db5ea0..ed7907c1 100644 --- a/src/components/LandingHeader.svelte +++ b/src/components/LandingHeader.svelte @@ -40,29 +40,29 @@ {/if} - {#if !user} + {#if user} {:else} {/if} diff --git a/src/routes/(app)/[username]/invoice/[hash]/+page.svelte b/src/routes/(app)/[username]/invoice/[hash]/+page.svelte index 2ff92687..fff2b22c 100644 --- a/src/routes/(app)/[username]/invoice/[hash]/+page.svelte +++ b/src/routes/(app)/[username]/invoice/[hash]/+page.svelte @@ -7,7 +7,6 @@ import { last } from '$lib/store'; import { Avatar, Icon, Heart, Image } from '$comp'; import { t } from '$lib/translations'; - import screenfull from 'screenfull'; import { goto, invalidate } from '$app/navigation'; export let data; @@ -67,14 +66,6 @@ $: link = type === 'bitcoin' ? text : `lightning:${text}`; $: txt = type === 'bitcoin' ? hash : text; - let full; - let toggle = () => { - screenfull.toggle(qr); - full = !full; - if (full) src = lg; - else src = sm; - }; - let toggleType = async () => { invoice.type = invoice.type === types.lightning ? types.bitcoin : types.lightning; ({ hash } = await post(`/${username}/invoice`, { @@ -111,21 +102,18 @@
Bitcoin
-
-
- {txt} -
-
+ +
+ + {#if amount > 0} diff --git a/src/routes/(app)/payment/[id]/+page.svelte b/src/routes/(app)/payment/[id]/+page.svelte index b8a23605..2e170a43 100644 --- a/src/routes/(app)/payment/[id]/+page.svelte +++ b/src/routes/(app)/payment/[id]/+page.svelte @@ -26,14 +26,14 @@ {#if p.with}
{amount > 0 ? 'From' : 'To'} - - {/if} @@ -42,18 +42,19 @@
{f(fiat(a, rate), currency)} {#if tip} - - + {f(fiat(tip, rate), currency)} - + + + {f(fiat(tip, rate), currency)} + {/if} - ⚡️{`${s(a)}`} - - {#if tip} - - + ⚡️{s(tip)} - - {/if} - + ⚡️{`${s(a)}`} + + {#if tip} + + + ⚡️{s(tip)} + + {/if} +
diff --git a/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte b/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte index b3a944f4..77d5fde6 100644 --- a/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte +++ b/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte @@ -22,7 +22,7 @@ loading = false; if (form?.message?.includes('pin')) $pin = undefined; if (form) ({ min, max, feeRate, fee, ourfee, subtract } = form); - if (!ourfee) ourfee = 0; + if (!ourfee) ourfee = 0; if (feeRate) confirmed = true; stale = false; }; @@ -77,7 +77,9 @@ {f(toFiat(fee + ourfee, $selectedRate), currency)}

⚡️{s(fee + ourfee)}

- +
{:else} @@ -104,7 +106,9 @@
- +
{/if} diff --git a/src/routes/(app)/sent/+page.svelte b/src/routes/(app)/sent/+page.svelte index 72511487..760d2e1d 100644 --- a/src/routes/(app)/sent/+page.svelte +++ b/src/routes/(app)/sent/+page.svelte @@ -7,7 +7,7 @@ export let data; let { payments, user } = data; - let { currency, username } = user; + let { currency, username } = user; let payment = payments[0]; let { amount, rate, tip } = payment; -- cgit v1.2.3 From 759c053c3ae1eb8f3d885b12cd1a5e7ba11cfa78 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 28 Feb 2023 00:43:53 -0800 Subject: docs --- package.json | 1 + pnpm-lock.yaml | 268 +++++++--------------------------- src/components/Code.svelte | 22 ++- src/lib/samples.js | 9 +- src/routes/(static)/docs/+page.svelte | 29 ++-- 5 files changed, 95 insertions(+), 234 deletions(-) (limited to 'src') diff --git a/package.json b/package.json index ac67d8b3..2af9cbd3 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "leaflet": "^1.9.3", "leaflet.markercluster": "^1.5.3", "nostr": "^0.2.7", + "nostr-tools": "^1.7.1", "postcss": "^8.4.20", "prettier": "^2.8.1", "prettier-plugin-svelte": "^2.9.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a0c68508..1e3d9beb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,6 +16,7 @@ specifiers: leaflet: ^1.9.3 leaflet.markercluster: ^1.5.3 nostr: ^0.2.7 + nostr-tools: ^1.7.1 postcss: ^8.4.20 prettier: ^2.8.1 prettier-plugin-svelte: ^2.9.0 @@ -56,6 +57,7 @@ devDependencies: leaflet: 1.9.3 leaflet.markercluster: 1.5.3_leaflet@1.9.3 nostr: 0.2.7 + nostr-tools: 1.7.1 postcss: 8.4.20 prettier: 2.8.1 prettier-plugin-svelte: 2.9.0_ajxj753sv7dbwexjherrch25ta @@ -278,6 +280,18 @@ packages: resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} dev: false + /@noble/hashes/1.0.0: + resolution: {integrity: sha512-DZVbtY62kc3kkBtMHqwCOfXrT/hnoORy5BJ4+HU1IR59X0KWAOqsfzQPcUl/lQLlG7qXbe/fZ3r/emxtAl+sqg==} + dev: true + + /@noble/hashes/1.2.0: + resolution: {integrity: sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==} + dev: true + + /@noble/secp256k1/1.7.1: + resolution: {integrity: sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==} + dev: true + /@nodelib/fs.scandir/2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -390,6 +404,25 @@ packages: rollup: 3.8.1 dev: false + /@scure/base/1.1.1: + resolution: {integrity: sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==} + dev: true + + /@scure/bip32/1.1.5: + resolution: {integrity: sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw==} + dependencies: + '@noble/hashes': 1.2.0 + '@noble/secp256k1': 1.7.1 + '@scure/base': 1.1.1 + dev: true + + /@scure/bip39/1.1.1: + resolution: {integrity: sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==} + dependencies: + '@noble/hashes': 1.2.0 + '@scure/base': 1.1.1 + dev: true + /@sveltejs/adapter-node/1.1.4_@sveltejs+kit@1.2.10: resolution: {integrity: sha512-3iEBqi1fXLXP9YIbVuz2LXajoebRJCmAFEQbN40DlxAnA7G+InxUgnqFun3q9gBMz2Qvd99K51g/HxWetXRe8Q==} peerDependencies: @@ -584,10 +617,6 @@ packages: /@types/estree/0.0.39: resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==} - /@types/estree/0.0.39: - resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==} - dev: true - /@types/estree/1.0.0: resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==} dev: false @@ -939,10 +968,6 @@ packages: resolution: {integrity: sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==} dev: true - /builtin-status-codes/3.0.0: - resolution: {integrity: sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==} - dev: true - /busboy/1.6.0: resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==} engines: {node: '>=10.16.0'} @@ -1008,14 +1033,6 @@ packages: resolution: {integrity: sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==} dev: true - /console-browserify/1.2.0: - resolution: {integrity: sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==} - dev: true - - /constants-browserify/1.0.0: - resolution: {integrity: sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==} - dev: true - /cookie/0.5.0: resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} engines: {node: '>= 0.6'} @@ -1028,13 +1045,6 @@ packages: elliptic: 6.5.4 dev: true - /create-ecdh/4.0.4: - resolution: {integrity: sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==} - dependencies: - bn.js: 4.12.0 - elliptic: 6.5.4 - dev: true - /create-hash/1.2.0: resolution: {integrity: sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==} dependencies: @@ -1112,14 +1122,6 @@ packages: object-keys: 1.1.1 dev: true - /define-properties/1.1.4: - resolution: {integrity: sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==} - engines: {node: '>= 0.4'} - dependencies: - has-property-descriptors: 1.0.0 - object-keys: 1.1.1 - dev: true - /defined/1.0.1: resolution: {integrity: sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==} dev: true @@ -1462,18 +1464,6 @@ packages: safe-buffer: 5.2.1 dev: true - /events/3.3.0: - resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} - engines: {node: '>=0.8.x'} - dev: true - - /evp_bytestokey/1.0.3: - resolution: {integrity: sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==} - dependencies: - md5.js: 1.3.5 - safe-buffer: 5.2.1 - dev: true - /fast-glob/3.2.12: resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} engines: {node: '>=8.6.0'} @@ -1587,12 +1577,6 @@ packages: get-intrinsic: 1.1.3 dev: true - /gopd/1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - dependencies: - get-intrinsic: 1.1.3 - dev: true - /graceful-fs/4.2.10: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} dev: true @@ -1670,14 +1654,6 @@ packages: has-tostringtag: 1.0.0 dev: true - /is-arguments/1.1.1: - resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - has-tostringtag: 1.0.0 - dev: true - /is-binary-path/2.1.0: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} @@ -1697,11 +1673,6 @@ packages: engines: {node: '>= 0.4'} dev: true - /is-callable/1.2.7: - resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} - engines: {node: '>= 0.4'} - dev: true - /is-core-module/2.11.0: resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==} dependencies: @@ -1738,14 +1709,6 @@ packages: define-properties: 1.1.4 dev: true - /is-nan/1.3.2: - resolution: {integrity: sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.1.4 - dev: true - /is-number/7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} @@ -1773,22 +1736,6 @@ packages: engines: {node: '>=10'} dev: true - /is-typed-array/1.1.10: - resolution: {integrity: sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==} - engines: {node: '>= 0.4'} - dependencies: - available-typed-arrays: 1.0.5 - call-bind: 1.0.2 - for-each: 0.3.3 - gopd: 1.0.1 - has-tostringtag: 1.0.0 - dev: true - - /isomorphic-timers-promises/1.0.1: - resolution: {integrity: sha512-u4sej9B1LPSxTGKB/HiuzvEQnXH0ECYkSVQU39koSwmFAxhlEAFl9RdTvLv4TOTQUgBS5O3O5fwUxk6byBZ+IQ==} - engines: {node: '>=10'} - dev: true - /kleur/4.1.5: resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} engines: {node: '>=6'} @@ -1977,39 +1924,6 @@ packages: vm-browserify: 1.1.2 dev: true - /node-stdlib-browser/1.2.0: - resolution: {integrity: sha512-VSjFxUhRhkyed8AtLwSCkMrJRfQ3e2lGtG3sP6FEgaLKBBbxM/dLfjRe1+iLhjvyLFW3tBQ8+c0pcOtXGbAZJg==} - engines: {node: '>=10'} - dependencies: - assert: 2.0.0 - browser-resolve: 2.0.0 - browserify-zlib: 0.2.0 - buffer: 5.7.1 - console-browserify: 1.2.0 - constants-browserify: 1.0.0 - create-require: 1.1.1 - crypto-browserify: 3.12.0 - domain-browser: 4.22.0 - events: 3.3.0 - https-browserify: 1.0.0 - isomorphic-timers-promises: 1.0.1 - os-browserify: 0.3.0 - path-browserify: 1.0.1 - pkg-dir: 5.0.0 - process: 0.11.10 - punycode: 1.4.1 - querystring-es3: 0.2.1 - readable-stream: 3.6.0 - stream-browserify: 3.0.0 - stream-http: 3.2.0 - string_decoder: 1.3.0 - timers-browserify: 2.0.12 - tty-browserify: 0.0.1 - url: 0.11.0 - util: 0.12.5 - vm-browserify: 1.1.2 - dev: true - /normalize-path/3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} @@ -2020,6 +1934,17 @@ packages: engines: {node: '>=0.10.0'} dev: true + /nostr-tools/1.7.1: + resolution: {integrity: sha512-r72KpbLVz6Gaqei6LIj6m+cyp24eF3myiIMlmv93WCgDFCI5w72u+OrZzjSrJaeE94vYoEJfOF16/2Rl5o5z5w==} + dependencies: + '@noble/hashes': 1.0.0 + '@noble/secp256k1': 1.7.1 + '@scure/base': 1.1.1 + '@scure/bip32': 1.1.5 + '@scure/bip39': 1.1.1 + prettier: 2.8.4 + dev: true + /nostr/0.2.7: resolution: {integrity: sha512-Yq5tkiCTJtohs7H7Fx+Ki83bR8b3xapdwYi17HunhW5EQfZ9rI0cIXFyihj2ZRkv/0YYvVBiCp/KIaLYt5LyfQ==} dependencies: @@ -2098,47 +2023,6 @@ packages: engines: {node: '>=8'} dev: true - /os-browserify/0.3.0: - resolution: {integrity: sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==} - dev: true - - /p-limit/3.1.0: - resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} - engines: {node: '>=10'} - dependencies: - yocto-queue: 0.1.0 - dev: true - - /p-locate/5.0.0: - resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} - engines: {node: '>=10'} - dependencies: - p-limit: 3.1.0 - dev: true - - /pako/1.0.11: - resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} - dev: true - - /parse-asn1/5.1.6: - resolution: {integrity: sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==} - dependencies: - asn1.js: 5.4.1 - browserify-aes: 1.2.0 - evp_bytestokey: 1.0.3 - pbkdf2: 3.1.2 - safe-buffer: 5.2.1 - dev: true - - /path-browserify/1.0.1: - resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} - dev: true - - /path-exists/4.0.0: - resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} - engines: {node: '>=8'} - dev: true - /path-is-absolute/1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} @@ -2158,17 +2042,6 @@ packages: sha.js: 2.4.11 dev: true - /pbkdf2/3.1.2: - resolution: {integrity: sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==} - engines: {node: '>=0.12'} - dependencies: - create-hash: 1.2.0 - create-hmac: 1.1.7 - ripemd160: 2.0.2 - safe-buffer: 5.2.1 - sha.js: 2.4.11 - dev: true - /picocolors/1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} @@ -2273,6 +2146,12 @@ packages: hasBin: true dev: true + /prettier/2.8.4: + resolution: {integrity: sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==} + engines: {node: '>=10.13.0'} + hasBin: true + dev: true + /process/0.11.10: resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} engines: {node: '>= 0.6.0'} @@ -2474,10 +2353,6 @@ packages: resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==} dev: true - /setimmediate/1.0.5: - resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==} - dev: true - /sha.js/2.4.11: resolution: {integrity: sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==} hasBin: true @@ -2542,22 +2417,6 @@ packages: xtend: 4.0.2 dev: true - /stream-browserify/3.0.0: - resolution: {integrity: sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==} - dependencies: - inherits: 2.0.4 - readable-stream: 3.6.0 - dev: true - - /stream-http/3.2.0: - resolution: {integrity: sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A==} - dependencies: - builtin-status-codes: 3.0.0 - inherits: 2.0.4 - readable-stream: 3.6.0 - xtend: 4.0.2 - dev: true - /streamsearch/1.1.0: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} engines: {node: '>=10.0.0'} @@ -2734,13 +2593,6 @@ packages: uint8array-tools: 0.0.7 dev: true - /tiny-secp256k1/2.2.1: - resolution: {integrity: sha512-/U4xfVqnVxJXN4YVsru0E6t5wVncu2uunB8+RVR40fYUxkKYUPS10f+ePQZgFBoE/Jbf9H1NBveupF2VmB58Ng==} - engines: {node: '>=14.0.0'} - dependencies: - uint8array-tools: 0.0.7 - dev: true - /to-regex-range/5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -2757,10 +2609,6 @@ packages: resolution: {integrity: sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==} dev: true - /tty-browserify/0.0.1: - resolution: {integrity: sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==} - dev: true - /typeforce/1.18.0: resolution: {integrity: sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==} dev: true @@ -2946,22 +2794,6 @@ packages: is-typed-array: 1.1.10 dev: true - /vm-browserify/1.1.2: - resolution: {integrity: sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==} - dev: true - - /which-typed-array/1.1.9: - resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==} - engines: {node: '>= 0.4'} - dependencies: - available-typed-arrays: 1.0.5 - call-bind: 1.0.2 - for-each: 0.3.3 - gopd: 1.0.1 - has-tostringtag: 1.0.0 - is-typed-array: 1.1.10 - dev: true - /wif/2.0.6: resolution: {integrity: sha512-HIanZn1zmduSF+BQhkE+YXIbEiH0xPr1012QbFEGB0xsKqJii0/SqJjyn8dFv6y36kOznMgMB+LGcbZTJ1xACQ==} dependencies: diff --git a/src/components/Code.svelte b/src/components/Code.svelte index b3181d0a..0e09191e 100644 --- a/src/components/Code.svelte +++ b/src/components/Code.svelte @@ -5,11 +5,27 @@ export let sample; -
-
{samples[sample]}
+
+
+
{samples[sample]}
+
+ + diff --git a/src/lib/samples.js b/src/lib/samples.js index 4af61822..93b9aa24 100644 --- a/src/lib/samples.js +++ b/src/lib/samples.js @@ -1,13 +1,13 @@ export default { - register: `curl -s "https://coinos.io/api/register" -H "application/json" -d '{ + register: `curl "https://coinos.io/api/register" -H "application/json" -d '{ "username": "adam", "password": "hunter2" }'`, - login: `curl -s "https://coinos.io/api/login" -H "application/json" -d '{ + login: `curl "https://coinos.io/api/login" -H "application/json" -d '{ "username": "adam", "password": "hunter2" }'`, - invoice: `curl -s "https://coinos.io/api/invoice" + invoice: `curl "https://coinos.io/api/invoice" -H "application/json" -H "Authorization: Bearer $token" -d '{ @@ -18,5 +18,6 @@ export default { "secret": "hunter2" }, }'`, - fetchInvoice: `curl -s "https://coinos.io/api/invoice/bc1qmhfk9stzffhd9umzmld92vff7zg3mdlh7rvvaj" -H "application/json" }'` + fetchInvoice: `curl "https://coinos.io/api/invoice/bc1qmhfk9stzffhd9umzmld92vff7zg3mdlh7rvvaj" + -H "application/json"'` }; diff --git a/src/routes/(static)/docs/+page.svelte b/src/routes/(static)/docs/+page.svelte index d44204d8..cb82bd05 100644 --- a/src/routes/(static)/docs/+page.svelte +++ b/src/routes/(static)/docs/+page.svelte @@ -1,10 +1,16 @@ -
+

API Documentation

@@ -16,15 +22,19 @@

Base URL

-
https://coinos.io/api
-
+
{api}
+

Auth Token

This JWT authorizes you to use the API

-
export token="{token}"
-
+
{tokenSample}
+

POST /register

@@ -42,17 +52,17 @@ type: bitcoin or lightning
- amount: integer satoshis (optional) + amount: amount in satoshis
- webhook: a URL that we'll POST to when the invoice is - paid (optional) + webhook: an endpoint to hit when the invoice is paid
- secret: a secret to send with the POST (optional) + secret: a secret string for the webhook to check
+ hey

GET /invoice/:hash

@@ -123,4 +133,5 @@ + -- cgit v1.2.3 From 3651919e5a2e4783b05d8af369f0d24e279b15c8 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 1 Mar 2023 22:40:45 -0800 Subject: support form captcha --- src/routes/(app)/support/+page.server.js | 15 --------- src/routes/(app)/support/+page.svelte | 57 +++++++++++++++++++++----------- src/routes/(app)/support/+server.js | 7 ++++ 3 files changed, 44 insertions(+), 35 deletions(-) delete mode 100644 src/routes/(app)/support/+page.server.js create mode 100644 src/routes/(app)/support/+server.js (limited to 'src') diff --git a/src/routes/(app)/support/+page.server.js b/src/routes/(app)/support/+page.server.js deleted file mode 100644 index 6d0af616..00000000 --- a/src/routes/(app)/support/+page.server.js +++ /dev/null @@ -1,15 +0,0 @@ -import { fd, post } from '$lib/utils'; -import { fail } from '@sveltejs/kit'; - -export const actions = { - default: async ({ cookies, request }) => { - let form = await fd(request); - try { - await post('/email', form); - } catch (e) { - return fail(400, { error: e.message }); - } - - return { success: true }; - } -}; diff --git a/src/routes/(app)/support/+page.svelte b/src/routes/(app)/support/+page.svelte index d00cc069..8dbfc1af 100644 --- a/src/routes/(app)/support/+page.svelte +++ b/src/routes/(app)/support/+page.svelte @@ -1,10 +1,10 @@ + + + + {#if user} {/if} -{#if form?.error} -
- {form.error} -
-{/if} +
+ {#if sent} +

Thank you!

+
Someone will be in touch shortly.
-
- {#if form?.success} -

Thank you!

-

Someone will be in touch shortly.

- - - - + {:else}

{$t('user.support.header')}

-

+

Fill out this form or email us directly at support@coinos.io and we'll do our best to get back to you in a timely manner.

-
+
Date: Wed, 1 Mar 2023 22:54:28 -0800 Subject: disable prerendering --- src/routes/(app)/support/+server.js | 2 ++ src/routes/+page.server.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/routes/(app)/support/+server.js b/src/routes/(app)/support/+server.js index af5fcc66..6b1778a8 100644 --- a/src/routes/(app)/support/+server.js +++ b/src/routes/(app)/support/+server.js @@ -1,6 +1,8 @@ import { json } from '@sveltejs/kit'; import { auth, post } from '$lib/utils'; +export const prerender = false; + export async function POST({ cookies, request }) { let result = await post('/email', await request.json(), auth(cookies)); return json(result); diff --git a/src/routes/+page.server.js b/src/routes/+page.server.js index 4bcc6089..7936e88b 100644 --- a/src/routes/+page.server.js +++ b/src/routes/+page.server.js @@ -1,6 +1,6 @@ import { get } from '$lib/utils'; -export const prerender = true; +// export const prerender = true; export let load = async () => { let data = { locations: [] }; -- cgit v1.2.3 From 0c3cb465a91941531a09cd53f3e4b0b78f24784f Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 3 Mar 2023 12:33:29 -0800 Subject: use div for message input --- src/app.css | 1 - .../(app)/[username]/(profile)/+layout.svelte | 1 - src/routes/(app)/[username]/dashboard/+page.svelte | 1 - src/routes/(app)/[username]/messages/+page.svelte | 36 +++++++++++++--------- .../[username]/payments/[...page]/+page.svelte | 2 +- .../(app)/launch/thanks/[asset]/+page.server.js | 1 - src/routes/(app)/send/[...text]/+page.svelte | 1 - src/routes/(app)/send/invoice/[id]/+page.server.js | 2 +- .../(app)/send/lightning/[payreq]/+page.server.js | 2 +- .../user/[username]/[...amount]/+page.server.js | 2 +- src/routes/(static)/bounties/+page.svelte | 2 +- 11 files changed, 27 insertions(+), 24 deletions(-) delete mode 100644 src/routes/(app)/launch/thanks/[asset]/+page.server.js (limited to 'src') diff --git a/src/app.css b/src/app.css index 12fad732..3a722fb1 100644 --- a/src/app.css +++ b/src/app.css @@ -35,7 +35,6 @@ button.primary { -webkit-appearance: none; -moz-appearance: none; background: transparent; - background-image: url('/icons/down.svg'); background-repeat: no-repeat; background-position-x: 95%; background-position-y: 1em; diff --git a/src/routes/(app)/[username]/(profile)/+layout.svelte b/src/routes/(app)/[username]/(profile)/+layout.svelte index 6eb2a850..133930b1 100644 --- a/src/routes/(app)/[username]/(profile)/+layout.svelte +++ b/src/routes/(app)/[username]/(profile)/+layout.svelte @@ -4,7 +4,6 @@ import { Icon } from '$comp'; import { t } from '$lib/translations'; import { sign, send } from '$lib/nostr'; - import { v4 } from 'uuid'; export let data; let events, user, subject, src, text; diff --git a/src/routes/(app)/[username]/dashboard/+page.svelte b/src/routes/(app)/[username]/dashboard/+page.svelte index 499034e6..d8761ea9 100644 --- a/src/routes/(app)/[username]/dashboard/+page.svelte +++ b/src/routes/(app)/[username]/dashboard/+page.svelte @@ -7,7 +7,6 @@ import { goto } from '$app/navigation'; import { t } from '$lib/translations'; import { events } from '$lib/store'; - import { v4 } from 'uuid'; export let data; $: ({ invoices, requests } = data); diff --git a/src/routes/(app)/[username]/messages/+page.svelte b/src/routes/(app)/[username]/messages/+page.svelte index 5de18c66..7a10d605 100644 --- a/src/routes/(app)/[username]/messages/+page.svelte +++ b/src/routes/(app)/[username]/messages/+page.svelte @@ -2,7 +2,7 @@ import { cubicInOut } from 'svelte/easing'; import { browser } from '$app/environment'; import { t } from '$lib/translations'; - import { format, parseISO } from 'date-fns'; + import { format } from 'date-fns'; import { scale, fade, fly } from 'svelte/transition'; import { enhance } from '$app/forms'; import { Avatar, Icon } from '$comp'; @@ -68,7 +68,6 @@ event.message = message; message = ''; - input.focus(); event.author = user; event.recipient = subject; @@ -92,9 +91,16 @@ message = ''; submitting = false; }; + + let keydown = (e) => { + if (e.key === 'Enter') { + e.preventDefault(); + submit(); + } + }; -
+
- + - - - +
diff --git a/src/routes/(app)/[username]/payments/[...page]/+page.svelte b/src/routes/(app)/[username]/payments/[...page]/+page.svelte index aacba81e..a502f8c3 100644 --- a/src/routes/(app)/[username]/payments/[...page]/+page.svelte +++ b/src/routes/(app)/[username]/payments/[...page]/+page.svelte @@ -1,7 +1,7 @@ -
+
{samples[sample]}
diff --git a/src/components/Footer.svelte b/src/components/Footer.svelte index ae69e70a..7520e5d4 100644 --- a/src/components/Footer.svelte +++ b/src/components/Footer.svelte @@ -5,7 +5,7 @@ const followLinks = [ { url: 'https://twitter.com/coinoswallet', titleID: 'twitter' }, { url: 'https://t.me/coinoswallet', titleID: 'telegram' }, - { url: 'https://linktr.ee/coinos.io', titleID: 'linktree' }, + { url: 'https://linktr.ee/coinos.io', titleID: 'linktree' } ]; const companyLinks = [ diff --git a/src/routes/(app)/[username]/(profile)/+layout.svelte b/src/routes/(app)/[username]/(profile)/+layout.svelte index 133930b1..bbb2379e 100644 --- a/src/routes/(app)/[username]/(profile)/+layout.svelte +++ b/src/routes/(app)/[username]/(profile)/+layout.svelte @@ -59,6 +59,9 @@ t++; }, 10); }; + + let hideBio = true; + let toggleBio = () => (hideBio = false);
@@ -66,7 +69,11 @@

{display || username}

-
+
{subject.address && subject.address !== 'null' ? subject.address : ''}
diff --git a/src/routes/(static)/bounties/+page.svelte b/src/routes/(static)/bounties/+page.svelte index e3670e78..32a962fc 100644 --- a/src/routes/(static)/bounties/+page.svelte +++ b/src/routes/(static)/bounties/+page.svelte @@ -54,8 +54,11 @@

⚡️750,000 will be awarded once the merchant has accepted bitcoin for 6 months. We'll be sending - shadowy supertaggersshadowy supertaggers to check up on them periodically.

diff --git a/src/routes/(static)/docs/+page.svelte b/src/routes/(static)/docs/+page.svelte index cb82bd05..8ddb98cd 100644 --- a/src/routes/(static)/docs/+page.svelte +++ b/src/routes/(static)/docs/+page.svelte @@ -7,7 +7,7 @@ let api = PUBLIC_COINOS_URL + '/api'; if (!token) token = ''; - let tokenSample = `export token="${token}"`; + let tokenSample = `export token="${token}"`;
@@ -31,8 +31,8 @@

Auth Token

This JWT authorizes you to use the API

-
{tokenSample}
-
diff --git a/tailwind.config.cjs b/tailwind.config.cjs index c57db020..1d082420 100644 --- a/tailwind.config.cjs +++ b/tailwind.config.cjs @@ -12,6 +12,6 @@ module.exports = { } } }, - plugins: [require('tailwind-scrollbar')], + plugins: [require('tailwind-scrollbar'), require('@tailwindcss/line-clamp')], safelist: ['w-16', 'h-16', 'w-20', 'h-20', 'w-24', 'h-24'] }; -- cgit v1.2.3 From 555eedf7804cf5fa4f963b7fcffeee4f97c0c911 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 11 Mar 2023 07:54:38 -0800 Subject: homepage update --- src/components/About.svelte | 15 --------------- src/locales/en.json | 16 ++++++++-------- 2 files changed, 8 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/components/About.svelte b/src/components/About.svelte index 0a0ff874..b468750d 100644 --- a/src/components/About.svelte +++ b/src/components/About.svelte @@ -13,21 +13,6 @@ ] }, { name: 'cole', socials: [] }, - { - name: 'john', - socials: [] - }, - { - name: 'shauna', - socials: [ - { type: 'twitter', url: 'https://twitter.com/ShaunaCollister', color: 'bg-[#1D9BF0]' }, - { - type: 'linkedin', - url: 'https://www.linkedin.com/in/shauna-collister-32905214', - color: 'bg-[#0a66c2]' - } - ] - } ]; diff --git a/src/locales/en.json b/src/locales/en.json index 9a50d6b4..4915277a 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -45,15 +45,15 @@ "header": "FAQ", "cost": { "question": "What does it cost?", - "answer": "It's free to register an account and receive payments over the lightning network. We charge a 0.1% fee to convert from lightning to bitcoin." + "answer": "It's free to register an account and receive payments. We charge a 0.1% conversion fee if you withdraw regular bitcoin to lightning or vice versa." }, "compatibility": { "question": "Do I need any special device or software?", - "answer": "No. Coinos is web-based, so as long as you have an internet connection, you can use it on any device. Retail merchants might use it on a phone or a tablet." + "answer": "No. Coinos is web based, so as long as you have an internet connection and a web browser, it works anywhere. Retail merchants might use it on a phone or a tablet." }, "safety": { "question": "When do my funds settle?", - "answer": "Lightning payments are settled instantly. You can withdraw your balance to another wallet or exchange right after payments are received." + "answer": "Lightning payments are settled instantly. You can withdraw your balance to another wallet or exchange immediately once funds are received." } }, "footer": { @@ -79,7 +79,7 @@ }, "step3": { "header": "3. That's all!", - "description": "Spend your coin at other merchants or save it for a rainy day, the choice is yours." + "description": "Spend your coin immediately or save it and watch it grow, the choice is yours." } }, "invoice": { @@ -102,11 +102,11 @@ "landing": { "header_before_icon": "The", "header_with_icon": "easiest", - "header_after_icon": "way to accept bitcoin in your store.", - "subheader": "Grow your customer base and revenue by accepting bitcoin with an easy-to-use web app. No software or hardware required.", + "header_after_icon": "way to get started with bitcoin.", + "subheader": "A simple but powerful web wallet for everyone. No software or hardware required.", "info1": { "title": "Instant payments via Lightning", - "description": "The moment your customer sends a payment, it’s there. No waiting for bank settlements or worrying about chargebacks. Instant settlement, in seconds. Say goodbye to 3% credit card processing fees." + "description": "We make it easy for merchants to receive retail payments. No waiting for bank settlements or worrying about chargebacks. Instant settlement, in seconds. Say goodbye to 3% credit card processing fees." }, "info2": { "title": "Simple to use", @@ -116,7 +116,7 @@ }, "info3": { "title": "Brand it your way!", - "description": "Customize your point of sale look and feel, or keep it on default - it's totally up to you." + "description": "Customize your profile page look and feel, or keep it on default - it's totally up to you." } }, "login": { -- cgit v1.2.3 From 2810139cfb19643527c8be4589ab1562c441f618 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 11 Mar 2023 10:21:02 -0800 Subject: prompt for tip on internal payments --- src/routes/(app)/send/invoice/[id]/+page.server.js | 14 ++++++++----- src/routes/(app)/send/invoice/[id]/+page.svelte | 24 +++++++++++++++++----- src/routes/(app)/sent/+page.server.js | 1 + 3 files changed, 29 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/routes/(app)/send/invoice/[id]/+page.server.js b/src/routes/(app)/send/invoice/[id]/+page.server.js index 3db03123..c3ae0945 100644 --- a/src/routes/(app)/send/invoice/[id]/+page.server.js +++ b/src/routes/(app)/send/invoice/[id]/+page.server.js @@ -1,22 +1,26 @@ import { error, fail, redirect } from '@sveltejs/kit'; import { fd, auth, get, post } from '$lib/utils'; -export async function load({ params: { id }, parent }) { +export async function load({ params: { id }, parent, url }) { let { user } = await parent(); - let { amount, address, tip, text, user: recipient } = await get(`/invoice/${id}`); + let { amount, address, rate, prompt, tip, text, user: recipient } = await get(`/invoice/${id}`); + + console.log("AMOUNT, TIP", amount, tip) + + if (prompt && tip === null) throw redirect(307, `/${recipient.username}/invoice/${id}/tip`); if (recipient.username === user.username) throw error(500, { message: 'Cannot send to self' }); - if (tip) amount += tip; - return { amount, address, payreq: text, recipient }; + return { amount, address, tip, rate, payreq: text, recipient }; } export const actions = { default: async ({ cookies, params: { hash }, request }) => { try { let body = await fd(request); - body.amount = parseInt(body.amount); body.hash = hash; + console.log("SENDING BODY", body) + await post('/payments', body, auth(cookies)); } catch (e) { return fail(400, { message: e.message }); diff --git a/src/routes/(app)/send/invoice/[id]/+page.svelte b/src/routes/(app)/send/invoice/[id]/+page.svelte index 7570a61a..c9cb9392 100644 --- a/src/routes/(app)/send/invoice/[id]/+page.svelte +++ b/src/routes/(app)/send/invoice/[id]/+page.svelte @@ -5,11 +5,11 @@ import { enhance } from '$app/forms'; import { Avatar, Icon, Numpad, Spinner } from '$comp'; import { page } from '$app/stores'; - import { back, f, s, sats } from '$lib/utils'; + import { back, f, fiat as toFiat, s, sats } from '$lib/utils'; export let data; export let form; - let { address, payreq, recipient, user } = data; + let { address, payreq, recipient, rate, tip, user } = data; let { currency } = user; let amount = form?.amount || data.amount; @@ -49,9 +49,23 @@

{$t('payments.send')}

-

- {fiat ? f(amountFiat, currency) : '⚡️' + s(amount)} -

+

+ {f(toFiat(amount, rate), currency)} + {#if tip} + + + {f(toFiat(tip, rate), currency)} + + {/if} +

+

+ ⚡️{s(amount)} + + {#if tip} + + + ⚡️{s(tip)} + + {/if} +

{$t('payments.to')}

diff --git a/src/routes/(app)/sent/+page.server.js b/src/routes/(app)/sent/+page.server.js index 381ff32f..cfd43472 100644 --- a/src/routes/(app)/sent/+page.server.js +++ b/src/routes/(app)/sent/+page.server.js @@ -2,5 +2,6 @@ import { get, auth } from '$lib/utils'; export let load = async ({ cookies }) => { let { payments } = await get('/payments', auth(cookies)); + console.log("HUH", payments[0]) return { payments }; }; -- cgit v1.2.3 From 9b5f8947c05ee59225ffa100e4ebd83d2a243b57 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 11 Mar 2023 16:23:15 -0800 Subject: rm log --- src/routes/(app)/send/invoice/[id]/+page.server.js | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src') diff --git a/src/routes/(app)/send/invoice/[id]/+page.server.js b/src/routes/(app)/send/invoice/[id]/+page.server.js index c3ae0945..0d23d307 100644 --- a/src/routes/(app)/send/invoice/[id]/+page.server.js +++ b/src/routes/(app)/send/invoice/[id]/+page.server.js @@ -6,8 +6,6 @@ export async function load({ params: { id }, parent, url }) { let { amount, address, rate, prompt, tip, text, user: recipient } = await get(`/invoice/${id}`); - console.log("AMOUNT, TIP", amount, tip) - if (prompt && tip === null) throw redirect(307, `/${recipient.username}/invoice/${id}/tip`); if (recipient.username === user.username) throw error(500, { message: 'Cannot send to self' }); return { amount, address, tip, rate, payreq: text, recipient }; @@ -19,8 +17,6 @@ export const actions = { let body = await fd(request); body.hash = hash; - console.log("SENDING BODY", body) - await post('/payments', body, auth(cookies)); } catch (e) { return fail(400, { message: e.message }); -- cgit v1.2.3 From ffb2a1c2ccfeb8d6002644e2fcefe60a7fd20d05 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 11 Mar 2023 16:36:40 -0800 Subject: prompt for tip --- src/components/About.svelte | 2 +- .../(app)/[username]/invoice/[hash]/+layout.server.js | 2 +- src/routes/(app)/send/invoice/[id]/+page.server.js | 2 +- .../(app)/send/user/[username]/[...amount]/+page.svelte | 16 +++++----------- src/routes/(app)/sent/+page.server.js | 2 +- 5 files changed, 9 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/components/About.svelte b/src/components/About.svelte index b468750d..4292b9fd 100644 --- a/src/components/About.svelte +++ b/src/components/About.svelte @@ -12,7 +12,7 @@ { type: 'github', url: 'https://github.com/asoltys', color: 'bg-gray-800' } ] }, - { name: 'cole', socials: [] }, + { name: 'cole', socials: [] } ]; diff --git a/src/routes/(app)/[username]/invoice/[hash]/+layout.server.js b/src/routes/(app)/[username]/invoice/[hash]/+layout.server.js index b5323d3f..7cf87e14 100644 --- a/src/routes/(app)/[username]/invoice/[hash]/+layout.server.js +++ b/src/routes/(app)/[username]/invoice/[hash]/+layout.server.js @@ -19,7 +19,7 @@ export async function load({ depends, params, url, parent }) { if (paid && !url.pathname.endsWith('paid')) throw redirect(307, `/${params.username}/invoice/${hash}/paid`); - let sm = Qr.drawImg(invoice.text, { size: 300 }); + let sm = Qr.drawImg(invoice.text || '', { size: 300 }); return { hash, invoice, sm, lg: sm }; } diff --git a/src/routes/(app)/send/invoice/[id]/+page.server.js b/src/routes/(app)/send/invoice/[id]/+page.server.js index 0d23d307..261345fa 100644 --- a/src/routes/(app)/send/invoice/[id]/+page.server.js +++ b/src/routes/(app)/send/invoice/[id]/+page.server.js @@ -6,7 +6,7 @@ export async function load({ params: { id }, parent, url }) { let { amount, address, rate, prompt, tip, text, user: recipient } = await get(`/invoice/${id}`); - if (prompt && tip === null) throw redirect(307, `/${recipient.username}/invoice/${id}/tip`); + if (prompt && tip === null) throw redirect(307, `/${recipient.username}/invoice/${id}/tip`); if (recipient.username === user.username) throw error(500, { message: 'Cannot send to self' }); return { amount, address, tip, rate, payreq: text, recipient }; } diff --git a/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte b/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte index 1bb88277..af6a6368 100644 --- a/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte +++ b/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte @@ -30,11 +30,15 @@ ({ hash } = await post(`/${subject.username}/invoice`, { invoice: { amount, + hash: 'internal', rate: rates[subject.currency], + prompt: subject.prompt, type: 'internal' }, user: subject })); + + goto(`/${subject.username}/invoice/${hash}`); }; let loading; @@ -56,17 +60,7 @@ {/if}
- {#if amount} -

Sending

-
-

- {f(amountFiat, currency)} -

-

{sat(amount)}

-
- {:else} - - {/if} +
diff --git a/src/routes/(app)/sent/+page.server.js b/src/routes/(app)/sent/+page.server.js index cfd43472..d949906a 100644 --- a/src/routes/(app)/sent/+page.server.js +++ b/src/routes/(app)/sent/+page.server.js @@ -2,6 +2,6 @@ import { get, auth } from '$lib/utils'; export let load = async ({ cookies }) => { let { payments } = await get('/payments', auth(cookies)); - console.log("HUH", payments[0]) + console.log('HUH', payments[0]); return { payments }; }; -- cgit v1.2.3 From f5eaf3eac19e0e2902b894effb14b58cc8c21d2d Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 11 Mar 2023 17:47:15 -0800 Subject: fix param name --- src/routes/(app)/[username]/invoice/+server.js | 6 ++++-- .../(app)/[username]/invoice/[hash]/tip/+page.svelte | 4 ++++ src/routes/(app)/send/invoice/[id]/+page.server.js | 17 +++++++++++++---- src/routes/(app)/sent/+page.server.js | 1 - 4 files changed, 21 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/routes/(app)/[username]/invoice/+server.js b/src/routes/(app)/[username]/invoice/+server.js index 1321739e..461d380c 100644 --- a/src/routes/(app)/[username]/invoice/+server.js +++ b/src/routes/(app)/[username]/invoice/+server.js @@ -1,5 +1,7 @@ import { auth, post } from '$lib/utils'; import { json } from '@sveltejs/kit'; -export let POST = async ({ cookies: c, request: r }) => - json(await post('/invoice', await r.json(), auth(c))); +export let POST = async ({ cookies: c, request: r }) => { + let j = await r.json(); + return json(await post('/invoice', j, auth(c))); +}; diff --git a/src/routes/(app)/[username]/invoice/[hash]/tip/+page.svelte b/src/routes/(app)/[username]/invoice/[hash]/tip/+page.svelte index 296ef9c6..9d9021a6 100644 --- a/src/routes/(app)/[username]/invoice/[hash]/tip/+page.svelte +++ b/src/routes/(app)/[username]/invoice/[hash]/tip/+page.svelte @@ -59,6 +59,7 @@ let { invoice, id, user } = data; let { amount, + hash, type, rate, received, @@ -79,6 +80,7 @@ ({ invoice, id } = data); ({ amount, + hash, type, rate, received, @@ -110,6 +112,8 @@ + +

{$t('invoice.addTipq')}

diff --git a/src/routes/(app)/send/invoice/[id]/+page.server.js b/src/routes/(app)/send/invoice/[id]/+page.server.js index 261345fa..c9c2b222 100644 --- a/src/routes/(app)/send/invoice/[id]/+page.server.js +++ b/src/routes/(app)/send/invoice/[id]/+page.server.js @@ -4,18 +4,27 @@ import { fd, auth, get, post } from '$lib/utils'; export async function load({ params: { id }, parent, url }) { let { user } = await parent(); - let { amount, address, rate, prompt, tip, text, user: recipient } = await get(`/invoice/${id}`); + let { + amount, + address, + hash, + rate, + prompt, + tip, + text, + user: recipient + } = await get(`/invoice/${id}`); if (prompt && tip === null) throw redirect(307, `/${recipient.username}/invoice/${id}/tip`); if (recipient.username === user.username) throw error(500, { message: 'Cannot send to self' }); - return { amount, address, tip, rate, payreq: text, recipient }; + return { amount, address, hash, tip, rate, payreq: text, recipient }; } export const actions = { - default: async ({ cookies, params: { hash }, request }) => { + default: async ({ cookies, params: { id }, request }) => { try { let body = await fd(request); - body.hash = hash; + body.hash = id; await post('/payments', body, auth(cookies)); } catch (e) { diff --git a/src/routes/(app)/sent/+page.server.js b/src/routes/(app)/sent/+page.server.js index d949906a..381ff32f 100644 --- a/src/routes/(app)/sent/+page.server.js +++ b/src/routes/(app)/sent/+page.server.js @@ -2,6 +2,5 @@ import { get, auth } from '$lib/utils'; export let load = async ({ cookies }) => { let { payments } = await get('/payments', auth(cookies)); - console.log('HUH', payments[0]); return { payments }; }; -- cgit v1.2.3 From a865df6eb042bb305d2f880386fd6d9e5551ec4d Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 13 Mar 2023 00:44:43 -0700 Subject: payments page formatting --- .../[username]/payments/[...page]/+page.svelte | 32 +++++++++--------- src/routes/(app)/payment/[id]/+page.svelte | 39 +++++++++++++--------- 2 files changed, 40 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/routes/(app)/[username]/payments/[...page]/+page.svelte b/src/routes/(app)/[username]/payments/[...page]/+page.svelte index a502f8c3..84891b92 100644 --- a/src/routes/(app)/[username]/payments/[...page]/+page.svelte +++ b/src/routes/(app)/[username]/payments/[...page]/+page.svelte @@ -60,9 +60,11 @@ payments = payments.map((p) => ({ ...p, created: new Date(p.created), + total: p.amount + p.tip || 0, amount_fiat: f((p.amount * p.rate) / sats, p.currency), fee_fiat: p.fee ? f((p.fee * p.rate) / sats, p.currency) : null, - tip_fiat: p.tip ? f((p.tip * p.rate) / sats, p.currency) : null + tip_fiat: p.tip ? f((p.tip * p.rate) / sats, p.currency) : null, + total_fiat: f(((p.amount + p.tip || 0) * p.rate) / sats, p.currency) })); let keys = [ @@ -72,11 +74,13 @@ 'rate', 'currency', 'amount', - 'fee', 'tip', + 'total', + 'fee', 'amount_fiat', - 'fee_fiat', - 'tip_fiat' + 'tip_fiat', + 'total_fiat', + 'fee_fiat' ]; let csv = @@ -143,24 +147,20 @@
{/if} -
Amount
{f(fiat(a, rate), currency)} - {#if tip} - - + {f(fiat(tip, rate), currency)} - - {/if} - ⚡️{`${s(a)}`} - - {#if tip} - - + ⚡️{s(tip)} - - {/if} + + ⚡️{s(a)}
+ {#if tip} +
+ Tip +
+ {f(fiat(tip, rate), currency)} + + ⚡️{s(tip)} + +
+
+ +
+ Total +
+ {f(fiat(a + tip || 0, rate), currency)} + ⚡️{`${s(a + tip || 0)}`} +
+
+ {/if} +
Network fee
{f(fiat(fee, rate), currency)} - ⚡️{`${s(fee)}`} + ⚡️{`${s(fee)}`}
-- cgit v1.2.3 From cfa8570d59cbf89bc83b4ab9a6264ff776b1af90 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 13 Mar 2023 00:49:08 -0700 Subject: order of operations --- src/routes/(app)/[username]/payments/[...page]/+page.svelte | 8 ++++---- src/routes/(app)/payment/[id]/+page.svelte | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/routes/(app)/[username]/payments/[...page]/+page.svelte b/src/routes/(app)/[username]/payments/[...page]/+page.svelte index 84891b92..aa2ad72b 100644 --- a/src/routes/(app)/[username]/payments/[...page]/+page.svelte +++ b/src/routes/(app)/[username]/payments/[...page]/+page.svelte @@ -60,11 +60,11 @@ payments = payments.map((p) => ({ ...p, created: new Date(p.created), - total: p.amount + p.tip || 0, + total: p.amount + (p.tip || 0), amount_fiat: f((p.amount * p.rate) / sats, p.currency), fee_fiat: p.fee ? f((p.fee * p.rate) / sats, p.currency) : null, tip_fiat: p.tip ? f((p.tip * p.rate) / sats, p.currency) : null, - total_fiat: f(((p.amount + p.tip || 0) * p.rate) / sats, p.currency) + total_fiat: f(((p.amount + (p.tip || 0)) * p.rate) / sats, p.currency) })); let keys = [ @@ -147,8 +147,8 @@
-
- {f((Math.abs(p.amount) + p.tip || 0) * (p.rate / sats), p.currency)} +
+ {f((Math.abs(p.amount) + (p.tip || 0)) * (p.rate / sats), p.currency)} {#if p.tip} {f(Math.abs(p.amount) * (p.rate / sats), p.currency)} + {f( diff --git a/src/routes/(app)/payment/[id]/+page.svelte b/src/routes/(app)/payment/[id]/+page.svelte index c3f8cdf0..34e2d327 100644 --- a/src/routes/(app)/payment/[id]/+page.svelte +++ b/src/routes/(app)/payment/[id]/+page.svelte @@ -61,8 +61,8 @@
Total
- {f(fiat(a + tip || 0, rate), currency)} - ⚡️{`${s(a + tip || 0)}`} + {f(fiat(a + (tip || 0), rate), currency)} + ⚡️{`${s(a + (tip || 0))}`}
{/if} -- cgit v1.2.3 From e060d628c03cce102ecdc5dd77b0d2b7a7634eae Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 13 Mar 2023 10:05:26 -0700 Subject: fix amount display --- src/routes/(app)/[username]/payments/[...page]/+page.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/routes/(app)/[username]/payments/[...page]/+page.svelte b/src/routes/(app)/[username]/payments/[...page]/+page.svelte index aa2ad72b..4e2e6ede 100644 --- a/src/routes/(app)/[username]/payments/[...page]/+page.svelte +++ b/src/routes/(app)/[username]/payments/[...page]/+page.svelte @@ -160,7 +160,7 @@
- {sat(p.amount + p.tip)} + {sat(p.amount + (p.tip || 0))}
-- cgit v1.2.3 From 77219cc4fa9e75d2ca2f740f024c17aa5dda9129 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 13 Mar 2023 13:19:35 -0700 Subject: fix tip display --- src/routes/(app)/[username]/invoice/[hash]/paid/+page.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/routes/(app)/[username]/invoice/[hash]/paid/+page.svelte b/src/routes/(app)/[username]/invoice/[hash]/paid/+page.svelte index 3a281728..4d7aae51 100644 --- a/src/routes/(app)/[username]/invoice/[hash]/paid/+page.svelte +++ b/src/routes/(app)/[username]/invoice/[hash]/paid/+page.svelte @@ -21,7 +21,7 @@ {#if received}

{$t('invoice.paymentSuccessful')}

- {f(fiat(received - tip, rate), currency)} + {f(fiat(received, rate), currency)} {#if tip} + {f(fiat(tip, rate), currency)} @@ -29,7 +29,7 @@ {/if}

- ⚡️{s(received - tip)} + ⚡️{s(received)} {#if tip} @@ -48,7 +48,7 @@ {/if}

- ⚡️{s(pending - tip)} + ⚡️{s(pending)} {#if tip} + ⚡️{s(tip)} -- cgit v1.2.3 From 45063c606338af61fce751adc99b4369956ec163 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 13 Mar 2023 20:22:37 -0700 Subject: translations update --- src/locales/en.json | 11 +------- src/locales/es.json | 29 +++++----------------- .../[username]/(profile)/followers/+page.svelte | 3 ++- .../[username]/(profile)/follows/+page.svelte | 3 ++- .../[username]/settings/[...tab]/+page.svelte | 2 +- src/routes/(app)/sent/+page.svelte | 2 +- 6 files changed, 13 insertions(+), 37 deletions(-) (limited to 'src') diff --git a/src/locales/en.json b/src/locales/en.json index 4915277a..180a15f2 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -15,20 +15,10 @@ "position": "Chief Technical Officer", "bio": "Adam is a web developer and bitcoin enthusiast who believes sound money is key to increasing global prosperity. He lives in North Vancouver with his wife Chelsea and two children." }, - "shauna": { - "name": "Shauna", - "position": "Operations & Marketing", - "bio": "Strategic & Project Management. Jack of all Trades. Can always find time to meet for coffee." - }, "cole": { "name": "Cole", "position": "Certified Bitcoin Professional", "bio": "Cole is a driven individual with a passion for freedom. He came across bitcoin in 2016 and studied it in depth. Now he wants to introduce the lightning network to as many users as possible." - }, - "john": { - "name": "John Barratt", - "position": "Full Stack Web Developer", - "bio": "When not coding you can find John out in the woods hiking all the great trails that BC has to offer." } }, "locations": { @@ -195,6 +185,7 @@ "placeholder": "Paste a bitcoin address, lightning invoice or coinos username" }, "settings": { + "saveSettings": "Save Settings", "bannerImage": "Banner Image", "profileImage": "Profile Image", "oneTimeCode": "Enter one-time code", diff --git a/src/locales/es.json b/src/locales/es.json index 8e68a5f3..5a2a5123 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -15,31 +15,10 @@ "position": "Director de Tecnología", "bio": "Adam es un desarrollador web y un entusiasta de bitcoin que cree que el dinero sólido es clave para aumentar la prosperidad global. Vive en la ciudad de North Vancouver con su esposa Chelsea y sus dos hijos." }, - "secondl1ght": { - "name": "secondl1ght", - "position": "Desarrollador Web", - "bio": "Desarrollador web autodidacta, se sumergió de cabeza en con el bitcoin y dejó su trabajo fiduciario para concentrarse en el desarrollo de bitcoin a tiempo completo. Contribuye en proyectos de código abierto, es un defensor de la privacidad y un amante de la libertad." - }, - - "karnage": { - "name": "Karnage", - "position": "Diseñador de Producto", - "bio": "Mi misión es ayudar a los fundadores de startups a tener éxito. Creo productos para lograr estos objetivos. Diseño de producto con píxeles perfectos. Haz que te lo envíen." - }, - "shauna": { - "name": "Shauna", - "position": "Operaciones y Mercadeo", - "bio": "Gestión Estratégica y de Proyectos. Sé un poco de todo. Siempre habrá tiempo para compartir un buen café." - }, "cole": { "name": "Cole", "position": "Profesional de Bitcoin", "bio": "Como profesional certificado de Bitcoin, Cole es una persona motivada y apasionada por la libertad. Conoció el bitcoin en 2016 y lo estudió en profundidad. Ahora quiere presentarle la Red Lightning a tantos usuarios como sea posible." - }, - "john": { - "name": "John Barratt", - "position": "Desarrollador Web Full Stack", - "bio": "Cuando no está programando, podemos encontrar a John en el bosque recorriendo todos los grandes senderos que British Columbia tiene para ofrecer." } }, "locations": { @@ -165,6 +144,7 @@ "invoice": "Factura", "unfollow": "Dejar de seguir", "following": "Siguiendo", + "followers": "Seguidores", "follow": "Seguir", "remove": "Eliminar", "scanToPayBTC": "Escanear para pagar con bitcoin", @@ -198,6 +178,9 @@ "placeholder": "Asigne una dirección de bitcoin, una factura lightning o un usuario de coinos" }, "settings": { + "saveSettings": "Guardar ajustes", + "tipPrompt": "Solicitar propinas", + "tipPromptDescription": "Pregunta a las personas si quieren agregar una propina antes de pagar sus facturas", "bannerImage": "Imagen del Banner", "profileImage": "Imagen de perfil", "oneTimeCode": "Ingrese el código de un solo uso", @@ -243,7 +226,7 @@ "send": "Enviar" } }, - "transactions": { + "payments": { "header": "Transacciones", "AMOUNT": "CANTIDAD", "TYPE": "TIPO", @@ -253,7 +236,7 @@ "empty": "Aún no hay transacciones.", "send": "Enviado", "next": "Siguiente", - "sendersChoice": "Sender's choice", + "sendersChoice": "Elección del remitente", "sendTo": "Enviar a", "to": "para", "pay": "Pagar", diff --git a/src/routes/(app)/[username]/(profile)/followers/+page.svelte b/src/routes/(app)/[username]/(profile)/followers/+page.svelte index 77b337b6..9c425449 100644 --- a/src/routes/(app)/[username]/(profile)/followers/+page.svelte +++ b/src/routes/(app)/[username]/(profile)/followers/+page.svelte @@ -1,4 +1,5 @@ + + +
+ +
diff --git a/src/routes/(app)/admin/+page.server.js b/src/routes/(app)/admin/+page.server.js new file mode 100644 index 00000000..c4079a2f --- /dev/null +++ b/src/routes/(app)/admin/+page.server.js @@ -0,0 +1,10 @@ +import { get } from '$lib/utils'; +import { redirect } from '@sveltejs/kit'; + +export async function load({ parent }) { + let { user } = await parent(); + if (!user) throw redirect(307, '/login'); + + let users = (await get('/users')).sort((a, b) => b.balance - a.balance); + return { users }; +} diff --git a/src/routes/(app)/admin/+page.svelte b/src/routes/(app)/admin/+page.svelte new file mode 100644 index 00000000..1a747f1f --- /dev/null +++ b/src/routes/(app)/admin/+page.svelte @@ -0,0 +1,11 @@ + + +{#each users as { balance, username }} +
+
{username}
+
{balance}
+
+{/each} diff --git a/src/routes/(app)/payment/[id]/+page.svelte b/src/routes/(app)/payment/[id]/+page.svelte index 34e2d327..cf30db35 100644 --- a/src/routes/(app)/payment/[id]/+page.svelte +++ b/src/routes/(app)/payment/[id]/+page.svelte @@ -62,7 +62,7 @@ Total
{f(fiat(a + (tip || 0), rate), currency)} - ⚡️{`${s(a + (tip || 0))}`} + ⚡️{`${s(a + (tip || 0))}`}

{/if} diff --git a/src/routes/(app)/sent/+page.svelte b/src/routes/(app)/sent/+page.svelte index 72973c50..dbd18c2e 100644 --- a/src/routes/(app)/sent/+page.svelte +++ b/src/routes/(app)/sent/+page.svelte @@ -20,7 +20,7 @@
-

{$t('payments.sent')}!

+

{$t('payments.sent')}!

{f(fiat(amount, rate), currency)} {#if tip} -- cgit v1.2.3