# web3-gear

> Help to interact with Ether Contract

Latest version **1.0.34** (published 2022-09-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install web3-gear
pnpm add web3-gear
yarn add web3-gear
bun add web3-gear
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.34 |
| Published | 2022-09-05 |
| First published | 2022-09-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 101.9 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Author | mingqi@email.com |
| Maintainers | mingqi |
| Keywords | defi, ether, web3 |

## Links

- npm: https://www.npmjs.com/package/web3-gear
- Repository: https://github.com/PercivalZhang/Web3SwissKnife
- Homepage: https://github.com/PercivalZhang/Web3SwissKnife#readme
- Issues: https://github.com/PercivalZhang/Web3SwissKnife/issues
- npm.io page: https://npm.io/package/web3-gear

## Dependencies (8)

- [web3](https://npm.io/package/web3.md) ^1.3.0
- [axios](https://npm.io/package/axios.md) ^0.21.1
- [log4js](https://npm.io/package/log4js.md) ^6.3.0
- [decimal.js](https://npm.io/package/decimal.js.md) ^10.3.1
- [bignumber.js](https://npm.io/package/bignumber.js.md) ^9.0.1
- [node-json-db](https://npm.io/package/node-json-db.md) ^1.3.0
- [web3-eth-accounts](https://npm.io/package/web3-eth-accounts.md) ^1.3.4
- [web3-eth-contract](https://npm.io/package/web3-eth-contract.md) ^1.3.0

## Recent versions

- 1.0.34 (latest) — 2022-09-05
- 1.0.33 — 2022-09-02
- 1.0.32 — 2022-09-02
- 1.0.31 — 2022-09-02
- 1.0.30 — 2022-09-02
- 1.0.29 — 2022-09-02
- 1.0.28 — 2022-09-01
- 1.0.26 — 2022-09-01
- 1.0.25 — 2022-09-01
- 1.0.24 — 2022-09-01
- 1.0.23 — 2022-09-01
- 1.0.22 — 2022-09-01
- 1.0.21 — 2022-09-01
- 1.0.20 — 2022-09-01
- 1.0.19 — 2022-09-01
- … 15 more at https://npm.io/package/web3-gear/versions

## README

# Contract Helper

Help to interact with Ether Contract

# Sub Modules

- contract.helper.ts
  ETH Contract Wrapper
- swap.router.ts
  Swap Router Wrapper
- swiss.knife.ts
  All kinds of tools
- web.factory.ts
  Creat web3 RPC endpoint

# Demo Code

```
import {
  ContractHelper,
  SwissKnife,
  LoggerFactory,
} from "web3-gear";
import { Config } from "./config";

const userAddress = "0x1582B06D8C4b6c5990E2bA951D88A88363DaB891";

const logger = LoggerFactory.getInstance().getLogger("main");

const swissKnife = new SwissKnife(Config.network);

const chef = new ContractHelper(
  Config.contract.masterChef, // 合约地址
  "./BSC/pancake.swap/master.chef.v2.json",
  Config.network
);

const main = async () => {
  const userInfo = await chef.callReadMethod("userInfo", 2, userAddress);
  console.log(userInfo);
  logger.info(`amount: ${userInfo.amount}`);
  const lptDetails = await swissKnife.getPairedLPTokenDetails(
    Config.contract.lpToken
  );
  console.log(lptDetails);
};

main().catch((e) => {
  console.error(e.message);
});

```

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