Skip to content

Commit 44e9360

Browse files
authored
v1.2.5 (#42)
* refactor: change withdraw / deposit limits * refactor: get config from api * chore: bump version * chore: updates dependencies
1 parent 000f4de commit 44e9360

File tree

17 files changed

+1225
-1530
lines changed

17 files changed

+1225
-1530
lines changed

apps/api/package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@
2323
"dependencies": {
2424
"@ln-markets/api": "1.7.0",
2525
"bech32": "2.0.0",
26-
"bip32": "3.0.1",
26+
"bip32": "3.1.0",
2727
"bip39": "3.0.4",
2828
"cors": "2.8.5",
2929
"cuid": "2.1.8",
30-
"express": "4.18.1",
31-
"express-session": "1.17.2",
30+
"express": "4.18.2",
31+
"express-session": "1.17.3",
3232
"express-winston": "4.2.0",
33-
"helmet": "5.0.2",
34-
"ln-service": "53.15.0",
35-
"node-fetch": "3.2.4",
33+
"helmet": "6.0.0",
34+
"ln-service": "54.2.3",
35+
"node-fetch": "3.2.10",
3636
"secp256k1": "4.0.3",
3737
"tiny-secp256k1": "2.2.1",
38-
"winston": "3.7.2",
38+
"winston": "3.8.2",
3939
"ws": "8.6.0"
4040
},
4141
"nodemonConfig": {
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import LNMarketsAPI from '#src/classes/lnmarkets-api.js'
2+
3+
export default async (req, res, next) => {
4+
try {
5+
const { max_withdraw_amount } = await LNMarketsAPI.appConfiguration()
6+
7+
res.json({ max_withdraw_amount })
8+
} catch (error) {
9+
next(error)
10+
}
11+
}

apps/api/src/routes/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import express from 'express'
33
import isAuth from '#src/middleware/auth.js'
44

55
import auth from './auth/get.js'
6+
import configuration from './configuration/get.js'
67
import futures from './futures/get.js'
78
import options from './options/get.js'
89
import user from './user/index.js'
@@ -13,5 +14,6 @@ router.get('/auth', [isAuth], auth)
1314
router.get('/futures', [isAuth], futures)
1415
router.get('/options', [isAuth], options)
1516
router.use('/user', user)
17+
router.get('/configuration', configuration)
1618

1719
export default router

apps/front/package.json

+10-14
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,21 @@
1616
"format": "prettier --write 'src/**/*.js'"
1717
},
1818
"dependencies": {
19-
"@fortawesome/fontawesome-svg-core": "1.2.36",
20-
"@fortawesome/free-brands-svg-icons": "5.15.4",
21-
"@fortawesome/free-regular-svg-icons": "5.15.4",
22-
"@fortawesome/free-solid-svg-icons": "5.15.4",
23-
"@fortawesome/vue-fontawesome": "3.0.0-5",
19+
"@heroicons/vue": "^2.0.12",
2420
"@ln-markets/maths": "1.0.2",
2521
"mitt": "3.0.0",
26-
"vue": "3.2.33",
22+
"vue": "3.2.41",
2723
"vue-final-modal": "3.4.3",
28-
"vue-router": "4.0.14",
29-
"vuex": "4.0.2",
24+
"vue-router": "4.1.6",
25+
"vuex": "4.1.0",
3026
"vuex-persistedstate": "4.1.0"
3127
},
3228
"devDependencies": {
33-
"@vitejs/plugin-vue": "2.3.1",
34-
"@vue/compiler-sfc": "3.2.33",
35-
"autoprefixer": "10.4.7",
36-
"postcss": "8.4.13",
37-
"tailwindcss": "3.0.24",
38-
"vite": "2.9.7"
29+
"@vitejs/plugin-vue": "3.2.0",
30+
"@vue/compiler-sfc": "3.2.41",
31+
"autoprefixer": "10.4.12",
32+
"postcss": "8.4.18",
33+
"tailwindcss": "3.2.1",
34+
"vite": "3.2.0"
3935
}
4036
}

apps/front/src/components/font-awesome.js

-39
This file was deleted.

apps/front/src/components/index.js

-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ import Button from './Button.vue'
22
import Modal from './Modal.vue'
33
import Slider from './Slider.vue'
44

