-
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 #185 from enkryptcom/release/v1.7.0
Release/v1.7.0
- Loading branch information
Showing
76 changed files
with
769 additions
and
179 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
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
28 changes: 28 additions & 0 deletions
28
packages/extension/src/providers/ethereum/libs/tx-broadcaster.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,28 @@ | ||
import { NetworkNames } from "@enkryptcom/types"; | ||
import { v4 } from "uuid"; | ||
|
||
const broadcastTx = (hexTx: string, network: NetworkNames): Promise<string> => { | ||
if (network === NetworkNames.Ethereum) { | ||
const burl = "https://broadcast.mewapi.io/eth?product=enkrypt"; | ||
return fetch(burl, { | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
body: JSON.stringify({ | ||
jsonrpc: "2.0", | ||
method: "eth_sendRawTransaction", | ||
params: [hexTx], | ||
id: v4(), | ||
}), | ||
}) | ||
.then((response) => response.json()) | ||
.then((jRes) => { | ||
if (jRes.error) return Promise.reject(jRes.error); | ||
else return jRes.result as string; | ||
}); | ||
} | ||
return Promise.reject("Not valid network"); | ||
}; | ||
|
||
export default broadcastTx; |
25 changes: 25 additions & 0 deletions
25
packages/extension/src/providers/ethereum/methods/eth_sendRawTransaction.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,25 @@ | ||
import { getCustomError } from "@/libs/error"; | ||
import { MiddlewareFunction } from "@enkryptcom/types"; | ||
import EthereumProvider from ".."; | ||
import broadcastTx from "../libs/tx-broadcaster"; | ||
const method: MiddlewareFunction = function ( | ||
this: EthereumProvider, | ||
payload, | ||
res, | ||
next | ||
): void { | ||
if (payload.method !== "eth_sendRawTransaction") return next(); | ||
else { | ||
if (!payload.params || payload.params.length < 1) { | ||
return res( | ||
getCustomError("eth_sendTransaction: invalid request not enough params") | ||
); | ||
} | ||
broadcastTx(payload.params[0], this.network.name) | ||
.then((hash) => { | ||
res(null, hash); | ||
}) | ||
.catch(() => next()); | ||
} | ||
}; | ||
export default method; |
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
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
26 changes: 26 additions & 0 deletions
26
packages/extension/src/providers/ethereum/networks/canto.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,26 @@ | ||
import wrapActivityHandler from "@/libs/activity-state/wrap-activity-handler"; | ||
import { CoingeckoPlatform, NetworkNames } from "@enkryptcom/types"; | ||
import { EtherscanActivity } from "../libs/activity-handlers"; | ||
import { EvmNetwork, EvmNetworkOptions } from "../types/evm-network"; | ||
|
||
const cantoOptions: EvmNetworkOptions = { | ||
name: NetworkNames.Canto, | ||
name_long: "Canto", | ||
homePage: "https://canto.io/", | ||
blockExplorerTX: "https://evm.explorer.canto.io/tx/[[txHash]]", | ||
blockExplorerAddr: "https://evm.explorer.canto.io/address/[[address]]", | ||
chainID: "0x1e14", | ||
isTestNetwork: false, | ||
currencyName: "CANTO", | ||
currencyNameLong: "Canto", | ||
node: "https://canto.evm.chandrastation.com/", | ||
icon: require("./icons/canto.svg"), | ||
gradient: "linear-gradient(180deg, #C549FF 0%, #684CFF 100%)", | ||
coingeckoID: "canto", | ||
coingeckoPlatform: CoingeckoPlatform.Canto, | ||
activityHandler: wrapActivityHandler(EtherscanActivity), | ||
}; | ||
|
||
const canto = new EvmNetwork(cantoOptions); | ||
|
||
export default canto; |
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
4 changes: 4 additions & 0 deletions
4
packages/extension/src/providers/ethereum/networks/icons/canto.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
packages/extension/src/providers/ethereum/networks/icons/op.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
Oops, something went wrong.
38d9a3d
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/524e61d4b6d386cca50324febfcbaca5d9069d4d86ce5846686ac02d2d568273
firefox:
https://www.virustotal.com/gui/file/70c921d9a641804fee22236de7bfcabe05e339c86d3e9c674db509aad92f8121