From cc6bc08706dcbc657b76ddb07ee1c4bdb6107249 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 27 Feb 2023 19:28:09 -0800 Subject: api docs --- src/routes/(static)/docs/+page.server.js | 4 ++ src/routes/(static)/docs/+page.svelte | 81 +++++++++++++++++++++++++------- 2 files changed, 69 insertions(+), 16 deletions(-) create mode 100644 src/routes/(static)/docs/+page.server.js (limited to 'src/routes/(static)/docs') 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