# create-eth-test-account

> ## :unicorn: Fastest way to get setup with Ethereum :unicorn:

Latest version **1.1.0** (published 2020-05-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install create-eth-test-account
pnpm add create-eth-test-account
yarn add create-eth-test-account
bun add create-eth-test-account
```

Provides the command `create-ethereum-test-account`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2020-05-22 |
| First published | 2020-05-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 9.3 KB |
| Known vulnerabilities | 0 (+28 in 2 direct dependencies) |
| Install scripts | no |
| Author | Philipp Langhans |
| Maintainers | philipplgh |
| Keywords | Ethereum, faucet, CLI |

## Links

- npm: https://www.npmjs.com/package/create-eth-test-account
- npm.io page: https://npm.io/package/create-eth-test-account

## Dependencies (5)

- [axios](https://npm.io/package/axios.md) ^0.19.2
- [chalk](https://npm.io/package/chalk.md) ^4.0.0
- [ethers](https://npm.io/package/ethers.md) ^4.0.47
- [enquirer](https://npm.io/package/enquirer.md) ^2.3.5
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^8.5.1

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2020-05-22
- 1.0.0 — 2020-05-13

## README

# create eth-test-account

## :unicorn: Fastest way to get setup with Ethereum :unicorn:

```shell
npm create eth-test-account
```

💸💸💸 Get test Ether for the goerli testnet instantly! 💸💸💸

Uses the faucet at: https://api.ethfaucet.org

## Generate a pre-funded test account in seconds :rocket:

<p align="center"><img src="/img/install.gif?raw=true"/></p>

###  What is the password?
>"" (empty string)


### Do I need social media verification to use this?
> Nope. Hopefully a thing of the past. Might need to adjust CAPCTHAs in the future.

### Can I sell my test ether?
> No.

### What if I lose the key?
> Generate a new one: npm create ethereum-test-account


### Is it possible to use the same functionality in my tool?
> The API is rather simple and it should be totally possible

Take a look at `faucet.js`
```javascript
const FAUCET_API = 'https://api.ethfaucet.org'

const getCaptcha = async () => {
  try {
    const { data } = await axios.get(`${FAUCET_API}/captcha/${process.stdout.columns}/${process.stdout.rows * 2}`)
    return data
  } catch (error) {
    const { response } = error
    if (response) {
      console.error('Get captcha error:', response.status, response.statusText)
    } else {
      console.error('Get captcha error:', error.code)
    }
    process.exit()
  }
}

const checkCaptcha = async (token, answer) => {
  const decoded = jwt.decode(token)
  const { challenge, salt} = decoded
  const response = createHmac(answer, salt)
  return response === challenge
}

const requestFunds = async (address, challenge, response) => {
  const networkId = 5 // goerli
  const { data } = await axios.get(`${FAUCET_API}/faucet/${networkId}/${address}`, {
    headers: {
      Authorization: `${challenge}.${response}`
    }
  })
  return data
}
```

## Have fun!

---
_Source: https://npm.io/package/create-eth-test-account · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
