task3Swap.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // import { DBClient } from '../singletons'
  2. // import { Status } from '../models/Status'
  3. // import { forEachAsync } from '../utils'
  4. // import { InitiaClient } from '../InitiaClient'
  5. //
  6. // async function startCheck(concurrency) {
  7. // const accountsRaw = await DBClient.instance.account.findMany({
  8. // where: {
  9. // status: Status.Task2Done,
  10. // },
  11. // take: 2500,
  12. // })
  13. // await forEachAsync(accountsRaw, concurrency, async (account, index) => {
  14. // console.log(`${index}/${accountsRaw.length}: processing ${account.address}`)
  15. // try {
  16. // // await faucetAccount(account.address)
  17. //
  18. // const client = new InitiaClient(account.mnemonic, true)
  19. //
  20. // const bool = await client.swapScript()
  21. // console.log(bool)
  22. // if (bool == `done`) {
  23. // await DBClient.instance.account.update({
  24. // where: { id: account.id },
  25. // data: { status: Status.Task3Done },
  26. // })
  27. // }
  28. // } catch (e) {
  29. // console.log(e)
  30. // // await DBClient.instance.account.update({
  31. // // where: { id: account.id },
  32. // // data: { status: Status.MayQueued, message: e.message },
  33. // // })
  34. // }
  35. // })
  36. // }
  37. //
  38. // startCheck(20)