Skip to content

Commit

Permalink
Merge branch 'main' into feat/safari-support
Browse files Browse the repository at this point in the history
  • Loading branch information
kvhnuke committed Jan 11, 2024
2 parents 07b7f0f + 500fd27 commit 7188794
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 19 deletions.
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
2 changes: 1 addition & 1 deletion packages/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@enkryptcom/extension",
"version": "1.30.0",
"version": "1.31.0",
"private": true,
"scripts": {
"zip": "cd dist; zip -r release.zip *;",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ 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.ArtheraTest]: "https://explorer-test.arthera.net/",
[NetworkNames.Arthera]: "https://explorer.arthera.net/",
};

export { NetworkEndpoints };
10 changes: 5 additions & 5 deletions packages/extension/src/providers/ethereum/networks/aa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ const artheraOptions: EvmNetworkOptions = {
name: NetworkNames.Arthera,
name_long: "Arthera",
homePage: "https://arthera.net/",
blockExplorerTX: "https://explorer-test.arthera.net/tx/[[txHash]]",
blockExplorerAddr: "https://explorer-test.arthera.net/address/[[address]]",
chainID: "0x2803",
isTestNetwork: true,
blockExplorerTX: "https://explorer.arthera.net/tx/[[txHash]]",
blockExplorerAddr: "https://explorer.arthera.net/address/[[address]]",
chainID: "0x2802",
isTestNetwork: false,
currencyName: "AA",
currencyNameLong: "Arthera",
node: "wss://ws-test.arthera.net",
node: "https://rpc.arthera.net",
icon: require("./icons/aa.svg"),
activityHandler: wrapActivityHandler(EtherscanActivity),
};
Expand Down
23 changes: 23 additions & 0 deletions packages/extension/src/providers/ethereum/networks/aat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { NetworkNames } from "@enkryptcom/types";
import { EvmNetwork, EvmNetworkOptions } from "../types/evm-network";
import { EtherscanActivity } from "../libs/activity-handlers";
import wrapActivityHandler from "@/libs/activity-state/wrap-activity-handler";

const artheraTestOptions: EvmNetworkOptions = {
name: NetworkNames.ArtheraTest,
name_long: "Arthera Test",
homePage: "https://arthera.net/",
blockExplorerTX: "https://explorer-test.arthera.net/tx/[[txHash]]",
blockExplorerAddr: "https://explorer-test.arthera.net/address/[[address]]",
chainID: "0x2803",
isTestNetwork: true,
currencyName: "AA",
currencyNameLong: "Arthera",
node: "wss://ws-test.arthera.net",
icon: require("./icons/aa.svg"),
activityHandler: wrapActivityHandler(EtherscanActivity),
};

const artheraTest = new EvmNetwork(artheraTestOptions);

export default artheraTest;
2 changes: 2 additions & 0 deletions packages/extension/src/providers/ethereum/networks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import baseNode from "./base";
import celoNode from "./celo";
import shibNode from "./shib";
import artheraNode from "./aa";
import artheraTestNode from "./aat";

export default {
goerli: goerliNode,
Expand Down Expand Up @@ -75,4 +76,5 @@ export default {
celo: celoNode,
shib: shibNode,
arthera: artheraNode,
artheraTest: artheraTestNode,
};
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const method: MiddlewareFunction = function (
if (!payload.params?.length)
return res(getCustomError("Missing Params: signer_signPayload"));
const reqPayload = payload.params[0] as SignerPayloadRaw;
if (reqPayload.type !== "bytes")
if (reqPayload.type !== "bytes" && reqPayload.type !== "payload")
return res(getCustomError("type is not bytes: signer_signRaw"));
this.KeyRing.getAccount(polkadotEncodeAddress(reqPayload.address)).then(
(account) => {
Expand Down
1 change: 1 addition & 0 deletions packages/extension/src/ui/action/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<transition :name="transitionName" mode="out-in">
<component
:is="Component"
:key="$route.fullPath"
:network="currentNetwork"
:account-info="accountHeaderData"
@update:init="init"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@ const searchAllNetworks = computed(() => {
a.name_long.toLowerCase().startsWith(searchInput.value.toLowerCase())
);
});
onBeforeMount(async () => {
const setNetworkLists = async (isTestActive: boolean) => {
const allNetworksNotTestNets = (await getAllNetworksAndStatus())
.filter(({ isTestNetwork }) => !isTestNetwork)
.filter(({ isTestNetwork }) => !isTestNetwork || isTestActive)
.sort((a, b) => a.name_long.localeCompare(b.name_long));
const popularNetworks = allNetworksNotTestNets
Expand All @@ -119,16 +120,15 @@ onBeforeMount(async () => {
all.value = allNetworksNotTestNets;
popular.value = popularNetworks;
};
onBeforeMount(async () => {
await setNetworkLists(showTestNets.value);
});
const onTestNetCheck = async () => {
showTestNets.value = !showTestNets.value;
if (showTestNets.value) {
all.value = await getAllNetworksAndStatus();
} else {
all.value = all.value.filter(({ isTestNetwork }) => !isTestNetwork);
}
await setNetworkLists(showTestNets.value);
};
const onToggle = async (networkName: string, isActive: boolean) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ const selected: string = route.params.id as string;
const updateAssets = () => {
isLoading.value = true;
assets.value = [];
const currentNetwork = selectedNetworkName.value;
props.network
.getAllTokenInfo(props.accountInfo.selectedAccount?.address || "")
.then((_assets) => {
if (selectedNetworkName.value !== currentNetwork) return;
assets.value = _assets;
isLoading.value = false;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const sendLayouts: Record<ProviderName, any> = {
[ProviderName.bitcoin]: SendTransactionBTC,
[ProviderName.enkrypt]: null,
};
const layout = shallowRef();
const route = useRoute();
const networkName: string = route.params.id as string;
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export enum NetworkNames {
Celo = "CELO",
Litecoin = "LTC",
Dogecoin = "DOGE",
ArtheraTest = "AATest",
Arthera = "AA",
}

Expand Down

1 comment on commit 7188794

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