Skip to content

Commit

Permalink
Merge pull request #210 from enkryptcom/develop
Browse files Browse the repository at this point in the history
Release: v1.10.0
  • Loading branch information
kvhnuke authored Jan 14, 2023
2 parents d0565c2 + b1eb6fd commit 13d3a61
Show file tree
Hide file tree
Showing 41 changed files with 2,366 additions and 1,722 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Enkrypt is a web3 wallet built from the ground up to support the multi-chain fut
* Ethereum Classic
* Polkadot
* Kusama
* Edgeware
* Acala
* Karura
* More coming soon!
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
"watch-ts": "nodemon --exec 'yarn run build:all && node scripts/compile-done.js'"
},
"devDependencies": {
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"concurrently": "^7.4.0",
"@commitlint/cli": "^17.4.2",
"@commitlint/config-conventional": "^17.4.2",
"@swc/core": "^1.3.26",
"concurrently": "^7.6.0",
"devmoji": "^2.3.0",
"husky": "^8.0.1",
"husky": "^8.0.3",
"node-notifier": "^10.0.1",
"nodemon": "^2.0.20",
"ultra-runner": "^3.10.5"
Expand Down
24 changes: 12 additions & 12 deletions packages/extension-bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,25 @@
},
"devDependencies": {
"@antfu/eslint-config": "^0.27.0",
"@types/chai": "^4.3.3",
"@types/chai": "^4.3.4",
"@types/mocha": "^9.1.1",
"@types/node": "^18.7.18",
"@types/webextension-polyfill": "^0.9.1",
"@typescript-eslint/eslint-plugin": "^5.38.0",
"@typescript-eslint/parser": "^5.38.0",
"@types/node": "^18.11.18",
"@types/webextension-polyfill": "^0.10.0",
"@typescript-eslint/eslint-plugin": "^5.48.1",
"@typescript-eslint/parser": "^5.48.1",
"bumpp": "^8.2.1",
"eslint": "^8.23.1",
"eslint": "^8.31.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-prettier": "^8.6.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-import": "^2.27.4",
"eslint-plugin-module-resolver": "^1.5.0",
"prettier": "^2.7.1",
"prettier": "^2.8.2",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.1.0",
"tsup": "^6.2.3",
"tsconfig-paths": "^4.1.2",
"tsup": "^6.5.0",
"type-fest": "^2.19.0",
"typescript": "^4.8.3",
"typescript": "^4.9.4",
"typescript-eslint": "0.0.1-alpha.0"
}
}
82 changes: 41 additions & 41 deletions packages/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@enkryptcom/extension",
"version": "1.9.0",
"version": "1.10.0",
"private": true,
"scripts": {
"zip": "cd dist; zip -r release.zip *;",
Expand All @@ -27,24 +27,24 @@
"@enkryptcom/storage": "^0.0.1",
"@enkryptcom/types": "^0.0.1",
"@enkryptcom/utils": "^0.0.1",
"@ethereumjs/common": "^3.0.0",
"@ethereumjs/tx": "^4.0.0",
"@ledgerhq/hw-transport-webusb": "^6.27.4",
"@metamask/eth-sig-util": "^5.0.0",
"@types/chrome": "^0.0.197",
"@ethereumjs/common": "^3.0.2",
"@ethereumjs/tx": "^4.0.2",
"@ledgerhq/hw-transport-webusb": "^6.27.9",
"@metamask/eth-sig-util": "^5.0.2",
"@types/chrome": "^0.0.208",
"@types/events": "^3.0.0",
"@types/less": "^3.0.3",
"@types/lodash": "^4.14.185",
"@types/lodash": "^4.14.191",
"@types/utf-8-validate": "^5.0.0",
"@vueuse/core": "^9.2.0",
"@vueuse/core": "^9.10.0",
"add": "^2.0.6",
"bignumber.js": "^9.1.0",
"bignumber.js": "^9.1.1",
"bip39": "^3.0.4",
"bitcoinjs-lib": "^6.0.2",
"bitcoinjs-lib": "^6.1.0",
"bitcoinjs-message": "^2.2.0",
"chai": "^4.3.6",
"concurrently": "^7.4.0",
"core-js": "^3.25.2",
"chai": "^4.3.7",
"concurrently": "^7.6.0",
"core-js": "^3.27.1",
"ethereumjs-abi": "^0.6.8",
"ethereumjs-util": "^7.1.5",
"ethereumjs-wallet": "^1.0.2",
Expand All @@ -53,28 +53,28 @@
"memoize-one": "^6.0.0",
"moment": "^2.29.4",
"nanoevents": "^7.0.1",
"pinia": "^2.0.22",
"pinia": "^2.0.28",
"qrcode.vue": "^3.3.3",
"url-parse": "^1.5.10",
"uuid": "^9.0.0",
"vue": "^3.2.39",
"vue-router": "4.1.5",
"vue3-lottie": "^2.3.0",
"vue": "^3.2.45",
"vue-router": "4.1.6",
"vue3-lottie": "^2.4.0",
"vuedraggable": "^4.1.0",
"web3-eth": "^1.8.0",
"web3-utils": "^1.8.0",
"web3-eth": "^1.8.1",
"web3-utils": "^1.8.1",
"zxcvbn": "^4.4.2"
},
"devDependencies": {
"@polkadot/api": "^9.4.1",
"@polkadot/extension-inject": "^0.44.6",
"@polkadot/keyring": "^10.1.8",
"@polkadot/rpc-provider": "^9.4.1",
"@polkadot/types": "^9.4.1",
"@polkadot/types-known": "^9.4.1",
"@polkadot/ui-shared": "^2.9.9",
"@polkadot/util": "^10.1.8",
"@polkadot/wasm-crypto": "^6.3.1",
"@polkadot/api": "^9.11.1",
"@polkadot/extension-inject": "^0.44.8",
"@polkadot/keyring": "^10.2.3",
"@polkadot/rpc-provider": "^9.11.1",
"@polkadot/types": "^9.11.1",
"@polkadot/types-known": "^9.11.1",
"@polkadot/ui-shared": "^2.9.15",
"@polkadot/util": "^10.2.3",
"@polkadot/wasm-crypto": "^6.4.1",
"@rollup/plugin-commonjs": "^22.0.2",
"@rollup/plugin-inject": "^4.0.4",
"@rollup/plugin-json": "^4.1.0",
Expand All @@ -83,38 +83,38 @@
"@types/ethereumjs-abi": "^0.6.3",
"@types/mocha": "^9.1.1",
"@types/url-parse": "^1.4.8",
"@types/uuid": "^8.3.4",
"@types/uuid": "^9.0.0",
"@types/wif": "^2.0.2",
"@types/zxcvbn": "^4.4.1",
"@typescript-eslint/eslint-plugin": "^5.38.0",
"@typescript-eslint/parser": "^5.38.0",
"@typescript-eslint/eslint-plugin": "^5.48.1",
"@typescript-eslint/parser": "^5.48.1",
"@vue/cli-plugin-babel": "~5.0.8",
"@vue/cli-plugin-eslint": "~5.0.8",
"@vue/cli-plugin-typescript": "~5.0.8",
"@vue/cli-service": "~5.0.8",
"@vue/eslint-config-typescript": "^11.0.1",
"@vue/eslint-config-typescript": "^11.0.2",
"buffer": "^6.0.3",
"cross-env": "^7.0.3",
"crypto-browserify": "^3.12.0",
"eslint": "^8.23.1",
"eslint-config-prettier": "^8.5.0",
"eslint": "^8.31.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^8.7.1",
"https-browserify": "^1.0.0",
"less": "^4.1.3",
"less-loader": "^11.0.0",
"mocha": "^10.0.0",
"less-loader": "^11.1.0",
"mocha": "^10.2.0",
"path-browserify": "^1.0.1",
"prettier": "^2.7.1",
"prettier": "^2.8.2",
"rimraf": "^3.0.2",
"rollup": "^2.79.0",
"rollup": "^2.79.1",
"rollup-plugin-uglify": "^6.0.4",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"systeminformation": "^5.12.6",
"systeminformation": "^5.17.3",
"ts-mocha": "^10.0.0",
"tsconfig-paths": "^4.1.0",
"typescript": "^4.8.3",
"tsconfig-paths": "^4.1.2",
"typescript": "^4.9.4",
"url": "^0.11.0",
"webextension-polyfill": "^0.10.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/public/vendor/trezor-usb-permissions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const VERSION = "9.0.1";
const VERSION = "9.0.5";
const versionN = VERSION.split(".").map((s) => parseInt(s, 10));
// const DIRECTORY = `${ versionN[0] }${ (versionN[1] > 0 ? `.${versionN[1]}` : '') }/`;
const DIRECTORY = `${versionN[0]}/`;
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 @@ -39,6 +39,8 @@ const lists: Partial<Record<NetworkNames, string>> = {
"https://raw.githubusercontent.com/enkryptcom/dynamic-data/main/dapps/bifrost.json",
[NetworkNames.BifrostKusama]:
"https://raw.githubusercontent.com/enkryptcom/dynamic-data/main/dapps/bifrost.json",
[NetworkNames.Edgeware]:
"https://raw.githubusercontent.com/enkryptcom/dynamic-data/main/dapps/edg.json",
};

export default lists;
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Transaction {
to: this.tx.to || undefined,
from: this.tx.from,
data: this.tx.data || "0x",
value: this.tx.value || "0x0",
});
}
async finalizeTransaction(options: TransactionOptions): Promise<{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { getCustomError } from "@/libs/error";
import { WindowPromise } from "@/libs/window-promise";
import { MiddlewareFunction } from "@enkryptcom/types";
import { toBN } from "web3-utils";
import EthereumProvider from "..";
const method: MiddlewareFunction = function (
this: EthereumProvider,
Expand All @@ -22,14 +23,31 @@ const method: MiddlewareFunction = function (
const version = supportedMethods[payload.method as string];
const typedData = version === "V1" ? payload.params[0] : payload.params[1];
const address = version === "V1" ? payload.params[1] : payload.params[0];
const typedDataJSON = version !== "V1" ? JSON.parse(typedData) : typedData;

if (
typedDataJSON.domain &&
typedDataJSON.domain.chainId &&
!toBN(typedDataJSON.domain.chainId).eq(toBN(this.network.chainID))
)
return res(
getCustomError(
`eth_signTypedData: Provided chainId ${
typedDataJSON.domain.chainId
} must match the active chainId ${toBN(
this.network.chainID
).toString()}`,
-32603
)
);
this.KeyRing.getAccount(address.toLowerCase()).then((account) => {
const windowPromise = new WindowPromise();
windowPromise
.getResponse(
this.getUIPath(this.UIRoutes.ethSignTypedData.path),
JSON.stringify({
...payload,
params: [typedData, account, version, this.network.name],
params: [typedDataJSON, account, version, this.network.name],
}),
true
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,7 @@ onMounted(async () => {
const approve = async () => {
const { Request, Resolve, sendToBackground } = await windowPromise;
const version = Request.value.params![2] as SignTypedDataVersion;
const typedData =
version !== "V1"
? JSON.parse(Request.value.params![0])
: Request.value.params![0];
const typedData = Request.value.params![0];
let msgHash;
try {
if (version === SignTypedDataVersion.V1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const NetworkEndpoints = {
[NetworkNames.Shiden]: "https://shiden.api.subscan.io/",
[NetworkNames.Bifrost]: "https://bifrost.api.subscan.io/",
[NetworkNames.BifrostKusama]: "https://bifrost-kusama.api.subscan.io/",
[NetworkNames.Edgeware]: "https://edgeware.api.subscan.io/",
};

export { NetworkEndpoints };
9 changes: 5 additions & 4 deletions packages/extension/src/providers/polkadot/libs/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type {
ProviderMeta,
} from "@polkadot/extension-inject/types";
import type {
ProviderInterface,
ProviderInterfaceEmitCb,
ProviderInterfaceEmitted,
} from "@polkadot/rpc-provider/types";
Expand All @@ -23,17 +24,17 @@ export default class PostMessageProvider implements InjectedProvider {
eventEmitter: EventEmitter;
sendMessageHandler: InjectedSendMessageHandler;
options: InjectLibOptions;
isClonable: boolean;

constructor(options: InjectLibOptions) {
this.eventEmitter = new EventEmitter();
this.sendMessageHandler = options.sendMessageHandler;
this.options = options;
this.isClonable = true;
}

public clone(): PostMessageProvider {
console.error("PostMessageProvider.clone() is not implemented.");
public clone(): ProviderInterface {
return new PostMessageProvider(this.options);
}

public async connect(): Promise<void> {
console.error("PostMessageProvider.connect() is not implemented.");
}
Expand Down
34 changes: 34 additions & 0 deletions packages/extension/src/providers/polkadot/networks/edgeware.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { CoingeckoPlatform, NetworkNames } from "@enkryptcom/types";
import { toBN } from "web3-utils";
import { subscanActivity } from "../libs/activity-handlers";
import {
SubstrateNetwork,
SubstrateNetworkOptions,
} from "../types/substrate-network";
import wrapActivityHandler from "@/libs/activity-state/wrap-activity-handler";

const ksmOptions: SubstrateNetworkOptions = {
name: NetworkNames.Edgeware,
name_long: "Edgeware",
homePage: "https://www.edgeware.io/",
blockExplorerTX: "https://edgeware.subscan.io/extrinsic/[[txHash]]",
blockExplorerAddr: "https://edgeware.subscan.io/account/[[address]]",
isTestNetwork: false,
currencyName: "EDG",
currencyNameLong: "Edge",
icon: require("./icons/edgeware.svg"),
decimals: 18,
prefix: 7,
gradient: "#000000",
node: "wss://edgeware.jelliedowl.net",
coingeckoID: "edgeware",
coingeckoPlatform: CoingeckoPlatform.Edgeware,
genesisHash:
"0x742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
activityHandler: wrapActivityHandler(subscanActivity),
existentialDeposit: toBN("10000000000000"),
};

const ksm = new SubstrateNetwork(ksmOptions);

export default ksm;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions packages/extension/src/providers/polkadot/networks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import astrNode from "./astar/astar";
import sdnNode from "./astar/shiden";
import bncNode from "./bifrost/polkadot";
import bncKusamaNode from "./bifrost/kusama";
import edgNode from "./edgeware";

export default {
acala: acaNode,
Expand All @@ -18,4 +19,5 @@ export default {
shiden: sdnNode,
bifrost: bncNode,
bifrostKusama: bncKusamaNode,
edgeware: edgNode,
};
Binary file not shown.
Loading

2 comments on commit 13d3a61

@github-actions
Copy link

Choose a reason for hiding this comment

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

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