Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PWA #786

Draft
wants to merge 25 commits into
base: feature/2.3
Choose a base branch
from
Draft

PWA #786

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
39c8303
Add new sdk methods to flyover service
lserra-iov Aug 16, 2024
38c88f9
Set version to 2.3.0
lserra-iov Sep 10, 2024
f5cabe6
Save quote hash
lserra-iov Sep 9, 2024
2aa3d6a
Add xverse wallet support for Pegin
ronaldsg20 Sep 20, 2024
1e5f007
Downgrade sats-connect version
ronaldsg20 Sep 24, 2024
27dc8e0
Increasin unit test for Xverse wallet services and Tx builder
ronaldsg20 Sep 26, 2024
79b12a1
build(deps): bump webpack from 5.88.2 to 5.94.0
dependabot[bot] Sep 3, 2024
99f4d7f
build(deps): bump body-parser and express
dependabot[bot] Sep 23, 2024
88fe6b5
build(deps): bump path-to-regexp and express
dependabot[bot] Sep 23, 2024
b9aa8af
build(deps): bump micromatch from 4.0.5 to 4.0.8
dependabot[bot] Sep 3, 2024
06e58f0
Change displayed amount for flyover pegouts
lserra-iov Sep 26, 2024
308fd98
Remove old confirmation page
lserra-iov Sep 26, 2024
9ffeb7e
Show btc tx id of successful pegout
lserra-iov Sep 30, 2024
f10a894
Change success text and btc fee estimation on status page
lserra-iov Sep 30, 2024
6aecf2c
Get flyover tx status based on quote hash
lserra-iov Sep 19, 2024
58783e3
Set base of pwa for 2wp-app
ronaldsg20 Aug 12, 2024
9a98ad5
Add pwa config
lserra-iov Aug 13, 2024
97bcbed
Store searches in indexedDB
lserra-iov Aug 14, 2024
ae910e7
Fake indexedDB for testing
lserra-iov Aug 14, 2024
c3e8365
Show last txs in status page
lserra-iov Aug 15, 2024
f3469ba
Update app name
lserra-iov Oct 7, 2024
c925f00
Try background periodic sync
lserra-iov Oct 9, 2024
31e0926
Update status view and reuse db utils
lserra-iov Oct 14, 2024
092c451
Add notifications
lserra-iov Oct 15, 2024
d1412ce
Trigger tx search on txid click and sync notifications in app
lserra-iov Oct 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module.exports = {
'vuejs-accessibility/mouse-events-have-key-events': 'off',
'import/extensions': 'off',
'global-require': 'off',
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
},
overrides: [
{
Expand Down
5 changes: 5 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module.exports = {
transform: {
'^.+\\.vue$': '@vue/vue3-jest',
'^.+\\.(mts|mjs|jsx|ts|tsx)$': 'ts-jest',
},
preset: '@vue/cli-plugin-unit-jest/presets/typescript-and-babel',
collectCoverage: true,
collectCoverageFrom: ['src/(common|pegin)/(providers|services|utils)/*.ts'],
Expand All @@ -13,4 +17,5 @@ module.exports = {
coverageProvider: 'v8',
transformIgnorePatterns: ['node_modules/(?!axios)/'],
setupFilesAfterEnv: ['<rootDir>/setup-jest.js'],
silent: true,
};
1,784 changes: 1,485 additions & 299 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "PowPeg",
"version": "2.2.1",
"version": "2.3.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"dev": "npm run serve -- --hot-only --host localhost",
"build": "vue-cli-service build",
"test": "vue-cli-service test:unit --env=./tests/jsdom-env.js --coverageReporters=lcov --collect-coverage",
"test:unit": "vue-cli-service test:unit --env=./tests/jsdom-env.js --coverageReporters=lcov --collect-coverage",
"test:unit-logs": "vue-cli-service test:unit --env=./tests/jsdom-env.js --coverageReporters=lcov --silent=false --collect-coverage",
"lint": "vue-cli-service lint",
"scanner": "npx sonar-scanner"
},
Expand Down Expand Up @@ -45,12 +46,15 @@
"crypto-browserify": "^3.12.0",
"ethers": "^5.7.2",
"https-browserify": "^1.0.0",
"idb": "^8.0.0",
"jest-environment-jsdom": "^27.5.1",
"lodash": "^4.17.21",
"markdown-it": "^14.1.0",
"moment": "^2.29.4",
"os-browserify": "^0.3.0",
"process": "^0.11.10",
"register-service-worker": "^1.7.2",
"sats-connect": "2.3.x",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"text-encoding": "^0.7.0",
Expand All @@ -62,7 +66,8 @@
"vuetify": "^3.5.17",
"vuex": "^4.1.0",
"web3": "^4.8.0",
"web3-eth-contract": "^1.10.0"
"web3-eth-contract": "^1.10.0",
"workbox-precaching": "^7.1.0"
},
"devDependencies": {
"@intlify/vue-i18n-loader": "^4.2.0",
Expand All @@ -79,6 +84,7 @@
"@typescript-eslint/parser": "^5.62.0",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-plugin-pwa": "^5.0.8",
"@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-plugin-typescript": "~5.0.0",
"@vue/cli-plugin-unit-jest": "~5.0.0",
Expand All @@ -96,6 +102,7 @@
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-vue": "^8.7.1",
"eslint-plugin-vuejs-accessibility": "^1.2.0",
"fake-indexeddb": "^6.0.0",
"geckodriver": "^4.4.0",
"jest": "^27.5.1",
"sass": "^1.64.2",
Expand Down
Binary file added public/img/icons/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/apple-touch-icon-120x120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/apple-touch-icon-152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/apple-touch-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/apple-touch-icon-60x60.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/apple-touch-icon-76x76.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/maskable_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/maskable_icon_x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/maskable_icon_x384.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/maskable_icon_x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/msapplication-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icons/mstile-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/img/icons/safari-pinned-tab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<title>PowPeg</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css">
</head>
Expand Down
2 changes: 2 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow:
1 change: 1 addition & 0 deletions setup-jest.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { TextEncoder, TextDecoder } from 'util';
import 'fake-indexeddb/auto';

Object.assign(global, { TextDecoder, TextEncoder });
60 changes: 58 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
</template>

<script lang="ts">
import { computed, onBeforeMount, ref } from 'vue';
import {
computed, onBeforeMount, onBeforeUnmount, provide, ref,
} from 'vue';
import Top from '@/common/components/layouts/Top.vue';
import FooterRsk from '@/common/components/layouts/Footer.vue';
import Mobile from '@/common/views/Mobile.vue';
Expand All @@ -23,6 +25,8 @@ import * as constants from '@/common/store/constants';
import { useAction } from '@/common/store/helper';
import { vuetifyNonce } from '@/common/plugins/vuetify';
import { isMobileDevice } from '@/common/utils';
import { unreadNotificationsKey } from '@/common/providers/UnreadNotifications';
import { useRouter } from 'vue-router';

export default {
name: 'App',
Expand All @@ -49,7 +53,7 @@ export default {
connect-src 'self' 'unsafe-inline' https://www.clarity.ms/s/0.7.16/clarity.js wss://* https://*.hotjar.com https://*.hotjar.io https://www.clarity.ms/s/* wss://*.hotjar.com ${envVariables.vueAppApiBaseUrl} ${envVariables.vueAppRskNodeHost} https://lps.testnet.flyover.rif.technology https://lps.flyover.rif.technology https://api.coingecko.com https://*.clarity.ms https://www.clarity.ms/* ;
object-src 'none';
frame-src https://connect.trezor.io https://www.google.com/;
worker-src 'none';
worker-src 'self';
`;
return response;
});
Expand Down Expand Up @@ -92,6 +96,58 @@ export default {
showTermsAndConditions.value = show;
}

const unreadNotifications = ref(0);

function updateUnreadNotifications(value: number) {
unreadNotifications.value = value;
navigator.setAppBadge(unreadNotifications.value);
}

provide(
unreadNotificationsKey,
{
counter: unreadNotifications,
updateCounter: updateUnreadNotifications,
},
);

const router = useRouter();

function showNotification() {
Notification.requestPermission()
.then((permission) => {
if (permission === 'granted') {
const notification = new Notification('PowPeg', {
body: 'New transaction status available',
});
notification.onshow = () => {
updateUnreadNotifications(unreadNotifications.value + 1);
};
notification.onclose = () => {
updateUnreadNotifications(unreadNotifications.value - 1);
};
notification.onclick = () => {
notification.close();
router.push('/status');
};
}
});
}

function handleUpdateViewEvt(evt: MessageEvent) {
if (evt.data === 'update-view') {
showNotification();
}
}

onBeforeMount(() => {
navigator.serviceWorker.addEventListener('message', handleUpdateViewEvt);
});

onBeforeUnmount(() => {
navigator.serviceWorker.removeEventListener('message', handleUpdateViewEvt);
});

onBeforeMount(() => {
getFeatures();
getBtcPrice();
Expand Down
Binary file added src/assets/wallet-icons/xverse-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/wallet-icons/xverse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/common/components/exchange/SelectBitcoinWallet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ export default {
case constants.WALLET_NAMES.LEATHER.long_name:
wallet = constants.WALLET_NAMES.LEATHER.short_name;
break;
case constants.WALLET_NAMES.XVERSE.long_name:
wallet = constants.WALLET_NAMES.XVERSE.short_name;
break;
default:
wallet = '';
break;
Expand Down
166 changes: 0 additions & 166 deletions src/common/components/status/PegoutProgressBar.vue

This file was deleted.

Loading
Loading