symbol eth payment checked

This commit is contained in:
lzx
2025-08-07 18:53:50 +08:00
parent 94bd816ecb
commit 0f3716c9d2
8 changed files with 2002 additions and 0 deletions

32
src/app.js Normal file
View File

@@ -0,0 +1,32 @@
const fs = require("fs")
function loadConfig() {
const configPath = "./config.json";
if (!fs.existsSync(configPath)) {
throw new Error("Configuration file not found: " + configPath);
}
const configContent = fs.readFileSync(configPath, "utf-8");
if (!configContent) {
throw new Error("Configuration file is empty: " + configPath);
}
try {
return JSON.parse(configContent);
} catch (error) {
throw new Error("Error parsing configuration file: " + error.message);
}
}
class App {
constructor(){
const config = loadConfig();
this.ethNodeUrl = config.nodesUrl.ETH
const usdterc20_abi = JSON.parse(fs.readFileSync(config.abiPath.usdt_erc20_abi, "utf-8"));
const usdcerc20_abi = JSON.parse(fs.readFileSync(config.abiPath.usdc_erc20_abi, "utf-8"));
const usdttrc20_abi = JSON.parse(fs.readFileSync(config.abiPath.usdt_trc20_abi, "utf-8"));
this.abis = {usdcerc20_abi, usdterc20_abi, usdttrc20_abi};
}
}
const app = new App();
module.exports = app;