5-
import FontAwesomeIcon from './font-awesome.js'
6-
75
export default (app) => {
86
app.component('LnmUmbrelButton', Button)
97
app.component('LnmUmbrelModal', Modal)
108
app.component('LnmUmbrelSlider', Slider)
11-
app.component('FontAwesomeIcon', FontAwesomeIcon)
129
}

apps/front/src/layout/Footer.vue

+53-11
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,90 @@
11
<template>
22
<div class="flex flex-row justify-between items-center p-4 w-full">
33
<div class="flex flex-col text-xs">
4-
<div>LN Markets App v1.2.4</div>
4+
<div>LN Markets App v1.2.5</div>
55
</div>
66
<div class="flex flex-row justify-between items-center w-48">
77
<a
8-
aria-label="Telegram"
9-
class="text-3xl social-icon"
8+
aria-label="Discord"
9+
class="social-icon w-7 h-7"
1010
href="https://discord.gg/5HwDJFx2Jz"
1111
rel="noopener"
1212
target="_blank"
1313
>
14-
<font-awesome-icon :icon="['fab', 'discord']" />
14+
<svg
15+
role="img"
16+
viewBox="0 0 24 24"
17+
xmlns="http://www.w3.org/2000/svg"
18+
fill="currentColor"
19+
>
20+
<title>Discord</title>
21+
<path
22+
d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"
23+
/>
24+
</svg>
1525
</a>
1626
<a
1727
aria-label="Telegram"
18-
class="text-3xl social-icon"
28+
class="social-icon w-6 h-6"
1929
href="https://www.t.me/lnmarkets"
2030
rel="noopener"
2131
target="_blank"
2232
>
23-
<font-awesome-icon :icon="['fab', 'telegram']" />
33+
<svg
34+
role="img"
35+
viewBox="0 0 24 24"
36+
xmlns="http://www.w3.org/2000/svg"
37+
fill="currentColor"
38+
>
39+
<title>Telegram</title>
40+
<path
41+
d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"
42+
/>
43+
</svg>
2444
</a>
2545
<a
2646
aria-label="Github"
27-
class="text-3xl social-icon"
47+
class="social-icon w-7 h-7"
2848
href="https://github.com/lnmarkets/umbrel"
2949
rel="noopener"
3050
target="_blank"
3151
>
32-
<font-awesome-icon :icon="['fab', 'github']" />
52+
<svg
53+
role="img"
54+
viewBox="0 0 24 24"
55+
xmlns="http://www.w3.org/2000/svg"
56+
fill="currentColor"
57+
>
58+
<title>Github</title>
59+
<path
60+
fill-rule="evenodd"
61+
clip-rule="evenodd"
62+
d="M12 2C6.477 2 2 6.463 2 11.97c0 4.404 2.865 8.14 6.839 9.458.5.092.682-.216.682-.48 0-.236-.008-.864-.013-1.695-2.782.602-3.369-1.337-3.369-1.337-.454-1.151-1.11-1.458-1.11-1.458-.908-.618.069-.606.069-.606 1.003.07 1.531 1.027 1.531 1.027.892 1.524 2.341 1.084 2.91.828.092-.643.35-1.083.636-1.332-2.22-.251-4.555-1.107-4.555-4.927 0-1.088.39-1.979 1.029-2.675-.103-.252-.446-1.266.098-2.638 0 0 .84-.268 2.75 1.022A9.607 9.607 0 0 1 12 6.82c.85.004 1.705.114 2.504.336 1.909-1.29 2.747-1.022 2.747-1.022.546 1.372.202 2.386.1 2.638.64.696 1.028 1.587 1.028 2.675 0 3.83-2.339 4.673-4.566 4.92.359.307.678.915.678 1.846 0 1.332-.012 2.407-.012 2.734 0 .267.18.577.688.48 3.97-1.32 6.833-5.054 6.833-9.458C22 6.463 17.522 2 12 2Z"
63+
></path>
64+
</svg>
3365
</a>
3466
<a
3567
aria-label="Twitter"
36-
class="text-3xl social-icon"
68+
class="social-icon w-7 h-7"
3769
href="https://twitter.com/LNMarkets"
3870
rel="noopener"
3971
target="_blank"
4072
>
41-
<font-awesome-icon :icon="['fab', 'twitter']" />
73+
<svg
74+
role="img"
75+
viewBox="0 0 24 24"
76+
xmlns="http://www.w3.org/2000/svg"
77+
fill="currentColor"
78+
>
79+
<title>Twitter</title>
80+
<path
81+
d="M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085 4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z"
82+
/>
83+
</svg>
4284
</a>
4385
<a
4486
aria-label="Substack"
45-
class="w-7 h-7 social-icon"
87+
class="social-icon w-6 h-6"
4688
href="https://lnmarkets.substack.com/"
4789
rel="noopener"
4890
target="_blank"

