diff --git a/.babelrc b/.babelrc
index d7ad3fa32..4eab6e529 100644
--- a/.babelrc
+++ b/.babelrc
@@ -1,15 +1,17 @@
{
"plugins": [
"@babel/plugin-proposal-optional-chaining",
- "@babel/plugin-transform-spread"
+ "@babel/plugin-transform-spread",
+ "@babel/plugin-proposal-class-properties"
],
"presets": [
- ["@babel/preset-env", {
- "useBuiltIns": "usage",
+ ["@babel/preset-env", {
+ "useBuiltIns": "usage",
"targets": {
// https://jamie.build/last-2-versions
"browsers": ["> 0.25%", "not ie 11", "not op_mini all"]
- }
+ },
+ "corejs": 3
}]
]
}
diff --git a/.eslintrc.js b/.eslintrc.js
index 16b7919fc..6d22f56ba 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -38,16 +38,9 @@ module.exports = {
props: true,
ignorePropertyModificationsFor: [
'state', // for vuex state
- 'acc', // for reduce accumulators
- 'e' // for e.returnvalue
]
}],
- // disallow default export over named export
- 'import/prefer-default-export': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
- "class-methods-use-this": "warn",
- "no-empty": "warn",
- "no-restricted-globals": "warn"
}
}
diff --git a/.travis.yml b/.travis.yml
index 41f04991c..87c26b61f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,16 +12,24 @@ cache:
script:
- npm run lint -- --no-fix
- - npm test
- npm run build
before_deploy: scripts/before-deploy.sh
deploy:
- provider: pages
- skip_cleanup: true
- github_token: $GITHUB_TOKEN
- keep_history: true
- local_dir: dist/web/root
- on:
- branch: master
+ - provider: pages
+ skip_cleanup: true
+ github_token: $GITHUB_TOKEN
+ keep_history: true
+ local_dir: dist/web/root
+ on:
+ branch: master
+ - provider: pages
+ skip_cleanup: true
+ github_token: $GITHUB_TOKEN_SUPERHEROWALLET
+ keep_history: true
+ local_dir: dist/web/root
+ repo: superherowallet/wallet
+ target_branch: master
+ on:
+ branch: develop
diff --git a/config.xml b/config.xml
index 42257c4e4..2a47c1ab4 100644
--- a/config.xml
+++ b/config.xml
@@ -1,5 +1,5 @@
-
+
SuperHero
SuperHero wallet
diff --git a/package-lock.json b/package-lock.json
index bb0a96b9c..91c9eff19 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "superhero-wallet",
- "version": "0.0.13",
+ "version": "0.0.14",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -267,6 +267,107 @@
}
}
},
+ "@babel/helper-create-class-features-plugin": {
+ "version": "7.8.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.8.6.tgz",
+ "integrity": "sha512-klTBDdsr+VFFqaDHm5rR69OpEQtO2Qv8ECxHS1mNhJJvaHArR6a1xTf5K/eZW7eZpJbhCx3NW1Yt/sKsLXLblg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-function-name": "^7.8.3",
+ "@babel/helper-member-expression-to-functions": "^7.8.3",
+ "@babel/helper-optimise-call-expression": "^7.8.3",
+ "@babel/helper-plugin-utils": "^7.8.3",
+ "@babel/helper-replace-supers": "^7.8.6",
+ "@babel/helper-split-export-declaration": "^7.8.3"
+ },
+ "dependencies": {
+ "@babel/generator": {
+ "version": "7.9.4",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.4.tgz",
+ "integrity": "sha512-rjP8ahaDy/ouhrvCoU1E5mqaitWrxwuNGU+dy1EpaoK48jZay4MdkskKGIMHLZNewg8sAsqpGSREJwP0zH3YQA==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.9.0",
+ "jsesc": "^2.5.1",
+ "lodash": "^4.17.13",
+ "source-map": "^0.5.0"
+ }
+ },
+ "@babel/helper-replace-supers": {
+ "version": "7.8.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.8.6.tgz",
+ "integrity": "sha512-PeMArdA4Sv/Wf4zXwBKPqVj7n9UF/xg6slNRtZW84FM7JpE1CbG8B612FyM4cxrf4fMAMGO0kR7voy1ForHHFA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-member-expression-to-functions": "^7.8.3",
+ "@babel/helper-optimise-call-expression": "^7.8.3",
+ "@babel/traverse": "^7.8.6",
+ "@babel/types": "^7.8.6"
+ }
+ },
+ "@babel/parser": {
+ "version": "7.9.4",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz",
+ "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==",
+ "dev": true
+ },
+ "@babel/traverse": {
+ "version": "7.9.0",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.0.tgz",
+ "integrity": "sha512-jAZQj0+kn4WTHO5dUZkZKhbFrqZE7K5LAQ5JysMnmvGij+wOdr+8lWqPeW0BcF4wFwrEXXtdGO7wcV6YPJcf3w==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.8.3",
+ "@babel/generator": "^7.9.0",
+ "@babel/helper-function-name": "^7.8.3",
+ "@babel/helper-split-export-declaration": "^7.8.3",
+ "@babel/parser": "^7.9.0",
+ "@babel/types": "^7.9.0",
+ "debug": "^4.1.0",
+ "globals": "^11.1.0",
+ "lodash": "^4.17.13"
+ }
+ },
+ "@babel/types": {
+ "version": "7.9.0",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.0.tgz",
+ "integrity": "sha512-BS9JKfXkzzJl8RluW4JGknzpiUV7ZrvTayM6yfqLTVBEnFtyowVIOu6rqxRd5cVO6yGoWf4T8u8dgK9oB+GCng==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-validator-identifier": "^7.9.0",
+ "lodash": "^4.17.13",
+ "to-fast-properties": "^2.0.0"
+ }
+ },
+ "debug": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
+ "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
+ "dev": true,
+ "requires": {
+ "ms": "^2.1.1"
+ }
+ },
+ "jsesc": {
+ "version": "2.5.2",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
+ "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==",
+ "dev": true
+ },
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+ "dev": true
+ },
+ "source-map": {
+ "version": "0.5.7",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
+ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
+ "dev": true
+ }
+ }
+ },
"@babel/helper-create-regexp-features-plugin": {
"version": "7.8.3",
"resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.8.3.tgz",
@@ -455,6 +556,12 @@
"@babel/types": "^7.8.3"
}
},
+ "@babel/helper-validator-identifier": {
+ "version": "7.9.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.0.tgz",
+ "integrity": "sha512-6G8bQKjOh+of4PV/ThDm/rRqlU7+IGoJuofpagU5GlEl29Vv0RGqqt86ZGRV8ZuSOY3o+8yXl5y782SMcG7SHw==",
+ "dev": true
+ },
"@babel/helper-wrap-function": {
"version": "7.8.3",
"resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.8.3.tgz",
@@ -504,6 +611,16 @@
"@babel/plugin-syntax-async-generators": "^7.8.0"
}
},
+ "@babel/plugin-proposal-class-properties": {
+ "version": "7.8.3",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.8.3.tgz",
+ "integrity": "sha512-EqFhbo7IosdgPgZggHaNObkmO1kNUe3slaKu54d5OWvy+p9QIKOzK1GAEpAIsZtWVtPXUHSMcT4smvDrCfY4AA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-create-class-features-plugin": "^7.8.3",
+ "@babel/helper-plugin-utils": "^7.8.3"
+ }
+ },
"@babel/plugin-proposal-dynamic-import": {
"version": "7.8.3",
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.8.3.tgz",
@@ -2488,29 +2605,57 @@
"version": "github:aeternity/aepp-raendom#9bf50b4c526e81ee6d26f3eb57c7becfba3cdd5e",
"from": "github:aeternity/aepp-raendom#feature/layout-superhero",
"requires": {
- "@aeternity/aepp-sdk": "7.1.1",
+ "@aeternity/aepp-sdk": "7.2.1",
"axios": "^0.19.0",
"bignumber.js": "^9.0.0",
"bootstrap": "^4.4.1",
- "bootstrap-vue": "^2.4.0",
+ "bootstrap-vue": "^2.9.0",
+ "core-js": "^3.6.4",
"detect-browser": "^4.8.0",
- "i18n": "^0.8.5",
+ "i18n": "^0.8.6",
"lodash-es": "^4.17.15",
"vue": "^2.6.11",
- "vue-i18n": "^8.15.3",
- "vue-router": "^3.1.3",
- "vuex": "^3.1.2"
+ "vue-i18n": "^8.16.0",
+ "vue-router": "^3.1.6",
+ "vuex": "^3.1.3"
},
"dependencies": {
+ "@aeternity/aepp-sdk": {
+ "version": "7.2.1",
+ "resolved": "https://registry.npmjs.org/@aeternity/aepp-sdk/-/aepp-sdk-7.2.1.tgz",
+ "integrity": "sha512-ok15jB7FB6QkHf3kjFBKQ0GCp/2QHIFYq+TvBh59l6D7pYfb/7eU4/tLZKdxJPqYDtO9I7t3KIzCWG39yCWzhQ==",
+ "requires": {
+ "@aeternity/bip39": "^0.1.0",
+ "@stamp/it": "^1.0.3",
+ "@stamp/required": "^1.0.1",
+ "aes-js": "^3.1.1",
+ "axios": "^0.19.0",
+ "bignumber.js": "^9.0.0",
+ "bip32-path": "^0.4.2",
+ "blakejs": "^1.1.0",
+ "bs58check": "^2.1.1",
+ "ed2curve": "^0.3.0",
+ "joi-browser": "^13.4.0",
+ "libsodium-wrappers-sumo": "0.7.6",
+ "ramda": "^0.27.0",
+ "rlp": "2.2.4",
+ "serialize-javascript": "^3.0.0",
+ "sha.js": "^2.4.11",
+ "tweetnacl": "^1.0.0",
+ "tweetnacl-auth": "^1.0.1",
+ "uuid": "^7.0.0",
+ "websocket": "^1.0.26"
+ }
+ },
"bignumber.js": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz",
"integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A=="
},
"bootstrap-vue": {
- "version": "2.6.0",
- "resolved": "https://registry.npmjs.org/bootstrap-vue/-/bootstrap-vue-2.6.0.tgz",
- "integrity": "sha512-6p28wh/nnA5b8H0iVb6cIEkS6VUQikpQPRnCTSNEg3k1T8SNDXads7lJPn1Cxi268SXfrWttb8Pxct1c+0qKyA==",
+ "version": "2.10.0",
+ "resolved": "https://registry.npmjs.org/bootstrap-vue/-/bootstrap-vue-2.10.0.tgz",
+ "integrity": "sha512-N0nsx0VLzUi1DbUPNsShadD57DoUwQ/12lt84iPZTiyxR8qI9rcX0TUEPL9Sof+KCd8f/8cz46bNOK8dhsUKXQ==",
"requires": {
"@nuxt/opencollective": "^0.3.0",
"bootstrap": ">=4.4.1 <5.0.0",
@@ -2518,6 +2663,16 @@
"portal-vue": "^2.1.7",
"vue-functional-data-merge": "^3.1.0"
}
+ },
+ "serialize-javascript": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.0.0.tgz",
+ "integrity": "sha512-skZcHYw2vEX4bw90nAr2iTTsz6x2SrHEnfxgKYmZlvJYBEZrvbKtobJWlQ20zczKb3bsHHXXTYt48zBA7ni9cw=="
+ },
+ "uuid": {
+ "version": "7.0.3",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz",
+ "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg=="
}
}
},
@@ -3188,6 +3343,11 @@
"regenerator-runtime": "^0.11.0"
},
"dependencies": {
+ "core-js": {
+ "version": "2.6.11",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz",
+ "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg=="
+ },
"regenerator-runtime": {
"version": "0.11.1",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
@@ -5457,9 +5617,9 @@
}
},
"core-js": {
- "version": "2.6.11",
- "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz",
- "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg=="
+ "version": "3.6.4",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.4.tgz",
+ "integrity": "sha512-4paDGScNgZP2IXXilaffL9X7968RuvwlkK3xWtZRVqgd8SYNiVKRJvkFd1aqqEuPfN7E68ZHEp9hDj6lHj4Hyw=="
},
"core-js-compat": {
"version": "3.6.4",
@@ -10026,9 +10186,9 @@
"integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw=="
},
"i18n": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/i18n/-/i18n-0.8.5.tgz",
- "integrity": "sha512-6UgLbhJGgn4XFeuZc/dDdrrri0ij24EK4hxv4Pbi5hloYAZ1B2+0eQchEryBFezLKYOHhVGV/5+H4i0oxng94w==",
+ "version": "0.8.6",
+ "resolved": "https://registry.npmjs.org/i18n/-/i18n-0.8.6.tgz",
+ "integrity": "sha512-aMsJq8i1XXrb+BBsgmJBwak9mr69zPEIAUPb6c5yw2G/O4k1Q52lBxL+agZdQDN/RGf1ylQzrCswsOOgIiC1FA==",
"requires": {
"debug": "*",
"make-plural": "^6.0.1",
@@ -11079,6 +11239,11 @@
"resolved": "https://registry.npmjs.org/jsqr/-/jsqr-1.2.0.tgz",
"integrity": "sha512-wKcQS9QC2VHGk7aphWCp1RrFyC0CM6fMgC5prZZ2KV/Lk6OKNoCod9IR6bao+yx3KPY0gZFC5dc+h+KFzCI0Wg=="
},
+ "jump.js": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/jump.js/-/jump.js-1.0.2.tgz",
+ "integrity": "sha1-4GQbR/QKOPITnCX9oFAL8o5DAVo="
+ },
"keccak": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/keccak/-/keccak-2.1.0.tgz",
@@ -11628,9 +11793,9 @@
}
},
"make-plural": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/make-plural/-/make-plural-6.0.1.tgz",
- "integrity": "sha512-h0uBNi4tpDkiWUyYKrJNj8Kif6q3Ba5zp/8jnfPy3pQE+4XcTj6h3eZM5SYVUyDNX9Zk69Isr/dx0I+78aJUaQ=="
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/make-plural/-/make-plural-6.1.0.tgz",
+ "integrity": "sha512-0ekbPHqxcdRcmjZ43TkRuejK5rXgMF1OjG4FVnVHgCvOcjrexaSX7a0dfAvqhOm1qWPgjYnXtmz3cHpHW5ZewA=="
},
"mamacro": {
"version": "0.0.3",
@@ -12305,9 +12470,9 @@
"integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE="
},
"mustache": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.0.0.tgz",
- "integrity": "sha512-FJgjyX/IVkbXBXYUwH+OYwQKqWpFPLaLVESd70yHjSDunwzV2hZOoTBvPf4KLoxesUzzyfTH6F784Uqd7Wm5yA=="
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.0.1.tgz",
+ "integrity": "sha512-yL5VE97+OXn4+Er3THSmTdCFCtx5hHWzrolvH+JObZnUYwuaG7XV+Ch4fR2cIrcYI0tFHxS7iyFYl14bW8y2sA=="
},
"mute-stream": {
"version": "0.0.7",
@@ -19023,6 +19188,24 @@
"rollup-plugin-node-resolve": "^2.0.0"
}
},
+ "vue-tour": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/vue-tour/-/vue-tour-1.3.0.tgz",
+ "integrity": "sha512-hLXA8vCCWNNjvXwEbfOagcZfJMz1a9Xi7LTN5nb/Nqpuv8RKT25dS5/HJBvHEEh1EoYQNOwohx1YA6x+2KTQbQ==",
+ "requires": {
+ "hash-sum": "^2.0.0",
+ "jump.js": "^1.0.2",
+ "popper.js": "^1.16.0",
+ "vue": "^2.6.10"
+ },
+ "dependencies": {
+ "hash-sum": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-2.0.0.tgz",
+ "integrity": "sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg=="
+ }
+ }
+ },
"vuex": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/vuex/-/vuex-3.1.2.tgz",
diff --git a/package.json b/package.json
index a12fe035e..5c50c6f21 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "superhero-wallet",
- "version": "0.0.13",
+ "version": "0.0.14",
"description": "Superhero wallet",
"author": "SuperHero",
"license": "MIT",
@@ -81,6 +81,7 @@
"vue-qr-reader": "^1.6.0",
"vue-qrcode-reader": "^2.1.1",
"vue-router": "^3.1.5",
+ "vue-tour": "^1.3.0",
"vuex": "^3.1.1",
"web3": "^1.2.2",
"webextension-polyfill": "^0.3.1",
@@ -89,6 +90,7 @@
},
"devDependencies": {
"@babel/core": "^7.6.4",
+ "@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-optional-chaining": "^7.6.0",
"@babel/preset-env": "^7.6.3",
"@cypress/webpack-preprocessor": "^4.1.3",
@@ -101,7 +103,7 @@
"cordova": "^9.0.0",
"cordova-plugin-whitelist": "^1.3.4",
"cordova-res": "^0.9.0",
- "core-js": "^2.6.10",
+ "core-js": "^3.6.4",
"cross-env": "^5.2.1",
"css-loader": "^0.28.11",
"cypress": "^4.1.0",
@@ -145,7 +147,7 @@
"cordova-plugin-inappbrowser": {},
"ionic-plugin-deeplinks": {
"URL_SCHEME": "superhero",
- "DEEPLINK_HOST": "mobile.z52da5wt.xyz"
+ "DEEPLINK_HOST": "wallet.superhero.com"
}
},
"platforms": [
diff --git a/resources/icon.png b/resources/icon.png
index 0090d78f8..b2a5a22b7 100644
Binary files a/resources/icon.png and b/resources/icon.png differ
diff --git a/resources/splash.png b/resources/splash.png
index f1bddb21e..7dbc43c35 100644
Binary files a/resources/splash.png and b/resources/splash.png differ
diff --git a/serve.json b/serve.json
index 2292d51a8..26e45055f 100644
--- a/serve.json
+++ b/serve.json
@@ -1,3 +1,3 @@
{
- "public": "dist"
+ "public": "dist/web/root"
}
\ No newline at end of file
diff --git a/src/aepp/App.vue b/src/aepp/App.vue
index 45f9b6c9e..b6ba73665 100644
--- a/src/aepp/App.vue
+++ b/src/aepp/App.vue
@@ -79,7 +79,6 @@ contract Example =
nodes: [{ name: process.env.NETWORK, instance: node }],
compilerUrl: networks[process.env.NETWORK].COMPILER_URL,
onNetworkChange(params) {
- // eslint-disable-next-line no-alert
if (this.getNetworkId() !== params.networkId) alert(`Connected network ${this.getNetworkId()} is not supported with wallet network ${params.networkId}`);
},
onAddressChange: async () => {
@@ -126,22 +125,19 @@ contract Example =
};
},
async scanForWallets() {
- try {
- // eslint-disable-next-line func-names
- const handleWallets = async function({ wallets, newWallet }) {
- const wallet = newWallet || Object.values(wallets)[0];
- this.detector.stopScan();
+ const handleWallets = async ({ wallets, newWallet }) => {
+ const wallet = newWallet || Object.values(wallets)[0];
+ this.detector.stopScan();
- await this.connectToWallet(wallet);
- // let addr = await this.client.askAddresses()
- };
+ await this.connectToWallet(wallet);
+ // let addr = await this.client.askAddresses()
+ };
- const scannerConnection = await BrowserWindowMessageConnection({
- connectionInfo: { id: 'spy' },
- });
- this.detector = await Detector({ connection: scannerConnection });
- this.detector.scan(handleWallets.bind(this));
- } catch (e) {}
+ const scannerConnection = await BrowserWindowMessageConnection({
+ connectionInfo: { id: 'spy' },
+ });
+ this.detector = await Detector({ connection: scannerConnection });
+ this.detector.scan(handleWallets);
},
},
};
diff --git a/src/aepp/aepp.js b/src/aepp/aepp.js
index fa15a1e70..6e1307818 100644
--- a/src/aepp/aepp.js
+++ b/src/aepp/aepp.js
@@ -3,8 +3,6 @@ import App from './App';
global.browser = require('webextension-polyfill');
-/* eslint-disable no-new */
new Vue({
- el: '#app',
render: h => h(App),
-});
+}).$mount('#app');
diff --git a/src/background.js b/src/background.js
index b3e36df68..663e3a22b 100644
--- a/src/background.js
+++ b/src/background.js
@@ -1,9 +1,8 @@
import { setInterval } from 'timers';
import './lib/initPolyfills';
import { phishingCheckUrl, getPhishingUrls, setPhishingUrl } from './popup/utils/phishing-detect';
-import { extractHostName, detectConnectionType } from './popup/utils/helper';
+import { detectConnectionType } from './popup/utils/helper';
import { buildTx } from './popup/utils';
-
import WalletController from './wallet-controller';
import Notification from './notifications';
import rpcWallet from './lib/rpcWallet';
@@ -16,13 +15,12 @@ import { PopupConnections } from './lib/popup-connection';
const controller = new WalletController();
-if (process.env.IS_EXTENSION) {
+if (process.env.IS_EXTENSION && require.main.i === module.id) {
RedirectChainNames.init();
setInterval(() => {
browser.windows.getAll({}).then(wins => {
if (wins.length === 0) {
sessionStorage.removeItem('phishing_urls');
- browser.storage.local.remove(['isLogged', 'activeAccount']);
}
});
}, 5000);
@@ -30,33 +28,30 @@ if (process.env.IS_EXTENSION) {
const notification = new Notification();
setController(controller);
- const postPhishingData = data => {
- browser.tabs.query({ active: true, currentWindow: true }).then(tabs => {
- const message = { method: 'phishingCheck', data };
- tabs.forEach(({ id }) => browser.tabs.sendMessage(id, message));
- });
+ const postPhishingData = async data => {
+ const tabs = await browser.tabs.query({ active: true, currentWindow: true });
+ const message = { method: 'phishingCheck', data };
+ tabs.forEach(({ id }) => browser.tabs.sendMessage(id, message));
};
browser.runtime.onMessage.addListener(async (msg, sender) => {
switch (msg.method) {
case 'phishingCheck': {
const data = { ...msg, extUrl: browser.extension.getURL('./') };
- const host = extractHostName(msg.params.href);
+ const host = new URL(msg.params.href).hostname;
data.host = host;
- phishingCheckUrl(host).then(res => {
- if (res.result === 'blocked') {
- const whitelist = getPhishingUrls().filter(url => url === host);
- if (whitelist.length) {
- data.blocked = false;
- return postPhishingData(data);
- }
- data.blocked = true;
+ const { result } = await phishingCheckUrl(host);
+ if (result === 'blocked') {
+ const whitelist = getPhishingUrls().filter(url => url === host);
+ if (whitelist.length) {
+ data.blocked = false;
return postPhishingData(data);
}
- data.blocked = false;
+ data.blocked = true;
return postPhishingData(data);
- });
- break;
+ }
+ data.blocked = false;
+ return postPhishingData(data);
}
case 'setPhishingUrl': {
const urls = getPhishingUrls();
@@ -115,6 +110,7 @@ if (process.env.IS_EXTENSION) {
});
}
+// eslint-disable-next-line import/prefer-default-export
export const handleMessage = ({ type, payload }) => {
if (HDWALLET_METHODS.includes(type)) {
return controller[type](payload);
diff --git a/src/common/base.scss b/src/common/base.scss
index 997ef736a..f4258bf0e 100644
--- a/src/common/base.scss
+++ b/src/common/base.scss
@@ -225,23 +225,6 @@ main {
}
.transactionList, .allTransactions {
padding: 0px 0 0px 0!important;
- .ae-badge.primary {
- background:$primary-color;
- }
- .ae-badge.alternative{
- background:$color-alternative;
- }
- .ae-badge.secondary{
- background:$color-secondary;
- }
- .ae-badge {
- background:#929CA6;
- color:#fff !important;
- font-size:.7rem;
- }
-}
-.allTransactions .ae-identicon {
- margin-left: 1rem;
}
.transactionsPadding {
padding:1rem !important;
diff --git a/src/common/extension.scss b/src/common/extension.scss
index 8ebbc2df1..d0c0d478d 100644
--- a/src/common/extension.scss
+++ b/src/common/extension.scss
@@ -100,6 +100,15 @@ a {
.uppercase {
text-transform: uppercase;
}
+.underline {
+ text-decoration: underline;
+}
+.bolder {
+ font-weight: bold;
+}
+.italic {
+ font-style: italic;
+}
.link-sm {
font-size:11px;
margin:8px 0;
diff --git a/src/common/variables.scss b/src/common/variables.scss
index 572e0dcfe..6e2ff379b 100644
--- a/src/common/variables.scss
+++ b/src/common/variables.scss
@@ -24,10 +24,15 @@ $button-color: #3F4048;
$button-text-color: #CFCFCF;
$placeholder-color: #67676D;
$text-color: #BCBCC4;
-$accent-color: #6A8EBE;
-$secondary-color: #FF4784;
+$accent-color: #67f7b8;
+$secondary-color: #2a9cff;
$nav-bg-color: #21212A;
+$input-focus-color: #67f7b8;
+$input-error-color: #2a9cff;
+$transactions-bg: #12121b;
$nav-border-color: #3A3A47;
+$tx-border-color: #33343e;
+$box-button-color: #33343e;
$scrollbar-color:#707075;
$submenu-bg: #1B1B23;
$black-color: #000;
diff --git a/src/icons/activity-icon.svg b/src/icons/activity-icon.svg
new file mode 100644
index 000000000..44f52dfa8
--- /dev/null
+++ b/src/icons/activity-icon.svg
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/icons/arrow-down.png b/src/icons/arrow-down.png
new file mode 100644
index 000000000..39a948615
Binary files /dev/null and b/src/icons/arrow-down.png differ
diff --git a/src/icons/arrow-up.png b/src/icons/arrow-up.png
new file mode 100644
index 000000000..de4e67574
Binary files /dev/null and b/src/icons/arrow-up.png differ
diff --git a/src/icons/bell.svg b/src/icons/bell.svg
index af34b5796..231cd3995 100644
--- a/src/icons/bell.svg
+++ b/src/icons/bell.svg
@@ -1,7 +1,5 @@
-
-
-
-
-
-
+
+
+
+
diff --git a/src/icons/claim-icon.svg b/src/icons/claim-icon.svg
new file mode 100644
index 000000000..14c21dc75
--- /dev/null
+++ b/src/icons/claim-icon.svg
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/src/icons/copy.svg b/src/icons/copy.svg
index 1052f943d..bec05611e 100644
--- a/src/icons/copy.svg
+++ b/src/icons/copy.svg
@@ -1,7 +1,7 @@
-
+
-
-
+
+
diff --git a/src/icons/expanded-angle-arrow.svg b/src/icons/expanded-angle-arrow.svg
index 358722848..0d13234b6 100644
--- a/src/icons/expanded-angle-arrow.svg
+++ b/src/icons/expanded-angle-arrow.svg
@@ -1,6 +1,3 @@
-
-
-
-
-
+
+
diff --git a/src/icons/eye.png b/src/icons/eye.png
index 81dcdf973..326f5ab70 100644
Binary files a/src/icons/eye.png and b/src/icons/eye.png differ
diff --git a/src/icons/hamburger.svg b/src/icons/hamburger.svg
index 9678c9600..bf393a1e9 100644
--- a/src/icons/hamburger.svg
+++ b/src/icons/hamburger.svg
@@ -1,7 +1,3 @@
-
-
-
-
-
-
+
+
diff --git a/src/icons/help-icon.svg b/src/icons/help-icon.svg
new file mode 100644
index 000000000..a0af3fc24
--- /dev/null
+++ b/src/icons/help-icon.svg
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/src/icons/hero.svg b/src/icons/hero.svg
new file mode 100644
index 000000000..e7c595ac0
--- /dev/null
+++ b/src/icons/hero.svg
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/icons/icon_128.png b/src/icons/icon_128.png
index 82eef9d2d..d7c8ceba8 100644
Binary files a/src/icons/icon_128.png and b/src/icons/icon_128.png differ
diff --git a/src/icons/icon_48.png b/src/icons/icon_48.png
index 01c80c064..b06341c4d 100644
Binary files a/src/icons/icon_48.png and b/src/icons/icon_48.png differ
diff --git a/src/icons/logo-small.svg b/src/icons/logo-small.svg
index af12c2b96..36d49dba2 100644
--- a/src/icons/logo-small.svg
+++ b/src/icons/logo-small.svg
@@ -1,12 +1,3 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
diff --git a/src/icons/logo.svg b/src/icons/logo.svg
index a5cc649c4..6fd9afcec 100644
--- a/src/icons/logo.svg
+++ b/src/icons/logo.svg
@@ -1,13 +1,10 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
diff --git a/src/icons/onboarding-bg-top.svg b/src/icons/onboarding-bg-top.svg
new file mode 100644
index 000000000..ee8e62d07
--- /dev/null
+++ b/src/icons/onboarding-bg-top.svg
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/src/icons/onboarding-bg.png b/src/icons/onboarding-bg.png
new file mode 100644
index 000000000..78e06a946
Binary files /dev/null and b/src/icons/onboarding-bg.png differ
diff --git a/src/icons/settings-icon.svg b/src/icons/settings-icon.svg
new file mode 100644
index 000000000..38b382949
--- /dev/null
+++ b/src/icons/settings-icon.svg
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/src/icons/start-onboarding.svg b/src/icons/start-onboarding.svg
new file mode 100644
index 000000000..1c1e5cce2
--- /dev/null
+++ b/src/icons/start-onboarding.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/icons/tip-icon.svg b/src/icons/tip-icon.svg
new file mode 100644
index 000000000..b29ec5e21
--- /dev/null
+++ b/src/icons/tip-icon.svg
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/src/icons/topup-icon.svg b/src/icons/topup-icon.svg
new file mode 100644
index 000000000..985a443b6
--- /dev/null
+++ b/src/icons/topup-icon.svg
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/icons/withdraw-icon.svg b/src/icons/withdraw-icon.svg
new file mode 100644
index 000000000..864c0258b
--- /dev/null
+++ b/src/icons/withdraw-icon.svg
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/inject.js b/src/inject.js
index ddf0d3018..5c470383d 100644
--- a/src/inject.js
+++ b/src/inject.js
@@ -36,11 +36,7 @@ const sendToBackground = (method, params) =>
});
});
-if (typeof navigator.clipboard === 'undefined') {
- // redirectToWarning(extractHostName(window.location.href),window.location.href)
-} else {
- sendToBackground('phishingCheck', { href: window.location.href });
-}
+sendToBackground('phishingCheck', { href: window.location.href });
// Subscribe from postMessages from page
window.addEventListener(
@@ -57,18 +53,18 @@ window.addEventListener(
false
);
-// Handle message from background and redirect to page
-browser.runtime.onMessage.addListener(({ data }) => {
- if (data.method === 'phishingCheck') {
- if (data.blocked) {
- redirectToWarning(data.params.host, data.params.href, data.extUrl);
- }
- }
-});
-
-const sendDomData = () => {
+const getAddresses = () => {
const address = document.all[0].outerHTML.match(/(ak_[A-Za-z0-9]{49,50})/g);
const chainName = document.all[0].outerHTML.match(/[A-Za-z0-9]+\.chain/g);
+
+ return {
+ address,
+ chainName,
+ };
+};
+
+const sendDomData = () => {
+ const { address, chainName } = getAddresses();
if (address || chainName) {
setTimeout(() => {
browser.runtime.sendMessage({
@@ -96,6 +92,17 @@ window.addEventListener('load', () => {
);
});
+// Handle message from background and redirect to page
+browser.runtime.onMessage.addListener(({ data }) => {
+ const { method, blocked, params, extUrl, host, uuid } = data;
+
+ if (method === 'phishingCheck' && blocked) {
+ redirectToWarning(host, params.href, extUrl);
+ } else if (method === 'getAddresses') {
+ browser.runtime.sendMessage({ uuid, data: { ...getAddresses() } });
+ }
+});
+
/**
* Aex-2 Aepp communication
*/
diff --git a/src/lib/backend.js b/src/lib/backend.js
new file mode 100644
index 000000000..d25bc6059
--- /dev/null
+++ b/src/lib/backend.js
@@ -0,0 +1,99 @@
+// copied from https://github.com/aeternity/aepp-raendom/blob/246c75e6fb773cbe8cfe3960975779ab9d81186c/src/utils/backend.js
+
+const BACKEND_URL = 'https://raendom-backend.z52da5wt.xyz';
+
+const wrapTry = async promise => {
+ try {
+ return Promise.race([
+ promise.then(res => {
+ if (!res.ok) throw new Error(`Request failed with ${res.status}`);
+ return res.json();
+ }),
+ new Promise((resolve, reject) => {
+ setTimeout(reject, 3000, 'TIMEOUT');
+ }),
+ ]);
+ } catch (e) {
+ console.error('backend error', e);
+ return null;
+ }
+};
+
+const backendFetch = (path, ...args) => wrapTry(fetch(`${BACKEND_URL}/${path}`, ...args));
+
+export default class Backend {
+ static getTipComments = async tipId => backendFetch(`comment/api/tip/${encodeURIComponent(tipId)}`);
+
+ static async sendTipComment(tipId, text, author, signCb) {
+ const sendComment = async postParam =>
+ backendFetch(`comment/api/`, {
+ method: 'post',
+ body: JSON.stringify(postParam),
+ headers: { 'Content-Type': 'application/json' },
+ });
+
+ const responseChallenge = await sendComment({ tipId, text, author });
+ const signedChallenge = await signCb(responseChallenge.challenge);
+ const respondChallenge = {
+ challenge: responseChallenge.challenge,
+ signature: signedChallenge,
+ };
+
+ return sendComment(respondChallenge);
+ }
+
+ static getAllComments = async () => backendFetch(`comment/api/`);
+
+ static getProfile = async address => backendFetch(`profile/${address}`);
+
+ static sendProfileData = async postParam =>
+ backendFetch(`profile`, {
+ method: 'post',
+ body: JSON.stringify(postParam),
+ headers: { 'Content-Type': 'application/json' },
+ });
+
+ static setProfileImage = async (address, data, image = true) => {
+ const request = {
+ method: 'post',
+ body: image ? data : JSON.stringify(data),
+ };
+ Object.assign(request, !image && { headers: { 'Content-Type': 'application/json' } });
+ console.log(request);
+ return wrapTry(fetch(Backend.getProfileImageUrl(address), request));
+ };
+
+ static getProfileImageUrl = address => `${BACKEND_URL}/profile/image/${address}`;
+
+ static getStats = async () => backendFetch(`static/stats/`);
+
+ static getCacheTipById = async id => backendFetch(`cache/tip?id=${id}`);
+
+ static getCacheUserStats = async address => backendFetch(`cache/userStats?address=${address}`);
+
+ static getCacheTips = async (ordering, page, address = null, search = null) => {
+ let query = `?ordering=${ordering}&page=${page}`;
+ if (address) query += `&address=${address}`;
+ if (search) query += `&search=${encodeURIComponent(search)}`;
+
+ return backendFetch(`cache/tips${query}`);
+ };
+
+ static getCacheStats = async () => backendFetch(`cache/stats`);
+
+ static getCacheChainNames = async () => backendFetch(`cache/chainnames`);
+
+ static getPrice = async () => backendFetch(`cache/price`);
+
+ static getOracleCache = async () => backendFetch(`cache/oracle`);
+
+ static getTopicsCache = async () => backendFetch(`cache/topics`);
+
+ static cacheInvalidateTips = async () => backendFetch(`cache/invalidate/tips`);
+
+ static getCommentCountForAddress = async address => backendFetch(`comment/count/author/${address}`);
+
+ static getTipPreviewUrl = previewLink => `${BACKEND_URL}${previewLink}`;
+
+ static getProfileImageUrl = address => `${BACKEND_URL}/profile/image/${address}`;
+}
diff --git a/src/lib/background-utils.js b/src/lib/background-utils.js
index 42d16acde..82ee9b1a8 100644
--- a/src/lib/background-utils.js
+++ b/src/lib/background-utils.js
@@ -1,6 +1,8 @@
import Universal from '@aeternity/aepp-sdk/es/ae/universal';
import Node from '@aeternity/aepp-sdk/es/node';
+import { isEmpty } from 'lodash-es';
import { setContractInstance, contractCall, getAddressByNameEntry, getActiveNetwork } from '../popup/utils/helper';
+import { getState } from '../store/plugins/persistState';
let sdk;
let controller;
@@ -11,9 +13,9 @@ export const setController = contr => {
};
export const getActiveAccount = async () => {
- const { userAccount } = await browser.storage.local.get('userAccount');
- if (userAccount) {
- return { account: { publicKey: userAccount.publicKey }, activeAccount: 0 };
+ const { account } = await getState();
+ if (!isEmpty(account)) {
+ return { account: { publicKey: account.publicKey }, activeAccount: 0 };
}
return false;
};
@@ -33,7 +35,9 @@ export const switchNode = async () => {
const node = await Node({ url: network.internalUrl, internalUrl: network.internalUrl });
try {
await sdk.addNode(network.name, node, true);
- } catch (e) {}
+ } catch (e) {
+ console.error(`switchNode: ${e}`);
+ }
sdk.selectNode(network.name);
}
};
@@ -49,7 +53,9 @@ export const getSDK = async () => {
nativeMode: true,
compilerUrl: network.compilerUrl,
});
- } catch (e) {}
+ } catch (e) {
+ console.error(`getSDK: ${e}`);
+ }
}
return sdk;
diff --git a/src/lib/initPolyfills.js b/src/lib/initPolyfills.js
index 481752567..3dad42387 100644
--- a/src/lib/initPolyfills.js
+++ b/src/lib/initPolyfills.js
@@ -27,6 +27,10 @@ global.browser = process.env.IS_EXTENSION
keys.forEach(k => localStorage.removeItem(k));
return Promise.resolve();
},
+ clear() {
+ localStorage.clear();
+ return Promise.resolve();
+ },
},
},
};
diff --git a/src/lib/redirect-chain-names.js b/src/lib/redirect-chain-names.js
index 21153556f..a1c965b2e 100644
--- a/src/lib/redirect-chain-names.js
+++ b/src/lib/redirect-chain-names.js
@@ -19,12 +19,11 @@ export default {
.toLowerCase();
const q = new URL(`${url.protocol}//${params}`);
if (!q.hostname || !this.supportedDomain(q.hostname) || url.pathname !== '/search') {
- return;
+ return {};
}
chrome.tabs.update({ url: q.toString() });
- // eslint-disable-next-line consistent-return
return { cancel: true };
},
{
diff --git a/src/lib/rpcWallet.js b/src/lib/rpcWallet.js
index e9400109e..1df7fd363 100644
--- a/src/lib/rpcWallet.js
+++ b/src/lib/rpcWallet.js
@@ -4,7 +4,7 @@ import BrowserRuntimeConnection from '@aeternity/aepp-sdk/es/utils/aepp-wallet-c
import Node from '@aeternity/aepp-sdk/es/node';
import { setInterval, clearInterval } from 'timers';
import uuid from 'uuid';
-import { getAccounts } from '../popup/utils/storage';
+import { isEmpty } from 'lodash-es';
import {
parseFromStorage,
extractHostName,
@@ -18,6 +18,7 @@ import {
} from '../popup/utils/helper';
import { DEFAULT_NETWORK, AEX2_METHODS, NO_POPUP_AEPPS, BLACKLIST_AEPPS, MAX_AMOUNT_WITHOUT_CONFIRM } from '../popup/utils/constants';
import { mockLogin } from '../popup/utils';
+import { getState } from '../store/plugins/persistState';
global.browser = require('webextension-polyfill');
@@ -28,15 +29,17 @@ const rpcWallet = {
this.initFields();
this.controller = walletController;
if (process.env.RUNNING_IN_TESTS) await mockLogin();
- const { userAccount } = await browser.storage.local.get('userAccount');
- if (userAccount) {
- this.controller.generateWallet({ seed: stringifyForStorage(userAccount.privateKey) });
- const { activeNetwork } = await browser.storage.local.get('activeNetwork');
- this[AEX2_METHODS.INIT_RPC_WALLET]({ address: userAccount.publicKey, network: !activeNetwork ? DEFAULT_NETWORK : activeNetwork });
+ const { account } = await getState();
+ if (!isEmpty(account)) {
+ this.controller.generateWallet({ seed: stringifyForStorage(account.privateKey) });
+ const {
+ current: { network },
+ } = await getState();
+ this[AEX2_METHODS.INIT_RPC_WALLET]({ address: account.publicKey, network });
}
},
async initSubaccounts() {
- const subaccounts = await getAccounts();
+ const { subaccounts } = await getState();
this.subaccounts = subaccounts;
return Promise.resolve(true);
},
@@ -185,7 +188,9 @@ const rpcWallet = {
if (typeof cb !== 'undefined') {
cb();
}
- } catch (e) {}
+ } catch (e) {
+ console.error(`checkAeppPermissions: ${e}`);
+ }
} else if (typeof cb === 'undefined') {
action.accept();
} else {
@@ -218,7 +223,9 @@ const rpcWallet = {
} = aepp;
const { protocol } = new URL(url);
this.popups.setAeppInfo(id, { type, action: { params: action.params, method: action.method }, url, icons, name, protocol, host: extractHostName(url) });
- } catch (e) {}
+ } catch (e) {
+ console.error(`showPopup: ${e}`);
+ }
});
},
@@ -278,7 +285,9 @@ const rpcWallet = {
if (this.sdk) {
try {
await this.sdk.addNode(network, node, true);
- } catch (e) {}
+ } catch (e) {
+ console.error(`addNewNetwork: ${e}`);
+ }
this.sdk.selectNode(network);
}
},
diff --git a/src/lib/tip-claim-relay.js b/src/lib/tip-claim-relay.js
index 64adaea94..cfad8d320 100644
--- a/src/lib/tip-claim-relay.js
+++ b/src/lib/tip-claim-relay.js
@@ -41,6 +41,8 @@ export default {
await axios.post(`${TIP_SERVICE}`, { url, address: account.publicKey });
}
}
- } catch (err) {}
+ } catch (e) {
+ console.error(`checkUrlHasBalance: ${e}`);
+ }
},
};
diff --git a/src/lib/wallet.js b/src/lib/wallet.js
index 2560c348c..880ed0971 100644
--- a/src/lib/wallet.js
+++ b/src/lib/wallet.js
@@ -1,6 +1,7 @@
import Universal from '@aeternity/aepp-sdk/es/ae/universal';
import Node from '@aeternity/aepp-sdk/es/node';
import MemoryAccount from '@aeternity/aepp-sdk/es/account/memory';
+import { isEmpty } from 'lodash-es';
import store from '../store';
import { postMessage } from '../popup/utils/connection';
import { parseFromStorage, middleware, getAllNetworks } from '../popup/utils/helper';
@@ -9,39 +10,20 @@ import { TIPPING_CONTRACT } from '../popup/utils/constants';
export default {
countError: 0,
async init() {
- const { userAccount } = await browser.storage.local.get('userAccount');
- if (!userAccount) {
+ const { account } = store.getters;
+ if (isEmpty(account)) {
store.commit('SET_MAIN_LOADING', false);
return { loggedIn: false };
}
-
- const address = await store.dispatch('generateWallet', { seed: userAccount.privateKey });
- store.commit('UPDATE_ACCOUNT', userAccount);
+ const address = await store.dispatch('generateWallet', { seed: account.privateKey });
+ store.commit('UPDATE_ACCOUNT', account);
store.commit('SET_ACTIVE_ACCOUNT', { publicKey: address, index: 0 });
- let sub = [];
- const { subaccounts } = await browser.storage.local.get('subaccounts');
- if (!subaccounts || (subaccounts && !subaccounts.find(f => f.publicKey === userAccount.publicKey))) {
- sub.push({
- name: 'Main Account',
- publicKey: userAccount.publicKey,
- root: true,
- balance: 0,
- aename: null,
- });
- }
- if (subaccounts) sub = [...sub, ...subaccounts.filter(s => s.publicKey)];
- store.dispatch('setSubAccounts', sub);
- /* Get cached balance */
- const { tokenBal } = await browser.storage.local.get('tokenBal');
- if (tokenBal && tokenBal !== '0.000') store.commit('UPDATE_BALANCE', parseFloat(tokenBal));
store.commit('SWITCH_LOGGED_IN', true);
/* Get network */
const networks = await getAllNetworks();
store.commit('SET_NETWORKS', networks);
- const { activeNetwork } = await browser.storage.local.get(['activeNetwork']);
- if (activeNetwork) store.commit('SWITCH_NETWORK', activeNetwork);
store.commit('SET_MAIN_LOADING', false);
return { loggedIn: true };
@@ -80,7 +62,6 @@ export default {
}
},
async logout() {
- await browser.storage.local.remove(['isLogged', 'activeAccount']);
store.commit('SET_ACTIVE_ACCOUNT', { publicKey: '', index: 0 });
store.commit('UNSET_SUBACCOUNTS');
store.commit('UPDATE_ACCOUNT', {});
diff --git a/src/manifest.js b/src/manifest.js
index 1cd3477cd..4a1990d91 100644
--- a/src/manifest.js
+++ b/src/manifest.js
@@ -17,7 +17,6 @@ module.exports = (isProd, browser) => ({
'activeTab',
'clipboardWrite',
'notifications',
- 'tabs',
'webRequest',
'webRequestBlocking',
'*://*.chain/*',
diff --git a/src/notifications.js b/src/notifications.js
index 2b00e27da..020568aa7 100644
--- a/src/notifications.js
+++ b/src/notifications.js
@@ -3,9 +3,37 @@ import iconUrl from './icons/icon_48.png';
import { getSDK, getNodes } from './lib/background-utils';
import { NOTIFICATION_METHODS } from './popup/utils/constants';
import { detectBrowser } from './popup/utils/helper';
+import { getState } from './store/plugins/persistState';
global.browser = require('webextension-polyfill');
+async function deleteNotification(tx) {
+ const { processingTx } = await browser.storage.local.get('processingTx');
+ let list = [...processingTx];
+ list = list.filter(t => t !== tx);
+ await browser.storage.local.set({ processingTx: list });
+}
+
+async function sendNoti({ title, message, contextMessage, error }) {
+ let params = {
+ type: 'basic',
+ title,
+ iconUrl,
+ message,
+ priority: 2,
+ };
+ if (detectBrowser() !== 'Firefox') {
+ if (!error) {
+ params = {
+ ...params,
+ buttons: [{ title: 'See transaction details' }],
+ };
+ }
+ }
+
+ await browser.notifications.create(`popup.html?${contextMessage}`, params);
+}
+
export default class Notification {
constructor() {
this.init();
@@ -27,54 +55,20 @@ export default class Notification {
this.network = (await getNodes()).network;
}
- async getAllNotifications() {
- const { processingTx } = await browser.storage.local.get('processingTx');
- return processingTx;
- }
-
- async deleteNotification(tx) {
- const { processingTx } = await browser.storage.local.get('processingTx');
- let list = [...processingTx];
- list = list.filter(t => t !== tx);
- await browser.storage.local.set({ processingTx: list });
- }
-
async checkTxReady() {
- const noties = await this.getAllNotifications();
- if (noties) {
- noties.forEach(async tx => {
+ const { txQueue } = await getState();
+ if (txQueue) {
+ txQueue.forEach(async tx => {
if (tx !== 'error' && tx) {
await this.client.poll(tx);
const url = `${this.network.explorerUrl}/transactions/${tx}`;
- await this.sendNoti({ title: 'Transaction ready', message: `You can explore your transaction by clicking button below`, contextMessage: url, error: false });
+ await sendNoti({ title: 'Transaction ready', message: `You can explore your transaction by clicking button below`, contextMessage: url, error: false });
} else {
- await this.sendNoti({ title: 'Transaction error', message: 'Transaction cannot be processed ', error: true });
+ await sendNoti({ title: 'Transaction error', message: 'Transaction cannot be processed ', error: true });
}
- await this.deleteNotification(tx);
+ await deleteNotification(tx);
});
}
}
-
- async sendNoti({ title, message, contextMessage, error }) {
- let params = {
- type: 'basic',
- title,
- iconUrl,
- message,
- priority: 2,
- };
- if (detectBrowser() !== 'Firefox') {
- if (!error) {
- params = {
- ...params,
- buttons: [{ title: 'See transaction details' }],
- };
- }
- }
-
- await browser.notifications.create(`popup.html?${contextMessage}`, params);
-
- return Promise.resolve(true);
- }
}
diff --git a/src/options/options.js b/src/options/options.js
index fa15a1e70..6e1307818 100644
--- a/src/options/options.js
+++ b/src/options/options.js
@@ -3,8 +3,6 @@ import App from './App';
global.browser = require('webextension-polyfill');
-/* eslint-disable no-new */
new Vue({
- el: '#app',
render: h => h(App),
-});
+}).$mount('#app');
diff --git a/src/phishing/App.vue b/src/phishing/App.vue
index 880dcf63a..12c5262cc 100644
--- a/src/phishing/App.vue
+++ b/src/phishing/App.vue
@@ -14,7 +14,6 @@
security risks, such as domains that test positive on the SuperHero Phishing Detector . Domains on these warning lists may include outright malicious websites and
legitimate websites that have been compromised by a malicious actor.
- To read more about this site please review the domain on .
Note that this warning list is compiled on a voluntary basis. This list may be inaccurate or incomplete. Just because a domain does not appear on this list is not an
implicit guarantee of that domain's safety. As always, your transactions are your own responsibility. If you wish to interact with any domain on our warning list, you can
@@ -74,7 +73,7 @@ export default {
diff --git a/src/phishing/phishing.html b/src/phishing/phishing.html
index b3ba65d37..7fa014338 100644
--- a/src/phishing/phishing.html
+++ b/src/phishing/phishing.html
@@ -7,6 +7,6 @@
-
+