Requires completely removed from Platform codebase

This commit is contained in:
Luis Fernando Molina committed 2021-09-16 10:10:13 +02:00
1 parent d2811cc422
commit 2ec676defb
4 files changed
+11 -7

No files matched your search

+2 -2
View File
@@ -75,7 +75,7 @@ exports.newGithubServer = function newGithubServer() {
async function doGithub() {
const { Octokit } = require("@octokit/rest")
const { Octokit } = SA.nodeModules.octokit
const octokit = new Octokit({
auth: token,
@@ -204,7 +204,7 @@ exports.newGithubServer = function newGithubServer() {
try {
const repo = repository
const owner = 'Superalgos'
const { Octokit } = require("@octokit/rest")
const { Octokit } = SA.nodeModules.octokit
const octokit = new Octokit({
auth: token,
userAgent: 'Superalgos Beta 11'
+4 -4
View File
@@ -15,7 +15,7 @@ exports.newWeb3Server = function newWeb3Server() {
run: run
}
const Web3 = require('web3');
const Web3 = SA.nodeModules.web3
let web3Map = new Map()
return thisObject
@@ -241,7 +241,7 @@ exports.newWeb3Server = function newWeb3Server() {
async function mnemonicToPrivateKey(mnemonic) {
try {
const ethers = require('ethers')
const ethers = SA.nodeModules.ethers
let wallet = ethers.Wallet.fromMnemonic(mnemonic)
if (wallet.privateKey !== undefined) {
@@ -288,14 +288,14 @@ exports.newWeb3Server = function newWeb3Server() {
console.log('---------------------------------------------------------------------------------------------------------------------------------------------------')
console.log('')
const Tx = require('ethereumjs-tx').Transaction;
const Tx = SA.nodeModules.ethereumjsTx.Transaction;
const web3 = new Web3(new Web3.providers.HttpProvider('https://bsc-dataseed.binance.org/'))
const amount = web3.utils.toHex(tokenAmount)
privateKey = privateKey.replace('0x', '')
const privateKeyBuffer = Buffer.from(privateKey, 'hex')
const contractAbiObject = JSON.parse(contractAbi)
const contract = new web3.eth.Contract(contractAbiObject, contractAddress, { from: fromAddress })
const Common = require('ethereumjs-common').default
const Common = SA.nodeModules.ethereumjsCommon.default
const BSC_FORK = Common.forCustomChain(
'mainnet',
{
+1 -1
View File
@@ -7,7 +7,7 @@
finalize: finalize
}
const WEB_SOCKET = require('ws')
const WEB_SOCKET = SA.nodeModules.ws
let socketServer
let port = global.env.CLIENT_WEB_SOCKETS_INTERFACE_PORT
+4
View File
@@ -35,6 +35,10 @@ Setting up external dependencies.
*/
SA.nodeModules = {
fs: require('fs'),
web3: require('web3'),
ethers: require('ethers'),
ethereumjsTx: require('ethereumjs-tx'),
ethereumjsCommon: require('ethereumjs-common'),
nodeFetch: require('node-fetch'),
open: require('open'),
http: require('http'),