apps/front/src/modals/Deposit.vue

+3-19
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,9 @@
44
<template #content>
55
<div v-if="!waiting">
66
<p class="mb-4 text-sm text-center sm:text-base">
7-
Select the amount to deposit using one of the options below.
7+
Input the amount to deposit below (no limits).
88
</p>
9-
<div class="flex justify-center">
10-
<lnm-umbrel-slider
11-
class="w-1/2"
12-
:min="1000"
13-
:max="maxDeposit"
14-
:value="parseInt(amount)"
15-
:step="(maxDeposit - 1000) / 1000"
16-
@update="amount = parseInt($event)"
17-
/>
18-
</div>
199
<div class="flex justify-center mt-4">
20-
<lnm-umbrel-button class="mr-4" @click="amount = maxDeposit">
21-
Max
22-
</lnm-umbrel-button>
2310
<input
2411
v-model="amount"
2512
class="pr-2 w-1/2 text-sm text-right rounded border-2 border-gray-300 sm:w-auto"
@@ -42,9 +29,7 @@
4229
<lnm-umbrel-button
4330
class="w-1/3 sm:w-1/4"
4431
color="green"
45-
:disabled="
46-
!amount || parseInt(amount) > maxDeposit || parseInt(amount) < 1000
47-
"
32+
:disabled="!amount || parseInt(amount) < 1000"
4833
:click="deposit"
4934
:click-params="amount"
5035
>
@@ -57,7 +42,7 @@
5742
</template>
5843

5944
<script>
60-
import { computed, ref } from 'vue'
45+
import { ref } from 'vue'
6146
import { useStore } from 'vuex'
6247
import { isInteger } from '@/plugins/utils.js'
6348
import Loader from '@/components/Loader.vue'
@@ -69,7 +54,6 @@ export default {
6954
const store = useStore()
7055
const waiting = ref(false)
7156
return {
72-
maxDeposit: computed(() => store.getters['user/maxDeposit']),
7357
amount: ref(1000),
7458
waiting,
7559
deposit: (amount) => {

apps/front/src/modals/Withdraw.vue

+5-4
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
<lnm-umbrel-slider
1111
class="w-1/2"
1212
:min="1000"
13-
:max="balance"
13+
:max="maxWithdraw"
1414
:value="parseInt(amount)"
15-
:step="(balance - 1000) / 1000"
15+
:step="(maxWithdraw - 1000) / 1000"
1616
@update="amount = parseInt($event)"
1717
/>
1818
</div>
1919
<div class="flex justify-center mt-4">
20-
<lnm-umbrel-button class="mr-4" @click="amount = balance">
20+
<lnm-umbrel-button class="mr-4" @click="amount = maxWithdraw">
2121
Max
2222
</lnm-umbrel-button>
2323
<input
@@ -41,7 +41,7 @@
4141
class="w-1/3 sm:w-1/4"
4242
color="green"
4343
:disabled="
44-
!amount || parseInt(amount) > balance || parseInt(amount) < 1000
44+
!amount || parseInt(amount) > maxWithdraw || parseInt(amount) < 1000
4545
"
4646
:click="withdraw"
4747
:click-params="amount"
@@ -68,6 +68,7 @@ export default {
6868
const waiting = ref(false)
6969
return {
7070
balance: computed(() => store.state.user.account.available_balance),
71+
maxWithdraw: computed(() => store.getters['user/maxWithdraw']),
7172
amount: ref(1000),
7273
waiting,
7374
withdraw: (amount) => {

0 commit comments

Comments
 (0)