充值判定
This commit is contained in:
@@ -7,18 +7,14 @@ const getUSDTTxList = async address => {
|
|||||||
const res = await ERC20.getActions(address, USDTAddr, startBlock).catch(err => {
|
const res = await ERC20.getActions(address, USDTAddr, startBlock).catch(err => {
|
||||||
if (err) return [];
|
if (err) return [];
|
||||||
});
|
});
|
||||||
mylog.info(res, res.filter(tx => tx.to === address));
|
return res.filter(tx => tx.tokenName === 'Tether USD' && tx.tokenSymbol === 'USDT' && tx.to === address && tx.from !== address); //只取转入到本地址的
|
||||||
return res.filter(tx => tx.to === address); //只取转入到本地址的
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const parseUsdtTx = txList => {
|
const parseUsdtTx = txList => {
|
||||||
if (!txList || !Array.isArray(txList)) return [];
|
if (!txList || !Array.isArray(txList)) return [];
|
||||||
return txList.map(tx => {
|
return txList.map(tx => {
|
||||||
return {
|
tx.amount = (+tx.value) / 1e6;
|
||||||
amount: (+tx.value) / 1e6,
|
return tx;
|
||||||
hash: tx.hash,
|
|
||||||
blockNumber: tx.blockNumber
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user