From 64853b801688edf7a8858b7c1135502e5882823c Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 19 Dec 2022 23:16:03 -0800 Subject: docs page --- src/routes/(static)/+layout.svelte | 3 + src/routes/(static)/docs/+page.svelte | 74 ++++++++++++++++++++++ src/routes/(static)/news/+page.svelte | 115 ++++++++++++++++++++++++++++++++++ 3 files changed, 192 insertions(+) create mode 100644 src/routes/(static)/+layout.svelte create mode 100644 src/routes/(static)/docs/+page.svelte create mode 100644 src/routes/(static)/news/+page.svelte (limited to 'src/routes/(static)') diff --git a/src/routes/(static)/+layout.svelte b/src/routes/(static)/+layout.svelte new file mode 100644 index 00000000..2eb47149 --- /dev/null +++ b/src/routes/(static)/+layout.svelte @@ -0,0 +1,3 @@ +
+ +
diff --git a/src/routes/(static)/docs/+page.svelte b/src/routes/(static)/docs/+page.svelte new file mode 100644 index 00000000..5361c87e --- /dev/null +++ b/src/routes/(static)/docs/+page.svelte @@ -0,0 +1,74 @@ +

API Examples

+
{`
+api="https://coinos.io/api"
+json="Content-Type: application/json"
+
+username=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
+password="pw"
+
+echo Create user $username with password $password
+curl -s "$api/register" -H "$json" -d '{"user": {"username": "'$username'", "password": "'$password'", "confirm": "'$password'"}}' > /dev/null
+echo ""
+
+echo Login and get an API token
+token=$(curl -s "$api/taboggan" -H "$json" -d '{"username": "'$username'", "password": "'$password'"}' | jq -r .token)
+echo $token
+echo ""
+
+username="apidemo"
+token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFwaWRlbW8iLCJpYXQiOjE2NDAxMzIwNjd9.aBtcrnLjDS_Zixn5_X_N8sqX0KxTDrVySSqh1fa96rk"
+auth="Authorization: Bearer $token"
+
+echo Get account balance in satoshis
+curl -s "$api/me" -H "$json" -H "$auth" | jq '.account.balance'
+echo ""
+
+echo Get the current price of bitcoin in USD
+curl -s "$api/rates" -H "$json" | jq '.USD'
+echo ""
+
+echo Create a legacy Bitcoin address 
+address=$(curl -s "$api/address?network=bitcoin&type=legacy" -H "$auth" -H "$json" | jq -r .address)
+echo $address
+echo ""
+
+echo Create an invoice to associate the address with the user
+curl -s "$api/invoice" -H "$json" -d '{"invoice": {"address": "'$address'", "network": "bitcoin"}, "user": {"username": "'$username'"}}' > /dev/null
+echo ""
+
+msg="testingtesting123"
+echo Sign a message with the address: $msg $address
+curl -s "$api/signMessage" -H "$json" -H "$auth" -d '{"address": "'$address'", "message": "'$msg'"}'
+echo ""
+
+echo Create a bech32 Bitcoin address 
+address=$(curl -s "$api/address?network=bitcoin&type=bech32" -H "$auth" -H "$json" | jq -r .address)
+echo $address
+echo ""
+
+echo Create a lightning invoice
+text=$(curl -s "$api/lightning/invoice" -H "$auth" -H "$json" -d '{"amount": 100}')
+echo $text
+echo ""
+
+echo Associate the lightning invoice with the user
+curl -s "$api/invoice" -H "$json" -d '{"invoice": {"text": "'$text'", "network": "bitcoin"}, "user": {"username": "'$username'"}}' > /dev/null
+echo ""
+
+echo Get an external invoice
+payreq=$(curl -s https://legend.lnbits.com/api/v1/payments -H "$json" -H "x-api-key: 698e5b6744f8442880ba3ad630756c02" -d '{ "out": false, "amount": 50, "memo": "test", "unit": "sat", "lnurl_callback": null }' | jq -r .payment_request)
+echo $payreq
+echo ""
+
+echo Send a lightning payment
+curl -s "$api/lightning/send" -H "$json" -H "$auth" -d '{"payreq": "'$payreq'"}' | jq -r '{ amount, fee, balance: (.account.balance)}'
+echo ""
+
+echo Send a bitcoin payment
+tx=$(curl -s "$api/bitcoin/fee" -H "$json" -H "$auth" -d '{"address": "bc1qqc9azhdjjpdxenrndt8cw4tw9del5pyrjn0wln", "amount": 1200, "feeRate": 1000 }')
+hex=$(echo $tx | jq -r .tx.hex)
+fee=$(echo $tx | jq -r .tx.fee)
+
+curl -s "$api/bitcoin/send" -H "$json" -H "$auth" -d '{"address": "bc1qqc9azhdjjpdxenrndt8cw4tw9del5pyrjn0wln", "tx": { "hex": "'$hex'", "fee": "'$fee'" }}' | jq -r '{ amount, fee, balance: (.account.balance)}'
+echo ""
+`}
diff --git a/src/routes/(static)/news/+page.svelte b/src/routes/(static)/news/+page.svelte new file mode 100644 index 00000000..7eb1b7d9 --- /dev/null +++ b/src/routes/(static)/news/+page.svelte @@ -0,0 +1,115 @@ + + + + + +
+

{$t('news.header')}

+ +

{$t('news.subheader')}

+ +

Press Release - coinos Redesign - September 23, 2022

+ +

+ Today coinos is launching a new and improved interface for their open source web wallet, + allowing businesses to accept bitcoin with no setup or merchant fees. +

+ +

+ coinos is a web-based bitcoin payment application that is mobile and tablet friendly with handy + currency conversion and reporting features. bitcoin is the world's leading crypto currency. It + offers a secure and inexpensive way for people all over the globe to make and accept payments. +

+ +
+ coinos has enabled businesses to accept bitcoin since 2012, but now we have made it even + easier with a new simple, friendly and customizable interface for both businesses and customers to + use. +
+ Adam Soltys +
+ Adam Soltys + Founder and CTO +
+
+
+ +

+ coinos started as an indie bitcoin wallet created by Adam Soltys with the intention of providing + people with a fast, cheap, and easy way to get started with bitcoin. It's free to register an + account and you can sign up with just a username and password. +

+ +

Why accept bitcoin?

+
+ + We have already brought on some local businesses, here in Vancouver, and the business owners are + excited about the opportunity coinos is giving them to attract new customers by being able to accept + bitcoin. With coinos there are no set up fees, no merchant fees and transactions are safe and secure + with payments going directly to the business owner's wallet. There is no middle person. +
+ Adam Soltys +
+ Cole Goodwin + Bitcoin Professional +
+
+
+ +

coinos Timeline

+ + +

Contacts

+ +

+ Adam Soltys - Founder & CTO
+ adam@coinos.io +

+ +

+ Cole Goodwin - Bitcoin Professional
+ cole@coinos.io +

+ +

+ Shauna Collister - Operations & Marketing
+ shauna@coinos.io +

+
+ +