@@ -242,25 +242,25 @@ export default function Step2(props:Iprops) {
242242 //
243243 // if (chainId === 1) {
244244 // sender = contracts.mainnet;
245- // // url = 'https://etherscan.io/tx/ ';
245+ // // url = 'https://etherscan.io/tx';
246246 // // } else if (chainId === 42) {
247247 // // sender = contracts.kovan;
248- // // url = 'https://kovan.etherscan.io/tx/ ';
248+ // // url = 'https://kovan.etherscan.io/tx';
249249 // // } else if (chainId === 128) {
250250 // // sender = contracts.heco;
251- // // url = 'https://hecoinfo.com/tx/ ';
251+ // // url = 'https://hecoinfo.com/tx';
252252 // // } else if (chainId === 256) {
253253 // // sender = contracts.hecotest;
254- // // url = 'https://testnet.hecoinfo.com/tx/ ';
254+ // // url = 'https://testnet.hecoinfo.com/tx';
255255 // } else if (chainId === 137) {
256256 // sender = contracts.polygon;
257- // // url = 'https://polygonscan.com/tx/ ';
257+ // // url = 'https://polygonscan.com/tx';
258258 // } else if (chainId === 56) {
259259 // sender = contracts.bsc;
260- // // url = 'https://bscscan.com/tx/ ';
260+ // // url = 'https://bscscan.com/tx';
261261 // } else if (chainId === 97) {
262262 // sender = contracts.bsctest;
263- // // url = 'https://testnet.bscscan.com/tx/ ';
263+ // // url = 'https://testnet.bscscan.com/tx';
264264 // } else {
265265 // console.error('Unsupported network!!!!');
266266 // return;
@@ -393,11 +393,10 @@ export default function Step2(props:Iprops) {
393393
394394 settips ( `Sending Ether in progress... (${ txIndex } /${ Math . ceil ( addressArray . length / pageSize ) } )` ) ;
395395 dispatch ( { type : ActionType . TIPS , payload : `Sending Ether in progress... (${ txIndex } /${ Math . ceil ( addressArray . length / pageSize ) } )` } )
396-
397- await multiSender . connect ( signer ) . batchSendEther ( addressArr , amountWeiArr , { from : account , value : ethers . utils . hexValue ( sendValue ) } ) . then ( ( data : {
398- transactionHash : string ; hash : string ;
399- } ) => {
400- console . log ( 'batchSendEther' , data ) ;
396+ try {
397+ let res = await multiSender . connect ( signer ) . batchSendEther ( addressArr , amountWeiArr , { from : account , value : ethers . utils . hexValue ( sendValue ) } )
398+ let data = await res . wait ( ) ;
399+ console . log ( 'batchSendEther' , res ) ;
401400 txHashArr . push ( data . hash || data ?. transactionHash ) ;
402401 if ( txIndex >= Math . ceil ( addressArray . length / pageSize ) ) {
403402 setshowLoading ( false ) ;
@@ -406,12 +405,13 @@ export default function Step2(props:Iprops) {
406405 handleNext ( 3 ) ;
407406
408407 }
409- } ) . catch ( ( err : any ) => {
408+ } catch ( err : any ) {
410409 console . error ( 'batchSendEther error: ' , err ) ;
411- setErrorTips ( err . data ?. message || err . message )
410+ setErrorTips ( err . data ?. message || err . message )
412411 setshowLoading ( false ) ;
413412 dispatch ( { type : ActionType . TIPS , payload : null } )
414- } ) ;
413+ }
414+
415415
416416 }
417417 // setTxHashList(txHashArr);
@@ -468,8 +468,9 @@ export default function Step2(props:Iprops) {
468468 }
469469
470470 const downLoadExcel = ( data :string [ ] ) => {
471- if ( importRecord == null ) return ;
472- let amountStr = `Address,amount\n` ;
471+ if ( importRecord == null || ! data . length ) return ;
472+ let amountStr = `Address,Amount\n` ;
473+ let addressStr = "" ;
473474 importRecord . map ( ( item ) => {
474475 const { address, amount} = item ;
475476 let isSuccess = false ;
@@ -479,10 +480,13 @@ export default function Step2(props:Iprops) {
479480 }
480481 }
481482 if ( ! isSuccess ) {
482- amountStr += `${ address } ,${ amount } \n` ;
483+ addressStr += `${ address } ,${ amount } \n` ;
483484 }
484485 } ) ;
485- console . log ( amountStr )
486+ amountStr += addressStr ;
487+ console . log ( addressStr . split ( "\n" ) )
488+ if ( addressStr . split ( "\n" ) . length === 1 ) return ;
489+
486490
487491 let uri = `data:text/csv;charset=utf-8,\ufeff ${ amountStr } ` ;
488492
0 commit comments