# nakajs-tx-signer

> Lightweight transaction sending module for Nakachain

Latest version **1.2.0** (published 2019-02-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install nakajs-tx-signer
pnpm add nakajs-tx-signer
yarn add nakajs-tx-signer
bun add nakajs-tx-signer
```

## 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.2.0 |
| Published | 2019-02-15 |
| First published | 2019-02-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 25.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Deric Walintukan |
| Maintainers | dwalintukan |

## Links

- npm: https://www.npmjs.com/package/nakajs-tx-signer
- Repository: https://github.com/bodhiproject/nakajs-tx-signer
- Homepage: https://github.com/bodhiproject/nakajs-tx-signer#readme
- Issues: https://github.com/bodhiproject/nakajs-tx-signer/issues
- npm.io page: https://npm.io/package/nakajs-tx-signer

## Dependencies (4)

- [web3](https://npm.io/package/web3.md) ^1.0.0-beta.36
- [dotenv](https://npm.io/package/dotenv.md) ^6.2.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [nakajs-tx](https://npm.io/package/nakajs-tx.md) ^1.1.0

## Recent versions

- 1.2.0 (latest) — 2019-02-15
- 1.1.0 — 2019-02-15
- 1.0.0 — 2019-02-14

## README

# nakajs-tx-signer

## Install
```bash
npm i --save nakajs-tx-signer
```

## Usage
```js
const { sendTransaction } = require('nakajs-tx-signer')

const rpcUrl = 'http://localhost:8545'
const chainId = 12345
const from = '0x0000000000000000000000000000000000000000'
const fromPrivKey = 'abcdefghijklmnopqrstuvwxyz'
const to = '0x0000000000000000000000000000000000000000'
const gasLimit = 21000
const value = 0
const token = '0x0000000000000000000000000000000000000000'
const exchanger = '0x0000000000000000000000000000000000000000'
const exchangeRate = '0xDE0B6B3A7640000'

// Encode data param with Web3
const data = new Web3().eth.abi.encodeFunctionCall(
  {
    "constant": false,
    "inputs": [
      {
        "name": "to",
        "type": "address"
      },
      {
        "name": "amount",
        "type": "uint256"
      }
    ],
    "name": "transfer",
    "outputs": [
      {
        "name": "success",
        "type": "bool"
      }
    ],
    "payable": false,
    "stateMutability": "nonpayable",
    "type": "function"
  }, 
  ['0x0000000000000000000000000000000000000000', '100000000'],
)

sendTransaction({
  rpcUrl,
  chainId,
  from,
  fromPrivKey, 
  to,
  gasLimit,
  value,
  data,
  token,
  exchanger,
  exchangeRate,
})
```

## Local Scripts
1. Clone repo
2. `cd script`
3. Follow the instructions in `send.js`, `contract.js`, or `deploy.js`
4. `npm run send`, `npm run contract`, or `npm run deploy`

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