Skip to content

Commit

Permalink
devop: merge and update
Browse files Browse the repository at this point in the history
  • Loading branch information
kvhnuke committed Mar 20, 2024
2 parents 69c71b2 + f85951e commit 4625097
Show file tree
Hide file tree
Showing 33 changed files with 2,304 additions and 1,587 deletions.
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20-bullseye
FROM node:20-bookworm
RUN apt update
RUN apt install build-essential zip -y
ENV HOME /home
Expand Down
8 changes: 4 additions & 4 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 Down Expand Up @@ -30,9 +30,9 @@
"prepare": "husky"
},
"devDependencies": {
"@commitlint/cli": "^19.0.3",
"@commitlint/config-conventional": "^19.0.3",
"@swc/core": "^1.4.2",
"@commitlint/cli": "^19.2.1",
"@commitlint/config-conventional": "^19.1.0",
"@swc/core": "^1.4.8",
"concurrently": "^8.2.2",
"husky": "^9.0.11",
"node-notifier": "^10.0.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/extension-bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
"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.22",
"@types/node": "^20.11.30",
"@types/webextension-polyfill": "^0.10.7",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"bumpp": "^9.3.0",
"bumpp": "^9.4.0",
"eslint": "^8.57.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.10.0",
Expand Down
36 changes: 18 additions & 18 deletions packages/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@enkryptcom/extension",
"version": "1.34.0",
"version": "1.35.0",
"private": true,
"scripts": {
"zip": "cd dist; zip -r release.zip *;",
Expand All @@ -19,7 +19,7 @@
"watch-vue-firefox": "cross-env BROWSER='firefox' vue-cli-service build --watch --no-clean"
},
"dependencies": {
"@babel/runtime": "^7.23.8",
"@babel/runtime": "^7.24.1",
"@enkryptcom/extension-bridge": "workspace:^",
"@enkryptcom/hw-wallets": "workspace:^",
"@enkryptcom/keyring": "workspace:^",
Expand All @@ -28,16 +28,16 @@
"@enkryptcom/swap": "workspace:^",
"@enkryptcom/types": "workspace:^",
"@enkryptcom/utils": "workspace:^",
"@ethereumjs/common": "^4.2.0",
"@ethereumjs/tx": "^5.2.1",
"@ethereumjs/util": "^9.0.2",
"@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",
"add": "^2.0.6",
Expand All @@ -46,7 +46,7 @@
"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",
Expand All @@ -64,21 +64,21 @@
"vue": "^3.4.21",
"vue-echarts": "6.6.9",
"vue-router": "4.3.0",
"vue3-lottie": "^3.2.0",
"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.11.3",
"@polkadot/extension-inject": "^0.46.6",
"@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.11.3",
"@polkadot/types": "^10.11.3",
"@polkadot/types-known": "^10.11.3",
"@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 @@ -118,7 +118,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
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,13 @@ const isInputsValid = computed<boolean>(() => {
!isAddress(addressTo.value, (props.network as BitcoinNetwork).networkInfo)
)
return false;
if (!isValidDecimals(sendAmount.value, selectedAsset.value.decimals!)) {
if (
isSendToken.value &&
!isValidDecimals(sendAmount.value, selectedAsset.value.decimals!)
) {
return false;
}
if (!isSendToken.value && !selectedNft.value.id) {
return false;
}
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ const NetworkEndpoints: Record<string, string> = {
"https://parallel-stormy-spica.explorer.mainnet.skalenodes.com/",
[NetworkNames.SkaleChaos]:
"https://staging-fast-active-bellatrix.explorer.staging-v3.skalenodes.com/",
[NetworkNames.ZkSyncGoerli]: "https://zksync2-testnet.zkscan.io/",
[NetworkNames.ZkSync]: "https://zksync2-mainnet.zkscan.io/",
[NetworkNames.ZkSyncGoerli]:
"https://block-explorer-api.testnets.zksync.dev/",
[NetworkNames.ZkSync]: "https://block-explorer-api.mainnet.zksync.io/",
[NetworkNames.Arbitrum]: "https://api.arbiscan.io/",
[NetworkNames.Gnosis]: "https://api.gnosisscan.io/",
[NetworkNames.Avalanche]: "https://api.snowtrace.io/",
Expand All @@ -46,7 +47,6 @@ const NetworkEndpoints: Record<string, string> = {
[NetworkNames.MaticZK]: "https://api-zkevm.polygonscan.com/",
[NetworkNames.Base]: "https://api.basescan.org/",
[NetworkNames.Celo]: "https://explorer.celo.org/mainnet/",
[NetworkNames.Arthera]: "https://explorer-test.arthera.net/",
[NetworkNames.FormTestnet]: "https://testnet-explorer.form.network/",
[NetworkNames.ArtheraTest]: "https://explorer-test.arthera.net/",
[NetworkNames.Arthera]: "https://explorer.arthera.net/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const method: MiddlewareFunction = async function (
): Promise<void> {
if (payload.method !== "enkrypt_getPublicKey") return next();
else {
const whitelistDomains = ["localhost", "raffle.enkrypt.com"];
const whitelistDomains = ["localhost", "giveaway.enkrypt.com"];
if (!whitelistDomains.includes(payload.options?.domain || "".toLowerCase()))
return res(getCustomError("Cannot call this method from this domain"));
const isInitialized = await this.KeyRing.isInitialized();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const zkSyncOptions: EvmNetworkOptions = {
coingeckoPlatform: CoingeckoPlatform.Zksync,
NFTHandler: shNFTHandler,
assetsInfoHandler,

activityHandler: wrapActivityHandler(EtherscanActivity),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,13 @@ const isValidSend = computed<boolean>(() => {
const isInputsValid = computed<boolean>(() => {
if (!props.network.isAddress(addressTo.value)) return false;
if (!isValidDecimals(sendAmount.value, selectedAsset.value.decimals!)) {
if (
isSendToken.value &&
!isValidDecimals(sendAmount.value, selectedAsset.value.decimals!)
) {
return false;
}
if (!isSendToken.value && !selectedNft.value.id) {
return false;
}
if (new BigNumber(sendAmount.value).gt(assetMaxValue.value)) return false;
Expand Down
24 changes: 22 additions & 2 deletions packages/extension/src/ui/action/views/send-transaction/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<template>
<component v-bind="$props" :is="layout" />
<component
:is="layout"
:account-info="localAccounts"
:network="localNetwork"
/>
</template>

<script setup lang="ts">
Expand All @@ -9,7 +13,9 @@ import SendTransactionBTC from "@/providers/bitcoin/ui/send-transaction/index.vu
import { useRoute } from "vue-router";
import { ProviderName } from "@/types/provider";
import { getNetworkByName } from "@/libs/utils/networks";
import { shallowRef } from "vue";
import { shallowRef, ref, PropType } from "vue";
import { BaseNetwork } from "@/types/base-network";
import { AccountsHeaderData } from "../../types/account";
const sendLayouts: Record<ProviderName, any> = {
[ProviderName.ethereum]: SendTransactionEVM,
Expand All @@ -20,9 +26,23 @@ const sendLayouts: Record<ProviderName, any> = {
const layout = shallowRef();
const route = useRoute();
const localNetwork = ref<BaseNetwork>();
const localAccounts = ref<AccountsHeaderData>();
const props = defineProps({
network: {
type: Object as PropType<BaseNetwork>,
default: () => ({}),
},
accountInfo: {
type: Object as PropType<AccountsHeaderData>,
default: () => ({}),
},
});
const networkName: string = route.params.id as string;
getNetworkByName(networkName).then((network) => {
if (network) {
localNetwork.value = props.network;
localAccounts.value = props.accountInfo;
layout.value = sendLayouts[network.provider];
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,44 @@
class="swap-looking__animation"
/>
<Vue3Lottie
v-else-if="error === SwapError.NETWORK_NOT_SUPPORTED"
v-else-if="
error === SwapError.NETWORK_NOT_SUPPORTED ||
error === SwapError.TEMP_NOT_SUPPORTED
"
:loop="true"
:animation-data="LottieWarning"
class="swap-looking__animation"
/>

<h3 v-if="error !== SwapError.NETWORK_NOT_SUPPORTED">
<h3
v-if="
error !== SwapError.NETWORK_NOT_SUPPORTED &&
error !== SwapError.TEMP_NOT_SUPPORTED
"
>
{{ Errors[error!].title }}
</h3>
<p v-if="error !== SwapError.NETWORK_NOT_SUPPORTED">
<p
v-if="
error !== SwapError.NETWORK_NOT_SUPPORTED &&
error !== SwapError.TEMP_NOT_SUPPORTED
"
>
{{ Errors[error!].description }}
</p>

<h3 v-if="error === SwapError.NETWORK_NOT_SUPPORTED">
Coming soon to<br />{{ networkName }}
</h3>
<p v-if="error === SwapError.NETWORK_NOT_SUPPORTED">
<h3 v-if="error === SwapError.TEMP_NOT_SUPPORTED">
{{ networkName }}<br />is temporarily not supported
</h3>
<p
v-if="
error === SwapError.NETWORK_NOT_SUPPORTED ||
error === SwapError.TEMP_NOT_SUPPORTED
"
>
Can't wait to swap? Try swapping on {{ supportedNets }}.
</p>
</div>
Expand All @@ -57,10 +78,11 @@ interface IProps {
networkName: string;
close: () => void;
}
const prop = defineProps<IProps>();
const supportedNets = getSupportedNetworks()
.map((net) => net.name)
.filter((name) => name !== prop.networkName)
.join(", ");
defineProps<IProps>();
</script>

<style lang="less" scoped>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export enum SwapError {
SOME_TOKENS,
NO_TRADES,
NETWORK_NOT_SUPPORTED,
TEMP_NOT_SUPPORTED,
}

export const Errors: Record<number, ErrorInfo> = {
Expand Down
8 changes: 7 additions & 1 deletion packages/extension/src/ui/action/views/swap/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,11 @@ onMounted(async () => {
toNetworks.value.push(netInfo);
});
toNetworks.value.sort(sortByRank);
if (!thisNetwork!) {
swapError.value = SwapError.TEMP_NOT_SUPPORTED;
toggleSwapError();
return;
}
await initToNetworkInfo(thisNetwork!);
setToTokens();
isLooking.value = false;
Expand Down Expand Up @@ -597,7 +602,8 @@ const toggleLooking = () => {
const toggleSwapError = () => {
showSwapError.value = !showSwapError.value;
if (
swapError.value === SwapError.NETWORK_NOT_SUPPORTED &&
(swapError.value === SwapError.NETWORK_NOT_SUPPORTED ||
swapError.value === SwapError.TEMP_NOT_SUPPORTED) &&
!showSwapError.value
) {
router.go(-1);
Expand Down
20 changes: 10 additions & 10 deletions packages/hw-wallets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"node": ">=14.15.0"
},
"devDependencies": {
"@types/chai": "^4.3.12",
"@types/chai": "^4.3.14",
"@types/mocha": "^10.0.6",
"@types/node": "^20.11.22",
"@types/node": "^20.11.30",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"chai": "^4.4.1",
Expand Down Expand Up @@ -48,16 +48,16 @@
"@enkryptcom/types": "workspace:^",
"@enkryptcom/utils": "workspace:^",
"@ethereumjs/rlp": "^5.0.2",
"@ethereumjs/tx": "^5.2.1",
"@ethereumjs/util": "^9.0.2",
"@ledgerhq/hw-app-eth": "^6.35.6",
"@ledgerhq/hw-transport": "^6.30.4",
"@ledgerhq/hw-transport-webusb": "^6.28.4",
"@ethereumjs/tx": "^5.3.0",
"@ethereumjs/util": "^9.0.3",
"@ledgerhq/hw-app-eth": "^6.35.7",
"@ledgerhq/hw-transport": "^6.30.5",
"@ledgerhq/hw-transport-webusb": "^6.28.5",
"@ledgerhq/live-common": "^33.6.1",
"@polkadot/types": "^10.11.3",
"@polkadot/types": "^10.12.4",
"@polkadot/util": "^12.6.2",
"@trezor/connect-web": "^9.1.12",
"@zondax/ledger-substrate": "^0.41.3",
"@trezor/connect-web": "^9.2.1",
"@zondax/ledger-substrate": "^0.41.4",
"hdkey": "^2.1.0",
"webextension-polyfill": "^0.10.0"
}
Expand Down
4 changes: 4 additions & 0 deletions packages/hw-wallets/src/ledger/ethereum/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ const supportedPaths = {
bip44Paths.ethereumLedger,
bip44Paths.ethereumLedgerLive,
],
[NetworkNames.Avalanche]: [
bip44Paths.ethereumLedger,
bip44Paths.ethereumLedgerLive,
],
[NetworkNames.Goerli]: [bip44Paths.ethereumTestnetLedger],
};
export { supportedPaths };
Loading

1 comment on commit 4625097

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