From 216a600224fde22ce76b367557a02094ec693886 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 1 Dec 2023 20:04:13 -0800 Subject: prettier --- src/routes/(static)/docs/+page.server.js | 4 +- src/routes/(static)/docs/+page.svelte | 241 ++++++++++++++++--------------- 2 files changed, 127 insertions(+), 118 deletions(-) (limited to 'src/routes/(static)/docs') 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 @@
-

Documentation

- -

- 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 curl from your command line. -

- -

API Base URL

-
-
{api}
- -
- -

Auth Token

-

- {#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. - {/if} - - Save it in a variable called $token to run the examples. -

- -
-
{tokenSample}
- -
- -

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.

- -
-
Request params
-
-
type
-
bitcoin or lightning
-
amount
-
amount in satoshis
-
webhook
-
(optional) endpoint to hit when the invoice is paid
-
secret
-
a secret for the webhook to check
-
-
- -

Get a lightning invoice to receive funds

- - -

Get a bitcoin address to receive funds

- - -

Sample response

- -

You can check the received field to see how much has been paid

- -

Specify a webhook to be called when an invoice is paid

- - -

GET /invoice/:hash

-

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

- - -

POST /payments

-

Send a lightning payment

- - -

Send a bitcoin payment

- - -

Send an internal payment to another user

- - -

GET /payments

-

Get all payments sent or received by the current user

- -
-
Query params
-
-
start
-
only payments after this unix time
-
end
-
only payments before this unix time
-
limit
-
limit to this integer number of results
-
offset
-
start limiting from this integer offset
-
-
- +

Documentation

+ +

+ 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 curl from your command + line. +

+ +

API Base URL

+
+
{api}
+ +
+ +

Auth Token

+

+ {#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. + {/if} + + Save it in a variable called $token to run the examples. +

+ +
+
{tokenSample}
+ +
+ +

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.

+ +
+
Request params
+
+
type
+
bitcoin or lightning
+
amount
+
amount in satoshis
+
webhook
+
+ (optional) endpoint to hit when the invoice is paid +
+
secret
+
a secret for the webhook to check
+
+
+ +

Get a lightning invoice to receive funds

+ + +

Get a bitcoin address to receive funds

+ + +

Sample response

+ +

You can check the received field to see how much has been paid

+ +

Specify a webhook to be called when an invoice is paid

+ + +

GET /invoice/:hash

+

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

+ + +

POST /payments

+

Send a lightning payment

+ + +

Send a bitcoin payment

+ + +

Send an internal payment to another user

+ + +

GET /payments

+

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

+ +
+
Query params
+
+
start
+
only payments after this unix time
+
end
+
only payments before this unix time
+
limit
+
limit to this integer number of results
+
offset
+
start limiting from this integer offset
+
+
+
-- cgit v1.2.3