mirror of
https://github.com/tornadocash/tornado-relayer.git
synced 2024-10-01 08:25:37 -04:00
28 lines
660 B
JavaScript
28 lines
660 B
JavaScript
|
const { toHex, toWei } = require('web3-utils')
|
||
|
const TxManager = require('./src/TxManager')
|
||
|
const { rpcUrl, privateKey } = require('./config')
|
||
|
const TxM = new TxManager({
|
||
|
privateKey,
|
||
|
rpcUrl,
|
||
|
})
|
||
|
|
||
|
const tx = {
|
||
|
from: '0x03Ebd0748Aa4D1457cF479cce56309641e0a98F5',
|
||
|
value: 0,
|
||
|
gasPrice: toHex(toWei('1', 'gwei')),
|
||
|
to: '0x03Ebd0748Aa4D1457cF479cce56309641e0a98F5',
|
||
|
}
|
||
|
|
||
|
async function main() {
|
||
|
const receipt = await TxM.submit(tx)
|
||
|
.on('transactionHash', (hash) => {
|
||
|
console.log('hash', hash)
|
||
|
})
|
||
|
.on('confirmations', (confirmations) => {
|
||
|
console.log('confirmations', confirmations)
|
||
|
})
|
||
|
console.log('receipt', receipt)
|
||
|
}
|
||
|
|
||
|
main()
|