update
This commit is contained in:
parent
0f3716c9d2
commit
4636ecd866
|
@ -0,0 +1,2 @@
|
|||
node_modules
|
||||
src/config.json
|
11
README.md
11
README.md
|
@ -1,7 +1,4 @@
|
|||
# wallet
|
||||
|
||||
Blockchain wallet, support list:
|
||||
ETH
|
||||
ERC20
|
||||
TRON
|
||||
TRC20
|
||||
# start
|
||||
```
|
||||
npm run start --${port} // default: 12345
|
||||
```
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"name": "payment",
|
||||
"version": "1.0.0",
|
||||
"description": "Blockchain wallet, support list:\r ETH \r ERC20 \r TRON \r TRC20",
|
||||
"main": "app.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "node app"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://47.129.22.53:22345/lizixuan/wallet.git"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"abi-decoder": "^2.4.0",
|
||||
"axios": "^1.11.0",
|
||||
"express": "^5.1.0",
|
||||
"web3": "^4.16.0"
|
||||
}
|
||||
}
|
|
@ -19,7 +19,8 @@ function loadConfig() {
|
|||
class App {
|
||||
constructor(){
|
||||
const config = loadConfig();
|
||||
this.ethNodeUrl = config.nodesUrl.ETH
|
||||
this.ethNodeUrl = config.nodesUrl.ETH.url
|
||||
this.ETH_API_KEY = config.nodesUrl.ETH.key
|
||||
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"));
|
||||
|
|
|
@ -4,7 +4,7 @@ const Web3 = require("web3");
|
|||
const axios = require("axios");
|
||||
|
||||
class ETH {
|
||||
#key = "2KKTKZ8MSG6DNUPQ4K9JVWPQ4H33DSUQA3"
|
||||
#key = ""
|
||||
constructor(){
|
||||
const apiUrl = app.ethNodeUrl
|
||||
const usdt_abi = app.abis.usdterc20_abi;
|
||||
|
@ -13,6 +13,7 @@ class ETH {
|
|||
abiDecoder.addABI(usdt_abi);
|
||||
abiDecoder.addABI(usdc_abi);
|
||||
this.decoder = abiDecoder;
|
||||
this.#key = app.ETH_API_KEY
|
||||
}
|
||||
|
||||
decodeInput(input){
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
{
|
||||
"nodesUrl": {
|
||||
"ETH": "https://api.etherscan.io/v2/api"
|
||||
"ETH": {
|
||||
"url":"https://api.etherscan.io/v2/api",
|
||||
"key":"2KKTKZ8MSG6DNUPQ4K9JVWPQ4H33DSUQA3"
|
||||
}
|
||||
},
|
||||
"abiPath": {
|
||||
"usdt_erc20_abi": "./abi/erc20usdt.json",
|
||||
|
|
1
wallet
1
wallet
|
@ -1 +0,0 @@
|
|||
Subproject commit 94bd816ecb424138d5fcf99f568505ec9d466d08
|
Loading…
Reference in New Issue