Skip to content

Commit

Permalink
devop: merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
kvhnuke committed Feb 22, 2024
2 parents f5252ca + ba254ad commit 5bdef30
Show file tree
Hide file tree
Showing 138 changed files with 5,554 additions and 3,069 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ jobs:
buildAll:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: setup env
id: node-version
run: |
docker build -t enkrypt-build-container .
echo ::set-output name=NODE_VERSION::$(docker run --rm -v `pwd`:/home:rw enkrypt-build-container /bin/bash -c "node --version")
echo "NODE_VERSION=$(docker run --rm -v `pwd`:/home:rw enkrypt-build-container /bin/bash -c "node --version")" >> $GITHUB_OUTPUT
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- name: Cache yarn modules
uses: actions/cache@v3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: setup env
id: node-version
run: |
docker build -t enkrypt-build-container .
echo ::set-output name=NODE_VERSION::$(docker run --rm -v `pwd`:/home:rw enkrypt-build-container /bin/bash -c "node --version")
echo "NODE_VERSION=$(docker run --rm -v `pwd`:/home:rw enkrypt-build-container /bin/bash -c "node --version")" >> $GITHUB_OUTPUT
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- name: Cache yarn modules
uses: actions/cache@v3
Expand All @@ -34,7 +34,7 @@ jobs:

- name: Get release tag
id: get_release_tag
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT

- name: build
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: "16"
cache: "yarn"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16-bullseye
FROM node:20-bullseye
RUN apt update
RUN apt install build-essential zip -y
ENV HOME /home
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Enkrypt is a web3 wallet built from the ground up to support the multi-chain fut
- Aurora
- Ontology
- Puppy Net
- Arthera
- More coming soon!

