jsir 1.2.7 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cmd/cleanLog.js +1 -1
- package/cmd/configServer.js +1 -2
- package/cmd/dirServer.js +1 -1
- package/cmd/ethDataServer.js +2 -4
- package/cmd/ethPrivateHit.js +1 -1
- package/cmd/mockServer.js +2 -2
- package/cmd/ooa.js +592 -371
- package/cmd/staticServer.js +1 -1
- package/cmd/stop.js +1 -1
- package/ethWeb.js +39 -58
- package/index.js +3 -264
- package/package.json +1 -1
- package/util.js +220 -46
package/cmd/staticServer.js
CHANGED
package/cmd/stop.js
CHANGED
package/ethWeb.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
let {getLibDataDir, trim, toBigNum, getConfig, objDataFile,
|
|
4
|
-
eFn, removeFirst, randomInt, splitArray, sleep, vl, cacheFn, isError, bMin, getOr} = require('./util')
|
|
1
|
+
let {BigNumber, getLibDataDir, trim, toBigNum, getConfig, objDataFile, infoStr, errorStr, batchAsync,
|
|
2
|
+
eFn, removeFirst, randomInt, splitArray, sleep, vl, cacheFn, isError, bMin, getOr, errorStack} = require('./util')
|
|
5
3
|
const abiDecoder = require('abi-decoder');
|
|
6
4
|
let fs = require('fs')
|
|
7
5
|
let contractMapPath = getLibDataDir() + "/contractMap.json"
|
|
@@ -16,6 +14,7 @@ const batchCallAbi = [{"inputs":[{"internalType":"bool","name":"atom","type":"bo
|
|
|
16
14
|
let Web3Contract = require('web3-eth-contract');
|
|
17
15
|
|
|
18
16
|
let batchCallAddressMap = {
|
|
17
|
+
1: '0xf375451681f567bEB7AeAD101F7944C2574718Eb',
|
|
19
18
|
128: '0x0817dC05EAb0A0C8aDBafDbE35883B5e5DD8a299',
|
|
20
19
|
137: '0xa36e94d707ff68629F01f0886c4d790459b90fB4',
|
|
21
20
|
66: '0x5a8138bF21BdCf8424A999069F24f6F7A065F6A0',
|
|
@@ -45,7 +44,7 @@ async function _ethBatchQuery(calls = [], web3) {
|
|
|
45
44
|
try {
|
|
46
45
|
result = itfs[i].decodeFunctionResult(calls[i].name || calls[i].method, data)
|
|
47
46
|
} catch (e) {
|
|
48
|
-
$log(new Error(e
|
|
47
|
+
$log(new Error(errorStack(e)).stack)
|
|
49
48
|
error = e
|
|
50
49
|
}
|
|
51
50
|
pros.push(new Promise(async resolve => {
|
|
@@ -53,7 +52,7 @@ async function _ethBatchQuery(calls = [], web3) {
|
|
|
53
52
|
try {
|
|
54
53
|
await calls[i].callback(error, result)
|
|
55
54
|
} catch (e) {
|
|
56
|
-
$log(new Error(e
|
|
55
|
+
$log(new Error(errorStack(e)).stack)
|
|
57
56
|
resolve(result || error);
|
|
58
57
|
throw e
|
|
59
58
|
}
|
|
@@ -90,7 +89,7 @@ async function ethBatchQuery(calls = [], web3, batchNum = 49, asyncNum = 33, use
|
|
|
90
89
|
for (let call of calls) {
|
|
91
90
|
let item = {
|
|
92
91
|
method: newContract(web3, call.abi, call.address)
|
|
93
|
-
.methods[call.name || call.
|
|
92
|
+
.methods[call.name || call.method](...(call.args || call.params || []))
|
|
94
93
|
.call
|
|
95
94
|
}
|
|
96
95
|
if (call.callback) {
|
|
@@ -119,18 +118,8 @@ async function ethBatchQuery_(calls = [], web3, batchNum, asyncNum) {
|
|
|
119
118
|
}
|
|
120
119
|
if (batchNum) {
|
|
121
120
|
let callBatchs = splitArray(calls, batchNum)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
let pro = _ethBatchQuery(callBatchs[i], web3)
|
|
125
|
-
pros.push(pro)
|
|
126
|
-
|
|
127
|
-
if (asyncNum === 1) {
|
|
128
|
-
await pro;
|
|
129
|
-
} else if (i > 0 && i % asyncNum === 0) {
|
|
130
|
-
await pro;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
return (await Promise.all(pros)).reduce((a,b) => a.concat(b))
|
|
121
|
+
return (await batchAsync(callBatchs.map(item => () => _ethBatchQuery(item, web3)), asyncNum))
|
|
122
|
+
.reduce((a,b) => a.concat(b))
|
|
134
123
|
}
|
|
135
124
|
return _ethBatchQuery(calls, web3)
|
|
136
125
|
}
|
|
@@ -176,7 +165,7 @@ async function erc20Query(address, method, ...args) {
|
|
|
176
165
|
const contract = newContract(web3, erc20Abi, address);
|
|
177
166
|
return await contract.methods[method](...args).call()
|
|
178
167
|
} catch (e) {
|
|
179
|
-
$log(new Error(e
|
|
168
|
+
$log(new Error(errorStack(e)).stack)
|
|
180
169
|
return null;
|
|
181
170
|
}
|
|
182
171
|
}
|
|
@@ -369,7 +358,7 @@ async function sendTxn(privateKey, toAddress, value, contract, method, ...args)
|
|
|
369
358
|
console.info(`发送成功:${signTxn.transactionHash}`)
|
|
370
359
|
} catch (e) {
|
|
371
360
|
console.error(`发送失败:${signTxn.transactionHash}`)
|
|
372
|
-
console.log(e
|
|
361
|
+
console.log(String(e))
|
|
373
362
|
}
|
|
374
363
|
}
|
|
375
364
|
|
|
@@ -385,7 +374,7 @@ function newContract(web3, abi, address) {
|
|
|
385
374
|
if (address) {
|
|
386
375
|
address = address.toLowerCase()
|
|
387
376
|
}
|
|
388
|
-
let key = [JSON.stringify(abi), address].filter(i => i).join("-")
|
|
377
|
+
let key = [String(chainId), JSON.stringify(abi), address].filter(i => i).join("-")
|
|
389
378
|
|
|
390
379
|
if (!global.$contracts[key]) {
|
|
391
380
|
global.$contracts[key] = new web3.eth.Contract(abi, address);
|
|
@@ -579,7 +568,7 @@ async function getTokenMap(tokens, web3, batchNum, asyncNum) {
|
|
|
579
568
|
}
|
|
580
569
|
} catch (e) {
|
|
581
570
|
$log(`${token} erc20 info error`)
|
|
582
|
-
$log(new Error(e
|
|
571
|
+
$log(new Error(errorStack(e)).stack)
|
|
583
572
|
}
|
|
584
573
|
}
|
|
585
574
|
return chainMap
|
|
@@ -784,7 +773,7 @@ async function ethQuery(web3, address, method, ...args) {
|
|
|
784
773
|
const contract = newContract(web3, (await getContractJson(address)).abi, address);
|
|
785
774
|
return await contract.methods[method](...args).call()
|
|
786
775
|
} catch (e) {
|
|
787
|
-
$log(new Error(e
|
|
776
|
+
$log(new Error(errorStack(e)).stack)
|
|
788
777
|
return null;
|
|
789
778
|
}
|
|
790
779
|
}
|
|
@@ -794,7 +783,7 @@ async function ethQuery1(web3, address, abi, method, ...args) {
|
|
|
794
783
|
const contract = newContract(web3, abi, address);
|
|
795
784
|
return await contract.methods[method](...args).call()
|
|
796
785
|
} catch (e) {
|
|
797
|
-
$log(new Error(e
|
|
786
|
+
$log(new Error(errorStack(e)).stack)
|
|
798
787
|
return null
|
|
799
788
|
}
|
|
800
789
|
}
|
|
@@ -805,7 +794,7 @@ async function ethRead(address, abi, method, args, web3) {
|
|
|
805
794
|
const contract = newContract(web3, abi, address);
|
|
806
795
|
return await contract.methods[method](...args).call()
|
|
807
796
|
} catch (e) {
|
|
808
|
-
$log(new Error(e
|
|
797
|
+
$log(new Error(errorStack(e)).stack)
|
|
809
798
|
return null
|
|
810
799
|
}
|
|
811
800
|
}
|
|
@@ -816,15 +805,16 @@ function createEthWrite(config = {}) {
|
|
|
816
805
|
}
|
|
817
806
|
}
|
|
818
807
|
|
|
819
|
-
async function ethWrite(sender, address,
|
|
808
|
+
async function ethWrite(sender, address,
|
|
809
|
+
{data, abi, method, args, gasPrice, gasPriceAdd, gasLimit,
|
|
810
|
+
value, waitConfirm, sleepSec, msg, onError} = {}) {
|
|
820
811
|
if (!address) {
|
|
821
812
|
throw 'address require for ethWrite'
|
|
822
813
|
}
|
|
823
814
|
let web3 = sender.web3 || global.web3
|
|
824
815
|
|
|
825
|
-
let avgGasPrice = await cacheFn('getGasPrice', async () => await web3.eth.getGasPrice(), 1000 * 5)
|
|
826
816
|
let txObject = {
|
|
827
|
-
gasPrice: gasPrice ? gasPrice * 1000000000 :
|
|
817
|
+
gasPrice: gasPrice ? gasPrice * 1000000000 : await cacheFn('getGasPrice', async () => await web3.eth.getGasPrice(), 1000 * 5),
|
|
828
818
|
gasLimit: gasLimit,
|
|
829
819
|
to: address,
|
|
830
820
|
value
|
|
@@ -848,15 +838,15 @@ async function ethWrite(sender, address, {data, abi, method, args, gasPrice, gas
|
|
|
848
838
|
msg = msg ? msg + ' ':''
|
|
849
839
|
console.log(`${msg}send ${signedTx.hash} ${txObject.gasPrice/1000000000}g`)
|
|
850
840
|
result = result.then(resp => {
|
|
851
|
-
console.log(
|
|
841
|
+
console.log(infoStr(`${msg}${signedTx.hash} 交易成功`))
|
|
852
842
|
return true
|
|
853
843
|
}).catch(async e => {
|
|
854
|
-
console.log(
|
|
844
|
+
console.log(errorStr(`${msg}${signedTx.hash} 交易失败`))
|
|
855
845
|
if (onError) {
|
|
856
846
|
return await onError(e)
|
|
857
847
|
} else {
|
|
858
|
-
console.error(e
|
|
859
|
-
$log(new Error(e
|
|
848
|
+
console.error(String(e))
|
|
849
|
+
$log(new Error(errorStack(e)).stack)
|
|
860
850
|
return false
|
|
861
851
|
}
|
|
862
852
|
})
|
|
@@ -895,17 +885,8 @@ async function web3BatchReq(items, batchNum = 49, asyncNum = 33, web3) {
|
|
|
895
885
|
}
|
|
896
886
|
if (batchNum) {
|
|
897
887
|
let callBatchs = splitArray(items, batchNum)
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
let pro = _web3BatchReq(callBatchs[i], web3)
|
|
901
|
-
pros.push(pro)
|
|
902
|
-
if (asyncNum === 1) {
|
|
903
|
-
await pro;
|
|
904
|
-
} else if (i > 0 && i % asyncNum === 0) {
|
|
905
|
-
await pro;
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
return (await Promise.all(pros)).reduce((a,b) => a.concat(b))
|
|
888
|
+
return (await batchAsync(callBatchs.map(item => () => _web3BatchReq(item, web3)), asyncNum))
|
|
889
|
+
.reduce((a,b) => a.concat(b))
|
|
909
890
|
}
|
|
910
891
|
return _web3BatchReq(items, web3)
|
|
911
892
|
}
|
|
@@ -921,13 +902,13 @@ async function _web3BatchReq(items, web3) {
|
|
|
921
902
|
try {
|
|
922
903
|
await item.callback(error, result)
|
|
923
904
|
} catch (e) {
|
|
924
|
-
$log(new Error(e
|
|
905
|
+
$log(new Error(errorStack(e)).stack)
|
|
925
906
|
resolve(result || error);
|
|
926
907
|
throw e
|
|
927
908
|
}
|
|
928
909
|
}
|
|
929
910
|
if (error) {
|
|
930
|
-
$log(new Error(
|
|
911
|
+
$log(new Error(errorStack(error)).stack)
|
|
931
912
|
}
|
|
932
913
|
resolve(result || error);
|
|
933
914
|
}));
|
|
@@ -1034,7 +1015,7 @@ async function batchTranfer(ethTranserWrite, token, froms, tos, min, max) {
|
|
|
1034
1015
|
for(let from of froms) {
|
|
1035
1016
|
let sender = await newSender(from)
|
|
1036
1017
|
for(let to of tos) {
|
|
1037
|
-
let fromAddress = String(from).startsWith('0x') ? from:global.$wallet.getAddress(from);
|
|
1018
|
+
let fromAddress = String(from).startsWith('0x') ? privateToAddress(from):global.$wallet.getAddress(from);
|
|
1038
1019
|
let toAddress = String(to).startsWith('0x') ? to:global.$wallet.getAddress(to);
|
|
1039
1020
|
|
|
1040
1021
|
if (token) {
|
|
@@ -1044,12 +1025,12 @@ async function batchTranfer(ethTranserWrite, token, froms, tos, min, max) {
|
|
|
1044
1025
|
if (Number(tb) >= min) {
|
|
1045
1026
|
continue
|
|
1046
1027
|
}
|
|
1047
|
-
let transferAmt = bMin(max, tb)
|
|
1028
|
+
let transferAmt = BigNumber(bMin(max, tb)).toFixed(0)
|
|
1048
1029
|
if (Number(fb) < Number(transferAmt)) {
|
|
1049
1030
|
continue
|
|
1050
1031
|
}
|
|
1051
1032
|
let fmtTransferAmt = exDcmNum(transferAmt, -decimals).toString()
|
|
1052
|
-
pros.push(ethTranserWrite(sender, token, {
|
|
1033
|
+
pros.push(await ethTranserWrite(sender, token, {
|
|
1053
1034
|
abi: erc20Abi,
|
|
1054
1035
|
method: 'transfer',
|
|
1055
1036
|
args: [toAddress, transferAmt],
|
|
@@ -1062,19 +1043,19 @@ async function batchTranfer(ethTranserWrite, token, froms, tos, min, max) {
|
|
|
1062
1043
|
if (Number(tb) >= min) {
|
|
1063
1044
|
continue
|
|
1064
1045
|
}
|
|
1065
|
-
let transferAmt = bMin(max, tb)
|
|
1046
|
+
let transferAmt = BigNumber(bMin(max, tb)).toFixed(0)
|
|
1066
1047
|
if (Number(fb) < Number(transferAmt)) {
|
|
1067
1048
|
continue
|
|
1068
1049
|
}
|
|
1069
1050
|
let fmtTransferAmt = exDcmNum(transferAmt, -decimals).toString()
|
|
1070
|
-
pros.push(ethTranserWrite(sender, toAddress, {
|
|
1051
|
+
pros.push(await ethTranserWrite(sender, toAddress, {
|
|
1071
1052
|
value: transferAmt,
|
|
1072
1053
|
msg: from + '转' + fmtTransferAmt + '本币给' + to
|
|
1073
1054
|
}))
|
|
1074
1055
|
}
|
|
1075
1056
|
}
|
|
1076
1057
|
}
|
|
1077
|
-
await Promise.all(pros)
|
|
1058
|
+
await Promise.all(pros.map(i => i.promise))
|
|
1078
1059
|
}
|
|
1079
1060
|
|
|
1080
1061
|
async function batchCollect(ethTranserWrite, token, froms, to, remain) {
|
|
@@ -1091,7 +1072,7 @@ async function batchCollect(ethTranserWrite, token, froms, to, remain) {
|
|
|
1091
1072
|
for(let from of froms) {
|
|
1092
1073
|
let sender = await newSender(from)
|
|
1093
1074
|
|
|
1094
|
-
let fromAddress = String(from).startsWith('0x') ? from:global.$wallet.getAddress(from);
|
|
1075
|
+
let fromAddress = String(from).startsWith('0x') ? privateToAddress(from):global.$wallet.getAddress(from);
|
|
1095
1076
|
let toAddress = String(to).startsWith('0x') ? to:global.$wallet.getAddress(to);
|
|
1096
1077
|
|
|
1097
1078
|
if (token) {
|
|
@@ -1100,9 +1081,9 @@ async function batchCollect(ethTranserWrite, token, froms, to, remain) {
|
|
|
1100
1081
|
if (Number(fb) <= remain) {
|
|
1101
1082
|
continue
|
|
1102
1083
|
}
|
|
1103
|
-
let transferAmt = bMin(fb, remain)
|
|
1084
|
+
let transferAmt = BigNumber(bMin(fb, remain)).toFixed(0)
|
|
1104
1085
|
let fmtTransferAmt = exDcmNum(transferAmt, -decimals).toString()
|
|
1105
|
-
pros.push(ethTranserWrite(sender, token, {
|
|
1086
|
+
pros.push(await ethTranserWrite(sender, token, {
|
|
1106
1087
|
abi: erc20Abi,
|
|
1107
1088
|
method: 'transfer',
|
|
1108
1089
|
args: [toAddress, transferAmt],
|
|
@@ -1114,15 +1095,15 @@ async function batchCollect(ethTranserWrite, token, froms, to, remain) {
|
|
|
1114
1095
|
if (Number(fb) <= remain) {
|
|
1115
1096
|
continue
|
|
1116
1097
|
}
|
|
1117
|
-
let transferAmt = bMin(fb, remain)
|
|
1098
|
+
let transferAmt = BigNumber(bMin(fb, remain)).toFixed(0)
|
|
1118
1099
|
let fmtTransferAmt = exDcmNum(transferAmt, -decimals).toString()
|
|
1119
|
-
pros.push(ethTranserWrite(sender, toAddress, {
|
|
1100
|
+
pros.push(await ethTranserWrite(sender, toAddress, {
|
|
1120
1101
|
value: transferAmt,
|
|
1121
1102
|
msg: from + '转' + fmtTransferAmt + '本币给' + to
|
|
1122
1103
|
}))
|
|
1123
1104
|
}
|
|
1124
1105
|
}
|
|
1125
|
-
await Promise.all(pros)
|
|
1106
|
+
await Promise.all(pros.map(i => i.promise))
|
|
1126
1107
|
}
|
|
1127
1108
|
|
|
1128
1109
|
function coinNum(num, decimals) {
|
package/index.js
CHANGED
|
@@ -1,267 +1,6 @@
|
|
|
1
|
-
const {
|
|
2
|
-
run,
|
|
3
|
-
reget,
|
|
4
|
-
trim,
|
|
5
|
-
e,
|
|
6
|
-
ee,
|
|
7
|
-
regEach,
|
|
8
|
-
runSync,
|
|
9
|
-
linuxAskAndKill,
|
|
10
|
-
fanyi,
|
|
11
|
-
cleanFile,
|
|
12
|
-
fileCleaner,
|
|
13
|
-
getLibDataDir,
|
|
14
|
-
lisPid,
|
|
15
|
-
got,
|
|
16
|
-
timeLoop,
|
|
17
|
-
getLisPidDir,
|
|
18
|
-
mkdir,
|
|
19
|
-
bAdd,
|
|
20
|
-
bDiv,
|
|
21
|
-
bMin,
|
|
22
|
-
bMul,
|
|
23
|
-
getConfig,
|
|
24
|
-
getCbText,
|
|
25
|
-
aesDecipher,
|
|
26
|
-
aesCipher,
|
|
27
|
-
pad,
|
|
28
|
-
requireG,
|
|
29
|
-
toBigNum,
|
|
30
|
-
objDataFile,
|
|
31
|
-
appendLog,
|
|
32
|
-
createLimitLogger,
|
|
33
|
-
clearConsole,
|
|
34
|
-
fileLock,
|
|
35
|
-
globalLock,
|
|
36
|
-
globalUnLock,
|
|
37
|
-
rmDir,
|
|
38
|
-
eFn,
|
|
39
|
-
removeFirst,
|
|
40
|
-
sleep,
|
|
41
|
-
getUniConfig,
|
|
42
|
-
timeLimit,
|
|
43
|
-
dayJs,
|
|
44
|
-
setCbText,
|
|
45
|
-
randomInt,
|
|
46
|
-
vl,
|
|
47
|
-
getVl,
|
|
48
|
-
getFnVl,
|
|
49
|
-
$config,
|
|
50
|
-
timeStr,
|
|
51
|
-
splitArray,
|
|
52
|
-
BigNumber,
|
|
53
|
-
range,
|
|
54
|
-
Range,
|
|
55
|
-
getOr,
|
|
56
|
-
$log,
|
|
57
|
-
createLimitLogger2,
|
|
58
|
-
cacheFn,
|
|
59
|
-
isError,
|
|
60
|
-
getOrFn,
|
|
61
|
-
emptyFn,
|
|
62
|
-
setConfig,
|
|
63
|
-
axios,
|
|
64
|
-
textDataFile,
|
|
65
|
-
arrayDataFile,
|
|
66
|
-
dataFile,
|
|
67
|
-
strEq,
|
|
68
|
-
wrapRows,
|
|
69
|
-
info,
|
|
70
|
-
warn,
|
|
71
|
-
error,
|
|
72
|
-
parseSteps
|
|
73
|
-
} = require('./util')
|
|
74
|
-
const {
|
|
75
|
-
sc,
|
|
76
|
-
sd,
|
|
77
|
-
st,
|
|
78
|
-
sb,
|
|
79
|
-
ss
|
|
80
|
-
} = require('./sol')
|
|
81
|
-
const {
|
|
82
|
-
getContractJson,
|
|
83
|
-
coinNum,
|
|
84
|
-
forEachBlock,
|
|
85
|
-
parseInputData,
|
|
86
|
-
exDcm,
|
|
87
|
-
ethQuery,
|
|
88
|
-
ethQuery1,
|
|
89
|
-
exDcmNum,
|
|
90
|
-
encodeEthAddress,
|
|
91
|
-
gasPrice,
|
|
92
|
-
tokenMap,
|
|
93
|
-
getPrice,
|
|
94
|
-
getPriceNoFee,
|
|
95
|
-
getPriceByAmt,
|
|
96
|
-
getPriceByAmtNoFee,
|
|
97
|
-
getPairAmt,
|
|
98
|
-
getPairAmtNoFee,
|
|
99
|
-
getPoolAmt,
|
|
100
|
-
getLastBlockSecTime,
|
|
101
|
-
forEachBlockAsync,
|
|
102
|
-
newContract,
|
|
103
|
-
sendTxn,
|
|
104
|
-
walletGet,
|
|
105
|
-
txnSign,
|
|
106
|
-
initSender,
|
|
107
|
-
privateToAddress,
|
|
108
|
-
initSenderWithKeys,
|
|
109
|
-
erc20Query,
|
|
110
|
-
initRootWallet,
|
|
111
|
-
ethBatchQuery,
|
|
112
|
-
newAbiInterface,
|
|
113
|
-
newWeb3Contract,
|
|
114
|
-
getTokenMap,
|
|
115
|
-
getReserves,
|
|
116
|
-
swapExactFor,
|
|
117
|
-
swapForExact,
|
|
118
|
-
ethRead,
|
|
119
|
-
ethWrite,
|
|
120
|
-
fmtErc20Amt,
|
|
121
|
-
createEthWrite,
|
|
122
|
-
forEachBlockBatch,
|
|
123
|
-
forEachEvent,
|
|
124
|
-
batchTranfer,
|
|
125
|
-
batchCollect,
|
|
126
|
-
web3BatchReq,
|
|
127
|
-
fastSwapExactFor,
|
|
128
|
-
fastSwapForExact,
|
|
129
|
-
getTokenBal,
|
|
130
|
-
transferToken,
|
|
131
|
-
tokenApprove,
|
|
132
|
-
txnInputReplacer,
|
|
133
|
-
abiDecoder,
|
|
134
|
-
saveTokenMap
|
|
135
|
-
} = require('./ethWeb')
|
|
136
1
|
|
|
137
2
|
module.exports = {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
reget,
|
|
142
|
-
trim,
|
|
143
|
-
e,
|
|
144
|
-
ee,
|
|
145
|
-
regEach,
|
|
146
|
-
runSync,
|
|
147
|
-
linuxAskAndKill,
|
|
148
|
-
fanyi,
|
|
149
|
-
cleanFile,
|
|
150
|
-
fileCleaner,
|
|
151
|
-
getLibDataDir,
|
|
152
|
-
lisPid,
|
|
153
|
-
got,
|
|
154
|
-
timeLoop,
|
|
155
|
-
getLisPidDir,
|
|
156
|
-
getContractJson,
|
|
157
|
-
mkdir,
|
|
158
|
-
sc,
|
|
159
|
-
sd,
|
|
160
|
-
st,
|
|
161
|
-
sb,
|
|
162
|
-
parseInputData,
|
|
163
|
-
exDcm,
|
|
164
|
-
bAdd,
|
|
165
|
-
bDiv,
|
|
166
|
-
bMin,
|
|
167
|
-
bMul,
|
|
168
|
-
ss,
|
|
169
|
-
getConfig,
|
|
170
|
-
getCbText,
|
|
171
|
-
aesDecipher,
|
|
172
|
-
aesCipher,
|
|
173
|
-
pad,
|
|
174
|
-
requireG,
|
|
175
|
-
ethQuery,
|
|
176
|
-
ethQuery1,
|
|
177
|
-
exDcmNum,
|
|
178
|
-
toBigNum,
|
|
179
|
-
objDataFile,
|
|
180
|
-
appendLog,
|
|
181
|
-
createLimitLogger,
|
|
182
|
-
encodeEthAddress,
|
|
183
|
-
clearConsole,
|
|
184
|
-
fileLock,
|
|
185
|
-
globalLock,
|
|
186
|
-
globalUnLock,
|
|
187
|
-
rmDir,
|
|
188
|
-
gasPrice,
|
|
189
|
-
tokenMap,
|
|
190
|
-
getPrice,
|
|
191
|
-
getPriceNoFee,
|
|
192
|
-
getPriceByAmt,
|
|
193
|
-
getPriceByAmtNoFee,
|
|
194
|
-
getPairAmt,
|
|
195
|
-
getPairAmtNoFee,
|
|
196
|
-
getPoolAmt,
|
|
197
|
-
getLastBlockSecTime,
|
|
198
|
-
forEachBlockAsync,
|
|
199
|
-
eFn,
|
|
200
|
-
newContract,
|
|
201
|
-
sendTxn,
|
|
202
|
-
removeFirst,
|
|
203
|
-
sleep,
|
|
204
|
-
walletGet,
|
|
205
|
-
txnSign,
|
|
206
|
-
initSender,
|
|
207
|
-
getUniConfig,
|
|
208
|
-
privateToAddress,
|
|
209
|
-
initSenderWithKeys,
|
|
210
|
-
erc20Query,
|
|
211
|
-
timeLimit,
|
|
212
|
-
dayJs,
|
|
213
|
-
setCbText,
|
|
214
|
-
initRootWallet,
|
|
215
|
-
randomInt,
|
|
216
|
-
vl,
|
|
217
|
-
getVl,
|
|
218
|
-
getFnVl,
|
|
219
|
-
$config,
|
|
220
|
-
timeStr,
|
|
221
|
-
ethBatchQuery,
|
|
222
|
-
newAbiInterface,
|
|
223
|
-
newWeb3Contract,
|
|
224
|
-
splitArray,
|
|
225
|
-
BigNumber,
|
|
226
|
-
getTokenMap,
|
|
227
|
-
getReserves,
|
|
228
|
-
swapExactFor,
|
|
229
|
-
swapForExact,
|
|
230
|
-
ethRead,
|
|
231
|
-
ethWrite,
|
|
232
|
-
fmtErc20Amt,
|
|
233
|
-
createEthWrite,
|
|
234
|
-
forEachBlockBatch,
|
|
235
|
-
forEachEvent,
|
|
236
|
-
range,
|
|
237
|
-
Range,
|
|
238
|
-
batchTranfer,
|
|
239
|
-
batchCollect,
|
|
240
|
-
web3BatchReq,
|
|
241
|
-
getOr,
|
|
242
|
-
$log,
|
|
243
|
-
createLimitLogger2,
|
|
244
|
-
fastSwapExactFor,
|
|
245
|
-
fastSwapForExact,
|
|
246
|
-
cacheFn,
|
|
247
|
-
isError,
|
|
248
|
-
getTokenBal,
|
|
249
|
-
transferToken,
|
|
250
|
-
tokenApprove,
|
|
251
|
-
getOrFn,
|
|
252
|
-
emptyFn,
|
|
253
|
-
setConfig,
|
|
254
|
-
axios,
|
|
255
|
-
textDataFile,
|
|
256
|
-
arrayDataFile,
|
|
257
|
-
dataFile,
|
|
258
|
-
strEq,
|
|
259
|
-
wrapRows,
|
|
260
|
-
info,
|
|
261
|
-
warn,
|
|
262
|
-
error,
|
|
263
|
-
txnInputReplacer,
|
|
264
|
-
parseSteps,
|
|
265
|
-
abiDecoder,
|
|
266
|
-
saveTokenMap
|
|
3
|
+
...require('util'),
|
|
4
|
+
...require('ethWeb'),
|
|
5
|
+
...require('sol')
|
|
267
6
|
}
|