-
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 #471 from enkryptcom/develop
Release: v1.42.0
- 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.
a50537a
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/4415d17c8ba556b6a70fba7c4e14415568c7dbf550b55de02add837136243d0b
firefox:
https://www.virustotal.com/gui/file/c78da9944f12bf7435b53f7adab2eed59ec3bf92371a36adcc7a23ceb6be6426
a50537a
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/4bb808356d502a62222b2efa822d2bd09ae213a7bc5a58a19b864318e3d0b2e5
firefox:
https://www.virustotal.com/gui/file/d80db05113e4c05a4f9b4759eba7a46fbd20022f00e6bed6f539f4427927d9db
a50537a
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/e9dad09cd29c38d77bcb0006b4eb3b3c7f7d7261183929b807c95346248432f0
firefox:
https://www.virustotal.com/gui/file/deda9b68aca882c7c06758a702df1a3764a9ac5cfc31d069bcdfcfe5898d76fa