Skip to content

Commit

Permalink
devop: merge
Browse files Browse the repository at this point in the history
  • Loading branch information
kvhnuke committed Mar 20, 2024
2 parents 4258591 + acab47e commit e0b5e01
Show file tree
Hide file tree
Showing 65 changed files with 3,964 additions and 3,303 deletions.
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn commitlint --edit $1
4 changes: 0 additions & 4 deletions .husky/prepare-commit-msg

This file was deleted.

874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.3.cjs

This file was deleted.

875 changes: 875 additions & 0 deletions .yarn/releases/yarn-3.8.1.cjs

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
checksumBehavior: update

nodeLinker: node-modules

plugins:
Expand All @@ -8,4 +10,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"

yarnPath: .yarn/releases/yarn-3.6.3.cjs
yarnPath: .yarn/releases/yarn-3.8.1.cjs
24 changes: 24 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
rules: {
"type-enum": [
2,
"always",
[
"devop",
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"test",
"button",
],
],
},
};
40 changes: 0 additions & 40 deletions devmoji.config.js

This file was deleted.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "enkrypt",
"packageManager": "yarn@3.6.3",
"packageManager": "yarn@3.8.1",
"version": "0.0.2",
"private": true,
"workspaces": [
Expand All @@ -26,15 +26,15 @@
"upgrade": "yarn upgrade-interactive",
"version:bump:patch": "yarn workspaces foreach -pv --exclude @enkryptcom/extension exec 'yarn version --immediate patch'",
"publish": "yarn workspaces foreach -pv --exclude @enkryptcom/extension exec 'yarn npm publish --access public --otp 474911'",
"version:apply": "yarn version apply --all"
"version:apply": "yarn version apply --all",
"prepare": "husky"
},
"devDependencies": {
"@commitlint/cli": "^17.8.1",
"@commitlint/config-conventional": "^17.8.1",
"@swc/core": "^1.4.4",
"@commitlint/cli": "^19.2.1",
"@commitlint/config-conventional": "^19.1.0",
"@swc/core": "^1.4.8",
"concurrently": "^8.2.2",
"devmoji": "^2.3.0",
"husky": "^8.0.3",
"husky": "^9.0.11",
"node-notifier": "^10.0.1",
"nodemon": "^3.1.0",
"ultra-runner": "^3.10.5"
Expand Down
10 changes: 5 additions & 5 deletions packages/extension-bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
"dist"
],
"dependencies": {
"nanoevents": "^7.0.1",
"nanoevents": "^9.0.0",
"serialize-error": "11.0.3",
"tiny-uid": "^1.1.2",
"webextension-polyfill": "^0.10.0"
},
"devDependencies": {
"@types/chai": "^4.3.12",
"@types/chai": "^4.3.14",
"@types/mocha": "^10.0.6",
"@types/node": "^20.11.24",
"@types/node": "^20.11.30",
"@types/webextension-polyfill": "^0.10.7",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
Expand All @@ -55,8 +55,8 @@
"prettier": "^2.8.8",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"tsup": "^6.7.0",
"type-fest": "^2.19.0",
"tsup": "^8.0.2",
"type-fest": "^4.13.1",
"typescript": "^4.9.5",
"typescript-eslint": "0.0.1-alpha.0"
}
Expand Down
6 changes: 6 additions & 0 deletions packages/extension/configs/browser-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const BROWSER = process.env.BROWSER;
const browserNames = {
chrome: "chrome",
firefox: "firefox",
operaedge: "opera-edge",
};

const browserConfigs = {
Expand All @@ -18,6 +19,10 @@ const browserConfigs = {
manifest: "./src/manifest/manifest-firefox.json",
background: "./src/scripts/firefox/background.ts",
},
[browserNames.operaedge]: {
manifest: "./src/manifest/manifest-edge-opera.json",
background: "./src/scripts/chrome/background.ts",
},
};

