# coin-ts

> A minimal cryptocurrency CLI implementation in TypeScript & Immutable.js

Latest version **1.0.7** (published 2018-02-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install coin-ts
pnpm add coin-ts
yarn add coin-ts
bun add coin-ts
```

Provides the command `coin`.

## 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.0.7 |
| Published | 2018-02-01 |
| First published | 2018-02-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 185 |
| Maintainers | seanseany |

## Links

- npm: https://www.npmjs.com/package/coin-ts
- Repository: https://github.com/seanjameshan/coin-cli
- Homepage: https://github.com/seanjameshan/coin-cli#readme
- Issues: https://github.com/seanjameshan/coin-cli/issues
- npm.io page: https://npm.io/package/coin-ts

## Dependencies (6)

- [wrtc](https://npm.io/package/wrtc.md) 0.0.63
- [vorpal](https://npm.io/package/vorpal.md) ^1.12.0
- [ts-node](https://npm.io/package/ts-node.md) ^4.0.2
- [elliptic](https://npm.io/package/elliptic.md) ^6.4.0
- [immutable](https://npm.io/package/immutable.md) ^4.0.0-rc.9
- [peer-exchange](https://npm.io/package/peer-exchange.md) ^2.2.0

## Recent versions

- 1.0.7 (latest) — 2018-02-01
- 1.0.6 — 2018-02-01
- 1.0.4 — 2018-02-01
- 1.0.3 — 2018-02-01
- 1.0.2 — 2018-02-01
- 1.0.1 — 2018-02-01
- 1.0.0 — 2018-02-01

## README

<h1 align="center">
  <br>
  <a href="https://coindemo.io" rel="noopener noreferrer" target="_blank"><img src="https://raw.githubusercontent.com/seanjameshan/coin-cli/master/media/logo.png" width="150"></a>
  <br>
    <a href="https://coindemo.io" rel="noopener noreferrer" target="_blank">Coin CLI</a>
  <br>
</h1>

<h4 align="center">A minimal cryptocurrency CLI implementation in TypeScript & Immutable.js</h4>

<br>

## Demo

#### Connect
![connect](https://raw.githubusercontent.com/seanjameshan/coin-cli/master/media/demo/connect.gif)

#### Mining
![mining](https://raw.githubusercontent.com/seanjameshan/coin-cli/master/media/demo/mine.gif)

#### Payment
![payment](https://raw.githubusercontent.com/seanjameshan/coin-cli/master/media/demo/pay.gif)

## 🎉 Features
- 💰 Wallet with public and private key.
- 💳 Make Payments between wallets.
- 🔑 Transactions are signed with the wallet's private key.
- 🔗 Blocks with index, hash, data, transactions, and timestamp.
- ⛏ Proof-of-work implementation.
- ⛓ In-memory JavaScript array to store the blockchain.
- ✅ Block & Transaction integrity validation.
- 📡 Decentralized and distributed peer-to-peer communication.
- ✨ Minimal implementation in 900 lines of code.

## 📦 Installation

To install this application, you'll need
[Node.js](https://nodejs.org/en/download/) 7+ (which comes with
[npm](http://npmjs.com)) installed on your computer. From your command line:

#### Source (recommended)

You'll need [Git](https://git-scm.com) to run the project from source. From your
command line:

```bash
# Clone this repository
$ git clone https://github.com/seanjameshan/coin-cli

# Go into the repository
$ cd coin-cli

# Install dependencies
$ npm install

# Run the app
$ npm start
```

#### [NPM]() 
<!-- add npm link above -->
```bash
$ npm install ts-node -g
$ npm install coin-ts -g
$ coin
```

## 🕹️ Usage
| Command                                  | Alias | Description                                                               | Example                    |
|------------------------------------------|-------|---------------------------------------------------------------------------|----------------------------|
| open <port>                              | o     | Open <port> to accept incoming connections.                               | open 5000                  |
| connect <host> <port>                    | c     | Connect to a new peer with <host> and <peer>                              | connect localhost 5000     |
| blockchain                               | bc    | See the current state of the blockchain.                                  |                            |
| peers                                    | p     | Get the list of connected peers.                                          |                            |
| mine [address]                           | m     | Mine a new block with rewards going to optional [address].                | mine or mine xxx...        |
| transactions                             | tx    | See unconfirmed transactions that can be mined.                           |                            |
| wallet <password>                        | w     | Create a new wallet with <password>                                       | wallet mypassword          |
| key                                      | k     | Get your public key                                                       |                            |
| pay <address> <amount> <fee> <password>  | p     | Make payment to <address> with <amount> and <fee> using wallet <password> | pay xxx... 10 5 mypassword |
| balance [address]                        | b     | Balance of optional <address>                                             | balance or balance xxx...  |
| help [command...]                        |       | Provides help for a given command                                         | help balance or help       |
| exit                                     |       | Exits application.                                                        |                            |

<br>

<h1 align="center">
<a rel="noopener noreferrer" target="_blank" href="https://www.buymeacoffee.com/seanhan"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" target="_blank"></a>
</h1>

<br>

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