aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/samples.js
blob: 4d02ff3793a4a7512043d69bf56babff09af0615 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888 } /* Comment */
.highlight .err { color: #A61717; background-color: #E3D2D2 } /* Error */
.highlight .k { color: #080; font-weight: bold } /* Keyword */
.highlight .ch { color: #888 } /* Comment.Hashbang */
.highlight .cm { color: #888 } /* Comment.Multiline */
.highlight .cp { color: #C00; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888 } /* Comment.Single */
.highlight .cs { color: #C00; font-weight: bold; background-color: #FFF0F0 } /* Comment.Special */
.highlight .gd { color: #000; background-color: #FDD } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #A00 } /* Generic.Error */
.highlight .gh { color: #333 } /* Generic.Heading */
.highlight .gi { color: #000; background-color: #DFD } /* Generic.Inserted */
.highlight .go { color: #888 } /* Generic.Output */
.highlight .gp { color: #555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666 } /* Generic.Subheading */
.highlight .gt { color: #A00 } /* Generic.Traceback */
.highlight .kc { color: #080; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #080; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #080; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #080 } /* Keyword.Pseudo */
.highli
import { PUBLIC_DOMAIN, PUBLIC_COINOS_URL } from "$env/static/public";

let api = PUBLIC_DOMAIN.includes("localhost")
  ? `${PUBLIC_COINOS_URL}`
  : `https://${PUBLIC_DOMAIN}/api`;

export default {
  register: `curl "${api}/register" -H "content-type: application/json" -d '{
  "user": {
    "username": "demo",
    "password": "hunter2"
  }
}'`,
  login: `curl "${api}/login" -H "content-type: application/json" -d '{
  "username": "demo",
  "password": "hunter2"
}'`,
  payments: `curl "${api}/payments" 
  -H "content-type: application/json" 
  -H "Authorization: Bearer $token"
`,
  lightning: `curl "${api}/payments" 
  -H "content-type: application/json" 
  -H "Authoriz
nl0zu9r8qdq2vdhkjmn0wvxqztgcqpjrzjqwhmav82kntsppmkp8jp4vg4h9nns78tsy8mg7ve4lq5txrkp0h56zlarvqqdtcqqsqqqqqqqqqqp6cq9q9qyysgqzxlypywzphyujm3ga5j5csfcmqvlnae0fgnvymkaaw94eeg7py5rqzysyjkr3ev2snq63qpsc69vf54adkd0szvmvwt5cuadjnuy95sq4xfa40" }'`, bitcoin: `curl "${api}/payments" -H "content-type: application/json" -H "Authorization: Bearer $token" -d '{ "amount": 5000, "hash": "bc1q3unh97w4rmelflrm2hvdwz37d8kray3vn4d5ca" }'`, internal: `HASH=$(curl "${api}/invoice" -H "content-type: application/json" -H "Authorization: Bearer $token" -d '{ "invoice": { "amount": 1000, "type": "lightning" }, "user": { "username": "alice" } }' | jq -r '.hash'); curl "${api}/payments" -H "content-type: application/json" -H "Authorization: Bearer $token" -d '{ "amount": 5000, "hash": $HASH }'`, rates: `curl "${api}/rates" -H "content-type: application/json" }'`, lightningInvoice: `curl "${api}/invoice" -H "content-type: application/json" -H "Authorization: Bearer $token" -d '{ "invoice": { "amount": 1000, "type": "lightning" } }'`, bitcoinAddress: `curl "${api}/invoice" -H "content-type: application/json" -H "Authorization: Bearer $token" -d '{ "invoice": { "amount": 3141, "type": "bitcoin" } }'`, webhook: `curl "${api}/invoice" -H "content-type: application/json" -H "Authorization: Bearer $token" -d '{ "invoice": { "type": "lightning", "webhook": "https://example.com/payment/received", "secret": "webhooksecret" } }'`, fetchInvoice: `curl "${api}/invoice/bc1qmhfk9stzffhd9umzmld92vff7zg3mdlh7rvvaj" -H "content-type: application/json"'`, invoiceResponse: `{ "amount":3141 "tip":0 "type":"bitcoin" "prompt":false "rate":31836.9702667 "hash":"bc1qmhfk9stzffhd9umzmld92vff7zg3mdlh7rvvaj" "text":"bitcoin:bc1qmhfk9stzffhd9umzmld92vff7zg3mdlh7rvvaj?amount=0.00003141" "currency":"CAD" "uid":"a9770421-3f65-11ed-9f57-0242ac2a0004" "received":0 "created":1677537428134 }`, socketAuth: `echo '{"type":"login","data":{"username":"user","password":"password"}}' | websocat -n https://coinos.io/ws`, };