-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #470 from enkryptcom/devop/prep-release
devop: prep release
- Loading branch information
Showing
29 changed files
with
424 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
packages/extension/src/providers/common/libs/new-features.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/extension/src/providers/ethereum/libs/activity-handlers/providers/telos/configs.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }; |
88 changes: 88 additions & 0 deletions
88
packages/extension/src/providers/ethereum/libs/activity-handlers/providers/telos/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}; |
16 changes: 16 additions & 0 deletions
16
packages/extension/src/providers/ethereum/libs/activity-handlers/providers/telos/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
packages/extension/src/providers/ethereum/networks/blast.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { CoingeckoPlatform, NetworkNames } from "@enkryptcom/types"; | ||
import { EvmNetwork, EvmNetworkOptions } from "../types/evm-network"; | ||
import assetsInfoHandler from "@/providers/ethereum/libs/assets-handlers/assetinfo-mew"; | ||
import { EtherscanActivity } from "../libs/activity-handlers"; | ||
import wrapActivityHandler from "@/libs/activity-state/wrap-activity-handler"; | ||
|
||
const ethOptions: EvmNetworkOptions = { | ||
name: NetworkNames.Blast, | ||
name_long: "Blast", | ||
homePage: "https://blast.io/en", | ||
blockExplorerTX: "https://blastscan.io/tx/[[txHash]]", | ||
blockExplorerAddr: "https://blastscan.io/address/[[address]]", | ||
chainID: "0x13e31", | ||
isTestNetwork: false, | ||
currencyName: "ETH", | ||
currencyNameLong: "Ethereum", | ||
node: "wss://blast-rpc.publicnode.com", | ||
icon: require("./icons/blast.webp"), | ||
coingeckoID: "ethereum", | ||
coingeckoPlatform: CoingeckoPlatform.Blast, | ||
assetsInfoHandler, | ||
activityHandler: wrapActivityHandler(EtherscanActivity), | ||
}; | ||
|
||
const eth = new EvmNetwork(ethOptions); | ||
|
||
export default eth; |
27 changes: 27 additions & 0 deletions
27
packages/extension/src/providers/ethereum/networks/degen.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { CoingeckoPlatform, NetworkNames } from "@enkryptcom/types"; | ||
import { EvmNetwork, EvmNetworkOptions } from "../types/evm-network"; | ||
import assetsInfoHandler from "@/providers/ethereum/libs/assets-handlers/assetinfo-mew"; | ||
import { EtherscanActivity } from "../libs/activity-handlers"; | ||
import wrapActivityHandler from "@/libs/activity-state/wrap-activity-handler"; | ||
|
||
const ethOptions: EvmNetworkOptions = { | ||
name: NetworkNames.Degen, | ||
name_long: "Degen", | ||
homePage: "https://www.degen.tips/", | ||
blockExplorerTX: "https://explorer.degen.tips/tx/[[txHash]]", | ||
blockExplorerAddr: "https://explorer.degen.tips/address/[[address]]", | ||
chainID: "0x27bc86aa", | ||
isTestNetwork: false, | ||
currencyName: "DEGEN", | ||
currencyNameLong: "DEGEN", | ||
node: "https://rpc.degen.tips", | ||
icon: require("./icons/degen.png"), | ||
coingeckoID: "degen-base", | ||
coingeckoPlatform: CoingeckoPlatform.Degen, | ||
assetsInfoHandler, | ||
activityHandler: wrapActivityHandler(EtherscanActivity), | ||
}; | ||
|
||
const eth = new EvmNetwork(ethOptions); | ||
|
||
export default eth; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { CoingeckoPlatform, NetworkNames } from "@enkryptcom/types"; | ||
import { EvmNetwork, EvmNetworkOptions } from "../types/evm-network"; | ||
import assetsInfoHandler from "@/providers/ethereum/libs/assets-handlers/assetinfo-mew"; | ||
import { EtherscanActivity } from "../libs/activity-handlers"; | ||
import wrapActivityHandler from "@/libs/activity-state/wrap-activity-handler"; | ||
|
||
const ethOptions: EvmNetworkOptions = { | ||
name: NetworkNames.Sanko, | ||
name_long: "Sanko", | ||
homePage: "https://sanko.xyz", | ||
blockExplorerTX: "https://explorer.sanko.xyz/tx/[[txHash]]", | ||
blockExplorerAddr: "https://explorer.sanko.xyz/address/[[address]]", | ||
chainID: "0x7cc", | ||
isTestNetwork: false, | ||
currencyName: "DMT", | ||
currencyNameLong: "DMT", | ||
node: "https://mainnet.sanko.xyz", | ||
icon: require("./icons/sanko.png"), | ||
coingeckoID: "dream-machine-token", | ||
coingeckoPlatform: CoingeckoPlatform.Sanko, | ||
assetsInfoHandler, | ||
activityHandler: wrapActivityHandler(EtherscanActivity), | ||
}; | ||
|
||
const eth = new EvmNetwork(ethOptions); | ||
|
||
export default eth; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
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 ethOptions: EvmNetworkOptions = { | ||
name: NetworkNames.Ham, | ||
name_long: "Ham Chain", | ||
homePage: "https://ham.fun/", | ||
blockExplorerTX: "https://explorer.ham.fun/tx/[[txHash]]", | ||
blockExplorerAddr: "https://explorer.ham.fun/address/[[address]]", | ||
chainID: "0x13f8", | ||
isTestNetwork: false, | ||
currencyName: "ETH", | ||
currencyNameLong: "Ethereum", | ||
node: "https://rpc.ham.fun", | ||
icon: require("./icons/ham.png"), | ||
coingeckoID: "ethereum", | ||
activityHandler: wrapActivityHandler(EtherscanActivity), | ||
}; | ||
|
||
const eth = new EvmNetwork(ethOptions); | ||
|
||
export default eth; |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
8c76488
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Virus total analysis
chrome:
https://www.virustotal.com/gui/file/82aea71fb55e06c6f991a5fdcc600b5b5b8a6fb889c9338178fe4c844a1a4338
firefox:
https://www.virustotal.com/gui/file/be67f4bca17af972654b38ffb0cd5a35f6274eae76dab829decf3210b5c7df28
8c76488
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Virus total analysis
chrome:
https://www.virustotal.com/gui/file/327299fd2a014b6ee5bb54ec6ed35dec4c655ad4cdac962fd5004fb0b99c1570
firefox:
https://www.virustotal.com/gui/file/ca99d8cf6f06880f5d5bb4c4102589b9f24208307c3ebafabfefd0c767efb68b