Skip to content

Commit

Permalink
devop: merge
Browse files Browse the repository at this point in the history
  • Loading branch information
kvhnuke committed Jul 31, 2024
2 parents ea979a0 + 02cba1e commit 2d94264
Show file tree
Hide file tree
Showing 42 changed files with 1,966 additions and 1,481 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@swc/core": "^1.6.3",
"@swc/core": "^1.7.3",
"concurrently": "^8.2.2",
"husky": "^9.0.11",
"husky": "^9.1.4",
"node-notifier": "^10.0.1",
"nodemon": "^3.1.3",
"nodemon": "^3.1.4",
"ultra-runner": "^3.10.5"
},
"resolutions": {
Expand Down
8 changes: 4 additions & 4 deletions packages/extension-bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
},
"devDependencies": {
"@types/chai": "^4.3.16",
"@types/mocha": "^10.0.6",
"@types/node": "^20.14.6",
"@types/mocha": "^10.0.7",
"@types/node": "^20.14.13",
"@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": "^8.1.0",
"type-fest": "^4.20.1",
"tsup": "^8.2.3",
"type-fest": "^4.23.0",
"typescript": "^4.9.5",
"typescript-eslint": "0.0.1-alpha.0"
}
Expand Down
5 changes: 4 additions & 1 deletion packages/extension-bridge/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ export const getBackgroundPageType = (): RuntimeContext => {
const url = new URL(browser.runtime.getURL(manifest.options_ui.page));
if (url.pathname === window.location.pathname) return "options";
}
if (window?.location?.pathname === "/index.html") {
if (
window?.location?.pathname === "/index.html" ||
window?.location?.pathname === "/onboard.html"
) {
return "new-window";
}
return "background";
Expand Down
62 changes: 31 additions & 31 deletions packages/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@enkryptcom/extension",
"version": "1.41.0",
"version": "1.42.0",
"private": true,
"scripts": {
"zip": "cd dist; zip -r release.zip *;",
Expand All @@ -21,8 +21,8 @@
"watch-vue-firefox": "cross-env BROWSER='firefox' vue-cli-service build --watch --no-clean"
},
"dependencies": {
"@amplitude/analytics-browser": "^2.9.0",
"@babel/runtime": "^7.24.7",
"@amplitude/analytics-browser": "^2.9.3",
"@babel/runtime": "^7.25.0",
"@enkryptcom/extension-bridge": "workspace:^",
"@enkryptcom/hw-wallets": "workspace:^",
"@enkryptcom/keyring": "workspace:^",
Expand All @@ -34,26 +34,26 @@
"@ethereumjs/common": "^4.3.0",
"@ethereumjs/tx": "^5.3.0",
"@ethereumjs/util": "^9.0.3",
"@kadena/client": "^1.12.0",
"@ledgerhq/hw-transport-webusb": "^6.29.0",
"@metamask/eth-sig-util": "^7.0.2",
"@kadena/client": "^1.13.0",
"@ledgerhq/hw-transport-webusb": "^6.29.2",
"@metamask/eth-sig-util": "^7.0.3",
"@rollup/plugin-replace": "^5.0.7",
"@types/chrome": "^0.0.268",
"@types/chrome": "^0.0.269",
"@types/events": "^3.0.3",
"@types/less": "^3.0.6",
"@types/lodash": "^4.17.5",
"@types/lodash": "^4.17.7",
"@types/utf-8-validate": "^5.0.2",
"@vueuse/core": "^10.11.0",
"add": "^2.0.6",
"bignumber.js": "^9.1.2",
"bip39": "^3.1.0",
"bitcoinjs-lib": "^6.1.6",
"bs58": "^6.0.0",
"chai": "^4.4.1",
"chai": "^4.5.0",
"concurrently": "^8.2.2",
"core-js": "^3.37.1",
"echarts": "^5.5.0",
"ethereum-cryptography": "^2.2.0",
"echarts": "^5.5.1",
"ethereum-cryptography": "^2.2.1",
"ethereumjs-abi": "^0.6.8",
"ethereumjs-wallet": "^1.0.2",
"eventemitter3": "^5.0.1",
Expand All @@ -62,14 +62,14 @@
"moment": "^2.30.1",
"nanoevents": "^9.0.0",
"pact-lang-api": "^4.3.6",
"pinia": "^2.1.7",
"pinia": "^2.2.0",
"qrcode.vue": "^3.4.1",
"switch-ts": "^1.1.1",
"url-parse": "^1.5.10",
"uuid": "^10.0.0",
"vue": "^3.4.29",
"vue-echarts": "6.7.3",
"vue-router": "4.3.3",
"vue": "^3.4.34",
"vue-echarts": "7.0.0-beta.0",
"vue-router": "4.4.0",
"vue3-lottie": "^3.3.0",
"vuedraggable": "^4.1.0",
"web3-eth": "^1.10.4",
Expand All @@ -79,25 +79,25 @@
},
"devDependencies": {
"@babel/plugin-transform-class-static-block": "^7.24.7",
"@kadena/pactjs-cli": "^1.12.0",
"@polkadot/api": "^11.3.1",
"@polkadot/extension-inject": "^0.47.6",
"@polkadot/keyring": "^12.6.2",
"@polkadot/rpc-provider": "^11.3.1",
"@polkadot/types": "^11.3.1",
"@polkadot/types-known": "^11.3.1",
"@polkadot/ui-shared": "^3.6.6",
"@polkadot/util": "^12.6.2",
"@kadena/pactjs-cli": "^1.13.0",
"@polkadot/api": "^12.2.3",
"@polkadot/extension-inject": "^0.50.1",
"@polkadot/keyring": "^13.0.2",
"@polkadot/rpc-provider": "^12.2.3",
"@polkadot/types": "^12.2.3",
"@polkadot/types-known": "^12.2.3",
"@polkadot/ui-shared": "^3.8.2",
"@polkadot/util": "^13.0.2",
"@polkadot/wasm-crypto": "^7.3.2",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-inject": "^5.0.5",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"@types/bs58": "^4.0.4",
"@types/ethereumjs-abi": "^0.6.5",
"@types/mocha": "^10.0.6",
"@types/mocha": "^10.0.7",
"@types/url-parse": "^1.4.11",
"@types/uuid": "^9.0.8",
"@types/uuid": "^10.0.0",
"@types/wif": "^2.0.5",
"@types/zxcvbn": "^4.4.4",
"@typescript-eslint/eslint-plugin": "^5.62.0",
Expand All @@ -117,20 +117,20 @@
"https-browserify": "^1.0.0",
"less": "^4.2.0",
"less-loader": "^12.2.0",
"mocha": "^10.4.0",
"mocha": "^10.7.0",
"path-browserify": "^1.0.1",
"prettier": "^2.8.8",
"rimraf": "^5.0.7",
"rollup": "^4.18.0",
"rimraf": "^6.0.1",
"rollup": "^4.19.1",
"rollup-plugin-uglify": "^6.0.4",
"semver": "^7.6.2",
"semver": "^7.6.3",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"systeminformation": "^5.22.11",
"ts-mocha": "^10.0.0",
"tsconfig-paths": "^4.2.0",
"typescript": "^4.9.5",
"url": "^0.11.3",
"url": "^0.11.4",
"webextension-polyfill": "^0.12.0"
},
"installConfig": {
Expand Down
10 changes: 6 additions & 4 deletions packages/extension/src/providers/common/libs/new-features.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { NetworkNames } from "@enkryptcom/types";

const newNetworks = [
NetworkNames.Kadena,
NetworkNames.Rollux,
NetworkNames.Syscoin,
NetworkNames.Telos,
NetworkNames.Blast,
NetworkNames.Sanko,
NetworkNames.Degen,
NetworkNames.Ham,
];
const newSwaps = [NetworkNames.MaticZK, NetworkNames.Base];
const newSwaps: NetworkNames[] = [];

export { newNetworks, newSwaps };
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import EtherscanActivity from "./providers/etherscan";
import OkcActivity from "./providers/okc";
import TomoScan from "./providers/tomoscan";
import OntEVMActivity from "./providers/ont-evm";
import TelosActivity from "./providers/telos";
export {
RivetActivity,
EtherscanActivity,
OkcActivity,
OntEVMActivity,
TomoScan,
TelosActivity,
};
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { NetworkNames } from "@enkryptcom/types";

const NetworkEndpoints: Record<string, string> = {
[NetworkNames.Ethereum]: "https://api.etherscan.io/",
[NetworkNames.Ethereum]: "https://eth.blockscout.com/",
[NetworkNames.Binance]: "https://api.bscscan.com/",
[NetworkNames.Matic]: "https://api.polygonscan.com/",
[NetworkNames.Matic]: "https://polygon.blockscout.com/",
[NetworkNames.Moonbeam]: "https://api-moonbeam.moonscan.io/",
[NetworkNames.Moonriver]: "https://api-moonriver.moonscan.io/",
[NetworkNames.KaruraEVM]: "https://blockscout.karura.network/",
Expand All @@ -13,6 +13,7 @@ const NetworkEndpoints: Record<string, string> = {
[NetworkNames.Canto]: "https://evm.explorer.canto.io/",
[NetworkNames.EdgeEVM]: "https://edgscan.live/",
[NetworkNames.Rootstock]: "https://blockscout.com/rsk/mainnet/",
[NetworkNames.RootstockTestnet]: "https://rootstock-testnet.blockscout.com/",
[NetworkNames.SkaleBlockBrawlers]:
"https://frayed-decent-antares.explorer.mainnet.skalenodes.com/",
[NetworkNames.SkaleCalypso]:
Expand Down Expand Up @@ -53,6 +54,10 @@ const NetworkEndpoints: Record<string, string> = {
[NetworkNames.Syscoin]: "https://explorer.syscoin.org/",
[NetworkNames.RolluxTest]: "https://rollux.tanenbaum.io/",
[NetworkNames.Rollux]: "https://explorer.rollux.com/",
[NetworkNames.Blast]: "https://blastscan.io/",
[NetworkNames.Sanko]: "https://explorer.sanko.xyz/",
[NetworkNames.Degen]: "https://explorer.degen.tips/",
[NetworkNames.Ham]: "https://explorer.ham.fun/",
};

export { NetworkEndpoints };
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const getAddressActivity = async (
).then((res) => {
if (res.status === "0") return [];
const results = res.result as EtherscanTxType[];
const newResults = results.reverse().map((tx) => {
const newResults = results.map((tx) => {
const rawTx: EthereumRawInfo = {
blockHash: tx.blockHash,
blockNumber: numberToHex(tx.blockNumber),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { NetworkNames } from "@enkryptcom/types";

const NetworkEndpoints: Record<string, string> = {
[NetworkNames.Telos]: "https://api.teloscan.io/",
};

export { NetworkEndpoints };
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import cacheFetch from "@/libs/cache-fetch";
import { EvmNetwork } from "@/providers/ethereum/types/evm-network";
import {
Activity,
ActivityStatus,
ActivityType,
EthereumRawInfo,
} from "@/types/activity";
import { BaseNetwork } from "@/types/base-network";
import { numberToHex } from "web3-utils";
import { decodeTx } from "../../../transaction/decoder";
import { NetworkEndpoints } from "./configs";
import { TelosTXType } from "./types";
const TTL = 30000;
const getAddressActivity = async (
address: string,
endpoint: string
): Promise<EthereumRawInfo[]> => {
return cacheFetch(
{
url: `${endpoint}v1/address/${address}/transactions`,
},
TTL
).then((res) => {
if (!res.success) return [];
const results = res.results as TelosTXType[];
const newResults = results.map((tx) => {
const rawTx: EthereumRawInfo = {
blockHash: "0x",
blockNumber: numberToHex(tx.blockNumber),
contractAddress: tx.contractAddress
? tx.contractAddress.toLowerCase()
: null,
data: tx.input,
effectiveGasPrice: tx.gasPrice,
from: tx.from.toLowerCase(),
to: tx.to === "" ? null : tx.to.toLowerCase(),
gas: tx.gasLimit,
gasUsed: tx.gasused,
nonce: numberToHex(tx.nonce),
status: tx.status === "0x1" ? true : false,
transactionHash: tx.hash,
value: tx.value,
timestamp: tx.timestamp,
};
return rawTx;
});
return newResults.slice(0, 50) as EthereumRawInfo[];
});
};
export default async (
network: BaseNetwork,
address: string
): Promise<Activity[]> => {
address = address.toLowerCase();
const enpoint =
NetworkEndpoints[network.name as keyof typeof NetworkEndpoints];
const activities = await getAddressActivity(address, enpoint);
const Promises = activities.map((activity) => {
return decodeTx(activity, network as EvmNetwork).then((txData) => {
return {
from: activity.from,
to: activity.contractAddress
? activity.contractAddress
: txData.tokenTo!,
isIncoming: activity.from !== address,
network: network.name,
rawInfo: activity,
status: activity.status
? ActivityStatus.success
: ActivityStatus.failed,
timestamp: activity.timestamp ? activity.timestamp : 0,
value: txData.tokenValue,
transactionHash: activity.transactionHash,
type: ActivityType.transaction,
nonce: activity.nonce,
token: {
decimals: txData.tokenDecimals,
icon: txData.tokenImage,
name: txData.tokenName,
symbol: txData.tokenSymbol,
price: txData.currentPriceUSD.toString(),
},
};
});
});
return Promise.all(Promises);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export interface TelosTXType {
gasused: string;
contractAddress: string;
index: number;
nonce: number;
input: string;
gasLimit: string;
blockNumber: number;
from: string;
to: string;
value: string;
hash: string;
timestamp: number;
gasPrice: string;
status: "0x1" | "0x0";
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,22 @@ const supportedNetworks: Record<SupportedNetworkNames, SupportedNetwork> = {
tbName: "rollux",
cgPlatform: CoingeckoPlatform.Rollux,
},
[NetworkNames.Telos]: {
tbName: "tlos",
cgPlatform: CoingeckoPlatform.Telos,
},
[NetworkNames.Blast]: {
tbName: "blast",
cgPlatform: CoingeckoPlatform.Blast,
},
[NetworkNames.Sanko]: {
tbName: "sanko",
cgPlatform: CoingeckoPlatform.Sanko,
},
[NetworkNames.Degen]: {
tbName: "degen",
cgPlatform: CoingeckoPlatform.Degen,
},
};

const getTokens = (
Expand Down
Loading

0 comments on commit 2d94264

Please sign in to comment.