From 7974e1565a0dc3a1809d84fefc1feb90b0d83383 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 10 May 2023 14:05:26 -0700 Subject: update docs --- src/components/Code.svelte | 4 +-- src/lib/samples.js | 59 ++++++++++++++++++++++++++------ src/lib/utils.js | 6 ++++ src/routes/(static)/docs/+page.svelte | 63 +++++++++++++++++++++++------------ 4 files changed, 97 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/components/Code.svelte b/src/components/Code.svelte index a718c5ed..dd0cecf2 100644 --- a/src/components/Code.svelte +++ b/src/components/Code.svelte @@ -1,5 +1,5 @@
@@ -14,10 +14,10 @@

Coinos has a simple REST API that can be used to register accounts and make payments and - queries. + queries. The following examples show how you can call the API with curl from your command line.

-

Base URL

+

API Base URL

{api}
- {#if token} -

Auth Token

-

This token authorizes you to use the API as {user.username}

-
-
{tokenSample}
- -
- {/if} +

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

@@ -61,11 +68,19 @@
- +

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 many satoshis have been paid so far

+

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

@@ -73,6 +88,16 @@

+

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

@@ -90,10 +115,4 @@ - -

Websocket API

-

Subscribe to real time rates and payments

- -
Authenticate
- -- cgit v1.2.3