function modifyManifest(buffer) {
Expand Down Expand Up @@ -67,6 +72,7 @@ const setConfig = (config) => {
BUILD_TIME: new Date().toLocaleString().replace(/\D/g, ""),
IS_DEV: process.env.NODE_ENV === "development",
IS_FIREFOX: BROWSER === browserNames.firefox,
IS_OPERA_EDGE: BROWSER === browserNames.operaedge,
PREFILL_PASSWORD:
process.env.NODE_ENV === "development"
? JSON.stringify("test pass")
Expand Down
44 changes: 23 additions & 21 deletions packages/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "@enkryptcom/extension",
"version": "1.35.0",
"version": "1.36.0",
"private": true,
"scripts": {
"zip": "cd dist; zip -r release.zip *;",
"build:chrome": "cross-env BROWSER='chrome' vue-cli-service build && yarn build:rollup",
"build:operaedge": "cross-env BROWSER='opera-edge' vue-cli-service build && yarn build:rollup",
"build:firefox": "cross-env BROWSER='firefox' vue-cli-service build && yarn build:rollup && node configs/get-system-info.js",
"lint": "vue-cli-service lint --fix",
"build:rollup": "cross-env minify=on rollup --config configs/rollup.config.contentscript.mjs && cross-env minify=on rollup --config configs/rollup.config.inject.mjs",
Expand All @@ -19,7 +20,7 @@
},
"dependencies": {
"@amplitude/analytics-browser": "^2.5.3",
"@babel/runtime": "^7.23.8",
"@babel/runtime": "^7.24.1",
"@enkryptcom/extension-bridge": "workspace:^",
"@enkryptcom/hw-wallets": "workspace:^",
"@enkryptcom/keyring": "workspace:^",
Expand All @@ -28,33 +29,34 @@
"@enkryptcom/swap": "workspace:^",
"@enkryptcom/types": "workspace:^",
"@enkryptcom/utils": "workspace:^",
"@ethereumjs/common": "^3.2.0",
"@ethereumjs/tx": "^4.2.0",
"@ledgerhq/hw-transport-webusb": "^6.28.4",
"@ethereumjs/common": "^4.3.0",
"@ethereumjs/tx": "^5.3.0",
"@ethereumjs/util": "^9.0.3",
"@ledgerhq/hw-transport-webusb": "^6.28.5",
"@metamask/eth-sig-util": "^7.0.1",
"@rollup/plugin-replace": "^5.0.5",
"@types/chrome": "^0.0.262",
"@types/chrome": "^0.0.263",
"@types/events": "^3.0.3",
"@types/less": "^3.0.6",
"@types/lodash": "^4.14.202",
"@types/lodash": "^4.17.0",
"@types/utf-8-validate": "^5.0.2",
"@vueuse/core": "^9.13.0",
"@vueuse/core": "^10.9.0",
"add": "^2.0.6",
"bignumber.js": "^9.1.2",
"bip39": "^3.1.0",
"bitcoinjs-lib": "^6.1.5",
"chai": "^4.4.1",
"concurrently": "^8.2.2",
"core-js": "^3.36.0",
"core-js": "^3.36.1",
"echarts": "^5.5.0",
"ethereum-cryptography": "^2.1.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.30.1",
"nanoevents": "^7.0.1",
"nanoevents": "^9.0.0",
"pinia": "^2.1.7",
"qrcode.vue": "^3.4.1",
"switch-ts": "^1.1.1",
Expand All @@ -63,21 +65,21 @@
"vue": "^3.4.21",
"vue-echarts": "6.6.9",
"vue-router": "4.3.0",
"vue3-lottie": "^2.7.4",
"vue3-lottie": "^3.3.0",
"vuedraggable": "^4.1.0",
"web3-eth": "^1.10.4",
"web3-utils": "^1.10.4",
"yarn": "^1.22.21",
"yarn": "^1.22.22",
"zxcvbn": "^4.4.2"
},
"devDependencies": {
"@babel/plugin-transform-class-static-block": "^7.23.4",
"@polkadot/api": "^10.12.1",
"@polkadot/extension-inject": "^0.46.7",
"@babel/plugin-transform-class-static-block": "^7.24.1",
"@polkadot/api": "^10.12.4",
"@polkadot/extension-inject": "^0.46.9",
"@polkadot/keyring": "^12.6.2",
"@polkadot/rpc-provider": "^10.12.1",
"@polkadot/types": "^10.12.1",
"@polkadot/types-known": "^10.12.1",
"@polkadot/rpc-provider": "^10.12.4",
"@polkadot/types": "^10.12.4",
"@polkadot/types-known": "^10.12.4",
"@polkadot/ui-shared": "^3.6.5",
"@polkadot/util": "^12.6.2",
"@polkadot/wasm-crypto": "^7.3.2",
Expand Down Expand Up @@ -107,7 +109,7 @@
"eslint-plugin-vue": "^8.7.1",
"https-browserify": "^1.0.0",
"less": "^4.2.0",
"less-loader": "^11.1.4",
"less-loader": "^12.2.0",
"mocha": "^10.3.0",
"path-browserify": "^1.0.1",
"prettier": "^2.8.8",
Expand All @@ -117,7 +119,7 @@
"semver": "^7.6.0",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"systeminformation": "^5.22.0",
"systeminformation": "^5.22.6",
"ts-mocha": "^10.0.0",
"tsconfig-paths": "^4.2.0",
"typescript": "^4.9.5",
Expand Down
2 changes: 2 additions & 0 deletions packages/extension/src/libs/dapp-list/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ const lists: Partial<Record<NetworkNames, string>> = {
"https://raw.githubusercontent.com/enkryptcom/dynamic-data/main/dapps/celo.json",
[NetworkNames.MaticZK]:
"https://raw.githubusercontent.com/enkryptcom/dynamic-data/main/dapps/matic-zkevm.json",
[NetworkNames.Bitcoin]:
"https://raw.githubusercontent.com/enkryptcom/dynamic-data/main/dapps/btc.json",
};

export default lists;
49 changes: 49 additions & 0 deletions packages/extension/src/manifest/manifest-edge-opera.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"manifest_version": 3,
"action": {
"default_icon": {
"16": "assets/img/icons/icon16.png",
"32": "assets/img/icons/icon32.png",
"64": "assets/img/icons/icon64.png",
"192": "assets/img/icons/icon192.png"
},
"default_title": "Enkrypt",
"default_popup": "action.html"
},
"background": {
"service_worker": "scripts/background.js"
},
"host_permissions": ["file://*/*", "http://*/*", "https://*/*"],
"content_scripts": [
{
"matches": ["file://*/*", "http://*/*", "https://*/*"],
"js": ["scripts/contentscript.js"],
"run_at": "document_start",
"all_frames": false
},
{
"matches": ["*://connect.trezor.io/*/popup.html"],
"js": ["vendor/trezor-content-script.js"],
"run_at": "document_start"
}
],
"web_accessible_resources": [
{
"resources": ["scripts/inject.js", "scripts/*.js.map"],
"use_dynamic_url": false,
"matches": ["file://*/*", "http://*/*", "https://*/*"]
}
],
"minimum_chrome_version": "111",
"content_security_policy": {
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'"
},
"permissions": [
"storage",
"unlimitedStorage",
"tabs",
"clipboardRead",
"clipboardWrite",
"scripting"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@

import { BitcoinNetwork, PaymentType } from "../types/bitcoin-network";
import { address as BTCAddress, Transaction, Psbt } from "bitcoinjs-lib";
import { sha256 } from "ethereumjs-util";
import { sha256 } from "ethereum-cryptography/sha256";
import { PSBTSigner } from "../ui/libs/signer";
import { bufferToHex } from "@enkryptcom/utils";

const bip0322_hash = (message: string) => {
const tag = "BIP0322-signed-message";
const tagHash = sha256(Buffer.from(tag));
const result = sha256(
Buffer.concat([tagHash, tagHash, Buffer.from(message)])
);
return result.toString("hex");
return bufferToHex(result, true);
};

const MAX_SAFE_INTEGER = 9007199254740991;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sha256 } from "ethereumjs-util";
import { sha256 } from "ethereum-cryptography/sha256";

const MAGIC_BYTES = Buffer.from("Bitcoin Signed Message:\n");

Expand Down Expand Up @@ -28,7 +28,7 @@ export const magicHash = (messageBuffer: Buffer) => {
const prefix1 = varintBufNum(MAGIC_BYTES.length);
const prefix2 = varintBufNum(messageBuffer.length);
const buf = Buffer.concat([prefix1, MAGIC_BYTES, prefix2, messageBuffer]);
return sha256(sha256(buf));
return Buffer.from(sha256(sha256(buf)));
};

export const toCompact = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ import { getError } from "@/libs/error";
import { ErrorCodes } from "@/providers/ethereum/types";
import { WindowPromiseHandler } from "@/libs/window-promise";
import { DEFAULT_BTC_NETWORK, getNetworkByName } from "@/libs/utils/networks";
import { fromBase, hexToBuffer } from "@enkryptcom/utils";
import { fromBase, hexToBuffer, bufferToHex } from "@enkryptcom/utils";
import { ProviderRequestOptions } from "@/types/provider";
import { GasFeeType } from "./types";
import MarketData from "@/libs/market-data";
Expand All @@ -141,7 +141,6 @@ import { toBN } from "web3-utils";
import { Psbt } from "bitcoinjs-lib";
import BigNumber from "bignumber.js";
import { JsonTreeView } from "@/libs/json-tree-view";
import { bufferToHex } from "ethereumjs-util";
const isProcessing = ref(false);
const isPreLoading = ref(true);
Expand Down
Loading

1 comment on commit e0b5e01

@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.