diff options
| author | Adam Soltys <[email protected]> | 2026-02-11 20:10:43 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-11 20:10:43 -0800 |
| commit | 56a04684c1fb77ea7b21afc6b0d2e1c4773906f6 (patch) | |
| tree | d6bc2557c56b93177bb14aa376847c6e123a4862 /src/routes/(static)/docs | |
| parent | 13466248004327e9a026cb89f94926f9b060d1c1 (diff) | |
| download | coinos-ui-56a04684c1fb77ea7b21afc6b0d2e1c4773906f6.tar.gz coinos-ui-56a04684c1fb77ea7b21afc6b0d2e1c4773906f6.zip | |
format
Diffstat (limited to 'src/routes/(static)/docs')
| -rw-r--r-- | src/routes/(static)/docs/+page.svelte | 67 |
1 files changed, 20 insertions, 47 deletions
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=<your auth token>`; + let tokenSample = token ? `export token="${token}"` : `export token=<your auth token>`; let roSample = `export token="${ro}"`; </script> {#snippet cp(something)} - <button - type="button" - class="ml-auto" - onclick={() => copy(something)} - aria-label="Copy value" - > + <button type="button" class="ml-auto" onclick={() => copy(something)} aria-label="Copy value"> <iconify-icon noobserver icon="ph:copy-bold" width="42"></iconify-icon> </button> {/snippet} @@ -40,17 +33,15 @@ </p> <p class="text-secondary"> - 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 <a + 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 <a href="https://curl.se/" class="text-secondary underline">curl</a > </p> <h2 class="text-2xl">API Base URL</h2> - <div - class="bg-primary text-primary-content rounded-lg p-4 flex gap-4 items-center" - > + <div class="bg-primary text-primary-content rounded-lg p-4 flex gap-4 items-center"> <div>{api}</div> {@render cp(api)} </div> @@ -60,38 +51,32 @@ {#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. + <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. It gives full - access to your account so keep it safe. + Save it in a variable called <b>$token</b> to run the examples. It gives full access to your account + so keep it safe. </p> - <div - class="bg-primary text-primary-content rounded-lg p-4 flex gap-4 items-center" - > + <div class="bg-primary text-primary-content rounded-lg p-4 flex gap-4 items-center"> <div class="w-full break-all">{tokenSample}</div> {@render cp(tokenSample)} </div> {#if ro} <p class="text-secondary"> - 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 </p> - <div - class="bg-primary text-primary-content rounded-lg p-4 flex gap-4 items-center" - > + <div class="bg-primary text-primary-content rounded-lg p-4 flex gap-4 items-center"> <div class="w-full break-all">{roSample}</div> {@render cp(roSample)} </div> {/if} <h2 class="text-2xl">POST /register</h2> - <p class="text-secondary"> - Register a new user account with a username and password - </p> + <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> @@ -111,13 +96,9 @@ <div class="font-bold">display</div> <div class="col-span-2">string - spaces allowed</div> <div class="font-bold">currency</div> - <div class="col-span-2"> - string - three-letter ISO currency code e.g. CAD or USD - </div> + <div class="col-span-2">string - three-letter ISO currency code e.g. CAD or USD</div> <div class="font-bold">language</div> - <div class="col-span-2"> - string - two-letter language code e.g. en, fr, es - </div> + <div class="col-span-2">string - two-letter language code e.g. en, fr, es</div> </div> <Code sample="update" /> @@ -131,19 +112,13 @@ <div class="font-bold">type (string, default: lightning)</div> <div class="col-span-2">bitcoin or lightning</div> <div class="font-bold">fiat (boolean, default: false)</div> - <div class="col-span-2"> - whether the amount is denominated in satoshis or local currency - </div> + <div class="col-span-2">whether the amount is denominated in satoshis or local currency</div> <div class="font-bold">amount (numeric)</div> <div class="col-span-2">amount to be paid</div> <div class="font-bold">webhook (string, optional)</div> - <div class="col-span-2"> - remote endpoint to call when the invoice is paid - </div> + <div class="col-span-2">remote endpoint to call when the invoice is paid</div> <div class="font-bold">secret (string, optional)</div> - <div class="col-span-2"> - a secret value passed to the webhook to authenticate the request - </div> + <div class="col-span-2">a secret value passed to the webhook to authenticate the request</div> </div> </div> @@ -178,9 +153,7 @@ <Code sample="bitcoin" /> <h2 class="text-2xl">GET /payments</h2> - <p class="text-secondary"> - Get all payments sent or received by the current user - </p> + <p class="text-secondary">Get all payments sent or received by the current user</p> <div class="text-secondary"> <div>Query params</div> |
