Add ws link to curl examples (#3063)
This commit is contained in:
parent
681730a4af
commit
0c76efa2b9
4 changed files with 51 additions and 10 deletions
|
|
@ -85,7 +85,12 @@
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
<code><span class="text-light-green">GET</span> /api/v1/wallet</code>
|
<code><span class="text-light-green">GET</span> /api/v1/wallet</code>
|
||||||
<h5 class="text-caption q-mt-sm q-mb-none">Headers</h5>
|
<h5 class="text-caption q-mt-sm q-mb-none">Headers</h5>
|
||||||
<code>{"X-Api-Key": "<i v-text="wallet.inkey"></i>"}</code><br />
|
<code
|
||||||
|
>{"X-Api-Key": "<i
|
||||||
|
v-text="inkeyHidden ? '****************' : wallet.inkey"
|
||||||
|
></i
|
||||||
|
>"}</code
|
||||||
|
><br />
|
||||||
<h5 class="text-caption q-mt-sm q-mb-none">
|
<h5 class="text-caption q-mt-sm q-mb-none">
|
||||||
Returns 200 OK (application/json)
|
Returns 200 OK (application/json)
|
||||||
</h5>
|
</h5>
|
||||||
|
|
@ -96,7 +101,8 @@
|
||||||
<h5 class="text-caption q-mt-sm q-mb-none">Curl example</h5>
|
<h5 class="text-caption q-mt-sm q-mb-none">Curl example</h5>
|
||||||
<code
|
<code
|
||||||
>curl <span v-text="baseUrl"></span>api/v1/wallet -H "X-Api-Key:
|
>curl <span v-text="baseUrl"></span>api/v1/wallet -H "X-Api-Key:
|
||||||
<i v-text="wallet.inkey"></i>"</code
|
<i v-text="inkeyHidden ? '****************' : wallet.inkey"></i
|
||||||
|
>"</code
|
||||||
>
|
>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
@ -112,7 +118,12 @@
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
<code><span class="text-light-green">POST</span> /api/v1/payments</code>
|
<code><span class="text-light-green">POST</span> /api/v1/payments</code>
|
||||||
<h5 class="text-caption q-mt-sm q-mb-none">Headers</h5>
|
<h5 class="text-caption q-mt-sm q-mb-none">Headers</h5>
|
||||||
<code>{"X-Api-Key": "<i v-text="wallet.inkey"></i>"}</code><br />
|
<code
|
||||||
|
>{"X-Api-Key": "<i
|
||||||
|
v-text="inkeyHidden ? '****************' : wallet.inkey"
|
||||||
|
></i
|
||||||
|
>"}</code
|
||||||
|
><br />
|
||||||
<h5 class="text-caption q-mt-sm q-mb-none">Body (application/json)</h5>
|
<h5 class="text-caption q-mt-sm q-mb-none">Body (application/json)</h5>
|
||||||
<code
|
<code
|
||||||
>{"out": false, "amount": <int>, "memo": <string>,
|
>{"out": false, "amount": <int>, "memo": <string>,
|
||||||
|
|
@ -130,8 +141,9 @@
|
||||||
<code
|
<code
|
||||||
>curl -X POST <span v-text="baseUrl"></span>api/v1/payments -d
|
>curl -X POST <span v-text="baseUrl"></span>api/v1/payments -d
|
||||||
'{"out": false, "amount": <int>, "memo": <string>}' -H
|
'{"out": false, "amount": <int>, "memo": <string>}' -H
|
||||||
"X-Api-Key: <i v-text="wallet.inkey"></i>" -H "Content-type:
|
"X-Api-Key:
|
||||||
application/json"</code
|
<i v-text="inkeyHidden ? '****************' : wallet.inkey"></i>" -H
|
||||||
|
"Content-type: application/json"</code
|
||||||
>
|
>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
@ -218,7 +230,12 @@
|
||||||
/api/v1/payments/<payment_hash></code
|
/api/v1/payments/<payment_hash></code
|
||||||
>
|
>
|
||||||
<h5 class="text-caption q-mt-sm q-mb-none">Headers</h5>
|
<h5 class="text-caption q-mt-sm q-mb-none">Headers</h5>
|
||||||
<code>{"X-Api-Key": "{{ wallet.inkey }}"}</code>
|
<code
|
||||||
|
>{"X-Api-Key": "<i
|
||||||
|
v-text="inkeyHidden ? '****************' : wallet.inkey"
|
||||||
|
></i
|
||||||
|
>"}</code
|
||||||
|
>
|
||||||
<h5 class="text-caption q-mt-sm q-mb-none">
|
<h5 class="text-caption q-mt-sm q-mb-none">
|
||||||
Returns 200 OK (application/json)
|
Returns 200 OK (application/json)
|
||||||
</h5>
|
</h5>
|
||||||
|
|
@ -227,11 +244,33 @@
|
||||||
<code
|
<code
|
||||||
>curl -X GET
|
>curl -X GET
|
||||||
<span v-text="baseUrl"></span>api/v1/payments/<payment_hash> -H
|
<span v-text="baseUrl"></span>api/v1/payments/<payment_hash> -H
|
||||||
"X-Api-Key: <i v-text="wallet.inkey"></i>" -H "Content-type:
|
"X-Api-Key:
|
||||||
application/json"</code
|
<i v-text="inkeyHidden ? '****************' : wallet.inkey"></i>" -H
|
||||||
|
"Content-type: application/json"</code
|
||||||
>
|
>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
<q-card>
|
||||||
|
<q-card-section>
|
||||||
|
<code
|
||||||
|
><span class="text-pink">WS</span>
|
||||||
|
/api/v1/ws/<invoice_key></code
|
||||||
|
>
|
||||||
|
<h5
|
||||||
|
class="text-caption q-mt-sm q-mb-none"
|
||||||
|
v-text="$t('websocket_example')"
|
||||||
|
></h5>
|
||||||
|
<code
|
||||||
|
>wscat -c <span v-text="websocketUrl"></span>/<span
|
||||||
|
v-text="inkeyHidden ? '****************' : wallet.inkey"
|
||||||
|
></span
|
||||||
|
></code>
|
||||||
|
<h5 class="text-caption q-mt-sm q-mb-none">
|
||||||
|
Returns 200 OK (application/json)/payments
|
||||||
|
</h5>
|
||||||
|
<code>{"balance": <int>, "payment": <object>}</code>
|
||||||
|
</q-card-section>
|
||||||
|
</q-card>
|
||||||
</q-expansion-item>
|
</q-expansion-item>
|
||||||
<q-separator></q-separator>
|
<q-separator></q-separator>
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
|
|
|
||||||
2
lnbits/static/bundle.min.js
vendored
2
lnbits/static/bundle.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -568,5 +568,6 @@ window.localisation.en = {
|
||||||
view_list: 'View wallets as list',
|
view_list: 'View wallets as list',
|
||||||
view_column: 'View wallets as rows',
|
view_column: 'View wallets as rows',
|
||||||
filter_payments: 'Filter payments',
|
filter_payments: 'Filter payments',
|
||||||
filter_date: 'Filter by date'
|
filter_date: 'Filter by date',
|
||||||
|
websocket_example: 'Websocket example'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ window.WalletPageLogic = {
|
||||||
return {
|
return {
|
||||||
origin: window.location.origin,
|
origin: window.location.origin,
|
||||||
baseUrl: `${window.location.protocol}//${window.location.host}/`,
|
baseUrl: `${window.location.protocol}//${window.location.host}/`,
|
||||||
|
websocketUrl: `${'http:' ? 'ws://' : 'wss://'}${window.location.host}/api/v1/ws`,
|
||||||
parse: {
|
parse: {
|
||||||
show: false,
|
show: false,
|
||||||
invoice: null,
|
invoice: null,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue