From 56a04684c1fb77ea7b21afc6b0d2e1c4773906f6 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 11 Feb 2026 20:10:43 -0800 Subject: format --- src/routes/(static)/docs/+page.svelte | 67 +++++++++++------------------------ 1 file changed, 20 insertions(+), 47 deletions(-) (limited to 'src/routes/(static)/docs') diff --git a/src/routes/(static)/docs/+page.svelte b/src/routes/(static)/docs/+page.svelte index 51b1f54e..fc803158 100644 --- a/src/routes/(static)/docs/+page.svelte +++ b/src/routes/(static)/docs/+page.svelte @@ -11,20 +11,13 @@ ? `${PUBLIC_COINOS_URL}` : `https://${PUBLIC_DOMAIN}/api`; - let tokenSample = token - ? `export token="${token}"` - : `export token=`; + let tokenSample = token ? `export token="${token}"` : `export token=`; let roSample = `export token="${ro}"`; {#snippet cp(something)} - {/snippet} @@ -40,17 +33,15 @@

- Coinos has a REST API that can be used to register accounts and make - payments. The following examples show how you can call the API with curl

API Base URL

-
+
{api}
{@render cp(api)}
@@ -60,38 +51,32 @@ {#if user && token} This token authorizes you to use the API as {user.username}. {:else} - Sign in to view your auth token here, - or get one from the /login endpoint. + Sign in to view your auth token here, or get one from the + /login endpoint. {/if} - Save it in a variable called $token to run the examples. It gives full - access to your account so keep it safe. + Save it in a variable called $token to run the examples. It gives full access to your account + so keep it safe.

-
+
{tokenSample}
{@render cp(tokenSample)}
{#if ro}

- This read-only token has permission to create invoices and fetch payments - but can't be used to make withdrawals + This read-only token has permission to create invoices and fetch payments but can't be used to + make withdrawals

-
+
{roSample}
{@render cp(roSample)}
{/if}

POST /register

-

- Register a new user account with a username and password -

+

Register a new user account with a username and password

POST /login

@@ -111,13 +96,9 @@
display
string - spaces allowed
currency
-
- string - three-letter ISO currency code e.g. CAD or USD -
+
string - three-letter ISO currency code e.g. CAD or USD
language
-
- string - two-letter language code e.g. en, fr, es -
+
string - two-letter language code e.g. en, fr, es
@@ -131,19 +112,13 @@
type (string, default: lightning)
bitcoin or lightning
fiat (boolean, default: false)
-
- whether the amount is denominated in satoshis or local currency -
+
whether the amount is denominated in satoshis or local currency
amount (numeric)
amount to be paid
webhook (string, optional)
-
- remote endpoint to call when the invoice is paid -
+
remote endpoint to call when the invoice is paid
secret (string, optional)
-
- a secret value passed to the webhook to authenticate the request -
+
a secret value passed to the webhook to authenticate the request
@@ -178,9 +153,7 @@

GET /payments

-

- Get all payments sent or received by the current user -

+

Get all payments sent or received by the current user

Query params
-- cgit v1.2.3