Looking to add your project? [Contact us!](https://mewwallet.typeform.com/enkrypt-inquiry?typeform-source=www.enkrypt.com)
Expand All @@ -75,8 +76,8 @@ To get started make sure you have `nodejs` and `nvm` installed on your system

- npm
```sh
nvm install 16
nvm use 16
nvm install 20
nvm use 20
npm install yarn -g
```

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
"version:apply": "yarn version apply --all"
},
"devDependencies": {
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",
"@swc/core": "^1.3.84",
"concurrently": "^8.2.1",
"@commitlint/cli": "^17.8.1",
"@commitlint/config-conventional": "^17.8.1",
"@swc/core": "^1.3.104",
"concurrently": "^8.2.2",
"devmoji": "^2.3.0",
"husky": "^8.0.3",
"node-notifier": "^10.0.1",
"nodemon": "^3.0.1",
"nodemon": "^3.0.3",
"ultra-runner": "^3.10.5"
},
"resolutions": {
Expand Down
18 changes: 9 additions & 9 deletions packages/extension-bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,26 @@
],
"dependencies": {
"nanoevents": "^7.0.1",
"serialize-error": "11.0.2",
"serialize-error": "11.0.3",
"tiny-uid": "^1.1.2",
"webextension-polyfill": "^0.10.0"
},
"devDependencies": {
"@types/chai": "^4.3.6",
"@types/mocha": "^10.0.1",
"@types/node": "^20.6.0",
"@types/webextension-polyfill": "^0.10.2",
"@types/chai": "^4.3.11",
"@types/mocha": "^10.0.6",
"@types/node": "^20.11.5",
"@types/webextension-polyfill": "^0.10.7",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"bumpp": "^8.2.1",
"eslint": "^8.49.0",
"bumpp": "^9.3.0",
"eslint": "^8.56.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.10.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-module-resolver": "^1.5.0",
"prettier": "^2.8.8",
"ts-node": "^10.9.1",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"tsup": "^6.7.0",
"type-fest": "^2.19.0",
Expand Down
1 change: 1 addition & 0 deletions packages/extension/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
plugins: ["@babel/plugin-transform-class-static-block"],
presets: ["@vue/cli-plugin-babel/preset"],
};
1 change: 1 addition & 0 deletions packages/extension/configs/browser-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const setConfig = (config) => {
args[0]["process.env"] = {
..._base,
PACKAGE_VERSION: JSON.stringify(package.version),
BUILD_TIME: new Date().toLocaleString().replace(/\D/g, ""),
IS_DEV: process.env.NODE_ENV === "development",
IS_FIREFOX: BROWSER === browserNames.firefox,
PREFILL_PASSWORD:
Expand Down
98 changes: 50 additions & 48 deletions packages/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@enkryptcom/extension",
"version": "1.28.0",
"version": "1.33.0",
"private": true,
"scripts": {
"zip": "cd dist; zip -r release.zip *;",
Expand All @@ -18,7 +18,7 @@
"watch-vue-firefox": "cross-env BROWSER='firefox' vue-cli-service build --watch --no-clean"
},
"dependencies": {
"@babel/runtime": "^7.22.15",
"@babel/runtime": "^7.23.8",
"@enkryptcom/extension-bridge": "workspace:^",
"@enkryptcom/hw-wallets": "workspace:^",
"@enkryptcom/keyring": "workspace:^",
Expand All @@ -30,68 +30,69 @@
"@ethereumjs/common": "^3.2.0",
"@ethereumjs/tx": "^4.2.0",
"@kadena/client": "^1.2.0",
"@ledgerhq/hw-transport-webusb": "^6.27.19",
"@metamask/eth-sig-util": "^6.0.1",
"@rollup/plugin-replace": "^5.0.2",
"@types/chrome": "^0.0.245",
"@types/events": "^3.0.0",
"@types/less": "^3.0.4",
"@types/lodash": "^4.14.198",
"@types/utf-8-validate": "^5.0.0",
"@ledgerhq/hw-transport-webusb": "^6.28.1",
"@metamask/eth-sig-util": "^7.0.1",
"@rollup/plugin-replace": "^5.0.5",
"@types/chrome": "^0.0.258",
"@types/events": "^3.0.3",
"@types/less": "^3.0.6",
"@types/lodash": "^4.14.202",
"@types/utf-8-validate": "^5.0.2",
"@vueuse/core": "^9.13.0",
"add": "^2.0.6",
"bignumber.js": "^9.1.2",
"bip39": "^3.1.0",
"bitcoinjs-lib": "^6.1.3",
"bitcoinjs-lib": "^6.1.5",
"bitcoinjs-message": "^2.2.0",
"chai": "^4.3.8",
"concurrently": "^8.2.1",
"core-js": "^3.32.2",
"chai": "^4.4.1",
"concurrently": "^8.2.2",
"core-js": "^3.35.0",
"echarts": "^5.4.3",
"ethereumjs-abi": "^0.6.8",
"ethereumjs-util": "^7.1.5",
"ethereumjs-wallet": "^1.0.2",
"eventemitter3": "^5.0.1",
"lodash": "^4.17.21",
"memoize-one": "^6.0.0",
"moment": "^2.29.4",
"moment": "^2.30.1",
"nanoevents": "^7.0.1",
"pact-lang-api": "^4.3.6",
"pinia": "^2.1.6",
"pinia": "^2.1.7",
"qrcode.vue": "^3.4.1",
"switch-ts": "^1.1.1",
"url-parse": "^1.5.10",
"uuid": "^9.0.0",
"vue": "^3.3.4",
"vue-echarts": "^6.6.1",
"vue-router": "4.2.4",
"uuid": "^9.0.1",
"vue": "^3.4.15",
"vue-echarts": "6.6.8",
"vue-router": "4.2.5",
"vue3-lottie": "^2.7.4",
"vuedraggable": "^4.1.0",
"web3-eth": "^1.10.2",
"web3-utils": "^1.10.2",
"yarn": "^1.22.19",
"web3-eth": "^1.10.3",
"web3-utils": "^1.10.3",
"yarn": "^1.22.21",
"zxcvbn": "^4.4.2"
},
"devDependencies": {
"@polkadot/api": "^10.9.1",
"@polkadot/extension-inject": "^0.46.5",
"@polkadot/keyring": "^12.5.1",
"@polkadot/rpc-provider": "^10.9.1",
"@polkadot/types": "^10.9.1",
"@polkadot/types-known": "^10.9.1",
"@polkadot/ui-shared": "^3.6.3",
"@polkadot/util": "^12.5.1",
"@polkadot/wasm-crypto": "^7.2.2",
"@rollup/plugin-commonjs": "^25.0.4",
"@rollup/plugin-inject": "^5.0.3",
"@rollup/plugin-node-resolve": "^15.2.1",
"@rollup/plugin-typescript": "^11.1.3",
"@types/ethereumjs-abi": "^0.6.3",
"@types/mocha": "^10.0.1",
"@types/url-parse": "^1.4.9",
"@types/uuid": "^9.0.3",
"@types/wif": "^2.0.2",
"@types/zxcvbn": "^4.4.2",
"@babel/plugin-transform-class-static-block": "^7.23.4",
"@polkadot/api": "^10.11.2",
"@polkadot/extension-inject": "^0.46.6",
"@polkadot/keyring": "^12.6.2",
"@polkadot/rpc-provider": "^10.11.2",
"@polkadot/types": "^10.11.2",
"@polkadot/types-known": "^10.11.2",
"@polkadot/ui-shared": "^3.6.4",
"@polkadot/util": "^12.6.2",
"@polkadot/wasm-crypto": "^7.3.2",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-inject": "^5.0.5",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"@types/ethereumjs-abi": "^0.6.5",
"@types/mocha": "^10.0.6",
"@types/url-parse": "^1.4.11",
"@types/uuid": "^9.0.7",
"@types/wif": "^2.0.5",
"@types/zxcvbn": "^4.4.4",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@vue/cli-plugin-babel": "~5.0.8",
Expand All @@ -102,26 +103,27 @@
"buffer": "^6.0.3",
"cross-env": "^7.0.3",
"crypto-browserify": "^3.12.0",
"eslint": "^8.49.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^8.7.1",
"https-browserify": "^1.0.0",
"less": "^4.2.0",
"less-loader": "^11.1.3",
"less-loader": "^11.1.4",
"mocha": "^10.2.0",
"path-browserify": "^1.0.1",
"prettier": "^2.8.8",
"rimraf": "^5.0.1",
"rollup": "^3.29.1",
"rimraf": "^5.0.5",
"rollup": "^3.29.4",
"rollup-plugin-uglify": "^6.0.4",
"semver": "^7.5.4",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"systeminformation": "^5.21.4",
"systeminformation": "^5.21.22",
"ts-mocha": "^10.0.0",
"tsconfig-paths": "^4.2.0",
"typescript": "^4.9.5",
"url": "^0.11.2",
"url": "^0.11.3",
"webextension-polyfill": "^0.10.0"
},
"installConfig": {
Expand Down
60 changes: 33 additions & 27 deletions packages/extension/src/libs/activity-state/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ActivityOptions } from "./types";
import { Activity, ActivityStatus } from "@/types/activity";
const STORAGE_KEY = "activity";
const MAX_PENDING_TIME = 12 * 60 * 60 * 1000; // 12 hours

class ActivityState {
#storage: BrowserStorage;
constructor() {
Expand All @@ -19,39 +20,44 @@ class ActivityState {
activity: Activity[],
options: ActivityOptions
): Promise<void> {
const activities = await this.getActivitiesById(
this.getActivityId(options)
let activities = await this.getActivitiesById(this.getActivityId(options));
const liveHashesToRemove: string[] = [];
const oldHashesToRemove: string[] = [];
activities.forEach((act) => {
activity.forEach((lact) => {
if (act.transactionHash === lact.transactionHash) {
act.status = lact.status;
liveHashesToRemove.push(lact.transactionHash);
}
if (
act.nonce &&
act.nonce === lact.nonce &&
act.transactionHash !== lact.transactionHash &&
(lact.status === ActivityStatus.success ||
lact.status === ActivityStatus.failed)
) {
oldHashesToRemove.push(act.transactionHash);
}
});
});
activity = activity.filter(
(a) => !liveHashesToRemove.includes(a.transactionHash)
);
const combined = activity.concat(activities);
activities = activities.filter(
(a) => !oldHashesToRemove.includes(a.transactionHash)
);
let combined = activities.concat(activity);
combined.sort((a, b) => {
return b.timestamp - a.timestamp;
});
const existingHashes: string[] = [];
const cleanArr: Activity[] = [];
const currentTime = new Date().getTime();
const minedNonces = cleanArr
.filter(
(item) =>
(item.status === ActivityStatus.success ||
item.status === ActivityStatus.failed) &&
item.nonce
)
.map((item) => item.nonce);
for (let i = 0; i < combined.length; i++) {
if (!existingHashes.includes(combined[i].transactionHash)) {
if (
combined[i].status !== ActivityStatus.pending ||
!combined[i].nonce ||
!minedNonces.includes(combined[i].nonce) ||
(combined[i].status === ActivityStatus.pending &&
combined[i].timestamp > currentTime - MAX_PENDING_TIME)
)
cleanArr.push(combined[i]);
}
existingHashes.push(combined[i].transactionHash);
}
combined = combined.filter(
(a) =>
a.status !== ActivityStatus.pending ||
a.timestamp > currentTime - MAX_PENDING_TIME
);
await this.setActivitiesById(
cleanArr.slice(0, 50),
combined.slice(0, 50),
this.getActivityId(options)
);
}
Expand Down
Loading

1 comment on commit 5bdef30

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.