{ "name": "coinos", "version": "0.0.1", "private": true, "scripts": { "start": "nodemon index.js", "generate": "sequelize-automate -c config/index.js", "min": "DEBUG=debug SCOPE=MIN nodemon index.js", "debug": "DEBUG=debug nodemon index.js" }, "dependencies": { "@asoltys/bitcoin-core": "^3.0.7", "async-mutex": "^0.2.4", "axios": "^0.21.1", "bcrypt": "^5.0.0", "bip32": "^2.0.5", "bip39": "^3.0.2", "bitcoinjs-lib": "6", "body-parser": "^1.19.0", "bolt11": "^1.3.2", "buffer-reverse": "^1.0.1", "clightning-client": "^0.1.2", "coinselect": "^3.1.12", "compression": "^1.7.4", "cookie-parser": "^1.4.4", "cors": "^2.8.5", "date-fns": "^2.21.3", "ecpair": "^2.0.1", "express": "4.17.1", "express-async-handler": "^1.1.4", "express-pino-logger": "^6.0.0", "express-session": "^1.16.2", "http-proxy-middleware": "^0.20.0", "imap": "^0.8.19", "jsonwebtoken": "^8.5.1", "knex": "^0.95.6", "lightning": "^3.5.0", "liquidjs-lib": "https://github.com/asoltys/liquidjs-lib#4a0bb0c4b38d327ec247d49e89219798fb0b28e2", "lnurl": "0.19", "long": "^4.0.0", "mailgun-js": "^0.22.0", "mariadb": "^2.4.0", "multer": "^1.4.2", "mysql": "^2.18.1", "mysql2": "^2.2.5", "node-fetch": "^2.6.1", "nodemon": "^2.0.7", "otplib": "^12.0.1", "passport": "0.4.0", "passport-jwt": "^4.0.0", "passport-local": "1.0.0", "pino": "^6.13.2", "pino-pretty": "^7.0.0", "pm2": "^5.1.0", "query-string": "^6.13.1", "sequelize": "^5.21.3", "sqlite3": "^5.0.2", "tiny-secp256k1": "^2.1.2", "uuid": "8", "web-push": "^3.4.4", "wretch": "^1.7.4", "ws": "^7.4.6", "zeromq": "6.0.0-beta.6" }, "devDependencies": { "prettier": "^1.18.2" }, "apidoc": { "title": "CoinOS Server API Documentation", "url": "https://coinos.io/api" } } alue='master'>master coinos ui — legacy coinos.io web app (SvelteKit)coinos
aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/samples.ts
blob: ae7ef6d5c912576c817d48132ea2eda094173c68 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import { PUBLIC_COINOS_URL, PUBLIC_DOMAIN } from "$env/static/public";

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

export default {
	me: `curl "${api}/me" -H "content-type: application/json"`,
	update: `curl "${api}/user" -H "content-type: application/json" -d '{
    "username": "demo",
  }'`,
	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 "Authorization: Bearer $token"
  -d '{
    "payreq": "lnbc1pj94d8fsp5n77k340ps4m9jn7kp8he8yynpddvurv6mcsrrqpnq5l2jxdxzlwqpp5m96pqhc5nrlk8cqsu9ufdxxa43sarp8vwf9egvm2pg9nl0zu9r8qdq2vdhkjmn0wvxqztgcqpjrzjqwhmav82kntsppmkp8jp4vg4h9nns78tsy8mg7ve4lq5txrkp0h56zlarvqqdtcqqsqqqqqqqqqqp6cq9q9qyysgqzxlypywzphyujm3ga5j5csfcmqvlnae0fgnvymkaaw94eeg7py5rqzysyjkr3ev2snq63qpsc69vf54adkd0szvmvwt5cuadjnuy95sq4xfa40"
}'`,
	bitcoin: `curl "${api}/bitcoin/send" 
  -H "content-type: application/json" 
  -H "Authorization: Bearer $token"
  -d '{
    "amount": 5000,
    "address": "bc1q3unh97w4rmelflrm2hvdwz37d8kray3vn4d5ca"
}'`,
	internal: `curl "${api}/send" 
  -H "content-type: application/json" 
  -H "Authorization: Bearer $token"
  -d '{
    "amount": 5000,
    "username": "alice"
}'`,
	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`,
};