# eos-contract-wrapper

> eos contract wrapper

Latest version **0.0.1** (published 2018-12-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install eos-contract-wrapper
pnpm add eos-contract-wrapper
yarn add eos-contract-wrapper
bun add eos-contract-wrapper
```

## 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.0.1 |
| Published | 2018-12-31 |
| First published | 2018-12-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | cypher zhong |
| Maintainers | mingmingzi |
| Keywords | eos, eosjs, contracts, eos contract |

## Links

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

## Dependencies (5)

- [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
- [eos-service](https://npm.io/package/eos-service.md) 0.0.3
- [text-encoding](https://npm.io/package/text-encoding.md) latest

## Recent versions

- 0.0.1 (latest) — 2018-12-31

## README

## Eos Contract Wrapper

Create eos contract js wrapper, make it easier to call eos contract.



### Usage

#### clone

clone this project and run `npm install`  at project dir.



#### config

Check the `config`  dir:

```js
let config = {
    NET_CONFIG: {
        blockchain: 'eos',
        protocol: 'http',
        host: 'localhost',
        port: 80,
        chainId: 'cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f',
        private_key: "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"
    },
    USE_EOSSERVICE:true,
    CONTRACTS: ["eosio.token"]
};

module.exports = config;
```

this project can create contract wrapper  using `eosjs`'s transact or my other project[ eos.service](https://github.com/clockknock/eos.service)'s transact. If you are using `eosjs`, change `USE_EOSSERVICE:true` to `USE_EOSSERVICE:false`, and add the contract name into `CONTRACTS` after you set code and set abi to your eos chain.



if your want use eosjs's transact,



#### run 

Back to `src`  and then run `index.js`, your contracts will show in `contracts`, after create wrapper, use example at [here](https://github.com/clockknock/eos-contract-wrapper/blob/master/test/test_wrapped_contract.js), just pass your parameter and you can get the transaction receipt.

```js

let EosToken = require('../contracts/eosio.token');

describe('test contract', function () {
    it('test eosio.token transfer', async () => {
        let receipt = await eosToken.transfer("alice", "bob", "1.0000 EOS", "test contract wrapper");
        console.info(JSON.stringify(receipt, null, 2), "\n ");
    });


});
```

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