|
|
@@ -192,7 +192,6 @@ tokenpocketBnb.getEstimateGas= async function (data){
|
|
|
console.log('estimateGas---------------start',data)
|
|
|
let estimateGas =await tokenpocketBnb.getProvider().request({ method: 'eth_estimateGas',params:[data, "latest"]})
|
|
|
// estimateGas=web3.utils.hexToNumber(estimateGas)
|
|
|
- console.log(estimateGas,'estimateGas-------------------------------------------------------',web3.utils.hexToNumberString(estimateGas))
|
|
|
if(!estimateGas || web3.utils.hexToNumberString(estimateGas)<100000){
|
|
|
estimateGas=1000000
|
|
|
estimateGas=web3.utils.numberToHex('1500000');
|
|
|
@@ -209,23 +208,21 @@ tokenpocketBnb.getEstimateGas= async function (data){
|
|
|
* @returns {{}}
|
|
|
*/
|
|
|
tokenpocketBnb.getTransactionData=async function (to,money){
|
|
|
- console.log('-------------------------aaaaaaaaaaaaaaaaaaaaaa')
|
|
|
let data={};
|
|
|
|
|
|
data.to=to;
|
|
|
data.from=tokenpocketBnb.getMyAddress();
|
|
|
data.gasPrice=await tokenpocketBnb.getGasPrice();
|
|
|
data.gas=await tokenpocketBnb.getEstimateGas(data);
|
|
|
- console.log('-------------------------aaaaaaaaaaaaaaaaaaaaaa')
|
|
|
data.chainId=chainId;
|
|
|
if(tools.isDevelopment()){
|
|
|
money=0.00001;
|
|
|
}
|
|
|
data.data='0x0';
|
|
|
- console.log(money.toString())
|
|
|
- data.value=web3.utils.numberToHex(ethers.utils.parseEther(money.toString()).toString());
|
|
|
- console.log('value:'+data.value)
|
|
|
-
|
|
|
+ money=money+''
|
|
|
+ console.log(money)
|
|
|
+ data.value=web3.utils.numberToHex(ethers.utils.parseEther(money).toString());
|
|
|
+ console.log(data)
|
|
|
return data;
|
|
|
}
|
|
|
|