# eos-service

> Simple wrapper to [eosjs](https://github.com/EOSIO/eosjs). Make it easier to send transaction.

Latest version **0.1.1** (published 2019-01-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install eos-service
pnpm add eos-service
yarn add eos-service
bun add eos-service
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2019-01-04 |
| First published | 2018-12-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 6.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | cypher zhong |
| Maintainers | mingmingzi |
| Keywords | eos, eosjs |

## Links

- npm: https://www.npmjs.com/package/eos-service
- Repository: https://github.com/clockknock/eos.service
- Homepage: https://github.com/clockknock/eos.service#readme
- Issues: https://github.com/clockknock/eos.service/issues
- npm.io page: https://npm.io/package/eos-service

## Dependencies (4)

- [eosjs](https://npm.io/package/eosjs.md) ^20.0.0-beta3
- [big.js](https://npm.io/package/big.js.md) ^5.2.2
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.3.0
- [text-encoding](https://npm.io/package/text-encoding.md) latest

## Recent versions

- 0.1.1 (latest) — 2019-01-04
- 0.1.0 — 2019-01-04
- 0.0.4 — 2018-12-31
- 0.0.3 — 2018-12-31
- 0.0.2 — 2018-12-31
- 0.0.1 — 2018-12-31

## README

## EosService

Simple wrapper to [eosjs](https://github.com/EOSIO/eosjs). Make it easier to send transaction and make the function prrettier.

and some actions frequantly used.





### NodeJS Dependency



`npm install eos-service`



### Import

```js
let EosService=require("eos-service");
let NET_CONFIG = {//your net config(test net or main net)
    blockchain: 'eos',
    protocol: 'http',
    host: 'localhost',
    port: 80,
    chainId: 'cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f',
    private_key: "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"//the private key of the actor

};
let eosService = new EosService(NET_CONFIG);

```



### Usage

```js
let data = {
    from: "alice",
    to: "bob",
    quantity: "1.0000 EOS",
    memo: "transfer test"
};
let receipt = await eosService.pushAction("eosio.token", "transfer", "alice", data);
console.info(JSON.stringify(receipt, null, 2), "\n ");

```

and some more util function:

```js
let amount = eosService.assetToAmount("1.0000 EOS");
console.info(JSON.stringify(amount, null, 2), "\n ");//10000

let amount = eosService.assetToAmount("1.0000 SYS", 6);
console.info(JSON.stringify(amount, null, 2), "\n ");//1000000

let symbol = eosService.assetToSymbol("1.0000 EOS");
console.info(JSON.stringify(symbol, null, 2), "\n ");//"EOS"

let amount=eosService.stringToAsset(10000,"EOS");
console.info(JSON.stringify(amount, null, 2),"\n ");//"1.0000 EOS"

let amount=eosService.stringToAsset(3000,"EOS");
console.info(JSON.stringify(amount, null, 2),"\n ");//"0.3000 EOS"

let amount=eosService.stringToAsset(10000,"SYS",6);
console.info(JSON.stringify(amount, null, 2),"\n ");//"0.010000 SYS"
```

more example at [here](https://github.com/clockknock/eos.service/tree/master/example)
and [here](https://github.com/clockknock/eos.service/tree/master/test/index.js)
and my other helpful repository about eos contract at [here](https://github.com/clockknock/eos-contract-wrapper), make we easier to react with eos contract

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