diff options
| author | Adam Soltys <[email protected]> | 2023-12-15 15:43:47 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-12-15 15:43:47 -0800 |
| commit | 2018722898a38722edebe9854707b6e622c79fb8 (patch) | |
| tree | 043db5b8e14b4dc388356fc133e57255d5c9add9 /src/lib | |
| parent | 7d598265e60eecf06a27501a85e8db330aeed381 (diff) | |
| download | coinos-ui-2018722898a38722edebe9854707b6e622c79fb8.tar.gz coinos-ui-2018722898a38722edebe9854707b6e622c79fb8.zip | |
update sample url
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/samples.js | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/lib/samples.js b/src/lib/samples.js index 1a1f5d9c..4d02ff37 100644 --- a/src/lib/samples.js +++ b/src/lib/samples.js @@ -1,32 +1,38 @@ +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 "https://coinos.io/api/register" -H "content-type: application/json" -d '{ + register: `curl "${api}/register" -H "content-type: application/json" -d '{ "user": { "username": "demo", "password": "hunter2" } }'`, - login: `curl "https://coinos.io/api/login" -H "content-type: application/json" -d '{ + login: `curl "${api}/login" -H "content-type: application/json" -d '{ "username": "demo", "password": "hunter2" }'`, - payments: `curl "https://coinos.io/api/payments" + payments: `curl "${api}/payments" -H "content-type: application/json" -H "Authorization: Bearer $token" `, - lightning: `curl "https://coinos.io/api/payments" + lightning: `curl "${api}/payments" -H "content-type: application/json" -H "Authorization: Bearer $token" -d '{ "payreq": "lnbc1pj94d8fsp5n77k340ps4m9jn7kp8he8yynpddvurv6mcsrrqpnq5l2jxdxzlwqpp5m96pqhc5nrlk8cqsu9ufdxxa43sarp8vwf9egvm2pg9nl0zu9r8qdq2vdhkjmn0wvxqztgcqpjrzjqwhmav82kntsppmkp8jp4vg4h9nns78tsy8mg7ve4lq5txrkp0h56zlarvqqdtcqqsqqqqqqqqqqp6cq9q9qyysgqzxlypywzphyujm3ga5j5csfcmqvlnae0fgnvymkaaw94eeg7py5rqzysyjkr3ev2snq63qpsc69vf54adkd0szvmvwt5cuadjnuy95sq4xfa40" }'`, - bitcoin: `curl "https://coinos.io/api/payments" + bitcoin: `curl "${api}/payments" -H "content-type: application/json" -H "Authorization: Bearer $token" -d '{ "amount": 5000, "hash": "bc1q3unh97w4rmelflrm2hvdwz37d8kray3vn4d5ca" }'`, - internal: `HASH=$(curl "https://coinos.io/api/invoice" + internal: `HASH=$(curl "${api}/invoice" -H "content-type: application/json" -H "Authorization: Bearer $token" -d '{ @@ -39,17 +45,17 @@ export default { } }' | jq -r '.hash'); - curl "https://coinos.io/api/payments" + curl "${api}/payments" -H "content-type: application/json" -H "Authorization: Bearer $token" -d '{ "amount": 5000, "hash": $HASH }'`, - rates: `curl "https://coinos.io/api/rates" + rates: `curl "${api}/rates" -H "content-type: application/json" }'`, - lightningInvoice: `curl "https://coinos.io/api/invoice" + lightningInvoice: `curl "${api}/invoice" -H "content-type: application/json" -H "Authorization: Bearer $token" -d '{ @@ -58,7 +64,7 @@ export default { "type": "lightning" } }'`, - bitcoinAddress: `curl "https://coinos.io/api/invoice" + bitcoinAddress: `curl "${api}/invoice" -H "content-type: application/json" -H "Authorization: Bearer $token" -d '{ @@ -67,7 +73,7 @@ export default { "type": "bitcoin" } }'`, - webhook: `curl "https://coinos.io/api/invoice" + webhook: `curl "${api}/invoice" -H "content-type: application/json" -H "Authorization: Bearer $token" -d '{ @@ -77,7 +83,7 @@ export default { "secret": "webhooksecret" } }'`, - fetchInvoice: `curl "https://coinos.io/api/invoice/bc1qmhfk9stzffhd9umzmld92vff7zg3mdlh7rvvaj" + fetchInvoice: `curl "${api}/invoice/bc1qmhfk9stzffhd9umzmld92vff7zg3mdlh7rvvaj" -H "content-type: application/json"'`, invoiceResponse: `{ "amount":3141 |
