faucetTuc.ts 599 B

123456789101112131415161718192021222324
  1. import { forEachAsync, getAxiosClient } from '../utils'
  2. import { DBClient } from '../singletons'
  3. import { Status } from '../models/Status'
  4. import polly from 'polly-js'
  5. async function faucetTuc(address: string) {
  6. await polly()
  7. .waitAndRetry(3)
  8. .executeForPromise(async () => {
  9. const client = getAxiosClient(true)
  10. const res = await client.post(
  11. 'https://birdee-faucet.testnet.mesoops.net/',
  12. {
  13. address: address,
  14. coins: ['10000000utuc'],
  15. },
  16. )
  17. if (res.data.error) {
  18. throw new Error(res.data.error)
  19. }
  20. })
  21. }