|
|
@@ -65,6 +65,9 @@ export class Web3Service {
|
|
|
amount: ethers.utils.parseEther(amount)
|
|
|
})
|
|
|
Logger.log('Deposit sent. Awaiting confirmation...')
|
|
|
+ account.offBridgeNum = (account.offBridgeNum || 0) + 1
|
|
|
+ account.lastOffBridge = new Date()
|
|
|
+ await this.accountService.save([account])
|
|
|
return new Web3Result(account.address, deposit.hash, web3Config[account.network], false)
|
|
|
// // Await processing of the deposit on L1
|
|
|
// const ethereumTxReceipt = await deposit.waitL1Commit()
|
|
|
@@ -97,6 +100,9 @@ export class Web3Service {
|
|
|
amount: ethers.utils.parseEther(amount)
|
|
|
})
|
|
|
Logger.log(`Widthdraw sent. ${web3Config[account.network].zksyncExplorer}/tx/${withdrawL2.hash}`)
|
|
|
+ account.offBridgeNum = (account.offBridgeNum || 0) + 1
|
|
|
+ account.lastOffBridge = new Date()
|
|
|
+ await this.accountService.save([account])
|
|
|
return new Web3Result(account.address, withdrawL2.hash, web3Config[account.network], true)
|
|
|
// // Await processing of the deposit on L1
|
|
|
// const ethereumTxReceipt = await deposit.waitL1Commit()
|
|
|
@@ -128,6 +134,9 @@ export class Web3Service {
|
|
|
to: web3Config[account.network].orbiterEthAddress,
|
|
|
value: ethers.utils.parseEther(amount).add(web3Config[account.network].orbiterIdCodeZk)
|
|
|
})
|
|
|
+ account.thirdBridgeNum = (account.thirdBridgeNum || 0) + 1
|
|
|
+ account.lastThirdBridge = new Date()
|
|
|
+ await this.accountService.save([account])
|
|
|
return new Web3Result(account.address, tx.hash, web3Config[account.network], false)
|
|
|
}
|
|
|
|
|
|
@@ -143,6 +152,9 @@ export class Web3Service {
|
|
|
to: web3Config[account.network].orbiterZkAddress,
|
|
|
value: ethers.utils.parseEther(amount).add(web3Config[account.network].orbiterIdCodeEth)
|
|
|
})
|
|
|
+ account.thirdBridgeNum = (account.thirdBridgeNum || 0) + 1
|
|
|
+ account.lastThirdBridge = new Date()
|
|
|
+ await this.accountService.save([account])
|
|
|
return new Web3Result(account.address, tx.hash, web3Config[account.network], true)
|
|
|
}
|
|
|
|
|
|
@@ -265,6 +277,9 @@ export class Web3Service {
|
|
|
gasLimit
|
|
|
})
|
|
|
Logger.log(`tx hash: ${tx.hash}`, 'addLiquidity')
|
|
|
+ account.addLiuidityNum = (account.addLiuidityNum || 0) + 1
|
|
|
+ account.lastAddLiuidity = new Date()
|
|
|
+ await this.accountService.save([account])
|
|
|
return new Web3Result(account.address, tx.hash, web3Config[account.network], true)
|
|
|
}
|
|
|
|
|
|
@@ -334,6 +349,9 @@ export class Web3Service {
|
|
|
gasLimit
|
|
|
})
|
|
|
console.log('decLiquidityCalling tx: ', JSON.stringify(tx0, null, 4))
|
|
|
+ account.removeLiuidityNum = (account.removeLiuidityNum || 0) + 1
|
|
|
+ account.lastRemoveLiuidity = new Date()
|
|
|
+ await this.accountService.save([account])
|
|
|
return new Web3Result(account.address, tx0.hash, web3Config[account.network], true)
|
|
|
}
|
|
|
|
|
|
@@ -439,6 +457,9 @@ export class Web3Service {
|
|
|
gasLimit
|
|
|
})
|
|
|
console.log(tx)
|
|
|
+ account.swapNum = (account.swapNum || 0) + 1
|
|
|
+ account.lastSwap = new Date()
|
|
|
+ await this.accountService.save([account])
|
|
|
return new Web3Result(account.address, tx.hash, web3Config[account.network], true)
|
|
|
}
|
|
|
|
|
|
@@ -504,6 +525,9 @@ export class Web3Service {
|
|
|
gasLimit
|
|
|
})
|
|
|
console.log(JSON.stringify(tx, null, 4))
|
|
|
+ account.swapNum = (account.swapNum || 0) + 1
|
|
|
+ account.lastSwap = new Date()
|
|
|
+ await this.accountService.save([account])
|
|
|
return new Web3Result(account.address, tx.hash, web3Config[account.network], true)
|
|
|
}
|
|
|
|
|
|
@@ -555,6 +579,9 @@ export class Web3Service {
|
|
|
gasLimit
|
|
|
})
|
|
|
console.log(tx)
|
|
|
+ account.mintNum = (account.mintNum || 0) + 1
|
|
|
+ account.lastMint = new Date()
|
|
|
+ await this.accountService.save([account])
|
|
|
return new Web3Result(account.address, tx.hash, web3Config[account.network], true)
|
|
|
}
|
|
|
}
|